From 09d3cfa67968eb61e20e3ee4c34ce0cc984cec28 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 18 Dec 2024 00:04:44 +0000 Subject: [PATCH 001/229] 21977 functioning - Services counselor can select counseling office when creating a move --- pkg/gen/ghcapi/configure_mymove.go | 5 + pkg/gen/ghcapi/embedded_spec.go | 132 +++++++++++++++++- pkg/gen/ghcapi/ghcoperations/mymove_api.go | 12 ++ ...sportation_offices_g_b_l_o_cs_responses.go | 2 +- .../show_counseling_offices.go | 58 ++++++++ .../show_counseling_offices_parameters.go | 91 ++++++++++++ .../show_counseling_offices_responses.go | 87 ++++++++++++ .../show_counseling_offices_urlbuilder.go | 101 ++++++++++++++ pkg/gen/ghcmessages/counseling_office.go | 95 +++++++++++++ pkg/gen/ghcmessages/counseling_offices.go | 78 +++++++++++ pkg/gen/ghcmessages/create_orders.go | 21 +++ pkg/handlers/ghcapi/api.go | 5 + .../internal/payloads/model_to_payload.go | 12 ++ pkg/handlers/ghcapi/orders.go | 12 +- pkg/handlers/ghcapi/tranportation_offices.go | 24 ++++ .../Office/AddOrdersForm/AddOrdersForm.jsx | 41 +++++- src/services/ghcApi.js | 4 + swagger-def/ghc.yaml | 47 ++++++- swagger/ghc.yaml | 49 ++++++- 19 files changed, 863 insertions(+), 13 deletions(-) create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go create mode 100644 pkg/gen/ghcmessages/counseling_office.go create mode 100644 pkg/gen/ghcmessages/counseling_offices.go diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go index 4ca4c62707f..5dc14161927 100644 --- a/pkg/gen/ghcapi/configure_mymove.go +++ b/pkg/gen/ghcapi/configure_mymove.go @@ -456,6 +456,11 @@ func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") }) } + if api.TransportationOfficeShowCounselingOfficesHandler == nil { + api.TransportationOfficeShowCounselingOfficesHandler = transportation_office.ShowCounselingOfficesHandlerFunc(func(params transportation_office.ShowCounselingOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.ShowCounselingOffices has not yet been implemented") + }) + } if api.PpmShowPaymentPacketHandler == nil { api.PpmShowPaymentPacketHandler = ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 005d774877f..39b6a4f900a 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6109,7 +6109,7 @@ func init() { "operationId": "getTransportationOfficesGBLOCs", "responses": { "200": { - "description": "Successfully retrieved transportation offices", + "description": "Successfully retrieved GBLOCs", "schema": { "$ref": "#/definitions/GBLOCs" } @@ -6132,6 +6132,40 @@ func init() { } } }, + "/transportation_offices/{dutyLocationId}/counseling_offices": { + "get": { + "description": "Returns the counseling locations matching the GBLOC from the selected duty location", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the counseling locations in the GBLOC matching the duty location", + "operationId": "showCounselingOffices", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved counseling offices", + "schema": { + "$ref": "#/definitions/CounselingOffices" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, "/uploads": { "post": { "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", @@ -6810,6 +6844,30 @@ func init() { } } }, + "CounselingOffice": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "CounselingOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/CounselingOffice" + } + }, "CounselingUpdateAllowancePayload": { "type": "object", "properties": { @@ -7411,6 +7469,12 @@ func init() { "x-nullable": true, "example": true }, + "counseling_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, "departmentIndicator": { "$ref": "#/definitions/DeptIndicator" }, @@ -22610,7 +22674,7 @@ func init() { "operationId": "getTransportationOfficesGBLOCs", "responses": { "200": { - "description": "Successfully retrieved transportation offices", + "description": "Successfully retrieved GBLOCs", "schema": { "$ref": "#/definitions/GBLOCs" } @@ -22648,6 +22712,40 @@ func init() { } } }, + "/transportation_offices/{dutyLocationId}/counseling_offices": { + "get": { + "description": "Returns the counseling locations matching the GBLOC from the selected duty location", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the counseling locations in the GBLOC matching the duty location", + "operationId": "showCounselingOffices", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved counseling offices", + "schema": { + "$ref": "#/definitions/CounselingOffices" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, "/uploads": { "post": { "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", @@ -23342,6 +23440,30 @@ func init() { } } }, + "CounselingOffice": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "CounselingOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/CounselingOffice" + } + }, "CounselingUpdateAllowancePayload": { "type": "object", "properties": { @@ -23947,6 +24069,12 @@ func init() { "x-nullable": true, "example": true }, + "counseling_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, "departmentIndicator": { "$ref": "#/definitions/DeptIndicator" }, diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go index 0809cb3b701..b7b59bf7947 100644 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -301,6 +301,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { PpmShowAOAPacketHandler: ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") }), + TransportationOfficeShowCounselingOfficesHandler: transportation_office.ShowCounselingOfficesHandlerFunc(func(params transportation_office.ShowCounselingOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.ShowCounselingOffices has not yet been implemented") + }), PpmShowPaymentPacketHandler: ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") }), @@ -585,6 +588,8 @@ type MymoveAPI struct { MoveSetFinancialReviewFlagHandler move.SetFinancialReviewFlagHandler // PpmShowAOAPacketHandler sets the operation handler for the show a o a packet operation PpmShowAOAPacketHandler ppm.ShowAOAPacketHandler + // TransportationOfficeShowCounselingOfficesHandler sets the operation handler for the show counseling offices operation + TransportationOfficeShowCounselingOfficesHandler transportation_office.ShowCounselingOfficesHandler // PpmShowPaymentPacketHandler sets the operation handler for the show payment packet operation PpmShowPaymentPacketHandler ppm.ShowPaymentPacketHandler // EvaluationReportsSubmitEvaluationReportHandler sets the operation handler for the submit evaluation report operation @@ -955,6 +960,9 @@ func (o *MymoveAPI) Validate() error { if o.PpmShowAOAPacketHandler == nil { unregistered = append(unregistered, "ppm.ShowAOAPacketHandler") } + if o.TransportationOfficeShowCounselingOfficesHandler == nil { + unregistered = append(unregistered, "transportation_office.ShowCounselingOfficesHandler") + } if o.PpmShowPaymentPacketHandler == nil { unregistered = append(unregistered, "ppm.ShowPaymentPacketHandler") } @@ -1442,6 +1450,10 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } + o.handlers["GET"]["/transportation_offices/{dutyLocationId}/counseling_offices"] = transportation_office.NewShowCounselingOffices(o.context, o.TransportationOfficeShowCounselingOfficesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/payment-packet"] = ppm.NewShowPaymentPacket(o.context, o.PpmShowPaymentPacketHandler) if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go index 309de84d0fa..c630be03fd6 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go @@ -17,7 +17,7 @@ import ( const GetTransportationOfficesGBLOCsOKCode int = 200 /* -GetTransportationOfficesGBLOCsOK Successfully retrieved transportation offices +GetTransportationOfficesGBLOCsOK Successfully retrieved GBLOCs swagger:response getTransportationOfficesGBLOCsOK */ diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go new file mode 100644 index 00000000000..5b4c1967e43 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowCounselingOfficesHandlerFunc turns a function with the right signature into a show counseling offices handler +type ShowCounselingOfficesHandlerFunc func(ShowCounselingOfficesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowCounselingOfficesHandlerFunc) Handle(params ShowCounselingOfficesParams) middleware.Responder { + return fn(params) +} + +// ShowCounselingOfficesHandler interface for that can handle valid show counseling offices params +type ShowCounselingOfficesHandler interface { + Handle(ShowCounselingOfficesParams) middleware.Responder +} + +// NewShowCounselingOffices creates a new http.Handler for the show counseling offices operation +func NewShowCounselingOffices(ctx *middleware.Context, handler ShowCounselingOfficesHandler) *ShowCounselingOffices { + return &ShowCounselingOffices{Context: ctx, Handler: handler} +} + +/* + ShowCounselingOffices swagger:route GET /transportation_offices/{dutyLocationId}/counseling_offices transportationOffice showCounselingOffices + +# Returns the counseling locations in the GBLOC matching the duty location + +Returns the counseling locations matching the GBLOC from the selected duty location +*/ +type ShowCounselingOffices struct { + Context *middleware.Context + Handler ShowCounselingOfficesHandler +} + +func (o *ShowCounselingOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowCounselingOfficesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go new file mode 100644 index 00000000000..24f4c585bfd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowCounselingOfficesParams creates a new ShowCounselingOfficesParams object +// +// There are no default values defined in the spec. +func NewShowCounselingOfficesParams() ShowCounselingOfficesParams { + + return ShowCounselingOfficesParams{} +} + +// ShowCounselingOfficesParams contains all the bound params for the show counseling offices operation +// typically these are obtained from a http.Request +// +// swagger:parameters showCounselingOffices +type ShowCounselingOfficesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the duty location + Required: true + In: path + */ + DutyLocationID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowCounselingOfficesParams() beforehand. +func (o *ShowCounselingOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDutyLocationID, rhkDutyLocationID, _ := route.Params.GetOK("dutyLocationId") + if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDutyLocationID binds and validates parameter DutyLocationID from path. +func (o *ShowCounselingOfficesParams) bindDutyLocationID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("dutyLocationId", "path", "strfmt.UUID", raw) + } + o.DutyLocationID = *(value.(*strfmt.UUID)) + + if err := o.validateDutyLocationID(formats); err != nil { + return err + } + + return nil +} + +// validateDutyLocationID carries on validations for parameter DutyLocationID +func (o *ShowCounselingOfficesParams) validateDutyLocationID(formats strfmt.Registry) error { + + if err := validate.FormatOf("dutyLocationId", "path", "uuid", o.DutyLocationID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go new file mode 100644 index 00000000000..73793566c47 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ShowCounselingOfficesOKCode is the HTTP code returned for type ShowCounselingOfficesOK +const ShowCounselingOfficesOKCode int = 200 + +/* +ShowCounselingOfficesOK Successfully retrieved counseling offices + +swagger:response showCounselingOfficesOK +*/ +type ShowCounselingOfficesOK struct { + + /* + In: Body + */ + Payload ghcmessages.CounselingOffices `json:"body,omitempty"` +} + +// NewShowCounselingOfficesOK creates ShowCounselingOfficesOK with default headers values +func NewShowCounselingOfficesOK() *ShowCounselingOfficesOK { + + return &ShowCounselingOfficesOK{} +} + +// WithPayload adds the payload to the show counseling offices o k response +func (o *ShowCounselingOfficesOK) WithPayload(payload ghcmessages.CounselingOffices) *ShowCounselingOfficesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show counseling offices o k response +func (o *ShowCounselingOfficesOK) SetPayload(payload ghcmessages.CounselingOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.CounselingOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowCounselingOfficesInternalServerErrorCode is the HTTP code returned for type ShowCounselingOfficesInternalServerError +const ShowCounselingOfficesInternalServerErrorCode int = 500 + +/* +ShowCounselingOfficesInternalServerError internal server error + +swagger:response showCounselingOfficesInternalServerError +*/ +type ShowCounselingOfficesInternalServerError struct { +} + +// NewShowCounselingOfficesInternalServerError creates ShowCounselingOfficesInternalServerError with default headers values +func NewShowCounselingOfficesInternalServerError() *ShowCounselingOfficesInternalServerError { + + return &ShowCounselingOfficesInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go new file mode 100644 index 00000000000..1f0e360afa7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowCounselingOfficesURL generates an URL for the show counseling offices operation +type ShowCounselingOfficesURL struct { + DutyLocationID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowCounselingOfficesURL) WithBasePath(bp string) *ShowCounselingOfficesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowCounselingOfficesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowCounselingOfficesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/transportation_offices/{dutyLocationId}/counseling_offices" + + dutyLocationID := o.DutyLocationID.String() + if dutyLocationID != "" { + _path = strings.Replace(_path, "{dutyLocationId}", dutyLocationID, -1) + } else { + return nil, errors.New("dutyLocationId is required on ShowCounselingOfficesURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowCounselingOfficesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowCounselingOfficesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowCounselingOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowCounselingOfficesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowCounselingOfficesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowCounselingOfficesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcmessages/counseling_office.go b/pkg/gen/ghcmessages/counseling_office.go new file mode 100644 index 00000000000..b3bf2fea949 --- /dev/null +++ b/pkg/gen/ghcmessages/counseling_office.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CounselingOffice counseling office +// +// swagger:model CounselingOffice +type CounselingOffice struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // name + // Example: Fort Bragg North Station + // Required: true + Name *string `json:"name"` +} + +// Validate validates this counseling office +func (m *CounselingOffice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CounselingOffice) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CounselingOffice) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this counseling office based on context it is used +func (m *CounselingOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CounselingOffice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CounselingOffice) UnmarshalBinary(b []byte) error { + var res CounselingOffice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/counseling_offices.go b/pkg/gen/ghcmessages/counseling_offices.go new file mode 100644 index 00000000000..28a6d79e3b3 --- /dev/null +++ b/pkg/gen/ghcmessages/counseling_offices.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CounselingOffices counseling offices +// +// swagger:model CounselingOffices +type CounselingOffices []*CounselingOffice + +// Validate validates this counseling offices +func (m CounselingOffices) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this counseling offices based on the context it is used +func (m CounselingOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/create_orders.go b/pkg/gen/ghcmessages/create_orders.go index 25f77f42c15..d253d74c0aa 100644 --- a/pkg/gen/ghcmessages/create_orders.go +++ b/pkg/gen/ghcmessages/create_orders.go @@ -23,6 +23,11 @@ type CreateOrders struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // counseling office id + // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 + // Format: uuid + CounselingOfficeID *strfmt.UUID `json:"counseling_office_id,omitempty"` + // department indicator DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` @@ -100,6 +105,10 @@ type CreateOrders struct { func (m *CreateOrders) Validate(formats strfmt.Registry) error { var res []error + if err := m.validateCounselingOfficeID(formats); err != nil { + res = append(res, err) + } + if err := m.validateDepartmentIndicator(formats); err != nil { res = append(res, err) } @@ -150,6 +159,18 @@ func (m *CreateOrders) Validate(formats strfmt.Registry) error { return nil } +func (m *CreateOrders) validateCounselingOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("counseling_office_id", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + func (m *CreateOrders) validateDepartmentIndicator(formats strfmt.Registry) error { if swag.IsZero(m.DepartmentIndicator) { // not required return nil diff --git a/pkg/handlers/ghcapi/api.go b/pkg/handlers/ghcapi/api.go index 5edc3f7e3ee..b97cd843244 100644 --- a/pkg/handlers/ghcapi/api.go +++ b/pkg/handlers/ghcapi/api.go @@ -641,6 +641,11 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI { transportationOfficeFetcher, } + ghcAPI.TransportationOfficeShowCounselingOfficesHandler = ShowCounselingOfficesHandler{ + handlerConfig, + transportationOfficeFetcher, + } + ghcAPI.MoveUpdateCloseoutOfficeHandler = UpdateMoveCloseoutOfficeHandler{ handlerConfig, closeoutOfficeUpdater, diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index ebfbf27c303..41951384931 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -435,6 +435,18 @@ func GBLOCs(gblocs []string) ghcmessages.GBLOCs { return payload } +func CounselingOffices(counselingOffices models.TransportationOffices) ghcmessages.CounselingOffices { + payload := make(ghcmessages.CounselingOffices, len(counselingOffices)) + + for i, counselingOffice := range counselingOffices { + payload[i] = &ghcmessages.CounselingOffice{ + ID: handlers.FmtUUID(counselingOffice.ID), + Name: models.StringPointer(counselingOffice.Name), + } + } + return payload +} + // MoveHistory payload func MoveHistory(logger *zap.Logger, moveHistory *models.MoveHistory) *ghcmessages.MoveHistory { payload := &ghcmessages.MoveHistory{ diff --git a/pkg/handlers/ghcapi/orders.go b/pkg/handlers/ghcapi/orders.go index 9f0ce28404a..8488bf64db4 100644 --- a/pkg/handlers/ghcapi/orders.go +++ b/pkg/handlers/ghcapi/orders.go @@ -330,15 +330,13 @@ func (h CreateOrderHandler) Handle(params orderop.CreateOrderParams) middleware. Show: models.BoolPointer(true), Status: &status, } - if !appCtx.Session().OfficeUserID.IsNil() { - officeUser, err := models.FetchOfficeUserByID(appCtx.DB(), appCtx.Session().OfficeUserID) + + if payload.CounselingOfficeID != nil { + counselingOffice, err := uuid.FromString(payload.CounselingOfficeID.String()) if err != nil { - err = apperror.NewBadDataError("Unable to fetch office user.") - appCtx.Logger().Error(err.Error()) - return orderop.NewCreateOrderUnprocessableEntity(), err - } else { - moveOptions.CounselingOfficeID = &officeUser.TransportationOfficeID + return handlers.ResponseForError(appCtx.Logger(), err), err } + moveOptions.CounselingOfficeID = &counselingOffice } if newOrder.OrdersType == "SAFETY" { diff --git a/pkg/handlers/ghcapi/tranportation_offices.go b/pkg/handlers/ghcapi/tranportation_offices.go index 405580923bb..6c0dcacc1b6 100644 --- a/pkg/handlers/ghcapi/tranportation_offices.go +++ b/pkg/handlers/ghcapi/tranportation_offices.go @@ -2,6 +2,7 @@ package ghcapi import ( "github.com/go-openapi/runtime/middleware" + "github.com/gofrs/uuid" "go.uber.org/zap" "github.com/transcom/mymove/pkg/appcontext" @@ -73,3 +74,26 @@ func (h GetTransportationOfficesGBLOCsHandler) Handle(params transportationoffic return transportationofficeop.NewGetTransportationOfficesGBLOCsOK().WithPayload(returnPayload), nil }) } + +// ShowCounselingOfficesHandler returns the counseling offices for a duty location ID +type ShowCounselingOfficesHandler struct { + handlers.HandlerConfig + services.TransportationOfficesFetcher +} + +// Handle retrieves the counseling offices in the system for a given duty location ID +func (h ShowCounselingOfficesHandler) Handle(params transportationofficeop.ShowCounselingOfficesParams) middleware.Responder { + return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, + func(appCtx appcontext.AppContext) (middleware.Responder, error) { + dutyLocationID := uuid.FromStringOrNil(params.DutyLocationID.String()) + + counselingOffices, err := h.TransportationOfficesFetcher.GetCounselingOffices(appCtx, dutyLocationID) + if err != nil { + appCtx.Logger().Error("Error searching for Counseling Offices: ", zap.Error(err)) + return transportationofficeop.NewShowCounselingOfficesInternalServerError(), err + } + + returnPayload := payloads.CounselingOffices(*counselingOffices) + return transportationofficeop.NewShowCounselingOfficesOK().WithPayload(returnPayload), nil + }) +} diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index 07949b46c2e..dfc7929d597 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -20,11 +20,13 @@ import Callout from 'components/Callout'; import MaskedTextField from 'components/form/fields/MaskedTextField/MaskedTextField'; import formStyles from 'styles/form.module.scss'; import ConnectedFlashMessage from 'containers/FlashMessage/FlashMessage'; +import { showCounselingOffices } from 'services/ghcApi'; let originMeta; let newDutyMeta = ''; const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isSafetyMoveSelected }) => { const payGradeOptions = dropdownInputOptions(ORDERS_PAY_GRADE_OPTIONS); + const [counselingOfficeOptions, setCounselingOfficeOptions] = useState(null); const [currentDutyLocation, setCurrentDutyLocation] = useState(''); const [newDutyLocation, setNewDutyLocation] = useState(''); const [showAccompaniedTourField, setShowAccompaniedTourField] = useState(false); @@ -69,6 +71,17 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS }, []); useEffect(() => { + if (currentDutyLocation?.id) { + showCounselingOffices(currentDutyLocation.id).then((fetchedData) => { + if (fetchedData.body) { + const counselingOffices = fetchedData.body.map((item) => ({ + key: item.id, + value: item.name, + })); + setCounselingOfficeOptions(counselingOffices); + } + }); + } // Check if either currentDutyLocation or newDutyLocation is OCONUS if (currentDutyLocation?.address?.isOconus || newDutyLocation?.address?.isOconus) { setIsOconusMove(true); @@ -90,11 +103,19 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS return ( - {({ values, isValid, isSubmitting, handleSubmit, touched, setFieldValue }) => { + {({ values, isValid, isSubmitting, handleSubmit, touched, setFieldValue, setValues }) => { const isRetirementOrSeparation = ['RETIREMENT', 'SEPARATION'].includes(values.ordersType); if (!values.origin_duty_location && touched.origin_duty_location) originMeta = 'Required'; else originMeta = null; + const handleCounselingOfficeChange = () => { + setValues({ + ...values, + counseling_office_id: null, + }); + setCounselingOfficeOptions(null); + }; + if (!values.newDutyLocation && touched.newDutyLocation) newDutyMeta = 'Required'; else newDutyMeta = null; const handleHasDependentsChange = (e) => { @@ -133,10 +154,28 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS id="originDutyLocation" onDutyLocationChange={(e) => { setCurrentDutyLocation(e); + handleCounselingOfficeChange(); }} metaOverride={originMeta} required /> + {currentDutyLocation.provides_services_counseling && ( +
+ + +
+ )} {isRetirementOrSeparation ? ( <> diff --git a/src/services/ghcApi.js b/src/services/ghcApi.js index de5d1ea9092..043616613b5 100644 --- a/src/services/ghcApi.js +++ b/src/services/ghcApi.js @@ -754,6 +754,10 @@ export async function getGBLOCs() { return makeGHCRequest(operationPath, {}, { normalize: false }); } +export async function showCounselingOffices(dutyLocationId) { + return makeGHCRequestRaw('transportationOffice.showCounselingOffices', { dutyLocationId }); +} + export const reviewShipmentAddressUpdate = async ({ shipmentID, ifMatchETag, body }) => { const operationPath = 'shipment.reviewShipmentAddressUpdate'; const schemaKey = 'ShipmentAddressUpdate'; diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index b3889e88eab..c9abaf62e5c 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -4012,7 +4012,7 @@ paths: - transportationOffice responses: '200': - description: Successfully retrieved transportation offices + description: Successfully retrieved GBLOCs schema: $ref: '#/definitions/GBLOCs' '400': @@ -4025,6 +4025,29 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' + /transportation_offices/{dutyLocationId}/counseling_offices: + get: + summary: Returns the counseling locations in the GBLOC matching the duty location + description: Returns the counseling locations matching the GBLOC from the selected duty location + operationId: showCounselingOffices + tags: + - transportationOffice + parameters: + - in: path + name: dutyLocationId + format: uuid + type: string + required: true + description: UUID of the duty location + produces: + - application/json + responses: + '200': + description: Successfully retrieved counseling offices + schema: + $ref: '#/definitions/CounselingOffices' + '500': + description: internal server error /uploads: post: summary: Create a new upload @@ -5541,6 +5564,11 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 + counseling_office_id: + type: string + format: uuid + example: cf1addea-a4f9-4173-8506-2bb82a064cb7 + x-nullable: true ordersNumber: type: string title: Orders Number @@ -7638,6 +7666,23 @@ definitions: type: array items: type: string + CounselingOffices: + type: array + items: + $ref: '#/definitions/CounselingOffice' + CounselingOffice: + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + name: + type: string + example: Fort Bragg North Station + required: + - id + - name MovePayload: type: object properties: diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index f37c686f7b8..426b1a3b421 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -4208,7 +4208,7 @@ paths: - transportationOffice responses: '200': - description: Successfully retrieved transportation offices + description: Successfully retrieved GBLOCs schema: $ref: '#/definitions/GBLOCs' '400': @@ -4221,6 +4221,31 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' + /transportation_offices/{dutyLocationId}/counseling_offices: + get: + summary: Returns the counseling locations in the GBLOC matching the duty location + description: >- + Returns the counseling locations matching the GBLOC from the selected + duty location + operationId: showCounselingOffices + tags: + - transportationOffice + parameters: + - in: path + name: dutyLocationId + format: uuid + type: string + required: true + description: UUID of the duty location + produces: + - application/json + responses: + '200': + description: Successfully retrieved counseling offices + schema: + $ref: '#/definitions/CounselingOffices' + '500': + description: internal server error /uploads: post: summary: Create a new upload @@ -5785,6 +5810,11 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 + counselingOfficeId: + type: string + format: uuid + example: cf1addea-a4f9-4173-8506-2bb82a064cb7 + x-nullable: true ordersNumber: type: string title: Orders Number @@ -7982,6 +8012,23 @@ definitions: type: array items: type: string + CounselingOffices: + type: array + items: + $ref: '#/definitions/CounselingOffice' + CounselingOffice: + type: object + properties: + id: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 + name: + type: string + example: Fort Bragg North Station + required: + - id + - name MovePayload: type: object properties: From c61301b553d54c901cdea68ae26577f800212593 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 18 Dec 2024 00:41:54 +0000 Subject: [PATCH 002/229] tests for 21997 --- pkg/handlers/ghcapi/orders_test.go | 1 + .../ghcapi/transportation_offices_test.go | 57 ++++++++++++++++ .../AddOrdersForm/AddOrdersForm.test.jsx | 66 +++++++++++++++++++ 3 files changed, 124 insertions(+) diff --git a/pkg/handlers/ghcapi/orders_test.go b/pkg/handlers/ghcapi/orders_test.go index 93fdc901600..3ace83328be 100644 --- a/pkg/handlers/ghcapi/orders_test.go +++ b/pkg/handlers/ghcapi/orders_test.go @@ -73,6 +73,7 @@ func (suite *HandlerSuite) TestCreateOrder() { Sac: handlers.FmtString("SacNumber"), DepartmentIndicator: ghcmessages.NewDeptIndicator(deptIndicator), Grade: ghcmessages.GradeE1.Pointer(), + CounselingOfficeID: handlers.FmtUUID(*dutyLocation.TransportationOfficeID), } params := orderop.CreateOrderParams{ diff --git a/pkg/handlers/ghcapi/transportation_offices_test.go b/pkg/handlers/ghcapi/transportation_offices_test.go index 92ac98f630b..ef61e931c71 100644 --- a/pkg/handlers/ghcapi/transportation_offices_test.go +++ b/pkg/handlers/ghcapi/transportation_offices_test.go @@ -1,13 +1,16 @@ package ghcapi import ( + "fmt" "net/http/httptest" "github.com/go-openapi/strfmt" "github.com/transcom/mymove/pkg/factory" transportationofficeop "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/transportation_office" + "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services/address" transportationofficeservice "github.com/transcom/mymove/pkg/services/transportation_office" ) @@ -145,3 +148,57 @@ func (suite *HandlerSuite) TestGetTransportationOfficesGBLOCsHandler() { suite.Equal(transportationOffice1.Gbloc, responsePayload.Payload[0]) suite.Equal(transportationOffice2.Gbloc, responsePayload.Payload[1]) } + +func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { + user := factory.BuildDefaultUser(suite.DB()) + + fetcher := transportationofficeservice.NewTransportationOfficesFetcher() + + newAddress := models.Address{ + StreetAddress1: "some address", + City: "city", + State: "CA", + PostalCode: "59801", + County: "County", + } + addressCreator := address.NewAddressCreator() + createdAddress, err := addressCreator.CreateAddress(suite.AppContextForTest(), &newAddress) + suite.NoError(err) + + origDutyLocation := factory.BuildDutyLocation(suite.DB(), []factory.Customization{ + { + Model: models.DutyLocation{ + AddressID: createdAddress.ID, + ProvidesServicesCounseling: true, + }, + }, + { + Model: models.TransportationOffice{ + Name: "PPPO Travis AFB - USAF", + Gbloc: "KKFA", + ProvidesCloseout: true, + }, + }, + }, nil) + suite.MustSave(&origDutyLocation) + + path := fmt.Sprintf("/transportation_offices/%v/counseling_offices", origDutyLocation.ID.String()) + req := httptest.NewRequest("GET", path, nil) + req = suite.AuthenticateUserRequest(req, user) + params := transportationofficeop.ShowCounselingOfficesParams{ + HTTPRequest: req, + DutyLocationID: *handlers.FmtUUID(origDutyLocation.ID), + } + + handler := ShowCounselingOfficesHandler{ + HandlerConfig: suite.HandlerConfig(), + TransportationOfficesFetcher: fetcher} + + response := handler.Handle(params) + suite.Assertions.IsType(&transportationofficeop.ShowCounselingOfficesOK{}, response) + responsePayload := response.(*transportationofficeop.ShowCounselingOfficesOK) + + // Validate outgoing payload + suite.NoError(responsePayload.Payload.Validate(strfmt.Default)) + +} diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index f6c4f04e22f..f09c075ea29 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -75,10 +75,44 @@ jest.mock('components/LocationSearchBox/api', () => ({ name: 'Luke AFB', updated_at: '2021-02-11T16:48:04.117Z', }, + { + address: { + city: '', + id: '25be4d12-fe93-47f1-bbec-1db386dfa67e', + postalCode: '', + state: '', + streetAddress1: '', + }, + address_id: '4334640b-c35e-4293-a2f1-36c7b629f904', + affiliation: 'AIR_FORCE', + created_at: '2021-02-11T16:48:04.117Z', + id: '22f0755f-6f35-478b-9a75-35a69211da1d', + name: 'Scott AFB', + updated_at: '2021-02-11T16:48:04.117Z', + provides_services_counseling: true, + }, ]), ), })); +jest.mock('services/ghcApi', () => ({ + ...jest.requireActual('services/ghcApi'), + showCounselingOffices: jest.fn().mockImplementation(() => + Promise.resolve({ + body: [ + { + id: '3e937c1f-5539-4919-954d-017989130584', + name: 'Albuquerque AFB', + }, + { + id: 'fa51dab0-4553-4732-b843-1f33407f77bc', + name: 'Glendale Luke AFB', + }, + ], + }), + ), +})); + jest.mock('utils/featureFlags', () => ({ ...jest.requireActual('utils/featureFlags'), isBooleanFlagEnabled: jest.fn().mockImplementation(() => Promise.resolve(false)), @@ -96,6 +130,7 @@ const initialValues = { accompaniedTour: '', dependentsUnderTwelve: '', dependentsTwelveAndOver: '', + counselingOfficeId: '', }; const testProps = { initialValues, @@ -194,3 +229,34 @@ describe('AddOrdersForm - OCONUS and Accompanied Tour Test', () => { }); }); }); + +describe('AddOrdersForm - With Counseling Office', () => { + it('displays the counseling office dropdown', async () => { + isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); + render( + + + , + ); + + await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); + await userEvent.type(screen.getByLabelText(/Orders date/), '08 Nov 2020'); + await userEvent.type(screen.getByLabelText(/Report by date/), '26 Nov 2020'); + await userEvent.click(screen.getByLabelText('No')); + await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']); + + // Test Current Duty Location Search Box interaction + await userEvent.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 100 }); + const selectedOptionCurrent = await screen.findByText(/Scott/); + await userEvent.click(selectedOptionCurrent); + + // Test New Duty Location Search Box interaction + await userEvent.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 100 }); + const selectedOptionNew = await screen.findByText(/Luke/); + await userEvent.click(selectedOptionNew); + + await waitFor(() => { + expect(screen.getByLabelText(/Counseling office/)); + }); + }); +}); From fdb8347bcddc31b77030a4e8820f7f53894c03bc Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 18 Dec 2024 15:50:38 +0000 Subject: [PATCH 003/229] expand 21997 tests --- pkg/gen/ghcapi/embedded_spec.go | 4 +- pkg/gen/ghcmessages/create_orders.go | 6 +-- .../Office/AddOrdersForm/AddOrdersForm.jsx | 3 +- .../ServicesCounselingAddOrders.test.jsx | 45 +++++++++++++++++++ swagger-def/ghc.yaml | 2 +- 5 files changed, 53 insertions(+), 7 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 39b6a4f900a..cbe49f80e17 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -7469,7 +7469,7 @@ func init() { "x-nullable": true, "example": true }, - "counseling_office_id": { + "counselingOfficeId": { "type": "string", "format": "uuid", "x-nullable": true, @@ -24069,7 +24069,7 @@ func init() { "x-nullable": true, "example": true }, - "counseling_office_id": { + "counselingOfficeId": { "type": "string", "format": "uuid", "x-nullable": true, diff --git a/pkg/gen/ghcmessages/create_orders.go b/pkg/gen/ghcmessages/create_orders.go index d253d74c0aa..a71a85a4d74 100644 --- a/pkg/gen/ghcmessages/create_orders.go +++ b/pkg/gen/ghcmessages/create_orders.go @@ -23,10 +23,10 @@ type CreateOrders struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // counseling office id + // counseling office Id // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 // Format: uuid - CounselingOfficeID *strfmt.UUID `json:"counseling_office_id,omitempty"` + CounselingOfficeID *strfmt.UUID `json:"counselingOfficeId,omitempty"` // department indicator DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` @@ -164,7 +164,7 @@ func (m *CreateOrders) validateCounselingOfficeID(formats strfmt.Registry) error return nil } - if err := validate.FormatOf("counseling_office_id", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { + if err := validate.FormatOf("counselingOfficeId", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { return err } diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index dfc7929d597..c16b00fc1d6 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -111,7 +111,7 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS const handleCounselingOfficeChange = () => { setValues({ ...values, - counseling_office_id: null, + counselingOfficeId: null, }); setCounselingOfficeOptions(null); }; @@ -170,6 +170,7 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS label="Counseling office" name="counselingOfficeId" id="counselingOfficeId" + data-testid="counselingOfficeSelect" hint="Required" required options={counselingOfficeOptions} diff --git a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx index eb57eefb665..7677573f6c2 100644 --- a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; +import { debug } from 'jest-preview'; import ServicesCounselingAddOrders from './ServicesCounselingAddOrders'; @@ -23,6 +24,20 @@ jest.mock('utils/featureFlags', () => ({ jest.mock('services/ghcApi', () => ({ ...jest.requireActual('services/ghcApi'), counselingCreateOrder: jest.fn().mockImplementation(() => Promise.resolve()), + showCounselingOffices: jest.fn().mockImplementation(() => + Promise.resolve({ + body: [ + { + id: '3e937c1f-5539-4919-954d-017989130584', + name: 'Albuquerque AFB', + }, + { + id: 'fa51dab0-4553-4732-b843-1f33407f77bc', + name: 'Glendale Luke AFB', + }, + ], + }), + ), })); jest.mock('services/internalApi', () => ({ @@ -79,6 +94,7 @@ jest.mock('components/LocationSearchBox/api', () => ({ id: '7d123884-7c1b-4611-92ae-e8d43ca03ad9', name: 'Hill AFB', updated_at: '2021-02-11T16:48:04.117Z', + provides_services_counseling: true, }, { address: { @@ -362,6 +378,7 @@ describe('ServicesCounselingAddOrders component', () => { expect(nextBtn).toBeEnabled(); }); + // debug(); await userEvent.click(nextBtn); await waitFor(() => { @@ -370,6 +387,34 @@ describe('ServicesCounselingAddOrders component', () => { }); }); + it('Displays the counseling office dropdown', async () => { + renderWithMocks(); + + counselingCreateOrder.mockImplementation(() => Promise.resolve(fakeResponse)); + + const user = userEvent.setup(); + + await user.selectOptions(screen.getByLabelText('Orders type'), 'PERMANENT_CHANGE_OF_STATION'); + await user.type(screen.getByLabelText('Orders date'), '08 Nov 2020'); + await user.type(screen.getByLabelText('Report by date'), '29 Nov 2020'); + await user.click(screen.getByLabelText('No')); + await user.selectOptions(screen.getByLabelText('Pay grade'), ['E-5']); + + // Test Current Duty Location Search Box interaction + await user.type(screen.getByLabelText('Current duty location'), 'AFB', { delay: 500 }); + const selectedOptionCurrent = await screen.findByText(/Hill/); + await user.click(selectedOptionCurrent); + + await waitFor(async () => { + expect(screen.getByLabelText(/Counseling office/)); + }); + + await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); + const selectedOptionNew = await screen.findByText(/Luke/); + await user.click(selectedOptionNew); + debug(); + }); + it('routes to the move details page when the next button is clicked for OCONUS orders', async () => { isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); renderWithMocks(); diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index c9abaf62e5c..5c60482d05e 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -5564,7 +5564,7 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 - counseling_office_id: + counselingOfficeId: type: string format: uuid example: cf1addea-a4f9-4173-8506-2bb82a064cb7 From 4c9b0ca61b19bf02d78ad46a46e32dad0a00018e Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 19 Dec 2024 15:18:57 +0000 Subject: [PATCH 004/229] removed jest debugs and added no counseling office test case --- .../Office/AddOrdersForm/AddOrdersForm.test.jsx | 8 +++++--- .../ServicesCounselingAddOrders.test.jsx | 11 +++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index f09c075ea29..ed9a856cdfa 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -208,6 +208,9 @@ describe('AddOrdersForm - OCONUS and Accompanied Tour Test', () => { const selectedOptionCurrent = await screen.findByText(/Elmendorf/); await userEvent.click(selectedOptionCurrent); + const counselingOfficeLabel = await screen.queryByText(/Counseling office/); + expect(counselingOfficeLabel).toBeFalsy(); + // Test New Duty Location Search Box interaction await userEvent.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 100 }); const selectedOptionNew = await screen.findByText(/Luke/); @@ -255,8 +258,7 @@ describe('AddOrdersForm - With Counseling Office', () => { const selectedOptionNew = await screen.findByText(/Luke/); await userEvent.click(selectedOptionNew); - await waitFor(() => { - expect(screen.getByLabelText(/Counseling office/)); - }); + const counselingOfficeLabel = await screen.queryByText(/Counseling office/); + expect(counselingOfficeLabel).toBeTruthy(); }); }); diff --git a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx index 7677573f6c2..497ebcbe081 100644 --- a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx @@ -1,7 +1,6 @@ import React from 'react'; import { render, screen, waitFor } from '@testing-library/react'; import userEvent from '@testing-library/user-event'; -import { debug } from 'jest-preview'; import ServicesCounselingAddOrders from './ServicesCounselingAddOrders'; @@ -369,6 +368,9 @@ describe('ServicesCounselingAddOrders component', () => { const selectedOptionCurrent = await screen.findByText(/Altus/); await user.click(selectedOptionCurrent); + const counselingOfficeLabel = await screen.queryByText(/Counseling office/); + expect(counselingOfficeLabel).toBeFalsy(); + await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Luke/); await user.click(selectedOptionNew); @@ -378,7 +380,6 @@ describe('ServicesCounselingAddOrders component', () => { expect(nextBtn).toBeEnabled(); }); - // debug(); await userEvent.click(nextBtn); await waitFor(() => { @@ -405,14 +406,12 @@ describe('ServicesCounselingAddOrders component', () => { const selectedOptionCurrent = await screen.findByText(/Hill/); await user.click(selectedOptionCurrent); - await waitFor(async () => { - expect(screen.getByLabelText(/Counseling office/)); - }); + const counselingOfficeLabel = await screen.queryByText(/Counseling office/); + expect(counselingOfficeLabel).toBeTruthy(); await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Luke/); await user.click(selectedOptionNew); - debug(); }); it('routes to the move details page when the next button is clicked for OCONUS orders', async () => { From d308a38c80a52b9e83e80a583a47b5e24e8a82eb Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 20 Dec 2024 15:43:41 +0000 Subject: [PATCH 005/229] Added counseling office to move payload --- pkg/gen/ghcapi/embedded_spec.go | 18 +++++ pkg/gen/ghcmessages/move.go | 71 +++++++++++++++++++ .../internal/payloads/model_to_payload.go | 2 + pkg/services/move/move_fetcher.go | 2 +- swagger-def/ghc.yaml | 7 ++ swagger/ghc.yaml | 9 +++ 6 files changed, 108 insertions(+), 1 deletion(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index cbe49f80e17..183609a41ca 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -9980,6 +9980,15 @@ func init() { "format": "uuid", "x-nullable": true }, + "counselingOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "counselingOfficeId": { + "description": "The transportation office that will handle services counseling for this move", + "type": "string", + "format": "uuid", + "x-nullable": true + }, "createdAt": { "type": "string", "format": "date-time" @@ -26580,6 +26589,15 @@ func init() { "format": "uuid", "x-nullable": true }, + "counselingOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "counselingOfficeId": { + "description": "The transportation office that will handle services counseling for this move", + "type": "string", + "format": "uuid", + "x-nullable": true + }, "createdAt": { "type": "string", "format": "date-time" diff --git a/pkg/gen/ghcmessages/move.go b/pkg/gen/ghcmessages/move.go index bb67e748b11..c647b3c7764 100644 --- a/pkg/gen/ghcmessages/move.go +++ b/pkg/gen/ghcmessages/move.go @@ -61,6 +61,13 @@ type Move struct { // Format: uuid ContractorID *strfmt.UUID `json:"contractorId,omitempty"` + // counseling office + CounselingOffice *TransportationOffice `json:"counselingOffice,omitempty"` + + // The transportation office that will handle services counseling for this move + // Format: uuid + CounselingOfficeID *strfmt.UUID `json:"counselingOfficeId,omitempty"` + // created at // Format: date-time CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` @@ -193,6 +200,14 @@ func (m *Move) Validate(formats strfmt.Registry) error { res = append(res, err) } + if err := m.validateCounselingOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCounselingOfficeID(formats); err != nil { + res = append(res, err) + } + if err := m.validateCreatedAt(formats); err != nil { res = append(res, err) } @@ -441,6 +456,37 @@ func (m *Move) validateContractorID(formats strfmt.Registry) error { return nil } +func (m *Move) validateCounselingOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if m.CounselingOffice != nil { + if err := m.CounselingOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counselingOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counselingOffice") + } + return err + } + } + + return nil +} + +func (m *Move) validateCounselingOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("counselingOfficeId", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + func (m *Move) validateCreatedAt(formats strfmt.Registry) error { if swag.IsZero(m.CreatedAt) { // not required return nil @@ -661,6 +707,10 @@ func (m *Move) ContextValidate(ctx context.Context, formats strfmt.Registry) err res = append(res, err) } + if err := m.contextValidateCounselingOffice(ctx, formats); err != nil { + res = append(res, err) + } + if err := m.contextValidateFinancialReviewFlag(ctx, formats); err != nil { res = append(res, err) } @@ -817,6 +867,27 @@ func (m *Move) contextValidateContractor(ctx context.Context, formats strfmt.Reg return nil } +func (m *Move) contextValidateCounselingOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CounselingOffice != nil { + + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if err := m.CounselingOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counselingOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counselingOffice") + } + return err + } + } + + return nil +} + func (m *Move) contextValidateFinancialReviewFlag(ctx context.Context, formats strfmt.Registry) error { if err := validate.ReadOnly(ctx, "financialReviewFlag", "body", bool(m.FinancialReviewFlag)); err != nil { diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 6d1dd799115..c15657f6966 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -120,6 +120,8 @@ func Move(move *models.Move, storer storage.FileStorer) (*ghcmessages.Move, erro SCAssignedUser: AssignedOfficeUser(move.SCAssignedUser), TOOAssignedUser: AssignedOfficeUser(move.TOOAssignedUser), TIOAssignedUser: AssignedOfficeUser(move.TIOAssignedUser), + CounselingOfficeID: handlers.FmtUUIDPtr(move.CounselingOfficeID), + CounselingOffice: TransportationOffice(move.CounselingOffice), } return payload, nil diff --git a/pkg/services/move/move_fetcher.go b/pkg/services/move/move_fetcher.go index 470f4ca78a4..a75cf4ece2a 100644 --- a/pkg/services/move/move_fetcher.go +++ b/pkg/services/move/move_fetcher.go @@ -25,7 +25,7 @@ func (f moveFetcher) FetchMove(appCtx appcontext.AppContext, locator string, sea move := &models.Move{} query := appCtx.DB(). EagerPreload("CloseoutOffice.Address", "Contractor", "ShipmentGBLOC", "LockedByOfficeUser", "LockedByOfficeUser.TransportationOffice", "AdditionalDocuments", - "AdditionalDocuments.UserUploads"). + "AdditionalDocuments.UserUploads", "CounselingOffice"). LeftJoin("move_to_gbloc", "move_to_gbloc.move_id = moves.id"). LeftJoin("office_users", "office_users.id = moves.locked_by"). Where("locator = $1", locator) diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 5c60482d05e..2bf80c888f8 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -5147,6 +5147,13 @@ definitions: format: uuid description: The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members x-nullable: true + counselingOffice: + $ref: 'definitions/TransportationOffice.yaml' + counselingOfficeId: + type: string + format: uuid + description: The transportation office that will handle services counseling for this move + x-nullable: true approvalsRequestedAt: type: string format: date-time diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 426b1a3b421..c4b0c22900d 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5379,6 +5379,15 @@ definitions: The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members x-nullable: true + counselingOffice: + $ref: '#/definitions/TransportationOffice' + counselingOfficeId: + type: string + format: uuid + description: >- + The transportation office that will handle services counseling for + this move + x-nullable: true approvalsRequestedAt: type: string format: date-time From b35066b5844555b9a2d0df72c857f7b247f26101 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 20 Dec 2024 17:23:33 +0000 Subject: [PATCH 006/229] update counseling office selction instructions --- src/components/Office/AddOrdersForm/AddOrdersForm.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index c16b00fc1d6..87ef797e81c 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -162,9 +162,9 @@ const AddOrdersForm = ({ onSubmit, ordersTypeOptions, initialValues, onBack, isS {currentDutyLocation.provides_services_counseling && (
Date: Tue, 7 Jan 2025 08:44:29 -0600 Subject: [PATCH 007/229] Update Meridian MS 39302 duty loc --- migrations/app/migrations_manifest.txt | 1 + ...06202424_insert_transportation_offices_meridian_ms.up.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index a31d11f3f55..534dfbd97dc 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1060,3 +1060,4 @@ 20241227153723_remove_empty_string_emplid_values.up.sql 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql +20250106202424_insert_transportation_offices_meridian_ms.up.sql \ No newline at end of file diff --git a/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql b/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql new file mode 100644 index 00000000000..167ccf316e3 --- /dev/null +++ b/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql @@ -0,0 +1,5 @@ +--update duty location for NAS Meridian, MS to use zip 39309 +update duty_locations set name = 'NAS Meridian, MS 39309', address_id = '691551c2-71fe-4a15-871f-0c46dff98230' where id = '334fecaf-abeb-49ce-99b5-81d69c8beae5'; + +--remove 39302 duty location +delete from duty_locations where id = 'e55be32c-bf89-4927-8893-4454a26bfd55'; From 31fd3717a5b65e093b9ab78d62450685e7d628d3 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Tue, 7 Jan 2025 17:08:30 +0000 Subject: [PATCH 008/229] B-21934 --- migrations/app/migrations_manifest.txt | 4 +- ...0106153750_admin_weight_restriction.up.sql | 6 + ...min_weight_restriction_convert_bool.up.sql | 4 + pkg/gen/ghcapi/embedded_spec.go | 28 + .../counseling_update_allowance_payload.go | 3 + pkg/gen/ghcmessages/entitlements.go | 4 + .../ghcmessages/update_allowance_payload.go | 3 + pkg/gen/primeapi/embedded_spec.go | 8 + pkg/gen/primemessages/entitlements.go | 4 + pkg/gen/primev2api/embedded_spec.go | 8 + pkg/gen/primev2messages/entitlements.go | 4 + pkg/gen/primev3api/embedded_spec.go | 8 + pkg/gen/primev3messages/entitlements.go | 4 + pkg/gen/supportapi/embedded_spec.go | 8 + pkg/gen/supportmessages/entitlement.go | 4 + .../internal/payloads/model_to_payload.go | 6 +- .../primeapi/payloads/model_to_payload.go | 1 + .../primeapiv2/payloads/model_to_payload.go | 1 + pkg/models/ghc_entitlements.go | 1 + pkg/services/order/order_updater.go | 8 + .../AllowancesDetailForm.jsx | 22 +- .../AllowancesDetailForm.test.jsx | 37 + .../Office/DefinitionLists/AllowancesList.jsx | 8 + .../MoveHistory/Database/BooleanFields.js | 1 + .../MoveHistory/Database/FieldMappings.js | 1 + .../Office/MoveAllowances/MoveAllowances.jsx | 4 + src/pages/Office/MoveDetails/MoveDetails.jsx | 1 + .../ServicesCounselingMoveAllowances.jsx | 4 + .../ServicesCounselingMoveDetails.jsx | 1 + .../definitions/prime/Entitlements.yaml | 3 + swagger-def/ghc.yaml | 3225 +++++++++-------- swagger-def/support.yaml | 3 + swagger/ghc.yaml | 15 + swagger/prime.yaml | 3 + swagger/prime_v2.yaml | 3 + swagger/prime_v3.yaml | 3 + swagger/support.yaml | 3 + 37 files changed, 1854 insertions(+), 1600 deletions(-) create mode 100644 migrations/app/schema/20250106153750_admin_weight_restriction.up.sql create mode 100644 migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 18c13cdaa73..ffaf109d530 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1052,10 +1052,12 @@ 20241203024453_add_ppm_max_incentive_column.up.sql 20241204155919_update_ordering_proc.up.sql 20241204210208_retroactive_update_of_ppm_max_and_estimated_incentives_prd.up.sql -20241218201833_add_PPPO_BASE_ELIZABETH.up.sql 20241217163231_update_duty_locations_bad_zips.up.sql 20241217180136_add_AK_zips_to_zip3_distances.up.sql +20241218201833_add_PPPO_BASE_ELIZABETH.up.sql 20241220171035_add_additional_AK_zips_to_zip3_distances.up.sql 20241227153723_remove_empty_string_emplid_values.up.sql 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql +20250106153750_admin_weight_restriction.up.sql +20250106190758_admin_weight_restriction_convert_bool.up.sql diff --git a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql new file mode 100644 index 00000000000..a3e6e097e45 --- /dev/null +++ b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql @@ -0,0 +1,6 @@ +ALTER TABLE entitlements +ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; + +-- ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), +-- ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, +-- ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file diff --git a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql new file mode 100644 index 00000000000..f8f923c0ae7 --- /dev/null +++ b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql @@ -0,0 +1,4 @@ +ALTER TABLE entitlements + ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), + ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, + ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 361f666c222..a0183a05515 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6862,6 +6862,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -8043,6 +8048,10 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -13790,6 +13799,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -23602,6 +23616,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -24787,6 +24806,10 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -30662,6 +30685,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index d6bed9fac0c..c1a0ce9f418 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -23,6 +23,9 @@ type CounselingUpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // Indicates if the customer is restricted to a specific location for their admin restricted weight. + AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` + // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 2ee15f3d03a..7699f3be0e3 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -23,6 +23,10 @@ type Entitlements struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index ee0d677c0e7..0a63d9b9fa9 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -23,6 +23,9 @@ type UpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // Indicates if the customer is restricted to a specific location for their admin restricted weight. + AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` + // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 52039d783cc..5df9a70d690 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1730,6 +1730,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -6624,6 +6628,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index c51ada24273..a1e606a00aa 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index f0468e10884..849b5f6783b 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -966,6 +966,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -4573,6 +4577,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index e29d3f733e3..b39c4b64fd8 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index bb5a844cfe0..b5fc1983191 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1128,6 +1128,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -5382,6 +5386,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index 1e228c6350f..d642d70f69b 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 31eea1917ec..c50b1a37c98 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1110,6 +1110,10 @@ func init() { "Entitlement": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -3977,6 +3981,10 @@ func init() { "Entitlement": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 434ad8aeed3..4ae036d582c 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlement type Entitlement struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index caa4aef11d5..482074aa402 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -717,6 +717,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { } requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) gunSafe := entitlement.GunSafe + adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation var accompaniedTour *bool if entitlement.AccompaniedTour != nil { accompaniedTour = models.BoolPointer(*entitlement.AccompaniedTour) @@ -750,8 +751,9 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { AccompaniedTour: accompaniedTour, UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - GunSafe: gunSafe, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + GunSafe: gunSafe, + AdminRestrictedWeightLocation: adminRestrictedWeightLocation, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index d5c76723fa4..57ae9b12a4b 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -217,6 +217,7 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, + AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 56ad6caabcb..2ece0f55833 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -162,6 +162,7 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, + AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index 383caada3a7..7497291cb8c 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -31,6 +31,7 @@ type Entitlement struct { OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` + AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` } diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 38c991a112a..323bd7a0592 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -456,6 +456,10 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.GunSafe = *payload.GunSafe } + if payload.AdminRestrictedWeightLocation != nil { + order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } @@ -556,6 +560,10 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.GunSafe = *payload.GunSafe } + if payload.AdminRestrictedWeightLocation != nil { + order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 94d8bcc2dc3..edc345478ea 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,6 +20,8 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(false); + useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -164,8 +166,26 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab isDisabled={formIsDisabled} />
+
+ setIsAdminWeightLocationChecked(e.target.checked)} + /> + {isAdminWeightLocationChecked && ( + + )} +
-
Weight allowance
+
Standard Weight allowance
{formatWeight(entitlements.totalWeight)}
diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx index 503ab865df3..fcf825bd404 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx @@ -159,3 +159,40 @@ describe('AllowancesDetailForm', () => { expect(screen.queryByLabelText(/Number of dependents of the age 12 or over/)).toBeInTheDocument(); }); }); +describe('AllowancesDetailForm additional tests', () => { + it('renders gun safe checkbox field', async () => { + render( + + + , + ); + + expect(await screen.findByTestId('gunSafeInput')).toBeInTheDocument(); + }); + + it('renders admin weight location section with conditional weight restriction field', async () => { + render( + + + , + ); + + const adminWeightCheckbox = await screen.findByTestId('adminWeightLocation'); + expect(adminWeightCheckbox).toBeInTheDocument(); + expect(screen.queryByTestId('weightRestrictionInput')).not.toBeInTheDocument(); + await act(async () => { + adminWeightCheckbox.click(); + }); + expect(screen.getByTestId('weightRestrictionInput')).toBeInTheDocument(); + }); + + it('displays the total weight allowance correctly', async () => { + render( + + + , + ); + + expect(await screen.findByTestId('weightAllowance')).toHaveTextContent('11,000'); + }); +}); diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 3d5c1e850cc..3e0cf3dd93d 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -104,6 +104,14 @@ const AllowancesList = ({ info, showVisualCues }) => {
Gun Safe
{info.gunSafe ? 'Authorized' : 'Unauthorized'}
+
+
Admin Restricted Weight Location
+
{info.adminRestrictedWeightLocation ? 'Yes' : 'No'}
+
+
+
Weight Restriction
+
-
+
); diff --git a/src/constants/MoveHistory/Database/BooleanFields.js b/src/constants/MoveHistory/Database/BooleanFields.js index 91654232fd0..6dc78506343 100644 --- a/src/constants/MoveHistory/Database/BooleanFields.js +++ b/src/constants/MoveHistory/Database/BooleanFields.js @@ -12,6 +12,7 @@ export default { missing_receipt: 'missing_receipt', organizational_clothing_and_individual_equipment: 'organizational_clothing_and_individual_equipment', gun_safe: 'gun_safe', + admin_restricted_weight_location: 'admin_restricted_weight_location', email_is_preferred: 'email_is_preferred', phone_is_preferred: 'phone_is_preferred', uses_external_vendor: 'uses_external_vendor', diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 737df5b08ae..1b216087f52 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -39,6 +39,7 @@ export default { required_medical_equipment_weight: 'Required medical equipment', organizational_clothing_and_individual_equipment: 'OCIE', gun_safe: 'Gun Safe', + admin_restricted_weight_location: 'Admin restricted weight location', requested_pickup_date: 'Requested pickup date', grade: 'Pay grade', shipment_type: 'Shipment type', diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 9adf62bdc39..1412c39c972 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -98,6 +98,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -118,6 +119,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit: Number(storageInTransit), gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -133,6 +135,7 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -148,6 +151,7 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit: `${storageInTransit}`, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index d47156e3dc0..49209ee870b 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -410,6 +410,7 @@ const MoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, + adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 98a85147767..c954518334c 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -86,6 +86,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -106,6 +107,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: Number(storageInTransit), organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -121,6 +123,7 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -136,6 +139,7 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, storageInTransit: `${storageInTransit}`, gunSafe, + adminRestrictedWeightLocation, organizationalClothingAndIndividualEquipment, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 82e50380a2f..da6d6a2a34d 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -387,6 +387,7 @@ const ServicesCounselingMoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, + adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 5722870f9d7..8a95dccf41c 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -21,6 +21,9 @@ properties: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index a0df07f3800..c39682a8598 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -1,4 +1,4 @@ -swagger: '2.0' +swagger: "2.0" info: contact: email: milmove-developers@caci.com @@ -6,7 +6,7 @@ info: $ref: info/ghc_description.md license: name: MIT - url: 'https://opensource.org/licenses/MIT' + url: "https://opensource.org/licenses/MIT" title: MilMove GHC API version: 0.0.1 basePath: /ghc/v1 @@ -15,7 +15,7 @@ schemes: tags: - name: queues - name: move - - $ref: 'tags/order.yaml' + - $ref: "tags/order.yaml" - name: moveTaskOrder - name: customer - name: mtoServiceItem @@ -31,7 +31,7 @@ tags: - name: paymentRequests - name: reServiceItems paths: - '/customer': + "/customer": post: summary: Creates a customer with Okta option description: Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting. @@ -47,28 +47,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/CreateCustomerPayload' + $ref: "#/definitions/CreateCustomerPayload" responses: - '200': + "200": description: successfully created the customer schema: - $ref: '#/definitions/CreatedCustomer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/CreatedCustomer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /open/requested-office-users: post: consumes: @@ -92,19 +92,19 @@ paths: name: officeUser description: Office User information schema: - $ref: '#/definitions/OfficeUserCreate' + $ref: "#/definitions/OfficeUserCreate" responses: - '201': + "201": description: successfully requested the creation of provided office user schema: - $ref: '#/definitions/OfficeUser' - '422': + $ref: "#/definitions/OfficeUser" + "422": description: validation error schema: - $ref: '#/definitions/ValidationError' - '500': + $ref: "#/definitions/ValidationError" + "500": description: internal server error - '/customer/{customerID}': + "/customer/{customerID}": parameters: - description: ID of customer to use in: path @@ -117,20 +117,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved information on an individual customer schema: - $ref: '#/definitions/Customer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Customer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - customer description: Returns a given customer @@ -151,30 +151,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateCustomerPayload' + $ref: "#/definitions/UpdateCustomerPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Customer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Customer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.customer /customer/search: @@ -223,22 +223,30 @@ paths: sort: type: string x-nullable: true - enum: [customerName, edipi, emplid, branch, personalEmail, telephone] + enum: + [ + customerName, + edipi, + emplid, + branch, + personalEmail, + telephone, + ] order: type: string x-nullable: true enum: [asc, desc] description: field that results should be sorted by responses: - '200': + "200": description: Successfully returned all customers matching the criteria schema: - $ref: '#/definitions/SearchCustomersResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' - '/move/{locator}': + $ref: "#/definitions/SearchCustomersResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" + "/move/{locator}": parameters: - description: Code used to identify a move in the system in: path @@ -250,26 +258,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved the individual move schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns a given move for a unique alphanumeric locator string summary: Returns a given move operationId: getMove - '/move/{locator}/history': + "/move/{locator}/history": parameters: - description: Code used to identify a move in the system in: path @@ -289,26 +297,26 @@ paths: type: integer description: results per page responses: - '200': + "200": description: Successfully retrieved the individual move history schema: - $ref: '#/definitions/MoveHistoryResult' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MoveHistoryResult" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns the history for a given move for a unique alphanumeric locator string summary: Returns the history of an identified move operationId: getMoveHistory - '/moves/{moveID}/shipment-evaluation-reports-list': + "/moves/{moveID}/shipment-evaluation-reports-list": parameters: - description: Code used to identify a move in the system in: path @@ -320,26 +328,26 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the move's evaluation reports schema: - $ref: '#/definitions/EvaluationReportList' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReportList" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns shipment evaluation reports for the specified move that are visible to the current office user summary: Returns shipment evaluation reports for the specified move that are visible to the current office user operationId: getMoveShipmentEvaluationReportsList - '/moves/{moveID}/counseling-evaluation-reports-list': + "/moves/{moveID}/counseling-evaluation-reports-list": parameters: - description: Code used to identify a move in the system in: path @@ -351,26 +359,26 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the move's evaluation reports schema: - $ref: '#/definitions/EvaluationReportList' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReportList" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns counseling evaluation reports for the specified move that are visible to the current office user summary: Returns counseling evaluation reports for the specified move that are visible to the current office user operationId: getMoveCounselingEvaluationReportsList - '/moves/{moveID}/cancel': + "/moves/{moveID}/cancel": parameters: - description: ID of the move in: path @@ -385,22 +393,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully canceled move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - move description: cancels a move @@ -408,7 +416,7 @@ paths: summary: Cancels a move x-permissions: - update.cancelMoveFlag - '/counseling/orders/{orderID}': + "/counseling/orders/{orderID}": parameters: - description: ID of order to update in: path @@ -431,27 +439,27 @@ paths: name: body required: true schema: - $ref: '#/definitions/CounselingUpdateOrderPayload' + $ref: "#/definitions/CounselingUpdateOrderPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/orders': + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/orders": post: summary: Creates an orders model for a logged-in user description: Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move @@ -466,23 +474,23 @@ paths: - in: body name: createOrders schema: - $ref: '#/definitions/CreateOrders' + $ref: "#/definitions/CreateOrders" responses: - '200': + "200": description: created instance of orders schema: - $ref: '#/definitions/Order' - '400': + $ref: "#/definitions/Order" + "400": description: invalid request - '401': + "401": description: request requires user authentication - '403': + "403": description: user is not authorized - '422': - $ref: '#/responses/UnprocessableEntity' - '500': + "422": + $ref: "#/responses/UnprocessableEntity" + "500": description: internal server error - '/orders/{orderID}': + "/orders/{orderID}": parameters: - description: ID of order to use in: path @@ -505,30 +513,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateOrderPayload' + $ref: "#/definitions/UpdateOrderPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Order' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.orders get: @@ -536,26 +544,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved order schema: - $ref: '#/definitions/Order' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - order description: Gets an order operationId: getOrder summary: Gets an order by ID - '/orders/{orderID}/allowances': + "/orders/{orderID}/allowances": parameters: - description: ID of order to use in: path @@ -578,29 +586,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateAllowancePayload' + $ref: "#/definitions/UpdateAllowancePayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of allowance schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.allowances - '/orders/{orderID}/acknowledge-excess-weight-risk': + "/orders/{orderID}/acknowledge-excess-weight-risk": parameters: - description: ID of order to use in: path @@ -624,23 +632,23 @@ paths: type: string required: true responses: - '200': + "200": description: updated Move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.excessWeightRisk - '/orders/{orderID}/update-billable-weight': + "/orders/{orderID}/update-billable-weight": parameters: - description: ID of order to use in: path @@ -663,29 +671,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateBillableWeightPayload' + $ref: "#/definitions/UpdateBillableWeightPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated Order schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.billableWeight - '/orders/{orderID}/update-max-billable-weight/tio': + "/orders/{orderID}/update-max-billable-weight/tio": parameters: - description: ID of order to use in: path @@ -708,23 +716,23 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateMaxBillableWeightAsTIOPayload' - - $ref: 'parameters/ifMatch.yaml' + $ref: "#/definitions/UpdateMaxBillableWeightAsTIOPayload" + - $ref: "parameters/ifMatch.yaml" responses: - '200': + "200": description: updated Order schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.maxBillableWeight /orders/{orderID}/upload_amended_orders: @@ -749,23 +757,23 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error - '/counseling/orders/{orderID}/allowances': + "/counseling/orders/{orderID}/allowances": parameters: - description: ID of order to use in: path @@ -788,27 +796,27 @@ paths: name: body required: true schema: - $ref: '#/definitions/CounselingUpdateAllowancePayload' + $ref: "#/definitions/CounselingUpdateAllowancePayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of allowance schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move-task-orders/{moveTaskOrderID}': + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move-task-orders/{moveTaskOrderID}": parameters: - description: ID of move to use in: path @@ -820,26 +828,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved move task order schema: - $ref: '#/definitions/MoveTaskOrder' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MoveTaskOrder" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Gets a move operationId: getMoveTaskOrder summary: Gets a move by ID - '/move_task_orders/{moveTaskOrderID}/mto_service_items': + "/move_task_orders/{moveTaskOrderID}/mto_service_items": parameters: - description: ID of move for mto service item to use in: path @@ -852,22 +860,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: 'definitions/MTOServiceItems.yaml' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItems.yaml" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Gets all line items for a move operationId: listMTOServiceItems summary: Gets all line items for a move - '/mto-shipments': + "/mto-shipments": post: summary: createMTOShipment description: | @@ -894,21 +902,21 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateMTOShipment' + $ref: "#/definitions/CreateMTOShipment" responses: - '200': + "200": description: Successfully created a MTO shipment. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move_task_orders/{moveTaskOrderID}/mto_shipments': + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move_task_orders/{moveTaskOrderID}/mto_shipments": parameters: - description: ID of move task order for mto shipment to use in: path @@ -921,24 +929,24 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all mto shipments for a move task order schema: - $ref: '#/definitions/MTOShipments' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MTOShipments" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoShipment description: Gets all shipments for a move task order operationId: listMTOShipments summary: Gets all shipments for a move task order - '/shipments/{shipmentID}': + "/shipments/{shipmentID}": get: summary: fetches a shipment by ID description: fetches a shipment by ID @@ -955,20 +963,20 @@ paths: format: uuid type: string responses: - '200': + "200": description: Successfully fetched the shipment schema: - $ref: '#/definitions/MTOShipment' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MTOShipment" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" delete: summary: Soft deletes a shipment by ID description: Soft deletes a shipment by ID @@ -985,21 +993,21 @@ paths: format: uuid type: string responses: - '204': + "204": description: Successfully soft deleted the shipment - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": patch: summary: updateMTOShipment description: | @@ -1052,27 +1060,27 @@ paths: - in: body name: body schema: - $ref: '#/definitions/UpdateShipment' + $ref: "#/definitions/UpdateShipment" responses: - '200': + "200": description: Successfully updated the specified MTO shipment. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/shipments/{shipmentID}/approve': + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/shipments/{shipmentID}/approve": parameters: - description: ID of the shipment in: path @@ -1091,22 +1099,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully approved the shipment schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Approves a shipment @@ -1114,7 +1122,7 @@ paths: summary: Approves a shipment x-permissions: - update.shipment - '/shipments/{shipmentID}/request-diversion': + "/shipments/{shipmentID}/request-diversion": parameters: - description: ID of the shipment in: path @@ -1136,24 +1144,24 @@ paths: name: body required: true schema: - $ref: '#/definitions/RequestDiversion' + $ref: "#/definitions/RequestDiversion" responses: - '200': + "200": description: Successfully requested the shipment diversion schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Requests a shipment diversion @@ -1161,7 +1169,7 @@ paths: summary: Requests a shipment diversion x-permissions: - create.shipmentDiversionRequest - '/shipments/{shipmentID}/approve-diversion': + "/shipments/{shipmentID}/approve-diversion": parameters: - description: ID of the shipment in: path @@ -1180,22 +1188,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully approved the shipment diversion schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.shipment tags: @@ -1203,7 +1211,7 @@ paths: description: Approves a shipment diversion operationId: approveShipmentDiversion summary: Approves a shipment diversion - '/shipments/{shipmentID}/reject': + "/shipments/{shipmentID}/reject": parameters: - description: ID of the shipment in: path @@ -1225,30 +1233,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/RejectShipment' + $ref: "#/definitions/RejectShipment" responses: - '200': + "200": description: Successfully rejected the shipment schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: rejects a shipment operationId: rejectShipment summary: rejects a shipment - '/shipments/{shipmentID}/request-cancellation': + "/shipments/{shipmentID}/request-cancellation": parameters: - description: ID of the shipment in: path @@ -1267,22 +1275,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully requested the shipment cancellation schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Requests a shipment cancellation @@ -1290,7 +1298,7 @@ paths: summary: Requests a shipment cancellation x-permissions: - create.shipmentCancellation - '/shipments/{shipmentID}/request-reweigh': + "/shipments/{shipmentID}/request-reweigh": parameters: - description: ID of the shipment in: path @@ -1304,22 +1312,22 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully requested a reweigh of the shipment schema: - $ref: 'definitions/Reweigh.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Reweigh.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - reweigh @@ -1328,7 +1336,7 @@ paths: summary: Requests a shipment reweigh x-permissions: - create.reweighRequest - '/shipments/{shipmentID}/review-shipment-address-update': + "/shipments/{shipmentID}/review-shipment-address-update": parameters: - description: ID of the shipment in: path @@ -1362,29 +1370,30 @@ paths: - officeRemarks - status responses: - '200': + "200": description: Successfully requested a shipment address update schema: - $ref: 'definitions/ShipmentAddressUpdate.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/ShipmentAddressUpdate.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - description: This endpoint is used to approve a address update request. Office remarks are required. + description: + This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item operationId: reviewShipmentAddressUpdate summary: Allows TOO to review a shipment address update - '/shipments/{shipmentID}/sit-extensions': + "/shipments/{shipmentID}/sit-extensions": post: summary: Create an approved SIT Duration Update description: TOO can creates an already-approved SIT Duration Update on behalf of a customer @@ -1406,7 +1415,7 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateApprovedSITDurationUpdate' + $ref: "#/definitions/CreateApprovedSITDurationUpdate" required: true - in: header description: We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment @@ -1414,23 +1423,23 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully created a SIT Extension. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.SITExtension - '/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve': + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": parameters: - description: ID of the shipment in: path @@ -1454,29 +1463,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/ApproveSITExtension' + $ref: "#/definitions/ApproveSITExtension" - in: header description: We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment name: If-Match type: string required: true responses: - '200': + "200": description: Successfully approved a SIT extension schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - sitExtension @@ -1485,7 +1494,7 @@ paths: summary: Approves a SIT extension x-permissions: - update.SITExtension - '/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny': + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": parameters: - description: ID of the shipment in: path @@ -1509,28 +1518,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/DenySITExtension' + $ref: "#/definitions/DenySITExtension" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: Successfully denied a SIT extension schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - sitExtension @@ -1539,7 +1548,7 @@ paths: summary: Denies a SIT extension x-permissions: - update.SITExtension - '/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense': + "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": parameters: - description: ID of the shipment in: path @@ -1557,28 +1566,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateSITServiceItemCustomerExpense' + $ref: "#/definitions/UpdateSITServiceItemCustomerExpense" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: Successfully converted to customer expense schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - mtoServiceItem @@ -1608,22 +1617,22 @@ paths: produces: - application/json responses: - '200': + "200": description: All PPM documents and associated uploads for the specified PPM shipment. schema: - $ref: 'definitions/PPMDocuments.yaml' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMDocuments.yaml" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/weightTicketId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/weightTicketId.yaml" patch: summary: Updates a weight ticket document description: | @@ -1637,35 +1646,35 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateWeightTicketPayload required: true schema: - $ref: '#/definitions/UpdateWeightTicket' + $ref: "#/definitions/UpdateWeightTicket" responses: - '200': + "200": description: returns an updated weight ticket object schema: - $ref: 'definitions/WeightTicket.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/WeightTicket.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/movingExpenseId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/movingExpenseId.yaml" patch: summary: Updates the moving expense description: | @@ -1679,35 +1688,35 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateMovingExpense required: true schema: - $ref: '#/definitions/UpdateMovingExpense' + $ref: "#/definitions/UpdateMovingExpense" responses: - '200': + "200": description: returns an updated moving expense object schema: - $ref: 'definitions/MovingExpense.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}: - parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/proGearWeightTicketId.yaml' + $ref: "definitions/MovingExpense.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + ? /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} + : parameters: + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/proGearWeightTicketId.yaml" patch: summary: Updates a pro-gear weight ticket description: | @@ -1721,31 +1730,31 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateProGearWeightTicket required: true schema: - $ref: '#/definitions/UpdateProGearWeightTicket' + $ref: "#/definitions/UpdateProGearWeightTicket" responses: - '200': + "200": description: returns an updated pro-gear weight ticket object schema: - $ref: 'definitions/ProGearWeightTicket.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/ProGearWeightTicket.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/aoa-packet: parameters: - description: the id for the ppmshipment with aoa to be downloaded @@ -1767,7 +1776,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -1776,19 +1785,19 @@ paths: schema: format: binary type: file - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/finish-document-review: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" patch: summary: Updates a PPM shipment's status after document review description: | @@ -1806,26 +1815,26 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully finished document review schema: - $ref: 'definitions/PPMShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.shipment /ppm-shipments/{ppmShipmentId}/ppm-sit: @@ -1841,7 +1850,7 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" - in: header name: If-Match type: string @@ -1849,27 +1858,27 @@ paths: - in: body name: body schema: - $ref: 'definitions/PPMShipmentSIT.yaml' + $ref: "definitions/PPMShipmentSIT.yaml" responses: - '200': + "200": description: Successfully finished PPM SIT update schema: - $ref: 'definitions/PPMShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/closeout: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" get: summary: Get the closeout calcuations for the specified PPM shipment description: | @@ -1880,23 +1889,23 @@ paths: produces: - application/json responses: - '200': + "200": description: Returns closeout for the specified PPM shipment. schema: - $ref: 'definitions/PPMCloseout.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMCloseout.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/actual-weight: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" get: summary: Get the actual weight for a PPM shipment description: | @@ -1907,23 +1916,23 @@ paths: produces: - application/json responses: - '200': + "200": description: Returns actual weight for the specified PPM shipment. schema: - $ref: 'definitions/PPMActualWeight.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMActualWeight.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" - in: path format: string description: location of sit @@ -1961,20 +1970,20 @@ paths: produces: - application/json responses: - '200': + "200": description: Calculates and returns the SIT estimated cost for the specified PPM shipment. schema: - $ref: 'definitions/PPMSITEstimatedCost.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMSITEstimatedCost.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/payment-packet: get: summary: Returns PPM payment packet @@ -1992,7 +2001,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -2001,17 +2010,17 @@ paths: schema: format: binary type: file - '400': + "400": description: invalid request - '401': + "401": description: request requires user authentication - '403': + "403": description: user is not authorized - '404': + "404": description: ppm not found - '500': + "500": description: internal server error - '/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents': + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": parameters: - description: ID of move task order in: path @@ -2030,22 +2039,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all agents for a move task order schema: - $ref: 'definitions/MTOAgents.yaml' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOAgents.yaml" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoAgent description: Fetches a list of agents associated with a move task order. operationId: fetchMTOAgentList summary: Fetch move task order agents. - '/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}': + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": parameters: - description: ID of move to use in: path @@ -2062,26 +2071,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved a line item for a move task order by ID schema: - $ref: 'definitions/MTOServiceItemSingle.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItemSingle.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Gets a line item by ID for a move by ID operationId: getMTOServiceItem summary: Gets a line item by ID for a move by ID - '/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status': + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": parameters: - description: ID of move to use in: path @@ -2103,32 +2112,32 @@ paths: name: body required: true schema: - $ref: '#/definitions/PatchMTOServiceItemStatusPayload' + $ref: "#/definitions/PatchMTOServiceItemStatusPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: >- Successfully updated status for a line item for a move task order by ID schema: - $ref: 'definitions/MTOServiceItem.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItem.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Changes the status of a line item for a move by ID @@ -2136,7 +2145,7 @@ paths: summary: Change the status of a line item for a move by ID x-permissions: - update.MTOServiceItem - '/service-item/{mtoServiceItemID}/entry-date-update': + "/service-item/{mtoServiceItemID}/entry-date-update": parameters: - description: ID of the service item in: path @@ -2153,32 +2162,32 @@ paths: name: body required: true schema: - $ref: 'definitions/ServiceItemSitEntryDate.yaml' + $ref: "definitions/ServiceItemSitEntryDate.yaml" responses: - '200': + "200": description: Successfully updated SIT entry date schema: - $ref: 'definitions/MTOServiceItemSingle.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItemSingle.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item operationId: updateServiceItemSitEntryDate summary: Updates a service item's SIT entry date by ID - '/move-task-orders/{moveTaskOrderID}/status': + "/move-task-orders/{moveTaskOrderID}/status": patch: consumes: - application/json @@ -2197,29 +2206,29 @@ paths: - in: body name: serviceItemCodes schema: - $ref: '#/definitions/MTOApprovalServiceItemCodes' + $ref: "#/definitions/MTOApprovalServiceItemCodes" required: true responses: - '200': + "200": description: Successfully updated move task order status schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move task order status to make it available to prime @@ -2228,7 +2237,7 @@ paths: x-permissions: - update.move - create.serviceItem - '/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed': + "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": patch: consumes: - application/json @@ -2245,33 +2254,33 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully updated move task order status schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) status to service counseling completed operationId: updateMTOStatusServiceCounselingCompleted summary: Changes move (move task order) status to service counseling completed - '/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status': - parameters: + ? "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status" + : parameters: - description: ID of move to use in: path name: moveTaskOrderID @@ -2292,32 +2301,32 @@ paths: name: body required: true schema: - $ref: '#/definitions/PaymentServiceItem' + $ref: "#/definitions/PaymentServiceItem" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: >- Successfully updated status for a line item for a move task order by ID schema: - $ref: '#/definitions/PaymentServiceItem' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentServiceItem" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentServiceItem description: Changes the status of a line item for a move by ID @@ -2325,7 +2334,7 @@ paths: summary: Change the status of a payment service item for a move by ID x-permissions: - update.paymentServiceItemStatus - '/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at': + "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": patch: consumes: - application/json @@ -2342,31 +2351,31 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully updated move task order billableWeightsReviewedAt field schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) billableWeightsReviewedAt field to a timestamp operationId: updateMTOReviewedBillableWeightsAt - '/move-task-orders/{moveTaskOrderID}/tio-remarks': + "/move-task-orders/{moveTaskOrderID}/tio-remarks": patch: consumes: - application/json @@ -2386,33 +2395,33 @@ paths: name: body required: true schema: - $ref: '#/definitions/Move' + $ref: "#/definitions/Move" responses: - '200': + "200": description: Successfully updated move task order tioRemarks field schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) billableWeightsReviewedAt field to a timestamp operationId: updateMoveTIORemarks - '/move-task-orders/{moveTaskOrderID}/entitlements': + "/move-task-orders/{moveTaskOrderID}/entitlements": parameters: - description: ID of move to use in: path @@ -2426,24 +2435,24 @@ paths: tags: - moveTaskOrder responses: - '200': + "200": description: Successfully retrieved entitlements schema: - $ref: '#/definitions/Entitlements' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Entitlements" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" description: Gets entitlements operationId: getEntitlements summary: Gets entitlements for a move by ID - '/payment-requests/{paymentRequestID}': + "/payment-requests/{paymentRequestID}": parameters: - description: UUID of payment request format: uuid @@ -2456,20 +2465,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: fetched instance of payment request schema: - $ref: '#/definitions/PaymentRequest' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequest" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Fetches an instance of a payment request by id @@ -2477,7 +2486,7 @@ paths: summary: Fetches a payment request by id x-permissions: - read.paymentRequest - '/moves/{locator}/closeout-office': + "/moves/{locator}/closeout-office": parameters: - description: move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members format: string @@ -2512,25 +2521,25 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully set the closeout office for the move schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/moves/{locator}/customer-support-remarks': + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/moves/{locator}/customer-support-remarks": parameters: - description: move code to identify a move for customer support remarks format: string @@ -2547,20 +2556,20 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateCustomerSupportRemark' + $ref: "#/definitions/CreateCustomerSupportRemark" responses: - '200': + "200": description: Successfully created customer support remark schema: - $ref: 'definitions/CustomerSupportRemark.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemark.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - customerSupportRemarks description: Creates a customer support remark for a move @@ -2571,24 +2580,24 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: 'definitions/CustomerSupportRemarks.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemarks.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - customerSupportRemarks description: Fetches customer support remarks for a move operationId: getCustomerSupportRemarksForMove summary: Fetches customer support remarks using the move code (locator). - '/customer-support-remarks/{customerSupportRemarkID}': + "/customer-support-remarks/{customerSupportRemarkID}": parameters: - in: path description: the customer support remark ID to be modified @@ -2611,22 +2620,22 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateCustomerSupportRemarkPayload' + $ref: "#/definitions/UpdateCustomerSupportRemarkPayload" responses: - '200': + "200": description: Successfully updated customer support remark schema: - $ref: 'definitions/CustomerSupportRemark.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemark.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" delete: summary: Soft deletes a customer support remark by ID description: Soft deletes a customer support remark by ID @@ -2636,21 +2645,21 @@ paths: produces: - application/json responses: - '204': + "204": description: Successfully soft deleted the shipment - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/moves/{locator}/evaluation-reports': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/moves/{locator}/evaluation-reports": parameters: - in: path name: locator @@ -2665,20 +2674,20 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateEvaluationReport' + $ref: "#/definitions/CreateEvaluationReport" responses: - '200': + "200": description: Successfully created evaluation report schema: - $ref: '#/definitions/EvaluationReport' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReport" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.evaluationReport tags: @@ -2686,7 +2695,7 @@ paths: description: Creates an evaluation report operationId: createEvaluationReport summary: Creates an evaluation report - '/evaluation-reports/{reportID}/download': + "/evaluation-reports/{reportID}/download": parameters: - in: path description: the evaluation report ID to be downloaded @@ -2703,7 +2712,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -2712,13 +2721,13 @@ paths: schema: format: binary type: file - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' - '/evaluation-reports/{reportID}': + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + "/evaluation-reports/{reportID}": parameters: - in: path description: the evaluation report ID to be modified @@ -2735,18 +2744,18 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully got the report schema: - $ref: '#/definitions/EvaluationReport' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReport" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" delete: summary: Deletes an evaluation report by ID description: Deletes an evaluation report by ID @@ -2758,20 +2767,20 @@ paths: produces: - application/json responses: - '204': + "204": description: Successfully deleted the report - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" put: summary: Saves an evaluation report as a draft description: Saves an evaluation report as a draft @@ -2788,7 +2797,7 @@ paths: - in: body name: body schema: - $ref: '#/definitions/EvaluationReport' + $ref: "#/definitions/EvaluationReport" - in: header name: If-Match type: string @@ -2797,23 +2806,23 @@ paths: Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. responses: - '204': + "204": description: Successfully saved the report - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/evaluation-reports/{reportID}/submit': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/evaluation-reports/{reportID}/submit": parameters: - in: path description: the evaluation report ID to be modified @@ -2838,21 +2847,21 @@ paths: Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. responses: - '204': + "204": description: Successfully submitted an evaluation report with the provided ID - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/evaluation-reports/{reportID}/appeal/add': + "/evaluation-reports/{reportID}/appeal/add": parameters: - in: path description: the evaluation report ID @@ -2874,23 +2883,23 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateAppeal' + $ref: "#/definitions/CreateAppeal" responses: - '204': + "204": description: Successfully added an appeal to a serious incident - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/evaluation-reports/{reportID}/{reportViolationID}/appeal/add': + "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": parameters: - in: path description: the evaluation report ID @@ -2918,23 +2927,23 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateAppeal' + $ref: "#/definitions/CreateAppeal" responses: - '204': + "204": description: Successfully added an appeal to a violation - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/pws-violations': + "/pws-violations": get: summary: Fetch the possible PWS violations for an evaluation report description: Fetch the possible PWS violations for an evaluation report @@ -2944,19 +2953,19 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the PWS violations schema: - $ref: '#/definitions/PWSViolations' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' - '/report-violations/{reportID}': + $ref: "#/definitions/PWSViolations" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + "/report-violations/{reportID}": parameters: - in: path description: the evaluation report ID that has associated violations @@ -2973,18 +2982,18 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the report violations schema: - $ref: '#/definitions/ReportViolations' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ReportViolations" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" post: summary: Associate violations with an evaluation report description: >- @@ -3003,25 +3012,25 @@ paths: - in: body name: body schema: - $ref: '#/definitions/AssociateReportViolations' + $ref: "#/definitions/AssociateReportViolations" responses: - '204': + "204": description: Successfully saved the report violations - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.reportViolation - '/moves/{locator}/payment-requests': + "/moves/{locator}/payment-requests": parameters: - description: move code to identify a move for payment requests format: string @@ -3034,18 +3043,18 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: '#/definitions/PaymentRequests' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequests" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Fetches payment requests for a move @@ -3053,7 +3062,7 @@ paths: summary: Fetches payment requests using the move code (locator). x-permissions: - read.paymentRequest - '/moves/{moveID}/financial-review-flag': + "/moves/{moveID}/financial-review-flag": parameters: - description: ID of move to flag in: path @@ -3091,20 +3100,20 @@ paths: example: false type: boolean responses: - '200': + "200": description: updated Move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.financialReviewFlag /moves/{moveID}/uploadAdditionalDocuments: @@ -3129,25 +3138,25 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error x-permissions: - create.supportingDocuments - '/payment-requests/{paymentRequestID}/shipments-payment-sit-balance': + "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": parameters: - description: payment request ID of the payment request with SIT service items being reviewed name: paymentRequestID @@ -3160,18 +3169,18 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved shipments and their SIT days balance from all payment requests on the move schema: - $ref: '#/definitions/ShipmentsPaymentSITBalance' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ShipmentsPaymentSITBalance" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Returns all shipment payment request SIT usage to support partial SIT invoicing @@ -3179,7 +3188,7 @@ paths: summary: Returns all shipment payment request SIT usage to support partial SIT invoicing x-permissions: - read.shipmentsPaymentSITBalance - '/payment-requests/{paymentRequestID}/status': + "/payment-requests/{paymentRequestID}/status": patch: consumes: - application/json @@ -3196,30 +3205,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdatePaymentRequestStatusPayload' + $ref: "#/definitions/UpdatePaymentRequestStatusPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated payment request schema: - $ref: '#/definitions/PaymentRequest' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequest" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Updates status of a payment request by id @@ -3227,7 +3236,7 @@ paths: summary: Updates status of a payment request by id x-permissions: - update.paymentRequest - '/payment-requests/{paymentRequestID}/bulkDownload': + "/payment-requests/{paymentRequestID}/bulkDownload": parameters: - description: the id for the payment-request with files to be downloaded in: path @@ -3244,7 +3253,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -3253,10 +3262,10 @@ paths: schema: format: binary type: file - '400': - $ref: '#/responses/InvalidRequest' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "500": + $ref: "#/responses/ServerError" /documents/{documentId}: get: summary: Returns a document @@ -3272,24 +3281,24 @@ paths: required: true description: UUID of the document to return responses: - '200': + "200": description: the requested document schema: - $ref: 'definitions/Document.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Document.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /documents: post: summary: Create a new document @@ -3302,17 +3311,17 @@ paths: name: documentPayload required: true schema: - $ref: '#/definitions/PostDocumentPayload' + $ref: "#/definitions/PostDocumentPayload" responses: - '201': + "201": description: created document schema: - $ref: 'definitions/Document.yaml' - '400': + $ref: "definitions/Document.yaml" + "400": description: invalid request - '403': - $ref: '#/responses/PermissionDenied' - '500': + "403": + $ref: "#/responses/PermissionDenied" + "500": description: server error /queues/counseling: get: @@ -3463,14 +3472,14 @@ paths: description: | Used to illustrate which user is assigned to this payment request. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueueMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueueMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/counseling/origin-list: get: produces: @@ -3491,14 +3500,14 @@ paths: type: string description: Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/Locations' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Locations" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/prime-moves: get: summary: getPrimeMovesQueue @@ -3540,14 +3549,14 @@ paths: type: string description: order type responses: - '200': + "200": description: Successfully retrieved moves. A successful fetch might still return zero moves. schema: - $ref: '#/definitions/ListPrimeMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ListPrimeMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/moves: get: produces: @@ -3654,14 +3663,14 @@ paths: type: string description: filters using a counselingOffice name of the move responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueueMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueueMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/payment-requests: get: produces: @@ -3676,7 +3685,20 @@ paths: - in: query name: sort type: string - enum: [customerName, locator, submittedAt, branch, status, edipi, emplid, age, originDutyLocation, assignedTo, counselingOffice] + enum: + [ + customerName, + locator, + submittedAt, + branch, + status, + edipi, + emplid, + age, + originDutyLocation, + assignedTo, + counselingOffice, + ] description: field that results should be sorted by - in: query name: order @@ -3750,14 +3772,14 @@ paths: description: | Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueuePaymentRequestsResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueuePaymentRequestsResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /moves/search: post: produces: @@ -3862,15 +3884,15 @@ paths: enum: [asc, desc] description: field that results should be sorted by responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/SearchMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' - '/tac/valid': + $ref: "#/definitions/SearchMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" + "/tac/valid": get: summary: Validation of a TAC value description: Returns a boolean based on whether a tac value is valid or not @@ -3885,23 +3907,23 @@ paths: required: true description: The tac value to validate responses: - '200': + "200": description: Successfully retrieved validation status schema: - $ref: '#/definitions/TacValid' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TacValid" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /lines-of-accounting: post: - summary: 'Fetch line of accounting' + summary: "Fetch line of accounting" description: > Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering @@ -3913,33 +3935,33 @@ paths: tags: - linesOfAccounting consumes: - - 'application/json' + - "application/json" produces: - - 'application/json' + - "application/json" parameters: - - in: 'body' - name: 'body' - description: 'Service member affiliation, effective date, and TAC code.' + - in: "body" + name: "body" + description: "Service member affiliation, effective date, and TAC code." required: true schema: - $ref: '#/definitions/FetchLineOfAccountingPayload' + $ref: "#/definitions/FetchLineOfAccountingPayload" responses: - '200': - description: 'Successfully retrieved line of accounting' - schema: - $ref: 'definitions/LineOfAccounting.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "200": + description: "Successfully retrieved line of accounting" + schema: + $ref: "definitions/LineOfAccounting.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /transportation-offices: get: produces: @@ -3957,20 +3979,20 @@ paths: minLength: 2 description: Search string for transportation offices responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/TransportationOffices' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TransportationOffices" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /open/transportation-offices: get: produces: @@ -3988,20 +4010,20 @@ paths: minLength: 2 description: Search string for transportation offices responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/TransportationOffices' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TransportationOffices" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /transportation-offices/gblocs: get: produces: @@ -4012,20 +4034,20 @@ paths: tags: - transportationOffice responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/GBLOCs' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/GBLOCs" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /addresses/zip-city-lookup/{search}: get: summary: Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string @@ -4034,23 +4056,23 @@ paths: tags: - addresses parameters: - - in: path - name: search - type: string - required: true + - in: path + name: search + type: string + required: true responses: - '200': + "200": description: the requested list of city, state, county, and postal code matches schema: $ref: "#/definitions/VLocations" - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /uploads: post: summary: Create a new upload @@ -4075,19 +4097,19 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request - '403': + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error /re-service-items: get: @@ -4099,18 +4121,18 @@ paths: tags: - reServiceItems responses: - '200': + "200": description: Successfully retrieved all ReServiceItems. schema: - $ref: '#/definitions/ReServiceItems' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ReServiceItems" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /uploads/{uploadID}: delete: summary: Deletes an upload @@ -4131,17 +4153,17 @@ paths: format: uuid description: ID of the order that the upload belongs to responses: - '204': + "204": description: deleted - '400': + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '500': + "500": description: server error /uploads/get/: get: @@ -4149,20 +4171,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved upload schema: - $ref: 'definitions/Upload.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Upload.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - uploads description: Gets an upload @@ -4197,19 +4219,19 @@ paths: minimum: 0 maximum: 3 responses: - '201': + "201": description: updated upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request - '403': + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error /application_parameters/{parameterName}: get: @@ -4226,15 +4248,15 @@ paths: required: true description: Parameter Name responses: - '200': + "200": description: Application Parameters schema: - $ref: '#/definitions/ApplicationParameters' - '400': + $ref: "#/definitions/ApplicationParameters" + "400": description: invalid request - '401': + "401": description: request requires user authentication - '500': + "500": description: server error /calendar/{countryCode}/is-weekend-holiday/{date}: get: @@ -4261,18 +4283,18 @@ paths: type: string format: date responses: - '200': + "200": description: Successfully determine if given date is weekend and/or holiday for given country. schema: - $ref: '#/definitions/IsDateWeekendHolidayInfo' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/IsDateWeekendHolidayInfo" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /moves/{moveID}/assignOfficeUser: parameters: - description: ID of the move @@ -4291,16 +4313,16 @@ paths: name: body required: true schema: - $ref: '#/definitions/AssignOfficeUserBody' + $ref: "#/definitions/AssignOfficeUserBody" responses: - '200': + "200": description: Successfully assigned office user to the move schema: - $ref: '#/definitions/Move' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: assigns either a services counselor, task ordering officer, or task invoicing officer to the move @@ -4327,12 +4349,12 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully unassigned office user from the move schema: - $ref: '#/definitions/Move' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "500": + $ref: "#/responses/ServerError" tags: - move description: unassigns either a services counselor, task ordering officer, or task invoicing officer from the move @@ -4351,7 +4373,7 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully unlocked officer's move(s). schema: type: object @@ -4359,8 +4381,8 @@ paths: successMessage: type: string example: OK - '500': - $ref: '#/responses/ServerError' + "500": + $ref: "#/responses/ServerError" tags: - move description: >- @@ -4412,7 +4434,7 @@ definitions: - instance ValidationError: allOf: - - $ref: '#/definitions/ClientError' + - $ref: "#/definitions/ClientError" - type: object properties: invalid_fields: @@ -4504,17 +4526,17 @@ definitions: type: string format: uuid transportationOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" transportationOfficeAssignments: type: array items: - $ref: 'definitions/TransportationOfficeAssignment.yaml' + $ref: "definitions/TransportationOfficeAssignment.yaml" active: type: boolean roles: type: array items: - $ref: '#/definitions/Role' + $ref: "#/definitions/Role" edipi: type: string otherUniqueId: @@ -4562,18 +4584,18 @@ definitions: type: string format: uuid transportationOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" OfficeUserCreate: type: object properties: email: type: string - example: 'user@userdomain.com' + example: "user@userdomain.com" title: Email x-nullable: false edipi: type: string - example: '1234567890' + example: "1234567890" maxLength: 10 title: EDIPI x-nullable: true @@ -4603,12 +4625,12 @@ definitions: transportationOfficeId: type: string format: uuid - example: 'c56a4180-65aa-42ec-a945-5fd21dec0538' + example: "c56a4180-65aa-42ec-a945-5fd21dec0538" x-nullable: false roles: type: array items: - $ref: '#/definitions/OfficeUserRole' + $ref: "#/definitions/OfficeUserRole" x-nullable: false required: - firstName @@ -4622,12 +4644,12 @@ definitions: properties: name: type: string - example: 'Task Ordering Officer' + example: "Task Ordering Officer" x-nullable: true title: name roleType: type: string - example: 'task_ordering_officer' + example: "task_ordering_officer" x-nullable: true title: roleType Customer: @@ -4661,9 +4683,9 @@ definitions: example: David x-nullable: true current_address: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" backup_contact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" id: type: string format: uuid @@ -4686,7 +4708,7 @@ definitions: pattern: '^[2-9]\d{2}-\d{3}-\d{4}$|^$' x-nullable: true backupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" cacValidated: type: boolean x-nullable: true @@ -4723,9 +4745,9 @@ definitions: example: David x-nullable: true residentialAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" backupContact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" id: type: string format: uuid @@ -4751,7 +4773,7 @@ definitions: pattern: '^[2-9]\d{2}-\d{3}-\d{4}$' x-nullable: true backupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" cacValidated: type: boolean UpdateCustomerPayload: @@ -4783,9 +4805,9 @@ definitions: x-nullable: true current_address: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" backup_contact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" phoneIsPreferred: type: boolean emailIsPreferred: @@ -4797,22 +4819,22 @@ definitions: x-nullable: true backupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" cac_validated: type: boolean CreateCustomerPayload: type: object properties: affiliation: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" edipi: type: string - example: '1234567890' + example: "1234567890" maxLength: 10 x-nullable: false emplid: type: string - example: '9485155' + example: "9485155" maxLength: 7 x-nullable: true firstName: @@ -4850,12 +4872,12 @@ definitions: type: boolean residentialAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" backupContact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" backupMailingAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" createOktaAccount: type: boolean cacUser: @@ -4864,7 +4886,7 @@ definitions: type: object properties: departmentIndicator: - $ref: 'definitions/DepartmentIndicator.yaml' + $ref: "definitions/DepartmentIndicator.yaml" effectiveDate: description: > The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. @@ -4875,12 +4897,12 @@ definitions: users per customer request). type: string format: date - example: '2023-01-01' + example: "2023-01-01" tacCode: type: string minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" SearchCustomersResult: type: object properties: @@ -4891,11 +4913,11 @@ definitions: totalCount: type: integer searchCustomers: - $ref: '#/definitions/SearchCustomers' + $ref: "#/definitions/SearchCustomers" SearchCustomers: type: array items: - $ref: '#/definitions/SearchCustomer' + $ref: "#/definitions/SearchCustomer" SearchCustomer: type: object properties: @@ -4947,6 +4969,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -5102,22 +5127,22 @@ definitions: format: uuid x-nullable: true contractor: - $ref: '#/definitions/Contractor' + $ref: "#/definitions/Contractor" locator: type: string - example: '1K43AR' + example: "1K43AR" ordersId: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 orders: - $ref: '#/definitions/Order' + $ref: "#/definitions/Order" referenceId: example: 1001-3456 type: string x-nullable: true status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" excess_weight_qualified_at: type: string format: date-time @@ -5144,7 +5169,7 @@ definitions: x-nullable: true readOnly: true closeoutOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" closeoutOfficeId: type: string format: uuid @@ -5168,26 +5193,26 @@ definitions: eTag: type: string shipmentGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" lockedByOfficeUserID: type: string format: uuid x-nullable: true lockedByOfficeUser: - $ref: '#/definitions/LockedOfficeUser' + $ref: "#/definitions/LockedOfficeUser" x-nullable: true lockExpiresAt: type: string format: date-time x-nullable: true additionalDocuments: - $ref: 'definitions/Document.yaml' + $ref: "definitions/Document.yaml" SCAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" TOOAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" TIOAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" MoveHistory: properties: id: @@ -5197,11 +5222,11 @@ definitions: type: string historyRecords: description: A list of MoveAuditHistory's connected to the move. - $ref: '#/definitions/MoveAuditHistories' + $ref: "#/definitions/MoveAuditHistories" locator: description: move locator type: string - example: '1K43AR' + example: "1K43AR" referenceId: description: move referenceID example: 1001-3456 @@ -5223,11 +5248,11 @@ definitions: type: string historyRecords: description: A list of MoveAuditHistory's connected to the move. - $ref: '#/definitions/MoveAuditHistories' + $ref: "#/definitions/MoveAuditHistories" locator: description: move locator type: string - example: '1K43AR' + example: "1K43AR" referenceId: description: move referenceID example: 1001-3456 @@ -5236,7 +5261,7 @@ definitions: MoveAuditHistories: type: array items: - $ref: '#/definitions/MoveAuditHistory' + $ref: "#/definitions/MoveAuditHistory" MoveAuditHistory: properties: id: @@ -5333,7 +5358,7 @@ definitions: MoveAuditHistoryItems: type: array items: - $ref: '#/definitions/MoveAuditHistoryItem' + $ref: "#/definitions/MoveAuditHistoryItem" MoveAuditHistoryItem: properties: columnName: @@ -5410,10 +5435,10 @@ definitions: format: uuid type: string customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" moveCode: type: string - example: 'H2XFJF' + example: "H2XFJF" first_name: type: string example: John @@ -5423,19 +5448,19 @@ definitions: example: Doe readOnly: true grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" entitlement: - $ref: '#/definitions/Entitlements' + $ref: "#/definitions/Entitlements" destinationDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" destinationDutyLocationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" originDutyLocationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" moveTaskOrderID: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -5456,42 +5481,42 @@ definitions: order_number: type: string x-nullable: true - example: '030-00362' + example: "030-00362" order_type: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" order_type_detail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" x-nullable: true date_issued: type: string format: date - example: '2020-01-01' + example: "2020-01-01" report_by_date: type: string format: date - example: '2020-01-01' + example: "2020-01-01" department_indicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true tac: type: string title: TAC - example: 'F8J1' + example: "F8J1" x-nullable: true sac: type: string title: SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true ntsTac: type: string title: NTS TAC - example: 'F8J1' + example: "F8J1" x-nullable: true ntsSac: type: string title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true has_dependents: type: boolean @@ -5510,7 +5535,7 @@ definitions: naics: type: string orders_type: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" eTag: type: string type: object @@ -5529,7 +5554,7 @@ definitions: Locations: type: array items: - $ref: '#/definitions/Location' + $ref: "#/definitions/Location" OrderBody: type: object properties: @@ -5554,9 +5579,9 @@ definitions: format: date title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" hasDependents: type: boolean title: Are dependents included in your orders? @@ -5571,21 +5596,21 @@ definitions: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" tac: type: string title: TAC - example: 'F8J1' + example: "F8J1" x-nullable: true sac: type: string title: SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" originDutyLocationId: type: string format: uuid @@ -5620,25 +5645,25 @@ definitions: type: string description: The date and time that these orders were cut. format: date - example: '2018-04-26' + example: "2018-04-26" title: Orders date reportByDate: type: string description: Report By Date format: date - example: '2018-04-26' + example: "2018-04-26" title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" ordersNumber: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true originDutyLocationId: type: string @@ -5653,24 +5678,24 @@ definitions: title: HHG TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" x-nullable: true sac: title: HHG SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml ntsTac: title: NTS TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" $ref: definitions/NullableString.yaml ntsSac: title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" required: - issueDate - reportByDate @@ -5684,18 +5709,18 @@ definitions: type: string description: The date and time that these orders were cut. format: date - example: '2018-04-26' + example: "2018-04-26" title: Orders date reportByDate: type: string description: Report By Date format: date - example: '2018-04-26' + example: "2018-04-26" title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" originDutyLocationId: type: string format: uuid @@ -5708,37 +5733,37 @@ definitions: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" tac: type: string title: HHG TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" x-nullable: true sac: title: HHG SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml ntsTac: title: NTS TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" $ref: definitions/NullableString.yaml ntsSac: title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true ordersAcknowledgement: description: Confirmation that the new amended orders were reviewed after previously approving the original orders type: boolean x-nullable: true grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" required: - issueDate - reportByDate @@ -5749,12 +5774,12 @@ definitions: type: object properties: grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" dependentsAuthorized: type: boolean x-nullable: true agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" proGearWeight: description: unit is in lbs example: 2000 @@ -5789,6 +5814,10 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: Indicates if the customer is restricted to a specific location for their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -5841,12 +5870,12 @@ definitions: type: object properties: grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" dependentsAuthorized: type: boolean x-nullable: true agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" proGearWeight: minimum: 0 maximum: 2000 @@ -5881,6 +5910,10 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: Indicates if the customer is restricted to a specific location for their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -5916,7 +5949,7 @@ definitions: type: string locator: type: string - example: '1K43AR' + example: "1K43AR" referenceId: example: 1001-3456 type: string @@ -5936,9 +5969,9 @@ definitions: format: date-time type: string destinationAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" pickupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" destinationDutyLocation: example: 1f2270c7-7166-40ae-981e-b200ebdf3054 format: uuid @@ -5948,7 +5981,7 @@ definitions: format: uuid type: string entitlements: - $ref: '#/definitions/Entitlements' + $ref: "#/definitions/Entitlements" requestedPickupDate: format: date type: string @@ -5961,12 +5994,12 @@ definitions: type: object MoveTaskOrders: items: - $ref: '#/definitions/MoveTaskOrder' + $ref: "#/definitions/MoveTaskOrder" type: array PaymentRequest: properties: proofOfServiceDocs: - $ref: '#/definitions/ProofOfServiceDocs' + $ref: "#/definitions/ProofOfServiceDocs" id: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -5976,7 +6009,7 @@ definitions: default: false type: boolean moveTaskOrder: - $ref: '#/definitions/Move' + $ref: "#/definitions/Move" moveTaskOrderID: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -5986,9 +6019,9 @@ definitions: type: string x-nullable: true serviceItems: - $ref: '#/definitions/PaymentServiceItems' + $ref: "#/definitions/PaymentServiceItems" status: - $ref: '#/definitions/PaymentRequestStatus' + $ref: "#/definitions/PaymentRequestStatus" paymentRequestNumber: example: 1234-5678-1 readOnly: true @@ -6041,11 +6074,11 @@ definitions: type: object PaymentRequests: items: - $ref: '#/definitions/PaymentRequest' + $ref: "#/definitions/PaymentRequest" type: array PaymentServiceItems: items: - $ref: '#/definitions/PaymentServiceItem' + $ref: "#/definitions/PaymentServiceItem" type: array PaymentServiceItem: properties: @@ -6072,14 +6105,14 @@ definitions: example: Move management type: string mtoShipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" mtoShipmentID: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 x-nullable: true status: - $ref: 'definitions/PaymentServiceItemStatus.yaml' + $ref: "definitions/PaymentServiceItemStatus.yaml" priceCents: type: integer format: cents @@ -6094,7 +6127,7 @@ definitions: readOnly: true format: string paymentServiceItemParams: - $ref: 'definitions/PaymentServiceItemParams.yaml' + $ref: "definitions/PaymentServiceItemParams.yaml" eTag: type: string tppsInvoiceAmountPaidPerServiceItemMillicents: @@ -6104,10 +6137,10 @@ definitions: x-nullable: true type: object PaymentRequestStatus: - $ref: 'definitions/PaymentRequestStatus.yaml' + $ref: "definitions/PaymentRequestStatus.yaml" ProofOfServiceDocs: items: - $ref: '#/definitions/ProofOfServiceDoc' + $ref: "#/definitions/ProofOfServiceDoc" type: array ProofOfServiceDoc: properties: @@ -6115,11 +6148,11 @@ definitions: type: boolean uploads: items: - $ref: 'definitions/Upload.yaml' + $ref: "definitions/Upload.yaml" type: array ShipmentsPaymentSITBalance: items: - $ref: '#/definitions/ShipmentPaymentSITBalance' + $ref: "#/definitions/ShipmentPaymentSITBalance" type: array ShipmentPaymentSITBalance: properties: @@ -6159,7 +6192,7 @@ definitions: type: object properties: shipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" requestedPickupDate: format: date type: string @@ -6188,16 +6221,16 @@ definitions: x-nullable: true pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryDeliveryAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6208,10 +6241,10 @@ definitions: x-omitempty: false tertiaryDeliveryAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6229,14 +6262,14 @@ definitions: x-nullable: true x-omitempty: false destinationType: - $ref: 'definitions/DestinationType.yaml' + $ref: "definitions/DestinationType.yaml" agents: - $ref: 'definitions/MTOAgents.yaml' + $ref: "definitions/MTOAgents.yaml" x-nullable: true tacType: - $ref: 'definitions/LOATypeNullable.yaml' + $ref: "definitions/LOATypeNullable.yaml" sacType: - $ref: 'definitions/LOATypeNullable.yaml' + $ref: "definitions/LOATypeNullable.yaml" usesExternalVendor: type: boolean example: false @@ -6252,13 +6285,13 @@ definitions: x-nullable: true storageFacility: x-nullable: true - $ref: 'definitions/StorageFacility.yaml' + $ref: "definitions/StorageFacility.yaml" ppmShipment: - $ref: '#/definitions/UpdatePPMShipment' + $ref: "#/definitions/UpdatePPMShipment" boatShipment: - $ref: '#/definitions/UpdateBoatShipment' + $ref: "#/definitions/UpdateBoatShipment" mobileHomeShipment: - $ref: '#/definitions/UpdateMobileHomeShipment' + $ref: "#/definitions/UpdateMobileHomeShipment" UpdatePPMShipment: type: object properties: @@ -6274,34 +6307,34 @@ definitions: x-nullable: true pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" actualPickupPostalCode: description: > The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ x-nullable: true secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/PPMDestinationAddress.yaml' + - $ref: "definitions/PPMDestinationAddress.yaml" actualDestinationPostalCode: description: > The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ x-nullable: true secondaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6312,10 +6345,10 @@ definitions: x-omitempty: false tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6326,13 +6359,13 @@ definitions: x-omitempty: false w2Address: x-nullable: true - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" sitExpected: type: boolean x-nullable: true sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedWeight: type: integer @@ -6390,7 +6423,7 @@ definitions: format: cents x-nullable: true advanceStatus: - $ref: 'definitions/PPMAdvanceStatus.yaml' + $ref: "definitions/PPMAdvanceStatus.yaml" x-nullable: true isActualExpenseReimbursement: description: Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. @@ -6484,7 +6517,7 @@ definitions: description: Indicates if the trailer that the customer used meets all the criteria to be claimable. type: boolean status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string @@ -6499,7 +6532,7 @@ definitions: type: object properties: movingExpenseType: - $ref: 'definitions/OmittableMovingExpenseType.yaml' + $ref: "definitions/OmittableMovingExpenseType.yaml" description: description: A brief description of the expense. type: string @@ -6517,7 +6550,7 @@ definitions: type: string format: date status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string @@ -6526,7 +6559,7 @@ definitions: type: integer sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedCost: description: The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. @@ -6554,13 +6587,13 @@ definitions: type: integer minimum: 0 status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string MTOShipments: items: - $ref: 'definitions/MTOShipment.yaml' + $ref: "definitions/MTOShipment.yaml" type: array CreateMTOShipment: type: object @@ -6606,17 +6639,17 @@ definitions: example: handle with care x-nullable: true agents: - $ref: 'definitions/MTOAgents.yaml' + $ref: "definitions/MTOAgents.yaml" mtoServiceItems: - $ref: 'definitions/MTOServiceItems.yaml' + $ref: "definitions/MTOServiceItems.yaml" pickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6624,7 +6657,7 @@ definitions: secondaryPickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryDeliveryAddress: type: boolean x-nullable: true @@ -6632,7 +6665,7 @@ definitions: secondaryDeliveryAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6640,7 +6673,7 @@ definitions: tertiaryPickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryDeliveryAddress: type: boolean x-nullable: true @@ -6648,18 +6681,18 @@ definitions: tertiaryDeliveryAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationType: - $ref: 'definitions/DestinationType.yaml' + $ref: "definitions/DestinationType.yaml" shipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" tacType: allOf: - - $ref: 'definitions/LOAType.yaml' + - $ref: "definitions/LOAType.yaml" - x-nullable: true sacType: allOf: - - $ref: 'definitions/LOAType.yaml' + - $ref: "definitions/LOAType.yaml" - x-nullable: true usesExternalVendor: type: boolean @@ -6676,13 +6709,13 @@ definitions: x-formatting: weight storageFacility: x-nullable: true - $ref: 'definitions/StorageFacility.yaml' + $ref: "definitions/StorageFacility.yaml" mobileHomeShipment: - $ref: '#/definitions/CreateMobileHomeShipment' + $ref: "#/definitions/CreateMobileHomeShipment" ppmShipment: - $ref: '#/definitions/CreatePPMShipment' + $ref: "#/definitions/CreatePPMShipment" boatShipment: - $ref: '#/definitions/CreateBoatShipment' + $ref: "#/definitions/CreateBoatShipment" required: - moveTaskOrderID - shipmentType @@ -6696,22 +6729,22 @@ definitions: type: string pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/PPMDestinationAddress.yaml' + - $ref: "definitions/PPMDestinationAddress.yaml" secondaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6732,7 +6765,7 @@ definitions: type: boolean sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedWeight: type: integer @@ -6865,7 +6898,7 @@ definitions: minimum: 1 requestReason: description: Reason from service counselor-provided picklist for SIT Duration Update - example: 'AWAITING_COMPLETION_OF_RESIDENCE' + example: "AWAITING_COMPLETION_OF_RESIDENCE" type: string enum: - SERIOUS_ILLNESS_MEMBER @@ -6912,7 +6945,7 @@ definitions: properties: requestReason: description: Reason from service counselor-provided picklist for SIT Duration Update - example: 'AWAITING_COMPLETION_OF_RESIDENCE' + example: "AWAITING_COMPLETION_OF_RESIDENCE" type: string enum: - SERIOUS_ILLNESS_MEMBER @@ -6973,14 +7006,14 @@ definitions: type: string x-nullable: true status: - $ref: '#/definitions/PaymentRequestStatus' + $ref: "#/definitions/PaymentRequestStatus" eTag: type: string type: object AvailableOfficeUsers: type: array items: - $ref: '#/definitions/AvailableOfficeUser' + $ref: "#/definitions/AvailableOfficeUser" AvailableOfficeUser: type: object properties: @@ -6995,7 +7028,7 @@ definitions: QueueMoves: type: array items: - $ref: '#/definitions/QueueMove' + $ref: "#/definitions/QueueMove" QueueMove: type: object properties: @@ -7003,9 +7036,9 @@ definitions: type: string format: uuid customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" locator: type: string submittedAt: @@ -7021,15 +7054,15 @@ definitions: type: string x-nullable: true departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" shipmentsCount: type: integer originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" destinationDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" ppmType: type: string enum: [FULL, PARTIAL] @@ -7049,14 +7082,14 @@ definitions: format: uuid x-nullable: true lockedByOfficeUser: - $ref: '#/definitions/LockedOfficeUser' + $ref: "#/definitions/LockedOfficeUser" x-nullable: true lockExpiresAt: type: string format: date-time x-nullable: true ppmStatus: - $ref: '#/definitions/PPMStatus' + $ref: "#/definitions/PPMStatus" x-nullable: true counselingOffice: type: string @@ -7066,10 +7099,10 @@ definitions: format: uuid x-nullable: true assignedTo: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" x-nullable: true availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' + $ref: "#/definitions/AvailableOfficeUsers" assignable: type: boolean QueueMovesResult: @@ -7082,7 +7115,7 @@ definitions: totalCount: type: integer queueMoves: - $ref: '#/definitions/QueueMoves' + $ref: "#/definitions/QueueMoves" ListPrimeMove: description: > An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to @@ -7095,7 +7128,7 @@ definitions: type: string moveCode: type: string - example: 'HYXFJF' + example: "HYXFJF" readOnly: true createdAt: format: date-time @@ -7135,7 +7168,7 @@ definitions: ListPrimeMoves: type: array items: - $ref: '#/definitions/ListPrimeMove' + $ref: "#/definitions/ListPrimeMove" ListPrimeMovesResult: type: object properties: @@ -7146,7 +7179,7 @@ definitions: totalCount: type: integer queueMoves: - $ref: '#/definitions/ListPrimeMoves' + $ref: "#/definitions/ListPrimeMoves" QueuePaymentRequest: type: object properties: @@ -7157,9 +7190,9 @@ definitions: type: string format: uuid customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" status: - $ref: '#/definitions/QueuePaymentRequestStatus' + $ref: "#/definitions/QueuePaymentRequestStatus" age: type: number format: double @@ -7170,11 +7203,11 @@ definitions: locator: type: string departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" orderType: type: string x-nullable: true @@ -7187,10 +7220,10 @@ definitions: format: date-time x-nullable: true assignedTo: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" x-nullable: true availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' + $ref: "#/definitions/AvailableOfficeUsers" assignable: type: boolean counselingOffice: @@ -7199,7 +7232,7 @@ definitions: QueuePaymentRequests: type: array items: - $ref: '#/definitions/QueuePaymentRequest' + $ref: "#/definitions/QueuePaymentRequest" QueuePaymentRequestsResult: type: object properties: @@ -7210,7 +7243,7 @@ definitions: totalCount: type: integer queuePaymentRequests: - $ref: '#/definitions/QueuePaymentRequests' + $ref: "#/definitions/QueuePaymentRequests" QueuePaymentRequestStatus: enum: - Payment requested @@ -7222,7 +7255,7 @@ definitions: SearchMoves: type: array items: - $ref: '#/definitions/SearchMove' + $ref: "#/definitions/SearchMove" SearchMove: type: object properties: @@ -7246,7 +7279,7 @@ definitions: example: 9551-6199-2 x-nullable: true status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" locator: type: string branch: @@ -7257,13 +7290,13 @@ definitions: format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ destinationDutyLocationPostalCode: format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ requestedPickupDate: type: string @@ -7276,9 +7309,9 @@ definitions: format: date x-nullable: true originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" destinationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" lockedByOfficeUserID: type: string format: uuid @@ -7300,7 +7333,7 @@ definitions: totalCount: type: integer searchMoves: - $ref: '#/definitions/SearchMoves' + $ref: "#/definitions/SearchMoves" GBLOC: type: string enum: @@ -7395,7 +7428,7 @@ definitions: EvaluationReportList: type: array items: - $ref: '#/definitions/EvaluationReport' + $ref: "#/definitions/EvaluationReport" EvaluationReport: type: object description: An evaluation report @@ -7417,28 +7450,28 @@ definitions: x-nullable: true readOnly: true type: - $ref: '#/definitions/EvaluationReportType' + $ref: "#/definitions/EvaluationReportType" inspectionType: - $ref: '#/definitions/EvaluationReportInspectionType' + $ref: "#/definitions/EvaluationReportInspectionType" x-nullable: true inspectionDate: type: string format: date x-nullable: true officeUser: - $ref: '#/definitions/EvaluationReportOfficeUser' + $ref: "#/definitions/EvaluationReportOfficeUser" location: - $ref: '#/definitions/EvaluationReportLocation' + $ref: "#/definitions/EvaluationReportLocation" x-nullable: true reportViolations: - $ref: '#/definitions/ReportViolations' + $ref: "#/definitions/ReportViolations" x-nullable: true gsrAppeals: - $ref: '#/definitions/GSRAppeals' + $ref: "#/definitions/GSRAppeals" x-nullable: true locationDescription: type: string - example: 'Route 66 at crash inspection site 3' + example: "Route 66 at crash inspection site 3" x-nullable: true observedShipmentDeliveryDate: type: string @@ -7451,18 +7484,18 @@ definitions: timeDepart: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '14:30' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "14:30" evalStart: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '15:00' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "15:00" evalEnd: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '18:00' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "18:00" violationsObserved: type: boolean x-nullable: true @@ -7574,7 +7607,7 @@ definitions: PWSViolations: type: array items: - $ref: '#/definitions/PWSViolation' + $ref: "#/definitions/PWSViolation" AssociateReportViolations: type: object description: A list of PWS violation string ids to associate with an evaluation report @@ -7601,14 +7634,14 @@ definitions: format: uuid type: string violation: - $ref: '#/definitions/PWSViolation' + $ref: "#/definitions/PWSViolation" gsrAppeals: - $ref: '#/definitions/GSRAppeals' + $ref: "#/definitions/GSRAppeals" x-nullable: true ReportViolations: type: array items: - $ref: '#/definitions/ReportViolation' + $ref: "#/definitions/ReportViolation" GSRAppealStatusType: type: string enum: @@ -7617,7 +7650,7 @@ definitions: GSRAppeals: type: array items: - $ref: '#/definitions/GSRAppeal' + $ref: "#/definitions/GSRAppeal" GSRAppeal: type: object description: An object associating appeals on violations and serious incidents @@ -7639,12 +7672,12 @@ definitions: format: uuid type: string officeUser: - $ref: '#/definitions/EvaluationReportOfficeUser' + $ref: "#/definitions/EvaluationReportOfficeUser" isSeriousIncident: type: boolean example: false appealStatus: - $ref: '#/definitions/GSRAppealStatusType' + $ref: "#/definitions/GSRAppealStatusType" remarks: type: string example: Office user remarks @@ -7655,7 +7688,7 @@ definitions: TransportationOffices: type: array items: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" VLocations: type: array items: @@ -7686,9 +7719,9 @@ definitions: readOnly: true locator: type: string - example: '12432' + example: "12432" status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" created_at: type: string format: date-time @@ -7700,9 +7733,9 @@ definitions: format: date-time x-nullable: true mto_shipments: - $ref: '#/definitions/MTOShipments' + $ref: "#/definitions/MTOShipments" closeout_office: - $ref: '#/definitions/TransportationOffice' + $ref: "#/definitions/TransportationOffice" cancel_reason: type: string example: Change of orders @@ -7714,7 +7747,7 @@ definitions: type: string readOnly: true additionalDocuments: - $ref: 'definitions/Document.yaml' + $ref: "definitions/Document.yaml" required: - id - orders_id @@ -7732,7 +7765,7 @@ definitions: date: type: string format: date - example: '2018-09-25' + example: "2018-09-25" is_weekend: type: boolean is_holiday: @@ -7771,28 +7804,28 @@ responses: InvalidRequest: description: The request payload is invalid schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" NotFound: description: The requested resource wasn't found schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" Conflict: description: Conflict error schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" PermissionDenied: description: The request was denied schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" ServerError: description: A server error occurred schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" PreconditionFailed: description: Precondition failed schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" UnprocessableEntity: description: The payload was unprocessable. schema: - $ref: '#/definitions/ValidationError' + $ref: "#/definitions/ValidationError" diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index e3bf2dd4528..5f94bc926db 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -878,6 +878,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index ab568b434c8..83842cc917f 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5165,6 +5165,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -6051,6 +6054,12 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: >- + Indicates if the customer is restricted to a specific location for + their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -6154,6 +6163,12 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: >- + Indicates if the customer is restricted to a specific location for + their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 83ef52b06c7..8af5a4ee92d 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3023,6 +3023,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 00c4e8d169b..05ac5076d6c 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1634,6 +1634,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index cb7c5a5d10a..398bf9c100d 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1722,6 +1722,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/support.yaml b/swagger/support.yaml index 8b0e87f4842..bd09358deef 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -953,6 +953,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean From 2620c6d565e857a10c2ae8008abee2c7b2419f57 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Tue, 7 Jan 2025 22:58:56 +0000 Subject: [PATCH 009/229] add queue management tracking to move history --- .../sql_scripts/move_history_fetcher.sql | 8 ++- .../MoveHistory/Database/FieldMappings.js | 3 + .../DeleteAssignedOfficeUser.jsx | 18 ++++++ .../DeleteAssignedOfficeUser.test.jsx | 50 ++++++++++++++++ .../UpdateAssignedOfficeUser.jsx | 23 +++++++ .../UpdateAssignedOfficeUser.test.jsx | 60 +++++++++++++++++++ ...ateMTOStatusServiceCounselingCompleted.jsx | 9 ++- ...OStatusServiceCounselingCompleted.test.jsx | 11 ++++ .../updateMoveTaskOrderStatus.jsx | 9 ++- .../updateMoveTaskOrderStatus.test.jsx | 12 ++++ .../UpdatePaymentRequestStatusMoves.jsx | 16 +++++ .../UpdatePaymentRequestStatusMoves.test.jsx | 41 +++++++++++++ .../updateServiceItemStatusUpdateMove.jsx | 9 ++- ...updateServiceItemStatusUpdateMove.test.jsx | 11 ++++ .../MoveHistory/EventTemplates/index.js | 3 + .../MoveHistory/UIDisplay/Operations.js | 2 + src/utils/formatters.js | 14 +++++ src/utils/formatters.test.js | 47 +++++++++++++++ 18 files changed, 341 insertions(+), 5 deletions(-) create mode 100644 src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.test.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx diff --git a/pkg/assets/sql_scripts/move_history_fetcher.sql b/pkg/assets/sql_scripts/move_history_fetcher.sql index dacacf55d78..718d835b2cb 100644 --- a/pkg/assets/sql_scripts/move_history_fetcher.sql +++ b/pkg/assets/sql_scripts/move_history_fetcher.sql @@ -52,14 +52,18 @@ WITH move AS ( 'closeout_office_name', (SELECT transportation_offices.name FROM transportation_offices WHERE transportation_offices.id = uuid(c.closeout_office_id)), 'counseling_office_name', - (SELECT transportation_offices.name FROM transportation_offices WHERE transportation_offices.id = uuid(c.counseling_transportation_office_id)) + (SELECT transportation_offices.name FROM transportation_offices WHERE transportation_offices.id = uuid(c.counseling_transportation_office_id)), + 'assigned_office_user_first_name', + (select office_users.first_name from office_users where office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))), + 'assigned_office_user_last_name', + (select office_users.last_name from office_users where office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))) )) )::TEXT AS context, NULL AS context_id FROM audit_history JOIN move ON audit_history.object_id = move.id - JOIN jsonb_to_record(audit_history.changed_data) as c(closeout_office_id TEXT, counseling_transportation_office_id TEXT) on TRUE + JOIN jsonb_to_record(audit_history.changed_data) as c(closeout_office_id TEXT, counseling_transportation_office_id text, sc_assigned_id text, too_assigned_id text, tio_assigned_id text) on TRUE WHERE audit_history.table_name = 'moves' -- Remove log for when shipment_seq_num updates AND NOT (audit_history.event_name = NULL AND audit_history.changed_data::TEXT LIKE '%shipment_seq_num%' AND LENGTH(audit_history.changed_data::TEXT) < 25) diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 5b9ece8b735..5cfeab3e8a4 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -148,4 +148,7 @@ export default { approvals_requested_at: 'Approvals requested at', approved_at: 'Approved at', counseling_office_name: 'Counseling office', + assigned_sc: 'Counselor assigned', + assigned_too: 'Task ordering officer assigned', + assigned_tio: 'Task invoicing officer assigned', }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.jsx b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.jsx new file mode 100644 index 00000000000..e721b67abd0 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.jsx @@ -0,0 +1,18 @@ +import React from 'react'; + +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; + +export default { + action: a.UPDATE, + eventName: o.deleteAssignedOfficeUser, + tableName: t.moves, + getEventNameDisplay: () => 'Updated move', + getDetails: ({ changedValues }) => { + if (changedValues.sc_assigned_id === null) return <>Counselor unassigned; + if (changedValues.too_assigned_id === null) return <>Task ordering officer unassigned; + if (changedValues.tio_assigned_id === null) return <>Task invoicing officer unassigned; + return <>Unassigned; + }, +}; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.test.jsx new file mode 100644 index 00000000000..cf02b1f8fb5 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser.test.jsx @@ -0,0 +1,50 @@ +import { screen, render } from '@testing-library/react'; + +import e from 'constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/DeleteAssignedOfficeUser'; +import getTemplate from 'constants/MoveHistory/TemplateManager'; + +describe('When given a move that has been unassigned', () => { + const historyRecord = { + action: 'UPDATE', + eventName: 'deleteAssignedOfficeUser', + tableName: 'moves', + changedValues: { + sc_assigned_id: null, + }, + }; + + it('correctly matches the template', () => { + const template = getTemplate(historyRecord); + expect(template).toMatchObject(e); + }); + + it('displays the proper name in the event name display column', () => { + const template = getTemplate(historyRecord); + + render(template.getEventNameDisplay(historyRecord)); + expect(screen.getByText('Updated move')).toBeInTheDocument(); + }); + + describe('displays the proper details for', () => { + it('services counselor', () => { + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Counselor unassigned')).toBeInTheDocument(); + }); + it('task ordering officer', () => { + historyRecord.changedValues = { too_assigned_id: null }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task ordering officer unassigned')).toBeInTheDocument(); + }); + it('task invoicing officer', () => { + historyRecord.changedValues = { tio_assigned_id: null }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task invoicing officer unassigned')).toBeInTheDocument(); + }); + }); +}); diff --git a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.jsx b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.jsx new file mode 100644 index 00000000000..16e43bc64b6 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.jsx @@ -0,0 +1,23 @@ +import React from 'react'; + +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; +import LabeledDetails from 'pages/Office/MoveHistory/LabeledDetails'; +import { formatAssignedOfficeUserFromContext } from 'utils/formatters'; + +const formatChangedValues = (historyRecord) => { + const newChangedValues = { + ...formatAssignedOfficeUserFromContext(historyRecord), + }; + + return { ...historyRecord, changedValues: newChangedValues }; +}; + +export default { + action: a.UPDATE, + eventName: o.updateAssignedOfficeUser, + tableName: t.moves, + getEventNameDisplay: () => 'Updated move', + getDetails: (historyRecord) => , +}; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx new file mode 100644 index 00000000000..218b16bb2a0 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx @@ -0,0 +1,60 @@ +import { screen, render } from '@testing-library/react'; + +import e from 'constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser'; +import getTemplate from 'constants/MoveHistory/TemplateManager'; + +describe('When given a move that has been assigned', () => { + const historyRecord = { + action: 'UPDATE', + eventName: 'updateAssignedOfficeUser', + tableName: 'moves', + changedValues: { + sc_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', + }, + context: [{ assigned_office_user_last_name: 'Daniels', assigned_office_user_first_name: 'Jayden' }], + }; + + it('correctly matches the template', () => { + const template = getTemplate(historyRecord); + expect(template).toMatchObject(e); + }); + + it('displays the proper name in the event name display column', () => { + const template = getTemplate(historyRecord); + + render(template.getEventNameDisplay(historyRecord)); + expect(screen.getByText('Updated move')).toBeInTheDocument(); + }); + + describe('displays the proper details for', () => { + it('services counselor', () => { + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Counselor assigned')).toBeInTheDocument(); + expect(screen.getByText(': Daniels, Jayden')).toBeInTheDocument(); + }); + it('task ordering officer', () => { + historyRecord.changedValues = { too_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137' }; + historyRecord.context = [ + { assigned_office_user_last_name: 'Robinson', assigned_office_user_first_name: 'Brian' }, + ]; + + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task ordering officer assigned')).toBeInTheDocument(); + expect(screen.getByText(': Robinson, Brian')).toBeInTheDocument(); + }); + it('task invoicing officer', () => { + historyRecord.changedValues = { tio_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137' }; + historyRecord.context = [{ assigned_office_user_last_name: 'Luvu', assigned_office_user_first_name: 'Frankie' }]; + + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task invoicing officer assigned')).toBeInTheDocument(); + expect(screen.getByText(': Luvu, Frankie')).toBeInTheDocument(); + }); + }); +}); diff --git a/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.jsx b/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.jsx index 6fda8260ba0..033dbada873 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.jsx @@ -9,5 +9,12 @@ export default { eventName: o.updateMTOStatusServiceCounselingCompleted, tableName: t.moves, getEventNameDisplay: () => 'Updated move', - getDetails: () => <> Counseling Completed , + getDetails: ({ changedValues }) => { + return ( + <> +
Counseling Completed
+ {changedValues?.sc_assigned_id !== undefined ?
Counselor Unassigned
: null} + + ); + }, }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.test.jsx index 153216daf83..d4422ca4cc0 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateMTOStatusServiceCounselingCompleted/updateMTOStatusServiceCounselingCompleted.test.jsx @@ -26,4 +26,15 @@ describe('When given a completed services counseling for a move', () => { render(template.getEventNameDisplay(historyRecord)); expect(screen.getByText('Updated move')).toBeInTheDocument(); }); + it('displays correct details when an SC is unassigned', () => { + historyRecord.changedValues = { + ...historyRecord.changedValues, + sc_assigned_id: null, + }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Counseling Completed')).toBeInTheDocument(); + expect(screen.getByText('Counselor Unassigned')).toBeInTheDocument(); + }); }); diff --git a/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.jsx index 1d433adf367..bcdc2533a0c 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.jsx @@ -9,5 +9,12 @@ export default { eventName: o.updateMoveTaskOrderStatus, tableName: t.moves, getEventNameDisplay: () => 'Approved move', - getDetails: () => <> Created Move Task Order (MTO) , + getDetails: ({ changedValues }) => { + return ( + <> +
Created Move Task Order (MTO)
+ {changedValues?.too_assigned_id !== undefined ?
Task Ordering Officer Unassigned
: null} + + ); + }, }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.test.jsx index 6f6f5a11f78..c7a47beb1d3 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateMoveTaskOrderStatus/updateMoveTaskOrderStatus.test.jsx @@ -27,4 +27,16 @@ describe('when given a Move approved history record', () => { expect(screen.getByText('Approved move')); expect(screen.getByText('Created Move Task Order (MTO)')); }); + + it('displays correct details when a TOO is unassigned', () => { + historyRecord.changedValues = { + ...historyRecord.changedValues, + too_assigned_id: null, + }; + + const template = getTemplate(historyRecord); + render(template.getDetails(historyRecord)); + expect(screen.getByText('Created Move Task Order (MTO)')); + expect(screen.getByText('Task Ordering Officer Unassigned')); + }); }); diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx new file mode 100644 index 00000000000..fb63a54891d --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx @@ -0,0 +1,16 @@ +import React from 'react'; + +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; + +export default { + action: a.UPDATE, + eventName: o.updatePaymentRequestStatus, + tableName: t.moves, + getEventNameDisplay: () => 'Updated move', + getDetails: ({ changedValues }) => { + if (changedValues?.tio_assigned_id !== undefined) return <> Task Invoicing Officer Unassigned ; + return <> - ; + }, +}; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx new file mode 100644 index 00000000000..8e555c10d84 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx @@ -0,0 +1,41 @@ +import { screen, render } from '@testing-library/react'; + +import e from 'constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves'; +import getTemplate from 'constants/MoveHistory/TemplateManager'; + +describe('When given a completed services counseling for a move', () => { + const historyRecord = { + action: 'UPDATE', + eventName: 'updatePaymentRequestStatus', + tableName: 'moves', + }; + it('correctly matches the update mto status services counseling completed event to the proper template', () => { + const template = getTemplate(historyRecord); + expect(template).toMatchObject(e); + }); + + it('displays the proper name in the event name display column', () => { + const template = getTemplate(historyRecord); + + render(template.getEventNameDisplay(historyRecord)); + expect(screen.getByText('Updated move')).toBeInTheDocument(); + }); + + it('defaults to blank entry if TIO ID is not present in changedValues', () => { + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('-')).toBeInTheDocument(); + }); + + it('displays correct details when a TIO is unassigned', () => { + historyRecord.changedValues = { + ...historyRecord.changedValues, + tio_assigned_id: null, + }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task Invoicing Officer Unassigned')).toBeInTheDocument(); + }); +}); diff --git a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx index 799beef3b0a..4f0a084d37c 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx @@ -10,5 +10,12 @@ export default { eventName: o.updateMTOServiceItemStatus, tableName: t.moves, getEventNameDisplay: () => 'Updated move', - getDetails: (historyRecord) => , + getDetails: (historyRecord) => { + return ( + <> + + {historyRecord.changedValues.too_assigned_id !== undefined ? <>Task Ordering Officer Unassigned : null} + + ); + }, }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx index 6660baa258e..b77cade3d48 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx @@ -25,4 +25,15 @@ describe('when given a update service item status, update move history record', expect(screen.getByText(value)).toBeInTheDocument(); }); }); + + it('displays correct details when a TOO is unassigned', () => { + historyRecord.changedValues = { + ...historyRecord.changedValues, + too_assigned_id: null, + }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('Task Ordering Officer Unassigned')).toBeInTheDocument(); + }); }); diff --git a/src/constants/MoveHistory/EventTemplates/index.js b/src/constants/MoveHistory/EventTemplates/index.js index afcbd6b7060..8a6a16db356 100644 --- a/src/constants/MoveHistory/EventTemplates/index.js +++ b/src/constants/MoveHistory/EventTemplates/index.js @@ -109,3 +109,6 @@ export { default as moveCancelerPPMShipments } from './MoveCanceler/MoveCanceler export { default as cancelMove } from './CancelMove/CancelMove'; export { default as cancelMoveMTOShipments } from './CancelMove/CancelMoveMTOShipments'; export { default as cancelMovePPMShipments } from './CancelMove/CancelMovePPMShipments'; +export { default as updateAssignedOfficeUser } from './UpdateAssignedOfficeUser/UpdateAssignedOfficeUser'; +export { default as deleteAssignedOfficeUser } from './UpdateAssignedOfficeUser/DeleteAssignedOfficeUser'; +export { default as UpdatePaymentRequestStatusMoves } from './UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves'; diff --git a/src/constants/MoveHistory/UIDisplay/Operations.js b/src/constants/MoveHistory/UIDisplay/Operations.js index 8ca4a3f5cd0..43ecc2ea6e5 100644 --- a/src/constants/MoveHistory/UIDisplay/Operations.js +++ b/src/constants/MoveHistory/UIDisplay/Operations.js @@ -65,4 +65,6 @@ export default { addAppealToViolation: 'addAppealToViolation', // ghc.yaml addAppealToSeriousIncident: 'addAppealToSeriousIncident', // ghc.yaml cancelMove: 'cancelMove', // internal.yaml + updateAssignedOfficeUser: 'updateAssignedOfficeUser', // ghc.yaml + deleteAssignedOfficeUser: 'deleteAssignedOfficeUser', // ghc.yaml }; diff --git a/src/utils/formatters.js b/src/utils/formatters.js index 1470ad756ad..1215e9068b6 100644 --- a/src/utils/formatters.js +++ b/src/utils/formatters.js @@ -593,3 +593,17 @@ export const constructSCOrderOconusFields = (values) => { null, }; }; + +export const formatAssignedOfficeUserFromContext = (historyRecord) => { + const { changedValues, context } = historyRecord; + const newValues = {}; + if (!context) return newValues; + + const name = `${context[0].assigned_office_user_last_name}, ${context[0].assigned_office_user_first_name}`; + + if (changedValues.sc_assigned_id) newValues.assigned_sc = name; + if (changedValues.too_assigned_id) newValues.assigned_too = name; + if (changedValues.tio_assigned_id) newValues.assigned_tio = name; + + return newValues; +}; diff --git a/src/utils/formatters.test.js b/src/utils/formatters.test.js index 481cea6cf7a..86a6e9e86aa 100644 --- a/src/utils/formatters.test.js +++ b/src/utils/formatters.test.js @@ -345,6 +345,53 @@ describe('formatters', () => { }); }); +describe('formatAssignedOfficeUserFromContext', () => { + it('properly formats an SCs name', () => { + const values = { + changedValues: { + sc_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', + }, + context: [{ assigned_office_user_last_name: 'Daniels', assigned_office_user_first_name: 'Jayden' }], + }; + + const result = formatters.formatAssignedOfficeUserFromContext(values); + + expect(result).toEqual({ + assigned_sc: 'Daniels, Jayden', + }); + }); + + it('properly formats a TOOs name', () => { + const values = { + changedValues: { + too_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', + }, + context: [{ assigned_office_user_last_name: 'McLaurin', assigned_office_user_first_name: 'Terry' }], + }; + + const result = formatters.formatAssignedOfficeUserFromContext(values); + + expect(result).toEqual({ + assigned_too: 'McLaurin, Terry', + }); + }); + + it('properly formats a TIOs name', () => { + const values = { + changedValues: { + tio_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', + }, + context: [{ assigned_office_user_last_name: 'Robinson', assigned_office_user_first_name: 'Brian' }], + }; + + const result = formatters.formatAssignedOfficeUserFromContext(values); + + expect(result).toEqual({ + assigned_tio: 'Robinson, Brian', + }); + }); +}); + describe('constructSCOrderOconusFields', () => { it('returns null for all fields if not OCONUS and no dependents', () => { const values = { From 6a767151b3bb4b09802b7b3c19fc4286319e537e Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Tue, 7 Jan 2025 23:12:21 +0000 Subject: [PATCH 010/229] Add counseling office to orders list component --- .../Office/DefinitionLists/OrdersList.jsx | 10 +++++-- .../DefinitionLists/OrdersList.stories.jsx | 18 +++++++++++ .../DefinitionLists/OrdersList.test.jsx | 9 +++++- src/pages/Office/MoveDetails/MoveDetails.jsx | 2 +- .../ServicesCounselingMoveDetails.jsx | 2 +- src/setupProxy.js | 30 +++++++++---------- 6 files changed, 51 insertions(+), 20 deletions(-) diff --git a/src/components/Office/DefinitionLists/OrdersList.jsx b/src/components/Office/DefinitionLists/OrdersList.jsx index 46ec027d40e..f915abc480c 100644 --- a/src/components/Office/DefinitionLists/OrdersList.jsx +++ b/src/components/Office/DefinitionLists/OrdersList.jsx @@ -15,7 +15,7 @@ import { ordersTypeDetailReadable, } from 'utils/formatters'; -const OrdersList = ({ ordersInfo, showMissingWarnings }) => { +const OrdersList = ({ ordersInfo, moveInfo, showMissingWarnings }) => { const { ordersType } = ordersInfo; const isRetiree = ordersType === 'RETIREMENT'; const isSeparatee = ordersType === 'SEPARATION'; @@ -57,6 +57,12 @@ const OrdersList = ({ ordersInfo, showMissingWarnings }) => {
Current duty location
{ordersInfo.currentDutyLocation?.name}
+
+
Counseling office
+
+ {moveInfo.counselingOffice?.name ? moveInfo.counselingOffice?.name : '—'} +
+
{ {isRetiree || isSeparatee ? 'HOR, HOS, or PLEAD' : 'New duty location'}
- {ordersInfo.newDutyLocation?.name ? ordersInfo.newDutyLocation?.name : '-'} + {ordersInfo.newDutyLocation?.name ? ordersInfo.newDutyLocation?.name : '—'}
( NTStac: text('ordersInfo.NTStac', '9999'), payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} />
); @@ -81,6 +84,9 @@ export const AsServiceCounselor = () => ( NTStac: '', payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} /> ); @@ -105,6 +111,9 @@ export const AsServiceCounselorProcessingRetirement = () => ( NTStac: '', payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} /> ); @@ -129,6 +138,9 @@ export const AsServiceCounselorProcessingSeparation = () => ( NTStac: '', payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} /> ); @@ -166,6 +178,9 @@ export const AsTOO = () => ( NTStac: '', payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} /> ); @@ -212,6 +227,9 @@ export const AsTOOProcessingSeparation = () => ( NTStac: '', payGrade: text('ordersInfo.payGrade', 'E_5'), }} + moveInfo={{ + name: 'PPPO Los Angeles SFB - USAF', + }} /> ); diff --git a/src/components/Office/DefinitionLists/OrdersList.test.jsx b/src/components/Office/DefinitionLists/OrdersList.test.jsx index 586c0d1bfab..107463b7a1c 100644 --- a/src/components/Office/DefinitionLists/OrdersList.test.jsx +++ b/src/components/Office/DefinitionLists/OrdersList.test.jsx @@ -32,9 +32,16 @@ const ordersInfo = { payGrade: 'E_7', }; +const moveInfo = { + counselingOffice: { + name: 'PPPO Los Angeles SFB - USAF', + }, +}; + // what ordersInfo from above should be rendered as const expectedRenderedOrdersInfo = { currentDutyLocation: 'JBSA Lackland', + counselingOffice: 'PPPO Los Angeles SFB - USAF', newDutyLocation: 'JB Lewis-McChord', issuedDate: '08 Mar 2020', reportByDate: '01 Apr 2020', @@ -65,7 +72,7 @@ const ordersInfoMissing = { describe('OrdersList', () => { it('renders formatted orders info', () => { - render(); + render(); Object.keys(expectedRenderedOrdersInfo).forEach((key) => { expect(screen.getByText(expectedRenderedOrdersInfo[key])).toBeInTheDocument(); }); diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index d47156e3dc0..3ee4c4d3dcf 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -638,7 +638,7 @@ const MoveDetails = ({ } shipmentsInfoNonPpm={shipmentsInfoNonPPM} > - +
diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 82e50380a2f..2c6bc7cef99 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -878,7 +878,7 @@ const ServicesCounselingMoveDetails = ({ } ppmShipmentInfoNeedsApproval={ppmShipmentsInfoNeedsApproval} > - +
diff --git a/src/setupProxy.js b/src/setupProxy.js index 3a6b0f36484..7d92e2f9aea 100644 --- a/src/setupProxy.js +++ b/src/setupProxy.js @@ -1,19 +1,19 @@ const { createProxyMiddleware } = require('http-proxy-middleware'); module.exports = (app) => { - app.use(createProxyMiddleware('/api', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/internal', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/admin', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/ghc', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/prime', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/pptas', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/support', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/testharness', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/storage', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/devlocal-auth', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/auth/**', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/logout', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/downloads', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/debug/**', { target: 'http://milmovelocal:8080/' })); - app.use(createProxyMiddleware('/client/**', { target: 'http://milmovelocal:8080/' })); + app.use('/api', createProxyMiddleware({ target: 'http://milmovelocal:8080/api' })); + app.use('/internal', createProxyMiddleware({ target: 'http://milmovelocal:8080/internal' })); + app.use('/admin', createProxyMiddleware({ target: 'http://milmovelocal:8080/admin' })); + app.use('/ghc', createProxyMiddleware({ target: 'http://milmovelocal:8080/ghc' })); + app.use('/prime', createProxyMiddleware({ target: 'http://milmovelocal:8080/prime' })); + app.use('/pptas', createProxyMiddleware({ target: 'http://milmovelocal:8080/pptas' })); + app.use('/support', createProxyMiddleware({ target: 'http://milmovelocal:8080/support' })); + app.use('/testharness', createProxyMiddleware({ target: 'http://milmovelocal:8080/testharness' })); + app.use('/storage', createProxyMiddleware({ target: 'http://milmovelocal:8080/storage' })); + app.use('/devlocal-auth', createProxyMiddleware({ target: 'http://milmovelocal:8080/devlocal-auth' })); + app.use('/auth', createProxyMiddleware({ target: 'http://milmovelocal:8080/auth' })); + app.use('/logout', createProxyMiddleware({ target: 'http://milmovelocal:8080/logout' })); + app.use('/downloads', createProxyMiddleware({ target: 'http://milmovelocal:8080/downloads' })); + app.use('/debug', createProxyMiddleware({ target: 'http://milmovelocal:8080/debug' })); + app.use('/client', createProxyMiddleware({ target: 'http://milmovelocal:8080/client' })); }; From 6db16ee3ca6b8dcc65342b0cd4b45b071f5749f6 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Wed, 8 Jan 2025 14:21:05 +0000 Subject: [PATCH 011/229] capitalize sql --- pkg/assets/sql_scripts/move_history_fetcher.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/assets/sql_scripts/move_history_fetcher.sql b/pkg/assets/sql_scripts/move_history_fetcher.sql index 718d835b2cb..305c682ec4f 100644 --- a/pkg/assets/sql_scripts/move_history_fetcher.sql +++ b/pkg/assets/sql_scripts/move_history_fetcher.sql @@ -54,16 +54,16 @@ WITH move AS ( 'counseling_office_name', (SELECT transportation_offices.name FROM transportation_offices WHERE transportation_offices.id = uuid(c.counseling_transportation_office_id)), 'assigned_office_user_first_name', - (select office_users.first_name from office_users where office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))), + (SELECT office_users.first_name FROM office_users WHERE office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))), 'assigned_office_user_last_name', - (select office_users.last_name from office_users where office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))) + (SELECT office_users.last_name FROM office_users WHERE office_users.id IN (uuid(c.sc_assigned_id), uuid(c.too_assigned_id), uuid(c.tio_assigned_id))) )) )::TEXT AS context, NULL AS context_id FROM audit_history JOIN move ON audit_history.object_id = move.id - JOIN jsonb_to_record(audit_history.changed_data) as c(closeout_office_id TEXT, counseling_transportation_office_id text, sc_assigned_id text, too_assigned_id text, tio_assigned_id text) on TRUE + JOIN jsonb_to_record(audit_history.changed_data) as c(closeout_office_id TEXT, counseling_transportation_office_id TEXT, sc_assigned_id TEXT, too_assigned_id TEXT, tio_assigned_id TEXT) ON TRUE WHERE audit_history.table_name = 'moves' -- Remove log for when shipment_seq_num updates AND NOT (audit_history.event_name = NULL AND audit_history.changed_data::TEXT LIKE '%shipment_seq_num%' AND LENGTH(audit_history.changed_data::TEXT) < 25) From 9dfc76ce90e3cc1bf31eb04641c45c0f304c0340 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 8 Jan 2025 16:00:43 +0000 Subject: [PATCH 012/229] counseling office in orders card test fix --- src/components/Office/DefinitionLists/OrdersList.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Office/DefinitionLists/OrdersList.jsx b/src/components/Office/DefinitionLists/OrdersList.jsx index f915abc480c..27de47eb1fc 100644 --- a/src/components/Office/DefinitionLists/OrdersList.jsx +++ b/src/components/Office/DefinitionLists/OrdersList.jsx @@ -60,7 +60,7 @@ const OrdersList = ({ ordersInfo, moveInfo, showMissingWarnings }) => {
Counseling office
- {moveInfo.counselingOffice?.name ? moveInfo.counselingOffice?.name : '—'} + {moveInfo?.counselingOffice?.name ? moveInfo.counselingOffice.name : '—'}
Date: Wed, 8 Jan 2025 13:15:42 -0600 Subject: [PATCH 013/229] Remove duty loc 55460, rename migration file --- migrations/app/migrations_manifest.txt | 2 +- .../app/schema/20250106202424_update_duty_locs.up.sql | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 migrations/app/schema/20250106202424_update_duty_locs.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 07bfebbf72a..44b525889f5 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1063,4 +1063,4 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql -20250106202424_insert_transportation_offices_meridian_ms.up.sql \ No newline at end of file +20250106202424_update_duty_locs.up.sql \ No newline at end of file diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql new file mode 100644 index 00000000000..7c45653bc3e --- /dev/null +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -0,0 +1,11 @@ +--update duty location for NAS Meridian, MS to use zip 39309 +update duty_locations set name = 'NAS Meridian, MS 39309', address_id = '691551c2-71fe-4a15-871f-0c46dff98230' where id = '334fecaf-abeb-49ce-99b5-81d69c8beae5'; + +--remove 39302 duty location +delete from duty_locations where id = 'e55be32c-bf89-4927-8893-4454a26bfd55'; + +--update duty location for Minneapolis, MN 55460 to use 55467 +update orders set new_duty_location_id = 'fc4d669f-594a-4784-9831-bf2eb9f8948b' where new_duty_location_id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344'; + +--remove 55460 duty location +delete from duty_locations where id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344'; \ No newline at end of file From 633df9d3b3b37843ce9562db565238e42a86f96a Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 8 Jan 2025 13:42:30 -0600 Subject: [PATCH 014/229] add weight restriction --- migrations/app/migrations_manifest.txt | 1 + ...250107184554_add_weight_restriction.up.sql | 4 +++ pkg/gen/ghcapi/embedded_spec.go | 32 +++++++++++++++++++ .../counseling_update_allowance_payload.go | 4 +++ pkg/gen/ghcmessages/entitlements.go | 4 +++ .../ghcmessages/update_allowance_payload.go | 4 +++ pkg/gen/primeapi/embedded_spec.go | 10 ++++++ pkg/gen/primemessages/entitlements.go | 4 +++ pkg/gen/primev2api/embedded_spec.go | 10 ++++++ pkg/gen/primev2messages/entitlements.go | 4 +++ pkg/gen/primev3api/embedded_spec.go | 10 ++++++ pkg/gen/primev3messages/entitlements.go | 4 +++ pkg/gen/supportapi/embedded_spec.go | 8 +++++ pkg/gen/supportmessages/entitlement.go | 4 +++ .../internal/payloads/model_to_payload.go | 10 ++++-- .../primeapi/payloads/model_to_payload.go | 9 +++--- .../primeapiv2/payloads/model_to_payload.go | 9 +++--- .../primeapiv3/payloads/model_to_payload.go | 9 +++--- .../internal/payloads/model_to_payload.go | 10 +++--- pkg/models/ghc_entitlements.go | 1 + pkg/services/order/order_updater.go | 8 +++-- .../AllowancesDetailForm.jsx | 29 +++++++++++------ .../Office/DefinitionLists/AllowancesList.jsx | 4 ++- .../MoveHistory/Database/FieldMappings.js | 1 + .../Office/MoveAllowances/MoveAllowances.jsx | 4 +++ src/pages/Office/MoveDetails/MoveDetails.jsx | 1 + .../ServicesCounselingMoveAllowances.jsx | 4 +++ .../ServicesCounselingMoveDetails.jsx | 1 + .../definitions/prime/Entitlements.yaml | 4 +++ swagger-def/ghc.yaml | 13 ++++++++ swagger-def/support.yaml | 3 ++ swagger/ghc.yaml | 15 +++++++++ swagger/prime.yaml | 4 +++ swagger/prime_v2.yaml | 4 +++ swagger/prime_v3.yaml | 4 +++ swagger/support.yaml | 3 ++ 36 files changed, 221 insertions(+), 32 deletions(-) create mode 100644 migrations/app/schema/20250107184554_add_weight_restriction.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index ffaf109d530..5be0ac320d2 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1061,3 +1061,4 @@ 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250106153750_admin_weight_restriction.up.sql 20250106190758_admin_weight_restriction_convert_bool.up.sql +20250107184554_add_weight_restriction.up.sql diff --git a/migrations/app/schema/20250107184554_add_weight_restriction.up.sql b/migrations/app/schema/20250107184554_add_weight_restriction.up.sql new file mode 100644 index 00000000000..6d2a0ce08f6 --- /dev/null +++ b/migrations/app/schema/20250107184554_add_weight_restriction.up.sql @@ -0,0 +1,4 @@ +ALTER TABLE entitlements +ADD column weight_restriction int; + +COMMENT ON COLUMN entitlements.weight_restriction IS 'The weight restricted on the move to a particular location'; diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index a0183a05515..2bdafeafd2d 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6929,6 +6929,13 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "unit is in lbs", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -8135,6 +8142,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "description": "The amount of weight in pounds that the move is restricted to for a particular location.", + "type": "integer", + "example": 1500 } } }, @@ -13866,6 +13878,10 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "type": "integer", + "example": 1500 } } }, @@ -23687,6 +23703,13 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "unit is in lbs", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -24893,6 +24916,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "description": "The amount of weight in pounds that the move is restricted to for a particular location.", + "type": "integer", + "example": 1500 } } }, @@ -30756,6 +30784,10 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "type": "integer", + "example": 1500 } } }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index c1a0ce9f418..78fa59fa9fb 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -73,6 +73,10 @@ type CounselingUpdateAllowancePayload struct { // ub allowance // Example: 500 UbAllowance *int64 `json:"ubAllowance,omitempty"` + + // unit is in lbs + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this counseling update allowance payload diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 7699f3be0e3..bc8ab2aad65 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -94,6 +94,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // The amount of weight in pounds that the move is restricted to for a particular location. + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index 0a63d9b9fa9..391b664a827 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -73,6 +73,10 @@ type UpdateAllowancePayload struct { // ub allowance // Example: 500 UbAllowance *int64 `json:"ubAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this update allowance payload diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 5df9a70d690..a2089ab4ff6 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1805,6 +1805,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, @@ -6703,6 +6708,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index a1e606a00aa..f414734eb5d 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 849b5f6783b..7b513facec7 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -1041,6 +1041,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, @@ -4652,6 +4657,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index b39c4b64fd8..20bcf683c79 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index b5fc1983191..5c2a9e740d7 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1203,6 +1203,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, @@ -5461,6 +5466,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "example": 1500 } } }, diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index d642d70f69b..3e3568aacdc 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index c50b1a37c98..45e90f65b9e 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1187,6 +1187,10 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "example": 1500 } } }, @@ -4058,6 +4062,10 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "example": 1500 } } }, diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 4ae036d582c..2247b355374 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -85,6 +85,10 @@ type Entitlement struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlement diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 482074aa402..ba1facad756 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -718,6 +718,11 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) gunSafe := entitlement.GunSafe adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation + + var weightRestriction int64 + wr := int64(entitlement.WeightRestriction) + weightRestriction = wr + var accompaniedTour *bool if entitlement.AccompaniedTour != nil { accompaniedTour = models.BoolPointer(*entitlement.AccompaniedTour) @@ -753,11 +758,10 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, GunSafe: gunSafe, AdminRestrictedWeightLocation: adminRestrictedWeightLocation, + WeightRestriction: weightRestriction, ETag: etag.GenerateEtag(entitlement.UpdatedAt), } -} - -// DutyLocation payload +} // DutyLocation payload func DutyLocation(dutyLocation *models.DutyLocation) *ghcmessages.DutyLocation { if dutyLocation == nil { return nil diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 57ae9b12a4b..29d5aed536a 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -224,10 +224,11 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: int64(entitlement.WeightRestriction), + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 2ece0f55833..44183723ac2 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -169,10 +169,11 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: int64(entitlement.WeightRestriction), + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index f4cd6ab2609..5723796265d 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -169,10 +169,11 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: int64(entitlement.WeightRestriction), + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go index 5e43cd2070b..55d81ac65a8 100644 --- a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go @@ -151,6 +151,7 @@ func Entitlement(entitlement *models.Entitlement) *supportmessages.Entitlement { if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + return &supportmessages.Entitlement{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -162,10 +163,11 @@ func Entitlement(entitlement *models.Entitlement) *supportmessages.Entitlement { ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: int64(entitlement.WeightRestriction), + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index 7497291cb8c..f8e6a383bf6 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -32,6 +32,7 @@ type Entitlement struct { ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` + WeightRestriction int `db:"weight_restriction"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` } diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 323bd7a0592..a8692b14653 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -460,6 +460,8 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation } + order.Entitlement.WeightRestriction = int(payload.WeightRestriction) + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } @@ -505,8 +507,8 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. } return order -} +} func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder models.Order, payload ghcmessages.CounselingUpdateAllowancePayload) models.Order { order := existingOrder @@ -564,6 +566,8 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation } + order.Entitlement.WeightRestriction = int(*payload.WeightRestriction) + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } @@ -603,8 +607,8 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder } return order -} +} func (f *orderUpdater) saveDocumentForAmendedOrder(appCtx appcontext.AppContext, doc *models.Document) (*models.Document, error) { var docID uuid.UUID if doc != nil { diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index edc345478ea..23c99ba8862 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,8 +20,9 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); - const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(false); - + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState( + entitlements?.adminRestrictedWeightLocation || false, + ); useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -175,15 +176,23 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab isDisabled={formIsDisabled} onChange={(e) => setIsAdminWeightLocationChecked(e.target.checked)} /> - {isAdminWeightLocationChecked && ( - - )}
+ {isAdminWeightLocationChecked && ( + + )} +
Standard Weight allowance
{formatWeight(entitlements.totalWeight)}
diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 3e0cf3dd93d..185a81be3f5 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -110,7 +110,9 @@ const AllowancesList = ({ info, showVisualCues }) => {
Weight Restriction
-
-
+
+ {info.weightRestriction ? formatWeight(info.weightRestriction) : DEFAULT_EMPTY_VALUE} +
diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 1b216087f52..12c7a71d67d 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -40,6 +40,7 @@ export default { organizational_clothing_and_individual_equipment: 'OCIE', gun_safe: 'Gun Safe', admin_restricted_weight_location: 'Admin restricted weight location', + weight_restriction: 'Weight restriction', requested_pickup_date: 'Requested pickup date', grade: 'Pay grade', shipment_type: 'Shipment type', diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 1412c39c972..346a0c6c263 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -99,6 +99,7 @@ const MoveAllowances = () => { storageInTransit, gunSafe, adminRestrictedWeightLocation, + weightRestriction, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -120,6 +121,7 @@ const MoveAllowances = () => { storageInTransit: Number(storageInTransit), gunSafe, adminRestrictedWeightLocation, + weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -136,6 +138,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -152,6 +155,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction, storageInTransit: `${storageInTransit}`, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index 49209ee870b..81da8df5671 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -415,6 +415,7 @@ const MoveDetails = ({ dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, ubAllowance: allowances.unaccompaniedBaggageAllowance, + weightRestriction: allowances.weightRestriction, }; const customerInfo = { diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index c954518334c..299d6de374d 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -87,6 +87,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit, gunSafe, adminRestrictedWeightLocation, + weightRestriction, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -108,6 +109,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -124,6 +126,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -140,6 +143,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: `${storageInTransit}`, gunSafe, adminRestrictedWeightLocation, + weightRestriction, organizationalClothingAndIndividualEquipment, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index da6d6a2a34d..4fa2f82bbe6 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -392,6 +392,7 @@ const ServicesCounselingMoveDetails = ({ dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, ubAllowance: allowances.unaccompaniedBaggageAllowance, + weightRestriction: allowances.weightRestriction, }; const ordersInfo = { diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 8a95dccf41c..45e4f573900 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -57,6 +57,10 @@ properties: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight eTag: type: string readOnly: true diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index c39682a8598..45017e8cb08 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -5026,6 +5026,10 @@ definitions: example: 3 x-nullable: true description: Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + weightRestriction: + type: integer + example: 1500 + description: The amount of weight in pounds that the move is restricted to for a particular location. eTag: type: string type: object @@ -5837,6 +5841,9 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer UpdateBillableWeightPayload: type: object properties: @@ -5933,6 +5940,12 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + description: unit is in lbs + x-formatting: weight + x-nullable: true MoveTaskOrder: description: The Move (MoveTaskOrder) properties: diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 5f94bc926db..b487f1bdaea 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -916,6 +916,9 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer eTag: type: string readOnly: true diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 83842cc917f..74a3ff2d4a5 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5231,6 +5231,12 @@ definitions: description: >- Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + weightRestriction: + type: integer + example: 1500 + description: >- + The amount of weight in pounds that the move is restricted to for a + particular location. eTag: type: string type: object @@ -6086,6 +6092,9 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer UpdateBillableWeightPayload: type: object properties: @@ -6195,6 +6204,12 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + description: unit is in lbs + x-formatting: weight + x-nullable: true MoveTaskOrder: description: The Move (MoveTaskOrder) properties: diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 8af5a4ee92d..974b986a39d 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3059,6 +3059,10 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight eTag: type: string readOnly: true diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 05ac5076d6c..20c3c8243b6 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1670,6 +1670,10 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight eTag: type: string readOnly: true diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index 398bf9c100d..b7122385c20 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1758,6 +1758,10 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight eTag: type: string readOnly: true diff --git a/swagger/support.yaml b/swagger/support.yaml index bd09358deef..0d90796ada5 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -991,6 +991,9 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer eTag: type: string readOnly: true From eb0949e76ead2c9c3daffd47237e5c405d888fae Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 8 Jan 2025 21:19:00 +0000 Subject: [PATCH 015/229] extend counselor add orders with counseling offices tests --- pkg/handlers/ghcapi/transportation_offices_test.go | 10 ++++++++-- .../Office/AddOrdersForm/AddOrdersForm.test.jsx | 5 +++++ .../ServicesCounselingAddOrders.test.jsx | 7 +++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/pkg/handlers/ghcapi/transportation_offices_test.go b/pkg/handlers/ghcapi/transportation_offices_test.go index 10c0a51ddd2..087c5c2d243 100644 --- a/pkg/handlers/ghcapi/transportation_offices_test.go +++ b/pkg/handlers/ghcapi/transportation_offices_test.go @@ -174,7 +174,7 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { }, { Model: models.TransportationOffice{ - Name: "PPPO Travis AFB - USAF", + Name: "New PPPO Travis AFB - USAF", Gbloc: "KKFA", ProvidesCloseout: true, }, @@ -200,5 +200,11 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { // Validate outgoing payload suite.NoError(responsePayload.Payload.Validate(strfmt.Default)) - + var i int + for index, office := range responsePayload.Payload { + if *office.Name == "New PPPO Travis AFB - USAF" { + i = index + } + } + suite.NotNil(i) } diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index ed9a856cdfa..804c6f71642 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -260,5 +260,10 @@ describe('AddOrdersForm - With Counseling Office', () => { const counselingOfficeLabel = await screen.queryByText(/Counseling office/); expect(counselingOfficeLabel).toBeTruthy(); + + await userEvent.selectOptions(screen.getByLabelText(/Counseling office/), ['Albuquerque AFB']); + + const nextBtn = screen.getByRole('button', { name: 'Next' }); + expect(nextBtn.getAttribute('disabled')).toBeFalsy(); }); }); diff --git a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx index 497ebcbe081..a0accc4b2db 100644 --- a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx @@ -409,9 +409,16 @@ describe('ServicesCounselingAddOrders component', () => { const counselingOfficeLabel = await screen.queryByText(/Counseling office/); expect(counselingOfficeLabel).toBeTruthy(); + await userEvent.selectOptions(screen.getByLabelText(/Counseling office/), ['Glendale Luke AFB']); + await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Luke/); await user.click(selectedOptionNew); + + const nextBtn = await screen.findByRole('button', { name: 'Next' }); + await waitFor(() => { + expect(nextBtn.getAttribute('disabled')).toBeFalsy(); + }); }); it('routes to the move details page when the next button is clicked for OCONUS orders', async () => { From a0131278d4e90a595eb6b3f75562ea850d7a2ab6 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 9 Jan 2025 20:57:50 +0000 Subject: [PATCH 016/229] increase test coverage of counseling offices model to payload per review request --- .../payloads/model_to_payload_test.go | 31 ++++++++++++++++++ .../payloads/model_to_payload_test.go | 32 +++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index ec3072d2ca0..e1aa18da846 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -950,3 +950,34 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { suite.Equal(handlers.FmtString(models.MarketOconus.FullString()), result.Market, "Expected Market to be OCONUS") }) } + +func (suite *PayloadsSuite) TestCounselingOffices() { + suite.Run("correctly maps transportaion offices to counseling offices payload", func() { + office1 := factory.BuildTransportationOffice(nil, []factory.Customization{ + { + Model: models.TransportationOffice{ + ID: uuid.Must(uuid.NewV4()), + Name: "PPPO Fort Liberty", + }, + }, + }, nil) + + office2 := factory.BuildTransportationOffice(nil, []factory.Customization{ + { + Model: models.TransportationOffice{ + ID: uuid.Must(uuid.NewV4()), + Name: "PPPO Fort Walker", + }, + }, + }, nil) + + offices := models.TransportationOffices{office1, office2} + + payload := CounselingOffices(offices) + + suite.IsType(payload, ghcmessages.CounselingOffices{}) + suite.Equal(2, len(payload)) + suite.Equal(office1.ID.String(), payload[0].ID.String()) + suite.Equal(office2.ID.String(), payload[1].ID.String()) + }) +} diff --git a/pkg/handlers/internalapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/internalapi/internal/payloads/model_to_payload_test.go index c88ec3b12ff..c91a8073807 100644 --- a/pkg/handlers/internalapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/internalapi/internal/payloads/model_to_payload_test.go @@ -3,6 +3,7 @@ package payloads import ( "github.com/gofrs/uuid" + "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/gen/internalmessages" "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/models" @@ -115,3 +116,34 @@ func (suite *PayloadsSuite) TestVLocation() { suite.Equal(county, *(payload.County), "Expected County to match") }) } + +func (suite *PayloadsSuite) TestCounselingOffices() { + suite.Run("correctly maps transportaion offices to counseling offices payload", func() { + office1 := factory.BuildTransportationOffice(nil, []factory.Customization{ + { + Model: models.TransportationOffice{ + ID: uuid.Must(uuid.NewV4()), + Name: "PPPO Fort Liberty", + }, + }, + }, nil) + + office2 := factory.BuildTransportationOffice(nil, []factory.Customization{ + { + Model: models.TransportationOffice{ + ID: uuid.Must(uuid.NewV4()), + Name: "PPPO Fort Walker", + }, + }, + }, nil) + + offices := models.TransportationOffices{office1, office2} + + payload := CounselingOffices(offices) + + suite.IsType(payload, internalmessages.CounselingOffices{}) + suite.Equal(2, len(payload)) + suite.Equal(office1.ID.String(), payload[0].ID.String()) + suite.Equal(office2.ID.String(), payload[1].ID.String()) + }) +} From 024916fc685eda27147be556e16cea6c26cbdea3 Mon Sep 17 00:00:00 2001 From: pambecker Date: Thu, 9 Jan 2025 21:38:46 +0000 Subject: [PATCH 017/229] PaymentRequest bulk assign --- pkg/gen/ghcapi/configure_mymove.go | 5 + pkg/gen/ghcapi/embedded_spec.go | 145 ++++++++++++- pkg/gen/ghcapi/ghcoperations/mymove_api.go | 12 ++ .../queues/get_bulk_assignment_data.go | 2 +- .../get_bulk_assignment_data_parameters.go | 2 +- ...et_bulk_assignment_payment_request_data.go | 58 ++++++ ...ignment_payment_request_data_parameters.go | 92 +++++++++ ...signment_payment_request_data_responses.go | 194 ++++++++++++++++++ ...ignment_payment_request_data_urlbuilder.go | 103 ++++++++++ .../bulk_assignment_payment_request_data.go | 142 +++++++++++++ .../bulk_assignment_payment_request_i_ds.go | 70 +++++++ .../bulk_assignment_payment_request_id.go | 39 ++++ pkg/handlers/ghcapi/api.go | 6 + .../internal/payloads/model_to_payload.go | 24 +++ pkg/handlers/ghcapi/queues.go | 66 ++++++ pkg/models/payment_request.go | 5 + pkg/services/payment_request.go | 4 + .../payment_request_fetcher.go | 49 +++++ src/hooks/queries.js | 15 ++ src/services/ghcApi.js | 4 + swagger-def/ghc.yaml | 47 ++++- swagger/ghc.yaml | 49 ++++- 22 files changed, 1121 insertions(+), 12 deletions(-) create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go create mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go create mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go create mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go index 2c7449ec836..0ad30ff96d8 100644 --- a/pkg/gen/ghcapi/configure_mymove.go +++ b/pkg/gen/ghcapi/configure_mymove.go @@ -227,6 +227,11 @@ func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") }) } + if api.QueuesGetBulkAssignmentPaymentRequestDataHandler == nil { + api.QueuesGetBulkAssignmentPaymentRequestDataHandler = queues.GetBulkAssignmentPaymentRequestDataHandlerFunc(func(params queues.GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetBulkAssignmentPaymentRequestData has not yet been implemented") + }) + } if api.CustomerGetCustomerHandler == nil { api.CustomerGetCustomerHandler = customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 8ac79c787e2..14e6957b1b0 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -4321,15 +4321,14 @@ func init() { "tags": [ "queues" ], - "summary": "Gets data for bulk assignment modal", + "summary": "Gets data for bulk assignment move modal", "operationId": "getBulkAssignmentData", "parameters": [ { "enum": [ "COUNSELING", "CLOSEOUT", - "TASK_ORDER", - "PAYMENT_REQUEST" + "TASK_ORDER" ], "type": "string", "description": "A string corresponding to the queue type", @@ -4356,6 +4355,47 @@ func init() { } } }, + "/queues/bulk-assignment-payment-requests": { + "get": { + "description": "Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets data for bulk assignment payment request modal", + "operationId": "getBulkAssignmentPaymentRequestData", + "parameters": [ + { + "enum": [ + "PAYMENT_REQUEST" + ], + "type": "string", + "description": "A string corresponding to the queue type", + "name": "queueType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned bulk assignment payment request data", + "schema": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestData" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, "/queues/counseling": { "get": { "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", @@ -6893,6 +6933,28 @@ func init() { "$ref": "#/definitions/BulkAssignmentMoveID" } }, + "BulkAssignmentPaymentRequestData": { + "type": "object", + "properties": { + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "bulkAssignmentPaymentRequestIDs": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestIDs" + } + } + }, + "BulkAssignmentPaymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "BulkAssignmentPaymentRequestIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestID" + } + }, "ClientError": { "type": "object", "required": [ @@ -20744,15 +20806,14 @@ func init() { "tags": [ "queues" ], - "summary": "Gets data for bulk assignment modal", + "summary": "Gets data for bulk assignment move modal", "operationId": "getBulkAssignmentData", "parameters": [ { "enum": [ "COUNSELING", "CLOSEOUT", - "TASK_ORDER", - "PAYMENT_REQUEST" + "TASK_ORDER" ], "type": "string", "description": "A string corresponding to the queue type", @@ -20788,6 +20849,56 @@ func init() { } } }, + "/queues/bulk-assignment-payment-requests": { + "get": { + "description": "Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets data for bulk assignment payment request modal", + "operationId": "getBulkAssignmentPaymentRequestData", + "parameters": [ + { + "enum": [ + "PAYMENT_REQUEST" + ], + "type": "string", + "description": "A string corresponding to the queue type", + "name": "queueType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned bulk assignment payment request data", + "schema": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestData" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, "/queues/counseling": { "get": { "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", @@ -23719,6 +23830,28 @@ func init() { "$ref": "#/definitions/BulkAssignmentMoveID" } }, + "BulkAssignmentPaymentRequestData": { + "type": "object", + "properties": { + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "bulkAssignmentPaymentRequestIDs": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestIDs" + } + } + }, + "BulkAssignmentPaymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "BulkAssignmentPaymentRequestIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/BulkAssignmentPaymentRequestID" + } + }, "ClientError": { "type": "object", "required": [ diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go index e64a6704256..6cbe77d291c 100644 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -164,6 +164,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { QueuesGetBulkAssignmentDataHandler: queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") }), + QueuesGetBulkAssignmentPaymentRequestDataHandler: queues.GetBulkAssignmentPaymentRequestDataHandlerFunc(func(params queues.GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetBulkAssignmentPaymentRequestData has not yet been implemented") + }), CustomerGetCustomerHandler: customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") }), @@ -500,6 +503,8 @@ type MymoveAPI struct { ReServiceItemsGetAllReServiceItemsHandler re_service_items.GetAllReServiceItemsHandler // QueuesGetBulkAssignmentDataHandler sets the operation handler for the get bulk assignment data operation QueuesGetBulkAssignmentDataHandler queues.GetBulkAssignmentDataHandler + // QueuesGetBulkAssignmentPaymentRequestDataHandler sets the operation handler for the get bulk assignment payment request data operation + QueuesGetBulkAssignmentPaymentRequestDataHandler queues.GetBulkAssignmentPaymentRequestDataHandler // CustomerGetCustomerHandler sets the operation handler for the get customer operation CustomerGetCustomerHandler customer.GetCustomerHandler // CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler sets the operation handler for the get customer support remarks for move operation @@ -828,6 +833,9 @@ func (o *MymoveAPI) Validate() error { if o.QueuesGetBulkAssignmentDataHandler == nil { unregistered = append(unregistered, "queues.GetBulkAssignmentDataHandler") } + if o.QueuesGetBulkAssignmentPaymentRequestDataHandler == nil { + unregistered = append(unregistered, "queues.GetBulkAssignmentPaymentRequestDataHandler") + } if o.CustomerGetCustomerHandler == nil { unregistered = append(unregistered, "customer.GetCustomerHandler") } @@ -1275,6 +1283,10 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } + o.handlers["GET"]["/queues/bulk-assignment-payment-requests"] = queues.NewGetBulkAssignmentPaymentRequestData(o.context, o.QueuesGetBulkAssignmentPaymentRequestDataHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } o.handlers["GET"]["/customer/{customerID}"] = customer.NewGetCustomer(o.context, o.CustomerGetCustomerHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go index a48fbcedc45..a5f97625273 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go @@ -32,7 +32,7 @@ func NewGetBulkAssignmentData(ctx *middleware.Context, handler GetBulkAssignment /* GetBulkAssignmentData swagger:route GET /queues/bulk-assignment queues getBulkAssignmentData -# Gets data for bulk assignment modal +# Gets data for bulk assignment move modal Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned */ diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go index 84675ac3ec4..57a0402fdae 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go @@ -84,7 +84,7 @@ func (o *GetBulkAssignmentDataParams) bindQueueType(rawData []string, hasKey boo // validateQueueType carries on validations for parameter QueueType func (o *GetBulkAssignmentDataParams) validateQueueType(formats strfmt.Registry) error { - if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER", "PAYMENT_REQUEST"}, true); err != nil { + if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER"}, true); err != nil { return err } diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go new file mode 100644 index 00000000000..837c5bbda92 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetBulkAssignmentPaymentRequestDataHandlerFunc turns a function with the right signature into a get bulk assignment payment request data handler +type GetBulkAssignmentPaymentRequestDataHandlerFunc func(GetBulkAssignmentPaymentRequestDataParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetBulkAssignmentPaymentRequestDataHandlerFunc) Handle(params GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { + return fn(params) +} + +// GetBulkAssignmentPaymentRequestDataHandler interface for that can handle valid get bulk assignment payment request data params +type GetBulkAssignmentPaymentRequestDataHandler interface { + Handle(GetBulkAssignmentPaymentRequestDataParams) middleware.Responder +} + +// NewGetBulkAssignmentPaymentRequestData creates a new http.Handler for the get bulk assignment payment request data operation +func NewGetBulkAssignmentPaymentRequestData(ctx *middleware.Context, handler GetBulkAssignmentPaymentRequestDataHandler) *GetBulkAssignmentPaymentRequestData { + return &GetBulkAssignmentPaymentRequestData{Context: ctx, Handler: handler} +} + +/* + GetBulkAssignmentPaymentRequestData swagger:route GET /queues/bulk-assignment-payment-requests queues getBulkAssignmentPaymentRequestData + +# Gets data for bulk assignment payment request modal + +Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned +*/ +type GetBulkAssignmentPaymentRequestData struct { + Context *middleware.Context + Handler GetBulkAssignmentPaymentRequestDataHandler +} + +func (o *GetBulkAssignmentPaymentRequestData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetBulkAssignmentPaymentRequestDataParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go new file mode 100644 index 00000000000..fe339a332bc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetBulkAssignmentPaymentRequestDataParams creates a new GetBulkAssignmentPaymentRequestDataParams object +// +// There are no default values defined in the spec. +func NewGetBulkAssignmentPaymentRequestDataParams() GetBulkAssignmentPaymentRequestDataParams { + + return GetBulkAssignmentPaymentRequestDataParams{} +} + +// GetBulkAssignmentPaymentRequestDataParams contains all the bound params for the get bulk assignment payment request data operation +// typically these are obtained from a http.Request +// +// swagger:parameters getBulkAssignmentPaymentRequestData +type GetBulkAssignmentPaymentRequestDataParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*A string corresponding to the queue type + In: query + */ + QueueType *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetBulkAssignmentPaymentRequestDataParams() beforehand. +func (o *GetBulkAssignmentPaymentRequestDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qQueueType, qhkQueueType, _ := qs.GetOK("queueType") + if err := o.bindQueueType(qQueueType, qhkQueueType, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindQueueType binds and validates parameter QueueType from query. +func (o *GetBulkAssignmentPaymentRequestDataParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.QueueType = &raw + + if err := o.validateQueueType(formats); err != nil { + return err + } + + return nil +} + +// validateQueueType carries on validations for parameter QueueType +func (o *GetBulkAssignmentPaymentRequestDataParams) validateQueueType(formats strfmt.Registry) error { + + if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"PAYMENT_REQUEST"}, true); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go new file mode 100644 index 00000000000..e89cbdf7c59 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetBulkAssignmentPaymentRequestDataOKCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataOK +const GetBulkAssignmentPaymentRequestDataOKCode int = 200 + +/* +GetBulkAssignmentPaymentRequestDataOK Successfully returned bulk assignment payment request data + +swagger:response getBulkAssignmentPaymentRequestDataOK +*/ +type GetBulkAssignmentPaymentRequestDataOK struct { + + /* + In: Body + */ + Payload *ghcmessages.BulkAssignmentPaymentRequestData `json:"body,omitempty"` +} + +// NewGetBulkAssignmentPaymentRequestDataOK creates GetBulkAssignmentPaymentRequestDataOK with default headers values +func NewGetBulkAssignmentPaymentRequestDataOK() *GetBulkAssignmentPaymentRequestDataOK { + + return &GetBulkAssignmentPaymentRequestDataOK{} +} + +// WithPayload adds the payload to the get bulk assignment payment request data o k response +func (o *GetBulkAssignmentPaymentRequestDataOK) WithPayload(payload *ghcmessages.BulkAssignmentPaymentRequestData) *GetBulkAssignmentPaymentRequestDataOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment payment request data o k response +func (o *GetBulkAssignmentPaymentRequestDataOK) SetPayload(payload *ghcmessages.BulkAssignmentPaymentRequestData) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentPaymentRequestDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentPaymentRequestDataUnauthorizedCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataUnauthorized +const GetBulkAssignmentPaymentRequestDataUnauthorizedCode int = 401 + +/* +GetBulkAssignmentPaymentRequestDataUnauthorized The request was denied + +swagger:response getBulkAssignmentPaymentRequestDataUnauthorized +*/ +type GetBulkAssignmentPaymentRequestDataUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentPaymentRequestDataUnauthorized creates GetBulkAssignmentPaymentRequestDataUnauthorized with default headers values +func NewGetBulkAssignmentPaymentRequestDataUnauthorized() *GetBulkAssignmentPaymentRequestDataUnauthorized { + + return &GetBulkAssignmentPaymentRequestDataUnauthorized{} +} + +// WithPayload adds the payload to the get bulk assignment payment request data unauthorized response +func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment payment request data unauthorized response +func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentPaymentRequestDataNotFoundCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataNotFound +const GetBulkAssignmentPaymentRequestDataNotFoundCode int = 404 + +/* +GetBulkAssignmentPaymentRequestDataNotFound The requested resource wasn't found + +swagger:response getBulkAssignmentPaymentRequestDataNotFound +*/ +type GetBulkAssignmentPaymentRequestDataNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentPaymentRequestDataNotFound creates GetBulkAssignmentPaymentRequestDataNotFound with default headers values +func NewGetBulkAssignmentPaymentRequestDataNotFound() *GetBulkAssignmentPaymentRequestDataNotFound { + + return &GetBulkAssignmentPaymentRequestDataNotFound{} +} + +// WithPayload adds the payload to the get bulk assignment payment request data not found response +func (o *GetBulkAssignmentPaymentRequestDataNotFound) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment payment request data not found response +func (o *GetBulkAssignmentPaymentRequestDataNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentPaymentRequestDataNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentPaymentRequestDataInternalServerErrorCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataInternalServerError +const GetBulkAssignmentPaymentRequestDataInternalServerErrorCode int = 500 + +/* +GetBulkAssignmentPaymentRequestDataInternalServerError A server error occurred + +swagger:response getBulkAssignmentPaymentRequestDataInternalServerError +*/ +type GetBulkAssignmentPaymentRequestDataInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentPaymentRequestDataInternalServerError creates GetBulkAssignmentPaymentRequestDataInternalServerError with default headers values +func NewGetBulkAssignmentPaymentRequestDataInternalServerError() *GetBulkAssignmentPaymentRequestDataInternalServerError { + + return &GetBulkAssignmentPaymentRequestDataInternalServerError{} +} + +// WithPayload adds the payload to the get bulk assignment payment request data internal server error response +func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment payment request data internal server error response +func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go new file mode 100644 index 00000000000..3af039adfb1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetBulkAssignmentPaymentRequestDataURL generates an URL for the get bulk assignment payment request data operation +type GetBulkAssignmentPaymentRequestDataURL struct { + QueueType *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetBulkAssignmentPaymentRequestDataURL) WithBasePath(bp string) *GetBulkAssignmentPaymentRequestDataURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetBulkAssignmentPaymentRequestDataURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetBulkAssignmentPaymentRequestDataURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/bulk-assignment-payment-requests" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var queueTypeQ string + if o.QueueType != nil { + queueTypeQ = *o.QueueType + } + if queueTypeQ != "" { + qs.Set("queueType", queueTypeQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetBulkAssignmentPaymentRequestDataURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetBulkAssignmentPaymentRequestDataURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetBulkAssignmentPaymentRequestDataURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetBulkAssignmentPaymentRequestDataURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetBulkAssignmentPaymentRequestDataURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetBulkAssignmentPaymentRequestDataURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go new file mode 100644 index 00000000000..7a431799d17 --- /dev/null +++ b/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BulkAssignmentPaymentRequestData bulk assignment payment request data +// +// swagger:model BulkAssignmentPaymentRequestData +type BulkAssignmentPaymentRequestData struct { + + // available office users + AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` + + // bulk assignment payment request i ds + BulkAssignmentPaymentRequestIDs BulkAssignmentPaymentRequestIDs `json:"bulkAssignmentPaymentRequestIDs,omitempty"` +} + +// Validate validates this bulk assignment payment request data +func (m *BulkAssignmentPaymentRequestData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAvailableOfficeUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBulkAssignmentPaymentRequestIDs(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BulkAssignmentPaymentRequestData) validateAvailableOfficeUsers(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableOfficeUsers) { // not required + return nil + } + + if err := m.AvailableOfficeUsers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *BulkAssignmentPaymentRequestData) validateBulkAssignmentPaymentRequestIDs(formats strfmt.Registry) error { + if swag.IsZero(m.BulkAssignmentPaymentRequestIDs) { // not required + return nil + } + + if err := m.BulkAssignmentPaymentRequestIDs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bulkAssignmentPaymentRequestIDs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bulkAssignmentPaymentRequestIDs") + } + return err + } + + return nil +} + +// ContextValidate validate this bulk assignment payment request data based on the context it is used +func (m *BulkAssignmentPaymentRequestData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBulkAssignmentPaymentRequestIDs(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *BulkAssignmentPaymentRequestData) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *BulkAssignmentPaymentRequestData) contextValidateBulkAssignmentPaymentRequestIDs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.BulkAssignmentPaymentRequestIDs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("bulkAssignmentPaymentRequestIDs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("bulkAssignmentPaymentRequestIDs") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *BulkAssignmentPaymentRequestData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *BulkAssignmentPaymentRequestData) UnmarshalBinary(b []byte) error { + var res BulkAssignmentPaymentRequestData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go new file mode 100644 index 00000000000..7e49b4e7cbd --- /dev/null +++ b/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BulkAssignmentPaymentRequestIDs bulk assignment payment request i ds +// +// swagger:model BulkAssignmentPaymentRequestIDs +type BulkAssignmentPaymentRequestIDs []BulkAssignmentPaymentRequestID + +// Validate validates this bulk assignment payment request i ds +func (m BulkAssignmentPaymentRequestIDs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this bulk assignment payment request i ds based on the context it is used +func (m BulkAssignmentPaymentRequestIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go new file mode 100644 index 00000000000..699c81bda10 --- /dev/null +++ b/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go @@ -0,0 +1,39 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// BulkAssignmentPaymentRequestID bulk assignment payment request ID +// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 +// +// swagger:model BulkAssignmentPaymentRequestID +type BulkAssignmentPaymentRequestID strfmt.UUID + +// Validate validates this bulk assignment payment request ID +func (m BulkAssignmentPaymentRequestID) Validate(formats strfmt.Registry) error { + var res []error + + if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this bulk assignment payment request ID based on context it is used +func (m BulkAssignmentPaymentRequestID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/handlers/ghcapi/api.go b/pkg/handlers/ghcapi/api.go index 1b0a66d1956..5fb96b70993 100644 --- a/pkg/handlers/ghcapi/api.go +++ b/pkg/handlers/ghcapi/api.go @@ -536,6 +536,12 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI { move.NewMoveFetcherBulkAssignment(), } + ghcAPI.QueuesGetBulkAssignmentPaymentRequestDataHandler = GetPaymentRequestBulkAssignmentDataHandler{ + handlerConfig, + officeusercreator.NewOfficeUserFetcherPop(), + paymentrequest.NewPaymentRequestFetcherBulkAssignment(), + } + ghcAPI.QueuesGetMovesQueueHandler = GetMovesQueueHandler{ handlerConfig, order.NewOrderFetcher(), diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index db8c54617ed..4d094c8fd09 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2183,6 +2183,30 @@ func BulkAssignmentData(appCtx appcontext.AppContext, moves []models.MoveWithEar return *bulkAssignmentData } +func BulkAssignmentPaymentRequestData(appCtx appcontext.AppContext, paymentRequests []models.PaymentRequestWithEarliestRequestedDate, officeUsers []models.OfficeUserWithWorkload, officeId uuid.UUID) ghcmessages.BulkAssignmentPaymentRequestData { + availableOfficeUsers := make(ghcmessages.AvailableOfficeUsers, len(officeUsers)) + availablePaymentRequests := make(ghcmessages.BulkAssignmentPaymentRequestIDs, len(paymentRequests)) + + for i, officeUser := range officeUsers { + availableOfficeUsers[i] = &ghcmessages.AvailableOfficeUser{ + LastName: officeUser.LastName, + FirstName: officeUser.FirstName, + OfficeUserID: *handlers.FmtUUID(officeUser.ID), + Workload: int64(officeUser.Workload), + } + } + for i, paymentRequest := range paymentRequests { + availablePaymentRequests[i] = ghcmessages.BulkAssignmentPaymentRequestID(strfmt.UUID(paymentRequest.ID.String())) + } + + bulkAssignmentPaymentRequestData := &ghcmessages.BulkAssignmentPaymentRequestData{ + AvailableOfficeUsers: availableOfficeUsers, + BulkAssignmentPaymentRequestIDs: availablePaymentRequests, + } + + return *bulkAssignmentPaymentRequestData +} + func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.AssignedOfficeUser, isCloseoutQueue bool, officeUser models.OfficeUser, ppmCloseoutGblocs bool) bool { // default to false isAssignable := false diff --git a/pkg/handlers/ghcapi/queues.go b/pkg/handlers/ghcapi/queues.go index 16c80507c85..02741bcb359 100644 --- a/pkg/handlers/ghcapi/queues.go +++ b/pkg/handlers/ghcapi/queues.go @@ -617,6 +617,72 @@ func (h GetBulkAssignmentDataHandler) Handle( }) } +// GetPaymentRequestBulkAssignmentDataHandler returns payment requests that the supervisor can assign, along with the office users they are able to assign to +type GetPaymentRequestBulkAssignmentDataHandler struct { + handlers.HandlerConfig + services.OfficeUserFetcherPop + services.PaymentRequestFetcherBulkAssignment +} + +func (h GetPaymentRequestBulkAssignmentDataHandler) Handle( + params queues.GetBulkAssignmentPaymentRequestDataParams, +) middleware.Responder { + return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, + func(appCtx appcontext.AppContext) (middleware.Responder, error) { + if !appCtx.Session().IsOfficeUser() { + err := apperror.NewForbiddenError("not an office user") + appCtx.Logger().Error("Must be an office user", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataUnauthorized(), err + } + + officeUser, err := h.OfficeUserFetcherPop.FetchOfficeUserByID(appCtx, appCtx.Session().OfficeUserID) + if err != nil { + appCtx.Logger().Error("Error retrieving office_user", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataNotFound(), err + } + + privileges, err := models.FetchPrivilegesForUser(appCtx.DB(), *officeUser.UserID) + if err != nil { + appCtx.Logger().Error("Error retreiving user privileges", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataNotFound(), err + } + + isSupervisor := privileges.HasPrivilege(models.PrivilegeTypeSupervisor) + if !isSupervisor { + appCtx.Logger().Error("Unauthorized", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataUnauthorized(), err + } + + queueType := params.QueueType + var officeUserData ghcmessages.BulkAssignmentPaymentRequestData + + switch *queueType { + case string(models.QueueTypePaymentRequest): + // fetch the TIOs who work at their office + officeUsers, err := h.OfficeUserFetcherPop.FetchOfficeUsersWithWorkloadByRoleAndOffice( + appCtx, + roles.RoleTypeTIO, + officeUser.TransportationOfficeID, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving TIO office users", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err + } + // fetch the payment requests available to be assigned to their office users + paymentRequests, err := h.PaymentRequestFetcherBulkAssignment.FetchPaymentRequestsForBulkAssignment( + appCtx, officeUser.TransportationOffice.Gbloc, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving payment requests", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err + } + + officeUserData = payloads.BulkAssignmentPaymentRequestData(appCtx, paymentRequests, officeUsers, officeUser.TransportationOffice.ID) + } + return queues.NewGetBulkAssignmentPaymentRequestDataOK().WithPayload(&officeUserData), nil + }) +} + // GetServicesCounselingOriginListHandler returns the origin list for the Service Counselor user via GET /queues/counselor/origin-list type GetServicesCounselingOriginListHandler struct { handlers.HandlerConfig diff --git a/pkg/models/payment_request.go b/pkg/models/payment_request.go index 120f7a1d4fb..8a57e05e0ae 100644 --- a/pkg/models/payment_request.go +++ b/pkg/models/payment_request.go @@ -89,6 +89,11 @@ type PaymentRequest struct { TPPSPaidInvoiceReports TPPSPaidInvoiceReportEntrys `has_many:"tpps_paid_invoice_reports" fk_id:"payment_request_number"` } +type PaymentRequestWithEarliestRequestedDate struct { + ID uuid.UUID `json:"id" db:"id"` + EarliestRequestedDate time.Time `db:"requested_at"` +} + // TableName overrides the table name used by Pop. func (p PaymentRequest) TableName() string { return "payment_requests" diff --git a/pkg/services/payment_request.go b/pkg/services/payment_request.go index ae7e345dc94..74c3e5a6e98 100644 --- a/pkg/services/payment_request.go +++ b/pkg/services/payment_request.go @@ -122,3 +122,7 @@ type ShipmentsPaymentSITBalance interface { type PaymentRequestBulkDownloadCreator interface { CreatePaymentRequestBulkDownload(appCtx appcontext.AppContext, paymentRequestID uuid.UUID) (afero.File, error) } + +type PaymentRequestFetcherBulkAssignment interface { + FetchPaymentRequestsForBulkAssignment(appCtx appcontext.AppContext, gbloc string) ([]models.PaymentRequestWithEarliestRequestedDate, error) +} diff --git a/pkg/services/payment_request/payment_request_fetcher.go b/pkg/services/payment_request/payment_request_fetcher.go index b08d948d756..a68f09f0c38 100644 --- a/pkg/services/payment_request/payment_request_fetcher.go +++ b/pkg/services/payment_request/payment_request_fetcher.go @@ -2,11 +2,13 @@ package paymentrequest import ( "database/sql" + "fmt" "github.com/gofrs/uuid" "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/apperror" + "github.com/transcom/mymove/pkg/gen/internalmessages" "github.com/transcom/mymove/pkg/models" "github.com/transcom/mymove/pkg/services" ) @@ -58,3 +60,50 @@ func (p *paymentRequestFetcher) FetchPaymentRequest(appCtx appcontext.AppContext return paymentRequest, err } + +type paymentRequestFetcherBulkAssignment struct { +} + +// NewPaymentRequestFetcherBulkAssignment creates a new paymentRequestFetcherBulkAssignment service +func NewPaymentRequestFetcherBulkAssignment() services.PaymentRequestFetcherBulkAssignment { + return &paymentRequestFetcherBulkAssignment{} +} + +func (f paymentRequestFetcherBulkAssignment) FetchPaymentRequestsForBulkAssignment(appCtx appcontext.AppContext, gbloc string) ([]models.PaymentRequestWithEarliestRequestedDate, error) { + var payment_requests []models.PaymentRequestWithEarliestRequestedDate + + err := appCtx.DB(). + RawQuery(`SELECT + payment_requests.id, + payment_requests.requested_at + FROM payment_requests + INNER JOIN moves on moves.id = payment_requests.move_id + INNER JOIN orders ON orders.id = moves.orders_id + INNER JOIN service_members ON orders.service_member_id = service_members.id + LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id + WHERE + payment_requests.status = 'PENDING' + AND moves.show = $1 + AND (orders.orders_type NOT IN ($2, $3, $4)) + AND moves.tio_assigned_id IS NULL + AND service_members.affiliation != 'MARINES' + AND move_to_gbloc.gbloc = $5 + GROUP BY payment_requests.id + ORDER BY payment_requests.requested_at ASC`, + models.BoolPointer(true), + internalmessages.OrdersTypeBLUEBARK, + internalmessages.OrdersTypeWOUNDEDWARRIOR, + internalmessages.OrdersTypeSAFETY, + gbloc). + All(&payment_requests) + + if err != nil { + return nil, fmt.Errorf("error fetching payment requests for GBLOC: %s with error %w", gbloc, err) + } + + if len(payment_requests) < 1 { + return nil, nil + } + + return payment_requests, nil +} diff --git a/src/hooks/queries.js b/src/hooks/queries.js index ce469702359..cf67da7c887 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -35,6 +35,7 @@ import { searchCustomers, getGBLOCs, getBulkAssignmentData, + getBulkAssignmentPaymentRequestData, } from 'services/ghcApi'; import { getLoggedInUserQueries } from 'services/internalApi'; import { getPrimeSimulatorMove } from 'services/primeApi'; @@ -234,6 +235,20 @@ export const useBulkAssignmentQueries = (queueType) => { }; }; +export const useBulkAssignmentPaymentRequestQueries = (queueType) => { + const { data: bulkAssignmentPaymentRequestData, ...bulkAssignmentPaymentRequestDataQuery } = useQuery( + [queueType], + ({ queryKey }) => getBulkAssignmentPaymentRequestData(queryKey), + ); + const { isLoading, isError, isSuccess } = getQueriesStatus([bulkAssignmentPaymentRequestDataQuery]); + return { + bulkAssignmentPaymentRequestData, + isLoading, + isError, + isSuccess, + }; +}; + export const useEditShipmentQueries = (moveCode) => { // Get the orders info const { data: move = {}, ...moveQuery } = useQuery([MOVES, moveCode], ({ queryKey }) => getMove(...queryKey)); diff --git a/src/services/ghcApi.js b/src/services/ghcApi.js index aab855315c7..a008d1d6ebd 100644 --- a/src/services/ghcApi.js +++ b/src/services/ghcApi.js @@ -146,6 +146,10 @@ export async function getBulkAssignmentData(queueType) { return makeGHCRequest('queues.getBulkAssignmentData', { queueType }, { normalize: false }); } +export async function getBulkAssignmentPaymentRequestData(queueType) { + return makeGHCRequest('queues.getBulkAssignmentPaymentRequestData', { queueType }, { normalize: false }); +} + export async function createCustomerSupportRemarkForMove({ body, locator }) { return makeGHCRequest('customerSupportRemarks.createCustomerSupportRemarkForMove', { body, diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 3d965ec0a5c..3bd4a43add3 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3475,7 +3475,7 @@ paths: get: produces: - application/json - summary: Gets data for bulk assignment modal + summary: Gets data for bulk assignment move modal description: > Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned operationId: getBulkAssignmentData @@ -3490,7 +3490,6 @@ paths: - COUNSELING - CLOSEOUT - TASK_ORDER - - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment data @@ -3502,6 +3501,35 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' + /queues/bulk-assignment-payment-requests: + get: + produces: + - application/json + summary: Gets data for bulk assignment payment request modal + description: > + Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; + the current workload of the office users that work under them, and the payment requests that are available to be assigned + operationId: getBulkAssignmentPaymentRequestData + tags: + - queues + parameters: + - in: query + name: queueType + type: string + description: A string corresponding to the queue type + enum: + - PAYMENT_REQUEST + responses: + '200': + description: Successfully returned bulk assignment payment request data + schema: + $ref: '#/definitions/BulkAssignmentPaymentRequestData' + '401': + $ref: '#/responses/PermissionDenied' + '404': + $ref: '#/responses/NotFound' + '500': + $ref: '#/responses/ServerError' /queues/counseling/origin-list: get: produces: @@ -7016,6 +7044,14 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 + BulkAssignmentPaymentRequestIDs: + type: array + items: + $ref: '#/definitions/BulkAssignmentPaymentRequestID' + BulkAssignmentPaymentRequestID: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 AvailableOfficeUsers: type: array items: @@ -7042,6 +7078,13 @@ definitions: $ref: '#/definitions/AvailableOfficeUsers' bulkAssignmentMoveIDs: $ref: '#/definitions/BulkAssignmentMoveIDs' + BulkAssignmentPaymentRequestData: + type: object + properties: + availableOfficeUsers: + $ref: '#/definitions/AvailableOfficeUsers' + bulkAssignmentPaymentRequestIDs: + $ref: '#/definitions/BulkAssignmentPaymentRequestIDs' QueueMoves: type: array items: diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index ba52ed330f2..926839ff84d 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3604,7 +3604,7 @@ paths: get: produces: - application/json - summary: Gets data for bulk assignment modal + summary: Gets data for bulk assignment move modal description: > Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office @@ -3622,7 +3622,6 @@ paths: - COUNSELING - CLOSEOUT - TASK_ORDER - - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment data @@ -3634,6 +3633,37 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' + /queues/bulk-assignment-payment-requests: + get: + produces: + - application/json + summary: Gets data for bulk assignment payment request modal + description: > + Supervisor office users are able to bulk assign payment requests. This + endpoint returns the relevant data to them; the current workload of the + office users that work under them, and the payment requests that are + available to be assigned + operationId: getBulkAssignmentPaymentRequestData + tags: + - queues + parameters: + - in: query + name: queueType + type: string + description: A string corresponding to the queue type + enum: + - PAYMENT_REQUEST + responses: + '200': + description: Successfully returned bulk assignment payment request data + schema: + $ref: '#/definitions/BulkAssignmentPaymentRequestData' + '401': + $ref: '#/responses/PermissionDenied' + '404': + $ref: '#/responses/NotFound' + '500': + $ref: '#/responses/ServerError' /queues/counseling/origin-list: get: produces: @@ -7356,6 +7386,14 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 + BulkAssignmentPaymentRequestIDs: + type: array + items: + $ref: '#/definitions/BulkAssignmentPaymentRequestID' + BulkAssignmentPaymentRequestID: + type: string + format: uuid + example: c56a4180-65aa-42ec-a945-5fd21dec0538 AvailableOfficeUsers: type: array items: @@ -7382,6 +7420,13 @@ definitions: $ref: '#/definitions/AvailableOfficeUsers' bulkAssignmentMoveIDs: $ref: '#/definitions/BulkAssignmentMoveIDs' + BulkAssignmentPaymentRequestData: + type: object + properties: + availableOfficeUsers: + $ref: '#/definitions/AvailableOfficeUsers' + bulkAssignmentPaymentRequestIDs: + $ref: '#/definitions/BulkAssignmentPaymentRequestIDs' QueueMoves: type: array items: From 6bf992586368c85cec8ba58460fea070abd4de0b Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 10 Jan 2025 15:48:59 +0000 Subject: [PATCH 018/229] Added payment_service_items table to the audit_history table logs. Created template for move history events for rejecting/accepting payment_service_items --- migrations/app/migrations_manifest.txt | 1 + ...ory_table_for_payment_service_items.up.sql | 1 + src/constants/MoveHistory/Database/Tables.js | 1 + .../UpdatePaymentServiceItem.jsx | 28 +++++++++++++++++++ .../MoveHistory/EventTemplates/index.js | 1 + .../MoveHistory/UIDisplay/Operations.js | 1 + 6 files changed, 33 insertions(+) create mode 100644 migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql create mode 100644 src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 9151f5ec112..6ee1de57c69 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1066,3 +1066,4 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql +20250109194140_create_audit_history_table_for_payment_service_items.up.sql diff --git a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql new file mode 100644 index 00000000000..68c3a865112 --- /dev/null +++ b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql @@ -0,0 +1 @@ +SELECT add_audit_history_table('payment_service_items'); \ No newline at end of file diff --git a/src/constants/MoveHistory/Database/Tables.js b/src/constants/MoveHistory/Database/Tables.js index e097f569adf..7a96c2ba5aa 100644 --- a/src/constants/MoveHistory/Database/Tables.js +++ b/src/constants/MoveHistory/Database/Tables.js @@ -19,4 +19,5 @@ export default { moving_expenses: 'moving_expenses', progear_weight_tickets: 'progear_weight_tickets', gsr_appeals: 'gsr_appeals', + payment_service_items: 'payment_service_items', }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx new file mode 100644 index 00000000000..0977bb649ca --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx @@ -0,0 +1,28 @@ +import React from 'react'; + +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; +import { getMtoShipmentLabel } from 'utils/formatMtoShipment'; +import LabeledDetails from 'pages/Office/MoveHistory/LabeledDetails'; + +const formatChangedValues = (historyRecord) => { + const newChangedValues = { + ...historyRecord.changedValues, + ...getMtoShipmentLabel(historyRecord), + }; + + return { ...historyRecord, changedValues: newChangedValues }; +}; + +export default { + action: a.UPDATE, + eventName: o.updatePaymentServiceItem, + tableName: t.payment_service_items, + getEventNameDisplay: () => { + return
Updated Payment Service Item
; + }, + getDetails: (historyRecord) => { + return ; + }, +}; diff --git a/src/constants/MoveHistory/EventTemplates/index.js b/src/constants/MoveHistory/EventTemplates/index.js index afcbd6b7060..d1d582e6f16 100644 --- a/src/constants/MoveHistory/EventTemplates/index.js +++ b/src/constants/MoveHistory/EventTemplates/index.js @@ -109,3 +109,4 @@ export { default as moveCancelerPPMShipments } from './MoveCanceler/MoveCanceler export { default as cancelMove } from './CancelMove/CancelMove'; export { default as cancelMoveMTOShipments } from './CancelMove/CancelMoveMTOShipments'; export { default as cancelMovePPMShipments } from './CancelMove/CancelMovePPMShipments'; +export { default as updatePaymentServiceItem } from './UpdatePaymentServiceItem/UpdatePaymentServiceItem'; diff --git a/src/constants/MoveHistory/UIDisplay/Operations.js b/src/constants/MoveHistory/UIDisplay/Operations.js index 8ca4a3f5cd0..79f50d951aa 100644 --- a/src/constants/MoveHistory/UIDisplay/Operations.js +++ b/src/constants/MoveHistory/UIDisplay/Operations.js @@ -34,6 +34,7 @@ export default { updateOrder: 'updateOrder', // ghc.yaml updateOrders: 'updateOrders', // internal.yaml updatePaymentRequestStatus: 'updatePaymentRequestStatus', + updatePaymentServiceItem: 'updatePaymentServiceItem', updateReweigh: 'updateReweigh', updateServiceItemStatus: 'updateMTOServiceItemStatus', updateServiceItemSitEntryDate: 'updateServiceItemSitEntryDate', // ghc.yaml From aed794679c3dcb22d72ba623cba077b842a738be Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 10 Jan 2025 09:55:07 -0600 Subject: [PATCH 019/229] B-21934 add validation --- src/pages/Office/MoveAllowances/MoveAllowances.jsx | 6 +++++- .../ServicesCounselingMoveAllowances.jsx | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 346a0c6c263..18484e884bd 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -43,6 +43,10 @@ const validationSchema = Yup.object({ .min(0, 'Storage in transit (days) must be greater than or equal to 0') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), + weightRestriction: Yup.number() + .min(0, 'Weight restriction must be greater than or equal to 0') + .transform((value) => (Number.isNaN(value) ? 0 : value)) + .notRequired(), }); const MoveAllowances = () => { @@ -155,7 +159,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, - weightRestriction, + weightRestriction: `${weightRestriction}`, storageInTransit: `${storageInTransit}`, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 299d6de374d..d6a8f85bc6b 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -143,7 +143,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: `${storageInTransit}`, gunSafe, adminRestrictedWeightLocation, - weightRestriction, + weightRestriction: `${weightRestriction}`, organizationalClothingAndIndividualEquipment, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, From 0b5ade160f24b62256fd23308f8ccfe40d806181 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 10 Jan 2025 17:29:03 +0000 Subject: [PATCH 020/229] fix tests --- pkg/factory/entitlement_factory.go | 4 ++++ pkg/handlers/ghcapi/orders_test.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/pkg/factory/entitlement_factory.go b/pkg/factory/entitlement_factory.go index 235fdaf3be6..2255527c223 100644 --- a/pkg/factory/entitlement_factory.go +++ b/pkg/factory/entitlement_factory.go @@ -47,6 +47,7 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai proGearWeight := 2000 proGearWeightSpouse := 500 ordersType := internalmessages.OrdersTypePERMANENTCHANGEOFSTATION + weightRestriction := 0 // Create default Entitlement entitlement := models.Entitlement{ @@ -59,6 +60,8 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, OrganizationalClothingAndIndividualEquipment: ocie, + AdminRestrictedWeightLocation: *setBoolPtr(&cEntitlement.AdminRestrictedWeightLocation, false), + WeightRestriction: weightRestriction, } // Set default calculated values entitlement.SetWeightAllotment(string(*grade), ordersType) @@ -73,4 +76,5 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai } return entitlement + } diff --git a/pkg/handlers/ghcapi/orders_test.go b/pkg/handlers/ghcapi/orders_test.go index 6d3bd880903..ad50d90ef69 100644 --- a/pkg/handlers/ghcapi/orders_test.go +++ b/pkg/handlers/ghcapi/orders_test.go @@ -1476,6 +1476,8 @@ func (suite *HandlerSuite) TestCounselingUpdateAllowanceHandler() { ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, StorageInTransit: models.Int64Pointer(80), + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } request := httptest.NewRequest("PATCH", "/counseling/orders/{orderID}/allowances", nil) From 86c7d32585eced4a457a0fe05bcec4e62a185448 Mon Sep 17 00:00:00 2001 From: Beth Grohmann Date: Fri, 10 Jan 2025 11:51:10 -0600 Subject: [PATCH 021/229] Add 92135 duty locs --- .../schema/20250106202424_update_duty_locs.up.sql | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql index 7c45653bc3e..fa4212ac57e 100644 --- a/migrations/app/schema/20250106202424_update_duty_locs.up.sql +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -8,4 +8,14 @@ delete from duty_locations where id = 'e55be32c-bf89-4927-8893-4454a26bfd55'; update orders set new_duty_location_id = 'fc4d669f-594a-4784-9831-bf2eb9f8948b' where new_duty_location_id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344'; --remove 55460 duty location -delete from duty_locations where id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344'; \ No newline at end of file +delete from duty_locations where id = '4c960096-1fbc-4b9d-b7d9-5979a3ba7344'; + +--add 92135 duty location +INSERT INTO addresses +(id, street_address_1, street_address_2, city, state, postal_code, created_at, updated_at, street_address_3, county, is_oconus, country_id, us_post_region_cities_id) +VALUES('3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid, 'n/a', NULL, 'NAS N ISLAND', 'CA', '39125', now(), now(), NULL, 'SAN DIEGO', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, 'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid); + +INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling,id,street_address_1,street_address_2,city,state,postal_code,created_at,updated_at,street_address_3,county,is_oconus,country_id,us_post_region_cities_id,uprc_id,city_name,state,uspr_zip_id,usprc_county_nm,country,cities_id,state_id,us_post_regions_id,country_id) VALUES + ('56255626-bbbe-4834-8324-1c08f011f2f6'::uuid,'NAS N Island, CA 92135',NULL,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,'2025-01-09 07:54:08.851309','2025-01-09 07:54:08.851309',NULL,true,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,'n/a',NULL,'NAS N ISLAND','CA','39125','2025-01-09 07:35:38.084001','2025-01-09 07:35:38.084001',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid,'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid,'NAS N ISLAND','CA','92135','SAN DIEGO','US','2f5a7421-abf0-4663-bf6c-80994eb50c2f'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid), + ('7156098f-13cf-4455-bcd5-eb829d57c714'::uuid,'NAS North Island, CA 92135',NULL,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,'2025-01-09 07:53:04.765731','2025-01-09 07:53:04.765731',NULL,true,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,'N/A',NULL,'NAS NORTH ISLAND','CA','92135','2019-07-15 17:24:59.295706','2019-07-15 17:24:59.295706',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'191165db-d30a-414d-862b-54afdfc7aeb9'::uuid,'191165db-d30a-414d-862b-54afdfc7aeb9'::uuid,'NAS NORTH ISLAND','CA','92135','SAN DIEGO','US','d42994ab-e19d-419f-9058-efe0533dd7ea'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid), + ('6555ccb2-a8a1-4961-98cc-b507490580ed'::uuid,'San Diego, CA 92135',NULL,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,'2025-01-09 07:49:29.331296','2025-01-09 07:49:29.331296',NULL,true,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,'n/a',NULL,'San Diego','CA','92135','2021-12-02 02:31:27.222671','2021-12-02 02:31:27.222671',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'e32ddc14-9844-4998-86b4-12e4bce293e2'::uuid,'e32ddc14-9844-4998-86b4-12e4bce293e2'::uuid,'SAN DIEGO','CA','92135','SAN DIEGO','US','f5f944a0-6bf9-4394-aaa3-f632e997cd43'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid); From 4f3a8336191b55d861a04ff7921b10b60e10694c Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 10 Jan 2025 18:32:40 +0000 Subject: [PATCH 022/229] more tests --- pkg/services/order/order_updater_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/pkg/services/order/order_updater_test.go b/pkg/services/order/order_updater_test.go index 1bf72866552..1ed15ea9a89 100644 --- a/pkg/services/order/order_updater_test.go +++ b/pkg/services/order/order_updater_test.go @@ -588,6 +588,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: int64(*models.IntPointer(0)), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -630,6 +632,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { AccompaniedTour: models.BoolPointer(true), DependentsTwelveAndOver: models.Int64Pointer(2), DependentsUnderTwelve: models.Int64Pointer(4), + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: int64(*models.IntPointer(0)), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -675,6 +679,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: int64(*models.IntPointer(0)), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -747,6 +753,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { AccompaniedTour: models.BoolPointer(true), DependentsTwelveAndOver: models.Int64Pointer(1), DependentsUnderTwelve: models.Int64Pointer(2), + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -784,6 +792,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -829,6 +839,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -878,6 +890,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), orderWithoutDefaults.ID, payload, eTag) @@ -929,6 +943,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -965,6 +981,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: models.BoolPointer(false), + WeightRestriction: models.Int64Pointer(0), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) From 36be221b878f1c4b992dc0ba9625107f1617f2d3 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 10 Jan 2025 20:56:40 +0000 Subject: [PATCH 023/229] remove comment --- .../app/schema/20250106153750_admin_weight_restriction.up.sql | 4 ---- 1 file changed, 4 deletions(-) diff --git a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql index a3e6e097e45..d5f248d8237 100644 --- a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql +++ b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql @@ -1,6 +1,2 @@ ALTER TABLE entitlements ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; - --- ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), --- ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, --- ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file From 0e159b7bc203560ebe5544865f975ec2b414e70b Mon Sep 17 00:00:00 2001 From: Beth Grohmann Date: Fri, 10 Jan 2025 15:28:57 -0600 Subject: [PATCH 024/229] Add Cannon AFB 88101 duty loc --- .../schema/20250106202424_update_duty_locs.up.sql | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql index fa4212ac57e..cd83780df46 100644 --- a/migrations/app/schema/20250106202424_update_duty_locs.up.sql +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -15,7 +15,12 @@ INSERT INTO addresses (id, street_address_1, street_address_2, city, state, postal_code, created_at, updated_at, street_address_3, county, is_oconus, country_id, us_post_region_cities_id) VALUES('3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid, 'n/a', NULL, 'NAS N ISLAND', 'CA', '39125', now(), now(), NULL, 'SAN DIEGO', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, 'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid); -INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling,id,street_address_1,street_address_2,city,state,postal_code,created_at,updated_at,street_address_3,county,is_oconus,country_id,us_post_region_cities_id,uprc_id,city_name,state,uspr_zip_id,usprc_county_nm,country,cities_id,state_id,us_post_regions_id,country_id) VALUES - ('56255626-bbbe-4834-8324-1c08f011f2f6'::uuid,'NAS N Island, CA 92135',NULL,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,'2025-01-09 07:54:08.851309','2025-01-09 07:54:08.851309',NULL,true,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,'n/a',NULL,'NAS N ISLAND','CA','39125','2025-01-09 07:35:38.084001','2025-01-09 07:35:38.084001',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid,'ce42858c-85af-4566-bbef-6b9aaf75c18a'::uuid,'NAS N ISLAND','CA','92135','SAN DIEGO','US','2f5a7421-abf0-4663-bf6c-80994eb50c2f'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid), - ('7156098f-13cf-4455-bcd5-eb829d57c714'::uuid,'NAS North Island, CA 92135',NULL,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,'2025-01-09 07:53:04.765731','2025-01-09 07:53:04.765731',NULL,true,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,'N/A',NULL,'NAS NORTH ISLAND','CA','92135','2019-07-15 17:24:59.295706','2019-07-15 17:24:59.295706',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'191165db-d30a-414d-862b-54afdfc7aeb9'::uuid,'191165db-d30a-414d-862b-54afdfc7aeb9'::uuid,'NAS NORTH ISLAND','CA','92135','SAN DIEGO','US','d42994ab-e19d-419f-9058-efe0533dd7ea'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid), - ('6555ccb2-a8a1-4961-98cc-b507490580ed'::uuid,'San Diego, CA 92135',NULL,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,'2025-01-09 07:49:29.331296','2025-01-09 07:49:29.331296',NULL,true,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,'n/a',NULL,'San Diego','CA','92135','2021-12-02 02:31:27.222671','2021-12-02 02:31:27.222671',NULL,'SAN DIEGO',false,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid,'e32ddc14-9844-4998-86b4-12e4bce293e2'::uuid,'e32ddc14-9844-4998-86b4-12e4bce293e2'::uuid,'SAN DIEGO','CA','92135','SAN DIEGO','US','f5f944a0-6bf9-4394-aaa3-f632e997cd43'::uuid,'05dbc84f-e93e-4c5c-8f6d-7179cfb5eb8b'::uuid,'9b915603-848e-483e-957a-665acbe07fb2'::uuid,'791899e6-cd77-46f2-981b-176ecb8d7098'::uuid); +INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES + ('56255626-bbbe-4834-8324-1c08f011f2f6'::uuid,'NAS N Island, CA 92135',NULL,'3d617fab-bf6f-4f07-8ab5-f7652b8e7f3e'::uuid,now(),now(),null,true), + ('7156098f-13cf-4455-bcd5-eb829d57c714'::uuid,'NAS North Island, CA 92135',NULL,'8d613f71-b80e-4ad4-95e7-00781b084c7c'::uuid,now(),now(),null,true), + ('6555ccb2-a8a1-4961-98cc-b507490580ed'::uuid,'San Diego, CA 92135',NULL,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,now(),now(),null,true); + +--add Cannon AFB 88101 duty location +INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES +('98beab3c-f8ce-4e3c-b78e-8db614721621'::uuid, 'Cannon AFB, NM 88101',null, 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid,now(),now(),'80796bc4-e494-4b19-bb16-cdcdba187829',true); + From 3123707db761e438f9190ff2cb804c54fab67671 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 10 Jan 2025 22:53:33 +0000 Subject: [PATCH 025/229] peer review suggestions --- pkg/handlers/ghcapi/transportation_offices_test.go | 1 - pkg/handlers/internalapi/transportation_offices_test.go | 1 - src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/handlers/ghcapi/transportation_offices_test.go b/pkg/handlers/ghcapi/transportation_offices_test.go index 087c5c2d243..3be2ce21b3d 100644 --- a/pkg/handlers/ghcapi/transportation_offices_test.go +++ b/pkg/handlers/ghcapi/transportation_offices_test.go @@ -180,7 +180,6 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { }, }, }, nil) - suite.MustSave(&origDutyLocation) path := fmt.Sprintf("/transportation_offices/%v/counseling_offices", origDutyLocation.ID.String()) req := httptest.NewRequest("GET", path, nil) diff --git a/pkg/handlers/internalapi/transportation_offices_test.go b/pkg/handlers/internalapi/transportation_offices_test.go index b41c5aff7bf..83f875335a4 100644 --- a/pkg/handlers/internalapi/transportation_offices_test.go +++ b/pkg/handlers/internalapi/transportation_offices_test.go @@ -153,7 +153,6 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { }, }, }, nil) - suite.MustSave(&origDutyLocation) path := fmt.Sprintf("/transportation_offices/%v/counseling_offices", origDutyLocation.ID.String()) req := httptest.NewRequest("GET", path, nil) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index 18495b24036..55813f517fb 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -263,8 +263,8 @@ describe('AddOrdersForm - With Counseling Office', () => { ); await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); - await userEvent.type(screen.getByLabelText(/Orders date/), '08 Nov 2020'); - await userEvent.type(screen.getByLabelText(/Report by date/), '26 Nov 2020'); + await userEvent.paste(screen.getByLabelText(/Orders date/), '08 Nov 2020'); + await userEvent.paste(screen.getByLabelText(/Report by date/), '26 Nov 2020'); await userEvent.click(screen.getByLabelText('No')); await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']); From 045349320247e23db138745d2685428a1abf5a52 Mon Sep 17 00:00:00 2001 From: Beth Grohmann Date: Mon, 13 Jan 2025 14:33:48 -0600 Subject: [PATCH 026/229] Merge main --- .../admin_users/create_admin_user.go | 60 - .../create_admin_user_parameters.go | 76 - .../create_admin_user_responses.go | 159 - .../create_admin_user_urlbuilder.go | 87 - .../admin_users/get_admin_user.go | 59 - .../admin_users/get_admin_user_parameters.go | 91 - .../admin_users/get_admin_user_responses.go | 159 - .../admin_users/get_admin_user_urlbuilder.go | 101 - .../admin_users/index_admin_users.go | 59 - .../index_admin_users_parameters.go | 210 - .../index_admin_users_responses.go | 184 - .../index_admin_users_urlbuilder.go | 150 - .../admin_users/update_admin_user.go | 59 - .../update_admin_user_parameters.go | 128 - .../update_admin_user_responses.go | 159 - .../update_admin_user_urlbuilder.go | 101 - .../create_client_certificate.go | 60 - .../create_client_certificate_parameters.go | 76 - .../create_client_certificate_responses.go | 159 - .../create_client_certificate_urlbuilder.go | 87 - .../get_client_certificate.go | 60 - .../get_client_certificate_parameters.go | 91 - .../get_client_certificate_responses.go | 159 - .../get_client_certificate_urlbuilder.go | 101 - .../index_client_certificates.go | 60 - .../index_client_certificates_parameters.go | 201 - .../index_client_certificates_responses.go | 184 - .../index_client_certificates_urlbuilder.go | 141 - .../remove_client_certificate.go | 60 - .../remove_client_certificate_parameters.go | 91 - .../remove_client_certificate_responses.go | 159 - .../remove_client_certificate_urlbuilder.go | 101 - .../update_client_certificate.go | 60 - .../update_client_certificate_parameters.go | 128 - .../update_client_certificate_responses.go | 159 - .../update_client_certificate_urlbuilder.go | 101 - .../get_electronic_orders_totals.go | 59 - ...get_electronic_orders_totals_parameters.go | 123 - .../get_electronic_orders_totals_responses.go | 162 - ...get_electronic_orders_totals_urlbuilder.go | 132 - .../index_electronic_orders.go | 59 - .../index_electronic_orders_parameters.go | 210 - .../index_electronic_orders_responses.go | 184 - .../index_electronic_orders_urlbuilder.go | 150 - .../adminoperations/moves/get_move.go | 59 - .../moves/get_move_parameters.go | 91 - .../moves/get_move_responses.go | 159 - .../moves/get_move_urlbuilder.go | 101 - .../adminoperations/moves/index_moves.go | 59 - .../moves/index_moves_parameters.go | 201 - .../moves/index_moves_responses.go | 184 - .../moves/index_moves_urlbuilder.go | 141 - .../adminoperations/moves/update_move.go | 63 - .../moves/update_move_parameters.go | 128 - .../moves/update_move_responses.go | 209 - .../moves/update_move_urlbuilder.go | 101 - .../adminapi/adminoperations/mymove_api.go | 741 - .../notifications/index_notifications.go | 60 - .../index_notifications_parameters.go | 201 - .../index_notifications_responses.go | 184 - .../index_notifications_urlbuilder.go | 141 - .../office_users/create_office_user.go | 62 - .../create_office_user_parameters.go | 76 - .../create_office_user_responses.go | 129 - .../create_office_user_urlbuilder.go | 87 - .../office_users/get_office_user.go | 59 - .../get_office_user_parameters.go | 91 - .../office_users/get_office_user_responses.go | 159 - .../get_office_user_urlbuilder.go | 101 - .../office_users/index_office_users.go | 59 - .../index_office_users_parameters.go | 201 - .../index_office_users_responses.go | 184 - .../index_office_users_urlbuilder.go | 141 - .../office_users/update_office_user.go | 59 - .../update_office_user_parameters.go | 128 - .../update_office_user_responses.go | 159 - .../update_office_user_urlbuilder.go | 101 - .../organizations/index_organizations.go | 59 - .../index_organizations_parameters.go | 210 - .../index_organizations_responses.go | 184 - .../index_organizations_urlbuilder.go | 150 - .../payment_request_syncada_file.go | 58 - ...payment_request_syncada_file_parameters.go | 245 - .../payment_request_syncada_file_responses.go | 181 - ...payment_request_syncada_file_urlbuilder.go | 152 - .../index_payment_request_syncada_files.go | 58 - ...ayment_request_syncada_files_parameters.go | 201 - ...payment_request_syncada_files_responses.go | 184 - ...ayment_request_syncada_files_urlbuilder.go | 141 - .../get_requested_office_user.go | 58 - .../get_requested_office_user_parameters.go | 91 - .../get_requested_office_user_responses.go | 159 - .../get_requested_office_user_urlbuilder.go | 101 - .../index_requested_office_users.go | 59 - ...index_requested_office_users_parameters.go | 201 - .../index_requested_office_users_responses.go | 184 - ...index_requested_office_users_urlbuilder.go | 141 - .../update_requested_office_user.go | 58 - ...update_requested_office_user_parameters.go | 128 - .../update_requested_office_user_responses.go | 179 - ...update_requested_office_user_urlbuilder.go | 101 - .../get_office_by_id.go | 59 - .../get_office_by_id_parameters.go | 91 - .../get_office_by_id_responses.go | 159 - .../get_office_by_id_urlbuilder.go | 101 - .../transportation_offices/index_offices.go | 59 - .../index_offices_parameters.go | 201 - .../index_offices_responses.go | 184 - .../index_offices_urlbuilder.go | 141 - .../adminoperations/uploads/get_upload.go | 60 - .../uploads/get_upload_parameters.go | 91 - .../uploads/get_upload_responses.go | 159 - .../uploads/get_upload_urlbuilder.go | 101 - .../user/get_logged_in_admin_user.go | 58 - .../get_logged_in_admin_user_parameters.go | 46 - .../get_logged_in_admin_user_responses.go | 159 - .../get_logged_in_admin_user_urlbuilder.go | 87 - .../adminoperations/users/get_user.go | 60 - .../users/get_user_parameters.go | 91 - .../users/get_user_responses.go | 159 - .../users/get_user_urlbuilder.go | 101 - .../adminoperations/users/index_users.go | 59 - .../users/index_users_parameters.go | 201 - .../users/index_users_responses.go | 184 - .../users/index_users_urlbuilder.go | 141 - .../adminoperations/users/update_user.go | 60 - .../users/update_user_parameters.go | 128 - .../users/update_user_responses.go | 229 - .../users/update_user_urlbuilder.go | 101 - .../create_webhook_subscription.go | 60 - .../create_webhook_subscription_parameters.go | 76 - .../create_webhook_subscription_responses.go | 159 - .../create_webhook_subscription_urlbuilder.go | 87 - .../get_webhook_subscription.go | 59 - .../get_webhook_subscription_parameters.go | 91 - .../get_webhook_subscription_responses.go | 159 - .../get_webhook_subscription_urlbuilder.go | 101 - .../index_webhook_subscriptions.go | 59 - .../index_webhook_subscriptions_parameters.go | 201 - .../index_webhook_subscriptions_responses.go | 184 - .../index_webhook_subscriptions_urlbuilder.go | 141 - .../update_webhook_subscription.go | 59 - .../update_webhook_subscription_parameters.go | 158 - .../update_webhook_subscription_responses.go | 254 - .../update_webhook_subscription_urlbuilder.go | 101 - pkg/gen/adminapi/configure_mymove.go | 265 - pkg/gen/adminapi/doc.go | 24 - pkg/gen/adminapi/embedded_spec.go | 7339 ---- pkg/gen/adminapi/server.go | 507 - pkg/gen/adminmessages/electronic_order.go | 224 - pkg/gen/adminmessages/electronic_orders.go | 78 - .../adminmessages/electronic_orders_total.go | 77 - .../adminmessages/electronic_orders_totals.go | 78 - pkg/gen/adminmessages/issuer.go | 87 - pkg/gen/adminmessages/move.go | 295 - pkg/gen/adminmessages/move_status.go | 84 - pkg/gen/adminmessages/move_update.go | 71 - pkg/gen/adminmessages/moves.go | 78 - pkg/gen/adminmessages/notification.go | 224 - pkg/gen/adminmessages/notifications.go | 78 - pkg/gen/adminmessages/office_user.go | 606 - pkg/gen/adminmessages/office_user_create.go | 281 - .../adminmessages/office_user_privilege.go | 55 - pkg/gen/adminmessages/office_user_role.go | 55 - ...e_user_transportation_office_assignment.go | 78 - pkg/gen/adminmessages/office_user_update.go | 280 - pkg/gen/adminmessages/office_users.go | 78 - .../okta_account_info_response.go | 65 - pkg/gen/adminmessages/organization.go | 211 - pkg/gen/adminmessages/organizations.go | 78 - .../payment_request_syncada_file.go | 123 - .../payment_request_syncada_files.go | 78 - pkg/gen/adminmessages/privilege.go | 156 - .../requested_office_user_update.go | 238 - pkg/gen/adminmessages/role.go | 190 - pkg/gen/adminmessages/service_member.go | 138 - .../adminmessages/transportation_office.go | 274 - .../transportation_office_assignment.go | 223 - .../adminmessages/transportation_offices.go | 78 - pkg/gen/adminmessages/upload.go | 153 - pkg/gen/adminmessages/upload_information.go | 201 - pkg/gen/adminmessages/user.go | 245 - pkg/gen/adminmessages/user_update.go | 59 - pkg/gen/adminmessages/users.go | 78 - pkg/gen/adminmessages/validation_error.go | 154 - pkg/gen/adminmessages/webhook_subscription.go | 277 - .../webhook_subscription_status.go | 81 - .../adminmessages/webhook_subscriptions.go | 78 - pkg/gen/ghcapi/configure_mymove.go | 640 - pkg/gen/ghcapi/doc.go | 26 - pkg/gen/ghcapi/embedded_spec.go | 32291 ---------------- .../get_location_by_zip_city_state.go | 58 - ...t_location_by_zip_city_state_parameters.go | 71 - ...et_location_by_zip_city_state_responses.go | 242 - ...t_location_by_zip_city_state_urlbuilder.go | 99 - .../application_parameters/get_param.go | 58 - .../get_param_parameters.go | 71 - .../get_param_responses.go | 134 - .../get_param_urlbuilder.go | 99 - .../calendar/is_date_weekend_holiday.go | 58 - .../is_date_weekend_holiday_parameters.go | 129 - .../is_date_weekend_holiday_responses.go | 239 - .../is_date_weekend_holiday_urlbuilder.go | 109 - .../create_customer_with_okta_option.go | 58 - ...te_customer_with_okta_option_parameters.go | 84 - ...ate_customer_with_okta_option_responses.go | 419 - ...te_customer_with_okta_option_urlbuilder.go | 87 - .../ghcoperations/customer/get_customer.go | 58 - .../customer/get_customer_parameters.go | 91 - .../customer/get_customer_responses.go | 284 - .../customer/get_customer_urlbuilder.go | 101 - .../customer/search_customers.go | 311 - .../customer/search_customers_parameters.go | 74 - .../customer/search_customers_responses.go | 149 - .../customer/search_customers_urlbuilder.go | 87 - .../ghcoperations/customer/update_customer.go | 58 - .../customer/update_customer_parameters.go | 157 - .../customer/update_customer_responses.go | 374 - .../customer/update_customer_urlbuilder.go | 101 - ...create_customer_support_remark_for_move.go | 58 - ...omer_support_remark_for_move_parameters.go | 101 - ...tomer_support_remark_for_move_responses.go | 239 - ...omer_support_remark_for_move_urlbuilder.go | 99 - .../delete_customer_support_remark.go | 58 - ...lete_customer_support_remark_parameters.go | 91 - ...elete_customer_support_remark_responses.go | 309 - ...lete_customer_support_remark_urlbuilder.go | 101 - .../get_customer_support_remarks_for_move.go | 58 - ...mer_support_remarks_for_move_parameters.go | 71 - ...omer_support_remarks_for_move_responses.go | 242 - ...mer_support_remarks_for_move_urlbuilder.go | 99 - ...update_customer_support_remark_for_move.go | 58 - ...omer_support_remark_for_move_parameters.go | 128 - ...tomer_support_remark_for_move_responses.go | 284 - ...omer_support_remark_for_move_urlbuilder.go | 101 - .../add_appeal_to_serious_incident.go | 58 - ...d_appeal_to_serious_incident_parameters.go | 120 - ...dd_appeal_to_serious_incident_responses.go | 264 - ...d_appeal_to_serious_incident_urlbuilder.go | 101 - .../add_appeal_to_violation.go | 58 - .../add_appeal_to_violation_parameters.go | 163 - .../add_appeal_to_violation_responses.go | 264 - .../add_appeal_to_violation_urlbuilder.go | 109 - .../create_evaluation_report.go | 58 - .../create_evaluation_report_parameters.go | 101 - .../create_evaluation_report_responses.go | 239 - .../create_evaluation_report_urlbuilder.go | 99 - .../delete_evaluation_report.go | 58 - .../delete_evaluation_report_parameters.go | 91 - .../delete_evaluation_report_responses.go | 309 - .../delete_evaluation_report_urlbuilder.go | 101 - .../download_evaluation_report.go | 58 - .../download_evaluation_report_parameters.go | 91 - .../download_evaluation_report_responses.go | 215 - .../download_evaluation_report_urlbuilder.go | 101 - .../get_evaluation_report.go | 58 - .../get_evaluation_report_parameters.go | 91 - .../get_evaluation_report_responses.go | 239 - .../get_evaluation_report_urlbuilder.go | 101 - .../save_evaluation_report.go | 58 - .../save_evaluation_report_parameters.go | 150 - .../save_evaluation_report_responses.go | 354 - .../save_evaluation_report_urlbuilder.go | 101 - .../submit_evaluation_report.go | 58 - .../submit_evaluation_report_parameters.go | 121 - .../submit_evaluation_report_responses.go | 264 - .../submit_evaluation_report_urlbuilder.go | 101 - .../ghc_documents/create_document.go | 58 - .../create_document_parameters.go | 84 - .../create_document_responses.go | 154 - .../create_document_urlbuilder.go | 87 - .../ghc_documents/get_document.go | 58 - .../ghc_documents/get_document_parameters.go | 91 - .../ghc_documents/get_document_responses.go | 374 - .../ghc_documents/get_document_urlbuilder.go | 101 - .../request_line_of_accounting.go | 58 - .../request_line_of_accounting_parameters.go | 84 - .../request_line_of_accounting_responses.go | 329 - .../request_line_of_accounting_urlbuilder.go | 87 - .../move/check_for_locked_moves_and_unlock.go | 97 - ..._for_locked_moves_and_unlock_parameters.go | 91 - ...k_for_locked_moves_and_unlock_responses.go | 104 - ..._for_locked_moves_and_unlock_urlbuilder.go | 101 - .../move/delete_assigned_office_user.go | 117 - .../delete_assigned_office_user_parameters.go | 118 - .../delete_assigned_office_user_responses.go | 104 - .../delete_assigned_office_user_urlbuilder.go | 101 - pkg/gen/ghcapi/ghcoperations/move/get_move.go | 58 - ...move_counseling_evaluation_reports_list.go | 58 - ...ling_evaluation_reports_list_parameters.go | 91 - ...eling_evaluation_reports_list_responses.go | 287 - ...ling_evaluation_reports_list_urlbuilder.go | 101 - .../ghcoperations/move/get_move_history.go | 58 - .../move/get_move_history_parameters.go | 139 - .../move/get_move_history_responses.go | 284 - .../move/get_move_history_urlbuilder.go | 124 - .../ghcoperations/move/get_move_parameters.go | 71 - .../ghcoperations/move/get_move_responses.go | 284 - ...t_move_shipment_evaluation_reports_list.go | 58 - ...ment_evaluation_reports_list_parameters.go | 91 - ...pment_evaluation_reports_list_responses.go | 287 - ...ment_evaluation_reports_list_urlbuilder.go | 101 - .../ghcoperations/move/get_move_urlbuilder.go | 99 - .../ghcoperations/move/move_canceler.go | 58 - .../move/move_canceler_parameters.go | 91 - .../move/move_canceler_responses.go | 329 - .../move/move_canceler_urlbuilder.go | 101 - .../ghcapi/ghcoperations/move/search_moves.go | 430 - .../move/search_moves_parameters.go | 74 - .../move/search_moves_responses.go | 149 - .../move/search_moves_urlbuilder.go | 87 - .../move/set_financial_review_flag.go | 124 - .../set_financial_review_flag_parameters.go | 143 - .../set_financial_review_flag_responses.go | 284 - .../set_financial_review_flag_urlbuilder.go | 101 - .../move/update_assigned_office_user.go | 56 - .../update_assigned_office_user_parameters.go | 128 - .../update_assigned_office_user_responses.go | 149 - .../update_assigned_office_user_urlbuilder.go | 101 - .../move/update_closeout_office.go | 124 - .../move/update_closeout_office_parameters.go | 128 - .../move/update_closeout_office_responses.go | 374 - .../move/update_closeout_office_urlbuilder.go | 99 - .../move/upload_additional_documents.go | 58 - .../upload_additional_documents_parameters.go | 131 - .../upload_additional_documents_responses.go | 204 - .../upload_additional_documents_urlbuilder.go | 101 - .../move_task_order/get_entitlements.go | 58 - .../get_entitlements_parameters.go | 71 - .../get_entitlements_responses.go | 284 - .../get_entitlements_urlbuilder.go | 99 - .../move_task_order/get_move_task_order.go | 58 - .../get_move_task_order_parameters.go | 71 - .../get_move_task_order_responses.go | 284 - .../get_move_task_order_urlbuilder.go | 99 - ...date_m_t_o_reviewed_billable_weights_at.go | 56 - ...reviewed_billable_weights_at_parameters.go | 101 - ..._reviewed_billable_weights_at_responses.go | 419 - ...reviewed_billable_weights_at_urlbuilder.go | 99 - ...t_o_status_service_counseling_completed.go | 58 - ...service_counseling_completed_parameters.go | 101 - ..._service_counseling_completed_responses.go | 419 - ...service_counseling_completed_urlbuilder.go | 99 - .../update_move_t_i_o_remarks.go | 56 - .../update_move_t_i_o_remarks_parameters.go | 138 - .../update_move_t_i_o_remarks_responses.go | 419 - .../update_move_t_i_o_remarks_urlbuilder.go | 99 - .../update_move_task_order_status.go | 58 - ...pdate_move_task_order_status_parameters.go | 138 - ...update_move_task_order_status_responses.go | 419 - ...pdate_move_task_order_status_urlbuilder.go | 99 - .../mto_agent/fetch_m_t_o_agent_list.go | 58 - .../fetch_m_t_o_agent_list_parameters.go | 134 - .../fetch_m_t_o_agent_list_responses.go | 197 - .../fetch_m_t_o_agent_list_urlbuilder.go | 109 - .../get_m_t_o_service_item.go | 58 - .../get_m_t_o_service_item_parameters.go | 95 - .../get_m_t_o_service_item_responses.go | 284 - .../get_m_t_o_service_item_urlbuilder.go | 107 - .../list_m_t_o_service_items.go | 58 - .../list_m_t_o_service_items_parameters.go | 91 - .../list_m_t_o_service_items_responses.go | 197 - .../list_m_t_o_service_items_urlbuilder.go | 101 - .../update_m_t_o_service_item_status.go | 58 - ...te_m_t_o_service_item_status_parameters.go | 162 - ...ate_m_t_o_service_item_status_responses.go | 374 - ...te_m_t_o_service_item_status_urlbuilder.go | 107 - .../update_service_item_sit_entry_date.go | 58 - ..._service_item_sit_entry_date_parameters.go | 109 - ...e_service_item_sit_entry_date_responses.go | 374 - ..._service_item_sit_entry_date_urlbuilder.go | 99 - .../mto_shipment/create_m_t_o_shipment.go | 69 - .../create_m_t_o_shipment_parameters.go | 76 - .../create_m_t_o_shipment_responses.go | 239 - .../create_m_t_o_shipment_urlbuilder.go | 87 - .../mto_shipment/get_shipment.go | 58 - .../mto_shipment/get_shipment_parameters.go | 91 - .../mto_shipment/get_shipment_responses.go | 284 - .../mto_shipment/get_shipment_urlbuilder.go | 101 - .../mto_shipment/list_m_t_o_shipments.go | 58 - .../list_m_t_o_shipments_parameters.go | 91 - .../list_m_t_o_shipments_responses.go | 242 - .../list_m_t_o_shipments_urlbuilder.go | 101 - .../mto_shipment/update_m_t_o_shipment.go | 76 - .../update_m_t_o_shipment_parameters.go | 193 - .../update_m_t_o_shipment_responses.go | 374 - .../update_m_t_o_shipment_urlbuilder.go | 109 - pkg/gen/ghcapi/ghcoperations/mymove_api.go | 1622 - .../create_requested_office_user.go | 59 - ...create_requested_office_user_parameters.go | 76 - .../create_requested_office_user_responses.go | 129 - ...create_requested_office_user_urlbuilder.go | 87 - .../order/acknowledge_excess_weight_risk.go | 58 - ...knowledge_excess_weight_risk_parameters.go | 120 - ...cknowledge_excess_weight_risk_responses.go | 284 - ...knowledge_excess_weight_risk_urlbuilder.go | 101 - .../order/counseling_update_allowance.go | 58 - .../counseling_update_allowance_parameters.go | 157 - .../counseling_update_allowance_responses.go | 284 - .../counseling_update_allowance_urlbuilder.go | 101 - .../order/counseling_update_order.go | 58 - .../counseling_update_order_parameters.go | 157 - .../counseling_update_order_responses.go | 284 - .../counseling_update_order_urlbuilder.go | 101 - .../ghcoperations/order/create_order.go | 58 - .../order/create_order_parameters.go | 76 - .../order/create_order_responses.go | 204 - .../order/create_order_urlbuilder.go | 87 - .../ghcapi/ghcoperations/order/get_order.go | 58 - .../order/get_order_parameters.go | 91 - .../order/get_order_responses.go | 284 - .../order/get_order_urlbuilder.go | 101 - .../ghcoperations/order/update_allowance.go | 58 - .../order/update_allowance_parameters.go | 157 - .../order/update_allowance_responses.go | 284 - .../order/update_allowance_urlbuilder.go | 101 - .../order/update_billable_weight.go | 58 - .../update_billable_weight_parameters.go | 157 - .../order/update_billable_weight_responses.go | 284 - .../update_billable_weight_urlbuilder.go | 101 - .../update_max_billable_weight_as_t_i_o.go | 58 - ...max_billable_weight_as_t_i_o_parameters.go | 158 - ..._max_billable_weight_as_t_i_o_responses.go | 284 - ...max_billable_weight_as_t_i_o_urlbuilder.go | 101 - .../ghcoperations/order/update_order.go | 58 - .../order/update_order_parameters.go | 157 - .../order/update_order_responses.go | 374 - .../order/update_order_urlbuilder.go | 101 - .../order/upload_amended_orders.go | 58 - .../order/upload_amended_orders_parameters.go | 131 - .../order/upload_amended_orders_responses.go | 204 - .../order/upload_amended_orders_urlbuilder.go | 101 - .../payment_requests/bulk_download.go | 58 - .../bulk_download_parameters.go | 71 - .../bulk_download_responses.go | 170 - .../bulk_download_urlbuilder.go | 99 - .../payment_requests/get_payment_request.go | 58 - .../get_payment_request_parameters.go | 91 - .../get_payment_request_responses.go | 284 - .../get_payment_request_urlbuilder.go | 101 - .../get_payment_requests_for_move.go | 58 - ...et_payment_requests_for_move_parameters.go | 71 - ...get_payment_requests_for_move_responses.go | 242 - ...et_payment_requests_for_move_urlbuilder.go | 99 - .../get_shipments_payment_s_i_t_balance.go | 58 - ...pments_payment_s_i_t_balance_parameters.go | 91 - ...ipments_payment_s_i_t_balance_responses.go | 242 - ...pments_payment_s_i_t_balance_urlbuilder.go | 101 - .../update_payment_request_status.go | 58 - ...pdate_payment_request_status_parameters.go | 157 - ...update_payment_request_status_responses.go | 374 - ...pdate_payment_request_status_urlbuilder.go | 101 - .../update_payment_service_item_status.go | 58 - ..._payment_service_item_status_parameters.go | 162 - ...e_payment_service_item_status_responses.go | 374 - ..._payment_service_item_status_urlbuilder.go | 107 - .../ppm/finish_document_review.go | 58 - .../ppm/finish_document_review_parameters.go | 120 - .../ppm/finish_document_review_responses.go | 419 - .../ppm/finish_document_review_urlbuilder.go | 101 - .../ppm/get_p_p_m_actual_weight.go | 58 - .../ppm/get_p_p_m_actual_weight_parameters.go | 91 - .../ppm/get_p_p_m_actual_weight_responses.go | 284 - .../ppm/get_p_p_m_actual_weight_urlbuilder.go | 101 - .../ghcoperations/ppm/get_p_p_m_closeout.go | 58 - .../ppm/get_p_p_m_closeout_parameters.go | 91 - .../ppm/get_p_p_m_closeout_responses.go | 284 - .../ppm/get_p_p_m_closeout_urlbuilder.go | 101 - .../ghcoperations/ppm/get_p_p_m_documents.go | 59 - .../ppm/get_p_p_m_documents_parameters.go | 91 - .../ppm/get_p_p_m_documents_responses.go | 239 - .../ppm/get_p_p_m_documents_urlbuilder.go | 101 - .../ppm/get_p_p_m_s_i_t_estimated_cost.go | 58 - ...t_p_p_m_s_i_t_estimated_cost_parameters.go | 284 - ...et_p_p_m_s_i_t_estimated_cost_responses.go | 284 - ...t_p_p_m_s_i_t_estimated_cost_urlbuilder.go | 133 - .../ghcoperations/ppm/show_a_o_a_packet.go | 62 - .../ppm/show_a_o_a_packet_parameters.go | 71 - .../ppm/show_a_o_a_packet_responses.go | 305 - .../ppm/show_a_o_a_packet_urlbuilder.go | 99 - .../ghcoperations/ppm/show_payment_packet.go | 58 - .../ppm/show_payment_packet_parameters.go | 91 - .../ppm/show_payment_packet_responses.go | 203 - .../ppm/show_payment_packet_urlbuilder.go | 101 - .../ppm/update_moving_expense.go | 59 - .../ppm/update_moving_expense_parameters.go | 201 - .../ppm/update_moving_expense_responses.go | 374 - .../ppm/update_moving_expense_urlbuilder.go | 109 - .../ghcoperations/ppm/update_p_p_m_s_i_t.go | 58 - .../ppm/update_p_p_m_s_i_t_parameters.go | 149 - .../ppm/update_p_p_m_s_i_t_responses.go | 329 - .../ppm/update_p_p_m_s_i_t_urlbuilder.go | 101 - .../ppm/update_pro_gear_weight_ticket.go | 59 - ...pdate_pro_gear_weight_ticket_parameters.go | 201 - ...update_pro_gear_weight_ticket_responses.go | 374 - ...pdate_pro_gear_weight_ticket_urlbuilder.go | 109 - .../ghcoperations/ppm/update_weight_ticket.go | 59 - .../ppm/update_weight_ticket_parameters.go | 201 - .../ppm/update_weight_ticket_responses.go | 374 - .../ppm/update_weight_ticket_urlbuilder.go | 109 - .../pws_violations/get_p_w_s_violations.go | 58 - .../get_p_w_s_violations_parameters.go | 46 - .../get_p_w_s_violations_responses.go | 242 - .../get_p_w_s_violations_urlbuilder.go | 87 - .../queues/get_bulk_assignment_data.go | 58 - .../get_bulk_assignment_data_parameters.go | 92 - .../get_bulk_assignment_data_responses.go | 194 - .../get_bulk_assignment_data_urlbuilder.go | 103 - .../ghcoperations/queues/get_moves_queue.go | 58 - .../queues/get_moves_queue_parameters.go | 644 - .../queues/get_moves_queue_responses.go | 149 - .../queues/get_moves_queue_urlbuilder.go | 274 - .../queues/get_payment_requests_queue.go | 58 - .../get_payment_requests_queue_parameters.go | 598 - .../get_payment_requests_queue_responses.go | 149 - .../get_payment_requests_queue_urlbuilder.go | 259 - .../get_services_counseling_origin_list.go | 58 - ...vices_counseling_origin_list_parameters.go | 110 - ...rvices_counseling_origin_list_responses.go | 152 - ...vices_counseling_origin_list_urlbuilder.go | 114 - .../queues/get_services_counseling_queue.go | 58 - ...et_services_counseling_queue_parameters.go | 858 - ...get_services_counseling_queue_responses.go | 149 - ...et_services_counseling_queue_urlbuilder.go | 328 - .../ghcoperations/queues/list_prime_moves.go | 64 - .../queues/list_prime_moves_parameters.go | 243 - .../queues/list_prime_moves_responses.go | 149 - .../queues/list_prime_moves_urlbuilder.go | 151 - .../get_all_re_service_items.go | 58 - .../get_all_re_service_items_parameters.go | 46 - .../get_all_re_service_items_responses.go | 242 - .../get_all_re_service_items_urlbuilder.go | 87 - .../associate_report_violations.go | 58 - .../associate_report_violations_parameters.go | 120 - .../associate_report_violations_responses.go | 309 - .../associate_report_violations_urlbuilder.go | 101 - .../get_report_violations_by_report_id.go | 58 - ...port_violations_by_report_id_parameters.go | 91 - ...eport_violations_by_report_id_responses.go | 242 - ...port_violations_by_report_id_urlbuilder.go | 101 - .../shipment/approve_s_i_t_extension.go | 58 - .../approve_s_i_t_extension_parameters.go | 200 - .../approve_s_i_t_extension_responses.go | 329 - .../approve_s_i_t_extension_urlbuilder.go | 109 - .../shipment/approve_shipment.go | 58 - .../shipment/approve_shipment_diversion.go | 58 - .../approve_shipment_diversion_parameters.go | 120 - .../approve_shipment_diversion_responses.go | 329 - .../approve_shipment_diversion_urlbuilder.go | 101 - .../shipment/approve_shipment_parameters.go | 120 - .../shipment/approve_shipment_responses.go | 329 - .../shipment/approve_shipment_urlbuilder.go | 101 - .../create_approved_s_i_t_duration_update.go | 58 - ...proved_s_i_t_duration_update_parameters.go | 157 - ...pproved_s_i_t_duration_update_responses.go | 284 - ...proved_s_i_t_duration_update_urlbuilder.go | 101 - .../ghcoperations/shipment/delete_shipment.go | 58 - .../shipment/delete_shipment_parameters.go | 91 - .../shipment/delete_shipment_responses.go | 309 - .../shipment/delete_shipment_urlbuilder.go | 101 - .../shipment/deny_s_i_t_extension.go | 58 - .../deny_s_i_t_extension_parameters.go | 200 - .../deny_s_i_t_extension_responses.go | 329 - .../deny_s_i_t_extension_urlbuilder.go | 109 - .../ghcoperations/shipment/reject_shipment.go | 58 - .../shipment/reject_shipment_parameters.go | 157 - .../shipment/reject_shipment_responses.go | 329 - .../shipment/reject_shipment_urlbuilder.go | 101 - .../shipment/request_shipment_cancellation.go | 58 - ...equest_shipment_cancellation_parameters.go | 120 - ...request_shipment_cancellation_responses.go | 329 - ...equest_shipment_cancellation_urlbuilder.go | 101 - .../shipment/request_shipment_diversion.go | 58 - .../request_shipment_diversion_parameters.go | 157 - .../request_shipment_diversion_responses.go | 329 - .../request_shipment_diversion_urlbuilder.go | 101 - .../shipment/request_shipment_reweigh.go | 58 - .../request_shipment_reweigh_parameters.go | 91 - .../request_shipment_reweigh_responses.go | 329 - .../request_shipment_reweigh_urlbuilder.go | 101 - .../review_shipment_address_update.go | 172 - ...view_shipment_address_update_parameters.go | 155 - ...eview_shipment_address_update_responses.go | 329 - ...view_shipment_address_update_urlbuilder.go | 101 - ...ate_s_i_t_service_item_customer_expense.go | 58 - ...ervice_item_customer_expense_parameters.go | 157 - ...service_item_customer_expense_responses.go | 329 - ...ervice_item_customer_expense_urlbuilder.go | 101 - .../ghcoperations/tac/tac_validation.go | 58 - .../tac/tac_validation_parameters.go | 82 - .../tac/tac_validation_responses.go | 284 - .../tac/tac_validation_urlbuilder.go | 100 - .../get_transportation_offices.go | 58 - .../get_transportation_offices_g_b_l_o_cs.go | 58 - ...portation_offices_g_b_l_o_cs_parameters.go | 46 - ...sportation_offices_g_b_l_o_cs_responses.go | 287 - ...portation_offices_g_b_l_o_cs_urlbuilder.go | 87 - .../get_transportation_offices_open.go | 58 - ..._transportation_offices_open_parameters.go | 97 - ...t_transportation_offices_open_responses.go | 287 - ..._transportation_offices_open_urlbuilder.go | 100 - .../get_transportation_offices_parameters.go | 97 - .../get_transportation_offices_responses.go | 287 - .../get_transportation_offices_urlbuilder.go | 100 - .../ghcoperations/uploads/create_upload.go | 58 - .../uploads/create_upload_parameters.go | 136 - .../uploads/create_upload_responses.go | 184 - .../uploads/create_upload_urlbuilder.go | 105 - .../ghcoperations/uploads/delete_upload.go | 58 - .../uploads/delete_upload_parameters.go | 140 - .../uploads/delete_upload_responses.go | 159 - .../uploads/delete_upload_urlbuilder.go | 115 - .../ghcoperations/uploads/get_upload.go | 58 - .../uploads/get_upload_parameters.go | 46 - .../uploads/get_upload_responses.go | 284 - .../uploads/get_upload_urlbuilder.go | 87 - .../ghcoperations/uploads/update_upload.go | 127 - .../uploads/update_upload_parameters.go | 126 - .../uploads/update_upload_responses.go | 184 - .../uploads/update_upload_urlbuilder.go | 101 - pkg/gen/ghcapi/server.go | 507 - .../ghcmessages/bulk_assignment_move_i_ds.go | 70 - .../ghcmessages/bulk_assignment_move_id.go | 39 - pkg/gen/ghcmessages/client_error.go | 110 - pkg/gen/ghcmessages/contractor.go | 83 - .../counseling_update_allowance_payload.go | 279 - .../counseling_update_order_payload.go | 533 - pkg/gen/ghcmessages/create_appeal.go | 110 - .../create_approved_s_i_t_duration_update.go | 145 - pkg/gen/ghcmessages/create_boat_shipment.go | 229 - .../ghcmessages/create_customer_payload.go | 344 - .../create_customer_support_remark.go | 95 - .../ghcmessages/create_evaluation_report.go | 75 - pkg/gen/ghcmessages/create_m_t_o_shipment.go | 817 - .../create_mobile_home_shipment.go | 156 - pkg/gen/ghcmessages/create_orders.go | 438 - pkg/gen/ghcmessages/create_p_p_m_shipment.go | 404 - pkg/gen/ghcmessages/created_customer.go | 351 - pkg/gen/ghcmessages/customer.go | 351 - pkg/gen/ghcmessages/customer_contact_type.go | 78 - .../ghcmessages/customer_support_remark.go | 284 - .../ghcmessages/customer_support_remarks.go | 78 - pkg/gen/ghcmessages/deny_s_i_t_extension.go | 90 - pkg/gen/ghcmessages/department_indicator.go | 92 - pkg/gen/ghcmessages/dept_indicator.go | 90 - pkg/gen/ghcmessages/destination_type.go | 85 - pkg/gen/ghcmessages/dimension_type.go | 78 - pkg/gen/ghcmessages/document.go | 169 - pkg/gen/ghcmessages/duty_location.go | 159 - pkg/gen/ghcmessages/entitlements.go | 142 - pkg/gen/ghcmessages/error.go | 71 - pkg/gen/ghcmessages/evaluation_report.go | 794 - .../evaluation_report_inspection_type.go | 81 - pkg/gen/ghcmessages/evaluation_report_list.go | 78 - .../ghcmessages/evaluation_report_location.go | 81 - .../evaluation_report_office_user.go | 126 - pkg/gen/ghcmessages/evaluation_report_type.go | 78 - .../fetch_line_of_accounting_payload.go | 158 - pkg/gen/ghcmessages/g_b_l_o_c.go | 138 - pkg/gen/ghcmessages/g_b_l_o_cs.go | 27 - pkg/gen/ghcmessages/g_s_r_appeal.go | 282 - .../ghcmessages/g_s_r_appeal_status_type.go | 78 - pkg/gen/ghcmessages/g_s_r_appeals.go | 78 - pkg/gen/ghcmessages/grade.go | 159 - .../invalid_request_response_payload.go | 50 - .../is_date_weekend_holiday_info.go | 148 - pkg/gen/ghcmessages/l_o_a_type.go | 79 - pkg/gen/ghcmessages/line_of_accounting.go | 1232 - pkg/gen/ghcmessages/list_prime_move.go | 338 - pkg/gen/ghcmessages/list_prime_moves.go | 78 - .../ghcmessages/list_prime_moves_result.go | 109 - pkg/gen/ghcmessages/location.go | 90 - pkg/gen/ghcmessages/locations.go | 78 - pkg/gen/ghcmessages/locked_office_user.go | 136 - pkg/gen/ghcmessages/m_t_o_agent.go | 236 - pkg/gen/ghcmessages/m_t_o_agents.go | 78 - .../m_t_o_approval_service_item_codes.go | 55 - pkg/gen/ghcmessages/m_t_o_service_item.go | 937 - .../m_t_o_service_item_customer_contact.go | 171 - .../m_t_o_service_item_customer_contacts.go | 78 - .../m_t_o_service_item_dimension.go | 138 - .../m_t_o_service_item_dimensions.go | 78 - .../ghcmessages/m_t_o_service_item_single.go | 390 - .../ghcmessages/m_t_o_service_item_status.go | 81 - pkg/gen/ghcmessages/m_t_o_service_items.go | 78 - pkg/gen/ghcmessages/m_t_o_shipment.go | 1564 - pkg/gen/ghcmessages/m_t_o_shipment_status.go | 91 - pkg/gen/ghcmessages/m_t_o_shipment_type.go | 97 - pkg/gen/ghcmessages/m_t_o_shipments.go | 78 - pkg/gen/ghcmessages/mobile_home.go | 232 - pkg/gen/ghcmessages/move.go | 932 - pkg/gen/ghcmessages/move_audit_histories.go | 78 - pkg/gen/ghcmessages/move_audit_history.go | 244 - .../ghcmessages/move_audit_history_item.go | 53 - .../ghcmessages/move_audit_history_items.go | 78 - pkg/gen/ghcmessages/move_history.go | 130 - pkg/gen/ghcmessages/move_history_result.go | 139 - pkg/gen/ghcmessages/move_payload.go | 467 - pkg/gen/ghcmessages/move_status.go | 93 - pkg/gen/ghcmessages/move_task_order.go | 431 - pkg/gen/ghcmessages/move_task_orders.go | 78 - pkg/gen/ghcmessages/moving_expense.go | 674 - pkg/gen/ghcmessages/moving_expenses.go | 78 - pkg/gen/ghcmessages/office_user.go | 593 - pkg/gen/ghcmessages/office_user_create.go | 250 - pkg/gen/ghcmessages/office_user_role.go | 55 - .../omittable_moving_expense_type.go | 99 - .../omittable_p_p_m_document_status.go | 81 - pkg/gen/ghcmessages/order.go | 901 - pkg/gen/ghcmessages/order_body.go | 74 - pkg/gen/ghcmessages/orders_type.go | 102 - pkg/gen/ghcmessages/orders_type_detail.go | 93 - pkg/gen/ghcmessages/p_p_m_actual_weight.go | 72 - pkg/gen/ghcmessages/p_p_m_advance_status.go | 89 - pkg/gen/ghcmessages/p_p_m_closeout.go | 225 - .../ghcmessages/p_p_m_destination_address.go | 379 - pkg/gen/ghcmessages/p_p_m_document_status.go | 81 - .../p_p_m_document_status_reason.go | 27 - pkg/gen/ghcmessages/p_p_m_documents.go | 184 - .../ghcmessages/p_p_m_s_i_t_estimated_cost.go | 335 - pkg/gen/ghcmessages/p_p_m_shipment.go | 1264 - pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go | 146 - pkg/gen/ghcmessages/p_p_m_shipment_status.go | 108 - pkg/gen/ghcmessages/p_p_m_status.go | 96 - pkg/gen/ghcmessages/p_w_s_violation.go | 116 - pkg/gen/ghcmessages/p_w_s_violations.go | 78 - ...patch_m_t_o_service_item_status_payload.go | 112 - pkg/gen/ghcmessages/payment_request.go | 471 - pkg/gen/ghcmessages/payment_request_status.go | 96 - pkg/gen/ghcmessages/payment_requests.go | 78 - pkg/gen/ghcmessages/payment_service_item.go | 350 - .../ghcmessages/payment_service_item_param.go | 274 - .../payment_service_item_params.go | 78 - .../payment_service_item_status.go | 90 - pkg/gen/ghcmessages/payment_service_items.go | 78 - pkg/gen/ghcmessages/post_document_payload.go | 74 - pkg/gen/ghcmessages/pro_gear_weight_ticket.go | 463 - .../ghcmessages/pro_gear_weight_tickets.go | 78 - pkg/gen/ghcmessages/proof_of_service_doc.go | 124 - pkg/gen/ghcmessages/proof_of_service_docs.go | 78 - pkg/gen/ghcmessages/queue_move.go | 774 - pkg/gen/ghcmessages/queue_moves.go | 78 - pkg/gen/ghcmessages/queue_moves_result.go | 109 - pkg/gen/ghcmessages/queue_payment_request.go | 512 - .../queue_payment_request_status.go | 84 - pkg/gen/ghcmessages/queue_payment_requests.go | 78 - .../queue_payment_requests_result.go | 109 - pkg/gen/ghcmessages/re_service_item.go | 378 - pkg/gen/ghcmessages/re_service_items.go | 78 - pkg/gen/ghcmessages/reject_shipment.go | 72 - pkg/gen/ghcmessages/report_violation.go | 215 - pkg/gen/ghcmessages/report_violations.go | 78 - pkg/gen/ghcmessages/request_diversion.go | 72 - pkg/gen/ghcmessages/reweigh.go | 195 - pkg/gen/ghcmessages/reweigh_requester.go | 84 - pkg/gen/ghcmessages/role.go | 190 - pkg/gen/ghcmessages/s_i_t_extension.go | 291 - pkg/gen/ghcmessages/s_i_t_extensions.go | 78 - pkg/gen/ghcmessages/s_i_t_location_type.go | 78 - .../s_i_t_service_item_grouping.go | 153 - .../s_i_t_service_item_groupings.go | 78 - pkg/gen/ghcmessages/s_i_t_status.go | 397 - pkg/gen/ghcmessages/s_i_t_summary.go | 199 - pkg/gen/ghcmessages/search_customer.go | 132 - pkg/gen/ghcmessages/search_customers.go | 78 - .../ghcmessages/search_customers_result.go | 109 - pkg/gen/ghcmessages/search_move.go | 370 - pkg/gen/ghcmessages/search_moves.go | 78 - pkg/gen/ghcmessages/search_moves_result.go | 109 - .../ghcmessages/service_item_param_name.go | 282 - .../ghcmessages/service_item_param_origin.go | 84 - .../ghcmessages/service_item_param_type.go | 93 - .../service_item_sit_entry_date.go | 95 - .../ghcmessages/service_request_document.go | 142 - .../ghcmessages/service_request_documents.go | 78 - .../ghcmessages/shipment_address_update.go | 408 - .../shipment_address_update_status.go | 90 - .../shipment_payment_s_i_t_balance.go | 186 - .../shipments_payment_s_i_t_balance.go | 78 - pkg/gen/ghcmessages/signed_certification.go | 408 - .../ghcmessages/signed_certification_type.go | 100 - pkg/gen/ghcmessages/storage_facility.go | 194 - .../submitted_moving_expense_type.go | 99 - pkg/gen/ghcmessages/tac_valid.go | 72 - pkg/gen/ghcmessages/transportation_office.go | 246 - .../transportation_office_assignment.go | 241 - pkg/gen/ghcmessages/transportation_offices.go | 78 - .../ghcmessages/update_allowance_payload.go | 279 - .../update_billable_weight_payload.go | 75 - pkg/gen/ghcmessages/update_boat_shipment.go | 129 - .../ghcmessages/update_customer_payload.go | 247 - .../update_customer_support_remark_payload.go | 72 - ...te_max_billable_weight_as_t_i_o_payload.go | 100 - .../update_mobile_home_shipment.go | 65 - pkg/gen/ghcmessages/update_moving_expense.go | 265 - pkg/gen/ghcmessages/update_order_payload.go | 536 - pkg/gen/ghcmessages/update_p_p_m_shipment.go | 571 - .../update_payment_request_status_payload.go | 111 - .../update_pro_gear_weight_ticket.go | 134 - ...ate_s_i_t_service_item_customer_expense.go | 90 - pkg/gen/ghcmessages/update_shipment.go | 736 - pkg/gen/ghcmessages/update_weight_ticket.go | 177 - pkg/gen/ghcmessages/upload.go | 477 - pkg/gen/ghcmessages/v_location.go | 302 - pkg/gen/ghcmessages/v_locations.go | 78 - pkg/gen/ghcmessages/validation_error.go | 154 - pkg/gen/ghcmessages/weight_ticket.go | 703 - pkg/gen/ghcmessages/weight_tickets.go | 78 - pkg/gen/internalapi/configure_mymove.go | 453 - pkg/gen/internalapi/doc.go | 27 - pkg/gen/internalapi/embedded_spec.go | 17822 --------- .../get_location_by_zip_city_state.go | 58 - ...t_location_by_zip_city_state_parameters.go | 71 - ...et_location_by_zip_city_state_responses.go | 242 - ...t_location_by_zip_city_state_urlbuilder.go | 99 - .../addresses/show_address.go | 58 - .../addresses/show_address_parameters.go | 91 - .../addresses/show_address_responses.go | 159 - .../addresses/show_address_urlbuilder.go | 101 - .../application_parameters/validate.go | 58 - .../validate_parameters.go | 84 - .../validate_responses.go | 134 - .../validate_urlbuilder.go | 87 - .../create_service_member_backup_contact.go | 58 - ...ervice_member_backup_contact_parameters.go | 128 - ...service_member_backup_contact_responses.go | 184 - ...ervice_member_backup_contact_urlbuilder.go | 101 - .../index_service_member_backup_contacts.go | 58 - ...rvice_member_backup_contacts_parameters.go | 91 - ...ervice_member_backup_contacts_responses.go | 187 - ...rvice_member_backup_contacts_urlbuilder.go | 101 - .../show_service_member_backup_contact.go | 58 - ...ervice_member_backup_contact_parameters.go | 91 - ...service_member_backup_contact_responses.go | 184 - ...ervice_member_backup_contact_urlbuilder.go | 101 - .../update_service_member_backup_contact.go | 58 - ...ervice_member_backup_contact_parameters.go | 128 - ...service_member_backup_contact_responses.go | 184 - ...ervice_member_backup_contact_urlbuilder.go | 101 - .../calendar/is_date_weekend_holiday.go | 58 - .../is_date_weekend_holiday_parameters.go | 129 - .../is_date_weekend_holiday_responses.go | 239 - .../is_date_weekend_holiday_urlbuilder.go | 109 - .../calendar/show_available_move_dates.go | 58 - .../show_available_move_dates_parameters.go | 101 - .../show_available_move_dates_responses.go | 159 - .../show_available_move_dates_urlbuilder.go | 102 - .../create_signed_certification.go | 58 - .../create_signed_certification_parameters.go | 128 - .../create_signed_certification_responses.go | 184 - .../create_signed_certification_urlbuilder.go | 101 - .../index_signed_certification.go | 58 - .../index_signed_certification_parameters.go | 91 - .../index_signed_certification_responses.go | 187 - .../index_signed_certification_urlbuilder.go | 101 - .../documents/create_document.go | 58 - .../documents/create_document_parameters.go | 84 - .../documents/create_document_responses.go | 109 - .../documents/create_document_urlbuilder.go | 87 - .../documents/show_document.go | 58 - .../documents/show_document_parameters.go | 91 - .../documents/show_document_responses.go | 179 - .../documents/show_document_urlbuilder.go | 101 - .../duty_locations/search_duty_locations.go | 58 - .../search_duty_locations_parameters.go | 82 - .../search_duty_locations_responses.go | 187 - .../search_duty_locations_urlbuilder.go | 100 - .../entitlements/index_entitlements.go | 58 - .../index_entitlements_parameters.go | 46 - .../index_entitlements_responses.go | 62 - .../index_entitlements_urlbuilder.go | 87 - .../boolean_feature_flag_for_user.go | 58 - ...oolean_feature_flag_for_user_parameters.go | 95 - ...boolean_feature_flag_for_user_responses.go | 134 - ...oolean_feature_flag_for_user_urlbuilder.go | 99 - .../variant_feature_flag_for_user.go | 58 - ...ariant_feature_flag_for_user_parameters.go | 95 - ...variant_feature_flag_for_user_responses.go | 134 - ...ariant_feature_flag_for_user_urlbuilder.go | 99 - .../move_docs/create_generic_move_document.go | 58 - ...create_generic_move_document_parameters.go | 128 - .../create_generic_move_document_responses.go | 159 - ...create_generic_move_document_urlbuilder.go | 101 - .../create_weight_ticket_document.go | 58 - ...reate_weight_ticket_document_parameters.go | 128 - ...create_weight_ticket_document_responses.go | 159 - ...reate_weight_ticket_document_urlbuilder.go | 101 - .../move_docs/delete_move_document.go | 58 - .../delete_move_document_parameters.go | 91 - .../delete_move_document_responses.go | 159 - .../delete_move_document_urlbuilder.go | 101 - .../move_docs/index_move_documents.go | 58 - .../index_move_documents_parameters.go | 91 - .../index_move_documents_responses.go | 137 - .../index_move_documents_urlbuilder.go | 101 - .../move_docs/update_move_document.go | 58 - .../update_move_document_parameters.go | 128 - .../update_move_document_responses.go | 184 - .../update_move_document_urlbuilder.go | 101 - .../internaloperations/moves/get_all_moves.go | 58 - .../moves/get_all_moves_parameters.go | 91 - .../moves/get_all_moves_responses.go | 194 - .../moves/get_all_moves_urlbuilder.go | 101 - .../internaloperations/moves/patch_move.go | 58 - .../moves/patch_move_parameters.go | 158 - .../moves/patch_move_responses.go | 234 - .../moves/patch_move_urlbuilder.go | 101 - .../internaloperations/moves/show_move.go | 58 - .../moves/show_move_parameters.go | 91 - .../moves/show_move_responses.go | 184 - .../moves/show_move_urlbuilder.go | 101 - .../moves/submit_amended_orders.go | 58 - .../moves/submit_amended_orders_parameters.go | 91 - .../moves/submit_amended_orders_responses.go | 204 - .../moves/submit_amended_orders_urlbuilder.go | 101 - .../moves/submit_move_for_approval.go | 58 - .../submit_move_for_approval_parameters.go | 128 - .../submit_move_for_approval_responses.go | 204 - .../submit_move_for_approval_urlbuilder.go | 101 - .../moves/upload_additional_documents.go | 58 - .../upload_additional_documents_parameters.go | 131 - .../upload_additional_documents_responses.go | 204 - .../upload_additional_documents_urlbuilder.go | 101 - .../mto_shipment/create_m_t_o_shipment.go | 67 - .../create_m_t_o_shipment_parameters.go | 76 - .../create_m_t_o_shipment_responses.go | 329 - .../create_m_t_o_shipment_urlbuilder.go | 87 - .../mto_shipment/delete_shipment.go | 58 - .../delete_shipment_parameters.go | 91 - .../mto_shipment/delete_shipment_responses.go | 309 - .../delete_shipment_urlbuilder.go | 101 - .../mto_shipment/list_m_t_o_shipments.go | 58 - .../list_m_t_o_shipments_parameters.go | 91 - .../list_m_t_o_shipments_responses.go | 242 - .../list_m_t_o_shipments_urlbuilder.go | 101 - .../mto_shipment/update_m_t_o_shipment.go | 73 - .../update_m_t_o_shipment_parameters.go | 150 - .../update_m_t_o_shipment_responses.go | 374 - .../update_m_t_o_shipment_urlbuilder.go | 101 - .../internaloperations/mymove_api.go | 1175 - .../internaloperations/office/approve_move.go | 58 - .../office/approve_move_parameters.go | 91 - .../office/approve_move_responses.go | 204 - .../office/approve_move_urlbuilder.go | 101 - .../office/approve_reimbursement.go | 58 - .../approve_reimbursement_parameters.go | 91 - .../office/approve_reimbursement_responses.go | 159 - .../approve_reimbursement_urlbuilder.go | 101 - .../internaloperations/office/cancel_move.go | 58 - .../office/cancel_move_parameters.go | 91 - .../office/cancel_move_responses.go | 204 - .../office/cancel_move_urlbuilder.go | 101 - .../office/show_office_orders.go | 58 - .../office/show_office_orders_parameters.go | 91 - .../office/show_office_orders_responses.go | 184 - .../office/show_office_orders_urlbuilder.go | 101 - .../okta_profile/show_okta_info.go | 58 - .../okta_profile/show_okta_info_parameters.go | 46 - .../okta_profile/show_okta_info_responses.go | 184 - .../okta_profile/show_okta_info_urlbuilder.go | 87 - .../okta_profile/update_okta_info.go | 58 - .../update_okta_info_parameters.go | 84 - .../update_okta_info_responses.go | 202 - .../update_okta_info_urlbuilder.go | 87 - .../orders/create_orders.go | 58 - .../orders/create_orders_parameters.go | 84 - .../orders/create_orders_responses.go | 159 - .../orders/create_orders_urlbuilder.go | 87 - .../internaloperations/orders/show_orders.go | 58 - .../orders/show_orders_parameters.go | 91 - .../orders/show_orders_responses.go | 184 - .../orders/show_orders_urlbuilder.go | 101 - .../orders/update_orders.go | 58 - .../orders/update_orders_parameters.go | 128 - .../orders/update_orders_responses.go | 184 - .../orders/update_orders_urlbuilder.go | 101 - .../orders/upload_amended_orders.go | 58 - .../upload_amended_orders_parameters.go | 131 - .../orders/upload_amended_orders_responses.go | 204 - .../upload_amended_orders_urlbuilder.go | 101 - .../validate_postal_code_with_rate_data.go | 58 - ...e_postal_code_with_rate_data_parameters.go | 135 - ...te_postal_code_with_rate_data_responses.go | 159 - ...e_postal_code_with_rate_data_urlbuilder.go | 110 - .../ppm/create_moving_expense.go | 58 - .../ppm/create_moving_expense_parameters.go | 91 - .../ppm/create_moving_expense_responses.go | 329 - .../ppm/create_moving_expense_urlbuilder.go | 101 - .../ppm/create_p_p_m_upload.go | 58 - .../ppm/create_p_p_m_upload_parameters.go | 220 - .../ppm/create_p_p_m_upload_responses.go | 309 - .../ppm/create_p_p_m_upload_urlbuilder.go | 119 - .../ppm/create_pro_gear_weight_ticket.go | 59 - ...reate_pro_gear_weight_ticket_parameters.go | 91 - ...create_pro_gear_weight_ticket_responses.go | 374 - ...reate_pro_gear_weight_ticket_urlbuilder.go | 101 - .../ppm/create_weight_ticket.go | 58 - .../ppm/create_weight_ticket_parameters.go | 91 - .../ppm/create_weight_ticket_responses.go | 329 - .../ppm/create_weight_ticket_urlbuilder.go | 101 - .../ppm/delete_moving_expense.go | 59 - .../ppm/delete_moving_expense_parameters.go | 134 - .../ppm/delete_moving_expense_responses.go | 354 - .../ppm/delete_moving_expense_urlbuilder.go | 109 - .../ppm/delete_pro_gear_weight_ticket.go | 59 - ...elete_pro_gear_weight_ticket_parameters.go | 134 - ...delete_pro_gear_weight_ticket_responses.go | 354 - ...elete_pro_gear_weight_ticket_urlbuilder.go | 109 - .../ppm/delete_weight_ticket.go | 60 - .../ppm/delete_weight_ticket_parameters.go | 134 - .../ppm/delete_weight_ticket_responses.go | 354 - .../ppm/delete_weight_ticket_urlbuilder.go | 109 - .../resubmit_p_p_m_shipment_documentation.go | 59 - ...p_p_m_shipment_documentation_parameters.go | 201 - ..._p_p_m_shipment_documentation_responses.go | 419 - ...p_p_m_shipment_documentation_urlbuilder.go | 109 - .../ppm/show_a_o_a_packet.go | 62 - .../ppm/show_a_o_a_packet_parameters.go | 71 - .../ppm/show_a_o_a_packet_responses.go | 305 - .../ppm/show_a_o_a_packet_urlbuilder.go | 99 - .../ppm/show_payment_packet.go | 58 - .../ppm/show_payment_packet_parameters.go | 91 - .../ppm/show_payment_packet_responses.go | 203 - .../ppm/show_payment_packet_urlbuilder.go | 101 - .../submit_p_p_m_shipment_documentation.go | 59 - ...p_p_m_shipment_documentation_parameters.go | 128 - ..._p_p_m_shipment_documentation_responses.go | 374 - ...p_p_m_shipment_documentation_urlbuilder.go | 101 - .../ppm/update_moving_expense.go | 58 - .../ppm/update_moving_expense_parameters.go | 201 - .../ppm/update_moving_expense_responses.go | 374 - .../ppm/update_moving_expense_urlbuilder.go | 109 - .../ppm/update_pro_gear_weight_ticket.go | 59 - ...pdate_pro_gear_weight_ticket_parameters.go | 201 - ...update_pro_gear_weight_ticket_responses.go | 374 - ...pdate_pro_gear_weight_ticket_urlbuilder.go | 109 - .../ppm/update_weight_ticket.go | 58 - .../ppm/update_weight_ticket_parameters.go | 201 - .../ppm/update_weight_ticket_responses.go | 374 - .../ppm/update_weight_ticket_urlbuilder.go | 109 - .../internaloperations/queues/show_queue.go | 58 - .../queues/show_queue_parameters.go | 86 - .../queues/show_queue_responses.go | 162 - .../queues/show_queue_urlbuilder.go | 99 - .../service_members/create_service_member.go | 58 - .../create_service_member_parameters.go | 84 - .../create_service_member_responses.go | 184 - .../create_service_member_urlbuilder.go | 87 - .../service_members/patch_service_member.go | 58 - .../patch_service_member_parameters.go | 128 - .../patch_service_member_responses.go | 184 - .../patch_service_member_urlbuilder.go | 101 - .../service_members/show_service_member.go | 58 - .../show_service_member_orders.go | 58 - .../show_service_member_orders_parameters.go | 91 - .../show_service_member_orders_responses.go | 184 - .../show_service_member_orders_urlbuilder.go | 101 - .../show_service_member_parameters.go | 91 - .../show_service_member_responses.go | 184 - .../show_service_member_urlbuilder.go | 101 - .../get_transportation_offices.go | 58 - .../get_transportation_offices_parameters.go | 97 - .../get_transportation_offices_responses.go | 287 - .../get_transportation_offices_urlbuilder.go | 100 - .../show_counseling_offices.go | 58 - .../show_counseling_offices_parameters.go | 91 - .../show_counseling_offices_responses.go | 87 - .../show_counseling_offices_urlbuilder.go | 101 - ...how_duty_location_transportation_office.go | 58 - ...cation_transportation_office_parameters.go | 91 - ...ocation_transportation_office_responses.go | 184 - ...cation_transportation_office_urlbuilder.go | 101 - .../uploads/create_upload.go | 58 - .../uploads/create_upload_parameters.go | 136 - .../uploads/create_upload_responses.go | 204 - .../uploads/create_upload_urlbuilder.go | 105 - .../uploads/delete_upload.go | 58 - .../uploads/delete_upload_parameters.go | 232 - .../uploads/delete_upload_responses.go | 159 - .../uploads/delete_upload_urlbuilder.go | 133 - .../uploads/delete_uploads.go | 58 - .../uploads/delete_uploads_parameters.go | 101 - .../uploads/delete_uploads_responses.go | 159 - .../uploads/delete_uploads_urlbuilder.go | 115 - .../users/is_logged_in_user.go | 119 - .../users/is_logged_in_user_parameters.go | 46 - .../users/is_logged_in_user_responses.go | 107 - .../users/is_logged_in_user_urlbuilder.go | 87 - .../users/show_logged_in_user.go | 58 - .../users/show_logged_in_user_parameters.go | 46 - .../users/show_logged_in_user_responses.go | 134 - .../users/show_logged_in_user_urlbuilder.go | 87 - pkg/gen/internalapi/server.go | 507 - .../create_mobile_home_shipment.go | 156 - .../internalmessages/create_p_p_m_shipment.go | 411 - ...e_service_member_backup_contact_payload.go | 174 - .../create_service_member_payload.go | 421 - pkg/gen/internalmessages/create_shipment.go | 680 - .../create_signed_certification_payload.go | 238 - .../internalmessages/create_update_orders.go | 482 - .../create_weight_ticket_documents_payload.go | 280 - pkg/gen/internalmessages/dept_indicator.go | 90 - pkg/gen/internalmessages/document.go | 169 - .../internalmessages/duty_location_payload.go | 346 - .../duty_locations_payload.go | 78 - pkg/gen/internalmessages/entitlement.go | 73 - pkg/gen/internalmessages/error.go | 108 - .../internalmessages/feature_flag_boolean.go | 126 - .../internalmessages/feature_flag_variant.go | 144 - .../internalmessages/index_entitlements.go | 67 - .../internalmessages/index_moves_payload.go | 78 - ..._service_member_backup_contacts_payload.go | 78 - pkg/gen/internalmessages/internal_move.go | 436 - .../invalid_request_response_payload.go | 50 - .../is_date_weekend_holiday_info.go | 148 - .../logged_in_user_payload.go | 365 - pkg/gen/internalmessages/m_t_o_agent.go | 275 - pkg/gen/internalmessages/m_t_o_agent_type.go | 79 - pkg/gen/internalmessages/m_t_o_agents.go | 78 - pkg/gen/internalmessages/m_t_o_shipment.go | 967 - .../internalmessages/m_t_o_shipment_status.go | 93 - .../internalmessages/m_t_o_shipment_type.go | 97 - pkg/gen/internalmessages/m_t_o_shipments.go | 78 - pkg/gen/internalmessages/method_of_receipt.go | 81 - pkg/gen/internalmessages/mobile_home.go | 232 - .../internalmessages/move_document_payload.go | 597 - .../internalmessages/move_document_status.go | 84 - .../internalmessages/move_document_type.go | 91 - pkg/gen/internalmessages/move_documents.go | 78 - pkg/gen/internalmessages/move_payload.go | 518 - pkg/gen/internalmessages/move_queue_item.go | 563 - pkg/gen/internalmessages/move_status.go | 90 - pkg/gen/internalmessages/moves_list.go | 183 - pkg/gen/internalmessages/moving_expense.go | 674 - .../internalmessages/moving_expense_type.go | 99 - .../nullable_signed_certification_type.go | 84 - pkg/gen/internalmessages/office_user.go | 309 - .../okta_user_profile_data.go | 129 - .../omittable_moving_expense_type.go | 99 - .../omittable_p_p_m_document_status.go | 81 - pkg/gen/internalmessages/order_pay_grade.go | 159 - pkg/gen/internalmessages/orders.go | 821 - pkg/gen/internalmessages/orders_status.go | 84 - pkg/gen/internalmessages/orders_type.go | 102 - .../internalmessages/orders_type_detail.go | 93 - .../internalmessages/p_p_m_advance_status.go | 89 - .../p_p_m_destination_address.go | 379 - .../p_p_m_document_status_reason.go | 27 - .../internalmessages/p_p_m_estimate_range.go | 88 - pkg/gen/internalmessages/p_p_m_shipment.go | 1264 - .../internalmessages/p_p_m_shipment_status.go | 108 - .../internalmessages/patch_move_payload.go | 76 - .../patch_service_member_payload.go | 401 - .../internalmessages/post_document_payload.go | 74 - pkg/gen/internalmessages/ppm_id.go | 40 - pkg/gen/internalmessages/privilege.go | 156 - .../pro_gear_weight_ticket.go | 463 - .../rate_engine_postal_code_payload.go | 145 - pkg/gen/internalmessages/reimbursement.go | 229 - .../internalmessages/reimbursement_status.go | 87 - pkg/gen/internalmessages/role.go | 139 - .../internalmessages/s_i_t_location_type.go | 78 - ...ave_p_p_m_shipment_signed_certification.go | 110 - .../service_member_backup_contact_payload.go | 276 - .../service_member_payload.go | 676 - .../internalmessages/signed_certification.go | 408 - .../signed_certification_payload.go | 327 - .../signed_certification_type.go | 100 - .../signed_certification_type_create.go | 84 - .../internalmessages/signed_certifications.go | 78 - .../submit_move_for_approval_payload.go | 109 - .../submitted_moving_expense_type.go | 99 - .../internalmessages/transportation_office.go | 246 - .../transportation_office_assignment.go | 241 - .../transportation_offices.go | 78 - .../internalmessages/update_boat_shipment.go | 129 - .../update_mobile_home_shipment.go | 65 - .../internalmessages/update_moving_expense.go | 277 - .../update_okta_user_profile_data.go | 109 - .../internalmessages/update_p_p_m_shipment.go | 572 - .../update_pro_gear_weight_ticket.go | 83 - ...e_service_member_backup_contact_payload.go | 174 - pkg/gen/internalmessages/update_shipment.go | 714 - .../internalmessages/update_weight_ticket.go | 132 - pkg/gen/internalmessages/upload.go | 477 - pkg/gen/internalmessages/v_location.go | 302 - pkg/gen/internalmessages/v_locations.go | 78 - pkg/gen/internalmessages/validation_error.go | 154 - pkg/gen/internalmessages/weight_allotment.go | 126 - pkg/gen/internalmessages/weight_ticket.go | 703 - .../weight_ticket_set_type.go | 84 - pkg/gen/internalmessages/weight_tickets.go | 78 - pkg/gen/primeapi/configure_mymove.go | 183 - pkg/gen/primeapi/doc.go | 28 - pkg/gen/primeapi/embedded_spec.go | 9491 ----- .../create_excess_weight_record.go | 58 - .../create_excess_weight_record_parameters.go | 131 - .../create_excess_weight_record_responses.go | 284 - .../create_excess_weight_record_urlbuilder.go | 101 - .../move_task_order/download_move_order.go | 63 - .../download_move_order_parameters.go | 125 - .../download_move_order_responses.go | 305 - .../download_move_order_urlbuilder.go | 113 - .../move_task_order/get_move_task_order.go | 61 - .../get_move_task_order_parameters.go | 71 - .../get_move_task_order_responses.go | 239 - .../get_move_task_order_urlbuilder.go | 99 - .../move_task_order/list_moves.go | 64 - .../move_task_order/list_moves_parameters.go | 97 - .../move_task_order/list_moves_responses.go | 197 - .../move_task_order/list_moves_urlbuilder.go | 105 - ...pdate_m_t_o_post_counseling_information.go | 65 - ..._post_counseling_information_parameters.go | 102 - ...o_post_counseling_information_responses.go | 374 - ..._post_counseling_information_urlbuilder.go | 99 - .../create_m_t_o_service_item.go | 144 - .../create_m_t_o_service_item_parameters.go | 76 - .../create_m_t_o_service_item_responses.go | 377 - .../create_m_t_o_service_item_urlbuilder.go | 87 - .../create_service_request_document_upload.go | 67 - ...vice_request_document_upload_parameters.go | 111 - ...rvice_request_document_upload_responses.go | 329 - ...vice_request_document_upload_urlbuilder.go | 99 - .../update_m_t_o_service_item.go | 116 - .../update_m_t_o_service_item_parameters.go | 138 - .../update_m_t_o_service_item_responses.go | 419 - .../update_m_t_o_service_item_urlbuilder.go | 99 - .../mto_shipment/create_m_t_o_agent.go | 67 - .../create_m_t_o_agent_parameters.go | 128 - .../create_m_t_o_agent_responses.go | 374 - .../create_m_t_o_agent_urlbuilder.go | 101 - .../mto_shipment/create_m_t_o_shipment.go | 59 - .../create_m_t_o_shipment_parameters.go | 46 - .../create_m_t_o_shipment_responses.go | 37 - .../create_m_t_o_shipment_urlbuilder.go | 87 - .../mto_shipment/create_s_i_t_extension.go | 61 - .../create_s_i_t_extension_parameters.go | 128 - .../create_s_i_t_extension_responses.go | 374 - .../create_s_i_t_extension_urlbuilder.go | 101 - .../mto_shipment/delete_m_t_o_shipment.go | 64 - .../delete_m_t_o_shipment_parameters.go | 91 - .../delete_m_t_o_shipment_responses.go | 309 - .../delete_m_t_o_shipment_urlbuilder.go | 101 - .../mto_shipment/update_m_t_o_agent.go | 67 - .../update_m_t_o_agent_parameters.go | 201 - .../update_m_t_o_agent_responses.go | 374 - .../update_m_t_o_agent_urlbuilder.go | 109 - .../mto_shipment/update_m_t_o_shipment.go | 59 - .../update_m_t_o_shipment_address.go | 72 - ...pdate_m_t_o_shipment_address_parameters.go | 201 - ...update_m_t_o_shipment_address_responses.go | 419 - ...pdate_m_t_o_shipment_address_urlbuilder.go | 109 - .../update_m_t_o_shipment_parameters.go | 91 - .../update_m_t_o_shipment_responses.go | 37 - .../update_m_t_o_shipment_status.go | 60 - ...update_m_t_o_shipment_status_parameters.go | 158 - .../update_m_t_o_shipment_status_responses.go | 419 - ...update_m_t_o_shipment_status_urlbuilder.go | 101 - .../update_m_t_o_shipment_urlbuilder.go | 101 - .../mto_shipment/update_reweigh.go | 64 - .../mto_shipment/update_reweigh_parameters.go | 201 - .../mto_shipment/update_reweigh_responses.go | 419 - .../mto_shipment/update_reweigh_urlbuilder.go | 109 - .../update_shipment_destination_address.go | 76 - ...shipment_destination_address_parameters.go | 158 - ..._shipment_destination_address_responses.go | 419 - ...shipment_destination_address_urlbuilder.go | 101 - .../primeapi/primeoperations/mymove_api.go | 558 - .../payment_request/create_payment_request.go | 407 - .../create_payment_request_parameters.go | 76 - .../create_payment_request_responses.go | 374 - .../create_payment_request_urlbuilder.go | 87 - .../payment_request/create_upload.go | 88 - .../create_upload_parameters.go | 144 - .../create_upload_responses.go | 329 - .../create_upload_urlbuilder.go | 99 - pkg/gen/primeapi/server.go | 507 - .../create_excess_weight_record_parameters.go | 174 - .../create_excess_weight_record_responses.go | 473 - .../download_move_order_parameters.go | 198 - .../download_move_order_responses.go | 487 - .../get_move_task_order_parameters.go | 151 - .../get_move_task_order_responses.go | 399 - .../move_task_order/list_moves_parameters.go | 165 - .../move_task_order/list_moves_responses.go | 323 - .../move_task_order/move_task_order_client.go | 275 - ..._post_counseling_information_parameters.go | 174 - ...o_post_counseling_information_responses.go | 621 - .../create_m_t_o_service_item_parameters.go | 148 - .../create_m_t_o_service_item_responses.go | 621 - ...vice_request_document_upload_parameters.go | 172 - ...rvice_request_document_upload_responses.go | 547 - .../mto_service_item_client.go | 318 - .../update_m_t_o_service_item_parameters.go | 193 - .../update_m_t_o_service_item_responses.go | 695 - .../create_m_t_o_agent_parameters.go | 174 - .../create_m_t_o_agent_responses.go | 621 - .../create_m_t_o_shipment_parameters.go | 128 - .../create_m_t_o_shipment_responses.go | 88 - .../create_s_i_t_extension_parameters.go | 174 - .../create_s_i_t_extension_responses.go | 621 - .../delete_m_t_o_shipment_parameters.go | 153 - .../delete_m_t_o_shipment_responses.go | 535 - .../mto_shipment/mto_shipment_client.go | 524 - .../update_m_t_o_agent_parameters.go | 221 - .../update_m_t_o_agent_responses.go | 621 - ...pdate_m_t_o_shipment_address_parameters.go | 221 - ...update_m_t_o_shipment_address_responses.go | 695 - .../update_m_t_o_shipment_parameters.go | 153 - .../update_m_t_o_shipment_responses.go | 88 - ...update_m_t_o_shipment_status_parameters.go | 197 - .../update_m_t_o_shipment_status_responses.go | 695 - .../mto_shipment/update_reweigh_parameters.go | 221 - .../mto_shipment/update_reweigh_responses.go | 695 - ...shipment_destination_address_parameters.go | 197 - ..._shipment_destination_address_responses.go | 695 - pkg/gen/primeclient/mymove_client.go | 127 - .../create_payment_request_parameters.go | 150 - .../create_payment_request_responses.go | 621 - .../create_upload_parameters.go | 205 - .../create_upload_responses.go | 547 - .../payment_request/payment_request_client.go | 504 - pkg/gen/primemessages/excess_weight_record.go | 226 - pkg/gen/primemessages/list_move.go | 414 - pkg/gen/primemessages/list_moves.go | 78 - pkg/gen/primemessages/m_t_o_agent.go | 306 - pkg/gen/primemessages/m_t_o_agent_type.go | 82 - pkg/gen/primemessages/m_t_o_agents.go | 85 - pkg/gen/primemessages/m_t_o_service_item.go | 523 - .../primemessages/m_t_o_service_item_basic.go | 574 - .../m_t_o_service_item_dest_s_i_t.go | 987 - .../m_t_o_service_item_dimension.go | 129 - .../m_t_o_service_item_domestic_crating.go | 705 - ..._t_o_service_item_international_crating.go | 773 - ...rvice_item_international_fuel_surcharge.go | 575 - .../m_t_o_service_item_model_type.go | 103 - .../m_t_o_service_item_origin_s_i_t.go | 900 - .../m_t_o_service_item_shuttle.go | 633 - .../m_t_o_service_item_status.go | 90 - pkg/gen/primemessages/m_t_o_shipment.go | 204 - pkg/gen/primemessages/m_t_o_shipment_type.go | 107 - .../m_t_o_shipment_without_service_items.go | 1282 - ...m_t_o_shipments_without_service_objects.go | 78 - pkg/gen/primemessages/move_task_order.go | 939 - pkg/gen/primemessages/order.go | 448 - pkg/gen/primemessages/orders_type.go | 102 - pkg/gen/primemessages/p_p_m_shipment.go | 587 - .../primemessages/p_p_m_shipment_status.go | 108 - pkg/gen/primemessages/payment_request.go | 322 - .../primemessages/payment_request_status.go | 96 - pkg/gen/primemessages/payment_requests.go | 78 - pkg/gen/primemessages/payment_service_item.go | 266 - .../payment_service_item_param.go | 274 - .../payment_service_item_params.go | 78 - .../payment_service_item_status.go | 90 - .../primemessages/payment_service_items.go | 78 - pkg/gen/primemessages/proof_of_service_doc.go | 121 - .../primemessages/proof_of_service_docs.go | 78 - pkg/gen/primemessages/re_service_code.go | 219 - pkg/gen/primemessages/reweigh.go | 280 - pkg/gen/primemessages/reweigh_requester.go | 84 - pkg/gen/primemessages/s_i_t_extension.go | 291 - pkg/gen/primemessages/s_i_t_extensions.go | 78 - pkg/gen/primemessages/s_i_t_location_type.go | 78 - pkg/gen/primemessages/service_item.go | 211 - .../primemessages/service_item_param_name.go | 282 - .../service_item_param_origin.go | 84 - .../primemessages/service_item_param_type.go | 93 - .../primemessages/service_request_document.go | 121 - .../service_request_documents.go | 78 - .../primemessages/shipment_address_update.go | 408 - .../shipment_address_update_status.go | 90 - pkg/gen/primemessages/storage_facility.go | 194 - .../update_m_t_o_service_item.go | 194 - ...o_service_item_international_port_f_s_c.go | 249 - .../update_m_t_o_service_item_model_type.go | 95 - .../update_m_t_o_service_item_s_i_t.go | 680 - .../update_m_t_o_service_item_shuttle.go | 264 - .../primemessages/update_m_t_o_shipment.go | 570 - .../update_m_t_o_shipment_status.go | 102 - .../primemessages/update_p_p_m_shipment.go | 199 - pkg/gen/primemessages/update_reweigh.go | 79 - .../update_shipment_destination_address.go | 126 - .../primemessages/upload_with_omissions.go | 279 - pkg/gen/primemessages/validation_error.go | 132 - pkg/gen/primev2api/configure_mymove.go | 87 - pkg/gen/primev2api/doc.go | 26 - pkg/gen/primev2api/embedded_spec.go | 7217 ---- .../move_task_order/get_move_task_order.go | 65 - .../get_move_task_order_parameters.go | 71 - .../get_move_task_order_responses.go | 239 - .../get_move_task_order_urlbuilder.go | 99 - .../mto_shipment/create_m_t_o_shipment.go | 73 - .../create_m_t_o_shipment_parameters.go | 76 - .../create_m_t_o_shipment_responses.go | 239 - .../create_m_t_o_shipment_urlbuilder.go | 87 - .../mto_shipment/update_m_t_o_shipment.go | 72 - .../update_m_t_o_shipment_parameters.go | 158 - .../update_m_t_o_shipment_responses.go | 374 - .../update_m_t_o_shipment_urlbuilder.go | 101 - .../primev2operations/mymove_api.go | 334 - pkg/gen/primev2api/server.go | 507 - .../get_move_task_order_parameters.go | 151 - .../get_move_task_order_responses.go | 399 - .../move_task_order/move_task_order_client.go | 89 - .../create_m_t_o_shipment_parameters.go | 150 - .../create_m_t_o_shipment_responses.go | 399 - .../mto_shipment/mto_shipment_client.go | 153 - .../update_m_t_o_shipment_parameters.go | 197 - .../update_m_t_o_shipment_responses.go | 621 - pkg/gen/primev2client/mymove_client.go | 117 - pkg/gen/primev2messages/m_t_o_agent_type.go | 82 - pkg/gen/primev2messages/m_t_o_agents.go | 85 - pkg/gen/primev2messages/m_t_o_service_item.go | 517 - .../m_t_o_service_item_basic.go | 574 - .../m_t_o_service_item_dest_s_i_t.go | 987 - .../m_t_o_service_item_dimension.go | 129 - .../m_t_o_service_item_domestic_crating.go | 705 - ..._t_o_service_item_international_crating.go | 773 - .../m_t_o_service_item_model_type.go | 103 - .../m_t_o_service_item_origin_s_i_t.go | 900 - .../m_t_o_service_item_shuttle.go | 633 - .../m_t_o_service_item_status.go | 90 - pkg/gen/primev2messages/m_t_o_shipment.go | 204 - .../primev2messages/m_t_o_shipment_type.go | 107 - .../m_t_o_shipment_without_service_items.go | 1282 - ...m_t_o_shipments_without_service_objects.go | 78 - pkg/gen/primev2messages/move_task_order.go | 965 - pkg/gen/primev2messages/order.go | 516 - pkg/gen/primev2messages/orders_type.go | 102 - pkg/gen/primev2messages/p_p_m_shipment.go | 587 - .../primev2messages/p_p_m_shipment_status.go | 108 - pkg/gen/primev2messages/payment_request.go | 322 - .../primev2messages/payment_request_status.go | 96 - pkg/gen/primev2messages/payment_requests.go | 78 - .../primev2messages/payment_service_item.go | 266 - .../payment_service_item_param.go | 274 - .../payment_service_item_params.go | 78 - .../payment_service_item_status.go | 90 - .../primev2messages/payment_service_items.go | 78 - .../primev2messages/proof_of_service_doc.go | 121 - .../primev2messages/proof_of_service_docs.go | 78 - pkg/gen/primev2messages/re_service_code.go | 219 - pkg/gen/primev2messages/reweigh.go | 280 - pkg/gen/primev2messages/reweigh_requester.go | 84 - pkg/gen/primev2messages/s_i_t_extension.go | 291 - pkg/gen/primev2messages/s_i_t_extensions.go | 78 - .../primev2messages/s_i_t_location_type.go | 78 - .../service_item_param_name.go | 282 - .../service_item_param_origin.go | 84 - .../service_item_param_type.go | 93 - .../service_request_document.go | 121 - .../service_request_documents.go | 78 - .../shipment_address_update.go | 408 - .../shipment_address_update_status.go | 90 - pkg/gen/primev2messages/storage_facility.go | 194 - .../update_m_t_o_service_item.go | 188 - .../update_m_t_o_service_item_model_type.go | 86 - .../update_m_t_o_service_item_s_i_t.go | 680 - .../update_m_t_o_service_item_shuttle.go | 264 - .../primev2messages/update_m_t_o_shipment.go | 534 - .../update_m_t_o_shipment_status.go | 102 - .../primev2messages/update_p_p_m_shipment.go | 199 - pkg/gen/primev2messages/update_reweigh.go | 79 - .../update_shipment_destination_address.go | 126 - .../primev2messages/upload_with_omissions.go | 279 - pkg/gen/primev2messages/validation_error.go | 132 - pkg/gen/primev3api/configure_mymove.go | 87 - pkg/gen/primev3api/doc.go | 26 - pkg/gen/primev3api/embedded_spec.go | 8587 ---- .../move_task_order/get_move_task_order.go | 61 - .../get_move_task_order_parameters.go | 71 - .../get_move_task_order_responses.go | 239 - .../get_move_task_order_urlbuilder.go | 99 - .../mto_shipment/create_m_t_o_shipment.go | 69 - .../create_m_t_o_shipment_parameters.go | 76 - .../create_m_t_o_shipment_responses.go | 239 - .../create_m_t_o_shipment_urlbuilder.go | 87 - .../mto_shipment/update_m_t_o_shipment.go | 68 - .../update_m_t_o_shipment_parameters.go | 158 - .../update_m_t_o_shipment_responses.go | 374 - .../update_m_t_o_shipment_urlbuilder.go | 101 - .../primev3operations/mymove_api.go | 334 - pkg/gen/primev3api/server.go | 507 - .../get_move_task_order_parameters.go | 151 - .../get_move_task_order_responses.go | 399 - .../move_task_order/move_task_order_client.go | 85 - .../create_m_t_o_shipment_parameters.go | 150 - .../create_m_t_o_shipment_responses.go | 399 - .../mto_shipment/mto_shipment_client.go | 145 - .../update_m_t_o_shipment_parameters.go | 197 - .../update_m_t_o_shipment_responses.go | 621 - pkg/gen/primev3client/mymove_client.go | 117 - pkg/gen/primev3messages/error.go | 108 - pkg/gen/primev3messages/m_t_o_agent.go | 306 - pkg/gen/primev3messages/m_t_o_agent_type.go | 82 - pkg/gen/primev3messages/m_t_o_agents.go | 85 - pkg/gen/primev3messages/m_t_o_service_item.go | 517 - .../m_t_o_service_item_basic.go | 574 - .../m_t_o_service_item_dest_s_i_t.go | 987 - .../m_t_o_service_item_dimension.go | 129 - .../m_t_o_service_item_domestic_crating.go | 705 - ..._t_o_service_item_international_crating.go | 773 - .../m_t_o_service_item_model_type.go | 103 - .../m_t_o_service_item_origin_s_i_t.go | 900 - .../m_t_o_service_item_shuttle.go | 633 - .../m_t_o_service_item_status.go | 90 - pkg/gen/primev3messages/m_t_o_shipment.go | 204 - .../primev3messages/m_t_o_shipment_type.go | 107 - .../m_t_o_shipment_without_service_items.go | 1740 - ...m_t_o_shipments_without_service_objects.go | 78 - pkg/gen/primev3messages/mobile_home.go | 232 - pkg/gen/primev3messages/move_task_order.go | 965 - pkg/gen/primev3messages/order.go | 516 - pkg/gen/primev3messages/orders_type.go | 102 - .../p_p_m_destination_address.go | 379 - pkg/gen/primev3messages/p_p_m_shipment.go | 1003 - .../primev3messages/p_p_m_shipment_status.go | 108 - pkg/gen/primev3messages/payment_request.go | 322 - .../primev3messages/payment_request_status.go | 96 - pkg/gen/primev3messages/payment_requests.go | 78 - .../primev3messages/payment_service_item.go | 266 - .../payment_service_item_param.go | 274 - .../payment_service_item_params.go | 78 - .../payment_service_item_status.go | 90 - .../primev3messages/payment_service_items.go | 78 - pkg/gen/primev3messages/port.go | 385 - .../primev3messages/proof_of_service_doc.go | 121 - .../primev3messages/proof_of_service_docs.go | 78 - pkg/gen/primev3messages/rate_area.go | 113 - pkg/gen/primev3messages/re_service_code.go | 219 - pkg/gen/primev3messages/reweigh.go | 280 - pkg/gen/primev3messages/reweigh_requester.go | 84 - pkg/gen/primev3messages/s_i_t_extension.go | 291 - pkg/gen/primev3messages/s_i_t_extensions.go | 78 - .../primev3messages/s_i_t_location_type.go | 78 - .../service_item_param_name.go | 282 - .../service_item_param_origin.go | 84 - .../service_item_param_type.go | 93 - .../service_request_document.go | 121 - .../service_request_documents.go | 78 - .../shipment_address_update.go | 408 - .../shipment_address_update_status.go | 90 - pkg/gen/primev3messages/storage_facility.go | 194 - .../update_m_t_o_service_item.go | 188 - .../update_m_t_o_service_item_model_type.go | 86 - .../update_m_t_o_service_item_s_i_t.go | 680 - .../update_m_t_o_service_item_shuttle.go | 264 - .../primev3messages/update_m_t_o_shipment.go | 690 - .../update_m_t_o_shipment_status.go | 102 - .../primev3messages/update_p_p_m_shipment.go | 373 - pkg/gen/primev3messages/update_reweigh.go | 79 - .../update_shipment_destination_address.go | 126 - .../primev3messages/upload_with_omissions.go | 279 - pkg/gen/primev3messages/validation_error.go | 132 - pkg/gen/supportapi/configure_mymove.go | 145 - pkg/gen/supportapi/doc.go | 26 - pkg/gen/supportapi/embedded_spec.go | 5480 --- pkg/gen/supportapi/server.go | 507 - .../move_task_order/create_move_task_order.go | 70 - .../create_move_task_order_parameters.go | 84 - .../create_move_task_order_responses.go | 329 - .../create_move_task_order_urlbuilder.go | 87 - .../move_task_order/get_move_task_order.go | 63 - .../get_move_task_order_parameters.go | 71 - .../get_move_task_order_responses.go | 239 - .../get_move_task_order_urlbuilder.go | 99 - .../hide_non_fake_move_task_orders.go | 60 - ...de_non_fake_move_task_orders_parameters.go | 46 - ...ide_non_fake_move_task_orders_responses.go | 419 - ...de_non_fake_move_task_orders_urlbuilder.go | 87 - .../move_task_order/list_m_t_os.go | 61 - .../move_task_order/list_m_t_os_parameters.go | 83 - .../move_task_order/list_m_t_os_responses.go | 287 - .../move_task_order/list_m_t_os_urlbuilder.go | 105 - .../make_move_task_order_available.go | 60 - ...ke_move_task_order_available_parameters.go | 102 - ...ake_move_task_order_available_responses.go | 374 - ...ke_move_task_order_available_urlbuilder.go | 99 - .../update_m_t_o_service_item_status.go | 60 - ...te_m_t_o_service_item_status_parameters.go | 139 - ...ate_m_t_o_service_item_status_responses.go | 419 - ...te_m_t_o_service_item_status_urlbuilder.go | 99 - .../update_m_t_o_shipment_status.go | 58 - ...update_m_t_o_shipment_status_parameters.go | 158 - .../update_m_t_o_shipment_status_responses.go | 419 - ...update_m_t_o_shipment_status_urlbuilder.go | 101 - .../supportoperations/mymove_api.go | 469 - .../get_payment_request_e_d_i.go | 62 - .../get_payment_request_e_d_i_parameters.go | 91 - .../get_payment_request_e_d_i_responses.go | 374 - .../get_payment_request_e_d_i_urlbuilder.go | 101 - .../list_m_t_o_payment_requests.go | 62 - .../list_m_t_o_payment_requests_parameters.go | 91 - .../list_m_t_o_payment_requests_responses.go | 287 - .../list_m_t_o_payment_requests_urlbuilder.go | 101 - .../process_reviewed_payment_requests.go | 61 - ...ss_reviewed_payment_requests_parameters.go | 84 - ...ess_reviewed_payment_requests_responses.go | 332 - ...ss_reviewed_payment_requests_urlbuilder.go | 87 - .../recalculate_payment_request.go | 62 - .../recalculate_payment_request_parameters.go | 91 - .../recalculate_payment_request_responses.go | 419 - .../recalculate_payment_request_urlbuilder.go | 101 - .../update_payment_request_status.go | 62 - ...pdate_payment_request_status_parameters.go | 158 - ...update_payment_request_status_responses.go | 419 - ...pdate_payment_request_status_urlbuilder.go | 101 - .../webhook/create_webhook_notification.go | 58 - .../create_webhook_notification_parameters.go | 76 - .../create_webhook_notification_responses.go | 149 - .../create_webhook_notification_urlbuilder.go | 87 - .../webhook/receive_webhook_notification.go | 58 - ...receive_webhook_notification_parameters.go | 84 - .../receive_webhook_notification_responses.go | 239 - ...receive_webhook_notification_urlbuilder.go | 87 - .../create_move_task_order_parameters.go | 150 - .../create_move_task_order_responses.go | 547 - .../get_move_task_order_parameters.go | 151 - .../get_move_task_order_responses.go | 399 - ...de_non_fake_move_task_orders_parameters.go | 128 - ...ide_non_fake_move_task_orders_responses.go | 695 - .../move_task_order/list_m_t_os_parameters.go | 166 - .../move_task_order/list_m_t_os_responses.go | 471 - ...ke_move_task_order_available_parameters.go | 174 - ...ake_move_task_order_available_responses.go | 621 - .../move_task_order/move_task_order_client.go | 278 - .../mto_service_item_client.go | 84 - ...te_m_t_o_service_item_status_parameters.go | 195 - ...ate_m_t_o_service_item_status_responses.go | 695 - .../mto_shipment/mto_shipment_client.go | 81 - ...update_m_t_o_shipment_status_parameters.go | 197 - .../update_m_t_o_shipment_status_responses.go | 695 - pkg/gen/supportclient/mymove_client.go | 132 - .../get_payment_request_e_d_i_parameters.go | 153 - .../get_payment_request_e_d_i_responses.go | 621 - .../list_m_t_o_payment_requests_parameters.go | 153 - .../list_m_t_o_payment_requests_responses.go | 471 - .../payment_request/payment_request_client.go | 271 - ...ss_reviewed_payment_requests_parameters.go | 150 - ...ess_reviewed_payment_requests_responses.go | 545 - .../recalculate_payment_request_parameters.go | 153 - .../recalculate_payment_request_responses.go | 695 - ...pdate_payment_request_status_parameters.go | 197 - ...update_payment_request_status_responses.go | 695 - .../create_webhook_notification_parameters.go | 153 - .../create_webhook_notification_responses.go | 251 - ...receive_webhook_notification_parameters.go | 153 - .../receive_webhook_notification_responses.go | 399 - .../supportclient/webhook/webhook_client.go | 123 - pkg/gen/supportmessages/orders_type_detail.go | 93 - pkg/gen/supportmessages/payment_request.go | 289 - .../supportmessages/payment_request_e_d_i.go | 111 - .../supportmessages/payment_request_status.go | 96 - pkg/gen/supportmessages/payment_requests.go | 78 - .../process_reviewed_payment_requests.go | 180 - .../proof_of_service_package.go | 143 - pkg/gen/supportmessages/rank.go | 159 - pkg/gen/supportmessages/re_service_code.go | 219 - .../update_m_t_o_service_item_status.go | 108 - .../update_m_t_o_shipment_status.go | 121 - .../update_payment_request_status.go | 126 - .../supportmessages/upload_with_omissions.go | 279 - pkg/gen/supportmessages/validation_error.go | 132 - .../supportmessages/webhook_notification.go | 312 - .../webhook_notification_status.go | 87 - 1666 files changed, 393203 deletions(-) delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/mymove_api.go delete mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications.go delete mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations.go delete mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload.go delete mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/get_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/index_users.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/update_user.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go delete mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go delete mode 100644 pkg/gen/adminapi/configure_mymove.go delete mode 100644 pkg/gen/adminapi/doc.go delete mode 100644 pkg/gen/adminapi/embedded_spec.go delete mode 100644 pkg/gen/adminapi/server.go delete mode 100644 pkg/gen/adminmessages/electronic_order.go delete mode 100644 pkg/gen/adminmessages/electronic_orders.go delete mode 100644 pkg/gen/adminmessages/electronic_orders_total.go delete mode 100644 pkg/gen/adminmessages/electronic_orders_totals.go delete mode 100644 pkg/gen/adminmessages/issuer.go delete mode 100644 pkg/gen/adminmessages/move.go delete mode 100644 pkg/gen/adminmessages/move_status.go delete mode 100644 pkg/gen/adminmessages/move_update.go delete mode 100644 pkg/gen/adminmessages/moves.go delete mode 100644 pkg/gen/adminmessages/notification.go delete mode 100644 pkg/gen/adminmessages/notifications.go delete mode 100644 pkg/gen/adminmessages/office_user.go delete mode 100644 pkg/gen/adminmessages/office_user_create.go delete mode 100644 pkg/gen/adminmessages/office_user_privilege.go delete mode 100644 pkg/gen/adminmessages/office_user_role.go delete mode 100644 pkg/gen/adminmessages/office_user_transportation_office_assignment.go delete mode 100644 pkg/gen/adminmessages/office_user_update.go delete mode 100644 pkg/gen/adminmessages/office_users.go delete mode 100644 pkg/gen/adminmessages/okta_account_info_response.go delete mode 100644 pkg/gen/adminmessages/organization.go delete mode 100644 pkg/gen/adminmessages/organizations.go delete mode 100644 pkg/gen/adminmessages/payment_request_syncada_file.go delete mode 100644 pkg/gen/adminmessages/payment_request_syncada_files.go delete mode 100644 pkg/gen/adminmessages/privilege.go delete mode 100644 pkg/gen/adminmessages/requested_office_user_update.go delete mode 100644 pkg/gen/adminmessages/role.go delete mode 100644 pkg/gen/adminmessages/service_member.go delete mode 100644 pkg/gen/adminmessages/transportation_office.go delete mode 100644 pkg/gen/adminmessages/transportation_office_assignment.go delete mode 100644 pkg/gen/adminmessages/transportation_offices.go delete mode 100644 pkg/gen/adminmessages/upload.go delete mode 100644 pkg/gen/adminmessages/upload_information.go delete mode 100644 pkg/gen/adminmessages/user.go delete mode 100644 pkg/gen/adminmessages/user_update.go delete mode 100644 pkg/gen/adminmessages/users.go delete mode 100644 pkg/gen/adminmessages/validation_error.go delete mode 100644 pkg/gen/adminmessages/webhook_subscription.go delete mode 100644 pkg/gen/adminmessages/webhook_subscription_status.go delete mode 100644 pkg/gen/adminmessages/webhook_subscriptions.go delete mode 100644 pkg/gen/ghcapi/configure_mymove.go delete mode 100644 pkg/gen/ghcapi/doc.go delete mode 100644 pkg/gen/ghcapi/embedded_spec.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/mymove_api.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go delete mode 100644 pkg/gen/ghcapi/server.go delete mode 100644 pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go delete mode 100644 pkg/gen/ghcmessages/bulk_assignment_move_id.go delete mode 100644 pkg/gen/ghcmessages/client_error.go delete mode 100644 pkg/gen/ghcmessages/contractor.go delete mode 100644 pkg/gen/ghcmessages/counseling_update_allowance_payload.go delete mode 100644 pkg/gen/ghcmessages/counseling_update_order_payload.go delete mode 100644 pkg/gen/ghcmessages/create_appeal.go delete mode 100644 pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go delete mode 100644 pkg/gen/ghcmessages/create_boat_shipment.go delete mode 100644 pkg/gen/ghcmessages/create_customer_payload.go delete mode 100644 pkg/gen/ghcmessages/create_customer_support_remark.go delete mode 100644 pkg/gen/ghcmessages/create_evaluation_report.go delete mode 100644 pkg/gen/ghcmessages/create_m_t_o_shipment.go delete mode 100644 pkg/gen/ghcmessages/create_mobile_home_shipment.go delete mode 100644 pkg/gen/ghcmessages/create_orders.go delete mode 100644 pkg/gen/ghcmessages/create_p_p_m_shipment.go delete mode 100644 pkg/gen/ghcmessages/created_customer.go delete mode 100644 pkg/gen/ghcmessages/customer.go delete mode 100644 pkg/gen/ghcmessages/customer_contact_type.go delete mode 100644 pkg/gen/ghcmessages/customer_support_remark.go delete mode 100644 pkg/gen/ghcmessages/customer_support_remarks.go delete mode 100644 pkg/gen/ghcmessages/deny_s_i_t_extension.go delete mode 100644 pkg/gen/ghcmessages/department_indicator.go delete mode 100644 pkg/gen/ghcmessages/dept_indicator.go delete mode 100644 pkg/gen/ghcmessages/destination_type.go delete mode 100644 pkg/gen/ghcmessages/dimension_type.go delete mode 100644 pkg/gen/ghcmessages/document.go delete mode 100644 pkg/gen/ghcmessages/duty_location.go delete mode 100644 pkg/gen/ghcmessages/entitlements.go delete mode 100644 pkg/gen/ghcmessages/error.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report_inspection_type.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report_list.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report_location.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report_office_user.go delete mode 100644 pkg/gen/ghcmessages/evaluation_report_type.go delete mode 100644 pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go delete mode 100644 pkg/gen/ghcmessages/g_b_l_o_c.go delete mode 100644 pkg/gen/ghcmessages/g_b_l_o_cs.go delete mode 100644 pkg/gen/ghcmessages/g_s_r_appeal.go delete mode 100644 pkg/gen/ghcmessages/g_s_r_appeal_status_type.go delete mode 100644 pkg/gen/ghcmessages/g_s_r_appeals.go delete mode 100644 pkg/gen/ghcmessages/grade.go delete mode 100644 pkg/gen/ghcmessages/invalid_request_response_payload.go delete mode 100644 pkg/gen/ghcmessages/is_date_weekend_holiday_info.go delete mode 100644 pkg/gen/ghcmessages/l_o_a_type.go delete mode 100644 pkg/gen/ghcmessages/line_of_accounting.go delete mode 100644 pkg/gen/ghcmessages/list_prime_move.go delete mode 100644 pkg/gen/ghcmessages/list_prime_moves.go delete mode 100644 pkg/gen/ghcmessages/list_prime_moves_result.go delete mode 100644 pkg/gen/ghcmessages/location.go delete mode 100644 pkg/gen/ghcmessages/locations.go delete mode 100644 pkg/gen/ghcmessages/locked_office_user.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_agent.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_agents.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_dimension.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_single.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_status.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_service_items.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_shipment.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_shipment_status.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_shipment_type.go delete mode 100644 pkg/gen/ghcmessages/m_t_o_shipments.go delete mode 100644 pkg/gen/ghcmessages/mobile_home.go delete mode 100644 pkg/gen/ghcmessages/move.go delete mode 100644 pkg/gen/ghcmessages/move_audit_histories.go delete mode 100644 pkg/gen/ghcmessages/move_audit_history.go delete mode 100644 pkg/gen/ghcmessages/move_audit_history_item.go delete mode 100644 pkg/gen/ghcmessages/move_audit_history_items.go delete mode 100644 pkg/gen/ghcmessages/move_history.go delete mode 100644 pkg/gen/ghcmessages/move_history_result.go delete mode 100644 pkg/gen/ghcmessages/move_payload.go delete mode 100644 pkg/gen/ghcmessages/move_status.go delete mode 100644 pkg/gen/ghcmessages/move_task_order.go delete mode 100644 pkg/gen/ghcmessages/move_task_orders.go delete mode 100644 pkg/gen/ghcmessages/moving_expense.go delete mode 100644 pkg/gen/ghcmessages/moving_expenses.go delete mode 100644 pkg/gen/ghcmessages/office_user.go delete mode 100644 pkg/gen/ghcmessages/office_user_create.go delete mode 100644 pkg/gen/ghcmessages/office_user_role.go delete mode 100644 pkg/gen/ghcmessages/omittable_moving_expense_type.go delete mode 100644 pkg/gen/ghcmessages/omittable_p_p_m_document_status.go delete mode 100644 pkg/gen/ghcmessages/order.go delete mode 100644 pkg/gen/ghcmessages/order_body.go delete mode 100644 pkg/gen/ghcmessages/orders_type.go delete mode 100644 pkg/gen/ghcmessages/orders_type_detail.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_actual_weight.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_advance_status.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_closeout.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_destination_address.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_document_status.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_document_status_reason.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_documents.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_shipment.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_shipment_status.go delete mode 100644 pkg/gen/ghcmessages/p_p_m_status.go delete mode 100644 pkg/gen/ghcmessages/p_w_s_violation.go delete mode 100644 pkg/gen/ghcmessages/p_w_s_violations.go delete mode 100644 pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go delete mode 100644 pkg/gen/ghcmessages/payment_request.go delete mode 100644 pkg/gen/ghcmessages/payment_request_status.go delete mode 100644 pkg/gen/ghcmessages/payment_requests.go delete mode 100644 pkg/gen/ghcmessages/payment_service_item.go delete mode 100644 pkg/gen/ghcmessages/payment_service_item_param.go delete mode 100644 pkg/gen/ghcmessages/payment_service_item_params.go delete mode 100644 pkg/gen/ghcmessages/payment_service_item_status.go delete mode 100644 pkg/gen/ghcmessages/payment_service_items.go delete mode 100644 pkg/gen/ghcmessages/post_document_payload.go delete mode 100644 pkg/gen/ghcmessages/pro_gear_weight_ticket.go delete mode 100644 pkg/gen/ghcmessages/pro_gear_weight_tickets.go delete mode 100644 pkg/gen/ghcmessages/proof_of_service_doc.go delete mode 100644 pkg/gen/ghcmessages/proof_of_service_docs.go delete mode 100644 pkg/gen/ghcmessages/queue_move.go delete mode 100644 pkg/gen/ghcmessages/queue_moves.go delete mode 100644 pkg/gen/ghcmessages/queue_moves_result.go delete mode 100644 pkg/gen/ghcmessages/queue_payment_request.go delete mode 100644 pkg/gen/ghcmessages/queue_payment_request_status.go delete mode 100644 pkg/gen/ghcmessages/queue_payment_requests.go delete mode 100644 pkg/gen/ghcmessages/queue_payment_requests_result.go delete mode 100644 pkg/gen/ghcmessages/re_service_item.go delete mode 100644 pkg/gen/ghcmessages/re_service_items.go delete mode 100644 pkg/gen/ghcmessages/reject_shipment.go delete mode 100644 pkg/gen/ghcmessages/report_violation.go delete mode 100644 pkg/gen/ghcmessages/report_violations.go delete mode 100644 pkg/gen/ghcmessages/request_diversion.go delete mode 100644 pkg/gen/ghcmessages/reweigh.go delete mode 100644 pkg/gen/ghcmessages/reweigh_requester.go delete mode 100644 pkg/gen/ghcmessages/role.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_extension.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_extensions.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_location_type.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_service_item_grouping.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_service_item_groupings.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_status.go delete mode 100644 pkg/gen/ghcmessages/s_i_t_summary.go delete mode 100644 pkg/gen/ghcmessages/search_customer.go delete mode 100644 pkg/gen/ghcmessages/search_customers.go delete mode 100644 pkg/gen/ghcmessages/search_customers_result.go delete mode 100644 pkg/gen/ghcmessages/search_move.go delete mode 100644 pkg/gen/ghcmessages/search_moves.go delete mode 100644 pkg/gen/ghcmessages/search_moves_result.go delete mode 100644 pkg/gen/ghcmessages/service_item_param_name.go delete mode 100644 pkg/gen/ghcmessages/service_item_param_origin.go delete mode 100644 pkg/gen/ghcmessages/service_item_param_type.go delete mode 100644 pkg/gen/ghcmessages/service_item_sit_entry_date.go delete mode 100644 pkg/gen/ghcmessages/service_request_document.go delete mode 100644 pkg/gen/ghcmessages/service_request_documents.go delete mode 100644 pkg/gen/ghcmessages/shipment_address_update.go delete mode 100644 pkg/gen/ghcmessages/shipment_address_update_status.go delete mode 100644 pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go delete mode 100644 pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go delete mode 100644 pkg/gen/ghcmessages/signed_certification.go delete mode 100644 pkg/gen/ghcmessages/signed_certification_type.go delete mode 100644 pkg/gen/ghcmessages/storage_facility.go delete mode 100644 pkg/gen/ghcmessages/submitted_moving_expense_type.go delete mode 100644 pkg/gen/ghcmessages/tac_valid.go delete mode 100644 pkg/gen/ghcmessages/transportation_office.go delete mode 100644 pkg/gen/ghcmessages/transportation_office_assignment.go delete mode 100644 pkg/gen/ghcmessages/transportation_offices.go delete mode 100644 pkg/gen/ghcmessages/update_allowance_payload.go delete mode 100644 pkg/gen/ghcmessages/update_billable_weight_payload.go delete mode 100644 pkg/gen/ghcmessages/update_boat_shipment.go delete mode 100644 pkg/gen/ghcmessages/update_customer_payload.go delete mode 100644 pkg/gen/ghcmessages/update_customer_support_remark_payload.go delete mode 100644 pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go delete mode 100644 pkg/gen/ghcmessages/update_mobile_home_shipment.go delete mode 100644 pkg/gen/ghcmessages/update_moving_expense.go delete mode 100644 pkg/gen/ghcmessages/update_order_payload.go delete mode 100644 pkg/gen/ghcmessages/update_p_p_m_shipment.go delete mode 100644 pkg/gen/ghcmessages/update_payment_request_status_payload.go delete mode 100644 pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go delete mode 100644 pkg/gen/ghcmessages/update_shipment.go delete mode 100644 pkg/gen/ghcmessages/update_weight_ticket.go delete mode 100644 pkg/gen/ghcmessages/upload.go delete mode 100644 pkg/gen/ghcmessages/v_location.go delete mode 100644 pkg/gen/ghcmessages/v_locations.go delete mode 100644 pkg/gen/ghcmessages/validation_error.go delete mode 100644 pkg/gen/ghcmessages/weight_ticket.go delete mode 100644 pkg/gen/ghcmessages/weight_tickets.go delete mode 100644 pkg/gen/internalapi/configure_mymove.go delete mode 100644 pkg/gen/internalapi/doc.go delete mode 100644 pkg/gen/internalapi/embedded_spec.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate.go delete mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go delete mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go delete mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/mymove_api.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go delete mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue.go delete mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go delete mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go delete mode 100644 pkg/gen/internalapi/server.go delete mode 100644 pkg/gen/internalmessages/create_mobile_home_shipment.go delete mode 100644 pkg/gen/internalmessages/create_p_p_m_shipment.go delete mode 100644 pkg/gen/internalmessages/create_service_member_backup_contact_payload.go delete mode 100644 pkg/gen/internalmessages/create_service_member_payload.go delete mode 100644 pkg/gen/internalmessages/create_shipment.go delete mode 100644 pkg/gen/internalmessages/create_signed_certification_payload.go delete mode 100644 pkg/gen/internalmessages/create_update_orders.go delete mode 100644 pkg/gen/internalmessages/create_weight_ticket_documents_payload.go delete mode 100644 pkg/gen/internalmessages/dept_indicator.go delete mode 100644 pkg/gen/internalmessages/document.go delete mode 100644 pkg/gen/internalmessages/duty_location_payload.go delete mode 100644 pkg/gen/internalmessages/duty_locations_payload.go delete mode 100644 pkg/gen/internalmessages/entitlement.go delete mode 100644 pkg/gen/internalmessages/error.go delete mode 100644 pkg/gen/internalmessages/feature_flag_boolean.go delete mode 100644 pkg/gen/internalmessages/feature_flag_variant.go delete mode 100644 pkg/gen/internalmessages/index_entitlements.go delete mode 100644 pkg/gen/internalmessages/index_moves_payload.go delete mode 100644 pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go delete mode 100644 pkg/gen/internalmessages/internal_move.go delete mode 100644 pkg/gen/internalmessages/invalid_request_response_payload.go delete mode 100644 pkg/gen/internalmessages/is_date_weekend_holiday_info.go delete mode 100644 pkg/gen/internalmessages/logged_in_user_payload.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agent.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agent_type.go delete mode 100644 pkg/gen/internalmessages/m_t_o_agents.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipment.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipment_status.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipment_type.go delete mode 100644 pkg/gen/internalmessages/m_t_o_shipments.go delete mode 100644 pkg/gen/internalmessages/method_of_receipt.go delete mode 100644 pkg/gen/internalmessages/mobile_home.go delete mode 100644 pkg/gen/internalmessages/move_document_payload.go delete mode 100644 pkg/gen/internalmessages/move_document_status.go delete mode 100644 pkg/gen/internalmessages/move_document_type.go delete mode 100644 pkg/gen/internalmessages/move_documents.go delete mode 100644 pkg/gen/internalmessages/move_payload.go delete mode 100644 pkg/gen/internalmessages/move_queue_item.go delete mode 100644 pkg/gen/internalmessages/move_status.go delete mode 100644 pkg/gen/internalmessages/moves_list.go delete mode 100644 pkg/gen/internalmessages/moving_expense.go delete mode 100644 pkg/gen/internalmessages/moving_expense_type.go delete mode 100644 pkg/gen/internalmessages/nullable_signed_certification_type.go delete mode 100644 pkg/gen/internalmessages/office_user.go delete mode 100644 pkg/gen/internalmessages/okta_user_profile_data.go delete mode 100644 pkg/gen/internalmessages/omittable_moving_expense_type.go delete mode 100644 pkg/gen/internalmessages/omittable_p_p_m_document_status.go delete mode 100644 pkg/gen/internalmessages/order_pay_grade.go delete mode 100644 pkg/gen/internalmessages/orders.go delete mode 100644 pkg/gen/internalmessages/orders_status.go delete mode 100644 pkg/gen/internalmessages/orders_type.go delete mode 100644 pkg/gen/internalmessages/orders_type_detail.go delete mode 100644 pkg/gen/internalmessages/p_p_m_advance_status.go delete mode 100644 pkg/gen/internalmessages/p_p_m_destination_address.go delete mode 100644 pkg/gen/internalmessages/p_p_m_document_status_reason.go delete mode 100644 pkg/gen/internalmessages/p_p_m_estimate_range.go delete mode 100644 pkg/gen/internalmessages/p_p_m_shipment.go delete mode 100644 pkg/gen/internalmessages/p_p_m_shipment_status.go delete mode 100644 pkg/gen/internalmessages/patch_move_payload.go delete mode 100644 pkg/gen/internalmessages/patch_service_member_payload.go delete mode 100644 pkg/gen/internalmessages/post_document_payload.go delete mode 100644 pkg/gen/internalmessages/ppm_id.go delete mode 100644 pkg/gen/internalmessages/privilege.go delete mode 100644 pkg/gen/internalmessages/pro_gear_weight_ticket.go delete mode 100644 pkg/gen/internalmessages/rate_engine_postal_code_payload.go delete mode 100644 pkg/gen/internalmessages/reimbursement.go delete mode 100644 pkg/gen/internalmessages/reimbursement_status.go delete mode 100644 pkg/gen/internalmessages/role.go delete mode 100644 pkg/gen/internalmessages/s_i_t_location_type.go delete mode 100644 pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go delete mode 100644 pkg/gen/internalmessages/service_member_backup_contact_payload.go delete mode 100644 pkg/gen/internalmessages/service_member_payload.go delete mode 100644 pkg/gen/internalmessages/signed_certification.go delete mode 100644 pkg/gen/internalmessages/signed_certification_payload.go delete mode 100644 pkg/gen/internalmessages/signed_certification_type.go delete mode 100644 pkg/gen/internalmessages/signed_certification_type_create.go delete mode 100644 pkg/gen/internalmessages/signed_certifications.go delete mode 100644 pkg/gen/internalmessages/submit_move_for_approval_payload.go delete mode 100644 pkg/gen/internalmessages/submitted_moving_expense_type.go delete mode 100644 pkg/gen/internalmessages/transportation_office.go delete mode 100644 pkg/gen/internalmessages/transportation_office_assignment.go delete mode 100644 pkg/gen/internalmessages/transportation_offices.go delete mode 100644 pkg/gen/internalmessages/update_boat_shipment.go delete mode 100644 pkg/gen/internalmessages/update_mobile_home_shipment.go delete mode 100644 pkg/gen/internalmessages/update_moving_expense.go delete mode 100644 pkg/gen/internalmessages/update_okta_user_profile_data.go delete mode 100644 pkg/gen/internalmessages/update_p_p_m_shipment.go delete mode 100644 pkg/gen/internalmessages/update_pro_gear_weight_ticket.go delete mode 100644 pkg/gen/internalmessages/update_service_member_backup_contact_payload.go delete mode 100644 pkg/gen/internalmessages/update_shipment.go delete mode 100644 pkg/gen/internalmessages/update_weight_ticket.go delete mode 100644 pkg/gen/internalmessages/upload.go delete mode 100644 pkg/gen/internalmessages/v_location.go delete mode 100644 pkg/gen/internalmessages/v_locations.go delete mode 100644 pkg/gen/internalmessages/validation_error.go delete mode 100644 pkg/gen/internalmessages/weight_allotment.go delete mode 100644 pkg/gen/internalmessages/weight_ticket.go delete mode 100644 pkg/gen/internalmessages/weight_ticket_set_type.go delete mode 100644 pkg/gen/internalmessages/weight_tickets.go delete mode 100644 pkg/gen/primeapi/configure_mymove.go delete mode 100644 pkg/gen/primeapi/doc.go delete mode 100644 pkg/gen/primeapi/embedded_spec.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/mymove_api.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go delete mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go delete mode 100644 pkg/gen/primeapi/server.go delete mode 100644 pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go delete mode 100644 pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go delete mode 100644 pkg/gen/primeclient/move_task_order/download_move_order_parameters.go delete mode 100644 pkg/gen/primeclient/move_task_order/download_move_order_responses.go delete mode 100644 pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primeclient/move_task_order/list_moves_parameters.go delete mode 100644 pkg/gen/primeclient/move_task_order/list_moves_responses.go delete mode 100644 pkg/gen/primeclient/move_task_order/move_task_order_client.go delete mode 100644 pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go delete mode 100644 pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go delete mode 100644 pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go delete mode 100644 pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go delete mode 100644 pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go delete mode 100644 pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go delete mode 100644 pkg/gen/primeclient/mto_service_item/mto_service_item_client.go delete mode 100644 pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go delete mode 100644 pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/mto_shipment_client.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go delete mode 100644 pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go delete mode 100644 pkg/gen/primeclient/mymove_client.go delete mode 100644 pkg/gen/primeclient/payment_request/create_payment_request_parameters.go delete mode 100644 pkg/gen/primeclient/payment_request/create_payment_request_responses.go delete mode 100644 pkg/gen/primeclient/payment_request/create_upload_parameters.go delete mode 100644 pkg/gen/primeclient/payment_request/create_upload_responses.go delete mode 100644 pkg/gen/primeclient/payment_request/payment_request_client.go delete mode 100644 pkg/gen/primemessages/excess_weight_record.go delete mode 100644 pkg/gen/primemessages/list_move.go delete mode 100644 pkg/gen/primemessages/list_moves.go delete mode 100644 pkg/gen/primemessages/m_t_o_agent.go delete mode 100644 pkg/gen/primemessages/m_t_o_agent_type.go delete mode 100644 pkg/gen/primemessages/m_t_o_agents.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_basic.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_dimension.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_international_crating.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primemessages/m_t_o_service_item_status.go delete mode 100644 pkg/gen/primemessages/m_t_o_shipment.go delete mode 100644 pkg/gen/primemessages/m_t_o_shipment_type.go delete mode 100644 pkg/gen/primemessages/m_t_o_shipment_without_service_items.go delete mode 100644 pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go delete mode 100644 pkg/gen/primemessages/move_task_order.go delete mode 100644 pkg/gen/primemessages/order.go delete mode 100644 pkg/gen/primemessages/orders_type.go delete mode 100644 pkg/gen/primemessages/p_p_m_shipment.go delete mode 100644 pkg/gen/primemessages/p_p_m_shipment_status.go delete mode 100644 pkg/gen/primemessages/payment_request.go delete mode 100644 pkg/gen/primemessages/payment_request_status.go delete mode 100644 pkg/gen/primemessages/payment_requests.go delete mode 100644 pkg/gen/primemessages/payment_service_item.go delete mode 100644 pkg/gen/primemessages/payment_service_item_param.go delete mode 100644 pkg/gen/primemessages/payment_service_item_params.go delete mode 100644 pkg/gen/primemessages/payment_service_item_status.go delete mode 100644 pkg/gen/primemessages/payment_service_items.go delete mode 100644 pkg/gen/primemessages/proof_of_service_doc.go delete mode 100644 pkg/gen/primemessages/proof_of_service_docs.go delete mode 100644 pkg/gen/primemessages/re_service_code.go delete mode 100644 pkg/gen/primemessages/reweigh.go delete mode 100644 pkg/gen/primemessages/reweigh_requester.go delete mode 100644 pkg/gen/primemessages/s_i_t_extension.go delete mode 100644 pkg/gen/primemessages/s_i_t_extensions.go delete mode 100644 pkg/gen/primemessages/s_i_t_location_type.go delete mode 100644 pkg/gen/primemessages/service_item.go delete mode 100644 pkg/gen/primemessages/service_item_param_name.go delete mode 100644 pkg/gen/primemessages/service_item_param_origin.go delete mode 100644 pkg/gen/primemessages/service_item_param_type.go delete mode 100644 pkg/gen/primemessages/service_request_document.go delete mode 100644 pkg/gen/primemessages/service_request_documents.go delete mode 100644 pkg/gen/primemessages/shipment_address_update.go delete mode 100644 pkg/gen/primemessages/shipment_address_update_status.go delete mode 100644 pkg/gen/primemessages/storage_facility.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_service_item.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primemessages/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/primemessages/update_p_p_m_shipment.go delete mode 100644 pkg/gen/primemessages/update_reweigh.go delete mode 100644 pkg/gen/primemessages/update_shipment_destination_address.go delete mode 100644 pkg/gen/primemessages/upload_with_omissions.go delete mode 100644 pkg/gen/primemessages/validation_error.go delete mode 100644 pkg/gen/primev2api/configure_mymove.go delete mode 100644 pkg/gen/primev2api/doc.go delete mode 100644 pkg/gen/primev2api/embedded_spec.go delete mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go delete mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primev2api/primev2operations/mymove_api.go delete mode 100644 pkg/gen/primev2api/server.go delete mode 100644 pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primev2client/move_task_order/move_task_order_client.go delete mode 100644 pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev2client/mto_shipment/mto_shipment_client.go delete mode 100644 pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev2client/mymove_client.go delete mode 100644 pkg/gen/primev2messages/m_t_o_agent_type.go delete mode 100644 pkg/gen/primev2messages/m_t_o_agents.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_basic.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_dimension.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_international_crating.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primev2messages/m_t_o_service_item_status.go delete mode 100644 pkg/gen/primev2messages/m_t_o_shipment.go delete mode 100644 pkg/gen/primev2messages/m_t_o_shipment_type.go delete mode 100644 pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go delete mode 100644 pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go delete mode 100644 pkg/gen/primev2messages/move_task_order.go delete mode 100644 pkg/gen/primev2messages/order.go delete mode 100644 pkg/gen/primev2messages/orders_type.go delete mode 100644 pkg/gen/primev2messages/p_p_m_shipment.go delete mode 100644 pkg/gen/primev2messages/p_p_m_shipment_status.go delete mode 100644 pkg/gen/primev2messages/payment_request.go delete mode 100644 pkg/gen/primev2messages/payment_request_status.go delete mode 100644 pkg/gen/primev2messages/payment_requests.go delete mode 100644 pkg/gen/primev2messages/payment_service_item.go delete mode 100644 pkg/gen/primev2messages/payment_service_item_param.go delete mode 100644 pkg/gen/primev2messages/payment_service_item_params.go delete mode 100644 pkg/gen/primev2messages/payment_service_item_status.go delete mode 100644 pkg/gen/primev2messages/payment_service_items.go delete mode 100644 pkg/gen/primev2messages/proof_of_service_doc.go delete mode 100644 pkg/gen/primev2messages/proof_of_service_docs.go delete mode 100644 pkg/gen/primev2messages/re_service_code.go delete mode 100644 pkg/gen/primev2messages/reweigh.go delete mode 100644 pkg/gen/primev2messages/reweigh_requester.go delete mode 100644 pkg/gen/primev2messages/s_i_t_extension.go delete mode 100644 pkg/gen/primev2messages/s_i_t_extensions.go delete mode 100644 pkg/gen/primev2messages/s_i_t_location_type.go delete mode 100644 pkg/gen/primev2messages/service_item_param_name.go delete mode 100644 pkg/gen/primev2messages/service_item_param_origin.go delete mode 100644 pkg/gen/primev2messages/service_item_param_type.go delete mode 100644 pkg/gen/primev2messages/service_request_document.go delete mode 100644 pkg/gen/primev2messages/service_request_documents.go delete mode 100644 pkg/gen/primev2messages/shipment_address_update.go delete mode 100644 pkg/gen/primev2messages/shipment_address_update_status.go delete mode 100644 pkg/gen/primev2messages/storage_facility.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primev2messages/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/primev2messages/update_p_p_m_shipment.go delete mode 100644 pkg/gen/primev2messages/update_reweigh.go delete mode 100644 pkg/gen/primev2messages/update_shipment_destination_address.go delete mode 100644 pkg/gen/primev2messages/upload_with_omissions.go delete mode 100644 pkg/gen/primev2messages/validation_error.go delete mode 100644 pkg/gen/primev3api/configure_mymove.go delete mode 100644 pkg/gen/primev3api/doc.go delete mode 100644 pkg/gen/primev3api/embedded_spec.go delete mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go delete mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go delete mode 100644 pkg/gen/primev3api/primev3operations/mymove_api.go delete mode 100644 pkg/gen/primev3api/server.go delete mode 100644 pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/primev3client/move_task_order/move_task_order_client.go delete mode 100644 pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev3client/mto_shipment/mto_shipment_client.go delete mode 100644 pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go delete mode 100644 pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go delete mode 100644 pkg/gen/primev3client/mymove_client.go delete mode 100644 pkg/gen/primev3messages/error.go delete mode 100644 pkg/gen/primev3messages/m_t_o_agent.go delete mode 100644 pkg/gen/primev3messages/m_t_o_agent_type.go delete mode 100644 pkg/gen/primev3messages/m_t_o_agents.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_basic.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_dimension.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_international_crating.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primev3messages/m_t_o_service_item_status.go delete mode 100644 pkg/gen/primev3messages/m_t_o_shipment.go delete mode 100644 pkg/gen/primev3messages/m_t_o_shipment_type.go delete mode 100644 pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go delete mode 100644 pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go delete mode 100644 pkg/gen/primev3messages/mobile_home.go delete mode 100644 pkg/gen/primev3messages/move_task_order.go delete mode 100644 pkg/gen/primev3messages/order.go delete mode 100644 pkg/gen/primev3messages/orders_type.go delete mode 100644 pkg/gen/primev3messages/p_p_m_destination_address.go delete mode 100644 pkg/gen/primev3messages/p_p_m_shipment.go delete mode 100644 pkg/gen/primev3messages/p_p_m_shipment_status.go delete mode 100644 pkg/gen/primev3messages/payment_request.go delete mode 100644 pkg/gen/primev3messages/payment_request_status.go delete mode 100644 pkg/gen/primev3messages/payment_requests.go delete mode 100644 pkg/gen/primev3messages/payment_service_item.go delete mode 100644 pkg/gen/primev3messages/payment_service_item_param.go delete mode 100644 pkg/gen/primev3messages/payment_service_item_params.go delete mode 100644 pkg/gen/primev3messages/payment_service_item_status.go delete mode 100644 pkg/gen/primev3messages/payment_service_items.go delete mode 100644 pkg/gen/primev3messages/port.go delete mode 100644 pkg/gen/primev3messages/proof_of_service_doc.go delete mode 100644 pkg/gen/primev3messages/proof_of_service_docs.go delete mode 100644 pkg/gen/primev3messages/rate_area.go delete mode 100644 pkg/gen/primev3messages/re_service_code.go delete mode 100644 pkg/gen/primev3messages/reweigh.go delete mode 100644 pkg/gen/primev3messages/reweigh_requester.go delete mode 100644 pkg/gen/primev3messages/s_i_t_extension.go delete mode 100644 pkg/gen/primev3messages/s_i_t_extensions.go delete mode 100644 pkg/gen/primev3messages/s_i_t_location_type.go delete mode 100644 pkg/gen/primev3messages/service_item_param_name.go delete mode 100644 pkg/gen/primev3messages/service_item_param_origin.go delete mode 100644 pkg/gen/primev3messages/service_item_param_type.go delete mode 100644 pkg/gen/primev3messages/service_request_document.go delete mode 100644 pkg/gen/primev3messages/service_request_documents.go delete mode 100644 pkg/gen/primev3messages/shipment_address_update.go delete mode 100644 pkg/gen/primev3messages/shipment_address_update_status.go delete mode 100644 pkg/gen/primev3messages/storage_facility.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_shipment.go delete mode 100644 pkg/gen/primev3messages/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/primev3messages/update_p_p_m_shipment.go delete mode 100644 pkg/gen/primev3messages/update_reweigh.go delete mode 100644 pkg/gen/primev3messages/update_shipment_destination_address.go delete mode 100644 pkg/gen/primev3messages/upload_with_omissions.go delete mode 100644 pkg/gen/primev3messages/validation_error.go delete mode 100644 pkg/gen/supportapi/configure_mymove.go delete mode 100644 pkg/gen/supportapi/doc.go delete mode 100644 pkg/gen/supportapi/embedded_spec.go delete mode 100644 pkg/gen/supportapi/server.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/mymove_api.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go delete mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go delete mode 100644 pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go delete mode 100644 pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go delete mode 100644 pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go delete mode 100644 pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go delete mode 100644 pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go delete mode 100644 pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go delete mode 100644 pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go delete mode 100644 pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go delete mode 100644 pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go delete mode 100644 pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go delete mode 100644 pkg/gen/supportclient/move_task_order/move_task_order_client.go delete mode 100644 pkg/gen/supportclient/mto_service_item/mto_service_item_client.go delete mode 100644 pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go delete mode 100644 pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go delete mode 100644 pkg/gen/supportclient/mto_shipment/mto_shipment_client.go delete mode 100644 pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go delete mode 100644 pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go delete mode 100644 pkg/gen/supportclient/mymove_client.go delete mode 100644 pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go delete mode 100644 pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go delete mode 100644 pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go delete mode 100644 pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go delete mode 100644 pkg/gen/supportclient/payment_request/payment_request_client.go delete mode 100644 pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go delete mode 100644 pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go delete mode 100644 pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go delete mode 100644 pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go delete mode 100644 pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go delete mode 100644 pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go delete mode 100644 pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go delete mode 100644 pkg/gen/supportclient/webhook/create_webhook_notification_responses.go delete mode 100644 pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go delete mode 100644 pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go delete mode 100644 pkg/gen/supportclient/webhook/webhook_client.go delete mode 100644 pkg/gen/supportmessages/orders_type_detail.go delete mode 100644 pkg/gen/supportmessages/payment_request.go delete mode 100644 pkg/gen/supportmessages/payment_request_e_d_i.go delete mode 100644 pkg/gen/supportmessages/payment_request_status.go delete mode 100644 pkg/gen/supportmessages/payment_requests.go delete mode 100644 pkg/gen/supportmessages/process_reviewed_payment_requests.go delete mode 100644 pkg/gen/supportmessages/proof_of_service_package.go delete mode 100644 pkg/gen/supportmessages/rank.go delete mode 100644 pkg/gen/supportmessages/re_service_code.go delete mode 100644 pkg/gen/supportmessages/update_m_t_o_service_item_status.go delete mode 100644 pkg/gen/supportmessages/update_m_t_o_shipment_status.go delete mode 100644 pkg/gen/supportmessages/update_payment_request_status.go delete mode 100644 pkg/gen/supportmessages/upload_with_omissions.go delete mode 100644 pkg/gen/supportmessages/validation_error.go delete mode 100644 pkg/gen/supportmessages/webhook_notification.go delete mode 100644 pkg/gen/supportmessages/webhook_notification_status.go diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go deleted file mode 100644 index 126c45c2752..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateAdminUserHandlerFunc turns a function with the right signature into a create admin user handler -type CreateAdminUserHandlerFunc func(CreateAdminUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateAdminUserHandlerFunc) Handle(params CreateAdminUserParams) middleware.Responder { - return fn(params) -} - -// CreateAdminUserHandler interface for that can handle valid create admin user params -type CreateAdminUserHandler interface { - Handle(CreateAdminUserParams) middleware.Responder -} - -// NewCreateAdminUser creates a new http.Handler for the create admin user operation -func NewCreateAdminUser(ctx *middleware.Context, handler CreateAdminUserHandler) *CreateAdminUser { - return &CreateAdminUser{Context: ctx, Handler: handler} -} - -/* - CreateAdminUser swagger:route POST /admin-users Admin users createAdminUser - -# Create an Admin User - -This endpoint creates an Admin User record and returns the created record in the -`201` response. Do not use this endpoint directly as it is meant to be used with -the Admin UI exclusively. -*/ -type CreateAdminUser struct { - Context *middleware.Context - Handler CreateAdminUserHandler -} - -func (o *CreateAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateAdminUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go deleted file mode 100644 index e7c7e9af6ab..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewCreateAdminUserParams creates a new CreateAdminUserParams object -// -// There are no default values defined in the spec. -func NewCreateAdminUserParams() CreateAdminUserParams { - - return CreateAdminUserParams{} -} - -// CreateAdminUserParams contains all the bound params for the create admin user operation -// typically these are obtained from a http.Request -// -// swagger:parameters createAdminUser -type CreateAdminUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Admin User information - In: body - */ - AdminUser *adminmessages.AdminUserCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateAdminUserParams() beforehand. -func (o *CreateAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.AdminUserCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("adminUser", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.AdminUser = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go deleted file mode 100644 index 1ddaeb40fca..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// CreateAdminUserCreatedCode is the HTTP code returned for type CreateAdminUserCreated -const CreateAdminUserCreatedCode int = 201 - -/* -CreateAdminUserCreated Successfully created Admin User - -swagger:response createAdminUserCreated -*/ -type CreateAdminUserCreated struct { - - /* - In: Body - */ - Payload *adminmessages.AdminUser `json:"body,omitempty"` -} - -// NewCreateAdminUserCreated creates CreateAdminUserCreated with default headers values -func NewCreateAdminUserCreated() *CreateAdminUserCreated { - - return &CreateAdminUserCreated{} -} - -// WithPayload adds the payload to the create admin user created response -func (o *CreateAdminUserCreated) WithPayload(payload *adminmessages.AdminUser) *CreateAdminUserCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create admin user created response -func (o *CreateAdminUserCreated) SetPayload(payload *adminmessages.AdminUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateAdminUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateAdminUserBadRequestCode is the HTTP code returned for type CreateAdminUserBadRequest -const CreateAdminUserBadRequestCode int = 400 - -/* -CreateAdminUserBadRequest Invalid Request - -swagger:response createAdminUserBadRequest -*/ -type CreateAdminUserBadRequest struct { -} - -// NewCreateAdminUserBadRequest creates CreateAdminUserBadRequest with default headers values -func NewCreateAdminUserBadRequest() *CreateAdminUserBadRequest { - - return &CreateAdminUserBadRequest{} -} - -// WriteResponse to the client -func (o *CreateAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateAdminUserUnauthorizedCode is the HTTP code returned for type CreateAdminUserUnauthorized -const CreateAdminUserUnauthorizedCode int = 401 - -/* -CreateAdminUserUnauthorized Must be authenticated to use this end point - -swagger:response createAdminUserUnauthorized -*/ -type CreateAdminUserUnauthorized struct { -} - -// NewCreateAdminUserUnauthorized creates CreateAdminUserUnauthorized with default headers values -func NewCreateAdminUserUnauthorized() *CreateAdminUserUnauthorized { - - return &CreateAdminUserUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateAdminUserForbiddenCode is the HTTP code returned for type CreateAdminUserForbidden -const CreateAdminUserForbiddenCode int = 403 - -/* -CreateAdminUserForbidden Not authorized to create an Admin User - -swagger:response createAdminUserForbidden -*/ -type CreateAdminUserForbidden struct { -} - -// NewCreateAdminUserForbidden creates CreateAdminUserForbidden with default headers values -func NewCreateAdminUserForbidden() *CreateAdminUserForbidden { - - return &CreateAdminUserForbidden{} -} - -// WriteResponse to the client -func (o *CreateAdminUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateAdminUserInternalServerErrorCode is the HTTP code returned for type CreateAdminUserInternalServerError -const CreateAdminUserInternalServerErrorCode int = 500 - -/* -CreateAdminUserInternalServerError Server error - -swagger:response createAdminUserInternalServerError -*/ -type CreateAdminUserInternalServerError struct { -} - -// NewCreateAdminUserInternalServerError creates CreateAdminUserInternalServerError with default headers values -func NewCreateAdminUserInternalServerError() *CreateAdminUserInternalServerError { - - return &CreateAdminUserInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go deleted file mode 100644 index 18ce2599074..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateAdminUserURL generates an URL for the create admin user operation -type CreateAdminUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAdminUserURL) WithBasePath(bp string) *CreateAdminUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateAdminUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateAdminUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/admin-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateAdminUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateAdminUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateAdminUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateAdminUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateAdminUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go deleted file mode 100644 index 10a6d0c45de..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetAdminUserHandlerFunc turns a function with the right signature into a get admin user handler -type GetAdminUserHandlerFunc func(GetAdminUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetAdminUserHandlerFunc) Handle(params GetAdminUserParams) middleware.Responder { - return fn(params) -} - -// GetAdminUserHandler interface for that can handle valid get admin user params -type GetAdminUserHandler interface { - Handle(GetAdminUserParams) middleware.Responder -} - -// NewGetAdminUser creates a new http.Handler for the get admin user operation -func NewGetAdminUser(ctx *middleware.Context, handler GetAdminUserHandler) *GetAdminUser { - return &GetAdminUser{Context: ctx, Handler: handler} -} - -/* - GetAdminUser swagger:route GET /admin-users/{adminUserId} Admin users getAdminUser - -# Fetch a specific Admin User - -This endpoint returns a single Admin User by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type GetAdminUser struct { - Context *middleware.Context - Handler GetAdminUserHandler -} - -func (o *GetAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetAdminUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go deleted file mode 100644 index 3c91dacf20f..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetAdminUserParams creates a new GetAdminUserParams object -// -// There are no default values defined in the spec. -func NewGetAdminUserParams() GetAdminUserParams { - - return GetAdminUserParams{} -} - -// GetAdminUserParams contains all the bound params for the get admin user operation -// typically these are obtained from a http.Request -// -// swagger:parameters getAdminUser -type GetAdminUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - AdminUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetAdminUserParams() beforehand. -func (o *GetAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rAdminUserID, rhkAdminUserID, _ := route.Params.GetOK("adminUserId") - if err := o.bindAdminUserID(rAdminUserID, rhkAdminUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAdminUserID binds and validates parameter AdminUserID from path. -func (o *GetAdminUserParams) bindAdminUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("adminUserId", "path", "strfmt.UUID", raw) - } - o.AdminUserID = *(value.(*strfmt.UUID)) - - if err := o.validateAdminUserID(formats); err != nil { - return err - } - - return nil -} - -// validateAdminUserID carries on validations for parameter AdminUserID -func (o *GetAdminUserParams) validateAdminUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("adminUserId", "path", "uuid", o.AdminUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go deleted file mode 100644 index dd9c9572e00..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetAdminUserOKCode is the HTTP code returned for type GetAdminUserOK -const GetAdminUserOKCode int = 200 - -/* -GetAdminUserOK success - -swagger:response getAdminUserOK -*/ -type GetAdminUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.AdminUser `json:"body,omitempty"` -} - -// NewGetAdminUserOK creates GetAdminUserOK with default headers values -func NewGetAdminUserOK() *GetAdminUserOK { - - return &GetAdminUserOK{} -} - -// WithPayload adds the payload to the get admin user o k response -func (o *GetAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *GetAdminUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get admin user o k response -func (o *GetAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAdminUserBadRequestCode is the HTTP code returned for type GetAdminUserBadRequest -const GetAdminUserBadRequestCode int = 400 - -/* -GetAdminUserBadRequest invalid request - -swagger:response getAdminUserBadRequest -*/ -type GetAdminUserBadRequest struct { -} - -// NewGetAdminUserBadRequest creates GetAdminUserBadRequest with default headers values -func NewGetAdminUserBadRequest() *GetAdminUserBadRequest { - - return &GetAdminUserBadRequest{} -} - -// WriteResponse to the client -func (o *GetAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetAdminUserUnauthorizedCode is the HTTP code returned for type GetAdminUserUnauthorized -const GetAdminUserUnauthorizedCode int = 401 - -/* -GetAdminUserUnauthorized request requires user authentication - -swagger:response getAdminUserUnauthorized -*/ -type GetAdminUserUnauthorized struct { -} - -// NewGetAdminUserUnauthorized creates GetAdminUserUnauthorized with default headers values -func NewGetAdminUserUnauthorized() *GetAdminUserUnauthorized { - - return &GetAdminUserUnauthorized{} -} - -// WriteResponse to the client -func (o *GetAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetAdminUserNotFoundCode is the HTTP code returned for type GetAdminUserNotFound -const GetAdminUserNotFoundCode int = 404 - -/* -GetAdminUserNotFound Admin User not found - -swagger:response getAdminUserNotFound -*/ -type GetAdminUserNotFound struct { -} - -// NewGetAdminUserNotFound creates GetAdminUserNotFound with default headers values -func NewGetAdminUserNotFound() *GetAdminUserNotFound { - - return &GetAdminUserNotFound{} -} - -// WriteResponse to the client -func (o *GetAdminUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetAdminUserInternalServerErrorCode is the HTTP code returned for type GetAdminUserInternalServerError -const GetAdminUserInternalServerErrorCode int = 500 - -/* -GetAdminUserInternalServerError server error - -swagger:response getAdminUserInternalServerError -*/ -type GetAdminUserInternalServerError struct { -} - -// NewGetAdminUserInternalServerError creates GetAdminUserInternalServerError with default headers values -func NewGetAdminUserInternalServerError() *GetAdminUserInternalServerError { - - return &GetAdminUserInternalServerError{} -} - -// WriteResponse to the client -func (o *GetAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go deleted file mode 100644 index 01e45020d73..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetAdminUserURL generates an URL for the get admin user operation -type GetAdminUserURL struct { - AdminUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAdminUserURL) WithBasePath(bp string) *GetAdminUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAdminUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetAdminUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/admin-users/{adminUserId}" - - adminUserID := o.AdminUserID.String() - if adminUserID != "" { - _path = strings.Replace(_path, "{adminUserId}", adminUserID, -1) - } else { - return nil, errors.New("adminUserId is required on GetAdminUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetAdminUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetAdminUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetAdminUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetAdminUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetAdminUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go deleted file mode 100644 index 8b9aad66d60..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexAdminUsersHandlerFunc turns a function with the right signature into a index admin users handler -type IndexAdminUsersHandlerFunc func(IndexAdminUsersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexAdminUsersHandlerFunc) Handle(params IndexAdminUsersParams) middleware.Responder { - return fn(params) -} - -// IndexAdminUsersHandler interface for that can handle valid index admin users params -type IndexAdminUsersHandler interface { - Handle(IndexAdminUsersParams) middleware.Responder -} - -// NewIndexAdminUsers creates a new http.Handler for the index admin users operation -func NewIndexAdminUsers(ctx *middleware.Context, handler IndexAdminUsersHandler) *IndexAdminUsers { - return &IndexAdminUsers{Context: ctx, Handler: handler} -} - -/* - IndexAdminUsers swagger:route GET /admin-users Admin users indexAdminUsers - -# List Admin Users - -This endpoint returns a list of Admin Users. Do not use this endpoint directly -as it is meant to be used with the Admin UI exclusively. -*/ -type IndexAdminUsers struct { - Context *middleware.Context - Handler IndexAdminUsersHandler -} - -func (o *IndexAdminUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexAdminUsersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go deleted file mode 100644 index be0bcb192b1..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexAdminUsersParams creates a new IndexAdminUsersParams object -// -// There are no default values defined in the spec. -func NewIndexAdminUsersParams() IndexAdminUsersParams { - - return IndexAdminUsersParams{} -} - -// IndexAdminUsersParams contains all the bound params for the index admin users operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexAdminUsers -type IndexAdminUsersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter []string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexAdminUsersParams() beforehand. -func (o *IndexAdminUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates array parameter Filter from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *IndexAdminUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvFilter string - if len(rawData) > 0 { - qvFilter = rawData[len(rawData)-1] - } - - // CollectionFormat: - filterIC := swag.SplitByFormat(qvFilter, "") - if len(filterIC) == 0 { - return nil - } - - var filterIR []string - for _, filterIV := range filterIC { - filterI := filterIV - - filterIR = append(filterIR, filterI) - } - - o.Filter = filterIR - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexAdminUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexAdminUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexAdminUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexAdminUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go deleted file mode 100644 index c158b9dddbd..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexAdminUsersOKCode is the HTTP code returned for type IndexAdminUsersOK -const IndexAdminUsersOKCode int = 200 - -/* -IndexAdminUsersOK success - -swagger:response indexAdminUsersOK -*/ -type IndexAdminUsersOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.AdminUsers `json:"body,omitempty"` -} - -// NewIndexAdminUsersOK creates IndexAdminUsersOK with default headers values -func NewIndexAdminUsersOK() *IndexAdminUsersOK { - - return &IndexAdminUsersOK{} -} - -// WithContentRange adds the contentRange to the index admin users o k response -func (o *IndexAdminUsersOK) WithContentRange(contentRange string) *IndexAdminUsersOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index admin users o k response -func (o *IndexAdminUsersOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index admin users o k response -func (o *IndexAdminUsersOK) WithPayload(payload adminmessages.AdminUsers) *IndexAdminUsersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index admin users o k response -func (o *IndexAdminUsersOK) SetPayload(payload adminmessages.AdminUsers) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexAdminUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.AdminUsers{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexAdminUsersBadRequestCode is the HTTP code returned for type IndexAdminUsersBadRequest -const IndexAdminUsersBadRequestCode int = 400 - -/* -IndexAdminUsersBadRequest invalid request - -swagger:response indexAdminUsersBadRequest -*/ -type IndexAdminUsersBadRequest struct { -} - -// NewIndexAdminUsersBadRequest creates IndexAdminUsersBadRequest with default headers values -func NewIndexAdminUsersBadRequest() *IndexAdminUsersBadRequest { - - return &IndexAdminUsersBadRequest{} -} - -// WriteResponse to the client -func (o *IndexAdminUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexAdminUsersUnauthorizedCode is the HTTP code returned for type IndexAdminUsersUnauthorized -const IndexAdminUsersUnauthorizedCode int = 401 - -/* -IndexAdminUsersUnauthorized request requires user authentication - -swagger:response indexAdminUsersUnauthorized -*/ -type IndexAdminUsersUnauthorized struct { -} - -// NewIndexAdminUsersUnauthorized creates IndexAdminUsersUnauthorized with default headers values -func NewIndexAdminUsersUnauthorized() *IndexAdminUsersUnauthorized { - - return &IndexAdminUsersUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexAdminUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexAdminUsersNotFoundCode is the HTTP code returned for type IndexAdminUsersNotFound -const IndexAdminUsersNotFoundCode int = 404 - -/* -IndexAdminUsersNotFound Admin Users not found - -swagger:response indexAdminUsersNotFound -*/ -type IndexAdminUsersNotFound struct { -} - -// NewIndexAdminUsersNotFound creates IndexAdminUsersNotFound with default headers values -func NewIndexAdminUsersNotFound() *IndexAdminUsersNotFound { - - return &IndexAdminUsersNotFound{} -} - -// WriteResponse to the client -func (o *IndexAdminUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexAdminUsersInternalServerErrorCode is the HTTP code returned for type IndexAdminUsersInternalServerError -const IndexAdminUsersInternalServerErrorCode int = 500 - -/* -IndexAdminUsersInternalServerError server error - -swagger:response indexAdminUsersInternalServerError -*/ -type IndexAdminUsersInternalServerError struct { -} - -// NewIndexAdminUsersInternalServerError creates IndexAdminUsersInternalServerError with default headers values -func NewIndexAdminUsersInternalServerError() *IndexAdminUsersInternalServerError { - - return &IndexAdminUsersInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexAdminUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go deleted file mode 100644 index dc1023af8c9..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexAdminUsersURL generates an URL for the index admin users operation -type IndexAdminUsersURL struct { - Filter []string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexAdminUsersURL) WithBasePath(bp string) *IndexAdminUsersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexAdminUsersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexAdminUsersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/admin-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterIR []string - for _, filterI := range o.Filter { - filterIS := filterI - if filterIS != "" { - filterIR = append(filterIR, filterIS) - } - } - - filter := swag.JoinByFormat(filterIR, "") - - if len(filter) > 0 { - qsv := filter[0] - if qsv != "" { - qs.Set("filter", qsv) - } - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexAdminUsersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexAdminUsersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexAdminUsersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexAdminUsersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexAdminUsersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexAdminUsersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go deleted file mode 100644 index 67a252b84f2..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateAdminUserHandlerFunc turns a function with the right signature into a update admin user handler -type UpdateAdminUserHandlerFunc func(UpdateAdminUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateAdminUserHandlerFunc) Handle(params UpdateAdminUserParams) middleware.Responder { - return fn(params) -} - -// UpdateAdminUserHandler interface for that can handle valid update admin user params -type UpdateAdminUserHandler interface { - Handle(UpdateAdminUserParams) middleware.Responder -} - -// NewUpdateAdminUser creates a new http.Handler for the update admin user operation -func NewUpdateAdminUser(ctx *middleware.Context, handler UpdateAdminUserHandler) *UpdateAdminUser { - return &UpdateAdminUser{Context: ctx, Handler: handler} -} - -/* - UpdateAdminUser swagger:route PATCH /admin-users/{adminUserId} Admin users updateAdminUser - -# Updates an Admin User - -This endpoint updates a single Admin User by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type UpdateAdminUser struct { - Context *middleware.Context - Handler UpdateAdminUserHandler -} - -func (o *UpdateAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateAdminUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go deleted file mode 100644 index a1f35214c7d..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateAdminUserParams creates a new UpdateAdminUserParams object -// -// There are no default values defined in the spec. -func NewUpdateAdminUserParams() UpdateAdminUserParams { - - return UpdateAdminUserParams{} -} - -// UpdateAdminUserParams contains all the bound params for the update admin user operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateAdminUser -type UpdateAdminUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Admin User information - Required: true - In: body - */ - AdminUser *adminmessages.AdminUserUpdate - /* - Required: true - In: path - */ - AdminUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateAdminUserParams() beforehand. -func (o *UpdateAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.AdminUserUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("adminUser", "body", "")) - } else { - res = append(res, errors.NewParseError("adminUser", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.AdminUser = &body - } - } - } else { - res = append(res, errors.Required("adminUser", "body", "")) - } - - rAdminUserID, rhkAdminUserID, _ := route.Params.GetOK("adminUserId") - if err := o.bindAdminUserID(rAdminUserID, rhkAdminUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAdminUserID binds and validates parameter AdminUserID from path. -func (o *UpdateAdminUserParams) bindAdminUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("adminUserId", "path", "strfmt.UUID", raw) - } - o.AdminUserID = *(value.(*strfmt.UUID)) - - if err := o.validateAdminUserID(formats); err != nil { - return err - } - - return nil -} - -// validateAdminUserID carries on validations for parameter AdminUserID -func (o *UpdateAdminUserParams) validateAdminUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("adminUserId", "path", "uuid", o.AdminUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go deleted file mode 100644 index 0ffb8bbd11d..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateAdminUserOKCode is the HTTP code returned for type UpdateAdminUserOK -const UpdateAdminUserOKCode int = 200 - -/* -UpdateAdminUserOK Successfully updated Admin User - -swagger:response updateAdminUserOK -*/ -type UpdateAdminUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.AdminUser `json:"body,omitempty"` -} - -// NewUpdateAdminUserOK creates UpdateAdminUserOK with default headers values -func NewUpdateAdminUserOK() *UpdateAdminUserOK { - - return &UpdateAdminUserOK{} -} - -// WithPayload adds the payload to the update admin user o k response -func (o *UpdateAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *UpdateAdminUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update admin user o k response -func (o *UpdateAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAdminUserBadRequestCode is the HTTP code returned for type UpdateAdminUserBadRequest -const UpdateAdminUserBadRequestCode int = 400 - -/* -UpdateAdminUserBadRequest Invalid Request - -swagger:response updateAdminUserBadRequest -*/ -type UpdateAdminUserBadRequest struct { -} - -// NewUpdateAdminUserBadRequest creates UpdateAdminUserBadRequest with default headers values -func NewUpdateAdminUserBadRequest() *UpdateAdminUserBadRequest { - - return &UpdateAdminUserBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateAdminUserUnauthorizedCode is the HTTP code returned for type UpdateAdminUserUnauthorized -const UpdateAdminUserUnauthorizedCode int = 401 - -/* -UpdateAdminUserUnauthorized Must be authenticated to use this end point - -swagger:response updateAdminUserUnauthorized -*/ -type UpdateAdminUserUnauthorized struct { -} - -// NewUpdateAdminUserUnauthorized creates UpdateAdminUserUnauthorized with default headers values -func NewUpdateAdminUserUnauthorized() *UpdateAdminUserUnauthorized { - - return &UpdateAdminUserUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateAdminUserForbiddenCode is the HTTP code returned for type UpdateAdminUserForbidden -const UpdateAdminUserForbiddenCode int = 403 - -/* -UpdateAdminUserForbidden Not authorized to update an Admin User - -swagger:response updateAdminUserForbidden -*/ -type UpdateAdminUserForbidden struct { -} - -// NewUpdateAdminUserForbidden creates UpdateAdminUserForbidden with default headers values -func NewUpdateAdminUserForbidden() *UpdateAdminUserForbidden { - - return &UpdateAdminUserForbidden{} -} - -// WriteResponse to the client -func (o *UpdateAdminUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateAdminUserInternalServerErrorCode is the HTTP code returned for type UpdateAdminUserInternalServerError -const UpdateAdminUserInternalServerErrorCode int = 500 - -/* -UpdateAdminUserInternalServerError Server error - -swagger:response updateAdminUserInternalServerError -*/ -type UpdateAdminUserInternalServerError struct { -} - -// NewUpdateAdminUserInternalServerError creates UpdateAdminUserInternalServerError with default headers values -func NewUpdateAdminUserInternalServerError() *UpdateAdminUserInternalServerError { - - return &UpdateAdminUserInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go deleted file mode 100644 index ad34ad03cd5..00000000000 --- a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package admin_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateAdminUserURL generates an URL for the update admin user operation -type UpdateAdminUserURL struct { - AdminUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAdminUserURL) WithBasePath(bp string) *UpdateAdminUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAdminUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateAdminUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/admin-users/{adminUserId}" - - adminUserID := o.AdminUserID.String() - if adminUserID != "" { - _path = strings.Replace(_path, "{adminUserId}", adminUserID, -1) - } else { - return nil, errors.New("adminUserId is required on UpdateAdminUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateAdminUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateAdminUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateAdminUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateAdminUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateAdminUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go deleted file mode 100644 index ae7a0a37508..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateClientCertificateHandlerFunc turns a function with the right signature into a create client certificate handler -type CreateClientCertificateHandlerFunc func(CreateClientCertificateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateClientCertificateHandlerFunc) Handle(params CreateClientCertificateParams) middleware.Responder { - return fn(params) -} - -// CreateClientCertificateHandler interface for that can handle valid create client certificate params -type CreateClientCertificateHandler interface { - Handle(CreateClientCertificateParams) middleware.Responder -} - -// NewCreateClientCertificate creates a new http.Handler for the create client certificate operation -func NewCreateClientCertificate(ctx *middleware.Context, handler CreateClientCertificateHandler) *CreateClientCertificate { - return &CreateClientCertificate{Context: ctx, Handler: handler} -} - -/* - CreateClientCertificate swagger:route POST /client-certificates Client certificates createClientCertificate - -create a client cert - -This endpoint creates a Client Certificate record and returns the -created record in the `201` response. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type CreateClientCertificate struct { - Context *middleware.Context - Handler CreateClientCertificateHandler -} - -func (o *CreateClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateClientCertificateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go deleted file mode 100644 index 460aad56134..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewCreateClientCertificateParams creates a new CreateClientCertificateParams object -// -// There are no default values defined in the spec. -func NewCreateClientCertificateParams() CreateClientCertificateParams { - - return CreateClientCertificateParams{} -} - -// CreateClientCertificateParams contains all the bound params for the create client certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters createClientCertificate -type CreateClientCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*client cert information - In: body - */ - ClientCertificate *adminmessages.ClientCertificateCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateClientCertificateParams() beforehand. -func (o *CreateClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.ClientCertificateCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("clientCertificate", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ClientCertificate = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go deleted file mode 100644 index 9aa4feddb1b..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// CreateClientCertificateCreatedCode is the HTTP code returned for type CreateClientCertificateCreated -const CreateClientCertificateCreatedCode int = 201 - -/* -CreateClientCertificateCreated Successfully created client certificate - -swagger:response createClientCertificateCreated -*/ -type CreateClientCertificateCreated struct { - - /* - In: Body - */ - Payload *adminmessages.ClientCertificate `json:"body,omitempty"` -} - -// NewCreateClientCertificateCreated creates CreateClientCertificateCreated with default headers values -func NewCreateClientCertificateCreated() *CreateClientCertificateCreated { - - return &CreateClientCertificateCreated{} -} - -// WithPayload adds the payload to the create client certificate created response -func (o *CreateClientCertificateCreated) WithPayload(payload *adminmessages.ClientCertificate) *CreateClientCertificateCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create client certificate created response -func (o *CreateClientCertificateCreated) SetPayload(payload *adminmessages.ClientCertificate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateClientCertificateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateClientCertificateBadRequestCode is the HTTP code returned for type CreateClientCertificateBadRequest -const CreateClientCertificateBadRequestCode int = 400 - -/* -CreateClientCertificateBadRequest Invalid Request - -swagger:response createClientCertificateBadRequest -*/ -type CreateClientCertificateBadRequest struct { -} - -// NewCreateClientCertificateBadRequest creates CreateClientCertificateBadRequest with default headers values -func NewCreateClientCertificateBadRequest() *CreateClientCertificateBadRequest { - - return &CreateClientCertificateBadRequest{} -} - -// WriteResponse to the client -func (o *CreateClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateClientCertificateUnauthorizedCode is the HTTP code returned for type CreateClientCertificateUnauthorized -const CreateClientCertificateUnauthorizedCode int = 401 - -/* -CreateClientCertificateUnauthorized Must be authenticated to use this end point - -swagger:response createClientCertificateUnauthorized -*/ -type CreateClientCertificateUnauthorized struct { -} - -// NewCreateClientCertificateUnauthorized creates CreateClientCertificateUnauthorized with default headers values -func NewCreateClientCertificateUnauthorized() *CreateClientCertificateUnauthorized { - - return &CreateClientCertificateUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateClientCertificateForbiddenCode is the HTTP code returned for type CreateClientCertificateForbidden -const CreateClientCertificateForbiddenCode int = 403 - -/* -CreateClientCertificateForbidden Not authorized to create a client certificate - -swagger:response createClientCertificateForbidden -*/ -type CreateClientCertificateForbidden struct { -} - -// NewCreateClientCertificateForbidden creates CreateClientCertificateForbidden with default headers values -func NewCreateClientCertificateForbidden() *CreateClientCertificateForbidden { - - return &CreateClientCertificateForbidden{} -} - -// WriteResponse to the client -func (o *CreateClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateClientCertificateInternalServerErrorCode is the HTTP code returned for type CreateClientCertificateInternalServerError -const CreateClientCertificateInternalServerErrorCode int = 500 - -/* -CreateClientCertificateInternalServerError Server error - -swagger:response createClientCertificateInternalServerError -*/ -type CreateClientCertificateInternalServerError struct { -} - -// NewCreateClientCertificateInternalServerError creates CreateClientCertificateInternalServerError with default headers values -func NewCreateClientCertificateInternalServerError() *CreateClientCertificateInternalServerError { - - return &CreateClientCertificateInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go deleted file mode 100644 index 00326141490..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateClientCertificateURL generates an URL for the create client certificate operation -type CreateClientCertificateURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateClientCertificateURL) WithBasePath(bp string) *CreateClientCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateClientCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateClientCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/client-certificates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateClientCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateClientCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateClientCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateClientCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateClientCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go deleted file mode 100644 index 59161996b9f..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetClientCertificateHandlerFunc turns a function with the right signature into a get client certificate handler -type GetClientCertificateHandlerFunc func(GetClientCertificateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetClientCertificateHandlerFunc) Handle(params GetClientCertificateParams) middleware.Responder { - return fn(params) -} - -// GetClientCertificateHandler interface for that can handle valid get client certificate params -type GetClientCertificateHandler interface { - Handle(GetClientCertificateParams) middleware.Responder -} - -// NewGetClientCertificate creates a new http.Handler for the get client certificate operation -func NewGetClientCertificate(ctx *middleware.Context, handler GetClientCertificateHandler) *GetClientCertificate { - return &GetClientCertificate{Context: ctx, Handler: handler} -} - -/* - GetClientCertificate swagger:route GET /client-certificates/{clientCertificateId} Client certificates getClientCertificate - -# Get a client certificate - -This endpoint returns a single Client Certificate by ID. Do not use -this endpoint directly as it is meant to be used with the Admin UI -exclusively. -*/ -type GetClientCertificate struct { - Context *middleware.Context - Handler GetClientCertificateHandler -} - -func (o *GetClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetClientCertificateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go deleted file mode 100644 index 70a7bd0cefb..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetClientCertificateParams creates a new GetClientCertificateParams object -// -// There are no default values defined in the spec. -func NewGetClientCertificateParams() GetClientCertificateParams { - - return GetClientCertificateParams{} -} - -// GetClientCertificateParams contains all the bound params for the get client certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters getClientCertificate -type GetClientCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ClientCertificateID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetClientCertificateParams() beforehand. -func (o *GetClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") - if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindClientCertificateID binds and validates parameter ClientCertificateID from path. -func (o *GetClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) - } - o.ClientCertificateID = *(value.(*strfmt.UUID)) - - if err := o.validateClientCertificateID(formats); err != nil { - return err - } - - return nil -} - -// validateClientCertificateID carries on validations for parameter ClientCertificateID -func (o *GetClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { - - if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go deleted file mode 100644 index 64e5fafce31..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetClientCertificateOKCode is the HTTP code returned for type GetClientCertificateOK -const GetClientCertificateOKCode int = 200 - -/* -GetClientCertificateOK success - -swagger:response getClientCertificateOK -*/ -type GetClientCertificateOK struct { - - /* - In: Body - */ - Payload *adminmessages.ClientCertificate `json:"body,omitempty"` -} - -// NewGetClientCertificateOK creates GetClientCertificateOK with default headers values -func NewGetClientCertificateOK() *GetClientCertificateOK { - - return &GetClientCertificateOK{} -} - -// WithPayload adds the payload to the get client certificate o k response -func (o *GetClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *GetClientCertificateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get client certificate o k response -func (o *GetClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetClientCertificateBadRequestCode is the HTTP code returned for type GetClientCertificateBadRequest -const GetClientCertificateBadRequestCode int = 400 - -/* -GetClientCertificateBadRequest invalid request - -swagger:response getClientCertificateBadRequest -*/ -type GetClientCertificateBadRequest struct { -} - -// NewGetClientCertificateBadRequest creates GetClientCertificateBadRequest with default headers values -func NewGetClientCertificateBadRequest() *GetClientCertificateBadRequest { - - return &GetClientCertificateBadRequest{} -} - -// WriteResponse to the client -func (o *GetClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetClientCertificateUnauthorizedCode is the HTTP code returned for type GetClientCertificateUnauthorized -const GetClientCertificateUnauthorizedCode int = 401 - -/* -GetClientCertificateUnauthorized request requires user authentication - -swagger:response getClientCertificateUnauthorized -*/ -type GetClientCertificateUnauthorized struct { -} - -// NewGetClientCertificateUnauthorized creates GetClientCertificateUnauthorized with default headers values -func NewGetClientCertificateUnauthorized() *GetClientCertificateUnauthorized { - - return &GetClientCertificateUnauthorized{} -} - -// WriteResponse to the client -func (o *GetClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetClientCertificateNotFoundCode is the HTTP code returned for type GetClientCertificateNotFound -const GetClientCertificateNotFoundCode int = 404 - -/* -GetClientCertificateNotFound id not found - -swagger:response getClientCertificateNotFound -*/ -type GetClientCertificateNotFound struct { -} - -// NewGetClientCertificateNotFound creates GetClientCertificateNotFound with default headers values -func NewGetClientCertificateNotFound() *GetClientCertificateNotFound { - - return &GetClientCertificateNotFound{} -} - -// WriteResponse to the client -func (o *GetClientCertificateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetClientCertificateInternalServerErrorCode is the HTTP code returned for type GetClientCertificateInternalServerError -const GetClientCertificateInternalServerErrorCode int = 500 - -/* -GetClientCertificateInternalServerError server error - -swagger:response getClientCertificateInternalServerError -*/ -type GetClientCertificateInternalServerError struct { -} - -// NewGetClientCertificateInternalServerError creates GetClientCertificateInternalServerError with default headers values -func NewGetClientCertificateInternalServerError() *GetClientCertificateInternalServerError { - - return &GetClientCertificateInternalServerError{} -} - -// WriteResponse to the client -func (o *GetClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go deleted file mode 100644 index ebb693c73e1..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetClientCertificateURL generates an URL for the get client certificate operation -type GetClientCertificateURL struct { - ClientCertificateID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClientCertificateURL) WithBasePath(bp string) *GetClientCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetClientCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetClientCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/client-certificates/{clientCertificateId}" - - clientCertificateID := o.ClientCertificateID.String() - if clientCertificateID != "" { - _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) - } else { - return nil, errors.New("clientCertificateId is required on GetClientCertificateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetClientCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetClientCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetClientCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetClientCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetClientCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go deleted file mode 100644 index e70c6c97cf4..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexClientCertificatesHandlerFunc turns a function with the right signature into a index client certificates handler -type IndexClientCertificatesHandlerFunc func(IndexClientCertificatesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexClientCertificatesHandlerFunc) Handle(params IndexClientCertificatesParams) middleware.Responder { - return fn(params) -} - -// IndexClientCertificatesHandler interface for that can handle valid index client certificates params -type IndexClientCertificatesHandler interface { - Handle(IndexClientCertificatesParams) middleware.Responder -} - -// NewIndexClientCertificates creates a new http.Handler for the index client certificates operation -func NewIndexClientCertificates(ctx *middleware.Context, handler IndexClientCertificatesHandler) *IndexClientCertificates { - return &IndexClientCertificates{Context: ctx, Handler: handler} -} - -/* - IndexClientCertificates swagger:route GET /client-certificates Client certificates indexClientCertificates - -# List client certificates - -This endpoint returns a list of Client Certificates. Do not use this -endpoint directly as it is meant to be used with the Admin UI -exclusively. -*/ -type IndexClientCertificates struct { - Context *middleware.Context - Handler IndexClientCertificatesHandler -} - -func (o *IndexClientCertificates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexClientCertificatesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go deleted file mode 100644 index 5dd5e461c9e..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexClientCertificatesParams creates a new IndexClientCertificatesParams object -// -// There are no default values defined in the spec. -func NewIndexClientCertificatesParams() IndexClientCertificatesParams { - - return IndexClientCertificatesParams{} -} - -// IndexClientCertificatesParams contains all the bound params for the index client certificates operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexClientCertificates -type IndexClientCertificatesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexClientCertificatesParams() beforehand. -func (o *IndexClientCertificatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexClientCertificatesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexClientCertificatesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexClientCertificatesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexClientCertificatesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexClientCertificatesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go deleted file mode 100644 index 4bf02a9cf18..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexClientCertificatesOKCode is the HTTP code returned for type IndexClientCertificatesOK -const IndexClientCertificatesOKCode int = 200 - -/* -IndexClientCertificatesOK success - -swagger:response indexClientCertificatesOK -*/ -type IndexClientCertificatesOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.ClientCertificates `json:"body,omitempty"` -} - -// NewIndexClientCertificatesOK creates IndexClientCertificatesOK with default headers values -func NewIndexClientCertificatesOK() *IndexClientCertificatesOK { - - return &IndexClientCertificatesOK{} -} - -// WithContentRange adds the contentRange to the index client certificates o k response -func (o *IndexClientCertificatesOK) WithContentRange(contentRange string) *IndexClientCertificatesOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index client certificates o k response -func (o *IndexClientCertificatesOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index client certificates o k response -func (o *IndexClientCertificatesOK) WithPayload(payload adminmessages.ClientCertificates) *IndexClientCertificatesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index client certificates o k response -func (o *IndexClientCertificatesOK) SetPayload(payload adminmessages.ClientCertificates) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexClientCertificatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.ClientCertificates{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexClientCertificatesBadRequestCode is the HTTP code returned for type IndexClientCertificatesBadRequest -const IndexClientCertificatesBadRequestCode int = 400 - -/* -IndexClientCertificatesBadRequest invalid request - -swagger:response indexClientCertificatesBadRequest -*/ -type IndexClientCertificatesBadRequest struct { -} - -// NewIndexClientCertificatesBadRequest creates IndexClientCertificatesBadRequest with default headers values -func NewIndexClientCertificatesBadRequest() *IndexClientCertificatesBadRequest { - - return &IndexClientCertificatesBadRequest{} -} - -// WriteResponse to the client -func (o *IndexClientCertificatesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexClientCertificatesUnauthorizedCode is the HTTP code returned for type IndexClientCertificatesUnauthorized -const IndexClientCertificatesUnauthorizedCode int = 401 - -/* -IndexClientCertificatesUnauthorized request requires user authentication - -swagger:response indexClientCertificatesUnauthorized -*/ -type IndexClientCertificatesUnauthorized struct { -} - -// NewIndexClientCertificatesUnauthorized creates IndexClientCertificatesUnauthorized with default headers values -func NewIndexClientCertificatesUnauthorized() *IndexClientCertificatesUnauthorized { - - return &IndexClientCertificatesUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexClientCertificatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexClientCertificatesNotFoundCode is the HTTP code returned for type IndexClientCertificatesNotFound -const IndexClientCertificatesNotFoundCode int = 404 - -/* -IndexClientCertificatesNotFound office not found - -swagger:response indexClientCertificatesNotFound -*/ -type IndexClientCertificatesNotFound struct { -} - -// NewIndexClientCertificatesNotFound creates IndexClientCertificatesNotFound with default headers values -func NewIndexClientCertificatesNotFound() *IndexClientCertificatesNotFound { - - return &IndexClientCertificatesNotFound{} -} - -// WriteResponse to the client -func (o *IndexClientCertificatesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexClientCertificatesInternalServerErrorCode is the HTTP code returned for type IndexClientCertificatesInternalServerError -const IndexClientCertificatesInternalServerErrorCode int = 500 - -/* -IndexClientCertificatesInternalServerError server error - -swagger:response indexClientCertificatesInternalServerError -*/ -type IndexClientCertificatesInternalServerError struct { -} - -// NewIndexClientCertificatesInternalServerError creates IndexClientCertificatesInternalServerError with default headers values -func NewIndexClientCertificatesInternalServerError() *IndexClientCertificatesInternalServerError { - - return &IndexClientCertificatesInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexClientCertificatesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go deleted file mode 100644 index 78037d822ca..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexClientCertificatesURL generates an URL for the index client certificates operation -type IndexClientCertificatesURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexClientCertificatesURL) WithBasePath(bp string) *IndexClientCertificatesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexClientCertificatesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexClientCertificatesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/client-certificates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexClientCertificatesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexClientCertificatesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexClientCertificatesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexClientCertificatesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexClientCertificatesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexClientCertificatesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go deleted file mode 100644 index f8dc02bc17e..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RemoveClientCertificateHandlerFunc turns a function with the right signature into a remove client certificate handler -type RemoveClientCertificateHandlerFunc func(RemoveClientCertificateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RemoveClientCertificateHandlerFunc) Handle(params RemoveClientCertificateParams) middleware.Responder { - return fn(params) -} - -// RemoveClientCertificateHandler interface for that can handle valid remove client certificate params -type RemoveClientCertificateHandler interface { - Handle(RemoveClientCertificateParams) middleware.Responder -} - -// NewRemoveClientCertificate creates a new http.Handler for the remove client certificate operation -func NewRemoveClientCertificate(ctx *middleware.Context, handler RemoveClientCertificateHandler) *RemoveClientCertificate { - return &RemoveClientCertificate{Context: ctx, Handler: handler} -} - -/* - RemoveClientCertificate swagger:route DELETE /client-certificates/{clientCertificateId} Client certificates removeClientCertificate - -removes a client certificate - -This endpoint removes a single Client Certificate by ID. Do not use -this endpoint directly as it is meant to be used with the Admin UI -exclusively. -*/ -type RemoveClientCertificate struct { - Context *middleware.Context - Handler RemoveClientCertificateHandler -} - -func (o *RemoveClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRemoveClientCertificateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go deleted file mode 100644 index 6b29aa1cf35..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewRemoveClientCertificateParams creates a new RemoveClientCertificateParams object -// -// There are no default values defined in the spec. -func NewRemoveClientCertificateParams() RemoveClientCertificateParams { - - return RemoveClientCertificateParams{} -} - -// RemoveClientCertificateParams contains all the bound params for the remove client certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters removeClientCertificate -type RemoveClientCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - ClientCertificateID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRemoveClientCertificateParams() beforehand. -func (o *RemoveClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") - if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindClientCertificateID binds and validates parameter ClientCertificateID from path. -func (o *RemoveClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) - } - o.ClientCertificateID = *(value.(*strfmt.UUID)) - - if err := o.validateClientCertificateID(formats); err != nil { - return err - } - - return nil -} - -// validateClientCertificateID carries on validations for parameter ClientCertificateID -func (o *RemoveClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { - - if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go deleted file mode 100644 index 2d5c13d2656..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// RemoveClientCertificateOKCode is the HTTP code returned for type RemoveClientCertificateOK -const RemoveClientCertificateOKCode int = 200 - -/* -RemoveClientCertificateOK Successfully removed Client Certificate - -swagger:response removeClientCertificateOK -*/ -type RemoveClientCertificateOK struct { - - /* - In: Body - */ - Payload *adminmessages.ClientCertificate `json:"body,omitempty"` -} - -// NewRemoveClientCertificateOK creates RemoveClientCertificateOK with default headers values -func NewRemoveClientCertificateOK() *RemoveClientCertificateOK { - - return &RemoveClientCertificateOK{} -} - -// WithPayload adds the payload to the remove client certificate o k response -func (o *RemoveClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *RemoveClientCertificateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the remove client certificate o k response -func (o *RemoveClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RemoveClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RemoveClientCertificateBadRequestCode is the HTTP code returned for type RemoveClientCertificateBadRequest -const RemoveClientCertificateBadRequestCode int = 400 - -/* -RemoveClientCertificateBadRequest Invalid Request - -swagger:response removeClientCertificateBadRequest -*/ -type RemoveClientCertificateBadRequest struct { -} - -// NewRemoveClientCertificateBadRequest creates RemoveClientCertificateBadRequest with default headers values -func NewRemoveClientCertificateBadRequest() *RemoveClientCertificateBadRequest { - - return &RemoveClientCertificateBadRequest{} -} - -// WriteResponse to the client -func (o *RemoveClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// RemoveClientCertificateUnauthorizedCode is the HTTP code returned for type RemoveClientCertificateUnauthorized -const RemoveClientCertificateUnauthorizedCode int = 401 - -/* -RemoveClientCertificateUnauthorized Must be authenticated to use this end point - -swagger:response removeClientCertificateUnauthorized -*/ -type RemoveClientCertificateUnauthorized struct { -} - -// NewRemoveClientCertificateUnauthorized creates RemoveClientCertificateUnauthorized with default headers values -func NewRemoveClientCertificateUnauthorized() *RemoveClientCertificateUnauthorized { - - return &RemoveClientCertificateUnauthorized{} -} - -// WriteResponse to the client -func (o *RemoveClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// RemoveClientCertificateForbiddenCode is the HTTP code returned for type RemoveClientCertificateForbidden -const RemoveClientCertificateForbiddenCode int = 403 - -/* -RemoveClientCertificateForbidden Not authorized to remove a client certificate - -swagger:response removeClientCertificateForbidden -*/ -type RemoveClientCertificateForbidden struct { -} - -// NewRemoveClientCertificateForbidden creates RemoveClientCertificateForbidden with default headers values -func NewRemoveClientCertificateForbidden() *RemoveClientCertificateForbidden { - - return &RemoveClientCertificateForbidden{} -} - -// WriteResponse to the client -func (o *RemoveClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// RemoveClientCertificateInternalServerErrorCode is the HTTP code returned for type RemoveClientCertificateInternalServerError -const RemoveClientCertificateInternalServerErrorCode int = 500 - -/* -RemoveClientCertificateInternalServerError Server error - -swagger:response removeClientCertificateInternalServerError -*/ -type RemoveClientCertificateInternalServerError struct { -} - -// NewRemoveClientCertificateInternalServerError creates RemoveClientCertificateInternalServerError with default headers values -func NewRemoveClientCertificateInternalServerError() *RemoveClientCertificateInternalServerError { - - return &RemoveClientCertificateInternalServerError{} -} - -// WriteResponse to the client -func (o *RemoveClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go deleted file mode 100644 index 8c2d98a56e4..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RemoveClientCertificateURL generates an URL for the remove client certificate operation -type RemoveClientCertificateURL struct { - ClientCertificateID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RemoveClientCertificateURL) WithBasePath(bp string) *RemoveClientCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RemoveClientCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RemoveClientCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/client-certificates/{clientCertificateId}" - - clientCertificateID := o.ClientCertificateID.String() - if clientCertificateID != "" { - _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) - } else { - return nil, errors.New("clientCertificateId is required on RemoveClientCertificateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RemoveClientCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RemoveClientCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RemoveClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RemoveClientCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RemoveClientCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RemoveClientCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go deleted file mode 100644 index 6e013be7628..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateClientCertificateHandlerFunc turns a function with the right signature into a update client certificate handler -type UpdateClientCertificateHandlerFunc func(UpdateClientCertificateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateClientCertificateHandlerFunc) Handle(params UpdateClientCertificateParams) middleware.Responder { - return fn(params) -} - -// UpdateClientCertificateHandler interface for that can handle valid update client certificate params -type UpdateClientCertificateHandler interface { - Handle(UpdateClientCertificateParams) middleware.Responder -} - -// NewUpdateClientCertificate creates a new http.Handler for the update client certificate operation -func NewUpdateClientCertificate(ctx *middleware.Context, handler UpdateClientCertificateHandler) *UpdateClientCertificate { - return &UpdateClientCertificate{Context: ctx, Handler: handler} -} - -/* - UpdateClientCertificate swagger:route PATCH /client-certificates/{clientCertificateId} Client certificates updateClientCertificate - -# Updates a client certificate - -This endpoint updates a single Client Certificate by ID. Do not use -this endpoint directly as it is meant to be used with the Admin UI -exclusively. -*/ -type UpdateClientCertificate struct { - Context *middleware.Context - Handler UpdateClientCertificateHandler -} - -func (o *UpdateClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateClientCertificateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go deleted file mode 100644 index b25f01f232c..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateClientCertificateParams creates a new UpdateClientCertificateParams object -// -// There are no default values defined in the spec. -func NewUpdateClientCertificateParams() UpdateClientCertificateParams { - - return UpdateClientCertificateParams{} -} - -// UpdateClientCertificateParams contains all the bound params for the update client certificate operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateClientCertificate -type UpdateClientCertificateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*client cert information - Required: true - In: body - */ - ClientCertificate *adminmessages.ClientCertificateUpdate - /* - Required: true - In: path - */ - ClientCertificateID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateClientCertificateParams() beforehand. -func (o *UpdateClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.ClientCertificateUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("clientCertificate", "body", "")) - } else { - res = append(res, errors.NewParseError("clientCertificate", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ClientCertificate = &body - } - } - } else { - res = append(res, errors.Required("clientCertificate", "body", "")) - } - - rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") - if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindClientCertificateID binds and validates parameter ClientCertificateID from path. -func (o *UpdateClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) - } - o.ClientCertificateID = *(value.(*strfmt.UUID)) - - if err := o.validateClientCertificateID(formats); err != nil { - return err - } - - return nil -} - -// validateClientCertificateID carries on validations for parameter ClientCertificateID -func (o *UpdateClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { - - if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go deleted file mode 100644 index 32d5fe36e69..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateClientCertificateOKCode is the HTTP code returned for type UpdateClientCertificateOK -const UpdateClientCertificateOKCode int = 200 - -/* -UpdateClientCertificateOK Successfully updated Client Certificate - -swagger:response updateClientCertificateOK -*/ -type UpdateClientCertificateOK struct { - - /* - In: Body - */ - Payload *adminmessages.ClientCertificate `json:"body,omitempty"` -} - -// NewUpdateClientCertificateOK creates UpdateClientCertificateOK with default headers values -func NewUpdateClientCertificateOK() *UpdateClientCertificateOK { - - return &UpdateClientCertificateOK{} -} - -// WithPayload adds the payload to the update client certificate o k response -func (o *UpdateClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *UpdateClientCertificateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update client certificate o k response -func (o *UpdateClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateClientCertificateBadRequestCode is the HTTP code returned for type UpdateClientCertificateBadRequest -const UpdateClientCertificateBadRequestCode int = 400 - -/* -UpdateClientCertificateBadRequest Invalid Request - -swagger:response updateClientCertificateBadRequest -*/ -type UpdateClientCertificateBadRequest struct { -} - -// NewUpdateClientCertificateBadRequest creates UpdateClientCertificateBadRequest with default headers values -func NewUpdateClientCertificateBadRequest() *UpdateClientCertificateBadRequest { - - return &UpdateClientCertificateBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateClientCertificateUnauthorizedCode is the HTTP code returned for type UpdateClientCertificateUnauthorized -const UpdateClientCertificateUnauthorizedCode int = 401 - -/* -UpdateClientCertificateUnauthorized Must be authenticated to use this end point - -swagger:response updateClientCertificateUnauthorized -*/ -type UpdateClientCertificateUnauthorized struct { -} - -// NewUpdateClientCertificateUnauthorized creates UpdateClientCertificateUnauthorized with default headers values -func NewUpdateClientCertificateUnauthorized() *UpdateClientCertificateUnauthorized { - - return &UpdateClientCertificateUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateClientCertificateForbiddenCode is the HTTP code returned for type UpdateClientCertificateForbidden -const UpdateClientCertificateForbiddenCode int = 403 - -/* -UpdateClientCertificateForbidden Not authorized to update a client certificate - -swagger:response updateClientCertificateForbidden -*/ -type UpdateClientCertificateForbidden struct { -} - -// NewUpdateClientCertificateForbidden creates UpdateClientCertificateForbidden with default headers values -func NewUpdateClientCertificateForbidden() *UpdateClientCertificateForbidden { - - return &UpdateClientCertificateForbidden{} -} - -// WriteResponse to the client -func (o *UpdateClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateClientCertificateInternalServerErrorCode is the HTTP code returned for type UpdateClientCertificateInternalServerError -const UpdateClientCertificateInternalServerErrorCode int = 500 - -/* -UpdateClientCertificateInternalServerError Server error - -swagger:response updateClientCertificateInternalServerError -*/ -type UpdateClientCertificateInternalServerError struct { -} - -// NewUpdateClientCertificateInternalServerError creates UpdateClientCertificateInternalServerError with default headers values -func NewUpdateClientCertificateInternalServerError() *UpdateClientCertificateInternalServerError { - - return &UpdateClientCertificateInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go deleted file mode 100644 index e9f97f74c63..00000000000 --- a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package client_certificates - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateClientCertificateURL generates an URL for the update client certificate operation -type UpdateClientCertificateURL struct { - ClientCertificateID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateClientCertificateURL) WithBasePath(bp string) *UpdateClientCertificateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateClientCertificateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateClientCertificateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/client-certificates/{clientCertificateId}" - - clientCertificateID := o.ClientCertificateID.String() - if clientCertificateID != "" { - _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) - } else { - return nil, errors.New("clientCertificateId is required on UpdateClientCertificateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateClientCertificateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateClientCertificateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateClientCertificateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateClientCertificateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateClientCertificateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go deleted file mode 100644 index 82450238284..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetElectronicOrdersTotalsHandlerFunc turns a function with the right signature into a get electronic orders totals handler -type GetElectronicOrdersTotalsHandlerFunc func(GetElectronicOrdersTotalsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetElectronicOrdersTotalsHandlerFunc) Handle(params GetElectronicOrdersTotalsParams) middleware.Responder { - return fn(params) -} - -// GetElectronicOrdersTotalsHandler interface for that can handle valid get electronic orders totals params -type GetElectronicOrdersTotalsHandler interface { - Handle(GetElectronicOrdersTotalsParams) middleware.Responder -} - -// NewGetElectronicOrdersTotals creates a new http.Handler for the get electronic orders totals operation -func NewGetElectronicOrdersTotals(ctx *middleware.Context, handler GetElectronicOrdersTotalsHandler) *GetElectronicOrdersTotals { - return &GetElectronicOrdersTotals{Context: ctx, Handler: handler} -} - -/* - GetElectronicOrdersTotals swagger:route GET /electronic-orders/totals Electronic orders getElectronicOrdersTotals - -# Get total counts for the orders stored in MilMove - -This endpoint returns a list of record counts for Electronic Orders. Do not use -this endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type GetElectronicOrdersTotals struct { - Context *middleware.Context - Handler GetElectronicOrdersTotalsHandler -} - -func (o *GetElectronicOrdersTotals) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetElectronicOrdersTotalsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go deleted file mode 100644 index 5db5040c80e..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetElectronicOrdersTotalsParams creates a new GetElectronicOrdersTotalsParams object -// -// There are no default values defined in the spec. -func NewGetElectronicOrdersTotalsParams() GetElectronicOrdersTotalsParams { - - return GetElectronicOrdersTotalsParams{} -} - -// GetElectronicOrdersTotalsParams contains all the bound params for the get electronic orders totals operation -// typically these are obtained from a http.Request -// -// swagger:parameters getElectronicOrdersTotals -type GetElectronicOrdersTotalsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - AndFilter []string - /* - In: query - */ - Filter []string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetElectronicOrdersTotalsParams() beforehand. -func (o *GetElectronicOrdersTotalsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qAndFilter, qhkAndFilter, _ := qs.GetOK("andFilter") - if err := o.bindAndFilter(qAndFilter, qhkAndFilter, route.Formats); err != nil { - res = append(res, err) - } - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAndFilter binds and validates array parameter AndFilter from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *GetElectronicOrdersTotalsParams) bindAndFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvAndFilter string - if len(rawData) > 0 { - qvAndFilter = rawData[len(rawData)-1] - } - - // CollectionFormat: - andFilterIC := swag.SplitByFormat(qvAndFilter, "") - if len(andFilterIC) == 0 { - return nil - } - - var andFilterIR []string - for _, andFilterIV := range andFilterIC { - andFilterI := andFilterIV - - andFilterIR = append(andFilterIR, andFilterI) - } - - o.AndFilter = andFilterIR - - return nil -} - -// bindFilter binds and validates array parameter Filter from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *GetElectronicOrdersTotalsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvFilter string - if len(rawData) > 0 { - qvFilter = rawData[len(rawData)-1] - } - - // CollectionFormat: - filterIC := swag.SplitByFormat(qvFilter, "") - if len(filterIC) == 0 { - return nil - } - - var filterIR []string - for _, filterIV := range filterIC { - filterI := filterIV - - filterIR = append(filterIR, filterI) - } - - o.Filter = filterIR - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go deleted file mode 100644 index d782dfd0d2b..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetElectronicOrdersTotalsOKCode is the HTTP code returned for type GetElectronicOrdersTotalsOK -const GetElectronicOrdersTotalsOKCode int = 200 - -/* -GetElectronicOrdersTotalsOK success - -swagger:response getElectronicOrdersTotalsOK -*/ -type GetElectronicOrdersTotalsOK struct { - - /* - In: Body - */ - Payload adminmessages.ElectronicOrdersTotals `json:"body,omitempty"` -} - -// NewGetElectronicOrdersTotalsOK creates GetElectronicOrdersTotalsOK with default headers values -func NewGetElectronicOrdersTotalsOK() *GetElectronicOrdersTotalsOK { - - return &GetElectronicOrdersTotalsOK{} -} - -// WithPayload adds the payload to the get electronic orders totals o k response -func (o *GetElectronicOrdersTotalsOK) WithPayload(payload adminmessages.ElectronicOrdersTotals) *GetElectronicOrdersTotalsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get electronic orders totals o k response -func (o *GetElectronicOrdersTotalsOK) SetPayload(payload adminmessages.ElectronicOrdersTotals) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetElectronicOrdersTotalsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.ElectronicOrdersTotals{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetElectronicOrdersTotalsBadRequestCode is the HTTP code returned for type GetElectronicOrdersTotalsBadRequest -const GetElectronicOrdersTotalsBadRequestCode int = 400 - -/* -GetElectronicOrdersTotalsBadRequest invalid request - -swagger:response getElectronicOrdersTotalsBadRequest -*/ -type GetElectronicOrdersTotalsBadRequest struct { -} - -// NewGetElectronicOrdersTotalsBadRequest creates GetElectronicOrdersTotalsBadRequest with default headers values -func NewGetElectronicOrdersTotalsBadRequest() *GetElectronicOrdersTotalsBadRequest { - - return &GetElectronicOrdersTotalsBadRequest{} -} - -// WriteResponse to the client -func (o *GetElectronicOrdersTotalsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetElectronicOrdersTotalsUnauthorizedCode is the HTTP code returned for type GetElectronicOrdersTotalsUnauthorized -const GetElectronicOrdersTotalsUnauthorizedCode int = 401 - -/* -GetElectronicOrdersTotalsUnauthorized request requires user authentication - -swagger:response getElectronicOrdersTotalsUnauthorized -*/ -type GetElectronicOrdersTotalsUnauthorized struct { -} - -// NewGetElectronicOrdersTotalsUnauthorized creates GetElectronicOrdersTotalsUnauthorized with default headers values -func NewGetElectronicOrdersTotalsUnauthorized() *GetElectronicOrdersTotalsUnauthorized { - - return &GetElectronicOrdersTotalsUnauthorized{} -} - -// WriteResponse to the client -func (o *GetElectronicOrdersTotalsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetElectronicOrdersTotalsNotFoundCode is the HTTP code returned for type GetElectronicOrdersTotalsNotFound -const GetElectronicOrdersTotalsNotFoundCode int = 404 - -/* -GetElectronicOrdersTotalsNotFound Total count for Electronic Orders not found - -swagger:response getElectronicOrdersTotalsNotFound -*/ -type GetElectronicOrdersTotalsNotFound struct { -} - -// NewGetElectronicOrdersTotalsNotFound creates GetElectronicOrdersTotalsNotFound with default headers values -func NewGetElectronicOrdersTotalsNotFound() *GetElectronicOrdersTotalsNotFound { - - return &GetElectronicOrdersTotalsNotFound{} -} - -// WriteResponse to the client -func (o *GetElectronicOrdersTotalsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetElectronicOrdersTotalsInternalServerErrorCode is the HTTP code returned for type GetElectronicOrdersTotalsInternalServerError -const GetElectronicOrdersTotalsInternalServerErrorCode int = 500 - -/* -GetElectronicOrdersTotalsInternalServerError server error - -swagger:response getElectronicOrdersTotalsInternalServerError -*/ -type GetElectronicOrdersTotalsInternalServerError struct { -} - -// NewGetElectronicOrdersTotalsInternalServerError creates GetElectronicOrdersTotalsInternalServerError with default headers values -func NewGetElectronicOrdersTotalsInternalServerError() *GetElectronicOrdersTotalsInternalServerError { - - return &GetElectronicOrdersTotalsInternalServerError{} -} - -// WriteResponse to the client -func (o *GetElectronicOrdersTotalsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go deleted file mode 100644 index a5a2415e2f9..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetElectronicOrdersTotalsURL generates an URL for the get electronic orders totals operation -type GetElectronicOrdersTotalsURL struct { - AndFilter []string - Filter []string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetElectronicOrdersTotalsURL) WithBasePath(bp string) *GetElectronicOrdersTotalsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetElectronicOrdersTotalsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetElectronicOrdersTotalsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/electronic-orders/totals" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var andFilterIR []string - for _, andFilterI := range o.AndFilter { - andFilterIS := andFilterI - if andFilterIS != "" { - andFilterIR = append(andFilterIR, andFilterIS) - } - } - - andFilter := swag.JoinByFormat(andFilterIR, "") - - if len(andFilter) > 0 { - qsv := andFilter[0] - if qsv != "" { - qs.Set("andFilter", qsv) - } - } - - var filterIR []string - for _, filterI := range o.Filter { - filterIS := filterI - if filterIS != "" { - filterIR = append(filterIR, filterIS) - } - } - - filter := swag.JoinByFormat(filterIR, "") - - if len(filter) > 0 { - qsv := filter[0] - if qsv != "" { - qs.Set("filter", qsv) - } - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetElectronicOrdersTotalsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetElectronicOrdersTotalsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetElectronicOrdersTotalsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetElectronicOrdersTotalsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetElectronicOrdersTotalsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetElectronicOrdersTotalsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go deleted file mode 100644 index 79dd17739c7..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexElectronicOrdersHandlerFunc turns a function with the right signature into a index electronic orders handler -type IndexElectronicOrdersHandlerFunc func(IndexElectronicOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexElectronicOrdersHandlerFunc) Handle(params IndexElectronicOrdersParams) middleware.Responder { - return fn(params) -} - -// IndexElectronicOrdersHandler interface for that can handle valid index electronic orders params -type IndexElectronicOrdersHandler interface { - Handle(IndexElectronicOrdersParams) middleware.Responder -} - -// NewIndexElectronicOrders creates a new http.Handler for the index electronic orders operation -func NewIndexElectronicOrders(ctx *middleware.Context, handler IndexElectronicOrdersHandler) *IndexElectronicOrders { - return &IndexElectronicOrders{Context: ctx, Handler: handler} -} - -/* - IndexElectronicOrders swagger:route GET /electronic-orders Electronic orders indexElectronicOrders - -# List Electronic Orders - -This endpoint returns a list of Electronic Orders. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type IndexElectronicOrders struct { - Context *middleware.Context - Handler IndexElectronicOrdersHandler -} - -func (o *IndexElectronicOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexElectronicOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go deleted file mode 100644 index 7cf24f4b208..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexElectronicOrdersParams creates a new IndexElectronicOrdersParams object -// -// There are no default values defined in the spec. -func NewIndexElectronicOrdersParams() IndexElectronicOrdersParams { - - return IndexElectronicOrdersParams{} -} - -// IndexElectronicOrdersParams contains all the bound params for the index electronic orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexElectronicOrders -type IndexElectronicOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter []string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexElectronicOrdersParams() beforehand. -func (o *IndexElectronicOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates array parameter Filter from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *IndexElectronicOrdersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvFilter string - if len(rawData) > 0 { - qvFilter = rawData[len(rawData)-1] - } - - // CollectionFormat: - filterIC := swag.SplitByFormat(qvFilter, "") - if len(filterIC) == 0 { - return nil - } - - var filterIR []string - for _, filterIV := range filterIC { - filterI := filterIV - - filterIR = append(filterIR, filterI) - } - - o.Filter = filterIR - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexElectronicOrdersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexElectronicOrdersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexElectronicOrdersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexElectronicOrdersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go deleted file mode 100644 index d9a92c28ca7..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexElectronicOrdersOKCode is the HTTP code returned for type IndexElectronicOrdersOK -const IndexElectronicOrdersOKCode int = 200 - -/* -IndexElectronicOrdersOK success - -swagger:response indexElectronicOrdersOK -*/ -type IndexElectronicOrdersOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.ElectronicOrders `json:"body,omitempty"` -} - -// NewIndexElectronicOrdersOK creates IndexElectronicOrdersOK with default headers values -func NewIndexElectronicOrdersOK() *IndexElectronicOrdersOK { - - return &IndexElectronicOrdersOK{} -} - -// WithContentRange adds the contentRange to the index electronic orders o k response -func (o *IndexElectronicOrdersOK) WithContentRange(contentRange string) *IndexElectronicOrdersOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index electronic orders o k response -func (o *IndexElectronicOrdersOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index electronic orders o k response -func (o *IndexElectronicOrdersOK) WithPayload(payload adminmessages.ElectronicOrders) *IndexElectronicOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index electronic orders o k response -func (o *IndexElectronicOrdersOK) SetPayload(payload adminmessages.ElectronicOrders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexElectronicOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.ElectronicOrders{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexElectronicOrdersBadRequestCode is the HTTP code returned for type IndexElectronicOrdersBadRequest -const IndexElectronicOrdersBadRequestCode int = 400 - -/* -IndexElectronicOrdersBadRequest invalid request - -swagger:response indexElectronicOrdersBadRequest -*/ -type IndexElectronicOrdersBadRequest struct { -} - -// NewIndexElectronicOrdersBadRequest creates IndexElectronicOrdersBadRequest with default headers values -func NewIndexElectronicOrdersBadRequest() *IndexElectronicOrdersBadRequest { - - return &IndexElectronicOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *IndexElectronicOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexElectronicOrdersUnauthorizedCode is the HTTP code returned for type IndexElectronicOrdersUnauthorized -const IndexElectronicOrdersUnauthorizedCode int = 401 - -/* -IndexElectronicOrdersUnauthorized request requires user authentication - -swagger:response indexElectronicOrdersUnauthorized -*/ -type IndexElectronicOrdersUnauthorized struct { -} - -// NewIndexElectronicOrdersUnauthorized creates IndexElectronicOrdersUnauthorized with default headers values -func NewIndexElectronicOrdersUnauthorized() *IndexElectronicOrdersUnauthorized { - - return &IndexElectronicOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexElectronicOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexElectronicOrdersNotFoundCode is the HTTP code returned for type IndexElectronicOrdersNotFound -const IndexElectronicOrdersNotFoundCode int = 404 - -/* -IndexElectronicOrdersNotFound Electronic Order not found - -swagger:response indexElectronicOrdersNotFound -*/ -type IndexElectronicOrdersNotFound struct { -} - -// NewIndexElectronicOrdersNotFound creates IndexElectronicOrdersNotFound with default headers values -func NewIndexElectronicOrdersNotFound() *IndexElectronicOrdersNotFound { - - return &IndexElectronicOrdersNotFound{} -} - -// WriteResponse to the client -func (o *IndexElectronicOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexElectronicOrdersInternalServerErrorCode is the HTTP code returned for type IndexElectronicOrdersInternalServerError -const IndexElectronicOrdersInternalServerErrorCode int = 500 - -/* -IndexElectronicOrdersInternalServerError server error - -swagger:response indexElectronicOrdersInternalServerError -*/ -type IndexElectronicOrdersInternalServerError struct { -} - -// NewIndexElectronicOrdersInternalServerError creates IndexElectronicOrdersInternalServerError with default headers values -func NewIndexElectronicOrdersInternalServerError() *IndexElectronicOrdersInternalServerError { - - return &IndexElectronicOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexElectronicOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go deleted file mode 100644 index 534c245c601..00000000000 --- a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package electronic_orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexElectronicOrdersURL generates an URL for the index electronic orders operation -type IndexElectronicOrdersURL struct { - Filter []string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexElectronicOrdersURL) WithBasePath(bp string) *IndexElectronicOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexElectronicOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexElectronicOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/electronic-orders" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterIR []string - for _, filterI := range o.Filter { - filterIS := filterI - if filterIS != "" { - filterIR = append(filterIR, filterIS) - } - } - - filter := swag.JoinByFormat(filterIR, "") - - if len(filter) > 0 { - qsv := filter[0] - if qsv != "" { - qs.Set("filter", qsv) - } - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexElectronicOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexElectronicOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexElectronicOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexElectronicOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexElectronicOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexElectronicOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move.go b/pkg/gen/adminapi/adminoperations/moves/get_move.go deleted file mode 100644 index f674264c30b..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/get_move.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveHandlerFunc turns a function with the right signature into a get move handler -type GetMoveHandlerFunc func(GetMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveHandlerFunc) Handle(params GetMoveParams) middleware.Responder { - return fn(params) -} - -// GetMoveHandler interface for that can handle valid get move params -type GetMoveHandler interface { - Handle(GetMoveParams) middleware.Responder -} - -// NewGetMove creates a new http.Handler for the get move operation -func NewGetMove(ctx *middleware.Context, handler GetMoveHandler) *GetMove { - return &GetMove{Context: ctx, Handler: handler} -} - -/* - GetMove swagger:route GET /moves/{moveID} Moves getMove - -# Get information about a Move - -This endpoint returns a single Move by ID. Do not use this endpoint directly as -it is meant to be used with the Admin UI exclusively. -*/ -type GetMove struct { - Context *middleware.Context - Handler GetMoveHandler -} - -func (o *GetMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go b/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go deleted file mode 100644 index 7a3c1185b61..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetMoveParams creates a new GetMoveParams object -// -// There are no default values defined in the spec. -func NewGetMoveParams() GetMoveParams { - - return GetMoveParams{} -} - -// GetMoveParams contains all the bound params for the get move operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMove -type GetMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveParams() beforehand. -func (o *GetMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *GetMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go b/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go deleted file mode 100644 index f1070aabdb2..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetMoveOKCode is the HTTP code returned for type GetMoveOK -const GetMoveOKCode int = 200 - -/* -GetMoveOK Success - -swagger:response getMoveOK -*/ -type GetMoveOK struct { - - /* - In: Body - */ - Payload *adminmessages.Move `json:"body,omitempty"` -} - -// NewGetMoveOK creates GetMoveOK with default headers values -func NewGetMoveOK() *GetMoveOK { - - return &GetMoveOK{} -} - -// WithPayload adds the payload to the get move o k response -func (o *GetMoveOK) WithPayload(payload *adminmessages.Move) *GetMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move o k response -func (o *GetMoveOK) SetPayload(payload *adminmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveBadRequestCode is the HTTP code returned for type GetMoveBadRequest -const GetMoveBadRequestCode int = 400 - -/* -GetMoveBadRequest Invalid request - -swagger:response getMoveBadRequest -*/ -type GetMoveBadRequest struct { -} - -// NewGetMoveBadRequest creates GetMoveBadRequest with default headers values -func NewGetMoveBadRequest() *GetMoveBadRequest { - - return &GetMoveBadRequest{} -} - -// WriteResponse to the client -func (o *GetMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetMoveUnauthorizedCode is the HTTP code returned for type GetMoveUnauthorized -const GetMoveUnauthorizedCode int = 401 - -/* -GetMoveUnauthorized Must be authenticated to use this endpoint - -swagger:response getMoveUnauthorized -*/ -type GetMoveUnauthorized struct { -} - -// NewGetMoveUnauthorized creates GetMoveUnauthorized with default headers values -func NewGetMoveUnauthorized() *GetMoveUnauthorized { - - return &GetMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *GetMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetMoveNotFoundCode is the HTTP code returned for type GetMoveNotFound -const GetMoveNotFoundCode int = 404 - -/* -GetMoveNotFound Move not found - -swagger:response getMoveNotFound -*/ -type GetMoveNotFound struct { -} - -// NewGetMoveNotFound creates GetMoveNotFound with default headers values -func NewGetMoveNotFound() *GetMoveNotFound { - - return &GetMoveNotFound{} -} - -// WriteResponse to the client -func (o *GetMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetMoveInternalServerErrorCode is the HTTP code returned for type GetMoveInternalServerError -const GetMoveInternalServerErrorCode int = 500 - -/* -GetMoveInternalServerError Server error - -swagger:response getMoveInternalServerError -*/ -type GetMoveInternalServerError struct { -} - -// NewGetMoveInternalServerError creates GetMoveInternalServerError with default headers values -func NewGetMoveInternalServerError() *GetMoveInternalServerError { - - return &GetMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *GetMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go deleted file mode 100644 index 61e83c27c9e..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetMoveURL generates an URL for the get move operation -type GetMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveURL) WithBasePath(bp string) *GetMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves.go b/pkg/gen/adminapi/adminoperations/moves/index_moves.go deleted file mode 100644 index d059611a921..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/index_moves.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexMovesHandlerFunc turns a function with the right signature into a index moves handler -type IndexMovesHandlerFunc func(IndexMovesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexMovesHandlerFunc) Handle(params IndexMovesParams) middleware.Responder { - return fn(params) -} - -// IndexMovesHandler interface for that can handle valid index moves params -type IndexMovesHandler interface { - Handle(IndexMovesParams) middleware.Responder -} - -// NewIndexMoves creates a new http.Handler for the index moves operation -func NewIndexMoves(ctx *middleware.Context, handler IndexMovesHandler) *IndexMoves { - return &IndexMoves{Context: ctx, Handler: handler} -} - -/* - IndexMoves swagger:route GET /moves Moves indexMoves - -# List Moves - -This endpoint returns a list of Moves. Do not use this endpoint directly -as it is meant to be used with the Admin UI exclusively. -*/ -type IndexMoves struct { - Context *middleware.Context - Handler IndexMovesHandler -} - -func (o *IndexMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexMovesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go deleted file mode 100644 index ccc5e6e210d..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexMovesParams creates a new IndexMovesParams object -// -// There are no default values defined in the spec. -func NewIndexMovesParams() IndexMovesParams { - - return IndexMovesParams{} -} - -// IndexMovesParams contains all the bound params for the index moves operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexMoves -type IndexMovesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexMovesParams() beforehand. -func (o *IndexMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexMovesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexMovesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexMovesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexMovesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexMovesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go deleted file mode 100644 index 3199955fe75..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexMovesOKCode is the HTTP code returned for type IndexMovesOK -const IndexMovesOKCode int = 200 - -/* -IndexMovesOK success - -swagger:response indexMovesOK -*/ -type IndexMovesOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.Moves `json:"body,omitempty"` -} - -// NewIndexMovesOK creates IndexMovesOK with default headers values -func NewIndexMovesOK() *IndexMovesOK { - - return &IndexMovesOK{} -} - -// WithContentRange adds the contentRange to the index moves o k response -func (o *IndexMovesOK) WithContentRange(contentRange string) *IndexMovesOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index moves o k response -func (o *IndexMovesOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index moves o k response -func (o *IndexMovesOK) WithPayload(payload adminmessages.Moves) *IndexMovesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index moves o k response -func (o *IndexMovesOK) SetPayload(payload adminmessages.Moves) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.Moves{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexMovesBadRequestCode is the HTTP code returned for type IndexMovesBadRequest -const IndexMovesBadRequestCode int = 400 - -/* -IndexMovesBadRequest invalid request - -swagger:response indexMovesBadRequest -*/ -type IndexMovesBadRequest struct { -} - -// NewIndexMovesBadRequest creates IndexMovesBadRequest with default headers values -func NewIndexMovesBadRequest() *IndexMovesBadRequest { - - return &IndexMovesBadRequest{} -} - -// WriteResponse to the client -func (o *IndexMovesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexMovesUnauthorizedCode is the HTTP code returned for type IndexMovesUnauthorized -const IndexMovesUnauthorizedCode int = 401 - -/* -IndexMovesUnauthorized request requires user authentication - -swagger:response indexMovesUnauthorized -*/ -type IndexMovesUnauthorized struct { -} - -// NewIndexMovesUnauthorized creates IndexMovesUnauthorized with default headers values -func NewIndexMovesUnauthorized() *IndexMovesUnauthorized { - - return &IndexMovesUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexMovesNotFoundCode is the HTTP code returned for type IndexMovesNotFound -const IndexMovesNotFoundCode int = 404 - -/* -IndexMovesNotFound Moves not found - -swagger:response indexMovesNotFound -*/ -type IndexMovesNotFound struct { -} - -// NewIndexMovesNotFound creates IndexMovesNotFound with default headers values -func NewIndexMovesNotFound() *IndexMovesNotFound { - - return &IndexMovesNotFound{} -} - -// WriteResponse to the client -func (o *IndexMovesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexMovesInternalServerErrorCode is the HTTP code returned for type IndexMovesInternalServerError -const IndexMovesInternalServerErrorCode int = 500 - -/* -IndexMovesInternalServerError server error - -swagger:response indexMovesInternalServerError -*/ -type IndexMovesInternalServerError struct { -} - -// NewIndexMovesInternalServerError creates IndexMovesInternalServerError with default headers values -func NewIndexMovesInternalServerError() *IndexMovesInternalServerError { - - return &IndexMovesInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go deleted file mode 100644 index f9bc47252b8..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexMovesURL generates an URL for the index moves operation -type IndexMovesURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexMovesURL) WithBasePath(bp string) *IndexMovesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexMovesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexMovesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexMovesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexMovesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexMovesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexMovesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexMovesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexMovesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move.go b/pkg/gen/adminapi/adminoperations/moves/update_move.go deleted file mode 100644 index ef9da3e7970..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/update_move.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMoveHandlerFunc turns a function with the right signature into a update move handler -type UpdateMoveHandlerFunc func(UpdateMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMoveHandlerFunc) Handle(params UpdateMoveParams) middleware.Responder { - return fn(params) -} - -// UpdateMoveHandler interface for that can handle valid update move params -type UpdateMoveHandler interface { - Handle(UpdateMoveParams) middleware.Responder -} - -// NewUpdateMove creates a new http.Handler for the update move operation -func NewUpdateMove(ctx *middleware.Context, handler UpdateMoveHandler) *UpdateMove { - return &UpdateMove{Context: ctx, Handler: handler} -} - -/* - UpdateMove swagger:route PATCH /moves/{moveID} Moves updateMove - -# Toggle Move visibility - -This endpoint updates a single Move by ID. This allows the Admin User to change -the `show` field on the selected field to either `True` or `False`. A "shown" -Move will appear to all users as normal, a "hidden" Move will not be returned or -editable using any other endpoint (besides those in the Support API), and thus -effectively deactivated. Do not use this endpoint directly as it is meant to be -used with the Admin UI exclusively. -*/ -type UpdateMove struct { - Context *middleware.Context - Handler UpdateMoveHandler -} - -func (o *UpdateMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go b/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go deleted file mode 100644 index 768d0b54ee3..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateMoveParams creates a new UpdateMoveParams object -// -// There are no default values defined in the spec. -func NewUpdateMoveParams() UpdateMoveParams { - - return UpdateMoveParams{} -} - -// UpdateMoveParams contains all the bound params for the update move operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMove -type UpdateMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Move information - Required: true - In: body - */ - Move *adminmessages.MoveUpdate - /* - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMoveParams() beforehand. -func (o *UpdateMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.MoveUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("move", "body", "")) - } else { - res = append(res, errors.NewParseError("move", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Move = &body - } - } - } else { - res = append(res, errors.Required("move", "body", "")) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *UpdateMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *UpdateMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go b/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go deleted file mode 100644 index c56ece6b1f5..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go +++ /dev/null @@ -1,209 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateMoveOKCode is the HTTP code returned for type UpdateMoveOK -const UpdateMoveOKCode int = 200 - -/* -UpdateMoveOK Successfully updated the Move - -swagger:response updateMoveOK -*/ -type UpdateMoveOK struct { - - /* - In: Body - */ - Payload *adminmessages.Move `json:"body,omitempty"` -} - -// NewUpdateMoveOK creates UpdateMoveOK with default headers values -func NewUpdateMoveOK() *UpdateMoveOK { - - return &UpdateMoveOK{} -} - -// WithPayload adds the payload to the update move o k response -func (o *UpdateMoveOK) WithPayload(payload *adminmessages.Move) *UpdateMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move o k response -func (o *UpdateMoveOK) SetPayload(payload *adminmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveBadRequestCode is the HTTP code returned for type UpdateMoveBadRequest -const UpdateMoveBadRequestCode int = 400 - -/* -UpdateMoveBadRequest Invalid request - -swagger:response updateMoveBadRequest -*/ -type UpdateMoveBadRequest struct { -} - -// NewUpdateMoveBadRequest creates UpdateMoveBadRequest with default headers values -func NewUpdateMoveBadRequest() *UpdateMoveBadRequest { - - return &UpdateMoveBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateMoveUnauthorizedCode is the HTTP code returned for type UpdateMoveUnauthorized -const UpdateMoveUnauthorizedCode int = 401 - -/* -UpdateMoveUnauthorized Must be authenticated to use this endpoint - -swagger:response updateMoveUnauthorized -*/ -type UpdateMoveUnauthorized struct { -} - -// NewUpdateMoveUnauthorized creates UpdateMoveUnauthorized with default headers values -func NewUpdateMoveUnauthorized() *UpdateMoveUnauthorized { - - return &UpdateMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateMoveForbiddenCode is the HTTP code returned for type UpdateMoveForbidden -const UpdateMoveForbiddenCode int = 403 - -/* -UpdateMoveForbidden Not authorized to update this Move - -swagger:response updateMoveForbidden -*/ -type UpdateMoveForbidden struct { -} - -// NewUpdateMoveForbidden creates UpdateMoveForbidden with default headers values -func NewUpdateMoveForbidden() *UpdateMoveForbidden { - - return &UpdateMoveForbidden{} -} - -// WriteResponse to the client -func (o *UpdateMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateMoveNotFoundCode is the HTTP code returned for type UpdateMoveNotFound -const UpdateMoveNotFoundCode int = 404 - -/* -UpdateMoveNotFound Move not found - -swagger:response updateMoveNotFound -*/ -type UpdateMoveNotFound struct { -} - -// NewUpdateMoveNotFound creates UpdateMoveNotFound with default headers values -func NewUpdateMoveNotFound() *UpdateMoveNotFound { - - return &UpdateMoveNotFound{} -} - -// WriteResponse to the client -func (o *UpdateMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateMoveUnprocessableEntityCode is the HTTP code returned for type UpdateMoveUnprocessableEntity -const UpdateMoveUnprocessableEntityCode int = 422 - -/* -UpdateMoveUnprocessableEntity Invalid input - -swagger:response updateMoveUnprocessableEntity -*/ -type UpdateMoveUnprocessableEntity struct { -} - -// NewUpdateMoveUnprocessableEntity creates UpdateMoveUnprocessableEntity with default headers values -func NewUpdateMoveUnprocessableEntity() *UpdateMoveUnprocessableEntity { - - return &UpdateMoveUnprocessableEntity{} -} - -// WriteResponse to the client -func (o *UpdateMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(422) -} - -// UpdateMoveInternalServerErrorCode is the HTTP code returned for type UpdateMoveInternalServerError -const UpdateMoveInternalServerErrorCode int = 500 - -/* -UpdateMoveInternalServerError Server error - -swagger:response updateMoveInternalServerError -*/ -type UpdateMoveInternalServerError struct { -} - -// NewUpdateMoveInternalServerError creates UpdateMoveInternalServerError with default headers values -func NewUpdateMoveInternalServerError() *UpdateMoveInternalServerError { - - return &UpdateMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go deleted file mode 100644 index 87f1ef71d15..00000000000 --- a/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMoveURL generates an URL for the update move operation -type UpdateMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveURL) WithBasePath(bp string) *UpdateMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on UpdateMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/mymove_api.go b/pkg/gen/adminapi/adminoperations/mymove_api.go deleted file mode 100644 index e2ed2892e29..00000000000 --- a/pkg/gen/adminapi/adminoperations/mymove_api.go +++ /dev/null @@ -1,741 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminoperations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/admin_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/client_certificates" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/electronic_orders" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/moves" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/notifications" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/office_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/organizations" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_file" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_files" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/requested_office_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/transportation_offices" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/uploads" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/user" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/webhook_subscriptions" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - - JSONProducer: runtime.JSONProducer(), - - AdminUsersCreateAdminUserHandler: admin_users.CreateAdminUserHandlerFunc(func(params admin_users.CreateAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.CreateAdminUser has not yet been implemented") - }), - ClientCertificatesCreateClientCertificateHandler: client_certificates.CreateClientCertificateHandlerFunc(func(params client_certificates.CreateClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.CreateClientCertificate has not yet been implemented") - }), - OfficeUsersCreateOfficeUserHandler: office_users.CreateOfficeUserHandlerFunc(func(params office_users.CreateOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.CreateOfficeUser has not yet been implemented") - }), - WebhookSubscriptionsCreateWebhookSubscriptionHandler: webhook_subscriptions.CreateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.CreateWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.CreateWebhookSubscription has not yet been implemented") - }), - AdminUsersGetAdminUserHandler: admin_users.GetAdminUserHandlerFunc(func(params admin_users.GetAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.GetAdminUser has not yet been implemented") - }), - ClientCertificatesGetClientCertificateHandler: client_certificates.GetClientCertificateHandlerFunc(func(params client_certificates.GetClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.GetClientCertificate has not yet been implemented") - }), - ElectronicOrdersGetElectronicOrdersTotalsHandler: electronic_orders.GetElectronicOrdersTotalsHandlerFunc(func(params electronic_orders.GetElectronicOrdersTotalsParams) middleware.Responder { - return middleware.NotImplemented("operation electronic_orders.GetElectronicOrdersTotals has not yet been implemented") - }), - UserGetLoggedInAdminUserHandler: user.GetLoggedInAdminUserHandlerFunc(func(params user.GetLoggedInAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation user.GetLoggedInAdminUser has not yet been implemented") - }), - MovesGetMoveHandler: moves.GetMoveHandlerFunc(func(params moves.GetMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.GetMove has not yet been implemented") - }), - TransportationOfficesGetOfficeByIDHandler: transportation_offices.GetOfficeByIDHandlerFunc(func(params transportation_offices.GetOfficeByIDParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.GetOfficeByID has not yet been implemented") - }), - OfficeUsersGetOfficeUserHandler: office_users.GetOfficeUserHandlerFunc(func(params office_users.GetOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.GetOfficeUser has not yet been implemented") - }), - RequestedOfficeUsersGetRequestedOfficeUserHandler: requested_office_users.GetRequestedOfficeUserHandlerFunc(func(params requested_office_users.GetRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.GetRequestedOfficeUser has not yet been implemented") - }), - UploadsGetUploadHandler: uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") - }), - UsersGetUserHandler: users.GetUserHandlerFunc(func(params users.GetUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.GetUser has not yet been implemented") - }), - WebhookSubscriptionsGetWebhookSubscriptionHandler: webhook_subscriptions.GetWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.GetWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.GetWebhookSubscription has not yet been implemented") - }), - AdminUsersIndexAdminUsersHandler: admin_users.IndexAdminUsersHandlerFunc(func(params admin_users.IndexAdminUsersParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.IndexAdminUsers has not yet been implemented") - }), - ClientCertificatesIndexClientCertificatesHandler: client_certificates.IndexClientCertificatesHandlerFunc(func(params client_certificates.IndexClientCertificatesParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.IndexClientCertificates has not yet been implemented") - }), - ElectronicOrdersIndexElectronicOrdersHandler: electronic_orders.IndexElectronicOrdersHandlerFunc(func(params electronic_orders.IndexElectronicOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation electronic_orders.IndexElectronicOrders has not yet been implemented") - }), - MovesIndexMovesHandler: moves.IndexMovesHandlerFunc(func(params moves.IndexMovesParams) middleware.Responder { - return middleware.NotImplemented("operation moves.IndexMoves has not yet been implemented") - }), - NotificationsIndexNotificationsHandler: notifications.IndexNotificationsHandlerFunc(func(params notifications.IndexNotificationsParams) middleware.Responder { - return middleware.NotImplemented("operation notifications.IndexNotifications has not yet been implemented") - }), - OfficeUsersIndexOfficeUsersHandler: office_users.IndexOfficeUsersHandlerFunc(func(params office_users.IndexOfficeUsersParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.IndexOfficeUsers has not yet been implemented") - }), - TransportationOfficesIndexOfficesHandler: transportation_offices.IndexOfficesHandlerFunc(func(params transportation_offices.IndexOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.IndexOffices has not yet been implemented") - }), - OrganizationsIndexOrganizationsHandler: organizations.IndexOrganizationsHandlerFunc(func(params organizations.IndexOrganizationsParams) middleware.Responder { - return middleware.NotImplemented("operation organizations.IndexOrganizations has not yet been implemented") - }), - PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler: payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandlerFunc(func(params payment_request_syncada_files.IndexPaymentRequestSyncadaFilesParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request_syncada_files.IndexPaymentRequestSyncadaFiles has not yet been implemented") - }), - RequestedOfficeUsersIndexRequestedOfficeUsersHandler: requested_office_users.IndexRequestedOfficeUsersHandlerFunc(func(params requested_office_users.IndexRequestedOfficeUsersParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.IndexRequestedOfficeUsers has not yet been implemented") - }), - UsersIndexUsersHandler: users.IndexUsersHandlerFunc(func(params users.IndexUsersParams) middleware.Responder { - return middleware.NotImplemented("operation users.IndexUsers has not yet been implemented") - }), - WebhookSubscriptionsIndexWebhookSubscriptionsHandler: webhook_subscriptions.IndexWebhookSubscriptionsHandlerFunc(func(params webhook_subscriptions.IndexWebhookSubscriptionsParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.IndexWebhookSubscriptions has not yet been implemented") - }), - PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler: payment_request_syncada_file.PaymentRequestSyncadaFileHandlerFunc(func(params payment_request_syncada_file.PaymentRequestSyncadaFileParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request_syncada_file.PaymentRequestSyncadaFile has not yet been implemented") - }), - ClientCertificatesRemoveClientCertificateHandler: client_certificates.RemoveClientCertificateHandlerFunc(func(params client_certificates.RemoveClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.RemoveClientCertificate has not yet been implemented") - }), - AdminUsersUpdateAdminUserHandler: admin_users.UpdateAdminUserHandlerFunc(func(params admin_users.UpdateAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.UpdateAdminUser has not yet been implemented") - }), - ClientCertificatesUpdateClientCertificateHandler: client_certificates.UpdateClientCertificateHandlerFunc(func(params client_certificates.UpdateClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.UpdateClientCertificate has not yet been implemented") - }), - MovesUpdateMoveHandler: moves.UpdateMoveHandlerFunc(func(params moves.UpdateMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.UpdateMove has not yet been implemented") - }), - OfficeUsersUpdateOfficeUserHandler: office_users.UpdateOfficeUserHandlerFunc(func(params office_users.UpdateOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.UpdateOfficeUser has not yet been implemented") - }), - RequestedOfficeUsersUpdateRequestedOfficeUserHandler: requested_office_users.UpdateRequestedOfficeUserHandlerFunc(func(params requested_office_users.UpdateRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.UpdateRequestedOfficeUser has not yet been implemented") - }), - UsersUpdateUserHandler: users.UpdateUserHandlerFunc(func(params users.UpdateUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.UpdateUser has not yet been implemented") - }), - WebhookSubscriptionsUpdateWebhookSubscriptionHandler: webhook_subscriptions.UpdateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.UpdateWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.UpdateWebhookSubscription has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Admin API is a RESTful API that enables the Admin application for MilMove. - -All endpoints are located under `/admin/v1`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // AdminUsersCreateAdminUserHandler sets the operation handler for the create admin user operation - AdminUsersCreateAdminUserHandler admin_users.CreateAdminUserHandler - // ClientCertificatesCreateClientCertificateHandler sets the operation handler for the create client certificate operation - ClientCertificatesCreateClientCertificateHandler client_certificates.CreateClientCertificateHandler - // OfficeUsersCreateOfficeUserHandler sets the operation handler for the create office user operation - OfficeUsersCreateOfficeUserHandler office_users.CreateOfficeUserHandler - // WebhookSubscriptionsCreateWebhookSubscriptionHandler sets the operation handler for the create webhook subscription operation - WebhookSubscriptionsCreateWebhookSubscriptionHandler webhook_subscriptions.CreateWebhookSubscriptionHandler - // AdminUsersGetAdminUserHandler sets the operation handler for the get admin user operation - AdminUsersGetAdminUserHandler admin_users.GetAdminUserHandler - // ClientCertificatesGetClientCertificateHandler sets the operation handler for the get client certificate operation - ClientCertificatesGetClientCertificateHandler client_certificates.GetClientCertificateHandler - // ElectronicOrdersGetElectronicOrdersTotalsHandler sets the operation handler for the get electronic orders totals operation - ElectronicOrdersGetElectronicOrdersTotalsHandler electronic_orders.GetElectronicOrdersTotalsHandler - // UserGetLoggedInAdminUserHandler sets the operation handler for the get logged in admin user operation - UserGetLoggedInAdminUserHandler user.GetLoggedInAdminUserHandler - // MovesGetMoveHandler sets the operation handler for the get move operation - MovesGetMoveHandler moves.GetMoveHandler - // TransportationOfficesGetOfficeByIDHandler sets the operation handler for the get office by Id operation - TransportationOfficesGetOfficeByIDHandler transportation_offices.GetOfficeByIDHandler - // OfficeUsersGetOfficeUserHandler sets the operation handler for the get office user operation - OfficeUsersGetOfficeUserHandler office_users.GetOfficeUserHandler - // RequestedOfficeUsersGetRequestedOfficeUserHandler sets the operation handler for the get requested office user operation - RequestedOfficeUsersGetRequestedOfficeUserHandler requested_office_users.GetRequestedOfficeUserHandler - // UploadsGetUploadHandler sets the operation handler for the get upload operation - UploadsGetUploadHandler uploads.GetUploadHandler - // UsersGetUserHandler sets the operation handler for the get user operation - UsersGetUserHandler users.GetUserHandler - // WebhookSubscriptionsGetWebhookSubscriptionHandler sets the operation handler for the get webhook subscription operation - WebhookSubscriptionsGetWebhookSubscriptionHandler webhook_subscriptions.GetWebhookSubscriptionHandler - // AdminUsersIndexAdminUsersHandler sets the operation handler for the index admin users operation - AdminUsersIndexAdminUsersHandler admin_users.IndexAdminUsersHandler - // ClientCertificatesIndexClientCertificatesHandler sets the operation handler for the index client certificates operation - ClientCertificatesIndexClientCertificatesHandler client_certificates.IndexClientCertificatesHandler - // ElectronicOrdersIndexElectronicOrdersHandler sets the operation handler for the index electronic orders operation - ElectronicOrdersIndexElectronicOrdersHandler electronic_orders.IndexElectronicOrdersHandler - // MovesIndexMovesHandler sets the operation handler for the index moves operation - MovesIndexMovesHandler moves.IndexMovesHandler - // NotificationsIndexNotificationsHandler sets the operation handler for the index notifications operation - NotificationsIndexNotificationsHandler notifications.IndexNotificationsHandler - // OfficeUsersIndexOfficeUsersHandler sets the operation handler for the index office users operation - OfficeUsersIndexOfficeUsersHandler office_users.IndexOfficeUsersHandler - // TransportationOfficesIndexOfficesHandler sets the operation handler for the index offices operation - TransportationOfficesIndexOfficesHandler transportation_offices.IndexOfficesHandler - // OrganizationsIndexOrganizationsHandler sets the operation handler for the index organizations operation - OrganizationsIndexOrganizationsHandler organizations.IndexOrganizationsHandler - // PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler sets the operation handler for the index payment request syncada files operation - PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandler - // RequestedOfficeUsersIndexRequestedOfficeUsersHandler sets the operation handler for the index requested office users operation - RequestedOfficeUsersIndexRequestedOfficeUsersHandler requested_office_users.IndexRequestedOfficeUsersHandler - // UsersIndexUsersHandler sets the operation handler for the index users operation - UsersIndexUsersHandler users.IndexUsersHandler - // WebhookSubscriptionsIndexWebhookSubscriptionsHandler sets the operation handler for the index webhook subscriptions operation - WebhookSubscriptionsIndexWebhookSubscriptionsHandler webhook_subscriptions.IndexWebhookSubscriptionsHandler - // PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler sets the operation handler for the payment request syncada file operation - PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler payment_request_syncada_file.PaymentRequestSyncadaFileHandler - // ClientCertificatesRemoveClientCertificateHandler sets the operation handler for the remove client certificate operation - ClientCertificatesRemoveClientCertificateHandler client_certificates.RemoveClientCertificateHandler - // AdminUsersUpdateAdminUserHandler sets the operation handler for the update admin user operation - AdminUsersUpdateAdminUserHandler admin_users.UpdateAdminUserHandler - // ClientCertificatesUpdateClientCertificateHandler sets the operation handler for the update client certificate operation - ClientCertificatesUpdateClientCertificateHandler client_certificates.UpdateClientCertificateHandler - // MovesUpdateMoveHandler sets the operation handler for the update move operation - MovesUpdateMoveHandler moves.UpdateMoveHandler - // OfficeUsersUpdateOfficeUserHandler sets the operation handler for the update office user operation - OfficeUsersUpdateOfficeUserHandler office_users.UpdateOfficeUserHandler - // RequestedOfficeUsersUpdateRequestedOfficeUserHandler sets the operation handler for the update requested office user operation - RequestedOfficeUsersUpdateRequestedOfficeUserHandler requested_office_users.UpdateRequestedOfficeUserHandler - // UsersUpdateUserHandler sets the operation handler for the update user operation - UsersUpdateUserHandler users.UpdateUserHandler - // WebhookSubscriptionsUpdateWebhookSubscriptionHandler sets the operation handler for the update webhook subscription operation - WebhookSubscriptionsUpdateWebhookSubscriptionHandler webhook_subscriptions.UpdateWebhookSubscriptionHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.AdminUsersCreateAdminUserHandler == nil { - unregistered = append(unregistered, "admin_users.CreateAdminUserHandler") - } - if o.ClientCertificatesCreateClientCertificateHandler == nil { - unregistered = append(unregistered, "client_certificates.CreateClientCertificateHandler") - } - if o.OfficeUsersCreateOfficeUserHandler == nil { - unregistered = append(unregistered, "office_users.CreateOfficeUserHandler") - } - if o.WebhookSubscriptionsCreateWebhookSubscriptionHandler == nil { - unregistered = append(unregistered, "webhook_subscriptions.CreateWebhookSubscriptionHandler") - } - if o.AdminUsersGetAdminUserHandler == nil { - unregistered = append(unregistered, "admin_users.GetAdminUserHandler") - } - if o.ClientCertificatesGetClientCertificateHandler == nil { - unregistered = append(unregistered, "client_certificates.GetClientCertificateHandler") - } - if o.ElectronicOrdersGetElectronicOrdersTotalsHandler == nil { - unregistered = append(unregistered, "electronic_orders.GetElectronicOrdersTotalsHandler") - } - if o.UserGetLoggedInAdminUserHandler == nil { - unregistered = append(unregistered, "user.GetLoggedInAdminUserHandler") - } - if o.MovesGetMoveHandler == nil { - unregistered = append(unregistered, "moves.GetMoveHandler") - } - if o.TransportationOfficesGetOfficeByIDHandler == nil { - unregistered = append(unregistered, "transportation_offices.GetOfficeByIDHandler") - } - if o.OfficeUsersGetOfficeUserHandler == nil { - unregistered = append(unregistered, "office_users.GetOfficeUserHandler") - } - if o.RequestedOfficeUsersGetRequestedOfficeUserHandler == nil { - unregistered = append(unregistered, "requested_office_users.GetRequestedOfficeUserHandler") - } - if o.UploadsGetUploadHandler == nil { - unregistered = append(unregistered, "uploads.GetUploadHandler") - } - if o.UsersGetUserHandler == nil { - unregistered = append(unregistered, "users.GetUserHandler") - } - if o.WebhookSubscriptionsGetWebhookSubscriptionHandler == nil { - unregistered = append(unregistered, "webhook_subscriptions.GetWebhookSubscriptionHandler") - } - if o.AdminUsersIndexAdminUsersHandler == nil { - unregistered = append(unregistered, "admin_users.IndexAdminUsersHandler") - } - if o.ClientCertificatesIndexClientCertificatesHandler == nil { - unregistered = append(unregistered, "client_certificates.IndexClientCertificatesHandler") - } - if o.ElectronicOrdersIndexElectronicOrdersHandler == nil { - unregistered = append(unregistered, "electronic_orders.IndexElectronicOrdersHandler") - } - if o.MovesIndexMovesHandler == nil { - unregistered = append(unregistered, "moves.IndexMovesHandler") - } - if o.NotificationsIndexNotificationsHandler == nil { - unregistered = append(unregistered, "notifications.IndexNotificationsHandler") - } - if o.OfficeUsersIndexOfficeUsersHandler == nil { - unregistered = append(unregistered, "office_users.IndexOfficeUsersHandler") - } - if o.TransportationOfficesIndexOfficesHandler == nil { - unregistered = append(unregistered, "transportation_offices.IndexOfficesHandler") - } - if o.OrganizationsIndexOrganizationsHandler == nil { - unregistered = append(unregistered, "organizations.IndexOrganizationsHandler") - } - if o.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler == nil { - unregistered = append(unregistered, "payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandler") - } - if o.RequestedOfficeUsersIndexRequestedOfficeUsersHandler == nil { - unregistered = append(unregistered, "requested_office_users.IndexRequestedOfficeUsersHandler") - } - if o.UsersIndexUsersHandler == nil { - unregistered = append(unregistered, "users.IndexUsersHandler") - } - if o.WebhookSubscriptionsIndexWebhookSubscriptionsHandler == nil { - unregistered = append(unregistered, "webhook_subscriptions.IndexWebhookSubscriptionsHandler") - } - if o.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler == nil { - unregistered = append(unregistered, "payment_request_syncada_file.PaymentRequestSyncadaFileHandler") - } - if o.ClientCertificatesRemoveClientCertificateHandler == nil { - unregistered = append(unregistered, "client_certificates.RemoveClientCertificateHandler") - } - if o.AdminUsersUpdateAdminUserHandler == nil { - unregistered = append(unregistered, "admin_users.UpdateAdminUserHandler") - } - if o.ClientCertificatesUpdateClientCertificateHandler == nil { - unregistered = append(unregistered, "client_certificates.UpdateClientCertificateHandler") - } - if o.MovesUpdateMoveHandler == nil { - unregistered = append(unregistered, "moves.UpdateMoveHandler") - } - if o.OfficeUsersUpdateOfficeUserHandler == nil { - unregistered = append(unregistered, "office_users.UpdateOfficeUserHandler") - } - if o.RequestedOfficeUsersUpdateRequestedOfficeUserHandler == nil { - unregistered = append(unregistered, "requested_office_users.UpdateRequestedOfficeUserHandler") - } - if o.UsersUpdateUserHandler == nil { - unregistered = append(unregistered, "users.UpdateUserHandler") - } - if o.WebhookSubscriptionsUpdateWebhookSubscriptionHandler == nil { - unregistered = append(unregistered, "webhook_subscriptions.UpdateWebhookSubscriptionHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/admin-users"] = admin_users.NewCreateAdminUser(o.context, o.AdminUsersCreateAdminUserHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/client-certificates"] = client_certificates.NewCreateClientCertificate(o.context, o.ClientCertificatesCreateClientCertificateHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/office-users"] = office_users.NewCreateOfficeUser(o.context, o.OfficeUsersCreateOfficeUserHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/webhook-subscriptions"] = webhook_subscriptions.NewCreateWebhookSubscription(o.context, o.WebhookSubscriptionsCreateWebhookSubscriptionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/admin-users/{adminUserId}"] = admin_users.NewGetAdminUser(o.context, o.AdminUsersGetAdminUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewGetClientCertificate(o.context, o.ClientCertificatesGetClientCertificateHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/electronic-orders/totals"] = electronic_orders.NewGetElectronicOrdersTotals(o.context, o.ElectronicOrdersGetElectronicOrdersTotalsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/user"] = user.NewGetLoggedInAdminUser(o.context, o.UserGetLoggedInAdminUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveID}"] = moves.NewGetMove(o.context, o.MovesGetMoveHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/offices/{officeId}"] = transportation_offices.NewGetOfficeByID(o.context, o.TransportationOfficesGetOfficeByIDHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/office-users/{officeUserId}"] = office_users.NewGetOfficeUser(o.context, o.OfficeUsersGetOfficeUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/requested-office-users/{officeUserId}"] = requested_office_users.NewGetRequestedOfficeUser(o.context, o.RequestedOfficeUsersGetRequestedOfficeUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/uploads/{uploadId}"] = uploads.NewGetUpload(o.context, o.UploadsGetUploadHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/users/{userId}"] = users.NewGetUser(o.context, o.UsersGetUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/webhook-subscriptions/{webhookSubscriptionId}"] = webhook_subscriptions.NewGetWebhookSubscription(o.context, o.WebhookSubscriptionsGetWebhookSubscriptionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/admin-users"] = admin_users.NewIndexAdminUsers(o.context, o.AdminUsersIndexAdminUsersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/client-certificates"] = client_certificates.NewIndexClientCertificates(o.context, o.ClientCertificatesIndexClientCertificatesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/electronic-orders"] = electronic_orders.NewIndexElectronicOrders(o.context, o.ElectronicOrdersIndexElectronicOrdersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves"] = moves.NewIndexMoves(o.context, o.MovesIndexMovesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/notifications"] = notifications.NewIndexNotifications(o.context, o.NotificationsIndexNotificationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/office-users"] = office_users.NewIndexOfficeUsers(o.context, o.OfficeUsersIndexOfficeUsersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/offices"] = transportation_offices.NewIndexOffices(o.context, o.TransportationOfficesIndexOfficesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/organizations"] = organizations.NewIndexOrganizations(o.context, o.OrganizationsIndexOrganizationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-request-syncada-files"] = payment_request_syncada_files.NewIndexPaymentRequestSyncadaFiles(o.context, o.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/requested-office-users"] = requested_office_users.NewIndexRequestedOfficeUsers(o.context, o.RequestedOfficeUsersIndexRequestedOfficeUsersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/users"] = users.NewIndexUsers(o.context, o.UsersIndexUsersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/webhook-subscriptions"] = webhook_subscriptions.NewIndexWebhookSubscriptions(o.context, o.WebhookSubscriptionsIndexWebhookSubscriptionsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-request-syncada-files/{paymentRequestSyncadaFileId}"] = payment_request_syncada_file.NewPaymentRequestSyncadaFile(o.context, o.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewRemoveClientCertificate(o.context, o.ClientCertificatesRemoveClientCertificateHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/admin-users/{adminUserId}"] = admin_users.NewUpdateAdminUser(o.context, o.AdminUsersUpdateAdminUserHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewUpdateClientCertificate(o.context, o.ClientCertificatesUpdateClientCertificateHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveID}"] = moves.NewUpdateMove(o.context, o.MovesUpdateMoveHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/office-users/{officeUserId}"] = office_users.NewUpdateOfficeUser(o.context, o.OfficeUsersUpdateOfficeUserHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/requested-office-users/{officeUserId}"] = requested_office_users.NewUpdateRequestedOfficeUser(o.context, o.RequestedOfficeUsersUpdateRequestedOfficeUserHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/users/{userId}"] = users.NewUpdateUser(o.context, o.UsersUpdateUserHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/webhook-subscriptions/{webhookSubscriptionId}"] = webhook_subscriptions.NewUpdateWebhookSubscription(o.context, o.WebhookSubscriptionsUpdateWebhookSubscriptionHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go deleted file mode 100644 index ed0d2c255f7..00000000000 --- a/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package notifications - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexNotificationsHandlerFunc turns a function with the right signature into a index notifications handler -type IndexNotificationsHandlerFunc func(IndexNotificationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexNotificationsHandlerFunc) Handle(params IndexNotificationsParams) middleware.Responder { - return fn(params) -} - -// IndexNotificationsHandler interface for that can handle valid index notifications params -type IndexNotificationsHandler interface { - Handle(IndexNotificationsParams) middleware.Responder -} - -// NewIndexNotifications creates a new http.Handler for the index notifications operation -func NewIndexNotifications(ctx *middleware.Context, handler IndexNotificationsHandler) *IndexNotifications { - return &IndexNotifications{Context: ctx, Handler: handler} -} - -/* - IndexNotifications swagger:route GET /notifications Notifications indexNotifications - -# List Notifications - -This endpoint returns a list of Notifications that have been sent to Service -Members. Do not use this endpoint directly as it is meant to be used with the -Admin UI exclusively. -*/ -type IndexNotifications struct { - Context *middleware.Context - Handler IndexNotificationsHandler -} - -func (o *IndexNotifications) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexNotificationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go deleted file mode 100644 index 073d74291be..00000000000 --- a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package notifications - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexNotificationsParams creates a new IndexNotificationsParams object -// -// There are no default values defined in the spec. -func NewIndexNotificationsParams() IndexNotificationsParams { - - return IndexNotificationsParams{} -} - -// IndexNotificationsParams contains all the bound params for the index notifications operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexNotifications -type IndexNotificationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexNotificationsParams() beforehand. -func (o *IndexNotificationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexNotificationsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexNotificationsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexNotificationsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexNotificationsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexNotificationsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go deleted file mode 100644 index 6c25b154c6f..00000000000 --- a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package notifications - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexNotificationsOKCode is the HTTP code returned for type IndexNotificationsOK -const IndexNotificationsOKCode int = 200 - -/* -IndexNotificationsOK success - -swagger:response indexNotificationsOK -*/ -type IndexNotificationsOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.Notifications `json:"body,omitempty"` -} - -// NewIndexNotificationsOK creates IndexNotificationsOK with default headers values -func NewIndexNotificationsOK() *IndexNotificationsOK { - - return &IndexNotificationsOK{} -} - -// WithContentRange adds the contentRange to the index notifications o k response -func (o *IndexNotificationsOK) WithContentRange(contentRange string) *IndexNotificationsOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index notifications o k response -func (o *IndexNotificationsOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index notifications o k response -func (o *IndexNotificationsOK) WithPayload(payload adminmessages.Notifications) *IndexNotificationsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index notifications o k response -func (o *IndexNotificationsOK) SetPayload(payload adminmessages.Notifications) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexNotificationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.Notifications{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexNotificationsBadRequestCode is the HTTP code returned for type IndexNotificationsBadRequest -const IndexNotificationsBadRequestCode int = 400 - -/* -IndexNotificationsBadRequest invalid request - -swagger:response indexNotificationsBadRequest -*/ -type IndexNotificationsBadRequest struct { -} - -// NewIndexNotificationsBadRequest creates IndexNotificationsBadRequest with default headers values -func NewIndexNotificationsBadRequest() *IndexNotificationsBadRequest { - - return &IndexNotificationsBadRequest{} -} - -// WriteResponse to the client -func (o *IndexNotificationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexNotificationsUnauthorizedCode is the HTTP code returned for type IndexNotificationsUnauthorized -const IndexNotificationsUnauthorizedCode int = 401 - -/* -IndexNotificationsUnauthorized request requires user authentication - -swagger:response indexNotificationsUnauthorized -*/ -type IndexNotificationsUnauthorized struct { -} - -// NewIndexNotificationsUnauthorized creates IndexNotificationsUnauthorized with default headers values -func NewIndexNotificationsUnauthorized() *IndexNotificationsUnauthorized { - - return &IndexNotificationsUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexNotificationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexNotificationsNotFoundCode is the HTTP code returned for type IndexNotificationsNotFound -const IndexNotificationsNotFoundCode int = 404 - -/* -IndexNotificationsNotFound Notifications not found - -swagger:response indexNotificationsNotFound -*/ -type IndexNotificationsNotFound struct { -} - -// NewIndexNotificationsNotFound creates IndexNotificationsNotFound with default headers values -func NewIndexNotificationsNotFound() *IndexNotificationsNotFound { - - return &IndexNotificationsNotFound{} -} - -// WriteResponse to the client -func (o *IndexNotificationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexNotificationsInternalServerErrorCode is the HTTP code returned for type IndexNotificationsInternalServerError -const IndexNotificationsInternalServerErrorCode int = 500 - -/* -IndexNotificationsInternalServerError server error - -swagger:response indexNotificationsInternalServerError -*/ -type IndexNotificationsInternalServerError struct { -} - -// NewIndexNotificationsInternalServerError creates IndexNotificationsInternalServerError with default headers values -func NewIndexNotificationsInternalServerError() *IndexNotificationsInternalServerError { - - return &IndexNotificationsInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexNotificationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go deleted file mode 100644 index bf720a5a1a6..00000000000 --- a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package notifications - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexNotificationsURL generates an URL for the index notifications operation -type IndexNotificationsURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexNotificationsURL) WithBasePath(bp string) *IndexNotificationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexNotificationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexNotificationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/notifications" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexNotificationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexNotificationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexNotificationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexNotificationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexNotificationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexNotificationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go deleted file mode 100644 index e897a55842d..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateOfficeUserHandlerFunc turns a function with the right signature into a create office user handler -type CreateOfficeUserHandlerFunc func(CreateOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateOfficeUserHandlerFunc) Handle(params CreateOfficeUserParams) middleware.Responder { - return fn(params) -} - -// CreateOfficeUserHandler interface for that can handle valid create office user params -type CreateOfficeUserHandler interface { - Handle(CreateOfficeUserParams) middleware.Responder -} - -// NewCreateOfficeUser creates a new http.Handler for the create office user operation -func NewCreateOfficeUser(ctx *middleware.Context, handler CreateOfficeUserHandler) *CreateOfficeUser { - return &CreateOfficeUser{Context: ctx, Handler: handler} -} - -/* - CreateOfficeUser swagger:route POST /office-users Office users createOfficeUser - -# Create an Office User - -This endpoint creates an Office User record and returns the created record in -the `201` response. If there are issues with the Office User information -provided a `422` response will occur with information about invalid fields and -additional details. Do not use this endpoint directly as it is meant to be used -with the Admin UI exclusively. -*/ -type CreateOfficeUser struct { - Context *middleware.Context - Handler CreateOfficeUserHandler -} - -func (o *CreateOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go deleted file mode 100644 index d6185c068cd..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewCreateOfficeUserParams creates a new CreateOfficeUserParams object -// -// There are no default values defined in the spec. -func NewCreateOfficeUserParams() CreateOfficeUserParams { - - return CreateOfficeUserParams{} -} - -// CreateOfficeUserParams contains all the bound params for the create office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters createOfficeUser -type CreateOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Office User information - In: body - */ - OfficeUser *adminmessages.OfficeUserCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateOfficeUserParams() beforehand. -func (o *CreateOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.OfficeUserCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("officeUser", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.OfficeUser = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go deleted file mode 100644 index 8451a3cdc58..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// CreateOfficeUserCreatedCode is the HTTP code returned for type CreateOfficeUserCreated -const CreateOfficeUserCreatedCode int = 201 - -/* -CreateOfficeUserCreated Successfully created Office User - -swagger:response createOfficeUserCreated -*/ -type CreateOfficeUserCreated struct { - - /* - In: Body - */ - Payload *adminmessages.OfficeUser `json:"body,omitempty"` -} - -// NewCreateOfficeUserCreated creates CreateOfficeUserCreated with default headers values -func NewCreateOfficeUserCreated() *CreateOfficeUserCreated { - - return &CreateOfficeUserCreated{} -} - -// WithPayload adds the payload to the create office user created response -func (o *CreateOfficeUserCreated) WithPayload(payload *adminmessages.OfficeUser) *CreateOfficeUserCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create office user created response -func (o *CreateOfficeUserCreated) SetPayload(payload *adminmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateOfficeUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateOfficeUserUnprocessableEntityCode is the HTTP code returned for type CreateOfficeUserUnprocessableEntity -const CreateOfficeUserUnprocessableEntityCode int = 422 - -/* -CreateOfficeUserUnprocessableEntity validation error - -swagger:response createOfficeUserUnprocessableEntity -*/ -type CreateOfficeUserUnprocessableEntity struct { - - /* - In: Body - */ - Payload *adminmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateOfficeUserUnprocessableEntity creates CreateOfficeUserUnprocessableEntity with default headers values -func NewCreateOfficeUserUnprocessableEntity() *CreateOfficeUserUnprocessableEntity { - - return &CreateOfficeUserUnprocessableEntity{} -} - -// WithPayload adds the payload to the create office user unprocessable entity response -func (o *CreateOfficeUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *CreateOfficeUserUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create office user unprocessable entity response -func (o *CreateOfficeUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateOfficeUserInternalServerErrorCode is the HTTP code returned for type CreateOfficeUserInternalServerError -const CreateOfficeUserInternalServerErrorCode int = 500 - -/* -CreateOfficeUserInternalServerError internal server error - -swagger:response createOfficeUserInternalServerError -*/ -type CreateOfficeUserInternalServerError struct { -} - -// NewCreateOfficeUserInternalServerError creates CreateOfficeUserInternalServerError with default headers values -func NewCreateOfficeUserInternalServerError() *CreateOfficeUserInternalServerError { - - return &CreateOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go deleted file mode 100644 index 33cfe5f1232..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateOfficeUserURL generates an URL for the create office user operation -type CreateOfficeUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOfficeUserURL) WithBasePath(bp string) *CreateOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/office-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go deleted file mode 100644 index 9e17eaf2b8d..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetOfficeUserHandlerFunc turns a function with the right signature into a get office user handler -type GetOfficeUserHandlerFunc func(GetOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetOfficeUserHandlerFunc) Handle(params GetOfficeUserParams) middleware.Responder { - return fn(params) -} - -// GetOfficeUserHandler interface for that can handle valid get office user params -type GetOfficeUserHandler interface { - Handle(GetOfficeUserParams) middleware.Responder -} - -// NewGetOfficeUser creates a new http.Handler for the get office user operation -func NewGetOfficeUser(ctx *middleware.Context, handler GetOfficeUserHandler) *GetOfficeUser { - return &GetOfficeUser{Context: ctx, Handler: handler} -} - -/* - GetOfficeUser swagger:route GET /office-users/{officeUserId} Office users getOfficeUser - -# Get an Office User - -This endpoint returns a single Office User by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type GetOfficeUser struct { - Context *middleware.Context - Handler GetOfficeUserHandler -} - -func (o *GetOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go deleted file mode 100644 index 3d91ef00de0..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetOfficeUserParams creates a new GetOfficeUserParams object -// -// There are no default values defined in the spec. -func NewGetOfficeUserParams() GetOfficeUserParams { - - return GetOfficeUserParams{} -} - -// GetOfficeUserParams contains all the bound params for the get office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters getOfficeUser -type GetOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - OfficeUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetOfficeUserParams() beforehand. -func (o *GetOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") - if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeUserID binds and validates parameter OfficeUserID from path. -func (o *GetOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) - } - o.OfficeUserID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeUserID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeUserID carries on validations for parameter OfficeUserID -func (o *GetOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go deleted file mode 100644 index 7d5cc7c6fdc..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetOfficeUserOKCode is the HTTP code returned for type GetOfficeUserOK -const GetOfficeUserOKCode int = 200 - -/* -GetOfficeUserOK success - -swagger:response getOfficeUserOK -*/ -type GetOfficeUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.OfficeUser `json:"body,omitempty"` -} - -// NewGetOfficeUserOK creates GetOfficeUserOK with default headers values -func NewGetOfficeUserOK() *GetOfficeUserOK { - - return &GetOfficeUserOK{} -} - -// WithPayload adds the payload to the get office user o k response -func (o *GetOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *GetOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get office user o k response -func (o *GetOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOfficeUserBadRequestCode is the HTTP code returned for type GetOfficeUserBadRequest -const GetOfficeUserBadRequestCode int = 400 - -/* -GetOfficeUserBadRequest invalid request - -swagger:response getOfficeUserBadRequest -*/ -type GetOfficeUserBadRequest struct { -} - -// NewGetOfficeUserBadRequest creates GetOfficeUserBadRequest with default headers values -func NewGetOfficeUserBadRequest() *GetOfficeUserBadRequest { - - return &GetOfficeUserBadRequest{} -} - -// WriteResponse to the client -func (o *GetOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetOfficeUserUnauthorizedCode is the HTTP code returned for type GetOfficeUserUnauthorized -const GetOfficeUserUnauthorizedCode int = 401 - -/* -GetOfficeUserUnauthorized request requires user authentication - -swagger:response getOfficeUserUnauthorized -*/ -type GetOfficeUserUnauthorized struct { -} - -// NewGetOfficeUserUnauthorized creates GetOfficeUserUnauthorized with default headers values -func NewGetOfficeUserUnauthorized() *GetOfficeUserUnauthorized { - - return &GetOfficeUserUnauthorized{} -} - -// WriteResponse to the client -func (o *GetOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetOfficeUserNotFoundCode is the HTTP code returned for type GetOfficeUserNotFound -const GetOfficeUserNotFoundCode int = 404 - -/* -GetOfficeUserNotFound Office User not found - -swagger:response getOfficeUserNotFound -*/ -type GetOfficeUserNotFound struct { -} - -// NewGetOfficeUserNotFound creates GetOfficeUserNotFound with default headers values -func NewGetOfficeUserNotFound() *GetOfficeUserNotFound { - - return &GetOfficeUserNotFound{} -} - -// WriteResponse to the client -func (o *GetOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetOfficeUserInternalServerErrorCode is the HTTP code returned for type GetOfficeUserInternalServerError -const GetOfficeUserInternalServerErrorCode int = 500 - -/* -GetOfficeUserInternalServerError server error - -swagger:response getOfficeUserInternalServerError -*/ -type GetOfficeUserInternalServerError struct { -} - -// NewGetOfficeUserInternalServerError creates GetOfficeUserInternalServerError with default headers values -func NewGetOfficeUserInternalServerError() *GetOfficeUserInternalServerError { - - return &GetOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *GetOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go deleted file mode 100644 index 39f1a8ab469..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetOfficeUserURL generates an URL for the get office user operation -type GetOfficeUserURL struct { - OfficeUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOfficeUserURL) WithBasePath(bp string) *GetOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/office-users/{officeUserId}" - - officeUserID := o.OfficeUserID.String() - if officeUserID != "" { - _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) - } else { - return nil, errors.New("officeUserId is required on GetOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go deleted file mode 100644 index d0378388347..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexOfficeUsersHandlerFunc turns a function with the right signature into a index office users handler -type IndexOfficeUsersHandlerFunc func(IndexOfficeUsersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexOfficeUsersHandlerFunc) Handle(params IndexOfficeUsersParams) middleware.Responder { - return fn(params) -} - -// IndexOfficeUsersHandler interface for that can handle valid index office users params -type IndexOfficeUsersHandler interface { - Handle(IndexOfficeUsersParams) middleware.Responder -} - -// NewIndexOfficeUsers creates a new http.Handler for the index office users operation -func NewIndexOfficeUsers(ctx *middleware.Context, handler IndexOfficeUsersHandler) *IndexOfficeUsers { - return &IndexOfficeUsers{Context: ctx, Handler: handler} -} - -/* - IndexOfficeUsers swagger:route GET /office-users Office users indexOfficeUsers - -# List of Office Users - -This endpoint returns a list of Office Users. Do not use this endpoint directly -as it is meant to be used with the Admin UI exclusively. -*/ -type IndexOfficeUsers struct { - Context *middleware.Context - Handler IndexOfficeUsersHandler -} - -func (o *IndexOfficeUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexOfficeUsersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go deleted file mode 100644 index 5d48f8cb168..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexOfficeUsersParams creates a new IndexOfficeUsersParams object -// -// There are no default values defined in the spec. -func NewIndexOfficeUsersParams() IndexOfficeUsersParams { - - return IndexOfficeUsersParams{} -} - -// IndexOfficeUsersParams contains all the bound params for the index office users operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexOfficeUsers -type IndexOfficeUsersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexOfficeUsersParams() beforehand. -func (o *IndexOfficeUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexOfficeUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexOfficeUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexOfficeUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexOfficeUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexOfficeUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go deleted file mode 100644 index 98fc5882712..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexOfficeUsersOKCode is the HTTP code returned for type IndexOfficeUsersOK -const IndexOfficeUsersOKCode int = 200 - -/* -IndexOfficeUsersOK success - -swagger:response indexOfficeUsersOK -*/ -type IndexOfficeUsersOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.OfficeUsers `json:"body,omitempty"` -} - -// NewIndexOfficeUsersOK creates IndexOfficeUsersOK with default headers values -func NewIndexOfficeUsersOK() *IndexOfficeUsersOK { - - return &IndexOfficeUsersOK{} -} - -// WithContentRange adds the contentRange to the index office users o k response -func (o *IndexOfficeUsersOK) WithContentRange(contentRange string) *IndexOfficeUsersOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index office users o k response -func (o *IndexOfficeUsersOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index office users o k response -func (o *IndexOfficeUsersOK) WithPayload(payload adminmessages.OfficeUsers) *IndexOfficeUsersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index office users o k response -func (o *IndexOfficeUsersOK) SetPayload(payload adminmessages.OfficeUsers) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexOfficeUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.OfficeUsers{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexOfficeUsersBadRequestCode is the HTTP code returned for type IndexOfficeUsersBadRequest -const IndexOfficeUsersBadRequestCode int = 400 - -/* -IndexOfficeUsersBadRequest invalid request - -swagger:response indexOfficeUsersBadRequest -*/ -type IndexOfficeUsersBadRequest struct { -} - -// NewIndexOfficeUsersBadRequest creates IndexOfficeUsersBadRequest with default headers values -func NewIndexOfficeUsersBadRequest() *IndexOfficeUsersBadRequest { - - return &IndexOfficeUsersBadRequest{} -} - -// WriteResponse to the client -func (o *IndexOfficeUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexOfficeUsersUnauthorizedCode is the HTTP code returned for type IndexOfficeUsersUnauthorized -const IndexOfficeUsersUnauthorizedCode int = 401 - -/* -IndexOfficeUsersUnauthorized request requires user authentication - -swagger:response indexOfficeUsersUnauthorized -*/ -type IndexOfficeUsersUnauthorized struct { -} - -// NewIndexOfficeUsersUnauthorized creates IndexOfficeUsersUnauthorized with default headers values -func NewIndexOfficeUsersUnauthorized() *IndexOfficeUsersUnauthorized { - - return &IndexOfficeUsersUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexOfficeUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexOfficeUsersNotFoundCode is the HTTP code returned for type IndexOfficeUsersNotFound -const IndexOfficeUsersNotFoundCode int = 404 - -/* -IndexOfficeUsersNotFound Office User not found - -swagger:response indexOfficeUsersNotFound -*/ -type IndexOfficeUsersNotFound struct { -} - -// NewIndexOfficeUsersNotFound creates IndexOfficeUsersNotFound with default headers values -func NewIndexOfficeUsersNotFound() *IndexOfficeUsersNotFound { - - return &IndexOfficeUsersNotFound{} -} - -// WriteResponse to the client -func (o *IndexOfficeUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexOfficeUsersInternalServerErrorCode is the HTTP code returned for type IndexOfficeUsersInternalServerError -const IndexOfficeUsersInternalServerErrorCode int = 500 - -/* -IndexOfficeUsersInternalServerError server error - -swagger:response indexOfficeUsersInternalServerError -*/ -type IndexOfficeUsersInternalServerError struct { -} - -// NewIndexOfficeUsersInternalServerError creates IndexOfficeUsersInternalServerError with default headers values -func NewIndexOfficeUsersInternalServerError() *IndexOfficeUsersInternalServerError { - - return &IndexOfficeUsersInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexOfficeUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go deleted file mode 100644 index c9c775c48ed..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexOfficeUsersURL generates an URL for the index office users operation -type IndexOfficeUsersURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOfficeUsersURL) WithBasePath(bp string) *IndexOfficeUsersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOfficeUsersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexOfficeUsersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/office-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexOfficeUsersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexOfficeUsersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexOfficeUsersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexOfficeUsersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexOfficeUsersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexOfficeUsersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go deleted file mode 100644 index 0849e68da77..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateOfficeUserHandlerFunc turns a function with the right signature into a update office user handler -type UpdateOfficeUserHandlerFunc func(UpdateOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateOfficeUserHandlerFunc) Handle(params UpdateOfficeUserParams) middleware.Responder { - return fn(params) -} - -// UpdateOfficeUserHandler interface for that can handle valid update office user params -type UpdateOfficeUserHandler interface { - Handle(UpdateOfficeUserParams) middleware.Responder -} - -// NewUpdateOfficeUser creates a new http.Handler for the update office user operation -func NewUpdateOfficeUser(ctx *middleware.Context, handler UpdateOfficeUserHandler) *UpdateOfficeUser { - return &UpdateOfficeUser{Context: ctx, Handler: handler} -} - -/* - UpdateOfficeUser swagger:route PATCH /office-users/{officeUserId} Office users updateOfficeUser - -# Updates an Office User - -This endpoint updates a single Office User by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type UpdateOfficeUser struct { - Context *middleware.Context - Handler UpdateOfficeUserHandler -} - -func (o *UpdateOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go deleted file mode 100644 index 414f49cf99b..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateOfficeUserParams creates a new UpdateOfficeUserParams object -// -// There are no default values defined in the spec. -func NewUpdateOfficeUserParams() UpdateOfficeUserParams { - - return UpdateOfficeUserParams{} -} - -// UpdateOfficeUserParams contains all the bound params for the update office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateOfficeUser -type UpdateOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Office User information - Required: true - In: body - */ - OfficeUser *adminmessages.OfficeUserUpdate - /* - Required: true - In: path - */ - OfficeUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateOfficeUserParams() beforehand. -func (o *UpdateOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.OfficeUserUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("officeUser", "body", "")) - } else { - res = append(res, errors.NewParseError("officeUser", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.OfficeUser = &body - } - } - } else { - res = append(res, errors.Required("officeUser", "body", "")) - } - - rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") - if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeUserID binds and validates parameter OfficeUserID from path. -func (o *UpdateOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) - } - o.OfficeUserID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeUserID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeUserID carries on validations for parameter OfficeUserID -func (o *UpdateOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go deleted file mode 100644 index bce64ffde3a..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateOfficeUserOKCode is the HTTP code returned for type UpdateOfficeUserOK -const UpdateOfficeUserOKCode int = 200 - -/* -UpdateOfficeUserOK Successfully updated Office User - -swagger:response updateOfficeUserOK -*/ -type UpdateOfficeUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.OfficeUser `json:"body,omitempty"` -} - -// NewUpdateOfficeUserOK creates UpdateOfficeUserOK with default headers values -func NewUpdateOfficeUserOK() *UpdateOfficeUserOK { - - return &UpdateOfficeUserOK{} -} - -// WithPayload adds the payload to the update office user o k response -func (o *UpdateOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *UpdateOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update office user o k response -func (o *UpdateOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOfficeUserBadRequestCode is the HTTP code returned for type UpdateOfficeUserBadRequest -const UpdateOfficeUserBadRequestCode int = 400 - -/* -UpdateOfficeUserBadRequest Invalid Request - -swagger:response updateOfficeUserBadRequest -*/ -type UpdateOfficeUserBadRequest struct { -} - -// NewUpdateOfficeUserBadRequest creates UpdateOfficeUserBadRequest with default headers values -func NewUpdateOfficeUserBadRequest() *UpdateOfficeUserBadRequest { - - return &UpdateOfficeUserBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateOfficeUserUnauthorizedCode is the HTTP code returned for type UpdateOfficeUserUnauthorized -const UpdateOfficeUserUnauthorizedCode int = 401 - -/* -UpdateOfficeUserUnauthorized Must be authenticated to use this end point - -swagger:response updateOfficeUserUnauthorized -*/ -type UpdateOfficeUserUnauthorized struct { -} - -// NewUpdateOfficeUserUnauthorized creates UpdateOfficeUserUnauthorized with default headers values -func NewUpdateOfficeUserUnauthorized() *UpdateOfficeUserUnauthorized { - - return &UpdateOfficeUserUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateOfficeUserForbiddenCode is the HTTP code returned for type UpdateOfficeUserForbidden -const UpdateOfficeUserForbiddenCode int = 403 - -/* -UpdateOfficeUserForbidden Not authorized to update an Office User - -swagger:response updateOfficeUserForbidden -*/ -type UpdateOfficeUserForbidden struct { -} - -// NewUpdateOfficeUserForbidden creates UpdateOfficeUserForbidden with default headers values -func NewUpdateOfficeUserForbidden() *UpdateOfficeUserForbidden { - - return &UpdateOfficeUserForbidden{} -} - -// WriteResponse to the client -func (o *UpdateOfficeUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateOfficeUserInternalServerError -const UpdateOfficeUserInternalServerErrorCode int = 500 - -/* -UpdateOfficeUserInternalServerError Server error - -swagger:response updateOfficeUserInternalServerError -*/ -type UpdateOfficeUserInternalServerError struct { -} - -// NewUpdateOfficeUserInternalServerError creates UpdateOfficeUserInternalServerError with default headers values -func NewUpdateOfficeUserInternalServerError() *UpdateOfficeUserInternalServerError { - - return &UpdateOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go deleted file mode 100644 index a65a776374c..00000000000 --- a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateOfficeUserURL generates an URL for the update office user operation -type UpdateOfficeUserURL struct { - OfficeUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOfficeUserURL) WithBasePath(bp string) *UpdateOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/office-users/{officeUserId}" - - officeUserID := o.OfficeUserID.String() - if officeUserID != "" { - _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) - } else { - return nil, errors.New("officeUserId is required on UpdateOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go deleted file mode 100644 index e3388257734..00000000000 --- a/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package organizations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexOrganizationsHandlerFunc turns a function with the right signature into a index organizations handler -type IndexOrganizationsHandlerFunc func(IndexOrganizationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexOrganizationsHandlerFunc) Handle(params IndexOrganizationsParams) middleware.Responder { - return fn(params) -} - -// IndexOrganizationsHandler interface for that can handle valid index organizations params -type IndexOrganizationsHandler interface { - Handle(IndexOrganizationsParams) middleware.Responder -} - -// NewIndexOrganizations creates a new http.Handler for the index organizations operation -func NewIndexOrganizations(ctx *middleware.Context, handler IndexOrganizationsHandler) *IndexOrganizations { - return &IndexOrganizations{Context: ctx, Handler: handler} -} - -/* - IndexOrganizations swagger:route GET /organizations Organizations indexOrganizations - -# List Organizations - -This endpoint returns a list of Organizations. Do not use this endpoint directly -as it is meant to be used with the Admin UI exclusively. -*/ -type IndexOrganizations struct { - Context *middleware.Context - Handler IndexOrganizationsHandler -} - -func (o *IndexOrganizations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexOrganizationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go deleted file mode 100644 index 13163956c76..00000000000 --- a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go +++ /dev/null @@ -1,210 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package organizations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexOrganizationsParams creates a new IndexOrganizationsParams object -// -// There are no default values defined in the spec. -func NewIndexOrganizationsParams() IndexOrganizationsParams { - - return IndexOrganizationsParams{} -} - -// IndexOrganizationsParams contains all the bound params for the index organizations operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexOrganizations -type IndexOrganizationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter []string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexOrganizationsParams() beforehand. -func (o *IndexOrganizationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates array parameter Filter from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *IndexOrganizationsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvFilter string - if len(rawData) > 0 { - qvFilter = rawData[len(rawData)-1] - } - - // CollectionFormat: - filterIC := swag.SplitByFormat(qvFilter, "") - if len(filterIC) == 0 { - return nil - } - - var filterIR []string - for _, filterIV := range filterIC { - filterI := filterIV - - filterIR = append(filterIR, filterI) - } - - o.Filter = filterIR - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexOrganizationsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexOrganizationsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexOrganizationsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexOrganizationsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go deleted file mode 100644 index 304283f2b85..00000000000 --- a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package organizations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexOrganizationsOKCode is the HTTP code returned for type IndexOrganizationsOK -const IndexOrganizationsOKCode int = 200 - -/* -IndexOrganizationsOK success - -swagger:response indexOrganizationsOK -*/ -type IndexOrganizationsOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.Organizations `json:"body,omitempty"` -} - -// NewIndexOrganizationsOK creates IndexOrganizationsOK with default headers values -func NewIndexOrganizationsOK() *IndexOrganizationsOK { - - return &IndexOrganizationsOK{} -} - -// WithContentRange adds the contentRange to the index organizations o k response -func (o *IndexOrganizationsOK) WithContentRange(contentRange string) *IndexOrganizationsOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index organizations o k response -func (o *IndexOrganizationsOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index organizations o k response -func (o *IndexOrganizationsOK) WithPayload(payload adminmessages.Organizations) *IndexOrganizationsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index organizations o k response -func (o *IndexOrganizationsOK) SetPayload(payload adminmessages.Organizations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexOrganizationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.Organizations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexOrganizationsBadRequestCode is the HTTP code returned for type IndexOrganizationsBadRequest -const IndexOrganizationsBadRequestCode int = 400 - -/* -IndexOrganizationsBadRequest invalid request - -swagger:response indexOrganizationsBadRequest -*/ -type IndexOrganizationsBadRequest struct { -} - -// NewIndexOrganizationsBadRequest creates IndexOrganizationsBadRequest with default headers values -func NewIndexOrganizationsBadRequest() *IndexOrganizationsBadRequest { - - return &IndexOrganizationsBadRequest{} -} - -// WriteResponse to the client -func (o *IndexOrganizationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexOrganizationsUnauthorizedCode is the HTTP code returned for type IndexOrganizationsUnauthorized -const IndexOrganizationsUnauthorizedCode int = 401 - -/* -IndexOrganizationsUnauthorized request requires user authentication - -swagger:response indexOrganizationsUnauthorized -*/ -type IndexOrganizationsUnauthorized struct { -} - -// NewIndexOrganizationsUnauthorized creates IndexOrganizationsUnauthorized with default headers values -func NewIndexOrganizationsUnauthorized() *IndexOrganizationsUnauthorized { - - return &IndexOrganizationsUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexOrganizationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexOrganizationsNotFoundCode is the HTTP code returned for type IndexOrganizationsNotFound -const IndexOrganizationsNotFoundCode int = 404 - -/* -IndexOrganizationsNotFound Organizations not found - -swagger:response indexOrganizationsNotFound -*/ -type IndexOrganizationsNotFound struct { -} - -// NewIndexOrganizationsNotFound creates IndexOrganizationsNotFound with default headers values -func NewIndexOrganizationsNotFound() *IndexOrganizationsNotFound { - - return &IndexOrganizationsNotFound{} -} - -// WriteResponse to the client -func (o *IndexOrganizationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexOrganizationsInternalServerErrorCode is the HTTP code returned for type IndexOrganizationsInternalServerError -const IndexOrganizationsInternalServerErrorCode int = 500 - -/* -IndexOrganizationsInternalServerError server error - -swagger:response indexOrganizationsInternalServerError -*/ -type IndexOrganizationsInternalServerError struct { -} - -// NewIndexOrganizationsInternalServerError creates IndexOrganizationsInternalServerError with default headers values -func NewIndexOrganizationsInternalServerError() *IndexOrganizationsInternalServerError { - - return &IndexOrganizationsInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexOrganizationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go deleted file mode 100644 index f55707d97ec..00000000000 --- a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package organizations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexOrganizationsURL generates an URL for the index organizations operation -type IndexOrganizationsURL struct { - Filter []string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOrganizationsURL) WithBasePath(bp string) *IndexOrganizationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOrganizationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexOrganizationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/organizations" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterIR []string - for _, filterI := range o.Filter { - filterIS := filterI - if filterIS != "" { - filterIR = append(filterIR, filterIS) - } - } - - filter := swag.JoinByFormat(filterIR, "") - - if len(filter) > 0 { - qsv := filter[0] - if qsv != "" { - qs.Set("filter", qsv) - } - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexOrganizationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexOrganizationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexOrganizationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexOrganizationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexOrganizationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexOrganizationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go deleted file mode 100644 index 0fd69641d61..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_file - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PaymentRequestSyncadaFileHandlerFunc turns a function with the right signature into a payment request syncada file handler -type PaymentRequestSyncadaFileHandlerFunc func(PaymentRequestSyncadaFileParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PaymentRequestSyncadaFileHandlerFunc) Handle(params PaymentRequestSyncadaFileParams) middleware.Responder { - return fn(params) -} - -// PaymentRequestSyncadaFileHandler interface for that can handle valid payment request syncada file params -type PaymentRequestSyncadaFileHandler interface { - Handle(PaymentRequestSyncadaFileParams) middleware.Responder -} - -// NewPaymentRequestSyncadaFile creates a new http.Handler for the payment request syncada file operation -func NewPaymentRequestSyncadaFile(ctx *middleware.Context, handler PaymentRequestSyncadaFileHandler) *PaymentRequestSyncadaFile { - return &PaymentRequestSyncadaFile{Context: ctx, Handler: handler} -} - -/* - PaymentRequestSyncadaFile swagger:route GET /payment-request-syncada-files/{paymentRequestSyncadaFileId} Payment Request Syncada File paymentRequestSyncadaFile - -# Payment Request EDI File - -Returns a Payment Request EDI858 file -*/ -type PaymentRequestSyncadaFile struct { - Context *middleware.Context - Handler PaymentRequestSyncadaFileHandler -} - -func (o *PaymentRequestSyncadaFile) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPaymentRequestSyncadaFileParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go deleted file mode 100644 index 4fddbb8299b..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_file - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewPaymentRequestSyncadaFileParams creates a new PaymentRequestSyncadaFileParams object -// -// There are no default values defined in the spec. -func NewPaymentRequestSyncadaFileParams() PaymentRequestSyncadaFileParams { - - return PaymentRequestSyncadaFileParams{} -} - -// PaymentRequestSyncadaFileParams contains all the bound params for the payment request syncada file operation -// typically these are obtained from a http.Request -// -// swagger:parameters paymentRequestSyncadaFile -type PaymentRequestSyncadaFileParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - Required: true - In: path - */ - PaymentRequestSyncadaFileID strfmt.UUID - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPaymentRequestSyncadaFileParams() beforehand. -func (o *PaymentRequestSyncadaFileParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - rPaymentRequestSyncadaFileID, rhkPaymentRequestSyncadaFileID, _ := route.Params.GetOK("paymentRequestSyncadaFileId") - if err := o.bindPaymentRequestSyncadaFileID(rPaymentRequestSyncadaFileID, rhkPaymentRequestSyncadaFileID, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *PaymentRequestSyncadaFileParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *PaymentRequestSyncadaFileParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *PaymentRequestSyncadaFileParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPaymentRequestSyncadaFileID binds and validates parameter PaymentRequestSyncadaFileID from path. -func (o *PaymentRequestSyncadaFileParams) bindPaymentRequestSyncadaFileID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestSyncadaFileId", "path", "strfmt.UUID", raw) - } - o.PaymentRequestSyncadaFileID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestSyncadaFileID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestSyncadaFileID carries on validations for parameter PaymentRequestSyncadaFileID -func (o *PaymentRequestSyncadaFileParams) validatePaymentRequestSyncadaFileID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestSyncadaFileId", "path", "uuid", o.PaymentRequestSyncadaFileID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *PaymentRequestSyncadaFileParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *PaymentRequestSyncadaFileParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go deleted file mode 100644 index 768d9302f7c..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go +++ /dev/null @@ -1,181 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_file - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// PaymentRequestSyncadaFileOKCode is the HTTP code returned for type PaymentRequestSyncadaFileOK -const PaymentRequestSyncadaFileOKCode int = 200 - -/* -PaymentRequestSyncadaFileOK success - -swagger:response paymentRequestSyncadaFileOK -*/ -type PaymentRequestSyncadaFileOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload *adminmessages.PaymentRequestSyncadaFile `json:"body,omitempty"` -} - -// NewPaymentRequestSyncadaFileOK creates PaymentRequestSyncadaFileOK with default headers values -func NewPaymentRequestSyncadaFileOK() *PaymentRequestSyncadaFileOK { - - return &PaymentRequestSyncadaFileOK{} -} - -// WithContentRange adds the contentRange to the payment request syncada file o k response -func (o *PaymentRequestSyncadaFileOK) WithContentRange(contentRange string) *PaymentRequestSyncadaFileOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the payment request syncada file o k response -func (o *PaymentRequestSyncadaFileOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the payment request syncada file o k response -func (o *PaymentRequestSyncadaFileOK) WithPayload(payload *adminmessages.PaymentRequestSyncadaFile) *PaymentRequestSyncadaFileOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the payment request syncada file o k response -func (o *PaymentRequestSyncadaFileOK) SetPayload(payload *adminmessages.PaymentRequestSyncadaFile) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PaymentRequestSyncadaFileOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PaymentRequestSyncadaFileBadRequestCode is the HTTP code returned for type PaymentRequestSyncadaFileBadRequest -const PaymentRequestSyncadaFileBadRequestCode int = 400 - -/* -PaymentRequestSyncadaFileBadRequest invalid request - -swagger:response paymentRequestSyncadaFileBadRequest -*/ -type PaymentRequestSyncadaFileBadRequest struct { -} - -// NewPaymentRequestSyncadaFileBadRequest creates PaymentRequestSyncadaFileBadRequest with default headers values -func NewPaymentRequestSyncadaFileBadRequest() *PaymentRequestSyncadaFileBadRequest { - - return &PaymentRequestSyncadaFileBadRequest{} -} - -// WriteResponse to the client -func (o *PaymentRequestSyncadaFileBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// PaymentRequestSyncadaFileUnauthorizedCode is the HTTP code returned for type PaymentRequestSyncadaFileUnauthorized -const PaymentRequestSyncadaFileUnauthorizedCode int = 401 - -/* -PaymentRequestSyncadaFileUnauthorized request requires user authentication - -swagger:response paymentRequestSyncadaFileUnauthorized -*/ -type PaymentRequestSyncadaFileUnauthorized struct { -} - -// NewPaymentRequestSyncadaFileUnauthorized creates PaymentRequestSyncadaFileUnauthorized with default headers values -func NewPaymentRequestSyncadaFileUnauthorized() *PaymentRequestSyncadaFileUnauthorized { - - return &PaymentRequestSyncadaFileUnauthorized{} -} - -// WriteResponse to the client -func (o *PaymentRequestSyncadaFileUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// PaymentRequestSyncadaFileNotFoundCode is the HTTP code returned for type PaymentRequestSyncadaFileNotFound -const PaymentRequestSyncadaFileNotFoundCode int = 404 - -/* -PaymentRequestSyncadaFileNotFound Payment Request EDI Files not found - -swagger:response paymentRequestSyncadaFileNotFound -*/ -type PaymentRequestSyncadaFileNotFound struct { -} - -// NewPaymentRequestSyncadaFileNotFound creates PaymentRequestSyncadaFileNotFound with default headers values -func NewPaymentRequestSyncadaFileNotFound() *PaymentRequestSyncadaFileNotFound { - - return &PaymentRequestSyncadaFileNotFound{} -} - -// WriteResponse to the client -func (o *PaymentRequestSyncadaFileNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// PaymentRequestSyncadaFileInternalServerErrorCode is the HTTP code returned for type PaymentRequestSyncadaFileInternalServerError -const PaymentRequestSyncadaFileInternalServerErrorCode int = 500 - -/* -PaymentRequestSyncadaFileInternalServerError server error - -swagger:response paymentRequestSyncadaFileInternalServerError -*/ -type PaymentRequestSyncadaFileInternalServerError struct { -} - -// NewPaymentRequestSyncadaFileInternalServerError creates PaymentRequestSyncadaFileInternalServerError with default headers values -func NewPaymentRequestSyncadaFileInternalServerError() *PaymentRequestSyncadaFileInternalServerError { - - return &PaymentRequestSyncadaFileInternalServerError{} -} - -// WriteResponse to the client -func (o *PaymentRequestSyncadaFileInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go deleted file mode 100644 index ac95f4dcaf0..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_file - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequestSyncadaFileURL generates an URL for the payment request syncada file operation -type PaymentRequestSyncadaFileURL struct { - PaymentRequestSyncadaFileID strfmt.UUID - - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PaymentRequestSyncadaFileURL) WithBasePath(bp string) *PaymentRequestSyncadaFileURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PaymentRequestSyncadaFileURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PaymentRequestSyncadaFileURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-request-syncada-files/{paymentRequestSyncadaFileId}" - - paymentRequestSyncadaFileID := o.PaymentRequestSyncadaFileID.String() - if paymentRequestSyncadaFileID != "" { - _path = strings.Replace(_path, "{paymentRequestSyncadaFileId}", paymentRequestSyncadaFileID, -1) - } else { - return nil, errors.New("paymentRequestSyncadaFileId is required on PaymentRequestSyncadaFileURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PaymentRequestSyncadaFileURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PaymentRequestSyncadaFileURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PaymentRequestSyncadaFileURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PaymentRequestSyncadaFileURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PaymentRequestSyncadaFileURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PaymentRequestSyncadaFileURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go deleted file mode 100644 index 6f1a093c000..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_files - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexPaymentRequestSyncadaFilesHandlerFunc turns a function with the right signature into a index payment request syncada files handler -type IndexPaymentRequestSyncadaFilesHandlerFunc func(IndexPaymentRequestSyncadaFilesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexPaymentRequestSyncadaFilesHandlerFunc) Handle(params IndexPaymentRequestSyncadaFilesParams) middleware.Responder { - return fn(params) -} - -// IndexPaymentRequestSyncadaFilesHandler interface for that can handle valid index payment request syncada files params -type IndexPaymentRequestSyncadaFilesHandler interface { - Handle(IndexPaymentRequestSyncadaFilesParams) middleware.Responder -} - -// NewIndexPaymentRequestSyncadaFiles creates a new http.Handler for the index payment request syncada files operation -func NewIndexPaymentRequestSyncadaFiles(ctx *middleware.Context, handler IndexPaymentRequestSyncadaFilesHandler) *IndexPaymentRequestSyncadaFiles { - return &IndexPaymentRequestSyncadaFiles{Context: ctx, Handler: handler} -} - -/* - IndexPaymentRequestSyncadaFiles swagger:route GET /payment-request-syncada-files Payment Request Syncada Files indexPaymentRequestSyncadaFiles - -# List Payment Request EDI Files - -Returns a list of Payment Request EDI files -*/ -type IndexPaymentRequestSyncadaFiles struct { - Context *middleware.Context - Handler IndexPaymentRequestSyncadaFilesHandler -} - -func (o *IndexPaymentRequestSyncadaFiles) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexPaymentRequestSyncadaFilesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go deleted file mode 100644 index 9863485c460..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_files - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexPaymentRequestSyncadaFilesParams creates a new IndexPaymentRequestSyncadaFilesParams object -// -// There are no default values defined in the spec. -func NewIndexPaymentRequestSyncadaFilesParams() IndexPaymentRequestSyncadaFilesParams { - - return IndexPaymentRequestSyncadaFilesParams{} -} - -// IndexPaymentRequestSyncadaFilesParams contains all the bound params for the index payment request syncada files operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexPaymentRequestSyncadaFiles -type IndexPaymentRequestSyncadaFilesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexPaymentRequestSyncadaFilesParams() beforehand. -func (o *IndexPaymentRequestSyncadaFilesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexPaymentRequestSyncadaFilesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexPaymentRequestSyncadaFilesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexPaymentRequestSyncadaFilesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexPaymentRequestSyncadaFilesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexPaymentRequestSyncadaFilesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go deleted file mode 100644 index a5b535302c4..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_files - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexPaymentRequestSyncadaFilesOKCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesOK -const IndexPaymentRequestSyncadaFilesOKCode int = 200 - -/* -IndexPaymentRequestSyncadaFilesOK success - -swagger:response indexPaymentRequestSyncadaFilesOK -*/ -type IndexPaymentRequestSyncadaFilesOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.PaymentRequestSyncadaFiles `json:"body,omitempty"` -} - -// NewIndexPaymentRequestSyncadaFilesOK creates IndexPaymentRequestSyncadaFilesOK with default headers values -func NewIndexPaymentRequestSyncadaFilesOK() *IndexPaymentRequestSyncadaFilesOK { - - return &IndexPaymentRequestSyncadaFilesOK{} -} - -// WithContentRange adds the contentRange to the index payment request syncada files o k response -func (o *IndexPaymentRequestSyncadaFilesOK) WithContentRange(contentRange string) *IndexPaymentRequestSyncadaFilesOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index payment request syncada files o k response -func (o *IndexPaymentRequestSyncadaFilesOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index payment request syncada files o k response -func (o *IndexPaymentRequestSyncadaFilesOK) WithPayload(payload adminmessages.PaymentRequestSyncadaFiles) *IndexPaymentRequestSyncadaFilesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index payment request syncada files o k response -func (o *IndexPaymentRequestSyncadaFilesOK) SetPayload(payload adminmessages.PaymentRequestSyncadaFiles) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexPaymentRequestSyncadaFilesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.PaymentRequestSyncadaFiles{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexPaymentRequestSyncadaFilesBadRequestCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesBadRequest -const IndexPaymentRequestSyncadaFilesBadRequestCode int = 400 - -/* -IndexPaymentRequestSyncadaFilesBadRequest invalid request - -swagger:response indexPaymentRequestSyncadaFilesBadRequest -*/ -type IndexPaymentRequestSyncadaFilesBadRequest struct { -} - -// NewIndexPaymentRequestSyncadaFilesBadRequest creates IndexPaymentRequestSyncadaFilesBadRequest with default headers values -func NewIndexPaymentRequestSyncadaFilesBadRequest() *IndexPaymentRequestSyncadaFilesBadRequest { - - return &IndexPaymentRequestSyncadaFilesBadRequest{} -} - -// WriteResponse to the client -func (o *IndexPaymentRequestSyncadaFilesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexPaymentRequestSyncadaFilesUnauthorizedCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesUnauthorized -const IndexPaymentRequestSyncadaFilesUnauthorizedCode int = 401 - -/* -IndexPaymentRequestSyncadaFilesUnauthorized request requires user authentication - -swagger:response indexPaymentRequestSyncadaFilesUnauthorized -*/ -type IndexPaymentRequestSyncadaFilesUnauthorized struct { -} - -// NewIndexPaymentRequestSyncadaFilesUnauthorized creates IndexPaymentRequestSyncadaFilesUnauthorized with default headers values -func NewIndexPaymentRequestSyncadaFilesUnauthorized() *IndexPaymentRequestSyncadaFilesUnauthorized { - - return &IndexPaymentRequestSyncadaFilesUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexPaymentRequestSyncadaFilesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexPaymentRequestSyncadaFilesNotFoundCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesNotFound -const IndexPaymentRequestSyncadaFilesNotFoundCode int = 404 - -/* -IndexPaymentRequestSyncadaFilesNotFound Payment Request EDI Files not found - -swagger:response indexPaymentRequestSyncadaFilesNotFound -*/ -type IndexPaymentRequestSyncadaFilesNotFound struct { -} - -// NewIndexPaymentRequestSyncadaFilesNotFound creates IndexPaymentRequestSyncadaFilesNotFound with default headers values -func NewIndexPaymentRequestSyncadaFilesNotFound() *IndexPaymentRequestSyncadaFilesNotFound { - - return &IndexPaymentRequestSyncadaFilesNotFound{} -} - -// WriteResponse to the client -func (o *IndexPaymentRequestSyncadaFilesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexPaymentRequestSyncadaFilesInternalServerErrorCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesInternalServerError -const IndexPaymentRequestSyncadaFilesInternalServerErrorCode int = 500 - -/* -IndexPaymentRequestSyncadaFilesInternalServerError server error - -swagger:response indexPaymentRequestSyncadaFilesInternalServerError -*/ -type IndexPaymentRequestSyncadaFilesInternalServerError struct { -} - -// NewIndexPaymentRequestSyncadaFilesInternalServerError creates IndexPaymentRequestSyncadaFilesInternalServerError with default headers values -func NewIndexPaymentRequestSyncadaFilesInternalServerError() *IndexPaymentRequestSyncadaFilesInternalServerError { - - return &IndexPaymentRequestSyncadaFilesInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexPaymentRequestSyncadaFilesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go deleted file mode 100644 index a9174bc35af..00000000000 --- a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request_syncada_files - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexPaymentRequestSyncadaFilesURL generates an URL for the index payment request syncada files operation -type IndexPaymentRequestSyncadaFilesURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexPaymentRequestSyncadaFilesURL) WithBasePath(bp string) *IndexPaymentRequestSyncadaFilesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexPaymentRequestSyncadaFilesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexPaymentRequestSyncadaFilesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-request-syncada-files" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexPaymentRequestSyncadaFilesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexPaymentRequestSyncadaFilesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexPaymentRequestSyncadaFilesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexPaymentRequestSyncadaFilesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexPaymentRequestSyncadaFilesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexPaymentRequestSyncadaFilesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go deleted file mode 100644 index 97efed9ad85..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetRequestedOfficeUserHandlerFunc turns a function with the right signature into a get requested office user handler -type GetRequestedOfficeUserHandlerFunc func(GetRequestedOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetRequestedOfficeUserHandlerFunc) Handle(params GetRequestedOfficeUserParams) middleware.Responder { - return fn(params) -} - -// GetRequestedOfficeUserHandler interface for that can handle valid get requested office user params -type GetRequestedOfficeUserHandler interface { - Handle(GetRequestedOfficeUserParams) middleware.Responder -} - -// NewGetRequestedOfficeUser creates a new http.Handler for the get requested office user operation -func NewGetRequestedOfficeUser(ctx *middleware.Context, handler GetRequestedOfficeUserHandler) *GetRequestedOfficeUser { - return &GetRequestedOfficeUser{Context: ctx, Handler: handler} -} - -/* - GetRequestedOfficeUser swagger:route GET /requested-office-users/{officeUserId} Requested office users getRequestedOfficeUser - -# Get a Requested Office User - -Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data. -*/ -type GetRequestedOfficeUser struct { - Context *middleware.Context - Handler GetRequestedOfficeUserHandler -} - -func (o *GetRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetRequestedOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go deleted file mode 100644 index bebba5529b5..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetRequestedOfficeUserParams creates a new GetRequestedOfficeUserParams object -// -// There are no default values defined in the spec. -func NewGetRequestedOfficeUserParams() GetRequestedOfficeUserParams { - - return GetRequestedOfficeUserParams{} -} - -// GetRequestedOfficeUserParams contains all the bound params for the get requested office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters getRequestedOfficeUser -type GetRequestedOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - OfficeUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetRequestedOfficeUserParams() beforehand. -func (o *GetRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") - if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeUserID binds and validates parameter OfficeUserID from path. -func (o *GetRequestedOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) - } - o.OfficeUserID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeUserID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeUserID carries on validations for parameter OfficeUserID -func (o *GetRequestedOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go deleted file mode 100644 index dded1590ba1..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetRequestedOfficeUserOKCode is the HTTP code returned for type GetRequestedOfficeUserOK -const GetRequestedOfficeUserOKCode int = 200 - -/* -GetRequestedOfficeUserOK success - -swagger:response getRequestedOfficeUserOK -*/ -type GetRequestedOfficeUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.OfficeUser `json:"body,omitempty"` -} - -// NewGetRequestedOfficeUserOK creates GetRequestedOfficeUserOK with default headers values -func NewGetRequestedOfficeUserOK() *GetRequestedOfficeUserOK { - - return &GetRequestedOfficeUserOK{} -} - -// WithPayload adds the payload to the get requested office user o k response -func (o *GetRequestedOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *GetRequestedOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get requested office user o k response -func (o *GetRequestedOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetRequestedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetRequestedOfficeUserBadRequestCode is the HTTP code returned for type GetRequestedOfficeUserBadRequest -const GetRequestedOfficeUserBadRequestCode int = 400 - -/* -GetRequestedOfficeUserBadRequest invalid request - -swagger:response getRequestedOfficeUserBadRequest -*/ -type GetRequestedOfficeUserBadRequest struct { -} - -// NewGetRequestedOfficeUserBadRequest creates GetRequestedOfficeUserBadRequest with default headers values -func NewGetRequestedOfficeUserBadRequest() *GetRequestedOfficeUserBadRequest { - - return &GetRequestedOfficeUserBadRequest{} -} - -// WriteResponse to the client -func (o *GetRequestedOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetRequestedOfficeUserUnauthorizedCode is the HTTP code returned for type GetRequestedOfficeUserUnauthorized -const GetRequestedOfficeUserUnauthorizedCode int = 401 - -/* -GetRequestedOfficeUserUnauthorized request requires user authentication - -swagger:response getRequestedOfficeUserUnauthorized -*/ -type GetRequestedOfficeUserUnauthorized struct { -} - -// NewGetRequestedOfficeUserUnauthorized creates GetRequestedOfficeUserUnauthorized with default headers values -func NewGetRequestedOfficeUserUnauthorized() *GetRequestedOfficeUserUnauthorized { - - return &GetRequestedOfficeUserUnauthorized{} -} - -// WriteResponse to the client -func (o *GetRequestedOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetRequestedOfficeUserNotFoundCode is the HTTP code returned for type GetRequestedOfficeUserNotFound -const GetRequestedOfficeUserNotFoundCode int = 404 - -/* -GetRequestedOfficeUserNotFound Office User not found - -swagger:response getRequestedOfficeUserNotFound -*/ -type GetRequestedOfficeUserNotFound struct { -} - -// NewGetRequestedOfficeUserNotFound creates GetRequestedOfficeUserNotFound with default headers values -func NewGetRequestedOfficeUserNotFound() *GetRequestedOfficeUserNotFound { - - return &GetRequestedOfficeUserNotFound{} -} - -// WriteResponse to the client -func (o *GetRequestedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type GetRequestedOfficeUserInternalServerError -const GetRequestedOfficeUserInternalServerErrorCode int = 500 - -/* -GetRequestedOfficeUserInternalServerError server error - -swagger:response getRequestedOfficeUserInternalServerError -*/ -type GetRequestedOfficeUserInternalServerError struct { -} - -// NewGetRequestedOfficeUserInternalServerError creates GetRequestedOfficeUserInternalServerError with default headers values -func NewGetRequestedOfficeUserInternalServerError() *GetRequestedOfficeUserInternalServerError { - - return &GetRequestedOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *GetRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go deleted file mode 100644 index 4cc60c7e91d..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetRequestedOfficeUserURL generates an URL for the get requested office user operation -type GetRequestedOfficeUserURL struct { - OfficeUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetRequestedOfficeUserURL) WithBasePath(bp string) *GetRequestedOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetRequestedOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetRequestedOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/requested-office-users/{officeUserId}" - - officeUserID := o.OfficeUserID.String() - if officeUserID != "" { - _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) - } else { - return nil, errors.New("officeUserId is required on GetRequestedOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetRequestedOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetRequestedOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetRequestedOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetRequestedOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go deleted file mode 100644 index cf8a8ea73f5..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexRequestedOfficeUsersHandlerFunc turns a function with the right signature into a index requested office users handler -type IndexRequestedOfficeUsersHandlerFunc func(IndexRequestedOfficeUsersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexRequestedOfficeUsersHandlerFunc) Handle(params IndexRequestedOfficeUsersParams) middleware.Responder { - return fn(params) -} - -// IndexRequestedOfficeUsersHandler interface for that can handle valid index requested office users params -type IndexRequestedOfficeUsersHandler interface { - Handle(IndexRequestedOfficeUsersParams) middleware.Responder -} - -// NewIndexRequestedOfficeUsers creates a new http.Handler for the index requested office users operation -func NewIndexRequestedOfficeUsers(ctx *middleware.Context, handler IndexRequestedOfficeUsersHandler) *IndexRequestedOfficeUsers { - return &IndexRequestedOfficeUsers{Context: ctx, Handler: handler} -} - -/* - IndexRequestedOfficeUsers swagger:route GET /requested-office-users Requested office users indexRequestedOfficeUsers - -# List of Office Users Requesting Accounts - -This endpoint returns a list of Office Users. Do not use this endpoint directly -as it is meant to be used with the Admin UI exclusively. -*/ -type IndexRequestedOfficeUsers struct { - Context *middleware.Context - Handler IndexRequestedOfficeUsersHandler -} - -func (o *IndexRequestedOfficeUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexRequestedOfficeUsersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go deleted file mode 100644 index b2229494363..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexRequestedOfficeUsersParams creates a new IndexRequestedOfficeUsersParams object -// -// There are no default values defined in the spec. -func NewIndexRequestedOfficeUsersParams() IndexRequestedOfficeUsersParams { - - return IndexRequestedOfficeUsersParams{} -} - -// IndexRequestedOfficeUsersParams contains all the bound params for the index requested office users operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexRequestedOfficeUsers -type IndexRequestedOfficeUsersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexRequestedOfficeUsersParams() beforehand. -func (o *IndexRequestedOfficeUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexRequestedOfficeUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexRequestedOfficeUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexRequestedOfficeUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexRequestedOfficeUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexRequestedOfficeUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go deleted file mode 100644 index d3fe79a41b8..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexRequestedOfficeUsersOKCode is the HTTP code returned for type IndexRequestedOfficeUsersOK -const IndexRequestedOfficeUsersOKCode int = 200 - -/* -IndexRequestedOfficeUsersOK success - -swagger:response indexRequestedOfficeUsersOK -*/ -type IndexRequestedOfficeUsersOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.OfficeUsers `json:"body,omitempty"` -} - -// NewIndexRequestedOfficeUsersOK creates IndexRequestedOfficeUsersOK with default headers values -func NewIndexRequestedOfficeUsersOK() *IndexRequestedOfficeUsersOK { - - return &IndexRequestedOfficeUsersOK{} -} - -// WithContentRange adds the contentRange to the index requested office users o k response -func (o *IndexRequestedOfficeUsersOK) WithContentRange(contentRange string) *IndexRequestedOfficeUsersOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index requested office users o k response -func (o *IndexRequestedOfficeUsersOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index requested office users o k response -func (o *IndexRequestedOfficeUsersOK) WithPayload(payload adminmessages.OfficeUsers) *IndexRequestedOfficeUsersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index requested office users o k response -func (o *IndexRequestedOfficeUsersOK) SetPayload(payload adminmessages.OfficeUsers) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexRequestedOfficeUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.OfficeUsers{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexRequestedOfficeUsersBadRequestCode is the HTTP code returned for type IndexRequestedOfficeUsersBadRequest -const IndexRequestedOfficeUsersBadRequestCode int = 400 - -/* -IndexRequestedOfficeUsersBadRequest invalid request - -swagger:response indexRequestedOfficeUsersBadRequest -*/ -type IndexRequestedOfficeUsersBadRequest struct { -} - -// NewIndexRequestedOfficeUsersBadRequest creates IndexRequestedOfficeUsersBadRequest with default headers values -func NewIndexRequestedOfficeUsersBadRequest() *IndexRequestedOfficeUsersBadRequest { - - return &IndexRequestedOfficeUsersBadRequest{} -} - -// WriteResponse to the client -func (o *IndexRequestedOfficeUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexRequestedOfficeUsersUnauthorizedCode is the HTTP code returned for type IndexRequestedOfficeUsersUnauthorized -const IndexRequestedOfficeUsersUnauthorizedCode int = 401 - -/* -IndexRequestedOfficeUsersUnauthorized request requires user authentication - -swagger:response indexRequestedOfficeUsersUnauthorized -*/ -type IndexRequestedOfficeUsersUnauthorized struct { -} - -// NewIndexRequestedOfficeUsersUnauthorized creates IndexRequestedOfficeUsersUnauthorized with default headers values -func NewIndexRequestedOfficeUsersUnauthorized() *IndexRequestedOfficeUsersUnauthorized { - - return &IndexRequestedOfficeUsersUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexRequestedOfficeUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexRequestedOfficeUsersNotFoundCode is the HTTP code returned for type IndexRequestedOfficeUsersNotFound -const IndexRequestedOfficeUsersNotFoundCode int = 404 - -/* -IndexRequestedOfficeUsersNotFound Office User not found - -swagger:response indexRequestedOfficeUsersNotFound -*/ -type IndexRequestedOfficeUsersNotFound struct { -} - -// NewIndexRequestedOfficeUsersNotFound creates IndexRequestedOfficeUsersNotFound with default headers values -func NewIndexRequestedOfficeUsersNotFound() *IndexRequestedOfficeUsersNotFound { - - return &IndexRequestedOfficeUsersNotFound{} -} - -// WriteResponse to the client -func (o *IndexRequestedOfficeUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexRequestedOfficeUsersInternalServerErrorCode is the HTTP code returned for type IndexRequestedOfficeUsersInternalServerError -const IndexRequestedOfficeUsersInternalServerErrorCode int = 500 - -/* -IndexRequestedOfficeUsersInternalServerError server error - -swagger:response indexRequestedOfficeUsersInternalServerError -*/ -type IndexRequestedOfficeUsersInternalServerError struct { -} - -// NewIndexRequestedOfficeUsersInternalServerError creates IndexRequestedOfficeUsersInternalServerError with default headers values -func NewIndexRequestedOfficeUsersInternalServerError() *IndexRequestedOfficeUsersInternalServerError { - - return &IndexRequestedOfficeUsersInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexRequestedOfficeUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go deleted file mode 100644 index 2169551a3fa..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexRequestedOfficeUsersURL generates an URL for the index requested office users operation -type IndexRequestedOfficeUsersURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexRequestedOfficeUsersURL) WithBasePath(bp string) *IndexRequestedOfficeUsersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexRequestedOfficeUsersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexRequestedOfficeUsersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/requested-office-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexRequestedOfficeUsersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexRequestedOfficeUsersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexRequestedOfficeUsersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexRequestedOfficeUsersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexRequestedOfficeUsersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexRequestedOfficeUsersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go deleted file mode 100644 index 42fd8d9c41f..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateRequestedOfficeUserHandlerFunc turns a function with the right signature into a update requested office user handler -type UpdateRequestedOfficeUserHandlerFunc func(UpdateRequestedOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateRequestedOfficeUserHandlerFunc) Handle(params UpdateRequestedOfficeUserParams) middleware.Responder { - return fn(params) -} - -// UpdateRequestedOfficeUserHandler interface for that can handle valid update requested office user params -type UpdateRequestedOfficeUserHandler interface { - Handle(UpdateRequestedOfficeUserParams) middleware.Responder -} - -// NewUpdateRequestedOfficeUser creates a new http.Handler for the update requested office user operation -func NewUpdateRequestedOfficeUser(ctx *middleware.Context, handler UpdateRequestedOfficeUserHandler) *UpdateRequestedOfficeUser { - return &UpdateRequestedOfficeUser{Context: ctx, Handler: handler} -} - -/* - UpdateRequestedOfficeUser swagger:route PATCH /requested-office-users/{officeUserId} Requested office users updateRequestedOfficeUser - -# Update a Requested Office User - -Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user. -*/ -type UpdateRequestedOfficeUser struct { - Context *middleware.Context - Handler UpdateRequestedOfficeUserHandler -} - -func (o *UpdateRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateRequestedOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go deleted file mode 100644 index 7e27a4ba306..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateRequestedOfficeUserParams creates a new UpdateRequestedOfficeUserParams object -// -// There are no default values defined in the spec. -func NewUpdateRequestedOfficeUserParams() UpdateRequestedOfficeUserParams { - - return UpdateRequestedOfficeUserParams{} -} - -// UpdateRequestedOfficeUserParams contains all the bound params for the update requested office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateRequestedOfficeUser -type UpdateRequestedOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *adminmessages.RequestedOfficeUserUpdate - /* - Required: true - In: path - */ - OfficeUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateRequestedOfficeUserParams() beforehand. -func (o *UpdateRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.RequestedOfficeUserUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") - if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeUserID binds and validates parameter OfficeUserID from path. -func (o *UpdateRequestedOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) - } - o.OfficeUserID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeUserID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeUserID carries on validations for parameter OfficeUserID -func (o *UpdateRequestedOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go deleted file mode 100644 index 51c533f41fe..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateRequestedOfficeUserOKCode is the HTTP code returned for type UpdateRequestedOfficeUserOK -const UpdateRequestedOfficeUserOKCode int = 200 - -/* -UpdateRequestedOfficeUserOK success - -swagger:response updateRequestedOfficeUserOK -*/ -type UpdateRequestedOfficeUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.OfficeUser `json:"body,omitempty"` -} - -// NewUpdateRequestedOfficeUserOK creates UpdateRequestedOfficeUserOK with default headers values -func NewUpdateRequestedOfficeUserOK() *UpdateRequestedOfficeUserOK { - - return &UpdateRequestedOfficeUserOK{} -} - -// WithPayload adds the payload to the update requested office user o k response -func (o *UpdateRequestedOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *UpdateRequestedOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update requested office user o k response -func (o *UpdateRequestedOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRequestedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateRequestedOfficeUserUnauthorizedCode is the HTTP code returned for type UpdateRequestedOfficeUserUnauthorized -const UpdateRequestedOfficeUserUnauthorizedCode int = 401 - -/* -UpdateRequestedOfficeUserUnauthorized request requires user authentication - -swagger:response updateRequestedOfficeUserUnauthorized -*/ -type UpdateRequestedOfficeUserUnauthorized struct { -} - -// NewUpdateRequestedOfficeUserUnauthorized creates UpdateRequestedOfficeUserUnauthorized with default headers values -func NewUpdateRequestedOfficeUserUnauthorized() *UpdateRequestedOfficeUserUnauthorized { - - return &UpdateRequestedOfficeUserUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateRequestedOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateRequestedOfficeUserNotFoundCode is the HTTP code returned for type UpdateRequestedOfficeUserNotFound -const UpdateRequestedOfficeUserNotFoundCode int = 404 - -/* -UpdateRequestedOfficeUserNotFound Office User not found - -swagger:response updateRequestedOfficeUserNotFound -*/ -type UpdateRequestedOfficeUserNotFound struct { -} - -// NewUpdateRequestedOfficeUserNotFound creates UpdateRequestedOfficeUserNotFound with default headers values -func NewUpdateRequestedOfficeUserNotFound() *UpdateRequestedOfficeUserNotFound { - - return &UpdateRequestedOfficeUserNotFound{} -} - -// WriteResponse to the client -func (o *UpdateRequestedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateRequestedOfficeUserUnprocessableEntityCode is the HTTP code returned for type UpdateRequestedOfficeUserUnprocessableEntity -const UpdateRequestedOfficeUserUnprocessableEntityCode int = 422 - -/* -UpdateRequestedOfficeUserUnprocessableEntity validation error - -swagger:response updateRequestedOfficeUserUnprocessableEntity -*/ -type UpdateRequestedOfficeUserUnprocessableEntity struct { - - /* - In: Body - */ - Payload *adminmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateRequestedOfficeUserUnprocessableEntity creates UpdateRequestedOfficeUserUnprocessableEntity with default headers values -func NewUpdateRequestedOfficeUserUnprocessableEntity() *UpdateRequestedOfficeUserUnprocessableEntity { - - return &UpdateRequestedOfficeUserUnprocessableEntity{} -} - -// WithPayload adds the payload to the update requested office user unprocessable entity response -func (o *UpdateRequestedOfficeUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateRequestedOfficeUserUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update requested office user unprocessable entity response -func (o *UpdateRequestedOfficeUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateRequestedOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateRequestedOfficeUserInternalServerError -const UpdateRequestedOfficeUserInternalServerErrorCode int = 500 - -/* -UpdateRequestedOfficeUserInternalServerError server error - -swagger:response updateRequestedOfficeUserInternalServerError -*/ -type UpdateRequestedOfficeUserInternalServerError struct { -} - -// NewUpdateRequestedOfficeUserInternalServerError creates UpdateRequestedOfficeUserInternalServerError with default headers values -func NewUpdateRequestedOfficeUserInternalServerError() *UpdateRequestedOfficeUserInternalServerError { - - return &UpdateRequestedOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go deleted file mode 100644 index 00275564ba1..00000000000 --- a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package requested_office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateRequestedOfficeUserURL generates an URL for the update requested office user operation -type UpdateRequestedOfficeUserURL struct { - OfficeUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateRequestedOfficeUserURL) WithBasePath(bp string) *UpdateRequestedOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateRequestedOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateRequestedOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/requested-office-users/{officeUserId}" - - officeUserID := o.OfficeUserID.String() - if officeUserID != "" { - _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) - } else { - return nil, errors.New("officeUserId is required on UpdateRequestedOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateRequestedOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateRequestedOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateRequestedOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateRequestedOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go deleted file mode 100644 index ab375956669..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetOfficeByIDHandlerFunc turns a function with the right signature into a get office by Id handler -type GetOfficeByIDHandlerFunc func(GetOfficeByIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetOfficeByIDHandlerFunc) Handle(params GetOfficeByIDParams) middleware.Responder { - return fn(params) -} - -// GetOfficeByIDHandler interface for that can handle valid get office by Id params -type GetOfficeByIDHandler interface { - Handle(GetOfficeByIDParams) middleware.Responder -} - -// NewGetOfficeByID creates a new http.Handler for the get office by Id operation -func NewGetOfficeByID(ctx *middleware.Context, handler GetOfficeByIDHandler) *GetOfficeByID { - return &GetOfficeByID{Context: ctx, Handler: handler} -} - -/* - GetOfficeByID swagger:route GET /offices/{officeId} Transportation offices getOfficeById - -# Get Transportation Office by ID - -This endpoint returns a list of Transportation Offices. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type GetOfficeByID struct { - Context *middleware.Context - Handler GetOfficeByIDHandler -} - -func (o *GetOfficeByID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetOfficeByIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go deleted file mode 100644 index ae0bcafa12e..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetOfficeByIDParams creates a new GetOfficeByIDParams object -// -// There are no default values defined in the spec. -func NewGetOfficeByIDParams() GetOfficeByIDParams { - - return GetOfficeByIDParams{} -} - -// GetOfficeByIDParams contains all the bound params for the get office by Id operation -// typically these are obtained from a http.Request -// -// swagger:parameters getOfficeById -type GetOfficeByIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - OfficeID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetOfficeByIDParams() beforehand. -func (o *GetOfficeByIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOfficeID, rhkOfficeID, _ := route.Params.GetOK("officeId") - if err := o.bindOfficeID(rOfficeID, rhkOfficeID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeID binds and validates parameter OfficeID from path. -func (o *GetOfficeByIDParams) bindOfficeID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeId", "path", "strfmt.UUID", raw) - } - o.OfficeID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeID carries on validations for parameter OfficeID -func (o *GetOfficeByIDParams) validateOfficeID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeId", "path", "uuid", o.OfficeID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go deleted file mode 100644 index 417b2ba1d00..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetOfficeByIDOKCode is the HTTP code returned for type GetOfficeByIDOK -const GetOfficeByIDOKCode int = 200 - -/* -GetOfficeByIDOK success - -swagger:response getOfficeByIdOK -*/ -type GetOfficeByIDOK struct { - - /* - In: Body - */ - Payload *adminmessages.TransportationOffice `json:"body,omitempty"` -} - -// NewGetOfficeByIDOK creates GetOfficeByIDOK with default headers values -func NewGetOfficeByIDOK() *GetOfficeByIDOK { - - return &GetOfficeByIDOK{} -} - -// WithPayload adds the payload to the get office by Id o k response -func (o *GetOfficeByIDOK) WithPayload(payload *adminmessages.TransportationOffice) *GetOfficeByIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get office by Id o k response -func (o *GetOfficeByIDOK) SetPayload(payload *adminmessages.TransportationOffice) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOfficeByIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOfficeByIDBadRequestCode is the HTTP code returned for type GetOfficeByIDBadRequest -const GetOfficeByIDBadRequestCode int = 400 - -/* -GetOfficeByIDBadRequest invalid request - -swagger:response getOfficeByIdBadRequest -*/ -type GetOfficeByIDBadRequest struct { -} - -// NewGetOfficeByIDBadRequest creates GetOfficeByIDBadRequest with default headers values -func NewGetOfficeByIDBadRequest() *GetOfficeByIDBadRequest { - - return &GetOfficeByIDBadRequest{} -} - -// WriteResponse to the client -func (o *GetOfficeByIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetOfficeByIDUnauthorizedCode is the HTTP code returned for type GetOfficeByIDUnauthorized -const GetOfficeByIDUnauthorizedCode int = 401 - -/* -GetOfficeByIDUnauthorized request requires user authentication - -swagger:response getOfficeByIdUnauthorized -*/ -type GetOfficeByIDUnauthorized struct { -} - -// NewGetOfficeByIDUnauthorized creates GetOfficeByIDUnauthorized with default headers values -func NewGetOfficeByIDUnauthorized() *GetOfficeByIDUnauthorized { - - return &GetOfficeByIDUnauthorized{} -} - -// WriteResponse to the client -func (o *GetOfficeByIDUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetOfficeByIDNotFoundCode is the HTTP code returned for type GetOfficeByIDNotFound -const GetOfficeByIDNotFoundCode int = 404 - -/* -GetOfficeByIDNotFound Transportation Office not found - -swagger:response getOfficeByIdNotFound -*/ -type GetOfficeByIDNotFound struct { -} - -// NewGetOfficeByIDNotFound creates GetOfficeByIDNotFound with default headers values -func NewGetOfficeByIDNotFound() *GetOfficeByIDNotFound { - - return &GetOfficeByIDNotFound{} -} - -// WriteResponse to the client -func (o *GetOfficeByIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetOfficeByIDInternalServerErrorCode is the HTTP code returned for type GetOfficeByIDInternalServerError -const GetOfficeByIDInternalServerErrorCode int = 500 - -/* -GetOfficeByIDInternalServerError server error - -swagger:response getOfficeByIdInternalServerError -*/ -type GetOfficeByIDInternalServerError struct { -} - -// NewGetOfficeByIDInternalServerError creates GetOfficeByIDInternalServerError with default headers values -func NewGetOfficeByIDInternalServerError() *GetOfficeByIDInternalServerError { - - return &GetOfficeByIDInternalServerError{} -} - -// WriteResponse to the client -func (o *GetOfficeByIDInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go deleted file mode 100644 index 84b2be6dc43..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetOfficeByIDURL generates an URL for the get office by Id operation -type GetOfficeByIDURL struct { - OfficeID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOfficeByIDURL) WithBasePath(bp string) *GetOfficeByIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOfficeByIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetOfficeByIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/offices/{officeId}" - - officeID := o.OfficeID.String() - if officeID != "" { - _path = strings.Replace(_path, "{officeId}", officeID, -1) - } else { - return nil, errors.New("officeId is required on GetOfficeByIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetOfficeByIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetOfficeByIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetOfficeByIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetOfficeByIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetOfficeByIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetOfficeByIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go deleted file mode 100644 index 304c3ad040b..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexOfficesHandlerFunc turns a function with the right signature into a index offices handler -type IndexOfficesHandlerFunc func(IndexOfficesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexOfficesHandlerFunc) Handle(params IndexOfficesParams) middleware.Responder { - return fn(params) -} - -// IndexOfficesHandler interface for that can handle valid index offices params -type IndexOfficesHandler interface { - Handle(IndexOfficesParams) middleware.Responder -} - -// NewIndexOffices creates a new http.Handler for the index offices operation -func NewIndexOffices(ctx *middleware.Context, handler IndexOfficesHandler) *IndexOffices { - return &IndexOffices{Context: ctx, Handler: handler} -} - -/* - IndexOffices swagger:route GET /offices Transportation offices indexOffices - -# List Transportation Offices - -This endpoint returns a list of Transportation Offices. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type IndexOffices struct { - Context *middleware.Context - Handler IndexOfficesHandler -} - -func (o *IndexOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexOfficesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go deleted file mode 100644 index 5b863367009..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexOfficesParams creates a new IndexOfficesParams object -// -// There are no default values defined in the spec. -func NewIndexOfficesParams() IndexOfficesParams { - - return IndexOfficesParams{} -} - -// IndexOfficesParams contains all the bound params for the index offices operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexOffices -type IndexOfficesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexOfficesParams() beforehand. -func (o *IndexOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexOfficesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexOfficesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexOfficesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexOfficesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexOfficesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go deleted file mode 100644 index 1a0a824da53..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexOfficesOKCode is the HTTP code returned for type IndexOfficesOK -const IndexOfficesOKCode int = 200 - -/* -IndexOfficesOK success - -swagger:response indexOfficesOK -*/ -type IndexOfficesOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.TransportationOffices `json:"body,omitempty"` -} - -// NewIndexOfficesOK creates IndexOfficesOK with default headers values -func NewIndexOfficesOK() *IndexOfficesOK { - - return &IndexOfficesOK{} -} - -// WithContentRange adds the contentRange to the index offices o k response -func (o *IndexOfficesOK) WithContentRange(contentRange string) *IndexOfficesOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index offices o k response -func (o *IndexOfficesOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index offices o k response -func (o *IndexOfficesOK) WithPayload(payload adminmessages.TransportationOffices) *IndexOfficesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index offices o k response -func (o *IndexOfficesOK) SetPayload(payload adminmessages.TransportationOffices) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.TransportationOffices{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexOfficesBadRequestCode is the HTTP code returned for type IndexOfficesBadRequest -const IndexOfficesBadRequestCode int = 400 - -/* -IndexOfficesBadRequest invalid request - -swagger:response indexOfficesBadRequest -*/ -type IndexOfficesBadRequest struct { -} - -// NewIndexOfficesBadRequest creates IndexOfficesBadRequest with default headers values -func NewIndexOfficesBadRequest() *IndexOfficesBadRequest { - - return &IndexOfficesBadRequest{} -} - -// WriteResponse to the client -func (o *IndexOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexOfficesUnauthorizedCode is the HTTP code returned for type IndexOfficesUnauthorized -const IndexOfficesUnauthorizedCode int = 401 - -/* -IndexOfficesUnauthorized request requires user authentication - -swagger:response indexOfficesUnauthorized -*/ -type IndexOfficesUnauthorized struct { -} - -// NewIndexOfficesUnauthorized creates IndexOfficesUnauthorized with default headers values -func NewIndexOfficesUnauthorized() *IndexOfficesUnauthorized { - - return &IndexOfficesUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexOfficesNotFoundCode is the HTTP code returned for type IndexOfficesNotFound -const IndexOfficesNotFoundCode int = 404 - -/* -IndexOfficesNotFound Transportation Office not found - -swagger:response indexOfficesNotFound -*/ -type IndexOfficesNotFound struct { -} - -// NewIndexOfficesNotFound creates IndexOfficesNotFound with default headers values -func NewIndexOfficesNotFound() *IndexOfficesNotFound { - - return &IndexOfficesNotFound{} -} - -// WriteResponse to the client -func (o *IndexOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexOfficesInternalServerErrorCode is the HTTP code returned for type IndexOfficesInternalServerError -const IndexOfficesInternalServerErrorCode int = 500 - -/* -IndexOfficesInternalServerError server error - -swagger:response indexOfficesInternalServerError -*/ -type IndexOfficesInternalServerError struct { -} - -// NewIndexOfficesInternalServerError creates IndexOfficesInternalServerError with default headers values -func NewIndexOfficesInternalServerError() *IndexOfficesInternalServerError { - - return &IndexOfficesInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go deleted file mode 100644 index a9d318bc905..00000000000 --- a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexOfficesURL generates an URL for the index offices operation -type IndexOfficesURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOfficesURL) WithBasePath(bp string) *IndexOfficesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexOfficesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexOfficesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/offices" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexOfficesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexOfficesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexOfficesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexOfficesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexOfficesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload.go deleted file mode 100644 index 6b8d2e4ebf8..00000000000 --- a/pkg/gen/adminapi/adminoperations/uploads/get_upload.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetUploadHandlerFunc turns a function with the right signature into a get upload handler -type GetUploadHandlerFunc func(GetUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetUploadHandlerFunc) Handle(params GetUploadParams) middleware.Responder { - return fn(params) -} - -// GetUploadHandler interface for that can handle valid get upload params -type GetUploadHandler interface { - Handle(GetUploadParams) middleware.Responder -} - -// NewGetUpload creates a new http.Handler for the get upload operation -func NewGetUpload(ctx *middleware.Context, handler GetUploadHandler) *GetUpload { - return &GetUpload{Context: ctx, Handler: handler} -} - -/* - GetUpload swagger:route GET /uploads/{uploadId} Uploads getUpload - -# Get information about an Upload - -This endpoint returns a single Upload by ID containing the given Upload and -information about the Uploader and Move. Do not use this endpoint directly as it -is meant to be used with the Admin UI exclusively. -*/ -type GetUpload struct { - Context *middleware.Context - Handler GetUploadHandler -} - -func (o *GetUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go deleted file mode 100644 index 7c71f367f8b..00000000000 --- a/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetUploadParams creates a new GetUploadParams object -// -// There are no default values defined in the spec. -func NewGetUploadParams() GetUploadParams { - - return GetUploadParams{} -} - -// GetUploadParams contains all the bound params for the get upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters getUpload -type GetUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - UploadID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetUploadParams() beforehand. -func (o *GetUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadId") - if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindUploadID binds and validates parameter UploadID from path. -func (o *GetUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("uploadId", "path", "strfmt.UUID", raw) - } - o.UploadID = *(value.(*strfmt.UUID)) - - if err := o.validateUploadID(formats); err != nil { - return err - } - - return nil -} - -// validateUploadID carries on validations for parameter UploadID -func (o *GetUploadParams) validateUploadID(formats strfmt.Registry) error { - - if err := validate.FormatOf("uploadId", "path", "uuid", o.UploadID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go deleted file mode 100644 index 08c26d43da9..00000000000 --- a/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetUploadOKCode is the HTTP code returned for type GetUploadOK -const GetUploadOKCode int = 200 - -/* -GetUploadOK success - -swagger:response getUploadOK -*/ -type GetUploadOK struct { - - /* - In: Body - */ - Payload *adminmessages.UploadInformation `json:"body,omitempty"` -} - -// NewGetUploadOK creates GetUploadOK with default headers values -func NewGetUploadOK() *GetUploadOK { - - return &GetUploadOK{} -} - -// WithPayload adds the payload to the get upload o k response -func (o *GetUploadOK) WithPayload(payload *adminmessages.UploadInformation) *GetUploadOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload o k response -func (o *GetUploadOK) SetPayload(payload *adminmessages.UploadInformation) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadBadRequestCode is the HTTP code returned for type GetUploadBadRequest -const GetUploadBadRequestCode int = 400 - -/* -GetUploadBadRequest invalid request - -swagger:response getUploadBadRequest -*/ -type GetUploadBadRequest struct { -} - -// NewGetUploadBadRequest creates GetUploadBadRequest with default headers values -func NewGetUploadBadRequest() *GetUploadBadRequest { - - return &GetUploadBadRequest{} -} - -// WriteResponse to the client -func (o *GetUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetUploadUnauthorizedCode is the HTTP code returned for type GetUploadUnauthorized -const GetUploadUnauthorizedCode int = 401 - -/* -GetUploadUnauthorized request requires user authentication - -swagger:response getUploadUnauthorized -*/ -type GetUploadUnauthorized struct { -} - -// NewGetUploadUnauthorized creates GetUploadUnauthorized with default headers values -func NewGetUploadUnauthorized() *GetUploadUnauthorized { - - return &GetUploadUnauthorized{} -} - -// WriteResponse to the client -func (o *GetUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetUploadNotFoundCode is the HTTP code returned for type GetUploadNotFound -const GetUploadNotFoundCode int = 404 - -/* -GetUploadNotFound Upload not found - -swagger:response getUploadNotFound -*/ -type GetUploadNotFound struct { -} - -// NewGetUploadNotFound creates GetUploadNotFound with default headers values -func NewGetUploadNotFound() *GetUploadNotFound { - - return &GetUploadNotFound{} -} - -// WriteResponse to the client -func (o *GetUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetUploadInternalServerErrorCode is the HTTP code returned for type GetUploadInternalServerError -const GetUploadInternalServerErrorCode int = 500 - -/* -GetUploadInternalServerError server error - -swagger:response getUploadInternalServerError -*/ -type GetUploadInternalServerError struct { -} - -// NewGetUploadInternalServerError creates GetUploadInternalServerError with default headers values -func NewGetUploadInternalServerError() *GetUploadInternalServerError { - - return &GetUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *GetUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go deleted file mode 100644 index f7c1dffc860..00000000000 --- a/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetUploadURL generates an URL for the get upload operation -type GetUploadURL struct { - UploadID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUploadURL) WithBasePath(bp string) *GetUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads/{uploadId}" - - uploadID := o.UploadID.String() - if uploadID != "" { - _path = strings.Replace(_path, "{uploadId}", uploadID, -1) - } else { - return nil, errors.New("uploadId is required on GetUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go deleted file mode 100644 index 1287028fe78..00000000000 --- a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetLoggedInAdminUserHandlerFunc turns a function with the right signature into a get logged in admin user handler -type GetLoggedInAdminUserHandlerFunc func(GetLoggedInAdminUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetLoggedInAdminUserHandlerFunc) Handle(params GetLoggedInAdminUserParams) middleware.Responder { - return fn(params) -} - -// GetLoggedInAdminUserHandler interface for that can handle valid get logged in admin user params -type GetLoggedInAdminUserHandler interface { - Handle(GetLoggedInAdminUserParams) middleware.Responder -} - -// NewGetLoggedInAdminUser creates a new http.Handler for the get logged in admin user operation -func NewGetLoggedInAdminUser(ctx *middleware.Context, handler GetLoggedInAdminUserHandler) *GetLoggedInAdminUser { - return &GetLoggedInAdminUser{Context: ctx, Handler: handler} -} - -/* - GetLoggedInAdminUser swagger:route GET /user User getLoggedInAdminUser - -# Gets the data about the currently signed in admin user - -Returns the admin user info for the currently logged in user -*/ -type GetLoggedInAdminUser struct { - Context *middleware.Context - Handler GetLoggedInAdminUserHandler -} - -func (o *GetLoggedInAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetLoggedInAdminUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go deleted file mode 100644 index ac0b1435402..00000000000 --- a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetLoggedInAdminUserParams creates a new GetLoggedInAdminUserParams object -// -// There are no default values defined in the spec. -func NewGetLoggedInAdminUserParams() GetLoggedInAdminUserParams { - - return GetLoggedInAdminUserParams{} -} - -// GetLoggedInAdminUserParams contains all the bound params for the get logged in admin user operation -// typically these are obtained from a http.Request -// -// swagger:parameters getLoggedInAdminUser -type GetLoggedInAdminUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetLoggedInAdminUserParams() beforehand. -func (o *GetLoggedInAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go deleted file mode 100644 index fe630235c59..00000000000 --- a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetLoggedInAdminUserOKCode is the HTTP code returned for type GetLoggedInAdminUserOK -const GetLoggedInAdminUserOKCode int = 200 - -/* -GetLoggedInAdminUserOK success - -swagger:response getLoggedInAdminUserOK -*/ -type GetLoggedInAdminUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.AdminUser `json:"body,omitempty"` -} - -// NewGetLoggedInAdminUserOK creates GetLoggedInAdminUserOK with default headers values -func NewGetLoggedInAdminUserOK() *GetLoggedInAdminUserOK { - - return &GetLoggedInAdminUserOK{} -} - -// WithPayload adds the payload to the get logged in admin user o k response -func (o *GetLoggedInAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *GetLoggedInAdminUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get logged in admin user o k response -func (o *GetLoggedInAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLoggedInAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLoggedInAdminUserBadRequestCode is the HTTP code returned for type GetLoggedInAdminUserBadRequest -const GetLoggedInAdminUserBadRequestCode int = 400 - -/* -GetLoggedInAdminUserBadRequest invalid request - -swagger:response getLoggedInAdminUserBadRequest -*/ -type GetLoggedInAdminUserBadRequest struct { -} - -// NewGetLoggedInAdminUserBadRequest creates GetLoggedInAdminUserBadRequest with default headers values -func NewGetLoggedInAdminUserBadRequest() *GetLoggedInAdminUserBadRequest { - - return &GetLoggedInAdminUserBadRequest{} -} - -// WriteResponse to the client -func (o *GetLoggedInAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetLoggedInAdminUserUnauthorizedCode is the HTTP code returned for type GetLoggedInAdminUserUnauthorized -const GetLoggedInAdminUserUnauthorizedCode int = 401 - -/* -GetLoggedInAdminUserUnauthorized request requires user authentication - -swagger:response getLoggedInAdminUserUnauthorized -*/ -type GetLoggedInAdminUserUnauthorized struct { -} - -// NewGetLoggedInAdminUserUnauthorized creates GetLoggedInAdminUserUnauthorized with default headers values -func NewGetLoggedInAdminUserUnauthorized() *GetLoggedInAdminUserUnauthorized { - - return &GetLoggedInAdminUserUnauthorized{} -} - -// WriteResponse to the client -func (o *GetLoggedInAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetLoggedInAdminUserNotFoundCode is the HTTP code returned for type GetLoggedInAdminUserNotFound -const GetLoggedInAdminUserNotFoundCode int = 404 - -/* -GetLoggedInAdminUserNotFound Admin User not found - -swagger:response getLoggedInAdminUserNotFound -*/ -type GetLoggedInAdminUserNotFound struct { -} - -// NewGetLoggedInAdminUserNotFound creates GetLoggedInAdminUserNotFound with default headers values -func NewGetLoggedInAdminUserNotFound() *GetLoggedInAdminUserNotFound { - - return &GetLoggedInAdminUserNotFound{} -} - -// WriteResponse to the client -func (o *GetLoggedInAdminUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetLoggedInAdminUserInternalServerErrorCode is the HTTP code returned for type GetLoggedInAdminUserInternalServerError -const GetLoggedInAdminUserInternalServerErrorCode int = 500 - -/* -GetLoggedInAdminUserInternalServerError server error - -swagger:response getLoggedInAdminUserInternalServerError -*/ -type GetLoggedInAdminUserInternalServerError struct { -} - -// NewGetLoggedInAdminUserInternalServerError creates GetLoggedInAdminUserInternalServerError with default headers values -func NewGetLoggedInAdminUserInternalServerError() *GetLoggedInAdminUserInternalServerError { - - return &GetLoggedInAdminUserInternalServerError{} -} - -// WriteResponse to the client -func (o *GetLoggedInAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go deleted file mode 100644 index 8be42303ee6..00000000000 --- a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package user - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetLoggedInAdminUserURL generates an URL for the get logged in admin user operation -type GetLoggedInAdminUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLoggedInAdminUserURL) WithBasePath(bp string) *GetLoggedInAdminUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLoggedInAdminUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetLoggedInAdminUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/user" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetLoggedInAdminUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetLoggedInAdminUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetLoggedInAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetLoggedInAdminUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetLoggedInAdminUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetLoggedInAdminUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user.go b/pkg/gen/adminapi/adminoperations/users/get_user.go deleted file mode 100644 index 12fff9039fa..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/get_user.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetUserHandlerFunc turns a function with the right signature into a get user handler -type GetUserHandlerFunc func(GetUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetUserHandlerFunc) Handle(params GetUserParams) middleware.Responder { - return fn(params) -} - -// GetUserHandler interface for that can handle valid get user params -type GetUserHandler interface { - Handle(GetUserParams) middleware.Responder -} - -// NewGetUser creates a new http.Handler for the get user operation -func NewGetUser(ctx *middleware.Context, handler GetUserHandler) *GetUser { - return &GetUser{Context: ctx, Handler: handler} -} - -/* - GetUser swagger:route GET /users/{userId} Users getUser - -# Get information about a User - -This endpoint returns a single User by ID. This also returns the User's sessions -as well. Do not use this endpoint directly as it is meant to be used with the -Admin UI exclusively. -*/ -type GetUser struct { - Context *middleware.Context - Handler GetUserHandler -} - -func (o *GetUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go b/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go deleted file mode 100644 index c712f83989f..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetUserParams creates a new GetUserParams object -// -// There are no default values defined in the spec. -func NewGetUserParams() GetUserParams { - - return GetUserParams{} -} - -// GetUserParams contains all the bound params for the get user operation -// typically these are obtained from a http.Request -// -// swagger:parameters getUser -type GetUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - UserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetUserParams() beforehand. -func (o *GetUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rUserID, rhkUserID, _ := route.Params.GetOK("userId") - if err := o.bindUserID(rUserID, rhkUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindUserID binds and validates parameter UserID from path. -func (o *GetUserParams) bindUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("userId", "path", "strfmt.UUID", raw) - } - o.UserID = *(value.(*strfmt.UUID)) - - if err := o.validateUserID(formats); err != nil { - return err - } - - return nil -} - -// validateUserID carries on validations for parameter UserID -func (o *GetUserParams) validateUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("userId", "path", "uuid", o.UserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_responses.go b/pkg/gen/adminapi/adminoperations/users/get_user_responses.go deleted file mode 100644 index 32d1eb9e0fb..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/get_user_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetUserOKCode is the HTTP code returned for type GetUserOK -const GetUserOKCode int = 200 - -/* -GetUserOK success - -swagger:response getUserOK -*/ -type GetUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.User `json:"body,omitempty"` -} - -// NewGetUserOK creates GetUserOK with default headers values -func NewGetUserOK() *GetUserOK { - - return &GetUserOK{} -} - -// WithPayload adds the payload to the get user o k response -func (o *GetUserOK) WithPayload(payload *adminmessages.User) *GetUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get user o k response -func (o *GetUserOK) SetPayload(payload *adminmessages.User) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUserBadRequestCode is the HTTP code returned for type GetUserBadRequest -const GetUserBadRequestCode int = 400 - -/* -GetUserBadRequest invalid request - -swagger:response getUserBadRequest -*/ -type GetUserBadRequest struct { -} - -// NewGetUserBadRequest creates GetUserBadRequest with default headers values -func NewGetUserBadRequest() *GetUserBadRequest { - - return &GetUserBadRequest{} -} - -// WriteResponse to the client -func (o *GetUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetUserUnauthorizedCode is the HTTP code returned for type GetUserUnauthorized -const GetUserUnauthorizedCode int = 401 - -/* -GetUserUnauthorized request requires user authentication - -swagger:response getUserUnauthorized -*/ -type GetUserUnauthorized struct { -} - -// NewGetUserUnauthorized creates GetUserUnauthorized with default headers values -func NewGetUserUnauthorized() *GetUserUnauthorized { - - return &GetUserUnauthorized{} -} - -// WriteResponse to the client -func (o *GetUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetUserNotFoundCode is the HTTP code returned for type GetUserNotFound -const GetUserNotFoundCode int = 404 - -/* -GetUserNotFound User not found - -swagger:response getUserNotFound -*/ -type GetUserNotFound struct { -} - -// NewGetUserNotFound creates GetUserNotFound with default headers values -func NewGetUserNotFound() *GetUserNotFound { - - return &GetUserNotFound{} -} - -// WriteResponse to the client -func (o *GetUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetUserInternalServerErrorCode is the HTTP code returned for type GetUserInternalServerError -const GetUserInternalServerErrorCode int = 500 - -/* -GetUserInternalServerError server error - -swagger:response getUserInternalServerError -*/ -type GetUserInternalServerError struct { -} - -// NewGetUserInternalServerError creates GetUserInternalServerError with default headers values -func NewGetUserInternalServerError() *GetUserInternalServerError { - - return &GetUserInternalServerError{} -} - -// WriteResponse to the client -func (o *GetUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go deleted file mode 100644 index 9805e8a2ef8..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetUserURL generates an URL for the get user operation -type GetUserURL struct { - UserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUserURL) WithBasePath(bp string) *GetUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/users/{userId}" - - userID := o.UserID.String() - if userID != "" { - _path = strings.Replace(_path, "{userId}", userID, -1) - } else { - return nil, errors.New("userId is required on GetUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users.go b/pkg/gen/adminapi/adminoperations/users/index_users.go deleted file mode 100644 index 64f2672aeb5..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/index_users.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexUsersHandlerFunc turns a function with the right signature into a index users handler -type IndexUsersHandlerFunc func(IndexUsersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexUsersHandlerFunc) Handle(params IndexUsersParams) middleware.Responder { - return fn(params) -} - -// IndexUsersHandler interface for that can handle valid index users params -type IndexUsersHandler interface { - Handle(IndexUsersParams) middleware.Responder -} - -// NewIndexUsers creates a new http.Handler for the index users operation -func NewIndexUsers(ctx *middleware.Context, handler IndexUsersHandler) *IndexUsers { - return &IndexUsers{Context: ctx, Handler: handler} -} - -/* - IndexUsers swagger:route GET /users Users indexUsers - -# List Users - -This endpoint returns a list of Users. Do not use this endpoint directly as it -is meant to be used with the Admin UI exclusively. -*/ -type IndexUsers struct { - Context *middleware.Context - Handler IndexUsersHandler -} - -func (o *IndexUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexUsersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go b/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go deleted file mode 100644 index cca50547e61..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexUsersParams creates a new IndexUsersParams object -// -// There are no default values defined in the spec. -func NewIndexUsersParams() IndexUsersParams { - - return IndexUsersParams{} -} - -// IndexUsersParams contains all the bound params for the index users operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexUsers -type IndexUsersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexUsersParams() beforehand. -func (o *IndexUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_responses.go b/pkg/gen/adminapi/adminoperations/users/index_users_responses.go deleted file mode 100644 index 68090209a4d..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/index_users_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexUsersOKCode is the HTTP code returned for type IndexUsersOK -const IndexUsersOKCode int = 200 - -/* -IndexUsersOK success - -swagger:response indexUsersOK -*/ -type IndexUsersOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.Users `json:"body,omitempty"` -} - -// NewIndexUsersOK creates IndexUsersOK with default headers values -func NewIndexUsersOK() *IndexUsersOK { - - return &IndexUsersOK{} -} - -// WithContentRange adds the contentRange to the index users o k response -func (o *IndexUsersOK) WithContentRange(contentRange string) *IndexUsersOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index users o k response -func (o *IndexUsersOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index users o k response -func (o *IndexUsersOK) WithPayload(payload adminmessages.Users) *IndexUsersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index users o k response -func (o *IndexUsersOK) SetPayload(payload adminmessages.Users) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.Users{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexUsersBadRequestCode is the HTTP code returned for type IndexUsersBadRequest -const IndexUsersBadRequestCode int = 400 - -/* -IndexUsersBadRequest invalid request - -swagger:response indexUsersBadRequest -*/ -type IndexUsersBadRequest struct { -} - -// NewIndexUsersBadRequest creates IndexUsersBadRequest with default headers values -func NewIndexUsersBadRequest() *IndexUsersBadRequest { - - return &IndexUsersBadRequest{} -} - -// WriteResponse to the client -func (o *IndexUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexUsersUnauthorizedCode is the HTTP code returned for type IndexUsersUnauthorized -const IndexUsersUnauthorizedCode int = 401 - -/* -IndexUsersUnauthorized request requires user authentication - -swagger:response indexUsersUnauthorized -*/ -type IndexUsersUnauthorized struct { -} - -// NewIndexUsersUnauthorized creates IndexUsersUnauthorized with default headers values -func NewIndexUsersUnauthorized() *IndexUsersUnauthorized { - - return &IndexUsersUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexUsersNotFoundCode is the HTTP code returned for type IndexUsersNotFound -const IndexUsersNotFoundCode int = 404 - -/* -IndexUsersNotFound Users not found - -swagger:response indexUsersNotFound -*/ -type IndexUsersNotFound struct { -} - -// NewIndexUsersNotFound creates IndexUsersNotFound with default headers values -func NewIndexUsersNotFound() *IndexUsersNotFound { - - return &IndexUsersNotFound{} -} - -// WriteResponse to the client -func (o *IndexUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexUsersInternalServerErrorCode is the HTTP code returned for type IndexUsersInternalServerError -const IndexUsersInternalServerErrorCode int = 500 - -/* -IndexUsersInternalServerError server error - -swagger:response indexUsersInternalServerError -*/ -type IndexUsersInternalServerError struct { -} - -// NewIndexUsersInternalServerError creates IndexUsersInternalServerError with default headers values -func NewIndexUsersInternalServerError() *IndexUsersInternalServerError { - - return &IndexUsersInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go deleted file mode 100644 index 2c8beeecd36..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexUsersURL generates an URL for the index users operation -type IndexUsersURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexUsersURL) WithBasePath(bp string) *IndexUsersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexUsersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexUsersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexUsersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexUsersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexUsersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexUsersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexUsersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexUsersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user.go b/pkg/gen/adminapi/adminoperations/users/update_user.go deleted file mode 100644 index ac2a01845f1..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/update_user.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateUserHandlerFunc turns a function with the right signature into a update user handler -type UpdateUserHandlerFunc func(UpdateUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateUserHandlerFunc) Handle(params UpdateUserParams) middleware.Responder { - return fn(params) -} - -// UpdateUserHandler interface for that can handle valid update user params -type UpdateUserHandler interface { - Handle(UpdateUserParams) middleware.Responder -} - -// NewUpdateUser creates a new http.Handler for the update user operation -func NewUpdateUser(ctx *middleware.Context, handler UpdateUserHandler) *UpdateUser { - return &UpdateUser{Context: ctx, Handler: handler} -} - -/* - UpdateUser swagger:route PATCH /users/{userId} Users updateUser - -# Update a User's session or active status - -This endpoint updates a single User by ID. This can be used by the Admin User to -update the User's session or the User's active status. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type UpdateUser struct { - Context *middleware.Context - Handler UpdateUserHandler -} - -func (o *UpdateUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go b/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go deleted file mode 100644 index afb57f89871..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateUserParams creates a new UpdateUserParams object -// -// There are no default values defined in the spec. -func NewUpdateUserParams() UpdateUserParams { - - return UpdateUserParams{} -} - -// UpdateUserParams contains all the bound params for the update user operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateUser -type UpdateUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*User information - Required: true - In: body - */ - User *adminmessages.UserUpdate - /* - Required: true - In: path - */ - UserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateUserParams() beforehand. -func (o *UpdateUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.UserUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("user", "body", "")) - } else { - res = append(res, errors.NewParseError("user", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.User = &body - } - } - } else { - res = append(res, errors.Required("user", "body", "")) - } - - rUserID, rhkUserID, _ := route.Params.GetOK("userId") - if err := o.bindUserID(rUserID, rhkUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindUserID binds and validates parameter UserID from path. -func (o *UpdateUserParams) bindUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("userId", "path", "strfmt.UUID", raw) - } - o.UserID = *(value.(*strfmt.UUID)) - - if err := o.validateUserID(formats); err != nil { - return err - } - - return nil -} - -// validateUserID carries on validations for parameter UserID -func (o *UpdateUserParams) validateUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("userId", "path", "uuid", o.UserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_responses.go b/pkg/gen/adminapi/adminoperations/users/update_user_responses.go deleted file mode 100644 index 9dc51b7e276..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/update_user_responses.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateUserOKCode is the HTTP code returned for type UpdateUserOK -const UpdateUserOKCode int = 200 - -/* -UpdateUserOK Successfully updated User - -swagger:response updateUserOK -*/ -type UpdateUserOK struct { - - /* - In: Body - */ - Payload *adminmessages.User `json:"body,omitempty"` -} - -// NewUpdateUserOK creates UpdateUserOK with default headers values -func NewUpdateUserOK() *UpdateUserOK { - - return &UpdateUserOK{} -} - -// WithPayload adds the payload to the update user o k response -func (o *UpdateUserOK) WithPayload(payload *adminmessages.User) *UpdateUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update user o k response -func (o *UpdateUserOK) SetPayload(payload *adminmessages.User) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateUserBadRequestCode is the HTTP code returned for type UpdateUserBadRequest -const UpdateUserBadRequestCode int = 400 - -/* -UpdateUserBadRequest Invalid Request - -swagger:response updateUserBadRequest -*/ -type UpdateUserBadRequest struct { -} - -// NewUpdateUserBadRequest creates UpdateUserBadRequest with default headers values -func NewUpdateUserBadRequest() *UpdateUserBadRequest { - - return &UpdateUserBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateUserUnauthorizedCode is the HTTP code returned for type UpdateUserUnauthorized -const UpdateUserUnauthorizedCode int = 401 - -/* -UpdateUserUnauthorized Must be authenticated to use this end point - -swagger:response updateUserUnauthorized -*/ -type UpdateUserUnauthorized struct { -} - -// NewUpdateUserUnauthorized creates UpdateUserUnauthorized with default headers values -func NewUpdateUserUnauthorized() *UpdateUserUnauthorized { - - return &UpdateUserUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateUserForbiddenCode is the HTTP code returned for type UpdateUserForbidden -const UpdateUserForbiddenCode int = 403 - -/* -UpdateUserForbidden Not authorized to update this User - -swagger:response updateUserForbidden -*/ -type UpdateUserForbidden struct { -} - -// NewUpdateUserForbidden creates UpdateUserForbidden with default headers values -func NewUpdateUserForbidden() *UpdateUserForbidden { - - return &UpdateUserForbidden{} -} - -// WriteResponse to the client -func (o *UpdateUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateUserNotFoundCode is the HTTP code returned for type UpdateUserNotFound -const UpdateUserNotFoundCode int = 404 - -/* -UpdateUserNotFound Not found - -swagger:response updateUserNotFound -*/ -type UpdateUserNotFound struct { -} - -// NewUpdateUserNotFound creates UpdateUserNotFound with default headers values -func NewUpdateUserNotFound() *UpdateUserNotFound { - - return &UpdateUserNotFound{} -} - -// WriteResponse to the client -func (o *UpdateUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateUserUnprocessableEntityCode is the HTTP code returned for type UpdateUserUnprocessableEntity -const UpdateUserUnprocessableEntityCode int = 422 - -/* -UpdateUserUnprocessableEntity Validation error - -swagger:response updateUserUnprocessableEntity -*/ -type UpdateUserUnprocessableEntity struct { - - /* - In: Body - */ - Payload *adminmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateUserUnprocessableEntity creates UpdateUserUnprocessableEntity with default headers values -func NewUpdateUserUnprocessableEntity() *UpdateUserUnprocessableEntity { - - return &UpdateUserUnprocessableEntity{} -} - -// WithPayload adds the payload to the update user unprocessable entity response -func (o *UpdateUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateUserUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update user unprocessable entity response -func (o *UpdateUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateUserInternalServerErrorCode is the HTTP code returned for type UpdateUserInternalServerError -const UpdateUserInternalServerErrorCode int = 500 - -/* -UpdateUserInternalServerError Server error - -swagger:response updateUserInternalServerError -*/ -type UpdateUserInternalServerError struct { -} - -// NewUpdateUserInternalServerError creates UpdateUserInternalServerError with default headers values -func NewUpdateUserInternalServerError() *UpdateUserInternalServerError { - - return &UpdateUserInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go deleted file mode 100644 index bc5cf0a2e64..00000000000 --- a/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateUserURL generates an URL for the update user operation -type UpdateUserURL struct { - UserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateUserURL) WithBasePath(bp string) *UpdateUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/users/{userId}" - - userID := o.UserID.String() - if userID != "" { - _path = strings.Replace(_path, "{userId}", userID, -1) - } else { - return nil, errors.New("userId is required on UpdateUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go deleted file mode 100644 index 1a9860585aa..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateWebhookSubscriptionHandlerFunc turns a function with the right signature into a create webhook subscription handler -type CreateWebhookSubscriptionHandlerFunc func(CreateWebhookSubscriptionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateWebhookSubscriptionHandlerFunc) Handle(params CreateWebhookSubscriptionParams) middleware.Responder { - return fn(params) -} - -// CreateWebhookSubscriptionHandler interface for that can handle valid create webhook subscription params -type CreateWebhookSubscriptionHandler interface { - Handle(CreateWebhookSubscriptionParams) middleware.Responder -} - -// NewCreateWebhookSubscription creates a new http.Handler for the create webhook subscription operation -func NewCreateWebhookSubscription(ctx *middleware.Context, handler CreateWebhookSubscriptionHandler) *CreateWebhookSubscription { - return &CreateWebhookSubscription{Context: ctx, Handler: handler} -} - -/* - CreateWebhookSubscription swagger:route POST /webhook-subscriptions Webhook subscriptions createWebhookSubscription - -# Create a Webhook Subscription - -This endpoint creates a Webhook Subscription and returns the created record in -the `201` response. Do not use this endpoint directly as it is meant to be used -with the Admin UI exclusively. -*/ -type CreateWebhookSubscription struct { - Context *middleware.Context - Handler CreateWebhookSubscriptionHandler -} - -func (o *CreateWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateWebhookSubscriptionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go deleted file mode 100644 index 0975e49e655..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewCreateWebhookSubscriptionParams creates a new CreateWebhookSubscriptionParams object -// -// There are no default values defined in the spec. -func NewCreateWebhookSubscriptionParams() CreateWebhookSubscriptionParams { - - return CreateWebhookSubscriptionParams{} -} - -// CreateWebhookSubscriptionParams contains all the bound params for the create webhook subscription operation -// typically these are obtained from a http.Request -// -// swagger:parameters createWebhookSubscription -type CreateWebhookSubscriptionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Webhook subscription information - In: body - */ - WebhookSubscription *adminmessages.CreateWebhookSubscription -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateWebhookSubscriptionParams() beforehand. -func (o *CreateWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.CreateWebhookSubscription - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("webhookSubscription", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.WebhookSubscription = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go deleted file mode 100644 index f98333cce70..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// CreateWebhookSubscriptionCreatedCode is the HTTP code returned for type CreateWebhookSubscriptionCreated -const CreateWebhookSubscriptionCreatedCode int = 201 - -/* -CreateWebhookSubscriptionCreated Successfully created Webhook Subscription - -swagger:response createWebhookSubscriptionCreated -*/ -type CreateWebhookSubscriptionCreated struct { - - /* - In: Body - */ - Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` -} - -// NewCreateWebhookSubscriptionCreated creates CreateWebhookSubscriptionCreated with default headers values -func NewCreateWebhookSubscriptionCreated() *CreateWebhookSubscriptionCreated { - - return &CreateWebhookSubscriptionCreated{} -} - -// WithPayload adds the payload to the create webhook subscription created response -func (o *CreateWebhookSubscriptionCreated) WithPayload(payload *adminmessages.WebhookSubscription) *CreateWebhookSubscriptionCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create webhook subscription created response -func (o *CreateWebhookSubscriptionCreated) SetPayload(payload *adminmessages.WebhookSubscription) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWebhookSubscriptionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWebhookSubscriptionBadRequestCode is the HTTP code returned for type CreateWebhookSubscriptionBadRequest -const CreateWebhookSubscriptionBadRequestCode int = 400 - -/* -CreateWebhookSubscriptionBadRequest Invalid Request - -swagger:response createWebhookSubscriptionBadRequest -*/ -type CreateWebhookSubscriptionBadRequest struct { -} - -// NewCreateWebhookSubscriptionBadRequest creates CreateWebhookSubscriptionBadRequest with default headers values -func NewCreateWebhookSubscriptionBadRequest() *CreateWebhookSubscriptionBadRequest { - - return &CreateWebhookSubscriptionBadRequest{} -} - -// WriteResponse to the client -func (o *CreateWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type CreateWebhookSubscriptionUnauthorized -const CreateWebhookSubscriptionUnauthorizedCode int = 401 - -/* -CreateWebhookSubscriptionUnauthorized Must be authenticated to use this end point - -swagger:response createWebhookSubscriptionUnauthorized -*/ -type CreateWebhookSubscriptionUnauthorized struct { -} - -// NewCreateWebhookSubscriptionUnauthorized creates CreateWebhookSubscriptionUnauthorized with default headers values -func NewCreateWebhookSubscriptionUnauthorized() *CreateWebhookSubscriptionUnauthorized { - - return &CreateWebhookSubscriptionUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateWebhookSubscriptionForbiddenCode is the HTTP code returned for type CreateWebhookSubscriptionForbidden -const CreateWebhookSubscriptionForbiddenCode int = 403 - -/* -CreateWebhookSubscriptionForbidden Not authorized to create a Webhook Subscription - -swagger:response createWebhookSubscriptionForbidden -*/ -type CreateWebhookSubscriptionForbidden struct { -} - -// NewCreateWebhookSubscriptionForbidden creates CreateWebhookSubscriptionForbidden with default headers values -func NewCreateWebhookSubscriptionForbidden() *CreateWebhookSubscriptionForbidden { - - return &CreateWebhookSubscriptionForbidden{} -} - -// WriteResponse to the client -func (o *CreateWebhookSubscriptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type CreateWebhookSubscriptionInternalServerError -const CreateWebhookSubscriptionInternalServerErrorCode int = 500 - -/* -CreateWebhookSubscriptionInternalServerError Server error - -swagger:response createWebhookSubscriptionInternalServerError -*/ -type CreateWebhookSubscriptionInternalServerError struct { -} - -// NewCreateWebhookSubscriptionInternalServerError creates CreateWebhookSubscriptionInternalServerError with default headers values -func NewCreateWebhookSubscriptionInternalServerError() *CreateWebhookSubscriptionInternalServerError { - - return &CreateWebhookSubscriptionInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go deleted file mode 100644 index e7eb51421fe..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateWebhookSubscriptionURL generates an URL for the create webhook subscription operation -type CreateWebhookSubscriptionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWebhookSubscriptionURL) WithBasePath(bp string) *CreateWebhookSubscriptionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWebhookSubscriptionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateWebhookSubscriptionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-subscriptions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateWebhookSubscriptionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateWebhookSubscriptionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateWebhookSubscriptionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateWebhookSubscriptionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go deleted file mode 100644 index 00c08b15816..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetWebhookSubscriptionHandlerFunc turns a function with the right signature into a get webhook subscription handler -type GetWebhookSubscriptionHandlerFunc func(GetWebhookSubscriptionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetWebhookSubscriptionHandlerFunc) Handle(params GetWebhookSubscriptionParams) middleware.Responder { - return fn(params) -} - -// GetWebhookSubscriptionHandler interface for that can handle valid get webhook subscription params -type GetWebhookSubscriptionHandler interface { - Handle(GetWebhookSubscriptionParams) middleware.Responder -} - -// NewGetWebhookSubscription creates a new http.Handler for the get webhook subscription operation -func NewGetWebhookSubscription(ctx *middleware.Context, handler GetWebhookSubscriptionHandler) *GetWebhookSubscription { - return &GetWebhookSubscription{Context: ctx, Handler: handler} -} - -/* - GetWebhookSubscription swagger:route GET /webhook-subscriptions/{webhookSubscriptionId} Webhook subscriptions getWebhookSubscription - -# Get information about a Webhook Subscription - -This endpoint returns a single Webhook Subscription by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type GetWebhookSubscription struct { - Context *middleware.Context - Handler GetWebhookSubscriptionHandler -} - -func (o *GetWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetWebhookSubscriptionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go deleted file mode 100644 index fc6b2e0649b..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetWebhookSubscriptionParams creates a new GetWebhookSubscriptionParams object -// -// There are no default values defined in the spec. -func NewGetWebhookSubscriptionParams() GetWebhookSubscriptionParams { - - return GetWebhookSubscriptionParams{} -} - -// GetWebhookSubscriptionParams contains all the bound params for the get webhook subscription operation -// typically these are obtained from a http.Request -// -// swagger:parameters getWebhookSubscription -type GetWebhookSubscriptionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - WebhookSubscriptionID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetWebhookSubscriptionParams() beforehand. -func (o *GetWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rWebhookSubscriptionID, rhkWebhookSubscriptionID, _ := route.Params.GetOK("webhookSubscriptionId") - if err := o.bindWebhookSubscriptionID(rWebhookSubscriptionID, rhkWebhookSubscriptionID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindWebhookSubscriptionID binds and validates parameter WebhookSubscriptionID from path. -func (o *GetWebhookSubscriptionParams) bindWebhookSubscriptionID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("webhookSubscriptionId", "path", "strfmt.UUID", raw) - } - o.WebhookSubscriptionID = *(value.(*strfmt.UUID)) - - if err := o.validateWebhookSubscriptionID(formats); err != nil { - return err - } - - return nil -} - -// validateWebhookSubscriptionID carries on validations for parameter WebhookSubscriptionID -func (o *GetWebhookSubscriptionParams) validateWebhookSubscriptionID(formats strfmt.Registry) error { - - if err := validate.FormatOf("webhookSubscriptionId", "path", "uuid", o.WebhookSubscriptionID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go deleted file mode 100644 index 2b6837397dd..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// GetWebhookSubscriptionOKCode is the HTTP code returned for type GetWebhookSubscriptionOK -const GetWebhookSubscriptionOKCode int = 200 - -/* -GetWebhookSubscriptionOK success - -swagger:response getWebhookSubscriptionOK -*/ -type GetWebhookSubscriptionOK struct { - - /* - In: Body - */ - Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` -} - -// NewGetWebhookSubscriptionOK creates GetWebhookSubscriptionOK with default headers values -func NewGetWebhookSubscriptionOK() *GetWebhookSubscriptionOK { - - return &GetWebhookSubscriptionOK{} -} - -// WithPayload adds the payload to the get webhook subscription o k response -func (o *GetWebhookSubscriptionOK) WithPayload(payload *adminmessages.WebhookSubscription) *GetWebhookSubscriptionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get webhook subscription o k response -func (o *GetWebhookSubscriptionOK) SetPayload(payload *adminmessages.WebhookSubscription) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetWebhookSubscriptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetWebhookSubscriptionBadRequestCode is the HTTP code returned for type GetWebhookSubscriptionBadRequest -const GetWebhookSubscriptionBadRequestCode int = 400 - -/* -GetWebhookSubscriptionBadRequest invalid request - -swagger:response getWebhookSubscriptionBadRequest -*/ -type GetWebhookSubscriptionBadRequest struct { -} - -// NewGetWebhookSubscriptionBadRequest creates GetWebhookSubscriptionBadRequest with default headers values -func NewGetWebhookSubscriptionBadRequest() *GetWebhookSubscriptionBadRequest { - - return &GetWebhookSubscriptionBadRequest{} -} - -// WriteResponse to the client -func (o *GetWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type GetWebhookSubscriptionUnauthorized -const GetWebhookSubscriptionUnauthorizedCode int = 401 - -/* -GetWebhookSubscriptionUnauthorized request requires user authentication - -swagger:response getWebhookSubscriptionUnauthorized -*/ -type GetWebhookSubscriptionUnauthorized struct { -} - -// NewGetWebhookSubscriptionUnauthorized creates GetWebhookSubscriptionUnauthorized with default headers values -func NewGetWebhookSubscriptionUnauthorized() *GetWebhookSubscriptionUnauthorized { - - return &GetWebhookSubscriptionUnauthorized{} -} - -// WriteResponse to the client -func (o *GetWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetWebhookSubscriptionNotFoundCode is the HTTP code returned for type GetWebhookSubscriptionNotFound -const GetWebhookSubscriptionNotFoundCode int = 404 - -/* -GetWebhookSubscriptionNotFound Webhook Subscription not found - -swagger:response getWebhookSubscriptionNotFound -*/ -type GetWebhookSubscriptionNotFound struct { -} - -// NewGetWebhookSubscriptionNotFound creates GetWebhookSubscriptionNotFound with default headers values -func NewGetWebhookSubscriptionNotFound() *GetWebhookSubscriptionNotFound { - - return &GetWebhookSubscriptionNotFound{} -} - -// WriteResponse to the client -func (o *GetWebhookSubscriptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// GetWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type GetWebhookSubscriptionInternalServerError -const GetWebhookSubscriptionInternalServerErrorCode int = 500 - -/* -GetWebhookSubscriptionInternalServerError server error - -swagger:response getWebhookSubscriptionInternalServerError -*/ -type GetWebhookSubscriptionInternalServerError struct { -} - -// NewGetWebhookSubscriptionInternalServerError creates GetWebhookSubscriptionInternalServerError with default headers values -func NewGetWebhookSubscriptionInternalServerError() *GetWebhookSubscriptionInternalServerError { - - return &GetWebhookSubscriptionInternalServerError{} -} - -// WriteResponse to the client -func (o *GetWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go deleted file mode 100644 index 433880f27d1..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetWebhookSubscriptionURL generates an URL for the get webhook subscription operation -type GetWebhookSubscriptionURL struct { - WebhookSubscriptionID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetWebhookSubscriptionURL) WithBasePath(bp string) *GetWebhookSubscriptionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetWebhookSubscriptionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetWebhookSubscriptionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-subscriptions/{webhookSubscriptionId}" - - webhookSubscriptionID := o.WebhookSubscriptionID.String() - if webhookSubscriptionID != "" { - _path = strings.Replace(_path, "{webhookSubscriptionId}", webhookSubscriptionID, -1) - } else { - return nil, errors.New("webhookSubscriptionId is required on GetWebhookSubscriptionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetWebhookSubscriptionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetWebhookSubscriptionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetWebhookSubscriptionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetWebhookSubscriptionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go deleted file mode 100644 index cfcd49ed6d0..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexWebhookSubscriptionsHandlerFunc turns a function with the right signature into a index webhook subscriptions handler -type IndexWebhookSubscriptionsHandlerFunc func(IndexWebhookSubscriptionsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexWebhookSubscriptionsHandlerFunc) Handle(params IndexWebhookSubscriptionsParams) middleware.Responder { - return fn(params) -} - -// IndexWebhookSubscriptionsHandler interface for that can handle valid index webhook subscriptions params -type IndexWebhookSubscriptionsHandler interface { - Handle(IndexWebhookSubscriptionsParams) middleware.Responder -} - -// NewIndexWebhookSubscriptions creates a new http.Handler for the index webhook subscriptions operation -func NewIndexWebhookSubscriptions(ctx *middleware.Context, handler IndexWebhookSubscriptionsHandler) *IndexWebhookSubscriptions { - return &IndexWebhookSubscriptions{Context: ctx, Handler: handler} -} - -/* - IndexWebhookSubscriptions swagger:route GET /webhook-subscriptions Webhook subscriptions indexWebhookSubscriptions - -# Lists Webhook Subscriptions - -This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint -directly as it is meant to be used with the Admin UI exclusively. -*/ -type IndexWebhookSubscriptions struct { - Context *middleware.Context - Handler IndexWebhookSubscriptionsHandler -} - -func (o *IndexWebhookSubscriptions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexWebhookSubscriptionsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go deleted file mode 100644 index 4a772c8782c..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewIndexWebhookSubscriptionsParams creates a new IndexWebhookSubscriptionsParams object -// -// There are no default values defined in the spec. -func NewIndexWebhookSubscriptionsParams() IndexWebhookSubscriptionsParams { - - return IndexWebhookSubscriptionsParams{} -} - -// IndexWebhookSubscriptionsParams contains all the bound params for the index webhook subscriptions operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexWebhookSubscriptions -type IndexWebhookSubscriptionsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - Filter *string - /* - In: query - */ - Order *bool - /* - In: query - */ - Page *int64 - /* - In: query - */ - PerPage *int64 - /* - In: query - */ - Sort *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexWebhookSubscriptionsParams() beforehand. -func (o *IndexWebhookSubscriptionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qFilter, qhkFilter, _ := qs.GetOK("filter") - if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFilter binds and validates parameter Filter from query. -func (o *IndexWebhookSubscriptionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Filter = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *IndexWebhookSubscriptionsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("order", "query", "bool", raw) - } - o.Order = &value - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *IndexWebhookSubscriptionsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *IndexWebhookSubscriptionsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *IndexWebhookSubscriptionsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go deleted file mode 100644 index c021e842203..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// IndexWebhookSubscriptionsOKCode is the HTTP code returned for type IndexWebhookSubscriptionsOK -const IndexWebhookSubscriptionsOKCode int = 200 - -/* -IndexWebhookSubscriptionsOK success - -swagger:response indexWebhookSubscriptionsOK -*/ -type IndexWebhookSubscriptionsOK struct { - /*Used for pagination - - */ - ContentRange string `json:"Content-Range"` - - /* - In: Body - */ - Payload adminmessages.WebhookSubscriptions `json:"body,omitempty"` -} - -// NewIndexWebhookSubscriptionsOK creates IndexWebhookSubscriptionsOK with default headers values -func NewIndexWebhookSubscriptionsOK() *IndexWebhookSubscriptionsOK { - - return &IndexWebhookSubscriptionsOK{} -} - -// WithContentRange adds the contentRange to the index webhook subscriptions o k response -func (o *IndexWebhookSubscriptionsOK) WithContentRange(contentRange string) *IndexWebhookSubscriptionsOK { - o.ContentRange = contentRange - return o -} - -// SetContentRange sets the contentRange to the index webhook subscriptions o k response -func (o *IndexWebhookSubscriptionsOK) SetContentRange(contentRange string) { - o.ContentRange = contentRange -} - -// WithPayload adds the payload to the index webhook subscriptions o k response -func (o *IndexWebhookSubscriptionsOK) WithPayload(payload adminmessages.WebhookSubscriptions) *IndexWebhookSubscriptionsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index webhook subscriptions o k response -func (o *IndexWebhookSubscriptionsOK) SetPayload(payload adminmessages.WebhookSubscriptions) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexWebhookSubscriptionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Range - - contentRange := o.ContentRange - if contentRange != "" { - rw.Header().Set("Content-Range", contentRange) - } - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = adminmessages.WebhookSubscriptions{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexWebhookSubscriptionsBadRequestCode is the HTTP code returned for type IndexWebhookSubscriptionsBadRequest -const IndexWebhookSubscriptionsBadRequestCode int = 400 - -/* -IndexWebhookSubscriptionsBadRequest Invalid request - -swagger:response indexWebhookSubscriptionsBadRequest -*/ -type IndexWebhookSubscriptionsBadRequest struct { -} - -// NewIndexWebhookSubscriptionsBadRequest creates IndexWebhookSubscriptionsBadRequest with default headers values -func NewIndexWebhookSubscriptionsBadRequest() *IndexWebhookSubscriptionsBadRequest { - - return &IndexWebhookSubscriptionsBadRequest{} -} - -// WriteResponse to the client -func (o *IndexWebhookSubscriptionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexWebhookSubscriptionsUnauthorizedCode is the HTTP code returned for type IndexWebhookSubscriptionsUnauthorized -const IndexWebhookSubscriptionsUnauthorizedCode int = 401 - -/* -IndexWebhookSubscriptionsUnauthorized Not authenticated for this endpoint - -swagger:response indexWebhookSubscriptionsUnauthorized -*/ -type IndexWebhookSubscriptionsUnauthorized struct { -} - -// NewIndexWebhookSubscriptionsUnauthorized creates IndexWebhookSubscriptionsUnauthorized with default headers values -func NewIndexWebhookSubscriptionsUnauthorized() *IndexWebhookSubscriptionsUnauthorized { - - return &IndexWebhookSubscriptionsUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexWebhookSubscriptionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexWebhookSubscriptionsNotFoundCode is the HTTP code returned for type IndexWebhookSubscriptionsNotFound -const IndexWebhookSubscriptionsNotFoundCode int = 404 - -/* -IndexWebhookSubscriptionsNotFound Webhook Subscriptions not found - -swagger:response indexWebhookSubscriptionsNotFound -*/ -type IndexWebhookSubscriptionsNotFound struct { -} - -// NewIndexWebhookSubscriptionsNotFound creates IndexWebhookSubscriptionsNotFound with default headers values -func NewIndexWebhookSubscriptionsNotFound() *IndexWebhookSubscriptionsNotFound { - - return &IndexWebhookSubscriptionsNotFound{} -} - -// WriteResponse to the client -func (o *IndexWebhookSubscriptionsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexWebhookSubscriptionsInternalServerErrorCode is the HTTP code returned for type IndexWebhookSubscriptionsInternalServerError -const IndexWebhookSubscriptionsInternalServerErrorCode int = 500 - -/* -IndexWebhookSubscriptionsInternalServerError Server error - -swagger:response indexWebhookSubscriptionsInternalServerError -*/ -type IndexWebhookSubscriptionsInternalServerError struct { -} - -// NewIndexWebhookSubscriptionsInternalServerError creates IndexWebhookSubscriptionsInternalServerError with default headers values -func NewIndexWebhookSubscriptionsInternalServerError() *IndexWebhookSubscriptionsInternalServerError { - - return &IndexWebhookSubscriptionsInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexWebhookSubscriptionsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go deleted file mode 100644 index 1da7c9f4715..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go +++ /dev/null @@ -1,141 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// IndexWebhookSubscriptionsURL generates an URL for the index webhook subscriptions operation -type IndexWebhookSubscriptionsURL struct { - Filter *string - Order *bool - Page *int64 - PerPage *int64 - Sort *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexWebhookSubscriptionsURL) WithBasePath(bp string) *IndexWebhookSubscriptionsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexWebhookSubscriptionsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexWebhookSubscriptionsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-subscriptions" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var filterQ string - if o.Filter != nil { - filterQ = *o.Filter - } - if filterQ != "" { - qs.Set("filter", filterQ) - } - - var orderQ string - if o.Order != nil { - orderQ = swag.FormatBool(*o.Order) - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexWebhookSubscriptionsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexWebhookSubscriptionsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexWebhookSubscriptionsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexWebhookSubscriptionsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexWebhookSubscriptionsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexWebhookSubscriptionsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go deleted file mode 100644 index 51c32be2f80..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateWebhookSubscriptionHandlerFunc turns a function with the right signature into a update webhook subscription handler -type UpdateWebhookSubscriptionHandlerFunc func(UpdateWebhookSubscriptionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateWebhookSubscriptionHandlerFunc) Handle(params UpdateWebhookSubscriptionParams) middleware.Responder { - return fn(params) -} - -// UpdateWebhookSubscriptionHandler interface for that can handle valid update webhook subscription params -type UpdateWebhookSubscriptionHandler interface { - Handle(UpdateWebhookSubscriptionParams) middleware.Responder -} - -// NewUpdateWebhookSubscription creates a new http.Handler for the update webhook subscription operation -func NewUpdateWebhookSubscription(ctx *middleware.Context, handler UpdateWebhookSubscriptionHandler) *UpdateWebhookSubscription { - return &UpdateWebhookSubscription{Context: ctx, Handler: handler} -} - -/* - UpdateWebhookSubscription swagger:route PATCH /webhook-subscriptions/{webhookSubscriptionId} Webhook subscriptions updateWebhookSubscription - -# Update a Webhook Subscription - -This endpoint updates a single Webhook Subscription by ID. Do not use this -endpoint directly as it is meant to be used with the Admin UI exclusively. -*/ -type UpdateWebhookSubscription struct { - Context *middleware.Context - Handler UpdateWebhookSubscriptionHandler -} - -func (o *UpdateWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateWebhookSubscriptionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go deleted file mode 100644 index 261d30d765f..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// NewUpdateWebhookSubscriptionParams creates a new UpdateWebhookSubscriptionParams object -// -// There are no default values defined in the spec. -func NewUpdateWebhookSubscriptionParams() UpdateWebhookSubscriptionParams { - - return UpdateWebhookSubscriptionParams{} -} - -// UpdateWebhookSubscriptionParams contains all the bound params for the update webhook subscription operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateWebhookSubscription -type UpdateWebhookSubscriptionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*Webhook Subscription information - Required: true - In: body - */ - WebhookSubscription *adminmessages.WebhookSubscription - /* - Required: true - In: path - */ - WebhookSubscriptionID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateWebhookSubscriptionParams() beforehand. -func (o *UpdateWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body adminmessages.WebhookSubscription - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("webhookSubscription", "body", "")) - } else { - res = append(res, errors.NewParseError("webhookSubscription", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.WebhookSubscription = &body - } - } - } else { - res = append(res, errors.Required("webhookSubscription", "body", "")) - } - - rWebhookSubscriptionID, rhkWebhookSubscriptionID, _ := route.Params.GetOK("webhookSubscriptionId") - if err := o.bindWebhookSubscriptionID(rWebhookSubscriptionID, rhkWebhookSubscriptionID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateWebhookSubscriptionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindWebhookSubscriptionID binds and validates parameter WebhookSubscriptionID from path. -func (o *UpdateWebhookSubscriptionParams) bindWebhookSubscriptionID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("webhookSubscriptionId", "path", "strfmt.UUID", raw) - } - o.WebhookSubscriptionID = *(value.(*strfmt.UUID)) - - if err := o.validateWebhookSubscriptionID(formats); err != nil { - return err - } - - return nil -} - -// validateWebhookSubscriptionID carries on validations for parameter WebhookSubscriptionID -func (o *UpdateWebhookSubscriptionParams) validateWebhookSubscriptionID(formats strfmt.Registry) error { - - if err := validate.FormatOf("webhookSubscriptionId", "path", "uuid", o.WebhookSubscriptionID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go deleted file mode 100644 index c231b611c3f..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/adminmessages" -) - -// UpdateWebhookSubscriptionOKCode is the HTTP code returned for type UpdateWebhookSubscriptionOK -const UpdateWebhookSubscriptionOKCode int = 200 - -/* -UpdateWebhookSubscriptionOK Successfully updated Webhook Subscription - -swagger:response updateWebhookSubscriptionOK -*/ -type UpdateWebhookSubscriptionOK struct { - - /* - In: Body - */ - Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` -} - -// NewUpdateWebhookSubscriptionOK creates UpdateWebhookSubscriptionOK with default headers values -func NewUpdateWebhookSubscriptionOK() *UpdateWebhookSubscriptionOK { - - return &UpdateWebhookSubscriptionOK{} -} - -// WithPayload adds the payload to the update webhook subscription o k response -func (o *UpdateWebhookSubscriptionOK) WithPayload(payload *adminmessages.WebhookSubscription) *UpdateWebhookSubscriptionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update webhook subscription o k response -func (o *UpdateWebhookSubscriptionOK) SetPayload(payload *adminmessages.WebhookSubscription) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWebhookSubscriptionBadRequestCode is the HTTP code returned for type UpdateWebhookSubscriptionBadRequest -const UpdateWebhookSubscriptionBadRequestCode int = 400 - -/* -UpdateWebhookSubscriptionBadRequest Invalid Request - -swagger:response updateWebhookSubscriptionBadRequest -*/ -type UpdateWebhookSubscriptionBadRequest struct { -} - -// NewUpdateWebhookSubscriptionBadRequest creates UpdateWebhookSubscriptionBadRequest with default headers values -func NewUpdateWebhookSubscriptionBadRequest() *UpdateWebhookSubscriptionBadRequest { - - return &UpdateWebhookSubscriptionBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type UpdateWebhookSubscriptionUnauthorized -const UpdateWebhookSubscriptionUnauthorizedCode int = 401 - -/* -UpdateWebhookSubscriptionUnauthorized Must be authenticated to use this end point - -swagger:response updateWebhookSubscriptionUnauthorized -*/ -type UpdateWebhookSubscriptionUnauthorized struct { -} - -// NewUpdateWebhookSubscriptionUnauthorized creates UpdateWebhookSubscriptionUnauthorized with default headers values -func NewUpdateWebhookSubscriptionUnauthorized() *UpdateWebhookSubscriptionUnauthorized { - - return &UpdateWebhookSubscriptionUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateWebhookSubscriptionForbiddenCode is the HTTP code returned for type UpdateWebhookSubscriptionForbidden -const UpdateWebhookSubscriptionForbiddenCode int = 403 - -/* -UpdateWebhookSubscriptionForbidden Not authorized to update this Webhook Subscription - -swagger:response updateWebhookSubscriptionForbidden -*/ -type UpdateWebhookSubscriptionForbidden struct { -} - -// NewUpdateWebhookSubscriptionForbidden creates UpdateWebhookSubscriptionForbidden with default headers values -func NewUpdateWebhookSubscriptionForbidden() *UpdateWebhookSubscriptionForbidden { - - return &UpdateWebhookSubscriptionForbidden{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateWebhookSubscriptionNotFoundCode is the HTTP code returned for type UpdateWebhookSubscriptionNotFound -const UpdateWebhookSubscriptionNotFoundCode int = 404 - -/* -UpdateWebhookSubscriptionNotFound Webhook Subscription not found - -swagger:response updateWebhookSubscriptionNotFound -*/ -type UpdateWebhookSubscriptionNotFound struct { -} - -// NewUpdateWebhookSubscriptionNotFound creates UpdateWebhookSubscriptionNotFound with default headers values -func NewUpdateWebhookSubscriptionNotFound() *UpdateWebhookSubscriptionNotFound { - - return &UpdateWebhookSubscriptionNotFound{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateWebhookSubscriptionPreconditionFailedCode is the HTTP code returned for type UpdateWebhookSubscriptionPreconditionFailed -const UpdateWebhookSubscriptionPreconditionFailedCode int = 412 - -/* -UpdateWebhookSubscriptionPreconditionFailed Precondition failed - -swagger:response updateWebhookSubscriptionPreconditionFailed -*/ -type UpdateWebhookSubscriptionPreconditionFailed struct { -} - -// NewUpdateWebhookSubscriptionPreconditionFailed creates UpdateWebhookSubscriptionPreconditionFailed with default headers values -func NewUpdateWebhookSubscriptionPreconditionFailed() *UpdateWebhookSubscriptionPreconditionFailed { - - return &UpdateWebhookSubscriptionPreconditionFailed{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(412) -} - -// UpdateWebhookSubscriptionUnprocessableEntityCode is the HTTP code returned for type UpdateWebhookSubscriptionUnprocessableEntity -const UpdateWebhookSubscriptionUnprocessableEntityCode int = 422 - -/* -UpdateWebhookSubscriptionUnprocessableEntity Validation error - -swagger:response updateWebhookSubscriptionUnprocessableEntity -*/ -type UpdateWebhookSubscriptionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *adminmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateWebhookSubscriptionUnprocessableEntity creates UpdateWebhookSubscriptionUnprocessableEntity with default headers values -func NewUpdateWebhookSubscriptionUnprocessableEntity() *UpdateWebhookSubscriptionUnprocessableEntity { - - return &UpdateWebhookSubscriptionUnprocessableEntity{} -} - -// WithPayload adds the payload to the update webhook subscription unprocessable entity response -func (o *UpdateWebhookSubscriptionUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateWebhookSubscriptionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update webhook subscription unprocessable entity response -func (o *UpdateWebhookSubscriptionUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type UpdateWebhookSubscriptionInternalServerError -const UpdateWebhookSubscriptionInternalServerErrorCode int = 500 - -/* -UpdateWebhookSubscriptionInternalServerError Server error - -swagger:response updateWebhookSubscriptionInternalServerError -*/ -type UpdateWebhookSubscriptionInternalServerError struct { -} - -// NewUpdateWebhookSubscriptionInternalServerError creates UpdateWebhookSubscriptionInternalServerError with default headers values -func NewUpdateWebhookSubscriptionInternalServerError() *UpdateWebhookSubscriptionInternalServerError { - - return &UpdateWebhookSubscriptionInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go deleted file mode 100644 index 73337ee6869..00000000000 --- a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook_subscriptions - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateWebhookSubscriptionURL generates an URL for the update webhook subscription operation -type UpdateWebhookSubscriptionURL struct { - WebhookSubscriptionID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWebhookSubscriptionURL) WithBasePath(bp string) *UpdateWebhookSubscriptionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWebhookSubscriptionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateWebhookSubscriptionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-subscriptions/{webhookSubscriptionId}" - - webhookSubscriptionID := o.WebhookSubscriptionID.String() - if webhookSubscriptionID != "" { - _path = strings.Replace(_path, "{webhookSubscriptionId}", webhookSubscriptionID, -1) - } else { - return nil, errors.New("webhookSubscriptionId is required on UpdateWebhookSubscriptionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/admin/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateWebhookSubscriptionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateWebhookSubscriptionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateWebhookSubscriptionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateWebhookSubscriptionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/adminapi/configure_mymove.go b/pkg/gen/adminapi/configure_mymove.go deleted file mode 100644 index 1e8322fbfe9..00000000000 --- a/pkg/gen/adminapi/configure_mymove.go +++ /dev/null @@ -1,265 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package adminapi - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/admin_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/client_certificates" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/electronic_orders" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/moves" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/notifications" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/office_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/organizations" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_file" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_files" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/requested_office_users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/transportation_offices" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/uploads" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/user" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/users" - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/webhook_subscriptions" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/admin.yaml --api-package adminoperations --model-package adminmessages --server-package adminapi --principal interface{} --exclude-main - -func configureFlags(api *adminoperations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *adminoperations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - - api.JSONProducer = runtime.JSONProducer() - - if api.AdminUsersCreateAdminUserHandler == nil { - api.AdminUsersCreateAdminUserHandler = admin_users.CreateAdminUserHandlerFunc(func(params admin_users.CreateAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.CreateAdminUser has not yet been implemented") - }) - } - if api.ClientCertificatesCreateClientCertificateHandler == nil { - api.ClientCertificatesCreateClientCertificateHandler = client_certificates.CreateClientCertificateHandlerFunc(func(params client_certificates.CreateClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.CreateClientCertificate has not yet been implemented") - }) - } - if api.OfficeUsersCreateOfficeUserHandler == nil { - api.OfficeUsersCreateOfficeUserHandler = office_users.CreateOfficeUserHandlerFunc(func(params office_users.CreateOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.CreateOfficeUser has not yet been implemented") - }) - } - if api.WebhookSubscriptionsCreateWebhookSubscriptionHandler == nil { - api.WebhookSubscriptionsCreateWebhookSubscriptionHandler = webhook_subscriptions.CreateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.CreateWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.CreateWebhookSubscription has not yet been implemented") - }) - } - if api.AdminUsersGetAdminUserHandler == nil { - api.AdminUsersGetAdminUserHandler = admin_users.GetAdminUserHandlerFunc(func(params admin_users.GetAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.GetAdminUser has not yet been implemented") - }) - } - if api.ClientCertificatesGetClientCertificateHandler == nil { - api.ClientCertificatesGetClientCertificateHandler = client_certificates.GetClientCertificateHandlerFunc(func(params client_certificates.GetClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.GetClientCertificate has not yet been implemented") - }) - } - if api.ElectronicOrdersGetElectronicOrdersTotalsHandler == nil { - api.ElectronicOrdersGetElectronicOrdersTotalsHandler = electronic_orders.GetElectronicOrdersTotalsHandlerFunc(func(params electronic_orders.GetElectronicOrdersTotalsParams) middleware.Responder { - return middleware.NotImplemented("operation electronic_orders.GetElectronicOrdersTotals has not yet been implemented") - }) - } - if api.UserGetLoggedInAdminUserHandler == nil { - api.UserGetLoggedInAdminUserHandler = user.GetLoggedInAdminUserHandlerFunc(func(params user.GetLoggedInAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation user.GetLoggedInAdminUser has not yet been implemented") - }) - } - if api.MovesGetMoveHandler == nil { - api.MovesGetMoveHandler = moves.GetMoveHandlerFunc(func(params moves.GetMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.GetMove has not yet been implemented") - }) - } - if api.TransportationOfficesGetOfficeByIDHandler == nil { - api.TransportationOfficesGetOfficeByIDHandler = transportation_offices.GetOfficeByIDHandlerFunc(func(params transportation_offices.GetOfficeByIDParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.GetOfficeByID has not yet been implemented") - }) - } - if api.OfficeUsersGetOfficeUserHandler == nil { - api.OfficeUsersGetOfficeUserHandler = office_users.GetOfficeUserHandlerFunc(func(params office_users.GetOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.GetOfficeUser has not yet been implemented") - }) - } - if api.RequestedOfficeUsersGetRequestedOfficeUserHandler == nil { - api.RequestedOfficeUsersGetRequestedOfficeUserHandler = requested_office_users.GetRequestedOfficeUserHandlerFunc(func(params requested_office_users.GetRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.GetRequestedOfficeUser has not yet been implemented") - }) - } - if api.UploadsGetUploadHandler == nil { - api.UploadsGetUploadHandler = uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") - }) - } - if api.UsersGetUserHandler == nil { - api.UsersGetUserHandler = users.GetUserHandlerFunc(func(params users.GetUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.GetUser has not yet been implemented") - }) - } - if api.WebhookSubscriptionsGetWebhookSubscriptionHandler == nil { - api.WebhookSubscriptionsGetWebhookSubscriptionHandler = webhook_subscriptions.GetWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.GetWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.GetWebhookSubscription has not yet been implemented") - }) - } - if api.AdminUsersIndexAdminUsersHandler == nil { - api.AdminUsersIndexAdminUsersHandler = admin_users.IndexAdminUsersHandlerFunc(func(params admin_users.IndexAdminUsersParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.IndexAdminUsers has not yet been implemented") - }) - } - if api.ClientCertificatesIndexClientCertificatesHandler == nil { - api.ClientCertificatesIndexClientCertificatesHandler = client_certificates.IndexClientCertificatesHandlerFunc(func(params client_certificates.IndexClientCertificatesParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.IndexClientCertificates has not yet been implemented") - }) - } - if api.ElectronicOrdersIndexElectronicOrdersHandler == nil { - api.ElectronicOrdersIndexElectronicOrdersHandler = electronic_orders.IndexElectronicOrdersHandlerFunc(func(params electronic_orders.IndexElectronicOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation electronic_orders.IndexElectronicOrders has not yet been implemented") - }) - } - if api.MovesIndexMovesHandler == nil { - api.MovesIndexMovesHandler = moves.IndexMovesHandlerFunc(func(params moves.IndexMovesParams) middleware.Responder { - return middleware.NotImplemented("operation moves.IndexMoves has not yet been implemented") - }) - } - if api.NotificationsIndexNotificationsHandler == nil { - api.NotificationsIndexNotificationsHandler = notifications.IndexNotificationsHandlerFunc(func(params notifications.IndexNotificationsParams) middleware.Responder { - return middleware.NotImplemented("operation notifications.IndexNotifications has not yet been implemented") - }) - } - if api.OfficeUsersIndexOfficeUsersHandler == nil { - api.OfficeUsersIndexOfficeUsersHandler = office_users.IndexOfficeUsersHandlerFunc(func(params office_users.IndexOfficeUsersParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.IndexOfficeUsers has not yet been implemented") - }) - } - if api.TransportationOfficesIndexOfficesHandler == nil { - api.TransportationOfficesIndexOfficesHandler = transportation_offices.IndexOfficesHandlerFunc(func(params transportation_offices.IndexOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.IndexOffices has not yet been implemented") - }) - } - if api.OrganizationsIndexOrganizationsHandler == nil { - api.OrganizationsIndexOrganizationsHandler = organizations.IndexOrganizationsHandlerFunc(func(params organizations.IndexOrganizationsParams) middleware.Responder { - return middleware.NotImplemented("operation organizations.IndexOrganizations has not yet been implemented") - }) - } - if api.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler == nil { - api.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler = payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandlerFunc(func(params payment_request_syncada_files.IndexPaymentRequestSyncadaFilesParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request_syncada_files.IndexPaymentRequestSyncadaFiles has not yet been implemented") - }) - } - if api.RequestedOfficeUsersIndexRequestedOfficeUsersHandler == nil { - api.RequestedOfficeUsersIndexRequestedOfficeUsersHandler = requested_office_users.IndexRequestedOfficeUsersHandlerFunc(func(params requested_office_users.IndexRequestedOfficeUsersParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.IndexRequestedOfficeUsers has not yet been implemented") - }) - } - if api.UsersIndexUsersHandler == nil { - api.UsersIndexUsersHandler = users.IndexUsersHandlerFunc(func(params users.IndexUsersParams) middleware.Responder { - return middleware.NotImplemented("operation users.IndexUsers has not yet been implemented") - }) - } - if api.WebhookSubscriptionsIndexWebhookSubscriptionsHandler == nil { - api.WebhookSubscriptionsIndexWebhookSubscriptionsHandler = webhook_subscriptions.IndexWebhookSubscriptionsHandlerFunc(func(params webhook_subscriptions.IndexWebhookSubscriptionsParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.IndexWebhookSubscriptions has not yet been implemented") - }) - } - if api.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler == nil { - api.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler = payment_request_syncada_file.PaymentRequestSyncadaFileHandlerFunc(func(params payment_request_syncada_file.PaymentRequestSyncadaFileParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request_syncada_file.PaymentRequestSyncadaFile has not yet been implemented") - }) - } - if api.ClientCertificatesRemoveClientCertificateHandler == nil { - api.ClientCertificatesRemoveClientCertificateHandler = client_certificates.RemoveClientCertificateHandlerFunc(func(params client_certificates.RemoveClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.RemoveClientCertificate has not yet been implemented") - }) - } - if api.AdminUsersUpdateAdminUserHandler == nil { - api.AdminUsersUpdateAdminUserHandler = admin_users.UpdateAdminUserHandlerFunc(func(params admin_users.UpdateAdminUserParams) middleware.Responder { - return middleware.NotImplemented("operation admin_users.UpdateAdminUser has not yet been implemented") - }) - } - if api.ClientCertificatesUpdateClientCertificateHandler == nil { - api.ClientCertificatesUpdateClientCertificateHandler = client_certificates.UpdateClientCertificateHandlerFunc(func(params client_certificates.UpdateClientCertificateParams) middleware.Responder { - return middleware.NotImplemented("operation client_certificates.UpdateClientCertificate has not yet been implemented") - }) - } - if api.MovesUpdateMoveHandler == nil { - api.MovesUpdateMoveHandler = moves.UpdateMoveHandlerFunc(func(params moves.UpdateMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.UpdateMove has not yet been implemented") - }) - } - if api.OfficeUsersUpdateOfficeUserHandler == nil { - api.OfficeUsersUpdateOfficeUserHandler = office_users.UpdateOfficeUserHandlerFunc(func(params office_users.UpdateOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.UpdateOfficeUser has not yet been implemented") - }) - } - if api.RequestedOfficeUsersUpdateRequestedOfficeUserHandler == nil { - api.RequestedOfficeUsersUpdateRequestedOfficeUserHandler = requested_office_users.UpdateRequestedOfficeUserHandlerFunc(func(params requested_office_users.UpdateRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation requested_office_users.UpdateRequestedOfficeUser has not yet been implemented") - }) - } - if api.UsersUpdateUserHandler == nil { - api.UsersUpdateUserHandler = users.UpdateUserHandlerFunc(func(params users.UpdateUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.UpdateUser has not yet been implemented") - }) - } - if api.WebhookSubscriptionsUpdateWebhookSubscriptionHandler == nil { - api.WebhookSubscriptionsUpdateWebhookSubscriptionHandler = webhook_subscriptions.UpdateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.UpdateWebhookSubscriptionParams) middleware.Responder { - return middleware.NotImplemented("operation webhook_subscriptions.UpdateWebhookSubscription has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/adminapi/doc.go b/pkg/gen/adminapi/doc.go deleted file mode 100644 index 9936bacd9d1..00000000000 --- a/pkg/gen/adminapi/doc.go +++ /dev/null @@ -1,24 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package adminapi MilMove Admin API -// -// The Admin API is a RESTful API that enables the Admin application for MilMove. -// -// All endpoints are located under `/admin/v1`. -// -// Schemes: -// https -// Host: localhost -// BasePath: /admin/v1 -// Version: 1.0.0 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// -// Produces: -// - application/json -// -// swagger:meta -package adminapi diff --git a/pkg/gen/adminapi/embedded_spec.go b/pkg/gen/adminapi/embedded_spec.go deleted file mode 100644 index c92c3d50045..00000000000 --- a/pkg/gen/adminapi/embedded_spec.go +++ /dev/null @@ -1,7339 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminapi - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "The Admin API is a RESTful API that enables the Admin application for MilMove.\n\nAll endpoints are located under ` + "`" + `/admin/v1` + "`" + `.\n", - "title": "MilMove Admin API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "1.0.0" - }, - "basePath": "/admin/v1", - "paths": { - "/admin-users": { - "get": { - "description": "This endpoint returns a list of Admin Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "List Admin Users", - "operationId": "indexAdminUsers", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin Users not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates an Admin User record and returns the created record in the\n` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used with\nthe Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Create an Admin User", - "operationId": "createAdminUser", - "parameters": [ - { - "description": "Admin User information", - "name": "adminUser", - "in": "body", - "schema": { - "$ref": "#/definitions/AdminUserCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Admin User", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create an Admin User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/admin-users/{adminUserId}": { - "get": { - "description": "This endpoint returns a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Fetch a specific Admin User", - "operationId": "getAdminUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "adminUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Updates an Admin User", - "operationId": "updateAdminUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "adminUserId", - "in": "path", - "required": true - }, - { - "description": "Admin User information", - "name": "adminUser", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AdminUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Admin User", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update an Admin User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/client-certificates": { - "get": { - "description": "This endpoint returns a list of Client Certificates. Do not use this\nendpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "List client certificates", - "operationId": "indexClientCertificates", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ClientCertificates" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "office not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates a Client Certificate record and returns the\ncreated record in the ` + "`" + `201` + "`" + ` response. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "create a client cert", - "operationId": "createClientCertificate", - "parameters": [ - { - "description": "client cert information", - "name": "clientCertificate", - "in": "body", - "schema": { - "$ref": "#/definitions/ClientCertificateCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created client certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create a client certificate" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/client-certificates/{clientCertificateId}": { - "get": { - "description": "This endpoint returns a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "Get a client certificate", - "operationId": "getClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "id not found" - }, - "500": { - "description": "server error" - } - } - }, - "delete": { - "description": "This endpoint removes a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "removes a client certificate", - "operationId": "removeClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully removed Client Certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to remove a client certificate" - }, - "500": { - "description": "Server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "Updates a client certificate", - "operationId": "updateClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - }, - { - "description": "client cert information", - "name": "clientCertificate", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ClientCertificateUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Client Certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update a client certificate" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/electronic-orders": { - "get": { - "description": "This endpoint returns a list of Electronic Orders. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Electronic orders" - ], - "summary": "List Electronic Orders", - "operationId": "indexElectronicOrders", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ElectronicOrders" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Electronic Order not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/electronic-orders/totals": { - "get": { - "description": "This endpoint returns a list of record counts for Electronic Orders. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Electronic orders" - ], - "summary": "Get total counts for the orders stored in MilMove", - "operationId": "getElectronicOrdersTotals", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "andFilter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ElectronicOrdersTotals" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Total count for Electronic Orders not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves": { - "get": { - "description": "This endpoint returns a list of Moves. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "List Moves", - "operationId": "indexMoves", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Moves" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Moves not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveID}": { - "get": { - "description": "This endpoint returns a single Move by ID. Do not use this endpoint directly as\nit is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "Get information about a Move", - "operationId": "getMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Must be authenticated to use this endpoint" - }, - "404": { - "description": "Move not found" - }, - "500": { - "description": "Server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Move by ID. This allows the Admin User to change\nthe ` + "`" + `show` + "`" + ` field on the selected field to either ` + "`" + `True` + "`" + ` or ` + "`" + `False` + "`" + `. A \"shown\"\nMove will appear to all users as normal, a \"hidden\" Move will not be returned or\neditable using any other endpoint (besides those in the Support API), and thus\neffectively deactivated. Do not use this endpoint directly as it is meant to be\nused with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "Toggle Move visibility", - "operationId": "updateMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveID", - "in": "path", - "required": true - }, - { - "description": "Move information", - "name": "Move", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Must be authenticated to use this endpoint" - }, - "403": { - "description": "Not authorized to update this Move" - }, - "404": { - "description": "Move not found" - }, - "422": { - "description": "Invalid input" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/notifications": { - "get": { - "description": "This endpoint returns a list of Notifications that have been sent to Service\nMembers. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "List Notifications", - "operationId": "indexNotifications", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Notifications" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Notifications not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/office-users": { - "get": { - "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "List of Office Users", - "operationId": "indexOfficeUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates an Office User record and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. If there are issues with the Office User information\nprovided a ` + "`" + `422` + "`" + ` response will occur with information about invalid fields and\nadditional details. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Create an Office User", - "operationId": "createOfficeUser", - "parameters": [ - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "schema": { - "$ref": "#/definitions/OfficeUserCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Office User", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/office-users/{officeUserId}": { - "get": { - "description": "This endpoint returns a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Get an Office User", - "operationId": "getOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Updates an Office User", - "operationId": "updateOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - }, - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/OfficeUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Office User", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update an Office User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/offices": { - "get": { - "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Transportation offices" - ], - "summary": "List Transportation Offices", - "operationId": "indexOffices", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/TransportationOffices" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Transportation Office not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/offices/{officeId}": { - "get": { - "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Transportation offices" - ], - "summary": "Get Transportation Office by ID", - "operationId": "getOfficeById", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Transportation Office not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/organizations": { - "get": { - "description": "This endpoint returns a list of Organizations. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "List Organizations", - "operationId": "indexOrganizations", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Organizations" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Organizations not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-request-syncada-files": { - "get": { - "description": "Returns a list of Payment Request EDI files", - "produces": [ - "application/json" - ], - "tags": [ - "Payment Request Syncada Files" - ], - "summary": "List Payment Request EDI Files", - "operationId": "indexPaymentRequestSyncadaFiles", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/PaymentRequestSyncadaFiles" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Payment Request EDI Files not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-request-syncada-files/{paymentRequestSyncadaFileId}": { - "get": { - "description": "Returns a Payment Request EDI858 file", - "produces": [ - "application/json" - ], - "tags": [ - "Payment Request Syncada File" - ], - "summary": "Payment Request EDI File", - "operationId": "paymentRequestSyncadaFile", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "paymentRequestSyncadaFileId", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/PaymentRequestSyncadaFile" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Payment Request EDI Files not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/requested-office-users": { - "get": { - "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "List of Office Users Requesting Accounts", - "operationId": "indexRequestedOfficeUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/requested-office-users/{officeUserId}": { - "get": { - "description": "Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data.", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "Get a Requested Office User", - "operationId": "getRequestedOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user.", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "Update a Requested Office User", - "operationId": "updateRequestedOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RequestedOfficeUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadId}": { - "get": { - "description": "This endpoint returns a single Upload by ID containing the given Upload and\ninformation about the Uploader and Move. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Uploads" - ], - "summary": "Get information about an Upload", - "operationId": "getUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "uploadId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/UploadInformation" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Upload not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/user": { - "get": { - "description": "Returns the admin user info for the currently logged in user", - "tags": [ - "User" - ], - "summary": "Gets the data about the currently signed in admin user", - "operationId": "getLoggedInAdminUser", - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin User not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users": { - "get": { - "description": "This endpoint returns a list of Users. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "List Users", - "operationId": "indexUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Users" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Users not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/{userId}": { - "get": { - "description": "This endpoint returns a single User by ID. This also returns the User's sessions\nas well. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n\n", - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get information about a User", - "operationId": "getUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "userId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/User" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single User by ID. This can be used by the Admin User to\nupdate the User's session or the User's active status. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update a User's session or active status", - "operationId": "updateUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "userId", - "in": "path", - "required": true - }, - { - "description": "User information", - "name": "User", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated User", - "schema": { - "$ref": "#/definitions/User" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update this User" - }, - "404": { - "description": "Not found" - }, - "422": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "Server error" - } - } - } - }, - "/webhook-subscriptions": { - "get": { - "description": "This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Lists Webhook Subscriptions", - "operationId": "indexWebhookSubscriptions", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/WebhookSubscriptions" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Not authenticated for this endpoint" - }, - "404": { - "description": "Webhook Subscriptions not found" - }, - "500": { - "description": "Server error" - } - } - }, - "post": { - "description": "This endpoint creates a Webhook Subscription and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Create a Webhook Subscription", - "operationId": "createWebhookSubscription", - "parameters": [ - { - "description": "Webhook subscription information", - "name": "webhookSubscription", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateWebhookSubscription" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Webhook Subscription", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create a Webhook Subscription" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/webhook-subscriptions/{webhookSubscriptionId}": { - "get": { - "description": "This endpoint returns a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Get information about a Webhook Subscription", - "operationId": "getWebhookSubscription", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "webhookSubscriptionId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Webhook Subscription not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Update a Webhook Subscription", - "operationId": "updateWebhookSubscription", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "webhookSubscriptionId", - "in": "path", - "required": true - }, - { - "description": "Webhook Subscription information", - "name": "WebhookSubscription", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated Webhook Subscription", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update this Webhook Subscription" - }, - "404": { - "description": "Webhook Subscription not found" - }, - "412": { - "description": "Precondition failed" - }, - "422": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "Server error" - } - } - } - } - }, - "definitions": { - "Address": { - "type": "object", - "required": [ - "streetAddress1", - "state", - "city", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "description": "zip code, international allowed", - "type": "string", - "format": "zip", - "title": "ZIP", - "example": "'90210' or 'N15 3NL'" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Address line 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Address line 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address line 3", - "x-nullable": true, - "example": "Montmârtre" - } - } - }, - "AdminUser": { - "type": "object", - "required": [ - "id", - "firstName", - "lastName", - "email", - "userId", - "organizationId", - "active", - "super", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "organizationId": { - "type": "string", - "format": "uuid" - }, - "super": { - "type": "boolean" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "AdminUserCreate": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "Email", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name" - }, - "lastName": { - "type": "string", - "title": "Last Name" - }, - "organizationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "super": { - "type": "boolean" - } - } - }, - "AdminUserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "super": { - "type": "boolean", - "x-nullable": true - } - } - }, - "AdminUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/AdminUser" - } - }, - "ClientCertificate": { - "type": "object", - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean" - }, - "allowAirForceOrdersWrite": { - "type": "boolean" - }, - "allowArmyOrdersRead": { - "type": "boolean" - }, - "allowArmyOrdersWrite": { - "type": "boolean" - }, - "allowCoastGuardOrdersRead": { - "type": "boolean" - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean" - }, - "allowDpsAuthAPI": { - "type": "boolean" - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean" - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean" - }, - "allowNavyOrdersRead": { - "type": "boolean" - }, - "allowNavyOrdersWrite": { - "type": "boolean" - }, - "allowOrdersAPI": { - "type": "boolean" - }, - "allowPPTAS": { - "type": "boolean" - }, - "allowPrime": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ClientCertificateCreate": { - "type": "object", - "required": [ - "sha256Digest", - "subject", - "email" - ], - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean" - }, - "allowAirForceOrdersWrite": { - "type": "boolean" - }, - "allowArmyOrdersRead": { - "type": "boolean" - }, - "allowArmyOrdersWrite": { - "type": "boolean" - }, - "allowCoastGuardOrdersRead": { - "type": "boolean" - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean" - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean" - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean" - }, - "allowNavyOrdersRead": { - "type": "boolean" - }, - "allowNavyOrdersWrite": { - "type": "boolean" - }, - "allowOrdersAPI": { - "type": "boolean" - }, - "allowPPTAS": { - "type": "boolean" - }, - "allowPrime": { - "type": "boolean" - }, - "email": { - "type": "string", - "example": "user@example.com" - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - } - } - }, - "ClientCertificateUpdate": { - "type": "object", - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowAirForceOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowArmyOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowArmyOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowCoastGuardOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowDpsAuthAPI": { - "type": "boolean", - "x-nullable": true - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowNavyOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowNavyOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowOrdersAPI": { - "type": "boolean", - "x-nullable": true - }, - "allowPPTAS": { - "type": "boolean", - "x-nullable": true - }, - "allowPrime": { - "type": "boolean", - "x-nullable": true - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - } - } - }, - "ClientCertificates": { - "type": "array", - "items": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateWebhookSubscription": { - "type": "object", - "required": [ - "subscriberId", - "status", - "eventKey", - "callbackUrl" - ], - "properties": { - "callbackUrl": { - "description": "The URL to which the notifications for this subscription will be pushed to.", - "type": "string" - }, - "eventKey": { - "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/WebhookSubscriptionStatus" - }, - "subscriberId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ElectronicOrder": { - "type": "object", - "required": [ - "id", - "issuer", - "ordersNumber", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "issuer": { - "$ref": "#/definitions/Issuer" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "title": "Updated at", - "readOnly": true - } - } - }, - "ElectronicOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/ElectronicOrder" - } - }, - "ElectronicOrdersTotal": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "count": { - "type": "integer", - "title": "Total Orders Count" - } - } - }, - "ElectronicOrdersTotals": { - "type": "array", - "items": { - "$ref": "#/definitions/ElectronicOrdersTotal" - } - }, - "Issuer": { - "description": "Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded.", - "type": "string", - "enum": [ - "army", - "navy", - "air-force", - "marine-corps", - "coast-guard" - ] - }, - "Move": { - "type": "object", - "required": [ - "id", - "ordersId", - "locator", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "ordersId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMember": { - "$ref": "#/definitions/ServiceMember" - }, - "show": { - "type": "boolean", - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MoveStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MoveUpdate": { - "type": "object", - "required": [ - "show" - ], - "properties": { - "show": { - "type": "boolean" - } - } - }, - "Moves": { - "type": "array", - "items": { - "$ref": "#/definitions/Move" - } - }, - "Notification": { - "type": "object", - "required": [ - "id", - "email", - "serviceMemberId", - "sesMessageId", - "notificationType", - "createdAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "notificationType": { - "type": "string", - "enum": [ - "MOVE_PAYMENT_REMINDER_EMAIL" - ] - }, - "serviceMemberId": { - "type": "string", - "format": "uuid" - }, - "sesMessageId": { - "type": "string" - } - } - }, - "Notifications": { - "type": "array", - "items": { - "$ref": "#/definitions/Notification" - } - }, - "OfficeUser": { - "type": "object", - "required": [ - "id", - "firstName", - "middleInitials", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "transportationOfficeAssignments", - "active", - "roles", - "edipi", - "otherUniqueId", - "rejectionReason", - "status", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "middleInitials": { - "type": "string" - }, - "otherUniqueId": { - "type": "string" - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/Privilege" - } - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REQUESTED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "OfficeUserCreate": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "Email", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name" - }, - "lastName": { - "type": "string", - "title": "Last Name" - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "L." - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserPrivilege" - }, - "x-nullable": true - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" - } - } - } - }, - "OfficeUserPrivilege": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "title": "privilegeType", - "x-nullable": true, - "example": "supervisor" - } - } - }, - "OfficeUserRole": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "title": "roleType", - "x-nullable": true, - "example": "task_ordering_officer" - } - } - }, - "OfficeUserTransportationOfficeAssignment": { - "type": "object", - "properties": { - "primaryOffice": { - "type": "boolean", - "title": "primaryOffice", - "x-nullable": true - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "title": "transportationOfficeId", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OfficeUserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "Q." - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserPrivilege" - } - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" - } - } - } - }, - "OfficeUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUser" - } - }, - "OktaAccountInfoResponse": { - "type": "object", - "properties": { - "activated": { - "type": "string" - }, - "created": { - "type": "string" - }, - "credentials": { - "type": "object" - }, - "id": { - "type": "string" - }, - "profile": { - "type": "object" - }, - "status": { - "type": "string" - } - } - }, - "Organization": { - "type": "object", - "required": [ - "id", - "name", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "title": "Name" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "title": "Updated at", - "readOnly": true - } - } - }, - "Organizations": { - "type": "array", - "items": { - "$ref": "#/definitions/Organization" - } - }, - "PaymentRequestSyncadaFile": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "ediString": { - "type": "string" - }, - "fileName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string" - } - } - }, - "PaymentRequestSyncadaFiles": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequestSyncadaFile" - } - }, - "Privilege": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "privilegeName": { - "type": "string", - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "example": "supervisor" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "RequestedOfficeUserUpdate": { - "type": "object", - "properties": { - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "Q." - }, - "otherUniqueId": { - "type": "string" - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "roleName", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleName": { - "type": "string", - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ServiceMember": { - "type": "object", - "properties": { - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleName": { - "type": "string", - "title": "Middle Name", - "x-nullable": true - }, - "userId": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "createdAt", - "updatedAt" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phoneLines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "Upload": { - "type": "object", - "properties": { - "contentType": { - "type": "string", - "enum": [ - "application/pdf", - "image/jpeg", - "image/png" - ] - }, - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "filename": { - "type": "string" - }, - "size": { - "type": "integer", - "title": "Size in Bytes" - } - } - }, - "UploadInformation": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveLocator": { - "type": "string", - "x-nullable": true, - "example": "12432" - }, - "officeUserEmail": { - "type": "string", - "x-nullable": true - }, - "officeUserFirstName": { - "type": "string", - "x-nullable": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "officeUserLastName": { - "type": "string", - "x-nullable": true - }, - "officeUserPhone": { - "type": "string", - "x-nullable": true - }, - "serviceMemberEmail": { - "type": "string", - "x-nullable": true - }, - "serviceMemberFirstName": { - "type": "string", - "x-nullable": true - }, - "serviceMemberId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMemberLastName": { - "type": "string", - "x-nullable": true - }, - "serviceMemberPhone": { - "type": "string", - "x-nullable": true - }, - "upload": { - "$ref": "#/definitions/Upload" - } - } - }, - "User": { - "type": "object", - "required": [ - "oktaEmail", - "active", - "createdAt", - "updatedAt", - "currentAdminSessionId", - "currentMilSessionId", - "currentOfficeSessionId" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "currentAdminSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "currentMilSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "currentOfficeSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "oktaEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "UserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "revokeAdminSession": { - "type": "boolean", - "x-nullable": true - }, - "revokeMilSession": { - "type": "boolean", - "x-nullable": true - }, - "revokeOfficeSession": { - "type": "boolean", - "x-nullable": true - } - } - }, - "Users": { - "type": "array", - "items": { - "$ref": "#/definitions/User" - } - }, - "ValidationError": { - "required": [ - "invalidFields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object" - } - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "WebhookSubscription": { - "description": "Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically.", - "type": "object", - "properties": { - "callbackUrl": { - "description": "The URL to which the notifications for this subscription will be pushed to.", - "type": "string", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "eventKey": { - "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "severity": { - "type": "integer", - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/WebhookSubscriptionStatus" - }, - "subscriberId": { - "description": "Unique identifier for the subscriber", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "d494f114-05a2-4b39-840c-3d33243b7e29" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "WebhookSubscriptionStatus": { - "type": "string", - "title": "Webhook subscription status", - "enum": [ - "ACTIVE", - "FAILING", - "DISABLED" - ], - "x-display-value": { - "ACTIVE": "Active", - "DISABLED": "Disabled", - "FAILING": "Failing" - }, - "x-nullable": true - }, - "WebhookSubscriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/WebhookSubscription" - } - } - }, - "tags": [ - { - "description": "Information about Admin UI users", - "name": "Admin users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about Client Certificates", - "name": "Client certificates", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about electronic orders", - "name": "Electronic orders", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about moves", - "name": "Moves", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about notifications", - "name": "Notifications", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about transportation offices", - "name": "Transportation offices", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about office users", - "name": "Office users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about organizations", - "name": "Organizations", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about uploads", - "name": "Uploads", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about requested office users", - "name": "Requested office users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about users", - "name": "Users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about Webhook subscriptions", - "name": "Webhook subscriptions", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "schemes": [ - "https" - ], - "swagger": "2.0", - "info": { - "description": "The Admin API is a RESTful API that enables the Admin application for MilMove.\n\nAll endpoints are located under ` + "`" + `/admin/v1` + "`" + `.\n", - "title": "MilMove Admin API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "1.0.0" - }, - "basePath": "/admin/v1", - "paths": { - "/admin-users": { - "get": { - "description": "This endpoint returns a list of Admin Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "List Admin Users", - "operationId": "indexAdminUsers", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin Users not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates an Admin User record and returns the created record in the\n` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used with\nthe Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Create an Admin User", - "operationId": "createAdminUser", - "parameters": [ - { - "description": "Admin User information", - "name": "adminUser", - "in": "body", - "schema": { - "$ref": "#/definitions/AdminUserCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Admin User", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create an Admin User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/admin-users/{adminUserId}": { - "get": { - "description": "This endpoint returns a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Fetch a specific Admin User", - "operationId": "getAdminUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "adminUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Admin users" - ], - "summary": "Updates an Admin User", - "operationId": "updateAdminUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "adminUserId", - "in": "path", - "required": true - }, - { - "description": "Admin User information", - "name": "adminUser", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AdminUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Admin User", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update an Admin User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/client-certificates": { - "get": { - "description": "This endpoint returns a list of Client Certificates. Do not use this\nendpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "List client certificates", - "operationId": "indexClientCertificates", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ClientCertificates" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "office not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates a Client Certificate record and returns the\ncreated record in the ` + "`" + `201` + "`" + ` response. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "create a client cert", - "operationId": "createClientCertificate", - "parameters": [ - { - "description": "client cert information", - "name": "clientCertificate", - "in": "body", - "schema": { - "$ref": "#/definitions/ClientCertificateCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created client certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create a client certificate" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/client-certificates/{clientCertificateId}": { - "get": { - "description": "This endpoint returns a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "Get a client certificate", - "operationId": "getClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "id not found" - }, - "500": { - "description": "server error" - } - } - }, - "delete": { - "description": "This endpoint removes a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "removes a client certificate", - "operationId": "removeClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully removed Client Certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to remove a client certificate" - }, - "500": { - "description": "Server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Client certificates" - ], - "summary": "Updates a client certificate", - "operationId": "updateClientCertificate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "clientCertificateId", - "in": "path", - "required": true - }, - { - "description": "client cert information", - "name": "clientCertificate", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ClientCertificateUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Client Certificate", - "schema": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update a client certificate" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/electronic-orders": { - "get": { - "description": "This endpoint returns a list of Electronic Orders. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Electronic orders" - ], - "summary": "List Electronic Orders", - "operationId": "indexElectronicOrders", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ElectronicOrders" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Electronic Order not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/electronic-orders/totals": { - "get": { - "description": "This endpoint returns a list of record counts for Electronic Orders. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Electronic orders" - ], - "summary": "Get total counts for the orders stored in MilMove", - "operationId": "getElectronicOrdersTotals", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "array", - "items": { - "type": "string" - }, - "name": "andFilter", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/ElectronicOrdersTotals" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Total count for Electronic Orders not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves": { - "get": { - "description": "This endpoint returns a list of Moves. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "List Moves", - "operationId": "indexMoves", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Moves" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Moves not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveID}": { - "get": { - "description": "This endpoint returns a single Move by ID. Do not use this endpoint directly as\nit is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "Get information about a Move", - "operationId": "getMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Success", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Must be authenticated to use this endpoint" - }, - "404": { - "description": "Move not found" - }, - "500": { - "description": "Server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Move by ID. This allows the Admin User to change\nthe ` + "`" + `show` + "`" + ` field on the selected field to either ` + "`" + `True` + "`" + ` or ` + "`" + `False` + "`" + `. A \"shown\"\nMove will appear to all users as normal, a \"hidden\" Move will not be returned or\neditable using any other endpoint (besides those in the Support API), and thus\neffectively deactivated. Do not use this endpoint directly as it is meant to be\nused with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Moves" - ], - "summary": "Toggle Move visibility", - "operationId": "updateMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveID", - "in": "path", - "required": true - }, - { - "description": "Move information", - "name": "Move", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Must be authenticated to use this endpoint" - }, - "403": { - "description": "Not authorized to update this Move" - }, - "404": { - "description": "Move not found" - }, - "422": { - "description": "Invalid input" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/notifications": { - "get": { - "description": "This endpoint returns a list of Notifications that have been sent to Service\nMembers. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Notifications" - ], - "summary": "List Notifications", - "operationId": "indexNotifications", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Notifications" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Notifications not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/office-users": { - "get": { - "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "List of Office Users", - "operationId": "indexOfficeUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "post": { - "description": "This endpoint creates an Office User record and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. If there are issues with the Office User information\nprovided a ` + "`" + `422` + "`" + ` response will occur with information about invalid fields and\nadditional details. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Create an Office User", - "operationId": "createOfficeUser", - "parameters": [ - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "schema": { - "$ref": "#/definitions/OfficeUserCreate" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Office User", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/office-users/{officeUserId}": { - "get": { - "description": "This endpoint returns a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Get an Office User", - "operationId": "getOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Office users" - ], - "summary": "Updates an Office User", - "operationId": "updateOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - }, - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/OfficeUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated Office User", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update an Office User" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/offices": { - "get": { - "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Transportation offices" - ], - "summary": "List Transportation Offices", - "operationId": "indexOffices", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/TransportationOffices" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Transportation Office not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/offices/{officeId}": { - "get": { - "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Transportation offices" - ], - "summary": "Get Transportation Office by ID", - "operationId": "getOfficeById", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Transportation Office not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/organizations": { - "get": { - "description": "This endpoint returns a list of Organizations. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Organizations" - ], - "summary": "List Organizations", - "operationId": "indexOrganizations", - "parameters": [ - { - "type": "array", - "items": { - "type": "string" - }, - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Organizations" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Organizations not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-request-syncada-files": { - "get": { - "description": "Returns a list of Payment Request EDI files", - "produces": [ - "application/json" - ], - "tags": [ - "Payment Request Syncada Files" - ], - "summary": "List Payment Request EDI Files", - "operationId": "indexPaymentRequestSyncadaFiles", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/PaymentRequestSyncadaFiles" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Payment Request EDI Files not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-request-syncada-files/{paymentRequestSyncadaFileId}": { - "get": { - "description": "Returns a Payment Request EDI858 file", - "produces": [ - "application/json" - ], - "tags": [ - "Payment Request Syncada File" - ], - "summary": "Payment Request EDI File", - "operationId": "paymentRequestSyncadaFile", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "paymentRequestSyncadaFileId", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/PaymentRequestSyncadaFile" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Payment Request EDI Files not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/requested-office-users": { - "get": { - "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "List of Office Users Requesting Accounts", - "operationId": "indexRequestedOfficeUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUsers" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/requested-office-users/{officeUserId}": { - "get": { - "description": "Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data.", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "Get a Requested Office User", - "operationId": "getRequestedOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user.", - "produces": [ - "application/json" - ], - "tags": [ - "Requested office users" - ], - "summary": "Update a Requested Office User", - "operationId": "updateRequestedOfficeUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "officeUserId", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RequestedOfficeUserUpdate" - } - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Office User not found" - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadId}": { - "get": { - "description": "This endpoint returns a single Upload by ID containing the given Upload and\ninformation about the Uploader and Move. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Uploads" - ], - "summary": "Get information about an Upload", - "operationId": "getUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "uploadId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/UploadInformation" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Upload not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/user": { - "get": { - "description": "Returns the admin user info for the currently logged in user", - "tags": [ - "User" - ], - "summary": "Gets the data about the currently signed in admin user", - "operationId": "getLoggedInAdminUser", - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/AdminUser" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Admin User not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users": { - "get": { - "description": "This endpoint returns a list of Users. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "List Users", - "operationId": "indexUsers", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/Users" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Users not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/{userId}": { - "get": { - "description": "This endpoint returns a single User by ID. This also returns the User's sessions\nas well. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n\n", - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Get information about a User", - "operationId": "getUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "userId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/User" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "User not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single User by ID. This can be used by the Admin User to\nupdate the User's session or the User's active status. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Users" - ], - "summary": "Update a User's session or active status", - "operationId": "updateUser", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "userId", - "in": "path", - "required": true - }, - { - "description": "User information", - "name": "User", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UserUpdate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated User", - "schema": { - "$ref": "#/definitions/User" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update this User" - }, - "404": { - "description": "Not found" - }, - "422": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "Server error" - } - } - } - }, - "/webhook-subscriptions": { - "get": { - "description": "This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Lists Webhook Subscriptions", - "operationId": "indexWebhookSubscriptions", - "parameters": [ - { - "type": "string", - "name": "filter", - "in": "query" - }, - { - "type": "integer", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "sort", - "in": "query" - }, - { - "type": "boolean", - "name": "order", - "in": "query" - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/WebhookSubscriptions" - }, - "headers": { - "Content-Range": { - "type": "string", - "description": "Used for pagination" - } - } - }, - "400": { - "description": "Invalid request" - }, - "401": { - "description": "Not authenticated for this endpoint" - }, - "404": { - "description": "Webhook Subscriptions not found" - }, - "500": { - "description": "Server error" - } - } - }, - "post": { - "description": "This endpoint creates a Webhook Subscription and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Create a Webhook Subscription", - "operationId": "createWebhookSubscription", - "parameters": [ - { - "description": "Webhook subscription information", - "name": "webhookSubscription", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateWebhookSubscription" - } - } - ], - "responses": { - "201": { - "description": "Successfully created Webhook Subscription", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to create a Webhook Subscription" - }, - "500": { - "description": "Server error" - } - } - } - }, - "/webhook-subscriptions/{webhookSubscriptionId}": { - "get": { - "description": "This endpoint returns a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Get information about a Webhook Subscription", - "operationId": "getWebhookSubscription", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "webhookSubscriptionId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "success", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "404": { - "description": "Webhook Subscription not found" - }, - "500": { - "description": "server error" - } - } - }, - "patch": { - "description": "This endpoint updates a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "Webhook subscriptions" - ], - "summary": "Update a Webhook Subscription", - "operationId": "updateWebhookSubscription", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "webhookSubscriptionId", - "in": "path", - "required": true - }, - { - "description": "Webhook Subscription information", - "name": "WebhookSubscription", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated Webhook Subscription", - "schema": { - "$ref": "#/definitions/WebhookSubscription" - } - }, - "400": { - "description": "Invalid Request" - }, - "401": { - "description": "Must be authenticated to use this end point" - }, - "403": { - "description": "Not authorized to update this Webhook Subscription" - }, - "404": { - "description": "Webhook Subscription not found" - }, - "412": { - "description": "Precondition failed" - }, - "422": { - "description": "Validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "Server error" - } - } - } - } - }, - "definitions": { - "Address": { - "type": "object", - "required": [ - "streetAddress1", - "state", - "city", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "description": "zip code, international allowed", - "type": "string", - "format": "zip", - "title": "ZIP", - "example": "'90210' or 'N15 3NL'" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Address line 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Address line 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address line 3", - "x-nullable": true, - "example": "Montmârtre" - } - } - }, - "AdminUser": { - "type": "object", - "required": [ - "id", - "firstName", - "lastName", - "email", - "userId", - "organizationId", - "active", - "super", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "organizationId": { - "type": "string", - "format": "uuid" - }, - "super": { - "type": "boolean" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "AdminUserCreate": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "Email", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name" - }, - "lastName": { - "type": "string", - "title": "Last Name" - }, - "organizationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "super": { - "type": "boolean" - } - } - }, - "AdminUserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "super": { - "type": "boolean", - "x-nullable": true - } - } - }, - "AdminUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/AdminUser" - } - }, - "ClientCertificate": { - "type": "object", - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean" - }, - "allowAirForceOrdersWrite": { - "type": "boolean" - }, - "allowArmyOrdersRead": { - "type": "boolean" - }, - "allowArmyOrdersWrite": { - "type": "boolean" - }, - "allowCoastGuardOrdersRead": { - "type": "boolean" - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean" - }, - "allowDpsAuthAPI": { - "type": "boolean" - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean" - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean" - }, - "allowNavyOrdersRead": { - "type": "boolean" - }, - "allowNavyOrdersWrite": { - "type": "boolean" - }, - "allowOrdersAPI": { - "type": "boolean" - }, - "allowPPTAS": { - "type": "boolean" - }, - "allowPrime": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ClientCertificateCreate": { - "type": "object", - "required": [ - "sha256Digest", - "subject", - "email" - ], - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean" - }, - "allowAirForceOrdersWrite": { - "type": "boolean" - }, - "allowArmyOrdersRead": { - "type": "boolean" - }, - "allowArmyOrdersWrite": { - "type": "boolean" - }, - "allowCoastGuardOrdersRead": { - "type": "boolean" - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean" - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean" - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean" - }, - "allowNavyOrdersRead": { - "type": "boolean" - }, - "allowNavyOrdersWrite": { - "type": "boolean" - }, - "allowOrdersAPI": { - "type": "boolean" - }, - "allowPPTAS": { - "type": "boolean" - }, - "allowPrime": { - "type": "boolean" - }, - "email": { - "type": "string", - "example": "user@example.com" - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - } - } - }, - "ClientCertificateUpdate": { - "type": "object", - "properties": { - "allowAirForceOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowAirForceOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowArmyOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowArmyOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowCoastGuardOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowCoastGuardOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowDpsAuthAPI": { - "type": "boolean", - "x-nullable": true - }, - "allowMarineCorpsOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowMarineCorpsOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowNavyOrdersRead": { - "type": "boolean", - "x-nullable": true - }, - "allowNavyOrdersWrite": { - "type": "boolean", - "x-nullable": true - }, - "allowOrdersAPI": { - "type": "boolean", - "x-nullable": true - }, - "allowPPTAS": { - "type": "boolean", - "x-nullable": true - }, - "allowPrime": { - "type": "boolean", - "x-nullable": true - }, - "sha256Digest": { - "type": "string", - "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" - }, - "subject": { - "type": "string", - "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" - } - } - }, - "ClientCertificates": { - "type": "array", - "items": { - "$ref": "#/definitions/ClientCertificate" - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateWebhookSubscription": { - "type": "object", - "required": [ - "subscriberId", - "status", - "eventKey", - "callbackUrl" - ], - "properties": { - "callbackUrl": { - "description": "The URL to which the notifications for this subscription will be pushed to.", - "type": "string" - }, - "eventKey": { - "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/WebhookSubscriptionStatus" - }, - "subscriberId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ElectronicOrder": { - "type": "object", - "required": [ - "id", - "issuer", - "ordersNumber", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "issuer": { - "$ref": "#/definitions/Issuer" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "title": "Updated at", - "readOnly": true - } - } - }, - "ElectronicOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/ElectronicOrder" - } - }, - "ElectronicOrdersTotal": { - "type": "object", - "properties": { - "category": { - "type": "string" - }, - "count": { - "type": "integer", - "title": "Total Orders Count", - "minimum": 0 - } - } - }, - "ElectronicOrdersTotals": { - "type": "array", - "items": { - "$ref": "#/definitions/ElectronicOrdersTotal" - } - }, - "Issuer": { - "description": "Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded.", - "type": "string", - "enum": [ - "army", - "navy", - "air-force", - "marine-corps", - "coast-guard" - ] - }, - "Move": { - "type": "object", - "required": [ - "id", - "ordersId", - "locator", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "ordersId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMember": { - "$ref": "#/definitions/ServiceMember" - }, - "show": { - "type": "boolean", - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MoveStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MoveUpdate": { - "type": "object", - "required": [ - "show" - ], - "properties": { - "show": { - "type": "boolean" - } - } - }, - "Moves": { - "type": "array", - "items": { - "$ref": "#/definitions/Move" - } - }, - "Notification": { - "type": "object", - "required": [ - "id", - "email", - "serviceMemberId", - "sesMessageId", - "notificationType", - "createdAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "notificationType": { - "type": "string", - "enum": [ - "MOVE_PAYMENT_REMINDER_EMAIL" - ] - }, - "serviceMemberId": { - "type": "string", - "format": "uuid" - }, - "sesMessageId": { - "type": "string" - } - } - }, - "Notifications": { - "type": "array", - "items": { - "$ref": "#/definitions/Notification" - } - }, - "OfficeUser": { - "type": "object", - "required": [ - "id", - "firstName", - "middleInitials", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "transportationOfficeAssignments", - "active", - "roles", - "edipi", - "otherUniqueId", - "rejectionReason", - "status", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "middleInitials": { - "type": "string" - }, - "otherUniqueId": { - "type": "string" - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/Privilege" - } - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REQUESTED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "OfficeUserCreate": { - "type": "object", - "properties": { - "email": { - "type": "string", - "title": "Email", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name" - }, - "lastName": { - "type": "string", - "title": "Last Name" - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "L." - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserPrivilege" - }, - "x-nullable": true - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" - } - } - } - }, - "OfficeUserPrivilege": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "title": "privilegeType", - "x-nullable": true, - "example": "supervisor" - } - } - }, - "OfficeUserRole": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "title": "roleType", - "x-nullable": true, - "example": "task_ordering_officer" - } - } - }, - "OfficeUserTransportationOfficeAssignment": { - "type": "object", - "properties": { - "primaryOffice": { - "type": "boolean", - "title": "primaryOffice", - "x-nullable": true - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "title": "transportationOfficeId", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OfficeUserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "Q." - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserPrivilege" - } - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" - } - } - } - }, - "OfficeUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUser" - } - }, - "OktaAccountInfoResponse": { - "type": "object", - "properties": { - "activated": { - "type": "string" - }, - "created": { - "type": "string" - }, - "credentials": { - "type": "object" - }, - "id": { - "type": "string" - }, - "profile": { - "type": "object" - }, - "status": { - "type": "string" - } - } - }, - "Organization": { - "type": "object", - "required": [ - "id", - "name", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "title": "Name" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "title": "Updated at", - "readOnly": true - } - } - }, - "Organizations": { - "type": "array", - "items": { - "$ref": "#/definitions/Organization" - } - }, - "PaymentRequestSyncadaFile": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "ediString": { - "type": "string" - }, - "fileName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string" - } - } - }, - "PaymentRequestSyncadaFiles": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequestSyncadaFile" - } - }, - "Privilege": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "privilegeName": { - "type": "string", - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "example": "supervisor" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "RequestedOfficeUserUpdate": { - "type": "object", - "properties": { - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "Q." - }, - "otherUniqueId": { - "type": "string" - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "roleName", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleName": { - "type": "string", - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ServiceMember": { - "type": "object", - "properties": { - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": true - }, - "middleName": { - "type": "string", - "title": "Middle Name", - "x-nullable": true - }, - "userId": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "createdAt", - "updatedAt" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phoneLines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "Upload": { - "type": "object", - "properties": { - "contentType": { - "type": "string", - "enum": [ - "application/pdf", - "image/jpeg", - "image/png" - ] - }, - "createdAt": { - "type": "string", - "format": "date-time", - "title": "Created at", - "readOnly": true - }, - "filename": { - "type": "string" - }, - "size": { - "type": "integer", - "title": "Size in Bytes" - } - } - }, - "UploadInformation": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveLocator": { - "type": "string", - "x-nullable": true, - "example": "12432" - }, - "officeUserEmail": { - "type": "string", - "x-nullable": true - }, - "officeUserFirstName": { - "type": "string", - "x-nullable": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "officeUserLastName": { - "type": "string", - "x-nullable": true - }, - "officeUserPhone": { - "type": "string", - "x-nullable": true - }, - "serviceMemberEmail": { - "type": "string", - "x-nullable": true - }, - "serviceMemberFirstName": { - "type": "string", - "x-nullable": true - }, - "serviceMemberId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMemberLastName": { - "type": "string", - "x-nullable": true - }, - "serviceMemberPhone": { - "type": "string", - "x-nullable": true - }, - "upload": { - "$ref": "#/definitions/Upload" - } - } - }, - "User": { - "type": "object", - "required": [ - "oktaEmail", - "active", - "createdAt", - "updatedAt", - "currentAdminSessionId", - "currentMilSessionId", - "currentOfficeSessionId" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "currentAdminSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "currentMilSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "currentOfficeSessionId": { - "type": "string", - "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "oktaEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "UserUpdate": { - "type": "object", - "properties": { - "active": { - "type": "boolean", - "x-nullable": true - }, - "revokeAdminSession": { - "type": "boolean", - "x-nullable": true - }, - "revokeMilSession": { - "type": "boolean", - "x-nullable": true - }, - "revokeOfficeSession": { - "type": "boolean", - "x-nullable": true - } - } - }, - "Users": { - "type": "array", - "items": { - "$ref": "#/definitions/User" - } - }, - "ValidationError": { - "required": [ - "invalidFields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "$ref": "#/definitions/ValidationErrorAllOf1" - } - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "ValidationErrorAllOf1": { - "type": "object" - }, - "WebhookSubscription": { - "description": "Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically.", - "type": "object", - "properties": { - "callbackUrl": { - "description": "The URL to which the notifications for this subscription will be pushed to.", - "type": "string", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "eventKey": { - "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "severity": { - "type": "integer", - "minimum": 0, - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/WebhookSubscriptionStatus" - }, - "subscriberId": { - "description": "Unique identifier for the subscriber", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "d494f114-05a2-4b39-840c-3d33243b7e29" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "WebhookSubscriptionStatus": { - "type": "string", - "title": "Webhook subscription status", - "enum": [ - "ACTIVE", - "FAILING", - "DISABLED" - ], - "x-display-value": { - "ACTIVE": "Active", - "DISABLED": "Disabled", - "FAILING": "Failing" - }, - "x-nullable": true - }, - "WebhookSubscriptions": { - "type": "array", - "items": { - "$ref": "#/definitions/WebhookSubscription" - } - } - }, - "tags": [ - { - "description": "Information about Admin UI users", - "name": "Admin users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about Client Certificates", - "name": "Client certificates", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about electronic orders", - "name": "Electronic orders", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about moves", - "name": "Moves", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about notifications", - "name": "Notifications", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about transportation offices", - "name": "Transportation offices", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about office users", - "name": "Office users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about organizations", - "name": "Organizations", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about uploads", - "name": "Uploads", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about requested office users", - "name": "Requested office users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about users", - "name": "Users", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - }, - { - "description": "Information about Webhook subscriptions", - "name": "Webhook subscriptions", - "externalDocs": { - "url": "https://transcom.github.io/mymove-docs/docs/api" - } - } - ] -}`)) -} diff --git a/pkg/gen/adminapi/server.go b/pkg/gen/adminapi/server.go deleted file mode 100644 index 4909a6a53ee..00000000000 --- a/pkg/gen/adminapi/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTPS, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *adminoperations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *adminoperations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *adminoperations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/adminmessages/electronic_order.go b/pkg/gen/adminmessages/electronic_order.go deleted file mode 100644 index 0d7f8472aed..00000000000 --- a/pkg/gen/adminmessages/electronic_order.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ElectronicOrder electronic order -// -// swagger:model ElectronicOrder -type ElectronicOrder struct { - - // Created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // issuer - // Required: true - Issuer *Issuer `json:"issuer"` - - // Orders Number - // Required: true - OrdersNumber *string `json:"ordersNumber"` - - // Updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this electronic order -func (m *ElectronicOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssuer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ElectronicOrder) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ElectronicOrder) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ElectronicOrder) validateIssuer(formats strfmt.Registry) error { - - if err := validate.Required("issuer", "body", m.Issuer); err != nil { - return err - } - - if err := validate.Required("issuer", "body", m.Issuer); err != nil { - return err - } - - if m.Issuer != nil { - if err := m.Issuer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("issuer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("issuer") - } - return err - } - } - - return nil -} - -func (m *ElectronicOrder) validateOrdersNumber(formats strfmt.Registry) error { - - if err := validate.Required("ordersNumber", "body", m.OrdersNumber); err != nil { - return err - } - - return nil -} - -func (m *ElectronicOrder) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this electronic order based on the context it is used -func (m *ElectronicOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateIssuer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ElectronicOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *ElectronicOrder) contextValidateIssuer(ctx context.Context, formats strfmt.Registry) error { - - if m.Issuer != nil { - - if err := m.Issuer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("issuer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("issuer") - } - return err - } - } - - return nil -} - -func (m *ElectronicOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ElectronicOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ElectronicOrder) UnmarshalBinary(b []byte) error { - var res ElectronicOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/electronic_orders.go b/pkg/gen/adminmessages/electronic_orders.go deleted file mode 100644 index 97ce00e09af..00000000000 --- a/pkg/gen/adminmessages/electronic_orders.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ElectronicOrders electronic orders -// -// swagger:model ElectronicOrders -type ElectronicOrders []*ElectronicOrder - -// Validate validates this electronic orders -func (m ElectronicOrders) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this electronic orders based on the context it is used -func (m ElectronicOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/electronic_orders_total.go b/pkg/gen/adminmessages/electronic_orders_total.go deleted file mode 100644 index 040fbc49a4e..00000000000 --- a/pkg/gen/adminmessages/electronic_orders_total.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ElectronicOrdersTotal electronic orders total -// -// swagger:model ElectronicOrdersTotal -type ElectronicOrdersTotal struct { - - // category - Category string `json:"category,omitempty"` - - // Total Orders Count - // Minimum: 0 - Count *int64 `json:"count,omitempty"` -} - -// Validate validates this electronic orders total -func (m *ElectronicOrdersTotal) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCount(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ElectronicOrdersTotal) validateCount(formats strfmt.Registry) error { - if swag.IsZero(m.Count) { // not required - return nil - } - - if err := validate.MinimumInt("count", "body", *m.Count, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this electronic orders total based on context it is used -func (m *ElectronicOrdersTotal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ElectronicOrdersTotal) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ElectronicOrdersTotal) UnmarshalBinary(b []byte) error { - var res ElectronicOrdersTotal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/electronic_orders_totals.go b/pkg/gen/adminmessages/electronic_orders_totals.go deleted file mode 100644 index 69925632842..00000000000 --- a/pkg/gen/adminmessages/electronic_orders_totals.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ElectronicOrdersTotals electronic orders totals -// -// swagger:model ElectronicOrdersTotals -type ElectronicOrdersTotals []*ElectronicOrdersTotal - -// Validate validates this electronic orders totals -func (m ElectronicOrdersTotals) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this electronic orders totals based on the context it is used -func (m ElectronicOrdersTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/issuer.go b/pkg/gen/adminmessages/issuer.go deleted file mode 100644 index 81dd9693167..00000000000 --- a/pkg/gen/adminmessages/issuer.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Issuer Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded. -// -// swagger:model Issuer -type Issuer string - -func NewIssuer(value Issuer) *Issuer { - return &value -} - -// Pointer returns a pointer to a freshly-allocated Issuer. -func (m Issuer) Pointer() *Issuer { - return &m -} - -const ( - - // IssuerArmy captures enum value "army" - IssuerArmy Issuer = "army" - - // IssuerNavy captures enum value "navy" - IssuerNavy Issuer = "navy" - - // IssuerAirDashForce captures enum value "air-force" - IssuerAirDashForce Issuer = "air-force" - - // IssuerMarineDashCorps captures enum value "marine-corps" - IssuerMarineDashCorps Issuer = "marine-corps" - - // IssuerCoastDashGuard captures enum value "coast-guard" - IssuerCoastDashGuard Issuer = "coast-guard" -) - -// for schema -var issuerEnum []interface{} - -func init() { - var res []Issuer - if err := json.Unmarshal([]byte(`["army","navy","air-force","marine-corps","coast-guard"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - issuerEnum = append(issuerEnum, v) - } -} - -func (m Issuer) validateIssuerEnum(path, location string, value Issuer) error { - if err := validate.EnumCase(path, location, value, issuerEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this issuer -func (m Issuer) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateIssuerEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this issuer based on context it is used -func (m Issuer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/adminmessages/move.go b/pkg/gen/adminmessages/move.go deleted file mode 100644 index 1cdbf840cf1..00000000000 --- a/pkg/gen/adminmessages/move.go +++ /dev/null @@ -1,295 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Move move -// -// swagger:model Move -type Move struct { - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // locator - // Example: 12432 - // Required: true - Locator *string `json:"locator"` - - // orders Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - OrdersID *strfmt.UUID `json:"ordersId"` - - // service member - ServiceMember *ServiceMember `json:"serviceMember,omitempty"` - - // show - Show *bool `json:"show,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this move -func (m *Move) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMember(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Move) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateLocator(formats strfmt.Registry) error { - - if err := validate.Required("locator", "body", m.Locator); err != nil { - return err - } - - return nil -} - -func (m *Move) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.Required("ordersId", "body", m.OrdersID); err != nil { - return err - } - - if err := validate.FormatOf("ordersId", "body", "uuid", m.OrdersID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateServiceMember(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMember) { // not required - return nil - } - - if m.ServiceMember != nil { - if err := m.ServiceMember.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceMember") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceMember") - } - return err - } - } - - return nil -} - -func (m *Move) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *Move) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move based on the context it is used -func (m *Move) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceMember(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Move) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Move) contextValidateServiceMember(ctx context.Context, formats strfmt.Registry) error { - - if m.ServiceMember != nil { - - if swag.IsZero(m.ServiceMember) { // not required - return nil - } - - if err := m.ServiceMember.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceMember") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceMember") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *Move) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Move) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Move) UnmarshalBinary(b []byte) error { - var res Move - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/move_status.go b/pkg/gen/adminmessages/move_status.go deleted file mode 100644 index 71801df750f..00000000000 --- a/pkg/gen/adminmessages/move_status.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MoveStatus Move status -// -// swagger:model MoveStatus -type MoveStatus string - -func NewMoveStatus(value MoveStatus) *MoveStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MoveStatus. -func (m MoveStatus) Pointer() *MoveStatus { - return &m -} - -const ( - - // MoveStatusDRAFT captures enum value "DRAFT" - MoveStatusDRAFT MoveStatus = "DRAFT" - - // MoveStatusSUBMITTED captures enum value "SUBMITTED" - MoveStatusSUBMITTED MoveStatus = "SUBMITTED" - - // MoveStatusAPPROVED captures enum value "APPROVED" - MoveStatusAPPROVED MoveStatus = "APPROVED" - - // MoveStatusCANCELED captures enum value "CANCELED" - MoveStatusCANCELED MoveStatus = "CANCELED" -) - -// for schema -var moveStatusEnum []interface{} - -func init() { - var res []MoveStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveStatusEnum = append(moveStatusEnum, v) - } -} - -func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { - if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this move status -func (m MoveStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMoveStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this move status based on context it is used -func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/adminmessages/move_update.go b/pkg/gen/adminmessages/move_update.go deleted file mode 100644 index 03c61926b4c..00000000000 --- a/pkg/gen/adminmessages/move_update.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveUpdate move update -// -// swagger:model MoveUpdate -type MoveUpdate struct { - - // show - // Required: true - Show *bool `json:"show"` -} - -// Validate validates this move update -func (m *MoveUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateShow(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveUpdate) validateShow(formats strfmt.Registry) error { - - if err := validate.Required("show", "body", m.Show); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this move update based on context it is used -func (m *MoveUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MoveUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveUpdate) UnmarshalBinary(b []byte) error { - var res MoveUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/moves.go b/pkg/gen/adminmessages/moves.go deleted file mode 100644 index 4336a71af8e..00000000000 --- a/pkg/gen/adminmessages/moves.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Moves moves -// -// swagger:model Moves -type Moves []*Move - -// Validate validates this moves -func (m Moves) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this moves based on the context it is used -func (m Moves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/notification.go b/pkg/gen/adminmessages/notification.go deleted file mode 100644 index fb0dafd9ef3..00000000000 --- a/pkg/gen/adminmessages/notification.go +++ /dev/null @@ -1,224 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Notification notification -// -// swagger:model Notification -type Notification struct { - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // email - // Required: true - Email *string `json:"email"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // notification type - // Required: true - // Enum: [MOVE_PAYMENT_REMINDER_EMAIL] - NotificationType *string `json:"notificationType"` - - // service member Id - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"serviceMemberId"` - - // ses message Id - // Required: true - SesMessageID *string `json:"sesMessageId"` -} - -// Validate validates this notification -func (m *Notification) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNotificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSesMessageID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Notification) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Notification) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - return nil -} - -func (m *Notification) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -var notificationTypeNotificationTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["MOVE_PAYMENT_REMINDER_EMAIL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - notificationTypeNotificationTypePropEnum = append(notificationTypeNotificationTypePropEnum, v) - } -} - -const ( - - // NotificationNotificationTypeMOVEPAYMENTREMINDEREMAIL captures enum value "MOVE_PAYMENT_REMINDER_EMAIL" - NotificationNotificationTypeMOVEPAYMENTREMINDEREMAIL string = "MOVE_PAYMENT_REMINDER_EMAIL" -) - -// prop value enum -func (m *Notification) validateNotificationTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, notificationTypeNotificationTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Notification) validateNotificationType(formats strfmt.Registry) error { - - if err := validate.Required("notificationType", "body", m.NotificationType); err != nil { - return err - } - - // value enum - if err := m.validateNotificationTypeEnum("notificationType", "body", *m.NotificationType); err != nil { - return err - } - - return nil -} - -func (m *Notification) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("serviceMemberId", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Notification) validateSesMessageID(formats strfmt.Registry) error { - - if err := validate.Required("sesMessageId", "body", m.SesMessageID); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this notification based on the context it is used -func (m *Notification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Notification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Notification) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Notification) UnmarshalBinary(b []byte) error { - var res Notification - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/notifications.go b/pkg/gen/adminmessages/notifications.go deleted file mode 100644 index 04ca2ba9f05..00000000000 --- a/pkg/gen/adminmessages/notifications.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Notifications notifications -// -// swagger:model Notifications -type Notifications []*Notification - -// Validate validates this notifications -func (m Notifications) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this notifications based on the context it is used -func (m Notifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/office_user.go b/pkg/gen/adminmessages/office_user.go deleted file mode 100644 index 0a58b7a0861..00000000000 --- a/pkg/gen/adminmessages/office_user.go +++ /dev/null @@ -1,606 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUser office user -// -// swagger:model OfficeUser -type OfficeUser struct { - - // active - // Required: true - Active *bool `json:"active"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // edipi - // Required: true - Edipi *string `json:"edipi"` - - // email - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email"` - - // first name - // Required: true - FirstName *string `json:"firstName"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // last name - // Required: true - LastName *string `json:"lastName"` - - // middle initials - // Required: true - MiddleInitials *string `json:"middleInitials"` - - // other unique Id - // Required: true - OtherUniqueID *string `json:"otherUniqueId"` - - // privileges - Privileges []*Privilege `json:"privileges"` - - // rejection reason - // Required: true - RejectionReason *string `json:"rejectionReason"` - - // roles - // Required: true - Roles []*Role `json:"roles"` - - // status - // Required: true - // Enum: [APPROVED REQUESTED REJECTED] - Status *string `json:"status"` - - // telephone - // Required: true - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone"` - - // transportation office assignments - // Required: true - TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportationOfficeAssignments"` - - // transportation office Id - // Required: true - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // user Id - // Format: uuid - UserID strfmt.UUID `json:"userId,omitempty"` -} - -// Validate validates this office user -func (m *OfficeUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActive(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMiddleInitials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOtherUniqueID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrivileges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRejectionReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeAssignments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) validateActive(formats strfmt.Registry) error { - - if err := validate.Required("active", "body", m.Active); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateEdipi(formats strfmt.Registry) error { - - if err := validate.Required("edipi", "body", m.Edipi); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateFirstName(formats strfmt.Registry) error { - - if err := validate.Required("firstName", "body", m.FirstName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateLastName(formats strfmt.Registry) error { - - if err := validate.Required("lastName", "body", m.LastName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateMiddleInitials(formats strfmt.Registry) error { - - if err := validate.Required("middleInitials", "body", m.MiddleInitials); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateOtherUniqueID(formats strfmt.Registry) error { - - if err := validate.Required("otherUniqueId", "body", m.OtherUniqueID); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validatePrivileges(formats strfmt.Registry) error { - if swag.IsZero(m.Privileges) { // not required - return nil - } - - for i := 0; i < len(m.Privileges); i++ { - if swag.IsZero(m.Privileges[i]) { // not required - continue - } - - if m.Privileges[i] != nil { - if err := m.Privileges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) validateRejectionReason(formats strfmt.Registry) error { - - if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateRoles(formats strfmt.Registry) error { - - if err := validate.Required("roles", "body", m.Roles); err != nil { - return err - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var officeUserTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["APPROVED","REQUESTED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - officeUserTypeStatusPropEnum = append(officeUserTypeStatusPropEnum, v) - } -} - -const ( - - // OfficeUserStatusAPPROVED captures enum value "APPROVED" - OfficeUserStatusAPPROVED string = "APPROVED" - - // OfficeUserStatusREQUESTED captures enum value "REQUESTED" - OfficeUserStatusREQUESTED string = "REQUESTED" - - // OfficeUserStatusREJECTED captures enum value "REJECTED" - OfficeUserStatusREJECTED string = "REJECTED" -) - -// prop value enum -func (m *OfficeUser) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, officeUserTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *OfficeUser) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateTelephone(formats strfmt.Registry) error { - - if err := validate.Required("telephone", "body", m.Telephone); err != nil { - return err - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeAssignments", "body", m.TransportationOfficeAssignments); err != nil { - return err - } - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - continue - } - - if m.TransportationOfficeAssignments[i] != nil { - if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this office user based on the context it is used -func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrivileges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Privileges); i++ { - - if m.Privileges[i] != nil { - - if swag.IsZero(m.Privileges[i]) { // not required - return nil - } - - if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - - if m.TransportationOfficeAssignments[i] != nil { - - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - return nil - } - - if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUser) UnmarshalBinary(b []byte) error { - var res OfficeUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_user_create.go b/pkg/gen/adminmessages/office_user_create.go deleted file mode 100644 index 6ad14306927..00000000000 --- a/pkg/gen/adminmessages/office_user_create.go +++ /dev/null @@ -1,281 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUserCreate office user create -// -// swagger:model OfficeUserCreate -type OfficeUserCreate struct { - - // Email - // Example: user@userdomain.com - Email string `json:"email,omitempty"` - - // First Name - FirstName string `json:"firstName,omitempty"` - - // Last Name - LastName string `json:"lastName,omitempty"` - - // Middle Initials - // Example: L. - MiddleInitials *string `json:"middleInitials,omitempty"` - - // privileges - Privileges []*OfficeUserPrivilege `json:"privileges"` - - // roles - Roles []*OfficeUserRole `json:"roles"` - - // telephone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone string `json:"telephone,omitempty"` - - // transportation office assignments - TransportationOfficeAssignments []*OfficeUserTransportationOfficeAssignment `json:"transportationOfficeAssignments"` -} - -// Validate validates this office user create -func (m *OfficeUserCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePrivileges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeAssignments(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserCreate) validatePrivileges(formats strfmt.Registry) error { - if swag.IsZero(m.Privileges) { // not required - return nil - } - - for i := 0; i < len(m.Privileges); i++ { - if swag.IsZero(m.Privileges[i]) { // not required - continue - } - - if m.Privileges[i] != nil { - if err := m.Privileges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserCreate) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(m.Roles) { // not required - return nil - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserCreate) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateTransportationOfficeAssignments(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeAssignments) { // not required - return nil - } - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - continue - } - - if m.TransportationOfficeAssignments[i] != nil { - if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this office user create based on the context it is used -func (m *OfficeUserCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePrivileges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserCreate) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Privileges); i++ { - - if m.Privileges[i] != nil { - - if swag.IsZero(m.Privileges[i]) { // not required - return nil - } - - if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserCreate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserCreate) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - - if m.TransportationOfficeAssignments[i] != nil { - - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - return nil - } - - if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserCreate) UnmarshalBinary(b []byte) error { - var res OfficeUserCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_user_privilege.go b/pkg/gen/adminmessages/office_user_privilege.go deleted file mode 100644 index 12c03673388..00000000000 --- a/pkg/gen/adminmessages/office_user_privilege.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OfficeUserPrivilege office user privilege -// -// swagger:model OfficeUserPrivilege -type OfficeUserPrivilege struct { - - // name - // Example: Supervisor - Name *string `json:"name,omitempty"` - - // privilegeType - // Example: supervisor - PrivilegeType *string `json:"privilegeType,omitempty"` -} - -// Validate validates this office user privilege -func (m *OfficeUserPrivilege) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this office user privilege based on context it is used -func (m *OfficeUserPrivilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserPrivilege) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserPrivilege) UnmarshalBinary(b []byte) error { - var res OfficeUserPrivilege - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_user_role.go b/pkg/gen/adminmessages/office_user_role.go deleted file mode 100644 index a3ef0e1e119..00000000000 --- a/pkg/gen/adminmessages/office_user_role.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OfficeUserRole office user role -// -// swagger:model OfficeUserRole -type OfficeUserRole struct { - - // name - // Example: Task Ordering Officer - Name *string `json:"name,omitempty"` - - // roleType - // Example: task_ordering_officer - RoleType *string `json:"roleType,omitempty"` -} - -// Validate validates this office user role -func (m *OfficeUserRole) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this office user role based on context it is used -func (m *OfficeUserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserRole) UnmarshalBinary(b []byte) error { - var res OfficeUserRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_user_transportation_office_assignment.go b/pkg/gen/adminmessages/office_user_transportation_office_assignment.go deleted file mode 100644 index ad1fcaffffb..00000000000 --- a/pkg/gen/adminmessages/office_user_transportation_office_assignment.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUserTransportationOfficeAssignment office user transportation office assignment -// -// swagger:model OfficeUserTransportationOfficeAssignment -type OfficeUserTransportationOfficeAssignment struct { - - // primaryOffice - PrimaryOffice *bool `json:"primaryOffice,omitempty"` - - // transportationOfficeId - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` -} - -// Validate validates this office user transportation office assignment -func (m *OfficeUserTransportationOfficeAssignment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserTransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this office user transportation office assignment based on context it is used -func (m *OfficeUserTransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserTransportationOfficeAssignment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserTransportationOfficeAssignment) UnmarshalBinary(b []byte) error { - var res OfficeUserTransportationOfficeAssignment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_user_update.go b/pkg/gen/adminmessages/office_user_update.go deleted file mode 100644 index 1210927a8e6..00000000000 --- a/pkg/gen/adminmessages/office_user_update.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUserUpdate office user update -// -// swagger:model OfficeUserUpdate -type OfficeUserUpdate struct { - - // active - Active *bool `json:"active,omitempty"` - - // First Name - FirstName *string `json:"firstName,omitempty"` - - // Last Name - LastName *string `json:"lastName,omitempty"` - - // Middle Initials - // Example: Q. - MiddleInitials *string `json:"middleInitials,omitempty"` - - // privileges - Privileges []*OfficeUserPrivilege `json:"privileges"` - - // roles - Roles []*OfficeUserRole `json:"roles"` - - // telephone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // transportation office assignments - TransportationOfficeAssignments []*OfficeUserTransportationOfficeAssignment `json:"transportationOfficeAssignments"` -} - -// Validate validates this office user update -func (m *OfficeUserUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePrivileges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeAssignments(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserUpdate) validatePrivileges(formats strfmt.Registry) error { - if swag.IsZero(m.Privileges) { // not required - return nil - } - - for i := 0; i < len(m.Privileges); i++ { - if swag.IsZero(m.Privileges[i]) { // not required - continue - } - - if m.Privileges[i] != nil { - if err := m.Privileges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserUpdate) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(m.Roles) { // not required - return nil - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserUpdate) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserUpdate) validateTransportationOfficeAssignments(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeAssignments) { // not required - return nil - } - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - continue - } - - if m.TransportationOfficeAssignments[i] != nil { - if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this office user update based on the context it is used -func (m *OfficeUserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePrivileges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserUpdate) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Privileges); i++ { - - if m.Privileges[i] != nil { - - if swag.IsZero(m.Privileges[i]) { // not required - return nil - } - - if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserUpdate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserUpdate) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - - if m.TransportationOfficeAssignments[i] != nil { - - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - return nil - } - - if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserUpdate) UnmarshalBinary(b []byte) error { - var res OfficeUserUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/office_users.go b/pkg/gen/adminmessages/office_users.go deleted file mode 100644 index d7403604137..00000000000 --- a/pkg/gen/adminmessages/office_users.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OfficeUsers office users -// -// swagger:model OfficeUsers -type OfficeUsers []*OfficeUser - -// Validate validates this office users -func (m OfficeUsers) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this office users based on the context it is used -func (m OfficeUsers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/okta_account_info_response.go b/pkg/gen/adminmessages/okta_account_info_response.go deleted file mode 100644 index aacfee8675f..00000000000 --- a/pkg/gen/adminmessages/okta_account_info_response.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OktaAccountInfoResponse okta account info response -// -// swagger:model OktaAccountInfoResponse -type OktaAccountInfoResponse struct { - - // activated - Activated string `json:"activated,omitempty"` - - // created - Created string `json:"created,omitempty"` - - // credentials - Credentials interface{} `json:"credentials,omitempty"` - - // id - ID string `json:"id,omitempty"` - - // profile - Profile interface{} `json:"profile,omitempty"` - - // status - Status string `json:"status,omitempty"` -} - -// Validate validates this okta account info response -func (m *OktaAccountInfoResponse) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this okta account info response based on context it is used -func (m *OktaAccountInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OktaAccountInfoResponse) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OktaAccountInfoResponse) UnmarshalBinary(b []byte) error { - var res OktaAccountInfoResponse - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/organization.go b/pkg/gen/adminmessages/organization.go deleted file mode 100644 index 8e83517d172..00000000000 --- a/pkg/gen/adminmessages/organization.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Organization organization -// -// swagger:model Organization -type Organization struct { - - // Created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name - // Required: true - Name *string `json:"name"` - - // telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // Updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this organization -func (m *Organization) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Organization) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Organization) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *Organization) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Organization) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *Organization) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *Organization) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this organization based on the context it is used -func (m *Organization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Organization) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Organization) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Organization) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Organization) UnmarshalBinary(b []byte) error { - var res Organization - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/organizations.go b/pkg/gen/adminmessages/organizations.go deleted file mode 100644 index 1c90c06aeb1..00000000000 --- a/pkg/gen/adminmessages/organizations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Organizations organizations -// -// swagger:model Organizations -type Organizations []*Organization - -// Validate validates this organizations -func (m Organizations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this organizations based on the context it is used -func (m Organizations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/payment_request_syncada_file.go b/pkg/gen/adminmessages/payment_request_syncada_file.go deleted file mode 100644 index efc68406b0a..00000000000 --- a/pkg/gen/adminmessages/payment_request_syncada_file.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequestSyncadaFile payment request syncada file -// -// swagger:model PaymentRequestSyncadaFile -type PaymentRequestSyncadaFile struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // edi string - EdiString string `json:"ediString,omitempty"` - - // file name - FileName string `json:"fileName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // payment request number - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` -} - -// Validate validates this payment request syncada file -func (m *PaymentRequestSyncadaFile) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequestSyncadaFile) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequestSyncadaFile) 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 -} - -// ContextValidate validate this payment request syncada file based on the context it is used -func (m *PaymentRequestSyncadaFile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequestSyncadaFile) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequestSyncadaFile) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequestSyncadaFile) UnmarshalBinary(b []byte) error { - var res PaymentRequestSyncadaFile - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/payment_request_syncada_files.go b/pkg/gen/adminmessages/payment_request_syncada_files.go deleted file mode 100644 index 2aa965b1493..00000000000 --- a/pkg/gen/adminmessages/payment_request_syncada_files.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequestSyncadaFiles payment request syncada files -// -// swagger:model PaymentRequestSyncadaFiles -type PaymentRequestSyncadaFiles []*PaymentRequestSyncadaFile - -// Validate validates this payment request syncada files -func (m PaymentRequestSyncadaFiles) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment request syncada files based on the context it is used -func (m PaymentRequestSyncadaFiles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/privilege.go b/pkg/gen/adminmessages/privilege.go deleted file mode 100644 index 36b0ce80d1f..00000000000 --- a/pkg/gen/adminmessages/privilege.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Privilege privilege -// -// swagger:model Privilege -type Privilege struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // privilege name - // Example: Supervisor - PrivilegeName string `json:"privilegeName,omitempty"` - - // privilege type - // Example: supervisor - PrivilegeType string `json:"privilegeType,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this privilege -func (m *Privilege) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Privilege) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Privilege) 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 *Privilege) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this privilege based on the context it is used -func (m *Privilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Privilege) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Privilege) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Privilege) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Privilege) UnmarshalBinary(b []byte) error { - var res Privilege - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/requested_office_user_update.go b/pkg/gen/adminmessages/requested_office_user_update.go deleted file mode 100644 index 3002224ef5d..00000000000 --- a/pkg/gen/adminmessages/requested_office_user_update.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RequestedOfficeUserUpdate requested office user update -// -// swagger:model RequestedOfficeUserUpdate -type RequestedOfficeUserUpdate struct { - - // edipi - Edipi string `json:"edipi,omitempty"` - - // email - // Example: user@userdomain.com - Email string `json:"email,omitempty"` - - // First Name - FirstName *string `json:"firstName,omitempty"` - - // Last Name - LastName *string `json:"lastName,omitempty"` - - // Middle Initials - // Example: Q. - MiddleInitials *string `json:"middleInitials,omitempty"` - - // other unique Id - OtherUniqueID string `json:"otherUniqueId,omitempty"` - - // rejection reason - RejectionReason string `json:"rejectionReason,omitempty"` - - // roles - Roles []*OfficeUserRole `json:"roles"` - - // status - // Enum: [APPROVED REJECTED] - Status string `json:"status,omitempty"` - - // telephone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // transportation office Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId,omitempty"` -} - -// Validate validates this requested office user update -func (m *RequestedOfficeUserUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestedOfficeUserUpdate) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(m.Roles) { // not required - return nil - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var requestedOfficeUserUpdateTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - requestedOfficeUserUpdateTypeStatusPropEnum = append(requestedOfficeUserUpdateTypeStatusPropEnum, v) - } -} - -const ( - - // RequestedOfficeUserUpdateStatusAPPROVED captures enum value "APPROVED" - RequestedOfficeUserUpdateStatusAPPROVED string = "APPROVED" - - // RequestedOfficeUserUpdateStatusREJECTED captures enum value "REJECTED" - RequestedOfficeUserUpdateStatusREJECTED string = "REJECTED" -) - -// prop value enum -func (m *RequestedOfficeUserUpdate) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, requestedOfficeUserUpdateTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *RequestedOfficeUserUpdate) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *RequestedOfficeUserUpdate) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *RequestedOfficeUserUpdate) validateTransportationOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this requested office user update based on the context it is used -func (m *RequestedOfficeUserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestedOfficeUserUpdate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *RequestedOfficeUserUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestedOfficeUserUpdate) UnmarshalBinary(b []byte) error { - var res RequestedOfficeUserUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/role.go b/pkg/gen/adminmessages/role.go deleted file mode 100644 index d770cf8e622..00000000000 --- a/pkg/gen/adminmessages/role.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Role role -// -// swagger:model Role -type Role struct { - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // role name - // Example: Task Ordering Officer - // Required: true - RoleName *string `json:"roleName"` - - // role type - // Example: customer - // Required: true - RoleType *string `json:"roleType"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this role -func (m *Role) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Role) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateRoleName(formats strfmt.Registry) error { - - if err := validate.Required("roleName", "body", m.RoleName); err != nil { - return err - } - - return nil -} - -func (m *Role) validateRoleType(formats strfmt.Registry) error { - - if err := validate.Required("roleType", "body", m.RoleType); err != nil { - return err - } - - return nil -} - -func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this role based on the context it is used -func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Role) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Role) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Role) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Role) UnmarshalBinary(b []byte) error { - var res Role - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/service_member.go b/pkg/gen/adminmessages/service_member.go deleted file mode 100644 index cb730bc165d..00000000000 --- a/pkg/gen/adminmessages/service_member.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceMember service member -// -// swagger:model ServiceMember -type ServiceMember struct { - - // First Name - FirstName *string `json:"firstName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Last Name - LastName *string `json:"lastName,omitempty"` - - // Middle Name - MiddleName *string `json:"middleName,omitempty"` - - // user Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - UserID strfmt.UUID `json:"userId,omitempty"` -} - -// Validate validates this service member -func (m *ServiceMember) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMember) 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 *ServiceMember) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service member based on the context it is used -func (m *ServiceMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUserID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMember) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ServiceMember) contextValidateUserID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "userId", "body", strfmt.UUID(m.UserID)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceMember) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceMember) UnmarshalBinary(b []byte) error { - var res ServiceMember - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/transportation_office.go b/pkg/gen/adminmessages/transportation_office.go deleted file mode 100644 index f291b011d51..00000000000 --- a/pkg/gen/adminmessages/transportation_office.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOffice transportation office -// -// swagger:model TransportationOffice -type TransportationOffice struct { - - // address - // Required: true - Address *Address `json:"address"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // gbloc - // Example: JENQ - // Pattern: ^[A-Z]{4}$ - Gbloc string `json:"gbloc,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // latitude - // Example: 29.382973 - Latitude float32 `json:"latitude,omitempty"` - - // longitude - // Example: -98.62759 - Longitude float32 `json:"longitude,omitempty"` - - // name - // Example: Fort Bragg North Station - // Required: true - Name *string `json:"name"` - - // phone lines - PhoneLines []string `json:"phoneLines"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this transportation office -func (m *TransportationOffice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGbloc(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhoneLines(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { - if swag.IsZero(m.Gbloc) { // not required - return nil - } - - if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { - if swag.IsZero(m.PhoneLines) { // not required - return nil - } - - for i := 0; i < len(m.PhoneLines); i++ { - - if err := validate.Pattern("phoneLines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - } - - return nil -} - -func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office based on the context it is used -func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *TransportationOffice) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOffice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOffice) UnmarshalBinary(b []byte) error { - var res TransportationOffice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/transportation_office_assignment.go b/pkg/gen/adminmessages/transportation_office_assignment.go deleted file mode 100644 index 8deb239d7a5..00000000000 --- a/pkg/gen/adminmessages/transportation_office_assignment.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOfficeAssignment transportation office assignment -// -// swagger:model TransportationOfficeAssignment -type TransportationOfficeAssignment struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // office user Id - // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 - // Format: uuid - OfficeUserID strfmt.UUID `json:"officeUserId,omitempty"` - - // primary office - PrimaryOffice bool `json:"primaryOffice"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` - - // transportation office Id - // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 - // Format: uuid - TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this transportation office assignment -func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office assignment based on the context it is used -func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { - var res TransportationOfficeAssignment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/transportation_offices.go b/pkg/gen/adminmessages/transportation_offices.go deleted file mode 100644 index 30adb86c204..00000000000 --- a/pkg/gen/adminmessages/transportation_offices.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TransportationOffices transportation offices -// -// swagger:model TransportationOffices -type TransportationOffices []*TransportationOffice - -// Validate validates this transportation offices -func (m TransportationOffices) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this transportation offices based on the context it is used -func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/upload.go b/pkg/gen/adminmessages/upload.go deleted file mode 100644 index 83cc5fb4b50..00000000000 --- a/pkg/gen/adminmessages/upload.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Upload upload -// -// swagger:model Upload -type Upload struct { - - // content type - // Enum: [application/pdf image/jpeg image/png] - ContentType string `json:"contentType,omitempty"` - - // Created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - Filename string `json:"filename,omitempty"` - - // Size in Bytes - Size int64 `json:"size,omitempty"` -} - -// Validate validates this upload -func (m *Upload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var uploadTypeContentTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["application/pdf","image/jpeg","image/png"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadTypeContentTypePropEnum = append(uploadTypeContentTypePropEnum, v) - } -} - -const ( - - // UploadContentTypeApplicationPdf captures enum value "application/pdf" - UploadContentTypeApplicationPdf string = "application/pdf" - - // UploadContentTypeImageJpeg captures enum value "image/jpeg" - UploadContentTypeImageJpeg string = "image/jpeg" - - // UploadContentTypeImagePng captures enum value "image/png" - UploadContentTypeImagePng string = "image/png" -) - -// prop value enum -func (m *Upload) validateContentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadTypeContentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Upload) validateContentType(formats strfmt.Registry) error { - if swag.IsZero(m.ContentType) { // not required - return nil - } - - // value enum - if err := m.validateContentTypeEnum("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload based on the context it is used -func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Upload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Upload) UnmarshalBinary(b []byte) error { - var res Upload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/upload_information.go b/pkg/gen/adminmessages/upload_information.go deleted file mode 100644 index f6b8b66dee2..00000000000 --- a/pkg/gen/adminmessages/upload_information.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadInformation upload information -// -// swagger:model UploadInformation -type UploadInformation struct { - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move locator - // Example: 12432 - MoveLocator *string `json:"moveLocator,omitempty"` - - // office user email - OfficeUserEmail *string `json:"officeUserEmail,omitempty"` - - // office user first name - OfficeUserFirstName *string `json:"officeUserFirstName,omitempty"` - - // office user Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OfficeUserID *strfmt.UUID `json:"officeUserId,omitempty"` - - // office user last name - OfficeUserLastName *string `json:"officeUserLastName,omitempty"` - - // office user phone - OfficeUserPhone *string `json:"officeUserPhone,omitempty"` - - // service member email - ServiceMemberEmail *string `json:"serviceMemberEmail,omitempty"` - - // service member first name - ServiceMemberFirstName *string `json:"serviceMemberFirstName,omitempty"` - - // service member Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"serviceMemberId,omitempty"` - - // service member last name - ServiceMemberLastName *string `json:"serviceMemberLastName,omitempty"` - - // service member phone - ServiceMemberPhone *string `json:"serviceMemberPhone,omitempty"` - - // upload - Upload *Upload `json:"upload,omitempty"` -} - -// Validate validates this upload information -func (m *UploadInformation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpload(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadInformation) 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 *UploadInformation) validateOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadInformation) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadInformation) validateUpload(formats strfmt.Registry) error { - if swag.IsZero(m.Upload) { // not required - return nil - } - - if m.Upload != nil { - if err := m.Upload.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("upload") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("upload") - } - return err - } - } - - return nil -} - -// ContextValidate validate this upload information based on the context it is used -func (m *UploadInformation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUpload(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadInformation) contextValidateUpload(ctx context.Context, formats strfmt.Registry) error { - - if m.Upload != nil { - - if swag.IsZero(m.Upload) { // not required - return nil - } - - if err := m.Upload.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("upload") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("upload") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadInformation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadInformation) UnmarshalBinary(b []byte) error { - var res UploadInformation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/user.go b/pkg/gen/adminmessages/user.go deleted file mode 100644 index 3ff4ba48b7f..00000000000 --- a/pkg/gen/adminmessages/user.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// User user -// -// swagger:model User -type User struct { - - // active - // Required: true - Active *bool `json:"active"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // current admin session Id - // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w - // Required: true - CurrentAdminSessionID *string `json:"currentAdminSessionId"` - - // current mil session Id - // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w - // Required: true - CurrentMilSessionID *string `json:"currentMilSessionId"` - - // current office session Id - // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w - // Required: true - CurrentOfficeSessionID *string `json:"currentOfficeSessionId"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // okta email - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - OktaEmail *string `json:"oktaEmail"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this user -func (m *User) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActive(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentAdminSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentMilSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentOfficeSessionID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOktaEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *User) validateActive(formats strfmt.Registry) error { - - if err := validate.Required("active", "body", m.Active); err != nil { - return err - } - - return nil -} - -func (m *User) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *User) validateCurrentAdminSessionID(formats strfmt.Registry) error { - - if err := validate.Required("currentAdminSessionId", "body", m.CurrentAdminSessionID); err != nil { - return err - } - - return nil -} - -func (m *User) validateCurrentMilSessionID(formats strfmt.Registry) error { - - if err := validate.Required("currentMilSessionId", "body", m.CurrentMilSessionID); err != nil { - return err - } - - return nil -} - -func (m *User) validateCurrentOfficeSessionID(formats strfmt.Registry) error { - - if err := validate.Required("currentOfficeSessionId", "body", m.CurrentOfficeSessionID); err != nil { - return err - } - - return nil -} - -func (m *User) 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 *User) validateOktaEmail(formats strfmt.Registry) error { - - if err := validate.Required("oktaEmail", "body", m.OktaEmail); err != nil { - return err - } - - if err := validate.Pattern("oktaEmail", "body", *m.OktaEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *User) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this user based on the context it is used -func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *User) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *User) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *User) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *User) UnmarshalBinary(b []byte) error { - var res User - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/user_update.go b/pkg/gen/adminmessages/user_update.go deleted file mode 100644 index 2ea4aac7cf7..00000000000 --- a/pkg/gen/adminmessages/user_update.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UserUpdate user update -// -// swagger:model UserUpdate -type UserUpdate struct { - - // active - Active *bool `json:"active,omitempty"` - - // revoke admin session - RevokeAdminSession *bool `json:"revokeAdminSession,omitempty"` - - // revoke mil session - RevokeMilSession *bool `json:"revokeMilSession,omitempty"` - - // revoke office session - RevokeOfficeSession *bool `json:"revokeOfficeSession,omitempty"` -} - -// Validate validates this user update -func (m *UserUpdate) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this user update based on context it is used -func (m *UserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UserUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UserUpdate) UnmarshalBinary(b []byte) error { - var res UserUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/users.go b/pkg/gen/adminmessages/users.go deleted file mode 100644 index 2032993a35a..00000000000 --- a/pkg/gen/adminmessages/users.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Users users -// -// swagger:model Users -type Users []*User - -// Validate validates this users -func (m Users) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this users based on the context it is used -func (m Users) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/adminmessages/validation_error.go b/pkg/gen/adminmessages/validation_error.go deleted file mode 100644 index 31f9c2c2610..00000000000 --- a/pkg/gen/adminmessages/validation_error.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - ValidationErrorAllOf1 - - // invalid fields - // Required: true - InvalidFields map[string]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var aO1 ValidationErrorAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.ValidationErrorAllOf1 = aO1 - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &propsValidationError); err != nil { - return err - } - m.InvalidFields = propsValidationError.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string]string `json:"invalidFields"` - } - propsValidationError.InvalidFields = m.InvalidFields - - jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) - if errValidationError != nil { - return nil, errValidationError - } - _parts = append(_parts, jsonDataPropsValidationError) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ValidationErrorAllOf1 validation error all of1 -// -// swagger:model ValidationErrorAllOf1 -type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/adminmessages/webhook_subscription.go b/pkg/gen/adminmessages/webhook_subscription.go deleted file mode 100644 index 0d042898e6c..00000000000 --- a/pkg/gen/adminmessages/webhook_subscription.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WebhookSubscription Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically. -// -// swagger:model WebhookSubscription -type WebhookSubscription struct { - - // The URL to which the notifications for this subscription will be pushed to. - CallbackURL *string `json:"callbackUrl,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications. - EventKey *string `json:"eventKey,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // severity - // Minimum: 0 - Severity *int64 `json:"severity,omitempty"` - - // status - Status *WebhookSubscriptionStatus `json:"status,omitempty"` - - // Unique identifier for the subscriber - // Example: d494f114-05a2-4b39-840c-3d33243b7e29 - // Format: uuid - SubscriberID *strfmt.UUID `json:"subscriberId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this webhook subscription -func (m *WebhookSubscription) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSeverity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubscriberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WebhookSubscription) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) 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 *WebhookSubscription) validateSeverity(formats strfmt.Registry) error { - if swag.IsZero(m.Severity) { // not required - return nil - } - - if err := validate.MinimumInt("severity", "body", *m.Severity, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WebhookSubscription) validateSubscriberID(formats strfmt.Registry) error { - if swag.IsZero(m.SubscriberID) { // not required - return nil - } - - if err := validate.FormatOf("subscriberId", "body", "uuid", m.SubscriberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this webhook subscription based on the context it is used -func (m *WebhookSubscription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WebhookSubscription) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *WebhookSubscription) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WebhookSubscription) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WebhookSubscription) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WebhookSubscription) UnmarshalBinary(b []byte) error { - var res WebhookSubscription - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/adminmessages/webhook_subscription_status.go b/pkg/gen/adminmessages/webhook_subscription_status.go deleted file mode 100644 index 5085d145c8f..00000000000 --- a/pkg/gen/adminmessages/webhook_subscription_status.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// WebhookSubscriptionStatus Webhook subscription status -// -// swagger:model WebhookSubscriptionStatus -type WebhookSubscriptionStatus string - -func NewWebhookSubscriptionStatus(value WebhookSubscriptionStatus) *WebhookSubscriptionStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated WebhookSubscriptionStatus. -func (m WebhookSubscriptionStatus) Pointer() *WebhookSubscriptionStatus { - return &m -} - -const ( - - // WebhookSubscriptionStatusACTIVE captures enum value "ACTIVE" - WebhookSubscriptionStatusACTIVE WebhookSubscriptionStatus = "ACTIVE" - - // WebhookSubscriptionStatusFAILING captures enum value "FAILING" - WebhookSubscriptionStatusFAILING WebhookSubscriptionStatus = "FAILING" - - // WebhookSubscriptionStatusDISABLED captures enum value "DISABLED" - WebhookSubscriptionStatusDISABLED WebhookSubscriptionStatus = "DISABLED" -) - -// for schema -var webhookSubscriptionStatusEnum []interface{} - -func init() { - var res []WebhookSubscriptionStatus - if err := json.Unmarshal([]byte(`["ACTIVE","FAILING","DISABLED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - webhookSubscriptionStatusEnum = append(webhookSubscriptionStatusEnum, v) - } -} - -func (m WebhookSubscriptionStatus) validateWebhookSubscriptionStatusEnum(path, location string, value WebhookSubscriptionStatus) error { - if err := validate.EnumCase(path, location, value, webhookSubscriptionStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this webhook subscription status -func (m WebhookSubscriptionStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateWebhookSubscriptionStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this webhook subscription status based on context it is used -func (m WebhookSubscriptionStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/adminmessages/webhook_subscriptions.go b/pkg/gen/adminmessages/webhook_subscriptions.go deleted file mode 100644 index cf63024b85c..00000000000 --- a/pkg/gen/adminmessages/webhook_subscriptions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package adminmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WebhookSubscriptions webhook subscriptions -// -// swagger:model WebhookSubscriptions -type WebhookSubscriptions []*WebhookSubscription - -// Validate validates this webhook subscriptions -func (m WebhookSubscriptions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this webhook subscriptions based on the context it is used -func (m WebhookSubscriptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go deleted file mode 100644 index 2c7449ec836..00000000000 --- a/pkg/gen/ghcapi/configure_mymove.go +++ /dev/null @@ -1,640 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package ghcapi - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/addresses" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/application_parameters" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/calendar" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer_support_remarks" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/evaluation_reports" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ghc_documents" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/lines_of_accounting" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_agent" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/office_users" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/order" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_requests" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_service_item" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ppm" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/pws_violations" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/queues" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/re_service_items" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/report_violations" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/shipment" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/tac" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/transportation_office" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/uploads" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/ghc.yaml --api-package ghcoperations --model-package ghcmessages --server-package ghcapi --principal interface{} --exclude-main - -func configureFlags(api *ghcoperations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - api.MultipartformConsumer = runtime.DiscardConsumer - - api.BinProducer = runtime.ByteStreamProducer() - api.JSONProducer = runtime.JSONProducer() - - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // uploads.CreateUploadMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // move.UploadAdditionalDocumentsMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // order.UploadAmendedOrdersMaxParseMemory = 32 << 20 - - if api.OrderAcknowledgeExcessWeightRiskHandler == nil { - api.OrderAcknowledgeExcessWeightRiskHandler = order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder { - return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented") - }) - } - if api.EvaluationReportsAddAppealToSeriousIncidentHandler == nil { - api.EvaluationReportsAddAppealToSeriousIncidentHandler = evaluation_reports.AddAppealToSeriousIncidentHandlerFunc(func(params evaluation_reports.AddAppealToSeriousIncidentParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.AddAppealToSeriousIncident has not yet been implemented") - }) - } - if api.EvaluationReportsAddAppealToViolationHandler == nil { - api.EvaluationReportsAddAppealToViolationHandler = evaluation_reports.AddAppealToViolationHandlerFunc(func(params evaluation_reports.AddAppealToViolationParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.AddAppealToViolation has not yet been implemented") - }) - } - if api.ShipmentApproveSITExtensionHandler == nil { - api.ShipmentApproveSITExtensionHandler = shipment.ApproveSITExtensionHandlerFunc(func(params shipment.ApproveSITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveSITExtension has not yet been implemented") - }) - } - if api.ShipmentApproveShipmentHandler == nil { - api.ShipmentApproveShipmentHandler = shipment.ApproveShipmentHandlerFunc(func(params shipment.ApproveShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveShipment has not yet been implemented") - }) - } - if api.ShipmentApproveShipmentDiversionHandler == nil { - api.ShipmentApproveShipmentDiversionHandler = shipment.ApproveShipmentDiversionHandlerFunc(func(params shipment.ApproveShipmentDiversionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") - }) - } - if api.ReportViolationsAssociateReportViolationsHandler == nil { - api.ReportViolationsAssociateReportViolationsHandler = report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { - return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") - }) - } - if api.PaymentRequestsBulkDownloadHandler == nil { - api.PaymentRequestsBulkDownloadHandler = payment_requests.BulkDownloadHandlerFunc(func(params payment_requests.BulkDownloadParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.BulkDownload has not yet been implemented") - }) - } - if api.MoveCheckForLockedMovesAndUnlockHandler == nil { - api.MoveCheckForLockedMovesAndUnlockHandler = move.CheckForLockedMovesAndUnlockHandlerFunc(func(params move.CheckForLockedMovesAndUnlockParams) middleware.Responder { - return middleware.NotImplemented("operation move.CheckForLockedMovesAndUnlock has not yet been implemented") - }) - } - if api.OrderCounselingUpdateAllowanceHandler == nil { - api.OrderCounselingUpdateAllowanceHandler = order.CounselingUpdateAllowanceHandlerFunc(func(params order.CounselingUpdateAllowanceParams) middleware.Responder { - return middleware.NotImplemented("operation order.CounselingUpdateAllowance has not yet been implemented") - }) - } - if api.OrderCounselingUpdateOrderHandler == nil { - api.OrderCounselingUpdateOrderHandler = order.CounselingUpdateOrderHandlerFunc(func(params order.CounselingUpdateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.CounselingUpdateOrder has not yet been implemented") - }) - } - if api.ShipmentCreateApprovedSITDurationUpdateHandler == nil { - api.ShipmentCreateApprovedSITDurationUpdateHandler = shipment.CreateApprovedSITDurationUpdateHandlerFunc(func(params shipment.CreateApprovedSITDurationUpdateParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.CreateApprovedSITDurationUpdate has not yet been implemented") - }) - } - if api.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler == nil { - api.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler = customer_support_remarks.CreateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.CreateCustomerSupportRemarkForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.CreateCustomerSupportRemarkForMove has not yet been implemented") - }) - } - if api.CustomerCreateCustomerWithOktaOptionHandler == nil { - api.CustomerCreateCustomerWithOktaOptionHandler = customer.CreateCustomerWithOktaOptionHandlerFunc(func(params customer.CreateCustomerWithOktaOptionParams) middleware.Responder { - return middleware.NotImplemented("operation customer.CreateCustomerWithOktaOption has not yet been implemented") - }) - } - if api.GhcDocumentsCreateDocumentHandler == nil { - api.GhcDocumentsCreateDocumentHandler = ghc_documents.CreateDocumentHandlerFunc(func(params ghc_documents.CreateDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation ghc_documents.CreateDocument has not yet been implemented") - }) - } - if api.EvaluationReportsCreateEvaluationReportHandler == nil { - api.EvaluationReportsCreateEvaluationReportHandler = evaluation_reports.CreateEvaluationReportHandlerFunc(func(params evaluation_reports.CreateEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.CreateEvaluationReport has not yet been implemented") - }) - } - if api.MtoShipmentCreateMTOShipmentHandler == nil { - api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }) - } - if api.OrderCreateOrderHandler == nil { - api.OrderCreateOrderHandler = order.CreateOrderHandlerFunc(func(params order.CreateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.CreateOrder has not yet been implemented") - }) - } - if api.OfficeUsersCreateRequestedOfficeUserHandler == nil { - api.OfficeUsersCreateRequestedOfficeUserHandler = office_users.CreateRequestedOfficeUserHandlerFunc(func(params office_users.CreateRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.CreateRequestedOfficeUser has not yet been implemented") - }) - } - if api.UploadsCreateUploadHandler == nil { - api.UploadsCreateUploadHandler = uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") - }) - } - if api.MoveDeleteAssignedOfficeUserHandler == nil { - api.MoveDeleteAssignedOfficeUserHandler = move.DeleteAssignedOfficeUserHandlerFunc(func(params move.DeleteAssignedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation move.DeleteAssignedOfficeUser has not yet been implemented") - }) - } - if api.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler == nil { - api.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler = customer_support_remarks.DeleteCustomerSupportRemarkHandlerFunc(func(params customer_support_remarks.DeleteCustomerSupportRemarkParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.DeleteCustomerSupportRemark has not yet been implemented") - }) - } - if api.EvaluationReportsDeleteEvaluationReportHandler == nil { - api.EvaluationReportsDeleteEvaluationReportHandler = evaluation_reports.DeleteEvaluationReportHandlerFunc(func(params evaluation_reports.DeleteEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.DeleteEvaluationReport has not yet been implemented") - }) - } - if api.ShipmentDeleteShipmentHandler == nil { - api.ShipmentDeleteShipmentHandler = shipment.DeleteShipmentHandlerFunc(func(params shipment.DeleteShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.DeleteShipment has not yet been implemented") - }) - } - if api.UploadsDeleteUploadHandler == nil { - api.UploadsDeleteUploadHandler = uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") - }) - } - if api.ShipmentDenySITExtensionHandler == nil { - api.ShipmentDenySITExtensionHandler = shipment.DenySITExtensionHandlerFunc(func(params shipment.DenySITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.DenySITExtension has not yet been implemented") - }) - } - if api.EvaluationReportsDownloadEvaluationReportHandler == nil { - api.EvaluationReportsDownloadEvaluationReportHandler = evaluation_reports.DownloadEvaluationReportHandlerFunc(func(params evaluation_reports.DownloadEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.DownloadEvaluationReport has not yet been implemented") - }) - } - if api.MtoAgentFetchMTOAgentListHandler == nil { - api.MtoAgentFetchMTOAgentListHandler = mto_agent.FetchMTOAgentListHandlerFunc(func(params mto_agent.FetchMTOAgentListParams) middleware.Responder { - return middleware.NotImplemented("operation mto_agent.FetchMTOAgentList has not yet been implemented") - }) - } - if api.PpmFinishDocumentReviewHandler == nil { - api.PpmFinishDocumentReviewHandler = ppm.FinishDocumentReviewHandlerFunc(func(params ppm.FinishDocumentReviewParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.FinishDocumentReview has not yet been implemented") - }) - } - if api.ReServiceItemsGetAllReServiceItemsHandler == nil { - api.ReServiceItemsGetAllReServiceItemsHandler = re_service_items.GetAllReServiceItemsHandlerFunc(func(params re_service_items.GetAllReServiceItemsParams) middleware.Responder { - return middleware.NotImplemented("operation re_service_items.GetAllReServiceItems has not yet been implemented") - }) - } - if api.QueuesGetBulkAssignmentDataHandler == nil { - api.QueuesGetBulkAssignmentDataHandler = queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") - }) - } - if api.CustomerGetCustomerHandler == nil { - api.CustomerGetCustomerHandler = customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { - return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") - }) - } - if api.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler == nil { - api.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler = customer_support_remarks.GetCustomerSupportRemarksForMoveHandlerFunc(func(params customer_support_remarks.GetCustomerSupportRemarksForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.GetCustomerSupportRemarksForMove has not yet been implemented") - }) - } - if api.GhcDocumentsGetDocumentHandler == nil { - api.GhcDocumentsGetDocumentHandler = ghc_documents.GetDocumentHandlerFunc(func(params ghc_documents.GetDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation ghc_documents.GetDocument has not yet been implemented") - }) - } - if api.MoveTaskOrderGetEntitlementsHandler == nil { - api.MoveTaskOrderGetEntitlementsHandler = move_task_order.GetEntitlementsHandlerFunc(func(params move_task_order.GetEntitlementsParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetEntitlements has not yet been implemented") - }) - } - if api.EvaluationReportsGetEvaluationReportHandler == nil { - api.EvaluationReportsGetEvaluationReportHandler = evaluation_reports.GetEvaluationReportHandlerFunc(func(params evaluation_reports.GetEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.GetEvaluationReport has not yet been implemented") - }) - } - if api.AddressesGetLocationByZipCityStateHandler == nil { - api.AddressesGetLocationByZipCityStateHandler = addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") - }) - } - if api.MtoServiceItemGetMTOServiceItemHandler == nil { - api.MtoServiceItemGetMTOServiceItemHandler = mto_service_item.GetMTOServiceItemHandlerFunc(func(params mto_service_item.GetMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.GetMTOServiceItem has not yet been implemented") - }) - } - if api.MoveGetMoveHandler == nil { - api.MoveGetMoveHandler = move.GetMoveHandlerFunc(func(params move.GetMoveParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMove has not yet been implemented") - }) - } - if api.MoveGetMoveCounselingEvaluationReportsListHandler == nil { - api.MoveGetMoveCounselingEvaluationReportsListHandler = move.GetMoveCounselingEvaluationReportsListHandlerFunc(func(params move.GetMoveCounselingEvaluationReportsListParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveCounselingEvaluationReportsList has not yet been implemented") - }) - } - if api.MoveGetMoveHistoryHandler == nil { - api.MoveGetMoveHistoryHandler = move.GetMoveHistoryHandlerFunc(func(params move.GetMoveHistoryParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveHistory has not yet been implemented") - }) - } - if api.MoveGetMoveShipmentEvaluationReportsListHandler == nil { - api.MoveGetMoveShipmentEvaluationReportsListHandler = move.GetMoveShipmentEvaluationReportsListHandlerFunc(func(params move.GetMoveShipmentEvaluationReportsListParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveShipmentEvaluationReportsList has not yet been implemented") - }) - } - if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { - api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }) - } - if api.QueuesGetMovesQueueHandler == nil { - api.QueuesGetMovesQueueHandler = queues.GetMovesQueueHandlerFunc(func(params queues.GetMovesQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetMovesQueue has not yet been implemented") - }) - } - if api.OrderGetOrderHandler == nil { - api.OrderGetOrderHandler = order.GetOrderHandlerFunc(func(params order.GetOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.GetOrder has not yet been implemented") - }) - } - if api.PpmGetPPMActualWeightHandler == nil { - api.PpmGetPPMActualWeightHandler = ppm.GetPPMActualWeightHandlerFunc(func(params ppm.GetPPMActualWeightParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMActualWeight has not yet been implemented") - }) - } - if api.PpmGetPPMCloseoutHandler == nil { - api.PpmGetPPMCloseoutHandler = ppm.GetPPMCloseoutHandlerFunc(func(params ppm.GetPPMCloseoutParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMCloseout has not yet been implemented") - }) - } - if api.PpmGetPPMDocumentsHandler == nil { - api.PpmGetPPMDocumentsHandler = ppm.GetPPMDocumentsHandlerFunc(func(params ppm.GetPPMDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMDocuments has not yet been implemented") - }) - } - if api.PpmGetPPMSITEstimatedCostHandler == nil { - api.PpmGetPPMSITEstimatedCostHandler = ppm.GetPPMSITEstimatedCostHandlerFunc(func(params ppm.GetPPMSITEstimatedCostParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMSITEstimatedCost has not yet been implemented") - }) - } - if api.PwsViolationsGetPWSViolationsHandler == nil { - api.PwsViolationsGetPWSViolationsHandler = pws_violations.GetPWSViolationsHandlerFunc(func(params pws_violations.GetPWSViolationsParams) middleware.Responder { - return middleware.NotImplemented("operation pws_violations.GetPWSViolations has not yet been implemented") - }) - } - if api.ApplicationParametersGetParamHandler == nil { - api.ApplicationParametersGetParamHandler = application_parameters.GetParamHandlerFunc(func(params application_parameters.GetParamParams) middleware.Responder { - return middleware.NotImplemented("operation application_parameters.GetParam has not yet been implemented") - }) - } - if api.PaymentRequestsGetPaymentRequestHandler == nil { - api.PaymentRequestsGetPaymentRequestHandler = payment_requests.GetPaymentRequestHandlerFunc(func(params payment_requests.GetPaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetPaymentRequest has not yet been implemented") - }) - } - if api.PaymentRequestsGetPaymentRequestsForMoveHandler == nil { - api.PaymentRequestsGetPaymentRequestsForMoveHandler = payment_requests.GetPaymentRequestsForMoveHandlerFunc(func(params payment_requests.GetPaymentRequestsForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetPaymentRequestsForMove has not yet been implemented") - }) - } - if api.QueuesGetPaymentRequestsQueueHandler == nil { - api.QueuesGetPaymentRequestsQueueHandler = queues.GetPaymentRequestsQueueHandlerFunc(func(params queues.GetPaymentRequestsQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetPaymentRequestsQueue has not yet been implemented") - }) - } - if api.ReportViolationsGetReportViolationsByReportIDHandler == nil { - api.ReportViolationsGetReportViolationsByReportIDHandler = report_violations.GetReportViolationsByReportIDHandlerFunc(func(params report_violations.GetReportViolationsByReportIDParams) middleware.Responder { - return middleware.NotImplemented("operation report_violations.GetReportViolationsByReportID has not yet been implemented") - }) - } - if api.QueuesGetServicesCounselingOriginListHandler == nil { - api.QueuesGetServicesCounselingOriginListHandler = queues.GetServicesCounselingOriginListHandlerFunc(func(params queues.GetServicesCounselingOriginListParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetServicesCounselingOriginList has not yet been implemented") - }) - } - if api.QueuesGetServicesCounselingQueueHandler == nil { - api.QueuesGetServicesCounselingQueueHandler = queues.GetServicesCounselingQueueHandlerFunc(func(params queues.GetServicesCounselingQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetServicesCounselingQueue has not yet been implemented") - }) - } - if api.MtoShipmentGetShipmentHandler == nil { - api.MtoShipmentGetShipmentHandler = mto_shipment.GetShipmentHandlerFunc(func(params mto_shipment.GetShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.GetShipment has not yet been implemented") - }) - } - if api.PaymentRequestsGetShipmentsPaymentSITBalanceHandler == nil { - api.PaymentRequestsGetShipmentsPaymentSITBalanceHandler = payment_requests.GetShipmentsPaymentSITBalanceHandlerFunc(func(params payment_requests.GetShipmentsPaymentSITBalanceParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetShipmentsPaymentSITBalance has not yet been implemented") - }) - } - if api.TransportationOfficeGetTransportationOfficesHandler == nil { - api.TransportationOfficeGetTransportationOfficesHandler = transportation_office.GetTransportationOfficesHandlerFunc(func(params transportation_office.GetTransportationOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOffices has not yet been implemented") - }) - } - if api.TransportationOfficeGetTransportationOfficesGBLOCsHandler == nil { - api.TransportationOfficeGetTransportationOfficesGBLOCsHandler = transportation_office.GetTransportationOfficesGBLOCsHandlerFunc(func(params transportation_office.GetTransportationOfficesGBLOCsParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesGBLOCs has not yet been implemented") - }) - } - if api.TransportationOfficeGetTransportationOfficesOpenHandler == nil { - api.TransportationOfficeGetTransportationOfficesOpenHandler = transportation_office.GetTransportationOfficesOpenHandlerFunc(func(params transportation_office.GetTransportationOfficesOpenParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesOpen has not yet been implemented") - }) - } - if api.UploadsGetUploadHandler == nil { - api.UploadsGetUploadHandler = uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") - }) - } - if api.CalendarIsDateWeekendHolidayHandler == nil { - api.CalendarIsDateWeekendHolidayHandler = calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") - }) - } - if api.MtoServiceItemListMTOServiceItemsHandler == nil { - api.MtoServiceItemListMTOServiceItemsHandler = mto_service_item.ListMTOServiceItemsHandlerFunc(func(params mto_service_item.ListMTOServiceItemsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.ListMTOServiceItems has not yet been implemented") - }) - } - if api.MtoShipmentListMTOShipmentsHandler == nil { - api.MtoShipmentListMTOShipmentsHandler = mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") - }) - } - if api.QueuesListPrimeMovesHandler == nil { - api.QueuesListPrimeMovesHandler = queues.ListPrimeMovesHandlerFunc(func(params queues.ListPrimeMovesParams) middleware.Responder { - return middleware.NotImplemented("operation queues.ListPrimeMoves has not yet been implemented") - }) - } - if api.MoveMoveCancelerHandler == nil { - api.MoveMoveCancelerHandler = move.MoveCancelerHandlerFunc(func(params move.MoveCancelerParams) middleware.Responder { - return middleware.NotImplemented("operation move.MoveCanceler has not yet been implemented") - }) - } - if api.ShipmentRejectShipmentHandler == nil { - api.ShipmentRejectShipmentHandler = shipment.RejectShipmentHandlerFunc(func(params shipment.RejectShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RejectShipment has not yet been implemented") - }) - } - if api.LinesOfAccountingRequestLineOfAccountingHandler == nil { - api.LinesOfAccountingRequestLineOfAccountingHandler = lines_of_accounting.RequestLineOfAccountingHandlerFunc(func(params lines_of_accounting.RequestLineOfAccountingParams) middleware.Responder { - return middleware.NotImplemented("operation lines_of_accounting.RequestLineOfAccounting has not yet been implemented") - }) - } - if api.ShipmentRequestShipmentCancellationHandler == nil { - api.ShipmentRequestShipmentCancellationHandler = shipment.RequestShipmentCancellationHandlerFunc(func(params shipment.RequestShipmentCancellationParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentCancellation has not yet been implemented") - }) - } - if api.ShipmentRequestShipmentDiversionHandler == nil { - api.ShipmentRequestShipmentDiversionHandler = shipment.RequestShipmentDiversionHandlerFunc(func(params shipment.RequestShipmentDiversionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentDiversion has not yet been implemented") - }) - } - if api.ShipmentRequestShipmentReweighHandler == nil { - api.ShipmentRequestShipmentReweighHandler = shipment.RequestShipmentReweighHandlerFunc(func(params shipment.RequestShipmentReweighParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentReweigh has not yet been implemented") - }) - } - if api.ShipmentReviewShipmentAddressUpdateHandler == nil { - api.ShipmentReviewShipmentAddressUpdateHandler = shipment.ReviewShipmentAddressUpdateHandlerFunc(func(params shipment.ReviewShipmentAddressUpdateParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ReviewShipmentAddressUpdate has not yet been implemented") - }) - } - if api.EvaluationReportsSaveEvaluationReportHandler == nil { - api.EvaluationReportsSaveEvaluationReportHandler = evaluation_reports.SaveEvaluationReportHandlerFunc(func(params evaluation_reports.SaveEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.SaveEvaluationReport has not yet been implemented") - }) - } - if api.CustomerSearchCustomersHandler == nil { - api.CustomerSearchCustomersHandler = customer.SearchCustomersHandlerFunc(func(params customer.SearchCustomersParams) middleware.Responder { - return middleware.NotImplemented("operation customer.SearchCustomers has not yet been implemented") - }) - } - if api.MoveSearchMovesHandler == nil { - api.MoveSearchMovesHandler = move.SearchMovesHandlerFunc(func(params move.SearchMovesParams) middleware.Responder { - return middleware.NotImplemented("operation move.SearchMoves has not yet been implemented") - }) - } - if api.MoveSetFinancialReviewFlagHandler == nil { - api.MoveSetFinancialReviewFlagHandler = move.SetFinancialReviewFlagHandlerFunc(func(params move.SetFinancialReviewFlagParams) middleware.Responder { - return middleware.NotImplemented("operation move.SetFinancialReviewFlag has not yet been implemented") - }) - } - if api.PpmShowAOAPacketHandler == nil { - api.PpmShowAOAPacketHandler = ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") - }) - } - if api.PpmShowPaymentPacketHandler == nil { - api.PpmShowPaymentPacketHandler = ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") - }) - } - if api.EvaluationReportsSubmitEvaluationReportHandler == nil { - api.EvaluationReportsSubmitEvaluationReportHandler = evaluation_reports.SubmitEvaluationReportHandlerFunc(func(params evaluation_reports.SubmitEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.SubmitEvaluationReport has not yet been implemented") - }) - } - if api.TacTacValidationHandler == nil { - api.TacTacValidationHandler = tac.TacValidationHandlerFunc(func(params tac.TacValidationParams) middleware.Responder { - return middleware.NotImplemented("operation tac.TacValidation has not yet been implemented") - }) - } - if api.OrderUpdateAllowanceHandler == nil { - api.OrderUpdateAllowanceHandler = order.UpdateAllowanceHandlerFunc(func(params order.UpdateAllowanceParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateAllowance has not yet been implemented") - }) - } - if api.MoveUpdateAssignedOfficeUserHandler == nil { - api.MoveUpdateAssignedOfficeUserHandler = move.UpdateAssignedOfficeUserHandlerFunc(func(params move.UpdateAssignedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation move.UpdateAssignedOfficeUser has not yet been implemented") - }) - } - if api.OrderUpdateBillableWeightHandler == nil { - api.OrderUpdateBillableWeightHandler = order.UpdateBillableWeightHandlerFunc(func(params order.UpdateBillableWeightParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateBillableWeight has not yet been implemented") - }) - } - if api.MoveUpdateCloseoutOfficeHandler == nil { - api.MoveUpdateCloseoutOfficeHandler = move.UpdateCloseoutOfficeHandlerFunc(func(params move.UpdateCloseoutOfficeParams) middleware.Responder { - return middleware.NotImplemented("operation move.UpdateCloseoutOffice has not yet been implemented") - }) - } - if api.CustomerUpdateCustomerHandler == nil { - api.CustomerUpdateCustomerHandler = customer.UpdateCustomerHandlerFunc(func(params customer.UpdateCustomerParams) middleware.Responder { - return middleware.NotImplemented("operation customer.UpdateCustomer has not yet been implemented") - }) - } - if api.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler == nil { - api.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler = customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.UpdateCustomerSupportRemarkForMove has not yet been implemented") - }) - } - if api.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler == nil { - api.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler = move_task_order.UpdateMTOReviewedBillableWeightsAtHandlerFunc(func(params move_task_order.UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOReviewedBillableWeightsAt has not yet been implemented") - }) - } - if api.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { - api.MtoServiceItemUpdateMTOServiceItemStatusHandler = mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentHandler == nil { - api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }) - } - if api.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler == nil { - api.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler = move_task_order.UpdateMTOStatusServiceCounselingCompletedHandlerFunc(func(params move_task_order.UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOStatusServiceCounselingCompleted has not yet been implemented") - }) - } - if api.OrderUpdateMaxBillableWeightAsTIOHandler == nil { - api.OrderUpdateMaxBillableWeightAsTIOHandler = order.UpdateMaxBillableWeightAsTIOHandlerFunc(func(params order.UpdateMaxBillableWeightAsTIOParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateMaxBillableWeightAsTIO has not yet been implemented") - }) - } - if api.MoveTaskOrderUpdateMoveTIORemarksHandler == nil { - api.MoveTaskOrderUpdateMoveTIORemarksHandler = move_task_order.UpdateMoveTIORemarksHandlerFunc(func(params move_task_order.UpdateMoveTIORemarksParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMoveTIORemarks has not yet been implemented") - }) - } - if api.MoveTaskOrderUpdateMoveTaskOrderStatusHandler == nil { - api.MoveTaskOrderUpdateMoveTaskOrderStatusHandler = move_task_order.UpdateMoveTaskOrderStatusHandlerFunc(func(params move_task_order.UpdateMoveTaskOrderStatusParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMoveTaskOrderStatus has not yet been implemented") - }) - } - if api.PpmUpdateMovingExpenseHandler == nil { - api.PpmUpdateMovingExpenseHandler = ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") - }) - } - if api.OrderUpdateOrderHandler == nil { - api.OrderUpdateOrderHandler = order.UpdateOrderHandlerFunc(func(params order.UpdateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateOrder has not yet been implemented") - }) - } - if api.PpmUpdatePPMSITHandler == nil { - api.PpmUpdatePPMSITHandler = ppm.UpdatePPMSITHandlerFunc(func(params ppm.UpdatePPMSITParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdatePPMSIT has not yet been implemented") - }) - } - if api.PaymentRequestsUpdatePaymentRequestStatusHandler == nil { - api.PaymentRequestsUpdatePaymentRequestStatusHandler = payment_requests.UpdatePaymentRequestStatusHandlerFunc(func(params payment_requests.UpdatePaymentRequestStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.UpdatePaymentRequestStatus has not yet been implemented") - }) - } - if api.PaymentServiceItemUpdatePaymentServiceItemStatusHandler == nil { - api.PaymentServiceItemUpdatePaymentServiceItemStatusHandler = payment_service_item.UpdatePaymentServiceItemStatusHandlerFunc(func(params payment_service_item.UpdatePaymentServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_service_item.UpdatePaymentServiceItemStatus has not yet been implemented") - }) - } - if api.PpmUpdateProGearWeightTicketHandler == nil { - api.PpmUpdateProGearWeightTicketHandler = ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") - }) - } - if api.ShipmentUpdateSITServiceItemCustomerExpenseHandler == nil { - api.ShipmentUpdateSITServiceItemCustomerExpenseHandler = shipment.UpdateSITServiceItemCustomerExpenseHandlerFunc(func(params shipment.UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.UpdateSITServiceItemCustomerExpense has not yet been implemented") - }) - } - if api.MtoServiceItemUpdateServiceItemSitEntryDateHandler == nil { - api.MtoServiceItemUpdateServiceItemSitEntryDateHandler = mto_service_item.UpdateServiceItemSitEntryDateHandlerFunc(func(params mto_service_item.UpdateServiceItemSitEntryDateParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateServiceItemSitEntryDate has not yet been implemented") - }) - } - if api.UploadsUpdateUploadHandler == nil { - api.UploadsUpdateUploadHandler = uploads.UpdateUploadHandlerFunc(func(params uploads.UpdateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.UpdateUpload has not yet been implemented") - }) - } - if api.PpmUpdateWeightTicketHandler == nil { - api.PpmUpdateWeightTicketHandler = ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") - }) - } - if api.MoveUploadAdditionalDocumentsHandler == nil { - api.MoveUploadAdditionalDocumentsHandler = move.UploadAdditionalDocumentsHandlerFunc(func(params move.UploadAdditionalDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation move.UploadAdditionalDocuments has not yet been implemented") - }) - } - if api.OrderUploadAmendedOrdersHandler == nil { - api.OrderUploadAmendedOrdersHandler = order.UploadAmendedOrdersHandlerFunc(func(params order.UploadAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation order.UploadAmendedOrders has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/ghcapi/doc.go b/pkg/gen/ghcapi/doc.go deleted file mode 100644 index 24f788c8fb2..00000000000 --- a/pkg/gen/ghcapi/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package ghcapi MilMove GHC API -// -// The GHC API is a RESTful API that enables the Office application for MilMove. -// -// All endpoints are located under `/ghc/v1`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /ghc/v1 -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// - multipart/form-data -// -// Produces: -// - application/pdf -// - application/json -// -// swagger:meta -package ghcapi diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go deleted file mode 100644 index 14b3a43903c..00000000000 --- a/pkg/gen/ghcapi/embedded_spec.go +++ /dev/null @@ -1,32291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcapi - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The GHC API is a RESTful API that enables the Office application for MilMove.\n\nAll endpoints are located under ` + "`" + `/ghc/v1` + "`" + `.\n", - "title": "MilMove GHC API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/ghc/v1", - "paths": { - "/addresses/zip-city-lookup/{search}": { - "get": { - "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string", - "operationId": "getLocationByZipCityState", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested list of city, state, county, and postal code matches", - "schema": { - "$ref": "#/definitions/VLocations" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/application_parameters/{parameterName}": { - "get": { - "description": "Searches for an application parameter by name, returns nil if not found", - "tags": [ - "application_parameters" - ], - "summary": "Searches for an application parameter by name, returns nil if not found", - "operationId": "getParam", - "parameters": [ - { - "type": "string", - "format": "string", - "description": "Parameter Name", - "name": "parameterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Application Parameters", - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - }, - "/calendar/{countryCode}/is-weekend-holiday/{date}": { - "get": { - "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", - "produces": [ - "application/json" - ], - "tags": [ - "calendar" - ], - "summary": "Validate move date selection", - "operationId": "isDateWeekendHoliday", - "parameters": [ - { - "enum": [ - "US" - ], - "type": "string", - "description": "country code for context of date", - "name": "countryCode", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date", - "description": "input date to determine if weekend/holiday for given country.", - "name": "date", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully determine if given date is weekend and/or holiday for given country.", - "schema": { - "$ref": "#/definitions/IsDateWeekendHolidayInfo" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/counseling/orders/{orderID}": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an order (performed by a services counselor)", - "operationId": "counselingUpdateOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CounselingUpdateOrderPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to update", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/counseling/orders/{orderID}/allowances": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an allowance (Orders with Entitlements)", - "operationId": "counselingUpdateAllowance", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CounselingUpdateAllowancePayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of allowance", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/customer": { - "post": { - "description": "Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Creates a customer with Okta option", - "operationId": "createCustomerWithOktaOption", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCustomerPayload" - } - } - ], - "responses": { - "200": { - "description": "successfully created the customer", - "schema": { - "$ref": "#/definitions/CreatedCustomer" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/customer-support-remarks/{customerSupportRemarkID}": { - "delete": { - "description": "Soft deletes a customer support remark by ID", - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Soft deletes a customer support remark by ID", - "operationId": "deleteCustomerSupportRemark", - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Updates a customer support remark for a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Updates a customer support remark for a move", - "operationId": "updateCustomerSupportRemarkForMove", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCustomerSupportRemarkPayload" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated customer support remark", - "schema": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the customer support remark ID to be modified", - "name": "customerSupportRemarkID", - "in": "path", - "required": true - } - ] - }, - "/customer/search": { - "post": { - "description": "Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Search customers by DOD ID or customer name", - "operationId": "searchCustomers", - "parameters": [ - { - "description": "field that results should be sorted by", - "name": "body", - "in": "body", - "schema": { - "properties": { - "branch": { - "description": "Branch", - "type": "string", - "minLength": 1 - }, - "customerName": { - "description": "Customer Name", - "type": "string", - "minLength": 1, - "x-nullable": true - }, - "edipi": { - "description": "DOD ID", - "type": "string", - "maxLength": 10, - "minLength": 10, - "x-nullable": true - }, - "emplid": { - "description": "EMPLID", - "type": "string", - "maxLength": 7, - "minLength": 7, - "x-nullable": true - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "x-nullable": true - }, - "page": { - "description": "requested page of results", - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "sort": { - "type": "string", - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "personalEmail", - "telephone" - ], - "x-nullable": true - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully returned all customers matching the criteria", - "schema": { - "$ref": "#/definitions/SearchCustomersResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/customer/{customerID}": { - "get": { - "description": "Returns a given customer", - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Returns a given customer", - "operationId": "getCustomer", - "responses": { - "200": { - "description": "Successfully retrieved information on an individual customer", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Updates customer info by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Updates customer info", - "operationId": "updateCustomer", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCustomerPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.customer" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of customer to use", - "name": "customerID", - "in": "path", - "required": true - } - ] - }, - "/documents": { - "post": { - "description": "Documents represent a physical artifact such as a scanned document or a PDF file", - "tags": [ - "ghcDocuments" - ], - "summary": "Create a new document", - "operationId": "createDocument", - "parameters": [ - { - "name": "documentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDocumentPayload" - } - } - ], - "responses": { - "201": { - "description": "created document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "description": "server error" - } - } - } - }, - "/documents/{documentId}": { - "get": { - "description": "Returns a document and its uploads", - "tags": [ - "ghcDocuments" - ], - "summary": "Returns a document", - "operationId": "getDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to return", - "name": "documentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/evaluation-reports/{reportID}": { - "get": { - "description": "Gets an evaluation report by ID", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Gets an evaluation report by ID", - "operationId": "getEvaluationReport", - "responses": { - "200": { - "description": "Successfully got the report", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "put": { - "description": "Saves an evaluation report as a draft", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Saves an evaluation report as a draft", - "operationId": "saveEvaluationReport", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully saved the report" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "delete": { - "description": "Deletes an evaluation report by ID", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Deletes an evaluation report by ID", - "operationId": "deleteEvaluationReport", - "responses": { - "204": { - "description": "Successfully deleted the report" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "delete.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be modified", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/appeal/add": { - "post": { - "description": "Adds an appeal to a serious incident on an evaluation report", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Adds an appeal to a serious incident on an evaluation report", - "operationId": "addAppealToSeriousIncident", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateAppeal" - } - } - ], - "responses": { - "204": { - "description": "Successfully added an appeal to a serious incident" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/download": { - "get": { - "description": "Downloads an evaluation report as a PDF", - "produces": [ - "application/pdf" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Downloads an evaluation report as a PDF", - "operationId": "downloadEvaluationReport", - "responses": { - "200": { - "description": "Evaluation report PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be downloaded", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/submit": { - "post": { - "description": "Submits an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Submits an evaluation report", - "operationId": "submitEvaluationReport", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully submitted an evaluation report with the provided ID" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be modified", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": { - "post": { - "description": "Adds an appeal to a violation", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Adds an appeal to a violation", - "operationId": "addAppealToViolation", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateAppeal" - } - } - ], - "responses": { - "204": { - "description": "Successfully added an appeal to a violation" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID", - "name": "reportID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "the report violation ID", - "name": "reportViolationID", - "in": "path", - "required": true - } - ] - }, - "/lines-of-accounting": { - "post": { - "description": "Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "linesOfAccounting" - ], - "summary": "Fetch line of accounting", - "operationId": "requestLineOfAccounting", - "parameters": [ - { - "description": "Service member affiliation, effective date, and TAC code.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/FetchLineOfAccountingPayload" - } - } - ], - "responses": { - "200": { - "description": "Successfully retrieved line of accounting", - "schema": { - "$ref": "#/definitions/LineOfAccounting" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}": { - "get": { - "description": "Gets a move", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Gets a move by ID", - "operationId": "getMoveTaskOrder", - "responses": { - "200": { - "description": "Successfully retrieved move task order", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": { - "patch": { - "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "operationId": "updateMTOReviewedBillableWeightsAt", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order billableWeightsReviewedAt field", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/entitlements": { - "get": { - "description": "Gets entitlements", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Gets entitlements for a move by ID", - "operationId": "getEntitlements", - "responses": { - "200": { - "description": "Successfully retrieved entitlements", - "schema": { - "$ref": "#/definitions/Entitlements" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status": { - "patch": { - "description": "Changes the status of a line item for a move by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentServiceItem" - ], - "summary": "Change the status of a payment service item for a move by ID", - "operationId": "updatePaymentServiceItemStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated status for a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.paymentServiceItemStatus" - ] - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of payment service item to use", - "name": "paymentServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": { - "get": { - "description": "Gets a line item by ID for a move by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Gets a line item by ID for a move by ID", - "operationId": "getMTOServiceItem", - "responses": { - "200": { - "description": "Successfully retrieved a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/MTOServiceItemSingle" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of line item to use", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": { - "patch": { - "description": "Changes the status of a line item for a move by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Change the status of a line item for a move by ID", - "operationId": "updateMTOServiceItemStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchMTOServiceItemStatusPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated status for a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.MTOServiceItem" - ] - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of line item to use", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/status": { - "patch": { - "description": "Changes move task order status to make it available to prime", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Change the status of a move task order to make it available to prime", - "operationId": "updateMoveTaskOrderStatus", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "serviceItemCodes", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOApprovalServiceItemCodes" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order status", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.move", - "create.serviceItem" - ] - } - }, - "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": { - "patch": { - "description": "Changes move (move task order) status to service counseling completed", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Changes move (move task order) status to service counseling completed", - "operationId": "updateMTOStatusServiceCounselingCompleted", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order status", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/tio-remarks": { - "patch": { - "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "operationId": "updateMoveTIORemarks", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Move" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order tioRemarks field", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move/{locator}": { - "get": { - "description": "Returns a given move for a unique alphanumeric locator string", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns a given move", - "operationId": "getMove", - "responses": { - "200": { - "description": "Successfully retrieved the individual move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "Code used to identify a move in the system", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/move/{locator}/history": { - "get": { - "description": "Returns the history for a given move for a unique alphanumeric locator string", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns the history of an identified move", - "operationId": "getMoveHistory", - "parameters": [ - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the individual move history", - "schema": { - "$ref": "#/definitions/MoveHistoryResult" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "Code used to identify a move in the system", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_service_items": { - "get": { - "description": "Gets all line items for a move", - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Gets all line items for a move", - "operationId": "listMTOServiceItems", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/MTOServiceItems" - } - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move for mto service item to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments": { - "get": { - "description": "Gets all shipments for a move task order", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Gets all shipments for a move task order", - "operationId": "listMTOShipments", - "responses": { - "200": { - "description": "Successfully retrieved all mto shipments for a move task order", - "schema": { - "$ref": "#/definitions/MTOShipments" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": { - "patch": { - "description": "Updates a specified MTO shipment.\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* No fields required in body\nOptional fields include:\n* New shipment status type\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Secondary Pick-up Address\n* SecondaryDelivery Address\n* Delivery Address Type\n* Customer Remarks\n* Counselor Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the MTO Shipment to update", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the specified MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": { - "get": { - "description": "Fetches a list of agents associated with a move task order.", - "produces": [ - "application/json" - ], - "tags": [ - "mtoAgent" - ], - "summary": "Fetch move task order agents.", - "operationId": "fetchMTOAgentList", - "responses": { - "200": { - "description": "Successfully retrieved all agents for a move task order", - "schema": { - "$ref": "#/definitions/MTOAgents" - } - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/moves/search": { - "post": { - "description": "Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Search moves by locator, DOD ID, or customer name", - "operationId": "searchMoves", - "parameters": [ - { - "description": "field that results should be sorted by", - "name": "body", - "in": "body", - "schema": { - "properties": { - "branch": { - "type": "string", - "x-nullable": true - }, - "customerName": { - "description": "Customer Name", - "type": "string", - "minLength": 1, - "x-nullable": true - }, - "deliveryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "destinationPostalCode": { - "type": "string", - "x-nullable": true - }, - "edipi": { - "description": "DOD ID", - "type": "string", - "maxLength": 10, - "minLength": 10, - "x-nullable": true - }, - "emplid": { - "description": "EMPLID", - "type": "string", - "maxLength": 7, - "minLength": 7, - "x-nullable": true - }, - "locator": { - "description": "Move locator", - "type": "string", - "maxLength": 6, - "minLength": 6, - "x-nullable": true - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "x-nullable": true - }, - "originPostalCode": { - "type": "string", - "x-nullable": true - }, - "page": { - "description": "requested page of results", - "type": "integer" - }, - "paymentRequestCode": { - "type": "string", - "x-nullable": true, - "example": "9551-6199-2" - }, - "perPage": { - "type": "integer" - }, - "pickupDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer", - "x-nullable": true - }, - "sort": { - "type": "string", - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "originPostalCode", - "destinationPostalCode", - "shipmentsCount" - ], - "x-nullable": true - }, - "status": { - "description": "Filtering for the status.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVALS REQUESTED", - "APPROVED", - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED", - "CANCELED" - ] - } - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/SearchMovesResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/moves/{locator}/closeout-office": { - "patch": { - "description": "Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Updates a Move's PPM closeout office for Army and Air Force customers", - "operationId": "updateCloseoutOffice", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "closeoutOfficeId" - ], - "properties": { - "closeoutOfficeId": { - "type": "string", - "format": "uuid" - } - } - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully set the closeout office for the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.closeoutOffice" - ] - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/customer-support-remarks": { - "get": { - "description": "Fetches customer support remarks for a move", - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Fetches customer support remarks using the move code (locator).", - "operationId": "getCustomerSupportRemarksForMove", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/CustomerSupportRemarks" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "post": { - "description": "Creates a customer support remark for a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Creates a customer support remark for a move", - "operationId": "createCustomerSupportRemarkForMove", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateCustomerSupportRemark" - } - } - ], - "responses": { - "200": { - "description": "Successfully created customer support remark", - "schema": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move for customer support remarks", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/evaluation-reports": { - "post": { - "description": "Creates an evaluation report", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Creates an evaluation report", - "operationId": "createEvaluationReport", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateEvaluationReport" - } - } - ], - "responses": { - "200": { - "description": "Successfully created evaluation report", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/payment-requests": { - "get": { - "description": "Fetches payment requests for a move", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Fetches payment requests using the move code (locator).", - "operationId": "getPaymentRequestsForMove", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "read.paymentRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move for payment requests", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/assignOfficeUser": { - "patch": { - "description": "assigns either a services counselor, task ordering officer, or task invoicing officer to the move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "updateAssignedOfficeUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AssignOfficeUserBody" - } - } - ], - "responses": { - "200": { - "description": "Successfully assigned office user to the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/cancel": { - "post": { - "description": "cancels a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Cancels a move", - "operationId": "moveCanceler", - "responses": { - "200": { - "description": "Successfully canceled move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.cancelMoveFlag" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/counseling-evaluation-reports-list": { - "get": { - "description": "Returns counseling evaluation reports for the specified move that are visible to the current office user", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns counseling evaluation reports for the specified move that are visible to the current office user", - "operationId": "getMoveCounselingEvaluationReportsList", - "responses": { - "200": { - "description": "Successfully retrieved the move's evaluation reports", - "schema": { - "$ref": "#/definitions/EvaluationReportList" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Code used to identify a move in the system", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/financial-review-flag": { - "post": { - "description": "This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Flags a move for financial office review", - "operationId": "setFinancialReviewFlag", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header" - }, - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "flagForReview" - ], - "properties": { - "flagForReview": { - "description": "boolean value representing whether we should flag a move for financial review", - "type": "boolean", - "example": false - }, - "remarks": { - "description": "explanation of why the move is being flagged for financial review", - "type": "string", - "x-nullable": true, - "example": "this address is way too far away" - } - } - } - } - ], - "responses": { - "200": { - "description": "updated Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.financialReviewFlag" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move to flag", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/shipment-evaluation-reports-list": { - "get": { - "description": "Returns shipment evaluation reports for the specified move that are visible to the current office user", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns shipment evaluation reports for the specified move that are visible to the current office user", - "operationId": "getMoveShipmentEvaluationReportsList", - "responses": { - "200": { - "description": "Successfully retrieved the move's evaluation reports", - "schema": { - "$ref": "#/definitions/EvaluationReportList" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Code used to identify a move in the system", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/unassignOfficeUser": { - "patch": { - "description": "unassigns either a services counselor, task ordering officer, or task invoicing officer from the move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "deleteAssignedOfficeUser", - "responses": { - "200": { - "description": "Successfully unassigned office user from the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "roleType" - ], - "properties": { - "roleType": { - "type": "string" - } - } - } - } - ] - }, - "/moves/{moveID}/uploadAdditionalDocuments": { - "patch": { - "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "move" - ], - "summary": "Patch the additional documents for a given move", - "operationId": "uploadAdditionalDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "moveID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - }, - "x-permissions": [ - "create.supportingDocuments" - ] - } - }, - "/moves/{officeUserID}/CheckForLockedMovesAndUnlock": { - "patch": { - "description": "Finds and unlocks any locked moves by an office user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "checkForLockedMovesAndUnlock", - "responses": { - "200": { - "description": "Successfully unlocked officer's move(s).", - "schema": { - "type": "object", - "properties": { - "successMessage": { - "type": "string", - "example": "OK" - } - } - } - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move's officer", - "name": "officeUserID", - "in": "path", - "required": true - } - ] - }, - "/mto-shipments": { - "post": { - "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Releasing / Receiving agents\nOptional fields include:\n* Delivery Address Type\n* Customer Remarks\n* Releasing / Receiving agents\n* An array of optional accessorial service item codes\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/open/requested-office-users": { - "post": { - "description": "This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account.\nRequest the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an \"OR\" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "officeUsers" - ], - "summary": "Create an Office User", - "operationId": "createRequestedOfficeUser", - "parameters": [ - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "schema": { - "$ref": "#/definitions/OfficeUserCreate" - } - } - ], - "responses": { - "201": { - "description": "successfully requested the creation of provided office user", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/open/transportation-offices": { - "get": { - "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns the transportation offices matching the search query", - "operationId": "getTransportationOfficesOpen", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/orders": { - "post": { - "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Creates an orders model for a logged-in user", - "operationId": "createOrder", - "parameters": [ - { - "name": "createOrders", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateOrders" - } - } - ], - "responses": { - "200": { - "description": "created instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{orderID}": { - "get": { - "description": "Gets an order", - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Gets an order by ID", - "operationId": "getOrder", - "responses": { - "200": { - "description": "Successfully retrieved order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an order", - "operationId": "updateOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrderPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.orders" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/acknowledge-excess-weight-risk": { - "post": { - "description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", - "operationId": "acknowledgeExcessWeightRisk", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.excessWeightRisk" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/allowances": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an allowance (Orders with Entitlements)", - "operationId": "updateAllowance", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAllowancePayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of allowance", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.allowances" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/update-billable-weight": { - "patch": { - "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements=", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates the max billable weight", - "operationId": "updateBillableWeight", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateBillableWeightPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated Order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.billableWeight" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/update-max-billable-weight/tio": { - "patch": { - "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates the max billable weight with TIO remarks", - "operationId": "updateMaxBillableWeightAsTIO", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMaxBillableWeightAsTIOPayload" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "updated Order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.maxBillableWeight" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/upload_amended_orders": { - "post": { - "description": "Create an amended order for a given order", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "order" - ], - "summary": "Create an amended order for a given order", - "operationId": "uploadAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "orderID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-requests/{paymentRequestID}": { - "get": { - "description": "Fetches an instance of a payment request by id", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Fetches a payment request by id", - "operationId": "getPaymentRequest", - "responses": { - "200": { - "description": "fetched instance of payment request", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "read.paymentRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/bulkDownload": { - "get": { - "description": "This endpoint downloads all uploaded payment request documentation combined into a single PDF.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Downloads all Payment Request documents as a PDF", - "operationId": "bulkDownload", - "responses": { - "200": { - "description": "Payment Request Files PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the payment-request with files to be downloaded", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": { - "get": { - "description": "Returns all shipment payment request SIT usage to support partial SIT invoicing", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Returns all shipment payment request SIT usage to support partial SIT invoicing", - "operationId": "getShipmentsPaymentSITBalance", - "responses": { - "200": { - "description": "Successfully retrieved shipments and their SIT days balance from all payment requests on the move", - "schema": { - "$ref": "#/definitions/ShipmentsPaymentSITBalance" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "read.shipmentsPaymentSITBalance" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "payment request ID of the payment request with SIT service items being reviewed", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/status": { - "patch": { - "description": "Updates status of a payment request by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Updates status of a payment request by id", - "operationId": "updatePaymentRequestStatus", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request", - "name": "paymentRequestID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePaymentRequestStatusPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated payment request", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.paymentRequest" - ] - } - }, - "/ppm-shipments/{ppmShipmentId}/actual-weight": { - "get": { - "description": "Retrieves the actual weight for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the actual weight for a PPM shipment", - "operationId": "getPPMActualWeight", - "responses": { - "200": { - "description": "Returns actual weight for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMActualWeight" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/aoa-packet": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Downloads AOA Packet form PPMShipment as a PDF", - "operationId": "showAOAPacket", - "responses": { - "200": { - "description": "AOA PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the ppmshipment with aoa to be downloaded", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/closeout": { - "get": { - "description": "Retrieves the closeout calculations for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the closeout calcuations for the specified PPM shipment", - "operationId": "getPPMCloseout", - "responses": { - "200": { - "description": "Returns closeout for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMCloseout" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/finish-document-review": { - "patch": { - "description": "Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a PPM shipment's status after document review", - "operationId": "finishDocumentReview", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully finished document review", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { - "patch": { - "description": "Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are\neditable because some have to be set by the customer, e.g. the description and the moving expense type.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates the moving expense", - "operationId": "updateMovingExpense", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "updateMovingExpense", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMovingExpense" - } - } - ], - "responses": { - "200": { - "description": "returns an updated moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/movingExpenseId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/payment-packet": { - "get": { - "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Returns PPM payment packet", - "operationId": "showPaymentPacket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppmShipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "PPM Payment Packet PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/ppm-sit": { - "patch": { - "description": "Updates a PPM shipment's SIT values\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a PPM shipment's SIT values", - "operationId": "updatePPMSIT", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/PPMShipmentSIT" - } - } - ], - "responses": { - "200": { - "description": "Successfully finished PPM SIT update", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { - "patch": { - "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a pro-gear weight ticket", - "operationId": "updateProGearWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "updateProGearWeightTicket", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateProGearWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/proGearWeightTicketId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost": { - "get": { - "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the SIT estimated cost for a PPM shipment", - "operationId": "getPPMSITEstimatedCost", - "responses": { - "200": { - "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMSITEstimatedCost" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "enum": [ - "ORIGIN", - "DESTINATION" - ], - "type": "string", - "format": "string", - "description": "location of sit", - "name": "sitLocation", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Date entered into SIT", - "name": "sitEntryDate", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Date departed SIT", - "name": "sitDepartureDate", - "in": "query", - "required": true - }, - { - "type": "integer", - "description": "Weight stored in SIT", - "name": "weightStored", - "in": "query", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { - "patch": { - "description": "Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's\nfields are editable because some have to be set by the customer, e.g. vehicle description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a weight ticket document", - "operationId": "updateWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "updateWeightTicketPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/weightTicketId" - } - ] - }, - "/pws-violations": { - "get": { - "description": "Fetch the possible PWS violations for an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "pwsViolations" - ], - "summary": "Fetch the possible PWS violations for an evaluation report", - "operationId": "getPWSViolations", - "responses": { - "200": { - "description": "Successfully retrieved the PWS violations", - "schema": { - "$ref": "#/definitions/PWSViolations" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/bulk-assignment": { - "get": { - "description": "Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets data for bulk assignment modal", - "operationId": "getBulkAssignmentData", - "parameters": [ - { - "enum": [ - "COUNSELING", - "CLOSEOUT", - "TASK_ORDER", - "PAYMENT_REQUEST" - ], - "type": "string", - "description": "A string corresponding to the queue type", - "name": "queueType", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned bulk assignment data", - "schema": { - "$ref": "#/definitions/BulkAssignmentData" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/counseling": { - "get": { - "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all customer moves needing services counseling by GBLOC origin", - "operationId": "getServicesCounselingQueue", - "parameters": [ - { - "type": "integer", - "description": "requested page number of paginated move results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "maximum number of moves to show on each page of paginated results", - "name": "perPage", - "in": "query" - }, - { - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "requestedMoveDate", - "submittedAt", - "originGBLOC", - "originDutyLocation", - "destinationDutyLocation", - "ppmType", - "closeoutInitiated", - "closeoutLocation", - "ppmStatus", - "counselingOffice", - "assignedTo" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "string", - "description": "filters by the branch of the move's service member", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique move code locator", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "description": "filters using a prefix match on the service member's last name", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique service member's DoD ID", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique service member's EMPLID", - "name": "emplid", - "in": "query" - }, - { - "type": "string", - "description": "filters the requested pickup date of a shipment on the move", - "name": "requestedMoveDate", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Start of the submitted at date in the user's local time zone converted to UTC", - "name": "submittedAt", - "in": "query" - }, - { - "type": "string", - "description": "filters the GBLOC of the service member's origin duty location", - "name": "originGBLOC", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "filters the name of the origin duty location on the orders", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "description": "filters the name of the destination duty location on the orders", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED" - ], - "type": "string" - }, - "description": "filters the status of the move", - "name": "status", - "in": "query" - }, - { - "type": "boolean", - "description": "Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves.", - "name": "needsPPMCloseout", - "in": "query" - }, - { - "enum": [ - "FULL", - "PARTIAL" - ], - "type": "string", - "description": "filters PPM type", - "name": "ppmType", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Latest date that closeout was initiated on a PPM on the move", - "name": "closeoutInitiated", - "in": "query" - }, - { - "type": "string", - "description": "closeout location", - "name": "closeoutLocation", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "enum": [ - "WAITING_ON_CUSTOMER", - "NEEDS_CLOSEOUT" - ], - "type": "string", - "description": "filters the status of the PPM shipment", - "name": "ppmStatus", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this payment request.\n", - "name": "assignedTo", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueueMovesResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/counseling/origin-list": { - "get": { - "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all moves origin locations in the counselors queue", - "operationId": "getServicesCounselingOriginList", - "parameters": [ - { - "type": "boolean", - "description": "Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations.", - "name": "needsPPMCloseout", - "in": "query" - }, - { - "type": "string", - "description": "Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.", - "name": "viewAsGBLOC", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/Locations" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/moves": { - "get": { - "description": "An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all customer moves by GBLOC origin", - "operationId": "getMovesQueue", - "parameters": [ - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - }, - { - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "originDutyLocation", - "destinationDutyLocation", - "requestedMoveDate", - "appearedInTooAt", - "assignedTo", - "counselingOffice" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "string", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "name": "emplid", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "name": "appearedInTooAt", - "in": "query" - }, - { - "type": "string", - "description": "filters the requested pickup date of a shipment on the move", - "name": "requestedMoveDate", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "SUBMITTED", - "SERVICE COUNSELING COMPLETED", - "APPROVALS REQUESTED" - ], - "type": "string" - }, - "description": "Filtering for the status.", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this move.\n", - "name": "assignedTo", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueueMovesResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/payment-requests": { - "get": { - "description": "An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all payment requests by GBLOC origin", - "operationId": "getPaymentRequestsQueue", - "parameters": [ - { - "enum": [ - "customerName", - "locator", - "submittedAt", - "branch", - "status", - "edipi", - "emplid", - "age", - "originDutyLocation", - "assignedTo", - "counselingOffice" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "number of records to include per page", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Start of the submitted at date in the user's local time zone converted to UTC", - "name": "submittedAt", - "in": "query" - }, - { - "type": "string", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "name": "emplid", - "in": "query" - }, - { - "type": "string", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "type": "string", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this payment request.\n", - "name": "assignedTo", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "PAID", - "DEPRECATED", - "EDI_ERROR" - ], - "type": "string" - }, - "description": "Filtering for the status.", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueuePaymentRequestsResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/prime-moves": { - "get": { - "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "getPrimeMovesQueue", - "operationId": "listPrimeMoves", - "parameters": [ - { - "type": "string", - "format": "date-time", - "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", - "name": "since", - "in": "query" - }, - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "moveCode", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/ListPrimeMovesResult" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/re-service-items": { - "get": { - "description": "Get ReServiceItems", - "produces": [ - "application/json" - ], - "tags": [ - "reServiceItems" - ], - "summary": "Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved)", - "operationId": "getAllReServiceItems", - "responses": { - "200": { - "description": "Successfully retrieved all ReServiceItems.", - "schema": { - "$ref": "#/definitions/ReServiceItems" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/report-violations/{reportID}": { - "get": { - "description": "Fetch the report violations for an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "reportViolations" - ], - "summary": "Fetch the report violations for an evaluation report", - "operationId": "getReportViolationsByReportID", - "responses": { - "200": { - "description": "Successfully retrieved the report violations", - "schema": { - "$ref": "#/definitions/ReportViolations" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "post": { - "description": "Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "reportViolations" - ], - "summary": "Associate violations with an evaluation report", - "operationId": "associateReportViolations", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/AssociateReportViolations" - } - } - ], - "responses": { - "204": { - "description": "Successfully saved the report violations" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.reportViolation" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID that has associated violations", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/service-item/{mtoServiceItemID}/entry-date-update": { - "patch": { - "description": "Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Updates a service item's SIT entry date by ID", - "operationId": "updateServiceItemSitEntryDate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ServiceItemSitEntryDate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated SIT entry date", - "schema": { - "$ref": "#/definitions/MTOServiceItemSingle" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of the service item", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}": { - "get": { - "description": "fetches a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "fetches a shipment by ID", - "operationId": "getShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be fetched", - "name": "shipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully fetched the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "delete": { - "description": "Soft deletes a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Soft deletes a shipment by ID", - "operationId": "deleteShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be deleted", - "name": "shipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/shipments/{shipmentID}/approve": { - "post": { - "description": "Approves a shipment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Approves a shipment", - "operationId": "approveShipment", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/approve-diversion": { - "post": { - "description": "Approves a shipment diversion", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Approves a shipment diversion", - "operationId": "approveShipmentDiversion", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved the shipment diversion", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/ppm-documents": { - "get": { - "description": "Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This\nexcludes any deleted PPM documents.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Gets all the PPM documents for a PPM shipment", - "operationId": "getPPMDocuments", - "responses": { - "200": { - "description": "All PPM documents and associated uploads for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMDocuments" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/reject": { - "post": { - "description": "rejects a shipment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "rejects a shipment", - "operationId": "rejectShipment", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RejectShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully rejected the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-cancellation": { - "post": { - "description": "Requests a shipment cancellation", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Requests a shipment cancellation", - "operationId": "requestShipmentCancellation", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully requested the shipment cancellation", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.shipmentCancellation" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-diversion": { - "post": { - "description": "Requests a shipment diversion", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Requests a shipment diversion", - "operationId": "requestShipmentDiversion", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RequestDiversion" - } - } - ], - "responses": { - "200": { - "description": "Successfully requested the shipment diversion", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.shipmentDiversionRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-reweigh": { - "post": { - "description": "Requests a shipment reweigh", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "reweigh" - ], - "summary": "Requests a shipment reweigh", - "operationId": "requestShipmentReweigh", - "responses": { - "200": { - "description": "Successfully requested a reweigh of the shipment", - "schema": { - "$ref": "#/definitions/Reweigh" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.reweighRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/review-shipment-address-update": { - "patch": { - "description": "This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Allows TOO to review a shipment address update", - "operationId": "reviewShipmentAddressUpdate", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "required": [ - "officeRemarks", - "status" - ], - "properties": { - "officeRemarks": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "REJECTED", - "APPROVED" - ] - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully requested a shipment address update", - "schema": { - "$ref": "#/definitions/ShipmentAddressUpdate" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-extensions": { - "post": { - "description": "TOO can creates an already-approved SIT Duration Update on behalf of a customer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Create an approved SIT Duration Update", - "operationId": "createApprovedSITDurationUpdate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateApprovedSITDurationUpdate" - } - }, - { - "type": "string", - "description": "We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully created a SIT Extension.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "create.SITExtension" - ] - } - }, - "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": { - "patch": { - "description": "Approves a SIT extension", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Approves a SIT extension", - "operationId": "approveSITExtension", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApproveSITExtension" - } - }, - { - "type": "string", - "description": "We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved a SIT extension", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.SITExtension" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the SIT extension", - "name": "sitExtensionID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": { - "patch": { - "description": "Denies a SIT extension", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Denies a SIT extension", - "operationId": "denySITExtension", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DenySITExtension" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully denied a SIT extension", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.SITExtension" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the SIT extension", - "name": "sitExtensionID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": { - "patch": { - "description": "Converts a SIT to customer expense", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "mtoServiceItem" - ], - "summary": "Converts a SIT to customer expense", - "operationId": "updateSITServiceItemCustomerExpense", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateSITServiceItemCustomerExpense" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully converted to customer expense", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - }, - "x-permissions": [ - "update.MTOServiceItem" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/tac/valid": { - "get": { - "description": "Returns a boolean based on whether a tac value is valid or not", - "tags": [ - "tac", - "order" - ], - "summary": "Validation of a TAC value", - "operationId": "tacValidation", - "parameters": [ - { - "type": "string", - "description": "The tac value to validate", - "name": "tac", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved validation status", - "schema": { - "$ref": "#/definitions/TacValid" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/transportation-offices": { - "get": { - "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", - "operationId": "getTransportationOffices", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/transportation-offices/gblocs": { - "get": { - "description": "Returns a list of distinct GBLOCs that exist in the transportation offices table", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns a list of distinct GBLOCs that exist in the transportation offices table", - "operationId": "getTransportationOfficesGBLOCs", - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/GBLOCs" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Create a new upload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query" - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/get/": { - "get": { - "description": "Gets an upload", - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Gets an upload by ID", - "operationId": "getUpload", - "responses": { - "200": { - "description": "Successfully retrieved upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/uploads/{uploadID}": { - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes an upload", - "operationId": "deleteUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be deleted", - "name": "uploadID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the order that the upload belongs to", - "name": "orderID", - "in": "query" - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadID}/update": { - "patch": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Update an existing upload. This is only needed currently for updating the image rotation.", - "operationId": "updateUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be updated", - "name": "uploadID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "properties": { - "rotation": { - "description": "The rotation of the image", - "type": "integer", - "maximum": 3 - } - } - } - } - ], - "responses": { - "201": { - "description": "updated upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Affiliation": { - "description": "Military branch of service", - "type": "string", - "title": "Branch of service", - "enum": [ - "ARMY", - "NAVY", - "MARINES", - "AIR_FORCE", - "COAST_GUARD", - "SPACE_FORCE", - "OTHER" - ], - "x-display-value": { - "AIR_FORCE": "Air Force", - "ARMY": "Army", - "COAST_GUARD": "Coast Guard", - "MARINES": "Marine Corps", - "NAVY": "Navy", - "OTHER": "OTHER", - "SPACE_FORCE": "Space Force" - }, - "x-nullable": true - }, - "ApplicationParameters": { - "type": "object", - "properties": { - "parameterName": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "parameterValue": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "validationCode": { - "type": "string", - "format": "string", - "x-nullable": true - } - } - }, - "ApproveSITExtension": { - "required": [ - "approvedDays" - ], - "properties": { - "approvedDays": { - "description": "Number of days approved for SIT extension", - "type": "integer", - "minimum": 1, - "example": 21 - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT approval", - "type": "string", - "x-nullable": true, - "example": "Approved for three weeks rather than requested 45 days" - }, - "requestReason": { - "description": "Reason from service counselor-provided picklist for SIT Duration Update", - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ], - "example": "AWAITING_COMPLETION_OF_RESIDENCE" - } - } - }, - "AssignOfficeUserBody": { - "type": "object", - "required": [ - "officeUserId", - "roleType" - ], - "properties": { - "officeUserId": { - "type": "string", - "format": "uuid" - }, - "roleType": { - "type": "string" - } - } - }, - "AssignedOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "AssociateReportViolations": { - "description": "A list of PWS violation string ids to associate with an evaluation report", - "type": "object", - "properties": { - "violations": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - }, - "AvailableOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "hasSafetyPrivilege": { - "type": "boolean" - }, - "lastName": { - "type": "string" - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "workload": { - "type": "integer" - } - } - }, - "AvailableOfficeUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/AvailableOfficeUser" - } - }, - "BackupContact": { - "type": "object", - "required": [ - "name", - "email", - "phone" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "example": "backupContact@mail.com" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - } - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "BulkAssignmentData": { - "type": "object", - "properties": { - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "bulkAssignmentMoveIDs": { - "$ref": "#/definitions/BulkAssignmentMoveIDs" - } - } - }, - "BulkAssignmentMoveID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "BulkAssignmentMoveIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/BulkAssignmentMoveID" - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "Contractor": { - "properties": { - "contractNumber": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "CounselingUpdateAllowancePayload": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "gunSafe": { - "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", - "type": "boolean", - "x-nullable": true - }, - "organizationalClothingAndIndividualEquipment": { - "description": "only for Army", - "type": "boolean", - "x-nullable": true - }, - "proGearWeight": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 2000, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 500, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "requiredMedicalEquipmentWeight": { - "description": "unit is in lbs", - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "storageInTransit": { - "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", - "type": "integer" - }, - "ubAllowance": { - "type": "integer", - "x-nullable": true, - "example": 500 - } - } - }, - "CounselingUpdateOrderPayload": { - "type": "object", - "required": [ - "issueDate", - "reportByDate", - "ordersType", - "originDutyLocationId", - "newDutyLocationId" - ], - "properties": { - "departmentIndicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ntsSac": { - "title": "NTS SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "title": "NTS TAC", - "maxLength": 4, - "minLength": 4, - "$ref": "#/definitions/NullableString", - "example": "F8J1" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "title": "HHG SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "tac": { - "type": "string", - "title": "HHG TAC", - "maxLength": 4, - "minLength": 4, - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreateAppeal": { - "description": "Appeal status and remarks left for a violation, created by a GSR user.", - "type": "object", - "properties": { - "appealStatus": { - "description": "The status of the appeal set by the GSR user", - "type": "string", - "enum": [ - "sustained", - "rejected" - ], - "example": "These are my violation appeal remarks" - }, - "remarks": { - "description": "Remarks left by the GSR user", - "type": "string", - "example": "These are my violation appeal remarks" - } - } - }, - "CreateApprovedSITDurationUpdate": { - "required": [ - "requestReason", - "approvedDays" - ], - "properties": { - "approvedDays": { - "description": "Number of days approved for SIT extension. This will match requested days saved to the SIT extension model.", - "type": "integer", - "example": 21 - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT Duration Update creation", - "type": "string", - "x-nullable": true, - "example": "Customer needs additional storage time as their new place of residence is not yet ready" - }, - "requestReason": { - "description": "Reason from service counselor-provided picklist for SIT Duration Update", - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ], - "example": "AWAITING_COMPLETION_OF_RESIDENCE" - } - } - }, - "CreateBoatShipment": { - "description": "Boat shipment information for the move.", - "required": [ - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateCustomerPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backupContact": { - "$ref": "#/definitions/BackupContact" - }, - "backupMailingAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "cacUser": { - "type": "boolean" - }, - "createOktaAccount": { - "type": "boolean" - }, - "edipi": { - "type": "string", - "maxLength": 10, - "x-nullable": false, - "example": "1234567890" - }, - "emailIsPreferred": { - "type": "boolean" - }, - "emplid": { - "type": "string", - "maxLength": 7, - "x-nullable": true, - "example": "9485155" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "middleName": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "personalEmail@email.com" - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "residentialAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "CreateCustomerSupportRemark": { - "description": "A text remark written by an customer support user that is associated with a specific move.", - "type": "object", - "required": [ - "content", - "officeUserID" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "CreateEvaluationReport": { - "description": "Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID.", - "type": "object", - "properties": { - "shipmentID": { - "description": "The shipment ID of the shipment to be evaluated in the report", - "type": "string", - "format": "uuid", - "example": "01b9671e-b268-4906-967b-ba661a1d3933" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "secondaryDeliveryAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "tertiaryDeliveryAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "usesExternalVendor": { - "type": "boolean", - "x-nullable": true, - "example": false - } - } - }, - "CreateMobileHomeShipment": { - "description": "A mobile home shipment that the prime moves for a service member.", - "required": [ - "make", - "model", - "year", - "lengthInInches", - "heightInInches", - "widthInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreateOrders": { - "type": "object", - "required": [ - "serviceMemberId", - "issueDate", - "reportByDate", - "ordersType", - "hasDependents", - "spouseHasProGear", - "newDutyLocationId" - ], - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "hasDependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "serviceMemberId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouseHasProGear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreatePPMShipment": { - "description": "A personally procured move is a type of shipment that a service members moves themselves.", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean" - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreatedCustomer": { - "type": "object", - "properties": { - "affiliation": { - "type": "string", - "title": "Branch of service customer is affilated with" - }, - "backupAddress": { - "$ref": "#/definitions/Address" - }, - "backupContact": { - "$ref": "#/definitions/BackupContact" - }, - "cacValidated": { - "type": "boolean" - }, - "edipi": { - "type": "string", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "middleName": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "oktaEmail": { - "type": "string" - }, - "oktaID": { - "type": "string" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "residentialAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Customer": { - "type": "object", - "properties": { - "agency": { - "type": "string", - "title": "Agency customer is affilated with" - }, - "backupAddress": { - "$ref": "#/definitions/Address" - }, - "backup_contact": { - "$ref": "#/definitions/BackupContact" - }, - "cacValidated": { - "type": "boolean", - "x-nullable": true - }, - "current_address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string" - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "first_name": { - "type": "string", - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "last_name": { - "type": "string", - "example": "Doe" - }, - "middle_name": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "CustomerContactType": { - "description": "Describes a customer contact type for a MTOServiceItem of type domestic destination SIT.", - "type": "string", - "enum": [ - "FIRST", - "SECOND" - ] - }, - "CustomerSupportRemark": { - "description": "A text remark written by an office user that is associated with a specific move.", - "type": "object", - "required": [ - "id", - "moveID", - "officeUserID", - "content" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeUserEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "readOnly": true - }, - "officeUserFirstName": { - "type": "string", - "readOnly": true, - "example": "Grace" - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeUserLastName": { - "type": "string", - "readOnly": true, - "example": "Griffin" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "CustomerSupportRemarks": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "DenySITExtension": { - "required": [ - "officeRemarks", - "convertToCustomerExpense" - ], - "properties": { - "convertToCustomerExpense": { - "description": "Whether or not to convert to members expense once SIT extension is denied.", - "type": "boolean", - "example": false - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT denial", - "type": "string", - "x-nullable": true, - "example": "Denied this extension as it does not match the criteria" - } - } - }, - "DepartmentIndicator": { - "description": "Military branch of service indicator for orders", - "type": "string", - "title": "Department indicator", - "enum": [ - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "COAST_GUARD", - "NAVY_AND_MARINES", - "AIR_AND_SPACE_FORCE", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of Secretary of Defense" - }, - "x-nullable": true - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DimensionType": { - "description": "Describes a dimension type for a MTOServiceItemDimension.", - "type": "string", - "enum": [ - "ITEM", - "CRATE" - ] - }, - "Document": { - "type": "object", - "required": [ - "id", - "service_member_id", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "address_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "eTag": { - "type": "string" - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": true - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "x-nullable": true, - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - }, - "EvaluationReport": { - "description": "An evaluation report", - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string" - }, - "evalEnd": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "18:00" - }, - "evalStart": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "15:00" - }, - "gsrAppeals": { - "x-nullable": true, - "$ref": "#/definitions/GSRAppeals" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "inspectionDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "inspectionType": { - "x-nullable": true, - "$ref": "#/definitions/EvaluationReportInspectionType" - }, - "location": { - "x-nullable": true, - "$ref": "#/definitions/EvaluationReportLocation" - }, - "locationDescription": { - "type": "string", - "x-nullable": true, - "example": "Route 66 at crash inspection site 3" - }, - "moveID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveReferenceID": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "observedClaimsResponseDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupSpreadEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupSpreadStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedShipmentDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedShipmentPhysicalPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "officeUser": { - "$ref": "#/definitions/EvaluationReportOfficeUser" - }, - "remarks": { - "type": "string", - "x-nullable": true - }, - "reportViolations": { - "x-nullable": true, - "$ref": "#/definitions/ReportViolations" - }, - "seriousIncident": { - "type": "boolean", - "x-nullable": true - }, - "seriousIncidentDesc": { - "type": "string", - "x-nullable": true - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "timeDepart": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "14:30" - }, - "type": { - "$ref": "#/definitions/EvaluationReportType" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "violationsObserved": { - "type": "boolean", - "x-nullable": true - } - } - }, - "EvaluationReportInspectionType": { - "type": "string", - "enum": [ - "DATA_REVIEW", - "PHYSICAL", - "VIRTUAL" - ], - "x-nullable": true - }, - "EvaluationReportList": { - "type": "array", - "items": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "EvaluationReportLocation": { - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION", - "OTHER" - ], - "x-nullable": true - }, - "EvaluationReportOfficeUser": { - "description": "The authoring office user for an evaluation report", - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - } - }, - "readOnly": true - }, - "EvaluationReportType": { - "type": "string", - "enum": [ - "SHIPMENT", - "COUNSELING" - ] - }, - "FetchLineOfAccountingPayload": { - "type": "object", - "properties": { - "departmentIndicator": { - "$ref": "#/definitions/DepartmentIndicator" - }, - "effectiveDate": { - "description": "The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request).\n", - "type": "string", - "format": "date", - "example": "2023-01-01" - }, - "tacCode": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "F8J1" - } - } - }, - "GBLOC": { - "type": "string", - "enum": [ - "AGFM", - "APAT", - "BGAC", - "BGNC", - "BKAS", - "CFMQ", - "CLPK", - "CNNQ", - "DMAT", - "GSAT", - "HAFC", - "HBAT", - "JEAT", - "JENQ", - "KKFA", - "LHNQ", - "LKNQ", - "MAPK", - "MAPS", - "MBFL", - "MLNQ", - "XXXX" - ] - }, - "GBLOCs": { - "type": "array", - "items": { - "type": "string" - } - }, - "GSRAppeal": { - "description": "An object associating appeals on violations and serious incidents", - "type": "object", - "properties": { - "appealStatus": { - "$ref": "#/definitions/GSRAppealStatusType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isSeriousIncident": { - "type": "boolean", - "example": false - }, - "officeUser": { - "$ref": "#/definitions/EvaluationReportOfficeUser" - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "remarks": { - "type": "string", - "example": "Office user remarks" - }, - "reportID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "violationID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "GSRAppealStatusType": { - "type": "string", - "enum": [ - "SUSTAINED", - "REJECTED" - ] - }, - "GSRAppeals": { - "type": "array", - "items": { - "$ref": "#/definitions/GSRAppeal" - } - }, - "Grade": { - "type": "string", - "title": "grade", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ], - "x-display-value": { - "ACADEMY_CADET": "Service Academy Cadet", - "AVIATION_CADET": "Aviation Cadet", - "CIVILIAN_EMPLOYEE": "Civilian Employee", - "E_1": "E-1", - "E_2": "E-2", - "E_3": "E-3", - "E_4": "E-4", - "E_5": "E-5", - "E_6": "E-6", - "E_7": "E-7", - "E_8": "E-8", - "E_9": "E-9", - "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", - "MIDSHIPMAN": "Midshipman", - "O_10": "O-10", - "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", - "O_2": "O-2", - "O_3": "O-3", - "O_4": "O-4", - "O_5": "O-5", - "O_6": "O-6", - "O_7": "O-7", - "O_8": "O-8", - "O_9": "O-9", - "W_1": "W-1", - "W_2": "W-2", - "W_3": "W-3", - "W_4": "W-4", - "W_5": "W-5" - }, - "x-nullable": true - }, - "InvalidRequestResponsePayload": { - "type": "object", - "properties": { - "errors": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "IsDateWeekendHolidayInfo": { - "type": "object", - "required": [ - "country_code", - "country_name", - "date", - "is_weekend", - "is_holiday" - ], - "properties": { - "country_code": { - "type": "string" - }, - "country_name": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - }, - "details": { - "type": "string" - }, - "is_holiday": { - "type": "boolean" - }, - "is_weekend": { - "type": "boolean" - } - } - }, - "LOAType": { - "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", - "type": "string", - "enum": [ - "HHG", - "NTS" - ], - "example": "HHG" - }, - "LOATypeNullable": { - "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", - "type": "string", - "enum": [ - "HHG", - "NTS" - ], - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - }, - "example": "HHG" - }, - "LineOfAccounting": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "example": "2023-08-03T19:17:10.050Z" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "06254fc3-b763-484c-b555-42855d1ad5cd" - }, - "loaActvtyID": { - "type": "string", - "maxLength": 11, - "x-nullable": true - }, - "loaAgncAcntngCd": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaAgncDsbrCd": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaAlltSnID": { - "type": "string", - "maxLength": 5, - "x-nullable": true, - "example": "123A" - }, - "loaBafID": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "1234" - }, - "loaBdgtAcntClsNm": { - "type": "string", - "maxLength": 8, - "x-nullable": true, - "example": "000000" - }, - "loaBetCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaBgFyTx": { - "type": "integer", - "x-nullable": true, - "example": 2006 - }, - "loaBgnDt": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2005-10-01" - }, - "loaBgtLnItmID": { - "type": "string", - "maxLength": 8, - "x-nullable": true - }, - "loaBgtRstrCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaBgtSubActCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaClsRefID": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaCstCd": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "loaCstCntrID": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "loaCustNm": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaDfAgncyAlctnRcpntID": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaDocID": { - "type": "string", - "maxLength": 15, - "x-nullable": true, - "example": "HHG12345678900" - }, - "loaDptID": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "1 " - }, - "loaDscTx": { - "type": "string", - "x-nullable": true, - "example": "PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER)" - }, - "loaDtlRmbsmtSrcID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaEndDt": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2015-10-01" - }, - "loaEndFyTx": { - "type": "integer", - "x-nullable": true, - "example": 2016 - }, - "loaFmsTrnsactnID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaFnclArID": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaFnctPrsNm": { - "type": "string", - "maxLength": 255, - "x-nullable": true - }, - "loaFndCntrID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaFndTyFgCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaHistStatCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaHsGdsCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "HT" - }, - "loaInstlAcntgActID": { - "type": "string", - "maxLength": 6, - "x-nullable": true, - "example": "12345" - }, - "loaJbOrdNm": { - "type": "string", - "maxLength": 10, - "x-nullable": true - }, - "loaLclInstlID": { - "type": "string", - "maxLength": 18, - "x-nullable": true - }, - "loaMajClmNm": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaMajRmbsmtSrcID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaObjClsID": { - "type": "string", - "maxLength": 6, - "x-nullable": true, - "example": "22NL" - }, - "loaOpAgncyID": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "1A" - }, - "loaPgmElmntID": { - "type": "string", - "maxLength": 12, - "x-nullable": true, - "example": "00000000" - }, - "loaPrjID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaSbaltmtRcpntID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaScrtyCoopCustCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaScrtyCoopDsgntrCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaScrtyCoopImplAgncCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaScrtyCoopLnItmID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaSpclIntrID": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaSrvSrcID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaStatCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true, - "example": "U" - }, - "loaSubAcntID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaSysId": { - "type": "string", - "maxLength": 20, - "x-nullable": true, - "example": "10003" - }, - "loaTnsfrDptNm": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaTrnsnID": { - "type": "string", - "maxLength": 3, - "x-nullable": true, - "example": "B1" - }, - "loaTrsySfxTx": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "0000" - }, - "loaTskBdgtSblnTx": { - "type": "string", - "maxLength": 8, - "x-nullable": true - }, - "loaUic": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaWkCntrRcpntNm": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaWrkOrdID": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "orgGrpDfasCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "ZZ" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "example": "2023-08-03T19:17:38.776Z" - }, - "validHhgProgramCodeForLoa": { - "type": "boolean", - "x-nullable": true - }, - "validLoaForTac": { - "type": "boolean", - "x-nullable": true - } - } - }, - "ListPrimeMove": { - "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "example": "AGFM" - }, - "destinationPostalCode": { - "type": "string", - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orderType": { - "type": "string" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ListPrimeMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/ListPrimeMove" - } - }, - "ListPrimeMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queueMoves": { - "$ref": "#/definitions/ListPrimeMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "Location": { - "type": "object", - "required": [ - "label", - "value" - ], - "properties": { - "label": { - "type": "string", - "example": "Label for display" - }, - "value": { - "type": "string", - "example": "Value for location" - } - } - }, - "Locations": { - "type": "array", - "items": { - "$ref": "#/definitions/Location" - } - }, - "LockedOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "type": "string", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ] - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOApprovalServiceItemCodes": { - "description": "MTO level service items to create when updating MTO status.", - "type": "object", - "properties": { - "serviceCodeCS": { - "type": "boolean", - "example": true - }, - "serviceCodeMS": { - "type": "boolean", - "example": true - } - } - }, - "MTOServiceItem": { - "type": "object", - "required": [ - "id", - "moveTaskOrderID", - "reServiceID", - "reServiceCode", - "reServiceName" - ], - "properties": { - "SITPostalCode": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "convertToCustomerExpense": { - "type": "boolean", - "x-omitempty": false, - "example": false - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "customerContacts": { - "$ref": "#/definitions/MTOServiceItemCustomerContacts" - }, - "customerExpenseReason": { - "type": "string", - "x-nullable": true - }, - "deletedAt": { - "type": "string", - "format": "date" - }, - "description": { - "type": "string", - "x-nullable": true - }, - "dimensions": { - "$ref": "#/definitions/MTOServiceItemDimensions" - }, - "eTag": { - "type": "string" - }, - "estimatedPrice": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "estimatedWeight": { - "description": "estimated weight of the shuttle service item provided by the prime", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "feeType": { - "type": "string", - "enum": [ - "COUNSELING", - "CRATING", - "TRUCKING", - "SHUTTLE" - ] - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "x-nullable": true, - "example": "CONUS" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupPostalCode": { - "type": "string", - "x-nullable": true - }, - "quantity": { - "type": "integer" - }, - "rate": { - "type": "integer" - }, - "reServiceCode": { - "type": "string" - }, - "reServiceID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "type": "string" - }, - "reason": { - "type": "string", - "x-nullable": true - }, - "rejectedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDeliveryMiles": { - "type": "integer", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitDestinationOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitOriginHHGActualAddress": { - "$ref": "#/definitions/Address" - }, - "sitOriginHHGOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - }, - "submittedAt": { - "type": "string", - "format": "date" - }, - "total": { - "type": "integer", - "format": "cents" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MTOServiceItemCustomerContact": { - "description": "Customer contact information for a destination SIT service item", - "type": "object", - "properties": { - "dateOfContact": { - "description": "Date of attempted contact by the prime.", - "type": "string", - "format": "date" - }, - "firstAvailableDeliveryDate": { - "description": "First available date that the Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "example": "2020-12-31" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "timeMilitary": { - "description": "Time of attempted contact by the prime.", - "type": "string", - "example": "0400Z" - }, - "type": { - "$ref": "#/definitions/CustomerContactType" - } - } - }, - "MTOServiceItemCustomerContacts": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItemCustomerContact" - } - }, - "MTOServiceItemDimension": { - "description": "Describes a dimension object for the MTOServiceItem.", - "type": "object", - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "type": { - "$ref": "#/definitions/DimensionType" - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDimensions": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItemDimension" - } - }, - "MTOServiceItemSingle": { - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "convertToCustomerExpense": { - "type": "boolean", - "x-omitempty": false, - "example": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerExpenseReason": { - "type": "string", - "x-nullable": true - }, - "deletedAt": { - "type": "string", - "format": "date" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupPostalCode": { - "type": "string", - "x-nullable": true - }, - "reServiceCode": { - "type": "string" - }, - "reServiceID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "type": "string" - }, - "rejectedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "status": { - "type": "string", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOServiceItemStatus": { - "description": "Describes all statuses for a MTOServiceItem", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - }, - "MTOServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "MTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The actual date that the shipment was delivered to the delivery address by the Prime", - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "approvedDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "billableWeightCap": { - "description": "TIO override billable weight to be used for calculations", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "billableWeightJustification": { - "type": "string", - "x-nullable": true, - "example": "more weight than expected" - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "calculatedBillableWeight": { - "type": "integer", - "x-nullable": true, - "readOnly": true, - "example": 2000 - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "destinationSitAuthEndDate": { - "type": "string", - "format": "date-time" - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "distance": { - "type": "integer", - "x-nullable": true, - "example": 500 - }, - "diversion": { - "type": "boolean", - "example": true - }, - "diversionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment needs rerouted" - }, - "eTag": { - "type": "string" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoAgents": { - "$ref": "#/definitions/MTOAgents" - }, - "mtoServiceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "originSitAuthEndDate": { - "type": "string", - "format": "date-time" - }, - "pickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "primeEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment not good enough" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requiredDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "reweigh": { - "x-nullable": true, - "x-omitempty": true, - "$ref": "#/definitions/Reweigh" - }, - "sacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "scheduledDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "scheduledPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDeliveryAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentLocator": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "1K43AR-01" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitDaysAllowance": { - "type": "integer", - "x-nullable": true - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "sitStatus": { - "$ref": "#/definitions/SITStatus" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "tertiaryDeliveryAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "usesExternalVendor": { - "type": "boolean", - "example": false - } - } - }, - "MTOShipmentStatus": { - "type": "string", - "title": "Shipment Status", - "enum": [ - "SUBMITTED", - "REJECTED", - "APPROVED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "example": "SUBMITTED" - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "Move": { - "properties": { - "SCAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "TIOAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "TOOAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "approvalsRequestedAt": { - "description": "The time at which a move is sent back to the TOO becuase the prime added a new service item for approval", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "billableWeightsReviewedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "closeoutOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "closeoutOfficeId": { - "description": "The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members", - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "contractor": { - "$ref": "#/definitions/Contractor" - }, - "contractorId": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "excess_weight_acknowledged_at": { - "description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "excess_weight_qualified_at": { - "description": "Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "financialReviewFlag": { - "description": "This flag is set by office users if a move should be reviewed by a Financial Office", - "type": "boolean", - "x-nullable": false, - "readOnly": true, - "example": false - }, - "financialReviewRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "Delivery Address is too far from duty location" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "type": "string", - "example": "1K43AR" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUser": { - "x-nullable": true, - "$ref": "#/definitions/LockedOfficeUser" - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orders": { - "$ref": "#/definitions/Order" - }, - "ordersId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "referenceId": { - "type": "string", - "x-nullable": true, - "example": "1001-3456" - }, - "serviceCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "shipmentGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "tioRemarks": { - "type": "string", - "x-nullable": true, - "example": "approved additional weight" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveAuditHistories": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveAuditHistory" - } - }, - "MoveAuditHistory": { - "properties": { - "action": { - "description": "Action type; I = insert, D = delete, U = update, T = truncate", - "type": "string" - }, - "actionTstampClk": { - "description": "Wall clock time at which audited event's trigger call occurred", - "type": "string", - "format": "date-time" - }, - "actionTstampStm": { - "description": "Statement start timestamp for tx in which audited event occurred", - "type": "string", - "format": "date-time" - }, - "actionTstampTx": { - "description": "Transaction start timestamp for tx in which audited event occurred", - "type": "string", - "format": "date-time" - }, - "changedValues": { - "description": "A list of (changed/updated) MoveAuditHistoryItem's for a record after the change.", - "type": "object", - "additionalProperties": true, - "x-nullable": true - }, - "context": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "x-nullable": true - }, - "contextId": { - "description": "id column for the context table the record belongs to", - "type": "string", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "eventName": { - "description": "API endpoint name that was called to make the change", - "type": "string", - "x-nullable": true - }, - "id": { - "description": "id from audity_history table", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "objectId": { - "description": "id column for the tableName where the data was changed", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "oldValues": { - "description": "A list of (old/previous) MoveAuditHistoryItem's for a record before the change.", - "type": "object", - "additionalProperties": true, - "x-nullable": true - }, - "relId": { - "description": "relation OID. Table OID (object identifier). Changes with drop/create.", - "type": "integer" - }, - "schemaName": { - "description": "Database schema audited table for this event is in", - "type": "string" - }, - "sessionUserEmail": { - "type": "string", - "x-nullable": true, - "example": "foobar@example.com" - }, - "sessionUserFirstName": { - "type": "string", - "x-nullable": true, - "example": "foo" - }, - "sessionUserId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sessionUserLastName": { - "type": "string", - "x-nullable": true, - "example": "bar" - }, - "sessionUserTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "statementOnly": { - "description": "true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW'", - "type": "boolean", - "example": false - }, - "tableName": { - "description": "name of database table that was changed", - "type": "string" - }, - "transactionId": { - "description": "Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx.", - "type": "integer", - "x-nullable": true - } - } - }, - "MoveAuditHistoryItem": { - "properties": { - "columnName": { - "type": "string" - }, - "columnValue": { - "type": "string" - } - } - }, - "MoveAuditHistoryItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveAuditHistoryItem" - } - }, - "MoveHistory": { - "properties": { - "historyRecords": { - "description": "A list of MoveAuditHistory's connected to the move.", - "$ref": "#/definitions/MoveAuditHistories" - }, - "id": { - "description": "move ID", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "description": "move locator", - "type": "string", - "example": "1K43AR" - }, - "referenceId": { - "description": "move referenceID", - "type": "string", - "x-nullable": true, - "example": "1001-3456" - } - } - }, - "MoveHistoryResult": { - "type": "object", - "properties": { - "historyRecords": { - "description": "A list of MoveAuditHistory's connected to the move.", - "$ref": "#/definitions/MoveAuditHistories" - }, - "id": { - "description": "move ID", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "description": "move locator", - "type": "string", - "example": "1K43AR" - }, - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "referenceId": { - "description": "move referenceID", - "type": "string", - "x-nullable": true, - "example": "1001-3456" - }, - "totalCount": { - "type": "integer" - } - } - }, - "MovePayload": { - "type": "object", - "required": [ - "id", - "orders_id", - "locator", - "created_at", - "updated_at", - "eTag" - ], - "properties": { - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - }, - "closeout_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "mto_shipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submitted_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveStatus": { - "type": "string", - "enum": [ - "DRAFT", - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED", - "SUBMITTED", - "APPROVALS REQUESTED", - "APPROVED", - "CANCELED" - ] - }, - "MoveTaskOrder": { - "description": "The Move (MoveTaskOrder)", - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "destinationDutyLocation": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "eTag": { - "type": "string" - }, - "entitlements": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "type": "string", - "example": "1K43AR" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "originDutyLocation": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "requestedPickupDate": { - "type": "string", - "format": "date" - }, - "serviceCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "tioRemarks": { - "type": "string", - "x-nullable": true, - "example": "approved additional weight" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveTaskOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "MovingExpense": { - "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "ppmShipmentId", - "documentId", - "document" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp the moving expense object was initially created in the system (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "A brief description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "The Document object that contains all file uploads for this expense" - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The id of the Document that contains all file uploads for this expense", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "Unique primary identifier of the Moving Expense object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingReceipt": { - "description": "Indicates if the service member is missing the receipt with the proof of expense amount", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "paidWithGtcc": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The PPM Shipment id that this moving expense belongs to", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedAmount": { - "description": "Customer submitted total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedDescription": { - "description": "Customer submitted description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "submittedMovingExpenseType": { - "$ref": "#/definitions/SubmittedMovingExpenseType" - }, - "submittedSitEndDate": { - "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "submittedSitStartDate": { - "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "updatedAt": { - "description": "Timestamp when a property of this moving expense object was last modified (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "MovingExpenses": { - "description": "All moving expenses associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - }, - "x-omitempty": false - }, - "NullableString": { - "type": "string", - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - } - }, - "OfficeUser": { - "type": "object", - "required": [ - "id", - "firstName", - "middleInitials", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "active", - "roles", - "edipi", - "otherUniqueId", - "rejectionReason", - "status", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "middleInitials": { - "type": "string" - }, - "otherUniqueId": { - "type": "string" - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REQUESTED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "OfficeUserCreate": { - "type": "object", - "required": [ - "firstName", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "roles" - ], - "properties": { - "edipi": { - "type": "string", - "title": "EDIPI", - "maxLength": 10, - "x-nullable": true, - "example": "1234567890" - }, - "email": { - "type": "string", - "title": "Email", - "x-nullable": false, - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": false - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": false - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "L." - }, - "otherUniqueId": { - "type": "string", - "title": "Office user identifier when EDIPI is not available", - "x-nullable": true - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - }, - "x-nullable": false - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": false, - "example": "212-555-5555" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "x-nullable": false, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OfficeUserRole": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "title": "roleType", - "x-nullable": true, - "example": "task_ordering_officer" - } - } - }, - "OmittableMovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OmittablePPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - }, - "x-nullable": true, - "x-omitempty": false - }, - "Order": { - "type": "object", - "properties": { - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "amendedOrdersAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "date_issued": { - "type": "string", - "format": "date", - "example": "2020-01-01" - }, - "department_indicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "eTag": { - "type": "string" - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "first_name": { - "type": "string", - "readOnly": true, - "example": "John" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "last_name": { - "type": "string", - "readOnly": true, - "example": "Doe" - }, - "methodOfPayment": { - "type": "string" - }, - "moveCode": { - "type": "string", - "example": "H2XFJF" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "naics": { - "type": "string" - }, - "ntsSac": { - "type": "string", - "title": "NTS SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "type": "string", - "title": "NTS TAC", - "x-nullable": true, - "example": "F8J1" - }, - "order_number": { - "type": "string", - "x-nullable": true, - "example": "030-00362" - }, - "order_type": { - "$ref": "#/definitions/OrdersType" - }, - "order_type_detail": { - "x-nullable": true, - "$ref": "#/definitions/OrdersTypeDetail" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "packingAndShippingInstructions": { - "type": "string" - }, - "report_by_date": { - "type": "string", - "format": "date", - "example": "2020-01-01" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?", - "example": false - }, - "supplyAndServicesCostEstimate": { - "type": "string" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - }, - "uploadedAmendedOrderID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploaded_order_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OrderBody": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PPMActualWeight": { - "description": "The actual net weight of a single PPM shipment. Used during document review for PPM closeout.", - "required": [ - "actualWeight" - ], - "properties": { - "actualWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "PPMAdvanceStatus": { - "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", - "type": "string", - "title": "PPM Advance Status", - "enum": [ - "APPROVED", - "REJECTED", - "EDITED", - "RECEIVED", - "NOT_RECEIVED" - ], - "x-nullable": true - }, - "PPMCloseout": { - "description": "The calculations needed in the \"Review Documents\" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment.", - "required": [ - "id" - ], - "properties": { - "SITReimbursement": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "aoa": { - "description": "Advance Operating Allowance (AOA).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "ddp": { - "description": "The Domestic Destination Price (DDP).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "dop": { - "description": "The Domestic Origin Price (DOP).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "gcc": { - "description": "Government Constructive Cost (GCC)", - "type": "integer", - "format": "cents", - "title": "GCC", - "x-nullable": true, - "x-omitempty": false - }, - "grossIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "haulFSC": { - "description": "The linehaul/shorthaul Fuel Surcharge (FSC).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "haulPrice": { - "description": "The price of the linehaul or shorthaul.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "haulType": { - "description": "The type of haul calculation used for this shipment (shorthaul or linehaul).", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "miles": { - "description": "The distance between the old address and the new address in miles.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 54 - }, - "packPrice": { - "description": "The full price of all packing/unpacking services.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "plannedMoveDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightCustomer": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightSpouse": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "remainingIncentive": { - "description": "The remaining reimbursement amount that is still owed to the customer.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "unpackPrice": { - "description": "The full price of all packing/unpacking services.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - } - }, - "PPMDocumentStatusReason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "PPMDocuments": { - "description": "All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses.", - "type": "object", - "properties": { - "MovingExpenses": { - "$ref": "#/definitions/MovingExpenses" - }, - "ProGearWeightTickets": { - "$ref": "#/definitions/ProGearWeightTickets" - }, - "WeightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true, - "x-omitempty": false - }, - "PPMSITEstimatedCost": { - "description": "The estimated cost of SIT for a single PPM shipment. Used during document review for PPM.", - "required": [ - "sitCost", - "priceFirstDaySIT", - "priceAdditionalDaySIT" - ], - "properties": { - "paramsAdditionalDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "numberDaysSIT": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "30" - }, - "priceRateOrFactor": { - "type": "string", - "example": "0.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "paramsFirstDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "priceRateOrFactor": { - "type": "string", - "example": "20.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "priceAdditionalDaySIT": { - "type": "integer", - "format": "cents", - "title": "Price of an additional day in SIT", - "example": 2000 - }, - "priceFirstDaySIT": { - "type": "integer", - "format": "cents", - "title": "Price of the first day in SIT", - "example": 2000 - }, - "sitCost": { - "type": "integer", - "example": 2000 - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4300 - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date" - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true - }, - "PPMShipmentSIT": { - "description": "SIT related items for a PPM shipment", - "required": [ - "sitLocation" - ], - "properties": { - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PPMStatus": { - "type": "string", - "enum": [ - "CANCELED", - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "COMPLETED" - ] - }, - "PWSViolation": { - "description": "A PWS violation for an evaluation report", - "type": "object", - "properties": { - "additionalDataElem": { - "type": "string", - "example": "QAE Observed Delivery Date" - }, - "category": { - "type": "string", - "example": "Pre-Move Services" - }, - "displayOrder": { - "type": "integer", - "example": 3 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isKpi": { - "type": "boolean", - "example": false - }, - "paragraphNumber": { - "type": "string", - "example": "1.2.3.4.5" - }, - "requirementStatement": { - "type": "string", - "example": "The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS." - }, - "requirementSummary": { - "type": "string", - "example": "Provide a single point of contact (POC)" - }, - "subCategory": { - "type": "string", - "example": "Weight Estimate" - }, - "title": { - "type": "string", - "example": "Customer Support" - } - }, - "readOnly": true - }, - "PWSViolations": { - "type": "array", - "items": { - "$ref": "#/definitions/PWSViolation" - } - }, - "PatchMTOServiceItemStatusPayload": { - "properties": { - "rejectionReason": { - "description": "Reason the service item was rejected", - "type": "string", - "x-nullable": true, - "example": "Insufficent details provided" - }, - "status": { - "description": "Describes all statuses for a MTOServiceItem", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - } - } - }, - "PaymentRequest": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "ediErrorCode": { - "description": "Reported code from syncada for the EDI error encountered", - "type": "string", - "x-nullable": true - }, - "ediErrorDescription": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true - }, - "ediErrorType": { - "description": "Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858.", - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrder": { - "$ref": "#/definitions/Move" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "receivedByGexAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "reviewedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sentToGexAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "serviceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - }, - "tppsInvoiceAmountPaidTotalMillicents": { - "type": "integer", - "format": "millients", - "title": "Total amount that TPPS paid for all service items on the payment request in millicents", - "x-nullable": true - }, - "tppsInvoiceSellerPaidDate": { - "type": "string", - "format": "date-time", - "title": "Date that TPPS paid HS for the payment request", - "x-nullable": true - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemCode": { - "type": "string", - "example": "DLH" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemName": { - "type": "string", - "example": "Move management" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoShipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - }, - "tppsInvoiceAmountPaidPerServiceItemMillicents": { - "type": "integer", - "format": "millicents", - "title": "Amount that TPPS paid for the individual service item in millicents", - "x-nullable": true - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "PostDocumentPayload": { - "type": "object", - "properties": { - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - } - } - }, - "ProGearWeightTicket": { - "description": "Pro-gear associated information and weight docs for a PPM shipment", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "documentId", - "document" - ], - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the pro-gear weight." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the pro-gear weight ticket.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedBelongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedHasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedWeight": { - "description": "Customer submitted weight of the pro-gear.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weight": { - "description": "Weight of the pro-gear.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "ProGearWeightTickets": { - "description": "All progear weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - }, - "x-omitempty": false - }, - "ProofOfServiceDoc": { - "properties": { - "isWeightTicket": { - "type": "boolean" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "QueueMove": { - "type": "object", - "properties": { - "appearedInTooAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "assignable": { - "type": "boolean" - }, - "assignedTo": { - "x-nullable": true, - "$ref": "#/definitions/AssignedOfficeUser" - }, - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "closeoutInitiated": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "closeoutLocation": { - "type": "string", - "x-nullable": true - }, - "counselingOffice": { - "type": "string", - "x-nullable": true - }, - "counselingOfficeID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUser": { - "x-nullable": true, - "$ref": "#/definitions/LockedOfficeUser" - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orderType": { - "type": "string", - "x-nullable": true - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "ppmStatus": { - "x-nullable": true, - "$ref": "#/definitions/PPMStatus" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ], - "x-nullable": true - }, - "requestedMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "QueueMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/QueueMove" - } - }, - "QueueMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queueMoves": { - "$ref": "#/definitions/QueueMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "QueuePaymentRequest": { - "type": "object", - "properties": { - "age": { - "description": "Days since the payment request has been requested. Decimal representation will allow more accurate sorting.", - "type": "number", - "format": "double" - }, - "assignable": { - "type": "boolean" - }, - "assignedTo": { - "x-nullable": true, - "$ref": "#/definitions/AssignedOfficeUser" - }, - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "counselingOffice": { - "type": "string", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "moveID": { - "type": "string", - "format": "uuid" - }, - "orderType": { - "type": "string", - "x-nullable": true - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "status": { - "$ref": "#/definitions/QueuePaymentRequestStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "QueuePaymentRequestStatus": { - "type": "string", - "title": "Queue Payment Request Status", - "enum": [ - "Payment requested", - "Reviewed", - "Rejected", - "Paid" - ] - }, - "QueuePaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/QueuePaymentRequest" - } - }, - "QueuePaymentRequestsResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queuePaymentRequests": { - "$ref": "#/definitions/QueuePaymentRequests" - }, - "totalCount": { - "type": "integer" - } - } - }, - "ReServiceItem": { - "description": "A Service Item which ties an ReService, Market, and Shipment Type together", - "type": "object", - "properties": { - "isAutoApproved": { - "type": "boolean", - "example": true - }, - "marketCode": { - "type": "string", - "enum": [ - "i", - "d" - ], - "example": "i (International), d (Domestic)" - }, - "serviceCode": { - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DCRTSA", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSFSC", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSFSC", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICRT", - "ICRTSA", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSFSC", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOFSIT", - "IOPSIT", - "IOSFSC", - "IOSHUT", - "ISLH", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "PODFSC", - "POEFSC", - "UBP" - ], - "example": "UBP" - }, - "serviceName": { - "type": "string", - "example": "International UB, International Shipping \u0026 Linehaul" - }, - "shipmentType": { - "type": "string", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "example": "HHG, UNACCOMPANIED_BAGGAGE" - } - } - }, - "ReServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/ReServiceItem" - } - }, - "RejectShipment": { - "required": [ - "rejectionReason" - ], - "properties": { - "rejectionReason": { - "type": "string", - "example": "MTO Shipment not good enough" - } - } - }, - "ReportViolation": { - "description": "An object associating violations to evaluation reports", - "type": "object", - "properties": { - "gsrAppeals": { - "x-nullable": true, - "$ref": "#/definitions/GSRAppeals" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reportID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "violation": { - "$ref": "#/definitions/PWSViolation" - }, - "violationID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "ReportViolations": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportViolation" - } - }, - "RequestDiversion": { - "required": [ - "diversionReason" - ], - "properties": { - "diversionReason": { - "type": "string", - "example": "Shipment route needs to change" - } - } - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the counselor" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "roleName", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleName": { - "type": "string", - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "SITServiceItemGrouping": { - "properties": { - "serviceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "summary": { - "description": "Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\nThis is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items.\n", - "$ref": "#/definitions/SITSummary" - } - } - }, - "SITServiceItemGroupings": { - "description": "Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\n", - "type": "array", - "items": { - "$ref": "#/definitions/SITServiceItemGrouping" - } - }, - "SITStatus": { - "properties": { - "calculatedTotalDaysInSIT": { - "type": "integer" - }, - "currentSIT": { - "type": "object", - "properties": { - "daysInSIT": { - "type": "integer" - }, - "location": { - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "serviceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitAuthorizedEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - } - } - }, - "pastSITServiceItemGroupings": { - "description": "A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes.\n", - "$ref": "#/definitions/SITServiceItemGroupings" - }, - "totalDaysRemaining": { - "type": "integer" - }, - "totalSITDaysUsed": { - "type": "integer" - } - } - }, - "SITSummary": { - "properties": { - "daysInSIT": { - "type": "integer" - }, - "firstDaySITServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "location": { - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "sitAuthorizedEndDate": { - "type": "string", - "format": "date-time" - }, - "sitCustomerContacted": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date-time" - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "SearchCustomer": { - "type": "object", - "properties": { - "branch": { - "type": "string" - }, - "edipi": { - "type": "string", - "x-nullable": true - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "lastName": { - "type": "string", - "x-nullable": true, - "example": "Doe" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "personalEmail@email.com" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "SearchCustomers": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchCustomer" - } - }, - "SearchCustomersResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "searchCustomers": { - "$ref": "#/definitions/SearchCustomers" - }, - "totalCount": { - "type": "integer" - } - } - }, - "SearchMove": { - "type": "object", - "properties": { - "branch": { - "type": "string" - }, - "destinationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "edipi": { - "type": "string", - "x-nullable": true, - "example": 1234567890 - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "lastName": { - "type": "string", - "x-nullable": true, - "example": "Doe" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orderType": { - "type": "string" - }, - "originDutyLocationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "paymentRequestCode": { - "type": "string", - "x-nullable": true, - "example": "9551-6199-2" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - } - } - }, - "SearchMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchMove" - } - }, - "SearchMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "searchMoves": { - "$ref": "#/definitions/SearchMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceItemSitEntryDate": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "mtoServiceItemID": { - "type": "string", - "format": "uuid" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "ServiceRequestDocuments": { - "description": "documents uploaded by the Prime as proof of request for service items", - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "ShipmentPaymentSITBalance": { - "properties": { - "pendingBilledEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "pendingBilledStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "pendingSITDaysInvoiced": { - "type": "integer" - }, - "previouslyBilledDays": { - "type": "integer", - "x-nullable": true - }, - "previouslyBilledEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "previouslyBilledStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentID": { - "type": "string", - "format": "uuid" - }, - "totalSITDaysAuthorized": { - "type": "integer" - }, - "totalSITDaysRemaining": { - "type": "integer" - }, - "totalSITEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - } - } - }, - "ShipmentsPaymentSITBalance": { - "type": "array", - "items": { - "$ref": "#/definitions/ShipmentPaymentSITBalance" - } - }, - "SignedCertification": { - "description": "Signed certification", - "type": "object", - "required": [ - "id", - "submittingUserId", - "moveId", - "certificationType", - "certificationText", - "signature", - "date", - "createdAt", - "updatedAt", - "eTag" - ], - "properties": { - "certificationText": { - "description": "Full text that the customer agreed to and signed.", - "type": "string" - }, - "certificationType": { - "$ref": "#/definitions/SignedCertificationType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "date": { - "description": "Date that the customer signed the certification.", - "type": "string", - "format": "date" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveId": { - "description": "The ID of the move associated with this signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmId": { - "description": "The ID of the PPM shipment associated with this signed certification, if any.", - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "signature": { - "description": "The signature that the customer provided.", - "type": "string" - }, - "submittingUserId": { - "description": "The ID of the user that signed.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SignedCertificationType": { - "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "SubmittedMovingExpenseType": { - "description": "Customer Submitted Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "TacValid": { - "type": "object", - "required": [ - "isValid" - ], - "properties": { - "isValid": { - "type": "boolean", - "example": true - } - } - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phone_lines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "required": [ - "officeUserId", - "transportationOfficeId", - "primaryOffice" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "UpdateAllowancePayload": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "gunSafe": { - "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", - "type": "boolean", - "x-nullable": true - }, - "organizationalClothingAndIndividualEquipment": { - "description": "only for Army", - "type": "boolean", - "x-nullable": true - }, - "proGearWeight": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 2000, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 500, - "x-formatting": "weight", - "x-nullable": true, - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "description": "unit is in lbs", - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "storageInTransit": { - "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", - "type": "integer" - }, - "ubAllowance": { - "type": "integer", - "x-nullable": true, - "example": 500 - } - } - }, - "UpdateBillableWeightPayload": { - "type": "object", - "properties": { - "authorizedWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - } - } - }, - "UpdateBoatShipment": { - "type": "object", - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean", - "x-nullable": true - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ], - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateCustomerPayload": { - "type": "object", - "properties": { - "backupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "backup_contact": { - "$ref": "#/definitions/BackupContact" - }, - "cac_validated": { - "type": "boolean" - }, - "current_address": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "first_name": { - "type": "string", - "example": "John" - }, - "last_name": { - "type": "string", - "example": "Doe" - }, - "middle_name": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - } - } - }, - "UpdateCustomerSupportRemarkPayload": { - "description": "A text remark update to an existing remark created by the current active user (the CSR).", - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - } - } - }, - "UpdateMaxBillableWeightAsTIOPayload": { - "type": "object", - "required": [ - "authorizedWeight", - "tioRemarks" - ], - "properties": { - "authorizedWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "tioRemarks": { - "description": "TIO remarks for updating the max billable weight", - "type": "string", - "minLength": 1, - "x-nullable": true, - "example": "Increasing max billable weight" - } - } - }, - "UpdateMobileHomeShipment": { - "type": "object", - "properties": { - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMovingExpense": { - "type": "object", - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer" - }, - "description": { - "description": "A brief description of the expense.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer" - } - } - }, - "UpdateOrderPayload": { - "type": "object", - "required": [ - "issueDate", - "reportByDate", - "ordersType", - "newDutyLocationId", - "originDutyLocationId" - ], - "properties": { - "departmentIndicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ntsSac": { - "title": "NTS SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "title": "NTS TAC", - "maxLength": 4, - "minLength": 4, - "$ref": "#/definitions/NullableString", - "example": "F8J1" - }, - "ordersAcknowledgement": { - "description": "Confirmation that the new amended orders were reviewed after previously approving the original orders", - "type": "boolean", - "x-nullable": true - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "title": "HHG SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "tac": { - "type": "string", - "title": "HHG TAC", - "maxLength": 4, - "minLength": 4, - "x-nullable": true, - "example": "F8J1" - } - } - }, - "UpdatePPMShipment": { - "type": "object", - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "actualMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceAmountRequested": { - "description": "The amount request for an advance, or null if no advance is requested\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceStatus": { - "x-nullable": true, - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4300 - }, - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean", - "x-nullable": true - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - } - } - }, - "UpdatePaymentRequestStatusPayload": { - "type": "object", - "properties": { - "eTag": { - "type": "string" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "UpdateProGearWeightTicket": { - "type": "object", - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean" - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "weight": { - "description": "Weight of the pro-gear contained in the shipment.", - "type": "integer" - } - } - }, - "UpdateSITServiceItemCustomerExpense": { - "required": [ - "convertToCustomerExpense", - "customerExpenseReason" - ], - "properties": { - "convertToCustomerExpense": { - "type": "boolean", - "example": true - }, - "customerExpenseReason": { - "description": "Reason the service item was rejected", - "type": "string", - "example": "Insufficent details provided" - } - } - }, - "UpdateShipment": { - "type": "object", - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "x-nullable": true, - "$ref": "#/definitions/MTOAgents" - }, - "billableWeightCap": { - "description": "estimated weight of the shuttle service item provided by the prime", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "billableWeightJustification": { - "type": "string", - "x-nullable": true, - "example": "more weight than expected" - }, - "boatShipment": { - "$ref": "#/definitions/UpdateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/UpdateMobileHomeShipment" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sacType": { - "$ref": "#/definitions/LOATypeNullable" - }, - "secondaryDeliveryAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "$ref": "#/definitions/LOATypeNullable" - }, - "tertiaryDeliveryAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "usesExternalVendor": { - "type": "boolean", - "x-nullable": true, - "example": false - } - } - }, - "UpdateWeightTicket": { - "type": "object", - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer" - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer" - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string" - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean" - } - } - }, - "Upload": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "id", - "url", - "filename", - "contentType", - "bytes", - "createdAt", - "updatedAt" - ], - "properties": { - "bytes": { - "type": "integer", - "readOnly": true - }, - "contentType": { - "type": "string", - "format": "mime-type", - "readOnly": true, - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "filename": { - "type": "string", - "readOnly": true, - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isWeightTicket": { - "type": "boolean" - }, - "rotation": { - "type": "integer", - "example": 2 - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ], - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "uploadType": { - "type": "string", - "enum": [ - "USER", - "PRIME", - "OFFICE" - ], - "readOnly": true, - "example": "OFFICE" - }, - "url": { - "type": "string", - "format": "uri", - "readOnly": true, - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocation": { - "description": "A postal code, city, and state lookup", - "type": "object", - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocations": { - "type": "array", - "items": { - "$ref": "#/definitions/VLocation" - } - }, - "ValidationError": { - "required": [ - "invalid_fields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object" - } - ], - "properties": { - "invalid_fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "WeightTicket": { - "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "emptyDocumentId", - "emptyDocument", - "fullDocument", - "fullDocumentId", - "proofOfTrailerOwnershipDocument", - "proofOfTrailerOwnershipDocumentId" - ], - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "emptyDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when empty." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "emptyDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", - "type": "string", - "format": "uuid", - "readOnly": true - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "fullDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when full." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "fullDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "ID of this set of weight tickets.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this set of weight tickets is for.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "proofOfTrailerOwnershipDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the proof of trailer ownership." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "proofOfTrailerOwnershipDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedEmptyWeight": { - "description": "Customer submitted weight of the vehicle when empty.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedFullWeight": { - "description": "Customer submitted weight of the vehicle when full.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedOwnsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedTrailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "WeightTickets": { - "description": "All weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/WeightTicket" - }, - "x-omitempty": false - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - "movingExpenseId": { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - }, - "ppmShipmentId": { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - "proGearWeightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - }, - "weightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "NotFound": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PermissionDenied": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PreconditionFailed": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "ServerError": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "name": "queues" - }, - { - "name": "move" - }, - { - "description": "Move Orders - Commonly called “Orders,” especially in customer-facing language. Orders are plural because they're a bundle of related orders issued bya Service (e.g. Army, Air Force, Navy) to a customer that authorize (and order) that customer to move from one location to another.\nOrders are backed by $$ in the bank to support that move, which is identified by a Line of Account (LOA) code on the orders document.\n", - "name": "order" - }, - { - "name": "moveTaskOrder" - }, - { - "name": "customer" - }, - { - "name": "mtoServiceItem" - }, - { - "name": "mtoShipment" - }, - { - "name": "shipment" - }, - { - "name": "mtoAgent" - }, - { - "name": "paymentServiceItem" - }, - { - "name": "ppm" - }, - { - "name": "tac" - }, - { - "name": "transportationOffice" - }, - { - "name": "addresses" - }, - { - "name": "uploads" - }, - { - "name": "paymentRequests" - }, - { - "name": "reServiceItems" - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The GHC API is a RESTful API that enables the Office application for MilMove.\n\nAll endpoints are located under ` + "`" + `/ghc/v1` + "`" + `.\n", - "title": "MilMove GHC API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/ghc/v1", - "paths": { - "/addresses/zip-city-lookup/{search}": { - "get": { - "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string", - "operationId": "getLocationByZipCityState", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested list of city, state, county, and postal code matches", - "schema": { - "$ref": "#/definitions/VLocations" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/application_parameters/{parameterName}": { - "get": { - "description": "Searches for an application parameter by name, returns nil if not found", - "tags": [ - "application_parameters" - ], - "summary": "Searches for an application parameter by name, returns nil if not found", - "operationId": "getParam", - "parameters": [ - { - "type": "string", - "format": "string", - "description": "Parameter Name", - "name": "parameterName", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Application Parameters", - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - }, - "/calendar/{countryCode}/is-weekend-holiday/{date}": { - "get": { - "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", - "produces": [ - "application/json" - ], - "tags": [ - "calendar" - ], - "summary": "Validate move date selection", - "operationId": "isDateWeekendHoliday", - "parameters": [ - { - "enum": [ - "US" - ], - "type": "string", - "description": "country code for context of date", - "name": "countryCode", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date", - "description": "input date to determine if weekend/holiday for given country.", - "name": "date", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully determine if given date is weekend and/or holiday for given country.", - "schema": { - "$ref": "#/definitions/IsDateWeekendHolidayInfo" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/counseling/orders/{orderID}": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an order (performed by a services counselor)", - "operationId": "counselingUpdateOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CounselingUpdateOrderPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to update", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/counseling/orders/{orderID}/allowances": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an allowance (Orders with Entitlements)", - "operationId": "counselingUpdateAllowance", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CounselingUpdateAllowancePayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of allowance", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/customer": { - "post": { - "description": "Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Creates a customer with Okta option", - "operationId": "createCustomerWithOktaOption", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateCustomerPayload" - } - } - ], - "responses": { - "200": { - "description": "successfully created the customer", - "schema": { - "$ref": "#/definitions/CreatedCustomer" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/customer-support-remarks/{customerSupportRemarkID}": { - "delete": { - "description": "Soft deletes a customer support remark by ID", - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Soft deletes a customer support remark by ID", - "operationId": "deleteCustomerSupportRemark", - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Updates a customer support remark for a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Updates a customer support remark for a move", - "operationId": "updateCustomerSupportRemarkForMove", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCustomerSupportRemarkPayload" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated customer support remark", - "schema": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the customer support remark ID to be modified", - "name": "customerSupportRemarkID", - "in": "path", - "required": true - } - ] - }, - "/customer/search": { - "post": { - "description": "Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Search customers by DOD ID or customer name", - "operationId": "searchCustomers", - "parameters": [ - { - "description": "field that results should be sorted by", - "name": "body", - "in": "body", - "schema": { - "properties": { - "branch": { - "description": "Branch", - "type": "string", - "minLength": 1 - }, - "customerName": { - "description": "Customer Name", - "type": "string", - "minLength": 1, - "x-nullable": true - }, - "edipi": { - "description": "DOD ID", - "type": "string", - "maxLength": 10, - "minLength": 10, - "x-nullable": true - }, - "emplid": { - "description": "EMPLID", - "type": "string", - "maxLength": 7, - "minLength": 7, - "x-nullable": true - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "x-nullable": true - }, - "page": { - "description": "requested page of results", - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "sort": { - "type": "string", - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "personalEmail", - "telephone" - ], - "x-nullable": true - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully returned all customers matching the criteria", - "schema": { - "$ref": "#/definitions/SearchCustomersResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/customer/{customerID}": { - "get": { - "description": "Returns a given customer", - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Returns a given customer", - "operationId": "getCustomer", - "responses": { - "200": { - "description": "Successfully retrieved information on an individual customer", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Updates customer info by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customer" - ], - "summary": "Updates customer info", - "operationId": "updateCustomer", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateCustomerPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Customer" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.customer" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of customer to use", - "name": "customerID", - "in": "path", - "required": true - } - ] - }, - "/documents": { - "post": { - "description": "Documents represent a physical artifact such as a scanned document or a PDF file", - "tags": [ - "ghcDocuments" - ], - "summary": "Create a new document", - "operationId": "createDocument", - "parameters": [ - { - "name": "documentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDocumentPayload" - } - } - ], - "responses": { - "201": { - "description": "created document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/documents/{documentId}": { - "get": { - "description": "Returns a document and its uploads", - "tags": [ - "ghcDocuments" - ], - "summary": "Returns a document", - "operationId": "getDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to return", - "name": "documentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/evaluation-reports/{reportID}": { - "get": { - "description": "Gets an evaluation report by ID", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Gets an evaluation report by ID", - "operationId": "getEvaluationReport", - "responses": { - "200": { - "description": "Successfully got the report", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "put": { - "description": "Saves an evaluation report as a draft", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Saves an evaluation report as a draft", - "operationId": "saveEvaluationReport", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully saved the report" - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "delete": { - "description": "Deletes an evaluation report by ID", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Deletes an evaluation report by ID", - "operationId": "deleteEvaluationReport", - "responses": { - "204": { - "description": "Successfully deleted the report" - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "delete.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be modified", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/appeal/add": { - "post": { - "description": "Adds an appeal to a serious incident on an evaluation report", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Adds an appeal to a serious incident on an evaluation report", - "operationId": "addAppealToSeriousIncident", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateAppeal" - } - } - ], - "responses": { - "204": { - "description": "Successfully added an appeal to a serious incident" - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/download": { - "get": { - "description": "Downloads an evaluation report as a PDF", - "produces": [ - "application/pdf" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Downloads an evaluation report as a PDF", - "operationId": "downloadEvaluationReport", - "responses": { - "200": { - "description": "Evaluation report PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be downloaded", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/submit": { - "post": { - "description": "Submits an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Submits an evaluation report", - "operationId": "submitEvaluationReport", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully submitted an evaluation report with the provided ID" - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID to be modified", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": { - "post": { - "description": "Adds an appeal to a violation", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Adds an appeal to a violation", - "operationId": "addAppealToViolation", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateAppeal" - } - } - ], - "responses": { - "204": { - "description": "Successfully added an appeal to a violation" - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID", - "name": "reportID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "the report violation ID", - "name": "reportViolationID", - "in": "path", - "required": true - } - ] - }, - "/lines-of-accounting": { - "post": { - "description": "Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "linesOfAccounting" - ], - "summary": "Fetch line of accounting", - "operationId": "requestLineOfAccounting", - "parameters": [ - { - "description": "Service member affiliation, effective date, and TAC code.", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/FetchLineOfAccountingPayload" - } - } - ], - "responses": { - "200": { - "description": "Successfully retrieved line of accounting", - "schema": { - "$ref": "#/definitions/LineOfAccounting" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}": { - "get": { - "description": "Gets a move", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Gets a move by ID", - "operationId": "getMoveTaskOrder", - "responses": { - "200": { - "description": "Successfully retrieved move task order", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": { - "patch": { - "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "operationId": "updateMTOReviewedBillableWeightsAt", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order billableWeightsReviewedAt field", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/entitlements": { - "get": { - "description": "Gets entitlements", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Gets entitlements for a move by ID", - "operationId": "getEntitlements", - "responses": { - "200": { - "description": "Successfully retrieved entitlements", - "schema": { - "$ref": "#/definitions/Entitlements" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status": { - "patch": { - "description": "Changes the status of a line item for a move by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentServiceItem" - ], - "summary": "Change the status of a payment service item for a move by ID", - "operationId": "updatePaymentServiceItemStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated status for a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.paymentServiceItemStatus" - ] - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of payment service item to use", - "name": "paymentServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": { - "get": { - "description": "Gets a line item by ID for a move by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Gets a line item by ID for a move by ID", - "operationId": "getMTOServiceItem", - "responses": { - "200": { - "description": "Successfully retrieved a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/MTOServiceItemSingle" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of line item to use", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": { - "patch": { - "description": "Changes the status of a line item for a move by ID", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Change the status of a line item for a move by ID", - "operationId": "updateMTOServiceItemStatus", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchMTOServiceItemStatusPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated status for a line item for a move task order by ID", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.MTOServiceItem" - ] - }, - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "ID of line item to use", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/status": { - "patch": { - "description": "Changes move task order status to make it available to prime", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Change the status of a move task order to make it available to prime", - "operationId": "updateMoveTaskOrderStatus", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "serviceItemCodes", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOApprovalServiceItemCodes" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order status", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.move", - "create.serviceItem" - ] - } - }, - "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": { - "patch": { - "description": "Changes move (move task order) status to service counseling completed", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Changes move (move task order) status to service counseling completed", - "operationId": "updateMTOStatusServiceCounselingCompleted", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order status", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/tio-remarks": { - "patch": { - "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "operationId": "updateMoveTIORemarks", - "parameters": [ - { - "type": "string", - "description": "ID of move to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Move" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order tioRemarks field", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move/{locator}": { - "get": { - "description": "Returns a given move for a unique alphanumeric locator string", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns a given move", - "operationId": "getMove", - "responses": { - "200": { - "description": "Successfully retrieved the individual move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "Code used to identify a move in the system", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/move/{locator}/history": { - "get": { - "description": "Returns the history for a given move for a unique alphanumeric locator string", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns the history of an identified move", - "operationId": "getMoveHistory", - "parameters": [ - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved the individual move history", - "schema": { - "$ref": "#/definitions/MoveHistoryResult" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "Code used to identify a move in the system", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_service_items": { - "get": { - "description": "Gets all line items for a move", - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Gets all line items for a move", - "operationId": "listMTOServiceItems", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/MTOServiceItems" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move for mto service item to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments": { - "get": { - "description": "Gets all shipments for a move task order", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Gets all shipments for a move task order", - "operationId": "listMTOShipments", - "responses": { - "200": { - "description": "Successfully retrieved all mto shipments for a move task order", - "schema": { - "$ref": "#/definitions/MTOShipments" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": { - "patch": { - "description": "Updates a specified MTO shipment.\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* No fields required in body\nOptional fields include:\n* New shipment status type\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Secondary Pick-up Address\n* SecondaryDelivery Address\n* Delivery Address Type\n* Customer Remarks\n* Counselor Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the MTO Shipment to update", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the specified MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": { - "get": { - "description": "Fetches a list of agents associated with a move task order.", - "produces": [ - "application/json" - ], - "tags": [ - "mtoAgent" - ], - "summary": "Fetch move task order agents.", - "operationId": "fetchMTOAgentList", - "responses": { - "200": { - "description": "Successfully retrieved all agents for a move task order", - "schema": { - "$ref": "#/definitions/MTOAgents" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/moves/search": { - "post": { - "description": "Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Search moves by locator, DOD ID, or customer name", - "operationId": "searchMoves", - "parameters": [ - { - "description": "field that results should be sorted by", - "name": "body", - "in": "body", - "schema": { - "properties": { - "branch": { - "type": "string", - "x-nullable": true - }, - "customerName": { - "description": "Customer Name", - "type": "string", - "minLength": 1, - "x-nullable": true - }, - "deliveryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "destinationPostalCode": { - "type": "string", - "x-nullable": true - }, - "edipi": { - "description": "DOD ID", - "type": "string", - "maxLength": 10, - "minLength": 10, - "x-nullable": true - }, - "emplid": { - "description": "EMPLID", - "type": "string", - "maxLength": 7, - "minLength": 7, - "x-nullable": true - }, - "locator": { - "description": "Move locator", - "type": "string", - "maxLength": 6, - "minLength": 6, - "x-nullable": true - }, - "order": { - "type": "string", - "enum": [ - "asc", - "desc" - ], - "x-nullable": true - }, - "originPostalCode": { - "type": "string", - "x-nullable": true - }, - "page": { - "description": "requested page of results", - "type": "integer" - }, - "paymentRequestCode": { - "type": "string", - "x-nullable": true, - "example": "9551-6199-2" - }, - "perPage": { - "type": "integer" - }, - "pickupDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer", - "x-nullable": true - }, - "sort": { - "type": "string", - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "originPostalCode", - "destinationPostalCode", - "shipmentsCount" - ], - "x-nullable": true - }, - "status": { - "description": "Filtering for the status.", - "type": "array", - "uniqueItems": true, - "items": { - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVALS REQUESTED", - "APPROVED", - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED", - "CANCELED" - ] - } - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/SearchMovesResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/moves/{locator}/closeout-office": { - "patch": { - "description": "Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Updates a Move's PPM closeout office for Army and Air Force customers", - "operationId": "updateCloseoutOffice", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "closeoutOfficeId" - ], - "properties": { - "closeoutOfficeId": { - "type": "string", - "format": "uuid" - } - } - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully set the closeout office for the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.closeoutOffice" - ] - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/customer-support-remarks": { - "get": { - "description": "Fetches customer support remarks for a move", - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Fetches customer support remarks using the move code (locator).", - "operationId": "getCustomerSupportRemarksForMove", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/CustomerSupportRemarks" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "post": { - "description": "Creates a customer support remark for a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "customerSupportRemarks" - ], - "summary": "Creates a customer support remark for a move", - "operationId": "createCustomerSupportRemarkForMove", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateCustomerSupportRemark" - } - } - ], - "responses": { - "200": { - "description": "Successfully created customer support remark", - "schema": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move for customer support remarks", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/evaluation-reports": { - "post": { - "description": "Creates an evaluation report", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "evaluationReports" - ], - "summary": "Creates an evaluation report", - "operationId": "createEvaluationReport", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateEvaluationReport" - } - } - ], - "responses": { - "200": { - "description": "Successfully created evaluation report", - "schema": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.evaluationReport" - ] - }, - "parameters": [ - { - "type": "string", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{locator}/payment-requests": { - "get": { - "description": "Fetches payment requests for a move", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Fetches payment requests using the move code (locator).", - "operationId": "getPaymentRequestsForMove", - "responses": { - "200": { - "description": "Successfully retrieved all line items for a move task order", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "read.paymentRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "string", - "description": "move code to identify a move for payment requests", - "name": "locator", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/assignOfficeUser": { - "patch": { - "description": "assigns either a services counselor, task ordering officer, or task invoicing officer to the move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "updateAssignedOfficeUser", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/AssignOfficeUserBody" - } - } - ], - "responses": { - "200": { - "description": "Successfully assigned office user to the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/cancel": { - "post": { - "description": "cancels a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Cancels a move", - "operationId": "moveCanceler", - "responses": { - "200": { - "description": "Successfully canceled move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.cancelMoveFlag" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/counseling-evaluation-reports-list": { - "get": { - "description": "Returns counseling evaluation reports for the specified move that are visible to the current office user", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns counseling evaluation reports for the specified move that are visible to the current office user", - "operationId": "getMoveCounselingEvaluationReportsList", - "responses": { - "200": { - "description": "Successfully retrieved the move's evaluation reports", - "schema": { - "$ref": "#/definitions/EvaluationReportList" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Code used to identify a move in the system", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/financial-review-flag": { - "post": { - "description": "This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Flags a move for financial office review", - "operationId": "setFinancialReviewFlag", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header" - }, - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "flagForReview" - ], - "properties": { - "flagForReview": { - "description": "boolean value representing whether we should flag a move for financial review", - "type": "boolean", - "example": false - }, - "remarks": { - "description": "explanation of why the move is being flagged for financial review", - "type": "string", - "x-nullable": true, - "example": "this address is way too far away" - } - } - } - } - ], - "responses": { - "200": { - "description": "updated Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.financialReviewFlag" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move to flag", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/shipment-evaluation-reports-list": { - "get": { - "description": "Returns shipment evaluation reports for the specified move that are visible to the current office user", - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "summary": "Returns shipment evaluation reports for the specified move that are visible to the current office user", - "operationId": "getMoveShipmentEvaluationReportsList", - "responses": { - "200": { - "description": "Successfully retrieved the move's evaluation reports", - "schema": { - "$ref": "#/definitions/EvaluationReportList" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Code used to identify a move in the system", - "name": "moveID", - "in": "path", - "required": true - } - ] - }, - "/moves/{moveID}/unassignOfficeUser": { - "patch": { - "description": "unassigns either a services counselor, task ordering officer, or task invoicing officer from the move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "deleteAssignedOfficeUser", - "responses": { - "200": { - "description": "Successfully unassigned office user from the move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move", - "name": "moveID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "required": [ - "roleType" - ], - "properties": { - "roleType": { - "type": "string" - } - } - } - } - ] - }, - "/moves/{moveID}/uploadAdditionalDocuments": { - "patch": { - "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "move" - ], - "summary": "Patch the additional documents for a given move", - "operationId": "uploadAdditionalDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "moveID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - }, - "x-permissions": [ - "create.supportingDocuments" - ] - } - }, - "/moves/{officeUserID}/CheckForLockedMovesAndUnlock": { - "patch": { - "description": "Finds and unlocks any locked moves by an office user", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "move" - ], - "operationId": "checkForLockedMovesAndUnlock", - "responses": { - "200": { - "description": "Successfully unlocked officer's move(s).", - "schema": { - "type": "object", - "properties": { - "successMessage": { - "type": "string", - "example": "OK" - } - } - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the move's officer", - "name": "officeUserID", - "in": "path", - "required": true - } - ] - }, - "/mto-shipments": { - "post": { - "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Releasing / Receiving agents\nOptional fields include:\n* Delivery Address Type\n* Customer Remarks\n* Releasing / Receiving agents\n* An array of optional accessorial service item codes\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/open/requested-office-users": { - "post": { - "description": "This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account.\nRequest the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an \"OR\" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "officeUsers" - ], - "summary": "Create an Office User", - "operationId": "createRequestedOfficeUser", - "parameters": [ - { - "description": "Office User information", - "name": "officeUser", - "in": "body", - "schema": { - "$ref": "#/definitions/OfficeUserCreate" - } - } - ], - "responses": { - "201": { - "description": "successfully requested the creation of provided office user", - "schema": { - "$ref": "#/definitions/OfficeUser" - } - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/open/transportation-offices": { - "get": { - "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns the transportation offices matching the search query", - "operationId": "getTransportationOfficesOpen", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/orders": { - "post": { - "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Creates an orders model for a logged-in user", - "operationId": "createOrder", - "parameters": [ - { - "name": "createOrders", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateOrders" - } - } - ], - "responses": { - "200": { - "description": "created instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{orderID}": { - "get": { - "description": "Gets an order", - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Gets an order by ID", - "operationId": "getOrder", - "responses": { - "200": { - "description": "Successfully retrieved order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an order", - "operationId": "updateOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOrderPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.orders" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/acknowledge-excess-weight-risk": { - "post": { - "description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", - "operationId": "acknowledgeExcessWeightRisk", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated Move", - "schema": { - "$ref": "#/definitions/Move" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.excessWeightRisk" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/allowances": { - "patch": { - "description": "All fields sent in this request will be set on the order referenced", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates an allowance (Orders with Entitlements)", - "operationId": "updateAllowance", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateAllowancePayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of allowance", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.allowances" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/update-billable-weight": { - "patch": { - "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements=", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates the max billable weight", - "operationId": "updateBillableWeight", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateBillableWeightPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated Order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.billableWeight" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/update-max-billable-weight/tio": { - "patch": { - "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "order" - ], - "summary": "Updates the max billable weight with TIO remarks", - "operationId": "updateMaxBillableWeightAsTIO", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMaxBillableWeightAsTIOPayload" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated Order", - "schema": { - "$ref": "#/definitions/Order" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.maxBillableWeight" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of order to use", - "name": "orderID", - "in": "path", - "required": true - } - ] - }, - "/orders/{orderID}/upload_amended_orders": { - "post": { - "description": "Create an amended order for a given order", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "order" - ], - "summary": "Create an amended order for a given order", - "operationId": "uploadAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "orderID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/payment-requests/{paymentRequestID}": { - "get": { - "description": "Fetches an instance of a payment request by id", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Fetches a payment request by id", - "operationId": "getPaymentRequest", - "responses": { - "200": { - "description": "fetched instance of payment request", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "read.paymentRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/bulkDownload": { - "get": { - "description": "This endpoint downloads all uploaded payment request documentation combined into a single PDF.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Downloads all Payment Request documents as a PDF", - "operationId": "bulkDownload", - "responses": { - "200": { - "description": "Payment Request Files PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the payment-request with files to be downloaded", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": { - "get": { - "description": "Returns all shipment payment request SIT usage to support partial SIT invoicing", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Returns all shipment payment request SIT usage to support partial SIT invoicing", - "operationId": "getShipmentsPaymentSITBalance", - "responses": { - "200": { - "description": "Successfully retrieved shipments and their SIT days balance from all payment requests on the move", - "schema": { - "$ref": "#/definitions/ShipmentsPaymentSITBalance" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "read.shipmentsPaymentSITBalance" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "payment request ID of the payment request with SIT service items being reviewed", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/status": { - "patch": { - "description": "Updates status of a payment request by id", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequests" - ], - "summary": "Updates status of a payment request by id", - "operationId": "updatePaymentRequestStatus", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request", - "name": "paymentRequestID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePaymentRequestStatusPayload" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "updated payment request", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.paymentRequest" - ] - } - }, - "/ppm-shipments/{ppmShipmentId}/actual-weight": { - "get": { - "description": "Retrieves the actual weight for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the actual weight for a PPM shipment", - "operationId": "getPPMActualWeight", - "responses": { - "200": { - "description": "Returns actual weight for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMActualWeight" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/aoa-packet": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Downloads AOA Packet form PPMShipment as a PDF", - "operationId": "showAOAPacket", - "responses": { - "200": { - "description": "AOA PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the ppmshipment with aoa to be downloaded", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/closeout": { - "get": { - "description": "Retrieves the closeout calculations for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the closeout calcuations for the specified PPM shipment", - "operationId": "getPPMCloseout", - "responses": { - "200": { - "description": "Returns closeout for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMCloseout" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/finish-document-review": { - "patch": { - "description": "Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a PPM shipment's status after document review", - "operationId": "finishDocumentReview", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully finished document review", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { - "patch": { - "description": "Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are\neditable because some have to be set by the customer, e.g. the description and the moving expense type.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates the moving expense", - "operationId": "updateMovingExpense", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "updateMovingExpense", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMovingExpense" - } - } - ], - "responses": { - "200": { - "description": "returns an updated moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/payment-packet": { - "get": { - "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Returns PPM payment packet", - "operationId": "showPaymentPacket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppmShipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "PPM Payment Packet PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/ppm-sit": { - "patch": { - "description": "Updates a PPM shipment's SIT values\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a PPM shipment's SIT values", - "operationId": "updatePPMSIT", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/PPMShipmentSIT" - } - } - ], - "responses": { - "200": { - "description": "Successfully finished PPM SIT update", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { - "patch": { - "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a pro-gear weight ticket", - "operationId": "updateProGearWeightTicket", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "updateProGearWeightTicket", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateProGearWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost": { - "get": { - "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Get the SIT estimated cost for a PPM shipment", - "operationId": "getPPMSITEstimatedCost", - "responses": { - "200": { - "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMSITEstimatedCost" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "enum": [ - "ORIGIN", - "DESTINATION" - ], - "type": "string", - "format": "string", - "description": "location of sit", - "name": "sitLocation", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Date entered into SIT", - "name": "sitEntryDate", - "in": "query", - "required": true - }, - { - "type": "string", - "format": "date-time", - "description": "Date departed SIT", - "name": "sitDepartureDate", - "in": "query", - "required": true - }, - { - "minimum": 0, - "type": "integer", - "description": "Weight stored in SIT", - "name": "weightStored", - "in": "query", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { - "patch": { - "description": "Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's\nfields are editable because some have to be set by the customer, e.g. vehicle description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a weight ticket document", - "operationId": "updateWeightTicket", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "updateWeightTicketPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - } - ] - }, - "/pws-violations": { - "get": { - "description": "Fetch the possible PWS violations for an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "pwsViolations" - ], - "summary": "Fetch the possible PWS violations for an evaluation report", - "operationId": "getPWSViolations", - "responses": { - "200": { - "description": "Successfully retrieved the PWS violations", - "schema": { - "$ref": "#/definitions/PWSViolations" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/bulk-assignment": { - "get": { - "description": "Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets data for bulk assignment modal", - "operationId": "getBulkAssignmentData", - "parameters": [ - { - "enum": [ - "COUNSELING", - "CLOSEOUT", - "TASK_ORDER", - "PAYMENT_REQUEST" - ], - "type": "string", - "description": "A string corresponding to the queue type", - "name": "queueType", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned bulk assignment data", - "schema": { - "$ref": "#/definitions/BulkAssignmentData" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/counseling": { - "get": { - "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all customer moves needing services counseling by GBLOC origin", - "operationId": "getServicesCounselingQueue", - "parameters": [ - { - "type": "integer", - "description": "requested page number of paginated move results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "maximum number of moves to show on each page of paginated results", - "name": "perPage", - "in": "query" - }, - { - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "requestedMoveDate", - "submittedAt", - "originGBLOC", - "originDutyLocation", - "destinationDutyLocation", - "ppmType", - "closeoutInitiated", - "closeoutLocation", - "ppmStatus", - "counselingOffice", - "assignedTo" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "string", - "description": "filters by the branch of the move's service member", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique move code locator", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "description": "filters using a prefix match on the service member's last name", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique service member's DoD ID", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "description": "filters to match the unique service member's EMPLID", - "name": "emplid", - "in": "query" - }, - { - "type": "string", - "description": "filters the requested pickup date of a shipment on the move", - "name": "requestedMoveDate", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Start of the submitted at date in the user's local time zone converted to UTC", - "name": "submittedAt", - "in": "query" - }, - { - "type": "string", - "description": "filters the GBLOC of the service member's origin duty location", - "name": "originGBLOC", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "description": "filters the name of the origin duty location on the orders", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "description": "filters the name of the destination duty location on the orders", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED" - ], - "type": "string" - }, - "description": "filters the status of the move", - "name": "status", - "in": "query" - }, - { - "type": "boolean", - "description": "Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves.", - "name": "needsPPMCloseout", - "in": "query" - }, - { - "enum": [ - "FULL", - "PARTIAL" - ], - "type": "string", - "description": "filters PPM type", - "name": "ppmType", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Latest date that closeout was initiated on a PPM on the move", - "name": "closeoutInitiated", - "in": "query" - }, - { - "type": "string", - "description": "closeout location", - "name": "closeoutLocation", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "enum": [ - "WAITING_ON_CUSTOMER", - "NEEDS_CLOSEOUT" - ], - "type": "string", - "description": "filters the status of the PPM shipment", - "name": "ppmStatus", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this payment request.\n", - "name": "assignedTo", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueueMovesResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/counseling/origin-list": { - "get": { - "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all moves origin locations in the counselors queue", - "operationId": "getServicesCounselingOriginList", - "parameters": [ - { - "type": "boolean", - "description": "Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations.", - "name": "needsPPMCloseout", - "in": "query" - }, - { - "type": "string", - "description": "Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.", - "name": "viewAsGBLOC", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/Locations" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/moves": { - "get": { - "description": "An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all customer moves by GBLOC origin", - "operationId": "getMovesQueue", - "parameters": [ - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - }, - { - "enum": [ - "customerName", - "edipi", - "emplid", - "branch", - "locator", - "status", - "originDutyLocation", - "destinationDutyLocation", - "requestedMoveDate", - "appearedInTooAt", - "assignedTo", - "counselingOffice" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "string", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "name": "emplid", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "type": "string" - }, - "collectionFormat": "multi", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "name": "appearedInTooAt", - "in": "query" - }, - { - "type": "string", - "description": "filters the requested pickup date of a shipment on the move", - "name": "requestedMoveDate", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "SUBMITTED", - "SERVICE COUNSELING COMPLETED", - "APPROVALS REQUESTED" - ], - "type": "string" - }, - "description": "Filtering for the status.", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this move.\n", - "name": "assignedTo", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueueMovesResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/payment-requests": { - "get": { - "description": "An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets queued list of all payment requests by GBLOC origin", - "operationId": "getPaymentRequestsQueue", - "parameters": [ - { - "enum": [ - "customerName", - "locator", - "submittedAt", - "branch", - "status", - "edipi", - "emplid", - "age", - "originDutyLocation", - "assignedTo", - "counselingOffice" - ], - "type": "string", - "description": "field that results should be sorted by", - "name": "sort", - "in": "query" - }, - { - "enum": [ - "asc", - "desc" - ], - "type": "string", - "description": "direction of sort order if applied", - "name": "order", - "in": "query" - }, - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "number of records to include per page", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "format": "date-time", - "description": "Start of the submitted at date in the user's local time zone converted to UTC", - "name": "submittedAt", - "in": "query" - }, - { - "type": "string", - "name": "branch", - "in": "query" - }, - { - "type": "string", - "name": "locator", - "in": "query" - }, - { - "type": "string", - "name": "customerName", - "in": "query" - }, - { - "type": "string", - "name": "edipi", - "in": "query" - }, - { - "type": "string", - "name": "emplid", - "in": "query" - }, - { - "type": "string", - "name": "destinationDutyLocation", - "in": "query" - }, - { - "type": "string", - "name": "originDutyLocation", - "in": "query" - }, - { - "type": "string", - "description": "Used to illustrate which user is assigned to this payment request.\n", - "name": "assignedTo", - "in": "query" - }, - { - "type": "string", - "description": "filters using a counselingOffice name of the move", - "name": "counselingOffice", - "in": "query" - }, - { - "uniqueItems": true, - "type": "array", - "items": { - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "PAID", - "DEPRECATED", - "EDI_ERROR" - ], - "type": "string" - }, - "description": "Filtering for the status.", - "name": "status", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - }, - { - "type": "string", - "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", - "name": "viewAsGBLOC", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully returned all moves matching the criteria", - "schema": { - "$ref": "#/definitions/QueuePaymentRequestsResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/prime-moves": { - "get": { - "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "getPrimeMovesQueue", - "operationId": "listPrimeMoves", - "parameters": [ - { - "type": "string", - "format": "date-time", - "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", - "name": "since", - "in": "query" - }, - { - "type": "integer", - "description": "requested page of results", - "name": "page", - "in": "query" - }, - { - "type": "integer", - "description": "results per page", - "name": "perPage", - "in": "query" - }, - { - "type": "string", - "name": "id", - "in": "query" - }, - { - "type": "string", - "name": "moveCode", - "in": "query" - }, - { - "type": "string", - "description": "order type", - "name": "orderType", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/ListPrimeMovesResult" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/re-service-items": { - "get": { - "description": "Get ReServiceItems", - "produces": [ - "application/json" - ], - "tags": [ - "reServiceItems" - ], - "summary": "Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved)", - "operationId": "getAllReServiceItems", - "responses": { - "200": { - "description": "Successfully retrieved all ReServiceItems.", - "schema": { - "$ref": "#/definitions/ReServiceItems" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/report-violations/{reportID}": { - "get": { - "description": "Fetch the report violations for an evaluation report", - "produces": [ - "application/json" - ], - "tags": [ - "reportViolations" - ], - "summary": "Fetch the report violations for an evaluation report", - "operationId": "getReportViolationsByReportID", - "responses": { - "200": { - "description": "Successfully retrieved the report violations", - "schema": { - "$ref": "#/definitions/ReportViolations" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "post": { - "description": "Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "reportViolations" - ], - "summary": "Associate violations with an evaluation report", - "operationId": "associateReportViolations", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/AssociateReportViolations" - } - } - ], - "responses": { - "204": { - "description": "Successfully saved the report violations" - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.reportViolation" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "the evaluation report ID that has associated violations", - "name": "reportID", - "in": "path", - "required": true - } - ] - }, - "/service-item/{mtoServiceItemID}/entry-date-update": { - "patch": { - "description": "Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "Updates a service item's SIT entry date by ID", - "operationId": "updateServiceItemSitEntryDate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ServiceItemSitEntryDate" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated SIT entry date", - "schema": { - "$ref": "#/definitions/MTOServiceItemSingle" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of the service item", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}": { - "get": { - "description": "fetches a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "fetches a shipment by ID", - "operationId": "getShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be fetched", - "name": "shipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully fetched the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "delete": { - "description": "Soft deletes a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Soft deletes a shipment by ID", - "operationId": "deleteShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be deleted", - "name": "shipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/shipments/{shipmentID}/approve": { - "post": { - "description": "Approves a shipment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Approves a shipment", - "operationId": "approveShipment", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/approve-diversion": { - "post": { - "description": "Approves a shipment diversion", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Approves a shipment diversion", - "operationId": "approveShipmentDiversion", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved the shipment diversion", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.shipment" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/ppm-documents": { - "get": { - "description": "Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This\nexcludes any deleted PPM documents.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Gets all the PPM documents for a PPM shipment", - "operationId": "getPPMDocuments", - "responses": { - "200": { - "description": "All PPM documents and associated uploads for the specified PPM shipment.", - "schema": { - "$ref": "#/definitions/PPMDocuments" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/reject": { - "post": { - "description": "rejects a shipment", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "rejects a shipment", - "operationId": "rejectShipment", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RejectShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully rejected the shipment", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-cancellation": { - "post": { - "description": "Requests a shipment cancellation", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Requests a shipment cancellation", - "operationId": "requestShipmentCancellation", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully requested the shipment cancellation", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.shipmentCancellation" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-diversion": { - "post": { - "description": "Requests a shipment diversion", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Requests a shipment diversion", - "operationId": "requestShipmentDiversion", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/RequestDiversion" - } - } - ], - "responses": { - "200": { - "description": "Successfully requested the shipment diversion", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.shipmentDiversionRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/request-reweigh": { - "post": { - "description": "Requests a shipment reweigh", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "reweigh" - ], - "summary": "Requests a shipment reweigh", - "operationId": "requestShipmentReweigh", - "responses": { - "200": { - "description": "Successfully requested a reweigh of the shipment", - "schema": { - "$ref": "#/definitions/Reweigh" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.reweighRequest" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/review-shipment-address-update": { - "patch": { - "description": "This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment" - ], - "summary": "Allows TOO to review a shipment address update", - "operationId": "reviewShipmentAddressUpdate", - "parameters": [ - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "required": [ - "officeRemarks", - "status" - ], - "properties": { - "officeRemarks": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "REJECTED", - "APPROVED" - ] - } - } - } - } - ], - "responses": { - "200": { - "description": "Successfully requested a shipment address update", - "schema": { - "$ref": "#/definitions/ShipmentAddressUpdate" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-extensions": { - "post": { - "description": "TOO can creates an already-approved SIT Duration Update on behalf of a customer", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Create an approved SIT Duration Update", - "operationId": "createApprovedSITDurationUpdate", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateApprovedSITDurationUpdate" - } - }, - { - "type": "string", - "description": "We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully created a SIT Extension.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "create.SITExtension" - ] - } - }, - "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": { - "patch": { - "description": "Approves a SIT extension", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Approves a SIT extension", - "operationId": "approveSITExtension", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApproveSITExtension" - } - }, - { - "type": "string", - "description": "We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully approved a SIT extension", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.SITExtension" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the SIT extension", - "name": "sitExtensionID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": { - "patch": { - "description": "Denies a SIT extension", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "sitExtension" - ], - "summary": "Denies a SIT extension", - "operationId": "denySITExtension", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/DenySITExtension" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully denied a SIT extension", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.SITExtension" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the SIT extension", - "name": "sitExtensionID", - "in": "path", - "required": true - } - ] - }, - "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": { - "patch": { - "description": "Converts a SIT to customer expense", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "shipment", - "mtoServiceItem" - ], - "summary": "Converts a SIT to customer expense", - "operationId": "updateSITServiceItemCustomerExpense", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateSITServiceItemCustomerExpense" - } - }, - { - "type": "string", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully converted to customer expense", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "409": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "412": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - }, - "x-permissions": [ - "update.MTOServiceItem" - ] - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment", - "name": "shipmentID", - "in": "path", - "required": true - } - ] - }, - "/tac/valid": { - "get": { - "description": "Returns a boolean based on whether a tac value is valid or not", - "tags": [ - "tac", - "order" - ], - "summary": "Validation of a TAC value", - "operationId": "tacValidation", - "parameters": [ - { - "type": "string", - "description": "The tac value to validate", - "name": "tac", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved validation status", - "schema": { - "$ref": "#/definitions/TacValid" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/transportation-offices": { - "get": { - "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", - "operationId": "getTransportationOffices", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/transportation-offices/gblocs": { - "get": { - "description": "Returns a list of distinct GBLOCs that exist in the transportation offices table", - "produces": [ - "application/json" - ], - "tags": [ - "transportationOffice" - ], - "summary": "Returns a list of distinct GBLOCs that exist in the transportation offices table", - "operationId": "getTransportationOfficesGBLOCs", - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/GBLOCs" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Create a new upload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query" - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/get/": { - "get": { - "description": "Gets an upload", - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Gets an upload by ID", - "operationId": "getUpload", - "responses": { - "200": { - "description": "Successfully retrieved upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "403": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/uploads/{uploadID}": { - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes an upload", - "operationId": "deleteUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be deleted", - "name": "uploadID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the order that the upload belongs to", - "name": "orderID", - "in": "query" - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadID}/update": { - "patch": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "uploads" - ], - "summary": "Update an existing upload. This is only needed currently for updating the image rotation.", - "operationId": "updateUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be updated", - "name": "uploadID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "properties": { - "rotation": { - "description": "The rotation of the image", - "type": "integer", - "maximum": 3, - "minimum": 0 - } - } - } - } - ], - "responses": { - "201": { - "description": "updated upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Affiliation": { - "description": "Military branch of service", - "type": "string", - "title": "Branch of service", - "enum": [ - "ARMY", - "NAVY", - "MARINES", - "AIR_FORCE", - "COAST_GUARD", - "SPACE_FORCE", - "OTHER" - ], - "x-display-value": { - "AIR_FORCE": "Air Force", - "ARMY": "Army", - "COAST_GUARD": "Coast Guard", - "MARINES": "Marine Corps", - "NAVY": "Navy", - "OTHER": "OTHER", - "SPACE_FORCE": "Space Force" - }, - "x-nullable": true - }, - "ApplicationParameters": { - "type": "object", - "properties": { - "parameterName": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "parameterValue": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "validationCode": { - "type": "string", - "format": "string", - "x-nullable": true - } - } - }, - "ApproveSITExtension": { - "required": [ - "approvedDays" - ], - "properties": { - "approvedDays": { - "description": "Number of days approved for SIT extension", - "type": "integer", - "minimum": 1, - "example": 21 - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT approval", - "type": "string", - "x-nullable": true, - "example": "Approved for three weeks rather than requested 45 days" - }, - "requestReason": { - "description": "Reason from service counselor-provided picklist for SIT Duration Update", - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ], - "example": "AWAITING_COMPLETION_OF_RESIDENCE" - } - } - }, - "AssignOfficeUserBody": { - "type": "object", - "required": [ - "officeUserId", - "roleType" - ], - "properties": { - "officeUserId": { - "type": "string", - "format": "uuid" - }, - "roleType": { - "type": "string" - } - } - }, - "AssignedOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "AssociateReportViolations": { - "description": "A list of PWS violation string ids to associate with an evaluation report", - "type": "object", - "properties": { - "violations": { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - } - } - } - }, - "AvailableOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "hasSafetyPrivilege": { - "type": "boolean" - }, - "lastName": { - "type": "string" - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "workload": { - "type": "integer" - } - } - }, - "AvailableOfficeUsers": { - "type": "array", - "items": { - "$ref": "#/definitions/AvailableOfficeUser" - } - }, - "BackupContact": { - "type": "object", - "required": [ - "name", - "email", - "phone" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "example": "backupContact@mail.com" - }, - "name": { - "type": "string" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - } - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "BulkAssignmentData": { - "type": "object", - "properties": { - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "bulkAssignmentMoveIDs": { - "$ref": "#/definitions/BulkAssignmentMoveIDs" - } - } - }, - "BulkAssignmentMoveID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "BulkAssignmentMoveIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/BulkAssignmentMoveID" - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "Contractor": { - "properties": { - "contractNumber": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "CounselingUpdateAllowancePayload": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "gunSafe": { - "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", - "type": "boolean", - "x-nullable": true - }, - "organizationalClothingAndIndividualEquipment": { - "description": "only for Army", - "type": "boolean", - "x-nullable": true - }, - "proGearWeight": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 2000, - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 500, - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "requiredMedicalEquipmentWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 0, - "x-formatting": "weight", - "example": 2000 - }, - "storageInTransit": { - "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", - "type": "integer", - "minimum": 0 - }, - "ubAllowance": { - "type": "integer", - "x-nullable": true, - "example": 500 - } - } - }, - "CounselingUpdateOrderPayload": { - "type": "object", - "required": [ - "issueDate", - "reportByDate", - "ordersType", - "originDutyLocationId", - "newDutyLocationId" - ], - "properties": { - "departmentIndicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ntsSac": { - "title": "NTS SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "title": "NTS TAC", - "maxLength": 4, - "minLength": 4, - "$ref": "#/definitions/NullableString", - "example": "F8J1" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "title": "HHG SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "tac": { - "type": "string", - "title": "HHG TAC", - "maxLength": 4, - "minLength": 4, - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreateAppeal": { - "description": "Appeal status and remarks left for a violation, created by a GSR user.", - "type": "object", - "properties": { - "appealStatus": { - "description": "The status of the appeal set by the GSR user", - "type": "string", - "enum": [ - "sustained", - "rejected" - ], - "example": "These are my violation appeal remarks" - }, - "remarks": { - "description": "Remarks left by the GSR user", - "type": "string", - "example": "These are my violation appeal remarks" - } - } - }, - "CreateApprovedSITDurationUpdate": { - "required": [ - "requestReason", - "approvedDays" - ], - "properties": { - "approvedDays": { - "description": "Number of days approved for SIT extension. This will match requested days saved to the SIT extension model.", - "type": "integer", - "example": 21 - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT Duration Update creation", - "type": "string", - "x-nullable": true, - "example": "Customer needs additional storage time as their new place of residence is not yet ready" - }, - "requestReason": { - "description": "Reason from service counselor-provided picklist for SIT Duration Update", - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ], - "example": "AWAITING_COMPLETION_OF_RESIDENCE" - } - } - }, - "CreateBoatShipment": { - "description": "Boat shipment information for the move.", - "required": [ - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateCustomerPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backupContact": { - "$ref": "#/definitions/BackupContact" - }, - "backupMailingAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "cacUser": { - "type": "boolean" - }, - "createOktaAccount": { - "type": "boolean" - }, - "edipi": { - "type": "string", - "maxLength": 10, - "x-nullable": false, - "example": "1234567890" - }, - "emailIsPreferred": { - "type": "boolean" - }, - "emplid": { - "type": "string", - "maxLength": 7, - "x-nullable": true, - "example": "9485155" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "middleName": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "personalEmail@email.com" - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "residentialAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "CreateCustomerSupportRemark": { - "description": "A text remark written by an customer support user that is associated with a specific move.", - "type": "object", - "required": [ - "content", - "officeUserID" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "CreateEvaluationReport": { - "description": "Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID.", - "type": "object", - "properties": { - "shipmentID": { - "description": "The shipment ID of the shipment to be evaluated in the report", - "type": "string", - "format": "uuid", - "example": "01b9671e-b268-4906-967b-ba661a1d3933" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "secondaryDeliveryAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "tertiaryDeliveryAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "usesExternalVendor": { - "type": "boolean", - "x-nullable": true, - "example": false - } - } - }, - "CreateMobileHomeShipment": { - "description": "A mobile home shipment that the prime moves for a service member.", - "required": [ - "make", - "model", - "year", - "lengthInInches", - "heightInInches", - "widthInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreateOrders": { - "type": "object", - "required": [ - "serviceMemberId", - "issueDate", - "reportByDate", - "ordersType", - "hasDependents", - "spouseHasProGear", - "newDutyLocationId" - ], - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "hasDependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "serviceMemberId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouseHasProGear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreatePPMShipment": { - "description": "A personally procured move is a type of shipment that a service members moves themselves.", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean" - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreatedCustomer": { - "type": "object", - "properties": { - "affiliation": { - "type": "string", - "title": "Branch of service customer is affilated with" - }, - "backupAddress": { - "$ref": "#/definitions/Address" - }, - "backupContact": { - "$ref": "#/definitions/BackupContact" - }, - "cacValidated": { - "type": "boolean" - }, - "edipi": { - "type": "string", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "middleName": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "oktaEmail": { - "type": "string" - }, - "oktaID": { - "type": "string" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "residentialAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Customer": { - "type": "object", - "properties": { - "agency": { - "type": "string", - "title": "Agency customer is affilated with" - }, - "backupAddress": { - "$ref": "#/definitions/Address" - }, - "backup_contact": { - "$ref": "#/definitions/BackupContact" - }, - "cacValidated": { - "type": "boolean", - "x-nullable": true - }, - "current_address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string" - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "first_name": { - "type": "string", - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "last_name": { - "type": "string", - "example": "Doe" - }, - "middle_name": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "CustomerContactType": { - "description": "Describes a customer contact type for a MTOServiceItem of type domestic destination SIT.", - "type": "string", - "enum": [ - "FIRST", - "SECOND" - ] - }, - "CustomerSupportRemark": { - "description": "A text remark written by an office user that is associated with a specific move.", - "type": "object", - "required": [ - "id", - "moveID", - "officeUserID", - "content" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeUserEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "readOnly": true - }, - "officeUserFirstName": { - "type": "string", - "readOnly": true, - "example": "Grace" - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeUserLastName": { - "type": "string", - "readOnly": true, - "example": "Griffin" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "CustomerSupportRemarks": { - "type": "array", - "items": { - "$ref": "#/definitions/CustomerSupportRemark" - } - }, - "DenySITExtension": { - "required": [ - "officeRemarks", - "convertToCustomerExpense" - ], - "properties": { - "convertToCustomerExpense": { - "description": "Whether or not to convert to members expense once SIT extension is denied.", - "type": "boolean", - "example": false - }, - "officeRemarks": { - "description": "Remarks from TOO about SIT denial", - "type": "string", - "x-nullable": true, - "example": "Denied this extension as it does not match the criteria" - } - } - }, - "DepartmentIndicator": { - "description": "Military branch of service indicator for orders", - "type": "string", - "title": "Department indicator", - "enum": [ - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "COAST_GUARD", - "NAVY_AND_MARINES", - "AIR_AND_SPACE_FORCE", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of Secretary of Defense" - }, - "x-nullable": true - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DimensionType": { - "description": "Describes a dimension type for a MTOServiceItemDimension.", - "type": "string", - "enum": [ - "ITEM", - "CRATE" - ] - }, - "Document": { - "type": "object", - "required": [ - "id", - "service_member_id", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "address_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "eTag": { - "type": "string" - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": true - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "x-nullable": true, - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "message" - ], - "properties": { - "message": { - "type": "string" - } - } - }, - "EvaluationReport": { - "description": "An evaluation report", - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string" - }, - "evalEnd": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "18:00" - }, - "evalStart": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "15:00" - }, - "gsrAppeals": { - "x-nullable": true, - "$ref": "#/definitions/GSRAppeals" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "inspectionDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "inspectionType": { - "x-nullable": true, - "$ref": "#/definitions/EvaluationReportInspectionType" - }, - "location": { - "x-nullable": true, - "$ref": "#/definitions/EvaluationReportLocation" - }, - "locationDescription": { - "type": "string", - "x-nullable": true, - "example": "Route 66 at crash inspection site 3" - }, - "moveID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveReferenceID": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "observedClaimsResponseDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupSpreadEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedPickupSpreadStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedShipmentDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "observedShipmentPhysicalPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "officeUser": { - "$ref": "#/definitions/EvaluationReportOfficeUser" - }, - "remarks": { - "type": "string", - "x-nullable": true - }, - "reportViolations": { - "x-nullable": true, - "$ref": "#/definitions/ReportViolations" - }, - "seriousIncident": { - "type": "boolean", - "x-nullable": true - }, - "seriousIncidentDesc": { - "type": "string", - "x-nullable": true - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "timeDepart": { - "type": "string", - "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", - "x-nullable": true, - "example": "14:30" - }, - "type": { - "$ref": "#/definitions/EvaluationReportType" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "violationsObserved": { - "type": "boolean", - "x-nullable": true - } - } - }, - "EvaluationReportInspectionType": { - "type": "string", - "enum": [ - "DATA_REVIEW", - "PHYSICAL", - "VIRTUAL" - ], - "x-nullable": true - }, - "EvaluationReportList": { - "type": "array", - "items": { - "$ref": "#/definitions/EvaluationReport" - } - }, - "EvaluationReportLocation": { - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION", - "OTHER" - ], - "x-nullable": true - }, - "EvaluationReportOfficeUser": { - "description": "The authoring office user for an evaluation report", - "type": "object", - "properties": { - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - } - }, - "readOnly": true - }, - "EvaluationReportType": { - "type": "string", - "enum": [ - "SHIPMENT", - "COUNSELING" - ] - }, - "FetchLineOfAccountingPayload": { - "type": "object", - "properties": { - "departmentIndicator": { - "$ref": "#/definitions/DepartmentIndicator" - }, - "effectiveDate": { - "description": "The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request).\n", - "type": "string", - "format": "date", - "example": "2023-01-01" - }, - "tacCode": { - "type": "string", - "maxLength": 4, - "minLength": 4, - "example": "F8J1" - } - } - }, - "GBLOC": { - "type": "string", - "enum": [ - "AGFM", - "APAT", - "BGAC", - "BGNC", - "BKAS", - "CFMQ", - "CLPK", - "CNNQ", - "DMAT", - "GSAT", - "HAFC", - "HBAT", - "JEAT", - "JENQ", - "KKFA", - "LHNQ", - "LKNQ", - "MAPK", - "MAPS", - "MBFL", - "MLNQ", - "XXXX" - ] - }, - "GBLOCs": { - "type": "array", - "items": { - "type": "string" - } - }, - "GSRAppeal": { - "description": "An object associating appeals on violations and serious incidents", - "type": "object", - "properties": { - "appealStatus": { - "$ref": "#/definitions/GSRAppealStatusType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isSeriousIncident": { - "type": "boolean", - "example": false - }, - "officeUser": { - "$ref": "#/definitions/EvaluationReportOfficeUser" - }, - "officeUserID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "remarks": { - "type": "string", - "example": "Office user remarks" - }, - "reportID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "violationID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "GSRAppealStatusType": { - "type": "string", - "enum": [ - "SUSTAINED", - "REJECTED" - ] - }, - "GSRAppeals": { - "type": "array", - "items": { - "$ref": "#/definitions/GSRAppeal" - } - }, - "Grade": { - "type": "string", - "title": "grade", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ], - "x-display-value": { - "ACADEMY_CADET": "Service Academy Cadet", - "AVIATION_CADET": "Aviation Cadet", - "CIVILIAN_EMPLOYEE": "Civilian Employee", - "E_1": "E-1", - "E_2": "E-2", - "E_3": "E-3", - "E_4": "E-4", - "E_5": "E-5", - "E_6": "E-6", - "E_7": "E-7", - "E_8": "E-8", - "E_9": "E-9", - "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", - "MIDSHIPMAN": "Midshipman", - "O_10": "O-10", - "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", - "O_2": "O-2", - "O_3": "O-3", - "O_4": "O-4", - "O_5": "O-5", - "O_6": "O-6", - "O_7": "O-7", - "O_8": "O-8", - "O_9": "O-9", - "W_1": "W-1", - "W_2": "W-2", - "W_3": "W-3", - "W_4": "W-4", - "W_5": "W-5" - }, - "x-nullable": true - }, - "InvalidRequestResponsePayload": { - "type": "object", - "properties": { - "errors": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "IsDateWeekendHolidayInfo": { - "type": "object", - "required": [ - "country_code", - "country_name", - "date", - "is_weekend", - "is_holiday" - ], - "properties": { - "country_code": { - "type": "string" - }, - "country_name": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - }, - "details": { - "type": "string" - }, - "is_holiday": { - "type": "boolean" - }, - "is_weekend": { - "type": "boolean" - } - } - }, - "LOAType": { - "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", - "type": "string", - "enum": [ - "HHG", - "NTS" - ], - "example": "HHG" - }, - "LOATypeNullable": { - "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", - "type": "string", - "enum": [ - "HHG", - "NTS" - ], - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - }, - "example": "HHG" - }, - "LineOfAccounting": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "example": "2023-08-03T19:17:10.050Z" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "06254fc3-b763-484c-b555-42855d1ad5cd" - }, - "loaActvtyID": { - "type": "string", - "maxLength": 11, - "x-nullable": true - }, - "loaAgncAcntngCd": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaAgncDsbrCd": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaAlltSnID": { - "type": "string", - "maxLength": 5, - "x-nullable": true, - "example": "123A" - }, - "loaBafID": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "1234" - }, - "loaBdgtAcntClsNm": { - "type": "string", - "maxLength": 8, - "x-nullable": true, - "example": "000000" - }, - "loaBetCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaBgFyTx": { - "type": "integer", - "x-nullable": true, - "example": 2006 - }, - "loaBgnDt": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2005-10-01" - }, - "loaBgtLnItmID": { - "type": "string", - "maxLength": 8, - "x-nullable": true - }, - "loaBgtRstrCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaBgtSubActCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaClsRefID": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaCstCd": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "loaCstCntrID": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "loaCustNm": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaDfAgncyAlctnRcpntID": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaDocID": { - "type": "string", - "maxLength": 15, - "x-nullable": true, - "example": "HHG12345678900" - }, - "loaDptID": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "1 " - }, - "loaDscTx": { - "type": "string", - "x-nullable": true, - "example": "PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER)" - }, - "loaDtlRmbsmtSrcID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaEndDt": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2015-10-01" - }, - "loaEndFyTx": { - "type": "integer", - "x-nullable": true, - "example": 2016 - }, - "loaFmsTrnsactnID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaFnclArID": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaFnctPrsNm": { - "type": "string", - "maxLength": 255, - "x-nullable": true - }, - "loaFndCntrID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaFndTyFgCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaHistStatCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaHsGdsCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "HT" - }, - "loaInstlAcntgActID": { - "type": "string", - "maxLength": 6, - "x-nullable": true, - "example": "12345" - }, - "loaJbOrdNm": { - "type": "string", - "maxLength": 10, - "x-nullable": true - }, - "loaLclInstlID": { - "type": "string", - "maxLength": 18, - "x-nullable": true - }, - "loaMajClmNm": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaMajRmbsmtSrcID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaObjClsID": { - "type": "string", - "maxLength": 6, - "x-nullable": true, - "example": "22NL" - }, - "loaOpAgncyID": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "1A" - }, - "loaPgmElmntID": { - "type": "string", - "maxLength": 12, - "x-nullable": true, - "example": "00000000" - }, - "loaPrjID": { - "type": "string", - "maxLength": 12, - "x-nullable": true - }, - "loaSbaltmtRcpntID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaScrtyCoopCustCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaScrtyCoopDsgntrCd": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaScrtyCoopImplAgncCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaScrtyCoopLnItmID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaSpclIntrID": { - "type": "string", - "maxLength": 2, - "x-nullable": true - }, - "loaSrvSrcID": { - "type": "string", - "maxLength": 1, - "x-nullable": true - }, - "loaStatCd": { - "type": "string", - "maxLength": 1, - "x-nullable": true, - "example": "U" - }, - "loaSubAcntID": { - "type": "string", - "maxLength": 3, - "x-nullable": true - }, - "loaSysId": { - "type": "string", - "maxLength": 20, - "x-nullable": true, - "example": "10003" - }, - "loaTnsfrDptNm": { - "type": "string", - "maxLength": 4, - "x-nullable": true - }, - "loaTrnsnID": { - "type": "string", - "maxLength": 3, - "x-nullable": true, - "example": "B1" - }, - "loaTrsySfxTx": { - "type": "string", - "maxLength": 4, - "x-nullable": true, - "example": "0000" - }, - "loaTskBdgtSblnTx": { - "type": "string", - "maxLength": 8, - "x-nullable": true - }, - "loaUic": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaWkCntrRcpntNm": { - "type": "string", - "maxLength": 6, - "x-nullable": true - }, - "loaWrkOrdID": { - "type": "string", - "maxLength": 16, - "x-nullable": true - }, - "orgGrpDfasCd": { - "type": "string", - "maxLength": 2, - "x-nullable": true, - "example": "ZZ" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "example": "2023-08-03T19:17:38.776Z" - }, - "validHhgProgramCodeForLoa": { - "type": "boolean", - "x-nullable": true - }, - "validLoaForTac": { - "type": "boolean", - "x-nullable": true - } - } - }, - "ListPrimeMove": { - "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "example": "AGFM" - }, - "destinationPostalCode": { - "type": "string", - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orderType": { - "type": "string" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ListPrimeMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/ListPrimeMove" - } - }, - "ListPrimeMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queueMoves": { - "$ref": "#/definitions/ListPrimeMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "Location": { - "type": "object", - "required": [ - "label", - "value" - ], - "properties": { - "label": { - "type": "string", - "example": "Label for display" - }, - "value": { - "type": "string", - "example": "Value for location" - } - } - }, - "Locations": { - "type": "array", - "items": { - "$ref": "#/definitions/Location" - } - }, - "LockedOfficeUser": { - "type": "object", - "properties": { - "firstName": { - "type": "string" - }, - "lastName": { - "type": "string" - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "type": "string", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ] - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOApprovalServiceItemCodes": { - "description": "MTO level service items to create when updating MTO status.", - "type": "object", - "properties": { - "serviceCodeCS": { - "type": "boolean", - "example": true - }, - "serviceCodeMS": { - "type": "boolean", - "example": true - } - } - }, - "MTOServiceItem": { - "type": "object", - "required": [ - "id", - "moveTaskOrderID", - "reServiceID", - "reServiceCode", - "reServiceName" - ], - "properties": { - "SITPostalCode": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "convertToCustomerExpense": { - "type": "boolean", - "x-omitempty": false, - "example": false - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "customerContacts": { - "$ref": "#/definitions/MTOServiceItemCustomerContacts" - }, - "customerExpenseReason": { - "type": "string", - "x-nullable": true - }, - "deletedAt": { - "type": "string", - "format": "date" - }, - "description": { - "type": "string", - "x-nullable": true - }, - "dimensions": { - "$ref": "#/definitions/MTOServiceItemDimensions" - }, - "eTag": { - "type": "string" - }, - "estimatedPrice": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "estimatedWeight": { - "description": "estimated weight of the shuttle service item provided by the prime", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "feeType": { - "type": "string", - "enum": [ - "COUNSELING", - "CRATING", - "TRUCKING", - "SHUTTLE" - ] - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "x-nullable": true, - "example": "CONUS" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupPostalCode": { - "type": "string", - "x-nullable": true - }, - "quantity": { - "type": "integer" - }, - "rate": { - "type": "integer" - }, - "reServiceCode": { - "type": "string" - }, - "reServiceID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "type": "string" - }, - "reason": { - "type": "string", - "x-nullable": true - }, - "rejectedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDeliveryMiles": { - "type": "integer", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitDestinationOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitOriginHHGActualAddress": { - "$ref": "#/definitions/Address" - }, - "sitOriginHHGOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - }, - "submittedAt": { - "type": "string", - "format": "date" - }, - "total": { - "type": "integer", - "format": "cents" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MTOServiceItemCustomerContact": { - "description": "Customer contact information for a destination SIT service item", - "type": "object", - "properties": { - "dateOfContact": { - "description": "Date of attempted contact by the prime.", - "type": "string", - "format": "date" - }, - "firstAvailableDeliveryDate": { - "description": "First available date that the Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "example": "2020-12-31" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "timeMilitary": { - "description": "Time of attempted contact by the prime.", - "type": "string", - "example": "0400Z" - }, - "type": { - "$ref": "#/definitions/CustomerContactType" - } - } - }, - "MTOServiceItemCustomerContacts": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItemCustomerContact" - } - }, - "MTOServiceItemDimension": { - "description": "Describes a dimension object for the MTOServiceItem.", - "type": "object", - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "type": { - "$ref": "#/definitions/DimensionType" - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDimensions": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItemDimension" - } - }, - "MTOServiceItemSingle": { - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "convertToCustomerExpense": { - "type": "boolean", - "x-omitempty": false, - "example": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerExpenseReason": { - "type": "string", - "x-nullable": true - }, - "deletedAt": { - "type": "string", - "format": "date" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupPostalCode": { - "type": "string", - "x-nullable": true - }, - "reServiceCode": { - "type": "string" - }, - "reServiceID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "type": "string" - }, - "rejectedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "status": { - "type": "string", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOServiceItemStatus": { - "description": "Describes all statuses for a MTOServiceItem", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - }, - "MTOServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "MTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The actual date that the shipment was delivered to the delivery address by the Prime", - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "approvedDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "billableWeightCap": { - "description": "TIO override billable weight to be used for calculations", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "billableWeightJustification": { - "type": "string", - "x-nullable": true, - "example": "more weight than expected" - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "calculatedBillableWeight": { - "type": "integer", - "x-nullable": true, - "readOnly": true, - "example": 2000 - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "destinationSitAuthEndDate": { - "type": "string", - "format": "date-time" - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "distance": { - "type": "integer", - "x-nullable": true, - "example": 500 - }, - "diversion": { - "type": "boolean", - "example": true - }, - "diversionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment needs rerouted" - }, - "eTag": { - "type": "string" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoAgents": { - "$ref": "#/definitions/MTOAgents" - }, - "mtoServiceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "originSitAuthEndDate": { - "type": "string", - "format": "date-time" - }, - "pickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "primeEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment not good enough" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requiredDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "reweigh": { - "x-nullable": true, - "x-omitempty": true, - "$ref": "#/definitions/Reweigh" - }, - "sacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "scheduledDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "scheduledPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDeliveryAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentLocator": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "1K43AR-01" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitDaysAllowance": { - "type": "integer", - "x-nullable": true - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "sitStatus": { - "$ref": "#/definitions/SITStatus" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "allOf": [ - { - "$ref": "#/definitions/LOAType" - }, - { - "x-nullable": true - } - ] - }, - "tertiaryDeliveryAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - }, - "usesExternalVendor": { - "type": "boolean", - "example": false - } - } - }, - "MTOShipmentStatus": { - "type": "string", - "title": "Shipment Status", - "enum": [ - "SUBMITTED", - "REJECTED", - "APPROVED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "example": "SUBMITTED" - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "Move": { - "properties": { - "SCAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "TIOAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "TOOAssignedUser": { - "$ref": "#/definitions/AssignedOfficeUser" - }, - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "approvalsRequestedAt": { - "description": "The time at which a move is sent back to the TOO becuase the prime added a new service item for approval", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "billableWeightsReviewedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "closeoutOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "closeoutOfficeId": { - "description": "The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members", - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "contractor": { - "$ref": "#/definitions/Contractor" - }, - "contractorId": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "excess_weight_acknowledged_at": { - "description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "excess_weight_qualified_at": { - "description": "Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "financialReviewFlag": { - "description": "This flag is set by office users if a move should be reviewed by a Financial Office", - "type": "boolean", - "x-nullable": false, - "readOnly": true, - "example": false - }, - "financialReviewRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "Delivery Address is too far from duty location" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "type": "string", - "example": "1K43AR" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUser": { - "x-nullable": true, - "$ref": "#/definitions/LockedOfficeUser" - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orders": { - "$ref": "#/definitions/Order" - }, - "ordersId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "referenceId": { - "type": "string", - "x-nullable": true, - "example": "1001-3456" - }, - "serviceCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "shipmentGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "tioRemarks": { - "type": "string", - "x-nullable": true, - "example": "approved additional weight" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveAuditHistories": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveAuditHistory" - } - }, - "MoveAuditHistory": { - "properties": { - "action": { - "description": "Action type; I = insert, D = delete, U = update, T = truncate", - "type": "string" - }, - "actionTstampClk": { - "description": "Wall clock time at which audited event's trigger call occurred", - "type": "string", - "format": "date-time" - }, - "actionTstampStm": { - "description": "Statement start timestamp for tx in which audited event occurred", - "type": "string", - "format": "date-time" - }, - "actionTstampTx": { - "description": "Transaction start timestamp for tx in which audited event occurred", - "type": "string", - "format": "date-time" - }, - "changedValues": { - "description": "A list of (changed/updated) MoveAuditHistoryItem's for a record after the change.", - "type": "object", - "additionalProperties": true, - "x-nullable": true - }, - "context": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "x-nullable": true - }, - "contextId": { - "description": "id column for the context table the record belongs to", - "type": "string", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "eventName": { - "description": "API endpoint name that was called to make the change", - "type": "string", - "x-nullable": true - }, - "id": { - "description": "id from audity_history table", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "objectId": { - "description": "id column for the tableName where the data was changed", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "oldValues": { - "description": "A list of (old/previous) MoveAuditHistoryItem's for a record before the change.", - "type": "object", - "additionalProperties": true, - "x-nullable": true - }, - "relId": { - "description": "relation OID. Table OID (object identifier). Changes with drop/create.", - "type": "integer" - }, - "schemaName": { - "description": "Database schema audited table for this event is in", - "type": "string" - }, - "sessionUserEmail": { - "type": "string", - "x-nullable": true, - "example": "foobar@example.com" - }, - "sessionUserFirstName": { - "type": "string", - "x-nullable": true, - "example": "foo" - }, - "sessionUserId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sessionUserLastName": { - "type": "string", - "x-nullable": true, - "example": "bar" - }, - "sessionUserTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "statementOnly": { - "description": "true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW'", - "type": "boolean", - "example": false - }, - "tableName": { - "description": "name of database table that was changed", - "type": "string" - }, - "transactionId": { - "description": "Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx.", - "type": "integer", - "x-nullable": true - } - } - }, - "MoveAuditHistoryItem": { - "properties": { - "columnName": { - "type": "string" - }, - "columnValue": { - "type": "string" - } - } - }, - "MoveAuditHistoryItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveAuditHistoryItem" - } - }, - "MoveHistory": { - "properties": { - "historyRecords": { - "description": "A list of MoveAuditHistory's connected to the move.", - "$ref": "#/definitions/MoveAuditHistories" - }, - "id": { - "description": "move ID", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "description": "move locator", - "type": "string", - "example": "1K43AR" - }, - "referenceId": { - "description": "move referenceID", - "type": "string", - "x-nullable": true, - "example": "1001-3456" - } - } - }, - "MoveHistoryResult": { - "type": "object", - "properties": { - "historyRecords": { - "description": "A list of MoveAuditHistory's connected to the move.", - "$ref": "#/definitions/MoveAuditHistories" - }, - "id": { - "description": "move ID", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "description": "move locator", - "type": "string", - "example": "1K43AR" - }, - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "referenceId": { - "description": "move referenceID", - "type": "string", - "x-nullable": true, - "example": "1001-3456" - }, - "totalCount": { - "type": "integer" - } - } - }, - "MovePayload": { - "type": "object", - "required": [ - "id", - "orders_id", - "locator", - "created_at", - "updated_at", - "eTag" - ], - "properties": { - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - }, - "closeout_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "mto_shipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submitted_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveStatus": { - "type": "string", - "enum": [ - "DRAFT", - "NEEDS SERVICE COUNSELING", - "SERVICE COUNSELING COMPLETED", - "SUBMITTED", - "APPROVALS REQUESTED", - "APPROVED", - "CANCELED" - ] - }, - "MoveTaskOrder": { - "description": "The Move (MoveTaskOrder)", - "type": "object", - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "createdAt": { - "type": "string", - "format": "date-time" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "destinationDutyLocation": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "eTag": { - "type": "string" - }, - "entitlements": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "locator": { - "type": "string", - "example": "1K43AR" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "originDutyLocation": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "requestedPickupDate": { - "type": "string", - "format": "date" - }, - "serviceCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "tioRemarks": { - "type": "string", - "x-nullable": true, - "example": "approved additional weight" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveTaskOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "MovingExpense": { - "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "ppmShipmentId", - "documentId", - "document" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp the moving expense object was initially created in the system (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "A brief description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "The Document object that contains all file uploads for this expense" - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The id of the Document that contains all file uploads for this expense", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "Unique primary identifier of the Moving Expense object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingReceipt": { - "description": "Indicates if the service member is missing the receipt with the proof of expense amount", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "paidWithGtcc": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The PPM Shipment id that this moving expense belongs to", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedAmount": { - "description": "Customer submitted total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedDescription": { - "description": "Customer submitted description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "submittedMovingExpenseType": { - "$ref": "#/definitions/SubmittedMovingExpenseType" - }, - "submittedSitEndDate": { - "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "submittedSitStartDate": { - "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "updatedAt": { - "description": "Timestamp when a property of this moving expense object was last modified (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "MovingExpenses": { - "description": "All moving expenses associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - }, - "x-omitempty": false - }, - "NullableString": { - "type": "string", - "x-go-type": { - "import": { - "package": "github.com/transcom/mymove/pkg/swagger/nullable" - }, - "type": "String" - } - }, - "OfficeUser": { - "type": "object", - "required": [ - "id", - "firstName", - "middleInitials", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "active", - "roles", - "edipi", - "otherUniqueId", - "rejectionReason", - "status", - "createdAt", - "updatedAt" - ], - "properties": { - "active": { - "type": "boolean" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "edipi": { - "type": "string" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" - }, - "firstName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string" - }, - "middleInitials": { - "type": "string" - }, - "otherUniqueId": { - "type": "string" - }, - "rejectionReason": { - "type": "string" - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - } - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "REQUESTED", - "REJECTED" - ] - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeAssignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "userId": { - "type": "string", - "format": "uuid" - } - } - }, - "OfficeUserCreate": { - "type": "object", - "required": [ - "firstName", - "lastName", - "email", - "telephone", - "transportationOfficeId", - "roles" - ], - "properties": { - "edipi": { - "type": "string", - "title": "EDIPI", - "maxLength": 10, - "x-nullable": true, - "example": "1234567890" - }, - "email": { - "type": "string", - "title": "Email", - "x-nullable": false, - "example": "user@userdomain.com" - }, - "firstName": { - "type": "string", - "title": "First Name", - "x-nullable": false - }, - "lastName": { - "type": "string", - "title": "Last Name", - "x-nullable": false - }, - "middleInitials": { - "type": "string", - "title": "Middle Initials", - "x-nullable": true, - "example": "L." - }, - "otherUniqueId": { - "type": "string", - "title": "Office user identifier when EDIPI is not available", - "x-nullable": true - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/OfficeUserRole" - }, - "x-nullable": false - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": false, - "example": "212-555-5555" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "x-nullable": false, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OfficeUserRole": { - "type": "object", - "properties": { - "name": { - "type": "string", - "title": "name", - "x-nullable": true, - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "title": "roleType", - "x-nullable": true, - "example": "task_ordering_officer" - } - } - }, - "OmittableMovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OmittablePPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - }, - "x-nullable": true, - "x-omitempty": false - }, - "Order": { - "type": "object", - "properties": { - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "amendedOrdersAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "date_issued": { - "type": "string", - "format": "date", - "example": "2020-01-01" - }, - "department_indicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "eTag": { - "type": "string" - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "first_name": { - "type": "string", - "readOnly": true, - "example": "John" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "last_name": { - "type": "string", - "readOnly": true, - "example": "Doe" - }, - "methodOfPayment": { - "type": "string" - }, - "moveCode": { - "type": "string", - "example": "H2XFJF" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "naics": { - "type": "string" - }, - "ntsSac": { - "type": "string", - "title": "NTS SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "type": "string", - "title": "NTS TAC", - "x-nullable": true, - "example": "F8J1" - }, - "order_number": { - "type": "string", - "x-nullable": true, - "example": "030-00362" - }, - "order_type": { - "$ref": "#/definitions/OrdersType" - }, - "order_type_detail": { - "x-nullable": true, - "$ref": "#/definitions/OrdersTypeDetail" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "packingAndShippingInstructions": { - "type": "string" - }, - "report_by_date": { - "type": "string", - "format": "date", - "example": "2020-01-01" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?", - "example": false - }, - "supplyAndServicesCostEstimate": { - "type": "string" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - }, - "uploadedAmendedOrderID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploaded_order_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OrderBody": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid" - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PPMActualWeight": { - "description": "The actual net weight of a single PPM shipment. Used during document review for PPM closeout.", - "required": [ - "actualWeight" - ], - "properties": { - "actualWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "PPMAdvanceStatus": { - "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", - "type": "string", - "title": "PPM Advance Status", - "enum": [ - "APPROVED", - "REJECTED", - "EDITED", - "RECEIVED", - "NOT_RECEIVED" - ], - "x-nullable": true - }, - "PPMCloseout": { - "description": "The calculations needed in the \"Review Documents\" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment.", - "required": [ - "id" - ], - "properties": { - "SITReimbursement": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "aoa": { - "description": "Advance Operating Allowance (AOA).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "ddp": { - "description": "The Domestic Destination Price (DDP).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "dop": { - "description": "The Domestic Origin Price (DOP).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "gcc": { - "description": "Government Constructive Cost (GCC)", - "type": "integer", - "format": "cents", - "title": "GCC", - "x-nullable": true, - "x-omitempty": false - }, - "grossIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "haulFSC": { - "description": "The linehaul/shorthaul Fuel Surcharge (FSC).", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "haulPrice": { - "description": "The price of the linehaul or shorthaul.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "haulType": { - "description": "The type of haul calculation used for this shipment (shorthaul or linehaul).", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "miles": { - "description": "The distance between the old address and the new address in miles.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false, - "example": 54 - }, - "packPrice": { - "description": "The full price of all packing/unpacking services.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "plannedMoveDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightCustomer": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightSpouse": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "remainingIncentive": { - "description": "The remaining reimbursement amount that is still owed to the customer.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "unpackPrice": { - "description": "The full price of all packing/unpacking services.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - } - }, - "PPMDocumentStatusReason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "PPMDocuments": { - "description": "All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses.", - "type": "object", - "properties": { - "MovingExpenses": { - "$ref": "#/definitions/MovingExpenses" - }, - "ProGearWeightTickets": { - "$ref": "#/definitions/ProGearWeightTickets" - }, - "WeightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true, - "x-omitempty": false - }, - "PPMSITEstimatedCost": { - "description": "The estimated cost of SIT for a single PPM shipment. Used during document review for PPM.", - "required": [ - "sitCost", - "priceFirstDaySIT", - "priceAdditionalDaySIT" - ], - "properties": { - "paramsAdditionalDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "numberDaysSIT": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "30" - }, - "priceRateOrFactor": { - "type": "string", - "example": "0.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "paramsFirstDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "priceRateOrFactor": { - "type": "string", - "example": "20.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "priceAdditionalDaySIT": { - "type": "integer", - "format": "cents", - "title": "Price of an additional day in SIT", - "example": 2000 - }, - "priceFirstDaySIT": { - "type": "integer", - "format": "cents", - "title": "Price of the first day in SIT", - "example": 2000 - }, - "sitCost": { - "type": "integer", - "example": 2000 - } - } - }, - "PPMSITEstimatedCostParamsAdditionalDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "numberDaysSIT": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "30" - }, - "priceRateOrFactor": { - "type": "string", - "example": "0.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "PPMSITEstimatedCostParamsFirstDaySIT": { - "type": "object", - "properties": { - "contractYearName": { - "type": "string", - "example": "Award Term 1" - }, - "escalationCompounded": { - "type": "string", - "example": "1.01" - }, - "isPeak": { - "type": "string", - "example": "true" - }, - "priceRateOrFactor": { - "type": "string", - "example": "20.53" - }, - "serviceAreaDestination": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - }, - "serviceAreaOrigin": { - "type": "string", - "x-nullable": true, - "x-omitempty": true, - "example": "252" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false, - "example": 4300 - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date" - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true - }, - "PPMShipmentSIT": { - "description": "SIT related items for a PPM shipment", - "required": [ - "sitLocation" - ], - "properties": { - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PPMStatus": { - "type": "string", - "enum": [ - "CANCELED", - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "COMPLETED" - ] - }, - "PWSViolation": { - "description": "A PWS violation for an evaluation report", - "type": "object", - "properties": { - "additionalDataElem": { - "type": "string", - "example": "QAE Observed Delivery Date" - }, - "category": { - "type": "string", - "example": "Pre-Move Services" - }, - "displayOrder": { - "type": "integer", - "example": 3 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isKpi": { - "type": "boolean", - "example": false - }, - "paragraphNumber": { - "type": "string", - "example": "1.2.3.4.5" - }, - "requirementStatement": { - "type": "string", - "example": "The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS." - }, - "requirementSummary": { - "type": "string", - "example": "Provide a single point of contact (POC)" - }, - "subCategory": { - "type": "string", - "example": "Weight Estimate" - }, - "title": { - "type": "string", - "example": "Customer Support" - } - }, - "readOnly": true - }, - "PWSViolations": { - "type": "array", - "items": { - "$ref": "#/definitions/PWSViolation" - } - }, - "PatchMTOServiceItemStatusPayload": { - "properties": { - "rejectionReason": { - "description": "Reason the service item was rejected", - "type": "string", - "x-nullable": true, - "example": "Insufficent details provided" - }, - "status": { - "description": "Describes all statuses for a MTOServiceItem", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - } - } - }, - "PaymentRequest": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "ediErrorCode": { - "description": "Reported code from syncada for the EDI error encountered", - "type": "string", - "x-nullable": true - }, - "ediErrorDescription": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true - }, - "ediErrorType": { - "description": "Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858.", - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrder": { - "$ref": "#/definitions/Move" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "receivedByGexAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "reviewedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sentToGexAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "serviceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - }, - "tppsInvoiceAmountPaidTotalMillicents": { - "type": "integer", - "format": "millients", - "title": "Total amount that TPPS paid for all service items on the payment request in millicents", - "x-nullable": true - }, - "tppsInvoiceSellerPaidDate": { - "type": "string", - "format": "date-time", - "title": "Date that TPPS paid HS for the payment request", - "x-nullable": true - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemCode": { - "type": "string", - "example": "DLH" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemName": { - "type": "string", - "example": "Move management" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoShipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - }, - "tppsInvoiceAmountPaidPerServiceItemMillicents": { - "type": "integer", - "format": "millicents", - "title": "Amount that TPPS paid for the individual service item in millicents", - "x-nullable": true - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "PostDocumentPayload": { - "type": "object", - "properties": { - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - } - } - }, - "ProGearWeightTicket": { - "description": "Pro-gear associated information and weight docs for a PPM shipment", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "documentId", - "document" - ], - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the pro-gear weight." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the pro-gear weight ticket.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedBelongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedHasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedWeight": { - "description": "Customer submitted weight of the pro-gear.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weight": { - "description": "Weight of the pro-gear.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - } - } - }, - "ProGearWeightTickets": { - "description": "All progear weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - }, - "x-omitempty": false - }, - "ProofOfServiceDoc": { - "properties": { - "isWeightTicket": { - "type": "boolean" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "QueueMove": { - "type": "object", - "properties": { - "appearedInTooAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "assignable": { - "type": "boolean" - }, - "assignedTo": { - "x-nullable": true, - "$ref": "#/definitions/AssignedOfficeUser" - }, - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "closeoutInitiated": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "closeoutLocation": { - "type": "string", - "x-nullable": true - }, - "counselingOffice": { - "type": "string", - "x-nullable": true - }, - "counselingOfficeID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUser": { - "x-nullable": true, - "$ref": "#/definitions/LockedOfficeUser" - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orderType": { - "type": "string", - "x-nullable": true - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "ppmStatus": { - "x-nullable": true, - "$ref": "#/definitions/PPMStatus" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ], - "x-nullable": true - }, - "requestedMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "QueueMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/QueueMove" - } - }, - "QueueMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queueMoves": { - "$ref": "#/definitions/QueueMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "QueuePaymentRequest": { - "type": "object", - "properties": { - "age": { - "description": "Days since the payment request has been requested. Decimal representation will allow more accurate sorting.", - "type": "number", - "format": "double" - }, - "assignable": { - "type": "boolean" - }, - "assignedTo": { - "x-nullable": true, - "$ref": "#/definitions/AssignedOfficeUser" - }, - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "counselingOffice": { - "type": "string", - "x-nullable": true - }, - "customer": { - "$ref": "#/definitions/Customer" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "moveID": { - "type": "string", - "format": "uuid" - }, - "orderType": { - "type": "string", - "x-nullable": true - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "status": { - "$ref": "#/definitions/QueuePaymentRequestStatus" - }, - "submittedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "QueuePaymentRequestStatus": { - "type": "string", - "title": "Queue Payment Request Status", - "enum": [ - "Payment requested", - "Reviewed", - "Rejected", - "Paid" - ] - }, - "QueuePaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/QueuePaymentRequest" - } - }, - "QueuePaymentRequestsResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "queuePaymentRequests": { - "$ref": "#/definitions/QueuePaymentRequests" - }, - "totalCount": { - "type": "integer" - } - } - }, - "ReServiceItem": { - "description": "A Service Item which ties an ReService, Market, and Shipment Type together", - "type": "object", - "properties": { - "isAutoApproved": { - "type": "boolean", - "example": true - }, - "marketCode": { - "type": "string", - "enum": [ - "i", - "d" - ], - "example": "i (International), d (Domestic)" - }, - "serviceCode": { - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DCRTSA", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSFSC", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSFSC", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICRT", - "ICRTSA", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSFSC", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOFSIT", - "IOPSIT", - "IOSFSC", - "IOSHUT", - "ISLH", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "PODFSC", - "POEFSC", - "UBP" - ], - "example": "UBP" - }, - "serviceName": { - "type": "string", - "example": "International UB, International Shipping \u0026 Linehaul" - }, - "shipmentType": { - "type": "string", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "example": "HHG, UNACCOMPANIED_BAGGAGE" - } - } - }, - "ReServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/ReServiceItem" - } - }, - "RejectShipment": { - "required": [ - "rejectionReason" - ], - "properties": { - "rejectionReason": { - "type": "string", - "example": "MTO Shipment not good enough" - } - } - }, - "ReportViolation": { - "description": "An object associating violations to evaluation reports", - "type": "object", - "properties": { - "gsrAppeals": { - "x-nullable": true, - "$ref": "#/definitions/GSRAppeals" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reportID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "violation": { - "$ref": "#/definitions/PWSViolation" - }, - "violationID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "ReportViolations": { - "type": "array", - "items": { - "$ref": "#/definitions/ReportViolation" - } - }, - "RequestDiversion": { - "required": [ - "diversionReason" - ], - "properties": { - "diversionReason": { - "type": "string", - "example": "Shipment route needs to change" - } - } - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the counselor" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "roleName", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleName": { - "type": "string", - "example": "Task Ordering Officer" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "SITServiceItemGrouping": { - "properties": { - "serviceItems": { - "$ref": "#/definitions/MTOServiceItems" - }, - "summary": { - "description": "Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\nThis is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items.\n", - "$ref": "#/definitions/SITSummary" - } - } - }, - "SITServiceItemGroupings": { - "description": "Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\n", - "type": "array", - "items": { - "$ref": "#/definitions/SITServiceItemGrouping" - } - }, - "SITStatus": { - "properties": { - "calculatedTotalDaysInSIT": { - "type": "integer", - "minimum": 0 - }, - "currentSIT": { - "type": "object", - "properties": { - "daysInSIT": { - "type": "integer", - "minimum": 0 - }, - "location": { - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "serviceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitAuthorizedEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - } - } - }, - "pastSITServiceItemGroupings": { - "description": "A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes.\n", - "$ref": "#/definitions/SITServiceItemGroupings" - }, - "totalDaysRemaining": { - "type": "integer", - "minimum": 0 - }, - "totalSITDaysUsed": { - "type": "integer", - "minimum": 0 - } - } - }, - "SITStatusCurrentSIT": { - "type": "object", - "properties": { - "daysInSIT": { - "type": "integer", - "minimum": 0 - }, - "location": { - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "serviceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitAuthorizedEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitCustomerContacted": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date", - "x-nullable": true - } - } - }, - "SITSummary": { - "properties": { - "daysInSIT": { - "type": "integer", - "minimum": 0 - }, - "firstDaySITServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "location": { - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "sitAuthorizedEndDate": { - "type": "string", - "format": "date-time" - }, - "sitCustomerContacted": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitDepartureDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "sitEntryDate": { - "type": "string", - "format": "date-time" - }, - "sitRequestedDelivery": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "SearchCustomer": { - "type": "object", - "properties": { - "branch": { - "type": "string" - }, - "edipi": { - "type": "string", - "x-nullable": true - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "lastName": { - "type": "string", - "x-nullable": true, - "example": "Doe" - }, - "personalEmail": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "personalEmail@email.com" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "SearchCustomers": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchCustomer" - } - }, - "SearchCustomersResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "searchCustomers": { - "$ref": "#/definitions/SearchCustomers" - }, - "totalCount": { - "type": "integer" - } - } - }, - "SearchMove": { - "type": "object", - "properties": { - "branch": { - "type": "string" - }, - "destinationGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "destinationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "edipi": { - "type": "string", - "x-nullable": true, - "example": 1234567890 - }, - "emplid": { - "type": "string", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid" - }, - "lastName": { - "type": "string", - "x-nullable": true, - "example": "Doe" - }, - "locator": { - "type": "string" - }, - "lockExpiresAt": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "lockedByOfficeUserID": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "orderType": { - "type": "string" - }, - "originDutyLocationPostalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "example": "90210" - }, - "originGBLOC": { - "$ref": "#/definitions/GBLOC" - }, - "paymentRequestCode": { - "type": "string", - "x-nullable": true, - "example": "9551-6199-2" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentsCount": { - "type": "integer" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - } - } - }, - "SearchMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/SearchMove" - } - }, - "SearchMovesResult": { - "type": "object", - "properties": { - "page": { - "type": "integer" - }, - "perPage": { - "type": "integer" - }, - "searchMoves": { - "$ref": "#/definitions/SearchMoves" - }, - "totalCount": { - "type": "integer" - } - } - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceItemSitEntryDate": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEntryDate": { - "type": "string", - "format": "date-time", - "x-nullable": true - } - } - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "mtoServiceItemID": { - "type": "string", - "format": "uuid" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "ServiceRequestDocuments": { - "description": "documents uploaded by the Prime as proof of request for service items", - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "ShipmentPaymentSITBalance": { - "properties": { - "pendingBilledEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "pendingBilledStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "pendingSITDaysInvoiced": { - "type": "integer" - }, - "previouslyBilledDays": { - "type": "integer", - "x-nullable": true - }, - "previouslyBilledEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "previouslyBilledStartDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentID": { - "type": "string", - "format": "uuid" - }, - "totalSITDaysAuthorized": { - "type": "integer" - }, - "totalSITDaysRemaining": { - "type": "integer" - }, - "totalSITEndDate": { - "type": "string", - "format": "date", - "x-nullable": true - } - } - }, - "ShipmentsPaymentSITBalance": { - "type": "array", - "items": { - "$ref": "#/definitions/ShipmentPaymentSITBalance" - } - }, - "SignedCertification": { - "description": "Signed certification", - "type": "object", - "required": [ - "id", - "submittingUserId", - "moveId", - "certificationType", - "certificationText", - "signature", - "date", - "createdAt", - "updatedAt", - "eTag" - ], - "properties": { - "certificationText": { - "description": "Full text that the customer agreed to and signed.", - "type": "string" - }, - "certificationType": { - "$ref": "#/definitions/SignedCertificationType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "date": { - "description": "Date that the customer signed the certification.", - "type": "string", - "format": "date" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveId": { - "description": "The ID of the move associated with this signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmId": { - "description": "The ID of the PPM shipment associated with this signed certification, if any.", - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "signature": { - "description": "The signature that the customer provided.", - "type": "string" - }, - "submittingUserId": { - "description": "The ID of the user that signed.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SignedCertificationType": { - "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "SubmittedMovingExpenseType": { - "description": "Customer Submitted Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "TacValid": { - "type": "object", - "required": [ - "isValid" - ], - "properties": { - "isValid": { - "type": "boolean", - "example": true - } - } - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phone_lines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "required": [ - "officeUserId", - "transportationOfficeId", - "primaryOffice" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "UpdateAllowancePayload": { - "type": "object", - "properties": { - "accompaniedTour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "agency": { - "$ref": "#/definitions/Affiliation" - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true - }, - "dependentsTwelveAndOver": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependentsUnderTwelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "gunSafe": { - "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", - "type": "boolean", - "x-nullable": true - }, - "organizationalClothingAndIndividualEquipment": { - "description": "only for Army", - "type": "boolean", - "x-nullable": true - }, - "proGearWeight": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 2000, - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "description": "unit is in lbs", - "type": "integer", - "maximum": 500, - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true, - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 0, - "x-formatting": "weight", - "example": 2000 - }, - "storageInTransit": { - "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", - "type": "integer", - "minimum": 0 - }, - "ubAllowance": { - "type": "integer", - "x-nullable": true, - "example": 500 - } - } - }, - "UpdateBillableWeightPayload": { - "type": "object", - "properties": { - "authorizedWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - } - } - }, - "UpdateBoatShipment": { - "type": "object", - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean", - "x-nullable": true - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ], - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateCustomerPayload": { - "type": "object", - "properties": { - "backupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "backup_contact": { - "$ref": "#/definitions/BackupContact" - }, - "cac_validated": { - "type": "boolean" - }, - "current_address": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "emailIsPreferred": { - "type": "boolean" - }, - "first_name": { - "type": "string", - "example": "John" - }, - "last_name": { - "type": "string", - "example": "Doe" - }, - "middle_name": { - "type": "string", - "x-nullable": true, - "example": "David" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "phoneIsPreferred": { - "type": "boolean" - }, - "secondaryTelephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", - "x-nullable": true - }, - "suffix": { - "type": "string", - "x-nullable": true, - "example": "Jr." - } - } - }, - "UpdateCustomerSupportRemarkPayload": { - "description": "A text remark update to an existing remark created by the current active user (the CSR).", - "type": "object", - "required": [ - "content" - ], - "properties": { - "content": { - "type": "string", - "example": "This is a remark about a move." - } - } - }, - "UpdateMaxBillableWeightAsTIOPayload": { - "type": "object", - "required": [ - "authorizedWeight", - "tioRemarks" - ], - "properties": { - "authorizedWeight": { - "description": "unit is in lbs", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "tioRemarks": { - "description": "TIO remarks for updating the max billable weight", - "type": "string", - "minLength": 1, - "x-nullable": true, - "example": "Increasing max billable weight" - } - } - }, - "UpdateMobileHomeShipment": { - "type": "object", - "properties": { - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMovingExpense": { - "type": "object", - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer" - }, - "description": { - "description": "A brief description of the expense.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer" - } - } - }, - "UpdateOrderPayload": { - "type": "object", - "required": [ - "issueDate", - "reportByDate", - "ordersType", - "newDutyLocationId", - "originDutyLocationId" - ], - "properties": { - "departmentIndicator": { - "x-nullable": true, - "$ref": "#/definitions/DeptIndicator" - }, - "grade": { - "$ref": "#/definitions/Grade" - }, - "issueDate": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "newDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ntsSac": { - "title": "NTS SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "ntsTac": { - "title": "NTS TAC", - "maxLength": 4, - "minLength": 4, - "$ref": "#/definitions/NullableString", - "example": "F8J1" - }, - "ordersAcknowledgement": { - "description": "Confirmation that the new amended orders were reviewed after previously approving the original orders", - "type": "boolean", - "x-nullable": true - }, - "ordersNumber": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationId": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reportByDate": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "title": "HHG SAC", - "$ref": "#/definitions/NullableString", - "example": "N002214CSW32Y9" - }, - "tac": { - "type": "string", - "title": "HHG TAC", - "maxLength": 4, - "minLength": 4, - "x-nullable": true, - "example": "F8J1" - } - } - }, - "UpdatePPMShipment": { - "type": "object", - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "actualMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceAmountRequested": { - "description": "The amount request for an advance, or null if no advance is requested\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceStatus": { - "x-nullable": true, - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "example": 4300 - }, - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean", - "x-nullable": true - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - } - } - }, - "UpdatePaymentRequestStatusPayload": { - "type": "object", - "properties": { - "eTag": { - "type": "string" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "UpdateProGearWeightTicket": { - "type": "object", - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean" - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "weight": { - "description": "Weight of the pro-gear contained in the shipment.", - "type": "integer", - "minimum": 0 - } - } - }, - "UpdateSITServiceItemCustomerExpense": { - "required": [ - "convertToCustomerExpense", - "customerExpenseReason" - ], - "properties": { - "convertToCustomerExpense": { - "type": "boolean", - "example": true - }, - "customerExpenseReason": { - "description": "Reason the service item was rejected", - "type": "string", - "example": "Insufficent details provided" - } - } - }, - "UpdateShipment": { - "type": "object", - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "x-nullable": true, - "$ref": "#/definitions/MTOAgents" - }, - "billableWeightCap": { - "description": "estimated weight of the shuttle service item provided by the prime", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2500 - }, - "billableWeightJustification": { - "type": "string", - "x-nullable": true, - "example": "more weight than expected" - }, - "boatShipment": { - "$ref": "#/definitions/UpdateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/UpdateMobileHomeShipment" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "pickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "sacType": { - "$ref": "#/definitions/LOATypeNullable" - }, - "secondaryDeliveryAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "serviceOrderNumber": { - "type": "string", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "x-nullable": true, - "$ref": "#/definitions/StorageFacility" - }, - "tacType": { - "$ref": "#/definitions/LOATypeNullable" - }, - "tertiaryDeliveryAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "usesExternalVendor": { - "type": "boolean", - "x-nullable": true, - "example": false - } - } - }, - "UpdateWeightTicket": { - "type": "object", - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "minimum": 0 - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "minimum": 0 - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "minimum": 0 - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string" - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean" - }, - "reason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string" - }, - "status": { - "$ref": "#/definitions/PPMDocumentStatus" - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean" - } - } - }, - "Upload": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "id", - "url", - "filename", - "contentType", - "bytes", - "createdAt", - "updatedAt" - ], - "properties": { - "bytes": { - "type": "integer", - "readOnly": true - }, - "contentType": { - "type": "string", - "format": "mime-type", - "readOnly": true, - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "filename": { - "type": "string", - "readOnly": true, - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isWeightTicket": { - "type": "boolean" - }, - "rotation": { - "type": "integer", - "example": 2 - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ], - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "uploadType": { - "type": "string", - "enum": [ - "USER", - "PRIME", - "OFFICE" - ], - "readOnly": true, - "example": "OFFICE" - }, - "url": { - "type": "string", - "format": "uri", - "readOnly": true, - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocation": { - "description": "A postal code, city, and state lookup", - "type": "object", - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocations": { - "type": "array", - "items": { - "$ref": "#/definitions/VLocation" - } - }, - "ValidationError": { - "required": [ - "invalid_fields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "$ref": "#/definitions/ValidationErrorAllOf1" - } - ], - "properties": { - "invalid_fields": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "ValidationErrorAllOf1": { - "type": "object" - }, - "WeightTicket": { - "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "emptyDocumentId", - "emptyDocument", - "fullDocument", - "fullDocumentId", - "proofOfTrailerOwnershipDocument", - "proofOfTrailerOwnershipDocumentId" - ], - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "emptyDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when empty." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "emptyDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", - "type": "string", - "format": "uuid", - "readOnly": true - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "fullDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when full." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "fullDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "ID of this set of weight tickets.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this set of weight tickets is for.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "proofOfTrailerOwnershipDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the proof of trailer ownership." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "proofOfTrailerOwnershipDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedEmptyWeight": { - "description": "Customer submitted weight of the vehicle when empty.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "submittedFullWeight": { - "description": "Customer submitted weight of the vehicle when full.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "submittedOwnsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedTrailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "WeightTickets": { - "description": "All weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/WeightTicket" - }, - "x-omitempty": false - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - "movingExpenseId": { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - }, - "ppmShipmentId": { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - "proGearWeightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - }, - "weightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "Conflict error", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "NotFound": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PermissionDenied": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PreconditionFailed": { - "description": "Precondition failed", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "ServerError": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "name": "queues" - }, - { - "name": "move" - }, - { - "description": "Move Orders - Commonly called “Orders,” especially in customer-facing language. Orders are plural because they're a bundle of related orders issued bya Service (e.g. Army, Air Force, Navy) to a customer that authorize (and order) that customer to move from one location to another.\nOrders are backed by $$ in the bank to support that move, which is identified by a Line of Account (LOA) code on the orders document.\n", - "name": "order" - }, - { - "name": "moveTaskOrder" - }, - { - "name": "customer" - }, - { - "name": "mtoServiceItem" - }, - { - "name": "mtoShipment" - }, - { - "name": "shipment" - }, - { - "name": "mtoAgent" - }, - { - "name": "paymentServiceItem" - }, - { - "name": "ppm" - }, - { - "name": "tac" - }, - { - "name": "transportationOffice" - }, - { - "name": "addresses" - }, - { - "name": "uploads" - }, - { - "name": "paymentRequests" - }, - { - "name": "reServiceItems" - } - ] -}`)) -} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go deleted file mode 100644 index caf0349eb8a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetLocationByZipCityStateHandlerFunc turns a function with the right signature into a get location by zip city state handler -type GetLocationByZipCityStateHandlerFunc func(GetLocationByZipCityStateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetLocationByZipCityStateHandlerFunc) Handle(params GetLocationByZipCityStateParams) middleware.Responder { - return fn(params) -} - -// GetLocationByZipCityStateHandler interface for that can handle valid get location by zip city state params -type GetLocationByZipCityStateHandler interface { - Handle(GetLocationByZipCityStateParams) middleware.Responder -} - -// NewGetLocationByZipCityState creates a new http.Handler for the get location by zip city state operation -func NewGetLocationByZipCityState(ctx *middleware.Context, handler GetLocationByZipCityStateHandler) *GetLocationByZipCityState { - return &GetLocationByZipCityState{Context: ctx, Handler: handler} -} - -/* - GetLocationByZipCityState swagger:route GET /addresses/zip-city-lookup/{search} addresses getLocationByZipCityState - -Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string - -Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code. -*/ -type GetLocationByZipCityState struct { - Context *middleware.Context - Handler GetLocationByZipCityStateHandler -} - -func (o *GetLocationByZipCityState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetLocationByZipCityStateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go deleted file mode 100644 index 0e8106fb581..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetLocationByZipCityStateParams creates a new GetLocationByZipCityStateParams object -// -// There are no default values defined in the spec. -func NewGetLocationByZipCityStateParams() GetLocationByZipCityStateParams { - - return GetLocationByZipCityStateParams{} -} - -// GetLocationByZipCityStateParams contains all the bound params for the get location by zip city state operation -// typically these are obtained from a http.Request -// -// swagger:parameters getLocationByZipCityState -type GetLocationByZipCityStateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetLocationByZipCityStateParams() beforehand. -func (o *GetLocationByZipCityStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rSearch, rhkSearch, _ := route.Params.GetOK("search") - if err := o.bindSearch(rSearch, rhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from path. -func (o *GetLocationByZipCityStateParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Search = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go deleted file mode 100644 index dea409e8867..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetLocationByZipCityStateOKCode is the HTTP code returned for type GetLocationByZipCityStateOK -const GetLocationByZipCityStateOKCode int = 200 - -/* -GetLocationByZipCityStateOK the requested list of city, state, county, and postal code matches - -swagger:response getLocationByZipCityStateOK -*/ -type GetLocationByZipCityStateOK struct { - - /* - In: Body - */ - Payload ghcmessages.VLocations `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateOK creates GetLocationByZipCityStateOK with default headers values -func NewGetLocationByZipCityStateOK() *GetLocationByZipCityStateOK { - - return &GetLocationByZipCityStateOK{} -} - -// WithPayload adds the payload to the get location by zip city state o k response -func (o *GetLocationByZipCityStateOK) WithPayload(payload ghcmessages.VLocations) *GetLocationByZipCityStateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state o k response -func (o *GetLocationByZipCityStateOK) SetPayload(payload ghcmessages.VLocations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.VLocations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetLocationByZipCityStateBadRequestCode is the HTTP code returned for type GetLocationByZipCityStateBadRequest -const GetLocationByZipCityStateBadRequestCode int = 400 - -/* -GetLocationByZipCityStateBadRequest The request payload is invalid - -swagger:response getLocationByZipCityStateBadRequest -*/ -type GetLocationByZipCityStateBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateBadRequest creates GetLocationByZipCityStateBadRequest with default headers values -func NewGetLocationByZipCityStateBadRequest() *GetLocationByZipCityStateBadRequest { - - return &GetLocationByZipCityStateBadRequest{} -} - -// WithPayload adds the payload to the get location by zip city state bad request response -func (o *GetLocationByZipCityStateBadRequest) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state bad request response -func (o *GetLocationByZipCityStateBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateForbiddenCode is the HTTP code returned for type GetLocationByZipCityStateForbidden -const GetLocationByZipCityStateForbiddenCode int = 403 - -/* -GetLocationByZipCityStateForbidden The request was denied - -swagger:response getLocationByZipCityStateForbidden -*/ -type GetLocationByZipCityStateForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateForbidden creates GetLocationByZipCityStateForbidden with default headers values -func NewGetLocationByZipCityStateForbidden() *GetLocationByZipCityStateForbidden { - - return &GetLocationByZipCityStateForbidden{} -} - -// WithPayload adds the payload to the get location by zip city state forbidden response -func (o *GetLocationByZipCityStateForbidden) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state forbidden response -func (o *GetLocationByZipCityStateForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateNotFoundCode is the HTTP code returned for type GetLocationByZipCityStateNotFound -const GetLocationByZipCityStateNotFoundCode int = 404 - -/* -GetLocationByZipCityStateNotFound The requested resource wasn't found - -swagger:response getLocationByZipCityStateNotFound -*/ -type GetLocationByZipCityStateNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateNotFound creates GetLocationByZipCityStateNotFound with default headers values -func NewGetLocationByZipCityStateNotFound() *GetLocationByZipCityStateNotFound { - - return &GetLocationByZipCityStateNotFound{} -} - -// WithPayload adds the payload to the get location by zip city state not found response -func (o *GetLocationByZipCityStateNotFound) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state not found response -func (o *GetLocationByZipCityStateNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateInternalServerErrorCode is the HTTP code returned for type GetLocationByZipCityStateInternalServerError -const GetLocationByZipCityStateInternalServerErrorCode int = 500 - -/* -GetLocationByZipCityStateInternalServerError A server error occurred - -swagger:response getLocationByZipCityStateInternalServerError -*/ -type GetLocationByZipCityStateInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateInternalServerError creates GetLocationByZipCityStateInternalServerError with default headers values -func NewGetLocationByZipCityStateInternalServerError() *GetLocationByZipCityStateInternalServerError { - - return &GetLocationByZipCityStateInternalServerError{} -} - -// WithPayload adds the payload to the get location by zip city state internal server error response -func (o *GetLocationByZipCityStateInternalServerError) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state internal server error response -func (o *GetLocationByZipCityStateInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go deleted file mode 100644 index 28a7061c39f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetLocationByZipCityStateURL generates an URL for the get location by zip city state operation -type GetLocationByZipCityStateURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLocationByZipCityStateURL) WithBasePath(bp string) *GetLocationByZipCityStateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLocationByZipCityStateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetLocationByZipCityStateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/addresses/zip-city-lookup/{search}" - - search := o.Search - if search != "" { - _path = strings.Replace(_path, "{search}", search, -1) - } else { - return nil, errors.New("search is required on GetLocationByZipCityStateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetLocationByZipCityStateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetLocationByZipCityStateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetLocationByZipCityStateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetLocationByZipCityStateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetLocationByZipCityStateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetLocationByZipCityStateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go deleted file mode 100644 index 209ae670952..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetParamHandlerFunc turns a function with the right signature into a get param handler -type GetParamHandlerFunc func(GetParamParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetParamHandlerFunc) Handle(params GetParamParams) middleware.Responder { - return fn(params) -} - -// GetParamHandler interface for that can handle valid get param params -type GetParamHandler interface { - Handle(GetParamParams) middleware.Responder -} - -// NewGetParam creates a new http.Handler for the get param operation -func NewGetParam(ctx *middleware.Context, handler GetParamHandler) *GetParam { - return &GetParam{Context: ctx, Handler: handler} -} - -/* - GetParam swagger:route GET /application_parameters/{parameterName} application_parameters getParam - -# Searches for an application parameter by name, returns nil if not found - -Searches for an application parameter by name, returns nil if not found -*/ -type GetParam struct { - Context *middleware.Context - Handler GetParamHandler -} - -func (o *GetParam) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetParamParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go deleted file mode 100644 index 8c05fe5ad84..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetParamParams creates a new GetParamParams object -// -// There are no default values defined in the spec. -func NewGetParamParams() GetParamParams { - - return GetParamParams{} -} - -// GetParamParams contains all the bound params for the get param operation -// typically these are obtained from a http.Request -// -// swagger:parameters getParam -type GetParamParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Parameter Name - Required: true - In: path - */ - ParameterName string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetParamParams() beforehand. -func (o *GetParamParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rParameterName, rhkParameterName, _ := route.Params.GetOK("parameterName") - if err := o.bindParameterName(rParameterName, rhkParameterName, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindParameterName binds and validates parameter ParameterName from path. -func (o *GetParamParams) bindParameterName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.ParameterName = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go deleted file mode 100644 index 5baf105818f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetParamOKCode is the HTTP code returned for type GetParamOK -const GetParamOKCode int = 200 - -/* -GetParamOK Application Parameters - -swagger:response getParamOK -*/ -type GetParamOK struct { - - /* - In: Body - */ - Payload *ghcmessages.ApplicationParameters `json:"body,omitempty"` -} - -// NewGetParamOK creates GetParamOK with default headers values -func NewGetParamOK() *GetParamOK { - - return &GetParamOK{} -} - -// WithPayload adds the payload to the get param o k response -func (o *GetParamOK) WithPayload(payload *ghcmessages.ApplicationParameters) *GetParamOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get param o k response -func (o *GetParamOK) SetPayload(payload *ghcmessages.ApplicationParameters) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetParamOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetParamBadRequestCode is the HTTP code returned for type GetParamBadRequest -const GetParamBadRequestCode int = 400 - -/* -GetParamBadRequest invalid request - -swagger:response getParamBadRequest -*/ -type GetParamBadRequest struct { -} - -// NewGetParamBadRequest creates GetParamBadRequest with default headers values -func NewGetParamBadRequest() *GetParamBadRequest { - - return &GetParamBadRequest{} -} - -// WriteResponse to the client -func (o *GetParamBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// GetParamUnauthorizedCode is the HTTP code returned for type GetParamUnauthorized -const GetParamUnauthorizedCode int = 401 - -/* -GetParamUnauthorized request requires user authentication - -swagger:response getParamUnauthorized -*/ -type GetParamUnauthorized struct { -} - -// NewGetParamUnauthorized creates GetParamUnauthorized with default headers values -func NewGetParamUnauthorized() *GetParamUnauthorized { - - return &GetParamUnauthorized{} -} - -// WriteResponse to the client -func (o *GetParamUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// GetParamInternalServerErrorCode is the HTTP code returned for type GetParamInternalServerError -const GetParamInternalServerErrorCode int = 500 - -/* -GetParamInternalServerError server error - -swagger:response getParamInternalServerError -*/ -type GetParamInternalServerError struct { -} - -// NewGetParamInternalServerError creates GetParamInternalServerError with default headers values -func NewGetParamInternalServerError() *GetParamInternalServerError { - - return &GetParamInternalServerError{} -} - -// WriteResponse to the client -func (o *GetParamInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go deleted file mode 100644 index 0f41a2ec1f5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetParamURL generates an URL for the get param operation -type GetParamURL struct { - ParameterName string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetParamURL) WithBasePath(bp string) *GetParamURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetParamURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetParamURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/application_parameters/{parameterName}" - - parameterName := o.ParameterName - if parameterName != "" { - _path = strings.Replace(_path, "{parameterName}", parameterName, -1) - } else { - return nil, errors.New("parameterName is required on GetParamURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetParamURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetParamURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetParamURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetParamURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetParamURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetParamURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go deleted file mode 100644 index 2391d9fec61..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IsDateWeekendHolidayHandlerFunc turns a function with the right signature into a is date weekend holiday handler -type IsDateWeekendHolidayHandlerFunc func(IsDateWeekendHolidayParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IsDateWeekendHolidayHandlerFunc) Handle(params IsDateWeekendHolidayParams) middleware.Responder { - return fn(params) -} - -// IsDateWeekendHolidayHandler interface for that can handle valid is date weekend holiday params -type IsDateWeekendHolidayHandler interface { - Handle(IsDateWeekendHolidayParams) middleware.Responder -} - -// NewIsDateWeekendHoliday creates a new http.Handler for the is date weekend holiday operation -func NewIsDateWeekendHoliday(ctx *middleware.Context, handler IsDateWeekendHolidayHandler) *IsDateWeekendHoliday { - return &IsDateWeekendHoliday{Context: ctx, Handler: handler} -} - -/* - IsDateWeekendHoliday swagger:route GET /calendar/{countryCode}/is-weekend-holiday/{date} calendar isDateWeekendHoliday - -# Validate move date selection - -Utility API to determine if input date falls on weekend and/or holiday. -*/ -type IsDateWeekendHoliday struct { - Context *middleware.Context - Handler IsDateWeekendHolidayHandler -} - -func (o *IsDateWeekendHoliday) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIsDateWeekendHolidayParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go deleted file mode 100644 index bb43341894d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewIsDateWeekendHolidayParams creates a new IsDateWeekendHolidayParams object -// -// There are no default values defined in the spec. -func NewIsDateWeekendHolidayParams() IsDateWeekendHolidayParams { - - return IsDateWeekendHolidayParams{} -} - -// IsDateWeekendHolidayParams contains all the bound params for the is date weekend holiday operation -// typically these are obtained from a http.Request -// -// swagger:parameters isDateWeekendHoliday -type IsDateWeekendHolidayParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*country code for context of date - Required: true - In: path - */ - CountryCode string - /*input date to determine if weekend/holiday for given country. - Required: true - In: path - */ - Date strfmt.Date -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIsDateWeekendHolidayParams() beforehand. -func (o *IsDateWeekendHolidayParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rCountryCode, rhkCountryCode, _ := route.Params.GetOK("countryCode") - if err := o.bindCountryCode(rCountryCode, rhkCountryCode, route.Formats); err != nil { - res = append(res, err) - } - - rDate, rhkDate, _ := route.Params.GetOK("date") - if err := o.bindDate(rDate, rhkDate, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCountryCode binds and validates parameter CountryCode from path. -func (o *IsDateWeekendHolidayParams) bindCountryCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.CountryCode = raw - - if err := o.validateCountryCode(formats); err != nil { - return err - } - - return nil -} - -// validateCountryCode carries on validations for parameter CountryCode -func (o *IsDateWeekendHolidayParams) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.EnumCase("countryCode", "path", o.CountryCode, []interface{}{"US"}, true); err != nil { - return err - } - - return nil -} - -// bindDate binds and validates parameter Date from path. -func (o *IsDateWeekendHolidayParams) bindDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: date - value, err := formats.Parse("date", raw) - if err != nil { - return errors.InvalidType("date", "path", "strfmt.Date", raw) - } - o.Date = *(value.(*strfmt.Date)) - - if err := o.validateDate(formats); err != nil { - return err - } - - return nil -} - -// validateDate carries on validations for parameter Date -func (o *IsDateWeekendHolidayParams) validateDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("date", "path", "date", o.Date.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go deleted file mode 100644 index d23e89dea9c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// IsDateWeekendHolidayOKCode is the HTTP code returned for type IsDateWeekendHolidayOK -const IsDateWeekendHolidayOKCode int = 200 - -/* -IsDateWeekendHolidayOK Successfully determine if given date is weekend and/or holiday for given country. - -swagger:response isDateWeekendHolidayOK -*/ -type IsDateWeekendHolidayOK struct { - - /* - In: Body - */ - Payload *ghcmessages.IsDateWeekendHolidayInfo `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayOK creates IsDateWeekendHolidayOK with default headers values -func NewIsDateWeekendHolidayOK() *IsDateWeekendHolidayOK { - - return &IsDateWeekendHolidayOK{} -} - -// WithPayload adds the payload to the is date weekend holiday o k response -func (o *IsDateWeekendHolidayOK) WithPayload(payload *ghcmessages.IsDateWeekendHolidayInfo) *IsDateWeekendHolidayOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday o k response -func (o *IsDateWeekendHolidayOK) SetPayload(payload *ghcmessages.IsDateWeekendHolidayInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayBadRequestCode is the HTTP code returned for type IsDateWeekendHolidayBadRequest -const IsDateWeekendHolidayBadRequestCode int = 400 - -/* -IsDateWeekendHolidayBadRequest The request payload is invalid - -swagger:response isDateWeekendHolidayBadRequest -*/ -type IsDateWeekendHolidayBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayBadRequest creates IsDateWeekendHolidayBadRequest with default headers values -func NewIsDateWeekendHolidayBadRequest() *IsDateWeekendHolidayBadRequest { - - return &IsDateWeekendHolidayBadRequest{} -} - -// WithPayload adds the payload to the is date weekend holiday bad request response -func (o *IsDateWeekendHolidayBadRequest) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday bad request response -func (o *IsDateWeekendHolidayBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayUnauthorizedCode is the HTTP code returned for type IsDateWeekendHolidayUnauthorized -const IsDateWeekendHolidayUnauthorizedCode int = 401 - -/* -IsDateWeekendHolidayUnauthorized The request was denied - -swagger:response isDateWeekendHolidayUnauthorized -*/ -type IsDateWeekendHolidayUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayUnauthorized creates IsDateWeekendHolidayUnauthorized with default headers values -func NewIsDateWeekendHolidayUnauthorized() *IsDateWeekendHolidayUnauthorized { - - return &IsDateWeekendHolidayUnauthorized{} -} - -// WithPayload adds the payload to the is date weekend holiday unauthorized response -func (o *IsDateWeekendHolidayUnauthorized) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday unauthorized response -func (o *IsDateWeekendHolidayUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayNotFoundCode is the HTTP code returned for type IsDateWeekendHolidayNotFound -const IsDateWeekendHolidayNotFoundCode int = 404 - -/* -IsDateWeekendHolidayNotFound The requested resource wasn't found - -swagger:response isDateWeekendHolidayNotFound -*/ -type IsDateWeekendHolidayNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayNotFound creates IsDateWeekendHolidayNotFound with default headers values -func NewIsDateWeekendHolidayNotFound() *IsDateWeekendHolidayNotFound { - - return &IsDateWeekendHolidayNotFound{} -} - -// WithPayload adds the payload to the is date weekend holiday not found response -func (o *IsDateWeekendHolidayNotFound) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday not found response -func (o *IsDateWeekendHolidayNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayInternalServerErrorCode is the HTTP code returned for type IsDateWeekendHolidayInternalServerError -const IsDateWeekendHolidayInternalServerErrorCode int = 500 - -/* -IsDateWeekendHolidayInternalServerError A server error occurred - -swagger:response isDateWeekendHolidayInternalServerError -*/ -type IsDateWeekendHolidayInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayInternalServerError creates IsDateWeekendHolidayInternalServerError with default headers values -func NewIsDateWeekendHolidayInternalServerError() *IsDateWeekendHolidayInternalServerError { - - return &IsDateWeekendHolidayInternalServerError{} -} - -// WithPayload adds the payload to the is date weekend holiday internal server error response -func (o *IsDateWeekendHolidayInternalServerError) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday internal server error response -func (o *IsDateWeekendHolidayInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go deleted file mode 100644 index 1b8e4b91497..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// IsDateWeekendHolidayURL generates an URL for the is date weekend holiday operation -type IsDateWeekendHolidayURL struct { - CountryCode string - Date strfmt.Date - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsDateWeekendHolidayURL) WithBasePath(bp string) *IsDateWeekendHolidayURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsDateWeekendHolidayURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IsDateWeekendHolidayURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/calendar/{countryCode}/is-weekend-holiday/{date}" - - countryCode := o.CountryCode - if countryCode != "" { - _path = strings.Replace(_path, "{countryCode}", countryCode, -1) - } else { - return nil, errors.New("countryCode is required on IsDateWeekendHolidayURL") - } - - date := o.Date.String() - if date != "" { - _path = strings.Replace(_path, "{date}", date, -1) - } else { - return nil, errors.New("date is required on IsDateWeekendHolidayURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IsDateWeekendHolidayURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IsDateWeekendHolidayURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IsDateWeekendHolidayURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IsDateWeekendHolidayURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IsDateWeekendHolidayURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IsDateWeekendHolidayURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go deleted file mode 100644 index 38bcedb68f6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateCustomerWithOktaOptionHandlerFunc turns a function with the right signature into a create customer with okta option handler -type CreateCustomerWithOktaOptionHandlerFunc func(CreateCustomerWithOktaOptionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateCustomerWithOktaOptionHandlerFunc) Handle(params CreateCustomerWithOktaOptionParams) middleware.Responder { - return fn(params) -} - -// CreateCustomerWithOktaOptionHandler interface for that can handle valid create customer with okta option params -type CreateCustomerWithOktaOptionHandler interface { - Handle(CreateCustomerWithOktaOptionParams) middleware.Responder -} - -// NewCreateCustomerWithOktaOption creates a new http.Handler for the create customer with okta option operation -func NewCreateCustomerWithOktaOption(ctx *middleware.Context, handler CreateCustomerWithOktaOptionHandler) *CreateCustomerWithOktaOption { - return &CreateCustomerWithOktaOption{Context: ctx, Handler: handler} -} - -/* - CreateCustomerWithOktaOption swagger:route POST /customer customer createCustomerWithOktaOption - -# Creates a customer with Okta option - -Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting. -*/ -type CreateCustomerWithOktaOption struct { - Context *middleware.Context - Handler CreateCustomerWithOktaOptionHandler -} - -func (o *CreateCustomerWithOktaOption) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateCustomerWithOktaOptionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go deleted file mode 100644 index d05da4adc8b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateCustomerWithOktaOptionParams creates a new CreateCustomerWithOktaOptionParams object -// -// There are no default values defined in the spec. -func NewCreateCustomerWithOktaOptionParams() CreateCustomerWithOktaOptionParams { - - return CreateCustomerWithOktaOptionParams{} -} - -// CreateCustomerWithOktaOptionParams contains all the bound params for the create customer with okta option operation -// typically these are obtained from a http.Request -// -// swagger:parameters createCustomerWithOktaOption -type CreateCustomerWithOktaOptionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *ghcmessages.CreateCustomerPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateCustomerWithOktaOptionParams() beforehand. -func (o *CreateCustomerWithOktaOptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateCustomerPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go deleted file mode 100644 index 901f27c6143..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateCustomerWithOktaOptionOKCode is the HTTP code returned for type CreateCustomerWithOktaOptionOK -const CreateCustomerWithOktaOptionOKCode int = 200 - -/* -CreateCustomerWithOktaOptionOK successfully created the customer - -swagger:response createCustomerWithOktaOptionOK -*/ -type CreateCustomerWithOktaOptionOK struct { - - /* - In: Body - */ - Payload *ghcmessages.CreatedCustomer `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionOK creates CreateCustomerWithOktaOptionOK with default headers values -func NewCreateCustomerWithOktaOptionOK() *CreateCustomerWithOktaOptionOK { - - return &CreateCustomerWithOktaOptionOK{} -} - -// WithPayload adds the payload to the create customer with okta option o k response -func (o *CreateCustomerWithOktaOptionOK) WithPayload(payload *ghcmessages.CreatedCustomer) *CreateCustomerWithOktaOptionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option o k response -func (o *CreateCustomerWithOktaOptionOK) SetPayload(payload *ghcmessages.CreatedCustomer) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionBadRequestCode is the HTTP code returned for type CreateCustomerWithOktaOptionBadRequest -const CreateCustomerWithOktaOptionBadRequestCode int = 400 - -/* -CreateCustomerWithOktaOptionBadRequest The request payload is invalid - -swagger:response createCustomerWithOktaOptionBadRequest -*/ -type CreateCustomerWithOktaOptionBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionBadRequest creates CreateCustomerWithOktaOptionBadRequest with default headers values -func NewCreateCustomerWithOktaOptionBadRequest() *CreateCustomerWithOktaOptionBadRequest { - - return &CreateCustomerWithOktaOptionBadRequest{} -} - -// WithPayload adds the payload to the create customer with okta option bad request response -func (o *CreateCustomerWithOktaOptionBadRequest) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option bad request response -func (o *CreateCustomerWithOktaOptionBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionUnauthorizedCode is the HTTP code returned for type CreateCustomerWithOktaOptionUnauthorized -const CreateCustomerWithOktaOptionUnauthorizedCode int = 401 - -/* -CreateCustomerWithOktaOptionUnauthorized The request was denied - -swagger:response createCustomerWithOktaOptionUnauthorized -*/ -type CreateCustomerWithOktaOptionUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionUnauthorized creates CreateCustomerWithOktaOptionUnauthorized with default headers values -func NewCreateCustomerWithOktaOptionUnauthorized() *CreateCustomerWithOktaOptionUnauthorized { - - return &CreateCustomerWithOktaOptionUnauthorized{} -} - -// WithPayload adds the payload to the create customer with okta option unauthorized response -func (o *CreateCustomerWithOktaOptionUnauthorized) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option unauthorized response -func (o *CreateCustomerWithOktaOptionUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionForbiddenCode is the HTTP code returned for type CreateCustomerWithOktaOptionForbidden -const CreateCustomerWithOktaOptionForbiddenCode int = 403 - -/* -CreateCustomerWithOktaOptionForbidden The request was denied - -swagger:response createCustomerWithOktaOptionForbidden -*/ -type CreateCustomerWithOktaOptionForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionForbidden creates CreateCustomerWithOktaOptionForbidden with default headers values -func NewCreateCustomerWithOktaOptionForbidden() *CreateCustomerWithOktaOptionForbidden { - - return &CreateCustomerWithOktaOptionForbidden{} -} - -// WithPayload adds the payload to the create customer with okta option forbidden response -func (o *CreateCustomerWithOktaOptionForbidden) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option forbidden response -func (o *CreateCustomerWithOktaOptionForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionNotFoundCode is the HTTP code returned for type CreateCustomerWithOktaOptionNotFound -const CreateCustomerWithOktaOptionNotFoundCode int = 404 - -/* -CreateCustomerWithOktaOptionNotFound The requested resource wasn't found - -swagger:response createCustomerWithOktaOptionNotFound -*/ -type CreateCustomerWithOktaOptionNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionNotFound creates CreateCustomerWithOktaOptionNotFound with default headers values -func NewCreateCustomerWithOktaOptionNotFound() *CreateCustomerWithOktaOptionNotFound { - - return &CreateCustomerWithOktaOptionNotFound{} -} - -// WithPayload adds the payload to the create customer with okta option not found response -func (o *CreateCustomerWithOktaOptionNotFound) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option not found response -func (o *CreateCustomerWithOktaOptionNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionConflictCode is the HTTP code returned for type CreateCustomerWithOktaOptionConflict -const CreateCustomerWithOktaOptionConflictCode int = 409 - -/* -CreateCustomerWithOktaOptionConflict Conflict error - -swagger:response createCustomerWithOktaOptionConflict -*/ -type CreateCustomerWithOktaOptionConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionConflict creates CreateCustomerWithOktaOptionConflict with default headers values -func NewCreateCustomerWithOktaOptionConflict() *CreateCustomerWithOktaOptionConflict { - - return &CreateCustomerWithOktaOptionConflict{} -} - -// WithPayload adds the payload to the create customer with okta option conflict response -func (o *CreateCustomerWithOktaOptionConflict) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option conflict response -func (o *CreateCustomerWithOktaOptionConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionPreconditionFailedCode is the HTTP code returned for type CreateCustomerWithOktaOptionPreconditionFailed -const CreateCustomerWithOktaOptionPreconditionFailedCode int = 412 - -/* -CreateCustomerWithOktaOptionPreconditionFailed Precondition failed - -swagger:response createCustomerWithOktaOptionPreconditionFailed -*/ -type CreateCustomerWithOktaOptionPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionPreconditionFailed creates CreateCustomerWithOktaOptionPreconditionFailed with default headers values -func NewCreateCustomerWithOktaOptionPreconditionFailed() *CreateCustomerWithOktaOptionPreconditionFailed { - - return &CreateCustomerWithOktaOptionPreconditionFailed{} -} - -// WithPayload adds the payload to the create customer with okta option precondition failed response -func (o *CreateCustomerWithOktaOptionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option precondition failed response -func (o *CreateCustomerWithOktaOptionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionUnprocessableEntityCode is the HTTP code returned for type CreateCustomerWithOktaOptionUnprocessableEntity -const CreateCustomerWithOktaOptionUnprocessableEntityCode int = 422 - -/* -CreateCustomerWithOktaOptionUnprocessableEntity The payload was unprocessable. - -swagger:response createCustomerWithOktaOptionUnprocessableEntity -*/ -type CreateCustomerWithOktaOptionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionUnprocessableEntity creates CreateCustomerWithOktaOptionUnprocessableEntity with default headers values -func NewCreateCustomerWithOktaOptionUnprocessableEntity() *CreateCustomerWithOktaOptionUnprocessableEntity { - - return &CreateCustomerWithOktaOptionUnprocessableEntity{} -} - -// WithPayload adds the payload to the create customer with okta option unprocessable entity response -func (o *CreateCustomerWithOktaOptionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateCustomerWithOktaOptionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option unprocessable entity response -func (o *CreateCustomerWithOktaOptionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerWithOktaOptionInternalServerErrorCode is the HTTP code returned for type CreateCustomerWithOktaOptionInternalServerError -const CreateCustomerWithOktaOptionInternalServerErrorCode int = 500 - -/* -CreateCustomerWithOktaOptionInternalServerError A server error occurred - -swagger:response createCustomerWithOktaOptionInternalServerError -*/ -type CreateCustomerWithOktaOptionInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerWithOktaOptionInternalServerError creates CreateCustomerWithOktaOptionInternalServerError with default headers values -func NewCreateCustomerWithOktaOptionInternalServerError() *CreateCustomerWithOktaOptionInternalServerError { - - return &CreateCustomerWithOktaOptionInternalServerError{} -} - -// WithPayload adds the payload to the create customer with okta option internal server error response -func (o *CreateCustomerWithOktaOptionInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer with okta option internal server error response -func (o *CreateCustomerWithOktaOptionInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerWithOktaOptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go deleted file mode 100644 index a7aba59aa7d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateCustomerWithOktaOptionURL generates an URL for the create customer with okta option operation -type CreateCustomerWithOktaOptionURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCustomerWithOktaOptionURL) WithBasePath(bp string) *CreateCustomerWithOktaOptionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCustomerWithOktaOptionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateCustomerWithOktaOptionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateCustomerWithOktaOptionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateCustomerWithOktaOptionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateCustomerWithOktaOptionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateCustomerWithOktaOptionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateCustomerWithOktaOptionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateCustomerWithOktaOptionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go deleted file mode 100644 index 13cda3bc69d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCustomerHandlerFunc turns a function with the right signature into a get customer handler -type GetCustomerHandlerFunc func(GetCustomerParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCustomerHandlerFunc) Handle(params GetCustomerParams) middleware.Responder { - return fn(params) -} - -// GetCustomerHandler interface for that can handle valid get customer params -type GetCustomerHandler interface { - Handle(GetCustomerParams) middleware.Responder -} - -// NewGetCustomer creates a new http.Handler for the get customer operation -func NewGetCustomer(ctx *middleware.Context, handler GetCustomerHandler) *GetCustomer { - return &GetCustomer{Context: ctx, Handler: handler} -} - -/* - GetCustomer swagger:route GET /customer/{customerID} customer getCustomer - -# Returns a given customer - -Returns a given customer -*/ -type GetCustomer struct { - Context *middleware.Context - Handler GetCustomerHandler -} - -func (o *GetCustomer) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCustomerParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go deleted file mode 100644 index b52b48a7125..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetCustomerParams creates a new GetCustomerParams object -// -// There are no default values defined in the spec. -func NewGetCustomerParams() GetCustomerParams { - - return GetCustomerParams{} -} - -// GetCustomerParams contains all the bound params for the get customer operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCustomer -type GetCustomerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of customer to use - Required: true - In: path - */ - CustomerID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCustomerParams() beforehand. -func (o *GetCustomerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rCustomerID, rhkCustomerID, _ := route.Params.GetOK("customerID") - if err := o.bindCustomerID(rCustomerID, rhkCustomerID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCustomerID binds and validates parameter CustomerID from path. -func (o *GetCustomerParams) bindCustomerID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("customerID", "path", "strfmt.UUID", raw) - } - o.CustomerID = *(value.(*strfmt.UUID)) - - if err := o.validateCustomerID(formats); err != nil { - return err - } - - return nil -} - -// validateCustomerID carries on validations for parameter CustomerID -func (o *GetCustomerParams) validateCustomerID(formats strfmt.Registry) error { - - if err := validate.FormatOf("customerID", "path", "uuid", o.CustomerID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go deleted file mode 100644 index b691559f3c2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetCustomerOKCode is the HTTP code returned for type GetCustomerOK -const GetCustomerOKCode int = 200 - -/* -GetCustomerOK Successfully retrieved information on an individual customer - -swagger:response getCustomerOK -*/ -type GetCustomerOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Customer `json:"body,omitempty"` -} - -// NewGetCustomerOK creates GetCustomerOK with default headers values -func NewGetCustomerOK() *GetCustomerOK { - - return &GetCustomerOK{} -} - -// WithPayload adds the payload to the get customer o k response -func (o *GetCustomerOK) WithPayload(payload *ghcmessages.Customer) *GetCustomerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer o k response -func (o *GetCustomerOK) SetPayload(payload *ghcmessages.Customer) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerBadRequestCode is the HTTP code returned for type GetCustomerBadRequest -const GetCustomerBadRequestCode int = 400 - -/* -GetCustomerBadRequest The request payload is invalid - -swagger:response getCustomerBadRequest -*/ -type GetCustomerBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerBadRequest creates GetCustomerBadRequest with default headers values -func NewGetCustomerBadRequest() *GetCustomerBadRequest { - - return &GetCustomerBadRequest{} -} - -// WithPayload adds the payload to the get customer bad request response -func (o *GetCustomerBadRequest) WithPayload(payload *ghcmessages.Error) *GetCustomerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer bad request response -func (o *GetCustomerBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerUnauthorizedCode is the HTTP code returned for type GetCustomerUnauthorized -const GetCustomerUnauthorizedCode int = 401 - -/* -GetCustomerUnauthorized The request was denied - -swagger:response getCustomerUnauthorized -*/ -type GetCustomerUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerUnauthorized creates GetCustomerUnauthorized with default headers values -func NewGetCustomerUnauthorized() *GetCustomerUnauthorized { - - return &GetCustomerUnauthorized{} -} - -// WithPayload adds the payload to the get customer unauthorized response -func (o *GetCustomerUnauthorized) WithPayload(payload *ghcmessages.Error) *GetCustomerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer unauthorized response -func (o *GetCustomerUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerForbiddenCode is the HTTP code returned for type GetCustomerForbidden -const GetCustomerForbiddenCode int = 403 - -/* -GetCustomerForbidden The request was denied - -swagger:response getCustomerForbidden -*/ -type GetCustomerForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerForbidden creates GetCustomerForbidden with default headers values -func NewGetCustomerForbidden() *GetCustomerForbidden { - - return &GetCustomerForbidden{} -} - -// WithPayload adds the payload to the get customer forbidden response -func (o *GetCustomerForbidden) WithPayload(payload *ghcmessages.Error) *GetCustomerForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer forbidden response -func (o *GetCustomerForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerNotFoundCode is the HTTP code returned for type GetCustomerNotFound -const GetCustomerNotFoundCode int = 404 - -/* -GetCustomerNotFound The requested resource wasn't found - -swagger:response getCustomerNotFound -*/ -type GetCustomerNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerNotFound creates GetCustomerNotFound with default headers values -func NewGetCustomerNotFound() *GetCustomerNotFound { - - return &GetCustomerNotFound{} -} - -// WithPayload adds the payload to the get customer not found response -func (o *GetCustomerNotFound) WithPayload(payload *ghcmessages.Error) *GetCustomerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer not found response -func (o *GetCustomerNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerInternalServerErrorCode is the HTTP code returned for type GetCustomerInternalServerError -const GetCustomerInternalServerErrorCode int = 500 - -/* -GetCustomerInternalServerError A server error occurred - -swagger:response getCustomerInternalServerError -*/ -type GetCustomerInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerInternalServerError creates GetCustomerInternalServerError with default headers values -func NewGetCustomerInternalServerError() *GetCustomerInternalServerError { - - return &GetCustomerInternalServerError{} -} - -// WithPayload adds the payload to the get customer internal server error response -func (o *GetCustomerInternalServerError) WithPayload(payload *ghcmessages.Error) *GetCustomerInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer internal server error response -func (o *GetCustomerInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go deleted file mode 100644 index 6a47ebf2086..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetCustomerURL generates an URL for the get customer operation -type GetCustomerURL struct { - CustomerID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCustomerURL) WithBasePath(bp string) *GetCustomerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCustomerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCustomerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer/{customerID}" - - customerID := o.CustomerID.String() - if customerID != "" { - _path = strings.Replace(_path, "{customerID}", customerID, -1) - } else { - return nil, errors.New("customerId is required on GetCustomerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCustomerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCustomerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCustomerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCustomerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCustomerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCustomerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go deleted file mode 100644 index 02f2dc2ab3a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go +++ /dev/null @@ -1,311 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SearchCustomersHandlerFunc turns a function with the right signature into a search customers handler -type SearchCustomersHandlerFunc func(SearchCustomersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SearchCustomersHandlerFunc) Handle(params SearchCustomersParams) middleware.Responder { - return fn(params) -} - -// SearchCustomersHandler interface for that can handle valid search customers params -type SearchCustomersHandler interface { - Handle(SearchCustomersParams) middleware.Responder -} - -// NewSearchCustomers creates a new http.Handler for the search customers operation -func NewSearchCustomers(ctx *middleware.Context, handler SearchCustomersHandler) *SearchCustomers { - return &SearchCustomers{Context: ctx, Handler: handler} -} - -/* - SearchCustomers swagger:route POST /customer/search customer searchCustomers - -# Search customers by DOD ID or customer name - -Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves. -*/ -type SearchCustomers struct { - Context *middleware.Context - Handler SearchCustomersHandler -} - -func (o *SearchCustomers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSearchCustomersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// SearchCustomersBody search customers body -// -// swagger:model SearchCustomersBody -type SearchCustomersBody struct { - - // Branch - // Min Length: 1 - Branch string `json:"branch,omitempty"` - - // Customer Name - // Min Length: 1 - CustomerName *string `json:"customerName,omitempty"` - - // DOD ID - // Max Length: 10 - // Min Length: 10 - Edipi *string `json:"edipi,omitempty"` - - // EMPLID - // Max Length: 7 - // Min Length: 7 - Emplid *string `json:"emplid,omitempty"` - - // order - // Enum: [asc desc] - Order *string `json:"order,omitempty"` - - // requested page of results - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // sort - // Enum: [customerName edipi emplid branch personalEmail telephone] - Sort *string `json:"sort,omitempty"` -} - -// Validate validates this search customers body -func (o *SearchCustomersBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateBranch(formats); err != nil { - res = append(res, err) - } - - if err := o.validateCustomerName(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEmplid(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSort(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchCustomersBody) validateBranch(formats strfmt.Registry) error { - if swag.IsZero(o.Branch) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"branch", "body", o.Branch, 1); err != nil { - return err - } - - return nil -} - -func (o *SearchCustomersBody) validateCustomerName(formats strfmt.Registry) error { - if swag.IsZero(o.CustomerName) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"customerName", "body", *o.CustomerName, 1); err != nil { - return err - } - - return nil -} - -func (o *SearchCustomersBody) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(o.Edipi) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { - return err - } - - return nil -} - -func (o *SearchCustomersBody) validateEmplid(formats strfmt.Registry) error { - if swag.IsZero(o.Emplid) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { - return err - } - - if err := validate.MaxLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { - return err - } - - return nil -} - -var searchCustomersBodyTypeOrderPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["asc","desc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - searchCustomersBodyTypeOrderPropEnum = append(searchCustomersBodyTypeOrderPropEnum, v) - } -} - -const ( - - // SearchCustomersBodyOrderAsc captures enum value "asc" - SearchCustomersBodyOrderAsc string = "asc" - - // SearchCustomersBodyOrderDesc captures enum value "desc" - SearchCustomersBodyOrderDesc string = "desc" -) - -// prop value enum -func (o *SearchCustomersBody) validateOrderEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, searchCustomersBodyTypeOrderPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *SearchCustomersBody) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(o.Order) { // not required - return nil - } - - // value enum - if err := o.validateOrderEnum("body"+"."+"order", "body", *o.Order); err != nil { - return err - } - - return nil -} - -var searchCustomersBodyTypeSortPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["customerName","edipi","emplid","branch","personalEmail","telephone"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - searchCustomersBodyTypeSortPropEnum = append(searchCustomersBodyTypeSortPropEnum, v) - } -} - -const ( - - // SearchCustomersBodySortCustomerName captures enum value "customerName" - SearchCustomersBodySortCustomerName string = "customerName" - - // SearchCustomersBodySortEdipi captures enum value "edipi" - SearchCustomersBodySortEdipi string = "edipi" - - // SearchCustomersBodySortEmplid captures enum value "emplid" - SearchCustomersBodySortEmplid string = "emplid" - - // SearchCustomersBodySortBranch captures enum value "branch" - SearchCustomersBodySortBranch string = "branch" - - // SearchCustomersBodySortPersonalEmail captures enum value "personalEmail" - SearchCustomersBodySortPersonalEmail string = "personalEmail" - - // SearchCustomersBodySortTelephone captures enum value "telephone" - SearchCustomersBodySortTelephone string = "telephone" -) - -// prop value enum -func (o *SearchCustomersBody) validateSortEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, searchCustomersBodyTypeSortPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *SearchCustomersBody) validateSort(formats strfmt.Registry) error { - if swag.IsZero(o.Sort) { // not required - return nil - } - - // value enum - if err := o.validateSortEnum("body"+"."+"sort", "body", *o.Sort); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this search customers body based on context it is used -func (o *SearchCustomersBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchCustomersBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchCustomersBody) UnmarshalBinary(b []byte) error { - var res SearchCustomersBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go deleted file mode 100644 index ca6d419ced9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" -) - -// NewSearchCustomersParams creates a new SearchCustomersParams object -// -// There are no default values defined in the spec. -func NewSearchCustomersParams() SearchCustomersParams { - - return SearchCustomersParams{} -} - -// SearchCustomersParams contains all the bound params for the search customers operation -// typically these are obtained from a http.Request -// -// swagger:parameters searchCustomers -type SearchCustomersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*field that results should be sorted by - In: body - */ - Body SearchCustomersBody -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSearchCustomersParams() beforehand. -func (o *SearchCustomersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body SearchCustomersBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go deleted file mode 100644 index 952e4e60a89..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// SearchCustomersOKCode is the HTTP code returned for type SearchCustomersOK -const SearchCustomersOKCode int = 200 - -/* -SearchCustomersOK Successfully returned all customers matching the criteria - -swagger:response searchCustomersOK -*/ -type SearchCustomersOK struct { - - /* - In: Body - */ - Payload *ghcmessages.SearchCustomersResult `json:"body,omitempty"` -} - -// NewSearchCustomersOK creates SearchCustomersOK with default headers values -func NewSearchCustomersOK() *SearchCustomersOK { - - return &SearchCustomersOK{} -} - -// WithPayload adds the payload to the search customers o k response -func (o *SearchCustomersOK) WithPayload(payload *ghcmessages.SearchCustomersResult) *SearchCustomersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search customers o k response -func (o *SearchCustomersOK) SetPayload(payload *ghcmessages.SearchCustomersResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchCustomersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SearchCustomersForbiddenCode is the HTTP code returned for type SearchCustomersForbidden -const SearchCustomersForbiddenCode int = 403 - -/* -SearchCustomersForbidden The request was denied - -swagger:response searchCustomersForbidden -*/ -type SearchCustomersForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSearchCustomersForbidden creates SearchCustomersForbidden with default headers values -func NewSearchCustomersForbidden() *SearchCustomersForbidden { - - return &SearchCustomersForbidden{} -} - -// WithPayload adds the payload to the search customers forbidden response -func (o *SearchCustomersForbidden) WithPayload(payload *ghcmessages.Error) *SearchCustomersForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search customers forbidden response -func (o *SearchCustomersForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchCustomersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SearchCustomersInternalServerErrorCode is the HTTP code returned for type SearchCustomersInternalServerError -const SearchCustomersInternalServerErrorCode int = 500 - -/* -SearchCustomersInternalServerError A server error occurred - -swagger:response searchCustomersInternalServerError -*/ -type SearchCustomersInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSearchCustomersInternalServerError creates SearchCustomersInternalServerError with default headers values -func NewSearchCustomersInternalServerError() *SearchCustomersInternalServerError { - - return &SearchCustomersInternalServerError{} -} - -// WithPayload adds the payload to the search customers internal server error response -func (o *SearchCustomersInternalServerError) WithPayload(payload *ghcmessages.Error) *SearchCustomersInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search customers internal server error response -func (o *SearchCustomersInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchCustomersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go deleted file mode 100644 index 06d228d61fd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// SearchCustomersURL generates an URL for the search customers operation -type SearchCustomersURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchCustomersURL) WithBasePath(bp string) *SearchCustomersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchCustomersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SearchCustomersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer/search" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SearchCustomersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SearchCustomersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SearchCustomersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SearchCustomersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SearchCustomersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SearchCustomersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go deleted file mode 100644 index 4a6bf76daa4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateCustomerHandlerFunc turns a function with the right signature into a update customer handler -type UpdateCustomerHandlerFunc func(UpdateCustomerParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCustomerHandlerFunc) Handle(params UpdateCustomerParams) middleware.Responder { - return fn(params) -} - -// UpdateCustomerHandler interface for that can handle valid update customer params -type UpdateCustomerHandler interface { - Handle(UpdateCustomerParams) middleware.Responder -} - -// NewUpdateCustomer creates a new http.Handler for the update customer operation -func NewUpdateCustomer(ctx *middleware.Context, handler UpdateCustomerHandler) *UpdateCustomer { - return &UpdateCustomer{Context: ctx, Handler: handler} -} - -/* - UpdateCustomer swagger:route PATCH /customer/{customerID} customer updateCustomer - -# Updates customer info - -Updates customer info by ID -*/ -type UpdateCustomer struct { - Context *middleware.Context - Handler UpdateCustomerHandler -} - -func (o *UpdateCustomer) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCustomerParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go deleted file mode 100644 index 18fb04926d8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateCustomerParams creates a new UpdateCustomerParams object -// -// There are no default values defined in the spec. -func NewUpdateCustomerParams() UpdateCustomerParams { - - return UpdateCustomerParams{} -} - -// UpdateCustomerParams contains all the bound params for the update customer operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCustomer -type UpdateCustomerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateCustomerPayload - /*ID of customer to use - Required: true - In: path - */ - CustomerID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCustomerParams() beforehand. -func (o *UpdateCustomerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateCustomerPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rCustomerID, rhkCustomerID, _ := route.Params.GetOK("customerID") - if err := o.bindCustomerID(rCustomerID, rhkCustomerID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateCustomerParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindCustomerID binds and validates parameter CustomerID from path. -func (o *UpdateCustomerParams) bindCustomerID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("customerID", "path", "strfmt.UUID", raw) - } - o.CustomerID = *(value.(*strfmt.UUID)) - - if err := o.validateCustomerID(formats); err != nil { - return err - } - - return nil -} - -// validateCustomerID carries on validations for parameter CustomerID -func (o *UpdateCustomerParams) validateCustomerID(formats strfmt.Registry) error { - - if err := validate.FormatOf("customerID", "path", "uuid", o.CustomerID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go deleted file mode 100644 index b51b3d26bc5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateCustomerOKCode is the HTTP code returned for type UpdateCustomerOK -const UpdateCustomerOKCode int = 200 - -/* -UpdateCustomerOK updated instance of orders - -swagger:response updateCustomerOK -*/ -type UpdateCustomerOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Customer `json:"body,omitempty"` -} - -// NewUpdateCustomerOK creates UpdateCustomerOK with default headers values -func NewUpdateCustomerOK() *UpdateCustomerOK { - - return &UpdateCustomerOK{} -} - -// WithPayload adds the payload to the update customer o k response -func (o *UpdateCustomerOK) WithPayload(payload *ghcmessages.Customer) *UpdateCustomerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer o k response -func (o *UpdateCustomerOK) SetPayload(payload *ghcmessages.Customer) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerBadRequestCode is the HTTP code returned for type UpdateCustomerBadRequest -const UpdateCustomerBadRequestCode int = 400 - -/* -UpdateCustomerBadRequest The request payload is invalid - -swagger:response updateCustomerBadRequest -*/ -type UpdateCustomerBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerBadRequest creates UpdateCustomerBadRequest with default headers values -func NewUpdateCustomerBadRequest() *UpdateCustomerBadRequest { - - return &UpdateCustomerBadRequest{} -} - -// WithPayload adds the payload to the update customer bad request response -func (o *UpdateCustomerBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCustomerBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer bad request response -func (o *UpdateCustomerBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerUnauthorizedCode is the HTTP code returned for type UpdateCustomerUnauthorized -const UpdateCustomerUnauthorizedCode int = 401 - -/* -UpdateCustomerUnauthorized The request was denied - -swagger:response updateCustomerUnauthorized -*/ -type UpdateCustomerUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerUnauthorized creates UpdateCustomerUnauthorized with default headers values -func NewUpdateCustomerUnauthorized() *UpdateCustomerUnauthorized { - - return &UpdateCustomerUnauthorized{} -} - -// WithPayload adds the payload to the update customer unauthorized response -func (o *UpdateCustomerUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateCustomerUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer unauthorized response -func (o *UpdateCustomerUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerForbiddenCode is the HTTP code returned for type UpdateCustomerForbidden -const UpdateCustomerForbiddenCode int = 403 - -/* -UpdateCustomerForbidden The request was denied - -swagger:response updateCustomerForbidden -*/ -type UpdateCustomerForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerForbidden creates UpdateCustomerForbidden with default headers values -func NewUpdateCustomerForbidden() *UpdateCustomerForbidden { - - return &UpdateCustomerForbidden{} -} - -// WithPayload adds the payload to the update customer forbidden response -func (o *UpdateCustomerForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCustomerForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer forbidden response -func (o *UpdateCustomerForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerNotFoundCode is the HTTP code returned for type UpdateCustomerNotFound -const UpdateCustomerNotFoundCode int = 404 - -/* -UpdateCustomerNotFound The requested resource wasn't found - -swagger:response updateCustomerNotFound -*/ -type UpdateCustomerNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerNotFound creates UpdateCustomerNotFound with default headers values -func NewUpdateCustomerNotFound() *UpdateCustomerNotFound { - - return &UpdateCustomerNotFound{} -} - -// WithPayload adds the payload to the update customer not found response -func (o *UpdateCustomerNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCustomerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer not found response -func (o *UpdateCustomerNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerPreconditionFailedCode is the HTTP code returned for type UpdateCustomerPreconditionFailed -const UpdateCustomerPreconditionFailedCode int = 412 - -/* -UpdateCustomerPreconditionFailed Precondition failed - -swagger:response updateCustomerPreconditionFailed -*/ -type UpdateCustomerPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerPreconditionFailed creates UpdateCustomerPreconditionFailed with default headers values -func NewUpdateCustomerPreconditionFailed() *UpdateCustomerPreconditionFailed { - - return &UpdateCustomerPreconditionFailed{} -} - -// WithPayload adds the payload to the update customer precondition failed response -func (o *UpdateCustomerPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateCustomerPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer precondition failed response -func (o *UpdateCustomerPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerUnprocessableEntityCode is the HTTP code returned for type UpdateCustomerUnprocessableEntity -const UpdateCustomerUnprocessableEntityCode int = 422 - -/* -UpdateCustomerUnprocessableEntity The payload was unprocessable. - -swagger:response updateCustomerUnprocessableEntity -*/ -type UpdateCustomerUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateCustomerUnprocessableEntity creates UpdateCustomerUnprocessableEntity with default headers values -func NewUpdateCustomerUnprocessableEntity() *UpdateCustomerUnprocessableEntity { - - return &UpdateCustomerUnprocessableEntity{} -} - -// WithPayload adds the payload to the update customer unprocessable entity response -func (o *UpdateCustomerUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCustomerUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer unprocessable entity response -func (o *UpdateCustomerUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerInternalServerErrorCode is the HTTP code returned for type UpdateCustomerInternalServerError -const UpdateCustomerInternalServerErrorCode int = 500 - -/* -UpdateCustomerInternalServerError A server error occurred - -swagger:response updateCustomerInternalServerError -*/ -type UpdateCustomerInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerInternalServerError creates UpdateCustomerInternalServerError with default headers values -func NewUpdateCustomerInternalServerError() *UpdateCustomerInternalServerError { - - return &UpdateCustomerInternalServerError{} -} - -// WithPayload adds the payload to the update customer internal server error response -func (o *UpdateCustomerInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCustomerInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer internal server error response -func (o *UpdateCustomerInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go deleted file mode 100644 index 7b2c291da15..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateCustomerURL generates an URL for the update customer operation -type UpdateCustomerURL struct { - CustomerID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCustomerURL) WithBasePath(bp string) *UpdateCustomerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCustomerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCustomerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer/{customerID}" - - customerID := o.CustomerID.String() - if customerID != "" { - _path = strings.Replace(_path, "{customerID}", customerID, -1) - } else { - return nil, errors.New("customerId is required on UpdateCustomerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCustomerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCustomerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCustomerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCustomerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCustomerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCustomerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go deleted file mode 100644 index 59cc9ed4fb8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateCustomerSupportRemarkForMoveHandlerFunc turns a function with the right signature into a create customer support remark for move handler -type CreateCustomerSupportRemarkForMoveHandlerFunc func(CreateCustomerSupportRemarkForMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateCustomerSupportRemarkForMoveHandlerFunc) Handle(params CreateCustomerSupportRemarkForMoveParams) middleware.Responder { - return fn(params) -} - -// CreateCustomerSupportRemarkForMoveHandler interface for that can handle valid create customer support remark for move params -type CreateCustomerSupportRemarkForMoveHandler interface { - Handle(CreateCustomerSupportRemarkForMoveParams) middleware.Responder -} - -// NewCreateCustomerSupportRemarkForMove creates a new http.Handler for the create customer support remark for move operation -func NewCreateCustomerSupportRemarkForMove(ctx *middleware.Context, handler CreateCustomerSupportRemarkForMoveHandler) *CreateCustomerSupportRemarkForMove { - return &CreateCustomerSupportRemarkForMove{Context: ctx, Handler: handler} -} - -/* - CreateCustomerSupportRemarkForMove swagger:route POST /moves/{locator}/customer-support-remarks customerSupportRemarks createCustomerSupportRemarkForMove - -# Creates a customer support remark for a move - -Creates a customer support remark for a move -*/ -type CreateCustomerSupportRemarkForMove struct { - Context *middleware.Context - Handler CreateCustomerSupportRemarkForMoveHandler -} - -func (o *CreateCustomerSupportRemarkForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateCustomerSupportRemarkForMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go deleted file mode 100644 index 130357392b8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateCustomerSupportRemarkForMoveParams creates a new CreateCustomerSupportRemarkForMoveParams object -// -// There are no default values defined in the spec. -func NewCreateCustomerSupportRemarkForMoveParams() CreateCustomerSupportRemarkForMoveParams { - - return CreateCustomerSupportRemarkForMoveParams{} -} - -// CreateCustomerSupportRemarkForMoveParams contains all the bound params for the create customer support remark for move operation -// typically these are obtained from a http.Request -// -// swagger:parameters createCustomerSupportRemarkForMove -type CreateCustomerSupportRemarkForMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.CreateCustomerSupportRemark - /*move code to identify a move for customer support remarks - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateCustomerSupportRemarkForMoveParams() beforehand. -func (o *CreateCustomerSupportRemarkForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateCustomerSupportRemark - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *CreateCustomerSupportRemarkForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go deleted file mode 100644 index be2f4b1bde6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateCustomerSupportRemarkForMoveOKCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveOK -const CreateCustomerSupportRemarkForMoveOKCode int = 200 - -/* -CreateCustomerSupportRemarkForMoveOK Successfully created customer support remark - -swagger:response createCustomerSupportRemarkForMoveOK -*/ -type CreateCustomerSupportRemarkForMoveOK struct { - - /* - In: Body - */ - Payload *ghcmessages.CustomerSupportRemark `json:"body,omitempty"` -} - -// NewCreateCustomerSupportRemarkForMoveOK creates CreateCustomerSupportRemarkForMoveOK with default headers values -func NewCreateCustomerSupportRemarkForMoveOK() *CreateCustomerSupportRemarkForMoveOK { - - return &CreateCustomerSupportRemarkForMoveOK{} -} - -// WithPayload adds the payload to the create customer support remark for move o k response -func (o *CreateCustomerSupportRemarkForMoveOK) WithPayload(payload *ghcmessages.CustomerSupportRemark) *CreateCustomerSupportRemarkForMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer support remark for move o k response -func (o *CreateCustomerSupportRemarkForMoveOK) SetPayload(payload *ghcmessages.CustomerSupportRemark) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerSupportRemarkForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerSupportRemarkForMoveBadRequestCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveBadRequest -const CreateCustomerSupportRemarkForMoveBadRequestCode int = 400 - -/* -CreateCustomerSupportRemarkForMoveBadRequest The request payload is invalid - -swagger:response createCustomerSupportRemarkForMoveBadRequest -*/ -type CreateCustomerSupportRemarkForMoveBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerSupportRemarkForMoveBadRequest creates CreateCustomerSupportRemarkForMoveBadRequest with default headers values -func NewCreateCustomerSupportRemarkForMoveBadRequest() *CreateCustomerSupportRemarkForMoveBadRequest { - - return &CreateCustomerSupportRemarkForMoveBadRequest{} -} - -// WithPayload adds the payload to the create customer support remark for move bad request response -func (o *CreateCustomerSupportRemarkForMoveBadRequest) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer support remark for move bad request response -func (o *CreateCustomerSupportRemarkForMoveBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerSupportRemarkForMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerSupportRemarkForMoveNotFoundCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveNotFound -const CreateCustomerSupportRemarkForMoveNotFoundCode int = 404 - -/* -CreateCustomerSupportRemarkForMoveNotFound The requested resource wasn't found - -swagger:response createCustomerSupportRemarkForMoveNotFound -*/ -type CreateCustomerSupportRemarkForMoveNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerSupportRemarkForMoveNotFound creates CreateCustomerSupportRemarkForMoveNotFound with default headers values -func NewCreateCustomerSupportRemarkForMoveNotFound() *CreateCustomerSupportRemarkForMoveNotFound { - - return &CreateCustomerSupportRemarkForMoveNotFound{} -} - -// WithPayload adds the payload to the create customer support remark for move not found response -func (o *CreateCustomerSupportRemarkForMoveNotFound) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer support remark for move not found response -func (o *CreateCustomerSupportRemarkForMoveNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerSupportRemarkForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerSupportRemarkForMoveUnprocessableEntityCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveUnprocessableEntity -const CreateCustomerSupportRemarkForMoveUnprocessableEntityCode int = 422 - -/* -CreateCustomerSupportRemarkForMoveUnprocessableEntity The payload was unprocessable. - -swagger:response createCustomerSupportRemarkForMoveUnprocessableEntity -*/ -type CreateCustomerSupportRemarkForMoveUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateCustomerSupportRemarkForMoveUnprocessableEntity creates CreateCustomerSupportRemarkForMoveUnprocessableEntity with default headers values -func NewCreateCustomerSupportRemarkForMoveUnprocessableEntity() *CreateCustomerSupportRemarkForMoveUnprocessableEntity { - - return &CreateCustomerSupportRemarkForMoveUnprocessableEntity{} -} - -// WithPayload adds the payload to the create customer support remark for move unprocessable entity response -func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateCustomerSupportRemarkForMoveUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer support remark for move unprocessable entity response -func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateCustomerSupportRemarkForMoveInternalServerErrorCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveInternalServerError -const CreateCustomerSupportRemarkForMoveInternalServerErrorCode int = 500 - -/* -CreateCustomerSupportRemarkForMoveInternalServerError A server error occurred - -swagger:response createCustomerSupportRemarkForMoveInternalServerError -*/ -type CreateCustomerSupportRemarkForMoveInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateCustomerSupportRemarkForMoveInternalServerError creates CreateCustomerSupportRemarkForMoveInternalServerError with default headers values -func NewCreateCustomerSupportRemarkForMoveInternalServerError() *CreateCustomerSupportRemarkForMoveInternalServerError { - - return &CreateCustomerSupportRemarkForMoveInternalServerError{} -} - -// WithPayload adds the payload to the create customer support remark for move internal server error response -func (o *CreateCustomerSupportRemarkForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create customer support remark for move internal server error response -func (o *CreateCustomerSupportRemarkForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateCustomerSupportRemarkForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go deleted file mode 100644 index 5d698538cc2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// CreateCustomerSupportRemarkForMoveURL generates an URL for the create customer support remark for move operation -type CreateCustomerSupportRemarkForMoveURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCustomerSupportRemarkForMoveURL) WithBasePath(bp string) *CreateCustomerSupportRemarkForMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateCustomerSupportRemarkForMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateCustomerSupportRemarkForMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/customer-support-remarks" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on CreateCustomerSupportRemarkForMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateCustomerSupportRemarkForMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateCustomerSupportRemarkForMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateCustomerSupportRemarkForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateCustomerSupportRemarkForMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateCustomerSupportRemarkForMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateCustomerSupportRemarkForMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go deleted file mode 100644 index a297b3a6709..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteCustomerSupportRemarkHandlerFunc turns a function with the right signature into a delete customer support remark handler -type DeleteCustomerSupportRemarkHandlerFunc func(DeleteCustomerSupportRemarkParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteCustomerSupportRemarkHandlerFunc) Handle(params DeleteCustomerSupportRemarkParams) middleware.Responder { - return fn(params) -} - -// DeleteCustomerSupportRemarkHandler interface for that can handle valid delete customer support remark params -type DeleteCustomerSupportRemarkHandler interface { - Handle(DeleteCustomerSupportRemarkParams) middleware.Responder -} - -// NewDeleteCustomerSupportRemark creates a new http.Handler for the delete customer support remark operation -func NewDeleteCustomerSupportRemark(ctx *middleware.Context, handler DeleteCustomerSupportRemarkHandler) *DeleteCustomerSupportRemark { - return &DeleteCustomerSupportRemark{Context: ctx, Handler: handler} -} - -/* - DeleteCustomerSupportRemark swagger:route DELETE /customer-support-remarks/{customerSupportRemarkID} customerSupportRemarks deleteCustomerSupportRemark - -# Soft deletes a customer support remark by ID - -Soft deletes a customer support remark by ID -*/ -type DeleteCustomerSupportRemark struct { - Context *middleware.Context - Handler DeleteCustomerSupportRemarkHandler -} - -func (o *DeleteCustomerSupportRemark) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteCustomerSupportRemarkParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go deleted file mode 100644 index 97d6230ff57..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteCustomerSupportRemarkParams creates a new DeleteCustomerSupportRemarkParams object -// -// There are no default values defined in the spec. -func NewDeleteCustomerSupportRemarkParams() DeleteCustomerSupportRemarkParams { - - return DeleteCustomerSupportRemarkParams{} -} - -// DeleteCustomerSupportRemarkParams contains all the bound params for the delete customer support remark operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteCustomerSupportRemark -type DeleteCustomerSupportRemarkParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the customer support remark ID to be modified - Required: true - In: path - */ - CustomerSupportRemarkID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteCustomerSupportRemarkParams() beforehand. -func (o *DeleteCustomerSupportRemarkParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, _ := route.Params.GetOK("customerSupportRemarkID") - if err := o.bindCustomerSupportRemarkID(rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCustomerSupportRemarkID binds and validates parameter CustomerSupportRemarkID from path. -func (o *DeleteCustomerSupportRemarkParams) bindCustomerSupportRemarkID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("customerSupportRemarkID", "path", "strfmt.UUID", raw) - } - o.CustomerSupportRemarkID = *(value.(*strfmt.UUID)) - - if err := o.validateCustomerSupportRemarkID(formats); err != nil { - return err - } - - return nil -} - -// validateCustomerSupportRemarkID carries on validations for parameter CustomerSupportRemarkID -func (o *DeleteCustomerSupportRemarkParams) validateCustomerSupportRemarkID(formats strfmt.Registry) error { - - if err := validate.FormatOf("customerSupportRemarkID", "path", "uuid", o.CustomerSupportRemarkID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go deleted file mode 100644 index 5152215d37b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DeleteCustomerSupportRemarkNoContentCode is the HTTP code returned for type DeleteCustomerSupportRemarkNoContent -const DeleteCustomerSupportRemarkNoContentCode int = 204 - -/* -DeleteCustomerSupportRemarkNoContent Successfully soft deleted the shipment - -swagger:response deleteCustomerSupportRemarkNoContent -*/ -type DeleteCustomerSupportRemarkNoContent struct { -} - -// NewDeleteCustomerSupportRemarkNoContent creates DeleteCustomerSupportRemarkNoContent with default headers values -func NewDeleteCustomerSupportRemarkNoContent() *DeleteCustomerSupportRemarkNoContent { - - return &DeleteCustomerSupportRemarkNoContent{} -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteCustomerSupportRemarkBadRequestCode is the HTTP code returned for type DeleteCustomerSupportRemarkBadRequest -const DeleteCustomerSupportRemarkBadRequestCode int = 400 - -/* -DeleteCustomerSupportRemarkBadRequest The request payload is invalid - -swagger:response deleteCustomerSupportRemarkBadRequest -*/ -type DeleteCustomerSupportRemarkBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkBadRequest creates DeleteCustomerSupportRemarkBadRequest with default headers values -func NewDeleteCustomerSupportRemarkBadRequest() *DeleteCustomerSupportRemarkBadRequest { - - return &DeleteCustomerSupportRemarkBadRequest{} -} - -// WithPayload adds the payload to the delete customer support remark bad request response -func (o *DeleteCustomerSupportRemarkBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark bad request response -func (o *DeleteCustomerSupportRemarkBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCustomerSupportRemarkForbiddenCode is the HTTP code returned for type DeleteCustomerSupportRemarkForbidden -const DeleteCustomerSupportRemarkForbiddenCode int = 403 - -/* -DeleteCustomerSupportRemarkForbidden The request was denied - -swagger:response deleteCustomerSupportRemarkForbidden -*/ -type DeleteCustomerSupportRemarkForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkForbidden creates DeleteCustomerSupportRemarkForbidden with default headers values -func NewDeleteCustomerSupportRemarkForbidden() *DeleteCustomerSupportRemarkForbidden { - - return &DeleteCustomerSupportRemarkForbidden{} -} - -// WithPayload adds the payload to the delete customer support remark forbidden response -func (o *DeleteCustomerSupportRemarkForbidden) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark forbidden response -func (o *DeleteCustomerSupportRemarkForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCustomerSupportRemarkNotFoundCode is the HTTP code returned for type DeleteCustomerSupportRemarkNotFound -const DeleteCustomerSupportRemarkNotFoundCode int = 404 - -/* -DeleteCustomerSupportRemarkNotFound The requested resource wasn't found - -swagger:response deleteCustomerSupportRemarkNotFound -*/ -type DeleteCustomerSupportRemarkNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkNotFound creates DeleteCustomerSupportRemarkNotFound with default headers values -func NewDeleteCustomerSupportRemarkNotFound() *DeleteCustomerSupportRemarkNotFound { - - return &DeleteCustomerSupportRemarkNotFound{} -} - -// WithPayload adds the payload to the delete customer support remark not found response -func (o *DeleteCustomerSupportRemarkNotFound) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark not found response -func (o *DeleteCustomerSupportRemarkNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCustomerSupportRemarkConflictCode is the HTTP code returned for type DeleteCustomerSupportRemarkConflict -const DeleteCustomerSupportRemarkConflictCode int = 409 - -/* -DeleteCustomerSupportRemarkConflict Conflict error - -swagger:response deleteCustomerSupportRemarkConflict -*/ -type DeleteCustomerSupportRemarkConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkConflict creates DeleteCustomerSupportRemarkConflict with default headers values -func NewDeleteCustomerSupportRemarkConflict() *DeleteCustomerSupportRemarkConflict { - - return &DeleteCustomerSupportRemarkConflict{} -} - -// WithPayload adds the payload to the delete customer support remark conflict response -func (o *DeleteCustomerSupportRemarkConflict) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark conflict response -func (o *DeleteCustomerSupportRemarkConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCustomerSupportRemarkUnprocessableEntityCode is the HTTP code returned for type DeleteCustomerSupportRemarkUnprocessableEntity -const DeleteCustomerSupportRemarkUnprocessableEntityCode int = 422 - -/* -DeleteCustomerSupportRemarkUnprocessableEntity The payload was unprocessable. - -swagger:response deleteCustomerSupportRemarkUnprocessableEntity -*/ -type DeleteCustomerSupportRemarkUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkUnprocessableEntity creates DeleteCustomerSupportRemarkUnprocessableEntity with default headers values -func NewDeleteCustomerSupportRemarkUnprocessableEntity() *DeleteCustomerSupportRemarkUnprocessableEntity { - - return &DeleteCustomerSupportRemarkUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete customer support remark unprocessable entity response -func (o *DeleteCustomerSupportRemarkUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteCustomerSupportRemarkUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark unprocessable entity response -func (o *DeleteCustomerSupportRemarkUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteCustomerSupportRemarkInternalServerErrorCode is the HTTP code returned for type DeleteCustomerSupportRemarkInternalServerError -const DeleteCustomerSupportRemarkInternalServerErrorCode int = 500 - -/* -DeleteCustomerSupportRemarkInternalServerError A server error occurred - -swagger:response deleteCustomerSupportRemarkInternalServerError -*/ -type DeleteCustomerSupportRemarkInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteCustomerSupportRemarkInternalServerError creates DeleteCustomerSupportRemarkInternalServerError with default headers values -func NewDeleteCustomerSupportRemarkInternalServerError() *DeleteCustomerSupportRemarkInternalServerError { - - return &DeleteCustomerSupportRemarkInternalServerError{} -} - -// WithPayload adds the payload to the delete customer support remark internal server error response -func (o *DeleteCustomerSupportRemarkInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete customer support remark internal server error response -func (o *DeleteCustomerSupportRemarkInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteCustomerSupportRemarkInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go deleted file mode 100644 index 591af7abaa6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteCustomerSupportRemarkURL generates an URL for the delete customer support remark operation -type DeleteCustomerSupportRemarkURL struct { - CustomerSupportRemarkID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCustomerSupportRemarkURL) WithBasePath(bp string) *DeleteCustomerSupportRemarkURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteCustomerSupportRemarkURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteCustomerSupportRemarkURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer-support-remarks/{customerSupportRemarkID}" - - customerSupportRemarkID := o.CustomerSupportRemarkID.String() - if customerSupportRemarkID != "" { - _path = strings.Replace(_path, "{customerSupportRemarkID}", customerSupportRemarkID, -1) - } else { - return nil, errors.New("customerSupportRemarkId is required on DeleteCustomerSupportRemarkURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteCustomerSupportRemarkURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteCustomerSupportRemarkURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteCustomerSupportRemarkURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteCustomerSupportRemarkURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteCustomerSupportRemarkURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteCustomerSupportRemarkURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go deleted file mode 100644 index f0bd4560481..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetCustomerSupportRemarksForMoveHandlerFunc turns a function with the right signature into a get customer support remarks for move handler -type GetCustomerSupportRemarksForMoveHandlerFunc func(GetCustomerSupportRemarksForMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetCustomerSupportRemarksForMoveHandlerFunc) Handle(params GetCustomerSupportRemarksForMoveParams) middleware.Responder { - return fn(params) -} - -// GetCustomerSupportRemarksForMoveHandler interface for that can handle valid get customer support remarks for move params -type GetCustomerSupportRemarksForMoveHandler interface { - Handle(GetCustomerSupportRemarksForMoveParams) middleware.Responder -} - -// NewGetCustomerSupportRemarksForMove creates a new http.Handler for the get customer support remarks for move operation -func NewGetCustomerSupportRemarksForMove(ctx *middleware.Context, handler GetCustomerSupportRemarksForMoveHandler) *GetCustomerSupportRemarksForMove { - return &GetCustomerSupportRemarksForMove{Context: ctx, Handler: handler} -} - -/* - GetCustomerSupportRemarksForMove swagger:route GET /moves/{locator}/customer-support-remarks customerSupportRemarks getCustomerSupportRemarksForMove - -Fetches customer support remarks using the move code (locator). - -Fetches customer support remarks for a move -*/ -type GetCustomerSupportRemarksForMove struct { - Context *middleware.Context - Handler GetCustomerSupportRemarksForMoveHandler -} - -func (o *GetCustomerSupportRemarksForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetCustomerSupportRemarksForMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go deleted file mode 100644 index 626a4fb8b99..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetCustomerSupportRemarksForMoveParams creates a new GetCustomerSupportRemarksForMoveParams object -// -// There are no default values defined in the spec. -func NewGetCustomerSupportRemarksForMoveParams() GetCustomerSupportRemarksForMoveParams { - - return GetCustomerSupportRemarksForMoveParams{} -} - -// GetCustomerSupportRemarksForMoveParams contains all the bound params for the get customer support remarks for move operation -// typically these are obtained from a http.Request -// -// swagger:parameters getCustomerSupportRemarksForMove -type GetCustomerSupportRemarksForMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*move code to identify a move for customer support remarks - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetCustomerSupportRemarksForMoveParams() beforehand. -func (o *GetCustomerSupportRemarksForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *GetCustomerSupportRemarksForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go deleted file mode 100644 index cf6db5b9820..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetCustomerSupportRemarksForMoveOKCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveOK -const GetCustomerSupportRemarksForMoveOKCode int = 200 - -/* -GetCustomerSupportRemarksForMoveOK Successfully retrieved all line items for a move task order - -swagger:response getCustomerSupportRemarksForMoveOK -*/ -type GetCustomerSupportRemarksForMoveOK struct { - - /* - In: Body - */ - Payload ghcmessages.CustomerSupportRemarks `json:"body,omitempty"` -} - -// NewGetCustomerSupportRemarksForMoveOK creates GetCustomerSupportRemarksForMoveOK with default headers values -func NewGetCustomerSupportRemarksForMoveOK() *GetCustomerSupportRemarksForMoveOK { - - return &GetCustomerSupportRemarksForMoveOK{} -} - -// WithPayload adds the payload to the get customer support remarks for move o k response -func (o *GetCustomerSupportRemarksForMoveOK) WithPayload(payload ghcmessages.CustomerSupportRemarks) *GetCustomerSupportRemarksForMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer support remarks for move o k response -func (o *GetCustomerSupportRemarksForMoveOK) SetPayload(payload ghcmessages.CustomerSupportRemarks) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerSupportRemarksForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.CustomerSupportRemarks{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetCustomerSupportRemarksForMoveForbiddenCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveForbidden -const GetCustomerSupportRemarksForMoveForbiddenCode int = 403 - -/* -GetCustomerSupportRemarksForMoveForbidden The request was denied - -swagger:response getCustomerSupportRemarksForMoveForbidden -*/ -type GetCustomerSupportRemarksForMoveForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerSupportRemarksForMoveForbidden creates GetCustomerSupportRemarksForMoveForbidden with default headers values -func NewGetCustomerSupportRemarksForMoveForbidden() *GetCustomerSupportRemarksForMoveForbidden { - - return &GetCustomerSupportRemarksForMoveForbidden{} -} - -// WithPayload adds the payload to the get customer support remarks for move forbidden response -func (o *GetCustomerSupportRemarksForMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer support remarks for move forbidden response -func (o *GetCustomerSupportRemarksForMoveForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerSupportRemarksForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerSupportRemarksForMoveNotFoundCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveNotFound -const GetCustomerSupportRemarksForMoveNotFoundCode int = 404 - -/* -GetCustomerSupportRemarksForMoveNotFound The requested resource wasn't found - -swagger:response getCustomerSupportRemarksForMoveNotFound -*/ -type GetCustomerSupportRemarksForMoveNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerSupportRemarksForMoveNotFound creates GetCustomerSupportRemarksForMoveNotFound with default headers values -func NewGetCustomerSupportRemarksForMoveNotFound() *GetCustomerSupportRemarksForMoveNotFound { - - return &GetCustomerSupportRemarksForMoveNotFound{} -} - -// WithPayload adds the payload to the get customer support remarks for move not found response -func (o *GetCustomerSupportRemarksForMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer support remarks for move not found response -func (o *GetCustomerSupportRemarksForMoveNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerSupportRemarksForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerSupportRemarksForMoveUnprocessableEntityCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveUnprocessableEntity -const GetCustomerSupportRemarksForMoveUnprocessableEntityCode int = 422 - -/* -GetCustomerSupportRemarksForMoveUnprocessableEntity The payload was unprocessable. - -swagger:response getCustomerSupportRemarksForMoveUnprocessableEntity -*/ -type GetCustomerSupportRemarksForMoveUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetCustomerSupportRemarksForMoveUnprocessableEntity creates GetCustomerSupportRemarksForMoveUnprocessableEntity with default headers values -func NewGetCustomerSupportRemarksForMoveUnprocessableEntity() *GetCustomerSupportRemarksForMoveUnprocessableEntity { - - return &GetCustomerSupportRemarksForMoveUnprocessableEntity{} -} - -// WithPayload adds the payload to the get customer support remarks for move unprocessable entity response -func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetCustomerSupportRemarksForMoveUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer support remarks for move unprocessable entity response -func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetCustomerSupportRemarksForMoveInternalServerErrorCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveInternalServerError -const GetCustomerSupportRemarksForMoveInternalServerErrorCode int = 500 - -/* -GetCustomerSupportRemarksForMoveInternalServerError A server error occurred - -swagger:response getCustomerSupportRemarksForMoveInternalServerError -*/ -type GetCustomerSupportRemarksForMoveInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetCustomerSupportRemarksForMoveInternalServerError creates GetCustomerSupportRemarksForMoveInternalServerError with default headers values -func NewGetCustomerSupportRemarksForMoveInternalServerError() *GetCustomerSupportRemarksForMoveInternalServerError { - - return &GetCustomerSupportRemarksForMoveInternalServerError{} -} - -// WithPayload adds the payload to the get customer support remarks for move internal server error response -func (o *GetCustomerSupportRemarksForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get customer support remarks for move internal server error response -func (o *GetCustomerSupportRemarksForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetCustomerSupportRemarksForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go deleted file mode 100644 index b3b97239169..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetCustomerSupportRemarksForMoveURL generates an URL for the get customer support remarks for move operation -type GetCustomerSupportRemarksForMoveURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCustomerSupportRemarksForMoveURL) WithBasePath(bp string) *GetCustomerSupportRemarksForMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetCustomerSupportRemarksForMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetCustomerSupportRemarksForMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/customer-support-remarks" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on GetCustomerSupportRemarksForMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetCustomerSupportRemarksForMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetCustomerSupportRemarksForMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetCustomerSupportRemarksForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetCustomerSupportRemarksForMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetCustomerSupportRemarksForMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetCustomerSupportRemarksForMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go deleted file mode 100644 index 00a99fa2d8a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateCustomerSupportRemarkForMoveHandlerFunc turns a function with the right signature into a update customer support remark for move handler -type UpdateCustomerSupportRemarkForMoveHandlerFunc func(UpdateCustomerSupportRemarkForMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCustomerSupportRemarkForMoveHandlerFunc) Handle(params UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { - return fn(params) -} - -// UpdateCustomerSupportRemarkForMoveHandler interface for that can handle valid update customer support remark for move params -type UpdateCustomerSupportRemarkForMoveHandler interface { - Handle(UpdateCustomerSupportRemarkForMoveParams) middleware.Responder -} - -// NewUpdateCustomerSupportRemarkForMove creates a new http.Handler for the update customer support remark for move operation -func NewUpdateCustomerSupportRemarkForMove(ctx *middleware.Context, handler UpdateCustomerSupportRemarkForMoveHandler) *UpdateCustomerSupportRemarkForMove { - return &UpdateCustomerSupportRemarkForMove{Context: ctx, Handler: handler} -} - -/* - UpdateCustomerSupportRemarkForMove swagger:route PATCH /customer-support-remarks/{customerSupportRemarkID} customerSupportRemarks updateCustomerSupportRemarkForMove - -# Updates a customer support remark for a move - -Updates a customer support remark for a move -*/ -type UpdateCustomerSupportRemarkForMove struct { - Context *middleware.Context - Handler UpdateCustomerSupportRemarkForMoveHandler -} - -func (o *UpdateCustomerSupportRemarkForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCustomerSupportRemarkForMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go deleted file mode 100644 index 0b3c6e94676..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateCustomerSupportRemarkForMoveParams creates a new UpdateCustomerSupportRemarkForMoveParams object -// -// There are no default values defined in the spec. -func NewUpdateCustomerSupportRemarkForMoveParams() UpdateCustomerSupportRemarkForMoveParams { - - return UpdateCustomerSupportRemarkForMoveParams{} -} - -// UpdateCustomerSupportRemarkForMoveParams contains all the bound params for the update customer support remark for move operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCustomerSupportRemarkForMove -type UpdateCustomerSupportRemarkForMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateCustomerSupportRemarkPayload - /*the customer support remark ID to be modified - Required: true - In: path - */ - CustomerSupportRemarkID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCustomerSupportRemarkForMoveParams() beforehand. -func (o *UpdateCustomerSupportRemarkForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateCustomerSupportRemarkPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, _ := route.Params.GetOK("customerSupportRemarkID") - if err := o.bindCustomerSupportRemarkID(rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCustomerSupportRemarkID binds and validates parameter CustomerSupportRemarkID from path. -func (o *UpdateCustomerSupportRemarkForMoveParams) bindCustomerSupportRemarkID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("customerSupportRemarkID", "path", "strfmt.UUID", raw) - } - o.CustomerSupportRemarkID = *(value.(*strfmt.UUID)) - - if err := o.validateCustomerSupportRemarkID(formats); err != nil { - return err - } - - return nil -} - -// validateCustomerSupportRemarkID carries on validations for parameter CustomerSupportRemarkID -func (o *UpdateCustomerSupportRemarkForMoveParams) validateCustomerSupportRemarkID(formats strfmt.Registry) error { - - if err := validate.FormatOf("customerSupportRemarkID", "path", "uuid", o.CustomerSupportRemarkID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go deleted file mode 100644 index c09f2f3d9f5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateCustomerSupportRemarkForMoveOKCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveOK -const UpdateCustomerSupportRemarkForMoveOKCode int = 200 - -/* -UpdateCustomerSupportRemarkForMoveOK Successfully updated customer support remark - -swagger:response updateCustomerSupportRemarkForMoveOK -*/ -type UpdateCustomerSupportRemarkForMoveOK struct { - - /* - In: Body - */ - Payload *ghcmessages.CustomerSupportRemark `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveOK creates UpdateCustomerSupportRemarkForMoveOK with default headers values -func NewUpdateCustomerSupportRemarkForMoveOK() *UpdateCustomerSupportRemarkForMoveOK { - - return &UpdateCustomerSupportRemarkForMoveOK{} -} - -// WithPayload adds the payload to the update customer support remark for move o k response -func (o *UpdateCustomerSupportRemarkForMoveOK) WithPayload(payload *ghcmessages.CustomerSupportRemark) *UpdateCustomerSupportRemarkForMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move o k response -func (o *UpdateCustomerSupportRemarkForMoveOK) SetPayload(payload *ghcmessages.CustomerSupportRemark) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerSupportRemarkForMoveBadRequestCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveBadRequest -const UpdateCustomerSupportRemarkForMoveBadRequestCode int = 400 - -/* -UpdateCustomerSupportRemarkForMoveBadRequest The request payload is invalid - -swagger:response updateCustomerSupportRemarkForMoveBadRequest -*/ -type UpdateCustomerSupportRemarkForMoveBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveBadRequest creates UpdateCustomerSupportRemarkForMoveBadRequest with default headers values -func NewUpdateCustomerSupportRemarkForMoveBadRequest() *UpdateCustomerSupportRemarkForMoveBadRequest { - - return &UpdateCustomerSupportRemarkForMoveBadRequest{} -} - -// WithPayload adds the payload to the update customer support remark for move bad request response -func (o *UpdateCustomerSupportRemarkForMoveBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move bad request response -func (o *UpdateCustomerSupportRemarkForMoveBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerSupportRemarkForMoveForbiddenCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveForbidden -const UpdateCustomerSupportRemarkForMoveForbiddenCode int = 403 - -/* -UpdateCustomerSupportRemarkForMoveForbidden The request was denied - -swagger:response updateCustomerSupportRemarkForMoveForbidden -*/ -type UpdateCustomerSupportRemarkForMoveForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveForbidden creates UpdateCustomerSupportRemarkForMoveForbidden with default headers values -func NewUpdateCustomerSupportRemarkForMoveForbidden() *UpdateCustomerSupportRemarkForMoveForbidden { - - return &UpdateCustomerSupportRemarkForMoveForbidden{} -} - -// WithPayload adds the payload to the update customer support remark for move forbidden response -func (o *UpdateCustomerSupportRemarkForMoveForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move forbidden response -func (o *UpdateCustomerSupportRemarkForMoveForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerSupportRemarkForMoveNotFoundCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveNotFound -const UpdateCustomerSupportRemarkForMoveNotFoundCode int = 404 - -/* -UpdateCustomerSupportRemarkForMoveNotFound The requested resource wasn't found - -swagger:response updateCustomerSupportRemarkForMoveNotFound -*/ -type UpdateCustomerSupportRemarkForMoveNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveNotFound creates UpdateCustomerSupportRemarkForMoveNotFound with default headers values -func NewUpdateCustomerSupportRemarkForMoveNotFound() *UpdateCustomerSupportRemarkForMoveNotFound { - - return &UpdateCustomerSupportRemarkForMoveNotFound{} -} - -// WithPayload adds the payload to the update customer support remark for move not found response -func (o *UpdateCustomerSupportRemarkForMoveNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move not found response -func (o *UpdateCustomerSupportRemarkForMoveNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerSupportRemarkForMoveUnprocessableEntityCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveUnprocessableEntity -const UpdateCustomerSupportRemarkForMoveUnprocessableEntityCode int = 422 - -/* -UpdateCustomerSupportRemarkForMoveUnprocessableEntity The payload was unprocessable. - -swagger:response updateCustomerSupportRemarkForMoveUnprocessableEntity -*/ -type UpdateCustomerSupportRemarkForMoveUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveUnprocessableEntity creates UpdateCustomerSupportRemarkForMoveUnprocessableEntity with default headers values -func NewUpdateCustomerSupportRemarkForMoveUnprocessableEntity() *UpdateCustomerSupportRemarkForMoveUnprocessableEntity { - - return &UpdateCustomerSupportRemarkForMoveUnprocessableEntity{} -} - -// WithPayload adds the payload to the update customer support remark for move unprocessable entity response -func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCustomerSupportRemarkForMoveUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move unprocessable entity response -func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCustomerSupportRemarkForMoveInternalServerErrorCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveInternalServerError -const UpdateCustomerSupportRemarkForMoveInternalServerErrorCode int = 500 - -/* -UpdateCustomerSupportRemarkForMoveInternalServerError A server error occurred - -swagger:response updateCustomerSupportRemarkForMoveInternalServerError -*/ -type UpdateCustomerSupportRemarkForMoveInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCustomerSupportRemarkForMoveInternalServerError creates UpdateCustomerSupportRemarkForMoveInternalServerError with default headers values -func NewUpdateCustomerSupportRemarkForMoveInternalServerError() *UpdateCustomerSupportRemarkForMoveInternalServerError { - - return &UpdateCustomerSupportRemarkForMoveInternalServerError{} -} - -// WithPayload adds the payload to the update customer support remark for move internal server error response -func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update customer support remark for move internal server error response -func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go deleted file mode 100644 index ca740c07d6c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package customer_support_remarks - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateCustomerSupportRemarkForMoveURL generates an URL for the update customer support remark for move operation -type UpdateCustomerSupportRemarkForMoveURL struct { - CustomerSupportRemarkID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCustomerSupportRemarkForMoveURL) WithBasePath(bp string) *UpdateCustomerSupportRemarkForMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCustomerSupportRemarkForMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCustomerSupportRemarkForMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/customer-support-remarks/{customerSupportRemarkID}" - - customerSupportRemarkID := o.CustomerSupportRemarkID.String() - if customerSupportRemarkID != "" { - _path = strings.Replace(_path, "{customerSupportRemarkID}", customerSupportRemarkID, -1) - } else { - return nil, errors.New("customerSupportRemarkId is required on UpdateCustomerSupportRemarkForMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCustomerSupportRemarkForMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCustomerSupportRemarkForMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCustomerSupportRemarkForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCustomerSupportRemarkForMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCustomerSupportRemarkForMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCustomerSupportRemarkForMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go deleted file mode 100644 index 1712102930a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AddAppealToSeriousIncidentHandlerFunc turns a function with the right signature into a add appeal to serious incident handler -type AddAppealToSeriousIncidentHandlerFunc func(AddAppealToSeriousIncidentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AddAppealToSeriousIncidentHandlerFunc) Handle(params AddAppealToSeriousIncidentParams) middleware.Responder { - return fn(params) -} - -// AddAppealToSeriousIncidentHandler interface for that can handle valid add appeal to serious incident params -type AddAppealToSeriousIncidentHandler interface { - Handle(AddAppealToSeriousIncidentParams) middleware.Responder -} - -// NewAddAppealToSeriousIncident creates a new http.Handler for the add appeal to serious incident operation -func NewAddAppealToSeriousIncident(ctx *middleware.Context, handler AddAppealToSeriousIncidentHandler) *AddAppealToSeriousIncident { - return &AddAppealToSeriousIncident{Context: ctx, Handler: handler} -} - -/* - AddAppealToSeriousIncident swagger:route POST /evaluation-reports/{reportID}/appeal/add evaluationReports addAppealToSeriousIncident - -# Adds an appeal to a serious incident on an evaluation report - -Adds an appeal to a serious incident on an evaluation report -*/ -type AddAppealToSeriousIncident struct { - Context *middleware.Context - Handler AddAppealToSeriousIncidentHandler -} - -func (o *AddAppealToSeriousIncident) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAddAppealToSeriousIncidentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go deleted file mode 100644 index b06a2628861..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewAddAppealToSeriousIncidentParams creates a new AddAppealToSeriousIncidentParams object -// -// There are no default values defined in the spec. -func NewAddAppealToSeriousIncidentParams() AddAppealToSeriousIncidentParams { - - return AddAppealToSeriousIncidentParams{} -} - -// AddAppealToSeriousIncidentParams contains all the bound params for the add appeal to serious incident operation -// typically these are obtained from a http.Request -// -// swagger:parameters addAppealToSeriousIncident -type AddAppealToSeriousIncidentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.CreateAppeal - /*the evaluation report ID - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAddAppealToSeriousIncidentParams() beforehand. -func (o *AddAppealToSeriousIncidentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateAppeal - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *AddAppealToSeriousIncidentParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *AddAppealToSeriousIncidentParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go deleted file mode 100644 index 66f46f39b51..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// AddAppealToSeriousIncidentNoContentCode is the HTTP code returned for type AddAppealToSeriousIncidentNoContent -const AddAppealToSeriousIncidentNoContentCode int = 204 - -/* -AddAppealToSeriousIncidentNoContent Successfully added an appeal to a serious incident - -swagger:response addAppealToSeriousIncidentNoContent -*/ -type AddAppealToSeriousIncidentNoContent struct { -} - -// NewAddAppealToSeriousIncidentNoContent creates AddAppealToSeriousIncidentNoContent with default headers values -func NewAddAppealToSeriousIncidentNoContent() *AddAppealToSeriousIncidentNoContent { - - return &AddAppealToSeriousIncidentNoContent{} -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// AddAppealToSeriousIncidentForbiddenCode is the HTTP code returned for type AddAppealToSeriousIncidentForbidden -const AddAppealToSeriousIncidentForbiddenCode int = 403 - -/* -AddAppealToSeriousIncidentForbidden The request was denied - -swagger:response addAppealToSeriousIncidentForbidden -*/ -type AddAppealToSeriousIncidentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToSeriousIncidentForbidden creates AddAppealToSeriousIncidentForbidden with default headers values -func NewAddAppealToSeriousIncidentForbidden() *AddAppealToSeriousIncidentForbidden { - - return &AddAppealToSeriousIncidentForbidden{} -} - -// WithPayload adds the payload to the add appeal to serious incident forbidden response -func (o *AddAppealToSeriousIncidentForbidden) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to serious incident forbidden response -func (o *AddAppealToSeriousIncidentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToSeriousIncidentNotFoundCode is the HTTP code returned for type AddAppealToSeriousIncidentNotFound -const AddAppealToSeriousIncidentNotFoundCode int = 404 - -/* -AddAppealToSeriousIncidentNotFound The requested resource wasn't found - -swagger:response addAppealToSeriousIncidentNotFound -*/ -type AddAppealToSeriousIncidentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToSeriousIncidentNotFound creates AddAppealToSeriousIncidentNotFound with default headers values -func NewAddAppealToSeriousIncidentNotFound() *AddAppealToSeriousIncidentNotFound { - - return &AddAppealToSeriousIncidentNotFound{} -} - -// WithPayload adds the payload to the add appeal to serious incident not found response -func (o *AddAppealToSeriousIncidentNotFound) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to serious incident not found response -func (o *AddAppealToSeriousIncidentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToSeriousIncidentPreconditionFailedCode is the HTTP code returned for type AddAppealToSeriousIncidentPreconditionFailed -const AddAppealToSeriousIncidentPreconditionFailedCode int = 412 - -/* -AddAppealToSeriousIncidentPreconditionFailed Precondition failed - -swagger:response addAppealToSeriousIncidentPreconditionFailed -*/ -type AddAppealToSeriousIncidentPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToSeriousIncidentPreconditionFailed creates AddAppealToSeriousIncidentPreconditionFailed with default headers values -func NewAddAppealToSeriousIncidentPreconditionFailed() *AddAppealToSeriousIncidentPreconditionFailed { - - return &AddAppealToSeriousIncidentPreconditionFailed{} -} - -// WithPayload adds the payload to the add appeal to serious incident precondition failed response -func (o *AddAppealToSeriousIncidentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to serious incident precondition failed response -func (o *AddAppealToSeriousIncidentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToSeriousIncidentUnprocessableEntityCode is the HTTP code returned for type AddAppealToSeriousIncidentUnprocessableEntity -const AddAppealToSeriousIncidentUnprocessableEntityCode int = 422 - -/* -AddAppealToSeriousIncidentUnprocessableEntity The payload was unprocessable. - -swagger:response addAppealToSeriousIncidentUnprocessableEntity -*/ -type AddAppealToSeriousIncidentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewAddAppealToSeriousIncidentUnprocessableEntity creates AddAppealToSeriousIncidentUnprocessableEntity with default headers values -func NewAddAppealToSeriousIncidentUnprocessableEntity() *AddAppealToSeriousIncidentUnprocessableEntity { - - return &AddAppealToSeriousIncidentUnprocessableEntity{} -} - -// WithPayload adds the payload to the add appeal to serious incident unprocessable entity response -func (o *AddAppealToSeriousIncidentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AddAppealToSeriousIncidentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to serious incident unprocessable entity response -func (o *AddAppealToSeriousIncidentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToSeriousIncidentInternalServerErrorCode is the HTTP code returned for type AddAppealToSeriousIncidentInternalServerError -const AddAppealToSeriousIncidentInternalServerErrorCode int = 500 - -/* -AddAppealToSeriousIncidentInternalServerError A server error occurred - -swagger:response addAppealToSeriousIncidentInternalServerError -*/ -type AddAppealToSeriousIncidentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToSeriousIncidentInternalServerError creates AddAppealToSeriousIncidentInternalServerError with default headers values -func NewAddAppealToSeriousIncidentInternalServerError() *AddAppealToSeriousIncidentInternalServerError { - - return &AddAppealToSeriousIncidentInternalServerError{} -} - -// WithPayload adds the payload to the add appeal to serious incident internal server error response -func (o *AddAppealToSeriousIncidentInternalServerError) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to serious incident internal server error response -func (o *AddAppealToSeriousIncidentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToSeriousIncidentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go deleted file mode 100644 index 37603d65430..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// AddAppealToSeriousIncidentURL generates an URL for the add appeal to serious incident operation -type AddAppealToSeriousIncidentURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AddAppealToSeriousIncidentURL) WithBasePath(bp string) *AddAppealToSeriousIncidentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AddAppealToSeriousIncidentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AddAppealToSeriousIncidentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}/appeal/add" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on AddAppealToSeriousIncidentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AddAppealToSeriousIncidentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AddAppealToSeriousIncidentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AddAppealToSeriousIncidentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AddAppealToSeriousIncidentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AddAppealToSeriousIncidentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AddAppealToSeriousIncidentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go deleted file mode 100644 index aab72a39edd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AddAppealToViolationHandlerFunc turns a function with the right signature into a add appeal to violation handler -type AddAppealToViolationHandlerFunc func(AddAppealToViolationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AddAppealToViolationHandlerFunc) Handle(params AddAppealToViolationParams) middleware.Responder { - return fn(params) -} - -// AddAppealToViolationHandler interface for that can handle valid add appeal to violation params -type AddAppealToViolationHandler interface { - Handle(AddAppealToViolationParams) middleware.Responder -} - -// NewAddAppealToViolation creates a new http.Handler for the add appeal to violation operation -func NewAddAppealToViolation(ctx *middleware.Context, handler AddAppealToViolationHandler) *AddAppealToViolation { - return &AddAppealToViolation{Context: ctx, Handler: handler} -} - -/* - AddAppealToViolation swagger:route POST /evaluation-reports/{reportID}/{reportViolationID}/appeal/add evaluationReports addAppealToViolation - -# Adds an appeal to a violation - -Adds an appeal to a violation -*/ -type AddAppealToViolation struct { - Context *middleware.Context - Handler AddAppealToViolationHandler -} - -func (o *AddAppealToViolation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAddAppealToViolationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go deleted file mode 100644 index b05a333396d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewAddAppealToViolationParams creates a new AddAppealToViolationParams object -// -// There are no default values defined in the spec. -func NewAddAppealToViolationParams() AddAppealToViolationParams { - - return AddAppealToViolationParams{} -} - -// AddAppealToViolationParams contains all the bound params for the add appeal to violation operation -// typically these are obtained from a http.Request -// -// swagger:parameters addAppealToViolation -type AddAppealToViolationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.CreateAppeal - /*the evaluation report ID - Required: true - In: path - */ - ReportID strfmt.UUID - /*the report violation ID - Required: true - In: path - */ - ReportViolationID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAddAppealToViolationParams() beforehand. -func (o *AddAppealToViolationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateAppeal - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - - rReportViolationID, rhkReportViolationID, _ := route.Params.GetOK("reportViolationID") - if err := o.bindReportViolationID(rReportViolationID, rhkReportViolationID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *AddAppealToViolationParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *AddAppealToViolationParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} - -// bindReportViolationID binds and validates parameter ReportViolationID from path. -func (o *AddAppealToViolationParams) bindReportViolationID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportViolationID", "path", "strfmt.UUID", raw) - } - o.ReportViolationID = *(value.(*strfmt.UUID)) - - if err := o.validateReportViolationID(formats); err != nil { - return err - } - - return nil -} - -// validateReportViolationID carries on validations for parameter ReportViolationID -func (o *AddAppealToViolationParams) validateReportViolationID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportViolationID", "path", "uuid", o.ReportViolationID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go deleted file mode 100644 index b140b2844cf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// AddAppealToViolationNoContentCode is the HTTP code returned for type AddAppealToViolationNoContent -const AddAppealToViolationNoContentCode int = 204 - -/* -AddAppealToViolationNoContent Successfully added an appeal to a violation - -swagger:response addAppealToViolationNoContent -*/ -type AddAppealToViolationNoContent struct { -} - -// NewAddAppealToViolationNoContent creates AddAppealToViolationNoContent with default headers values -func NewAddAppealToViolationNoContent() *AddAppealToViolationNoContent { - - return &AddAppealToViolationNoContent{} -} - -// WriteResponse to the client -func (o *AddAppealToViolationNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// AddAppealToViolationForbiddenCode is the HTTP code returned for type AddAppealToViolationForbidden -const AddAppealToViolationForbiddenCode int = 403 - -/* -AddAppealToViolationForbidden The request was denied - -swagger:response addAppealToViolationForbidden -*/ -type AddAppealToViolationForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToViolationForbidden creates AddAppealToViolationForbidden with default headers values -func NewAddAppealToViolationForbidden() *AddAppealToViolationForbidden { - - return &AddAppealToViolationForbidden{} -} - -// WithPayload adds the payload to the add appeal to violation forbidden response -func (o *AddAppealToViolationForbidden) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to violation forbidden response -func (o *AddAppealToViolationForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToViolationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToViolationNotFoundCode is the HTTP code returned for type AddAppealToViolationNotFound -const AddAppealToViolationNotFoundCode int = 404 - -/* -AddAppealToViolationNotFound The requested resource wasn't found - -swagger:response addAppealToViolationNotFound -*/ -type AddAppealToViolationNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToViolationNotFound creates AddAppealToViolationNotFound with default headers values -func NewAddAppealToViolationNotFound() *AddAppealToViolationNotFound { - - return &AddAppealToViolationNotFound{} -} - -// WithPayload adds the payload to the add appeal to violation not found response -func (o *AddAppealToViolationNotFound) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to violation not found response -func (o *AddAppealToViolationNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToViolationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToViolationPreconditionFailedCode is the HTTP code returned for type AddAppealToViolationPreconditionFailed -const AddAppealToViolationPreconditionFailedCode int = 412 - -/* -AddAppealToViolationPreconditionFailed Precondition failed - -swagger:response addAppealToViolationPreconditionFailed -*/ -type AddAppealToViolationPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToViolationPreconditionFailed creates AddAppealToViolationPreconditionFailed with default headers values -func NewAddAppealToViolationPreconditionFailed() *AddAppealToViolationPreconditionFailed { - - return &AddAppealToViolationPreconditionFailed{} -} - -// WithPayload adds the payload to the add appeal to violation precondition failed response -func (o *AddAppealToViolationPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to violation precondition failed response -func (o *AddAppealToViolationPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToViolationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToViolationUnprocessableEntityCode is the HTTP code returned for type AddAppealToViolationUnprocessableEntity -const AddAppealToViolationUnprocessableEntityCode int = 422 - -/* -AddAppealToViolationUnprocessableEntity The payload was unprocessable. - -swagger:response addAppealToViolationUnprocessableEntity -*/ -type AddAppealToViolationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewAddAppealToViolationUnprocessableEntity creates AddAppealToViolationUnprocessableEntity with default headers values -func NewAddAppealToViolationUnprocessableEntity() *AddAppealToViolationUnprocessableEntity { - - return &AddAppealToViolationUnprocessableEntity{} -} - -// WithPayload adds the payload to the add appeal to violation unprocessable entity response -func (o *AddAppealToViolationUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AddAppealToViolationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to violation unprocessable entity response -func (o *AddAppealToViolationUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToViolationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AddAppealToViolationInternalServerErrorCode is the HTTP code returned for type AddAppealToViolationInternalServerError -const AddAppealToViolationInternalServerErrorCode int = 500 - -/* -AddAppealToViolationInternalServerError A server error occurred - -swagger:response addAppealToViolationInternalServerError -*/ -type AddAppealToViolationInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAddAppealToViolationInternalServerError creates AddAppealToViolationInternalServerError with default headers values -func NewAddAppealToViolationInternalServerError() *AddAppealToViolationInternalServerError { - - return &AddAppealToViolationInternalServerError{} -} - -// WithPayload adds the payload to the add appeal to violation internal server error response -func (o *AddAppealToViolationInternalServerError) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the add appeal to violation internal server error response -func (o *AddAppealToViolationInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AddAppealToViolationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go deleted file mode 100644 index b273a73e8df..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// AddAppealToViolationURL generates an URL for the add appeal to violation operation -type AddAppealToViolationURL struct { - ReportID strfmt.UUID - ReportViolationID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AddAppealToViolationURL) WithBasePath(bp string) *AddAppealToViolationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AddAppealToViolationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AddAppealToViolationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on AddAppealToViolationURL") - } - - reportViolationID := o.ReportViolationID.String() - if reportViolationID != "" { - _path = strings.Replace(_path, "{reportViolationID}", reportViolationID, -1) - } else { - return nil, errors.New("reportViolationId is required on AddAppealToViolationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AddAppealToViolationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AddAppealToViolationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AddAppealToViolationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AddAppealToViolationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AddAppealToViolationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AddAppealToViolationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go deleted file mode 100644 index 9a14099b789..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateEvaluationReportHandlerFunc turns a function with the right signature into a create evaluation report handler -type CreateEvaluationReportHandlerFunc func(CreateEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateEvaluationReportHandlerFunc) Handle(params CreateEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// CreateEvaluationReportHandler interface for that can handle valid create evaluation report params -type CreateEvaluationReportHandler interface { - Handle(CreateEvaluationReportParams) middleware.Responder -} - -// NewCreateEvaluationReport creates a new http.Handler for the create evaluation report operation -func NewCreateEvaluationReport(ctx *middleware.Context, handler CreateEvaluationReportHandler) *CreateEvaluationReport { - return &CreateEvaluationReport{Context: ctx, Handler: handler} -} - -/* - CreateEvaluationReport swagger:route POST /moves/{locator}/evaluation-reports evaluationReports createEvaluationReport - -# Creates an evaluation report - -Creates an evaluation report -*/ -type CreateEvaluationReport struct { - Context *middleware.Context - Handler CreateEvaluationReportHandler -} - -func (o *CreateEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go deleted file mode 100644 index dee804fe213..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateEvaluationReportParams creates a new CreateEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewCreateEvaluationReportParams() CreateEvaluationReportParams { - - return CreateEvaluationReportParams{} -} - -// CreateEvaluationReportParams contains all the bound params for the create evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters createEvaluationReport -type CreateEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.CreateEvaluationReport - /* - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateEvaluationReportParams() beforehand. -func (o *CreateEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateEvaluationReport - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *CreateEvaluationReportParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go deleted file mode 100644 index 5c6ae5b87a0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateEvaluationReportOKCode is the HTTP code returned for type CreateEvaluationReportOK -const CreateEvaluationReportOKCode int = 200 - -/* -CreateEvaluationReportOK Successfully created evaluation report - -swagger:response createEvaluationReportOK -*/ -type CreateEvaluationReportOK struct { - - /* - In: Body - */ - Payload *ghcmessages.EvaluationReport `json:"body,omitempty"` -} - -// NewCreateEvaluationReportOK creates CreateEvaluationReportOK with default headers values -func NewCreateEvaluationReportOK() *CreateEvaluationReportOK { - - return &CreateEvaluationReportOK{} -} - -// WithPayload adds the payload to the create evaluation report o k response -func (o *CreateEvaluationReportOK) WithPayload(payload *ghcmessages.EvaluationReport) *CreateEvaluationReportOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create evaluation report o k response -func (o *CreateEvaluationReportOK) SetPayload(payload *ghcmessages.EvaluationReport) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEvaluationReportBadRequestCode is the HTTP code returned for type CreateEvaluationReportBadRequest -const CreateEvaluationReportBadRequestCode int = 400 - -/* -CreateEvaluationReportBadRequest The request payload is invalid - -swagger:response createEvaluationReportBadRequest -*/ -type CreateEvaluationReportBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateEvaluationReportBadRequest creates CreateEvaluationReportBadRequest with default headers values -func NewCreateEvaluationReportBadRequest() *CreateEvaluationReportBadRequest { - - return &CreateEvaluationReportBadRequest{} -} - -// WithPayload adds the payload to the create evaluation report bad request response -func (o *CreateEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create evaluation report bad request response -func (o *CreateEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEvaluationReportNotFoundCode is the HTTP code returned for type CreateEvaluationReportNotFound -const CreateEvaluationReportNotFoundCode int = 404 - -/* -CreateEvaluationReportNotFound The requested resource wasn't found - -swagger:response createEvaluationReportNotFound -*/ -type CreateEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateEvaluationReportNotFound creates CreateEvaluationReportNotFound with default headers values -func NewCreateEvaluationReportNotFound() *CreateEvaluationReportNotFound { - - return &CreateEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the create evaluation report not found response -func (o *CreateEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create evaluation report not found response -func (o *CreateEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEvaluationReportUnprocessableEntityCode is the HTTP code returned for type CreateEvaluationReportUnprocessableEntity -const CreateEvaluationReportUnprocessableEntityCode int = 422 - -/* -CreateEvaluationReportUnprocessableEntity The payload was unprocessable. - -swagger:response createEvaluationReportUnprocessableEntity -*/ -type CreateEvaluationReportUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateEvaluationReportUnprocessableEntity creates CreateEvaluationReportUnprocessableEntity with default headers values -func NewCreateEvaluationReportUnprocessableEntity() *CreateEvaluationReportUnprocessableEntity { - - return &CreateEvaluationReportUnprocessableEntity{} -} - -// WithPayload adds the payload to the create evaluation report unprocessable entity response -func (o *CreateEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateEvaluationReportUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create evaluation report unprocessable entity response -func (o *CreateEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateEvaluationReportInternalServerErrorCode is the HTTP code returned for type CreateEvaluationReportInternalServerError -const CreateEvaluationReportInternalServerErrorCode int = 500 - -/* -CreateEvaluationReportInternalServerError A server error occurred - -swagger:response createEvaluationReportInternalServerError -*/ -type CreateEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateEvaluationReportInternalServerError creates CreateEvaluationReportInternalServerError with default headers values -func NewCreateEvaluationReportInternalServerError() *CreateEvaluationReportInternalServerError { - - return &CreateEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the create evaluation report internal server error response -func (o *CreateEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create evaluation report internal server error response -func (o *CreateEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go deleted file mode 100644 index 80fc8ee1af9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// CreateEvaluationReportURL generates an URL for the create evaluation report operation -type CreateEvaluationReportURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEvaluationReportURL) WithBasePath(bp string) *CreateEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/evaluation-reports" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on CreateEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go deleted file mode 100644 index 57f634a8a9a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteEvaluationReportHandlerFunc turns a function with the right signature into a delete evaluation report handler -type DeleteEvaluationReportHandlerFunc func(DeleteEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteEvaluationReportHandlerFunc) Handle(params DeleteEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// DeleteEvaluationReportHandler interface for that can handle valid delete evaluation report params -type DeleteEvaluationReportHandler interface { - Handle(DeleteEvaluationReportParams) middleware.Responder -} - -// NewDeleteEvaluationReport creates a new http.Handler for the delete evaluation report operation -func NewDeleteEvaluationReport(ctx *middleware.Context, handler DeleteEvaluationReportHandler) *DeleteEvaluationReport { - return &DeleteEvaluationReport{Context: ctx, Handler: handler} -} - -/* - DeleteEvaluationReport swagger:route DELETE /evaluation-reports/{reportID} evaluationReports deleteEvaluationReport - -# Deletes an evaluation report by ID - -Deletes an evaluation report by ID -*/ -type DeleteEvaluationReport struct { - Context *middleware.Context - Handler DeleteEvaluationReportHandler -} - -func (o *DeleteEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go deleted file mode 100644 index 58b9cfc12c5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteEvaluationReportParams creates a new DeleteEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewDeleteEvaluationReportParams() DeleteEvaluationReportParams { - - return DeleteEvaluationReportParams{} -} - -// DeleteEvaluationReportParams contains all the bound params for the delete evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteEvaluationReport -type DeleteEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the evaluation report ID to be modified - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteEvaluationReportParams() beforehand. -func (o *DeleteEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *DeleteEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *DeleteEvaluationReportParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go deleted file mode 100644 index 9cbfc739d3c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DeleteEvaluationReportNoContentCode is the HTTP code returned for type DeleteEvaluationReportNoContent -const DeleteEvaluationReportNoContentCode int = 204 - -/* -DeleteEvaluationReportNoContent Successfully deleted the report - -swagger:response deleteEvaluationReportNoContent -*/ -type DeleteEvaluationReportNoContent struct { -} - -// NewDeleteEvaluationReportNoContent creates DeleteEvaluationReportNoContent with default headers values -func NewDeleteEvaluationReportNoContent() *DeleteEvaluationReportNoContent { - - return &DeleteEvaluationReportNoContent{} -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteEvaluationReportBadRequestCode is the HTTP code returned for type DeleteEvaluationReportBadRequest -const DeleteEvaluationReportBadRequestCode int = 400 - -/* -DeleteEvaluationReportBadRequest The request payload is invalid - -swagger:response deleteEvaluationReportBadRequest -*/ -type DeleteEvaluationReportBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportBadRequest creates DeleteEvaluationReportBadRequest with default headers values -func NewDeleteEvaluationReportBadRequest() *DeleteEvaluationReportBadRequest { - - return &DeleteEvaluationReportBadRequest{} -} - -// WithPayload adds the payload to the delete evaluation report bad request response -func (o *DeleteEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report bad request response -func (o *DeleteEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEvaluationReportForbiddenCode is the HTTP code returned for type DeleteEvaluationReportForbidden -const DeleteEvaluationReportForbiddenCode int = 403 - -/* -DeleteEvaluationReportForbidden The request was denied - -swagger:response deleteEvaluationReportForbidden -*/ -type DeleteEvaluationReportForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportForbidden creates DeleteEvaluationReportForbidden with default headers values -func NewDeleteEvaluationReportForbidden() *DeleteEvaluationReportForbidden { - - return &DeleteEvaluationReportForbidden{} -} - -// WithPayload adds the payload to the delete evaluation report forbidden response -func (o *DeleteEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report forbidden response -func (o *DeleteEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEvaluationReportNotFoundCode is the HTTP code returned for type DeleteEvaluationReportNotFound -const DeleteEvaluationReportNotFoundCode int = 404 - -/* -DeleteEvaluationReportNotFound The requested resource wasn't found - -swagger:response deleteEvaluationReportNotFound -*/ -type DeleteEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportNotFound creates DeleteEvaluationReportNotFound with default headers values -func NewDeleteEvaluationReportNotFound() *DeleteEvaluationReportNotFound { - - return &DeleteEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the delete evaluation report not found response -func (o *DeleteEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report not found response -func (o *DeleteEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEvaluationReportConflictCode is the HTTP code returned for type DeleteEvaluationReportConflict -const DeleteEvaluationReportConflictCode int = 409 - -/* -DeleteEvaluationReportConflict Conflict error - -swagger:response deleteEvaluationReportConflict -*/ -type DeleteEvaluationReportConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportConflict creates DeleteEvaluationReportConflict with default headers values -func NewDeleteEvaluationReportConflict() *DeleteEvaluationReportConflict { - - return &DeleteEvaluationReportConflict{} -} - -// WithPayload adds the payload to the delete evaluation report conflict response -func (o *DeleteEvaluationReportConflict) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report conflict response -func (o *DeleteEvaluationReportConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEvaluationReportUnprocessableEntityCode is the HTTP code returned for type DeleteEvaluationReportUnprocessableEntity -const DeleteEvaluationReportUnprocessableEntityCode int = 422 - -/* -DeleteEvaluationReportUnprocessableEntity The payload was unprocessable. - -swagger:response deleteEvaluationReportUnprocessableEntity -*/ -type DeleteEvaluationReportUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportUnprocessableEntity creates DeleteEvaluationReportUnprocessableEntity with default headers values -func NewDeleteEvaluationReportUnprocessableEntity() *DeleteEvaluationReportUnprocessableEntity { - - return &DeleteEvaluationReportUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete evaluation report unprocessable entity response -func (o *DeleteEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteEvaluationReportUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report unprocessable entity response -func (o *DeleteEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteEvaluationReportInternalServerErrorCode is the HTTP code returned for type DeleteEvaluationReportInternalServerError -const DeleteEvaluationReportInternalServerErrorCode int = 500 - -/* -DeleteEvaluationReportInternalServerError A server error occurred - -swagger:response deleteEvaluationReportInternalServerError -*/ -type DeleteEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteEvaluationReportInternalServerError creates DeleteEvaluationReportInternalServerError with default headers values -func NewDeleteEvaluationReportInternalServerError() *DeleteEvaluationReportInternalServerError { - - return &DeleteEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the delete evaluation report internal server error response -func (o *DeleteEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete evaluation report internal server error response -func (o *DeleteEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go deleted file mode 100644 index ee442054a61..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteEvaluationReportURL generates an URL for the delete evaluation report operation -type DeleteEvaluationReportURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEvaluationReportURL) WithBasePath(bp string) *DeleteEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on DeleteEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go deleted file mode 100644 index 8fd37e22cea..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DownloadEvaluationReportHandlerFunc turns a function with the right signature into a download evaluation report handler -type DownloadEvaluationReportHandlerFunc func(DownloadEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DownloadEvaluationReportHandlerFunc) Handle(params DownloadEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// DownloadEvaluationReportHandler interface for that can handle valid download evaluation report params -type DownloadEvaluationReportHandler interface { - Handle(DownloadEvaluationReportParams) middleware.Responder -} - -// NewDownloadEvaluationReport creates a new http.Handler for the download evaluation report operation -func NewDownloadEvaluationReport(ctx *middleware.Context, handler DownloadEvaluationReportHandler) *DownloadEvaluationReport { - return &DownloadEvaluationReport{Context: ctx, Handler: handler} -} - -/* - DownloadEvaluationReport swagger:route GET /evaluation-reports/{reportID}/download evaluationReports downloadEvaluationReport - -# Downloads an evaluation report as a PDF - -Downloads an evaluation report as a PDF -*/ -type DownloadEvaluationReport struct { - Context *middleware.Context - Handler DownloadEvaluationReportHandler -} - -func (o *DownloadEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDownloadEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go deleted file mode 100644 index 0a851e13843..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDownloadEvaluationReportParams creates a new DownloadEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewDownloadEvaluationReportParams() DownloadEvaluationReportParams { - - return DownloadEvaluationReportParams{} -} - -// DownloadEvaluationReportParams contains all the bound params for the download evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters downloadEvaluationReport -type DownloadEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the evaluation report ID to be downloaded - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDownloadEvaluationReportParams() beforehand. -func (o *DownloadEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *DownloadEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *DownloadEvaluationReportParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go deleted file mode 100644 index c498c89df4c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DownloadEvaluationReportOKCode is the HTTP code returned for type DownloadEvaluationReportOK -const DownloadEvaluationReportOKCode int = 200 - -/* -DownloadEvaluationReportOK Evaluation report PDF - -swagger:response downloadEvaluationReportOK -*/ -type DownloadEvaluationReportOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewDownloadEvaluationReportOK creates DownloadEvaluationReportOK with default headers values -func NewDownloadEvaluationReportOK() *DownloadEvaluationReportOK { - - return &DownloadEvaluationReportOK{} -} - -// WithContentDisposition adds the contentDisposition to the download evaluation report o k response -func (o *DownloadEvaluationReportOK) WithContentDisposition(contentDisposition string) *DownloadEvaluationReportOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the download evaluation report o k response -func (o *DownloadEvaluationReportOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the download evaluation report o k response -func (o *DownloadEvaluationReportOK) WithPayload(payload io.ReadCloser) *DownloadEvaluationReportOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download evaluation report o k response -func (o *DownloadEvaluationReportOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// DownloadEvaluationReportForbiddenCode is the HTTP code returned for type DownloadEvaluationReportForbidden -const DownloadEvaluationReportForbiddenCode int = 403 - -/* -DownloadEvaluationReportForbidden The request was denied - -swagger:response downloadEvaluationReportForbidden -*/ -type DownloadEvaluationReportForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDownloadEvaluationReportForbidden creates DownloadEvaluationReportForbidden with default headers values -func NewDownloadEvaluationReportForbidden() *DownloadEvaluationReportForbidden { - - return &DownloadEvaluationReportForbidden{} -} - -// WithPayload adds the payload to the download evaluation report forbidden response -func (o *DownloadEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download evaluation report forbidden response -func (o *DownloadEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadEvaluationReportNotFoundCode is the HTTP code returned for type DownloadEvaluationReportNotFound -const DownloadEvaluationReportNotFoundCode int = 404 - -/* -DownloadEvaluationReportNotFound The requested resource wasn't found - -swagger:response downloadEvaluationReportNotFound -*/ -type DownloadEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDownloadEvaluationReportNotFound creates DownloadEvaluationReportNotFound with default headers values -func NewDownloadEvaluationReportNotFound() *DownloadEvaluationReportNotFound { - - return &DownloadEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the download evaluation report not found response -func (o *DownloadEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download evaluation report not found response -func (o *DownloadEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadEvaluationReportInternalServerErrorCode is the HTTP code returned for type DownloadEvaluationReportInternalServerError -const DownloadEvaluationReportInternalServerErrorCode int = 500 - -/* -DownloadEvaluationReportInternalServerError A server error occurred - -swagger:response downloadEvaluationReportInternalServerError -*/ -type DownloadEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDownloadEvaluationReportInternalServerError creates DownloadEvaluationReportInternalServerError with default headers values -func NewDownloadEvaluationReportInternalServerError() *DownloadEvaluationReportInternalServerError { - - return &DownloadEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the download evaluation report internal server error response -func (o *DownloadEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download evaluation report internal server error response -func (o *DownloadEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go deleted file mode 100644 index 2526bc4fedf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DownloadEvaluationReportURL generates an URL for the download evaluation report operation -type DownloadEvaluationReportURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DownloadEvaluationReportURL) WithBasePath(bp string) *DownloadEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DownloadEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DownloadEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}/download" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on DownloadEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DownloadEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DownloadEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DownloadEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DownloadEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DownloadEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DownloadEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go deleted file mode 100644 index 6f752a077f6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetEvaluationReportHandlerFunc turns a function with the right signature into a get evaluation report handler -type GetEvaluationReportHandlerFunc func(GetEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEvaluationReportHandlerFunc) Handle(params GetEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// GetEvaluationReportHandler interface for that can handle valid get evaluation report params -type GetEvaluationReportHandler interface { - Handle(GetEvaluationReportParams) middleware.Responder -} - -// NewGetEvaluationReport creates a new http.Handler for the get evaluation report operation -func NewGetEvaluationReport(ctx *middleware.Context, handler GetEvaluationReportHandler) *GetEvaluationReport { - return &GetEvaluationReport{Context: ctx, Handler: handler} -} - -/* - GetEvaluationReport swagger:route GET /evaluation-reports/{reportID} evaluationReports getEvaluationReport - -# Gets an evaluation report by ID - -Gets an evaluation report by ID -*/ -type GetEvaluationReport struct { - Context *middleware.Context - Handler GetEvaluationReportHandler -} - -func (o *GetEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go deleted file mode 100644 index e1a0cc13052..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetEvaluationReportParams creates a new GetEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewGetEvaluationReportParams() GetEvaluationReportParams { - - return GetEvaluationReportParams{} -} - -// GetEvaluationReportParams contains all the bound params for the get evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters getEvaluationReport -type GetEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the evaluation report ID to be modified - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEvaluationReportParams() beforehand. -func (o *GetEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *GetEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *GetEvaluationReportParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go deleted file mode 100644 index b0816c82cbe..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetEvaluationReportOKCode is the HTTP code returned for type GetEvaluationReportOK -const GetEvaluationReportOKCode int = 200 - -/* -GetEvaluationReportOK Successfully got the report - -swagger:response getEvaluationReportOK -*/ -type GetEvaluationReportOK struct { - - /* - In: Body - */ - Payload *ghcmessages.EvaluationReport `json:"body,omitempty"` -} - -// NewGetEvaluationReportOK creates GetEvaluationReportOK with default headers values -func NewGetEvaluationReportOK() *GetEvaluationReportOK { - - return &GetEvaluationReportOK{} -} - -// WithPayload adds the payload to the get evaluation report o k response -func (o *GetEvaluationReportOK) WithPayload(payload *ghcmessages.EvaluationReport) *GetEvaluationReportOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get evaluation report o k response -func (o *GetEvaluationReportOK) SetPayload(payload *ghcmessages.EvaluationReport) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEvaluationReportBadRequestCode is the HTTP code returned for type GetEvaluationReportBadRequest -const GetEvaluationReportBadRequestCode int = 400 - -/* -GetEvaluationReportBadRequest The request payload is invalid - -swagger:response getEvaluationReportBadRequest -*/ -type GetEvaluationReportBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEvaluationReportBadRequest creates GetEvaluationReportBadRequest with default headers values -func NewGetEvaluationReportBadRequest() *GetEvaluationReportBadRequest { - - return &GetEvaluationReportBadRequest{} -} - -// WithPayload adds the payload to the get evaluation report bad request response -func (o *GetEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get evaluation report bad request response -func (o *GetEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEvaluationReportForbiddenCode is the HTTP code returned for type GetEvaluationReportForbidden -const GetEvaluationReportForbiddenCode int = 403 - -/* -GetEvaluationReportForbidden The request was denied - -swagger:response getEvaluationReportForbidden -*/ -type GetEvaluationReportForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEvaluationReportForbidden creates GetEvaluationReportForbidden with default headers values -func NewGetEvaluationReportForbidden() *GetEvaluationReportForbidden { - - return &GetEvaluationReportForbidden{} -} - -// WithPayload adds the payload to the get evaluation report forbidden response -func (o *GetEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get evaluation report forbidden response -func (o *GetEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEvaluationReportNotFoundCode is the HTTP code returned for type GetEvaluationReportNotFound -const GetEvaluationReportNotFoundCode int = 404 - -/* -GetEvaluationReportNotFound The requested resource wasn't found - -swagger:response getEvaluationReportNotFound -*/ -type GetEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEvaluationReportNotFound creates GetEvaluationReportNotFound with default headers values -func NewGetEvaluationReportNotFound() *GetEvaluationReportNotFound { - - return &GetEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the get evaluation report not found response -func (o *GetEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get evaluation report not found response -func (o *GetEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEvaluationReportInternalServerErrorCode is the HTTP code returned for type GetEvaluationReportInternalServerError -const GetEvaluationReportInternalServerErrorCode int = 500 - -/* -GetEvaluationReportInternalServerError A server error occurred - -swagger:response getEvaluationReportInternalServerError -*/ -type GetEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEvaluationReportInternalServerError creates GetEvaluationReportInternalServerError with default headers values -func NewGetEvaluationReportInternalServerError() *GetEvaluationReportInternalServerError { - - return &GetEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the get evaluation report internal server error response -func (o *GetEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get evaluation report internal server error response -func (o *GetEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go deleted file mode 100644 index 154a867f840..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetEvaluationReportURL generates an URL for the get evaluation report operation -type GetEvaluationReportURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEvaluationReportURL) WithBasePath(bp string) *GetEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on GetEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go deleted file mode 100644 index 13876f710c8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SaveEvaluationReportHandlerFunc turns a function with the right signature into a save evaluation report handler -type SaveEvaluationReportHandlerFunc func(SaveEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SaveEvaluationReportHandlerFunc) Handle(params SaveEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// SaveEvaluationReportHandler interface for that can handle valid save evaluation report params -type SaveEvaluationReportHandler interface { - Handle(SaveEvaluationReportParams) middleware.Responder -} - -// NewSaveEvaluationReport creates a new http.Handler for the save evaluation report operation -func NewSaveEvaluationReport(ctx *middleware.Context, handler SaveEvaluationReportHandler) *SaveEvaluationReport { - return &SaveEvaluationReport{Context: ctx, Handler: handler} -} - -/* - SaveEvaluationReport swagger:route PUT /evaluation-reports/{reportID} evaluationReports saveEvaluationReport - -# Saves an evaluation report as a draft - -Saves an evaluation report as a draft -*/ -type SaveEvaluationReport struct { - Context *middleware.Context - Handler SaveEvaluationReportHandler -} - -func (o *SaveEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSaveEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go deleted file mode 100644 index 2a93b71392b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewSaveEvaluationReportParams creates a new SaveEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewSaveEvaluationReportParams() SaveEvaluationReportParams { - - return SaveEvaluationReportParams{} -} - -// SaveEvaluationReportParams contains all the bound params for the save evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters saveEvaluationReport -type SaveEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - In: body - */ - Body *ghcmessages.EvaluationReport - /*the evaluation report ID to be modified - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSaveEvaluationReportParams() beforehand. -func (o *SaveEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.EvaluationReport - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *SaveEvaluationReportParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *SaveEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *SaveEvaluationReportParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go deleted file mode 100644 index 1f251d8239f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go +++ /dev/null @@ -1,354 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// SaveEvaluationReportNoContentCode is the HTTP code returned for type SaveEvaluationReportNoContent -const SaveEvaluationReportNoContentCode int = 204 - -/* -SaveEvaluationReportNoContent Successfully saved the report - -swagger:response saveEvaluationReportNoContent -*/ -type SaveEvaluationReportNoContent struct { -} - -// NewSaveEvaluationReportNoContent creates SaveEvaluationReportNoContent with default headers values -func NewSaveEvaluationReportNoContent() *SaveEvaluationReportNoContent { - - return &SaveEvaluationReportNoContent{} -} - -// WriteResponse to the client -func (o *SaveEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// SaveEvaluationReportBadRequestCode is the HTTP code returned for type SaveEvaluationReportBadRequest -const SaveEvaluationReportBadRequestCode int = 400 - -/* -SaveEvaluationReportBadRequest The request payload is invalid - -swagger:response saveEvaluationReportBadRequest -*/ -type SaveEvaluationReportBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportBadRequest creates SaveEvaluationReportBadRequest with default headers values -func NewSaveEvaluationReportBadRequest() *SaveEvaluationReportBadRequest { - - return &SaveEvaluationReportBadRequest{} -} - -// WithPayload adds the payload to the save evaluation report bad request response -func (o *SaveEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report bad request response -func (o *SaveEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportForbiddenCode is the HTTP code returned for type SaveEvaluationReportForbidden -const SaveEvaluationReportForbiddenCode int = 403 - -/* -SaveEvaluationReportForbidden The request was denied - -swagger:response saveEvaluationReportForbidden -*/ -type SaveEvaluationReportForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportForbidden creates SaveEvaluationReportForbidden with default headers values -func NewSaveEvaluationReportForbidden() *SaveEvaluationReportForbidden { - - return &SaveEvaluationReportForbidden{} -} - -// WithPayload adds the payload to the save evaluation report forbidden response -func (o *SaveEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report forbidden response -func (o *SaveEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportNotFoundCode is the HTTP code returned for type SaveEvaluationReportNotFound -const SaveEvaluationReportNotFoundCode int = 404 - -/* -SaveEvaluationReportNotFound The requested resource wasn't found - -swagger:response saveEvaluationReportNotFound -*/ -type SaveEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportNotFound creates SaveEvaluationReportNotFound with default headers values -func NewSaveEvaluationReportNotFound() *SaveEvaluationReportNotFound { - - return &SaveEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the save evaluation report not found response -func (o *SaveEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report not found response -func (o *SaveEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportConflictCode is the HTTP code returned for type SaveEvaluationReportConflict -const SaveEvaluationReportConflictCode int = 409 - -/* -SaveEvaluationReportConflict Conflict error - -swagger:response saveEvaluationReportConflict -*/ -type SaveEvaluationReportConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportConflict creates SaveEvaluationReportConflict with default headers values -func NewSaveEvaluationReportConflict() *SaveEvaluationReportConflict { - - return &SaveEvaluationReportConflict{} -} - -// WithPayload adds the payload to the save evaluation report conflict response -func (o *SaveEvaluationReportConflict) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report conflict response -func (o *SaveEvaluationReportConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportPreconditionFailedCode is the HTTP code returned for type SaveEvaluationReportPreconditionFailed -const SaveEvaluationReportPreconditionFailedCode int = 412 - -/* -SaveEvaluationReportPreconditionFailed Precondition failed - -swagger:response saveEvaluationReportPreconditionFailed -*/ -type SaveEvaluationReportPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportPreconditionFailed creates SaveEvaluationReportPreconditionFailed with default headers values -func NewSaveEvaluationReportPreconditionFailed() *SaveEvaluationReportPreconditionFailed { - - return &SaveEvaluationReportPreconditionFailed{} -} - -// WithPayload adds the payload to the save evaluation report precondition failed response -func (o *SaveEvaluationReportPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report precondition failed response -func (o *SaveEvaluationReportPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportUnprocessableEntityCode is the HTTP code returned for type SaveEvaluationReportUnprocessableEntity -const SaveEvaluationReportUnprocessableEntityCode int = 422 - -/* -SaveEvaluationReportUnprocessableEntity The payload was unprocessable. - -swagger:response saveEvaluationReportUnprocessableEntity -*/ -type SaveEvaluationReportUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewSaveEvaluationReportUnprocessableEntity creates SaveEvaluationReportUnprocessableEntity with default headers values -func NewSaveEvaluationReportUnprocessableEntity() *SaveEvaluationReportUnprocessableEntity { - - return &SaveEvaluationReportUnprocessableEntity{} -} - -// WithPayload adds the payload to the save evaluation report unprocessable entity response -func (o *SaveEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SaveEvaluationReportUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report unprocessable entity response -func (o *SaveEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SaveEvaluationReportInternalServerErrorCode is the HTTP code returned for type SaveEvaluationReportInternalServerError -const SaveEvaluationReportInternalServerErrorCode int = 500 - -/* -SaveEvaluationReportInternalServerError A server error occurred - -swagger:response saveEvaluationReportInternalServerError -*/ -type SaveEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSaveEvaluationReportInternalServerError creates SaveEvaluationReportInternalServerError with default headers values -func NewSaveEvaluationReportInternalServerError() *SaveEvaluationReportInternalServerError { - - return &SaveEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the save evaluation report internal server error response -func (o *SaveEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the save evaluation report internal server error response -func (o *SaveEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SaveEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go deleted file mode 100644 index c3bafb4b0f9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SaveEvaluationReportURL generates an URL for the save evaluation report operation -type SaveEvaluationReportURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SaveEvaluationReportURL) WithBasePath(bp string) *SaveEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SaveEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SaveEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on SaveEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SaveEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SaveEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SaveEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SaveEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SaveEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SaveEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go deleted file mode 100644 index c09ee25d01d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SubmitEvaluationReportHandlerFunc turns a function with the right signature into a submit evaluation report handler -type SubmitEvaluationReportHandlerFunc func(SubmitEvaluationReportParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SubmitEvaluationReportHandlerFunc) Handle(params SubmitEvaluationReportParams) middleware.Responder { - return fn(params) -} - -// SubmitEvaluationReportHandler interface for that can handle valid submit evaluation report params -type SubmitEvaluationReportHandler interface { - Handle(SubmitEvaluationReportParams) middleware.Responder -} - -// NewSubmitEvaluationReport creates a new http.Handler for the submit evaluation report operation -func NewSubmitEvaluationReport(ctx *middleware.Context, handler SubmitEvaluationReportHandler) *SubmitEvaluationReport { - return &SubmitEvaluationReport{Context: ctx, Handler: handler} -} - -/* - SubmitEvaluationReport swagger:route POST /evaluation-reports/{reportID}/submit evaluationReports submitEvaluationReport - -# Submits an evaluation report - -Submits an evaluation report -*/ -type SubmitEvaluationReport struct { - Context *middleware.Context - Handler SubmitEvaluationReportHandler -} - -func (o *SubmitEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSubmitEvaluationReportParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go deleted file mode 100644 index 568345d7e2e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewSubmitEvaluationReportParams creates a new SubmitEvaluationReportParams object -// -// There are no default values defined in the spec. -func NewSubmitEvaluationReportParams() SubmitEvaluationReportParams { - - return SubmitEvaluationReportParams{} -} - -// SubmitEvaluationReportParams contains all the bound params for the submit evaluation report operation -// typically these are obtained from a http.Request -// -// swagger:parameters submitEvaluationReport -type SubmitEvaluationReportParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*the evaluation report ID to be modified - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSubmitEvaluationReportParams() beforehand. -func (o *SubmitEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *SubmitEvaluationReportParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *SubmitEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *SubmitEvaluationReportParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go deleted file mode 100644 index c9b099e84d7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// SubmitEvaluationReportNoContentCode is the HTTP code returned for type SubmitEvaluationReportNoContent -const SubmitEvaluationReportNoContentCode int = 204 - -/* -SubmitEvaluationReportNoContent Successfully submitted an evaluation report with the provided ID - -swagger:response submitEvaluationReportNoContent -*/ -type SubmitEvaluationReportNoContent struct { -} - -// NewSubmitEvaluationReportNoContent creates SubmitEvaluationReportNoContent with default headers values -func NewSubmitEvaluationReportNoContent() *SubmitEvaluationReportNoContent { - - return &SubmitEvaluationReportNoContent{} -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// SubmitEvaluationReportForbiddenCode is the HTTP code returned for type SubmitEvaluationReportForbidden -const SubmitEvaluationReportForbiddenCode int = 403 - -/* -SubmitEvaluationReportForbidden The request was denied - -swagger:response submitEvaluationReportForbidden -*/ -type SubmitEvaluationReportForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSubmitEvaluationReportForbidden creates SubmitEvaluationReportForbidden with default headers values -func NewSubmitEvaluationReportForbidden() *SubmitEvaluationReportForbidden { - - return &SubmitEvaluationReportForbidden{} -} - -// WithPayload adds the payload to the submit evaluation report forbidden response -func (o *SubmitEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit evaluation report forbidden response -func (o *SubmitEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitEvaluationReportNotFoundCode is the HTTP code returned for type SubmitEvaluationReportNotFound -const SubmitEvaluationReportNotFoundCode int = 404 - -/* -SubmitEvaluationReportNotFound The requested resource wasn't found - -swagger:response submitEvaluationReportNotFound -*/ -type SubmitEvaluationReportNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSubmitEvaluationReportNotFound creates SubmitEvaluationReportNotFound with default headers values -func NewSubmitEvaluationReportNotFound() *SubmitEvaluationReportNotFound { - - return &SubmitEvaluationReportNotFound{} -} - -// WithPayload adds the payload to the submit evaluation report not found response -func (o *SubmitEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit evaluation report not found response -func (o *SubmitEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitEvaluationReportPreconditionFailedCode is the HTTP code returned for type SubmitEvaluationReportPreconditionFailed -const SubmitEvaluationReportPreconditionFailedCode int = 412 - -/* -SubmitEvaluationReportPreconditionFailed Precondition failed - -swagger:response submitEvaluationReportPreconditionFailed -*/ -type SubmitEvaluationReportPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSubmitEvaluationReportPreconditionFailed creates SubmitEvaluationReportPreconditionFailed with default headers values -func NewSubmitEvaluationReportPreconditionFailed() *SubmitEvaluationReportPreconditionFailed { - - return &SubmitEvaluationReportPreconditionFailed{} -} - -// WithPayload adds the payload to the submit evaluation report precondition failed response -func (o *SubmitEvaluationReportPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit evaluation report precondition failed response -func (o *SubmitEvaluationReportPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitEvaluationReportUnprocessableEntityCode is the HTTP code returned for type SubmitEvaluationReportUnprocessableEntity -const SubmitEvaluationReportUnprocessableEntityCode int = 422 - -/* -SubmitEvaluationReportUnprocessableEntity The payload was unprocessable. - -swagger:response submitEvaluationReportUnprocessableEntity -*/ -type SubmitEvaluationReportUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewSubmitEvaluationReportUnprocessableEntity creates SubmitEvaluationReportUnprocessableEntity with default headers values -func NewSubmitEvaluationReportUnprocessableEntity() *SubmitEvaluationReportUnprocessableEntity { - - return &SubmitEvaluationReportUnprocessableEntity{} -} - -// WithPayload adds the payload to the submit evaluation report unprocessable entity response -func (o *SubmitEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SubmitEvaluationReportUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit evaluation report unprocessable entity response -func (o *SubmitEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitEvaluationReportInternalServerErrorCode is the HTTP code returned for type SubmitEvaluationReportInternalServerError -const SubmitEvaluationReportInternalServerErrorCode int = 500 - -/* -SubmitEvaluationReportInternalServerError A server error occurred - -swagger:response submitEvaluationReportInternalServerError -*/ -type SubmitEvaluationReportInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSubmitEvaluationReportInternalServerError creates SubmitEvaluationReportInternalServerError with default headers values -func NewSubmitEvaluationReportInternalServerError() *SubmitEvaluationReportInternalServerError { - - return &SubmitEvaluationReportInternalServerError{} -} - -// WithPayload adds the payload to the submit evaluation report internal server error response -func (o *SubmitEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit evaluation report internal server error response -func (o *SubmitEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go deleted file mode 100644 index 3eefcfe0060..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package evaluation_reports - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SubmitEvaluationReportURL generates an URL for the submit evaluation report operation -type SubmitEvaluationReportURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitEvaluationReportURL) WithBasePath(bp string) *SubmitEvaluationReportURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitEvaluationReportURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SubmitEvaluationReportURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/evaluation-reports/{reportID}/submit" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on SubmitEvaluationReportURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SubmitEvaluationReportURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SubmitEvaluationReportURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SubmitEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SubmitEvaluationReportURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SubmitEvaluationReportURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SubmitEvaluationReportURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go deleted file mode 100644 index 77cadd241ac..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateDocumentHandlerFunc turns a function with the right signature into a create document handler -type CreateDocumentHandlerFunc func(CreateDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateDocumentHandlerFunc) Handle(params CreateDocumentParams) middleware.Responder { - return fn(params) -} - -// CreateDocumentHandler interface for that can handle valid create document params -type CreateDocumentHandler interface { - Handle(CreateDocumentParams) middleware.Responder -} - -// NewCreateDocument creates a new http.Handler for the create document operation -func NewCreateDocument(ctx *middleware.Context, handler CreateDocumentHandler) *CreateDocument { - return &CreateDocument{Context: ctx, Handler: handler} -} - -/* - CreateDocument swagger:route POST /documents ghcDocuments createDocument - -# Create a new document - -Documents represent a physical artifact such as a scanned document or a PDF file -*/ -type CreateDocument struct { - Context *middleware.Context - Handler CreateDocumentHandler -} - -func (o *CreateDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go deleted file mode 100644 index b1fea83a00b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateDocumentParams creates a new CreateDocumentParams object -// -// There are no default values defined in the spec. -func NewCreateDocumentParams() CreateDocumentParams { - - return CreateDocumentParams{} -} - -// CreateDocumentParams contains all the bound params for the create document operation -// typically these are obtained from a http.Request -// -// swagger:parameters createDocument -type CreateDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - DocumentPayload *ghcmessages.PostDocumentPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateDocumentParams() beforehand. -func (o *CreateDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.PostDocumentPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("documentPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("documentPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.DocumentPayload = &body - } - } - } else { - res = append(res, errors.Required("documentPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go deleted file mode 100644 index ac24e277c6a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateDocumentCreatedCode is the HTTP code returned for type CreateDocumentCreated -const CreateDocumentCreatedCode int = 201 - -/* -CreateDocumentCreated created document - -swagger:response createDocumentCreated -*/ -type CreateDocumentCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.Document `json:"body,omitempty"` -} - -// NewCreateDocumentCreated creates CreateDocumentCreated with default headers values -func NewCreateDocumentCreated() *CreateDocumentCreated { - - return &CreateDocumentCreated{} -} - -// WithPayload adds the payload to the create document created response -func (o *CreateDocumentCreated) WithPayload(payload *ghcmessages.Document) *CreateDocumentCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create document created response -func (o *CreateDocumentCreated) SetPayload(payload *ghcmessages.Document) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDocumentCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateDocumentBadRequestCode is the HTTP code returned for type CreateDocumentBadRequest -const CreateDocumentBadRequestCode int = 400 - -/* -CreateDocumentBadRequest invalid request - -swagger:response createDocumentBadRequest -*/ -type CreateDocumentBadRequest struct { -} - -// NewCreateDocumentBadRequest creates CreateDocumentBadRequest with default headers values -func NewCreateDocumentBadRequest() *CreateDocumentBadRequest { - - return &CreateDocumentBadRequest{} -} - -// WriteResponse to the client -func (o *CreateDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateDocumentForbiddenCode is the HTTP code returned for type CreateDocumentForbidden -const CreateDocumentForbiddenCode int = 403 - -/* -CreateDocumentForbidden The request was denied - -swagger:response createDocumentForbidden -*/ -type CreateDocumentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateDocumentForbidden creates CreateDocumentForbidden with default headers values -func NewCreateDocumentForbidden() *CreateDocumentForbidden { - - return &CreateDocumentForbidden{} -} - -// WithPayload adds the payload to the create document forbidden response -func (o *CreateDocumentForbidden) WithPayload(payload *ghcmessages.Error) *CreateDocumentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create document forbidden response -func (o *CreateDocumentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateDocumentInternalServerErrorCode is the HTTP code returned for type CreateDocumentInternalServerError -const CreateDocumentInternalServerErrorCode int = 500 - -/* -CreateDocumentInternalServerError server error - -swagger:response createDocumentInternalServerError -*/ -type CreateDocumentInternalServerError struct { -} - -// NewCreateDocumentInternalServerError creates CreateDocumentInternalServerError with default headers values -func NewCreateDocumentInternalServerError() *CreateDocumentInternalServerError { - - return &CreateDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go deleted file mode 100644 index d8470b17761..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateDocumentURL generates an URL for the create document operation -type CreateDocumentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDocumentURL) WithBasePath(bp string) *CreateDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/documents" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go deleted file mode 100644 index b17be0b43bc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetDocumentHandlerFunc turns a function with the right signature into a get document handler -type GetDocumentHandlerFunc func(GetDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetDocumentHandlerFunc) Handle(params GetDocumentParams) middleware.Responder { - return fn(params) -} - -// GetDocumentHandler interface for that can handle valid get document params -type GetDocumentHandler interface { - Handle(GetDocumentParams) middleware.Responder -} - -// NewGetDocument creates a new http.Handler for the get document operation -func NewGetDocument(ctx *middleware.Context, handler GetDocumentHandler) *GetDocument { - return &GetDocument{Context: ctx, Handler: handler} -} - -/* - GetDocument swagger:route GET /documents/{documentId} ghcDocuments getDocument - -# Returns a document - -Returns a document and its uploads -*/ -type GetDocument struct { - Context *middleware.Context - Handler GetDocumentHandler -} - -func (o *GetDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go deleted file mode 100644 index 87835a385d2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetDocumentParams creates a new GetDocumentParams object -// -// There are no default values defined in the spec. -func NewGetDocumentParams() GetDocumentParams { - - return GetDocumentParams{} -} - -// GetDocumentParams contains all the bound params for the get document operation -// typically these are obtained from a http.Request -// -// swagger:parameters getDocument -type GetDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the document to return - Required: true - In: path - */ - DocumentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetDocumentParams() beforehand. -func (o *GetDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rDocumentID, rhkDocumentID, _ := route.Params.GetOK("documentId") - if err := o.bindDocumentID(rDocumentID, rhkDocumentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDocumentID binds and validates parameter DocumentID from path. -func (o *GetDocumentParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("documentId", "path", "strfmt.UUID", raw) - } - o.DocumentID = *(value.(*strfmt.UUID)) - - if err := o.validateDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateDocumentID carries on validations for parameter DocumentID -func (o *GetDocumentParams) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("documentId", "path", "uuid", o.DocumentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go deleted file mode 100644 index 6ca584c8cc7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetDocumentOKCode is the HTTP code returned for type GetDocumentOK -const GetDocumentOKCode int = 200 - -/* -GetDocumentOK the requested document - -swagger:response getDocumentOK -*/ -type GetDocumentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Document `json:"body,omitempty"` -} - -// NewGetDocumentOK creates GetDocumentOK with default headers values -func NewGetDocumentOK() *GetDocumentOK { - - return &GetDocumentOK{} -} - -// WithPayload adds the payload to the get document o k response -func (o *GetDocumentOK) WithPayload(payload *ghcmessages.Document) *GetDocumentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document o k response -func (o *GetDocumentOK) SetPayload(payload *ghcmessages.Document) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentBadRequestCode is the HTTP code returned for type GetDocumentBadRequest -const GetDocumentBadRequestCode int = 400 - -/* -GetDocumentBadRequest The request payload is invalid - -swagger:response getDocumentBadRequest -*/ -type GetDocumentBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentBadRequest creates GetDocumentBadRequest with default headers values -func NewGetDocumentBadRequest() *GetDocumentBadRequest { - - return &GetDocumentBadRequest{} -} - -// WithPayload adds the payload to the get document bad request response -func (o *GetDocumentBadRequest) WithPayload(payload *ghcmessages.Error) *GetDocumentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document bad request response -func (o *GetDocumentBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentUnauthorizedCode is the HTTP code returned for type GetDocumentUnauthorized -const GetDocumentUnauthorizedCode int = 401 - -/* -GetDocumentUnauthorized The request was denied - -swagger:response getDocumentUnauthorized -*/ -type GetDocumentUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentUnauthorized creates GetDocumentUnauthorized with default headers values -func NewGetDocumentUnauthorized() *GetDocumentUnauthorized { - - return &GetDocumentUnauthorized{} -} - -// WithPayload adds the payload to the get document unauthorized response -func (o *GetDocumentUnauthorized) WithPayload(payload *ghcmessages.Error) *GetDocumentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document unauthorized response -func (o *GetDocumentUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentForbiddenCode is the HTTP code returned for type GetDocumentForbidden -const GetDocumentForbiddenCode int = 403 - -/* -GetDocumentForbidden The request was denied - -swagger:response getDocumentForbidden -*/ -type GetDocumentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentForbidden creates GetDocumentForbidden with default headers values -func NewGetDocumentForbidden() *GetDocumentForbidden { - - return &GetDocumentForbidden{} -} - -// WithPayload adds the payload to the get document forbidden response -func (o *GetDocumentForbidden) WithPayload(payload *ghcmessages.Error) *GetDocumentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document forbidden response -func (o *GetDocumentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentNotFoundCode is the HTTP code returned for type GetDocumentNotFound -const GetDocumentNotFoundCode int = 404 - -/* -GetDocumentNotFound The requested resource wasn't found - -swagger:response getDocumentNotFound -*/ -type GetDocumentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentNotFound creates GetDocumentNotFound with default headers values -func NewGetDocumentNotFound() *GetDocumentNotFound { - - return &GetDocumentNotFound{} -} - -// WithPayload adds the payload to the get document not found response -func (o *GetDocumentNotFound) WithPayload(payload *ghcmessages.Error) *GetDocumentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document not found response -func (o *GetDocumentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentPreconditionFailedCode is the HTTP code returned for type GetDocumentPreconditionFailed -const GetDocumentPreconditionFailedCode int = 412 - -/* -GetDocumentPreconditionFailed Precondition failed - -swagger:response getDocumentPreconditionFailed -*/ -type GetDocumentPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentPreconditionFailed creates GetDocumentPreconditionFailed with default headers values -func NewGetDocumentPreconditionFailed() *GetDocumentPreconditionFailed { - - return &GetDocumentPreconditionFailed{} -} - -// WithPayload adds the payload to the get document precondition failed response -func (o *GetDocumentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *GetDocumentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document precondition failed response -func (o *GetDocumentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentUnprocessableEntityCode is the HTTP code returned for type GetDocumentUnprocessableEntity -const GetDocumentUnprocessableEntityCode int = 422 - -/* -GetDocumentUnprocessableEntity The payload was unprocessable. - -swagger:response getDocumentUnprocessableEntity -*/ -type GetDocumentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetDocumentUnprocessableEntity creates GetDocumentUnprocessableEntity with default headers values -func NewGetDocumentUnprocessableEntity() *GetDocumentUnprocessableEntity { - - return &GetDocumentUnprocessableEntity{} -} - -// WithPayload adds the payload to the get document unprocessable entity response -func (o *GetDocumentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetDocumentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document unprocessable entity response -func (o *GetDocumentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetDocumentInternalServerErrorCode is the HTTP code returned for type GetDocumentInternalServerError -const GetDocumentInternalServerErrorCode int = 500 - -/* -GetDocumentInternalServerError A server error occurred - -swagger:response getDocumentInternalServerError -*/ -type GetDocumentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetDocumentInternalServerError creates GetDocumentInternalServerError with default headers values -func NewGetDocumentInternalServerError() *GetDocumentInternalServerError { - - return &GetDocumentInternalServerError{} -} - -// WithPayload adds the payload to the get document internal server error response -func (o *GetDocumentInternalServerError) WithPayload(payload *ghcmessages.Error) *GetDocumentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get document internal server error response -func (o *GetDocumentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go deleted file mode 100644 index 1dbc81b0334..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghc_documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetDocumentURL generates an URL for the get document operation -type GetDocumentURL struct { - DocumentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetDocumentURL) WithBasePath(bp string) *GetDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/documents/{documentId}" - - documentID := o.DocumentID.String() - if documentID != "" { - _path = strings.Replace(_path, "{documentId}", documentID, -1) - } else { - return nil, errors.New("documentId is required on GetDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go deleted file mode 100644 index a08e6363355..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package lines_of_accounting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RequestLineOfAccountingHandlerFunc turns a function with the right signature into a request line of accounting handler -type RequestLineOfAccountingHandlerFunc func(RequestLineOfAccountingParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RequestLineOfAccountingHandlerFunc) Handle(params RequestLineOfAccountingParams) middleware.Responder { - return fn(params) -} - -// RequestLineOfAccountingHandler interface for that can handle valid request line of accounting params -type RequestLineOfAccountingHandler interface { - Handle(RequestLineOfAccountingParams) middleware.Responder -} - -// NewRequestLineOfAccounting creates a new http.Handler for the request line of accounting operation -func NewRequestLineOfAccounting(ctx *middleware.Context, handler RequestLineOfAccountingHandler) *RequestLineOfAccounting { - return &RequestLineOfAccounting{Context: ctx, Handler: handler} -} - -/* - RequestLineOfAccounting swagger:route POST /lines-of-accounting linesOfAccounting requestLineOfAccounting - -# Fetch line of accounting - -Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find "Active" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. -*/ -type RequestLineOfAccounting struct { - Context *middleware.Context - Handler RequestLineOfAccountingHandler -} - -func (o *RequestLineOfAccounting) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRequestLineOfAccountingParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go deleted file mode 100644 index a8dbe80b3a6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package lines_of_accounting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewRequestLineOfAccountingParams creates a new RequestLineOfAccountingParams object -// -// There are no default values defined in the spec. -func NewRequestLineOfAccountingParams() RequestLineOfAccountingParams { - - return RequestLineOfAccountingParams{} -} - -// RequestLineOfAccountingParams contains all the bound params for the request line of accounting operation -// typically these are obtained from a http.Request -// -// swagger:parameters requestLineOfAccounting -type RequestLineOfAccountingParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Service member affiliation, effective date, and TAC code. - Required: true - In: body - */ - Body *ghcmessages.FetchLineOfAccountingPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRequestLineOfAccountingParams() beforehand. -func (o *RequestLineOfAccountingParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.FetchLineOfAccountingPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go deleted file mode 100644 index d1d5f3281a6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package lines_of_accounting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// RequestLineOfAccountingOKCode is the HTTP code returned for type RequestLineOfAccountingOK -const RequestLineOfAccountingOKCode int = 200 - -/* -RequestLineOfAccountingOK Successfully retrieved line of accounting - -swagger:response requestLineOfAccountingOK -*/ -type RequestLineOfAccountingOK struct { - - /* - In: Body - */ - Payload *ghcmessages.LineOfAccounting `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingOK creates RequestLineOfAccountingOK with default headers values -func NewRequestLineOfAccountingOK() *RequestLineOfAccountingOK { - - return &RequestLineOfAccountingOK{} -} - -// WithPayload adds the payload to the request line of accounting o k response -func (o *RequestLineOfAccountingOK) WithPayload(payload *ghcmessages.LineOfAccounting) *RequestLineOfAccountingOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting o k response -func (o *RequestLineOfAccountingOK) SetPayload(payload *ghcmessages.LineOfAccounting) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingBadRequestCode is the HTTP code returned for type RequestLineOfAccountingBadRequest -const RequestLineOfAccountingBadRequestCode int = 400 - -/* -RequestLineOfAccountingBadRequest The request payload is invalid - -swagger:response requestLineOfAccountingBadRequest -*/ -type RequestLineOfAccountingBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingBadRequest creates RequestLineOfAccountingBadRequest with default headers values -func NewRequestLineOfAccountingBadRequest() *RequestLineOfAccountingBadRequest { - - return &RequestLineOfAccountingBadRequest{} -} - -// WithPayload adds the payload to the request line of accounting bad request response -func (o *RequestLineOfAccountingBadRequest) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting bad request response -func (o *RequestLineOfAccountingBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingUnauthorizedCode is the HTTP code returned for type RequestLineOfAccountingUnauthorized -const RequestLineOfAccountingUnauthorizedCode int = 401 - -/* -RequestLineOfAccountingUnauthorized The request was denied - -swagger:response requestLineOfAccountingUnauthorized -*/ -type RequestLineOfAccountingUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingUnauthorized creates RequestLineOfAccountingUnauthorized with default headers values -func NewRequestLineOfAccountingUnauthorized() *RequestLineOfAccountingUnauthorized { - - return &RequestLineOfAccountingUnauthorized{} -} - -// WithPayload adds the payload to the request line of accounting unauthorized response -func (o *RequestLineOfAccountingUnauthorized) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting unauthorized response -func (o *RequestLineOfAccountingUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingForbiddenCode is the HTTP code returned for type RequestLineOfAccountingForbidden -const RequestLineOfAccountingForbiddenCode int = 403 - -/* -RequestLineOfAccountingForbidden The request was denied - -swagger:response requestLineOfAccountingForbidden -*/ -type RequestLineOfAccountingForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingForbidden creates RequestLineOfAccountingForbidden with default headers values -func NewRequestLineOfAccountingForbidden() *RequestLineOfAccountingForbidden { - - return &RequestLineOfAccountingForbidden{} -} - -// WithPayload adds the payload to the request line of accounting forbidden response -func (o *RequestLineOfAccountingForbidden) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting forbidden response -func (o *RequestLineOfAccountingForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingNotFoundCode is the HTTP code returned for type RequestLineOfAccountingNotFound -const RequestLineOfAccountingNotFoundCode int = 404 - -/* -RequestLineOfAccountingNotFound The requested resource wasn't found - -swagger:response requestLineOfAccountingNotFound -*/ -type RequestLineOfAccountingNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingNotFound creates RequestLineOfAccountingNotFound with default headers values -func NewRequestLineOfAccountingNotFound() *RequestLineOfAccountingNotFound { - - return &RequestLineOfAccountingNotFound{} -} - -// WithPayload adds the payload to the request line of accounting not found response -func (o *RequestLineOfAccountingNotFound) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting not found response -func (o *RequestLineOfAccountingNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingUnprocessableEntityCode is the HTTP code returned for type RequestLineOfAccountingUnprocessableEntity -const RequestLineOfAccountingUnprocessableEntityCode int = 422 - -/* -RequestLineOfAccountingUnprocessableEntity The payload was unprocessable. - -swagger:response requestLineOfAccountingUnprocessableEntity -*/ -type RequestLineOfAccountingUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingUnprocessableEntity creates RequestLineOfAccountingUnprocessableEntity with default headers values -func NewRequestLineOfAccountingUnprocessableEntity() *RequestLineOfAccountingUnprocessableEntity { - - return &RequestLineOfAccountingUnprocessableEntity{} -} - -// WithPayload adds the payload to the request line of accounting unprocessable entity response -func (o *RequestLineOfAccountingUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestLineOfAccountingUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting unprocessable entity response -func (o *RequestLineOfAccountingUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestLineOfAccountingInternalServerErrorCode is the HTTP code returned for type RequestLineOfAccountingInternalServerError -const RequestLineOfAccountingInternalServerErrorCode int = 500 - -/* -RequestLineOfAccountingInternalServerError A server error occurred - -swagger:response requestLineOfAccountingInternalServerError -*/ -type RequestLineOfAccountingInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestLineOfAccountingInternalServerError creates RequestLineOfAccountingInternalServerError with default headers values -func NewRequestLineOfAccountingInternalServerError() *RequestLineOfAccountingInternalServerError { - - return &RequestLineOfAccountingInternalServerError{} -} - -// WithPayload adds the payload to the request line of accounting internal server error response -func (o *RequestLineOfAccountingInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request line of accounting internal server error response -func (o *RequestLineOfAccountingInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestLineOfAccountingInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go deleted file mode 100644 index 713e48a25e3..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package lines_of_accounting - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// RequestLineOfAccountingURL generates an URL for the request line of accounting operation -type RequestLineOfAccountingURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestLineOfAccountingURL) WithBasePath(bp string) *RequestLineOfAccountingURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestLineOfAccountingURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RequestLineOfAccountingURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/lines-of-accounting" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RequestLineOfAccountingURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RequestLineOfAccountingURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RequestLineOfAccountingURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RequestLineOfAccountingURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RequestLineOfAccountingURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RequestLineOfAccountingURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go deleted file mode 100644 index 1d723e61825..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CheckForLockedMovesAndUnlockHandlerFunc turns a function with the right signature into a check for locked moves and unlock handler -type CheckForLockedMovesAndUnlockHandlerFunc func(CheckForLockedMovesAndUnlockParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CheckForLockedMovesAndUnlockHandlerFunc) Handle(params CheckForLockedMovesAndUnlockParams) middleware.Responder { - return fn(params) -} - -// CheckForLockedMovesAndUnlockHandler interface for that can handle valid check for locked moves and unlock params -type CheckForLockedMovesAndUnlockHandler interface { - Handle(CheckForLockedMovesAndUnlockParams) middleware.Responder -} - -// NewCheckForLockedMovesAndUnlock creates a new http.Handler for the check for locked moves and unlock operation -func NewCheckForLockedMovesAndUnlock(ctx *middleware.Context, handler CheckForLockedMovesAndUnlockHandler) *CheckForLockedMovesAndUnlock { - return &CheckForLockedMovesAndUnlock{Context: ctx, Handler: handler} -} - -/* - CheckForLockedMovesAndUnlock swagger:route PATCH /moves/{officeUserID}/CheckForLockedMovesAndUnlock move checkForLockedMovesAndUnlock - -Finds and unlocks any locked moves by an office user -*/ -type CheckForLockedMovesAndUnlock struct { - Context *middleware.Context - Handler CheckForLockedMovesAndUnlockHandler -} - -func (o *CheckForLockedMovesAndUnlock) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCheckForLockedMovesAndUnlockParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// CheckForLockedMovesAndUnlockOKBody check for locked moves and unlock o k body -// -// swagger:model CheckForLockedMovesAndUnlockOKBody -type CheckForLockedMovesAndUnlockOKBody struct { - - // success message - // Example: OK - SuccessMessage string `json:"successMessage,omitempty"` -} - -// Validate validates this check for locked moves and unlock o k body -func (o *CheckForLockedMovesAndUnlockOKBody) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this check for locked moves and unlock o k body based on context it is used -func (o *CheckForLockedMovesAndUnlockOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *CheckForLockedMovesAndUnlockOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *CheckForLockedMovesAndUnlockOKBody) UnmarshalBinary(b []byte) error { - var res CheckForLockedMovesAndUnlockOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go deleted file mode 100644 index 46162a72b81..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewCheckForLockedMovesAndUnlockParams creates a new CheckForLockedMovesAndUnlockParams object -// -// There are no default values defined in the spec. -func NewCheckForLockedMovesAndUnlockParams() CheckForLockedMovesAndUnlockParams { - - return CheckForLockedMovesAndUnlockParams{} -} - -// CheckForLockedMovesAndUnlockParams contains all the bound params for the check for locked moves and unlock operation -// typically these are obtained from a http.Request -// -// swagger:parameters checkForLockedMovesAndUnlock -type CheckForLockedMovesAndUnlockParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the move's officer - Required: true - In: path - */ - OfficeUserID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCheckForLockedMovesAndUnlockParams() beforehand. -func (o *CheckForLockedMovesAndUnlockParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserID") - if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOfficeUserID binds and validates parameter OfficeUserID from path. -func (o *CheckForLockedMovesAndUnlockParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("officeUserID", "path", "strfmt.UUID", raw) - } - o.OfficeUserID = *(value.(*strfmt.UUID)) - - if err := o.validateOfficeUserID(formats); err != nil { - return err - } - - return nil -} - -// validateOfficeUserID carries on validations for parameter OfficeUserID -func (o *CheckForLockedMovesAndUnlockParams) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.FormatOf("officeUserID", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go deleted file mode 100644 index 8b5abbefb35..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CheckForLockedMovesAndUnlockOKCode is the HTTP code returned for type CheckForLockedMovesAndUnlockOK -const CheckForLockedMovesAndUnlockOKCode int = 200 - -/* -CheckForLockedMovesAndUnlockOK Successfully unlocked officer's move(s). - -swagger:response checkForLockedMovesAndUnlockOK -*/ -type CheckForLockedMovesAndUnlockOK struct { - - /* - In: Body - */ - Payload *CheckForLockedMovesAndUnlockOKBody `json:"body,omitempty"` -} - -// NewCheckForLockedMovesAndUnlockOK creates CheckForLockedMovesAndUnlockOK with default headers values -func NewCheckForLockedMovesAndUnlockOK() *CheckForLockedMovesAndUnlockOK { - - return &CheckForLockedMovesAndUnlockOK{} -} - -// WithPayload adds the payload to the check for locked moves and unlock o k response -func (o *CheckForLockedMovesAndUnlockOK) WithPayload(payload *CheckForLockedMovesAndUnlockOKBody) *CheckForLockedMovesAndUnlockOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the check for locked moves and unlock o k response -func (o *CheckForLockedMovesAndUnlockOK) SetPayload(payload *CheckForLockedMovesAndUnlockOKBody) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CheckForLockedMovesAndUnlockOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CheckForLockedMovesAndUnlockInternalServerErrorCode is the HTTP code returned for type CheckForLockedMovesAndUnlockInternalServerError -const CheckForLockedMovesAndUnlockInternalServerErrorCode int = 500 - -/* -CheckForLockedMovesAndUnlockInternalServerError A server error occurred - -swagger:response checkForLockedMovesAndUnlockInternalServerError -*/ -type CheckForLockedMovesAndUnlockInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCheckForLockedMovesAndUnlockInternalServerError creates CheckForLockedMovesAndUnlockInternalServerError with default headers values -func NewCheckForLockedMovesAndUnlockInternalServerError() *CheckForLockedMovesAndUnlockInternalServerError { - - return &CheckForLockedMovesAndUnlockInternalServerError{} -} - -// WithPayload adds the payload to the check for locked moves and unlock internal server error response -func (o *CheckForLockedMovesAndUnlockInternalServerError) WithPayload(payload *ghcmessages.Error) *CheckForLockedMovesAndUnlockInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the check for locked moves and unlock internal server error response -func (o *CheckForLockedMovesAndUnlockInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CheckForLockedMovesAndUnlockInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go deleted file mode 100644 index e103de7869d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CheckForLockedMovesAndUnlockURL generates an URL for the check for locked moves and unlock operation -type CheckForLockedMovesAndUnlockURL struct { - OfficeUserID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CheckForLockedMovesAndUnlockURL) WithBasePath(bp string) *CheckForLockedMovesAndUnlockURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CheckForLockedMovesAndUnlockURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CheckForLockedMovesAndUnlockURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{officeUserID}/CheckForLockedMovesAndUnlock" - - officeUserID := o.OfficeUserID.String() - if officeUserID != "" { - _path = strings.Replace(_path, "{officeUserID}", officeUserID, -1) - } else { - return nil, errors.New("officeUserId is required on CheckForLockedMovesAndUnlockURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CheckForLockedMovesAndUnlockURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CheckForLockedMovesAndUnlockURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CheckForLockedMovesAndUnlockURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CheckForLockedMovesAndUnlockURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CheckForLockedMovesAndUnlockURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CheckForLockedMovesAndUnlockURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go deleted file mode 100644 index 52752c84141..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DeleteAssignedOfficeUserHandlerFunc turns a function with the right signature into a delete assigned office user handler -type DeleteAssignedOfficeUserHandlerFunc func(DeleteAssignedOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteAssignedOfficeUserHandlerFunc) Handle(params DeleteAssignedOfficeUserParams) middleware.Responder { - return fn(params) -} - -// DeleteAssignedOfficeUserHandler interface for that can handle valid delete assigned office user params -type DeleteAssignedOfficeUserHandler interface { - Handle(DeleteAssignedOfficeUserParams) middleware.Responder -} - -// NewDeleteAssignedOfficeUser creates a new http.Handler for the delete assigned office user operation -func NewDeleteAssignedOfficeUser(ctx *middleware.Context, handler DeleteAssignedOfficeUserHandler) *DeleteAssignedOfficeUser { - return &DeleteAssignedOfficeUser{Context: ctx, Handler: handler} -} - -/* - DeleteAssignedOfficeUser swagger:route PATCH /moves/{moveID}/unassignOfficeUser move deleteAssignedOfficeUser - -unassigns either a services counselor, task ordering officer, or task invoicing officer from the move -*/ -type DeleteAssignedOfficeUser struct { - Context *middleware.Context - Handler DeleteAssignedOfficeUserHandler -} - -func (o *DeleteAssignedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteAssignedOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// DeleteAssignedOfficeUserBody delete assigned office user body -// -// swagger:model DeleteAssignedOfficeUserBody -type DeleteAssignedOfficeUserBody struct { - - // role type - // Required: true - RoleType *string `json:"roleType"` -} - -// Validate validates this delete assigned office user body -func (o *DeleteAssignedOfficeUserBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRoleType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *DeleteAssignedOfficeUserBody) validateRoleType(formats strfmt.Registry) error { - - if err := validate.Required("body"+"."+"roleType", "body", o.RoleType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this delete assigned office user body based on context it is used -func (o *DeleteAssignedOfficeUserBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *DeleteAssignedOfficeUserBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *DeleteAssignedOfficeUserBody) UnmarshalBinary(b []byte) error { - var res DeleteAssignedOfficeUserBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go deleted file mode 100644 index 2b2a9c43fd1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go +++ /dev/null @@ -1,118 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteAssignedOfficeUserParams creates a new DeleteAssignedOfficeUserParams object -// -// There are no default values defined in the spec. -func NewDeleteAssignedOfficeUserParams() DeleteAssignedOfficeUserParams { - - return DeleteAssignedOfficeUserParams{} -} - -// DeleteAssignedOfficeUserParams contains all the bound params for the delete assigned office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteAssignedOfficeUser -type DeleteAssignedOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body DeleteAssignedOfficeUserBody - /*ID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteAssignedOfficeUserParams() beforehand. -func (o *DeleteAssignedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body DeleteAssignedOfficeUserBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *DeleteAssignedOfficeUserParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *DeleteAssignedOfficeUserParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go deleted file mode 100644 index 74eeb8a5c5e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go +++ /dev/null @@ -1,104 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DeleteAssignedOfficeUserOKCode is the HTTP code returned for type DeleteAssignedOfficeUserOK -const DeleteAssignedOfficeUserOKCode int = 200 - -/* -DeleteAssignedOfficeUserOK Successfully unassigned office user from the move - -swagger:response deleteAssignedOfficeUserOK -*/ -type DeleteAssignedOfficeUserOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewDeleteAssignedOfficeUserOK creates DeleteAssignedOfficeUserOK with default headers values -func NewDeleteAssignedOfficeUserOK() *DeleteAssignedOfficeUserOK { - - return &DeleteAssignedOfficeUserOK{} -} - -// WithPayload adds the payload to the delete assigned office user o k response -func (o *DeleteAssignedOfficeUserOK) WithPayload(payload *ghcmessages.Move) *DeleteAssignedOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete assigned office user o k response -func (o *DeleteAssignedOfficeUserOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAssignedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteAssignedOfficeUserInternalServerErrorCode is the HTTP code returned for type DeleteAssignedOfficeUserInternalServerError -const DeleteAssignedOfficeUserInternalServerErrorCode int = 500 - -/* -DeleteAssignedOfficeUserInternalServerError A server error occurred - -swagger:response deleteAssignedOfficeUserInternalServerError -*/ -type DeleteAssignedOfficeUserInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteAssignedOfficeUserInternalServerError creates DeleteAssignedOfficeUserInternalServerError with default headers values -func NewDeleteAssignedOfficeUserInternalServerError() *DeleteAssignedOfficeUserInternalServerError { - - return &DeleteAssignedOfficeUserInternalServerError{} -} - -// WithPayload adds the payload to the delete assigned office user internal server error response -func (o *DeleteAssignedOfficeUserInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteAssignedOfficeUserInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete assigned office user internal server error response -func (o *DeleteAssignedOfficeUserInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteAssignedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go deleted file mode 100644 index 8f81bd03096..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteAssignedOfficeUserURL generates an URL for the delete assigned office user operation -type DeleteAssignedOfficeUserURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAssignedOfficeUserURL) WithBasePath(bp string) *DeleteAssignedOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteAssignedOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteAssignedOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/unassignOfficeUser" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on DeleteAssignedOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteAssignedOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteAssignedOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteAssignedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteAssignedOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteAssignedOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteAssignedOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move.go b/pkg/gen/ghcapi/ghcoperations/move/get_move.go deleted file mode 100644 index db9024a0c0c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveHandlerFunc turns a function with the right signature into a get move handler -type GetMoveHandlerFunc func(GetMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveHandlerFunc) Handle(params GetMoveParams) middleware.Responder { - return fn(params) -} - -// GetMoveHandler interface for that can handle valid get move params -type GetMoveHandler interface { - Handle(GetMoveParams) middleware.Responder -} - -// NewGetMove creates a new http.Handler for the get move operation -func NewGetMove(ctx *middleware.Context, handler GetMoveHandler) *GetMove { - return &GetMove{Context: ctx, Handler: handler} -} - -/* - GetMove swagger:route GET /move/{locator} move getMove - -# Returns a given move - -Returns a given move for a unique alphanumeric locator string -*/ -type GetMove struct { - Context *middleware.Context - Handler GetMoveHandler -} - -func (o *GetMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go deleted file mode 100644 index 2989281f5af..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveCounselingEvaluationReportsListHandlerFunc turns a function with the right signature into a get move counseling evaluation reports list handler -type GetMoveCounselingEvaluationReportsListHandlerFunc func(GetMoveCounselingEvaluationReportsListParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveCounselingEvaluationReportsListHandlerFunc) Handle(params GetMoveCounselingEvaluationReportsListParams) middleware.Responder { - return fn(params) -} - -// GetMoveCounselingEvaluationReportsListHandler interface for that can handle valid get move counseling evaluation reports list params -type GetMoveCounselingEvaluationReportsListHandler interface { - Handle(GetMoveCounselingEvaluationReportsListParams) middleware.Responder -} - -// NewGetMoveCounselingEvaluationReportsList creates a new http.Handler for the get move counseling evaluation reports list operation -func NewGetMoveCounselingEvaluationReportsList(ctx *middleware.Context, handler GetMoveCounselingEvaluationReportsListHandler) *GetMoveCounselingEvaluationReportsList { - return &GetMoveCounselingEvaluationReportsList{Context: ctx, Handler: handler} -} - -/* - GetMoveCounselingEvaluationReportsList swagger:route GET /moves/{moveID}/counseling-evaluation-reports-list move getMoveCounselingEvaluationReportsList - -# Returns counseling evaluation reports for the specified move that are visible to the current office user - -Returns counseling evaluation reports for the specified move that are visible to the current office user -*/ -type GetMoveCounselingEvaluationReportsList struct { - Context *middleware.Context - Handler GetMoveCounselingEvaluationReportsListHandler -} - -func (o *GetMoveCounselingEvaluationReportsList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveCounselingEvaluationReportsListParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go deleted file mode 100644 index ef8796bb2d8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetMoveCounselingEvaluationReportsListParams creates a new GetMoveCounselingEvaluationReportsListParams object -// -// There are no default values defined in the spec. -func NewGetMoveCounselingEvaluationReportsListParams() GetMoveCounselingEvaluationReportsListParams { - - return GetMoveCounselingEvaluationReportsListParams{} -} - -// GetMoveCounselingEvaluationReportsListParams contains all the bound params for the get move counseling evaluation reports list operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveCounselingEvaluationReportsList -type GetMoveCounselingEvaluationReportsListParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Code used to identify a move in the system - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveCounselingEvaluationReportsListParams() beforehand. -func (o *GetMoveCounselingEvaluationReportsListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveCounselingEvaluationReportsListParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *GetMoveCounselingEvaluationReportsListParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go deleted file mode 100644 index 4756560f448..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMoveCounselingEvaluationReportsListOKCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListOK -const GetMoveCounselingEvaluationReportsListOKCode int = 200 - -/* -GetMoveCounselingEvaluationReportsListOK Successfully retrieved the move's evaluation reports - -swagger:response getMoveCounselingEvaluationReportsListOK -*/ -type GetMoveCounselingEvaluationReportsListOK struct { - - /* - In: Body - */ - Payload ghcmessages.EvaluationReportList `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListOK creates GetMoveCounselingEvaluationReportsListOK with default headers values -func NewGetMoveCounselingEvaluationReportsListOK() *GetMoveCounselingEvaluationReportsListOK { - - return &GetMoveCounselingEvaluationReportsListOK{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list o k response -func (o *GetMoveCounselingEvaluationReportsListOK) WithPayload(payload ghcmessages.EvaluationReportList) *GetMoveCounselingEvaluationReportsListOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list o k response -func (o *GetMoveCounselingEvaluationReportsListOK) SetPayload(payload ghcmessages.EvaluationReportList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.EvaluationReportList{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetMoveCounselingEvaluationReportsListBadRequestCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListBadRequest -const GetMoveCounselingEvaluationReportsListBadRequestCode int = 400 - -/* -GetMoveCounselingEvaluationReportsListBadRequest The request payload is invalid - -swagger:response getMoveCounselingEvaluationReportsListBadRequest -*/ -type GetMoveCounselingEvaluationReportsListBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListBadRequest creates GetMoveCounselingEvaluationReportsListBadRequest with default headers values -func NewGetMoveCounselingEvaluationReportsListBadRequest() *GetMoveCounselingEvaluationReportsListBadRequest { - - return &GetMoveCounselingEvaluationReportsListBadRequest{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list bad request response -func (o *GetMoveCounselingEvaluationReportsListBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list bad request response -func (o *GetMoveCounselingEvaluationReportsListBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveCounselingEvaluationReportsListUnauthorizedCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListUnauthorized -const GetMoveCounselingEvaluationReportsListUnauthorizedCode int = 401 - -/* -GetMoveCounselingEvaluationReportsListUnauthorized The request was denied - -swagger:response getMoveCounselingEvaluationReportsListUnauthorized -*/ -type GetMoveCounselingEvaluationReportsListUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListUnauthorized creates GetMoveCounselingEvaluationReportsListUnauthorized with default headers values -func NewGetMoveCounselingEvaluationReportsListUnauthorized() *GetMoveCounselingEvaluationReportsListUnauthorized { - - return &GetMoveCounselingEvaluationReportsListUnauthorized{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list unauthorized response -func (o *GetMoveCounselingEvaluationReportsListUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list unauthorized response -func (o *GetMoveCounselingEvaluationReportsListUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveCounselingEvaluationReportsListForbiddenCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListForbidden -const GetMoveCounselingEvaluationReportsListForbiddenCode int = 403 - -/* -GetMoveCounselingEvaluationReportsListForbidden The request was denied - -swagger:response getMoveCounselingEvaluationReportsListForbidden -*/ -type GetMoveCounselingEvaluationReportsListForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListForbidden creates GetMoveCounselingEvaluationReportsListForbidden with default headers values -func NewGetMoveCounselingEvaluationReportsListForbidden() *GetMoveCounselingEvaluationReportsListForbidden { - - return &GetMoveCounselingEvaluationReportsListForbidden{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list forbidden response -func (o *GetMoveCounselingEvaluationReportsListForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list forbidden response -func (o *GetMoveCounselingEvaluationReportsListForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveCounselingEvaluationReportsListNotFoundCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListNotFound -const GetMoveCounselingEvaluationReportsListNotFoundCode int = 404 - -/* -GetMoveCounselingEvaluationReportsListNotFound The requested resource wasn't found - -swagger:response getMoveCounselingEvaluationReportsListNotFound -*/ -type GetMoveCounselingEvaluationReportsListNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListNotFound creates GetMoveCounselingEvaluationReportsListNotFound with default headers values -func NewGetMoveCounselingEvaluationReportsListNotFound() *GetMoveCounselingEvaluationReportsListNotFound { - - return &GetMoveCounselingEvaluationReportsListNotFound{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list not found response -func (o *GetMoveCounselingEvaluationReportsListNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list not found response -func (o *GetMoveCounselingEvaluationReportsListNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveCounselingEvaluationReportsListInternalServerErrorCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListInternalServerError -const GetMoveCounselingEvaluationReportsListInternalServerErrorCode int = 500 - -/* -GetMoveCounselingEvaluationReportsListInternalServerError A server error occurred - -swagger:response getMoveCounselingEvaluationReportsListInternalServerError -*/ -type GetMoveCounselingEvaluationReportsListInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveCounselingEvaluationReportsListInternalServerError creates GetMoveCounselingEvaluationReportsListInternalServerError with default headers values -func NewGetMoveCounselingEvaluationReportsListInternalServerError() *GetMoveCounselingEvaluationReportsListInternalServerError { - - return &GetMoveCounselingEvaluationReportsListInternalServerError{} -} - -// WithPayload adds the payload to the get move counseling evaluation reports list internal server error response -func (o *GetMoveCounselingEvaluationReportsListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move counseling evaluation reports list internal server error response -func (o *GetMoveCounselingEvaluationReportsListInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveCounselingEvaluationReportsListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go deleted file mode 100644 index a3725b0aae3..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetMoveCounselingEvaluationReportsListURL generates an URL for the get move counseling evaluation reports list operation -type GetMoveCounselingEvaluationReportsListURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveCounselingEvaluationReportsListURL) WithBasePath(bp string) *GetMoveCounselingEvaluationReportsListURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveCounselingEvaluationReportsListURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveCounselingEvaluationReportsListURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/counseling-evaluation-reports-list" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveCounselingEvaluationReportsListURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveCounselingEvaluationReportsListURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveCounselingEvaluationReportsListURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveCounselingEvaluationReportsListURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveCounselingEvaluationReportsListURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveCounselingEvaluationReportsListURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveCounselingEvaluationReportsListURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go deleted file mode 100644 index c544b6c9e47..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveHistoryHandlerFunc turns a function with the right signature into a get move history handler -type GetMoveHistoryHandlerFunc func(GetMoveHistoryParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveHistoryHandlerFunc) Handle(params GetMoveHistoryParams) middleware.Responder { - return fn(params) -} - -// GetMoveHistoryHandler interface for that can handle valid get move history params -type GetMoveHistoryHandler interface { - Handle(GetMoveHistoryParams) middleware.Responder -} - -// NewGetMoveHistory creates a new http.Handler for the get move history operation -func NewGetMoveHistory(ctx *middleware.Context, handler GetMoveHistoryHandler) *GetMoveHistory { - return &GetMoveHistory{Context: ctx, Handler: handler} -} - -/* - GetMoveHistory swagger:route GET /move/{locator}/history move getMoveHistory - -# Returns the history of an identified move - -Returns the history for a given move for a unique alphanumeric locator string -*/ -type GetMoveHistory struct { - Context *middleware.Context - Handler GetMoveHistoryHandler -} - -func (o *GetMoveHistory) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveHistoryParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go deleted file mode 100644 index 8cef5040635..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetMoveHistoryParams creates a new GetMoveHistoryParams object -// -// There are no default values defined in the spec. -func NewGetMoveHistoryParams() GetMoveHistoryParams { - - return GetMoveHistoryParams{} -} - -// GetMoveHistoryParams contains all the bound params for the get move history operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveHistory -type GetMoveHistoryParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Code used to identify a move in the system - Required: true - In: path - */ - Locator string - /*requested page of results - In: query - */ - Page *int64 - /*results per page - In: query - */ - PerPage *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveHistoryParams() beforehand. -func (o *GetMoveHistoryParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *GetMoveHistoryParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *GetMoveHistoryParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *GetMoveHistoryParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go deleted file mode 100644 index 47d1f3e4090..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMoveHistoryOKCode is the HTTP code returned for type GetMoveHistoryOK -const GetMoveHistoryOKCode int = 200 - -/* -GetMoveHistoryOK Successfully retrieved the individual move history - -swagger:response getMoveHistoryOK -*/ -type GetMoveHistoryOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MoveHistoryResult `json:"body,omitempty"` -} - -// NewGetMoveHistoryOK creates GetMoveHistoryOK with default headers values -func NewGetMoveHistoryOK() *GetMoveHistoryOK { - - return &GetMoveHistoryOK{} -} - -// WithPayload adds the payload to the get move history o k response -func (o *GetMoveHistoryOK) WithPayload(payload *ghcmessages.MoveHistoryResult) *GetMoveHistoryOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history o k response -func (o *GetMoveHistoryOK) SetPayload(payload *ghcmessages.MoveHistoryResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveHistoryBadRequestCode is the HTTP code returned for type GetMoveHistoryBadRequest -const GetMoveHistoryBadRequestCode int = 400 - -/* -GetMoveHistoryBadRequest The request payload is invalid - -swagger:response getMoveHistoryBadRequest -*/ -type GetMoveHistoryBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveHistoryBadRequest creates GetMoveHistoryBadRequest with default headers values -func NewGetMoveHistoryBadRequest() *GetMoveHistoryBadRequest { - - return &GetMoveHistoryBadRequest{} -} - -// WithPayload adds the payload to the get move history bad request response -func (o *GetMoveHistoryBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history bad request response -func (o *GetMoveHistoryBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveHistoryUnauthorizedCode is the HTTP code returned for type GetMoveHistoryUnauthorized -const GetMoveHistoryUnauthorizedCode int = 401 - -/* -GetMoveHistoryUnauthorized The request was denied - -swagger:response getMoveHistoryUnauthorized -*/ -type GetMoveHistoryUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveHistoryUnauthorized creates GetMoveHistoryUnauthorized with default headers values -func NewGetMoveHistoryUnauthorized() *GetMoveHistoryUnauthorized { - - return &GetMoveHistoryUnauthorized{} -} - -// WithPayload adds the payload to the get move history unauthorized response -func (o *GetMoveHistoryUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history unauthorized response -func (o *GetMoveHistoryUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveHistoryForbiddenCode is the HTTP code returned for type GetMoveHistoryForbidden -const GetMoveHistoryForbiddenCode int = 403 - -/* -GetMoveHistoryForbidden The request was denied - -swagger:response getMoveHistoryForbidden -*/ -type GetMoveHistoryForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveHistoryForbidden creates GetMoveHistoryForbidden with default headers values -func NewGetMoveHistoryForbidden() *GetMoveHistoryForbidden { - - return &GetMoveHistoryForbidden{} -} - -// WithPayload adds the payload to the get move history forbidden response -func (o *GetMoveHistoryForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history forbidden response -func (o *GetMoveHistoryForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveHistoryNotFoundCode is the HTTP code returned for type GetMoveHistoryNotFound -const GetMoveHistoryNotFoundCode int = 404 - -/* -GetMoveHistoryNotFound The requested resource wasn't found - -swagger:response getMoveHistoryNotFound -*/ -type GetMoveHistoryNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveHistoryNotFound creates GetMoveHistoryNotFound with default headers values -func NewGetMoveHistoryNotFound() *GetMoveHistoryNotFound { - - return &GetMoveHistoryNotFound{} -} - -// WithPayload adds the payload to the get move history not found response -func (o *GetMoveHistoryNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history not found response -func (o *GetMoveHistoryNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveHistoryInternalServerErrorCode is the HTTP code returned for type GetMoveHistoryInternalServerError -const GetMoveHistoryInternalServerErrorCode int = 500 - -/* -GetMoveHistoryInternalServerError A server error occurred - -swagger:response getMoveHistoryInternalServerError -*/ -type GetMoveHistoryInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveHistoryInternalServerError creates GetMoveHistoryInternalServerError with default headers values -func NewGetMoveHistoryInternalServerError() *GetMoveHistoryInternalServerError { - - return &GetMoveHistoryInternalServerError{} -} - -// WithPayload adds the payload to the get move history internal server error response -func (o *GetMoveHistoryInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move history internal server error response -func (o *GetMoveHistoryInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveHistoryInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go deleted file mode 100644 index 8266cad9d57..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/swag" -) - -// GetMoveHistoryURL generates an URL for the get move history operation -type GetMoveHistoryURL struct { - Locator string - - Page *int64 - PerPage *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveHistoryURL) WithBasePath(bp string) *GetMoveHistoryURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveHistoryURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveHistoryURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move/{locator}/history" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on GetMoveHistoryURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveHistoryURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveHistoryURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveHistoryURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveHistoryURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveHistoryURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveHistoryURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go deleted file mode 100644 index 33ca21cc208..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveParams creates a new GetMoveParams object -// -// There are no default values defined in the spec. -func NewGetMoveParams() GetMoveParams { - - return GetMoveParams{} -} - -// GetMoveParams contains all the bound params for the get move operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMove -type GetMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Code used to identify a move in the system - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveParams() beforehand. -func (o *GetMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *GetMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go deleted file mode 100644 index dd24b77d31e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMoveOKCode is the HTTP code returned for type GetMoveOK -const GetMoveOKCode int = 200 - -/* -GetMoveOK Successfully retrieved the individual move - -swagger:response getMoveOK -*/ -type GetMoveOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewGetMoveOK creates GetMoveOK with default headers values -func NewGetMoveOK() *GetMoveOK { - - return &GetMoveOK{} -} - -// WithPayload adds the payload to the get move o k response -func (o *GetMoveOK) WithPayload(payload *ghcmessages.Move) *GetMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move o k response -func (o *GetMoveOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveBadRequestCode is the HTTP code returned for type GetMoveBadRequest -const GetMoveBadRequestCode int = 400 - -/* -GetMoveBadRequest The request payload is invalid - -swagger:response getMoveBadRequest -*/ -type GetMoveBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveBadRequest creates GetMoveBadRequest with default headers values -func NewGetMoveBadRequest() *GetMoveBadRequest { - - return &GetMoveBadRequest{} -} - -// WithPayload adds the payload to the get move bad request response -func (o *GetMoveBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move bad request response -func (o *GetMoveBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveUnauthorizedCode is the HTTP code returned for type GetMoveUnauthorized -const GetMoveUnauthorizedCode int = 401 - -/* -GetMoveUnauthorized The request was denied - -swagger:response getMoveUnauthorized -*/ -type GetMoveUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveUnauthorized creates GetMoveUnauthorized with default headers values -func NewGetMoveUnauthorized() *GetMoveUnauthorized { - - return &GetMoveUnauthorized{} -} - -// WithPayload adds the payload to the get move unauthorized response -func (o *GetMoveUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move unauthorized response -func (o *GetMoveUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveForbiddenCode is the HTTP code returned for type GetMoveForbidden -const GetMoveForbiddenCode int = 403 - -/* -GetMoveForbidden The request was denied - -swagger:response getMoveForbidden -*/ -type GetMoveForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveForbidden creates GetMoveForbidden with default headers values -func NewGetMoveForbidden() *GetMoveForbidden { - - return &GetMoveForbidden{} -} - -// WithPayload adds the payload to the get move forbidden response -func (o *GetMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move forbidden response -func (o *GetMoveForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveNotFoundCode is the HTTP code returned for type GetMoveNotFound -const GetMoveNotFoundCode int = 404 - -/* -GetMoveNotFound The requested resource wasn't found - -swagger:response getMoveNotFound -*/ -type GetMoveNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveNotFound creates GetMoveNotFound with default headers values -func NewGetMoveNotFound() *GetMoveNotFound { - - return &GetMoveNotFound{} -} - -// WithPayload adds the payload to the get move not found response -func (o *GetMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move not found response -func (o *GetMoveNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveInternalServerErrorCode is the HTTP code returned for type GetMoveInternalServerError -const GetMoveInternalServerErrorCode int = 500 - -/* -GetMoveInternalServerError A server error occurred - -swagger:response getMoveInternalServerError -*/ -type GetMoveInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveInternalServerError creates GetMoveInternalServerError with default headers values -func NewGetMoveInternalServerError() *GetMoveInternalServerError { - - return &GetMoveInternalServerError{} -} - -// WithPayload adds the payload to the get move internal server error response -func (o *GetMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move internal server error response -func (o *GetMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go deleted file mode 100644 index d124b8d8f74..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveShipmentEvaluationReportsListHandlerFunc turns a function with the right signature into a get move shipment evaluation reports list handler -type GetMoveShipmentEvaluationReportsListHandlerFunc func(GetMoveShipmentEvaluationReportsListParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveShipmentEvaluationReportsListHandlerFunc) Handle(params GetMoveShipmentEvaluationReportsListParams) middleware.Responder { - return fn(params) -} - -// GetMoveShipmentEvaluationReportsListHandler interface for that can handle valid get move shipment evaluation reports list params -type GetMoveShipmentEvaluationReportsListHandler interface { - Handle(GetMoveShipmentEvaluationReportsListParams) middleware.Responder -} - -// NewGetMoveShipmentEvaluationReportsList creates a new http.Handler for the get move shipment evaluation reports list operation -func NewGetMoveShipmentEvaluationReportsList(ctx *middleware.Context, handler GetMoveShipmentEvaluationReportsListHandler) *GetMoveShipmentEvaluationReportsList { - return &GetMoveShipmentEvaluationReportsList{Context: ctx, Handler: handler} -} - -/* - GetMoveShipmentEvaluationReportsList swagger:route GET /moves/{moveID}/shipment-evaluation-reports-list move getMoveShipmentEvaluationReportsList - -# Returns shipment evaluation reports for the specified move that are visible to the current office user - -Returns shipment evaluation reports for the specified move that are visible to the current office user -*/ -type GetMoveShipmentEvaluationReportsList struct { - Context *middleware.Context - Handler GetMoveShipmentEvaluationReportsListHandler -} - -func (o *GetMoveShipmentEvaluationReportsList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveShipmentEvaluationReportsListParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go deleted file mode 100644 index 1538328f9fd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetMoveShipmentEvaluationReportsListParams creates a new GetMoveShipmentEvaluationReportsListParams object -// -// There are no default values defined in the spec. -func NewGetMoveShipmentEvaluationReportsListParams() GetMoveShipmentEvaluationReportsListParams { - - return GetMoveShipmentEvaluationReportsListParams{} -} - -// GetMoveShipmentEvaluationReportsListParams contains all the bound params for the get move shipment evaluation reports list operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveShipmentEvaluationReportsList -type GetMoveShipmentEvaluationReportsListParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Code used to identify a move in the system - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveShipmentEvaluationReportsListParams() beforehand. -func (o *GetMoveShipmentEvaluationReportsListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveShipmentEvaluationReportsListParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *GetMoveShipmentEvaluationReportsListParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go deleted file mode 100644 index 063c638d677..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMoveShipmentEvaluationReportsListOKCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListOK -const GetMoveShipmentEvaluationReportsListOKCode int = 200 - -/* -GetMoveShipmentEvaluationReportsListOK Successfully retrieved the move's evaluation reports - -swagger:response getMoveShipmentEvaluationReportsListOK -*/ -type GetMoveShipmentEvaluationReportsListOK struct { - - /* - In: Body - */ - Payload ghcmessages.EvaluationReportList `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListOK creates GetMoveShipmentEvaluationReportsListOK with default headers values -func NewGetMoveShipmentEvaluationReportsListOK() *GetMoveShipmentEvaluationReportsListOK { - - return &GetMoveShipmentEvaluationReportsListOK{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list o k response -func (o *GetMoveShipmentEvaluationReportsListOK) WithPayload(payload ghcmessages.EvaluationReportList) *GetMoveShipmentEvaluationReportsListOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list o k response -func (o *GetMoveShipmentEvaluationReportsListOK) SetPayload(payload ghcmessages.EvaluationReportList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.EvaluationReportList{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetMoveShipmentEvaluationReportsListBadRequestCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListBadRequest -const GetMoveShipmentEvaluationReportsListBadRequestCode int = 400 - -/* -GetMoveShipmentEvaluationReportsListBadRequest The request payload is invalid - -swagger:response getMoveShipmentEvaluationReportsListBadRequest -*/ -type GetMoveShipmentEvaluationReportsListBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListBadRequest creates GetMoveShipmentEvaluationReportsListBadRequest with default headers values -func NewGetMoveShipmentEvaluationReportsListBadRequest() *GetMoveShipmentEvaluationReportsListBadRequest { - - return &GetMoveShipmentEvaluationReportsListBadRequest{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list bad request response -func (o *GetMoveShipmentEvaluationReportsListBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list bad request response -func (o *GetMoveShipmentEvaluationReportsListBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveShipmentEvaluationReportsListUnauthorizedCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListUnauthorized -const GetMoveShipmentEvaluationReportsListUnauthorizedCode int = 401 - -/* -GetMoveShipmentEvaluationReportsListUnauthorized The request was denied - -swagger:response getMoveShipmentEvaluationReportsListUnauthorized -*/ -type GetMoveShipmentEvaluationReportsListUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListUnauthorized creates GetMoveShipmentEvaluationReportsListUnauthorized with default headers values -func NewGetMoveShipmentEvaluationReportsListUnauthorized() *GetMoveShipmentEvaluationReportsListUnauthorized { - - return &GetMoveShipmentEvaluationReportsListUnauthorized{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list unauthorized response -func (o *GetMoveShipmentEvaluationReportsListUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list unauthorized response -func (o *GetMoveShipmentEvaluationReportsListUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveShipmentEvaluationReportsListForbiddenCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListForbidden -const GetMoveShipmentEvaluationReportsListForbiddenCode int = 403 - -/* -GetMoveShipmentEvaluationReportsListForbidden The request was denied - -swagger:response getMoveShipmentEvaluationReportsListForbidden -*/ -type GetMoveShipmentEvaluationReportsListForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListForbidden creates GetMoveShipmentEvaluationReportsListForbidden with default headers values -func NewGetMoveShipmentEvaluationReportsListForbidden() *GetMoveShipmentEvaluationReportsListForbidden { - - return &GetMoveShipmentEvaluationReportsListForbidden{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list forbidden response -func (o *GetMoveShipmentEvaluationReportsListForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list forbidden response -func (o *GetMoveShipmentEvaluationReportsListForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveShipmentEvaluationReportsListNotFoundCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListNotFound -const GetMoveShipmentEvaluationReportsListNotFoundCode int = 404 - -/* -GetMoveShipmentEvaluationReportsListNotFound The requested resource wasn't found - -swagger:response getMoveShipmentEvaluationReportsListNotFound -*/ -type GetMoveShipmentEvaluationReportsListNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListNotFound creates GetMoveShipmentEvaluationReportsListNotFound with default headers values -func NewGetMoveShipmentEvaluationReportsListNotFound() *GetMoveShipmentEvaluationReportsListNotFound { - - return &GetMoveShipmentEvaluationReportsListNotFound{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list not found response -func (o *GetMoveShipmentEvaluationReportsListNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list not found response -func (o *GetMoveShipmentEvaluationReportsListNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveShipmentEvaluationReportsListInternalServerErrorCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListInternalServerError -const GetMoveShipmentEvaluationReportsListInternalServerErrorCode int = 500 - -/* -GetMoveShipmentEvaluationReportsListInternalServerError A server error occurred - -swagger:response getMoveShipmentEvaluationReportsListInternalServerError -*/ -type GetMoveShipmentEvaluationReportsListInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveShipmentEvaluationReportsListInternalServerError creates GetMoveShipmentEvaluationReportsListInternalServerError with default headers values -func NewGetMoveShipmentEvaluationReportsListInternalServerError() *GetMoveShipmentEvaluationReportsListInternalServerError { - - return &GetMoveShipmentEvaluationReportsListInternalServerError{} -} - -// WithPayload adds the payload to the get move shipment evaluation reports list internal server error response -func (o *GetMoveShipmentEvaluationReportsListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move shipment evaluation reports list internal server error response -func (o *GetMoveShipmentEvaluationReportsListInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveShipmentEvaluationReportsListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go deleted file mode 100644 index 3854b930ca0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetMoveShipmentEvaluationReportsListURL generates an URL for the get move shipment evaluation reports list operation -type GetMoveShipmentEvaluationReportsListURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveShipmentEvaluationReportsListURL) WithBasePath(bp string) *GetMoveShipmentEvaluationReportsListURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveShipmentEvaluationReportsListURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveShipmentEvaluationReportsListURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/shipment-evaluation-reports-list" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveShipmentEvaluationReportsListURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveShipmentEvaluationReportsListURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveShipmentEvaluationReportsListURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveShipmentEvaluationReportsListURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveShipmentEvaluationReportsListURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveShipmentEvaluationReportsListURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveShipmentEvaluationReportsListURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go deleted file mode 100644 index c4e0dc786aa..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveURL generates an URL for the get move operation -type GetMoveURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveURL) WithBasePath(bp string) *GetMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move/{locator}" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on GetMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go deleted file mode 100644 index 5036a38e3a0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// MoveCancelerHandlerFunc turns a function with the right signature into a move canceler handler -type MoveCancelerHandlerFunc func(MoveCancelerParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn MoveCancelerHandlerFunc) Handle(params MoveCancelerParams) middleware.Responder { - return fn(params) -} - -// MoveCancelerHandler interface for that can handle valid move canceler params -type MoveCancelerHandler interface { - Handle(MoveCancelerParams) middleware.Responder -} - -// NewMoveCanceler creates a new http.Handler for the move canceler operation -func NewMoveCanceler(ctx *middleware.Context, handler MoveCancelerHandler) *MoveCanceler { - return &MoveCanceler{Context: ctx, Handler: handler} -} - -/* - MoveCanceler swagger:route POST /moves/{moveID}/cancel move moveCanceler - -# Cancels a move - -cancels a move -*/ -type MoveCanceler struct { - Context *middleware.Context - Handler MoveCancelerHandler -} - -func (o *MoveCanceler) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewMoveCancelerParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go deleted file mode 100644 index e997f36bc19..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewMoveCancelerParams creates a new MoveCancelerParams object -// -// There are no default values defined in the spec. -func NewMoveCancelerParams() MoveCancelerParams { - - return MoveCancelerParams{} -} - -// MoveCancelerParams contains all the bound params for the move canceler operation -// typically these are obtained from a http.Request -// -// swagger:parameters moveCanceler -type MoveCancelerParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewMoveCancelerParams() beforehand. -func (o *MoveCancelerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *MoveCancelerParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *MoveCancelerParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go deleted file mode 100644 index d96b78fc5af..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// MoveCancelerOKCode is the HTTP code returned for type MoveCancelerOK -const MoveCancelerOKCode int = 200 - -/* -MoveCancelerOK Successfully canceled move - -swagger:response moveCancelerOK -*/ -type MoveCancelerOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewMoveCancelerOK creates MoveCancelerOK with default headers values -func NewMoveCancelerOK() *MoveCancelerOK { - - return &MoveCancelerOK{} -} - -// WithPayload adds the payload to the move canceler o k response -func (o *MoveCancelerOK) WithPayload(payload *ghcmessages.Move) *MoveCancelerOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler o k response -func (o *MoveCancelerOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerForbiddenCode is the HTTP code returned for type MoveCancelerForbidden -const MoveCancelerForbiddenCode int = 403 - -/* -MoveCancelerForbidden The request was denied - -swagger:response moveCancelerForbidden -*/ -type MoveCancelerForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewMoveCancelerForbidden creates MoveCancelerForbidden with default headers values -func NewMoveCancelerForbidden() *MoveCancelerForbidden { - - return &MoveCancelerForbidden{} -} - -// WithPayload adds the payload to the move canceler forbidden response -func (o *MoveCancelerForbidden) WithPayload(payload *ghcmessages.Error) *MoveCancelerForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler forbidden response -func (o *MoveCancelerForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerNotFoundCode is the HTTP code returned for type MoveCancelerNotFound -const MoveCancelerNotFoundCode int = 404 - -/* -MoveCancelerNotFound The requested resource wasn't found - -swagger:response moveCancelerNotFound -*/ -type MoveCancelerNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewMoveCancelerNotFound creates MoveCancelerNotFound with default headers values -func NewMoveCancelerNotFound() *MoveCancelerNotFound { - - return &MoveCancelerNotFound{} -} - -// WithPayload adds the payload to the move canceler not found response -func (o *MoveCancelerNotFound) WithPayload(payload *ghcmessages.Error) *MoveCancelerNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler not found response -func (o *MoveCancelerNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerConflictCode is the HTTP code returned for type MoveCancelerConflict -const MoveCancelerConflictCode int = 409 - -/* -MoveCancelerConflict Conflict error - -swagger:response moveCancelerConflict -*/ -type MoveCancelerConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewMoveCancelerConflict creates MoveCancelerConflict with default headers values -func NewMoveCancelerConflict() *MoveCancelerConflict { - - return &MoveCancelerConflict{} -} - -// WithPayload adds the payload to the move canceler conflict response -func (o *MoveCancelerConflict) WithPayload(payload *ghcmessages.Error) *MoveCancelerConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler conflict response -func (o *MoveCancelerConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerPreconditionFailedCode is the HTTP code returned for type MoveCancelerPreconditionFailed -const MoveCancelerPreconditionFailedCode int = 412 - -/* -MoveCancelerPreconditionFailed Precondition failed - -swagger:response moveCancelerPreconditionFailed -*/ -type MoveCancelerPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewMoveCancelerPreconditionFailed creates MoveCancelerPreconditionFailed with default headers values -func NewMoveCancelerPreconditionFailed() *MoveCancelerPreconditionFailed { - - return &MoveCancelerPreconditionFailed{} -} - -// WithPayload adds the payload to the move canceler precondition failed response -func (o *MoveCancelerPreconditionFailed) WithPayload(payload *ghcmessages.Error) *MoveCancelerPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler precondition failed response -func (o *MoveCancelerPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerUnprocessableEntityCode is the HTTP code returned for type MoveCancelerUnprocessableEntity -const MoveCancelerUnprocessableEntityCode int = 422 - -/* -MoveCancelerUnprocessableEntity The payload was unprocessable. - -swagger:response moveCancelerUnprocessableEntity -*/ -type MoveCancelerUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewMoveCancelerUnprocessableEntity creates MoveCancelerUnprocessableEntity with default headers values -func NewMoveCancelerUnprocessableEntity() *MoveCancelerUnprocessableEntity { - - return &MoveCancelerUnprocessableEntity{} -} - -// WithPayload adds the payload to the move canceler unprocessable entity response -func (o *MoveCancelerUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *MoveCancelerUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler unprocessable entity response -func (o *MoveCancelerUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MoveCancelerInternalServerErrorCode is the HTTP code returned for type MoveCancelerInternalServerError -const MoveCancelerInternalServerErrorCode int = 500 - -/* -MoveCancelerInternalServerError A server error occurred - -swagger:response moveCancelerInternalServerError -*/ -type MoveCancelerInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewMoveCancelerInternalServerError creates MoveCancelerInternalServerError with default headers values -func NewMoveCancelerInternalServerError() *MoveCancelerInternalServerError { - - return &MoveCancelerInternalServerError{} -} - -// WithPayload adds the payload to the move canceler internal server error response -func (o *MoveCancelerInternalServerError) WithPayload(payload *ghcmessages.Error) *MoveCancelerInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the move canceler internal server error response -func (o *MoveCancelerInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MoveCancelerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go deleted file mode 100644 index f3f6ebb25eb..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// MoveCancelerURL generates an URL for the move canceler operation -type MoveCancelerURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *MoveCancelerURL) WithBasePath(bp string) *MoveCancelerURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *MoveCancelerURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *MoveCancelerURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/cancel" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on MoveCancelerURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *MoveCancelerURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *MoveCancelerURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *MoveCancelerURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on MoveCancelerURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on MoveCancelerURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *MoveCancelerURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go deleted file mode 100644 index d54a3739ead..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "encoding/json" - "net/http" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SearchMovesHandlerFunc turns a function with the right signature into a search moves handler -type SearchMovesHandlerFunc func(SearchMovesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SearchMovesHandlerFunc) Handle(params SearchMovesParams) middleware.Responder { - return fn(params) -} - -// SearchMovesHandler interface for that can handle valid search moves params -type SearchMovesHandler interface { - Handle(SearchMovesParams) middleware.Responder -} - -// NewSearchMoves creates a new http.Handler for the search moves operation -func NewSearchMoves(ctx *middleware.Context, handler SearchMovesHandler) *SearchMoves { - return &SearchMoves{Context: ctx, Handler: handler} -} - -/* - SearchMoves swagger:route POST /moves/search move searchMoves - -# Search moves by locator, DOD ID, or customer name - -Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users. -*/ -type SearchMoves struct { - Context *middleware.Context - Handler SearchMovesHandler -} - -func (o *SearchMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSearchMovesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// SearchMovesBody search moves body -// -// swagger:model SearchMovesBody -type SearchMovesBody struct { - - // branch - Branch *string `json:"branch,omitempty"` - - // Customer Name - // Min Length: 1 - CustomerName *string `json:"customerName,omitempty"` - - // delivery date - // Format: date-time - DeliveryDate *strfmt.DateTime `json:"deliveryDate,omitempty"` - - // destination postal code - DestinationPostalCode *string `json:"destinationPostalCode,omitempty"` - - // DOD ID - // Max Length: 10 - // Min Length: 10 - Edipi *string `json:"edipi,omitempty"` - - // EMPLID - // Max Length: 7 - // Min Length: 7 - Emplid *string `json:"emplid,omitempty"` - - // Move locator - // Max Length: 6 - // Min Length: 6 - Locator *string `json:"locator,omitempty"` - - // order - // Enum: [asc desc] - Order *string `json:"order,omitempty"` - - // origin postal code - OriginPostalCode *string `json:"originPostalCode,omitempty"` - - // requested page of results - Page int64 `json:"page,omitempty"` - - // payment request code - // Example: 9551-6199-2 - PaymentRequestCode *string `json:"paymentRequestCode,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // pickup date - // Format: date-time - PickupDate *strfmt.DateTime `json:"pickupDate,omitempty"` - - // shipments count - ShipmentsCount *int64 `json:"shipmentsCount,omitempty"` - - // sort - // Enum: [customerName edipi emplid branch locator status originPostalCode destinationPostalCode shipmentsCount] - Sort *string `json:"sort,omitempty"` - - // Filtering for the status. - // Unique: true - Status []string `json:"status"` -} - -// Validate validates this search moves body -func (o *SearchMovesBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCustomerName(formats); err != nil { - res = append(res, err) - } - - if err := o.validateDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := o.validateEmplid(formats); err != nil { - res = append(res, err) - } - - if err := o.validateLocator(formats); err != nil { - res = append(res, err) - } - - if err := o.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := o.validatePickupDate(formats); err != nil { - res = append(res, err) - } - - if err := o.validateSort(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SearchMovesBody) validateCustomerName(formats strfmt.Registry) error { - if swag.IsZero(o.CustomerName) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"customerName", "body", *o.CustomerName, 1); err != nil { - return err - } - - return nil -} - -func (o *SearchMovesBody) validateDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(o.DeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"deliveryDate", "body", "date-time", o.DeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (o *SearchMovesBody) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(o.Edipi) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { - return err - } - - return nil -} - -func (o *SearchMovesBody) validateEmplid(formats strfmt.Registry) error { - if swag.IsZero(o.Emplid) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { - return err - } - - if err := validate.MaxLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { - return err - } - - return nil -} - -func (o *SearchMovesBody) validateLocator(formats strfmt.Registry) error { - if swag.IsZero(o.Locator) { // not required - return nil - } - - if err := validate.MinLength("body"+"."+"locator", "body", *o.Locator, 6); err != nil { - return err - } - - if err := validate.MaxLength("body"+"."+"locator", "body", *o.Locator, 6); err != nil { - return err - } - - return nil -} - -var searchMovesBodyTypeOrderPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["asc","desc"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - searchMovesBodyTypeOrderPropEnum = append(searchMovesBodyTypeOrderPropEnum, v) - } -} - -const ( - - // SearchMovesBodyOrderAsc captures enum value "asc" - SearchMovesBodyOrderAsc string = "asc" - - // SearchMovesBodyOrderDesc captures enum value "desc" - SearchMovesBodyOrderDesc string = "desc" -) - -// prop value enum -func (o *SearchMovesBody) validateOrderEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, searchMovesBodyTypeOrderPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *SearchMovesBody) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(o.Order) { // not required - return nil - } - - // value enum - if err := o.validateOrderEnum("body"+"."+"order", "body", *o.Order); err != nil { - return err - } - - return nil -} - -func (o *SearchMovesBody) validatePickupDate(formats strfmt.Registry) error { - if swag.IsZero(o.PickupDate) { // not required - return nil - } - - if err := validate.FormatOf("body"+"."+"pickupDate", "body", "date-time", o.PickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -var searchMovesBodyTypeSortPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["customerName","edipi","emplid","branch","locator","status","originPostalCode","destinationPostalCode","shipmentsCount"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - searchMovesBodyTypeSortPropEnum = append(searchMovesBodyTypeSortPropEnum, v) - } -} - -const ( - - // SearchMovesBodySortCustomerName captures enum value "customerName" - SearchMovesBodySortCustomerName string = "customerName" - - // SearchMovesBodySortEdipi captures enum value "edipi" - SearchMovesBodySortEdipi string = "edipi" - - // SearchMovesBodySortEmplid captures enum value "emplid" - SearchMovesBodySortEmplid string = "emplid" - - // SearchMovesBodySortBranch captures enum value "branch" - SearchMovesBodySortBranch string = "branch" - - // SearchMovesBodySortLocator captures enum value "locator" - SearchMovesBodySortLocator string = "locator" - - // SearchMovesBodySortStatus captures enum value "status" - SearchMovesBodySortStatus string = "status" - - // SearchMovesBodySortOriginPostalCode captures enum value "originPostalCode" - SearchMovesBodySortOriginPostalCode string = "originPostalCode" - - // SearchMovesBodySortDestinationPostalCode captures enum value "destinationPostalCode" - SearchMovesBodySortDestinationPostalCode string = "destinationPostalCode" - - // SearchMovesBodySortShipmentsCount captures enum value "shipmentsCount" - SearchMovesBodySortShipmentsCount string = "shipmentsCount" -) - -// prop value enum -func (o *SearchMovesBody) validateSortEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, searchMovesBodyTypeSortPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *SearchMovesBody) validateSort(formats strfmt.Registry) error { - if swag.IsZero(o.Sort) { // not required - return nil - } - - // value enum - if err := o.validateSortEnum("body"+"."+"sort", "body", *o.Sort); err != nil { - return err - } - - return nil -} - -var searchMovesBodyStatusItemsEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVALS REQUESTED","APPROVED","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - searchMovesBodyStatusItemsEnum = append(searchMovesBodyStatusItemsEnum, v) - } -} - -func (o *SearchMovesBody) validateStatusItemsEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, searchMovesBodyStatusItemsEnum, true); err != nil { - return err - } - return nil -} - -func (o *SearchMovesBody) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(o.Status) { // not required - return nil - } - - if err := validate.UniqueItems("body"+"."+"status", "body", o.Status); err != nil { - return err - } - - for i := 0; i < len(o.Status); i++ { - - // value enum - if err := o.validateStatusItemsEnum("body"+"."+"status"+"."+strconv.Itoa(i), "body", o.Status[i]); err != nil { - return err - } - - } - - return nil -} - -// ContextValidate validates this search moves body based on context it is used -func (o *SearchMovesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SearchMovesBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SearchMovesBody) UnmarshalBinary(b []byte) error { - var res SearchMovesBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go deleted file mode 100644 index d35fba4a7a1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" -) - -// NewSearchMovesParams creates a new SearchMovesParams object -// -// There are no default values defined in the spec. -func NewSearchMovesParams() SearchMovesParams { - - return SearchMovesParams{} -} - -// SearchMovesParams contains all the bound params for the search moves operation -// typically these are obtained from a http.Request -// -// swagger:parameters searchMoves -type SearchMovesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*field that results should be sorted by - In: body - */ - Body SearchMovesBody -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSearchMovesParams() beforehand. -func (o *SearchMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body SearchMovesBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go deleted file mode 100644 index 28872076183..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// SearchMovesOKCode is the HTTP code returned for type SearchMovesOK -const SearchMovesOKCode int = 200 - -/* -SearchMovesOK Successfully returned all moves matching the criteria - -swagger:response searchMovesOK -*/ -type SearchMovesOK struct { - - /* - In: Body - */ - Payload *ghcmessages.SearchMovesResult `json:"body,omitempty"` -} - -// NewSearchMovesOK creates SearchMovesOK with default headers values -func NewSearchMovesOK() *SearchMovesOK { - - return &SearchMovesOK{} -} - -// WithPayload adds the payload to the search moves o k response -func (o *SearchMovesOK) WithPayload(payload *ghcmessages.SearchMovesResult) *SearchMovesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search moves o k response -func (o *SearchMovesOK) SetPayload(payload *ghcmessages.SearchMovesResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SearchMovesForbiddenCode is the HTTP code returned for type SearchMovesForbidden -const SearchMovesForbiddenCode int = 403 - -/* -SearchMovesForbidden The request was denied - -swagger:response searchMovesForbidden -*/ -type SearchMovesForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSearchMovesForbidden creates SearchMovesForbidden with default headers values -func NewSearchMovesForbidden() *SearchMovesForbidden { - - return &SearchMovesForbidden{} -} - -// WithPayload adds the payload to the search moves forbidden response -func (o *SearchMovesForbidden) WithPayload(payload *ghcmessages.Error) *SearchMovesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search moves forbidden response -func (o *SearchMovesForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SearchMovesInternalServerErrorCode is the HTTP code returned for type SearchMovesInternalServerError -const SearchMovesInternalServerErrorCode int = 500 - -/* -SearchMovesInternalServerError A server error occurred - -swagger:response searchMovesInternalServerError -*/ -type SearchMovesInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSearchMovesInternalServerError creates SearchMovesInternalServerError with default headers values -func NewSearchMovesInternalServerError() *SearchMovesInternalServerError { - - return &SearchMovesInternalServerError{} -} - -// WithPayload adds the payload to the search moves internal server error response -func (o *SearchMovesInternalServerError) WithPayload(payload *ghcmessages.Error) *SearchMovesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search moves internal server error response -func (o *SearchMovesInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go deleted file mode 100644 index 12f5b61885e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// SearchMovesURL generates an URL for the search moves operation -type SearchMovesURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchMovesURL) WithBasePath(bp string) *SearchMovesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchMovesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SearchMovesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/search" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SearchMovesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SearchMovesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SearchMovesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SearchMovesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SearchMovesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SearchMovesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go deleted file mode 100644 index 439a4363a7f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SetFinancialReviewFlagHandlerFunc turns a function with the right signature into a set financial review flag handler -type SetFinancialReviewFlagHandlerFunc func(SetFinancialReviewFlagParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SetFinancialReviewFlagHandlerFunc) Handle(params SetFinancialReviewFlagParams) middleware.Responder { - return fn(params) -} - -// SetFinancialReviewFlagHandler interface for that can handle valid set financial review flag params -type SetFinancialReviewFlagHandler interface { - Handle(SetFinancialReviewFlagParams) middleware.Responder -} - -// NewSetFinancialReviewFlag creates a new http.Handler for the set financial review flag operation -func NewSetFinancialReviewFlag(ctx *middleware.Context, handler SetFinancialReviewFlagHandler) *SetFinancialReviewFlag { - return &SetFinancialReviewFlag{Context: ctx, Handler: handler} -} - -/* - SetFinancialReviewFlag swagger:route POST /moves/{moveID}/financial-review-flag move setFinancialReviewFlag - -# Flags a move for financial office review - -This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer. -*/ -type SetFinancialReviewFlag struct { - Context *middleware.Context - Handler SetFinancialReviewFlagHandler -} - -func (o *SetFinancialReviewFlag) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSetFinancialReviewFlagParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// SetFinancialReviewFlagBody set financial review flag body -// -// swagger:model SetFinancialReviewFlagBody -type SetFinancialReviewFlagBody struct { - - // boolean value representing whether we should flag a move for financial review - // Example: false - // Required: true - FlagForReview *bool `json:"flagForReview"` - - // explanation of why the move is being flagged for financial review - // Example: this address is way too far away - Remarks *string `json:"remarks,omitempty"` -} - -// Validate validates this set financial review flag body -func (o *SetFinancialReviewFlagBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateFlagForReview(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *SetFinancialReviewFlagBody) validateFlagForReview(formats strfmt.Registry) error { - - if err := validate.Required("body"+"."+"flagForReview", "body", o.FlagForReview); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this set financial review flag body based on context it is used -func (o *SetFinancialReviewFlagBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *SetFinancialReviewFlagBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *SetFinancialReviewFlagBody) UnmarshalBinary(b []byte) error { - var res SetFinancialReviewFlagBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go deleted file mode 100644 index a3670952284..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewSetFinancialReviewFlagParams creates a new SetFinancialReviewFlagParams object -// -// There are no default values defined in the spec. -func NewSetFinancialReviewFlagParams() SetFinancialReviewFlagParams { - - return SetFinancialReviewFlagParams{} -} - -// SetFinancialReviewFlagParams contains all the bound params for the set financial review flag operation -// typically these are obtained from a http.Request -// -// swagger:parameters setFinancialReviewFlag -type SetFinancialReviewFlagParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: header - */ - IfMatch *string - /* - In: body - */ - Body SetFinancialReviewFlagBody - /*ID of move to flag - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSetFinancialReviewFlagParams() beforehand. -func (o *SetFinancialReviewFlagParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body SetFinancialReviewFlagBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *SetFinancialReviewFlagParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.IfMatch = &raw - - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *SetFinancialReviewFlagParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *SetFinancialReviewFlagParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go deleted file mode 100644 index 376131d716a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// SetFinancialReviewFlagOKCode is the HTTP code returned for type SetFinancialReviewFlagOK -const SetFinancialReviewFlagOKCode int = 200 - -/* -SetFinancialReviewFlagOK updated Move - -swagger:response setFinancialReviewFlagOK -*/ -type SetFinancialReviewFlagOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagOK creates SetFinancialReviewFlagOK with default headers values -func NewSetFinancialReviewFlagOK() *SetFinancialReviewFlagOK { - - return &SetFinancialReviewFlagOK{} -} - -// WithPayload adds the payload to the set financial review flag o k response -func (o *SetFinancialReviewFlagOK) WithPayload(payload *ghcmessages.Move) *SetFinancialReviewFlagOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag o k response -func (o *SetFinancialReviewFlagOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SetFinancialReviewFlagForbiddenCode is the HTTP code returned for type SetFinancialReviewFlagForbidden -const SetFinancialReviewFlagForbiddenCode int = 403 - -/* -SetFinancialReviewFlagForbidden The request was denied - -swagger:response setFinancialReviewFlagForbidden -*/ -type SetFinancialReviewFlagForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagForbidden creates SetFinancialReviewFlagForbidden with default headers values -func NewSetFinancialReviewFlagForbidden() *SetFinancialReviewFlagForbidden { - - return &SetFinancialReviewFlagForbidden{} -} - -// WithPayload adds the payload to the set financial review flag forbidden response -func (o *SetFinancialReviewFlagForbidden) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag forbidden response -func (o *SetFinancialReviewFlagForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SetFinancialReviewFlagNotFoundCode is the HTTP code returned for type SetFinancialReviewFlagNotFound -const SetFinancialReviewFlagNotFoundCode int = 404 - -/* -SetFinancialReviewFlagNotFound The requested resource wasn't found - -swagger:response setFinancialReviewFlagNotFound -*/ -type SetFinancialReviewFlagNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagNotFound creates SetFinancialReviewFlagNotFound with default headers values -func NewSetFinancialReviewFlagNotFound() *SetFinancialReviewFlagNotFound { - - return &SetFinancialReviewFlagNotFound{} -} - -// WithPayload adds the payload to the set financial review flag not found response -func (o *SetFinancialReviewFlagNotFound) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag not found response -func (o *SetFinancialReviewFlagNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SetFinancialReviewFlagPreconditionFailedCode is the HTTP code returned for type SetFinancialReviewFlagPreconditionFailed -const SetFinancialReviewFlagPreconditionFailedCode int = 412 - -/* -SetFinancialReviewFlagPreconditionFailed Precondition failed - -swagger:response setFinancialReviewFlagPreconditionFailed -*/ -type SetFinancialReviewFlagPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagPreconditionFailed creates SetFinancialReviewFlagPreconditionFailed with default headers values -func NewSetFinancialReviewFlagPreconditionFailed() *SetFinancialReviewFlagPreconditionFailed { - - return &SetFinancialReviewFlagPreconditionFailed{} -} - -// WithPayload adds the payload to the set financial review flag precondition failed response -func (o *SetFinancialReviewFlagPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag precondition failed response -func (o *SetFinancialReviewFlagPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SetFinancialReviewFlagUnprocessableEntityCode is the HTTP code returned for type SetFinancialReviewFlagUnprocessableEntity -const SetFinancialReviewFlagUnprocessableEntityCode int = 422 - -/* -SetFinancialReviewFlagUnprocessableEntity The payload was unprocessable. - -swagger:response setFinancialReviewFlagUnprocessableEntity -*/ -type SetFinancialReviewFlagUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagUnprocessableEntity creates SetFinancialReviewFlagUnprocessableEntity with default headers values -func NewSetFinancialReviewFlagUnprocessableEntity() *SetFinancialReviewFlagUnprocessableEntity { - - return &SetFinancialReviewFlagUnprocessableEntity{} -} - -// WithPayload adds the payload to the set financial review flag unprocessable entity response -func (o *SetFinancialReviewFlagUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SetFinancialReviewFlagUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag unprocessable entity response -func (o *SetFinancialReviewFlagUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SetFinancialReviewFlagInternalServerErrorCode is the HTTP code returned for type SetFinancialReviewFlagInternalServerError -const SetFinancialReviewFlagInternalServerErrorCode int = 500 - -/* -SetFinancialReviewFlagInternalServerError A server error occurred - -swagger:response setFinancialReviewFlagInternalServerError -*/ -type SetFinancialReviewFlagInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewSetFinancialReviewFlagInternalServerError creates SetFinancialReviewFlagInternalServerError with default headers values -func NewSetFinancialReviewFlagInternalServerError() *SetFinancialReviewFlagInternalServerError { - - return &SetFinancialReviewFlagInternalServerError{} -} - -// WithPayload adds the payload to the set financial review flag internal server error response -func (o *SetFinancialReviewFlagInternalServerError) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the set financial review flag internal server error response -func (o *SetFinancialReviewFlagInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SetFinancialReviewFlagInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go deleted file mode 100644 index 059b54a60fb..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SetFinancialReviewFlagURL generates an URL for the set financial review flag operation -type SetFinancialReviewFlagURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SetFinancialReviewFlagURL) WithBasePath(bp string) *SetFinancialReviewFlagURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SetFinancialReviewFlagURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SetFinancialReviewFlagURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/financial-review-flag" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on SetFinancialReviewFlagURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SetFinancialReviewFlagURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SetFinancialReviewFlagURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SetFinancialReviewFlagURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SetFinancialReviewFlagURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SetFinancialReviewFlagURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SetFinancialReviewFlagURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go deleted file mode 100644 index 3f827a7c2ec..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateAssignedOfficeUserHandlerFunc turns a function with the right signature into a update assigned office user handler -type UpdateAssignedOfficeUserHandlerFunc func(UpdateAssignedOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateAssignedOfficeUserHandlerFunc) Handle(params UpdateAssignedOfficeUserParams) middleware.Responder { - return fn(params) -} - -// UpdateAssignedOfficeUserHandler interface for that can handle valid update assigned office user params -type UpdateAssignedOfficeUserHandler interface { - Handle(UpdateAssignedOfficeUserParams) middleware.Responder -} - -// NewUpdateAssignedOfficeUser creates a new http.Handler for the update assigned office user operation -func NewUpdateAssignedOfficeUser(ctx *middleware.Context, handler UpdateAssignedOfficeUserHandler) *UpdateAssignedOfficeUser { - return &UpdateAssignedOfficeUser{Context: ctx, Handler: handler} -} - -/* - UpdateAssignedOfficeUser swagger:route PATCH /moves/{moveID}/assignOfficeUser move updateAssignedOfficeUser - -assigns either a services counselor, task ordering officer, or task invoicing officer to the move -*/ -type UpdateAssignedOfficeUser struct { - Context *middleware.Context - Handler UpdateAssignedOfficeUserHandler -} - -func (o *UpdateAssignedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateAssignedOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go deleted file mode 100644 index 547d76b97ae..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateAssignedOfficeUserParams creates a new UpdateAssignedOfficeUserParams object -// -// There are no default values defined in the spec. -func NewUpdateAssignedOfficeUserParams() UpdateAssignedOfficeUserParams { - - return UpdateAssignedOfficeUserParams{} -} - -// UpdateAssignedOfficeUserParams contains all the bound params for the update assigned office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateAssignedOfficeUser -type UpdateAssignedOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *ghcmessages.AssignOfficeUserBody - /*ID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateAssignedOfficeUserParams() beforehand. -func (o *UpdateAssignedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.AssignOfficeUserBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *UpdateAssignedOfficeUserParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *UpdateAssignedOfficeUserParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go deleted file mode 100644 index d31443bdb2a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateAssignedOfficeUserOKCode is the HTTP code returned for type UpdateAssignedOfficeUserOK -const UpdateAssignedOfficeUserOKCode int = 200 - -/* -UpdateAssignedOfficeUserOK Successfully assigned office user to the move - -swagger:response updateAssignedOfficeUserOK -*/ -type UpdateAssignedOfficeUserOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateAssignedOfficeUserOK creates UpdateAssignedOfficeUserOK with default headers values -func NewUpdateAssignedOfficeUserOK() *UpdateAssignedOfficeUserOK { - - return &UpdateAssignedOfficeUserOK{} -} - -// WithPayload adds the payload to the update assigned office user o k response -func (o *UpdateAssignedOfficeUserOK) WithPayload(payload *ghcmessages.Move) *UpdateAssignedOfficeUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update assigned office user o k response -func (o *UpdateAssignedOfficeUserOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAssignedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAssignedOfficeUserNotFoundCode is the HTTP code returned for type UpdateAssignedOfficeUserNotFound -const UpdateAssignedOfficeUserNotFoundCode int = 404 - -/* -UpdateAssignedOfficeUserNotFound The requested resource wasn't found - -swagger:response updateAssignedOfficeUserNotFound -*/ -type UpdateAssignedOfficeUserNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAssignedOfficeUserNotFound creates UpdateAssignedOfficeUserNotFound with default headers values -func NewUpdateAssignedOfficeUserNotFound() *UpdateAssignedOfficeUserNotFound { - - return &UpdateAssignedOfficeUserNotFound{} -} - -// WithPayload adds the payload to the update assigned office user not found response -func (o *UpdateAssignedOfficeUserNotFound) WithPayload(payload *ghcmessages.Error) *UpdateAssignedOfficeUserNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update assigned office user not found response -func (o *UpdateAssignedOfficeUserNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAssignedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAssignedOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateAssignedOfficeUserInternalServerError -const UpdateAssignedOfficeUserInternalServerErrorCode int = 500 - -/* -UpdateAssignedOfficeUserInternalServerError A server error occurred - -swagger:response updateAssignedOfficeUserInternalServerError -*/ -type UpdateAssignedOfficeUserInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAssignedOfficeUserInternalServerError creates UpdateAssignedOfficeUserInternalServerError with default headers values -func NewUpdateAssignedOfficeUserInternalServerError() *UpdateAssignedOfficeUserInternalServerError { - - return &UpdateAssignedOfficeUserInternalServerError{} -} - -// WithPayload adds the payload to the update assigned office user internal server error response -func (o *UpdateAssignedOfficeUserInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateAssignedOfficeUserInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update assigned office user internal server error response -func (o *UpdateAssignedOfficeUserInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAssignedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go deleted file mode 100644 index d02a2ed7909..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateAssignedOfficeUserURL generates an URL for the update assigned office user operation -type UpdateAssignedOfficeUserURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAssignedOfficeUserURL) WithBasePath(bp string) *UpdateAssignedOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAssignedOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateAssignedOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/assignOfficeUser" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on UpdateAssignedOfficeUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateAssignedOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateAssignedOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateAssignedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateAssignedOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateAssignedOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateAssignedOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go deleted file mode 100644 index f1aaf468b38..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateCloseoutOfficeHandlerFunc turns a function with the right signature into a update closeout office handler -type UpdateCloseoutOfficeHandlerFunc func(UpdateCloseoutOfficeParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateCloseoutOfficeHandlerFunc) Handle(params UpdateCloseoutOfficeParams) middleware.Responder { - return fn(params) -} - -// UpdateCloseoutOfficeHandler interface for that can handle valid update closeout office params -type UpdateCloseoutOfficeHandler interface { - Handle(UpdateCloseoutOfficeParams) middleware.Responder -} - -// NewUpdateCloseoutOffice creates a new http.Handler for the update closeout office operation -func NewUpdateCloseoutOffice(ctx *middleware.Context, handler UpdateCloseoutOfficeHandler) *UpdateCloseoutOffice { - return &UpdateCloseoutOffice{Context: ctx, Handler: handler} -} - -/* - UpdateCloseoutOffice swagger:route PATCH /moves/{locator}/closeout-office move updateCloseoutOffice - -# Updates a Move's PPM closeout office for Army and Air Force customers - -Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by -*/ -type UpdateCloseoutOffice struct { - Context *middleware.Context - Handler UpdateCloseoutOfficeHandler -} - -func (o *UpdateCloseoutOffice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateCloseoutOfficeParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// UpdateCloseoutOfficeBody update closeout office body -// -// swagger:model UpdateCloseoutOfficeBody -type UpdateCloseoutOfficeBody struct { - - // closeout office Id - // Required: true - // Format: uuid - CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId"` -} - -// Validate validates this update closeout office body -func (o *UpdateCloseoutOfficeBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateCloseoutOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateCloseoutOfficeBody) validateCloseoutOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("body"+"."+"closeoutOfficeId", "body", o.CloseoutOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("body"+"."+"closeoutOfficeId", "body", "uuid", o.CloseoutOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update closeout office body based on context it is used -func (o *UpdateCloseoutOfficeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateCloseoutOfficeBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateCloseoutOfficeBody) UnmarshalBinary(b []byte) error { - var res UpdateCloseoutOfficeBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go deleted file mode 100644 index 59f62355a51..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateCloseoutOfficeParams creates a new UpdateCloseoutOfficeParams object -// -// There are no default values defined in the spec. -func NewUpdateCloseoutOfficeParams() UpdateCloseoutOfficeParams { - - return UpdateCloseoutOfficeParams{} -} - -// UpdateCloseoutOfficeParams contains all the bound params for the update closeout office operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateCloseoutOffice -type UpdateCloseoutOfficeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - In: body - */ - Body UpdateCloseoutOfficeBody - /*move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateCloseoutOfficeParams() beforehand. -func (o *UpdateCloseoutOfficeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body UpdateCloseoutOfficeBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateCloseoutOfficeParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *UpdateCloseoutOfficeParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go deleted file mode 100644 index 395068d5017..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateCloseoutOfficeOKCode is the HTTP code returned for type UpdateCloseoutOfficeOK -const UpdateCloseoutOfficeOKCode int = 200 - -/* -UpdateCloseoutOfficeOK Successfully set the closeout office for the move - -swagger:response updateCloseoutOfficeOK -*/ -type UpdateCloseoutOfficeOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeOK creates UpdateCloseoutOfficeOK with default headers values -func NewUpdateCloseoutOfficeOK() *UpdateCloseoutOfficeOK { - - return &UpdateCloseoutOfficeOK{} -} - -// WithPayload adds the payload to the update closeout office o k response -func (o *UpdateCloseoutOfficeOK) WithPayload(payload *ghcmessages.Move) *UpdateCloseoutOfficeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office o k response -func (o *UpdateCloseoutOfficeOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeBadRequestCode is the HTTP code returned for type UpdateCloseoutOfficeBadRequest -const UpdateCloseoutOfficeBadRequestCode int = 400 - -/* -UpdateCloseoutOfficeBadRequest The request payload is invalid - -swagger:response updateCloseoutOfficeBadRequest -*/ -type UpdateCloseoutOfficeBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeBadRequest creates UpdateCloseoutOfficeBadRequest with default headers values -func NewUpdateCloseoutOfficeBadRequest() *UpdateCloseoutOfficeBadRequest { - - return &UpdateCloseoutOfficeBadRequest{} -} - -// WithPayload adds the payload to the update closeout office bad request response -func (o *UpdateCloseoutOfficeBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office bad request response -func (o *UpdateCloseoutOfficeBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeUnauthorizedCode is the HTTP code returned for type UpdateCloseoutOfficeUnauthorized -const UpdateCloseoutOfficeUnauthorizedCode int = 401 - -/* -UpdateCloseoutOfficeUnauthorized The request was denied - -swagger:response updateCloseoutOfficeUnauthorized -*/ -type UpdateCloseoutOfficeUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeUnauthorized creates UpdateCloseoutOfficeUnauthorized with default headers values -func NewUpdateCloseoutOfficeUnauthorized() *UpdateCloseoutOfficeUnauthorized { - - return &UpdateCloseoutOfficeUnauthorized{} -} - -// WithPayload adds the payload to the update closeout office unauthorized response -func (o *UpdateCloseoutOfficeUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office unauthorized response -func (o *UpdateCloseoutOfficeUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeForbiddenCode is the HTTP code returned for type UpdateCloseoutOfficeForbidden -const UpdateCloseoutOfficeForbiddenCode int = 403 - -/* -UpdateCloseoutOfficeForbidden The request was denied - -swagger:response updateCloseoutOfficeForbidden -*/ -type UpdateCloseoutOfficeForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeForbidden creates UpdateCloseoutOfficeForbidden with default headers values -func NewUpdateCloseoutOfficeForbidden() *UpdateCloseoutOfficeForbidden { - - return &UpdateCloseoutOfficeForbidden{} -} - -// WithPayload adds the payload to the update closeout office forbidden response -func (o *UpdateCloseoutOfficeForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office forbidden response -func (o *UpdateCloseoutOfficeForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeNotFoundCode is the HTTP code returned for type UpdateCloseoutOfficeNotFound -const UpdateCloseoutOfficeNotFoundCode int = 404 - -/* -UpdateCloseoutOfficeNotFound The requested resource wasn't found - -swagger:response updateCloseoutOfficeNotFound -*/ -type UpdateCloseoutOfficeNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeNotFound creates UpdateCloseoutOfficeNotFound with default headers values -func NewUpdateCloseoutOfficeNotFound() *UpdateCloseoutOfficeNotFound { - - return &UpdateCloseoutOfficeNotFound{} -} - -// WithPayload adds the payload to the update closeout office not found response -func (o *UpdateCloseoutOfficeNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office not found response -func (o *UpdateCloseoutOfficeNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficePreconditionFailedCode is the HTTP code returned for type UpdateCloseoutOfficePreconditionFailed -const UpdateCloseoutOfficePreconditionFailedCode int = 412 - -/* -UpdateCloseoutOfficePreconditionFailed Precondition failed - -swagger:response updateCloseoutOfficePreconditionFailed -*/ -type UpdateCloseoutOfficePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficePreconditionFailed creates UpdateCloseoutOfficePreconditionFailed with default headers values -func NewUpdateCloseoutOfficePreconditionFailed() *UpdateCloseoutOfficePreconditionFailed { - - return &UpdateCloseoutOfficePreconditionFailed{} -} - -// WithPayload adds the payload to the update closeout office precondition failed response -func (o *UpdateCloseoutOfficePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office precondition failed response -func (o *UpdateCloseoutOfficePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeUnprocessableEntityCode is the HTTP code returned for type UpdateCloseoutOfficeUnprocessableEntity -const UpdateCloseoutOfficeUnprocessableEntityCode int = 422 - -/* -UpdateCloseoutOfficeUnprocessableEntity The payload was unprocessable. - -swagger:response updateCloseoutOfficeUnprocessableEntity -*/ -type UpdateCloseoutOfficeUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeUnprocessableEntity creates UpdateCloseoutOfficeUnprocessableEntity with default headers values -func NewUpdateCloseoutOfficeUnprocessableEntity() *UpdateCloseoutOfficeUnprocessableEntity { - - return &UpdateCloseoutOfficeUnprocessableEntity{} -} - -// WithPayload adds the payload to the update closeout office unprocessable entity response -func (o *UpdateCloseoutOfficeUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCloseoutOfficeUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office unprocessable entity response -func (o *UpdateCloseoutOfficeUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateCloseoutOfficeInternalServerErrorCode is the HTTP code returned for type UpdateCloseoutOfficeInternalServerError -const UpdateCloseoutOfficeInternalServerErrorCode int = 500 - -/* -UpdateCloseoutOfficeInternalServerError A server error occurred - -swagger:response updateCloseoutOfficeInternalServerError -*/ -type UpdateCloseoutOfficeInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateCloseoutOfficeInternalServerError creates UpdateCloseoutOfficeInternalServerError with default headers values -func NewUpdateCloseoutOfficeInternalServerError() *UpdateCloseoutOfficeInternalServerError { - - return &UpdateCloseoutOfficeInternalServerError{} -} - -// WithPayload adds the payload to the update closeout office internal server error response -func (o *UpdateCloseoutOfficeInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update closeout office internal server error response -func (o *UpdateCloseoutOfficeInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateCloseoutOfficeInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go deleted file mode 100644 index 6eb86b3b52c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateCloseoutOfficeURL generates an URL for the update closeout office operation -type UpdateCloseoutOfficeURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCloseoutOfficeURL) WithBasePath(bp string) *UpdateCloseoutOfficeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateCloseoutOfficeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateCloseoutOfficeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/closeout-office" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on UpdateCloseoutOfficeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateCloseoutOfficeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateCloseoutOfficeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateCloseoutOfficeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateCloseoutOfficeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateCloseoutOfficeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateCloseoutOfficeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go deleted file mode 100644 index a7c0aa3fe88..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UploadAdditionalDocumentsHandlerFunc turns a function with the right signature into a upload additional documents handler -type UploadAdditionalDocumentsHandlerFunc func(UploadAdditionalDocumentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UploadAdditionalDocumentsHandlerFunc) Handle(params UploadAdditionalDocumentsParams) middleware.Responder { - return fn(params) -} - -// UploadAdditionalDocumentsHandler interface for that can handle valid upload additional documents params -type UploadAdditionalDocumentsHandler interface { - Handle(UploadAdditionalDocumentsParams) middleware.Responder -} - -// NewUploadAdditionalDocuments creates a new http.Handler for the upload additional documents operation -func NewUploadAdditionalDocuments(ctx *middleware.Context, handler UploadAdditionalDocumentsHandler) *UploadAdditionalDocuments { - return &UploadAdditionalDocuments{Context: ctx, Handler: handler} -} - -/* - UploadAdditionalDocuments swagger:route PATCH /moves/{moveID}/uploadAdditionalDocuments move uploadAdditionalDocuments - -# Patch the additional documents for a given move - -Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order. -*/ -type UploadAdditionalDocuments struct { - Context *middleware.Context - Handler UploadAdditionalDocumentsHandler -} - -func (o *UploadAdditionalDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUploadAdditionalDocumentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go deleted file mode 100644 index e8f75a2842f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UploadAdditionalDocumentsMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var UploadAdditionalDocumentsMaxParseMemory int64 = 32 << 20 - -// NewUploadAdditionalDocumentsParams creates a new UploadAdditionalDocumentsParams object -// -// There are no default values defined in the spec. -func NewUploadAdditionalDocumentsParams() UploadAdditionalDocumentsParams { - - return UploadAdditionalDocumentsParams{} -} - -// UploadAdditionalDocumentsParams contains all the bound params for the upload additional documents operation -// typically these are obtained from a http.Request -// -// swagger:parameters uploadAdditionalDocuments -type UploadAdditionalDocumentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the order - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUploadAdditionalDocumentsParams() beforehand. -func (o *UploadAdditionalDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(UploadAdditionalDocumentsMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *UploadAdditionalDocumentsParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *UploadAdditionalDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *UploadAdditionalDocumentsParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go deleted file mode 100644 index f2fb00f0516..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UploadAdditionalDocumentsCreatedCode is the HTTP code returned for type UploadAdditionalDocumentsCreated -const UploadAdditionalDocumentsCreatedCode int = 201 - -/* -UploadAdditionalDocumentsCreated created upload - -swagger:response uploadAdditionalDocumentsCreated -*/ -type UploadAdditionalDocumentsCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.Upload `json:"body,omitempty"` -} - -// NewUploadAdditionalDocumentsCreated creates UploadAdditionalDocumentsCreated with default headers values -func NewUploadAdditionalDocumentsCreated() *UploadAdditionalDocumentsCreated { - - return &UploadAdditionalDocumentsCreated{} -} - -// WithPayload adds the payload to the upload additional documents created response -func (o *UploadAdditionalDocumentsCreated) WithPayload(payload *ghcmessages.Upload) *UploadAdditionalDocumentsCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload additional documents created response -func (o *UploadAdditionalDocumentsCreated) SetPayload(payload *ghcmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAdditionalDocumentsBadRequestCode is the HTTP code returned for type UploadAdditionalDocumentsBadRequest -const UploadAdditionalDocumentsBadRequestCode int = 400 - -/* -UploadAdditionalDocumentsBadRequest invalid request - -swagger:response uploadAdditionalDocumentsBadRequest -*/ -type UploadAdditionalDocumentsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewUploadAdditionalDocumentsBadRequest creates UploadAdditionalDocumentsBadRequest with default headers values -func NewUploadAdditionalDocumentsBadRequest() *UploadAdditionalDocumentsBadRequest { - - return &UploadAdditionalDocumentsBadRequest{} -} - -// WithPayload adds the payload to the upload additional documents bad request response -func (o *UploadAdditionalDocumentsBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *UploadAdditionalDocumentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload additional documents bad request response -func (o *UploadAdditionalDocumentsBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAdditionalDocumentsForbiddenCode is the HTTP code returned for type UploadAdditionalDocumentsForbidden -const UploadAdditionalDocumentsForbiddenCode int = 403 - -/* -UploadAdditionalDocumentsForbidden not authorized - -swagger:response uploadAdditionalDocumentsForbidden -*/ -type UploadAdditionalDocumentsForbidden struct { -} - -// NewUploadAdditionalDocumentsForbidden creates UploadAdditionalDocumentsForbidden with default headers values -func NewUploadAdditionalDocumentsForbidden() *UploadAdditionalDocumentsForbidden { - - return &UploadAdditionalDocumentsForbidden{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UploadAdditionalDocumentsNotFoundCode is the HTTP code returned for type UploadAdditionalDocumentsNotFound -const UploadAdditionalDocumentsNotFoundCode int = 404 - -/* -UploadAdditionalDocumentsNotFound not found - -swagger:response uploadAdditionalDocumentsNotFound -*/ -type UploadAdditionalDocumentsNotFound struct { -} - -// NewUploadAdditionalDocumentsNotFound creates UploadAdditionalDocumentsNotFound with default headers values -func NewUploadAdditionalDocumentsNotFound() *UploadAdditionalDocumentsNotFound { - - return &UploadAdditionalDocumentsNotFound{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UploadAdditionalDocumentsRequestEntityTooLargeCode is the HTTP code returned for type UploadAdditionalDocumentsRequestEntityTooLarge -const UploadAdditionalDocumentsRequestEntityTooLargeCode int = 413 - -/* -UploadAdditionalDocumentsRequestEntityTooLarge payload is too large - -swagger:response uploadAdditionalDocumentsRequestEntityTooLarge -*/ -type UploadAdditionalDocumentsRequestEntityTooLarge struct { -} - -// NewUploadAdditionalDocumentsRequestEntityTooLarge creates UploadAdditionalDocumentsRequestEntityTooLarge with default headers values -func NewUploadAdditionalDocumentsRequestEntityTooLarge() *UploadAdditionalDocumentsRequestEntityTooLarge { - - return &UploadAdditionalDocumentsRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// UploadAdditionalDocumentsInternalServerErrorCode is the HTTP code returned for type UploadAdditionalDocumentsInternalServerError -const UploadAdditionalDocumentsInternalServerErrorCode int = 500 - -/* -UploadAdditionalDocumentsInternalServerError server error - -swagger:response uploadAdditionalDocumentsInternalServerError -*/ -type UploadAdditionalDocumentsInternalServerError struct { -} - -// NewUploadAdditionalDocumentsInternalServerError creates UploadAdditionalDocumentsInternalServerError with default headers values -func NewUploadAdditionalDocumentsInternalServerError() *UploadAdditionalDocumentsInternalServerError { - - return &UploadAdditionalDocumentsInternalServerError{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go deleted file mode 100644 index 9cc82a6b383..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UploadAdditionalDocumentsURL generates an URL for the upload additional documents operation -type UploadAdditionalDocumentsURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAdditionalDocumentsURL) WithBasePath(bp string) *UploadAdditionalDocumentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAdditionalDocumentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UploadAdditionalDocumentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveID}/uploadAdditionalDocuments" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on UploadAdditionalDocumentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UploadAdditionalDocumentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UploadAdditionalDocumentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UploadAdditionalDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UploadAdditionalDocumentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UploadAdditionalDocumentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UploadAdditionalDocumentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go deleted file mode 100644 index aaefe95f783..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetEntitlementsHandlerFunc turns a function with the right signature into a get entitlements handler -type GetEntitlementsHandlerFunc func(GetEntitlementsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetEntitlementsHandlerFunc) Handle(params GetEntitlementsParams) middleware.Responder { - return fn(params) -} - -// GetEntitlementsHandler interface for that can handle valid get entitlements params -type GetEntitlementsHandler interface { - Handle(GetEntitlementsParams) middleware.Responder -} - -// NewGetEntitlements creates a new http.Handler for the get entitlements operation -func NewGetEntitlements(ctx *middleware.Context, handler GetEntitlementsHandler) *GetEntitlements { - return &GetEntitlements{Context: ctx, Handler: handler} -} - -/* - GetEntitlements swagger:route GET /move-task-orders/{moveTaskOrderID}/entitlements moveTaskOrder getEntitlements - -# Gets entitlements for a move by ID - -Gets entitlements -*/ -type GetEntitlements struct { - Context *middleware.Context - Handler GetEntitlementsHandler -} - -func (o *GetEntitlements) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetEntitlementsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go deleted file mode 100644 index 54b54a09fd4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetEntitlementsParams creates a new GetEntitlementsParams object -// -// There are no default values defined in the spec. -func NewGetEntitlementsParams() GetEntitlementsParams { - - return GetEntitlementsParams{} -} - -// GetEntitlementsParams contains all the bound params for the get entitlements operation -// typically these are obtained from a http.Request -// -// swagger:parameters getEntitlements -type GetEntitlementsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetEntitlementsParams() beforehand. -func (o *GetEntitlementsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *GetEntitlementsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go deleted file mode 100644 index 42973fea3e1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetEntitlementsOKCode is the HTTP code returned for type GetEntitlementsOK -const GetEntitlementsOKCode int = 200 - -/* -GetEntitlementsOK Successfully retrieved entitlements - -swagger:response getEntitlementsOK -*/ -type GetEntitlementsOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Entitlements `json:"body,omitempty"` -} - -// NewGetEntitlementsOK creates GetEntitlementsOK with default headers values -func NewGetEntitlementsOK() *GetEntitlementsOK { - - return &GetEntitlementsOK{} -} - -// WithPayload adds the payload to the get entitlements o k response -func (o *GetEntitlementsOK) WithPayload(payload *ghcmessages.Entitlements) *GetEntitlementsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements o k response -func (o *GetEntitlementsOK) SetPayload(payload *ghcmessages.Entitlements) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEntitlementsBadRequestCode is the HTTP code returned for type GetEntitlementsBadRequest -const GetEntitlementsBadRequestCode int = 400 - -/* -GetEntitlementsBadRequest The request payload is invalid - -swagger:response getEntitlementsBadRequest -*/ -type GetEntitlementsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEntitlementsBadRequest creates GetEntitlementsBadRequest with default headers values -func NewGetEntitlementsBadRequest() *GetEntitlementsBadRequest { - - return &GetEntitlementsBadRequest{} -} - -// WithPayload adds the payload to the get entitlements bad request response -func (o *GetEntitlementsBadRequest) WithPayload(payload *ghcmessages.Error) *GetEntitlementsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements bad request response -func (o *GetEntitlementsBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEntitlementsUnauthorizedCode is the HTTP code returned for type GetEntitlementsUnauthorized -const GetEntitlementsUnauthorizedCode int = 401 - -/* -GetEntitlementsUnauthorized The request was denied - -swagger:response getEntitlementsUnauthorized -*/ -type GetEntitlementsUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEntitlementsUnauthorized creates GetEntitlementsUnauthorized with default headers values -func NewGetEntitlementsUnauthorized() *GetEntitlementsUnauthorized { - - return &GetEntitlementsUnauthorized{} -} - -// WithPayload adds the payload to the get entitlements unauthorized response -func (o *GetEntitlementsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetEntitlementsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements unauthorized response -func (o *GetEntitlementsUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEntitlementsForbiddenCode is the HTTP code returned for type GetEntitlementsForbidden -const GetEntitlementsForbiddenCode int = 403 - -/* -GetEntitlementsForbidden The request was denied - -swagger:response getEntitlementsForbidden -*/ -type GetEntitlementsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEntitlementsForbidden creates GetEntitlementsForbidden with default headers values -func NewGetEntitlementsForbidden() *GetEntitlementsForbidden { - - return &GetEntitlementsForbidden{} -} - -// WithPayload adds the payload to the get entitlements forbidden response -func (o *GetEntitlementsForbidden) WithPayload(payload *ghcmessages.Error) *GetEntitlementsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements forbidden response -func (o *GetEntitlementsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEntitlementsNotFoundCode is the HTTP code returned for type GetEntitlementsNotFound -const GetEntitlementsNotFoundCode int = 404 - -/* -GetEntitlementsNotFound The requested resource wasn't found - -swagger:response getEntitlementsNotFound -*/ -type GetEntitlementsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEntitlementsNotFound creates GetEntitlementsNotFound with default headers values -func NewGetEntitlementsNotFound() *GetEntitlementsNotFound { - - return &GetEntitlementsNotFound{} -} - -// WithPayload adds the payload to the get entitlements not found response -func (o *GetEntitlementsNotFound) WithPayload(payload *ghcmessages.Error) *GetEntitlementsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements not found response -func (o *GetEntitlementsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetEntitlementsInternalServerErrorCode is the HTTP code returned for type GetEntitlementsInternalServerError -const GetEntitlementsInternalServerErrorCode int = 500 - -/* -GetEntitlementsInternalServerError A server error occurred - -swagger:response getEntitlementsInternalServerError -*/ -type GetEntitlementsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetEntitlementsInternalServerError creates GetEntitlementsInternalServerError with default headers values -func NewGetEntitlementsInternalServerError() *GetEntitlementsInternalServerError { - - return &GetEntitlementsInternalServerError{} -} - -// WithPayload adds the payload to the get entitlements internal server error response -func (o *GetEntitlementsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetEntitlementsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get entitlements internal server error response -func (o *GetEntitlementsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetEntitlementsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go deleted file mode 100644 index 7ec7e8326d4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetEntitlementsURL generates an URL for the get entitlements operation -type GetEntitlementsURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEntitlementsURL) WithBasePath(bp string) *GetEntitlementsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetEntitlementsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetEntitlementsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/entitlements" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on GetEntitlementsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetEntitlementsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetEntitlementsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetEntitlementsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetEntitlementsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetEntitlementsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetEntitlementsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go deleted file mode 100644 index fa196585950..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler -type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// GetMoveTaskOrderHandler interface for that can handle valid get move task order params -type GetMoveTaskOrderHandler interface { - Handle(GetMoveTaskOrderParams) middleware.Responder -} - -// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation -func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { - return &GetMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - GetMoveTaskOrder swagger:route GET /move-task-orders/{moveTaskOrderID} moveTaskOrder getMoveTaskOrder - -# Gets a move by ID - -Gets a move -*/ -type GetMoveTaskOrder struct { - Context *middleware.Context - Handler GetMoveTaskOrderHandler -} - -func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index a33864f5180..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { - - return GetMoveTaskOrderParams{} -} - -// GetMoveTaskOrderParams contains all the bound params for the get move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveTaskOrder -type GetMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. -func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *GetMoveTaskOrderParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index aa9cd10b67e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK -const GetMoveTaskOrderOKCode int = 200 - -/* -GetMoveTaskOrderOK Successfully retrieved move task order - -swagger:response getMoveTaskOrderOK -*/ -type GetMoveTaskOrderOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - - return &GetMoveTaskOrderOK{} -} - -// WithPayload adds the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) WithPayload(payload *ghcmessages.MoveTaskOrder) *GetMoveTaskOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) SetPayload(payload *ghcmessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderBadRequestCode is the HTTP code returned for type GetMoveTaskOrderBadRequest -const GetMoveTaskOrderBadRequestCode int = 400 - -/* -GetMoveTaskOrderBadRequest The request payload is invalid - -swagger:response getMoveTaskOrderBadRequest -*/ -type GetMoveTaskOrderBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderBadRequest creates GetMoveTaskOrderBadRequest with default headers values -func NewGetMoveTaskOrderBadRequest() *GetMoveTaskOrderBadRequest { - - return &GetMoveTaskOrderBadRequest{} -} - -// WithPayload adds the payload to the get move task order bad request response -func (o *GetMoveTaskOrderBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order bad request response -func (o *GetMoveTaskOrderBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized -const GetMoveTaskOrderUnauthorizedCode int = 401 - -/* -GetMoveTaskOrderUnauthorized The request was denied - -swagger:response getMoveTaskOrderUnauthorized -*/ -type GetMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - - return &GetMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden -const GetMoveTaskOrderForbiddenCode int = 403 - -/* -GetMoveTaskOrderForbidden The request was denied - -swagger:response getMoveTaskOrderForbidden -*/ -type GetMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - - return &GetMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound -const GetMoveTaskOrderNotFoundCode int = 404 - -/* -GetMoveTaskOrderNotFound The requested resource wasn't found - -swagger:response getMoveTaskOrderNotFound -*/ -type GetMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - - return &GetMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError -const GetMoveTaskOrderInternalServerErrorCode int = 500 - -/* -GetMoveTaskOrderInternalServerError A server error occurred - -swagger:response getMoveTaskOrderInternalServerError -*/ -type GetMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - - return &GetMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go deleted file mode 100644 index 0eb44042657..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveTaskOrderURL generates an URL for the get move task order operation -type GetMoveTaskOrderURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on GetMoveTaskOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go deleted file mode 100644 index 6af08f9317e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOReviewedBillableWeightsAtHandlerFunc turns a function with the right signature into a update m t o reviewed billable weights at handler -type UpdateMTOReviewedBillableWeightsAtHandlerFunc func(UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOReviewedBillableWeightsAtHandlerFunc) Handle(params UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOReviewedBillableWeightsAtHandler interface for that can handle valid update m t o reviewed billable weights at params -type UpdateMTOReviewedBillableWeightsAtHandler interface { - Handle(UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder -} - -// NewUpdateMTOReviewedBillableWeightsAt creates a new http.Handler for the update m t o reviewed billable weights at operation -func NewUpdateMTOReviewedBillableWeightsAt(ctx *middleware.Context, handler UpdateMTOReviewedBillableWeightsAtHandler) *UpdateMTOReviewedBillableWeightsAt { - return &UpdateMTOReviewedBillableWeightsAt{Context: ctx, Handler: handler} -} - -/* - UpdateMTOReviewedBillableWeightsAt swagger:route PATCH /move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at moveTaskOrder updateMTOReviewedBillableWeightsAt - -Changes move (move task order) billableWeightsReviewedAt field to a timestamp -*/ -type UpdateMTOReviewedBillableWeightsAt struct { - Context *middleware.Context - Handler UpdateMTOReviewedBillableWeightsAtHandler -} - -func (o *UpdateMTOReviewedBillableWeightsAt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOReviewedBillableWeightsAtParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go deleted file mode 100644 index 4dba27881da..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateMTOReviewedBillableWeightsAtParams creates a new UpdateMTOReviewedBillableWeightsAtParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOReviewedBillableWeightsAtParams() UpdateMTOReviewedBillableWeightsAtParams { - - return UpdateMTOReviewedBillableWeightsAtParams{} -} - -// UpdateMTOReviewedBillableWeightsAtParams contains all the bound params for the update m t o reviewed billable weights at operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOReviewedBillableWeightsAt -type UpdateMTOReviewedBillableWeightsAtParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOReviewedBillableWeightsAtParams() beforehand. -func (o *UpdateMTOReviewedBillableWeightsAtParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOReviewedBillableWeightsAtParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMTOReviewedBillableWeightsAtParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go deleted file mode 100644 index 83e896b7250..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMTOReviewedBillableWeightsAtOKCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtOK -const UpdateMTOReviewedBillableWeightsAtOKCode int = 200 - -/* -UpdateMTOReviewedBillableWeightsAtOK Successfully updated move task order billableWeightsReviewedAt field - -swagger:response updateMTOReviewedBillableWeightsAtOK -*/ -type UpdateMTOReviewedBillableWeightsAtOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtOK creates UpdateMTOReviewedBillableWeightsAtOK with default headers values -func NewUpdateMTOReviewedBillableWeightsAtOK() *UpdateMTOReviewedBillableWeightsAtOK { - - return &UpdateMTOReviewedBillableWeightsAtOK{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at o k response -func (o *UpdateMTOReviewedBillableWeightsAtOK) WithPayload(payload *ghcmessages.Move) *UpdateMTOReviewedBillableWeightsAtOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at o k response -func (o *UpdateMTOReviewedBillableWeightsAtOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtBadRequestCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtBadRequest -const UpdateMTOReviewedBillableWeightsAtBadRequestCode int = 400 - -/* -UpdateMTOReviewedBillableWeightsAtBadRequest The request payload is invalid - -swagger:response updateMTOReviewedBillableWeightsAtBadRequest -*/ -type UpdateMTOReviewedBillableWeightsAtBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtBadRequest creates UpdateMTOReviewedBillableWeightsAtBadRequest with default headers values -func NewUpdateMTOReviewedBillableWeightsAtBadRequest() *UpdateMTOReviewedBillableWeightsAtBadRequest { - - return &UpdateMTOReviewedBillableWeightsAtBadRequest{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at bad request response -func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at bad request response -func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtUnauthorizedCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtUnauthorized -const UpdateMTOReviewedBillableWeightsAtUnauthorizedCode int = 401 - -/* -UpdateMTOReviewedBillableWeightsAtUnauthorized The request was denied - -swagger:response updateMTOReviewedBillableWeightsAtUnauthorized -*/ -type UpdateMTOReviewedBillableWeightsAtUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtUnauthorized creates UpdateMTOReviewedBillableWeightsAtUnauthorized with default headers values -func NewUpdateMTOReviewedBillableWeightsAtUnauthorized() *UpdateMTOReviewedBillableWeightsAtUnauthorized { - - return &UpdateMTOReviewedBillableWeightsAtUnauthorized{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at unauthorized response -func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at unauthorized response -func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtForbiddenCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtForbidden -const UpdateMTOReviewedBillableWeightsAtForbiddenCode int = 403 - -/* -UpdateMTOReviewedBillableWeightsAtForbidden The request was denied - -swagger:response updateMTOReviewedBillableWeightsAtForbidden -*/ -type UpdateMTOReviewedBillableWeightsAtForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtForbidden creates UpdateMTOReviewedBillableWeightsAtForbidden with default headers values -func NewUpdateMTOReviewedBillableWeightsAtForbidden() *UpdateMTOReviewedBillableWeightsAtForbidden { - - return &UpdateMTOReviewedBillableWeightsAtForbidden{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at forbidden response -func (o *UpdateMTOReviewedBillableWeightsAtForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at forbidden response -func (o *UpdateMTOReviewedBillableWeightsAtForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtNotFoundCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtNotFound -const UpdateMTOReviewedBillableWeightsAtNotFoundCode int = 404 - -/* -UpdateMTOReviewedBillableWeightsAtNotFound The requested resource wasn't found - -swagger:response updateMTOReviewedBillableWeightsAtNotFound -*/ -type UpdateMTOReviewedBillableWeightsAtNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtNotFound creates UpdateMTOReviewedBillableWeightsAtNotFound with default headers values -func NewUpdateMTOReviewedBillableWeightsAtNotFound() *UpdateMTOReviewedBillableWeightsAtNotFound { - - return &UpdateMTOReviewedBillableWeightsAtNotFound{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at not found response -func (o *UpdateMTOReviewedBillableWeightsAtNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at not found response -func (o *UpdateMTOReviewedBillableWeightsAtNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtConflictCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtConflict -const UpdateMTOReviewedBillableWeightsAtConflictCode int = 409 - -/* -UpdateMTOReviewedBillableWeightsAtConflict Conflict error - -swagger:response updateMTOReviewedBillableWeightsAtConflict -*/ -type UpdateMTOReviewedBillableWeightsAtConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtConflict creates UpdateMTOReviewedBillableWeightsAtConflict with default headers values -func NewUpdateMTOReviewedBillableWeightsAtConflict() *UpdateMTOReviewedBillableWeightsAtConflict { - - return &UpdateMTOReviewedBillableWeightsAtConflict{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at conflict response -func (o *UpdateMTOReviewedBillableWeightsAtConflict) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at conflict response -func (o *UpdateMTOReviewedBillableWeightsAtConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtPreconditionFailedCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtPreconditionFailed -const UpdateMTOReviewedBillableWeightsAtPreconditionFailedCode int = 412 - -/* -UpdateMTOReviewedBillableWeightsAtPreconditionFailed Precondition failed - -swagger:response updateMTOReviewedBillableWeightsAtPreconditionFailed -*/ -type UpdateMTOReviewedBillableWeightsAtPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtPreconditionFailed creates UpdateMTOReviewedBillableWeightsAtPreconditionFailed with default headers values -func NewUpdateMTOReviewedBillableWeightsAtPreconditionFailed() *UpdateMTOReviewedBillableWeightsAtPreconditionFailed { - - return &UpdateMTOReviewedBillableWeightsAtPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at precondition failed response -func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at precondition failed response -func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtUnprocessableEntityCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtUnprocessableEntity -const UpdateMTOReviewedBillableWeightsAtUnprocessableEntityCode int = 422 - -/* -UpdateMTOReviewedBillableWeightsAtUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOReviewedBillableWeightsAtUnprocessableEntity -*/ -type UpdateMTOReviewedBillableWeightsAtUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtUnprocessableEntity creates UpdateMTOReviewedBillableWeightsAtUnprocessableEntity with default headers values -func NewUpdateMTOReviewedBillableWeightsAtUnprocessableEntity() *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity { - - return &UpdateMTOReviewedBillableWeightsAtUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at unprocessable entity response -func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at unprocessable entity response -func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOReviewedBillableWeightsAtInternalServerErrorCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtInternalServerError -const UpdateMTOReviewedBillableWeightsAtInternalServerErrorCode int = 500 - -/* -UpdateMTOReviewedBillableWeightsAtInternalServerError A server error occurred - -swagger:response updateMTOReviewedBillableWeightsAtInternalServerError -*/ -type UpdateMTOReviewedBillableWeightsAtInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOReviewedBillableWeightsAtInternalServerError creates UpdateMTOReviewedBillableWeightsAtInternalServerError with default headers values -func NewUpdateMTOReviewedBillableWeightsAtInternalServerError() *UpdateMTOReviewedBillableWeightsAtInternalServerError { - - return &UpdateMTOReviewedBillableWeightsAtInternalServerError{} -} - -// WithPayload adds the payload to the update m t o reviewed billable weights at internal server error response -func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o reviewed billable weights at internal server error response -func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go deleted file mode 100644 index 6b5d00f3ba5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOReviewedBillableWeightsAtURL generates an URL for the update m t o reviewed billable weights at operation -type UpdateMTOReviewedBillableWeightsAtURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOReviewedBillableWeightsAtURL) WithBasePath(bp string) *UpdateMTOReviewedBillableWeightsAtURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOReviewedBillableWeightsAtURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOReviewedBillableWeightsAtURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMTOReviewedBillableWeightsAtURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOReviewedBillableWeightsAtURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOReviewedBillableWeightsAtURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOReviewedBillableWeightsAtURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOReviewedBillableWeightsAtURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOReviewedBillableWeightsAtURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOReviewedBillableWeightsAtURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go deleted file mode 100644 index 3e328a2ee31..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOStatusServiceCounselingCompletedHandlerFunc turns a function with the right signature into a update m t o status service counseling completed handler -type UpdateMTOStatusServiceCounselingCompletedHandlerFunc func(UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOStatusServiceCounselingCompletedHandlerFunc) Handle(params UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOStatusServiceCounselingCompletedHandler interface for that can handle valid update m t o status service counseling completed params -type UpdateMTOStatusServiceCounselingCompletedHandler interface { - Handle(UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder -} - -// NewUpdateMTOStatusServiceCounselingCompleted creates a new http.Handler for the update m t o status service counseling completed operation -func NewUpdateMTOStatusServiceCounselingCompleted(ctx *middleware.Context, handler UpdateMTOStatusServiceCounselingCompletedHandler) *UpdateMTOStatusServiceCounselingCompleted { - return &UpdateMTOStatusServiceCounselingCompleted{Context: ctx, Handler: handler} -} - -/* - UpdateMTOStatusServiceCounselingCompleted swagger:route PATCH /move-task-orders/{moveTaskOrderID}/status/service-counseling-completed moveTaskOrder updateMTOStatusServiceCounselingCompleted - -# Changes move (move task order) status to service counseling completed - -Changes move (move task order) status to service counseling completed -*/ -type UpdateMTOStatusServiceCounselingCompleted struct { - Context *middleware.Context - Handler UpdateMTOStatusServiceCounselingCompletedHandler -} - -func (o *UpdateMTOStatusServiceCounselingCompleted) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOStatusServiceCounselingCompletedParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go deleted file mode 100644 index b1971590362..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateMTOStatusServiceCounselingCompletedParams creates a new UpdateMTOStatusServiceCounselingCompletedParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOStatusServiceCounselingCompletedParams() UpdateMTOStatusServiceCounselingCompletedParams { - - return UpdateMTOStatusServiceCounselingCompletedParams{} -} - -// UpdateMTOStatusServiceCounselingCompletedParams contains all the bound params for the update m t o status service counseling completed operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOStatusServiceCounselingCompleted -type UpdateMTOStatusServiceCounselingCompletedParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOStatusServiceCounselingCompletedParams() beforehand. -func (o *UpdateMTOStatusServiceCounselingCompletedParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOStatusServiceCounselingCompletedParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMTOStatusServiceCounselingCompletedParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go deleted file mode 100644 index 0094a040e6e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMTOStatusServiceCounselingCompletedOKCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedOK -const UpdateMTOStatusServiceCounselingCompletedOKCode int = 200 - -/* -UpdateMTOStatusServiceCounselingCompletedOK Successfully updated move task order status - -swagger:response updateMTOStatusServiceCounselingCompletedOK -*/ -type UpdateMTOStatusServiceCounselingCompletedOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedOK creates UpdateMTOStatusServiceCounselingCompletedOK with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedOK() *UpdateMTOStatusServiceCounselingCompletedOK { - - return &UpdateMTOStatusServiceCounselingCompletedOK{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed o k response -func (o *UpdateMTOStatusServiceCounselingCompletedOK) WithPayload(payload *ghcmessages.Move) *UpdateMTOStatusServiceCounselingCompletedOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed o k response -func (o *UpdateMTOStatusServiceCounselingCompletedOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedBadRequestCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedBadRequest -const UpdateMTOStatusServiceCounselingCompletedBadRequestCode int = 400 - -/* -UpdateMTOStatusServiceCounselingCompletedBadRequest The request payload is invalid - -swagger:response updateMTOStatusServiceCounselingCompletedBadRequest -*/ -type UpdateMTOStatusServiceCounselingCompletedBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedBadRequest creates UpdateMTOStatusServiceCounselingCompletedBadRequest with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedBadRequest() *UpdateMTOStatusServiceCounselingCompletedBadRequest { - - return &UpdateMTOStatusServiceCounselingCompletedBadRequest{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed bad request response -func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed bad request response -func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedUnauthorizedCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedUnauthorized -const UpdateMTOStatusServiceCounselingCompletedUnauthorizedCode int = 401 - -/* -UpdateMTOStatusServiceCounselingCompletedUnauthorized The request was denied - -swagger:response updateMTOStatusServiceCounselingCompletedUnauthorized -*/ -type UpdateMTOStatusServiceCounselingCompletedUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedUnauthorized creates UpdateMTOStatusServiceCounselingCompletedUnauthorized with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedUnauthorized() *UpdateMTOStatusServiceCounselingCompletedUnauthorized { - - return &UpdateMTOStatusServiceCounselingCompletedUnauthorized{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed unauthorized response -func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed unauthorized response -func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedForbiddenCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedForbidden -const UpdateMTOStatusServiceCounselingCompletedForbiddenCode int = 403 - -/* -UpdateMTOStatusServiceCounselingCompletedForbidden The request was denied - -swagger:response updateMTOStatusServiceCounselingCompletedForbidden -*/ -type UpdateMTOStatusServiceCounselingCompletedForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedForbidden creates UpdateMTOStatusServiceCounselingCompletedForbidden with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedForbidden() *UpdateMTOStatusServiceCounselingCompletedForbidden { - - return &UpdateMTOStatusServiceCounselingCompletedForbidden{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed forbidden response -func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed forbidden response -func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedNotFoundCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedNotFound -const UpdateMTOStatusServiceCounselingCompletedNotFoundCode int = 404 - -/* -UpdateMTOStatusServiceCounselingCompletedNotFound The requested resource wasn't found - -swagger:response updateMTOStatusServiceCounselingCompletedNotFound -*/ -type UpdateMTOStatusServiceCounselingCompletedNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedNotFound creates UpdateMTOStatusServiceCounselingCompletedNotFound with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedNotFound() *UpdateMTOStatusServiceCounselingCompletedNotFound { - - return &UpdateMTOStatusServiceCounselingCompletedNotFound{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed not found response -func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed not found response -func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedConflictCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedConflict -const UpdateMTOStatusServiceCounselingCompletedConflictCode int = 409 - -/* -UpdateMTOStatusServiceCounselingCompletedConflict Conflict error - -swagger:response updateMTOStatusServiceCounselingCompletedConflict -*/ -type UpdateMTOStatusServiceCounselingCompletedConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedConflict creates UpdateMTOStatusServiceCounselingCompletedConflict with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedConflict() *UpdateMTOStatusServiceCounselingCompletedConflict { - - return &UpdateMTOStatusServiceCounselingCompletedConflict{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed conflict response -func (o *UpdateMTOStatusServiceCounselingCompletedConflict) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed conflict response -func (o *UpdateMTOStatusServiceCounselingCompletedConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedPreconditionFailedCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedPreconditionFailed -const UpdateMTOStatusServiceCounselingCompletedPreconditionFailedCode int = 412 - -/* -UpdateMTOStatusServiceCounselingCompletedPreconditionFailed Precondition failed - -swagger:response updateMTOStatusServiceCounselingCompletedPreconditionFailed -*/ -type UpdateMTOStatusServiceCounselingCompletedPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedPreconditionFailed creates UpdateMTOStatusServiceCounselingCompletedPreconditionFailed with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedPreconditionFailed() *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed { - - return &UpdateMTOStatusServiceCounselingCompletedPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed precondition failed response -func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed precondition failed response -func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedUnprocessableEntityCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity -const UpdateMTOStatusServiceCounselingCompletedUnprocessableEntityCode int = 422 - -/* -UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOStatusServiceCounselingCompletedUnprocessableEntity -*/ -type UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedUnprocessableEntity creates UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedUnprocessableEntity() *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity { - - return &UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed unprocessable entity response -func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed unprocessable entity response -func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOStatusServiceCounselingCompletedInternalServerErrorCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedInternalServerError -const UpdateMTOStatusServiceCounselingCompletedInternalServerErrorCode int = 500 - -/* -UpdateMTOStatusServiceCounselingCompletedInternalServerError A server error occurred - -swagger:response updateMTOStatusServiceCounselingCompletedInternalServerError -*/ -type UpdateMTOStatusServiceCounselingCompletedInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOStatusServiceCounselingCompletedInternalServerError creates UpdateMTOStatusServiceCounselingCompletedInternalServerError with default headers values -func NewUpdateMTOStatusServiceCounselingCompletedInternalServerError() *UpdateMTOStatusServiceCounselingCompletedInternalServerError { - - return &UpdateMTOStatusServiceCounselingCompletedInternalServerError{} -} - -// WithPayload adds the payload to the update m t o status service counseling completed internal server error response -func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o status service counseling completed internal server error response -func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go deleted file mode 100644 index c8d2c8eca09..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOStatusServiceCounselingCompletedURL generates an URL for the update m t o status service counseling completed operation -type UpdateMTOStatusServiceCounselingCompletedURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOStatusServiceCounselingCompletedURL) WithBasePath(bp string) *UpdateMTOStatusServiceCounselingCompletedURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOStatusServiceCounselingCompletedURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOStatusServiceCounselingCompletedURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMTOStatusServiceCounselingCompletedURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOStatusServiceCounselingCompletedURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOStatusServiceCounselingCompletedURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOStatusServiceCounselingCompletedURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOStatusServiceCounselingCompletedURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOStatusServiceCounselingCompletedURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOStatusServiceCounselingCompletedURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go deleted file mode 100644 index 4a0234ddd41..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go +++ /dev/null @@ -1,56 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMoveTIORemarksHandlerFunc turns a function with the right signature into a update move t i o remarks handler -type UpdateMoveTIORemarksHandlerFunc func(UpdateMoveTIORemarksParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMoveTIORemarksHandlerFunc) Handle(params UpdateMoveTIORemarksParams) middleware.Responder { - return fn(params) -} - -// UpdateMoveTIORemarksHandler interface for that can handle valid update move t i o remarks params -type UpdateMoveTIORemarksHandler interface { - Handle(UpdateMoveTIORemarksParams) middleware.Responder -} - -// NewUpdateMoveTIORemarks creates a new http.Handler for the update move t i o remarks operation -func NewUpdateMoveTIORemarks(ctx *middleware.Context, handler UpdateMoveTIORemarksHandler) *UpdateMoveTIORemarks { - return &UpdateMoveTIORemarks{Context: ctx, Handler: handler} -} - -/* - UpdateMoveTIORemarks swagger:route PATCH /move-task-orders/{moveTaskOrderID}/tio-remarks moveTaskOrder updateMoveTIORemarks - -Changes move (move task order) billableWeightsReviewedAt field to a timestamp -*/ -type UpdateMoveTIORemarks struct { - Context *middleware.Context - Handler UpdateMoveTIORemarksHandler -} - -func (o *UpdateMoveTIORemarks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMoveTIORemarksParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go deleted file mode 100644 index 3df5d6da86e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMoveTIORemarksParams creates a new UpdateMoveTIORemarksParams object -// -// There are no default values defined in the spec. -func NewUpdateMoveTIORemarksParams() UpdateMoveTIORemarksParams { - - return UpdateMoveTIORemarksParams{} -} - -// UpdateMoveTIORemarksParams contains all the bound params for the update move t i o remarks operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMoveTIORemarks -type UpdateMoveTIORemarksParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.Move - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMoveTIORemarksParams() beforehand. -func (o *UpdateMoveTIORemarksParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.Move - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMoveTIORemarksParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMoveTIORemarksParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go deleted file mode 100644 index 0c4a63542e6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMoveTIORemarksOKCode is the HTTP code returned for type UpdateMoveTIORemarksOK -const UpdateMoveTIORemarksOKCode int = 200 - -/* -UpdateMoveTIORemarksOK Successfully updated move task order tioRemarks field - -swagger:response updateMoveTIORemarksOK -*/ -type UpdateMoveTIORemarksOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksOK creates UpdateMoveTIORemarksOK with default headers values -func NewUpdateMoveTIORemarksOK() *UpdateMoveTIORemarksOK { - - return &UpdateMoveTIORemarksOK{} -} - -// WithPayload adds the payload to the update move t i o remarks o k response -func (o *UpdateMoveTIORemarksOK) WithPayload(payload *ghcmessages.Move) *UpdateMoveTIORemarksOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks o k response -func (o *UpdateMoveTIORemarksOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksBadRequestCode is the HTTP code returned for type UpdateMoveTIORemarksBadRequest -const UpdateMoveTIORemarksBadRequestCode int = 400 - -/* -UpdateMoveTIORemarksBadRequest The request payload is invalid - -swagger:response updateMoveTIORemarksBadRequest -*/ -type UpdateMoveTIORemarksBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksBadRequest creates UpdateMoveTIORemarksBadRequest with default headers values -func NewUpdateMoveTIORemarksBadRequest() *UpdateMoveTIORemarksBadRequest { - - return &UpdateMoveTIORemarksBadRequest{} -} - -// WithPayload adds the payload to the update move t i o remarks bad request response -func (o *UpdateMoveTIORemarksBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks bad request response -func (o *UpdateMoveTIORemarksBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksUnauthorizedCode is the HTTP code returned for type UpdateMoveTIORemarksUnauthorized -const UpdateMoveTIORemarksUnauthorizedCode int = 401 - -/* -UpdateMoveTIORemarksUnauthorized The request was denied - -swagger:response updateMoveTIORemarksUnauthorized -*/ -type UpdateMoveTIORemarksUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksUnauthorized creates UpdateMoveTIORemarksUnauthorized with default headers values -func NewUpdateMoveTIORemarksUnauthorized() *UpdateMoveTIORemarksUnauthorized { - - return &UpdateMoveTIORemarksUnauthorized{} -} - -// WithPayload adds the payload to the update move t i o remarks unauthorized response -func (o *UpdateMoveTIORemarksUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks unauthorized response -func (o *UpdateMoveTIORemarksUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksForbiddenCode is the HTTP code returned for type UpdateMoveTIORemarksForbidden -const UpdateMoveTIORemarksForbiddenCode int = 403 - -/* -UpdateMoveTIORemarksForbidden The request was denied - -swagger:response updateMoveTIORemarksForbidden -*/ -type UpdateMoveTIORemarksForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksForbidden creates UpdateMoveTIORemarksForbidden with default headers values -func NewUpdateMoveTIORemarksForbidden() *UpdateMoveTIORemarksForbidden { - - return &UpdateMoveTIORemarksForbidden{} -} - -// WithPayload adds the payload to the update move t i o remarks forbidden response -func (o *UpdateMoveTIORemarksForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks forbidden response -func (o *UpdateMoveTIORemarksForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksNotFoundCode is the HTTP code returned for type UpdateMoveTIORemarksNotFound -const UpdateMoveTIORemarksNotFoundCode int = 404 - -/* -UpdateMoveTIORemarksNotFound The requested resource wasn't found - -swagger:response updateMoveTIORemarksNotFound -*/ -type UpdateMoveTIORemarksNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksNotFound creates UpdateMoveTIORemarksNotFound with default headers values -func NewUpdateMoveTIORemarksNotFound() *UpdateMoveTIORemarksNotFound { - - return &UpdateMoveTIORemarksNotFound{} -} - -// WithPayload adds the payload to the update move t i o remarks not found response -func (o *UpdateMoveTIORemarksNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks not found response -func (o *UpdateMoveTIORemarksNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksConflictCode is the HTTP code returned for type UpdateMoveTIORemarksConflict -const UpdateMoveTIORemarksConflictCode int = 409 - -/* -UpdateMoveTIORemarksConflict Conflict error - -swagger:response updateMoveTIORemarksConflict -*/ -type UpdateMoveTIORemarksConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksConflict creates UpdateMoveTIORemarksConflict with default headers values -func NewUpdateMoveTIORemarksConflict() *UpdateMoveTIORemarksConflict { - - return &UpdateMoveTIORemarksConflict{} -} - -// WithPayload adds the payload to the update move t i o remarks conflict response -func (o *UpdateMoveTIORemarksConflict) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks conflict response -func (o *UpdateMoveTIORemarksConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksPreconditionFailedCode is the HTTP code returned for type UpdateMoveTIORemarksPreconditionFailed -const UpdateMoveTIORemarksPreconditionFailedCode int = 412 - -/* -UpdateMoveTIORemarksPreconditionFailed Precondition failed - -swagger:response updateMoveTIORemarksPreconditionFailed -*/ -type UpdateMoveTIORemarksPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksPreconditionFailed creates UpdateMoveTIORemarksPreconditionFailed with default headers values -func NewUpdateMoveTIORemarksPreconditionFailed() *UpdateMoveTIORemarksPreconditionFailed { - - return &UpdateMoveTIORemarksPreconditionFailed{} -} - -// WithPayload adds the payload to the update move t i o remarks precondition failed response -func (o *UpdateMoveTIORemarksPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks precondition failed response -func (o *UpdateMoveTIORemarksPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksUnprocessableEntityCode is the HTTP code returned for type UpdateMoveTIORemarksUnprocessableEntity -const UpdateMoveTIORemarksUnprocessableEntityCode int = 422 - -/* -UpdateMoveTIORemarksUnprocessableEntity The payload was unprocessable. - -swagger:response updateMoveTIORemarksUnprocessableEntity -*/ -type UpdateMoveTIORemarksUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksUnprocessableEntity creates UpdateMoveTIORemarksUnprocessableEntity with default headers values -func NewUpdateMoveTIORemarksUnprocessableEntity() *UpdateMoveTIORemarksUnprocessableEntity { - - return &UpdateMoveTIORemarksUnprocessableEntity{} -} - -// WithPayload adds the payload to the update move t i o remarks unprocessable entity response -func (o *UpdateMoveTIORemarksUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMoveTIORemarksUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks unprocessable entity response -func (o *UpdateMoveTIORemarksUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTIORemarksInternalServerErrorCode is the HTTP code returned for type UpdateMoveTIORemarksInternalServerError -const UpdateMoveTIORemarksInternalServerErrorCode int = 500 - -/* -UpdateMoveTIORemarksInternalServerError A server error occurred - -swagger:response updateMoveTIORemarksInternalServerError -*/ -type UpdateMoveTIORemarksInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTIORemarksInternalServerError creates UpdateMoveTIORemarksInternalServerError with default headers values -func NewUpdateMoveTIORemarksInternalServerError() *UpdateMoveTIORemarksInternalServerError { - - return &UpdateMoveTIORemarksInternalServerError{} -} - -// WithPayload adds the payload to the update move t i o remarks internal server error response -func (o *UpdateMoveTIORemarksInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move t i o remarks internal server error response -func (o *UpdateMoveTIORemarksInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTIORemarksInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go deleted file mode 100644 index 116d0bfc1c2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMoveTIORemarksURL generates an URL for the update move t i o remarks operation -type UpdateMoveTIORemarksURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveTIORemarksURL) WithBasePath(bp string) *UpdateMoveTIORemarksURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveTIORemarksURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMoveTIORemarksURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/tio-remarks" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMoveTIORemarksURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMoveTIORemarksURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMoveTIORemarksURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMoveTIORemarksURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMoveTIORemarksURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMoveTIORemarksURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMoveTIORemarksURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go deleted file mode 100644 index ec8f17920aa..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMoveTaskOrderStatusHandlerFunc turns a function with the right signature into a update move task order status handler -type UpdateMoveTaskOrderStatusHandlerFunc func(UpdateMoveTaskOrderStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMoveTaskOrderStatusHandlerFunc) Handle(params UpdateMoveTaskOrderStatusParams) middleware.Responder { - return fn(params) -} - -// UpdateMoveTaskOrderStatusHandler interface for that can handle valid update move task order status params -type UpdateMoveTaskOrderStatusHandler interface { - Handle(UpdateMoveTaskOrderStatusParams) middleware.Responder -} - -// NewUpdateMoveTaskOrderStatus creates a new http.Handler for the update move task order status operation -func NewUpdateMoveTaskOrderStatus(ctx *middleware.Context, handler UpdateMoveTaskOrderStatusHandler) *UpdateMoveTaskOrderStatus { - return &UpdateMoveTaskOrderStatus{Context: ctx, Handler: handler} -} - -/* - UpdateMoveTaskOrderStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/status moveTaskOrder updateMoveTaskOrderStatus - -# Change the status of a move task order to make it available to prime - -Changes move task order status to make it available to prime -*/ -type UpdateMoveTaskOrderStatus struct { - Context *middleware.Context - Handler UpdateMoveTaskOrderStatusHandler -} - -func (o *UpdateMoveTaskOrderStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMoveTaskOrderStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go deleted file mode 100644 index bb1ffe4b294..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMoveTaskOrderStatusParams creates a new UpdateMoveTaskOrderStatusParams object -// -// There are no default values defined in the spec. -func NewUpdateMoveTaskOrderStatusParams() UpdateMoveTaskOrderStatusParams { - - return UpdateMoveTaskOrderStatusParams{} -} - -// UpdateMoveTaskOrderStatusParams contains all the bound params for the update move task order status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMoveTaskOrderStatus -type UpdateMoveTaskOrderStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string - /* - Required: true - In: body - */ - ServiceItemCodes *ghcmessages.MTOApprovalServiceItemCodes -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMoveTaskOrderStatusParams() beforehand. -func (o *UpdateMoveTaskOrderStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.MTOApprovalServiceItemCodes - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("serviceItemCodes", "body", "")) - } else { - res = append(res, errors.NewParseError("serviceItemCodes", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.ServiceItemCodes = &body - } - } - } else { - res = append(res, errors.Required("serviceItemCodes", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMoveTaskOrderStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMoveTaskOrderStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go deleted file mode 100644 index 1787fd1ecbf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMoveTaskOrderStatusOKCode is the HTTP code returned for type UpdateMoveTaskOrderStatusOK -const UpdateMoveTaskOrderStatusOKCode int = 200 - -/* -UpdateMoveTaskOrderStatusOK Successfully updated move task order status - -swagger:response updateMoveTaskOrderStatusOK -*/ -type UpdateMoveTaskOrderStatusOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusOK creates UpdateMoveTaskOrderStatusOK with default headers values -func NewUpdateMoveTaskOrderStatusOK() *UpdateMoveTaskOrderStatusOK { - - return &UpdateMoveTaskOrderStatusOK{} -} - -// WithPayload adds the payload to the update move task order status o k response -func (o *UpdateMoveTaskOrderStatusOK) WithPayload(payload *ghcmessages.Move) *UpdateMoveTaskOrderStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status o k response -func (o *UpdateMoveTaskOrderStatusOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusBadRequestCode is the HTTP code returned for type UpdateMoveTaskOrderStatusBadRequest -const UpdateMoveTaskOrderStatusBadRequestCode int = 400 - -/* -UpdateMoveTaskOrderStatusBadRequest The request payload is invalid - -swagger:response updateMoveTaskOrderStatusBadRequest -*/ -type UpdateMoveTaskOrderStatusBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusBadRequest creates UpdateMoveTaskOrderStatusBadRequest with default headers values -func NewUpdateMoveTaskOrderStatusBadRequest() *UpdateMoveTaskOrderStatusBadRequest { - - return &UpdateMoveTaskOrderStatusBadRequest{} -} - -// WithPayload adds the payload to the update move task order status bad request response -func (o *UpdateMoveTaskOrderStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status bad request response -func (o *UpdateMoveTaskOrderStatusBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusUnauthorizedCode is the HTTP code returned for type UpdateMoveTaskOrderStatusUnauthorized -const UpdateMoveTaskOrderStatusUnauthorizedCode int = 401 - -/* -UpdateMoveTaskOrderStatusUnauthorized The request was denied - -swagger:response updateMoveTaskOrderStatusUnauthorized -*/ -type UpdateMoveTaskOrderStatusUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusUnauthorized creates UpdateMoveTaskOrderStatusUnauthorized with default headers values -func NewUpdateMoveTaskOrderStatusUnauthorized() *UpdateMoveTaskOrderStatusUnauthorized { - - return &UpdateMoveTaskOrderStatusUnauthorized{} -} - -// WithPayload adds the payload to the update move task order status unauthorized response -func (o *UpdateMoveTaskOrderStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status unauthorized response -func (o *UpdateMoveTaskOrderStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusForbiddenCode is the HTTP code returned for type UpdateMoveTaskOrderStatusForbidden -const UpdateMoveTaskOrderStatusForbiddenCode int = 403 - -/* -UpdateMoveTaskOrderStatusForbidden The request was denied - -swagger:response updateMoveTaskOrderStatusForbidden -*/ -type UpdateMoveTaskOrderStatusForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusForbidden creates UpdateMoveTaskOrderStatusForbidden with default headers values -func NewUpdateMoveTaskOrderStatusForbidden() *UpdateMoveTaskOrderStatusForbidden { - - return &UpdateMoveTaskOrderStatusForbidden{} -} - -// WithPayload adds the payload to the update move task order status forbidden response -func (o *UpdateMoveTaskOrderStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status forbidden response -func (o *UpdateMoveTaskOrderStatusForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusNotFoundCode is the HTTP code returned for type UpdateMoveTaskOrderStatusNotFound -const UpdateMoveTaskOrderStatusNotFoundCode int = 404 - -/* -UpdateMoveTaskOrderStatusNotFound The requested resource wasn't found - -swagger:response updateMoveTaskOrderStatusNotFound -*/ -type UpdateMoveTaskOrderStatusNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusNotFound creates UpdateMoveTaskOrderStatusNotFound with default headers values -func NewUpdateMoveTaskOrderStatusNotFound() *UpdateMoveTaskOrderStatusNotFound { - - return &UpdateMoveTaskOrderStatusNotFound{} -} - -// WithPayload adds the payload to the update move task order status not found response -func (o *UpdateMoveTaskOrderStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status not found response -func (o *UpdateMoveTaskOrderStatusNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusConflictCode is the HTTP code returned for type UpdateMoveTaskOrderStatusConflict -const UpdateMoveTaskOrderStatusConflictCode int = 409 - -/* -UpdateMoveTaskOrderStatusConflict Conflict error - -swagger:response updateMoveTaskOrderStatusConflict -*/ -type UpdateMoveTaskOrderStatusConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusConflict creates UpdateMoveTaskOrderStatusConflict with default headers values -func NewUpdateMoveTaskOrderStatusConflict() *UpdateMoveTaskOrderStatusConflict { - - return &UpdateMoveTaskOrderStatusConflict{} -} - -// WithPayload adds the payload to the update move task order status conflict response -func (o *UpdateMoveTaskOrderStatusConflict) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status conflict response -func (o *UpdateMoveTaskOrderStatusConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusPreconditionFailedCode is the HTTP code returned for type UpdateMoveTaskOrderStatusPreconditionFailed -const UpdateMoveTaskOrderStatusPreconditionFailedCode int = 412 - -/* -UpdateMoveTaskOrderStatusPreconditionFailed Precondition failed - -swagger:response updateMoveTaskOrderStatusPreconditionFailed -*/ -type UpdateMoveTaskOrderStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusPreconditionFailed creates UpdateMoveTaskOrderStatusPreconditionFailed with default headers values -func NewUpdateMoveTaskOrderStatusPreconditionFailed() *UpdateMoveTaskOrderStatusPreconditionFailed { - - return &UpdateMoveTaskOrderStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update move task order status precondition failed response -func (o *UpdateMoveTaskOrderStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status precondition failed response -func (o *UpdateMoveTaskOrderStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMoveTaskOrderStatusUnprocessableEntity -const UpdateMoveTaskOrderStatusUnprocessableEntityCode int = 422 - -/* -UpdateMoveTaskOrderStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updateMoveTaskOrderStatusUnprocessableEntity -*/ -type UpdateMoveTaskOrderStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusUnprocessableEntity creates UpdateMoveTaskOrderStatusUnprocessableEntity with default headers values -func NewUpdateMoveTaskOrderStatusUnprocessableEntity() *UpdateMoveTaskOrderStatusUnprocessableEntity { - - return &UpdateMoveTaskOrderStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update move task order status unprocessable entity response -func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMoveTaskOrderStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status unprocessable entity response -func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveTaskOrderStatusInternalServerErrorCode is the HTTP code returned for type UpdateMoveTaskOrderStatusInternalServerError -const UpdateMoveTaskOrderStatusInternalServerErrorCode int = 500 - -/* -UpdateMoveTaskOrderStatusInternalServerError A server error occurred - -swagger:response updateMoveTaskOrderStatusInternalServerError -*/ -type UpdateMoveTaskOrderStatusInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMoveTaskOrderStatusInternalServerError creates UpdateMoveTaskOrderStatusInternalServerError with default headers values -func NewUpdateMoveTaskOrderStatusInternalServerError() *UpdateMoveTaskOrderStatusInternalServerError { - - return &UpdateMoveTaskOrderStatusInternalServerError{} -} - -// WithPayload adds the payload to the update move task order status internal server error response -func (o *UpdateMoveTaskOrderStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move task order status internal server error response -func (o *UpdateMoveTaskOrderStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveTaskOrderStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go deleted file mode 100644 index 7c230437a31..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMoveTaskOrderStatusURL generates an URL for the update move task order status operation -type UpdateMoveTaskOrderStatusURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveTaskOrderStatusURL) WithBasePath(bp string) *UpdateMoveTaskOrderStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveTaskOrderStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMoveTaskOrderStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/status" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMoveTaskOrderStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMoveTaskOrderStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMoveTaskOrderStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMoveTaskOrderStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMoveTaskOrderStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMoveTaskOrderStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMoveTaskOrderStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go deleted file mode 100644 index 9ea69f40903..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_agent - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// FetchMTOAgentListHandlerFunc turns a function with the right signature into a fetch m t o agent list handler -type FetchMTOAgentListHandlerFunc func(FetchMTOAgentListParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn FetchMTOAgentListHandlerFunc) Handle(params FetchMTOAgentListParams) middleware.Responder { - return fn(params) -} - -// FetchMTOAgentListHandler interface for that can handle valid fetch m t o agent list params -type FetchMTOAgentListHandler interface { - Handle(FetchMTOAgentListParams) middleware.Responder -} - -// NewFetchMTOAgentList creates a new http.Handler for the fetch m t o agent list operation -func NewFetchMTOAgentList(ctx *middleware.Context, handler FetchMTOAgentListHandler) *FetchMTOAgentList { - return &FetchMTOAgentList{Context: ctx, Handler: handler} -} - -/* - FetchMTOAgentList swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents mtoAgent fetchMTOAgentList - -Fetch move task order agents. - -Fetches a list of agents associated with a move task order. -*/ -type FetchMTOAgentList struct { - Context *middleware.Context - Handler FetchMTOAgentListHandler -} - -func (o *FetchMTOAgentList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewFetchMTOAgentListParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go deleted file mode 100644 index 2c213c4ce18..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_agent - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewFetchMTOAgentListParams creates a new FetchMTOAgentListParams object -// -// There are no default values defined in the spec. -func NewFetchMTOAgentListParams() FetchMTOAgentListParams { - - return FetchMTOAgentListParams{} -} - -// FetchMTOAgentListParams contains all the bound params for the fetch m t o agent list operation -// typically these are obtained from a http.Request -// -// swagger:parameters fetchMTOAgentList -type FetchMTOAgentListParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move task order - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewFetchMTOAgentListParams() beforehand. -func (o *FetchMTOAgentListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *FetchMTOAgentListParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *FetchMTOAgentListParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *FetchMTOAgentListParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *FetchMTOAgentListParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go deleted file mode 100644 index 4c6b5363d3b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_agent - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// FetchMTOAgentListOKCode is the HTTP code returned for type FetchMTOAgentListOK -const FetchMTOAgentListOKCode int = 200 - -/* -FetchMTOAgentListOK Successfully retrieved all agents for a move task order - -swagger:response fetchMTOAgentListOK -*/ -type FetchMTOAgentListOK struct { - - /* - In: Body - */ - Payload ghcmessages.MTOAgents `json:"body,omitempty"` -} - -// NewFetchMTOAgentListOK creates FetchMTOAgentListOK with default headers values -func NewFetchMTOAgentListOK() *FetchMTOAgentListOK { - - return &FetchMTOAgentListOK{} -} - -// WithPayload adds the payload to the fetch m t o agent list o k response -func (o *FetchMTOAgentListOK) WithPayload(payload ghcmessages.MTOAgents) *FetchMTOAgentListOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fetch m t o agent list o k response -func (o *FetchMTOAgentListOK) SetPayload(payload ghcmessages.MTOAgents) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FetchMTOAgentListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.MTOAgents{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// FetchMTOAgentListNotFoundCode is the HTTP code returned for type FetchMTOAgentListNotFound -const FetchMTOAgentListNotFoundCode int = 404 - -/* -FetchMTOAgentListNotFound The requested resource wasn't found - -swagger:response fetchMTOAgentListNotFound -*/ -type FetchMTOAgentListNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFetchMTOAgentListNotFound creates FetchMTOAgentListNotFound with default headers values -func NewFetchMTOAgentListNotFound() *FetchMTOAgentListNotFound { - - return &FetchMTOAgentListNotFound{} -} - -// WithPayload adds the payload to the fetch m t o agent list not found response -func (o *FetchMTOAgentListNotFound) WithPayload(payload *ghcmessages.Error) *FetchMTOAgentListNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fetch m t o agent list not found response -func (o *FetchMTOAgentListNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FetchMTOAgentListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FetchMTOAgentListUnprocessableEntityCode is the HTTP code returned for type FetchMTOAgentListUnprocessableEntity -const FetchMTOAgentListUnprocessableEntityCode int = 422 - -/* -FetchMTOAgentListUnprocessableEntity The payload was unprocessable. - -swagger:response fetchMTOAgentListUnprocessableEntity -*/ -type FetchMTOAgentListUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewFetchMTOAgentListUnprocessableEntity creates FetchMTOAgentListUnprocessableEntity with default headers values -func NewFetchMTOAgentListUnprocessableEntity() *FetchMTOAgentListUnprocessableEntity { - - return &FetchMTOAgentListUnprocessableEntity{} -} - -// WithPayload adds the payload to the fetch m t o agent list unprocessable entity response -func (o *FetchMTOAgentListUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *FetchMTOAgentListUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fetch m t o agent list unprocessable entity response -func (o *FetchMTOAgentListUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FetchMTOAgentListUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FetchMTOAgentListInternalServerErrorCode is the HTTP code returned for type FetchMTOAgentListInternalServerError -const FetchMTOAgentListInternalServerErrorCode int = 500 - -/* -FetchMTOAgentListInternalServerError A server error occurred - -swagger:response fetchMTOAgentListInternalServerError -*/ -type FetchMTOAgentListInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFetchMTOAgentListInternalServerError creates FetchMTOAgentListInternalServerError with default headers values -func NewFetchMTOAgentListInternalServerError() *FetchMTOAgentListInternalServerError { - - return &FetchMTOAgentListInternalServerError{} -} - -// WithPayload adds the payload to the fetch m t o agent list internal server error response -func (o *FetchMTOAgentListInternalServerError) WithPayload(payload *ghcmessages.Error) *FetchMTOAgentListInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the fetch m t o agent list internal server error response -func (o *FetchMTOAgentListInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FetchMTOAgentListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go deleted file mode 100644 index fd993b942e3..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_agent - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// FetchMTOAgentListURL generates an URL for the fetch m t o agent list operation -type FetchMTOAgentListURL struct { - MoveTaskOrderID strfmt.UUID - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FetchMTOAgentListURL) WithBasePath(bp string) *FetchMTOAgentListURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FetchMTOAgentListURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *FetchMTOAgentListURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on FetchMTOAgentListURL") - } - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on FetchMTOAgentListURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *FetchMTOAgentListURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *FetchMTOAgentListURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *FetchMTOAgentListURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on FetchMTOAgentListURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on FetchMTOAgentListURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *FetchMTOAgentListURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go deleted file mode 100644 index fee98cfba38..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMTOServiceItemHandlerFunc turns a function with the right signature into a get m t o service item handler -type GetMTOServiceItemHandlerFunc func(GetMTOServiceItemParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMTOServiceItemHandlerFunc) Handle(params GetMTOServiceItemParams) middleware.Responder { - return fn(params) -} - -// GetMTOServiceItemHandler interface for that can handle valid get m t o service item params -type GetMTOServiceItemHandler interface { - Handle(GetMTOServiceItemParams) middleware.Responder -} - -// NewGetMTOServiceItem creates a new http.Handler for the get m t o service item operation -func NewGetMTOServiceItem(ctx *middleware.Context, handler GetMTOServiceItemHandler) *GetMTOServiceItem { - return &GetMTOServiceItem{Context: ctx, Handler: handler} -} - -/* - GetMTOServiceItem swagger:route GET /move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID} mtoServiceItem getMTOServiceItem - -# Gets a line item by ID for a move by ID - -Gets a line item by ID for a move by ID -*/ -type GetMTOServiceItem struct { - Context *middleware.Context - Handler GetMTOServiceItemHandler -} - -func (o *GetMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMTOServiceItemParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go deleted file mode 100644 index c0f1f26cee8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMTOServiceItemParams creates a new GetMTOServiceItemParams object -// -// There are no default values defined in the spec. -func NewGetMTOServiceItemParams() GetMTOServiceItemParams { - - return GetMTOServiceItemParams{} -} - -// GetMTOServiceItemParams contains all the bound params for the get m t o service item operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMTOServiceItem -type GetMTOServiceItemParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string - /*ID of line item to use - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMTOServiceItemParams() beforehand. -func (o *GetMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *GetMTOServiceItemParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *GetMTOServiceItemParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go deleted file mode 100644 index a8aa048dc48..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMTOServiceItemOKCode is the HTTP code returned for type GetMTOServiceItemOK -const GetMTOServiceItemOKCode int = 200 - -/* -GetMTOServiceItemOK Successfully retrieved a line item for a move task order by ID - -swagger:response getMTOServiceItemOK -*/ -type GetMTOServiceItemOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOServiceItemSingle `json:"body,omitempty"` -} - -// NewGetMTOServiceItemOK creates GetMTOServiceItemOK with default headers values -func NewGetMTOServiceItemOK() *GetMTOServiceItemOK { - - return &GetMTOServiceItemOK{} -} - -// WithPayload adds the payload to the get m t o service item o k response -func (o *GetMTOServiceItemOK) WithPayload(payload *ghcmessages.MTOServiceItemSingle) *GetMTOServiceItemOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item o k response -func (o *GetMTOServiceItemOK) SetPayload(payload *ghcmessages.MTOServiceItemSingle) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMTOServiceItemBadRequestCode is the HTTP code returned for type GetMTOServiceItemBadRequest -const GetMTOServiceItemBadRequestCode int = 400 - -/* -GetMTOServiceItemBadRequest The request payload is invalid - -swagger:response getMTOServiceItemBadRequest -*/ -type GetMTOServiceItemBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMTOServiceItemBadRequest creates GetMTOServiceItemBadRequest with default headers values -func NewGetMTOServiceItemBadRequest() *GetMTOServiceItemBadRequest { - - return &GetMTOServiceItemBadRequest{} -} - -// WithPayload adds the payload to the get m t o service item bad request response -func (o *GetMTOServiceItemBadRequest) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item bad request response -func (o *GetMTOServiceItemBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMTOServiceItemUnauthorizedCode is the HTTP code returned for type GetMTOServiceItemUnauthorized -const GetMTOServiceItemUnauthorizedCode int = 401 - -/* -GetMTOServiceItemUnauthorized The request was denied - -swagger:response getMTOServiceItemUnauthorized -*/ -type GetMTOServiceItemUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMTOServiceItemUnauthorized creates GetMTOServiceItemUnauthorized with default headers values -func NewGetMTOServiceItemUnauthorized() *GetMTOServiceItemUnauthorized { - - return &GetMTOServiceItemUnauthorized{} -} - -// WithPayload adds the payload to the get m t o service item unauthorized response -func (o *GetMTOServiceItemUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item unauthorized response -func (o *GetMTOServiceItemUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMTOServiceItemForbiddenCode is the HTTP code returned for type GetMTOServiceItemForbidden -const GetMTOServiceItemForbiddenCode int = 403 - -/* -GetMTOServiceItemForbidden The request was denied - -swagger:response getMTOServiceItemForbidden -*/ -type GetMTOServiceItemForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMTOServiceItemForbidden creates GetMTOServiceItemForbidden with default headers values -func NewGetMTOServiceItemForbidden() *GetMTOServiceItemForbidden { - - return &GetMTOServiceItemForbidden{} -} - -// WithPayload adds the payload to the get m t o service item forbidden response -func (o *GetMTOServiceItemForbidden) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item forbidden response -func (o *GetMTOServiceItemForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMTOServiceItemNotFoundCode is the HTTP code returned for type GetMTOServiceItemNotFound -const GetMTOServiceItemNotFoundCode int = 404 - -/* -GetMTOServiceItemNotFound The requested resource wasn't found - -swagger:response getMTOServiceItemNotFound -*/ -type GetMTOServiceItemNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMTOServiceItemNotFound creates GetMTOServiceItemNotFound with default headers values -func NewGetMTOServiceItemNotFound() *GetMTOServiceItemNotFound { - - return &GetMTOServiceItemNotFound{} -} - -// WithPayload adds the payload to the get m t o service item not found response -func (o *GetMTOServiceItemNotFound) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item not found response -func (o *GetMTOServiceItemNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMTOServiceItemInternalServerErrorCode is the HTTP code returned for type GetMTOServiceItemInternalServerError -const GetMTOServiceItemInternalServerErrorCode int = 500 - -/* -GetMTOServiceItemInternalServerError A server error occurred - -swagger:response getMTOServiceItemInternalServerError -*/ -type GetMTOServiceItemInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMTOServiceItemInternalServerError creates GetMTOServiceItemInternalServerError with default headers values -func NewGetMTOServiceItemInternalServerError() *GetMTOServiceItemInternalServerError { - - return &GetMTOServiceItemInternalServerError{} -} - -// WithPayload adds the payload to the get m t o service item internal server error response -func (o *GetMTOServiceItemInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get m t o service item internal server error response -func (o *GetMTOServiceItemInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go deleted file mode 100644 index 99feb3d4f2b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMTOServiceItemURL generates an URL for the get m t o service item operation -type GetMTOServiceItemURL struct { - MoveTaskOrderID string - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMTOServiceItemURL) WithBasePath(bp string) *GetMTOServiceItemURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMTOServiceItemURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMTOServiceItemURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on GetMTOServiceItemURL") - } - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on GetMTOServiceItemURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMTOServiceItemURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMTOServiceItemURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMTOServiceItemURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMTOServiceItemURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go deleted file mode 100644 index 7b08257233a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMTOServiceItemsHandlerFunc turns a function with the right signature into a list m t o service items handler -type ListMTOServiceItemsHandlerFunc func(ListMTOServiceItemsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMTOServiceItemsHandlerFunc) Handle(params ListMTOServiceItemsParams) middleware.Responder { - return fn(params) -} - -// ListMTOServiceItemsHandler interface for that can handle valid list m t o service items params -type ListMTOServiceItemsHandler interface { - Handle(ListMTOServiceItemsParams) middleware.Responder -} - -// NewListMTOServiceItems creates a new http.Handler for the list m t o service items operation -func NewListMTOServiceItems(ctx *middleware.Context, handler ListMTOServiceItemsHandler) *ListMTOServiceItems { - return &ListMTOServiceItems{Context: ctx, Handler: handler} -} - -/* - ListMTOServiceItems swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_service_items mtoServiceItem listMTOServiceItems - -# Gets all line items for a move - -Gets all line items for a move -*/ -type ListMTOServiceItems struct { - Context *middleware.Context - Handler ListMTOServiceItemsHandler -} - -func (o *ListMTOServiceItems) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMTOServiceItemsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go deleted file mode 100644 index 72dbb94fac3..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewListMTOServiceItemsParams creates a new ListMTOServiceItemsParams object -// -// There are no default values defined in the spec. -func NewListMTOServiceItemsParams() ListMTOServiceItemsParams { - - return ListMTOServiceItemsParams{} -} - -// ListMTOServiceItemsParams contains all the bound params for the list m t o service items operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMTOServiceItems -type ListMTOServiceItemsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move for mto service item to use - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMTOServiceItemsParams() beforehand. -func (o *ListMTOServiceItemsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *ListMTOServiceItemsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *ListMTOServiceItemsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go deleted file mode 100644 index f70a9d5e887..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ListMTOServiceItemsOKCode is the HTTP code returned for type ListMTOServiceItemsOK -const ListMTOServiceItemsOKCode int = 200 - -/* -ListMTOServiceItemsOK Successfully retrieved all line items for a move task order - -swagger:response listMTOServiceItemsOK -*/ -type ListMTOServiceItemsOK struct { - - /* - In: Body - */ - Payload ghcmessages.MTOServiceItems `json:"body,omitempty"` -} - -// NewListMTOServiceItemsOK creates ListMTOServiceItemsOK with default headers values -func NewListMTOServiceItemsOK() *ListMTOServiceItemsOK { - - return &ListMTOServiceItemsOK{} -} - -// WithPayload adds the payload to the list m t o service items o k response -func (o *ListMTOServiceItemsOK) WithPayload(payload ghcmessages.MTOServiceItems) *ListMTOServiceItemsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o service items o k response -func (o *ListMTOServiceItemsOK) SetPayload(payload ghcmessages.MTOServiceItems) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOServiceItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.MTOServiceItems{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMTOServiceItemsNotFoundCode is the HTTP code returned for type ListMTOServiceItemsNotFound -const ListMTOServiceItemsNotFoundCode int = 404 - -/* -ListMTOServiceItemsNotFound The requested resource wasn't found - -swagger:response listMTOServiceItemsNotFound -*/ -type ListMTOServiceItemsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListMTOServiceItemsNotFound creates ListMTOServiceItemsNotFound with default headers values -func NewListMTOServiceItemsNotFound() *ListMTOServiceItemsNotFound { - - return &ListMTOServiceItemsNotFound{} -} - -// WithPayload adds the payload to the list m t o service items not found response -func (o *ListMTOServiceItemsNotFound) WithPayload(payload *ghcmessages.Error) *ListMTOServiceItemsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o service items not found response -func (o *ListMTOServiceItemsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOServiceItemsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOServiceItemsUnprocessableEntityCode is the HTTP code returned for type ListMTOServiceItemsUnprocessableEntity -const ListMTOServiceItemsUnprocessableEntityCode int = 422 - -/* -ListMTOServiceItemsUnprocessableEntity The payload was unprocessable. - -swagger:response listMTOServiceItemsUnprocessableEntity -*/ -type ListMTOServiceItemsUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewListMTOServiceItemsUnprocessableEntity creates ListMTOServiceItemsUnprocessableEntity with default headers values -func NewListMTOServiceItemsUnprocessableEntity() *ListMTOServiceItemsUnprocessableEntity { - - return &ListMTOServiceItemsUnprocessableEntity{} -} - -// WithPayload adds the payload to the list m t o service items unprocessable entity response -func (o *ListMTOServiceItemsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ListMTOServiceItemsUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o service items unprocessable entity response -func (o *ListMTOServiceItemsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOServiceItemsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOServiceItemsInternalServerErrorCode is the HTTP code returned for type ListMTOServiceItemsInternalServerError -const ListMTOServiceItemsInternalServerErrorCode int = 500 - -/* -ListMTOServiceItemsInternalServerError A server error occurred - -swagger:response listMTOServiceItemsInternalServerError -*/ -type ListMTOServiceItemsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListMTOServiceItemsInternalServerError creates ListMTOServiceItemsInternalServerError with default headers values -func NewListMTOServiceItemsInternalServerError() *ListMTOServiceItemsInternalServerError { - - return &ListMTOServiceItemsInternalServerError{} -} - -// WithPayload adds the payload to the list m t o service items internal server error response -func (o *ListMTOServiceItemsInternalServerError) WithPayload(payload *ghcmessages.Error) *ListMTOServiceItemsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o service items internal server error response -func (o *ListMTOServiceItemsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOServiceItemsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go deleted file mode 100644 index 42361b94613..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ListMTOServiceItemsURL generates an URL for the list m t o service items operation -type ListMTOServiceItemsURL struct { - MoveTaskOrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOServiceItemsURL) WithBasePath(bp string) *ListMTOServiceItemsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOServiceItemsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMTOServiceItemsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_task_orders/{moveTaskOrderID}/mto_service_items" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on ListMTOServiceItemsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMTOServiceItemsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMTOServiceItemsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMTOServiceItemsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMTOServiceItemsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMTOServiceItemsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMTOServiceItemsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go deleted file mode 100644 index fd15c76b0db..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOServiceItemStatusHandlerFunc turns a function with the right signature into a update m t o service item status handler -type UpdateMTOServiceItemStatusHandlerFunc func(UpdateMTOServiceItemStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOServiceItemStatusHandlerFunc) Handle(params UpdateMTOServiceItemStatusParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOServiceItemStatusHandler interface for that can handle valid update m t o service item status params -type UpdateMTOServiceItemStatusHandler interface { - Handle(UpdateMTOServiceItemStatusParams) middleware.Responder -} - -// NewUpdateMTOServiceItemStatus creates a new http.Handler for the update m t o service item status operation -func NewUpdateMTOServiceItemStatus(ctx *middleware.Context, handler UpdateMTOServiceItemStatusHandler) *UpdateMTOServiceItemStatus { - return &UpdateMTOServiceItemStatus{Context: ctx, Handler: handler} -} - -/* - UpdateMTOServiceItemStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status mtoServiceItem updateMTOServiceItemStatus - -# Change the status of a line item for a move by ID - -Changes the status of a line item for a move by ID -*/ -type UpdateMTOServiceItemStatus struct { - Context *middleware.Context - Handler UpdateMTOServiceItemStatusHandler -} - -func (o *UpdateMTOServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOServiceItemStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go deleted file mode 100644 index dad712808c0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOServiceItemStatusParams() UpdateMTOServiceItemStatusParams { - - return UpdateMTOServiceItemStatusParams{} -} - -// UpdateMTOServiceItemStatusParams contains all the bound params for the update m t o service item status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOServiceItemStatus -type UpdateMTOServiceItemStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.PatchMTOServiceItemStatusPayload - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string - /*ID of line item to use - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemStatusParams() beforehand. -func (o *UpdateMTOServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.PatchMTOServiceItemStatusPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMTOServiceItemStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *UpdateMTOServiceItemStatusParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go deleted file mode 100644 index 1122fd66480..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMTOServiceItemStatusOKCode is the HTTP code returned for type UpdateMTOServiceItemStatusOK -const UpdateMTOServiceItemStatusOKCode int = 200 - -/* -UpdateMTOServiceItemStatusOK Successfully updated status for a line item for a move task order by ID - -swagger:response updateMTOServiceItemStatusOK -*/ -type UpdateMTOServiceItemStatusOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOServiceItem `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusOK creates UpdateMTOServiceItemStatusOK with default headers values -func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { - - return &UpdateMTOServiceItemStatusOK{} -} - -// WithPayload adds the payload to the update m t o service item status o k response -func (o *UpdateMTOServiceItemStatusOK) WithPayload(payload *ghcmessages.MTOServiceItem) *UpdateMTOServiceItemStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status o k response -func (o *UpdateMTOServiceItemStatusOK) SetPayload(payload *ghcmessages.MTOServiceItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemStatusBadRequest -const UpdateMTOServiceItemStatusBadRequestCode int = 400 - -/* -UpdateMTOServiceItemStatusBadRequest The request payload is invalid - -swagger:response updateMTOServiceItemStatusBadRequest -*/ -type UpdateMTOServiceItemStatusBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusBadRequest creates UpdateMTOServiceItemStatusBadRequest with default headers values -func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { - - return &UpdateMTOServiceItemStatusBadRequest{} -} - -// WithPayload adds the payload to the update m t o service item status bad request response -func (o *UpdateMTOServiceItemStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status bad request response -func (o *UpdateMTOServiceItemStatusBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnauthorized -const UpdateMTOServiceItemStatusUnauthorizedCode int = 401 - -/* -UpdateMTOServiceItemStatusUnauthorized The request was denied - -swagger:response updateMTOServiceItemStatusUnauthorized -*/ -type UpdateMTOServiceItemStatusUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusUnauthorized creates UpdateMTOServiceItemStatusUnauthorized with default headers values -func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { - - return &UpdateMTOServiceItemStatusUnauthorized{} -} - -// WithPayload adds the payload to the update m t o service item status unauthorized response -func (o *UpdateMTOServiceItemStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status unauthorized response -func (o *UpdateMTOServiceItemStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemStatusForbidden -const UpdateMTOServiceItemStatusForbiddenCode int = 403 - -/* -UpdateMTOServiceItemStatusForbidden The request was denied - -swagger:response updateMTOServiceItemStatusForbidden -*/ -type UpdateMTOServiceItemStatusForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusForbidden creates UpdateMTOServiceItemStatusForbidden with default headers values -func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { - - return &UpdateMTOServiceItemStatusForbidden{} -} - -// WithPayload adds the payload to the update m t o service item status forbidden response -func (o *UpdateMTOServiceItemStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status forbidden response -func (o *UpdateMTOServiceItemStatusForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemStatusNotFound -const UpdateMTOServiceItemStatusNotFoundCode int = 404 - -/* -UpdateMTOServiceItemStatusNotFound The requested resource wasn't found - -swagger:response updateMTOServiceItemStatusNotFound -*/ -type UpdateMTOServiceItemStatusNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusNotFound creates UpdateMTOServiceItemStatusNotFound with default headers values -func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { - - return &UpdateMTOServiceItemStatusNotFound{} -} - -// WithPayload adds the payload to the update m t o service item status not found response -func (o *UpdateMTOServiceItemStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status not found response -func (o *UpdateMTOServiceItemStatusNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemStatusPreconditionFailed -const UpdateMTOServiceItemStatusPreconditionFailedCode int = 412 - -/* -UpdateMTOServiceItemStatusPreconditionFailed Precondition failed - -swagger:response updateMTOServiceItemStatusPreconditionFailed -*/ -type UpdateMTOServiceItemStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusPreconditionFailed creates UpdateMTOServiceItemStatusPreconditionFailed with default headers values -func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { - - return &UpdateMTOServiceItemStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o service item status precondition failed response -func (o *UpdateMTOServiceItemStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status precondition failed response -func (o *UpdateMTOServiceItemStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnprocessableEntity -const UpdateMTOServiceItemStatusUnprocessableEntityCode int = 422 - -/* -UpdateMTOServiceItemStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOServiceItemStatusUnprocessableEntity -*/ -type UpdateMTOServiceItemStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusUnprocessableEntity creates UpdateMTOServiceItemStatusUnprocessableEntity with default headers values -func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { - - return &UpdateMTOServiceItemStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o service item status unprocessable entity response -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOServiceItemStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status unprocessable entity response -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemStatusInternalServerError -const UpdateMTOServiceItemStatusInternalServerErrorCode int = 500 - -/* -UpdateMTOServiceItemStatusInternalServerError A server error occurred - -swagger:response updateMTOServiceItemStatusInternalServerError -*/ -type UpdateMTOServiceItemStatusInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusInternalServerError creates UpdateMTOServiceItemStatusInternalServerError with default headers values -func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { - - return &UpdateMTOServiceItemStatusInternalServerError{} -} - -// WithPayload adds the payload to the update m t o service item status internal server error response -func (o *UpdateMTOServiceItemStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status internal server error response -func (o *UpdateMTOServiceItemStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go deleted file mode 100644 index 76f339c1d6c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOServiceItemStatusURL generates an URL for the update m t o service item status operation -type UpdateMTOServiceItemStatusURL struct { - MoveTaskOrderID string - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemStatusURL) WithBasePath(bp string) *UpdateMTOServiceItemStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOServiceItemStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMTOServiceItemStatusURL") - } - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOServiceItemStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOServiceItemStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOServiceItemStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go deleted file mode 100644 index d352fc5934f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServiceItemSitEntryDateHandlerFunc turns a function with the right signature into a update service item sit entry date handler -type UpdateServiceItemSitEntryDateHandlerFunc func(UpdateServiceItemSitEntryDateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServiceItemSitEntryDateHandlerFunc) Handle(params UpdateServiceItemSitEntryDateParams) middleware.Responder { - return fn(params) -} - -// UpdateServiceItemSitEntryDateHandler interface for that can handle valid update service item sit entry date params -type UpdateServiceItemSitEntryDateHandler interface { - Handle(UpdateServiceItemSitEntryDateParams) middleware.Responder -} - -// NewUpdateServiceItemSitEntryDate creates a new http.Handler for the update service item sit entry date operation -func NewUpdateServiceItemSitEntryDate(ctx *middleware.Context, handler UpdateServiceItemSitEntryDateHandler) *UpdateServiceItemSitEntryDate { - return &UpdateServiceItemSitEntryDate{Context: ctx, Handler: handler} -} - -/* - UpdateServiceItemSitEntryDate swagger:route PATCH /service-item/{mtoServiceItemID}/entry-date-update mtoServiceItem updateServiceItemSitEntryDate - -# Updates a service item's SIT entry date by ID - -Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item -*/ -type UpdateServiceItemSitEntryDate struct { - Context *middleware.Context - Handler UpdateServiceItemSitEntryDateHandler -} - -func (o *UpdateServiceItemSitEntryDate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServiceItemSitEntryDateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go deleted file mode 100644 index 96638c0c8df..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateServiceItemSitEntryDateParams creates a new UpdateServiceItemSitEntryDateParams object -// -// There are no default values defined in the spec. -func NewUpdateServiceItemSitEntryDateParams() UpdateServiceItemSitEntryDateParams { - - return UpdateServiceItemSitEntryDateParams{} -} - -// UpdateServiceItemSitEntryDateParams contains all the bound params for the update service item sit entry date operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateServiceItemSitEntryDate -type UpdateServiceItemSitEntryDateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *ghcmessages.ServiceItemSitEntryDate - /*ID of the service item - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServiceItemSitEntryDateParams() beforehand. -func (o *UpdateServiceItemSitEntryDateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.ServiceItemSitEntryDate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *UpdateServiceItemSitEntryDateParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go deleted file mode 100644 index 5f4b6e2a765..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateServiceItemSitEntryDateOKCode is the HTTP code returned for type UpdateServiceItemSitEntryDateOK -const UpdateServiceItemSitEntryDateOKCode int = 200 - -/* -UpdateServiceItemSitEntryDateOK Successfully updated SIT entry date - -swagger:response updateServiceItemSitEntryDateOK -*/ -type UpdateServiceItemSitEntryDateOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOServiceItemSingle `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateOK creates UpdateServiceItemSitEntryDateOK with default headers values -func NewUpdateServiceItemSitEntryDateOK() *UpdateServiceItemSitEntryDateOK { - - return &UpdateServiceItemSitEntryDateOK{} -} - -// WithPayload adds the payload to the update service item sit entry date o k response -func (o *UpdateServiceItemSitEntryDateOK) WithPayload(payload *ghcmessages.MTOServiceItemSingle) *UpdateServiceItemSitEntryDateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date o k response -func (o *UpdateServiceItemSitEntryDateOK) SetPayload(payload *ghcmessages.MTOServiceItemSingle) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateBadRequestCode is the HTTP code returned for type UpdateServiceItemSitEntryDateBadRequest -const UpdateServiceItemSitEntryDateBadRequestCode int = 400 - -/* -UpdateServiceItemSitEntryDateBadRequest The request payload is invalid - -swagger:response updateServiceItemSitEntryDateBadRequest -*/ -type UpdateServiceItemSitEntryDateBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateBadRequest creates UpdateServiceItemSitEntryDateBadRequest with default headers values -func NewUpdateServiceItemSitEntryDateBadRequest() *UpdateServiceItemSitEntryDateBadRequest { - - return &UpdateServiceItemSitEntryDateBadRequest{} -} - -// WithPayload adds the payload to the update service item sit entry date bad request response -func (o *UpdateServiceItemSitEntryDateBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date bad request response -func (o *UpdateServiceItemSitEntryDateBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateUnauthorizedCode is the HTTP code returned for type UpdateServiceItemSitEntryDateUnauthorized -const UpdateServiceItemSitEntryDateUnauthorizedCode int = 401 - -/* -UpdateServiceItemSitEntryDateUnauthorized The request was denied - -swagger:response updateServiceItemSitEntryDateUnauthorized -*/ -type UpdateServiceItemSitEntryDateUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateUnauthorized creates UpdateServiceItemSitEntryDateUnauthorized with default headers values -func NewUpdateServiceItemSitEntryDateUnauthorized() *UpdateServiceItemSitEntryDateUnauthorized { - - return &UpdateServiceItemSitEntryDateUnauthorized{} -} - -// WithPayload adds the payload to the update service item sit entry date unauthorized response -func (o *UpdateServiceItemSitEntryDateUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date unauthorized response -func (o *UpdateServiceItemSitEntryDateUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateForbiddenCode is the HTTP code returned for type UpdateServiceItemSitEntryDateForbidden -const UpdateServiceItemSitEntryDateForbiddenCode int = 403 - -/* -UpdateServiceItemSitEntryDateForbidden The request was denied - -swagger:response updateServiceItemSitEntryDateForbidden -*/ -type UpdateServiceItemSitEntryDateForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateForbidden creates UpdateServiceItemSitEntryDateForbidden with default headers values -func NewUpdateServiceItemSitEntryDateForbidden() *UpdateServiceItemSitEntryDateForbidden { - - return &UpdateServiceItemSitEntryDateForbidden{} -} - -// WithPayload adds the payload to the update service item sit entry date forbidden response -func (o *UpdateServiceItemSitEntryDateForbidden) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date forbidden response -func (o *UpdateServiceItemSitEntryDateForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateNotFoundCode is the HTTP code returned for type UpdateServiceItemSitEntryDateNotFound -const UpdateServiceItemSitEntryDateNotFoundCode int = 404 - -/* -UpdateServiceItemSitEntryDateNotFound The requested resource wasn't found - -swagger:response updateServiceItemSitEntryDateNotFound -*/ -type UpdateServiceItemSitEntryDateNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateNotFound creates UpdateServiceItemSitEntryDateNotFound with default headers values -func NewUpdateServiceItemSitEntryDateNotFound() *UpdateServiceItemSitEntryDateNotFound { - - return &UpdateServiceItemSitEntryDateNotFound{} -} - -// WithPayload adds the payload to the update service item sit entry date not found response -func (o *UpdateServiceItemSitEntryDateNotFound) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date not found response -func (o *UpdateServiceItemSitEntryDateNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDatePreconditionFailedCode is the HTTP code returned for type UpdateServiceItemSitEntryDatePreconditionFailed -const UpdateServiceItemSitEntryDatePreconditionFailedCode int = 412 - -/* -UpdateServiceItemSitEntryDatePreconditionFailed Precondition failed - -swagger:response updateServiceItemSitEntryDatePreconditionFailed -*/ -type UpdateServiceItemSitEntryDatePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDatePreconditionFailed creates UpdateServiceItemSitEntryDatePreconditionFailed with default headers values -func NewUpdateServiceItemSitEntryDatePreconditionFailed() *UpdateServiceItemSitEntryDatePreconditionFailed { - - return &UpdateServiceItemSitEntryDatePreconditionFailed{} -} - -// WithPayload adds the payload to the update service item sit entry date precondition failed response -func (o *UpdateServiceItemSitEntryDatePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDatePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date precondition failed response -func (o *UpdateServiceItemSitEntryDatePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDatePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateUnprocessableEntityCode is the HTTP code returned for type UpdateServiceItemSitEntryDateUnprocessableEntity -const UpdateServiceItemSitEntryDateUnprocessableEntityCode int = 422 - -/* -UpdateServiceItemSitEntryDateUnprocessableEntity The payload was unprocessable. - -swagger:response updateServiceItemSitEntryDateUnprocessableEntity -*/ -type UpdateServiceItemSitEntryDateUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateUnprocessableEntity creates UpdateServiceItemSitEntryDateUnprocessableEntity with default headers values -func NewUpdateServiceItemSitEntryDateUnprocessableEntity() *UpdateServiceItemSitEntryDateUnprocessableEntity { - - return &UpdateServiceItemSitEntryDateUnprocessableEntity{} -} - -// WithPayload adds the payload to the update service item sit entry date unprocessable entity response -func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateServiceItemSitEntryDateUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date unprocessable entity response -func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceItemSitEntryDateInternalServerErrorCode is the HTTP code returned for type UpdateServiceItemSitEntryDateInternalServerError -const UpdateServiceItemSitEntryDateInternalServerErrorCode int = 500 - -/* -UpdateServiceItemSitEntryDateInternalServerError A server error occurred - -swagger:response updateServiceItemSitEntryDateInternalServerError -*/ -type UpdateServiceItemSitEntryDateInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateServiceItemSitEntryDateInternalServerError creates UpdateServiceItemSitEntryDateInternalServerError with default headers values -func NewUpdateServiceItemSitEntryDateInternalServerError() *UpdateServiceItemSitEntryDateInternalServerError { - - return &UpdateServiceItemSitEntryDateInternalServerError{} -} - -// WithPayload adds the payload to the update service item sit entry date internal server error response -func (o *UpdateServiceItemSitEntryDateInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service item sit entry date internal server error response -func (o *UpdateServiceItemSitEntryDateInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceItemSitEntryDateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go deleted file mode 100644 index 2a477f33ee4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateServiceItemSitEntryDateURL generates an URL for the update service item sit entry date operation -type UpdateServiceItemSitEntryDateURL struct { - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceItemSitEntryDateURL) WithBasePath(bp string) *UpdateServiceItemSitEntryDateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceItemSitEntryDateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServiceItemSitEntryDateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service-item/{mtoServiceItemID}/entry-date-update" - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on UpdateServiceItemSitEntryDateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServiceItemSitEntryDateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServiceItemSitEntryDateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServiceItemSitEntryDateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServiceItemSitEntryDateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServiceItemSitEntryDateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServiceItemSitEntryDateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go deleted file mode 100644 index b701c9cbcb8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler -type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params -type CreateMTOShipmentHandler interface { - Handle(CreateMTOShipmentParams) middleware.Responder -} - -// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation -func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { - return &CreateMTOShipment{Context: ctx, Handler: handler} -} - -/* - CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment - -createMTOShipment - -Creates a MTO shipment for the specified Move Task Order. -Required fields include: -* Shipment Type -* Customer requested pick-up date -* Pick-up Address -* Delivery Address -* Releasing / Receiving agents -Optional fields include: -* Delivery Address Type -* Customer Remarks -* Releasing / Receiving agents -* An array of optional accessorial service item codes -*/ -type CreateMTOShipment struct { - Context *middleware.Context - Handler CreateMTOShipmentHandler -} - -func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index d3f2997df76..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOShipmentParams() CreateMTOShipmentParams { - - return CreateMTOShipmentParams{} -} - -// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOShipment -type CreateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.CreateMTOShipment -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. -func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateMTOShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index e09e9ec4c5d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK -const CreateMTOShipmentOKCode int = 200 - -/* -CreateMTOShipmentOK Successfully created a MTO shipment. - -swagger:response createMTOShipmentOK -*/ -type CreateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - - return &CreateMTOShipmentOK{} -} - -// WithPayload adds the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *CreateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest -const CreateMTOShipmentBadRequestCode int = 400 - -/* -CreateMTOShipmentBadRequest The request payload is invalid - -swagger:response createMTOShipmentBadRequest -*/ -type CreateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - - return &CreateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound -const CreateMTOShipmentNotFoundCode int = 404 - -/* -CreateMTOShipmentNotFound The requested resource wasn't found - -swagger:response createMTOShipmentNotFound -*/ -type CreateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - - return &CreateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity -const CreateMTOShipmentUnprocessableEntityCode int = 422 - -/* -CreateMTOShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response createMTOShipmentUnprocessableEntity -*/ -type CreateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - - return &CreateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError -const CreateMTOShipmentInternalServerErrorCode int = 500 - -/* -CreateMTOShipmentInternalServerError A server error occurred - -swagger:response createMTOShipmentInternalServerError -*/ -type CreateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - - return &CreateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index 80a0cf279e6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOShipmentURL generates an URL for the create m t o shipment operation -type CreateMTOShipmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go deleted file mode 100644 index eb07dd54847..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetShipmentHandlerFunc turns a function with the right signature into a get shipment handler -type GetShipmentHandlerFunc func(GetShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetShipmentHandlerFunc) Handle(params GetShipmentParams) middleware.Responder { - return fn(params) -} - -// GetShipmentHandler interface for that can handle valid get shipment params -type GetShipmentHandler interface { - Handle(GetShipmentParams) middleware.Responder -} - -// NewGetShipment creates a new http.Handler for the get shipment operation -func NewGetShipment(ctx *middleware.Context, handler GetShipmentHandler) *GetShipment { - return &GetShipment{Context: ctx, Handler: handler} -} - -/* - GetShipment swagger:route GET /shipments/{shipmentID} mtoShipment getShipment - -fetches a shipment by ID - -fetches a shipment by ID -*/ -type GetShipment struct { - Context *middleware.Context - Handler GetShipmentHandler -} - -func (o *GetShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go deleted file mode 100644 index 39b7f921314..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetShipmentParams creates a new GetShipmentParams object -// -// There are no default values defined in the spec. -func NewGetShipmentParams() GetShipmentParams { - - return GetShipmentParams{} -} - -// GetShipmentParams contains all the bound params for the get shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters getShipment -type GetShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the shipment to be fetched - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetShipmentParams() beforehand. -func (o *GetShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *GetShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *GetShipmentParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go deleted file mode 100644 index 3105d2a6409..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetShipmentOKCode is the HTTP code returned for type GetShipmentOK -const GetShipmentOKCode int = 200 - -/* -GetShipmentOK Successfully fetched the shipment - -swagger:response getShipmentOK -*/ -type GetShipmentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewGetShipmentOK creates GetShipmentOK with default headers values -func NewGetShipmentOK() *GetShipmentOK { - - return &GetShipmentOK{} -} - -// WithPayload adds the payload to the get shipment o k response -func (o *GetShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *GetShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment o k response -func (o *GetShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentBadRequestCode is the HTTP code returned for type GetShipmentBadRequest -const GetShipmentBadRequestCode int = 400 - -/* -GetShipmentBadRequest The request payload is invalid - -swagger:response getShipmentBadRequest -*/ -type GetShipmentBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentBadRequest creates GetShipmentBadRequest with default headers values -func NewGetShipmentBadRequest() *GetShipmentBadRequest { - - return &GetShipmentBadRequest{} -} - -// WithPayload adds the payload to the get shipment bad request response -func (o *GetShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *GetShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment bad request response -func (o *GetShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentForbiddenCode is the HTTP code returned for type GetShipmentForbidden -const GetShipmentForbiddenCode int = 403 - -/* -GetShipmentForbidden The request was denied - -swagger:response getShipmentForbidden -*/ -type GetShipmentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentForbidden creates GetShipmentForbidden with default headers values -func NewGetShipmentForbidden() *GetShipmentForbidden { - - return &GetShipmentForbidden{} -} - -// WithPayload adds the payload to the get shipment forbidden response -func (o *GetShipmentForbidden) WithPayload(payload *ghcmessages.Error) *GetShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment forbidden response -func (o *GetShipmentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentNotFoundCode is the HTTP code returned for type GetShipmentNotFound -const GetShipmentNotFoundCode int = 404 - -/* -GetShipmentNotFound The requested resource wasn't found - -swagger:response getShipmentNotFound -*/ -type GetShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentNotFound creates GetShipmentNotFound with default headers values -func NewGetShipmentNotFound() *GetShipmentNotFound { - - return &GetShipmentNotFound{} -} - -// WithPayload adds the payload to the get shipment not found response -func (o *GetShipmentNotFound) WithPayload(payload *ghcmessages.Error) *GetShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment not found response -func (o *GetShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentUnprocessableEntityCode is the HTTP code returned for type GetShipmentUnprocessableEntity -const GetShipmentUnprocessableEntityCode int = 422 - -/* -GetShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response getShipmentUnprocessableEntity -*/ -type GetShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetShipmentUnprocessableEntity creates GetShipmentUnprocessableEntity with default headers values -func NewGetShipmentUnprocessableEntity() *GetShipmentUnprocessableEntity { - - return &GetShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the get shipment unprocessable entity response -func (o *GetShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment unprocessable entity response -func (o *GetShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentInternalServerErrorCode is the HTTP code returned for type GetShipmentInternalServerError -const GetShipmentInternalServerErrorCode int = 500 - -/* -GetShipmentInternalServerError A server error occurred - -swagger:response getShipmentInternalServerError -*/ -type GetShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentInternalServerError creates GetShipmentInternalServerError with default headers values -func NewGetShipmentInternalServerError() *GetShipmentInternalServerError { - - return &GetShipmentInternalServerError{} -} - -// WithPayload adds the payload to the get shipment internal server error response -func (o *GetShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *GetShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipment internal server error response -func (o *GetShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go deleted file mode 100644 index 5bcdd735d79..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetShipmentURL generates an URL for the get shipment operation -type GetShipmentURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetShipmentURL) WithBasePath(bp string) *GetShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on GetShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go deleted file mode 100644 index 1d6949747b1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMTOShipmentsHandlerFunc turns a function with the right signature into a list m t o shipments handler -type ListMTOShipmentsHandlerFunc func(ListMTOShipmentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMTOShipmentsHandlerFunc) Handle(params ListMTOShipmentsParams) middleware.Responder { - return fn(params) -} - -// ListMTOShipmentsHandler interface for that can handle valid list m t o shipments params -type ListMTOShipmentsHandler interface { - Handle(ListMTOShipmentsParams) middleware.Responder -} - -// NewListMTOShipments creates a new http.Handler for the list m t o shipments operation -func NewListMTOShipments(ctx *middleware.Context, handler ListMTOShipmentsHandler) *ListMTOShipments { - return &ListMTOShipments{Context: ctx, Handler: handler} -} - -/* - ListMTOShipments swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_shipments mtoShipment listMTOShipments - -# Gets all shipments for a move task order - -Gets all shipments for a move task order -*/ -type ListMTOShipments struct { - Context *middleware.Context - Handler ListMTOShipmentsHandler -} - -func (o *ListMTOShipments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMTOShipmentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go deleted file mode 100644 index e186e4a8796..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewListMTOShipmentsParams creates a new ListMTOShipmentsParams object -// -// There are no default values defined in the spec. -func NewListMTOShipmentsParams() ListMTOShipmentsParams { - - return ListMTOShipmentsParams{} -} - -// ListMTOShipmentsParams contains all the bound params for the list m t o shipments operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMTOShipments -type ListMTOShipmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move task order for mto shipment to use - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMTOShipmentsParams() beforehand. -func (o *ListMTOShipmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *ListMTOShipmentsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *ListMTOShipmentsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go deleted file mode 100644 index 7aaebb34d52..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ListMTOShipmentsOKCode is the HTTP code returned for type ListMTOShipmentsOK -const ListMTOShipmentsOKCode int = 200 - -/* -ListMTOShipmentsOK Successfully retrieved all mto shipments for a move task order - -swagger:response listMTOShipmentsOK -*/ -type ListMTOShipmentsOK struct { - - /* - In: Body - */ - Payload ghcmessages.MTOShipments `json:"body,omitempty"` -} - -// NewListMTOShipmentsOK creates ListMTOShipmentsOK with default headers values -func NewListMTOShipmentsOK() *ListMTOShipmentsOK { - - return &ListMTOShipmentsOK{} -} - -// WithPayload adds the payload to the list m t o shipments o k response -func (o *ListMTOShipmentsOK) WithPayload(payload ghcmessages.MTOShipments) *ListMTOShipmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments o k response -func (o *ListMTOShipmentsOK) SetPayload(payload ghcmessages.MTOShipments) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.MTOShipments{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMTOShipmentsForbiddenCode is the HTTP code returned for type ListMTOShipmentsForbidden -const ListMTOShipmentsForbiddenCode int = 403 - -/* -ListMTOShipmentsForbidden The request was denied - -swagger:response listMTOShipmentsForbidden -*/ -type ListMTOShipmentsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListMTOShipmentsForbidden creates ListMTOShipmentsForbidden with default headers values -func NewListMTOShipmentsForbidden() *ListMTOShipmentsForbidden { - - return &ListMTOShipmentsForbidden{} -} - -// WithPayload adds the payload to the list m t o shipments forbidden response -func (o *ListMTOShipmentsForbidden) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments forbidden response -func (o *ListMTOShipmentsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsNotFoundCode is the HTTP code returned for type ListMTOShipmentsNotFound -const ListMTOShipmentsNotFoundCode int = 404 - -/* -ListMTOShipmentsNotFound The requested resource wasn't found - -swagger:response listMTOShipmentsNotFound -*/ -type ListMTOShipmentsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListMTOShipmentsNotFound creates ListMTOShipmentsNotFound with default headers values -func NewListMTOShipmentsNotFound() *ListMTOShipmentsNotFound { - - return &ListMTOShipmentsNotFound{} -} - -// WithPayload adds the payload to the list m t o shipments not found response -func (o *ListMTOShipmentsNotFound) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments not found response -func (o *ListMTOShipmentsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsUnprocessableEntityCode is the HTTP code returned for type ListMTOShipmentsUnprocessableEntity -const ListMTOShipmentsUnprocessableEntityCode int = 422 - -/* -ListMTOShipmentsUnprocessableEntity The payload was unprocessable. - -swagger:response listMTOShipmentsUnprocessableEntity -*/ -type ListMTOShipmentsUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewListMTOShipmentsUnprocessableEntity creates ListMTOShipmentsUnprocessableEntity with default headers values -func NewListMTOShipmentsUnprocessableEntity() *ListMTOShipmentsUnprocessableEntity { - - return &ListMTOShipmentsUnprocessableEntity{} -} - -// WithPayload adds the payload to the list m t o shipments unprocessable entity response -func (o *ListMTOShipmentsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ListMTOShipmentsUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments unprocessable entity response -func (o *ListMTOShipmentsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsInternalServerErrorCode is the HTTP code returned for type ListMTOShipmentsInternalServerError -const ListMTOShipmentsInternalServerErrorCode int = 500 - -/* -ListMTOShipmentsInternalServerError A server error occurred - -swagger:response listMTOShipmentsInternalServerError -*/ -type ListMTOShipmentsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListMTOShipmentsInternalServerError creates ListMTOShipmentsInternalServerError with default headers values -func NewListMTOShipmentsInternalServerError() *ListMTOShipmentsInternalServerError { - - return &ListMTOShipmentsInternalServerError{} -} - -// WithPayload adds the payload to the list m t o shipments internal server error response -func (o *ListMTOShipmentsInternalServerError) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments internal server error response -func (o *ListMTOShipmentsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go deleted file mode 100644 index 87184b95a9c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ListMTOShipmentsURL generates an URL for the list m t o shipments operation -type ListMTOShipmentsURL struct { - MoveTaskOrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOShipmentsURL) WithBasePath(bp string) *ListMTOShipmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOShipmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMTOShipmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on ListMTOShipmentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMTOShipmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMTOShipmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMTOShipmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMTOShipmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMTOShipmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMTOShipmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go deleted file mode 100644 index eb0db5e29ab..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler -type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params -type UpdateMTOShipmentHandler interface { - Handle(UpdateMTOShipmentParams) middleware.Responder -} - -// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation -func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { - return &UpdateMTOShipment{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipment swagger:route PATCH /move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID} mtoShipment updateMTOShipment - -updateMTOShipment - -Updates a specified MTO shipment. -Required fields include: -* MTO Shipment ID required in path -* If-Match required in headers -* No fields required in body -Optional fields include: -* New shipment status type -* Shipment Type -* Customer requested pick-up date -* Pick-up Address -* Delivery Address -* Secondary Pick-up Address -* SecondaryDelivery Address -* Delivery Address Type -* Customer Remarks -* Counselor Remarks -* Releasing / Receiving agents -* Actual Pro Gear Weight -* Actual Spouse Pro Gear Weight -*/ -type UpdateMTOShipment struct { - Context *middleware.Context - Handler UpdateMTOShipmentHandler -} - -func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index 221db2ce162..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { - - return UpdateMTOShipmentParams{} -} - -// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipment -type UpdateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - In: body - */ - Body *ghcmessages.UpdateShipment - /*ID of move task order for mto shipment to use - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID - /*UUID of the MTO Shipment to update - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. -func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMTOShipmentParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *UpdateMTOShipmentParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *UpdateMTOShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *UpdateMTOShipmentParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 6db7a6650b7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK -const UpdateMTOShipmentOKCode int = 200 - -/* -UpdateMTOShipmentOK Successfully updated the specified MTO shipment. - -swagger:response updateMTOShipmentOK -*/ -type UpdateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - - return &UpdateMTOShipmentOK{} -} - -// WithPayload adds the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *UpdateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest -const UpdateMTOShipmentBadRequestCode int = 400 - -/* -UpdateMTOShipmentBadRequest The request payload is invalid - -swagger:response updateMTOShipmentBadRequest -*/ -type UpdateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - - return &UpdateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized -const UpdateMTOShipmentUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentUnauthorized The request was denied - -swagger:response updateMTOShipmentUnauthorized -*/ -type UpdateMTOShipmentUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - - return &UpdateMTOShipmentUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden -const UpdateMTOShipmentForbiddenCode int = 403 - -/* -UpdateMTOShipmentForbidden The request was denied - -swagger:response updateMTOShipmentForbidden -*/ -type UpdateMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - - return &UpdateMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound -const UpdateMTOShipmentNotFoundCode int = 404 - -/* -UpdateMTOShipmentNotFound The requested resource wasn't found - -swagger:response updateMTOShipmentNotFound -*/ -type UpdateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - - return &UpdateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed -const UpdateMTOShipmentPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentPreconditionFailed Precondition failed - -swagger:response updateMTOShipmentPreconditionFailed -*/ -type UpdateMTOShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - - return &UpdateMTOShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity -const UpdateMTOShipmentUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOShipmentUnprocessableEntity -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - - return &UpdateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError -const UpdateMTOShipmentInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentInternalServerError A server error occurred - -swagger:response updateMTOShipmentInternalServerError -*/ -type UpdateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - - return &UpdateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index 5b05a62e80a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation -type UpdateMTOShipmentURL struct { - MoveTaskOrderID strfmt.UUID - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMTOShipmentURL") - } - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on UpdateMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go deleted file mode 100644 index e64a6704256..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ /dev/null @@ -1,1622 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcoperations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/addresses" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/application_parameters" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/calendar" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer_support_remarks" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/evaluation_reports" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ghc_documents" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/lines_of_accounting" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_agent" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/office_users" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/order" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_requests" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_service_item" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ppm" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/pws_violations" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/queues" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/re_service_items" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/report_violations" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/shipment" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/tac" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/transportation_office" - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/uploads" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - MultipartformConsumer: runtime.DiscardConsumer, - - BinProducer: runtime.ByteStreamProducer(), - JSONProducer: runtime.JSONProducer(), - - OrderAcknowledgeExcessWeightRiskHandler: order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder { - return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented") - }), - EvaluationReportsAddAppealToSeriousIncidentHandler: evaluation_reports.AddAppealToSeriousIncidentHandlerFunc(func(params evaluation_reports.AddAppealToSeriousIncidentParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.AddAppealToSeriousIncident has not yet been implemented") - }), - EvaluationReportsAddAppealToViolationHandler: evaluation_reports.AddAppealToViolationHandlerFunc(func(params evaluation_reports.AddAppealToViolationParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.AddAppealToViolation has not yet been implemented") - }), - ShipmentApproveSITExtensionHandler: shipment.ApproveSITExtensionHandlerFunc(func(params shipment.ApproveSITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveSITExtension has not yet been implemented") - }), - ShipmentApproveShipmentHandler: shipment.ApproveShipmentHandlerFunc(func(params shipment.ApproveShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveShipment has not yet been implemented") - }), - ShipmentApproveShipmentDiversionHandler: shipment.ApproveShipmentDiversionHandlerFunc(func(params shipment.ApproveShipmentDiversionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") - }), - ReportViolationsAssociateReportViolationsHandler: report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { - return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") - }), - PaymentRequestsBulkDownloadHandler: payment_requests.BulkDownloadHandlerFunc(func(params payment_requests.BulkDownloadParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.BulkDownload has not yet been implemented") - }), - MoveCheckForLockedMovesAndUnlockHandler: move.CheckForLockedMovesAndUnlockHandlerFunc(func(params move.CheckForLockedMovesAndUnlockParams) middleware.Responder { - return middleware.NotImplemented("operation move.CheckForLockedMovesAndUnlock has not yet been implemented") - }), - OrderCounselingUpdateAllowanceHandler: order.CounselingUpdateAllowanceHandlerFunc(func(params order.CounselingUpdateAllowanceParams) middleware.Responder { - return middleware.NotImplemented("operation order.CounselingUpdateAllowance has not yet been implemented") - }), - OrderCounselingUpdateOrderHandler: order.CounselingUpdateOrderHandlerFunc(func(params order.CounselingUpdateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.CounselingUpdateOrder has not yet been implemented") - }), - ShipmentCreateApprovedSITDurationUpdateHandler: shipment.CreateApprovedSITDurationUpdateHandlerFunc(func(params shipment.CreateApprovedSITDurationUpdateParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.CreateApprovedSITDurationUpdate has not yet been implemented") - }), - CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler: customer_support_remarks.CreateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.CreateCustomerSupportRemarkForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.CreateCustomerSupportRemarkForMove has not yet been implemented") - }), - CustomerCreateCustomerWithOktaOptionHandler: customer.CreateCustomerWithOktaOptionHandlerFunc(func(params customer.CreateCustomerWithOktaOptionParams) middleware.Responder { - return middleware.NotImplemented("operation customer.CreateCustomerWithOktaOption has not yet been implemented") - }), - GhcDocumentsCreateDocumentHandler: ghc_documents.CreateDocumentHandlerFunc(func(params ghc_documents.CreateDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation ghc_documents.CreateDocument has not yet been implemented") - }), - EvaluationReportsCreateEvaluationReportHandler: evaluation_reports.CreateEvaluationReportHandlerFunc(func(params evaluation_reports.CreateEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.CreateEvaluationReport has not yet been implemented") - }), - MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }), - OrderCreateOrderHandler: order.CreateOrderHandlerFunc(func(params order.CreateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.CreateOrder has not yet been implemented") - }), - OfficeUsersCreateRequestedOfficeUserHandler: office_users.CreateRequestedOfficeUserHandlerFunc(func(params office_users.CreateRequestedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation office_users.CreateRequestedOfficeUser has not yet been implemented") - }), - UploadsCreateUploadHandler: uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") - }), - MoveDeleteAssignedOfficeUserHandler: move.DeleteAssignedOfficeUserHandlerFunc(func(params move.DeleteAssignedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation move.DeleteAssignedOfficeUser has not yet been implemented") - }), - CustomerSupportRemarksDeleteCustomerSupportRemarkHandler: customer_support_remarks.DeleteCustomerSupportRemarkHandlerFunc(func(params customer_support_remarks.DeleteCustomerSupportRemarkParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.DeleteCustomerSupportRemark has not yet been implemented") - }), - EvaluationReportsDeleteEvaluationReportHandler: evaluation_reports.DeleteEvaluationReportHandlerFunc(func(params evaluation_reports.DeleteEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.DeleteEvaluationReport has not yet been implemented") - }), - ShipmentDeleteShipmentHandler: shipment.DeleteShipmentHandlerFunc(func(params shipment.DeleteShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.DeleteShipment has not yet been implemented") - }), - UploadsDeleteUploadHandler: uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") - }), - ShipmentDenySITExtensionHandler: shipment.DenySITExtensionHandlerFunc(func(params shipment.DenySITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.DenySITExtension has not yet been implemented") - }), - EvaluationReportsDownloadEvaluationReportHandler: evaluation_reports.DownloadEvaluationReportHandlerFunc(func(params evaluation_reports.DownloadEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.DownloadEvaluationReport has not yet been implemented") - }), - MtoAgentFetchMTOAgentListHandler: mto_agent.FetchMTOAgentListHandlerFunc(func(params mto_agent.FetchMTOAgentListParams) middleware.Responder { - return middleware.NotImplemented("operation mto_agent.FetchMTOAgentList has not yet been implemented") - }), - PpmFinishDocumentReviewHandler: ppm.FinishDocumentReviewHandlerFunc(func(params ppm.FinishDocumentReviewParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.FinishDocumentReview has not yet been implemented") - }), - ReServiceItemsGetAllReServiceItemsHandler: re_service_items.GetAllReServiceItemsHandlerFunc(func(params re_service_items.GetAllReServiceItemsParams) middleware.Responder { - return middleware.NotImplemented("operation re_service_items.GetAllReServiceItems has not yet been implemented") - }), - QueuesGetBulkAssignmentDataHandler: queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") - }), - CustomerGetCustomerHandler: customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { - return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") - }), - CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler: customer_support_remarks.GetCustomerSupportRemarksForMoveHandlerFunc(func(params customer_support_remarks.GetCustomerSupportRemarksForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.GetCustomerSupportRemarksForMove has not yet been implemented") - }), - GhcDocumentsGetDocumentHandler: ghc_documents.GetDocumentHandlerFunc(func(params ghc_documents.GetDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation ghc_documents.GetDocument has not yet been implemented") - }), - MoveTaskOrderGetEntitlementsHandler: move_task_order.GetEntitlementsHandlerFunc(func(params move_task_order.GetEntitlementsParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetEntitlements has not yet been implemented") - }), - EvaluationReportsGetEvaluationReportHandler: evaluation_reports.GetEvaluationReportHandlerFunc(func(params evaluation_reports.GetEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.GetEvaluationReport has not yet been implemented") - }), - AddressesGetLocationByZipCityStateHandler: addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") - }), - MtoServiceItemGetMTOServiceItemHandler: mto_service_item.GetMTOServiceItemHandlerFunc(func(params mto_service_item.GetMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.GetMTOServiceItem has not yet been implemented") - }), - MoveGetMoveHandler: move.GetMoveHandlerFunc(func(params move.GetMoveParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMove has not yet been implemented") - }), - MoveGetMoveCounselingEvaluationReportsListHandler: move.GetMoveCounselingEvaluationReportsListHandlerFunc(func(params move.GetMoveCounselingEvaluationReportsListParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveCounselingEvaluationReportsList has not yet been implemented") - }), - MoveGetMoveHistoryHandler: move.GetMoveHistoryHandlerFunc(func(params move.GetMoveHistoryParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveHistory has not yet been implemented") - }), - MoveGetMoveShipmentEvaluationReportsListHandler: move.GetMoveShipmentEvaluationReportsListHandlerFunc(func(params move.GetMoveShipmentEvaluationReportsListParams) middleware.Responder { - return middleware.NotImplemented("operation move.GetMoveShipmentEvaluationReportsList has not yet been implemented") - }), - MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }), - QueuesGetMovesQueueHandler: queues.GetMovesQueueHandlerFunc(func(params queues.GetMovesQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetMovesQueue has not yet been implemented") - }), - OrderGetOrderHandler: order.GetOrderHandlerFunc(func(params order.GetOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.GetOrder has not yet been implemented") - }), - PpmGetPPMActualWeightHandler: ppm.GetPPMActualWeightHandlerFunc(func(params ppm.GetPPMActualWeightParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMActualWeight has not yet been implemented") - }), - PpmGetPPMCloseoutHandler: ppm.GetPPMCloseoutHandlerFunc(func(params ppm.GetPPMCloseoutParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMCloseout has not yet been implemented") - }), - PpmGetPPMDocumentsHandler: ppm.GetPPMDocumentsHandlerFunc(func(params ppm.GetPPMDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMDocuments has not yet been implemented") - }), - PpmGetPPMSITEstimatedCostHandler: ppm.GetPPMSITEstimatedCostHandlerFunc(func(params ppm.GetPPMSITEstimatedCostParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.GetPPMSITEstimatedCost has not yet been implemented") - }), - PwsViolationsGetPWSViolationsHandler: pws_violations.GetPWSViolationsHandlerFunc(func(params pws_violations.GetPWSViolationsParams) middleware.Responder { - return middleware.NotImplemented("operation pws_violations.GetPWSViolations has not yet been implemented") - }), - ApplicationParametersGetParamHandler: application_parameters.GetParamHandlerFunc(func(params application_parameters.GetParamParams) middleware.Responder { - return middleware.NotImplemented("operation application_parameters.GetParam has not yet been implemented") - }), - PaymentRequestsGetPaymentRequestHandler: payment_requests.GetPaymentRequestHandlerFunc(func(params payment_requests.GetPaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetPaymentRequest has not yet been implemented") - }), - PaymentRequestsGetPaymentRequestsForMoveHandler: payment_requests.GetPaymentRequestsForMoveHandlerFunc(func(params payment_requests.GetPaymentRequestsForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetPaymentRequestsForMove has not yet been implemented") - }), - QueuesGetPaymentRequestsQueueHandler: queues.GetPaymentRequestsQueueHandlerFunc(func(params queues.GetPaymentRequestsQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetPaymentRequestsQueue has not yet been implemented") - }), - ReportViolationsGetReportViolationsByReportIDHandler: report_violations.GetReportViolationsByReportIDHandlerFunc(func(params report_violations.GetReportViolationsByReportIDParams) middleware.Responder { - return middleware.NotImplemented("operation report_violations.GetReportViolationsByReportID has not yet been implemented") - }), - QueuesGetServicesCounselingOriginListHandler: queues.GetServicesCounselingOriginListHandlerFunc(func(params queues.GetServicesCounselingOriginListParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetServicesCounselingOriginList has not yet been implemented") - }), - QueuesGetServicesCounselingQueueHandler: queues.GetServicesCounselingQueueHandlerFunc(func(params queues.GetServicesCounselingQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetServicesCounselingQueue has not yet been implemented") - }), - MtoShipmentGetShipmentHandler: mto_shipment.GetShipmentHandlerFunc(func(params mto_shipment.GetShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.GetShipment has not yet been implemented") - }), - PaymentRequestsGetShipmentsPaymentSITBalanceHandler: payment_requests.GetShipmentsPaymentSITBalanceHandlerFunc(func(params payment_requests.GetShipmentsPaymentSITBalanceParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.GetShipmentsPaymentSITBalance has not yet been implemented") - }), - TransportationOfficeGetTransportationOfficesHandler: transportation_office.GetTransportationOfficesHandlerFunc(func(params transportation_office.GetTransportationOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOffices has not yet been implemented") - }), - TransportationOfficeGetTransportationOfficesGBLOCsHandler: transportation_office.GetTransportationOfficesGBLOCsHandlerFunc(func(params transportation_office.GetTransportationOfficesGBLOCsParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesGBLOCs has not yet been implemented") - }), - TransportationOfficeGetTransportationOfficesOpenHandler: transportation_office.GetTransportationOfficesOpenHandlerFunc(func(params transportation_office.GetTransportationOfficesOpenParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesOpen has not yet been implemented") - }), - UploadsGetUploadHandler: uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") - }), - CalendarIsDateWeekendHolidayHandler: calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") - }), - MtoServiceItemListMTOServiceItemsHandler: mto_service_item.ListMTOServiceItemsHandlerFunc(func(params mto_service_item.ListMTOServiceItemsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.ListMTOServiceItems has not yet been implemented") - }), - MtoShipmentListMTOShipmentsHandler: mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") - }), - QueuesListPrimeMovesHandler: queues.ListPrimeMovesHandlerFunc(func(params queues.ListPrimeMovesParams) middleware.Responder { - return middleware.NotImplemented("operation queues.ListPrimeMoves has not yet been implemented") - }), - MoveMoveCancelerHandler: move.MoveCancelerHandlerFunc(func(params move.MoveCancelerParams) middleware.Responder { - return middleware.NotImplemented("operation move.MoveCanceler has not yet been implemented") - }), - ShipmentRejectShipmentHandler: shipment.RejectShipmentHandlerFunc(func(params shipment.RejectShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RejectShipment has not yet been implemented") - }), - LinesOfAccountingRequestLineOfAccountingHandler: lines_of_accounting.RequestLineOfAccountingHandlerFunc(func(params lines_of_accounting.RequestLineOfAccountingParams) middleware.Responder { - return middleware.NotImplemented("operation lines_of_accounting.RequestLineOfAccounting has not yet been implemented") - }), - ShipmentRequestShipmentCancellationHandler: shipment.RequestShipmentCancellationHandlerFunc(func(params shipment.RequestShipmentCancellationParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentCancellation has not yet been implemented") - }), - ShipmentRequestShipmentDiversionHandler: shipment.RequestShipmentDiversionHandlerFunc(func(params shipment.RequestShipmentDiversionParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentDiversion has not yet been implemented") - }), - ShipmentRequestShipmentReweighHandler: shipment.RequestShipmentReweighHandlerFunc(func(params shipment.RequestShipmentReweighParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.RequestShipmentReweigh has not yet been implemented") - }), - ShipmentReviewShipmentAddressUpdateHandler: shipment.ReviewShipmentAddressUpdateHandlerFunc(func(params shipment.ReviewShipmentAddressUpdateParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.ReviewShipmentAddressUpdate has not yet been implemented") - }), - EvaluationReportsSaveEvaluationReportHandler: evaluation_reports.SaveEvaluationReportHandlerFunc(func(params evaluation_reports.SaveEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.SaveEvaluationReport has not yet been implemented") - }), - CustomerSearchCustomersHandler: customer.SearchCustomersHandlerFunc(func(params customer.SearchCustomersParams) middleware.Responder { - return middleware.NotImplemented("operation customer.SearchCustomers has not yet been implemented") - }), - MoveSearchMovesHandler: move.SearchMovesHandlerFunc(func(params move.SearchMovesParams) middleware.Responder { - return middleware.NotImplemented("operation move.SearchMoves has not yet been implemented") - }), - MoveSetFinancialReviewFlagHandler: move.SetFinancialReviewFlagHandlerFunc(func(params move.SetFinancialReviewFlagParams) middleware.Responder { - return middleware.NotImplemented("operation move.SetFinancialReviewFlag has not yet been implemented") - }), - PpmShowAOAPacketHandler: ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") - }), - PpmShowPaymentPacketHandler: ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") - }), - EvaluationReportsSubmitEvaluationReportHandler: evaluation_reports.SubmitEvaluationReportHandlerFunc(func(params evaluation_reports.SubmitEvaluationReportParams) middleware.Responder { - return middleware.NotImplemented("operation evaluation_reports.SubmitEvaluationReport has not yet been implemented") - }), - TacTacValidationHandler: tac.TacValidationHandlerFunc(func(params tac.TacValidationParams) middleware.Responder { - return middleware.NotImplemented("operation tac.TacValidation has not yet been implemented") - }), - OrderUpdateAllowanceHandler: order.UpdateAllowanceHandlerFunc(func(params order.UpdateAllowanceParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateAllowance has not yet been implemented") - }), - MoveUpdateAssignedOfficeUserHandler: move.UpdateAssignedOfficeUserHandlerFunc(func(params move.UpdateAssignedOfficeUserParams) middleware.Responder { - return middleware.NotImplemented("operation move.UpdateAssignedOfficeUser has not yet been implemented") - }), - OrderUpdateBillableWeightHandler: order.UpdateBillableWeightHandlerFunc(func(params order.UpdateBillableWeightParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateBillableWeight has not yet been implemented") - }), - MoveUpdateCloseoutOfficeHandler: move.UpdateCloseoutOfficeHandlerFunc(func(params move.UpdateCloseoutOfficeParams) middleware.Responder { - return middleware.NotImplemented("operation move.UpdateCloseoutOffice has not yet been implemented") - }), - CustomerUpdateCustomerHandler: customer.UpdateCustomerHandlerFunc(func(params customer.UpdateCustomerParams) middleware.Responder { - return middleware.NotImplemented("operation customer.UpdateCustomer has not yet been implemented") - }), - CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler: customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { - return middleware.NotImplemented("operation customer_support_remarks.UpdateCustomerSupportRemarkForMove has not yet been implemented") - }), - MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler: move_task_order.UpdateMTOReviewedBillableWeightsAtHandlerFunc(func(params move_task_order.UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOReviewedBillableWeightsAt has not yet been implemented") - }), - MtoServiceItemUpdateMTOServiceItemStatusHandler: mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }), - MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler: move_task_order.UpdateMTOStatusServiceCounselingCompletedHandlerFunc(func(params move_task_order.UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOStatusServiceCounselingCompleted has not yet been implemented") - }), - OrderUpdateMaxBillableWeightAsTIOHandler: order.UpdateMaxBillableWeightAsTIOHandlerFunc(func(params order.UpdateMaxBillableWeightAsTIOParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateMaxBillableWeightAsTIO has not yet been implemented") - }), - MoveTaskOrderUpdateMoveTIORemarksHandler: move_task_order.UpdateMoveTIORemarksHandlerFunc(func(params move_task_order.UpdateMoveTIORemarksParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMoveTIORemarks has not yet been implemented") - }), - MoveTaskOrderUpdateMoveTaskOrderStatusHandler: move_task_order.UpdateMoveTaskOrderStatusHandlerFunc(func(params move_task_order.UpdateMoveTaskOrderStatusParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMoveTaskOrderStatus has not yet been implemented") - }), - PpmUpdateMovingExpenseHandler: ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") - }), - OrderUpdateOrderHandler: order.UpdateOrderHandlerFunc(func(params order.UpdateOrderParams) middleware.Responder { - return middleware.NotImplemented("operation order.UpdateOrder has not yet been implemented") - }), - PpmUpdatePPMSITHandler: ppm.UpdatePPMSITHandlerFunc(func(params ppm.UpdatePPMSITParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdatePPMSIT has not yet been implemented") - }), - PaymentRequestsUpdatePaymentRequestStatusHandler: payment_requests.UpdatePaymentRequestStatusHandlerFunc(func(params payment_requests.UpdatePaymentRequestStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_requests.UpdatePaymentRequestStatus has not yet been implemented") - }), - PaymentServiceItemUpdatePaymentServiceItemStatusHandler: payment_service_item.UpdatePaymentServiceItemStatusHandlerFunc(func(params payment_service_item.UpdatePaymentServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_service_item.UpdatePaymentServiceItemStatus has not yet been implemented") - }), - PpmUpdateProGearWeightTicketHandler: ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") - }), - ShipmentUpdateSITServiceItemCustomerExpenseHandler: shipment.UpdateSITServiceItemCustomerExpenseHandlerFunc(func(params shipment.UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation shipment.UpdateSITServiceItemCustomerExpense has not yet been implemented") - }), - MtoServiceItemUpdateServiceItemSitEntryDateHandler: mto_service_item.UpdateServiceItemSitEntryDateHandlerFunc(func(params mto_service_item.UpdateServiceItemSitEntryDateParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateServiceItemSitEntryDate has not yet been implemented") - }), - UploadsUpdateUploadHandler: uploads.UpdateUploadHandlerFunc(func(params uploads.UpdateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.UpdateUpload has not yet been implemented") - }), - PpmUpdateWeightTicketHandler: ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") - }), - MoveUploadAdditionalDocumentsHandler: move.UploadAdditionalDocumentsHandlerFunc(func(params move.UploadAdditionalDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation move.UploadAdditionalDocuments has not yet been implemented") - }), - OrderUploadAmendedOrdersHandler: order.UploadAmendedOrdersHandlerFunc(func(params order.UploadAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation order.UploadAmendedOrders has not yet been implemented") - }), - } -} - -/* -MymoveAPI The GHC API is a RESTful API that enables the Office application for MilMove. - -All endpoints are located under `/ghc/v1`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // MultipartformConsumer registers a consumer for the following mime types: - // - multipart/form-data - MultipartformConsumer runtime.Consumer - - // BinProducer registers a producer for the following mime types: - // - application/pdf - BinProducer runtime.Producer - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // OrderAcknowledgeExcessWeightRiskHandler sets the operation handler for the acknowledge excess weight risk operation - OrderAcknowledgeExcessWeightRiskHandler order.AcknowledgeExcessWeightRiskHandler - // EvaluationReportsAddAppealToSeriousIncidentHandler sets the operation handler for the add appeal to serious incident operation - EvaluationReportsAddAppealToSeriousIncidentHandler evaluation_reports.AddAppealToSeriousIncidentHandler - // EvaluationReportsAddAppealToViolationHandler sets the operation handler for the add appeal to violation operation - EvaluationReportsAddAppealToViolationHandler evaluation_reports.AddAppealToViolationHandler - // ShipmentApproveSITExtensionHandler sets the operation handler for the approve s i t extension operation - ShipmentApproveSITExtensionHandler shipment.ApproveSITExtensionHandler - // ShipmentApproveShipmentHandler sets the operation handler for the approve shipment operation - ShipmentApproveShipmentHandler shipment.ApproveShipmentHandler - // ShipmentApproveShipmentDiversionHandler sets the operation handler for the approve shipment diversion operation - ShipmentApproveShipmentDiversionHandler shipment.ApproveShipmentDiversionHandler - // ReportViolationsAssociateReportViolationsHandler sets the operation handler for the associate report violations operation - ReportViolationsAssociateReportViolationsHandler report_violations.AssociateReportViolationsHandler - // PaymentRequestsBulkDownloadHandler sets the operation handler for the bulk download operation - PaymentRequestsBulkDownloadHandler payment_requests.BulkDownloadHandler - // MoveCheckForLockedMovesAndUnlockHandler sets the operation handler for the check for locked moves and unlock operation - MoveCheckForLockedMovesAndUnlockHandler move.CheckForLockedMovesAndUnlockHandler - // OrderCounselingUpdateAllowanceHandler sets the operation handler for the counseling update allowance operation - OrderCounselingUpdateAllowanceHandler order.CounselingUpdateAllowanceHandler - // OrderCounselingUpdateOrderHandler sets the operation handler for the counseling update order operation - OrderCounselingUpdateOrderHandler order.CounselingUpdateOrderHandler - // ShipmentCreateApprovedSITDurationUpdateHandler sets the operation handler for the create approved s i t duration update operation - ShipmentCreateApprovedSITDurationUpdateHandler shipment.CreateApprovedSITDurationUpdateHandler - // CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler sets the operation handler for the create customer support remark for move operation - CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler customer_support_remarks.CreateCustomerSupportRemarkForMoveHandler - // CustomerCreateCustomerWithOktaOptionHandler sets the operation handler for the create customer with okta option operation - CustomerCreateCustomerWithOktaOptionHandler customer.CreateCustomerWithOktaOptionHandler - // GhcDocumentsCreateDocumentHandler sets the operation handler for the create document operation - GhcDocumentsCreateDocumentHandler ghc_documents.CreateDocumentHandler - // EvaluationReportsCreateEvaluationReportHandler sets the operation handler for the create evaluation report operation - EvaluationReportsCreateEvaluationReportHandler evaluation_reports.CreateEvaluationReportHandler - // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation - MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler - // OrderCreateOrderHandler sets the operation handler for the create order operation - OrderCreateOrderHandler order.CreateOrderHandler - // OfficeUsersCreateRequestedOfficeUserHandler sets the operation handler for the create requested office user operation - OfficeUsersCreateRequestedOfficeUserHandler office_users.CreateRequestedOfficeUserHandler - // UploadsCreateUploadHandler sets the operation handler for the create upload operation - UploadsCreateUploadHandler uploads.CreateUploadHandler - // MoveDeleteAssignedOfficeUserHandler sets the operation handler for the delete assigned office user operation - MoveDeleteAssignedOfficeUserHandler move.DeleteAssignedOfficeUserHandler - // CustomerSupportRemarksDeleteCustomerSupportRemarkHandler sets the operation handler for the delete customer support remark operation - CustomerSupportRemarksDeleteCustomerSupportRemarkHandler customer_support_remarks.DeleteCustomerSupportRemarkHandler - // EvaluationReportsDeleteEvaluationReportHandler sets the operation handler for the delete evaluation report operation - EvaluationReportsDeleteEvaluationReportHandler evaluation_reports.DeleteEvaluationReportHandler - // ShipmentDeleteShipmentHandler sets the operation handler for the delete shipment operation - ShipmentDeleteShipmentHandler shipment.DeleteShipmentHandler - // UploadsDeleteUploadHandler sets the operation handler for the delete upload operation - UploadsDeleteUploadHandler uploads.DeleteUploadHandler - // ShipmentDenySITExtensionHandler sets the operation handler for the deny s i t extension operation - ShipmentDenySITExtensionHandler shipment.DenySITExtensionHandler - // EvaluationReportsDownloadEvaluationReportHandler sets the operation handler for the download evaluation report operation - EvaluationReportsDownloadEvaluationReportHandler evaluation_reports.DownloadEvaluationReportHandler - // MtoAgentFetchMTOAgentListHandler sets the operation handler for the fetch m t o agent list operation - MtoAgentFetchMTOAgentListHandler mto_agent.FetchMTOAgentListHandler - // PpmFinishDocumentReviewHandler sets the operation handler for the finish document review operation - PpmFinishDocumentReviewHandler ppm.FinishDocumentReviewHandler - // ReServiceItemsGetAllReServiceItemsHandler sets the operation handler for the get all re service items operation - ReServiceItemsGetAllReServiceItemsHandler re_service_items.GetAllReServiceItemsHandler - // QueuesGetBulkAssignmentDataHandler sets the operation handler for the get bulk assignment data operation - QueuesGetBulkAssignmentDataHandler queues.GetBulkAssignmentDataHandler - // CustomerGetCustomerHandler sets the operation handler for the get customer operation - CustomerGetCustomerHandler customer.GetCustomerHandler - // CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler sets the operation handler for the get customer support remarks for move operation - CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler customer_support_remarks.GetCustomerSupportRemarksForMoveHandler - // GhcDocumentsGetDocumentHandler sets the operation handler for the get document operation - GhcDocumentsGetDocumentHandler ghc_documents.GetDocumentHandler - // MoveTaskOrderGetEntitlementsHandler sets the operation handler for the get entitlements operation - MoveTaskOrderGetEntitlementsHandler move_task_order.GetEntitlementsHandler - // EvaluationReportsGetEvaluationReportHandler sets the operation handler for the get evaluation report operation - EvaluationReportsGetEvaluationReportHandler evaluation_reports.GetEvaluationReportHandler - // AddressesGetLocationByZipCityStateHandler sets the operation handler for the get location by zip city state operation - AddressesGetLocationByZipCityStateHandler addresses.GetLocationByZipCityStateHandler - // MtoServiceItemGetMTOServiceItemHandler sets the operation handler for the get m t o service item operation - MtoServiceItemGetMTOServiceItemHandler mto_service_item.GetMTOServiceItemHandler - // MoveGetMoveHandler sets the operation handler for the get move operation - MoveGetMoveHandler move.GetMoveHandler - // MoveGetMoveCounselingEvaluationReportsListHandler sets the operation handler for the get move counseling evaluation reports list operation - MoveGetMoveCounselingEvaluationReportsListHandler move.GetMoveCounselingEvaluationReportsListHandler - // MoveGetMoveHistoryHandler sets the operation handler for the get move history operation - MoveGetMoveHistoryHandler move.GetMoveHistoryHandler - // MoveGetMoveShipmentEvaluationReportsListHandler sets the operation handler for the get move shipment evaluation reports list operation - MoveGetMoveShipmentEvaluationReportsListHandler move.GetMoveShipmentEvaluationReportsListHandler - // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation - MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler - // QueuesGetMovesQueueHandler sets the operation handler for the get moves queue operation - QueuesGetMovesQueueHandler queues.GetMovesQueueHandler - // OrderGetOrderHandler sets the operation handler for the get order operation - OrderGetOrderHandler order.GetOrderHandler - // PpmGetPPMActualWeightHandler sets the operation handler for the get p p m actual weight operation - PpmGetPPMActualWeightHandler ppm.GetPPMActualWeightHandler - // PpmGetPPMCloseoutHandler sets the operation handler for the get p p m closeout operation - PpmGetPPMCloseoutHandler ppm.GetPPMCloseoutHandler - // PpmGetPPMDocumentsHandler sets the operation handler for the get p p m documents operation - PpmGetPPMDocumentsHandler ppm.GetPPMDocumentsHandler - // PpmGetPPMSITEstimatedCostHandler sets the operation handler for the get p p m s i t estimated cost operation - PpmGetPPMSITEstimatedCostHandler ppm.GetPPMSITEstimatedCostHandler - // PwsViolationsGetPWSViolationsHandler sets the operation handler for the get p w s violations operation - PwsViolationsGetPWSViolationsHandler pws_violations.GetPWSViolationsHandler - // ApplicationParametersGetParamHandler sets the operation handler for the get param operation - ApplicationParametersGetParamHandler application_parameters.GetParamHandler - // PaymentRequestsGetPaymentRequestHandler sets the operation handler for the get payment request operation - PaymentRequestsGetPaymentRequestHandler payment_requests.GetPaymentRequestHandler - // PaymentRequestsGetPaymentRequestsForMoveHandler sets the operation handler for the get payment requests for move operation - PaymentRequestsGetPaymentRequestsForMoveHandler payment_requests.GetPaymentRequestsForMoveHandler - // QueuesGetPaymentRequestsQueueHandler sets the operation handler for the get payment requests queue operation - QueuesGetPaymentRequestsQueueHandler queues.GetPaymentRequestsQueueHandler - // ReportViolationsGetReportViolationsByReportIDHandler sets the operation handler for the get report violations by report ID operation - ReportViolationsGetReportViolationsByReportIDHandler report_violations.GetReportViolationsByReportIDHandler - // QueuesGetServicesCounselingOriginListHandler sets the operation handler for the get services counseling origin list operation - QueuesGetServicesCounselingOriginListHandler queues.GetServicesCounselingOriginListHandler - // QueuesGetServicesCounselingQueueHandler sets the operation handler for the get services counseling queue operation - QueuesGetServicesCounselingQueueHandler queues.GetServicesCounselingQueueHandler - // MtoShipmentGetShipmentHandler sets the operation handler for the get shipment operation - MtoShipmentGetShipmentHandler mto_shipment.GetShipmentHandler - // PaymentRequestsGetShipmentsPaymentSITBalanceHandler sets the operation handler for the get shipments payment s i t balance operation - PaymentRequestsGetShipmentsPaymentSITBalanceHandler payment_requests.GetShipmentsPaymentSITBalanceHandler - // TransportationOfficeGetTransportationOfficesHandler sets the operation handler for the get transportation offices operation - TransportationOfficeGetTransportationOfficesHandler transportation_office.GetTransportationOfficesHandler - // TransportationOfficeGetTransportationOfficesGBLOCsHandler sets the operation handler for the get transportation offices g b l o cs operation - TransportationOfficeGetTransportationOfficesGBLOCsHandler transportation_office.GetTransportationOfficesGBLOCsHandler - // TransportationOfficeGetTransportationOfficesOpenHandler sets the operation handler for the get transportation offices open operation - TransportationOfficeGetTransportationOfficesOpenHandler transportation_office.GetTransportationOfficesOpenHandler - // UploadsGetUploadHandler sets the operation handler for the get upload operation - UploadsGetUploadHandler uploads.GetUploadHandler - // CalendarIsDateWeekendHolidayHandler sets the operation handler for the is date weekend holiday operation - CalendarIsDateWeekendHolidayHandler calendar.IsDateWeekendHolidayHandler - // MtoServiceItemListMTOServiceItemsHandler sets the operation handler for the list m t o service items operation - MtoServiceItemListMTOServiceItemsHandler mto_service_item.ListMTOServiceItemsHandler - // MtoShipmentListMTOShipmentsHandler sets the operation handler for the list m t o shipments operation - MtoShipmentListMTOShipmentsHandler mto_shipment.ListMTOShipmentsHandler - // QueuesListPrimeMovesHandler sets the operation handler for the list prime moves operation - QueuesListPrimeMovesHandler queues.ListPrimeMovesHandler - // MoveMoveCancelerHandler sets the operation handler for the move canceler operation - MoveMoveCancelerHandler move.MoveCancelerHandler - // ShipmentRejectShipmentHandler sets the operation handler for the reject shipment operation - ShipmentRejectShipmentHandler shipment.RejectShipmentHandler - // LinesOfAccountingRequestLineOfAccountingHandler sets the operation handler for the request line of accounting operation - LinesOfAccountingRequestLineOfAccountingHandler lines_of_accounting.RequestLineOfAccountingHandler - // ShipmentRequestShipmentCancellationHandler sets the operation handler for the request shipment cancellation operation - ShipmentRequestShipmentCancellationHandler shipment.RequestShipmentCancellationHandler - // ShipmentRequestShipmentDiversionHandler sets the operation handler for the request shipment diversion operation - ShipmentRequestShipmentDiversionHandler shipment.RequestShipmentDiversionHandler - // ShipmentRequestShipmentReweighHandler sets the operation handler for the request shipment reweigh operation - ShipmentRequestShipmentReweighHandler shipment.RequestShipmentReweighHandler - // ShipmentReviewShipmentAddressUpdateHandler sets the operation handler for the review shipment address update operation - ShipmentReviewShipmentAddressUpdateHandler shipment.ReviewShipmentAddressUpdateHandler - // EvaluationReportsSaveEvaluationReportHandler sets the operation handler for the save evaluation report operation - EvaluationReportsSaveEvaluationReportHandler evaluation_reports.SaveEvaluationReportHandler - // CustomerSearchCustomersHandler sets the operation handler for the search customers operation - CustomerSearchCustomersHandler customer.SearchCustomersHandler - // MoveSearchMovesHandler sets the operation handler for the search moves operation - MoveSearchMovesHandler move.SearchMovesHandler - // MoveSetFinancialReviewFlagHandler sets the operation handler for the set financial review flag operation - MoveSetFinancialReviewFlagHandler move.SetFinancialReviewFlagHandler - // PpmShowAOAPacketHandler sets the operation handler for the show a o a packet operation - PpmShowAOAPacketHandler ppm.ShowAOAPacketHandler - // PpmShowPaymentPacketHandler sets the operation handler for the show payment packet operation - PpmShowPaymentPacketHandler ppm.ShowPaymentPacketHandler - // EvaluationReportsSubmitEvaluationReportHandler sets the operation handler for the submit evaluation report operation - EvaluationReportsSubmitEvaluationReportHandler evaluation_reports.SubmitEvaluationReportHandler - // TacTacValidationHandler sets the operation handler for the tac validation operation - TacTacValidationHandler tac.TacValidationHandler - // OrderUpdateAllowanceHandler sets the operation handler for the update allowance operation - OrderUpdateAllowanceHandler order.UpdateAllowanceHandler - // MoveUpdateAssignedOfficeUserHandler sets the operation handler for the update assigned office user operation - MoveUpdateAssignedOfficeUserHandler move.UpdateAssignedOfficeUserHandler - // OrderUpdateBillableWeightHandler sets the operation handler for the update billable weight operation - OrderUpdateBillableWeightHandler order.UpdateBillableWeightHandler - // MoveUpdateCloseoutOfficeHandler sets the operation handler for the update closeout office operation - MoveUpdateCloseoutOfficeHandler move.UpdateCloseoutOfficeHandler - // CustomerUpdateCustomerHandler sets the operation handler for the update customer operation - CustomerUpdateCustomerHandler customer.UpdateCustomerHandler - // CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler sets the operation handler for the update customer support remark for move operation - CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandler - // MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler sets the operation handler for the update m t o reviewed billable weights at operation - MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler move_task_order.UpdateMTOReviewedBillableWeightsAtHandler - // MtoServiceItemUpdateMTOServiceItemStatusHandler sets the operation handler for the update m t o service item status operation - MtoServiceItemUpdateMTOServiceItemStatusHandler mto_service_item.UpdateMTOServiceItemStatusHandler - // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation - MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler - // MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler sets the operation handler for the update m t o status service counseling completed operation - MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler move_task_order.UpdateMTOStatusServiceCounselingCompletedHandler - // OrderUpdateMaxBillableWeightAsTIOHandler sets the operation handler for the update max billable weight as t i o operation - OrderUpdateMaxBillableWeightAsTIOHandler order.UpdateMaxBillableWeightAsTIOHandler - // MoveTaskOrderUpdateMoveTIORemarksHandler sets the operation handler for the update move t i o remarks operation - MoveTaskOrderUpdateMoveTIORemarksHandler move_task_order.UpdateMoveTIORemarksHandler - // MoveTaskOrderUpdateMoveTaskOrderStatusHandler sets the operation handler for the update move task order status operation - MoveTaskOrderUpdateMoveTaskOrderStatusHandler move_task_order.UpdateMoveTaskOrderStatusHandler - // PpmUpdateMovingExpenseHandler sets the operation handler for the update moving expense operation - PpmUpdateMovingExpenseHandler ppm.UpdateMovingExpenseHandler - // OrderUpdateOrderHandler sets the operation handler for the update order operation - OrderUpdateOrderHandler order.UpdateOrderHandler - // PpmUpdatePPMSITHandler sets the operation handler for the update p p m s i t operation - PpmUpdatePPMSITHandler ppm.UpdatePPMSITHandler - // PaymentRequestsUpdatePaymentRequestStatusHandler sets the operation handler for the update payment request status operation - PaymentRequestsUpdatePaymentRequestStatusHandler payment_requests.UpdatePaymentRequestStatusHandler - // PaymentServiceItemUpdatePaymentServiceItemStatusHandler sets the operation handler for the update payment service item status operation - PaymentServiceItemUpdatePaymentServiceItemStatusHandler payment_service_item.UpdatePaymentServiceItemStatusHandler - // PpmUpdateProGearWeightTicketHandler sets the operation handler for the update pro gear weight ticket operation - PpmUpdateProGearWeightTicketHandler ppm.UpdateProGearWeightTicketHandler - // ShipmentUpdateSITServiceItemCustomerExpenseHandler sets the operation handler for the update s i t service item customer expense operation - ShipmentUpdateSITServiceItemCustomerExpenseHandler shipment.UpdateSITServiceItemCustomerExpenseHandler - // MtoServiceItemUpdateServiceItemSitEntryDateHandler sets the operation handler for the update service item sit entry date operation - MtoServiceItemUpdateServiceItemSitEntryDateHandler mto_service_item.UpdateServiceItemSitEntryDateHandler - // UploadsUpdateUploadHandler sets the operation handler for the update upload operation - UploadsUpdateUploadHandler uploads.UpdateUploadHandler - // PpmUpdateWeightTicketHandler sets the operation handler for the update weight ticket operation - PpmUpdateWeightTicketHandler ppm.UpdateWeightTicketHandler - // MoveUploadAdditionalDocumentsHandler sets the operation handler for the upload additional documents operation - MoveUploadAdditionalDocumentsHandler move.UploadAdditionalDocumentsHandler - // OrderUploadAmendedOrdersHandler sets the operation handler for the upload amended orders operation - OrderUploadAmendedOrdersHandler order.UploadAmendedOrdersHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.MultipartformConsumer == nil { - unregistered = append(unregistered, "MultipartformConsumer") - } - - if o.BinProducer == nil { - unregistered = append(unregistered, "BinProducer") - } - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.OrderAcknowledgeExcessWeightRiskHandler == nil { - unregistered = append(unregistered, "order.AcknowledgeExcessWeightRiskHandler") - } - if o.EvaluationReportsAddAppealToSeriousIncidentHandler == nil { - unregistered = append(unregistered, "evaluation_reports.AddAppealToSeriousIncidentHandler") - } - if o.EvaluationReportsAddAppealToViolationHandler == nil { - unregistered = append(unregistered, "evaluation_reports.AddAppealToViolationHandler") - } - if o.ShipmentApproveSITExtensionHandler == nil { - unregistered = append(unregistered, "shipment.ApproveSITExtensionHandler") - } - if o.ShipmentApproveShipmentHandler == nil { - unregistered = append(unregistered, "shipment.ApproveShipmentHandler") - } - if o.ShipmentApproveShipmentDiversionHandler == nil { - unregistered = append(unregistered, "shipment.ApproveShipmentDiversionHandler") - } - if o.ReportViolationsAssociateReportViolationsHandler == nil { - unregistered = append(unregistered, "report_violations.AssociateReportViolationsHandler") - } - if o.PaymentRequestsBulkDownloadHandler == nil { - unregistered = append(unregistered, "payment_requests.BulkDownloadHandler") - } - if o.MoveCheckForLockedMovesAndUnlockHandler == nil { - unregistered = append(unregistered, "move.CheckForLockedMovesAndUnlockHandler") - } - if o.OrderCounselingUpdateAllowanceHandler == nil { - unregistered = append(unregistered, "order.CounselingUpdateAllowanceHandler") - } - if o.OrderCounselingUpdateOrderHandler == nil { - unregistered = append(unregistered, "order.CounselingUpdateOrderHandler") - } - if o.ShipmentCreateApprovedSITDurationUpdateHandler == nil { - unregistered = append(unregistered, "shipment.CreateApprovedSITDurationUpdateHandler") - } - if o.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler == nil { - unregistered = append(unregistered, "customer_support_remarks.CreateCustomerSupportRemarkForMoveHandler") - } - if o.CustomerCreateCustomerWithOktaOptionHandler == nil { - unregistered = append(unregistered, "customer.CreateCustomerWithOktaOptionHandler") - } - if o.GhcDocumentsCreateDocumentHandler == nil { - unregistered = append(unregistered, "ghc_documents.CreateDocumentHandler") - } - if o.EvaluationReportsCreateEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.CreateEvaluationReportHandler") - } - if o.MtoShipmentCreateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") - } - if o.OrderCreateOrderHandler == nil { - unregistered = append(unregistered, "order.CreateOrderHandler") - } - if o.OfficeUsersCreateRequestedOfficeUserHandler == nil { - unregistered = append(unregistered, "office_users.CreateRequestedOfficeUserHandler") - } - if o.UploadsCreateUploadHandler == nil { - unregistered = append(unregistered, "uploads.CreateUploadHandler") - } - if o.MoveDeleteAssignedOfficeUserHandler == nil { - unregistered = append(unregistered, "move.DeleteAssignedOfficeUserHandler") - } - if o.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler == nil { - unregistered = append(unregistered, "customer_support_remarks.DeleteCustomerSupportRemarkHandler") - } - if o.EvaluationReportsDeleteEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.DeleteEvaluationReportHandler") - } - if o.ShipmentDeleteShipmentHandler == nil { - unregistered = append(unregistered, "shipment.DeleteShipmentHandler") - } - if o.UploadsDeleteUploadHandler == nil { - unregistered = append(unregistered, "uploads.DeleteUploadHandler") - } - if o.ShipmentDenySITExtensionHandler == nil { - unregistered = append(unregistered, "shipment.DenySITExtensionHandler") - } - if o.EvaluationReportsDownloadEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.DownloadEvaluationReportHandler") - } - if o.MtoAgentFetchMTOAgentListHandler == nil { - unregistered = append(unregistered, "mto_agent.FetchMTOAgentListHandler") - } - if o.PpmFinishDocumentReviewHandler == nil { - unregistered = append(unregistered, "ppm.FinishDocumentReviewHandler") - } - if o.ReServiceItemsGetAllReServiceItemsHandler == nil { - unregistered = append(unregistered, "re_service_items.GetAllReServiceItemsHandler") - } - if o.QueuesGetBulkAssignmentDataHandler == nil { - unregistered = append(unregistered, "queues.GetBulkAssignmentDataHandler") - } - if o.CustomerGetCustomerHandler == nil { - unregistered = append(unregistered, "customer.GetCustomerHandler") - } - if o.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler == nil { - unregistered = append(unregistered, "customer_support_remarks.GetCustomerSupportRemarksForMoveHandler") - } - if o.GhcDocumentsGetDocumentHandler == nil { - unregistered = append(unregistered, "ghc_documents.GetDocumentHandler") - } - if o.MoveTaskOrderGetEntitlementsHandler == nil { - unregistered = append(unregistered, "move_task_order.GetEntitlementsHandler") - } - if o.EvaluationReportsGetEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.GetEvaluationReportHandler") - } - if o.AddressesGetLocationByZipCityStateHandler == nil { - unregistered = append(unregistered, "addresses.GetLocationByZipCityStateHandler") - } - if o.MtoServiceItemGetMTOServiceItemHandler == nil { - unregistered = append(unregistered, "mto_service_item.GetMTOServiceItemHandler") - } - if o.MoveGetMoveHandler == nil { - unregistered = append(unregistered, "move.GetMoveHandler") - } - if o.MoveGetMoveCounselingEvaluationReportsListHandler == nil { - unregistered = append(unregistered, "move.GetMoveCounselingEvaluationReportsListHandler") - } - if o.MoveGetMoveHistoryHandler == nil { - unregistered = append(unregistered, "move.GetMoveHistoryHandler") - } - if o.MoveGetMoveShipmentEvaluationReportsListHandler == nil { - unregistered = append(unregistered, "move.GetMoveShipmentEvaluationReportsListHandler") - } - if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") - } - if o.QueuesGetMovesQueueHandler == nil { - unregistered = append(unregistered, "queues.GetMovesQueueHandler") - } - if o.OrderGetOrderHandler == nil { - unregistered = append(unregistered, "order.GetOrderHandler") - } - if o.PpmGetPPMActualWeightHandler == nil { - unregistered = append(unregistered, "ppm.GetPPMActualWeightHandler") - } - if o.PpmGetPPMCloseoutHandler == nil { - unregistered = append(unregistered, "ppm.GetPPMCloseoutHandler") - } - if o.PpmGetPPMDocumentsHandler == nil { - unregistered = append(unregistered, "ppm.GetPPMDocumentsHandler") - } - if o.PpmGetPPMSITEstimatedCostHandler == nil { - unregistered = append(unregistered, "ppm.GetPPMSITEstimatedCostHandler") - } - if o.PwsViolationsGetPWSViolationsHandler == nil { - unregistered = append(unregistered, "pws_violations.GetPWSViolationsHandler") - } - if o.ApplicationParametersGetParamHandler == nil { - unregistered = append(unregistered, "application_parameters.GetParamHandler") - } - if o.PaymentRequestsGetPaymentRequestHandler == nil { - unregistered = append(unregistered, "payment_requests.GetPaymentRequestHandler") - } - if o.PaymentRequestsGetPaymentRequestsForMoveHandler == nil { - unregistered = append(unregistered, "payment_requests.GetPaymentRequestsForMoveHandler") - } - if o.QueuesGetPaymentRequestsQueueHandler == nil { - unregistered = append(unregistered, "queues.GetPaymentRequestsQueueHandler") - } - if o.ReportViolationsGetReportViolationsByReportIDHandler == nil { - unregistered = append(unregistered, "report_violations.GetReportViolationsByReportIDHandler") - } - if o.QueuesGetServicesCounselingOriginListHandler == nil { - unregistered = append(unregistered, "queues.GetServicesCounselingOriginListHandler") - } - if o.QueuesGetServicesCounselingQueueHandler == nil { - unregistered = append(unregistered, "queues.GetServicesCounselingQueueHandler") - } - if o.MtoShipmentGetShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.GetShipmentHandler") - } - if o.PaymentRequestsGetShipmentsPaymentSITBalanceHandler == nil { - unregistered = append(unregistered, "payment_requests.GetShipmentsPaymentSITBalanceHandler") - } - if o.TransportationOfficeGetTransportationOfficesHandler == nil { - unregistered = append(unregistered, "transportation_office.GetTransportationOfficesHandler") - } - if o.TransportationOfficeGetTransportationOfficesGBLOCsHandler == nil { - unregistered = append(unregistered, "transportation_office.GetTransportationOfficesGBLOCsHandler") - } - if o.TransportationOfficeGetTransportationOfficesOpenHandler == nil { - unregistered = append(unregistered, "transportation_office.GetTransportationOfficesOpenHandler") - } - if o.UploadsGetUploadHandler == nil { - unregistered = append(unregistered, "uploads.GetUploadHandler") - } - if o.CalendarIsDateWeekendHolidayHandler == nil { - unregistered = append(unregistered, "calendar.IsDateWeekendHolidayHandler") - } - if o.MtoServiceItemListMTOServiceItemsHandler == nil { - unregistered = append(unregistered, "mto_service_item.ListMTOServiceItemsHandler") - } - if o.MtoShipmentListMTOShipmentsHandler == nil { - unregistered = append(unregistered, "mto_shipment.ListMTOShipmentsHandler") - } - if o.QueuesListPrimeMovesHandler == nil { - unregistered = append(unregistered, "queues.ListPrimeMovesHandler") - } - if o.MoveMoveCancelerHandler == nil { - unregistered = append(unregistered, "move.MoveCancelerHandler") - } - if o.ShipmentRejectShipmentHandler == nil { - unregistered = append(unregistered, "shipment.RejectShipmentHandler") - } - if o.LinesOfAccountingRequestLineOfAccountingHandler == nil { - unregistered = append(unregistered, "lines_of_accounting.RequestLineOfAccountingHandler") - } - if o.ShipmentRequestShipmentCancellationHandler == nil { - unregistered = append(unregistered, "shipment.RequestShipmentCancellationHandler") - } - if o.ShipmentRequestShipmentDiversionHandler == nil { - unregistered = append(unregistered, "shipment.RequestShipmentDiversionHandler") - } - if o.ShipmentRequestShipmentReweighHandler == nil { - unregistered = append(unregistered, "shipment.RequestShipmentReweighHandler") - } - if o.ShipmentReviewShipmentAddressUpdateHandler == nil { - unregistered = append(unregistered, "shipment.ReviewShipmentAddressUpdateHandler") - } - if o.EvaluationReportsSaveEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.SaveEvaluationReportHandler") - } - if o.CustomerSearchCustomersHandler == nil { - unregistered = append(unregistered, "customer.SearchCustomersHandler") - } - if o.MoveSearchMovesHandler == nil { - unregistered = append(unregistered, "move.SearchMovesHandler") - } - if o.MoveSetFinancialReviewFlagHandler == nil { - unregistered = append(unregistered, "move.SetFinancialReviewFlagHandler") - } - if o.PpmShowAOAPacketHandler == nil { - unregistered = append(unregistered, "ppm.ShowAOAPacketHandler") - } - if o.PpmShowPaymentPacketHandler == nil { - unregistered = append(unregistered, "ppm.ShowPaymentPacketHandler") - } - if o.EvaluationReportsSubmitEvaluationReportHandler == nil { - unregistered = append(unregistered, "evaluation_reports.SubmitEvaluationReportHandler") - } - if o.TacTacValidationHandler == nil { - unregistered = append(unregistered, "tac.TacValidationHandler") - } - if o.OrderUpdateAllowanceHandler == nil { - unregistered = append(unregistered, "order.UpdateAllowanceHandler") - } - if o.MoveUpdateAssignedOfficeUserHandler == nil { - unregistered = append(unregistered, "move.UpdateAssignedOfficeUserHandler") - } - if o.OrderUpdateBillableWeightHandler == nil { - unregistered = append(unregistered, "order.UpdateBillableWeightHandler") - } - if o.MoveUpdateCloseoutOfficeHandler == nil { - unregistered = append(unregistered, "move.UpdateCloseoutOfficeHandler") - } - if o.CustomerUpdateCustomerHandler == nil { - unregistered = append(unregistered, "customer.UpdateCustomerHandler") - } - if o.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler == nil { - unregistered = append(unregistered, "customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandler") - } - if o.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler == nil { - unregistered = append(unregistered, "move_task_order.UpdateMTOReviewedBillableWeightsAtHandler") - } - if o.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { - unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemStatusHandler") - } - if o.MtoShipmentUpdateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") - } - if o.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler == nil { - unregistered = append(unregistered, "move_task_order.UpdateMTOStatusServiceCounselingCompletedHandler") - } - if o.OrderUpdateMaxBillableWeightAsTIOHandler == nil { - unregistered = append(unregistered, "order.UpdateMaxBillableWeightAsTIOHandler") - } - if o.MoveTaskOrderUpdateMoveTIORemarksHandler == nil { - unregistered = append(unregistered, "move_task_order.UpdateMoveTIORemarksHandler") - } - if o.MoveTaskOrderUpdateMoveTaskOrderStatusHandler == nil { - unregistered = append(unregistered, "move_task_order.UpdateMoveTaskOrderStatusHandler") - } - if o.PpmUpdateMovingExpenseHandler == nil { - unregistered = append(unregistered, "ppm.UpdateMovingExpenseHandler") - } - if o.OrderUpdateOrderHandler == nil { - unregistered = append(unregistered, "order.UpdateOrderHandler") - } - if o.PpmUpdatePPMSITHandler == nil { - unregistered = append(unregistered, "ppm.UpdatePPMSITHandler") - } - if o.PaymentRequestsUpdatePaymentRequestStatusHandler == nil { - unregistered = append(unregistered, "payment_requests.UpdatePaymentRequestStatusHandler") - } - if o.PaymentServiceItemUpdatePaymentServiceItemStatusHandler == nil { - unregistered = append(unregistered, "payment_service_item.UpdatePaymentServiceItemStatusHandler") - } - if o.PpmUpdateProGearWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.UpdateProGearWeightTicketHandler") - } - if o.ShipmentUpdateSITServiceItemCustomerExpenseHandler == nil { - unregistered = append(unregistered, "shipment.UpdateSITServiceItemCustomerExpenseHandler") - } - if o.MtoServiceItemUpdateServiceItemSitEntryDateHandler == nil { - unregistered = append(unregistered, "mto_service_item.UpdateServiceItemSitEntryDateHandler") - } - if o.UploadsUpdateUploadHandler == nil { - unregistered = append(unregistered, "uploads.UpdateUploadHandler") - } - if o.PpmUpdateWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.UpdateWeightTicketHandler") - } - if o.MoveUploadAdditionalDocumentsHandler == nil { - unregistered = append(unregistered, "move.UploadAdditionalDocumentsHandler") - } - if o.OrderUploadAmendedOrdersHandler == nil { - unregistered = append(unregistered, "order.UploadAmendedOrdersHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - case "multipart/form-data": - result["multipart/form-data"] = o.MultipartformConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/pdf": - result["application/pdf"] = o.BinProducer - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/orders/{orderID}/acknowledge-excess-weight-risk"] = order.NewAcknowledgeExcessWeightRisk(o.context, o.OrderAcknowledgeExcessWeightRiskHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/evaluation-reports/{reportID}/appeal/add"] = evaluation_reports.NewAddAppealToSeriousIncident(o.context, o.EvaluationReportsAddAppealToSeriousIncidentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/evaluation-reports/{reportID}/{reportViolationID}/appeal/add"] = evaluation_reports.NewAddAppealToViolation(o.context, o.EvaluationReportsAddAppealToViolationHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve"] = shipment.NewApproveSITExtension(o.context, o.ShipmentApproveSITExtensionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/approve"] = shipment.NewApproveShipment(o.context, o.ShipmentApproveShipmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/approve-diversion"] = shipment.NewApproveShipmentDiversion(o.context, o.ShipmentApproveShipmentDiversionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/report-violations/{reportID}"] = report_violations.NewAssociateReportViolations(o.context, o.ReportViolationsAssociateReportViolationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-requests/{paymentRequestID}/bulkDownload"] = payment_requests.NewBulkDownload(o.context, o.PaymentRequestsBulkDownloadHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{officeUserID}/CheckForLockedMovesAndUnlock"] = move.NewCheckForLockedMovesAndUnlock(o.context, o.MoveCheckForLockedMovesAndUnlockHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/counseling/orders/{orderID}/allowances"] = order.NewCounselingUpdateAllowance(o.context, o.OrderCounselingUpdateAllowanceHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/counseling/orders/{orderID}"] = order.NewCounselingUpdateOrder(o.context, o.OrderCounselingUpdateOrderHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/sit-extensions"] = shipment.NewCreateApprovedSITDurationUpdate(o.context, o.ShipmentCreateApprovedSITDurationUpdateHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{locator}/customer-support-remarks"] = customer_support_remarks.NewCreateCustomerSupportRemarkForMove(o.context, o.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/customer"] = customer.NewCreateCustomerWithOktaOption(o.context, o.CustomerCreateCustomerWithOktaOptionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/documents"] = ghc_documents.NewCreateDocument(o.context, o.GhcDocumentsCreateDocumentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{locator}/evaluation-reports"] = evaluation_reports.NewCreateEvaluationReport(o.context, o.EvaluationReportsCreateEvaluationReportHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/orders"] = order.NewCreateOrder(o.context, o.OrderCreateOrderHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/open/requested-office-users"] = office_users.NewCreateRequestedOfficeUser(o.context, o.OfficeUsersCreateRequestedOfficeUserHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/uploads"] = uploads.NewCreateUpload(o.context, o.UploadsCreateUploadHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveID}/unassignOfficeUser"] = move.NewDeleteAssignedOfficeUser(o.context, o.MoveDeleteAssignedOfficeUserHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/customer-support-remarks/{customerSupportRemarkID}"] = customer_support_remarks.NewDeleteCustomerSupportRemark(o.context, o.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewDeleteEvaluationReport(o.context, o.EvaluationReportsDeleteEvaluationReportHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/shipments/{shipmentID}"] = shipment.NewDeleteShipment(o.context, o.ShipmentDeleteShipmentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/uploads/{uploadID}"] = uploads.NewDeleteUpload(o.context, o.UploadsDeleteUploadHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny"] = shipment.NewDenySITExtension(o.context, o.ShipmentDenySITExtensionHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/evaluation-reports/{reportID}/download"] = evaluation_reports.NewDownloadEvaluationReport(o.context, o.EvaluationReportsDownloadEvaluationReportHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents"] = mto_agent.NewFetchMTOAgentList(o.context, o.MtoAgentFetchMTOAgentListHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/finish-document-review"] = ppm.NewFinishDocumentReview(o.context, o.PpmFinishDocumentReviewHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/re-service-items"] = re_service_items.NewGetAllReServiceItems(o.context, o.ReServiceItemsGetAllReServiceItemsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/bulk-assignment"] = queues.NewGetBulkAssignmentData(o.context, o.QueuesGetBulkAssignmentDataHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/customer/{customerID}"] = customer.NewGetCustomer(o.context, o.CustomerGetCustomerHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{locator}/customer-support-remarks"] = customer_support_remarks.NewGetCustomerSupportRemarksForMove(o.context, o.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/documents/{documentId}"] = ghc_documents.NewGetDocument(o.context, o.GhcDocumentsGetDocumentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/entitlements"] = move_task_order.NewGetEntitlements(o.context, o.MoveTaskOrderGetEntitlementsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewGetEvaluationReport(o.context, o.EvaluationReportsGetEvaluationReportHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/addresses/zip-city-lookup/{search}"] = addresses.NewGetLocationByZipCityState(o.context, o.AddressesGetLocationByZipCityStateHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}"] = mto_service_item.NewGetMTOServiceItem(o.context, o.MtoServiceItemGetMTOServiceItemHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move/{locator}"] = move.NewGetMove(o.context, o.MoveGetMoveHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveID}/counseling-evaluation-reports-list"] = move.NewGetMoveCounselingEvaluationReportsList(o.context, o.MoveGetMoveCounselingEvaluationReportsListHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move/{locator}/history"] = move.NewGetMoveHistory(o.context, o.MoveGetMoveHistoryHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveID}/shipment-evaluation-reports-list"] = move.NewGetMoveShipmentEvaluationReportsList(o.context, o.MoveGetMoveShipmentEvaluationReportsListHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/moves"] = queues.NewGetMovesQueue(o.context, o.QueuesGetMovesQueueHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/orders/{orderID}"] = order.NewGetOrder(o.context, o.OrderGetOrderHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/actual-weight"] = ppm.NewGetPPMActualWeight(o.context, o.PpmGetPPMActualWeightHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/closeout"] = ppm.NewGetPPMCloseout(o.context, o.PpmGetPPMCloseoutHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/shipments/{shipmentID}/ppm-documents"] = ppm.NewGetPPMDocuments(o.context, o.PpmGetPPMDocumentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost"] = ppm.NewGetPPMSITEstimatedCost(o.context, o.PpmGetPPMSITEstimatedCostHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/pws-violations"] = pws_violations.NewGetPWSViolations(o.context, o.PwsViolationsGetPWSViolationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/application_parameters/{parameterName}"] = application_parameters.NewGetParam(o.context, o.ApplicationParametersGetParamHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-requests/{paymentRequestID}"] = payment_requests.NewGetPaymentRequest(o.context, o.PaymentRequestsGetPaymentRequestHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{locator}/payment-requests"] = payment_requests.NewGetPaymentRequestsForMove(o.context, o.PaymentRequestsGetPaymentRequestsForMoveHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/payment-requests"] = queues.NewGetPaymentRequestsQueue(o.context, o.QueuesGetPaymentRequestsQueueHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/report-violations/{reportID}"] = report_violations.NewGetReportViolationsByReportID(o.context, o.ReportViolationsGetReportViolationsByReportIDHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/counseling/origin-list"] = queues.NewGetServicesCounselingOriginList(o.context, o.QueuesGetServicesCounselingOriginListHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/counseling"] = queues.NewGetServicesCounselingQueue(o.context, o.QueuesGetServicesCounselingQueueHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/shipments/{shipmentID}"] = mto_shipment.NewGetShipment(o.context, o.MtoShipmentGetShipmentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-requests/{paymentRequestID}/shipments-payment-sit-balance"] = payment_requests.NewGetShipmentsPaymentSITBalance(o.context, o.PaymentRequestsGetShipmentsPaymentSITBalanceHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transportation-offices"] = transportation_office.NewGetTransportationOffices(o.context, o.TransportationOfficeGetTransportationOfficesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transportation-offices/gblocs"] = transportation_office.NewGetTransportationOfficesGBLOCs(o.context, o.TransportationOfficeGetTransportationOfficesGBLOCsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/open/transportation-offices"] = transportation_office.NewGetTransportationOfficesOpen(o.context, o.TransportationOfficeGetTransportationOfficesOpenHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/uploads/get"] = uploads.NewGetUpload(o.context, o.UploadsGetUploadHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/calendar/{countryCode}/is-weekend-holiday/{date}"] = calendar.NewIsDateWeekendHoliday(o.context, o.CalendarIsDateWeekendHolidayHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_service_items"] = mto_service_item.NewListMTOServiceItems(o.context, o.MtoServiceItemListMTOServiceItemsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_shipments"] = mto_shipment.NewListMTOShipments(o.context, o.MtoShipmentListMTOShipmentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/prime-moves"] = queues.NewListPrimeMoves(o.context, o.QueuesListPrimeMovesHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveID}/cancel"] = move.NewMoveCanceler(o.context, o.MoveMoveCancelerHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/reject"] = shipment.NewRejectShipment(o.context, o.ShipmentRejectShipmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/lines-of-accounting"] = lines_of_accounting.NewRequestLineOfAccounting(o.context, o.LinesOfAccountingRequestLineOfAccountingHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/request-cancellation"] = shipment.NewRequestShipmentCancellation(o.context, o.ShipmentRequestShipmentCancellationHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/request-diversion"] = shipment.NewRequestShipmentDiversion(o.context, o.ShipmentRequestShipmentDiversionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/shipments/{shipmentID}/request-reweigh"] = shipment.NewRequestShipmentReweigh(o.context, o.ShipmentRequestShipmentReweighHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/shipments/{shipmentID}/review-shipment-address-update"] = shipment.NewReviewShipmentAddressUpdate(o.context, o.ShipmentReviewShipmentAddressUpdateHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewSaveEvaluationReport(o.context, o.EvaluationReportsSaveEvaluationReportHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/customer/search"] = customer.NewSearchCustomers(o.context, o.CustomerSearchCustomersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/search"] = move.NewSearchMoves(o.context, o.MoveSearchMovesHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveID}/financial-review-flag"] = move.NewSetFinancialReviewFlag(o.context, o.MoveSetFinancialReviewFlagHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/aoa-packet"] = ppm.NewShowAOAPacket(o.context, o.PpmShowAOAPacketHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/payment-packet"] = ppm.NewShowPaymentPacket(o.context, o.PpmShowPaymentPacketHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/evaluation-reports/{reportID}/submit"] = evaluation_reports.NewSubmitEvaluationReport(o.context, o.EvaluationReportsSubmitEvaluationReportHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/tac/valid"] = tac.NewTacValidation(o.context, o.TacTacValidationHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/orders/{orderID}/allowances"] = order.NewUpdateAllowance(o.context, o.OrderUpdateAllowanceHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveID}/assignOfficeUser"] = move.NewUpdateAssignedOfficeUser(o.context, o.MoveUpdateAssignedOfficeUserHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/orders/{orderID}/update-billable-weight"] = order.NewUpdateBillableWeight(o.context, o.OrderUpdateBillableWeightHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{locator}/closeout-office"] = move.NewUpdateCloseoutOffice(o.context, o.MoveUpdateCloseoutOfficeHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/customer/{customerID}"] = customer.NewUpdateCustomer(o.context, o.CustomerUpdateCustomerHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/customer-support-remarks/{customerSupportRemarkID}"] = customer_support_remarks.NewUpdateCustomerSupportRemarkForMove(o.context, o.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at"] = move_task_order.NewUpdateMTOReviewedBillableWeightsAt(o.context, o.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status"] = mto_service_item.NewUpdateMTOServiceItemStatus(o.context, o.MtoServiceItemUpdateMTOServiceItemStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed"] = move_task_order.NewUpdateMTOStatusServiceCounselingCompleted(o.context, o.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/orders/{orderID}/update-max-billable-weight/tio"] = order.NewUpdateMaxBillableWeightAsTIO(o.context, o.OrderUpdateMaxBillableWeightAsTIOHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/tio-remarks"] = move_task_order.NewUpdateMoveTIORemarks(o.context, o.MoveTaskOrderUpdateMoveTIORemarksHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/status"] = move_task_order.NewUpdateMoveTaskOrderStatus(o.context, o.MoveTaskOrderUpdateMoveTaskOrderStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewUpdateMovingExpense(o.context, o.PpmUpdateMovingExpenseHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/orders/{orderID}"] = order.NewUpdateOrder(o.context, o.OrderUpdateOrderHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/ppm-sit"] = ppm.NewUpdatePPMSIT(o.context, o.PpmUpdatePPMSITHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/payment-requests/{paymentRequestID}/status"] = payment_requests.NewUpdatePaymentRequestStatus(o.context, o.PaymentRequestsUpdatePaymentRequestStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status"] = payment_service_item.NewUpdatePaymentServiceItemStatus(o.context, o.PaymentServiceItemUpdatePaymentServiceItemStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewUpdateProGearWeightTicket(o.context, o.PpmUpdateProGearWeightTicketHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense"] = shipment.NewUpdateSITServiceItemCustomerExpense(o.context, o.ShipmentUpdateSITServiceItemCustomerExpenseHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/service-item/{mtoServiceItemID}/entry-date-update"] = mto_service_item.NewUpdateServiceItemSitEntryDate(o.context, o.MtoServiceItemUpdateServiceItemSitEntryDateHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/uploads/{uploadID}/update"] = uploads.NewUpdateUpload(o.context, o.UploadsUpdateUploadHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewUpdateWeightTicket(o.context, o.PpmUpdateWeightTicketHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveID}/uploadAdditionalDocuments"] = move.NewUploadAdditionalDocuments(o.context, o.MoveUploadAdditionalDocumentsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/orders/{orderID}/upload_amended_orders"] = order.NewUploadAmendedOrders(o.context, o.OrderUploadAmendedOrdersHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go deleted file mode 100644 index fcbad1a89c6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateRequestedOfficeUserHandlerFunc turns a function with the right signature into a create requested office user handler -type CreateRequestedOfficeUserHandlerFunc func(CreateRequestedOfficeUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateRequestedOfficeUserHandlerFunc) Handle(params CreateRequestedOfficeUserParams) middleware.Responder { - return fn(params) -} - -// CreateRequestedOfficeUserHandler interface for that can handle valid create requested office user params -type CreateRequestedOfficeUserHandler interface { - Handle(CreateRequestedOfficeUserParams) middleware.Responder -} - -// NewCreateRequestedOfficeUser creates a new http.Handler for the create requested office user operation -func NewCreateRequestedOfficeUser(ctx *middleware.Context, handler CreateRequestedOfficeUserHandler) *CreateRequestedOfficeUser { - return &CreateRequestedOfficeUser{Context: ctx, Handler: handler} -} - -/* - CreateRequestedOfficeUser swagger:route POST /open/requested-office-users officeUsers createRequestedOfficeUser - -# Create an Office User - -This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account. -Request the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an "OR" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level. -*/ -type CreateRequestedOfficeUser struct { - Context *middleware.Context - Handler CreateRequestedOfficeUserHandler -} - -func (o *CreateRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateRequestedOfficeUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go deleted file mode 100644 index 1d85a3c948c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateRequestedOfficeUserParams creates a new CreateRequestedOfficeUserParams object -// -// There are no default values defined in the spec. -func NewCreateRequestedOfficeUserParams() CreateRequestedOfficeUserParams { - - return CreateRequestedOfficeUserParams{} -} - -// CreateRequestedOfficeUserParams contains all the bound params for the create requested office user operation -// typically these are obtained from a http.Request -// -// swagger:parameters createRequestedOfficeUser -type CreateRequestedOfficeUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Office User information - In: body - */ - OfficeUser *ghcmessages.OfficeUserCreate -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateRequestedOfficeUserParams() beforehand. -func (o *CreateRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.OfficeUserCreate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("officeUser", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.OfficeUser = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go deleted file mode 100644 index 50780474c47..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateRequestedOfficeUserCreatedCode is the HTTP code returned for type CreateRequestedOfficeUserCreated -const CreateRequestedOfficeUserCreatedCode int = 201 - -/* -CreateRequestedOfficeUserCreated successfully requested the creation of provided office user - -swagger:response createRequestedOfficeUserCreated -*/ -type CreateRequestedOfficeUserCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.OfficeUser `json:"body,omitempty"` -} - -// NewCreateRequestedOfficeUserCreated creates CreateRequestedOfficeUserCreated with default headers values -func NewCreateRequestedOfficeUserCreated() *CreateRequestedOfficeUserCreated { - - return &CreateRequestedOfficeUserCreated{} -} - -// WithPayload adds the payload to the create requested office user created response -func (o *CreateRequestedOfficeUserCreated) WithPayload(payload *ghcmessages.OfficeUser) *CreateRequestedOfficeUserCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create requested office user created response -func (o *CreateRequestedOfficeUserCreated) SetPayload(payload *ghcmessages.OfficeUser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateRequestedOfficeUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateRequestedOfficeUserUnprocessableEntityCode is the HTTP code returned for type CreateRequestedOfficeUserUnprocessableEntity -const CreateRequestedOfficeUserUnprocessableEntityCode int = 422 - -/* -CreateRequestedOfficeUserUnprocessableEntity validation error - -swagger:response createRequestedOfficeUserUnprocessableEntity -*/ -type CreateRequestedOfficeUserUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateRequestedOfficeUserUnprocessableEntity creates CreateRequestedOfficeUserUnprocessableEntity with default headers values -func NewCreateRequestedOfficeUserUnprocessableEntity() *CreateRequestedOfficeUserUnprocessableEntity { - - return &CreateRequestedOfficeUserUnprocessableEntity{} -} - -// WithPayload adds the payload to the create requested office user unprocessable entity response -func (o *CreateRequestedOfficeUserUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateRequestedOfficeUserUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create requested office user unprocessable entity response -func (o *CreateRequestedOfficeUserUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateRequestedOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type CreateRequestedOfficeUserInternalServerError -const CreateRequestedOfficeUserInternalServerErrorCode int = 500 - -/* -CreateRequestedOfficeUserInternalServerError internal server error - -swagger:response createRequestedOfficeUserInternalServerError -*/ -type CreateRequestedOfficeUserInternalServerError struct { -} - -// NewCreateRequestedOfficeUserInternalServerError creates CreateRequestedOfficeUserInternalServerError with default headers values -func NewCreateRequestedOfficeUserInternalServerError() *CreateRequestedOfficeUserInternalServerError { - - return &CreateRequestedOfficeUserInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go deleted file mode 100644 index 41d03b87326..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office_users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateRequestedOfficeUserURL generates an URL for the create requested office user operation -type CreateRequestedOfficeUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateRequestedOfficeUserURL) WithBasePath(bp string) *CreateRequestedOfficeUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateRequestedOfficeUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateRequestedOfficeUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/open/requested-office-users" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateRequestedOfficeUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateRequestedOfficeUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateRequestedOfficeUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateRequestedOfficeUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go deleted file mode 100644 index 4a5775ae93b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AcknowledgeExcessWeightRiskHandlerFunc turns a function with the right signature into a acknowledge excess weight risk handler -type AcknowledgeExcessWeightRiskHandlerFunc func(AcknowledgeExcessWeightRiskParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AcknowledgeExcessWeightRiskHandlerFunc) Handle(params AcknowledgeExcessWeightRiskParams) middleware.Responder { - return fn(params) -} - -// AcknowledgeExcessWeightRiskHandler interface for that can handle valid acknowledge excess weight risk params -type AcknowledgeExcessWeightRiskHandler interface { - Handle(AcknowledgeExcessWeightRiskParams) middleware.Responder -} - -// NewAcknowledgeExcessWeightRisk creates a new http.Handler for the acknowledge excess weight risk operation -func NewAcknowledgeExcessWeightRisk(ctx *middleware.Context, handler AcknowledgeExcessWeightRiskHandler) *AcknowledgeExcessWeightRisk { - return &AcknowledgeExcessWeightRisk{Context: ctx, Handler: handler} -} - -/* - AcknowledgeExcessWeightRisk swagger:route POST /orders/{orderID}/acknowledge-excess-weight-risk order acknowledgeExcessWeightRisk - -# Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert - -Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert -*/ -type AcknowledgeExcessWeightRisk struct { - Context *middleware.Context - Handler AcknowledgeExcessWeightRiskHandler -} - -func (o *AcknowledgeExcessWeightRisk) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAcknowledgeExcessWeightRiskParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go deleted file mode 100644 index b0347485f9c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewAcknowledgeExcessWeightRiskParams creates a new AcknowledgeExcessWeightRiskParams object -// -// There are no default values defined in the spec. -func NewAcknowledgeExcessWeightRiskParams() AcknowledgeExcessWeightRiskParams { - - return AcknowledgeExcessWeightRiskParams{} -} - -// AcknowledgeExcessWeightRiskParams contains all the bound params for the acknowledge excess weight risk operation -// typically these are obtained from a http.Request -// -// swagger:parameters acknowledgeExcessWeightRisk -type AcknowledgeExcessWeightRiskParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAcknowledgeExcessWeightRiskParams() beforehand. -func (o *AcknowledgeExcessWeightRiskParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *AcknowledgeExcessWeightRiskParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *AcknowledgeExcessWeightRiskParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *AcknowledgeExcessWeightRiskParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go deleted file mode 100644 index 9e787116db4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// AcknowledgeExcessWeightRiskOKCode is the HTTP code returned for type AcknowledgeExcessWeightRiskOK -const AcknowledgeExcessWeightRiskOKCode int = 200 - -/* -AcknowledgeExcessWeightRiskOK updated Move - -swagger:response acknowledgeExcessWeightRiskOK -*/ -type AcknowledgeExcessWeightRiskOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Move `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskOK creates AcknowledgeExcessWeightRiskOK with default headers values -func NewAcknowledgeExcessWeightRiskOK() *AcknowledgeExcessWeightRiskOK { - - return &AcknowledgeExcessWeightRiskOK{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk o k response -func (o *AcknowledgeExcessWeightRiskOK) WithPayload(payload *ghcmessages.Move) *AcknowledgeExcessWeightRiskOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk o k response -func (o *AcknowledgeExcessWeightRiskOK) SetPayload(payload *ghcmessages.Move) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AcknowledgeExcessWeightRiskForbiddenCode is the HTTP code returned for type AcknowledgeExcessWeightRiskForbidden -const AcknowledgeExcessWeightRiskForbiddenCode int = 403 - -/* -AcknowledgeExcessWeightRiskForbidden The request was denied - -swagger:response acknowledgeExcessWeightRiskForbidden -*/ -type AcknowledgeExcessWeightRiskForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskForbidden creates AcknowledgeExcessWeightRiskForbidden with default headers values -func NewAcknowledgeExcessWeightRiskForbidden() *AcknowledgeExcessWeightRiskForbidden { - - return &AcknowledgeExcessWeightRiskForbidden{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk forbidden response -func (o *AcknowledgeExcessWeightRiskForbidden) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk forbidden response -func (o *AcknowledgeExcessWeightRiskForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AcknowledgeExcessWeightRiskNotFoundCode is the HTTP code returned for type AcknowledgeExcessWeightRiskNotFound -const AcknowledgeExcessWeightRiskNotFoundCode int = 404 - -/* -AcknowledgeExcessWeightRiskNotFound The requested resource wasn't found - -swagger:response acknowledgeExcessWeightRiskNotFound -*/ -type AcknowledgeExcessWeightRiskNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskNotFound creates AcknowledgeExcessWeightRiskNotFound with default headers values -func NewAcknowledgeExcessWeightRiskNotFound() *AcknowledgeExcessWeightRiskNotFound { - - return &AcknowledgeExcessWeightRiskNotFound{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk not found response -func (o *AcknowledgeExcessWeightRiskNotFound) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk not found response -func (o *AcknowledgeExcessWeightRiskNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AcknowledgeExcessWeightRiskPreconditionFailedCode is the HTTP code returned for type AcknowledgeExcessWeightRiskPreconditionFailed -const AcknowledgeExcessWeightRiskPreconditionFailedCode int = 412 - -/* -AcknowledgeExcessWeightRiskPreconditionFailed Precondition failed - -swagger:response acknowledgeExcessWeightRiskPreconditionFailed -*/ -type AcknowledgeExcessWeightRiskPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskPreconditionFailed creates AcknowledgeExcessWeightRiskPreconditionFailed with default headers values -func NewAcknowledgeExcessWeightRiskPreconditionFailed() *AcknowledgeExcessWeightRiskPreconditionFailed { - - return &AcknowledgeExcessWeightRiskPreconditionFailed{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk precondition failed response -func (o *AcknowledgeExcessWeightRiskPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk precondition failed response -func (o *AcknowledgeExcessWeightRiskPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AcknowledgeExcessWeightRiskUnprocessableEntityCode is the HTTP code returned for type AcknowledgeExcessWeightRiskUnprocessableEntity -const AcknowledgeExcessWeightRiskUnprocessableEntityCode int = 422 - -/* -AcknowledgeExcessWeightRiskUnprocessableEntity The payload was unprocessable. - -swagger:response acknowledgeExcessWeightRiskUnprocessableEntity -*/ -type AcknowledgeExcessWeightRiskUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskUnprocessableEntity creates AcknowledgeExcessWeightRiskUnprocessableEntity with default headers values -func NewAcknowledgeExcessWeightRiskUnprocessableEntity() *AcknowledgeExcessWeightRiskUnprocessableEntity { - - return &AcknowledgeExcessWeightRiskUnprocessableEntity{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk unprocessable entity response -func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AcknowledgeExcessWeightRiskUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk unprocessable entity response -func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AcknowledgeExcessWeightRiskInternalServerErrorCode is the HTTP code returned for type AcknowledgeExcessWeightRiskInternalServerError -const AcknowledgeExcessWeightRiskInternalServerErrorCode int = 500 - -/* -AcknowledgeExcessWeightRiskInternalServerError A server error occurred - -swagger:response acknowledgeExcessWeightRiskInternalServerError -*/ -type AcknowledgeExcessWeightRiskInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAcknowledgeExcessWeightRiskInternalServerError creates AcknowledgeExcessWeightRiskInternalServerError with default headers values -func NewAcknowledgeExcessWeightRiskInternalServerError() *AcknowledgeExcessWeightRiskInternalServerError { - - return &AcknowledgeExcessWeightRiskInternalServerError{} -} - -// WithPayload adds the payload to the acknowledge excess weight risk internal server error response -func (o *AcknowledgeExcessWeightRiskInternalServerError) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the acknowledge excess weight risk internal server error response -func (o *AcknowledgeExcessWeightRiskInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AcknowledgeExcessWeightRiskInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go deleted file mode 100644 index 47c48a63470..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// AcknowledgeExcessWeightRiskURL generates an URL for the acknowledge excess weight risk operation -type AcknowledgeExcessWeightRiskURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AcknowledgeExcessWeightRiskURL) WithBasePath(bp string) *AcknowledgeExcessWeightRiskURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AcknowledgeExcessWeightRiskURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AcknowledgeExcessWeightRiskURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}/acknowledge-excess-weight-risk" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on AcknowledgeExcessWeightRiskURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AcknowledgeExcessWeightRiskURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AcknowledgeExcessWeightRiskURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AcknowledgeExcessWeightRiskURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AcknowledgeExcessWeightRiskURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AcknowledgeExcessWeightRiskURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AcknowledgeExcessWeightRiskURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go deleted file mode 100644 index 3738597821c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CounselingUpdateAllowanceHandlerFunc turns a function with the right signature into a counseling update allowance handler -type CounselingUpdateAllowanceHandlerFunc func(CounselingUpdateAllowanceParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CounselingUpdateAllowanceHandlerFunc) Handle(params CounselingUpdateAllowanceParams) middleware.Responder { - return fn(params) -} - -// CounselingUpdateAllowanceHandler interface for that can handle valid counseling update allowance params -type CounselingUpdateAllowanceHandler interface { - Handle(CounselingUpdateAllowanceParams) middleware.Responder -} - -// NewCounselingUpdateAllowance creates a new http.Handler for the counseling update allowance operation -func NewCounselingUpdateAllowance(ctx *middleware.Context, handler CounselingUpdateAllowanceHandler) *CounselingUpdateAllowance { - return &CounselingUpdateAllowance{Context: ctx, Handler: handler} -} - -/* - CounselingUpdateAllowance swagger:route PATCH /counseling/orders/{orderID}/allowances order counselingUpdateAllowance - -Updates an allowance (Orders with Entitlements) - -All fields sent in this request will be set on the order referenced -*/ -type CounselingUpdateAllowance struct { - Context *middleware.Context - Handler CounselingUpdateAllowanceHandler -} - -func (o *CounselingUpdateAllowance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCounselingUpdateAllowanceParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go deleted file mode 100644 index da064dcb3cd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCounselingUpdateAllowanceParams creates a new CounselingUpdateAllowanceParams object -// -// There are no default values defined in the spec. -func NewCounselingUpdateAllowanceParams() CounselingUpdateAllowanceParams { - - return CounselingUpdateAllowanceParams{} -} - -// CounselingUpdateAllowanceParams contains all the bound params for the counseling update allowance operation -// typically these are obtained from a http.Request -// -// swagger:parameters counselingUpdateAllowance -type CounselingUpdateAllowanceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.CounselingUpdateAllowancePayload - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCounselingUpdateAllowanceParams() beforehand. -func (o *CounselingUpdateAllowanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CounselingUpdateAllowancePayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *CounselingUpdateAllowanceParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *CounselingUpdateAllowanceParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *CounselingUpdateAllowanceParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go deleted file mode 100644 index 3e81047d27f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CounselingUpdateAllowanceOKCode is the HTTP code returned for type CounselingUpdateAllowanceOK -const CounselingUpdateAllowanceOKCode int = 200 - -/* -CounselingUpdateAllowanceOK updated instance of allowance - -swagger:response counselingUpdateAllowanceOK -*/ -type CounselingUpdateAllowanceOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowanceOK creates CounselingUpdateAllowanceOK with default headers values -func NewCounselingUpdateAllowanceOK() *CounselingUpdateAllowanceOK { - - return &CounselingUpdateAllowanceOK{} -} - -// WithPayload adds the payload to the counseling update allowance o k response -func (o *CounselingUpdateAllowanceOK) WithPayload(payload *ghcmessages.Order) *CounselingUpdateAllowanceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance o k response -func (o *CounselingUpdateAllowanceOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateAllowanceForbiddenCode is the HTTP code returned for type CounselingUpdateAllowanceForbidden -const CounselingUpdateAllowanceForbiddenCode int = 403 - -/* -CounselingUpdateAllowanceForbidden The request was denied - -swagger:response counselingUpdateAllowanceForbidden -*/ -type CounselingUpdateAllowanceForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowanceForbidden creates CounselingUpdateAllowanceForbidden with default headers values -func NewCounselingUpdateAllowanceForbidden() *CounselingUpdateAllowanceForbidden { - - return &CounselingUpdateAllowanceForbidden{} -} - -// WithPayload adds the payload to the counseling update allowance forbidden response -func (o *CounselingUpdateAllowanceForbidden) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance forbidden response -func (o *CounselingUpdateAllowanceForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateAllowanceNotFoundCode is the HTTP code returned for type CounselingUpdateAllowanceNotFound -const CounselingUpdateAllowanceNotFoundCode int = 404 - -/* -CounselingUpdateAllowanceNotFound The requested resource wasn't found - -swagger:response counselingUpdateAllowanceNotFound -*/ -type CounselingUpdateAllowanceNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowanceNotFound creates CounselingUpdateAllowanceNotFound with default headers values -func NewCounselingUpdateAllowanceNotFound() *CounselingUpdateAllowanceNotFound { - - return &CounselingUpdateAllowanceNotFound{} -} - -// WithPayload adds the payload to the counseling update allowance not found response -func (o *CounselingUpdateAllowanceNotFound) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance not found response -func (o *CounselingUpdateAllowanceNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateAllowancePreconditionFailedCode is the HTTP code returned for type CounselingUpdateAllowancePreconditionFailed -const CounselingUpdateAllowancePreconditionFailedCode int = 412 - -/* -CounselingUpdateAllowancePreconditionFailed Precondition failed - -swagger:response counselingUpdateAllowancePreconditionFailed -*/ -type CounselingUpdateAllowancePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowancePreconditionFailed creates CounselingUpdateAllowancePreconditionFailed with default headers values -func NewCounselingUpdateAllowancePreconditionFailed() *CounselingUpdateAllowancePreconditionFailed { - - return &CounselingUpdateAllowancePreconditionFailed{} -} - -// WithPayload adds the payload to the counseling update allowance precondition failed response -func (o *CounselingUpdateAllowancePreconditionFailed) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowancePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance precondition failed response -func (o *CounselingUpdateAllowancePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowancePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateAllowanceUnprocessableEntityCode is the HTTP code returned for type CounselingUpdateAllowanceUnprocessableEntity -const CounselingUpdateAllowanceUnprocessableEntityCode int = 422 - -/* -CounselingUpdateAllowanceUnprocessableEntity The payload was unprocessable. - -swagger:response counselingUpdateAllowanceUnprocessableEntity -*/ -type CounselingUpdateAllowanceUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowanceUnprocessableEntity creates CounselingUpdateAllowanceUnprocessableEntity with default headers values -func NewCounselingUpdateAllowanceUnprocessableEntity() *CounselingUpdateAllowanceUnprocessableEntity { - - return &CounselingUpdateAllowanceUnprocessableEntity{} -} - -// WithPayload adds the payload to the counseling update allowance unprocessable entity response -func (o *CounselingUpdateAllowanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CounselingUpdateAllowanceUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance unprocessable entity response -func (o *CounselingUpdateAllowanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateAllowanceInternalServerErrorCode is the HTTP code returned for type CounselingUpdateAllowanceInternalServerError -const CounselingUpdateAllowanceInternalServerErrorCode int = 500 - -/* -CounselingUpdateAllowanceInternalServerError A server error occurred - -swagger:response counselingUpdateAllowanceInternalServerError -*/ -type CounselingUpdateAllowanceInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateAllowanceInternalServerError creates CounselingUpdateAllowanceInternalServerError with default headers values -func NewCounselingUpdateAllowanceInternalServerError() *CounselingUpdateAllowanceInternalServerError { - - return &CounselingUpdateAllowanceInternalServerError{} -} - -// WithPayload adds the payload to the counseling update allowance internal server error response -func (o *CounselingUpdateAllowanceInternalServerError) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update allowance internal server error response -func (o *CounselingUpdateAllowanceInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateAllowanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go deleted file mode 100644 index ee72f481d97..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CounselingUpdateAllowanceURL generates an URL for the counseling update allowance operation -type CounselingUpdateAllowanceURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CounselingUpdateAllowanceURL) WithBasePath(bp string) *CounselingUpdateAllowanceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CounselingUpdateAllowanceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CounselingUpdateAllowanceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/counseling/orders/{orderID}/allowances" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on CounselingUpdateAllowanceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CounselingUpdateAllowanceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CounselingUpdateAllowanceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CounselingUpdateAllowanceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CounselingUpdateAllowanceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CounselingUpdateAllowanceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CounselingUpdateAllowanceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go deleted file mode 100644 index 87f469da7e7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CounselingUpdateOrderHandlerFunc turns a function with the right signature into a counseling update order handler -type CounselingUpdateOrderHandlerFunc func(CounselingUpdateOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CounselingUpdateOrderHandlerFunc) Handle(params CounselingUpdateOrderParams) middleware.Responder { - return fn(params) -} - -// CounselingUpdateOrderHandler interface for that can handle valid counseling update order params -type CounselingUpdateOrderHandler interface { - Handle(CounselingUpdateOrderParams) middleware.Responder -} - -// NewCounselingUpdateOrder creates a new http.Handler for the counseling update order operation -func NewCounselingUpdateOrder(ctx *middleware.Context, handler CounselingUpdateOrderHandler) *CounselingUpdateOrder { - return &CounselingUpdateOrder{Context: ctx, Handler: handler} -} - -/* - CounselingUpdateOrder swagger:route PATCH /counseling/orders/{orderID} order counselingUpdateOrder - -Updates an order (performed by a services counselor) - -All fields sent in this request will be set on the order referenced -*/ -type CounselingUpdateOrder struct { - Context *middleware.Context - Handler CounselingUpdateOrderHandler -} - -func (o *CounselingUpdateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCounselingUpdateOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go deleted file mode 100644 index e713fd23542..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCounselingUpdateOrderParams creates a new CounselingUpdateOrderParams object -// -// There are no default values defined in the spec. -func NewCounselingUpdateOrderParams() CounselingUpdateOrderParams { - - return CounselingUpdateOrderParams{} -} - -// CounselingUpdateOrderParams contains all the bound params for the counseling update order operation -// typically these are obtained from a http.Request -// -// swagger:parameters counselingUpdateOrder -type CounselingUpdateOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.CounselingUpdateOrderPayload - /*ID of order to update - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCounselingUpdateOrderParams() beforehand. -func (o *CounselingUpdateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CounselingUpdateOrderPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *CounselingUpdateOrderParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *CounselingUpdateOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *CounselingUpdateOrderParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go deleted file mode 100644 index 6eabb9a0581..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CounselingUpdateOrderOKCode is the HTTP code returned for type CounselingUpdateOrderOK -const CounselingUpdateOrderOKCode int = 200 - -/* -CounselingUpdateOrderOK updated instance of orders - -swagger:response counselingUpdateOrderOK -*/ -type CounselingUpdateOrderOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderOK creates CounselingUpdateOrderOK with default headers values -func NewCounselingUpdateOrderOK() *CounselingUpdateOrderOK { - - return &CounselingUpdateOrderOK{} -} - -// WithPayload adds the payload to the counseling update order o k response -func (o *CounselingUpdateOrderOK) WithPayload(payload *ghcmessages.Order) *CounselingUpdateOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order o k response -func (o *CounselingUpdateOrderOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateOrderForbiddenCode is the HTTP code returned for type CounselingUpdateOrderForbidden -const CounselingUpdateOrderForbiddenCode int = 403 - -/* -CounselingUpdateOrderForbidden The request was denied - -swagger:response counselingUpdateOrderForbidden -*/ -type CounselingUpdateOrderForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderForbidden creates CounselingUpdateOrderForbidden with default headers values -func NewCounselingUpdateOrderForbidden() *CounselingUpdateOrderForbidden { - - return &CounselingUpdateOrderForbidden{} -} - -// WithPayload adds the payload to the counseling update order forbidden response -func (o *CounselingUpdateOrderForbidden) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order forbidden response -func (o *CounselingUpdateOrderForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateOrderNotFoundCode is the HTTP code returned for type CounselingUpdateOrderNotFound -const CounselingUpdateOrderNotFoundCode int = 404 - -/* -CounselingUpdateOrderNotFound The requested resource wasn't found - -swagger:response counselingUpdateOrderNotFound -*/ -type CounselingUpdateOrderNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderNotFound creates CounselingUpdateOrderNotFound with default headers values -func NewCounselingUpdateOrderNotFound() *CounselingUpdateOrderNotFound { - - return &CounselingUpdateOrderNotFound{} -} - -// WithPayload adds the payload to the counseling update order not found response -func (o *CounselingUpdateOrderNotFound) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order not found response -func (o *CounselingUpdateOrderNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateOrderPreconditionFailedCode is the HTTP code returned for type CounselingUpdateOrderPreconditionFailed -const CounselingUpdateOrderPreconditionFailedCode int = 412 - -/* -CounselingUpdateOrderPreconditionFailed Precondition failed - -swagger:response counselingUpdateOrderPreconditionFailed -*/ -type CounselingUpdateOrderPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderPreconditionFailed creates CounselingUpdateOrderPreconditionFailed with default headers values -func NewCounselingUpdateOrderPreconditionFailed() *CounselingUpdateOrderPreconditionFailed { - - return &CounselingUpdateOrderPreconditionFailed{} -} - -// WithPayload adds the payload to the counseling update order precondition failed response -func (o *CounselingUpdateOrderPreconditionFailed) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order precondition failed response -func (o *CounselingUpdateOrderPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateOrderUnprocessableEntityCode is the HTTP code returned for type CounselingUpdateOrderUnprocessableEntity -const CounselingUpdateOrderUnprocessableEntityCode int = 422 - -/* -CounselingUpdateOrderUnprocessableEntity The payload was unprocessable. - -swagger:response counselingUpdateOrderUnprocessableEntity -*/ -type CounselingUpdateOrderUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderUnprocessableEntity creates CounselingUpdateOrderUnprocessableEntity with default headers values -func NewCounselingUpdateOrderUnprocessableEntity() *CounselingUpdateOrderUnprocessableEntity { - - return &CounselingUpdateOrderUnprocessableEntity{} -} - -// WithPayload adds the payload to the counseling update order unprocessable entity response -func (o *CounselingUpdateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CounselingUpdateOrderUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order unprocessable entity response -func (o *CounselingUpdateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CounselingUpdateOrderInternalServerErrorCode is the HTTP code returned for type CounselingUpdateOrderInternalServerError -const CounselingUpdateOrderInternalServerErrorCode int = 500 - -/* -CounselingUpdateOrderInternalServerError A server error occurred - -swagger:response counselingUpdateOrderInternalServerError -*/ -type CounselingUpdateOrderInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCounselingUpdateOrderInternalServerError creates CounselingUpdateOrderInternalServerError with default headers values -func NewCounselingUpdateOrderInternalServerError() *CounselingUpdateOrderInternalServerError { - - return &CounselingUpdateOrderInternalServerError{} -} - -// WithPayload adds the payload to the counseling update order internal server error response -func (o *CounselingUpdateOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the counseling update order internal server error response -func (o *CounselingUpdateOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CounselingUpdateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go deleted file mode 100644 index 5835a42eeaf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CounselingUpdateOrderURL generates an URL for the counseling update order operation -type CounselingUpdateOrderURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CounselingUpdateOrderURL) WithBasePath(bp string) *CounselingUpdateOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CounselingUpdateOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CounselingUpdateOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/counseling/orders/{orderID}" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on CounselingUpdateOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CounselingUpdateOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CounselingUpdateOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CounselingUpdateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CounselingUpdateOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CounselingUpdateOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CounselingUpdateOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order.go b/pkg/gen/ghcapi/ghcoperations/order/create_order.go deleted file mode 100644 index 7dbf9d65331..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/create_order.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateOrderHandlerFunc turns a function with the right signature into a create order handler -type CreateOrderHandlerFunc func(CreateOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateOrderHandlerFunc) Handle(params CreateOrderParams) middleware.Responder { - return fn(params) -} - -// CreateOrderHandler interface for that can handle valid create order params -type CreateOrderHandler interface { - Handle(CreateOrderParams) middleware.Responder -} - -// NewCreateOrder creates a new http.Handler for the create order operation -func NewCreateOrder(ctx *middleware.Context, handler CreateOrderHandler) *CreateOrder { - return &CreateOrder{Context: ctx, Handler: handler} -} - -/* - CreateOrder swagger:route POST /orders order createOrder - -# Creates an orders model for a logged-in user - -Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move -*/ -type CreateOrder struct { - Context *middleware.Context - Handler CreateOrderHandler -} - -func (o *CreateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go deleted file mode 100644 index 769a4dda61a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateOrderParams creates a new CreateOrderParams object -// -// There are no default values defined in the spec. -func NewCreateOrderParams() CreateOrderParams { - - return CreateOrderParams{} -} - -// CreateOrderParams contains all the bound params for the create order operation -// typically these are obtained from a http.Request -// -// swagger:parameters createOrder -type CreateOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - CreateOrders *ghcmessages.CreateOrders -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateOrderParams() beforehand. -func (o *CreateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateOrders - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("createOrders", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateOrders = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go deleted file mode 100644 index eeeab3fb41c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateOrderOKCode is the HTTP code returned for type CreateOrderOK -const CreateOrderOKCode int = 200 - -/* -CreateOrderOK created instance of orders - -swagger:response createOrderOK -*/ -type CreateOrderOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewCreateOrderOK creates CreateOrderOK with default headers values -func NewCreateOrderOK() *CreateOrderOK { - - return &CreateOrderOK{} -} - -// WithPayload adds the payload to the create order o k response -func (o *CreateOrderOK) WithPayload(payload *ghcmessages.Order) *CreateOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create order o k response -func (o *CreateOrderOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateOrderBadRequestCode is the HTTP code returned for type CreateOrderBadRequest -const CreateOrderBadRequestCode int = 400 - -/* -CreateOrderBadRequest invalid request - -swagger:response createOrderBadRequest -*/ -type CreateOrderBadRequest struct { -} - -// NewCreateOrderBadRequest creates CreateOrderBadRequest with default headers values -func NewCreateOrderBadRequest() *CreateOrderBadRequest { - - return &CreateOrderBadRequest{} -} - -// WriteResponse to the client -func (o *CreateOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateOrderUnauthorizedCode is the HTTP code returned for type CreateOrderUnauthorized -const CreateOrderUnauthorizedCode int = 401 - -/* -CreateOrderUnauthorized request requires user authentication - -swagger:response createOrderUnauthorized -*/ -type CreateOrderUnauthorized struct { -} - -// NewCreateOrderUnauthorized creates CreateOrderUnauthorized with default headers values -func NewCreateOrderUnauthorized() *CreateOrderUnauthorized { - - return &CreateOrderUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateOrderForbiddenCode is the HTTP code returned for type CreateOrderForbidden -const CreateOrderForbiddenCode int = 403 - -/* -CreateOrderForbidden user is not authorized - -swagger:response createOrderForbidden -*/ -type CreateOrderForbidden struct { -} - -// NewCreateOrderForbidden creates CreateOrderForbidden with default headers values -func NewCreateOrderForbidden() *CreateOrderForbidden { - - return &CreateOrderForbidden{} -} - -// WriteResponse to the client -func (o *CreateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateOrderUnprocessableEntityCode is the HTTP code returned for type CreateOrderUnprocessableEntity -const CreateOrderUnprocessableEntityCode int = 422 - -/* -CreateOrderUnprocessableEntity The payload was unprocessable. - -swagger:response createOrderUnprocessableEntity -*/ -type CreateOrderUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateOrderUnprocessableEntity creates CreateOrderUnprocessableEntity with default headers values -func NewCreateOrderUnprocessableEntity() *CreateOrderUnprocessableEntity { - - return &CreateOrderUnprocessableEntity{} -} - -// WithPayload adds the payload to the create order unprocessable entity response -func (o *CreateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateOrderUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create order unprocessable entity response -func (o *CreateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateOrderInternalServerErrorCode is the HTTP code returned for type CreateOrderInternalServerError -const CreateOrderInternalServerErrorCode int = 500 - -/* -CreateOrderInternalServerError internal server error - -swagger:response createOrderInternalServerError -*/ -type CreateOrderInternalServerError struct { -} - -// NewCreateOrderInternalServerError creates CreateOrderInternalServerError with default headers values -func NewCreateOrderInternalServerError() *CreateOrderInternalServerError { - - return &CreateOrderInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go deleted file mode 100644 index 948a452892b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateOrderURL generates an URL for the create order operation -type CreateOrderURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOrderURL) WithBasePath(bp string) *CreateOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order.go b/pkg/gen/ghcapi/ghcoperations/order/get_order.go deleted file mode 100644 index 4dc9b7361b7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/get_order.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetOrderHandlerFunc turns a function with the right signature into a get order handler -type GetOrderHandlerFunc func(GetOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetOrderHandlerFunc) Handle(params GetOrderParams) middleware.Responder { - return fn(params) -} - -// GetOrderHandler interface for that can handle valid get order params -type GetOrderHandler interface { - Handle(GetOrderParams) middleware.Responder -} - -// NewGetOrder creates a new http.Handler for the get order operation -func NewGetOrder(ctx *middleware.Context, handler GetOrderHandler) *GetOrder { - return &GetOrder{Context: ctx, Handler: handler} -} - -/* - GetOrder swagger:route GET /orders/{orderID} order getOrder - -# Gets an order by ID - -Gets an order -*/ -type GetOrder struct { - Context *middleware.Context - Handler GetOrderHandler -} - -func (o *GetOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go deleted file mode 100644 index a37d96bd6d5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetOrderParams creates a new GetOrderParams object -// -// There are no default values defined in the spec. -func NewGetOrderParams() GetOrderParams { - - return GetOrderParams{} -} - -// GetOrderParams contains all the bound params for the get order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getOrder -type GetOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetOrderParams() beforehand. -func (o *GetOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *GetOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *GetOrderParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go deleted file mode 100644 index 4a4963f7d20..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetOrderOKCode is the HTTP code returned for type GetOrderOK -const GetOrderOKCode int = 200 - -/* -GetOrderOK Successfully retrieved order - -swagger:response getOrderOK -*/ -type GetOrderOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewGetOrderOK creates GetOrderOK with default headers values -func NewGetOrderOK() *GetOrderOK { - - return &GetOrderOK{} -} - -// WithPayload adds the payload to the get order o k response -func (o *GetOrderOK) WithPayload(payload *ghcmessages.Order) *GetOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order o k response -func (o *GetOrderOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOrderBadRequestCode is the HTTP code returned for type GetOrderBadRequest -const GetOrderBadRequestCode int = 400 - -/* -GetOrderBadRequest The request payload is invalid - -swagger:response getOrderBadRequest -*/ -type GetOrderBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetOrderBadRequest creates GetOrderBadRequest with default headers values -func NewGetOrderBadRequest() *GetOrderBadRequest { - - return &GetOrderBadRequest{} -} - -// WithPayload adds the payload to the get order bad request response -func (o *GetOrderBadRequest) WithPayload(payload *ghcmessages.Error) *GetOrderBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order bad request response -func (o *GetOrderBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOrderUnauthorizedCode is the HTTP code returned for type GetOrderUnauthorized -const GetOrderUnauthorizedCode int = 401 - -/* -GetOrderUnauthorized The request was denied - -swagger:response getOrderUnauthorized -*/ -type GetOrderUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetOrderUnauthorized creates GetOrderUnauthorized with default headers values -func NewGetOrderUnauthorized() *GetOrderUnauthorized { - - return &GetOrderUnauthorized{} -} - -// WithPayload adds the payload to the get order unauthorized response -func (o *GetOrderUnauthorized) WithPayload(payload *ghcmessages.Error) *GetOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order unauthorized response -func (o *GetOrderUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOrderForbiddenCode is the HTTP code returned for type GetOrderForbidden -const GetOrderForbiddenCode int = 403 - -/* -GetOrderForbidden The request was denied - -swagger:response getOrderForbidden -*/ -type GetOrderForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetOrderForbidden creates GetOrderForbidden with default headers values -func NewGetOrderForbidden() *GetOrderForbidden { - - return &GetOrderForbidden{} -} - -// WithPayload adds the payload to the get order forbidden response -func (o *GetOrderForbidden) WithPayload(payload *ghcmessages.Error) *GetOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order forbidden response -func (o *GetOrderForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOrderNotFoundCode is the HTTP code returned for type GetOrderNotFound -const GetOrderNotFoundCode int = 404 - -/* -GetOrderNotFound The requested resource wasn't found - -swagger:response getOrderNotFound -*/ -type GetOrderNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetOrderNotFound creates GetOrderNotFound with default headers values -func NewGetOrderNotFound() *GetOrderNotFound { - - return &GetOrderNotFound{} -} - -// WithPayload adds the payload to the get order not found response -func (o *GetOrderNotFound) WithPayload(payload *ghcmessages.Error) *GetOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order not found response -func (o *GetOrderNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetOrderInternalServerErrorCode is the HTTP code returned for type GetOrderInternalServerError -const GetOrderInternalServerErrorCode int = 500 - -/* -GetOrderInternalServerError A server error occurred - -swagger:response getOrderInternalServerError -*/ -type GetOrderInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetOrderInternalServerError creates GetOrderInternalServerError with default headers values -func NewGetOrderInternalServerError() *GetOrderInternalServerError { - - return &GetOrderInternalServerError{} -} - -// WithPayload adds the payload to the get order internal server error response -func (o *GetOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *GetOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get order internal server error response -func (o *GetOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go deleted file mode 100644 index 177c957da31..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetOrderURL generates an URL for the get order operation -type GetOrderURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOrderURL) WithBasePath(bp string) *GetOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on GetOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go deleted file mode 100644 index cc058e011e2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateAllowanceHandlerFunc turns a function with the right signature into a update allowance handler -type UpdateAllowanceHandlerFunc func(UpdateAllowanceParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateAllowanceHandlerFunc) Handle(params UpdateAllowanceParams) middleware.Responder { - return fn(params) -} - -// UpdateAllowanceHandler interface for that can handle valid update allowance params -type UpdateAllowanceHandler interface { - Handle(UpdateAllowanceParams) middleware.Responder -} - -// NewUpdateAllowance creates a new http.Handler for the update allowance operation -func NewUpdateAllowance(ctx *middleware.Context, handler UpdateAllowanceHandler) *UpdateAllowance { - return &UpdateAllowance{Context: ctx, Handler: handler} -} - -/* - UpdateAllowance swagger:route PATCH /orders/{orderID}/allowances order updateAllowance - -Updates an allowance (Orders with Entitlements) - -All fields sent in this request will be set on the order referenced -*/ -type UpdateAllowance struct { - Context *middleware.Context - Handler UpdateAllowanceHandler -} - -func (o *UpdateAllowance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateAllowanceParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go deleted file mode 100644 index 9d1a36f9195..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateAllowanceParams creates a new UpdateAllowanceParams object -// -// There are no default values defined in the spec. -func NewUpdateAllowanceParams() UpdateAllowanceParams { - - return UpdateAllowanceParams{} -} - -// UpdateAllowanceParams contains all the bound params for the update allowance operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateAllowance -type UpdateAllowanceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateAllowancePayload - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateAllowanceParams() beforehand. -func (o *UpdateAllowanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateAllowancePayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateAllowanceParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *UpdateAllowanceParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *UpdateAllowanceParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go deleted file mode 100644 index 119b8685e24..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateAllowanceOKCode is the HTTP code returned for type UpdateAllowanceOK -const UpdateAllowanceOKCode int = 200 - -/* -UpdateAllowanceOK updated instance of allowance - -swagger:response updateAllowanceOK -*/ -type UpdateAllowanceOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewUpdateAllowanceOK creates UpdateAllowanceOK with default headers values -func NewUpdateAllowanceOK() *UpdateAllowanceOK { - - return &UpdateAllowanceOK{} -} - -// WithPayload adds the payload to the update allowance o k response -func (o *UpdateAllowanceOK) WithPayload(payload *ghcmessages.Order) *UpdateAllowanceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance o k response -func (o *UpdateAllowanceOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAllowanceForbiddenCode is the HTTP code returned for type UpdateAllowanceForbidden -const UpdateAllowanceForbiddenCode int = 403 - -/* -UpdateAllowanceForbidden The request was denied - -swagger:response updateAllowanceForbidden -*/ -type UpdateAllowanceForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAllowanceForbidden creates UpdateAllowanceForbidden with default headers values -func NewUpdateAllowanceForbidden() *UpdateAllowanceForbidden { - - return &UpdateAllowanceForbidden{} -} - -// WithPayload adds the payload to the update allowance forbidden response -func (o *UpdateAllowanceForbidden) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance forbidden response -func (o *UpdateAllowanceForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAllowanceNotFoundCode is the HTTP code returned for type UpdateAllowanceNotFound -const UpdateAllowanceNotFoundCode int = 404 - -/* -UpdateAllowanceNotFound The requested resource wasn't found - -swagger:response updateAllowanceNotFound -*/ -type UpdateAllowanceNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAllowanceNotFound creates UpdateAllowanceNotFound with default headers values -func NewUpdateAllowanceNotFound() *UpdateAllowanceNotFound { - - return &UpdateAllowanceNotFound{} -} - -// WithPayload adds the payload to the update allowance not found response -func (o *UpdateAllowanceNotFound) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance not found response -func (o *UpdateAllowanceNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAllowancePreconditionFailedCode is the HTTP code returned for type UpdateAllowancePreconditionFailed -const UpdateAllowancePreconditionFailedCode int = 412 - -/* -UpdateAllowancePreconditionFailed Precondition failed - -swagger:response updateAllowancePreconditionFailed -*/ -type UpdateAllowancePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAllowancePreconditionFailed creates UpdateAllowancePreconditionFailed with default headers values -func NewUpdateAllowancePreconditionFailed() *UpdateAllowancePreconditionFailed { - - return &UpdateAllowancePreconditionFailed{} -} - -// WithPayload adds the payload to the update allowance precondition failed response -func (o *UpdateAllowancePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateAllowancePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance precondition failed response -func (o *UpdateAllowancePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowancePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAllowanceUnprocessableEntityCode is the HTTP code returned for type UpdateAllowanceUnprocessableEntity -const UpdateAllowanceUnprocessableEntityCode int = 422 - -/* -UpdateAllowanceUnprocessableEntity The payload was unprocessable. - -swagger:response updateAllowanceUnprocessableEntity -*/ -type UpdateAllowanceUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateAllowanceUnprocessableEntity creates UpdateAllowanceUnprocessableEntity with default headers values -func NewUpdateAllowanceUnprocessableEntity() *UpdateAllowanceUnprocessableEntity { - - return &UpdateAllowanceUnprocessableEntity{} -} - -// WithPayload adds the payload to the update allowance unprocessable entity response -func (o *UpdateAllowanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateAllowanceUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance unprocessable entity response -func (o *UpdateAllowanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateAllowanceInternalServerErrorCode is the HTTP code returned for type UpdateAllowanceInternalServerError -const UpdateAllowanceInternalServerErrorCode int = 500 - -/* -UpdateAllowanceInternalServerError A server error occurred - -swagger:response updateAllowanceInternalServerError -*/ -type UpdateAllowanceInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateAllowanceInternalServerError creates UpdateAllowanceInternalServerError with default headers values -func NewUpdateAllowanceInternalServerError() *UpdateAllowanceInternalServerError { - - return &UpdateAllowanceInternalServerError{} -} - -// WithPayload adds the payload to the update allowance internal server error response -func (o *UpdateAllowanceInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update allowance internal server error response -func (o *UpdateAllowanceInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateAllowanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go deleted file mode 100644 index d1f41da8358..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateAllowanceURL generates an URL for the update allowance operation -type UpdateAllowanceURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAllowanceURL) WithBasePath(bp string) *UpdateAllowanceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateAllowanceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateAllowanceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}/allowances" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on UpdateAllowanceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateAllowanceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateAllowanceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateAllowanceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateAllowanceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateAllowanceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateAllowanceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go deleted file mode 100644 index 4d09b1a2372..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateBillableWeightHandlerFunc turns a function with the right signature into a update billable weight handler -type UpdateBillableWeightHandlerFunc func(UpdateBillableWeightParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateBillableWeightHandlerFunc) Handle(params UpdateBillableWeightParams) middleware.Responder { - return fn(params) -} - -// UpdateBillableWeightHandler interface for that can handle valid update billable weight params -type UpdateBillableWeightHandler interface { - Handle(UpdateBillableWeightParams) middleware.Responder -} - -// NewUpdateBillableWeight creates a new http.Handler for the update billable weight operation -func NewUpdateBillableWeight(ctx *middleware.Context, handler UpdateBillableWeightHandler) *UpdateBillableWeight { - return &UpdateBillableWeight{Context: ctx, Handler: handler} -} - -/* - UpdateBillableWeight swagger:route PATCH /orders/{orderID}/update-billable-weight order updateBillableWeight - -# Updates the max billable weight - -Updates the DBAuthorizedWeight attribute for the Order Entitlements= -*/ -type UpdateBillableWeight struct { - Context *middleware.Context - Handler UpdateBillableWeightHandler -} - -func (o *UpdateBillableWeight) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateBillableWeightParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go deleted file mode 100644 index 796a273c846..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateBillableWeightParams creates a new UpdateBillableWeightParams object -// -// There are no default values defined in the spec. -func NewUpdateBillableWeightParams() UpdateBillableWeightParams { - - return UpdateBillableWeightParams{} -} - -// UpdateBillableWeightParams contains all the bound params for the update billable weight operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateBillableWeight -type UpdateBillableWeightParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateBillableWeightPayload - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateBillableWeightParams() beforehand. -func (o *UpdateBillableWeightParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateBillableWeightPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateBillableWeightParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *UpdateBillableWeightParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *UpdateBillableWeightParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go deleted file mode 100644 index 5725e416a42..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateBillableWeightOKCode is the HTTP code returned for type UpdateBillableWeightOK -const UpdateBillableWeightOKCode int = 200 - -/* -UpdateBillableWeightOK updated Order - -swagger:response updateBillableWeightOK -*/ -type UpdateBillableWeightOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewUpdateBillableWeightOK creates UpdateBillableWeightOK with default headers values -func NewUpdateBillableWeightOK() *UpdateBillableWeightOK { - - return &UpdateBillableWeightOK{} -} - -// WithPayload adds the payload to the update billable weight o k response -func (o *UpdateBillableWeightOK) WithPayload(payload *ghcmessages.Order) *UpdateBillableWeightOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight o k response -func (o *UpdateBillableWeightOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateBillableWeightForbiddenCode is the HTTP code returned for type UpdateBillableWeightForbidden -const UpdateBillableWeightForbiddenCode int = 403 - -/* -UpdateBillableWeightForbidden The request was denied - -swagger:response updateBillableWeightForbidden -*/ -type UpdateBillableWeightForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateBillableWeightForbidden creates UpdateBillableWeightForbidden with default headers values -func NewUpdateBillableWeightForbidden() *UpdateBillableWeightForbidden { - - return &UpdateBillableWeightForbidden{} -} - -// WithPayload adds the payload to the update billable weight forbidden response -func (o *UpdateBillableWeightForbidden) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight forbidden response -func (o *UpdateBillableWeightForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateBillableWeightNotFoundCode is the HTTP code returned for type UpdateBillableWeightNotFound -const UpdateBillableWeightNotFoundCode int = 404 - -/* -UpdateBillableWeightNotFound The requested resource wasn't found - -swagger:response updateBillableWeightNotFound -*/ -type UpdateBillableWeightNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateBillableWeightNotFound creates UpdateBillableWeightNotFound with default headers values -func NewUpdateBillableWeightNotFound() *UpdateBillableWeightNotFound { - - return &UpdateBillableWeightNotFound{} -} - -// WithPayload adds the payload to the update billable weight not found response -func (o *UpdateBillableWeightNotFound) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight not found response -func (o *UpdateBillableWeightNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateBillableWeightPreconditionFailedCode is the HTTP code returned for type UpdateBillableWeightPreconditionFailed -const UpdateBillableWeightPreconditionFailedCode int = 412 - -/* -UpdateBillableWeightPreconditionFailed Precondition failed - -swagger:response updateBillableWeightPreconditionFailed -*/ -type UpdateBillableWeightPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateBillableWeightPreconditionFailed creates UpdateBillableWeightPreconditionFailed with default headers values -func NewUpdateBillableWeightPreconditionFailed() *UpdateBillableWeightPreconditionFailed { - - return &UpdateBillableWeightPreconditionFailed{} -} - -// WithPayload adds the payload to the update billable weight precondition failed response -func (o *UpdateBillableWeightPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight precondition failed response -func (o *UpdateBillableWeightPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateBillableWeightUnprocessableEntityCode is the HTTP code returned for type UpdateBillableWeightUnprocessableEntity -const UpdateBillableWeightUnprocessableEntityCode int = 422 - -/* -UpdateBillableWeightUnprocessableEntity The payload was unprocessable. - -swagger:response updateBillableWeightUnprocessableEntity -*/ -type UpdateBillableWeightUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateBillableWeightUnprocessableEntity creates UpdateBillableWeightUnprocessableEntity with default headers values -func NewUpdateBillableWeightUnprocessableEntity() *UpdateBillableWeightUnprocessableEntity { - - return &UpdateBillableWeightUnprocessableEntity{} -} - -// WithPayload adds the payload to the update billable weight unprocessable entity response -func (o *UpdateBillableWeightUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateBillableWeightUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight unprocessable entity response -func (o *UpdateBillableWeightUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateBillableWeightInternalServerErrorCode is the HTTP code returned for type UpdateBillableWeightInternalServerError -const UpdateBillableWeightInternalServerErrorCode int = 500 - -/* -UpdateBillableWeightInternalServerError A server error occurred - -swagger:response updateBillableWeightInternalServerError -*/ -type UpdateBillableWeightInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateBillableWeightInternalServerError creates UpdateBillableWeightInternalServerError with default headers values -func NewUpdateBillableWeightInternalServerError() *UpdateBillableWeightInternalServerError { - - return &UpdateBillableWeightInternalServerError{} -} - -// WithPayload adds the payload to the update billable weight internal server error response -func (o *UpdateBillableWeightInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update billable weight internal server error response -func (o *UpdateBillableWeightInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateBillableWeightInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go deleted file mode 100644 index b09e4526219..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateBillableWeightURL generates an URL for the update billable weight operation -type UpdateBillableWeightURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateBillableWeightURL) WithBasePath(bp string) *UpdateBillableWeightURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateBillableWeightURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateBillableWeightURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}/update-billable-weight" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on UpdateBillableWeightURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateBillableWeightURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateBillableWeightURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateBillableWeightURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateBillableWeightURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateBillableWeightURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateBillableWeightURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go deleted file mode 100644 index 09c5ab4de0e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMaxBillableWeightAsTIOHandlerFunc turns a function with the right signature into a update max billable weight as t i o handler -type UpdateMaxBillableWeightAsTIOHandlerFunc func(UpdateMaxBillableWeightAsTIOParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMaxBillableWeightAsTIOHandlerFunc) Handle(params UpdateMaxBillableWeightAsTIOParams) middleware.Responder { - return fn(params) -} - -// UpdateMaxBillableWeightAsTIOHandler interface for that can handle valid update max billable weight as t i o params -type UpdateMaxBillableWeightAsTIOHandler interface { - Handle(UpdateMaxBillableWeightAsTIOParams) middleware.Responder -} - -// NewUpdateMaxBillableWeightAsTIO creates a new http.Handler for the update max billable weight as t i o operation -func NewUpdateMaxBillableWeightAsTIO(ctx *middleware.Context, handler UpdateMaxBillableWeightAsTIOHandler) *UpdateMaxBillableWeightAsTIO { - return &UpdateMaxBillableWeightAsTIO{Context: ctx, Handler: handler} -} - -/* - UpdateMaxBillableWeightAsTIO swagger:route PATCH /orders/{orderID}/update-max-billable-weight/tio order updateMaxBillableWeightAsTIO - -# Updates the max billable weight with TIO remarks - -Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks -*/ -type UpdateMaxBillableWeightAsTIO struct { - Context *middleware.Context - Handler UpdateMaxBillableWeightAsTIOHandler -} - -func (o *UpdateMaxBillableWeightAsTIO) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMaxBillableWeightAsTIOParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go deleted file mode 100644 index b9404407abe..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMaxBillableWeightAsTIOParams creates a new UpdateMaxBillableWeightAsTIOParams object -// -// There are no default values defined in the spec. -func NewUpdateMaxBillableWeightAsTIOParams() UpdateMaxBillableWeightAsTIOParams { - - return UpdateMaxBillableWeightAsTIOParams{} -} - -// UpdateMaxBillableWeightAsTIOParams contains all the bound params for the update max billable weight as t i o operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMaxBillableWeightAsTIO -type UpdateMaxBillableWeightAsTIOParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateMaxBillableWeightAsTIOPayload - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMaxBillableWeightAsTIOParams() beforehand. -func (o *UpdateMaxBillableWeightAsTIOParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateMaxBillableWeightAsTIOPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMaxBillableWeightAsTIOParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *UpdateMaxBillableWeightAsTIOParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *UpdateMaxBillableWeightAsTIOParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go deleted file mode 100644 index f0a5b9655f7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMaxBillableWeightAsTIOOKCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOOK -const UpdateMaxBillableWeightAsTIOOKCode int = 200 - -/* -UpdateMaxBillableWeightAsTIOOK updated Order - -swagger:response updateMaxBillableWeightAsTIOOK -*/ -type UpdateMaxBillableWeightAsTIOOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIOOK creates UpdateMaxBillableWeightAsTIOOK with default headers values -func NewUpdateMaxBillableWeightAsTIOOK() *UpdateMaxBillableWeightAsTIOOK { - - return &UpdateMaxBillableWeightAsTIOOK{} -} - -// WithPayload adds the payload to the update max billable weight as t i o o k response -func (o *UpdateMaxBillableWeightAsTIOOK) WithPayload(payload *ghcmessages.Order) *UpdateMaxBillableWeightAsTIOOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o o k response -func (o *UpdateMaxBillableWeightAsTIOOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIOOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMaxBillableWeightAsTIOForbiddenCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOForbidden -const UpdateMaxBillableWeightAsTIOForbiddenCode int = 403 - -/* -UpdateMaxBillableWeightAsTIOForbidden The request was denied - -swagger:response updateMaxBillableWeightAsTIOForbidden -*/ -type UpdateMaxBillableWeightAsTIOForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIOForbidden creates UpdateMaxBillableWeightAsTIOForbidden with default headers values -func NewUpdateMaxBillableWeightAsTIOForbidden() *UpdateMaxBillableWeightAsTIOForbidden { - - return &UpdateMaxBillableWeightAsTIOForbidden{} -} - -// WithPayload adds the payload to the update max billable weight as t i o forbidden response -func (o *UpdateMaxBillableWeightAsTIOForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o forbidden response -func (o *UpdateMaxBillableWeightAsTIOForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIOForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMaxBillableWeightAsTIONotFoundCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIONotFound -const UpdateMaxBillableWeightAsTIONotFoundCode int = 404 - -/* -UpdateMaxBillableWeightAsTIONotFound The requested resource wasn't found - -swagger:response updateMaxBillableWeightAsTIONotFound -*/ -type UpdateMaxBillableWeightAsTIONotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIONotFound creates UpdateMaxBillableWeightAsTIONotFound with default headers values -func NewUpdateMaxBillableWeightAsTIONotFound() *UpdateMaxBillableWeightAsTIONotFound { - - return &UpdateMaxBillableWeightAsTIONotFound{} -} - -// WithPayload adds the payload to the update max billable weight as t i o not found response -func (o *UpdateMaxBillableWeightAsTIONotFound) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIONotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o not found response -func (o *UpdateMaxBillableWeightAsTIONotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIONotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMaxBillableWeightAsTIOPreconditionFailedCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOPreconditionFailed -const UpdateMaxBillableWeightAsTIOPreconditionFailedCode int = 412 - -/* -UpdateMaxBillableWeightAsTIOPreconditionFailed Precondition failed - -swagger:response updateMaxBillableWeightAsTIOPreconditionFailed -*/ -type UpdateMaxBillableWeightAsTIOPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIOPreconditionFailed creates UpdateMaxBillableWeightAsTIOPreconditionFailed with default headers values -func NewUpdateMaxBillableWeightAsTIOPreconditionFailed() *UpdateMaxBillableWeightAsTIOPreconditionFailed { - - return &UpdateMaxBillableWeightAsTIOPreconditionFailed{} -} - -// WithPayload adds the payload to the update max billable weight as t i o precondition failed response -func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o precondition failed response -func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMaxBillableWeightAsTIOUnprocessableEntityCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOUnprocessableEntity -const UpdateMaxBillableWeightAsTIOUnprocessableEntityCode int = 422 - -/* -UpdateMaxBillableWeightAsTIOUnprocessableEntity The payload was unprocessable. - -swagger:response updateMaxBillableWeightAsTIOUnprocessableEntity -*/ -type UpdateMaxBillableWeightAsTIOUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIOUnprocessableEntity creates UpdateMaxBillableWeightAsTIOUnprocessableEntity with default headers values -func NewUpdateMaxBillableWeightAsTIOUnprocessableEntity() *UpdateMaxBillableWeightAsTIOUnprocessableEntity { - - return &UpdateMaxBillableWeightAsTIOUnprocessableEntity{} -} - -// WithPayload adds the payload to the update max billable weight as t i o unprocessable entity response -func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMaxBillableWeightAsTIOUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o unprocessable entity response -func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMaxBillableWeightAsTIOInternalServerErrorCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOInternalServerError -const UpdateMaxBillableWeightAsTIOInternalServerErrorCode int = 500 - -/* -UpdateMaxBillableWeightAsTIOInternalServerError A server error occurred - -swagger:response updateMaxBillableWeightAsTIOInternalServerError -*/ -type UpdateMaxBillableWeightAsTIOInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMaxBillableWeightAsTIOInternalServerError creates UpdateMaxBillableWeightAsTIOInternalServerError with default headers values -func NewUpdateMaxBillableWeightAsTIOInternalServerError() *UpdateMaxBillableWeightAsTIOInternalServerError { - - return &UpdateMaxBillableWeightAsTIOInternalServerError{} -} - -// WithPayload adds the payload to the update max billable weight as t i o internal server error response -func (o *UpdateMaxBillableWeightAsTIOInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update max billable weight as t i o internal server error response -func (o *UpdateMaxBillableWeightAsTIOInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMaxBillableWeightAsTIOInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go deleted file mode 100644 index 3f310e176fb..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMaxBillableWeightAsTIOURL generates an URL for the update max billable weight as t i o operation -type UpdateMaxBillableWeightAsTIOURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMaxBillableWeightAsTIOURL) WithBasePath(bp string) *UpdateMaxBillableWeightAsTIOURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMaxBillableWeightAsTIOURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMaxBillableWeightAsTIOURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}/update-max-billable-weight/tio" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on UpdateMaxBillableWeightAsTIOURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMaxBillableWeightAsTIOURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMaxBillableWeightAsTIOURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMaxBillableWeightAsTIOURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMaxBillableWeightAsTIOURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMaxBillableWeightAsTIOURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMaxBillableWeightAsTIOURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order.go b/pkg/gen/ghcapi/ghcoperations/order/update_order.go deleted file mode 100644 index 5f1b2051b2a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_order.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateOrderHandlerFunc turns a function with the right signature into a update order handler -type UpdateOrderHandlerFunc func(UpdateOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateOrderHandlerFunc) Handle(params UpdateOrderParams) middleware.Responder { - return fn(params) -} - -// UpdateOrderHandler interface for that can handle valid update order params -type UpdateOrderHandler interface { - Handle(UpdateOrderParams) middleware.Responder -} - -// NewUpdateOrder creates a new http.Handler for the update order operation -func NewUpdateOrder(ctx *middleware.Context, handler UpdateOrderHandler) *UpdateOrder { - return &UpdateOrder{Context: ctx, Handler: handler} -} - -/* - UpdateOrder swagger:route PATCH /orders/{orderID} order updateOrder - -# Updates an order - -All fields sent in this request will be set on the order referenced -*/ -type UpdateOrder struct { - Context *middleware.Context - Handler UpdateOrderHandler -} - -func (o *UpdateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go deleted file mode 100644 index acec9c7fb56..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateOrderParams creates a new UpdateOrderParams object -// -// There are no default values defined in the spec. -func NewUpdateOrderParams() UpdateOrderParams { - - return UpdateOrderParams{} -} - -// UpdateOrderParams contains all the bound params for the update order operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateOrder -type UpdateOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateOrderPayload - /*ID of order to use - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateOrderParams() beforehand. -func (o *UpdateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateOrderPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateOrderParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *UpdateOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *UpdateOrderParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go deleted file mode 100644 index 62a3e7c7441..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateOrderOKCode is the HTTP code returned for type UpdateOrderOK -const UpdateOrderOKCode int = 200 - -/* -UpdateOrderOK updated instance of orders - -swagger:response updateOrderOK -*/ -type UpdateOrderOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Order `json:"body,omitempty"` -} - -// NewUpdateOrderOK creates UpdateOrderOK with default headers values -func NewUpdateOrderOK() *UpdateOrderOK { - - return &UpdateOrderOK{} -} - -// WithPayload adds the payload to the update order o k response -func (o *UpdateOrderOK) WithPayload(payload *ghcmessages.Order) *UpdateOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order o k response -func (o *UpdateOrderOK) SetPayload(payload *ghcmessages.Order) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderBadRequestCode is the HTTP code returned for type UpdateOrderBadRequest -const UpdateOrderBadRequestCode int = 400 - -/* -UpdateOrderBadRequest The request payload is invalid - -swagger:response updateOrderBadRequest -*/ -type UpdateOrderBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderBadRequest creates UpdateOrderBadRequest with default headers values -func NewUpdateOrderBadRequest() *UpdateOrderBadRequest { - - return &UpdateOrderBadRequest{} -} - -// WithPayload adds the payload to the update order bad request response -func (o *UpdateOrderBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateOrderBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order bad request response -func (o *UpdateOrderBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderForbiddenCode is the HTTP code returned for type UpdateOrderForbidden -const UpdateOrderForbiddenCode int = 403 - -/* -UpdateOrderForbidden The request was denied - -swagger:response updateOrderForbidden -*/ -type UpdateOrderForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderForbidden creates UpdateOrderForbidden with default headers values -func NewUpdateOrderForbidden() *UpdateOrderForbidden { - - return &UpdateOrderForbidden{} -} - -// WithPayload adds the payload to the update order forbidden response -func (o *UpdateOrderForbidden) WithPayload(payload *ghcmessages.Error) *UpdateOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order forbidden response -func (o *UpdateOrderForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderNotFoundCode is the HTTP code returned for type UpdateOrderNotFound -const UpdateOrderNotFoundCode int = 404 - -/* -UpdateOrderNotFound The requested resource wasn't found - -swagger:response updateOrderNotFound -*/ -type UpdateOrderNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderNotFound creates UpdateOrderNotFound with default headers values -func NewUpdateOrderNotFound() *UpdateOrderNotFound { - - return &UpdateOrderNotFound{} -} - -// WithPayload adds the payload to the update order not found response -func (o *UpdateOrderNotFound) WithPayload(payload *ghcmessages.Error) *UpdateOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order not found response -func (o *UpdateOrderNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderConflictCode is the HTTP code returned for type UpdateOrderConflict -const UpdateOrderConflictCode int = 409 - -/* -UpdateOrderConflict Conflict error - -swagger:response updateOrderConflict -*/ -type UpdateOrderConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderConflict creates UpdateOrderConflict with default headers values -func NewUpdateOrderConflict() *UpdateOrderConflict { - - return &UpdateOrderConflict{} -} - -// WithPayload adds the payload to the update order conflict response -func (o *UpdateOrderConflict) WithPayload(payload *ghcmessages.Error) *UpdateOrderConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order conflict response -func (o *UpdateOrderConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderPreconditionFailedCode is the HTTP code returned for type UpdateOrderPreconditionFailed -const UpdateOrderPreconditionFailedCode int = 412 - -/* -UpdateOrderPreconditionFailed Precondition failed - -swagger:response updateOrderPreconditionFailed -*/ -type UpdateOrderPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderPreconditionFailed creates UpdateOrderPreconditionFailed with default headers values -func NewUpdateOrderPreconditionFailed() *UpdateOrderPreconditionFailed { - - return &UpdateOrderPreconditionFailed{} -} - -// WithPayload adds the payload to the update order precondition failed response -func (o *UpdateOrderPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateOrderPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order precondition failed response -func (o *UpdateOrderPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderUnprocessableEntityCode is the HTTP code returned for type UpdateOrderUnprocessableEntity -const UpdateOrderUnprocessableEntityCode int = 422 - -/* -UpdateOrderUnprocessableEntity The payload was unprocessable. - -swagger:response updateOrderUnprocessableEntity -*/ -type UpdateOrderUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateOrderUnprocessableEntity creates UpdateOrderUnprocessableEntity with default headers values -func NewUpdateOrderUnprocessableEntity() *UpdateOrderUnprocessableEntity { - - return &UpdateOrderUnprocessableEntity{} -} - -// WithPayload adds the payload to the update order unprocessable entity response -func (o *UpdateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateOrderUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order unprocessable entity response -func (o *UpdateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrderInternalServerErrorCode is the HTTP code returned for type UpdateOrderInternalServerError -const UpdateOrderInternalServerErrorCode int = 500 - -/* -UpdateOrderInternalServerError A server error occurred - -swagger:response updateOrderInternalServerError -*/ -type UpdateOrderInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateOrderInternalServerError creates UpdateOrderInternalServerError with default headers values -func NewUpdateOrderInternalServerError() *UpdateOrderInternalServerError { - - return &UpdateOrderInternalServerError{} -} - -// WithPayload adds the payload to the update order internal server error response -func (o *UpdateOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update order internal server error response -func (o *UpdateOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go deleted file mode 100644 index 397d0bf98a8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateOrderURL generates an URL for the update order operation -type UpdateOrderURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOrderURL) WithBasePath(bp string) *UpdateOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on UpdateOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go deleted file mode 100644 index 240571809c6..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UploadAmendedOrdersHandlerFunc turns a function with the right signature into a upload amended orders handler -type UploadAmendedOrdersHandlerFunc func(UploadAmendedOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UploadAmendedOrdersHandlerFunc) Handle(params UploadAmendedOrdersParams) middleware.Responder { - return fn(params) -} - -// UploadAmendedOrdersHandler interface for that can handle valid upload amended orders params -type UploadAmendedOrdersHandler interface { - Handle(UploadAmendedOrdersParams) middleware.Responder -} - -// NewUploadAmendedOrders creates a new http.Handler for the upload amended orders operation -func NewUploadAmendedOrders(ctx *middleware.Context, handler UploadAmendedOrdersHandler) *UploadAmendedOrders { - return &UploadAmendedOrders{Context: ctx, Handler: handler} -} - -/* - UploadAmendedOrders swagger:route POST /orders/{orderID}/upload_amended_orders order uploadAmendedOrders - -# Create an amended order for a given order - -Create an amended order for a given order -*/ -type UploadAmendedOrders struct { - Context *middleware.Context - Handler UploadAmendedOrdersHandler -} - -func (o *UploadAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUploadAmendedOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go deleted file mode 100644 index ba7dd983dc5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UploadAmendedOrdersMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var UploadAmendedOrdersMaxParseMemory int64 = 32 << 20 - -// NewUploadAmendedOrdersParams creates a new UploadAmendedOrdersParams object -// -// There are no default values defined in the spec. -func NewUploadAmendedOrdersParams() UploadAmendedOrdersParams { - - return UploadAmendedOrdersParams{} -} - -// UploadAmendedOrdersParams contains all the bound params for the upload amended orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters uploadAmendedOrders -type UploadAmendedOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the order - Required: true - In: path - */ - OrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUploadAmendedOrdersParams() beforehand. -func (o *UploadAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(UploadAmendedOrdersMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") - if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *UploadAmendedOrdersParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindOrderID binds and validates parameter OrderID from path. -func (o *UploadAmendedOrdersParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) - } - o.OrderID = *(value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *UploadAmendedOrdersParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go deleted file mode 100644 index 8f5744ed778..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UploadAmendedOrdersCreatedCode is the HTTP code returned for type UploadAmendedOrdersCreated -const UploadAmendedOrdersCreatedCode int = 201 - -/* -UploadAmendedOrdersCreated created upload - -swagger:response uploadAmendedOrdersCreated -*/ -type UploadAmendedOrdersCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.Upload `json:"body,omitempty"` -} - -// NewUploadAmendedOrdersCreated creates UploadAmendedOrdersCreated with default headers values -func NewUploadAmendedOrdersCreated() *UploadAmendedOrdersCreated { - - return &UploadAmendedOrdersCreated{} -} - -// WithPayload adds the payload to the upload amended orders created response -func (o *UploadAmendedOrdersCreated) WithPayload(payload *ghcmessages.Upload) *UploadAmendedOrdersCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload amended orders created response -func (o *UploadAmendedOrdersCreated) SetPayload(payload *ghcmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAmendedOrdersBadRequestCode is the HTTP code returned for type UploadAmendedOrdersBadRequest -const UploadAmendedOrdersBadRequestCode int = 400 - -/* -UploadAmendedOrdersBadRequest invalid request - -swagger:response uploadAmendedOrdersBadRequest -*/ -type UploadAmendedOrdersBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewUploadAmendedOrdersBadRequest creates UploadAmendedOrdersBadRequest with default headers values -func NewUploadAmendedOrdersBadRequest() *UploadAmendedOrdersBadRequest { - - return &UploadAmendedOrdersBadRequest{} -} - -// WithPayload adds the payload to the upload amended orders bad request response -func (o *UploadAmendedOrdersBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *UploadAmendedOrdersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload amended orders bad request response -func (o *UploadAmendedOrdersBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAmendedOrdersForbiddenCode is the HTTP code returned for type UploadAmendedOrdersForbidden -const UploadAmendedOrdersForbiddenCode int = 403 - -/* -UploadAmendedOrdersForbidden not authorized - -swagger:response uploadAmendedOrdersForbidden -*/ -type UploadAmendedOrdersForbidden struct { -} - -// NewUploadAmendedOrdersForbidden creates UploadAmendedOrdersForbidden with default headers values -func NewUploadAmendedOrdersForbidden() *UploadAmendedOrdersForbidden { - - return &UploadAmendedOrdersForbidden{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UploadAmendedOrdersNotFoundCode is the HTTP code returned for type UploadAmendedOrdersNotFound -const UploadAmendedOrdersNotFoundCode int = 404 - -/* -UploadAmendedOrdersNotFound not found - -swagger:response uploadAmendedOrdersNotFound -*/ -type UploadAmendedOrdersNotFound struct { -} - -// NewUploadAmendedOrdersNotFound creates UploadAmendedOrdersNotFound with default headers values -func NewUploadAmendedOrdersNotFound() *UploadAmendedOrdersNotFound { - - return &UploadAmendedOrdersNotFound{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UploadAmendedOrdersRequestEntityTooLargeCode is the HTTP code returned for type UploadAmendedOrdersRequestEntityTooLarge -const UploadAmendedOrdersRequestEntityTooLargeCode int = 413 - -/* -UploadAmendedOrdersRequestEntityTooLarge payload is too large - -swagger:response uploadAmendedOrdersRequestEntityTooLarge -*/ -type UploadAmendedOrdersRequestEntityTooLarge struct { -} - -// NewUploadAmendedOrdersRequestEntityTooLarge creates UploadAmendedOrdersRequestEntityTooLarge with default headers values -func NewUploadAmendedOrdersRequestEntityTooLarge() *UploadAmendedOrdersRequestEntityTooLarge { - - return &UploadAmendedOrdersRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// UploadAmendedOrdersInternalServerErrorCode is the HTTP code returned for type UploadAmendedOrdersInternalServerError -const UploadAmendedOrdersInternalServerErrorCode int = 500 - -/* -UploadAmendedOrdersInternalServerError server error - -swagger:response uploadAmendedOrdersInternalServerError -*/ -type UploadAmendedOrdersInternalServerError struct { -} - -// NewUploadAmendedOrdersInternalServerError creates UploadAmendedOrdersInternalServerError with default headers values -func NewUploadAmendedOrdersInternalServerError() *UploadAmendedOrdersInternalServerError { - - return &UploadAmendedOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go deleted file mode 100644 index b529396cb6d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UploadAmendedOrdersURL generates an URL for the upload amended orders operation -type UploadAmendedOrdersURL struct { - OrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAmendedOrdersURL) WithBasePath(bp string) *UploadAmendedOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAmendedOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UploadAmendedOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{orderID}/upload_amended_orders" - - orderID := o.OrderID.String() - if orderID != "" { - _path = strings.Replace(_path, "{orderID}", orderID, -1) - } else { - return nil, errors.New("orderId is required on UploadAmendedOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UploadAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UploadAmendedOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UploadAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UploadAmendedOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UploadAmendedOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UploadAmendedOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go deleted file mode 100644 index 78f7901ab05..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// BulkDownloadHandlerFunc turns a function with the right signature into a bulk download handler -type BulkDownloadHandlerFunc func(BulkDownloadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn BulkDownloadHandlerFunc) Handle(params BulkDownloadParams) middleware.Responder { - return fn(params) -} - -// BulkDownloadHandler interface for that can handle valid bulk download params -type BulkDownloadHandler interface { - Handle(BulkDownloadParams) middleware.Responder -} - -// NewBulkDownload creates a new http.Handler for the bulk download operation -func NewBulkDownload(ctx *middleware.Context, handler BulkDownloadHandler) *BulkDownload { - return &BulkDownload{Context: ctx, Handler: handler} -} - -/* - BulkDownload swagger:route GET /payment-requests/{paymentRequestID}/bulkDownload paymentRequests bulkDownload - -# Downloads all Payment Request documents as a PDF - -This endpoint downloads all uploaded payment request documentation combined into a single PDF. -*/ -type BulkDownload struct { - Context *middleware.Context - Handler BulkDownloadHandler -} - -func (o *BulkDownload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewBulkDownloadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go deleted file mode 100644 index ff67f05c88a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewBulkDownloadParams creates a new BulkDownloadParams object -// -// There are no default values defined in the spec. -func NewBulkDownloadParams() BulkDownloadParams { - - return BulkDownloadParams{} -} - -// BulkDownloadParams contains all the bound params for the bulk download operation -// typically these are obtained from a http.Request -// -// swagger:parameters bulkDownload -type BulkDownloadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the id for the payment-request with files to be downloaded - Required: true - In: path - */ - PaymentRequestID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewBulkDownloadParams() beforehand. -func (o *BulkDownloadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *BulkDownloadParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PaymentRequestID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go deleted file mode 100644 index b00eca8e5c1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go +++ /dev/null @@ -1,170 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// BulkDownloadOKCode is the HTTP code returned for type BulkDownloadOK -const BulkDownloadOKCode int = 200 - -/* -BulkDownloadOK Payment Request Files PDF - -swagger:response bulkDownloadOK -*/ -type BulkDownloadOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewBulkDownloadOK creates BulkDownloadOK with default headers values -func NewBulkDownloadOK() *BulkDownloadOK { - - return &BulkDownloadOK{} -} - -// WithContentDisposition adds the contentDisposition to the bulk download o k response -func (o *BulkDownloadOK) WithContentDisposition(contentDisposition string) *BulkDownloadOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the bulk download o k response -func (o *BulkDownloadOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the bulk download o k response -func (o *BulkDownloadOK) WithPayload(payload io.ReadCloser) *BulkDownloadOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the bulk download o k response -func (o *BulkDownloadOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *BulkDownloadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// BulkDownloadBadRequestCode is the HTTP code returned for type BulkDownloadBadRequest -const BulkDownloadBadRequestCode int = 400 - -/* -BulkDownloadBadRequest The request payload is invalid - -swagger:response bulkDownloadBadRequest -*/ -type BulkDownloadBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewBulkDownloadBadRequest creates BulkDownloadBadRequest with default headers values -func NewBulkDownloadBadRequest() *BulkDownloadBadRequest { - - return &BulkDownloadBadRequest{} -} - -// WithPayload adds the payload to the bulk download bad request response -func (o *BulkDownloadBadRequest) WithPayload(payload *ghcmessages.Error) *BulkDownloadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the bulk download bad request response -func (o *BulkDownloadBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *BulkDownloadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// BulkDownloadInternalServerErrorCode is the HTTP code returned for type BulkDownloadInternalServerError -const BulkDownloadInternalServerErrorCode int = 500 - -/* -BulkDownloadInternalServerError A server error occurred - -swagger:response bulkDownloadInternalServerError -*/ -type BulkDownloadInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewBulkDownloadInternalServerError creates BulkDownloadInternalServerError with default headers values -func NewBulkDownloadInternalServerError() *BulkDownloadInternalServerError { - - return &BulkDownloadInternalServerError{} -} - -// WithPayload adds the payload to the bulk download internal server error response -func (o *BulkDownloadInternalServerError) WithPayload(payload *ghcmessages.Error) *BulkDownloadInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the bulk download internal server error response -func (o *BulkDownloadInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *BulkDownloadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go deleted file mode 100644 index 7f67d894191..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// BulkDownloadURL generates an URL for the bulk download operation -type BulkDownloadURL struct { - PaymentRequestID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *BulkDownloadURL) WithBasePath(bp string) *BulkDownloadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *BulkDownloadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *BulkDownloadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/bulkDownload" - - paymentRequestID := o.PaymentRequestID - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on BulkDownloadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *BulkDownloadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *BulkDownloadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *BulkDownloadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on BulkDownloadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on BulkDownloadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *BulkDownloadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go deleted file mode 100644 index 13b2283d707..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPaymentRequestHandlerFunc turns a function with the right signature into a get payment request handler -type GetPaymentRequestHandlerFunc func(GetPaymentRequestParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPaymentRequestHandlerFunc) Handle(params GetPaymentRequestParams) middleware.Responder { - return fn(params) -} - -// GetPaymentRequestHandler interface for that can handle valid get payment request params -type GetPaymentRequestHandler interface { - Handle(GetPaymentRequestParams) middleware.Responder -} - -// NewGetPaymentRequest creates a new http.Handler for the get payment request operation -func NewGetPaymentRequest(ctx *middleware.Context, handler GetPaymentRequestHandler) *GetPaymentRequest { - return &GetPaymentRequest{Context: ctx, Handler: handler} -} - -/* - GetPaymentRequest swagger:route GET /payment-requests/{paymentRequestID} paymentRequests getPaymentRequest - -# Fetches a payment request by id - -Fetches an instance of a payment request by id -*/ -type GetPaymentRequest struct { - Context *middleware.Context - Handler GetPaymentRequestHandler -} - -func (o *GetPaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPaymentRequestParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go deleted file mode 100644 index e1cae65b0dd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetPaymentRequestParams creates a new GetPaymentRequestParams object -// -// There are no default values defined in the spec. -func NewGetPaymentRequestParams() GetPaymentRequestParams { - - return GetPaymentRequestParams{} -} - -// GetPaymentRequestParams contains all the bound params for the get payment request operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPaymentRequest -type GetPaymentRequestParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of payment request - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPaymentRequestParams() beforehand. -func (o *GetPaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *GetPaymentRequestParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *GetPaymentRequestParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go deleted file mode 100644 index d460661337f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPaymentRequestOKCode is the HTTP code returned for type GetPaymentRequestOK -const GetPaymentRequestOKCode int = 200 - -/* -GetPaymentRequestOK fetched instance of payment request - -swagger:response getPaymentRequestOK -*/ -type GetPaymentRequestOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PaymentRequest `json:"body,omitempty"` -} - -// NewGetPaymentRequestOK creates GetPaymentRequestOK with default headers values -func NewGetPaymentRequestOK() *GetPaymentRequestOK { - - return &GetPaymentRequestOK{} -} - -// WithPayload adds the payload to the get payment request o k response -func (o *GetPaymentRequestOK) WithPayload(payload *ghcmessages.PaymentRequest) *GetPaymentRequestOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request o k response -func (o *GetPaymentRequestOK) SetPayload(payload *ghcmessages.PaymentRequest) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestBadRequestCode is the HTTP code returned for type GetPaymentRequestBadRequest -const GetPaymentRequestBadRequestCode int = 400 - -/* -GetPaymentRequestBadRequest The request payload is invalid - -swagger:response getPaymentRequestBadRequest -*/ -type GetPaymentRequestBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestBadRequest creates GetPaymentRequestBadRequest with default headers values -func NewGetPaymentRequestBadRequest() *GetPaymentRequestBadRequest { - - return &GetPaymentRequestBadRequest{} -} - -// WithPayload adds the payload to the get payment request bad request response -func (o *GetPaymentRequestBadRequest) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request bad request response -func (o *GetPaymentRequestBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestUnauthorizedCode is the HTTP code returned for type GetPaymentRequestUnauthorized -const GetPaymentRequestUnauthorizedCode int = 401 - -/* -GetPaymentRequestUnauthorized The request was denied - -swagger:response getPaymentRequestUnauthorized -*/ -type GetPaymentRequestUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestUnauthorized creates GetPaymentRequestUnauthorized with default headers values -func NewGetPaymentRequestUnauthorized() *GetPaymentRequestUnauthorized { - - return &GetPaymentRequestUnauthorized{} -} - -// WithPayload adds the payload to the get payment request unauthorized response -func (o *GetPaymentRequestUnauthorized) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request unauthorized response -func (o *GetPaymentRequestUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestForbiddenCode is the HTTP code returned for type GetPaymentRequestForbidden -const GetPaymentRequestForbiddenCode int = 403 - -/* -GetPaymentRequestForbidden The request was denied - -swagger:response getPaymentRequestForbidden -*/ -type GetPaymentRequestForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestForbidden creates GetPaymentRequestForbidden with default headers values -func NewGetPaymentRequestForbidden() *GetPaymentRequestForbidden { - - return &GetPaymentRequestForbidden{} -} - -// WithPayload adds the payload to the get payment request forbidden response -func (o *GetPaymentRequestForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request forbidden response -func (o *GetPaymentRequestForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestNotFoundCode is the HTTP code returned for type GetPaymentRequestNotFound -const GetPaymentRequestNotFoundCode int = 404 - -/* -GetPaymentRequestNotFound The requested resource wasn't found - -swagger:response getPaymentRequestNotFound -*/ -type GetPaymentRequestNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestNotFound creates GetPaymentRequestNotFound with default headers values -func NewGetPaymentRequestNotFound() *GetPaymentRequestNotFound { - - return &GetPaymentRequestNotFound{} -} - -// WithPayload adds the payload to the get payment request not found response -func (o *GetPaymentRequestNotFound) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request not found response -func (o *GetPaymentRequestNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestInternalServerError -const GetPaymentRequestInternalServerErrorCode int = 500 - -/* -GetPaymentRequestInternalServerError A server error occurred - -swagger:response getPaymentRequestInternalServerError -*/ -type GetPaymentRequestInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestInternalServerError creates GetPaymentRequestInternalServerError with default headers values -func NewGetPaymentRequestInternalServerError() *GetPaymentRequestInternalServerError { - - return &GetPaymentRequestInternalServerError{} -} - -// WithPayload adds the payload to the get payment request internal server error response -func (o *GetPaymentRequestInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request internal server error response -func (o *GetPaymentRequestInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go deleted file mode 100644 index 42f0aa1479b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetPaymentRequestURL generates an URL for the get payment request operation -type GetPaymentRequestURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestURL) WithBasePath(bp string) *GetPaymentRequestURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPaymentRequestURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on GetPaymentRequestURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPaymentRequestURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPaymentRequestURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPaymentRequestURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPaymentRequestURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPaymentRequestURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go deleted file mode 100644 index 36c3861f70b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPaymentRequestsForMoveHandlerFunc turns a function with the right signature into a get payment requests for move handler -type GetPaymentRequestsForMoveHandlerFunc func(GetPaymentRequestsForMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPaymentRequestsForMoveHandlerFunc) Handle(params GetPaymentRequestsForMoveParams) middleware.Responder { - return fn(params) -} - -// GetPaymentRequestsForMoveHandler interface for that can handle valid get payment requests for move params -type GetPaymentRequestsForMoveHandler interface { - Handle(GetPaymentRequestsForMoveParams) middleware.Responder -} - -// NewGetPaymentRequestsForMove creates a new http.Handler for the get payment requests for move operation -func NewGetPaymentRequestsForMove(ctx *middleware.Context, handler GetPaymentRequestsForMoveHandler) *GetPaymentRequestsForMove { - return &GetPaymentRequestsForMove{Context: ctx, Handler: handler} -} - -/* - GetPaymentRequestsForMove swagger:route GET /moves/{locator}/payment-requests paymentRequests getPaymentRequestsForMove - -Fetches payment requests using the move code (locator). - -Fetches payment requests for a move -*/ -type GetPaymentRequestsForMove struct { - Context *middleware.Context - Handler GetPaymentRequestsForMoveHandler -} - -func (o *GetPaymentRequestsForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPaymentRequestsForMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go deleted file mode 100644 index 495ed0bf0ab..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetPaymentRequestsForMoveParams creates a new GetPaymentRequestsForMoveParams object -// -// There are no default values defined in the spec. -func NewGetPaymentRequestsForMoveParams() GetPaymentRequestsForMoveParams { - - return GetPaymentRequestsForMoveParams{} -} - -// GetPaymentRequestsForMoveParams contains all the bound params for the get payment requests for move operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPaymentRequestsForMove -type GetPaymentRequestsForMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*move code to identify a move for payment requests - Required: true - In: path - */ - Locator string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPaymentRequestsForMoveParams() beforehand. -func (o *GetPaymentRequestsForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *GetPaymentRequestsForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go deleted file mode 100644 index c1eca8a56a1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPaymentRequestsForMoveOKCode is the HTTP code returned for type GetPaymentRequestsForMoveOK -const GetPaymentRequestsForMoveOKCode int = 200 - -/* -GetPaymentRequestsForMoveOK Successfully retrieved all line items for a move task order - -swagger:response getPaymentRequestsForMoveOK -*/ -type GetPaymentRequestsForMoveOK struct { - - /* - In: Body - */ - Payload ghcmessages.PaymentRequests `json:"body,omitempty"` -} - -// NewGetPaymentRequestsForMoveOK creates GetPaymentRequestsForMoveOK with default headers values -func NewGetPaymentRequestsForMoveOK() *GetPaymentRequestsForMoveOK { - - return &GetPaymentRequestsForMoveOK{} -} - -// WithPayload adds the payload to the get payment requests for move o k response -func (o *GetPaymentRequestsForMoveOK) WithPayload(payload ghcmessages.PaymentRequests) *GetPaymentRequestsForMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests for move o k response -func (o *GetPaymentRequestsForMoveOK) SetPayload(payload ghcmessages.PaymentRequests) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.PaymentRequests{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetPaymentRequestsForMoveForbiddenCode is the HTTP code returned for type GetPaymentRequestsForMoveForbidden -const GetPaymentRequestsForMoveForbiddenCode int = 403 - -/* -GetPaymentRequestsForMoveForbidden The request was denied - -swagger:response getPaymentRequestsForMoveForbidden -*/ -type GetPaymentRequestsForMoveForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestsForMoveForbidden creates GetPaymentRequestsForMoveForbidden with default headers values -func NewGetPaymentRequestsForMoveForbidden() *GetPaymentRequestsForMoveForbidden { - - return &GetPaymentRequestsForMoveForbidden{} -} - -// WithPayload adds the payload to the get payment requests for move forbidden response -func (o *GetPaymentRequestsForMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests for move forbidden response -func (o *GetPaymentRequestsForMoveForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestsForMoveNotFoundCode is the HTTP code returned for type GetPaymentRequestsForMoveNotFound -const GetPaymentRequestsForMoveNotFoundCode int = 404 - -/* -GetPaymentRequestsForMoveNotFound The requested resource wasn't found - -swagger:response getPaymentRequestsForMoveNotFound -*/ -type GetPaymentRequestsForMoveNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestsForMoveNotFound creates GetPaymentRequestsForMoveNotFound with default headers values -func NewGetPaymentRequestsForMoveNotFound() *GetPaymentRequestsForMoveNotFound { - - return &GetPaymentRequestsForMoveNotFound{} -} - -// WithPayload adds the payload to the get payment requests for move not found response -func (o *GetPaymentRequestsForMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests for move not found response -func (o *GetPaymentRequestsForMoveNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestsForMoveUnprocessableEntityCode is the HTTP code returned for type GetPaymentRequestsForMoveUnprocessableEntity -const GetPaymentRequestsForMoveUnprocessableEntityCode int = 422 - -/* -GetPaymentRequestsForMoveUnprocessableEntity The payload was unprocessable. - -swagger:response getPaymentRequestsForMoveUnprocessableEntity -*/ -type GetPaymentRequestsForMoveUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPaymentRequestsForMoveUnprocessableEntity creates GetPaymentRequestsForMoveUnprocessableEntity with default headers values -func NewGetPaymentRequestsForMoveUnprocessableEntity() *GetPaymentRequestsForMoveUnprocessableEntity { - - return &GetPaymentRequestsForMoveUnprocessableEntity{} -} - -// WithPayload adds the payload to the get payment requests for move unprocessable entity response -func (o *GetPaymentRequestsForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPaymentRequestsForMoveUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests for move unprocessable entity response -func (o *GetPaymentRequestsForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestsForMoveInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestsForMoveInternalServerError -const GetPaymentRequestsForMoveInternalServerErrorCode int = 500 - -/* -GetPaymentRequestsForMoveInternalServerError A server error occurred - -swagger:response getPaymentRequestsForMoveInternalServerError -*/ -type GetPaymentRequestsForMoveInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestsForMoveInternalServerError creates GetPaymentRequestsForMoveInternalServerError with default headers values -func NewGetPaymentRequestsForMoveInternalServerError() *GetPaymentRequestsForMoveInternalServerError { - - return &GetPaymentRequestsForMoveInternalServerError{} -} - -// WithPayload adds the payload to the get payment requests for move internal server error response -func (o *GetPaymentRequestsForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests for move internal server error response -func (o *GetPaymentRequestsForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go deleted file mode 100644 index 8c31a3d51c4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetPaymentRequestsForMoveURL generates an URL for the get payment requests for move operation -type GetPaymentRequestsForMoveURL struct { - Locator string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestsForMoveURL) WithBasePath(bp string) *GetPaymentRequestsForMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestsForMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPaymentRequestsForMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/payment-requests" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on GetPaymentRequestsForMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPaymentRequestsForMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPaymentRequestsForMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPaymentRequestsForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPaymentRequestsForMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPaymentRequestsForMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPaymentRequestsForMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go deleted file mode 100644 index 50ad871ad96..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetShipmentsPaymentSITBalanceHandlerFunc turns a function with the right signature into a get shipments payment s i t balance handler -type GetShipmentsPaymentSITBalanceHandlerFunc func(GetShipmentsPaymentSITBalanceParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetShipmentsPaymentSITBalanceHandlerFunc) Handle(params GetShipmentsPaymentSITBalanceParams) middleware.Responder { - return fn(params) -} - -// GetShipmentsPaymentSITBalanceHandler interface for that can handle valid get shipments payment s i t balance params -type GetShipmentsPaymentSITBalanceHandler interface { - Handle(GetShipmentsPaymentSITBalanceParams) middleware.Responder -} - -// NewGetShipmentsPaymentSITBalance creates a new http.Handler for the get shipments payment s i t balance operation -func NewGetShipmentsPaymentSITBalance(ctx *middleware.Context, handler GetShipmentsPaymentSITBalanceHandler) *GetShipmentsPaymentSITBalance { - return &GetShipmentsPaymentSITBalance{Context: ctx, Handler: handler} -} - -/* - GetShipmentsPaymentSITBalance swagger:route GET /payment-requests/{paymentRequestID}/shipments-payment-sit-balance paymentRequests getShipmentsPaymentSITBalance - -# Returns all shipment payment request SIT usage to support partial SIT invoicing - -Returns all shipment payment request SIT usage to support partial SIT invoicing -*/ -type GetShipmentsPaymentSITBalance struct { - Context *middleware.Context - Handler GetShipmentsPaymentSITBalanceHandler -} - -func (o *GetShipmentsPaymentSITBalance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetShipmentsPaymentSITBalanceParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go deleted file mode 100644 index 6d107c40c80..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetShipmentsPaymentSITBalanceParams creates a new GetShipmentsPaymentSITBalanceParams object -// -// There are no default values defined in the spec. -func NewGetShipmentsPaymentSITBalanceParams() GetShipmentsPaymentSITBalanceParams { - - return GetShipmentsPaymentSITBalanceParams{} -} - -// GetShipmentsPaymentSITBalanceParams contains all the bound params for the get shipments payment s i t balance operation -// typically these are obtained from a http.Request -// -// swagger:parameters getShipmentsPaymentSITBalance -type GetShipmentsPaymentSITBalanceParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*payment request ID of the payment request with SIT service items being reviewed - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetShipmentsPaymentSITBalanceParams() beforehand. -func (o *GetShipmentsPaymentSITBalanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *GetShipmentsPaymentSITBalanceParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *GetShipmentsPaymentSITBalanceParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go deleted file mode 100644 index 635f95ed44f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetShipmentsPaymentSITBalanceOKCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceOK -const GetShipmentsPaymentSITBalanceOKCode int = 200 - -/* -GetShipmentsPaymentSITBalanceOK Successfully retrieved shipments and their SIT days balance from all payment requests on the move - -swagger:response getShipmentsPaymentSITBalanceOK -*/ -type GetShipmentsPaymentSITBalanceOK struct { - - /* - In: Body - */ - Payload ghcmessages.ShipmentsPaymentSITBalance `json:"body,omitempty"` -} - -// NewGetShipmentsPaymentSITBalanceOK creates GetShipmentsPaymentSITBalanceOK with default headers values -func NewGetShipmentsPaymentSITBalanceOK() *GetShipmentsPaymentSITBalanceOK { - - return &GetShipmentsPaymentSITBalanceOK{} -} - -// WithPayload adds the payload to the get shipments payment s i t balance o k response -func (o *GetShipmentsPaymentSITBalanceOK) WithPayload(payload ghcmessages.ShipmentsPaymentSITBalance) *GetShipmentsPaymentSITBalanceOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipments payment s i t balance o k response -func (o *GetShipmentsPaymentSITBalanceOK) SetPayload(payload ghcmessages.ShipmentsPaymentSITBalance) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentsPaymentSITBalanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.ShipmentsPaymentSITBalance{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetShipmentsPaymentSITBalanceForbiddenCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceForbidden -const GetShipmentsPaymentSITBalanceForbiddenCode int = 403 - -/* -GetShipmentsPaymentSITBalanceForbidden The request was denied - -swagger:response getShipmentsPaymentSITBalanceForbidden -*/ -type GetShipmentsPaymentSITBalanceForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentsPaymentSITBalanceForbidden creates GetShipmentsPaymentSITBalanceForbidden with default headers values -func NewGetShipmentsPaymentSITBalanceForbidden() *GetShipmentsPaymentSITBalanceForbidden { - - return &GetShipmentsPaymentSITBalanceForbidden{} -} - -// WithPayload adds the payload to the get shipments payment s i t balance forbidden response -func (o *GetShipmentsPaymentSITBalanceForbidden) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipments payment s i t balance forbidden response -func (o *GetShipmentsPaymentSITBalanceForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentsPaymentSITBalanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentsPaymentSITBalanceNotFoundCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceNotFound -const GetShipmentsPaymentSITBalanceNotFoundCode int = 404 - -/* -GetShipmentsPaymentSITBalanceNotFound The requested resource wasn't found - -swagger:response getShipmentsPaymentSITBalanceNotFound -*/ -type GetShipmentsPaymentSITBalanceNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentsPaymentSITBalanceNotFound creates GetShipmentsPaymentSITBalanceNotFound with default headers values -func NewGetShipmentsPaymentSITBalanceNotFound() *GetShipmentsPaymentSITBalanceNotFound { - - return &GetShipmentsPaymentSITBalanceNotFound{} -} - -// WithPayload adds the payload to the get shipments payment s i t balance not found response -func (o *GetShipmentsPaymentSITBalanceNotFound) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipments payment s i t balance not found response -func (o *GetShipmentsPaymentSITBalanceNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentsPaymentSITBalanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentsPaymentSITBalanceUnprocessableEntityCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceUnprocessableEntity -const GetShipmentsPaymentSITBalanceUnprocessableEntityCode int = 422 - -/* -GetShipmentsPaymentSITBalanceUnprocessableEntity The payload was unprocessable. - -swagger:response getShipmentsPaymentSITBalanceUnprocessableEntity -*/ -type GetShipmentsPaymentSITBalanceUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetShipmentsPaymentSITBalanceUnprocessableEntity creates GetShipmentsPaymentSITBalanceUnprocessableEntity with default headers values -func NewGetShipmentsPaymentSITBalanceUnprocessableEntity() *GetShipmentsPaymentSITBalanceUnprocessableEntity { - - return &GetShipmentsPaymentSITBalanceUnprocessableEntity{} -} - -// WithPayload adds the payload to the get shipments payment s i t balance unprocessable entity response -func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetShipmentsPaymentSITBalanceUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipments payment s i t balance unprocessable entity response -func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetShipmentsPaymentSITBalanceInternalServerErrorCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceInternalServerError -const GetShipmentsPaymentSITBalanceInternalServerErrorCode int = 500 - -/* -GetShipmentsPaymentSITBalanceInternalServerError A server error occurred - -swagger:response getShipmentsPaymentSITBalanceInternalServerError -*/ -type GetShipmentsPaymentSITBalanceInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetShipmentsPaymentSITBalanceInternalServerError creates GetShipmentsPaymentSITBalanceInternalServerError with default headers values -func NewGetShipmentsPaymentSITBalanceInternalServerError() *GetShipmentsPaymentSITBalanceInternalServerError { - - return &GetShipmentsPaymentSITBalanceInternalServerError{} -} - -// WithPayload adds the payload to the get shipments payment s i t balance internal server error response -func (o *GetShipmentsPaymentSITBalanceInternalServerError) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get shipments payment s i t balance internal server error response -func (o *GetShipmentsPaymentSITBalanceInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetShipmentsPaymentSITBalanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go deleted file mode 100644 index 6fd2e91f0bc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetShipmentsPaymentSITBalanceURL generates an URL for the get shipments payment s i t balance operation -type GetShipmentsPaymentSITBalanceURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetShipmentsPaymentSITBalanceURL) WithBasePath(bp string) *GetShipmentsPaymentSITBalanceURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetShipmentsPaymentSITBalanceURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetShipmentsPaymentSITBalanceURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on GetShipmentsPaymentSITBalanceURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetShipmentsPaymentSITBalanceURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetShipmentsPaymentSITBalanceURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetShipmentsPaymentSITBalanceURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetShipmentsPaymentSITBalanceURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetShipmentsPaymentSITBalanceURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetShipmentsPaymentSITBalanceURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go deleted file mode 100644 index 7014bffd4e2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdatePaymentRequestStatusHandlerFunc turns a function with the right signature into a update payment request status handler -type UpdatePaymentRequestStatusHandlerFunc func(UpdatePaymentRequestStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdatePaymentRequestStatusHandlerFunc) Handle(params UpdatePaymentRequestStatusParams) middleware.Responder { - return fn(params) -} - -// UpdatePaymentRequestStatusHandler interface for that can handle valid update payment request status params -type UpdatePaymentRequestStatusHandler interface { - Handle(UpdatePaymentRequestStatusParams) middleware.Responder -} - -// NewUpdatePaymentRequestStatus creates a new http.Handler for the update payment request status operation -func NewUpdatePaymentRequestStatus(ctx *middleware.Context, handler UpdatePaymentRequestStatusHandler) *UpdatePaymentRequestStatus { - return &UpdatePaymentRequestStatus{Context: ctx, Handler: handler} -} - -/* - UpdatePaymentRequestStatus swagger:route PATCH /payment-requests/{paymentRequestID}/status paymentRequests updatePaymentRequestStatus - -# Updates status of a payment request by id - -Updates status of a payment request by id -*/ -type UpdatePaymentRequestStatus struct { - Context *middleware.Context - Handler UpdatePaymentRequestStatusHandler -} - -func (o *UpdatePaymentRequestStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdatePaymentRequestStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go deleted file mode 100644 index 74a15d542ea..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object -// -// There are no default values defined in the spec. -func NewUpdatePaymentRequestStatusParams() UpdatePaymentRequestStatusParams { - - return UpdatePaymentRequestStatusParams{} -} - -// UpdatePaymentRequestStatusParams contains all the bound params for the update payment request status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updatePaymentRequestStatus -type UpdatePaymentRequestStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdatePaymentRequestStatusPayload - /*UUID of payment request - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdatePaymentRequestStatusParams() beforehand. -func (o *UpdatePaymentRequestStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdatePaymentRequestStatusPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdatePaymentRequestStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *UpdatePaymentRequestStatusParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *UpdatePaymentRequestStatusParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go deleted file mode 100644 index 104e878e532..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdatePaymentRequestStatusOKCode is the HTTP code returned for type UpdatePaymentRequestStatusOK -const UpdatePaymentRequestStatusOKCode int = 200 - -/* -UpdatePaymentRequestStatusOK updated payment request - -swagger:response updatePaymentRequestStatusOK -*/ -type UpdatePaymentRequestStatusOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PaymentRequest `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusOK creates UpdatePaymentRequestStatusOK with default headers values -func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { - - return &UpdatePaymentRequestStatusOK{} -} - -// WithPayload adds the payload to the update payment request status o k response -func (o *UpdatePaymentRequestStatusOK) WithPayload(payload *ghcmessages.PaymentRequest) *UpdatePaymentRequestStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status o k response -func (o *UpdatePaymentRequestStatusOK) SetPayload(payload *ghcmessages.PaymentRequest) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusBadRequestCode is the HTTP code returned for type UpdatePaymentRequestStatusBadRequest -const UpdatePaymentRequestStatusBadRequestCode int = 400 - -/* -UpdatePaymentRequestStatusBadRequest The request payload is invalid - -swagger:response updatePaymentRequestStatusBadRequest -*/ -type UpdatePaymentRequestStatusBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusBadRequest creates UpdatePaymentRequestStatusBadRequest with default headers values -func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { - - return &UpdatePaymentRequestStatusBadRequest{} -} - -// WithPayload adds the payload to the update payment request status bad request response -func (o *UpdatePaymentRequestStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status bad request response -func (o *UpdatePaymentRequestStatusBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentRequestStatusUnauthorized -const UpdatePaymentRequestStatusUnauthorizedCode int = 401 - -/* -UpdatePaymentRequestStatusUnauthorized The request was denied - -swagger:response updatePaymentRequestStatusUnauthorized -*/ -type UpdatePaymentRequestStatusUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusUnauthorized creates UpdatePaymentRequestStatusUnauthorized with default headers values -func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { - - return &UpdatePaymentRequestStatusUnauthorized{} -} - -// WithPayload adds the payload to the update payment request status unauthorized response -func (o *UpdatePaymentRequestStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status unauthorized response -func (o *UpdatePaymentRequestStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusForbiddenCode is the HTTP code returned for type UpdatePaymentRequestStatusForbidden -const UpdatePaymentRequestStatusForbiddenCode int = 403 - -/* -UpdatePaymentRequestStatusForbidden The request was denied - -swagger:response updatePaymentRequestStatusForbidden -*/ -type UpdatePaymentRequestStatusForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusForbidden creates UpdatePaymentRequestStatusForbidden with default headers values -func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { - - return &UpdatePaymentRequestStatusForbidden{} -} - -// WithPayload adds the payload to the update payment request status forbidden response -func (o *UpdatePaymentRequestStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status forbidden response -func (o *UpdatePaymentRequestStatusForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusNotFoundCode is the HTTP code returned for type UpdatePaymentRequestStatusNotFound -const UpdatePaymentRequestStatusNotFoundCode int = 404 - -/* -UpdatePaymentRequestStatusNotFound The requested resource wasn't found - -swagger:response updatePaymentRequestStatusNotFound -*/ -type UpdatePaymentRequestStatusNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusNotFound creates UpdatePaymentRequestStatusNotFound with default headers values -func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { - - return &UpdatePaymentRequestStatusNotFound{} -} - -// WithPayload adds the payload to the update payment request status not found response -func (o *UpdatePaymentRequestStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status not found response -func (o *UpdatePaymentRequestStatusNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentRequestStatusPreconditionFailed -const UpdatePaymentRequestStatusPreconditionFailedCode int = 412 - -/* -UpdatePaymentRequestStatusPreconditionFailed Precondition failed - -swagger:response updatePaymentRequestStatusPreconditionFailed -*/ -type UpdatePaymentRequestStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusPreconditionFailed creates UpdatePaymentRequestStatusPreconditionFailed with default headers values -func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { - - return &UpdatePaymentRequestStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update payment request status precondition failed response -func (o *UpdatePaymentRequestStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status precondition failed response -func (o *UpdatePaymentRequestStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentRequestStatusUnprocessableEntity -const UpdatePaymentRequestStatusUnprocessableEntityCode int = 422 - -/* -UpdatePaymentRequestStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updatePaymentRequestStatusUnprocessableEntity -*/ -type UpdatePaymentRequestStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusUnprocessableEntity creates UpdatePaymentRequestStatusUnprocessableEntity with default headers values -func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { - - return &UpdatePaymentRequestStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update payment request status unprocessable entity response -func (o *UpdatePaymentRequestStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePaymentRequestStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status unprocessable entity response -func (o *UpdatePaymentRequestStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentRequestStatusInternalServerError -const UpdatePaymentRequestStatusInternalServerErrorCode int = 500 - -/* -UpdatePaymentRequestStatusInternalServerError A server error occurred - -swagger:response updatePaymentRequestStatusInternalServerError -*/ -type UpdatePaymentRequestStatusInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusInternalServerError creates UpdatePaymentRequestStatusInternalServerError with default headers values -func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { - - return &UpdatePaymentRequestStatusInternalServerError{} -} - -// WithPayload adds the payload to the update payment request status internal server error response -func (o *UpdatePaymentRequestStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status internal server error response -func (o *UpdatePaymentRequestStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go deleted file mode 100644 index cfbb39e034c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_requests - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdatePaymentRequestStatusURL generates an URL for the update payment request status operation -type UpdatePaymentRequestStatusURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentRequestStatusURL) WithBasePath(bp string) *UpdatePaymentRequestStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentRequestStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdatePaymentRequestStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/status" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on UpdatePaymentRequestStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdatePaymentRequestStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdatePaymentRequestStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdatePaymentRequestStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdatePaymentRequestStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdatePaymentRequestStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdatePaymentRequestStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go deleted file mode 100644 index 333dfdd7d76..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdatePaymentServiceItemStatusHandlerFunc turns a function with the right signature into a update payment service item status handler -type UpdatePaymentServiceItemStatusHandlerFunc func(UpdatePaymentServiceItemStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdatePaymentServiceItemStatusHandlerFunc) Handle(params UpdatePaymentServiceItemStatusParams) middleware.Responder { - return fn(params) -} - -// UpdatePaymentServiceItemStatusHandler interface for that can handle valid update payment service item status params -type UpdatePaymentServiceItemStatusHandler interface { - Handle(UpdatePaymentServiceItemStatusParams) middleware.Responder -} - -// NewUpdatePaymentServiceItemStatus creates a new http.Handler for the update payment service item status operation -func NewUpdatePaymentServiceItemStatus(ctx *middleware.Context, handler UpdatePaymentServiceItemStatusHandler) *UpdatePaymentServiceItemStatus { - return &UpdatePaymentServiceItemStatus{Context: ctx, Handler: handler} -} - -/* - UpdatePaymentServiceItemStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status paymentServiceItem updatePaymentServiceItemStatus - -# Change the status of a payment service item for a move by ID - -Changes the status of a line item for a move by ID -*/ -type UpdatePaymentServiceItemStatus struct { - Context *middleware.Context - Handler UpdatePaymentServiceItemStatusHandler -} - -func (o *UpdatePaymentServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdatePaymentServiceItemStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go deleted file mode 100644 index 912945f23df..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdatePaymentServiceItemStatusParams creates a new UpdatePaymentServiceItemStatusParams object -// -// There are no default values defined in the spec. -func NewUpdatePaymentServiceItemStatusParams() UpdatePaymentServiceItemStatusParams { - - return UpdatePaymentServiceItemStatusParams{} -} - -// UpdatePaymentServiceItemStatusParams contains all the bound params for the update payment service item status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updatePaymentServiceItemStatus -type UpdatePaymentServiceItemStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.PaymentServiceItem - /*ID of move to use - Required: true - In: path - */ - MoveTaskOrderID string - /*ID of payment service item to use - Required: true - In: path - */ - PaymentServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdatePaymentServiceItemStatusParams() beforehand. -func (o *UpdatePaymentServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.PaymentServiceItem - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rPaymentServiceItemID, rhkPaymentServiceItemID, _ := route.Params.GetOK("paymentServiceItemID") - if err := o.bindPaymentServiceItemID(rPaymentServiceItemID, rhkPaymentServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdatePaymentServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdatePaymentServiceItemStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} - -// bindPaymentServiceItemID binds and validates parameter PaymentServiceItemID from path. -func (o *UpdatePaymentServiceItemStatusParams) bindPaymentServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PaymentServiceItemID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go deleted file mode 100644 index d5297264596..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdatePaymentServiceItemStatusOKCode is the HTTP code returned for type UpdatePaymentServiceItemStatusOK -const UpdatePaymentServiceItemStatusOKCode int = 200 - -/* -UpdatePaymentServiceItemStatusOK Successfully updated status for a line item for a move task order by ID - -swagger:response updatePaymentServiceItemStatusOK -*/ -type UpdatePaymentServiceItemStatusOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PaymentServiceItem `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusOK creates UpdatePaymentServiceItemStatusOK with default headers values -func NewUpdatePaymentServiceItemStatusOK() *UpdatePaymentServiceItemStatusOK { - - return &UpdatePaymentServiceItemStatusOK{} -} - -// WithPayload adds the payload to the update payment service item status o k response -func (o *UpdatePaymentServiceItemStatusOK) WithPayload(payload *ghcmessages.PaymentServiceItem) *UpdatePaymentServiceItemStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status o k response -func (o *UpdatePaymentServiceItemStatusOK) SetPayload(payload *ghcmessages.PaymentServiceItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusBadRequestCode is the HTTP code returned for type UpdatePaymentServiceItemStatusBadRequest -const UpdatePaymentServiceItemStatusBadRequestCode int = 400 - -/* -UpdatePaymentServiceItemStatusBadRequest The request payload is invalid - -swagger:response updatePaymentServiceItemStatusBadRequest -*/ -type UpdatePaymentServiceItemStatusBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusBadRequest creates UpdatePaymentServiceItemStatusBadRequest with default headers values -func NewUpdatePaymentServiceItemStatusBadRequest() *UpdatePaymentServiceItemStatusBadRequest { - - return &UpdatePaymentServiceItemStatusBadRequest{} -} - -// WithPayload adds the payload to the update payment service item status bad request response -func (o *UpdatePaymentServiceItemStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status bad request response -func (o *UpdatePaymentServiceItemStatusBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentServiceItemStatusUnauthorized -const UpdatePaymentServiceItemStatusUnauthorizedCode int = 401 - -/* -UpdatePaymentServiceItemStatusUnauthorized The request was denied - -swagger:response updatePaymentServiceItemStatusUnauthorized -*/ -type UpdatePaymentServiceItemStatusUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusUnauthorized creates UpdatePaymentServiceItemStatusUnauthorized with default headers values -func NewUpdatePaymentServiceItemStatusUnauthorized() *UpdatePaymentServiceItemStatusUnauthorized { - - return &UpdatePaymentServiceItemStatusUnauthorized{} -} - -// WithPayload adds the payload to the update payment service item status unauthorized response -func (o *UpdatePaymentServiceItemStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status unauthorized response -func (o *UpdatePaymentServiceItemStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusForbiddenCode is the HTTP code returned for type UpdatePaymentServiceItemStatusForbidden -const UpdatePaymentServiceItemStatusForbiddenCode int = 403 - -/* -UpdatePaymentServiceItemStatusForbidden The request was denied - -swagger:response updatePaymentServiceItemStatusForbidden -*/ -type UpdatePaymentServiceItemStatusForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusForbidden creates UpdatePaymentServiceItemStatusForbidden with default headers values -func NewUpdatePaymentServiceItemStatusForbidden() *UpdatePaymentServiceItemStatusForbidden { - - return &UpdatePaymentServiceItemStatusForbidden{} -} - -// WithPayload adds the payload to the update payment service item status forbidden response -func (o *UpdatePaymentServiceItemStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status forbidden response -func (o *UpdatePaymentServiceItemStatusForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusNotFoundCode is the HTTP code returned for type UpdatePaymentServiceItemStatusNotFound -const UpdatePaymentServiceItemStatusNotFoundCode int = 404 - -/* -UpdatePaymentServiceItemStatusNotFound The requested resource wasn't found - -swagger:response updatePaymentServiceItemStatusNotFound -*/ -type UpdatePaymentServiceItemStatusNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusNotFound creates UpdatePaymentServiceItemStatusNotFound with default headers values -func NewUpdatePaymentServiceItemStatusNotFound() *UpdatePaymentServiceItemStatusNotFound { - - return &UpdatePaymentServiceItemStatusNotFound{} -} - -// WithPayload adds the payload to the update payment service item status not found response -func (o *UpdatePaymentServiceItemStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status not found response -func (o *UpdatePaymentServiceItemStatusNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentServiceItemStatusPreconditionFailed -const UpdatePaymentServiceItemStatusPreconditionFailedCode int = 412 - -/* -UpdatePaymentServiceItemStatusPreconditionFailed Precondition failed - -swagger:response updatePaymentServiceItemStatusPreconditionFailed -*/ -type UpdatePaymentServiceItemStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusPreconditionFailed creates UpdatePaymentServiceItemStatusPreconditionFailed with default headers values -func NewUpdatePaymentServiceItemStatusPreconditionFailed() *UpdatePaymentServiceItemStatusPreconditionFailed { - - return &UpdatePaymentServiceItemStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update payment service item status precondition failed response -func (o *UpdatePaymentServiceItemStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status precondition failed response -func (o *UpdatePaymentServiceItemStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentServiceItemStatusUnprocessableEntity -const UpdatePaymentServiceItemStatusUnprocessableEntityCode int = 422 - -/* -UpdatePaymentServiceItemStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updatePaymentServiceItemStatusUnprocessableEntity -*/ -type UpdatePaymentServiceItemStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusUnprocessableEntity creates UpdatePaymentServiceItemStatusUnprocessableEntity with default headers values -func NewUpdatePaymentServiceItemStatusUnprocessableEntity() *UpdatePaymentServiceItemStatusUnprocessableEntity { - - return &UpdatePaymentServiceItemStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update payment service item status unprocessable entity response -func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePaymentServiceItemStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status unprocessable entity response -func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentServiceItemStatusInternalServerError -const UpdatePaymentServiceItemStatusInternalServerErrorCode int = 500 - -/* -UpdatePaymentServiceItemStatusInternalServerError A server error occurred - -swagger:response updatePaymentServiceItemStatusInternalServerError -*/ -type UpdatePaymentServiceItemStatusInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentServiceItemStatusInternalServerError creates UpdatePaymentServiceItemStatusInternalServerError with default headers values -func NewUpdatePaymentServiceItemStatusInternalServerError() *UpdatePaymentServiceItemStatusInternalServerError { - - return &UpdatePaymentServiceItemStatusInternalServerError{} -} - -// WithPayload adds the payload to the update payment service item status internal server error response -func (o *UpdatePaymentServiceItemStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment service item status internal server error response -func (o *UpdatePaymentServiceItemStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go deleted file mode 100644 index 267d249ec2b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdatePaymentServiceItemStatusURL generates an URL for the update payment service item status operation -type UpdatePaymentServiceItemStatusURL struct { - MoveTaskOrderID string - PaymentServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentServiceItemStatusURL) WithBasePath(bp string) *UpdatePaymentServiceItemStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentServiceItemStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdatePaymentServiceItemStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdatePaymentServiceItemStatusURL") - } - - paymentServiceItemID := o.PaymentServiceItemID - if paymentServiceItemID != "" { - _path = strings.Replace(_path, "{paymentServiceItemID}", paymentServiceItemID, -1) - } else { - return nil, errors.New("paymentServiceItemId is required on UpdatePaymentServiceItemStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdatePaymentServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdatePaymentServiceItemStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdatePaymentServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdatePaymentServiceItemStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdatePaymentServiceItemStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdatePaymentServiceItemStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go deleted file mode 100644 index bdaf9872611..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// FinishDocumentReviewHandlerFunc turns a function with the right signature into a finish document review handler -type FinishDocumentReviewHandlerFunc func(FinishDocumentReviewParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn FinishDocumentReviewHandlerFunc) Handle(params FinishDocumentReviewParams) middleware.Responder { - return fn(params) -} - -// FinishDocumentReviewHandler interface for that can handle valid finish document review params -type FinishDocumentReviewHandler interface { - Handle(FinishDocumentReviewParams) middleware.Responder -} - -// NewFinishDocumentReview creates a new http.Handler for the finish document review operation -func NewFinishDocumentReview(ctx *middleware.Context, handler FinishDocumentReviewHandler) *FinishDocumentReview { - return &FinishDocumentReview{Context: ctx, Handler: handler} -} - -/* - FinishDocumentReview swagger:route PATCH /ppm-shipments/{ppmShipmentId}/finish-document-review ppm finishDocumentReview - -# Updates a PPM shipment's status after document review - -Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected. -*/ -type FinishDocumentReview struct { - Context *middleware.Context - Handler FinishDocumentReviewHandler -} - -func (o *FinishDocumentReview) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewFinishDocumentReviewParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go deleted file mode 100644 index 19ea254de60..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewFinishDocumentReviewParams creates a new FinishDocumentReviewParams object -// -// There are no default values defined in the spec. -func NewFinishDocumentReviewParams() FinishDocumentReviewParams { - - return FinishDocumentReviewParams{} -} - -// FinishDocumentReviewParams contains all the bound params for the finish document review operation -// typically these are obtained from a http.Request -// -// swagger:parameters finishDocumentReview -type FinishDocumentReviewParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewFinishDocumentReviewParams() beforehand. -func (o *FinishDocumentReviewParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *FinishDocumentReviewParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *FinishDocumentReviewParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *FinishDocumentReviewParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go deleted file mode 100644 index c2b6cb7dd9f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// FinishDocumentReviewOKCode is the HTTP code returned for type FinishDocumentReviewOK -const FinishDocumentReviewOKCode int = 200 - -/* -FinishDocumentReviewOK Successfully finished document review - -swagger:response finishDocumentReviewOK -*/ -type FinishDocumentReviewOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMShipment `json:"body,omitempty"` -} - -// NewFinishDocumentReviewOK creates FinishDocumentReviewOK with default headers values -func NewFinishDocumentReviewOK() *FinishDocumentReviewOK { - - return &FinishDocumentReviewOK{} -} - -// WithPayload adds the payload to the finish document review o k response -func (o *FinishDocumentReviewOK) WithPayload(payload *ghcmessages.PPMShipment) *FinishDocumentReviewOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review o k response -func (o *FinishDocumentReviewOK) SetPayload(payload *ghcmessages.PPMShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewBadRequestCode is the HTTP code returned for type FinishDocumentReviewBadRequest -const FinishDocumentReviewBadRequestCode int = 400 - -/* -FinishDocumentReviewBadRequest The request payload is invalid - -swagger:response finishDocumentReviewBadRequest -*/ -type FinishDocumentReviewBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewBadRequest creates FinishDocumentReviewBadRequest with default headers values -func NewFinishDocumentReviewBadRequest() *FinishDocumentReviewBadRequest { - - return &FinishDocumentReviewBadRequest{} -} - -// WithPayload adds the payload to the finish document review bad request response -func (o *FinishDocumentReviewBadRequest) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review bad request response -func (o *FinishDocumentReviewBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewUnauthorizedCode is the HTTP code returned for type FinishDocumentReviewUnauthorized -const FinishDocumentReviewUnauthorizedCode int = 401 - -/* -FinishDocumentReviewUnauthorized The request was denied - -swagger:response finishDocumentReviewUnauthorized -*/ -type FinishDocumentReviewUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewUnauthorized creates FinishDocumentReviewUnauthorized with default headers values -func NewFinishDocumentReviewUnauthorized() *FinishDocumentReviewUnauthorized { - - return &FinishDocumentReviewUnauthorized{} -} - -// WithPayload adds the payload to the finish document review unauthorized response -func (o *FinishDocumentReviewUnauthorized) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review unauthorized response -func (o *FinishDocumentReviewUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewForbiddenCode is the HTTP code returned for type FinishDocumentReviewForbidden -const FinishDocumentReviewForbiddenCode int = 403 - -/* -FinishDocumentReviewForbidden The request was denied - -swagger:response finishDocumentReviewForbidden -*/ -type FinishDocumentReviewForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewForbidden creates FinishDocumentReviewForbidden with default headers values -func NewFinishDocumentReviewForbidden() *FinishDocumentReviewForbidden { - - return &FinishDocumentReviewForbidden{} -} - -// WithPayload adds the payload to the finish document review forbidden response -func (o *FinishDocumentReviewForbidden) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review forbidden response -func (o *FinishDocumentReviewForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewNotFoundCode is the HTTP code returned for type FinishDocumentReviewNotFound -const FinishDocumentReviewNotFoundCode int = 404 - -/* -FinishDocumentReviewNotFound The requested resource wasn't found - -swagger:response finishDocumentReviewNotFound -*/ -type FinishDocumentReviewNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewNotFound creates FinishDocumentReviewNotFound with default headers values -func NewFinishDocumentReviewNotFound() *FinishDocumentReviewNotFound { - - return &FinishDocumentReviewNotFound{} -} - -// WithPayload adds the payload to the finish document review not found response -func (o *FinishDocumentReviewNotFound) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review not found response -func (o *FinishDocumentReviewNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewConflictCode is the HTTP code returned for type FinishDocumentReviewConflict -const FinishDocumentReviewConflictCode int = 409 - -/* -FinishDocumentReviewConflict Conflict error - -swagger:response finishDocumentReviewConflict -*/ -type FinishDocumentReviewConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewConflict creates FinishDocumentReviewConflict with default headers values -func NewFinishDocumentReviewConflict() *FinishDocumentReviewConflict { - - return &FinishDocumentReviewConflict{} -} - -// WithPayload adds the payload to the finish document review conflict response -func (o *FinishDocumentReviewConflict) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review conflict response -func (o *FinishDocumentReviewConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewPreconditionFailedCode is the HTTP code returned for type FinishDocumentReviewPreconditionFailed -const FinishDocumentReviewPreconditionFailedCode int = 412 - -/* -FinishDocumentReviewPreconditionFailed Precondition failed - -swagger:response finishDocumentReviewPreconditionFailed -*/ -type FinishDocumentReviewPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewPreconditionFailed creates FinishDocumentReviewPreconditionFailed with default headers values -func NewFinishDocumentReviewPreconditionFailed() *FinishDocumentReviewPreconditionFailed { - - return &FinishDocumentReviewPreconditionFailed{} -} - -// WithPayload adds the payload to the finish document review precondition failed response -func (o *FinishDocumentReviewPreconditionFailed) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review precondition failed response -func (o *FinishDocumentReviewPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewUnprocessableEntityCode is the HTTP code returned for type FinishDocumentReviewUnprocessableEntity -const FinishDocumentReviewUnprocessableEntityCode int = 422 - -/* -FinishDocumentReviewUnprocessableEntity The payload was unprocessable. - -swagger:response finishDocumentReviewUnprocessableEntity -*/ -type FinishDocumentReviewUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewFinishDocumentReviewUnprocessableEntity creates FinishDocumentReviewUnprocessableEntity with default headers values -func NewFinishDocumentReviewUnprocessableEntity() *FinishDocumentReviewUnprocessableEntity { - - return &FinishDocumentReviewUnprocessableEntity{} -} - -// WithPayload adds the payload to the finish document review unprocessable entity response -func (o *FinishDocumentReviewUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *FinishDocumentReviewUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review unprocessable entity response -func (o *FinishDocumentReviewUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// FinishDocumentReviewInternalServerErrorCode is the HTTP code returned for type FinishDocumentReviewInternalServerError -const FinishDocumentReviewInternalServerErrorCode int = 500 - -/* -FinishDocumentReviewInternalServerError A server error occurred - -swagger:response finishDocumentReviewInternalServerError -*/ -type FinishDocumentReviewInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewFinishDocumentReviewInternalServerError creates FinishDocumentReviewInternalServerError with default headers values -func NewFinishDocumentReviewInternalServerError() *FinishDocumentReviewInternalServerError { - - return &FinishDocumentReviewInternalServerError{} -} - -// WithPayload adds the payload to the finish document review internal server error response -func (o *FinishDocumentReviewInternalServerError) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the finish document review internal server error response -func (o *FinishDocumentReviewInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *FinishDocumentReviewInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go deleted file mode 100644 index 4d9e3e1251f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// FinishDocumentReviewURL generates an URL for the finish document review operation -type FinishDocumentReviewURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FinishDocumentReviewURL) WithBasePath(bp string) *FinishDocumentReviewURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *FinishDocumentReviewURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *FinishDocumentReviewURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/finish-document-review" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on FinishDocumentReviewURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *FinishDocumentReviewURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *FinishDocumentReviewURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *FinishDocumentReviewURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on FinishDocumentReviewURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on FinishDocumentReviewURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *FinishDocumentReviewURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go deleted file mode 100644 index 533ae2ee80c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPPMActualWeightHandlerFunc turns a function with the right signature into a get p p m actual weight handler -type GetPPMActualWeightHandlerFunc func(GetPPMActualWeightParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPPMActualWeightHandlerFunc) Handle(params GetPPMActualWeightParams) middleware.Responder { - return fn(params) -} - -// GetPPMActualWeightHandler interface for that can handle valid get p p m actual weight params -type GetPPMActualWeightHandler interface { - Handle(GetPPMActualWeightParams) middleware.Responder -} - -// NewGetPPMActualWeight creates a new http.Handler for the get p p m actual weight operation -func NewGetPPMActualWeight(ctx *middleware.Context, handler GetPPMActualWeightHandler) *GetPPMActualWeight { - return &GetPPMActualWeight{Context: ctx, Handler: handler} -} - -/* - GetPPMActualWeight swagger:route GET /ppm-shipments/{ppmShipmentId}/actual-weight ppm getPPMActualWeight - -# Get the actual weight for a PPM shipment - -Retrieves the actual weight for the specified PPM shipment. -*/ -type GetPPMActualWeight struct { - Context *middleware.Context - Handler GetPPMActualWeightHandler -} - -func (o *GetPPMActualWeight) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPPMActualWeightParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go deleted file mode 100644 index a26648ef235..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetPPMActualWeightParams creates a new GetPPMActualWeightParams object -// -// There are no default values defined in the spec. -func NewGetPPMActualWeightParams() GetPPMActualWeightParams { - - return GetPPMActualWeightParams{} -} - -// GetPPMActualWeightParams contains all the bound params for the get p p m actual weight operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPPMActualWeight -type GetPPMActualWeightParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPPMActualWeightParams() beforehand. -func (o *GetPPMActualWeightParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *GetPPMActualWeightParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *GetPPMActualWeightParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go deleted file mode 100644 index dfec7304a52..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPPMActualWeightOKCode is the HTTP code returned for type GetPPMActualWeightOK -const GetPPMActualWeightOKCode int = 200 - -/* -GetPPMActualWeightOK Returns actual weight for the specified PPM shipment. - -swagger:response getPPMActualWeightOK -*/ -type GetPPMActualWeightOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMActualWeight `json:"body,omitempty"` -} - -// NewGetPPMActualWeightOK creates GetPPMActualWeightOK with default headers values -func NewGetPPMActualWeightOK() *GetPPMActualWeightOK { - - return &GetPPMActualWeightOK{} -} - -// WithPayload adds the payload to the get p p m actual weight o k response -func (o *GetPPMActualWeightOK) WithPayload(payload *ghcmessages.PPMActualWeight) *GetPPMActualWeightOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight o k response -func (o *GetPPMActualWeightOK) SetPayload(payload *ghcmessages.PPMActualWeight) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMActualWeightBadRequestCode is the HTTP code returned for type GetPPMActualWeightBadRequest -const GetPPMActualWeightBadRequestCode int = 400 - -/* -GetPPMActualWeightBadRequest The request payload is invalid - -swagger:response getPPMActualWeightBadRequest -*/ -type GetPPMActualWeightBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMActualWeightBadRequest creates GetPPMActualWeightBadRequest with default headers values -func NewGetPPMActualWeightBadRequest() *GetPPMActualWeightBadRequest { - - return &GetPPMActualWeightBadRequest{} -} - -// WithPayload adds the payload to the get p p m actual weight bad request response -func (o *GetPPMActualWeightBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight bad request response -func (o *GetPPMActualWeightBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMActualWeightForbiddenCode is the HTTP code returned for type GetPPMActualWeightForbidden -const GetPPMActualWeightForbiddenCode int = 403 - -/* -GetPPMActualWeightForbidden The request was denied - -swagger:response getPPMActualWeightForbidden -*/ -type GetPPMActualWeightForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMActualWeightForbidden creates GetPPMActualWeightForbidden with default headers values -func NewGetPPMActualWeightForbidden() *GetPPMActualWeightForbidden { - - return &GetPPMActualWeightForbidden{} -} - -// WithPayload adds the payload to the get p p m actual weight forbidden response -func (o *GetPPMActualWeightForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight forbidden response -func (o *GetPPMActualWeightForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMActualWeightNotFoundCode is the HTTP code returned for type GetPPMActualWeightNotFound -const GetPPMActualWeightNotFoundCode int = 404 - -/* -GetPPMActualWeightNotFound The requested resource wasn't found - -swagger:response getPPMActualWeightNotFound -*/ -type GetPPMActualWeightNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMActualWeightNotFound creates GetPPMActualWeightNotFound with default headers values -func NewGetPPMActualWeightNotFound() *GetPPMActualWeightNotFound { - - return &GetPPMActualWeightNotFound{} -} - -// WithPayload adds the payload to the get p p m actual weight not found response -func (o *GetPPMActualWeightNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight not found response -func (o *GetPPMActualWeightNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMActualWeightUnprocessableEntityCode is the HTTP code returned for type GetPPMActualWeightUnprocessableEntity -const GetPPMActualWeightUnprocessableEntityCode int = 422 - -/* -GetPPMActualWeightUnprocessableEntity The payload was unprocessable. - -swagger:response getPPMActualWeightUnprocessableEntity -*/ -type GetPPMActualWeightUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPPMActualWeightUnprocessableEntity creates GetPPMActualWeightUnprocessableEntity with default headers values -func NewGetPPMActualWeightUnprocessableEntity() *GetPPMActualWeightUnprocessableEntity { - - return &GetPPMActualWeightUnprocessableEntity{} -} - -// WithPayload adds the payload to the get p p m actual weight unprocessable entity response -func (o *GetPPMActualWeightUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMActualWeightUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight unprocessable entity response -func (o *GetPPMActualWeightUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMActualWeightInternalServerErrorCode is the HTTP code returned for type GetPPMActualWeightInternalServerError -const GetPPMActualWeightInternalServerErrorCode int = 500 - -/* -GetPPMActualWeightInternalServerError A server error occurred - -swagger:response getPPMActualWeightInternalServerError -*/ -type GetPPMActualWeightInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMActualWeightInternalServerError creates GetPPMActualWeightInternalServerError with default headers values -func NewGetPPMActualWeightInternalServerError() *GetPPMActualWeightInternalServerError { - - return &GetPPMActualWeightInternalServerError{} -} - -// WithPayload adds the payload to the get p p m actual weight internal server error response -func (o *GetPPMActualWeightInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m actual weight internal server error response -func (o *GetPPMActualWeightInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMActualWeightInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go deleted file mode 100644 index 2439b3dbc05..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetPPMActualWeightURL generates an URL for the get p p m actual weight operation -type GetPPMActualWeightURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMActualWeightURL) WithBasePath(bp string) *GetPPMActualWeightURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMActualWeightURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPPMActualWeightURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/actual-weight" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on GetPPMActualWeightURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPPMActualWeightURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPPMActualWeightURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPPMActualWeightURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPPMActualWeightURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPPMActualWeightURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPPMActualWeightURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go deleted file mode 100644 index d2536b933db..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPPMCloseoutHandlerFunc turns a function with the right signature into a get p p m closeout handler -type GetPPMCloseoutHandlerFunc func(GetPPMCloseoutParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPPMCloseoutHandlerFunc) Handle(params GetPPMCloseoutParams) middleware.Responder { - return fn(params) -} - -// GetPPMCloseoutHandler interface for that can handle valid get p p m closeout params -type GetPPMCloseoutHandler interface { - Handle(GetPPMCloseoutParams) middleware.Responder -} - -// NewGetPPMCloseout creates a new http.Handler for the get p p m closeout operation -func NewGetPPMCloseout(ctx *middleware.Context, handler GetPPMCloseoutHandler) *GetPPMCloseout { - return &GetPPMCloseout{Context: ctx, Handler: handler} -} - -/* - GetPPMCloseout swagger:route GET /ppm-shipments/{ppmShipmentId}/closeout ppm getPPMCloseout - -# Get the closeout calcuations for the specified PPM shipment - -Retrieves the closeout calculations for the specified PPM shipment. -*/ -type GetPPMCloseout struct { - Context *middleware.Context - Handler GetPPMCloseoutHandler -} - -func (o *GetPPMCloseout) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPPMCloseoutParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go deleted file mode 100644 index 0b766ba8fd9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetPPMCloseoutParams creates a new GetPPMCloseoutParams object -// -// There are no default values defined in the spec. -func NewGetPPMCloseoutParams() GetPPMCloseoutParams { - - return GetPPMCloseoutParams{} -} - -// GetPPMCloseoutParams contains all the bound params for the get p p m closeout operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPPMCloseout -type GetPPMCloseoutParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPPMCloseoutParams() beforehand. -func (o *GetPPMCloseoutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *GetPPMCloseoutParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *GetPPMCloseoutParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go deleted file mode 100644 index 38821f39514..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPPMCloseoutOKCode is the HTTP code returned for type GetPPMCloseoutOK -const GetPPMCloseoutOKCode int = 200 - -/* -GetPPMCloseoutOK Returns closeout for the specified PPM shipment. - -swagger:response getPPMCloseoutOK -*/ -type GetPPMCloseoutOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMCloseout `json:"body,omitempty"` -} - -// NewGetPPMCloseoutOK creates GetPPMCloseoutOK with default headers values -func NewGetPPMCloseoutOK() *GetPPMCloseoutOK { - - return &GetPPMCloseoutOK{} -} - -// WithPayload adds the payload to the get p p m closeout o k response -func (o *GetPPMCloseoutOK) WithPayload(payload *ghcmessages.PPMCloseout) *GetPPMCloseoutOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout o k response -func (o *GetPPMCloseoutOK) SetPayload(payload *ghcmessages.PPMCloseout) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMCloseoutBadRequestCode is the HTTP code returned for type GetPPMCloseoutBadRequest -const GetPPMCloseoutBadRequestCode int = 400 - -/* -GetPPMCloseoutBadRequest The request payload is invalid - -swagger:response getPPMCloseoutBadRequest -*/ -type GetPPMCloseoutBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMCloseoutBadRequest creates GetPPMCloseoutBadRequest with default headers values -func NewGetPPMCloseoutBadRequest() *GetPPMCloseoutBadRequest { - - return &GetPPMCloseoutBadRequest{} -} - -// WithPayload adds the payload to the get p p m closeout bad request response -func (o *GetPPMCloseoutBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout bad request response -func (o *GetPPMCloseoutBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMCloseoutForbiddenCode is the HTTP code returned for type GetPPMCloseoutForbidden -const GetPPMCloseoutForbiddenCode int = 403 - -/* -GetPPMCloseoutForbidden The request was denied - -swagger:response getPPMCloseoutForbidden -*/ -type GetPPMCloseoutForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMCloseoutForbidden creates GetPPMCloseoutForbidden with default headers values -func NewGetPPMCloseoutForbidden() *GetPPMCloseoutForbidden { - - return &GetPPMCloseoutForbidden{} -} - -// WithPayload adds the payload to the get p p m closeout forbidden response -func (o *GetPPMCloseoutForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout forbidden response -func (o *GetPPMCloseoutForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMCloseoutNotFoundCode is the HTTP code returned for type GetPPMCloseoutNotFound -const GetPPMCloseoutNotFoundCode int = 404 - -/* -GetPPMCloseoutNotFound The requested resource wasn't found - -swagger:response getPPMCloseoutNotFound -*/ -type GetPPMCloseoutNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMCloseoutNotFound creates GetPPMCloseoutNotFound with default headers values -func NewGetPPMCloseoutNotFound() *GetPPMCloseoutNotFound { - - return &GetPPMCloseoutNotFound{} -} - -// WithPayload adds the payload to the get p p m closeout not found response -func (o *GetPPMCloseoutNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout not found response -func (o *GetPPMCloseoutNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMCloseoutUnprocessableEntityCode is the HTTP code returned for type GetPPMCloseoutUnprocessableEntity -const GetPPMCloseoutUnprocessableEntityCode int = 422 - -/* -GetPPMCloseoutUnprocessableEntity The payload was unprocessable. - -swagger:response getPPMCloseoutUnprocessableEntity -*/ -type GetPPMCloseoutUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPPMCloseoutUnprocessableEntity creates GetPPMCloseoutUnprocessableEntity with default headers values -func NewGetPPMCloseoutUnprocessableEntity() *GetPPMCloseoutUnprocessableEntity { - - return &GetPPMCloseoutUnprocessableEntity{} -} - -// WithPayload adds the payload to the get p p m closeout unprocessable entity response -func (o *GetPPMCloseoutUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMCloseoutUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout unprocessable entity response -func (o *GetPPMCloseoutUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMCloseoutInternalServerErrorCode is the HTTP code returned for type GetPPMCloseoutInternalServerError -const GetPPMCloseoutInternalServerErrorCode int = 500 - -/* -GetPPMCloseoutInternalServerError A server error occurred - -swagger:response getPPMCloseoutInternalServerError -*/ -type GetPPMCloseoutInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMCloseoutInternalServerError creates GetPPMCloseoutInternalServerError with default headers values -func NewGetPPMCloseoutInternalServerError() *GetPPMCloseoutInternalServerError { - - return &GetPPMCloseoutInternalServerError{} -} - -// WithPayload adds the payload to the get p p m closeout internal server error response -func (o *GetPPMCloseoutInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m closeout internal server error response -func (o *GetPPMCloseoutInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMCloseoutInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go deleted file mode 100644 index 44164af2f1a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetPPMCloseoutURL generates an URL for the get p p m closeout operation -type GetPPMCloseoutURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMCloseoutURL) WithBasePath(bp string) *GetPPMCloseoutURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMCloseoutURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPPMCloseoutURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/closeout" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on GetPPMCloseoutURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPPMCloseoutURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPPMCloseoutURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPPMCloseoutURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPPMCloseoutURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPPMCloseoutURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPPMCloseoutURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go deleted file mode 100644 index 1e794c2ad41..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPPMDocumentsHandlerFunc turns a function with the right signature into a get p p m documents handler -type GetPPMDocumentsHandlerFunc func(GetPPMDocumentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPPMDocumentsHandlerFunc) Handle(params GetPPMDocumentsParams) middleware.Responder { - return fn(params) -} - -// GetPPMDocumentsHandler interface for that can handle valid get p p m documents params -type GetPPMDocumentsHandler interface { - Handle(GetPPMDocumentsParams) middleware.Responder -} - -// NewGetPPMDocuments creates a new http.Handler for the get p p m documents operation -func NewGetPPMDocuments(ctx *middleware.Context, handler GetPPMDocumentsHandler) *GetPPMDocuments { - return &GetPPMDocuments{Context: ctx, Handler: handler} -} - -/* - GetPPMDocuments swagger:route GET /shipments/{shipmentID}/ppm-documents ppm getPPMDocuments - -# Gets all the PPM documents for a PPM shipment - -Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This -excludes any deleted PPM documents. -*/ -type GetPPMDocuments struct { - Context *middleware.Context - Handler GetPPMDocumentsHandler -} - -func (o *GetPPMDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPPMDocumentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go deleted file mode 100644 index f42e2d87d85..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetPPMDocumentsParams creates a new GetPPMDocumentsParams object -// -// There are no default values defined in the spec. -func NewGetPPMDocumentsParams() GetPPMDocumentsParams { - - return GetPPMDocumentsParams{} -} - -// GetPPMDocumentsParams contains all the bound params for the get p p m documents operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPPMDocuments -type GetPPMDocumentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPPMDocumentsParams() beforehand. -func (o *GetPPMDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *GetPPMDocumentsParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *GetPPMDocumentsParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go deleted file mode 100644 index 6a21b24f070..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPPMDocumentsOKCode is the HTTP code returned for type GetPPMDocumentsOK -const GetPPMDocumentsOKCode int = 200 - -/* -GetPPMDocumentsOK All PPM documents and associated uploads for the specified PPM shipment. - -swagger:response getPPMDocumentsOK -*/ -type GetPPMDocumentsOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMDocuments `json:"body,omitempty"` -} - -// NewGetPPMDocumentsOK creates GetPPMDocumentsOK with default headers values -func NewGetPPMDocumentsOK() *GetPPMDocumentsOK { - - return &GetPPMDocumentsOK{} -} - -// WithPayload adds the payload to the get p p m documents o k response -func (o *GetPPMDocumentsOK) WithPayload(payload *ghcmessages.PPMDocuments) *GetPPMDocumentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m documents o k response -func (o *GetPPMDocumentsOK) SetPayload(payload *ghcmessages.PPMDocuments) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMDocumentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMDocumentsUnauthorizedCode is the HTTP code returned for type GetPPMDocumentsUnauthorized -const GetPPMDocumentsUnauthorizedCode int = 401 - -/* -GetPPMDocumentsUnauthorized The request was denied - -swagger:response getPPMDocumentsUnauthorized -*/ -type GetPPMDocumentsUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMDocumentsUnauthorized creates GetPPMDocumentsUnauthorized with default headers values -func NewGetPPMDocumentsUnauthorized() *GetPPMDocumentsUnauthorized { - - return &GetPPMDocumentsUnauthorized{} -} - -// WithPayload adds the payload to the get p p m documents unauthorized response -func (o *GetPPMDocumentsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m documents unauthorized response -func (o *GetPPMDocumentsUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMDocumentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMDocumentsForbiddenCode is the HTTP code returned for type GetPPMDocumentsForbidden -const GetPPMDocumentsForbiddenCode int = 403 - -/* -GetPPMDocumentsForbidden The request was denied - -swagger:response getPPMDocumentsForbidden -*/ -type GetPPMDocumentsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMDocumentsForbidden creates GetPPMDocumentsForbidden with default headers values -func NewGetPPMDocumentsForbidden() *GetPPMDocumentsForbidden { - - return &GetPPMDocumentsForbidden{} -} - -// WithPayload adds the payload to the get p p m documents forbidden response -func (o *GetPPMDocumentsForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m documents forbidden response -func (o *GetPPMDocumentsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMDocumentsUnprocessableEntityCode is the HTTP code returned for type GetPPMDocumentsUnprocessableEntity -const GetPPMDocumentsUnprocessableEntityCode int = 422 - -/* -GetPPMDocumentsUnprocessableEntity The payload was unprocessable. - -swagger:response getPPMDocumentsUnprocessableEntity -*/ -type GetPPMDocumentsUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPPMDocumentsUnprocessableEntity creates GetPPMDocumentsUnprocessableEntity with default headers values -func NewGetPPMDocumentsUnprocessableEntity() *GetPPMDocumentsUnprocessableEntity { - - return &GetPPMDocumentsUnprocessableEntity{} -} - -// WithPayload adds the payload to the get p p m documents unprocessable entity response -func (o *GetPPMDocumentsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMDocumentsUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m documents unprocessable entity response -func (o *GetPPMDocumentsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMDocumentsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMDocumentsInternalServerErrorCode is the HTTP code returned for type GetPPMDocumentsInternalServerError -const GetPPMDocumentsInternalServerErrorCode int = 500 - -/* -GetPPMDocumentsInternalServerError A server error occurred - -swagger:response getPPMDocumentsInternalServerError -*/ -type GetPPMDocumentsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMDocumentsInternalServerError creates GetPPMDocumentsInternalServerError with default headers values -func NewGetPPMDocumentsInternalServerError() *GetPPMDocumentsInternalServerError { - - return &GetPPMDocumentsInternalServerError{} -} - -// WithPayload adds the payload to the get p p m documents internal server error response -func (o *GetPPMDocumentsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m documents internal server error response -func (o *GetPPMDocumentsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go deleted file mode 100644 index 35d0ce45712..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetPPMDocumentsURL generates an URL for the get p p m documents operation -type GetPPMDocumentsURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMDocumentsURL) WithBasePath(bp string) *GetPPMDocumentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMDocumentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPPMDocumentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/ppm-documents" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on GetPPMDocumentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPPMDocumentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPPMDocumentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPPMDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPPMDocumentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPPMDocumentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPPMDocumentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go deleted file mode 100644 index 77275e1ca27..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPPMSITEstimatedCostHandlerFunc turns a function with the right signature into a get p p m s i t estimated cost handler -type GetPPMSITEstimatedCostHandlerFunc func(GetPPMSITEstimatedCostParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPPMSITEstimatedCostHandlerFunc) Handle(params GetPPMSITEstimatedCostParams) middleware.Responder { - return fn(params) -} - -// GetPPMSITEstimatedCostHandler interface for that can handle valid get p p m s i t estimated cost params -type GetPPMSITEstimatedCostHandler interface { - Handle(GetPPMSITEstimatedCostParams) middleware.Responder -} - -// NewGetPPMSITEstimatedCost creates a new http.Handler for the get p p m s i t estimated cost operation -func NewGetPPMSITEstimatedCost(ctx *middleware.Context, handler GetPPMSITEstimatedCostHandler) *GetPPMSITEstimatedCost { - return &GetPPMSITEstimatedCost{Context: ctx, Handler: handler} -} - -/* - GetPPMSITEstimatedCost swagger:route GET /ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost ppm getPPMSITEstimatedCost - -# Get the SIT estimated cost for a PPM shipment - -Calculates and returns the SIT estimated cost for the specified PPM shipment. -*/ -type GetPPMSITEstimatedCost struct { - Context *middleware.Context - Handler GetPPMSITEstimatedCostHandler -} - -func (o *GetPPMSITEstimatedCost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPPMSITEstimatedCostParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go deleted file mode 100644 index 1f48e73d2d4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetPPMSITEstimatedCostParams creates a new GetPPMSITEstimatedCostParams object -// -// There are no default values defined in the spec. -func NewGetPPMSITEstimatedCostParams() GetPPMSITEstimatedCostParams { - - return GetPPMSITEstimatedCostParams{} -} - -// GetPPMSITEstimatedCostParams contains all the bound params for the get p p m s i t estimated cost operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPPMSITEstimatedCost -type GetPPMSITEstimatedCostParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*Date departed SIT - Required: true - In: query - */ - SitDepartureDate strfmt.DateTime - /*Date entered into SIT - Required: true - In: query - */ - SitEntryDate strfmt.DateTime - /*location of sit - Required: true - In: path - */ - SitLocation string - /*Weight stored in SIT - Required: true - Minimum: 0 - In: query - */ - WeightStored int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPPMSITEstimatedCostParams() beforehand. -func (o *GetPPMSITEstimatedCostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - qSitDepartureDate, qhkSitDepartureDate, _ := qs.GetOK("sitDepartureDate") - if err := o.bindSitDepartureDate(qSitDepartureDate, qhkSitDepartureDate, route.Formats); err != nil { - res = append(res, err) - } - - qSitEntryDate, qhkSitEntryDate, _ := qs.GetOK("sitEntryDate") - if err := o.bindSitEntryDate(qSitEntryDate, qhkSitEntryDate, route.Formats); err != nil { - res = append(res, err) - } - - rSitLocation, rhkSitLocation, _ := route.Params.GetOK("sitLocation") - if err := o.bindSitLocation(rSitLocation, rhkSitLocation, route.Formats); err != nil { - res = append(res, err) - } - - qWeightStored, qhkWeightStored, _ := qs.GetOK("weightStored") - if err := o.bindWeightStored(qWeightStored, qhkWeightStored, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *GetPPMSITEstimatedCostParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *GetPPMSITEstimatedCostParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindSitDepartureDate binds and validates parameter SitDepartureDate from query. -func (o *GetPPMSITEstimatedCostParams) bindSitDepartureDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("sitDepartureDate", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("sitDepartureDate", "query", raw); err != nil { - return err - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("sitDepartureDate", "query", "strfmt.DateTime", raw) - } - o.SitDepartureDate = *(value.(*strfmt.DateTime)) - - if err := o.validateSitDepartureDate(formats); err != nil { - return err - } - - return nil -} - -// validateSitDepartureDate carries on validations for parameter SitDepartureDate -func (o *GetPPMSITEstimatedCostParams) validateSitDepartureDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("sitDepartureDate", "query", "date-time", o.SitDepartureDate.String(), formats); err != nil { - return err - } - return nil -} - -// bindSitEntryDate binds and validates parameter SitEntryDate from query. -func (o *GetPPMSITEstimatedCostParams) bindSitEntryDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("sitEntryDate", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("sitEntryDate", "query", raw); err != nil { - return err - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("sitEntryDate", "query", "strfmt.DateTime", raw) - } - o.SitEntryDate = *(value.(*strfmt.DateTime)) - - if err := o.validateSitEntryDate(formats); err != nil { - return err - } - - return nil -} - -// validateSitEntryDate carries on validations for parameter SitEntryDate -func (o *GetPPMSITEstimatedCostParams) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("sitEntryDate", "query", "date-time", o.SitEntryDate.String(), formats); err != nil { - return err - } - return nil -} - -// bindSitLocation binds and validates parameter SitLocation from path. -func (o *GetPPMSITEstimatedCostParams) bindSitLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.SitLocation = raw - - if err := o.validateSitLocation(formats); err != nil { - return err - } - - return nil -} - -// validateSitLocation carries on validations for parameter SitLocation -func (o *GetPPMSITEstimatedCostParams) validateSitLocation(formats strfmt.Registry) error { - - if err := validate.EnumCase("sitLocation", "path", o.SitLocation, []interface{}{"ORIGIN", "DESTINATION"}, true); err != nil { - return err - } - - return nil -} - -// bindWeightStored binds and validates parameter WeightStored from query. -func (o *GetPPMSITEstimatedCostParams) bindWeightStored(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("weightStored", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("weightStored", "query", raw); err != nil { - return err - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("weightStored", "query", "int64", raw) - } - o.WeightStored = value - - if err := o.validateWeightStored(formats); err != nil { - return err - } - - return nil -} - -// validateWeightStored carries on validations for parameter WeightStored -func (o *GetPPMSITEstimatedCostParams) validateWeightStored(formats strfmt.Registry) error { - - if err := validate.MinimumInt("weightStored", "query", o.WeightStored, 0, false); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go deleted file mode 100644 index 0a0c4101f29..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPPMSITEstimatedCostOKCode is the HTTP code returned for type GetPPMSITEstimatedCostOK -const GetPPMSITEstimatedCostOKCode int = 200 - -/* -GetPPMSITEstimatedCostOK Calculates and returns the SIT estimated cost for the specified PPM shipment. - -swagger:response getPPMSITEstimatedCostOK -*/ -type GetPPMSITEstimatedCostOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMSITEstimatedCost `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostOK creates GetPPMSITEstimatedCostOK with default headers values -func NewGetPPMSITEstimatedCostOK() *GetPPMSITEstimatedCostOK { - - return &GetPPMSITEstimatedCostOK{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost o k response -func (o *GetPPMSITEstimatedCostOK) WithPayload(payload *ghcmessages.PPMSITEstimatedCost) *GetPPMSITEstimatedCostOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost o k response -func (o *GetPPMSITEstimatedCostOK) SetPayload(payload *ghcmessages.PPMSITEstimatedCost) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMSITEstimatedCostBadRequestCode is the HTTP code returned for type GetPPMSITEstimatedCostBadRequest -const GetPPMSITEstimatedCostBadRequestCode int = 400 - -/* -GetPPMSITEstimatedCostBadRequest The request payload is invalid - -swagger:response getPPMSITEstimatedCostBadRequest -*/ -type GetPPMSITEstimatedCostBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostBadRequest creates GetPPMSITEstimatedCostBadRequest with default headers values -func NewGetPPMSITEstimatedCostBadRequest() *GetPPMSITEstimatedCostBadRequest { - - return &GetPPMSITEstimatedCostBadRequest{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost bad request response -func (o *GetPPMSITEstimatedCostBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost bad request response -func (o *GetPPMSITEstimatedCostBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMSITEstimatedCostForbiddenCode is the HTTP code returned for type GetPPMSITEstimatedCostForbidden -const GetPPMSITEstimatedCostForbiddenCode int = 403 - -/* -GetPPMSITEstimatedCostForbidden The request was denied - -swagger:response getPPMSITEstimatedCostForbidden -*/ -type GetPPMSITEstimatedCostForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostForbidden creates GetPPMSITEstimatedCostForbidden with default headers values -func NewGetPPMSITEstimatedCostForbidden() *GetPPMSITEstimatedCostForbidden { - - return &GetPPMSITEstimatedCostForbidden{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost forbidden response -func (o *GetPPMSITEstimatedCostForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost forbidden response -func (o *GetPPMSITEstimatedCostForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMSITEstimatedCostNotFoundCode is the HTTP code returned for type GetPPMSITEstimatedCostNotFound -const GetPPMSITEstimatedCostNotFoundCode int = 404 - -/* -GetPPMSITEstimatedCostNotFound The requested resource wasn't found - -swagger:response getPPMSITEstimatedCostNotFound -*/ -type GetPPMSITEstimatedCostNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostNotFound creates GetPPMSITEstimatedCostNotFound with default headers values -func NewGetPPMSITEstimatedCostNotFound() *GetPPMSITEstimatedCostNotFound { - - return &GetPPMSITEstimatedCostNotFound{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost not found response -func (o *GetPPMSITEstimatedCostNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost not found response -func (o *GetPPMSITEstimatedCostNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMSITEstimatedCostUnprocessableEntityCode is the HTTP code returned for type GetPPMSITEstimatedCostUnprocessableEntity -const GetPPMSITEstimatedCostUnprocessableEntityCode int = 422 - -/* -GetPPMSITEstimatedCostUnprocessableEntity The payload was unprocessable. - -swagger:response getPPMSITEstimatedCostUnprocessableEntity -*/ -type GetPPMSITEstimatedCostUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostUnprocessableEntity creates GetPPMSITEstimatedCostUnprocessableEntity with default headers values -func NewGetPPMSITEstimatedCostUnprocessableEntity() *GetPPMSITEstimatedCostUnprocessableEntity { - - return &GetPPMSITEstimatedCostUnprocessableEntity{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost unprocessable entity response -func (o *GetPPMSITEstimatedCostUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMSITEstimatedCostUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost unprocessable entity response -func (o *GetPPMSITEstimatedCostUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPPMSITEstimatedCostInternalServerErrorCode is the HTTP code returned for type GetPPMSITEstimatedCostInternalServerError -const GetPPMSITEstimatedCostInternalServerErrorCode int = 500 - -/* -GetPPMSITEstimatedCostInternalServerError A server error occurred - -swagger:response getPPMSITEstimatedCostInternalServerError -*/ -type GetPPMSITEstimatedCostInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPPMSITEstimatedCostInternalServerError creates GetPPMSITEstimatedCostInternalServerError with default headers values -func NewGetPPMSITEstimatedCostInternalServerError() *GetPPMSITEstimatedCostInternalServerError { - - return &GetPPMSITEstimatedCostInternalServerError{} -} - -// WithPayload adds the payload to the get p p m s i t estimated cost internal server error response -func (o *GetPPMSITEstimatedCostInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p p m s i t estimated cost internal server error response -func (o *GetPPMSITEstimatedCostInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPPMSITEstimatedCostInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go deleted file mode 100644 index 13c48d63d8b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetPPMSITEstimatedCostURL generates an URL for the get p p m s i t estimated cost operation -type GetPPMSITEstimatedCostURL struct { - PpmShipmentID strfmt.UUID - SitLocation string - - SitDepartureDate strfmt.DateTime - SitEntryDate strfmt.DateTime - WeightStored int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMSITEstimatedCostURL) WithBasePath(bp string) *GetPPMSITEstimatedCostURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPPMSITEstimatedCostURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPPMSITEstimatedCostURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on GetPPMSITEstimatedCostURL") - } - - sitLocation := o.SitLocation - if sitLocation != "" { - _path = strings.Replace(_path, "{sitLocation}", sitLocation, -1) - } else { - return nil, errors.New("sitLocation is required on GetPPMSITEstimatedCostURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - sitDepartureDateQ := o.SitDepartureDate.String() - if sitDepartureDateQ != "" { - qs.Set("sitDepartureDate", sitDepartureDateQ) - } - - sitEntryDateQ := o.SitEntryDate.String() - if sitEntryDateQ != "" { - qs.Set("sitEntryDate", sitEntryDateQ) - } - - weightStoredQ := swag.FormatInt64(o.WeightStored) - if weightStoredQ != "" { - qs.Set("weightStored", weightStoredQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPPMSITEstimatedCostURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPPMSITEstimatedCostURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPPMSITEstimatedCostURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPPMSITEstimatedCostURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPPMSITEstimatedCostURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPPMSITEstimatedCostURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go deleted file mode 100644 index 2766f01b32c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowAOAPacketHandlerFunc turns a function with the right signature into a show a o a packet handler -type ShowAOAPacketHandlerFunc func(ShowAOAPacketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowAOAPacketHandlerFunc) Handle(params ShowAOAPacketParams) middleware.Responder { - return fn(params) -} - -// ShowAOAPacketHandler interface for that can handle valid show a o a packet params -type ShowAOAPacketHandler interface { - Handle(ShowAOAPacketParams) middleware.Responder -} - -// NewShowAOAPacket creates a new http.Handler for the show a o a packet operation -func NewShowAOAPacket(ctx *middleware.Context, handler ShowAOAPacketHandler) *ShowAOAPacket { - return &ShowAOAPacket{Context: ctx, Handler: handler} -} - -/* - ShowAOAPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/aoa-packet ppm showAOAPacket - -# Downloads AOA Packet form PPMShipment as a PDF - -### Functionality -This endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF. -### Errors -* The PPMShipment must have requested an AOA. -* The PPMShipment AOA Request must have been approved. -*/ -type ShowAOAPacket struct { - Context *middleware.Context - Handler ShowAOAPacketHandler -} - -func (o *ShowAOAPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowAOAPacketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go deleted file mode 100644 index 046c0667969..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewShowAOAPacketParams creates a new ShowAOAPacketParams object -// -// There are no default values defined in the spec. -func NewShowAOAPacketParams() ShowAOAPacketParams { - - return ShowAOAPacketParams{} -} - -// ShowAOAPacketParams contains all the bound params for the show a o a packet operation -// typically these are obtained from a http.Request -// -// swagger:parameters showAOAPacket -type ShowAOAPacketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the id for the ppmshipment with aoa to be downloaded - Required: true - In: path - */ - PpmShipmentID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowAOAPacketParams() beforehand. -func (o *ShowAOAPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *ShowAOAPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PpmShipmentID = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go deleted file mode 100644 index f7f0bb5e2f9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ShowAOAPacketOKCode is the HTTP code returned for type ShowAOAPacketOK -const ShowAOAPacketOKCode int = 200 - -/* -ShowAOAPacketOK AOA PDF - -swagger:response showAOAPacketOK -*/ -type ShowAOAPacketOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewShowAOAPacketOK creates ShowAOAPacketOK with default headers values -func NewShowAOAPacketOK() *ShowAOAPacketOK { - - return &ShowAOAPacketOK{} -} - -// WithContentDisposition adds the contentDisposition to the show a o a packet o k response -func (o *ShowAOAPacketOK) WithContentDisposition(contentDisposition string) *ShowAOAPacketOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the show a o a packet o k response -func (o *ShowAOAPacketOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the show a o a packet o k response -func (o *ShowAOAPacketOK) WithPayload(payload io.ReadCloser) *ShowAOAPacketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet o k response -func (o *ShowAOAPacketOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowAOAPacketBadRequestCode is the HTTP code returned for type ShowAOAPacketBadRequest -const ShowAOAPacketBadRequestCode int = 400 - -/* -ShowAOAPacketBadRequest The request payload is invalid - -swagger:response showAOAPacketBadRequest -*/ -type ShowAOAPacketBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewShowAOAPacketBadRequest creates ShowAOAPacketBadRequest with default headers values -func NewShowAOAPacketBadRequest() *ShowAOAPacketBadRequest { - - return &ShowAOAPacketBadRequest{} -} - -// WithPayload adds the payload to the show a o a packet bad request response -func (o *ShowAOAPacketBadRequest) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet bad request response -func (o *ShowAOAPacketBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketForbiddenCode is the HTTP code returned for type ShowAOAPacketForbidden -const ShowAOAPacketForbiddenCode int = 403 - -/* -ShowAOAPacketForbidden The request was denied - -swagger:response showAOAPacketForbidden -*/ -type ShowAOAPacketForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewShowAOAPacketForbidden creates ShowAOAPacketForbidden with default headers values -func NewShowAOAPacketForbidden() *ShowAOAPacketForbidden { - - return &ShowAOAPacketForbidden{} -} - -// WithPayload adds the payload to the show a o a packet forbidden response -func (o *ShowAOAPacketForbidden) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet forbidden response -func (o *ShowAOAPacketForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketNotFoundCode is the HTTP code returned for type ShowAOAPacketNotFound -const ShowAOAPacketNotFoundCode int = 404 - -/* -ShowAOAPacketNotFound The requested resource wasn't found - -swagger:response showAOAPacketNotFound -*/ -type ShowAOAPacketNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewShowAOAPacketNotFound creates ShowAOAPacketNotFound with default headers values -func NewShowAOAPacketNotFound() *ShowAOAPacketNotFound { - - return &ShowAOAPacketNotFound{} -} - -// WithPayload adds the payload to the show a o a packet not found response -func (o *ShowAOAPacketNotFound) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet not found response -func (o *ShowAOAPacketNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketUnprocessableEntityCode is the HTTP code returned for type ShowAOAPacketUnprocessableEntity -const ShowAOAPacketUnprocessableEntityCode int = 422 - -/* -ShowAOAPacketUnprocessableEntity The payload was unprocessable. - -swagger:response showAOAPacketUnprocessableEntity -*/ -type ShowAOAPacketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewShowAOAPacketUnprocessableEntity creates ShowAOAPacketUnprocessableEntity with default headers values -func NewShowAOAPacketUnprocessableEntity() *ShowAOAPacketUnprocessableEntity { - - return &ShowAOAPacketUnprocessableEntity{} -} - -// WithPayload adds the payload to the show a o a packet unprocessable entity response -func (o *ShowAOAPacketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ShowAOAPacketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet unprocessable entity response -func (o *ShowAOAPacketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketInternalServerErrorCode is the HTTP code returned for type ShowAOAPacketInternalServerError -const ShowAOAPacketInternalServerErrorCode int = 500 - -/* -ShowAOAPacketInternalServerError A server error occurred - -swagger:response showAOAPacketInternalServerError -*/ -type ShowAOAPacketInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewShowAOAPacketInternalServerError creates ShowAOAPacketInternalServerError with default headers values -func NewShowAOAPacketInternalServerError() *ShowAOAPacketInternalServerError { - - return &ShowAOAPacketInternalServerError{} -} - -// WithPayload adds the payload to the show a o a packet internal server error response -func (o *ShowAOAPacketInternalServerError) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet internal server error response -func (o *ShowAOAPacketInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go deleted file mode 100644 index 92f3764fe58..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ShowAOAPacketURL generates an URL for the show a o a packet operation -type ShowAOAPacketURL struct { - PpmShipmentID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAOAPacketURL) WithBasePath(bp string) *ShowAOAPacketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAOAPacketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowAOAPacketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/aoa-packet" - - ppmShipmentID := o.PpmShipmentID - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on ShowAOAPacketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowAOAPacketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowAOAPacketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowAOAPacketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowAOAPacketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowAOAPacketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowAOAPacketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go deleted file mode 100644 index 8ba7d0c7e56..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowPaymentPacketHandlerFunc turns a function with the right signature into a show payment packet handler -type ShowPaymentPacketHandlerFunc func(ShowPaymentPacketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowPaymentPacketHandlerFunc) Handle(params ShowPaymentPacketParams) middleware.Responder { - return fn(params) -} - -// ShowPaymentPacketHandler interface for that can handle valid show payment packet params -type ShowPaymentPacketHandler interface { - Handle(ShowPaymentPacketParams) middleware.Responder -} - -// NewShowPaymentPacket creates a new http.Handler for the show payment packet operation -func NewShowPaymentPacket(ctx *middleware.Context, handler ShowPaymentPacketHandler) *ShowPaymentPacket { - return &ShowPaymentPacket{Context: ctx, Handler: handler} -} - -/* - ShowPaymentPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/payment-packet ppm showPaymentPacket - -# Returns PPM payment packet - -Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations. -*/ -type ShowPaymentPacket struct { - Context *middleware.Context - Handler ShowPaymentPacketHandler -} - -func (o *ShowPaymentPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowPaymentPacketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go deleted file mode 100644 index b3b4c85fadf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowPaymentPacketParams creates a new ShowPaymentPacketParams object -// -// There are no default values defined in the spec. -func NewShowPaymentPacketParams() ShowPaymentPacketParams { - - return ShowPaymentPacketParams{} -} - -// ShowPaymentPacketParams contains all the bound params for the show payment packet operation -// typically these are obtained from a http.Request -// -// swagger:parameters showPaymentPacket -type ShowPaymentPacketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the ppmShipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowPaymentPacketParams() beforehand. -func (o *ShowPaymentPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *ShowPaymentPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *ShowPaymentPacketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go deleted file mode 100644 index 8537da157f4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" -) - -// ShowPaymentPacketOKCode is the HTTP code returned for type ShowPaymentPacketOK -const ShowPaymentPacketOKCode int = 200 - -/* -ShowPaymentPacketOK PPM Payment Packet PDF - -swagger:response showPaymentPacketOK -*/ -type ShowPaymentPacketOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewShowPaymentPacketOK creates ShowPaymentPacketOK with default headers values -func NewShowPaymentPacketOK() *ShowPaymentPacketOK { - - return &ShowPaymentPacketOK{} -} - -// WithContentDisposition adds the contentDisposition to the show payment packet o k response -func (o *ShowPaymentPacketOK) WithContentDisposition(contentDisposition string) *ShowPaymentPacketOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the show payment packet o k response -func (o *ShowPaymentPacketOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the show payment packet o k response -func (o *ShowPaymentPacketOK) WithPayload(payload io.ReadCloser) *ShowPaymentPacketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show payment packet o k response -func (o *ShowPaymentPacketOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowPaymentPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowPaymentPacketBadRequestCode is the HTTP code returned for type ShowPaymentPacketBadRequest -const ShowPaymentPacketBadRequestCode int = 400 - -/* -ShowPaymentPacketBadRequest invalid request - -swagger:response showPaymentPacketBadRequest -*/ -type ShowPaymentPacketBadRequest struct { -} - -// NewShowPaymentPacketBadRequest creates ShowPaymentPacketBadRequest with default headers values -func NewShowPaymentPacketBadRequest() *ShowPaymentPacketBadRequest { - - return &ShowPaymentPacketBadRequest{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowPaymentPacketUnauthorizedCode is the HTTP code returned for type ShowPaymentPacketUnauthorized -const ShowPaymentPacketUnauthorizedCode int = 401 - -/* -ShowPaymentPacketUnauthorized request requires user authentication - -swagger:response showPaymentPacketUnauthorized -*/ -type ShowPaymentPacketUnauthorized struct { -} - -// NewShowPaymentPacketUnauthorized creates ShowPaymentPacketUnauthorized with default headers values -func NewShowPaymentPacketUnauthorized() *ShowPaymentPacketUnauthorized { - - return &ShowPaymentPacketUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowPaymentPacketForbiddenCode is the HTTP code returned for type ShowPaymentPacketForbidden -const ShowPaymentPacketForbiddenCode int = 403 - -/* -ShowPaymentPacketForbidden user is not authorized - -swagger:response showPaymentPacketForbidden -*/ -type ShowPaymentPacketForbidden struct { -} - -// NewShowPaymentPacketForbidden creates ShowPaymentPacketForbidden with default headers values -func NewShowPaymentPacketForbidden() *ShowPaymentPacketForbidden { - - return &ShowPaymentPacketForbidden{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowPaymentPacketNotFoundCode is the HTTP code returned for type ShowPaymentPacketNotFound -const ShowPaymentPacketNotFoundCode int = 404 - -/* -ShowPaymentPacketNotFound ppm not found - -swagger:response showPaymentPacketNotFound -*/ -type ShowPaymentPacketNotFound struct { -} - -// NewShowPaymentPacketNotFound creates ShowPaymentPacketNotFound with default headers values -func NewShowPaymentPacketNotFound() *ShowPaymentPacketNotFound { - - return &ShowPaymentPacketNotFound{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowPaymentPacketInternalServerErrorCode is the HTTP code returned for type ShowPaymentPacketInternalServerError -const ShowPaymentPacketInternalServerErrorCode int = 500 - -/* -ShowPaymentPacketInternalServerError internal server error - -swagger:response showPaymentPacketInternalServerError -*/ -type ShowPaymentPacketInternalServerError struct { -} - -// NewShowPaymentPacketInternalServerError creates ShowPaymentPacketInternalServerError with default headers values -func NewShowPaymentPacketInternalServerError() *ShowPaymentPacketInternalServerError { - - return &ShowPaymentPacketInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go deleted file mode 100644 index 3ab88cafdd9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowPaymentPacketURL generates an URL for the show payment packet operation -type ShowPaymentPacketURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowPaymentPacketURL) WithBasePath(bp string) *ShowPaymentPacketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowPaymentPacketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowPaymentPacketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/payment-packet" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on ShowPaymentPacketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowPaymentPacketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowPaymentPacketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowPaymentPacketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowPaymentPacketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowPaymentPacketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowPaymentPacketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go deleted file mode 100644 index 224c2b25336..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMovingExpenseHandlerFunc turns a function with the right signature into a update moving expense handler -type UpdateMovingExpenseHandlerFunc func(UpdateMovingExpenseParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMovingExpenseHandlerFunc) Handle(params UpdateMovingExpenseParams) middleware.Responder { - return fn(params) -} - -// UpdateMovingExpenseHandler interface for that can handle valid update moving expense params -type UpdateMovingExpenseHandler interface { - Handle(UpdateMovingExpenseParams) middleware.Responder -} - -// NewUpdateMovingExpense creates a new http.Handler for the update moving expense operation -func NewUpdateMovingExpense(ctx *middleware.Context, handler UpdateMovingExpenseHandler) *UpdateMovingExpense { - return &UpdateMovingExpense{Context: ctx, Handler: handler} -} - -/* - UpdateMovingExpense swagger:route PATCH /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm updateMovingExpense - -# Updates the moving expense - -Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are -editable because some have to be set by the customer, e.g. the description and the moving expense type. -*/ -type UpdateMovingExpense struct { - Context *middleware.Context - Handler UpdateMovingExpenseHandler -} - -func (o *UpdateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMovingExpenseParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go deleted file mode 100644 index 9eecabd5e21..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateMovingExpenseParams creates a new UpdateMovingExpenseParams object -// -// There are no default values defined in the spec. -func NewUpdateMovingExpenseParams() UpdateMovingExpenseParams { - - return UpdateMovingExpenseParams{} -} - -// UpdateMovingExpenseParams contains all the bound params for the update moving expense operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMovingExpense -type UpdateMovingExpenseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the moving expense - Required: true - In: path - */ - MovingExpenseID strfmt.UUID - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - UpdateMovingExpense *ghcmessages.UpdateMovingExpense -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMovingExpenseParams() beforehand. -func (o *UpdateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") - if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateMovingExpense - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateMovingExpense", "body", "")) - } else { - res = append(res, errors.NewParseError("updateMovingExpense", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateMovingExpense = &body - } - } - } else { - res = append(res, errors.Required("updateMovingExpense", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMovingExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. -func (o *UpdateMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) - } - o.MovingExpenseID = *(value.(*strfmt.UUID)) - - if err := o.validateMovingExpenseID(formats); err != nil { - return err - } - - return nil -} - -// validateMovingExpenseID carries on validations for parameter MovingExpenseID -func (o *UpdateMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { - - if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go deleted file mode 100644 index d4be7d73b00..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateMovingExpenseOKCode is the HTTP code returned for type UpdateMovingExpenseOK -const UpdateMovingExpenseOKCode int = 200 - -/* -UpdateMovingExpenseOK returns an updated moving expense object - -swagger:response updateMovingExpenseOK -*/ -type UpdateMovingExpenseOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MovingExpense `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseOK creates UpdateMovingExpenseOK with default headers values -func NewUpdateMovingExpenseOK() *UpdateMovingExpenseOK { - - return &UpdateMovingExpenseOK{} -} - -// WithPayload adds the payload to the update moving expense o k response -func (o *UpdateMovingExpenseOK) WithPayload(payload *ghcmessages.MovingExpense) *UpdateMovingExpenseOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense o k response -func (o *UpdateMovingExpenseOK) SetPayload(payload *ghcmessages.MovingExpense) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseBadRequestCode is the HTTP code returned for type UpdateMovingExpenseBadRequest -const UpdateMovingExpenseBadRequestCode int = 400 - -/* -UpdateMovingExpenseBadRequest The request payload is invalid - -swagger:response updateMovingExpenseBadRequest -*/ -type UpdateMovingExpenseBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseBadRequest creates UpdateMovingExpenseBadRequest with default headers values -func NewUpdateMovingExpenseBadRequest() *UpdateMovingExpenseBadRequest { - - return &UpdateMovingExpenseBadRequest{} -} - -// WithPayload adds the payload to the update moving expense bad request response -func (o *UpdateMovingExpenseBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense bad request response -func (o *UpdateMovingExpenseBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseUnauthorizedCode is the HTTP code returned for type UpdateMovingExpenseUnauthorized -const UpdateMovingExpenseUnauthorizedCode int = 401 - -/* -UpdateMovingExpenseUnauthorized The request was denied - -swagger:response updateMovingExpenseUnauthorized -*/ -type UpdateMovingExpenseUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseUnauthorized creates UpdateMovingExpenseUnauthorized with default headers values -func NewUpdateMovingExpenseUnauthorized() *UpdateMovingExpenseUnauthorized { - - return &UpdateMovingExpenseUnauthorized{} -} - -// WithPayload adds the payload to the update moving expense unauthorized response -func (o *UpdateMovingExpenseUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense unauthorized response -func (o *UpdateMovingExpenseUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseForbiddenCode is the HTTP code returned for type UpdateMovingExpenseForbidden -const UpdateMovingExpenseForbiddenCode int = 403 - -/* -UpdateMovingExpenseForbidden The request was denied - -swagger:response updateMovingExpenseForbidden -*/ -type UpdateMovingExpenseForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseForbidden creates UpdateMovingExpenseForbidden with default headers values -func NewUpdateMovingExpenseForbidden() *UpdateMovingExpenseForbidden { - - return &UpdateMovingExpenseForbidden{} -} - -// WithPayload adds the payload to the update moving expense forbidden response -func (o *UpdateMovingExpenseForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense forbidden response -func (o *UpdateMovingExpenseForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseNotFoundCode is the HTTP code returned for type UpdateMovingExpenseNotFound -const UpdateMovingExpenseNotFoundCode int = 404 - -/* -UpdateMovingExpenseNotFound The requested resource wasn't found - -swagger:response updateMovingExpenseNotFound -*/ -type UpdateMovingExpenseNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseNotFound creates UpdateMovingExpenseNotFound with default headers values -func NewUpdateMovingExpenseNotFound() *UpdateMovingExpenseNotFound { - - return &UpdateMovingExpenseNotFound{} -} - -// WithPayload adds the payload to the update moving expense not found response -func (o *UpdateMovingExpenseNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense not found response -func (o *UpdateMovingExpenseNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpensePreconditionFailedCode is the HTTP code returned for type UpdateMovingExpensePreconditionFailed -const UpdateMovingExpensePreconditionFailedCode int = 412 - -/* -UpdateMovingExpensePreconditionFailed Precondition failed - -swagger:response updateMovingExpensePreconditionFailed -*/ -type UpdateMovingExpensePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpensePreconditionFailed creates UpdateMovingExpensePreconditionFailed with default headers values -func NewUpdateMovingExpensePreconditionFailed() *UpdateMovingExpensePreconditionFailed { - - return &UpdateMovingExpensePreconditionFailed{} -} - -// WithPayload adds the payload to the update moving expense precondition failed response -func (o *UpdateMovingExpensePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpensePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense precondition failed response -func (o *UpdateMovingExpensePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateMovingExpenseUnprocessableEntity -const UpdateMovingExpenseUnprocessableEntityCode int = 422 - -/* -UpdateMovingExpenseUnprocessableEntity The payload was unprocessable. - -swagger:response updateMovingExpenseUnprocessableEntity -*/ -type UpdateMovingExpenseUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseUnprocessableEntity creates UpdateMovingExpenseUnprocessableEntity with default headers values -func NewUpdateMovingExpenseUnprocessableEntity() *UpdateMovingExpenseUnprocessableEntity { - - return &UpdateMovingExpenseUnprocessableEntity{} -} - -// WithPayload adds the payload to the update moving expense unprocessable entity response -func (o *UpdateMovingExpenseUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMovingExpenseUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense unprocessable entity response -func (o *UpdateMovingExpenseUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseInternalServerErrorCode is the HTTP code returned for type UpdateMovingExpenseInternalServerError -const UpdateMovingExpenseInternalServerErrorCode int = 500 - -/* -UpdateMovingExpenseInternalServerError A server error occurred - -swagger:response updateMovingExpenseInternalServerError -*/ -type UpdateMovingExpenseInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseInternalServerError creates UpdateMovingExpenseInternalServerError with default headers values -func NewUpdateMovingExpenseInternalServerError() *UpdateMovingExpenseInternalServerError { - - return &UpdateMovingExpenseInternalServerError{} -} - -// WithPayload adds the payload to the update moving expense internal server error response -func (o *UpdateMovingExpenseInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense internal server error response -func (o *UpdateMovingExpenseInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go deleted file mode 100644 index de39727106b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMovingExpenseURL generates an URL for the update moving expense operation -type UpdateMovingExpenseURL struct { - MovingExpenseID strfmt.UUID - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMovingExpenseURL) WithBasePath(bp string) *UpdateMovingExpenseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMovingExpenseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMovingExpenseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" - - movingExpenseID := o.MovingExpenseID.String() - if movingExpenseID != "" { - _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) - } else { - return nil, errors.New("movingExpenseId is required on UpdateMovingExpenseURL") - } - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateMovingExpenseURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMovingExpenseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMovingExpenseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMovingExpenseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMovingExpenseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go deleted file mode 100644 index 9151318adb2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdatePPMSITHandlerFunc turns a function with the right signature into a update p p m s i t handler -type UpdatePPMSITHandlerFunc func(UpdatePPMSITParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdatePPMSITHandlerFunc) Handle(params UpdatePPMSITParams) middleware.Responder { - return fn(params) -} - -// UpdatePPMSITHandler interface for that can handle valid update p p m s i t params -type UpdatePPMSITHandler interface { - Handle(UpdatePPMSITParams) middleware.Responder -} - -// NewUpdatePPMSIT creates a new http.Handler for the update p p m s i t operation -func NewUpdatePPMSIT(ctx *middleware.Context, handler UpdatePPMSITHandler) *UpdatePPMSIT { - return &UpdatePPMSIT{Context: ctx, Handler: handler} -} - -/* - UpdatePPMSIT swagger:route PATCH /ppm-shipments/{ppmShipmentId}/ppm-sit ppm updatePPMSIT - -# Updates a PPM shipment's SIT values - -Updates a PPM shipment's SIT values -*/ -type UpdatePPMSIT struct { - Context *middleware.Context - Handler UpdatePPMSITHandler -} - -func (o *UpdatePPMSIT) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdatePPMSITParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go deleted file mode 100644 index 13b0433528a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdatePPMSITParams creates a new UpdatePPMSITParams object -// -// There are no default values defined in the spec. -func NewUpdatePPMSITParams() UpdatePPMSITParams { - - return UpdatePPMSITParams{} -} - -// UpdatePPMSITParams contains all the bound params for the update p p m s i t operation -// typically these are obtained from a http.Request -// -// swagger:parameters updatePPMSIT -type UpdatePPMSITParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - In: body - */ - Body *ghcmessages.PPMShipmentSIT - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdatePPMSITParams() beforehand. -func (o *UpdatePPMSITParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.PPMShipmentSIT - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdatePPMSITParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdatePPMSITParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdatePPMSITParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go deleted file mode 100644 index f2ed2f59b26..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdatePPMSITOKCode is the HTTP code returned for type UpdatePPMSITOK -const UpdatePPMSITOKCode int = 200 - -/* -UpdatePPMSITOK Successfully finished PPM SIT update - -swagger:response updatePPMSITOK -*/ -type UpdatePPMSITOK struct { - - /* - In: Body - */ - Payload *ghcmessages.PPMShipment `json:"body,omitempty"` -} - -// NewUpdatePPMSITOK creates UpdatePPMSITOK with default headers values -func NewUpdatePPMSITOK() *UpdatePPMSITOK { - - return &UpdatePPMSITOK{} -} - -// WithPayload adds the payload to the update p p m s i t o k response -func (o *UpdatePPMSITOK) WithPayload(payload *ghcmessages.PPMShipment) *UpdatePPMSITOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t o k response -func (o *UpdatePPMSITOK) SetPayload(payload *ghcmessages.PPMShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITBadRequestCode is the HTTP code returned for type UpdatePPMSITBadRequest -const UpdatePPMSITBadRequestCode int = 400 - -/* -UpdatePPMSITBadRequest The request payload is invalid - -swagger:response updatePPMSITBadRequest -*/ -type UpdatePPMSITBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePPMSITBadRequest creates UpdatePPMSITBadRequest with default headers values -func NewUpdatePPMSITBadRequest() *UpdatePPMSITBadRequest { - - return &UpdatePPMSITBadRequest{} -} - -// WithPayload adds the payload to the update p p m s i t bad request response -func (o *UpdatePPMSITBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t bad request response -func (o *UpdatePPMSITBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITForbiddenCode is the HTTP code returned for type UpdatePPMSITForbidden -const UpdatePPMSITForbiddenCode int = 403 - -/* -UpdatePPMSITForbidden The request was denied - -swagger:response updatePPMSITForbidden -*/ -type UpdatePPMSITForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePPMSITForbidden creates UpdatePPMSITForbidden with default headers values -func NewUpdatePPMSITForbidden() *UpdatePPMSITForbidden { - - return &UpdatePPMSITForbidden{} -} - -// WithPayload adds the payload to the update p p m s i t forbidden response -func (o *UpdatePPMSITForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t forbidden response -func (o *UpdatePPMSITForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITNotFoundCode is the HTTP code returned for type UpdatePPMSITNotFound -const UpdatePPMSITNotFoundCode int = 404 - -/* -UpdatePPMSITNotFound The requested resource wasn't found - -swagger:response updatePPMSITNotFound -*/ -type UpdatePPMSITNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePPMSITNotFound creates UpdatePPMSITNotFound with default headers values -func NewUpdatePPMSITNotFound() *UpdatePPMSITNotFound { - - return &UpdatePPMSITNotFound{} -} - -// WithPayload adds the payload to the update p p m s i t not found response -func (o *UpdatePPMSITNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t not found response -func (o *UpdatePPMSITNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITPreconditionFailedCode is the HTTP code returned for type UpdatePPMSITPreconditionFailed -const UpdatePPMSITPreconditionFailedCode int = 412 - -/* -UpdatePPMSITPreconditionFailed Precondition failed - -swagger:response updatePPMSITPreconditionFailed -*/ -type UpdatePPMSITPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePPMSITPreconditionFailed creates UpdatePPMSITPreconditionFailed with default headers values -func NewUpdatePPMSITPreconditionFailed() *UpdatePPMSITPreconditionFailed { - - return &UpdatePPMSITPreconditionFailed{} -} - -// WithPayload adds the payload to the update p p m s i t precondition failed response -func (o *UpdatePPMSITPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t precondition failed response -func (o *UpdatePPMSITPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITUnprocessableEntityCode is the HTTP code returned for type UpdatePPMSITUnprocessableEntity -const UpdatePPMSITUnprocessableEntityCode int = 422 - -/* -UpdatePPMSITUnprocessableEntity The payload was unprocessable. - -swagger:response updatePPMSITUnprocessableEntity -*/ -type UpdatePPMSITUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdatePPMSITUnprocessableEntity creates UpdatePPMSITUnprocessableEntity with default headers values -func NewUpdatePPMSITUnprocessableEntity() *UpdatePPMSITUnprocessableEntity { - - return &UpdatePPMSITUnprocessableEntity{} -} - -// WithPayload adds the payload to the update p p m s i t unprocessable entity response -func (o *UpdatePPMSITUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePPMSITUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t unprocessable entity response -func (o *UpdatePPMSITUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePPMSITInternalServerErrorCode is the HTTP code returned for type UpdatePPMSITInternalServerError -const UpdatePPMSITInternalServerErrorCode int = 500 - -/* -UpdatePPMSITInternalServerError A server error occurred - -swagger:response updatePPMSITInternalServerError -*/ -type UpdatePPMSITInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePPMSITInternalServerError creates UpdatePPMSITInternalServerError with default headers values -func NewUpdatePPMSITInternalServerError() *UpdatePPMSITInternalServerError { - - return &UpdatePPMSITInternalServerError{} -} - -// WithPayload adds the payload to the update p p m s i t internal server error response -func (o *UpdatePPMSITInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update p p m s i t internal server error response -func (o *UpdatePPMSITInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePPMSITInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go deleted file mode 100644 index 569016d2412..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdatePPMSITURL generates an URL for the update p p m s i t operation -type UpdatePPMSITURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePPMSITURL) WithBasePath(bp string) *UpdatePPMSITURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePPMSITURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdatePPMSITURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/ppm-sit" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdatePPMSITURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdatePPMSITURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdatePPMSITURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdatePPMSITURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdatePPMSITURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdatePPMSITURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdatePPMSITURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go deleted file mode 100644 index 548bc7605a1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateProGearWeightTicketHandlerFunc turns a function with the right signature into a update pro gear weight ticket handler -type UpdateProGearWeightTicketHandlerFunc func(UpdateProGearWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateProGearWeightTicketHandlerFunc) Handle(params UpdateProGearWeightTicketParams) middleware.Responder { - return fn(params) -} - -// UpdateProGearWeightTicketHandler interface for that can handle valid update pro gear weight ticket params -type UpdateProGearWeightTicketHandler interface { - Handle(UpdateProGearWeightTicketParams) middleware.Responder -} - -// NewUpdateProGearWeightTicket creates a new http.Handler for the update pro gear weight ticket operation -func NewUpdateProGearWeightTicket(ctx *middleware.Context, handler UpdateProGearWeightTicketHandler) *UpdateProGearWeightTicket { - return &UpdateProGearWeightTicket{Context: ctx, Handler: handler} -} - -/* - UpdateProGearWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm updateProGearWeightTicket - -# Updates a pro-gear weight ticket - -Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable -because some have to be set by the customer, e.g. the description. -*/ -type UpdateProGearWeightTicket struct { - Context *middleware.Context - Handler UpdateProGearWeightTicketHandler -} - -func (o *UpdateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateProGearWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go deleted file mode 100644 index 31aef97d6dc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateProGearWeightTicketParams creates a new UpdateProGearWeightTicketParams object -// -// There are no default values defined in the spec. -func NewUpdateProGearWeightTicketParams() UpdateProGearWeightTicketParams { - - return UpdateProGearWeightTicketParams{} -} - -// UpdateProGearWeightTicketParams contains all the bound params for the update pro gear weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateProGearWeightTicket -type UpdateProGearWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*UUID of the pro-gear weight ticket - Required: true - In: path - */ - ProGearWeightTicketID strfmt.UUID - /* - Required: true - In: body - */ - UpdateProGearWeightTicket *ghcmessages.UpdateProGearWeightTicket -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateProGearWeightTicketParams() beforehand. -func (o *UpdateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") - if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateProGearWeightTicket - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) - } else { - res = append(res, errors.NewParseError("updateProGearWeightTicket", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateProGearWeightTicket = &body - } - } - } else { - res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateProGearWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. -func (o *UpdateProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) - } - o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateProGearWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID -func (o *UpdateProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go deleted file mode 100644 index a36a4622ce2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateProGearWeightTicketOKCode is the HTTP code returned for type UpdateProGearWeightTicketOK -const UpdateProGearWeightTicketOKCode int = 200 - -/* -UpdateProGearWeightTicketOK returns an updated pro-gear weight ticket object - -swagger:response updateProGearWeightTicketOK -*/ -type UpdateProGearWeightTicketOK struct { - - /* - In: Body - */ - Payload *ghcmessages.ProGearWeightTicket `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketOK creates UpdateProGearWeightTicketOK with default headers values -func NewUpdateProGearWeightTicketOK() *UpdateProGearWeightTicketOK { - - return &UpdateProGearWeightTicketOK{} -} - -// WithPayload adds the payload to the update pro gear weight ticket o k response -func (o *UpdateProGearWeightTicketOK) WithPayload(payload *ghcmessages.ProGearWeightTicket) *UpdateProGearWeightTicketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket o k response -func (o *UpdateProGearWeightTicketOK) SetPayload(payload *ghcmessages.ProGearWeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketBadRequestCode is the HTTP code returned for type UpdateProGearWeightTicketBadRequest -const UpdateProGearWeightTicketBadRequestCode int = 400 - -/* -UpdateProGearWeightTicketBadRequest The request payload is invalid - -swagger:response updateProGearWeightTicketBadRequest -*/ -type UpdateProGearWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketBadRequest creates UpdateProGearWeightTicketBadRequest with default headers values -func NewUpdateProGearWeightTicketBadRequest() *UpdateProGearWeightTicketBadRequest { - - return &UpdateProGearWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the update pro gear weight ticket bad request response -func (o *UpdateProGearWeightTicketBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket bad request response -func (o *UpdateProGearWeightTicketBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateProGearWeightTicketUnauthorized -const UpdateProGearWeightTicketUnauthorizedCode int = 401 - -/* -UpdateProGearWeightTicketUnauthorized The request was denied - -swagger:response updateProGearWeightTicketUnauthorized -*/ -type UpdateProGearWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketUnauthorized creates UpdateProGearWeightTicketUnauthorized with default headers values -func NewUpdateProGearWeightTicketUnauthorized() *UpdateProGearWeightTicketUnauthorized { - - return &UpdateProGearWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the update pro gear weight ticket unauthorized response -func (o *UpdateProGearWeightTicketUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket unauthorized response -func (o *UpdateProGearWeightTicketUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketForbiddenCode is the HTTP code returned for type UpdateProGearWeightTicketForbidden -const UpdateProGearWeightTicketForbiddenCode int = 403 - -/* -UpdateProGearWeightTicketForbidden The request was denied - -swagger:response updateProGearWeightTicketForbidden -*/ -type UpdateProGearWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketForbidden creates UpdateProGearWeightTicketForbidden with default headers values -func NewUpdateProGearWeightTicketForbidden() *UpdateProGearWeightTicketForbidden { - - return &UpdateProGearWeightTicketForbidden{} -} - -// WithPayload adds the payload to the update pro gear weight ticket forbidden response -func (o *UpdateProGearWeightTicketForbidden) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket forbidden response -func (o *UpdateProGearWeightTicketForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketNotFoundCode is the HTTP code returned for type UpdateProGearWeightTicketNotFound -const UpdateProGearWeightTicketNotFoundCode int = 404 - -/* -UpdateProGearWeightTicketNotFound The requested resource wasn't found - -swagger:response updateProGearWeightTicketNotFound -*/ -type UpdateProGearWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketNotFound creates UpdateProGearWeightTicketNotFound with default headers values -func NewUpdateProGearWeightTicketNotFound() *UpdateProGearWeightTicketNotFound { - - return &UpdateProGearWeightTicketNotFound{} -} - -// WithPayload adds the payload to the update pro gear weight ticket not found response -func (o *UpdateProGearWeightTicketNotFound) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket not found response -func (o *UpdateProGearWeightTicketNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateProGearWeightTicketPreconditionFailed -const UpdateProGearWeightTicketPreconditionFailedCode int = 412 - -/* -UpdateProGearWeightTicketPreconditionFailed Precondition failed - -swagger:response updateProGearWeightTicketPreconditionFailed -*/ -type UpdateProGearWeightTicketPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketPreconditionFailed creates UpdateProGearWeightTicketPreconditionFailed with default headers values -func NewUpdateProGearWeightTicketPreconditionFailed() *UpdateProGearWeightTicketPreconditionFailed { - - return &UpdateProGearWeightTicketPreconditionFailed{} -} - -// WithPayload adds the payload to the update pro gear weight ticket precondition failed response -func (o *UpdateProGearWeightTicketPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket precondition failed response -func (o *UpdateProGearWeightTicketPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateProGearWeightTicketUnprocessableEntity -const UpdateProGearWeightTicketUnprocessableEntityCode int = 422 - -/* -UpdateProGearWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response updateProGearWeightTicketUnprocessableEntity -*/ -type UpdateProGearWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketUnprocessableEntity creates UpdateProGearWeightTicketUnprocessableEntity with default headers values -func NewUpdateProGearWeightTicketUnprocessableEntity() *UpdateProGearWeightTicketUnprocessableEntity { - - return &UpdateProGearWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the update pro gear weight ticket unprocessable entity response -func (o *UpdateProGearWeightTicketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateProGearWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket unprocessable entity response -func (o *UpdateProGearWeightTicketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateProGearWeightTicketInternalServerError -const UpdateProGearWeightTicketInternalServerErrorCode int = 500 - -/* -UpdateProGearWeightTicketInternalServerError A server error occurred - -swagger:response updateProGearWeightTicketInternalServerError -*/ -type UpdateProGearWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketInternalServerError creates UpdateProGearWeightTicketInternalServerError with default headers values -func NewUpdateProGearWeightTicketInternalServerError() *UpdateProGearWeightTicketInternalServerError { - - return &UpdateProGearWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the update pro gear weight ticket internal server error response -func (o *UpdateProGearWeightTicketInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket internal server error response -func (o *UpdateProGearWeightTicketInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go deleted file mode 100644 index 9cab7f6cd14..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateProGearWeightTicketURL generates an URL for the update pro gear weight ticket operation -type UpdateProGearWeightTicketURL struct { - PpmShipmentID strfmt.UUID - ProGearWeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateProGearWeightTicketURL) WithBasePath(bp string) *UpdateProGearWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateProGearWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateProGearWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateProGearWeightTicketURL") - } - - proGearWeightTicketID := o.ProGearWeightTicketID.String() - if proGearWeightTicketID != "" { - _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) - } else { - return nil, errors.New("proGearWeightTicketId is required on UpdateProGearWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateProGearWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateProGearWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateProGearWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateProGearWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go deleted file mode 100644 index 63d222745ae..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateWeightTicketHandlerFunc turns a function with the right signature into a update weight ticket handler -type UpdateWeightTicketHandlerFunc func(UpdateWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateWeightTicketHandlerFunc) Handle(params UpdateWeightTicketParams) middleware.Responder { - return fn(params) -} - -// UpdateWeightTicketHandler interface for that can handle valid update weight ticket params -type UpdateWeightTicketHandler interface { - Handle(UpdateWeightTicketParams) middleware.Responder -} - -// NewUpdateWeightTicket creates a new http.Handler for the update weight ticket operation -func NewUpdateWeightTicket(ctx *middleware.Context, handler UpdateWeightTicketHandler) *UpdateWeightTicket { - return &UpdateWeightTicket{Context: ctx, Handler: handler} -} - -/* - UpdateWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm updateWeightTicket - -# Updates a weight ticket document - -Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's -fields are editable because some have to be set by the customer, e.g. vehicle description. -*/ -type UpdateWeightTicket struct { - Context *middleware.Context - Handler UpdateWeightTicketHandler -} - -func (o *UpdateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go deleted file mode 100644 index 9eb43a27983..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateWeightTicketParams creates a new UpdateWeightTicketParams object -// -// There are no default values defined in the spec. -func NewUpdateWeightTicketParams() UpdateWeightTicketParams { - - return UpdateWeightTicketParams{} -} - -// UpdateWeightTicketParams contains all the bound params for the update weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateWeightTicket -type UpdateWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - UpdateWeightTicketPayload *ghcmessages.UpdateWeightTicket - /*UUID of the weight ticket - Required: true - In: path - */ - WeightTicketID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateWeightTicketParams() beforehand. -func (o *UpdateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateWeightTicket - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("updateWeightTicketPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateWeightTicketPayload = &body - } - } - } else { - res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) - } - - rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") - if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindWeightTicketID binds and validates parameter WeightTicketID from path. -func (o *UpdateWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) - } - o.WeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateWeightTicketID carries on validations for parameter WeightTicketID -func (o *UpdateWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go deleted file mode 100644 index fcce2648a02..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateWeightTicketOKCode is the HTTP code returned for type UpdateWeightTicketOK -const UpdateWeightTicketOKCode int = 200 - -/* -UpdateWeightTicketOK returns an updated weight ticket object - -swagger:response updateWeightTicketOK -*/ -type UpdateWeightTicketOK struct { - - /* - In: Body - */ - Payload *ghcmessages.WeightTicket `json:"body,omitempty"` -} - -// NewUpdateWeightTicketOK creates UpdateWeightTicketOK with default headers values -func NewUpdateWeightTicketOK() *UpdateWeightTicketOK { - - return &UpdateWeightTicketOK{} -} - -// WithPayload adds the payload to the update weight ticket o k response -func (o *UpdateWeightTicketOK) WithPayload(payload *ghcmessages.WeightTicket) *UpdateWeightTicketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket o k response -func (o *UpdateWeightTicketOK) SetPayload(payload *ghcmessages.WeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketBadRequestCode is the HTTP code returned for type UpdateWeightTicketBadRequest -const UpdateWeightTicketBadRequestCode int = 400 - -/* -UpdateWeightTicketBadRequest The request payload is invalid - -swagger:response updateWeightTicketBadRequest -*/ -type UpdateWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketBadRequest creates UpdateWeightTicketBadRequest with default headers values -func NewUpdateWeightTicketBadRequest() *UpdateWeightTicketBadRequest { - - return &UpdateWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the update weight ticket bad request response -func (o *UpdateWeightTicketBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket bad request response -func (o *UpdateWeightTicketBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateWeightTicketUnauthorized -const UpdateWeightTicketUnauthorizedCode int = 401 - -/* -UpdateWeightTicketUnauthorized The request was denied - -swagger:response updateWeightTicketUnauthorized -*/ -type UpdateWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketUnauthorized creates UpdateWeightTicketUnauthorized with default headers values -func NewUpdateWeightTicketUnauthorized() *UpdateWeightTicketUnauthorized { - - return &UpdateWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the update weight ticket unauthorized response -func (o *UpdateWeightTicketUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket unauthorized response -func (o *UpdateWeightTicketUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketForbiddenCode is the HTTP code returned for type UpdateWeightTicketForbidden -const UpdateWeightTicketForbiddenCode int = 403 - -/* -UpdateWeightTicketForbidden The request was denied - -swagger:response updateWeightTicketForbidden -*/ -type UpdateWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketForbidden creates UpdateWeightTicketForbidden with default headers values -func NewUpdateWeightTicketForbidden() *UpdateWeightTicketForbidden { - - return &UpdateWeightTicketForbidden{} -} - -// WithPayload adds the payload to the update weight ticket forbidden response -func (o *UpdateWeightTicketForbidden) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket forbidden response -func (o *UpdateWeightTicketForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketNotFoundCode is the HTTP code returned for type UpdateWeightTicketNotFound -const UpdateWeightTicketNotFoundCode int = 404 - -/* -UpdateWeightTicketNotFound The requested resource wasn't found - -swagger:response updateWeightTicketNotFound -*/ -type UpdateWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketNotFound creates UpdateWeightTicketNotFound with default headers values -func NewUpdateWeightTicketNotFound() *UpdateWeightTicketNotFound { - - return &UpdateWeightTicketNotFound{} -} - -// WithPayload adds the payload to the update weight ticket not found response -func (o *UpdateWeightTicketNotFound) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket not found response -func (o *UpdateWeightTicketNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateWeightTicketPreconditionFailed -const UpdateWeightTicketPreconditionFailedCode int = 412 - -/* -UpdateWeightTicketPreconditionFailed Precondition failed - -swagger:response updateWeightTicketPreconditionFailed -*/ -type UpdateWeightTicketPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketPreconditionFailed creates UpdateWeightTicketPreconditionFailed with default headers values -func NewUpdateWeightTicketPreconditionFailed() *UpdateWeightTicketPreconditionFailed { - - return &UpdateWeightTicketPreconditionFailed{} -} - -// WithPayload adds the payload to the update weight ticket precondition failed response -func (o *UpdateWeightTicketPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket precondition failed response -func (o *UpdateWeightTicketPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateWeightTicketUnprocessableEntity -const UpdateWeightTicketUnprocessableEntityCode int = 422 - -/* -UpdateWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response updateWeightTicketUnprocessableEntity -*/ -type UpdateWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketUnprocessableEntity creates UpdateWeightTicketUnprocessableEntity with default headers values -func NewUpdateWeightTicketUnprocessableEntity() *UpdateWeightTicketUnprocessableEntity { - - return &UpdateWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the update weight ticket unprocessable entity response -func (o *UpdateWeightTicketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket unprocessable entity response -func (o *UpdateWeightTicketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateWeightTicketInternalServerError -const UpdateWeightTicketInternalServerErrorCode int = 500 - -/* -UpdateWeightTicketInternalServerError A server error occurred - -swagger:response updateWeightTicketInternalServerError -*/ -type UpdateWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketInternalServerError creates UpdateWeightTicketInternalServerError with default headers values -func NewUpdateWeightTicketInternalServerError() *UpdateWeightTicketInternalServerError { - - return &UpdateWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the update weight ticket internal server error response -func (o *UpdateWeightTicketInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket internal server error response -func (o *UpdateWeightTicketInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go deleted file mode 100644 index 42504f88cd4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateWeightTicketURL generates an URL for the update weight ticket operation -type UpdateWeightTicketURL struct { - PpmShipmentID strfmt.UUID - WeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWeightTicketURL) WithBasePath(bp string) *UpdateWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateWeightTicketURL") - } - - weightTicketID := o.WeightTicketID.String() - if weightTicketID != "" { - _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) - } else { - return nil, errors.New("weightTicketId is required on UpdateWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go deleted file mode 100644 index 583bacfda5f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pws_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPWSViolationsHandlerFunc turns a function with the right signature into a get p w s violations handler -type GetPWSViolationsHandlerFunc func(GetPWSViolationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPWSViolationsHandlerFunc) Handle(params GetPWSViolationsParams) middleware.Responder { - return fn(params) -} - -// GetPWSViolationsHandler interface for that can handle valid get p w s violations params -type GetPWSViolationsHandler interface { - Handle(GetPWSViolationsParams) middleware.Responder -} - -// NewGetPWSViolations creates a new http.Handler for the get p w s violations operation -func NewGetPWSViolations(ctx *middleware.Context, handler GetPWSViolationsHandler) *GetPWSViolations { - return &GetPWSViolations{Context: ctx, Handler: handler} -} - -/* - GetPWSViolations swagger:route GET /pws-violations pwsViolations getPWSViolations - -# Fetch the possible PWS violations for an evaluation report - -Fetch the possible PWS violations for an evaluation report -*/ -type GetPWSViolations struct { - Context *middleware.Context - Handler GetPWSViolationsHandler -} - -func (o *GetPWSViolations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPWSViolationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go deleted file mode 100644 index ac1a466992a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pws_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetPWSViolationsParams creates a new GetPWSViolationsParams object -// -// There are no default values defined in the spec. -func NewGetPWSViolationsParams() GetPWSViolationsParams { - - return GetPWSViolationsParams{} -} - -// GetPWSViolationsParams contains all the bound params for the get p w s violations operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPWSViolations -type GetPWSViolationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPWSViolationsParams() beforehand. -func (o *GetPWSViolationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go deleted file mode 100644 index b18ab1cd2c2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pws_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPWSViolationsOKCode is the HTTP code returned for type GetPWSViolationsOK -const GetPWSViolationsOKCode int = 200 - -/* -GetPWSViolationsOK Successfully retrieved the PWS violations - -swagger:response getPWSViolationsOK -*/ -type GetPWSViolationsOK struct { - - /* - In: Body - */ - Payload ghcmessages.PWSViolations `json:"body,omitempty"` -} - -// NewGetPWSViolationsOK creates GetPWSViolationsOK with default headers values -func NewGetPWSViolationsOK() *GetPWSViolationsOK { - - return &GetPWSViolationsOK{} -} - -// WithPayload adds the payload to the get p w s violations o k response -func (o *GetPWSViolationsOK) WithPayload(payload ghcmessages.PWSViolations) *GetPWSViolationsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p w s violations o k response -func (o *GetPWSViolationsOK) SetPayload(payload ghcmessages.PWSViolations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPWSViolationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.PWSViolations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetPWSViolationsBadRequestCode is the HTTP code returned for type GetPWSViolationsBadRequest -const GetPWSViolationsBadRequestCode int = 400 - -/* -GetPWSViolationsBadRequest The request payload is invalid - -swagger:response getPWSViolationsBadRequest -*/ -type GetPWSViolationsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPWSViolationsBadRequest creates GetPWSViolationsBadRequest with default headers values -func NewGetPWSViolationsBadRequest() *GetPWSViolationsBadRequest { - - return &GetPWSViolationsBadRequest{} -} - -// WithPayload adds the payload to the get p w s violations bad request response -func (o *GetPWSViolationsBadRequest) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p w s violations bad request response -func (o *GetPWSViolationsBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPWSViolationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPWSViolationsForbiddenCode is the HTTP code returned for type GetPWSViolationsForbidden -const GetPWSViolationsForbiddenCode int = 403 - -/* -GetPWSViolationsForbidden The request was denied - -swagger:response getPWSViolationsForbidden -*/ -type GetPWSViolationsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPWSViolationsForbidden creates GetPWSViolationsForbidden with default headers values -func NewGetPWSViolationsForbidden() *GetPWSViolationsForbidden { - - return &GetPWSViolationsForbidden{} -} - -// WithPayload adds the payload to the get p w s violations forbidden response -func (o *GetPWSViolationsForbidden) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p w s violations forbidden response -func (o *GetPWSViolationsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPWSViolationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPWSViolationsNotFoundCode is the HTTP code returned for type GetPWSViolationsNotFound -const GetPWSViolationsNotFoundCode int = 404 - -/* -GetPWSViolationsNotFound The requested resource wasn't found - -swagger:response getPWSViolationsNotFound -*/ -type GetPWSViolationsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPWSViolationsNotFound creates GetPWSViolationsNotFound with default headers values -func NewGetPWSViolationsNotFound() *GetPWSViolationsNotFound { - - return &GetPWSViolationsNotFound{} -} - -// WithPayload adds the payload to the get p w s violations not found response -func (o *GetPWSViolationsNotFound) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p w s violations not found response -func (o *GetPWSViolationsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPWSViolationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPWSViolationsInternalServerErrorCode is the HTTP code returned for type GetPWSViolationsInternalServerError -const GetPWSViolationsInternalServerErrorCode int = 500 - -/* -GetPWSViolationsInternalServerError A server error occurred - -swagger:response getPWSViolationsInternalServerError -*/ -type GetPWSViolationsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPWSViolationsInternalServerError creates GetPWSViolationsInternalServerError with default headers values -func NewGetPWSViolationsInternalServerError() *GetPWSViolationsInternalServerError { - - return &GetPWSViolationsInternalServerError{} -} - -// WithPayload adds the payload to the get p w s violations internal server error response -func (o *GetPWSViolationsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get p w s violations internal server error response -func (o *GetPWSViolationsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPWSViolationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go deleted file mode 100644 index 46e5b445ded..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package pws_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetPWSViolationsURL generates an URL for the get p w s violations operation -type GetPWSViolationsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPWSViolationsURL) WithBasePath(bp string) *GetPWSViolationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPWSViolationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPWSViolationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/pws-violations" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPWSViolationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPWSViolationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPWSViolationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPWSViolationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPWSViolationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPWSViolationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go deleted file mode 100644 index a48fbcedc45..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetBulkAssignmentDataHandlerFunc turns a function with the right signature into a get bulk assignment data handler -type GetBulkAssignmentDataHandlerFunc func(GetBulkAssignmentDataParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetBulkAssignmentDataHandlerFunc) Handle(params GetBulkAssignmentDataParams) middleware.Responder { - return fn(params) -} - -// GetBulkAssignmentDataHandler interface for that can handle valid get bulk assignment data params -type GetBulkAssignmentDataHandler interface { - Handle(GetBulkAssignmentDataParams) middleware.Responder -} - -// NewGetBulkAssignmentData creates a new http.Handler for the get bulk assignment data operation -func NewGetBulkAssignmentData(ctx *middleware.Context, handler GetBulkAssignmentDataHandler) *GetBulkAssignmentData { - return &GetBulkAssignmentData{Context: ctx, Handler: handler} -} - -/* - GetBulkAssignmentData swagger:route GET /queues/bulk-assignment queues getBulkAssignmentData - -# Gets data for bulk assignment modal - -Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned -*/ -type GetBulkAssignmentData struct { - Context *middleware.Context - Handler GetBulkAssignmentDataHandler -} - -func (o *GetBulkAssignmentData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetBulkAssignmentDataParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go deleted file mode 100644 index 84675ac3ec4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetBulkAssignmentDataParams creates a new GetBulkAssignmentDataParams object -// -// There are no default values defined in the spec. -func NewGetBulkAssignmentDataParams() GetBulkAssignmentDataParams { - - return GetBulkAssignmentDataParams{} -} - -// GetBulkAssignmentDataParams contains all the bound params for the get bulk assignment data operation -// typically these are obtained from a http.Request -// -// swagger:parameters getBulkAssignmentData -type GetBulkAssignmentDataParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*A string corresponding to the queue type - In: query - */ - QueueType *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetBulkAssignmentDataParams() beforehand. -func (o *GetBulkAssignmentDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qQueueType, qhkQueueType, _ := qs.GetOK("queueType") - if err := o.bindQueueType(qQueueType, qhkQueueType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindQueueType binds and validates parameter QueueType from query. -func (o *GetBulkAssignmentDataParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.QueueType = &raw - - if err := o.validateQueueType(formats); err != nil { - return err - } - - return nil -} - -// validateQueueType carries on validations for parameter QueueType -func (o *GetBulkAssignmentDataParams) validateQueueType(formats strfmt.Registry) error { - - if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER", "PAYMENT_REQUEST"}, true); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go deleted file mode 100644 index 7aff474a411..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetBulkAssignmentDataOKCode is the HTTP code returned for type GetBulkAssignmentDataOK -const GetBulkAssignmentDataOKCode int = 200 - -/* -GetBulkAssignmentDataOK Successfully returned bulk assignment data - -swagger:response getBulkAssignmentDataOK -*/ -type GetBulkAssignmentDataOK struct { - - /* - In: Body - */ - Payload *ghcmessages.BulkAssignmentData `json:"body,omitempty"` -} - -// NewGetBulkAssignmentDataOK creates GetBulkAssignmentDataOK with default headers values -func NewGetBulkAssignmentDataOK() *GetBulkAssignmentDataOK { - - return &GetBulkAssignmentDataOK{} -} - -// WithPayload adds the payload to the get bulk assignment data o k response -func (o *GetBulkAssignmentDataOK) WithPayload(payload *ghcmessages.BulkAssignmentData) *GetBulkAssignmentDataOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment data o k response -func (o *GetBulkAssignmentDataOK) SetPayload(payload *ghcmessages.BulkAssignmentData) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentDataUnauthorizedCode is the HTTP code returned for type GetBulkAssignmentDataUnauthorized -const GetBulkAssignmentDataUnauthorizedCode int = 401 - -/* -GetBulkAssignmentDataUnauthorized The request was denied - -swagger:response getBulkAssignmentDataUnauthorized -*/ -type GetBulkAssignmentDataUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentDataUnauthorized creates GetBulkAssignmentDataUnauthorized with default headers values -func NewGetBulkAssignmentDataUnauthorized() *GetBulkAssignmentDataUnauthorized { - - return &GetBulkAssignmentDataUnauthorized{} -} - -// WithPayload adds the payload to the get bulk assignment data unauthorized response -func (o *GetBulkAssignmentDataUnauthorized) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment data unauthorized response -func (o *GetBulkAssignmentDataUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentDataNotFoundCode is the HTTP code returned for type GetBulkAssignmentDataNotFound -const GetBulkAssignmentDataNotFoundCode int = 404 - -/* -GetBulkAssignmentDataNotFound The requested resource wasn't found - -swagger:response getBulkAssignmentDataNotFound -*/ -type GetBulkAssignmentDataNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentDataNotFound creates GetBulkAssignmentDataNotFound with default headers values -func NewGetBulkAssignmentDataNotFound() *GetBulkAssignmentDataNotFound { - - return &GetBulkAssignmentDataNotFound{} -} - -// WithPayload adds the payload to the get bulk assignment data not found response -func (o *GetBulkAssignmentDataNotFound) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment data not found response -func (o *GetBulkAssignmentDataNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentDataNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentDataInternalServerErrorCode is the HTTP code returned for type GetBulkAssignmentDataInternalServerError -const GetBulkAssignmentDataInternalServerErrorCode int = 500 - -/* -GetBulkAssignmentDataInternalServerError A server error occurred - -swagger:response getBulkAssignmentDataInternalServerError -*/ -type GetBulkAssignmentDataInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentDataInternalServerError creates GetBulkAssignmentDataInternalServerError with default headers values -func NewGetBulkAssignmentDataInternalServerError() *GetBulkAssignmentDataInternalServerError { - - return &GetBulkAssignmentDataInternalServerError{} -} - -// WithPayload adds the payload to the get bulk assignment data internal server error response -func (o *GetBulkAssignmentDataInternalServerError) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment data internal server error response -func (o *GetBulkAssignmentDataInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go deleted file mode 100644 index eda687319c9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetBulkAssignmentDataURL generates an URL for the get bulk assignment data operation -type GetBulkAssignmentDataURL struct { - QueueType *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetBulkAssignmentDataURL) WithBasePath(bp string) *GetBulkAssignmentDataURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetBulkAssignmentDataURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetBulkAssignmentDataURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/bulk-assignment" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var queueTypeQ string - if o.QueueType != nil { - queueTypeQ = *o.QueueType - } - if queueTypeQ != "" { - qs.Set("queueType", queueTypeQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetBulkAssignmentDataURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetBulkAssignmentDataURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetBulkAssignmentDataURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetBulkAssignmentDataURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetBulkAssignmentDataURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetBulkAssignmentDataURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go deleted file mode 100644 index 2683d984fed..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMovesQueueHandlerFunc turns a function with the right signature into a get moves queue handler -type GetMovesQueueHandlerFunc func(GetMovesQueueParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMovesQueueHandlerFunc) Handle(params GetMovesQueueParams) middleware.Responder { - return fn(params) -} - -// GetMovesQueueHandler interface for that can handle valid get moves queue params -type GetMovesQueueHandler interface { - Handle(GetMovesQueueParams) middleware.Responder -} - -// NewGetMovesQueue creates a new http.Handler for the get moves queue operation -func NewGetMovesQueue(ctx *middleware.Context, handler GetMovesQueueHandler) *GetMovesQueue { - return &GetMovesQueue{Context: ctx, Handler: handler} -} - -/* - GetMovesQueue swagger:route GET /queues/moves queues getMovesQueue - -# Gets queued list of all customer moves by GBLOC origin - -An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve. -*/ -type GetMovesQueue struct { - Context *middleware.Context - Handler GetMovesQueueHandler -} - -func (o *GetMovesQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMovesQueueParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go deleted file mode 100644 index f1cfe32cfae..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go +++ /dev/null @@ -1,644 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetMovesQueueParams creates a new GetMovesQueueParams object -// -// There are no default values defined in the spec. -func NewGetMovesQueueParams() GetMovesQueueParams { - - return GetMovesQueueParams{} -} - -// GetMovesQueueParams contains all the bound params for the get moves queue operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMovesQueue -type GetMovesQueueParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - AppearedInTooAt *strfmt.DateTime - /*Used to illustrate which user is assigned to this move. - - In: query - */ - AssignedTo *string - /* - In: query - */ - Branch *string - /*filters using a counselingOffice name of the move - In: query - */ - CounselingOffice *string - /* - In: query - */ - CustomerName *string - /* - In: query - */ - DestinationDutyLocation *string - /* - In: query - */ - Edipi *string - /* - In: query - */ - Emplid *string - /* - In: query - */ - Locator *string - /*direction of sort order if applied - In: query - */ - Order *string - /*order type - In: query - */ - OrderType *string - /* - Unique: true - In: query - Collection Format: multi - */ - OriginDutyLocation []string - /*requested page of results - In: query - */ - Page *int64 - /*results per page - In: query - */ - PerPage *int64 - /*filters the requested pickup date of a shipment on the move - In: query - */ - RequestedMoveDate *string - /*field that results should be sorted by - In: query - */ - Sort *string - /*Filtering for the status. - Unique: true - In: query - */ - Status []string - /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. - - In: query - */ - ViewAsGBLOC *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMovesQueueParams() beforehand. -func (o *GetMovesQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qAppearedInTooAt, qhkAppearedInTooAt, _ := qs.GetOK("appearedInTooAt") - if err := o.bindAppearedInTooAt(qAppearedInTooAt, qhkAppearedInTooAt, route.Formats); err != nil { - res = append(res, err) - } - - qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") - if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { - res = append(res, err) - } - - qBranch, qhkBranch, _ := qs.GetOK("branch") - if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { - res = append(res, err) - } - - qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") - if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { - res = append(res, err) - } - - qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") - if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { - res = append(res, err) - } - - qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") - if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qEdipi, qhkEdipi, _ := qs.GetOK("edipi") - if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { - res = append(res, err) - } - - qEmplid, qhkEmplid, _ := qs.GetOK("emplid") - if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { - res = append(res, err) - } - - qLocator, qhkLocator, _ := qs.GetOK("locator") - if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qOrderType, qhkOrderType, _ := qs.GetOK("orderType") - if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { - res = append(res, err) - } - - qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") - if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qRequestedMoveDate, qhkRequestedMoveDate, _ := qs.GetOK("requestedMoveDate") - if err := o.bindRequestedMoveDate(qRequestedMoveDate, qhkRequestedMoveDate, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - - qStatus, qhkStatus, _ := qs.GetOK("status") - if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { - res = append(res, err) - } - - qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") - if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAppearedInTooAt binds and validates parameter AppearedInTooAt from query. -func (o *GetMovesQueueParams) bindAppearedInTooAt(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("appearedInTooAt", "query", "strfmt.DateTime", raw) - } - o.AppearedInTooAt = (value.(*strfmt.DateTime)) - - if err := o.validateAppearedInTooAt(formats); err != nil { - return err - } - - return nil -} - -// validateAppearedInTooAt carries on validations for parameter AppearedInTooAt -func (o *GetMovesQueueParams) validateAppearedInTooAt(formats strfmt.Registry) error { - - if err := validate.FormatOf("appearedInTooAt", "query", "date-time", o.AppearedInTooAt.String(), formats); err != nil { - return err - } - return nil -} - -// bindAssignedTo binds and validates parameter AssignedTo from query. -func (o *GetMovesQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.AssignedTo = &raw - - return nil -} - -// bindBranch binds and validates parameter Branch from query. -func (o *GetMovesQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Branch = &raw - - return nil -} - -// bindCounselingOffice binds and validates parameter CounselingOffice from query. -func (o *GetMovesQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CounselingOffice = &raw - - return nil -} - -// bindCustomerName binds and validates parameter CustomerName from query. -func (o *GetMovesQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CustomerName = &raw - - return nil -} - -// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. -func (o *GetMovesQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.DestinationDutyLocation = &raw - - return nil -} - -// bindEdipi binds and validates parameter Edipi from query. -func (o *GetMovesQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Edipi = &raw - - return nil -} - -// bindEmplid binds and validates parameter Emplid from query. -func (o *GetMovesQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Emplid = &raw - - return nil -} - -// bindLocator binds and validates parameter Locator from query. -func (o *GetMovesQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Locator = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *GetMovesQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Order = &raw - - if err := o.validateOrder(formats); err != nil { - return err - } - - return nil -} - -// validateOrder carries on validations for parameter Order -func (o *GetMovesQueueParams) validateOrder(formats strfmt.Registry) error { - - if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { - return err - } - - return nil -} - -// bindOrderType binds and validates parameter OrderType from query. -func (o *GetMovesQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OrderType = &raw - - return nil -} - -// bindOriginDutyLocation binds and validates array parameter OriginDutyLocation from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *GetMovesQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - originDutyLocationIC := rawData - if len(originDutyLocationIC) == 0 { - return nil - } - - var originDutyLocationIR []string - for _, originDutyLocationIV := range originDutyLocationIC { - originDutyLocationI := originDutyLocationIV - - originDutyLocationIR = append(originDutyLocationIR, originDutyLocationI) - } - - o.OriginDutyLocation = originDutyLocationIR - if err := o.validateOriginDutyLocation(formats); err != nil { - return err - } - - return nil -} - -// validateOriginDutyLocation carries on validations for parameter OriginDutyLocation -func (o *GetMovesQueueParams) validateOriginDutyLocation(formats strfmt.Registry) error { - - // uniqueItems: true - if err := validate.UniqueItems("originDutyLocation", "query", o.OriginDutyLocation); err != nil { - return err - } - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *GetMovesQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *GetMovesQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindRequestedMoveDate binds and validates parameter RequestedMoveDate from query. -func (o *GetMovesQueueParams) bindRequestedMoveDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RequestedMoveDate = &raw - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *GetMovesQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - if err := o.validateSort(formats); err != nil { - return err - } - - return nil -} - -// validateSort carries on validations for parameter Sort -func (o *GetMovesQueueParams) validateSort(formats strfmt.Registry) error { - - if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "edipi", "emplid", "branch", "locator", "status", "originDutyLocation", "destinationDutyLocation", "requestedMoveDate", "appearedInTooAt", "assignedTo", "counselingOffice"}, true); err != nil { - return err - } - - return nil -} - -// bindStatus binds and validates array parameter Status from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *GetMovesQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvStatus string - if len(rawData) > 0 { - qvStatus = rawData[len(rawData)-1] - } - - // CollectionFormat: - statusIC := swag.SplitByFormat(qvStatus, "") - if len(statusIC) == 0 { - return nil - } - - var statusIR []string - for i, statusIV := range statusIC { - statusI := statusIV - - if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"SUBMITTED", "SERVICE COUNSELING COMPLETED", "APPROVALS REQUESTED"}, true); err != nil { - return err - } - - statusIR = append(statusIR, statusI) - } - - o.Status = statusIR - if err := o.validateStatus(formats); err != nil { - return err - } - - return nil -} - -// validateStatus carries on validations for parameter Status -func (o *GetMovesQueueParams) validateStatus(formats strfmt.Registry) error { - - // uniqueItems: true - if err := validate.UniqueItems("status", "query", o.Status); err != nil { - return err - } - return nil -} - -// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. -func (o *GetMovesQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ViewAsGBLOC = &raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go deleted file mode 100644 index e74af3bb51e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetMovesQueueOKCode is the HTTP code returned for type GetMovesQueueOK -const GetMovesQueueOKCode int = 200 - -/* -GetMovesQueueOK Successfully returned all moves matching the criteria - -swagger:response getMovesQueueOK -*/ -type GetMovesQueueOK struct { - - /* - In: Body - */ - Payload *ghcmessages.QueueMovesResult `json:"body,omitempty"` -} - -// NewGetMovesQueueOK creates GetMovesQueueOK with default headers values -func NewGetMovesQueueOK() *GetMovesQueueOK { - - return &GetMovesQueueOK{} -} - -// WithPayload adds the payload to the get moves queue o k response -func (o *GetMovesQueueOK) WithPayload(payload *ghcmessages.QueueMovesResult) *GetMovesQueueOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get moves queue o k response -func (o *GetMovesQueueOK) SetPayload(payload *ghcmessages.QueueMovesResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMovesQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMovesQueueForbiddenCode is the HTTP code returned for type GetMovesQueueForbidden -const GetMovesQueueForbiddenCode int = 403 - -/* -GetMovesQueueForbidden The request was denied - -swagger:response getMovesQueueForbidden -*/ -type GetMovesQueueForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMovesQueueForbidden creates GetMovesQueueForbidden with default headers values -func NewGetMovesQueueForbidden() *GetMovesQueueForbidden { - - return &GetMovesQueueForbidden{} -} - -// WithPayload adds the payload to the get moves queue forbidden response -func (o *GetMovesQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetMovesQueueForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get moves queue forbidden response -func (o *GetMovesQueueForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMovesQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMovesQueueInternalServerErrorCode is the HTTP code returned for type GetMovesQueueInternalServerError -const GetMovesQueueInternalServerErrorCode int = 500 - -/* -GetMovesQueueInternalServerError A server error occurred - -swagger:response getMovesQueueInternalServerError -*/ -type GetMovesQueueInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetMovesQueueInternalServerError creates GetMovesQueueInternalServerError with default headers values -func NewGetMovesQueueInternalServerError() *GetMovesQueueInternalServerError { - - return &GetMovesQueueInternalServerError{} -} - -// WithPayload adds the payload to the get moves queue internal server error response -func (o *GetMovesQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMovesQueueInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get moves queue internal server error response -func (o *GetMovesQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMovesQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go deleted file mode 100644 index ec05a50a3eb..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetMovesQueueURL generates an URL for the get moves queue operation -type GetMovesQueueURL struct { - AppearedInTooAt *strfmt.DateTime - AssignedTo *string - Branch *string - CounselingOffice *string - CustomerName *string - DestinationDutyLocation *string - Edipi *string - Emplid *string - Locator *string - Order *string - OrderType *string - OriginDutyLocation []string - Page *int64 - PerPage *int64 - RequestedMoveDate *string - Sort *string - Status []string - ViewAsGBLOC *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMovesQueueURL) WithBasePath(bp string) *GetMovesQueueURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMovesQueueURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMovesQueueURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/moves" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var appearedInTooAtQ string - if o.AppearedInTooAt != nil { - appearedInTooAtQ = o.AppearedInTooAt.String() - } - if appearedInTooAtQ != "" { - qs.Set("appearedInTooAt", appearedInTooAtQ) - } - - var assignedToQ string - if o.AssignedTo != nil { - assignedToQ = *o.AssignedTo - } - if assignedToQ != "" { - qs.Set("assignedTo", assignedToQ) - } - - var branchQ string - if o.Branch != nil { - branchQ = *o.Branch - } - if branchQ != "" { - qs.Set("branch", branchQ) - } - - var counselingOfficeQ string - if o.CounselingOffice != nil { - counselingOfficeQ = *o.CounselingOffice - } - if counselingOfficeQ != "" { - qs.Set("counselingOffice", counselingOfficeQ) - } - - var customerNameQ string - if o.CustomerName != nil { - customerNameQ = *o.CustomerName - } - if customerNameQ != "" { - qs.Set("customerName", customerNameQ) - } - - var destinationDutyLocationQ string - if o.DestinationDutyLocation != nil { - destinationDutyLocationQ = *o.DestinationDutyLocation - } - if destinationDutyLocationQ != "" { - qs.Set("destinationDutyLocation", destinationDutyLocationQ) - } - - var edipiQ string - if o.Edipi != nil { - edipiQ = *o.Edipi - } - if edipiQ != "" { - qs.Set("edipi", edipiQ) - } - - var emplidQ string - if o.Emplid != nil { - emplidQ = *o.Emplid - } - if emplidQ != "" { - qs.Set("emplid", emplidQ) - } - - var locatorQ string - if o.Locator != nil { - locatorQ = *o.Locator - } - if locatorQ != "" { - qs.Set("locator", locatorQ) - } - - var orderQ string - if o.Order != nil { - orderQ = *o.Order - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var orderTypeQ string - if o.OrderType != nil { - orderTypeQ = *o.OrderType - } - if orderTypeQ != "" { - qs.Set("orderType", orderTypeQ) - } - - var originDutyLocationIR []string - for _, originDutyLocationI := range o.OriginDutyLocation { - originDutyLocationIS := originDutyLocationI - if originDutyLocationIS != "" { - originDutyLocationIR = append(originDutyLocationIR, originDutyLocationIS) - } - } - - originDutyLocation := swag.JoinByFormat(originDutyLocationIR, "multi") - - for _, qsv := range originDutyLocation { - qs.Add("originDutyLocation", qsv) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var requestedMoveDateQ string - if o.RequestedMoveDate != nil { - requestedMoveDateQ = *o.RequestedMoveDate - } - if requestedMoveDateQ != "" { - qs.Set("requestedMoveDate", requestedMoveDateQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - var statusIR []string - for _, statusI := range o.Status { - statusIS := statusI - if statusIS != "" { - statusIR = append(statusIR, statusIS) - } - } - - status := swag.JoinByFormat(statusIR, "") - - if len(status) > 0 { - qsv := status[0] - if qsv != "" { - qs.Set("status", qsv) - } - } - - var viewAsGBLOCQ string - if o.ViewAsGBLOC != nil { - viewAsGBLOCQ = *o.ViewAsGBLOC - } - if viewAsGBLOCQ != "" { - qs.Set("viewAsGBLOC", viewAsGBLOCQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMovesQueueURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMovesQueueURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMovesQueueURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMovesQueueURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMovesQueueURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMovesQueueURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go deleted file mode 100644 index 9c6f9dac17c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPaymentRequestsQueueHandlerFunc turns a function with the right signature into a get payment requests queue handler -type GetPaymentRequestsQueueHandlerFunc func(GetPaymentRequestsQueueParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPaymentRequestsQueueHandlerFunc) Handle(params GetPaymentRequestsQueueParams) middleware.Responder { - return fn(params) -} - -// GetPaymentRequestsQueueHandler interface for that can handle valid get payment requests queue params -type GetPaymentRequestsQueueHandler interface { - Handle(GetPaymentRequestsQueueParams) middleware.Responder -} - -// NewGetPaymentRequestsQueue creates a new http.Handler for the get payment requests queue operation -func NewGetPaymentRequestsQueue(ctx *middleware.Context, handler GetPaymentRequestsQueueHandler) *GetPaymentRequestsQueue { - return &GetPaymentRequestsQueue{Context: ctx, Handler: handler} -} - -/* - GetPaymentRequestsQueue swagger:route GET /queues/payment-requests queues getPaymentRequestsQueue - -# Gets queued list of all payment requests by GBLOC origin - -An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location. -*/ -type GetPaymentRequestsQueue struct { - Context *middleware.Context - Handler GetPaymentRequestsQueueHandler -} - -func (o *GetPaymentRequestsQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPaymentRequestsQueueParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go deleted file mode 100644 index fe0d201031e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go +++ /dev/null @@ -1,598 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetPaymentRequestsQueueParams creates a new GetPaymentRequestsQueueParams object -// -// There are no default values defined in the spec. -func NewGetPaymentRequestsQueueParams() GetPaymentRequestsQueueParams { - - return GetPaymentRequestsQueueParams{} -} - -// GetPaymentRequestsQueueParams contains all the bound params for the get payment requests queue operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPaymentRequestsQueue -type GetPaymentRequestsQueueParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Used to illustrate which user is assigned to this payment request. - - In: query - */ - AssignedTo *string - /* - In: query - */ - Branch *string - /*filters using a counselingOffice name of the move - In: query - */ - CounselingOffice *string - /* - In: query - */ - CustomerName *string - /* - In: query - */ - DestinationDutyLocation *string - /* - In: query - */ - Edipi *string - /* - In: query - */ - Emplid *string - /* - In: query - */ - Locator *string - /*direction of sort order if applied - In: query - */ - Order *string - /*order type - In: query - */ - OrderType *string - /* - In: query - */ - OriginDutyLocation *string - /*requested page of results - In: query - */ - Page *int64 - /*number of records to include per page - In: query - */ - PerPage *int64 - /*field that results should be sorted by - In: query - */ - Sort *string - /*Filtering for the status. - Unique: true - In: query - */ - Status []string - /*Start of the submitted at date in the user's local time zone converted to UTC - In: query - */ - SubmittedAt *strfmt.DateTime - /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. - - In: query - */ - ViewAsGBLOC *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPaymentRequestsQueueParams() beforehand. -func (o *GetPaymentRequestsQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") - if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { - res = append(res, err) - } - - qBranch, qhkBranch, _ := qs.GetOK("branch") - if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { - res = append(res, err) - } - - qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") - if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { - res = append(res, err) - } - - qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") - if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { - res = append(res, err) - } - - qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") - if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qEdipi, qhkEdipi, _ := qs.GetOK("edipi") - if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { - res = append(res, err) - } - - qEmplid, qhkEmplid, _ := qs.GetOK("emplid") - if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { - res = append(res, err) - } - - qLocator, qhkLocator, _ := qs.GetOK("locator") - if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qOrderType, qhkOrderType, _ := qs.GetOK("orderType") - if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { - res = append(res, err) - } - - qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") - if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - - qStatus, qhkStatus, _ := qs.GetOK("status") - if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { - res = append(res, err) - } - - qSubmittedAt, qhkSubmittedAt, _ := qs.GetOK("submittedAt") - if err := o.bindSubmittedAt(qSubmittedAt, qhkSubmittedAt, route.Formats); err != nil { - res = append(res, err) - } - - qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") - if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAssignedTo binds and validates parameter AssignedTo from query. -func (o *GetPaymentRequestsQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.AssignedTo = &raw - - return nil -} - -// bindBranch binds and validates parameter Branch from query. -func (o *GetPaymentRequestsQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Branch = &raw - - return nil -} - -// bindCounselingOffice binds and validates parameter CounselingOffice from query. -func (o *GetPaymentRequestsQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CounselingOffice = &raw - - return nil -} - -// bindCustomerName binds and validates parameter CustomerName from query. -func (o *GetPaymentRequestsQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CustomerName = &raw - - return nil -} - -// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. -func (o *GetPaymentRequestsQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.DestinationDutyLocation = &raw - - return nil -} - -// bindEdipi binds and validates parameter Edipi from query. -func (o *GetPaymentRequestsQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Edipi = &raw - - return nil -} - -// bindEmplid binds and validates parameter Emplid from query. -func (o *GetPaymentRequestsQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Emplid = &raw - - return nil -} - -// bindLocator binds and validates parameter Locator from query. -func (o *GetPaymentRequestsQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Locator = &raw - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *GetPaymentRequestsQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Order = &raw - - if err := o.validateOrder(formats); err != nil { - return err - } - - return nil -} - -// validateOrder carries on validations for parameter Order -func (o *GetPaymentRequestsQueueParams) validateOrder(formats strfmt.Registry) error { - - if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { - return err - } - - return nil -} - -// bindOrderType binds and validates parameter OrderType from query. -func (o *GetPaymentRequestsQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OrderType = &raw - - return nil -} - -// bindOriginDutyLocation binds and validates parameter OriginDutyLocation from query. -func (o *GetPaymentRequestsQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OriginDutyLocation = &raw - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *GetPaymentRequestsQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *GetPaymentRequestsQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *GetPaymentRequestsQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - if err := o.validateSort(formats); err != nil { - return err - } - - return nil -} - -// validateSort carries on validations for parameter Sort -func (o *GetPaymentRequestsQueueParams) validateSort(formats strfmt.Registry) error { - - if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "locator", "submittedAt", "branch", "status", "edipi", "emplid", "age", "originDutyLocation", "assignedTo", "counselingOffice"}, true); err != nil { - return err - } - - return nil -} - -// bindStatus binds and validates array parameter Status from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *GetPaymentRequestsQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvStatus string - if len(rawData) > 0 { - qvStatus = rawData[len(rawData)-1] - } - - // CollectionFormat: - statusIC := swag.SplitByFormat(qvStatus, "") - if len(statusIC) == 0 { - return nil - } - - var statusIR []string - for i, statusIV := range statusIC { - statusI := statusIV - - if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"PENDING", "REVIEWED", "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", "PAID", "DEPRECATED", "EDI_ERROR"}, true); err != nil { - return err - } - - statusIR = append(statusIR, statusI) - } - - o.Status = statusIR - if err := o.validateStatus(formats); err != nil { - return err - } - - return nil -} - -// validateStatus carries on validations for parameter Status -func (o *GetPaymentRequestsQueueParams) validateStatus(formats strfmt.Registry) error { - - // uniqueItems: true - if err := validate.UniqueItems("status", "query", o.Status); err != nil { - return err - } - return nil -} - -// bindSubmittedAt binds and validates parameter SubmittedAt from query. -func (o *GetPaymentRequestsQueueParams) bindSubmittedAt(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("submittedAt", "query", "strfmt.DateTime", raw) - } - o.SubmittedAt = (value.(*strfmt.DateTime)) - - if err := o.validateSubmittedAt(formats); err != nil { - return err - } - - return nil -} - -// validateSubmittedAt carries on validations for parameter SubmittedAt -func (o *GetPaymentRequestsQueueParams) validateSubmittedAt(formats strfmt.Registry) error { - - if err := validate.FormatOf("submittedAt", "query", "date-time", o.SubmittedAt.String(), formats); err != nil { - return err - } - return nil -} - -// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. -func (o *GetPaymentRequestsQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ViewAsGBLOC = &raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go deleted file mode 100644 index 791e2f29378..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetPaymentRequestsQueueOKCode is the HTTP code returned for type GetPaymentRequestsQueueOK -const GetPaymentRequestsQueueOKCode int = 200 - -/* -GetPaymentRequestsQueueOK Successfully returned all moves matching the criteria - -swagger:response getPaymentRequestsQueueOK -*/ -type GetPaymentRequestsQueueOK struct { - - /* - In: Body - */ - Payload *ghcmessages.QueuePaymentRequestsResult `json:"body,omitempty"` -} - -// NewGetPaymentRequestsQueueOK creates GetPaymentRequestsQueueOK with default headers values -func NewGetPaymentRequestsQueueOK() *GetPaymentRequestsQueueOK { - - return &GetPaymentRequestsQueueOK{} -} - -// WithPayload adds the payload to the get payment requests queue o k response -func (o *GetPaymentRequestsQueueOK) WithPayload(payload *ghcmessages.QueuePaymentRequestsResult) *GetPaymentRequestsQueueOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests queue o k response -func (o *GetPaymentRequestsQueueOK) SetPayload(payload *ghcmessages.QueuePaymentRequestsResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestsQueueForbiddenCode is the HTTP code returned for type GetPaymentRequestsQueueForbidden -const GetPaymentRequestsQueueForbiddenCode int = 403 - -/* -GetPaymentRequestsQueueForbidden The request was denied - -swagger:response getPaymentRequestsQueueForbidden -*/ -type GetPaymentRequestsQueueForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestsQueueForbidden creates GetPaymentRequestsQueueForbidden with default headers values -func NewGetPaymentRequestsQueueForbidden() *GetPaymentRequestsQueueForbidden { - - return &GetPaymentRequestsQueueForbidden{} -} - -// WithPayload adds the payload to the get payment requests queue forbidden response -func (o *GetPaymentRequestsQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsQueueForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests queue forbidden response -func (o *GetPaymentRequestsQueueForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestsQueueInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestsQueueInternalServerError -const GetPaymentRequestsQueueInternalServerErrorCode int = 500 - -/* -GetPaymentRequestsQueueInternalServerError A server error occurred - -swagger:response getPaymentRequestsQueueInternalServerError -*/ -type GetPaymentRequestsQueueInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestsQueueInternalServerError creates GetPaymentRequestsQueueInternalServerError with default headers values -func NewGetPaymentRequestsQueueInternalServerError() *GetPaymentRequestsQueueInternalServerError { - - return &GetPaymentRequestsQueueInternalServerError{} -} - -// WithPayload adds the payload to the get payment requests queue internal server error response -func (o *GetPaymentRequestsQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsQueueInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment requests queue internal server error response -func (o *GetPaymentRequestsQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestsQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go deleted file mode 100644 index 1b5aa0e8b3b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go +++ /dev/null @@ -1,259 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetPaymentRequestsQueueURL generates an URL for the get payment requests queue operation -type GetPaymentRequestsQueueURL struct { - AssignedTo *string - Branch *string - CounselingOffice *string - CustomerName *string - DestinationDutyLocation *string - Edipi *string - Emplid *string - Locator *string - Order *string - OrderType *string - OriginDutyLocation *string - Page *int64 - PerPage *int64 - Sort *string - Status []string - SubmittedAt *strfmt.DateTime - ViewAsGBLOC *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestsQueueURL) WithBasePath(bp string) *GetPaymentRequestsQueueURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestsQueueURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPaymentRequestsQueueURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/payment-requests" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var assignedToQ string - if o.AssignedTo != nil { - assignedToQ = *o.AssignedTo - } - if assignedToQ != "" { - qs.Set("assignedTo", assignedToQ) - } - - var branchQ string - if o.Branch != nil { - branchQ = *o.Branch - } - if branchQ != "" { - qs.Set("branch", branchQ) - } - - var counselingOfficeQ string - if o.CounselingOffice != nil { - counselingOfficeQ = *o.CounselingOffice - } - if counselingOfficeQ != "" { - qs.Set("counselingOffice", counselingOfficeQ) - } - - var customerNameQ string - if o.CustomerName != nil { - customerNameQ = *o.CustomerName - } - if customerNameQ != "" { - qs.Set("customerName", customerNameQ) - } - - var destinationDutyLocationQ string - if o.DestinationDutyLocation != nil { - destinationDutyLocationQ = *o.DestinationDutyLocation - } - if destinationDutyLocationQ != "" { - qs.Set("destinationDutyLocation", destinationDutyLocationQ) - } - - var edipiQ string - if o.Edipi != nil { - edipiQ = *o.Edipi - } - if edipiQ != "" { - qs.Set("edipi", edipiQ) - } - - var emplidQ string - if o.Emplid != nil { - emplidQ = *o.Emplid - } - if emplidQ != "" { - qs.Set("emplid", emplidQ) - } - - var locatorQ string - if o.Locator != nil { - locatorQ = *o.Locator - } - if locatorQ != "" { - qs.Set("locator", locatorQ) - } - - var orderQ string - if o.Order != nil { - orderQ = *o.Order - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var orderTypeQ string - if o.OrderType != nil { - orderTypeQ = *o.OrderType - } - if orderTypeQ != "" { - qs.Set("orderType", orderTypeQ) - } - - var originDutyLocationQ string - if o.OriginDutyLocation != nil { - originDutyLocationQ = *o.OriginDutyLocation - } - if originDutyLocationQ != "" { - qs.Set("originDutyLocation", originDutyLocationQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - var statusIR []string - for _, statusI := range o.Status { - statusIS := statusI - if statusIS != "" { - statusIR = append(statusIR, statusIS) - } - } - - status := swag.JoinByFormat(statusIR, "") - - if len(status) > 0 { - qsv := status[0] - if qsv != "" { - qs.Set("status", qsv) - } - } - - var submittedAtQ string - if o.SubmittedAt != nil { - submittedAtQ = o.SubmittedAt.String() - } - if submittedAtQ != "" { - qs.Set("submittedAt", submittedAtQ) - } - - var viewAsGBLOCQ string - if o.ViewAsGBLOC != nil { - viewAsGBLOCQ = *o.ViewAsGBLOC - } - if viewAsGBLOCQ != "" { - qs.Set("viewAsGBLOC", viewAsGBLOCQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPaymentRequestsQueueURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPaymentRequestsQueueURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPaymentRequestsQueueURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPaymentRequestsQueueURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPaymentRequestsQueueURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPaymentRequestsQueueURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go deleted file mode 100644 index 7cdd86ead69..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetServicesCounselingOriginListHandlerFunc turns a function with the right signature into a get services counseling origin list handler -type GetServicesCounselingOriginListHandlerFunc func(GetServicesCounselingOriginListParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetServicesCounselingOriginListHandlerFunc) Handle(params GetServicesCounselingOriginListParams) middleware.Responder { - return fn(params) -} - -// GetServicesCounselingOriginListHandler interface for that can handle valid get services counseling origin list params -type GetServicesCounselingOriginListHandler interface { - Handle(GetServicesCounselingOriginListParams) middleware.Responder -} - -// NewGetServicesCounselingOriginList creates a new http.Handler for the get services counseling origin list operation -func NewGetServicesCounselingOriginList(ctx *middleware.Context, handler GetServicesCounselingOriginListHandler) *GetServicesCounselingOriginList { - return &GetServicesCounselingOriginList{Context: ctx, Handler: handler} -} - -/* - GetServicesCounselingOriginList swagger:route GET /queues/counseling/origin-list queues getServicesCounselingOriginList - -# Gets queued list of all moves origin locations in the counselors queue - -An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations. -*/ -type GetServicesCounselingOriginList struct { - Context *middleware.Context - Handler GetServicesCounselingOriginListHandler -} - -func (o *GetServicesCounselingOriginList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetServicesCounselingOriginListParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go deleted file mode 100644 index df70ba4cbab..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewGetServicesCounselingOriginListParams creates a new GetServicesCounselingOriginListParams object -// -// There are no default values defined in the spec. -func NewGetServicesCounselingOriginListParams() GetServicesCounselingOriginListParams { - - return GetServicesCounselingOriginListParams{} -} - -// GetServicesCounselingOriginListParams contains all the bound params for the get services counseling origin list operation -// typically these are obtained from a http.Request -// -// swagger:parameters getServicesCounselingOriginList -type GetServicesCounselingOriginListParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations. - In: query - */ - NeedsPPMCloseout *bool - /*Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. - In: query - */ - ViewAsGBLOC *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetServicesCounselingOriginListParams() beforehand. -func (o *GetServicesCounselingOriginListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qNeedsPPMCloseout, qhkNeedsPPMCloseout, _ := qs.GetOK("needsPPMCloseout") - if err := o.bindNeedsPPMCloseout(qNeedsPPMCloseout, qhkNeedsPPMCloseout, route.Formats); err != nil { - res = append(res, err) - } - - qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") - if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindNeedsPPMCloseout binds and validates parameter NeedsPPMCloseout from query. -func (o *GetServicesCounselingOriginListParams) bindNeedsPPMCloseout(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("needsPPMCloseout", "query", "bool", raw) - } - o.NeedsPPMCloseout = &value - - return nil -} - -// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. -func (o *GetServicesCounselingOriginListParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ViewAsGBLOC = &raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go deleted file mode 100644 index d4c1355b782..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetServicesCounselingOriginListOKCode is the HTTP code returned for type GetServicesCounselingOriginListOK -const GetServicesCounselingOriginListOKCode int = 200 - -/* -GetServicesCounselingOriginListOK Successfully returned all moves matching the criteria - -swagger:response getServicesCounselingOriginListOK -*/ -type GetServicesCounselingOriginListOK struct { - - /* - In: Body - */ - Payload ghcmessages.Locations `json:"body,omitempty"` -} - -// NewGetServicesCounselingOriginListOK creates GetServicesCounselingOriginListOK with default headers values -func NewGetServicesCounselingOriginListOK() *GetServicesCounselingOriginListOK { - - return &GetServicesCounselingOriginListOK{} -} - -// WithPayload adds the payload to the get services counseling origin list o k response -func (o *GetServicesCounselingOriginListOK) WithPayload(payload ghcmessages.Locations) *GetServicesCounselingOriginListOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling origin list o k response -func (o *GetServicesCounselingOriginListOK) SetPayload(payload ghcmessages.Locations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingOriginListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.Locations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetServicesCounselingOriginListForbiddenCode is the HTTP code returned for type GetServicesCounselingOriginListForbidden -const GetServicesCounselingOriginListForbiddenCode int = 403 - -/* -GetServicesCounselingOriginListForbidden The request was denied - -swagger:response getServicesCounselingOriginListForbidden -*/ -type GetServicesCounselingOriginListForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetServicesCounselingOriginListForbidden creates GetServicesCounselingOriginListForbidden with default headers values -func NewGetServicesCounselingOriginListForbidden() *GetServicesCounselingOriginListForbidden { - - return &GetServicesCounselingOriginListForbidden{} -} - -// WithPayload adds the payload to the get services counseling origin list forbidden response -func (o *GetServicesCounselingOriginListForbidden) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingOriginListForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling origin list forbidden response -func (o *GetServicesCounselingOriginListForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingOriginListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetServicesCounselingOriginListInternalServerErrorCode is the HTTP code returned for type GetServicesCounselingOriginListInternalServerError -const GetServicesCounselingOriginListInternalServerErrorCode int = 500 - -/* -GetServicesCounselingOriginListInternalServerError A server error occurred - -swagger:response getServicesCounselingOriginListInternalServerError -*/ -type GetServicesCounselingOriginListInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetServicesCounselingOriginListInternalServerError creates GetServicesCounselingOriginListInternalServerError with default headers values -func NewGetServicesCounselingOriginListInternalServerError() *GetServicesCounselingOriginListInternalServerError { - - return &GetServicesCounselingOriginListInternalServerError{} -} - -// WithPayload adds the payload to the get services counseling origin list internal server error response -func (o *GetServicesCounselingOriginListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingOriginListInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling origin list internal server error response -func (o *GetServicesCounselingOriginListInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingOriginListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go deleted file mode 100644 index adc6d175249..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go +++ /dev/null @@ -1,114 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// GetServicesCounselingOriginListURL generates an URL for the get services counseling origin list operation -type GetServicesCounselingOriginListURL struct { - NeedsPPMCloseout *bool - ViewAsGBLOC *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetServicesCounselingOriginListURL) WithBasePath(bp string) *GetServicesCounselingOriginListURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetServicesCounselingOriginListURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetServicesCounselingOriginListURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/counseling/origin-list" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var needsPPMCloseoutQ string - if o.NeedsPPMCloseout != nil { - needsPPMCloseoutQ = swag.FormatBool(*o.NeedsPPMCloseout) - } - if needsPPMCloseoutQ != "" { - qs.Set("needsPPMCloseout", needsPPMCloseoutQ) - } - - var viewAsGBLOCQ string - if o.ViewAsGBLOC != nil { - viewAsGBLOCQ = *o.ViewAsGBLOC - } - if viewAsGBLOCQ != "" { - qs.Set("viewAsGBLOC", viewAsGBLOCQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetServicesCounselingOriginListURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetServicesCounselingOriginListURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetServicesCounselingOriginListURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetServicesCounselingOriginListURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetServicesCounselingOriginListURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetServicesCounselingOriginListURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go deleted file mode 100644 index ef38cfda721..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetServicesCounselingQueueHandlerFunc turns a function with the right signature into a get services counseling queue handler -type GetServicesCounselingQueueHandlerFunc func(GetServicesCounselingQueueParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetServicesCounselingQueueHandlerFunc) Handle(params GetServicesCounselingQueueParams) middleware.Responder { - return fn(params) -} - -// GetServicesCounselingQueueHandler interface for that can handle valid get services counseling queue params -type GetServicesCounselingQueueHandler interface { - Handle(GetServicesCounselingQueueParams) middleware.Responder -} - -// NewGetServicesCounselingQueue creates a new http.Handler for the get services counseling queue operation -func NewGetServicesCounselingQueue(ctx *middleware.Context, handler GetServicesCounselingQueueHandler) *GetServicesCounselingQueue { - return &GetServicesCounselingQueue{Context: ctx, Handler: handler} -} - -/* - GetServicesCounselingQueue swagger:route GET /queues/counseling queues getServicesCounselingQueue - -# Gets queued list of all customer moves needing services counseling by GBLOC origin - -An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf. -*/ -type GetServicesCounselingQueue struct { - Context *middleware.Context - Handler GetServicesCounselingQueueHandler -} - -func (o *GetServicesCounselingQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetServicesCounselingQueueParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go deleted file mode 100644 index 2b03f53918f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go +++ /dev/null @@ -1,858 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewGetServicesCounselingQueueParams creates a new GetServicesCounselingQueueParams object -// -// There are no default values defined in the spec. -func NewGetServicesCounselingQueueParams() GetServicesCounselingQueueParams { - - return GetServicesCounselingQueueParams{} -} - -// GetServicesCounselingQueueParams contains all the bound params for the get services counseling queue operation -// typically these are obtained from a http.Request -// -// swagger:parameters getServicesCounselingQueue -type GetServicesCounselingQueueParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Used to illustrate which user is assigned to this payment request. - - In: query - */ - AssignedTo *string - /*filters by the branch of the move's service member - In: query - */ - Branch *string - /*Latest date that closeout was initiated on a PPM on the move - In: query - */ - CloseoutInitiated *strfmt.DateTime - /*closeout location - In: query - */ - CloseoutLocation *string - /*filters using a counselingOffice name of the move - In: query - */ - CounselingOffice *string - /*filters using a prefix match on the service member's last name - In: query - */ - CustomerName *string - /*filters the name of the destination duty location on the orders - In: query - */ - DestinationDutyLocation *string - /*filters to match the unique service member's DoD ID - In: query - */ - Edipi *string - /*filters to match the unique service member's EMPLID - In: query - */ - Emplid *string - /*filters to match the unique move code locator - In: query - */ - Locator *string - /*Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves. - In: query - */ - NeedsPPMCloseout *bool - /*direction of sort order if applied - In: query - */ - Order *string - /*order type - In: query - */ - OrderType *string - /*filters the name of the origin duty location on the orders - Unique: true - In: query - Collection Format: multi - */ - OriginDutyLocation []string - /*filters the GBLOC of the service member's origin duty location - In: query - */ - OriginGBLOC *string - /*requested page number of paginated move results - In: query - */ - Page *int64 - /*maximum number of moves to show on each page of paginated results - In: query - */ - PerPage *int64 - /*filters the status of the PPM shipment - In: query - */ - PpmStatus *string - /*filters PPM type - In: query - */ - PpmType *string - /*filters the requested pickup date of a shipment on the move - In: query - */ - RequestedMoveDate *string - /*field that results should be sorted by - In: query - */ - Sort *string - /*filters the status of the move - Unique: true - In: query - */ - Status []string - /*Start of the submitted at date in the user's local time zone converted to UTC - In: query - */ - SubmittedAt *strfmt.DateTime - /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. - - In: query - */ - ViewAsGBLOC *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetServicesCounselingQueueParams() beforehand. -func (o *GetServicesCounselingQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") - if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { - res = append(res, err) - } - - qBranch, qhkBranch, _ := qs.GetOK("branch") - if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { - res = append(res, err) - } - - qCloseoutInitiated, qhkCloseoutInitiated, _ := qs.GetOK("closeoutInitiated") - if err := o.bindCloseoutInitiated(qCloseoutInitiated, qhkCloseoutInitiated, route.Formats); err != nil { - res = append(res, err) - } - - qCloseoutLocation, qhkCloseoutLocation, _ := qs.GetOK("closeoutLocation") - if err := o.bindCloseoutLocation(qCloseoutLocation, qhkCloseoutLocation, route.Formats); err != nil { - res = append(res, err) - } - - qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") - if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { - res = append(res, err) - } - - qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") - if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { - res = append(res, err) - } - - qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") - if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qEdipi, qhkEdipi, _ := qs.GetOK("edipi") - if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { - res = append(res, err) - } - - qEmplid, qhkEmplid, _ := qs.GetOK("emplid") - if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { - res = append(res, err) - } - - qLocator, qhkLocator, _ := qs.GetOK("locator") - if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { - res = append(res, err) - } - - qNeedsPPMCloseout, qhkNeedsPPMCloseout, _ := qs.GetOK("needsPPMCloseout") - if err := o.bindNeedsPPMCloseout(qNeedsPPMCloseout, qhkNeedsPPMCloseout, route.Formats); err != nil { - res = append(res, err) - } - - qOrder, qhkOrder, _ := qs.GetOK("order") - if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { - res = append(res, err) - } - - qOrderType, qhkOrderType, _ := qs.GetOK("orderType") - if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { - res = append(res, err) - } - - qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") - if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { - res = append(res, err) - } - - qOriginGBLOC, qhkOriginGBLOC, _ := qs.GetOK("originGBLOC") - if err := o.bindOriginGBLOC(qOriginGBLOC, qhkOriginGBLOC, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qPpmStatus, qhkPpmStatus, _ := qs.GetOK("ppmStatus") - if err := o.bindPpmStatus(qPpmStatus, qhkPpmStatus, route.Formats); err != nil { - res = append(res, err) - } - - qPpmType, qhkPpmType, _ := qs.GetOK("ppmType") - if err := o.bindPpmType(qPpmType, qhkPpmType, route.Formats); err != nil { - res = append(res, err) - } - - qRequestedMoveDate, qhkRequestedMoveDate, _ := qs.GetOK("requestedMoveDate") - if err := o.bindRequestedMoveDate(qRequestedMoveDate, qhkRequestedMoveDate, route.Formats); err != nil { - res = append(res, err) - } - - qSort, qhkSort, _ := qs.GetOK("sort") - if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { - res = append(res, err) - } - - qStatus, qhkStatus, _ := qs.GetOK("status") - if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { - res = append(res, err) - } - - qSubmittedAt, qhkSubmittedAt, _ := qs.GetOK("submittedAt") - if err := o.bindSubmittedAt(qSubmittedAt, qhkSubmittedAt, route.Formats); err != nil { - res = append(res, err) - } - - qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") - if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAssignedTo binds and validates parameter AssignedTo from query. -func (o *GetServicesCounselingQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.AssignedTo = &raw - - return nil -} - -// bindBranch binds and validates parameter Branch from query. -func (o *GetServicesCounselingQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Branch = &raw - - return nil -} - -// bindCloseoutInitiated binds and validates parameter CloseoutInitiated from query. -func (o *GetServicesCounselingQueueParams) bindCloseoutInitiated(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("closeoutInitiated", "query", "strfmt.DateTime", raw) - } - o.CloseoutInitiated = (value.(*strfmt.DateTime)) - - if err := o.validateCloseoutInitiated(formats); err != nil { - return err - } - - return nil -} - -// validateCloseoutInitiated carries on validations for parameter CloseoutInitiated -func (o *GetServicesCounselingQueueParams) validateCloseoutInitiated(formats strfmt.Registry) error { - - if err := validate.FormatOf("closeoutInitiated", "query", "date-time", o.CloseoutInitiated.String(), formats); err != nil { - return err - } - return nil -} - -// bindCloseoutLocation binds and validates parameter CloseoutLocation from query. -func (o *GetServicesCounselingQueueParams) bindCloseoutLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CloseoutLocation = &raw - - return nil -} - -// bindCounselingOffice binds and validates parameter CounselingOffice from query. -func (o *GetServicesCounselingQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CounselingOffice = &raw - - return nil -} - -// bindCustomerName binds and validates parameter CustomerName from query. -func (o *GetServicesCounselingQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.CustomerName = &raw - - return nil -} - -// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. -func (o *GetServicesCounselingQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.DestinationDutyLocation = &raw - - return nil -} - -// bindEdipi binds and validates parameter Edipi from query. -func (o *GetServicesCounselingQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Edipi = &raw - - return nil -} - -// bindEmplid binds and validates parameter Emplid from query. -func (o *GetServicesCounselingQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Emplid = &raw - - return nil -} - -// bindLocator binds and validates parameter Locator from query. -func (o *GetServicesCounselingQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Locator = &raw - - return nil -} - -// bindNeedsPPMCloseout binds and validates parameter NeedsPPMCloseout from query. -func (o *GetServicesCounselingQueueParams) bindNeedsPPMCloseout(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("needsPPMCloseout", "query", "bool", raw) - } - o.NeedsPPMCloseout = &value - - return nil -} - -// bindOrder binds and validates parameter Order from query. -func (o *GetServicesCounselingQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Order = &raw - - if err := o.validateOrder(formats); err != nil { - return err - } - - return nil -} - -// validateOrder carries on validations for parameter Order -func (o *GetServicesCounselingQueueParams) validateOrder(formats strfmt.Registry) error { - - if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { - return err - } - - return nil -} - -// bindOrderType binds and validates parameter OrderType from query. -func (o *GetServicesCounselingQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OrderType = &raw - - return nil -} - -// bindOriginDutyLocation binds and validates array parameter OriginDutyLocation from query. -// -// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). -func (o *GetServicesCounselingQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { - // CollectionFormat: multi - originDutyLocationIC := rawData - if len(originDutyLocationIC) == 0 { - return nil - } - - var originDutyLocationIR []string - for _, originDutyLocationIV := range originDutyLocationIC { - originDutyLocationI := originDutyLocationIV - - originDutyLocationIR = append(originDutyLocationIR, originDutyLocationI) - } - - o.OriginDutyLocation = originDutyLocationIR - if err := o.validateOriginDutyLocation(formats); err != nil { - return err - } - - return nil -} - -// validateOriginDutyLocation carries on validations for parameter OriginDutyLocation -func (o *GetServicesCounselingQueueParams) validateOriginDutyLocation(formats strfmt.Registry) error { - - // uniqueItems: true - if err := validate.UniqueItems("originDutyLocation", "query", o.OriginDutyLocation); err != nil { - return err - } - return nil -} - -// bindOriginGBLOC binds and validates parameter OriginGBLOC from query. -func (o *GetServicesCounselingQueueParams) bindOriginGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OriginGBLOC = &raw - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *GetServicesCounselingQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *GetServicesCounselingQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindPpmStatus binds and validates parameter PpmStatus from query. -func (o *GetServicesCounselingQueueParams) bindPpmStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.PpmStatus = &raw - - if err := o.validatePpmStatus(formats); err != nil { - return err - } - - return nil -} - -// validatePpmStatus carries on validations for parameter PpmStatus -func (o *GetServicesCounselingQueueParams) validatePpmStatus(formats strfmt.Registry) error { - - if err := validate.EnumCase("ppmStatus", "query", *o.PpmStatus, []interface{}{"WAITING_ON_CUSTOMER", "NEEDS_CLOSEOUT"}, true); err != nil { - return err - } - - return nil -} - -// bindPpmType binds and validates parameter PpmType from query. -func (o *GetServicesCounselingQueueParams) bindPpmType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.PpmType = &raw - - if err := o.validatePpmType(formats); err != nil { - return err - } - - return nil -} - -// validatePpmType carries on validations for parameter PpmType -func (o *GetServicesCounselingQueueParams) validatePpmType(formats strfmt.Registry) error { - - if err := validate.EnumCase("ppmType", "query", *o.PpmType, []interface{}{"FULL", "PARTIAL"}, true); err != nil { - return err - } - - return nil -} - -// bindRequestedMoveDate binds and validates parameter RequestedMoveDate from query. -func (o *GetServicesCounselingQueueParams) bindRequestedMoveDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.RequestedMoveDate = &raw - - return nil -} - -// bindSort binds and validates parameter Sort from query. -func (o *GetServicesCounselingQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.Sort = &raw - - if err := o.validateSort(formats); err != nil { - return err - } - - return nil -} - -// validateSort carries on validations for parameter Sort -func (o *GetServicesCounselingQueueParams) validateSort(formats strfmt.Registry) error { - - if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "edipi", "emplid", "branch", "locator", "status", "requestedMoveDate", "submittedAt", "originGBLOC", "originDutyLocation", "destinationDutyLocation", "ppmType", "closeoutInitiated", "closeoutLocation", "ppmStatus", "counselingOffice", "assignedTo"}, true); err != nil { - return err - } - - return nil -} - -// bindStatus binds and validates array parameter Status from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *GetServicesCounselingQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { - var qvStatus string - if len(rawData) > 0 { - qvStatus = rawData[len(rawData)-1] - } - - // CollectionFormat: - statusIC := swag.SplitByFormat(qvStatus, "") - if len(statusIC) == 0 { - return nil - } - - var statusIR []string - for i, statusIV := range statusIC { - statusI := statusIV - - if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"NEEDS SERVICE COUNSELING", "SERVICE COUNSELING COMPLETED"}, true); err != nil { - return err - } - - statusIR = append(statusIR, statusI) - } - - o.Status = statusIR - if err := o.validateStatus(formats); err != nil { - return err - } - - return nil -} - -// validateStatus carries on validations for parameter Status -func (o *GetServicesCounselingQueueParams) validateStatus(formats strfmt.Registry) error { - - // uniqueItems: true - if err := validate.UniqueItems("status", "query", o.Status); err != nil { - return err - } - return nil -} - -// bindSubmittedAt binds and validates parameter SubmittedAt from query. -func (o *GetServicesCounselingQueueParams) bindSubmittedAt(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("submittedAt", "query", "strfmt.DateTime", raw) - } - o.SubmittedAt = (value.(*strfmt.DateTime)) - - if err := o.validateSubmittedAt(formats); err != nil { - return err - } - - return nil -} - -// validateSubmittedAt carries on validations for parameter SubmittedAt -func (o *GetServicesCounselingQueueParams) validateSubmittedAt(formats strfmt.Registry) error { - - if err := validate.FormatOf("submittedAt", "query", "date-time", o.SubmittedAt.String(), formats); err != nil { - return err - } - return nil -} - -// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. -func (o *GetServicesCounselingQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ViewAsGBLOC = &raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go deleted file mode 100644 index f75f014d949..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetServicesCounselingQueueOKCode is the HTTP code returned for type GetServicesCounselingQueueOK -const GetServicesCounselingQueueOKCode int = 200 - -/* -GetServicesCounselingQueueOK Successfully returned all moves matching the criteria - -swagger:response getServicesCounselingQueueOK -*/ -type GetServicesCounselingQueueOK struct { - - /* - In: Body - */ - Payload *ghcmessages.QueueMovesResult `json:"body,omitempty"` -} - -// NewGetServicesCounselingQueueOK creates GetServicesCounselingQueueOK with default headers values -func NewGetServicesCounselingQueueOK() *GetServicesCounselingQueueOK { - - return &GetServicesCounselingQueueOK{} -} - -// WithPayload adds the payload to the get services counseling queue o k response -func (o *GetServicesCounselingQueueOK) WithPayload(payload *ghcmessages.QueueMovesResult) *GetServicesCounselingQueueOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling queue o k response -func (o *GetServicesCounselingQueueOK) SetPayload(payload *ghcmessages.QueueMovesResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetServicesCounselingQueueForbiddenCode is the HTTP code returned for type GetServicesCounselingQueueForbidden -const GetServicesCounselingQueueForbiddenCode int = 403 - -/* -GetServicesCounselingQueueForbidden The request was denied - -swagger:response getServicesCounselingQueueForbidden -*/ -type GetServicesCounselingQueueForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetServicesCounselingQueueForbidden creates GetServicesCounselingQueueForbidden with default headers values -func NewGetServicesCounselingQueueForbidden() *GetServicesCounselingQueueForbidden { - - return &GetServicesCounselingQueueForbidden{} -} - -// WithPayload adds the payload to the get services counseling queue forbidden response -func (o *GetServicesCounselingQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingQueueForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling queue forbidden response -func (o *GetServicesCounselingQueueForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetServicesCounselingQueueInternalServerErrorCode is the HTTP code returned for type GetServicesCounselingQueueInternalServerError -const GetServicesCounselingQueueInternalServerErrorCode int = 500 - -/* -GetServicesCounselingQueueInternalServerError A server error occurred - -swagger:response getServicesCounselingQueueInternalServerError -*/ -type GetServicesCounselingQueueInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetServicesCounselingQueueInternalServerError creates GetServicesCounselingQueueInternalServerError with default headers values -func NewGetServicesCounselingQueueInternalServerError() *GetServicesCounselingQueueInternalServerError { - - return &GetServicesCounselingQueueInternalServerError{} -} - -// WithPayload adds the payload to the get services counseling queue internal server error response -func (o *GetServicesCounselingQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingQueueInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get services counseling queue internal server error response -func (o *GetServicesCounselingQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetServicesCounselingQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go deleted file mode 100644 index d7ad7668c07..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go +++ /dev/null @@ -1,328 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GetServicesCounselingQueueURL generates an URL for the get services counseling queue operation -type GetServicesCounselingQueueURL struct { - AssignedTo *string - Branch *string - CloseoutInitiated *strfmt.DateTime - CloseoutLocation *string - CounselingOffice *string - CustomerName *string - DestinationDutyLocation *string - Edipi *string - Emplid *string - Locator *string - NeedsPPMCloseout *bool - Order *string - OrderType *string - OriginDutyLocation []string - OriginGBLOC *string - Page *int64 - PerPage *int64 - PpmStatus *string - PpmType *string - RequestedMoveDate *string - Sort *string - Status []string - SubmittedAt *strfmt.DateTime - ViewAsGBLOC *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetServicesCounselingQueueURL) WithBasePath(bp string) *GetServicesCounselingQueueURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetServicesCounselingQueueURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetServicesCounselingQueueURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/counseling" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var assignedToQ string - if o.AssignedTo != nil { - assignedToQ = *o.AssignedTo - } - if assignedToQ != "" { - qs.Set("assignedTo", assignedToQ) - } - - var branchQ string - if o.Branch != nil { - branchQ = *o.Branch - } - if branchQ != "" { - qs.Set("branch", branchQ) - } - - var closeoutInitiatedQ string - if o.CloseoutInitiated != nil { - closeoutInitiatedQ = o.CloseoutInitiated.String() - } - if closeoutInitiatedQ != "" { - qs.Set("closeoutInitiated", closeoutInitiatedQ) - } - - var closeoutLocationQ string - if o.CloseoutLocation != nil { - closeoutLocationQ = *o.CloseoutLocation - } - if closeoutLocationQ != "" { - qs.Set("closeoutLocation", closeoutLocationQ) - } - - var counselingOfficeQ string - if o.CounselingOffice != nil { - counselingOfficeQ = *o.CounselingOffice - } - if counselingOfficeQ != "" { - qs.Set("counselingOffice", counselingOfficeQ) - } - - var customerNameQ string - if o.CustomerName != nil { - customerNameQ = *o.CustomerName - } - if customerNameQ != "" { - qs.Set("customerName", customerNameQ) - } - - var destinationDutyLocationQ string - if o.DestinationDutyLocation != nil { - destinationDutyLocationQ = *o.DestinationDutyLocation - } - if destinationDutyLocationQ != "" { - qs.Set("destinationDutyLocation", destinationDutyLocationQ) - } - - var edipiQ string - if o.Edipi != nil { - edipiQ = *o.Edipi - } - if edipiQ != "" { - qs.Set("edipi", edipiQ) - } - - var emplidQ string - if o.Emplid != nil { - emplidQ = *o.Emplid - } - if emplidQ != "" { - qs.Set("emplid", emplidQ) - } - - var locatorQ string - if o.Locator != nil { - locatorQ = *o.Locator - } - if locatorQ != "" { - qs.Set("locator", locatorQ) - } - - var needsPPMCloseoutQ string - if o.NeedsPPMCloseout != nil { - needsPPMCloseoutQ = swag.FormatBool(*o.NeedsPPMCloseout) - } - if needsPPMCloseoutQ != "" { - qs.Set("needsPPMCloseout", needsPPMCloseoutQ) - } - - var orderQ string - if o.Order != nil { - orderQ = *o.Order - } - if orderQ != "" { - qs.Set("order", orderQ) - } - - var orderTypeQ string - if o.OrderType != nil { - orderTypeQ = *o.OrderType - } - if orderTypeQ != "" { - qs.Set("orderType", orderTypeQ) - } - - var originDutyLocationIR []string - for _, originDutyLocationI := range o.OriginDutyLocation { - originDutyLocationIS := originDutyLocationI - if originDutyLocationIS != "" { - originDutyLocationIR = append(originDutyLocationIR, originDutyLocationIS) - } - } - - originDutyLocation := swag.JoinByFormat(originDutyLocationIR, "multi") - - for _, qsv := range originDutyLocation { - qs.Add("originDutyLocation", qsv) - } - - var originGBLOCQ string - if o.OriginGBLOC != nil { - originGBLOCQ = *o.OriginGBLOC - } - if originGBLOCQ != "" { - qs.Set("originGBLOC", originGBLOCQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var ppmStatusQ string - if o.PpmStatus != nil { - ppmStatusQ = *o.PpmStatus - } - if ppmStatusQ != "" { - qs.Set("ppmStatus", ppmStatusQ) - } - - var ppmTypeQ string - if o.PpmType != nil { - ppmTypeQ = *o.PpmType - } - if ppmTypeQ != "" { - qs.Set("ppmType", ppmTypeQ) - } - - var requestedMoveDateQ string - if o.RequestedMoveDate != nil { - requestedMoveDateQ = *o.RequestedMoveDate - } - if requestedMoveDateQ != "" { - qs.Set("requestedMoveDate", requestedMoveDateQ) - } - - var sortQ string - if o.Sort != nil { - sortQ = *o.Sort - } - if sortQ != "" { - qs.Set("sort", sortQ) - } - - var statusIR []string - for _, statusI := range o.Status { - statusIS := statusI - if statusIS != "" { - statusIR = append(statusIR, statusIS) - } - } - - status := swag.JoinByFormat(statusIR, "") - - if len(status) > 0 { - qsv := status[0] - if qsv != "" { - qs.Set("status", qsv) - } - } - - var submittedAtQ string - if o.SubmittedAt != nil { - submittedAtQ = o.SubmittedAt.String() - } - if submittedAtQ != "" { - qs.Set("submittedAt", submittedAtQ) - } - - var viewAsGBLOCQ string - if o.ViewAsGBLOC != nil { - viewAsGBLOCQ = *o.ViewAsGBLOC - } - if viewAsGBLOCQ != "" { - qs.Set("viewAsGBLOC", viewAsGBLOCQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetServicesCounselingQueueURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetServicesCounselingQueueURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetServicesCounselingQueueURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetServicesCounselingQueueURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetServicesCounselingQueueURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetServicesCounselingQueueURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go deleted file mode 100644 index 3923f7dfd8c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListPrimeMovesHandlerFunc turns a function with the right signature into a list prime moves handler -type ListPrimeMovesHandlerFunc func(ListPrimeMovesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListPrimeMovesHandlerFunc) Handle(params ListPrimeMovesParams) middleware.Responder { - return fn(params) -} - -// ListPrimeMovesHandler interface for that can handle valid list prime moves params -type ListPrimeMovesHandler interface { - Handle(ListPrimeMovesParams) middleware.Responder -} - -// NewListPrimeMoves creates a new http.Handler for the list prime moves operation -func NewListPrimeMoves(ctx *middleware.Context, handler ListPrimeMovesHandler) *ListPrimeMoves { - return &ListPrimeMoves{Context: ctx, Handler: handler} -} - -/* - ListPrimeMoves swagger:route GET /queues/prime-moves queues listPrimeMoves - -getPrimeMovesQueue - -Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this -list down to only the moves that have been updated since the provided timestamp. A move will be considered -updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment -requests, is later than the provided date and time. - -**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has -been set, that move will always appear in this list. -*/ -type ListPrimeMoves struct { - Context *middleware.Context - Handler ListPrimeMovesHandler -} - -func (o *ListPrimeMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListPrimeMovesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go deleted file mode 100644 index 6562f690385..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go +++ /dev/null @@ -1,243 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewListPrimeMovesParams creates a new ListPrimeMovesParams object -// -// There are no default values defined in the spec. -func NewListPrimeMovesParams() ListPrimeMovesParams { - - return ListPrimeMovesParams{} -} - -// ListPrimeMovesParams contains all the bound params for the list prime moves operation -// typically these are obtained from a http.Request -// -// swagger:parameters listPrimeMoves -type ListPrimeMovesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: query - */ - ID *string - /* - In: query - */ - MoveCode *string - /*order type - In: query - */ - OrderType *string - /*requested page of results - In: query - */ - Page *int64 - /*results per page - In: query - */ - PerPage *int64 - /*Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" - In: query - */ - Since *strfmt.DateTime -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListPrimeMovesParams() beforehand. -func (o *ListPrimeMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qID, qhkID, _ := qs.GetOK("id") - if err := o.bindID(qID, qhkID, route.Formats); err != nil { - res = append(res, err) - } - - qMoveCode, qhkMoveCode, _ := qs.GetOK("moveCode") - if err := o.bindMoveCode(qMoveCode, qhkMoveCode, route.Formats); err != nil { - res = append(res, err) - } - - qOrderType, qhkOrderType, _ := qs.GetOK("orderType") - if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { - res = append(res, err) - } - - qPage, qhkPage, _ := qs.GetOK("page") - if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { - res = append(res, err) - } - - qPerPage, qhkPerPage, _ := qs.GetOK("perPage") - if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { - res = append(res, err) - } - - qSince, qhkSince, _ := qs.GetOK("since") - if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindID binds and validates parameter ID from query. -func (o *ListPrimeMovesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.ID = &raw - - return nil -} - -// bindMoveCode binds and validates parameter MoveCode from query. -func (o *ListPrimeMovesParams) bindMoveCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.MoveCode = &raw - - return nil -} - -// bindOrderType binds and validates parameter OrderType from query. -func (o *ListPrimeMovesParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.OrderType = &raw - - return nil -} - -// bindPage binds and validates parameter Page from query. -func (o *ListPrimeMovesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("page", "query", "int64", raw) - } - o.Page = &value - - return nil -} - -// bindPerPage binds and validates parameter PerPage from query. -func (o *ListPrimeMovesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("perPage", "query", "int64", raw) - } - o.PerPage = &value - - return nil -} - -// bindSince binds and validates parameter Since from query. -func (o *ListPrimeMovesParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("since", "query", "strfmt.DateTime", raw) - } - o.Since = (value.(*strfmt.DateTime)) - - if err := o.validateSince(formats); err != nil { - return err - } - - return nil -} - -// validateSince carries on validations for parameter Since -func (o *ListPrimeMovesParams) validateSince(formats strfmt.Registry) error { - - if err := validate.FormatOf("since", "query", "date-time", o.Since.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go deleted file mode 100644 index 8bb53b97cbd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ListPrimeMovesOKCode is the HTTP code returned for type ListPrimeMovesOK -const ListPrimeMovesOKCode int = 200 - -/* -ListPrimeMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. - -swagger:response listPrimeMovesOK -*/ -type ListPrimeMovesOK struct { - - /* - In: Body - */ - Payload *ghcmessages.ListPrimeMovesResult `json:"body,omitempty"` -} - -// NewListPrimeMovesOK creates ListPrimeMovesOK with default headers values -func NewListPrimeMovesOK() *ListPrimeMovesOK { - - return &ListPrimeMovesOK{} -} - -// WithPayload adds the payload to the list prime moves o k response -func (o *ListPrimeMovesOK) WithPayload(payload *ghcmessages.ListPrimeMovesResult) *ListPrimeMovesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list prime moves o k response -func (o *ListPrimeMovesOK) SetPayload(payload *ghcmessages.ListPrimeMovesResult) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPrimeMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPrimeMovesForbiddenCode is the HTTP code returned for type ListPrimeMovesForbidden -const ListPrimeMovesForbiddenCode int = 403 - -/* -ListPrimeMovesForbidden The request was denied - -swagger:response listPrimeMovesForbidden -*/ -type ListPrimeMovesForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListPrimeMovesForbidden creates ListPrimeMovesForbidden with default headers values -func NewListPrimeMovesForbidden() *ListPrimeMovesForbidden { - - return &ListPrimeMovesForbidden{} -} - -// WithPayload adds the payload to the list prime moves forbidden response -func (o *ListPrimeMovesForbidden) WithPayload(payload *ghcmessages.Error) *ListPrimeMovesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list prime moves forbidden response -func (o *ListPrimeMovesForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPrimeMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListPrimeMovesInternalServerErrorCode is the HTTP code returned for type ListPrimeMovesInternalServerError -const ListPrimeMovesInternalServerErrorCode int = 500 - -/* -ListPrimeMovesInternalServerError A server error occurred - -swagger:response listPrimeMovesInternalServerError -*/ -type ListPrimeMovesInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewListPrimeMovesInternalServerError creates ListPrimeMovesInternalServerError with default headers values -func NewListPrimeMovesInternalServerError() *ListPrimeMovesInternalServerError { - - return &ListPrimeMovesInternalServerError{} -} - -// WithPayload adds the payload to the list prime moves internal server error response -func (o *ListPrimeMovesInternalServerError) WithPayload(payload *ghcmessages.Error) *ListPrimeMovesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list prime moves internal server error response -func (o *ListPrimeMovesInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListPrimeMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go deleted file mode 100644 index b76bbe56629..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListPrimeMovesURL generates an URL for the list prime moves operation -type ListPrimeMovesURL struct { - ID *string - MoveCode *string - OrderType *string - Page *int64 - PerPage *int64 - Since *strfmt.DateTime - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPrimeMovesURL) WithBasePath(bp string) *ListPrimeMovesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListPrimeMovesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListPrimeMovesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/prime-moves" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var idQ string - if o.ID != nil { - idQ = *o.ID - } - if idQ != "" { - qs.Set("id", idQ) - } - - var moveCodeQ string - if o.MoveCode != nil { - moveCodeQ = *o.MoveCode - } - if moveCodeQ != "" { - qs.Set("moveCode", moveCodeQ) - } - - var orderTypeQ string - if o.OrderType != nil { - orderTypeQ = *o.OrderType - } - if orderTypeQ != "" { - qs.Set("orderType", orderTypeQ) - } - - var pageQ string - if o.Page != nil { - pageQ = swag.FormatInt64(*o.Page) - } - if pageQ != "" { - qs.Set("page", pageQ) - } - - var perPageQ string - if o.PerPage != nil { - perPageQ = swag.FormatInt64(*o.PerPage) - } - if perPageQ != "" { - qs.Set("perPage", perPageQ) - } - - var sinceQ string - if o.Since != nil { - sinceQ = o.Since.String() - } - if sinceQ != "" { - qs.Set("since", sinceQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListPrimeMovesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListPrimeMovesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListPrimeMovesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListPrimeMovesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListPrimeMovesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListPrimeMovesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go deleted file mode 100644 index 1dd08a72a7c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package re_service_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetAllReServiceItemsHandlerFunc turns a function with the right signature into a get all re service items handler -type GetAllReServiceItemsHandlerFunc func(GetAllReServiceItemsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetAllReServiceItemsHandlerFunc) Handle(params GetAllReServiceItemsParams) middleware.Responder { - return fn(params) -} - -// GetAllReServiceItemsHandler interface for that can handle valid get all re service items params -type GetAllReServiceItemsHandler interface { - Handle(GetAllReServiceItemsParams) middleware.Responder -} - -// NewGetAllReServiceItems creates a new http.Handler for the get all re service items operation -func NewGetAllReServiceItems(ctx *middleware.Context, handler GetAllReServiceItemsHandler) *GetAllReServiceItems { - return &GetAllReServiceItems{Context: ctx, Handler: handler} -} - -/* - GetAllReServiceItems swagger:route GET /re-service-items reServiceItems getAllReServiceItems - -Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved) - -Get ReServiceItems -*/ -type GetAllReServiceItems struct { - Context *middleware.Context - Handler GetAllReServiceItemsHandler -} - -func (o *GetAllReServiceItems) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetAllReServiceItemsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go deleted file mode 100644 index 3e66348bc46..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package re_service_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetAllReServiceItemsParams creates a new GetAllReServiceItemsParams object -// -// There are no default values defined in the spec. -func NewGetAllReServiceItemsParams() GetAllReServiceItemsParams { - - return GetAllReServiceItemsParams{} -} - -// GetAllReServiceItemsParams contains all the bound params for the get all re service items operation -// typically these are obtained from a http.Request -// -// swagger:parameters getAllReServiceItems -type GetAllReServiceItemsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetAllReServiceItemsParams() beforehand. -func (o *GetAllReServiceItemsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go deleted file mode 100644 index c5b7d2e48d3..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package re_service_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetAllReServiceItemsOKCode is the HTTP code returned for type GetAllReServiceItemsOK -const GetAllReServiceItemsOKCode int = 200 - -/* -GetAllReServiceItemsOK Successfully retrieved all ReServiceItems. - -swagger:response getAllReServiceItemsOK -*/ -type GetAllReServiceItemsOK struct { - - /* - In: Body - */ - Payload ghcmessages.ReServiceItems `json:"body,omitempty"` -} - -// NewGetAllReServiceItemsOK creates GetAllReServiceItemsOK with default headers values -func NewGetAllReServiceItemsOK() *GetAllReServiceItemsOK { - - return &GetAllReServiceItemsOK{} -} - -// WithPayload adds the payload to the get all re service items o k response -func (o *GetAllReServiceItemsOK) WithPayload(payload ghcmessages.ReServiceItems) *GetAllReServiceItemsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all re service items o k response -func (o *GetAllReServiceItemsOK) SetPayload(payload ghcmessages.ReServiceItems) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllReServiceItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.ReServiceItems{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetAllReServiceItemsBadRequestCode is the HTTP code returned for type GetAllReServiceItemsBadRequest -const GetAllReServiceItemsBadRequestCode int = 400 - -/* -GetAllReServiceItemsBadRequest The request payload is invalid - -swagger:response getAllReServiceItemsBadRequest -*/ -type GetAllReServiceItemsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetAllReServiceItemsBadRequest creates GetAllReServiceItemsBadRequest with default headers values -func NewGetAllReServiceItemsBadRequest() *GetAllReServiceItemsBadRequest { - - return &GetAllReServiceItemsBadRequest{} -} - -// WithPayload adds the payload to the get all re service items bad request response -func (o *GetAllReServiceItemsBadRequest) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all re service items bad request response -func (o *GetAllReServiceItemsBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllReServiceItemsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllReServiceItemsUnauthorizedCode is the HTTP code returned for type GetAllReServiceItemsUnauthorized -const GetAllReServiceItemsUnauthorizedCode int = 401 - -/* -GetAllReServiceItemsUnauthorized The request was denied - -swagger:response getAllReServiceItemsUnauthorized -*/ -type GetAllReServiceItemsUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetAllReServiceItemsUnauthorized creates GetAllReServiceItemsUnauthorized with default headers values -func NewGetAllReServiceItemsUnauthorized() *GetAllReServiceItemsUnauthorized { - - return &GetAllReServiceItemsUnauthorized{} -} - -// WithPayload adds the payload to the get all re service items unauthorized response -func (o *GetAllReServiceItemsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all re service items unauthorized response -func (o *GetAllReServiceItemsUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllReServiceItemsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllReServiceItemsNotFoundCode is the HTTP code returned for type GetAllReServiceItemsNotFound -const GetAllReServiceItemsNotFoundCode int = 404 - -/* -GetAllReServiceItemsNotFound The requested resource wasn't found - -swagger:response getAllReServiceItemsNotFound -*/ -type GetAllReServiceItemsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetAllReServiceItemsNotFound creates GetAllReServiceItemsNotFound with default headers values -func NewGetAllReServiceItemsNotFound() *GetAllReServiceItemsNotFound { - - return &GetAllReServiceItemsNotFound{} -} - -// WithPayload adds the payload to the get all re service items not found response -func (o *GetAllReServiceItemsNotFound) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all re service items not found response -func (o *GetAllReServiceItemsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllReServiceItemsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllReServiceItemsInternalServerErrorCode is the HTTP code returned for type GetAllReServiceItemsInternalServerError -const GetAllReServiceItemsInternalServerErrorCode int = 500 - -/* -GetAllReServiceItemsInternalServerError A server error occurred - -swagger:response getAllReServiceItemsInternalServerError -*/ -type GetAllReServiceItemsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetAllReServiceItemsInternalServerError creates GetAllReServiceItemsInternalServerError with default headers values -func NewGetAllReServiceItemsInternalServerError() *GetAllReServiceItemsInternalServerError { - - return &GetAllReServiceItemsInternalServerError{} -} - -// WithPayload adds the payload to the get all re service items internal server error response -func (o *GetAllReServiceItemsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all re service items internal server error response -func (o *GetAllReServiceItemsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllReServiceItemsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go deleted file mode 100644 index be1ff8cd69e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package re_service_items - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetAllReServiceItemsURL generates an URL for the get all re service items operation -type GetAllReServiceItemsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAllReServiceItemsURL) WithBasePath(bp string) *GetAllReServiceItemsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAllReServiceItemsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetAllReServiceItemsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/re-service-items" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetAllReServiceItemsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetAllReServiceItemsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetAllReServiceItemsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetAllReServiceItemsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetAllReServiceItemsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetAllReServiceItemsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go deleted file mode 100644 index 7ed7d246832..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// AssociateReportViolationsHandlerFunc turns a function with the right signature into a associate report violations handler -type AssociateReportViolationsHandlerFunc func(AssociateReportViolationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn AssociateReportViolationsHandlerFunc) Handle(params AssociateReportViolationsParams) middleware.Responder { - return fn(params) -} - -// AssociateReportViolationsHandler interface for that can handle valid associate report violations params -type AssociateReportViolationsHandler interface { - Handle(AssociateReportViolationsParams) middleware.Responder -} - -// NewAssociateReportViolations creates a new http.Handler for the associate report violations operation -func NewAssociateReportViolations(ctx *middleware.Context, handler AssociateReportViolationsHandler) *AssociateReportViolations { - return &AssociateReportViolations{Context: ctx, Handler: handler} -} - -/* - AssociateReportViolations swagger:route POST /report-violations/{reportID} reportViolations associateReportViolations - -# Associate violations with an evaluation report - -Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report. -*/ -type AssociateReportViolations struct { - Context *middleware.Context - Handler AssociateReportViolationsHandler -} - -func (o *AssociateReportViolations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewAssociateReportViolationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go deleted file mode 100644 index 4eb082affb9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewAssociateReportViolationsParams creates a new AssociateReportViolationsParams object -// -// There are no default values defined in the spec. -func NewAssociateReportViolationsParams() AssociateReportViolationsParams { - - return AssociateReportViolationsParams{} -} - -// AssociateReportViolationsParams contains all the bound params for the associate report violations operation -// typically these are obtained from a http.Request -// -// swagger:parameters associateReportViolations -type AssociateReportViolationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *ghcmessages.AssociateReportViolations - /*the evaluation report ID that has associated violations - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewAssociateReportViolationsParams() beforehand. -func (o *AssociateReportViolationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.AssociateReportViolations - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *AssociateReportViolationsParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *AssociateReportViolationsParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go deleted file mode 100644 index b28d30c65e7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// AssociateReportViolationsNoContentCode is the HTTP code returned for type AssociateReportViolationsNoContent -const AssociateReportViolationsNoContentCode int = 204 - -/* -AssociateReportViolationsNoContent Successfully saved the report violations - -swagger:response associateReportViolationsNoContent -*/ -type AssociateReportViolationsNoContent struct { -} - -// NewAssociateReportViolationsNoContent creates AssociateReportViolationsNoContent with default headers values -func NewAssociateReportViolationsNoContent() *AssociateReportViolationsNoContent { - - return &AssociateReportViolationsNoContent{} -} - -// WriteResponse to the client -func (o *AssociateReportViolationsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// AssociateReportViolationsBadRequestCode is the HTTP code returned for type AssociateReportViolationsBadRequest -const AssociateReportViolationsBadRequestCode int = 400 - -/* -AssociateReportViolationsBadRequest The request payload is invalid - -swagger:response associateReportViolationsBadRequest -*/ -type AssociateReportViolationsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAssociateReportViolationsBadRequest creates AssociateReportViolationsBadRequest with default headers values -func NewAssociateReportViolationsBadRequest() *AssociateReportViolationsBadRequest { - - return &AssociateReportViolationsBadRequest{} -} - -// WithPayload adds the payload to the associate report violations bad request response -func (o *AssociateReportViolationsBadRequest) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations bad request response -func (o *AssociateReportViolationsBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateReportViolationsForbiddenCode is the HTTP code returned for type AssociateReportViolationsForbidden -const AssociateReportViolationsForbiddenCode int = 403 - -/* -AssociateReportViolationsForbidden The request was denied - -swagger:response associateReportViolationsForbidden -*/ -type AssociateReportViolationsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAssociateReportViolationsForbidden creates AssociateReportViolationsForbidden with default headers values -func NewAssociateReportViolationsForbidden() *AssociateReportViolationsForbidden { - - return &AssociateReportViolationsForbidden{} -} - -// WithPayload adds the payload to the associate report violations forbidden response -func (o *AssociateReportViolationsForbidden) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations forbidden response -func (o *AssociateReportViolationsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateReportViolationsNotFoundCode is the HTTP code returned for type AssociateReportViolationsNotFound -const AssociateReportViolationsNotFoundCode int = 404 - -/* -AssociateReportViolationsNotFound The requested resource wasn't found - -swagger:response associateReportViolationsNotFound -*/ -type AssociateReportViolationsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAssociateReportViolationsNotFound creates AssociateReportViolationsNotFound with default headers values -func NewAssociateReportViolationsNotFound() *AssociateReportViolationsNotFound { - - return &AssociateReportViolationsNotFound{} -} - -// WithPayload adds the payload to the associate report violations not found response -func (o *AssociateReportViolationsNotFound) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations not found response -func (o *AssociateReportViolationsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateReportViolationsConflictCode is the HTTP code returned for type AssociateReportViolationsConflict -const AssociateReportViolationsConflictCode int = 409 - -/* -AssociateReportViolationsConflict Conflict error - -swagger:response associateReportViolationsConflict -*/ -type AssociateReportViolationsConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAssociateReportViolationsConflict creates AssociateReportViolationsConflict with default headers values -func NewAssociateReportViolationsConflict() *AssociateReportViolationsConflict { - - return &AssociateReportViolationsConflict{} -} - -// WithPayload adds the payload to the associate report violations conflict response -func (o *AssociateReportViolationsConflict) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations conflict response -func (o *AssociateReportViolationsConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateReportViolationsUnprocessableEntityCode is the HTTP code returned for type AssociateReportViolationsUnprocessableEntity -const AssociateReportViolationsUnprocessableEntityCode int = 422 - -/* -AssociateReportViolationsUnprocessableEntity The payload was unprocessable. - -swagger:response associateReportViolationsUnprocessableEntity -*/ -type AssociateReportViolationsUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewAssociateReportViolationsUnprocessableEntity creates AssociateReportViolationsUnprocessableEntity with default headers values -func NewAssociateReportViolationsUnprocessableEntity() *AssociateReportViolationsUnprocessableEntity { - - return &AssociateReportViolationsUnprocessableEntity{} -} - -// WithPayload adds the payload to the associate report violations unprocessable entity response -func (o *AssociateReportViolationsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AssociateReportViolationsUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations unprocessable entity response -func (o *AssociateReportViolationsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// AssociateReportViolationsInternalServerErrorCode is the HTTP code returned for type AssociateReportViolationsInternalServerError -const AssociateReportViolationsInternalServerErrorCode int = 500 - -/* -AssociateReportViolationsInternalServerError A server error occurred - -swagger:response associateReportViolationsInternalServerError -*/ -type AssociateReportViolationsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewAssociateReportViolationsInternalServerError creates AssociateReportViolationsInternalServerError with default headers values -func NewAssociateReportViolationsInternalServerError() *AssociateReportViolationsInternalServerError { - - return &AssociateReportViolationsInternalServerError{} -} - -// WithPayload adds the payload to the associate report violations internal server error response -func (o *AssociateReportViolationsInternalServerError) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the associate report violations internal server error response -func (o *AssociateReportViolationsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *AssociateReportViolationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go deleted file mode 100644 index 0c0af0e9f47..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// AssociateReportViolationsURL generates an URL for the associate report violations operation -type AssociateReportViolationsURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AssociateReportViolationsURL) WithBasePath(bp string) *AssociateReportViolationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *AssociateReportViolationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *AssociateReportViolationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/report-violations/{reportID}" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on AssociateReportViolationsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *AssociateReportViolationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *AssociateReportViolationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *AssociateReportViolationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on AssociateReportViolationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on AssociateReportViolationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *AssociateReportViolationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go deleted file mode 100644 index 36a811ffe6e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetReportViolationsByReportIDHandlerFunc turns a function with the right signature into a get report violations by report ID handler -type GetReportViolationsByReportIDHandlerFunc func(GetReportViolationsByReportIDParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetReportViolationsByReportIDHandlerFunc) Handle(params GetReportViolationsByReportIDParams) middleware.Responder { - return fn(params) -} - -// GetReportViolationsByReportIDHandler interface for that can handle valid get report violations by report ID params -type GetReportViolationsByReportIDHandler interface { - Handle(GetReportViolationsByReportIDParams) middleware.Responder -} - -// NewGetReportViolationsByReportID creates a new http.Handler for the get report violations by report ID operation -func NewGetReportViolationsByReportID(ctx *middleware.Context, handler GetReportViolationsByReportIDHandler) *GetReportViolationsByReportID { - return &GetReportViolationsByReportID{Context: ctx, Handler: handler} -} - -/* - GetReportViolationsByReportID swagger:route GET /report-violations/{reportID} reportViolations getReportViolationsByReportId - -# Fetch the report violations for an evaluation report - -Fetch the report violations for an evaluation report -*/ -type GetReportViolationsByReportID struct { - Context *middleware.Context - Handler GetReportViolationsByReportIDHandler -} - -func (o *GetReportViolationsByReportID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetReportViolationsByReportIDParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go deleted file mode 100644 index 9b4cbe0a168..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetReportViolationsByReportIDParams creates a new GetReportViolationsByReportIDParams object -// -// There are no default values defined in the spec. -func NewGetReportViolationsByReportIDParams() GetReportViolationsByReportIDParams { - - return GetReportViolationsByReportIDParams{} -} - -// GetReportViolationsByReportIDParams contains all the bound params for the get report violations by report ID operation -// typically these are obtained from a http.Request -// -// swagger:parameters getReportViolationsByReportID -type GetReportViolationsByReportIDParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the evaluation report ID that has associated violations - Required: true - In: path - */ - ReportID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetReportViolationsByReportIDParams() beforehand. -func (o *GetReportViolationsByReportIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rReportID, rhkReportID, _ := route.Params.GetOK("reportID") - if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReportID binds and validates parameter ReportID from path. -func (o *GetReportViolationsByReportIDParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) - } - o.ReportID = *(value.(*strfmt.UUID)) - - if err := o.validateReportID(formats); err != nil { - return err - } - - return nil -} - -// validateReportID carries on validations for parameter ReportID -func (o *GetReportViolationsByReportIDParams) validateReportID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go deleted file mode 100644 index 4bbf9da8205..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetReportViolationsByReportIDOKCode is the HTTP code returned for type GetReportViolationsByReportIDOK -const GetReportViolationsByReportIDOKCode int = 200 - -/* -GetReportViolationsByReportIDOK Successfully retrieved the report violations - -swagger:response getReportViolationsByReportIdOK -*/ -type GetReportViolationsByReportIDOK struct { - - /* - In: Body - */ - Payload ghcmessages.ReportViolations `json:"body,omitempty"` -} - -// NewGetReportViolationsByReportIDOK creates GetReportViolationsByReportIDOK with default headers values -func NewGetReportViolationsByReportIDOK() *GetReportViolationsByReportIDOK { - - return &GetReportViolationsByReportIDOK{} -} - -// WithPayload adds the payload to the get report violations by report Id o k response -func (o *GetReportViolationsByReportIDOK) WithPayload(payload ghcmessages.ReportViolations) *GetReportViolationsByReportIDOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get report violations by report Id o k response -func (o *GetReportViolationsByReportIDOK) SetPayload(payload ghcmessages.ReportViolations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetReportViolationsByReportIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.ReportViolations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetReportViolationsByReportIDBadRequestCode is the HTTP code returned for type GetReportViolationsByReportIDBadRequest -const GetReportViolationsByReportIDBadRequestCode int = 400 - -/* -GetReportViolationsByReportIDBadRequest The request payload is invalid - -swagger:response getReportViolationsByReportIdBadRequest -*/ -type GetReportViolationsByReportIDBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetReportViolationsByReportIDBadRequest creates GetReportViolationsByReportIDBadRequest with default headers values -func NewGetReportViolationsByReportIDBadRequest() *GetReportViolationsByReportIDBadRequest { - - return &GetReportViolationsByReportIDBadRequest{} -} - -// WithPayload adds the payload to the get report violations by report Id bad request response -func (o *GetReportViolationsByReportIDBadRequest) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get report violations by report Id bad request response -func (o *GetReportViolationsByReportIDBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetReportViolationsByReportIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetReportViolationsByReportIDForbiddenCode is the HTTP code returned for type GetReportViolationsByReportIDForbidden -const GetReportViolationsByReportIDForbiddenCode int = 403 - -/* -GetReportViolationsByReportIDForbidden The request was denied - -swagger:response getReportViolationsByReportIdForbidden -*/ -type GetReportViolationsByReportIDForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetReportViolationsByReportIDForbidden creates GetReportViolationsByReportIDForbidden with default headers values -func NewGetReportViolationsByReportIDForbidden() *GetReportViolationsByReportIDForbidden { - - return &GetReportViolationsByReportIDForbidden{} -} - -// WithPayload adds the payload to the get report violations by report Id forbidden response -func (o *GetReportViolationsByReportIDForbidden) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get report violations by report Id forbidden response -func (o *GetReportViolationsByReportIDForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetReportViolationsByReportIDForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetReportViolationsByReportIDNotFoundCode is the HTTP code returned for type GetReportViolationsByReportIDNotFound -const GetReportViolationsByReportIDNotFoundCode int = 404 - -/* -GetReportViolationsByReportIDNotFound The requested resource wasn't found - -swagger:response getReportViolationsByReportIdNotFound -*/ -type GetReportViolationsByReportIDNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetReportViolationsByReportIDNotFound creates GetReportViolationsByReportIDNotFound with default headers values -func NewGetReportViolationsByReportIDNotFound() *GetReportViolationsByReportIDNotFound { - - return &GetReportViolationsByReportIDNotFound{} -} - -// WithPayload adds the payload to the get report violations by report Id not found response -func (o *GetReportViolationsByReportIDNotFound) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get report violations by report Id not found response -func (o *GetReportViolationsByReportIDNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetReportViolationsByReportIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetReportViolationsByReportIDInternalServerErrorCode is the HTTP code returned for type GetReportViolationsByReportIDInternalServerError -const GetReportViolationsByReportIDInternalServerErrorCode int = 500 - -/* -GetReportViolationsByReportIDInternalServerError A server error occurred - -swagger:response getReportViolationsByReportIdInternalServerError -*/ -type GetReportViolationsByReportIDInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetReportViolationsByReportIDInternalServerError creates GetReportViolationsByReportIDInternalServerError with default headers values -func NewGetReportViolationsByReportIDInternalServerError() *GetReportViolationsByReportIDInternalServerError { - - return &GetReportViolationsByReportIDInternalServerError{} -} - -// WithPayload adds the payload to the get report violations by report Id internal server error response -func (o *GetReportViolationsByReportIDInternalServerError) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get report violations by report Id internal server error response -func (o *GetReportViolationsByReportIDInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetReportViolationsByReportIDInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go deleted file mode 100644 index fd070cd59e5..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package report_violations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetReportViolationsByReportIDURL generates an URL for the get report violations by report ID operation -type GetReportViolationsByReportIDURL struct { - ReportID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetReportViolationsByReportIDURL) WithBasePath(bp string) *GetReportViolationsByReportIDURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetReportViolationsByReportIDURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetReportViolationsByReportIDURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/report-violations/{reportID}" - - reportID := o.ReportID.String() - if reportID != "" { - _path = strings.Replace(_path, "{reportID}", reportID, -1) - } else { - return nil, errors.New("reportId is required on GetReportViolationsByReportIDURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetReportViolationsByReportIDURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetReportViolationsByReportIDURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetReportViolationsByReportIDURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetReportViolationsByReportIDURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetReportViolationsByReportIDURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetReportViolationsByReportIDURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go deleted file mode 100644 index 3f0e0dab040..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ApproveSITExtensionHandlerFunc turns a function with the right signature into a approve s i t extension handler -type ApproveSITExtensionHandlerFunc func(ApproveSITExtensionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ApproveSITExtensionHandlerFunc) Handle(params ApproveSITExtensionParams) middleware.Responder { - return fn(params) -} - -// ApproveSITExtensionHandler interface for that can handle valid approve s i t extension params -type ApproveSITExtensionHandler interface { - Handle(ApproveSITExtensionParams) middleware.Responder -} - -// NewApproveSITExtension creates a new http.Handler for the approve s i t extension operation -func NewApproveSITExtension(ctx *middleware.Context, handler ApproveSITExtensionHandler) *ApproveSITExtension { - return &ApproveSITExtension{Context: ctx, Handler: handler} -} - -/* - ApproveSITExtension swagger:route PATCH /shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve shipment sitExtension approveSITExtension - -# Approves a SIT extension - -Approves a SIT extension -*/ -type ApproveSITExtension struct { - Context *middleware.Context - Handler ApproveSITExtensionHandler -} - -func (o *ApproveSITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewApproveSITExtensionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go deleted file mode 100644 index 6b42177e17a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewApproveSITExtensionParams creates a new ApproveSITExtensionParams object -// -// There are no default values defined in the spec. -func NewApproveSITExtensionParams() ApproveSITExtensionParams { - - return ApproveSITExtensionParams{} -} - -// ApproveSITExtensionParams contains all the bound params for the approve s i t extension operation -// typically these are obtained from a http.Request -// -// swagger:parameters approveSITExtension -type ApproveSITExtensionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.ApproveSITExtension - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID - /*ID of the SIT extension - Required: true - In: path - */ - SitExtensionID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewApproveSITExtensionParams() beforehand. -func (o *ApproveSITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.ApproveSITExtension - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rSitExtensionID, rhkSitExtensionID, _ := route.Params.GetOK("sitExtensionID") - if err := o.bindSitExtensionID(rSitExtensionID, rhkSitExtensionID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *ApproveSITExtensionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *ApproveSITExtensionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *ApproveSITExtensionParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindSitExtensionID binds and validates parameter SitExtensionID from path. -func (o *ApproveSITExtensionParams) bindSitExtensionID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("sitExtensionID", "path", "strfmt.UUID", raw) - } - o.SitExtensionID = *(value.(*strfmt.UUID)) - - if err := o.validateSitExtensionID(formats); err != nil { - return err - } - - return nil -} - -// validateSitExtensionID carries on validations for parameter SitExtensionID -func (o *ApproveSITExtensionParams) validateSitExtensionID(formats strfmt.Registry) error { - - if err := validate.FormatOf("sitExtensionID", "path", "uuid", o.SitExtensionID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go deleted file mode 100644 index 1f06dd73705..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ApproveSITExtensionOKCode is the HTTP code returned for type ApproveSITExtensionOK -const ApproveSITExtensionOKCode int = 200 - -/* -ApproveSITExtensionOK Successfully approved a SIT extension - -swagger:response approveSITExtensionOK -*/ -type ApproveSITExtensionOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewApproveSITExtensionOK creates ApproveSITExtensionOK with default headers values -func NewApproveSITExtensionOK() *ApproveSITExtensionOK { - - return &ApproveSITExtensionOK{} -} - -// WithPayload adds the payload to the approve s i t extension o k response -func (o *ApproveSITExtensionOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveSITExtensionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension o k response -func (o *ApproveSITExtensionOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionForbiddenCode is the HTTP code returned for type ApproveSITExtensionForbidden -const ApproveSITExtensionForbiddenCode int = 403 - -/* -ApproveSITExtensionForbidden The request was denied - -swagger:response approveSITExtensionForbidden -*/ -type ApproveSITExtensionForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveSITExtensionForbidden creates ApproveSITExtensionForbidden with default headers values -func NewApproveSITExtensionForbidden() *ApproveSITExtensionForbidden { - - return &ApproveSITExtensionForbidden{} -} - -// WithPayload adds the payload to the approve s i t extension forbidden response -func (o *ApproveSITExtensionForbidden) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension forbidden response -func (o *ApproveSITExtensionForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionNotFoundCode is the HTTP code returned for type ApproveSITExtensionNotFound -const ApproveSITExtensionNotFoundCode int = 404 - -/* -ApproveSITExtensionNotFound The requested resource wasn't found - -swagger:response approveSITExtensionNotFound -*/ -type ApproveSITExtensionNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveSITExtensionNotFound creates ApproveSITExtensionNotFound with default headers values -func NewApproveSITExtensionNotFound() *ApproveSITExtensionNotFound { - - return &ApproveSITExtensionNotFound{} -} - -// WithPayload adds the payload to the approve s i t extension not found response -func (o *ApproveSITExtensionNotFound) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension not found response -func (o *ApproveSITExtensionNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionConflictCode is the HTTP code returned for type ApproveSITExtensionConflict -const ApproveSITExtensionConflictCode int = 409 - -/* -ApproveSITExtensionConflict Conflict error - -swagger:response approveSITExtensionConflict -*/ -type ApproveSITExtensionConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveSITExtensionConflict creates ApproveSITExtensionConflict with default headers values -func NewApproveSITExtensionConflict() *ApproveSITExtensionConflict { - - return &ApproveSITExtensionConflict{} -} - -// WithPayload adds the payload to the approve s i t extension conflict response -func (o *ApproveSITExtensionConflict) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension conflict response -func (o *ApproveSITExtensionConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionPreconditionFailedCode is the HTTP code returned for type ApproveSITExtensionPreconditionFailed -const ApproveSITExtensionPreconditionFailedCode int = 412 - -/* -ApproveSITExtensionPreconditionFailed Precondition failed - -swagger:response approveSITExtensionPreconditionFailed -*/ -type ApproveSITExtensionPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveSITExtensionPreconditionFailed creates ApproveSITExtensionPreconditionFailed with default headers values -func NewApproveSITExtensionPreconditionFailed() *ApproveSITExtensionPreconditionFailed { - - return &ApproveSITExtensionPreconditionFailed{} -} - -// WithPayload adds the payload to the approve s i t extension precondition failed response -func (o *ApproveSITExtensionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension precondition failed response -func (o *ApproveSITExtensionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionUnprocessableEntityCode is the HTTP code returned for type ApproveSITExtensionUnprocessableEntity -const ApproveSITExtensionUnprocessableEntityCode int = 422 - -/* -ApproveSITExtensionUnprocessableEntity The payload was unprocessable. - -swagger:response approveSITExtensionUnprocessableEntity -*/ -type ApproveSITExtensionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewApproveSITExtensionUnprocessableEntity creates ApproveSITExtensionUnprocessableEntity with default headers values -func NewApproveSITExtensionUnprocessableEntity() *ApproveSITExtensionUnprocessableEntity { - - return &ApproveSITExtensionUnprocessableEntity{} -} - -// WithPayload adds the payload to the approve s i t extension unprocessable entity response -func (o *ApproveSITExtensionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveSITExtensionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension unprocessable entity response -func (o *ApproveSITExtensionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveSITExtensionInternalServerErrorCode is the HTTP code returned for type ApproveSITExtensionInternalServerError -const ApproveSITExtensionInternalServerErrorCode int = 500 - -/* -ApproveSITExtensionInternalServerError A server error occurred - -swagger:response approveSITExtensionInternalServerError -*/ -type ApproveSITExtensionInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveSITExtensionInternalServerError creates ApproveSITExtensionInternalServerError with default headers values -func NewApproveSITExtensionInternalServerError() *ApproveSITExtensionInternalServerError { - - return &ApproveSITExtensionInternalServerError{} -} - -// WithPayload adds the payload to the approve s i t extension internal server error response -func (o *ApproveSITExtensionInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve s i t extension internal server error response -func (o *ApproveSITExtensionInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveSITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go deleted file mode 100644 index b487d453b47..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ApproveSITExtensionURL generates an URL for the approve s i t extension operation -type ApproveSITExtensionURL struct { - ShipmentID strfmt.UUID - SitExtensionID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveSITExtensionURL) WithBasePath(bp string) *ApproveSITExtensionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveSITExtensionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ApproveSITExtensionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on ApproveSITExtensionURL") - } - - sitExtensionID := o.SitExtensionID.String() - if sitExtensionID != "" { - _path = strings.Replace(_path, "{sitExtensionID}", sitExtensionID, -1) - } else { - return nil, errors.New("sitExtensionId is required on ApproveSITExtensionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ApproveSITExtensionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ApproveSITExtensionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ApproveSITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ApproveSITExtensionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ApproveSITExtensionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ApproveSITExtensionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go deleted file mode 100644 index 619bd007cd9..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ApproveShipmentHandlerFunc turns a function with the right signature into a approve shipment handler -type ApproveShipmentHandlerFunc func(ApproveShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ApproveShipmentHandlerFunc) Handle(params ApproveShipmentParams) middleware.Responder { - return fn(params) -} - -// ApproveShipmentHandler interface for that can handle valid approve shipment params -type ApproveShipmentHandler interface { - Handle(ApproveShipmentParams) middleware.Responder -} - -// NewApproveShipment creates a new http.Handler for the approve shipment operation -func NewApproveShipment(ctx *middleware.Context, handler ApproveShipmentHandler) *ApproveShipment { - return &ApproveShipment{Context: ctx, Handler: handler} -} - -/* - ApproveShipment swagger:route POST /shipments/{shipmentID}/approve shipment approveShipment - -# Approves a shipment - -Approves a shipment -*/ -type ApproveShipment struct { - Context *middleware.Context - Handler ApproveShipmentHandler -} - -func (o *ApproveShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewApproveShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go deleted file mode 100644 index 63b48bd30dc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ApproveShipmentDiversionHandlerFunc turns a function with the right signature into a approve shipment diversion handler -type ApproveShipmentDiversionHandlerFunc func(ApproveShipmentDiversionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ApproveShipmentDiversionHandlerFunc) Handle(params ApproveShipmentDiversionParams) middleware.Responder { - return fn(params) -} - -// ApproveShipmentDiversionHandler interface for that can handle valid approve shipment diversion params -type ApproveShipmentDiversionHandler interface { - Handle(ApproveShipmentDiversionParams) middleware.Responder -} - -// NewApproveShipmentDiversion creates a new http.Handler for the approve shipment diversion operation -func NewApproveShipmentDiversion(ctx *middleware.Context, handler ApproveShipmentDiversionHandler) *ApproveShipmentDiversion { - return &ApproveShipmentDiversion{Context: ctx, Handler: handler} -} - -/* - ApproveShipmentDiversion swagger:route POST /shipments/{shipmentID}/approve-diversion shipment approveShipmentDiversion - -# Approves a shipment diversion - -Approves a shipment diversion -*/ -type ApproveShipmentDiversion struct { - Context *middleware.Context - Handler ApproveShipmentDiversionHandler -} - -func (o *ApproveShipmentDiversion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewApproveShipmentDiversionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go deleted file mode 100644 index 303b41dbcbe..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewApproveShipmentDiversionParams creates a new ApproveShipmentDiversionParams object -// -// There are no default values defined in the spec. -func NewApproveShipmentDiversionParams() ApproveShipmentDiversionParams { - - return ApproveShipmentDiversionParams{} -} - -// ApproveShipmentDiversionParams contains all the bound params for the approve shipment diversion operation -// typically these are obtained from a http.Request -// -// swagger:parameters approveShipmentDiversion -type ApproveShipmentDiversionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewApproveShipmentDiversionParams() beforehand. -func (o *ApproveShipmentDiversionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *ApproveShipmentDiversionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *ApproveShipmentDiversionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *ApproveShipmentDiversionParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go deleted file mode 100644 index b85cdd36c85..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ApproveShipmentDiversionOKCode is the HTTP code returned for type ApproveShipmentDiversionOK -const ApproveShipmentDiversionOKCode int = 200 - -/* -ApproveShipmentDiversionOK Successfully approved the shipment diversion - -swagger:response approveShipmentDiversionOK -*/ -type ApproveShipmentDiversionOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionOK creates ApproveShipmentDiversionOK with default headers values -func NewApproveShipmentDiversionOK() *ApproveShipmentDiversionOK { - - return &ApproveShipmentDiversionOK{} -} - -// WithPayload adds the payload to the approve shipment diversion o k response -func (o *ApproveShipmentDiversionOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveShipmentDiversionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion o k response -func (o *ApproveShipmentDiversionOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionForbiddenCode is the HTTP code returned for type ApproveShipmentDiversionForbidden -const ApproveShipmentDiversionForbiddenCode int = 403 - -/* -ApproveShipmentDiversionForbidden The request was denied - -swagger:response approveShipmentDiversionForbidden -*/ -type ApproveShipmentDiversionForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionForbidden creates ApproveShipmentDiversionForbidden with default headers values -func NewApproveShipmentDiversionForbidden() *ApproveShipmentDiversionForbidden { - - return &ApproveShipmentDiversionForbidden{} -} - -// WithPayload adds the payload to the approve shipment diversion forbidden response -func (o *ApproveShipmentDiversionForbidden) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion forbidden response -func (o *ApproveShipmentDiversionForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionNotFoundCode is the HTTP code returned for type ApproveShipmentDiversionNotFound -const ApproveShipmentDiversionNotFoundCode int = 404 - -/* -ApproveShipmentDiversionNotFound The requested resource wasn't found - -swagger:response approveShipmentDiversionNotFound -*/ -type ApproveShipmentDiversionNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionNotFound creates ApproveShipmentDiversionNotFound with default headers values -func NewApproveShipmentDiversionNotFound() *ApproveShipmentDiversionNotFound { - - return &ApproveShipmentDiversionNotFound{} -} - -// WithPayload adds the payload to the approve shipment diversion not found response -func (o *ApproveShipmentDiversionNotFound) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion not found response -func (o *ApproveShipmentDiversionNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionConflictCode is the HTTP code returned for type ApproveShipmentDiversionConflict -const ApproveShipmentDiversionConflictCode int = 409 - -/* -ApproveShipmentDiversionConflict Conflict error - -swagger:response approveShipmentDiversionConflict -*/ -type ApproveShipmentDiversionConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionConflict creates ApproveShipmentDiversionConflict with default headers values -func NewApproveShipmentDiversionConflict() *ApproveShipmentDiversionConflict { - - return &ApproveShipmentDiversionConflict{} -} - -// WithPayload adds the payload to the approve shipment diversion conflict response -func (o *ApproveShipmentDiversionConflict) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion conflict response -func (o *ApproveShipmentDiversionConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionPreconditionFailedCode is the HTTP code returned for type ApproveShipmentDiversionPreconditionFailed -const ApproveShipmentDiversionPreconditionFailedCode int = 412 - -/* -ApproveShipmentDiversionPreconditionFailed Precondition failed - -swagger:response approveShipmentDiversionPreconditionFailed -*/ -type ApproveShipmentDiversionPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionPreconditionFailed creates ApproveShipmentDiversionPreconditionFailed with default headers values -func NewApproveShipmentDiversionPreconditionFailed() *ApproveShipmentDiversionPreconditionFailed { - - return &ApproveShipmentDiversionPreconditionFailed{} -} - -// WithPayload adds the payload to the approve shipment diversion precondition failed response -func (o *ApproveShipmentDiversionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion precondition failed response -func (o *ApproveShipmentDiversionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionUnprocessableEntityCode is the HTTP code returned for type ApproveShipmentDiversionUnprocessableEntity -const ApproveShipmentDiversionUnprocessableEntityCode int = 422 - -/* -ApproveShipmentDiversionUnprocessableEntity The payload was unprocessable. - -swagger:response approveShipmentDiversionUnprocessableEntity -*/ -type ApproveShipmentDiversionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionUnprocessableEntity creates ApproveShipmentDiversionUnprocessableEntity with default headers values -func NewApproveShipmentDiversionUnprocessableEntity() *ApproveShipmentDiversionUnprocessableEntity { - - return &ApproveShipmentDiversionUnprocessableEntity{} -} - -// WithPayload adds the payload to the approve shipment diversion unprocessable entity response -func (o *ApproveShipmentDiversionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveShipmentDiversionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion unprocessable entity response -func (o *ApproveShipmentDiversionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentDiversionInternalServerErrorCode is the HTTP code returned for type ApproveShipmentDiversionInternalServerError -const ApproveShipmentDiversionInternalServerErrorCode int = 500 - -/* -ApproveShipmentDiversionInternalServerError A server error occurred - -swagger:response approveShipmentDiversionInternalServerError -*/ -type ApproveShipmentDiversionInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentDiversionInternalServerError creates ApproveShipmentDiversionInternalServerError with default headers values -func NewApproveShipmentDiversionInternalServerError() *ApproveShipmentDiversionInternalServerError { - - return &ApproveShipmentDiversionInternalServerError{} -} - -// WithPayload adds the payload to the approve shipment diversion internal server error response -func (o *ApproveShipmentDiversionInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment diversion internal server error response -func (o *ApproveShipmentDiversionInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentDiversionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go deleted file mode 100644 index 6b65d5179ee..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ApproveShipmentDiversionURL generates an URL for the approve shipment diversion operation -type ApproveShipmentDiversionURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveShipmentDiversionURL) WithBasePath(bp string) *ApproveShipmentDiversionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveShipmentDiversionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ApproveShipmentDiversionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/approve-diversion" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on ApproveShipmentDiversionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ApproveShipmentDiversionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ApproveShipmentDiversionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ApproveShipmentDiversionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ApproveShipmentDiversionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ApproveShipmentDiversionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ApproveShipmentDiversionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go deleted file mode 100644 index 1d3ce107f57..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewApproveShipmentParams creates a new ApproveShipmentParams object -// -// There are no default values defined in the spec. -func NewApproveShipmentParams() ApproveShipmentParams { - - return ApproveShipmentParams{} -} - -// ApproveShipmentParams contains all the bound params for the approve shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters approveShipment -type ApproveShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewApproveShipmentParams() beforehand. -func (o *ApproveShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *ApproveShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *ApproveShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *ApproveShipmentParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go deleted file mode 100644 index 1e9cbc2b79a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ApproveShipmentOKCode is the HTTP code returned for type ApproveShipmentOK -const ApproveShipmentOKCode int = 200 - -/* -ApproveShipmentOK Successfully approved the shipment - -swagger:response approveShipmentOK -*/ -type ApproveShipmentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewApproveShipmentOK creates ApproveShipmentOK with default headers values -func NewApproveShipmentOK() *ApproveShipmentOK { - - return &ApproveShipmentOK{} -} - -// WithPayload adds the payload to the approve shipment o k response -func (o *ApproveShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment o k response -func (o *ApproveShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentForbiddenCode is the HTTP code returned for type ApproveShipmentForbidden -const ApproveShipmentForbiddenCode int = 403 - -/* -ApproveShipmentForbidden The request was denied - -swagger:response approveShipmentForbidden -*/ -type ApproveShipmentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentForbidden creates ApproveShipmentForbidden with default headers values -func NewApproveShipmentForbidden() *ApproveShipmentForbidden { - - return &ApproveShipmentForbidden{} -} - -// WithPayload adds the payload to the approve shipment forbidden response -func (o *ApproveShipmentForbidden) WithPayload(payload *ghcmessages.Error) *ApproveShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment forbidden response -func (o *ApproveShipmentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentNotFoundCode is the HTTP code returned for type ApproveShipmentNotFound -const ApproveShipmentNotFoundCode int = 404 - -/* -ApproveShipmentNotFound The requested resource wasn't found - -swagger:response approveShipmentNotFound -*/ -type ApproveShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentNotFound creates ApproveShipmentNotFound with default headers values -func NewApproveShipmentNotFound() *ApproveShipmentNotFound { - - return &ApproveShipmentNotFound{} -} - -// WithPayload adds the payload to the approve shipment not found response -func (o *ApproveShipmentNotFound) WithPayload(payload *ghcmessages.Error) *ApproveShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment not found response -func (o *ApproveShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentConflictCode is the HTTP code returned for type ApproveShipmentConflict -const ApproveShipmentConflictCode int = 409 - -/* -ApproveShipmentConflict Conflict error - -swagger:response approveShipmentConflict -*/ -type ApproveShipmentConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentConflict creates ApproveShipmentConflict with default headers values -func NewApproveShipmentConflict() *ApproveShipmentConflict { - - return &ApproveShipmentConflict{} -} - -// WithPayload adds the payload to the approve shipment conflict response -func (o *ApproveShipmentConflict) WithPayload(payload *ghcmessages.Error) *ApproveShipmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment conflict response -func (o *ApproveShipmentConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentPreconditionFailedCode is the HTTP code returned for type ApproveShipmentPreconditionFailed -const ApproveShipmentPreconditionFailedCode int = 412 - -/* -ApproveShipmentPreconditionFailed Precondition failed - -swagger:response approveShipmentPreconditionFailed -*/ -type ApproveShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentPreconditionFailed creates ApproveShipmentPreconditionFailed with default headers values -func NewApproveShipmentPreconditionFailed() *ApproveShipmentPreconditionFailed { - - return &ApproveShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the approve shipment precondition failed response -func (o *ApproveShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment precondition failed response -func (o *ApproveShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentUnprocessableEntityCode is the HTTP code returned for type ApproveShipmentUnprocessableEntity -const ApproveShipmentUnprocessableEntityCode int = 422 - -/* -ApproveShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response approveShipmentUnprocessableEntity -*/ -type ApproveShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewApproveShipmentUnprocessableEntity creates ApproveShipmentUnprocessableEntity with default headers values -func NewApproveShipmentUnprocessableEntity() *ApproveShipmentUnprocessableEntity { - - return &ApproveShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the approve shipment unprocessable entity response -func (o *ApproveShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment unprocessable entity response -func (o *ApproveShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveShipmentInternalServerErrorCode is the HTTP code returned for type ApproveShipmentInternalServerError -const ApproveShipmentInternalServerErrorCode int = 500 - -/* -ApproveShipmentInternalServerError A server error occurred - -swagger:response approveShipmentInternalServerError -*/ -type ApproveShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewApproveShipmentInternalServerError creates ApproveShipmentInternalServerError with default headers values -func NewApproveShipmentInternalServerError() *ApproveShipmentInternalServerError { - - return &ApproveShipmentInternalServerError{} -} - -// WithPayload adds the payload to the approve shipment internal server error response -func (o *ApproveShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve shipment internal server error response -func (o *ApproveShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go deleted file mode 100644 index 973399fecdc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ApproveShipmentURL generates an URL for the approve shipment operation -type ApproveShipmentURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveShipmentURL) WithBasePath(bp string) *ApproveShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ApproveShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/approve" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on ApproveShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ApproveShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ApproveShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ApproveShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ApproveShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ApproveShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ApproveShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go deleted file mode 100644 index 7e69baf206f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateApprovedSITDurationUpdateHandlerFunc turns a function with the right signature into a create approved s i t duration update handler -type CreateApprovedSITDurationUpdateHandlerFunc func(CreateApprovedSITDurationUpdateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateApprovedSITDurationUpdateHandlerFunc) Handle(params CreateApprovedSITDurationUpdateParams) middleware.Responder { - return fn(params) -} - -// CreateApprovedSITDurationUpdateHandler interface for that can handle valid create approved s i t duration update params -type CreateApprovedSITDurationUpdateHandler interface { - Handle(CreateApprovedSITDurationUpdateParams) middleware.Responder -} - -// NewCreateApprovedSITDurationUpdate creates a new http.Handler for the create approved s i t duration update operation -func NewCreateApprovedSITDurationUpdate(ctx *middleware.Context, handler CreateApprovedSITDurationUpdateHandler) *CreateApprovedSITDurationUpdate { - return &CreateApprovedSITDurationUpdate{Context: ctx, Handler: handler} -} - -/* - CreateApprovedSITDurationUpdate swagger:route POST /shipments/{shipmentID}/sit-extensions shipment sitExtension createApprovedSITDurationUpdate - -# Create an approved SIT Duration Update - -TOO can creates an already-approved SIT Duration Update on behalf of a customer -*/ -type CreateApprovedSITDurationUpdate struct { - Context *middleware.Context - Handler CreateApprovedSITDurationUpdateHandler -} - -func (o *CreateApprovedSITDurationUpdate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateApprovedSITDurationUpdateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go deleted file mode 100644 index 6c9cf6b1660..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewCreateApprovedSITDurationUpdateParams creates a new CreateApprovedSITDurationUpdateParams object -// -// There are no default values defined in the spec. -func NewCreateApprovedSITDurationUpdateParams() CreateApprovedSITDurationUpdateParams { - - return CreateApprovedSITDurationUpdateParams{} -} - -// CreateApprovedSITDurationUpdateParams contains all the bound params for the create approved s i t duration update operation -// typically these are obtained from a http.Request -// -// swagger:parameters createApprovedSITDurationUpdate -type CreateApprovedSITDurationUpdateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.CreateApprovedSITDurationUpdate - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateApprovedSITDurationUpdateParams() beforehand. -func (o *CreateApprovedSITDurationUpdateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.CreateApprovedSITDurationUpdate - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *CreateApprovedSITDurationUpdateParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *CreateApprovedSITDurationUpdateParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *CreateApprovedSITDurationUpdateParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go deleted file mode 100644 index 8e3f3f6f2d7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateApprovedSITDurationUpdateOKCode is the HTTP code returned for type CreateApprovedSITDurationUpdateOK -const CreateApprovedSITDurationUpdateOKCode int = 200 - -/* -CreateApprovedSITDurationUpdateOK Successfully created a SIT Extension. - -swagger:response createApprovedSITDurationUpdateOK -*/ -type CreateApprovedSITDurationUpdateOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateOK creates CreateApprovedSITDurationUpdateOK with default headers values -func NewCreateApprovedSITDurationUpdateOK() *CreateApprovedSITDurationUpdateOK { - - return &CreateApprovedSITDurationUpdateOK{} -} - -// WithPayload adds the payload to the create approved s i t duration update o k response -func (o *CreateApprovedSITDurationUpdateOK) WithPayload(payload *ghcmessages.MTOShipment) *CreateApprovedSITDurationUpdateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update o k response -func (o *CreateApprovedSITDurationUpdateOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateApprovedSITDurationUpdateBadRequestCode is the HTTP code returned for type CreateApprovedSITDurationUpdateBadRequest -const CreateApprovedSITDurationUpdateBadRequestCode int = 400 - -/* -CreateApprovedSITDurationUpdateBadRequest The request payload is invalid - -swagger:response createApprovedSITDurationUpdateBadRequest -*/ -type CreateApprovedSITDurationUpdateBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateBadRequest creates CreateApprovedSITDurationUpdateBadRequest with default headers values -func NewCreateApprovedSITDurationUpdateBadRequest() *CreateApprovedSITDurationUpdateBadRequest { - - return &CreateApprovedSITDurationUpdateBadRequest{} -} - -// WithPayload adds the payload to the create approved s i t duration update bad request response -func (o *CreateApprovedSITDurationUpdateBadRequest) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update bad request response -func (o *CreateApprovedSITDurationUpdateBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateApprovedSITDurationUpdateForbiddenCode is the HTTP code returned for type CreateApprovedSITDurationUpdateForbidden -const CreateApprovedSITDurationUpdateForbiddenCode int = 403 - -/* -CreateApprovedSITDurationUpdateForbidden The request was denied - -swagger:response createApprovedSITDurationUpdateForbidden -*/ -type CreateApprovedSITDurationUpdateForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateForbidden creates CreateApprovedSITDurationUpdateForbidden with default headers values -func NewCreateApprovedSITDurationUpdateForbidden() *CreateApprovedSITDurationUpdateForbidden { - - return &CreateApprovedSITDurationUpdateForbidden{} -} - -// WithPayload adds the payload to the create approved s i t duration update forbidden response -func (o *CreateApprovedSITDurationUpdateForbidden) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update forbidden response -func (o *CreateApprovedSITDurationUpdateForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateApprovedSITDurationUpdateNotFoundCode is the HTTP code returned for type CreateApprovedSITDurationUpdateNotFound -const CreateApprovedSITDurationUpdateNotFoundCode int = 404 - -/* -CreateApprovedSITDurationUpdateNotFound The requested resource wasn't found - -swagger:response createApprovedSITDurationUpdateNotFound -*/ -type CreateApprovedSITDurationUpdateNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateNotFound creates CreateApprovedSITDurationUpdateNotFound with default headers values -func NewCreateApprovedSITDurationUpdateNotFound() *CreateApprovedSITDurationUpdateNotFound { - - return &CreateApprovedSITDurationUpdateNotFound{} -} - -// WithPayload adds the payload to the create approved s i t duration update not found response -func (o *CreateApprovedSITDurationUpdateNotFound) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update not found response -func (o *CreateApprovedSITDurationUpdateNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateApprovedSITDurationUpdateUnprocessableEntityCode is the HTTP code returned for type CreateApprovedSITDurationUpdateUnprocessableEntity -const CreateApprovedSITDurationUpdateUnprocessableEntityCode int = 422 - -/* -CreateApprovedSITDurationUpdateUnprocessableEntity The payload was unprocessable. - -swagger:response createApprovedSITDurationUpdateUnprocessableEntity -*/ -type CreateApprovedSITDurationUpdateUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateUnprocessableEntity creates CreateApprovedSITDurationUpdateUnprocessableEntity with default headers values -func NewCreateApprovedSITDurationUpdateUnprocessableEntity() *CreateApprovedSITDurationUpdateUnprocessableEntity { - - return &CreateApprovedSITDurationUpdateUnprocessableEntity{} -} - -// WithPayload adds the payload to the create approved s i t duration update unprocessable entity response -func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateApprovedSITDurationUpdateUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update unprocessable entity response -func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateApprovedSITDurationUpdateInternalServerErrorCode is the HTTP code returned for type CreateApprovedSITDurationUpdateInternalServerError -const CreateApprovedSITDurationUpdateInternalServerErrorCode int = 500 - -/* -CreateApprovedSITDurationUpdateInternalServerError A server error occurred - -swagger:response createApprovedSITDurationUpdateInternalServerError -*/ -type CreateApprovedSITDurationUpdateInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewCreateApprovedSITDurationUpdateInternalServerError creates CreateApprovedSITDurationUpdateInternalServerError with default headers values -func NewCreateApprovedSITDurationUpdateInternalServerError() *CreateApprovedSITDurationUpdateInternalServerError { - - return &CreateApprovedSITDurationUpdateInternalServerError{} -} - -// WithPayload adds the payload to the create approved s i t duration update internal server error response -func (o *CreateApprovedSITDurationUpdateInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create approved s i t duration update internal server error response -func (o *CreateApprovedSITDurationUpdateInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateApprovedSITDurationUpdateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go deleted file mode 100644 index 4366475a2cc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateApprovedSITDurationUpdateURL generates an URL for the create approved s i t duration update operation -type CreateApprovedSITDurationUpdateURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateApprovedSITDurationUpdateURL) WithBasePath(bp string) *CreateApprovedSITDurationUpdateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateApprovedSITDurationUpdateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateApprovedSITDurationUpdateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/sit-extensions" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on CreateApprovedSITDurationUpdateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateApprovedSITDurationUpdateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateApprovedSITDurationUpdateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateApprovedSITDurationUpdateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateApprovedSITDurationUpdateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateApprovedSITDurationUpdateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateApprovedSITDurationUpdateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go deleted file mode 100644 index a030f176181..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteShipmentHandlerFunc turns a function with the right signature into a delete shipment handler -type DeleteShipmentHandlerFunc func(DeleteShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteShipmentHandlerFunc) Handle(params DeleteShipmentParams) middleware.Responder { - return fn(params) -} - -// DeleteShipmentHandler interface for that can handle valid delete shipment params -type DeleteShipmentHandler interface { - Handle(DeleteShipmentParams) middleware.Responder -} - -// NewDeleteShipment creates a new http.Handler for the delete shipment operation -func NewDeleteShipment(ctx *middleware.Context, handler DeleteShipmentHandler) *DeleteShipment { - return &DeleteShipment{Context: ctx, Handler: handler} -} - -/* - DeleteShipment swagger:route DELETE /shipments/{shipmentID} shipment deleteShipment - -# Soft deletes a shipment by ID - -Soft deletes a shipment by ID -*/ -type DeleteShipment struct { - Context *middleware.Context - Handler DeleteShipmentHandler -} - -func (o *DeleteShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go deleted file mode 100644 index 08bc880b2c0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteShipmentParams creates a new DeleteShipmentParams object -// -// There are no default values defined in the spec. -func NewDeleteShipmentParams() DeleteShipmentParams { - - return DeleteShipmentParams{} -} - -// DeleteShipmentParams contains all the bound params for the delete shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteShipment -type DeleteShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the shipment to be deleted - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteShipmentParams() beforehand. -func (o *DeleteShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *DeleteShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *DeleteShipmentParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go deleted file mode 100644 index fe39e60931b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DeleteShipmentNoContentCode is the HTTP code returned for type DeleteShipmentNoContent -const DeleteShipmentNoContentCode int = 204 - -/* -DeleteShipmentNoContent Successfully soft deleted the shipment - -swagger:response deleteShipmentNoContent -*/ -type DeleteShipmentNoContent struct { -} - -// NewDeleteShipmentNoContent creates DeleteShipmentNoContent with default headers values -func NewDeleteShipmentNoContent() *DeleteShipmentNoContent { - - return &DeleteShipmentNoContent{} -} - -// WriteResponse to the client -func (o *DeleteShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteShipmentBadRequestCode is the HTTP code returned for type DeleteShipmentBadRequest -const DeleteShipmentBadRequestCode int = 400 - -/* -DeleteShipmentBadRequest The request payload is invalid - -swagger:response deleteShipmentBadRequest -*/ -type DeleteShipmentBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentBadRequest creates DeleteShipmentBadRequest with default headers values -func NewDeleteShipmentBadRequest() *DeleteShipmentBadRequest { - - return &DeleteShipmentBadRequest{} -} - -// WithPayload adds the payload to the delete shipment bad request response -func (o *DeleteShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment bad request response -func (o *DeleteShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentForbiddenCode is the HTTP code returned for type DeleteShipmentForbidden -const DeleteShipmentForbiddenCode int = 403 - -/* -DeleteShipmentForbidden The request was denied - -swagger:response deleteShipmentForbidden -*/ -type DeleteShipmentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentForbidden creates DeleteShipmentForbidden with default headers values -func NewDeleteShipmentForbidden() *DeleteShipmentForbidden { - - return &DeleteShipmentForbidden{} -} - -// WithPayload adds the payload to the delete shipment forbidden response -func (o *DeleteShipmentForbidden) WithPayload(payload *ghcmessages.Error) *DeleteShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment forbidden response -func (o *DeleteShipmentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentNotFoundCode is the HTTP code returned for type DeleteShipmentNotFound -const DeleteShipmentNotFoundCode int = 404 - -/* -DeleteShipmentNotFound The requested resource wasn't found - -swagger:response deleteShipmentNotFound -*/ -type DeleteShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentNotFound creates DeleteShipmentNotFound with default headers values -func NewDeleteShipmentNotFound() *DeleteShipmentNotFound { - - return &DeleteShipmentNotFound{} -} - -// WithPayload adds the payload to the delete shipment not found response -func (o *DeleteShipmentNotFound) WithPayload(payload *ghcmessages.Error) *DeleteShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment not found response -func (o *DeleteShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentConflictCode is the HTTP code returned for type DeleteShipmentConflict -const DeleteShipmentConflictCode int = 409 - -/* -DeleteShipmentConflict Conflict error - -swagger:response deleteShipmentConflict -*/ -type DeleteShipmentConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentConflict creates DeleteShipmentConflict with default headers values -func NewDeleteShipmentConflict() *DeleteShipmentConflict { - - return &DeleteShipmentConflict{} -} - -// WithPayload adds the payload to the delete shipment conflict response -func (o *DeleteShipmentConflict) WithPayload(payload *ghcmessages.Error) *DeleteShipmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment conflict response -func (o *DeleteShipmentConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteShipmentUnprocessableEntity -const DeleteShipmentUnprocessableEntityCode int = 422 - -/* -DeleteShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response deleteShipmentUnprocessableEntity -*/ -type DeleteShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteShipmentUnprocessableEntity creates DeleteShipmentUnprocessableEntity with default headers values -func NewDeleteShipmentUnprocessableEntity() *DeleteShipmentUnprocessableEntity { - - return &DeleteShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete shipment unprocessable entity response -func (o *DeleteShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment unprocessable entity response -func (o *DeleteShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentInternalServerErrorCode is the HTTP code returned for type DeleteShipmentInternalServerError -const DeleteShipmentInternalServerErrorCode int = 500 - -/* -DeleteShipmentInternalServerError A server error occurred - -swagger:response deleteShipmentInternalServerError -*/ -type DeleteShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentInternalServerError creates DeleteShipmentInternalServerError with default headers values -func NewDeleteShipmentInternalServerError() *DeleteShipmentInternalServerError { - - return &DeleteShipmentInternalServerError{} -} - -// WithPayload adds the payload to the delete shipment internal server error response -func (o *DeleteShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment internal server error response -func (o *DeleteShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go deleted file mode 100644 index 6440e1fc6bc..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteShipmentURL generates an URL for the delete shipment operation -type DeleteShipmentURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteShipmentURL) WithBasePath(bp string) *DeleteShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on DeleteShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go deleted file mode 100644 index 84541c09914..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DenySITExtensionHandlerFunc turns a function with the right signature into a deny s i t extension handler -type DenySITExtensionHandlerFunc func(DenySITExtensionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DenySITExtensionHandlerFunc) Handle(params DenySITExtensionParams) middleware.Responder { - return fn(params) -} - -// DenySITExtensionHandler interface for that can handle valid deny s i t extension params -type DenySITExtensionHandler interface { - Handle(DenySITExtensionParams) middleware.Responder -} - -// NewDenySITExtension creates a new http.Handler for the deny s i t extension operation -func NewDenySITExtension(ctx *middleware.Context, handler DenySITExtensionHandler) *DenySITExtension { - return &DenySITExtension{Context: ctx, Handler: handler} -} - -/* - DenySITExtension swagger:route PATCH /shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny shipment sitExtension denySITExtension - -# Denies a SIT extension - -Denies a SIT extension -*/ -type DenySITExtension struct { - Context *middleware.Context - Handler DenySITExtensionHandler -} - -func (o *DenySITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDenySITExtensionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go deleted file mode 100644 index 5a4faeea715..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go +++ /dev/null @@ -1,200 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewDenySITExtensionParams creates a new DenySITExtensionParams object -// -// There are no default values defined in the spec. -func NewDenySITExtensionParams() DenySITExtensionParams { - - return DenySITExtensionParams{} -} - -// DenySITExtensionParams contains all the bound params for the deny s i t extension operation -// typically these are obtained from a http.Request -// -// swagger:parameters denySITExtension -type DenySITExtensionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.DenySITExtension - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID - /*ID of the SIT extension - Required: true - In: path - */ - SitExtensionID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDenySITExtensionParams() beforehand. -func (o *DenySITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.DenySITExtension - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rSitExtensionID, rhkSitExtensionID, _ := route.Params.GetOK("sitExtensionID") - if err := o.bindSitExtensionID(rSitExtensionID, rhkSitExtensionID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *DenySITExtensionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *DenySITExtensionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *DenySITExtensionParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindSitExtensionID binds and validates parameter SitExtensionID from path. -func (o *DenySITExtensionParams) bindSitExtensionID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("sitExtensionID", "path", "strfmt.UUID", raw) - } - o.SitExtensionID = *(value.(*strfmt.UUID)) - - if err := o.validateSitExtensionID(formats); err != nil { - return err - } - - return nil -} - -// validateSitExtensionID carries on validations for parameter SitExtensionID -func (o *DenySITExtensionParams) validateSitExtensionID(formats strfmt.Registry) error { - - if err := validate.FormatOf("sitExtensionID", "path", "uuid", o.SitExtensionID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go deleted file mode 100644 index 9a71d77ef32..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DenySITExtensionOKCode is the HTTP code returned for type DenySITExtensionOK -const DenySITExtensionOKCode int = 200 - -/* -DenySITExtensionOK Successfully denied a SIT extension - -swagger:response denySITExtensionOK -*/ -type DenySITExtensionOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewDenySITExtensionOK creates DenySITExtensionOK with default headers values -func NewDenySITExtensionOK() *DenySITExtensionOK { - - return &DenySITExtensionOK{} -} - -// WithPayload adds the payload to the deny s i t extension o k response -func (o *DenySITExtensionOK) WithPayload(payload *ghcmessages.MTOShipment) *DenySITExtensionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension o k response -func (o *DenySITExtensionOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionForbiddenCode is the HTTP code returned for type DenySITExtensionForbidden -const DenySITExtensionForbiddenCode int = 403 - -/* -DenySITExtensionForbidden The request was denied - -swagger:response denySITExtensionForbidden -*/ -type DenySITExtensionForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDenySITExtensionForbidden creates DenySITExtensionForbidden with default headers values -func NewDenySITExtensionForbidden() *DenySITExtensionForbidden { - - return &DenySITExtensionForbidden{} -} - -// WithPayload adds the payload to the deny s i t extension forbidden response -func (o *DenySITExtensionForbidden) WithPayload(payload *ghcmessages.Error) *DenySITExtensionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension forbidden response -func (o *DenySITExtensionForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionNotFoundCode is the HTTP code returned for type DenySITExtensionNotFound -const DenySITExtensionNotFoundCode int = 404 - -/* -DenySITExtensionNotFound The requested resource wasn't found - -swagger:response denySITExtensionNotFound -*/ -type DenySITExtensionNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDenySITExtensionNotFound creates DenySITExtensionNotFound with default headers values -func NewDenySITExtensionNotFound() *DenySITExtensionNotFound { - - return &DenySITExtensionNotFound{} -} - -// WithPayload adds the payload to the deny s i t extension not found response -func (o *DenySITExtensionNotFound) WithPayload(payload *ghcmessages.Error) *DenySITExtensionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension not found response -func (o *DenySITExtensionNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionConflictCode is the HTTP code returned for type DenySITExtensionConflict -const DenySITExtensionConflictCode int = 409 - -/* -DenySITExtensionConflict Conflict error - -swagger:response denySITExtensionConflict -*/ -type DenySITExtensionConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDenySITExtensionConflict creates DenySITExtensionConflict with default headers values -func NewDenySITExtensionConflict() *DenySITExtensionConflict { - - return &DenySITExtensionConflict{} -} - -// WithPayload adds the payload to the deny s i t extension conflict response -func (o *DenySITExtensionConflict) WithPayload(payload *ghcmessages.Error) *DenySITExtensionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension conflict response -func (o *DenySITExtensionConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionPreconditionFailedCode is the HTTP code returned for type DenySITExtensionPreconditionFailed -const DenySITExtensionPreconditionFailedCode int = 412 - -/* -DenySITExtensionPreconditionFailed Precondition failed - -swagger:response denySITExtensionPreconditionFailed -*/ -type DenySITExtensionPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDenySITExtensionPreconditionFailed creates DenySITExtensionPreconditionFailed with default headers values -func NewDenySITExtensionPreconditionFailed() *DenySITExtensionPreconditionFailed { - - return &DenySITExtensionPreconditionFailed{} -} - -// WithPayload adds the payload to the deny s i t extension precondition failed response -func (o *DenySITExtensionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *DenySITExtensionPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension precondition failed response -func (o *DenySITExtensionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionUnprocessableEntityCode is the HTTP code returned for type DenySITExtensionUnprocessableEntity -const DenySITExtensionUnprocessableEntityCode int = 422 - -/* -DenySITExtensionUnprocessableEntity The payload was unprocessable. - -swagger:response denySITExtensionUnprocessableEntity -*/ -type DenySITExtensionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewDenySITExtensionUnprocessableEntity creates DenySITExtensionUnprocessableEntity with default headers values -func NewDenySITExtensionUnprocessableEntity() *DenySITExtensionUnprocessableEntity { - - return &DenySITExtensionUnprocessableEntity{} -} - -// WithPayload adds the payload to the deny s i t extension unprocessable entity response -func (o *DenySITExtensionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DenySITExtensionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension unprocessable entity response -func (o *DenySITExtensionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DenySITExtensionInternalServerErrorCode is the HTTP code returned for type DenySITExtensionInternalServerError -const DenySITExtensionInternalServerErrorCode int = 500 - -/* -DenySITExtensionInternalServerError A server error occurred - -swagger:response denySITExtensionInternalServerError -*/ -type DenySITExtensionInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewDenySITExtensionInternalServerError creates DenySITExtensionInternalServerError with default headers values -func NewDenySITExtensionInternalServerError() *DenySITExtensionInternalServerError { - - return &DenySITExtensionInternalServerError{} -} - -// WithPayload adds the payload to the deny s i t extension internal server error response -func (o *DenySITExtensionInternalServerError) WithPayload(payload *ghcmessages.Error) *DenySITExtensionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the deny s i t extension internal server error response -func (o *DenySITExtensionInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DenySITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go deleted file mode 100644 index d1c2628bad0..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DenySITExtensionURL generates an URL for the deny s i t extension operation -type DenySITExtensionURL struct { - ShipmentID strfmt.UUID - SitExtensionID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DenySITExtensionURL) WithBasePath(bp string) *DenySITExtensionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DenySITExtensionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DenySITExtensionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on DenySITExtensionURL") - } - - sitExtensionID := o.SitExtensionID.String() - if sitExtensionID != "" { - _path = strings.Replace(_path, "{sitExtensionID}", sitExtensionID, -1) - } else { - return nil, errors.New("sitExtensionId is required on DenySITExtensionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DenySITExtensionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DenySITExtensionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DenySITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DenySITExtensionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DenySITExtensionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DenySITExtensionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go deleted file mode 100644 index 091eb60c5d8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RejectShipmentHandlerFunc turns a function with the right signature into a reject shipment handler -type RejectShipmentHandlerFunc func(RejectShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RejectShipmentHandlerFunc) Handle(params RejectShipmentParams) middleware.Responder { - return fn(params) -} - -// RejectShipmentHandler interface for that can handle valid reject shipment params -type RejectShipmentHandler interface { - Handle(RejectShipmentParams) middleware.Responder -} - -// NewRejectShipment creates a new http.Handler for the reject shipment operation -func NewRejectShipment(ctx *middleware.Context, handler RejectShipmentHandler) *RejectShipment { - return &RejectShipment{Context: ctx, Handler: handler} -} - -/* - RejectShipment swagger:route POST /shipments/{shipmentID}/reject shipment rejectShipment - -rejects a shipment - -rejects a shipment -*/ -type RejectShipment struct { - Context *middleware.Context - Handler RejectShipmentHandler -} - -func (o *RejectShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRejectShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go deleted file mode 100644 index a4ac8d82304..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewRejectShipmentParams creates a new RejectShipmentParams object -// -// There are no default values defined in the spec. -func NewRejectShipmentParams() RejectShipmentParams { - - return RejectShipmentParams{} -} - -// RejectShipmentParams contains all the bound params for the reject shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters rejectShipment -type RejectShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.RejectShipment - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRejectShipmentParams() beforehand. -func (o *RejectShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.RejectShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *RejectShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *RejectShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *RejectShipmentParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go deleted file mode 100644 index e28b2f38671..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// RejectShipmentOKCode is the HTTP code returned for type RejectShipmentOK -const RejectShipmentOKCode int = 200 - -/* -RejectShipmentOK Successfully rejected the shipment - -swagger:response rejectShipmentOK -*/ -type RejectShipmentOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewRejectShipmentOK creates RejectShipmentOK with default headers values -func NewRejectShipmentOK() *RejectShipmentOK { - - return &RejectShipmentOK{} -} - -// WithPayload adds the payload to the reject shipment o k response -func (o *RejectShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *RejectShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment o k response -func (o *RejectShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentForbiddenCode is the HTTP code returned for type RejectShipmentForbidden -const RejectShipmentForbiddenCode int = 403 - -/* -RejectShipmentForbidden The request was denied - -swagger:response rejectShipmentForbidden -*/ -type RejectShipmentForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRejectShipmentForbidden creates RejectShipmentForbidden with default headers values -func NewRejectShipmentForbidden() *RejectShipmentForbidden { - - return &RejectShipmentForbidden{} -} - -// WithPayload adds the payload to the reject shipment forbidden response -func (o *RejectShipmentForbidden) WithPayload(payload *ghcmessages.Error) *RejectShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment forbidden response -func (o *RejectShipmentForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentNotFoundCode is the HTTP code returned for type RejectShipmentNotFound -const RejectShipmentNotFoundCode int = 404 - -/* -RejectShipmentNotFound The requested resource wasn't found - -swagger:response rejectShipmentNotFound -*/ -type RejectShipmentNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRejectShipmentNotFound creates RejectShipmentNotFound with default headers values -func NewRejectShipmentNotFound() *RejectShipmentNotFound { - - return &RejectShipmentNotFound{} -} - -// WithPayload adds the payload to the reject shipment not found response -func (o *RejectShipmentNotFound) WithPayload(payload *ghcmessages.Error) *RejectShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment not found response -func (o *RejectShipmentNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentConflictCode is the HTTP code returned for type RejectShipmentConflict -const RejectShipmentConflictCode int = 409 - -/* -RejectShipmentConflict Conflict error - -swagger:response rejectShipmentConflict -*/ -type RejectShipmentConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRejectShipmentConflict creates RejectShipmentConflict with default headers values -func NewRejectShipmentConflict() *RejectShipmentConflict { - - return &RejectShipmentConflict{} -} - -// WithPayload adds the payload to the reject shipment conflict response -func (o *RejectShipmentConflict) WithPayload(payload *ghcmessages.Error) *RejectShipmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment conflict response -func (o *RejectShipmentConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentPreconditionFailedCode is the HTTP code returned for type RejectShipmentPreconditionFailed -const RejectShipmentPreconditionFailedCode int = 412 - -/* -RejectShipmentPreconditionFailed Precondition failed - -swagger:response rejectShipmentPreconditionFailed -*/ -type RejectShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRejectShipmentPreconditionFailed creates RejectShipmentPreconditionFailed with default headers values -func NewRejectShipmentPreconditionFailed() *RejectShipmentPreconditionFailed { - - return &RejectShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the reject shipment precondition failed response -func (o *RejectShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RejectShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment precondition failed response -func (o *RejectShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentUnprocessableEntityCode is the HTTP code returned for type RejectShipmentUnprocessableEntity -const RejectShipmentUnprocessableEntityCode int = 422 - -/* -RejectShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response rejectShipmentUnprocessableEntity -*/ -type RejectShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewRejectShipmentUnprocessableEntity creates RejectShipmentUnprocessableEntity with default headers values -func NewRejectShipmentUnprocessableEntity() *RejectShipmentUnprocessableEntity { - - return &RejectShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the reject shipment unprocessable entity response -func (o *RejectShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RejectShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment unprocessable entity response -func (o *RejectShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RejectShipmentInternalServerErrorCode is the HTTP code returned for type RejectShipmentInternalServerError -const RejectShipmentInternalServerErrorCode int = 500 - -/* -RejectShipmentInternalServerError A server error occurred - -swagger:response rejectShipmentInternalServerError -*/ -type RejectShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRejectShipmentInternalServerError creates RejectShipmentInternalServerError with default headers values -func NewRejectShipmentInternalServerError() *RejectShipmentInternalServerError { - - return &RejectShipmentInternalServerError{} -} - -// WithPayload adds the payload to the reject shipment internal server error response -func (o *RejectShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *RejectShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the reject shipment internal server error response -func (o *RejectShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RejectShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go deleted file mode 100644 index 31e58a094a2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RejectShipmentURL generates an URL for the reject shipment operation -type RejectShipmentURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RejectShipmentURL) WithBasePath(bp string) *RejectShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RejectShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RejectShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/reject" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on RejectShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RejectShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RejectShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RejectShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RejectShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RejectShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RejectShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go deleted file mode 100644 index 552850bb41f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RequestShipmentCancellationHandlerFunc turns a function with the right signature into a request shipment cancellation handler -type RequestShipmentCancellationHandlerFunc func(RequestShipmentCancellationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RequestShipmentCancellationHandlerFunc) Handle(params RequestShipmentCancellationParams) middleware.Responder { - return fn(params) -} - -// RequestShipmentCancellationHandler interface for that can handle valid request shipment cancellation params -type RequestShipmentCancellationHandler interface { - Handle(RequestShipmentCancellationParams) middleware.Responder -} - -// NewRequestShipmentCancellation creates a new http.Handler for the request shipment cancellation operation -func NewRequestShipmentCancellation(ctx *middleware.Context, handler RequestShipmentCancellationHandler) *RequestShipmentCancellation { - return &RequestShipmentCancellation{Context: ctx, Handler: handler} -} - -/* - RequestShipmentCancellation swagger:route POST /shipments/{shipmentID}/request-cancellation shipment requestShipmentCancellation - -# Requests a shipment cancellation - -Requests a shipment cancellation -*/ -type RequestShipmentCancellation struct { - Context *middleware.Context - Handler RequestShipmentCancellationHandler -} - -func (o *RequestShipmentCancellation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRequestShipmentCancellationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go deleted file mode 100644 index 1a38c9bc5f2..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go +++ /dev/null @@ -1,120 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewRequestShipmentCancellationParams creates a new RequestShipmentCancellationParams object -// -// There are no default values defined in the spec. -func NewRequestShipmentCancellationParams() RequestShipmentCancellationParams { - - return RequestShipmentCancellationParams{} -} - -// RequestShipmentCancellationParams contains all the bound params for the request shipment cancellation operation -// typically these are obtained from a http.Request -// -// swagger:parameters requestShipmentCancellation -type RequestShipmentCancellationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRequestShipmentCancellationParams() beforehand. -func (o *RequestShipmentCancellationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *RequestShipmentCancellationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *RequestShipmentCancellationParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *RequestShipmentCancellationParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go deleted file mode 100644 index 995adf82acb..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// RequestShipmentCancellationOKCode is the HTTP code returned for type RequestShipmentCancellationOK -const RequestShipmentCancellationOKCode int = 200 - -/* -RequestShipmentCancellationOK Successfully requested the shipment cancellation - -swagger:response requestShipmentCancellationOK -*/ -type RequestShipmentCancellationOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationOK creates RequestShipmentCancellationOK with default headers values -func NewRequestShipmentCancellationOK() *RequestShipmentCancellationOK { - - return &RequestShipmentCancellationOK{} -} - -// WithPayload adds the payload to the request shipment cancellation o k response -func (o *RequestShipmentCancellationOK) WithPayload(payload *ghcmessages.MTOShipment) *RequestShipmentCancellationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation o k response -func (o *RequestShipmentCancellationOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationForbiddenCode is the HTTP code returned for type RequestShipmentCancellationForbidden -const RequestShipmentCancellationForbiddenCode int = 403 - -/* -RequestShipmentCancellationForbidden The request was denied - -swagger:response requestShipmentCancellationForbidden -*/ -type RequestShipmentCancellationForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationForbidden creates RequestShipmentCancellationForbidden with default headers values -func NewRequestShipmentCancellationForbidden() *RequestShipmentCancellationForbidden { - - return &RequestShipmentCancellationForbidden{} -} - -// WithPayload adds the payload to the request shipment cancellation forbidden response -func (o *RequestShipmentCancellationForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation forbidden response -func (o *RequestShipmentCancellationForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationNotFoundCode is the HTTP code returned for type RequestShipmentCancellationNotFound -const RequestShipmentCancellationNotFoundCode int = 404 - -/* -RequestShipmentCancellationNotFound The requested resource wasn't found - -swagger:response requestShipmentCancellationNotFound -*/ -type RequestShipmentCancellationNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationNotFound creates RequestShipmentCancellationNotFound with default headers values -func NewRequestShipmentCancellationNotFound() *RequestShipmentCancellationNotFound { - - return &RequestShipmentCancellationNotFound{} -} - -// WithPayload adds the payload to the request shipment cancellation not found response -func (o *RequestShipmentCancellationNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation not found response -func (o *RequestShipmentCancellationNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationConflictCode is the HTTP code returned for type RequestShipmentCancellationConflict -const RequestShipmentCancellationConflictCode int = 409 - -/* -RequestShipmentCancellationConflict Conflict error - -swagger:response requestShipmentCancellationConflict -*/ -type RequestShipmentCancellationConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationConflict creates RequestShipmentCancellationConflict with default headers values -func NewRequestShipmentCancellationConflict() *RequestShipmentCancellationConflict { - - return &RequestShipmentCancellationConflict{} -} - -// WithPayload adds the payload to the request shipment cancellation conflict response -func (o *RequestShipmentCancellationConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation conflict response -func (o *RequestShipmentCancellationConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationPreconditionFailedCode is the HTTP code returned for type RequestShipmentCancellationPreconditionFailed -const RequestShipmentCancellationPreconditionFailedCode int = 412 - -/* -RequestShipmentCancellationPreconditionFailed Precondition failed - -swagger:response requestShipmentCancellationPreconditionFailed -*/ -type RequestShipmentCancellationPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationPreconditionFailed creates RequestShipmentCancellationPreconditionFailed with default headers values -func NewRequestShipmentCancellationPreconditionFailed() *RequestShipmentCancellationPreconditionFailed { - - return &RequestShipmentCancellationPreconditionFailed{} -} - -// WithPayload adds the payload to the request shipment cancellation precondition failed response -func (o *RequestShipmentCancellationPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation precondition failed response -func (o *RequestShipmentCancellationPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationUnprocessableEntityCode is the HTTP code returned for type RequestShipmentCancellationUnprocessableEntity -const RequestShipmentCancellationUnprocessableEntityCode int = 422 - -/* -RequestShipmentCancellationUnprocessableEntity The payload was unprocessable. - -swagger:response requestShipmentCancellationUnprocessableEntity -*/ -type RequestShipmentCancellationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationUnprocessableEntity creates RequestShipmentCancellationUnprocessableEntity with default headers values -func NewRequestShipmentCancellationUnprocessableEntity() *RequestShipmentCancellationUnprocessableEntity { - - return &RequestShipmentCancellationUnprocessableEntity{} -} - -// WithPayload adds the payload to the request shipment cancellation unprocessable entity response -func (o *RequestShipmentCancellationUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentCancellationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation unprocessable entity response -func (o *RequestShipmentCancellationUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentCancellationInternalServerErrorCode is the HTTP code returned for type RequestShipmentCancellationInternalServerError -const RequestShipmentCancellationInternalServerErrorCode int = 500 - -/* -RequestShipmentCancellationInternalServerError A server error occurred - -swagger:response requestShipmentCancellationInternalServerError -*/ -type RequestShipmentCancellationInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentCancellationInternalServerError creates RequestShipmentCancellationInternalServerError with default headers values -func NewRequestShipmentCancellationInternalServerError() *RequestShipmentCancellationInternalServerError { - - return &RequestShipmentCancellationInternalServerError{} -} - -// WithPayload adds the payload to the request shipment cancellation internal server error response -func (o *RequestShipmentCancellationInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment cancellation internal server error response -func (o *RequestShipmentCancellationInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentCancellationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go deleted file mode 100644 index 2b947e2b49d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RequestShipmentCancellationURL generates an URL for the request shipment cancellation operation -type RequestShipmentCancellationURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentCancellationURL) WithBasePath(bp string) *RequestShipmentCancellationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentCancellationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RequestShipmentCancellationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/request-cancellation" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on RequestShipmentCancellationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RequestShipmentCancellationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RequestShipmentCancellationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RequestShipmentCancellationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RequestShipmentCancellationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RequestShipmentCancellationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RequestShipmentCancellationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go deleted file mode 100644 index ec62c5ea289..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RequestShipmentDiversionHandlerFunc turns a function with the right signature into a request shipment diversion handler -type RequestShipmentDiversionHandlerFunc func(RequestShipmentDiversionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RequestShipmentDiversionHandlerFunc) Handle(params RequestShipmentDiversionParams) middleware.Responder { - return fn(params) -} - -// RequestShipmentDiversionHandler interface for that can handle valid request shipment diversion params -type RequestShipmentDiversionHandler interface { - Handle(RequestShipmentDiversionParams) middleware.Responder -} - -// NewRequestShipmentDiversion creates a new http.Handler for the request shipment diversion operation -func NewRequestShipmentDiversion(ctx *middleware.Context, handler RequestShipmentDiversionHandler) *RequestShipmentDiversion { - return &RequestShipmentDiversion{Context: ctx, Handler: handler} -} - -/* - RequestShipmentDiversion swagger:route POST /shipments/{shipmentID}/request-diversion shipment requestShipmentDiversion - -# Requests a shipment diversion - -Requests a shipment diversion -*/ -type RequestShipmentDiversion struct { - Context *middleware.Context - Handler RequestShipmentDiversionHandler -} - -func (o *RequestShipmentDiversion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRequestShipmentDiversionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go deleted file mode 100644 index 8bc676c850a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewRequestShipmentDiversionParams creates a new RequestShipmentDiversionParams object -// -// There are no default values defined in the spec. -func NewRequestShipmentDiversionParams() RequestShipmentDiversionParams { - - return RequestShipmentDiversionParams{} -} - -// RequestShipmentDiversionParams contains all the bound params for the request shipment diversion operation -// typically these are obtained from a http.Request -// -// swagger:parameters requestShipmentDiversion -type RequestShipmentDiversionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.RequestDiversion - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRequestShipmentDiversionParams() beforehand. -func (o *RequestShipmentDiversionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.RequestDiversion - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *RequestShipmentDiversionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *RequestShipmentDiversionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *RequestShipmentDiversionParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go deleted file mode 100644 index aa563d4d6aa..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// RequestShipmentDiversionOKCode is the HTTP code returned for type RequestShipmentDiversionOK -const RequestShipmentDiversionOKCode int = 200 - -/* -RequestShipmentDiversionOK Successfully requested the shipment diversion - -swagger:response requestShipmentDiversionOK -*/ -type RequestShipmentDiversionOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionOK creates RequestShipmentDiversionOK with default headers values -func NewRequestShipmentDiversionOK() *RequestShipmentDiversionOK { - - return &RequestShipmentDiversionOK{} -} - -// WithPayload adds the payload to the request shipment diversion o k response -func (o *RequestShipmentDiversionOK) WithPayload(payload *ghcmessages.MTOShipment) *RequestShipmentDiversionOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion o k response -func (o *RequestShipmentDiversionOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionForbiddenCode is the HTTP code returned for type RequestShipmentDiversionForbidden -const RequestShipmentDiversionForbiddenCode int = 403 - -/* -RequestShipmentDiversionForbidden The request was denied - -swagger:response requestShipmentDiversionForbidden -*/ -type RequestShipmentDiversionForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionForbidden creates RequestShipmentDiversionForbidden with default headers values -func NewRequestShipmentDiversionForbidden() *RequestShipmentDiversionForbidden { - - return &RequestShipmentDiversionForbidden{} -} - -// WithPayload adds the payload to the request shipment diversion forbidden response -func (o *RequestShipmentDiversionForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion forbidden response -func (o *RequestShipmentDiversionForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionNotFoundCode is the HTTP code returned for type RequestShipmentDiversionNotFound -const RequestShipmentDiversionNotFoundCode int = 404 - -/* -RequestShipmentDiversionNotFound The requested resource wasn't found - -swagger:response requestShipmentDiversionNotFound -*/ -type RequestShipmentDiversionNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionNotFound creates RequestShipmentDiversionNotFound with default headers values -func NewRequestShipmentDiversionNotFound() *RequestShipmentDiversionNotFound { - - return &RequestShipmentDiversionNotFound{} -} - -// WithPayload adds the payload to the request shipment diversion not found response -func (o *RequestShipmentDiversionNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion not found response -func (o *RequestShipmentDiversionNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionConflictCode is the HTTP code returned for type RequestShipmentDiversionConflict -const RequestShipmentDiversionConflictCode int = 409 - -/* -RequestShipmentDiversionConflict Conflict error - -swagger:response requestShipmentDiversionConflict -*/ -type RequestShipmentDiversionConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionConflict creates RequestShipmentDiversionConflict with default headers values -func NewRequestShipmentDiversionConflict() *RequestShipmentDiversionConflict { - - return &RequestShipmentDiversionConflict{} -} - -// WithPayload adds the payload to the request shipment diversion conflict response -func (o *RequestShipmentDiversionConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion conflict response -func (o *RequestShipmentDiversionConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionPreconditionFailedCode is the HTTP code returned for type RequestShipmentDiversionPreconditionFailed -const RequestShipmentDiversionPreconditionFailedCode int = 412 - -/* -RequestShipmentDiversionPreconditionFailed Precondition failed - -swagger:response requestShipmentDiversionPreconditionFailed -*/ -type RequestShipmentDiversionPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionPreconditionFailed creates RequestShipmentDiversionPreconditionFailed with default headers values -func NewRequestShipmentDiversionPreconditionFailed() *RequestShipmentDiversionPreconditionFailed { - - return &RequestShipmentDiversionPreconditionFailed{} -} - -// WithPayload adds the payload to the request shipment diversion precondition failed response -func (o *RequestShipmentDiversionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion precondition failed response -func (o *RequestShipmentDiversionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionUnprocessableEntityCode is the HTTP code returned for type RequestShipmentDiversionUnprocessableEntity -const RequestShipmentDiversionUnprocessableEntityCode int = 422 - -/* -RequestShipmentDiversionUnprocessableEntity The payload was unprocessable. - -swagger:response requestShipmentDiversionUnprocessableEntity -*/ -type RequestShipmentDiversionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionUnprocessableEntity creates RequestShipmentDiversionUnprocessableEntity with default headers values -func NewRequestShipmentDiversionUnprocessableEntity() *RequestShipmentDiversionUnprocessableEntity { - - return &RequestShipmentDiversionUnprocessableEntity{} -} - -// WithPayload adds the payload to the request shipment diversion unprocessable entity response -func (o *RequestShipmentDiversionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentDiversionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion unprocessable entity response -func (o *RequestShipmentDiversionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentDiversionInternalServerErrorCode is the HTTP code returned for type RequestShipmentDiversionInternalServerError -const RequestShipmentDiversionInternalServerErrorCode int = 500 - -/* -RequestShipmentDiversionInternalServerError A server error occurred - -swagger:response requestShipmentDiversionInternalServerError -*/ -type RequestShipmentDiversionInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentDiversionInternalServerError creates RequestShipmentDiversionInternalServerError with default headers values -func NewRequestShipmentDiversionInternalServerError() *RequestShipmentDiversionInternalServerError { - - return &RequestShipmentDiversionInternalServerError{} -} - -// WithPayload adds the payload to the request shipment diversion internal server error response -func (o *RequestShipmentDiversionInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment diversion internal server error response -func (o *RequestShipmentDiversionInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentDiversionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go deleted file mode 100644 index 54e8bf53267..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RequestShipmentDiversionURL generates an URL for the request shipment diversion operation -type RequestShipmentDiversionURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentDiversionURL) WithBasePath(bp string) *RequestShipmentDiversionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentDiversionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RequestShipmentDiversionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/request-diversion" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on RequestShipmentDiversionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RequestShipmentDiversionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RequestShipmentDiversionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RequestShipmentDiversionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RequestShipmentDiversionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RequestShipmentDiversionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RequestShipmentDiversionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go deleted file mode 100644 index c09620f1caf..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RequestShipmentReweighHandlerFunc turns a function with the right signature into a request shipment reweigh handler -type RequestShipmentReweighHandlerFunc func(RequestShipmentReweighParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RequestShipmentReweighHandlerFunc) Handle(params RequestShipmentReweighParams) middleware.Responder { - return fn(params) -} - -// RequestShipmentReweighHandler interface for that can handle valid request shipment reweigh params -type RequestShipmentReweighHandler interface { - Handle(RequestShipmentReweighParams) middleware.Responder -} - -// NewRequestShipmentReweigh creates a new http.Handler for the request shipment reweigh operation -func NewRequestShipmentReweigh(ctx *middleware.Context, handler RequestShipmentReweighHandler) *RequestShipmentReweigh { - return &RequestShipmentReweigh{Context: ctx, Handler: handler} -} - -/* - RequestShipmentReweigh swagger:route POST /shipments/{shipmentID}/request-reweigh shipment reweigh requestShipmentReweigh - -# Requests a shipment reweigh - -Requests a shipment reweigh -*/ -type RequestShipmentReweigh struct { - Context *middleware.Context - Handler RequestShipmentReweighHandler -} - -func (o *RequestShipmentReweigh) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRequestShipmentReweighParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go deleted file mode 100644 index 28f79ca9eaa..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewRequestShipmentReweighParams creates a new RequestShipmentReweighParams object -// -// There are no default values defined in the spec. -func NewRequestShipmentReweighParams() RequestShipmentReweighParams { - - return RequestShipmentReweighParams{} -} - -// RequestShipmentReweighParams contains all the bound params for the request shipment reweigh operation -// typically these are obtained from a http.Request -// -// swagger:parameters requestShipmentReweigh -type RequestShipmentReweighParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRequestShipmentReweighParams() beforehand. -func (o *RequestShipmentReweighParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *RequestShipmentReweighParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *RequestShipmentReweighParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go deleted file mode 100644 index 21cddadc4c7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// RequestShipmentReweighOKCode is the HTTP code returned for type RequestShipmentReweighOK -const RequestShipmentReweighOKCode int = 200 - -/* -RequestShipmentReweighOK Successfully requested a reweigh of the shipment - -swagger:response requestShipmentReweighOK -*/ -type RequestShipmentReweighOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Reweigh `json:"body,omitempty"` -} - -// NewRequestShipmentReweighOK creates RequestShipmentReweighOK with default headers values -func NewRequestShipmentReweighOK() *RequestShipmentReweighOK { - - return &RequestShipmentReweighOK{} -} - -// WithPayload adds the payload to the request shipment reweigh o k response -func (o *RequestShipmentReweighOK) WithPayload(payload *ghcmessages.Reweigh) *RequestShipmentReweighOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh o k response -func (o *RequestShipmentReweighOK) SetPayload(payload *ghcmessages.Reweigh) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighForbiddenCode is the HTTP code returned for type RequestShipmentReweighForbidden -const RequestShipmentReweighForbiddenCode int = 403 - -/* -RequestShipmentReweighForbidden The request was denied - -swagger:response requestShipmentReweighForbidden -*/ -type RequestShipmentReweighForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentReweighForbidden creates RequestShipmentReweighForbidden with default headers values -func NewRequestShipmentReweighForbidden() *RequestShipmentReweighForbidden { - - return &RequestShipmentReweighForbidden{} -} - -// WithPayload adds the payload to the request shipment reweigh forbidden response -func (o *RequestShipmentReweighForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh forbidden response -func (o *RequestShipmentReweighForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighNotFoundCode is the HTTP code returned for type RequestShipmentReweighNotFound -const RequestShipmentReweighNotFoundCode int = 404 - -/* -RequestShipmentReweighNotFound The requested resource wasn't found - -swagger:response requestShipmentReweighNotFound -*/ -type RequestShipmentReweighNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentReweighNotFound creates RequestShipmentReweighNotFound with default headers values -func NewRequestShipmentReweighNotFound() *RequestShipmentReweighNotFound { - - return &RequestShipmentReweighNotFound{} -} - -// WithPayload adds the payload to the request shipment reweigh not found response -func (o *RequestShipmentReweighNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh not found response -func (o *RequestShipmentReweighNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighConflictCode is the HTTP code returned for type RequestShipmentReweighConflict -const RequestShipmentReweighConflictCode int = 409 - -/* -RequestShipmentReweighConflict Conflict error - -swagger:response requestShipmentReweighConflict -*/ -type RequestShipmentReweighConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentReweighConflict creates RequestShipmentReweighConflict with default headers values -func NewRequestShipmentReweighConflict() *RequestShipmentReweighConflict { - - return &RequestShipmentReweighConflict{} -} - -// WithPayload adds the payload to the request shipment reweigh conflict response -func (o *RequestShipmentReweighConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh conflict response -func (o *RequestShipmentReweighConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighPreconditionFailedCode is the HTTP code returned for type RequestShipmentReweighPreconditionFailed -const RequestShipmentReweighPreconditionFailedCode int = 412 - -/* -RequestShipmentReweighPreconditionFailed Precondition failed - -swagger:response requestShipmentReweighPreconditionFailed -*/ -type RequestShipmentReweighPreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentReweighPreconditionFailed creates RequestShipmentReweighPreconditionFailed with default headers values -func NewRequestShipmentReweighPreconditionFailed() *RequestShipmentReweighPreconditionFailed { - - return &RequestShipmentReweighPreconditionFailed{} -} - -// WithPayload adds the payload to the request shipment reweigh precondition failed response -func (o *RequestShipmentReweighPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh precondition failed response -func (o *RequestShipmentReweighPreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighUnprocessableEntityCode is the HTTP code returned for type RequestShipmentReweighUnprocessableEntity -const RequestShipmentReweighUnprocessableEntityCode int = 422 - -/* -RequestShipmentReweighUnprocessableEntity The payload was unprocessable. - -swagger:response requestShipmentReweighUnprocessableEntity -*/ -type RequestShipmentReweighUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewRequestShipmentReweighUnprocessableEntity creates RequestShipmentReweighUnprocessableEntity with default headers values -func NewRequestShipmentReweighUnprocessableEntity() *RequestShipmentReweighUnprocessableEntity { - - return &RequestShipmentReweighUnprocessableEntity{} -} - -// WithPayload adds the payload to the request shipment reweigh unprocessable entity response -func (o *RequestShipmentReweighUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentReweighUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh unprocessable entity response -func (o *RequestShipmentReweighUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RequestShipmentReweighInternalServerErrorCode is the HTTP code returned for type RequestShipmentReweighInternalServerError -const RequestShipmentReweighInternalServerErrorCode int = 500 - -/* -RequestShipmentReweighInternalServerError A server error occurred - -swagger:response requestShipmentReweighInternalServerError -*/ -type RequestShipmentReweighInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewRequestShipmentReweighInternalServerError creates RequestShipmentReweighInternalServerError with default headers values -func NewRequestShipmentReweighInternalServerError() *RequestShipmentReweighInternalServerError { - - return &RequestShipmentReweighInternalServerError{} -} - -// WithPayload adds the payload to the request shipment reweigh internal server error response -func (o *RequestShipmentReweighInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the request shipment reweigh internal server error response -func (o *RequestShipmentReweighInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RequestShipmentReweighInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go deleted file mode 100644 index d1902ca4631..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RequestShipmentReweighURL generates an URL for the request shipment reweigh operation -type RequestShipmentReweighURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentReweighURL) WithBasePath(bp string) *RequestShipmentReweighURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RequestShipmentReweighURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RequestShipmentReweighURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/request-reweigh" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on RequestShipmentReweighURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RequestShipmentReweighURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RequestShipmentReweighURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RequestShipmentReweighURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RequestShipmentReweighURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RequestShipmentReweighURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RequestShipmentReweighURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go deleted file mode 100644 index d4532a282ce..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "encoding/json" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReviewShipmentAddressUpdateHandlerFunc turns a function with the right signature into a review shipment address update handler -type ReviewShipmentAddressUpdateHandlerFunc func(ReviewShipmentAddressUpdateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ReviewShipmentAddressUpdateHandlerFunc) Handle(params ReviewShipmentAddressUpdateParams) middleware.Responder { - return fn(params) -} - -// ReviewShipmentAddressUpdateHandler interface for that can handle valid review shipment address update params -type ReviewShipmentAddressUpdateHandler interface { - Handle(ReviewShipmentAddressUpdateParams) middleware.Responder -} - -// NewReviewShipmentAddressUpdate creates a new http.Handler for the review shipment address update operation -func NewReviewShipmentAddressUpdate(ctx *middleware.Context, handler ReviewShipmentAddressUpdateHandler) *ReviewShipmentAddressUpdate { - return &ReviewShipmentAddressUpdate{Context: ctx, Handler: handler} -} - -/* - ReviewShipmentAddressUpdate swagger:route PATCH /shipments/{shipmentID}/review-shipment-address-update shipment reviewShipmentAddressUpdate - -# Allows TOO to review a shipment address update - -This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item -*/ -type ReviewShipmentAddressUpdate struct { - Context *middleware.Context - Handler ReviewShipmentAddressUpdateHandler -} - -func (o *ReviewShipmentAddressUpdate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewReviewShipmentAddressUpdateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// ReviewShipmentAddressUpdateBody review shipment address update body -// -// swagger:model ReviewShipmentAddressUpdateBody -type ReviewShipmentAddressUpdateBody struct { - - // office remarks - // Required: true - OfficeRemarks *string `json:"officeRemarks"` - - // status - // Required: true - // Enum: [REJECTED APPROVED] - Status *string `json:"status"` -} - -// Validate validates this review shipment address update body -func (o *ReviewShipmentAddressUpdateBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateOfficeRemarks(formats); err != nil { - res = append(res, err) - } - - if err := o.validateStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *ReviewShipmentAddressUpdateBody) validateOfficeRemarks(formats strfmt.Registry) error { - - if err := validate.Required("body"+"."+"officeRemarks", "body", o.OfficeRemarks); err != nil { - return err - } - - return nil -} - -var reviewShipmentAddressUpdateBodyTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reviewShipmentAddressUpdateBodyTypeStatusPropEnum = append(reviewShipmentAddressUpdateBodyTypeStatusPropEnum, v) - } -} - -const ( - - // ReviewShipmentAddressUpdateBodyStatusREJECTED captures enum value "REJECTED" - ReviewShipmentAddressUpdateBodyStatusREJECTED string = "REJECTED" - - // ReviewShipmentAddressUpdateBodyStatusAPPROVED captures enum value "APPROVED" - ReviewShipmentAddressUpdateBodyStatusAPPROVED string = "APPROVED" -) - -// prop value enum -func (o *ReviewShipmentAddressUpdateBody) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, reviewShipmentAddressUpdateBodyTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (o *ReviewShipmentAddressUpdateBody) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("body"+"."+"status", "body", o.Status); err != nil { - return err - } - - // value enum - if err := o.validateStatusEnum("body"+"."+"status", "body", *o.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this review shipment address update body based on context it is used -func (o *ReviewShipmentAddressUpdateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *ReviewShipmentAddressUpdateBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *ReviewShipmentAddressUpdateBody) UnmarshalBinary(b []byte) error { - var res ReviewShipmentAddressUpdateBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go deleted file mode 100644 index d7d16648a8c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go +++ /dev/null @@ -1,155 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewReviewShipmentAddressUpdateParams creates a new ReviewShipmentAddressUpdateParams object -// -// There are no default values defined in the spec. -func NewReviewShipmentAddressUpdateParams() ReviewShipmentAddressUpdateParams { - - return ReviewShipmentAddressUpdateParams{} -} - -// ReviewShipmentAddressUpdateParams contains all the bound params for the review shipment address update operation -// typically these are obtained from a http.Request -// -// swagger:parameters reviewShipmentAddressUpdate -type ReviewShipmentAddressUpdateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body ReviewShipmentAddressUpdateBody - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewReviewShipmentAddressUpdateParams() beforehand. -func (o *ReviewShipmentAddressUpdateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ReviewShipmentAddressUpdateBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *ReviewShipmentAddressUpdateParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *ReviewShipmentAddressUpdateParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *ReviewShipmentAddressUpdateParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go deleted file mode 100644 index 7ab8362c8d4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// ReviewShipmentAddressUpdateOKCode is the HTTP code returned for type ReviewShipmentAddressUpdateOK -const ReviewShipmentAddressUpdateOKCode int = 200 - -/* -ReviewShipmentAddressUpdateOK Successfully requested a shipment address update - -swagger:response reviewShipmentAddressUpdateOK -*/ -type ReviewShipmentAddressUpdateOK struct { - - /* - In: Body - */ - Payload *ghcmessages.ShipmentAddressUpdate `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateOK creates ReviewShipmentAddressUpdateOK with default headers values -func NewReviewShipmentAddressUpdateOK() *ReviewShipmentAddressUpdateOK { - - return &ReviewShipmentAddressUpdateOK{} -} - -// WithPayload adds the payload to the review shipment address update o k response -func (o *ReviewShipmentAddressUpdateOK) WithPayload(payload *ghcmessages.ShipmentAddressUpdate) *ReviewShipmentAddressUpdateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update o k response -func (o *ReviewShipmentAddressUpdateOK) SetPayload(payload *ghcmessages.ShipmentAddressUpdate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdateForbiddenCode is the HTTP code returned for type ReviewShipmentAddressUpdateForbidden -const ReviewShipmentAddressUpdateForbiddenCode int = 403 - -/* -ReviewShipmentAddressUpdateForbidden The request was denied - -swagger:response reviewShipmentAddressUpdateForbidden -*/ -type ReviewShipmentAddressUpdateForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateForbidden creates ReviewShipmentAddressUpdateForbidden with default headers values -func NewReviewShipmentAddressUpdateForbidden() *ReviewShipmentAddressUpdateForbidden { - - return &ReviewShipmentAddressUpdateForbidden{} -} - -// WithPayload adds the payload to the review shipment address update forbidden response -func (o *ReviewShipmentAddressUpdateForbidden) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update forbidden response -func (o *ReviewShipmentAddressUpdateForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdateNotFoundCode is the HTTP code returned for type ReviewShipmentAddressUpdateNotFound -const ReviewShipmentAddressUpdateNotFoundCode int = 404 - -/* -ReviewShipmentAddressUpdateNotFound The requested resource wasn't found - -swagger:response reviewShipmentAddressUpdateNotFound -*/ -type ReviewShipmentAddressUpdateNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateNotFound creates ReviewShipmentAddressUpdateNotFound with default headers values -func NewReviewShipmentAddressUpdateNotFound() *ReviewShipmentAddressUpdateNotFound { - - return &ReviewShipmentAddressUpdateNotFound{} -} - -// WithPayload adds the payload to the review shipment address update not found response -func (o *ReviewShipmentAddressUpdateNotFound) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update not found response -func (o *ReviewShipmentAddressUpdateNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdateConflictCode is the HTTP code returned for type ReviewShipmentAddressUpdateConflict -const ReviewShipmentAddressUpdateConflictCode int = 409 - -/* -ReviewShipmentAddressUpdateConflict Conflict error - -swagger:response reviewShipmentAddressUpdateConflict -*/ -type ReviewShipmentAddressUpdateConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateConflict creates ReviewShipmentAddressUpdateConflict with default headers values -func NewReviewShipmentAddressUpdateConflict() *ReviewShipmentAddressUpdateConflict { - - return &ReviewShipmentAddressUpdateConflict{} -} - -// WithPayload adds the payload to the review shipment address update conflict response -func (o *ReviewShipmentAddressUpdateConflict) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update conflict response -func (o *ReviewShipmentAddressUpdateConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdatePreconditionFailedCode is the HTTP code returned for type ReviewShipmentAddressUpdatePreconditionFailed -const ReviewShipmentAddressUpdatePreconditionFailedCode int = 412 - -/* -ReviewShipmentAddressUpdatePreconditionFailed Precondition failed - -swagger:response reviewShipmentAddressUpdatePreconditionFailed -*/ -type ReviewShipmentAddressUpdatePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdatePreconditionFailed creates ReviewShipmentAddressUpdatePreconditionFailed with default headers values -func NewReviewShipmentAddressUpdatePreconditionFailed() *ReviewShipmentAddressUpdatePreconditionFailed { - - return &ReviewShipmentAddressUpdatePreconditionFailed{} -} - -// WithPayload adds the payload to the review shipment address update precondition failed response -func (o *ReviewShipmentAddressUpdatePreconditionFailed) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdatePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update precondition failed response -func (o *ReviewShipmentAddressUpdatePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdatePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdateUnprocessableEntityCode is the HTTP code returned for type ReviewShipmentAddressUpdateUnprocessableEntity -const ReviewShipmentAddressUpdateUnprocessableEntityCode int = 422 - -/* -ReviewShipmentAddressUpdateUnprocessableEntity The payload was unprocessable. - -swagger:response reviewShipmentAddressUpdateUnprocessableEntity -*/ -type ReviewShipmentAddressUpdateUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateUnprocessableEntity creates ReviewShipmentAddressUpdateUnprocessableEntity with default headers values -func NewReviewShipmentAddressUpdateUnprocessableEntity() *ReviewShipmentAddressUpdateUnprocessableEntity { - - return &ReviewShipmentAddressUpdateUnprocessableEntity{} -} - -// WithPayload adds the payload to the review shipment address update unprocessable entity response -func (o *ReviewShipmentAddressUpdateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ReviewShipmentAddressUpdateUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update unprocessable entity response -func (o *ReviewShipmentAddressUpdateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReviewShipmentAddressUpdateInternalServerErrorCode is the HTTP code returned for type ReviewShipmentAddressUpdateInternalServerError -const ReviewShipmentAddressUpdateInternalServerErrorCode int = 500 - -/* -ReviewShipmentAddressUpdateInternalServerError A server error occurred - -swagger:response reviewShipmentAddressUpdateInternalServerError -*/ -type ReviewShipmentAddressUpdateInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewReviewShipmentAddressUpdateInternalServerError creates ReviewShipmentAddressUpdateInternalServerError with default headers values -func NewReviewShipmentAddressUpdateInternalServerError() *ReviewShipmentAddressUpdateInternalServerError { - - return &ReviewShipmentAddressUpdateInternalServerError{} -} - -// WithPayload adds the payload to the review shipment address update internal server error response -func (o *ReviewShipmentAddressUpdateInternalServerError) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the review shipment address update internal server error response -func (o *ReviewShipmentAddressUpdateInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReviewShipmentAddressUpdateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go deleted file mode 100644 index 8d469c47f27..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ReviewShipmentAddressUpdateURL generates an URL for the review shipment address update operation -type ReviewShipmentAddressUpdateURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReviewShipmentAddressUpdateURL) WithBasePath(bp string) *ReviewShipmentAddressUpdateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReviewShipmentAddressUpdateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ReviewShipmentAddressUpdateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/review-shipment-address-update" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on ReviewShipmentAddressUpdateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ReviewShipmentAddressUpdateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ReviewShipmentAddressUpdateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ReviewShipmentAddressUpdateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ReviewShipmentAddressUpdateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ReviewShipmentAddressUpdateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ReviewShipmentAddressUpdateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go deleted file mode 100644 index 5b7290cafe7..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateSITServiceItemCustomerExpenseHandlerFunc turns a function with the right signature into a update s i t service item customer expense handler -type UpdateSITServiceItemCustomerExpenseHandlerFunc func(UpdateSITServiceItemCustomerExpenseParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateSITServiceItemCustomerExpenseHandlerFunc) Handle(params UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { - return fn(params) -} - -// UpdateSITServiceItemCustomerExpenseHandler interface for that can handle valid update s i t service item customer expense params -type UpdateSITServiceItemCustomerExpenseHandler interface { - Handle(UpdateSITServiceItemCustomerExpenseParams) middleware.Responder -} - -// NewUpdateSITServiceItemCustomerExpense creates a new http.Handler for the update s i t service item customer expense operation -func NewUpdateSITServiceItemCustomerExpense(ctx *middleware.Context, handler UpdateSITServiceItemCustomerExpenseHandler) *UpdateSITServiceItemCustomerExpense { - return &UpdateSITServiceItemCustomerExpense{Context: ctx, Handler: handler} -} - -/* - UpdateSITServiceItemCustomerExpense swagger:route PATCH /shipments/{shipmentID}/sit-service-item/convert-to-customer-expense shipment mtoServiceItem updateSITServiceItemCustomerExpense - -# Converts a SIT to customer expense - -Converts a SIT to customer expense -*/ -type UpdateSITServiceItemCustomerExpense struct { - Context *middleware.Context - Handler UpdateSITServiceItemCustomerExpenseHandler -} - -func (o *UpdateSITServiceItemCustomerExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateSITServiceItemCustomerExpenseParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go deleted file mode 100644 index 07c5ab5be2a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// NewUpdateSITServiceItemCustomerExpenseParams creates a new UpdateSITServiceItemCustomerExpenseParams object -// -// There are no default values defined in the spec. -func NewUpdateSITServiceItemCustomerExpenseParams() UpdateSITServiceItemCustomerExpenseParams { - - return UpdateSITServiceItemCustomerExpenseParams{} -} - -// UpdateSITServiceItemCustomerExpenseParams contains all the bound params for the update s i t service item customer expense operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateSITServiceItemCustomerExpense -type UpdateSITServiceItemCustomerExpenseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *ghcmessages.UpdateSITServiceItemCustomerExpense - /*ID of the shipment - Required: true - In: path - */ - ShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateSITServiceItemCustomerExpenseParams() beforehand. -func (o *UpdateSITServiceItemCustomerExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body ghcmessages.UpdateSITServiceItemCustomerExpense - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") - if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateSITServiceItemCustomerExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindShipmentID binds and validates parameter ShipmentID from path. -func (o *UpdateSITServiceItemCustomerExpenseParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) - } - o.ShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateShipmentID carries on validations for parameter ShipmentID -func (o *UpdateSITServiceItemCustomerExpenseParams) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go deleted file mode 100644 index 318518fa67b..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateSITServiceItemCustomerExpenseOKCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseOK -const UpdateSITServiceItemCustomerExpenseOKCode int = 200 - -/* -UpdateSITServiceItemCustomerExpenseOK Successfully converted to customer expense - -swagger:response updateSITServiceItemCustomerExpenseOK -*/ -type UpdateSITServiceItemCustomerExpenseOK struct { - - /* - In: Body - */ - Payload *ghcmessages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseOK creates UpdateSITServiceItemCustomerExpenseOK with default headers values -func NewUpdateSITServiceItemCustomerExpenseOK() *UpdateSITServiceItemCustomerExpenseOK { - - return &UpdateSITServiceItemCustomerExpenseOK{} -} - -// WithPayload adds the payload to the update s i t service item customer expense o k response -func (o *UpdateSITServiceItemCustomerExpenseOK) WithPayload(payload *ghcmessages.MTOShipment) *UpdateSITServiceItemCustomerExpenseOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense o k response -func (o *UpdateSITServiceItemCustomerExpenseOK) SetPayload(payload *ghcmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpenseForbiddenCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseForbidden -const UpdateSITServiceItemCustomerExpenseForbiddenCode int = 403 - -/* -UpdateSITServiceItemCustomerExpenseForbidden The request was denied - -swagger:response updateSITServiceItemCustomerExpenseForbidden -*/ -type UpdateSITServiceItemCustomerExpenseForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseForbidden creates UpdateSITServiceItemCustomerExpenseForbidden with default headers values -func NewUpdateSITServiceItemCustomerExpenseForbidden() *UpdateSITServiceItemCustomerExpenseForbidden { - - return &UpdateSITServiceItemCustomerExpenseForbidden{} -} - -// WithPayload adds the payload to the update s i t service item customer expense forbidden response -func (o *UpdateSITServiceItemCustomerExpenseForbidden) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense forbidden response -func (o *UpdateSITServiceItemCustomerExpenseForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpenseNotFoundCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseNotFound -const UpdateSITServiceItemCustomerExpenseNotFoundCode int = 404 - -/* -UpdateSITServiceItemCustomerExpenseNotFound The requested resource wasn't found - -swagger:response updateSITServiceItemCustomerExpenseNotFound -*/ -type UpdateSITServiceItemCustomerExpenseNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseNotFound creates UpdateSITServiceItemCustomerExpenseNotFound with default headers values -func NewUpdateSITServiceItemCustomerExpenseNotFound() *UpdateSITServiceItemCustomerExpenseNotFound { - - return &UpdateSITServiceItemCustomerExpenseNotFound{} -} - -// WithPayload adds the payload to the update s i t service item customer expense not found response -func (o *UpdateSITServiceItemCustomerExpenseNotFound) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense not found response -func (o *UpdateSITServiceItemCustomerExpenseNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpenseConflictCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseConflict -const UpdateSITServiceItemCustomerExpenseConflictCode int = 409 - -/* -UpdateSITServiceItemCustomerExpenseConflict Conflict error - -swagger:response updateSITServiceItemCustomerExpenseConflict -*/ -type UpdateSITServiceItemCustomerExpenseConflict struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseConflict creates UpdateSITServiceItemCustomerExpenseConflict with default headers values -func NewUpdateSITServiceItemCustomerExpenseConflict() *UpdateSITServiceItemCustomerExpenseConflict { - - return &UpdateSITServiceItemCustomerExpenseConflict{} -} - -// WithPayload adds the payload to the update s i t service item customer expense conflict response -func (o *UpdateSITServiceItemCustomerExpenseConflict) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense conflict response -func (o *UpdateSITServiceItemCustomerExpenseConflict) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpensePreconditionFailedCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpensePreconditionFailed -const UpdateSITServiceItemCustomerExpensePreconditionFailedCode int = 412 - -/* -UpdateSITServiceItemCustomerExpensePreconditionFailed Precondition failed - -swagger:response updateSITServiceItemCustomerExpensePreconditionFailed -*/ -type UpdateSITServiceItemCustomerExpensePreconditionFailed struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpensePreconditionFailed creates UpdateSITServiceItemCustomerExpensePreconditionFailed with default headers values -func NewUpdateSITServiceItemCustomerExpensePreconditionFailed() *UpdateSITServiceItemCustomerExpensePreconditionFailed { - - return &UpdateSITServiceItemCustomerExpensePreconditionFailed{} -} - -// WithPayload adds the payload to the update s i t service item customer expense precondition failed response -func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpensePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense precondition failed response -func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseUnprocessableEntity -const UpdateSITServiceItemCustomerExpenseUnprocessableEntityCode int = 422 - -/* -UpdateSITServiceItemCustomerExpenseUnprocessableEntity The payload was unprocessable. - -swagger:response updateSITServiceItemCustomerExpenseUnprocessableEntity -*/ -type UpdateSITServiceItemCustomerExpenseUnprocessableEntity struct { - - /* - In: Body - */ - Payload *ghcmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseUnprocessableEntity creates UpdateSITServiceItemCustomerExpenseUnprocessableEntity with default headers values -func NewUpdateSITServiceItemCustomerExpenseUnprocessableEntity() *UpdateSITServiceItemCustomerExpenseUnprocessableEntity { - - return &UpdateSITServiceItemCustomerExpenseUnprocessableEntity{} -} - -// WithPayload adds the payload to the update s i t service item customer expense unprocessable entity response -func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateSITServiceItemCustomerExpenseUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense unprocessable entity response -func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateSITServiceItemCustomerExpenseInternalServerErrorCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseInternalServerError -const UpdateSITServiceItemCustomerExpenseInternalServerErrorCode int = 500 - -/* -UpdateSITServiceItemCustomerExpenseInternalServerError A server error occurred - -swagger:response updateSITServiceItemCustomerExpenseInternalServerError -*/ -type UpdateSITServiceItemCustomerExpenseInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewUpdateSITServiceItemCustomerExpenseInternalServerError creates UpdateSITServiceItemCustomerExpenseInternalServerError with default headers values -func NewUpdateSITServiceItemCustomerExpenseInternalServerError() *UpdateSITServiceItemCustomerExpenseInternalServerError { - - return &UpdateSITServiceItemCustomerExpenseInternalServerError{} -} - -// WithPayload adds the payload to the update s i t service item customer expense internal server error response -func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update s i t service item customer expense internal server error response -func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go deleted file mode 100644 index 598c3b5e605..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateSITServiceItemCustomerExpenseURL generates an URL for the update s i t service item customer expense operation -type UpdateSITServiceItemCustomerExpenseURL struct { - ShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateSITServiceItemCustomerExpenseURL) WithBasePath(bp string) *UpdateSITServiceItemCustomerExpenseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateSITServiceItemCustomerExpenseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateSITServiceItemCustomerExpenseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense" - - shipmentID := o.ShipmentID.String() - if shipmentID != "" { - _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) - } else { - return nil, errors.New("shipmentId is required on UpdateSITServiceItemCustomerExpenseURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateSITServiceItemCustomerExpenseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateSITServiceItemCustomerExpenseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateSITServiceItemCustomerExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateSITServiceItemCustomerExpenseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateSITServiceItemCustomerExpenseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateSITServiceItemCustomerExpenseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go deleted file mode 100644 index 0788a96be73..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package tac - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// TacValidationHandlerFunc turns a function with the right signature into a tac validation handler -type TacValidationHandlerFunc func(TacValidationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn TacValidationHandlerFunc) Handle(params TacValidationParams) middleware.Responder { - return fn(params) -} - -// TacValidationHandler interface for that can handle valid tac validation params -type TacValidationHandler interface { - Handle(TacValidationParams) middleware.Responder -} - -// NewTacValidation creates a new http.Handler for the tac validation operation -func NewTacValidation(ctx *middleware.Context, handler TacValidationHandler) *TacValidation { - return &TacValidation{Context: ctx, Handler: handler} -} - -/* - TacValidation swagger:route GET /tac/valid tac order tacValidation - -# Validation of a TAC value - -Returns a boolean based on whether a tac value is valid or not -*/ -type TacValidation struct { - Context *middleware.Context - Handler TacValidationHandler -} - -func (o *TacValidation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewTacValidationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go deleted file mode 100644 index 1d5c20d3673..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package tac - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewTacValidationParams creates a new TacValidationParams object -// -// There are no default values defined in the spec. -func NewTacValidationParams() TacValidationParams { - - return TacValidationParams{} -} - -// TacValidationParams contains all the bound params for the tac validation operation -// typically these are obtained from a http.Request -// -// swagger:parameters tacValidation -type TacValidationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The tac value to validate - Required: true - In: query - */ - Tac string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewTacValidationParams() beforehand. -func (o *TacValidationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qTac, qhkTac, _ := qs.GetOK("tac") - if err := o.bindTac(qTac, qhkTac, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindTac binds and validates parameter Tac from query. -func (o *TacValidationParams) bindTac(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("tac", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("tac", "query", raw); err != nil { - return err - } - o.Tac = raw - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go deleted file mode 100644 index 0c1c71ce662..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package tac - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// TacValidationOKCode is the HTTP code returned for type TacValidationOK -const TacValidationOKCode int = 200 - -/* -TacValidationOK Successfully retrieved validation status - -swagger:response tacValidationOK -*/ -type TacValidationOK struct { - - /* - In: Body - */ - Payload *ghcmessages.TacValid `json:"body,omitempty"` -} - -// NewTacValidationOK creates TacValidationOK with default headers values -func NewTacValidationOK() *TacValidationOK { - - return &TacValidationOK{} -} - -// WithPayload adds the payload to the tac validation o k response -func (o *TacValidationOK) WithPayload(payload *ghcmessages.TacValid) *TacValidationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation o k response -func (o *TacValidationOK) SetPayload(payload *ghcmessages.TacValid) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// TacValidationBadRequestCode is the HTTP code returned for type TacValidationBadRequest -const TacValidationBadRequestCode int = 400 - -/* -TacValidationBadRequest The request payload is invalid - -swagger:response tacValidationBadRequest -*/ -type TacValidationBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewTacValidationBadRequest creates TacValidationBadRequest with default headers values -func NewTacValidationBadRequest() *TacValidationBadRequest { - - return &TacValidationBadRequest{} -} - -// WithPayload adds the payload to the tac validation bad request response -func (o *TacValidationBadRequest) WithPayload(payload *ghcmessages.Error) *TacValidationBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation bad request response -func (o *TacValidationBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// TacValidationUnauthorizedCode is the HTTP code returned for type TacValidationUnauthorized -const TacValidationUnauthorizedCode int = 401 - -/* -TacValidationUnauthorized The request was denied - -swagger:response tacValidationUnauthorized -*/ -type TacValidationUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewTacValidationUnauthorized creates TacValidationUnauthorized with default headers values -func NewTacValidationUnauthorized() *TacValidationUnauthorized { - - return &TacValidationUnauthorized{} -} - -// WithPayload adds the payload to the tac validation unauthorized response -func (o *TacValidationUnauthorized) WithPayload(payload *ghcmessages.Error) *TacValidationUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation unauthorized response -func (o *TacValidationUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// TacValidationForbiddenCode is the HTTP code returned for type TacValidationForbidden -const TacValidationForbiddenCode int = 403 - -/* -TacValidationForbidden The request was denied - -swagger:response tacValidationForbidden -*/ -type TacValidationForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewTacValidationForbidden creates TacValidationForbidden with default headers values -func NewTacValidationForbidden() *TacValidationForbidden { - - return &TacValidationForbidden{} -} - -// WithPayload adds the payload to the tac validation forbidden response -func (o *TacValidationForbidden) WithPayload(payload *ghcmessages.Error) *TacValidationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation forbidden response -func (o *TacValidationForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// TacValidationNotFoundCode is the HTTP code returned for type TacValidationNotFound -const TacValidationNotFoundCode int = 404 - -/* -TacValidationNotFound The requested resource wasn't found - -swagger:response tacValidationNotFound -*/ -type TacValidationNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewTacValidationNotFound creates TacValidationNotFound with default headers values -func NewTacValidationNotFound() *TacValidationNotFound { - - return &TacValidationNotFound{} -} - -// WithPayload adds the payload to the tac validation not found response -func (o *TacValidationNotFound) WithPayload(payload *ghcmessages.Error) *TacValidationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation not found response -func (o *TacValidationNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// TacValidationInternalServerErrorCode is the HTTP code returned for type TacValidationInternalServerError -const TacValidationInternalServerErrorCode int = 500 - -/* -TacValidationInternalServerError A server error occurred - -swagger:response tacValidationInternalServerError -*/ -type TacValidationInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewTacValidationInternalServerError creates TacValidationInternalServerError with default headers values -func NewTacValidationInternalServerError() *TacValidationInternalServerError { - - return &TacValidationInternalServerError{} -} - -// WithPayload adds the payload to the tac validation internal server error response -func (o *TacValidationInternalServerError) WithPayload(payload *ghcmessages.Error) *TacValidationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the tac validation internal server error response -func (o *TacValidationInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *TacValidationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go deleted file mode 100644 index 4c5198ee269..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package tac - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// TacValidationURL generates an URL for the tac validation operation -type TacValidationURL struct { - Tac string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *TacValidationURL) WithBasePath(bp string) *TacValidationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *TacValidationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *TacValidationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/tac/valid" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - tacQ := o.Tac - if tacQ != "" { - qs.Set("tac", tacQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *TacValidationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *TacValidationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *TacValidationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on TacValidationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on TacValidationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *TacValidationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go deleted file mode 100644 index fd19356220f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetTransportationOfficesHandlerFunc turns a function with the right signature into a get transportation offices handler -type GetTransportationOfficesHandlerFunc func(GetTransportationOfficesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetTransportationOfficesHandlerFunc) Handle(params GetTransportationOfficesParams) middleware.Responder { - return fn(params) -} - -// GetTransportationOfficesHandler interface for that can handle valid get transportation offices params -type GetTransportationOfficesHandler interface { - Handle(GetTransportationOfficesParams) middleware.Responder -} - -// NewGetTransportationOffices creates a new http.Handler for the get transportation offices operation -func NewGetTransportationOffices(ctx *middleware.Context, handler GetTransportationOfficesHandler) *GetTransportationOffices { - return &GetTransportationOffices{Context: ctx, Handler: handler} -} - -/* - GetTransportationOffices swagger:route GET /transportation-offices transportationOffice getTransportationOffices - -# Returns the transportation offices matching the search query that is enabled for PPM closeout - -Returns the transportation offices matching the search query that is enabled for PPM closeout -*/ -type GetTransportationOffices struct { - Context *middleware.Context - Handler GetTransportationOfficesHandler -} - -func (o *GetTransportationOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetTransportationOfficesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go deleted file mode 100644 index 2963b3d8445..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetTransportationOfficesGBLOCsHandlerFunc turns a function with the right signature into a get transportation offices g b l o cs handler -type GetTransportationOfficesGBLOCsHandlerFunc func(GetTransportationOfficesGBLOCsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetTransportationOfficesGBLOCsHandlerFunc) Handle(params GetTransportationOfficesGBLOCsParams) middleware.Responder { - return fn(params) -} - -// GetTransportationOfficesGBLOCsHandler interface for that can handle valid get transportation offices g b l o cs params -type GetTransportationOfficesGBLOCsHandler interface { - Handle(GetTransportationOfficesGBLOCsParams) middleware.Responder -} - -// NewGetTransportationOfficesGBLOCs creates a new http.Handler for the get transportation offices g b l o cs operation -func NewGetTransportationOfficesGBLOCs(ctx *middleware.Context, handler GetTransportationOfficesGBLOCsHandler) *GetTransportationOfficesGBLOCs { - return &GetTransportationOfficesGBLOCs{Context: ctx, Handler: handler} -} - -/* - GetTransportationOfficesGBLOCs swagger:route GET /transportation-offices/gblocs transportationOffice getTransportationOfficesGBLOCs - -# Returns a list of distinct GBLOCs that exist in the transportation offices table - -Returns a list of distinct GBLOCs that exist in the transportation offices table -*/ -type GetTransportationOfficesGBLOCs struct { - Context *middleware.Context - Handler GetTransportationOfficesGBLOCsHandler -} - -func (o *GetTransportationOfficesGBLOCs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetTransportationOfficesGBLOCsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go deleted file mode 100644 index 3e900e08a06..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetTransportationOfficesGBLOCsParams creates a new GetTransportationOfficesGBLOCsParams object -// -// There are no default values defined in the spec. -func NewGetTransportationOfficesGBLOCsParams() GetTransportationOfficesGBLOCsParams { - - return GetTransportationOfficesGBLOCsParams{} -} - -// GetTransportationOfficesGBLOCsParams contains all the bound params for the get transportation offices g b l o cs operation -// typically these are obtained from a http.Request -// -// swagger:parameters getTransportationOfficesGBLOCs -type GetTransportationOfficesGBLOCsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesGBLOCsParams() beforehand. -func (o *GetTransportationOfficesGBLOCsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go deleted file mode 100644 index 309de84d0fa..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetTransportationOfficesGBLOCsOKCode is the HTTP code returned for type GetTransportationOfficesGBLOCsOK -const GetTransportationOfficesGBLOCsOKCode int = 200 - -/* -GetTransportationOfficesGBLOCsOK Successfully retrieved transportation offices - -swagger:response getTransportationOfficesGBLOCsOK -*/ -type GetTransportationOfficesGBLOCsOK struct { - - /* - In: Body - */ - Payload ghcmessages.GBLOCs `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsOK creates GetTransportationOfficesGBLOCsOK with default headers values -func NewGetTransportationOfficesGBLOCsOK() *GetTransportationOfficesGBLOCsOK { - - return &GetTransportationOfficesGBLOCsOK{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs o k response -func (o *GetTransportationOfficesGBLOCsOK) WithPayload(payload ghcmessages.GBLOCs) *GetTransportationOfficesGBLOCsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs o k response -func (o *GetTransportationOfficesGBLOCsOK) SetPayload(payload ghcmessages.GBLOCs) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.GBLOCs{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetTransportationOfficesGBLOCsBadRequestCode is the HTTP code returned for type GetTransportationOfficesGBLOCsBadRequest -const GetTransportationOfficesGBLOCsBadRequestCode int = 400 - -/* -GetTransportationOfficesGBLOCsBadRequest The request payload is invalid - -swagger:response getTransportationOfficesGBLOCsBadRequest -*/ -type GetTransportationOfficesGBLOCsBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsBadRequest creates GetTransportationOfficesGBLOCsBadRequest with default headers values -func NewGetTransportationOfficesGBLOCsBadRequest() *GetTransportationOfficesGBLOCsBadRequest { - - return &GetTransportationOfficesGBLOCsBadRequest{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs bad request response -func (o *GetTransportationOfficesGBLOCsBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs bad request response -func (o *GetTransportationOfficesGBLOCsBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesGBLOCsUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesGBLOCsUnauthorized -const GetTransportationOfficesGBLOCsUnauthorizedCode int = 401 - -/* -GetTransportationOfficesGBLOCsUnauthorized The request was denied - -swagger:response getTransportationOfficesGBLOCsUnauthorized -*/ -type GetTransportationOfficesGBLOCsUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsUnauthorized creates GetTransportationOfficesGBLOCsUnauthorized with default headers values -func NewGetTransportationOfficesGBLOCsUnauthorized() *GetTransportationOfficesGBLOCsUnauthorized { - - return &GetTransportationOfficesGBLOCsUnauthorized{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs unauthorized response -func (o *GetTransportationOfficesGBLOCsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs unauthorized response -func (o *GetTransportationOfficesGBLOCsUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesGBLOCsForbiddenCode is the HTTP code returned for type GetTransportationOfficesGBLOCsForbidden -const GetTransportationOfficesGBLOCsForbiddenCode int = 403 - -/* -GetTransportationOfficesGBLOCsForbidden The request was denied - -swagger:response getTransportationOfficesGBLOCsForbidden -*/ -type GetTransportationOfficesGBLOCsForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsForbidden creates GetTransportationOfficesGBLOCsForbidden with default headers values -func NewGetTransportationOfficesGBLOCsForbidden() *GetTransportationOfficesGBLOCsForbidden { - - return &GetTransportationOfficesGBLOCsForbidden{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs forbidden response -func (o *GetTransportationOfficesGBLOCsForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs forbidden response -func (o *GetTransportationOfficesGBLOCsForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesGBLOCsNotFoundCode is the HTTP code returned for type GetTransportationOfficesGBLOCsNotFound -const GetTransportationOfficesGBLOCsNotFoundCode int = 404 - -/* -GetTransportationOfficesGBLOCsNotFound The requested resource wasn't found - -swagger:response getTransportationOfficesGBLOCsNotFound -*/ -type GetTransportationOfficesGBLOCsNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsNotFound creates GetTransportationOfficesGBLOCsNotFound with default headers values -func NewGetTransportationOfficesGBLOCsNotFound() *GetTransportationOfficesGBLOCsNotFound { - - return &GetTransportationOfficesGBLOCsNotFound{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs not found response -func (o *GetTransportationOfficesGBLOCsNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs not found response -func (o *GetTransportationOfficesGBLOCsNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesGBLOCsInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesGBLOCsInternalServerError -const GetTransportationOfficesGBLOCsInternalServerErrorCode int = 500 - -/* -GetTransportationOfficesGBLOCsInternalServerError A server error occurred - -swagger:response getTransportationOfficesGBLOCsInternalServerError -*/ -type GetTransportationOfficesGBLOCsInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesGBLOCsInternalServerError creates GetTransportationOfficesGBLOCsInternalServerError with default headers values -func NewGetTransportationOfficesGBLOCsInternalServerError() *GetTransportationOfficesGBLOCsInternalServerError { - - return &GetTransportationOfficesGBLOCsInternalServerError{} -} - -// WithPayload adds the payload to the get transportation offices g b l o cs internal server error response -func (o *GetTransportationOfficesGBLOCsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices g b l o cs internal server error response -func (o *GetTransportationOfficesGBLOCsInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesGBLOCsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go deleted file mode 100644 index facd23c184d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetTransportationOfficesGBLOCsURL generates an URL for the get transportation offices g b l o cs operation -type GetTransportationOfficesGBLOCsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesGBLOCsURL) WithBasePath(bp string) *GetTransportationOfficesGBLOCsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesGBLOCsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetTransportationOfficesGBLOCsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transportation-offices/gblocs" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetTransportationOfficesGBLOCsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetTransportationOfficesGBLOCsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetTransportationOfficesGBLOCsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetTransportationOfficesGBLOCsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetTransportationOfficesGBLOCsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetTransportationOfficesGBLOCsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go deleted file mode 100644 index 457347fb6dd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetTransportationOfficesOpenHandlerFunc turns a function with the right signature into a get transportation offices open handler -type GetTransportationOfficesOpenHandlerFunc func(GetTransportationOfficesOpenParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetTransportationOfficesOpenHandlerFunc) Handle(params GetTransportationOfficesOpenParams) middleware.Responder { - return fn(params) -} - -// GetTransportationOfficesOpenHandler interface for that can handle valid get transportation offices open params -type GetTransportationOfficesOpenHandler interface { - Handle(GetTransportationOfficesOpenParams) middleware.Responder -} - -// NewGetTransportationOfficesOpen creates a new http.Handler for the get transportation offices open operation -func NewGetTransportationOfficesOpen(ctx *middleware.Context, handler GetTransportationOfficesOpenHandler) *GetTransportationOfficesOpen { - return &GetTransportationOfficesOpen{Context: ctx, Handler: handler} -} - -/* - GetTransportationOfficesOpen swagger:route GET /open/transportation-offices transportationOffice getTransportationOfficesOpen - -# Returns the transportation offices matching the search query - -This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query. -*/ -type GetTransportationOfficesOpen struct { - Context *middleware.Context - Handler GetTransportationOfficesOpenHandler -} - -func (o *GetTransportationOfficesOpen) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetTransportationOfficesOpenParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go deleted file mode 100644 index 87d8e07ea5d..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetTransportationOfficesOpenParams creates a new GetTransportationOfficesOpenParams object -// -// There are no default values defined in the spec. -func NewGetTransportationOfficesOpenParams() GetTransportationOfficesOpenParams { - - return GetTransportationOfficesOpenParams{} -} - -// GetTransportationOfficesOpenParams contains all the bound params for the get transportation offices open operation -// typically these are obtained from a http.Request -// -// swagger:parameters getTransportationOfficesOpen -type GetTransportationOfficesOpenParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Search string for transportation offices - Required: true - Min Length: 2 - In: query - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesOpenParams() beforehand. -func (o *GetTransportationOfficesOpenParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSearch, qhkSearch, _ := qs.GetOK("search") - if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from query. -func (o *GetTransportationOfficesOpenParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("search", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("search", "query", raw); err != nil { - return err - } - o.Search = raw - - if err := o.validateSearch(formats); err != nil { - return err - } - - return nil -} - -// validateSearch carries on validations for parameter Search -func (o *GetTransportationOfficesOpenParams) validateSearch(formats strfmt.Registry) error { - - if err := validate.MinLength("search", "query", o.Search, 2); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go deleted file mode 100644 index bb5a2aaae03..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetTransportationOfficesOpenOKCode is the HTTP code returned for type GetTransportationOfficesOpenOK -const GetTransportationOfficesOpenOKCode int = 200 - -/* -GetTransportationOfficesOpenOK Successfully retrieved transportation offices - -swagger:response getTransportationOfficesOpenOK -*/ -type GetTransportationOfficesOpenOK struct { - - /* - In: Body - */ - Payload ghcmessages.TransportationOffices `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenOK creates GetTransportationOfficesOpenOK with default headers values -func NewGetTransportationOfficesOpenOK() *GetTransportationOfficesOpenOK { - - return &GetTransportationOfficesOpenOK{} -} - -// WithPayload adds the payload to the get transportation offices open o k response -func (o *GetTransportationOfficesOpenOK) WithPayload(payload ghcmessages.TransportationOffices) *GetTransportationOfficesOpenOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open o k response -func (o *GetTransportationOfficesOpenOK) SetPayload(payload ghcmessages.TransportationOffices) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.TransportationOffices{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetTransportationOfficesOpenBadRequestCode is the HTTP code returned for type GetTransportationOfficesOpenBadRequest -const GetTransportationOfficesOpenBadRequestCode int = 400 - -/* -GetTransportationOfficesOpenBadRequest The request payload is invalid - -swagger:response getTransportationOfficesOpenBadRequest -*/ -type GetTransportationOfficesOpenBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenBadRequest creates GetTransportationOfficesOpenBadRequest with default headers values -func NewGetTransportationOfficesOpenBadRequest() *GetTransportationOfficesOpenBadRequest { - - return &GetTransportationOfficesOpenBadRequest{} -} - -// WithPayload adds the payload to the get transportation offices open bad request response -func (o *GetTransportationOfficesOpenBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open bad request response -func (o *GetTransportationOfficesOpenBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesOpenUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesOpenUnauthorized -const GetTransportationOfficesOpenUnauthorizedCode int = 401 - -/* -GetTransportationOfficesOpenUnauthorized The request was denied - -swagger:response getTransportationOfficesOpenUnauthorized -*/ -type GetTransportationOfficesOpenUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenUnauthorized creates GetTransportationOfficesOpenUnauthorized with default headers values -func NewGetTransportationOfficesOpenUnauthorized() *GetTransportationOfficesOpenUnauthorized { - - return &GetTransportationOfficesOpenUnauthorized{} -} - -// WithPayload adds the payload to the get transportation offices open unauthorized response -func (o *GetTransportationOfficesOpenUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open unauthorized response -func (o *GetTransportationOfficesOpenUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesOpenForbiddenCode is the HTTP code returned for type GetTransportationOfficesOpenForbidden -const GetTransportationOfficesOpenForbiddenCode int = 403 - -/* -GetTransportationOfficesOpenForbidden The request was denied - -swagger:response getTransportationOfficesOpenForbidden -*/ -type GetTransportationOfficesOpenForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenForbidden creates GetTransportationOfficesOpenForbidden with default headers values -func NewGetTransportationOfficesOpenForbidden() *GetTransportationOfficesOpenForbidden { - - return &GetTransportationOfficesOpenForbidden{} -} - -// WithPayload adds the payload to the get transportation offices open forbidden response -func (o *GetTransportationOfficesOpenForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open forbidden response -func (o *GetTransportationOfficesOpenForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesOpenNotFoundCode is the HTTP code returned for type GetTransportationOfficesOpenNotFound -const GetTransportationOfficesOpenNotFoundCode int = 404 - -/* -GetTransportationOfficesOpenNotFound The requested resource wasn't found - -swagger:response getTransportationOfficesOpenNotFound -*/ -type GetTransportationOfficesOpenNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenNotFound creates GetTransportationOfficesOpenNotFound with default headers values -func NewGetTransportationOfficesOpenNotFound() *GetTransportationOfficesOpenNotFound { - - return &GetTransportationOfficesOpenNotFound{} -} - -// WithPayload adds the payload to the get transportation offices open not found response -func (o *GetTransportationOfficesOpenNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open not found response -func (o *GetTransportationOfficesOpenNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesOpenInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesOpenInternalServerError -const GetTransportationOfficesOpenInternalServerErrorCode int = 500 - -/* -GetTransportationOfficesOpenInternalServerError A server error occurred - -swagger:response getTransportationOfficesOpenInternalServerError -*/ -type GetTransportationOfficesOpenInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOpenInternalServerError creates GetTransportationOfficesOpenInternalServerError with default headers values -func NewGetTransportationOfficesOpenInternalServerError() *GetTransportationOfficesOpenInternalServerError { - - return &GetTransportationOfficesOpenInternalServerError{} -} - -// WithPayload adds the payload to the get transportation offices open internal server error response -func (o *GetTransportationOfficesOpenInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices open internal server error response -func (o *GetTransportationOfficesOpenInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOpenInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go deleted file mode 100644 index d559a132ce4..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetTransportationOfficesOpenURL generates an URL for the get transportation offices open operation -type GetTransportationOfficesOpenURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesOpenURL) WithBasePath(bp string) *GetTransportationOfficesOpenURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesOpenURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetTransportationOfficesOpenURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/open/transportation-offices" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - searchQ := o.Search - if searchQ != "" { - qs.Set("search", searchQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetTransportationOfficesOpenURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetTransportationOfficesOpenURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetTransportationOfficesOpenURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetTransportationOfficesOpenURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetTransportationOfficesOpenURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetTransportationOfficesOpenURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go deleted file mode 100644 index 4ffe186391e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetTransportationOfficesParams creates a new GetTransportationOfficesParams object -// -// There are no default values defined in the spec. -func NewGetTransportationOfficesParams() GetTransportationOfficesParams { - - return GetTransportationOfficesParams{} -} - -// GetTransportationOfficesParams contains all the bound params for the get transportation offices operation -// typically these are obtained from a http.Request -// -// swagger:parameters getTransportationOffices -type GetTransportationOfficesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Search string for transportation offices - Required: true - Min Length: 2 - In: query - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesParams() beforehand. -func (o *GetTransportationOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSearch, qhkSearch, _ := qs.GetOK("search") - if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from query. -func (o *GetTransportationOfficesParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("search", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("search", "query", raw); err != nil { - return err - } - o.Search = raw - - if err := o.validateSearch(formats); err != nil { - return err - } - - return nil -} - -// validateSearch carries on validations for parameter Search -func (o *GetTransportationOfficesParams) validateSearch(formats strfmt.Registry) error { - - if err := validate.MinLength("search", "query", o.Search, 2); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go deleted file mode 100644 index 8d85d775341..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetTransportationOfficesOKCode is the HTTP code returned for type GetTransportationOfficesOK -const GetTransportationOfficesOKCode int = 200 - -/* -GetTransportationOfficesOK Successfully retrieved transportation offices - -swagger:response getTransportationOfficesOK -*/ -type GetTransportationOfficesOK struct { - - /* - In: Body - */ - Payload ghcmessages.TransportationOffices `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOK creates GetTransportationOfficesOK with default headers values -func NewGetTransportationOfficesOK() *GetTransportationOfficesOK { - - return &GetTransportationOfficesOK{} -} - -// WithPayload adds the payload to the get transportation offices o k response -func (o *GetTransportationOfficesOK) WithPayload(payload ghcmessages.TransportationOffices) *GetTransportationOfficesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices o k response -func (o *GetTransportationOfficesOK) SetPayload(payload ghcmessages.TransportationOffices) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = ghcmessages.TransportationOffices{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetTransportationOfficesBadRequestCode is the HTTP code returned for type GetTransportationOfficesBadRequest -const GetTransportationOfficesBadRequestCode int = 400 - -/* -GetTransportationOfficesBadRequest The request payload is invalid - -swagger:response getTransportationOfficesBadRequest -*/ -type GetTransportationOfficesBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesBadRequest creates GetTransportationOfficesBadRequest with default headers values -func NewGetTransportationOfficesBadRequest() *GetTransportationOfficesBadRequest { - - return &GetTransportationOfficesBadRequest{} -} - -// WithPayload adds the payload to the get transportation offices bad request response -func (o *GetTransportationOfficesBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices bad request response -func (o *GetTransportationOfficesBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesUnauthorized -const GetTransportationOfficesUnauthorizedCode int = 401 - -/* -GetTransportationOfficesUnauthorized The request was denied - -swagger:response getTransportationOfficesUnauthorized -*/ -type GetTransportationOfficesUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesUnauthorized creates GetTransportationOfficesUnauthorized with default headers values -func NewGetTransportationOfficesUnauthorized() *GetTransportationOfficesUnauthorized { - - return &GetTransportationOfficesUnauthorized{} -} - -// WithPayload adds the payload to the get transportation offices unauthorized response -func (o *GetTransportationOfficesUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices unauthorized response -func (o *GetTransportationOfficesUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesForbiddenCode is the HTTP code returned for type GetTransportationOfficesForbidden -const GetTransportationOfficesForbiddenCode int = 403 - -/* -GetTransportationOfficesForbidden The request was denied - -swagger:response getTransportationOfficesForbidden -*/ -type GetTransportationOfficesForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesForbidden creates GetTransportationOfficesForbidden with default headers values -func NewGetTransportationOfficesForbidden() *GetTransportationOfficesForbidden { - - return &GetTransportationOfficesForbidden{} -} - -// WithPayload adds the payload to the get transportation offices forbidden response -func (o *GetTransportationOfficesForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices forbidden response -func (o *GetTransportationOfficesForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesNotFoundCode is the HTTP code returned for type GetTransportationOfficesNotFound -const GetTransportationOfficesNotFoundCode int = 404 - -/* -GetTransportationOfficesNotFound The requested resource wasn't found - -swagger:response getTransportationOfficesNotFound -*/ -type GetTransportationOfficesNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesNotFound creates GetTransportationOfficesNotFound with default headers values -func NewGetTransportationOfficesNotFound() *GetTransportationOfficesNotFound { - - return &GetTransportationOfficesNotFound{} -} - -// WithPayload adds the payload to the get transportation offices not found response -func (o *GetTransportationOfficesNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices not found response -func (o *GetTransportationOfficesNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesInternalServerError -const GetTransportationOfficesInternalServerErrorCode int = 500 - -/* -GetTransportationOfficesInternalServerError A server error occurred - -swagger:response getTransportationOfficesInternalServerError -*/ -type GetTransportationOfficesInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesInternalServerError creates GetTransportationOfficesInternalServerError with default headers values -func NewGetTransportationOfficesInternalServerError() *GetTransportationOfficesInternalServerError { - - return &GetTransportationOfficesInternalServerError{} -} - -// WithPayload adds the payload to the get transportation offices internal server error response -func (o *GetTransportationOfficesInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices internal server error response -func (o *GetTransportationOfficesInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go deleted file mode 100644 index 540f7a01edd..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetTransportationOfficesURL generates an URL for the get transportation offices operation -type GetTransportationOfficesURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesURL) WithBasePath(bp string) *GetTransportationOfficesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetTransportationOfficesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transportation-offices" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - searchQ := o.Search - if searchQ != "" { - qs.Set("search", searchQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetTransportationOfficesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetTransportationOfficesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetTransportationOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetTransportationOfficesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetTransportationOfficesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetTransportationOfficesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go deleted file mode 100644 index 91b006bd391..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler -type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { - return fn(params) -} - -// CreateUploadHandler interface for that can handle valid create upload params -type CreateUploadHandler interface { - Handle(CreateUploadParams) middleware.Responder -} - -// NewCreateUpload creates a new http.Handler for the create upload operation -func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { - return &CreateUpload{Context: ctx, Handler: handler} -} - -/* - CreateUpload swagger:route POST /uploads uploads createUpload - -# Create a new upload - -Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future. -*/ -type CreateUpload struct { - Context *middleware.Context - Handler CreateUploadHandler -} - -func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go deleted file mode 100644 index c3c00400764..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// CreateUploadMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreateUploadMaxParseMemory int64 = 32 << 20 - -// NewCreateUploadParams creates a new CreateUploadParams object -// -// There are no default values defined in the spec. -func NewCreateUploadParams() CreateUploadParams { - - return CreateUploadParams{} -} - -// CreateUploadParams contains all the bound params for the create upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters createUpload -type CreateUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the document to add an upload to - In: query - */ - DocumentID *strfmt.UUID - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. -func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") - if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { - res = append(res, err) - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDocumentID binds and validates parameter DocumentID from query. -func (o *CreateUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) - } - o.DocumentID = (value.(*strfmt.UUID)) - - if err := o.validateDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateDocumentID carries on validations for parameter DocumentID -func (o *CreateUploadParams) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go deleted file mode 100644 index f6f0c90faed..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated -const CreateUploadCreatedCode int = 201 - -/* -CreateUploadCreated created upload - -swagger:response createUploadCreated -*/ -type CreateUploadCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.Upload `json:"body,omitempty"` -} - -// NewCreateUploadCreated creates CreateUploadCreated with default headers values -func NewCreateUploadCreated() *CreateUploadCreated { - - return &CreateUploadCreated{} -} - -// WithPayload adds the payload to the create upload created response -func (o *CreateUploadCreated) WithPayload(payload *ghcmessages.Upload) *CreateUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload created response -func (o *CreateUploadCreated) SetPayload(payload *ghcmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest -const CreateUploadBadRequestCode int = 400 - -/* -CreateUploadBadRequest invalid request - -swagger:response createUploadBadRequest -*/ -type CreateUploadBadRequest struct { -} - -// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values -func NewCreateUploadBadRequest() *CreateUploadBadRequest { - - return &CreateUploadBadRequest{} -} - -// WriteResponse to the client -func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden -const CreateUploadForbiddenCode int = 403 - -/* -CreateUploadForbidden not authorized - -swagger:response createUploadForbidden -*/ -type CreateUploadForbidden struct { -} - -// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values -func NewCreateUploadForbidden() *CreateUploadForbidden { - - return &CreateUploadForbidden{} -} - -// WriteResponse to the client -func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound -const CreateUploadNotFoundCode int = 404 - -/* -CreateUploadNotFound not found - -swagger:response createUploadNotFound -*/ -type CreateUploadNotFound struct { -} - -// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values -func NewCreateUploadNotFound() *CreateUploadNotFound { - - return &CreateUploadNotFound{} -} - -// WriteResponse to the client -func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// CreateUploadRequestEntityTooLargeCode is the HTTP code returned for type CreateUploadRequestEntityTooLarge -const CreateUploadRequestEntityTooLargeCode int = 413 - -/* -CreateUploadRequestEntityTooLarge payload is too large - -swagger:response createUploadRequestEntityTooLarge -*/ -type CreateUploadRequestEntityTooLarge struct { -} - -// NewCreateUploadRequestEntityTooLarge creates CreateUploadRequestEntityTooLarge with default headers values -func NewCreateUploadRequestEntityTooLarge() *CreateUploadRequestEntityTooLarge { - - return &CreateUploadRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *CreateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError -const CreateUploadInternalServerErrorCode int = 500 - -/* -CreateUploadInternalServerError server error - -swagger:response createUploadInternalServerError -*/ -type CreateUploadInternalServerError struct { -} - -// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values -func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { - - return &CreateUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go deleted file mode 100644 index 526f68188d1..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// CreateUploadURL generates an URL for the create upload operation -type CreateUploadURL struct { - DocumentID *strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var documentIDQ string - if o.DocumentID != nil { - documentIDQ = o.DocumentID.String() - } - if documentIDQ != "" { - qs.Set("documentId", documentIDQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go deleted file mode 100644 index 7b3c8a85298..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteUploadHandlerFunc turns a function with the right signature into a delete upload handler -type DeleteUploadHandlerFunc func(DeleteUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteUploadHandlerFunc) Handle(params DeleteUploadParams) middleware.Responder { - return fn(params) -} - -// DeleteUploadHandler interface for that can handle valid delete upload params -type DeleteUploadHandler interface { - Handle(DeleteUploadParams) middleware.Responder -} - -// NewDeleteUpload creates a new http.Handler for the delete upload operation -func NewDeleteUpload(ctx *middleware.Context, handler DeleteUploadHandler) *DeleteUpload { - return &DeleteUpload{Context: ctx, Handler: handler} -} - -/* - DeleteUpload swagger:route DELETE /uploads/{uploadID} uploads deleteUpload - -# Deletes an upload - -Uploads represent a single digital file, such as a JPEG or PDF. -*/ -type DeleteUpload struct { - Context *middleware.Context - Handler DeleteUploadHandler -} - -func (o *DeleteUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go deleted file mode 100644 index dbda2b48511..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go +++ /dev/null @@ -1,140 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteUploadParams creates a new DeleteUploadParams object -// -// There are no default values defined in the spec. -func NewDeleteUploadParams() DeleteUploadParams { - - return DeleteUploadParams{} -} - -// DeleteUploadParams contains all the bound params for the delete upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteUpload -type DeleteUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the order that the upload belongs to - In: query - */ - OrderID *strfmt.UUID - /*UUID of the upload to be deleted - Required: true - In: path - */ - UploadID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteUploadParams() beforehand. -func (o *DeleteUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qOrderID, qhkOrderID, _ := qs.GetOK("orderID") - if err := o.bindOrderID(qOrderID, qhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - - rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadID") - if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOrderID binds and validates parameter OrderID from query. -func (o *DeleteUploadParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderID", "query", "strfmt.UUID", raw) - } - o.OrderID = (value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *DeleteUploadParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderID", "query", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} - -// bindUploadID binds and validates parameter UploadID from path. -func (o *DeleteUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("uploadID", "path", "strfmt.UUID", raw) - } - o.UploadID = *(value.(*strfmt.UUID)) - - if err := o.validateUploadID(formats); err != nil { - return err - } - - return nil -} - -// validateUploadID carries on validations for parameter UploadID -func (o *DeleteUploadParams) validateUploadID(formats strfmt.Registry) error { - - if err := validate.FormatOf("uploadID", "path", "uuid", o.UploadID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go deleted file mode 100644 index 27997373cea..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// DeleteUploadNoContentCode is the HTTP code returned for type DeleteUploadNoContent -const DeleteUploadNoContentCode int = 204 - -/* -DeleteUploadNoContent deleted - -swagger:response deleteUploadNoContent -*/ -type DeleteUploadNoContent struct { -} - -// NewDeleteUploadNoContent creates DeleteUploadNoContent with default headers values -func NewDeleteUploadNoContent() *DeleteUploadNoContent { - - return &DeleteUploadNoContent{} -} - -// WriteResponse to the client -func (o *DeleteUploadNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteUploadBadRequestCode is the HTTP code returned for type DeleteUploadBadRequest -const DeleteUploadBadRequestCode int = 400 - -/* -DeleteUploadBadRequest invalid request - -swagger:response deleteUploadBadRequest -*/ -type DeleteUploadBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewDeleteUploadBadRequest creates DeleteUploadBadRequest with default headers values -func NewDeleteUploadBadRequest() *DeleteUploadBadRequest { - - return &DeleteUploadBadRequest{} -} - -// WithPayload adds the payload to the delete upload bad request response -func (o *DeleteUploadBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *DeleteUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete upload bad request response -func (o *DeleteUploadBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteUploadForbiddenCode is the HTTP code returned for type DeleteUploadForbidden -const DeleteUploadForbiddenCode int = 403 - -/* -DeleteUploadForbidden not authorized - -swagger:response deleteUploadForbidden -*/ -type DeleteUploadForbidden struct { -} - -// NewDeleteUploadForbidden creates DeleteUploadForbidden with default headers values -func NewDeleteUploadForbidden() *DeleteUploadForbidden { - - return &DeleteUploadForbidden{} -} - -// WriteResponse to the client -func (o *DeleteUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// DeleteUploadNotFoundCode is the HTTP code returned for type DeleteUploadNotFound -const DeleteUploadNotFoundCode int = 404 - -/* -DeleteUploadNotFound not found - -swagger:response deleteUploadNotFound -*/ -type DeleteUploadNotFound struct { -} - -// NewDeleteUploadNotFound creates DeleteUploadNotFound with default headers values -func NewDeleteUploadNotFound() *DeleteUploadNotFound { - - return &DeleteUploadNotFound{} -} - -// WriteResponse to the client -func (o *DeleteUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// DeleteUploadInternalServerErrorCode is the HTTP code returned for type DeleteUploadInternalServerError -const DeleteUploadInternalServerErrorCode int = 500 - -/* -DeleteUploadInternalServerError server error - -swagger:response deleteUploadInternalServerError -*/ -type DeleteUploadInternalServerError struct { -} - -// NewDeleteUploadInternalServerError creates DeleteUploadInternalServerError with default headers values -func NewDeleteUploadInternalServerError() *DeleteUploadInternalServerError { - - return &DeleteUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *DeleteUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go deleted file mode 100644 index 64a468d4251..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteUploadURL generates an URL for the delete upload operation -type DeleteUploadURL struct { - UploadID strfmt.UUID - - OrderID *strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadURL) WithBasePath(bp string) *DeleteUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads/{uploadID}" - - uploadID := o.UploadID.String() - if uploadID != "" { - _path = strings.Replace(_path, "{uploadID}", uploadID, -1) - } else { - return nil, errors.New("uploadId is required on DeleteUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var orderIDQ string - if o.OrderID != nil { - orderIDQ = o.OrderID.String() - } - if orderIDQ != "" { - qs.Set("orderID", orderIDQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go deleted file mode 100644 index df53caf0b06..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetUploadHandlerFunc turns a function with the right signature into a get upload handler -type GetUploadHandlerFunc func(GetUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetUploadHandlerFunc) Handle(params GetUploadParams) middleware.Responder { - return fn(params) -} - -// GetUploadHandler interface for that can handle valid get upload params -type GetUploadHandler interface { - Handle(GetUploadParams) middleware.Responder -} - -// NewGetUpload creates a new http.Handler for the get upload operation -func NewGetUpload(ctx *middleware.Context, handler GetUploadHandler) *GetUpload { - return &GetUpload{Context: ctx, Handler: handler} -} - -/* - GetUpload swagger:route GET /uploads/get/ uploads getUpload - -# Gets an upload by ID - -Gets an upload -*/ -type GetUpload struct { - Context *middleware.Context - Handler GetUploadHandler -} - -func (o *GetUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go deleted file mode 100644 index ecb5da8a69c..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetUploadParams creates a new GetUploadParams object -// -// There are no default values defined in the spec. -func NewGetUploadParams() GetUploadParams { - - return GetUploadParams{} -} - -// GetUploadParams contains all the bound params for the get upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters getUpload -type GetUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetUploadParams() beforehand. -func (o *GetUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go deleted file mode 100644 index b4eba10ed6e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetUploadOKCode is the HTTP code returned for type GetUploadOK -const GetUploadOKCode int = 200 - -/* -GetUploadOK Successfully retrieved upload - -swagger:response getUploadOK -*/ -type GetUploadOK struct { - - /* - In: Body - */ - Payload *ghcmessages.Upload `json:"body,omitempty"` -} - -// NewGetUploadOK creates GetUploadOK with default headers values -func NewGetUploadOK() *GetUploadOK { - - return &GetUploadOK{} -} - -// WithPayload adds the payload to the get upload o k response -func (o *GetUploadOK) WithPayload(payload *ghcmessages.Upload) *GetUploadOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload o k response -func (o *GetUploadOK) SetPayload(payload *ghcmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadBadRequestCode is the HTTP code returned for type GetUploadBadRequest -const GetUploadBadRequestCode int = 400 - -/* -GetUploadBadRequest The request payload is invalid - -swagger:response getUploadBadRequest -*/ -type GetUploadBadRequest struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetUploadBadRequest creates GetUploadBadRequest with default headers values -func NewGetUploadBadRequest() *GetUploadBadRequest { - - return &GetUploadBadRequest{} -} - -// WithPayload adds the payload to the get upload bad request response -func (o *GetUploadBadRequest) WithPayload(payload *ghcmessages.Error) *GetUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload bad request response -func (o *GetUploadBadRequest) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadUnauthorizedCode is the HTTP code returned for type GetUploadUnauthorized -const GetUploadUnauthorizedCode int = 401 - -/* -GetUploadUnauthorized The request was denied - -swagger:response getUploadUnauthorized -*/ -type GetUploadUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetUploadUnauthorized creates GetUploadUnauthorized with default headers values -func NewGetUploadUnauthorized() *GetUploadUnauthorized { - - return &GetUploadUnauthorized{} -} - -// WithPayload adds the payload to the get upload unauthorized response -func (o *GetUploadUnauthorized) WithPayload(payload *ghcmessages.Error) *GetUploadUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload unauthorized response -func (o *GetUploadUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadForbiddenCode is the HTTP code returned for type GetUploadForbidden -const GetUploadForbiddenCode int = 403 - -/* -GetUploadForbidden The request was denied - -swagger:response getUploadForbidden -*/ -type GetUploadForbidden struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetUploadForbidden creates GetUploadForbidden with default headers values -func NewGetUploadForbidden() *GetUploadForbidden { - - return &GetUploadForbidden{} -} - -// WithPayload adds the payload to the get upload forbidden response -func (o *GetUploadForbidden) WithPayload(payload *ghcmessages.Error) *GetUploadForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload forbidden response -func (o *GetUploadForbidden) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadNotFoundCode is the HTTP code returned for type GetUploadNotFound -const GetUploadNotFoundCode int = 404 - -/* -GetUploadNotFound The requested resource wasn't found - -swagger:response getUploadNotFound -*/ -type GetUploadNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetUploadNotFound creates GetUploadNotFound with default headers values -func NewGetUploadNotFound() *GetUploadNotFound { - - return &GetUploadNotFound{} -} - -// WithPayload adds the payload to the get upload not found response -func (o *GetUploadNotFound) WithPayload(payload *ghcmessages.Error) *GetUploadNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload not found response -func (o *GetUploadNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetUploadInternalServerErrorCode is the HTTP code returned for type GetUploadInternalServerError -const GetUploadInternalServerErrorCode int = 500 - -/* -GetUploadInternalServerError A server error occurred - -swagger:response getUploadInternalServerError -*/ -type GetUploadInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetUploadInternalServerError creates GetUploadInternalServerError with default headers values -func NewGetUploadInternalServerError() *GetUploadInternalServerError { - - return &GetUploadInternalServerError{} -} - -// WithPayload adds the payload to the get upload internal server error response -func (o *GetUploadInternalServerError) WithPayload(payload *ghcmessages.Error) *GetUploadInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get upload internal server error response -func (o *GetUploadInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go deleted file mode 100644 index 94ea195a90a..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetUploadURL generates an URL for the get upload operation -type GetUploadURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUploadURL) WithBasePath(bp string) *GetUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads/get/" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go deleted file mode 100644 index f861fa06ad8..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateUploadHandlerFunc turns a function with the right signature into a update upload handler -type UpdateUploadHandlerFunc func(UpdateUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateUploadHandlerFunc) Handle(params UpdateUploadParams) middleware.Responder { - return fn(params) -} - -// UpdateUploadHandler interface for that can handle valid update upload params -type UpdateUploadHandler interface { - Handle(UpdateUploadParams) middleware.Responder -} - -// NewUpdateUpload creates a new http.Handler for the update upload operation -func NewUpdateUpload(ctx *middleware.Context, handler UpdateUploadHandler) *UpdateUpload { - return &UpdateUpload{Context: ctx, Handler: handler} -} - -/* - UpdateUpload swagger:route PATCH /uploads/{uploadID}/update uploads updateUpload - -Update an existing upload. This is only needed currently for updating the image rotation. - -Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page. -*/ -type UpdateUpload struct { - Context *middleware.Context - Handler UpdateUploadHandler -} - -func (o *UpdateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// UpdateUploadBody update upload body -// -// swagger:model UpdateUploadBody -type UpdateUploadBody struct { - - // The rotation of the image - // Maximum: 3 - // Minimum: 0 - Rotation *int64 `json:"rotation,omitempty"` -} - -// Validate validates this update upload body -func (o *UpdateUploadBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateRotation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *UpdateUploadBody) validateRotation(formats strfmt.Registry) error { - if swag.IsZero(o.Rotation) { // not required - return nil - } - - if err := validate.MinimumInt("body"+"."+"rotation", "body", *o.Rotation, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("body"+"."+"rotation", "body", *o.Rotation, 3, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update upload body based on context it is used -func (o *UpdateUploadBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *UpdateUploadBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *UpdateUploadBody) UnmarshalBinary(b []byte) error { - var res UpdateUploadBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go deleted file mode 100644 index d068e218990..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateUploadParams creates a new UpdateUploadParams object -// -// There are no default values defined in the spec. -func NewUpdateUploadParams() UpdateUploadParams { - - return UpdateUploadParams{} -} - -// UpdateUploadParams contains all the bound params for the update upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateUpload -type UpdateUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body UpdateUploadBody - /*UUID of the upload to be updated - Required: true - In: path - */ - UploadID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateUploadParams() beforehand. -func (o *UpdateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body UpdateUploadBody - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadID") - if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindUploadID binds and validates parameter UploadID from path. -func (o *UpdateUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("uploadID", "path", "strfmt.UUID", raw) - } - o.UploadID = *(value.(*strfmt.UUID)) - - if err := o.validateUploadID(formats); err != nil { - return err - } - - return nil -} - -// validateUploadID carries on validations for parameter UploadID -func (o *UpdateUploadParams) validateUploadID(formats strfmt.Registry) error { - - if err := validate.FormatOf("uploadID", "path", "uuid", o.UploadID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go deleted file mode 100644 index 236a1d4ec73..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// UpdateUploadCreatedCode is the HTTP code returned for type UpdateUploadCreated -const UpdateUploadCreatedCode int = 201 - -/* -UpdateUploadCreated updated upload - -swagger:response updateUploadCreated -*/ -type UpdateUploadCreated struct { - - /* - In: Body - */ - Payload *ghcmessages.Upload `json:"body,omitempty"` -} - -// NewUpdateUploadCreated creates UpdateUploadCreated with default headers values -func NewUpdateUploadCreated() *UpdateUploadCreated { - - return &UpdateUploadCreated{} -} - -// WithPayload adds the payload to the update upload created response -func (o *UpdateUploadCreated) WithPayload(payload *ghcmessages.Upload) *UpdateUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update upload created response -func (o *UpdateUploadCreated) SetPayload(payload *ghcmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateUploadBadRequestCode is the HTTP code returned for type UpdateUploadBadRequest -const UpdateUploadBadRequestCode int = 400 - -/* -UpdateUploadBadRequest invalid request - -swagger:response updateUploadBadRequest -*/ -type UpdateUploadBadRequest struct { -} - -// NewUpdateUploadBadRequest creates UpdateUploadBadRequest with default headers values -func NewUpdateUploadBadRequest() *UpdateUploadBadRequest { - - return &UpdateUploadBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateUploadForbiddenCode is the HTTP code returned for type UpdateUploadForbidden -const UpdateUploadForbiddenCode int = 403 - -/* -UpdateUploadForbidden not authorized - -swagger:response updateUploadForbidden -*/ -type UpdateUploadForbidden struct { -} - -// NewUpdateUploadForbidden creates UpdateUploadForbidden with default headers values -func NewUpdateUploadForbidden() *UpdateUploadForbidden { - - return &UpdateUploadForbidden{} -} - -// WriteResponse to the client -func (o *UpdateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateUploadNotFoundCode is the HTTP code returned for type UpdateUploadNotFound -const UpdateUploadNotFoundCode int = 404 - -/* -UpdateUploadNotFound not found - -swagger:response updateUploadNotFound -*/ -type UpdateUploadNotFound struct { -} - -// NewUpdateUploadNotFound creates UpdateUploadNotFound with default headers values -func NewUpdateUploadNotFound() *UpdateUploadNotFound { - - return &UpdateUploadNotFound{} -} - -// WriteResponse to the client -func (o *UpdateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateUploadRequestEntityTooLargeCode is the HTTP code returned for type UpdateUploadRequestEntityTooLarge -const UpdateUploadRequestEntityTooLargeCode int = 413 - -/* -UpdateUploadRequestEntityTooLarge payload is too large - -swagger:response updateUploadRequestEntityTooLarge -*/ -type UpdateUploadRequestEntityTooLarge struct { -} - -// NewUpdateUploadRequestEntityTooLarge creates UpdateUploadRequestEntityTooLarge with default headers values -func NewUpdateUploadRequestEntityTooLarge() *UpdateUploadRequestEntityTooLarge { - - return &UpdateUploadRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *UpdateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// UpdateUploadInternalServerErrorCode is the HTTP code returned for type UpdateUploadInternalServerError -const UpdateUploadInternalServerErrorCode int = 500 - -/* -UpdateUploadInternalServerError server error - -swagger:response updateUploadInternalServerError -*/ -type UpdateUploadInternalServerError struct { -} - -// NewUpdateUploadInternalServerError creates UpdateUploadInternalServerError with default headers values -func NewUpdateUploadInternalServerError() *UpdateUploadInternalServerError { - - return &UpdateUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go deleted file mode 100644 index e7df609bf1e..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateUploadURL generates an URL for the update upload operation -type UpdateUploadURL struct { - UploadID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateUploadURL) WithBasePath(bp string) *UpdateUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads/{uploadID}/update" - - uploadID := o.UploadID.String() - if uploadID != "" { - _path = strings.Replace(_path, "{uploadID}", uploadID, -1) - } else { - return nil, errors.New("uploadId is required on UpdateUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcapi/server.go b/pkg/gen/ghcapi/server.go deleted file mode 100644 index 7ab2c3d1029..00000000000 --- a/pkg/gen/ghcapi/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *ghcoperations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *ghcoperations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *ghcoperations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go b/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go deleted file mode 100644 index 5b34ee2a4bc..00000000000 --- a/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BulkAssignmentMoveIDs bulk assignment move i ds -// -// swagger:model BulkAssignmentMoveIDs -type BulkAssignmentMoveIDs []BulkAssignmentMoveID - -// Validate validates this bulk assignment move i ds -func (m BulkAssignmentMoveIDs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this bulk assignment move i ds based on the context it is used -func (m BulkAssignmentMoveIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/bulk_assignment_move_id.go b/pkg/gen/ghcmessages/bulk_assignment_move_id.go deleted file mode 100644 index 505c9541f63..00000000000 --- a/pkg/gen/ghcmessages/bulk_assignment_move_id.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// BulkAssignmentMoveID bulk assignment move ID -// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 -// -// swagger:model BulkAssignmentMoveID -type BulkAssignmentMoveID strfmt.UUID - -// Validate validates this bulk assignment move ID -func (m BulkAssignmentMoveID) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this bulk assignment move ID based on context it is used -func (m BulkAssignmentMoveID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/client_error.go b/pkg/gen/ghcmessages/client_error.go deleted file mode 100644 index d5b7a412b94..00000000000 --- a/pkg/gen/ghcmessages/client_error.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ClientError client error -// -// swagger:model ClientError -type ClientError struct { - - // detail - // Required: true - Detail *string `json:"detail"` - - // instance - // Required: true - // Format: uuid - Instance *strfmt.UUID `json:"instance"` - - // title - // Required: true - Title *string `json:"title"` -} - -// Validate validates this client error -func (m *ClientError) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ClientError) validateDetail(formats strfmt.Registry) error { - - if err := validate.Required("detail", "body", m.Detail); err != nil { - return err - } - - return nil -} - -func (m *ClientError) validateInstance(formats strfmt.Registry) error { - - if err := validate.Required("instance", "body", m.Instance); err != nil { - return err - } - - if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ClientError) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this client error based on context it is used -func (m *ClientError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ClientError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ClientError) UnmarshalBinary(b []byte) error { - var res ClientError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/contractor.go b/pkg/gen/ghcmessages/contractor.go deleted file mode 100644 index 71c37c4c052..00000000000 --- a/pkg/gen/ghcmessages/contractor.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Contractor contractor -// -// swagger:model Contractor -type Contractor struct { - - // contract number - ContractNumber string `json:"contractNumber,omitempty"` - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // name - Name string `json:"name,omitempty"` - - // type - Type string `json:"type,omitempty"` -} - -// Validate validates this contractor -func (m *Contractor) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Contractor) 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 -} - -// ContextValidate validates this contractor based on context it is used -func (m *Contractor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Contractor) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Contractor) UnmarshalBinary(b []byte) error { - var res Contractor - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go deleted file mode 100644 index d6bed9fac0c..00000000000 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CounselingUpdateAllowancePayload counseling update allowance payload -// -// swagger:model CounselingUpdateAllowancePayload -type CounselingUpdateAllowancePayload struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - - // agency - Agency *Affiliation `json:"agency,omitempty"` - - // dependents authorized - DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. - GunSafe *bool `json:"gunSafe,omitempty"` - - // only for Army - OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` - - // unit is in lbs - // Example: 2000 - // Maximum: 2000 - // Minimum: 0 - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // unit is in lbs - // Example: 2000 - // Maximum: 500 - // Minimum: 0 - ProGearWeightSpouse *int64 `json:"proGearWeightSpouse,omitempty"` - - // unit is in lbs - // Example: 2000 - // Minimum: 0 - RequiredMedicalEquipmentWeight *int64 `json:"requiredMedicalEquipmentWeight,omitempty"` - - // the number of storage in transit days that the customer is entitled to for a given shipment on their move - // Minimum: 0 - StorageInTransit *int64 `json:"storageInTransit,omitempty"` - - // ub allowance - // Example: 500 - UbAllowance *int64 `json:"ubAllowance,omitempty"` -} - -// Validate validates this counseling update allowance payload -func (m *CounselingUpdateAllowancePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgency(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightSpouse(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredMedicalEquipmentWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageInTransit(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateAgency(formats strfmt.Registry) error { - if swag.IsZero(m.Agency) { // not required - return nil - } - - if m.Agency != nil { - if err := m.Agency.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateProGearWeight(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeight) { // not required - return nil - } - - if err := validate.MinimumInt("proGearWeight", "body", *m.ProGearWeight, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("proGearWeight", "body", *m.ProGearWeight, 2000, false); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateProGearWeightSpouse(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeightSpouse) { // not required - return nil - } - - if err := validate.MinimumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 500, false); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateRequiredMedicalEquipmentWeight(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredMedicalEquipmentWeight) { // not required - return nil - } - - if err := validate.MinimumInt("requiredMedicalEquipmentWeight", "body", *m.RequiredMedicalEquipmentWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) validateStorageInTransit(formats strfmt.Registry) error { - if swag.IsZero(m.StorageInTransit) { // not required - return nil - } - - if err := validate.MinimumInt("storageInTransit", "body", *m.StorageInTransit, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this counseling update allowance payload based on the context it is used -func (m *CounselingUpdateAllowancePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgency(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CounselingUpdateAllowancePayload) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { - - if m.Agency != nil { - - if swag.IsZero(m.Agency) { // not required - return nil - } - - if err := m.Agency.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateAllowancePayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CounselingUpdateAllowancePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CounselingUpdateAllowancePayload) UnmarshalBinary(b []byte) error { - var res CounselingUpdateAllowancePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/counseling_update_order_payload.go b/pkg/gen/ghcmessages/counseling_update_order_payload.go deleted file mode 100644 index a03a99a22de..00000000000 --- a/pkg/gen/ghcmessages/counseling_update_order_payload.go +++ /dev/null @@ -1,533 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - "github.com/transcom/mymove/pkg/swagger/nullable" -) - -// CounselingUpdateOrderPayload counseling update order payload -// -// swagger:model CounselingUpdateOrderPayload -type CounselingUpdateOrderPayload struct { - - // department indicator - DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // Orders date - // - // The date and time that these orders were cut. - // Example: 2018-04-26 - // Required: true - // Format: date - IssueDate *strfmt.Date `json:"issueDate"` - - // new duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` - - // NTS SAC - // Example: N002214CSW32Y9 - NtsSac nullable.String `json:"ntsSac,omitempty"` - - // NTS TAC - // Example: F8J1 - NtsTac nullable.String `json:"ntsTac,omitempty"` - - // Orders Number - // Example: 030-00362 - OrdersNumber *string `json:"ordersNumber,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"ordersType"` - - // orders type detail - OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` - - // origin duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - OriginDutyLocationID *strfmt.UUID `json:"originDutyLocationId"` - - // Report-by date - // - // Report By Date - // Example: 2018-04-26 - // Required: true - // Format: date - ReportByDate *strfmt.Date `json:"reportByDate"` - - // HHG SAC - // Example: N002214CSW32Y9 - Sac nullable.String `json:"sac,omitempty"` - - // HHG TAC - // Example: F8J1 - // Max Length: 4 - // Min Length: 4 - Tac *string `json:"tac,omitempty"` -} - -// Validate validates this counseling update order payload -func (m *CounselingUpdateOrderPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssueDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNtsSac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNtsTac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTac(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CounselingUpdateOrderPayload) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateIssueDate(formats strfmt.Registry) error { - - if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { - return err - } - - if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateNewDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateNtsSac(formats strfmt.Registry) error { - if swag.IsZero(m.NtsSac) { // not required - return nil - } - - if err := m.NtsSac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsSac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsSac") - } - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateNtsTac(formats strfmt.Registry) error { - if swag.IsZero(m.NtsTac) { // not required - return nil - } - - if err := m.NtsTac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsTac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsTac") - } - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateOrdersTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if m.OrdersTypeDetail != nil { - if err := m.OrdersTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateOriginDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("originDutyLocationId", "body", m.OriginDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateReportByDate(formats strfmt.Registry) error { - - if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { - return err - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateSac(formats strfmt.Registry) error { - if swag.IsZero(m.Sac) { // not required - return nil - } - - if err := m.Sac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sac") - } - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) validateTac(formats strfmt.Registry) error { - if swag.IsZero(m.Tac) { // not required - return nil - } - - if err := validate.MinLength("tac", "body", *m.Tac, 4); err != nil { - return err - } - - if err := validate.MaxLength("tac", "body", *m.Tac, 4); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this counseling update order payload based on the context it is used -func (m *CounselingUpdateOrderPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNtsSac(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNtsTac(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSac(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateNtsSac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.NtsSac) { // not required - return nil - } - - if err := m.NtsSac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsSac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsSac") - } - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateNtsTac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.NtsTac) { // not required - return nil - } - - if err := m.NtsTac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsTac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsTac") - } - return err - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersTypeDetail != nil { - - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -func (m *CounselingUpdateOrderPayload) contextValidateSac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Sac) { // not required - return nil - } - - if err := m.Sac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sac") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CounselingUpdateOrderPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CounselingUpdateOrderPayload) UnmarshalBinary(b []byte) error { - var res CounselingUpdateOrderPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_appeal.go b/pkg/gen/ghcmessages/create_appeal.go deleted file mode 100644 index 7ac06af37b8..00000000000 --- a/pkg/gen/ghcmessages/create_appeal.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateAppeal Appeal status and remarks left for a violation, created by a GSR user. -// -// swagger:model CreateAppeal -type CreateAppeal struct { - - // The status of the appeal set by the GSR user - // Example: These are my violation appeal remarks - // Enum: [sustained rejected] - AppealStatus string `json:"appealStatus,omitempty"` - - // Remarks left by the GSR user - // Example: These are my violation appeal remarks - Remarks string `json:"remarks,omitempty"` -} - -// Validate validates this create appeal -func (m *CreateAppeal) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppealStatus(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var createAppealTypeAppealStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["sustained","rejected"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createAppealTypeAppealStatusPropEnum = append(createAppealTypeAppealStatusPropEnum, v) - } -} - -const ( - - // CreateAppealAppealStatusSustained captures enum value "sustained" - CreateAppealAppealStatusSustained string = "sustained" - - // CreateAppealAppealStatusRejected captures enum value "rejected" - CreateAppealAppealStatusRejected string = "rejected" -) - -// prop value enum -func (m *CreateAppeal) validateAppealStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createAppealTypeAppealStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateAppeal) validateAppealStatus(formats strfmt.Registry) error { - if swag.IsZero(m.AppealStatus) { // not required - return nil - } - - // value enum - if err := m.validateAppealStatusEnum("appealStatus", "body", m.AppealStatus); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create appeal based on context it is used -func (m *CreateAppeal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateAppeal) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateAppeal) UnmarshalBinary(b []byte) error { - var res CreateAppeal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go b/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go deleted file mode 100644 index c69f080a112..00000000000 --- a/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateApprovedSITDurationUpdate create approved s i t duration update -// -// swagger:model CreateApprovedSITDurationUpdate -type CreateApprovedSITDurationUpdate struct { - - // Number of days approved for SIT extension. This will match requested days saved to the SIT extension model. - // Example: 21 - // Required: true - ApprovedDays *int64 `json:"approvedDays"` - - // Remarks from TOO about SIT Duration Update creation - // Example: Customer needs additional storage time as their new place of residence is not yet ready - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // Reason from service counselor-provided picklist for SIT Duration Update - // Example: AWAITING_COMPLETION_OF_RESIDENCE - // Required: true - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason *string `json:"requestReason"` -} - -// Validate validates this create approved s i t duration update -func (m *CreateApprovedSITDurationUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedDays(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateApprovedSITDurationUpdate) validateApprovedDays(formats strfmt.Registry) error { - - if err := validate.Required("approvedDays", "body", m.ApprovedDays); err != nil { - return err - } - - return nil -} - -var createApprovedSITDurationUpdateTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createApprovedSITDurationUpdateTypeRequestReasonPropEnum = append(createApprovedSITDurationUpdateTypeRequestReasonPropEnum, v) - } -} - -const ( - - // CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // CreateApprovedSITDurationUpdateRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - CreateApprovedSITDurationUpdateRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // CreateApprovedSITDurationUpdateRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - CreateApprovedSITDurationUpdateRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // CreateApprovedSITDurationUpdateRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - CreateApprovedSITDurationUpdateRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // CreateApprovedSITDurationUpdateRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - CreateApprovedSITDurationUpdateRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // CreateApprovedSITDurationUpdateRequestReasonOTHER captures enum value "OTHER" - CreateApprovedSITDurationUpdateRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *CreateApprovedSITDurationUpdate) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createApprovedSITDurationUpdateTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateApprovedSITDurationUpdate) validateRequestReason(formats strfmt.Registry) error { - - if err := validate.Required("requestReason", "body", m.RequestReason); err != nil { - return err - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", *m.RequestReason); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create approved s i t duration update based on context it is used -func (m *CreateApprovedSITDurationUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateApprovedSITDurationUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateApprovedSITDurationUpdate) UnmarshalBinary(b []byte) error { - var res CreateApprovedSITDurationUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_boat_shipment.go b/pkg/gen/ghcmessages/create_boat_shipment.go deleted file mode 100644 index 20a5708a369..00000000000 --- a/pkg/gen/ghcmessages/create_boat_shipment.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateBoatShipment Boat shipment information for the move. -// -// swagger:model CreateBoatShipment -type CreateBoatShipment struct { - - // Does the boat have a trailer - // Required: true - HasTrailer *bool `json:"hasTrailer"` - - // Height of the Boat in inches - // Required: true - HeightInInches *int64 `json:"heightInInches"` - - // Is the trailer roadworthy - IsRoadworthy *bool `json:"isRoadworthy,omitempty"` - - // Length of the Boat in inches - // Required: true - LengthInInches *int64 `json:"lengthInInches"` - - // Make of the Boat - // Required: true - Make *string `json:"make"` - - // Model of the Boat - // Required: true - Model *string `json:"model"` - - // type - // Required: true - // Enum: [HAUL_AWAY TOW_AWAY] - Type *string `json:"type"` - - // Width of the Boat in inches - // Required: true - WidthInInches *int64 `json:"widthInInches"` - - // Year of the Boat - // Required: true - Year *int64 `json:"year"` -} - -// Validate validates this create boat shipment -func (m *CreateBoatShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHasTrailer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHeightInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLengthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMake(formats); err != nil { - res = append(res, err) - } - - if err := m.validateModel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateYear(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateBoatShipment) validateHasTrailer(formats strfmt.Registry) error { - - if err := validate.Required("hasTrailer", "body", m.HasTrailer); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateHeightInInches(formats strfmt.Registry) error { - - if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateLengthInInches(formats strfmt.Registry) error { - - if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateMake(formats strfmt.Registry) error { - - if err := validate.Required("make", "body", m.Make); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateModel(formats strfmt.Registry) error { - - if err := validate.Required("model", "body", m.Model); err != nil { - return err - } - - return nil -} - -var createBoatShipmentTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - createBoatShipmentTypeTypePropEnum = append(createBoatShipmentTypeTypePropEnum, v) - } -} - -const ( - - // CreateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" - CreateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" - - // CreateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" - CreateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" -) - -// prop value enum -func (m *CreateBoatShipment) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, createBoatShipmentTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *CreateBoatShipment) validateType(formats strfmt.Registry) error { - - if err := validate.Required("type", "body", m.Type); err != nil { - return err - } - - // value enum - if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateWidthInInches(formats strfmt.Registry) error { - - if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateBoatShipment) validateYear(formats strfmt.Registry) error { - - if err := validate.Required("year", "body", m.Year); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create boat shipment based on context it is used -func (m *CreateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateBoatShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateBoatShipment) UnmarshalBinary(b []byte) error { - var res CreateBoatShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_customer_payload.go b/pkg/gen/ghcmessages/create_customer_payload.go deleted file mode 100644 index 68ece54fb88..00000000000 --- a/pkg/gen/ghcmessages/create_customer_payload.go +++ /dev/null @@ -1,344 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateCustomerPayload create customer payload -// -// swagger:model CreateCustomerPayload -type CreateCustomerPayload struct { - - // affiliation - Affiliation *Affiliation `json:"affiliation,omitempty"` - - // backup contact - BackupContact *BackupContact `json:"backupContact,omitempty"` - - // backup mailing address - BackupMailingAddress struct { - Address - } `json:"backupMailingAddress,omitempty"` - - // cac user - CacUser bool `json:"cacUser,omitempty"` - - // create okta account - CreateOktaAccount bool `json:"createOktaAccount,omitempty"` - - // edipi - // Example: 1234567890 - // Max Length: 10 - Edipi string `json:"edipi,omitempty"` - - // email is preferred - EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` - - // emplid - // Example: 9485155 - // Max Length: 7 - Emplid *string `json:"emplid,omitempty"` - - // first name - // Example: John - FirstName string `json:"firstName,omitempty"` - - // last name - // Example: Doe - LastName string `json:"lastName,omitempty"` - - // middle name - // Example: David - MiddleName *string `json:"middleName,omitempty"` - - // personal email - // Example: personalEmail@email.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail string `json:"personalEmail,omitempty"` - - // phone is preferred - PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` - - // residential address - ResidentialAddress struct { - Address - } `json:"residentialAddress,omitempty"` - - // secondary telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` - - // suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` -} - -// Validate validates this create customer payload -func (m *CreateCustomerPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffiliation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupContact(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupMailingAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmplid(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResidentialAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCustomerPayload) validateAffiliation(formats strfmt.Registry) error { - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if m.Affiliation != nil { - if err := m.Affiliation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *CreateCustomerPayload) validateBackupContact(formats strfmt.Registry) error { - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if m.BackupContact != nil { - if err := m.BackupContact.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupContact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupContact") - } - return err - } - } - - return nil -} - -func (m *CreateCustomerPayload) validateBackupMailingAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateCustomerPayload) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.Edipi) { // not required - return nil - } - - if err := validate.MaxLength("edipi", "body", m.Edipi, 10); err != nil { - return err - } - - return nil -} - -func (m *CreateCustomerPayload) validateEmplid(formats strfmt.Registry) error { - if swag.IsZero(m.Emplid) { // not required - return nil - } - - if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { - return err - } - - return nil -} - -func (m *CreateCustomerPayload) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personalEmail", "body", m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateCustomerPayload) validateResidentialAddress(formats strfmt.Registry) error { - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateCustomerPayload) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateCustomerPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create customer payload based on the context it is used -func (m *CreateCustomerPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAffiliation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupContact(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCustomerPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { - - if m.Affiliation != nil { - - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *CreateCustomerPayload) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupContact != nil { - - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupContact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupContact") - } - return err - } - } - - return nil -} - -func (m *CreateCustomerPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateCustomerPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateCustomerPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateCustomerPayload) UnmarshalBinary(b []byte) error { - var res CreateCustomerPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_customer_support_remark.go b/pkg/gen/ghcmessages/create_customer_support_remark.go deleted file mode 100644 index 59a5e99ac4b..00000000000 --- a/pkg/gen/ghcmessages/create_customer_support_remark.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateCustomerSupportRemark A text remark written by an customer support user that is associated with a specific move. -// -// swagger:model CreateCustomerSupportRemark -type CreateCustomerSupportRemark struct { - - // content - // Example: This is a remark about a move. - // Required: true - Content *string `json:"content"` - - // office user ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - OfficeUserID *strfmt.UUID `json:"officeUserID"` -} - -// Validate validates this create customer support remark -func (m *CreateCustomerSupportRemark) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateCustomerSupportRemark) validateContent(formats strfmt.Registry) error { - - if err := validate.Required("content", "body", m.Content); err != nil { - return err - } - - return nil -} - -func (m *CreateCustomerSupportRemark) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.Required("officeUserID", "body", m.OfficeUserID); err != nil { - return err - } - - if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create customer support remark based on context it is used -func (m *CreateCustomerSupportRemark) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateCustomerSupportRemark) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateCustomerSupportRemark) UnmarshalBinary(b []byte) error { - var res CreateCustomerSupportRemark - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_evaluation_report.go b/pkg/gen/ghcmessages/create_evaluation_report.go deleted file mode 100644 index 20b8ad439ca..00000000000 --- a/pkg/gen/ghcmessages/create_evaluation_report.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateEvaluationReport Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID. -// -// swagger:model CreateEvaluationReport -type CreateEvaluationReport struct { - - // The shipment ID of the shipment to be evaluated in the report - // Example: 01b9671e-b268-4906-967b-ba661a1d3933 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` -} - -// Validate validates this create evaluation report -func (m *CreateEvaluationReport) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateEvaluationReport) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create evaluation report based on context it is used -func (m *CreateEvaluationReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateEvaluationReport) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateEvaluationReport) UnmarshalBinary(b []byte) error { - var res CreateEvaluationReport - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_m_t_o_shipment.go b/pkg/gen/ghcmessages/create_m_t_o_shipment.go deleted file mode 100644 index 6a6a5924fc5..00000000000 --- a/pkg/gen/ghcmessages/create_m_t_o_shipment.go +++ /dev/null @@ -1,817 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateMTOShipment create m t o shipment -// -// swagger:model CreateMTOShipment -type CreateMTOShipment struct { - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // boat shipment - BoatShipment *CreateBoatShipment `json:"boatShipment,omitempty"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // The customer can use the customer remarks field to inform the services counselor and the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // Customer enters this information during onboarding. Optional field. - // - // Example: handle with care - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // Where the movers should deliver this shipment. - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // has secondary delivery address - HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary delivery address - HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // mobile home shipment - MobileHomeShipment *CreateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` - - // The ID of the move this new shipment is for. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - // mto service items - MtoServiceItems MTOServiceItems `json:"mtoServiceItems,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 2000 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The address where the movers should pick up this shipment. - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *CreatePPMShipment `json:"ppmShipment,omitempty"` - - // The customer's preferred delivery date. - // - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. - // - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // sac type - SacType *LOAType `json:"sacType,omitempty"` - - // Where the movers should deliver this shipment. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // The address where the movers should pick up this shipment. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // service order number - ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` - - // shipment type - // Required: true - ShipmentType *MTOShipmentType `json:"shipmentType"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // tac type - TacType *LOAType `json:"tacType,omitempty"` - - // Where the movers should deliver this shipment. - TertiaryDeliveryAddress struct { - Address - } `json:"tertiaryDeliveryAddress,omitempty"` - - // The address where the movers should pick up this shipment. - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` - - // uses external vendor - // Example: false - UsesExternalVendor *bool `json:"usesExternalVendor,omitempty"` -} - -// Validate validates this create m t o shipment -func (m *CreateMTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateMTOShipment) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *CreateMTOShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateMTOShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateMTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItems) { // not required - return nil - } - - if err := m.MtoServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems") - } - return err - } - - return nil -} - -func (m *CreateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateMTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateMTOShipment) validateSacType(formats strfmt.Registry) error { - if swag.IsZero(m.SacType) { // not required - return nil - } - - if m.SacType != nil { - if err := m.SacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateMTOShipment) validateShipmentType(formats strfmt.Registry) error { - - if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { - return err - } - - if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { - return err - } - - if m.ShipmentType != nil { - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateTacType(formats strfmt.Registry) error { - if swag.IsZero(m.TacType) { // not required - return nil - } - - if m.TacType != nil { - if err := m.TacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *CreateMTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -// ContextValidate validate this create m t o shipment based on the context it is used -func (m *CreateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateMTOShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems") - } - return err - } - - return nil -} - -func (m *CreateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { - - if m.SacType != nil { - - if swag.IsZero(m.SacType) { // not required - return nil - } - - if err := m.SacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if m.ShipmentType != nil { - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { - - if m.TacType != nil { - - if swag.IsZero(m.TacType) { // not required - return nil - } - - if err := m.TacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - } - - return nil -} - -func (m *CreateMTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreateMTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateMTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateMTOShipment) UnmarshalBinary(b []byte) error { - var res CreateMTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_mobile_home_shipment.go b/pkg/gen/ghcmessages/create_mobile_home_shipment.go deleted file mode 100644 index 0f1ecd5a474..00000000000 --- a/pkg/gen/ghcmessages/create_mobile_home_shipment.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateMobileHomeShipment A mobile home shipment that the prime moves for a service member. -// -// swagger:model CreateMobileHomeShipment -type CreateMobileHomeShipment struct { - - // Height of the Mobile Home in inches - // Required: true - HeightInInches *int64 `json:"heightInInches"` - - // Length of the Mobile Home in inches - // Required: true - LengthInInches *int64 `json:"lengthInInches"` - - // Make of the Mobile Home - // Required: true - Make *string `json:"make"` - - // Model of the Mobile Home - // Required: true - Model *string `json:"model"` - - // Width of the Mobile Home in inches - // Required: true - WidthInInches *int64 `json:"widthInInches"` - - // Year of the Mobile Home - // Required: true - Year *int64 `json:"year"` -} - -// Validate validates this create mobile home shipment -func (m *CreateMobileHomeShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeightInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLengthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMake(formats); err != nil { - res = append(res, err) - } - - if err := m.validateModel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateYear(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateMobileHomeShipment) validateHeightInInches(formats strfmt.Registry) error { - - if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateLengthInInches(formats strfmt.Registry) error { - - if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateMake(formats strfmt.Registry) error { - - if err := validate.Required("make", "body", m.Make); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateModel(formats strfmt.Registry) error { - - if err := validate.Required("model", "body", m.Model); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateWidthInInches(formats strfmt.Registry) error { - - if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateYear(formats strfmt.Registry) error { - - if err := validate.Required("year", "body", m.Year); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create mobile home shipment based on context it is used -func (m *CreateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateMobileHomeShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateMobileHomeShipment) UnmarshalBinary(b []byte) error { - var res CreateMobileHomeShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_orders.go b/pkg/gen/ghcmessages/create_orders.go deleted file mode 100644 index 25f77f42c15..00000000000 --- a/pkg/gen/ghcmessages/create_orders.go +++ /dev/null @@ -1,438 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateOrders create orders -// -// swagger:model CreateOrders -type CreateOrders struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // Are dependents included in your orders? - // Required: true - HasDependents *bool `json:"hasDependents"` - - // Orders date - // - // The date and time that these orders were cut. - // Required: true - // Format: date - IssueDate *strfmt.Date `json:"issueDate"` - - // new duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` - - // Orders Number - // Example: 030-00362 - OrdersNumber *string `json:"ordersNumber,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"ordersType"` - - // orders type detail - OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` - - // origin duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OriginDutyLocationID strfmt.UUID `json:"originDutyLocationId,omitempty"` - - // Report-by date - // - // Report By Date - // Required: true - // Format: date - ReportByDate *strfmt.Date `json:"reportByDate"` - - // SAC - // Example: N002214CSW32Y9 - Sac *string `json:"sac,omitempty"` - - // service member Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"serviceMemberId"` - - // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? - // Required: true - SpouseHasProGear *bool `json:"spouseHasProGear"` - - // TAC - // Example: F8J1 - Tac *string `json:"tac,omitempty"` -} - -// Validate validates this create orders -func (m *CreateOrders) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasDependents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssueDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpouseHasProGear(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateOrders) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) validateHasDependents(formats strfmt.Registry) error { - - if err := validate.Required("hasDependents", "body", m.HasDependents); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateIssueDate(formats strfmt.Registry) error { - - if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { - return err - } - - if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateNewDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) validateOrdersTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if m.OrdersTypeDetail != nil { - if err := m.OrdersTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) validateOriginDutyLocationID(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocationID) { // not required - return nil - } - - if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateReportByDate(formats strfmt.Registry) error { - - if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { - return err - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("serviceMemberId", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateOrders) validateSpouseHasProGear(formats strfmt.Registry) error { - - if err := validate.Required("spouseHasProGear", "body", m.SpouseHasProGear); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create orders based on the context it is used -func (m *CreateOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateOrders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *CreateOrders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersTypeDetail != nil { - - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateOrders) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateOrders) UnmarshalBinary(b []byte) error { - var res CreateOrders - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/create_p_p_m_shipment.go b/pkg/gen/ghcmessages/create_p_p_m_shipment.go deleted file mode 100644 index 87746177f68..00000000000 --- a/pkg/gen/ghcmessages/create_p_p_m_shipment.go +++ /dev/null @@ -1,404 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreatePPMShipment A personally procured move is a type of shipment that a service members moves themselves. -// -// swagger:model CreatePPMShipment -type CreatePPMShipment struct { - - // destination address - // Required: true - DestinationAddress struct { - PPMDestinationAddress - } `json:"destinationAddress"` - - // estimated weight - // Example: 4200 - // Required: true - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to move. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // Indicates whether PPM shipment has pro gear. - // - // Required: true - HasProGear *bool `json:"hasProGear"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // pickup address - // Required: true - PickupAddress struct { - Address - } `json:"pickupAddress"` - - // pro gear weight - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // secondary destination address - SecondaryDestinationAddress struct { - Address - } `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // sit estimated departure date - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` - - // sit estimated entry date - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` - - // sit estimated weight - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` - - // sit expected - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // spouse pro gear weight - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` - - // tertiary destination address - TertiaryDestinationAddress struct { - Address - } `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this create p p m shipment -func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasProGear(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) validateEstimatedWeight(formats strfmt.Registry) error { - - if err := validate.Required("estimatedWeight", "body", m.EstimatedWeight); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateHasProGear(formats strfmt.Registry) error { - - if err := validate.Required("hasProGear", "body", m.HasProGear); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *CreatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *CreatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -// ContextValidate validate this create p p m shipment based on the context it is used -func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *CreatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *CreatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreatePPMShipment) UnmarshalBinary(b []byte) error { - var res CreatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/created_customer.go b/pkg/gen/ghcmessages/created_customer.go deleted file mode 100644 index ec1b6ae0754..00000000000 --- a/pkg/gen/ghcmessages/created_customer.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreatedCustomer created customer -// -// swagger:model CreatedCustomer -type CreatedCustomer struct { - - // Branch of service customer is affilated with - Affiliation string `json:"affiliation,omitempty"` - - // backup address - BackupAddress *Address `json:"backupAddress,omitempty"` - - // backup contact - BackupContact *BackupContact `json:"backupContact,omitempty"` - - // cac validated - CacValidated bool `json:"cacValidated,omitempty"` - - // edipi - Edipi *string `json:"edipi,omitempty"` - - // email is preferred - EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` - - // first name - // Example: John - FirstName string `json:"firstName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Doe - LastName string `json:"lastName,omitempty"` - - // middle name - // Example: David - MiddleName *string `json:"middleName,omitempty"` - - // okta email - OktaEmail string `json:"oktaEmail,omitempty"` - - // okta ID - OktaID string `json:"oktaID,omitempty"` - - // personal email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail string `json:"personalEmail,omitempty"` - - // phone is preferred - PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` - - // residential address - ResidentialAddress *Address `json:"residentialAddress,omitempty"` - - // secondary telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` - - // suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // user ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"userID,omitempty"` -} - -// Validate validates this created customer -func (m *CreatedCustomer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupContact(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResidentialAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatedCustomer) validateBackupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupAddress) { // not required - return nil - } - - if m.BackupAddress != nil { - if err := m.BackupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatedCustomer) validateBackupContact(formats strfmt.Registry) error { - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if m.BackupContact != nil { - if err := m.BackupContact.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupContact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupContact") - } - return err - } - } - - return nil -} - -func (m *CreatedCustomer) 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 *CreatedCustomer) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personalEmail", "body", m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *CreatedCustomer) validateResidentialAddress(formats strfmt.Registry) error { - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if m.ResidentialAddress != nil { - if err := m.ResidentialAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residentialAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residentialAddress") - } - return err - } - } - - return nil -} - -func (m *CreatedCustomer) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *CreatedCustomer) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *CreatedCustomer) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this created customer based on the context it is used -func (m *CreatedCustomer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBackupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupContact(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatedCustomer) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupAddress != nil { - - if swag.IsZero(m.BackupAddress) { // not required - return nil - } - - if err := m.BackupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatedCustomer) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupContact != nil { - - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupContact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupContact") - } - return err - } - } - - return nil -} - -func (m *CreatedCustomer) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.ResidentialAddress != nil { - - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residentialAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residentialAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreatedCustomer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreatedCustomer) UnmarshalBinary(b []byte) error { - var res CreatedCustomer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/customer.go b/pkg/gen/ghcmessages/customer.go deleted file mode 100644 index c4034e3cfe2..00000000000 --- a/pkg/gen/ghcmessages/customer.go +++ /dev/null @@ -1,351 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Customer customer -// -// swagger:model Customer -type Customer struct { - - // Agency customer is affilated with - Agency string `json:"agency,omitempty"` - - // backup address - BackupAddress *Address `json:"backupAddress,omitempty"` - - // backup contact - BackupContact *BackupContact `json:"backup_contact,omitempty"` - - // cac validated - CacValidated *bool `json:"cacValidated,omitempty"` - - // current address - CurrentAddress *Address `json:"current_address,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // edipi - Edipi string `json:"edipi,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // email is preferred - EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` - - // emplid - Emplid *string `json:"emplid,omitempty"` - - // first name - // Example: John - FirstName string `json:"first_name,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Doe - LastName string `json:"last_name,omitempty"` - - // middle name - // Example: David - MiddleName *string `json:"middle_name,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` - - // phone is preferred - PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` - - // secondary telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ - SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` - - // suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // user ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"userID,omitempty"` -} - -// Validate validates this customer -func (m *Customer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupContact(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Customer) validateBackupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupAddress) { // not required - return nil - } - - if m.BackupAddress != nil { - if err := m.BackupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupAddress") - } - return err - } - } - - return nil -} - -func (m *Customer) validateBackupContact(formats strfmt.Registry) error { - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if m.BackupContact != nil { - if err := m.BackupContact.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contact") - } - return err - } - } - - return nil -} - -func (m *Customer) validateCurrentAddress(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentAddress) { // not required - return nil - } - - if m.CurrentAddress != nil { - if err := m.CurrentAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("current_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("current_address") - } - return err - } - } - - return nil -} - -func (m *Customer) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *Customer) 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 *Customer) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *Customer) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$|^$`); err != nil { - return err - } - - return nil -} - -func (m *Customer) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this customer based on the context it is used -func (m *Customer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBackupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupContact(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Customer) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupAddress != nil { - - if swag.IsZero(m.BackupAddress) { // not required - return nil - } - - if err := m.BackupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backupAddress") - } - return err - } - } - - return nil -} - -func (m *Customer) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupContact != nil { - - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contact") - } - return err - } - } - - return nil -} - -func (m *Customer) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.CurrentAddress != nil { - - if swag.IsZero(m.CurrentAddress) { // not required - return nil - } - - if err := m.CurrentAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("current_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("current_address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Customer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Customer) UnmarshalBinary(b []byte) error { - var res Customer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/customer_contact_type.go b/pkg/gen/ghcmessages/customer_contact_type.go deleted file mode 100644 index 61fc0f2c4d6..00000000000 --- a/pkg/gen/ghcmessages/customer_contact_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// CustomerContactType Describes a customer contact type for a MTOServiceItem of type domestic destination SIT. -// -// swagger:model CustomerContactType -type CustomerContactType string - -func NewCustomerContactType(value CustomerContactType) *CustomerContactType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated CustomerContactType. -func (m CustomerContactType) Pointer() *CustomerContactType { - return &m -} - -const ( - - // CustomerContactTypeFIRST captures enum value "FIRST" - CustomerContactTypeFIRST CustomerContactType = "FIRST" - - // CustomerContactTypeSECOND captures enum value "SECOND" - CustomerContactTypeSECOND CustomerContactType = "SECOND" -) - -// for schema -var customerContactTypeEnum []interface{} - -func init() { - var res []CustomerContactType - if err := json.Unmarshal([]byte(`["FIRST","SECOND"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - customerContactTypeEnum = append(customerContactTypeEnum, v) - } -} - -func (m CustomerContactType) validateCustomerContactTypeEnum(path, location string, value CustomerContactType) error { - if err := validate.EnumCase(path, location, value, customerContactTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this customer contact type -func (m CustomerContactType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateCustomerContactTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this customer contact type based on context it is used -func (m CustomerContactType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/customer_support_remark.go b/pkg/gen/ghcmessages/customer_support_remark.go deleted file mode 100644 index 9c13dbc6ff8..00000000000 --- a/pkg/gen/ghcmessages/customer_support_remark.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CustomerSupportRemark A text remark written by an office user that is associated with a specific move. -// -// swagger:model CustomerSupportRemark -type CustomerSupportRemark struct { - - // content - // Example: This is a remark about a move. - // Required: true - Content *string `json:"content"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // move ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveID *strfmt.UUID `json:"moveID"` - - // office user email - // Read Only: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - OfficeUserEmail string `json:"officeUserEmail,omitempty"` - - // office user first name - // Example: Grace - // Read Only: true - OfficeUserFirstName string `json:"officeUserFirstName,omitempty"` - - // office user ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - OfficeUserID *strfmt.UUID `json:"officeUserID"` - - // office user last name - // Example: Griffin - // Read Only: true - OfficeUserLastName string `json:"officeUserLastName,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this customer support remark -func (m *CustomerSupportRemark) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContent(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CustomerSupportRemark) validateContent(formats strfmt.Registry) error { - - if err := validate.Required("content", "body", m.Content); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("moveID", "body", m.MoveID); err != nil { - return err - } - - if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateOfficeUserEmail(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUserEmail) { // not required - return nil - } - - if err := validate.Pattern("officeUserEmail", "body", m.OfficeUserEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.Required("officeUserID", "body", m.OfficeUserID); err != nil { - return err - } - - if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this customer support remark based on the context it is used -func (m *CustomerSupportRemark) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUserEmail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUserFirstName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUserLastName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CustomerSupportRemark) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) contextValidateOfficeUserEmail(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "officeUserEmail", "body", string(m.OfficeUserEmail)); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) contextValidateOfficeUserFirstName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "officeUserFirstName", "body", string(m.OfficeUserFirstName)); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) contextValidateOfficeUserLastName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "officeUserLastName", "body", string(m.OfficeUserLastName)); err != nil { - return err - } - - return nil -} - -func (m *CustomerSupportRemark) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CustomerSupportRemark) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CustomerSupportRemark) UnmarshalBinary(b []byte) error { - var res CustomerSupportRemark - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/customer_support_remarks.go b/pkg/gen/ghcmessages/customer_support_remarks.go deleted file mode 100644 index f3668e48223..00000000000 --- a/pkg/gen/ghcmessages/customer_support_remarks.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CustomerSupportRemarks customer support remarks -// -// swagger:model CustomerSupportRemarks -type CustomerSupportRemarks []*CustomerSupportRemark - -// Validate validates this customer support remarks -func (m CustomerSupportRemarks) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this customer support remarks based on the context it is used -func (m CustomerSupportRemarks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/deny_s_i_t_extension.go b/pkg/gen/ghcmessages/deny_s_i_t_extension.go deleted file mode 100644 index 5737bac551c..00000000000 --- a/pkg/gen/ghcmessages/deny_s_i_t_extension.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DenySITExtension deny s i t extension -// -// swagger:model DenySITExtension -type DenySITExtension struct { - - // Whether or not to convert to members expense once SIT extension is denied. - // Example: false - // Required: true - ConvertToCustomerExpense *bool `json:"convertToCustomerExpense"` - - // Remarks from TOO about SIT denial - // Example: Denied this extension as it does not match the criteria - // Required: true - OfficeRemarks *string `json:"officeRemarks"` -} - -// Validate validates this deny s i t extension -func (m *DenySITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConvertToCustomerExpense(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeRemarks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DenySITExtension) validateConvertToCustomerExpense(formats strfmt.Registry) error { - - if err := validate.Required("convertToCustomerExpense", "body", m.ConvertToCustomerExpense); err != nil { - return err - } - - return nil -} - -func (m *DenySITExtension) validateOfficeRemarks(formats strfmt.Registry) error { - - if err := validate.Required("officeRemarks", "body", m.OfficeRemarks); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this deny s i t extension based on context it is used -func (m *DenySITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *DenySITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DenySITExtension) UnmarshalBinary(b []byte) error { - var res DenySITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/department_indicator.go b/pkg/gen/ghcmessages/department_indicator.go deleted file mode 100644 index 0c20239960c..00000000000 --- a/pkg/gen/ghcmessages/department_indicator.go +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DepartmentIndicator Department indicator -// -// # Military branch of service indicator for orders -// -// swagger:model DepartmentIndicator -type DepartmentIndicator string - -func NewDepartmentIndicator(value DepartmentIndicator) *DepartmentIndicator { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DepartmentIndicator. -func (m DepartmentIndicator) Pointer() *DepartmentIndicator { - return &m -} - -const ( - - // DepartmentIndicatorARMY captures enum value "ARMY" - DepartmentIndicatorARMY DepartmentIndicator = "ARMY" - - // DepartmentIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" - DepartmentIndicatorARMYCORPSOFENGINEERS DepartmentIndicator = "ARMY_CORPS_OF_ENGINEERS" - - // DepartmentIndicatorCOASTGUARD captures enum value "COAST_GUARD" - DepartmentIndicatorCOASTGUARD DepartmentIndicator = "COAST_GUARD" - - // DepartmentIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" - DepartmentIndicatorNAVYANDMARINES DepartmentIndicator = "NAVY_AND_MARINES" - - // DepartmentIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" - DepartmentIndicatorAIRANDSPACEFORCE DepartmentIndicator = "AIR_AND_SPACE_FORCE" - - // DepartmentIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" - DepartmentIndicatorOFFICEOFSECRETARYOFDEFENSE DepartmentIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" -) - -// for schema -var departmentIndicatorEnum []interface{} - -func init() { - var res []DepartmentIndicator - if err := json.Unmarshal([]byte(`["ARMY","ARMY_CORPS_OF_ENGINEERS","COAST_GUARD","NAVY_AND_MARINES","AIR_AND_SPACE_FORCE","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - departmentIndicatorEnum = append(departmentIndicatorEnum, v) - } -} - -func (m DepartmentIndicator) validateDepartmentIndicatorEnum(path, location string, value DepartmentIndicator) error { - if err := validate.EnumCase(path, location, value, departmentIndicatorEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this department indicator -func (m DepartmentIndicator) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDepartmentIndicatorEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this department indicator based on context it is used -func (m DepartmentIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/dept_indicator.go b/pkg/gen/ghcmessages/dept_indicator.go deleted file mode 100644 index 25167bade51..00000000000 --- a/pkg/gen/ghcmessages/dept_indicator.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DeptIndicator Dept. indicator -// -// swagger:model DeptIndicator -type DeptIndicator string - -func NewDeptIndicator(value DeptIndicator) *DeptIndicator { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DeptIndicator. -func (m DeptIndicator) Pointer() *DeptIndicator { - return &m -} - -const ( - - // DeptIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" - DeptIndicatorNAVYANDMARINES DeptIndicator = "NAVY_AND_MARINES" - - // DeptIndicatorARMY captures enum value "ARMY" - DeptIndicatorARMY DeptIndicator = "ARMY" - - // DeptIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" - DeptIndicatorARMYCORPSOFENGINEERS DeptIndicator = "ARMY_CORPS_OF_ENGINEERS" - - // DeptIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" - DeptIndicatorAIRANDSPACEFORCE DeptIndicator = "AIR_AND_SPACE_FORCE" - - // DeptIndicatorCOASTGUARD captures enum value "COAST_GUARD" - DeptIndicatorCOASTGUARD DeptIndicator = "COAST_GUARD" - - // DeptIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" - DeptIndicatorOFFICEOFSECRETARYOFDEFENSE DeptIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" -) - -// for schema -var deptIndicatorEnum []interface{} - -func init() { - var res []DeptIndicator - if err := json.Unmarshal([]byte(`["NAVY_AND_MARINES","ARMY","ARMY_CORPS_OF_ENGINEERS","AIR_AND_SPACE_FORCE","COAST_GUARD","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - deptIndicatorEnum = append(deptIndicatorEnum, v) - } -} - -func (m DeptIndicator) validateDeptIndicatorEnum(path, location string, value DeptIndicator) error { - if err := validate.EnumCase(path, location, value, deptIndicatorEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this dept indicator -func (m DeptIndicator) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDeptIndicatorEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this dept indicator based on context it is used -func (m DeptIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/destination_type.go b/pkg/gen/ghcmessages/destination_type.go deleted file mode 100644 index b36b646a7c4..00000000000 --- a/pkg/gen/ghcmessages/destination_type.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DestinationType Destination Type -// Example: OTHER_THAN_AUTHORIZED -// -// swagger:model DestinationType -type DestinationType string - -func NewDestinationType(value DestinationType) *DestinationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DestinationType. -func (m DestinationType) Pointer() *DestinationType { - return &m -} - -const ( - - // DestinationTypeHOMEOFRECORD captures enum value "HOME_OF_RECORD" - DestinationTypeHOMEOFRECORD DestinationType = "HOME_OF_RECORD" - - // DestinationTypeHOMEOFSELECTION captures enum value "HOME_OF_SELECTION" - DestinationTypeHOMEOFSELECTION DestinationType = "HOME_OF_SELECTION" - - // DestinationTypePLACEENTEREDACTIVEDUTY captures enum value "PLACE_ENTERED_ACTIVE_DUTY" - DestinationTypePLACEENTEREDACTIVEDUTY DestinationType = "PLACE_ENTERED_ACTIVE_DUTY" - - // DestinationTypeOTHERTHANAUTHORIZED captures enum value "OTHER_THAN_AUTHORIZED" - DestinationTypeOTHERTHANAUTHORIZED DestinationType = "OTHER_THAN_AUTHORIZED" -) - -// for schema -var destinationTypeEnum []interface{} - -func init() { - var res []DestinationType - if err := json.Unmarshal([]byte(`["HOME_OF_RECORD","HOME_OF_SELECTION","PLACE_ENTERED_ACTIVE_DUTY","OTHER_THAN_AUTHORIZED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - destinationTypeEnum = append(destinationTypeEnum, v) - } -} - -func (m DestinationType) validateDestinationTypeEnum(path, location string, value DestinationType) error { - if err := validate.EnumCase(path, location, value, destinationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this destination type -func (m DestinationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDestinationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this destination type based on context it is used -func (m DestinationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/dimension_type.go b/pkg/gen/ghcmessages/dimension_type.go deleted file mode 100644 index ebef7ab615c..00000000000 --- a/pkg/gen/ghcmessages/dimension_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DimensionType Describes a dimension type for a MTOServiceItemDimension. -// -// swagger:model DimensionType -type DimensionType string - -func NewDimensionType(value DimensionType) *DimensionType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DimensionType. -func (m DimensionType) Pointer() *DimensionType { - return &m -} - -const ( - - // DimensionTypeITEM captures enum value "ITEM" - DimensionTypeITEM DimensionType = "ITEM" - - // DimensionTypeCRATE captures enum value "CRATE" - DimensionTypeCRATE DimensionType = "CRATE" -) - -// for schema -var dimensionTypeEnum []interface{} - -func init() { - var res []DimensionType - if err := json.Unmarshal([]byte(`["ITEM","CRATE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - dimensionTypeEnum = append(dimensionTypeEnum, v) - } -} - -func (m DimensionType) validateDimensionTypeEnum(path, location string, value DimensionType) error { - if err := validate.EnumCase(path, location, value, dimensionTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this dimension type -func (m DimensionType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDimensionTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this dimension type based on context it is used -func (m DimensionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/document.go b/pkg/gen/ghcmessages/document.go deleted file mode 100644 index 9b67058b6aa..00000000000 --- a/pkg/gen/ghcmessages/document.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Document document -// -// swagger:model Document -type Document struct { - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // The service member this document belongs to - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"service_member_id"` - - // uploads - // Required: true - Uploads []*Upload `json:"uploads"` -} - -// Validate validates this document -func (m *Document) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Document) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Document) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Document) validateUploads(formats strfmt.Registry) error { - - if err := validate.Required("uploads", "body", m.Uploads); err != nil { - return err - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this document based on the context it is used -func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Document) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Document) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Document) UnmarshalBinary(b []byte) error { - var res Document - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/duty_location.go b/pkg/gen/ghcmessages/duty_location.go deleted file mode 100644 index 7eacde86380..00000000000 --- a/pkg/gen/ghcmessages/duty_location.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DutyLocation duty location -// -// swagger:model DutyLocation -type DutyLocation struct { - - // address - Address *Address `json:"address,omitempty"` - - // address id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - AddressID strfmt.UUID `json:"address_id,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // name - // Example: Fort Bragg North Station - Name string `json:"name,omitempty"` -} - -// Validate validates this duty location -func (m *DutyLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAddressID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocation) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *DutyLocation) validateAddressID(formats strfmt.Registry) error { - if swag.IsZero(m.AddressID) { // not required - return nil - } - - if err := validate.FormatOf("address_id", "body", "uuid", m.AddressID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocation) 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 -} - -// ContextValidate validate this duty location based on the context it is used -func (m *DutyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocation) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DutyLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DutyLocation) UnmarshalBinary(b []byte) error { - var res DutyLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go deleted file mode 100644 index 2ee15f3d03a..00000000000 --- a/pkg/gen/ghcmessages/entitlements.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Entitlements entitlements -// -// swagger:model Entitlements -type Entitlements struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - - // authorized weight - // Example: 2000 - AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` - - // dependents authorized - // Example: true - DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // gun safe - // Example: false - GunSafe bool `json:"gunSafe,omitempty"` - - // id - // Example: 571008b1-b0de-454d-b843-d71be9f02c04 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // non temporary storage - // Example: false - NonTemporaryStorage *bool `json:"nonTemporaryStorage,omitempty"` - - // organizational clothing and individual equipment - // Example: true - OrganizationalClothingAndIndividualEquipment bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` - - // privately owned vehicle - // Example: false - PrivatelyOwnedVehicle *bool `json:"privatelyOwnedVehicle,omitempty"` - - // pro gear weight - // Example: 2000 - ProGearWeight int64 `json:"proGearWeight,omitempty"` - - // pro gear weight spouse - // Example: 500 - ProGearWeightSpouse int64 `json:"proGearWeightSpouse,omitempty"` - - // required medical equipment weight - // Example: 500 - RequiredMedicalEquipmentWeight int64 `json:"requiredMedicalEquipmentWeight,omitempty"` - - // storage in transit - // Example: 90 - StorageInTransit *int64 `json:"storageInTransit,omitempty"` - - // total dependents - // Example: 2 - TotalDependents int64 `json:"totalDependents,omitempty"` - - // total weight - // Example: 500 - TotalWeight int64 `json:"totalWeight,omitempty"` - - // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. - // Example: 3 - UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` -} - -// Validate validates this entitlements -func (m *Entitlements) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Entitlements) 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 -} - -// ContextValidate validates this entitlements based on context it is used -func (m *Entitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Entitlements) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Entitlements) UnmarshalBinary(b []byte) error { - var res Entitlements - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/error.go b/pkg/gen/ghcmessages/error.go deleted file mode 100644 index d28746cc200..00000000000 --- a/pkg/gen/ghcmessages/error.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // message - // Required: true - Message *string `json:"message"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMessage(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Error) validateMessage(formats strfmt.Registry) error { - - if err := validate.Required("message", "body", m.Message); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report.go b/pkg/gen/ghcmessages/evaluation_report.go deleted file mode 100644 index 89713d04013..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report.go +++ /dev/null @@ -1,794 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EvaluationReport An evaluation report -// -// swagger:model EvaluationReport -type EvaluationReport struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // eval end - // Example: 18:00 - // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ - EvalEnd *string `json:"evalEnd,omitempty"` - - // eval start - // Example: 15:00 - // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ - EvalStart *string `json:"evalStart,omitempty"` - - // gsr appeals - GsrAppeals GSRAppeals `json:"gsrAppeals,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // inspection date - // Format: date - InspectionDate *strfmt.Date `json:"inspectionDate,omitempty"` - - // inspection type - InspectionType *EvaluationReportInspectionType `json:"inspectionType,omitempty"` - - // location - Location *EvaluationReportLocation `json:"location,omitempty"` - - // location description - // Example: Route 66 at crash inspection site 3 - LocationDescription *string `json:"locationDescription,omitempty"` - - // move ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveID strfmt.UUID `json:"moveID,omitempty"` - - // move reference ID - // Read Only: true - MoveReferenceID *string `json:"moveReferenceID,omitempty"` - - // observed claims response date - // Format: date - ObservedClaimsResponseDate *strfmt.Date `json:"observedClaimsResponseDate,omitempty"` - - // observed delivery date - // Format: date - ObservedDeliveryDate *strfmt.Date `json:"observedDeliveryDate,omitempty"` - - // observed pickup date - // Format: date - ObservedPickupDate *strfmt.Date `json:"observedPickupDate,omitempty"` - - // observed pickup spread end date - // Format: date - ObservedPickupSpreadEndDate *strfmt.Date `json:"observedPickupSpreadEndDate,omitempty"` - - // observed pickup spread start date - // Format: date - ObservedPickupSpreadStartDate *strfmt.Date `json:"observedPickupSpreadStartDate,omitempty"` - - // observed shipment delivery date - // Format: date - ObservedShipmentDeliveryDate *strfmt.Date `json:"observedShipmentDeliveryDate,omitempty"` - - // observed shipment physical pickup date - // Format: date - ObservedShipmentPhysicalPickupDate *strfmt.Date `json:"observedShipmentPhysicalPickupDate,omitempty"` - - // office user - OfficeUser *EvaluationReportOfficeUser `json:"officeUser,omitempty"` - - // remarks - Remarks *string `json:"remarks,omitempty"` - - // report violations - ReportViolations ReportViolations `json:"reportViolations,omitempty"` - - // serious incident - SeriousIncident *bool `json:"seriousIncident,omitempty"` - - // serious incident desc - SeriousIncidentDesc *string `json:"seriousIncidentDesc,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ShipmentID *strfmt.UUID `json:"shipmentID,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` - - // time depart - // Example: 14:30 - // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ - TimeDepart *string `json:"timeDepart,omitempty"` - - // type - Type EvaluationReportType `json:"type,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // violations observed - ViolationsObserved *bool `json:"violationsObserved,omitempty"` -} - -// Validate validates this evaluation report -func (m *EvaluationReport) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEvalEnd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEvalStart(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGsrAppeals(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInspectionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInspectionType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedClaimsResponseDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedPickupSpreadEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedPickupSpreadStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedShipmentDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObservedShipmentPhysicalPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportViolations(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeDepart(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EvaluationReport) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateEvalEnd(formats strfmt.Registry) error { - if swag.IsZero(m.EvalEnd) { // not required - return nil - } - - if err := validate.Pattern("evalEnd", "body", *m.EvalEnd, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateEvalStart(formats strfmt.Registry) error { - if swag.IsZero(m.EvalStart) { // not required - return nil - } - - if err := validate.Pattern("evalStart", "body", *m.EvalStart, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateGsrAppeals(formats strfmt.Registry) error { - if swag.IsZero(m.GsrAppeals) { // not required - return nil - } - - if err := m.GsrAppeals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gsrAppeals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gsrAppeals") - } - return err - } - - return nil -} - -func (m *EvaluationReport) 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 *EvaluationReport) validateInspectionDate(formats strfmt.Registry) error { - if swag.IsZero(m.InspectionDate) { // not required - return nil - } - - if err := validate.FormatOf("inspectionDate", "body", "date", m.InspectionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateInspectionType(formats strfmt.Registry) error { - if swag.IsZero(m.InspectionType) { // not required - return nil - } - - if m.InspectionType != nil { - if err := m.InspectionType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("inspectionType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("inspectionType") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) validateLocation(formats strfmt.Registry) error { - if swag.IsZero(m.Location) { // not required - return nil - } - - if m.Location != nil { - if err := m.Location.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) validateMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveID) { // not required - return nil - } - - if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedClaimsResponseDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedClaimsResponseDate) { // not required - return nil - } - - if err := validate.FormatOf("observedClaimsResponseDate", "body", "date", m.ObservedClaimsResponseDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("observedDeliveryDate", "body", "date", m.ObservedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("observedPickupDate", "body", "date", m.ObservedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedPickupSpreadEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedPickupSpreadEndDate) { // not required - return nil - } - - if err := validate.FormatOf("observedPickupSpreadEndDate", "body", "date", m.ObservedPickupSpreadEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedPickupSpreadStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedPickupSpreadStartDate) { // not required - return nil - } - - if err := validate.FormatOf("observedPickupSpreadStartDate", "body", "date", m.ObservedPickupSpreadStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedShipmentDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedShipmentDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("observedShipmentDeliveryDate", "body", "date", m.ObservedShipmentDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateObservedShipmentPhysicalPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ObservedShipmentPhysicalPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("observedShipmentPhysicalPickupDate", "body", "date", m.ObservedShipmentPhysicalPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateOfficeUser(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if m.OfficeUser != nil { - if err := m.OfficeUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("officeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("officeUser") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) validateReportViolations(formats strfmt.Registry) error { - if swag.IsZero(m.ReportViolations) { // not required - return nil - } - - if err := m.ReportViolations.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reportViolations") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reportViolations") - } - return err - } - - return nil -} - -func (m *EvaluationReport) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateTimeDepart(formats strfmt.Registry) error { - if swag.IsZero(m.TimeDepart) { // not required - return nil - } - - if err := validate.Pattern("timeDepart", "body", *m.TimeDepart, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -func (m *EvaluationReport) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this evaluation report based on the context it is used -func (m *EvaluationReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGsrAppeals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateInspectionType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveReferenceID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReportViolations(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EvaluationReport) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateGsrAppeals(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GsrAppeals.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gsrAppeals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gsrAppeals") - } - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateInspectionType(ctx context.Context, formats strfmt.Registry) error { - - if m.InspectionType != nil { - - if swag.IsZero(m.InspectionType) { // not required - return nil - } - - if err := m.InspectionType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("inspectionType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("inspectionType") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.Location != nil { - - if swag.IsZero(m.Location) { // not required - return nil - } - - if err := m.Location.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("location") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveID", "body", strfmt.UUID(m.MoveID)); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateMoveReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveReferenceID", "body", m.MoveReferenceID); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { - - if m.OfficeUser != nil { - - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("officeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("officeUser") - } - return err - } - } - - return nil -} - -func (m *EvaluationReport) contextValidateReportViolations(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ReportViolations.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reportViolations") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reportViolations") - } - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", m.ShipmentID); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -func (m *EvaluationReport) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *EvaluationReport) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EvaluationReport) UnmarshalBinary(b []byte) error { - var res EvaluationReport - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report_inspection_type.go b/pkg/gen/ghcmessages/evaluation_report_inspection_type.go deleted file mode 100644 index d538d76c6eb..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report_inspection_type.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EvaluationReportInspectionType evaluation report inspection type -// -// swagger:model EvaluationReportInspectionType -type EvaluationReportInspectionType string - -func NewEvaluationReportInspectionType(value EvaluationReportInspectionType) *EvaluationReportInspectionType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated EvaluationReportInspectionType. -func (m EvaluationReportInspectionType) Pointer() *EvaluationReportInspectionType { - return &m -} - -const ( - - // EvaluationReportInspectionTypeDATAREVIEW captures enum value "DATA_REVIEW" - EvaluationReportInspectionTypeDATAREVIEW EvaluationReportInspectionType = "DATA_REVIEW" - - // EvaluationReportInspectionTypePHYSICAL captures enum value "PHYSICAL" - EvaluationReportInspectionTypePHYSICAL EvaluationReportInspectionType = "PHYSICAL" - - // EvaluationReportInspectionTypeVIRTUAL captures enum value "VIRTUAL" - EvaluationReportInspectionTypeVIRTUAL EvaluationReportInspectionType = "VIRTUAL" -) - -// for schema -var evaluationReportInspectionTypeEnum []interface{} - -func init() { - var res []EvaluationReportInspectionType - if err := json.Unmarshal([]byte(`["DATA_REVIEW","PHYSICAL","VIRTUAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - evaluationReportInspectionTypeEnum = append(evaluationReportInspectionTypeEnum, v) - } -} - -func (m EvaluationReportInspectionType) validateEvaluationReportInspectionTypeEnum(path, location string, value EvaluationReportInspectionType) error { - if err := validate.EnumCase(path, location, value, evaluationReportInspectionTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this evaluation report inspection type -func (m EvaluationReportInspectionType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEvaluationReportInspectionTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this evaluation report inspection type based on context it is used -func (m EvaluationReportInspectionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report_list.go b/pkg/gen/ghcmessages/evaluation_report_list.go deleted file mode 100644 index 92c522e2ae8..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report_list.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// EvaluationReportList evaluation report list -// -// swagger:model EvaluationReportList -type EvaluationReportList []*EvaluationReport - -// Validate validates this evaluation report list -func (m EvaluationReportList) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this evaluation report list based on the context it is used -func (m EvaluationReportList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report_location.go b/pkg/gen/ghcmessages/evaluation_report_location.go deleted file mode 100644 index 558b8762a33..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report_location.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EvaluationReportLocation evaluation report location -// -// swagger:model EvaluationReportLocation -type EvaluationReportLocation string - -func NewEvaluationReportLocation(value EvaluationReportLocation) *EvaluationReportLocation { - return &value -} - -// Pointer returns a pointer to a freshly-allocated EvaluationReportLocation. -func (m EvaluationReportLocation) Pointer() *EvaluationReportLocation { - return &m -} - -const ( - - // EvaluationReportLocationORIGIN captures enum value "ORIGIN" - EvaluationReportLocationORIGIN EvaluationReportLocation = "ORIGIN" - - // EvaluationReportLocationDESTINATION captures enum value "DESTINATION" - EvaluationReportLocationDESTINATION EvaluationReportLocation = "DESTINATION" - - // EvaluationReportLocationOTHER captures enum value "OTHER" - EvaluationReportLocationOTHER EvaluationReportLocation = "OTHER" -) - -// for schema -var evaluationReportLocationEnum []interface{} - -func init() { - var res []EvaluationReportLocation - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - evaluationReportLocationEnum = append(evaluationReportLocationEnum, v) - } -} - -func (m EvaluationReportLocation) validateEvaluationReportLocationEnum(path, location string, value EvaluationReportLocation) error { - if err := validate.EnumCase(path, location, value, evaluationReportLocationEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this evaluation report location -func (m EvaluationReportLocation) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEvaluationReportLocationEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this evaluation report location based on context it is used -func (m EvaluationReportLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report_office_user.go b/pkg/gen/ghcmessages/evaluation_report_office_user.go deleted file mode 100644 index d492debd9cb..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report_office_user.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// EvaluationReportOfficeUser The authoring office user for an evaluation report -// -// swagger:model EvaluationReportOfficeUser -type EvaluationReportOfficeUser struct { - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email string `json:"email,omitempty"` - - // first name - FirstName string `json:"firstName,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName string `json:"lastName,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone string `json:"phone,omitempty"` -} - -// Validate validates this evaluation report office user -func (m *EvaluationReportOfficeUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *EvaluationReportOfficeUser) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *EvaluationReportOfficeUser) 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 *EvaluationReportOfficeUser) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this evaluation report office user based on the context it is used -func (m *EvaluationReportOfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *EvaluationReportOfficeUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *EvaluationReportOfficeUser) UnmarshalBinary(b []byte) error { - var res EvaluationReportOfficeUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/evaluation_report_type.go b/pkg/gen/ghcmessages/evaluation_report_type.go deleted file mode 100644 index e899d3e45b4..00000000000 --- a/pkg/gen/ghcmessages/evaluation_report_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// EvaluationReportType evaluation report type -// -// swagger:model EvaluationReportType -type EvaluationReportType string - -func NewEvaluationReportType(value EvaluationReportType) *EvaluationReportType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated EvaluationReportType. -func (m EvaluationReportType) Pointer() *EvaluationReportType { - return &m -} - -const ( - - // EvaluationReportTypeSHIPMENT captures enum value "SHIPMENT" - EvaluationReportTypeSHIPMENT EvaluationReportType = "SHIPMENT" - - // EvaluationReportTypeCOUNSELING captures enum value "COUNSELING" - EvaluationReportTypeCOUNSELING EvaluationReportType = "COUNSELING" -) - -// for schema -var evaluationReportTypeEnum []interface{} - -func init() { - var res []EvaluationReportType - if err := json.Unmarshal([]byte(`["SHIPMENT","COUNSELING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - evaluationReportTypeEnum = append(evaluationReportTypeEnum, v) - } -} - -func (m EvaluationReportType) validateEvaluationReportTypeEnum(path, location string, value EvaluationReportType) error { - if err := validate.EnumCase(path, location, value, evaluationReportTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this evaluation report type -func (m EvaluationReportType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateEvaluationReportTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this evaluation report type based on context it is used -func (m EvaluationReportType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go b/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go deleted file mode 100644 index bd5033bcd36..00000000000 --- a/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FetchLineOfAccountingPayload fetch line of accounting payload -// -// swagger:model FetchLineOfAccountingPayload -type FetchLineOfAccountingPayload struct { - - // department indicator - DepartmentIndicator *DepartmentIndicator `json:"departmentIndicator,omitempty"` - - // The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find "Active" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). - // - // Example: 2023-01-01 - // Format: date - EffectiveDate strfmt.Date `json:"effectiveDate,omitempty"` - - // tac code - // Example: F8J1 - // Max Length: 4 - // Min Length: 4 - TacCode string `json:"tacCode,omitempty"` -} - -// Validate validates this fetch line of accounting payload -func (m *FetchLineOfAccountingPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEffectiveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTacCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FetchLineOfAccountingPayload) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *FetchLineOfAccountingPayload) validateEffectiveDate(formats strfmt.Registry) error { - if swag.IsZero(m.EffectiveDate) { // not required - return nil - } - - if err := validate.FormatOf("effectiveDate", "body", "date", m.EffectiveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *FetchLineOfAccountingPayload) validateTacCode(formats strfmt.Registry) error { - if swag.IsZero(m.TacCode) { // not required - return nil - } - - if err := validate.MinLength("tacCode", "body", m.TacCode, 4); err != nil { - return err - } - - if err := validate.MaxLength("tacCode", "body", m.TacCode, 4); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this fetch line of accounting payload based on the context it is used -func (m *FetchLineOfAccountingPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FetchLineOfAccountingPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *FetchLineOfAccountingPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FetchLineOfAccountingPayload) UnmarshalBinary(b []byte) error { - var res FetchLineOfAccountingPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/g_b_l_o_c.go b/pkg/gen/ghcmessages/g_b_l_o_c.go deleted file mode 100644 index e256ccad14b..00000000000 --- a/pkg/gen/ghcmessages/g_b_l_o_c.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// GBLOC g b l o c -// -// swagger:model GBLOC -type GBLOC string - -func NewGBLOC(value GBLOC) *GBLOC { - return &value -} - -// Pointer returns a pointer to a freshly-allocated GBLOC. -func (m GBLOC) Pointer() *GBLOC { - return &m -} - -const ( - - // GBLOCAGFM captures enum value "AGFM" - GBLOCAGFM GBLOC = "AGFM" - - // GBLOCAPAT captures enum value "APAT" - GBLOCAPAT GBLOC = "APAT" - - // GBLOCBGAC captures enum value "BGAC" - GBLOCBGAC GBLOC = "BGAC" - - // GBLOCBGNC captures enum value "BGNC" - GBLOCBGNC GBLOC = "BGNC" - - // GBLOCBKAS captures enum value "BKAS" - GBLOCBKAS GBLOC = "BKAS" - - // GBLOCCFMQ captures enum value "CFMQ" - GBLOCCFMQ GBLOC = "CFMQ" - - // GBLOCCLPK captures enum value "CLPK" - GBLOCCLPK GBLOC = "CLPK" - - // GBLOCCNNQ captures enum value "CNNQ" - GBLOCCNNQ GBLOC = "CNNQ" - - // GBLOCDMAT captures enum value "DMAT" - GBLOCDMAT GBLOC = "DMAT" - - // GBLOCGSAT captures enum value "GSAT" - GBLOCGSAT GBLOC = "GSAT" - - // GBLOCHAFC captures enum value "HAFC" - GBLOCHAFC GBLOC = "HAFC" - - // GBLOCHBAT captures enum value "HBAT" - GBLOCHBAT GBLOC = "HBAT" - - // GBLOCJEAT captures enum value "JEAT" - GBLOCJEAT GBLOC = "JEAT" - - // GBLOCJENQ captures enum value "JENQ" - GBLOCJENQ GBLOC = "JENQ" - - // GBLOCKKFA captures enum value "KKFA" - GBLOCKKFA GBLOC = "KKFA" - - // GBLOCLHNQ captures enum value "LHNQ" - GBLOCLHNQ GBLOC = "LHNQ" - - // GBLOCLKNQ captures enum value "LKNQ" - GBLOCLKNQ GBLOC = "LKNQ" - - // GBLOCMAPK captures enum value "MAPK" - GBLOCMAPK GBLOC = "MAPK" - - // GBLOCMAPS captures enum value "MAPS" - GBLOCMAPS GBLOC = "MAPS" - - // GBLOCMBFL captures enum value "MBFL" - GBLOCMBFL GBLOC = "MBFL" - - // GBLOCMLNQ captures enum value "MLNQ" - GBLOCMLNQ GBLOC = "MLNQ" - - // GBLOCXXXX captures enum value "XXXX" - GBLOCXXXX GBLOC = "XXXX" -) - -// for schema -var gBLOCEnum []interface{} - -func init() { - var res []GBLOC - if err := json.Unmarshal([]byte(`["AGFM","APAT","BGAC","BGNC","BKAS","CFMQ","CLPK","CNNQ","DMAT","GSAT","HAFC","HBAT","JEAT","JENQ","KKFA","LHNQ","LKNQ","MAPK","MAPS","MBFL","MLNQ","XXXX"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - gBLOCEnum = append(gBLOCEnum, v) - } -} - -func (m GBLOC) validateGBLOCEnum(path, location string, value GBLOC) error { - if err := validate.EnumCase(path, location, value, gBLOCEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this g b l o c -func (m GBLOC) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateGBLOCEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this g b l o c based on context it is used -func (m GBLOC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/g_b_l_o_cs.go b/pkg/gen/ghcmessages/g_b_l_o_cs.go deleted file mode 100644 index 55c15e4d533..00000000000 --- a/pkg/gen/ghcmessages/g_b_l_o_cs.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// GBLOCs g b l o cs -// -// swagger:model GBLOCs -type GBLOCs []string - -// Validate validates this g b l o cs -func (m GBLOCs) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this g b l o cs based on context it is used -func (m GBLOCs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/g_s_r_appeal.go b/pkg/gen/ghcmessages/g_s_r_appeal.go deleted file mode 100644 index 011ba6a0e2b..00000000000 --- a/pkg/gen/ghcmessages/g_s_r_appeal.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// GSRAppeal An object associating appeals on violations and serious incidents -// -// swagger:model GSRAppeal -type GSRAppeal struct { - - // appeal status - AppealStatus GSRAppealStatusType `json:"appealStatus,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is serious incident - // Example: false - IsSeriousIncident bool `json:"isSeriousIncident,omitempty"` - - // office user - OfficeUser *EvaluationReportOfficeUser `json:"officeUser,omitempty"` - - // office user ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - OfficeUserID strfmt.UUID `json:"officeUserID,omitempty"` - - // remarks - // Example: Office user remarks - Remarks string `json:"remarks,omitempty"` - - // report ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ReportID strfmt.UUID `json:"reportID,omitempty"` - - // violation ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ViolationID strfmt.UUID `json:"violationID,omitempty"` -} - -// Validate validates this g s r appeal -func (m *GSRAppeal) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppealStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViolationID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GSRAppeal) validateAppealStatus(formats strfmt.Registry) error { - if swag.IsZero(m.AppealStatus) { // not required - return nil - } - - if err := m.AppealStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appealStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appealStatus") - } - return err - } - - return nil -} - -func (m *GSRAppeal) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GSRAppeal) 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 *GSRAppeal) validateOfficeUser(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if m.OfficeUser != nil { - if err := m.OfficeUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("officeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("officeUser") - } - return err - } - } - - return nil -} - -func (m *GSRAppeal) validateOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GSRAppeal) validateReportID(formats strfmt.Registry) error { - if swag.IsZero(m.ReportID) { // not required - return nil - } - - if err := validate.FormatOf("reportID", "body", "uuid", m.ReportID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *GSRAppeal) validateViolationID(formats strfmt.Registry) error { - if swag.IsZero(m.ViolationID) { // not required - return nil - } - - if err := validate.FormatOf("violationID", "body", "uuid", m.ViolationID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this g s r appeal based on the context it is used -func (m *GSRAppeal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAppealStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUser(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *GSRAppeal) contextValidateAppealStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AppealStatus) { // not required - return nil - } - - if err := m.AppealStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("appealStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("appealStatus") - } - return err - } - - return nil -} - -func (m *GSRAppeal) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *GSRAppeal) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { - - if m.OfficeUser != nil { - - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("officeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("officeUser") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *GSRAppeal) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *GSRAppeal) UnmarshalBinary(b []byte) error { - var res GSRAppeal - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go b/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go deleted file mode 100644 index 6008623fb2b..00000000000 --- a/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// GSRAppealStatusType g s r appeal status type -// -// swagger:model GSRAppealStatusType -type GSRAppealStatusType string - -func NewGSRAppealStatusType(value GSRAppealStatusType) *GSRAppealStatusType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated GSRAppealStatusType. -func (m GSRAppealStatusType) Pointer() *GSRAppealStatusType { - return &m -} - -const ( - - // GSRAppealStatusTypeSUSTAINED captures enum value "SUSTAINED" - GSRAppealStatusTypeSUSTAINED GSRAppealStatusType = "SUSTAINED" - - // GSRAppealStatusTypeREJECTED captures enum value "REJECTED" - GSRAppealStatusTypeREJECTED GSRAppealStatusType = "REJECTED" -) - -// for schema -var gSRAppealStatusTypeEnum []interface{} - -func init() { - var res []GSRAppealStatusType - if err := json.Unmarshal([]byte(`["SUSTAINED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - gSRAppealStatusTypeEnum = append(gSRAppealStatusTypeEnum, v) - } -} - -func (m GSRAppealStatusType) validateGSRAppealStatusTypeEnum(path, location string, value GSRAppealStatusType) error { - if err := validate.EnumCase(path, location, value, gSRAppealStatusTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this g s r appeal status type -func (m GSRAppealStatusType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateGSRAppealStatusTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this g s r appeal status type based on context it is used -func (m GSRAppealStatusType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/g_s_r_appeals.go b/pkg/gen/ghcmessages/g_s_r_appeals.go deleted file mode 100644 index d3bd71bf41e..00000000000 --- a/pkg/gen/ghcmessages/g_s_r_appeals.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// GSRAppeals g s r appeals -// -// swagger:model GSRAppeals -type GSRAppeals []*GSRAppeal - -// Validate validates this g s r appeals -func (m GSRAppeals) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this g s r appeals based on the context it is used -func (m GSRAppeals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/grade.go b/pkg/gen/ghcmessages/grade.go deleted file mode 100644 index 866e582be14..00000000000 --- a/pkg/gen/ghcmessages/grade.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Grade grade -// -// swagger:model Grade -type Grade string - -func NewGrade(value Grade) *Grade { - return &value -} - -// Pointer returns a pointer to a freshly-allocated Grade. -func (m Grade) Pointer() *Grade { - return &m -} - -const ( - - // GradeE1 captures enum value "E_1" - GradeE1 Grade = "E_1" - - // GradeE2 captures enum value "E_2" - GradeE2 Grade = "E_2" - - // GradeE3 captures enum value "E_3" - GradeE3 Grade = "E_3" - - // GradeE4 captures enum value "E_4" - GradeE4 Grade = "E_4" - - // GradeE5 captures enum value "E_5" - GradeE5 Grade = "E_5" - - // GradeE6 captures enum value "E_6" - GradeE6 Grade = "E_6" - - // GradeE7 captures enum value "E_7" - GradeE7 Grade = "E_7" - - // GradeE8 captures enum value "E_8" - GradeE8 Grade = "E_8" - - // GradeE9 captures enum value "E_9" - GradeE9 Grade = "E_9" - - // GradeE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" - GradeE9SPECIALSENIORENLISTED Grade = "E_9_SPECIAL_SENIOR_ENLISTED" - - // GradeO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" - GradeO1ACADEMYGRADUATE Grade = "O_1_ACADEMY_GRADUATE" - - // GradeO2 captures enum value "O_2" - GradeO2 Grade = "O_2" - - // GradeO3 captures enum value "O_3" - GradeO3 Grade = "O_3" - - // GradeO4 captures enum value "O_4" - GradeO4 Grade = "O_4" - - // GradeO5 captures enum value "O_5" - GradeO5 Grade = "O_5" - - // GradeO6 captures enum value "O_6" - GradeO6 Grade = "O_6" - - // GradeO7 captures enum value "O_7" - GradeO7 Grade = "O_7" - - // GradeO8 captures enum value "O_8" - GradeO8 Grade = "O_8" - - // GradeO9 captures enum value "O_9" - GradeO9 Grade = "O_9" - - // GradeO10 captures enum value "O_10" - GradeO10 Grade = "O_10" - - // GradeW1 captures enum value "W_1" - GradeW1 Grade = "W_1" - - // GradeW2 captures enum value "W_2" - GradeW2 Grade = "W_2" - - // GradeW3 captures enum value "W_3" - GradeW3 Grade = "W_3" - - // GradeW4 captures enum value "W_4" - GradeW4 Grade = "W_4" - - // GradeW5 captures enum value "W_5" - GradeW5 Grade = "W_5" - - // GradeAVIATIONCADET captures enum value "AVIATION_CADET" - GradeAVIATIONCADET Grade = "AVIATION_CADET" - - // GradeCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" - GradeCIVILIANEMPLOYEE Grade = "CIVILIAN_EMPLOYEE" - - // GradeACADEMYCADET captures enum value "ACADEMY_CADET" - GradeACADEMYCADET Grade = "ACADEMY_CADET" - - // GradeMIDSHIPMAN captures enum value "MIDSHIPMAN" - GradeMIDSHIPMAN Grade = "MIDSHIPMAN" -) - -// for schema -var gradeEnum []interface{} - -func init() { - var res []Grade - if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - gradeEnum = append(gradeEnum, v) - } -} - -func (m Grade) validateGradeEnum(path, location string, value Grade) error { - if err := validate.EnumCase(path, location, value, gradeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this grade -func (m Grade) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateGradeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this grade based on context it is used -func (m Grade) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/invalid_request_response_payload.go b/pkg/gen/ghcmessages/invalid_request_response_payload.go deleted file mode 100644 index 2c80bbabbf7..00000000000 --- a/pkg/gen/ghcmessages/invalid_request_response_payload.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InvalidRequestResponsePayload invalid request response payload -// -// swagger:model InvalidRequestResponsePayload -type InvalidRequestResponsePayload struct { - - // errors - Errors map[string]string `json:"errors,omitempty"` -} - -// Validate validates this invalid request response payload -func (m *InvalidRequestResponsePayload) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this invalid request response payload based on context it is used -func (m *InvalidRequestResponsePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InvalidRequestResponsePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InvalidRequestResponsePayload) UnmarshalBinary(b []byte) error { - var res InvalidRequestResponsePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go b/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go deleted file mode 100644 index 46f40a747e0..00000000000 --- a/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IsDateWeekendHolidayInfo is date weekend holiday info -// -// swagger:model IsDateWeekendHolidayInfo -type IsDateWeekendHolidayInfo struct { - - // country code - // Required: true - CountryCode *string `json:"country_code"` - - // country name - // Required: true - CountryName *string `json:"country_name"` - - // date - // Example: 2018-09-25 - // Required: true - // Format: date - Date *strfmt.Date `json:"date"` - - // details - Details string `json:"details,omitempty"` - - // is holiday - // Required: true - IsHoliday *bool `json:"is_holiday"` - - // is weekend - // Required: true - IsWeekend *bool `json:"is_weekend"` -} - -// Validate validates this is date weekend holiday info -func (m *IsDateWeekendHolidayInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCountryCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCountryName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsHoliday(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsWeekend(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.Required("country_code", "body", m.CountryCode); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateCountryName(formats strfmt.Registry) error { - - if err := validate.Required("country_name", "body", m.CountryName); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateIsHoliday(formats strfmt.Registry) error { - - if err := validate.Required("is_holiday", "body", m.IsHoliday); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateIsWeekend(formats strfmt.Registry) error { - - if err := validate.Required("is_weekend", "body", m.IsWeekend); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this is date weekend holiday info based on context it is used -func (m *IsDateWeekendHolidayInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IsDateWeekendHolidayInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IsDateWeekendHolidayInfo) UnmarshalBinary(b []byte) error { - var res IsDateWeekendHolidayInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/l_o_a_type.go b/pkg/gen/ghcmessages/l_o_a_type.go deleted file mode 100644 index f0e681ebe35..00000000000 --- a/pkg/gen/ghcmessages/l_o_a_type.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// LOAType The Line of accounting (TAC/SAC) type that will be used for the shipment -// Example: HHG -// -// swagger:model LOAType -type LOAType string - -func NewLOAType(value LOAType) *LOAType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated LOAType. -func (m LOAType) Pointer() *LOAType { - return &m -} - -const ( - - // LOATypeHHG captures enum value "HHG" - LOATypeHHG LOAType = "HHG" - - // LOATypeNTS captures enum value "NTS" - LOATypeNTS LOAType = "NTS" -) - -// for schema -var lOATypeEnum []interface{} - -func init() { - var res []LOAType - if err := json.Unmarshal([]byte(`["HHG","NTS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - lOATypeEnum = append(lOATypeEnum, v) - } -} - -func (m LOAType) validateLOATypeEnum(path, location string, value LOAType) error { - if err := validate.EnumCase(path, location, value, lOATypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this l o a type -func (m LOAType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateLOATypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this l o a type based on context it is used -func (m LOAType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/line_of_accounting.go b/pkg/gen/ghcmessages/line_of_accounting.go deleted file mode 100644 index e2906cde749..00000000000 --- a/pkg/gen/ghcmessages/line_of_accounting.go +++ /dev/null @@ -1,1232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LineOfAccounting line of accounting -// -// swagger:model LineOfAccounting -type LineOfAccounting struct { - - // created at - // Example: 2023-08-03T19:17:10.050Z - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - // Example: 06254fc3-b763-484c-b555-42855d1ad5cd - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // loa actvty ID - // Max Length: 11 - LoaActvtyID *string `json:"loaActvtyID,omitempty"` - - // loa agnc acntng cd - // Max Length: 6 - LoaAgncAcntngCd *string `json:"loaAgncAcntngCd,omitempty"` - - // loa agnc dsbr cd - // Max Length: 6 - LoaAgncDsbrCd *string `json:"loaAgncDsbrCd,omitempty"` - - // loa allt sn ID - // Example: 123A - // Max Length: 5 - LoaAlltSnID *string `json:"loaAlltSnID,omitempty"` - - // loa baf ID - // Example: 1234 - // Max Length: 4 - LoaBafID *string `json:"loaBafID,omitempty"` - - // loa bdgt acnt cls nm - // Example: 000000 - // Max Length: 8 - LoaBdgtAcntClsNm *string `json:"loaBdgtAcntClsNm,omitempty"` - - // loa bet cd - // Max Length: 4 - LoaBetCd *string `json:"loaBetCd,omitempty"` - - // loa bg fy tx - // Example: 2006 - LoaBgFyTx *int64 `json:"loaBgFyTx,omitempty"` - - // loa bgn dt - // Example: 2005-10-01 - // Format: date - LoaBgnDt *strfmt.Date `json:"loaBgnDt,omitempty"` - - // loa bgt ln itm ID - // Max Length: 8 - LoaBgtLnItmID *string `json:"loaBgtLnItmID,omitempty"` - - // loa bgt rstr cd - // Max Length: 1 - LoaBgtRstrCd *string `json:"loaBgtRstrCd,omitempty"` - - // loa bgt sub act cd - // Max Length: 4 - LoaBgtSubActCd *string `json:"loaBgtSubActCd,omitempty"` - - // loa cls ref ID - // Max Length: 2 - LoaClsRefID *string `json:"loaClsRefID,omitempty"` - - // loa cst cd - // Max Length: 16 - LoaCstCd *string `json:"loaCstCd,omitempty"` - - // loa cst cntr ID - // Max Length: 16 - LoaCstCntrID *string `json:"loaCstCntrID,omitempty"` - - // loa cust nm - // Max Length: 6 - LoaCustNm *string `json:"loaCustNm,omitempty"` - - // loa df agncy alctn rcpnt ID - // Max Length: 4 - LoaDfAgncyAlctnRcpntID *string `json:"loaDfAgncyAlctnRcpntID,omitempty"` - - // loa doc ID - // Example: HHG12345678900 - // Max Length: 15 - LoaDocID *string `json:"loaDocID,omitempty"` - - // loa dpt ID - // Example: 1 - // Max Length: 2 - LoaDptID *string `json:"loaDptID,omitempty"` - - // loa dsc tx - // Example: PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER) - LoaDscTx *string `json:"loaDscTx,omitempty"` - - // loa dtl rmbsmt src ID - // Max Length: 3 - LoaDtlRmbsmtSrcID *string `json:"loaDtlRmbsmtSrcID,omitempty"` - - // loa end dt - // Example: 2015-10-01 - // Format: date - LoaEndDt *strfmt.Date `json:"loaEndDt,omitempty"` - - // loa end fy tx - // Example: 2016 - LoaEndFyTx *int64 `json:"loaEndFyTx,omitempty"` - - // loa fms trnsactn ID - // Max Length: 12 - LoaFmsTrnsactnID *string `json:"loaFmsTrnsactnID,omitempty"` - - // loa fncl ar ID - // Max Length: 6 - LoaFnclArID *string `json:"loaFnclArID,omitempty"` - - // loa fnct prs nm - // Max Length: 255 - LoaFnctPrsNm *string `json:"loaFnctPrsNm,omitempty"` - - // loa fnd cntr ID - // Max Length: 12 - LoaFndCntrID *string `json:"loaFndCntrID,omitempty"` - - // loa fnd ty fg cd - // Max Length: 1 - LoaFndTyFgCd *string `json:"loaFndTyFgCd,omitempty"` - - // loa hist stat cd - // Max Length: 1 - LoaHistStatCd *string `json:"loaHistStatCd,omitempty"` - - // loa hs gds cd - // Example: HT - // Max Length: 2 - LoaHsGdsCd *string `json:"loaHsGdsCd,omitempty"` - - // loa instl acntg act ID - // Example: 12345 - // Max Length: 6 - LoaInstlAcntgActID *string `json:"loaInstlAcntgActID,omitempty"` - - // loa jb ord nm - // Max Length: 10 - LoaJbOrdNm *string `json:"loaJbOrdNm,omitempty"` - - // loa lcl instl ID - // Max Length: 18 - LoaLclInstlID *string `json:"loaLclInstlID,omitempty"` - - // loa maj clm nm - // Max Length: 4 - LoaMajClmNm *string `json:"loaMajClmNm,omitempty"` - - // loa maj rmbsmt src ID - // Max Length: 1 - LoaMajRmbsmtSrcID *string `json:"loaMajRmbsmtSrcID,omitempty"` - - // loa obj cls ID - // Example: 22NL - // Max Length: 6 - LoaObjClsID *string `json:"loaObjClsID,omitempty"` - - // loa op agncy ID - // Example: 1A - // Max Length: 4 - LoaOpAgncyID *string `json:"loaOpAgncyID,omitempty"` - - // loa pgm elmnt ID - // Example: 00000000 - // Max Length: 12 - LoaPgmElmntID *string `json:"loaPgmElmntID,omitempty"` - - // loa prj ID - // Max Length: 12 - LoaPrjID *string `json:"loaPrjID,omitempty"` - - // loa sbaltmt rcpnt ID - // Max Length: 1 - LoaSbaltmtRcpntID *string `json:"loaSbaltmtRcpntID,omitempty"` - - // loa scrty coop cust cd - // Max Length: 2 - LoaScrtyCoopCustCd *string `json:"loaScrtyCoopCustCd,omitempty"` - - // loa scrty coop dsgntr cd - // Max Length: 4 - LoaScrtyCoopDsgntrCd *string `json:"loaScrtyCoopDsgntrCd,omitempty"` - - // loa scrty coop impl agnc cd - // Max Length: 1 - LoaScrtyCoopImplAgncCd *string `json:"loaScrtyCoopImplAgncCd,omitempty"` - - // loa scrty coop ln itm ID - // Max Length: 3 - LoaScrtyCoopLnItmID *string `json:"loaScrtyCoopLnItmID,omitempty"` - - // loa spcl intr ID - // Max Length: 2 - LoaSpclIntrID *string `json:"loaSpclIntrID,omitempty"` - - // loa srv src ID - // Max Length: 1 - LoaSrvSrcID *string `json:"loaSrvSrcID,omitempty"` - - // loa stat cd - // Example: U - // Max Length: 1 - LoaStatCd *string `json:"loaStatCd,omitempty"` - - // loa sub acnt ID - // Max Length: 3 - LoaSubAcntID *string `json:"loaSubAcntID,omitempty"` - - // loa sys Id - // Example: 10003 - // Max Length: 20 - LoaSysID *string `json:"loaSysId,omitempty"` - - // loa tnsfr dpt nm - // Max Length: 4 - LoaTnsfrDptNm *string `json:"loaTnsfrDptNm,omitempty"` - - // loa trnsn ID - // Example: B1 - // Max Length: 3 - LoaTrnsnID *string `json:"loaTrnsnID,omitempty"` - - // loa trsy sfx tx - // Example: 0000 - // Max Length: 4 - LoaTrsySfxTx *string `json:"loaTrsySfxTx,omitempty"` - - // loa tsk bdgt sbln tx - // Max Length: 8 - LoaTskBdgtSblnTx *string `json:"loaTskBdgtSblnTx,omitempty"` - - // loa uic - // Max Length: 6 - LoaUic *string `json:"loaUic,omitempty"` - - // loa wk cntr rcpnt nm - // Max Length: 6 - LoaWkCntrRcpntNm *string `json:"loaWkCntrRcpntNm,omitempty"` - - // loa wrk ord ID - // Max Length: 16 - LoaWrkOrdID *string `json:"loaWrkOrdID,omitempty"` - - // org grp dfas cd - // Example: ZZ - // Max Length: 2 - OrgGrpDfasCd *string `json:"orgGrpDfasCd,omitempty"` - - // updated at - // Example: 2023-08-03T19:17:38.776Z - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // valid hhg program code for loa - ValidHhgProgramCodeForLoa *bool `json:"validHhgProgramCodeForLoa,omitempty"` - - // valid loa for tac - ValidLoaForTac *bool `json:"validLoaForTac,omitempty"` -} - -// Validate validates this line of accounting -func (m *LineOfAccounting) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaActvtyID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaAgncAcntngCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaAgncDsbrCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaAlltSnID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBafID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBdgtAcntClsNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBetCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBgnDt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBgtLnItmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBgtRstrCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaBgtSubActCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaClsRefID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaCstCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaCstCntrID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaCustNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaDfAgncyAlctnRcpntID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaDocID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaDptID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaDtlRmbsmtSrcID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaEndDt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaFmsTrnsactnID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaFnclArID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaFnctPrsNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaFndCntrID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaFndTyFgCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaHistStatCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaHsGdsCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaInstlAcntgActID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaJbOrdNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaLclInstlID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaMajClmNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaMajRmbsmtSrcID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaObjClsID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaOpAgncyID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaPgmElmntID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaPrjID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaSbaltmtRcpntID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaScrtyCoopCustCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaScrtyCoopDsgntrCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaScrtyCoopImplAgncCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaScrtyCoopLnItmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaSpclIntrID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaSrvSrcID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaStatCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaSubAcntID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaSysID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaTnsfrDptNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaTrnsnID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaTrsySfxTx(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaTskBdgtSblnTx(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaUic(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaWkCntrRcpntNm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLoaWrkOrdID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrgGrpDfasCd(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LineOfAccounting) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) 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 *LineOfAccounting) validateLoaActvtyID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaActvtyID) { // not required - return nil - } - - if err := validate.MaxLength("loaActvtyID", "body", *m.LoaActvtyID, 11); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaAgncAcntngCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaAgncAcntngCd) { // not required - return nil - } - - if err := validate.MaxLength("loaAgncAcntngCd", "body", *m.LoaAgncAcntngCd, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaAgncDsbrCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaAgncDsbrCd) { // not required - return nil - } - - if err := validate.MaxLength("loaAgncDsbrCd", "body", *m.LoaAgncDsbrCd, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaAlltSnID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaAlltSnID) { // not required - return nil - } - - if err := validate.MaxLength("loaAlltSnID", "body", *m.LoaAlltSnID, 5); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBafID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBafID) { // not required - return nil - } - - if err := validate.MaxLength("loaBafID", "body", *m.LoaBafID, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBdgtAcntClsNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBdgtAcntClsNm) { // not required - return nil - } - - if err := validate.MaxLength("loaBdgtAcntClsNm", "body", *m.LoaBdgtAcntClsNm, 8); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBetCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBetCd) { // not required - return nil - } - - if err := validate.MaxLength("loaBetCd", "body", *m.LoaBetCd, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBgnDt(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBgnDt) { // not required - return nil - } - - if err := validate.FormatOf("loaBgnDt", "body", "date", m.LoaBgnDt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBgtLnItmID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBgtLnItmID) { // not required - return nil - } - - if err := validate.MaxLength("loaBgtLnItmID", "body", *m.LoaBgtLnItmID, 8); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBgtRstrCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBgtRstrCd) { // not required - return nil - } - - if err := validate.MaxLength("loaBgtRstrCd", "body", *m.LoaBgtRstrCd, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaBgtSubActCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaBgtSubActCd) { // not required - return nil - } - - if err := validate.MaxLength("loaBgtSubActCd", "body", *m.LoaBgtSubActCd, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaClsRefID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaClsRefID) { // not required - return nil - } - - if err := validate.MaxLength("loaClsRefID", "body", *m.LoaClsRefID, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaCstCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaCstCd) { // not required - return nil - } - - if err := validate.MaxLength("loaCstCd", "body", *m.LoaCstCd, 16); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaCstCntrID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaCstCntrID) { // not required - return nil - } - - if err := validate.MaxLength("loaCstCntrID", "body", *m.LoaCstCntrID, 16); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaCustNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaCustNm) { // not required - return nil - } - - if err := validate.MaxLength("loaCustNm", "body", *m.LoaCustNm, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaDfAgncyAlctnRcpntID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaDfAgncyAlctnRcpntID) { // not required - return nil - } - - if err := validate.MaxLength("loaDfAgncyAlctnRcpntID", "body", *m.LoaDfAgncyAlctnRcpntID, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaDocID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaDocID) { // not required - return nil - } - - if err := validate.MaxLength("loaDocID", "body", *m.LoaDocID, 15); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaDptID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaDptID) { // not required - return nil - } - - if err := validate.MaxLength("loaDptID", "body", *m.LoaDptID, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaDtlRmbsmtSrcID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaDtlRmbsmtSrcID) { // not required - return nil - } - - if err := validate.MaxLength("loaDtlRmbsmtSrcID", "body", *m.LoaDtlRmbsmtSrcID, 3); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaEndDt(formats strfmt.Registry) error { - if swag.IsZero(m.LoaEndDt) { // not required - return nil - } - - if err := validate.FormatOf("loaEndDt", "body", "date", m.LoaEndDt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaFmsTrnsactnID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaFmsTrnsactnID) { // not required - return nil - } - - if err := validate.MaxLength("loaFmsTrnsactnID", "body", *m.LoaFmsTrnsactnID, 12); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaFnclArID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaFnclArID) { // not required - return nil - } - - if err := validate.MaxLength("loaFnclArID", "body", *m.LoaFnclArID, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaFnctPrsNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaFnctPrsNm) { // not required - return nil - } - - if err := validate.MaxLength("loaFnctPrsNm", "body", *m.LoaFnctPrsNm, 255); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaFndCntrID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaFndCntrID) { // not required - return nil - } - - if err := validate.MaxLength("loaFndCntrID", "body", *m.LoaFndCntrID, 12); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaFndTyFgCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaFndTyFgCd) { // not required - return nil - } - - if err := validate.MaxLength("loaFndTyFgCd", "body", *m.LoaFndTyFgCd, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaHistStatCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaHistStatCd) { // not required - return nil - } - - if err := validate.MaxLength("loaHistStatCd", "body", *m.LoaHistStatCd, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaHsGdsCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaHsGdsCd) { // not required - return nil - } - - if err := validate.MaxLength("loaHsGdsCd", "body", *m.LoaHsGdsCd, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaInstlAcntgActID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaInstlAcntgActID) { // not required - return nil - } - - if err := validate.MaxLength("loaInstlAcntgActID", "body", *m.LoaInstlAcntgActID, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaJbOrdNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaJbOrdNm) { // not required - return nil - } - - if err := validate.MaxLength("loaJbOrdNm", "body", *m.LoaJbOrdNm, 10); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaLclInstlID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaLclInstlID) { // not required - return nil - } - - if err := validate.MaxLength("loaLclInstlID", "body", *m.LoaLclInstlID, 18); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaMajClmNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaMajClmNm) { // not required - return nil - } - - if err := validate.MaxLength("loaMajClmNm", "body", *m.LoaMajClmNm, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaMajRmbsmtSrcID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaMajRmbsmtSrcID) { // not required - return nil - } - - if err := validate.MaxLength("loaMajRmbsmtSrcID", "body", *m.LoaMajRmbsmtSrcID, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaObjClsID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaObjClsID) { // not required - return nil - } - - if err := validate.MaxLength("loaObjClsID", "body", *m.LoaObjClsID, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaOpAgncyID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaOpAgncyID) { // not required - return nil - } - - if err := validate.MaxLength("loaOpAgncyID", "body", *m.LoaOpAgncyID, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaPgmElmntID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaPgmElmntID) { // not required - return nil - } - - if err := validate.MaxLength("loaPgmElmntID", "body", *m.LoaPgmElmntID, 12); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaPrjID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaPrjID) { // not required - return nil - } - - if err := validate.MaxLength("loaPrjID", "body", *m.LoaPrjID, 12); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaSbaltmtRcpntID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaSbaltmtRcpntID) { // not required - return nil - } - - if err := validate.MaxLength("loaSbaltmtRcpntID", "body", *m.LoaSbaltmtRcpntID, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaScrtyCoopCustCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaScrtyCoopCustCd) { // not required - return nil - } - - if err := validate.MaxLength("loaScrtyCoopCustCd", "body", *m.LoaScrtyCoopCustCd, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaScrtyCoopDsgntrCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaScrtyCoopDsgntrCd) { // not required - return nil - } - - if err := validate.MaxLength("loaScrtyCoopDsgntrCd", "body", *m.LoaScrtyCoopDsgntrCd, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaScrtyCoopImplAgncCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaScrtyCoopImplAgncCd) { // not required - return nil - } - - if err := validate.MaxLength("loaScrtyCoopImplAgncCd", "body", *m.LoaScrtyCoopImplAgncCd, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaScrtyCoopLnItmID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaScrtyCoopLnItmID) { // not required - return nil - } - - if err := validate.MaxLength("loaScrtyCoopLnItmID", "body", *m.LoaScrtyCoopLnItmID, 3); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaSpclIntrID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaSpclIntrID) { // not required - return nil - } - - if err := validate.MaxLength("loaSpclIntrID", "body", *m.LoaSpclIntrID, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaSrvSrcID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaSrvSrcID) { // not required - return nil - } - - if err := validate.MaxLength("loaSrvSrcID", "body", *m.LoaSrvSrcID, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaStatCd(formats strfmt.Registry) error { - if swag.IsZero(m.LoaStatCd) { // not required - return nil - } - - if err := validate.MaxLength("loaStatCd", "body", *m.LoaStatCd, 1); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaSubAcntID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaSubAcntID) { // not required - return nil - } - - if err := validate.MaxLength("loaSubAcntID", "body", *m.LoaSubAcntID, 3); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaSysID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaSysID) { // not required - return nil - } - - if err := validate.MaxLength("loaSysId", "body", *m.LoaSysID, 20); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaTnsfrDptNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaTnsfrDptNm) { // not required - return nil - } - - if err := validate.MaxLength("loaTnsfrDptNm", "body", *m.LoaTnsfrDptNm, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaTrnsnID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaTrnsnID) { // not required - return nil - } - - if err := validate.MaxLength("loaTrnsnID", "body", *m.LoaTrnsnID, 3); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaTrsySfxTx(formats strfmt.Registry) error { - if swag.IsZero(m.LoaTrsySfxTx) { // not required - return nil - } - - if err := validate.MaxLength("loaTrsySfxTx", "body", *m.LoaTrsySfxTx, 4); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaTskBdgtSblnTx(formats strfmt.Registry) error { - if swag.IsZero(m.LoaTskBdgtSblnTx) { // not required - return nil - } - - if err := validate.MaxLength("loaTskBdgtSblnTx", "body", *m.LoaTskBdgtSblnTx, 8); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaUic(formats strfmt.Registry) error { - if swag.IsZero(m.LoaUic) { // not required - return nil - } - - if err := validate.MaxLength("loaUic", "body", *m.LoaUic, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaWkCntrRcpntNm(formats strfmt.Registry) error { - if swag.IsZero(m.LoaWkCntrRcpntNm) { // not required - return nil - } - - if err := validate.MaxLength("loaWkCntrRcpntNm", "body", *m.LoaWkCntrRcpntNm, 6); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateLoaWrkOrdID(formats strfmt.Registry) error { - if swag.IsZero(m.LoaWrkOrdID) { // not required - return nil - } - - if err := validate.MaxLength("loaWrkOrdID", "body", *m.LoaWrkOrdID, 16); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateOrgGrpDfasCd(formats strfmt.Registry) error { - if swag.IsZero(m.OrgGrpDfasCd) { // not required - return nil - } - - if err := validate.MaxLength("orgGrpDfasCd", "body", *m.OrgGrpDfasCd, 2); err != nil { - return err - } - - return nil -} - -func (m *LineOfAccounting) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this line of accounting based on context it is used -func (m *LineOfAccounting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *LineOfAccounting) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LineOfAccounting) UnmarshalBinary(b []byte) error { - var res LineOfAccounting - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/list_prime_move.go b/pkg/gen/ghcmessages/list_prime_move.go deleted file mode 100644 index 690f8097816..00000000000 --- a/pkg/gen/ghcmessages/list_prime_move.go +++ /dev/null @@ -1,338 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListPrimeMove An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently. -// -// swagger:model ListPrimeMove -type ListPrimeMove struct { - - // approved at - // Read Only: true - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination g b l o c - // Example: AGFM - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - // destination postal code - // Example: 90210 - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // order type - OrderType string `json:"orderType,omitempty"` - - // ppm type - // Enum: [FULL PARTIAL] - PpmType string `json:"ppmType,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this list prime move -func (m *ListPrimeMove) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPrimeMove) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) 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 *ListPrimeMove) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -var listPrimeMoveTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listPrimeMoveTypePpmTypePropEnum = append(listPrimeMoveTypePpmTypePropEnum, v) - } -} - -const ( - - // ListPrimeMovePpmTypeFULL captures enum value "FULL" - ListPrimeMovePpmTypeFULL string = "FULL" - - // ListPrimeMovePpmTypePARTIAL captures enum value "PARTIAL" - ListPrimeMovePpmTypePARTIAL string = "PARTIAL" -) - -// prop value enum -func (m *ListPrimeMove) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listPrimeMoveTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ListPrimeMove) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list prime move based on the context it is used -func (m *ListPrimeMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateApprovedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPrimeMove) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *ListPrimeMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListPrimeMove) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListPrimeMove) UnmarshalBinary(b []byte) error { - var res ListPrimeMove - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/list_prime_moves.go b/pkg/gen/ghcmessages/list_prime_moves.go deleted file mode 100644 index d0197077d8e..00000000000 --- a/pkg/gen/ghcmessages/list_prime_moves.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListPrimeMoves list prime moves -// -// swagger:model ListPrimeMoves -type ListPrimeMoves []*ListPrimeMove - -// Validate validates this list prime moves -func (m ListPrimeMoves) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this list prime moves based on the context it is used -func (m ListPrimeMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/list_prime_moves_result.go b/pkg/gen/ghcmessages/list_prime_moves_result.go deleted file mode 100644 index 4c024dec513..00000000000 --- a/pkg/gen/ghcmessages/list_prime_moves_result.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListPrimeMovesResult list prime moves result -// -// swagger:model ListPrimeMovesResult -type ListPrimeMovesResult struct { - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // queue moves - QueueMoves ListPrimeMoves `json:"queueMoves,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this list prime moves result -func (m *ListPrimeMovesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateQueueMoves(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPrimeMovesResult) validateQueueMoves(formats strfmt.Registry) error { - if swag.IsZero(m.QueueMoves) { // not required - return nil - } - - if err := m.QueueMoves.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queueMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queueMoves") - } - return err - } - - return nil -} - -// ContextValidate validate this list prime moves result based on the context it is used -func (m *ListPrimeMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateQueueMoves(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListPrimeMovesResult) contextValidateQueueMoves(ctx context.Context, formats strfmt.Registry) error { - - if err := m.QueueMoves.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queueMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queueMoves") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListPrimeMovesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListPrimeMovesResult) UnmarshalBinary(b []byte) error { - var res ListPrimeMovesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/location.go b/pkg/gen/ghcmessages/location.go deleted file mode 100644 index cfe5a0e0f4e..00000000000 --- a/pkg/gen/ghcmessages/location.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Location location -// -// swagger:model Location -type Location struct { - - // label - // Example: Label for display - // Required: true - Label *string `json:"label"` - - // value - // Example: Value for location - // Required: true - Value *string `json:"value"` -} - -// Validate validates this location -func (m *Location) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateLabel(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 *Location) validateLabel(formats strfmt.Registry) error { - - if err := validate.Required("label", "body", m.Label); err != nil { - return err - } - - return nil -} - -func (m *Location) validateValue(formats strfmt.Registry) error { - - if err := validate.Required("value", "body", m.Value); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this location based on context it is used -func (m *Location) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Location) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Location) UnmarshalBinary(b []byte) error { - var res Location - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/locations.go b/pkg/gen/ghcmessages/locations.go deleted file mode 100644 index 073139e4061..00000000000 --- a/pkg/gen/ghcmessages/locations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Locations locations -// -// swagger:model Locations -type Locations []*Location - -// Validate validates this locations -func (m Locations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this locations based on the context it is used -func (m Locations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/locked_office_user.go b/pkg/gen/ghcmessages/locked_office_user.go deleted file mode 100644 index a6dedb2e3c3..00000000000 --- a/pkg/gen/ghcmessages/locked_office_user.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LockedOfficeUser locked office user -// -// swagger:model LockedOfficeUser -type LockedOfficeUser struct { - - // first name - FirstName string `json:"firstName,omitempty"` - - // last name - LastName string `json:"lastName,omitempty"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` - - // transportation office Id - // Format: uuid - TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` -} - -// Validate validates this locked office user -func (m *LockedOfficeUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LockedOfficeUser) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *LockedOfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this locked office user based on the context it is used -func (m *LockedOfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LockedOfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LockedOfficeUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LockedOfficeUser) UnmarshalBinary(b []byte) error { - var res LockedOfficeUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_agent.go b/pkg/gen/ghcmessages/m_t_o_agent.go deleted file mode 100644 index 5115dd2848c..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_agent.go +++ /dev/null @@ -1,236 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgent m t o agent -// -// swagger:model MTOAgent -type MTOAgent struct { - - // agent type - // Enum: [RELEASING_AGENT RECEIVING_AGENT] - AgentType string `json:"agentType,omitempty"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: (^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$) - Email *string `json:"email,omitempty"` - - // first name - FirstName *string `json:"firstName,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName *string `json:"lastName,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // phone - // Pattern: (^[2-9]\d{2}-\d{3}-\d{4}$)|(^$) - Phone *string `json:"phone,omitempty"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o agent -func (m *MTOAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var mTOAgentTypeAgentTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentTypeAgentTypePropEnum = append(mTOAgentTypeAgentTypePropEnum, v) - } -} - -const ( - - // MTOAgentAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentAgentTypeRELEASINGAGENT string = "RELEASING_AGENT" - - // MTOAgentAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentAgentTypeRECEIVINGAGENT string = "RECEIVING_AGENT" -) - -// prop value enum -func (m *MTOAgent) validateAgentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOAgentTypeAgentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(m.AgentType) { // not required - return nil - } - - // value enum - if err := m.validateAgentTypeEnum("agentType", "body", m.AgentType); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$)`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `(^[2-9]\d{2}-\d{3}-\d{4}$)|(^$)`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this m t o agent based on context it is used -func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MTOAgent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOAgent) UnmarshalBinary(b []byte) error { - var res MTOAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_agents.go b/pkg/gen/ghcmessages/m_t_o_agents.go deleted file mode 100644 index a0f5cdea3c1..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_agents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOAgents m t o agents -// -// swagger:model MTOAgents -type MTOAgents []*MTOAgent - -// Validate validates this m t o agents -func (m MTOAgents) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents based on the context it is used -func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go b/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go deleted file mode 100644 index c39aa2484ae..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOApprovalServiceItemCodes MTO level service items to create when updating MTO status. -// -// swagger:model MTOApprovalServiceItemCodes -type MTOApprovalServiceItemCodes struct { - - // service code c s - // Example: true - ServiceCodeCS bool `json:"serviceCodeCS,omitempty"` - - // service code m s - // Example: true - ServiceCodeMS bool `json:"serviceCodeMS,omitempty"` -} - -// Validate validates this m t o approval service item codes -func (m *MTOApprovalServiceItemCodes) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this m t o approval service item codes based on context it is used -func (m *MTOApprovalServiceItemCodes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MTOApprovalServiceItemCodes) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOApprovalServiceItemCodes) UnmarshalBinary(b []byte) error { - var res MTOApprovalServiceItemCodes - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item.go b/pkg/gen/ghcmessages/m_t_o_service_item.go deleted file mode 100644 index 9f20d0d5a7b..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item.go +++ /dev/null @@ -1,937 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItem m t o service item -// -// swagger:model MTOServiceItem -type MTOServiceItem struct { - - // s i t postal code - // Read Only: true - SITPostalCode *string `json:"SITPostalCode,omitempty"` - - // approved at - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // convert to customer expense - // Example: false - ConvertToCustomerExpense bool `json:"convertToCustomerExpense"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // customer contacts - CustomerContacts MTOServiceItemCustomerContacts `json:"customerContacts,omitempty"` - - // customer expense reason - CustomerExpenseReason *string `json:"customerExpenseReason,omitempty"` - - // deleted at - // Format: date - DeletedAt strfmt.Date `json:"deletedAt,omitempty"` - - // description - Description *string `json:"description,omitempty"` - - // dimensions - Dimensions MTOServiceItemDimensions `json:"dimensions,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // estimated price - EstimatedPrice *int64 `json:"estimatedPrice,omitempty"` - - // estimated weight of the shuttle service item provided by the prime - // Example: 2500 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // fee type - // Enum: [COUNSELING CRATING TRUCKING SHUTTLE] - FeeType string `json:"feeType,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // locked price cents - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market *string `json:"market,omitempty"` - - // move task order ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // pickup postal code - PickupPostalCode *string `json:"pickupPostalCode,omitempty"` - - // quantity - Quantity int64 `json:"quantity,omitempty"` - - // rate - Rate int64 `json:"rate,omitempty"` - - // re service code - // Required: true - ReServiceCode *string `json:"reServiceCode"` - - // re service ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - ReServiceID *strfmt.UUID `json:"reServiceID"` - - // re service name - // Required: true - ReServiceName *string `json:"reServiceName"` - - // reason - Reason *string `json:"reason,omitempty"` - - // rejected at - // Format: date-time - RejectedAt *strfmt.DateTime `json:"rejectedAt,omitempty"` - - // rejection reason - RejectionReason *string `json:"rejectionReason,omitempty"` - - // service request documents - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - // sit customer contacted - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // sit delivery miles - SitDeliveryMiles *int64 `json:"sitDeliveryMiles,omitempty"` - - // sit departure date - // Format: date-time - SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // sit destination original address - SitDestinationOriginalAddress *Address `json:"sitDestinationOriginalAddress,omitempty"` - - // sit entry date - // Format: date-time - SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` - - // sit origin h h g actual address - SitOriginHHGActualAddress *Address `json:"sitOriginHHGActualAddress,omitempty"` - - // sit origin h h g original address - SitOriginHHGOriginalAddress *Address `json:"sitOriginHHGOriginalAddress,omitempty"` - - // sit requested delivery - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - - // status - Status MTOServiceItemStatus `json:"status,omitempty"` - - // submitted at - // Format: date - SubmittedAt strfmt.Date `json:"submittedAt,omitempty"` - - // total - Total int64 `json:"total,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o service item -func (m *MTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerContacts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDimensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFeeType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarket(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRejectedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginHHGActualAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginHHGOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItem) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateCustomerContacts(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerContacts) { // not required - return nil - } - - if err := m.CustomerContacts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customerContacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customerContacts") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) validateDeletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.DeletedAt) { // not required - return nil - } - - if err := validate.FormatOf("deletedAt", "body", "date", m.DeletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateDimensions(formats strfmt.Registry) error { - if swag.IsZero(m.Dimensions) { // not required - return nil - } - - if err := m.Dimensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dimensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dimensions") - } - return err - } - - return nil -} - -var mTOServiceItemTypeFeeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["COUNSELING","CRATING","TRUCKING","SHUTTLE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemTypeFeeTypePropEnum = append(mTOServiceItemTypeFeeTypePropEnum, v) - } -} - -const ( - - // MTOServiceItemFeeTypeCOUNSELING captures enum value "COUNSELING" - MTOServiceItemFeeTypeCOUNSELING string = "COUNSELING" - - // MTOServiceItemFeeTypeCRATING captures enum value "CRATING" - MTOServiceItemFeeTypeCRATING string = "CRATING" - - // MTOServiceItemFeeTypeTRUCKING captures enum value "TRUCKING" - MTOServiceItemFeeTypeTRUCKING string = "TRUCKING" - - // MTOServiceItemFeeTypeSHUTTLE captures enum value "SHUTTLE" - MTOServiceItemFeeTypeSHUTTLE string = "SHUTTLE" -) - -// prop value enum -func (m *MTOServiceItem) validateFeeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemTypeFeeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItem) validateFeeType(formats strfmt.Registry) error { - if swag.IsZero(m.FeeType) { // not required - return nil - } - - // value enum - if err := m.validateFeeTypeEnum("feeType", "body", m.FeeType); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -var mTOServiceItemTypeMarketPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemTypeMarketPropEnum = append(mTOServiceItemTypeMarketPropEnum, v) - } -} - -const ( - - // MTOServiceItemMarketCONUS captures enum value "CONUS" - MTOServiceItemMarketCONUS string = "CONUS" - - // MTOServiceItemMarketOCONUS captures enum value "OCONUS" - MTOServiceItemMarketOCONUS string = "OCONUS" -) - -// prop value enum -func (m *MTOServiceItem) validateMarketEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemTypeMarketPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItem) validateMarket(formats strfmt.Registry) error { - if swag.IsZero(m.Market) { // not required - return nil - } - - // value enum - if err := m.validateMarketEnum("market", "body", *m.Market); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateReServiceID(formats strfmt.Registry) error { - - if err := validate.Required("reServiceID", "body", m.ReServiceID); err != nil { - return err - } - - if err := validate.FormatOf("reServiceID", "body", "uuid", m.ReServiceID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateReServiceName(formats strfmt.Registry) error { - - if err := validate.Required("reServiceName", "body", m.ReServiceName); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateRejectedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RejectedAt) { // not required - return nil - } - - if err := validate.FormatOf("rejectedAt", "body", "date-time", m.RejectedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRequestDocuments) { // not required - return nil - } - - if err := m.ServiceRequestDocuments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) validateSitCustomerContacted(formats strfmt.Registry) error { - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateSitDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) validateSitDestinationOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitDestinationOriginalAddress) { // not required - return nil - } - - if m.SitDestinationOriginalAddress != nil { - if err := m.SitDestinationOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) validateSitEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateSitOriginHHGActualAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginHHGActualAddress) { // not required - return nil - } - - if m.SitOriginHHGActualAddress != nil { - if err := m.SitOriginHHGActualAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginHHGActualAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginHHGActualAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) validateSitOriginHHGOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginHHGOriginalAddress) { // not required - return nil - } - - if m.SitOriginHHGOriginalAddress != nil { - if err := m.SitOriginHHGOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginHHGOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginHHGOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) validateSitRequestedDelivery(formats strfmt.Registry) error { - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item based on the context it is used -func (m *MTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSITPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerContacts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDimensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitDestinationOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginHHGActualAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginHHGOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItem) contextValidateSITPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "SITPostalCode", "body", m.SITPostalCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItem) contextValidateCustomerContacts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.CustomerContacts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customerContacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customerContacts") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) contextValidateDimensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Dimensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("dimensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("dimensions") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItem) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) contextValidateSitDestinationOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationOriginalAddress != nil { - - if swag.IsZero(m.SitDestinationOriginalAddress) { // not required - return nil - } - - if err := m.SitDestinationOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) contextValidateSitOriginHHGActualAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginHHGActualAddress != nil { - - if swag.IsZero(m.SitOriginHHGActualAddress) { // not required - return nil - } - - if err := m.SitOriginHHGActualAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginHHGActualAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginHHGActualAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) contextValidateSitOriginHHGOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginHHGOriginalAddress != nil { - - if swag.IsZero(m.SitOriginHHGOriginalAddress) { // not required - return nil - } - - if err := m.SitOriginHHGOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginHHGOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginHHGOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItem) UnmarshalBinary(b []byte) error { - var res MTOServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go deleted file mode 100644 index 1731ce9d43c..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemCustomerContact Customer contact information for a destination SIT service item -// -// swagger:model MTOServiceItemCustomerContact -type MTOServiceItemCustomerContact struct { - - // Date of attempted contact by the prime. - // Format: date - DateOfContact strfmt.Date `json:"dateOfContact,omitempty"` - - // First available date that the Prime can deliver SIT service item. - // Example: 2020-12-31 - // Format: date - FirstAvailableDeliveryDate strfmt.Date `json:"firstAvailableDeliveryDate,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Time of attempted contact by the prime. - // Example: 0400Z - TimeMilitary string `json:"timeMilitary,omitempty"` - - // type - Type CustomerContactType `json:"type,omitempty"` -} - -// Validate validates this m t o service item customer contact -func (m *MTOServiceItemCustomerContact) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDateOfContact(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemCustomerContact) validateDateOfContact(formats strfmt.Registry) error { - if swag.IsZero(m.DateOfContact) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact", "body", "date", m.DateOfContact.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemCustomerContact) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemCustomerContact) 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 *MTOServiceItemCustomerContact) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this m t o service item customer contact based on the context it is used -func (m *MTOServiceItemCustomerContact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemCustomerContact) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemCustomerContact) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemCustomerContact) UnmarshalBinary(b []byte) error { - var res MTOServiceItemCustomerContact - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go deleted file mode 100644 index 0e8c1380700..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOServiceItemCustomerContacts m t o service item customer contacts -// -// swagger:model MTOServiceItemCustomerContacts -type MTOServiceItemCustomerContacts []*MTOServiceItemCustomerContact - -// Validate validates this m t o service item customer contacts -func (m MTOServiceItemCustomerContacts) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item customer contacts based on the context it is used -func (m MTOServiceItemCustomerContacts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go b/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go deleted file mode 100644 index 2b2744c337a..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDimension Describes a dimension object for the MTOServiceItem. -// -// swagger:model MTOServiceItemDimension -type MTOServiceItemDimension struct { - - // Height in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - Height int32 `json:"height,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Length in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - Length int32 `json:"length,omitempty"` - - // type - Type DimensionType `json:"type,omitempty"` - - // Width in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - Width int32 `json:"width,omitempty"` -} - -// Validate validates this m t o service item dimension -func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this m t o service item dimension based on the context it is used -func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDimension) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDimension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go b/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go deleted file mode 100644 index f91bbd314f2..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOServiceItemDimensions m t o service item dimensions -// -// swagger:model MTOServiceItemDimensions -type MTOServiceItemDimensions []*MTOServiceItemDimension - -// Validate validates this m t o service item dimensions -func (m MTOServiceItemDimensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item dimensions based on the context it is used -func (m MTOServiceItemDimensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_single.go b/pkg/gen/ghcmessages/m_t_o_service_item_single.go deleted file mode 100644 index c6623e63344..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_single.go +++ /dev/null @@ -1,390 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemSingle m t o service item single -// -// swagger:model MTOServiceItemSingle -type MTOServiceItemSingle struct { - - // approved at - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // convert to customer expense - // Example: false - ConvertToCustomerExpense bool `json:"convertToCustomerExpense"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // customer expense reason - CustomerExpenseReason *string `json:"customerExpenseReason,omitempty"` - - // deleted at - // Format: date - DeletedAt strfmt.Date `json:"deletedAt,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move task order ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // pickup postal code - PickupPostalCode *string `json:"pickupPostalCode,omitempty"` - - // re service code - ReServiceCode string `json:"reServiceCode,omitempty"` - - // re service ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ReServiceID strfmt.UUID `json:"reServiceID,omitempty"` - - // re service name - ReServiceName string `json:"reServiceName,omitempty"` - - // rejected at - // Format: date-time - RejectedAt *strfmt.DateTime `json:"rejectedAt,omitempty"` - - // rejection reason - RejectionReason *string `json:"rejectionReason,omitempty"` - - // sit customer contacted - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // sit departure date - // Format: date-time - SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` - - // sit entry date - // Format: date-time - SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` - - // sit postal code - // Read Only: true - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // sit requested delivery - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // status - Status *string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o service item single -func (m *MTOServiceItemSingle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRejectedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemSingle) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateDeletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.DeletedAt) { // not required - return nil - } - - if err := validate.FormatOf("deletedAt", "body", "date", m.DeletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) 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 *MTOServiceItemSingle) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateReServiceID(formats strfmt.Registry) error { - if swag.IsZero(m.ReServiceID) { // not required - return nil - } - - if err := validate.FormatOf("reServiceID", "body", "uuid", m.ReServiceID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateRejectedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RejectedAt) { // not required - return nil - } - - if err := validate.FormatOf("rejectedAt", "body", "date-time", m.RejectedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateSitCustomerContacted(formats strfmt.Registry) error { - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateSitDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateSitEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateSitRequestedDelivery(formats strfmt.Registry) error { - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item single based on the context it is used -func (m *MTOServiceItemSingle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemSingle) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) contextValidateSitPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "sitPostalCode", "body", m.SitPostalCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemSingle) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemSingle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemSingle) UnmarshalBinary(b []byte) error { - var res MTOServiceItemSingle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_status.go b/pkg/gen/ghcmessages/m_t_o_service_item_status.go deleted file mode 100644 index 6e3de71c9c2..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_item_status.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemStatus Describes all statuses for a MTOServiceItem -// -// swagger:model MTOServiceItemStatus -type MTOServiceItemStatus string - -func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. -func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { - return &m -} - -const ( - - // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" - MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" - - // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" - MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" - - // MTOServiceItemStatusREJECTED captures enum value "REJECTED" - MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" -) - -// for schema -var mTOServiceItemStatusEnum []interface{} - -func init() { - var res []MTOServiceItemStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) - } -} - -func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item status -func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o service item status based on context it is used -func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_service_items.go b/pkg/gen/ghcmessages/m_t_o_service_items.go deleted file mode 100644 index 4e2860a9a01..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOServiceItems A list of service items connected to this shipment. -// -// swagger:model MTOServiceItems -type MTOServiceItems []*MTOServiceItem - -// Validate validates this m t o service items -func (m MTOServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service items based on the context it is used -func (m MTOServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment.go b/pkg/gen/ghcmessages/m_t_o_shipment.go deleted file mode 100644 index 78a6420cee4..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_shipment.go +++ /dev/null @@ -1,1564 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipment m t o shipment -// -// swagger:model MTOShipment -type MTOShipment struct { - - // The actual date that the shipment was delivered to the delivery address by the Prime - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate,omitempty"` - - // actual pickup date - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate,omitempty"` - - // actual pro gear weight - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // actual spouse pro gear weight - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // approved date - // Format: date-time - ApprovedDate *strfmt.DateTime `json:"approvedDate,omitempty"` - - // TIO override billable weight to be used for calculations - // Example: 2500 - BillableWeightCap *int64 `json:"billableWeightCap,omitempty"` - - // billable weight justification - // Example: more weight than expected - BillableWeightJustification *string `json:"billableWeightJustification,omitempty"` - - // boat shipment - BoatShipment *BoatShipment `json:"boatShipment,omitempty"` - - // calculated billable weight - // Example: 2000 - // Read Only: true - CalculatedBillableWeight *int64 `json:"calculatedBillableWeight,omitempty"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // customer remarks - // Example: handle with care - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // deleted at - // Format: date-time - DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` - - // delivery address update - DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // destination sit auth end date - // Format: date-time - DestinationSitAuthEndDate strfmt.DateTime `json:"destinationSitAuthEndDate,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // distance - // Example: 500 - Distance *int64 `json:"distance,omitempty"` - - // diversion - // Example: true - Diversion bool `json:"diversion,omitempty"` - - // diversion reason - // Example: MTO Shipment needs rerouted - DiversionReason *string `json:"diversionReason,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // has secondary delivery address - HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary delivery address - HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Single-letter designator for domestic (d) or international (i) shipments - // Example: d - // Enum: [d i] - MarketCode string `json:"marketCode,omitempty"` - - // mobile home shipment - MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` - - // move task order ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // mto agents - MtoAgents MTOAgents `json:"mtoAgents,omitempty"` - - // mto service items - MtoServiceItems MTOServiceItems `json:"mtoServiceItems,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 2000 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // origin sit auth end date - // Format: date-time - OriginSitAuthEndDate strfmt.DateTime `json:"originSitAuthEndDate,omitempty"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` - - // prime actual weight - // Example: 2000 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // prime estimated weight - // Example: 2000 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // rejection reason - // Example: MTO Shipment not good enough - RejectionReason *string `json:"rejectionReason,omitempty"` - - // requested delivery date - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // required delivery date - // Format: date - RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate,omitempty"` - - // reweigh - Reweigh *Reweigh `json:"reweigh,omitempty"` - - // sac type - SacType *LOAType `json:"sacType,omitempty"` - - // scheduled delivery date - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate,omitempty"` - - // scheduled pickup date - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate,omitempty"` - - // secondary delivery address - SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // service order number - ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` - - // shipment locator - // Example: 1K43AR-01 - // Read Only: true - ShipmentLocator *string `json:"shipmentLocator,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // sit days allowance - SitDaysAllowance *int64 `json:"sitDaysAllowance,omitempty"` - - // sit extensions - SitExtensions SITExtensions `json:"sitExtensions,omitempty"` - - // sit status - SitStatus *SITStatus `json:"sitStatus,omitempty"` - - // status - Status MTOShipmentStatus `json:"status,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // tac type - TacType *LOAType `json:"tacType,omitempty"` - - // tertiary delivery address - TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // uses external vendor - // Example: false - UsesExternalVendor bool `json:"usesExternalVendor,omitempty"` -} - -// Validate validates this m t o shipment -func (m *MTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveryAddressUpdate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReweigh(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExtensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("approvedDate", "body", "date-time", m.ApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateDeletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.DeletedAt) { // not required - return nil - } - - if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateDeliveryAddressUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if m.DeliveryAddressUpdate != nil { - if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date-time", m.DestinationSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) 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 -} - -var mTOShipmentTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeMarketCodePropEnum = append(mTOShipmentTypeMarketCodePropEnum, v) - } -} - -const ( - - // MTOShipmentMarketCodeD captures enum value "d" - MTOShipmentMarketCodeD string = "d" - - // MTOShipmentMarketCodeI captures enum value "i" - MTOShipmentMarketCodeI string = "i" -) - -// prop value enum -func (m *MTOShipment) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipment) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateMtoAgents(formats strfmt.Registry) error { - if swag.IsZero(m.MtoAgents) { // not required - return nil - } - - if err := m.MtoAgents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoAgents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoAgents") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItems) { // not required - return nil - } - - if err := m.MtoServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateOriginSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("originSitAuthEndDate", "body", "date-time", m.OriginSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateRequiredDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateReweigh(formats strfmt.Registry) error { - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if m.Reweigh != nil { - if err := m.Reweigh.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateSacType(formats strfmt.Registry) error { - if swag.IsZero(m.SacType) { // not required - return nil - } - - if m.SacType != nil { - if err := m.SacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if m.SecondaryDeliveryAddress != nil { - if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateSitExtensions(formats strfmt.Registry) error { - if swag.IsZero(m.SitExtensions) { // not required - return nil - } - - if err := m.SitExtensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateSitStatus(formats strfmt.Registry) error { - if swag.IsZero(m.SitStatus) { // not required - return nil - } - - if m.SitStatus != nil { - if err := m.SitStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitStatus") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateTacType(formats strfmt.Registry) error { - if swag.IsZero(m.TacType) { // not required - return nil - } - - if m.TacType != nil { - if err := m.TacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if m.TertiaryDeliveryAddress != nil { - if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment based on the context it is used -func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCalculatedBillableWeight(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReweigh(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentLocator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitExtensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateCalculatedBillableWeight(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "calculatedBillableWeight", "body", m.CalculatedBillableWeight); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.DeliveryAddressUpdate != nil { - - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateMtoAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoAgents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoAgents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoAgents") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { - - if m.Reweigh != nil { - - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { - - if m.SacType != nil { - - if swag.IsZero(m.SacType) { // not required - return nil - } - - if err := m.SacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDeliveryAddress != nil { - - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateShipmentLocator(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentLocator", "body", m.ShipmentLocator); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateSitStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.SitStatus != nil { - - if swag.IsZero(m.SitStatus) { // not required - return nil - } - - if err := m.SitStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitStatus") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { - - if m.TacType != nil { - - if swag.IsZero(m.TacType) { // not required - return nil - } - - if err := m.TacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDeliveryAddress != nil { - - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipment) UnmarshalBinary(b []byte) error { - var res MTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment_status.go b/pkg/gen/ghcmessages/m_t_o_shipment_status.go deleted file mode 100644 index 9c38080ae8a..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_shipment_status.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentStatus Shipment Status -// Example: SUBMITTED -// -// swagger:model MTOShipmentStatus -type MTOShipmentStatus string - -func NewMTOShipmentStatus(value MTOShipmentStatus) *MTOShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentStatus. -func (m MTOShipmentStatus) Pointer() *MTOShipmentStatus { - return &m -} - -const ( - - // MTOShipmentStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentStatusSUBMITTED MTOShipmentStatus = "SUBMITTED" - - // MTOShipmentStatusREJECTED captures enum value "REJECTED" - MTOShipmentStatusREJECTED MTOShipmentStatus = "REJECTED" - - // MTOShipmentStatusAPPROVED captures enum value "APPROVED" - MTOShipmentStatusAPPROVED MTOShipmentStatus = "APPROVED" - - // MTOShipmentStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - MTOShipmentStatusCANCELLATIONREQUESTED MTOShipmentStatus = "CANCELLATION_REQUESTED" - - // MTOShipmentStatusCANCELED captures enum value "CANCELED" - MTOShipmentStatusCANCELED MTOShipmentStatus = "CANCELED" - - // MTOShipmentStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - MTOShipmentStatusDIVERSIONREQUESTED MTOShipmentStatus = "DIVERSION_REQUESTED" -) - -// for schema -var mTOShipmentStatusEnum []interface{} - -func init() { - var res []MTOShipmentStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","REJECTED","APPROVED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentStatusEnum = append(mTOShipmentStatusEnum, v) - } -} - -func (m MTOShipmentStatus) validateMTOShipmentStatusEnum(path, location string, value MTOShipmentStatus) error { - if err := validate.EnumCase(path, location, value, mTOShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment status -func (m MTOShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment status based on context it is used -func (m MTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment_type.go b/pkg/gen/ghcmessages/m_t_o_shipment_type.go deleted file mode 100644 index 6e554e7d4d3..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_shipment_type.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType Shipment Type -// Example: HHG -// -// swagger:model MTOShipmentType -type MTOShipmentType string - -func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType. -func (m MTOShipmentType) Pointer() *MTOShipmentType { - return &m -} - -const ( - - // MTOShipmentTypeHHG captures enum value "HHG" - MTOShipmentTypeHHG MTOShipmentType = "HHG" - - // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" - - // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentTypePPM captures enum value "PPM" - MTOShipmentTypePPM MTOShipmentType = "PPM" - - // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" - - // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" - - // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" - - // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" -) - -// for schema -var mTOShipmentTypeEnum []interface{} - -func init() { - var res []MTOShipmentType - if err := json.Unmarshal([]byte(`["HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","PPM","BOAT_HAUL_AWAY","BOAT_TOW_AWAY","MOBILE_HOME","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) - } -} - -func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type -func (m MTOShipmentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type based on context it is used -func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/m_t_o_shipments.go b/pkg/gen/ghcmessages/m_t_o_shipments.go deleted file mode 100644 index 9285acd4e21..00000000000 --- a/pkg/gen/ghcmessages/m_t_o_shipments.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipments m t o shipments -// -// swagger:model MTOShipments -type MTOShipments []*MTOShipment - -// Validate validates this m t o shipments -func (m MTOShipments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments based on the context it is used -func (m MTOShipments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/mobile_home.go b/pkg/gen/ghcmessages/mobile_home.go deleted file mode 100644 index a54b9b8752a..00000000000 --- a/pkg/gen/ghcmessages/mobile_home.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. -// -// swagger:model MobileHome -type MobileHome struct { - - // Timestamp of when a property of this object was created (UTC) - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // height in inches - HeightInInches int64 `json:"heightInInches,omitempty"` - - // Primary auto-generated unique identifier of the Mobile Home object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // length in inches - LengthInInches int64 `json:"lengthInInches,omitempty"` - - // The make of the mobile home - Make string `json:"make,omitempty"` - - // The model of the mobile home. - Model string `json:"model,omitempty"` - - // The id of the parent MTOShipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // width in inches - WidthInInches int64 `json:"widthInInches,omitempty"` - - // The year the mobile home was made. - Year int64 `json:"year,omitempty"` -} - -// Validate validates this mobile home -func (m *MobileHome) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this mobile home based on the context it is used -func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MobileHome) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MobileHome) UnmarshalBinary(b []byte) error { - var res MobileHome - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move.go b/pkg/gen/ghcmessages/move.go deleted file mode 100644 index bb67e748b11..00000000000 --- a/pkg/gen/ghcmessages/move.go +++ /dev/null @@ -1,932 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Move move -// -// swagger:model Move -type Move struct { - - // s c assigned user - SCAssignedUser *AssignedOfficeUser `json:"SCAssignedUser,omitempty"` - - // t i o assigned user - TIOAssignedUser *AssignedOfficeUser `json:"TIOAssignedUser,omitempty"` - - // t o o assigned user - TOOAssignedUser *AssignedOfficeUser `json:"TOOAssignedUser,omitempty"` - - // additional documents - AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` - - // The time at which a move is sent back to the TOO becuase the prime added a new service item for approval - // Format: date-time - ApprovalsRequestedAt *strfmt.DateTime `json:"approvalsRequestedAt,omitempty"` - - // approved at - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // billable weights reviewed at - // Format: date-time - BillableWeightsReviewedAt *strfmt.DateTime `json:"billableWeightsReviewedAt,omitempty"` - - // closeout office - CloseoutOffice *TransportationOffice `json:"closeoutOffice,omitempty"` - - // The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members - // Format: uuid - CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId,omitempty"` - - // contractor - Contractor *Contractor `json:"contractor,omitempty"` - - // contractor Id - // Format: uuid - ContractorID *strfmt.UUID `json:"contractorId,omitempty"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excess_weight_acknowledged_at,omitempty"` - - // Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excess_weight_qualified_at,omitempty"` - - // This flag is set by office users if a move should be reviewed by a Financial Office - // Example: false - // Read Only: true - FinancialReviewFlag bool `json:"financialReviewFlag,omitempty"` - - // financial review remarks - // Example: Delivery Address is too far from duty location - // Read Only: true - FinancialReviewRemarks *string `json:"financialReviewRemarks,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // locator - // Example: 1K43AR - Locator string `json:"locator,omitempty"` - - // lock expires at - // Format: date-time - LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` - - // locked by office user - LockedByOfficeUser *LockedOfficeUser `json:"lockedByOfficeUser,omitempty"` - - // locked by office user ID - // Format: uuid - LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` - - // orders - Orders *Order `json:"orders,omitempty"` - - // orders Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrdersID strfmt.UUID `json:"ordersId,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID *string `json:"referenceId,omitempty"` - - // service counseling completed at - // Format: date-time - ServiceCounselingCompletedAt *strfmt.DateTime `json:"serviceCounselingCompletedAt,omitempty"` - - // shipment g b l o c - ShipmentGBLOC GBLOC `json:"shipmentGBLOC,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` - - // tio remarks - // Example: approved additional weight - TioRemarks *string `json:"tioRemarks,omitempty"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this move -func (m *Move) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSCAssignedUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTIOAssignedUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTOOAssignedUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdditionalDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovalsRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBillableWeightsReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloseoutOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloseoutOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContractor(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContractorID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrders(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Move) validateSCAssignedUser(formats strfmt.Registry) error { - if swag.IsZero(m.SCAssignedUser) { // not required - return nil - } - - if m.SCAssignedUser != nil { - if err := m.SCAssignedUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SCAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("SCAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) validateTIOAssignedUser(formats strfmt.Registry) error { - if swag.IsZero(m.TIOAssignedUser) { // not required - return nil - } - - if m.TIOAssignedUser != nil { - if err := m.TIOAssignedUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("TIOAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TIOAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) validateTOOAssignedUser(formats strfmt.Registry) error { - if swag.IsZero(m.TOOAssignedUser) { // not required - return nil - } - - if m.TOOAssignedUser != nil { - if err := m.TOOAssignedUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("TOOAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TOOAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) validateAdditionalDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if m.AdditionalDocuments != nil { - if err := m.AdditionalDocuments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *Move) validateApprovalsRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovalsRequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvalsRequestedAt", "body", "date-time", m.ApprovalsRequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateBillableWeightsReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.BillableWeightsReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("billableWeightsReviewedAt", "body", "date-time", m.BillableWeightsReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateCloseoutOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if m.CloseoutOffice != nil { - if err := m.CloseoutOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeoutOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeoutOffice") - } - return err - } - } - - return nil -} - -func (m *Move) validateCloseoutOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("closeoutOfficeId", "body", "uuid", m.CloseoutOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateContractor(formats strfmt.Registry) error { - if swag.IsZero(m.Contractor) { // not required - return nil - } - - if m.Contractor != nil { - if err := m.Contractor.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("contractor") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("contractor") - } - return err - } - } - - return nil -} - -func (m *Move) validateContractorID(formats strfmt.Registry) error { - if swag.IsZero(m.ContractorID) { // not required - return nil - } - - if err := validate.FormatOf("contractorId", "body", "uuid", m.ContractorID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("excess_weight_acknowledged_at", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excess_weight_qualified_at", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) 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 *Move) validateLockExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.LockExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateLockedByOfficeUser(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUser) { // not required - return nil - } - - if m.LockedByOfficeUser != nil { - if err := m.LockedByOfficeUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lockedByOfficeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("lockedByOfficeUser") - } - return err - } - } - - return nil -} - -func (m *Move) validateLockedByOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateOrders(formats strfmt.Registry) error { - if swag.IsZero(m.Orders) { // not required - return nil - } - - if m.Orders != nil { - if err := m.Orders.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders") - } - return err - } - } - - return nil -} - -func (m *Move) validateOrdersID(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersID) { // not required - return nil - } - - if err := validate.FormatOf("ordersId", "body", "uuid", m.OrdersID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateServiceCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("serviceCounselingCompletedAt", "body", "date-time", m.ServiceCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateShipmentGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentGBLOC) { // not required - return nil - } - - if err := m.ShipmentGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentGBLOC") - } - return err - } - - return nil -} - -func (m *Move) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *Move) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Move) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move based on the context it is used -func (m *Move) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSCAssignedUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTIOAssignedUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTOOAssignedUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContractor(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFinancialReviewFlag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFinancialReviewRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLockedByOfficeUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrders(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Move) contextValidateSCAssignedUser(ctx context.Context, formats strfmt.Registry) error { - - if m.SCAssignedUser != nil { - - if swag.IsZero(m.SCAssignedUser) { // not required - return nil - } - - if err := m.SCAssignedUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("SCAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("SCAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateTIOAssignedUser(ctx context.Context, formats strfmt.Registry) error { - - if m.TIOAssignedUser != nil { - - if swag.IsZero(m.TIOAssignedUser) { // not required - return nil - } - - if err := m.TIOAssignedUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("TIOAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TIOAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateTOOAssignedUser(ctx context.Context, formats strfmt.Registry) error { - - if m.TOOAssignedUser != nil { - - if swag.IsZero(m.TOOAssignedUser) { // not required - return nil - } - - if err := m.TOOAssignedUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("TOOAssignedUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("TOOAssignedUser") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { - - if m.AdditionalDocuments != nil { - - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CloseoutOffice != nil { - - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeoutOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeoutOffice") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateContractor(ctx context.Context, formats strfmt.Registry) error { - - if m.Contractor != nil { - - if swag.IsZero(m.Contractor) { // not required - return nil - } - - if err := m.Contractor.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("contractor") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("contractor") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateFinancialReviewFlag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "financialReviewFlag", "body", bool(m.FinancialReviewFlag)); err != nil { - return err - } - - return nil -} - -func (m *Move) contextValidateFinancialReviewRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "financialReviewRemarks", "body", m.FinancialReviewRemarks); err != nil { - return err - } - - return nil -} - -func (m *Move) contextValidateLockedByOfficeUser(ctx context.Context, formats strfmt.Registry) error { - - if m.LockedByOfficeUser != nil { - - if swag.IsZero(m.LockedByOfficeUser) { // not required - return nil - } - - if err := m.LockedByOfficeUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lockedByOfficeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("lockedByOfficeUser") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateOrders(ctx context.Context, formats strfmt.Registry) error { - - if m.Orders != nil { - - if swag.IsZero(m.Orders) { // not required - return nil - } - - if err := m.Orders.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders") - } - return err - } - } - - return nil -} - -func (m *Move) contextValidateShipmentGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentGBLOC) { // not required - return nil - } - - if err := m.ShipmentGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentGBLOC") - } - return err - } - - return nil -} - -func (m *Move) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Move) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Move) UnmarshalBinary(b []byte) error { - var res Move - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_audit_histories.go b/pkg/gen/ghcmessages/move_audit_histories.go deleted file mode 100644 index 2dcc1d5137b..00000000000 --- a/pkg/gen/ghcmessages/move_audit_histories.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MoveAuditHistories move audit histories -// -// swagger:model MoveAuditHistories -type MoveAuditHistories []*MoveAuditHistory - -// Validate validates this move audit histories -func (m MoveAuditHistories) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this move audit histories based on the context it is used -func (m MoveAuditHistories) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/move_audit_history.go b/pkg/gen/ghcmessages/move_audit_history.go deleted file mode 100644 index a92a81cabe6..00000000000 --- a/pkg/gen/ghcmessages/move_audit_history.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveAuditHistory move audit history -// -// swagger:model MoveAuditHistory -type MoveAuditHistory struct { - - // Action type; I = insert, D = delete, U = update, T = truncate - Action string `json:"action,omitempty"` - - // Wall clock time at which audited event's trigger call occurred - // Format: date-time - ActionTstampClk strfmt.DateTime `json:"actionTstampClk,omitempty"` - - // Statement start timestamp for tx in which audited event occurred - // Format: date-time - ActionTstampStm strfmt.DateTime `json:"actionTstampStm,omitempty"` - - // Transaction start timestamp for tx in which audited event occurred - // Format: date-time - ActionTstampTx strfmt.DateTime `json:"actionTstampTx,omitempty"` - - // A list of (changed/updated) MoveAuditHistoryItem's for a record after the change. - ChangedValues interface{} `json:"changedValues,omitempty"` - - // context - Context []map[string]string `json:"context"` - - // id column for the context table the record belongs to - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - ContextID *string `json:"contextId,omitempty"` - - // API endpoint name that was called to make the change - EventName *string `json:"eventName,omitempty"` - - // id from audity_history table - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // id column for the tableName where the data was changed - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ObjectID *strfmt.UUID `json:"objectId,omitempty"` - - // A list of (old/previous) MoveAuditHistoryItem's for a record before the change. - OldValues interface{} `json:"oldValues,omitempty"` - - // relation OID. Table OID (object identifier). Changes with drop/create. - RelID int64 `json:"relId,omitempty"` - - // Database schema audited table for this event is in - SchemaName string `json:"schemaName,omitempty"` - - // session user email - // Example: foobar@example.com - SessionUserEmail *string `json:"sessionUserEmail,omitempty"` - - // session user first name - // Example: foo - SessionUserFirstName *string `json:"sessionUserFirstName,omitempty"` - - // session user Id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - SessionUserID *strfmt.UUID `json:"sessionUserId,omitempty"` - - // session user last name - // Example: bar - SessionUserLastName *string `json:"sessionUserLastName,omitempty"` - - // session user telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - SessionUserTelephone *string `json:"sessionUserTelephone,omitempty"` - - // true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW' - // Example: false - StatementOnly bool `json:"statementOnly,omitempty"` - - // name of database table that was changed - TableName string `json:"tableName,omitempty"` - - // Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx. - TransactionID *int64 `json:"transactionId,omitempty"` -} - -// Validate validates this move audit history -func (m *MoveAuditHistory) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActionTstampClk(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActionTstampStm(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActionTstampTx(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObjectID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSessionUserTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveAuditHistory) validateActionTstampClk(formats strfmt.Registry) error { - if swag.IsZero(m.ActionTstampClk) { // not required - return nil - } - - if err := validate.FormatOf("actionTstampClk", "body", "date-time", m.ActionTstampClk.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveAuditHistory) validateActionTstampStm(formats strfmt.Registry) error { - if swag.IsZero(m.ActionTstampStm) { // not required - return nil - } - - if err := validate.FormatOf("actionTstampStm", "body", "date-time", m.ActionTstampStm.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveAuditHistory) validateActionTstampTx(formats strfmt.Registry) error { - if swag.IsZero(m.ActionTstampTx) { // not required - return nil - } - - if err := validate.FormatOf("actionTstampTx", "body", "date-time", m.ActionTstampTx.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveAuditHistory) 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 *MoveAuditHistory) validateObjectID(formats strfmt.Registry) error { - if swag.IsZero(m.ObjectID) { // not required - return nil - } - - if err := validate.FormatOf("objectId", "body", "uuid", m.ObjectID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveAuditHistory) validateSessionUserID(formats strfmt.Registry) error { - if swag.IsZero(m.SessionUserID) { // not required - return nil - } - - if err := validate.FormatOf("sessionUserId", "body", "uuid", m.SessionUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveAuditHistory) validateSessionUserTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SessionUserTelephone) { // not required - return nil - } - - if err := validate.Pattern("sessionUserTelephone", "body", *m.SessionUserTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this move audit history based on context it is used -func (m *MoveAuditHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MoveAuditHistory) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveAuditHistory) UnmarshalBinary(b []byte) error { - var res MoveAuditHistory - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_audit_history_item.go b/pkg/gen/ghcmessages/move_audit_history_item.go deleted file mode 100644 index d8c47368d5d..00000000000 --- a/pkg/gen/ghcmessages/move_audit_history_item.go +++ /dev/null @@ -1,53 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MoveAuditHistoryItem move audit history item -// -// swagger:model MoveAuditHistoryItem -type MoveAuditHistoryItem struct { - - // column name - ColumnName string `json:"columnName,omitempty"` - - // column value - ColumnValue string `json:"columnValue,omitempty"` -} - -// Validate validates this move audit history item -func (m *MoveAuditHistoryItem) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this move audit history item based on context it is used -func (m *MoveAuditHistoryItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MoveAuditHistoryItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveAuditHistoryItem) UnmarshalBinary(b []byte) error { - var res MoveAuditHistoryItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_audit_history_items.go b/pkg/gen/ghcmessages/move_audit_history_items.go deleted file mode 100644 index 9b6d9577be1..00000000000 --- a/pkg/gen/ghcmessages/move_audit_history_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MoveAuditHistoryItems move audit history items -// -// swagger:model MoveAuditHistoryItems -type MoveAuditHistoryItems []*MoveAuditHistoryItem - -// Validate validates this move audit history items -func (m MoveAuditHistoryItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this move audit history items based on the context it is used -func (m MoveAuditHistoryItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/move_history.go b/pkg/gen/ghcmessages/move_history.go deleted file mode 100644 index 3c820dfc847..00000000000 --- a/pkg/gen/ghcmessages/move_history.go +++ /dev/null @@ -1,130 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveHistory move history -// -// swagger:model MoveHistory -type MoveHistory struct { - - // A list of MoveAuditHistory's connected to the move. - HistoryRecords MoveAuditHistories `json:"historyRecords,omitempty"` - - // move ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move locator - // Example: 1K43AR - Locator string `json:"locator,omitempty"` - - // move referenceID - // Example: 1001-3456 - ReferenceID *string `json:"referenceId,omitempty"` -} - -// Validate validates this move history -func (m *MoveHistory) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHistoryRecords(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveHistory) validateHistoryRecords(formats strfmt.Registry) error { - if swag.IsZero(m.HistoryRecords) { // not required - return nil - } - - if err := m.HistoryRecords.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("historyRecords") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("historyRecords") - } - return err - } - - return nil -} - -func (m *MoveHistory) 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 -} - -// ContextValidate validate this move history based on the context it is used -func (m *MoveHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHistoryRecords(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveHistory) contextValidateHistoryRecords(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HistoryRecords.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("historyRecords") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("historyRecords") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveHistory) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveHistory) UnmarshalBinary(b []byte) error { - var res MoveHistory - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_history_result.go b/pkg/gen/ghcmessages/move_history_result.go deleted file mode 100644 index 5c07ab9c563..00000000000 --- a/pkg/gen/ghcmessages/move_history_result.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveHistoryResult move history result -// -// swagger:model MoveHistoryResult -type MoveHistoryResult struct { - - // A list of MoveAuditHistory's connected to the move. - HistoryRecords MoveAuditHistories `json:"historyRecords,omitempty"` - - // move ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move locator - // Example: 1K43AR - Locator string `json:"locator,omitempty"` - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // move referenceID - // Example: 1001-3456 - ReferenceID *string `json:"referenceId,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this move history result -func (m *MoveHistoryResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHistoryRecords(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveHistoryResult) validateHistoryRecords(formats strfmt.Registry) error { - if swag.IsZero(m.HistoryRecords) { // not required - return nil - } - - if err := m.HistoryRecords.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("historyRecords") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("historyRecords") - } - return err - } - - return nil -} - -func (m *MoveHistoryResult) 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 -} - -// ContextValidate validate this move history result based on the context it is used -func (m *MoveHistoryResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateHistoryRecords(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveHistoryResult) contextValidateHistoryRecords(ctx context.Context, formats strfmt.Registry) error { - - if err := m.HistoryRecords.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("historyRecords") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("historyRecords") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveHistoryResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveHistoryResult) UnmarshalBinary(b []byte) error { - var res MoveHistoryResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_payload.go b/pkg/gen/ghcmessages/move_payload.go deleted file mode 100644 index 16962a7a619..00000000000 --- a/pkg/gen/ghcmessages/move_payload.go +++ /dev/null @@ -1,467 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MovePayload move payload -// -// swagger:model MovePayload -type MovePayload struct { - - // additional documents - AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` - - // cancel reason - // Example: Change of orders - CancelReason *string `json:"cancel_reason,omitempty"` - - // closeout office - CloseoutOffice *TransportationOffice `json:"closeout_office,omitempty"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // e tag - // Required: true - ETag *string `json:"eTag"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // locator - // Example: 12432 - // Required: true - Locator *string `json:"locator"` - - // mto shipments - MtoShipments MTOShipments `json:"mto_shipments,omitempty"` - - // orders id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - OrdersID *strfmt.UUID `json:"orders_id"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // service member id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submitted_at,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this move payload -func (m *MovePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdditionalDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloseoutOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovePayload) validateAdditionalDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if m.AdditionalDocuments != nil { - if err := m.AdditionalDocuments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *MovePayload) validateCloseoutOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if m.CloseoutOffice != nil { - if err := m.CloseoutOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeout_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeout_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateETag(formats strfmt.Registry) error { - - if err := validate.Required("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateLocator(formats strfmt.Registry) error { - - if err := validate.Required("locator", "body", m.Locator); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateMtoShipments(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipments) { // not required - return nil - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mto_shipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mto_shipments") - } - return err - } - - return nil -} - -func (m *MovePayload) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.Required("orders_id", "body", m.OrdersID); err != nil { - return err - } - - if err := validate.FormatOf("orders_id", "body", "uuid", m.OrdersID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MovePayload) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submitted_at", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move payload based on the context it is used -func (m *MovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovePayload) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { - - if m.AdditionalDocuments != nil { - - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *MovePayload) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CloseoutOffice != nil { - - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeout_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeout_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mto_shipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mto_shipments") - } - return err - } - - return nil -} - -func (m *MovePayload) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MovePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MovePayload) UnmarshalBinary(b []byte) error { - var res MovePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_status.go b/pkg/gen/ghcmessages/move_status.go deleted file mode 100644 index 53b716bb3ed..00000000000 --- a/pkg/gen/ghcmessages/move_status.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MoveStatus move status -// -// swagger:model MoveStatus -type MoveStatus string - -func NewMoveStatus(value MoveStatus) *MoveStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MoveStatus. -func (m MoveStatus) Pointer() *MoveStatus { - return &m -} - -const ( - - // MoveStatusDRAFT captures enum value "DRAFT" - MoveStatusDRAFT MoveStatus = "DRAFT" - - // MoveStatusNEEDSSERVICECOUNSELING captures enum value "NEEDS SERVICE COUNSELING" - MoveStatusNEEDSSERVICECOUNSELING MoveStatus = "NEEDS SERVICE COUNSELING" - - // MoveStatusSERVICECOUNSELINGCOMPLETED captures enum value "SERVICE COUNSELING COMPLETED" - MoveStatusSERVICECOUNSELINGCOMPLETED MoveStatus = "SERVICE COUNSELING COMPLETED" - - // MoveStatusSUBMITTED captures enum value "SUBMITTED" - MoveStatusSUBMITTED MoveStatus = "SUBMITTED" - - // MoveStatusAPPROVALSREQUESTED captures enum value "APPROVALS REQUESTED" - MoveStatusAPPROVALSREQUESTED MoveStatus = "APPROVALS REQUESTED" - - // MoveStatusAPPROVED captures enum value "APPROVED" - MoveStatusAPPROVED MoveStatus = "APPROVED" - - // MoveStatusCANCELED captures enum value "CANCELED" - MoveStatusCANCELED MoveStatus = "CANCELED" -) - -// for schema -var moveStatusEnum []interface{} - -func init() { - var res []MoveStatus - if err := json.Unmarshal([]byte(`["DRAFT","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED","SUBMITTED","APPROVALS REQUESTED","APPROVED","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveStatusEnum = append(moveStatusEnum, v) - } -} - -func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { - if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this move status -func (m MoveStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMoveStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this move status based on context it is used -func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/move_task_order.go b/pkg/gen/ghcmessages/move_task_order.go deleted file mode 100644 index ea4cff97ef2..00000000000 --- a/pkg/gen/ghcmessages/move_task_order.go +++ /dev/null @@ -1,431 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveTaskOrder The Move (MoveTaskOrder) -// -// swagger:model MoveTaskOrder -type MoveTaskOrder struct { - - // approved at - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // destination duty location - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - DestinationDutyLocation strfmt.UUID `json:"destinationDutyLocation,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // entitlements - Entitlements *Entitlements `json:"entitlements,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // locator - // Example: 1K43AR - Locator string `json:"locator,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // origin duty location - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - OriginDutyLocation strfmt.UUID `json:"originDutyLocation,omitempty"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate strfmt.Date `json:"requestedPickupDate,omitempty"` - - // service counseling completed at - // Format: date-time - ServiceCounselingCompletedAt *strfmt.DateTime `json:"serviceCounselingCompletedAt,omitempty"` - - // tio remarks - // Example: approved additional weight - TioRemarks *string `json:"tioRemarks,omitempty"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this move task order -func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlements(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := validate.FormatOf("destinationDutyLocation", "body", "uuid", m.DestinationDutyLocation.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateEntitlements(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlements) { // not required - return nil - } - - if m.Entitlements != nil { - if err := m.Entitlements.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := validate.FormatOf("originDutyLocation", "body", "uuid", m.OriginDutyLocation.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateServiceCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("serviceCounselingCompletedAt", "body", "date-time", m.ServiceCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move task order based on the context it is used -func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlements(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlements != nil { - - if swag.IsZero(m.Entitlements) { // not required - return nil - } - - if err := m.Entitlements.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlements") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlements") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { - var res MoveTaskOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/move_task_orders.go b/pkg/gen/ghcmessages/move_task_orders.go deleted file mode 100644 index 9bd21ca951e..00000000000 --- a/pkg/gen/ghcmessages/move_task_orders.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MoveTaskOrders move task orders -// -// swagger:model MoveTaskOrders -type MoveTaskOrders []*MoveTaskOrder - -// Validate validates this move task orders -func (m MoveTaskOrders) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this move task orders based on the context it is used -func (m MoveTaskOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/moving_expense.go b/pkg/gen/ghcmessages/moving_expense.go deleted file mode 100644 index 2bf92cf68d7..00000000000 --- a/pkg/gen/ghcmessages/moving_expense.go +++ /dev/null @@ -1,674 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MovingExpense Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment. -// -// swagger:model MovingExpense -type MovingExpense struct { - - // The total amount of the expense as indicated on the receipt - Amount *int64 `json:"amount"` - - // Timestamp the moving expense object was initially created in the system (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A brief description of the expense - Description *string `json:"description"` - - // document - // Required: true - Document *Document `json:"document"` - - // The id of the Document that contains all file uploads for this expense - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - DocumentID strfmt.UUID `json:"documentId"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // Unique primary identifier of the Moving Expense object - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Indicates if the service member is missing the receipt with the proof of expense amount - MissingReceipt *bool `json:"missingReceipt"` - - // moving expense type - MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` - - // Indicates if the service member used their government issued card to pay for the expense - PaidWithGtcc *bool `json:"paidWithGtcc"` - - // The PPM Shipment id that this moving expense belongs to - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2018-05-26 - // Format: date - SitEndDate *strfmt.Date `json:"sitEndDate"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The amount of SIT that will be reimbursed - SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` - - // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2022-04-26 - // Format: date - SitStartDate *strfmt.Date `json:"sitStartDate"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Customer submitted total amount of the expense as indicated on the receipt - SubmittedAmount *int64 `json:"submittedAmount"` - - // Customer submitted description of the expense - SubmittedDescription *string `json:"submittedDescription"` - - // submitted moving expense type - SubmittedMovingExpenseType *SubmittedMovingExpenseType `json:"submittedMovingExpenseType"` - - // Customer submitted date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2018-05-26 - // Format: date - SubmittedSitEndDate *strfmt.Date `json:"submittedSitEndDate"` - - // Customer submitted date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2022-04-26 - // Format: date - SubmittedSitStartDate *strfmt.Date `json:"submittedSitStartDate"` - - // Timestamp when a property of this moving expense object was last modified (UTC) - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // The total weight stored in PPM SIT - WeightStored *int64 `json:"weightStored"` -} - -// Validate validates this moving expense -func (m *MovingExpense) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedSitStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovingExpense) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateDocument(formats strfmt.Registry) error { - - if err := validate.Required("document", "body", m.Document); err != nil { - return err - } - - if m.Document != nil { - if err := m.Document.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if m.MovingExpenseType != nil { - if err := m.MovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSubmittedMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedMovingExpenseType) { // not required - return nil - } - - if m.SubmittedMovingExpenseType != nil { - if err := m.SubmittedMovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("submittedMovingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("submittedMovingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSubmittedSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedSitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("submittedSitEndDate", "body", "date", m.SubmittedSitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateSubmittedSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedSitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("submittedSitStartDate", "body", "date", m.SubmittedSitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this moving expense based on the context it is used -func (m *MovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubmittedMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovingExpense) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.Document != nil { - - if err := m.Document.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.MovingExpenseType != nil { - - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateSubmittedMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.SubmittedMovingExpenseType != nil { - - if swag.IsZero(m.SubmittedMovingExpenseType) { // not required - return nil - } - - if err := m.SubmittedMovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("submittedMovingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("submittedMovingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MovingExpense) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MovingExpense) UnmarshalBinary(b []byte) error { - var res MovingExpense - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/moving_expenses.go b/pkg/gen/ghcmessages/moving_expenses.go deleted file mode 100644 index feffd16ef01..00000000000 --- a/pkg/gen/ghcmessages/moving_expenses.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MovingExpenses All moving expenses associated with a PPM shipment. -// -// swagger:model MovingExpenses -type MovingExpenses []*MovingExpense - -// Validate validates this moving expenses -func (m MovingExpenses) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this moving expenses based on the context it is used -func (m MovingExpenses) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/office_user.go b/pkg/gen/ghcmessages/office_user.go deleted file mode 100644 index 3614d465a18..00000000000 --- a/pkg/gen/ghcmessages/office_user.go +++ /dev/null @@ -1,593 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUser office user -// -// swagger:model OfficeUser -type OfficeUser struct { - - // active - // Required: true - Active *bool `json:"active"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // edipi - // Required: true - Edipi *string `json:"edipi"` - - // email - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email"` - - // first name - // Required: true - FirstName *string `json:"firstName"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // last name - // Required: true - LastName *string `json:"lastName"` - - // middle initials - // Required: true - MiddleInitials *string `json:"middleInitials"` - - // other unique Id - // Required: true - OtherUniqueID *string `json:"otherUniqueId"` - - // rejection reason - // Required: true - RejectionReason *string `json:"rejectionReason"` - - // roles - // Required: true - Roles []*Role `json:"roles"` - - // status - // Required: true - // Enum: [APPROVED REQUESTED REJECTED] - Status *string `json:"status"` - - // telephone - // Required: true - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` - - // transportation office assignments - TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportationOfficeAssignments"` - - // transportation office Id - // Required: true - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // user Id - // Format: uuid - UserID strfmt.UUID `json:"userId,omitempty"` -} - -// Validate validates this office user -func (m *OfficeUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActive(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMiddleInitials(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOtherUniqueID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRejectionReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeAssignments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) validateActive(formats strfmt.Registry) error { - - if err := validate.Required("active", "body", m.Active); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateEdipi(formats strfmt.Registry) error { - - if err := validate.Required("edipi", "body", m.Edipi); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateFirstName(formats strfmt.Registry) error { - - if err := validate.Required("firstName", "body", m.FirstName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateLastName(formats strfmt.Registry) error { - - if err := validate.Required("lastName", "body", m.LastName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateMiddleInitials(formats strfmt.Registry) error { - - if err := validate.Required("middleInitials", "body", m.MiddleInitials); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateOtherUniqueID(formats strfmt.Registry) error { - - if err := validate.Required("otherUniqueId", "body", m.OtherUniqueID); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateRejectionReason(formats strfmt.Registry) error { - - if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateRoles(formats strfmt.Registry) error { - - if err := validate.Required("roles", "body", m.Roles); err != nil { - return err - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -var officeUserTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["APPROVED","REQUESTED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - officeUserTypeStatusPropEnum = append(officeUserTypeStatusPropEnum, v) - } -} - -const ( - - // OfficeUserStatusAPPROVED captures enum value "APPROVED" - OfficeUserStatusAPPROVED string = "APPROVED" - - // OfficeUserStatusREQUESTED captures enum value "REQUESTED" - OfficeUserStatusREQUESTED string = "REQUESTED" - - // OfficeUserStatusREJECTED captures enum value "REJECTED" - OfficeUserStatusREJECTED string = "REJECTED" -) - -// prop value enum -func (m *OfficeUser) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, officeUserTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *OfficeUser) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - // value enum - if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateTelephone(formats strfmt.Registry) error { - - if err := validate.Required("telephone", "body", m.Telephone); err != nil { - return err - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeAssignments) { // not required - return nil - } - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - continue - } - - if m.TransportationOfficeAssignments[i] != nil { - if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this office user based on the context it is used -func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - - if m.TransportationOfficeAssignments[i] != nil { - - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - return nil - } - - if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUser) UnmarshalBinary(b []byte) error { - var res OfficeUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/office_user_create.go b/pkg/gen/ghcmessages/office_user_create.go deleted file mode 100644 index fbeab9bf83c..00000000000 --- a/pkg/gen/ghcmessages/office_user_create.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUserCreate office user create -// -// swagger:model OfficeUserCreate -type OfficeUserCreate struct { - - // EDIPI - // Example: 1234567890 - // Max Length: 10 - Edipi *string `json:"edipi,omitempty"` - - // Email - // Example: user@userdomain.com - // Required: true - Email string `json:"email"` - - // First Name - // Required: true - FirstName string `json:"firstName"` - - // Last Name - // Required: true - LastName string `json:"lastName"` - - // Middle Initials - // Example: L. - MiddleInitials *string `json:"middleInitials,omitempty"` - - // Office user identifier when EDIPI is not available - OtherUniqueID *string `json:"otherUniqueId,omitempty"` - - // roles - // Required: true - Roles []*OfficeUserRole `json:"roles"` - - // telephone - // Example: 212-555-5555 - // Required: true - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone string `json:"telephone"` - - // transportation office Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - TransportationOfficeID strfmt.UUID `json:"transportationOfficeId"` -} - -// Validate validates this office user create -func (m *OfficeUserCreate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserCreate) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.Edipi) { // not required - return nil - } - - if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateEmail(formats strfmt.Registry) error { - - if err := validate.RequiredString("email", "body", m.Email); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateFirstName(formats strfmt.Registry) error { - - if err := validate.RequiredString("firstName", "body", m.FirstName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateLastName(formats strfmt.Registry) error { - - if err := validate.RequiredString("lastName", "body", m.LastName); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateRoles(formats strfmt.Registry) error { - - if err := validate.Required("roles", "body", m.Roles); err != nil { - return err - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUserCreate) validateTelephone(formats strfmt.Registry) error { - - if err := validate.RequiredString("telephone", "body", m.Telephone); err != nil { - return err - } - - if err := validate.Pattern("telephone", "body", m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUserCreate) validateTransportationOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeId", "body", strfmt.UUID(m.TransportationOfficeID)); err != nil { - return err - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this office user create based on the context it is used -func (m *OfficeUserCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUserCreate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserCreate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserCreate) UnmarshalBinary(b []byte) error { - var res OfficeUserCreate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/office_user_role.go b/pkg/gen/ghcmessages/office_user_role.go deleted file mode 100644 index 391a0388275..00000000000 --- a/pkg/gen/ghcmessages/office_user_role.go +++ /dev/null @@ -1,55 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// OfficeUserRole office user role -// -// swagger:model OfficeUserRole -type OfficeUserRole struct { - - // name - // Example: Task Ordering Officer - Name *string `json:"name,omitempty"` - - // roleType - // Example: task_ordering_officer - RoleType *string `json:"roleType,omitempty"` -} - -// Validate validates this office user role -func (m *OfficeUserRole) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this office user role based on context it is used -func (m *OfficeUserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUserRole) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUserRole) UnmarshalBinary(b []byte) error { - var res OfficeUserRole - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/omittable_moving_expense_type.go b/pkg/gen/ghcmessages/omittable_moving_expense_type.go deleted file mode 100644 index 9ffc820dd57..00000000000 --- a/pkg/gen/ghcmessages/omittable_moving_expense_type.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OmittableMovingExpenseType Moving Expense Type -// -// swagger:model OmittableMovingExpenseType -type OmittableMovingExpenseType string - -func NewOmittableMovingExpenseType(value OmittableMovingExpenseType) *OmittableMovingExpenseType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OmittableMovingExpenseType. -func (m OmittableMovingExpenseType) Pointer() *OmittableMovingExpenseType { - return &m -} - -const ( - - // OmittableMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" - OmittableMovingExpenseTypeCONTRACTEDEXPENSE OmittableMovingExpenseType = "CONTRACTED_EXPENSE" - - // OmittableMovingExpenseTypeGAS captures enum value "GAS" - OmittableMovingExpenseTypeGAS OmittableMovingExpenseType = "GAS" - - // OmittableMovingExpenseTypeOIL captures enum value "OIL" - OmittableMovingExpenseTypeOIL OmittableMovingExpenseType = "OIL" - - // OmittableMovingExpenseTypeOTHER captures enum value "OTHER" - OmittableMovingExpenseTypeOTHER OmittableMovingExpenseType = "OTHER" - - // OmittableMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" - OmittableMovingExpenseTypePACKINGMATERIALS OmittableMovingExpenseType = "PACKING_MATERIALS" - - // OmittableMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" - OmittableMovingExpenseTypeRENTALEQUIPMENT OmittableMovingExpenseType = "RENTAL_EQUIPMENT" - - // OmittableMovingExpenseTypeSTORAGE captures enum value "STORAGE" - OmittableMovingExpenseTypeSTORAGE OmittableMovingExpenseType = "STORAGE" - - // OmittableMovingExpenseTypeTOLLS captures enum value "TOLLS" - OmittableMovingExpenseTypeTOLLS OmittableMovingExpenseType = "TOLLS" - - // OmittableMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" - OmittableMovingExpenseTypeWEIGHINGFEE OmittableMovingExpenseType = "WEIGHING_FEE" -) - -// for schema -var omittableMovingExpenseTypeEnum []interface{} - -func init() { - var res []OmittableMovingExpenseType - if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - omittableMovingExpenseTypeEnum = append(omittableMovingExpenseTypeEnum, v) - } -} - -func (m OmittableMovingExpenseType) validateOmittableMovingExpenseTypeEnum(path, location string, value OmittableMovingExpenseType) error { - if err := validate.EnumCase(path, location, value, omittableMovingExpenseTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this omittable moving expense type -func (m OmittableMovingExpenseType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOmittableMovingExpenseTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this omittable moving expense type based on context it is used -func (m OmittableMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go b/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go deleted file mode 100644 index 8fb701d3ad3..00000000000 --- a/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OmittablePPMDocumentStatus Status of the PPM document. -// -// swagger:model OmittablePPMDocumentStatus -type OmittablePPMDocumentStatus string - -func NewOmittablePPMDocumentStatus(value OmittablePPMDocumentStatus) *OmittablePPMDocumentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OmittablePPMDocumentStatus. -func (m OmittablePPMDocumentStatus) Pointer() *OmittablePPMDocumentStatus { - return &m -} - -const ( - - // OmittablePPMDocumentStatusAPPROVED captures enum value "APPROVED" - OmittablePPMDocumentStatusAPPROVED OmittablePPMDocumentStatus = "APPROVED" - - // OmittablePPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" - OmittablePPMDocumentStatusEXCLUDED OmittablePPMDocumentStatus = "EXCLUDED" - - // OmittablePPMDocumentStatusREJECTED captures enum value "REJECTED" - OmittablePPMDocumentStatusREJECTED OmittablePPMDocumentStatus = "REJECTED" -) - -// for schema -var omittablePPMDocumentStatusEnum []interface{} - -func init() { - var res []OmittablePPMDocumentStatus - if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - omittablePPMDocumentStatusEnum = append(omittablePPMDocumentStatusEnum, v) - } -} - -func (m OmittablePPMDocumentStatus) validateOmittablePPMDocumentStatusEnum(path, location string, value OmittablePPMDocumentStatus) error { - if err := validate.EnumCase(path, location, value, omittablePPMDocumentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this omittable p p m document status -func (m OmittablePPMDocumentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOmittablePPMDocumentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this omittable p p m document status based on context it is used -func (m OmittablePPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/order.go b/pkg/gen/ghcmessages/order.go deleted file mode 100644 index aa655d0aac0..00000000000 --- a/pkg/gen/ghcmessages/order.go +++ /dev/null @@ -1,901 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // agency - Agency *Affiliation `json:"agency,omitempty"` - - // amended orders acknowledged at - // Format: date-time - AmendedOrdersAcknowledgedAt *strfmt.DateTime `json:"amendedOrdersAcknowledgedAt,omitempty"` - - // customer - Customer *Customer `json:"customer,omitempty"` - - // customer ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CustomerID strfmt.UUID `json:"customerID,omitempty"` - - // date issued - // Example: 2020-01-01 - // Format: date - DateIssued strfmt.Date `json:"date_issued,omitempty"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // destination duty location g b l o c - DestinationDutyLocationGBLOC GBLOC `json:"destinationDutyLocationGBLOC,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // entitlement - Entitlement *Entitlements `json:"entitlement,omitempty"` - - // first name - // Example: John - // Read Only: true - FirstName string `json:"first_name,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // Are dependents included in your orders? - // Example: false - HasDependents bool `json:"has_dependents,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Doe - // Read Only: true - LastName string `json:"last_name,omitempty"` - - // method of payment - MethodOfPayment string `json:"methodOfPayment,omitempty"` - - // move code - // Example: H2XFJF - MoveCode string `json:"moveCode,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // naics - Naics string `json:"naics,omitempty"` - - // NTS SAC - // Example: N002214CSW32Y9 - NtsSac *string `json:"ntsSac,omitempty"` - - // NTS TAC - // Example: F8J1 - NtsTac *string `json:"ntsTac,omitempty"` - - // order number - // Example: 030-00362 - OrderNumber *string `json:"order_number,omitempty"` - - // order type - OrderType OrdersType `json:"order_type,omitempty"` - - // order type detail - OrderTypeDetail *OrdersTypeDetail `json:"order_type_detail,omitempty"` - - // orders type - OrdersType OrdersType `json:"orders_type,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin duty location g b l o c - OriginDutyLocationGBLOC GBLOC `json:"originDutyLocationGBLOC,omitempty"` - - // packing and shipping instructions - PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` - - // report by date - // Example: 2020-01-01 - // Format: date - ReportByDate strfmt.Date `json:"report_by_date,omitempty"` - - // SAC - // Example: N002214CSW32Y9 - Sac *string `json:"sac,omitempty"` - - // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? - // Example: false - SpouseHasProGear bool `json:"spouse_has_pro_gear,omitempty"` - - // supply and services cost estimate - SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` - - // TAC - // Example: F8J1 - Tac *string `json:"tac,omitempty"` - - // uploaded amended order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UploadedAmendedOrderID *strfmt.UUID `json:"uploadedAmendedOrderID,omitempty"` - - // uploaded order id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UploadedOrderID strfmt.UUID `json:"uploaded_order_id,omitempty"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgency(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAmendedOrdersAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateIssued(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocationGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadedAmendedOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadedOrderID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateAgency(formats strfmt.Registry) error { - if swag.IsZero(m.Agency) { // not required - return nil - } - - if m.Agency != nil { - if err := m.Agency.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *Order) validateAmendedOrdersAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.AmendedOrdersAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("amendedOrdersAcknowledgedAt", "body", "date-time", m.AmendedOrdersAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) validateCustomerID(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerID) { // not required - return nil - } - - if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDateIssued(formats strfmt.Registry) error { - if swag.IsZero(m.DateIssued) { // not required - return nil - } - - if err := validate.FormatOf("date_issued", "body", "date", m.DateIssued.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateDestinationDutyLocationGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocationGBLOC) { // not required - return nil - } - - if err := m.DestinationDutyLocationGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocationGBLOC") - } - return err - } - - return nil -} - -func (m *Order) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderType(formats strfmt.Registry) error { - if swag.IsZero(m.OrderType) { // not required - return nil - } - - if err := m.OrderType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order_type") - } - return err - } - - return nil -} - -func (m *Order) validateOrderTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrderTypeDetail) { // not required - return nil - } - - if m.OrderTypeDetail != nil { - if err := m.OrderTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order_type_detail") - } - return err - } - } - - return nil -} - -func (m *Order) validateOrdersType(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - - return nil -} - -func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateOriginDutyLocationGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocationGBLOC) { // not required - return nil - } - - if err := m.OriginDutyLocationGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocationGBLOC") - } - return err - } - - return nil -} - -func (m *Order) validateReportByDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReportByDate) { // not required - return nil - } - - if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateUploadedAmendedOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.UploadedAmendedOrderID) { // not required - return nil - } - - if err := validate.FormatOf("uploadedAmendedOrderID", "body", "uuid", m.UploadedAmendedOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateUploadedOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.UploadedOrderID) { // not required - return nil - } - - if err := validate.FormatOf("uploaded_order_id", "body", "uuid", m.UploadedOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgency(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFirstName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLastName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrderType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrderTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { - - if m.Agency != nil { - - if swag.IsZero(m.Agency) { // not required - return nil - } - - if err := m.Agency.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.DestinationDutyLocationGBLOC) { // not required - return nil - } - - if err := m.DestinationDutyLocationGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocationGBLOC") - } - return err - } - - return nil -} - -func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateFirstName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "first_name", "body", string(m.FirstName)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateLastName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "last_name", "body", string(m.LastName)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateOrderType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrderType) { // not required - return nil - } - - if err := m.OrderType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order_type") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOrderTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrderTypeDetail != nil { - - if swag.IsZero(m.OrderTypeDetail) { // not required - return nil - } - - if err := m.OrderTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order_type_detail") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OriginDutyLocationGBLOC) { // not required - return nil - } - - if err := m.OriginDutyLocationGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocationGBLOC") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/order_body.go b/pkg/gen/ghcmessages/order_body.go deleted file mode 100644 index 5d972159d61..00000000000 --- a/pkg/gen/ghcmessages/order_body.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OrderBody order body -// -// swagger:model OrderBody -type OrderBody struct { - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` -} - -// Validate validates this order body -func (m *OrderBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OrderBody) 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 -} - -// ContextValidate validates this order body based on context it is used -func (m *OrderBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OrderBody) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OrderBody) UnmarshalBinary(b []byte) error { - var res OrderBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/orders_type.go b/pkg/gen/ghcmessages/orders_type.go deleted file mode 100644 index 13ed0b535c1..00000000000 --- a/pkg/gen/ghcmessages/orders_type.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersType Orders type -// -// swagger:model OrdersType -type OrdersType string - -func NewOrdersType(value OrdersType) *OrdersType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersType. -func (m OrdersType) Pointer() *OrdersType { - return &m -} - -const ( - - // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" - OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" - - // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" - OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" - - // OrdersTypeRETIREMENT captures enum value "RETIREMENT" - OrdersTypeRETIREMENT OrdersType = "RETIREMENT" - - // OrdersTypeSEPARATION captures enum value "SEPARATION" - OrdersTypeSEPARATION OrdersType = "SEPARATION" - - // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" - OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" - - // OrdersTypeBLUEBARK captures enum value "BLUEBARK" - OrdersTypeBLUEBARK OrdersType = "BLUEBARK" - - // OrdersTypeSAFETY captures enum value "SAFETY" - OrdersTypeSAFETY OrdersType = "SAFETY" - - // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" - OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" - - // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" - OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" - - // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" - OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" -) - -// for schema -var ordersTypeEnum []interface{} - -func init() { - var res []OrdersType - if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeEnum = append(ordersTypeEnum, v) - } -} - -func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { - if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type -func (m OrdersType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type based on context it is used -func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/orders_type_detail.go b/pkg/gen/ghcmessages/orders_type_detail.go deleted file mode 100644 index 985b73f0e61..00000000000 --- a/pkg/gen/ghcmessages/orders_type_detail.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersTypeDetail Orders type detail -// -// swagger:model OrdersTypeDetail -type OrdersTypeDetail string - -func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. -func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { - return &m -} - -const ( - - // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" - OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" - - // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" - OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" - - // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" - OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" - - // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" - OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" - - // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" - OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" - - // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" - OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" - - // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" - OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" -) - -// for schema -var ordersTypeDetailEnum []interface{} - -func init() { - var res []OrdersTypeDetail - if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) - } -} - -func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { - if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type detail -func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type detail based on context it is used -func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_actual_weight.go b/pkg/gen/ghcmessages/p_p_m_actual_weight.go deleted file mode 100644 index 3e3e871f897..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_actual_weight.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMActualWeight The actual net weight of a single PPM shipment. Used during document review for PPM closeout. -// -// swagger:model PPMActualWeight -type PPMActualWeight struct { - - // actual weight - // Example: 2000 - // Required: true - ActualWeight *int64 `json:"actualWeight"` -} - -// Validate validates this p p m actual weight -func (m *PPMActualWeight) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMActualWeight) validateActualWeight(formats strfmt.Registry) error { - - if err := validate.Required("actualWeight", "body", m.ActualWeight); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p p m actual weight based on context it is used -func (m *PPMActualWeight) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PPMActualWeight) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMActualWeight) UnmarshalBinary(b []byte) error { - var res PPMActualWeight - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_advance_status.go b/pkg/gen/ghcmessages/p_p_m_advance_status.go deleted file mode 100644 index 6cacf489a30..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_advance_status.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMAdvanceStatus PPM Advance Status -// -// # Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received -// -// swagger:model PPMAdvanceStatus -type PPMAdvanceStatus string - -func NewPPMAdvanceStatus(value PPMAdvanceStatus) *PPMAdvanceStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMAdvanceStatus. -func (m PPMAdvanceStatus) Pointer() *PPMAdvanceStatus { - return &m -} - -const ( - - // PPMAdvanceStatusAPPROVED captures enum value "APPROVED" - PPMAdvanceStatusAPPROVED PPMAdvanceStatus = "APPROVED" - - // PPMAdvanceStatusREJECTED captures enum value "REJECTED" - PPMAdvanceStatusREJECTED PPMAdvanceStatus = "REJECTED" - - // PPMAdvanceStatusEDITED captures enum value "EDITED" - PPMAdvanceStatusEDITED PPMAdvanceStatus = "EDITED" - - // PPMAdvanceStatusRECEIVED captures enum value "RECEIVED" - PPMAdvanceStatusRECEIVED PPMAdvanceStatus = "RECEIVED" - - // PPMAdvanceStatusNOTRECEIVED captures enum value "NOT_RECEIVED" - PPMAdvanceStatusNOTRECEIVED PPMAdvanceStatus = "NOT_RECEIVED" -) - -// for schema -var pPMAdvanceStatusEnum []interface{} - -func init() { - var res []PPMAdvanceStatus - if err := json.Unmarshal([]byte(`["APPROVED","REJECTED","EDITED","RECEIVED","NOT_RECEIVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMAdvanceStatusEnum = append(pPMAdvanceStatusEnum, v) - } -} - -func (m PPMAdvanceStatus) validatePPMAdvanceStatusEnum(path, location string, value PPMAdvanceStatus) error { - if err := validate.EnumCase(path, location, value, pPMAdvanceStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m advance status -func (m PPMAdvanceStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMAdvanceStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this p p m advance status based on context it is used -func (m PPMAdvanceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_closeout.go b/pkg/gen/ghcmessages/p_p_m_closeout.go deleted file mode 100644 index b0f423ba61a..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_closeout.go +++ /dev/null @@ -1,225 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMCloseout The calculations needed in the "Review Documents" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment. -// -// swagger:model PPMCloseout -type PPMCloseout struct { - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SITReimbursement *int64 `json:"SITReimbursement"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // actual weight - // Example: 2000 - ActualWeight *int64 `json:"actualWeight"` - - // Advance Operating Allowance (AOA). - Aoa *int64 `json:"aoa"` - - // The Domestic Destination Price (DDP). - Ddp *int64 `json:"ddp"` - - // The Domestic Origin Price (DOP). - Dop *int64 `json:"dop"` - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // GCC - // - // Government Constructive Cost (GCC) - Gcc *int64 `json:"gcc"` - - // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. - // - // Read Only: true - GrossIncentive *int64 `json:"grossIncentive"` - - // The linehaul/shorthaul Fuel Surcharge (FSC). - HaulFSC *int64 `json:"haulFSC"` - - // The price of the linehaul or shorthaul. - HaulPrice *int64 `json:"haulPrice"` - - // The type of haul calculation used for this shipment (shorthaul or linehaul). - HaulType *string `json:"haulType"` - - // Primary auto-generated unique identifier of the PPM shipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // The distance between the old address and the new address in miles. - // Example: 54 - // Minimum: 0 - Miles *int64 `json:"miles"` - - // The full price of all packing/unpacking services. - PackPrice *int64 `json:"packPrice"` - - // Date the customer expects to begin their move. - // - // Format: date - PlannedMoveDate *strfmt.Date `json:"plannedMoveDate"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeightCustomer *int64 `json:"proGearWeightCustomer"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - ProGearWeightSpouse *int64 `json:"proGearWeightSpouse"` - - // The remaining reimbursement amount that is still owed to the customer. - RemainingIncentive *int64 `json:"remainingIncentive"` - - // The full price of all packing/unpacking services. - UnpackPrice *int64 `json:"unpackPrice"` -} - -// Validate validates this p p m closeout -func (m *PPMCloseout) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMiles(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePlannedMoveDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMCloseout) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMCloseout) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMCloseout) validateMiles(formats strfmt.Registry) error { - if swag.IsZero(m.Miles) { // not required - return nil - } - - if err := validate.MinimumInt("miles", "body", *m.Miles, 0, false); err != nil { - return err - } - - return nil -} - -func (m *PPMCloseout) validatePlannedMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.PlannedMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("plannedMoveDate", "body", "date", m.PlannedMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m closeout based on the context it is used -func (m *PPMCloseout) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGrossIncentive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMCloseout) contextValidateGrossIncentive(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "grossIncentive", "body", m.GrossIncentive); err != nil { - return err - } - - return nil -} - -func (m *PPMCloseout) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMCloseout) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMCloseout) UnmarshalBinary(b []byte) error { - var res PPMCloseout - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_destination_address.go b/pkg/gen/ghcmessages/p_p_m_destination_address.go deleted file mode 100644 index 4a74a91bb81..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_destination_address.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMDestinationAddress A postal address -// -// swagger:model PPMDestinationAddress -type PPMDestinationAddress struct { - - // City - // Example: Anytown - // Required: true - City *string `json:"city"` - - // Country - // Example: USA - Country *string `json:"country,omitempty"` - - // County - // Example: LOS ANGELES - County *string `json:"county,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // ZIP - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - PostalCode *string `json:"postalCode"` - - // State - // Required: true - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State *string `json:"state"` - - // Street address 1 - // Example: 123 Main Ave - StreetAddress1 *string `json:"streetAddress1,omitempty"` - - // Street address 2 - // Example: Apartment 9000 - StreetAddress2 *string `json:"streetAddress2,omitempty"` - - // Address Line 3 - // Example: Montmârtre - StreetAddress3 *string `json:"streetAddress3,omitempty"` - - // us post region cities ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` -} - -// Validate validates this p p m destination address -func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsPostRegionCitiesID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { - - if err := validate.Required("city", "body", m.City); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { - - if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { - return err - } - - if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -var pPMDestinationAddressTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) - } -} - -const ( - - // PPMDestinationAddressStateAL captures enum value "AL" - PPMDestinationAddressStateAL string = "AL" - - // PPMDestinationAddressStateAK captures enum value "AK" - PPMDestinationAddressStateAK string = "AK" - - // PPMDestinationAddressStateAR captures enum value "AR" - PPMDestinationAddressStateAR string = "AR" - - // PPMDestinationAddressStateAZ captures enum value "AZ" - PPMDestinationAddressStateAZ string = "AZ" - - // PPMDestinationAddressStateCA captures enum value "CA" - PPMDestinationAddressStateCA string = "CA" - - // PPMDestinationAddressStateCO captures enum value "CO" - PPMDestinationAddressStateCO string = "CO" - - // PPMDestinationAddressStateCT captures enum value "CT" - PPMDestinationAddressStateCT string = "CT" - - // PPMDestinationAddressStateDC captures enum value "DC" - PPMDestinationAddressStateDC string = "DC" - - // PPMDestinationAddressStateDE captures enum value "DE" - PPMDestinationAddressStateDE string = "DE" - - // PPMDestinationAddressStateFL captures enum value "FL" - PPMDestinationAddressStateFL string = "FL" - - // PPMDestinationAddressStateGA captures enum value "GA" - PPMDestinationAddressStateGA string = "GA" - - // PPMDestinationAddressStateHI captures enum value "HI" - PPMDestinationAddressStateHI string = "HI" - - // PPMDestinationAddressStateIA captures enum value "IA" - PPMDestinationAddressStateIA string = "IA" - - // PPMDestinationAddressStateID captures enum value "ID" - PPMDestinationAddressStateID string = "ID" - - // PPMDestinationAddressStateIL captures enum value "IL" - PPMDestinationAddressStateIL string = "IL" - - // PPMDestinationAddressStateIN captures enum value "IN" - PPMDestinationAddressStateIN string = "IN" - - // PPMDestinationAddressStateKS captures enum value "KS" - PPMDestinationAddressStateKS string = "KS" - - // PPMDestinationAddressStateKY captures enum value "KY" - PPMDestinationAddressStateKY string = "KY" - - // PPMDestinationAddressStateLA captures enum value "LA" - PPMDestinationAddressStateLA string = "LA" - - // PPMDestinationAddressStateMA captures enum value "MA" - PPMDestinationAddressStateMA string = "MA" - - // PPMDestinationAddressStateMD captures enum value "MD" - PPMDestinationAddressStateMD string = "MD" - - // PPMDestinationAddressStateME captures enum value "ME" - PPMDestinationAddressStateME string = "ME" - - // PPMDestinationAddressStateMI captures enum value "MI" - PPMDestinationAddressStateMI string = "MI" - - // PPMDestinationAddressStateMN captures enum value "MN" - PPMDestinationAddressStateMN string = "MN" - - // PPMDestinationAddressStateMO captures enum value "MO" - PPMDestinationAddressStateMO string = "MO" - - // PPMDestinationAddressStateMS captures enum value "MS" - PPMDestinationAddressStateMS string = "MS" - - // PPMDestinationAddressStateMT captures enum value "MT" - PPMDestinationAddressStateMT string = "MT" - - // PPMDestinationAddressStateNC captures enum value "NC" - PPMDestinationAddressStateNC string = "NC" - - // PPMDestinationAddressStateND captures enum value "ND" - PPMDestinationAddressStateND string = "ND" - - // PPMDestinationAddressStateNE captures enum value "NE" - PPMDestinationAddressStateNE string = "NE" - - // PPMDestinationAddressStateNH captures enum value "NH" - PPMDestinationAddressStateNH string = "NH" - - // PPMDestinationAddressStateNJ captures enum value "NJ" - PPMDestinationAddressStateNJ string = "NJ" - - // PPMDestinationAddressStateNM captures enum value "NM" - PPMDestinationAddressStateNM string = "NM" - - // PPMDestinationAddressStateNV captures enum value "NV" - PPMDestinationAddressStateNV string = "NV" - - // PPMDestinationAddressStateNY captures enum value "NY" - PPMDestinationAddressStateNY string = "NY" - - // PPMDestinationAddressStateOH captures enum value "OH" - PPMDestinationAddressStateOH string = "OH" - - // PPMDestinationAddressStateOK captures enum value "OK" - PPMDestinationAddressStateOK string = "OK" - - // PPMDestinationAddressStateOR captures enum value "OR" - PPMDestinationAddressStateOR string = "OR" - - // PPMDestinationAddressStatePA captures enum value "PA" - PPMDestinationAddressStatePA string = "PA" - - // PPMDestinationAddressStateRI captures enum value "RI" - PPMDestinationAddressStateRI string = "RI" - - // PPMDestinationAddressStateSC captures enum value "SC" - PPMDestinationAddressStateSC string = "SC" - - // PPMDestinationAddressStateSD captures enum value "SD" - PPMDestinationAddressStateSD string = "SD" - - // PPMDestinationAddressStateTN captures enum value "TN" - PPMDestinationAddressStateTN string = "TN" - - // PPMDestinationAddressStateTX captures enum value "TX" - PPMDestinationAddressStateTX string = "TX" - - // PPMDestinationAddressStateUT captures enum value "UT" - PPMDestinationAddressStateUT string = "UT" - - // PPMDestinationAddressStateVA captures enum value "VA" - PPMDestinationAddressStateVA string = "VA" - - // PPMDestinationAddressStateVT captures enum value "VT" - PPMDestinationAddressStateVT string = "VT" - - // PPMDestinationAddressStateWA captures enum value "WA" - PPMDestinationAddressStateWA string = "WA" - - // PPMDestinationAddressStateWI captures enum value "WI" - PPMDestinationAddressStateWI string = "WI" - - // PPMDestinationAddressStateWV captures enum value "WV" - PPMDestinationAddressStateWV string = "WV" - - // PPMDestinationAddressStateWY captures enum value "WY" - PPMDestinationAddressStateWY string = "WY" -) - -// prop value enum -func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { - if swag.IsZero(m.UsPostRegionCitiesID) { // not required - return nil - } - - if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m destination address based on the context it is used -func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { - var res PPMDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_document_status.go b/pkg/gen/ghcmessages/p_p_m_document_status.go deleted file mode 100644 index 66d4f937af8..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_document_status.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMDocumentStatus Status of the PPM document. -// -// swagger:model PPMDocumentStatus -type PPMDocumentStatus string - -func NewPPMDocumentStatus(value PPMDocumentStatus) *PPMDocumentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMDocumentStatus. -func (m PPMDocumentStatus) Pointer() *PPMDocumentStatus { - return &m -} - -const ( - - // PPMDocumentStatusAPPROVED captures enum value "APPROVED" - PPMDocumentStatusAPPROVED PPMDocumentStatus = "APPROVED" - - // PPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" - PPMDocumentStatusEXCLUDED PPMDocumentStatus = "EXCLUDED" - - // PPMDocumentStatusREJECTED captures enum value "REJECTED" - PPMDocumentStatusREJECTED PPMDocumentStatus = "REJECTED" -) - -// for schema -var pPMDocumentStatusEnum []interface{} - -func init() { - var res []PPMDocumentStatus - if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMDocumentStatusEnum = append(pPMDocumentStatusEnum, v) - } -} - -func (m PPMDocumentStatus) validatePPMDocumentStatusEnum(path, location string, value PPMDocumentStatus) error { - if err := validate.EnumCase(path, location, value, pPMDocumentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m document status -func (m PPMDocumentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMDocumentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this p p m document status based on context it is used -func (m PPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_document_status_reason.go b/pkg/gen/ghcmessages/p_p_m_document_status_reason.go deleted file mode 100644 index 4ee8a9cb264..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_document_status_reason.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// PPMDocumentStatusReason The reason the services counselor has excluded or rejected the item. -// -// swagger:model PPMDocumentStatusReason -type PPMDocumentStatusReason string - -// Validate validates this p p m document status reason -func (m PPMDocumentStatusReason) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p p m document status reason based on context it is used -func (m PPMDocumentStatusReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_documents.go b/pkg/gen/ghcmessages/p_p_m_documents.go deleted file mode 100644 index 64e76938ca2..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_documents.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PPMDocuments All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses. -// -// swagger:model PPMDocuments -type PPMDocuments struct { - - // moving expenses - MovingExpenses MovingExpenses `json:"MovingExpenses"` - - // pro gear weight tickets - ProGearWeightTickets ProGearWeightTickets `json:"ProGearWeightTickets"` - - // weight tickets - WeightTickets WeightTickets `json:"WeightTickets"` -} - -// Validate validates this p p m documents -func (m *PPMDocuments) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMovingExpenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightTickets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTickets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDocuments) validateMovingExpenses(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenses) { // not required - return nil - } - - if err := m.MovingExpenses.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("MovingExpenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("MovingExpenses") - } - return err - } - - return nil -} - -func (m *PPMDocuments) validateProGearWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeightTickets) { // not required - return nil - } - - if err := m.ProGearWeightTickets.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ProGearWeightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ProGearWeightTickets") - } - return err - } - - return nil -} - -func (m *PPMDocuments) validateWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTickets) { // not required - return nil - } - - if err := m.WeightTickets.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WeightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("WeightTickets") - } - return err - } - - return nil -} - -// ContextValidate validate this p p m documents based on the context it is used -func (m *PPMDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDocuments) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MovingExpenses.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("MovingExpenses") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("MovingExpenses") - } - return err - } - - return nil -} - -func (m *PPMDocuments) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProGearWeightTickets.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ProGearWeightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ProGearWeightTickets") - } - return err - } - - return nil -} - -func (m *PPMDocuments) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("WeightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("WeightTickets") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMDocuments) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMDocuments) UnmarshalBinary(b []byte) error { - var res PPMDocuments - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go b/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go deleted file mode 100644 index 6fe30dab21a..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go +++ /dev/null @@ -1,335 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMSITEstimatedCost The estimated cost of SIT for a single PPM shipment. Used during document review for PPM. -// -// swagger:model PPMSITEstimatedCost -type PPMSITEstimatedCost struct { - - // params additional day s i t - ParamsAdditionalDaySIT *PPMSITEstimatedCostParamsAdditionalDaySIT `json:"paramsAdditionalDaySIT,omitempty"` - - // params first day s i t - ParamsFirstDaySIT *PPMSITEstimatedCostParamsFirstDaySIT `json:"paramsFirstDaySIT,omitempty"` - - // Price of an additional day in SIT - // Example: 2000 - // Required: true - PriceAdditionalDaySIT *int64 `json:"priceAdditionalDaySIT"` - - // Price of the first day in SIT - // Example: 2000 - // Required: true - PriceFirstDaySIT *int64 `json:"priceFirstDaySIT"` - - // sit cost - // Example: 2000 - // Required: true - SitCost *int64 `json:"sitCost"` -} - -// Validate validates this p p m s i t estimated cost -func (m *PPMSITEstimatedCost) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateParamsAdditionalDaySIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParamsFirstDaySIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePriceAdditionalDaySIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePriceFirstDaySIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCost(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMSITEstimatedCost) validateParamsAdditionalDaySIT(formats strfmt.Registry) error { - if swag.IsZero(m.ParamsAdditionalDaySIT) { // not required - return nil - } - - if m.ParamsAdditionalDaySIT != nil { - if err := m.ParamsAdditionalDaySIT.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paramsAdditionalDaySIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paramsAdditionalDaySIT") - } - return err - } - } - - return nil -} - -func (m *PPMSITEstimatedCost) validateParamsFirstDaySIT(formats strfmt.Registry) error { - if swag.IsZero(m.ParamsFirstDaySIT) { // not required - return nil - } - - if m.ParamsFirstDaySIT != nil { - if err := m.ParamsFirstDaySIT.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paramsFirstDaySIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paramsFirstDaySIT") - } - return err - } - } - - return nil -} - -func (m *PPMSITEstimatedCost) validatePriceAdditionalDaySIT(formats strfmt.Registry) error { - - if err := validate.Required("priceAdditionalDaySIT", "body", m.PriceAdditionalDaySIT); err != nil { - return err - } - - return nil -} - -func (m *PPMSITEstimatedCost) validatePriceFirstDaySIT(formats strfmt.Registry) error { - - if err := validate.Required("priceFirstDaySIT", "body", m.PriceFirstDaySIT); err != nil { - return err - } - - return nil -} - -func (m *PPMSITEstimatedCost) validateSitCost(formats strfmt.Registry) error { - - if err := validate.Required("sitCost", "body", m.SitCost); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m s i t estimated cost based on the context it is used -func (m *PPMSITEstimatedCost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateParamsAdditionalDaySIT(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateParamsFirstDaySIT(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMSITEstimatedCost) contextValidateParamsAdditionalDaySIT(ctx context.Context, formats strfmt.Registry) error { - - if m.ParamsAdditionalDaySIT != nil { - - if swag.IsZero(m.ParamsAdditionalDaySIT) { // not required - return nil - } - - if err := m.ParamsAdditionalDaySIT.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paramsAdditionalDaySIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paramsAdditionalDaySIT") - } - return err - } - } - - return nil -} - -func (m *PPMSITEstimatedCost) contextValidateParamsFirstDaySIT(ctx context.Context, formats strfmt.Registry) error { - - if m.ParamsFirstDaySIT != nil { - - if swag.IsZero(m.ParamsFirstDaySIT) { // not required - return nil - } - - if err := m.ParamsFirstDaySIT.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paramsFirstDaySIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paramsFirstDaySIT") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMSITEstimatedCost) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMSITEstimatedCost) UnmarshalBinary(b []byte) error { - var res PPMSITEstimatedCost - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// PPMSITEstimatedCostParamsAdditionalDaySIT p p m s i t estimated cost params additional day s i t -// -// swagger:model PPMSITEstimatedCostParamsAdditionalDaySIT -type PPMSITEstimatedCostParamsAdditionalDaySIT struct { - - // contract year name - // Example: Award Term 1 - ContractYearName string `json:"contractYearName,omitempty"` - - // escalation compounded - // Example: 1.01 - EscalationCompounded string `json:"escalationCompounded,omitempty"` - - // is peak - // Example: true - IsPeak string `json:"isPeak,omitempty"` - - // number days s i t - // Example: 30 - NumberDaysSIT *string `json:"numberDaysSIT,omitempty"` - - // price rate or factor - // Example: 0.53 - PriceRateOrFactor string `json:"priceRateOrFactor,omitempty"` - - // service area destination - // Example: 252 - ServiceAreaDestination *string `json:"serviceAreaDestination,omitempty"` - - // service area origin - // Example: 252 - ServiceAreaOrigin *string `json:"serviceAreaOrigin,omitempty"` -} - -// Validate validates this p p m s i t estimated cost params additional day s i t -func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p p m s i t estimated cost params additional day s i t based on context it is used -func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) UnmarshalBinary(b []byte) error { - var res PPMSITEstimatedCostParamsAdditionalDaySIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// PPMSITEstimatedCostParamsFirstDaySIT p p m s i t estimated cost params first day s i t -// -// swagger:model PPMSITEstimatedCostParamsFirstDaySIT -type PPMSITEstimatedCostParamsFirstDaySIT struct { - - // contract year name - // Example: Award Term 1 - ContractYearName string `json:"contractYearName,omitempty"` - - // escalation compounded - // Example: 1.01 - EscalationCompounded string `json:"escalationCompounded,omitempty"` - - // is peak - // Example: true - IsPeak string `json:"isPeak,omitempty"` - - // price rate or factor - // Example: 20.53 - PriceRateOrFactor string `json:"priceRateOrFactor,omitempty"` - - // service area destination - // Example: 252 - ServiceAreaDestination *string `json:"serviceAreaDestination,omitempty"` - - // service area origin - // Example: 252 - ServiceAreaOrigin *string `json:"serviceAreaOrigin,omitempty"` -} - -// Validate validates this p p m s i t estimated cost params first day s i t -func (m *PPMSITEstimatedCostParamsFirstDaySIT) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p p m s i t estimated cost params first day s i t based on context it is used -func (m *PPMSITEstimatedCostParamsFirstDaySIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PPMSITEstimatedCostParamsFirstDaySIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMSITEstimatedCostParamsFirstDaySIT) UnmarshalBinary(b []byte) error { - var res PPMSITEstimatedCostParamsFirstDaySIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment.go b/pkg/gen/ghcmessages/p_p_m_shipment.go deleted file mode 100644 index 3b563ef0515..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_shipment.go +++ /dev/null @@ -1,1264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment -type PPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // advance status - AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` - - // The allowable weight of the PPM shipment goods being moved. - // Example: 4300 - // Minimum: 0 - AllowableWeight *int64 `json:"allowableWeight"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // Timestamp of when the PPM Shipment was initially created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin their move. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. - // - // Read Only: true - FinalIncentive *int64 `json:"finalIncentive"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Primary auto-generated unique identifier of the PPM shipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - MaxIncentive *int64 `json:"maxIncentive"` - - // All expense documentation receipt records of this PPM shipment. - MovingExpenses []*MovingExpense `json:"movingExpenses"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeight *int64 `json:"proGearWeight"` - - // All pro-gear weight ticket documentation records for this PPM shipment. - ProGearWeightTickets []*ProGearWeightTicket `json:"proGearWeightTickets"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // secondary destination address - SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // The id of the parent MTOShipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // signed certification - SignedCertification *SignedCertification `json:"signedCertification,omitempty"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // tertiary destination address - TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // w2 address - W2Address *Address `json:"w2Address,omitempty"` - - // weight tickets - WeightTickets WeightTickets `json:"weightTickets"` -} - -// Validate validates this p p m shipment -func (m *PPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdvanceStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAllowableWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightTickets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignedCertification(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateW2Address(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTickets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if m.AdvanceStatus != nil { - if err := m.AdvanceStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateAllowableWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AllowableWeight) { // not required - return nil - } - - if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateMovingExpenses(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenses) { // not required - return nil - } - - for i := 0; i < len(m.MovingExpenses); i++ { - if swag.IsZero(m.MovingExpenses[i]) { // not required - continue - } - - if m.MovingExpenses[i] != nil { - if err := m.MovingExpenses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeightTickets) { // not required - return nil - } - - for i := 0; i < len(m.ProGearWeightTickets); i++ { - if swag.IsZero(m.ProGearWeightTickets[i]) { // not required - continue - } - - if m.ProGearWeightTickets[i] != nil { - if err := m.ProGearWeightTickets[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if m.SecondaryDestinationAddress != nil { - if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSignedCertification(formats strfmt.Registry) error { - if swag.IsZero(m.SignedCertification) { // not required - return nil - } - - if m.SignedCertification != nil { - if err := m.SignedCertification.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("signedCertification") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("signedCertification") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if m.TertiaryDestinationAddress != nil { - if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateW2Address(formats strfmt.Registry) error { - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if m.W2Address != nil { - if err := m.W2Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTickets) { // not required - return nil - } - - if err := m.WeightTickets.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weightTickets") - } - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment based on the context it is used -func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSignedCertification(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateW2Address(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvanceStatus != nil { - - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MovingExpenses); i++ { - - if m.MovingExpenses[i] != nil { - - if swag.IsZero(m.MovingExpenses[i]) { // not required - return nil - } - - if err := m.MovingExpenses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ProGearWeightTickets); i++ { - - if m.ProGearWeightTickets[i] != nil { - - if swag.IsZero(m.ProGearWeightTickets[i]) { // not required - return nil - } - - if err := m.ProGearWeightTickets[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDestinationAddress != nil { - - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateSignedCertification(ctx context.Context, formats strfmt.Registry) error { - - if m.SignedCertification != nil { - - if swag.IsZero(m.SignedCertification) { // not required - return nil - } - - if err := m.SignedCertification.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("signedCertification") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("signedCertification") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDestinationAddress != nil { - - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { - - if m.W2Address != nil { - - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if err := m.W2Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weightTickets") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment) UnmarshalBinary(b []byte) error { - var res PPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go b/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go deleted file mode 100644 index 27da00c881f..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipmentSIT SIT related items for a PPM shipment -// -// swagger:model PPMShipmentSIT -type PPMShipmentSIT struct { - - // sit location - // Required: true - SitLocation *SITLocationType `json:"sitLocation"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this p p m shipment s i t -func (m *PPMShipmentSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipmentSIT) validateSitLocation(formats strfmt.Registry) error { - - if err := validate.Required("sitLocation", "body", m.SitLocation); err != nil { - return err - } - - if err := validate.Required("sitLocation", "body", m.SitLocation); err != nil { - return err - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipmentSIT) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment s i t based on the context it is used -func (m *PPMShipmentSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipmentSIT) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipmentSIT) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipmentSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipmentSIT) UnmarshalBinary(b []byte) error { - var res PPMShipmentSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment_status.go b/pkg/gen/ghcmessages/p_p_m_shipment_status.go deleted file mode 100644 index c0c00accade..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_shipment_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMShipmentStatus Status of the PPM Shipment: -// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. -// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. -// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. -// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. -// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. -// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. -// -// swagger:model PPMShipmentStatus -type PPMShipmentStatus string - -func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. -func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { - return &m -} - -const ( - - // PPMShipmentStatusDRAFT captures enum value "DRAFT" - PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" - - // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" - PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" - - // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" - - // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" - - // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" - - // PPMShipmentStatusCANCELED captures enum value "CANCELED" - PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" -) - -// for schema -var pPMShipmentStatusEnum []interface{} - -func init() { - var res []PPMShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) - } -} - -func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { - if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m shipment status -func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p p m shipment status based on the context it is used -func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/p_p_m_status.go b/pkg/gen/ghcmessages/p_p_m_status.go deleted file mode 100644 index 720b370a8d3..00000000000 --- a/pkg/gen/ghcmessages/p_p_m_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMStatus p p m status -// -// swagger:model PPMStatus -type PPMStatus string - -func NewPPMStatus(value PPMStatus) *PPMStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMStatus. -func (m PPMStatus) Pointer() *PPMStatus { - return &m -} - -const ( - - // PPMStatusCANCELED captures enum value "CANCELED" - PPMStatusCANCELED PPMStatus = "CANCELED" - - // PPMStatusDRAFT captures enum value "DRAFT" - PPMStatusDRAFT PPMStatus = "DRAFT" - - // PPMStatusSUBMITTED captures enum value "SUBMITTED" - PPMStatusSUBMITTED PPMStatus = "SUBMITTED" - - // PPMStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMStatusWAITINGONCUSTOMER PPMStatus = "WAITING_ON_CUSTOMER" - - // PPMStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMStatusNEEDSADVANCEAPPROVAL PPMStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMStatusNEEDSCLOSEOUT PPMStatus = "NEEDS_CLOSEOUT" - - // PPMStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMStatusCLOSEOUTCOMPLETE PPMStatus = "CLOSEOUT_COMPLETE" - - // PPMStatusCOMPLETED captures enum value "COMPLETED" - PPMStatusCOMPLETED PPMStatus = "COMPLETED" -) - -// for schema -var pPMStatusEnum []interface{} - -func init() { - var res []PPMStatus - if err := json.Unmarshal([]byte(`["CANCELED","DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","COMPLETED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMStatusEnum = append(pPMStatusEnum, v) - } -} - -func (m PPMStatus) validatePPMStatusEnum(path, location string, value PPMStatus) error { - if err := validate.EnumCase(path, location, value, pPMStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m status -func (m PPMStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this p p m status based on context it is used -func (m PPMStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/p_w_s_violation.go b/pkg/gen/ghcmessages/p_w_s_violation.go deleted file mode 100644 index 321e02d0ea9..00000000000 --- a/pkg/gen/ghcmessages/p_w_s_violation.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PWSViolation A PWS violation for an evaluation report -// -// swagger:model PWSViolation -type PWSViolation struct { - - // additional data elem - // Example: QAE Observed Delivery Date - AdditionalDataElem string `json:"additionalDataElem,omitempty"` - - // category - // Example: Pre-Move Services - Category string `json:"category,omitempty"` - - // display order - // Example: 3 - DisplayOrder int64 `json:"displayOrder,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is kpi - // Example: false - IsKpi bool `json:"isKpi,omitempty"` - - // paragraph number - // Example: 1.2.3.4.5 - ParagraphNumber string `json:"paragraphNumber,omitempty"` - - // requirement statement - // Example: The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS. - RequirementStatement string `json:"requirementStatement,omitempty"` - - // requirement summary - // Example: Provide a single point of contact (POC) - RequirementSummary string `json:"requirementSummary,omitempty"` - - // sub category - // Example: Weight Estimate - SubCategory string `json:"subCategory,omitempty"` - - // title - // Example: Customer Support - Title string `json:"title,omitempty"` -} - -// Validate validates this p w s violation -func (m *PWSViolation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PWSViolation) 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 -} - -// ContextValidate validate this p w s violation based on the context it is used -func (m *PWSViolation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *PWSViolation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PWSViolation) UnmarshalBinary(b []byte) error { - var res PWSViolation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/p_w_s_violations.go b/pkg/gen/ghcmessages/p_w_s_violations.go deleted file mode 100644 index e06fd5c227f..00000000000 --- a/pkg/gen/ghcmessages/p_w_s_violations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PWSViolations p w s violations -// -// swagger:model PWSViolations -type PWSViolations []*PWSViolation - -// Validate validates this p w s violations -func (m PWSViolations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p w s violations based on the context it is used -func (m PWSViolations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go b/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go deleted file mode 100644 index 311df9797d8..00000000000 --- a/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go +++ /dev/null @@ -1,112 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PatchMTOServiceItemStatusPayload patch m t o service item status payload -// -// swagger:model PatchMTOServiceItemStatusPayload -type PatchMTOServiceItemStatusPayload struct { - - // Reason the service item was rejected - // Example: Insufficent details provided - RejectionReason *string `json:"rejectionReason,omitempty"` - - // Describes all statuses for a MTOServiceItem - // Enum: [SUBMITTED APPROVED REJECTED] - Status string `json:"status,omitempty"` -} - -// Validate validates this patch m t o service item status payload -func (m *PatchMTOServiceItemStatusPayload) 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 -} - -var patchMTOServiceItemStatusPayloadTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - patchMTOServiceItemStatusPayloadTypeStatusPropEnum = append(patchMTOServiceItemStatusPayloadTypeStatusPropEnum, v) - } -} - -const ( - - // PatchMTOServiceItemStatusPayloadStatusSUBMITTED captures enum value "SUBMITTED" - PatchMTOServiceItemStatusPayloadStatusSUBMITTED string = "SUBMITTED" - - // PatchMTOServiceItemStatusPayloadStatusAPPROVED captures enum value "APPROVED" - PatchMTOServiceItemStatusPayloadStatusAPPROVED string = "APPROVED" - - // PatchMTOServiceItemStatusPayloadStatusREJECTED captures enum value "REJECTED" - PatchMTOServiceItemStatusPayloadStatusREJECTED string = "REJECTED" -) - -// prop value enum -func (m *PatchMTOServiceItemStatusPayload) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, patchMTOServiceItemStatusPayloadTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PatchMTOServiceItemStatusPayload) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this patch m t o service item status payload based on context it is used -func (m *PatchMTOServiceItemStatusPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PatchMTOServiceItemStatusPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PatchMTOServiceItemStatusPayload) UnmarshalBinary(b []byte) error { - var res PatchMTOServiceItemStatusPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/payment_request.go b/pkg/gen/ghcmessages/payment_request.go deleted file mode 100644 index 6e4ba8100c6..00000000000 --- a/pkg/gen/ghcmessages/payment_request.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // Reported code from syncada for the EDI error encountered - EdiErrorCode *string `json:"ediErrorCode,omitempty"` - - // The reason the services counselor has excluded or rejected the item. - EdiErrorDescription *string `json:"ediErrorDescription,omitempty"` - - // Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858. - EdiErrorType *string `json:"ediErrorType,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order - MoveTaskOrder *Move `json:"moveTaskOrder,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // proof of service docs - ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // received by gex at - // Format: date-time - ReceivedByGexAt *strfmt.DateTime `json:"receivedByGexAt,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // reviewed at - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt,omitempty"` - - // sent to gex at - // Format: date-time - SentToGexAt *strfmt.DateTime `json:"sentToGexAt,omitempty"` - - // service items - ServiceItems PaymentServiceItems `json:"serviceItems,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` - - // Total amount that TPPS paid for all service items on the payment request in millicents - TppsInvoiceAmountPaidTotalMillicents *int64 `json:"tppsInvoiceAmountPaidTotalMillicents,omitempty"` - - // Date that TPPS paid HS for the payment request - // Format: date-time - TppsInvoiceSellerPaidDate *strfmt.DateTime `json:"tppsInvoiceSellerPaidDate,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrder(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfServiceDocs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReceivedByGexAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSentToGexAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTppsInvoiceSellerPaidDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrder(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrder) { // not required - return nil - } - - if m.MoveTaskOrder != nil { - if err := m.MoveTaskOrder.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moveTaskOrder") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moveTaskOrder") - } - return err - } - } - - return nil -} - -func (m *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { - if swag.IsZero(m.ProofOfServiceDocs) { // not required - return nil - } - - if err := m.ProofOfServiceDocs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateReceivedByGexAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReceivedByGexAt) { // not required - return nil - } - - if err := validate.FormatOf("receivedByGexAt", "body", "date-time", m.ReceivedByGexAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateSentToGexAt(formats strfmt.Registry) error { - if swag.IsZero(m.SentToGexAt) { // not required - return nil - } - - if err := validate.FormatOf("sentToGexAt", "body", "date-time", m.SentToGexAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceItems) { // not required - return nil - } - - if err := m.ServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateTppsInvoiceSellerPaidDate(formats strfmt.Registry) error { - if swag.IsZero(m.TppsInvoiceSellerPaidDate) { // not required - return nil - } - - if err := validate.FormatOf("tppsInvoiceSellerPaidDate", "body", "date-time", m.TppsInvoiceSellerPaidDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveTaskOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateMoveTaskOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.MoveTaskOrder != nil { - - if swag.IsZero(m.MoveTaskOrder) { // not required - return nil - } - - if err := m.MoveTaskOrder.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moveTaskOrder") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moveTaskOrder") - } - return err - } - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/payment_request_status.go b/pkg/gen/ghcmessages/payment_request_status.go deleted file mode 100644 index 56359fa3219..00000000000 --- a/pkg/gen/ghcmessages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" - PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/payment_requests.go b/pkg/gen/ghcmessages/payment_requests.go deleted file mode 100644 index 2cc938bac72..00000000000 --- a/pkg/gen/ghcmessages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/payment_service_item.go b/pkg/gen/ghcmessages/payment_service_item.go deleted file mode 100644 index 8dce225f76c..00000000000 --- a/pkg/gen/ghcmessages/payment_service_item.go +++ /dev/null @@ -1,350 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItem payment service item -// -// swagger:model PaymentServiceItem -type PaymentServiceItem struct { - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto service item code - // Example: DLH - MtoServiceItemCode string `json:"mtoServiceItemCode,omitempty"` - - // mto service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // mto service item name - // Example: Move management - MtoServiceItemName string `json:"mtoServiceItemName,omitempty"` - - // mto shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // mto shipment type - MtoShipmentType MTOShipmentType `json:"mtoShipmentType,omitempty"` - - // payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // payment service item params - PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` - - // Price of the service item in cents - PriceCents *int64 `json:"priceCents,omitempty"` - - // reference ID - // Example: 1234-5678-c56a4180 - // Read Only: true - ReferenceID string `json:"referenceID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentServiceItemStatus `json:"status,omitempty"` - - // Amount that TPPS paid for the individual service item in millicents - TppsInvoiceAmountPaidPerServiceItemMillicents *int64 `json:"tppsInvoiceAmountPaidPerServiceItemMillicents,omitempty"` -} - -// Validate validates this payment service item -func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validateMtoShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentType) { // not required - return nil - } - - if err := m.MtoShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipmentType") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemParams) { // not required - return nil - } - - if err := m.PaymentServiceItemParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item based on the context it is used -func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReferenceID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateMtoShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentType) { // not required - return nil - } - - if err := m.MtoShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipmentType") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { - var res PaymentServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/payment_service_item_param.go b/pkg/gen/ghcmessages/payment_service_item_param.go deleted file mode 100644 index 0743122c77b..00000000000 --- a/pkg/gen/ghcmessages/payment_service_item_param.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemParam payment service item param -// -// swagger:model PaymentServiceItemParam -type PaymentServiceItemParam struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // key - Key ServiceItemParamName `json:"key,omitempty"` - - // origin - Origin ServiceItemParamOrigin `json:"origin,omitempty"` - - // payment service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` - - // type - Type ServiceItemParamType `json:"type,omitempty"` - - // value - // Example: 3025 - Value string `json:"value,omitempty"` -} - -// Validate validates this payment service item param -func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item param based on the context it is used -func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKey(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { - var res PaymentServiceItemParam - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/payment_service_item_params.go b/pkg/gen/ghcmessages/payment_service_item_params.go deleted file mode 100644 index 5f09832fdd6..00000000000 --- a/pkg/gen/ghcmessages/payment_service_item_params.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItemParams payment service item params -// -// swagger:model PaymentServiceItemParams -type PaymentServiceItemParams []*PaymentServiceItemParam - -// Validate validates this payment service item params -func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service item params based on the context it is used -func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/payment_service_item_status.go b/pkg/gen/ghcmessages/payment_service_item_status.go deleted file mode 100644 index 0e1f2354741..00000000000 --- a/pkg/gen/ghcmessages/payment_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemStatus Payment Service Item Status -// -// swagger:model PaymentServiceItemStatus -type PaymentServiceItemStatus string - -func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. -func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { - return &m -} - -const ( - - // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" - PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" - - // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" - PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" - - // PaymentServiceItemStatusDENIED captures enum value "DENIED" - PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" - - // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" - - // PaymentServiceItemStatusPAID captures enum value "PAID" - PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" - - // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" - PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" -) - -// for schema -var paymentServiceItemStatusEnum []interface{} - -func init() { - var res []PaymentServiceItemStatus - if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) - } -} - -func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment service item status -func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment service item status based on context it is used -func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/payment_service_items.go b/pkg/gen/ghcmessages/payment_service_items.go deleted file mode 100644 index fe8564195b2..00000000000 --- a/pkg/gen/ghcmessages/payment_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItems payment service items -// -// swagger:model PaymentServiceItems -type PaymentServiceItems []*PaymentServiceItem - -// Validate validates this payment service items -func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service items based on the context it is used -func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/post_document_payload.go b/pkg/gen/ghcmessages/post_document_payload.go deleted file mode 100644 index 72e059cdfc3..00000000000 --- a/pkg/gen/ghcmessages/post_document_payload.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostDocumentPayload post document payload -// -// swagger:model PostDocumentPayload -type PostDocumentPayload struct { - - // The service member this document belongs to - // Format: uuid - ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` -} - -// Validate validates this post document payload -func (m *PostDocumentPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostDocumentPayload) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this post document payload based on context it is used -func (m *PostDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostDocumentPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostDocumentPayload) UnmarshalBinary(b []byte) error { - var res PostDocumentPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/pro_gear_weight_ticket.go b/pkg/gen/ghcmessages/pro_gear_weight_ticket.go deleted file mode 100644 index 1c7089a51b0..00000000000 --- a/pkg/gen/ghcmessages/pro_gear_weight_ticket.go +++ /dev/null @@ -1,463 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProGearWeightTicket Pro-gear associated information and weight docs for a PPM shipment -// -// swagger:model ProGearWeightTicket -type ProGearWeightTicket struct { - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - BelongsToSelf *bool `json:"belongsToSelf"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // Describes the pro-gear that was moved. - Description *string `json:"description"` - - // document - // Required: true - Document *Document `json:"document"` - - // The ID of the document that is associated with the user uploads containing the pro-gear weight. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - DocumentID strfmt.UUID `json:"documentId"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - HasWeightTickets *bool `json:"hasWeightTickets"` - - // The ID of the pro-gear weight ticket. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // The ID of the PPM shipment that this pro-gear weight ticket is associated with. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - SubmittedBelongsToSelf *bool `json:"submittedBelongsToSelf"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - SubmittedHasWeightTickets *bool `json:"submittedHasWeightTickets"` - - // Customer submitted weight of the pro-gear. - // Minimum: 0 - SubmittedWeight *int64 `json:"submittedWeight"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // Weight of the pro-gear. - // Minimum: 0 - Weight *int64 `json:"weight"` -} - -// Validate validates this pro gear weight ticket -func (m *ProGearWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProGearWeightTicket) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateDocument(formats strfmt.Registry) error { - - if err := validate.Required("document", "body", m.Document); err != nil { - return err - } - - if m.Document != nil { - if err := m.Document.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) 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 *ProGearWeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateSubmittedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedWeight", "body", *m.SubmittedWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this pro gear weight ticket based on the context it is used -func (m *ProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProGearWeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.Document != nil { - - if err := m.Document.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProGearWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProGearWeightTicket) UnmarshalBinary(b []byte) error { - var res ProGearWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/pro_gear_weight_tickets.go b/pkg/gen/ghcmessages/pro_gear_weight_tickets.go deleted file mode 100644 index 4e8f9876f27..00000000000 --- a/pkg/gen/ghcmessages/pro_gear_weight_tickets.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProGearWeightTickets All progear weight tickets associated with a PPM shipment. -// -// swagger:model ProGearWeightTickets -type ProGearWeightTickets []*ProGearWeightTicket - -// Validate validates this pro gear weight tickets -func (m ProGearWeightTickets) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this pro gear weight tickets based on the context it is used -func (m ProGearWeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/proof_of_service_doc.go b/pkg/gen/ghcmessages/proof_of_service_doc.go deleted file mode 100644 index 3a549c8868a..00000000000 --- a/pkg/gen/ghcmessages/proof_of_service_doc.go +++ /dev/null @@ -1,124 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDoc proof of service doc -// -// swagger:model ProofOfServiceDoc -type ProofOfServiceDoc struct { - - // is weight ticket - IsWeightTicket bool `json:"isWeightTicket,omitempty"` - - // uploads - Uploads []*Upload `json:"uploads"` -} - -// Validate validates this proof of service doc -func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service doc based on the context it is used -func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { - var res ProofOfServiceDoc - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/proof_of_service_docs.go b/pkg/gen/ghcmessages/proof_of_service_docs.go deleted file mode 100644 index 464781e3510..00000000000 --- a/pkg/gen/ghcmessages/proof_of_service_docs.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDocs proof of service docs -// -// swagger:model ProofOfServiceDocs -type ProofOfServiceDocs []*ProofOfServiceDoc - -// Validate validates this proof of service docs -func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this proof of service docs based on the context it is used -func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/queue_move.go b/pkg/gen/ghcmessages/queue_move.go deleted file mode 100644 index cf370535fb8..00000000000 --- a/pkg/gen/ghcmessages/queue_move.go +++ /dev/null @@ -1,774 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// QueueMove queue move -// -// swagger:model QueueMove -type QueueMove struct { - - // appeared in too at - // Format: date-time - AppearedInTooAt *strfmt.DateTime `json:"appearedInTooAt,omitempty"` - - // assignable - Assignable bool `json:"assignable,omitempty"` - - // assigned to - AssignedTo *AssignedOfficeUser `json:"assignedTo,omitempty"` - - // available office users - AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` - - // closeout initiated - // Format: date-time - CloseoutInitiated *strfmt.DateTime `json:"closeoutInitiated,omitempty"` - - // closeout location - CloseoutLocation *string `json:"closeoutLocation,omitempty"` - - // counseling office - CounselingOffice *string `json:"counselingOffice,omitempty"` - - // counseling office ID - // Format: uuid - CounselingOfficeID *strfmt.UUID `json:"counselingOfficeID,omitempty"` - - // customer - Customer *Customer `json:"customer,omitempty"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // locator - Locator string `json:"locator,omitempty"` - - // lock expires at - // Format: date-time - LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` - - // locked by office user - LockedByOfficeUser *LockedOfficeUser `json:"lockedByOfficeUser,omitempty"` - - // locked by office user ID - // Format: uuid - LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` - - // order type - OrderType *string `json:"orderType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin g b l o c - OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` - - // ppm status - PpmStatus PPMStatus `json:"ppmStatus,omitempty"` - - // ppm type - // Enum: [FULL PARTIAL] - PpmType *string `json:"ppmType,omitempty"` - - // requested move date - // Format: date - RequestedMoveDate *strfmt.Date `json:"requestedMoveDate,omitempty"` - - // shipments count - ShipmentsCount int64 `json:"shipmentsCount,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` -} - -// Validate validates this queue move -func (m *QueueMove) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAppearedInTooAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAssignedTo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableOfficeUsers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloseoutInitiated(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCounselingOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueueMove) validateAppearedInTooAt(formats strfmt.Registry) error { - if swag.IsZero(m.AppearedInTooAt) { // not required - return nil - } - - if err := validate.FormatOf("appearedInTooAt", "body", "date-time", m.AppearedInTooAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateAssignedTo(formats strfmt.Registry) error { - if swag.IsZero(m.AssignedTo) { // not required - return nil - } - - if m.AssignedTo != nil { - if err := m.AssignedTo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("assignedTo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("assignedTo") - } - return err - } - } - - return nil -} - -func (m *QueueMove) validateAvailableOfficeUsers(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableOfficeUsers) { // not required - return nil - } - - if err := m.AvailableOfficeUsers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *QueueMove) validateCloseoutInitiated(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutInitiated) { // not required - return nil - } - - if err := validate.FormatOf("closeoutInitiated", "body", "date-time", m.CloseoutInitiated.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateCounselingOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.CounselingOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("counselingOfficeID", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *QueueMove) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *QueueMove) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueueMove) 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 *QueueMove) validateLockExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.LockExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateLockedByOfficeUser(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUser) { // not required - return nil - } - - if m.LockedByOfficeUser != nil { - if err := m.LockedByOfficeUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lockedByOfficeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("lockedByOfficeUser") - } - return err - } - } - - return nil -} - -func (m *QueueMove) validateLockedByOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueueMove) validateOriginGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *QueueMove) validatePpmStatus(formats strfmt.Registry) error { - if swag.IsZero(m.PpmStatus) { // not required - return nil - } - - if err := m.PpmStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmStatus") - } - return err - } - - return nil -} - -var queueMoveTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - queueMoveTypePpmTypePropEnum = append(queueMoveTypePpmTypePropEnum, v) - } -} - -const ( - - // QueueMovePpmTypeFULL captures enum value "FULL" - QueueMovePpmTypeFULL string = "FULL" - - // QueueMovePpmTypePARTIAL captures enum value "PARTIAL" - QueueMovePpmTypePARTIAL string = "PARTIAL" -) - -// prop value enum -func (m *QueueMove) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, queueMoveTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *QueueMove) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", *m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) validateRequestedMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedMoveDate", "body", "date", m.RequestedMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueueMove) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *QueueMove) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this queue move based on the context it is used -func (m *QueueMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAssignedTo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateLockedByOfficeUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueueMove) contextValidateAssignedTo(ctx context.Context, formats strfmt.Registry) error { - - if m.AssignedTo != nil { - - if swag.IsZero(m.AssignedTo) { // not required - return nil - } - - if err := m.AssignedTo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("assignedTo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("assignedTo") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *QueueMove) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateLockedByOfficeUser(ctx context.Context, formats strfmt.Registry) error { - - if m.LockedByOfficeUser != nil { - - if swag.IsZero(m.LockedByOfficeUser) { // not required - return nil - } - - if err := m.LockedByOfficeUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("lockedByOfficeUser") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("lockedByOfficeUser") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueueMove) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *QueueMove) contextValidatePpmStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.PpmStatus) { // not required - return nil - } - - if err := m.PpmStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmStatus") - } - return err - } - - return nil -} - -func (m *QueueMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *QueueMove) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *QueueMove) UnmarshalBinary(b []byte) error { - var res QueueMove - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/queue_moves.go b/pkg/gen/ghcmessages/queue_moves.go deleted file mode 100644 index 1edf791be07..00000000000 --- a/pkg/gen/ghcmessages/queue_moves.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// QueueMoves queue moves -// -// swagger:model QueueMoves -type QueueMoves []*QueueMove - -// Validate validates this queue moves -func (m QueueMoves) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this queue moves based on the context it is used -func (m QueueMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/queue_moves_result.go b/pkg/gen/ghcmessages/queue_moves_result.go deleted file mode 100644 index a0117f55989..00000000000 --- a/pkg/gen/ghcmessages/queue_moves_result.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// QueueMovesResult queue moves result -// -// swagger:model QueueMovesResult -type QueueMovesResult struct { - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // queue moves - QueueMoves QueueMoves `json:"queueMoves,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this queue moves result -func (m *QueueMovesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateQueueMoves(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueueMovesResult) validateQueueMoves(formats strfmt.Registry) error { - if swag.IsZero(m.QueueMoves) { // not required - return nil - } - - if err := m.QueueMoves.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queueMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queueMoves") - } - return err - } - - return nil -} - -// ContextValidate validate this queue moves result based on the context it is used -func (m *QueueMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateQueueMoves(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueueMovesResult) contextValidateQueueMoves(ctx context.Context, formats strfmt.Registry) error { - - if err := m.QueueMoves.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queueMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queueMoves") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *QueueMovesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *QueueMovesResult) UnmarshalBinary(b []byte) error { - var res QueueMovesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/queue_payment_request.go b/pkg/gen/ghcmessages/queue_payment_request.go deleted file mode 100644 index 28a4edbb0f7..00000000000 --- a/pkg/gen/ghcmessages/queue_payment_request.go +++ /dev/null @@ -1,512 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// QueuePaymentRequest queue payment request -// -// swagger:model QueuePaymentRequest -type QueuePaymentRequest struct { - - // Days since the payment request has been requested. Decimal representation will allow more accurate sorting. - Age float64 `json:"age,omitempty"` - - // assignable - Assignable bool `json:"assignable,omitempty"` - - // assigned to - AssignedTo *AssignedOfficeUser `json:"assignedTo,omitempty"` - - // available office users - AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` - - // counseling office - CounselingOffice *string `json:"counselingOffice,omitempty"` - - // customer - Customer *Customer `json:"customer,omitempty"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // locator - Locator string `json:"locator,omitempty"` - - // lock expires at - // Format: date-time - LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` - - // locked by office user ID - // Format: uuid - LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` - - // move ID - // Format: uuid - MoveID strfmt.UUID `json:"moveID,omitempty"` - - // order type - OrderType *string `json:"orderType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin g b l o c - OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` - - // status - Status QueuePaymentRequestStatus `json:"status,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt strfmt.DateTime `json:"submittedAt,omitempty"` -} - -// Validate validates this queue payment request -func (m *QueuePaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAssignedTo(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableOfficeUsers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueuePaymentRequest) validateAssignedTo(formats strfmt.Registry) error { - if swag.IsZero(m.AssignedTo) { // not required - return nil - } - - if m.AssignedTo != nil { - if err := m.AssignedTo.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("assignedTo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("assignedTo") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) validateAvailableOfficeUsers(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableOfficeUsers) { // not required - return nil - } - - if err := m.AvailableOfficeUsers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *QueuePaymentRequest) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) 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 *QueuePaymentRequest) validateLockExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.LockExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueuePaymentRequest) validateLockedByOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueuePaymentRequest) validateMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveID) { // not required - return nil - } - - if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *QueuePaymentRequest) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) validateOriginGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *QueuePaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *QueuePaymentRequest) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this queue payment request based on the context it is used -func (m *QueuePaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAssignedTo(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueuePaymentRequest) contextValidateAssignedTo(ctx context.Context, formats strfmt.Registry) error { - - if m.AssignedTo != nil { - - if swag.IsZero(m.AssignedTo) { // not required - return nil - } - - if err := m.AssignedTo.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("assignedTo") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("assignedTo") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *QueuePaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *QueuePaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *QueuePaymentRequest) UnmarshalBinary(b []byte) error { - var res QueuePaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/queue_payment_request_status.go b/pkg/gen/ghcmessages/queue_payment_request_status.go deleted file mode 100644 index b83982b696d..00000000000 --- a/pkg/gen/ghcmessages/queue_payment_request_status.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// QueuePaymentRequestStatus Queue Payment Request Status -// -// swagger:model QueuePaymentRequestStatus -type QueuePaymentRequestStatus string - -func NewQueuePaymentRequestStatus(value QueuePaymentRequestStatus) *QueuePaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated QueuePaymentRequestStatus. -func (m QueuePaymentRequestStatus) Pointer() *QueuePaymentRequestStatus { - return &m -} - -const ( - - // QueuePaymentRequestStatusPaymentRequested captures enum value "Payment requested" - QueuePaymentRequestStatusPaymentRequested QueuePaymentRequestStatus = "Payment requested" - - // QueuePaymentRequestStatusReviewed captures enum value "Reviewed" - QueuePaymentRequestStatusReviewed QueuePaymentRequestStatus = "Reviewed" - - // QueuePaymentRequestStatusRejected captures enum value "Rejected" - QueuePaymentRequestStatusRejected QueuePaymentRequestStatus = "Rejected" - - // QueuePaymentRequestStatusPaid captures enum value "Paid" - QueuePaymentRequestStatusPaid QueuePaymentRequestStatus = "Paid" -) - -// for schema -var queuePaymentRequestStatusEnum []interface{} - -func init() { - var res []QueuePaymentRequestStatus - if err := json.Unmarshal([]byte(`["Payment requested","Reviewed","Rejected","Paid"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - queuePaymentRequestStatusEnum = append(queuePaymentRequestStatusEnum, v) - } -} - -func (m QueuePaymentRequestStatus) validateQueuePaymentRequestStatusEnum(path, location string, value QueuePaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, queuePaymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this queue payment request status -func (m QueuePaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateQueuePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this queue payment request status based on context it is used -func (m QueuePaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/queue_payment_requests.go b/pkg/gen/ghcmessages/queue_payment_requests.go deleted file mode 100644 index 1e1e9172a1e..00000000000 --- a/pkg/gen/ghcmessages/queue_payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// QueuePaymentRequests queue payment requests -// -// swagger:model QueuePaymentRequests -type QueuePaymentRequests []*QueuePaymentRequest - -// Validate validates this queue payment requests -func (m QueuePaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this queue payment requests based on the context it is used -func (m QueuePaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/queue_payment_requests_result.go b/pkg/gen/ghcmessages/queue_payment_requests_result.go deleted file mode 100644 index be3af16ade8..00000000000 --- a/pkg/gen/ghcmessages/queue_payment_requests_result.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// QueuePaymentRequestsResult queue payment requests result -// -// swagger:model QueuePaymentRequestsResult -type QueuePaymentRequestsResult struct { - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // queue payment requests - QueuePaymentRequests QueuePaymentRequests `json:"queuePaymentRequests,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this queue payment requests result -func (m *QueuePaymentRequestsResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateQueuePaymentRequests(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueuePaymentRequestsResult) validateQueuePaymentRequests(formats strfmt.Registry) error { - if swag.IsZero(m.QueuePaymentRequests) { // not required - return nil - } - - if err := m.QueuePaymentRequests.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queuePaymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queuePaymentRequests") - } - return err - } - - return nil -} - -// ContextValidate validate this queue payment requests result based on the context it is used -func (m *QueuePaymentRequestsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateQueuePaymentRequests(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *QueuePaymentRequestsResult) contextValidateQueuePaymentRequests(ctx context.Context, formats strfmt.Registry) error { - - if err := m.QueuePaymentRequests.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("queuePaymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("queuePaymentRequests") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *QueuePaymentRequestsResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *QueuePaymentRequestsResult) UnmarshalBinary(b []byte) error { - var res QueuePaymentRequestsResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/re_service_item.go b/pkg/gen/ghcmessages/re_service_item.go deleted file mode 100644 index f90165b8924..00000000000 --- a/pkg/gen/ghcmessages/re_service_item.go +++ /dev/null @@ -1,378 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReServiceItem A Service Item which ties an ReService, Market, and Shipment Type together -// -// swagger:model ReServiceItem -type ReServiceItem struct { - - // is auto approved - // Example: true - IsAutoApproved bool `json:"isAutoApproved,omitempty"` - - // market code - // Example: i (International), d (Domestic) - // Enum: [i d] - MarketCode string `json:"marketCode,omitempty"` - - // service code - // Example: UBP - // Enum: [CS DBHF DBTF DCRT DCRTSA DDASIT DDDSIT DDFSIT DDP DDSFSC DDSHUT DLH DMHF DNPK DOASIT DOFSIT DOP DOPSIT DOSFSC DOSHUT DPK DSH DUCRT DUPK FSC IBHF IBTF ICRT ICRTSA IDASIT IDDSIT IDFSIT IDSFSC IDSHUT IHPK IHUPK INPK IOASIT IOFSIT IOPSIT IOSFSC IOSHUT ISLH IUBPK IUBUPK IUCRT MS PODFSC POEFSC UBP] - ServiceCode string `json:"serviceCode,omitempty"` - - // service name - // Example: International UB, International Shipping \u0026 Linehaul - ServiceName string `json:"serviceName,omitempty"` - - // shipment type - // Example: HHG, UNACCOMPANIED_BAGGAGE - // Enum: [BOAT_HAUL_AWAY BOAT_TOW_AWAY HHG HHG_INTO_NTS HHG_OUTOF_NTS_DOMESTIC MOBILE_HOME PPM UNACCOMPANIED_BAGGAGE] - ShipmentType string `json:"shipmentType,omitempty"` -} - -// Validate validates this re service item -func (m *ReServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var reServiceItemTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["i","d"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceItemTypeMarketCodePropEnum = append(reServiceItemTypeMarketCodePropEnum, v) - } -} - -const ( - - // ReServiceItemMarketCodeI captures enum value "i" - ReServiceItemMarketCodeI string = "i" - - // ReServiceItemMarketCodeD captures enum value "d" - ReServiceItemMarketCodeD string = "d" -) - -// prop value enum -func (m *ReServiceItem) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, reServiceItemTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ReServiceItem) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -var reServiceItemTypeServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DCRTSA","DDASIT","DDDSIT","DDFSIT","DDP","DDSFSC","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSFSC","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICRT","ICRTSA","IDASIT","IDDSIT","IDFSIT","IDSFSC","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOFSIT","IOPSIT","IOSFSC","IOSHUT","ISLH","IUBPK","IUBUPK","IUCRT","MS","PODFSC","POEFSC","UBP"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceItemTypeServiceCodePropEnum = append(reServiceItemTypeServiceCodePropEnum, v) - } -} - -const ( - - // ReServiceItemServiceCodeCS captures enum value "CS" - ReServiceItemServiceCodeCS string = "CS" - - // ReServiceItemServiceCodeDBHF captures enum value "DBHF" - ReServiceItemServiceCodeDBHF string = "DBHF" - - // ReServiceItemServiceCodeDBTF captures enum value "DBTF" - ReServiceItemServiceCodeDBTF string = "DBTF" - - // ReServiceItemServiceCodeDCRT captures enum value "DCRT" - ReServiceItemServiceCodeDCRT string = "DCRT" - - // ReServiceItemServiceCodeDCRTSA captures enum value "DCRTSA" - ReServiceItemServiceCodeDCRTSA string = "DCRTSA" - - // ReServiceItemServiceCodeDDASIT captures enum value "DDASIT" - ReServiceItemServiceCodeDDASIT string = "DDASIT" - - // ReServiceItemServiceCodeDDDSIT captures enum value "DDDSIT" - ReServiceItemServiceCodeDDDSIT string = "DDDSIT" - - // ReServiceItemServiceCodeDDFSIT captures enum value "DDFSIT" - ReServiceItemServiceCodeDDFSIT string = "DDFSIT" - - // ReServiceItemServiceCodeDDP captures enum value "DDP" - ReServiceItemServiceCodeDDP string = "DDP" - - // ReServiceItemServiceCodeDDSFSC captures enum value "DDSFSC" - ReServiceItemServiceCodeDDSFSC string = "DDSFSC" - - // ReServiceItemServiceCodeDDSHUT captures enum value "DDSHUT" - ReServiceItemServiceCodeDDSHUT string = "DDSHUT" - - // ReServiceItemServiceCodeDLH captures enum value "DLH" - ReServiceItemServiceCodeDLH string = "DLH" - - // ReServiceItemServiceCodeDMHF captures enum value "DMHF" - ReServiceItemServiceCodeDMHF string = "DMHF" - - // ReServiceItemServiceCodeDNPK captures enum value "DNPK" - ReServiceItemServiceCodeDNPK string = "DNPK" - - // ReServiceItemServiceCodeDOASIT captures enum value "DOASIT" - ReServiceItemServiceCodeDOASIT string = "DOASIT" - - // ReServiceItemServiceCodeDOFSIT captures enum value "DOFSIT" - ReServiceItemServiceCodeDOFSIT string = "DOFSIT" - - // ReServiceItemServiceCodeDOP captures enum value "DOP" - ReServiceItemServiceCodeDOP string = "DOP" - - // ReServiceItemServiceCodeDOPSIT captures enum value "DOPSIT" - ReServiceItemServiceCodeDOPSIT string = "DOPSIT" - - // ReServiceItemServiceCodeDOSFSC captures enum value "DOSFSC" - ReServiceItemServiceCodeDOSFSC string = "DOSFSC" - - // ReServiceItemServiceCodeDOSHUT captures enum value "DOSHUT" - ReServiceItemServiceCodeDOSHUT string = "DOSHUT" - - // ReServiceItemServiceCodeDPK captures enum value "DPK" - ReServiceItemServiceCodeDPK string = "DPK" - - // ReServiceItemServiceCodeDSH captures enum value "DSH" - ReServiceItemServiceCodeDSH string = "DSH" - - // ReServiceItemServiceCodeDUCRT captures enum value "DUCRT" - ReServiceItemServiceCodeDUCRT string = "DUCRT" - - // ReServiceItemServiceCodeDUPK captures enum value "DUPK" - ReServiceItemServiceCodeDUPK string = "DUPK" - - // ReServiceItemServiceCodeFSC captures enum value "FSC" - ReServiceItemServiceCodeFSC string = "FSC" - - // ReServiceItemServiceCodeIBHF captures enum value "IBHF" - ReServiceItemServiceCodeIBHF string = "IBHF" - - // ReServiceItemServiceCodeIBTF captures enum value "IBTF" - ReServiceItemServiceCodeIBTF string = "IBTF" - - // ReServiceItemServiceCodeICRT captures enum value "ICRT" - ReServiceItemServiceCodeICRT string = "ICRT" - - // ReServiceItemServiceCodeICRTSA captures enum value "ICRTSA" - ReServiceItemServiceCodeICRTSA string = "ICRTSA" - - // ReServiceItemServiceCodeIDASIT captures enum value "IDASIT" - ReServiceItemServiceCodeIDASIT string = "IDASIT" - - // ReServiceItemServiceCodeIDDSIT captures enum value "IDDSIT" - ReServiceItemServiceCodeIDDSIT string = "IDDSIT" - - // ReServiceItemServiceCodeIDFSIT captures enum value "IDFSIT" - ReServiceItemServiceCodeIDFSIT string = "IDFSIT" - - // ReServiceItemServiceCodeIDSFSC captures enum value "IDSFSC" - ReServiceItemServiceCodeIDSFSC string = "IDSFSC" - - // ReServiceItemServiceCodeIDSHUT captures enum value "IDSHUT" - ReServiceItemServiceCodeIDSHUT string = "IDSHUT" - - // ReServiceItemServiceCodeIHPK captures enum value "IHPK" - ReServiceItemServiceCodeIHPK string = "IHPK" - - // ReServiceItemServiceCodeIHUPK captures enum value "IHUPK" - ReServiceItemServiceCodeIHUPK string = "IHUPK" - - // ReServiceItemServiceCodeINPK captures enum value "INPK" - ReServiceItemServiceCodeINPK string = "INPK" - - // ReServiceItemServiceCodeIOASIT captures enum value "IOASIT" - ReServiceItemServiceCodeIOASIT string = "IOASIT" - - // ReServiceItemServiceCodeIOFSIT captures enum value "IOFSIT" - ReServiceItemServiceCodeIOFSIT string = "IOFSIT" - - // ReServiceItemServiceCodeIOPSIT captures enum value "IOPSIT" - ReServiceItemServiceCodeIOPSIT string = "IOPSIT" - - // ReServiceItemServiceCodeIOSFSC captures enum value "IOSFSC" - ReServiceItemServiceCodeIOSFSC string = "IOSFSC" - - // ReServiceItemServiceCodeIOSHUT captures enum value "IOSHUT" - ReServiceItemServiceCodeIOSHUT string = "IOSHUT" - - // ReServiceItemServiceCodeISLH captures enum value "ISLH" - ReServiceItemServiceCodeISLH string = "ISLH" - - // ReServiceItemServiceCodeIUBPK captures enum value "IUBPK" - ReServiceItemServiceCodeIUBPK string = "IUBPK" - - // ReServiceItemServiceCodeIUBUPK captures enum value "IUBUPK" - ReServiceItemServiceCodeIUBUPK string = "IUBUPK" - - // ReServiceItemServiceCodeIUCRT captures enum value "IUCRT" - ReServiceItemServiceCodeIUCRT string = "IUCRT" - - // ReServiceItemServiceCodeMS captures enum value "MS" - ReServiceItemServiceCodeMS string = "MS" - - // ReServiceItemServiceCodePODFSC captures enum value "PODFSC" - ReServiceItemServiceCodePODFSC string = "PODFSC" - - // ReServiceItemServiceCodePOEFSC captures enum value "POEFSC" - ReServiceItemServiceCodePOEFSC string = "POEFSC" - - // ReServiceItemServiceCodeUBP captures enum value "UBP" - ReServiceItemServiceCodeUBP string = "UBP" -) - -// prop value enum -func (m *ReServiceItem) validateServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, reServiceItemTypeServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ReServiceItem) validateServiceCode(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateServiceCodeEnum("serviceCode", "body", m.ServiceCode); err != nil { - return err - } - - return nil -} - -var reServiceItemTypeShipmentTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceItemTypeShipmentTypePropEnum = append(reServiceItemTypeShipmentTypePropEnum, v) - } -} - -const ( - - // ReServiceItemShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - ReServiceItemShipmentTypeBOATHAULAWAY string = "BOAT_HAUL_AWAY" - - // ReServiceItemShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - ReServiceItemShipmentTypeBOATTOWAWAY string = "BOAT_TOW_AWAY" - - // ReServiceItemShipmentTypeHHG captures enum value "HHG" - ReServiceItemShipmentTypeHHG string = "HHG" - - // ReServiceItemShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - ReServiceItemShipmentTypeHHGINTONTS string = "HHG_INTO_NTS" - - // ReServiceItemShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - ReServiceItemShipmentTypeHHGOUTOFNTSDOMESTIC string = "HHG_OUTOF_NTS_DOMESTIC" - - // ReServiceItemShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - ReServiceItemShipmentTypeMOBILEHOME string = "MOBILE_HOME" - - // ReServiceItemShipmentTypePPM captures enum value "PPM" - ReServiceItemShipmentTypePPM string = "PPM" - - // ReServiceItemShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - ReServiceItemShipmentTypeUNACCOMPANIEDBAGGAGE string = "UNACCOMPANIED_BAGGAGE" -) - -// prop value enum -func (m *ReServiceItem) validateShipmentTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, reServiceItemTypeShipmentTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ReServiceItem) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - // value enum - if err := m.validateShipmentTypeEnum("shipmentType", "body", m.ShipmentType); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this re service item based on context it is used -func (m *ReServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ReServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReServiceItem) UnmarshalBinary(b []byte) error { - var res ReServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/re_service_items.go b/pkg/gen/ghcmessages/re_service_items.go deleted file mode 100644 index b5c2f510811..00000000000 --- a/pkg/gen/ghcmessages/re_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ReServiceItems re service items -// -// swagger:model ReServiceItems -type ReServiceItems []*ReServiceItem - -// Validate validates this re service items -func (m ReServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this re service items based on the context it is used -func (m ReServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/reject_shipment.go b/pkg/gen/ghcmessages/reject_shipment.go deleted file mode 100644 index e50cd51114c..00000000000 --- a/pkg/gen/ghcmessages/reject_shipment.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RejectShipment reject shipment -// -// swagger:model RejectShipment -type RejectShipment struct { - - // rejection reason - // Example: MTO Shipment not good enough - // Required: true - RejectionReason *string `json:"rejectionReason"` -} - -// Validate validates this reject shipment -func (m *RejectShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRejectionReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RejectShipment) validateRejectionReason(formats strfmt.Registry) error { - - if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this reject shipment based on context it is used -func (m *RejectShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RejectShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RejectShipment) UnmarshalBinary(b []byte) error { - var res RejectShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/report_violation.go b/pkg/gen/ghcmessages/report_violation.go deleted file mode 100644 index b407165cba7..00000000000 --- a/pkg/gen/ghcmessages/report_violation.go +++ /dev/null @@ -1,215 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ReportViolation An object associating violations to evaluation reports -// -// swagger:model ReportViolation -type ReportViolation struct { - - // gsr appeals - GsrAppeals GSRAppeals `json:"gsrAppeals,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // report ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ReportID strfmt.UUID `json:"reportID,omitempty"` - - // violation - Violation *PWSViolation `json:"violation,omitempty"` - - // violation ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ViolationID strfmt.UUID `json:"violationID,omitempty"` -} - -// Validate validates this report violation -func (m *ReportViolation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateGsrAppeals(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViolation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateViolationID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ReportViolation) validateGsrAppeals(formats strfmt.Registry) error { - if swag.IsZero(m.GsrAppeals) { // not required - return nil - } - - if err := m.GsrAppeals.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gsrAppeals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gsrAppeals") - } - return err - } - - return nil -} - -func (m *ReportViolation) 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 *ReportViolation) validateReportID(formats strfmt.Registry) error { - if swag.IsZero(m.ReportID) { // not required - return nil - } - - if err := validate.FormatOf("reportID", "body", "uuid", m.ReportID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ReportViolation) validateViolation(formats strfmt.Registry) error { - if swag.IsZero(m.Violation) { // not required - return nil - } - - if m.Violation != nil { - if err := m.Violation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("violation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("violation") - } - return err - } - } - - return nil -} - -func (m *ReportViolation) validateViolationID(formats strfmt.Registry) error { - if swag.IsZero(m.ViolationID) { // not required - return nil - } - - if err := validate.FormatOf("violationID", "body", "uuid", m.ViolationID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this report violation based on the context it is used -func (m *ReportViolation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGsrAppeals(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateViolation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ReportViolation) contextValidateGsrAppeals(ctx context.Context, formats strfmt.Registry) error { - - if err := m.GsrAppeals.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("gsrAppeals") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("gsrAppeals") - } - return err - } - - return nil -} - -func (m *ReportViolation) contextValidateViolation(ctx context.Context, formats strfmt.Registry) error { - - if m.Violation != nil { - - if swag.IsZero(m.Violation) { // not required - return nil - } - - if err := m.Violation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("violation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("violation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ReportViolation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ReportViolation) UnmarshalBinary(b []byte) error { - var res ReportViolation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/report_violations.go b/pkg/gen/ghcmessages/report_violations.go deleted file mode 100644 index 77be647c8c9..00000000000 --- a/pkg/gen/ghcmessages/report_violations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ReportViolations report violations -// -// swagger:model ReportViolations -type ReportViolations []*ReportViolation - -// Validate validates this report violations -func (m ReportViolations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this report violations based on the context it is used -func (m ReportViolations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/request_diversion.go b/pkg/gen/ghcmessages/request_diversion.go deleted file mode 100644 index c5af02f8653..00000000000 --- a/pkg/gen/ghcmessages/request_diversion.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RequestDiversion request diversion -// -// swagger:model RequestDiversion -type RequestDiversion struct { - - // diversion reason - // Example: Shipment route needs to change - // Required: true - DiversionReason *string `json:"diversionReason"` -} - -// Validate validates this request diversion -func (m *RequestDiversion) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDiversionReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RequestDiversion) validateDiversionReason(formats strfmt.Registry) error { - - if err := validate.Required("diversionReason", "body", m.DiversionReason); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this request diversion based on context it is used -func (m *RequestDiversion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RequestDiversion) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RequestDiversion) UnmarshalBinary(b []byte) error { - var res RequestDiversion - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/reweigh.go b/pkg/gen/ghcmessages/reweigh.go deleted file mode 100644 index 940b4f303d3..00000000000 --- a/pkg/gen/ghcmessages/reweigh.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. -// -// swagger:model Reweigh -type Reweigh struct { - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // requested at - // Format: date-time - RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` - - // requested by - RequestedBy ReweighRequester `json:"requestedBy,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // verification provided at - // Format: date-time - VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` - - // verification reason - // Example: The reweigh was not performed due to some justification provided by the counselor - VerificationReason *string `json:"verificationReason"` - - // weight - // Example: 2000 - Weight *int64 `json:"weight"` -} - -// Validate validates this reweigh -func (m *Reweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationProvidedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { - if swag.IsZero(m.VerificationProvidedAt) { // not required - return nil - } - - if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this reweigh based on the context it is used -func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateRequestedBy(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reweigh) UnmarshalBinary(b []byte) error { - var res Reweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/reweigh_requester.go b/pkg/gen/ghcmessages/reweigh_requester.go deleted file mode 100644 index 94768abe78e..00000000000 --- a/pkg/gen/ghcmessages/reweigh_requester.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReweighRequester reweigh requester -// -// swagger:model ReweighRequester -type ReweighRequester string - -func NewReweighRequester(value ReweighRequester) *ReweighRequester { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReweighRequester. -func (m ReweighRequester) Pointer() *ReweighRequester { - return &m -} - -const ( - - // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" - ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" - - // ReweighRequesterPRIME captures enum value "PRIME" - ReweighRequesterPRIME ReweighRequester = "PRIME" - - // ReweighRequesterSYSTEM captures enum value "SYSTEM" - ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" - - // ReweighRequesterTOO captures enum value "TOO" - ReweighRequesterTOO ReweighRequester = "TOO" -) - -// for schema -var reweighRequesterEnum []interface{} - -func init() { - var res []ReweighRequester - if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reweighRequesterEnum = append(reweighRequesterEnum, v) - } -} - -func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { - if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reweigh requester -func (m ReweighRequester) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReweighRequesterEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reweigh requester based on context it is used -func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/role.go b/pkg/gen/ghcmessages/role.go deleted file mode 100644 index 91996e18d37..00000000000 --- a/pkg/gen/ghcmessages/role.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Role role -// -// swagger:model Role -type Role struct { - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // role name - // Example: Task Ordering Officer - // Required: true - RoleName *string `json:"roleName"` - - // role type - // Example: customer - // Required: true - RoleType *string `json:"roleType"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this role -func (m *Role) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Role) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateRoleName(formats strfmt.Registry) error { - - if err := validate.Required("roleName", "body", m.RoleName); err != nil { - return err - } - - return nil -} - -func (m *Role) validateRoleType(formats strfmt.Registry) error { - - if err := validate.Required("roleType", "body", m.RoleType); err != nil { - return err - } - - return nil -} - -func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this role based on the context it is used -func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Role) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Role) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Role) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Role) UnmarshalBinary(b []byte) error { - var res Role - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_extension.go b/pkg/gen/ghcmessages/s_i_t_extension.go deleted file mode 100644 index db55243e80a..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_extension.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. -// -// swagger:model SITExtension -type SITExtension struct { - - // approved days - // Example: 30 - ApprovedDays *int64 `json:"approvedDays"` - - // contractor remarks - // Example: We need SIT additional days. The customer has not found a house yet. - ContractorRemarks *string `json:"contractorRemarks"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // decision date - // Format: date-time - DecisionDate *strfmt.DateTime `json:"decisionDate"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // office remarks - OfficeRemarks *string `json:"officeRemarks"` - - // request reason - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason string `json:"requestReason,omitempty"` - - // requested days - // Example: 30 - RequestedDays int64 `json:"requestedDays,omitempty"` - - // status - // Enum: [PENDING APPROVED DENIED] - Status interface{} `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this s i t extension -func (m *SITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDecisionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { - if swag.IsZero(m.DecisionDate) { // not required - return nil - } - - if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -var sITExtensionTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) - } -} - -const ( - - // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // SITExtensionRequestReasonOTHER captures enum value "OTHER" - SITExtensionRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { - if swag.IsZero(m.RequestReason) { // not required - return nil - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t extension based on the context it is used -func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITExtension) UnmarshalBinary(b []byte) error { - var res SITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_extensions.go b/pkg/gen/ghcmessages/s_i_t_extensions.go deleted file mode 100644 index b9d5dd4a2b5..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_extensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITExtensions s i t extensions -// -// swagger:model SITExtensions -type SITExtensions []*SITExtension - -// Validate validates this s i t extensions -func (m SITExtensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t extensions based on the context it is used -func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_location_type.go b/pkg/gen/ghcmessages/s_i_t_location_type.go deleted file mode 100644 index 22d10341c44..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_location_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SITLocationType The list of SIT location types. -// -// swagger:model SITLocationType -type SITLocationType string - -func NewSITLocationType(value SITLocationType) *SITLocationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SITLocationType. -func (m SITLocationType) Pointer() *SITLocationType { - return &m -} - -const ( - - // SITLocationTypeORIGIN captures enum value "ORIGIN" - SITLocationTypeORIGIN SITLocationType = "ORIGIN" - - // SITLocationTypeDESTINATION captures enum value "DESTINATION" - SITLocationTypeDESTINATION SITLocationType = "DESTINATION" -) - -// for schema -var sITLocationTypeEnum []interface{} - -func init() { - var res []SITLocationType - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITLocationTypeEnum = append(sITLocationTypeEnum, v) - } -} - -func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { - if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this s i t location type -func (m SITLocationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this s i t location type based on context it is used -func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go b/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go deleted file mode 100644 index 5c1b38a9910..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITServiceItemGrouping s i t service item grouping -// -// swagger:model SITServiceItemGrouping -type SITServiceItemGrouping struct { - - // service items - ServiceItems MTOServiceItems `json:"serviceItems,omitempty"` - - // Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date. - // This is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items. - // - Summary *SITSummary `json:"summary,omitempty"` -} - -// Validate validates this s i t service item grouping -func (m *SITServiceItemGrouping) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSummary(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITServiceItemGrouping) validateServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceItems) { // not required - return nil - } - - if err := m.ServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceItems") - } - return err - } - - return nil -} - -func (m *SITServiceItemGrouping) validateSummary(formats strfmt.Registry) error { - if swag.IsZero(m.Summary) { // not required - return nil - } - - if m.Summary != nil { - if err := m.Summary.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("summary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("summary") - } - return err - } - } - - return nil -} - -// ContextValidate validate this s i t service item grouping based on the context it is used -func (m *SITServiceItemGrouping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSummary(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITServiceItemGrouping) contextValidateServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceItems") - } - return err - } - - return nil -} - -func (m *SITServiceItemGrouping) contextValidateSummary(ctx context.Context, formats strfmt.Registry) error { - - if m.Summary != nil { - - if swag.IsZero(m.Summary) { // not required - return nil - } - - if err := m.Summary.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("summary") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("summary") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITServiceItemGrouping) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITServiceItemGrouping) UnmarshalBinary(b []byte) error { - var res SITServiceItemGrouping - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go b/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go deleted file mode 100644 index 4a52622083e..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITServiceItemGroupings Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date. -// -// swagger:model SITServiceItemGroupings -type SITServiceItemGroupings []*SITServiceItemGrouping - -// Validate validates this s i t service item groupings -func (m SITServiceItemGroupings) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t service item groupings based on the context it is used -func (m SITServiceItemGroupings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_status.go b/pkg/gen/ghcmessages/s_i_t_status.go deleted file mode 100644 index 00a405f8670..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_status.go +++ /dev/null @@ -1,397 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITStatus s i t status -// -// swagger:model SITStatus -type SITStatus struct { - - // calculated total days in s i t - // Minimum: 0 - CalculatedTotalDaysInSIT *int64 `json:"calculatedTotalDaysInSIT,omitempty"` - - // current s i t - CurrentSIT *SITStatusCurrentSIT `json:"currentSIT,omitempty"` - - // A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes. - // - PastSITServiceItemGroupings SITServiceItemGroupings `json:"pastSITServiceItemGroupings,omitempty"` - - // total days remaining - // Minimum: 0 - TotalDaysRemaining *int64 `json:"totalDaysRemaining,omitempty"` - - // total s i t days used - // Minimum: 0 - TotalSITDaysUsed *int64 `json:"totalSITDaysUsed,omitempty"` -} - -// Validate validates this s i t status -func (m *SITStatus) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCalculatedTotalDaysInSIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentSIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePastSITServiceItemGroupings(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalDaysRemaining(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalSITDaysUsed(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITStatus) validateCalculatedTotalDaysInSIT(formats strfmt.Registry) error { - if swag.IsZero(m.CalculatedTotalDaysInSIT) { // not required - return nil - } - - if err := validate.MinimumInt("calculatedTotalDaysInSIT", "body", *m.CalculatedTotalDaysInSIT, 0, false); err != nil { - return err - } - - return nil -} - -func (m *SITStatus) validateCurrentSIT(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentSIT) { // not required - return nil - } - - if m.CurrentSIT != nil { - if err := m.CurrentSIT.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentSIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentSIT") - } - return err - } - } - - return nil -} - -func (m *SITStatus) validatePastSITServiceItemGroupings(formats strfmt.Registry) error { - if swag.IsZero(m.PastSITServiceItemGroupings) { // not required - return nil - } - - if err := m.PastSITServiceItemGroupings.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pastSITServiceItemGroupings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pastSITServiceItemGroupings") - } - return err - } - - return nil -} - -func (m *SITStatus) validateTotalDaysRemaining(formats strfmt.Registry) error { - if swag.IsZero(m.TotalDaysRemaining) { // not required - return nil - } - - if err := validate.MinimumInt("totalDaysRemaining", "body", *m.TotalDaysRemaining, 0, false); err != nil { - return err - } - - return nil -} - -func (m *SITStatus) validateTotalSITDaysUsed(formats strfmt.Registry) error { - if swag.IsZero(m.TotalSITDaysUsed) { // not required - return nil - } - - if err := validate.MinimumInt("totalSITDaysUsed", "body", *m.TotalSITDaysUsed, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t status based on the context it is used -func (m *SITStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCurrentSIT(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePastSITServiceItemGroupings(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITStatus) contextValidateCurrentSIT(ctx context.Context, formats strfmt.Registry) error { - - if m.CurrentSIT != nil { - - if swag.IsZero(m.CurrentSIT) { // not required - return nil - } - - if err := m.CurrentSIT.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentSIT") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentSIT") - } - return err - } - } - - return nil -} - -func (m *SITStatus) contextValidatePastSITServiceItemGroupings(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PastSITServiceItemGroupings.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pastSITServiceItemGroupings") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pastSITServiceItemGroupings") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITStatus) UnmarshalBinary(b []byte) error { - var res SITStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// SITStatusCurrentSIT s i t status current s i t -// -// swagger:model SITStatusCurrentSIT -type SITStatusCurrentSIT struct { - - // days in s i t - // Minimum: 0 - DaysInSIT *int64 `json:"daysInSIT,omitempty"` - - // location - // Enum: [ORIGIN DESTINATION] - Location interface{} `json:"location,omitempty"` - - // service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ServiceItemID strfmt.UUID `json:"serviceItemID,omitempty"` - - // sit authorized end date - // Format: date - SitAuthorizedEndDate *strfmt.Date `json:"sitAuthorizedEndDate,omitempty"` - - // sit customer contacted - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // sit departure date - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit entry date - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit requested delivery - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` -} - -// Validate validates this s i t status current s i t -func (m *SITStatusCurrentSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDaysInSIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitAuthorizedEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITStatusCurrentSIT) validateDaysInSIT(formats strfmt.Registry) error { - if swag.IsZero(m.DaysInSIT) { // not required - return nil - } - - if err := validate.MinimumInt("currentSIT"+"."+"daysInSIT", "body", *m.DaysInSIT, 0, false); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"serviceItemID", "body", "uuid", m.ServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateSitAuthorizedEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitAuthorizedEndDate) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"sitAuthorizedEndDate", "body", "date", m.SitAuthorizedEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateSitDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateSitEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITStatusCurrentSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("currentSIT"+"."+"sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s i t status current s i t based on context it is used -func (m *SITStatusCurrentSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SITStatusCurrentSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITStatusCurrentSIT) UnmarshalBinary(b []byte) error { - var res SITStatusCurrentSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/s_i_t_summary.go b/pkg/gen/ghcmessages/s_i_t_summary.go deleted file mode 100644 index 02e65e6428e..00000000000 --- a/pkg/gen/ghcmessages/s_i_t_summary.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITSummary s i t summary -// -// swagger:model SITSummary -type SITSummary struct { - - // days in s i t - // Minimum: 0 - DaysInSIT *int64 `json:"daysInSIT,omitempty"` - - // first day s i t service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - FirstDaySITServiceItemID strfmt.UUID `json:"firstDaySITServiceItemID,omitempty"` - - // location - // Enum: [ORIGIN DESTINATION] - Location interface{} `json:"location,omitempty"` - - // sit authorized end date - // Format: date-time - SitAuthorizedEndDate strfmt.DateTime `json:"sitAuthorizedEndDate,omitempty"` - - // sit customer contacted - // Format: date-time - SitCustomerContacted *strfmt.DateTime `json:"sitCustomerContacted,omitempty"` - - // sit departure date - // Format: date-time - SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` - - // sit entry date - // Format: date-time - SitEntryDate strfmt.DateTime `json:"sitEntryDate,omitempty"` - - // sit requested delivery - // Format: date-time - SitRequestedDelivery *strfmt.DateTime `json:"sitRequestedDelivery,omitempty"` -} - -// Validate validates this s i t summary -func (m *SITSummary) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDaysInSIT(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstDaySITServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitAuthorizedEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITSummary) validateDaysInSIT(formats strfmt.Registry) error { - if swag.IsZero(m.DaysInSIT) { // not required - return nil - } - - if err := validate.MinimumInt("daysInSIT", "body", *m.DaysInSIT, 0, false); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateFirstDaySITServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.FirstDaySITServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("firstDaySITServiceItemID", "body", "uuid", m.FirstDaySITServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateSitAuthorizedEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitAuthorizedEndDate) { // not required - return nil - } - - if err := validate.FormatOf("sitAuthorizedEndDate", "body", "date-time", m.SitAuthorizedEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateSitCustomerContacted(formats strfmt.Registry) error { - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date-time", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateSitDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateSitEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITSummary) validateSitRequestedDelivery(formats strfmt.Registry) error { - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date-time", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this s i t summary based on context it is used -func (m *SITSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SITSummary) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITSummary) UnmarshalBinary(b []byte) error { - var res SITSummary - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/search_customer.go b/pkg/gen/ghcmessages/search_customer.go deleted file mode 100644 index f35e52f734c..00000000000 --- a/pkg/gen/ghcmessages/search_customer.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SearchCustomer search customer -// -// swagger:model SearchCustomer -type SearchCustomer struct { - - // branch - Branch string `json:"branch,omitempty"` - - // edipi - Edipi *string `json:"edipi,omitempty"` - - // emplid - Emplid *string `json:"emplid,omitempty"` - - // first name - // Example: John - FirstName *string `json:"firstName,omitempty"` - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Doe - LastName *string `json:"lastName,omitempty"` - - // personal email - // Example: personalEmail@email.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail *string `json:"personalEmail,omitempty"` - - // telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` -} - -// Validate validates this search customer -func (m *SearchCustomer) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchCustomer) 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 *SearchCustomer) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personalEmail", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *SearchCustomer) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this search customer based on context it is used -func (m *SearchCustomer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SearchCustomer) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SearchCustomer) UnmarshalBinary(b []byte) error { - var res SearchCustomer - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/search_customers.go b/pkg/gen/ghcmessages/search_customers.go deleted file mode 100644 index 5b090aea851..00000000000 --- a/pkg/gen/ghcmessages/search_customers.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SearchCustomers search customers -// -// swagger:model SearchCustomers -type SearchCustomers []*SearchCustomer - -// Validate validates this search customers -func (m SearchCustomers) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this search customers based on the context it is used -func (m SearchCustomers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/search_customers_result.go b/pkg/gen/ghcmessages/search_customers_result.go deleted file mode 100644 index 5abcaf215ec..00000000000 --- a/pkg/gen/ghcmessages/search_customers_result.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SearchCustomersResult search customers result -// -// swagger:model SearchCustomersResult -type SearchCustomersResult struct { - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // search customers - SearchCustomers SearchCustomers `json:"searchCustomers,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this search customers result -func (m *SearchCustomersResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSearchCustomers(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchCustomersResult) validateSearchCustomers(formats strfmt.Registry) error { - if swag.IsZero(m.SearchCustomers) { // not required - return nil - } - - if err := m.SearchCustomers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchCustomers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchCustomers") - } - return err - } - - return nil -} - -// ContextValidate validate this search customers result based on the context it is used -func (m *SearchCustomersResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSearchCustomers(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchCustomersResult) contextValidateSearchCustomers(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SearchCustomers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchCustomers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchCustomers") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SearchCustomersResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SearchCustomersResult) UnmarshalBinary(b []byte) error { - var res SearchCustomersResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/search_move.go b/pkg/gen/ghcmessages/search_move.go deleted file mode 100644 index f0f91015deb..00000000000 --- a/pkg/gen/ghcmessages/search_move.go +++ /dev/null @@ -1,370 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SearchMove search move -// -// swagger:model SearchMove -type SearchMove struct { - - // branch - Branch string `json:"branch,omitempty"` - - // destination g b l o c - DestinationGBLOC GBLOC `json:"destinationGBLOC,omitempty"` - - // ZIP - // Example: 90210 - // Pattern: ^(\d{5})$ - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // edipi - // Example: 1234567890 - Edipi *string `json:"edipi,omitempty"` - - // emplid - Emplid *string `json:"emplid,omitempty"` - - // first name - // Example: John - FirstName *string `json:"firstName,omitempty"` - - // id - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - // Example: Doe - LastName *string `json:"lastName,omitempty"` - - // locator - Locator string `json:"locator,omitempty"` - - // lock expires at - // Format: date-time - LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` - - // locked by office user ID - // Format: uuid - LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` - - // order type - OrderType string `json:"orderType,omitempty"` - - // ZIP - // Example: 90210 - // Pattern: ^(\d{5})$ - OriginDutyLocationPostalCode string `json:"originDutyLocationPostalCode,omitempty"` - - // origin g b l o c - OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` - - // payment request code - // Example: 9551-6199-2 - PaymentRequestCode *string `json:"paymentRequestCode,omitempty"` - - // requested delivery date - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // shipments count - ShipmentsCount int64 `json:"shipmentsCount,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` -} - -// Validate validates this search move -func (m *SearchMove) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestinationGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockExpiresAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLockedByOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginGBLOC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(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 *SearchMove) validateDestinationGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationGBLOC) { // not required - return nil - } - - if err := m.DestinationGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationGBLOC") - } - return err - } - - return nil -} - -func (m *SearchMove) validateDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("destinationPostalCode", "body", m.DestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) 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 *SearchMove) validateLockExpiresAt(formats strfmt.Registry) error { - if swag.IsZero(m.LockExpiresAt) { // not required - return nil - } - - if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) validateLockedByOfficeUserID(formats strfmt.Registry) error { - if swag.IsZero(m.LockedByOfficeUserID) { // not required - return nil - } - - if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) validateOriginDutyLocationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("originDutyLocationPostalCode", "body", m.OriginDutyLocationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) validateOriginGBLOC(formats strfmt.Registry) error { - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *SearchMove) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SearchMove) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this search move based on the context it is used -func (m *SearchMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchMove) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.DestinationGBLOC) { // not required - return nil - } - - if err := m.DestinationGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationGBLOC") - } - return err - } - - return nil -} - -func (m *SearchMove) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OriginGBLOC) { // not required - return nil - } - - if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originGBLOC") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originGBLOC") - } - return err - } - - return nil -} - -func (m *SearchMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SearchMove) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SearchMove) UnmarshalBinary(b []byte) error { - var res SearchMove - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/search_moves.go b/pkg/gen/ghcmessages/search_moves.go deleted file mode 100644 index 0b85d95454d..00000000000 --- a/pkg/gen/ghcmessages/search_moves.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SearchMoves search moves -// -// swagger:model SearchMoves -type SearchMoves []*SearchMove - -// Validate validates this search moves -func (m SearchMoves) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this search moves based on the context it is used -func (m SearchMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/search_moves_result.go b/pkg/gen/ghcmessages/search_moves_result.go deleted file mode 100644 index 18d050fdbe3..00000000000 --- a/pkg/gen/ghcmessages/search_moves_result.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SearchMovesResult search moves result -// -// swagger:model SearchMovesResult -type SearchMovesResult struct { - - // page - Page int64 `json:"page,omitempty"` - - // per page - PerPage int64 `json:"perPage,omitempty"` - - // search moves - SearchMoves SearchMoves `json:"searchMoves,omitempty"` - - // total count - TotalCount int64 `json:"totalCount,omitempty"` -} - -// Validate validates this search moves result -func (m *SearchMovesResult) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateSearchMoves(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchMovesResult) validateSearchMoves(formats strfmt.Registry) error { - if swag.IsZero(m.SearchMoves) { // not required - return nil - } - - if err := m.SearchMoves.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchMoves") - } - return err - } - - return nil -} - -// ContextValidate validate this search moves result based on the context it is used -func (m *SearchMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSearchMoves(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SearchMovesResult) contextValidateSearchMoves(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SearchMoves.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("searchMoves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("searchMoves") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SearchMovesResult) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SearchMovesResult) UnmarshalBinary(b []byte) error { - var res SearchMovesResult - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/service_item_param_name.go b/pkg/gen/ghcmessages/service_item_param_name.go deleted file mode 100644 index eff0f3d2734..00000000000 --- a/pkg/gen/ghcmessages/service_item_param_name.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamName service item param name -// -// swagger:model ServiceItemParamName -type ServiceItemParamName string - -func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. -func (m ServiceItemParamName) Pointer() *ServiceItemParamName { - return &m -} - -const ( - - // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" - ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" - - // ServiceItemParamNameContractCode captures enum value "ContractCode" - ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" - - // ServiceItemParamNameContractYearName captures enum value "ContractYearName" - ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" - - // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" - ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" - - // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" - ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" - - // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" - ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" - - // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" - ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" - - // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" - ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" - - // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" - ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" - - // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" - ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" - - // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" - ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" - - // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" - ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" - - // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" - ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" - - // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" - ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" - - // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" - ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" - - // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" - ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" - - // ServiceItemParamNameIsPeak captures enum value "IsPeak" - ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" - - // ServiceItemParamNameMarketDest captures enum value "MarketDest" - ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" - - // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" - ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" - - // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" - ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" - - // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" - ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" - - // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" - ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" - - // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" - ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" - - // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" - ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" - - // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" - ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" - - // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" - ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" - - // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" - ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" - - // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" - ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" - - // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" - ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" - - // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" - ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" - - // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" - ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" - - // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" - ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" - - // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" - ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" - - // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" - ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" - - // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" - ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" - ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" - - // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" - ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" - - // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" - ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" - - // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" - - // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" - ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" - - // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" - ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" - - // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" - ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" - - // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" - ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" - - // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" - ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" - - // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" - ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" - - // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" - ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" - - // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" - ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" - - // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" - ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" - - // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" - ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" - - // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" - ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" - - // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" - ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" - - // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" - ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" - - // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" - ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" - - // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" - ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" - - // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" - ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" - - // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" - ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" - - // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" - ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" - - // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" - ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" - - // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" - ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" - - // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" - ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" - - // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" - ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" - - // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" - ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" - - // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" - ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" - - // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" - ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" - - // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" - ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" - - // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" - ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" - - // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" - ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" - - // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" - ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" -) - -// for schema -var serviceItemParamNameEnum []interface{} - -func init() { - var res []ServiceItemParamName - if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) - } -} - -func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { - if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param name -func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param name based on context it is used -func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/service_item_param_origin.go b/pkg/gen/ghcmessages/service_item_param_origin.go deleted file mode 100644 index b84eef2b788..00000000000 --- a/pkg/gen/ghcmessages/service_item_param_origin.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamOrigin service item param origin -// -// swagger:model ServiceItemParamOrigin -type ServiceItemParamOrigin string - -func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. -func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { - return &m -} - -const ( - - // ServiceItemParamOriginPRIME captures enum value "PRIME" - ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" - - // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" - ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" - - // ServiceItemParamOriginPRICER captures enum value "PRICER" - ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" - - // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" - ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" -) - -// for schema -var serviceItemParamOriginEnum []interface{} - -func init() { - var res []ServiceItemParamOrigin - if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) - } -} - -func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { - if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param origin -func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param origin based on context it is used -func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/service_item_param_type.go b/pkg/gen/ghcmessages/service_item_param_type.go deleted file mode 100644 index dcd963f29ad..00000000000 --- a/pkg/gen/ghcmessages/service_item_param_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamType service item param type -// -// swagger:model ServiceItemParamType -type ServiceItemParamType string - -func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. -func (m ServiceItemParamType) Pointer() *ServiceItemParamType { - return &m -} - -const ( - - // ServiceItemParamTypeSTRING captures enum value "STRING" - ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" - - // ServiceItemParamTypeDATE captures enum value "DATE" - ServiceItemParamTypeDATE ServiceItemParamType = "DATE" - - // ServiceItemParamTypeINTEGER captures enum value "INTEGER" - ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" - - // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" - ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" - - // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" - ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" - - // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" - ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" - - // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" - ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" -) - -// for schema -var serviceItemParamTypeEnum []interface{} - -func init() { - var res []ServiceItemParamType - if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) - } -} - -func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { - if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param type -func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param type based on context it is used -func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/service_item_sit_entry_date.go b/pkg/gen/ghcmessages/service_item_sit_entry_date.go deleted file mode 100644 index 3cc6ee77f05..00000000000 --- a/pkg/gen/ghcmessages/service_item_sit_entry_date.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceItemSitEntryDate service item sit entry date -// -// swagger:model ServiceItemSitEntryDate -type ServiceItemSitEntryDate struct { - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // sit entry date - // Format: date-time - SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` -} - -// Validate validates this service item sit entry date -func (m *ServiceItemSitEntryDate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceItemSitEntryDate) 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 *ServiceItemSitEntryDate) validateSitEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this service item sit entry date based on context it is used -func (m *ServiceItemSitEntryDate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceItemSitEntryDate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceItemSitEntryDate) UnmarshalBinary(b []byte) error { - var res ServiceItemSitEntryDate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/service_request_document.go b/pkg/gen/ghcmessages/service_request_document.go deleted file mode 100644 index a7a68cd5e0a..00000000000 --- a/pkg/gen/ghcmessages/service_request_document.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceRequestDocument service request document -// -// swagger:model ServiceRequestDocument -type ServiceRequestDocument struct { - - // mto service item ID - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // uploads - Uploads []*Upload `json:"uploads"` -} - -// Validate validates this service request document -func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service request document based on the context it is used -func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { - var res ServiceRequestDocument - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/service_request_documents.go b/pkg/gen/ghcmessages/service_request_documents.go deleted file mode 100644 index 53fb4bfd026..00000000000 --- a/pkg/gen/ghcmessages/service_request_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocuments documents uploaded by the Prime as proof of request for service items -// -// swagger:model ServiceRequestDocuments -type ServiceRequestDocuments []*ServiceRequestDocument - -// Validate validates this service request documents -func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service request documents based on the context it is used -func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/shipment_address_update.go b/pkg/gen/ghcmessages/shipment_address_update.go deleted file mode 100644 index d609419c05d..00000000000 --- a/pkg/gen/ghcmessages/shipment_address_update.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. -// -// swagger:model ShipmentAddressUpdate -type ShipmentAddressUpdate struct { - - // Contractor Remarks - // - // The reason there is an address change. - // Example: This is a contractor remark - // Required: true - // Read Only: true - ContractorRemarks string `json:"contractorRemarks"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` - - // The distance between the original SIT address and requested new delivery address of shipment - // Example: 88 - // Minimum: 0 - NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` - - // Office Remarks - // - // The TOO comment on approval or rejection. - // Example: This is an office remark - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // The distance between the original SIT address and the previous/old delivery address of shipment - // Example: 50 - // Minimum: 0 - OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` - - // original address - // Required: true - OriginalAddress *Address `json:"originalAddress"` - - // shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID"` - - // sit original address - SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` - - // status - // Required: true - Status ShipmentAddressUpdateStatus `json:"status"` -} - -// Validate validates this shipment address update -func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOldSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.NewSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.OldSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { - - if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { - return err - } - - if m.OriginalAddress != nil { - if err := m.OriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if m.SitOriginalAddress != nil { - if err := m.SitOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this shipment address update based on the context it is used -func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginalAddress != nil { - - if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginalAddress != nil { - - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { - var res ShipmentAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/shipment_address_update_status.go b/pkg/gen/ghcmessages/shipment_address_update_status.go deleted file mode 100644 index 70bec375800..00000000000 --- a/pkg/gen/ghcmessages/shipment_address_update_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdateStatus Status -// -// swagger:model ShipmentAddressUpdateStatus -type ShipmentAddressUpdateStatus string - -func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. -func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { - return &m -} - -const ( - - // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" - ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" - - // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" - ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" - - // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" - ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" -) - -// for schema -var shipmentAddressUpdateStatusEnum []interface{} - -func init() { - var res []ShipmentAddressUpdateStatus - if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) - } -} - -func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { - if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this shipment address update status -func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipment address update status based on the context it is used -func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go b/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go deleted file mode 100644 index c50869cd9ae..00000000000 --- a/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentPaymentSITBalance shipment payment s i t balance -// -// swagger:model ShipmentPaymentSITBalance -type ShipmentPaymentSITBalance struct { - - // pending billed end date - // Format: date - PendingBilledEndDate *strfmt.Date `json:"pendingBilledEndDate,omitempty"` - - // pending billed start date - // Format: date - PendingBilledStartDate *strfmt.Date `json:"pendingBilledStartDate,omitempty"` - - // pending s i t days invoiced - PendingSITDaysInvoiced int64 `json:"pendingSITDaysInvoiced,omitempty"` - - // previously billed days - PreviouslyBilledDays *int64 `json:"previouslyBilledDays,omitempty"` - - // previously billed end date - // Format: date - PreviouslyBilledEndDate *strfmt.Date `json:"previouslyBilledEndDate,omitempty"` - - // previously billed start date - // Format: date - PreviouslyBilledStartDate *strfmt.Date `json:"previouslyBilledStartDate,omitempty"` - - // shipment ID - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // total s i t days authorized - TotalSITDaysAuthorized int64 `json:"totalSITDaysAuthorized,omitempty"` - - // total s i t days remaining - TotalSITDaysRemaining int64 `json:"totalSITDaysRemaining,omitempty"` - - // total s i t end date - // Format: date - TotalSITEndDate *strfmt.Date `json:"totalSITEndDate,omitempty"` -} - -// Validate validates this shipment payment s i t balance -func (m *ShipmentPaymentSITBalance) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePendingBilledEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePendingBilledStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePreviouslyBilledEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePreviouslyBilledStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalSITEndDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentPaymentSITBalance) validatePendingBilledEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.PendingBilledEndDate) { // not required - return nil - } - - if err := validate.FormatOf("pendingBilledEndDate", "body", "date", m.PendingBilledEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentPaymentSITBalance) validatePendingBilledStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.PendingBilledStartDate) { // not required - return nil - } - - if err := validate.FormatOf("pendingBilledStartDate", "body", "date", m.PendingBilledStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentPaymentSITBalance) validatePreviouslyBilledEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.PreviouslyBilledEndDate) { // not required - return nil - } - - if err := validate.FormatOf("previouslyBilledEndDate", "body", "date", m.PreviouslyBilledEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentPaymentSITBalance) validatePreviouslyBilledStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.PreviouslyBilledStartDate) { // not required - return nil - } - - if err := validate.FormatOf("previouslyBilledStartDate", "body", "date", m.PreviouslyBilledStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentPaymentSITBalance) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentPaymentSITBalance) validateTotalSITEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.TotalSITEndDate) { // not required - return nil - } - - if err := validate.FormatOf("totalSITEndDate", "body", "date", m.TotalSITEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this shipment payment s i t balance based on context it is used -func (m *ShipmentPaymentSITBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ShipmentPaymentSITBalance) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentPaymentSITBalance) UnmarshalBinary(b []byte) error { - var res ShipmentPaymentSITBalance - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go b/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go deleted file mode 100644 index f672b5de6bd..00000000000 --- a/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ShipmentsPaymentSITBalance shipments payment s i t balance -// -// swagger:model ShipmentsPaymentSITBalance -type ShipmentsPaymentSITBalance []*ShipmentPaymentSITBalance - -// Validate validates this shipments payment s i t balance -func (m ShipmentsPaymentSITBalance) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipments payment s i t balance based on the context it is used -func (m ShipmentsPaymentSITBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/signed_certification.go b/pkg/gen/ghcmessages/signed_certification.go deleted file mode 100644 index b6295516c80..00000000000 --- a/pkg/gen/ghcmessages/signed_certification.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SignedCertification Signed certification -// -// swagger:model SignedCertification -type SignedCertification struct { - - // Full text that the customer agreed to and signed. - // Required: true - CertificationText *string `json:"certificationText"` - - // certification type - // Required: true - CertificationType SignedCertificationType `json:"certificationType"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // Date that the customer signed the certification. - // Required: true - // Format: date - Date *strfmt.Date `json:"date"` - - // A hash that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The ID of the signed certification. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // The ID of the move associated with this signed certification. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - MoveID strfmt.UUID `json:"moveId"` - - // The ID of the PPM shipment associated with this signed certification, if any. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - PpmID *strfmt.UUID `json:"ppmId"` - - // The signature that the customer provided. - // Required: true - Signature *string `json:"signature"` - - // The ID of the user that signed. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - SubmittingUserID strfmt.UUID `json:"submittingUserId"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this signed certification -func (m *SignedCertification) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificationText(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignature(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittingUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertification) validateCertificationText(formats strfmt.Registry) error { - - if err := validate.Required("certificationText", "body", m.CertificationText); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateCertificationType(formats strfmt.Registry) error { - - if err := validate.Required("certificationType", "body", SignedCertificationType(m.CertificationType)); err != nil { - return err - } - - if err := m.CertificationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificationType") - } - return err - } - - return nil -} - -func (m *SignedCertification) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("moveId", "body", strfmt.UUID(m.MoveID)); err != nil { - return err - } - - if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validatePpmID(formats strfmt.Registry) error { - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if err := validate.FormatOf("ppmId", "body", "uuid", m.PpmID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateSignature(formats strfmt.Registry) error { - - if err := validate.Required("signature", "body", m.Signature); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateSubmittingUserID(formats strfmt.Registry) error { - - if err := validate.Required("submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { - return err - } - - if err := validate.FormatOf("submittingUserId", "body", "uuid", m.SubmittingUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this signed certification based on the context it is used -func (m *SignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubmittingUserID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertification) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificationType") - } - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveId", "body", strfmt.UUID(m.MoveID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmId", "body", m.PpmID); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateSubmittingUserID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SignedCertification) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SignedCertification) UnmarshalBinary(b []byte) error { - var res SignedCertification - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/signed_certification_type.go b/pkg/gen/ghcmessages/signed_certification_type.go deleted file mode 100644 index 2b8c61cab50..00000000000 --- a/pkg/gen/ghcmessages/signed_certification_type.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SignedCertificationType The type of signed certification: -// - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are -// ready to submit their documentation for review. When they submit, they will be asked to sign certifying the -// information is correct. -// - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users. -// - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to -// service-counseling-completed "Submit move details" by service counselor. -// - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue. -// -// swagger:model SignedCertificationType -type SignedCertificationType string - -func NewSignedCertificationType(value SignedCertificationType) *SignedCertificationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SignedCertificationType. -func (m SignedCertificationType) Pointer() *SignedCertificationType { - return &m -} - -const ( - - // SignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" - SignedCertificationTypePPMPAYMENT SignedCertificationType = "PPM_PAYMENT" - - // SignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" - SignedCertificationTypeSHIPMENT SignedCertificationType = "SHIPMENT" - - // SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - - // SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "CLOSEOUT_REVIEWED_PPM_PAYMENT" -) - -// for schema -var signedCertificationTypeEnum []interface{} - -func init() { - var res []SignedCertificationType - if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - signedCertificationTypeEnum = append(signedCertificationTypeEnum, v) - } -} - -func (m SignedCertificationType) validateSignedCertificationTypeEnum(path, location string, value SignedCertificationType) error { - if err := validate.EnumCase(path, location, value, signedCertificationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this signed certification type -func (m SignedCertificationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSignedCertificationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this signed certification type based on the context it is used -func (m SignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", SignedCertificationType(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/storage_facility.go b/pkg/gen/ghcmessages/storage_facility.go deleted file mode 100644 index e78dcede80e..00000000000 --- a/pkg/gen/ghcmessages/storage_facility.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageFacility The Storage Facility information for the shipment -// -// swagger:model StorageFacility -type StorageFacility struct { - - // address - Address *Address `json:"address,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // facility name - FacilityName string `json:"facilityName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lot number - LotNumber *string `json:"lotNumber,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` -} - -// Validate validates this storage facility -func (m *StorageFacility) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage facility based on the context it is used -func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageFacility) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageFacility) UnmarshalBinary(b []byte) error { - var res StorageFacility - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/submitted_moving_expense_type.go b/pkg/gen/ghcmessages/submitted_moving_expense_type.go deleted file mode 100644 index 4e4c6e5ebc7..00000000000 --- a/pkg/gen/ghcmessages/submitted_moving_expense_type.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SubmittedMovingExpenseType Customer Submitted Moving Expense Type -// -// swagger:model SubmittedMovingExpenseType -type SubmittedMovingExpenseType string - -func NewSubmittedMovingExpenseType(value SubmittedMovingExpenseType) *SubmittedMovingExpenseType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SubmittedMovingExpenseType. -func (m SubmittedMovingExpenseType) Pointer() *SubmittedMovingExpenseType { - return &m -} - -const ( - - // SubmittedMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" - SubmittedMovingExpenseTypeCONTRACTEDEXPENSE SubmittedMovingExpenseType = "CONTRACTED_EXPENSE" - - // SubmittedMovingExpenseTypeGAS captures enum value "GAS" - SubmittedMovingExpenseTypeGAS SubmittedMovingExpenseType = "GAS" - - // SubmittedMovingExpenseTypeOIL captures enum value "OIL" - SubmittedMovingExpenseTypeOIL SubmittedMovingExpenseType = "OIL" - - // SubmittedMovingExpenseTypeOTHER captures enum value "OTHER" - SubmittedMovingExpenseTypeOTHER SubmittedMovingExpenseType = "OTHER" - - // SubmittedMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" - SubmittedMovingExpenseTypePACKINGMATERIALS SubmittedMovingExpenseType = "PACKING_MATERIALS" - - // SubmittedMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" - SubmittedMovingExpenseTypeRENTALEQUIPMENT SubmittedMovingExpenseType = "RENTAL_EQUIPMENT" - - // SubmittedMovingExpenseTypeSTORAGE captures enum value "STORAGE" - SubmittedMovingExpenseTypeSTORAGE SubmittedMovingExpenseType = "STORAGE" - - // SubmittedMovingExpenseTypeTOLLS captures enum value "TOLLS" - SubmittedMovingExpenseTypeTOLLS SubmittedMovingExpenseType = "TOLLS" - - // SubmittedMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" - SubmittedMovingExpenseTypeWEIGHINGFEE SubmittedMovingExpenseType = "WEIGHING_FEE" -) - -// for schema -var submittedMovingExpenseTypeEnum []interface{} - -func init() { - var res []SubmittedMovingExpenseType - if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - submittedMovingExpenseTypeEnum = append(submittedMovingExpenseTypeEnum, v) - } -} - -func (m SubmittedMovingExpenseType) validateSubmittedMovingExpenseTypeEnum(path, location string, value SubmittedMovingExpenseType) error { - if err := validate.EnumCase(path, location, value, submittedMovingExpenseTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this submitted moving expense type -func (m SubmittedMovingExpenseType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSubmittedMovingExpenseTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this submitted moving expense type based on context it is used -func (m SubmittedMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/ghcmessages/tac_valid.go b/pkg/gen/ghcmessages/tac_valid.go deleted file mode 100644 index 2b5bef8f266..00000000000 --- a/pkg/gen/ghcmessages/tac_valid.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TacValid tac valid -// -// swagger:model TacValid -type TacValid struct { - - // is valid - // Example: true - // Required: true - IsValid *bool `json:"isValid"` -} - -// Validate validates this tac valid -func (m *TacValid) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateIsValid(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TacValid) validateIsValid(formats strfmt.Registry) error { - - if err := validate.Required("isValid", "body", m.IsValid); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this tac valid based on context it is used -func (m *TacValid) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *TacValid) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TacValid) UnmarshalBinary(b []byte) error { - var res TacValid - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/transportation_office.go b/pkg/gen/ghcmessages/transportation_office.go deleted file mode 100644 index 75b4fa95068..00000000000 --- a/pkg/gen/ghcmessages/transportation_office.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOffice transportation office -// -// swagger:model TransportationOffice -type TransportationOffice struct { - - // address - // Required: true - Address *Address `json:"address"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // gbloc - // Example: JENQ - // Pattern: ^[A-Z]{4}$ - Gbloc string `json:"gbloc,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // latitude - // Example: 29.382973 - Latitude float32 `json:"latitude,omitempty"` - - // longitude - // Example: -98.62759 - Longitude float32 `json:"longitude,omitempty"` - - // name - // Example: Fort Bragg North Station - // Required: true - Name *string `json:"name"` - - // phone lines - PhoneLines []string `json:"phone_lines"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this transportation office -func (m *TransportationOffice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGbloc(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhoneLines(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { - if swag.IsZero(m.Gbloc) { // not required - return nil - } - - if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { - if swag.IsZero(m.PhoneLines) { // not required - return nil - } - - for i := 0; i < len(m.PhoneLines); i++ { - - if err := validate.Pattern("phone_lines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - } - - return nil -} - -func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office based on the context it is used -func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOffice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOffice) UnmarshalBinary(b []byte) error { - var res TransportationOffice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/transportation_office_assignment.go b/pkg/gen/ghcmessages/transportation_office_assignment.go deleted file mode 100644 index c370c5902af..00000000000 --- a/pkg/gen/ghcmessages/transportation_office_assignment.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOfficeAssignment transportation office assignment -// -// swagger:model TransportationOfficeAssignment -type TransportationOfficeAssignment struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // office user Id - // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 - // Required: true - // Format: uuid - OfficeUserID *strfmt.UUID `json:"officeUserId"` - - // primary office - // Required: true - PrimaryOffice *bool `json:"primaryOffice"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` - - // transportation office Id - // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 - // Required: true - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this transportation office assignment -func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimaryOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.Required("officeUserId", "body", m.OfficeUserID); err != nil { - return err - } - - if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validatePrimaryOffice(formats strfmt.Registry) error { - - if err := validate.Required("primaryOffice", "body", m.PrimaryOffice); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office assignment based on the context it is used -func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { - var res TransportationOfficeAssignment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/transportation_offices.go b/pkg/gen/ghcmessages/transportation_offices.go deleted file mode 100644 index d964c5c3733..00000000000 --- a/pkg/gen/ghcmessages/transportation_offices.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TransportationOffices transportation offices -// -// swagger:model TransportationOffices -type TransportationOffices []*TransportationOffice - -// Validate validates this transportation offices -func (m TransportationOffices) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this transportation offices based on the context it is used -func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go deleted file mode 100644 index ee0d677c0e7..00000000000 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateAllowancePayload update allowance payload -// -// swagger:model UpdateAllowancePayload -type UpdateAllowancePayload struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - - // agency - Agency *Affiliation `json:"agency,omitempty"` - - // dependents authorized - DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. - GunSafe *bool `json:"gunSafe,omitempty"` - - // only for Army - OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` - - // unit is in lbs - // Example: 2000 - // Maximum: 2000 - // Minimum: 0 - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // unit is in lbs - // Example: 500 - // Maximum: 500 - // Minimum: 0 - ProGearWeightSpouse *int64 `json:"proGearWeightSpouse,omitempty"` - - // unit is in lbs - // Example: 2000 - // Minimum: 0 - RequiredMedicalEquipmentWeight *int64 `json:"requiredMedicalEquipmentWeight,omitempty"` - - // the number of storage in transit days that the customer is entitled to for a given shipment on their move - // Minimum: 0 - StorageInTransit *int64 `json:"storageInTransit,omitempty"` - - // ub allowance - // Example: 500 - UbAllowance *int64 `json:"ubAllowance,omitempty"` -} - -// Validate validates this update allowance payload -func (m *UpdateAllowancePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgency(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightSpouse(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredMedicalEquipmentWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageInTransit(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateAllowancePayload) validateAgency(formats strfmt.Registry) error { - if swag.IsZero(m.Agency) { // not required - return nil - } - - if m.Agency != nil { - if err := m.Agency.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *UpdateAllowancePayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *UpdateAllowancePayload) validateProGearWeight(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeight) { // not required - return nil - } - - if err := validate.MinimumInt("proGearWeight", "body", *m.ProGearWeight, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("proGearWeight", "body", *m.ProGearWeight, 2000, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateAllowancePayload) validateProGearWeightSpouse(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeightSpouse) { // not required - return nil - } - - if err := validate.MinimumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 0, false); err != nil { - return err - } - - if err := validate.MaximumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 500, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateAllowancePayload) validateRequiredMedicalEquipmentWeight(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredMedicalEquipmentWeight) { // not required - return nil - } - - if err := validate.MinimumInt("requiredMedicalEquipmentWeight", "body", *m.RequiredMedicalEquipmentWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateAllowancePayload) validateStorageInTransit(formats strfmt.Registry) error { - if swag.IsZero(m.StorageInTransit) { // not required - return nil - } - - if err := validate.MinimumInt("storageInTransit", "body", *m.StorageInTransit, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update allowance payload based on the context it is used -func (m *UpdateAllowancePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgency(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateAllowancePayload) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { - - if m.Agency != nil { - - if swag.IsZero(m.Agency) { // not required - return nil - } - - if err := m.Agency.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agency") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agency") - } - return err - } - } - - return nil -} - -func (m *UpdateAllowancePayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateAllowancePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateAllowancePayload) UnmarshalBinary(b []byte) error { - var res UpdateAllowancePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_billable_weight_payload.go b/pkg/gen/ghcmessages/update_billable_weight_payload.go deleted file mode 100644 index 63c423f2849..00000000000 --- a/pkg/gen/ghcmessages/update_billable_weight_payload.go +++ /dev/null @@ -1,75 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateBillableWeightPayload update billable weight payload -// -// swagger:model UpdateBillableWeightPayload -type UpdateBillableWeightPayload struct { - - // unit is in lbs - // Example: 2000 - // Minimum: 1 - AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` -} - -// Validate validates this update billable weight payload -func (m *UpdateBillableWeightPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthorizedWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateBillableWeightPayload) validateAuthorizedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AuthorizedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("authorizedWeight", "body", *m.AuthorizedWeight, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update billable weight payload based on context it is used -func (m *UpdateBillableWeightPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateBillableWeightPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateBillableWeightPayload) UnmarshalBinary(b []byte) error { - var res UpdateBillableWeightPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_boat_shipment.go b/pkg/gen/ghcmessages/update_boat_shipment.go deleted file mode 100644 index bcc443a6e6c..00000000000 --- a/pkg/gen/ghcmessages/update_boat_shipment.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateBoatShipment update boat shipment -// -// swagger:model UpdateBoatShipment -type UpdateBoatShipment struct { - - // Does the boat have a trailer - HasTrailer *bool `json:"hasTrailer,omitempty"` - - // Height of the Boat in inches - HeightInInches *int64 `json:"heightInInches,omitempty"` - - // Is the trailer roadworthy - IsRoadworthy *bool `json:"isRoadworthy,omitempty"` - - // Length of the Boat in inches - LengthInInches *int64 `json:"lengthInInches,omitempty"` - - // Make of the Boat - Make *string `json:"make,omitempty"` - - // Model of the Boat - Model *string `json:"model,omitempty"` - - // type - // Enum: [HAUL_AWAY TOW_AWAY] - Type *string `json:"type,omitempty"` - - // Width of the Boat in inches - WidthInInches *int64 `json:"widthInInches,omitempty"` - - // Year of the Boat - Year *int64 `json:"year,omitempty"` -} - -// Validate validates this update boat shipment -func (m *UpdateBoatShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var updateBoatShipmentTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateBoatShipmentTypeTypePropEnum = append(updateBoatShipmentTypeTypePropEnum, v) - } -} - -const ( - - // UpdateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" - UpdateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" - - // UpdateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" - UpdateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" -) - -// prop value enum -func (m *UpdateBoatShipment) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateBoatShipmentTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateBoatShipment) 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 -} - -// ContextValidate validates this update boat shipment based on context it is used -func (m *UpdateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateBoatShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateBoatShipment) UnmarshalBinary(b []byte) error { - var res UpdateBoatShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_customer_payload.go b/pkg/gen/ghcmessages/update_customer_payload.go deleted file mode 100644 index d86dc5681a2..00000000000 --- a/pkg/gen/ghcmessages/update_customer_payload.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateCustomerPayload update customer payload -// -// swagger:model UpdateCustomerPayload -type UpdateCustomerPayload struct { - - // backup address - BackupAddress struct { - Address - } `json:"backupAddress,omitempty"` - - // backup contact - BackupContact *BackupContact `json:"backup_contact,omitempty"` - - // cac validated - CacValidated bool `json:"cac_validated,omitempty"` - - // current address - CurrentAddress struct { - Address - } `json:"current_address,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // email is preferred - EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` - - // first name - // Example: John - FirstName string `json:"first_name,omitempty"` - - // last name - // Example: Doe - LastName string `json:"last_name,omitempty"` - - // middle name - // Example: David - MiddleName *string `json:"middle_name,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` - - // phone is preferred - PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` - - // secondary telephone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ - SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` - - // suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` -} - -// Validate validates this update customer payload -func (m *UpdateCustomerPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBackupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupContact(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateCustomerPayload) validateBackupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateCustomerPayload) validateBackupContact(formats strfmt.Registry) error { - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if m.BackupContact != nil { - if err := m.BackupContact.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contact") - } - return err - } - } - - return nil -} - -func (m *UpdateCustomerPayload) validateCurrentAddress(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateCustomerPayload) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateCustomerPayload) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateCustomerPayload) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$|^$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update customer payload based on the context it is used -func (m *UpdateCustomerPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBackupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupContact(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateCustomerPayload) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateCustomerPayload) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupContact != nil { - - if swag.IsZero(m.BackupContact) { // not required - return nil - } - - if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contact") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contact") - } - return err - } - } - - return nil -} - -func (m *UpdateCustomerPayload) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateCustomerPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateCustomerPayload) UnmarshalBinary(b []byte) error { - var res UpdateCustomerPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_customer_support_remark_payload.go b/pkg/gen/ghcmessages/update_customer_support_remark_payload.go deleted file mode 100644 index c57e0202950..00000000000 --- a/pkg/gen/ghcmessages/update_customer_support_remark_payload.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateCustomerSupportRemarkPayload A text remark update to an existing remark created by the current active user (the CSR). -// -// swagger:model UpdateCustomerSupportRemarkPayload -type UpdateCustomerSupportRemarkPayload struct { - - // content - // Example: This is a remark about a move. - // Required: true - Content *string `json:"content"` -} - -// Validate validates this update customer support remark payload -func (m *UpdateCustomerSupportRemarkPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContent(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateCustomerSupportRemarkPayload) validateContent(formats strfmt.Registry) error { - - if err := validate.Required("content", "body", m.Content); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update customer support remark payload based on context it is used -func (m *UpdateCustomerSupportRemarkPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateCustomerSupportRemarkPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateCustomerSupportRemarkPayload) UnmarshalBinary(b []byte) error { - var res UpdateCustomerSupportRemarkPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go b/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go deleted file mode 100644 index bc473fd5a94..00000000000 --- a/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMaxBillableWeightAsTIOPayload update max billable weight as t i o payload -// -// swagger:model UpdateMaxBillableWeightAsTIOPayload -type UpdateMaxBillableWeightAsTIOPayload struct { - - // unit is in lbs - // Example: 2000 - // Required: true - // Minimum: 1 - AuthorizedWeight *int64 `json:"authorizedWeight"` - - // TIO remarks for updating the max billable weight - // Example: Increasing max billable weight - // Required: true - // Min Length: 1 - TioRemarks *string `json:"tioRemarks"` -} - -// Validate validates this update max billable weight as t i o payload -func (m *UpdateMaxBillableWeightAsTIOPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAuthorizedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTioRemarks(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMaxBillableWeightAsTIOPayload) validateAuthorizedWeight(formats strfmt.Registry) error { - - if err := validate.Required("authorizedWeight", "body", m.AuthorizedWeight); err != nil { - return err - } - - if err := validate.MinimumInt("authorizedWeight", "body", *m.AuthorizedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMaxBillableWeightAsTIOPayload) validateTioRemarks(formats strfmt.Registry) error { - - if err := validate.Required("tioRemarks", "body", m.TioRemarks); err != nil { - return err - } - - if err := validate.MinLength("tioRemarks", "body", *m.TioRemarks, 1); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update max billable weight as t i o payload based on context it is used -func (m *UpdateMaxBillableWeightAsTIOPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMaxBillableWeightAsTIOPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMaxBillableWeightAsTIOPayload) UnmarshalBinary(b []byte) error { - var res UpdateMaxBillableWeightAsTIOPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_mobile_home_shipment.go b/pkg/gen/ghcmessages/update_mobile_home_shipment.go deleted file mode 100644 index 7a4df05aa5e..00000000000 --- a/pkg/gen/ghcmessages/update_mobile_home_shipment.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateMobileHomeShipment update mobile home shipment -// -// swagger:model UpdateMobileHomeShipment -type UpdateMobileHomeShipment struct { - - // Height of the Boat in inches - HeightInInches *int64 `json:"heightInInches,omitempty"` - - // Length of the Boat in inches - LengthInInches *int64 `json:"lengthInInches,omitempty"` - - // Make of the Boat - Make *string `json:"make,omitempty"` - - // Model of the Boat - Model *string `json:"model,omitempty"` - - // Width of the Boat in inches - WidthInInches *int64 `json:"widthInInches,omitempty"` - - // Year of the Boat - Year *int64 `json:"year,omitempty"` -} - -// Validate validates this update mobile home shipment -func (m *UpdateMobileHomeShipment) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update mobile home shipment based on context it is used -func (m *UpdateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMobileHomeShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMobileHomeShipment) UnmarshalBinary(b []byte) error { - var res UpdateMobileHomeShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_moving_expense.go b/pkg/gen/ghcmessages/update_moving_expense.go deleted file mode 100644 index c3534bedfa8..00000000000 --- a/pkg/gen/ghcmessages/update_moving_expense.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMovingExpense update moving expense -// -// swagger:model UpdateMovingExpense -type UpdateMovingExpense struct { - - // The total amount of the expense as indicated on the receipt - Amount int64 `json:"amount,omitempty"` - - // A brief description of the expense. - Description *string `json:"description"` - - // moving expense type - MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` - - // The reason the services counselor has excluded or rejected the item. - Reason string `json:"reason,omitempty"` - - // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Format: date - SitEndDate strfmt.Date `json:"sitEndDate,omitempty"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The amount of SIT that will be reimbursed - SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` - - // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Format: date - SitStartDate strfmt.Date `json:"sitStartDate,omitempty"` - - // status - Status PPMDocumentStatus `json:"status,omitempty"` - - // The total weight stored in PPM SIT - WeightStored int64 `json:"weightStored,omitempty"` -} - -// Validate validates this update moving expense -func (m *UpdateMovingExpense) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitStartDate(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 *UpdateMovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if m.MovingExpenseType != nil { - if err := m.MovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this update moving expense based on the context it is used -func (m *UpdateMovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.MovingExpenseType != nil { - - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMovingExpense) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMovingExpense) UnmarshalBinary(b []byte) error { - var res UpdateMovingExpense - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_order_payload.go b/pkg/gen/ghcmessages/update_order_payload.go deleted file mode 100644 index f5a09ceb70d..00000000000 --- a/pkg/gen/ghcmessages/update_order_payload.go +++ /dev/null @@ -1,536 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - "github.com/transcom/mymove/pkg/swagger/nullable" -) - -// UpdateOrderPayload update order payload -// -// swagger:model UpdateOrderPayload -type UpdateOrderPayload struct { - - // department indicator - DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` - - // grade - Grade *Grade `json:"grade,omitempty"` - - // Orders date - // - // The date and time that these orders were cut. - // Example: 2018-04-26 - // Required: true - // Format: date - IssueDate *strfmt.Date `json:"issueDate"` - - // new duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` - - // NTS SAC - // Example: N002214CSW32Y9 - NtsSac nullable.String `json:"ntsSac,omitempty"` - - // NTS TAC - // Example: F8J1 - NtsTac nullable.String `json:"ntsTac,omitempty"` - - // Confirmation that the new amended orders were reviewed after previously approving the original orders - OrdersAcknowledgement *bool `json:"ordersAcknowledgement,omitempty"` - - // Orders Number - // Example: 030-00362 - OrdersNumber *string `json:"ordersNumber,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"ordersType"` - - // orders type detail - OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` - - // origin duty location Id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - OriginDutyLocationID *strfmt.UUID `json:"originDutyLocationId"` - - // Report-by date - // - // Report By Date - // Example: 2018-04-26 - // Required: true - // Format: date - ReportByDate *strfmt.Date `json:"reportByDate"` - - // HHG SAC - // Example: N002214CSW32Y9 - Sac nullable.String `json:"sac,omitempty"` - - // HHG TAC - // Example: F8J1 - // Max Length: 4 - // Min Length: 4 - Tac *string `json:"tac,omitempty"` -} - -// Validate validates this update order payload -func (m *UpdateOrderPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssueDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNtsSac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNtsTac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSac(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTac(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateOrderPayload) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) validateIssueDate(formats strfmt.Registry) error { - - if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { - return err - } - - if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateNewDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateNtsSac(formats strfmt.Registry) error { - if swag.IsZero(m.NtsSac) { // not required - return nil - } - - if err := m.NtsSac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsSac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsSac") - } - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateNtsTac(formats strfmt.Registry) error { - if swag.IsZero(m.NtsTac) { // not required - return nil - } - - if err := m.NtsTac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsTac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsTac") - } - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) validateOrdersTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if m.OrdersTypeDetail != nil { - if err := m.OrdersTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) validateOriginDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("originDutyLocationId", "body", m.OriginDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateReportByDate(formats strfmt.Registry) error { - - if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { - return err - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateSac(formats strfmt.Registry) error { - if swag.IsZero(m.Sac) { // not required - return nil - } - - if err := m.Sac.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sac") - } - return err - } - - return nil -} - -func (m *UpdateOrderPayload) validateTac(formats strfmt.Registry) error { - if swag.IsZero(m.Tac) { // not required - return nil - } - - if err := validate.MinLength("tac", "body", *m.Tac, 4); err != nil { - return err - } - - if err := validate.MaxLength("tac", "body", *m.Tac, 4); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update order payload based on the context it is used -func (m *UpdateOrderPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNtsSac(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNtsTac(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSac(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateOrderPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("departmentIndicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("departmentIndicator") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateNtsSac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.NtsSac) { // not required - return nil - } - - if err := m.NtsSac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsSac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsSac") - } - return err - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateNtsTac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.NtsTac) { // not required - return nil - } - - if err := m.NtsTac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ntsTac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ntsTac") - } - return err - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersTypeDetail != nil { - - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersTypeDetail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersTypeDetail") - } - return err - } - } - - return nil -} - -func (m *UpdateOrderPayload) contextValidateSac(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Sac) { // not required - return nil - } - - if err := m.Sac.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sac") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sac") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateOrderPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateOrderPayload) UnmarshalBinary(b []byte) error { - var res UpdateOrderPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_p_p_m_shipment.go b/pkg/gen/ghcmessages/update_p_p_m_shipment.go deleted file mode 100644 index 1684f99a4c9..00000000000 --- a/pkg/gen/ghcmessages/update_p_p_m_shipment.go +++ /dev/null @@ -1,571 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePPMShipment update p p m shipment -// -// swagger:model UpdatePPMShipment -type UpdatePPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode,omitempty"` - - // actual move date - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate,omitempty"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode,omitempty"` - - // The amount received for an advance, or null if no advance is received - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived,omitempty"` - - // The amount request for an advance, or null if no advance is requested - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested,omitempty"` - - // advance status - AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` - - // The allowable weight of the PPM shipment goods being moved. - // Example: 4300 - // Minimum: 0 - AllowableWeight *int64 `json:"allowableWeight,omitempty"` - - // destination address - DestinationAddress struct { - PPMDestinationAddress - } `json:"destinationAddress,omitempty"` - - // estimated weight - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // Date the customer expects to move. - // - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` - - // Indicates whether PPM shipment has pro gear. - // - HasProGear *bool `json:"hasProGear,omitempty"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance,omitempty"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance,omitempty"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // pickup address - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // pro gear weight - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // secondary destination address - SecondaryDestinationAddress struct { - Address - } `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // sit estimated departure date - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` - - // sit estimated entry date - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` - - // sit estimated weight - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` - - // sit expected - SitExpected *bool `json:"sitExpected,omitempty"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // spouse pro gear weight - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` - - // tertiary destination address - TertiaryDestinationAddress struct { - Address - } `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` - - // w2 address - W2Address *Address `json:"w2Address,omitempty"` -} - -// Validate validates this update p p m shipment -func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdvanceStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAllowableWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateW2Address(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if m.AdvanceStatus != nil { - if err := m.AdvanceStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateAllowableWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AllowableWeight) { // not required - return nil - } - - if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.ExpectedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateW2Address(formats strfmt.Registry) error { - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if m.W2Address != nil { - if err := m.W2Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update p p m shipment based on the context it is used -func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateW2Address(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvanceStatus != nil { - - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { - - if m.W2Address != nil { - - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if err := m.W2Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { - var res UpdatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_payment_request_status_payload.go b/pkg/gen/ghcmessages/update_payment_request_status_payload.go deleted file mode 100644 index b6e87663034..00000000000 --- a/pkg/gen/ghcmessages/update_payment_request_status_payload.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdatePaymentRequestStatusPayload update payment request status payload -// -// swagger:model UpdatePaymentRequestStatusPayload -type UpdatePaymentRequestStatusPayload struct { - - // e tag - ETag string `json:"eTag,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this update payment request status payload -func (m *UpdatePaymentRequestStatusPayload) 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 *UpdatePaymentRequestStatusPayload) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this update payment request status payload based on the context it is used -func (m *UpdatePaymentRequestStatusPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePaymentRequestStatusPayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePaymentRequestStatusPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePaymentRequestStatusPayload) UnmarshalBinary(b []byte) error { - var res UpdatePaymentRequestStatusPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go b/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go deleted file mode 100644 index 7cf1e0290ff..00000000000 --- a/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateProGearWeightTicket update pro gear weight ticket -// -// swagger:model UpdateProGearWeightTicket -type UpdateProGearWeightTicket struct { - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - BelongsToSelf bool `json:"belongsToSelf,omitempty"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - HasWeightTickets bool `json:"hasWeightTickets,omitempty"` - - // The reason the services counselor has excluded or rejected the item. - Reason string `json:"reason,omitempty"` - - // status - Status PPMDocumentStatus `json:"status,omitempty"` - - // Weight of the pro-gear contained in the shipment. - // Minimum: 0 - Weight *int64 `json:"weight,omitempty"` -} - -// Validate validates this update pro gear weight ticket -func (m *UpdateProGearWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateProGearWeightTicket) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *UpdateProGearWeightTicket) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update pro gear weight ticket based on the context it is used -func (m *UpdateProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateProGearWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateProGearWeightTicket) UnmarshalBinary(b []byte) error { - var res UpdateProGearWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go b/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go deleted file mode 100644 index 19cd36e9709..00000000000 --- a/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateSITServiceItemCustomerExpense update s i t service item customer expense -// -// swagger:model UpdateSITServiceItemCustomerExpense -type UpdateSITServiceItemCustomerExpense struct { - - // convert to customer expense - // Example: true - // Required: true - ConvertToCustomerExpense *bool `json:"convertToCustomerExpense"` - - // Reason the service item was rejected - // Example: Insufficent details provided - // Required: true - CustomerExpenseReason *string `json:"customerExpenseReason"` -} - -// Validate validates this update s i t service item customer expense -func (m *UpdateSITServiceItemCustomerExpense) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateConvertToCustomerExpense(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerExpenseReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateSITServiceItemCustomerExpense) validateConvertToCustomerExpense(formats strfmt.Registry) error { - - if err := validate.Required("convertToCustomerExpense", "body", m.ConvertToCustomerExpense); err != nil { - return err - } - - return nil -} - -func (m *UpdateSITServiceItemCustomerExpense) validateCustomerExpenseReason(formats strfmt.Registry) error { - - if err := validate.Required("customerExpenseReason", "body", m.CustomerExpenseReason); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update s i t service item customer expense based on context it is used -func (m *UpdateSITServiceItemCustomerExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateSITServiceItemCustomerExpense) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateSITServiceItemCustomerExpense) UnmarshalBinary(b []byte) error { - var res UpdateSITServiceItemCustomerExpense - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_shipment.go b/pkg/gen/ghcmessages/update_shipment.go deleted file mode 100644 index ec51eca5b62..00000000000 --- a/pkg/gen/ghcmessages/update_shipment.go +++ /dev/null @@ -1,736 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" - "github.com/transcom/mymove/pkg/swagger/nullable" -) - -// UpdateShipment update shipment -// -// swagger:model UpdateShipment -type UpdateShipment struct { - - // actual pro gear weight - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // actual spouse pro gear weight - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // estimated weight of the shuttle service item provided by the prime - // Example: 2500 - BillableWeightCap *int64 `json:"billableWeightCap,omitempty"` - - // billable weight justification - // Example: more weight than expected - BillableWeightJustification *string `json:"billableWeightJustification,omitempty"` - - // boat shipment - BoatShipment *UpdateBoatShipment `json:"boatShipment,omitempty"` - - // counselor remarks - // Example: counselor approved - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // customer remarks - // Example: handle with care - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // destination address - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // has secondary delivery address - HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary delivery address - HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // mobile home shipment - MobileHomeShipment *UpdateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 2000 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // pickup address - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` - - // requested delivery date - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // sac type - SacType nullable.String `json:"sacType,omitempty"` - - // secondary delivery address - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // service order number - ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // tac type - TacType nullable.String `json:"tacType,omitempty"` - - // tertiary delivery address - TertiaryDeliveryAddress struct { - Address - } `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` - - // uses external vendor - // Example: false - UsesExternalVendor *bool `json:"usesExternalVendor,omitempty"` -} - -// Validate validates this update shipment -func (m *UpdateShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTacType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipment) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipment) validateSacType(formats strfmt.Registry) error { - if swag.IsZero(m.SacType) { // not required - return nil - } - - if err := m.SacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateTacType(formats strfmt.Registry) error { - if swag.IsZero(m.TacType) { // not required - return nil - } - - if err := m.TacType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -// ContextValidate validate this update shipment based on the context it is used -func (m *UpdateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTacType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.SacType) { // not required - return nil - } - - if err := m.SacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sacType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.TacType) { // not required - return nil - } - - if err := m.TacType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tacType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tacType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateShipment) UnmarshalBinary(b []byte) error { - var res UpdateShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/update_weight_ticket.go b/pkg/gen/ghcmessages/update_weight_ticket.go deleted file mode 100644 index b1e861e0f11..00000000000 --- a/pkg/gen/ghcmessages/update_weight_ticket.go +++ /dev/null @@ -1,177 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateWeightTicket update weight ticket -// -// swagger:model UpdateWeightTicket -type UpdateWeightTicket struct { - - // Indicates the adjusted net weight of the vehicle - // Minimum: 0 - AdjustedNetWeight *int64 `json:"adjustedNetWeight,omitempty"` - - // Weight of the vehicle when empty. - // Minimum: 0 - EmptyWeight *int64 `json:"emptyWeight,omitempty"` - - // The weight of the vehicle when full. - // Minimum: 0 - FullWeight *int64 `json:"fullWeight,omitempty"` - - // Remarks explaining any edits made to the net weight - NetWeightRemarks string `json:"netWeightRemarks,omitempty"` - - // Indicates if the customer used a trailer they own for the move. - OwnsTrailer bool `json:"ownsTrailer,omitempty"` - - // The reason the services counselor has excluded or rejected the item. - Reason string `json:"reason,omitempty"` - - // status - Status PPMDocumentStatus `json:"status,omitempty"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - TrailerMeetsCriteria bool `json:"trailerMeetsCriteria,omitempty"` -} - -// Validate validates this update weight ticket -func (m *UpdateWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdjustedNetWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(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 *UpdateWeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AdjustedNetWeight) { // not required - return nil - } - - if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateWeightTicket) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateWeightTicket) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateWeightTicket) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this update weight ticket based on the context it is used -func (m *UpdateWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateWeightTicket) UnmarshalBinary(b []byte) error { - var res UpdateWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/upload.go b/pkg/gen/ghcmessages/upload.go deleted file mode 100644 index 3ef93543a04..00000000000 --- a/pkg/gen/ghcmessages/upload.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Upload An uploaded file. -// -// swagger:model Upload -type Upload struct { - - // bytes - // Required: true - // Read Only: true - Bytes int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - // Read Only: true - ContentType string `json:"contentType"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // deleted at - // Read Only: true - // Format: date-time - DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - // Read Only: true - Filename string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // is weight ticket - IsWeightTicket bool `json:"isWeightTicket,omitempty"` - - // rotation - // Example: 2 - Rotation int64 `json:"rotation,omitempty"` - - // status - // Read Only: true - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // upload type - // Example: OFFICE - // Read Only: true - // Enum: [USER PRIME OFFICE] - UploadType string `json:"uploadType,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uri - URL strfmt.URI `json:"url"` -} - -// Validate validates this upload -func (m *Upload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Upload) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", int64(m.Bytes)); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateContentType(formats strfmt.Registry) error { - - if err := validate.RequiredString("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateDeletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.DeletedAt) { // not required - return nil - } - - if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateFilename(formats strfmt.Registry) error { - - if err := validate.RequiredString("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -var uploadTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadTypeStatusPropEnum = append(uploadTypeStatusPropEnum, v) - } -} - -const ( - - // UploadStatusINFECTED captures enum value "INFECTED" - UploadStatusINFECTED string = "INFECTED" - - // UploadStatusCLEAN captures enum value "CLEAN" - UploadStatusCLEAN string = "CLEAN" - - // UploadStatusPROCESSING captures enum value "PROCESSING" - UploadStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *Upload) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Upload) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -var uploadTypeUploadTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["USER","PRIME","OFFICE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadTypeUploadTypePropEnum = append(uploadTypeUploadTypePropEnum, v) - } -} - -const ( - - // UploadUploadTypeUSER captures enum value "USER" - UploadUploadTypeUSER string = "USER" - - // UploadUploadTypePRIME captures enum value "PRIME" - UploadUploadTypePRIME string = "PRIME" - - // UploadUploadTypeOFFICE captures enum value "OFFICE" - UploadUploadTypeOFFICE string = "OFFICE" -) - -// prop value enum -func (m *Upload) validateUploadTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadTypeUploadTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Upload) validateUploadType(formats strfmt.Registry) error { - if swag.IsZero(m.UploadType) { // not required - return nil - } - - // value enum - if err := m.validateUploadTypeEnum("uploadType", "body", m.UploadType); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateURL(formats strfmt.Registry) error { - - if err := validate.Required("url", "body", strfmt.URI(m.URL)); err != nil { - return err - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload based on the context it is used -func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBytes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFilename(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUploadType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateURL(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Upload) contextValidateBytes(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "bytes", "body", int64(m.Bytes)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateContentType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contentType", "body", string(m.ContentType)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateDeletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "deletedAt", "body", m.DeletedAt); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateFilename(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "filename", "body", string(m.Filename)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateUploadType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "uploadType", "body", string(m.UploadType)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Upload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Upload) UnmarshalBinary(b []byte) error { - var res Upload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/v_location.go b/pkg/gen/ghcmessages/v_location.go deleted file mode 100644 index c9e1e2d6e5e..00000000000 --- a/pkg/gen/ghcmessages/v_location.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VLocation A postal code, city, and state lookup -// -// swagger:model VLocation -type VLocation struct { - - // City - // Example: Anytown - City string `json:"city,omitempty"` - - // County - // Example: LOS ANGELES - County *string `json:"county,omitempty"` - - // ZIP - // Example: 90210 - // Pattern: ^(\d{5}?)$ - PostalCode string `json:"postalCode,omitempty"` - - // State - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State string `json:"state,omitempty"` - - // us post region cities ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` -} - -// Validate validates this v location -func (m *VLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsPostRegionCitiesID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VLocation) validatePostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PostalCode) { // not required - return nil - } - - if err := validate.Pattern("postalCode", "body", m.PostalCode, `^(\d{5}?)$`); err != nil { - return err - } - - return nil -} - -var vLocationTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vLocationTypeStatePropEnum = append(vLocationTypeStatePropEnum, v) - } -} - -const ( - - // VLocationStateAL captures enum value "AL" - VLocationStateAL string = "AL" - - // VLocationStateAK captures enum value "AK" - VLocationStateAK string = "AK" - - // VLocationStateAR captures enum value "AR" - VLocationStateAR string = "AR" - - // VLocationStateAZ captures enum value "AZ" - VLocationStateAZ string = "AZ" - - // VLocationStateCA captures enum value "CA" - VLocationStateCA string = "CA" - - // VLocationStateCO captures enum value "CO" - VLocationStateCO string = "CO" - - // VLocationStateCT captures enum value "CT" - VLocationStateCT string = "CT" - - // VLocationStateDC captures enum value "DC" - VLocationStateDC string = "DC" - - // VLocationStateDE captures enum value "DE" - VLocationStateDE string = "DE" - - // VLocationStateFL captures enum value "FL" - VLocationStateFL string = "FL" - - // VLocationStateGA captures enum value "GA" - VLocationStateGA string = "GA" - - // VLocationStateHI captures enum value "HI" - VLocationStateHI string = "HI" - - // VLocationStateIA captures enum value "IA" - VLocationStateIA string = "IA" - - // VLocationStateID captures enum value "ID" - VLocationStateID string = "ID" - - // VLocationStateIL captures enum value "IL" - VLocationStateIL string = "IL" - - // VLocationStateIN captures enum value "IN" - VLocationStateIN string = "IN" - - // VLocationStateKS captures enum value "KS" - VLocationStateKS string = "KS" - - // VLocationStateKY captures enum value "KY" - VLocationStateKY string = "KY" - - // VLocationStateLA captures enum value "LA" - VLocationStateLA string = "LA" - - // VLocationStateMA captures enum value "MA" - VLocationStateMA string = "MA" - - // VLocationStateMD captures enum value "MD" - VLocationStateMD string = "MD" - - // VLocationStateME captures enum value "ME" - VLocationStateME string = "ME" - - // VLocationStateMI captures enum value "MI" - VLocationStateMI string = "MI" - - // VLocationStateMN captures enum value "MN" - VLocationStateMN string = "MN" - - // VLocationStateMO captures enum value "MO" - VLocationStateMO string = "MO" - - // VLocationStateMS captures enum value "MS" - VLocationStateMS string = "MS" - - // VLocationStateMT captures enum value "MT" - VLocationStateMT string = "MT" - - // VLocationStateNC captures enum value "NC" - VLocationStateNC string = "NC" - - // VLocationStateND captures enum value "ND" - VLocationStateND string = "ND" - - // VLocationStateNE captures enum value "NE" - VLocationStateNE string = "NE" - - // VLocationStateNH captures enum value "NH" - VLocationStateNH string = "NH" - - // VLocationStateNJ captures enum value "NJ" - VLocationStateNJ string = "NJ" - - // VLocationStateNM captures enum value "NM" - VLocationStateNM string = "NM" - - // VLocationStateNV captures enum value "NV" - VLocationStateNV string = "NV" - - // VLocationStateNY captures enum value "NY" - VLocationStateNY string = "NY" - - // VLocationStateOH captures enum value "OH" - VLocationStateOH string = "OH" - - // VLocationStateOK captures enum value "OK" - VLocationStateOK string = "OK" - - // VLocationStateOR captures enum value "OR" - VLocationStateOR string = "OR" - - // VLocationStatePA captures enum value "PA" - VLocationStatePA string = "PA" - - // VLocationStateRI captures enum value "RI" - VLocationStateRI string = "RI" - - // VLocationStateSC captures enum value "SC" - VLocationStateSC string = "SC" - - // VLocationStateSD captures enum value "SD" - VLocationStateSD string = "SD" - - // VLocationStateTN captures enum value "TN" - VLocationStateTN string = "TN" - - // VLocationStateTX captures enum value "TX" - VLocationStateTX string = "TX" - - // VLocationStateUT captures enum value "UT" - VLocationStateUT string = "UT" - - // VLocationStateVA captures enum value "VA" - VLocationStateVA string = "VA" - - // VLocationStateVT captures enum value "VT" - VLocationStateVT string = "VT" - - // VLocationStateWA captures enum value "WA" - VLocationStateWA string = "WA" - - // VLocationStateWI captures enum value "WI" - VLocationStateWI string = "WI" - - // VLocationStateWV captures enum value "WV" - VLocationStateWV string = "WV" - - // VLocationStateWY captures enum value "WY" - VLocationStateWY string = "WY" -) - -// prop value enum -func (m *VLocation) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vLocationTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VLocation) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *VLocation) validateUsPostRegionCitiesID(formats strfmt.Registry) error { - if swag.IsZero(m.UsPostRegionCitiesID) { // not required - return nil - } - - if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this v location based on context it is used -func (m *VLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VLocation) UnmarshalBinary(b []byte) error { - var res VLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/v_locations.go b/pkg/gen/ghcmessages/v_locations.go deleted file mode 100644 index 82af765b9f3..00000000000 --- a/pkg/gen/ghcmessages/v_locations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VLocations v locations -// -// swagger:model VLocations -type VLocations []*VLocation - -// Validate validates this v locations -func (m VLocations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v locations based on the context it is used -func (m VLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/validation_error.go b/pkg/gen/ghcmessages/validation_error.go deleted file mode 100644 index 7f2c695aa8f..00000000000 --- a/pkg/gen/ghcmessages/validation_error.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - ValidationErrorAllOf1 - - // invalid fields - // Required: true - InvalidFields map[string]string `json:"invalid_fields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var aO1 ValidationErrorAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.ValidationErrorAllOf1 = aO1 - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string]string `json:"invalid_fields"` - } - if err := swag.ReadJSON(raw, &propsValidationError); err != nil { - return err - } - m.InvalidFields = propsValidationError.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string]string `json:"invalid_fields"` - } - propsValidationError.InvalidFields = m.InvalidFields - - jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) - if errValidationError != nil { - return nil, errValidationError - } - _parts = append(_parts, jsonDataPropsValidationError) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalid_fields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ValidationErrorAllOf1 validation error all of1 -// -// swagger:model ValidationErrorAllOf1 -type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/ghcmessages/weight_ticket.go b/pkg/gen/ghcmessages/weight_ticket.go deleted file mode 100644 index 65435245820..00000000000 --- a/pkg/gen/ghcmessages/weight_ticket.go +++ /dev/null @@ -1,703 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WeightTicket Vehicle and optional trailer information and weight documents used to move this PPM shipment. -// -// swagger:model WeightTicket -type WeightTicket struct { - - // Indicates the adjusted net weight of the vehicle - // Minimum: 0 - AdjustedNetWeight *int64 `json:"adjustedNetWeight"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // empty document - // Required: true - EmptyDocument *Document `json:"emptyDocument"` - - // ID of the document that is associated with the user uploads containing the vehicle weight when empty. - // Required: true - // Read Only: true - // Format: uuid - EmptyDocumentID strfmt.UUID `json:"emptyDocumentId"` - - // Weight of the vehicle when empty. - // Minimum: 0 - EmptyWeight *int64 `json:"emptyWeight"` - - // full document - // Required: true - FullDocument *Document `json:"fullDocument"` - - // ID of the document that is associated with the user uploads containing the vehicle weight when full. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - FullDocumentID strfmt.UUID `json:"fullDocumentId"` - - // The weight of the vehicle when full. - // Minimum: 0 - FullWeight *int64 `json:"fullWeight"` - - // ID of this set of weight tickets. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. - MissingEmptyWeightTicket *bool `json:"missingEmptyWeightTicket"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when full. - MissingFullWeightTicket *bool `json:"missingFullWeightTicket"` - - // Remarks explaining any edits made to the net weight - NetWeightRemarks *string `json:"netWeightRemarks"` - - // Indicates if the customer used a trailer they own for the move. - OwnsTrailer *bool `json:"ownsTrailer"` - - // The ID of the PPM shipment that this set of weight tickets is for. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // proof of trailer ownership document - // Required: true - ProofOfTrailerOwnershipDocument *Document `json:"proofOfTrailerOwnershipDocument"` - - // ID of the document that is associated with the user uploads containing the proof of trailer ownership. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ProofOfTrailerOwnershipDocumentID strfmt.UUID `json:"proofOfTrailerOwnershipDocumentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Customer submitted weight of the vehicle when empty. - // Minimum: 0 - SubmittedEmptyWeight *int64 `json:"submittedEmptyWeight"` - - // Customer submitted weight of the vehicle when full. - // Minimum: 0 - SubmittedFullWeight *int64 `json:"submittedFullWeight"` - - // Indicates if the customer used a trailer they own for the move. - SubmittedOwnsTrailer *bool `json:"submittedOwnsTrailer"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - SubmittedTrailerMeetsCriteria *bool `json:"submittedTrailerMeetsCriteria"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - TrailerMeetsCriteria *bool `json:"trailerMeetsCriteria"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. - VehicleDescription *string `json:"vehicleDescription"` -} - -// Validate validates this weight ticket -func (m *WeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdjustedNetWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfTrailerOwnershipDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfTrailerOwnershipDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AdjustedNetWeight) { // not required - return nil - } - - if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateEmptyDocument(formats strfmt.Registry) error { - - if err := validate.Required("emptyDocument", "body", m.EmptyDocument); err != nil { - return err - } - - if m.EmptyDocument != nil { - if err := m.EmptyDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emptyDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("emptyDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateEmptyDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("emptyDocumentId", "body", "uuid", m.EmptyDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateFullDocument(formats strfmt.Registry) error { - - if err := validate.Required("fullDocument", "body", m.FullDocument); err != nil { - return err - } - - if m.FullDocument != nil { - if err := m.FullDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fullDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateFullDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("fullDocumentId", "body", "uuid", m.FullDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) 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 *WeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateProofOfTrailerOwnershipDocument(formats strfmt.Registry) error { - - if err := validate.Required("proofOfTrailerOwnershipDocument", "body", m.ProofOfTrailerOwnershipDocument); err != nil { - return err - } - - if m.ProofOfTrailerOwnershipDocument != nil { - if err := m.ProofOfTrailerOwnershipDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfTrailerOwnershipDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfTrailerOwnershipDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateProofOfTrailerOwnershipDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("proofOfTrailerOwnershipDocumentId", "body", "uuid", m.ProofOfTrailerOwnershipDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateSubmittedEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedEmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedEmptyWeight", "body", *m.SubmittedEmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateSubmittedFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedFullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedFullWeight", "body", *m.SubmittedFullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this weight ticket based on the context it is used -func (m *WeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEmptyDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEmptyDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFullDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFullDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfTrailerOwnershipDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfTrailerOwnershipDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateEmptyDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.EmptyDocument != nil { - - if err := m.EmptyDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emptyDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("emptyDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateEmptyDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateFullDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.FullDocument != nil { - - if err := m.FullDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fullDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateFullDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.ProofOfTrailerOwnershipDocument != nil { - - if err := m.ProofOfTrailerOwnershipDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfTrailerOwnershipDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfTrailerOwnershipDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WeightTicket) UnmarshalBinary(b []byte) error { - var res WeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/weight_tickets.go b/pkg/gen/ghcmessages/weight_tickets.go deleted file mode 100644 index f13786a3ff1..00000000000 --- a/pkg/gen/ghcmessages/weight_tickets.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WeightTickets All weight tickets associated with a PPM shipment. -// -// swagger:model WeightTickets -type WeightTickets []*WeightTicket - -// Validate validates this weight tickets -func (m WeightTickets) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this weight tickets based on the context it is used -func (m WeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/configure_mymove.go b/pkg/gen/internalapi/configure_mymove.go deleted file mode 100644 index 3b277e0037c..00000000000 --- a/pkg/gen/internalapi/configure_mymove.go +++ /dev/null @@ -1,453 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package internalapi - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/addresses" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/application_parameters" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/backup_contacts" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/calendar" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/certification" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/documents" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/duty_locations" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/entitlements" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/feature_flags" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/move_docs" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/moves" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/office" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/okta_profile" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/orders" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/postal_codes" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/ppm" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/queues" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/service_members" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/transportation_offices" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/uploads" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/users" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/internal.yaml --api-package internaloperations --model-package internalmessages --server-package internalapi --principal interface{} --exclude-main - -func configureFlags(api *internaloperations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *internaloperations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - api.MultipartformConsumer = runtime.DiscardConsumer - - api.BinProducer = runtime.ByteStreamProducer() - api.JSONProducer = runtime.JSONProducer() - - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // ppm.CreatePPMUploadMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // uploads.CreateUploadMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // moves.UploadAdditionalDocumentsMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // orders.UploadAmendedOrdersMaxParseMemory = 32 << 20 - - if api.OfficeApproveMoveHandler == nil { - api.OfficeApproveMoveHandler = office.ApproveMoveHandlerFunc(func(params office.ApproveMoveParams) middleware.Responder { - return middleware.NotImplemented("operation office.ApproveMove has not yet been implemented") - }) - } - if api.OfficeApproveReimbursementHandler == nil { - api.OfficeApproveReimbursementHandler = office.ApproveReimbursementHandlerFunc(func(params office.ApproveReimbursementParams) middleware.Responder { - return middleware.NotImplemented("operation office.ApproveReimbursement has not yet been implemented") - }) - } - if api.FeatureFlagsBooleanFeatureFlagForUserHandler == nil { - api.FeatureFlagsBooleanFeatureFlagForUserHandler = feature_flags.BooleanFeatureFlagForUserHandlerFunc(func(params feature_flags.BooleanFeatureFlagForUserParams) middleware.Responder { - return middleware.NotImplemented("operation feature_flags.BooleanFeatureFlagForUser has not yet been implemented") - }) - } - if api.OfficeCancelMoveHandler == nil { - api.OfficeCancelMoveHandler = office.CancelMoveHandlerFunc(func(params office.CancelMoveParams) middleware.Responder { - return middleware.NotImplemented("operation office.CancelMove has not yet been implemented") - }) - } - if api.DocumentsCreateDocumentHandler == nil { - api.DocumentsCreateDocumentHandler = documents.CreateDocumentHandlerFunc(func(params documents.CreateDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation documents.CreateDocument has not yet been implemented") - }) - } - if api.MoveDocsCreateGenericMoveDocumentHandler == nil { - api.MoveDocsCreateGenericMoveDocumentHandler = move_docs.CreateGenericMoveDocumentHandlerFunc(func(params move_docs.CreateGenericMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.CreateGenericMoveDocument has not yet been implemented") - }) - } - if api.MtoShipmentCreateMTOShipmentHandler == nil { - api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }) - } - if api.PpmCreateMovingExpenseHandler == nil { - api.PpmCreateMovingExpenseHandler = ppm.CreateMovingExpenseHandlerFunc(func(params ppm.CreateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateMovingExpense has not yet been implemented") - }) - } - if api.OrdersCreateOrdersHandler == nil { - api.OrdersCreateOrdersHandler = orders.CreateOrdersHandlerFunc(func(params orders.CreateOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.CreateOrders has not yet been implemented") - }) - } - if api.PpmCreatePPMUploadHandler == nil { - api.PpmCreatePPMUploadHandler = ppm.CreatePPMUploadHandlerFunc(func(params ppm.CreatePPMUploadParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreatePPMUpload has not yet been implemented") - }) - } - if api.PpmCreateProGearWeightTicketHandler == nil { - api.PpmCreateProGearWeightTicketHandler = ppm.CreateProGearWeightTicketHandlerFunc(func(params ppm.CreateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateProGearWeightTicket has not yet been implemented") - }) - } - if api.ServiceMembersCreateServiceMemberHandler == nil { - api.ServiceMembersCreateServiceMemberHandler = service_members.CreateServiceMemberHandlerFunc(func(params service_members.CreateServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.CreateServiceMember has not yet been implemented") - }) - } - if api.BackupContactsCreateServiceMemberBackupContactHandler == nil { - api.BackupContactsCreateServiceMemberBackupContactHandler = backup_contacts.CreateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.CreateServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.CreateServiceMemberBackupContact has not yet been implemented") - }) - } - if api.CertificationCreateSignedCertificationHandler == nil { - api.CertificationCreateSignedCertificationHandler = certification.CreateSignedCertificationHandlerFunc(func(params certification.CreateSignedCertificationParams) middleware.Responder { - return middleware.NotImplemented("operation certification.CreateSignedCertification has not yet been implemented") - }) - } - if api.UploadsCreateUploadHandler == nil { - api.UploadsCreateUploadHandler = uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") - }) - } - if api.PpmCreateWeightTicketHandler == nil { - api.PpmCreateWeightTicketHandler = ppm.CreateWeightTicketHandlerFunc(func(params ppm.CreateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateWeightTicket has not yet been implemented") - }) - } - if api.MoveDocsCreateWeightTicketDocumentHandler == nil { - api.MoveDocsCreateWeightTicketDocumentHandler = move_docs.CreateWeightTicketDocumentHandlerFunc(func(params move_docs.CreateWeightTicketDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.CreateWeightTicketDocument has not yet been implemented") - }) - } - if api.MoveDocsDeleteMoveDocumentHandler == nil { - api.MoveDocsDeleteMoveDocumentHandler = move_docs.DeleteMoveDocumentHandlerFunc(func(params move_docs.DeleteMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.DeleteMoveDocument has not yet been implemented") - }) - } - if api.PpmDeleteMovingExpenseHandler == nil { - api.PpmDeleteMovingExpenseHandler = ppm.DeleteMovingExpenseHandlerFunc(func(params ppm.DeleteMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteMovingExpense has not yet been implemented") - }) - } - if api.PpmDeleteProGearWeightTicketHandler == nil { - api.PpmDeleteProGearWeightTicketHandler = ppm.DeleteProGearWeightTicketHandlerFunc(func(params ppm.DeleteProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteProGearWeightTicket has not yet been implemented") - }) - } - if api.MtoShipmentDeleteShipmentHandler == nil { - api.MtoShipmentDeleteShipmentHandler = mto_shipment.DeleteShipmentHandlerFunc(func(params mto_shipment.DeleteShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.DeleteShipment has not yet been implemented") - }) - } - if api.UploadsDeleteUploadHandler == nil { - api.UploadsDeleteUploadHandler = uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") - }) - } - if api.UploadsDeleteUploadsHandler == nil { - api.UploadsDeleteUploadsHandler = uploads.DeleteUploadsHandlerFunc(func(params uploads.DeleteUploadsParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUploads has not yet been implemented") - }) - } - if api.PpmDeleteWeightTicketHandler == nil { - api.PpmDeleteWeightTicketHandler = ppm.DeleteWeightTicketHandlerFunc(func(params ppm.DeleteWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") - }) - } - if api.MovesGetAllMovesHandler == nil { - api.MovesGetAllMovesHandler = moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { - return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") - }) - } - if api.AddressesGetLocationByZipCityStateHandler == nil { - api.AddressesGetLocationByZipCityStateHandler = addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") - }) - } - if api.TransportationOfficesGetTransportationOfficesHandler == nil { - api.TransportationOfficesGetTransportationOfficesHandler = transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") - }) - } - if api.EntitlementsIndexEntitlementsHandler == nil { - api.EntitlementsIndexEntitlementsHandler = entitlements.IndexEntitlementsHandlerFunc(func(params entitlements.IndexEntitlementsParams) middleware.Responder { - return middleware.NotImplemented("operation entitlements.IndexEntitlements has not yet been implemented") - }) - } - if api.MoveDocsIndexMoveDocumentsHandler == nil { - api.MoveDocsIndexMoveDocumentsHandler = move_docs.IndexMoveDocumentsHandlerFunc(func(params move_docs.IndexMoveDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.IndexMoveDocuments has not yet been implemented") - }) - } - if api.BackupContactsIndexServiceMemberBackupContactsHandler == nil { - api.BackupContactsIndexServiceMemberBackupContactsHandler = backup_contacts.IndexServiceMemberBackupContactsHandlerFunc(func(params backup_contacts.IndexServiceMemberBackupContactsParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.IndexServiceMemberBackupContacts has not yet been implemented") - }) - } - if api.CertificationIndexSignedCertificationHandler == nil { - api.CertificationIndexSignedCertificationHandler = certification.IndexSignedCertificationHandlerFunc(func(params certification.IndexSignedCertificationParams) middleware.Responder { - return middleware.NotImplemented("operation certification.IndexSignedCertification has not yet been implemented") - }) - } - if api.CalendarIsDateWeekendHolidayHandler == nil { - api.CalendarIsDateWeekendHolidayHandler = calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") - }) - } - if api.UsersIsLoggedInUserHandler == nil { - api.UsersIsLoggedInUserHandler = users.IsLoggedInUserHandlerFunc(func(params users.IsLoggedInUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.IsLoggedInUser has not yet been implemented") - }) - } - if api.MtoShipmentListMTOShipmentsHandler == nil { - api.MtoShipmentListMTOShipmentsHandler = mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") - }) - } - if api.MovesPatchMoveHandler == nil { - api.MovesPatchMoveHandler = moves.PatchMoveHandlerFunc(func(params moves.PatchMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") - }) - } - if api.ServiceMembersPatchServiceMemberHandler == nil { - api.ServiceMembersPatchServiceMemberHandler = service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") - }) - } - if api.PpmResubmitPPMShipmentDocumentationHandler == nil { - api.PpmResubmitPPMShipmentDocumentationHandler = ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") - }) - } - if api.DutyLocationsSearchDutyLocationsHandler == nil { - api.DutyLocationsSearchDutyLocationsHandler = duty_locations.SearchDutyLocationsHandlerFunc(func(params duty_locations.SearchDutyLocationsParams) middleware.Responder { - return middleware.NotImplemented("operation duty_locations.SearchDutyLocations has not yet been implemented") - }) - } - if api.PpmShowAOAPacketHandler == nil { - api.PpmShowAOAPacketHandler = ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") - }) - } - if api.AddressesShowAddressHandler == nil { - api.AddressesShowAddressHandler = addresses.ShowAddressHandlerFunc(func(params addresses.ShowAddressParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.ShowAddress has not yet been implemented") - }) - } - if api.CalendarShowAvailableMoveDatesHandler == nil { - api.CalendarShowAvailableMoveDatesHandler = calendar.ShowAvailableMoveDatesHandlerFunc(func(params calendar.ShowAvailableMoveDatesParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.ShowAvailableMoveDates has not yet been implemented") - }) - } - if api.TransportationOfficesShowCounselingOfficesHandler == nil { - api.TransportationOfficesShowCounselingOfficesHandler = transportation_offices.ShowCounselingOfficesHandlerFunc(func(params transportation_offices.ShowCounselingOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.ShowCounselingOffices has not yet been implemented") - }) - } - if api.DocumentsShowDocumentHandler == nil { - api.DocumentsShowDocumentHandler = documents.ShowDocumentHandlerFunc(func(params documents.ShowDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation documents.ShowDocument has not yet been implemented") - }) - } - if api.TransportationOfficesShowDutyLocationTransportationOfficeHandler == nil { - api.TransportationOfficesShowDutyLocationTransportationOfficeHandler = transportation_offices.ShowDutyLocationTransportationOfficeHandlerFunc(func(params transportation_offices.ShowDutyLocationTransportationOfficeParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.ShowDutyLocationTransportationOffice has not yet been implemented") - }) - } - if api.UsersShowLoggedInUserHandler == nil { - api.UsersShowLoggedInUserHandler = users.ShowLoggedInUserHandlerFunc(func(params users.ShowLoggedInUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.ShowLoggedInUser has not yet been implemented") - }) - } - if api.MovesShowMoveHandler == nil { - api.MovesShowMoveHandler = moves.ShowMoveHandlerFunc(func(params moves.ShowMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.ShowMove has not yet been implemented") - }) - } - if api.OfficeShowOfficeOrdersHandler == nil { - api.OfficeShowOfficeOrdersHandler = office.ShowOfficeOrdersHandlerFunc(func(params office.ShowOfficeOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation office.ShowOfficeOrders has not yet been implemented") - }) - } - if api.OktaProfileShowOktaInfoHandler == nil { - api.OktaProfileShowOktaInfoHandler = okta_profile.ShowOktaInfoHandlerFunc(func(params okta_profile.ShowOktaInfoParams) middleware.Responder { - return middleware.NotImplemented("operation okta_profile.ShowOktaInfo has not yet been implemented") - }) - } - if api.OrdersShowOrdersHandler == nil { - api.OrdersShowOrdersHandler = orders.ShowOrdersHandlerFunc(func(params orders.ShowOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.ShowOrders has not yet been implemented") - }) - } - if api.PpmShowPaymentPacketHandler == nil { - api.PpmShowPaymentPacketHandler = ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") - }) - } - if api.QueuesShowQueueHandler == nil { - api.QueuesShowQueueHandler = queues.ShowQueueHandlerFunc(func(params queues.ShowQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.ShowQueue has not yet been implemented") - }) - } - if api.ServiceMembersShowServiceMemberHandler == nil { - api.ServiceMembersShowServiceMemberHandler = service_members.ShowServiceMemberHandlerFunc(func(params service_members.ShowServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.ShowServiceMember has not yet been implemented") - }) - } - if api.BackupContactsShowServiceMemberBackupContactHandler == nil { - api.BackupContactsShowServiceMemberBackupContactHandler = backup_contacts.ShowServiceMemberBackupContactHandlerFunc(func(params backup_contacts.ShowServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.ShowServiceMemberBackupContact has not yet been implemented") - }) - } - if api.ServiceMembersShowServiceMemberOrdersHandler == nil { - api.ServiceMembersShowServiceMemberOrdersHandler = service_members.ShowServiceMemberOrdersHandlerFunc(func(params service_members.ShowServiceMemberOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.ShowServiceMemberOrders has not yet been implemented") - }) - } - if api.MovesSubmitAmendedOrdersHandler == nil { - api.MovesSubmitAmendedOrdersHandler = moves.SubmitAmendedOrdersHandlerFunc(func(params moves.SubmitAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation moves.SubmitAmendedOrders has not yet been implemented") - }) - } - if api.MovesSubmitMoveForApprovalHandler == nil { - api.MovesSubmitMoveForApprovalHandler = moves.SubmitMoveForApprovalHandlerFunc(func(params moves.SubmitMoveForApprovalParams) middleware.Responder { - return middleware.NotImplemented("operation moves.SubmitMoveForApproval has not yet been implemented") - }) - } - if api.PpmSubmitPPMShipmentDocumentationHandler == nil { - api.PpmSubmitPPMShipmentDocumentationHandler = ppm.SubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.SubmitPPMShipmentDocumentationParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentHandler == nil { - api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }) - } - if api.MoveDocsUpdateMoveDocumentHandler == nil { - api.MoveDocsUpdateMoveDocumentHandler = move_docs.UpdateMoveDocumentHandlerFunc(func(params move_docs.UpdateMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.UpdateMoveDocument has not yet been implemented") - }) - } - if api.PpmUpdateMovingExpenseHandler == nil { - api.PpmUpdateMovingExpenseHandler = ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") - }) - } - if api.OktaProfileUpdateOktaInfoHandler == nil { - api.OktaProfileUpdateOktaInfoHandler = okta_profile.UpdateOktaInfoHandlerFunc(func(params okta_profile.UpdateOktaInfoParams) middleware.Responder { - return middleware.NotImplemented("operation okta_profile.UpdateOktaInfo has not yet been implemented") - }) - } - if api.OrdersUpdateOrdersHandler == nil { - api.OrdersUpdateOrdersHandler = orders.UpdateOrdersHandlerFunc(func(params orders.UpdateOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.UpdateOrders has not yet been implemented") - }) - } - if api.PpmUpdateProGearWeightTicketHandler == nil { - api.PpmUpdateProGearWeightTicketHandler = ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") - }) - } - if api.BackupContactsUpdateServiceMemberBackupContactHandler == nil { - api.BackupContactsUpdateServiceMemberBackupContactHandler = backup_contacts.UpdateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.UpdateServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.UpdateServiceMemberBackupContact has not yet been implemented") - }) - } - if api.PpmUpdateWeightTicketHandler == nil { - api.PpmUpdateWeightTicketHandler = ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") - }) - } - if api.MovesUploadAdditionalDocumentsHandler == nil { - api.MovesUploadAdditionalDocumentsHandler = moves.UploadAdditionalDocumentsHandlerFunc(func(params moves.UploadAdditionalDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation moves.UploadAdditionalDocuments has not yet been implemented") - }) - } - if api.OrdersUploadAmendedOrdersHandler == nil { - api.OrdersUploadAmendedOrdersHandler = orders.UploadAmendedOrdersHandlerFunc(func(params orders.UploadAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.UploadAmendedOrders has not yet been implemented") - }) - } - if api.ApplicationParametersValidateHandler == nil { - api.ApplicationParametersValidateHandler = application_parameters.ValidateHandlerFunc(func(params application_parameters.ValidateParams) middleware.Responder { - return middleware.NotImplemented("operation application_parameters.Validate has not yet been implemented") - }) - } - if api.PostalCodesValidatePostalCodeWithRateDataHandler == nil { - api.PostalCodesValidatePostalCodeWithRateDataHandler = postal_codes.ValidatePostalCodeWithRateDataHandlerFunc(func(params postal_codes.ValidatePostalCodeWithRateDataParams) middleware.Responder { - return middleware.NotImplemented("operation postal_codes.ValidatePostalCodeWithRateData has not yet been implemented") - }) - } - if api.FeatureFlagsVariantFeatureFlagForUserHandler == nil { - api.FeatureFlagsVariantFeatureFlagForUserHandler = feature_flags.VariantFeatureFlagForUserHandlerFunc(func(params feature_flags.VariantFeatureFlagForUserParams) middleware.Responder { - return middleware.NotImplemented("operation feature_flags.VariantFeatureFlagForUser has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/internalapi/doc.go b/pkg/gen/internalapi/doc.go deleted file mode 100644 index 463e7be3e81..00000000000 --- a/pkg/gen/internalapi/doc.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package internalapi MilMove Internal API -// -// The Internal API is a RESTful API that enables the Customer application for -// MilMove. -// -// All endpoints are located under `/internal`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /internal -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// - multipart/form-data -// -// Produces: -// - application/pdf -// - application/json -// -// swagger:meta -package internalapi diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go deleted file mode 100644 index 0e198c6c4e6..00000000000 --- a/pkg/gen/internalapi/embedded_spec.go +++ /dev/null @@ -1,17822 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalapi - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "swagger": "2.0", - "info": { - "description": "The Internal API is a RESTful API that enables the Customer application for\nMilMove.\n\nAll endpoints are located under ` + "`" + `/internal` + "`" + `.\n", - "title": "MilMove Internal API", - "contact": { - "email": "ppp@truss.works" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/internal", - "paths": { - "/addresses/zip-city-lookup/{search}": { - "get": { - "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string", - "operationId": "getLocationByZipCityState", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested list of city, state, county, and postal code matches", - "schema": { - "$ref": "#/definitions/VLocations" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/addresses/{addressId}": { - "get": { - "description": "Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns an address", - "operationId": "showAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the address to return", - "name": "addressId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested address", - "schema": { - "$ref": "#/definitions/Address" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/allmoves/{serviceMemberId}": { - "get": { - "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moves" - ], - "summary": "Return the current and previous moves of a service member", - "operationId": "getAllMoves", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/MovesList" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/application_parameters": { - "post": { - "description": "Searches for an application parameter by name and value, returns nil if not found", - "tags": [ - "application_parameters" - ], - "summary": "Searches for an application parameter by name and value, returns nil if not found", - "operationId": "validate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - } - ], - "responses": { - "200": { - "description": "Application Parameters", - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - }, - "/backup_contacts/{backupContactId}": { - "get": { - "description": "Returns the given service member backup contact", - "tags": [ - "backup_contacts" - ], - "summary": "Returns the given service member backup contact", - "operationId": "showServiceMemberBackupContact", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member backup contact", - "name": "backupContactId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "backup contact not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "put": { - "description": "Any fields sent in this request will be set on the backup contact referenced", - "tags": [ - "backup_contacts" - ], - "summary": "Updates a service member backup contact", - "operationId": "updateServiceMemberBackupContact", - "parameters": [ - { - "name": "updateServiceMemberBackupContactPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateServiceMemberBackupContactPayload" - } - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member backup contact", - "name": "backupContactId", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "updated instance of backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "backup contact not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/calendar/available_move_dates": { - "get": { - "description": "Returns available dates for the move calendar", - "tags": [ - "calendar" - ], - "summary": "Returns available dates for the move calendar", - "operationId": "showAvailableMoveDates", - "parameters": [ - { - "type": "string", - "format": "date", - "description": "Look for future available dates starting from (and including) this date", - "name": "startDate", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "List of available dates", - "schema": { - "$ref": "#/definitions/AvailableMoveDates" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/calendar/{countryCode}/is-weekend-holiday/{date}": { - "get": { - "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", - "produces": [ - "application/json" - ], - "tags": [ - "calendar" - ], - "summary": "Validate move date selection", - "operationId": "isDateWeekendHoliday", - "parameters": [ - { - "enum": [ - "US" - ], - "type": "string", - "description": "country code for context of date", - "name": "countryCode", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date", - "description": "input date to determine if weekend/holiday for given country.", - "name": "date", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully determine if given date is weekend and/or holiday for given country.", - "schema": { - "$ref": "#/definitions/IsDateWeekendHolidayInfo" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/documents": { - "post": { - "description": "Documents represent a physical artifact such as a scanned document or a PDF file", - "tags": [ - "documents" - ], - "summary": "Create a new document", - "operationId": "createDocument", - "parameters": [ - { - "name": "documentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDocumentPayload" - } - } - ], - "responses": { - "201": { - "description": "created document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request" - }, - "500": { - "description": "server error" - } - } - } - }, - "/documents/{documentId}": { - "get": { - "description": "Returns a document and its uploads", - "tags": [ - "documents" - ], - "summary": "Returns a document", - "operationId": "showDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to return", - "name": "documentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/duty_locations": { - "get": { - "description": "Returns the duty locations matching the search query", - "tags": [ - "duty_locations" - ], - "summary": "Returns the duty locations matching the search query", - "operationId": "searchDutyLocations", - "parameters": [ - { - "type": "string", - "description": "Search string for duty locations", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the duty location", - "schema": { - "$ref": "#/definitions/DutyLocationsPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "matching duty location not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/duty_locations/{dutyLocationId}/transportation_office": { - "get": { - "description": "Returns the given duty location's transportation office", - "tags": [ - "transportation_offices" - ], - "summary": "Returns the transportation office for a given duty location", - "operationId": "showDutyLocationTransportationOffice", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the duty location", - "name": "dutyLocationId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the transportation office for a duty location", - "schema": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "transportation office not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/entitlements": { - "get": { - "description": "List weight weights allotted by entitlement", - "tags": [ - "entitlements" - ], - "summary": "List weight weights allotted by entitlement", - "operationId": "indexEntitlements", - "responses": { - "200": { - "description": "List of weights allotted entitlement", - "schema": { - "$ref": "#/definitions/IndexEntitlements" - } - } - } - } - }, - "/feature-flags/user-boolean/{key}": { - "post": { - "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "featureFlags" - ], - "summary": "Determines if a user has a feature flag enabled", - "operationId": "booleanFeatureFlagForUser", - "parameters": [ - { - "type": "string", - "description": "Feature Flag Key", - "name": "key", - "in": "path", - "required": true - }, - { - "description": "context for the feature flag request", - "name": "flagContext", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Boolean Feature Flag Status", - "schema": { - "$ref": "#/definitions/FeatureFlagBoolean" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/feature-flags/user-variant/{key}": { - "post": { - "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "featureFlags" - ], - "summary": "Determines if a user has a feature flag enabled", - "operationId": "variantFeatureFlagForUser", - "parameters": [ - { - "type": "string", - "description": "Feature Flag Key", - "name": "key", - "in": "path", - "required": true - }, - { - "description": "context for the feature flag request", - "name": "flagContext", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Variant Feature Flag Status", - "schema": { - "$ref": "#/definitions/FeatureFlagVariant" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/move_documents/{moveDocumentId}": { - "put": { - "description": "Update a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Updates a move document", - "operationId": "updateMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move document model", - "name": "moveDocumentId", - "in": "path", - "required": true - }, - { - "name": "updateMoveDocument", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of move document", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move document not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "delete": { - "description": "Deletes a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Deletes a move document", - "operationId": "deleteMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move document model", - "name": "moveDocumentId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}": { - "get": { - "description": "Returns the given move", - "tags": [ - "moves" - ], - "summary": "Returns the given move", - "operationId": "showMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the move", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move is not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the move referenced", - "tags": [ - "moves" - ], - "summary": "Patches the move", - "operationId": "patchMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "patchMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchMovePayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of move", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move or closeout office is not found" - }, - "412": { - "description": "precondition failed" - }, - "422": { - "description": "unprocessable entity" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/approve": { - "post": { - "description": "Approves the basic details of a move. The status of the move will be updated to APPROVED", - "tags": [ - "office" - ], - "summary": "Approves a move to proceed", - "operationId": "approveMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (approved) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/cancel": { - "post": { - "description": "Cancels the basic details of a move. The status of the move will be updated to CANCELED", - "tags": [ - "office" - ], - "summary": "Cancels a move", - "operationId": "cancelMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (canceled) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to cancel this move" - }, - "409": { - "description": "the move is not in a state to be canceled", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/move_documents": { - "get": { - "description": "Returns a list of all Move Documents associated with this move", - "tags": [ - "move_docs" - ], - "summary": "Returns a list of all Move Documents associated with this move", - "operationId": "indexMoveDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns list of move douments", - "schema": { - "$ref": "#/definitions/MoveDocuments" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - } - } - }, - "post": { - "description": "Created a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Creates a move document", - "operationId": "createGenericMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createGenericMoveDocumentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateGenericMoveDocumentPayload" - } - } - ], - "responses": { - "200": { - "description": "returns new move document object", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to modify this move" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/orders": { - "get": { - "description": "Returns orders information for a move for office use", - "tags": [ - "office" - ], - "summary": "Returns orders information for a move for office use", - "operationId": "showOfficeOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the orders information for a move for office use", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/signed_certifications": { - "get": { - "description": "returns a list of all signed_certifications associated with the move ID", - "tags": [ - "certification" - ], - "summary": "gets the signed certifications for the given move ID", - "operationId": "indexSignedCertification", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns a list of signed certifications", - "schema": { - "$ref": "#/definitions/SignedCertifications" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Create an instance of signed_certification tied to the move ID", - "tags": [ - "certification" - ], - "summary": "Submits signed certification for the given move ID", - "operationId": "createSignedCertification", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move being signed for", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateSignedCertificationPayload" - } - } - ], - "responses": { - "201": { - "description": "created instance of signed_certification", - "schema": { - "$ref": "#/definitions/SignedCertificationPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to sign for this move" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/submit": { - "post": { - "description": "Submits a move for approval by the office. The status of the move will be updated to SUBMITTED", - "tags": [ - "moves" - ], - "summary": "Submits a move for approval", - "operationId": "submitMoveForApproval", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "submitMoveForApprovalPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SubmitMoveForApprovalPayload" - } - } - ], - "responses": { - "200": { - "description": "returns updated (submitted) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/submit_amended_orders": { - "post": { - "description": "Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not.", - "tags": [ - "moves" - ], - "summary": "Submits amended orders for review", - "operationId": "submitAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (submitted) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/uploadAdditionalDocuments": { - "patch": { - "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "moves" - ], - "summary": "Patch the additional documents for a given move", - "operationId": "uploadAdditionalDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "moveId", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/weight_ticket": { - "post": { - "description": "Created a weight ticket document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Creates a weight ticket document", - "operationId": "createWeightTicketDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createWeightTicketDocument", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateWeightTicketDocumentsPayload" - } - } - ], - "responses": { - "200": { - "description": "returns new weight ticket document object", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to modify this move" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveTaskOrderID}/mto_shipments": { - "get": { - "description": "Gets all MTO shipments for the specified Move Task Order.\n", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Gets all shipments for a move task order", - "operationId": "listMTOShipments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved all mto shipments for a move task order.", - "schema": { - "$ref": "#/definitions/MTOShipments" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentId}": { - "delete": { - "description": "Soft deletes a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Soft deletes a shipment by ID", - "operationId": "deleteShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be deleted", - "name": "mtoShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Updates a specified MTO shipment.\n\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* Shipment type is required in body\n\nOptional fields include:\n* New shipment status type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Customer Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the MTO Shipment to update", - "name": "mtoShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the specified MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto_shipments": { - "post": { - "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n\nOptional fields include:\n* Customer Remarks\n* Releasing / Receiving agents\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/okta-profile": { - "get": { - "description": "Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update.", - "produces": [ - "application/json" - ], - "tags": [ - "okta_profile" - ], - "summary": "Returns Okta profile values from Okta's Users API", - "operationId": "showOktaInfo", - "responses": { - "200": { - "description": "okta profile for user", - "schema": { - "$ref": "#/definitions/OktaUserProfileData" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "okta_profile" - ], - "summary": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", - "operationId": "updateOktaInfo", - "parameters": [ - { - "name": "updateOktaUserProfileData", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOktaUserProfileData" - } - } - ], - "responses": { - "200": { - "description": "okta profile for user", - "schema": { - "$ref": "#/definitions/OktaUserProfileData" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "422": { - "description": "validation error", - "schema": { - "$ref": "#/responses/UnprocessableEntity" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders": { - "post": { - "description": "Creates an instance of orders tied to a service member", - "tags": [ - "orders" - ], - "summary": "Creates an orders model for a logged-in user", - "operationId": "createOrders", - "parameters": [ - { - "name": "createOrders", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateUpdateOrders" - } - } - ], - "responses": { - "201": { - "description": "created instance of orders", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{ordersId}": { - "get": { - "description": "Returns the given order", - "tags": [ - "orders" - ], - "summary": "Returns the given order", - "operationId": "showOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "ordersId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the order", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "order is not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "put": { - "description": "All fields sent in this request will be set on the orders referenced", - "tags": [ - "orders" - ], - "summary": "Updates orders", - "operationId": "updateOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the orders model", - "name": "ordersId", - "in": "path", - "required": true - }, - { - "name": "updateOrders", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateUpdateOrders" - } - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "orders not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{ordersId}/upload_amended_orders": { - "patch": { - "description": "Patch the amended orders for a given order", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "orders" - ], - "summary": "Patch the amended orders for a given order", - "operationId": "uploadAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "ordersId", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/aoa-packet": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Downloads AOA Packet form PPMShipment as a PDF", - "operationId": "showAOAPacket", - "responses": { - "200": { - "description": "AOA PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the ppmshipment with aoa to be downloaded", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses": { - "post": { - "description": "Creates a moving expense document for the PPM shipment", - "tags": [ - "ppm" - ], - "summary": "Creates moving expense document", - "operationId": "createMovingExpense", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ], - "responses": { - "201": { - "description": "returns new moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { - "delete": { - "description": "Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a moving expense by ID", - "operationId": "deleteMovingExpense", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the moving expense to be deleted", - "name": "movingExpenseId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the moving expense" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the moving expense referenced", - "tags": [ - "ppm" - ], - "summary": "Updates the moving expense", - "operationId": "updateMovingExpense", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/movingExpenseId" - }, - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "updateMovingExpense", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMovingExpense" - } - } - ], - "responses": { - "200": { - "description": "returns an updated moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/payment-packet": { - "get": { - "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Returns PPM payment packet", - "operationId": "showPaymentPacket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppmShipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "PPM Payment Packet PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets": { - "post": { - "description": "Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a\npro-gear weight ticket. Data should be filled in using the patch endpoint.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Creates a pro-gear weight ticket", - "operationId": "createProGearWeightTicket", - "responses": { - "201": { - "description": "returns a new pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { - "delete": { - "description": "Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a pro-gear weight line item by ID", - "operationId": "deleteProGearWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the pro-gear weight ticket to be deleted", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the pro-gear weight ticket" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a pro-gear weight ticket", - "operationId": "updateProGearWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/proGearWeightTicketId" - }, - { - "name": "updateProGearWeightTicket", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateProGearWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}": { - "put": { - "description": "Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates signature and routes PPM shipment to service counselor", - "operationId": "resubmitPPMShipmentDocumentation", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the signed certification", - "name": "signedCertificationId", - "in": "path", - "required": true - }, - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "savePPMShipmentSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SavePPMShipmentSignedCertification" - } - } - ], - "responses": { - "200": { - "description": "Returns the updated PPM shipment", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation": { - "post": { - "description": "Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Saves signature and routes PPM shipment to service counselor", - "operationId": "submitPPMShipmentDocumentation", - "parameters": [ - { - "name": "savePPMShipmentSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SavePPMShipmentSignedCertification" - } - } - ], - "responses": { - "200": { - "description": "Returns the updated PPM shipment", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "ppm" - ], - "summary": "Create a new upload for a PPM weight ticket, pro-gear, or moving expense document", - "operationId": "createPPMUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppm shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "boolean", - "description": "If the upload is a Weight Receipt", - "name": "weightReceipt", - "in": "query", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "413": { - "description": "payload is too large" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket": { - "post": { - "description": "Created a weight ticket document with the given information", - "tags": [ - "ppm" - ], - "summary": "Creates a weight ticket document", - "operationId": "createWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - } - ], - "responses": { - "200": { - "description": "returns new weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { - "delete": { - "description": "Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database. This may change the PPM shipment's final\nincentive.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a weight ticket by ID", - "operationId": "deleteWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the weight ticket to be deleted", - "name": "weightTicketId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the weight ticket" - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "Updates a weight ticket document with the new information", - "tags": [ - "ppm" - ], - "summary": "Updates a weight ticket document", - "operationId": "updateWeightTicket", - "parameters": [ - { - "$ref": "#/parameters/ppmShipmentId" - }, - { - "$ref": "#/parameters/weightTicketId" - }, - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "updateWeightTicketPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/queues/{queueType}": { - "get": { - "description": "Show all moves in a queue", - "tags": [ - "queues" - ], - "summary": "Show all moves in a queue", - "operationId": "showQueue", - "parameters": [ - { - "enum": [ - "new", - "ppm_payment_requested", - "all", - "ppm_approved", - "ppm_completed" - ], - "type": "string", - "description": "Queue type to show", - "name": "queueType", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "list all moves in the specified queue", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveQueueItem" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to access this queue" - }, - "404": { - "description": "move queue item is not found" - } - } - } - }, - "/rate_engine_postal_codes/{postal_code}": { - "get": { - "description": "Verifies if a zipcode is valid for origin or destination location for a move.", - "tags": [ - "postal_codes" - ], - "summary": "Validate if a zipcode is valid for origin or destination location for a move.", - "operationId": "validatePostalCodeWithRateData", - "parameters": [ - { - "pattern": "^(\\d{5}?)$", - "type": "string", - "format": "zip", - "name": "postal_code", - "in": "path", - "required": true - }, - { - "enum": [ - "origin", - "destination" - ], - "type": "string", - "name": "postal_code_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "postal_code is valid or invalid", - "schema": { - "$ref": "#/definitions/RateEnginePostalCodePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "server error" - } - } - } - }, - "/reimbursement/{reimbursementId}/approve": { - "post": { - "description": "Sets the status of the reimbursement to APPROVED.", - "tags": [ - "office" - ], - "summary": "Approves the reimbursement", - "operationId": "approveReimbursement", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the reimbursement being approved", - "name": "reimbursementId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of reimbursement", - "schema": { - "$ref": "#/definitions/Reimbursement" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members": { - "post": { - "description": "Creates an instance of a service member tied to a user", - "tags": [ - "service_members" - ], - "summary": "Creates service member for a logged-in user", - "operationId": "createServiceMember", - "parameters": [ - { - "name": "createServiceMemberPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateServiceMemberPayload" - } - } - ], - "responses": { - "201": { - "description": "created instance of service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}": { - "get": { - "description": "Returns the given service member", - "tags": [ - "service_members" - ], - "summary": "Returns the given service member", - "operationId": "showServiceMember", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the service member referenced", - "tags": [ - "service_members" - ], - "summary": "Patches the service member", - "operationId": "patchServiceMember", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - }, - { - "name": "patchServiceMemberPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchServiceMemberPayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}/backup_contacts": { - "get": { - "description": "List all service member backup contacts", - "tags": [ - "backup_contacts" - ], - "summary": "List all service member backup contacts", - "operationId": "indexServiceMemberBackupContacts", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "list of service member backup contacts", - "schema": { - "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to see this backup contact" - }, - "404": { - "description": "contact not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Creates an instance of a backup contact tied to a service member user", - "tags": [ - "backup_contacts" - ], - "summary": "Submits backup contact for a logged-in user", - "operationId": "createServiceMemberBackupContact", - "parameters": [ - { - "name": "createBackupContactPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateServiceMemberBackupContactPayload" - } - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "created instance of service member backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to create this backup contact" - }, - "404": { - "description": "contact not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}/current_orders": { - "get": { - "description": "Returns orders", - "tags": [ - "service_members" - ], - "summary": "Returns the latest orders for a given service member", - "operationId": "showServiceMemberOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/transportation-offices": { - "get": { - "description": "Returns the transportation offices matching the search query", - "produces": [ - "application/json" - ], - "tags": [ - "transportation_offices" - ], - "summary": "Returns the transportation offices matching the search query", - "operationId": "getTransportationOffices", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/transportation_offices/{dutyLocationId}/counseling_offices": { - "get": { - "description": "Returns the counseling locations matching the GBLOC from the selected duty location", - "produces": [ - "application/json" - ], - "tags": [ - "transportation_offices" - ], - "summary": "Returns the counseling locations in the GBLOC matching the duty location", - "operationId": "showCounselingOffices", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the duty location", - "name": "dutyLocationId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the counseling office for a duty location", - "schema": { - "$ref": "#/definitions/CounselingOffices" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "uploads" - ], - "summary": "Create a new upload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query" - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - }, - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes a collection of uploads", - "operationId": "deleteUploads", - "parameters": [ - { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "description": "Array of UUIDs to be deleted", - "name": "uploadIds", - "in": "query", - "required": true - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadId}": { - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes an upload", - "operationId": "deleteUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be deleted", - "name": "uploadId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the order that the upload belongs to", - "name": "orderId", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Optional ID of the move that the upload belongs to", - "name": "moveId", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Optional PPM shipment ID related to the upload", - "name": "ppmId", - "in": "query" - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/is_logged_in": { - "get": { - "description": "Returns boolean as to whether the user is logged in", - "tags": [ - "users" - ], - "summary": "Returns boolean as to whether the user is logged in", - "operationId": "isLoggedInUser", - "responses": { - "200": { - "description": "Currently logged in user", - "schema": { - "type": "object", - "required": [ - "isLoggedIn" - ], - "properties": { - "isLoggedIn": { - "type": "boolean" - } - } - } - }, - "400": { - "description": "invalid request" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/logged_in": { - "get": { - "description": "Returns the user info for the currently logged in user", - "tags": [ - "users" - ], - "summary": "Returns the user info for the currently logged in user", - "operationId": "showLoggedInUser", - "responses": { - "200": { - "description": "Currently logged in user", - "schema": { - "$ref": "#/definitions/LoggedInUserPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Affiliation": { - "description": "Military branch of service", - "type": "string", - "title": "Branch of service", - "enum": [ - "ARMY", - "NAVY", - "MARINES", - "AIR_FORCE", - "COAST_GUARD", - "SPACE_FORCE", - "OTHER" - ], - "x-display-value": { - "AIR_FORCE": "Air Force", - "ARMY": "Army", - "COAST_GUARD": "Coast Guard", - "MARINES": "Marine Corps", - "NAVY": "Navy", - "OTHER": "OTHER", - "SPACE_FORCE": "Space Force" - }, - "x-nullable": true - }, - "ApplicationParameters": { - "type": "object", - "properties": { - "parameterName": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "parameterValue": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "validationCode": { - "type": "string", - "format": "string", - "x-nullable": true - } - } - }, - "AvailableMoveDates": { - "type": "object", - "required": [ - "start_date", - "available" - ], - "properties": { - "available": { - "type": "array", - "items": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } - }, - "start_date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } - } - }, - "BackupContactPermission": { - "type": "string", - "title": "Permissions", - "enum": [ - "NONE", - "VIEW", - "EDIT" - ], - "x-display-value": { - "EDIT": "View and edit all move details", - "NONE": "Contact Only", - "VIEW": "View all move details" - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "CancelMove": { - "type": "object", - "required": [ - "cancel_reason" - ], - "properties": { - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CounselingOffice": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "CounselingOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/CounselingOffice" - } - }, - "CreateBoatShipment": { - "description": "Boat shipment information for the move.", - "required": [ - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateGenericMoveDocumentPayload": { - "type": "object", - "required": [ - "upload_ids", - "title", - "move_document_type" - ], - "properties": { - "move_document_type": { - "$ref": "#/definitions/MoveDocumentType" - }, - "notes": { - "type": "string", - "title": "Notes", - "x-nullable": true, - "example": "This document is good to go!" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "title": { - "type": "string", - "example": "very_useful_document.pdf" - }, - "upload_ids": { - "type": "array", - "items": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - } - }, - "CreateMobileHomeShipment": { - "description": "A mobile home shipment that the prime moves for a service member.", - "required": [ - "make", - "model", - "year", - "lengthInInches", - "heightInInches", - "widthInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "A personally procured move is a type of shipment that a service members moves themselves.", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected" - ], - "properties": { - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date" - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Denotes if this PPM shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "sitExpected": { - "type": "boolean" - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "CreateServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "name", - "email", - "permission" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "title": "Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@exmaple.com" - }, - "name": { - "type": "string", - "title": "Name", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - } - } - }, - "CreateServiceMemberPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "current_location_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Phone", - "x-nullable": true - }, - "residential_address": { - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Alternate phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "CreateShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date" - }, - "requestedPickupDate": { - "type": "string", - "format": "date" - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "CreateSignedCertificationPayload": { - "type": "object", - "required": [ - "date", - "signature", - "certification_text" - ], - "properties": { - "certification_text": { - "type": "string" - }, - "certification_type": { - "$ref": "#/definitions/SignedCertificationTypeCreate" - }, - "date": { - "type": "string", - "format": "date-time", - "title": "Date" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "ppm_id": { - "$ref": "#/definitions/PpmID" - }, - "signature": { - "type": "string", - "title": "Signature" - } - } - }, - "CreateUpdateOrders": { - "type": "object", - "required": [ - "service_member_id", - "issue_date", - "report_by_date", - "orders_type", - "has_dependents", - "spouse_has_pro_gear", - "new_duty_location_id" - ], - "properties": { - "accompanied_tour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "counseling_office_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" - }, - "department_indicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "dependents_twelve_and_over": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependents_under_twelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "issue_date": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "move_id": { - "type": "string", - "format": "uuid", - "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" - }, - "new_duty_location_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orders_number": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "orders_type_detail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "origin_duty_location_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "report_by_date": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreateWeightTicketDocumentsPayload": { - "type": "object", - "required": [ - "personally_procured_move_id", - "weight_ticket_set_type", - "full_weight_ticket_missing", - "empty_weight_ticket_missing", - "trailer_ownership_missing" - ], - "properties": { - "empty_weight": { - "type": "integer", - "title": "empty weight ticket recorded weight" - }, - "empty_weight_ticket_missing": { - "type": "boolean", - "title": "missing empty weight ticket" - }, - "full_weight": { - "type": "integer", - "title": "full weight ticket recorded weight" - }, - "full_weight_ticket_missing": { - "type": "boolean", - "title": "missing full weight ticket" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "trailer_ownership_missing": { - "type": "boolean", - "title": "missing trailer ownership documentation" - }, - "upload_ids": { - "type": "array", - "items": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - }, - "vehicle_make": { - "type": "string", - "title": "Vehicle make", - "x-nullable": true - }, - "vehicle_model": { - "type": "string", - "title": "Vehicle model", - "x-nullable": true - }, - "vehicle_nickname": { - "type": "string", - "title": "Vehicle nickname (ex. 'Large box truck')", - "x-nullable": true - }, - "weight_ticket_date": { - "type": "string", - "format": "date", - "title": "Full Weight Ticket Date", - "x-nullable": true, - "example": "2018-04-26" - }, - "weight_ticket_set_type": { - "$ref": "#/definitions/WeightTicketSetType" - } - } - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "Document": { - "type": "object", - "required": [ - "id", - "service_member_id", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "DutyLocationPayload": { - "type": "object", - "required": [ - "id", - "name", - "address_id", - "affiliation", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "address_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "provides_services_counseling": { - "type": "boolean", - "x-nullable": false - }, - "transportation_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportation_office_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "DutyLocationsPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/DutyLocationPayload" - } - }, - "Entitlement": { - "type": "object", - "properties": { - "accompanied_tour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "dependents_twelve_and_over": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependents_under_twelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "proGear": { - "description": "Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "proGearSpouse": { - "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", - "type": "integer", - "x-nullable": true, - "example": 500 - }, - "ub_allowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "FeatureFlagBoolean": { - "description": "A feature flag", - "type": "object", - "required": [ - "entity", - "key", - "match", - "namespace" - ], - "properties": { - "entity": { - "type": "string", - "example": "11111111-1111-1111-1111-111111111111" - }, - "key": { - "type": "string", - "example": "flag" - }, - "match": { - "type": "boolean", - "example": true - }, - "namespace": { - "type": "string", - "example": "test" - } - } - }, - "FeatureFlagVariant": { - "description": "A feature flag", - "type": "object", - "required": [ - "entity", - "key", - "match", - "variant", - "namespace" - ], - "properties": { - "entity": { - "type": "string", - "example": "11111111-1111-1111-1111-111111111111" - }, - "key": { - "type": "string", - "example": "flag" - }, - "match": { - "type": "boolean", - "example": true - }, - "namespace": { - "type": "string", - "example": "test" - }, - "variant": { - "type": "string", - "example": "myval" - } - } - }, - "IndexEntitlements": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/WeightAllotment" - } - }, - "IndexMovesPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/MovePayload" - } - }, - "IndexServiceMemberBackupContactsPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "InternalMove": { - "type": "object", - "properties": { - "closeoutOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "counselingOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orders": { - "type": "object" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "status": { - "type": "string", - "readOnly": true - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "InvalidRequestResponsePayload": { - "type": "object", - "properties": { - "errors": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "IsDateWeekendHolidayInfo": { - "type": "object", - "required": [ - "country_code", - "country_name", - "date", - "is_weekend", - "is_holiday" - ], - "properties": { - "country_code": { - "type": "string" - }, - "country_name": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - }, - "details": { - "type": "string" - }, - "is_holiday": { - "type": "boolean" - }, - "is_weekend": { - "type": "boolean" - } - } - }, - "LoggedInUserPayload": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "readOnly": true, - "example": "john_bob@example.com" - }, - "first_name": { - "type": "string", - "readOnly": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "office_user": { - "$ref": "#/definitions/OfficeUser" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - } - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/Privilege" - } - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - }, - "x-nullable": true - }, - "service_member": { - "$ref": "#/definitions/ServiceMemberPayload" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "type": "string", - "title": "MTO Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOShipment": { - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentLocator": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "1K43AR-01" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentStatus": { - "type": "string", - "enum": [ - "DRAFT", - "APPROVED", - "SUBMITTED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MethodOfReceipt": { - "type": "string", - "title": "Method of Receipt", - "enum": [ - "MIL_PAY", - "OTHER_DD", - "GTCC" - ], - "x-display-value": { - "GTCC": "GTCC", - "MIL_PAY": "MilPay", - "OTHER_DD": "Other account" - }, - "x-nullable": true - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "MoveDocumentPayload": { - "type": "object", - "required": [ - "id", - "move_id", - "document", - "title", - "move_document_type", - "status" - ], - "properties": { - "document": { - "$ref": "#/definitions/Document" - }, - "empty_weight": { - "type": "integer", - "title": "Empty weight", - "x-formatting": "weight", - "x-nullable": true - }, - "empty_weight_ticket_missing": { - "type": "boolean", - "title": "missing empty weight ticket", - "x-nullable": true - }, - "full_weight": { - "type": "integer", - "title": "Full weight", - "x-formatting": "weight", - "x-nullable": true - }, - "full_weight_ticket_missing": { - "type": "boolean", - "title": "missing full weight ticket", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "move_document_type": { - "$ref": "#/definitions/MoveDocumentType" - }, - "move_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moving_expense_type": { - "$ref": "#/definitions/MovingExpenseType" - }, - "notes": { - "type": "string", - "title": "Notes", - "x-nullable": true, - "example": "This document is good to go!" - }, - "payment_method": { - "type": "string", - "title": "Payment Method", - "enum": [ - "OTHER", - "GTCC" - ], - "x-display-value": { - "GTCC": "GTCC", - "OTHER": "Other account" - } - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "receipt_missing": { - "type": "boolean", - "title": "missing expense receipt", - "x-nullable": true - }, - "requested_amount_cents": { - "description": "unit is cents", - "type": "integer", - "format": "cents", - "title": "Requested Amount", - "minimum": 1 - }, - "status": { - "$ref": "#/definitions/MoveDocumentStatus" - }, - "storage_end_date": { - "type": "string", - "format": "date", - "title": "End date of storage for storage expenses", - "x-nullable": true, - "example": "2018-04-26" - }, - "storage_start_date": { - "type": "string", - "format": "date", - "title": "Start date of storage for storage expenses", - "x-nullable": true, - "example": "2018-04-26" - }, - "title": { - "type": "string", - "title": "Document title", - "example": "very_useful_document.pdf" - }, - "trailer_ownership_missing": { - "type": "boolean", - "title": "missing trailer ownership documentation", - "x-nullable": true - }, - "vehicle_make": { - "type": "string", - "title": "Vehicle make", - "x-nullable": true - }, - "vehicle_model": { - "type": "string", - "title": "Vehicle model", - "x-nullable": true - }, - "vehicle_nickname": { - "type": "string", - "title": "Nickname (ex. \"15-foot truck\")", - "x-nullable": true - }, - "weight_ticket_date": { - "type": "string", - "format": "date", - "title": "Weight ticket date", - "x-nullable": true, - "example": "2018-04-26" - }, - "weight_ticket_set_type": { - "$ref": "#/definitions/WeightTicketSetType" - } - } - }, - "MoveDocumentStatus": { - "type": "string", - "title": "Document status", - "enum": [ - "AWAITING_REVIEW", - "OK", - "HAS_ISSUE", - "EXCLUDE_FROM_CALCULATION" - ], - "x-display-value": { - "AWAITING_REVIEW": "Awaiting review", - "EXCLUDE_FROM_CALCULATION": "Exclude from calculation", - "HAS_ISSUE": "Has issue", - "OK": "OK" - } - }, - "MoveDocumentType": { - "type": "string", - "title": "Document type", - "enum": [ - "OTHER", - "WEIGHT_TICKET", - "STORAGE_EXPENSE", - "SHIPMENT_SUMMARY", - "EXPENSE", - "WEIGHT_TICKET_SET" - ], - "x-display-value": { - "EXPENSE": "Expense", - "OTHER": "Other document type", - "SHIPMENT_SUMMARY": "Shipment summary", - "STORAGE_EXPENSE": "Storage expense receipt", - "WEIGHT_TICKET": "Weight ticket", - "WEIGHT_TICKET_SET": "Weight ticket set" - }, - "example": "EXPENSE" - }, - "MoveDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "MovePayload": { - "type": "object", - "required": [ - "id", - "orders_id", - "locator", - "created_at", - "updated_at", - "eTag" - ], - "properties": { - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - }, - "closeout_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "counseling_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "mto_shipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submitted_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveQueueItem": { - "type": "object", - "required": [ - "id", - "status", - "locator", - "customer_name", - "edipi", - "grade", - "orders_type", - "branch_of_service", - "last_modified_date", - "created_at" - ], - "properties": { - "actual_move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "branch_of_service": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "customer_name": { - "type": "string", - "title": "Customer Name", - "example": "Thedog, Nino" - }, - "delivered_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "destination_duty_location_name": { - "type": "string", - "title": "Destination", - "x-nullable": true, - "example": "Dover AFB" - }, - "destination_gbloc": { - "type": "string", - "title": "Destination GBLOC", - "x-nullable": true, - "example": "LKNQ" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID #", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "example": "5789345789" - }, - "gbl_number": { - "type": "string", - "title": "GBL Number", - "x-nullable": true, - "example": "LNK12345" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "hhg_status": { - "type": "string", - "x-nullable": true, - "example": "ACCEPTED" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "invoice_approved_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "last_modified_date": { - "type": "string", - "format": "date-time", - "example": "2017-07-21T17:32:28Z" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "origin_duty_location_name": { - "type": "string", - "title": "Origin", - "x-nullable": true, - "example": "Dover AFB" - }, - "origin_gbloc": { - "type": "string", - "title": "Origin GBLOC", - "x-nullable": true, - "example": "LKNQ" - }, - "original_move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "pm_survey_conducted_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "ppm_status": { - "type": "string", - "x-nullable": true, - "example": "PAYMENT_REQUESTED" - }, - "status": { - "type": "string", - "example": "APPROVED" - }, - "submitted_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2018-04-25" - }, - "weight_allotment": { - "$ref": "#/definitions/WeightAllotment" - } - } - }, - "MoveStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED", - "NEEDS SERVICE COUNSELING", - "APPROVALS REQUESTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MovesList": { - "type": "object", - "properties": { - "currentMove": { - "type": "array", - "items": { - "$ref": "#/definitions/InternalMove" - } - }, - "previousMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/InternalMove" - } - } - } - }, - "MovingExpense": { - "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "ppmShipmentId", - "documentId", - "document" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp the moving expense object was initially created in the system (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "A brief description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "The Document object that contains all file uploads for this expense" - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The id of the Document that contains all file uploads for this expense", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "Unique primary identifier of the Moving Expense object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingReceipt": { - "description": "Indicates if the service member is missing the receipt with the proof of expense amount", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "paidWithGtcc": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The PPM Shipment id that this moving expense belongs to", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedAmount": { - "description": "Customer submitted total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedDescription": { - "description": "Customer submitted description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "submittedMovingExpenseType": { - "$ref": "#/definitions/SubmittedMovingExpenseType" - }, - "submittedSitEndDate": { - "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "submittedSitStartDate": { - "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "updatedAt": { - "description": "Timestamp when a property of this moving expense object was last modified (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "MovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - } - }, - "NullableSignedCertificationType": { - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PPM", - "HHG" - ], - "x-nullable": true - }, - "OfficeUser": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "email": { - "type": "string", - "format": "x-email", - "title": "Personal Email Address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportation_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportation_office_assignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OktaUserProfileData": { - "type": "object", - "properties": { - "cac_edipi": { - "type": "string", - "maxLength": 10, - "x-nullable": true, - "example": "1234567890" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "user@email.com" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "login": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "user@email.com" - }, - "sub": { - "type": "string", - "format": "string", - "example": "1duekdue9ekrjghf" - } - } - }, - "OmittableMovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OmittablePPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OrderPayGrade": { - "type": "string", - "title": "Grade", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ], - "x-display-value": { - "ACADEMY_CADET": "Service Academy Cadet", - "AVIATION_CADET": "Aviation Cadet", - "CIVILIAN_EMPLOYEE": "Civilian Employee", - "E_1": "E-1", - "E_2": "E-2", - "E_3": "E-3", - "E_4": "E-4", - "E_5": "E-5", - "E_6": "E-6", - "E_7": "E-7", - "E_8": "E-8", - "E_9": "E-9", - "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", - "MIDSHIPMAN": "Midshipman", - "O_10": "O-10", - "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", - "O_2": "O-2", - "O_3": "O-3", - "O_4": "O-4", - "O_5": "O-5", - "O_6": "O-6", - "O_7": "O-7", - "O_8": "O-8", - "O_9": "O-9", - "W_1": "W-1", - "W_2": "W-2", - "W_3": "W-3", - "W_4": "W-4", - "W_5": "W-5" - }, - "x-nullable": true - }, - "Orders": { - "type": "object", - "required": [ - "id", - "service_member_id", - "issue_date", - "report_by_date", - "orders_type", - "has_dependents", - "spouse_has_pro_gear", - "new_duty_location", - "uploaded_orders", - "created_at", - "updated_at" - ], - "properties": { - "authorizedWeight": { - "type": "integer", - "x-nullable": true, - "example": 7000 - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "department_indicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "entitlement": { - "$ref": "#/definitions/Entitlement" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "issue_date": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Date issued", - "example": "2018-04-26" - }, - "moves": { - "$ref": "#/definitions/IndexMovesPayload" - }, - "new_duty_location": { - "$ref": "#/definitions/DutyLocationPayload" - }, - "orders_number": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "orders_type_detail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationGbloc": { - "type": "string", - "title": "From what GBLOC do your orders originate?", - "x-nullable": true - }, - "origin_duty_location": { - "x-nullable": true, - "$ref": "#/definitions/DutyLocationPayload" - }, - "providesServicesCounseling": { - "type": "boolean", - "x-omitempty": false - }, - "report_by_date": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report by", - "example": "2018-04-26" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "status": { - "$ref": "#/definitions/OrdersStatus" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "uploaded_amended_orders": { - "$ref": "#/definitions/Document" - }, - "uploaded_amended_orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploaded_orders": { - "$ref": "#/definitions/Document" - } - } - }, - "OrdersStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PPMAdvanceStatus": { - "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", - "type": "string", - "title": "PPM Advance Status", - "enum": [ - "APPROVED", - "REJECTED", - "EDITED", - "RECEIVED", - "NOT_RECEIVED" - ], - "x-nullable": true - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMDocumentStatusReason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "PPMEstimateRange": { - "type": "object", - "required": [ - "range_min", - "range_max" - ], - "properties": { - "range_max": { - "type": "integer", - "title": "High estimate" - }, - "range_min": { - "type": "integer", - "title": "Low estimate" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4300 - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date" - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PatchMovePayload": { - "type": "object", - "required": [ - "closeoutOfficeId" - ], - "properties": { - "closeoutOfficeId": { - "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", - "type": "string", - "format": "uuid" - } - } - }, - "PatchServiceMemberPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "current_location_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "emplid": { - "type": "string", - "title": "USCG EMPLID", - "maxLength": 7, - "minLength": 7, - "pattern": "^\\d{7}$", - "x-nullable": true, - "example": "5789345" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Phone", - "x-nullable": true - }, - "residential_address": { - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Alternate Phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best Contact Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PostDocumentPayload": { - "type": "object", - "properties": { - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - } - } - }, - "PpmID": { - "description": "The PPM Shipment ID to associate with the assigned certificate.\n", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "Privilege": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "privilegeName": { - "type": "string", - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "example": "supervisor" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ProGearWeightTicket": { - "description": "Pro-gear associated information and weight docs for a PPM shipment", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "documentId", - "document" - ], - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the pro-gear weight." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the pro-gear weight ticket.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedBelongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedHasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedWeight": { - "description": "Customer submitted weight of the pro-gear.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weight": { - "description": "Weight of the pro-gear.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "RateEnginePostalCodePayload": { - "type": "object", - "required": [ - "valid", - "postal_code", - "postal_code_type" - ], - "properties": { - "postal_code": { - "description": "zip code, international allowed", - "type": "string", - "format": "zip", - "title": "ZIP", - "example": "'90210' or 'N15 3NL'" - }, - "postal_code_type": { - "type": "string", - "enum": [ - "origin", - "destination" - ] - }, - "valid": { - "type": "boolean", - "example": false - } - } - }, - "Reimbursement": { - "type": "object", - "required": [ - "requested_amount", - "method_of_receipt" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "method_of_receipt": { - "$ref": "#/definitions/MethodOfReceipt" - }, - "requested_amount": { - "description": "unit is cents", - "type": "integer", - "format": "cents", - "title": "Requested Amount", - "minimum": 1 - }, - "requested_date": { - "type": "string", - "format": "date", - "title": "Requested Date", - "x-nullable": true, - "example": "2018-04-26" - }, - "status": { - "$ref": "#/definitions/ReimbursementStatus" - } - }, - "x-nullable": true - }, - "ReimbursementStatus": { - "type": "string", - "title": "Reimbursement", - "enum": [ - "DRAFT", - "REQUESTED", - "APPROVED", - "REJECTED", - "PAID" - ], - "x-nullable": true - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "SavePPMShipmentSignedCertification": { - "type": "object", - "required": [ - "certification_text", - "signature", - "date" - ], - "properties": { - "certification_text": { - "description": "Text that the customer is agreeing to and signing.", - "type": "string" - }, - "date": { - "description": "Date of signature", - "type": "string", - "format": "date" - }, - "signature": { - "description": "Customer signature", - "type": "string" - } - } - }, - "ServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "id", - "created_at", - "updated_at", - "name", - "email", - "permission" - ], - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "email": { - "type": "string", - "format": "x-email", - "title": "Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "title": "Name", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "ServiceMemberPayload": { - "type": "object", - "required": [ - "id", - "user_id", - "is_profile_complete", - "created_at", - "updated_at" - ], - "properties": { - "affiliation": { - "title": "Branch", - "$ref": "#/definitions/Affiliation" - }, - "backup_contacts": { - "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "cac_validated": { - "type": "boolean" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "emplid": { - "type": "string", - "title": "USCG EMPLID", - "maxLength": 7, - "minLength": 7, - "pattern": "^\\d{7}$", - "x-nullable": true, - "example": "5789345" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "grade": { - "title": "Grade", - "$ref": "#/definitions/OrderPayGrade" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "is_profile_complete": { - "type": "boolean" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "orders": { - "type": "array", - "items": { - "$ref": "#/definitions/Orders" - } - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal Email Address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Telephone", - "x-nullable": true - }, - "residential_address": { - "title": "Residential Address", - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Secondary Phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "weight_allotment": { - "$ref": "#/definitions/WeightAllotment" - } - } - }, - "SignedCertification": { - "description": "Signed certification", - "type": "object", - "required": [ - "id", - "submittingUserId", - "moveId", - "certificationType", - "certificationText", - "signature", - "date", - "createdAt", - "updatedAt", - "eTag" - ], - "properties": { - "certificationText": { - "description": "Full text that the customer agreed to and signed.", - "type": "string" - }, - "certificationType": { - "$ref": "#/definitions/SignedCertificationType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "date": { - "description": "Date that the customer signed the certification.", - "type": "string", - "format": "date" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveId": { - "description": "The ID of the move associated with this signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmId": { - "description": "The ID of the PPM shipment associated with this signed certification, if any.", - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "signature": { - "description": "The signature that the customer provided.", - "type": "string" - }, - "submittingUserId": { - "description": "The ID of the user that signed.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SignedCertificationPayload": { - "type": "object", - "required": [ - "id", - "move_id", - "created_at", - "updated_at", - "date", - "signature", - "certification_text" - ], - "properties": { - "certification_text": { - "type": "string" - }, - "certification_type": { - "$ref": "#/definitions/NullableSignedCertificationType" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "date": { - "type": "string", - "format": "date-time", - "title": "Date" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "move_id": { - "type": "string", - "format": "uuid" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "ppm_id": { - "$ref": "#/definitions/PpmID" - }, - "signature": { - "type": "string", - "title": "Signature" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "SignedCertificationType": { - "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "readOnly": true - }, - "SignedCertificationTypeCreate": { - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "x-nullable": true - }, - "SignedCertifications": { - "type": "array", - "items": { - "$ref": "#/definitions/SignedCertificationPayload" - } - }, - "SubmitMoveForApprovalPayload": { - "type": "object", - "properties": { - "certificate": { - "$ref": "#/definitions/CreateSignedCertificationPayload" - } - } - }, - "SubmittedMovingExpenseType": { - "description": "Customer Submitted Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phone_lines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "required": [ - "officeUserId", - "transportationOfficeId", - "primaryOffice" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "UpdateBoatShipment": { - "type": "object", - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean", - "x-nullable": true - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ], - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMobileHomeShipment": { - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string", - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMovingExpense": { - "type": "object", - "required": [ - "movingExpenseType", - "description", - "paidWithGTCC", - "amount", - "missingReceipt" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer" - }, - "description": { - "description": "A brief description of the expense", - "type": "string" - }, - "missingReceipt": { - "description": "Indicates if the customer is missing the receipt for their expense.", - "type": "boolean" - }, - "movingExpenseType": { - "$ref": "#/definitions/MovingExpenseType" - }, - "paidWithGTCC": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer" - } - } - }, - "UpdateOktaUserProfileData": { - "type": "object", - "properties": { - "profile": { - "$ref": "#/definitions/OktaUserProfileData" - } - } - }, - "UpdatePPMShipment": { - "type": "object", - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "actualMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceAmountRequested": { - "description": "The amount requested for an advance, or null if no advance is requested\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "estimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean", - "x-nullable": true - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "sitExpected": { - "type": "boolean", - "x-nullable": true - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - } - } - }, - "UpdateProGearWeightTicket": { - "type": "object", - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean" - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string" - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean" - }, - "weight": { - "description": "Weight of the vehicle not including the pro-gear.", - "type": "integer" - } - } - }, - "UpdateServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "name", - "email", - "permission" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "title": "email address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - } - } - }, - "UpdateShipment": { - "type": "object", - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/UpdateBoatShipment" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/UpdateMobileHomeShipment" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UpdateWeightTicket": { - "type": "object", - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer" - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer" - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean" - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean" - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string" - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean" - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean" - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string" - } - } - }, - "Upload": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "id", - "url", - "filename", - "contentType", - "bytes", - "createdAt", - "updatedAt" - ], - "properties": { - "bytes": { - "type": "integer", - "readOnly": true - }, - "contentType": { - "type": "string", - "format": "mime-type", - "readOnly": true, - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "filename": { - "type": "string", - "readOnly": true, - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isWeightTicket": { - "type": "boolean" - }, - "rotation": { - "type": "integer", - "example": 2 - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ], - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "uploadType": { - "type": "string", - "enum": [ - "USER", - "PRIME", - "OFFICE" - ], - "readOnly": true, - "example": "OFFICE" - }, - "url": { - "type": "string", - "format": "uri", - "readOnly": true, - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocation": { - "description": "A postal code, city, and state lookup", - "type": "object", - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocations": { - "type": "array", - "items": { - "$ref": "#/definitions/VLocation" - } - }, - "ValidationError": { - "required": [ - "invalidFields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object" - } - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "WeightAllotment": { - "type": "object", - "required": [ - "total_weight_self", - "total_weight_self_plus_dependents", - "pro_gear_weight", - "pro_gear_weight_spouse" - ], - "properties": { - "pro_gear_weight": { - "type": "integer", - "example": 2000 - }, - "pro_gear_weight_spouse": { - "type": "integer", - "example": 500 - }, - "total_weight_self": { - "type": "integer", - "example": 18000 - }, - "total_weight_self_plus_dependents": { - "type": "integer", - "example": 18000 - } - } - }, - "WeightTicket": { - "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "emptyDocumentId", - "emptyDocument", - "fullDocument", - "fullDocumentId", - "proofOfTrailerOwnershipDocument", - "proofOfTrailerOwnershipDocumentId" - ], - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "emptyDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when empty." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "emptyDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", - "type": "string", - "format": "uuid", - "readOnly": true - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "fullDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when full." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "fullDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "ID of this set of weight tickets.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this set of weight tickets is for.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "proofOfTrailerOwnershipDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the proof of trailer ownership." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "proofOfTrailerOwnershipDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedEmptyWeight": { - "description": "Customer submitted weight of the vehicle when empty.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedFullWeight": { - "description": "Customer submitted weight of the vehicle when full.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedOwnsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedTrailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "WeightTicketSetType": { - "type": "string", - "title": "Select weight ticket type", - "enum": [ - "CAR", - "CAR_TRAILER", - "BOX_TRUCK", - "PRO_GEAR" - ], - "x-display-value": { - "BOX_TRUCK": "Box truck", - "CAR": "Car", - "CAR_TRAILER": "Car + Trailer", - "PRO_GEAR": "Pro-gear" - }, - "x-nullable": true - }, - "WeightTickets": { - "description": "All weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/WeightTicket" - }, - "x-omitempty": false - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - "movingExpenseId": { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - }, - "ppmShipmentId": { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - "proGearWeightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - }, - "weightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "name": "responses" - }, - { - "name": "orders" - }, - { - "name": "certification" - }, - { - "name": "moves" - }, - { - "name": "office" - }, - { - "name": "documents" - }, - { - "name": "uploads" - }, - { - "name": "service_members" - }, - { - "name": "backup_contacts" - }, - { - "name": "duty_locations" - }, - { - "name": "transportation_offices" - }, - { - "name": "queues" - }, - { - "name": "entitlements" - }, - { - "name": "calendar" - }, - { - "name": "move_docs" - }, - { - "name": "ppm" - }, - { - "name": "postal_codes" - }, - { - "name": "addresses" - }, - { - "name": "mtoShipment" - }, - { - "name": "featureFlags" - }, - { - "name": "okta_profile" - }, - { - "name": "application_parameters" - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "swagger": "2.0", - "info": { - "description": "The Internal API is a RESTful API that enables the Customer application for\nMilMove.\n\nAll endpoints are located under ` + "`" + `/internal` + "`" + `.\n", - "title": "MilMove Internal API", - "contact": { - "email": "ppp@truss.works" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/internal", - "paths": { - "/addresses/zip-city-lookup/{search}": { - "get": { - "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string", - "operationId": "getLocationByZipCityState", - "parameters": [ - { - "type": "string", - "name": "search", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested list of city, state, county, and postal code matches", - "schema": { - "$ref": "#/definitions/VLocations" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/addresses/{addressId}": { - "get": { - "description": "Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code.", - "tags": [ - "addresses" - ], - "summary": "Returns an address", - "operationId": "showAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the address to return", - "name": "addressId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested address", - "schema": { - "$ref": "#/definitions/Address" - } - }, - "400": { - "description": "invalid request" - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/allmoves/{serviceMemberId}": { - "get": { - "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moves" - ], - "summary": "Return the current and previous moves of a service member", - "operationId": "getAllMoves", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/MovesList" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/application_parameters": { - "post": { - "description": "Searches for an application parameter by name and value, returns nil if not found", - "tags": [ - "application_parameters" - ], - "summary": "Searches for an application parameter by name and value, returns nil if not found", - "operationId": "validate", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - } - ], - "responses": { - "200": { - "description": "Application Parameters", - "schema": { - "$ref": "#/definitions/ApplicationParameters" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - }, - "/backup_contacts/{backupContactId}": { - "get": { - "description": "Returns the given service member backup contact", - "tags": [ - "backup_contacts" - ], - "summary": "Returns the given service member backup contact", - "operationId": "showServiceMemberBackupContact", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member backup contact", - "name": "backupContactId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "backup contact not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "put": { - "description": "Any fields sent in this request will be set on the backup contact referenced", - "tags": [ - "backup_contacts" - ], - "summary": "Updates a service member backup contact", - "operationId": "updateServiceMemberBackupContact", - "parameters": [ - { - "name": "updateServiceMemberBackupContactPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateServiceMemberBackupContactPayload" - } - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member backup contact", - "name": "backupContactId", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "updated instance of backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "backup contact not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/calendar/available_move_dates": { - "get": { - "description": "Returns available dates for the move calendar", - "tags": [ - "calendar" - ], - "summary": "Returns available dates for the move calendar", - "operationId": "showAvailableMoveDates", - "parameters": [ - { - "type": "string", - "format": "date", - "description": "Look for future available dates starting from (and including) this date", - "name": "startDate", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "List of available dates", - "schema": { - "$ref": "#/definitions/AvailableMoveDates" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/calendar/{countryCode}/is-weekend-holiday/{date}": { - "get": { - "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", - "produces": [ - "application/json" - ], - "tags": [ - "calendar" - ], - "summary": "Validate move date selection", - "operationId": "isDateWeekendHoliday", - "parameters": [ - { - "enum": [ - "US" - ], - "type": "string", - "description": "country code for context of date", - "name": "countryCode", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "date", - "description": "input date to determine if weekend/holiday for given country.", - "name": "date", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully determine if given date is weekend and/or holiday for given country.", - "schema": { - "$ref": "#/definitions/IsDateWeekendHolidayInfo" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/documents": { - "post": { - "description": "Documents represent a physical artifact such as a scanned document or a PDF file", - "tags": [ - "documents" - ], - "summary": "Create a new document", - "operationId": "createDocument", - "parameters": [ - { - "name": "documentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PostDocumentPayload" - } - } - ], - "responses": { - "201": { - "description": "created document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request" - }, - "500": { - "description": "server error" - } - } - } - }, - "/documents/{documentId}": { - "get": { - "description": "Returns a document and its uploads", - "tags": [ - "documents" - ], - "summary": "Returns a document", - "operationId": "showDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to return", - "name": "documentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the requested document", - "schema": { - "$ref": "#/definitions/Document" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/duty_locations": { - "get": { - "description": "Returns the duty locations matching the search query", - "tags": [ - "duty_locations" - ], - "summary": "Returns the duty locations matching the search query", - "operationId": "searchDutyLocations", - "parameters": [ - { - "type": "string", - "description": "Search string for duty locations", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the duty location", - "schema": { - "$ref": "#/definitions/DutyLocationsPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "matching duty location not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/duty_locations/{dutyLocationId}/transportation_office": { - "get": { - "description": "Returns the given duty location's transportation office", - "tags": [ - "transportation_offices" - ], - "summary": "Returns the transportation office for a given duty location", - "operationId": "showDutyLocationTransportationOffice", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the duty location", - "name": "dutyLocationId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the transportation office for a duty location", - "schema": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "transportation office not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/entitlements": { - "get": { - "description": "List weight weights allotted by entitlement", - "tags": [ - "entitlements" - ], - "summary": "List weight weights allotted by entitlement", - "operationId": "indexEntitlements", - "responses": { - "200": { - "description": "List of weights allotted entitlement", - "schema": { - "$ref": "#/definitions/IndexEntitlements" - } - } - } - } - }, - "/feature-flags/user-boolean/{key}": { - "post": { - "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "featureFlags" - ], - "summary": "Determines if a user has a feature flag enabled", - "operationId": "booleanFeatureFlagForUser", - "parameters": [ - { - "type": "string", - "description": "Feature Flag Key", - "name": "key", - "in": "path", - "required": true - }, - { - "description": "context for the feature flag request", - "name": "flagContext", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Boolean Feature Flag Status", - "schema": { - "$ref": "#/definitions/FeatureFlagBoolean" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/feature-flags/user-variant/{key}": { - "post": { - "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "featureFlags" - ], - "summary": "Determines if a user has a feature flag enabled", - "operationId": "variantFeatureFlagForUser", - "parameters": [ - { - "type": "string", - "description": "Feature Flag Key", - "name": "key", - "in": "path", - "required": true - }, - { - "description": "context for the feature flag request", - "name": "flagContext", - "in": "body", - "required": true, - "schema": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - ], - "responses": { - "200": { - "description": "Variant Feature Flag Status", - "schema": { - "$ref": "#/definitions/FeatureFlagVariant" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/move_documents/{moveDocumentId}": { - "put": { - "description": "Update a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Updates a move document", - "operationId": "updateMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move document model", - "name": "moveDocumentId", - "in": "path", - "required": true - }, - { - "name": "updateMoveDocument", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of move document", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move document not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "delete": { - "description": "Deletes a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Deletes a move document", - "operationId": "deleteMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move document model", - "name": "moveDocumentId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}": { - "get": { - "description": "Returns the given move", - "tags": [ - "moves" - ], - "summary": "Returns the given move", - "operationId": "showMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the move", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move is not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the move referenced", - "tags": [ - "moves" - ], - "summary": "Patches the move", - "operationId": "patchMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "patchMovePayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchMovePayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of move", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move or closeout office is not found" - }, - "412": { - "description": "precondition failed" - }, - "422": { - "description": "unprocessable entity" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/approve": { - "post": { - "description": "Approves the basic details of a move. The status of the move will be updated to APPROVED", - "tags": [ - "office" - ], - "summary": "Approves a move to proceed", - "operationId": "approveMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (approved) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/cancel": { - "post": { - "description": "Cancels the basic details of a move. The status of the move will be updated to CANCELED", - "tags": [ - "office" - ], - "summary": "Cancels a move", - "operationId": "cancelMove", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (canceled) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to cancel this move" - }, - "409": { - "description": "the move is not in a state to be canceled", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/move_documents": { - "get": { - "description": "Returns a list of all Move Documents associated with this move", - "tags": [ - "move_docs" - ], - "summary": "Returns a list of all Move Documents associated with this move", - "operationId": "indexMoveDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns list of move douments", - "schema": { - "$ref": "#/definitions/MoveDocuments" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - } - } - }, - "post": { - "description": "Created a move document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Creates a move document", - "operationId": "createGenericMoveDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createGenericMoveDocumentPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateGenericMoveDocumentPayload" - } - } - ], - "responses": { - "200": { - "description": "returns new move document object", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to modify this move" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/orders": { - "get": { - "description": "Returns orders information for a move for office use", - "tags": [ - "office" - ], - "summary": "Returns orders information for a move for office use", - "operationId": "showOfficeOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the orders information for a move for office use", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/signed_certifications": { - "get": { - "description": "returns a list of all signed_certifications associated with the move ID", - "tags": [ - "certification" - ], - "summary": "gets the signed certifications for the given move ID", - "operationId": "indexSignedCertification", - "parameters": [ - { - "type": "string", - "format": "uuid", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns a list of signed certifications", - "schema": { - "$ref": "#/definitions/SignedCertifications" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Create an instance of signed_certification tied to the move ID", - "tags": [ - "certification" - ], - "summary": "Submits signed certification for the given move ID", - "operationId": "createSignedCertification", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move being signed for", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateSignedCertificationPayload" - } - } - ], - "responses": { - "201": { - "description": "created instance of signed_certification", - "schema": { - "$ref": "#/definitions/SignedCertificationPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to sign for this move" - }, - "404": { - "description": "move not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/moves/{moveId}/submit": { - "post": { - "description": "Submits a move for approval by the office. The status of the move will be updated to SUBMITTED", - "tags": [ - "moves" - ], - "summary": "Submits a move for approval", - "operationId": "submitMoveForApproval", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "submitMoveForApprovalPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SubmitMoveForApprovalPayload" - } - } - ], - "responses": { - "200": { - "description": "returns updated (submitted) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/submit_amended_orders": { - "post": { - "description": "Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not.", - "tags": [ - "moves" - ], - "summary": "Submits amended orders for review", - "operationId": "submitAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns updated (submitted) move object", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to approve this move" - }, - "409": { - "description": "the move is not in a state to be approved", - "schema": { - "$ref": "#/definitions/MovePayload" - } - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/uploadAdditionalDocuments": { - "patch": { - "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "moves" - ], - "summary": "Patch the additional documents for a given move", - "operationId": "uploadAdditionalDocuments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "moveId", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveId}/weight_ticket": { - "post": { - "description": "Created a weight ticket document with the given information", - "tags": [ - "move_docs" - ], - "summary": "Creates a weight ticket document", - "operationId": "createWeightTicketDocument", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move", - "name": "moveId", - "in": "path", - "required": true - }, - { - "name": "createWeightTicketDocument", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateWeightTicketDocumentsPayload" - } - } - ], - "responses": { - "200": { - "description": "returns new weight ticket document object", - "schema": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "not authorized to modify this move" - }, - "500": { - "description": "server error" - } - } - } - }, - "/moves/{moveTaskOrderID}/mto_shipments": { - "get": { - "description": "Gets all MTO shipments for the specified Move Task Order.\n", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Gets all shipments for a move task order", - "operationId": "listMTOShipments", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of move task order for mto shipment to use", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved all mto shipments for a move task order.", - "schema": { - "$ref": "#/definitions/MTOShipments" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentId}": { - "delete": { - "description": "Soft deletes a shipment by ID", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "Soft deletes a shipment by ID", - "operationId": "deleteShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "ID of the shipment to be deleted", - "name": "mtoShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the shipment" - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Updates a specified MTO shipment.\n\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* Shipment type is required in body\n\nOptional fields include:\n* New shipment status type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Customer Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the MTO Shipment to update", - "name": "mtoShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/UpdateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the specified MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto_shipments": { - "post": { - "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n\nOptional fields include:\n* Customer Remarks\n* Releasing / Receiving agents\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/okta-profile": { - "get": { - "description": "Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update.", - "produces": [ - "application/json" - ], - "tags": [ - "okta_profile" - ], - "summary": "Returns Okta profile values from Okta's Users API", - "operationId": "showOktaInfo", - "responses": { - "200": { - "description": "okta profile for user", - "schema": { - "$ref": "#/definitions/OktaUserProfileData" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "okta_profile" - ], - "summary": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", - "operationId": "updateOktaInfo", - "parameters": [ - { - "name": "updateOktaUserProfileData", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateOktaUserProfileData" - } - } - ], - "responses": { - "200": { - "description": "okta profile for user", - "schema": { - "$ref": "#/definitions/OktaUserProfileData" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "422": { - "description": "validation error", - "schema": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders": { - "post": { - "description": "Creates an instance of orders tied to a service member", - "tags": [ - "orders" - ], - "summary": "Creates an orders model for a logged-in user", - "operationId": "createOrders", - "parameters": [ - { - "name": "createOrders", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateUpdateOrders" - } - } - ], - "responses": { - "201": { - "description": "created instance of orders", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{ordersId}": { - "get": { - "description": "Returns the given order", - "tags": [ - "orders" - ], - "summary": "Returns the given order", - "operationId": "showOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "ordersId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the order", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "order is not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "put": { - "description": "All fields sent in this request will be set on the orders referenced", - "tags": [ - "orders" - ], - "summary": "Updates orders", - "operationId": "updateOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the orders model", - "name": "ordersId", - "in": "path", - "required": true - }, - { - "name": "updateOrders", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateUpdateOrders" - } - } - ], - "responses": { - "200": { - "description": "updated instance of orders", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "orders not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/orders/{ordersId}/upload_amended_orders": { - "patch": { - "description": "Patch the amended orders for a given order", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "orders" - ], - "summary": "Patch the amended orders for a given order", - "operationId": "uploadAmendedOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the order", - "name": "ordersId", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/aoa-packet": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Downloads AOA Packet form PPMShipment as a PDF", - "operationId": "showAOAPacket", - "responses": { - "200": { - "description": "AOA PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "the id for the ppmshipment with aoa to be downloaded", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses": { - "post": { - "description": "Creates a moving expense document for the PPM shipment", - "tags": [ - "ppm" - ], - "summary": "Creates moving expense document", - "operationId": "createMovingExpense", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "returns new moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { - "delete": { - "description": "Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a moving expense by ID", - "operationId": "deleteMovingExpense", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the moving expense to be deleted", - "name": "movingExpenseId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the moving expense" - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the moving expense referenced", - "tags": [ - "ppm" - ], - "summary": "Updates the moving expense", - "operationId": "updateMovingExpense", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "updateMovingExpense", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMovingExpense" - } - } - ], - "responses": { - "200": { - "description": "returns an updated moving expense object", - "schema": { - "$ref": "#/definitions/MovingExpense" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/payment-packet": { - "get": { - "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", - "produces": [ - "application/pdf" - ], - "tags": [ - "ppm" - ], - "summary": "Returns PPM payment packet", - "operationId": "showPaymentPacket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppmShipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "PPM Payment Packet PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "ppm not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets": { - "post": { - "description": "Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a\npro-gear weight ticket. Data should be filled in using the patch endpoint.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Creates a pro-gear weight ticket", - "operationId": "createProGearWeightTicket", - "responses": { - "201": { - "description": "returns a new pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { - "delete": { - "description": "Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a pro-gear weight line item by ID", - "operationId": "deleteProGearWeightTicket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the pro-gear weight ticket to be deleted", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the pro-gear weight ticket" - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates a pro-gear weight ticket", - "operationId": "updateProGearWeightTicket", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - }, - { - "name": "updateProGearWeightTicket", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateProGearWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated pro-gear weight ticket object", - "schema": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}": { - "put": { - "description": "Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Updates signature and routes PPM shipment to service counselor", - "operationId": "resubmitPPMShipmentDocumentation", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the signed certification", - "name": "signedCertificationId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "savePPMShipmentSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SavePPMShipmentSignedCertification" - } - } - ], - "responses": { - "200": { - "description": "Returns the updated PPM shipment", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation": { - "post": { - "description": "Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Saves signature and routes PPM shipment to service counselor", - "operationId": "submitPPMShipmentDocumentation", - "parameters": [ - { - "name": "savePPMShipmentSignedCertificationPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/SavePPMShipmentSignedCertification" - } - } - ], - "responses": { - "200": { - "description": "Returns the updated PPM shipment", - "schema": { - "$ref": "#/definitions/PPMShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ] - }, - "/ppm-shipments/{ppmShipmentId}/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "ppm" - ], - "summary": "Create a new upload for a PPM weight ticket, pro-gear, or moving expense document", - "operationId": "createPPMUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the ppm shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "boolean", - "description": "If the upload is a Weight Receipt", - "name": "weightReceipt", - "in": "query", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "413": { - "description": "payload is too large" - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket": { - "post": { - "description": "Created a weight ticket document with the given information", - "tags": [ - "ppm" - ], - "summary": "Creates a weight ticket document", - "operationId": "createWeightTicket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "returns new weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { - "delete": { - "description": "Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database. This may change the PPM shipment's final\nincentive.\n", - "produces": [ - "application/json" - ], - "tags": [ - "ppm" - ], - "summary": "Soft deletes a weight ticket by ID", - "operationId": "deleteWeightTicket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the weight ticket to be deleted", - "name": "weightTicketId", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully soft deleted the weight ticket" - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "Updates a weight ticket document with the new information", - "tags": [ - "ppm" - ], - "summary": "Updates a weight ticket document", - "operationId": "updateWeightTicket", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "updateWeightTicketPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateWeightTicket" - } - } - ], - "responses": { - "200": { - "description": "returns an updated weight ticket object", - "schema": { - "$ref": "#/definitions/WeightTicket" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/queues/{queueType}": { - "get": { - "description": "Show all moves in a queue", - "tags": [ - "queues" - ], - "summary": "Show all moves in a queue", - "operationId": "showQueue", - "parameters": [ - { - "enum": [ - "new", - "ppm_payment_requested", - "all", - "ppm_approved", - "ppm_completed" - ], - "type": "string", - "description": "Queue type to show", - "name": "queueType", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "list all moves in the specified queue", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveQueueItem" - } - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to access this queue" - }, - "404": { - "description": "move queue item is not found" - } - } - } - }, - "/rate_engine_postal_codes/{postal_code}": { - "get": { - "description": "Verifies if a zipcode is valid for origin or destination location for a move.", - "tags": [ - "postal_codes" - ], - "summary": "Validate if a zipcode is valid for origin or destination location for a move.", - "operationId": "validatePostalCodeWithRateData", - "parameters": [ - { - "pattern": "^(\\d{5}?)$", - "type": "string", - "format": "zip", - "name": "postal_code", - "in": "path", - "required": true - }, - { - "enum": [ - "origin", - "destination" - ], - "type": "string", - "name": "postal_code_type", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "postal_code is valid or invalid", - "schema": { - "$ref": "#/definitions/RateEnginePostalCodePayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "must be authenticated to use this endpoint" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "server error" - } - } - } - }, - "/reimbursement/{reimbursementId}/approve": { - "post": { - "description": "Sets the status of the reimbursement to APPROVED.", - "tags": [ - "office" - ], - "summary": "Approves the reimbursement", - "operationId": "approveReimbursement", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the reimbursement being approved", - "name": "reimbursementId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "updated instance of reimbursement", - "schema": { - "$ref": "#/definitions/Reimbursement" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members": { - "post": { - "description": "Creates an instance of a service member tied to a user", - "tags": [ - "service_members" - ], - "summary": "Creates service member for a logged-in user", - "operationId": "createServiceMember", - "parameters": [ - { - "name": "createServiceMemberPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateServiceMemberPayload" - } - } - ], - "responses": { - "201": { - "description": "created instance of service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}": { - "get": { - "description": "Returns the given service member", - "tags": [ - "service_members" - ], - "summary": "Returns the given service member", - "operationId": "showServiceMember", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "patch": { - "description": "Any fields sent in this request will be set on the service member referenced", - "tags": [ - "service_members" - ], - "summary": "Patches the service member", - "operationId": "patchServiceMember", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - }, - { - "name": "patchServiceMemberPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/PatchServiceMemberPayload" - } - } - ], - "responses": { - "200": { - "description": "updated instance of service member", - "schema": { - "$ref": "#/definitions/ServiceMemberPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}/backup_contacts": { - "get": { - "description": "List all service member backup contacts", - "tags": [ - "backup_contacts" - ], - "summary": "List all service member backup contacts", - "operationId": "indexServiceMemberBackupContacts", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "list of service member backup contacts", - "schema": { - "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to see this backup contact" - }, - "404": { - "description": "contact not found" - }, - "500": { - "description": "internal server error" - } - } - }, - "post": { - "description": "Creates an instance of a backup contact tied to a service member user", - "tags": [ - "backup_contacts" - ], - "summary": "Submits backup contact for a logged-in user", - "operationId": "createServiceMemberBackupContact", - "parameters": [ - { - "name": "createBackupContactPayload", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateServiceMemberBackupContactPayload" - } - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "201": { - "description": "created instance of service member backup contact", - "schema": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized to create this backup contact" - }, - "404": { - "description": "contact not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/service_members/{serviceMemberId}/current_orders": { - "get": { - "description": "Returns orders", - "tags": [ - "service_members" - ], - "summary": "Returns the latest orders for a given service member", - "operationId": "showServiceMemberOrders", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the service member", - "name": "serviceMemberId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the service member", - "schema": { - "$ref": "#/definitions/Orders" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "403": { - "description": "user is not authorized" - }, - "404": { - "description": "service member not found" - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/transportation-offices": { - "get": { - "description": "Returns the transportation offices matching the search query", - "produces": [ - "application/json" - ], - "tags": [ - "transportation_offices" - ], - "summary": "Returns the transportation offices matching the search query", - "operationId": "getTransportationOffices", - "parameters": [ - { - "minLength": 2, - "type": "string", - "description": "Search string for transportation offices", - "name": "search", - "in": "query", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved transportation offices", - "schema": { - "$ref": "#/definitions/TransportationOffices" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/transportation_offices/{dutyLocationId}/counseling_offices": { - "get": { - "description": "Returns the counseling locations matching the GBLOC from the selected duty location", - "produces": [ - "application/json" - ], - "tags": [ - "transportation_offices" - ], - "summary": "Returns the counseling locations in the GBLOC matching the duty location", - "operationId": "showCounselingOffices", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the duty location", - "name": "dutyLocationId", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "the instance of the counseling office for a duty location", - "schema": { - "$ref": "#/definitions/CounselingOffices" - } - }, - "500": { - "description": "internal server error" - } - } - } - }, - "/uploads": { - "post": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "consumes": [ - "multipart/form-data" - ], - "tags": [ - "uploads" - ], - "summary": "Create a new upload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the document to add an upload to", - "name": "documentId", - "in": "query" - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "created upload", - "schema": { - "$ref": "#/definitions/Upload" - } - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "413": { - "description": "payload is too large" - }, - "500": { - "description": "server error" - } - } - }, - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes a collection of uploads", - "operationId": "deleteUploads", - "parameters": [ - { - "type": "array", - "items": { - "type": "string", - "format": "uuid" - }, - "description": "Array of UUIDs to be deleted", - "name": "uploadIds", - "in": "query", - "required": true - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/uploads/{uploadId}": { - "delete": { - "description": "Uploads represent a single digital file, such as a JPEG or PDF.", - "tags": [ - "uploads" - ], - "summary": "Deletes an upload", - "operationId": "deleteUpload", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the upload to be deleted", - "name": "uploadId", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "ID of the order that the upload belongs to", - "name": "orderId", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Optional ID of the move that the upload belongs to", - "name": "moveId", - "in": "query" - }, - { - "type": "string", - "format": "uuid", - "description": "Optional PPM shipment ID related to the upload", - "name": "ppmId", - "in": "query" - } - ], - "responses": { - "204": { - "description": "deleted" - }, - "400": { - "description": "invalid request", - "schema": { - "$ref": "#/definitions/InvalidRequestResponsePayload" - } - }, - "403": { - "description": "not authorized" - }, - "404": { - "description": "not found" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/is_logged_in": { - "get": { - "description": "Returns boolean as to whether the user is logged in", - "tags": [ - "users" - ], - "summary": "Returns boolean as to whether the user is logged in", - "operationId": "isLoggedInUser", - "responses": { - "200": { - "description": "Currently logged in user", - "schema": { - "type": "object", - "required": [ - "isLoggedIn" - ], - "properties": { - "isLoggedIn": { - "type": "boolean" - } - } - } - }, - "400": { - "description": "invalid request" - }, - "500": { - "description": "server error" - } - } - } - }, - "/users/logged_in": { - "get": { - "description": "Returns the user info for the currently logged in user", - "tags": [ - "users" - ], - "summary": "Returns the user info for the currently logged in user", - "operationId": "showLoggedInUser", - "responses": { - "200": { - "description": "Currently logged in user", - "schema": { - "$ref": "#/definitions/LoggedInUserPayload" - } - }, - "400": { - "description": "invalid request" - }, - "401": { - "description": "request requires user authentication" - }, - "500": { - "description": "server error" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Affiliation": { - "description": "Military branch of service", - "type": "string", - "title": "Branch of service", - "enum": [ - "ARMY", - "NAVY", - "MARINES", - "AIR_FORCE", - "COAST_GUARD", - "SPACE_FORCE", - "OTHER" - ], - "x-display-value": { - "AIR_FORCE": "Air Force", - "ARMY": "Army", - "COAST_GUARD": "Coast Guard", - "MARINES": "Marine Corps", - "NAVY": "Navy", - "OTHER": "OTHER", - "SPACE_FORCE": "Space Force" - }, - "x-nullable": true - }, - "ApplicationParameters": { - "type": "object", - "properties": { - "parameterName": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "parameterValue": { - "type": "string", - "format": "string", - "x-nullable": true - }, - "validationCode": { - "type": "string", - "format": "string", - "x-nullable": true - } - } - }, - "AvailableMoveDates": { - "type": "object", - "required": [ - "start_date", - "available" - ], - "properties": { - "available": { - "type": "array", - "items": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } - }, - "start_date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - } - } - }, - "BackupContactPermission": { - "type": "string", - "title": "Permissions", - "enum": [ - "NONE", - "VIEW", - "EDIT" - ], - "x-display-value": { - "EDIT": "View and edit all move details", - "NONE": "Contact Only", - "VIEW": "View all move details" - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "CancelMove": { - "type": "object", - "required": [ - "cancel_reason" - ], - "properties": { - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CounselingOffice": { - "type": "object", - "required": [ - "id", - "name" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "CounselingOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/CounselingOffice" - } - }, - "CreateBoatShipment": { - "description": "Boat shipment information for the move.", - "required": [ - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateGenericMoveDocumentPayload": { - "type": "object", - "required": [ - "upload_ids", - "title", - "move_document_type" - ], - "properties": { - "move_document_type": { - "$ref": "#/definitions/MoveDocumentType" - }, - "notes": { - "type": "string", - "title": "Notes", - "x-nullable": true, - "example": "This document is good to go!" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "title": { - "type": "string", - "example": "very_useful_document.pdf" - }, - "upload_ids": { - "type": "array", - "items": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - } - }, - "CreateMobileHomeShipment": { - "description": "A mobile home shipment that the prime moves for a service member.", - "required": [ - "make", - "model", - "year", - "lengthInInches", - "heightInInches", - "widthInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "A personally procured move is a type of shipment that a service members moves themselves.", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected" - ], - "properties": { - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date" - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Denotes if this PPM shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "sitExpected": { - "type": "boolean" - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "CreateServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "name", - "email", - "permission" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "title": "Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@exmaple.com" - }, - "name": { - "type": "string", - "title": "Name", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - } - } - }, - "CreateServiceMemberPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "current_location_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Phone", - "x-nullable": true - }, - "residential_address": { - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Alternate phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "CreateShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date" - }, - "requestedPickupDate": { - "type": "string", - "format": "date" - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "CreateSignedCertificationPayload": { - "type": "object", - "required": [ - "date", - "signature", - "certification_text" - ], - "properties": { - "certification_text": { - "type": "string" - }, - "certification_type": { - "$ref": "#/definitions/SignedCertificationTypeCreate" - }, - "date": { - "type": "string", - "format": "date-time", - "title": "Date" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "ppm_id": { - "$ref": "#/definitions/PpmID" - }, - "signature": { - "type": "string", - "title": "Signature" - } - } - }, - "CreateUpdateOrders": { - "type": "object", - "required": [ - "service_member_id", - "issue_date", - "report_by_date", - "orders_type", - "has_dependents", - "spouse_has_pro_gear", - "new_duty_location_id" - ], - "properties": { - "accompanied_tour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "counseling_office_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" - }, - "department_indicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "dependents_twelve_and_over": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependents_under_twelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "issue_date": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Orders date", - "example": "2018-04-26" - }, - "move_id": { - "type": "string", - "format": "uuid", - "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" - }, - "new_duty_location_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orders_number": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "orders_type_detail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "origin_duty_location_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "report_by_date": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report-by date", - "example": "2018-04-26" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - } - } - }, - "CreateWeightTicketDocumentsPayload": { - "type": "object", - "required": [ - "personally_procured_move_id", - "weight_ticket_set_type", - "full_weight_ticket_missing", - "empty_weight_ticket_missing", - "trailer_ownership_missing" - ], - "properties": { - "empty_weight": { - "type": "integer", - "title": "empty weight ticket recorded weight", - "minimum": 0 - }, - "empty_weight_ticket_missing": { - "type": "boolean", - "title": "missing empty weight ticket" - }, - "full_weight": { - "type": "integer", - "title": "full weight ticket recorded weight", - "minimum": 0 - }, - "full_weight_ticket_missing": { - "type": "boolean", - "title": "missing full weight ticket" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "trailer_ownership_missing": { - "type": "boolean", - "title": "missing trailer ownership documentation" - }, - "upload_ids": { - "type": "array", - "items": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - }, - "vehicle_make": { - "type": "string", - "title": "Vehicle make", - "x-nullable": true - }, - "vehicle_model": { - "type": "string", - "title": "Vehicle model", - "x-nullable": true - }, - "vehicle_nickname": { - "type": "string", - "title": "Vehicle nickname (ex. 'Large box truck')", - "x-nullable": true - }, - "weight_ticket_date": { - "type": "string", - "format": "date", - "title": "Full Weight Ticket Date", - "x-nullable": true, - "example": "2018-04-26" - }, - "weight_ticket_set_type": { - "$ref": "#/definitions/WeightTicketSetType" - } - } - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "Document": { - "type": "object", - "required": [ - "id", - "service_member_id", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/Upload" - } - } - } - }, - "DutyLocationPayload": { - "type": "object", - "required": [ - "id", - "name", - "address_id", - "affiliation", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "address_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "provides_services_counseling": { - "type": "boolean", - "x-nullable": false - }, - "transportation_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportation_office_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "DutyLocationsPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/DutyLocationPayload" - } - }, - "Entitlement": { - "type": "object", - "properties": { - "accompanied_tour": { - "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", - "type": "boolean", - "x-nullable": true, - "example": true - }, - "dependents_twelve_and_over": { - "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 3 - }, - "dependents_under_twelve": { - "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", - "type": "integer", - "x-nullable": true, - "example": 5 - }, - "proGear": { - "description": "Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "proGearSpouse": { - "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", - "type": "integer", - "x-nullable": true, - "example": 500 - }, - "ub_allowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "FeatureFlagBoolean": { - "description": "A feature flag", - "type": "object", - "required": [ - "entity", - "key", - "match", - "namespace" - ], - "properties": { - "entity": { - "type": "string", - "example": "11111111-1111-1111-1111-111111111111" - }, - "key": { - "type": "string", - "example": "flag" - }, - "match": { - "type": "boolean", - "example": true - }, - "namespace": { - "type": "string", - "example": "test" - } - } - }, - "FeatureFlagVariant": { - "description": "A feature flag", - "type": "object", - "required": [ - "entity", - "key", - "match", - "variant", - "namespace" - ], - "properties": { - "entity": { - "type": "string", - "example": "11111111-1111-1111-1111-111111111111" - }, - "key": { - "type": "string", - "example": "flag" - }, - "match": { - "type": "boolean", - "example": true - }, - "namespace": { - "type": "string", - "example": "test" - }, - "variant": { - "type": "string", - "example": "myval" - } - } - }, - "IndexEntitlements": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/WeightAllotment" - } - }, - "IndexMovesPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/MovePayload" - } - }, - "IndexServiceMemberBackupContactsPayload": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceMemberBackupContactPayload" - } - }, - "InternalMove": { - "type": "object", - "properties": { - "closeoutOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "counselingOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "orders": { - "type": "object" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "status": { - "type": "string", - "readOnly": true - }, - "submittedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "InvalidRequestResponsePayload": { - "type": "object", - "properties": { - "errors": { - "type": "object", - "additionalProperties": { - "type": "string" - } - } - } - }, - "IsDateWeekendHolidayInfo": { - "type": "object", - "required": [ - "country_code", - "country_name", - "date", - "is_weekend", - "is_holiday" - ], - "properties": { - "country_code": { - "type": "string" - }, - "country_name": { - "type": "string" - }, - "date": { - "type": "string", - "format": "date", - "example": "2018-09-25" - }, - "details": { - "type": "string" - }, - "is_holiday": { - "type": "boolean" - }, - "is_weekend": { - "type": "boolean" - } - } - }, - "LoggedInUserPayload": { - "type": "object", - "required": [ - "id" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "readOnly": true, - "example": "john_bob@example.com" - }, - "first_name": { - "type": "string", - "readOnly": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "office_user": { - "$ref": "#/definitions/OfficeUser" - }, - "permissions": { - "type": "array", - "items": { - "type": "string" - } - }, - "privileges": { - "type": "array", - "items": { - "$ref": "#/definitions/Privilege" - } - }, - "roles": { - "type": "array", - "items": { - "$ref": "#/definitions/Role" - }, - "x-nullable": true - }, - "service_member": { - "$ref": "#/definitions/ServiceMemberPayload" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "type": "string", - "title": "MTO Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOShipment": { - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true, - "readOnly": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentLocator": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "1K43AR-01" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentStatus": { - "type": "string", - "enum": [ - "DRAFT", - "APPROVED", - "SUBMITTED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MethodOfReceipt": { - "type": "string", - "title": "Method of Receipt", - "enum": [ - "MIL_PAY", - "OTHER_DD", - "GTCC" - ], - "x-display-value": { - "GTCC": "GTCC", - "MIL_PAY": "MilPay", - "OTHER_DD": "Other account" - }, - "x-nullable": true - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "MoveDocumentPayload": { - "type": "object", - "required": [ - "id", - "move_id", - "document", - "title", - "move_document_type", - "status" - ], - "properties": { - "document": { - "$ref": "#/definitions/Document" - }, - "empty_weight": { - "type": "integer", - "title": "Empty weight", - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true - }, - "empty_weight_ticket_missing": { - "type": "boolean", - "title": "missing empty weight ticket", - "x-nullable": true - }, - "full_weight": { - "type": "integer", - "title": "Full weight", - "minimum": 0, - "x-formatting": "weight", - "x-nullable": true - }, - "full_weight_ticket_missing": { - "type": "boolean", - "title": "missing full weight ticket", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "move_document_type": { - "$ref": "#/definitions/MoveDocumentType" - }, - "move_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moving_expense_type": { - "$ref": "#/definitions/MovingExpenseType" - }, - "notes": { - "type": "string", - "title": "Notes", - "x-nullable": true, - "example": "This document is good to go!" - }, - "payment_method": { - "type": "string", - "title": "Payment Method", - "enum": [ - "OTHER", - "GTCC" - ], - "x-display-value": { - "GTCC": "GTCC", - "OTHER": "Other account" - } - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "receipt_missing": { - "type": "boolean", - "title": "missing expense receipt", - "x-nullable": true - }, - "requested_amount_cents": { - "description": "unit is cents", - "type": "integer", - "format": "cents", - "title": "Requested Amount", - "minimum": 1 - }, - "status": { - "$ref": "#/definitions/MoveDocumentStatus" - }, - "storage_end_date": { - "type": "string", - "format": "date", - "title": "End date of storage for storage expenses", - "x-nullable": true, - "example": "2018-04-26" - }, - "storage_start_date": { - "type": "string", - "format": "date", - "title": "Start date of storage for storage expenses", - "x-nullable": true, - "example": "2018-04-26" - }, - "title": { - "type": "string", - "title": "Document title", - "example": "very_useful_document.pdf" - }, - "trailer_ownership_missing": { - "type": "boolean", - "title": "missing trailer ownership documentation", - "x-nullable": true - }, - "vehicle_make": { - "type": "string", - "title": "Vehicle make", - "x-nullable": true - }, - "vehicle_model": { - "type": "string", - "title": "Vehicle model", - "x-nullable": true - }, - "vehicle_nickname": { - "type": "string", - "title": "Nickname (ex. \"15-foot truck\")", - "x-nullable": true - }, - "weight_ticket_date": { - "type": "string", - "format": "date", - "title": "Weight ticket date", - "x-nullable": true, - "example": "2018-04-26" - }, - "weight_ticket_set_type": { - "$ref": "#/definitions/WeightTicketSetType" - } - } - }, - "MoveDocumentStatus": { - "type": "string", - "title": "Document status", - "enum": [ - "AWAITING_REVIEW", - "OK", - "HAS_ISSUE", - "EXCLUDE_FROM_CALCULATION" - ], - "x-display-value": { - "AWAITING_REVIEW": "Awaiting review", - "EXCLUDE_FROM_CALCULATION": "Exclude from calculation", - "HAS_ISSUE": "Has issue", - "OK": "OK" - } - }, - "MoveDocumentType": { - "type": "string", - "title": "Document type", - "enum": [ - "OTHER", - "WEIGHT_TICKET", - "STORAGE_EXPENSE", - "SHIPMENT_SUMMARY", - "EXPENSE", - "WEIGHT_TICKET_SET" - ], - "x-display-value": { - "EXPENSE": "Expense", - "OTHER": "Other document type", - "SHIPMENT_SUMMARY": "Shipment summary", - "STORAGE_EXPENSE": "Storage expense receipt", - "WEIGHT_TICKET": "Weight ticket", - "WEIGHT_TICKET_SET": "Weight ticket set" - }, - "example": "EXPENSE" - }, - "MoveDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveDocumentPayload" - } - }, - "MovePayload": { - "type": "object", - "required": [ - "id", - "orders_id", - "locator", - "created_at", - "updated_at", - "eTag" - ], - "properties": { - "additionalDocuments": { - "$ref": "#/definitions/Document" - }, - "cancel_reason": { - "type": "string", - "x-nullable": true, - "example": "Change of orders" - }, - "closeout_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "counseling_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "eTag": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "mto_shipments": { - "$ref": "#/definitions/MTOShipments" - }, - "orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "submitted_at": { - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "MoveQueueItem": { - "type": "object", - "required": [ - "id", - "status", - "locator", - "customer_name", - "edipi", - "grade", - "orders_type", - "branch_of_service", - "last_modified_date", - "created_at" - ], - "properties": { - "actual_move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "branch_of_service": { - "type": "string" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "customer_name": { - "type": "string", - "title": "Customer Name", - "example": "Thedog, Nino" - }, - "delivered_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "destination_duty_location_name": { - "type": "string", - "title": "Destination", - "x-nullable": true, - "example": "Dover AFB" - }, - "destination_gbloc": { - "type": "string", - "title": "Destination GBLOC", - "x-nullable": true, - "example": "LKNQ" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID #", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "example": "5789345789" - }, - "gbl_number": { - "type": "string", - "title": "GBL Number", - "x-nullable": true, - "example": "LNK12345" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "hhg_status": { - "type": "string", - "x-nullable": true, - "example": "ACCEPTED" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "invoice_approved_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "last_modified_date": { - "type": "string", - "format": "date-time", - "example": "2017-07-21T17:32:28Z" - }, - "locator": { - "type": "string", - "example": "12432" - }, - "move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "origin_duty_location_name": { - "type": "string", - "title": "Origin", - "x-nullable": true, - "example": "Dover AFB" - }, - "origin_gbloc": { - "type": "string", - "title": "Origin GBLOC", - "x-nullable": true, - "example": "LKNQ" - }, - "original_move_date": { - "type": "string", - "format": "date", - "x-nullable": true, - "example": "2018-04-25" - }, - "pm_survey_conducted_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2017-07-21T17:32:28Z" - }, - "ppm_status": { - "type": "string", - "x-nullable": true, - "example": "PAYMENT_REQUESTED" - }, - "status": { - "type": "string", - "example": "APPROVED" - }, - "submitted_date": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "example": "2018-04-25" - }, - "weight_allotment": { - "$ref": "#/definitions/WeightAllotment" - } - } - }, - "MoveStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED", - "NEEDS SERVICE COUNSELING", - "APPROVALS REQUESTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MovesList": { - "type": "object", - "properties": { - "currentMove": { - "type": "array", - "items": { - "$ref": "#/definitions/InternalMove" - } - }, - "previousMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/InternalMove" - } - } - } - }, - "MovingExpense": { - "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", - "type": "object", - "required": [ - "id", - "createdAt", - "updatedAt", - "ppmShipmentId", - "documentId", - "document" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp the moving expense object was initially created in the system (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "A brief description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "The Document object that contains all file uploads for this expense" - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The id of the Document that contains all file uploads for this expense", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "Unique primary identifier of the Moving Expense object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingReceipt": { - "description": "Indicates if the service member is missing the receipt with the proof of expense amount", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenseType": { - "$ref": "#/definitions/OmittableMovingExpenseType" - }, - "paidWithGtcc": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The PPM Shipment id that this moving expense belongs to", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedAmount": { - "description": "Customer submitted total amount of the expense as indicated on the receipt", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "submittedDescription": { - "description": "Customer submitted description of the expense", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "submittedMovingExpenseType": { - "$ref": "#/definitions/SubmittedMovingExpenseType" - }, - "submittedSitEndDate": { - "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2018-05-26" - }, - "submittedSitStartDate": { - "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "example": "2022-04-26" - }, - "updatedAt": { - "description": "Timestamp when a property of this moving expense object was last modified (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "MovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - } - }, - "NullableSignedCertificationType": { - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PPM", - "HHG" - ], - "x-nullable": true - }, - "OfficeUser": { - "type": "object", - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "email": { - "type": "string", - "format": "x-email", - "title": "Personal Email Address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "transportation_office": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportation_office_assignments": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOfficeAssignment" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OktaUserProfileData": { - "type": "object", - "properties": { - "cac_edipi": { - "type": "string", - "maxLength": 10, - "x-nullable": true, - "example": "1234567890" - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "user@email.com" - }, - "firstName": { - "type": "string", - "example": "John" - }, - "lastName": { - "type": "string", - "example": "Doe" - }, - "login": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "user@email.com" - }, - "sub": { - "type": "string", - "format": "string", - "example": "1duekdue9ekrjghf" - } - } - }, - "OmittableMovingExpenseType": { - "description": "Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OmittablePPMDocumentStatus": { - "description": "Status of the PPM document.", - "type": "string", - "enum": [ - "APPROVED", - "EXCLUDED", - "REJECTED" - ], - "x-display-value": { - "APPROVED": "Approved", - "EXCLUDED": "Excluded", - "REJECTED": "Rejected" - }, - "x-nullable": true, - "x-omitempty": false - }, - "OrderPayGrade": { - "type": "string", - "title": "Grade", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ], - "x-display-value": { - "ACADEMY_CADET": "Service Academy Cadet", - "AVIATION_CADET": "Aviation Cadet", - "CIVILIAN_EMPLOYEE": "Civilian Employee", - "E_1": "E-1", - "E_2": "E-2", - "E_3": "E-3", - "E_4": "E-4", - "E_5": "E-5", - "E_6": "E-6", - "E_7": "E-7", - "E_8": "E-8", - "E_9": "E-9", - "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", - "MIDSHIPMAN": "Midshipman", - "O_10": "O-10", - "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", - "O_2": "O-2", - "O_3": "O-3", - "O_4": "O-4", - "O_5": "O-5", - "O_6": "O-6", - "O_7": "O-7", - "O_8": "O-8", - "O_9": "O-9", - "W_1": "W-1", - "W_2": "W-2", - "W_3": "W-3", - "W_4": "W-4", - "W_5": "W-5" - }, - "x-nullable": true - }, - "Orders": { - "type": "object", - "required": [ - "id", - "service_member_id", - "issue_date", - "report_by_date", - "orders_type", - "has_dependents", - "spouse_has_pro_gear", - "new_duty_location", - "uploaded_orders", - "created_at", - "updated_at" - ], - "properties": { - "authorizedWeight": { - "type": "integer", - "x-nullable": true, - "example": 7000 - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "department_indicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "entitlement": { - "$ref": "#/definitions/Entitlement" - }, - "grade": { - "$ref": "#/definitions/OrderPayGrade" - }, - "has_dependents": { - "type": "boolean", - "title": "Are dependents included in your orders?" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "issue_date": { - "description": "The date and time that these orders were cut.", - "type": "string", - "format": "date", - "title": "Date issued", - "example": "2018-04-26" - }, - "moves": { - "$ref": "#/definitions/IndexMovesPayload" - }, - "new_duty_location": { - "$ref": "#/definitions/DutyLocationPayload" - }, - "orders_number": { - "type": "string", - "title": "Orders Number", - "x-nullable": true, - "example": "030-00362" - }, - "orders_type": { - "$ref": "#/definitions/OrdersType" - }, - "orders_type_detail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocationGbloc": { - "type": "string", - "title": "From what GBLOC do your orders originate?", - "x-nullable": true - }, - "origin_duty_location": { - "x-nullable": true, - "$ref": "#/definitions/DutyLocationPayload" - }, - "providesServicesCounseling": { - "type": "boolean", - "x-omitempty": false - }, - "report_by_date": { - "description": "Report By Date", - "type": "string", - "format": "date", - "title": "Report by", - "example": "2018-04-26" - }, - "sac": { - "type": "string", - "title": "SAC", - "x-nullable": true, - "example": "N002214CSW32Y9" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "spouse_has_pro_gear": { - "type": "boolean", - "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" - }, - "status": { - "$ref": "#/definitions/OrdersStatus" - }, - "tac": { - "type": "string", - "title": "TAC", - "x-nullable": true, - "example": "F8J1" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "uploaded_amended_orders": { - "$ref": "#/definitions/Document" - }, - "uploaded_amended_orders_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploaded_orders": { - "$ref": "#/definitions/Document" - } - } - }, - "OrdersStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PPMAdvanceStatus": { - "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", - "type": "string", - "title": "PPM Advance Status", - "enum": [ - "APPROVED", - "REJECTED", - "EDITED", - "RECEIVED", - "NOT_RECEIVED" - ], - "x-nullable": true - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMDocumentStatusReason": { - "description": "The reason the services counselor has excluded or rejected the item.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "PPMEstimateRange": { - "type": "object", - "required": [ - "range_min", - "range_max" - ], - "properties": { - "range_max": { - "type": "integer", - "title": "High estimate" - }, - "range_min": { - "type": "integer", - "title": "Low estimate" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceStatus": { - "$ref": "#/definitions/PPMAdvanceStatus" - }, - "allowableWeight": { - "description": "The allowable weight of the PPM shipment goods being moved.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false, - "example": 4300 - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "Timestamp of when the PPM Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin their move.\n", - "type": "string", - "format": "date" - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "Primary auto-generated unique identifier of the PPM shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "movingExpenses": { - "description": "All expense documentation receipt records of this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MovingExpense" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeightTickets": { - "description": "All pro-gear weight ticket documentation records for this PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/ProGearWeightTicket" - } - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "secondaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "signedCertification": { - "$ref": "#/definitions/SignedCertification" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "tertiaryPickupAddress": { - "allOf": [ - { - "$ref": "#/definitions/Address" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - }, - "weightTickets": { - "$ref": "#/definitions/WeightTickets" - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PatchMovePayload": { - "type": "object", - "required": [ - "closeoutOfficeId" - ], - "properties": { - "closeoutOfficeId": { - "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", - "type": "string", - "format": "uuid" - } - } - }, - "PatchServiceMemberPayload": { - "type": "object", - "properties": { - "affiliation": { - "$ref": "#/definitions/Affiliation" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "current_location_id": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "emplid": { - "type": "string", - "title": "USCG EMPLID", - "maxLength": 7, - "minLength": 7, - "pattern": "^\\d{7}$", - "x-nullable": true, - "example": "5789345" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Phone", - "x-nullable": true - }, - "residential_address": { - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Alternate Phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best Contact Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PostDocumentPayload": { - "type": "object", - "properties": { - "service_member_id": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - } - } - }, - "PpmID": { - "description": "The PPM Shipment ID to associate with the assigned certificate.\n", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "Privilege": { - "type": "object", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "privilegeName": { - "type": "string", - "example": "Supervisor" - }, - "privilegeType": { - "type": "string", - "example": "supervisor" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ProGearWeightTicket": { - "description": "Pro-gear associated information and weight docs for a PPM shipment", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "documentId", - "document" - ], - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "document": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the pro-gear weight." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "documentId": { - "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the pro-gear weight ticket.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedBelongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedHasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedWeight": { - "description": "Customer submitted weight of the pro-gear.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "weight": { - "description": "Weight of the pro-gear.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - } - } - }, - "RateEnginePostalCodePayload": { - "type": "object", - "required": [ - "valid", - "postal_code", - "postal_code_type" - ], - "properties": { - "postal_code": { - "description": "zip code, international allowed", - "type": "string", - "format": "zip", - "title": "ZIP", - "example": "'90210' or 'N15 3NL'" - }, - "postal_code_type": { - "type": "string", - "enum": [ - "origin", - "destination" - ] - }, - "valid": { - "type": "boolean", - "example": false - } - } - }, - "Reimbursement": { - "type": "object", - "required": [ - "requested_amount", - "method_of_receipt" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "method_of_receipt": { - "$ref": "#/definitions/MethodOfReceipt" - }, - "requested_amount": { - "description": "unit is cents", - "type": "integer", - "format": "cents", - "title": "Requested Amount", - "minimum": 1 - }, - "requested_date": { - "type": "string", - "format": "date", - "title": "Requested Date", - "x-nullable": true, - "example": "2018-04-26" - }, - "status": { - "$ref": "#/definitions/ReimbursementStatus" - } - }, - "x-nullable": true - }, - "ReimbursementStatus": { - "type": "string", - "title": "Reimbursement", - "enum": [ - "DRAFT", - "REQUESTED", - "APPROVED", - "REJECTED", - "PAID" - ], - "x-nullable": true - }, - "Role": { - "type": "object", - "required": [ - "id", - "roleType", - "createdAt", - "updatedAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "roleType": { - "type": "string", - "example": "customer" - }, - "updatedAt": { - "type": "string", - "format": "date-time" - } - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "SavePPMShipmentSignedCertification": { - "type": "object", - "required": [ - "certification_text", - "signature", - "date" - ], - "properties": { - "certification_text": { - "description": "Text that the customer is agreeing to and signing.", - "type": "string" - }, - "date": { - "description": "Date of signature", - "type": "string", - "format": "date" - }, - "signature": { - "description": "Customer signature", - "type": "string" - } - } - }, - "ServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "id", - "created_at", - "updated_at", - "name", - "email", - "permission" - ], - "properties": { - "created_at": { - "type": "string", - "format": "date-time" - }, - "email": { - "type": "string", - "format": "x-email", - "title": "Email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "title": "Name", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "service_member_id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "ServiceMemberPayload": { - "type": "object", - "required": [ - "id", - "user_id", - "is_profile_complete", - "created_at", - "updated_at" - ], - "properties": { - "affiliation": { - "title": "Branch", - "$ref": "#/definitions/Affiliation" - }, - "backup_contacts": { - "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" - }, - "backup_mailing_address": { - "$ref": "#/definitions/Address" - }, - "cac_validated": { - "type": "boolean" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "edipi": { - "type": "string", - "format": "edipi", - "title": "DoD ID number", - "maxLength": 10, - "minLength": 10, - "pattern": "^\\d{10}$", - "x-nullable": true, - "example": "5789345789" - }, - "email_is_preferred": { - "type": "boolean", - "title": "Email", - "x-nullable": true - }, - "emplid": { - "type": "string", - "title": "USCG EMPLID", - "maxLength": 7, - "minLength": 7, - "pattern": "^\\d{7}$", - "x-nullable": true, - "example": "5789345" - }, - "first_name": { - "type": "string", - "title": "First name", - "x-nullable": true, - "example": "John" - }, - "grade": { - "title": "Grade", - "$ref": "#/definitions/OrderPayGrade" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "is_profile_complete": { - "type": "boolean" - }, - "last_name": { - "type": "string", - "title": "Last name", - "x-nullable": true, - "example": "Donut" - }, - "middle_name": { - "type": "string", - "title": "Middle name", - "x-nullable": true, - "example": "L." - }, - "orders": { - "type": "array", - "items": { - "$ref": "#/definitions/Orders" - } - }, - "personal_email": { - "type": "string", - "format": "x-email", - "title": "Personal Email Address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "phone_is_preferred": { - "type": "boolean", - "title": "Telephone", - "x-nullable": true - }, - "residential_address": { - "title": "Residential Address", - "$ref": "#/definitions/Address" - }, - "secondary_telephone": { - "type": "string", - "format": "telephone", - "title": "Secondary Phone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true, - "example": "212-555-5555" - }, - "suffix": { - "type": "string", - "title": "Suffix", - "x-nullable": true, - "example": "Jr." - }, - "telephone": { - "type": "string", - "format": "telephone", - "title": "Best contact phone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "user_id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "weight_allotment": { - "$ref": "#/definitions/WeightAllotment" - } - } - }, - "SignedCertification": { - "description": "Signed certification", - "type": "object", - "required": [ - "id", - "submittingUserId", - "moveId", - "certificationType", - "certificationText", - "signature", - "date", - "createdAt", - "updatedAt", - "eTag" - ], - "properties": { - "certificationText": { - "description": "Full text that the customer agreed to and signed.", - "type": "string" - }, - "certificationType": { - "$ref": "#/definitions/SignedCertificationType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "date": { - "description": "Date that the customer signed the certification.", - "type": "string", - "format": "date" - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveId": { - "description": "The ID of the move associated with this signed certification.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmId": { - "description": "The ID of the PPM shipment associated with this signed certification, if any.", - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "signature": { - "description": "The signature that the customer provided.", - "type": "string" - }, - "submittingUserId": { - "description": "The ID of the user that signed.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SignedCertificationPayload": { - "type": "object", - "required": [ - "id", - "move_id", - "created_at", - "updated_at", - "date", - "signature", - "certification_text" - ], - "properties": { - "certification_text": { - "type": "string" - }, - "certification_type": { - "$ref": "#/definitions/NullableSignedCertificationType" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "date": { - "type": "string", - "format": "date-time", - "title": "Date" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "move_id": { - "type": "string", - "format": "uuid" - }, - "personally_procured_move_id": { - "type": "string", - "format": "uuid", - "x-nullable": true - }, - "ppm_id": { - "$ref": "#/definitions/PpmID" - }, - "signature": { - "type": "string", - "title": "Signature" - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "SignedCertificationType": { - "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "readOnly": true - }, - "SignedCertificationTypeCreate": { - "type": "string", - "enum": [ - "PPM_PAYMENT", - "SHIPMENT", - "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", - "CLOSEOUT_REVIEWED_PPM_PAYMENT" - ], - "x-nullable": true - }, - "SignedCertifications": { - "type": "array", - "items": { - "$ref": "#/definitions/SignedCertificationPayload" - } - }, - "SubmitMoveForApprovalPayload": { - "type": "object", - "properties": { - "certificate": { - "$ref": "#/definitions/CreateSignedCertificationPayload" - } - } - }, - "SubmittedMovingExpenseType": { - "description": "Customer Submitted Moving Expense Type", - "type": "string", - "enum": [ - "CONTRACTED_EXPENSE", - "GAS", - "OIL", - "OTHER", - "PACKING_MATERIALS", - "RENTAL_EQUIPMENT", - "STORAGE", - "TOLLS", - "WEIGHING_FEE" - ], - "x-display-value": { - "CONTRACTED_EXPENSE": "Contracted expense", - "GAS": "Gas", - "OIL": "Oil", - "OTHER": "Other", - "PACKING_MATERIALS": "Packing materials", - "RENTAL_EQUIPMENT": "Rental equipment", - "STORAGE": "Storage", - "TOLLS": "Tolls", - "WEIGHING_FEE": "Weighing fee" - }, - "x-nullable": true, - "x-omitempty": false - }, - "TransportationOffice": { - "type": "object", - "required": [ - "id", - "name", - "address", - "created_at", - "updated_at" - ], - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "gbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "example": "JENQ" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "latitude": { - "type": "number", - "format": "float", - "example": 29.382973 - }, - "longitude": { - "type": "number", - "format": "float", - "example": -98.62759 - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - }, - "phone_lines": { - "type": "array", - "items": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "example": "212-555-5555" - } - }, - "updated_at": { - "type": "string", - "format": "date-time" - } - } - }, - "TransportationOfficeAssignment": { - "type": "object", - "required": [ - "officeUserId", - "transportationOfficeId", - "primaryOffice" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "officeUserId": { - "type": "string", - "format": "uuid", - "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" - }, - "primaryOffice": { - "type": "boolean", - "x-omitempty": false - }, - "transportationOffice": { - "$ref": "#/definitions/TransportationOffice" - }, - "transportationOfficeId": { - "type": "string", - "format": "uuid", - "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "TransportationOffices": { - "type": "array", - "items": { - "$ref": "#/definitions/TransportationOffice" - } - }, - "UpdateBoatShipment": { - "type": "object", - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean", - "x-nullable": true - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Boat", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Boat", - "type": "string", - "x-nullable": true - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ], - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Boat", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMobileHomeShipment": { - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string", - "x-nullable": true - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string", - "x-nullable": true - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer", - "x-nullable": true - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateMovingExpense": { - "type": "object", - "required": [ - "movingExpenseType", - "description", - "paidWithGTCC", - "amount", - "missingReceipt" - ], - "properties": { - "amount": { - "description": "The total amount of the expense as indicated on the receipt", - "type": "integer" - }, - "description": { - "description": "A brief description of the expense", - "type": "string" - }, - "missingReceipt": { - "description": "Indicates if the customer is missing the receipt for their expense.", - "type": "boolean" - }, - "movingExpenseType": { - "$ref": "#/definitions/MovingExpenseType" - }, - "paidWithGTCC": { - "description": "Indicates if the service member used their government issued card to pay for the expense", - "type": "boolean" - }, - "sitEndDate": { - "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "sitReimburseableAmount": { - "description": "The amount of SIT that will be reimbursed", - "type": "integer", - "x-nullable": true - }, - "sitStartDate": { - "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", - "type": "string", - "format": "date" - }, - "weightStored": { - "description": "The total weight stored in PPM SIT", - "type": "integer" - } - } - }, - "UpdateOktaUserProfileData": { - "type": "object", - "properties": { - "profile": { - "$ref": "#/definitions/OktaUserProfileData" - } - } - }, - "UpdatePPMShipment": { - "type": "object", - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "actualMoveDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "advanceAmountRequested": { - "description": "The amount requested for an advance, or null if no advance is requested\n", - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "estimatedWeight": { - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to move.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "finalIncentive": { - "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear.\n", - "type": "boolean", - "x-nullable": true - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "sitExpected": { - "type": "boolean", - "x-nullable": true - }, - "spouseProGearWeight": { - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "w2Address": { - "x-nullable": true, - "$ref": "#/definitions/Address" - } - } - }, - "UpdateProGearWeightTicket": { - "type": "object", - "properties": { - "belongsToSelf": { - "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", - "type": "boolean" - }, - "description": { - "description": "Describes the pro-gear that was moved.", - "type": "string" - }, - "hasWeightTickets": { - "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", - "type": "boolean" - }, - "weight": { - "description": "Weight of the vehicle not including the pro-gear.", - "type": "integer", - "minimum": 0 - } - } - }, - "UpdateServiceMemberBackupContactPayload": { - "type": "object", - "required": [ - "name", - "email", - "permission" - ], - "properties": { - "email": { - "type": "string", - "format": "x-email", - "title": "email address", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true, - "example": "john_bob@example.com" - }, - "name": { - "type": "string", - "x-nullable": true, - "example": "Susan Smith" - }, - "permission": { - "$ref": "#/definitions/BackupContactPermission" - }, - "telephone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true, - "example": "212-555-5555" - } - } - }, - "UpdateShipment": { - "type": "object", - "properties": { - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/UpdateBoatShipment" - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "hasSecondaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDeliveryAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "mobileHomeShipment": { - "$ref": "#/definitions/UpdateMobileHomeShipment" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "requestedDeliveryDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "$ref": "#/definitions/MTOShipmentStatus" - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UpdateWeightTicket": { - "type": "object", - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "minimum": 0 - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "minimum": 0 - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "minimum": 0 - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean" - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean" - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string" - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean" - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean" - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string" - } - } - }, - "Upload": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "id", - "url", - "filename", - "contentType", - "bytes", - "createdAt", - "updatedAt" - ], - "properties": { - "bytes": { - "type": "integer", - "readOnly": true - }, - "contentType": { - "type": "string", - "format": "mime-type", - "readOnly": true, - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "deletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "filename": { - "type": "string", - "readOnly": true, - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isWeightTicket": { - "type": "boolean" - }, - "rotation": { - "type": "integer", - "example": 2 - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ], - "readOnly": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "uploadType": { - "type": "string", - "enum": [ - "USER", - "PRIME", - "OFFICE" - ], - "readOnly": true, - "example": "OFFICE" - }, - "url": { - "type": "string", - "format": "uri", - "readOnly": true, - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocation": { - "description": "A postal code, city, and state lookup", - "type": "object", - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "VLocations": { - "type": "array", - "items": { - "$ref": "#/definitions/VLocation" - } - }, - "ValidationError": { - "required": [ - "invalidFields" - ], - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "$ref": "#/definitions/ValidationErrorAllOf1" - } - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - }, - "ValidationErrorAllOf1": { - "type": "object" - }, - "WeightAllotment": { - "type": "object", - "required": [ - "total_weight_self", - "total_weight_self_plus_dependents", - "pro_gear_weight", - "pro_gear_weight_spouse" - ], - "properties": { - "pro_gear_weight": { - "type": "integer", - "example": 2000 - }, - "pro_gear_weight_spouse": { - "type": "integer", - "example": 500 - }, - "total_weight_self": { - "type": "integer", - "example": 18000 - }, - "total_weight_self_plus_dependents": { - "type": "integer", - "example": 18000 - } - } - }, - "WeightTicket": { - "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", - "type": "object", - "required": [ - "ppmShipmentId", - "createdAt", - "updatedAt", - "emptyDocumentId", - "emptyDocument", - "fullDocument", - "fullDocumentId", - "proofOfTrailerOwnershipDocument", - "proofOfTrailerOwnershipDocumentId" - ], - "properties": { - "adjustedNetWeight": { - "description": "Indicates the adjusted net weight of the vehicle", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "emptyDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when empty." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "emptyDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", - "type": "string", - "format": "uuid", - "readOnly": true - }, - "emptyWeight": { - "description": "Weight of the vehicle when empty.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "fullDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the vehicle weight when full." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "fullDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "fullWeight": { - "description": "The weight of the vehicle when full.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "ID of this set of weight tickets.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "missingEmptyWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "missingFullWeightTicket": { - "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "netWeightRemarks": { - "description": "Remarks explaining any edits made to the net weight", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "ownsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "ppmShipmentId": { - "description": "The ID of the PPM shipment that this set of weight tickets is for.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "proofOfTrailerOwnershipDocument": { - "allOf": [ - { - "description": "Document that is associated with the user uploads containing the proof of trailer ownership." - }, - { - "$ref": "#/definitions/Document" - } - ] - }, - "proofOfTrailerOwnershipDocumentId": { - "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "reason": { - "$ref": "#/definitions/PPMDocumentStatusReason" - }, - "status": { - "$ref": "#/definitions/OmittablePPMDocumentStatus" - }, - "submittedEmptyWeight": { - "description": "Customer submitted weight of the vehicle when empty.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "submittedFullWeight": { - "description": "Customer submitted weight of the vehicle when full.", - "type": "integer", - "minimum": 0, - "x-nullable": true, - "x-omitempty": false - }, - "submittedOwnsTrailer": { - "description": "Indicates if the customer used a trailer they own for the move.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "submittedTrailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "trailerMeetsCriteria": { - "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "vehicleDescription": { - "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", - "type": "string", - "x-nullable": true, - "x-omitempty": false - } - } - }, - "WeightTicketSetType": { - "type": "string", - "title": "Select weight ticket type", - "enum": [ - "CAR", - "CAR_TRAILER", - "BOX_TRUCK", - "PRO_GEAR" - ], - "x-display-value": { - "BOX_TRUCK": "Box truck", - "CAR": "Car", - "CAR_TRAILER": "Car + Trailer", - "PRO_GEAR": "Pro-gear" - }, - "x-nullable": true - }, - "WeightTickets": { - "description": "All weight tickets associated with a PPM shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/WeightTicket" - }, - "x-omitempty": false - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - "movingExpenseId": { - "type": "string", - "format": "uuid", - "description": "UUID of the moving expense", - "name": "movingExpenseId", - "in": "path", - "required": true - }, - "ppmShipmentId": { - "type": "string", - "format": "uuid", - "description": "UUID of the PPM shipment", - "name": "ppmShipmentId", - "in": "path", - "required": true - }, - "proGearWeightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the pro-gear weight ticket", - "name": "proGearWeightTicketId", - "in": "path", - "required": true - }, - "weightTicketId": { - "type": "string", - "format": "uuid", - "description": "UUID of the weight ticket", - "name": "weightTicketId", - "in": "path", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "name": "responses" - }, - { - "name": "orders" - }, - { - "name": "certification" - }, - { - "name": "moves" - }, - { - "name": "office" - }, - { - "name": "documents" - }, - { - "name": "uploads" - }, - { - "name": "service_members" - }, - { - "name": "backup_contacts" - }, - { - "name": "duty_locations" - }, - { - "name": "transportation_offices" - }, - { - "name": "queues" - }, - { - "name": "entitlements" - }, - { - "name": "calendar" - }, - { - "name": "move_docs" - }, - { - "name": "ppm" - }, - { - "name": "postal_codes" - }, - { - "name": "addresses" - }, - { - "name": "mtoShipment" - }, - { - "name": "featureFlags" - }, - { - "name": "okta_profile" - }, - { - "name": "application_parameters" - } - ] -}`)) -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go deleted file mode 100644 index d202a9066f8..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetLocationByZipCityStateHandlerFunc turns a function with the right signature into a get location by zip city state handler -type GetLocationByZipCityStateHandlerFunc func(GetLocationByZipCityStateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetLocationByZipCityStateHandlerFunc) Handle(params GetLocationByZipCityStateParams) middleware.Responder { - return fn(params) -} - -// GetLocationByZipCityStateHandler interface for that can handle valid get location by zip city state params -type GetLocationByZipCityStateHandler interface { - Handle(GetLocationByZipCityStateParams) middleware.Responder -} - -// NewGetLocationByZipCityState creates a new http.Handler for the get location by zip city state operation -func NewGetLocationByZipCityState(ctx *middleware.Context, handler GetLocationByZipCityStateHandler) *GetLocationByZipCityState { - return &GetLocationByZipCityState{Context: ctx, Handler: handler} -} - -/* - GetLocationByZipCityState swagger:route GET /addresses/zip-city-lookup/{search} addresses getLocationByZipCityState - -Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string - -Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code. -*/ -type GetLocationByZipCityState struct { - Context *middleware.Context - Handler GetLocationByZipCityStateHandler -} - -func (o *GetLocationByZipCityState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetLocationByZipCityStateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go deleted file mode 100644 index 0e8106fb581..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetLocationByZipCityStateParams creates a new GetLocationByZipCityStateParams object -// -// There are no default values defined in the spec. -func NewGetLocationByZipCityStateParams() GetLocationByZipCityStateParams { - - return GetLocationByZipCityStateParams{} -} - -// GetLocationByZipCityStateParams contains all the bound params for the get location by zip city state operation -// typically these are obtained from a http.Request -// -// swagger:parameters getLocationByZipCityState -type GetLocationByZipCityStateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetLocationByZipCityStateParams() beforehand. -func (o *GetLocationByZipCityStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rSearch, rhkSearch, _ := route.Params.GetOK("search") - if err := o.bindSearch(rSearch, rhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from path. -func (o *GetLocationByZipCityStateParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Search = raw - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go deleted file mode 100644 index 9a6446dae6a..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// GetLocationByZipCityStateOKCode is the HTTP code returned for type GetLocationByZipCityStateOK -const GetLocationByZipCityStateOKCode int = 200 - -/* -GetLocationByZipCityStateOK the requested list of city, state, county, and postal code matches - -swagger:response getLocationByZipCityStateOK -*/ -type GetLocationByZipCityStateOK struct { - - /* - In: Body - */ - Payload internalmessages.VLocations `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateOK creates GetLocationByZipCityStateOK with default headers values -func NewGetLocationByZipCityStateOK() *GetLocationByZipCityStateOK { - - return &GetLocationByZipCityStateOK{} -} - -// WithPayload adds the payload to the get location by zip city state o k response -func (o *GetLocationByZipCityStateOK) WithPayload(payload internalmessages.VLocations) *GetLocationByZipCityStateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state o k response -func (o *GetLocationByZipCityStateOK) SetPayload(payload internalmessages.VLocations) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.VLocations{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetLocationByZipCityStateBadRequestCode is the HTTP code returned for type GetLocationByZipCityStateBadRequest -const GetLocationByZipCityStateBadRequestCode int = 400 - -/* -GetLocationByZipCityStateBadRequest The request payload is invalid. - -swagger:response getLocationByZipCityStateBadRequest -*/ -type GetLocationByZipCityStateBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateBadRequest creates GetLocationByZipCityStateBadRequest with default headers values -func NewGetLocationByZipCityStateBadRequest() *GetLocationByZipCityStateBadRequest { - - return &GetLocationByZipCityStateBadRequest{} -} - -// WithPayload adds the payload to the get location by zip city state bad request response -func (o *GetLocationByZipCityStateBadRequest) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state bad request response -func (o *GetLocationByZipCityStateBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateForbiddenCode is the HTTP code returned for type GetLocationByZipCityStateForbidden -const GetLocationByZipCityStateForbiddenCode int = 403 - -/* -GetLocationByZipCityStateForbidden The request was denied. - -swagger:response getLocationByZipCityStateForbidden -*/ -type GetLocationByZipCityStateForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateForbidden creates GetLocationByZipCityStateForbidden with default headers values -func NewGetLocationByZipCityStateForbidden() *GetLocationByZipCityStateForbidden { - - return &GetLocationByZipCityStateForbidden{} -} - -// WithPayload adds the payload to the get location by zip city state forbidden response -func (o *GetLocationByZipCityStateForbidden) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state forbidden response -func (o *GetLocationByZipCityStateForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateNotFoundCode is the HTTP code returned for type GetLocationByZipCityStateNotFound -const GetLocationByZipCityStateNotFoundCode int = 404 - -/* -GetLocationByZipCityStateNotFound The requested resource wasn't found. - -swagger:response getLocationByZipCityStateNotFound -*/ -type GetLocationByZipCityStateNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateNotFound creates GetLocationByZipCityStateNotFound with default headers values -func NewGetLocationByZipCityStateNotFound() *GetLocationByZipCityStateNotFound { - - return &GetLocationByZipCityStateNotFound{} -} - -// WithPayload adds the payload to the get location by zip city state not found response -func (o *GetLocationByZipCityStateNotFound) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state not found response -func (o *GetLocationByZipCityStateNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetLocationByZipCityStateInternalServerErrorCode is the HTTP code returned for type GetLocationByZipCityStateInternalServerError -const GetLocationByZipCityStateInternalServerErrorCode int = 500 - -/* -GetLocationByZipCityStateInternalServerError A server error occurred. - -swagger:response getLocationByZipCityStateInternalServerError -*/ -type GetLocationByZipCityStateInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewGetLocationByZipCityStateInternalServerError creates GetLocationByZipCityStateInternalServerError with default headers values -func NewGetLocationByZipCityStateInternalServerError() *GetLocationByZipCityStateInternalServerError { - - return &GetLocationByZipCityStateInternalServerError{} -} - -// WithPayload adds the payload to the get location by zip city state internal server error response -func (o *GetLocationByZipCityStateInternalServerError) WithPayload(payload *internalmessages.Error) *GetLocationByZipCityStateInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get location by zip city state internal server error response -func (o *GetLocationByZipCityStateInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetLocationByZipCityStateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go deleted file mode 100644 index 11f70d8a670..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetLocationByZipCityStateURL generates an URL for the get location by zip city state operation -type GetLocationByZipCityStateURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLocationByZipCityStateURL) WithBasePath(bp string) *GetLocationByZipCityStateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetLocationByZipCityStateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetLocationByZipCityStateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/addresses/zip-city-lookup/{search}" - - search := o.Search - if search != "" { - _path = strings.Replace(_path, "{search}", search, -1) - } else { - return nil, errors.New("search is required on GetLocationByZipCityStateURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetLocationByZipCityStateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetLocationByZipCityStateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetLocationByZipCityStateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetLocationByZipCityStateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetLocationByZipCityStateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetLocationByZipCityStateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address.go b/pkg/gen/internalapi/internaloperations/addresses/show_address.go deleted file mode 100644 index 2c05e4e079d..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/show_address.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowAddressHandlerFunc turns a function with the right signature into a show address handler -type ShowAddressHandlerFunc func(ShowAddressParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowAddressHandlerFunc) Handle(params ShowAddressParams) middleware.Responder { - return fn(params) -} - -// ShowAddressHandler interface for that can handle valid show address params -type ShowAddressHandler interface { - Handle(ShowAddressParams) middleware.Responder -} - -// NewShowAddress creates a new http.Handler for the show address operation -func NewShowAddress(ctx *middleware.Context, handler ShowAddressHandler) *ShowAddress { - return &ShowAddress{Context: ctx, Handler: handler} -} - -/* - ShowAddress swagger:route GET /addresses/{addressId} addresses showAddress - -# Returns an address - -Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code. -*/ -type ShowAddress struct { - Context *middleware.Context - Handler ShowAddressHandler -} - -func (o *ShowAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowAddressParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go deleted file mode 100644 index 5adf872ef43..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowAddressParams creates a new ShowAddressParams object -// -// There are no default values defined in the spec. -func NewShowAddressParams() ShowAddressParams { - - return ShowAddressParams{} -} - -// ShowAddressParams contains all the bound params for the show address operation -// typically these are obtained from a http.Request -// -// swagger:parameters showAddress -type ShowAddressParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the address to return - Required: true - In: path - */ - AddressID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowAddressParams() beforehand. -func (o *ShowAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rAddressID, rhkAddressID, _ := route.Params.GetOK("addressId") - if err := o.bindAddressID(rAddressID, rhkAddressID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindAddressID binds and validates parameter AddressID from path. -func (o *ShowAddressParams) bindAddressID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("addressId", "path", "strfmt.UUID", raw) - } - o.AddressID = *(value.(*strfmt.UUID)) - - if err := o.validateAddressID(formats); err != nil { - return err - } - - return nil -} - -// validateAddressID carries on validations for parameter AddressID -func (o *ShowAddressParams) validateAddressID(formats strfmt.Registry) error { - - if err := validate.FormatOf("addressId", "path", "uuid", o.AddressID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go deleted file mode 100644 index 7e226b4b17f..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowAddressOKCode is the HTTP code returned for type ShowAddressOK -const ShowAddressOKCode int = 200 - -/* -ShowAddressOK the requested address - -swagger:response showAddressOK -*/ -type ShowAddressOK struct { - - /* - In: Body - */ - Payload *internalmessages.Address `json:"body,omitempty"` -} - -// NewShowAddressOK creates ShowAddressOK with default headers values -func NewShowAddressOK() *ShowAddressOK { - - return &ShowAddressOK{} -} - -// WithPayload adds the payload to the show address o k response -func (o *ShowAddressOK) WithPayload(payload *internalmessages.Address) *ShowAddressOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show address o k response -func (o *ShowAddressOK) SetPayload(payload *internalmessages.Address) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAddressOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAddressBadRequestCode is the HTTP code returned for type ShowAddressBadRequest -const ShowAddressBadRequestCode int = 400 - -/* -ShowAddressBadRequest invalid request - -swagger:response showAddressBadRequest -*/ -type ShowAddressBadRequest struct { -} - -// NewShowAddressBadRequest creates ShowAddressBadRequest with default headers values -func NewShowAddressBadRequest() *ShowAddressBadRequest { - - return &ShowAddressBadRequest{} -} - -// WriteResponse to the client -func (o *ShowAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowAddressForbiddenCode is the HTTP code returned for type ShowAddressForbidden -const ShowAddressForbiddenCode int = 403 - -/* -ShowAddressForbidden not authorized - -swagger:response showAddressForbidden -*/ -type ShowAddressForbidden struct { -} - -// NewShowAddressForbidden creates ShowAddressForbidden with default headers values -func NewShowAddressForbidden() *ShowAddressForbidden { - - return &ShowAddressForbidden{} -} - -// WriteResponse to the client -func (o *ShowAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowAddressNotFoundCode is the HTTP code returned for type ShowAddressNotFound -const ShowAddressNotFoundCode int = 404 - -/* -ShowAddressNotFound not found - -swagger:response showAddressNotFound -*/ -type ShowAddressNotFound struct { -} - -// NewShowAddressNotFound creates ShowAddressNotFound with default headers values -func NewShowAddressNotFound() *ShowAddressNotFound { - - return &ShowAddressNotFound{} -} - -// WriteResponse to the client -func (o *ShowAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowAddressInternalServerErrorCode is the HTTP code returned for type ShowAddressInternalServerError -const ShowAddressInternalServerErrorCode int = 500 - -/* -ShowAddressInternalServerError server error - -swagger:response showAddressInternalServerError -*/ -type ShowAddressInternalServerError struct { -} - -// NewShowAddressInternalServerError creates ShowAddressInternalServerError with default headers values -func NewShowAddressInternalServerError() *ShowAddressInternalServerError { - - return &ShowAddressInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go deleted file mode 100644 index d9f5d169fb2..00000000000 --- a/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package addresses - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowAddressURL generates an URL for the show address operation -type ShowAddressURL struct { - AddressID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAddressURL) WithBasePath(bp string) *ShowAddressURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAddressURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowAddressURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/addresses/{addressId}" - - addressID := o.AddressID.String() - if addressID != "" { - _path = strings.Replace(_path, "{addressId}", addressID, -1) - } else { - return nil, errors.New("addressId is required on ShowAddressURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowAddressURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowAddressURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowAddressURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowAddressURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowAddressURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowAddressURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate.go deleted file mode 100644 index 430af001127..00000000000 --- a/pkg/gen/internalapi/internaloperations/application_parameters/validate.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ValidateHandlerFunc turns a function with the right signature into a validate handler -type ValidateHandlerFunc func(ValidateParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ValidateHandlerFunc) Handle(params ValidateParams) middleware.Responder { - return fn(params) -} - -// ValidateHandler interface for that can handle valid validate params -type ValidateHandler interface { - Handle(ValidateParams) middleware.Responder -} - -// NewValidate creates a new http.Handler for the validate operation -func NewValidate(ctx *middleware.Context, handler ValidateHandler) *Validate { - return &Validate{Context: ctx, Handler: handler} -} - -/* - Validate swagger:route POST /application_parameters application_parameters validate - -# Searches for an application parameter by name and value, returns nil if not found - -Searches for an application parameter by name and value, returns nil if not found -*/ -type Validate struct { - Context *middleware.Context - Handler ValidateHandler -} - -func (o *Validate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewValidateParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go deleted file mode 100644 index e57d49cc800..00000000000 --- a/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewValidateParams creates a new ValidateParams object -// -// There are no default values defined in the spec. -func NewValidateParams() ValidateParams { - - return ValidateParams{} -} - -// ValidateParams contains all the bound params for the validate operation -// typically these are obtained from a http.Request -// -// swagger:parameters validate -type ValidateParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *internalmessages.ApplicationParameters -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewValidateParams() beforehand. -func (o *ValidateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.ApplicationParameters - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go deleted file mode 100644 index c88c81f1a30..00000000000 --- a/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ValidateOKCode is the HTTP code returned for type ValidateOK -const ValidateOKCode int = 200 - -/* -ValidateOK Application Parameters - -swagger:response validateOK -*/ -type ValidateOK struct { - - /* - In: Body - */ - Payload *internalmessages.ApplicationParameters `json:"body,omitempty"` -} - -// NewValidateOK creates ValidateOK with default headers values -func NewValidateOK() *ValidateOK { - - return &ValidateOK{} -} - -// WithPayload adds the payload to the validate o k response -func (o *ValidateOK) WithPayload(payload *internalmessages.ApplicationParameters) *ValidateOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the validate o k response -func (o *ValidateOK) SetPayload(payload *internalmessages.ApplicationParameters) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ValidateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ValidateBadRequestCode is the HTTP code returned for type ValidateBadRequest -const ValidateBadRequestCode int = 400 - -/* -ValidateBadRequest invalid request - -swagger:response validateBadRequest -*/ -type ValidateBadRequest struct { -} - -// NewValidateBadRequest creates ValidateBadRequest with default headers values -func NewValidateBadRequest() *ValidateBadRequest { - - return &ValidateBadRequest{} -} - -// WriteResponse to the client -func (o *ValidateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ValidateUnauthorizedCode is the HTTP code returned for type ValidateUnauthorized -const ValidateUnauthorizedCode int = 401 - -/* -ValidateUnauthorized request requires user authentication - -swagger:response validateUnauthorized -*/ -type ValidateUnauthorized struct { -} - -// NewValidateUnauthorized creates ValidateUnauthorized with default headers values -func NewValidateUnauthorized() *ValidateUnauthorized { - - return &ValidateUnauthorized{} -} - -// WriteResponse to the client -func (o *ValidateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ValidateInternalServerErrorCode is the HTTP code returned for type ValidateInternalServerError -const ValidateInternalServerErrorCode int = 500 - -/* -ValidateInternalServerError server error - -swagger:response validateInternalServerError -*/ -type ValidateInternalServerError struct { -} - -// NewValidateInternalServerError creates ValidateInternalServerError with default headers values -func NewValidateInternalServerError() *ValidateInternalServerError { - - return &ValidateInternalServerError{} -} - -// WriteResponse to the client -func (o *ValidateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go deleted file mode 100644 index a55b1d441b8..00000000000 --- a/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package application_parameters - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ValidateURL generates an URL for the validate operation -type ValidateURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ValidateURL) WithBasePath(bp string) *ValidateURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ValidateURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ValidateURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/application_parameters" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ValidateURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ValidateURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ValidateURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ValidateURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ValidateURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ValidateURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go deleted file mode 100644 index dc003747f1a..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServiceMemberBackupContactHandlerFunc turns a function with the right signature into a create service member backup contact handler -type CreateServiceMemberBackupContactHandlerFunc func(CreateServiceMemberBackupContactParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServiceMemberBackupContactHandlerFunc) Handle(params CreateServiceMemberBackupContactParams) middleware.Responder { - return fn(params) -} - -// CreateServiceMemberBackupContactHandler interface for that can handle valid create service member backup contact params -type CreateServiceMemberBackupContactHandler interface { - Handle(CreateServiceMemberBackupContactParams) middleware.Responder -} - -// NewCreateServiceMemberBackupContact creates a new http.Handler for the create service member backup contact operation -func NewCreateServiceMemberBackupContact(ctx *middleware.Context, handler CreateServiceMemberBackupContactHandler) *CreateServiceMemberBackupContact { - return &CreateServiceMemberBackupContact{Context: ctx, Handler: handler} -} - -/* - CreateServiceMemberBackupContact swagger:route POST /service_members/{serviceMemberId}/backup_contacts backup_contacts createServiceMemberBackupContact - -# Submits backup contact for a logged-in user - -Creates an instance of a backup contact tied to a service member user -*/ -type CreateServiceMemberBackupContact struct { - Context *middleware.Context - Handler CreateServiceMemberBackupContactHandler -} - -func (o *CreateServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServiceMemberBackupContactParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go deleted file mode 100644 index b41e7a8764e..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateServiceMemberBackupContactParams creates a new CreateServiceMemberBackupContactParams object -// -// There are no default values defined in the spec. -func NewCreateServiceMemberBackupContactParams() CreateServiceMemberBackupContactParams { - - return CreateServiceMemberBackupContactParams{} -} - -// CreateServiceMemberBackupContactParams contains all the bound params for the create service member backup contact operation -// typically these are obtained from a http.Request -// -// swagger:parameters createServiceMemberBackupContact -type CreateServiceMemberBackupContactParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateBackupContactPayload *internalmessages.CreateServiceMemberBackupContactPayload - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServiceMemberBackupContactParams() beforehand. -func (o *CreateServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateServiceMemberBackupContactPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createBackupContactPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("createBackupContactPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateBackupContactPayload = &body - } - } - } else { - res = append(res, errors.Required("createBackupContactPayload", "body", "")) - } - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *CreateServiceMemberBackupContactParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *CreateServiceMemberBackupContactParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go deleted file mode 100644 index c21e915af12..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateServiceMemberBackupContactCreatedCode is the HTTP code returned for type CreateServiceMemberBackupContactCreated -const CreateServiceMemberBackupContactCreatedCode int = 201 - -/* -CreateServiceMemberBackupContactCreated created instance of service member backup contact - -swagger:response createServiceMemberBackupContactCreated -*/ -type CreateServiceMemberBackupContactCreated struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` -} - -// NewCreateServiceMemberBackupContactCreated creates CreateServiceMemberBackupContactCreated with default headers values -func NewCreateServiceMemberBackupContactCreated() *CreateServiceMemberBackupContactCreated { - - return &CreateServiceMemberBackupContactCreated{} -} - -// WithPayload adds the payload to the create service member backup contact created response -func (o *CreateServiceMemberBackupContactCreated) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *CreateServiceMemberBackupContactCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service member backup contact created response -func (o *CreateServiceMemberBackupContactCreated) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceMemberBackupContactBadRequestCode is the HTTP code returned for type CreateServiceMemberBackupContactBadRequest -const CreateServiceMemberBackupContactBadRequestCode int = 400 - -/* -CreateServiceMemberBackupContactBadRequest invalid request - -swagger:response createServiceMemberBackupContactBadRequest -*/ -type CreateServiceMemberBackupContactBadRequest struct { -} - -// NewCreateServiceMemberBackupContactBadRequest creates CreateServiceMemberBackupContactBadRequest with default headers values -func NewCreateServiceMemberBackupContactBadRequest() *CreateServiceMemberBackupContactBadRequest { - - return &CreateServiceMemberBackupContactBadRequest{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type CreateServiceMemberBackupContactUnauthorized -const CreateServiceMemberBackupContactUnauthorizedCode int = 401 - -/* -CreateServiceMemberBackupContactUnauthorized request requires user authentication - -swagger:response createServiceMemberBackupContactUnauthorized -*/ -type CreateServiceMemberBackupContactUnauthorized struct { -} - -// NewCreateServiceMemberBackupContactUnauthorized creates CreateServiceMemberBackupContactUnauthorized with default headers values -func NewCreateServiceMemberBackupContactUnauthorized() *CreateServiceMemberBackupContactUnauthorized { - - return &CreateServiceMemberBackupContactUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateServiceMemberBackupContactForbiddenCode is the HTTP code returned for type CreateServiceMemberBackupContactForbidden -const CreateServiceMemberBackupContactForbiddenCode int = 403 - -/* -CreateServiceMemberBackupContactForbidden user is not authorized to create this backup contact - -swagger:response createServiceMemberBackupContactForbidden -*/ -type CreateServiceMemberBackupContactForbidden struct { -} - -// NewCreateServiceMemberBackupContactForbidden creates CreateServiceMemberBackupContactForbidden with default headers values -func NewCreateServiceMemberBackupContactForbidden() *CreateServiceMemberBackupContactForbidden { - - return &CreateServiceMemberBackupContactForbidden{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateServiceMemberBackupContactNotFoundCode is the HTTP code returned for type CreateServiceMemberBackupContactNotFound -const CreateServiceMemberBackupContactNotFoundCode int = 404 - -/* -CreateServiceMemberBackupContactNotFound contact not found - -swagger:response createServiceMemberBackupContactNotFound -*/ -type CreateServiceMemberBackupContactNotFound struct { -} - -// NewCreateServiceMemberBackupContactNotFound creates CreateServiceMemberBackupContactNotFound with default headers values -func NewCreateServiceMemberBackupContactNotFound() *CreateServiceMemberBackupContactNotFound { - - return &CreateServiceMemberBackupContactNotFound{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// CreateServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type CreateServiceMemberBackupContactInternalServerError -const CreateServiceMemberBackupContactInternalServerErrorCode int = 500 - -/* -CreateServiceMemberBackupContactInternalServerError internal server error - -swagger:response createServiceMemberBackupContactInternalServerError -*/ -type CreateServiceMemberBackupContactInternalServerError struct { -} - -// NewCreateServiceMemberBackupContactInternalServerError creates CreateServiceMemberBackupContactInternalServerError with default headers values -func NewCreateServiceMemberBackupContactInternalServerError() *CreateServiceMemberBackupContactInternalServerError { - - return &CreateServiceMemberBackupContactInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go deleted file mode 100644 index 088ce4e4f6c..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateServiceMemberBackupContactURL generates an URL for the create service member backup contact operation -type CreateServiceMemberBackupContactURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceMemberBackupContactURL) WithBasePath(bp string) *CreateServiceMemberBackupContactURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceMemberBackupContactURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServiceMemberBackupContactURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members/{serviceMemberId}/backup_contacts" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on CreateServiceMemberBackupContactURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServiceMemberBackupContactURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServiceMemberBackupContactURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServiceMemberBackupContactURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServiceMemberBackupContactURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go deleted file mode 100644 index 281b230637c..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexServiceMemberBackupContactsHandlerFunc turns a function with the right signature into a index service member backup contacts handler -type IndexServiceMemberBackupContactsHandlerFunc func(IndexServiceMemberBackupContactsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexServiceMemberBackupContactsHandlerFunc) Handle(params IndexServiceMemberBackupContactsParams) middleware.Responder { - return fn(params) -} - -// IndexServiceMemberBackupContactsHandler interface for that can handle valid index service member backup contacts params -type IndexServiceMemberBackupContactsHandler interface { - Handle(IndexServiceMemberBackupContactsParams) middleware.Responder -} - -// NewIndexServiceMemberBackupContacts creates a new http.Handler for the index service member backup contacts operation -func NewIndexServiceMemberBackupContacts(ctx *middleware.Context, handler IndexServiceMemberBackupContactsHandler) *IndexServiceMemberBackupContacts { - return &IndexServiceMemberBackupContacts{Context: ctx, Handler: handler} -} - -/* - IndexServiceMemberBackupContacts swagger:route GET /service_members/{serviceMemberId}/backup_contacts backup_contacts indexServiceMemberBackupContacts - -# List all service member backup contacts - -List all service member backup contacts -*/ -type IndexServiceMemberBackupContacts struct { - Context *middleware.Context - Handler IndexServiceMemberBackupContactsHandler -} - -func (o *IndexServiceMemberBackupContacts) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexServiceMemberBackupContactsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go deleted file mode 100644 index b3ff83c7055..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewIndexServiceMemberBackupContactsParams creates a new IndexServiceMemberBackupContactsParams object -// -// There are no default values defined in the spec. -func NewIndexServiceMemberBackupContactsParams() IndexServiceMemberBackupContactsParams { - - return IndexServiceMemberBackupContactsParams{} -} - -// IndexServiceMemberBackupContactsParams contains all the bound params for the index service member backup contacts operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexServiceMemberBackupContacts -type IndexServiceMemberBackupContactsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexServiceMemberBackupContactsParams() beforehand. -func (o *IndexServiceMemberBackupContactsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *IndexServiceMemberBackupContactsParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *IndexServiceMemberBackupContactsParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go deleted file mode 100644 index 5d1a51be1dc..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// IndexServiceMemberBackupContactsOKCode is the HTTP code returned for type IndexServiceMemberBackupContactsOK -const IndexServiceMemberBackupContactsOKCode int = 200 - -/* -IndexServiceMemberBackupContactsOK list of service member backup contacts - -swagger:response indexServiceMemberBackupContactsOK -*/ -type IndexServiceMemberBackupContactsOK struct { - - /* - In: Body - */ - Payload internalmessages.IndexServiceMemberBackupContactsPayload `json:"body,omitempty"` -} - -// NewIndexServiceMemberBackupContactsOK creates IndexServiceMemberBackupContactsOK with default headers values -func NewIndexServiceMemberBackupContactsOK() *IndexServiceMemberBackupContactsOK { - - return &IndexServiceMemberBackupContactsOK{} -} - -// WithPayload adds the payload to the index service member backup contacts o k response -func (o *IndexServiceMemberBackupContactsOK) WithPayload(payload internalmessages.IndexServiceMemberBackupContactsPayload) *IndexServiceMemberBackupContactsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index service member backup contacts o k response -func (o *IndexServiceMemberBackupContactsOK) SetPayload(payload internalmessages.IndexServiceMemberBackupContactsPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.IndexServiceMemberBackupContactsPayload{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexServiceMemberBackupContactsBadRequestCode is the HTTP code returned for type IndexServiceMemberBackupContactsBadRequest -const IndexServiceMemberBackupContactsBadRequestCode int = 400 - -/* -IndexServiceMemberBackupContactsBadRequest invalid request - -swagger:response indexServiceMemberBackupContactsBadRequest -*/ -type IndexServiceMemberBackupContactsBadRequest struct { -} - -// NewIndexServiceMemberBackupContactsBadRequest creates IndexServiceMemberBackupContactsBadRequest with default headers values -func NewIndexServiceMemberBackupContactsBadRequest() *IndexServiceMemberBackupContactsBadRequest { - - return &IndexServiceMemberBackupContactsBadRequest{} -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexServiceMemberBackupContactsUnauthorizedCode is the HTTP code returned for type IndexServiceMemberBackupContactsUnauthorized -const IndexServiceMemberBackupContactsUnauthorizedCode int = 401 - -/* -IndexServiceMemberBackupContactsUnauthorized request requires user authentication - -swagger:response indexServiceMemberBackupContactsUnauthorized -*/ -type IndexServiceMemberBackupContactsUnauthorized struct { -} - -// NewIndexServiceMemberBackupContactsUnauthorized creates IndexServiceMemberBackupContactsUnauthorized with default headers values -func NewIndexServiceMemberBackupContactsUnauthorized() *IndexServiceMemberBackupContactsUnauthorized { - - return &IndexServiceMemberBackupContactsUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexServiceMemberBackupContactsForbiddenCode is the HTTP code returned for type IndexServiceMemberBackupContactsForbidden -const IndexServiceMemberBackupContactsForbiddenCode int = 403 - -/* -IndexServiceMemberBackupContactsForbidden user is not authorized to see this backup contact - -swagger:response indexServiceMemberBackupContactsForbidden -*/ -type IndexServiceMemberBackupContactsForbidden struct { -} - -// NewIndexServiceMemberBackupContactsForbidden creates IndexServiceMemberBackupContactsForbidden with default headers values -func NewIndexServiceMemberBackupContactsForbidden() *IndexServiceMemberBackupContactsForbidden { - - return &IndexServiceMemberBackupContactsForbidden{} -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// IndexServiceMemberBackupContactsNotFoundCode is the HTTP code returned for type IndexServiceMemberBackupContactsNotFound -const IndexServiceMemberBackupContactsNotFoundCode int = 404 - -/* -IndexServiceMemberBackupContactsNotFound contact not found - -swagger:response indexServiceMemberBackupContactsNotFound -*/ -type IndexServiceMemberBackupContactsNotFound struct { -} - -// NewIndexServiceMemberBackupContactsNotFound creates IndexServiceMemberBackupContactsNotFound with default headers values -func NewIndexServiceMemberBackupContactsNotFound() *IndexServiceMemberBackupContactsNotFound { - - return &IndexServiceMemberBackupContactsNotFound{} -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexServiceMemberBackupContactsInternalServerErrorCode is the HTTP code returned for type IndexServiceMemberBackupContactsInternalServerError -const IndexServiceMemberBackupContactsInternalServerErrorCode int = 500 - -/* -IndexServiceMemberBackupContactsInternalServerError internal server error - -swagger:response indexServiceMemberBackupContactsInternalServerError -*/ -type IndexServiceMemberBackupContactsInternalServerError struct { -} - -// NewIndexServiceMemberBackupContactsInternalServerError creates IndexServiceMemberBackupContactsInternalServerError with default headers values -func NewIndexServiceMemberBackupContactsInternalServerError() *IndexServiceMemberBackupContactsInternalServerError { - - return &IndexServiceMemberBackupContactsInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexServiceMemberBackupContactsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go deleted file mode 100644 index ea6f9b96332..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// IndexServiceMemberBackupContactsURL generates an URL for the index service member backup contacts operation -type IndexServiceMemberBackupContactsURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexServiceMemberBackupContactsURL) WithBasePath(bp string) *IndexServiceMemberBackupContactsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexServiceMemberBackupContactsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexServiceMemberBackupContactsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members/{serviceMemberId}/backup_contacts" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on IndexServiceMemberBackupContactsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexServiceMemberBackupContactsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexServiceMemberBackupContactsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexServiceMemberBackupContactsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexServiceMemberBackupContactsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexServiceMemberBackupContactsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexServiceMemberBackupContactsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go deleted file mode 100644 index e0d1fd877c8..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowServiceMemberBackupContactHandlerFunc turns a function with the right signature into a show service member backup contact handler -type ShowServiceMemberBackupContactHandlerFunc func(ShowServiceMemberBackupContactParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowServiceMemberBackupContactHandlerFunc) Handle(params ShowServiceMemberBackupContactParams) middleware.Responder { - return fn(params) -} - -// ShowServiceMemberBackupContactHandler interface for that can handle valid show service member backup contact params -type ShowServiceMemberBackupContactHandler interface { - Handle(ShowServiceMemberBackupContactParams) middleware.Responder -} - -// NewShowServiceMemberBackupContact creates a new http.Handler for the show service member backup contact operation -func NewShowServiceMemberBackupContact(ctx *middleware.Context, handler ShowServiceMemberBackupContactHandler) *ShowServiceMemberBackupContact { - return &ShowServiceMemberBackupContact{Context: ctx, Handler: handler} -} - -/* - ShowServiceMemberBackupContact swagger:route GET /backup_contacts/{backupContactId} backup_contacts showServiceMemberBackupContact - -# Returns the given service member backup contact - -Returns the given service member backup contact -*/ -type ShowServiceMemberBackupContact struct { - Context *middleware.Context - Handler ShowServiceMemberBackupContactHandler -} - -func (o *ShowServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowServiceMemberBackupContactParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go deleted file mode 100644 index fbfd32adbb2..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowServiceMemberBackupContactParams creates a new ShowServiceMemberBackupContactParams object -// -// There are no default values defined in the spec. -func NewShowServiceMemberBackupContactParams() ShowServiceMemberBackupContactParams { - - return ShowServiceMemberBackupContactParams{} -} - -// ShowServiceMemberBackupContactParams contains all the bound params for the show service member backup contact operation -// typically these are obtained from a http.Request -// -// swagger:parameters showServiceMemberBackupContact -type ShowServiceMemberBackupContactParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member backup contact - Required: true - In: path - */ - BackupContactID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowServiceMemberBackupContactParams() beforehand. -func (o *ShowServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rBackupContactID, rhkBackupContactID, _ := route.Params.GetOK("backupContactId") - if err := o.bindBackupContactID(rBackupContactID, rhkBackupContactID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindBackupContactID binds and validates parameter BackupContactID from path. -func (o *ShowServiceMemberBackupContactParams) bindBackupContactID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("backupContactId", "path", "strfmt.UUID", raw) - } - o.BackupContactID = *(value.(*strfmt.UUID)) - - if err := o.validateBackupContactID(formats); err != nil { - return err - } - - return nil -} - -// validateBackupContactID carries on validations for parameter BackupContactID -func (o *ShowServiceMemberBackupContactParams) validateBackupContactID(formats strfmt.Registry) error { - - if err := validate.FormatOf("backupContactId", "path", "uuid", o.BackupContactID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go deleted file mode 100644 index 5ea47e13ef8..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowServiceMemberBackupContactOKCode is the HTTP code returned for type ShowServiceMemberBackupContactOK -const ShowServiceMemberBackupContactOKCode int = 200 - -/* -ShowServiceMemberBackupContactOK the instance of the service member backup contact - -swagger:response showServiceMemberBackupContactOK -*/ -type ShowServiceMemberBackupContactOK struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` -} - -// NewShowServiceMemberBackupContactOK creates ShowServiceMemberBackupContactOK with default headers values -func NewShowServiceMemberBackupContactOK() *ShowServiceMemberBackupContactOK { - - return &ShowServiceMemberBackupContactOK{} -} - -// WithPayload adds the payload to the show service member backup contact o k response -func (o *ShowServiceMemberBackupContactOK) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *ShowServiceMemberBackupContactOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show service member backup contact o k response -func (o *ShowServiceMemberBackupContactOK) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowServiceMemberBackupContactBadRequestCode is the HTTP code returned for type ShowServiceMemberBackupContactBadRequest -const ShowServiceMemberBackupContactBadRequestCode int = 400 - -/* -ShowServiceMemberBackupContactBadRequest invalid request - -swagger:response showServiceMemberBackupContactBadRequest -*/ -type ShowServiceMemberBackupContactBadRequest struct { -} - -// NewShowServiceMemberBackupContactBadRequest creates ShowServiceMemberBackupContactBadRequest with default headers values -func NewShowServiceMemberBackupContactBadRequest() *ShowServiceMemberBackupContactBadRequest { - - return &ShowServiceMemberBackupContactBadRequest{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type ShowServiceMemberBackupContactUnauthorized -const ShowServiceMemberBackupContactUnauthorizedCode int = 401 - -/* -ShowServiceMemberBackupContactUnauthorized request requires user authentication - -swagger:response showServiceMemberBackupContactUnauthorized -*/ -type ShowServiceMemberBackupContactUnauthorized struct { -} - -// NewShowServiceMemberBackupContactUnauthorized creates ShowServiceMemberBackupContactUnauthorized with default headers values -func NewShowServiceMemberBackupContactUnauthorized() *ShowServiceMemberBackupContactUnauthorized { - - return &ShowServiceMemberBackupContactUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowServiceMemberBackupContactForbiddenCode is the HTTP code returned for type ShowServiceMemberBackupContactForbidden -const ShowServiceMemberBackupContactForbiddenCode int = 403 - -/* -ShowServiceMemberBackupContactForbidden user is not authorized - -swagger:response showServiceMemberBackupContactForbidden -*/ -type ShowServiceMemberBackupContactForbidden struct { -} - -// NewShowServiceMemberBackupContactForbidden creates ShowServiceMemberBackupContactForbidden with default headers values -func NewShowServiceMemberBackupContactForbidden() *ShowServiceMemberBackupContactForbidden { - - return &ShowServiceMemberBackupContactForbidden{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowServiceMemberBackupContactNotFoundCode is the HTTP code returned for type ShowServiceMemberBackupContactNotFound -const ShowServiceMemberBackupContactNotFoundCode int = 404 - -/* -ShowServiceMemberBackupContactNotFound backup contact not found - -swagger:response showServiceMemberBackupContactNotFound -*/ -type ShowServiceMemberBackupContactNotFound struct { -} - -// NewShowServiceMemberBackupContactNotFound creates ShowServiceMemberBackupContactNotFound with default headers values -func NewShowServiceMemberBackupContactNotFound() *ShowServiceMemberBackupContactNotFound { - - return &ShowServiceMemberBackupContactNotFound{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberBackupContactInternalServerError -const ShowServiceMemberBackupContactInternalServerErrorCode int = 500 - -/* -ShowServiceMemberBackupContactInternalServerError internal server error - -swagger:response showServiceMemberBackupContactInternalServerError -*/ -type ShowServiceMemberBackupContactInternalServerError struct { -} - -// NewShowServiceMemberBackupContactInternalServerError creates ShowServiceMemberBackupContactInternalServerError with default headers values -func NewShowServiceMemberBackupContactInternalServerError() *ShowServiceMemberBackupContactInternalServerError { - - return &ShowServiceMemberBackupContactInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go deleted file mode 100644 index 4efa9c1cf62..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowServiceMemberBackupContactURL generates an URL for the show service member backup contact operation -type ShowServiceMemberBackupContactURL struct { - BackupContactID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberBackupContactURL) WithBasePath(bp string) *ShowServiceMemberBackupContactURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberBackupContactURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowServiceMemberBackupContactURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/backup_contacts/{backupContactId}" - - backupContactID := o.BackupContactID.String() - if backupContactID != "" { - _path = strings.Replace(_path, "{backupContactId}", backupContactID, -1) - } else { - return nil, errors.New("backupContactId is required on ShowServiceMemberBackupContactURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowServiceMemberBackupContactURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowServiceMemberBackupContactURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowServiceMemberBackupContactURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowServiceMemberBackupContactURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go deleted file mode 100644 index faea2478d65..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateServiceMemberBackupContactHandlerFunc turns a function with the right signature into a update service member backup contact handler -type UpdateServiceMemberBackupContactHandlerFunc func(UpdateServiceMemberBackupContactParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateServiceMemberBackupContactHandlerFunc) Handle(params UpdateServiceMemberBackupContactParams) middleware.Responder { - return fn(params) -} - -// UpdateServiceMemberBackupContactHandler interface for that can handle valid update service member backup contact params -type UpdateServiceMemberBackupContactHandler interface { - Handle(UpdateServiceMemberBackupContactParams) middleware.Responder -} - -// NewUpdateServiceMemberBackupContact creates a new http.Handler for the update service member backup contact operation -func NewUpdateServiceMemberBackupContact(ctx *middleware.Context, handler UpdateServiceMemberBackupContactHandler) *UpdateServiceMemberBackupContact { - return &UpdateServiceMemberBackupContact{Context: ctx, Handler: handler} -} - -/* - UpdateServiceMemberBackupContact swagger:route PUT /backup_contacts/{backupContactId} backup_contacts updateServiceMemberBackupContact - -# Updates a service member backup contact - -Any fields sent in this request will be set on the backup contact referenced -*/ -type UpdateServiceMemberBackupContact struct { - Context *middleware.Context - Handler UpdateServiceMemberBackupContactHandler -} - -func (o *UpdateServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateServiceMemberBackupContactParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go deleted file mode 100644 index b6ec9e515b1..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateServiceMemberBackupContactParams creates a new UpdateServiceMemberBackupContactParams object -// -// There are no default values defined in the spec. -func NewUpdateServiceMemberBackupContactParams() UpdateServiceMemberBackupContactParams { - - return UpdateServiceMemberBackupContactParams{} -} - -// UpdateServiceMemberBackupContactParams contains all the bound params for the update service member backup contact operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateServiceMemberBackupContact -type UpdateServiceMemberBackupContactParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member backup contact - Required: true - In: path - */ - BackupContactID strfmt.UUID - /* - Required: true - In: body - */ - UpdateServiceMemberBackupContactPayload *internalmessages.UpdateServiceMemberBackupContactPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateServiceMemberBackupContactParams() beforehand. -func (o *UpdateServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rBackupContactID, rhkBackupContactID, _ := route.Params.GetOK("backupContactId") - if err := o.bindBackupContactID(rBackupContactID, rhkBackupContactID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateServiceMemberBackupContactPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateServiceMemberBackupContactPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("updateServiceMemberBackupContactPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateServiceMemberBackupContactPayload = &body - } - } - } else { - res = append(res, errors.Required("updateServiceMemberBackupContactPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindBackupContactID binds and validates parameter BackupContactID from path. -func (o *UpdateServiceMemberBackupContactParams) bindBackupContactID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("backupContactId", "path", "strfmt.UUID", raw) - } - o.BackupContactID = *(value.(*strfmt.UUID)) - - if err := o.validateBackupContactID(formats); err != nil { - return err - } - - return nil -} - -// validateBackupContactID carries on validations for parameter BackupContactID -func (o *UpdateServiceMemberBackupContactParams) validateBackupContactID(formats strfmt.Registry) error { - - if err := validate.FormatOf("backupContactId", "path", "uuid", o.BackupContactID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go deleted file mode 100644 index f52a1eb8f88..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateServiceMemberBackupContactCreatedCode is the HTTP code returned for type UpdateServiceMemberBackupContactCreated -const UpdateServiceMemberBackupContactCreatedCode int = 201 - -/* -UpdateServiceMemberBackupContactCreated updated instance of backup contact - -swagger:response updateServiceMemberBackupContactCreated -*/ -type UpdateServiceMemberBackupContactCreated struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` -} - -// NewUpdateServiceMemberBackupContactCreated creates UpdateServiceMemberBackupContactCreated with default headers values -func NewUpdateServiceMemberBackupContactCreated() *UpdateServiceMemberBackupContactCreated { - - return &UpdateServiceMemberBackupContactCreated{} -} - -// WithPayload adds the payload to the update service member backup contact created response -func (o *UpdateServiceMemberBackupContactCreated) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *UpdateServiceMemberBackupContactCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update service member backup contact created response -func (o *UpdateServiceMemberBackupContactCreated) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateServiceMemberBackupContactBadRequestCode is the HTTP code returned for type UpdateServiceMemberBackupContactBadRequest -const UpdateServiceMemberBackupContactBadRequestCode int = 400 - -/* -UpdateServiceMemberBackupContactBadRequest invalid request - -swagger:response updateServiceMemberBackupContactBadRequest -*/ -type UpdateServiceMemberBackupContactBadRequest struct { -} - -// NewUpdateServiceMemberBackupContactBadRequest creates UpdateServiceMemberBackupContactBadRequest with default headers values -func NewUpdateServiceMemberBackupContactBadRequest() *UpdateServiceMemberBackupContactBadRequest { - - return &UpdateServiceMemberBackupContactBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type UpdateServiceMemberBackupContactUnauthorized -const UpdateServiceMemberBackupContactUnauthorizedCode int = 401 - -/* -UpdateServiceMemberBackupContactUnauthorized request requires user authentication - -swagger:response updateServiceMemberBackupContactUnauthorized -*/ -type UpdateServiceMemberBackupContactUnauthorized struct { -} - -// NewUpdateServiceMemberBackupContactUnauthorized creates UpdateServiceMemberBackupContactUnauthorized with default headers values -func NewUpdateServiceMemberBackupContactUnauthorized() *UpdateServiceMemberBackupContactUnauthorized { - - return &UpdateServiceMemberBackupContactUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateServiceMemberBackupContactForbiddenCode is the HTTP code returned for type UpdateServiceMemberBackupContactForbidden -const UpdateServiceMemberBackupContactForbiddenCode int = 403 - -/* -UpdateServiceMemberBackupContactForbidden user is not authorized - -swagger:response updateServiceMemberBackupContactForbidden -*/ -type UpdateServiceMemberBackupContactForbidden struct { -} - -// NewUpdateServiceMemberBackupContactForbidden creates UpdateServiceMemberBackupContactForbidden with default headers values -func NewUpdateServiceMemberBackupContactForbidden() *UpdateServiceMemberBackupContactForbidden { - - return &UpdateServiceMemberBackupContactForbidden{} -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateServiceMemberBackupContactNotFoundCode is the HTTP code returned for type UpdateServiceMemberBackupContactNotFound -const UpdateServiceMemberBackupContactNotFoundCode int = 404 - -/* -UpdateServiceMemberBackupContactNotFound backup contact not found - -swagger:response updateServiceMemberBackupContactNotFound -*/ -type UpdateServiceMemberBackupContactNotFound struct { -} - -// NewUpdateServiceMemberBackupContactNotFound creates UpdateServiceMemberBackupContactNotFound with default headers values -func NewUpdateServiceMemberBackupContactNotFound() *UpdateServiceMemberBackupContactNotFound { - - return &UpdateServiceMemberBackupContactNotFound{} -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type UpdateServiceMemberBackupContactInternalServerError -const UpdateServiceMemberBackupContactInternalServerErrorCode int = 500 - -/* -UpdateServiceMemberBackupContactInternalServerError internal server error - -swagger:response updateServiceMemberBackupContactInternalServerError -*/ -type UpdateServiceMemberBackupContactInternalServerError struct { -} - -// NewUpdateServiceMemberBackupContactInternalServerError creates UpdateServiceMemberBackupContactInternalServerError with default headers values -func NewUpdateServiceMemberBackupContactInternalServerError() *UpdateServiceMemberBackupContactInternalServerError { - - return &UpdateServiceMemberBackupContactInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go deleted file mode 100644 index c2ee00351ac..00000000000 --- a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package backup_contacts - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateServiceMemberBackupContactURL generates an URL for the update service member backup contact operation -type UpdateServiceMemberBackupContactURL struct { - BackupContactID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceMemberBackupContactURL) WithBasePath(bp string) *UpdateServiceMemberBackupContactURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateServiceMemberBackupContactURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateServiceMemberBackupContactURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/backup_contacts/{backupContactId}" - - backupContactID := o.BackupContactID.String() - if backupContactID != "" { - _path = strings.Replace(_path, "{backupContactId}", backupContactID, -1) - } else { - return nil, errors.New("backupContactId is required on UpdateServiceMemberBackupContactURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateServiceMemberBackupContactURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateServiceMemberBackupContactURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateServiceMemberBackupContactURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateServiceMemberBackupContactURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go deleted file mode 100644 index 2391d9fec61..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IsDateWeekendHolidayHandlerFunc turns a function with the right signature into a is date weekend holiday handler -type IsDateWeekendHolidayHandlerFunc func(IsDateWeekendHolidayParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IsDateWeekendHolidayHandlerFunc) Handle(params IsDateWeekendHolidayParams) middleware.Responder { - return fn(params) -} - -// IsDateWeekendHolidayHandler interface for that can handle valid is date weekend holiday params -type IsDateWeekendHolidayHandler interface { - Handle(IsDateWeekendHolidayParams) middleware.Responder -} - -// NewIsDateWeekendHoliday creates a new http.Handler for the is date weekend holiday operation -func NewIsDateWeekendHoliday(ctx *middleware.Context, handler IsDateWeekendHolidayHandler) *IsDateWeekendHoliday { - return &IsDateWeekendHoliday{Context: ctx, Handler: handler} -} - -/* - IsDateWeekendHoliday swagger:route GET /calendar/{countryCode}/is-weekend-holiday/{date} calendar isDateWeekendHoliday - -# Validate move date selection - -Utility API to determine if input date falls on weekend and/or holiday. -*/ -type IsDateWeekendHoliday struct { - Context *middleware.Context - Handler IsDateWeekendHolidayHandler -} - -func (o *IsDateWeekendHoliday) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIsDateWeekendHolidayParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go deleted file mode 100644 index bb43341894d..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewIsDateWeekendHolidayParams creates a new IsDateWeekendHolidayParams object -// -// There are no default values defined in the spec. -func NewIsDateWeekendHolidayParams() IsDateWeekendHolidayParams { - - return IsDateWeekendHolidayParams{} -} - -// IsDateWeekendHolidayParams contains all the bound params for the is date weekend holiday operation -// typically these are obtained from a http.Request -// -// swagger:parameters isDateWeekendHoliday -type IsDateWeekendHolidayParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*country code for context of date - Required: true - In: path - */ - CountryCode string - /*input date to determine if weekend/holiday for given country. - Required: true - In: path - */ - Date strfmt.Date -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIsDateWeekendHolidayParams() beforehand. -func (o *IsDateWeekendHolidayParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rCountryCode, rhkCountryCode, _ := route.Params.GetOK("countryCode") - if err := o.bindCountryCode(rCountryCode, rhkCountryCode, route.Formats); err != nil { - res = append(res, err) - } - - rDate, rhkDate, _ := route.Params.GetOK("date") - if err := o.bindDate(rDate, rhkDate, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindCountryCode binds and validates parameter CountryCode from path. -func (o *IsDateWeekendHolidayParams) bindCountryCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.CountryCode = raw - - if err := o.validateCountryCode(formats); err != nil { - return err - } - - return nil -} - -// validateCountryCode carries on validations for parameter CountryCode -func (o *IsDateWeekendHolidayParams) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.EnumCase("countryCode", "path", o.CountryCode, []interface{}{"US"}, true); err != nil { - return err - } - - return nil -} - -// bindDate binds and validates parameter Date from path. -func (o *IsDateWeekendHolidayParams) bindDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: date - value, err := formats.Parse("date", raw) - if err != nil { - return errors.InvalidType("date", "path", "strfmt.Date", raw) - } - o.Date = *(value.(*strfmt.Date)) - - if err := o.validateDate(formats); err != nil { - return err - } - - return nil -} - -// validateDate carries on validations for parameter Date -func (o *IsDateWeekendHolidayParams) validateDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("date", "path", "date", o.Date.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go deleted file mode 100644 index 61070103010..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// IsDateWeekendHolidayOKCode is the HTTP code returned for type IsDateWeekendHolidayOK -const IsDateWeekendHolidayOKCode int = 200 - -/* -IsDateWeekendHolidayOK Successfully determine if given date is weekend and/or holiday for given country. - -swagger:response isDateWeekendHolidayOK -*/ -type IsDateWeekendHolidayOK struct { - - /* - In: Body - */ - Payload *internalmessages.IsDateWeekendHolidayInfo `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayOK creates IsDateWeekendHolidayOK with default headers values -func NewIsDateWeekendHolidayOK() *IsDateWeekendHolidayOK { - - return &IsDateWeekendHolidayOK{} -} - -// WithPayload adds the payload to the is date weekend holiday o k response -func (o *IsDateWeekendHolidayOK) WithPayload(payload *internalmessages.IsDateWeekendHolidayInfo) *IsDateWeekendHolidayOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday o k response -func (o *IsDateWeekendHolidayOK) SetPayload(payload *internalmessages.IsDateWeekendHolidayInfo) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayBadRequestCode is the HTTP code returned for type IsDateWeekendHolidayBadRequest -const IsDateWeekendHolidayBadRequestCode int = 400 - -/* -IsDateWeekendHolidayBadRequest The request payload is invalid. - -swagger:response isDateWeekendHolidayBadRequest -*/ -type IsDateWeekendHolidayBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayBadRequest creates IsDateWeekendHolidayBadRequest with default headers values -func NewIsDateWeekendHolidayBadRequest() *IsDateWeekendHolidayBadRequest { - - return &IsDateWeekendHolidayBadRequest{} -} - -// WithPayload adds the payload to the is date weekend holiday bad request response -func (o *IsDateWeekendHolidayBadRequest) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday bad request response -func (o *IsDateWeekendHolidayBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayUnauthorizedCode is the HTTP code returned for type IsDateWeekendHolidayUnauthorized -const IsDateWeekendHolidayUnauthorizedCode int = 401 - -/* -IsDateWeekendHolidayUnauthorized The request was denied. - -swagger:response isDateWeekendHolidayUnauthorized -*/ -type IsDateWeekendHolidayUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayUnauthorized creates IsDateWeekendHolidayUnauthorized with default headers values -func NewIsDateWeekendHolidayUnauthorized() *IsDateWeekendHolidayUnauthorized { - - return &IsDateWeekendHolidayUnauthorized{} -} - -// WithPayload adds the payload to the is date weekend holiday unauthorized response -func (o *IsDateWeekendHolidayUnauthorized) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday unauthorized response -func (o *IsDateWeekendHolidayUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayNotFoundCode is the HTTP code returned for type IsDateWeekendHolidayNotFound -const IsDateWeekendHolidayNotFoundCode int = 404 - -/* -IsDateWeekendHolidayNotFound The requested resource wasn't found. - -swagger:response isDateWeekendHolidayNotFound -*/ -type IsDateWeekendHolidayNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayNotFound creates IsDateWeekendHolidayNotFound with default headers values -func NewIsDateWeekendHolidayNotFound() *IsDateWeekendHolidayNotFound { - - return &IsDateWeekendHolidayNotFound{} -} - -// WithPayload adds the payload to the is date weekend holiday not found response -func (o *IsDateWeekendHolidayNotFound) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday not found response -func (o *IsDateWeekendHolidayNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsDateWeekendHolidayInternalServerErrorCode is the HTTP code returned for type IsDateWeekendHolidayInternalServerError -const IsDateWeekendHolidayInternalServerErrorCode int = 500 - -/* -IsDateWeekendHolidayInternalServerError A server error occurred. - -swagger:response isDateWeekendHolidayInternalServerError -*/ -type IsDateWeekendHolidayInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewIsDateWeekendHolidayInternalServerError creates IsDateWeekendHolidayInternalServerError with default headers values -func NewIsDateWeekendHolidayInternalServerError() *IsDateWeekendHolidayInternalServerError { - - return &IsDateWeekendHolidayInternalServerError{} -} - -// WithPayload adds the payload to the is date weekend holiday internal server error response -func (o *IsDateWeekendHolidayInternalServerError) WithPayload(payload *internalmessages.Error) *IsDateWeekendHolidayInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is date weekend holiday internal server error response -func (o *IsDateWeekendHolidayInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsDateWeekendHolidayInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go deleted file mode 100644 index 6f9666b8702..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// IsDateWeekendHolidayURL generates an URL for the is date weekend holiday operation -type IsDateWeekendHolidayURL struct { - CountryCode string - Date strfmt.Date - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsDateWeekendHolidayURL) WithBasePath(bp string) *IsDateWeekendHolidayURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsDateWeekendHolidayURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IsDateWeekendHolidayURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/calendar/{countryCode}/is-weekend-holiday/{date}" - - countryCode := o.CountryCode - if countryCode != "" { - _path = strings.Replace(_path, "{countryCode}", countryCode, -1) - } else { - return nil, errors.New("countryCode is required on IsDateWeekendHolidayURL") - } - - date := o.Date.String() - if date != "" { - _path = strings.Replace(_path, "{date}", date, -1) - } else { - return nil, errors.New("date is required on IsDateWeekendHolidayURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IsDateWeekendHolidayURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IsDateWeekendHolidayURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IsDateWeekendHolidayURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IsDateWeekendHolidayURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IsDateWeekendHolidayURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IsDateWeekendHolidayURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go deleted file mode 100644 index f2bfe088744..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowAvailableMoveDatesHandlerFunc turns a function with the right signature into a show available move dates handler -type ShowAvailableMoveDatesHandlerFunc func(ShowAvailableMoveDatesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowAvailableMoveDatesHandlerFunc) Handle(params ShowAvailableMoveDatesParams) middleware.Responder { - return fn(params) -} - -// ShowAvailableMoveDatesHandler interface for that can handle valid show available move dates params -type ShowAvailableMoveDatesHandler interface { - Handle(ShowAvailableMoveDatesParams) middleware.Responder -} - -// NewShowAvailableMoveDates creates a new http.Handler for the show available move dates operation -func NewShowAvailableMoveDates(ctx *middleware.Context, handler ShowAvailableMoveDatesHandler) *ShowAvailableMoveDates { - return &ShowAvailableMoveDates{Context: ctx, Handler: handler} -} - -/* - ShowAvailableMoveDates swagger:route GET /calendar/available_move_dates calendar showAvailableMoveDates - -# Returns available dates for the move calendar - -Returns available dates for the move calendar -*/ -type ShowAvailableMoveDates struct { - Context *middleware.Context - Handler ShowAvailableMoveDatesHandler -} - -func (o *ShowAvailableMoveDates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowAvailableMoveDatesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go deleted file mode 100644 index 211c0a93cb2..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowAvailableMoveDatesParams creates a new ShowAvailableMoveDatesParams object -// -// There are no default values defined in the spec. -func NewShowAvailableMoveDatesParams() ShowAvailableMoveDatesParams { - - return ShowAvailableMoveDatesParams{} -} - -// ShowAvailableMoveDatesParams contains all the bound params for the show available move dates operation -// typically these are obtained from a http.Request -// -// swagger:parameters showAvailableMoveDates -type ShowAvailableMoveDatesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Look for future available dates starting from (and including) this date - Required: true - In: query - */ - StartDate strfmt.Date -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowAvailableMoveDatesParams() beforehand. -func (o *ShowAvailableMoveDatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qStartDate, qhkStartDate, _ := qs.GetOK("startDate") - if err := o.bindStartDate(qStartDate, qhkStartDate, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindStartDate binds and validates parameter StartDate from query. -func (o *ShowAvailableMoveDatesParams) bindStartDate(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("startDate", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("startDate", "query", raw); err != nil { - return err - } - - // Format: date - value, err := formats.Parse("date", raw) - if err != nil { - return errors.InvalidType("startDate", "query", "strfmt.Date", raw) - } - o.StartDate = *(value.(*strfmt.Date)) - - if err := o.validateStartDate(formats); err != nil { - return err - } - - return nil -} - -// validateStartDate carries on validations for parameter StartDate -func (o *ShowAvailableMoveDatesParams) validateStartDate(formats strfmt.Registry) error { - - if err := validate.FormatOf("startDate", "query", "date", o.StartDate.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go deleted file mode 100644 index 779f5e52c86..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowAvailableMoveDatesOKCode is the HTTP code returned for type ShowAvailableMoveDatesOK -const ShowAvailableMoveDatesOKCode int = 200 - -/* -ShowAvailableMoveDatesOK List of available dates - -swagger:response showAvailableMoveDatesOK -*/ -type ShowAvailableMoveDatesOK struct { - - /* - In: Body - */ - Payload *internalmessages.AvailableMoveDates `json:"body,omitempty"` -} - -// NewShowAvailableMoveDatesOK creates ShowAvailableMoveDatesOK with default headers values -func NewShowAvailableMoveDatesOK() *ShowAvailableMoveDatesOK { - - return &ShowAvailableMoveDatesOK{} -} - -// WithPayload adds the payload to the show available move dates o k response -func (o *ShowAvailableMoveDatesOK) WithPayload(payload *internalmessages.AvailableMoveDates) *ShowAvailableMoveDatesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show available move dates o k response -func (o *ShowAvailableMoveDatesOK) SetPayload(payload *internalmessages.AvailableMoveDates) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAvailableMoveDatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAvailableMoveDatesBadRequestCode is the HTTP code returned for type ShowAvailableMoveDatesBadRequest -const ShowAvailableMoveDatesBadRequestCode int = 400 - -/* -ShowAvailableMoveDatesBadRequest invalid request - -swagger:response showAvailableMoveDatesBadRequest -*/ -type ShowAvailableMoveDatesBadRequest struct { -} - -// NewShowAvailableMoveDatesBadRequest creates ShowAvailableMoveDatesBadRequest with default headers values -func NewShowAvailableMoveDatesBadRequest() *ShowAvailableMoveDatesBadRequest { - - return &ShowAvailableMoveDatesBadRequest{} -} - -// WriteResponse to the client -func (o *ShowAvailableMoveDatesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowAvailableMoveDatesUnauthorizedCode is the HTTP code returned for type ShowAvailableMoveDatesUnauthorized -const ShowAvailableMoveDatesUnauthorizedCode int = 401 - -/* -ShowAvailableMoveDatesUnauthorized request requires user authentication - -swagger:response showAvailableMoveDatesUnauthorized -*/ -type ShowAvailableMoveDatesUnauthorized struct { -} - -// NewShowAvailableMoveDatesUnauthorized creates ShowAvailableMoveDatesUnauthorized with default headers values -func NewShowAvailableMoveDatesUnauthorized() *ShowAvailableMoveDatesUnauthorized { - - return &ShowAvailableMoveDatesUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowAvailableMoveDatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowAvailableMoveDatesForbiddenCode is the HTTP code returned for type ShowAvailableMoveDatesForbidden -const ShowAvailableMoveDatesForbiddenCode int = 403 - -/* -ShowAvailableMoveDatesForbidden user is not authorized - -swagger:response showAvailableMoveDatesForbidden -*/ -type ShowAvailableMoveDatesForbidden struct { -} - -// NewShowAvailableMoveDatesForbidden creates ShowAvailableMoveDatesForbidden with default headers values -func NewShowAvailableMoveDatesForbidden() *ShowAvailableMoveDatesForbidden { - - return &ShowAvailableMoveDatesForbidden{} -} - -// WriteResponse to the client -func (o *ShowAvailableMoveDatesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowAvailableMoveDatesInternalServerErrorCode is the HTTP code returned for type ShowAvailableMoveDatesInternalServerError -const ShowAvailableMoveDatesInternalServerErrorCode int = 500 - -/* -ShowAvailableMoveDatesInternalServerError internal server error - -swagger:response showAvailableMoveDatesInternalServerError -*/ -type ShowAvailableMoveDatesInternalServerError struct { -} - -// NewShowAvailableMoveDatesInternalServerError creates ShowAvailableMoveDatesInternalServerError with default headers values -func NewShowAvailableMoveDatesInternalServerError() *ShowAvailableMoveDatesInternalServerError { - - return &ShowAvailableMoveDatesInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowAvailableMoveDatesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go deleted file mode 100644 index 662e4248c9b..00000000000 --- a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package calendar - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// ShowAvailableMoveDatesURL generates an URL for the show available move dates operation -type ShowAvailableMoveDatesURL struct { - StartDate strfmt.Date - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAvailableMoveDatesURL) WithBasePath(bp string) *ShowAvailableMoveDatesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAvailableMoveDatesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowAvailableMoveDatesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/calendar/available_move_dates" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - startDateQ := o.StartDate.String() - if startDateQ != "" { - qs.Set("startDate", startDateQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowAvailableMoveDatesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowAvailableMoveDatesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowAvailableMoveDatesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowAvailableMoveDatesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowAvailableMoveDatesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowAvailableMoveDatesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go deleted file mode 100644 index 8ed4f999704..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateSignedCertificationHandlerFunc turns a function with the right signature into a create signed certification handler -type CreateSignedCertificationHandlerFunc func(CreateSignedCertificationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateSignedCertificationHandlerFunc) Handle(params CreateSignedCertificationParams) middleware.Responder { - return fn(params) -} - -// CreateSignedCertificationHandler interface for that can handle valid create signed certification params -type CreateSignedCertificationHandler interface { - Handle(CreateSignedCertificationParams) middleware.Responder -} - -// NewCreateSignedCertification creates a new http.Handler for the create signed certification operation -func NewCreateSignedCertification(ctx *middleware.Context, handler CreateSignedCertificationHandler) *CreateSignedCertification { - return &CreateSignedCertification{Context: ctx, Handler: handler} -} - -/* - CreateSignedCertification swagger:route POST /moves/{moveId}/signed_certifications certification createSignedCertification - -# Submits signed certification for the given move ID - -Create an instance of signed_certification tied to the move ID -*/ -type CreateSignedCertification struct { - Context *middleware.Context - Handler CreateSignedCertificationHandler -} - -func (o *CreateSignedCertification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateSignedCertificationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go deleted file mode 100644 index 733bc6d3822..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateSignedCertificationParams creates a new CreateSignedCertificationParams object -// -// There are no default values defined in the spec. -func NewCreateSignedCertificationParams() CreateSignedCertificationParams { - - return CreateSignedCertificationParams{} -} - -// CreateSignedCertificationParams contains all the bound params for the create signed certification operation -// typically these are obtained from a http.Request -// -// swagger:parameters createSignedCertification -type CreateSignedCertificationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateSignedCertificationPayload *internalmessages.CreateSignedCertificationPayload - /*UUID of the move being signed for - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateSignedCertificationParams() beforehand. -func (o *CreateSignedCertificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateSignedCertificationPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createSignedCertificationPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("createSignedCertificationPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateSignedCertificationPayload = &body - } - } - } else { - res = append(res, errors.Required("createSignedCertificationPayload", "body", "")) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *CreateSignedCertificationParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *CreateSignedCertificationParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go deleted file mode 100644 index 0d3bf6f8b7c..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateSignedCertificationCreatedCode is the HTTP code returned for type CreateSignedCertificationCreated -const CreateSignedCertificationCreatedCode int = 201 - -/* -CreateSignedCertificationCreated created instance of signed_certification - -swagger:response createSignedCertificationCreated -*/ -type CreateSignedCertificationCreated struct { - - /* - In: Body - */ - Payload *internalmessages.SignedCertificationPayload `json:"body,omitempty"` -} - -// NewCreateSignedCertificationCreated creates CreateSignedCertificationCreated with default headers values -func NewCreateSignedCertificationCreated() *CreateSignedCertificationCreated { - - return &CreateSignedCertificationCreated{} -} - -// WithPayload adds the payload to the create signed certification created response -func (o *CreateSignedCertificationCreated) WithPayload(payload *internalmessages.SignedCertificationPayload) *CreateSignedCertificationCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create signed certification created response -func (o *CreateSignedCertificationCreated) SetPayload(payload *internalmessages.SignedCertificationPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSignedCertificationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSignedCertificationBadRequestCode is the HTTP code returned for type CreateSignedCertificationBadRequest -const CreateSignedCertificationBadRequestCode int = 400 - -/* -CreateSignedCertificationBadRequest invalid request - -swagger:response createSignedCertificationBadRequest -*/ -type CreateSignedCertificationBadRequest struct { -} - -// NewCreateSignedCertificationBadRequest creates CreateSignedCertificationBadRequest with default headers values -func NewCreateSignedCertificationBadRequest() *CreateSignedCertificationBadRequest { - - return &CreateSignedCertificationBadRequest{} -} - -// WriteResponse to the client -func (o *CreateSignedCertificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateSignedCertificationUnauthorizedCode is the HTTP code returned for type CreateSignedCertificationUnauthorized -const CreateSignedCertificationUnauthorizedCode int = 401 - -/* -CreateSignedCertificationUnauthorized request requires user authentication - -swagger:response createSignedCertificationUnauthorized -*/ -type CreateSignedCertificationUnauthorized struct { -} - -// NewCreateSignedCertificationUnauthorized creates CreateSignedCertificationUnauthorized with default headers values -func NewCreateSignedCertificationUnauthorized() *CreateSignedCertificationUnauthorized { - - return &CreateSignedCertificationUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateSignedCertificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateSignedCertificationForbiddenCode is the HTTP code returned for type CreateSignedCertificationForbidden -const CreateSignedCertificationForbiddenCode int = 403 - -/* -CreateSignedCertificationForbidden user is not authorized to sign for this move - -swagger:response createSignedCertificationForbidden -*/ -type CreateSignedCertificationForbidden struct { -} - -// NewCreateSignedCertificationForbidden creates CreateSignedCertificationForbidden with default headers values -func NewCreateSignedCertificationForbidden() *CreateSignedCertificationForbidden { - - return &CreateSignedCertificationForbidden{} -} - -// WriteResponse to the client -func (o *CreateSignedCertificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateSignedCertificationNotFoundCode is the HTTP code returned for type CreateSignedCertificationNotFound -const CreateSignedCertificationNotFoundCode int = 404 - -/* -CreateSignedCertificationNotFound move not found - -swagger:response createSignedCertificationNotFound -*/ -type CreateSignedCertificationNotFound struct { -} - -// NewCreateSignedCertificationNotFound creates CreateSignedCertificationNotFound with default headers values -func NewCreateSignedCertificationNotFound() *CreateSignedCertificationNotFound { - - return &CreateSignedCertificationNotFound{} -} - -// WriteResponse to the client -func (o *CreateSignedCertificationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// CreateSignedCertificationInternalServerErrorCode is the HTTP code returned for type CreateSignedCertificationInternalServerError -const CreateSignedCertificationInternalServerErrorCode int = 500 - -/* -CreateSignedCertificationInternalServerError internal server error - -swagger:response createSignedCertificationInternalServerError -*/ -type CreateSignedCertificationInternalServerError struct { -} - -// NewCreateSignedCertificationInternalServerError creates CreateSignedCertificationInternalServerError with default headers values -func NewCreateSignedCertificationInternalServerError() *CreateSignedCertificationInternalServerError { - - return &CreateSignedCertificationInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateSignedCertificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go deleted file mode 100644 index 8cf71476144..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateSignedCertificationURL generates an URL for the create signed certification operation -type CreateSignedCertificationURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSignedCertificationURL) WithBasePath(bp string) *CreateSignedCertificationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSignedCertificationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateSignedCertificationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/signed_certifications" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on CreateSignedCertificationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateSignedCertificationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateSignedCertificationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateSignedCertificationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateSignedCertificationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateSignedCertificationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateSignedCertificationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go deleted file mode 100644 index 7722cbc1338..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexSignedCertificationHandlerFunc turns a function with the right signature into a index signed certification handler -type IndexSignedCertificationHandlerFunc func(IndexSignedCertificationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexSignedCertificationHandlerFunc) Handle(params IndexSignedCertificationParams) middleware.Responder { - return fn(params) -} - -// IndexSignedCertificationHandler interface for that can handle valid index signed certification params -type IndexSignedCertificationHandler interface { - Handle(IndexSignedCertificationParams) middleware.Responder -} - -// NewIndexSignedCertification creates a new http.Handler for the index signed certification operation -func NewIndexSignedCertification(ctx *middleware.Context, handler IndexSignedCertificationHandler) *IndexSignedCertification { - return &IndexSignedCertification{Context: ctx, Handler: handler} -} - -/* - IndexSignedCertification swagger:route GET /moves/{moveId}/signed_certifications certification indexSignedCertification - -gets the signed certifications for the given move ID - -returns a list of all signed_certifications associated with the move ID -*/ -type IndexSignedCertification struct { - Context *middleware.Context - Handler IndexSignedCertificationHandler -} - -func (o *IndexSignedCertification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexSignedCertificationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go deleted file mode 100644 index 055d4cb5751..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewIndexSignedCertificationParams creates a new IndexSignedCertificationParams object -// -// There are no default values defined in the spec. -func NewIndexSignedCertificationParams() IndexSignedCertificationParams { - - return IndexSignedCertificationParams{} -} - -// IndexSignedCertificationParams contains all the bound params for the index signed certification operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexSignedCertification -type IndexSignedCertificationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexSignedCertificationParams() beforehand. -func (o *IndexSignedCertificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *IndexSignedCertificationParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *IndexSignedCertificationParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go deleted file mode 100644 index e9511fdfd3a..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// IndexSignedCertificationOKCode is the HTTP code returned for type IndexSignedCertificationOK -const IndexSignedCertificationOKCode int = 200 - -/* -IndexSignedCertificationOK returns a list of signed certifications - -swagger:response indexSignedCertificationOK -*/ -type IndexSignedCertificationOK struct { - - /* - In: Body - */ - Payload internalmessages.SignedCertifications `json:"body,omitempty"` -} - -// NewIndexSignedCertificationOK creates IndexSignedCertificationOK with default headers values -func NewIndexSignedCertificationOK() *IndexSignedCertificationOK { - - return &IndexSignedCertificationOK{} -} - -// WithPayload adds the payload to the index signed certification o k response -func (o *IndexSignedCertificationOK) WithPayload(payload internalmessages.SignedCertifications) *IndexSignedCertificationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index signed certification o k response -func (o *IndexSignedCertificationOK) SetPayload(payload internalmessages.SignedCertifications) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexSignedCertificationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.SignedCertifications{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexSignedCertificationBadRequestCode is the HTTP code returned for type IndexSignedCertificationBadRequest -const IndexSignedCertificationBadRequestCode int = 400 - -/* -IndexSignedCertificationBadRequest invalid request - -swagger:response indexSignedCertificationBadRequest -*/ -type IndexSignedCertificationBadRequest struct { -} - -// NewIndexSignedCertificationBadRequest creates IndexSignedCertificationBadRequest with default headers values -func NewIndexSignedCertificationBadRequest() *IndexSignedCertificationBadRequest { - - return &IndexSignedCertificationBadRequest{} -} - -// WriteResponse to the client -func (o *IndexSignedCertificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexSignedCertificationUnauthorizedCode is the HTTP code returned for type IndexSignedCertificationUnauthorized -const IndexSignedCertificationUnauthorizedCode int = 401 - -/* -IndexSignedCertificationUnauthorized request requires user authentication - -swagger:response indexSignedCertificationUnauthorized -*/ -type IndexSignedCertificationUnauthorized struct { -} - -// NewIndexSignedCertificationUnauthorized creates IndexSignedCertificationUnauthorized with default headers values -func NewIndexSignedCertificationUnauthorized() *IndexSignedCertificationUnauthorized { - - return &IndexSignedCertificationUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexSignedCertificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexSignedCertificationForbiddenCode is the HTTP code returned for type IndexSignedCertificationForbidden -const IndexSignedCertificationForbiddenCode int = 403 - -/* -IndexSignedCertificationForbidden user is not authorized - -swagger:response indexSignedCertificationForbidden -*/ -type IndexSignedCertificationForbidden struct { -} - -// NewIndexSignedCertificationForbidden creates IndexSignedCertificationForbidden with default headers values -func NewIndexSignedCertificationForbidden() *IndexSignedCertificationForbidden { - - return &IndexSignedCertificationForbidden{} -} - -// WriteResponse to the client -func (o *IndexSignedCertificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// IndexSignedCertificationNotFoundCode is the HTTP code returned for type IndexSignedCertificationNotFound -const IndexSignedCertificationNotFoundCode int = 404 - -/* -IndexSignedCertificationNotFound move not found - -swagger:response indexSignedCertificationNotFound -*/ -type IndexSignedCertificationNotFound struct { -} - -// NewIndexSignedCertificationNotFound creates IndexSignedCertificationNotFound with default headers values -func NewIndexSignedCertificationNotFound() *IndexSignedCertificationNotFound { - - return &IndexSignedCertificationNotFound{} -} - -// WriteResponse to the client -func (o *IndexSignedCertificationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// IndexSignedCertificationInternalServerErrorCode is the HTTP code returned for type IndexSignedCertificationInternalServerError -const IndexSignedCertificationInternalServerErrorCode int = 500 - -/* -IndexSignedCertificationInternalServerError internal server error - -swagger:response indexSignedCertificationInternalServerError -*/ -type IndexSignedCertificationInternalServerError struct { -} - -// NewIndexSignedCertificationInternalServerError creates IndexSignedCertificationInternalServerError with default headers values -func NewIndexSignedCertificationInternalServerError() *IndexSignedCertificationInternalServerError { - - return &IndexSignedCertificationInternalServerError{} -} - -// WriteResponse to the client -func (o *IndexSignedCertificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go deleted file mode 100644 index db48533f456..00000000000 --- a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package certification - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// IndexSignedCertificationURL generates an URL for the index signed certification operation -type IndexSignedCertificationURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexSignedCertificationURL) WithBasePath(bp string) *IndexSignedCertificationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexSignedCertificationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexSignedCertificationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/signed_certifications" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on IndexSignedCertificationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexSignedCertificationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexSignedCertificationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexSignedCertificationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexSignedCertificationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexSignedCertificationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexSignedCertificationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document.go b/pkg/gen/internalapi/internaloperations/documents/create_document.go deleted file mode 100644 index 33d1c2e87c0..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/create_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateDocumentHandlerFunc turns a function with the right signature into a create document handler -type CreateDocumentHandlerFunc func(CreateDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateDocumentHandlerFunc) Handle(params CreateDocumentParams) middleware.Responder { - return fn(params) -} - -// CreateDocumentHandler interface for that can handle valid create document params -type CreateDocumentHandler interface { - Handle(CreateDocumentParams) middleware.Responder -} - -// NewCreateDocument creates a new http.Handler for the create document operation -func NewCreateDocument(ctx *middleware.Context, handler CreateDocumentHandler) *CreateDocument { - return &CreateDocument{Context: ctx, Handler: handler} -} - -/* - CreateDocument swagger:route POST /documents documents createDocument - -# Create a new document - -Documents represent a physical artifact such as a scanned document or a PDF file -*/ -type CreateDocument struct { - Context *middleware.Context - Handler CreateDocumentHandler -} - -func (o *CreateDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go b/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go deleted file mode 100644 index fa817c6784e..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateDocumentParams creates a new CreateDocumentParams object -// -// There are no default values defined in the spec. -func NewCreateDocumentParams() CreateDocumentParams { - - return CreateDocumentParams{} -} - -// CreateDocumentParams contains all the bound params for the create document operation -// typically these are obtained from a http.Request -// -// swagger:parameters createDocument -type CreateDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - DocumentPayload *internalmessages.PostDocumentPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateDocumentParams() beforehand. -func (o *CreateDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.PostDocumentPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("documentPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("documentPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.DocumentPayload = &body - } - } - } else { - res = append(res, errors.Required("documentPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go b/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go deleted file mode 100644 index 23f03d12d16..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateDocumentCreatedCode is the HTTP code returned for type CreateDocumentCreated -const CreateDocumentCreatedCode int = 201 - -/* -CreateDocumentCreated created document - -swagger:response createDocumentCreated -*/ -type CreateDocumentCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Document `json:"body,omitempty"` -} - -// NewCreateDocumentCreated creates CreateDocumentCreated with default headers values -func NewCreateDocumentCreated() *CreateDocumentCreated { - - return &CreateDocumentCreated{} -} - -// WithPayload adds the payload to the create document created response -func (o *CreateDocumentCreated) WithPayload(payload *internalmessages.Document) *CreateDocumentCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create document created response -func (o *CreateDocumentCreated) SetPayload(payload *internalmessages.Document) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateDocumentCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateDocumentBadRequestCode is the HTTP code returned for type CreateDocumentBadRequest -const CreateDocumentBadRequestCode int = 400 - -/* -CreateDocumentBadRequest invalid request - -swagger:response createDocumentBadRequest -*/ -type CreateDocumentBadRequest struct { -} - -// NewCreateDocumentBadRequest creates CreateDocumentBadRequest with default headers values -func NewCreateDocumentBadRequest() *CreateDocumentBadRequest { - - return &CreateDocumentBadRequest{} -} - -// WriteResponse to the client -func (o *CreateDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateDocumentInternalServerErrorCode is the HTTP code returned for type CreateDocumentInternalServerError -const CreateDocumentInternalServerErrorCode int = 500 - -/* -CreateDocumentInternalServerError server error - -swagger:response createDocumentInternalServerError -*/ -type CreateDocumentInternalServerError struct { -} - -// NewCreateDocumentInternalServerError creates CreateDocumentInternalServerError with default headers values -func NewCreateDocumentInternalServerError() *CreateDocumentInternalServerError { - - return &CreateDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go deleted file mode 100644 index 7492b3b027f..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateDocumentURL generates an URL for the create document operation -type CreateDocumentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDocumentURL) WithBasePath(bp string) *CreateDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/documents" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document.go b/pkg/gen/internalapi/internaloperations/documents/show_document.go deleted file mode 100644 index 1837f7f6bef..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/show_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowDocumentHandlerFunc turns a function with the right signature into a show document handler -type ShowDocumentHandlerFunc func(ShowDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowDocumentHandlerFunc) Handle(params ShowDocumentParams) middleware.Responder { - return fn(params) -} - -// ShowDocumentHandler interface for that can handle valid show document params -type ShowDocumentHandler interface { - Handle(ShowDocumentParams) middleware.Responder -} - -// NewShowDocument creates a new http.Handler for the show document operation -func NewShowDocument(ctx *middleware.Context, handler ShowDocumentHandler) *ShowDocument { - return &ShowDocument{Context: ctx, Handler: handler} -} - -/* - ShowDocument swagger:route GET /documents/{documentId} documents showDocument - -# Returns a document - -Returns a document and its uploads -*/ -type ShowDocument struct { - Context *middleware.Context - Handler ShowDocumentHandler -} - -func (o *ShowDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go b/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go deleted file mode 100644 index fbc4162da4e..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowDocumentParams creates a new ShowDocumentParams object -// -// There are no default values defined in the spec. -func NewShowDocumentParams() ShowDocumentParams { - - return ShowDocumentParams{} -} - -// ShowDocumentParams contains all the bound params for the show document operation -// typically these are obtained from a http.Request -// -// swagger:parameters showDocument -type ShowDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the document to return - Required: true - In: path - */ - DocumentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowDocumentParams() beforehand. -func (o *ShowDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rDocumentID, rhkDocumentID, _ := route.Params.GetOK("documentId") - if err := o.bindDocumentID(rDocumentID, rhkDocumentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDocumentID binds and validates parameter DocumentID from path. -func (o *ShowDocumentParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("documentId", "path", "strfmt.UUID", raw) - } - o.DocumentID = *(value.(*strfmt.UUID)) - - if err := o.validateDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateDocumentID carries on validations for parameter DocumentID -func (o *ShowDocumentParams) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("documentId", "path", "uuid", o.DocumentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go b/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go deleted file mode 100644 index 9871aaab702..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowDocumentOKCode is the HTTP code returned for type ShowDocumentOK -const ShowDocumentOKCode int = 200 - -/* -ShowDocumentOK the requested document - -swagger:response showDocumentOK -*/ -type ShowDocumentOK struct { - - /* - In: Body - */ - Payload *internalmessages.Document `json:"body,omitempty"` -} - -// NewShowDocumentOK creates ShowDocumentOK with default headers values -func NewShowDocumentOK() *ShowDocumentOK { - - return &ShowDocumentOK{} -} - -// WithPayload adds the payload to the show document o k response -func (o *ShowDocumentOK) WithPayload(payload *internalmessages.Document) *ShowDocumentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show document o k response -func (o *ShowDocumentOK) SetPayload(payload *internalmessages.Document) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowDocumentBadRequestCode is the HTTP code returned for type ShowDocumentBadRequest -const ShowDocumentBadRequestCode int = 400 - -/* -ShowDocumentBadRequest invalid request - -swagger:response showDocumentBadRequest -*/ -type ShowDocumentBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewShowDocumentBadRequest creates ShowDocumentBadRequest with default headers values -func NewShowDocumentBadRequest() *ShowDocumentBadRequest { - - return &ShowDocumentBadRequest{} -} - -// WithPayload adds the payload to the show document bad request response -func (o *ShowDocumentBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *ShowDocumentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show document bad request response -func (o *ShowDocumentBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowDocumentForbiddenCode is the HTTP code returned for type ShowDocumentForbidden -const ShowDocumentForbiddenCode int = 403 - -/* -ShowDocumentForbidden not authorized - -swagger:response showDocumentForbidden -*/ -type ShowDocumentForbidden struct { -} - -// NewShowDocumentForbidden creates ShowDocumentForbidden with default headers values -func NewShowDocumentForbidden() *ShowDocumentForbidden { - - return &ShowDocumentForbidden{} -} - -// WriteResponse to the client -func (o *ShowDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowDocumentNotFoundCode is the HTTP code returned for type ShowDocumentNotFound -const ShowDocumentNotFoundCode int = 404 - -/* -ShowDocumentNotFound not found - -swagger:response showDocumentNotFound -*/ -type ShowDocumentNotFound struct { -} - -// NewShowDocumentNotFound creates ShowDocumentNotFound with default headers values -func NewShowDocumentNotFound() *ShowDocumentNotFound { - - return &ShowDocumentNotFound{} -} - -// WriteResponse to the client -func (o *ShowDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowDocumentInternalServerErrorCode is the HTTP code returned for type ShowDocumentInternalServerError -const ShowDocumentInternalServerErrorCode int = 500 - -/* -ShowDocumentInternalServerError server error - -swagger:response showDocumentInternalServerError -*/ -type ShowDocumentInternalServerError struct { -} - -// NewShowDocumentInternalServerError creates ShowDocumentInternalServerError with default headers values -func NewShowDocumentInternalServerError() *ShowDocumentInternalServerError { - - return &ShowDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go deleted file mode 100644 index 2ac84a0412c..00000000000 --- a/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package documents - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowDocumentURL generates an URL for the show document operation -type ShowDocumentURL struct { - DocumentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowDocumentURL) WithBasePath(bp string) *ShowDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/documents/{documentId}" - - documentID := o.DocumentID.String() - if documentID != "" { - _path = strings.Replace(_path, "{documentId}", documentID, -1) - } else { - return nil, errors.New("documentId is required on ShowDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go deleted file mode 100644 index 3cacc580d22..00000000000 --- a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package duty_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SearchDutyLocationsHandlerFunc turns a function with the right signature into a search duty locations handler -type SearchDutyLocationsHandlerFunc func(SearchDutyLocationsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SearchDutyLocationsHandlerFunc) Handle(params SearchDutyLocationsParams) middleware.Responder { - return fn(params) -} - -// SearchDutyLocationsHandler interface for that can handle valid search duty locations params -type SearchDutyLocationsHandler interface { - Handle(SearchDutyLocationsParams) middleware.Responder -} - -// NewSearchDutyLocations creates a new http.Handler for the search duty locations operation -func NewSearchDutyLocations(ctx *middleware.Context, handler SearchDutyLocationsHandler) *SearchDutyLocations { - return &SearchDutyLocations{Context: ctx, Handler: handler} -} - -/* - SearchDutyLocations swagger:route GET /duty_locations duty_locations searchDutyLocations - -# Returns the duty locations matching the search query - -Returns the duty locations matching the search query -*/ -type SearchDutyLocations struct { - Context *middleware.Context - Handler SearchDutyLocationsHandler -} - -func (o *SearchDutyLocations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSearchDutyLocationsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go deleted file mode 100644 index 253cdadaf04..00000000000 --- a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package duty_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewSearchDutyLocationsParams creates a new SearchDutyLocationsParams object -// -// There are no default values defined in the spec. -func NewSearchDutyLocationsParams() SearchDutyLocationsParams { - - return SearchDutyLocationsParams{} -} - -// SearchDutyLocationsParams contains all the bound params for the search duty locations operation -// typically these are obtained from a http.Request -// -// swagger:parameters searchDutyLocations -type SearchDutyLocationsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Search string for duty locations - Required: true - In: query - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSearchDutyLocationsParams() beforehand. -func (o *SearchDutyLocationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSearch, qhkSearch, _ := qs.GetOK("search") - if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from query. -func (o *SearchDutyLocationsParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("search", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("search", "query", raw); err != nil { - return err - } - o.Search = raw - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go deleted file mode 100644 index 2cf5b63dd2e..00000000000 --- a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package duty_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// SearchDutyLocationsOKCode is the HTTP code returned for type SearchDutyLocationsOK -const SearchDutyLocationsOKCode int = 200 - -/* -SearchDutyLocationsOK the instance of the duty location - -swagger:response searchDutyLocationsOK -*/ -type SearchDutyLocationsOK struct { - - /* - In: Body - */ - Payload internalmessages.DutyLocationsPayload `json:"body,omitempty"` -} - -// NewSearchDutyLocationsOK creates SearchDutyLocationsOK with default headers values -func NewSearchDutyLocationsOK() *SearchDutyLocationsOK { - - return &SearchDutyLocationsOK{} -} - -// WithPayload adds the payload to the search duty locations o k response -func (o *SearchDutyLocationsOK) WithPayload(payload internalmessages.DutyLocationsPayload) *SearchDutyLocationsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the search duty locations o k response -func (o *SearchDutyLocationsOK) SetPayload(payload internalmessages.DutyLocationsPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SearchDutyLocationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.DutyLocationsPayload{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// SearchDutyLocationsBadRequestCode is the HTTP code returned for type SearchDutyLocationsBadRequest -const SearchDutyLocationsBadRequestCode int = 400 - -/* -SearchDutyLocationsBadRequest invalid request - -swagger:response searchDutyLocationsBadRequest -*/ -type SearchDutyLocationsBadRequest struct { -} - -// NewSearchDutyLocationsBadRequest creates SearchDutyLocationsBadRequest with default headers values -func NewSearchDutyLocationsBadRequest() *SearchDutyLocationsBadRequest { - - return &SearchDutyLocationsBadRequest{} -} - -// WriteResponse to the client -func (o *SearchDutyLocationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// SearchDutyLocationsUnauthorizedCode is the HTTP code returned for type SearchDutyLocationsUnauthorized -const SearchDutyLocationsUnauthorizedCode int = 401 - -/* -SearchDutyLocationsUnauthorized request requires user authentication - -swagger:response searchDutyLocationsUnauthorized -*/ -type SearchDutyLocationsUnauthorized struct { -} - -// NewSearchDutyLocationsUnauthorized creates SearchDutyLocationsUnauthorized with default headers values -func NewSearchDutyLocationsUnauthorized() *SearchDutyLocationsUnauthorized { - - return &SearchDutyLocationsUnauthorized{} -} - -// WriteResponse to the client -func (o *SearchDutyLocationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// SearchDutyLocationsForbiddenCode is the HTTP code returned for type SearchDutyLocationsForbidden -const SearchDutyLocationsForbiddenCode int = 403 - -/* -SearchDutyLocationsForbidden user is not authorized - -swagger:response searchDutyLocationsForbidden -*/ -type SearchDutyLocationsForbidden struct { -} - -// NewSearchDutyLocationsForbidden creates SearchDutyLocationsForbidden with default headers values -func NewSearchDutyLocationsForbidden() *SearchDutyLocationsForbidden { - - return &SearchDutyLocationsForbidden{} -} - -// WriteResponse to the client -func (o *SearchDutyLocationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// SearchDutyLocationsNotFoundCode is the HTTP code returned for type SearchDutyLocationsNotFound -const SearchDutyLocationsNotFoundCode int = 404 - -/* -SearchDutyLocationsNotFound matching duty location not found - -swagger:response searchDutyLocationsNotFound -*/ -type SearchDutyLocationsNotFound struct { -} - -// NewSearchDutyLocationsNotFound creates SearchDutyLocationsNotFound with default headers values -func NewSearchDutyLocationsNotFound() *SearchDutyLocationsNotFound { - - return &SearchDutyLocationsNotFound{} -} - -// WriteResponse to the client -func (o *SearchDutyLocationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// SearchDutyLocationsInternalServerErrorCode is the HTTP code returned for type SearchDutyLocationsInternalServerError -const SearchDutyLocationsInternalServerErrorCode int = 500 - -/* -SearchDutyLocationsInternalServerError internal server error - -swagger:response searchDutyLocationsInternalServerError -*/ -type SearchDutyLocationsInternalServerError struct { -} - -// NewSearchDutyLocationsInternalServerError creates SearchDutyLocationsInternalServerError with default headers values -func NewSearchDutyLocationsInternalServerError() *SearchDutyLocationsInternalServerError { - - return &SearchDutyLocationsInternalServerError{} -} - -// WriteResponse to the client -func (o *SearchDutyLocationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go deleted file mode 100644 index 698420efdc3..00000000000 --- a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package duty_locations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// SearchDutyLocationsURL generates an URL for the search duty locations operation -type SearchDutyLocationsURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchDutyLocationsURL) WithBasePath(bp string) *SearchDutyLocationsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SearchDutyLocationsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SearchDutyLocationsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/duty_locations" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - searchQ := o.Search - if searchQ != "" { - qs.Set("search", searchQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SearchDutyLocationsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SearchDutyLocationsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SearchDutyLocationsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SearchDutyLocationsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SearchDutyLocationsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SearchDutyLocationsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go deleted file mode 100644 index 23e1bb6fd74..00000000000 --- a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package entitlements - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexEntitlementsHandlerFunc turns a function with the right signature into a index entitlements handler -type IndexEntitlementsHandlerFunc func(IndexEntitlementsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexEntitlementsHandlerFunc) Handle(params IndexEntitlementsParams) middleware.Responder { - return fn(params) -} - -// IndexEntitlementsHandler interface for that can handle valid index entitlements params -type IndexEntitlementsHandler interface { - Handle(IndexEntitlementsParams) middleware.Responder -} - -// NewIndexEntitlements creates a new http.Handler for the index entitlements operation -func NewIndexEntitlements(ctx *middleware.Context, handler IndexEntitlementsHandler) *IndexEntitlements { - return &IndexEntitlements{Context: ctx, Handler: handler} -} - -/* - IndexEntitlements swagger:route GET /entitlements entitlements indexEntitlements - -# List weight weights allotted by entitlement - -List weight weights allotted by entitlement -*/ -type IndexEntitlements struct { - Context *middleware.Context - Handler IndexEntitlementsHandler -} - -func (o *IndexEntitlements) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexEntitlementsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go deleted file mode 100644 index 2964294104b..00000000000 --- a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package entitlements - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewIndexEntitlementsParams creates a new IndexEntitlementsParams object -// -// There are no default values defined in the spec. -func NewIndexEntitlementsParams() IndexEntitlementsParams { - - return IndexEntitlementsParams{} -} - -// IndexEntitlementsParams contains all the bound params for the index entitlements operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexEntitlements -type IndexEntitlementsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexEntitlementsParams() beforehand. -func (o *IndexEntitlementsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go deleted file mode 100644 index 972c901ef1d..00000000000 --- a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package entitlements - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// IndexEntitlementsOKCode is the HTTP code returned for type IndexEntitlementsOK -const IndexEntitlementsOKCode int = 200 - -/* -IndexEntitlementsOK List of weights allotted entitlement - -swagger:response indexEntitlementsOK -*/ -type IndexEntitlementsOK struct { - - /* - In: Body - */ - Payload internalmessages.IndexEntitlements `json:"body,omitempty"` -} - -// NewIndexEntitlementsOK creates IndexEntitlementsOK with default headers values -func NewIndexEntitlementsOK() *IndexEntitlementsOK { - - return &IndexEntitlementsOK{} -} - -// WithPayload adds the payload to the index entitlements o k response -func (o *IndexEntitlementsOK) WithPayload(payload internalmessages.IndexEntitlements) *IndexEntitlementsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index entitlements o k response -func (o *IndexEntitlementsOK) SetPayload(payload internalmessages.IndexEntitlements) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexEntitlementsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty map - payload = internalmessages.IndexEntitlements{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go deleted file mode 100644 index f02378c9ccc..00000000000 --- a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package entitlements - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// IndexEntitlementsURL generates an URL for the index entitlements operation -type IndexEntitlementsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexEntitlementsURL) WithBasePath(bp string) *IndexEntitlementsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexEntitlementsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexEntitlementsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/entitlements" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexEntitlementsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexEntitlementsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexEntitlementsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexEntitlementsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexEntitlementsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexEntitlementsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go deleted file mode 100644 index eaf409f2661..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// BooleanFeatureFlagForUserHandlerFunc turns a function with the right signature into a boolean feature flag for user handler -type BooleanFeatureFlagForUserHandlerFunc func(BooleanFeatureFlagForUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn BooleanFeatureFlagForUserHandlerFunc) Handle(params BooleanFeatureFlagForUserParams) middleware.Responder { - return fn(params) -} - -// BooleanFeatureFlagForUserHandler interface for that can handle valid boolean feature flag for user params -type BooleanFeatureFlagForUserHandler interface { - Handle(BooleanFeatureFlagForUserParams) middleware.Responder -} - -// NewBooleanFeatureFlagForUser creates a new http.Handler for the boolean feature flag for user operation -func NewBooleanFeatureFlagForUser(ctx *middleware.Context, handler BooleanFeatureFlagForUserHandler) *BooleanFeatureFlagForUser { - return &BooleanFeatureFlagForUser{Context: ctx, Handler: handler} -} - -/* - BooleanFeatureFlagForUser swagger:route POST /feature-flags/user-boolean/{key} featureFlags booleanFeatureFlagForUser - -# Determines if a user has a feature flag enabled - -Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user. -*/ -type BooleanFeatureFlagForUser struct { - Context *middleware.Context - Handler BooleanFeatureFlagForUserHandler -} - -func (o *BooleanFeatureFlagForUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewBooleanFeatureFlagForUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go deleted file mode 100644 index c01b6613631..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewBooleanFeatureFlagForUserParams creates a new BooleanFeatureFlagForUserParams object -// -// There are no default values defined in the spec. -func NewBooleanFeatureFlagForUserParams() BooleanFeatureFlagForUserParams { - - return BooleanFeatureFlagForUserParams{} -} - -// BooleanFeatureFlagForUserParams contains all the bound params for the boolean feature flag for user operation -// typically these are obtained from a http.Request -// -// swagger:parameters booleanFeatureFlagForUser -type BooleanFeatureFlagForUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*context for the feature flag request - Required: true - In: body - */ - FlagContext map[string]string - /*Feature Flag Key - Required: true - In: path - */ - Key string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewBooleanFeatureFlagForUserParams() beforehand. -func (o *BooleanFeatureFlagForUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body map[string]string - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("flagContext", "body", "")) - } else { - res = append(res, errors.NewParseError("flagContext", "body", "", err)) - } - } else { - // no validation required on inline body - o.FlagContext = body - } - } else { - res = append(res, errors.Required("flagContext", "body", "")) - } - - rKey, rhkKey, _ := route.Params.GetOK("key") - if err := o.bindKey(rKey, rhkKey, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindKey binds and validates parameter Key from path. -func (o *BooleanFeatureFlagForUserParams) bindKey(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Key = raw - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go deleted file mode 100644 index aaf26f9634f..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// BooleanFeatureFlagForUserOKCode is the HTTP code returned for type BooleanFeatureFlagForUserOK -const BooleanFeatureFlagForUserOKCode int = 200 - -/* -BooleanFeatureFlagForUserOK Boolean Feature Flag Status - -swagger:response booleanFeatureFlagForUserOK -*/ -type BooleanFeatureFlagForUserOK struct { - - /* - In: Body - */ - Payload *internalmessages.FeatureFlagBoolean `json:"body,omitempty"` -} - -// NewBooleanFeatureFlagForUserOK creates BooleanFeatureFlagForUserOK with default headers values -func NewBooleanFeatureFlagForUserOK() *BooleanFeatureFlagForUserOK { - - return &BooleanFeatureFlagForUserOK{} -} - -// WithPayload adds the payload to the boolean feature flag for user o k response -func (o *BooleanFeatureFlagForUserOK) WithPayload(payload *internalmessages.FeatureFlagBoolean) *BooleanFeatureFlagForUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the boolean feature flag for user o k response -func (o *BooleanFeatureFlagForUserOK) SetPayload(payload *internalmessages.FeatureFlagBoolean) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *BooleanFeatureFlagForUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// BooleanFeatureFlagForUserBadRequestCode is the HTTP code returned for type BooleanFeatureFlagForUserBadRequest -const BooleanFeatureFlagForUserBadRequestCode int = 400 - -/* -BooleanFeatureFlagForUserBadRequest invalid request - -swagger:response booleanFeatureFlagForUserBadRequest -*/ -type BooleanFeatureFlagForUserBadRequest struct { -} - -// NewBooleanFeatureFlagForUserBadRequest creates BooleanFeatureFlagForUserBadRequest with default headers values -func NewBooleanFeatureFlagForUserBadRequest() *BooleanFeatureFlagForUserBadRequest { - - return &BooleanFeatureFlagForUserBadRequest{} -} - -// WriteResponse to the client -func (o *BooleanFeatureFlagForUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// BooleanFeatureFlagForUserUnauthorizedCode is the HTTP code returned for type BooleanFeatureFlagForUserUnauthorized -const BooleanFeatureFlagForUserUnauthorizedCode int = 401 - -/* -BooleanFeatureFlagForUserUnauthorized request requires user authentication - -swagger:response booleanFeatureFlagForUserUnauthorized -*/ -type BooleanFeatureFlagForUserUnauthorized struct { -} - -// NewBooleanFeatureFlagForUserUnauthorized creates BooleanFeatureFlagForUserUnauthorized with default headers values -func NewBooleanFeatureFlagForUserUnauthorized() *BooleanFeatureFlagForUserUnauthorized { - - return &BooleanFeatureFlagForUserUnauthorized{} -} - -// WriteResponse to the client -func (o *BooleanFeatureFlagForUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// BooleanFeatureFlagForUserInternalServerErrorCode is the HTTP code returned for type BooleanFeatureFlagForUserInternalServerError -const BooleanFeatureFlagForUserInternalServerErrorCode int = 500 - -/* -BooleanFeatureFlagForUserInternalServerError internal server error - -swagger:response booleanFeatureFlagForUserInternalServerError -*/ -type BooleanFeatureFlagForUserInternalServerError struct { -} - -// NewBooleanFeatureFlagForUserInternalServerError creates BooleanFeatureFlagForUserInternalServerError with default headers values -func NewBooleanFeatureFlagForUserInternalServerError() *BooleanFeatureFlagForUserInternalServerError { - - return &BooleanFeatureFlagForUserInternalServerError{} -} - -// WriteResponse to the client -func (o *BooleanFeatureFlagForUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go deleted file mode 100644 index b74e915b15c..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// BooleanFeatureFlagForUserURL generates an URL for the boolean feature flag for user operation -type BooleanFeatureFlagForUserURL struct { - Key string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *BooleanFeatureFlagForUserURL) WithBasePath(bp string) *BooleanFeatureFlagForUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *BooleanFeatureFlagForUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *BooleanFeatureFlagForUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/feature-flags/user-boolean/{key}" - - key := o.Key - if key != "" { - _path = strings.Replace(_path, "{key}", key, -1) - } else { - return nil, errors.New("key is required on BooleanFeatureFlagForUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *BooleanFeatureFlagForUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *BooleanFeatureFlagForUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *BooleanFeatureFlagForUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on BooleanFeatureFlagForUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on BooleanFeatureFlagForUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *BooleanFeatureFlagForUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go deleted file mode 100644 index da1d45eeec4..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// VariantFeatureFlagForUserHandlerFunc turns a function with the right signature into a variant feature flag for user handler -type VariantFeatureFlagForUserHandlerFunc func(VariantFeatureFlagForUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn VariantFeatureFlagForUserHandlerFunc) Handle(params VariantFeatureFlagForUserParams) middleware.Responder { - return fn(params) -} - -// VariantFeatureFlagForUserHandler interface for that can handle valid variant feature flag for user params -type VariantFeatureFlagForUserHandler interface { - Handle(VariantFeatureFlagForUserParams) middleware.Responder -} - -// NewVariantFeatureFlagForUser creates a new http.Handler for the variant feature flag for user operation -func NewVariantFeatureFlagForUser(ctx *middleware.Context, handler VariantFeatureFlagForUserHandler) *VariantFeatureFlagForUser { - return &VariantFeatureFlagForUser{Context: ctx, Handler: handler} -} - -/* - VariantFeatureFlagForUser swagger:route POST /feature-flags/user-variant/{key} featureFlags variantFeatureFlagForUser - -# Determines if a user has a feature flag enabled - -Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user. -*/ -type VariantFeatureFlagForUser struct { - Context *middleware.Context - Handler VariantFeatureFlagForUserHandler -} - -func (o *VariantFeatureFlagForUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewVariantFeatureFlagForUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go deleted file mode 100644 index f42868195e9..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewVariantFeatureFlagForUserParams creates a new VariantFeatureFlagForUserParams object -// -// There are no default values defined in the spec. -func NewVariantFeatureFlagForUserParams() VariantFeatureFlagForUserParams { - - return VariantFeatureFlagForUserParams{} -} - -// VariantFeatureFlagForUserParams contains all the bound params for the variant feature flag for user operation -// typically these are obtained from a http.Request -// -// swagger:parameters variantFeatureFlagForUser -type VariantFeatureFlagForUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*context for the feature flag request - Required: true - In: body - */ - FlagContext map[string]string - /*Feature Flag Key - Required: true - In: path - */ - Key string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewVariantFeatureFlagForUserParams() beforehand. -func (o *VariantFeatureFlagForUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body map[string]string - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("flagContext", "body", "")) - } else { - res = append(res, errors.NewParseError("flagContext", "body", "", err)) - } - } else { - // no validation required on inline body - o.FlagContext = body - } - } else { - res = append(res, errors.Required("flagContext", "body", "")) - } - - rKey, rhkKey, _ := route.Params.GetOK("key") - if err := o.bindKey(rKey, rhkKey, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindKey binds and validates parameter Key from path. -func (o *VariantFeatureFlagForUserParams) bindKey(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Key = raw - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go deleted file mode 100644 index e1a82ace3d2..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// VariantFeatureFlagForUserOKCode is the HTTP code returned for type VariantFeatureFlagForUserOK -const VariantFeatureFlagForUserOKCode int = 200 - -/* -VariantFeatureFlagForUserOK Variant Feature Flag Status - -swagger:response variantFeatureFlagForUserOK -*/ -type VariantFeatureFlagForUserOK struct { - - /* - In: Body - */ - Payload *internalmessages.FeatureFlagVariant `json:"body,omitempty"` -} - -// NewVariantFeatureFlagForUserOK creates VariantFeatureFlagForUserOK with default headers values -func NewVariantFeatureFlagForUserOK() *VariantFeatureFlagForUserOK { - - return &VariantFeatureFlagForUserOK{} -} - -// WithPayload adds the payload to the variant feature flag for user o k response -func (o *VariantFeatureFlagForUserOK) WithPayload(payload *internalmessages.FeatureFlagVariant) *VariantFeatureFlagForUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the variant feature flag for user o k response -func (o *VariantFeatureFlagForUserOK) SetPayload(payload *internalmessages.FeatureFlagVariant) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *VariantFeatureFlagForUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// VariantFeatureFlagForUserBadRequestCode is the HTTP code returned for type VariantFeatureFlagForUserBadRequest -const VariantFeatureFlagForUserBadRequestCode int = 400 - -/* -VariantFeatureFlagForUserBadRequest invalid request - -swagger:response variantFeatureFlagForUserBadRequest -*/ -type VariantFeatureFlagForUserBadRequest struct { -} - -// NewVariantFeatureFlagForUserBadRequest creates VariantFeatureFlagForUserBadRequest with default headers values -func NewVariantFeatureFlagForUserBadRequest() *VariantFeatureFlagForUserBadRequest { - - return &VariantFeatureFlagForUserBadRequest{} -} - -// WriteResponse to the client -func (o *VariantFeatureFlagForUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// VariantFeatureFlagForUserUnauthorizedCode is the HTTP code returned for type VariantFeatureFlagForUserUnauthorized -const VariantFeatureFlagForUserUnauthorizedCode int = 401 - -/* -VariantFeatureFlagForUserUnauthorized request requires user authentication - -swagger:response variantFeatureFlagForUserUnauthorized -*/ -type VariantFeatureFlagForUserUnauthorized struct { -} - -// NewVariantFeatureFlagForUserUnauthorized creates VariantFeatureFlagForUserUnauthorized with default headers values -func NewVariantFeatureFlagForUserUnauthorized() *VariantFeatureFlagForUserUnauthorized { - - return &VariantFeatureFlagForUserUnauthorized{} -} - -// WriteResponse to the client -func (o *VariantFeatureFlagForUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// VariantFeatureFlagForUserInternalServerErrorCode is the HTTP code returned for type VariantFeatureFlagForUserInternalServerError -const VariantFeatureFlagForUserInternalServerErrorCode int = 500 - -/* -VariantFeatureFlagForUserInternalServerError internal server error - -swagger:response variantFeatureFlagForUserInternalServerError -*/ -type VariantFeatureFlagForUserInternalServerError struct { -} - -// NewVariantFeatureFlagForUserInternalServerError creates VariantFeatureFlagForUserInternalServerError with default headers values -func NewVariantFeatureFlagForUserInternalServerError() *VariantFeatureFlagForUserInternalServerError { - - return &VariantFeatureFlagForUserInternalServerError{} -} - -// WriteResponse to the client -func (o *VariantFeatureFlagForUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go deleted file mode 100644 index 3bd6e2f0091..00000000000 --- a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package feature_flags - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// VariantFeatureFlagForUserURL generates an URL for the variant feature flag for user operation -type VariantFeatureFlagForUserURL struct { - Key string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VariantFeatureFlagForUserURL) WithBasePath(bp string) *VariantFeatureFlagForUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *VariantFeatureFlagForUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *VariantFeatureFlagForUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/feature-flags/user-variant/{key}" - - key := o.Key - if key != "" { - _path = strings.Replace(_path, "{key}", key, -1) - } else { - return nil, errors.New("key is required on VariantFeatureFlagForUserURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *VariantFeatureFlagForUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *VariantFeatureFlagForUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *VariantFeatureFlagForUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on VariantFeatureFlagForUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on VariantFeatureFlagForUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *VariantFeatureFlagForUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go deleted file mode 100644 index 291dd9f6bca..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateGenericMoveDocumentHandlerFunc turns a function with the right signature into a create generic move document handler -type CreateGenericMoveDocumentHandlerFunc func(CreateGenericMoveDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateGenericMoveDocumentHandlerFunc) Handle(params CreateGenericMoveDocumentParams) middleware.Responder { - return fn(params) -} - -// CreateGenericMoveDocumentHandler interface for that can handle valid create generic move document params -type CreateGenericMoveDocumentHandler interface { - Handle(CreateGenericMoveDocumentParams) middleware.Responder -} - -// NewCreateGenericMoveDocument creates a new http.Handler for the create generic move document operation -func NewCreateGenericMoveDocument(ctx *middleware.Context, handler CreateGenericMoveDocumentHandler) *CreateGenericMoveDocument { - return &CreateGenericMoveDocument{Context: ctx, Handler: handler} -} - -/* - CreateGenericMoveDocument swagger:route POST /moves/{moveId}/move_documents move_docs createGenericMoveDocument - -# Creates a move document - -Created a move document with the given information -*/ -type CreateGenericMoveDocument struct { - Context *middleware.Context - Handler CreateGenericMoveDocumentHandler -} - -func (o *CreateGenericMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateGenericMoveDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go deleted file mode 100644 index 4a4d8f96f41..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateGenericMoveDocumentParams creates a new CreateGenericMoveDocumentParams object -// -// There are no default values defined in the spec. -func NewCreateGenericMoveDocumentParams() CreateGenericMoveDocumentParams { - - return CreateGenericMoveDocumentParams{} -} - -// CreateGenericMoveDocumentParams contains all the bound params for the create generic move document operation -// typically these are obtained from a http.Request -// -// swagger:parameters createGenericMoveDocument -type CreateGenericMoveDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateGenericMoveDocumentPayload *internalmessages.CreateGenericMoveDocumentPayload - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateGenericMoveDocumentParams() beforehand. -func (o *CreateGenericMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateGenericMoveDocumentPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createGenericMoveDocumentPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("createGenericMoveDocumentPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateGenericMoveDocumentPayload = &body - } - } - } else { - res = append(res, errors.Required("createGenericMoveDocumentPayload", "body", "")) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *CreateGenericMoveDocumentParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *CreateGenericMoveDocumentParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go deleted file mode 100644 index 5262c989a59..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateGenericMoveDocumentOKCode is the HTTP code returned for type CreateGenericMoveDocumentOK -const CreateGenericMoveDocumentOKCode int = 200 - -/* -CreateGenericMoveDocumentOK returns new move document object - -swagger:response createGenericMoveDocumentOK -*/ -type CreateGenericMoveDocumentOK struct { - - /* - In: Body - */ - Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` -} - -// NewCreateGenericMoveDocumentOK creates CreateGenericMoveDocumentOK with default headers values -func NewCreateGenericMoveDocumentOK() *CreateGenericMoveDocumentOK { - - return &CreateGenericMoveDocumentOK{} -} - -// WithPayload adds the payload to the create generic move document o k response -func (o *CreateGenericMoveDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *CreateGenericMoveDocumentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create generic move document o k response -func (o *CreateGenericMoveDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateGenericMoveDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateGenericMoveDocumentBadRequestCode is the HTTP code returned for type CreateGenericMoveDocumentBadRequest -const CreateGenericMoveDocumentBadRequestCode int = 400 - -/* -CreateGenericMoveDocumentBadRequest invalid request - -swagger:response createGenericMoveDocumentBadRequest -*/ -type CreateGenericMoveDocumentBadRequest struct { -} - -// NewCreateGenericMoveDocumentBadRequest creates CreateGenericMoveDocumentBadRequest with default headers values -func NewCreateGenericMoveDocumentBadRequest() *CreateGenericMoveDocumentBadRequest { - - return &CreateGenericMoveDocumentBadRequest{} -} - -// WriteResponse to the client -func (o *CreateGenericMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateGenericMoveDocumentUnauthorizedCode is the HTTP code returned for type CreateGenericMoveDocumentUnauthorized -const CreateGenericMoveDocumentUnauthorizedCode int = 401 - -/* -CreateGenericMoveDocumentUnauthorized must be authenticated to use this endpoint - -swagger:response createGenericMoveDocumentUnauthorized -*/ -type CreateGenericMoveDocumentUnauthorized struct { -} - -// NewCreateGenericMoveDocumentUnauthorized creates CreateGenericMoveDocumentUnauthorized with default headers values -func NewCreateGenericMoveDocumentUnauthorized() *CreateGenericMoveDocumentUnauthorized { - - return &CreateGenericMoveDocumentUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateGenericMoveDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateGenericMoveDocumentForbiddenCode is the HTTP code returned for type CreateGenericMoveDocumentForbidden -const CreateGenericMoveDocumentForbiddenCode int = 403 - -/* -CreateGenericMoveDocumentForbidden not authorized to modify this move - -swagger:response createGenericMoveDocumentForbidden -*/ -type CreateGenericMoveDocumentForbidden struct { -} - -// NewCreateGenericMoveDocumentForbidden creates CreateGenericMoveDocumentForbidden with default headers values -func NewCreateGenericMoveDocumentForbidden() *CreateGenericMoveDocumentForbidden { - - return &CreateGenericMoveDocumentForbidden{} -} - -// WriteResponse to the client -func (o *CreateGenericMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateGenericMoveDocumentInternalServerErrorCode is the HTTP code returned for type CreateGenericMoveDocumentInternalServerError -const CreateGenericMoveDocumentInternalServerErrorCode int = 500 - -/* -CreateGenericMoveDocumentInternalServerError server error - -swagger:response createGenericMoveDocumentInternalServerError -*/ -type CreateGenericMoveDocumentInternalServerError struct { -} - -// NewCreateGenericMoveDocumentInternalServerError creates CreateGenericMoveDocumentInternalServerError with default headers values -func NewCreateGenericMoveDocumentInternalServerError() *CreateGenericMoveDocumentInternalServerError { - - return &CreateGenericMoveDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateGenericMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go deleted file mode 100644 index 348086ac660..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateGenericMoveDocumentURL generates an URL for the create generic move document operation -type CreateGenericMoveDocumentURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateGenericMoveDocumentURL) WithBasePath(bp string) *CreateGenericMoveDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateGenericMoveDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateGenericMoveDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/move_documents" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on CreateGenericMoveDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateGenericMoveDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateGenericMoveDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateGenericMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateGenericMoveDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateGenericMoveDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateGenericMoveDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go deleted file mode 100644 index f0bf44d24a0..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateWeightTicketDocumentHandlerFunc turns a function with the right signature into a create weight ticket document handler -type CreateWeightTicketDocumentHandlerFunc func(CreateWeightTicketDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateWeightTicketDocumentHandlerFunc) Handle(params CreateWeightTicketDocumentParams) middleware.Responder { - return fn(params) -} - -// CreateWeightTicketDocumentHandler interface for that can handle valid create weight ticket document params -type CreateWeightTicketDocumentHandler interface { - Handle(CreateWeightTicketDocumentParams) middleware.Responder -} - -// NewCreateWeightTicketDocument creates a new http.Handler for the create weight ticket document operation -func NewCreateWeightTicketDocument(ctx *middleware.Context, handler CreateWeightTicketDocumentHandler) *CreateWeightTicketDocument { - return &CreateWeightTicketDocument{Context: ctx, Handler: handler} -} - -/* - CreateWeightTicketDocument swagger:route POST /moves/{moveId}/weight_ticket move_docs createWeightTicketDocument - -# Creates a weight ticket document - -Created a weight ticket document with the given information -*/ -type CreateWeightTicketDocument struct { - Context *middleware.Context - Handler CreateWeightTicketDocumentHandler -} - -func (o *CreateWeightTicketDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateWeightTicketDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go deleted file mode 100644 index 3d35b7be77d..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateWeightTicketDocumentParams creates a new CreateWeightTicketDocumentParams object -// -// There are no default values defined in the spec. -func NewCreateWeightTicketDocumentParams() CreateWeightTicketDocumentParams { - - return CreateWeightTicketDocumentParams{} -} - -// CreateWeightTicketDocumentParams contains all the bound params for the create weight ticket document operation -// typically these are obtained from a http.Request -// -// swagger:parameters createWeightTicketDocument -type CreateWeightTicketDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateWeightTicketDocument *internalmessages.CreateWeightTicketDocumentsPayload - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateWeightTicketDocumentParams() beforehand. -func (o *CreateWeightTicketDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateWeightTicketDocumentsPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createWeightTicketDocument", "body", "")) - } else { - res = append(res, errors.NewParseError("createWeightTicketDocument", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateWeightTicketDocument = &body - } - } - } else { - res = append(res, errors.Required("createWeightTicketDocument", "body", "")) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *CreateWeightTicketDocumentParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *CreateWeightTicketDocumentParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go deleted file mode 100644 index 21bbf9c2f9f..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateWeightTicketDocumentOKCode is the HTTP code returned for type CreateWeightTicketDocumentOK -const CreateWeightTicketDocumentOKCode int = 200 - -/* -CreateWeightTicketDocumentOK returns new weight ticket document object - -swagger:response createWeightTicketDocumentOK -*/ -type CreateWeightTicketDocumentOK struct { - - /* - In: Body - */ - Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` -} - -// NewCreateWeightTicketDocumentOK creates CreateWeightTicketDocumentOK with default headers values -func NewCreateWeightTicketDocumentOK() *CreateWeightTicketDocumentOK { - - return &CreateWeightTicketDocumentOK{} -} - -// WithPayload adds the payload to the create weight ticket document o k response -func (o *CreateWeightTicketDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *CreateWeightTicketDocumentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket document o k response -func (o *CreateWeightTicketDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketDocumentBadRequestCode is the HTTP code returned for type CreateWeightTicketDocumentBadRequest -const CreateWeightTicketDocumentBadRequestCode int = 400 - -/* -CreateWeightTicketDocumentBadRequest invalid request - -swagger:response createWeightTicketDocumentBadRequest -*/ -type CreateWeightTicketDocumentBadRequest struct { -} - -// NewCreateWeightTicketDocumentBadRequest creates CreateWeightTicketDocumentBadRequest with default headers values -func NewCreateWeightTicketDocumentBadRequest() *CreateWeightTicketDocumentBadRequest { - - return &CreateWeightTicketDocumentBadRequest{} -} - -// WriteResponse to the client -func (o *CreateWeightTicketDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateWeightTicketDocumentUnauthorizedCode is the HTTP code returned for type CreateWeightTicketDocumentUnauthorized -const CreateWeightTicketDocumentUnauthorizedCode int = 401 - -/* -CreateWeightTicketDocumentUnauthorized must be authenticated to use this endpoint - -swagger:response createWeightTicketDocumentUnauthorized -*/ -type CreateWeightTicketDocumentUnauthorized struct { -} - -// NewCreateWeightTicketDocumentUnauthorized creates CreateWeightTicketDocumentUnauthorized with default headers values -func NewCreateWeightTicketDocumentUnauthorized() *CreateWeightTicketDocumentUnauthorized { - - return &CreateWeightTicketDocumentUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateWeightTicketDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateWeightTicketDocumentForbiddenCode is the HTTP code returned for type CreateWeightTicketDocumentForbidden -const CreateWeightTicketDocumentForbiddenCode int = 403 - -/* -CreateWeightTicketDocumentForbidden not authorized to modify this move - -swagger:response createWeightTicketDocumentForbidden -*/ -type CreateWeightTicketDocumentForbidden struct { -} - -// NewCreateWeightTicketDocumentForbidden creates CreateWeightTicketDocumentForbidden with default headers values -func NewCreateWeightTicketDocumentForbidden() *CreateWeightTicketDocumentForbidden { - - return &CreateWeightTicketDocumentForbidden{} -} - -// WriteResponse to the client -func (o *CreateWeightTicketDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateWeightTicketDocumentInternalServerErrorCode is the HTTP code returned for type CreateWeightTicketDocumentInternalServerError -const CreateWeightTicketDocumentInternalServerErrorCode int = 500 - -/* -CreateWeightTicketDocumentInternalServerError server error - -swagger:response createWeightTicketDocumentInternalServerError -*/ -type CreateWeightTicketDocumentInternalServerError struct { -} - -// NewCreateWeightTicketDocumentInternalServerError creates CreateWeightTicketDocumentInternalServerError with default headers values -func NewCreateWeightTicketDocumentInternalServerError() *CreateWeightTicketDocumentInternalServerError { - - return &CreateWeightTicketDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateWeightTicketDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go deleted file mode 100644 index c6f07e80653..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateWeightTicketDocumentURL generates an URL for the create weight ticket document operation -type CreateWeightTicketDocumentURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWeightTicketDocumentURL) WithBasePath(bp string) *CreateWeightTicketDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWeightTicketDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateWeightTicketDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/weight_ticket" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on CreateWeightTicketDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateWeightTicketDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateWeightTicketDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateWeightTicketDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateWeightTicketDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateWeightTicketDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateWeightTicketDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go deleted file mode 100644 index 526ee9631da..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteMoveDocumentHandlerFunc turns a function with the right signature into a delete move document handler -type DeleteMoveDocumentHandlerFunc func(DeleteMoveDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteMoveDocumentHandlerFunc) Handle(params DeleteMoveDocumentParams) middleware.Responder { - return fn(params) -} - -// DeleteMoveDocumentHandler interface for that can handle valid delete move document params -type DeleteMoveDocumentHandler interface { - Handle(DeleteMoveDocumentParams) middleware.Responder -} - -// NewDeleteMoveDocument creates a new http.Handler for the delete move document operation -func NewDeleteMoveDocument(ctx *middleware.Context, handler DeleteMoveDocumentHandler) *DeleteMoveDocument { - return &DeleteMoveDocument{Context: ctx, Handler: handler} -} - -/* - DeleteMoveDocument swagger:route DELETE /move_documents/{moveDocumentId} move_docs deleteMoveDocument - -# Deletes a move document - -Deletes a move document with the given information -*/ -type DeleteMoveDocument struct { - Context *middleware.Context - Handler DeleteMoveDocumentHandler -} - -func (o *DeleteMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteMoveDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go deleted file mode 100644 index 94f1840ea72..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteMoveDocumentParams creates a new DeleteMoveDocumentParams object -// -// There are no default values defined in the spec. -func NewDeleteMoveDocumentParams() DeleteMoveDocumentParams { - - return DeleteMoveDocumentParams{} -} - -// DeleteMoveDocumentParams contains all the bound params for the delete move document operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteMoveDocument -type DeleteMoveDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move document model - Required: true - In: path - */ - MoveDocumentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteMoveDocumentParams() beforehand. -func (o *DeleteMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveDocumentID, rhkMoveDocumentID, _ := route.Params.GetOK("moveDocumentId") - if err := o.bindMoveDocumentID(rMoveDocumentID, rhkMoveDocumentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveDocumentID binds and validates parameter MoveDocumentID from path. -func (o *DeleteMoveDocumentParams) bindMoveDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveDocumentId", "path", "strfmt.UUID", raw) - } - o.MoveDocumentID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveDocumentID carries on validations for parameter MoveDocumentID -func (o *DeleteMoveDocumentParams) validateMoveDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveDocumentId", "path", "uuid", o.MoveDocumentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go deleted file mode 100644 index 1ef2bb42157..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteMoveDocumentNoContentCode is the HTTP code returned for type DeleteMoveDocumentNoContent -const DeleteMoveDocumentNoContentCode int = 204 - -/* -DeleteMoveDocumentNoContent deleted - -swagger:response deleteMoveDocumentNoContent -*/ -type DeleteMoveDocumentNoContent struct { -} - -// NewDeleteMoveDocumentNoContent creates DeleteMoveDocumentNoContent with default headers values -func NewDeleteMoveDocumentNoContent() *DeleteMoveDocumentNoContent { - - return &DeleteMoveDocumentNoContent{} -} - -// WriteResponse to the client -func (o *DeleteMoveDocumentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteMoveDocumentBadRequestCode is the HTTP code returned for type DeleteMoveDocumentBadRequest -const DeleteMoveDocumentBadRequestCode int = 400 - -/* -DeleteMoveDocumentBadRequest invalid request - -swagger:response deleteMoveDocumentBadRequest -*/ -type DeleteMoveDocumentBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewDeleteMoveDocumentBadRequest creates DeleteMoveDocumentBadRequest with default headers values -func NewDeleteMoveDocumentBadRequest() *DeleteMoveDocumentBadRequest { - - return &DeleteMoveDocumentBadRequest{} -} - -// WithPayload adds the payload to the delete move document bad request response -func (o *DeleteMoveDocumentBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteMoveDocumentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete move document bad request response -func (o *DeleteMoveDocumentBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMoveDocumentForbiddenCode is the HTTP code returned for type DeleteMoveDocumentForbidden -const DeleteMoveDocumentForbiddenCode int = 403 - -/* -DeleteMoveDocumentForbidden not authorized - -swagger:response deleteMoveDocumentForbidden -*/ -type DeleteMoveDocumentForbidden struct { -} - -// NewDeleteMoveDocumentForbidden creates DeleteMoveDocumentForbidden with default headers values -func NewDeleteMoveDocumentForbidden() *DeleteMoveDocumentForbidden { - - return &DeleteMoveDocumentForbidden{} -} - -// WriteResponse to the client -func (o *DeleteMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// DeleteMoveDocumentNotFoundCode is the HTTP code returned for type DeleteMoveDocumentNotFound -const DeleteMoveDocumentNotFoundCode int = 404 - -/* -DeleteMoveDocumentNotFound not found - -swagger:response deleteMoveDocumentNotFound -*/ -type DeleteMoveDocumentNotFound struct { -} - -// NewDeleteMoveDocumentNotFound creates DeleteMoveDocumentNotFound with default headers values -func NewDeleteMoveDocumentNotFound() *DeleteMoveDocumentNotFound { - - return &DeleteMoveDocumentNotFound{} -} - -// WriteResponse to the client -func (o *DeleteMoveDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// DeleteMoveDocumentInternalServerErrorCode is the HTTP code returned for type DeleteMoveDocumentInternalServerError -const DeleteMoveDocumentInternalServerErrorCode int = 500 - -/* -DeleteMoveDocumentInternalServerError server error - -swagger:response deleteMoveDocumentInternalServerError -*/ -type DeleteMoveDocumentInternalServerError struct { -} - -// NewDeleteMoveDocumentInternalServerError creates DeleteMoveDocumentInternalServerError with default headers values -func NewDeleteMoveDocumentInternalServerError() *DeleteMoveDocumentInternalServerError { - - return &DeleteMoveDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *DeleteMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go deleted file mode 100644 index b567974a3b7..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteMoveDocumentURL generates an URL for the delete move document operation -type DeleteMoveDocumentURL struct { - MoveDocumentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMoveDocumentURL) WithBasePath(bp string) *DeleteMoveDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMoveDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteMoveDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_documents/{moveDocumentId}" - - moveDocumentID := o.MoveDocumentID.String() - if moveDocumentID != "" { - _path = strings.Replace(_path, "{moveDocumentId}", moveDocumentID, -1) - } else { - return nil, errors.New("moveDocumentId is required on DeleteMoveDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteMoveDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteMoveDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteMoveDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteMoveDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteMoveDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go deleted file mode 100644 index 35fe97d34bd..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// IndexMoveDocumentsHandlerFunc turns a function with the right signature into a index move documents handler -type IndexMoveDocumentsHandlerFunc func(IndexMoveDocumentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IndexMoveDocumentsHandlerFunc) Handle(params IndexMoveDocumentsParams) middleware.Responder { - return fn(params) -} - -// IndexMoveDocumentsHandler interface for that can handle valid index move documents params -type IndexMoveDocumentsHandler interface { - Handle(IndexMoveDocumentsParams) middleware.Responder -} - -// NewIndexMoveDocuments creates a new http.Handler for the index move documents operation -func NewIndexMoveDocuments(ctx *middleware.Context, handler IndexMoveDocumentsHandler) *IndexMoveDocuments { - return &IndexMoveDocuments{Context: ctx, Handler: handler} -} - -/* - IndexMoveDocuments swagger:route GET /moves/{moveId}/move_documents move_docs indexMoveDocuments - -# Returns a list of all Move Documents associated with this move - -Returns a list of all Move Documents associated with this move -*/ -type IndexMoveDocuments struct { - Context *middleware.Context - Handler IndexMoveDocumentsHandler -} - -func (o *IndexMoveDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIndexMoveDocumentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go deleted file mode 100644 index e7df261218e..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewIndexMoveDocumentsParams creates a new IndexMoveDocumentsParams object -// -// There are no default values defined in the spec. -func NewIndexMoveDocumentsParams() IndexMoveDocumentsParams { - - return IndexMoveDocumentsParams{} -} - -// IndexMoveDocumentsParams contains all the bound params for the index move documents operation -// typically these are obtained from a http.Request -// -// swagger:parameters indexMoveDocuments -type IndexMoveDocumentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIndexMoveDocumentsParams() beforehand. -func (o *IndexMoveDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *IndexMoveDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *IndexMoveDocumentsParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go deleted file mode 100644 index 4fce27ccd9b..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// IndexMoveDocumentsOKCode is the HTTP code returned for type IndexMoveDocumentsOK -const IndexMoveDocumentsOKCode int = 200 - -/* -IndexMoveDocumentsOK returns list of move douments - -swagger:response indexMoveDocumentsOK -*/ -type IndexMoveDocumentsOK struct { - - /* - In: Body - */ - Payload internalmessages.MoveDocuments `json:"body,omitempty"` -} - -// NewIndexMoveDocumentsOK creates IndexMoveDocumentsOK with default headers values -func NewIndexMoveDocumentsOK() *IndexMoveDocumentsOK { - - return &IndexMoveDocumentsOK{} -} - -// WithPayload adds the payload to the index move documents o k response -func (o *IndexMoveDocumentsOK) WithPayload(payload internalmessages.MoveDocuments) *IndexMoveDocumentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the index move documents o k response -func (o *IndexMoveDocumentsOK) SetPayload(payload internalmessages.MoveDocuments) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IndexMoveDocumentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.MoveDocuments{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// IndexMoveDocumentsBadRequestCode is the HTTP code returned for type IndexMoveDocumentsBadRequest -const IndexMoveDocumentsBadRequestCode int = 400 - -/* -IndexMoveDocumentsBadRequest invalid request - -swagger:response indexMoveDocumentsBadRequest -*/ -type IndexMoveDocumentsBadRequest struct { -} - -// NewIndexMoveDocumentsBadRequest creates IndexMoveDocumentsBadRequest with default headers values -func NewIndexMoveDocumentsBadRequest() *IndexMoveDocumentsBadRequest { - - return &IndexMoveDocumentsBadRequest{} -} - -// WriteResponse to the client -func (o *IndexMoveDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IndexMoveDocumentsUnauthorizedCode is the HTTP code returned for type IndexMoveDocumentsUnauthorized -const IndexMoveDocumentsUnauthorizedCode int = 401 - -/* -IndexMoveDocumentsUnauthorized request requires user authentication - -swagger:response indexMoveDocumentsUnauthorized -*/ -type IndexMoveDocumentsUnauthorized struct { -} - -// NewIndexMoveDocumentsUnauthorized creates IndexMoveDocumentsUnauthorized with default headers values -func NewIndexMoveDocumentsUnauthorized() *IndexMoveDocumentsUnauthorized { - - return &IndexMoveDocumentsUnauthorized{} -} - -// WriteResponse to the client -func (o *IndexMoveDocumentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// IndexMoveDocumentsForbiddenCode is the HTTP code returned for type IndexMoveDocumentsForbidden -const IndexMoveDocumentsForbiddenCode int = 403 - -/* -IndexMoveDocumentsForbidden user is not authorized - -swagger:response indexMoveDocumentsForbidden -*/ -type IndexMoveDocumentsForbidden struct { -} - -// NewIndexMoveDocumentsForbidden creates IndexMoveDocumentsForbidden with default headers values -func NewIndexMoveDocumentsForbidden() *IndexMoveDocumentsForbidden { - - return &IndexMoveDocumentsForbidden{} -} - -// WriteResponse to the client -func (o *IndexMoveDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go deleted file mode 100644 index 216880123b3..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// IndexMoveDocumentsURL generates an URL for the index move documents operation -type IndexMoveDocumentsURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexMoveDocumentsURL) WithBasePath(bp string) *IndexMoveDocumentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IndexMoveDocumentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IndexMoveDocumentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/move_documents" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on IndexMoveDocumentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IndexMoveDocumentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IndexMoveDocumentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IndexMoveDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IndexMoveDocumentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IndexMoveDocumentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IndexMoveDocumentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go deleted file mode 100644 index 77eaf792b1d..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMoveDocumentHandlerFunc turns a function with the right signature into a update move document handler -type UpdateMoveDocumentHandlerFunc func(UpdateMoveDocumentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMoveDocumentHandlerFunc) Handle(params UpdateMoveDocumentParams) middleware.Responder { - return fn(params) -} - -// UpdateMoveDocumentHandler interface for that can handle valid update move document params -type UpdateMoveDocumentHandler interface { - Handle(UpdateMoveDocumentParams) middleware.Responder -} - -// NewUpdateMoveDocument creates a new http.Handler for the update move document operation -func NewUpdateMoveDocument(ctx *middleware.Context, handler UpdateMoveDocumentHandler) *UpdateMoveDocument { - return &UpdateMoveDocument{Context: ctx, Handler: handler} -} - -/* - UpdateMoveDocument swagger:route PUT /move_documents/{moveDocumentId} move_docs updateMoveDocument - -# Updates a move document - -Update a move document with the given information -*/ -type UpdateMoveDocument struct { - Context *middleware.Context - Handler UpdateMoveDocumentHandler -} - -func (o *UpdateMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMoveDocumentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go deleted file mode 100644 index bdf908e7ea5..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateMoveDocumentParams creates a new UpdateMoveDocumentParams object -// -// There are no default values defined in the spec. -func NewUpdateMoveDocumentParams() UpdateMoveDocumentParams { - - return UpdateMoveDocumentParams{} -} - -// UpdateMoveDocumentParams contains all the bound params for the update move document operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMoveDocument -type UpdateMoveDocumentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move document model - Required: true - In: path - */ - MoveDocumentID strfmt.UUID - /* - Required: true - In: body - */ - UpdateMoveDocument *internalmessages.MoveDocumentPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMoveDocumentParams() beforehand. -func (o *UpdateMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveDocumentID, rhkMoveDocumentID, _ := route.Params.GetOK("moveDocumentId") - if err := o.bindMoveDocumentID(rMoveDocumentID, rhkMoveDocumentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.MoveDocumentPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateMoveDocument", "body", "")) - } else { - res = append(res, errors.NewParseError("updateMoveDocument", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateMoveDocument = &body - } - } - } else { - res = append(res, errors.Required("updateMoveDocument", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveDocumentID binds and validates parameter MoveDocumentID from path. -func (o *UpdateMoveDocumentParams) bindMoveDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveDocumentId", "path", "strfmt.UUID", raw) - } - o.MoveDocumentID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveDocumentID carries on validations for parameter MoveDocumentID -func (o *UpdateMoveDocumentParams) validateMoveDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveDocumentId", "path", "uuid", o.MoveDocumentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go deleted file mode 100644 index ce4832dbb5b..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateMoveDocumentOKCode is the HTTP code returned for type UpdateMoveDocumentOK -const UpdateMoveDocumentOKCode int = 200 - -/* -UpdateMoveDocumentOK updated instance of move document - -swagger:response updateMoveDocumentOK -*/ -type UpdateMoveDocumentOK struct { - - /* - In: Body - */ - Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` -} - -// NewUpdateMoveDocumentOK creates UpdateMoveDocumentOK with default headers values -func NewUpdateMoveDocumentOK() *UpdateMoveDocumentOK { - - return &UpdateMoveDocumentOK{} -} - -// WithPayload adds the payload to the update move document o k response -func (o *UpdateMoveDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *UpdateMoveDocumentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update move document o k response -func (o *UpdateMoveDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMoveDocumentBadRequestCode is the HTTP code returned for type UpdateMoveDocumentBadRequest -const UpdateMoveDocumentBadRequestCode int = 400 - -/* -UpdateMoveDocumentBadRequest invalid request - -swagger:response updateMoveDocumentBadRequest -*/ -type UpdateMoveDocumentBadRequest struct { -} - -// NewUpdateMoveDocumentBadRequest creates UpdateMoveDocumentBadRequest with default headers values -func NewUpdateMoveDocumentBadRequest() *UpdateMoveDocumentBadRequest { - - return &UpdateMoveDocumentBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateMoveDocumentUnauthorizedCode is the HTTP code returned for type UpdateMoveDocumentUnauthorized -const UpdateMoveDocumentUnauthorizedCode int = 401 - -/* -UpdateMoveDocumentUnauthorized request requires user authentication - -swagger:response updateMoveDocumentUnauthorized -*/ -type UpdateMoveDocumentUnauthorized struct { -} - -// NewUpdateMoveDocumentUnauthorized creates UpdateMoveDocumentUnauthorized with default headers values -func NewUpdateMoveDocumentUnauthorized() *UpdateMoveDocumentUnauthorized { - - return &UpdateMoveDocumentUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateMoveDocumentForbiddenCode is the HTTP code returned for type UpdateMoveDocumentForbidden -const UpdateMoveDocumentForbiddenCode int = 403 - -/* -UpdateMoveDocumentForbidden user is not authorized - -swagger:response updateMoveDocumentForbidden -*/ -type UpdateMoveDocumentForbidden struct { -} - -// NewUpdateMoveDocumentForbidden creates UpdateMoveDocumentForbidden with default headers values -func NewUpdateMoveDocumentForbidden() *UpdateMoveDocumentForbidden { - - return &UpdateMoveDocumentForbidden{} -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateMoveDocumentNotFoundCode is the HTTP code returned for type UpdateMoveDocumentNotFound -const UpdateMoveDocumentNotFoundCode int = 404 - -/* -UpdateMoveDocumentNotFound move document not found - -swagger:response updateMoveDocumentNotFound -*/ -type UpdateMoveDocumentNotFound struct { -} - -// NewUpdateMoveDocumentNotFound creates UpdateMoveDocumentNotFound with default headers values -func NewUpdateMoveDocumentNotFound() *UpdateMoveDocumentNotFound { - - return &UpdateMoveDocumentNotFound{} -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateMoveDocumentInternalServerErrorCode is the HTTP code returned for type UpdateMoveDocumentInternalServerError -const UpdateMoveDocumentInternalServerErrorCode int = 500 - -/* -UpdateMoveDocumentInternalServerError internal server error - -swagger:response updateMoveDocumentInternalServerError -*/ -type UpdateMoveDocumentInternalServerError struct { -} - -// NewUpdateMoveDocumentInternalServerError creates UpdateMoveDocumentInternalServerError with default headers values -func NewUpdateMoveDocumentInternalServerError() *UpdateMoveDocumentInternalServerError { - - return &UpdateMoveDocumentInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go deleted file mode 100644 index ae05835d421..00000000000 --- a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_docs - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMoveDocumentURL generates an URL for the update move document operation -type UpdateMoveDocumentURL struct { - MoveDocumentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveDocumentURL) WithBasePath(bp string) *UpdateMoveDocumentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMoveDocumentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMoveDocumentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move_documents/{moveDocumentId}" - - moveDocumentID := o.MoveDocumentID.String() - if moveDocumentID != "" { - _path = strings.Replace(_path, "{moveDocumentId}", moveDocumentID, -1) - } else { - return nil, errors.New("moveDocumentId is required on UpdateMoveDocumentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMoveDocumentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMoveDocumentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMoveDocumentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMoveDocumentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMoveDocumentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go deleted file mode 100644 index 709a9bb4dee..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetAllMovesHandlerFunc turns a function with the right signature into a get all moves handler -type GetAllMovesHandlerFunc func(GetAllMovesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetAllMovesHandlerFunc) Handle(params GetAllMovesParams) middleware.Responder { - return fn(params) -} - -// GetAllMovesHandler interface for that can handle valid get all moves params -type GetAllMovesHandler interface { - Handle(GetAllMovesParams) middleware.Responder -} - -// NewGetAllMoves creates a new http.Handler for the get all moves operation -func NewGetAllMoves(ctx *middleware.Context, handler GetAllMovesHandler) *GetAllMoves { - return &GetAllMoves{Context: ctx, Handler: handler} -} - -/* - GetAllMoves swagger:route GET /allmoves/{serviceMemberId} moves getAllMoves - -# Return the current and previous moves of a service member - -This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array. -*/ -type GetAllMoves struct { - Context *middleware.Context - Handler GetAllMovesHandler -} - -func (o *GetAllMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetAllMovesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go deleted file mode 100644 index dc7953b2274..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetAllMovesParams creates a new GetAllMovesParams object -// -// There are no default values defined in the spec. -func NewGetAllMovesParams() GetAllMovesParams { - - return GetAllMovesParams{} -} - -// GetAllMovesParams contains all the bound params for the get all moves operation -// typically these are obtained from a http.Request -// -// swagger:parameters getAllMoves -type GetAllMovesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetAllMovesParams() beforehand. -func (o *GetAllMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *GetAllMovesParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *GetAllMovesParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go deleted file mode 100644 index f6f638eee3f..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// GetAllMovesOKCode is the HTTP code returned for type GetAllMovesOK -const GetAllMovesOKCode int = 200 - -/* -GetAllMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. - -swagger:response getAllMovesOK -*/ -type GetAllMovesOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovesList `json:"body,omitempty"` -} - -// NewGetAllMovesOK creates GetAllMovesOK with default headers values -func NewGetAllMovesOK() *GetAllMovesOK { - - return &GetAllMovesOK{} -} - -// WithPayload adds the payload to the get all moves o k response -func (o *GetAllMovesOK) WithPayload(payload *internalmessages.MovesList) *GetAllMovesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all moves o k response -func (o *GetAllMovesOK) SetPayload(payload *internalmessages.MovesList) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllMovesUnauthorizedCode is the HTTP code returned for type GetAllMovesUnauthorized -const GetAllMovesUnauthorizedCode int = 401 - -/* -GetAllMovesUnauthorized The request was denied. - -swagger:response getAllMovesUnauthorized -*/ -type GetAllMovesUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetAllMovesUnauthorized creates GetAllMovesUnauthorized with default headers values -func NewGetAllMovesUnauthorized() *GetAllMovesUnauthorized { - - return &GetAllMovesUnauthorized{} -} - -// WithPayload adds the payload to the get all moves unauthorized response -func (o *GetAllMovesUnauthorized) WithPayload(payload *internalmessages.ClientError) *GetAllMovesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all moves unauthorized response -func (o *GetAllMovesUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllMovesForbiddenCode is the HTTP code returned for type GetAllMovesForbidden -const GetAllMovesForbiddenCode int = 403 - -/* -GetAllMovesForbidden The request was denied. - -swagger:response getAllMovesForbidden -*/ -type GetAllMovesForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetAllMovesForbidden creates GetAllMovesForbidden with default headers values -func NewGetAllMovesForbidden() *GetAllMovesForbidden { - - return &GetAllMovesForbidden{} -} - -// WithPayload adds the payload to the get all moves forbidden response -func (o *GetAllMovesForbidden) WithPayload(payload *internalmessages.ClientError) *GetAllMovesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all moves forbidden response -func (o *GetAllMovesForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetAllMovesInternalServerErrorCode is the HTTP code returned for type GetAllMovesInternalServerError -const GetAllMovesInternalServerErrorCode int = 500 - -/* -GetAllMovesInternalServerError A server error occurred. - -swagger:response getAllMovesInternalServerError -*/ -type GetAllMovesInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewGetAllMovesInternalServerError creates GetAllMovesInternalServerError with default headers values -func NewGetAllMovesInternalServerError() *GetAllMovesInternalServerError { - - return &GetAllMovesInternalServerError{} -} - -// WithPayload adds the payload to the get all moves internal server error response -func (o *GetAllMovesInternalServerError) WithPayload(payload *internalmessages.Error) *GetAllMovesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get all moves internal server error response -func (o *GetAllMovesInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetAllMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go deleted file mode 100644 index ae245e18449..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetAllMovesURL generates an URL for the get all moves operation -type GetAllMovesURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAllMovesURL) WithBasePath(bp string) *GetAllMovesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetAllMovesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetAllMovesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/allmoves/{serviceMemberId}" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on GetAllMovesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetAllMovesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetAllMovesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetAllMovesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetAllMovesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetAllMovesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetAllMovesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move.go b/pkg/gen/internalapi/internaloperations/moves/patch_move.go deleted file mode 100644 index 89524a5f89d..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/patch_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchMoveHandlerFunc turns a function with the right signature into a patch move handler -type PatchMoveHandlerFunc func(PatchMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchMoveHandlerFunc) Handle(params PatchMoveParams) middleware.Responder { - return fn(params) -} - -// PatchMoveHandler interface for that can handle valid patch move params -type PatchMoveHandler interface { - Handle(PatchMoveParams) middleware.Responder -} - -// NewPatchMove creates a new http.Handler for the patch move operation -func NewPatchMove(ctx *middleware.Context, handler PatchMoveHandler) *PatchMove { - return &PatchMove{Context: ctx, Handler: handler} -} - -/* - PatchMove swagger:route PATCH /moves/{moveId} moves patchMove - -# Patches the move - -Any fields sent in this request will be set on the move referenced -*/ -type PatchMove struct { - Context *middleware.Context - Handler PatchMoveHandler -} - -func (o *PatchMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go deleted file mode 100644 index b839533060f..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewPatchMoveParams creates a new PatchMoveParams object -// -// There are no default values defined in the spec. -func NewPatchMoveParams() PatchMoveParams { - - return PatchMoveParams{} -} - -// PatchMoveParams contains all the bound params for the patch move operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchMove -type PatchMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID - /* - Required: true - In: body - */ - PatchMovePayload *internalmessages.PatchMovePayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchMoveParams() beforehand. -func (o *PatchMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.PatchMovePayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("patchMovePayload", "body", "")) - } else { - res = append(res, errors.NewParseError("patchMovePayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PatchMovePayload = &body - } - } - } else { - res = append(res, errors.Required("patchMovePayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *PatchMoveParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *PatchMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *PatchMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go deleted file mode 100644 index 6106ac7e633..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go +++ /dev/null @@ -1,234 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// PatchMoveOKCode is the HTTP code returned for type PatchMoveOK -const PatchMoveOKCode int = 200 - -/* -PatchMoveOK updated instance of move - -swagger:response patchMoveOK -*/ -type PatchMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewPatchMoveOK creates PatchMoveOK with default headers values -func NewPatchMoveOK() *PatchMoveOK { - - return &PatchMoveOK{} -} - -// WithPayload adds the payload to the patch move o k response -func (o *PatchMoveOK) WithPayload(payload *internalmessages.MovePayload) *PatchMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch move o k response -func (o *PatchMoveOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchMoveBadRequestCode is the HTTP code returned for type PatchMoveBadRequest -const PatchMoveBadRequestCode int = 400 - -/* -PatchMoveBadRequest invalid request - -swagger:response patchMoveBadRequest -*/ -type PatchMoveBadRequest struct { -} - -// NewPatchMoveBadRequest creates PatchMoveBadRequest with default headers values -func NewPatchMoveBadRequest() *PatchMoveBadRequest { - - return &PatchMoveBadRequest{} -} - -// WriteResponse to the client -func (o *PatchMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// PatchMoveUnauthorizedCode is the HTTP code returned for type PatchMoveUnauthorized -const PatchMoveUnauthorizedCode int = 401 - -/* -PatchMoveUnauthorized request requires user authentication - -swagger:response patchMoveUnauthorized -*/ -type PatchMoveUnauthorized struct { -} - -// NewPatchMoveUnauthorized creates PatchMoveUnauthorized with default headers values -func NewPatchMoveUnauthorized() *PatchMoveUnauthorized { - - return &PatchMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *PatchMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// PatchMoveForbiddenCode is the HTTP code returned for type PatchMoveForbidden -const PatchMoveForbiddenCode int = 403 - -/* -PatchMoveForbidden user is not authorized - -swagger:response patchMoveForbidden -*/ -type PatchMoveForbidden struct { -} - -// NewPatchMoveForbidden creates PatchMoveForbidden with default headers values -func NewPatchMoveForbidden() *PatchMoveForbidden { - - return &PatchMoveForbidden{} -} - -// WriteResponse to the client -func (o *PatchMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// PatchMoveNotFoundCode is the HTTP code returned for type PatchMoveNotFound -const PatchMoveNotFoundCode int = 404 - -/* -PatchMoveNotFound move or closeout office is not found - -swagger:response patchMoveNotFound -*/ -type PatchMoveNotFound struct { -} - -// NewPatchMoveNotFound creates PatchMoveNotFound with default headers values -func NewPatchMoveNotFound() *PatchMoveNotFound { - - return &PatchMoveNotFound{} -} - -// WriteResponse to the client -func (o *PatchMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// PatchMovePreconditionFailedCode is the HTTP code returned for type PatchMovePreconditionFailed -const PatchMovePreconditionFailedCode int = 412 - -/* -PatchMovePreconditionFailed precondition failed - -swagger:response patchMovePreconditionFailed -*/ -type PatchMovePreconditionFailed struct { -} - -// NewPatchMovePreconditionFailed creates PatchMovePreconditionFailed with default headers values -func NewPatchMovePreconditionFailed() *PatchMovePreconditionFailed { - - return &PatchMovePreconditionFailed{} -} - -// WriteResponse to the client -func (o *PatchMovePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(412) -} - -// PatchMoveUnprocessableEntityCode is the HTTP code returned for type PatchMoveUnprocessableEntity -const PatchMoveUnprocessableEntityCode int = 422 - -/* -PatchMoveUnprocessableEntity unprocessable entity - -swagger:response patchMoveUnprocessableEntity -*/ -type PatchMoveUnprocessableEntity struct { -} - -// NewPatchMoveUnprocessableEntity creates PatchMoveUnprocessableEntity with default headers values -func NewPatchMoveUnprocessableEntity() *PatchMoveUnprocessableEntity { - - return &PatchMoveUnprocessableEntity{} -} - -// WriteResponse to the client -func (o *PatchMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(422) -} - -// PatchMoveInternalServerErrorCode is the HTTP code returned for type PatchMoveInternalServerError -const PatchMoveInternalServerErrorCode int = 500 - -/* -PatchMoveInternalServerError internal server error - -swagger:response patchMoveInternalServerError -*/ -type PatchMoveInternalServerError struct { -} - -// NewPatchMoveInternalServerError creates PatchMoveInternalServerError with default headers values -func NewPatchMoveInternalServerError() *PatchMoveInternalServerError { - - return &PatchMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *PatchMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go deleted file mode 100644 index 6c6e9733eb5..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// PatchMoveURL generates an URL for the patch move operation -type PatchMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchMoveURL) WithBasePath(bp string) *PatchMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on PatchMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move.go b/pkg/gen/internalapi/internaloperations/moves/show_move.go deleted file mode 100644 index ff8783ab91e..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/show_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowMoveHandlerFunc turns a function with the right signature into a show move handler -type ShowMoveHandlerFunc func(ShowMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowMoveHandlerFunc) Handle(params ShowMoveParams) middleware.Responder { - return fn(params) -} - -// ShowMoveHandler interface for that can handle valid show move params -type ShowMoveHandler interface { - Handle(ShowMoveParams) middleware.Responder -} - -// NewShowMove creates a new http.Handler for the show move operation -func NewShowMove(ctx *middleware.Context, handler ShowMoveHandler) *ShowMove { - return &ShowMove{Context: ctx, Handler: handler} -} - -/* - ShowMove swagger:route GET /moves/{moveId} moves showMove - -# Returns the given move - -Returns the given move -*/ -type ShowMove struct { - Context *middleware.Context - Handler ShowMoveHandler -} - -func (o *ShowMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go b/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go deleted file mode 100644 index 6cbdda9ec18..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowMoveParams creates a new ShowMoveParams object -// -// There are no default values defined in the spec. -func NewShowMoveParams() ShowMoveParams { - - return ShowMoveParams{} -} - -// ShowMoveParams contains all the bound params for the show move operation -// typically these are obtained from a http.Request -// -// swagger:parameters showMove -type ShowMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowMoveParams() beforehand. -func (o *ShowMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *ShowMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *ShowMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go b/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go deleted file mode 100644 index 402f7b03f76..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowMoveOKCode is the HTTP code returned for type ShowMoveOK -const ShowMoveOKCode int = 200 - -/* -ShowMoveOK the instance of the move - -swagger:response showMoveOK -*/ -type ShowMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewShowMoveOK creates ShowMoveOK with default headers values -func NewShowMoveOK() *ShowMoveOK { - - return &ShowMoveOK{} -} - -// WithPayload adds the payload to the show move o k response -func (o *ShowMoveOK) WithPayload(payload *internalmessages.MovePayload) *ShowMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show move o k response -func (o *ShowMoveOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowMoveBadRequestCode is the HTTP code returned for type ShowMoveBadRequest -const ShowMoveBadRequestCode int = 400 - -/* -ShowMoveBadRequest invalid request - -swagger:response showMoveBadRequest -*/ -type ShowMoveBadRequest struct { -} - -// NewShowMoveBadRequest creates ShowMoveBadRequest with default headers values -func NewShowMoveBadRequest() *ShowMoveBadRequest { - - return &ShowMoveBadRequest{} -} - -// WriteResponse to the client -func (o *ShowMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowMoveUnauthorizedCode is the HTTP code returned for type ShowMoveUnauthorized -const ShowMoveUnauthorizedCode int = 401 - -/* -ShowMoveUnauthorized request requires user authentication - -swagger:response showMoveUnauthorized -*/ -type ShowMoveUnauthorized struct { -} - -// NewShowMoveUnauthorized creates ShowMoveUnauthorized with default headers values -func NewShowMoveUnauthorized() *ShowMoveUnauthorized { - - return &ShowMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowMoveForbiddenCode is the HTTP code returned for type ShowMoveForbidden -const ShowMoveForbiddenCode int = 403 - -/* -ShowMoveForbidden user is not authorized - -swagger:response showMoveForbidden -*/ -type ShowMoveForbidden struct { -} - -// NewShowMoveForbidden creates ShowMoveForbidden with default headers values -func NewShowMoveForbidden() *ShowMoveForbidden { - - return &ShowMoveForbidden{} -} - -// WriteResponse to the client -func (o *ShowMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowMoveNotFoundCode is the HTTP code returned for type ShowMoveNotFound -const ShowMoveNotFoundCode int = 404 - -/* -ShowMoveNotFound move is not found - -swagger:response showMoveNotFound -*/ -type ShowMoveNotFound struct { -} - -// NewShowMoveNotFound creates ShowMoveNotFound with default headers values -func NewShowMoveNotFound() *ShowMoveNotFound { - - return &ShowMoveNotFound{} -} - -// WriteResponse to the client -func (o *ShowMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowMoveInternalServerErrorCode is the HTTP code returned for type ShowMoveInternalServerError -const ShowMoveInternalServerErrorCode int = 500 - -/* -ShowMoveInternalServerError internal server error - -swagger:response showMoveInternalServerError -*/ -type ShowMoveInternalServerError struct { -} - -// NewShowMoveInternalServerError creates ShowMoveInternalServerError with default headers values -func NewShowMoveInternalServerError() *ShowMoveInternalServerError { - - return &ShowMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go deleted file mode 100644 index 556f9706c59..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowMoveURL generates an URL for the show move operation -type ShowMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowMoveURL) WithBasePath(bp string) *ShowMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on ShowMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go deleted file mode 100644 index 83a087601e2..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SubmitAmendedOrdersHandlerFunc turns a function with the right signature into a submit amended orders handler -type SubmitAmendedOrdersHandlerFunc func(SubmitAmendedOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SubmitAmendedOrdersHandlerFunc) Handle(params SubmitAmendedOrdersParams) middleware.Responder { - return fn(params) -} - -// SubmitAmendedOrdersHandler interface for that can handle valid submit amended orders params -type SubmitAmendedOrdersHandler interface { - Handle(SubmitAmendedOrdersParams) middleware.Responder -} - -// NewSubmitAmendedOrders creates a new http.Handler for the submit amended orders operation -func NewSubmitAmendedOrders(ctx *middleware.Context, handler SubmitAmendedOrdersHandler) *SubmitAmendedOrders { - return &SubmitAmendedOrders{Context: ctx, Handler: handler} -} - -/* - SubmitAmendedOrders swagger:route POST /moves/{moveId}/submit_amended_orders moves submitAmendedOrders - -# Submits amended orders for review - -Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not. -*/ -type SubmitAmendedOrders struct { - Context *middleware.Context - Handler SubmitAmendedOrdersHandler -} - -func (o *SubmitAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSubmitAmendedOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go deleted file mode 100644 index 6af6b5021f8..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewSubmitAmendedOrdersParams creates a new SubmitAmendedOrdersParams object -// -// There are no default values defined in the spec. -func NewSubmitAmendedOrdersParams() SubmitAmendedOrdersParams { - - return SubmitAmendedOrdersParams{} -} - -// SubmitAmendedOrdersParams contains all the bound params for the submit amended orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters submitAmendedOrders -type SubmitAmendedOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSubmitAmendedOrdersParams() beforehand. -func (o *SubmitAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *SubmitAmendedOrdersParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *SubmitAmendedOrdersParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go deleted file mode 100644 index 1718447db19..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// SubmitAmendedOrdersOKCode is the HTTP code returned for type SubmitAmendedOrdersOK -const SubmitAmendedOrdersOKCode int = 200 - -/* -SubmitAmendedOrdersOK returns updated (submitted) move object - -swagger:response submitAmendedOrdersOK -*/ -type SubmitAmendedOrdersOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewSubmitAmendedOrdersOK creates SubmitAmendedOrdersOK with default headers values -func NewSubmitAmendedOrdersOK() *SubmitAmendedOrdersOK { - - return &SubmitAmendedOrdersOK{} -} - -// WithPayload adds the payload to the submit amended orders o k response -func (o *SubmitAmendedOrdersOK) WithPayload(payload *internalmessages.MovePayload) *SubmitAmendedOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit amended orders o k response -func (o *SubmitAmendedOrdersOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitAmendedOrdersBadRequestCode is the HTTP code returned for type SubmitAmendedOrdersBadRequest -const SubmitAmendedOrdersBadRequestCode int = 400 - -/* -SubmitAmendedOrdersBadRequest invalid request - -swagger:response submitAmendedOrdersBadRequest -*/ -type SubmitAmendedOrdersBadRequest struct { -} - -// NewSubmitAmendedOrdersBadRequest creates SubmitAmendedOrdersBadRequest with default headers values -func NewSubmitAmendedOrdersBadRequest() *SubmitAmendedOrdersBadRequest { - - return &SubmitAmendedOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// SubmitAmendedOrdersUnauthorizedCode is the HTTP code returned for type SubmitAmendedOrdersUnauthorized -const SubmitAmendedOrdersUnauthorizedCode int = 401 - -/* -SubmitAmendedOrdersUnauthorized must be authenticated to use this endpoint - -swagger:response submitAmendedOrdersUnauthorized -*/ -type SubmitAmendedOrdersUnauthorized struct { -} - -// NewSubmitAmendedOrdersUnauthorized creates SubmitAmendedOrdersUnauthorized with default headers values -func NewSubmitAmendedOrdersUnauthorized() *SubmitAmendedOrdersUnauthorized { - - return &SubmitAmendedOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// SubmitAmendedOrdersForbiddenCode is the HTTP code returned for type SubmitAmendedOrdersForbidden -const SubmitAmendedOrdersForbiddenCode int = 403 - -/* -SubmitAmendedOrdersForbidden not authorized to approve this move - -swagger:response submitAmendedOrdersForbidden -*/ -type SubmitAmendedOrdersForbidden struct { -} - -// NewSubmitAmendedOrdersForbidden creates SubmitAmendedOrdersForbidden with default headers values -func NewSubmitAmendedOrdersForbidden() *SubmitAmendedOrdersForbidden { - - return &SubmitAmendedOrdersForbidden{} -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// SubmitAmendedOrdersConflictCode is the HTTP code returned for type SubmitAmendedOrdersConflict -const SubmitAmendedOrdersConflictCode int = 409 - -/* -SubmitAmendedOrdersConflict the move is not in a state to be approved - -swagger:response submitAmendedOrdersConflict -*/ -type SubmitAmendedOrdersConflict struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewSubmitAmendedOrdersConflict creates SubmitAmendedOrdersConflict with default headers values -func NewSubmitAmendedOrdersConflict() *SubmitAmendedOrdersConflict { - - return &SubmitAmendedOrdersConflict{} -} - -// WithPayload adds the payload to the submit amended orders conflict response -func (o *SubmitAmendedOrdersConflict) WithPayload(payload *internalmessages.MovePayload) *SubmitAmendedOrdersConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit amended orders conflict response -func (o *SubmitAmendedOrdersConflict) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitAmendedOrdersInternalServerErrorCode is the HTTP code returned for type SubmitAmendedOrdersInternalServerError -const SubmitAmendedOrdersInternalServerErrorCode int = 500 - -/* -SubmitAmendedOrdersInternalServerError server error - -swagger:response submitAmendedOrdersInternalServerError -*/ -type SubmitAmendedOrdersInternalServerError struct { -} - -// NewSubmitAmendedOrdersInternalServerError creates SubmitAmendedOrdersInternalServerError with default headers values -func NewSubmitAmendedOrdersInternalServerError() *SubmitAmendedOrdersInternalServerError { - - return &SubmitAmendedOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *SubmitAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go deleted file mode 100644 index 5b2a3aa8747..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SubmitAmendedOrdersURL generates an URL for the submit amended orders operation -type SubmitAmendedOrdersURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitAmendedOrdersURL) WithBasePath(bp string) *SubmitAmendedOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitAmendedOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SubmitAmendedOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/submit_amended_orders" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on SubmitAmendedOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SubmitAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SubmitAmendedOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SubmitAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SubmitAmendedOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SubmitAmendedOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SubmitAmendedOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go deleted file mode 100644 index 73f4579395b..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SubmitMoveForApprovalHandlerFunc turns a function with the right signature into a submit move for approval handler -type SubmitMoveForApprovalHandlerFunc func(SubmitMoveForApprovalParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SubmitMoveForApprovalHandlerFunc) Handle(params SubmitMoveForApprovalParams) middleware.Responder { - return fn(params) -} - -// SubmitMoveForApprovalHandler interface for that can handle valid submit move for approval params -type SubmitMoveForApprovalHandler interface { - Handle(SubmitMoveForApprovalParams) middleware.Responder -} - -// NewSubmitMoveForApproval creates a new http.Handler for the submit move for approval operation -func NewSubmitMoveForApproval(ctx *middleware.Context, handler SubmitMoveForApprovalHandler) *SubmitMoveForApproval { - return &SubmitMoveForApproval{Context: ctx, Handler: handler} -} - -/* - SubmitMoveForApproval swagger:route POST /moves/{moveId}/submit moves submitMoveForApproval - -# Submits a move for approval - -Submits a move for approval by the office. The status of the move will be updated to SUBMITTED -*/ -type SubmitMoveForApproval struct { - Context *middleware.Context - Handler SubmitMoveForApprovalHandler -} - -func (o *SubmitMoveForApproval) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSubmitMoveForApprovalParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go deleted file mode 100644 index 7fdccbfdc37..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewSubmitMoveForApprovalParams creates a new SubmitMoveForApprovalParams object -// -// There are no default values defined in the spec. -func NewSubmitMoveForApprovalParams() SubmitMoveForApprovalParams { - - return SubmitMoveForApprovalParams{} -} - -// SubmitMoveForApprovalParams contains all the bound params for the submit move for approval operation -// typically these are obtained from a http.Request -// -// swagger:parameters submitMoveForApproval -type SubmitMoveForApprovalParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID - /* - Required: true - In: body - */ - SubmitMoveForApprovalPayload *internalmessages.SubmitMoveForApprovalPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSubmitMoveForApprovalParams() beforehand. -func (o *SubmitMoveForApprovalParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.SubmitMoveForApprovalPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("submitMoveForApprovalPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("submitMoveForApprovalPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.SubmitMoveForApprovalPayload = &body - } - } - } else { - res = append(res, errors.Required("submitMoveForApprovalPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *SubmitMoveForApprovalParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *SubmitMoveForApprovalParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go deleted file mode 100644 index d19d2065bfa..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// SubmitMoveForApprovalOKCode is the HTTP code returned for type SubmitMoveForApprovalOK -const SubmitMoveForApprovalOKCode int = 200 - -/* -SubmitMoveForApprovalOK returns updated (submitted) move object - -swagger:response submitMoveForApprovalOK -*/ -type SubmitMoveForApprovalOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewSubmitMoveForApprovalOK creates SubmitMoveForApprovalOK with default headers values -func NewSubmitMoveForApprovalOK() *SubmitMoveForApprovalOK { - - return &SubmitMoveForApprovalOK{} -} - -// WithPayload adds the payload to the submit move for approval o k response -func (o *SubmitMoveForApprovalOK) WithPayload(payload *internalmessages.MovePayload) *SubmitMoveForApprovalOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit move for approval o k response -func (o *SubmitMoveForApprovalOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitMoveForApprovalBadRequestCode is the HTTP code returned for type SubmitMoveForApprovalBadRequest -const SubmitMoveForApprovalBadRequestCode int = 400 - -/* -SubmitMoveForApprovalBadRequest invalid request - -swagger:response submitMoveForApprovalBadRequest -*/ -type SubmitMoveForApprovalBadRequest struct { -} - -// NewSubmitMoveForApprovalBadRequest creates SubmitMoveForApprovalBadRequest with default headers values -func NewSubmitMoveForApprovalBadRequest() *SubmitMoveForApprovalBadRequest { - - return &SubmitMoveForApprovalBadRequest{} -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// SubmitMoveForApprovalUnauthorizedCode is the HTTP code returned for type SubmitMoveForApprovalUnauthorized -const SubmitMoveForApprovalUnauthorizedCode int = 401 - -/* -SubmitMoveForApprovalUnauthorized must be authenticated to use this endpoint - -swagger:response submitMoveForApprovalUnauthorized -*/ -type SubmitMoveForApprovalUnauthorized struct { -} - -// NewSubmitMoveForApprovalUnauthorized creates SubmitMoveForApprovalUnauthorized with default headers values -func NewSubmitMoveForApprovalUnauthorized() *SubmitMoveForApprovalUnauthorized { - - return &SubmitMoveForApprovalUnauthorized{} -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// SubmitMoveForApprovalForbiddenCode is the HTTP code returned for type SubmitMoveForApprovalForbidden -const SubmitMoveForApprovalForbiddenCode int = 403 - -/* -SubmitMoveForApprovalForbidden not authorized to approve this move - -swagger:response submitMoveForApprovalForbidden -*/ -type SubmitMoveForApprovalForbidden struct { -} - -// NewSubmitMoveForApprovalForbidden creates SubmitMoveForApprovalForbidden with default headers values -func NewSubmitMoveForApprovalForbidden() *SubmitMoveForApprovalForbidden { - - return &SubmitMoveForApprovalForbidden{} -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// SubmitMoveForApprovalConflictCode is the HTTP code returned for type SubmitMoveForApprovalConflict -const SubmitMoveForApprovalConflictCode int = 409 - -/* -SubmitMoveForApprovalConflict the move is not in a state to be approved - -swagger:response submitMoveForApprovalConflict -*/ -type SubmitMoveForApprovalConflict struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewSubmitMoveForApprovalConflict creates SubmitMoveForApprovalConflict with default headers values -func NewSubmitMoveForApprovalConflict() *SubmitMoveForApprovalConflict { - - return &SubmitMoveForApprovalConflict{} -} - -// WithPayload adds the payload to the submit move for approval conflict response -func (o *SubmitMoveForApprovalConflict) WithPayload(payload *internalmessages.MovePayload) *SubmitMoveForApprovalConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit move for approval conflict response -func (o *SubmitMoveForApprovalConflict) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitMoveForApprovalInternalServerErrorCode is the HTTP code returned for type SubmitMoveForApprovalInternalServerError -const SubmitMoveForApprovalInternalServerErrorCode int = 500 - -/* -SubmitMoveForApprovalInternalServerError server error - -swagger:response submitMoveForApprovalInternalServerError -*/ -type SubmitMoveForApprovalInternalServerError struct { -} - -// NewSubmitMoveForApprovalInternalServerError creates SubmitMoveForApprovalInternalServerError with default headers values -func NewSubmitMoveForApprovalInternalServerError() *SubmitMoveForApprovalInternalServerError { - - return &SubmitMoveForApprovalInternalServerError{} -} - -// WriteResponse to the client -func (o *SubmitMoveForApprovalInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go deleted file mode 100644 index 980ab955ed7..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SubmitMoveForApprovalURL generates an URL for the submit move for approval operation -type SubmitMoveForApprovalURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitMoveForApprovalURL) WithBasePath(bp string) *SubmitMoveForApprovalURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitMoveForApprovalURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SubmitMoveForApprovalURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/submit" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on SubmitMoveForApprovalURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SubmitMoveForApprovalURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SubmitMoveForApprovalURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SubmitMoveForApprovalURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SubmitMoveForApprovalURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SubmitMoveForApprovalURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SubmitMoveForApprovalURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go deleted file mode 100644 index ca7373bd49c..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UploadAdditionalDocumentsHandlerFunc turns a function with the right signature into a upload additional documents handler -type UploadAdditionalDocumentsHandlerFunc func(UploadAdditionalDocumentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UploadAdditionalDocumentsHandlerFunc) Handle(params UploadAdditionalDocumentsParams) middleware.Responder { - return fn(params) -} - -// UploadAdditionalDocumentsHandler interface for that can handle valid upload additional documents params -type UploadAdditionalDocumentsHandler interface { - Handle(UploadAdditionalDocumentsParams) middleware.Responder -} - -// NewUploadAdditionalDocuments creates a new http.Handler for the upload additional documents operation -func NewUploadAdditionalDocuments(ctx *middleware.Context, handler UploadAdditionalDocumentsHandler) *UploadAdditionalDocuments { - return &UploadAdditionalDocuments{Context: ctx, Handler: handler} -} - -/* - UploadAdditionalDocuments swagger:route PATCH /moves/{moveId}/uploadAdditionalDocuments moves uploadAdditionalDocuments - -# Patch the additional documents for a given move - -Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order. -*/ -type UploadAdditionalDocuments struct { - Context *middleware.Context - Handler UploadAdditionalDocumentsHandler -} - -func (o *UploadAdditionalDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUploadAdditionalDocumentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go deleted file mode 100644 index baf9cfbacc1..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UploadAdditionalDocumentsMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var UploadAdditionalDocumentsMaxParseMemory int64 = 32 << 20 - -// NewUploadAdditionalDocumentsParams creates a new UploadAdditionalDocumentsParams object -// -// There are no default values defined in the spec. -func NewUploadAdditionalDocumentsParams() UploadAdditionalDocumentsParams { - - return UploadAdditionalDocumentsParams{} -} - -// UploadAdditionalDocumentsParams contains all the bound params for the upload additional documents operation -// typically these are obtained from a http.Request -// -// swagger:parameters uploadAdditionalDocuments -type UploadAdditionalDocumentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the order - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUploadAdditionalDocumentsParams() beforehand. -func (o *UploadAdditionalDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(UploadAdditionalDocumentsMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *UploadAdditionalDocumentsParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *UploadAdditionalDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *UploadAdditionalDocumentsParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go deleted file mode 100644 index 368ed1ebcfb..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UploadAdditionalDocumentsCreatedCode is the HTTP code returned for type UploadAdditionalDocumentsCreated -const UploadAdditionalDocumentsCreatedCode int = 201 - -/* -UploadAdditionalDocumentsCreated created upload - -swagger:response uploadAdditionalDocumentsCreated -*/ -type UploadAdditionalDocumentsCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Upload `json:"body,omitempty"` -} - -// NewUploadAdditionalDocumentsCreated creates UploadAdditionalDocumentsCreated with default headers values -func NewUploadAdditionalDocumentsCreated() *UploadAdditionalDocumentsCreated { - - return &UploadAdditionalDocumentsCreated{} -} - -// WithPayload adds the payload to the upload additional documents created response -func (o *UploadAdditionalDocumentsCreated) WithPayload(payload *internalmessages.Upload) *UploadAdditionalDocumentsCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload additional documents created response -func (o *UploadAdditionalDocumentsCreated) SetPayload(payload *internalmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAdditionalDocumentsBadRequestCode is the HTTP code returned for type UploadAdditionalDocumentsBadRequest -const UploadAdditionalDocumentsBadRequestCode int = 400 - -/* -UploadAdditionalDocumentsBadRequest invalid request - -swagger:response uploadAdditionalDocumentsBadRequest -*/ -type UploadAdditionalDocumentsBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewUploadAdditionalDocumentsBadRequest creates UploadAdditionalDocumentsBadRequest with default headers values -func NewUploadAdditionalDocumentsBadRequest() *UploadAdditionalDocumentsBadRequest { - - return &UploadAdditionalDocumentsBadRequest{} -} - -// WithPayload adds the payload to the upload additional documents bad request response -func (o *UploadAdditionalDocumentsBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *UploadAdditionalDocumentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload additional documents bad request response -func (o *UploadAdditionalDocumentsBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAdditionalDocumentsForbiddenCode is the HTTP code returned for type UploadAdditionalDocumentsForbidden -const UploadAdditionalDocumentsForbiddenCode int = 403 - -/* -UploadAdditionalDocumentsForbidden not authorized - -swagger:response uploadAdditionalDocumentsForbidden -*/ -type UploadAdditionalDocumentsForbidden struct { -} - -// NewUploadAdditionalDocumentsForbidden creates UploadAdditionalDocumentsForbidden with default headers values -func NewUploadAdditionalDocumentsForbidden() *UploadAdditionalDocumentsForbidden { - - return &UploadAdditionalDocumentsForbidden{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UploadAdditionalDocumentsNotFoundCode is the HTTP code returned for type UploadAdditionalDocumentsNotFound -const UploadAdditionalDocumentsNotFoundCode int = 404 - -/* -UploadAdditionalDocumentsNotFound not found - -swagger:response uploadAdditionalDocumentsNotFound -*/ -type UploadAdditionalDocumentsNotFound struct { -} - -// NewUploadAdditionalDocumentsNotFound creates UploadAdditionalDocumentsNotFound with default headers values -func NewUploadAdditionalDocumentsNotFound() *UploadAdditionalDocumentsNotFound { - - return &UploadAdditionalDocumentsNotFound{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UploadAdditionalDocumentsRequestEntityTooLargeCode is the HTTP code returned for type UploadAdditionalDocumentsRequestEntityTooLarge -const UploadAdditionalDocumentsRequestEntityTooLargeCode int = 413 - -/* -UploadAdditionalDocumentsRequestEntityTooLarge payload is too large - -swagger:response uploadAdditionalDocumentsRequestEntityTooLarge -*/ -type UploadAdditionalDocumentsRequestEntityTooLarge struct { -} - -// NewUploadAdditionalDocumentsRequestEntityTooLarge creates UploadAdditionalDocumentsRequestEntityTooLarge with default headers values -func NewUploadAdditionalDocumentsRequestEntityTooLarge() *UploadAdditionalDocumentsRequestEntityTooLarge { - - return &UploadAdditionalDocumentsRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// UploadAdditionalDocumentsInternalServerErrorCode is the HTTP code returned for type UploadAdditionalDocumentsInternalServerError -const UploadAdditionalDocumentsInternalServerErrorCode int = 500 - -/* -UploadAdditionalDocumentsInternalServerError server error - -swagger:response uploadAdditionalDocumentsInternalServerError -*/ -type UploadAdditionalDocumentsInternalServerError struct { -} - -// NewUploadAdditionalDocumentsInternalServerError creates UploadAdditionalDocumentsInternalServerError with default headers values -func NewUploadAdditionalDocumentsInternalServerError() *UploadAdditionalDocumentsInternalServerError { - - return &UploadAdditionalDocumentsInternalServerError{} -} - -// WriteResponse to the client -func (o *UploadAdditionalDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go deleted file mode 100644 index 2eebbbffd3d..00000000000 --- a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package moves - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UploadAdditionalDocumentsURL generates an URL for the upload additional documents operation -type UploadAdditionalDocumentsURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAdditionalDocumentsURL) WithBasePath(bp string) *UploadAdditionalDocumentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAdditionalDocumentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UploadAdditionalDocumentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/uploadAdditionalDocuments" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on UploadAdditionalDocumentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UploadAdditionalDocumentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UploadAdditionalDocumentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UploadAdditionalDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UploadAdditionalDocumentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UploadAdditionalDocumentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UploadAdditionalDocumentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go deleted file mode 100644 index addb9cd5958..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler -type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params -type CreateMTOShipmentHandler interface { - Handle(CreateMTOShipmentParams) middleware.Responder -} - -// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation -func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { - return &CreateMTOShipment{Context: ctx, Handler: handler} -} - -/* - CreateMTOShipment swagger:route POST /mto_shipments mtoShipment createMTOShipment - -createMTOShipment - -Creates a MTO shipment for the specified Move Task Order. -Required fields include: -* Shipment Type -* Customer requested pick-up date -* Pick-up Address -* Delivery Address - -Optional fields include: -* Customer Remarks -* Releasing / Receiving agents -*/ -type CreateMTOShipment struct { - Context *middleware.Context - Handler CreateMTOShipmentHandler -} - -func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 4eec95360b9..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOShipmentParams() CreateMTOShipmentParams { - - return CreateMTOShipmentParams{} -} - -// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOShipment -type CreateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *internalmessages.CreateShipment -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. -func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index c53ec978d52..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK -const CreateMTOShipmentOKCode int = 200 - -/* -CreateMTOShipmentOK Successfully created a MTO shipment. - -swagger:response createMTOShipmentOK -*/ -type CreateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *internalmessages.MTOShipment `json:"body,omitempty"` -} - -// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - - return &CreateMTOShipmentOK{} -} - -// WithPayload adds the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) WithPayload(payload *internalmessages.MTOShipment) *CreateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) SetPayload(payload *internalmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest -const CreateMTOShipmentBadRequestCode int = 400 - -/* -CreateMTOShipmentBadRequest The request payload is invalid. - -swagger:response createMTOShipmentBadRequest -*/ -type CreateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - - return &CreateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentUnauthorizedCode is the HTTP code returned for type CreateMTOShipmentUnauthorized -const CreateMTOShipmentUnauthorizedCode int = 401 - -/* -CreateMTOShipmentUnauthorized The request was denied. - -swagger:response createMTOShipmentUnauthorized -*/ -type CreateMTOShipmentUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentUnauthorized creates CreateMTOShipmentUnauthorized with default headers values -func NewCreateMTOShipmentUnauthorized() *CreateMTOShipmentUnauthorized { - - return &CreateMTOShipmentUnauthorized{} -} - -// WithPayload adds the payload to the create m t o shipment unauthorized response -func (o *CreateMTOShipmentUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment unauthorized response -func (o *CreateMTOShipmentUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentForbiddenCode is the HTTP code returned for type CreateMTOShipmentForbidden -const CreateMTOShipmentForbiddenCode int = 403 - -/* -CreateMTOShipmentForbidden The request was denied. - -swagger:response createMTOShipmentForbidden -*/ -type CreateMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentForbidden creates CreateMTOShipmentForbidden with default headers values -func NewCreateMTOShipmentForbidden() *CreateMTOShipmentForbidden { - - return &CreateMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the create m t o shipment forbidden response -func (o *CreateMTOShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment forbidden response -func (o *CreateMTOShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound -const CreateMTOShipmentNotFoundCode int = 404 - -/* -CreateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response createMTOShipmentNotFound -*/ -type CreateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - - return &CreateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity -const CreateMTOShipmentUnprocessableEntityCode int = 422 - -/* -CreateMTOShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response createMTOShipmentUnprocessableEntity -*/ -type CreateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - - return &CreateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError -const CreateMTOShipmentInternalServerErrorCode int = 500 - -/* -CreateMTOShipmentInternalServerError A server error occurred. - -swagger:response createMTOShipmentInternalServerError -*/ -type CreateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - - return &CreateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *CreateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index fbeb57347b1..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOShipmentURL generates an URL for the create m t o shipment operation -type CreateMTOShipmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto_shipments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go deleted file mode 100644 index e5b29ca477e..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteShipmentHandlerFunc turns a function with the right signature into a delete shipment handler -type DeleteShipmentHandlerFunc func(DeleteShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteShipmentHandlerFunc) Handle(params DeleteShipmentParams) middleware.Responder { - return fn(params) -} - -// DeleteShipmentHandler interface for that can handle valid delete shipment params -type DeleteShipmentHandler interface { - Handle(DeleteShipmentParams) middleware.Responder -} - -// NewDeleteShipment creates a new http.Handler for the delete shipment operation -func NewDeleteShipment(ctx *middleware.Context, handler DeleteShipmentHandler) *DeleteShipment { - return &DeleteShipment{Context: ctx, Handler: handler} -} - -/* - DeleteShipment swagger:route DELETE /mto-shipments/{mtoShipmentId} mtoShipment deleteShipment - -# Soft deletes a shipment by ID - -Soft deletes a shipment by ID -*/ -type DeleteShipment struct { - Context *middleware.Context - Handler DeleteShipmentHandler -} - -func (o *DeleteShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go deleted file mode 100644 index 04cb9f081ab..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteShipmentParams creates a new DeleteShipmentParams object -// -// There are no default values defined in the spec. -func NewDeleteShipmentParams() DeleteShipmentParams { - - return DeleteShipmentParams{} -} - -// DeleteShipmentParams contains all the bound params for the delete shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteShipment -type DeleteShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the shipment to be deleted - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteShipmentParams() beforehand. -func (o *DeleteShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentId") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *DeleteShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentId", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *DeleteShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentId", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go deleted file mode 100644 index e380c6e7735..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteShipmentNoContentCode is the HTTP code returned for type DeleteShipmentNoContent -const DeleteShipmentNoContentCode int = 204 - -/* -DeleteShipmentNoContent Successfully soft deleted the shipment - -swagger:response deleteShipmentNoContent -*/ -type DeleteShipmentNoContent struct { -} - -// NewDeleteShipmentNoContent creates DeleteShipmentNoContent with default headers values -func NewDeleteShipmentNoContent() *DeleteShipmentNoContent { - - return &DeleteShipmentNoContent{} -} - -// WriteResponse to the client -func (o *DeleteShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteShipmentBadRequestCode is the HTTP code returned for type DeleteShipmentBadRequest -const DeleteShipmentBadRequestCode int = 400 - -/* -DeleteShipmentBadRequest The request payload is invalid. - -swagger:response deleteShipmentBadRequest -*/ -type DeleteShipmentBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteShipmentBadRequest creates DeleteShipmentBadRequest with default headers values -func NewDeleteShipmentBadRequest() *DeleteShipmentBadRequest { - - return &DeleteShipmentBadRequest{} -} - -// WithPayload adds the payload to the delete shipment bad request response -func (o *DeleteShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment bad request response -func (o *DeleteShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentForbiddenCode is the HTTP code returned for type DeleteShipmentForbidden -const DeleteShipmentForbiddenCode int = 403 - -/* -DeleteShipmentForbidden The request was denied. - -swagger:response deleteShipmentForbidden -*/ -type DeleteShipmentForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteShipmentForbidden creates DeleteShipmentForbidden with default headers values -func NewDeleteShipmentForbidden() *DeleteShipmentForbidden { - - return &DeleteShipmentForbidden{} -} - -// WithPayload adds the payload to the delete shipment forbidden response -func (o *DeleteShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment forbidden response -func (o *DeleteShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentNotFoundCode is the HTTP code returned for type DeleteShipmentNotFound -const DeleteShipmentNotFoundCode int = 404 - -/* -DeleteShipmentNotFound The requested resource wasn't found. - -swagger:response deleteShipmentNotFound -*/ -type DeleteShipmentNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteShipmentNotFound creates DeleteShipmentNotFound with default headers values -func NewDeleteShipmentNotFound() *DeleteShipmentNotFound { - - return &DeleteShipmentNotFound{} -} - -// WithPayload adds the payload to the delete shipment not found response -func (o *DeleteShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment not found response -func (o *DeleteShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentConflictCode is the HTTP code returned for type DeleteShipmentConflict -const DeleteShipmentConflictCode int = 409 - -/* -DeleteShipmentConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response deleteShipmentConflict -*/ -type DeleteShipmentConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteShipmentConflict creates DeleteShipmentConflict with default headers values -func NewDeleteShipmentConflict() *DeleteShipmentConflict { - - return &DeleteShipmentConflict{} -} - -// WithPayload adds the payload to the delete shipment conflict response -func (o *DeleteShipmentConflict) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment conflict response -func (o *DeleteShipmentConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteShipmentUnprocessableEntity -const DeleteShipmentUnprocessableEntityCode int = 422 - -/* -DeleteShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response deleteShipmentUnprocessableEntity -*/ -type DeleteShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteShipmentUnprocessableEntity creates DeleteShipmentUnprocessableEntity with default headers values -func NewDeleteShipmentUnprocessableEntity() *DeleteShipmentUnprocessableEntity { - - return &DeleteShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete shipment unprocessable entity response -func (o *DeleteShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment unprocessable entity response -func (o *DeleteShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteShipmentInternalServerErrorCode is the HTTP code returned for type DeleteShipmentInternalServerError -const DeleteShipmentInternalServerErrorCode int = 500 - -/* -DeleteShipmentInternalServerError A server error occurred. - -swagger:response deleteShipmentInternalServerError -*/ -type DeleteShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewDeleteShipmentInternalServerError creates DeleteShipmentInternalServerError with default headers values -func NewDeleteShipmentInternalServerError() *DeleteShipmentInternalServerError { - - return &DeleteShipmentInternalServerError{} -} - -// WithPayload adds the payload to the delete shipment internal server error response -func (o *DeleteShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete shipment internal server error response -func (o *DeleteShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go deleted file mode 100644 index c03c6cfdd26..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteShipmentURL generates an URL for the delete shipment operation -type DeleteShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteShipmentURL) WithBasePath(bp string) *DeleteShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentId}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentId}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on DeleteShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go deleted file mode 100644 index 9a0d749c7a6..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMTOShipmentsHandlerFunc turns a function with the right signature into a list m t o shipments handler -type ListMTOShipmentsHandlerFunc func(ListMTOShipmentsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMTOShipmentsHandlerFunc) Handle(params ListMTOShipmentsParams) middleware.Responder { - return fn(params) -} - -// ListMTOShipmentsHandler interface for that can handle valid list m t o shipments params -type ListMTOShipmentsHandler interface { - Handle(ListMTOShipmentsParams) middleware.Responder -} - -// NewListMTOShipments creates a new http.Handler for the list m t o shipments operation -func NewListMTOShipments(ctx *middleware.Context, handler ListMTOShipmentsHandler) *ListMTOShipments { - return &ListMTOShipments{Context: ctx, Handler: handler} -} - -/* - ListMTOShipments swagger:route GET /moves/{moveTaskOrderID}/mto_shipments mtoShipment listMTOShipments - -# Gets all shipments for a move task order - -Gets all MTO shipments for the specified Move Task Order. -*/ -type ListMTOShipments struct { - Context *middleware.Context - Handler ListMTOShipmentsHandler -} - -func (o *ListMTOShipments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMTOShipmentsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go deleted file mode 100644 index e186e4a8796..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewListMTOShipmentsParams creates a new ListMTOShipmentsParams object -// -// There are no default values defined in the spec. -func NewListMTOShipmentsParams() ListMTOShipmentsParams { - - return ListMTOShipmentsParams{} -} - -// ListMTOShipmentsParams contains all the bound params for the list m t o shipments operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMTOShipments -type ListMTOShipmentsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of move task order for mto shipment to use - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMTOShipmentsParams() beforehand. -func (o *ListMTOShipmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *ListMTOShipmentsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *ListMTOShipmentsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go deleted file mode 100644 index 5065a4f9e4f..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ListMTOShipmentsOKCode is the HTTP code returned for type ListMTOShipmentsOK -const ListMTOShipmentsOKCode int = 200 - -/* -ListMTOShipmentsOK Successfully retrieved all mto shipments for a move task order. - -swagger:response listMTOShipmentsOK -*/ -type ListMTOShipmentsOK struct { - - /* - In: Body - */ - Payload internalmessages.MTOShipments `json:"body,omitempty"` -} - -// NewListMTOShipmentsOK creates ListMTOShipmentsOK with default headers values -func NewListMTOShipmentsOK() *ListMTOShipmentsOK { - - return &ListMTOShipmentsOK{} -} - -// WithPayload adds the payload to the list m t o shipments o k response -func (o *ListMTOShipmentsOK) WithPayload(payload internalmessages.MTOShipments) *ListMTOShipmentsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments o k response -func (o *ListMTOShipmentsOK) SetPayload(payload internalmessages.MTOShipments) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.MTOShipments{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMTOShipmentsBadRequestCode is the HTTP code returned for type ListMTOShipmentsBadRequest -const ListMTOShipmentsBadRequestCode int = 400 - -/* -ListMTOShipmentsBadRequest The request payload is invalid. - -swagger:response listMTOShipmentsBadRequest -*/ -type ListMTOShipmentsBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOShipmentsBadRequest creates ListMTOShipmentsBadRequest with default headers values -func NewListMTOShipmentsBadRequest() *ListMTOShipmentsBadRequest { - - return &ListMTOShipmentsBadRequest{} -} - -// WithPayload adds the payload to the list m t o shipments bad request response -func (o *ListMTOShipmentsBadRequest) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments bad request response -func (o *ListMTOShipmentsBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsUnauthorizedCode is the HTTP code returned for type ListMTOShipmentsUnauthorized -const ListMTOShipmentsUnauthorizedCode int = 401 - -/* -ListMTOShipmentsUnauthorized The request was denied. - -swagger:response listMTOShipmentsUnauthorized -*/ -type ListMTOShipmentsUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOShipmentsUnauthorized creates ListMTOShipmentsUnauthorized with default headers values -func NewListMTOShipmentsUnauthorized() *ListMTOShipmentsUnauthorized { - - return &ListMTOShipmentsUnauthorized{} -} - -// WithPayload adds the payload to the list m t o shipments unauthorized response -func (o *ListMTOShipmentsUnauthorized) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments unauthorized response -func (o *ListMTOShipmentsUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsNotFoundCode is the HTTP code returned for type ListMTOShipmentsNotFound -const ListMTOShipmentsNotFoundCode int = 404 - -/* -ListMTOShipmentsNotFound The requested resource wasn't found. - -swagger:response listMTOShipmentsNotFound -*/ -type ListMTOShipmentsNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOShipmentsNotFound creates ListMTOShipmentsNotFound with default headers values -func NewListMTOShipmentsNotFound() *ListMTOShipmentsNotFound { - - return &ListMTOShipmentsNotFound{} -} - -// WithPayload adds the payload to the list m t o shipments not found response -func (o *ListMTOShipmentsNotFound) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments not found response -func (o *ListMTOShipmentsNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOShipmentsInternalServerErrorCode is the HTTP code returned for type ListMTOShipmentsInternalServerError -const ListMTOShipmentsInternalServerErrorCode int = 500 - -/* -ListMTOShipmentsInternalServerError A server error occurred. - -swagger:response listMTOShipmentsInternalServerError -*/ -type ListMTOShipmentsInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewListMTOShipmentsInternalServerError creates ListMTOShipmentsInternalServerError with default headers values -func NewListMTOShipmentsInternalServerError() *ListMTOShipmentsInternalServerError { - - return &ListMTOShipmentsInternalServerError{} -} - -// WithPayload adds the payload to the list m t o shipments internal server error response -func (o *ListMTOShipmentsInternalServerError) WithPayload(payload *internalmessages.Error) *ListMTOShipmentsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o shipments internal server error response -func (o *ListMTOShipmentsInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOShipmentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go deleted file mode 100644 index 677f0a0a528..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ListMTOShipmentsURL generates an URL for the list m t o shipments operation -type ListMTOShipmentsURL struct { - MoveTaskOrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOShipmentsURL) WithBasePath(bp string) *ListMTOShipmentsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOShipmentsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMTOShipmentsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveTaskOrderID}/mto_shipments" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on ListMTOShipmentsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMTOShipmentsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMTOShipmentsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMTOShipmentsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMTOShipmentsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMTOShipmentsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMTOShipmentsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go deleted file mode 100644 index 5d423b0185f..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler -type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params -type UpdateMTOShipmentHandler interface { - Handle(UpdateMTOShipmentParams) middleware.Responder -} - -// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation -func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { - return &UpdateMTOShipment{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentId} mtoShipment updateMTOShipment - -updateMTOShipment - -Updates a specified MTO shipment. - -Required fields include: -* MTO Shipment ID required in path -* If-Match required in headers -* Shipment type is required in body - -Optional fields include: -* New shipment status type -* Customer requested pick-up date -* Pick-up Address -* Delivery Address -* Customer Remarks -* Releasing / Receiving agents -* Actual Pro Gear Weight -* Actual Spouse Pro Gear Weight -*/ -type UpdateMTOShipment struct { - Context *middleware.Context - Handler UpdateMTOShipmentHandler -} - -func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index aae8f82a7db..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { - - return UpdateMTOShipmentParams{} -} - -// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipment -type UpdateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - In: body - */ - Body *internalmessages.UpdateShipment - /*UUID of the MTO Shipment to update - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. -func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentId") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentId", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentId", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 1b60695cb68..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK -const UpdateMTOShipmentOKCode int = 200 - -/* -UpdateMTOShipmentOK Successfully updated the specified MTO shipment. - -swagger:response updateMTOShipmentOK -*/ -type UpdateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *internalmessages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - - return &UpdateMTOShipmentOK{} -} - -// WithPayload adds the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) WithPayload(payload *internalmessages.MTOShipment) *UpdateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) SetPayload(payload *internalmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest -const UpdateMTOShipmentBadRequestCode int = 400 - -/* -UpdateMTOShipmentBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentBadRequest -*/ -type UpdateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - - return &UpdateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized -const UpdateMTOShipmentUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentUnauthorized The request was denied. - -swagger:response updateMTOShipmentUnauthorized -*/ -type UpdateMTOShipmentUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - - return &UpdateMTOShipmentUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden -const UpdateMTOShipmentForbiddenCode int = 403 - -/* -UpdateMTOShipmentForbidden The request was denied. - -swagger:response updateMTOShipmentForbidden -*/ -type UpdateMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - - return &UpdateMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound -const UpdateMTOShipmentNotFoundCode int = 404 - -/* -UpdateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentNotFound -*/ -type UpdateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - - return &UpdateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed -const UpdateMTOShipmentPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentPreconditionFailed -*/ -type UpdateMTOShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - - return &UpdateMTOShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity -const UpdateMTOShipmentUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOShipmentUnprocessableEntity -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - - return &UpdateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError -const UpdateMTOShipmentInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentInternalServerError A server error occurred. - -swagger:response updateMTOShipmentInternalServerError -*/ -type UpdateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - - return &UpdateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index ff57050f147..00000000000 --- a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation -type UpdateMTOShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentId}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentId}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/mymove_api.go b/pkg/gen/internalapi/internaloperations/mymove_api.go deleted file mode 100644 index b1ba4e1ac47..00000000000 --- a/pkg/gen/internalapi/internaloperations/mymove_api.go +++ /dev/null @@ -1,1175 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internaloperations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/addresses" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/application_parameters" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/backup_contacts" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/calendar" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/certification" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/documents" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/duty_locations" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/entitlements" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/feature_flags" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/move_docs" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/moves" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/office" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/okta_profile" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/orders" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/postal_codes" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/ppm" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/queues" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/service_members" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/transportation_offices" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/uploads" - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/users" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - MultipartformConsumer: runtime.DiscardConsumer, - - BinProducer: runtime.ByteStreamProducer(), - JSONProducer: runtime.JSONProducer(), - - OfficeApproveMoveHandler: office.ApproveMoveHandlerFunc(func(params office.ApproveMoveParams) middleware.Responder { - return middleware.NotImplemented("operation office.ApproveMove has not yet been implemented") - }), - OfficeApproveReimbursementHandler: office.ApproveReimbursementHandlerFunc(func(params office.ApproveReimbursementParams) middleware.Responder { - return middleware.NotImplemented("operation office.ApproveReimbursement has not yet been implemented") - }), - FeatureFlagsBooleanFeatureFlagForUserHandler: feature_flags.BooleanFeatureFlagForUserHandlerFunc(func(params feature_flags.BooleanFeatureFlagForUserParams) middleware.Responder { - return middleware.NotImplemented("operation feature_flags.BooleanFeatureFlagForUser has not yet been implemented") - }), - OfficeCancelMoveHandler: office.CancelMoveHandlerFunc(func(params office.CancelMoveParams) middleware.Responder { - return middleware.NotImplemented("operation office.CancelMove has not yet been implemented") - }), - DocumentsCreateDocumentHandler: documents.CreateDocumentHandlerFunc(func(params documents.CreateDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation documents.CreateDocument has not yet been implemented") - }), - MoveDocsCreateGenericMoveDocumentHandler: move_docs.CreateGenericMoveDocumentHandlerFunc(func(params move_docs.CreateGenericMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.CreateGenericMoveDocument has not yet been implemented") - }), - MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }), - PpmCreateMovingExpenseHandler: ppm.CreateMovingExpenseHandlerFunc(func(params ppm.CreateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateMovingExpense has not yet been implemented") - }), - OrdersCreateOrdersHandler: orders.CreateOrdersHandlerFunc(func(params orders.CreateOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.CreateOrders has not yet been implemented") - }), - PpmCreatePPMUploadHandler: ppm.CreatePPMUploadHandlerFunc(func(params ppm.CreatePPMUploadParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreatePPMUpload has not yet been implemented") - }), - PpmCreateProGearWeightTicketHandler: ppm.CreateProGearWeightTicketHandlerFunc(func(params ppm.CreateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateProGearWeightTicket has not yet been implemented") - }), - ServiceMembersCreateServiceMemberHandler: service_members.CreateServiceMemberHandlerFunc(func(params service_members.CreateServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.CreateServiceMember has not yet been implemented") - }), - BackupContactsCreateServiceMemberBackupContactHandler: backup_contacts.CreateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.CreateServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.CreateServiceMemberBackupContact has not yet been implemented") - }), - CertificationCreateSignedCertificationHandler: certification.CreateSignedCertificationHandlerFunc(func(params certification.CreateSignedCertificationParams) middleware.Responder { - return middleware.NotImplemented("operation certification.CreateSignedCertification has not yet been implemented") - }), - UploadsCreateUploadHandler: uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") - }), - PpmCreateWeightTicketHandler: ppm.CreateWeightTicketHandlerFunc(func(params ppm.CreateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.CreateWeightTicket has not yet been implemented") - }), - MoveDocsCreateWeightTicketDocumentHandler: move_docs.CreateWeightTicketDocumentHandlerFunc(func(params move_docs.CreateWeightTicketDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.CreateWeightTicketDocument has not yet been implemented") - }), - MoveDocsDeleteMoveDocumentHandler: move_docs.DeleteMoveDocumentHandlerFunc(func(params move_docs.DeleteMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.DeleteMoveDocument has not yet been implemented") - }), - PpmDeleteMovingExpenseHandler: ppm.DeleteMovingExpenseHandlerFunc(func(params ppm.DeleteMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteMovingExpense has not yet been implemented") - }), - PpmDeleteProGearWeightTicketHandler: ppm.DeleteProGearWeightTicketHandlerFunc(func(params ppm.DeleteProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteProGearWeightTicket has not yet been implemented") - }), - MtoShipmentDeleteShipmentHandler: mto_shipment.DeleteShipmentHandlerFunc(func(params mto_shipment.DeleteShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.DeleteShipment has not yet been implemented") - }), - UploadsDeleteUploadHandler: uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") - }), - UploadsDeleteUploadsHandler: uploads.DeleteUploadsHandlerFunc(func(params uploads.DeleteUploadsParams) middleware.Responder { - return middleware.NotImplemented("operation uploads.DeleteUploads has not yet been implemented") - }), - PpmDeleteWeightTicketHandler: ppm.DeleteWeightTicketHandlerFunc(func(params ppm.DeleteWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") - }), - MovesGetAllMovesHandler: moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { - return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") - }), - AddressesGetLocationByZipCityStateHandler: addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") - }), - TransportationOfficesGetTransportationOfficesHandler: transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") - }), - EntitlementsIndexEntitlementsHandler: entitlements.IndexEntitlementsHandlerFunc(func(params entitlements.IndexEntitlementsParams) middleware.Responder { - return middleware.NotImplemented("operation entitlements.IndexEntitlements has not yet been implemented") - }), - MoveDocsIndexMoveDocumentsHandler: move_docs.IndexMoveDocumentsHandlerFunc(func(params move_docs.IndexMoveDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.IndexMoveDocuments has not yet been implemented") - }), - BackupContactsIndexServiceMemberBackupContactsHandler: backup_contacts.IndexServiceMemberBackupContactsHandlerFunc(func(params backup_contacts.IndexServiceMemberBackupContactsParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.IndexServiceMemberBackupContacts has not yet been implemented") - }), - CertificationIndexSignedCertificationHandler: certification.IndexSignedCertificationHandlerFunc(func(params certification.IndexSignedCertificationParams) middleware.Responder { - return middleware.NotImplemented("operation certification.IndexSignedCertification has not yet been implemented") - }), - CalendarIsDateWeekendHolidayHandler: calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") - }), - UsersIsLoggedInUserHandler: users.IsLoggedInUserHandlerFunc(func(params users.IsLoggedInUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.IsLoggedInUser has not yet been implemented") - }), - MtoShipmentListMTOShipmentsHandler: mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") - }), - MovesPatchMoveHandler: moves.PatchMoveHandlerFunc(func(params moves.PatchMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") - }), - ServiceMembersPatchServiceMemberHandler: service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") - }), - PpmResubmitPPMShipmentDocumentationHandler: ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") - }), - DutyLocationsSearchDutyLocationsHandler: duty_locations.SearchDutyLocationsHandlerFunc(func(params duty_locations.SearchDutyLocationsParams) middleware.Responder { - return middleware.NotImplemented("operation duty_locations.SearchDutyLocations has not yet been implemented") - }), - PpmShowAOAPacketHandler: ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") - }), - AddressesShowAddressHandler: addresses.ShowAddressHandlerFunc(func(params addresses.ShowAddressParams) middleware.Responder { - return middleware.NotImplemented("operation addresses.ShowAddress has not yet been implemented") - }), - CalendarShowAvailableMoveDatesHandler: calendar.ShowAvailableMoveDatesHandlerFunc(func(params calendar.ShowAvailableMoveDatesParams) middleware.Responder { - return middleware.NotImplemented("operation calendar.ShowAvailableMoveDates has not yet been implemented") - }), - TransportationOfficesShowCounselingOfficesHandler: transportation_offices.ShowCounselingOfficesHandlerFunc(func(params transportation_offices.ShowCounselingOfficesParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.ShowCounselingOffices has not yet been implemented") - }), - DocumentsShowDocumentHandler: documents.ShowDocumentHandlerFunc(func(params documents.ShowDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation documents.ShowDocument has not yet been implemented") - }), - TransportationOfficesShowDutyLocationTransportationOfficeHandler: transportation_offices.ShowDutyLocationTransportationOfficeHandlerFunc(func(params transportation_offices.ShowDutyLocationTransportationOfficeParams) middleware.Responder { - return middleware.NotImplemented("operation transportation_offices.ShowDutyLocationTransportationOffice has not yet been implemented") - }), - UsersShowLoggedInUserHandler: users.ShowLoggedInUserHandlerFunc(func(params users.ShowLoggedInUserParams) middleware.Responder { - return middleware.NotImplemented("operation users.ShowLoggedInUser has not yet been implemented") - }), - MovesShowMoveHandler: moves.ShowMoveHandlerFunc(func(params moves.ShowMoveParams) middleware.Responder { - return middleware.NotImplemented("operation moves.ShowMove has not yet been implemented") - }), - OfficeShowOfficeOrdersHandler: office.ShowOfficeOrdersHandlerFunc(func(params office.ShowOfficeOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation office.ShowOfficeOrders has not yet been implemented") - }), - OktaProfileShowOktaInfoHandler: okta_profile.ShowOktaInfoHandlerFunc(func(params okta_profile.ShowOktaInfoParams) middleware.Responder { - return middleware.NotImplemented("operation okta_profile.ShowOktaInfo has not yet been implemented") - }), - OrdersShowOrdersHandler: orders.ShowOrdersHandlerFunc(func(params orders.ShowOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.ShowOrders has not yet been implemented") - }), - PpmShowPaymentPacketHandler: ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") - }), - QueuesShowQueueHandler: queues.ShowQueueHandlerFunc(func(params queues.ShowQueueParams) middleware.Responder { - return middleware.NotImplemented("operation queues.ShowQueue has not yet been implemented") - }), - ServiceMembersShowServiceMemberHandler: service_members.ShowServiceMemberHandlerFunc(func(params service_members.ShowServiceMemberParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.ShowServiceMember has not yet been implemented") - }), - BackupContactsShowServiceMemberBackupContactHandler: backup_contacts.ShowServiceMemberBackupContactHandlerFunc(func(params backup_contacts.ShowServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.ShowServiceMemberBackupContact has not yet been implemented") - }), - ServiceMembersShowServiceMemberOrdersHandler: service_members.ShowServiceMemberOrdersHandlerFunc(func(params service_members.ShowServiceMemberOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation service_members.ShowServiceMemberOrders has not yet been implemented") - }), - MovesSubmitAmendedOrdersHandler: moves.SubmitAmendedOrdersHandlerFunc(func(params moves.SubmitAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation moves.SubmitAmendedOrders has not yet been implemented") - }), - MovesSubmitMoveForApprovalHandler: moves.SubmitMoveForApprovalHandlerFunc(func(params moves.SubmitMoveForApprovalParams) middleware.Responder { - return middleware.NotImplemented("operation moves.SubmitMoveForApproval has not yet been implemented") - }), - PpmSubmitPPMShipmentDocumentationHandler: ppm.SubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.SubmitPPMShipmentDocumentationParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }), - MoveDocsUpdateMoveDocumentHandler: move_docs.UpdateMoveDocumentHandlerFunc(func(params move_docs.UpdateMoveDocumentParams) middleware.Responder { - return middleware.NotImplemented("operation move_docs.UpdateMoveDocument has not yet been implemented") - }), - PpmUpdateMovingExpenseHandler: ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") - }), - OktaProfileUpdateOktaInfoHandler: okta_profile.UpdateOktaInfoHandlerFunc(func(params okta_profile.UpdateOktaInfoParams) middleware.Responder { - return middleware.NotImplemented("operation okta_profile.UpdateOktaInfo has not yet been implemented") - }), - OrdersUpdateOrdersHandler: orders.UpdateOrdersHandlerFunc(func(params orders.UpdateOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.UpdateOrders has not yet been implemented") - }), - PpmUpdateProGearWeightTicketHandler: ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") - }), - BackupContactsUpdateServiceMemberBackupContactHandler: backup_contacts.UpdateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.UpdateServiceMemberBackupContactParams) middleware.Responder { - return middleware.NotImplemented("operation backup_contacts.UpdateServiceMemberBackupContact has not yet been implemented") - }), - PpmUpdateWeightTicketHandler: ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { - return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") - }), - MovesUploadAdditionalDocumentsHandler: moves.UploadAdditionalDocumentsHandlerFunc(func(params moves.UploadAdditionalDocumentsParams) middleware.Responder { - return middleware.NotImplemented("operation moves.UploadAdditionalDocuments has not yet been implemented") - }), - OrdersUploadAmendedOrdersHandler: orders.UploadAmendedOrdersHandlerFunc(func(params orders.UploadAmendedOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation orders.UploadAmendedOrders has not yet been implemented") - }), - ApplicationParametersValidateHandler: application_parameters.ValidateHandlerFunc(func(params application_parameters.ValidateParams) middleware.Responder { - return middleware.NotImplemented("operation application_parameters.Validate has not yet been implemented") - }), - PostalCodesValidatePostalCodeWithRateDataHandler: postal_codes.ValidatePostalCodeWithRateDataHandlerFunc(func(params postal_codes.ValidatePostalCodeWithRateDataParams) middleware.Responder { - return middleware.NotImplemented("operation postal_codes.ValidatePostalCodeWithRateData has not yet been implemented") - }), - FeatureFlagsVariantFeatureFlagForUserHandler: feature_flags.VariantFeatureFlagForUserHandlerFunc(func(params feature_flags.VariantFeatureFlagForUserParams) middleware.Responder { - return middleware.NotImplemented("operation feature_flags.VariantFeatureFlagForUser has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Internal API is a RESTful API that enables the Customer application for -MilMove. - -All endpoints are located under `/internal`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // MultipartformConsumer registers a consumer for the following mime types: - // - multipart/form-data - MultipartformConsumer runtime.Consumer - - // BinProducer registers a producer for the following mime types: - // - application/pdf - BinProducer runtime.Producer - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // OfficeApproveMoveHandler sets the operation handler for the approve move operation - OfficeApproveMoveHandler office.ApproveMoveHandler - // OfficeApproveReimbursementHandler sets the operation handler for the approve reimbursement operation - OfficeApproveReimbursementHandler office.ApproveReimbursementHandler - // FeatureFlagsBooleanFeatureFlagForUserHandler sets the operation handler for the boolean feature flag for user operation - FeatureFlagsBooleanFeatureFlagForUserHandler feature_flags.BooleanFeatureFlagForUserHandler - // OfficeCancelMoveHandler sets the operation handler for the cancel move operation - OfficeCancelMoveHandler office.CancelMoveHandler - // DocumentsCreateDocumentHandler sets the operation handler for the create document operation - DocumentsCreateDocumentHandler documents.CreateDocumentHandler - // MoveDocsCreateGenericMoveDocumentHandler sets the operation handler for the create generic move document operation - MoveDocsCreateGenericMoveDocumentHandler move_docs.CreateGenericMoveDocumentHandler - // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation - MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler - // PpmCreateMovingExpenseHandler sets the operation handler for the create moving expense operation - PpmCreateMovingExpenseHandler ppm.CreateMovingExpenseHandler - // OrdersCreateOrdersHandler sets the operation handler for the create orders operation - OrdersCreateOrdersHandler orders.CreateOrdersHandler - // PpmCreatePPMUploadHandler sets the operation handler for the create p p m upload operation - PpmCreatePPMUploadHandler ppm.CreatePPMUploadHandler - // PpmCreateProGearWeightTicketHandler sets the operation handler for the create pro gear weight ticket operation - PpmCreateProGearWeightTicketHandler ppm.CreateProGearWeightTicketHandler - // ServiceMembersCreateServiceMemberHandler sets the operation handler for the create service member operation - ServiceMembersCreateServiceMemberHandler service_members.CreateServiceMemberHandler - // BackupContactsCreateServiceMemberBackupContactHandler sets the operation handler for the create service member backup contact operation - BackupContactsCreateServiceMemberBackupContactHandler backup_contacts.CreateServiceMemberBackupContactHandler - // CertificationCreateSignedCertificationHandler sets the operation handler for the create signed certification operation - CertificationCreateSignedCertificationHandler certification.CreateSignedCertificationHandler - // UploadsCreateUploadHandler sets the operation handler for the create upload operation - UploadsCreateUploadHandler uploads.CreateUploadHandler - // PpmCreateWeightTicketHandler sets the operation handler for the create weight ticket operation - PpmCreateWeightTicketHandler ppm.CreateWeightTicketHandler - // MoveDocsCreateWeightTicketDocumentHandler sets the operation handler for the create weight ticket document operation - MoveDocsCreateWeightTicketDocumentHandler move_docs.CreateWeightTicketDocumentHandler - // MoveDocsDeleteMoveDocumentHandler sets the operation handler for the delete move document operation - MoveDocsDeleteMoveDocumentHandler move_docs.DeleteMoveDocumentHandler - // PpmDeleteMovingExpenseHandler sets the operation handler for the delete moving expense operation - PpmDeleteMovingExpenseHandler ppm.DeleteMovingExpenseHandler - // PpmDeleteProGearWeightTicketHandler sets the operation handler for the delete pro gear weight ticket operation - PpmDeleteProGearWeightTicketHandler ppm.DeleteProGearWeightTicketHandler - // MtoShipmentDeleteShipmentHandler sets the operation handler for the delete shipment operation - MtoShipmentDeleteShipmentHandler mto_shipment.DeleteShipmentHandler - // UploadsDeleteUploadHandler sets the operation handler for the delete upload operation - UploadsDeleteUploadHandler uploads.DeleteUploadHandler - // UploadsDeleteUploadsHandler sets the operation handler for the delete uploads operation - UploadsDeleteUploadsHandler uploads.DeleteUploadsHandler - // PpmDeleteWeightTicketHandler sets the operation handler for the delete weight ticket operation - PpmDeleteWeightTicketHandler ppm.DeleteWeightTicketHandler - // MovesGetAllMovesHandler sets the operation handler for the get all moves operation - MovesGetAllMovesHandler moves.GetAllMovesHandler - // AddressesGetLocationByZipCityStateHandler sets the operation handler for the get location by zip city state operation - AddressesGetLocationByZipCityStateHandler addresses.GetLocationByZipCityStateHandler - // TransportationOfficesGetTransportationOfficesHandler sets the operation handler for the get transportation offices operation - TransportationOfficesGetTransportationOfficesHandler transportation_offices.GetTransportationOfficesHandler - // EntitlementsIndexEntitlementsHandler sets the operation handler for the index entitlements operation - EntitlementsIndexEntitlementsHandler entitlements.IndexEntitlementsHandler - // MoveDocsIndexMoveDocumentsHandler sets the operation handler for the index move documents operation - MoveDocsIndexMoveDocumentsHandler move_docs.IndexMoveDocumentsHandler - // BackupContactsIndexServiceMemberBackupContactsHandler sets the operation handler for the index service member backup contacts operation - BackupContactsIndexServiceMemberBackupContactsHandler backup_contacts.IndexServiceMemberBackupContactsHandler - // CertificationIndexSignedCertificationHandler sets the operation handler for the index signed certification operation - CertificationIndexSignedCertificationHandler certification.IndexSignedCertificationHandler - // CalendarIsDateWeekendHolidayHandler sets the operation handler for the is date weekend holiday operation - CalendarIsDateWeekendHolidayHandler calendar.IsDateWeekendHolidayHandler - // UsersIsLoggedInUserHandler sets the operation handler for the is logged in user operation - UsersIsLoggedInUserHandler users.IsLoggedInUserHandler - // MtoShipmentListMTOShipmentsHandler sets the operation handler for the list m t o shipments operation - MtoShipmentListMTOShipmentsHandler mto_shipment.ListMTOShipmentsHandler - // MovesPatchMoveHandler sets the operation handler for the patch move operation - MovesPatchMoveHandler moves.PatchMoveHandler - // ServiceMembersPatchServiceMemberHandler sets the operation handler for the patch service member operation - ServiceMembersPatchServiceMemberHandler service_members.PatchServiceMemberHandler - // PpmResubmitPPMShipmentDocumentationHandler sets the operation handler for the resubmit p p m shipment documentation operation - PpmResubmitPPMShipmentDocumentationHandler ppm.ResubmitPPMShipmentDocumentationHandler - // DutyLocationsSearchDutyLocationsHandler sets the operation handler for the search duty locations operation - DutyLocationsSearchDutyLocationsHandler duty_locations.SearchDutyLocationsHandler - // PpmShowAOAPacketHandler sets the operation handler for the show a o a packet operation - PpmShowAOAPacketHandler ppm.ShowAOAPacketHandler - // AddressesShowAddressHandler sets the operation handler for the show address operation - AddressesShowAddressHandler addresses.ShowAddressHandler - // CalendarShowAvailableMoveDatesHandler sets the operation handler for the show available move dates operation - CalendarShowAvailableMoveDatesHandler calendar.ShowAvailableMoveDatesHandler - // TransportationOfficesShowCounselingOfficesHandler sets the operation handler for the show counseling offices operation - TransportationOfficesShowCounselingOfficesHandler transportation_offices.ShowCounselingOfficesHandler - // DocumentsShowDocumentHandler sets the operation handler for the show document operation - DocumentsShowDocumentHandler documents.ShowDocumentHandler - // TransportationOfficesShowDutyLocationTransportationOfficeHandler sets the operation handler for the show duty location transportation office operation - TransportationOfficesShowDutyLocationTransportationOfficeHandler transportation_offices.ShowDutyLocationTransportationOfficeHandler - // UsersShowLoggedInUserHandler sets the operation handler for the show logged in user operation - UsersShowLoggedInUserHandler users.ShowLoggedInUserHandler - // MovesShowMoveHandler sets the operation handler for the show move operation - MovesShowMoveHandler moves.ShowMoveHandler - // OfficeShowOfficeOrdersHandler sets the operation handler for the show office orders operation - OfficeShowOfficeOrdersHandler office.ShowOfficeOrdersHandler - // OktaProfileShowOktaInfoHandler sets the operation handler for the show okta info operation - OktaProfileShowOktaInfoHandler okta_profile.ShowOktaInfoHandler - // OrdersShowOrdersHandler sets the operation handler for the show orders operation - OrdersShowOrdersHandler orders.ShowOrdersHandler - // PpmShowPaymentPacketHandler sets the operation handler for the show payment packet operation - PpmShowPaymentPacketHandler ppm.ShowPaymentPacketHandler - // QueuesShowQueueHandler sets the operation handler for the show queue operation - QueuesShowQueueHandler queues.ShowQueueHandler - // ServiceMembersShowServiceMemberHandler sets the operation handler for the show service member operation - ServiceMembersShowServiceMemberHandler service_members.ShowServiceMemberHandler - // BackupContactsShowServiceMemberBackupContactHandler sets the operation handler for the show service member backup contact operation - BackupContactsShowServiceMemberBackupContactHandler backup_contacts.ShowServiceMemberBackupContactHandler - // ServiceMembersShowServiceMemberOrdersHandler sets the operation handler for the show service member orders operation - ServiceMembersShowServiceMemberOrdersHandler service_members.ShowServiceMemberOrdersHandler - // MovesSubmitAmendedOrdersHandler sets the operation handler for the submit amended orders operation - MovesSubmitAmendedOrdersHandler moves.SubmitAmendedOrdersHandler - // MovesSubmitMoveForApprovalHandler sets the operation handler for the submit move for approval operation - MovesSubmitMoveForApprovalHandler moves.SubmitMoveForApprovalHandler - // PpmSubmitPPMShipmentDocumentationHandler sets the operation handler for the submit p p m shipment documentation operation - PpmSubmitPPMShipmentDocumentationHandler ppm.SubmitPPMShipmentDocumentationHandler - // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation - MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler - // MoveDocsUpdateMoveDocumentHandler sets the operation handler for the update move document operation - MoveDocsUpdateMoveDocumentHandler move_docs.UpdateMoveDocumentHandler - // PpmUpdateMovingExpenseHandler sets the operation handler for the update moving expense operation - PpmUpdateMovingExpenseHandler ppm.UpdateMovingExpenseHandler - // OktaProfileUpdateOktaInfoHandler sets the operation handler for the update okta info operation - OktaProfileUpdateOktaInfoHandler okta_profile.UpdateOktaInfoHandler - // OrdersUpdateOrdersHandler sets the operation handler for the update orders operation - OrdersUpdateOrdersHandler orders.UpdateOrdersHandler - // PpmUpdateProGearWeightTicketHandler sets the operation handler for the update pro gear weight ticket operation - PpmUpdateProGearWeightTicketHandler ppm.UpdateProGearWeightTicketHandler - // BackupContactsUpdateServiceMemberBackupContactHandler sets the operation handler for the update service member backup contact operation - BackupContactsUpdateServiceMemberBackupContactHandler backup_contacts.UpdateServiceMemberBackupContactHandler - // PpmUpdateWeightTicketHandler sets the operation handler for the update weight ticket operation - PpmUpdateWeightTicketHandler ppm.UpdateWeightTicketHandler - // MovesUploadAdditionalDocumentsHandler sets the operation handler for the upload additional documents operation - MovesUploadAdditionalDocumentsHandler moves.UploadAdditionalDocumentsHandler - // OrdersUploadAmendedOrdersHandler sets the operation handler for the upload amended orders operation - OrdersUploadAmendedOrdersHandler orders.UploadAmendedOrdersHandler - // ApplicationParametersValidateHandler sets the operation handler for the validate operation - ApplicationParametersValidateHandler application_parameters.ValidateHandler - // PostalCodesValidatePostalCodeWithRateDataHandler sets the operation handler for the validate postal code with rate data operation - PostalCodesValidatePostalCodeWithRateDataHandler postal_codes.ValidatePostalCodeWithRateDataHandler - // FeatureFlagsVariantFeatureFlagForUserHandler sets the operation handler for the variant feature flag for user operation - FeatureFlagsVariantFeatureFlagForUserHandler feature_flags.VariantFeatureFlagForUserHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.MultipartformConsumer == nil { - unregistered = append(unregistered, "MultipartformConsumer") - } - - if o.BinProducer == nil { - unregistered = append(unregistered, "BinProducer") - } - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.OfficeApproveMoveHandler == nil { - unregistered = append(unregistered, "office.ApproveMoveHandler") - } - if o.OfficeApproveReimbursementHandler == nil { - unregistered = append(unregistered, "office.ApproveReimbursementHandler") - } - if o.FeatureFlagsBooleanFeatureFlagForUserHandler == nil { - unregistered = append(unregistered, "feature_flags.BooleanFeatureFlagForUserHandler") - } - if o.OfficeCancelMoveHandler == nil { - unregistered = append(unregistered, "office.CancelMoveHandler") - } - if o.DocumentsCreateDocumentHandler == nil { - unregistered = append(unregistered, "documents.CreateDocumentHandler") - } - if o.MoveDocsCreateGenericMoveDocumentHandler == nil { - unregistered = append(unregistered, "move_docs.CreateGenericMoveDocumentHandler") - } - if o.MtoShipmentCreateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") - } - if o.PpmCreateMovingExpenseHandler == nil { - unregistered = append(unregistered, "ppm.CreateMovingExpenseHandler") - } - if o.OrdersCreateOrdersHandler == nil { - unregistered = append(unregistered, "orders.CreateOrdersHandler") - } - if o.PpmCreatePPMUploadHandler == nil { - unregistered = append(unregistered, "ppm.CreatePPMUploadHandler") - } - if o.PpmCreateProGearWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.CreateProGearWeightTicketHandler") - } - if o.ServiceMembersCreateServiceMemberHandler == nil { - unregistered = append(unregistered, "service_members.CreateServiceMemberHandler") - } - if o.BackupContactsCreateServiceMemberBackupContactHandler == nil { - unregistered = append(unregistered, "backup_contacts.CreateServiceMemberBackupContactHandler") - } - if o.CertificationCreateSignedCertificationHandler == nil { - unregistered = append(unregistered, "certification.CreateSignedCertificationHandler") - } - if o.UploadsCreateUploadHandler == nil { - unregistered = append(unregistered, "uploads.CreateUploadHandler") - } - if o.PpmCreateWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.CreateWeightTicketHandler") - } - if o.MoveDocsCreateWeightTicketDocumentHandler == nil { - unregistered = append(unregistered, "move_docs.CreateWeightTicketDocumentHandler") - } - if o.MoveDocsDeleteMoveDocumentHandler == nil { - unregistered = append(unregistered, "move_docs.DeleteMoveDocumentHandler") - } - if o.PpmDeleteMovingExpenseHandler == nil { - unregistered = append(unregistered, "ppm.DeleteMovingExpenseHandler") - } - if o.PpmDeleteProGearWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.DeleteProGearWeightTicketHandler") - } - if o.MtoShipmentDeleteShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.DeleteShipmentHandler") - } - if o.UploadsDeleteUploadHandler == nil { - unregistered = append(unregistered, "uploads.DeleteUploadHandler") - } - if o.UploadsDeleteUploadsHandler == nil { - unregistered = append(unregistered, "uploads.DeleteUploadsHandler") - } - if o.PpmDeleteWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.DeleteWeightTicketHandler") - } - if o.MovesGetAllMovesHandler == nil { - unregistered = append(unregistered, "moves.GetAllMovesHandler") - } - if o.AddressesGetLocationByZipCityStateHandler == nil { - unregistered = append(unregistered, "addresses.GetLocationByZipCityStateHandler") - } - if o.TransportationOfficesGetTransportationOfficesHandler == nil { - unregistered = append(unregistered, "transportation_offices.GetTransportationOfficesHandler") - } - if o.EntitlementsIndexEntitlementsHandler == nil { - unregistered = append(unregistered, "entitlements.IndexEntitlementsHandler") - } - if o.MoveDocsIndexMoveDocumentsHandler == nil { - unregistered = append(unregistered, "move_docs.IndexMoveDocumentsHandler") - } - if o.BackupContactsIndexServiceMemberBackupContactsHandler == nil { - unregistered = append(unregistered, "backup_contacts.IndexServiceMemberBackupContactsHandler") - } - if o.CertificationIndexSignedCertificationHandler == nil { - unregistered = append(unregistered, "certification.IndexSignedCertificationHandler") - } - if o.CalendarIsDateWeekendHolidayHandler == nil { - unregistered = append(unregistered, "calendar.IsDateWeekendHolidayHandler") - } - if o.UsersIsLoggedInUserHandler == nil { - unregistered = append(unregistered, "users.IsLoggedInUserHandler") - } - if o.MtoShipmentListMTOShipmentsHandler == nil { - unregistered = append(unregistered, "mto_shipment.ListMTOShipmentsHandler") - } - if o.MovesPatchMoveHandler == nil { - unregistered = append(unregistered, "moves.PatchMoveHandler") - } - if o.ServiceMembersPatchServiceMemberHandler == nil { - unregistered = append(unregistered, "service_members.PatchServiceMemberHandler") - } - if o.PpmResubmitPPMShipmentDocumentationHandler == nil { - unregistered = append(unregistered, "ppm.ResubmitPPMShipmentDocumentationHandler") - } - if o.DutyLocationsSearchDutyLocationsHandler == nil { - unregistered = append(unregistered, "duty_locations.SearchDutyLocationsHandler") - } - if o.PpmShowAOAPacketHandler == nil { - unregistered = append(unregistered, "ppm.ShowAOAPacketHandler") - } - if o.AddressesShowAddressHandler == nil { - unregistered = append(unregistered, "addresses.ShowAddressHandler") - } - if o.CalendarShowAvailableMoveDatesHandler == nil { - unregistered = append(unregistered, "calendar.ShowAvailableMoveDatesHandler") - } - if o.TransportationOfficesShowCounselingOfficesHandler == nil { - unregistered = append(unregistered, "transportation_offices.ShowCounselingOfficesHandler") - } - if o.DocumentsShowDocumentHandler == nil { - unregistered = append(unregistered, "documents.ShowDocumentHandler") - } - if o.TransportationOfficesShowDutyLocationTransportationOfficeHandler == nil { - unregistered = append(unregistered, "transportation_offices.ShowDutyLocationTransportationOfficeHandler") - } - if o.UsersShowLoggedInUserHandler == nil { - unregistered = append(unregistered, "users.ShowLoggedInUserHandler") - } - if o.MovesShowMoveHandler == nil { - unregistered = append(unregistered, "moves.ShowMoveHandler") - } - if o.OfficeShowOfficeOrdersHandler == nil { - unregistered = append(unregistered, "office.ShowOfficeOrdersHandler") - } - if o.OktaProfileShowOktaInfoHandler == nil { - unregistered = append(unregistered, "okta_profile.ShowOktaInfoHandler") - } - if o.OrdersShowOrdersHandler == nil { - unregistered = append(unregistered, "orders.ShowOrdersHandler") - } - if o.PpmShowPaymentPacketHandler == nil { - unregistered = append(unregistered, "ppm.ShowPaymentPacketHandler") - } - if o.QueuesShowQueueHandler == nil { - unregistered = append(unregistered, "queues.ShowQueueHandler") - } - if o.ServiceMembersShowServiceMemberHandler == nil { - unregistered = append(unregistered, "service_members.ShowServiceMemberHandler") - } - if o.BackupContactsShowServiceMemberBackupContactHandler == nil { - unregistered = append(unregistered, "backup_contacts.ShowServiceMemberBackupContactHandler") - } - if o.ServiceMembersShowServiceMemberOrdersHandler == nil { - unregistered = append(unregistered, "service_members.ShowServiceMemberOrdersHandler") - } - if o.MovesSubmitAmendedOrdersHandler == nil { - unregistered = append(unregistered, "moves.SubmitAmendedOrdersHandler") - } - if o.MovesSubmitMoveForApprovalHandler == nil { - unregistered = append(unregistered, "moves.SubmitMoveForApprovalHandler") - } - if o.PpmSubmitPPMShipmentDocumentationHandler == nil { - unregistered = append(unregistered, "ppm.SubmitPPMShipmentDocumentationHandler") - } - if o.MtoShipmentUpdateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") - } - if o.MoveDocsUpdateMoveDocumentHandler == nil { - unregistered = append(unregistered, "move_docs.UpdateMoveDocumentHandler") - } - if o.PpmUpdateMovingExpenseHandler == nil { - unregistered = append(unregistered, "ppm.UpdateMovingExpenseHandler") - } - if o.OktaProfileUpdateOktaInfoHandler == nil { - unregistered = append(unregistered, "okta_profile.UpdateOktaInfoHandler") - } - if o.OrdersUpdateOrdersHandler == nil { - unregistered = append(unregistered, "orders.UpdateOrdersHandler") - } - if o.PpmUpdateProGearWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.UpdateProGearWeightTicketHandler") - } - if o.BackupContactsUpdateServiceMemberBackupContactHandler == nil { - unregistered = append(unregistered, "backup_contacts.UpdateServiceMemberBackupContactHandler") - } - if o.PpmUpdateWeightTicketHandler == nil { - unregistered = append(unregistered, "ppm.UpdateWeightTicketHandler") - } - if o.MovesUploadAdditionalDocumentsHandler == nil { - unregistered = append(unregistered, "moves.UploadAdditionalDocumentsHandler") - } - if o.OrdersUploadAmendedOrdersHandler == nil { - unregistered = append(unregistered, "orders.UploadAmendedOrdersHandler") - } - if o.ApplicationParametersValidateHandler == nil { - unregistered = append(unregistered, "application_parameters.ValidateHandler") - } - if o.PostalCodesValidatePostalCodeWithRateDataHandler == nil { - unregistered = append(unregistered, "postal_codes.ValidatePostalCodeWithRateDataHandler") - } - if o.FeatureFlagsVariantFeatureFlagForUserHandler == nil { - unregistered = append(unregistered, "feature_flags.VariantFeatureFlagForUserHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - case "multipart/form-data": - result["multipart/form-data"] = o.MultipartformConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/pdf": - result["application/pdf"] = o.BinProducer - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/approve"] = office.NewApproveMove(o.context, o.OfficeApproveMoveHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/reimbursement/{reimbursementId}/approve"] = office.NewApproveReimbursement(o.context, o.OfficeApproveReimbursementHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/feature-flags/user-boolean/{key}"] = feature_flags.NewBooleanFeatureFlagForUser(o.context, o.FeatureFlagsBooleanFeatureFlagForUserHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/cancel"] = office.NewCancelMove(o.context, o.OfficeCancelMoveHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/documents"] = documents.NewCreateDocument(o.context, o.DocumentsCreateDocumentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/move_documents"] = move_docs.NewCreateGenericMoveDocument(o.context, o.MoveDocsCreateGenericMoveDocumentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto_shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/moving-expenses"] = ppm.NewCreateMovingExpense(o.context, o.PpmCreateMovingExpenseHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/orders"] = orders.NewCreateOrders(o.context, o.OrdersCreateOrdersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/uploads"] = ppm.NewCreatePPMUpload(o.context, o.PpmCreatePPMUploadHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets"] = ppm.NewCreateProGearWeightTicket(o.context, o.PpmCreateProGearWeightTicketHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/service_members"] = service_members.NewCreateServiceMember(o.context, o.ServiceMembersCreateServiceMemberHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/service_members/{serviceMemberId}/backup_contacts"] = backup_contacts.NewCreateServiceMemberBackupContact(o.context, o.BackupContactsCreateServiceMemberBackupContactHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/signed_certifications"] = certification.NewCreateSignedCertification(o.context, o.CertificationCreateSignedCertificationHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/uploads"] = uploads.NewCreateUpload(o.context, o.UploadsCreateUploadHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/weight-ticket"] = ppm.NewCreateWeightTicket(o.context, o.PpmCreateWeightTicketHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/weight_ticket"] = move_docs.NewCreateWeightTicketDocument(o.context, o.MoveDocsCreateWeightTicketDocumentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/move_documents/{moveDocumentId}"] = move_docs.NewDeleteMoveDocument(o.context, o.MoveDocsDeleteMoveDocumentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewDeleteMovingExpense(o.context, o.PpmDeleteMovingExpenseHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewDeleteProGearWeightTicket(o.context, o.PpmDeleteProGearWeightTicketHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/mto-shipments/{mtoShipmentId}"] = mto_shipment.NewDeleteShipment(o.context, o.MtoShipmentDeleteShipmentHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/uploads/{uploadId}"] = uploads.NewDeleteUpload(o.context, o.UploadsDeleteUploadHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/uploads"] = uploads.NewDeleteUploads(o.context, o.UploadsDeleteUploadsHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewDeleteWeightTicket(o.context, o.PpmDeleteWeightTicketHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/allmoves/{serviceMemberId}"] = moves.NewGetAllMoves(o.context, o.MovesGetAllMovesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/addresses/zip-city-lookup/{search}"] = addresses.NewGetLocationByZipCityState(o.context, o.AddressesGetLocationByZipCityStateHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transportation-offices"] = transportation_offices.NewGetTransportationOffices(o.context, o.TransportationOfficesGetTransportationOfficesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/entitlements"] = entitlements.NewIndexEntitlements(o.context, o.EntitlementsIndexEntitlementsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveId}/move_documents"] = move_docs.NewIndexMoveDocuments(o.context, o.MoveDocsIndexMoveDocumentsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service_members/{serviceMemberId}/backup_contacts"] = backup_contacts.NewIndexServiceMemberBackupContacts(o.context, o.BackupContactsIndexServiceMemberBackupContactsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveId}/signed_certifications"] = certification.NewIndexSignedCertification(o.context, o.CertificationIndexSignedCertificationHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/calendar/{countryCode}/is-weekend-holiday/{date}"] = calendar.NewIsDateWeekendHoliday(o.context, o.CalendarIsDateWeekendHolidayHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/users/is_logged_in"] = users.NewIsLoggedInUser(o.context, o.UsersIsLoggedInUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveTaskOrderID}/mto_shipments"] = mto_shipment.NewListMTOShipments(o.context, o.MtoShipmentListMTOShipmentsHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveId}"] = moves.NewPatchMove(o.context, o.MovesPatchMoveHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/service_members/{serviceMemberId}"] = service_members.NewPatchServiceMember(o.context, o.ServiceMembersPatchServiceMemberHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}"] = ppm.NewResubmitPPMShipmentDocumentation(o.context, o.PpmResubmitPPMShipmentDocumentationHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/duty_locations"] = duty_locations.NewSearchDutyLocations(o.context, o.DutyLocationsSearchDutyLocationsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/aoa-packet"] = ppm.NewShowAOAPacket(o.context, o.PpmShowAOAPacketHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/addresses/{addressId}"] = addresses.NewShowAddress(o.context, o.AddressesShowAddressHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/calendar/available_move_dates"] = calendar.NewShowAvailableMoveDates(o.context, o.CalendarShowAvailableMoveDatesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/transportation_offices/{dutyLocationId}/counseling_offices"] = transportation_offices.NewShowCounselingOffices(o.context, o.TransportationOfficesShowCounselingOfficesHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/documents/{documentId}"] = documents.NewShowDocument(o.context, o.DocumentsShowDocumentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/duty_locations/{dutyLocationId}/transportation_office"] = transportation_offices.NewShowDutyLocationTransportationOffice(o.context, o.TransportationOfficesShowDutyLocationTransportationOfficeHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/users/logged_in"] = users.NewShowLoggedInUser(o.context, o.UsersShowLoggedInUserHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveId}"] = moves.NewShowMove(o.context, o.MovesShowMoveHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{moveId}/orders"] = office.NewShowOfficeOrders(o.context, o.OfficeShowOfficeOrdersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/okta-profile"] = okta_profile.NewShowOktaInfo(o.context, o.OktaProfileShowOktaInfoHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/orders/{ordersId}"] = orders.NewShowOrders(o.context, o.OrdersShowOrdersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/payment-packet"] = ppm.NewShowPaymentPacket(o.context, o.PpmShowPaymentPacketHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/queues/{queueType}"] = queues.NewShowQueue(o.context, o.QueuesShowQueueHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service_members/{serviceMemberId}"] = service_members.NewShowServiceMember(o.context, o.ServiceMembersShowServiceMemberHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/backup_contacts/{backupContactId}"] = backup_contacts.NewShowServiceMemberBackupContact(o.context, o.BackupContactsShowServiceMemberBackupContactHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/service_members/{serviceMemberId}/current_orders"] = service_members.NewShowServiceMemberOrders(o.context, o.ServiceMembersShowServiceMemberOrdersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/submit_amended_orders"] = moves.NewSubmitAmendedOrders(o.context, o.MovesSubmitAmendedOrdersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/moves/{moveId}/submit"] = moves.NewSubmitMoveForApproval(o.context, o.MovesSubmitMoveForApprovalHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation"] = ppm.NewSubmitPPMShipmentDocumentation(o.context, o.PpmSubmitPPMShipmentDocumentationHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentId}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/move_documents/{moveDocumentId}"] = move_docs.NewUpdateMoveDocument(o.context, o.MoveDocsUpdateMoveDocumentHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewUpdateMovingExpense(o.context, o.PpmUpdateMovingExpenseHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/okta-profile"] = okta_profile.NewUpdateOktaInfo(o.context, o.OktaProfileUpdateOktaInfoHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/orders/{ordersId}"] = orders.NewUpdateOrders(o.context, o.OrdersUpdateOrdersHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewUpdateProGearWeightTicket(o.context, o.PpmUpdateProGearWeightTicketHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/backup_contacts/{backupContactId}"] = backup_contacts.NewUpdateServiceMemberBackupContact(o.context, o.BackupContactsUpdateServiceMemberBackupContactHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewUpdateWeightTicket(o.context, o.PpmUpdateWeightTicketHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/moves/{moveId}/uploadAdditionalDocuments"] = moves.NewUploadAdditionalDocuments(o.context, o.MovesUploadAdditionalDocumentsHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/orders/{ordersId}/upload_amended_orders"] = orders.NewUploadAmendedOrders(o.context, o.OrdersUploadAmendedOrdersHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/application_parameters"] = application_parameters.NewValidate(o.context, o.ApplicationParametersValidateHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/rate_engine_postal_codes/{postal_code}"] = postal_codes.NewValidatePostalCodeWithRateData(o.context, o.PostalCodesValidatePostalCodeWithRateDataHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/feature-flags/user-variant/{key}"] = feature_flags.NewVariantFeatureFlagForUser(o.context, o.FeatureFlagsVariantFeatureFlagForUserHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move.go b/pkg/gen/internalapi/internaloperations/office/approve_move.go deleted file mode 100644 index eaa496d39ac..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ApproveMoveHandlerFunc turns a function with the right signature into a approve move handler -type ApproveMoveHandlerFunc func(ApproveMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ApproveMoveHandlerFunc) Handle(params ApproveMoveParams) middleware.Responder { - return fn(params) -} - -// ApproveMoveHandler interface for that can handle valid approve move params -type ApproveMoveHandler interface { - Handle(ApproveMoveParams) middleware.Responder -} - -// NewApproveMove creates a new http.Handler for the approve move operation -func NewApproveMove(ctx *middleware.Context, handler ApproveMoveHandler) *ApproveMove { - return &ApproveMove{Context: ctx, Handler: handler} -} - -/* - ApproveMove swagger:route POST /moves/{moveId}/approve office approveMove - -# Approves a move to proceed - -Approves the basic details of a move. The status of the move will be updated to APPROVED -*/ -type ApproveMove struct { - Context *middleware.Context - Handler ApproveMoveHandler -} - -func (o *ApproveMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewApproveMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go b/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go deleted file mode 100644 index f7f342996c8..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewApproveMoveParams creates a new ApproveMoveParams object -// -// There are no default values defined in the spec. -func NewApproveMoveParams() ApproveMoveParams { - - return ApproveMoveParams{} -} - -// ApproveMoveParams contains all the bound params for the approve move operation -// typically these are obtained from a http.Request -// -// swagger:parameters approveMove -type ApproveMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewApproveMoveParams() beforehand. -func (o *ApproveMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *ApproveMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *ApproveMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go b/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go deleted file mode 100644 index 085324662e5..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ApproveMoveOKCode is the HTTP code returned for type ApproveMoveOK -const ApproveMoveOKCode int = 200 - -/* -ApproveMoveOK returns updated (approved) move object - -swagger:response approveMoveOK -*/ -type ApproveMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewApproveMoveOK creates ApproveMoveOK with default headers values -func NewApproveMoveOK() *ApproveMoveOK { - - return &ApproveMoveOK{} -} - -// WithPayload adds the payload to the approve move o k response -func (o *ApproveMoveOK) WithPayload(payload *internalmessages.MovePayload) *ApproveMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve move o k response -func (o *ApproveMoveOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveMoveBadRequestCode is the HTTP code returned for type ApproveMoveBadRequest -const ApproveMoveBadRequestCode int = 400 - -/* -ApproveMoveBadRequest invalid request - -swagger:response approveMoveBadRequest -*/ -type ApproveMoveBadRequest struct { -} - -// NewApproveMoveBadRequest creates ApproveMoveBadRequest with default headers values -func NewApproveMoveBadRequest() *ApproveMoveBadRequest { - - return &ApproveMoveBadRequest{} -} - -// WriteResponse to the client -func (o *ApproveMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ApproveMoveUnauthorizedCode is the HTTP code returned for type ApproveMoveUnauthorized -const ApproveMoveUnauthorizedCode int = 401 - -/* -ApproveMoveUnauthorized must be authenticated to use this endpoint - -swagger:response approveMoveUnauthorized -*/ -type ApproveMoveUnauthorized struct { -} - -// NewApproveMoveUnauthorized creates ApproveMoveUnauthorized with default headers values -func NewApproveMoveUnauthorized() *ApproveMoveUnauthorized { - - return &ApproveMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *ApproveMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ApproveMoveForbiddenCode is the HTTP code returned for type ApproveMoveForbidden -const ApproveMoveForbiddenCode int = 403 - -/* -ApproveMoveForbidden not authorized to approve this move - -swagger:response approveMoveForbidden -*/ -type ApproveMoveForbidden struct { -} - -// NewApproveMoveForbidden creates ApproveMoveForbidden with default headers values -func NewApproveMoveForbidden() *ApproveMoveForbidden { - - return &ApproveMoveForbidden{} -} - -// WriteResponse to the client -func (o *ApproveMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ApproveMoveConflictCode is the HTTP code returned for type ApproveMoveConflict -const ApproveMoveConflictCode int = 409 - -/* -ApproveMoveConflict the move is not in a state to be approved - -swagger:response approveMoveConflict -*/ -type ApproveMoveConflict struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewApproveMoveConflict creates ApproveMoveConflict with default headers values -func NewApproveMoveConflict() *ApproveMoveConflict { - - return &ApproveMoveConflict{} -} - -// WithPayload adds the payload to the approve move conflict response -func (o *ApproveMoveConflict) WithPayload(payload *internalmessages.MovePayload) *ApproveMoveConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve move conflict response -func (o *ApproveMoveConflict) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveMoveConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveMoveInternalServerErrorCode is the HTTP code returned for type ApproveMoveInternalServerError -const ApproveMoveInternalServerErrorCode int = 500 - -/* -ApproveMoveInternalServerError server error - -swagger:response approveMoveInternalServerError -*/ -type ApproveMoveInternalServerError struct { -} - -// NewApproveMoveInternalServerError creates ApproveMoveInternalServerError with default headers values -func NewApproveMoveInternalServerError() *ApproveMoveInternalServerError { - - return &ApproveMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *ApproveMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go deleted file mode 100644 index eefffa6147b..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ApproveMoveURL generates an URL for the approve move operation -type ApproveMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveMoveURL) WithBasePath(bp string) *ApproveMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ApproveMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/approve" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on ApproveMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ApproveMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ApproveMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ApproveMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ApproveMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ApproveMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ApproveMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go deleted file mode 100644 index db2dafc26e4..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ApproveReimbursementHandlerFunc turns a function with the right signature into a approve reimbursement handler -type ApproveReimbursementHandlerFunc func(ApproveReimbursementParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ApproveReimbursementHandlerFunc) Handle(params ApproveReimbursementParams) middleware.Responder { - return fn(params) -} - -// ApproveReimbursementHandler interface for that can handle valid approve reimbursement params -type ApproveReimbursementHandler interface { - Handle(ApproveReimbursementParams) middleware.Responder -} - -// NewApproveReimbursement creates a new http.Handler for the approve reimbursement operation -func NewApproveReimbursement(ctx *middleware.Context, handler ApproveReimbursementHandler) *ApproveReimbursement { - return &ApproveReimbursement{Context: ctx, Handler: handler} -} - -/* - ApproveReimbursement swagger:route POST /reimbursement/{reimbursementId}/approve office approveReimbursement - -# Approves the reimbursement - -Sets the status of the reimbursement to APPROVED. -*/ -type ApproveReimbursement struct { - Context *middleware.Context - Handler ApproveReimbursementHandler -} - -func (o *ApproveReimbursement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewApproveReimbursementParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go deleted file mode 100644 index fc11f2ca9a7..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewApproveReimbursementParams creates a new ApproveReimbursementParams object -// -// There are no default values defined in the spec. -func NewApproveReimbursementParams() ApproveReimbursementParams { - - return ApproveReimbursementParams{} -} - -// ApproveReimbursementParams contains all the bound params for the approve reimbursement operation -// typically these are obtained from a http.Request -// -// swagger:parameters approveReimbursement -type ApproveReimbursementParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the reimbursement being approved - Required: true - In: path - */ - ReimbursementID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewApproveReimbursementParams() beforehand. -func (o *ApproveReimbursementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rReimbursementID, rhkReimbursementID, _ := route.Params.GetOK("reimbursementId") - if err := o.bindReimbursementID(rReimbursementID, rhkReimbursementID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindReimbursementID binds and validates parameter ReimbursementID from path. -func (o *ApproveReimbursementParams) bindReimbursementID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reimbursementId", "path", "strfmt.UUID", raw) - } - o.ReimbursementID = *(value.(*strfmt.UUID)) - - if err := o.validateReimbursementID(formats); err != nil { - return err - } - - return nil -} - -// validateReimbursementID carries on validations for parameter ReimbursementID -func (o *ApproveReimbursementParams) validateReimbursementID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reimbursementId", "path", "uuid", o.ReimbursementID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go deleted file mode 100644 index 0a53b994f0a..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ApproveReimbursementOKCode is the HTTP code returned for type ApproveReimbursementOK -const ApproveReimbursementOKCode int = 200 - -/* -ApproveReimbursementOK updated instance of reimbursement - -swagger:response approveReimbursementOK -*/ -type ApproveReimbursementOK struct { - - /* - In: Body - */ - Payload *internalmessages.Reimbursement `json:"body,omitempty"` -} - -// NewApproveReimbursementOK creates ApproveReimbursementOK with default headers values -func NewApproveReimbursementOK() *ApproveReimbursementOK { - - return &ApproveReimbursementOK{} -} - -// WithPayload adds the payload to the approve reimbursement o k response -func (o *ApproveReimbursementOK) WithPayload(payload *internalmessages.Reimbursement) *ApproveReimbursementOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the approve reimbursement o k response -func (o *ApproveReimbursementOK) SetPayload(payload *internalmessages.Reimbursement) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ApproveReimbursementOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ApproveReimbursementBadRequestCode is the HTTP code returned for type ApproveReimbursementBadRequest -const ApproveReimbursementBadRequestCode int = 400 - -/* -ApproveReimbursementBadRequest invalid request - -swagger:response approveReimbursementBadRequest -*/ -type ApproveReimbursementBadRequest struct { -} - -// NewApproveReimbursementBadRequest creates ApproveReimbursementBadRequest with default headers values -func NewApproveReimbursementBadRequest() *ApproveReimbursementBadRequest { - - return &ApproveReimbursementBadRequest{} -} - -// WriteResponse to the client -func (o *ApproveReimbursementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ApproveReimbursementUnauthorizedCode is the HTTP code returned for type ApproveReimbursementUnauthorized -const ApproveReimbursementUnauthorizedCode int = 401 - -/* -ApproveReimbursementUnauthorized request requires user authentication - -swagger:response approveReimbursementUnauthorized -*/ -type ApproveReimbursementUnauthorized struct { -} - -// NewApproveReimbursementUnauthorized creates ApproveReimbursementUnauthorized with default headers values -func NewApproveReimbursementUnauthorized() *ApproveReimbursementUnauthorized { - - return &ApproveReimbursementUnauthorized{} -} - -// WriteResponse to the client -func (o *ApproveReimbursementUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ApproveReimbursementForbiddenCode is the HTTP code returned for type ApproveReimbursementForbidden -const ApproveReimbursementForbiddenCode int = 403 - -/* -ApproveReimbursementForbidden user is not authorized - -swagger:response approveReimbursementForbidden -*/ -type ApproveReimbursementForbidden struct { -} - -// NewApproveReimbursementForbidden creates ApproveReimbursementForbidden with default headers values -func NewApproveReimbursementForbidden() *ApproveReimbursementForbidden { - - return &ApproveReimbursementForbidden{} -} - -// WriteResponse to the client -func (o *ApproveReimbursementForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ApproveReimbursementInternalServerErrorCode is the HTTP code returned for type ApproveReimbursementInternalServerError -const ApproveReimbursementInternalServerErrorCode int = 500 - -/* -ApproveReimbursementInternalServerError internal server error - -swagger:response approveReimbursementInternalServerError -*/ -type ApproveReimbursementInternalServerError struct { -} - -// NewApproveReimbursementInternalServerError creates ApproveReimbursementInternalServerError with default headers values -func NewApproveReimbursementInternalServerError() *ApproveReimbursementInternalServerError { - - return &ApproveReimbursementInternalServerError{} -} - -// WriteResponse to the client -func (o *ApproveReimbursementInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go deleted file mode 100644 index 98bea13d9cc..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ApproveReimbursementURL generates an URL for the approve reimbursement operation -type ApproveReimbursementURL struct { - ReimbursementID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveReimbursementURL) WithBasePath(bp string) *ApproveReimbursementURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ApproveReimbursementURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ApproveReimbursementURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/reimbursement/{reimbursementId}/approve" - - reimbursementID := o.ReimbursementID.String() - if reimbursementID != "" { - _path = strings.Replace(_path, "{reimbursementId}", reimbursementID, -1) - } else { - return nil, errors.New("reimbursementId is required on ApproveReimbursementURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ApproveReimbursementURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ApproveReimbursementURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ApproveReimbursementURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ApproveReimbursementURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ApproveReimbursementURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ApproveReimbursementURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move.go b/pkg/gen/internalapi/internaloperations/office/cancel_move.go deleted file mode 100644 index 003825037f1..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/cancel_move.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CancelMoveHandlerFunc turns a function with the right signature into a cancel move handler -type CancelMoveHandlerFunc func(CancelMoveParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CancelMoveHandlerFunc) Handle(params CancelMoveParams) middleware.Responder { - return fn(params) -} - -// CancelMoveHandler interface for that can handle valid cancel move params -type CancelMoveHandler interface { - Handle(CancelMoveParams) middleware.Responder -} - -// NewCancelMove creates a new http.Handler for the cancel move operation -func NewCancelMove(ctx *middleware.Context, handler CancelMoveHandler) *CancelMove { - return &CancelMove{Context: ctx, Handler: handler} -} - -/* - CancelMove swagger:route POST /moves/{moveId}/cancel office cancelMove - -# Cancels a move - -Cancels the basic details of a move. The status of the move will be updated to CANCELED -*/ -type CancelMove struct { - Context *middleware.Context - Handler CancelMoveHandler -} - -func (o *CancelMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCancelMoveParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go deleted file mode 100644 index 614af937735..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewCancelMoveParams creates a new CancelMoveParams object -// -// There are no default values defined in the spec. -func NewCancelMoveParams() CancelMoveParams { - - return CancelMoveParams{} -} - -// CancelMoveParams contains all the bound params for the cancel move operation -// typically these are obtained from a http.Request -// -// swagger:parameters cancelMove -type CancelMoveParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCancelMoveParams() beforehand. -func (o *CancelMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *CancelMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *CancelMoveParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go deleted file mode 100644 index 5e5d9ac11c4..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CancelMoveOKCode is the HTTP code returned for type CancelMoveOK -const CancelMoveOKCode int = 200 - -/* -CancelMoveOK returns updated (canceled) move object - -swagger:response cancelMoveOK -*/ -type CancelMoveOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewCancelMoveOK creates CancelMoveOK with default headers values -func NewCancelMoveOK() *CancelMoveOK { - - return &CancelMoveOK{} -} - -// WithPayload adds the payload to the cancel move o k response -func (o *CancelMoveOK) WithPayload(payload *internalmessages.MovePayload) *CancelMoveOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the cancel move o k response -func (o *CancelMoveOK) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CancelMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CancelMoveBadRequestCode is the HTTP code returned for type CancelMoveBadRequest -const CancelMoveBadRequestCode int = 400 - -/* -CancelMoveBadRequest invalid request - -swagger:response cancelMoveBadRequest -*/ -type CancelMoveBadRequest struct { -} - -// NewCancelMoveBadRequest creates CancelMoveBadRequest with default headers values -func NewCancelMoveBadRequest() *CancelMoveBadRequest { - - return &CancelMoveBadRequest{} -} - -// WriteResponse to the client -func (o *CancelMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CancelMoveUnauthorizedCode is the HTTP code returned for type CancelMoveUnauthorized -const CancelMoveUnauthorizedCode int = 401 - -/* -CancelMoveUnauthorized must be authenticated to use this endpoint - -swagger:response cancelMoveUnauthorized -*/ -type CancelMoveUnauthorized struct { -} - -// NewCancelMoveUnauthorized creates CancelMoveUnauthorized with default headers values -func NewCancelMoveUnauthorized() *CancelMoveUnauthorized { - - return &CancelMoveUnauthorized{} -} - -// WriteResponse to the client -func (o *CancelMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CancelMoveForbiddenCode is the HTTP code returned for type CancelMoveForbidden -const CancelMoveForbiddenCode int = 403 - -/* -CancelMoveForbidden not authorized to cancel this move - -swagger:response cancelMoveForbidden -*/ -type CancelMoveForbidden struct { -} - -// NewCancelMoveForbidden creates CancelMoveForbidden with default headers values -func NewCancelMoveForbidden() *CancelMoveForbidden { - - return &CancelMoveForbidden{} -} - -// WriteResponse to the client -func (o *CancelMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CancelMoveConflictCode is the HTTP code returned for type CancelMoveConflict -const CancelMoveConflictCode int = 409 - -/* -CancelMoveConflict the move is not in a state to be canceled - -swagger:response cancelMoveConflict -*/ -type CancelMoveConflict struct { - - /* - In: Body - */ - Payload *internalmessages.MovePayload `json:"body,omitempty"` -} - -// NewCancelMoveConflict creates CancelMoveConflict with default headers values -func NewCancelMoveConflict() *CancelMoveConflict { - - return &CancelMoveConflict{} -} - -// WithPayload adds the payload to the cancel move conflict response -func (o *CancelMoveConflict) WithPayload(payload *internalmessages.MovePayload) *CancelMoveConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the cancel move conflict response -func (o *CancelMoveConflict) SetPayload(payload *internalmessages.MovePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CancelMoveConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CancelMoveInternalServerErrorCode is the HTTP code returned for type CancelMoveInternalServerError -const CancelMoveInternalServerErrorCode int = 500 - -/* -CancelMoveInternalServerError server error - -swagger:response cancelMoveInternalServerError -*/ -type CancelMoveInternalServerError struct { -} - -// NewCancelMoveInternalServerError creates CancelMoveInternalServerError with default headers values -func NewCancelMoveInternalServerError() *CancelMoveInternalServerError { - - return &CancelMoveInternalServerError{} -} - -// WriteResponse to the client -func (o *CancelMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go deleted file mode 100644 index 2c2faf91575..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CancelMoveURL generates an URL for the cancel move operation -type CancelMoveURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CancelMoveURL) WithBasePath(bp string) *CancelMoveURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CancelMoveURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CancelMoveURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/cancel" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on CancelMoveURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CancelMoveURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CancelMoveURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CancelMoveURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CancelMoveURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CancelMoveURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CancelMoveURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders.go deleted file mode 100644 index 2c98b9d710c..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/show_office_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowOfficeOrdersHandlerFunc turns a function with the right signature into a show office orders handler -type ShowOfficeOrdersHandlerFunc func(ShowOfficeOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowOfficeOrdersHandlerFunc) Handle(params ShowOfficeOrdersParams) middleware.Responder { - return fn(params) -} - -// ShowOfficeOrdersHandler interface for that can handle valid show office orders params -type ShowOfficeOrdersHandler interface { - Handle(ShowOfficeOrdersParams) middleware.Responder -} - -// NewShowOfficeOrders creates a new http.Handler for the show office orders operation -func NewShowOfficeOrders(ctx *middleware.Context, handler ShowOfficeOrdersHandler) *ShowOfficeOrders { - return &ShowOfficeOrders{Context: ctx, Handler: handler} -} - -/* - ShowOfficeOrders swagger:route GET /moves/{moveId}/orders office showOfficeOrders - -# Returns orders information for a move for office use - -Returns orders information for a move for office use -*/ -type ShowOfficeOrders struct { - Context *middleware.Context - Handler ShowOfficeOrdersHandler -} - -func (o *ShowOfficeOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowOfficeOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go deleted file mode 100644 index 8b315ee768f..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowOfficeOrdersParams creates a new ShowOfficeOrdersParams object -// -// There are no default values defined in the spec. -func NewShowOfficeOrdersParams() ShowOfficeOrdersParams { - - return ShowOfficeOrdersParams{} -} - -// ShowOfficeOrdersParams contains all the bound params for the show office orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters showOfficeOrders -type ShowOfficeOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the move - Required: true - In: path - */ - MoveID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowOfficeOrdersParams() beforehand. -func (o *ShowOfficeOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *ShowOfficeOrdersParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) - } - o.MoveID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *ShowOfficeOrdersParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go deleted file mode 100644 index f76b5be2ef7..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowOfficeOrdersOKCode is the HTTP code returned for type ShowOfficeOrdersOK -const ShowOfficeOrdersOKCode int = 200 - -/* -ShowOfficeOrdersOK the orders information for a move for office use - -swagger:response showOfficeOrdersOK -*/ -type ShowOfficeOrdersOK struct { - - /* - In: Body - */ - Payload *internalmessages.Orders `json:"body,omitempty"` -} - -// NewShowOfficeOrdersOK creates ShowOfficeOrdersOK with default headers values -func NewShowOfficeOrdersOK() *ShowOfficeOrdersOK { - - return &ShowOfficeOrdersOK{} -} - -// WithPayload adds the payload to the show office orders o k response -func (o *ShowOfficeOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowOfficeOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show office orders o k response -func (o *ShowOfficeOrdersOK) SetPayload(payload *internalmessages.Orders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowOfficeOrdersBadRequestCode is the HTTP code returned for type ShowOfficeOrdersBadRequest -const ShowOfficeOrdersBadRequestCode int = 400 - -/* -ShowOfficeOrdersBadRequest invalid request - -swagger:response showOfficeOrdersBadRequest -*/ -type ShowOfficeOrdersBadRequest struct { -} - -// NewShowOfficeOrdersBadRequest creates ShowOfficeOrdersBadRequest with default headers values -func NewShowOfficeOrdersBadRequest() *ShowOfficeOrdersBadRequest { - - return &ShowOfficeOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowOfficeOrdersUnauthorizedCode is the HTTP code returned for type ShowOfficeOrdersUnauthorized -const ShowOfficeOrdersUnauthorizedCode int = 401 - -/* -ShowOfficeOrdersUnauthorized request requires user authentication - -swagger:response showOfficeOrdersUnauthorized -*/ -type ShowOfficeOrdersUnauthorized struct { -} - -// NewShowOfficeOrdersUnauthorized creates ShowOfficeOrdersUnauthorized with default headers values -func NewShowOfficeOrdersUnauthorized() *ShowOfficeOrdersUnauthorized { - - return &ShowOfficeOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowOfficeOrdersForbiddenCode is the HTTP code returned for type ShowOfficeOrdersForbidden -const ShowOfficeOrdersForbiddenCode int = 403 - -/* -ShowOfficeOrdersForbidden user is not authorized - -swagger:response showOfficeOrdersForbidden -*/ -type ShowOfficeOrdersForbidden struct { -} - -// NewShowOfficeOrdersForbidden creates ShowOfficeOrdersForbidden with default headers values -func NewShowOfficeOrdersForbidden() *ShowOfficeOrdersForbidden { - - return &ShowOfficeOrdersForbidden{} -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowOfficeOrdersNotFoundCode is the HTTP code returned for type ShowOfficeOrdersNotFound -const ShowOfficeOrdersNotFoundCode int = 404 - -/* -ShowOfficeOrdersNotFound move not found - -swagger:response showOfficeOrdersNotFound -*/ -type ShowOfficeOrdersNotFound struct { -} - -// NewShowOfficeOrdersNotFound creates ShowOfficeOrdersNotFound with default headers values -func NewShowOfficeOrdersNotFound() *ShowOfficeOrdersNotFound { - - return &ShowOfficeOrdersNotFound{} -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowOfficeOrdersInternalServerErrorCode is the HTTP code returned for type ShowOfficeOrdersInternalServerError -const ShowOfficeOrdersInternalServerErrorCode int = 500 - -/* -ShowOfficeOrdersInternalServerError internal server error - -swagger:response showOfficeOrdersInternalServerError -*/ -type ShowOfficeOrdersInternalServerError struct { -} - -// NewShowOfficeOrdersInternalServerError creates ShowOfficeOrdersInternalServerError with default headers values -func NewShowOfficeOrdersInternalServerError() *ShowOfficeOrdersInternalServerError { - - return &ShowOfficeOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowOfficeOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go deleted file mode 100644 index 4067e731324..00000000000 --- a/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package office - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowOfficeOrdersURL generates an URL for the show office orders operation -type ShowOfficeOrdersURL struct { - MoveID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOfficeOrdersURL) WithBasePath(bp string) *ShowOfficeOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOfficeOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowOfficeOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{moveId}/orders" - - moveID := o.MoveID.String() - if moveID != "" { - _path = strings.Replace(_path, "{moveId}", moveID, -1) - } else { - return nil, errors.New("moveId is required on ShowOfficeOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowOfficeOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowOfficeOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowOfficeOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowOfficeOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowOfficeOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowOfficeOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go deleted file mode 100644 index 37e9536ba1f..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowOktaInfoHandlerFunc turns a function with the right signature into a show okta info handler -type ShowOktaInfoHandlerFunc func(ShowOktaInfoParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowOktaInfoHandlerFunc) Handle(params ShowOktaInfoParams) middleware.Responder { - return fn(params) -} - -// ShowOktaInfoHandler interface for that can handle valid show okta info params -type ShowOktaInfoHandler interface { - Handle(ShowOktaInfoParams) middleware.Responder -} - -// NewShowOktaInfo creates a new http.Handler for the show okta info operation -func NewShowOktaInfo(ctx *middleware.Context, handler ShowOktaInfoHandler) *ShowOktaInfo { - return &ShowOktaInfo{Context: ctx, Handler: handler} -} - -/* - ShowOktaInfo swagger:route GET /okta-profile okta_profile showOktaInfo - -# Returns Okta profile values from Okta's Users API - -Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update. -*/ -type ShowOktaInfo struct { - Context *middleware.Context - Handler ShowOktaInfoHandler -} - -func (o *ShowOktaInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowOktaInfoParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go deleted file mode 100644 index 4a2cfcfd092..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewShowOktaInfoParams creates a new ShowOktaInfoParams object -// -// There are no default values defined in the spec. -func NewShowOktaInfoParams() ShowOktaInfoParams { - - return ShowOktaInfoParams{} -} - -// ShowOktaInfoParams contains all the bound params for the show okta info operation -// typically these are obtained from a http.Request -// -// swagger:parameters showOktaInfo -type ShowOktaInfoParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowOktaInfoParams() beforehand. -func (o *ShowOktaInfoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go deleted file mode 100644 index 107788c2f9a..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowOktaInfoOKCode is the HTTP code returned for type ShowOktaInfoOK -const ShowOktaInfoOKCode int = 200 - -/* -ShowOktaInfoOK okta profile for user - -swagger:response showOktaInfoOK -*/ -type ShowOktaInfoOK struct { - - /* - In: Body - */ - Payload *internalmessages.OktaUserProfileData `json:"body,omitempty"` -} - -// NewShowOktaInfoOK creates ShowOktaInfoOK with default headers values -func NewShowOktaInfoOK() *ShowOktaInfoOK { - - return &ShowOktaInfoOK{} -} - -// WithPayload adds the payload to the show okta info o k response -func (o *ShowOktaInfoOK) WithPayload(payload *internalmessages.OktaUserProfileData) *ShowOktaInfoOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show okta info o k response -func (o *ShowOktaInfoOK) SetPayload(payload *internalmessages.OktaUserProfileData) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowOktaInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowOktaInfoBadRequestCode is the HTTP code returned for type ShowOktaInfoBadRequest -const ShowOktaInfoBadRequestCode int = 400 - -/* -ShowOktaInfoBadRequest invalid request - -swagger:response showOktaInfoBadRequest -*/ -type ShowOktaInfoBadRequest struct { -} - -// NewShowOktaInfoBadRequest creates ShowOktaInfoBadRequest with default headers values -func NewShowOktaInfoBadRequest() *ShowOktaInfoBadRequest { - - return &ShowOktaInfoBadRequest{} -} - -// WriteResponse to the client -func (o *ShowOktaInfoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowOktaInfoUnauthorizedCode is the HTTP code returned for type ShowOktaInfoUnauthorized -const ShowOktaInfoUnauthorizedCode int = 401 - -/* -ShowOktaInfoUnauthorized request requires user authentication - -swagger:response showOktaInfoUnauthorized -*/ -type ShowOktaInfoUnauthorized struct { -} - -// NewShowOktaInfoUnauthorized creates ShowOktaInfoUnauthorized with default headers values -func NewShowOktaInfoUnauthorized() *ShowOktaInfoUnauthorized { - - return &ShowOktaInfoUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowOktaInfoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowOktaInfoForbiddenCode is the HTTP code returned for type ShowOktaInfoForbidden -const ShowOktaInfoForbiddenCode int = 403 - -/* -ShowOktaInfoForbidden user is not authorized - -swagger:response showOktaInfoForbidden -*/ -type ShowOktaInfoForbidden struct { -} - -// NewShowOktaInfoForbidden creates ShowOktaInfoForbidden with default headers values -func NewShowOktaInfoForbidden() *ShowOktaInfoForbidden { - - return &ShowOktaInfoForbidden{} -} - -// WriteResponse to the client -func (o *ShowOktaInfoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowOktaInfoNotFoundCode is the HTTP code returned for type ShowOktaInfoNotFound -const ShowOktaInfoNotFoundCode int = 404 - -/* -ShowOktaInfoNotFound service member not found - -swagger:response showOktaInfoNotFound -*/ -type ShowOktaInfoNotFound struct { -} - -// NewShowOktaInfoNotFound creates ShowOktaInfoNotFound with default headers values -func NewShowOktaInfoNotFound() *ShowOktaInfoNotFound { - - return &ShowOktaInfoNotFound{} -} - -// WriteResponse to the client -func (o *ShowOktaInfoNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowOktaInfoInternalServerErrorCode is the HTTP code returned for type ShowOktaInfoInternalServerError -const ShowOktaInfoInternalServerErrorCode int = 500 - -/* -ShowOktaInfoInternalServerError internal server error - -swagger:response showOktaInfoInternalServerError -*/ -type ShowOktaInfoInternalServerError struct { -} - -// NewShowOktaInfoInternalServerError creates ShowOktaInfoInternalServerError with default headers values -func NewShowOktaInfoInternalServerError() *ShowOktaInfoInternalServerError { - - return &ShowOktaInfoInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowOktaInfoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go deleted file mode 100644 index d603ba975e4..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ShowOktaInfoURL generates an URL for the show okta info operation -type ShowOktaInfoURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOktaInfoURL) WithBasePath(bp string) *ShowOktaInfoURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOktaInfoURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowOktaInfoURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/okta-profile" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowOktaInfoURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowOktaInfoURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowOktaInfoURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowOktaInfoURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowOktaInfoURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowOktaInfoURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go deleted file mode 100644 index 69a96f56f24..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateOktaInfoHandlerFunc turns a function with the right signature into a update okta info handler -type UpdateOktaInfoHandlerFunc func(UpdateOktaInfoParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateOktaInfoHandlerFunc) Handle(params UpdateOktaInfoParams) middleware.Responder { - return fn(params) -} - -// UpdateOktaInfoHandler interface for that can handle valid update okta info params -type UpdateOktaInfoHandler interface { - Handle(UpdateOktaInfoParams) middleware.Responder -} - -// NewUpdateOktaInfo creates a new http.Handler for the update okta info operation -func NewUpdateOktaInfo(ctx *middleware.Context, handler UpdateOktaInfoHandler) *UpdateOktaInfo { - return &UpdateOktaInfo{Context: ctx, Handler: handler} -} - -/* - UpdateOktaInfo swagger:route POST /okta-profile okta_profile updateOktaInfo - -Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values. - -Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values. -*/ -type UpdateOktaInfo struct { - Context *middleware.Context - Handler UpdateOktaInfoHandler -} - -func (o *UpdateOktaInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateOktaInfoParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go deleted file mode 100644 index ab513fa53a5..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateOktaInfoParams creates a new UpdateOktaInfoParams object -// -// There are no default values defined in the spec. -func NewUpdateOktaInfoParams() UpdateOktaInfoParams { - - return UpdateOktaInfoParams{} -} - -// UpdateOktaInfoParams contains all the bound params for the update okta info operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateOktaInfo -type UpdateOktaInfoParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - UpdateOktaUserProfileData *internalmessages.UpdateOktaUserProfileData -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateOktaInfoParams() beforehand. -func (o *UpdateOktaInfoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateOktaUserProfileData - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateOktaUserProfileData", "body", "")) - } else { - res = append(res, errors.NewParseError("updateOktaUserProfileData", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateOktaUserProfileData = &body - } - } - } else { - res = append(res, errors.Required("updateOktaUserProfileData", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go deleted file mode 100644 index 717ea5a09eb..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateOktaInfoOKCode is the HTTP code returned for type UpdateOktaInfoOK -const UpdateOktaInfoOKCode int = 200 - -/* -UpdateOktaInfoOK okta profile for user - -swagger:response updateOktaInfoOK -*/ -type UpdateOktaInfoOK struct { - - /* - In: Body - */ - Payload *internalmessages.OktaUserProfileData `json:"body,omitempty"` -} - -// NewUpdateOktaInfoOK creates UpdateOktaInfoOK with default headers values -func NewUpdateOktaInfoOK() *UpdateOktaInfoOK { - - return &UpdateOktaInfoOK{} -} - -// WithPayload adds the payload to the update okta info o k response -func (o *UpdateOktaInfoOK) WithPayload(payload *internalmessages.OktaUserProfileData) *UpdateOktaInfoOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update okta info o k response -func (o *UpdateOktaInfoOK) SetPayload(payload *internalmessages.OktaUserProfileData) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOktaInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOktaInfoBadRequestCode is the HTTP code returned for type UpdateOktaInfoBadRequest -const UpdateOktaInfoBadRequestCode int = 400 - -/* -UpdateOktaInfoBadRequest invalid request - -swagger:response updateOktaInfoBadRequest -*/ -type UpdateOktaInfoBadRequest struct { -} - -// NewUpdateOktaInfoBadRequest creates UpdateOktaInfoBadRequest with default headers values -func NewUpdateOktaInfoBadRequest() *UpdateOktaInfoBadRequest { - - return &UpdateOktaInfoBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateOktaInfoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateOktaInfoUnauthorizedCode is the HTTP code returned for type UpdateOktaInfoUnauthorized -const UpdateOktaInfoUnauthorizedCode int = 401 - -/* -UpdateOktaInfoUnauthorized request requires user authentication - -swagger:response updateOktaInfoUnauthorized -*/ -type UpdateOktaInfoUnauthorized struct { -} - -// NewUpdateOktaInfoUnauthorized creates UpdateOktaInfoUnauthorized with default headers values -func NewUpdateOktaInfoUnauthorized() *UpdateOktaInfoUnauthorized { - - return &UpdateOktaInfoUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateOktaInfoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateOktaInfoForbiddenCode is the HTTP code returned for type UpdateOktaInfoForbidden -const UpdateOktaInfoForbiddenCode int = 403 - -/* -UpdateOktaInfoForbidden user is not authorized - -swagger:response updateOktaInfoForbidden -*/ -type UpdateOktaInfoForbidden struct { -} - -// NewUpdateOktaInfoForbidden creates UpdateOktaInfoForbidden with default headers values -func NewUpdateOktaInfoForbidden() *UpdateOktaInfoForbidden { - - return &UpdateOktaInfoForbidden{} -} - -// WriteResponse to the client -func (o *UpdateOktaInfoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateOktaInfoUnprocessableEntityCode is the HTTP code returned for type UpdateOktaInfoUnprocessableEntity -const UpdateOktaInfoUnprocessableEntityCode int = 422 - -/* -UpdateOktaInfoUnprocessableEntity validation error - -swagger:response updateOktaInfoUnprocessableEntity -*/ -type UpdateOktaInfoUnprocessableEntity struct { - - /* - In: Body - */ - Payload interface{} `json:"body,omitempty"` -} - -// NewUpdateOktaInfoUnprocessableEntity creates UpdateOktaInfoUnprocessableEntity with default headers values -func NewUpdateOktaInfoUnprocessableEntity() *UpdateOktaInfoUnprocessableEntity { - - return &UpdateOktaInfoUnprocessableEntity{} -} - -// WithPayload adds the payload to the update okta info unprocessable entity response -func (o *UpdateOktaInfoUnprocessableEntity) WithPayload(payload interface{}) *UpdateOktaInfoUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update okta info unprocessable entity response -func (o *UpdateOktaInfoUnprocessableEntity) SetPayload(payload interface{}) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOktaInfoUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// UpdateOktaInfoInternalServerErrorCode is the HTTP code returned for type UpdateOktaInfoInternalServerError -const UpdateOktaInfoInternalServerErrorCode int = 500 - -/* -UpdateOktaInfoInternalServerError internal server error - -swagger:response updateOktaInfoInternalServerError -*/ -type UpdateOktaInfoInternalServerError struct { -} - -// NewUpdateOktaInfoInternalServerError creates UpdateOktaInfoInternalServerError with default headers values -func NewUpdateOktaInfoInternalServerError() *UpdateOktaInfoInternalServerError { - - return &UpdateOktaInfoInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateOktaInfoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go deleted file mode 100644 index ad661f25a4e..00000000000 --- a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package okta_profile - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// UpdateOktaInfoURL generates an URL for the update okta info operation -type UpdateOktaInfoURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOktaInfoURL) WithBasePath(bp string) *UpdateOktaInfoURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOktaInfoURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateOktaInfoURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/okta-profile" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateOktaInfoURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateOktaInfoURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateOktaInfoURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateOktaInfoURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateOktaInfoURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateOktaInfoURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders.go b/pkg/gen/internalapi/internaloperations/orders/create_orders.go deleted file mode 100644 index 49509ae1973..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/create_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateOrdersHandlerFunc turns a function with the right signature into a create orders handler -type CreateOrdersHandlerFunc func(CreateOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateOrdersHandlerFunc) Handle(params CreateOrdersParams) middleware.Responder { - return fn(params) -} - -// CreateOrdersHandler interface for that can handle valid create orders params -type CreateOrdersHandler interface { - Handle(CreateOrdersParams) middleware.Responder -} - -// NewCreateOrders creates a new http.Handler for the create orders operation -func NewCreateOrders(ctx *middleware.Context, handler CreateOrdersHandler) *CreateOrders { - return &CreateOrders{Context: ctx, Handler: handler} -} - -/* - CreateOrders swagger:route POST /orders orders createOrders - -# Creates an orders model for a logged-in user - -Creates an instance of orders tied to a service member -*/ -type CreateOrders struct { - Context *middleware.Context - Handler CreateOrdersHandler -} - -func (o *CreateOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go deleted file mode 100644 index f910ce190ef..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateOrdersParams creates a new CreateOrdersParams object -// -// There are no default values defined in the spec. -func NewCreateOrdersParams() CreateOrdersParams { - - return CreateOrdersParams{} -} - -// CreateOrdersParams contains all the bound params for the create orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters createOrders -type CreateOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateOrders *internalmessages.CreateUpdateOrders -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateOrdersParams() beforehand. -func (o *CreateOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateUpdateOrders - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createOrders", "body", "")) - } else { - res = append(res, errors.NewParseError("createOrders", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateOrders = &body - } - } - } else { - res = append(res, errors.Required("createOrders", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go deleted file mode 100644 index 5ef4c198e25..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateOrdersCreatedCode is the HTTP code returned for type CreateOrdersCreated -const CreateOrdersCreatedCode int = 201 - -/* -CreateOrdersCreated created instance of orders - -swagger:response createOrdersCreated -*/ -type CreateOrdersCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Orders `json:"body,omitempty"` -} - -// NewCreateOrdersCreated creates CreateOrdersCreated with default headers values -func NewCreateOrdersCreated() *CreateOrdersCreated { - - return &CreateOrdersCreated{} -} - -// WithPayload adds the payload to the create orders created response -func (o *CreateOrdersCreated) WithPayload(payload *internalmessages.Orders) *CreateOrdersCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create orders created response -func (o *CreateOrdersCreated) SetPayload(payload *internalmessages.Orders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateOrdersBadRequestCode is the HTTP code returned for type CreateOrdersBadRequest -const CreateOrdersBadRequestCode int = 400 - -/* -CreateOrdersBadRequest invalid request - -swagger:response createOrdersBadRequest -*/ -type CreateOrdersBadRequest struct { -} - -// NewCreateOrdersBadRequest creates CreateOrdersBadRequest with default headers values -func NewCreateOrdersBadRequest() *CreateOrdersBadRequest { - - return &CreateOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *CreateOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateOrdersUnauthorizedCode is the HTTP code returned for type CreateOrdersUnauthorized -const CreateOrdersUnauthorizedCode int = 401 - -/* -CreateOrdersUnauthorized request requires user authentication - -swagger:response createOrdersUnauthorized -*/ -type CreateOrdersUnauthorized struct { -} - -// NewCreateOrdersUnauthorized creates CreateOrdersUnauthorized with default headers values -func NewCreateOrdersUnauthorized() *CreateOrdersUnauthorized { - - return &CreateOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateOrdersForbiddenCode is the HTTP code returned for type CreateOrdersForbidden -const CreateOrdersForbiddenCode int = 403 - -/* -CreateOrdersForbidden user is not authorized - -swagger:response createOrdersForbidden -*/ -type CreateOrdersForbidden struct { -} - -// NewCreateOrdersForbidden creates CreateOrdersForbidden with default headers values -func NewCreateOrdersForbidden() *CreateOrdersForbidden { - - return &CreateOrdersForbidden{} -} - -// WriteResponse to the client -func (o *CreateOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateOrdersInternalServerErrorCode is the HTTP code returned for type CreateOrdersInternalServerError -const CreateOrdersInternalServerErrorCode int = 500 - -/* -CreateOrdersInternalServerError internal server error - -swagger:response createOrdersInternalServerError -*/ -type CreateOrdersInternalServerError struct { -} - -// NewCreateOrdersInternalServerError creates CreateOrdersInternalServerError with default headers values -func NewCreateOrdersInternalServerError() *CreateOrdersInternalServerError { - - return &CreateOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go deleted file mode 100644 index 4384d1df729..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateOrdersURL generates an URL for the create orders operation -type CreateOrdersURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOrdersURL) WithBasePath(bp string) *CreateOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders.go b/pkg/gen/internalapi/internaloperations/orders/show_orders.go deleted file mode 100644 index 6461f46c98a..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/show_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowOrdersHandlerFunc turns a function with the right signature into a show orders handler -type ShowOrdersHandlerFunc func(ShowOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowOrdersHandlerFunc) Handle(params ShowOrdersParams) middleware.Responder { - return fn(params) -} - -// ShowOrdersHandler interface for that can handle valid show orders params -type ShowOrdersHandler interface { - Handle(ShowOrdersParams) middleware.Responder -} - -// NewShowOrders creates a new http.Handler for the show orders operation -func NewShowOrders(ctx *middleware.Context, handler ShowOrdersHandler) *ShowOrders { - return &ShowOrders{Context: ctx, Handler: handler} -} - -/* - ShowOrders swagger:route GET /orders/{ordersId} orders showOrders - -# Returns the given order - -Returns the given order -*/ -type ShowOrders struct { - Context *middleware.Context - Handler ShowOrdersHandler -} - -func (o *ShowOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go deleted file mode 100644 index 85519703bd1..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowOrdersParams creates a new ShowOrdersParams object -// -// There are no default values defined in the spec. -func NewShowOrdersParams() ShowOrdersParams { - - return ShowOrdersParams{} -} - -// ShowOrdersParams contains all the bound params for the show orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters showOrders -type ShowOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the order - Required: true - In: path - */ - OrdersID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowOrdersParams() beforehand. -func (o *ShowOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") - if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOrdersID binds and validates parameter OrdersID from path. -func (o *ShowOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) - } - o.OrdersID = *(value.(*strfmt.UUID)) - - if err := o.validateOrdersID(formats); err != nil { - return err - } - - return nil -} - -// validateOrdersID carries on validations for parameter OrdersID -func (o *ShowOrdersParams) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go deleted file mode 100644 index 43fda213f90..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowOrdersOKCode is the HTTP code returned for type ShowOrdersOK -const ShowOrdersOKCode int = 200 - -/* -ShowOrdersOK the instance of the order - -swagger:response showOrdersOK -*/ -type ShowOrdersOK struct { - - /* - In: Body - */ - Payload *internalmessages.Orders `json:"body,omitempty"` -} - -// NewShowOrdersOK creates ShowOrdersOK with default headers values -func NewShowOrdersOK() *ShowOrdersOK { - - return &ShowOrdersOK{} -} - -// WithPayload adds the payload to the show orders o k response -func (o *ShowOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show orders o k response -func (o *ShowOrdersOK) SetPayload(payload *internalmessages.Orders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowOrdersBadRequestCode is the HTTP code returned for type ShowOrdersBadRequest -const ShowOrdersBadRequestCode int = 400 - -/* -ShowOrdersBadRequest invalid request - -swagger:response showOrdersBadRequest -*/ -type ShowOrdersBadRequest struct { -} - -// NewShowOrdersBadRequest creates ShowOrdersBadRequest with default headers values -func NewShowOrdersBadRequest() *ShowOrdersBadRequest { - - return &ShowOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *ShowOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowOrdersUnauthorizedCode is the HTTP code returned for type ShowOrdersUnauthorized -const ShowOrdersUnauthorizedCode int = 401 - -/* -ShowOrdersUnauthorized request requires user authentication - -swagger:response showOrdersUnauthorized -*/ -type ShowOrdersUnauthorized struct { -} - -// NewShowOrdersUnauthorized creates ShowOrdersUnauthorized with default headers values -func NewShowOrdersUnauthorized() *ShowOrdersUnauthorized { - - return &ShowOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowOrdersForbiddenCode is the HTTP code returned for type ShowOrdersForbidden -const ShowOrdersForbiddenCode int = 403 - -/* -ShowOrdersForbidden user is not authorized - -swagger:response showOrdersForbidden -*/ -type ShowOrdersForbidden struct { -} - -// NewShowOrdersForbidden creates ShowOrdersForbidden with default headers values -func NewShowOrdersForbidden() *ShowOrdersForbidden { - - return &ShowOrdersForbidden{} -} - -// WriteResponse to the client -func (o *ShowOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowOrdersNotFoundCode is the HTTP code returned for type ShowOrdersNotFound -const ShowOrdersNotFoundCode int = 404 - -/* -ShowOrdersNotFound order is not found - -swagger:response showOrdersNotFound -*/ -type ShowOrdersNotFound struct { -} - -// NewShowOrdersNotFound creates ShowOrdersNotFound with default headers values -func NewShowOrdersNotFound() *ShowOrdersNotFound { - - return &ShowOrdersNotFound{} -} - -// WriteResponse to the client -func (o *ShowOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowOrdersInternalServerErrorCode is the HTTP code returned for type ShowOrdersInternalServerError -const ShowOrdersInternalServerErrorCode int = 500 - -/* -ShowOrdersInternalServerError internal server error - -swagger:response showOrdersInternalServerError -*/ -type ShowOrdersInternalServerError struct { -} - -// NewShowOrdersInternalServerError creates ShowOrdersInternalServerError with default headers values -func NewShowOrdersInternalServerError() *ShowOrdersInternalServerError { - - return &ShowOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go deleted file mode 100644 index 7b94442fd82..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowOrdersURL generates an URL for the show orders operation -type ShowOrdersURL struct { - OrdersID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOrdersURL) WithBasePath(bp string) *ShowOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{ordersId}" - - ordersID := o.OrdersID.String() - if ordersID != "" { - _path = strings.Replace(_path, "{ordersId}", ordersID, -1) - } else { - return nil, errors.New("ordersId is required on ShowOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders.go b/pkg/gen/internalapi/internaloperations/orders/update_orders.go deleted file mode 100644 index f64cb7850e3..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/update_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateOrdersHandlerFunc turns a function with the right signature into a update orders handler -type UpdateOrdersHandlerFunc func(UpdateOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateOrdersHandlerFunc) Handle(params UpdateOrdersParams) middleware.Responder { - return fn(params) -} - -// UpdateOrdersHandler interface for that can handle valid update orders params -type UpdateOrdersHandler interface { - Handle(UpdateOrdersParams) middleware.Responder -} - -// NewUpdateOrders creates a new http.Handler for the update orders operation -func NewUpdateOrders(ctx *middleware.Context, handler UpdateOrdersHandler) *UpdateOrders { - return &UpdateOrders{Context: ctx, Handler: handler} -} - -/* - UpdateOrders swagger:route PUT /orders/{ordersId} orders updateOrders - -# Updates orders - -All fields sent in this request will be set on the orders referenced -*/ -type UpdateOrders struct { - Context *middleware.Context - Handler UpdateOrdersHandler -} - -func (o *UpdateOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go deleted file mode 100644 index ac1937c4bf7..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateOrdersParams creates a new UpdateOrdersParams object -// -// There are no default values defined in the spec. -func NewUpdateOrdersParams() UpdateOrdersParams { - - return UpdateOrdersParams{} -} - -// UpdateOrdersParams contains all the bound params for the update orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateOrders -type UpdateOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the orders model - Required: true - In: path - */ - OrdersID strfmt.UUID - /* - Required: true - In: body - */ - UpdateOrders *internalmessages.CreateUpdateOrders -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateOrdersParams() beforehand. -func (o *UpdateOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") - if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateUpdateOrders - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateOrders", "body", "")) - } else { - res = append(res, errors.NewParseError("updateOrders", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateOrders = &body - } - } - } else { - res = append(res, errors.Required("updateOrders", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindOrdersID binds and validates parameter OrdersID from path. -func (o *UpdateOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) - } - o.OrdersID = *(value.(*strfmt.UUID)) - - if err := o.validateOrdersID(formats); err != nil { - return err - } - - return nil -} - -// validateOrdersID carries on validations for parameter OrdersID -func (o *UpdateOrdersParams) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go deleted file mode 100644 index a84f6eea343..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateOrdersOKCode is the HTTP code returned for type UpdateOrdersOK -const UpdateOrdersOKCode int = 200 - -/* -UpdateOrdersOK updated instance of orders - -swagger:response updateOrdersOK -*/ -type UpdateOrdersOK struct { - - /* - In: Body - */ - Payload *internalmessages.Orders `json:"body,omitempty"` -} - -// NewUpdateOrdersOK creates UpdateOrdersOK with default headers values -func NewUpdateOrdersOK() *UpdateOrdersOK { - - return &UpdateOrdersOK{} -} - -// WithPayload adds the payload to the update orders o k response -func (o *UpdateOrdersOK) WithPayload(payload *internalmessages.Orders) *UpdateOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update orders o k response -func (o *UpdateOrdersOK) SetPayload(payload *internalmessages.Orders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateOrdersBadRequestCode is the HTTP code returned for type UpdateOrdersBadRequest -const UpdateOrdersBadRequestCode int = 400 - -/* -UpdateOrdersBadRequest invalid request - -swagger:response updateOrdersBadRequest -*/ -type UpdateOrdersBadRequest struct { -} - -// NewUpdateOrdersBadRequest creates UpdateOrdersBadRequest with default headers values -func NewUpdateOrdersBadRequest() *UpdateOrdersBadRequest { - - return &UpdateOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *UpdateOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// UpdateOrdersUnauthorizedCode is the HTTP code returned for type UpdateOrdersUnauthorized -const UpdateOrdersUnauthorizedCode int = 401 - -/* -UpdateOrdersUnauthorized request requires user authentication - -swagger:response updateOrdersUnauthorized -*/ -type UpdateOrdersUnauthorized struct { -} - -// NewUpdateOrdersUnauthorized creates UpdateOrdersUnauthorized with default headers values -func NewUpdateOrdersUnauthorized() *UpdateOrdersUnauthorized { - - return &UpdateOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *UpdateOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// UpdateOrdersForbiddenCode is the HTTP code returned for type UpdateOrdersForbidden -const UpdateOrdersForbiddenCode int = 403 - -/* -UpdateOrdersForbidden user is not authorized - -swagger:response updateOrdersForbidden -*/ -type UpdateOrdersForbidden struct { -} - -// NewUpdateOrdersForbidden creates UpdateOrdersForbidden with default headers values -func NewUpdateOrdersForbidden() *UpdateOrdersForbidden { - - return &UpdateOrdersForbidden{} -} - -// WriteResponse to the client -func (o *UpdateOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UpdateOrdersNotFoundCode is the HTTP code returned for type UpdateOrdersNotFound -const UpdateOrdersNotFoundCode int = 404 - -/* -UpdateOrdersNotFound orders not found - -swagger:response updateOrdersNotFound -*/ -type UpdateOrdersNotFound struct { -} - -// NewUpdateOrdersNotFound creates UpdateOrdersNotFound with default headers values -func NewUpdateOrdersNotFound() *UpdateOrdersNotFound { - - return &UpdateOrdersNotFound{} -} - -// WriteResponse to the client -func (o *UpdateOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UpdateOrdersInternalServerErrorCode is the HTTP code returned for type UpdateOrdersInternalServerError -const UpdateOrdersInternalServerErrorCode int = 500 - -/* -UpdateOrdersInternalServerError internal server error - -swagger:response updateOrdersInternalServerError -*/ -type UpdateOrdersInternalServerError struct { -} - -// NewUpdateOrdersInternalServerError creates UpdateOrdersInternalServerError with default headers values -func NewUpdateOrdersInternalServerError() *UpdateOrdersInternalServerError { - - return &UpdateOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *UpdateOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go deleted file mode 100644 index 65946f57543..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateOrdersURL generates an URL for the update orders operation -type UpdateOrdersURL struct { - OrdersID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOrdersURL) WithBasePath(bp string) *UpdateOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{ordersId}" - - ordersID := o.OrdersID.String() - if ordersID != "" { - _path = strings.Replace(_path, "{ordersId}", ordersID, -1) - } else { - return nil, errors.New("ordersId is required on UpdateOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go deleted file mode 100644 index 23bbb2feb03..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UploadAmendedOrdersHandlerFunc turns a function with the right signature into a upload amended orders handler -type UploadAmendedOrdersHandlerFunc func(UploadAmendedOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UploadAmendedOrdersHandlerFunc) Handle(params UploadAmendedOrdersParams) middleware.Responder { - return fn(params) -} - -// UploadAmendedOrdersHandler interface for that can handle valid upload amended orders params -type UploadAmendedOrdersHandler interface { - Handle(UploadAmendedOrdersParams) middleware.Responder -} - -// NewUploadAmendedOrders creates a new http.Handler for the upload amended orders operation -func NewUploadAmendedOrders(ctx *middleware.Context, handler UploadAmendedOrdersHandler) *UploadAmendedOrders { - return &UploadAmendedOrders{Context: ctx, Handler: handler} -} - -/* - UploadAmendedOrders swagger:route PATCH /orders/{ordersId}/upload_amended_orders orders uploadAmendedOrders - -# Patch the amended orders for a given order - -Patch the amended orders for a given order -*/ -type UploadAmendedOrders struct { - Context *middleware.Context - Handler UploadAmendedOrdersHandler -} - -func (o *UploadAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUploadAmendedOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go deleted file mode 100644 index ce13c404857..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UploadAmendedOrdersMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var UploadAmendedOrdersMaxParseMemory int64 = 32 << 20 - -// NewUploadAmendedOrdersParams creates a new UploadAmendedOrdersParams object -// -// There are no default values defined in the spec. -func NewUploadAmendedOrdersParams() UploadAmendedOrdersParams { - - return UploadAmendedOrdersParams{} -} - -// UploadAmendedOrdersParams contains all the bound params for the upload amended orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters uploadAmendedOrders -type UploadAmendedOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the order - Required: true - In: path - */ - OrdersID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUploadAmendedOrdersParams() beforehand. -func (o *UploadAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(UploadAmendedOrdersMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") - if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *UploadAmendedOrdersParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindOrdersID binds and validates parameter OrdersID from path. -func (o *UploadAmendedOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) - } - o.OrdersID = *(value.(*strfmt.UUID)) - - if err := o.validateOrdersID(formats); err != nil { - return err - } - - return nil -} - -// validateOrdersID carries on validations for parameter OrdersID -func (o *UploadAmendedOrdersParams) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go deleted file mode 100644 index 599e3f7db3c..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UploadAmendedOrdersCreatedCode is the HTTP code returned for type UploadAmendedOrdersCreated -const UploadAmendedOrdersCreatedCode int = 201 - -/* -UploadAmendedOrdersCreated created upload - -swagger:response uploadAmendedOrdersCreated -*/ -type UploadAmendedOrdersCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Upload `json:"body,omitempty"` -} - -// NewUploadAmendedOrdersCreated creates UploadAmendedOrdersCreated with default headers values -func NewUploadAmendedOrdersCreated() *UploadAmendedOrdersCreated { - - return &UploadAmendedOrdersCreated{} -} - -// WithPayload adds the payload to the upload amended orders created response -func (o *UploadAmendedOrdersCreated) WithPayload(payload *internalmessages.Upload) *UploadAmendedOrdersCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload amended orders created response -func (o *UploadAmendedOrdersCreated) SetPayload(payload *internalmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAmendedOrdersBadRequestCode is the HTTP code returned for type UploadAmendedOrdersBadRequest -const UploadAmendedOrdersBadRequestCode int = 400 - -/* -UploadAmendedOrdersBadRequest invalid request - -swagger:response uploadAmendedOrdersBadRequest -*/ -type UploadAmendedOrdersBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewUploadAmendedOrdersBadRequest creates UploadAmendedOrdersBadRequest with default headers values -func NewUploadAmendedOrdersBadRequest() *UploadAmendedOrdersBadRequest { - - return &UploadAmendedOrdersBadRequest{} -} - -// WithPayload adds the payload to the upload amended orders bad request response -func (o *UploadAmendedOrdersBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *UploadAmendedOrdersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the upload amended orders bad request response -func (o *UploadAmendedOrdersBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UploadAmendedOrdersForbiddenCode is the HTTP code returned for type UploadAmendedOrdersForbidden -const UploadAmendedOrdersForbiddenCode int = 403 - -/* -UploadAmendedOrdersForbidden not authorized - -swagger:response uploadAmendedOrdersForbidden -*/ -type UploadAmendedOrdersForbidden struct { -} - -// NewUploadAmendedOrdersForbidden creates UploadAmendedOrdersForbidden with default headers values -func NewUploadAmendedOrdersForbidden() *UploadAmendedOrdersForbidden { - - return &UploadAmendedOrdersForbidden{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// UploadAmendedOrdersNotFoundCode is the HTTP code returned for type UploadAmendedOrdersNotFound -const UploadAmendedOrdersNotFoundCode int = 404 - -/* -UploadAmendedOrdersNotFound not found - -swagger:response uploadAmendedOrdersNotFound -*/ -type UploadAmendedOrdersNotFound struct { -} - -// NewUploadAmendedOrdersNotFound creates UploadAmendedOrdersNotFound with default headers values -func NewUploadAmendedOrdersNotFound() *UploadAmendedOrdersNotFound { - - return &UploadAmendedOrdersNotFound{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// UploadAmendedOrdersRequestEntityTooLargeCode is the HTTP code returned for type UploadAmendedOrdersRequestEntityTooLarge -const UploadAmendedOrdersRequestEntityTooLargeCode int = 413 - -/* -UploadAmendedOrdersRequestEntityTooLarge payload is too large - -swagger:response uploadAmendedOrdersRequestEntityTooLarge -*/ -type UploadAmendedOrdersRequestEntityTooLarge struct { -} - -// NewUploadAmendedOrdersRequestEntityTooLarge creates UploadAmendedOrdersRequestEntityTooLarge with default headers values -func NewUploadAmendedOrdersRequestEntityTooLarge() *UploadAmendedOrdersRequestEntityTooLarge { - - return &UploadAmendedOrdersRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// UploadAmendedOrdersInternalServerErrorCode is the HTTP code returned for type UploadAmendedOrdersInternalServerError -const UploadAmendedOrdersInternalServerErrorCode int = 500 - -/* -UploadAmendedOrdersInternalServerError server error - -swagger:response uploadAmendedOrdersInternalServerError -*/ -type UploadAmendedOrdersInternalServerError struct { -} - -// NewUploadAmendedOrdersInternalServerError creates UploadAmendedOrdersInternalServerError with default headers values -func NewUploadAmendedOrdersInternalServerError() *UploadAmendedOrdersInternalServerError { - - return &UploadAmendedOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *UploadAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go deleted file mode 100644 index 2e163f6cd12..00000000000 --- a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package orders - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UploadAmendedOrdersURL generates an URL for the upload amended orders operation -type UploadAmendedOrdersURL struct { - OrdersID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAmendedOrdersURL) WithBasePath(bp string) *UploadAmendedOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UploadAmendedOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UploadAmendedOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/orders/{ordersId}/upload_amended_orders" - - ordersID := o.OrdersID.String() - if ordersID != "" { - _path = strings.Replace(_path, "{ordersId}", ordersID, -1) - } else { - return nil, errors.New("ordersId is required on UploadAmendedOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UploadAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UploadAmendedOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UploadAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UploadAmendedOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UploadAmendedOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UploadAmendedOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go deleted file mode 100644 index 944fd99cdb0..00000000000 --- a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package postal_codes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ValidatePostalCodeWithRateDataHandlerFunc turns a function with the right signature into a validate postal code with rate data handler -type ValidatePostalCodeWithRateDataHandlerFunc func(ValidatePostalCodeWithRateDataParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ValidatePostalCodeWithRateDataHandlerFunc) Handle(params ValidatePostalCodeWithRateDataParams) middleware.Responder { - return fn(params) -} - -// ValidatePostalCodeWithRateDataHandler interface for that can handle valid validate postal code with rate data params -type ValidatePostalCodeWithRateDataHandler interface { - Handle(ValidatePostalCodeWithRateDataParams) middleware.Responder -} - -// NewValidatePostalCodeWithRateData creates a new http.Handler for the validate postal code with rate data operation -func NewValidatePostalCodeWithRateData(ctx *middleware.Context, handler ValidatePostalCodeWithRateDataHandler) *ValidatePostalCodeWithRateData { - return &ValidatePostalCodeWithRateData{Context: ctx, Handler: handler} -} - -/* - ValidatePostalCodeWithRateData swagger:route GET /rate_engine_postal_codes/{postal_code} postal_codes validatePostalCodeWithRateData - -Validate if a zipcode is valid for origin or destination location for a move. - -Verifies if a zipcode is valid for origin or destination location for a move. -*/ -type ValidatePostalCodeWithRateData struct { - Context *middleware.Context - Handler ValidatePostalCodeWithRateDataHandler -} - -func (o *ValidatePostalCodeWithRateData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewValidatePostalCodeWithRateDataParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go deleted file mode 100644 index a3b511796f4..00000000000 --- a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go +++ /dev/null @@ -1,135 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package postal_codes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewValidatePostalCodeWithRateDataParams creates a new ValidatePostalCodeWithRateDataParams object -// -// There are no default values defined in the spec. -func NewValidatePostalCodeWithRateDataParams() ValidatePostalCodeWithRateDataParams { - - return ValidatePostalCodeWithRateDataParams{} -} - -// ValidatePostalCodeWithRateDataParams contains all the bound params for the validate postal code with rate data operation -// typically these are obtained from a http.Request -// -// swagger:parameters validatePostalCodeWithRateData -type ValidatePostalCodeWithRateDataParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - Pattern: ^(\d{5}?)$ - In: path - */ - PostalCode string - /* - Required: true - In: query - */ - PostalCodeType string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewValidatePostalCodeWithRateDataParams() beforehand. -func (o *ValidatePostalCodeWithRateDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - rPostalCode, rhkPostalCode, _ := route.Params.GetOK("postal_code") - if err := o.bindPostalCode(rPostalCode, rhkPostalCode, route.Formats); err != nil { - res = append(res, err) - } - - qPostalCodeType, qhkPostalCodeType, _ := qs.GetOK("postal_code_type") - if err := o.bindPostalCodeType(qPostalCodeType, qhkPostalCodeType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPostalCode binds and validates parameter PostalCode from path. -func (o *ValidatePostalCodeWithRateDataParams) bindPostalCode(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PostalCode = raw - - if err := o.validatePostalCode(formats); err != nil { - return err - } - - return nil -} - -// validatePostalCode carries on validations for parameter PostalCode -func (o *ValidatePostalCodeWithRateDataParams) validatePostalCode(formats strfmt.Registry) error { - - if err := validate.Pattern("postal_code", "path", o.PostalCode, `^(\d{5}?)$`); err != nil { - return err - } - - return nil -} - -// bindPostalCodeType binds and validates parameter PostalCodeType from query. -func (o *ValidatePostalCodeWithRateDataParams) bindPostalCodeType(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("postal_code_type", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("postal_code_type", "query", raw); err != nil { - return err - } - o.PostalCodeType = raw - - if err := o.validatePostalCodeType(formats); err != nil { - return err - } - - return nil -} - -// validatePostalCodeType carries on validations for parameter PostalCodeType -func (o *ValidatePostalCodeWithRateDataParams) validatePostalCodeType(formats strfmt.Registry) error { - - if err := validate.EnumCase("postal_code_type", "query", o.PostalCodeType, []interface{}{"origin", "destination"}, true); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go deleted file mode 100644 index 776307effee..00000000000 --- a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package postal_codes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ValidatePostalCodeWithRateDataOKCode is the HTTP code returned for type ValidatePostalCodeWithRateDataOK -const ValidatePostalCodeWithRateDataOKCode int = 200 - -/* -ValidatePostalCodeWithRateDataOK postal_code is valid or invalid - -swagger:response validatePostalCodeWithRateDataOK -*/ -type ValidatePostalCodeWithRateDataOK struct { - - /* - In: Body - */ - Payload *internalmessages.RateEnginePostalCodePayload `json:"body,omitempty"` -} - -// NewValidatePostalCodeWithRateDataOK creates ValidatePostalCodeWithRateDataOK with default headers values -func NewValidatePostalCodeWithRateDataOK() *ValidatePostalCodeWithRateDataOK { - - return &ValidatePostalCodeWithRateDataOK{} -} - -// WithPayload adds the payload to the validate postal code with rate data o k response -func (o *ValidatePostalCodeWithRateDataOK) WithPayload(payload *internalmessages.RateEnginePostalCodePayload) *ValidatePostalCodeWithRateDataOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the validate postal code with rate data o k response -func (o *ValidatePostalCodeWithRateDataOK) SetPayload(payload *internalmessages.RateEnginePostalCodePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ValidatePostalCodeWithRateDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ValidatePostalCodeWithRateDataBadRequestCode is the HTTP code returned for type ValidatePostalCodeWithRateDataBadRequest -const ValidatePostalCodeWithRateDataBadRequestCode int = 400 - -/* -ValidatePostalCodeWithRateDataBadRequest invalid request - -swagger:response validatePostalCodeWithRateDataBadRequest -*/ -type ValidatePostalCodeWithRateDataBadRequest struct { -} - -// NewValidatePostalCodeWithRateDataBadRequest creates ValidatePostalCodeWithRateDataBadRequest with default headers values -func NewValidatePostalCodeWithRateDataBadRequest() *ValidatePostalCodeWithRateDataBadRequest { - - return &ValidatePostalCodeWithRateDataBadRequest{} -} - -// WriteResponse to the client -func (o *ValidatePostalCodeWithRateDataBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ValidatePostalCodeWithRateDataUnauthorizedCode is the HTTP code returned for type ValidatePostalCodeWithRateDataUnauthorized -const ValidatePostalCodeWithRateDataUnauthorizedCode int = 401 - -/* -ValidatePostalCodeWithRateDataUnauthorized must be authenticated to use this endpoint - -swagger:response validatePostalCodeWithRateDataUnauthorized -*/ -type ValidatePostalCodeWithRateDataUnauthorized struct { -} - -// NewValidatePostalCodeWithRateDataUnauthorized creates ValidatePostalCodeWithRateDataUnauthorized with default headers values -func NewValidatePostalCodeWithRateDataUnauthorized() *ValidatePostalCodeWithRateDataUnauthorized { - - return &ValidatePostalCodeWithRateDataUnauthorized{} -} - -// WriteResponse to the client -func (o *ValidatePostalCodeWithRateDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ValidatePostalCodeWithRateDataForbiddenCode is the HTTP code returned for type ValidatePostalCodeWithRateDataForbidden -const ValidatePostalCodeWithRateDataForbiddenCode int = 403 - -/* -ValidatePostalCodeWithRateDataForbidden user is not authorized - -swagger:response validatePostalCodeWithRateDataForbidden -*/ -type ValidatePostalCodeWithRateDataForbidden struct { -} - -// NewValidatePostalCodeWithRateDataForbidden creates ValidatePostalCodeWithRateDataForbidden with default headers values -func NewValidatePostalCodeWithRateDataForbidden() *ValidatePostalCodeWithRateDataForbidden { - - return &ValidatePostalCodeWithRateDataForbidden{} -} - -// WriteResponse to the client -func (o *ValidatePostalCodeWithRateDataForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ValidatePostalCodeWithRateDataInternalServerErrorCode is the HTTP code returned for type ValidatePostalCodeWithRateDataInternalServerError -const ValidatePostalCodeWithRateDataInternalServerErrorCode int = 500 - -/* -ValidatePostalCodeWithRateDataInternalServerError server error - -swagger:response validatePostalCodeWithRateDataInternalServerError -*/ -type ValidatePostalCodeWithRateDataInternalServerError struct { -} - -// NewValidatePostalCodeWithRateDataInternalServerError creates ValidatePostalCodeWithRateDataInternalServerError with default headers values -func NewValidatePostalCodeWithRateDataInternalServerError() *ValidatePostalCodeWithRateDataInternalServerError { - - return &ValidatePostalCodeWithRateDataInternalServerError{} -} - -// WriteResponse to the client -func (o *ValidatePostalCodeWithRateDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go deleted file mode 100644 index 951fdd8a211..00000000000 --- a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package postal_codes - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ValidatePostalCodeWithRateDataURL generates an URL for the validate postal code with rate data operation -type ValidatePostalCodeWithRateDataURL struct { - PostalCode string - - PostalCodeType string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ValidatePostalCodeWithRateDataURL) WithBasePath(bp string) *ValidatePostalCodeWithRateDataURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ValidatePostalCodeWithRateDataURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ValidatePostalCodeWithRateDataURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/rate_engine_postal_codes/{postal_code}" - - postalCode := o.PostalCode - if postalCode != "" { - _path = strings.Replace(_path, "{postal_code}", postalCode, -1) - } else { - return nil, errors.New("postalCode is required on ValidatePostalCodeWithRateDataURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - postalCodeTypeQ := o.PostalCodeType - if postalCodeTypeQ != "" { - qs.Set("postal_code_type", postalCodeTypeQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ValidatePostalCodeWithRateDataURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ValidatePostalCodeWithRateDataURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ValidatePostalCodeWithRateDataURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ValidatePostalCodeWithRateDataURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ValidatePostalCodeWithRateDataURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ValidatePostalCodeWithRateDataURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go deleted file mode 100644 index 11221b7fe09..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMovingExpenseHandlerFunc turns a function with the right signature into a create moving expense handler -type CreateMovingExpenseHandlerFunc func(CreateMovingExpenseParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMovingExpenseHandlerFunc) Handle(params CreateMovingExpenseParams) middleware.Responder { - return fn(params) -} - -// CreateMovingExpenseHandler interface for that can handle valid create moving expense params -type CreateMovingExpenseHandler interface { - Handle(CreateMovingExpenseParams) middleware.Responder -} - -// NewCreateMovingExpense creates a new http.Handler for the create moving expense operation -func NewCreateMovingExpense(ctx *middleware.Context, handler CreateMovingExpenseHandler) *CreateMovingExpense { - return &CreateMovingExpense{Context: ctx, Handler: handler} -} - -/* - CreateMovingExpense swagger:route POST /ppm-shipments/{ppmShipmentId}/moving-expenses ppm createMovingExpense - -# Creates moving expense document - -Creates a moving expense document for the PPM shipment -*/ -type CreateMovingExpense struct { - Context *middleware.Context - Handler CreateMovingExpenseHandler -} - -func (o *CreateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMovingExpenseParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go deleted file mode 100644 index 7b28dadfd9d..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewCreateMovingExpenseParams creates a new CreateMovingExpenseParams object -// -// There are no default values defined in the spec. -func NewCreateMovingExpenseParams() CreateMovingExpenseParams { - - return CreateMovingExpenseParams{} -} - -// CreateMovingExpenseParams contains all the bound params for the create moving expense operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMovingExpense -type CreateMovingExpenseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMovingExpenseParams() beforehand. -func (o *CreateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *CreateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *CreateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go deleted file mode 100644 index 0c88a116cb8..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateMovingExpenseCreatedCode is the HTTP code returned for type CreateMovingExpenseCreated -const CreateMovingExpenseCreatedCode int = 201 - -/* -CreateMovingExpenseCreated returns new moving expense object - -swagger:response createMovingExpenseCreated -*/ -type CreateMovingExpenseCreated struct { - - /* - In: Body - */ - Payload *internalmessages.MovingExpense `json:"body,omitempty"` -} - -// NewCreateMovingExpenseCreated creates CreateMovingExpenseCreated with default headers values -func NewCreateMovingExpenseCreated() *CreateMovingExpenseCreated { - - return &CreateMovingExpenseCreated{} -} - -// WithPayload adds the payload to the create moving expense created response -func (o *CreateMovingExpenseCreated) WithPayload(payload *internalmessages.MovingExpense) *CreateMovingExpenseCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense created response -func (o *CreateMovingExpenseCreated) SetPayload(payload *internalmessages.MovingExpense) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseBadRequestCode is the HTTP code returned for type CreateMovingExpenseBadRequest -const CreateMovingExpenseBadRequestCode int = 400 - -/* -CreateMovingExpenseBadRequest The request payload is invalid. - -swagger:response createMovingExpenseBadRequest -*/ -type CreateMovingExpenseBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMovingExpenseBadRequest creates CreateMovingExpenseBadRequest with default headers values -func NewCreateMovingExpenseBadRequest() *CreateMovingExpenseBadRequest { - - return &CreateMovingExpenseBadRequest{} -} - -// WithPayload adds the payload to the create moving expense bad request response -func (o *CreateMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense bad request response -func (o *CreateMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseUnauthorizedCode is the HTTP code returned for type CreateMovingExpenseUnauthorized -const CreateMovingExpenseUnauthorizedCode int = 401 - -/* -CreateMovingExpenseUnauthorized The request was denied. - -swagger:response createMovingExpenseUnauthorized -*/ -type CreateMovingExpenseUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMovingExpenseUnauthorized creates CreateMovingExpenseUnauthorized with default headers values -func NewCreateMovingExpenseUnauthorized() *CreateMovingExpenseUnauthorized { - - return &CreateMovingExpenseUnauthorized{} -} - -// WithPayload adds the payload to the create moving expense unauthorized response -func (o *CreateMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense unauthorized response -func (o *CreateMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseForbiddenCode is the HTTP code returned for type CreateMovingExpenseForbidden -const CreateMovingExpenseForbiddenCode int = 403 - -/* -CreateMovingExpenseForbidden The request was denied. - -swagger:response createMovingExpenseForbidden -*/ -type CreateMovingExpenseForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMovingExpenseForbidden creates CreateMovingExpenseForbidden with default headers values -func NewCreateMovingExpenseForbidden() *CreateMovingExpenseForbidden { - - return &CreateMovingExpenseForbidden{} -} - -// WithPayload adds the payload to the create moving expense forbidden response -func (o *CreateMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense forbidden response -func (o *CreateMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseNotFoundCode is the HTTP code returned for type CreateMovingExpenseNotFound -const CreateMovingExpenseNotFoundCode int = 404 - -/* -CreateMovingExpenseNotFound The requested resource wasn't found. - -swagger:response createMovingExpenseNotFound -*/ -type CreateMovingExpenseNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMovingExpenseNotFound creates CreateMovingExpenseNotFound with default headers values -func NewCreateMovingExpenseNotFound() *CreateMovingExpenseNotFound { - - return &CreateMovingExpenseNotFound{} -} - -// WithPayload adds the payload to the create moving expense not found response -func (o *CreateMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense not found response -func (o *CreateMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type CreateMovingExpenseUnprocessableEntity -const CreateMovingExpenseUnprocessableEntityCode int = 422 - -/* -CreateMovingExpenseUnprocessableEntity The payload was unprocessable. - -swagger:response createMovingExpenseUnprocessableEntity -*/ -type CreateMovingExpenseUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMovingExpenseUnprocessableEntity creates CreateMovingExpenseUnprocessableEntity with default headers values -func NewCreateMovingExpenseUnprocessableEntity() *CreateMovingExpenseUnprocessableEntity { - - return &CreateMovingExpenseUnprocessableEntity{} -} - -// WithPayload adds the payload to the create moving expense unprocessable entity response -func (o *CreateMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateMovingExpenseUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense unprocessable entity response -func (o *CreateMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMovingExpenseInternalServerErrorCode is the HTTP code returned for type CreateMovingExpenseInternalServerError -const CreateMovingExpenseInternalServerErrorCode int = 500 - -/* -CreateMovingExpenseInternalServerError A server error occurred. - -swagger:response createMovingExpenseInternalServerError -*/ -type CreateMovingExpenseInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewCreateMovingExpenseInternalServerError creates CreateMovingExpenseInternalServerError with default headers values -func NewCreateMovingExpenseInternalServerError() *CreateMovingExpenseInternalServerError { - - return &CreateMovingExpenseInternalServerError{} -} - -// WithPayload adds the payload to the create moving expense internal server error response -func (o *CreateMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *CreateMovingExpenseInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create moving expense internal server error response -func (o *CreateMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go deleted file mode 100644 index e3682712581..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateMovingExpenseURL generates an URL for the create moving expense operation -type CreateMovingExpenseURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMovingExpenseURL) WithBasePath(bp string) *CreateMovingExpenseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMovingExpenseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMovingExpenseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on CreateMovingExpenseURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMovingExpenseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMovingExpenseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMovingExpenseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMovingExpenseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go deleted file mode 100644 index 853dd0bbab2..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreatePPMUploadHandlerFunc turns a function with the right signature into a create p p m upload handler -type CreatePPMUploadHandlerFunc func(CreatePPMUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreatePPMUploadHandlerFunc) Handle(params CreatePPMUploadParams) middleware.Responder { - return fn(params) -} - -// CreatePPMUploadHandler interface for that can handle valid create p p m upload params -type CreatePPMUploadHandler interface { - Handle(CreatePPMUploadParams) middleware.Responder -} - -// NewCreatePPMUpload creates a new http.Handler for the create p p m upload operation -func NewCreatePPMUpload(ctx *middleware.Context, handler CreatePPMUploadHandler) *CreatePPMUpload { - return &CreatePPMUpload{Context: ctx, Handler: handler} -} - -/* - CreatePPMUpload swagger:route POST /ppm-shipments/{ppmShipmentId}/uploads ppm createPPMUpload - -# Create a new upload for a PPM weight ticket, pro-gear, or moving expense document - -Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet. -*/ -type CreatePPMUpload struct { - Context *middleware.Context - Handler CreatePPMUploadHandler -} - -func (o *CreatePPMUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreatePPMUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go deleted file mode 100644 index 4da92b41966..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreatePPMUploadMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreatePPMUploadMaxParseMemory int64 = 32 << 20 - -// NewCreatePPMUploadParams creates a new CreatePPMUploadParams object -// -// There are no default values defined in the spec. -func NewCreatePPMUploadParams() CreatePPMUploadParams { - - return CreatePPMUploadParams{} -} - -// CreatePPMUploadParams contains all the bound params for the create p p m upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters createPPMUpload -type CreatePPMUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the document to add an upload to - Required: true - In: query - */ - DocumentID strfmt.UUID - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the ppm shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*If the upload is a Weight Receipt - Required: true - In: query - */ - WeightReceipt bool -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreatePPMUploadParams() beforehand. -func (o *CreatePPMUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - if err := r.ParseMultipartForm(CreatePPMUploadMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") - if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { - res = append(res, err) - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - qWeightReceipt, qhkWeightReceipt, _ := qs.GetOK("weightReceipt") - if err := o.bindWeightReceipt(qWeightReceipt, qhkWeightReceipt, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDocumentID binds and validates parameter DocumentID from query. -func (o *CreatePPMUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("documentId", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("documentId", "query", raw); err != nil { - return err - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) - } - o.DocumentID = *(value.(*strfmt.UUID)) - - if err := o.validateDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateDocumentID carries on validations for parameter DocumentID -func (o *CreatePPMUploadParams) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreatePPMUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *CreatePPMUploadParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *CreatePPMUploadParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindWeightReceipt binds and validates parameter WeightReceipt from query. -func (o *CreatePPMUploadParams) bindWeightReceipt(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("weightReceipt", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("weightReceipt", "query", raw); err != nil { - return err - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("weightReceipt", "query", "bool", raw) - } - o.WeightReceipt = value - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go deleted file mode 100644 index d560f1319b2..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreatePPMUploadCreatedCode is the HTTP code returned for type CreatePPMUploadCreated -const CreatePPMUploadCreatedCode int = 201 - -/* -CreatePPMUploadCreated created upload - -swagger:response createPPMUploadCreated -*/ -type CreatePPMUploadCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Upload `json:"body,omitempty"` -} - -// NewCreatePPMUploadCreated creates CreatePPMUploadCreated with default headers values -func NewCreatePPMUploadCreated() *CreatePPMUploadCreated { - - return &CreatePPMUploadCreated{} -} - -// WithPayload adds the payload to the create p p m upload created response -func (o *CreatePPMUploadCreated) WithPayload(payload *internalmessages.Upload) *CreatePPMUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload created response -func (o *CreatePPMUploadCreated) SetPayload(payload *internalmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePPMUploadBadRequestCode is the HTTP code returned for type CreatePPMUploadBadRequest -const CreatePPMUploadBadRequestCode int = 400 - -/* -CreatePPMUploadBadRequest invalid request - -swagger:response createPPMUploadBadRequest -*/ -type CreatePPMUploadBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewCreatePPMUploadBadRequest creates CreatePPMUploadBadRequest with default headers values -func NewCreatePPMUploadBadRequest() *CreatePPMUploadBadRequest { - - return &CreatePPMUploadBadRequest{} -} - -// WithPayload adds the payload to the create p p m upload bad request response -func (o *CreatePPMUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *CreatePPMUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload bad request response -func (o *CreatePPMUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePPMUploadForbiddenCode is the HTTP code returned for type CreatePPMUploadForbidden -const CreatePPMUploadForbiddenCode int = 403 - -/* -CreatePPMUploadForbidden The request was denied. - -swagger:response createPPMUploadForbidden -*/ -type CreatePPMUploadForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePPMUploadForbidden creates CreatePPMUploadForbidden with default headers values -func NewCreatePPMUploadForbidden() *CreatePPMUploadForbidden { - - return &CreatePPMUploadForbidden{} -} - -// WithPayload adds the payload to the create p p m upload forbidden response -func (o *CreatePPMUploadForbidden) WithPayload(payload *internalmessages.ClientError) *CreatePPMUploadForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload forbidden response -func (o *CreatePPMUploadForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePPMUploadNotFoundCode is the HTTP code returned for type CreatePPMUploadNotFound -const CreatePPMUploadNotFoundCode int = 404 - -/* -CreatePPMUploadNotFound The requested resource wasn't found. - -swagger:response createPPMUploadNotFound -*/ -type CreatePPMUploadNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePPMUploadNotFound creates CreatePPMUploadNotFound with default headers values -func NewCreatePPMUploadNotFound() *CreatePPMUploadNotFound { - - return &CreatePPMUploadNotFound{} -} - -// WithPayload adds the payload to the create p p m upload not found response -func (o *CreatePPMUploadNotFound) WithPayload(payload *internalmessages.ClientError) *CreatePPMUploadNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload not found response -func (o *CreatePPMUploadNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePPMUploadRequestEntityTooLargeCode is the HTTP code returned for type CreatePPMUploadRequestEntityTooLarge -const CreatePPMUploadRequestEntityTooLargeCode int = 413 - -/* -CreatePPMUploadRequestEntityTooLarge payload is too large - -swagger:response createPPMUploadRequestEntityTooLarge -*/ -type CreatePPMUploadRequestEntityTooLarge struct { -} - -// NewCreatePPMUploadRequestEntityTooLarge creates CreatePPMUploadRequestEntityTooLarge with default headers values -func NewCreatePPMUploadRequestEntityTooLarge() *CreatePPMUploadRequestEntityTooLarge { - - return &CreatePPMUploadRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *CreatePPMUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// CreatePPMUploadUnprocessableEntityCode is the HTTP code returned for type CreatePPMUploadUnprocessableEntity -const CreatePPMUploadUnprocessableEntityCode int = 422 - -/* -CreatePPMUploadUnprocessableEntity The payload was unprocessable. - -swagger:response createPPMUploadUnprocessableEntity -*/ -type CreatePPMUploadUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreatePPMUploadUnprocessableEntity creates CreatePPMUploadUnprocessableEntity with default headers values -func NewCreatePPMUploadUnprocessableEntity() *CreatePPMUploadUnprocessableEntity { - - return &CreatePPMUploadUnprocessableEntity{} -} - -// WithPayload adds the payload to the create p p m upload unprocessable entity response -func (o *CreatePPMUploadUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreatePPMUploadUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload unprocessable entity response -func (o *CreatePPMUploadUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePPMUploadInternalServerErrorCode is the HTTP code returned for type CreatePPMUploadInternalServerError -const CreatePPMUploadInternalServerErrorCode int = 500 - -/* -CreatePPMUploadInternalServerError A server error occurred. - -swagger:response createPPMUploadInternalServerError -*/ -type CreatePPMUploadInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewCreatePPMUploadInternalServerError creates CreatePPMUploadInternalServerError with default headers values -func NewCreatePPMUploadInternalServerError() *CreatePPMUploadInternalServerError { - - return &CreatePPMUploadInternalServerError{} -} - -// WithPayload adds the payload to the create p p m upload internal server error response -func (o *CreatePPMUploadInternalServerError) WithPayload(payload *internalmessages.Error) *CreatePPMUploadInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create p p m upload internal server error response -func (o *CreatePPMUploadInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePPMUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go deleted file mode 100644 index 893b8b6f374..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CreatePPMUploadURL generates an URL for the create p p m upload operation -type CreatePPMUploadURL struct { - PpmShipmentID strfmt.UUID - - DocumentID strfmt.UUID - WeightReceipt bool - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePPMUploadURL) WithBasePath(bp string) *CreatePPMUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePPMUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreatePPMUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/uploads" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on CreatePPMUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - documentIDQ := o.DocumentID.String() - if documentIDQ != "" { - qs.Set("documentId", documentIDQ) - } - - weightReceiptQ := swag.FormatBool(o.WeightReceipt) - if weightReceiptQ != "" { - qs.Set("weightReceipt", weightReceiptQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreatePPMUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreatePPMUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreatePPMUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreatePPMUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreatePPMUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreatePPMUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go deleted file mode 100644 index 9a2b3e5b8bd..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateProGearWeightTicketHandlerFunc turns a function with the right signature into a create pro gear weight ticket handler -type CreateProGearWeightTicketHandlerFunc func(CreateProGearWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateProGearWeightTicketHandlerFunc) Handle(params CreateProGearWeightTicketParams) middleware.Responder { - return fn(params) -} - -// CreateProGearWeightTicketHandler interface for that can handle valid create pro gear weight ticket params -type CreateProGearWeightTicketHandler interface { - Handle(CreateProGearWeightTicketParams) middleware.Responder -} - -// NewCreateProGearWeightTicket creates a new http.Handler for the create pro gear weight ticket operation -func NewCreateProGearWeightTicket(ctx *middleware.Context, handler CreateProGearWeightTicketHandler) *CreateProGearWeightTicket { - return &CreateProGearWeightTicket{Context: ctx, Handler: handler} -} - -/* - CreateProGearWeightTicket swagger:route POST /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets ppm createProGearWeightTicket - -# Creates a pro-gear weight ticket - -Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a -pro-gear weight ticket. Data should be filled in using the patch endpoint. -*/ -type CreateProGearWeightTicket struct { - Context *middleware.Context - Handler CreateProGearWeightTicketHandler -} - -func (o *CreateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateProGearWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go deleted file mode 100644 index 25cba58f560..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewCreateProGearWeightTicketParams creates a new CreateProGearWeightTicketParams object -// -// There are no default values defined in the spec. -func NewCreateProGearWeightTicketParams() CreateProGearWeightTicketParams { - - return CreateProGearWeightTicketParams{} -} - -// CreateProGearWeightTicketParams contains all the bound params for the create pro gear weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters createProGearWeightTicket -type CreateProGearWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateProGearWeightTicketParams() beforehand. -func (o *CreateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *CreateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *CreateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go deleted file mode 100644 index 7a22c60d4a0..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateProGearWeightTicketCreatedCode is the HTTP code returned for type CreateProGearWeightTicketCreated -const CreateProGearWeightTicketCreatedCode int = 201 - -/* -CreateProGearWeightTicketCreated returns a new pro-gear weight ticket object - -swagger:response createProGearWeightTicketCreated -*/ -type CreateProGearWeightTicketCreated struct { - - /* - In: Body - */ - Payload *internalmessages.ProGearWeightTicket `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketCreated creates CreateProGearWeightTicketCreated with default headers values -func NewCreateProGearWeightTicketCreated() *CreateProGearWeightTicketCreated { - - return &CreateProGearWeightTicketCreated{} -} - -// WithPayload adds the payload to the create pro gear weight ticket created response -func (o *CreateProGearWeightTicketCreated) WithPayload(payload *internalmessages.ProGearWeightTicket) *CreateProGearWeightTicketCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket created response -func (o *CreateProGearWeightTicketCreated) SetPayload(payload *internalmessages.ProGearWeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketBadRequestCode is the HTTP code returned for type CreateProGearWeightTicketBadRequest -const CreateProGearWeightTicketBadRequestCode int = 400 - -/* -CreateProGearWeightTicketBadRequest The request payload is invalid. - -swagger:response createProGearWeightTicketBadRequest -*/ -type CreateProGearWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketBadRequest creates CreateProGearWeightTicketBadRequest with default headers values -func NewCreateProGearWeightTicketBadRequest() *CreateProGearWeightTicketBadRequest { - - return &CreateProGearWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the create pro gear weight ticket bad request response -func (o *CreateProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket bad request response -func (o *CreateProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type CreateProGearWeightTicketUnauthorized -const CreateProGearWeightTicketUnauthorizedCode int = 401 - -/* -CreateProGearWeightTicketUnauthorized The request was denied. - -swagger:response createProGearWeightTicketUnauthorized -*/ -type CreateProGearWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketUnauthorized creates CreateProGearWeightTicketUnauthorized with default headers values -func NewCreateProGearWeightTicketUnauthorized() *CreateProGearWeightTicketUnauthorized { - - return &CreateProGearWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the create pro gear weight ticket unauthorized response -func (o *CreateProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket unauthorized response -func (o *CreateProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketForbiddenCode is the HTTP code returned for type CreateProGearWeightTicketForbidden -const CreateProGearWeightTicketForbiddenCode int = 403 - -/* -CreateProGearWeightTicketForbidden The request was denied. - -swagger:response createProGearWeightTicketForbidden -*/ -type CreateProGearWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketForbidden creates CreateProGearWeightTicketForbidden with default headers values -func NewCreateProGearWeightTicketForbidden() *CreateProGearWeightTicketForbidden { - - return &CreateProGearWeightTicketForbidden{} -} - -// WithPayload adds the payload to the create pro gear weight ticket forbidden response -func (o *CreateProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket forbidden response -func (o *CreateProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketNotFoundCode is the HTTP code returned for type CreateProGearWeightTicketNotFound -const CreateProGearWeightTicketNotFoundCode int = 404 - -/* -CreateProGearWeightTicketNotFound The requested resource wasn't found. - -swagger:response createProGearWeightTicketNotFound -*/ -type CreateProGearWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketNotFound creates CreateProGearWeightTicketNotFound with default headers values -func NewCreateProGearWeightTicketNotFound() *CreateProGearWeightTicketNotFound { - - return &CreateProGearWeightTicketNotFound{} -} - -// WithPayload adds the payload to the create pro gear weight ticket not found response -func (o *CreateProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket not found response -func (o *CreateProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type CreateProGearWeightTicketPreconditionFailed -const CreateProGearWeightTicketPreconditionFailedCode int = 412 - -/* -CreateProGearWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response createProGearWeightTicketPreconditionFailed -*/ -type CreateProGearWeightTicketPreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketPreconditionFailed creates CreateProGearWeightTicketPreconditionFailed with default headers values -func NewCreateProGearWeightTicketPreconditionFailed() *CreateProGearWeightTicketPreconditionFailed { - - return &CreateProGearWeightTicketPreconditionFailed{} -} - -// WithPayload adds the payload to the create pro gear weight ticket precondition failed response -func (o *CreateProGearWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket precondition failed response -func (o *CreateProGearWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type CreateProGearWeightTicketUnprocessableEntity -const CreateProGearWeightTicketUnprocessableEntityCode int = 422 - -/* -CreateProGearWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response createProGearWeightTicketUnprocessableEntity -*/ -type CreateProGearWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketUnprocessableEntity creates CreateProGearWeightTicketUnprocessableEntity with default headers values -func NewCreateProGearWeightTicketUnprocessableEntity() *CreateProGearWeightTicketUnprocessableEntity { - - return &CreateProGearWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the create pro gear weight ticket unprocessable entity response -func (o *CreateProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateProGearWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket unprocessable entity response -func (o *CreateProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type CreateProGearWeightTicketInternalServerError -const CreateProGearWeightTicketInternalServerErrorCode int = 500 - -/* -CreateProGearWeightTicketInternalServerError A server error occurred. - -swagger:response createProGearWeightTicketInternalServerError -*/ -type CreateProGearWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewCreateProGearWeightTicketInternalServerError creates CreateProGearWeightTicketInternalServerError with default headers values -func NewCreateProGearWeightTicketInternalServerError() *CreateProGearWeightTicketInternalServerError { - - return &CreateProGearWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the create pro gear weight ticket internal server error response -func (o *CreateProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *CreateProGearWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create pro gear weight ticket internal server error response -func (o *CreateProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go deleted file mode 100644 index 664e288fab6..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateProGearWeightTicketURL generates an URL for the create pro gear weight ticket operation -type CreateProGearWeightTicketURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateProGearWeightTicketURL) WithBasePath(bp string) *CreateProGearWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateProGearWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateProGearWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on CreateProGearWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateProGearWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateProGearWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateProGearWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateProGearWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go deleted file mode 100644 index 4df622a2c8a..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateWeightTicketHandlerFunc turns a function with the right signature into a create weight ticket handler -type CreateWeightTicketHandlerFunc func(CreateWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateWeightTicketHandlerFunc) Handle(params CreateWeightTicketParams) middleware.Responder { - return fn(params) -} - -// CreateWeightTicketHandler interface for that can handle valid create weight ticket params -type CreateWeightTicketHandler interface { - Handle(CreateWeightTicketParams) middleware.Responder -} - -// NewCreateWeightTicket creates a new http.Handler for the create weight ticket operation -func NewCreateWeightTicket(ctx *middleware.Context, handler CreateWeightTicketHandler) *CreateWeightTicket { - return &CreateWeightTicket{Context: ctx, Handler: handler} -} - -/* - CreateWeightTicket swagger:route POST /ppm-shipments/{ppmShipmentId}/weight-ticket ppm createWeightTicket - -# Creates a weight ticket document - -Created a weight ticket document with the given information -*/ -type CreateWeightTicket struct { - Context *middleware.Context - Handler CreateWeightTicketHandler -} - -func (o *CreateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go deleted file mode 100644 index a690dcfc861..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewCreateWeightTicketParams creates a new CreateWeightTicketParams object -// -// There are no default values defined in the spec. -func NewCreateWeightTicketParams() CreateWeightTicketParams { - - return CreateWeightTicketParams{} -} - -// CreateWeightTicketParams contains all the bound params for the create weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters createWeightTicket -type CreateWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateWeightTicketParams() beforehand. -func (o *CreateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *CreateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *CreateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go deleted file mode 100644 index b8b14e02217..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateWeightTicketOKCode is the HTTP code returned for type CreateWeightTicketOK -const CreateWeightTicketOKCode int = 200 - -/* -CreateWeightTicketOK returns new weight ticket object - -swagger:response createWeightTicketOK -*/ -type CreateWeightTicketOK struct { - - /* - In: Body - */ - Payload *internalmessages.WeightTicket `json:"body,omitempty"` -} - -// NewCreateWeightTicketOK creates CreateWeightTicketOK with default headers values -func NewCreateWeightTicketOK() *CreateWeightTicketOK { - - return &CreateWeightTicketOK{} -} - -// WithPayload adds the payload to the create weight ticket o k response -func (o *CreateWeightTicketOK) WithPayload(payload *internalmessages.WeightTicket) *CreateWeightTicketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket o k response -func (o *CreateWeightTicketOK) SetPayload(payload *internalmessages.WeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketBadRequestCode is the HTTP code returned for type CreateWeightTicketBadRequest -const CreateWeightTicketBadRequestCode int = 400 - -/* -CreateWeightTicketBadRequest The request payload is invalid. - -swagger:response createWeightTicketBadRequest -*/ -type CreateWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateWeightTicketBadRequest creates CreateWeightTicketBadRequest with default headers values -func NewCreateWeightTicketBadRequest() *CreateWeightTicketBadRequest { - - return &CreateWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the create weight ticket bad request response -func (o *CreateWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket bad request response -func (o *CreateWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketUnauthorizedCode is the HTTP code returned for type CreateWeightTicketUnauthorized -const CreateWeightTicketUnauthorizedCode int = 401 - -/* -CreateWeightTicketUnauthorized The request was denied. - -swagger:response createWeightTicketUnauthorized -*/ -type CreateWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateWeightTicketUnauthorized creates CreateWeightTicketUnauthorized with default headers values -func NewCreateWeightTicketUnauthorized() *CreateWeightTicketUnauthorized { - - return &CreateWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the create weight ticket unauthorized response -func (o *CreateWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket unauthorized response -func (o *CreateWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketForbiddenCode is the HTTP code returned for type CreateWeightTicketForbidden -const CreateWeightTicketForbiddenCode int = 403 - -/* -CreateWeightTicketForbidden The request was denied. - -swagger:response createWeightTicketForbidden -*/ -type CreateWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateWeightTicketForbidden creates CreateWeightTicketForbidden with default headers values -func NewCreateWeightTicketForbidden() *CreateWeightTicketForbidden { - - return &CreateWeightTicketForbidden{} -} - -// WithPayload adds the payload to the create weight ticket forbidden response -func (o *CreateWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket forbidden response -func (o *CreateWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketNotFoundCode is the HTTP code returned for type CreateWeightTicketNotFound -const CreateWeightTicketNotFoundCode int = 404 - -/* -CreateWeightTicketNotFound The requested resource wasn't found. - -swagger:response createWeightTicketNotFound -*/ -type CreateWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateWeightTicketNotFound creates CreateWeightTicketNotFound with default headers values -func NewCreateWeightTicketNotFound() *CreateWeightTicketNotFound { - - return &CreateWeightTicketNotFound{} -} - -// WithPayload adds the payload to the create weight ticket not found response -func (o *CreateWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket not found response -func (o *CreateWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketUnprocessableEntityCode is the HTTP code returned for type CreateWeightTicketUnprocessableEntity -const CreateWeightTicketUnprocessableEntityCode int = 422 - -/* -CreateWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response createWeightTicketUnprocessableEntity -*/ -type CreateWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateWeightTicketUnprocessableEntity creates CreateWeightTicketUnprocessableEntity with default headers values -func NewCreateWeightTicketUnprocessableEntity() *CreateWeightTicketUnprocessableEntity { - - return &CreateWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the create weight ticket unprocessable entity response -func (o *CreateWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket unprocessable entity response -func (o *CreateWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWeightTicketInternalServerErrorCode is the HTTP code returned for type CreateWeightTicketInternalServerError -const CreateWeightTicketInternalServerErrorCode int = 500 - -/* -CreateWeightTicketInternalServerError A server error occurred. - -swagger:response createWeightTicketInternalServerError -*/ -type CreateWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewCreateWeightTicketInternalServerError creates CreateWeightTicketInternalServerError with default headers values -func NewCreateWeightTicketInternalServerError() *CreateWeightTicketInternalServerError { - - return &CreateWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the create weight ticket internal server error response -func (o *CreateWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *CreateWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create weight ticket internal server error response -func (o *CreateWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go deleted file mode 100644 index 08da13bfffc..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateWeightTicketURL generates an URL for the create weight ticket operation -type CreateWeightTicketURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWeightTicketURL) WithBasePath(bp string) *CreateWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on CreateWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go deleted file mode 100644 index 48a94fe80e0..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteMovingExpenseHandlerFunc turns a function with the right signature into a delete moving expense handler -type DeleteMovingExpenseHandlerFunc func(DeleteMovingExpenseParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteMovingExpenseHandlerFunc) Handle(params DeleteMovingExpenseParams) middleware.Responder { - return fn(params) -} - -// DeleteMovingExpenseHandler interface for that can handle valid delete moving expense params -type DeleteMovingExpenseHandler interface { - Handle(DeleteMovingExpenseParams) middleware.Responder -} - -// NewDeleteMovingExpense creates a new http.Handler for the delete moving expense operation -func NewDeleteMovingExpense(ctx *middleware.Context, handler DeleteMovingExpenseHandler) *DeleteMovingExpense { - return &DeleteMovingExpense{Context: ctx, Handler: handler} -} - -/* - DeleteMovingExpense swagger:route DELETE /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm deleteMovingExpense - -# Soft deletes a moving expense by ID - -Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted -records are not visible in milmove, but are kept in the database. -*/ -type DeleteMovingExpense struct { - Context *middleware.Context - Handler DeleteMovingExpenseHandler -} - -func (o *DeleteMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteMovingExpenseParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go deleted file mode 100644 index dacc76abee6..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteMovingExpenseParams creates a new DeleteMovingExpenseParams object -// -// There are no default values defined in the spec. -func NewDeleteMovingExpenseParams() DeleteMovingExpenseParams { - - return DeleteMovingExpenseParams{} -} - -// DeleteMovingExpenseParams contains all the bound params for the delete moving expense operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteMovingExpense -type DeleteMovingExpenseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*ID of the moving expense to be deleted - Required: true - In: path - */ - MovingExpenseID strfmt.UUID - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteMovingExpenseParams() beforehand. -func (o *DeleteMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") - if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. -func (o *DeleteMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) - } - o.MovingExpenseID = *(value.(*strfmt.UUID)) - - if err := o.validateMovingExpenseID(formats); err != nil { - return err - } - - return nil -} - -// validateMovingExpenseID carries on validations for parameter MovingExpenseID -func (o *DeleteMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { - - if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *DeleteMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *DeleteMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go deleted file mode 100644 index a79baa37534..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go +++ /dev/null @@ -1,354 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteMovingExpenseNoContentCode is the HTTP code returned for type DeleteMovingExpenseNoContent -const DeleteMovingExpenseNoContentCode int = 204 - -/* -DeleteMovingExpenseNoContent Successfully soft deleted the moving expense - -swagger:response deleteMovingExpenseNoContent -*/ -type DeleteMovingExpenseNoContent struct { -} - -// NewDeleteMovingExpenseNoContent creates DeleteMovingExpenseNoContent with default headers values -func NewDeleteMovingExpenseNoContent() *DeleteMovingExpenseNoContent { - - return &DeleteMovingExpenseNoContent{} -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteMovingExpenseBadRequestCode is the HTTP code returned for type DeleteMovingExpenseBadRequest -const DeleteMovingExpenseBadRequestCode int = 400 - -/* -DeleteMovingExpenseBadRequest The request payload is invalid. - -swagger:response deleteMovingExpenseBadRequest -*/ -type DeleteMovingExpenseBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseBadRequest creates DeleteMovingExpenseBadRequest with default headers values -func NewDeleteMovingExpenseBadRequest() *DeleteMovingExpenseBadRequest { - - return &DeleteMovingExpenseBadRequest{} -} - -// WithPayload adds the payload to the delete moving expense bad request response -func (o *DeleteMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense bad request response -func (o *DeleteMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseUnauthorizedCode is the HTTP code returned for type DeleteMovingExpenseUnauthorized -const DeleteMovingExpenseUnauthorizedCode int = 401 - -/* -DeleteMovingExpenseUnauthorized The request was denied. - -swagger:response deleteMovingExpenseUnauthorized -*/ -type DeleteMovingExpenseUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseUnauthorized creates DeleteMovingExpenseUnauthorized with default headers values -func NewDeleteMovingExpenseUnauthorized() *DeleteMovingExpenseUnauthorized { - - return &DeleteMovingExpenseUnauthorized{} -} - -// WithPayload adds the payload to the delete moving expense unauthorized response -func (o *DeleteMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense unauthorized response -func (o *DeleteMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseForbiddenCode is the HTTP code returned for type DeleteMovingExpenseForbidden -const DeleteMovingExpenseForbiddenCode int = 403 - -/* -DeleteMovingExpenseForbidden The request was denied. - -swagger:response deleteMovingExpenseForbidden -*/ -type DeleteMovingExpenseForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseForbidden creates DeleteMovingExpenseForbidden with default headers values -func NewDeleteMovingExpenseForbidden() *DeleteMovingExpenseForbidden { - - return &DeleteMovingExpenseForbidden{} -} - -// WithPayload adds the payload to the delete moving expense forbidden response -func (o *DeleteMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense forbidden response -func (o *DeleteMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseNotFoundCode is the HTTP code returned for type DeleteMovingExpenseNotFound -const DeleteMovingExpenseNotFoundCode int = 404 - -/* -DeleteMovingExpenseNotFound The requested resource wasn't found. - -swagger:response deleteMovingExpenseNotFound -*/ -type DeleteMovingExpenseNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseNotFound creates DeleteMovingExpenseNotFound with default headers values -func NewDeleteMovingExpenseNotFound() *DeleteMovingExpenseNotFound { - - return &DeleteMovingExpenseNotFound{} -} - -// WithPayload adds the payload to the delete moving expense not found response -func (o *DeleteMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense not found response -func (o *DeleteMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseConflictCode is the HTTP code returned for type DeleteMovingExpenseConflict -const DeleteMovingExpenseConflictCode int = 409 - -/* -DeleteMovingExpenseConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response deleteMovingExpenseConflict -*/ -type DeleteMovingExpenseConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseConflict creates DeleteMovingExpenseConflict with default headers values -func NewDeleteMovingExpenseConflict() *DeleteMovingExpenseConflict { - - return &DeleteMovingExpenseConflict{} -} - -// WithPayload adds the payload to the delete moving expense conflict response -func (o *DeleteMovingExpenseConflict) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense conflict response -func (o *DeleteMovingExpenseConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseUnprocessableEntityCode is the HTTP code returned for type DeleteMovingExpenseUnprocessableEntity -const DeleteMovingExpenseUnprocessableEntityCode int = 422 - -/* -DeleteMovingExpenseUnprocessableEntity The payload was unprocessable. - -swagger:response deleteMovingExpenseUnprocessableEntity -*/ -type DeleteMovingExpenseUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseUnprocessableEntity creates DeleteMovingExpenseUnprocessableEntity with default headers values -func NewDeleteMovingExpenseUnprocessableEntity() *DeleteMovingExpenseUnprocessableEntity { - - return &DeleteMovingExpenseUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete moving expense unprocessable entity response -func (o *DeleteMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteMovingExpenseUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense unprocessable entity response -func (o *DeleteMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMovingExpenseInternalServerErrorCode is the HTTP code returned for type DeleteMovingExpenseInternalServerError -const DeleteMovingExpenseInternalServerErrorCode int = 500 - -/* -DeleteMovingExpenseInternalServerError A server error occurred. - -swagger:response deleteMovingExpenseInternalServerError -*/ -type DeleteMovingExpenseInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewDeleteMovingExpenseInternalServerError creates DeleteMovingExpenseInternalServerError with default headers values -func NewDeleteMovingExpenseInternalServerError() *DeleteMovingExpenseInternalServerError { - - return &DeleteMovingExpenseInternalServerError{} -} - -// WithPayload adds the payload to the delete moving expense internal server error response -func (o *DeleteMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteMovingExpenseInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete moving expense internal server error response -func (o *DeleteMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go deleted file mode 100644 index fc0e9760296..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteMovingExpenseURL generates an URL for the delete moving expense operation -type DeleteMovingExpenseURL struct { - MovingExpenseID strfmt.UUID - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMovingExpenseURL) WithBasePath(bp string) *DeleteMovingExpenseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMovingExpenseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteMovingExpenseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" - - movingExpenseID := o.MovingExpenseID.String() - if movingExpenseID != "" { - _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) - } else { - return nil, errors.New("movingExpenseId is required on DeleteMovingExpenseURL") - } - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on DeleteMovingExpenseURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteMovingExpenseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteMovingExpenseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteMovingExpenseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteMovingExpenseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteMovingExpenseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go deleted file mode 100644 index 5fa38fa663e..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteProGearWeightTicketHandlerFunc turns a function with the right signature into a delete pro gear weight ticket handler -type DeleteProGearWeightTicketHandlerFunc func(DeleteProGearWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteProGearWeightTicketHandlerFunc) Handle(params DeleteProGearWeightTicketParams) middleware.Responder { - return fn(params) -} - -// DeleteProGearWeightTicketHandler interface for that can handle valid delete pro gear weight ticket params -type DeleteProGearWeightTicketHandler interface { - Handle(DeleteProGearWeightTicketParams) middleware.Responder -} - -// NewDeleteProGearWeightTicket creates a new http.Handler for the delete pro gear weight ticket operation -func NewDeleteProGearWeightTicket(ctx *middleware.Context, handler DeleteProGearWeightTicketHandler) *DeleteProGearWeightTicket { - return &DeleteProGearWeightTicket{Context: ctx, Handler: handler} -} - -/* - DeleteProGearWeightTicket swagger:route DELETE /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm deleteProGearWeightTicket - -# Soft deletes a pro-gear weight line item by ID - -Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted -records are not visible in milmove, but are kept in the database. -*/ -type DeleteProGearWeightTicket struct { - Context *middleware.Context - Handler DeleteProGearWeightTicketHandler -} - -func (o *DeleteProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteProGearWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go deleted file mode 100644 index 8c23d1c7b27..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteProGearWeightTicketParams creates a new DeleteProGearWeightTicketParams object -// -// There are no default values defined in the spec. -func NewDeleteProGearWeightTicketParams() DeleteProGearWeightTicketParams { - - return DeleteProGearWeightTicketParams{} -} - -// DeleteProGearWeightTicketParams contains all the bound params for the delete pro gear weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteProGearWeightTicket -type DeleteProGearWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*ID of the pro-gear weight ticket to be deleted - Required: true - In: path - */ - ProGearWeightTicketID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteProGearWeightTicketParams() beforehand. -func (o *DeleteProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") - if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *DeleteProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *DeleteProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. -func (o *DeleteProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) - } - o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateProGearWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID -func (o *DeleteProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go deleted file mode 100644 index 04c1f2c4baf..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go +++ /dev/null @@ -1,354 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteProGearWeightTicketNoContentCode is the HTTP code returned for type DeleteProGearWeightTicketNoContent -const DeleteProGearWeightTicketNoContentCode int = 204 - -/* -DeleteProGearWeightTicketNoContent Successfully soft deleted the pro-gear weight ticket - -swagger:response deleteProGearWeightTicketNoContent -*/ -type DeleteProGearWeightTicketNoContent struct { -} - -// NewDeleteProGearWeightTicketNoContent creates DeleteProGearWeightTicketNoContent with default headers values -func NewDeleteProGearWeightTicketNoContent() *DeleteProGearWeightTicketNoContent { - - return &DeleteProGearWeightTicketNoContent{} -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteProGearWeightTicketBadRequestCode is the HTTP code returned for type DeleteProGearWeightTicketBadRequest -const DeleteProGearWeightTicketBadRequestCode int = 400 - -/* -DeleteProGearWeightTicketBadRequest The request payload is invalid. - -swagger:response deleteProGearWeightTicketBadRequest -*/ -type DeleteProGearWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketBadRequest creates DeleteProGearWeightTicketBadRequest with default headers values -func NewDeleteProGearWeightTicketBadRequest() *DeleteProGearWeightTicketBadRequest { - - return &DeleteProGearWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket bad request response -func (o *DeleteProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket bad request response -func (o *DeleteProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketUnauthorizedCode is the HTTP code returned for type DeleteProGearWeightTicketUnauthorized -const DeleteProGearWeightTicketUnauthorizedCode int = 401 - -/* -DeleteProGearWeightTicketUnauthorized The request was denied. - -swagger:response deleteProGearWeightTicketUnauthorized -*/ -type DeleteProGearWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketUnauthorized creates DeleteProGearWeightTicketUnauthorized with default headers values -func NewDeleteProGearWeightTicketUnauthorized() *DeleteProGearWeightTicketUnauthorized { - - return &DeleteProGearWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket unauthorized response -func (o *DeleteProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket unauthorized response -func (o *DeleteProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketForbiddenCode is the HTTP code returned for type DeleteProGearWeightTicketForbidden -const DeleteProGearWeightTicketForbiddenCode int = 403 - -/* -DeleteProGearWeightTicketForbidden The request was denied. - -swagger:response deleteProGearWeightTicketForbidden -*/ -type DeleteProGearWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketForbidden creates DeleteProGearWeightTicketForbidden with default headers values -func NewDeleteProGearWeightTicketForbidden() *DeleteProGearWeightTicketForbidden { - - return &DeleteProGearWeightTicketForbidden{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket forbidden response -func (o *DeleteProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket forbidden response -func (o *DeleteProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketNotFoundCode is the HTTP code returned for type DeleteProGearWeightTicketNotFound -const DeleteProGearWeightTicketNotFoundCode int = 404 - -/* -DeleteProGearWeightTicketNotFound The requested resource wasn't found. - -swagger:response deleteProGearWeightTicketNotFound -*/ -type DeleteProGearWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketNotFound creates DeleteProGearWeightTicketNotFound with default headers values -func NewDeleteProGearWeightTicketNotFound() *DeleteProGearWeightTicketNotFound { - - return &DeleteProGearWeightTicketNotFound{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket not found response -func (o *DeleteProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket not found response -func (o *DeleteProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketConflictCode is the HTTP code returned for type DeleteProGearWeightTicketConflict -const DeleteProGearWeightTicketConflictCode int = 409 - -/* -DeleteProGearWeightTicketConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response deleteProGearWeightTicketConflict -*/ -type DeleteProGearWeightTicketConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketConflict creates DeleteProGearWeightTicketConflict with default headers values -func NewDeleteProGearWeightTicketConflict() *DeleteProGearWeightTicketConflict { - - return &DeleteProGearWeightTicketConflict{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket conflict response -func (o *DeleteProGearWeightTicketConflict) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket conflict response -func (o *DeleteProGearWeightTicketConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type DeleteProGearWeightTicketUnprocessableEntity -const DeleteProGearWeightTicketUnprocessableEntityCode int = 422 - -/* -DeleteProGearWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response deleteProGearWeightTicketUnprocessableEntity -*/ -type DeleteProGearWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketUnprocessableEntity creates DeleteProGearWeightTicketUnprocessableEntity with default headers values -func NewDeleteProGearWeightTicketUnprocessableEntity() *DeleteProGearWeightTicketUnprocessableEntity { - - return &DeleteProGearWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket unprocessable entity response -func (o *DeleteProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteProGearWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket unprocessable entity response -func (o *DeleteProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type DeleteProGearWeightTicketInternalServerError -const DeleteProGearWeightTicketInternalServerErrorCode int = 500 - -/* -DeleteProGearWeightTicketInternalServerError A server error occurred. - -swagger:response deleteProGearWeightTicketInternalServerError -*/ -type DeleteProGearWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewDeleteProGearWeightTicketInternalServerError creates DeleteProGearWeightTicketInternalServerError with default headers values -func NewDeleteProGearWeightTicketInternalServerError() *DeleteProGearWeightTicketInternalServerError { - - return &DeleteProGearWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the delete pro gear weight ticket internal server error response -func (o *DeleteProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteProGearWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete pro gear weight ticket internal server error response -func (o *DeleteProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go deleted file mode 100644 index 1aa99fa9807..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteProGearWeightTicketURL generates an URL for the delete pro gear weight ticket operation -type DeleteProGearWeightTicketURL struct { - PpmShipmentID strfmt.UUID - ProGearWeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteProGearWeightTicketURL) WithBasePath(bp string) *DeleteProGearWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteProGearWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteProGearWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on DeleteProGearWeightTicketURL") - } - - proGearWeightTicketID := o.ProGearWeightTicketID.String() - if proGearWeightTicketID != "" { - _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) - } else { - return nil, errors.New("proGearWeightTicketId is required on DeleteProGearWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteProGearWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteProGearWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteProGearWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteProGearWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go deleted file mode 100644 index 3a9f3ca633c..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteWeightTicketHandlerFunc turns a function with the right signature into a delete weight ticket handler -type DeleteWeightTicketHandlerFunc func(DeleteWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteWeightTicketHandlerFunc) Handle(params DeleteWeightTicketParams) middleware.Responder { - return fn(params) -} - -// DeleteWeightTicketHandler interface for that can handle valid delete weight ticket params -type DeleteWeightTicketHandler interface { - Handle(DeleteWeightTicketParams) middleware.Responder -} - -// NewDeleteWeightTicket creates a new http.Handler for the delete weight ticket operation -func NewDeleteWeightTicket(ctx *middleware.Context, handler DeleteWeightTicketHandler) *DeleteWeightTicket { - return &DeleteWeightTicket{Context: ctx, Handler: handler} -} - -/* - DeleteWeightTicket swagger:route DELETE /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm deleteWeightTicket - -# Soft deletes a weight ticket by ID - -Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted -records are not visible in milmove, but are kept in the database. This may change the PPM shipment's final -incentive. -*/ -type DeleteWeightTicket struct { - Context *middleware.Context - Handler DeleteWeightTicketHandler -} - -func (o *DeleteWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go deleted file mode 100644 index fd2b7c11f07..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteWeightTicketParams creates a new DeleteWeightTicketParams object -// -// There are no default values defined in the spec. -func NewDeleteWeightTicketParams() DeleteWeightTicketParams { - - return DeleteWeightTicketParams{} -} - -// DeleteWeightTicketParams contains all the bound params for the delete weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteWeightTicket -type DeleteWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*ID of the weight ticket to be deleted - Required: true - In: path - */ - WeightTicketID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteWeightTicketParams() beforehand. -func (o *DeleteWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") - if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *DeleteWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *DeleteWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindWeightTicketID binds and validates parameter WeightTicketID from path. -func (o *DeleteWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) - } - o.WeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateWeightTicketID carries on validations for parameter WeightTicketID -func (o *DeleteWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go deleted file mode 100644 index 8dd6fc85960..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go +++ /dev/null @@ -1,354 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteWeightTicketNoContentCode is the HTTP code returned for type DeleteWeightTicketNoContent -const DeleteWeightTicketNoContentCode int = 204 - -/* -DeleteWeightTicketNoContent Successfully soft deleted the weight ticket - -swagger:response deleteWeightTicketNoContent -*/ -type DeleteWeightTicketNoContent struct { -} - -// NewDeleteWeightTicketNoContent creates DeleteWeightTicketNoContent with default headers values -func NewDeleteWeightTicketNoContent() *DeleteWeightTicketNoContent { - - return &DeleteWeightTicketNoContent{} -} - -// WriteResponse to the client -func (o *DeleteWeightTicketNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteWeightTicketBadRequestCode is the HTTP code returned for type DeleteWeightTicketBadRequest -const DeleteWeightTicketBadRequestCode int = 400 - -/* -DeleteWeightTicketBadRequest The request payload is invalid. - -swagger:response deleteWeightTicketBadRequest -*/ -type DeleteWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketBadRequest creates DeleteWeightTicketBadRequest with default headers values -func NewDeleteWeightTicketBadRequest() *DeleteWeightTicketBadRequest { - - return &DeleteWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the delete weight ticket bad request response -func (o *DeleteWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket bad request response -func (o *DeleteWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketUnauthorizedCode is the HTTP code returned for type DeleteWeightTicketUnauthorized -const DeleteWeightTicketUnauthorizedCode int = 401 - -/* -DeleteWeightTicketUnauthorized The request was denied. - -swagger:response deleteWeightTicketUnauthorized -*/ -type DeleteWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketUnauthorized creates DeleteWeightTicketUnauthorized with default headers values -func NewDeleteWeightTicketUnauthorized() *DeleteWeightTicketUnauthorized { - - return &DeleteWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the delete weight ticket unauthorized response -func (o *DeleteWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket unauthorized response -func (o *DeleteWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketForbiddenCode is the HTTP code returned for type DeleteWeightTicketForbidden -const DeleteWeightTicketForbiddenCode int = 403 - -/* -DeleteWeightTicketForbidden The request was denied. - -swagger:response deleteWeightTicketForbidden -*/ -type DeleteWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketForbidden creates DeleteWeightTicketForbidden with default headers values -func NewDeleteWeightTicketForbidden() *DeleteWeightTicketForbidden { - - return &DeleteWeightTicketForbidden{} -} - -// WithPayload adds the payload to the delete weight ticket forbidden response -func (o *DeleteWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket forbidden response -func (o *DeleteWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketNotFoundCode is the HTTP code returned for type DeleteWeightTicketNotFound -const DeleteWeightTicketNotFoundCode int = 404 - -/* -DeleteWeightTicketNotFound The requested resource wasn't found. - -swagger:response deleteWeightTicketNotFound -*/ -type DeleteWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketNotFound creates DeleteWeightTicketNotFound with default headers values -func NewDeleteWeightTicketNotFound() *DeleteWeightTicketNotFound { - - return &DeleteWeightTicketNotFound{} -} - -// WithPayload adds the payload to the delete weight ticket not found response -func (o *DeleteWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket not found response -func (o *DeleteWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketConflictCode is the HTTP code returned for type DeleteWeightTicketConflict -const DeleteWeightTicketConflictCode int = 409 - -/* -DeleteWeightTicketConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response deleteWeightTicketConflict -*/ -type DeleteWeightTicketConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketConflict creates DeleteWeightTicketConflict with default headers values -func NewDeleteWeightTicketConflict() *DeleteWeightTicketConflict { - - return &DeleteWeightTicketConflict{} -} - -// WithPayload adds the payload to the delete weight ticket conflict response -func (o *DeleteWeightTicketConflict) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket conflict response -func (o *DeleteWeightTicketConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketUnprocessableEntityCode is the HTTP code returned for type DeleteWeightTicketUnprocessableEntity -const DeleteWeightTicketUnprocessableEntityCode int = 422 - -/* -DeleteWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response deleteWeightTicketUnprocessableEntity -*/ -type DeleteWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteWeightTicketUnprocessableEntity creates DeleteWeightTicketUnprocessableEntity with default headers values -func NewDeleteWeightTicketUnprocessableEntity() *DeleteWeightTicketUnprocessableEntity { - - return &DeleteWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete weight ticket unprocessable entity response -func (o *DeleteWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket unprocessable entity response -func (o *DeleteWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteWeightTicketInternalServerErrorCode is the HTTP code returned for type DeleteWeightTicketInternalServerError -const DeleteWeightTicketInternalServerErrorCode int = 500 - -/* -DeleteWeightTicketInternalServerError A server error occurred. - -swagger:response deleteWeightTicketInternalServerError -*/ -type DeleteWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewDeleteWeightTicketInternalServerError creates DeleteWeightTicketInternalServerError with default headers values -func NewDeleteWeightTicketInternalServerError() *DeleteWeightTicketInternalServerError { - - return &DeleteWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the delete weight ticket internal server error response -func (o *DeleteWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete weight ticket internal server error response -func (o *DeleteWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go deleted file mode 100644 index b6ce03b31a7..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteWeightTicketURL generates an URL for the delete weight ticket operation -type DeleteWeightTicketURL struct { - PpmShipmentID strfmt.UUID - WeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteWeightTicketURL) WithBasePath(bp string) *DeleteWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on DeleteWeightTicketURL") - } - - weightTicketID := o.WeightTicketID.String() - if weightTicketID != "" { - _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) - } else { - return nil, errors.New("weightTicketId is required on DeleteWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go deleted file mode 100644 index 87a1ffc86dc..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ResubmitPPMShipmentDocumentationHandlerFunc turns a function with the right signature into a resubmit p p m shipment documentation handler -type ResubmitPPMShipmentDocumentationHandlerFunc func(ResubmitPPMShipmentDocumentationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ResubmitPPMShipmentDocumentationHandlerFunc) Handle(params ResubmitPPMShipmentDocumentationParams) middleware.Responder { - return fn(params) -} - -// ResubmitPPMShipmentDocumentationHandler interface for that can handle valid resubmit p p m shipment documentation params -type ResubmitPPMShipmentDocumentationHandler interface { - Handle(ResubmitPPMShipmentDocumentationParams) middleware.Responder -} - -// NewResubmitPPMShipmentDocumentation creates a new http.Handler for the resubmit p p m shipment documentation operation -func NewResubmitPPMShipmentDocumentation(ctx *middleware.Context, handler ResubmitPPMShipmentDocumentationHandler) *ResubmitPPMShipmentDocumentation { - return &ResubmitPPMShipmentDocumentation{Context: ctx, Handler: handler} -} - -/* - ResubmitPPMShipmentDocumentation swagger:route PUT /ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId} ppm resubmitPPMShipmentDocumentation - -# Updates signature and routes PPM shipment to service counselor - -Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service -counselor queue for review. -*/ -type ResubmitPPMShipmentDocumentation struct { - Context *middleware.Context - Handler ResubmitPPMShipmentDocumentationHandler -} - -func (o *ResubmitPPMShipmentDocumentation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewResubmitPPMShipmentDocumentationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go deleted file mode 100644 index ac6defe137d..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewResubmitPPMShipmentDocumentationParams creates a new ResubmitPPMShipmentDocumentationParams object -// -// There are no default values defined in the spec. -func NewResubmitPPMShipmentDocumentationParams() ResubmitPPMShipmentDocumentationParams { - - return ResubmitPPMShipmentDocumentationParams{} -} - -// ResubmitPPMShipmentDocumentationParams contains all the bound params for the resubmit p p m shipment documentation operation -// typically these are obtained from a http.Request -// -// swagger:parameters resubmitPPMShipmentDocumentation -type ResubmitPPMShipmentDocumentationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - SavePPMShipmentSignedCertificationPayload *internalmessages.SavePPMShipmentSignedCertification - /*UUID of the signed certification - Required: true - In: path - */ - SignedCertificationID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewResubmitPPMShipmentDocumentationParams() beforehand. -func (o *ResubmitPPMShipmentDocumentationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.SavePPMShipmentSignedCertification - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("savePPMShipmentSignedCertificationPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.SavePPMShipmentSignedCertificationPayload = &body - } - } - } else { - res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) - } - - rSignedCertificationID, rhkSignedCertificationID, _ := route.Params.GetOK("signedCertificationId") - if err := o.bindSignedCertificationID(rSignedCertificationID, rhkSignedCertificationID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *ResubmitPPMShipmentDocumentationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *ResubmitPPMShipmentDocumentationParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *ResubmitPPMShipmentDocumentationParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindSignedCertificationID binds and validates parameter SignedCertificationID from path. -func (o *ResubmitPPMShipmentDocumentationParams) bindSignedCertificationID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("signedCertificationId", "path", "strfmt.UUID", raw) - } - o.SignedCertificationID = *(value.(*strfmt.UUID)) - - if err := o.validateSignedCertificationID(formats); err != nil { - return err - } - - return nil -} - -// validateSignedCertificationID carries on validations for parameter SignedCertificationID -func (o *ResubmitPPMShipmentDocumentationParams) validateSignedCertificationID(formats strfmt.Registry) error { - - if err := validate.FormatOf("signedCertificationId", "path", "uuid", o.SignedCertificationID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go deleted file mode 100644 index 296f33c1599..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ResubmitPPMShipmentDocumentationOKCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationOK -const ResubmitPPMShipmentDocumentationOKCode int = 200 - -/* -ResubmitPPMShipmentDocumentationOK Returns the updated PPM shipment - -swagger:response resubmitPPMShipmentDocumentationOK -*/ -type ResubmitPPMShipmentDocumentationOK struct { - - /* - In: Body - */ - Payload *internalmessages.PPMShipment `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationOK creates ResubmitPPMShipmentDocumentationOK with default headers values -func NewResubmitPPMShipmentDocumentationOK() *ResubmitPPMShipmentDocumentationOK { - - return &ResubmitPPMShipmentDocumentationOK{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation o k response -func (o *ResubmitPPMShipmentDocumentationOK) WithPayload(payload *internalmessages.PPMShipment) *ResubmitPPMShipmentDocumentationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation o k response -func (o *ResubmitPPMShipmentDocumentationOK) SetPayload(payload *internalmessages.PPMShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationBadRequestCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationBadRequest -const ResubmitPPMShipmentDocumentationBadRequestCode int = 400 - -/* -ResubmitPPMShipmentDocumentationBadRequest The request payload is invalid. - -swagger:response resubmitPPMShipmentDocumentationBadRequest -*/ -type ResubmitPPMShipmentDocumentationBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationBadRequest creates ResubmitPPMShipmentDocumentationBadRequest with default headers values -func NewResubmitPPMShipmentDocumentationBadRequest() *ResubmitPPMShipmentDocumentationBadRequest { - - return &ResubmitPPMShipmentDocumentationBadRequest{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation bad request response -func (o *ResubmitPPMShipmentDocumentationBadRequest) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation bad request response -func (o *ResubmitPPMShipmentDocumentationBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationUnauthorizedCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationUnauthorized -const ResubmitPPMShipmentDocumentationUnauthorizedCode int = 401 - -/* -ResubmitPPMShipmentDocumentationUnauthorized The request was denied. - -swagger:response resubmitPPMShipmentDocumentationUnauthorized -*/ -type ResubmitPPMShipmentDocumentationUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationUnauthorized creates ResubmitPPMShipmentDocumentationUnauthorized with default headers values -func NewResubmitPPMShipmentDocumentationUnauthorized() *ResubmitPPMShipmentDocumentationUnauthorized { - - return &ResubmitPPMShipmentDocumentationUnauthorized{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation unauthorized response -func (o *ResubmitPPMShipmentDocumentationUnauthorized) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation unauthorized response -func (o *ResubmitPPMShipmentDocumentationUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationForbiddenCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationForbidden -const ResubmitPPMShipmentDocumentationForbiddenCode int = 403 - -/* -ResubmitPPMShipmentDocumentationForbidden The request was denied. - -swagger:response resubmitPPMShipmentDocumentationForbidden -*/ -type ResubmitPPMShipmentDocumentationForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationForbidden creates ResubmitPPMShipmentDocumentationForbidden with default headers values -func NewResubmitPPMShipmentDocumentationForbidden() *ResubmitPPMShipmentDocumentationForbidden { - - return &ResubmitPPMShipmentDocumentationForbidden{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation forbidden response -func (o *ResubmitPPMShipmentDocumentationForbidden) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation forbidden response -func (o *ResubmitPPMShipmentDocumentationForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationNotFoundCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationNotFound -const ResubmitPPMShipmentDocumentationNotFoundCode int = 404 - -/* -ResubmitPPMShipmentDocumentationNotFound The requested resource wasn't found. - -swagger:response resubmitPPMShipmentDocumentationNotFound -*/ -type ResubmitPPMShipmentDocumentationNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationNotFound creates ResubmitPPMShipmentDocumentationNotFound with default headers values -func NewResubmitPPMShipmentDocumentationNotFound() *ResubmitPPMShipmentDocumentationNotFound { - - return &ResubmitPPMShipmentDocumentationNotFound{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation not found response -func (o *ResubmitPPMShipmentDocumentationNotFound) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation not found response -func (o *ResubmitPPMShipmentDocumentationNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationConflictCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationConflict -const ResubmitPPMShipmentDocumentationConflictCode int = 409 - -/* -ResubmitPPMShipmentDocumentationConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response resubmitPPMShipmentDocumentationConflict -*/ -type ResubmitPPMShipmentDocumentationConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationConflict creates ResubmitPPMShipmentDocumentationConflict with default headers values -func NewResubmitPPMShipmentDocumentationConflict() *ResubmitPPMShipmentDocumentationConflict { - - return &ResubmitPPMShipmentDocumentationConflict{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation conflict response -func (o *ResubmitPPMShipmentDocumentationConflict) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation conflict response -func (o *ResubmitPPMShipmentDocumentationConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationPreconditionFailedCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationPreconditionFailed -const ResubmitPPMShipmentDocumentationPreconditionFailedCode int = 412 - -/* -ResubmitPPMShipmentDocumentationPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response resubmitPPMShipmentDocumentationPreconditionFailed -*/ -type ResubmitPPMShipmentDocumentationPreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationPreconditionFailed creates ResubmitPPMShipmentDocumentationPreconditionFailed with default headers values -func NewResubmitPPMShipmentDocumentationPreconditionFailed() *ResubmitPPMShipmentDocumentationPreconditionFailed { - - return &ResubmitPPMShipmentDocumentationPreconditionFailed{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation precondition failed response -func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation precondition failed response -func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationUnprocessableEntityCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationUnprocessableEntity -const ResubmitPPMShipmentDocumentationUnprocessableEntityCode int = 422 - -/* -ResubmitPPMShipmentDocumentationUnprocessableEntity The payload was unprocessable. - -swagger:response resubmitPPMShipmentDocumentationUnprocessableEntity -*/ -type ResubmitPPMShipmentDocumentationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationUnprocessableEntity creates ResubmitPPMShipmentDocumentationUnprocessableEntity with default headers values -func NewResubmitPPMShipmentDocumentationUnprocessableEntity() *ResubmitPPMShipmentDocumentationUnprocessableEntity { - - return &ResubmitPPMShipmentDocumentationUnprocessableEntity{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation unprocessable entity response -func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *ResubmitPPMShipmentDocumentationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation unprocessable entity response -func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ResubmitPPMShipmentDocumentationInternalServerErrorCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationInternalServerError -const ResubmitPPMShipmentDocumentationInternalServerErrorCode int = 500 - -/* -ResubmitPPMShipmentDocumentationInternalServerError A server error occurred. - -swagger:response resubmitPPMShipmentDocumentationInternalServerError -*/ -type ResubmitPPMShipmentDocumentationInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewResubmitPPMShipmentDocumentationInternalServerError creates ResubmitPPMShipmentDocumentationInternalServerError with default headers values -func NewResubmitPPMShipmentDocumentationInternalServerError() *ResubmitPPMShipmentDocumentationInternalServerError { - - return &ResubmitPPMShipmentDocumentationInternalServerError{} -} - -// WithPayload adds the payload to the resubmit p p m shipment documentation internal server error response -func (o *ResubmitPPMShipmentDocumentationInternalServerError) WithPayload(payload *internalmessages.Error) *ResubmitPPMShipmentDocumentationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the resubmit p p m shipment documentation internal server error response -func (o *ResubmitPPMShipmentDocumentationInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ResubmitPPMShipmentDocumentationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go deleted file mode 100644 index efd59b4dd02..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ResubmitPPMShipmentDocumentationURL generates an URL for the resubmit p p m shipment documentation operation -type ResubmitPPMShipmentDocumentationURL struct { - PpmShipmentID strfmt.UUID - SignedCertificationID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ResubmitPPMShipmentDocumentationURL) WithBasePath(bp string) *ResubmitPPMShipmentDocumentationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ResubmitPPMShipmentDocumentationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ResubmitPPMShipmentDocumentationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on ResubmitPPMShipmentDocumentationURL") - } - - signedCertificationID := o.SignedCertificationID.String() - if signedCertificationID != "" { - _path = strings.Replace(_path, "{signedCertificationId}", signedCertificationID, -1) - } else { - return nil, errors.New("signedCertificationId is required on ResubmitPPMShipmentDocumentationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ResubmitPPMShipmentDocumentationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ResubmitPPMShipmentDocumentationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ResubmitPPMShipmentDocumentationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ResubmitPPMShipmentDocumentationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ResubmitPPMShipmentDocumentationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ResubmitPPMShipmentDocumentationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go deleted file mode 100644 index 2766f01b32c..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowAOAPacketHandlerFunc turns a function with the right signature into a show a o a packet handler -type ShowAOAPacketHandlerFunc func(ShowAOAPacketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowAOAPacketHandlerFunc) Handle(params ShowAOAPacketParams) middleware.Responder { - return fn(params) -} - -// ShowAOAPacketHandler interface for that can handle valid show a o a packet params -type ShowAOAPacketHandler interface { - Handle(ShowAOAPacketParams) middleware.Responder -} - -// NewShowAOAPacket creates a new http.Handler for the show a o a packet operation -func NewShowAOAPacket(ctx *middleware.Context, handler ShowAOAPacketHandler) *ShowAOAPacket { - return &ShowAOAPacket{Context: ctx, Handler: handler} -} - -/* - ShowAOAPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/aoa-packet ppm showAOAPacket - -# Downloads AOA Packet form PPMShipment as a PDF - -### Functionality -This endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF. -### Errors -* The PPMShipment must have requested an AOA. -* The PPMShipment AOA Request must have been approved. -*/ -type ShowAOAPacket struct { - Context *middleware.Context - Handler ShowAOAPacketHandler -} - -func (o *ShowAOAPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowAOAPacketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go deleted file mode 100644 index 046c0667969..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewShowAOAPacketParams creates a new ShowAOAPacketParams object -// -// There are no default values defined in the spec. -func NewShowAOAPacketParams() ShowAOAPacketParams { - - return ShowAOAPacketParams{} -} - -// ShowAOAPacketParams contains all the bound params for the show a o a packet operation -// typically these are obtained from a http.Request -// -// swagger:parameters showAOAPacket -type ShowAOAPacketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the id for the ppmshipment with aoa to be downloaded - Required: true - In: path - */ - PpmShipmentID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowAOAPacketParams() beforehand. -func (o *ShowAOAPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *ShowAOAPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PpmShipmentID = raw - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go deleted file mode 100644 index e391bc128eb..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowAOAPacketOKCode is the HTTP code returned for type ShowAOAPacketOK -const ShowAOAPacketOKCode int = 200 - -/* -ShowAOAPacketOK AOA PDF - -swagger:response showAOAPacketOK -*/ -type ShowAOAPacketOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewShowAOAPacketOK creates ShowAOAPacketOK with default headers values -func NewShowAOAPacketOK() *ShowAOAPacketOK { - - return &ShowAOAPacketOK{} -} - -// WithContentDisposition adds the contentDisposition to the show a o a packet o k response -func (o *ShowAOAPacketOK) WithContentDisposition(contentDisposition string) *ShowAOAPacketOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the show a o a packet o k response -func (o *ShowAOAPacketOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the show a o a packet o k response -func (o *ShowAOAPacketOK) WithPayload(payload io.ReadCloser) *ShowAOAPacketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet o k response -func (o *ShowAOAPacketOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowAOAPacketBadRequestCode is the HTTP code returned for type ShowAOAPacketBadRequest -const ShowAOAPacketBadRequestCode int = 400 - -/* -ShowAOAPacketBadRequest The request payload is invalid. - -swagger:response showAOAPacketBadRequest -*/ -type ShowAOAPacketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewShowAOAPacketBadRequest creates ShowAOAPacketBadRequest with default headers values -func NewShowAOAPacketBadRequest() *ShowAOAPacketBadRequest { - - return &ShowAOAPacketBadRequest{} -} - -// WithPayload adds the payload to the show a o a packet bad request response -func (o *ShowAOAPacketBadRequest) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet bad request response -func (o *ShowAOAPacketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketForbiddenCode is the HTTP code returned for type ShowAOAPacketForbidden -const ShowAOAPacketForbiddenCode int = 403 - -/* -ShowAOAPacketForbidden The request was denied. - -swagger:response showAOAPacketForbidden -*/ -type ShowAOAPacketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewShowAOAPacketForbidden creates ShowAOAPacketForbidden with default headers values -func NewShowAOAPacketForbidden() *ShowAOAPacketForbidden { - - return &ShowAOAPacketForbidden{} -} - -// WithPayload adds the payload to the show a o a packet forbidden response -func (o *ShowAOAPacketForbidden) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet forbidden response -func (o *ShowAOAPacketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketNotFoundCode is the HTTP code returned for type ShowAOAPacketNotFound -const ShowAOAPacketNotFoundCode int = 404 - -/* -ShowAOAPacketNotFound The requested resource wasn't found. - -swagger:response showAOAPacketNotFound -*/ -type ShowAOAPacketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewShowAOAPacketNotFound creates ShowAOAPacketNotFound with default headers values -func NewShowAOAPacketNotFound() *ShowAOAPacketNotFound { - - return &ShowAOAPacketNotFound{} -} - -// WithPayload adds the payload to the show a o a packet not found response -func (o *ShowAOAPacketNotFound) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet not found response -func (o *ShowAOAPacketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketUnprocessableEntityCode is the HTTP code returned for type ShowAOAPacketUnprocessableEntity -const ShowAOAPacketUnprocessableEntityCode int = 422 - -/* -ShowAOAPacketUnprocessableEntity The payload was unprocessable. - -swagger:response showAOAPacketUnprocessableEntity -*/ -type ShowAOAPacketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewShowAOAPacketUnprocessableEntity creates ShowAOAPacketUnprocessableEntity with default headers values -func NewShowAOAPacketUnprocessableEntity() *ShowAOAPacketUnprocessableEntity { - - return &ShowAOAPacketUnprocessableEntity{} -} - -// WithPayload adds the payload to the show a o a packet unprocessable entity response -func (o *ShowAOAPacketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *ShowAOAPacketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet unprocessable entity response -func (o *ShowAOAPacketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowAOAPacketInternalServerErrorCode is the HTTP code returned for type ShowAOAPacketInternalServerError -const ShowAOAPacketInternalServerErrorCode int = 500 - -/* -ShowAOAPacketInternalServerError A server error occurred. - -swagger:response showAOAPacketInternalServerError -*/ -type ShowAOAPacketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewShowAOAPacketInternalServerError creates ShowAOAPacketInternalServerError with default headers values -func NewShowAOAPacketInternalServerError() *ShowAOAPacketInternalServerError { - - return &ShowAOAPacketInternalServerError{} -} - -// WithPayload adds the payload to the show a o a packet internal server error response -func (o *ShowAOAPacketInternalServerError) WithPayload(payload *internalmessages.Error) *ShowAOAPacketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show a o a packet internal server error response -func (o *ShowAOAPacketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowAOAPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go deleted file mode 100644 index 560a206f633..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ShowAOAPacketURL generates an URL for the show a o a packet operation -type ShowAOAPacketURL struct { - PpmShipmentID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAOAPacketURL) WithBasePath(bp string) *ShowAOAPacketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowAOAPacketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowAOAPacketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/aoa-packet" - - ppmShipmentID := o.PpmShipmentID - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on ShowAOAPacketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowAOAPacketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowAOAPacketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowAOAPacketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowAOAPacketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowAOAPacketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowAOAPacketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go deleted file mode 100644 index 8ba7d0c7e56..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowPaymentPacketHandlerFunc turns a function with the right signature into a show payment packet handler -type ShowPaymentPacketHandlerFunc func(ShowPaymentPacketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowPaymentPacketHandlerFunc) Handle(params ShowPaymentPacketParams) middleware.Responder { - return fn(params) -} - -// ShowPaymentPacketHandler interface for that can handle valid show payment packet params -type ShowPaymentPacketHandler interface { - Handle(ShowPaymentPacketParams) middleware.Responder -} - -// NewShowPaymentPacket creates a new http.Handler for the show payment packet operation -func NewShowPaymentPacket(ctx *middleware.Context, handler ShowPaymentPacketHandler) *ShowPaymentPacket { - return &ShowPaymentPacket{Context: ctx, Handler: handler} -} - -/* - ShowPaymentPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/payment-packet ppm showPaymentPacket - -# Returns PPM payment packet - -Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations. -*/ -type ShowPaymentPacket struct { - Context *middleware.Context - Handler ShowPaymentPacketHandler -} - -func (o *ShowPaymentPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowPaymentPacketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go deleted file mode 100644 index b3b4c85fadf..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowPaymentPacketParams creates a new ShowPaymentPacketParams object -// -// There are no default values defined in the spec. -func NewShowPaymentPacketParams() ShowPaymentPacketParams { - - return ShowPaymentPacketParams{} -} - -// ShowPaymentPacketParams contains all the bound params for the show payment packet operation -// typically these are obtained from a http.Request -// -// swagger:parameters showPaymentPacket -type ShowPaymentPacketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the ppmShipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowPaymentPacketParams() beforehand. -func (o *ShowPaymentPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *ShowPaymentPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *ShowPaymentPacketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go deleted file mode 100644 index 8537da157f4..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go +++ /dev/null @@ -1,203 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" -) - -// ShowPaymentPacketOKCode is the HTTP code returned for type ShowPaymentPacketOK -const ShowPaymentPacketOKCode int = 200 - -/* -ShowPaymentPacketOK PPM Payment Packet PDF - -swagger:response showPaymentPacketOK -*/ -type ShowPaymentPacketOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewShowPaymentPacketOK creates ShowPaymentPacketOK with default headers values -func NewShowPaymentPacketOK() *ShowPaymentPacketOK { - - return &ShowPaymentPacketOK{} -} - -// WithContentDisposition adds the contentDisposition to the show payment packet o k response -func (o *ShowPaymentPacketOK) WithContentDisposition(contentDisposition string) *ShowPaymentPacketOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the show payment packet o k response -func (o *ShowPaymentPacketOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the show payment packet o k response -func (o *ShowPaymentPacketOK) WithPayload(payload io.ReadCloser) *ShowPaymentPacketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show payment packet o k response -func (o *ShowPaymentPacketOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowPaymentPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowPaymentPacketBadRequestCode is the HTTP code returned for type ShowPaymentPacketBadRequest -const ShowPaymentPacketBadRequestCode int = 400 - -/* -ShowPaymentPacketBadRequest invalid request - -swagger:response showPaymentPacketBadRequest -*/ -type ShowPaymentPacketBadRequest struct { -} - -// NewShowPaymentPacketBadRequest creates ShowPaymentPacketBadRequest with default headers values -func NewShowPaymentPacketBadRequest() *ShowPaymentPacketBadRequest { - - return &ShowPaymentPacketBadRequest{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowPaymentPacketUnauthorizedCode is the HTTP code returned for type ShowPaymentPacketUnauthorized -const ShowPaymentPacketUnauthorizedCode int = 401 - -/* -ShowPaymentPacketUnauthorized request requires user authentication - -swagger:response showPaymentPacketUnauthorized -*/ -type ShowPaymentPacketUnauthorized struct { -} - -// NewShowPaymentPacketUnauthorized creates ShowPaymentPacketUnauthorized with default headers values -func NewShowPaymentPacketUnauthorized() *ShowPaymentPacketUnauthorized { - - return &ShowPaymentPacketUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowPaymentPacketForbiddenCode is the HTTP code returned for type ShowPaymentPacketForbidden -const ShowPaymentPacketForbiddenCode int = 403 - -/* -ShowPaymentPacketForbidden user is not authorized - -swagger:response showPaymentPacketForbidden -*/ -type ShowPaymentPacketForbidden struct { -} - -// NewShowPaymentPacketForbidden creates ShowPaymentPacketForbidden with default headers values -func NewShowPaymentPacketForbidden() *ShowPaymentPacketForbidden { - - return &ShowPaymentPacketForbidden{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowPaymentPacketNotFoundCode is the HTTP code returned for type ShowPaymentPacketNotFound -const ShowPaymentPacketNotFoundCode int = 404 - -/* -ShowPaymentPacketNotFound ppm not found - -swagger:response showPaymentPacketNotFound -*/ -type ShowPaymentPacketNotFound struct { -} - -// NewShowPaymentPacketNotFound creates ShowPaymentPacketNotFound with default headers values -func NewShowPaymentPacketNotFound() *ShowPaymentPacketNotFound { - - return &ShowPaymentPacketNotFound{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowPaymentPacketInternalServerErrorCode is the HTTP code returned for type ShowPaymentPacketInternalServerError -const ShowPaymentPacketInternalServerErrorCode int = 500 - -/* -ShowPaymentPacketInternalServerError internal server error - -swagger:response showPaymentPacketInternalServerError -*/ -type ShowPaymentPacketInternalServerError struct { -} - -// NewShowPaymentPacketInternalServerError creates ShowPaymentPacketInternalServerError with default headers values -func NewShowPaymentPacketInternalServerError() *ShowPaymentPacketInternalServerError { - - return &ShowPaymentPacketInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowPaymentPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go deleted file mode 100644 index 7cf1ed7163f..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowPaymentPacketURL generates an URL for the show payment packet operation -type ShowPaymentPacketURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowPaymentPacketURL) WithBasePath(bp string) *ShowPaymentPacketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowPaymentPacketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowPaymentPacketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/payment-packet" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on ShowPaymentPacketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowPaymentPacketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowPaymentPacketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowPaymentPacketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowPaymentPacketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowPaymentPacketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowPaymentPacketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go deleted file mode 100644 index 435a73316be..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// SubmitPPMShipmentDocumentationHandlerFunc turns a function with the right signature into a submit p p m shipment documentation handler -type SubmitPPMShipmentDocumentationHandlerFunc func(SubmitPPMShipmentDocumentationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn SubmitPPMShipmentDocumentationHandlerFunc) Handle(params SubmitPPMShipmentDocumentationParams) middleware.Responder { - return fn(params) -} - -// SubmitPPMShipmentDocumentationHandler interface for that can handle valid submit p p m shipment documentation params -type SubmitPPMShipmentDocumentationHandler interface { - Handle(SubmitPPMShipmentDocumentationParams) middleware.Responder -} - -// NewSubmitPPMShipmentDocumentation creates a new http.Handler for the submit p p m shipment documentation operation -func NewSubmitPPMShipmentDocumentation(ctx *middleware.Context, handler SubmitPPMShipmentDocumentationHandler) *SubmitPPMShipmentDocumentation { - return &SubmitPPMShipmentDocumentation{Context: ctx, Handler: handler} -} - -/* - SubmitPPMShipmentDocumentation swagger:route POST /ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation ppm submitPPMShipmentDocumentation - -# Saves signature and routes PPM shipment to service counselor - -Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service -counselor queue for review. -*/ -type SubmitPPMShipmentDocumentation struct { - Context *middleware.Context - Handler SubmitPPMShipmentDocumentationHandler -} - -func (o *SubmitPPMShipmentDocumentation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewSubmitPPMShipmentDocumentationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go deleted file mode 100644 index 2664c450f8c..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewSubmitPPMShipmentDocumentationParams creates a new SubmitPPMShipmentDocumentationParams object -// -// There are no default values defined in the spec. -func NewSubmitPPMShipmentDocumentationParams() SubmitPPMShipmentDocumentationParams { - - return SubmitPPMShipmentDocumentationParams{} -} - -// SubmitPPMShipmentDocumentationParams contains all the bound params for the submit p p m shipment documentation operation -// typically these are obtained from a http.Request -// -// swagger:parameters submitPPMShipmentDocumentation -type SubmitPPMShipmentDocumentationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - SavePPMShipmentSignedCertificationPayload *internalmessages.SavePPMShipmentSignedCertification -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewSubmitPPMShipmentDocumentationParams() beforehand. -func (o *SubmitPPMShipmentDocumentationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.SavePPMShipmentSignedCertification - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("savePPMShipmentSignedCertificationPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.SavePPMShipmentSignedCertificationPayload = &body - } - } - } else { - res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *SubmitPPMShipmentDocumentationParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *SubmitPPMShipmentDocumentationParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go deleted file mode 100644 index 136a5f31fe1..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// SubmitPPMShipmentDocumentationOKCode is the HTTP code returned for type SubmitPPMShipmentDocumentationOK -const SubmitPPMShipmentDocumentationOKCode int = 200 - -/* -SubmitPPMShipmentDocumentationOK Returns the updated PPM shipment - -swagger:response submitPPMShipmentDocumentationOK -*/ -type SubmitPPMShipmentDocumentationOK struct { - - /* - In: Body - */ - Payload *internalmessages.PPMShipment `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationOK creates SubmitPPMShipmentDocumentationOK with default headers values -func NewSubmitPPMShipmentDocumentationOK() *SubmitPPMShipmentDocumentationOK { - - return &SubmitPPMShipmentDocumentationOK{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation o k response -func (o *SubmitPPMShipmentDocumentationOK) WithPayload(payload *internalmessages.PPMShipment) *SubmitPPMShipmentDocumentationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation o k response -func (o *SubmitPPMShipmentDocumentationOK) SetPayload(payload *internalmessages.PPMShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationBadRequestCode is the HTTP code returned for type SubmitPPMShipmentDocumentationBadRequest -const SubmitPPMShipmentDocumentationBadRequestCode int = 400 - -/* -SubmitPPMShipmentDocumentationBadRequest The request payload is invalid. - -swagger:response submitPPMShipmentDocumentationBadRequest -*/ -type SubmitPPMShipmentDocumentationBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationBadRequest creates SubmitPPMShipmentDocumentationBadRequest with default headers values -func NewSubmitPPMShipmentDocumentationBadRequest() *SubmitPPMShipmentDocumentationBadRequest { - - return &SubmitPPMShipmentDocumentationBadRequest{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation bad request response -func (o *SubmitPPMShipmentDocumentationBadRequest) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation bad request response -func (o *SubmitPPMShipmentDocumentationBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationUnauthorizedCode is the HTTP code returned for type SubmitPPMShipmentDocumentationUnauthorized -const SubmitPPMShipmentDocumentationUnauthorizedCode int = 401 - -/* -SubmitPPMShipmentDocumentationUnauthorized The request was denied. - -swagger:response submitPPMShipmentDocumentationUnauthorized -*/ -type SubmitPPMShipmentDocumentationUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationUnauthorized creates SubmitPPMShipmentDocumentationUnauthorized with default headers values -func NewSubmitPPMShipmentDocumentationUnauthorized() *SubmitPPMShipmentDocumentationUnauthorized { - - return &SubmitPPMShipmentDocumentationUnauthorized{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation unauthorized response -func (o *SubmitPPMShipmentDocumentationUnauthorized) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation unauthorized response -func (o *SubmitPPMShipmentDocumentationUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationForbiddenCode is the HTTP code returned for type SubmitPPMShipmentDocumentationForbidden -const SubmitPPMShipmentDocumentationForbiddenCode int = 403 - -/* -SubmitPPMShipmentDocumentationForbidden The request was denied. - -swagger:response submitPPMShipmentDocumentationForbidden -*/ -type SubmitPPMShipmentDocumentationForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationForbidden creates SubmitPPMShipmentDocumentationForbidden with default headers values -func NewSubmitPPMShipmentDocumentationForbidden() *SubmitPPMShipmentDocumentationForbidden { - - return &SubmitPPMShipmentDocumentationForbidden{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation forbidden response -func (o *SubmitPPMShipmentDocumentationForbidden) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation forbidden response -func (o *SubmitPPMShipmentDocumentationForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationNotFoundCode is the HTTP code returned for type SubmitPPMShipmentDocumentationNotFound -const SubmitPPMShipmentDocumentationNotFoundCode int = 404 - -/* -SubmitPPMShipmentDocumentationNotFound The requested resource wasn't found. - -swagger:response submitPPMShipmentDocumentationNotFound -*/ -type SubmitPPMShipmentDocumentationNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationNotFound creates SubmitPPMShipmentDocumentationNotFound with default headers values -func NewSubmitPPMShipmentDocumentationNotFound() *SubmitPPMShipmentDocumentationNotFound { - - return &SubmitPPMShipmentDocumentationNotFound{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation not found response -func (o *SubmitPPMShipmentDocumentationNotFound) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation not found response -func (o *SubmitPPMShipmentDocumentationNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationConflictCode is the HTTP code returned for type SubmitPPMShipmentDocumentationConflict -const SubmitPPMShipmentDocumentationConflictCode int = 409 - -/* -SubmitPPMShipmentDocumentationConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response submitPPMShipmentDocumentationConflict -*/ -type SubmitPPMShipmentDocumentationConflict struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationConflict creates SubmitPPMShipmentDocumentationConflict with default headers values -func NewSubmitPPMShipmentDocumentationConflict() *SubmitPPMShipmentDocumentationConflict { - - return &SubmitPPMShipmentDocumentationConflict{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation conflict response -func (o *SubmitPPMShipmentDocumentationConflict) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation conflict response -func (o *SubmitPPMShipmentDocumentationConflict) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationUnprocessableEntityCode is the HTTP code returned for type SubmitPPMShipmentDocumentationUnprocessableEntity -const SubmitPPMShipmentDocumentationUnprocessableEntityCode int = 422 - -/* -SubmitPPMShipmentDocumentationUnprocessableEntity The payload was unprocessable. - -swagger:response submitPPMShipmentDocumentationUnprocessableEntity -*/ -type SubmitPPMShipmentDocumentationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationUnprocessableEntity creates SubmitPPMShipmentDocumentationUnprocessableEntity with default headers values -func NewSubmitPPMShipmentDocumentationUnprocessableEntity() *SubmitPPMShipmentDocumentationUnprocessableEntity { - - return &SubmitPPMShipmentDocumentationUnprocessableEntity{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation unprocessable entity response -func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *SubmitPPMShipmentDocumentationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation unprocessable entity response -func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// SubmitPPMShipmentDocumentationInternalServerErrorCode is the HTTP code returned for type SubmitPPMShipmentDocumentationInternalServerError -const SubmitPPMShipmentDocumentationInternalServerErrorCode int = 500 - -/* -SubmitPPMShipmentDocumentationInternalServerError A server error occurred. - -swagger:response submitPPMShipmentDocumentationInternalServerError -*/ -type SubmitPPMShipmentDocumentationInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewSubmitPPMShipmentDocumentationInternalServerError creates SubmitPPMShipmentDocumentationInternalServerError with default headers values -func NewSubmitPPMShipmentDocumentationInternalServerError() *SubmitPPMShipmentDocumentationInternalServerError { - - return &SubmitPPMShipmentDocumentationInternalServerError{} -} - -// WithPayload adds the payload to the submit p p m shipment documentation internal server error response -func (o *SubmitPPMShipmentDocumentationInternalServerError) WithPayload(payload *internalmessages.Error) *SubmitPPMShipmentDocumentationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the submit p p m shipment documentation internal server error response -func (o *SubmitPPMShipmentDocumentationInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *SubmitPPMShipmentDocumentationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go deleted file mode 100644 index 2444faa865e..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// SubmitPPMShipmentDocumentationURL generates an URL for the submit p p m shipment documentation operation -type SubmitPPMShipmentDocumentationURL struct { - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitPPMShipmentDocumentationURL) WithBasePath(bp string) *SubmitPPMShipmentDocumentationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *SubmitPPMShipmentDocumentationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *SubmitPPMShipmentDocumentationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on SubmitPPMShipmentDocumentationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *SubmitPPMShipmentDocumentationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *SubmitPPMShipmentDocumentationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *SubmitPPMShipmentDocumentationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on SubmitPPMShipmentDocumentationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on SubmitPPMShipmentDocumentationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *SubmitPPMShipmentDocumentationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go deleted file mode 100644 index bea95125fd1..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMovingExpenseHandlerFunc turns a function with the right signature into a update moving expense handler -type UpdateMovingExpenseHandlerFunc func(UpdateMovingExpenseParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMovingExpenseHandlerFunc) Handle(params UpdateMovingExpenseParams) middleware.Responder { - return fn(params) -} - -// UpdateMovingExpenseHandler interface for that can handle valid update moving expense params -type UpdateMovingExpenseHandler interface { - Handle(UpdateMovingExpenseParams) middleware.Responder -} - -// NewUpdateMovingExpense creates a new http.Handler for the update moving expense operation -func NewUpdateMovingExpense(ctx *middleware.Context, handler UpdateMovingExpenseHandler) *UpdateMovingExpense { - return &UpdateMovingExpense{Context: ctx, Handler: handler} -} - -/* - UpdateMovingExpense swagger:route PATCH /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm updateMovingExpense - -# Updates the moving expense - -Any fields sent in this request will be set on the moving expense referenced -*/ -type UpdateMovingExpense struct { - Context *middleware.Context - Handler UpdateMovingExpenseHandler -} - -func (o *UpdateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMovingExpenseParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go deleted file mode 100644 index 0b1a0b78714..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateMovingExpenseParams creates a new UpdateMovingExpenseParams object -// -// There are no default values defined in the spec. -func NewUpdateMovingExpenseParams() UpdateMovingExpenseParams { - - return UpdateMovingExpenseParams{} -} - -// UpdateMovingExpenseParams contains all the bound params for the update moving expense operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMovingExpense -type UpdateMovingExpenseParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the moving expense - Required: true - In: path - */ - MovingExpenseID strfmt.UUID - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - UpdateMovingExpense *internalmessages.UpdateMovingExpense -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMovingExpenseParams() beforehand. -func (o *UpdateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") - if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateMovingExpense - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateMovingExpense", "body", "")) - } else { - res = append(res, errors.NewParseError("updateMovingExpense", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateMovingExpense = &body - } - } - } else { - res = append(res, errors.Required("updateMovingExpense", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMovingExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. -func (o *UpdateMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) - } - o.MovingExpenseID = *(value.(*strfmt.UUID)) - - if err := o.validateMovingExpenseID(formats); err != nil { - return err - } - - return nil -} - -// validateMovingExpenseID carries on validations for parameter MovingExpenseID -func (o *UpdateMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { - - if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go deleted file mode 100644 index ce0d0c445c6..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateMovingExpenseOKCode is the HTTP code returned for type UpdateMovingExpenseOK -const UpdateMovingExpenseOKCode int = 200 - -/* -UpdateMovingExpenseOK returns an updated moving expense object - -swagger:response updateMovingExpenseOK -*/ -type UpdateMovingExpenseOK struct { - - /* - In: Body - */ - Payload *internalmessages.MovingExpense `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseOK creates UpdateMovingExpenseOK with default headers values -func NewUpdateMovingExpenseOK() *UpdateMovingExpenseOK { - - return &UpdateMovingExpenseOK{} -} - -// WithPayload adds the payload to the update moving expense o k response -func (o *UpdateMovingExpenseOK) WithPayload(payload *internalmessages.MovingExpense) *UpdateMovingExpenseOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense o k response -func (o *UpdateMovingExpenseOK) SetPayload(payload *internalmessages.MovingExpense) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseBadRequestCode is the HTTP code returned for type UpdateMovingExpenseBadRequest -const UpdateMovingExpenseBadRequestCode int = 400 - -/* -UpdateMovingExpenseBadRequest The request payload is invalid. - -swagger:response updateMovingExpenseBadRequest -*/ -type UpdateMovingExpenseBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseBadRequest creates UpdateMovingExpenseBadRequest with default headers values -func NewUpdateMovingExpenseBadRequest() *UpdateMovingExpenseBadRequest { - - return &UpdateMovingExpenseBadRequest{} -} - -// WithPayload adds the payload to the update moving expense bad request response -func (o *UpdateMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense bad request response -func (o *UpdateMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseUnauthorizedCode is the HTTP code returned for type UpdateMovingExpenseUnauthorized -const UpdateMovingExpenseUnauthorizedCode int = 401 - -/* -UpdateMovingExpenseUnauthorized The request was denied. - -swagger:response updateMovingExpenseUnauthorized -*/ -type UpdateMovingExpenseUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseUnauthorized creates UpdateMovingExpenseUnauthorized with default headers values -func NewUpdateMovingExpenseUnauthorized() *UpdateMovingExpenseUnauthorized { - - return &UpdateMovingExpenseUnauthorized{} -} - -// WithPayload adds the payload to the update moving expense unauthorized response -func (o *UpdateMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense unauthorized response -func (o *UpdateMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseForbiddenCode is the HTTP code returned for type UpdateMovingExpenseForbidden -const UpdateMovingExpenseForbiddenCode int = 403 - -/* -UpdateMovingExpenseForbidden The request was denied. - -swagger:response updateMovingExpenseForbidden -*/ -type UpdateMovingExpenseForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseForbidden creates UpdateMovingExpenseForbidden with default headers values -func NewUpdateMovingExpenseForbidden() *UpdateMovingExpenseForbidden { - - return &UpdateMovingExpenseForbidden{} -} - -// WithPayload adds the payload to the update moving expense forbidden response -func (o *UpdateMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense forbidden response -func (o *UpdateMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseNotFoundCode is the HTTP code returned for type UpdateMovingExpenseNotFound -const UpdateMovingExpenseNotFoundCode int = 404 - -/* -UpdateMovingExpenseNotFound The requested resource wasn't found. - -swagger:response updateMovingExpenseNotFound -*/ -type UpdateMovingExpenseNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseNotFound creates UpdateMovingExpenseNotFound with default headers values -func NewUpdateMovingExpenseNotFound() *UpdateMovingExpenseNotFound { - - return &UpdateMovingExpenseNotFound{} -} - -// WithPayload adds the payload to the update moving expense not found response -func (o *UpdateMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense not found response -func (o *UpdateMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpensePreconditionFailedCode is the HTTP code returned for type UpdateMovingExpensePreconditionFailed -const UpdateMovingExpensePreconditionFailedCode int = 412 - -/* -UpdateMovingExpensePreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMovingExpensePreconditionFailed -*/ -type UpdateMovingExpensePreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMovingExpensePreconditionFailed creates UpdateMovingExpensePreconditionFailed with default headers values -func NewUpdateMovingExpensePreconditionFailed() *UpdateMovingExpensePreconditionFailed { - - return &UpdateMovingExpensePreconditionFailed{} -} - -// WithPayload adds the payload to the update moving expense precondition failed response -func (o *UpdateMovingExpensePreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpensePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense precondition failed response -func (o *UpdateMovingExpensePreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateMovingExpenseUnprocessableEntity -const UpdateMovingExpenseUnprocessableEntityCode int = 422 - -/* -UpdateMovingExpenseUnprocessableEntity The payload was unprocessable. - -swagger:response updateMovingExpenseUnprocessableEntity -*/ -type UpdateMovingExpenseUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseUnprocessableEntity creates UpdateMovingExpenseUnprocessableEntity with default headers values -func NewUpdateMovingExpenseUnprocessableEntity() *UpdateMovingExpenseUnprocessableEntity { - - return &UpdateMovingExpenseUnprocessableEntity{} -} - -// WithPayload adds the payload to the update moving expense unprocessable entity response -func (o *UpdateMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateMovingExpenseUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense unprocessable entity response -func (o *UpdateMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMovingExpenseInternalServerErrorCode is the HTTP code returned for type UpdateMovingExpenseInternalServerError -const UpdateMovingExpenseInternalServerErrorCode int = 500 - -/* -UpdateMovingExpenseInternalServerError A server error occurred. - -swagger:response updateMovingExpenseInternalServerError -*/ -type UpdateMovingExpenseInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMovingExpenseInternalServerError creates UpdateMovingExpenseInternalServerError with default headers values -func NewUpdateMovingExpenseInternalServerError() *UpdateMovingExpenseInternalServerError { - - return &UpdateMovingExpenseInternalServerError{} -} - -// WithPayload adds the payload to the update moving expense internal server error response -func (o *UpdateMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateMovingExpenseInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update moving expense internal server error response -func (o *UpdateMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go deleted file mode 100644 index b204b455e5f..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMovingExpenseURL generates an URL for the update moving expense operation -type UpdateMovingExpenseURL struct { - MovingExpenseID strfmt.UUID - PpmShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMovingExpenseURL) WithBasePath(bp string) *UpdateMovingExpenseURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMovingExpenseURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMovingExpenseURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" - - movingExpenseID := o.MovingExpenseID.String() - if movingExpenseID != "" { - _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) - } else { - return nil, errors.New("movingExpenseId is required on UpdateMovingExpenseURL") - } - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateMovingExpenseURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMovingExpenseURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMovingExpenseURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMovingExpenseURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMovingExpenseURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go deleted file mode 100644 index 548bc7605a1..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateProGearWeightTicketHandlerFunc turns a function with the right signature into a update pro gear weight ticket handler -type UpdateProGearWeightTicketHandlerFunc func(UpdateProGearWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateProGearWeightTicketHandlerFunc) Handle(params UpdateProGearWeightTicketParams) middleware.Responder { - return fn(params) -} - -// UpdateProGearWeightTicketHandler interface for that can handle valid update pro gear weight ticket params -type UpdateProGearWeightTicketHandler interface { - Handle(UpdateProGearWeightTicketParams) middleware.Responder -} - -// NewUpdateProGearWeightTicket creates a new http.Handler for the update pro gear weight ticket operation -func NewUpdateProGearWeightTicket(ctx *middleware.Context, handler UpdateProGearWeightTicketHandler) *UpdateProGearWeightTicket { - return &UpdateProGearWeightTicket{Context: ctx, Handler: handler} -} - -/* - UpdateProGearWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm updateProGearWeightTicket - -# Updates a pro-gear weight ticket - -Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable -because some have to be set by the customer, e.g. the description. -*/ -type UpdateProGearWeightTicket struct { - Context *middleware.Context - Handler UpdateProGearWeightTicketHandler -} - -func (o *UpdateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateProGearWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go deleted file mode 100644 index f5927cf3783..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateProGearWeightTicketParams creates a new UpdateProGearWeightTicketParams object -// -// There are no default values defined in the spec. -func NewUpdateProGearWeightTicketParams() UpdateProGearWeightTicketParams { - - return UpdateProGearWeightTicketParams{} -} - -// UpdateProGearWeightTicketParams contains all the bound params for the update pro gear weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateProGearWeightTicket -type UpdateProGearWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /*UUID of the pro-gear weight ticket - Required: true - In: path - */ - ProGearWeightTicketID strfmt.UUID - /* - Required: true - In: body - */ - UpdateProGearWeightTicket *internalmessages.UpdateProGearWeightTicket -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateProGearWeightTicketParams() beforehand. -func (o *UpdateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") - if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateProGearWeightTicket - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) - } else { - res = append(res, errors.NewParseError("updateProGearWeightTicket", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateProGearWeightTicket = &body - } - } - } else { - res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateProGearWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. -func (o *UpdateProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) - } - o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateProGearWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID -func (o *UpdateProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go deleted file mode 100644 index 6c3fe4ddbe8..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateProGearWeightTicketOKCode is the HTTP code returned for type UpdateProGearWeightTicketOK -const UpdateProGearWeightTicketOKCode int = 200 - -/* -UpdateProGearWeightTicketOK returns an updated pro-gear weight ticket object - -swagger:response updateProGearWeightTicketOK -*/ -type UpdateProGearWeightTicketOK struct { - - /* - In: Body - */ - Payload *internalmessages.ProGearWeightTicket `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketOK creates UpdateProGearWeightTicketOK with default headers values -func NewUpdateProGearWeightTicketOK() *UpdateProGearWeightTicketOK { - - return &UpdateProGearWeightTicketOK{} -} - -// WithPayload adds the payload to the update pro gear weight ticket o k response -func (o *UpdateProGearWeightTicketOK) WithPayload(payload *internalmessages.ProGearWeightTicket) *UpdateProGearWeightTicketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket o k response -func (o *UpdateProGearWeightTicketOK) SetPayload(payload *internalmessages.ProGearWeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketBadRequestCode is the HTTP code returned for type UpdateProGearWeightTicketBadRequest -const UpdateProGearWeightTicketBadRequestCode int = 400 - -/* -UpdateProGearWeightTicketBadRequest The request payload is invalid. - -swagger:response updateProGearWeightTicketBadRequest -*/ -type UpdateProGearWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketBadRequest creates UpdateProGearWeightTicketBadRequest with default headers values -func NewUpdateProGearWeightTicketBadRequest() *UpdateProGearWeightTicketBadRequest { - - return &UpdateProGearWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the update pro gear weight ticket bad request response -func (o *UpdateProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket bad request response -func (o *UpdateProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateProGearWeightTicketUnauthorized -const UpdateProGearWeightTicketUnauthorizedCode int = 401 - -/* -UpdateProGearWeightTicketUnauthorized The request was denied. - -swagger:response updateProGearWeightTicketUnauthorized -*/ -type UpdateProGearWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketUnauthorized creates UpdateProGearWeightTicketUnauthorized with default headers values -func NewUpdateProGearWeightTicketUnauthorized() *UpdateProGearWeightTicketUnauthorized { - - return &UpdateProGearWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the update pro gear weight ticket unauthorized response -func (o *UpdateProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket unauthorized response -func (o *UpdateProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketForbiddenCode is the HTTP code returned for type UpdateProGearWeightTicketForbidden -const UpdateProGearWeightTicketForbiddenCode int = 403 - -/* -UpdateProGearWeightTicketForbidden The request was denied. - -swagger:response updateProGearWeightTicketForbidden -*/ -type UpdateProGearWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketForbidden creates UpdateProGearWeightTicketForbidden with default headers values -func NewUpdateProGearWeightTicketForbidden() *UpdateProGearWeightTicketForbidden { - - return &UpdateProGearWeightTicketForbidden{} -} - -// WithPayload adds the payload to the update pro gear weight ticket forbidden response -func (o *UpdateProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket forbidden response -func (o *UpdateProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketNotFoundCode is the HTTP code returned for type UpdateProGearWeightTicketNotFound -const UpdateProGearWeightTicketNotFoundCode int = 404 - -/* -UpdateProGearWeightTicketNotFound The requested resource wasn't found. - -swagger:response updateProGearWeightTicketNotFound -*/ -type UpdateProGearWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketNotFound creates UpdateProGearWeightTicketNotFound with default headers values -func NewUpdateProGearWeightTicketNotFound() *UpdateProGearWeightTicketNotFound { - - return &UpdateProGearWeightTicketNotFound{} -} - -// WithPayload adds the payload to the update pro gear weight ticket not found response -func (o *UpdateProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket not found response -func (o *UpdateProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateProGearWeightTicketPreconditionFailed -const UpdateProGearWeightTicketPreconditionFailedCode int = 412 - -/* -UpdateProGearWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateProGearWeightTicketPreconditionFailed -*/ -type UpdateProGearWeightTicketPreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketPreconditionFailed creates UpdateProGearWeightTicketPreconditionFailed with default headers values -func NewUpdateProGearWeightTicketPreconditionFailed() *UpdateProGearWeightTicketPreconditionFailed { - - return &UpdateProGearWeightTicketPreconditionFailed{} -} - -// WithPayload adds the payload to the update pro gear weight ticket precondition failed response -func (o *UpdateProGearWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket precondition failed response -func (o *UpdateProGearWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateProGearWeightTicketUnprocessableEntity -const UpdateProGearWeightTicketUnprocessableEntityCode int = 422 - -/* -UpdateProGearWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response updateProGearWeightTicketUnprocessableEntity -*/ -type UpdateProGearWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketUnprocessableEntity creates UpdateProGearWeightTicketUnprocessableEntity with default headers values -func NewUpdateProGearWeightTicketUnprocessableEntity() *UpdateProGearWeightTicketUnprocessableEntity { - - return &UpdateProGearWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the update pro gear weight ticket unprocessable entity response -func (o *UpdateProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateProGearWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket unprocessable entity response -func (o *UpdateProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateProGearWeightTicketInternalServerError -const UpdateProGearWeightTicketInternalServerErrorCode int = 500 - -/* -UpdateProGearWeightTicketInternalServerError A server error occurred. - -swagger:response updateProGearWeightTicketInternalServerError -*/ -type UpdateProGearWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewUpdateProGearWeightTicketInternalServerError creates UpdateProGearWeightTicketInternalServerError with default headers values -func NewUpdateProGearWeightTicketInternalServerError() *UpdateProGearWeightTicketInternalServerError { - - return &UpdateProGearWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the update pro gear weight ticket internal server error response -func (o *UpdateProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateProGearWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update pro gear weight ticket internal server error response -func (o *UpdateProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go deleted file mode 100644 index d11310fb2c5..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateProGearWeightTicketURL generates an URL for the update pro gear weight ticket operation -type UpdateProGearWeightTicketURL struct { - PpmShipmentID strfmt.UUID - ProGearWeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateProGearWeightTicketURL) WithBasePath(bp string) *UpdateProGearWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateProGearWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateProGearWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateProGearWeightTicketURL") - } - - proGearWeightTicketID := o.ProGearWeightTicketID.String() - if proGearWeightTicketID != "" { - _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) - } else { - return nil, errors.New("proGearWeightTicketId is required on UpdateProGearWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateProGearWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateProGearWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateProGearWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateProGearWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go deleted file mode 100644 index f7cd3b3d30b..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateWeightTicketHandlerFunc turns a function with the right signature into a update weight ticket handler -type UpdateWeightTicketHandlerFunc func(UpdateWeightTicketParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateWeightTicketHandlerFunc) Handle(params UpdateWeightTicketParams) middleware.Responder { - return fn(params) -} - -// UpdateWeightTicketHandler interface for that can handle valid update weight ticket params -type UpdateWeightTicketHandler interface { - Handle(UpdateWeightTicketParams) middleware.Responder -} - -// NewUpdateWeightTicket creates a new http.Handler for the update weight ticket operation -func NewUpdateWeightTicket(ctx *middleware.Context, handler UpdateWeightTicketHandler) *UpdateWeightTicket { - return &UpdateWeightTicket{Context: ctx, Handler: handler} -} - -/* - UpdateWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm updateWeightTicket - -# Updates a weight ticket document - -Updates a weight ticket document with the new information -*/ -type UpdateWeightTicket struct { - Context *middleware.Context - Handler UpdateWeightTicketHandler -} - -func (o *UpdateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateWeightTicketParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go deleted file mode 100644 index 7600fb72fd4..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewUpdateWeightTicketParams creates a new UpdateWeightTicketParams object -// -// There are no default values defined in the spec. -func NewUpdateWeightTicketParams() UpdateWeightTicketParams { - - return UpdateWeightTicketParams{} -} - -// UpdateWeightTicketParams contains all the bound params for the update weight ticket operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateWeightTicket -type UpdateWeightTicketParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the PPM shipment - Required: true - In: path - */ - PpmShipmentID strfmt.UUID - /* - Required: true - In: body - */ - UpdateWeightTicketPayload *internalmessages.UpdateWeightTicket - /*UUID of the weight ticket - Required: true - In: path - */ - WeightTicketID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateWeightTicketParams() beforehand. -func (o *UpdateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") - if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.UpdateWeightTicket - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("updateWeightTicketPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.UpdateWeightTicketPayload = &body - } - } - } else { - res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) - } - - rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") - if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. -func (o *UpdateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) - } - o.PpmShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validatePpmShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmShipmentID carries on validations for parameter PpmShipmentID -func (o *UpdateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindWeightTicketID binds and validates parameter WeightTicketID from path. -func (o *UpdateWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) - } - o.WeightTicketID = *(value.(*strfmt.UUID)) - - if err := o.validateWeightTicketID(formats); err != nil { - return err - } - - return nil -} - -// validateWeightTicketID carries on validations for parameter WeightTicketID -func (o *UpdateWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { - - if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go deleted file mode 100644 index f4f8e859fae..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// UpdateWeightTicketOKCode is the HTTP code returned for type UpdateWeightTicketOK -const UpdateWeightTicketOKCode int = 200 - -/* -UpdateWeightTicketOK returns an updated weight ticket object - -swagger:response updateWeightTicketOK -*/ -type UpdateWeightTicketOK struct { - - /* - In: Body - */ - Payload *internalmessages.WeightTicket `json:"body,omitempty"` -} - -// NewUpdateWeightTicketOK creates UpdateWeightTicketOK with default headers values -func NewUpdateWeightTicketOK() *UpdateWeightTicketOK { - - return &UpdateWeightTicketOK{} -} - -// WithPayload adds the payload to the update weight ticket o k response -func (o *UpdateWeightTicketOK) WithPayload(payload *internalmessages.WeightTicket) *UpdateWeightTicketOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket o k response -func (o *UpdateWeightTicketOK) SetPayload(payload *internalmessages.WeightTicket) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketBadRequestCode is the HTTP code returned for type UpdateWeightTicketBadRequest -const UpdateWeightTicketBadRequestCode int = 400 - -/* -UpdateWeightTicketBadRequest The request payload is invalid. - -swagger:response updateWeightTicketBadRequest -*/ -type UpdateWeightTicketBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketBadRequest creates UpdateWeightTicketBadRequest with default headers values -func NewUpdateWeightTicketBadRequest() *UpdateWeightTicketBadRequest { - - return &UpdateWeightTicketBadRequest{} -} - -// WithPayload adds the payload to the update weight ticket bad request response -func (o *UpdateWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket bad request response -func (o *UpdateWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateWeightTicketUnauthorized -const UpdateWeightTicketUnauthorizedCode int = 401 - -/* -UpdateWeightTicketUnauthorized The request was denied. - -swagger:response updateWeightTicketUnauthorized -*/ -type UpdateWeightTicketUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketUnauthorized creates UpdateWeightTicketUnauthorized with default headers values -func NewUpdateWeightTicketUnauthorized() *UpdateWeightTicketUnauthorized { - - return &UpdateWeightTicketUnauthorized{} -} - -// WithPayload adds the payload to the update weight ticket unauthorized response -func (o *UpdateWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket unauthorized response -func (o *UpdateWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketForbiddenCode is the HTTP code returned for type UpdateWeightTicketForbidden -const UpdateWeightTicketForbiddenCode int = 403 - -/* -UpdateWeightTicketForbidden The request was denied. - -swagger:response updateWeightTicketForbidden -*/ -type UpdateWeightTicketForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketForbidden creates UpdateWeightTicketForbidden with default headers values -func NewUpdateWeightTicketForbidden() *UpdateWeightTicketForbidden { - - return &UpdateWeightTicketForbidden{} -} - -// WithPayload adds the payload to the update weight ticket forbidden response -func (o *UpdateWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket forbidden response -func (o *UpdateWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketNotFoundCode is the HTTP code returned for type UpdateWeightTicketNotFound -const UpdateWeightTicketNotFoundCode int = 404 - -/* -UpdateWeightTicketNotFound The requested resource wasn't found. - -swagger:response updateWeightTicketNotFound -*/ -type UpdateWeightTicketNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketNotFound creates UpdateWeightTicketNotFound with default headers values -func NewUpdateWeightTicketNotFound() *UpdateWeightTicketNotFound { - - return &UpdateWeightTicketNotFound{} -} - -// WithPayload adds the payload to the update weight ticket not found response -func (o *UpdateWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket not found response -func (o *UpdateWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateWeightTicketPreconditionFailed -const UpdateWeightTicketPreconditionFailedCode int = 412 - -/* -UpdateWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateWeightTicketPreconditionFailed -*/ -type UpdateWeightTicketPreconditionFailed struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketPreconditionFailed creates UpdateWeightTicketPreconditionFailed with default headers values -func NewUpdateWeightTicketPreconditionFailed() *UpdateWeightTicketPreconditionFailed { - - return &UpdateWeightTicketPreconditionFailed{} -} - -// WithPayload adds the payload to the update weight ticket precondition failed response -func (o *UpdateWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket precondition failed response -func (o *UpdateWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateWeightTicketUnprocessableEntity -const UpdateWeightTicketUnprocessableEntityCode int = 422 - -/* -UpdateWeightTicketUnprocessableEntity The payload was unprocessable. - -swagger:response updateWeightTicketUnprocessableEntity -*/ -type UpdateWeightTicketUnprocessableEntity struct { - - /* - In: Body - */ - Payload *internalmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateWeightTicketUnprocessableEntity creates UpdateWeightTicketUnprocessableEntity with default headers values -func NewUpdateWeightTicketUnprocessableEntity() *UpdateWeightTicketUnprocessableEntity { - - return &UpdateWeightTicketUnprocessableEntity{} -} - -// WithPayload adds the payload to the update weight ticket unprocessable entity response -func (o *UpdateWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateWeightTicketUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket unprocessable entity response -func (o *UpdateWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateWeightTicketInternalServerError -const UpdateWeightTicketInternalServerErrorCode int = 500 - -/* -UpdateWeightTicketInternalServerError A server error occurred. - -swagger:response updateWeightTicketInternalServerError -*/ -type UpdateWeightTicketInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewUpdateWeightTicketInternalServerError creates UpdateWeightTicketInternalServerError with default headers values -func NewUpdateWeightTicketInternalServerError() *UpdateWeightTicketInternalServerError { - - return &UpdateWeightTicketInternalServerError{} -} - -// WithPayload adds the payload to the update weight ticket internal server error response -func (o *UpdateWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateWeightTicketInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update weight ticket internal server error response -func (o *UpdateWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go deleted file mode 100644 index c7798fe5936..00000000000 --- a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ppm - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateWeightTicketURL generates an URL for the update weight ticket operation -type UpdateWeightTicketURL struct { - PpmShipmentID strfmt.UUID - WeightTicketID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWeightTicketURL) WithBasePath(bp string) *UpdateWeightTicketURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateWeightTicketURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateWeightTicketURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" - - ppmShipmentID := o.PpmShipmentID.String() - if ppmShipmentID != "" { - _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) - } else { - return nil, errors.New("ppmShipmentId is required on UpdateWeightTicketURL") - } - - weightTicketID := o.WeightTicketID.String() - if weightTicketID != "" { - _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) - } else { - return nil, errors.New("weightTicketId is required on UpdateWeightTicketURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateWeightTicketURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateWeightTicketURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateWeightTicketURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateWeightTicketURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateWeightTicketURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue.go b/pkg/gen/internalapi/internaloperations/queues/show_queue.go deleted file mode 100644 index 6ab35bab19e..00000000000 --- a/pkg/gen/internalapi/internaloperations/queues/show_queue.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowQueueHandlerFunc turns a function with the right signature into a show queue handler -type ShowQueueHandlerFunc func(ShowQueueParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowQueueHandlerFunc) Handle(params ShowQueueParams) middleware.Responder { - return fn(params) -} - -// ShowQueueHandler interface for that can handle valid show queue params -type ShowQueueHandler interface { - Handle(ShowQueueParams) middleware.Responder -} - -// NewShowQueue creates a new http.Handler for the show queue operation -func NewShowQueue(ctx *middleware.Context, handler ShowQueueHandler) *ShowQueue { - return &ShowQueue{Context: ctx, Handler: handler} -} - -/* - ShowQueue swagger:route GET /queues/{queueType} queues showQueue - -# Show all moves in a queue - -Show all moves in a queue -*/ -type ShowQueue struct { - Context *middleware.Context - Handler ShowQueueHandler -} - -func (o *ShowQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowQueueParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go deleted file mode 100644 index 7c572657f80..00000000000 --- a/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowQueueParams creates a new ShowQueueParams object -// -// There are no default values defined in the spec. -func NewShowQueueParams() ShowQueueParams { - - return ShowQueueParams{} -} - -// ShowQueueParams contains all the bound params for the show queue operation -// typically these are obtained from a http.Request -// -// swagger:parameters showQueue -type ShowQueueParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Queue type to show - Required: true - In: path - */ - QueueType string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowQueueParams() beforehand. -func (o *ShowQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rQueueType, rhkQueueType, _ := route.Params.GetOK("queueType") - if err := o.bindQueueType(rQueueType, rhkQueueType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindQueueType binds and validates parameter QueueType from path. -func (o *ShowQueueParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.QueueType = raw - - if err := o.validateQueueType(formats); err != nil { - return err - } - - return nil -} - -// validateQueueType carries on validations for parameter QueueType -func (o *ShowQueueParams) validateQueueType(formats strfmt.Registry) error { - - if err := validate.EnumCase("queueType", "path", o.QueueType, []interface{}{"new", "ppm_payment_requested", "all", "ppm_approved", "ppm_completed"}, true); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go deleted file mode 100644 index 6c2c16aefa1..00000000000 --- a/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowQueueOKCode is the HTTP code returned for type ShowQueueOK -const ShowQueueOKCode int = 200 - -/* -ShowQueueOK list all moves in the specified queue - -swagger:response showQueueOK -*/ -type ShowQueueOK struct { - - /* - In: Body - */ - Payload []*internalmessages.MoveQueueItem `json:"body,omitempty"` -} - -// NewShowQueueOK creates ShowQueueOK with default headers values -func NewShowQueueOK() *ShowQueueOK { - - return &ShowQueueOK{} -} - -// WithPayload adds the payload to the show queue o k response -func (o *ShowQueueOK) WithPayload(payload []*internalmessages.MoveQueueItem) *ShowQueueOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show queue o k response -func (o *ShowQueueOK) SetPayload(payload []*internalmessages.MoveQueueItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = make([]*internalmessages.MoveQueueItem, 0, 50) - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowQueueBadRequestCode is the HTTP code returned for type ShowQueueBadRequest -const ShowQueueBadRequestCode int = 400 - -/* -ShowQueueBadRequest invalid request - -swagger:response showQueueBadRequest -*/ -type ShowQueueBadRequest struct { -} - -// NewShowQueueBadRequest creates ShowQueueBadRequest with default headers values -func NewShowQueueBadRequest() *ShowQueueBadRequest { - - return &ShowQueueBadRequest{} -} - -// WriteResponse to the client -func (o *ShowQueueBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowQueueUnauthorizedCode is the HTTP code returned for type ShowQueueUnauthorized -const ShowQueueUnauthorizedCode int = 401 - -/* -ShowQueueUnauthorized request requires user authentication - -swagger:response showQueueUnauthorized -*/ -type ShowQueueUnauthorized struct { -} - -// NewShowQueueUnauthorized creates ShowQueueUnauthorized with default headers values -func NewShowQueueUnauthorized() *ShowQueueUnauthorized { - - return &ShowQueueUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowQueueUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowQueueForbiddenCode is the HTTP code returned for type ShowQueueForbidden -const ShowQueueForbiddenCode int = 403 - -/* -ShowQueueForbidden user is not authorized to access this queue - -swagger:response showQueueForbidden -*/ -type ShowQueueForbidden struct { -} - -// NewShowQueueForbidden creates ShowQueueForbidden with default headers values -func NewShowQueueForbidden() *ShowQueueForbidden { - - return &ShowQueueForbidden{} -} - -// WriteResponse to the client -func (o *ShowQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowQueueNotFoundCode is the HTTP code returned for type ShowQueueNotFound -const ShowQueueNotFoundCode int = 404 - -/* -ShowQueueNotFound move queue item is not found - -swagger:response showQueueNotFound -*/ -type ShowQueueNotFound struct { -} - -// NewShowQueueNotFound creates ShowQueueNotFound with default headers values -func NewShowQueueNotFound() *ShowQueueNotFound { - - return &ShowQueueNotFound{} -} - -// WriteResponse to the client -func (o *ShowQueueNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go deleted file mode 100644 index b54100fe254..00000000000 --- a/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// ShowQueueURL generates an URL for the show queue operation -type ShowQueueURL struct { - QueueType string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowQueueURL) WithBasePath(bp string) *ShowQueueURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowQueueURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowQueueURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/{queueType}" - - queueType := o.QueueType - if queueType != "" { - _path = strings.Replace(_path, "{queueType}", queueType, -1) - } else { - return nil, errors.New("queueType is required on ShowQueueURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowQueueURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowQueueURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowQueueURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowQueueURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowQueueURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowQueueURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go deleted file mode 100644 index f6647f71943..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServiceMemberHandlerFunc turns a function with the right signature into a create service member handler -type CreateServiceMemberHandlerFunc func(CreateServiceMemberParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServiceMemberHandlerFunc) Handle(params CreateServiceMemberParams) middleware.Responder { - return fn(params) -} - -// CreateServiceMemberHandler interface for that can handle valid create service member params -type CreateServiceMemberHandler interface { - Handle(CreateServiceMemberParams) middleware.Responder -} - -// NewCreateServiceMember creates a new http.Handler for the create service member operation -func NewCreateServiceMember(ctx *middleware.Context, handler CreateServiceMemberHandler) *CreateServiceMember { - return &CreateServiceMember{Context: ctx, Handler: handler} -} - -/* - CreateServiceMember swagger:route POST /service_members service_members createServiceMember - -# Creates service member for a logged-in user - -Creates an instance of a service member tied to a user -*/ -type CreateServiceMember struct { - Context *middleware.Context - Handler CreateServiceMemberHandler -} - -func (o *CreateServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServiceMemberParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go deleted file mode 100644 index 7c4e2d774cf..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewCreateServiceMemberParams creates a new CreateServiceMemberParams object -// -// There are no default values defined in the spec. -func NewCreateServiceMemberParams() CreateServiceMemberParams { - - return CreateServiceMemberParams{} -} - -// CreateServiceMemberParams contains all the bound params for the create service member operation -// typically these are obtained from a http.Request -// -// swagger:parameters createServiceMember -type CreateServiceMemberParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - CreateServiceMemberPayload *internalmessages.CreateServiceMemberPayload -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServiceMemberParams() beforehand. -func (o *CreateServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.CreateServiceMemberPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("createServiceMemberPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("createServiceMemberPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.CreateServiceMemberPayload = &body - } - } - } else { - res = append(res, errors.Required("createServiceMemberPayload", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go deleted file mode 100644 index da5e7cadda2..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateServiceMemberCreatedCode is the HTTP code returned for type CreateServiceMemberCreated -const CreateServiceMemberCreatedCode int = 201 - -/* -CreateServiceMemberCreated created instance of service member - -swagger:response createServiceMemberCreated -*/ -type CreateServiceMemberCreated struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` -} - -// NewCreateServiceMemberCreated creates CreateServiceMemberCreated with default headers values -func NewCreateServiceMemberCreated() *CreateServiceMemberCreated { - - return &CreateServiceMemberCreated{} -} - -// WithPayload adds the payload to the create service member created response -func (o *CreateServiceMemberCreated) WithPayload(payload *internalmessages.ServiceMemberPayload) *CreateServiceMemberCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service member created response -func (o *CreateServiceMemberCreated) SetPayload(payload *internalmessages.ServiceMemberPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceMemberCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceMemberBadRequestCode is the HTTP code returned for type CreateServiceMemberBadRequest -const CreateServiceMemberBadRequestCode int = 400 - -/* -CreateServiceMemberBadRequest invalid request - -swagger:response createServiceMemberBadRequest -*/ -type CreateServiceMemberBadRequest struct { -} - -// NewCreateServiceMemberBadRequest creates CreateServiceMemberBadRequest with default headers values -func NewCreateServiceMemberBadRequest() *CreateServiceMemberBadRequest { - - return &CreateServiceMemberBadRequest{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// CreateServiceMemberUnauthorizedCode is the HTTP code returned for type CreateServiceMemberUnauthorized -const CreateServiceMemberUnauthorizedCode int = 401 - -/* -CreateServiceMemberUnauthorized request requires user authentication - -swagger:response createServiceMemberUnauthorized -*/ -type CreateServiceMemberUnauthorized struct { -} - -// NewCreateServiceMemberUnauthorized creates CreateServiceMemberUnauthorized with default headers values -func NewCreateServiceMemberUnauthorized() *CreateServiceMemberUnauthorized { - - return &CreateServiceMemberUnauthorized{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// CreateServiceMemberForbiddenCode is the HTTP code returned for type CreateServiceMemberForbidden -const CreateServiceMemberForbiddenCode int = 403 - -/* -CreateServiceMemberForbidden user is not authorized - -swagger:response createServiceMemberForbidden -*/ -type CreateServiceMemberForbidden struct { -} - -// NewCreateServiceMemberForbidden creates CreateServiceMemberForbidden with default headers values -func NewCreateServiceMemberForbidden() *CreateServiceMemberForbidden { - - return &CreateServiceMemberForbidden{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateServiceMemberNotFoundCode is the HTTP code returned for type CreateServiceMemberNotFound -const CreateServiceMemberNotFoundCode int = 404 - -/* -CreateServiceMemberNotFound service member not found - -swagger:response createServiceMemberNotFound -*/ -type CreateServiceMemberNotFound struct { -} - -// NewCreateServiceMemberNotFound creates CreateServiceMemberNotFound with default headers values -func NewCreateServiceMemberNotFound() *CreateServiceMemberNotFound { - - return &CreateServiceMemberNotFound{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// CreateServiceMemberInternalServerErrorCode is the HTTP code returned for type CreateServiceMemberInternalServerError -const CreateServiceMemberInternalServerErrorCode int = 500 - -/* -CreateServiceMemberInternalServerError internal server error - -swagger:response createServiceMemberInternalServerError -*/ -type CreateServiceMemberInternalServerError struct { -} - -// NewCreateServiceMemberInternalServerError creates CreateServiceMemberInternalServerError with default headers values -func NewCreateServiceMemberInternalServerError() *CreateServiceMemberInternalServerError { - - return &CreateServiceMemberInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go deleted file mode 100644 index f30b19fa2e8..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateServiceMemberURL generates an URL for the create service member operation -type CreateServiceMemberURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceMemberURL) WithBasePath(bp string) *CreateServiceMemberURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceMemberURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServiceMemberURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServiceMemberURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServiceMemberURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServiceMemberURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServiceMemberURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServiceMemberURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go deleted file mode 100644 index d773795c107..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// PatchServiceMemberHandlerFunc turns a function with the right signature into a patch service member handler -type PatchServiceMemberHandlerFunc func(PatchServiceMemberParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn PatchServiceMemberHandlerFunc) Handle(params PatchServiceMemberParams) middleware.Responder { - return fn(params) -} - -// PatchServiceMemberHandler interface for that can handle valid patch service member params -type PatchServiceMemberHandler interface { - Handle(PatchServiceMemberParams) middleware.Responder -} - -// NewPatchServiceMember creates a new http.Handler for the patch service member operation -func NewPatchServiceMember(ctx *middleware.Context, handler PatchServiceMemberHandler) *PatchServiceMember { - return &PatchServiceMember{Context: ctx, Handler: handler} -} - -/* - PatchServiceMember swagger:route PATCH /service_members/{serviceMemberId} service_members patchServiceMember - -# Patches the service member - -Any fields sent in this request will be set on the service member referenced -*/ -type PatchServiceMember struct { - Context *middleware.Context - Handler PatchServiceMemberHandler -} - -func (o *PatchServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewPatchServiceMemberParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go deleted file mode 100644 index 2a86ba3ea99..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// NewPatchServiceMemberParams creates a new PatchServiceMemberParams object -// -// There are no default values defined in the spec. -func NewPatchServiceMemberParams() PatchServiceMemberParams { - - return PatchServiceMemberParams{} -} - -// PatchServiceMemberParams contains all the bound params for the patch service member operation -// typically these are obtained from a http.Request -// -// swagger:parameters patchServiceMember -type PatchServiceMemberParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - PatchServiceMemberPayload *internalmessages.PatchServiceMemberPayload - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewPatchServiceMemberParams() beforehand. -func (o *PatchServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body internalmessages.PatchServiceMemberPayload - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("patchServiceMemberPayload", "body", "")) - } else { - res = append(res, errors.NewParseError("patchServiceMemberPayload", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.PatchServiceMemberPayload = &body - } - } - } else { - res = append(res, errors.Required("patchServiceMemberPayload", "body", "")) - } - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *PatchServiceMemberParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *PatchServiceMemberParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go deleted file mode 100644 index 7465d40bb07..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// PatchServiceMemberOKCode is the HTTP code returned for type PatchServiceMemberOK -const PatchServiceMemberOKCode int = 200 - -/* -PatchServiceMemberOK updated instance of service member - -swagger:response patchServiceMemberOK -*/ -type PatchServiceMemberOK struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` -} - -// NewPatchServiceMemberOK creates PatchServiceMemberOK with default headers values -func NewPatchServiceMemberOK() *PatchServiceMemberOK { - - return &PatchServiceMemberOK{} -} - -// WithPayload adds the payload to the patch service member o k response -func (o *PatchServiceMemberOK) WithPayload(payload *internalmessages.ServiceMemberPayload) *PatchServiceMemberOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the patch service member o k response -func (o *PatchServiceMemberOK) SetPayload(payload *internalmessages.ServiceMemberPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *PatchServiceMemberOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// PatchServiceMemberBadRequestCode is the HTTP code returned for type PatchServiceMemberBadRequest -const PatchServiceMemberBadRequestCode int = 400 - -/* -PatchServiceMemberBadRequest invalid request - -swagger:response patchServiceMemberBadRequest -*/ -type PatchServiceMemberBadRequest struct { -} - -// NewPatchServiceMemberBadRequest creates PatchServiceMemberBadRequest with default headers values -func NewPatchServiceMemberBadRequest() *PatchServiceMemberBadRequest { - - return &PatchServiceMemberBadRequest{} -} - -// WriteResponse to the client -func (o *PatchServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// PatchServiceMemberUnauthorizedCode is the HTTP code returned for type PatchServiceMemberUnauthorized -const PatchServiceMemberUnauthorizedCode int = 401 - -/* -PatchServiceMemberUnauthorized request requires user authentication - -swagger:response patchServiceMemberUnauthorized -*/ -type PatchServiceMemberUnauthorized struct { -} - -// NewPatchServiceMemberUnauthorized creates PatchServiceMemberUnauthorized with default headers values -func NewPatchServiceMemberUnauthorized() *PatchServiceMemberUnauthorized { - - return &PatchServiceMemberUnauthorized{} -} - -// WriteResponse to the client -func (o *PatchServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// PatchServiceMemberForbiddenCode is the HTTP code returned for type PatchServiceMemberForbidden -const PatchServiceMemberForbiddenCode int = 403 - -/* -PatchServiceMemberForbidden user is not authorized - -swagger:response patchServiceMemberForbidden -*/ -type PatchServiceMemberForbidden struct { -} - -// NewPatchServiceMemberForbidden creates PatchServiceMemberForbidden with default headers values -func NewPatchServiceMemberForbidden() *PatchServiceMemberForbidden { - - return &PatchServiceMemberForbidden{} -} - -// WriteResponse to the client -func (o *PatchServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// PatchServiceMemberNotFoundCode is the HTTP code returned for type PatchServiceMemberNotFound -const PatchServiceMemberNotFoundCode int = 404 - -/* -PatchServiceMemberNotFound service member not found - -swagger:response patchServiceMemberNotFound -*/ -type PatchServiceMemberNotFound struct { -} - -// NewPatchServiceMemberNotFound creates PatchServiceMemberNotFound with default headers values -func NewPatchServiceMemberNotFound() *PatchServiceMemberNotFound { - - return &PatchServiceMemberNotFound{} -} - -// WriteResponse to the client -func (o *PatchServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// PatchServiceMemberInternalServerErrorCode is the HTTP code returned for type PatchServiceMemberInternalServerError -const PatchServiceMemberInternalServerErrorCode int = 500 - -/* -PatchServiceMemberInternalServerError internal server error - -swagger:response patchServiceMemberInternalServerError -*/ -type PatchServiceMemberInternalServerError struct { -} - -// NewPatchServiceMemberInternalServerError creates PatchServiceMemberInternalServerError with default headers values -func NewPatchServiceMemberInternalServerError() *PatchServiceMemberInternalServerError { - - return &PatchServiceMemberInternalServerError{} -} - -// WriteResponse to the client -func (o *PatchServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go deleted file mode 100644 index d94335f8755..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// PatchServiceMemberURL generates an URL for the patch service member operation -type PatchServiceMemberURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceMemberURL) WithBasePath(bp string) *PatchServiceMemberURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *PatchServiceMemberURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *PatchServiceMemberURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members/{serviceMemberId}" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on PatchServiceMemberURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *PatchServiceMemberURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *PatchServiceMemberURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *PatchServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on PatchServiceMemberURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on PatchServiceMemberURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *PatchServiceMemberURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go deleted file mode 100644 index ce5a9aaaea5..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowServiceMemberHandlerFunc turns a function with the right signature into a show service member handler -type ShowServiceMemberHandlerFunc func(ShowServiceMemberParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowServiceMemberHandlerFunc) Handle(params ShowServiceMemberParams) middleware.Responder { - return fn(params) -} - -// ShowServiceMemberHandler interface for that can handle valid show service member params -type ShowServiceMemberHandler interface { - Handle(ShowServiceMemberParams) middleware.Responder -} - -// NewShowServiceMember creates a new http.Handler for the show service member operation -func NewShowServiceMember(ctx *middleware.Context, handler ShowServiceMemberHandler) *ShowServiceMember { - return &ShowServiceMember{Context: ctx, Handler: handler} -} - -/* - ShowServiceMember swagger:route GET /service_members/{serviceMemberId} service_members showServiceMember - -# Returns the given service member - -Returns the given service member -*/ -type ShowServiceMember struct { - Context *middleware.Context - Handler ShowServiceMemberHandler -} - -func (o *ShowServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowServiceMemberParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go deleted file mode 100644 index ee602075921..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowServiceMemberOrdersHandlerFunc turns a function with the right signature into a show service member orders handler -type ShowServiceMemberOrdersHandlerFunc func(ShowServiceMemberOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowServiceMemberOrdersHandlerFunc) Handle(params ShowServiceMemberOrdersParams) middleware.Responder { - return fn(params) -} - -// ShowServiceMemberOrdersHandler interface for that can handle valid show service member orders params -type ShowServiceMemberOrdersHandler interface { - Handle(ShowServiceMemberOrdersParams) middleware.Responder -} - -// NewShowServiceMemberOrders creates a new http.Handler for the show service member orders operation -func NewShowServiceMemberOrders(ctx *middleware.Context, handler ShowServiceMemberOrdersHandler) *ShowServiceMemberOrders { - return &ShowServiceMemberOrders{Context: ctx, Handler: handler} -} - -/* - ShowServiceMemberOrders swagger:route GET /service_members/{serviceMemberId}/current_orders service_members showServiceMemberOrders - -# Returns the latest orders for a given service member - -Returns orders -*/ -type ShowServiceMemberOrders struct { - Context *middleware.Context - Handler ShowServiceMemberOrdersHandler -} - -func (o *ShowServiceMemberOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowServiceMemberOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go deleted file mode 100644 index 327d67bdde7..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowServiceMemberOrdersParams creates a new ShowServiceMemberOrdersParams object -// -// There are no default values defined in the spec. -func NewShowServiceMemberOrdersParams() ShowServiceMemberOrdersParams { - - return ShowServiceMemberOrdersParams{} -} - -// ShowServiceMemberOrdersParams contains all the bound params for the show service member orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters showServiceMemberOrders -type ShowServiceMemberOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowServiceMemberOrdersParams() beforehand. -func (o *ShowServiceMemberOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *ShowServiceMemberOrdersParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *ShowServiceMemberOrdersParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go deleted file mode 100644 index 5d8c5fd5f6d..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowServiceMemberOrdersOKCode is the HTTP code returned for type ShowServiceMemberOrdersOK -const ShowServiceMemberOrdersOKCode int = 200 - -/* -ShowServiceMemberOrdersOK the instance of the service member - -swagger:response showServiceMemberOrdersOK -*/ -type ShowServiceMemberOrdersOK struct { - - /* - In: Body - */ - Payload *internalmessages.Orders `json:"body,omitempty"` -} - -// NewShowServiceMemberOrdersOK creates ShowServiceMemberOrdersOK with default headers values -func NewShowServiceMemberOrdersOK() *ShowServiceMemberOrdersOK { - - return &ShowServiceMemberOrdersOK{} -} - -// WithPayload adds the payload to the show service member orders o k response -func (o *ShowServiceMemberOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowServiceMemberOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show service member orders o k response -func (o *ShowServiceMemberOrdersOK) SetPayload(payload *internalmessages.Orders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowServiceMemberOrdersBadRequestCode is the HTTP code returned for type ShowServiceMemberOrdersBadRequest -const ShowServiceMemberOrdersBadRequestCode int = 400 - -/* -ShowServiceMemberOrdersBadRequest invalid request - -swagger:response showServiceMemberOrdersBadRequest -*/ -type ShowServiceMemberOrdersBadRequest struct { -} - -// NewShowServiceMemberOrdersBadRequest creates ShowServiceMemberOrdersBadRequest with default headers values -func NewShowServiceMemberOrdersBadRequest() *ShowServiceMemberOrdersBadRequest { - - return &ShowServiceMemberOrdersBadRequest{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowServiceMemberOrdersUnauthorizedCode is the HTTP code returned for type ShowServiceMemberOrdersUnauthorized -const ShowServiceMemberOrdersUnauthorizedCode int = 401 - -/* -ShowServiceMemberOrdersUnauthorized request requires user authentication - -swagger:response showServiceMemberOrdersUnauthorized -*/ -type ShowServiceMemberOrdersUnauthorized struct { -} - -// NewShowServiceMemberOrdersUnauthorized creates ShowServiceMemberOrdersUnauthorized with default headers values -func NewShowServiceMemberOrdersUnauthorized() *ShowServiceMemberOrdersUnauthorized { - - return &ShowServiceMemberOrdersUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowServiceMemberOrdersForbiddenCode is the HTTP code returned for type ShowServiceMemberOrdersForbidden -const ShowServiceMemberOrdersForbiddenCode int = 403 - -/* -ShowServiceMemberOrdersForbidden user is not authorized - -swagger:response showServiceMemberOrdersForbidden -*/ -type ShowServiceMemberOrdersForbidden struct { -} - -// NewShowServiceMemberOrdersForbidden creates ShowServiceMemberOrdersForbidden with default headers values -func NewShowServiceMemberOrdersForbidden() *ShowServiceMemberOrdersForbidden { - - return &ShowServiceMemberOrdersForbidden{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowServiceMemberOrdersNotFoundCode is the HTTP code returned for type ShowServiceMemberOrdersNotFound -const ShowServiceMemberOrdersNotFoundCode int = 404 - -/* -ShowServiceMemberOrdersNotFound service member not found - -swagger:response showServiceMemberOrdersNotFound -*/ -type ShowServiceMemberOrdersNotFound struct { -} - -// NewShowServiceMemberOrdersNotFound creates ShowServiceMemberOrdersNotFound with default headers values -func NewShowServiceMemberOrdersNotFound() *ShowServiceMemberOrdersNotFound { - - return &ShowServiceMemberOrdersNotFound{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowServiceMemberOrdersInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberOrdersInternalServerError -const ShowServiceMemberOrdersInternalServerErrorCode int = 500 - -/* -ShowServiceMemberOrdersInternalServerError internal server error - -swagger:response showServiceMemberOrdersInternalServerError -*/ -type ShowServiceMemberOrdersInternalServerError struct { -} - -// NewShowServiceMemberOrdersInternalServerError creates ShowServiceMemberOrdersInternalServerError with default headers values -func NewShowServiceMemberOrdersInternalServerError() *ShowServiceMemberOrdersInternalServerError { - - return &ShowServiceMemberOrdersInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go deleted file mode 100644 index 18cb771b23e..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowServiceMemberOrdersURL generates an URL for the show service member orders operation -type ShowServiceMemberOrdersURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberOrdersURL) WithBasePath(bp string) *ShowServiceMemberOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowServiceMemberOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members/{serviceMemberId}/current_orders" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on ShowServiceMemberOrdersURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowServiceMemberOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowServiceMemberOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowServiceMemberOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowServiceMemberOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowServiceMemberOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowServiceMemberOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go deleted file mode 100644 index 40f5010e96f..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowServiceMemberParams creates a new ShowServiceMemberParams object -// -// There are no default values defined in the spec. -func NewShowServiceMemberParams() ShowServiceMemberParams { - - return ShowServiceMemberParams{} -} - -// ShowServiceMemberParams contains all the bound params for the show service member operation -// typically these are obtained from a http.Request -// -// swagger:parameters showServiceMember -type ShowServiceMemberParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the service member - Required: true - In: path - */ - ServiceMemberID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowServiceMemberParams() beforehand. -func (o *ShowServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") - if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindServiceMemberID binds and validates parameter ServiceMemberID from path. -func (o *ShowServiceMemberParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) - } - o.ServiceMemberID = *(value.(*strfmt.UUID)) - - if err := o.validateServiceMemberID(formats); err != nil { - return err - } - - return nil -} - -// validateServiceMemberID carries on validations for parameter ServiceMemberID -func (o *ShowServiceMemberParams) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go deleted file mode 100644 index 1ce0447b363..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowServiceMemberOKCode is the HTTP code returned for type ShowServiceMemberOK -const ShowServiceMemberOKCode int = 200 - -/* -ShowServiceMemberOK the instance of the service member - -swagger:response showServiceMemberOK -*/ -type ShowServiceMemberOK struct { - - /* - In: Body - */ - Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` -} - -// NewShowServiceMemberOK creates ShowServiceMemberOK with default headers values -func NewShowServiceMemberOK() *ShowServiceMemberOK { - - return &ShowServiceMemberOK{} -} - -// WithPayload adds the payload to the show service member o k response -func (o *ShowServiceMemberOK) WithPayload(payload *internalmessages.ServiceMemberPayload) *ShowServiceMemberOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show service member o k response -func (o *ShowServiceMemberOK) SetPayload(payload *internalmessages.ServiceMemberPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowServiceMemberOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowServiceMemberBadRequestCode is the HTTP code returned for type ShowServiceMemberBadRequest -const ShowServiceMemberBadRequestCode int = 400 - -/* -ShowServiceMemberBadRequest invalid request - -swagger:response showServiceMemberBadRequest -*/ -type ShowServiceMemberBadRequest struct { -} - -// NewShowServiceMemberBadRequest creates ShowServiceMemberBadRequest with default headers values -func NewShowServiceMemberBadRequest() *ShowServiceMemberBadRequest { - - return &ShowServiceMemberBadRequest{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowServiceMemberUnauthorizedCode is the HTTP code returned for type ShowServiceMemberUnauthorized -const ShowServiceMemberUnauthorizedCode int = 401 - -/* -ShowServiceMemberUnauthorized request requires user authentication - -swagger:response showServiceMemberUnauthorized -*/ -type ShowServiceMemberUnauthorized struct { -} - -// NewShowServiceMemberUnauthorized creates ShowServiceMemberUnauthorized with default headers values -func NewShowServiceMemberUnauthorized() *ShowServiceMemberUnauthorized { - - return &ShowServiceMemberUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowServiceMemberForbiddenCode is the HTTP code returned for type ShowServiceMemberForbidden -const ShowServiceMemberForbiddenCode int = 403 - -/* -ShowServiceMemberForbidden user is not authorized - -swagger:response showServiceMemberForbidden -*/ -type ShowServiceMemberForbidden struct { -} - -// NewShowServiceMemberForbidden creates ShowServiceMemberForbidden with default headers values -func NewShowServiceMemberForbidden() *ShowServiceMemberForbidden { - - return &ShowServiceMemberForbidden{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowServiceMemberNotFoundCode is the HTTP code returned for type ShowServiceMemberNotFound -const ShowServiceMemberNotFoundCode int = 404 - -/* -ShowServiceMemberNotFound service member not found - -swagger:response showServiceMemberNotFound -*/ -type ShowServiceMemberNotFound struct { -} - -// NewShowServiceMemberNotFound creates ShowServiceMemberNotFound with default headers values -func NewShowServiceMemberNotFound() *ShowServiceMemberNotFound { - - return &ShowServiceMemberNotFound{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowServiceMemberInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberInternalServerError -const ShowServiceMemberInternalServerErrorCode int = 500 - -/* -ShowServiceMemberInternalServerError internal server error - -swagger:response showServiceMemberInternalServerError -*/ -type ShowServiceMemberInternalServerError struct { -} - -// NewShowServiceMemberInternalServerError creates ShowServiceMemberInternalServerError with default headers values -func NewShowServiceMemberInternalServerError() *ShowServiceMemberInternalServerError { - - return &ShowServiceMemberInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go deleted file mode 100644 index f3c4497009b..00000000000 --- a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package service_members - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowServiceMemberURL generates an URL for the show service member operation -type ShowServiceMemberURL struct { - ServiceMemberID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberURL) WithBasePath(bp string) *ShowServiceMemberURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowServiceMemberURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowServiceMemberURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/service_members/{serviceMemberId}" - - serviceMemberID := o.ServiceMemberID.String() - if serviceMemberID != "" { - _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) - } else { - return nil, errors.New("serviceMemberId is required on ShowServiceMemberURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowServiceMemberURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowServiceMemberURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowServiceMemberURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowServiceMemberURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowServiceMemberURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go deleted file mode 100644 index 9be75cd30e8..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetTransportationOfficesHandlerFunc turns a function with the right signature into a get transportation offices handler -type GetTransportationOfficesHandlerFunc func(GetTransportationOfficesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetTransportationOfficesHandlerFunc) Handle(params GetTransportationOfficesParams) middleware.Responder { - return fn(params) -} - -// GetTransportationOfficesHandler interface for that can handle valid get transportation offices params -type GetTransportationOfficesHandler interface { - Handle(GetTransportationOfficesParams) middleware.Responder -} - -// NewGetTransportationOffices creates a new http.Handler for the get transportation offices operation -func NewGetTransportationOffices(ctx *middleware.Context, handler GetTransportationOfficesHandler) *GetTransportationOffices { - return &GetTransportationOffices{Context: ctx, Handler: handler} -} - -/* - GetTransportationOffices swagger:route GET /transportation-offices transportation_offices getTransportationOffices - -# Returns the transportation offices matching the search query - -Returns the transportation offices matching the search query -*/ -type GetTransportationOffices struct { - Context *middleware.Context - Handler GetTransportationOfficesHandler -} - -func (o *GetTransportationOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetTransportationOfficesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go deleted file mode 100644 index 8aa41957284..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetTransportationOfficesParams creates a new GetTransportationOfficesParams object -// -// There are no default values defined in the spec. -func NewGetTransportationOfficesParams() GetTransportationOfficesParams { - - return GetTransportationOfficesParams{} -} - -// GetTransportationOfficesParams contains all the bound params for the get transportation offices operation -// typically these are obtained from a http.Request -// -// swagger:parameters getTransportationOffices -type GetTransportationOfficesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Search string for transportation offices - Required: true - Min Length: 2 - In: query - */ - Search string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesParams() beforehand. -func (o *GetTransportationOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSearch, qhkSearch, _ := qs.GetOK("search") - if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSearch binds and validates parameter Search from query. -func (o *GetTransportationOfficesParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("search", "query", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // AllowEmptyValue: false - - if err := validate.RequiredString("search", "query", raw); err != nil { - return err - } - o.Search = raw - - if err := o.validateSearch(formats); err != nil { - return err - } - - return nil -} - -// validateSearch carries on validations for parameter Search -func (o *GetTransportationOfficesParams) validateSearch(formats strfmt.Registry) error { - - if err := validate.MinLength("search", "query", o.Search, 2); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go deleted file mode 100644 index 63c2e5975ca..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// GetTransportationOfficesOKCode is the HTTP code returned for type GetTransportationOfficesOK -const GetTransportationOfficesOKCode int = 200 - -/* -GetTransportationOfficesOK Successfully retrieved transportation offices - -swagger:response getTransportationOfficesOK -*/ -type GetTransportationOfficesOK struct { - - /* - In: Body - */ - Payload internalmessages.TransportationOffices `json:"body,omitempty"` -} - -// NewGetTransportationOfficesOK creates GetTransportationOfficesOK with default headers values -func NewGetTransportationOfficesOK() *GetTransportationOfficesOK { - - return &GetTransportationOfficesOK{} -} - -// WithPayload adds the payload to the get transportation offices o k response -func (o *GetTransportationOfficesOK) WithPayload(payload internalmessages.TransportationOffices) *GetTransportationOfficesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices o k response -func (o *GetTransportationOfficesOK) SetPayload(payload internalmessages.TransportationOffices) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.TransportationOffices{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// GetTransportationOfficesBadRequestCode is the HTTP code returned for type GetTransportationOfficesBadRequest -const GetTransportationOfficesBadRequestCode int = 400 - -/* -GetTransportationOfficesBadRequest The request payload is invalid. - -swagger:response getTransportationOfficesBadRequest -*/ -type GetTransportationOfficesBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetTransportationOfficesBadRequest creates GetTransportationOfficesBadRequest with default headers values -func NewGetTransportationOfficesBadRequest() *GetTransportationOfficesBadRequest { - - return &GetTransportationOfficesBadRequest{} -} - -// WithPayload adds the payload to the get transportation offices bad request response -func (o *GetTransportationOfficesBadRequest) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices bad request response -func (o *GetTransportationOfficesBadRequest) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesUnauthorized -const GetTransportationOfficesUnauthorizedCode int = 401 - -/* -GetTransportationOfficesUnauthorized The request was denied. - -swagger:response getTransportationOfficesUnauthorized -*/ -type GetTransportationOfficesUnauthorized struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetTransportationOfficesUnauthorized creates GetTransportationOfficesUnauthorized with default headers values -func NewGetTransportationOfficesUnauthorized() *GetTransportationOfficesUnauthorized { - - return &GetTransportationOfficesUnauthorized{} -} - -// WithPayload adds the payload to the get transportation offices unauthorized response -func (o *GetTransportationOfficesUnauthorized) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices unauthorized response -func (o *GetTransportationOfficesUnauthorized) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesForbiddenCode is the HTTP code returned for type GetTransportationOfficesForbidden -const GetTransportationOfficesForbiddenCode int = 403 - -/* -GetTransportationOfficesForbidden The request was denied. - -swagger:response getTransportationOfficesForbidden -*/ -type GetTransportationOfficesForbidden struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetTransportationOfficesForbidden creates GetTransportationOfficesForbidden with default headers values -func NewGetTransportationOfficesForbidden() *GetTransportationOfficesForbidden { - - return &GetTransportationOfficesForbidden{} -} - -// WithPayload adds the payload to the get transportation offices forbidden response -func (o *GetTransportationOfficesForbidden) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices forbidden response -func (o *GetTransportationOfficesForbidden) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesNotFoundCode is the HTTP code returned for type GetTransportationOfficesNotFound -const GetTransportationOfficesNotFoundCode int = 404 - -/* -GetTransportationOfficesNotFound The requested resource wasn't found. - -swagger:response getTransportationOfficesNotFound -*/ -type GetTransportationOfficesNotFound struct { - - /* - In: Body - */ - Payload *internalmessages.ClientError `json:"body,omitempty"` -} - -// NewGetTransportationOfficesNotFound creates GetTransportationOfficesNotFound with default headers values -func NewGetTransportationOfficesNotFound() *GetTransportationOfficesNotFound { - - return &GetTransportationOfficesNotFound{} -} - -// WithPayload adds the payload to the get transportation offices not found response -func (o *GetTransportationOfficesNotFound) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices not found response -func (o *GetTransportationOfficesNotFound) SetPayload(payload *internalmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetTransportationOfficesInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesInternalServerError -const GetTransportationOfficesInternalServerErrorCode int = 500 - -/* -GetTransportationOfficesInternalServerError A server error occurred. - -swagger:response getTransportationOfficesInternalServerError -*/ -type GetTransportationOfficesInternalServerError struct { - - /* - In: Body - */ - Payload *internalmessages.Error `json:"body,omitempty"` -} - -// NewGetTransportationOfficesInternalServerError creates GetTransportationOfficesInternalServerError with default headers values -func NewGetTransportationOfficesInternalServerError() *GetTransportationOfficesInternalServerError { - - return &GetTransportationOfficesInternalServerError{} -} - -// WithPayload adds the payload to the get transportation offices internal server error response -func (o *GetTransportationOfficesInternalServerError) WithPayload(payload *internalmessages.Error) *GetTransportationOfficesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get transportation offices internal server error response -func (o *GetTransportationOfficesInternalServerError) SetPayload(payload *internalmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetTransportationOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go deleted file mode 100644 index 5a8df3af992..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetTransportationOfficesURL generates an URL for the get transportation offices operation -type GetTransportationOfficesURL struct { - Search string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesURL) WithBasePath(bp string) *GetTransportationOfficesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetTransportationOfficesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetTransportationOfficesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transportation-offices" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - searchQ := o.Search - if searchQ != "" { - qs.Set("search", searchQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetTransportationOfficesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetTransportationOfficesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetTransportationOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetTransportationOfficesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetTransportationOfficesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetTransportationOfficesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go deleted file mode 100644 index c82df5e3af2..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowCounselingOfficesHandlerFunc turns a function with the right signature into a show counseling offices handler -type ShowCounselingOfficesHandlerFunc func(ShowCounselingOfficesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowCounselingOfficesHandlerFunc) Handle(params ShowCounselingOfficesParams) middleware.Responder { - return fn(params) -} - -// ShowCounselingOfficesHandler interface for that can handle valid show counseling offices params -type ShowCounselingOfficesHandler interface { - Handle(ShowCounselingOfficesParams) middleware.Responder -} - -// NewShowCounselingOffices creates a new http.Handler for the show counseling offices operation -func NewShowCounselingOffices(ctx *middleware.Context, handler ShowCounselingOfficesHandler) *ShowCounselingOffices { - return &ShowCounselingOffices{Context: ctx, Handler: handler} -} - -/* - ShowCounselingOffices swagger:route GET /transportation_offices/{dutyLocationId}/counseling_offices transportation_offices showCounselingOffices - -# Returns the counseling locations in the GBLOC matching the duty location - -Returns the counseling locations matching the GBLOC from the selected duty location -*/ -type ShowCounselingOffices struct { - Context *middleware.Context - Handler ShowCounselingOfficesHandler -} - -func (o *ShowCounselingOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowCounselingOfficesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go deleted file mode 100644 index 18917f8c812..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowCounselingOfficesParams creates a new ShowCounselingOfficesParams object -// -// There are no default values defined in the spec. -func NewShowCounselingOfficesParams() ShowCounselingOfficesParams { - - return ShowCounselingOfficesParams{} -} - -// ShowCounselingOfficesParams contains all the bound params for the show counseling offices operation -// typically these are obtained from a http.Request -// -// swagger:parameters showCounselingOffices -type ShowCounselingOfficesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the duty location - Required: true - In: path - */ - DutyLocationID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowCounselingOfficesParams() beforehand. -func (o *ShowCounselingOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rDutyLocationID, rhkDutyLocationID, _ := route.Params.GetOK("dutyLocationId") - if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDutyLocationID binds and validates parameter DutyLocationID from path. -func (o *ShowCounselingOfficesParams) bindDutyLocationID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("dutyLocationId", "path", "strfmt.UUID", raw) - } - o.DutyLocationID = *(value.(*strfmt.UUID)) - - if err := o.validateDutyLocationID(formats); err != nil { - return err - } - - return nil -} - -// validateDutyLocationID carries on validations for parameter DutyLocationID -func (o *ShowCounselingOfficesParams) validateDutyLocationID(formats strfmt.Registry) error { - - if err := validate.FormatOf("dutyLocationId", "path", "uuid", o.DutyLocationID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go deleted file mode 100644 index dd5b23288dc..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowCounselingOfficesOKCode is the HTTP code returned for type ShowCounselingOfficesOK -const ShowCounselingOfficesOKCode int = 200 - -/* -ShowCounselingOfficesOK the instance of the counseling office for a duty location - -swagger:response showCounselingOfficesOK -*/ -type ShowCounselingOfficesOK struct { - - /* - In: Body - */ - Payload internalmessages.CounselingOffices `json:"body,omitempty"` -} - -// NewShowCounselingOfficesOK creates ShowCounselingOfficesOK with default headers values -func NewShowCounselingOfficesOK() *ShowCounselingOfficesOK { - - return &ShowCounselingOfficesOK{} -} - -// WithPayload adds the payload to the show counseling offices o k response -func (o *ShowCounselingOfficesOK) WithPayload(payload internalmessages.CounselingOffices) *ShowCounselingOfficesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show counseling offices o k response -func (o *ShowCounselingOfficesOK) SetPayload(payload internalmessages.CounselingOffices) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowCounselingOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = internalmessages.CounselingOffices{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ShowCounselingOfficesInternalServerErrorCode is the HTTP code returned for type ShowCounselingOfficesInternalServerError -const ShowCounselingOfficesInternalServerErrorCode int = 500 - -/* -ShowCounselingOfficesInternalServerError internal server error - -swagger:response showCounselingOfficesInternalServerError -*/ -type ShowCounselingOfficesInternalServerError struct { -} - -// NewShowCounselingOfficesInternalServerError creates ShowCounselingOfficesInternalServerError with default headers values -func NewShowCounselingOfficesInternalServerError() *ShowCounselingOfficesInternalServerError { - - return &ShowCounselingOfficesInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowCounselingOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go deleted file mode 100644 index 21122fe0b53..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowCounselingOfficesURL generates an URL for the show counseling offices operation -type ShowCounselingOfficesURL struct { - DutyLocationID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowCounselingOfficesURL) WithBasePath(bp string) *ShowCounselingOfficesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowCounselingOfficesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowCounselingOfficesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/transportation_offices/{dutyLocationId}/counseling_offices" - - dutyLocationID := o.DutyLocationID.String() - if dutyLocationID != "" { - _path = strings.Replace(_path, "{dutyLocationId}", dutyLocationID, -1) - } else { - return nil, errors.New("dutyLocationId is required on ShowCounselingOfficesURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowCounselingOfficesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowCounselingOfficesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowCounselingOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowCounselingOfficesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowCounselingOfficesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowCounselingOfficesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go deleted file mode 100644 index c2195cbbe69..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowDutyLocationTransportationOfficeHandlerFunc turns a function with the right signature into a show duty location transportation office handler -type ShowDutyLocationTransportationOfficeHandlerFunc func(ShowDutyLocationTransportationOfficeParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowDutyLocationTransportationOfficeHandlerFunc) Handle(params ShowDutyLocationTransportationOfficeParams) middleware.Responder { - return fn(params) -} - -// ShowDutyLocationTransportationOfficeHandler interface for that can handle valid show duty location transportation office params -type ShowDutyLocationTransportationOfficeHandler interface { - Handle(ShowDutyLocationTransportationOfficeParams) middleware.Responder -} - -// NewShowDutyLocationTransportationOffice creates a new http.Handler for the show duty location transportation office operation -func NewShowDutyLocationTransportationOffice(ctx *middleware.Context, handler ShowDutyLocationTransportationOfficeHandler) *ShowDutyLocationTransportationOffice { - return &ShowDutyLocationTransportationOffice{Context: ctx, Handler: handler} -} - -/* - ShowDutyLocationTransportationOffice swagger:route GET /duty_locations/{dutyLocationId}/transportation_office transportation_offices showDutyLocationTransportationOffice - -# Returns the transportation office for a given duty location - -Returns the given duty location's transportation office -*/ -type ShowDutyLocationTransportationOffice struct { - Context *middleware.Context - Handler ShowDutyLocationTransportationOfficeHandler -} - -func (o *ShowDutyLocationTransportationOffice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowDutyLocationTransportationOfficeParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go deleted file mode 100644 index cebbc8f51b1..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewShowDutyLocationTransportationOfficeParams creates a new ShowDutyLocationTransportationOfficeParams object -// -// There are no default values defined in the spec. -func NewShowDutyLocationTransportationOfficeParams() ShowDutyLocationTransportationOfficeParams { - - return ShowDutyLocationTransportationOfficeParams{} -} - -// ShowDutyLocationTransportationOfficeParams contains all the bound params for the show duty location transportation office operation -// typically these are obtained from a http.Request -// -// swagger:parameters showDutyLocationTransportationOffice -type ShowDutyLocationTransportationOfficeParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the duty location - Required: true - In: path - */ - DutyLocationID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowDutyLocationTransportationOfficeParams() beforehand. -func (o *ShowDutyLocationTransportationOfficeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rDutyLocationID, rhkDutyLocationID, _ := route.Params.GetOK("dutyLocationId") - if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDutyLocationID binds and validates parameter DutyLocationID from path. -func (o *ShowDutyLocationTransportationOfficeParams) bindDutyLocationID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("dutyLocationId", "path", "strfmt.UUID", raw) - } - o.DutyLocationID = *(value.(*strfmt.UUID)) - - if err := o.validateDutyLocationID(formats); err != nil { - return err - } - - return nil -} - -// validateDutyLocationID carries on validations for parameter DutyLocationID -func (o *ShowDutyLocationTransportationOfficeParams) validateDutyLocationID(formats strfmt.Registry) error { - - if err := validate.FormatOf("dutyLocationId", "path", "uuid", o.DutyLocationID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go deleted file mode 100644 index eac97450bc5..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go +++ /dev/null @@ -1,184 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowDutyLocationTransportationOfficeOKCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeOK -const ShowDutyLocationTransportationOfficeOKCode int = 200 - -/* -ShowDutyLocationTransportationOfficeOK the instance of the transportation office for a duty location - -swagger:response showDutyLocationTransportationOfficeOK -*/ -type ShowDutyLocationTransportationOfficeOK struct { - - /* - In: Body - */ - Payload *internalmessages.TransportationOffice `json:"body,omitempty"` -} - -// NewShowDutyLocationTransportationOfficeOK creates ShowDutyLocationTransportationOfficeOK with default headers values -func NewShowDutyLocationTransportationOfficeOK() *ShowDutyLocationTransportationOfficeOK { - - return &ShowDutyLocationTransportationOfficeOK{} -} - -// WithPayload adds the payload to the show duty location transportation office o k response -func (o *ShowDutyLocationTransportationOfficeOK) WithPayload(payload *internalmessages.TransportationOffice) *ShowDutyLocationTransportationOfficeOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show duty location transportation office o k response -func (o *ShowDutyLocationTransportationOfficeOK) SetPayload(payload *internalmessages.TransportationOffice) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowDutyLocationTransportationOfficeBadRequestCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeBadRequest -const ShowDutyLocationTransportationOfficeBadRequestCode int = 400 - -/* -ShowDutyLocationTransportationOfficeBadRequest invalid request - -swagger:response showDutyLocationTransportationOfficeBadRequest -*/ -type ShowDutyLocationTransportationOfficeBadRequest struct { -} - -// NewShowDutyLocationTransportationOfficeBadRequest creates ShowDutyLocationTransportationOfficeBadRequest with default headers values -func NewShowDutyLocationTransportationOfficeBadRequest() *ShowDutyLocationTransportationOfficeBadRequest { - - return &ShowDutyLocationTransportationOfficeBadRequest{} -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowDutyLocationTransportationOfficeUnauthorizedCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeUnauthorized -const ShowDutyLocationTransportationOfficeUnauthorizedCode int = 401 - -/* -ShowDutyLocationTransportationOfficeUnauthorized request requires user authentication - -swagger:response showDutyLocationTransportationOfficeUnauthorized -*/ -type ShowDutyLocationTransportationOfficeUnauthorized struct { -} - -// NewShowDutyLocationTransportationOfficeUnauthorized creates ShowDutyLocationTransportationOfficeUnauthorized with default headers values -func NewShowDutyLocationTransportationOfficeUnauthorized() *ShowDutyLocationTransportationOfficeUnauthorized { - - return &ShowDutyLocationTransportationOfficeUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowDutyLocationTransportationOfficeForbiddenCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeForbidden -const ShowDutyLocationTransportationOfficeForbiddenCode int = 403 - -/* -ShowDutyLocationTransportationOfficeForbidden user is not authorized - -swagger:response showDutyLocationTransportationOfficeForbidden -*/ -type ShowDutyLocationTransportationOfficeForbidden struct { -} - -// NewShowDutyLocationTransportationOfficeForbidden creates ShowDutyLocationTransportationOfficeForbidden with default headers values -func NewShowDutyLocationTransportationOfficeForbidden() *ShowDutyLocationTransportationOfficeForbidden { - - return &ShowDutyLocationTransportationOfficeForbidden{} -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// ShowDutyLocationTransportationOfficeNotFoundCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeNotFound -const ShowDutyLocationTransportationOfficeNotFoundCode int = 404 - -/* -ShowDutyLocationTransportationOfficeNotFound transportation office not found - -swagger:response showDutyLocationTransportationOfficeNotFound -*/ -type ShowDutyLocationTransportationOfficeNotFound struct { -} - -// NewShowDutyLocationTransportationOfficeNotFound creates ShowDutyLocationTransportationOfficeNotFound with default headers values -func NewShowDutyLocationTransportationOfficeNotFound() *ShowDutyLocationTransportationOfficeNotFound { - - return &ShowDutyLocationTransportationOfficeNotFound{} -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// ShowDutyLocationTransportationOfficeInternalServerErrorCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeInternalServerError -const ShowDutyLocationTransportationOfficeInternalServerErrorCode int = 500 - -/* -ShowDutyLocationTransportationOfficeInternalServerError internal server error - -swagger:response showDutyLocationTransportationOfficeInternalServerError -*/ -type ShowDutyLocationTransportationOfficeInternalServerError struct { -} - -// NewShowDutyLocationTransportationOfficeInternalServerError creates ShowDutyLocationTransportationOfficeInternalServerError with default headers values -func NewShowDutyLocationTransportationOfficeInternalServerError() *ShowDutyLocationTransportationOfficeInternalServerError { - - return &ShowDutyLocationTransportationOfficeInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowDutyLocationTransportationOfficeInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go deleted file mode 100644 index c18ea950d74..00000000000 --- a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package transportation_offices - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ShowDutyLocationTransportationOfficeURL generates an URL for the show duty location transportation office operation -type ShowDutyLocationTransportationOfficeURL struct { - DutyLocationID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowDutyLocationTransportationOfficeURL) WithBasePath(bp string) *ShowDutyLocationTransportationOfficeURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowDutyLocationTransportationOfficeURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowDutyLocationTransportationOfficeURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/duty_locations/{dutyLocationId}/transportation_office" - - dutyLocationID := o.DutyLocationID.String() - if dutyLocationID != "" { - _path = strings.Replace(_path, "{dutyLocationId}", dutyLocationID, -1) - } else { - return nil, errors.New("dutyLocationId is required on ShowDutyLocationTransportationOfficeURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowDutyLocationTransportationOfficeURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowDutyLocationTransportationOfficeURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowDutyLocationTransportationOfficeURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowDutyLocationTransportationOfficeURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowDutyLocationTransportationOfficeURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowDutyLocationTransportationOfficeURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload.go deleted file mode 100644 index 90b5451b23a..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/create_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler -type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { - return fn(params) -} - -// CreateUploadHandler interface for that can handle valid create upload params -type CreateUploadHandler interface { - Handle(CreateUploadParams) middleware.Responder -} - -// NewCreateUpload creates a new http.Handler for the create upload operation -func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { - return &CreateUpload{Context: ctx, Handler: handler} -} - -/* - CreateUpload swagger:route POST /uploads uploads createUpload - -# Create a new upload - -Uploads represent a single digital file, such as a JPEG or PDF. -*/ -type CreateUpload struct { - Context *middleware.Context - Handler CreateUploadHandler -} - -func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go deleted file mode 100644 index c3c00400764..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go +++ /dev/null @@ -1,136 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// CreateUploadMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreateUploadMaxParseMemory int64 = 32 << 20 - -// NewCreateUploadParams creates a new CreateUploadParams object -// -// There are no default values defined in the spec. -func NewCreateUploadParams() CreateUploadParams { - - return CreateUploadParams{} -} - -// CreateUploadParams contains all the bound params for the create upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters createUpload -type CreateUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the document to add an upload to - In: query - */ - DocumentID *strfmt.UUID - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. -func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") - if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { - res = append(res, err) - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindDocumentID binds and validates parameter DocumentID from query. -func (o *CreateUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) - } - o.DocumentID = (value.(*strfmt.UUID)) - - if err := o.validateDocumentID(formats); err != nil { - return err - } - - return nil -} - -// validateDocumentID carries on validations for parameter DocumentID -func (o *CreateUploadParams) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go deleted file mode 100644 index 5e7cd623942..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated -const CreateUploadCreatedCode int = 201 - -/* -CreateUploadCreated created upload - -swagger:response createUploadCreated -*/ -type CreateUploadCreated struct { - - /* - In: Body - */ - Payload *internalmessages.Upload `json:"body,omitempty"` -} - -// NewCreateUploadCreated creates CreateUploadCreated with default headers values -func NewCreateUploadCreated() *CreateUploadCreated { - - return &CreateUploadCreated{} -} - -// WithPayload adds the payload to the create upload created response -func (o *CreateUploadCreated) WithPayload(payload *internalmessages.Upload) *CreateUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload created response -func (o *CreateUploadCreated) SetPayload(payload *internalmessages.Upload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest -const CreateUploadBadRequestCode int = 400 - -/* -CreateUploadBadRequest invalid request - -swagger:response createUploadBadRequest -*/ -type CreateUploadBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values -func NewCreateUploadBadRequest() *CreateUploadBadRequest { - - return &CreateUploadBadRequest{} -} - -// WithPayload adds the payload to the create upload bad request response -func (o *CreateUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *CreateUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload bad request response -func (o *CreateUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden -const CreateUploadForbiddenCode int = 403 - -/* -CreateUploadForbidden not authorized - -swagger:response createUploadForbidden -*/ -type CreateUploadForbidden struct { -} - -// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values -func NewCreateUploadForbidden() *CreateUploadForbidden { - - return &CreateUploadForbidden{} -} - -// WriteResponse to the client -func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound -const CreateUploadNotFoundCode int = 404 - -/* -CreateUploadNotFound not found - -swagger:response createUploadNotFound -*/ -type CreateUploadNotFound struct { -} - -// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values -func NewCreateUploadNotFound() *CreateUploadNotFound { - - return &CreateUploadNotFound{} -} - -// WriteResponse to the client -func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// CreateUploadRequestEntityTooLargeCode is the HTTP code returned for type CreateUploadRequestEntityTooLarge -const CreateUploadRequestEntityTooLargeCode int = 413 - -/* -CreateUploadRequestEntityTooLarge payload is too large - -swagger:response createUploadRequestEntityTooLarge -*/ -type CreateUploadRequestEntityTooLarge struct { -} - -// NewCreateUploadRequestEntityTooLarge creates CreateUploadRequestEntityTooLarge with default headers values -func NewCreateUploadRequestEntityTooLarge() *CreateUploadRequestEntityTooLarge { - - return &CreateUploadRequestEntityTooLarge{} -} - -// WriteResponse to the client -func (o *CreateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(413) -} - -// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError -const CreateUploadInternalServerErrorCode int = 500 - -/* -CreateUploadInternalServerError server error - -swagger:response createUploadInternalServerError -*/ -type CreateUploadInternalServerError struct { -} - -// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values -func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { - - return &CreateUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go deleted file mode 100644 index 7d6fdb24b15..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// CreateUploadURL generates an URL for the create upload operation -type CreateUploadURL struct { - DocumentID *strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var documentIDQ string - if o.DocumentID != nil { - documentIDQ = o.DocumentID.String() - } - if documentIDQ != "" { - qs.Set("documentId", documentIDQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go deleted file mode 100644 index d2f39201c5c..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteUploadHandlerFunc turns a function with the right signature into a delete upload handler -type DeleteUploadHandlerFunc func(DeleteUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteUploadHandlerFunc) Handle(params DeleteUploadParams) middleware.Responder { - return fn(params) -} - -// DeleteUploadHandler interface for that can handle valid delete upload params -type DeleteUploadHandler interface { - Handle(DeleteUploadParams) middleware.Responder -} - -// NewDeleteUpload creates a new http.Handler for the delete upload operation -func NewDeleteUpload(ctx *middleware.Context, handler DeleteUploadHandler) *DeleteUpload { - return &DeleteUpload{Context: ctx, Handler: handler} -} - -/* - DeleteUpload swagger:route DELETE /uploads/{uploadId} uploads deleteUpload - -# Deletes an upload - -Uploads represent a single digital file, such as a JPEG or PDF. -*/ -type DeleteUpload struct { - Context *middleware.Context - Handler DeleteUploadHandler -} - -func (o *DeleteUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go deleted file mode 100644 index 4733744103b..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteUploadParams creates a new DeleteUploadParams object -// -// There are no default values defined in the spec. -func NewDeleteUploadParams() DeleteUploadParams { - - return DeleteUploadParams{} -} - -// DeleteUploadParams contains all the bound params for the delete upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteUpload -type DeleteUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optional ID of the move that the upload belongs to - In: query - */ - MoveID *strfmt.UUID - /*ID of the order that the upload belongs to - In: query - */ - OrderID *strfmt.UUID - /*Optional PPM shipment ID related to the upload - In: query - */ - PpmID *strfmt.UUID - /*UUID of the upload to be deleted - Required: true - In: path - */ - UploadID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteUploadParams() beforehand. -func (o *DeleteUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qMoveID, qhkMoveID, _ := qs.GetOK("moveId") - if err := o.bindMoveID(qMoveID, qhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - - qOrderID, qhkOrderID, _ := qs.GetOK("orderId") - if err := o.bindOrderID(qOrderID, qhkOrderID, route.Formats); err != nil { - res = append(res, err) - } - - qPpmID, qhkPpmID, _ := qs.GetOK("ppmId") - if err := o.bindPpmID(qPpmID, qhkPpmID, route.Formats); err != nil { - res = append(res, err) - } - - rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadId") - if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from query. -func (o *DeleteUploadParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveId", "query", "strfmt.UUID", raw) - } - o.MoveID = (value.(*strfmt.UUID)) - - if err := o.validateMoveID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveID carries on validations for parameter MoveID -func (o *DeleteUploadParams) validateMoveID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveId", "query", "uuid", o.MoveID.String(), formats); err != nil { - return err - } - return nil -} - -// bindOrderID binds and validates parameter OrderID from query. -func (o *DeleteUploadParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("orderId", "query", "strfmt.UUID", raw) - } - o.OrderID = (value.(*strfmt.UUID)) - - if err := o.validateOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateOrderID carries on validations for parameter OrderID -func (o *DeleteUploadParams) validateOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("orderId", "query", "uuid", o.OrderID.String(), formats); err != nil { - return err - } - return nil -} - -// bindPpmID binds and validates parameter PpmID from query. -func (o *DeleteUploadParams) bindPpmID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("ppmId", "query", "strfmt.UUID", raw) - } - o.PpmID = (value.(*strfmt.UUID)) - - if err := o.validatePpmID(formats); err != nil { - return err - } - - return nil -} - -// validatePpmID carries on validations for parameter PpmID -func (o *DeleteUploadParams) validatePpmID(formats strfmt.Registry) error { - - if err := validate.FormatOf("ppmId", "query", "uuid", o.PpmID.String(), formats); err != nil { - return err - } - return nil -} - -// bindUploadID binds and validates parameter UploadID from path. -func (o *DeleteUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("uploadId", "path", "strfmt.UUID", raw) - } - o.UploadID = *(value.(*strfmt.UUID)) - - if err := o.validateUploadID(formats); err != nil { - return err - } - - return nil -} - -// validateUploadID carries on validations for parameter UploadID -func (o *DeleteUploadParams) validateUploadID(formats strfmt.Registry) error { - - if err := validate.FormatOf("uploadId", "path", "uuid", o.UploadID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go deleted file mode 100644 index c92db66e7b2..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteUploadNoContentCode is the HTTP code returned for type DeleteUploadNoContent -const DeleteUploadNoContentCode int = 204 - -/* -DeleteUploadNoContent deleted - -swagger:response deleteUploadNoContent -*/ -type DeleteUploadNoContent struct { -} - -// NewDeleteUploadNoContent creates DeleteUploadNoContent with default headers values -func NewDeleteUploadNoContent() *DeleteUploadNoContent { - - return &DeleteUploadNoContent{} -} - -// WriteResponse to the client -func (o *DeleteUploadNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteUploadBadRequestCode is the HTTP code returned for type DeleteUploadBadRequest -const DeleteUploadBadRequestCode int = 400 - -/* -DeleteUploadBadRequest invalid request - -swagger:response deleteUploadBadRequest -*/ -type DeleteUploadBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewDeleteUploadBadRequest creates DeleteUploadBadRequest with default headers values -func NewDeleteUploadBadRequest() *DeleteUploadBadRequest { - - return &DeleteUploadBadRequest{} -} - -// WithPayload adds the payload to the delete upload bad request response -func (o *DeleteUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete upload bad request response -func (o *DeleteUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteUploadForbiddenCode is the HTTP code returned for type DeleteUploadForbidden -const DeleteUploadForbiddenCode int = 403 - -/* -DeleteUploadForbidden not authorized - -swagger:response deleteUploadForbidden -*/ -type DeleteUploadForbidden struct { -} - -// NewDeleteUploadForbidden creates DeleteUploadForbidden with default headers values -func NewDeleteUploadForbidden() *DeleteUploadForbidden { - - return &DeleteUploadForbidden{} -} - -// WriteResponse to the client -func (o *DeleteUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// DeleteUploadNotFoundCode is the HTTP code returned for type DeleteUploadNotFound -const DeleteUploadNotFoundCode int = 404 - -/* -DeleteUploadNotFound not found - -swagger:response deleteUploadNotFound -*/ -type DeleteUploadNotFound struct { -} - -// NewDeleteUploadNotFound creates DeleteUploadNotFound with default headers values -func NewDeleteUploadNotFound() *DeleteUploadNotFound { - - return &DeleteUploadNotFound{} -} - -// WriteResponse to the client -func (o *DeleteUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// DeleteUploadInternalServerErrorCode is the HTTP code returned for type DeleteUploadInternalServerError -const DeleteUploadInternalServerErrorCode int = 500 - -/* -DeleteUploadInternalServerError server error - -swagger:response deleteUploadInternalServerError -*/ -type DeleteUploadInternalServerError struct { -} - -// NewDeleteUploadInternalServerError creates DeleteUploadInternalServerError with default headers values -func NewDeleteUploadInternalServerError() *DeleteUploadInternalServerError { - - return &DeleteUploadInternalServerError{} -} - -// WriteResponse to the client -func (o *DeleteUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go deleted file mode 100644 index c5fdb9ecd28..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteUploadURL generates an URL for the delete upload operation -type DeleteUploadURL struct { - UploadID strfmt.UUID - - MoveID *strfmt.UUID - OrderID *strfmt.UUID - PpmID *strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadURL) WithBasePath(bp string) *DeleteUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads/{uploadId}" - - uploadID := o.UploadID.String() - if uploadID != "" { - _path = strings.Replace(_path, "{uploadId}", uploadID, -1) - } else { - return nil, errors.New("uploadId is required on DeleteUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var moveIDQ string - if o.MoveID != nil { - moveIDQ = o.MoveID.String() - } - if moveIDQ != "" { - qs.Set("moveId", moveIDQ) - } - - var orderIDQ string - if o.OrderID != nil { - orderIDQ = o.OrderID.String() - } - if orderIDQ != "" { - qs.Set("orderId", orderIDQ) - } - - var ppmIDQ string - if o.PpmID != nil { - ppmIDQ = o.PpmID.String() - } - if ppmIDQ != "" { - qs.Set("ppmId", ppmIDQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go deleted file mode 100644 index fd61077fa4f..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteUploadsHandlerFunc turns a function with the right signature into a delete uploads handler -type DeleteUploadsHandlerFunc func(DeleteUploadsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteUploadsHandlerFunc) Handle(params DeleteUploadsParams) middleware.Responder { - return fn(params) -} - -// DeleteUploadsHandler interface for that can handle valid delete uploads params -type DeleteUploadsHandler interface { - Handle(DeleteUploadsParams) middleware.Responder -} - -// NewDeleteUploads creates a new http.Handler for the delete uploads operation -func NewDeleteUploads(ctx *middleware.Context, handler DeleteUploadsHandler) *DeleteUploads { - return &DeleteUploads{Context: ctx, Handler: handler} -} - -/* - DeleteUploads swagger:route DELETE /uploads uploads deleteUploads - -# Deletes a collection of uploads - -Uploads represent a single digital file, such as a JPEG or PDF. -*/ -type DeleteUploads struct { - Context *middleware.Context - Handler DeleteUploadsHandler -} - -func (o *DeleteUploads) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteUploadsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go deleted file mode 100644 index 15b8c60bbdc..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// NewDeleteUploadsParams creates a new DeleteUploadsParams object -// -// There are no default values defined in the spec. -func NewDeleteUploadsParams() DeleteUploadsParams { - - return DeleteUploadsParams{} -} - -// DeleteUploadsParams contains all the bound params for the delete uploads operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteUploads -type DeleteUploadsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Array of UUIDs to be deleted - Required: true - In: query - */ - UploadIds []strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteUploadsParams() beforehand. -func (o *DeleteUploadsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qUploadIds, qhkUploadIds, _ := qs.GetOK("uploadIds") - if err := o.bindUploadIds(qUploadIds, qhkUploadIds, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindUploadIds binds and validates array parameter UploadIds from query. -// -// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). -func (o *DeleteUploadsParams) bindUploadIds(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("uploadIds", "query", rawData) - } - var qvUploadIds string - if len(rawData) > 0 { - qvUploadIds = rawData[len(rawData)-1] - } - - // CollectionFormat: - uploadIdsIC := swag.SplitByFormat(qvUploadIds, "") - if len(uploadIdsIC) == 0 { - return errors.Required("uploadIds", "query", uploadIdsIC) - } - - var uploadIdsIR []strfmt.UUID - for i, uploadIdsIV := range uploadIdsIC { - // items.Format: "uuid" - value, err := formats.Parse("uuid", uploadIdsIV) - if err != nil { - return errors.InvalidType(fmt.Sprintf("%s.%v", "uploadIds", i), "query", "strfmt.UUID", value) - } - uploadIdsI := *(value.(*strfmt.UUID)) - - if err := validate.FormatOf(fmt.Sprintf("%s.%v", "uploadIds", i), "query", "uuid", uploadIdsI.String(), formats); err != nil { - return err - } - uploadIdsIR = append(uploadIdsIR, uploadIdsI) - } - - o.UploadIds = uploadIdsIR - - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go deleted file mode 100644 index eeaf4055004..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// DeleteUploadsNoContentCode is the HTTP code returned for type DeleteUploadsNoContent -const DeleteUploadsNoContentCode int = 204 - -/* -DeleteUploadsNoContent deleted - -swagger:response deleteUploadsNoContent -*/ -type DeleteUploadsNoContent struct { -} - -// NewDeleteUploadsNoContent creates DeleteUploadsNoContent with default headers values -func NewDeleteUploadsNoContent() *DeleteUploadsNoContent { - - return &DeleteUploadsNoContent{} -} - -// WriteResponse to the client -func (o *DeleteUploadsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteUploadsBadRequestCode is the HTTP code returned for type DeleteUploadsBadRequest -const DeleteUploadsBadRequestCode int = 400 - -/* -DeleteUploadsBadRequest invalid request - -swagger:response deleteUploadsBadRequest -*/ -type DeleteUploadsBadRequest struct { - - /* - In: Body - */ - Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` -} - -// NewDeleteUploadsBadRequest creates DeleteUploadsBadRequest with default headers values -func NewDeleteUploadsBadRequest() *DeleteUploadsBadRequest { - - return &DeleteUploadsBadRequest{} -} - -// WithPayload adds the payload to the delete uploads bad request response -func (o *DeleteUploadsBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteUploadsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete uploads bad request response -func (o *DeleteUploadsBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteUploadsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteUploadsForbiddenCode is the HTTP code returned for type DeleteUploadsForbidden -const DeleteUploadsForbiddenCode int = 403 - -/* -DeleteUploadsForbidden not authorized - -swagger:response deleteUploadsForbidden -*/ -type DeleteUploadsForbidden struct { -} - -// NewDeleteUploadsForbidden creates DeleteUploadsForbidden with default headers values -func NewDeleteUploadsForbidden() *DeleteUploadsForbidden { - - return &DeleteUploadsForbidden{} -} - -// WriteResponse to the client -func (o *DeleteUploadsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(403) -} - -// DeleteUploadsNotFoundCode is the HTTP code returned for type DeleteUploadsNotFound -const DeleteUploadsNotFoundCode int = 404 - -/* -DeleteUploadsNotFound not found - -swagger:response deleteUploadsNotFound -*/ -type DeleteUploadsNotFound struct { -} - -// NewDeleteUploadsNotFound creates DeleteUploadsNotFound with default headers values -func NewDeleteUploadsNotFound() *DeleteUploadsNotFound { - - return &DeleteUploadsNotFound{} -} - -// WriteResponse to the client -func (o *DeleteUploadsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(404) -} - -// DeleteUploadsInternalServerErrorCode is the HTTP code returned for type DeleteUploadsInternalServerError -const DeleteUploadsInternalServerErrorCode int = 500 - -/* -DeleteUploadsInternalServerError server error - -swagger:response deleteUploadsInternalServerError -*/ -type DeleteUploadsInternalServerError struct { -} - -// NewDeleteUploadsInternalServerError creates DeleteUploadsInternalServerError with default headers values -func NewDeleteUploadsInternalServerError() *DeleteUploadsInternalServerError { - - return &DeleteUploadsInternalServerError{} -} - -// WriteResponse to the client -func (o *DeleteUploadsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go deleted file mode 100644 index 392b6fe290a..00000000000 --- a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go +++ /dev/null @@ -1,115 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package uploads - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DeleteUploadsURL generates an URL for the delete uploads operation -type DeleteUploadsURL struct { - UploadIds []strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadsURL) WithBasePath(bp string) *DeleteUploadsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteUploadsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteUploadsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/uploads" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var uploadIdsIR []string - for _, uploadIdsI := range o.UploadIds { - uploadIdsIS := uploadIdsI.String() - if uploadIdsIS != "" { - uploadIdsIR = append(uploadIdsIR, uploadIdsIS) - } - } - - uploadIds := swag.JoinByFormat(uploadIdsIR, "") - - if len(uploadIds) > 0 { - qsv := uploadIds[0] - if qsv != "" { - qs.Set("uploadIds", qsv) - } - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteUploadsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteUploadsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteUploadsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteUploadsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteUploadsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteUploadsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go deleted file mode 100644 index a8b5e891f45..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go +++ /dev/null @@ -1,119 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "context" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IsLoggedInUserHandlerFunc turns a function with the right signature into a is logged in user handler -type IsLoggedInUserHandlerFunc func(IsLoggedInUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn IsLoggedInUserHandlerFunc) Handle(params IsLoggedInUserParams) middleware.Responder { - return fn(params) -} - -// IsLoggedInUserHandler interface for that can handle valid is logged in user params -type IsLoggedInUserHandler interface { - Handle(IsLoggedInUserParams) middleware.Responder -} - -// NewIsLoggedInUser creates a new http.Handler for the is logged in user operation -func NewIsLoggedInUser(ctx *middleware.Context, handler IsLoggedInUserHandler) *IsLoggedInUser { - return &IsLoggedInUser{Context: ctx, Handler: handler} -} - -/* - IsLoggedInUser swagger:route GET /users/is_logged_in users isLoggedInUser - -# Returns boolean as to whether the user is logged in - -Returns boolean as to whether the user is logged in -*/ -type IsLoggedInUser struct { - Context *middleware.Context - Handler IsLoggedInUserHandler -} - -func (o *IsLoggedInUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewIsLoggedInUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} - -// IsLoggedInUserOKBody is logged in user o k body -// -// swagger:model IsLoggedInUserOKBody -type IsLoggedInUserOKBody struct { - - // is logged in - // Required: true - IsLoggedIn *bool `json:"isLoggedIn"` -} - -// Validate validates this is logged in user o k body -func (o *IsLoggedInUserOKBody) Validate(formats strfmt.Registry) error { - var res []error - - if err := o.validateIsLoggedIn(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (o *IsLoggedInUserOKBody) validateIsLoggedIn(formats strfmt.Registry) error { - - if err := validate.Required("isLoggedInUserOK"+"."+"isLoggedIn", "body", o.IsLoggedIn); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this is logged in user o k body based on context it is used -func (o *IsLoggedInUserOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (o *IsLoggedInUserOKBody) MarshalBinary() ([]byte, error) { - if o == nil { - return nil, nil - } - return swag.WriteJSON(o) -} - -// UnmarshalBinary interface implementation -func (o *IsLoggedInUserOKBody) UnmarshalBinary(b []byte) error { - var res IsLoggedInUserOKBody - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *o = res - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go deleted file mode 100644 index d5bd1b076b1..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewIsLoggedInUserParams creates a new IsLoggedInUserParams object -// -// There are no default values defined in the spec. -func NewIsLoggedInUserParams() IsLoggedInUserParams { - - return IsLoggedInUserParams{} -} - -// IsLoggedInUserParams contains all the bound params for the is logged in user operation -// typically these are obtained from a http.Request -// -// swagger:parameters isLoggedInUser -type IsLoggedInUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewIsLoggedInUserParams() beforehand. -func (o *IsLoggedInUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go deleted file mode 100644 index 5b5613270b1..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// IsLoggedInUserOKCode is the HTTP code returned for type IsLoggedInUserOK -const IsLoggedInUserOKCode int = 200 - -/* -IsLoggedInUserOK Currently logged in user - -swagger:response isLoggedInUserOK -*/ -type IsLoggedInUserOK struct { - - /* - In: Body - */ - Payload *IsLoggedInUserOKBody `json:"body,omitempty"` -} - -// NewIsLoggedInUserOK creates IsLoggedInUserOK with default headers values -func NewIsLoggedInUserOK() *IsLoggedInUserOK { - - return &IsLoggedInUserOK{} -} - -// WithPayload adds the payload to the is logged in user o k response -func (o *IsLoggedInUserOK) WithPayload(payload *IsLoggedInUserOKBody) *IsLoggedInUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the is logged in user o k response -func (o *IsLoggedInUserOK) SetPayload(payload *IsLoggedInUserOKBody) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *IsLoggedInUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// IsLoggedInUserBadRequestCode is the HTTP code returned for type IsLoggedInUserBadRequest -const IsLoggedInUserBadRequestCode int = 400 - -/* -IsLoggedInUserBadRequest invalid request - -swagger:response isLoggedInUserBadRequest -*/ -type IsLoggedInUserBadRequest struct { -} - -// NewIsLoggedInUserBadRequest creates IsLoggedInUserBadRequest with default headers values -func NewIsLoggedInUserBadRequest() *IsLoggedInUserBadRequest { - - return &IsLoggedInUserBadRequest{} -} - -// WriteResponse to the client -func (o *IsLoggedInUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// IsLoggedInUserInternalServerErrorCode is the HTTP code returned for type IsLoggedInUserInternalServerError -const IsLoggedInUserInternalServerErrorCode int = 500 - -/* -IsLoggedInUserInternalServerError server error - -swagger:response isLoggedInUserInternalServerError -*/ -type IsLoggedInUserInternalServerError struct { -} - -// NewIsLoggedInUserInternalServerError creates IsLoggedInUserInternalServerError with default headers values -func NewIsLoggedInUserInternalServerError() *IsLoggedInUserInternalServerError { - - return &IsLoggedInUserInternalServerError{} -} - -// WriteResponse to the client -func (o *IsLoggedInUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go deleted file mode 100644 index 0957510d8e9..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// IsLoggedInUserURL generates an URL for the is logged in user operation -type IsLoggedInUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsLoggedInUserURL) WithBasePath(bp string) *IsLoggedInUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *IsLoggedInUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *IsLoggedInUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/users/is_logged_in" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *IsLoggedInUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *IsLoggedInUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *IsLoggedInUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on IsLoggedInUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on IsLoggedInUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *IsLoggedInUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go deleted file mode 100644 index e661ccc30d3..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ShowLoggedInUserHandlerFunc turns a function with the right signature into a show logged in user handler -type ShowLoggedInUserHandlerFunc func(ShowLoggedInUserParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ShowLoggedInUserHandlerFunc) Handle(params ShowLoggedInUserParams) middleware.Responder { - return fn(params) -} - -// ShowLoggedInUserHandler interface for that can handle valid show logged in user params -type ShowLoggedInUserHandler interface { - Handle(ShowLoggedInUserParams) middleware.Responder -} - -// NewShowLoggedInUser creates a new http.Handler for the show logged in user operation -func NewShowLoggedInUser(ctx *middleware.Context, handler ShowLoggedInUserHandler) *ShowLoggedInUser { - return &ShowLoggedInUser{Context: ctx, Handler: handler} -} - -/* - ShowLoggedInUser swagger:route GET /users/logged_in users showLoggedInUser - -# Returns the user info for the currently logged in user - -Returns the user info for the currently logged in user -*/ -type ShowLoggedInUser struct { - Context *middleware.Context - Handler ShowLoggedInUserHandler -} - -func (o *ShowLoggedInUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewShowLoggedInUserParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go deleted file mode 100644 index d1cdcb6a449..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewShowLoggedInUserParams creates a new ShowLoggedInUserParams object -// -// There are no default values defined in the spec. -func NewShowLoggedInUserParams() ShowLoggedInUserParams { - - return ShowLoggedInUserParams{} -} - -// ShowLoggedInUserParams contains all the bound params for the show logged in user operation -// typically these are obtained from a http.Request -// -// swagger:parameters showLoggedInUser -type ShowLoggedInUserParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewShowLoggedInUserParams() beforehand. -func (o *ShowLoggedInUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go deleted file mode 100644 index bd218fd450e..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/internalmessages" -) - -// ShowLoggedInUserOKCode is the HTTP code returned for type ShowLoggedInUserOK -const ShowLoggedInUserOKCode int = 200 - -/* -ShowLoggedInUserOK Currently logged in user - -swagger:response showLoggedInUserOK -*/ -type ShowLoggedInUserOK struct { - - /* - In: Body - */ - Payload *internalmessages.LoggedInUserPayload `json:"body,omitempty"` -} - -// NewShowLoggedInUserOK creates ShowLoggedInUserOK with default headers values -func NewShowLoggedInUserOK() *ShowLoggedInUserOK { - - return &ShowLoggedInUserOK{} -} - -// WithPayload adds the payload to the show logged in user o k response -func (o *ShowLoggedInUserOK) WithPayload(payload *internalmessages.LoggedInUserPayload) *ShowLoggedInUserOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the show logged in user o k response -func (o *ShowLoggedInUserOK) SetPayload(payload *internalmessages.LoggedInUserPayload) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ShowLoggedInUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ShowLoggedInUserBadRequestCode is the HTTP code returned for type ShowLoggedInUserBadRequest -const ShowLoggedInUserBadRequestCode int = 400 - -/* -ShowLoggedInUserBadRequest invalid request - -swagger:response showLoggedInUserBadRequest -*/ -type ShowLoggedInUserBadRequest struct { -} - -// NewShowLoggedInUserBadRequest creates ShowLoggedInUserBadRequest with default headers values -func NewShowLoggedInUserBadRequest() *ShowLoggedInUserBadRequest { - - return &ShowLoggedInUserBadRequest{} -} - -// WriteResponse to the client -func (o *ShowLoggedInUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(400) -} - -// ShowLoggedInUserUnauthorizedCode is the HTTP code returned for type ShowLoggedInUserUnauthorized -const ShowLoggedInUserUnauthorizedCode int = 401 - -/* -ShowLoggedInUserUnauthorized request requires user authentication - -swagger:response showLoggedInUserUnauthorized -*/ -type ShowLoggedInUserUnauthorized struct { -} - -// NewShowLoggedInUserUnauthorized creates ShowLoggedInUserUnauthorized with default headers values -func NewShowLoggedInUserUnauthorized() *ShowLoggedInUserUnauthorized { - - return &ShowLoggedInUserUnauthorized{} -} - -// WriteResponse to the client -func (o *ShowLoggedInUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(401) -} - -// ShowLoggedInUserInternalServerErrorCode is the HTTP code returned for type ShowLoggedInUserInternalServerError -const ShowLoggedInUserInternalServerErrorCode int = 500 - -/* -ShowLoggedInUserInternalServerError server error - -swagger:response showLoggedInUserInternalServerError -*/ -type ShowLoggedInUserInternalServerError struct { -} - -// NewShowLoggedInUserInternalServerError creates ShowLoggedInUserInternalServerError with default headers values -func NewShowLoggedInUserInternalServerError() *ShowLoggedInUserInternalServerError { - - return &ShowLoggedInUserInternalServerError{} -} - -// WriteResponse to the client -func (o *ShowLoggedInUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(500) -} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go deleted file mode 100644 index dcf0616dcf8..00000000000 --- a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package users - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ShowLoggedInUserURL generates an URL for the show logged in user operation -type ShowLoggedInUserURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowLoggedInUserURL) WithBasePath(bp string) *ShowLoggedInUserURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ShowLoggedInUserURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ShowLoggedInUserURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/users/logged_in" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/internal" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ShowLoggedInUserURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ShowLoggedInUserURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ShowLoggedInUserURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ShowLoggedInUserURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ShowLoggedInUserURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ShowLoggedInUserURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/internalapi/server.go b/pkg/gen/internalapi/server.go deleted file mode 100644 index afa8c2a8581..00000000000 --- a/pkg/gen/internalapi/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *internaloperations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *internaloperations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *internaloperations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/internalmessages/create_mobile_home_shipment.go b/pkg/gen/internalmessages/create_mobile_home_shipment.go deleted file mode 100644 index 378f28bbdac..00000000000 --- a/pkg/gen/internalmessages/create_mobile_home_shipment.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateMobileHomeShipment A mobile home shipment that the prime moves for a service member. -// -// swagger:model CreateMobileHomeShipment -type CreateMobileHomeShipment struct { - - // Height of the Mobile Home in inches - // Required: true - HeightInInches *int64 `json:"heightInInches"` - - // Length of the Mobile Home in inches - // Required: true - LengthInInches *int64 `json:"lengthInInches"` - - // Make of the Mobile Home - // Required: true - Make *string `json:"make"` - - // Model of the Mobile Home - // Required: true - Model *string `json:"model"` - - // Width of the Mobile Home in inches - // Required: true - WidthInInches *int64 `json:"widthInInches"` - - // Year of the Mobile Home - // Required: true - Year *int64 `json:"year"` -} - -// Validate validates this create mobile home shipment -func (m *CreateMobileHomeShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeightInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLengthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMake(formats); err != nil { - res = append(res, err) - } - - if err := m.validateModel(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidthInInches(formats); err != nil { - res = append(res, err) - } - - if err := m.validateYear(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateMobileHomeShipment) validateHeightInInches(formats strfmt.Registry) error { - - if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateLengthInInches(formats strfmt.Registry) error { - - if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateMake(formats strfmt.Registry) error { - - if err := validate.Required("make", "body", m.Make); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateModel(formats strfmt.Registry) error { - - if err := validate.Required("model", "body", m.Model); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateWidthInInches(formats strfmt.Registry) error { - - if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { - return err - } - - return nil -} - -func (m *CreateMobileHomeShipment) validateYear(formats strfmt.Registry) error { - - if err := validate.Required("year", "body", m.Year); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this create mobile home shipment based on context it is used -func (m *CreateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *CreateMobileHomeShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateMobileHomeShipment) UnmarshalBinary(b []byte) error { - var res CreateMobileHomeShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_p_p_m_shipment.go b/pkg/gen/internalmessages/create_p_p_m_shipment.go deleted file mode 100644 index 98c9983390d..00000000000 --- a/pkg/gen/internalmessages/create_p_p_m_shipment.go +++ /dev/null @@ -1,411 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreatePPMShipment A personally procured move is a type of shipment that a service members moves themselves. -// -// swagger:model CreatePPMShipment -type CreatePPMShipment struct { - - // destination address - // Required: true - DestinationAddress *PPMDestinationAddress `json:"destinationAddress"` - - // Date the customer expects to move. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Denotes if this PPM shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // pickup address - // Required: true - PickupAddress *Address `json:"pickupAddress"` - - // secondary destination address - SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // sit expected - // Required: true - SitExpected *bool `json:"sitExpected"` - - // tertiary destination address - TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this create p p m shipment -func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - - if err := validate.Required("destinationAddress", "body", m.DestinationAddress); err != nil { - return err - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { - - if err := validate.Required("pickupAddress", "body", m.PickupAddress); err != nil { - return err - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if m.SecondaryDestinationAddress != nil { - if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *CreatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if m.TertiaryDestinationAddress != nil { - if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create p p m shipment based on the context it is used -func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDestinationAddress != nil { - - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDestinationAddress != nil { - - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreatePPMShipment) UnmarshalBinary(b []byte) error { - var res CreatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go b/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go deleted file mode 100644 index dd4f284258f..00000000000 --- a/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateServiceMemberBackupContactPayload create service member backup contact payload -// -// swagger:model CreateServiceMemberBackupContactPayload -type CreateServiceMemberBackupContactPayload struct { - - // Email - // Example: john_bob@exmaple.com - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email"` - - // Name - // Example: Susan Smith - // Required: true - Name *string `json:"name"` - - // permission - // Required: true - Permission *BackupContactPermission `json:"permission"` - - // Phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` -} - -// Validate validates this create service member backup contact payload -func (m *CreateServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePermission(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if m.Permission != nil { - if err := m.Permission.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create service member backup contact payload based on the context it is used -func (m *CreateServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePermission(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { - - if m.Permission != nil { - - if err := m.Permission.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { - var res CreateServiceMemberBackupContactPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_service_member_payload.go b/pkg/gen/internalmessages/create_service_member_payload.go deleted file mode 100644 index 737d5a0a897..00000000000 --- a/pkg/gen/internalmessages/create_service_member_payload.go +++ /dev/null @@ -1,421 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateServiceMemberPayload create service member payload -// -// swagger:model CreateServiceMemberPayload -type CreateServiceMemberPayload struct { - - // affiliation - Affiliation *Affiliation `json:"affiliation,omitempty"` - - // backup mailing address - BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` - - // current location id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CurrentLocationID *strfmt.UUID `json:"current_location_id,omitempty"` - - // DoD ID number - // Example: 5789345789 - // Max Length: 10 - // Min Length: 10 - // Pattern: ^\d{10}$ - Edipi *string `json:"edipi,omitempty"` - - // Email - EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` - - // First name - // Example: John - FirstName *string `json:"first_name,omitempty"` - - // grade - Grade *OrderPayGrade `json:"grade,omitempty"` - - // Last name - // Example: Donut - LastName *string `json:"last_name,omitempty"` - - // Middle name - // Example: L. - MiddleName *string `json:"middle_name,omitempty"` - - // Personal email - // Example: john_bob@example.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail *string `json:"personal_email,omitempty"` - - // Phone - PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` - - // residential address - ResidentialAddress *Address `json:"residential_address,omitempty"` - - // Alternate phone - // Example: 212-555-5555 - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - SecondaryTelephone *string `json:"secondary_telephone,omitempty"` - - // Suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // Best contact phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // user id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"user_id,omitempty"` -} - -// Validate validates this create service member payload -func (m *CreateServiceMemberPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffiliation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupMailingAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResidentialAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if m.Affiliation != nil { - if err := m.Affiliation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if m.BackupMailingAddress != nil { - if err := m.BackupMailingAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateCurrentLocationID(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentLocationID) { // not required - return nil - } - - if err := validate.FormatOf("current_location_id", "body", "uuid", m.CurrentLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.Edipi) { // not required - return nil - } - - if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if m.ResidentialAddress != nil { - if err := m.ResidentialAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *CreateServiceMemberPayload) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create service member payload based on the context it is used -func (m *CreateServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAffiliation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { - - if m.Affiliation != nil { - - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupMailingAddress != nil { - - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.ResidentialAddress != nil { - - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateServiceMemberPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateServiceMemberPayload) UnmarshalBinary(b []byte) error { - var res CreateServiceMemberPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_shipment.go b/pkg/gen/internalmessages/create_shipment.go deleted file mode 100644 index 284a4c755e0..00000000000 --- a/pkg/gen/internalmessages/create_shipment.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateShipment create shipment -// -// swagger:model CreateShipment -type CreateShipment struct { - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // boat shipment - BoatShipment *CreateBoatShipment `json:"boatShipment,omitempty"` - - // customer remarks - // Example: handle with care - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // mobile home shipment - MobileHomeShipment *CreateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` - - // move task order ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *CreatePPMShipment `json:"ppmShipment,omitempty"` - - // requested delivery date - // Format: date - RequestedDeliveryDate strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate strfmt.Date `json:"requestedPickupDate,omitempty"` - - // secondary delivery address - SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // shipment type - // Required: true - ShipmentType *MTOShipmentType `json:"shipmentType"` - - // tertiary delivery address - TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this create shipment -func (m *CreateShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateShipment) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *CreateShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if m.SecondaryDeliveryAddress != nil { - if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateShipmentType(formats strfmt.Registry) error { - - if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { - return err - } - - if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { - return err - } - - if m.ShipmentType != nil { - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if m.TertiaryDeliveryAddress != nil { - if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create shipment based on the context it is used -func (m *CreateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *CreateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDeliveryAddress != nil { - - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if m.ShipmentType != nil { - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDeliveryAddress != nil { - - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *CreateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateShipment) UnmarshalBinary(b []byte) error { - var res CreateShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_signed_certification_payload.go b/pkg/gen/internalmessages/create_signed_certification_payload.go deleted file mode 100644 index b22c458c6b8..00000000000 --- a/pkg/gen/internalmessages/create_signed_certification_payload.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateSignedCertificationPayload create signed certification payload -// -// swagger:model CreateSignedCertificationPayload -type CreateSignedCertificationPayload struct { - - // certification text - // Required: true - CertificationText *string `json:"certification_text"` - - // certification type - CertificationType *SignedCertificationTypeCreate `json:"certification_type,omitempty"` - - // Date - // Required: true - // Format: date-time - Date *strfmt.DateTime `json:"date"` - - // personally procured move id - // Format: uuid - PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` - - // ppm id - // Format: uuid - PpmID *PpmID `json:"ppm_id,omitempty"` - - // Signature - // Required: true - Signature *string `json:"signature"` -} - -// Validate validates this create signed certification payload -func (m *CreateSignedCertificationPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificationText(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonallyProcuredMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignature(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateSignedCertificationPayload) validateCertificationText(formats strfmt.Registry) error { - - if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { - return err - } - - return nil -} - -func (m *CreateSignedCertificationPayload) validateCertificationType(formats strfmt.Registry) error { - if swag.IsZero(m.CertificationType) { // not required - return nil - } - - if m.CertificationType != nil { - if err := m.CertificationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certification_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certification_type") - } - return err - } - } - - return nil -} - -func (m *CreateSignedCertificationPayload) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateSignedCertificationPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.PersonallyProcuredMoveID) { // not required - return nil - } - - if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateSignedCertificationPayload) validatePpmID(formats strfmt.Registry) error { - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if m.PpmID != nil { - if err := m.PpmID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppm_id") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppm_id") - } - return err - } - } - - return nil -} - -func (m *CreateSignedCertificationPayload) validateSignature(formats strfmt.Registry) error { - - if err := validate.Required("signature", "body", m.Signature); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create signed certification payload based on the context it is used -func (m *CreateSignedCertificationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateSignedCertificationPayload) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { - - if m.CertificationType != nil { - - if swag.IsZero(m.CertificationType) { // not required - return nil - } - - if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certification_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certification_type") - } - return err - } - } - - return nil -} - -func (m *CreateSignedCertificationPayload) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmID != nil { - - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if err := m.PpmID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppm_id") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppm_id") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateSignedCertificationPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateSignedCertificationPayload) UnmarshalBinary(b []byte) error { - var res CreateSignedCertificationPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_update_orders.go b/pkg/gen/internalmessages/create_update_orders.go deleted file mode 100644 index 7ccd66e1beb..00000000000 --- a/pkg/gen/internalmessages/create_update_orders.go +++ /dev/null @@ -1,482 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateUpdateOrders create update orders -// -// swagger:model CreateUpdateOrders -type CreateUpdateOrders struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompanied_tour,omitempty"` - - // counseling office id - // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 - // Format: uuid - CounselingOfficeID *strfmt.UUID `json:"counseling_office_id,omitempty"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependents_twelve_and_over,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependents_under_twelve,omitempty"` - - // grade - Grade *OrderPayGrade `json:"grade,omitempty"` - - // Are dependents included in your orders? - // Required: true - HasDependents *bool `json:"has_dependents"` - - // Orders date - // - // The date and time that these orders were cut. - // Example: 2018-04-26 - // Required: true - // Format: date - IssueDate *strfmt.Date `json:"issue_date"` - - // move id - // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 - // Format: uuid - MoveID strfmt.UUID `json:"move_id,omitempty"` - - // new duty location id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - NewDutyLocationID *strfmt.UUID `json:"new_duty_location_id"` - - // Orders Number - // Example: 030-00362 - OrdersNumber *string `json:"orders_number,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"orders_type"` - - // orders type detail - OrdersTypeDetail *OrdersTypeDetail `json:"orders_type_detail,omitempty"` - - // origin duty location id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OriginDutyLocationID strfmt.UUID `json:"origin_duty_location_id,omitempty"` - - // Report-by date - // - // Report By Date - // Example: 2018-04-26 - // Required: true - // Format: date - ReportByDate *strfmt.Date `json:"report_by_date"` - - // SAC - // Example: N002214CSW32Y9 - Sac *string `json:"sac,omitempty"` - - // service member id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"service_member_id"` - - // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? - // Required: true - SpouseHasProGear *bool `json:"spouse_has_pro_gear"` - - // TAC - // Example: F8J1 - Tac *string `json:"tac,omitempty"` -} - -// Validate validates this create update orders -func (m *CreateUpdateOrders) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCounselingOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasDependents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssueDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpouseHasProGear(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateUpdateOrders) validateCounselingOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.CounselingOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("counseling_office_id", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) validateHasDependents(formats strfmt.Registry) error { - - if err := validate.Required("has_dependents", "body", m.HasDependents); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateIssueDate(formats strfmt.Registry) error { - - if err := validate.Required("issue_date", "body", m.IssueDate); err != nil { - return err - } - - if err := validate.FormatOf("issue_date", "body", "date", m.IssueDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveID) { // not required - return nil - } - - if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateNewDutyLocationID(formats strfmt.Registry) error { - - if err := validate.Required("new_duty_location_id", "body", m.NewDutyLocationID); err != nil { - return err - } - - if err := validate.FormatOf("new_duty_location_id", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) validateOrdersTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if m.OrdersTypeDetail != nil { - if err := m.OrdersTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type_detail") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) validateOriginDutyLocationID(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocationID) { // not required - return nil - } - - if err := validate.FormatOf("origin_duty_location_id", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateReportByDate(formats strfmt.Registry) error { - - if err := validate.Required("report_by_date", "body", m.ReportByDate); err != nil { - return err - } - - if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateUpdateOrders) validateSpouseHasProGear(formats strfmt.Registry) error { - - if err := validate.Required("spouse_has_pro_gear", "body", m.SpouseHasProGear); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this create update orders based on the context it is used -func (m *CreateUpdateOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateUpdateOrders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *CreateUpdateOrders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersTypeDetail != nil { - - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type_detail") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateUpdateOrders) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateUpdateOrders) UnmarshalBinary(b []byte) error { - var res CreateUpdateOrders - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go b/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go deleted file mode 100644 index 171c18d429d..00000000000 --- a/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// CreateWeightTicketDocumentsPayload create weight ticket documents payload -// -// swagger:model CreateWeightTicketDocumentsPayload -type CreateWeightTicketDocumentsPayload struct { - - // empty weight ticket recorded weight - // Minimum: 0 - EmptyWeight *int64 `json:"empty_weight,omitempty"` - - // missing empty weight ticket - // Required: true - EmptyWeightTicketMissing *bool `json:"empty_weight_ticket_missing"` - - // full weight ticket recorded weight - // Minimum: 0 - FullWeight *int64 `json:"full_weight,omitempty"` - - // missing full weight ticket - // Required: true - FullWeightTicketMissing *bool `json:"full_weight_ticket_missing"` - - // personally procured move id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id"` - - // missing trailer ownership documentation - // Required: true - TrailerOwnershipMissing *bool `json:"trailer_ownership_missing"` - - // upload ids - UploadIds []strfmt.UUID `json:"upload_ids"` - - // Vehicle make - VehicleMake *string `json:"vehicle_make,omitempty"` - - // Vehicle model - VehicleModel *string `json:"vehicle_model,omitempty"` - - // Vehicle nickname (ex. 'Large box truck') - VehicleNickname *string `json:"vehicle_nickname,omitempty"` - - // Full Weight Ticket Date - // Example: 2018-04-26 - // Format: date - WeightTicketDate *strfmt.Date `json:"weight_ticket_date,omitempty"` - - // weight ticket set type - // Required: true - WeightTicketSetType *WeightTicketSetType `json:"weight_ticket_set_type"` -} - -// Validate validates this create weight ticket documents payload -func (m *CreateWeightTicketDocumentsPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeightTicketMissing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeightTicketMissing(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonallyProcuredMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTrailerOwnershipMissing(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadIds(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTicketDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTicketSetType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("empty_weight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateEmptyWeightTicketMissing(formats strfmt.Registry) error { - - if err := validate.Required("empty_weight_ticket_missing", "body", m.EmptyWeightTicketMissing); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("full_weight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateFullWeightTicketMissing(formats strfmt.Registry) error { - - if err := validate.Required("full_weight_ticket_missing", "body", m.FullWeightTicketMissing); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - - if err := validate.Required("personally_procured_move_id", "body", m.PersonallyProcuredMoveID); err != nil { - return err - } - - if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateTrailerOwnershipMissing(formats strfmt.Registry) error { - - if err := validate.Required("trailer_ownership_missing", "body", m.TrailerOwnershipMissing); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateUploadIds(formats strfmt.Registry) error { - if swag.IsZero(m.UploadIds) { // not required - return nil - } - - for i := 0; i < len(m.UploadIds); i++ { - - if err := validate.FormatOf("upload_ids"+"."+strconv.Itoa(i), "body", "uuid", m.UploadIds[i].String(), formats); err != nil { - return err - } - - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateWeightTicketDate(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTicketDate) { // not required - return nil - } - - if err := validate.FormatOf("weight_ticket_date", "body", "date", m.WeightTicketDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) validateWeightTicketSetType(formats strfmt.Registry) error { - - if err := validate.Required("weight_ticket_set_type", "body", m.WeightTicketSetType); err != nil { - return err - } - - if err := validate.Required("weight_ticket_set_type", "body", m.WeightTicketSetType); err != nil { - return err - } - - if m.WeightTicketSetType != nil { - if err := m.WeightTicketSetType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_ticket_set_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_ticket_set_type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this create weight ticket documents payload based on the context it is used -func (m *CreateWeightTicketDocumentsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateWeightTicketSetType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *CreateWeightTicketDocumentsPayload) contextValidateWeightTicketSetType(ctx context.Context, formats strfmt.Registry) error { - - if m.WeightTicketSetType != nil { - - if err := m.WeightTicketSetType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_ticket_set_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_ticket_set_type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *CreateWeightTicketDocumentsPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *CreateWeightTicketDocumentsPayload) UnmarshalBinary(b []byte) error { - var res CreateWeightTicketDocumentsPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/dept_indicator.go b/pkg/gen/internalmessages/dept_indicator.go deleted file mode 100644 index 9fbe14d6834..00000000000 --- a/pkg/gen/internalmessages/dept_indicator.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// DeptIndicator Dept. indicator -// -// swagger:model DeptIndicator -type DeptIndicator string - -func NewDeptIndicator(value DeptIndicator) *DeptIndicator { - return &value -} - -// Pointer returns a pointer to a freshly-allocated DeptIndicator. -func (m DeptIndicator) Pointer() *DeptIndicator { - return &m -} - -const ( - - // DeptIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" - DeptIndicatorNAVYANDMARINES DeptIndicator = "NAVY_AND_MARINES" - - // DeptIndicatorARMY captures enum value "ARMY" - DeptIndicatorARMY DeptIndicator = "ARMY" - - // DeptIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" - DeptIndicatorARMYCORPSOFENGINEERS DeptIndicator = "ARMY_CORPS_OF_ENGINEERS" - - // DeptIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" - DeptIndicatorAIRANDSPACEFORCE DeptIndicator = "AIR_AND_SPACE_FORCE" - - // DeptIndicatorCOASTGUARD captures enum value "COAST_GUARD" - DeptIndicatorCOASTGUARD DeptIndicator = "COAST_GUARD" - - // DeptIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" - DeptIndicatorOFFICEOFSECRETARYOFDEFENSE DeptIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" -) - -// for schema -var deptIndicatorEnum []interface{} - -func init() { - var res []DeptIndicator - if err := json.Unmarshal([]byte(`["NAVY_AND_MARINES","ARMY","ARMY_CORPS_OF_ENGINEERS","AIR_AND_SPACE_FORCE","COAST_GUARD","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - deptIndicatorEnum = append(deptIndicatorEnum, v) - } -} - -func (m DeptIndicator) validateDeptIndicatorEnum(path, location string, value DeptIndicator) error { - if err := validate.EnumCase(path, location, value, deptIndicatorEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this dept indicator -func (m DeptIndicator) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateDeptIndicatorEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this dept indicator based on context it is used -func (m DeptIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/document.go b/pkg/gen/internalmessages/document.go deleted file mode 100644 index 20005ca96d6..00000000000 --- a/pkg/gen/internalmessages/document.go +++ /dev/null @@ -1,169 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Document document -// -// swagger:model Document -type Document struct { - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // The service member this document belongs to - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"service_member_id"` - - // uploads - // Required: true - Uploads []*Upload `json:"uploads"` -} - -// Validate validates this document -func (m *Document) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Document) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Document) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Document) validateUploads(formats strfmt.Registry) error { - - if err := validate.Required("uploads", "body", m.Uploads); err != nil { - return err - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this document based on the context it is used -func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Document) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Document) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Document) UnmarshalBinary(b []byte) error { - var res Document - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/duty_location_payload.go b/pkg/gen/internalmessages/duty_location_payload.go deleted file mode 100644 index fbc69c41949..00000000000 --- a/pkg/gen/internalmessages/duty_location_payload.go +++ /dev/null @@ -1,346 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// DutyLocationPayload duty location payload -// -// swagger:model DutyLocationPayload -type DutyLocationPayload struct { - - // address - Address *Address `json:"address,omitempty"` - - // address id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - AddressID *strfmt.UUID `json:"address_id"` - - // affiliation - // Required: true - Affiliation *Affiliation `json:"affiliation"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // name - // Example: Fort Bragg North Station - // Required: true - Name *string `json:"name"` - - // provides services counseling - ProvidesServicesCounseling bool `json:"provides_services_counseling,omitempty"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportation_office,omitempty"` - - // transportation office id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportation_office_id,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this duty location payload -func (m *DutyLocationPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAddressID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAffiliation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocationPayload) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *DutyLocationPayload) validateAddressID(formats strfmt.Registry) error { - - if err := validate.Required("address_id", "body", m.AddressID); err != nil { - return err - } - - if err := validate.FormatOf("address_id", "body", "uuid", m.AddressID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocationPayload) validateAffiliation(formats strfmt.Registry) error { - - if err := validate.Required("affiliation", "body", m.Affiliation); err != nil { - return err - } - - if err := validate.Required("affiliation", "body", m.Affiliation); err != nil { - return err - } - - if m.Affiliation != nil { - if err := m.Affiliation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *DutyLocationPayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocationPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocationPayload) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *DutyLocationPayload) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office") - } - return err - } - } - - return nil -} - -func (m *DutyLocationPayload) validateTransportationOfficeID(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeID) { // not required - return nil - } - - if err := validate.FormatOf("transportation_office_id", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *DutyLocationPayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this duty location payload based on the context it is used -func (m *DutyLocationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAffiliation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *DutyLocationPayload) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *DutyLocationPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { - - if m.Affiliation != nil { - - if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *DutyLocationPayload) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *DutyLocationPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *DutyLocationPayload) UnmarshalBinary(b []byte) error { - var res DutyLocationPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/duty_locations_payload.go b/pkg/gen/internalmessages/duty_locations_payload.go deleted file mode 100644 index d8419ed65ce..00000000000 --- a/pkg/gen/internalmessages/duty_locations_payload.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// DutyLocationsPayload duty locations payload -// -// swagger:model DutyLocationsPayload -type DutyLocationsPayload []*DutyLocationPayload - -// Validate validates this duty locations payload -func (m DutyLocationsPayload) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this duty locations payload based on the context it is used -func (m DutyLocationsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/entitlement.go b/pkg/gen/internalmessages/entitlement.go deleted file mode 100644 index 703b403758f..00000000000 --- a/pkg/gen/internalmessages/entitlement.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// Entitlement entitlement -// -// swagger:model Entitlement -type Entitlement struct { - - // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. - // Example: true - AccompaniedTour *bool `json:"accompanied_tour,omitempty"` - - // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. - // Example: 3 - DependentsTwelveAndOver *int64 `json:"dependents_twelve_and_over,omitempty"` - - // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. - // Example: 5 - DependentsUnderTwelve *int64 `json:"dependents_under_twelve,omitempty"` - - // Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade - // - // Example: 2000 - ProGear *int64 `json:"proGear,omitempty"` - - // Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade - // - // Example: 500 - ProGearSpouse *int64 `json:"proGearSpouse,omitempty"` - - // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. - // Example: 3 - UbAllowance *int64 `json:"ub_allowance,omitempty"` -} - -// Validate validates this entitlement -func (m *Entitlement) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this entitlement based on context it is used -func (m *Entitlement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Entitlement) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Entitlement) UnmarshalBinary(b []byte) error { - var res Entitlement - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/error.go b/pkg/gen/internalmessages/error.go deleted file mode 100644 index 3d1ef7509ac..00000000000 --- a/pkg/gen/internalmessages/error.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // detail - // Required: true - Detail *string `json:"detail"` - - // instance - // Format: uuid - Instance strfmt.UUID `json:"instance,omitempty"` - - // title - // Required: true - Title *string `json:"title"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Error) validateDetail(formats strfmt.Registry) error { - - if err := validate.Required("detail", "body", m.Detail); err != nil { - return err - } - - return nil -} - -func (m *Error) validateInstance(formats strfmt.Registry) error { - if swag.IsZero(m.Instance) { // not required - return nil - } - - if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Error) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/feature_flag_boolean.go b/pkg/gen/internalmessages/feature_flag_boolean.go deleted file mode 100644 index 13b43ec4738..00000000000 --- a/pkg/gen/internalmessages/feature_flag_boolean.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FeatureFlagBoolean A feature flag -// -// swagger:model FeatureFlagBoolean -type FeatureFlagBoolean struct { - - // entity - // Example: 11111111-1111-1111-1111-111111111111 - // Required: true - Entity *string `json:"entity"` - - // key - // Example: flag - // Required: true - Key *string `json:"key"` - - // match - // Example: true - // Required: true - Match *bool `json:"match"` - - // namespace - // Example: test - // Required: true - Namespace *string `json:"namespace"` -} - -// Validate validates this feature flag boolean -func (m *FeatureFlagBoolean) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEntity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMatch(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNamespace(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FeatureFlagBoolean) validateEntity(formats strfmt.Registry) error { - - if err := validate.Required("entity", "body", m.Entity); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagBoolean) validateKey(formats strfmt.Registry) error { - - if err := validate.Required("key", "body", m.Key); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagBoolean) validateMatch(formats strfmt.Registry) error { - - if err := validate.Required("match", "body", m.Match); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagBoolean) validateNamespace(formats strfmt.Registry) error { - - if err := validate.Required("namespace", "body", m.Namespace); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this feature flag boolean based on context it is used -func (m *FeatureFlagBoolean) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FeatureFlagBoolean) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FeatureFlagBoolean) UnmarshalBinary(b []byte) error { - var res FeatureFlagBoolean - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/feature_flag_variant.go b/pkg/gen/internalmessages/feature_flag_variant.go deleted file mode 100644 index e0be90acfd3..00000000000 --- a/pkg/gen/internalmessages/feature_flag_variant.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// FeatureFlagVariant A feature flag -// -// swagger:model FeatureFlagVariant -type FeatureFlagVariant struct { - - // entity - // Example: 11111111-1111-1111-1111-111111111111 - // Required: true - Entity *string `json:"entity"` - - // key - // Example: flag - // Required: true - Key *string `json:"key"` - - // match - // Example: true - // Required: true - Match *bool `json:"match"` - - // namespace - // Example: test - // Required: true - Namespace *string `json:"namespace"` - - // variant - // Example: myval - // Required: true - Variant *string `json:"variant"` -} - -// Validate validates this feature flag variant -func (m *FeatureFlagVariant) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEntity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMatch(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNamespace(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVariant(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *FeatureFlagVariant) validateEntity(formats strfmt.Registry) error { - - if err := validate.Required("entity", "body", m.Entity); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagVariant) validateKey(formats strfmt.Registry) error { - - if err := validate.Required("key", "body", m.Key); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagVariant) validateMatch(formats strfmt.Registry) error { - - if err := validate.Required("match", "body", m.Match); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagVariant) validateNamespace(formats strfmt.Registry) error { - - if err := validate.Required("namespace", "body", m.Namespace); err != nil { - return err - } - - return nil -} - -func (m *FeatureFlagVariant) validateVariant(formats strfmt.Registry) error { - - if err := validate.Required("variant", "body", m.Variant); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this feature flag variant based on context it is used -func (m *FeatureFlagVariant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *FeatureFlagVariant) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *FeatureFlagVariant) UnmarshalBinary(b []byte) error { - var res FeatureFlagVariant - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/index_entitlements.go b/pkg/gen/internalmessages/index_entitlements.go deleted file mode 100644 index c20f2fd5056..00000000000 --- a/pkg/gen/internalmessages/index_entitlements.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// IndexEntitlements index entitlements -// -// swagger:model IndexEntitlements -type IndexEntitlements map[string]WeightAllotment - -// Validate validates this index entitlements -func (m IndexEntitlements) Validate(formats strfmt.Registry) error { - var res []error - - for k := range m { - - if err := validate.Required(k, "body", m[k]); err != nil { - return err - } - if val, ok := m[k]; ok { - if err := val.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(k) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(k) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this index entitlements based on the context it is used -func (m IndexEntitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for k := range m { - - if val, ok := m[k]; ok { - if err := val.ContextValidate(ctx, formats); err != nil { - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/index_moves_payload.go b/pkg/gen/internalmessages/index_moves_payload.go deleted file mode 100644 index 38f88edb504..00000000000 --- a/pkg/gen/internalmessages/index_moves_payload.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IndexMovesPayload index moves payload -// -// swagger:model IndexMovesPayload -type IndexMovesPayload []*MovePayload - -// Validate validates this index moves payload -func (m IndexMovesPayload) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this index moves payload based on the context it is used -func (m IndexMovesPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go b/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go deleted file mode 100644 index ea51e10a475..00000000000 --- a/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// IndexServiceMemberBackupContactsPayload index service member backup contacts payload -// -// swagger:model IndexServiceMemberBackupContactsPayload -type IndexServiceMemberBackupContactsPayload []*ServiceMemberBackupContactPayload - -// Validate validates this index service member backup contacts payload -func (m IndexServiceMemberBackupContactsPayload) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this index service member backup contacts payload based on the context it is used -func (m IndexServiceMemberBackupContactsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go deleted file mode 100644 index 3a2bc0e44f0..00000000000 --- a/pkg/gen/internalmessages/internal_move.go +++ /dev/null @@ -1,436 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// InternalMove internal move -// -// swagger:model InternalMove -type InternalMove struct { - - // closeout office - CloseoutOffice *TransportationOffice `json:"closeoutOffice,omitempty"` - - // counseling office - CounselingOffice *TransportationOffice `json:"counselingOffice,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - // mto shipments - MtoShipments MTOShipments `json:"mtoShipments,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // orders - Orders interface{} `json:"orders,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // status - // Read Only: true - Status string `json:"status,omitempty"` - - // submitted at - // Read Only: true - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this internal move -func (m *InternalMove) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloseoutOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCounselingOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InternalMove) validateCloseoutOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if m.CloseoutOffice != nil { - if err := m.CloseoutOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeoutOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeoutOffice") - } - return err - } - } - - return nil -} - -func (m *InternalMove) validateCounselingOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CounselingOffice) { // not required - return nil - } - - if m.CounselingOffice != nil { - if err := m.CounselingOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("counselingOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("counselingOffice") - } - return err - } - } - - return nil -} - -func (m *InternalMove) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) 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 *InternalMove) validateMtoShipments(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipments) { // not required - return nil - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this internal move based on the context it is used -func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselingOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubmittedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *InternalMove) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CloseoutOffice != nil { - - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeoutOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeoutOffice") - } - return err - } - } - - return nil -} - -func (m *InternalMove) contextValidateCounselingOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CounselingOffice != nil { - - if swag.IsZero(m.CounselingOffice) { // not required - return nil - } - - if err := m.CounselingOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("counselingOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("counselingOffice") - } - return err - } - } - - return nil -} - -func (m *InternalMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *InternalMove) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateSubmittedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "submittedAt", "body", m.SubmittedAt); err != nil { - return err - } - - return nil -} - -func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *InternalMove) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InternalMove) UnmarshalBinary(b []byte) error { - var res InternalMove - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/invalid_request_response_payload.go b/pkg/gen/internalmessages/invalid_request_response_payload.go deleted file mode 100644 index 724f9f641e3..00000000000 --- a/pkg/gen/internalmessages/invalid_request_response_payload.go +++ /dev/null @@ -1,50 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// InvalidRequestResponsePayload invalid request response payload -// -// swagger:model InvalidRequestResponsePayload -type InvalidRequestResponsePayload struct { - - // errors - Errors map[string]string `json:"errors,omitempty"` -} - -// Validate validates this invalid request response payload -func (m *InvalidRequestResponsePayload) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this invalid request response payload based on context it is used -func (m *InvalidRequestResponsePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *InvalidRequestResponsePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *InvalidRequestResponsePayload) UnmarshalBinary(b []byte) error { - var res InvalidRequestResponsePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/is_date_weekend_holiday_info.go b/pkg/gen/internalmessages/is_date_weekend_holiday_info.go deleted file mode 100644 index fac465ba617..00000000000 --- a/pkg/gen/internalmessages/is_date_weekend_holiday_info.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// IsDateWeekendHolidayInfo is date weekend holiday info -// -// swagger:model IsDateWeekendHolidayInfo -type IsDateWeekendHolidayInfo struct { - - // country code - // Required: true - CountryCode *string `json:"country_code"` - - // country name - // Required: true - CountryName *string `json:"country_name"` - - // date - // Example: 2018-09-25 - // Required: true - // Format: date - Date *strfmt.Date `json:"date"` - - // details - Details string `json:"details,omitempty"` - - // is holiday - // Required: true - IsHoliday *bool `json:"is_holiday"` - - // is weekend - // Required: true - IsWeekend *bool `json:"is_weekend"` -} - -// Validate validates this is date weekend holiday info -func (m *IsDateWeekendHolidayInfo) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCountryCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCountryName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsHoliday(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsWeekend(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateCountryCode(formats strfmt.Registry) error { - - if err := validate.Required("country_code", "body", m.CountryCode); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateCountryName(formats strfmt.Registry) error { - - if err := validate.Required("country_name", "body", m.CountryName); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateIsHoliday(formats strfmt.Registry) error { - - if err := validate.Required("is_holiday", "body", m.IsHoliday); err != nil { - return err - } - - return nil -} - -func (m *IsDateWeekendHolidayInfo) validateIsWeekend(formats strfmt.Registry) error { - - if err := validate.Required("is_weekend", "body", m.IsWeekend); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this is date weekend holiday info based on context it is used -func (m *IsDateWeekendHolidayInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *IsDateWeekendHolidayInfo) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *IsDateWeekendHolidayInfo) UnmarshalBinary(b []byte) error { - var res IsDateWeekendHolidayInfo - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/logged_in_user_payload.go b/pkg/gen/internalmessages/logged_in_user_payload.go deleted file mode 100644 index 95dc5a0fb49..00000000000 --- a/pkg/gen/internalmessages/logged_in_user_payload.go +++ /dev/null @@ -1,365 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// LoggedInUserPayload logged in user payload -// -// swagger:model LoggedInUserPayload -type LoggedInUserPayload struct { - - // email - // Example: john_bob@example.com - // Read Only: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email string `json:"email,omitempty"` - - // first name - // Example: John - // Read Only: true - FirstName string `json:"first_name,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // office user - OfficeUser *OfficeUser `json:"office_user,omitempty"` - - // permissions - Permissions []string `json:"permissions"` - - // privileges - Privileges []*Privilege `json:"privileges"` - - // roles - Roles []*Role `json:"roles"` - - // service member - ServiceMember *ServiceMemberPayload `json:"service_member,omitempty"` -} - -// Validate validates this logged in user payload -func (m *LoggedInUserPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUser(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrivileges(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoles(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMember(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoggedInUserPayload) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *LoggedInUserPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *LoggedInUserPayload) validateOfficeUser(formats strfmt.Registry) error { - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if m.OfficeUser != nil { - if err := m.OfficeUser.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("office_user") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("office_user") - } - return err - } - } - - return nil -} - -func (m *LoggedInUserPayload) validatePrivileges(formats strfmt.Registry) error { - if swag.IsZero(m.Privileges) { // not required - return nil - } - - for i := 0; i < len(m.Privileges); i++ { - if swag.IsZero(m.Privileges[i]) { // not required - continue - } - - if m.Privileges[i] != nil { - if err := m.Privileges[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *LoggedInUserPayload) validateRoles(formats strfmt.Registry) error { - if swag.IsZero(m.Roles) { // not required - return nil - } - - for i := 0; i < len(m.Roles); i++ { - if swag.IsZero(m.Roles[i]) { // not required - continue - } - - if m.Roles[i] != nil { - if err := m.Roles[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *LoggedInUserPayload) validateServiceMember(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMember) { // not required - return nil - } - - if m.ServiceMember != nil { - if err := m.ServiceMember.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_member") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_member") - } - return err - } - } - - return nil -} - -// ContextValidate validate this logged in user payload based on the context it is used -func (m *LoggedInUserPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEmail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFirstName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOfficeUser(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrivileges(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRoles(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceMember(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *LoggedInUserPayload) contextValidateEmail(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "email", "body", string(m.Email)); err != nil { - return err - } - - return nil -} - -func (m *LoggedInUserPayload) contextValidateFirstName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "first_name", "body", string(m.FirstName)); err != nil { - return err - } - - return nil -} - -func (m *LoggedInUserPayload) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { - - if m.OfficeUser != nil { - - if swag.IsZero(m.OfficeUser) { // not required - return nil - } - - if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("office_user") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("office_user") - } - return err - } - } - - return nil -} - -func (m *LoggedInUserPayload) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Privileges); i++ { - - if m.Privileges[i] != nil { - - if swag.IsZero(m.Privileges[i]) { // not required - return nil - } - - if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *LoggedInUserPayload) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Roles); i++ { - - if m.Roles[i] != nil { - - if swag.IsZero(m.Roles[i]) { // not required - return nil - } - - if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("roles" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("roles" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *LoggedInUserPayload) contextValidateServiceMember(ctx context.Context, formats strfmt.Registry) error { - - if m.ServiceMember != nil { - - if swag.IsZero(m.ServiceMember) { // not required - return nil - } - - if err := m.ServiceMember.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("service_member") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("service_member") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *LoggedInUserPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *LoggedInUserPayload) UnmarshalBinary(b []byte) error { - var res LoggedInUserPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_agent.go b/pkg/gen/internalmessages/m_t_o_agent.go deleted file mode 100644 index 1f6da8f4e7d..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agent.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgent m t o agent -// -// swagger:model MTOAgent -type MTOAgent struct { - - // agent type - AgentType MTOAgentType `json:"agentType,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // email - // Pattern: (^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$) - Email *string `json:"email,omitempty"` - - // first name - FirstName *string `json:"firstName,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName *string `json:"lastName,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // phone - // Pattern: (^[2-9]\d{2}-\d{3}-\d{4}$)|(^$) - Phone *string `json:"phone,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o agent -func (m *MTOAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$)`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `(^[2-9]\d{2}-\d{3}-\d{4}$)|(^$)`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o agent based on the context it is used -func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOAgent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOAgent) UnmarshalBinary(b []byte) error { - var res MTOAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_agent_type.go b/pkg/gen/internalmessages/m_t_o_agent_type.go deleted file mode 100644 index 12c0138a1c7..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agent_type.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOAgentType MTO Agent Type -// Example: RELEASING_AGENT -// -// swagger:model MTOAgentType -type MTOAgentType string - -func NewMTOAgentType(value MTOAgentType) *MTOAgentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOAgentType. -func (m MTOAgentType) Pointer() *MTOAgentType { - return &m -} - -const ( - - // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" - - // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" -) - -// for schema -var mTOAgentTypeEnum []interface{} - -func init() { - var res []MTOAgentType - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) - } -} - -func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { - if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o agent type -func (m MTOAgentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o agent type based on context it is used -func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_agents.go b/pkg/gen/internalmessages/m_t_o_agents.go deleted file mode 100644 index 00b0256a6c7..00000000000 --- a/pkg/gen/internalmessages/m_t_o_agents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOAgents m t o agents -// -// swagger:model MTOAgents -type MTOAgents []*MTOAgent - -// Validate validates this m t o agents -func (m MTOAgents) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents based on the context it is used -func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipment.go b/pkg/gen/internalmessages/m_t_o_shipment.go deleted file mode 100644 index 8e4499f969d..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipment.go +++ /dev/null @@ -1,967 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipment m t o shipment -// -// swagger:model MTOShipment -type MTOShipment struct { - - // actual pro gear weight - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // actual spouse pro gear weight - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // boat shipment - BoatShipment *BoatShipment `json:"boatShipment,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // customer remarks - // Example: handle with care - // Read Only: true - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // e tag - ETag string `json:"eTag,omitempty"` - - // has secondary delivery address - HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary delivery address - HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Single-letter designator for domestic (d) or international (i) shipments - // Example: d - // Enum: [d i] - MarketCode string `json:"marketCode,omitempty"` - - // mobile home shipment - MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` - - // move task order ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` - - // requested delivery date - // Read Only: true - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Read Only: true - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // secondary delivery address - SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // shipment locator - // Example: 1K43AR-01 - // Read Only: true - ShipmentLocator *string `json:"shipmentLocator,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // status - Status MTOShipmentStatus `json:"status,omitempty"` - - // tertiary delivery address - TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o shipment -func (m *MTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) 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 -} - -var mTOShipmentTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeMarketCodePropEnum = append(mTOShipmentTypeMarketCodePropEnum, v) - } -} - -const ( - - // MTOShipmentMarketCodeD captures enum value "d" - MTOShipmentMarketCodeD string = "d" - - // MTOShipmentMarketCodeI captures enum value "i" - MTOShipmentMarketCodeI string = "i" -) - -// prop value enum -func (m *MTOShipment) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipment) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if m.SecondaryDeliveryAddress != nil { - if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipment) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if m.TertiaryDeliveryAddress != nil { - if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment based on the context it is used -func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentLocator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDeliveryAddress != nil { - - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateShipmentLocator(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentLocator", "body", m.ShipmentLocator); err != nil { - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDeliveryAddress != nil { - - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipment) UnmarshalBinary(b []byte) error { - var res MTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_status.go b/pkg/gen/internalmessages/m_t_o_shipment_status.go deleted file mode 100644 index 94ccb7997bd..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipment_status.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentStatus m t o shipment status -// -// swagger:model MTOShipmentStatus -type MTOShipmentStatus string - -func NewMTOShipmentStatus(value MTOShipmentStatus) *MTOShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentStatus. -func (m MTOShipmentStatus) Pointer() *MTOShipmentStatus { - return &m -} - -const ( - - // MTOShipmentStatusDRAFT captures enum value "DRAFT" - MTOShipmentStatusDRAFT MTOShipmentStatus = "DRAFT" - - // MTOShipmentStatusAPPROVED captures enum value "APPROVED" - MTOShipmentStatusAPPROVED MTOShipmentStatus = "APPROVED" - - // MTOShipmentStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentStatusSUBMITTED MTOShipmentStatus = "SUBMITTED" - - // MTOShipmentStatusREJECTED captures enum value "REJECTED" - MTOShipmentStatusREJECTED MTOShipmentStatus = "REJECTED" -) - -// for schema -var mTOShipmentStatusEnum []interface{} - -func init() { - var res []MTOShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","APPROVED","SUBMITTED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentStatusEnum = append(mTOShipmentStatusEnum, v) - } -} - -func (m MTOShipmentStatus) validateMTOShipmentStatusEnum(path, location string, value MTOShipmentStatus) error { - if err := validate.EnumCase(path, location, value, mTOShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment status -func (m MTOShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipment status based on the context it is used -func (m MTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", MTOShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_type.go b/pkg/gen/internalmessages/m_t_o_shipment_type.go deleted file mode 100644 index a3853e1f64c..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipment_type.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType Shipment Type -// Example: HHG -// -// swagger:model MTOShipmentType -type MTOShipmentType string - -func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType. -func (m MTOShipmentType) Pointer() *MTOShipmentType { - return &m -} - -const ( - - // MTOShipmentTypeHHG captures enum value "HHG" - MTOShipmentTypeHHG MTOShipmentType = "HHG" - - // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" - - // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentTypePPM captures enum value "PPM" - MTOShipmentTypePPM MTOShipmentType = "PPM" - - // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" - - // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" - - // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" - - // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" -) - -// for schema -var mTOShipmentTypeEnum []interface{} - -func init() { - var res []MTOShipmentType - if err := json.Unmarshal([]byte(`["HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","PPM","BOAT_HAUL_AWAY","BOAT_TOW_AWAY","MOBILE_HOME","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) - } -} - -func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type -func (m MTOShipmentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type based on context it is used -func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/m_t_o_shipments.go b/pkg/gen/internalmessages/m_t_o_shipments.go deleted file mode 100644 index 415b37f9cdc..00000000000 --- a/pkg/gen/internalmessages/m_t_o_shipments.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipments m t o shipments -// -// swagger:model MTOShipments -type MTOShipments []*MTOShipment - -// Validate validates this m t o shipments -func (m MTOShipments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments based on the context it is used -func (m MTOShipments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/method_of_receipt.go b/pkg/gen/internalmessages/method_of_receipt.go deleted file mode 100644 index 5cb2900fec3..00000000000 --- a/pkg/gen/internalmessages/method_of_receipt.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MethodOfReceipt Method of Receipt -// -// swagger:model MethodOfReceipt -type MethodOfReceipt string - -func NewMethodOfReceipt(value MethodOfReceipt) *MethodOfReceipt { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MethodOfReceipt. -func (m MethodOfReceipt) Pointer() *MethodOfReceipt { - return &m -} - -const ( - - // MethodOfReceiptMILPAY captures enum value "MIL_PAY" - MethodOfReceiptMILPAY MethodOfReceipt = "MIL_PAY" - - // MethodOfReceiptOTHERDD captures enum value "OTHER_DD" - MethodOfReceiptOTHERDD MethodOfReceipt = "OTHER_DD" - - // MethodOfReceiptGTCC captures enum value "GTCC" - MethodOfReceiptGTCC MethodOfReceipt = "GTCC" -) - -// for schema -var methodOfReceiptEnum []interface{} - -func init() { - var res []MethodOfReceipt - if err := json.Unmarshal([]byte(`["MIL_PAY","OTHER_DD","GTCC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - methodOfReceiptEnum = append(methodOfReceiptEnum, v) - } -} - -func (m MethodOfReceipt) validateMethodOfReceiptEnum(path, location string, value MethodOfReceipt) error { - if err := validate.EnumCase(path, location, value, methodOfReceiptEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this method of receipt -func (m MethodOfReceipt) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMethodOfReceiptEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this method of receipt based on context it is used -func (m MethodOfReceipt) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/mobile_home.go b/pkg/gen/internalmessages/mobile_home.go deleted file mode 100644 index f2a2f7b66cf..00000000000 --- a/pkg/gen/internalmessages/mobile_home.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. -// -// swagger:model MobileHome -type MobileHome struct { - - // Timestamp of when a property of this object was created (UTC) - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // height in inches - HeightInInches int64 `json:"heightInInches,omitempty"` - - // Primary auto-generated unique identifier of the Mobile Home object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // length in inches - LengthInInches int64 `json:"lengthInInches,omitempty"` - - // The make of the mobile home - Make string `json:"make,omitempty"` - - // The model of the mobile home. - Model string `json:"model,omitempty"` - - // The id of the parent MTOShipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // width in inches - WidthInInches int64 `json:"widthInInches,omitempty"` - - // The year the mobile home was made. - Year int64 `json:"year,omitempty"` -} - -// Validate validates this mobile home -func (m *MobileHome) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this mobile home based on the context it is used -func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MobileHome) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MobileHome) UnmarshalBinary(b []byte) error { - var res MobileHome - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/move_document_payload.go b/pkg/gen/internalmessages/move_document_payload.go deleted file mode 100644 index 0b8153c0219..00000000000 --- a/pkg/gen/internalmessages/move_document_payload.go +++ /dev/null @@ -1,597 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveDocumentPayload move document payload -// -// swagger:model MoveDocumentPayload -type MoveDocumentPayload struct { - - // document - // Required: true - Document *Document `json:"document"` - - // Empty weight - // Minimum: 0 - EmptyWeight *int64 `json:"empty_weight,omitempty"` - - // missing empty weight ticket - EmptyWeightTicketMissing *bool `json:"empty_weight_ticket_missing,omitempty"` - - // Full weight - // Minimum: 0 - FullWeight *int64 `json:"full_weight,omitempty"` - - // missing full weight ticket - FullWeightTicketMissing *bool `json:"full_weight_ticket_missing,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // move document type - // Required: true - MoveDocumentType *MoveDocumentType `json:"move_document_type"` - - // move id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - MoveID *strfmt.UUID `json:"move_id"` - - // moving expense type - MovingExpenseType MovingExpenseType `json:"moving_expense_type,omitempty"` - - // Notes - // Example: This document is good to go! - Notes *string `json:"notes,omitempty"` - - // Payment Method - // Enum: [OTHER GTCC] - PaymentMethod string `json:"payment_method,omitempty"` - - // personally procured move id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` - - // missing expense receipt - ReceiptMissing *bool `json:"receipt_missing,omitempty"` - - // Requested Amount - // - // unit is cents - // Minimum: 1 - RequestedAmountCents int64 `json:"requested_amount_cents,omitempty"` - - // status - // Required: true - Status *MoveDocumentStatus `json:"status"` - - // End date of storage for storage expenses - // Example: 2018-04-26 - // Format: date - StorageEndDate *strfmt.Date `json:"storage_end_date,omitempty"` - - // Start date of storage for storage expenses - // Example: 2018-04-26 - // Format: date - StorageStartDate *strfmt.Date `json:"storage_start_date,omitempty"` - - // Document title - // Example: very_useful_document.pdf - // Required: true - Title *string `json:"title"` - - // missing trailer ownership documentation - TrailerOwnershipMissing *bool `json:"trailer_ownership_missing,omitempty"` - - // Vehicle make - VehicleMake *string `json:"vehicle_make,omitempty"` - - // Vehicle model - VehicleModel *string `json:"vehicle_model,omitempty"` - - // Nickname (ex. "15-foot truck") - VehicleNickname *string `json:"vehicle_nickname,omitempty"` - - // Weight ticket date - // Example: 2018-04-26 - // Format: date - WeightTicketDate *strfmt.Date `json:"weight_ticket_date,omitempty"` - - // weight ticket set type - WeightTicketSetType *WeightTicketSetType `json:"weight_ticket_set_type,omitempty"` -} - -// Validate validates this move document payload -func (m *MoveDocumentPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveDocumentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentMethod(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonallyProcuredMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAmountCents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTicketDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTicketSetType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveDocumentPayload) validateDocument(formats strfmt.Registry) error { - - if err := validate.Required("document", "body", m.Document); err != nil { - return err - } - - if m.Document != nil { - if err := m.Document.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("empty_weight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("full_weight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateMoveDocumentType(formats strfmt.Registry) error { - - if err := validate.Required("move_document_type", "body", m.MoveDocumentType); err != nil { - return err - } - - if err := validate.Required("move_document_type", "body", m.MoveDocumentType); err != nil { - return err - } - - if m.MoveDocumentType != nil { - if err := m.MoveDocumentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("move_document_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("move_document_type") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("move_id", "body", m.MoveID); err != nil { - return err - } - - if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if err := m.MovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moving_expense_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moving_expense_type") - } - return err - } - - return nil -} - -var moveDocumentPayloadTypePaymentMethodPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["OTHER","GTCC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveDocumentPayloadTypePaymentMethodPropEnum = append(moveDocumentPayloadTypePaymentMethodPropEnum, v) - } -} - -const ( - - // MoveDocumentPayloadPaymentMethodOTHER captures enum value "OTHER" - MoveDocumentPayloadPaymentMethodOTHER string = "OTHER" - - // MoveDocumentPayloadPaymentMethodGTCC captures enum value "GTCC" - MoveDocumentPayloadPaymentMethodGTCC string = "GTCC" -) - -// prop value enum -func (m *MoveDocumentPayload) validatePaymentMethodEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, moveDocumentPayloadTypePaymentMethodPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MoveDocumentPayload) validatePaymentMethod(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentMethod) { // not required - return nil - } - - // value enum - if err := m.validatePaymentMethodEnum("payment_method", "body", m.PaymentMethod); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.PersonallyProcuredMoveID) { // not required - return nil - } - - if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateRequestedAmountCents(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAmountCents) { // not required - return nil - } - - if err := validate.MinimumInt("requested_amount_cents", "body", m.RequestedAmountCents, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) validateStorageEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.StorageEndDate) { // not required - return nil - } - - if err := validate.FormatOf("storage_end_date", "body", "date", m.StorageEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateStorageStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.StorageStartDate) { // not required - return nil - } - - if err := validate.FormatOf("storage_start_date", "body", "date", m.StorageStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateWeightTicketDate(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTicketDate) { // not required - return nil - } - - if err := validate.FormatOf("weight_ticket_date", "body", "date", m.WeightTicketDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveDocumentPayload) validateWeightTicketSetType(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTicketSetType) { // not required - return nil - } - - if m.WeightTicketSetType != nil { - if err := m.WeightTicketSetType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_ticket_set_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_ticket_set_type") - } - return err - } - } - - return nil -} - -// ContextValidate validate this move document payload based on the context it is used -func (m *MoveDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveDocumentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightTicketSetType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveDocumentPayload) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.Document != nil { - - if err := m.Document.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) contextValidateMoveDocumentType(ctx context.Context, formats strfmt.Registry) error { - - if m.MoveDocumentType != nil { - - if err := m.MoveDocumentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("move_document_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("move_document_type") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moving_expense_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moving_expense_type") - } - return err - } - - return nil -} - -func (m *MoveDocumentPayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MoveDocumentPayload) contextValidateWeightTicketSetType(ctx context.Context, formats strfmt.Registry) error { - - if m.WeightTicketSetType != nil { - - if swag.IsZero(m.WeightTicketSetType) { // not required - return nil - } - - if err := m.WeightTicketSetType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_ticket_set_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_ticket_set_type") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveDocumentPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveDocumentPayload) UnmarshalBinary(b []byte) error { - var res MoveDocumentPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/move_document_status.go b/pkg/gen/internalmessages/move_document_status.go deleted file mode 100644 index 0d2c73d0707..00000000000 --- a/pkg/gen/internalmessages/move_document_status.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MoveDocumentStatus Document status -// -// swagger:model MoveDocumentStatus -type MoveDocumentStatus string - -func NewMoveDocumentStatus(value MoveDocumentStatus) *MoveDocumentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MoveDocumentStatus. -func (m MoveDocumentStatus) Pointer() *MoveDocumentStatus { - return &m -} - -const ( - - // MoveDocumentStatusAWAITINGREVIEW captures enum value "AWAITING_REVIEW" - MoveDocumentStatusAWAITINGREVIEW MoveDocumentStatus = "AWAITING_REVIEW" - - // MoveDocumentStatusOK captures enum value "OK" - MoveDocumentStatusOK MoveDocumentStatus = "OK" - - // MoveDocumentStatusHASISSUE captures enum value "HAS_ISSUE" - MoveDocumentStatusHASISSUE MoveDocumentStatus = "HAS_ISSUE" - - // MoveDocumentStatusEXCLUDEFROMCALCULATION captures enum value "EXCLUDE_FROM_CALCULATION" - MoveDocumentStatusEXCLUDEFROMCALCULATION MoveDocumentStatus = "EXCLUDE_FROM_CALCULATION" -) - -// for schema -var moveDocumentStatusEnum []interface{} - -func init() { - var res []MoveDocumentStatus - if err := json.Unmarshal([]byte(`["AWAITING_REVIEW","OK","HAS_ISSUE","EXCLUDE_FROM_CALCULATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveDocumentStatusEnum = append(moveDocumentStatusEnum, v) - } -} - -func (m MoveDocumentStatus) validateMoveDocumentStatusEnum(path, location string, value MoveDocumentStatus) error { - if err := validate.EnumCase(path, location, value, moveDocumentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this move document status -func (m MoveDocumentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMoveDocumentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this move document status based on context it is used -func (m MoveDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/move_document_type.go b/pkg/gen/internalmessages/move_document_type.go deleted file mode 100644 index 89d91a5c85b..00000000000 --- a/pkg/gen/internalmessages/move_document_type.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MoveDocumentType Document type -// Example: EXPENSE -// -// swagger:model MoveDocumentType -type MoveDocumentType string - -func NewMoveDocumentType(value MoveDocumentType) *MoveDocumentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MoveDocumentType. -func (m MoveDocumentType) Pointer() *MoveDocumentType { - return &m -} - -const ( - - // MoveDocumentTypeOTHER captures enum value "OTHER" - MoveDocumentTypeOTHER MoveDocumentType = "OTHER" - - // MoveDocumentTypeWEIGHTTICKET captures enum value "WEIGHT_TICKET" - MoveDocumentTypeWEIGHTTICKET MoveDocumentType = "WEIGHT_TICKET" - - // MoveDocumentTypeSTORAGEEXPENSE captures enum value "STORAGE_EXPENSE" - MoveDocumentTypeSTORAGEEXPENSE MoveDocumentType = "STORAGE_EXPENSE" - - // MoveDocumentTypeSHIPMENTSUMMARY captures enum value "SHIPMENT_SUMMARY" - MoveDocumentTypeSHIPMENTSUMMARY MoveDocumentType = "SHIPMENT_SUMMARY" - - // MoveDocumentTypeEXPENSE captures enum value "EXPENSE" - MoveDocumentTypeEXPENSE MoveDocumentType = "EXPENSE" - - // MoveDocumentTypeWEIGHTTICKETSET captures enum value "WEIGHT_TICKET_SET" - MoveDocumentTypeWEIGHTTICKETSET MoveDocumentType = "WEIGHT_TICKET_SET" -) - -// for schema -var moveDocumentTypeEnum []interface{} - -func init() { - var res []MoveDocumentType - if err := json.Unmarshal([]byte(`["OTHER","WEIGHT_TICKET","STORAGE_EXPENSE","SHIPMENT_SUMMARY","EXPENSE","WEIGHT_TICKET_SET"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveDocumentTypeEnum = append(moveDocumentTypeEnum, v) - } -} - -func (m MoveDocumentType) validateMoveDocumentTypeEnum(path, location string, value MoveDocumentType) error { - if err := validate.EnumCase(path, location, value, moveDocumentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this move document type -func (m MoveDocumentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMoveDocumentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this move document type based on context it is used -func (m MoveDocumentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/move_documents.go b/pkg/gen/internalmessages/move_documents.go deleted file mode 100644 index c7da2170f5a..00000000000 --- a/pkg/gen/internalmessages/move_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MoveDocuments move documents -// -// swagger:model MoveDocuments -type MoveDocuments []*MoveDocumentPayload - -// Validate validates this move documents -func (m MoveDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this move documents based on the context it is used -func (m MoveDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/move_payload.go b/pkg/gen/internalmessages/move_payload.go deleted file mode 100644 index 464d094fca0..00000000000 --- a/pkg/gen/internalmessages/move_payload.go +++ /dev/null @@ -1,518 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MovePayload move payload -// -// swagger:model MovePayload -type MovePayload struct { - - // additional documents - AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` - - // cancel reason - // Example: Change of orders - CancelReason *string `json:"cancel_reason,omitempty"` - - // closeout office - CloseoutOffice *TransportationOffice `json:"closeout_office,omitempty"` - - // counseling office - CounselingOffice *TransportationOffice `json:"counseling_office,omitempty"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // e tag - // Required: true - ETag *string `json:"eTag"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // locator - // Example: 12432 - // Required: true - Locator *string `json:"locator"` - - // mto shipments - MtoShipments MTOShipments `json:"mto_shipments,omitempty"` - - // orders id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - OrdersID *strfmt.UUID `json:"orders_id"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // service member id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` - - // status - Status MoveStatus `json:"status,omitempty"` - - // submitted at - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submitted_at,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this move payload -func (m *MovePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdditionalDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCloseoutOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCounselingOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovePayload) validateAdditionalDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if m.AdditionalDocuments != nil { - if err := m.AdditionalDocuments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *MovePayload) validateCloseoutOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if m.CloseoutOffice != nil { - if err := m.CloseoutOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeout_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeout_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) validateCounselingOffice(formats strfmt.Registry) error { - if swag.IsZero(m.CounselingOffice) { // not required - return nil - } - - if m.CounselingOffice != nil { - if err := m.CounselingOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("counseling_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("counseling_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateETag(formats strfmt.Registry) error { - - if err := validate.Required("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateLocator(formats strfmt.Registry) error { - - if err := validate.Required("locator", "body", m.Locator); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateMtoShipments(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipments) { // not required - return nil - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mto_shipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mto_shipments") - } - return err - } - - return nil -} - -func (m *MovePayload) validateOrdersID(formats strfmt.Registry) error { - - if err := validate.Required("orders_id", "body", m.OrdersID); err != nil { - return err - } - - if err := validate.FormatOf("orders_id", "body", "uuid", m.OrdersID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MovePayload) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submitted_at", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move payload based on the context it is used -func (m *MovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselingOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovePayload) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { - - if m.AdditionalDocuments != nil { - - if swag.IsZero(m.AdditionalDocuments) { // not required - return nil - } - - if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("additionalDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("additionalDocuments") - } - return err - } - } - - return nil -} - -func (m *MovePayload) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CloseoutOffice != nil { - - if swag.IsZero(m.CloseoutOffice) { // not required - return nil - } - - if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("closeout_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("closeout_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) contextValidateCounselingOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.CounselingOffice != nil { - - if swag.IsZero(m.CounselingOffice) { // not required - return nil - } - - if err := m.CounselingOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("counseling_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("counseling_office") - } - return err - } - } - - return nil -} - -func (m *MovePayload) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mto_shipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mto_shipments") - } - return err - } - - return nil -} - -func (m *MovePayload) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { - return err - } - - return nil -} - -func (m *MovePayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MovePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MovePayload) UnmarshalBinary(b []byte) error { - var res MovePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/move_queue_item.go b/pkg/gen/internalmessages/move_queue_item.go deleted file mode 100644 index b274073ea6e..00000000000 --- a/pkg/gen/internalmessages/move_queue_item.go +++ /dev/null @@ -1,563 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveQueueItem move queue item -// -// swagger:model MoveQueueItem -type MoveQueueItem struct { - - // actual move date - // Example: 2018-04-25 - // Format: date - ActualMoveDate *strfmt.Date `json:"actual_move_date,omitempty"` - - // branch of service - // Required: true - BranchOfService *string `json:"branch_of_service"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // Customer Name - // Example: Thedog, Nino - // Required: true - CustomerName *string `json:"customer_name"` - - // delivered date - // Example: 2017-07-21T17:32:28Z - // Format: date-time - DeliveredDate *strfmt.DateTime `json:"delivered_date,omitempty"` - - // Destination - // Example: Dover AFB - DestinationDutyLocationName *string `json:"destination_duty_location_name,omitempty"` - - // Destination GBLOC - // Example: LKNQ - DestinationGbloc *string `json:"destination_gbloc,omitempty"` - - // DoD ID # - // Example: 5789345789 - // Required: true - // Max Length: 10 - // Min Length: 10 - // Pattern: ^\d{10}$ - Edipi *string `json:"edipi"` - - // GBL Number - // Example: LNK12345 - GblNumber *string `json:"gbl_number,omitempty"` - - // grade - // Required: true - Grade *OrderPayGrade `json:"grade"` - - // hhg status - // Example: ACCEPTED - HhgStatus *string `json:"hhg_status,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // invoice approved date - // Example: 2017-07-21T17:32:28Z - // Format: date-time - InvoiceApprovedDate *strfmt.DateTime `json:"invoice_approved_date,omitempty"` - - // last modified date - // Example: 2017-07-21T17:32:28Z - // Required: true - // Format: date-time - LastModifiedDate *strfmt.DateTime `json:"last_modified_date"` - - // locator - // Example: 12432 - // Required: true - Locator *string `json:"locator"` - - // move date - // Example: 2018-04-25 - // Format: date - MoveDate *strfmt.Date `json:"move_date,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"orders_type"` - - // Origin - // Example: Dover AFB - OriginDutyLocationName *string `json:"origin_duty_location_name,omitempty"` - - // Origin GBLOC - // Example: LKNQ - OriginGbloc *string `json:"origin_gbloc,omitempty"` - - // original move date - // Example: 2018-04-25 - // Format: date - OriginalMoveDate *strfmt.Date `json:"original_move_date,omitempty"` - - // pm survey conducted date - // Example: 2017-07-21T17:32:28Z - // Format: date-time - PmSurveyConductedDate *strfmt.DateTime `json:"pm_survey_conducted_date,omitempty"` - - // ppm status - // Example: PAYMENT_REQUESTED - PpmStatus *string `json:"ppm_status,omitempty"` - - // status - // Example: APPROVED - // Required: true - Status *string `json:"status"` - - // submitted date - // Example: 2018-04-25 - // Format: date-time - SubmittedDate *strfmt.DateTime `json:"submitted_date,omitempty"` - - // weight allotment - WeightAllotment *WeightAllotment `json:"weight_allotment,omitempty"` -} - -// Validate validates this move queue item -func (m *MoveQueueItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBranchOfService(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerName(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveredDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInvoiceApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLastModifiedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLocator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePmSurveyConductedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightAllotment(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveQueueItem) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actual_move_date", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateBranchOfService(formats strfmt.Registry) error { - - if err := validate.Required("branch_of_service", "body", m.BranchOfService); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateCustomerName(formats strfmt.Registry) error { - - if err := validate.Required("customer_name", "body", m.CustomerName); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateDeliveredDate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveredDate) { // not required - return nil - } - - if err := validate.FormatOf("delivered_date", "body", "date-time", m.DeliveredDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateEdipi(formats strfmt.Registry) error { - - if err := validate.Required("edipi", "body", m.Edipi); err != nil { - return err - } - - if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateGrade(formats strfmt.Registry) error { - - if err := validate.Required("grade", "body", m.Grade); err != nil { - return err - } - - if err := validate.Required("grade", "body", m.Grade); err != nil { - return err - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *MoveQueueItem) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateInvoiceApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.InvoiceApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("invoice_approved_date", "body", "date-time", m.InvoiceApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateLastModifiedDate(formats strfmt.Registry) error { - - if err := validate.Required("last_modified_date", "body", m.LastModifiedDate); err != nil { - return err - } - - if err := validate.FormatOf("last_modified_date", "body", "date-time", m.LastModifiedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateLocator(formats strfmt.Registry) error { - - if err := validate.Required("locator", "body", m.Locator); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.MoveDate) { // not required - return nil - } - - if err := validate.FormatOf("move_date", "body", "date", m.MoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *MoveQueueItem) validateOriginalMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginalMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("original_move_date", "body", "date", m.OriginalMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validatePmSurveyConductedDate(formats strfmt.Registry) error { - if swag.IsZero(m.PmSurveyConductedDate) { // not required - return nil - } - - if err := validate.FormatOf("pm_survey_conducted_date", "body", "date-time", m.PmSurveyConductedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateSubmittedDate(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedDate) { // not required - return nil - } - - if err := validate.FormatOf("submitted_date", "body", "date-time", m.SubmittedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveQueueItem) validateWeightAllotment(formats strfmt.Registry) error { - if swag.IsZero(m.WeightAllotment) { // not required - return nil - } - - if m.WeightAllotment != nil { - if err := m.WeightAllotment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_allotment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_allotment") - } - return err - } - } - - return nil -} - -// ContextValidate validate this move queue item based on the context it is used -func (m *MoveQueueItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightAllotment(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveQueueItem) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *MoveQueueItem) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *MoveQueueItem) contextValidateWeightAllotment(ctx context.Context, formats strfmt.Registry) error { - - if m.WeightAllotment != nil { - - if swag.IsZero(m.WeightAllotment) { // not required - return nil - } - - if err := m.WeightAllotment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_allotment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_allotment") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveQueueItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveQueueItem) UnmarshalBinary(b []byte) error { - var res MoveQueueItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/move_status.go b/pkg/gen/internalmessages/move_status.go deleted file mode 100644 index d75050f1e06..00000000000 --- a/pkg/gen/internalmessages/move_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MoveStatus Move status -// -// swagger:model MoveStatus -type MoveStatus string - -func NewMoveStatus(value MoveStatus) *MoveStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MoveStatus. -func (m MoveStatus) Pointer() *MoveStatus { - return &m -} - -const ( - - // MoveStatusDRAFT captures enum value "DRAFT" - MoveStatusDRAFT MoveStatus = "DRAFT" - - // MoveStatusSUBMITTED captures enum value "SUBMITTED" - MoveStatusSUBMITTED MoveStatus = "SUBMITTED" - - // MoveStatusAPPROVED captures enum value "APPROVED" - MoveStatusAPPROVED MoveStatus = "APPROVED" - - // MoveStatusCANCELED captures enum value "CANCELED" - MoveStatusCANCELED MoveStatus = "CANCELED" - - // MoveStatusNEEDSSERVICECOUNSELING captures enum value "NEEDS SERVICE COUNSELING" - MoveStatusNEEDSSERVICECOUNSELING MoveStatus = "NEEDS SERVICE COUNSELING" - - // MoveStatusAPPROVALSREQUESTED captures enum value "APPROVALS REQUESTED" - MoveStatusAPPROVALSREQUESTED MoveStatus = "APPROVALS REQUESTED" -) - -// for schema -var moveStatusEnum []interface{} - -func init() { - var res []MoveStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED","NEEDS SERVICE COUNSELING","APPROVALS REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveStatusEnum = append(moveStatusEnum, v) - } -} - -func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { - if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this move status -func (m MoveStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMoveStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this move status based on context it is used -func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/moves_list.go b/pkg/gen/internalmessages/moves_list.go deleted file mode 100644 index 61450be60be..00000000000 --- a/pkg/gen/internalmessages/moves_list.go +++ /dev/null @@ -1,183 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MovesList moves list -// -// swagger:model MovesList -type MovesList struct { - - // current move - CurrentMove []*InternalMove `json:"currentMove"` - - // previous moves - PreviousMoves []*InternalMove `json:"previousMoves"` -} - -// Validate validates this moves list -func (m *MovesList) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCurrentMove(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePreviousMoves(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovesList) validateCurrentMove(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentMove) { // not required - return nil - } - - for i := 0; i < len(m.CurrentMove); i++ { - if swag.IsZero(m.CurrentMove[i]) { // not required - continue - } - - if m.CurrentMove[i] != nil { - if err := m.CurrentMove[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *MovesList) validatePreviousMoves(formats strfmt.Registry) error { - if swag.IsZero(m.PreviousMoves) { // not required - return nil - } - - for i := 0; i < len(m.PreviousMoves); i++ { - if swag.IsZero(m.PreviousMoves[i]) { // not required - continue - } - - if m.PreviousMoves[i] != nil { - if err := m.PreviousMoves[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this moves list based on the context it is used -func (m *MovesList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCurrentMove(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePreviousMoves(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovesList) contextValidateCurrentMove(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.CurrentMove); i++ { - - if m.CurrentMove[i] != nil { - - if swag.IsZero(m.CurrentMove[i]) { // not required - return nil - } - - if err := m.CurrentMove[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *MovesList) contextValidatePreviousMoves(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.PreviousMoves); i++ { - - if m.PreviousMoves[i] != nil { - - if swag.IsZero(m.PreviousMoves[i]) { // not required - return nil - } - - if err := m.PreviousMoves[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MovesList) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MovesList) UnmarshalBinary(b []byte) error { - var res MovesList - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/moving_expense.go b/pkg/gen/internalmessages/moving_expense.go deleted file mode 100644 index ef98d414455..00000000000 --- a/pkg/gen/internalmessages/moving_expense.go +++ /dev/null @@ -1,674 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MovingExpense Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment. -// -// swagger:model MovingExpense -type MovingExpense struct { - - // The total amount of the expense as indicated on the receipt - Amount *int64 `json:"amount"` - - // Timestamp the moving expense object was initially created in the system (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A brief description of the expense - Description *string `json:"description"` - - // document - // Required: true - Document *Document `json:"document"` - - // The id of the Document that contains all file uploads for this expense - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - DocumentID strfmt.UUID `json:"documentId"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // Unique primary identifier of the Moving Expense object - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Indicates if the service member is missing the receipt with the proof of expense amount - MissingReceipt *bool `json:"missingReceipt"` - - // moving expense type - MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` - - // Indicates if the service member used their government issued card to pay for the expense - PaidWithGtcc *bool `json:"paidWithGtcc"` - - // The PPM Shipment id that this moving expense belongs to - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2018-05-26 - // Format: date - SitEndDate *strfmt.Date `json:"sitEndDate"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The amount of SIT that will be reimbursed - SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` - - // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2022-04-26 - // Format: date - SitStartDate *strfmt.Date `json:"sitStartDate"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Customer submitted total amount of the expense as indicated on the receipt - SubmittedAmount *int64 `json:"submittedAmount"` - - // Customer submitted description of the expense - SubmittedDescription *string `json:"submittedDescription"` - - // submitted moving expense type - SubmittedMovingExpenseType *SubmittedMovingExpenseType `json:"submittedMovingExpenseType"` - - // Customer submitted date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2018-05-26 - // Format: date - SubmittedSitEndDate *strfmt.Date `json:"submittedSitEndDate"` - - // Customer submitted date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Example: 2022-04-26 - // Format: date - SubmittedSitStartDate *strfmt.Date `json:"submittedSitStartDate"` - - // Timestamp when a property of this moving expense object was last modified (UTC) - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // The total weight stored in PPM SIT - WeightStored *int64 `json:"weightStored"` -} - -// Validate validates this moving expense -func (m *MovingExpense) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedSitStartDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovingExpense) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateDocument(formats strfmt.Registry) error { - - if err := validate.Required("document", "body", m.Document); err != nil { - return err - } - - if m.Document != nil { - if err := m.Document.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if m.MovingExpenseType != nil { - if err := m.MovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSubmittedMovingExpenseType(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedMovingExpenseType) { // not required - return nil - } - - if m.SubmittedMovingExpenseType != nil { - if err := m.SubmittedMovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("submittedMovingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("submittedMovingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) validateSubmittedSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedSitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("submittedSitEndDate", "body", "date", m.SubmittedSitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateSubmittedSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedSitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("submittedSitStartDate", "body", "date", m.SubmittedSitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this moving expense based on the context it is used -func (m *MovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubmittedMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MovingExpense) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.Document != nil { - - if err := m.Document.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.MovingExpenseType != nil { - - if swag.IsZero(m.MovingExpenseType) { // not required - return nil - } - - if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MovingExpense) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateSubmittedMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.SubmittedMovingExpenseType != nil { - - if swag.IsZero(m.SubmittedMovingExpenseType) { // not required - return nil - } - - if err := m.SubmittedMovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("submittedMovingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("submittedMovingExpenseType") - } - return err - } - } - - return nil -} - -func (m *MovingExpense) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MovingExpense) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MovingExpense) UnmarshalBinary(b []byte) error { - var res MovingExpense - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/moving_expense_type.go b/pkg/gen/internalmessages/moving_expense_type.go deleted file mode 100644 index f94e9aae7b5..00000000000 --- a/pkg/gen/internalmessages/moving_expense_type.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MovingExpenseType Moving Expense Type -// -// swagger:model MovingExpenseType -type MovingExpenseType string - -func NewMovingExpenseType(value MovingExpenseType) *MovingExpenseType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MovingExpenseType. -func (m MovingExpenseType) Pointer() *MovingExpenseType { - return &m -} - -const ( - - // MovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" - MovingExpenseTypeCONTRACTEDEXPENSE MovingExpenseType = "CONTRACTED_EXPENSE" - - // MovingExpenseTypeGAS captures enum value "GAS" - MovingExpenseTypeGAS MovingExpenseType = "GAS" - - // MovingExpenseTypeOIL captures enum value "OIL" - MovingExpenseTypeOIL MovingExpenseType = "OIL" - - // MovingExpenseTypeOTHER captures enum value "OTHER" - MovingExpenseTypeOTHER MovingExpenseType = "OTHER" - - // MovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" - MovingExpenseTypePACKINGMATERIALS MovingExpenseType = "PACKING_MATERIALS" - - // MovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" - MovingExpenseTypeRENTALEQUIPMENT MovingExpenseType = "RENTAL_EQUIPMENT" - - // MovingExpenseTypeSTORAGE captures enum value "STORAGE" - MovingExpenseTypeSTORAGE MovingExpenseType = "STORAGE" - - // MovingExpenseTypeTOLLS captures enum value "TOLLS" - MovingExpenseTypeTOLLS MovingExpenseType = "TOLLS" - - // MovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" - MovingExpenseTypeWEIGHINGFEE MovingExpenseType = "WEIGHING_FEE" -) - -// for schema -var movingExpenseTypeEnum []interface{} - -func init() { - var res []MovingExpenseType - if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - movingExpenseTypeEnum = append(movingExpenseTypeEnum, v) - } -} - -func (m MovingExpenseType) validateMovingExpenseTypeEnum(path, location string, value MovingExpenseType) error { - if err := validate.EnumCase(path, location, value, movingExpenseTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this moving expense type -func (m MovingExpenseType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMovingExpenseTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this moving expense type based on context it is used -func (m MovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/nullable_signed_certification_type.go b/pkg/gen/internalmessages/nullable_signed_certification_type.go deleted file mode 100644 index fa2b4bf5e8d..00000000000 --- a/pkg/gen/internalmessages/nullable_signed_certification_type.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NullableSignedCertificationType nullable signed certification type -// -// swagger:model NullableSignedCertificationType -type NullableSignedCertificationType string - -func NewNullableSignedCertificationType(value NullableSignedCertificationType) *NullableSignedCertificationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated NullableSignedCertificationType. -func (m NullableSignedCertificationType) Pointer() *NullableSignedCertificationType { - return &m -} - -const ( - - // NullableSignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" - NullableSignedCertificationTypePPMPAYMENT NullableSignedCertificationType = "PPM_PAYMENT" - - // NullableSignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" - NullableSignedCertificationTypeSHIPMENT NullableSignedCertificationType = "SHIPMENT" - - // NullableSignedCertificationTypePPM captures enum value "PPM" - NullableSignedCertificationTypePPM NullableSignedCertificationType = "PPM" - - // NullableSignedCertificationTypeHHG captures enum value "HHG" - NullableSignedCertificationTypeHHG NullableSignedCertificationType = "HHG" -) - -// for schema -var nullableSignedCertificationTypeEnum []interface{} - -func init() { - var res []NullableSignedCertificationType - if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PPM","HHG"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - nullableSignedCertificationTypeEnum = append(nullableSignedCertificationTypeEnum, v) - } -} - -func (m NullableSignedCertificationType) validateNullableSignedCertificationTypeEnum(path, location string, value NullableSignedCertificationType) error { - if err := validate.EnumCase(path, location, value, nullableSignedCertificationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this nullable signed certification type -func (m NullableSignedCertificationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateNullableSignedCertificationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this nullable signed certification type based on context it is used -func (m NullableSignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/office_user.go b/pkg/gen/internalmessages/office_user.go deleted file mode 100644 index e548e7ec788..00000000000 --- a/pkg/gen/internalmessages/office_user.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OfficeUser office user -// -// swagger:model OfficeUser -type OfficeUser struct { - - // created at - // Format: date-time - CreatedAt strfmt.DateTime `json:"created_at,omitempty"` - - // Personal Email Address - // Example: john_bob@example.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // First name - // Example: John - FirstName *string `json:"first_name,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Last name - // Example: Donut - LastName *string `json:"last_name,omitempty"` - - // Middle name - // Example: L. - MiddleName *string `json:"middle_name,omitempty"` - - // Best contact phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportation_office,omitempty"` - - // transportation office assignments - TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportation_office_assignments"` - - // updated at - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` - - // user id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"user_id,omitempty"` -} - -// Validate validates this office user -func (m *OfficeUser) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeAssignments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) 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 *OfficeUser) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office") - } - return err - } - } - - return nil -} - -func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOfficeAssignments) { // not required - return nil - } - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - continue - } - - if m.TransportationOfficeAssignments[i] != nil { - if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this office user based on the context it is used -func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office") - } - return err - } - } - - return nil -} - -func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.TransportationOfficeAssignments); i++ { - - if m.TransportationOfficeAssignments[i] != nil { - - if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required - return nil - } - - if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *OfficeUser) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OfficeUser) UnmarshalBinary(b []byte) error { - var res OfficeUser - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/okta_user_profile_data.go b/pkg/gen/internalmessages/okta_user_profile_data.go deleted file mode 100644 index 532dd658754..00000000000 --- a/pkg/gen/internalmessages/okta_user_profile_data.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// OktaUserProfileData okta user profile data -// -// swagger:model OktaUserProfileData -type OktaUserProfileData struct { - - // cac edipi - // Example: 1234567890 - // Max Length: 10 - CacEdipi *string `json:"cac_edipi,omitempty"` - - // email - // Example: user@email.com - // Pattern: ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email string `json:"email,omitempty"` - - // first name - // Example: John - FirstName string `json:"firstName,omitempty"` - - // last name - // Example: Doe - LastName string `json:"lastName,omitempty"` - - // login - // Example: user@email.com - // Pattern: ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Login string `json:"login,omitempty"` - - // sub - // Example: 1duekdue9ekrjghf - Sub string `json:"sub,omitempty"` -} - -// Validate validates this okta user profile data -func (m *OktaUserProfileData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCacEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLogin(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *OktaUserProfileData) validateCacEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.CacEdipi) { // not required - return nil - } - - if err := validate.MaxLength("cac_edipi", "body", *m.CacEdipi, 10); err != nil { - return err - } - - return nil -} - -func (m *OktaUserProfileData) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *OktaUserProfileData) validateLogin(formats strfmt.Registry) error { - if swag.IsZero(m.Login) { // not required - return nil - } - - if err := validate.Pattern("login", "body", m.Login, `^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this okta user profile data based on context it is used -func (m *OktaUserProfileData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *OktaUserProfileData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *OktaUserProfileData) UnmarshalBinary(b []byte) error { - var res OktaUserProfileData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/omittable_moving_expense_type.go b/pkg/gen/internalmessages/omittable_moving_expense_type.go deleted file mode 100644 index 6020730fc7f..00000000000 --- a/pkg/gen/internalmessages/omittable_moving_expense_type.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OmittableMovingExpenseType Moving Expense Type -// -// swagger:model OmittableMovingExpenseType -type OmittableMovingExpenseType string - -func NewOmittableMovingExpenseType(value OmittableMovingExpenseType) *OmittableMovingExpenseType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OmittableMovingExpenseType. -func (m OmittableMovingExpenseType) Pointer() *OmittableMovingExpenseType { - return &m -} - -const ( - - // OmittableMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" - OmittableMovingExpenseTypeCONTRACTEDEXPENSE OmittableMovingExpenseType = "CONTRACTED_EXPENSE" - - // OmittableMovingExpenseTypeGAS captures enum value "GAS" - OmittableMovingExpenseTypeGAS OmittableMovingExpenseType = "GAS" - - // OmittableMovingExpenseTypeOIL captures enum value "OIL" - OmittableMovingExpenseTypeOIL OmittableMovingExpenseType = "OIL" - - // OmittableMovingExpenseTypeOTHER captures enum value "OTHER" - OmittableMovingExpenseTypeOTHER OmittableMovingExpenseType = "OTHER" - - // OmittableMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" - OmittableMovingExpenseTypePACKINGMATERIALS OmittableMovingExpenseType = "PACKING_MATERIALS" - - // OmittableMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" - OmittableMovingExpenseTypeRENTALEQUIPMENT OmittableMovingExpenseType = "RENTAL_EQUIPMENT" - - // OmittableMovingExpenseTypeSTORAGE captures enum value "STORAGE" - OmittableMovingExpenseTypeSTORAGE OmittableMovingExpenseType = "STORAGE" - - // OmittableMovingExpenseTypeTOLLS captures enum value "TOLLS" - OmittableMovingExpenseTypeTOLLS OmittableMovingExpenseType = "TOLLS" - - // OmittableMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" - OmittableMovingExpenseTypeWEIGHINGFEE OmittableMovingExpenseType = "WEIGHING_FEE" -) - -// for schema -var omittableMovingExpenseTypeEnum []interface{} - -func init() { - var res []OmittableMovingExpenseType - if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - omittableMovingExpenseTypeEnum = append(omittableMovingExpenseTypeEnum, v) - } -} - -func (m OmittableMovingExpenseType) validateOmittableMovingExpenseTypeEnum(path, location string, value OmittableMovingExpenseType) error { - if err := validate.EnumCase(path, location, value, omittableMovingExpenseTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this omittable moving expense type -func (m OmittableMovingExpenseType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOmittableMovingExpenseTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this omittable moving expense type based on context it is used -func (m OmittableMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/omittable_p_p_m_document_status.go b/pkg/gen/internalmessages/omittable_p_p_m_document_status.go deleted file mode 100644 index 338f459b1cd..00000000000 --- a/pkg/gen/internalmessages/omittable_p_p_m_document_status.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OmittablePPMDocumentStatus Status of the PPM document. -// -// swagger:model OmittablePPMDocumentStatus -type OmittablePPMDocumentStatus string - -func NewOmittablePPMDocumentStatus(value OmittablePPMDocumentStatus) *OmittablePPMDocumentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OmittablePPMDocumentStatus. -func (m OmittablePPMDocumentStatus) Pointer() *OmittablePPMDocumentStatus { - return &m -} - -const ( - - // OmittablePPMDocumentStatusAPPROVED captures enum value "APPROVED" - OmittablePPMDocumentStatusAPPROVED OmittablePPMDocumentStatus = "APPROVED" - - // OmittablePPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" - OmittablePPMDocumentStatusEXCLUDED OmittablePPMDocumentStatus = "EXCLUDED" - - // OmittablePPMDocumentStatusREJECTED captures enum value "REJECTED" - OmittablePPMDocumentStatusREJECTED OmittablePPMDocumentStatus = "REJECTED" -) - -// for schema -var omittablePPMDocumentStatusEnum []interface{} - -func init() { - var res []OmittablePPMDocumentStatus - if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - omittablePPMDocumentStatusEnum = append(omittablePPMDocumentStatusEnum, v) - } -} - -func (m OmittablePPMDocumentStatus) validateOmittablePPMDocumentStatusEnum(path, location string, value OmittablePPMDocumentStatus) error { - if err := validate.EnumCase(path, location, value, omittablePPMDocumentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this omittable p p m document status -func (m OmittablePPMDocumentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOmittablePPMDocumentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this omittable p p m document status based on context it is used -func (m OmittablePPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/order_pay_grade.go b/pkg/gen/internalmessages/order_pay_grade.go deleted file mode 100644 index 84059d29e25..00000000000 --- a/pkg/gen/internalmessages/order_pay_grade.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrderPayGrade Grade -// -// swagger:model OrderPayGrade -type OrderPayGrade string - -func NewOrderPayGrade(value OrderPayGrade) *OrderPayGrade { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrderPayGrade. -func (m OrderPayGrade) Pointer() *OrderPayGrade { - return &m -} - -const ( - - // OrderPayGradeE1 captures enum value "E_1" - OrderPayGradeE1 OrderPayGrade = "E_1" - - // OrderPayGradeE2 captures enum value "E_2" - OrderPayGradeE2 OrderPayGrade = "E_2" - - // OrderPayGradeE3 captures enum value "E_3" - OrderPayGradeE3 OrderPayGrade = "E_3" - - // OrderPayGradeE4 captures enum value "E_4" - OrderPayGradeE4 OrderPayGrade = "E_4" - - // OrderPayGradeE5 captures enum value "E_5" - OrderPayGradeE5 OrderPayGrade = "E_5" - - // OrderPayGradeE6 captures enum value "E_6" - OrderPayGradeE6 OrderPayGrade = "E_6" - - // OrderPayGradeE7 captures enum value "E_7" - OrderPayGradeE7 OrderPayGrade = "E_7" - - // OrderPayGradeE8 captures enum value "E_8" - OrderPayGradeE8 OrderPayGrade = "E_8" - - // OrderPayGradeE9 captures enum value "E_9" - OrderPayGradeE9 OrderPayGrade = "E_9" - - // OrderPayGradeE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" - OrderPayGradeE9SPECIALSENIORENLISTED OrderPayGrade = "E_9_SPECIAL_SENIOR_ENLISTED" - - // OrderPayGradeO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" - OrderPayGradeO1ACADEMYGRADUATE OrderPayGrade = "O_1_ACADEMY_GRADUATE" - - // OrderPayGradeO2 captures enum value "O_2" - OrderPayGradeO2 OrderPayGrade = "O_2" - - // OrderPayGradeO3 captures enum value "O_3" - OrderPayGradeO3 OrderPayGrade = "O_3" - - // OrderPayGradeO4 captures enum value "O_4" - OrderPayGradeO4 OrderPayGrade = "O_4" - - // OrderPayGradeO5 captures enum value "O_5" - OrderPayGradeO5 OrderPayGrade = "O_5" - - // OrderPayGradeO6 captures enum value "O_6" - OrderPayGradeO6 OrderPayGrade = "O_6" - - // OrderPayGradeO7 captures enum value "O_7" - OrderPayGradeO7 OrderPayGrade = "O_7" - - // OrderPayGradeO8 captures enum value "O_8" - OrderPayGradeO8 OrderPayGrade = "O_8" - - // OrderPayGradeO9 captures enum value "O_9" - OrderPayGradeO9 OrderPayGrade = "O_9" - - // OrderPayGradeO10 captures enum value "O_10" - OrderPayGradeO10 OrderPayGrade = "O_10" - - // OrderPayGradeW1 captures enum value "W_1" - OrderPayGradeW1 OrderPayGrade = "W_1" - - // OrderPayGradeW2 captures enum value "W_2" - OrderPayGradeW2 OrderPayGrade = "W_2" - - // OrderPayGradeW3 captures enum value "W_3" - OrderPayGradeW3 OrderPayGrade = "W_3" - - // OrderPayGradeW4 captures enum value "W_4" - OrderPayGradeW4 OrderPayGrade = "W_4" - - // OrderPayGradeW5 captures enum value "W_5" - OrderPayGradeW5 OrderPayGrade = "W_5" - - // OrderPayGradeAVIATIONCADET captures enum value "AVIATION_CADET" - OrderPayGradeAVIATIONCADET OrderPayGrade = "AVIATION_CADET" - - // OrderPayGradeCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" - OrderPayGradeCIVILIANEMPLOYEE OrderPayGrade = "CIVILIAN_EMPLOYEE" - - // OrderPayGradeACADEMYCADET captures enum value "ACADEMY_CADET" - OrderPayGradeACADEMYCADET OrderPayGrade = "ACADEMY_CADET" - - // OrderPayGradeMIDSHIPMAN captures enum value "MIDSHIPMAN" - OrderPayGradeMIDSHIPMAN OrderPayGrade = "MIDSHIPMAN" -) - -// for schema -var orderPayGradeEnum []interface{} - -func init() { - var res []OrderPayGrade - if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - orderPayGradeEnum = append(orderPayGradeEnum, v) - } -} - -func (m OrderPayGrade) validateOrderPayGradeEnum(path, location string, value OrderPayGrade) error { - if err := validate.EnumCase(path, location, value, orderPayGradeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this order pay grade -func (m OrderPayGrade) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrderPayGradeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this order pay grade based on context it is used -func (m OrderPayGrade) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/orders.go b/pkg/gen/internalmessages/orders.go deleted file mode 100644 index 6a789163d32..00000000000 --- a/pkg/gen/internalmessages/orders.go +++ /dev/null @@ -1,821 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Orders orders -// -// swagger:model Orders -type Orders struct { - - // authorized weight - // Example: 7000 - AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // department indicator - DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` - - // entitlement - Entitlement *Entitlement `json:"entitlement,omitempty"` - - // grade - Grade *OrderPayGrade `json:"grade,omitempty"` - - // Are dependents included in your orders? - // Required: true - HasDependents *bool `json:"has_dependents"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Date issued - // - // The date and time that these orders were cut. - // Example: 2018-04-26 - // Required: true - // Format: date - IssueDate *strfmt.Date `json:"issue_date"` - - // moves - Moves IndexMovesPayload `json:"moves,omitempty"` - - // new duty location - // Required: true - NewDutyLocation *DutyLocationPayload `json:"new_duty_location"` - - // Orders Number - // Example: 030-00362 - OrdersNumber *string `json:"orders_number,omitempty"` - - // orders type - // Required: true - OrdersType *OrdersType `json:"orders_type"` - - // orders type detail - OrdersTypeDetail *OrdersTypeDetail `json:"orders_type_detail,omitempty"` - - // From what GBLOC do your orders originate? - OriginDutyLocationGbloc *string `json:"originDutyLocationGbloc,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocationPayload `json:"origin_duty_location,omitempty"` - - // provides services counseling - ProvidesServicesCounseling bool `json:"providesServicesCounseling"` - - // Report by - // - // Report By Date - // Example: 2018-04-26 - // Required: true - // Format: date - ReportByDate *strfmt.Date `json:"report_by_date"` - - // SAC - // Example: N002214CSW32Y9 - Sac *string `json:"sac,omitempty"` - - // service member id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ServiceMemberID *strfmt.UUID `json:"service_member_id"` - - // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? - // Required: true - SpouseHasProGear *bool `json:"spouse_has_pro_gear"` - - // status - Status OrdersStatus `json:"status,omitempty"` - - // TAC - // Example: F8J1 - Tac *string `json:"tac,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` - - // uploaded amended orders - UploadedAmendedOrders *Document `json:"uploaded_amended_orders,omitempty"` - - // uploaded amended orders id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UploadedAmendedOrdersID strfmt.UUID `json:"uploaded_amended_orders_id,omitempty"` - - // uploaded orders - // Required: true - UploadedOrders *Document `json:"uploaded_orders"` -} - -// Validate validates this orders -func (m *Orders) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDepartmentIndicator(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateHasDependents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIssueDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoves(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersTypeDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSpouseHasProGear(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadedAmendedOrders(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadedAmendedOrdersID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadedOrders(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Orders) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateDepartmentIndicator(formats strfmt.Registry) error { - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if m.DepartmentIndicator != nil { - if err := m.DepartmentIndicator.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *Orders) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Orders) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *Orders) validateHasDependents(formats strfmt.Registry) error { - - if err := validate.Required("has_dependents", "body", m.HasDependents); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateIssueDate(formats strfmt.Registry) error { - - if err := validate.Required("issue_date", "body", m.IssueDate); err != nil { - return err - } - - if err := validate.FormatOf("issue_date", "body", "date", m.IssueDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateMoves(formats strfmt.Registry) error { - if swag.IsZero(m.Moves) { // not required - return nil - } - - if err := m.Moves.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moves") - } - return err - } - - return nil -} - -func (m *Orders) validateNewDutyLocation(formats strfmt.Registry) error { - - if err := validate.Required("new_duty_location", "body", m.NewDutyLocation); err != nil { - return err - } - - if m.NewDutyLocation != nil { - if err := m.NewDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("new_duty_location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("new_duty_location") - } - return err - } - } - - return nil -} - -func (m *Orders) validateOrdersType(formats strfmt.Registry) error { - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { - return err - } - - if m.OrdersType != nil { - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *Orders) validateOrdersTypeDetail(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if m.OrdersTypeDetail != nil { - if err := m.OrdersTypeDetail.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type_detail") - } - return err - } - } - - return nil -} - -func (m *Orders) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin_duty_location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin_duty_location") - } - return err - } - } - - return nil -} - -func (m *Orders) validateReportByDate(formats strfmt.Registry) error { - - if err := validate.Required("report_by_date", "body", m.ReportByDate); err != nil { - return err - } - - if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateServiceMemberID(formats strfmt.Registry) error { - - if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { - return err - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateSpouseHasProGear(formats strfmt.Registry) error { - - if err := validate.Required("spouse_has_pro_gear", "body", m.SpouseHasProGear); err != nil { - return err - } - - return nil -} - -func (m *Orders) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *Orders) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateUploadedAmendedOrders(formats strfmt.Registry) error { - if swag.IsZero(m.UploadedAmendedOrders) { // not required - return nil - } - - if m.UploadedAmendedOrders != nil { - if err := m.UploadedAmendedOrders.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploaded_amended_orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploaded_amended_orders") - } - return err - } - } - - return nil -} - -func (m *Orders) validateUploadedAmendedOrdersID(formats strfmt.Registry) error { - if swag.IsZero(m.UploadedAmendedOrdersID) { // not required - return nil - } - - if err := validate.FormatOf("uploaded_amended_orders_id", "body", "uuid", m.UploadedAmendedOrdersID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Orders) validateUploadedOrders(formats strfmt.Registry) error { - - if err := validate.Required("uploaded_orders", "body", m.UploadedOrders); err != nil { - return err - } - - if m.UploadedOrders != nil { - if err := m.UploadedOrders.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploaded_orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploaded_orders") - } - return err - } - } - - return nil -} - -// ContextValidate validate this orders based on the context it is used -func (m *Orders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoves(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUploadedAmendedOrders(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUploadedOrders(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Orders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { - - if m.DepartmentIndicator != nil { - - if swag.IsZero(m.DepartmentIndicator) { // not required - return nil - } - - if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("department_indicator") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("department_indicator") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateMoves(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Moves.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("moves") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("moves") - } - return err - } - - return nil -} - -func (m *Orders) contextValidateNewDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.NewDutyLocation != nil { - - if err := m.NewDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("new_duty_location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("new_duty_location") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersType != nil { - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { - - if m.OrdersTypeDetail != nil { - - if swag.IsZero(m.OrdersTypeDetail) { // not required - return nil - } - - if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders_type_detail") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders_type_detail") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin_duty_location") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin_duty_location") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *Orders) contextValidateUploadedAmendedOrders(ctx context.Context, formats strfmt.Registry) error { - - if m.UploadedAmendedOrders != nil { - - if swag.IsZero(m.UploadedAmendedOrders) { // not required - return nil - } - - if err := m.UploadedAmendedOrders.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploaded_amended_orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploaded_amended_orders") - } - return err - } - } - - return nil -} - -func (m *Orders) contextValidateUploadedOrders(ctx context.Context, formats strfmt.Registry) error { - - if m.UploadedOrders != nil { - - if err := m.UploadedOrders.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploaded_orders") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploaded_orders") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Orders) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Orders) UnmarshalBinary(b []byte) error { - var res Orders - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/orders_status.go b/pkg/gen/internalmessages/orders_status.go deleted file mode 100644 index f8e61108195..00000000000 --- a/pkg/gen/internalmessages/orders_status.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersStatus Move status -// -// swagger:model OrdersStatus -type OrdersStatus string - -func NewOrdersStatus(value OrdersStatus) *OrdersStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersStatus. -func (m OrdersStatus) Pointer() *OrdersStatus { - return &m -} - -const ( - - // OrdersStatusDRAFT captures enum value "DRAFT" - OrdersStatusDRAFT OrdersStatus = "DRAFT" - - // OrdersStatusSUBMITTED captures enum value "SUBMITTED" - OrdersStatusSUBMITTED OrdersStatus = "SUBMITTED" - - // OrdersStatusAPPROVED captures enum value "APPROVED" - OrdersStatusAPPROVED OrdersStatus = "APPROVED" - - // OrdersStatusCANCELED captures enum value "CANCELED" - OrdersStatusCANCELED OrdersStatus = "CANCELED" -) - -// for schema -var ordersStatusEnum []interface{} - -func init() { - var res []OrdersStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersStatusEnum = append(ordersStatusEnum, v) - } -} - -func (m OrdersStatus) validateOrdersStatusEnum(path, location string, value OrdersStatus) error { - if err := validate.EnumCase(path, location, value, ordersStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders status -func (m OrdersStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders status based on context it is used -func (m OrdersStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/orders_type.go b/pkg/gen/internalmessages/orders_type.go deleted file mode 100644 index 059e20ff623..00000000000 --- a/pkg/gen/internalmessages/orders_type.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersType Orders type -// -// swagger:model OrdersType -type OrdersType string - -func NewOrdersType(value OrdersType) *OrdersType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersType. -func (m OrdersType) Pointer() *OrdersType { - return &m -} - -const ( - - // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" - OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" - - // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" - OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" - - // OrdersTypeRETIREMENT captures enum value "RETIREMENT" - OrdersTypeRETIREMENT OrdersType = "RETIREMENT" - - // OrdersTypeSEPARATION captures enum value "SEPARATION" - OrdersTypeSEPARATION OrdersType = "SEPARATION" - - // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" - OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" - - // OrdersTypeBLUEBARK captures enum value "BLUEBARK" - OrdersTypeBLUEBARK OrdersType = "BLUEBARK" - - // OrdersTypeSAFETY captures enum value "SAFETY" - OrdersTypeSAFETY OrdersType = "SAFETY" - - // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" - OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" - - // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" - OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" - - // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" - OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" -) - -// for schema -var ordersTypeEnum []interface{} - -func init() { - var res []OrdersType - if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeEnum = append(ordersTypeEnum, v) - } -} - -func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { - if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type -func (m OrdersType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type based on context it is used -func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/orders_type_detail.go b/pkg/gen/internalmessages/orders_type_detail.go deleted file mode 100644 index 0cac696d939..00000000000 --- a/pkg/gen/internalmessages/orders_type_detail.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersTypeDetail Orders type detail -// -// swagger:model OrdersTypeDetail -type OrdersTypeDetail string - -func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. -func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { - return &m -} - -const ( - - // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" - OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" - - // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" - OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" - - // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" - OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" - - // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" - OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" - - // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" - OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" - - // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" - OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" - - // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" - OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" -) - -// for schema -var ordersTypeDetailEnum []interface{} - -func init() { - var res []OrdersTypeDetail - if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) - } -} - -func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { - if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type detail -func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type detail based on context it is used -func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_advance_status.go b/pkg/gen/internalmessages/p_p_m_advance_status.go deleted file mode 100644 index 47aad6d9e02..00000000000 --- a/pkg/gen/internalmessages/p_p_m_advance_status.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMAdvanceStatus PPM Advance Status -// -// # Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received -// -// swagger:model PPMAdvanceStatus -type PPMAdvanceStatus string - -func NewPPMAdvanceStatus(value PPMAdvanceStatus) *PPMAdvanceStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMAdvanceStatus. -func (m PPMAdvanceStatus) Pointer() *PPMAdvanceStatus { - return &m -} - -const ( - - // PPMAdvanceStatusAPPROVED captures enum value "APPROVED" - PPMAdvanceStatusAPPROVED PPMAdvanceStatus = "APPROVED" - - // PPMAdvanceStatusREJECTED captures enum value "REJECTED" - PPMAdvanceStatusREJECTED PPMAdvanceStatus = "REJECTED" - - // PPMAdvanceStatusEDITED captures enum value "EDITED" - PPMAdvanceStatusEDITED PPMAdvanceStatus = "EDITED" - - // PPMAdvanceStatusRECEIVED captures enum value "RECEIVED" - PPMAdvanceStatusRECEIVED PPMAdvanceStatus = "RECEIVED" - - // PPMAdvanceStatusNOTRECEIVED captures enum value "NOT_RECEIVED" - PPMAdvanceStatusNOTRECEIVED PPMAdvanceStatus = "NOT_RECEIVED" -) - -// for schema -var pPMAdvanceStatusEnum []interface{} - -func init() { - var res []PPMAdvanceStatus - if err := json.Unmarshal([]byte(`["APPROVED","REJECTED","EDITED","RECEIVED","NOT_RECEIVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMAdvanceStatusEnum = append(pPMAdvanceStatusEnum, v) - } -} - -func (m PPMAdvanceStatus) validatePPMAdvanceStatusEnum(path, location string, value PPMAdvanceStatus) error { - if err := validate.EnumCase(path, location, value, pPMAdvanceStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m advance status -func (m PPMAdvanceStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMAdvanceStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this p p m advance status based on context it is used -func (m PPMAdvanceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_destination_address.go b/pkg/gen/internalmessages/p_p_m_destination_address.go deleted file mode 100644 index c0ca4668595..00000000000 --- a/pkg/gen/internalmessages/p_p_m_destination_address.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMDestinationAddress A postal address -// -// swagger:model PPMDestinationAddress -type PPMDestinationAddress struct { - - // City - // Example: Anytown - // Required: true - City *string `json:"city"` - - // Country - // Example: USA - Country *string `json:"country,omitempty"` - - // County - // Example: LOS ANGELES - County *string `json:"county,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // ZIP - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - PostalCode *string `json:"postalCode"` - - // State - // Required: true - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State *string `json:"state"` - - // Street address 1 - // Example: 123 Main Ave - StreetAddress1 *string `json:"streetAddress1,omitempty"` - - // Street address 2 - // Example: Apartment 9000 - StreetAddress2 *string `json:"streetAddress2,omitempty"` - - // Address Line 3 - // Example: Montmârtre - StreetAddress3 *string `json:"streetAddress3,omitempty"` - - // us post region cities ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` -} - -// Validate validates this p p m destination address -func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsPostRegionCitiesID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { - - if err := validate.Required("city", "body", m.City); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { - - if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { - return err - } - - if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -var pPMDestinationAddressTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) - } -} - -const ( - - // PPMDestinationAddressStateAL captures enum value "AL" - PPMDestinationAddressStateAL string = "AL" - - // PPMDestinationAddressStateAK captures enum value "AK" - PPMDestinationAddressStateAK string = "AK" - - // PPMDestinationAddressStateAR captures enum value "AR" - PPMDestinationAddressStateAR string = "AR" - - // PPMDestinationAddressStateAZ captures enum value "AZ" - PPMDestinationAddressStateAZ string = "AZ" - - // PPMDestinationAddressStateCA captures enum value "CA" - PPMDestinationAddressStateCA string = "CA" - - // PPMDestinationAddressStateCO captures enum value "CO" - PPMDestinationAddressStateCO string = "CO" - - // PPMDestinationAddressStateCT captures enum value "CT" - PPMDestinationAddressStateCT string = "CT" - - // PPMDestinationAddressStateDC captures enum value "DC" - PPMDestinationAddressStateDC string = "DC" - - // PPMDestinationAddressStateDE captures enum value "DE" - PPMDestinationAddressStateDE string = "DE" - - // PPMDestinationAddressStateFL captures enum value "FL" - PPMDestinationAddressStateFL string = "FL" - - // PPMDestinationAddressStateGA captures enum value "GA" - PPMDestinationAddressStateGA string = "GA" - - // PPMDestinationAddressStateHI captures enum value "HI" - PPMDestinationAddressStateHI string = "HI" - - // PPMDestinationAddressStateIA captures enum value "IA" - PPMDestinationAddressStateIA string = "IA" - - // PPMDestinationAddressStateID captures enum value "ID" - PPMDestinationAddressStateID string = "ID" - - // PPMDestinationAddressStateIL captures enum value "IL" - PPMDestinationAddressStateIL string = "IL" - - // PPMDestinationAddressStateIN captures enum value "IN" - PPMDestinationAddressStateIN string = "IN" - - // PPMDestinationAddressStateKS captures enum value "KS" - PPMDestinationAddressStateKS string = "KS" - - // PPMDestinationAddressStateKY captures enum value "KY" - PPMDestinationAddressStateKY string = "KY" - - // PPMDestinationAddressStateLA captures enum value "LA" - PPMDestinationAddressStateLA string = "LA" - - // PPMDestinationAddressStateMA captures enum value "MA" - PPMDestinationAddressStateMA string = "MA" - - // PPMDestinationAddressStateMD captures enum value "MD" - PPMDestinationAddressStateMD string = "MD" - - // PPMDestinationAddressStateME captures enum value "ME" - PPMDestinationAddressStateME string = "ME" - - // PPMDestinationAddressStateMI captures enum value "MI" - PPMDestinationAddressStateMI string = "MI" - - // PPMDestinationAddressStateMN captures enum value "MN" - PPMDestinationAddressStateMN string = "MN" - - // PPMDestinationAddressStateMO captures enum value "MO" - PPMDestinationAddressStateMO string = "MO" - - // PPMDestinationAddressStateMS captures enum value "MS" - PPMDestinationAddressStateMS string = "MS" - - // PPMDestinationAddressStateMT captures enum value "MT" - PPMDestinationAddressStateMT string = "MT" - - // PPMDestinationAddressStateNC captures enum value "NC" - PPMDestinationAddressStateNC string = "NC" - - // PPMDestinationAddressStateND captures enum value "ND" - PPMDestinationAddressStateND string = "ND" - - // PPMDestinationAddressStateNE captures enum value "NE" - PPMDestinationAddressStateNE string = "NE" - - // PPMDestinationAddressStateNH captures enum value "NH" - PPMDestinationAddressStateNH string = "NH" - - // PPMDestinationAddressStateNJ captures enum value "NJ" - PPMDestinationAddressStateNJ string = "NJ" - - // PPMDestinationAddressStateNM captures enum value "NM" - PPMDestinationAddressStateNM string = "NM" - - // PPMDestinationAddressStateNV captures enum value "NV" - PPMDestinationAddressStateNV string = "NV" - - // PPMDestinationAddressStateNY captures enum value "NY" - PPMDestinationAddressStateNY string = "NY" - - // PPMDestinationAddressStateOH captures enum value "OH" - PPMDestinationAddressStateOH string = "OH" - - // PPMDestinationAddressStateOK captures enum value "OK" - PPMDestinationAddressStateOK string = "OK" - - // PPMDestinationAddressStateOR captures enum value "OR" - PPMDestinationAddressStateOR string = "OR" - - // PPMDestinationAddressStatePA captures enum value "PA" - PPMDestinationAddressStatePA string = "PA" - - // PPMDestinationAddressStateRI captures enum value "RI" - PPMDestinationAddressStateRI string = "RI" - - // PPMDestinationAddressStateSC captures enum value "SC" - PPMDestinationAddressStateSC string = "SC" - - // PPMDestinationAddressStateSD captures enum value "SD" - PPMDestinationAddressStateSD string = "SD" - - // PPMDestinationAddressStateTN captures enum value "TN" - PPMDestinationAddressStateTN string = "TN" - - // PPMDestinationAddressStateTX captures enum value "TX" - PPMDestinationAddressStateTX string = "TX" - - // PPMDestinationAddressStateUT captures enum value "UT" - PPMDestinationAddressStateUT string = "UT" - - // PPMDestinationAddressStateVA captures enum value "VA" - PPMDestinationAddressStateVA string = "VA" - - // PPMDestinationAddressStateVT captures enum value "VT" - PPMDestinationAddressStateVT string = "VT" - - // PPMDestinationAddressStateWA captures enum value "WA" - PPMDestinationAddressStateWA string = "WA" - - // PPMDestinationAddressStateWI captures enum value "WI" - PPMDestinationAddressStateWI string = "WI" - - // PPMDestinationAddressStateWV captures enum value "WV" - PPMDestinationAddressStateWV string = "WV" - - // PPMDestinationAddressStateWY captures enum value "WY" - PPMDestinationAddressStateWY string = "WY" -) - -// prop value enum -func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { - if swag.IsZero(m.UsPostRegionCitiesID) { // not required - return nil - } - - if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m destination address based on the context it is used -func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { - var res PPMDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_document_status_reason.go b/pkg/gen/internalmessages/p_p_m_document_status_reason.go deleted file mode 100644 index 1a2894065ed..00000000000 --- a/pkg/gen/internalmessages/p_p_m_document_status_reason.go +++ /dev/null @@ -1,27 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" -) - -// PPMDocumentStatusReason The reason the services counselor has excluded or rejected the item. -// -// swagger:model PPMDocumentStatusReason -type PPMDocumentStatusReason string - -// Validate validates this p p m document status reason -func (m PPMDocumentStatusReason) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this p p m document status reason based on context it is used -func (m PPMDocumentStatusReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_estimate_range.go b/pkg/gen/internalmessages/p_p_m_estimate_range.go deleted file mode 100644 index 430862df4a3..00000000000 --- a/pkg/gen/internalmessages/p_p_m_estimate_range.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMEstimateRange p p m estimate range -// -// swagger:model PPMEstimateRange -type PPMEstimateRange struct { - - // High estimate - // Required: true - RangeMax *int64 `json:"range_max"` - - // Low estimate - // Required: true - RangeMin *int64 `json:"range_min"` -} - -// Validate validates this p p m estimate range -func (m *PPMEstimateRange) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateRangeMax(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRangeMin(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMEstimateRange) validateRangeMax(formats strfmt.Registry) error { - - if err := validate.Required("range_max", "body", m.RangeMax); err != nil { - return err - } - - return nil -} - -func (m *PPMEstimateRange) validateRangeMin(formats strfmt.Registry) error { - - if err := validate.Required("range_min", "body", m.RangeMin); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this p p m estimate range based on context it is used -func (m *PPMEstimateRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PPMEstimateRange) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMEstimateRange) UnmarshalBinary(b []byte) error { - var res PPMEstimateRange - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_shipment.go b/pkg/gen/internalmessages/p_p_m_shipment.go deleted file mode 100644 index 43181ef2904..00000000000 --- a/pkg/gen/internalmessages/p_p_m_shipment.go +++ /dev/null @@ -1,1264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment -type PPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // advance status - AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` - - // The allowable weight of the PPM shipment goods being moved. - // Example: 4300 - // Minimum: 0 - AllowableWeight *int64 `json:"allowableWeight"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // Timestamp of when the PPM Shipment was initially created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin their move. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. - // - // Read Only: true - FinalIncentive *int64 `json:"finalIncentive"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Primary auto-generated unique identifier of the PPM shipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - MaxIncentive *int64 `json:"maxIncentive"` - - // All expense documentation receipt records of this PPM shipment. - MovingExpenses []*MovingExpense `json:"movingExpenses"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeight *int64 `json:"proGearWeight"` - - // All pro-gear weight ticket documentation records for this PPM shipment. - ProGearWeightTickets []*ProGearWeightTicket `json:"proGearWeightTickets"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // secondary destination address - SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // The id of the parent MTOShipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // signed certification - SignedCertification *SignedCertification `json:"signedCertification,omitempty"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // tertiary destination address - TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // w2 address - W2Address *Address `json:"w2Address,omitempty"` - - // weight tickets - WeightTickets WeightTickets `json:"weightTickets"` -} - -// Validate validates this p p m shipment -func (m *PPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAdvanceStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAllowableWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenses(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightTickets(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignedCertification(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateW2Address(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightTickets(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if m.AdvanceStatus != nil { - if err := m.AdvanceStatus.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateAllowableWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AllowableWeight) { // not required - return nil - } - - if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateMovingExpenses(formats strfmt.Registry) error { - if swag.IsZero(m.MovingExpenses) { // not required - return nil - } - - for i := 0; i < len(m.MovingExpenses); i++ { - if swag.IsZero(m.MovingExpenses[i]) { // not required - continue - } - - if m.MovingExpenses[i] != nil { - if err := m.MovingExpenses[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.ProGearWeightTickets) { // not required - return nil - } - - for i := 0; i < len(m.ProGearWeightTickets); i++ { - if swag.IsZero(m.ProGearWeightTickets[i]) { // not required - continue - } - - if m.ProGearWeightTickets[i] != nil { - if err := m.ProGearWeightTickets[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if m.SecondaryDestinationAddress != nil { - if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSignedCertification(formats strfmt.Registry) error { - if swag.IsZero(m.SignedCertification) { // not required - return nil - } - - if m.SignedCertification != nil { - if err := m.SignedCertification.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("signedCertification") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("signedCertification") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if m.TertiaryDestinationAddress != nil { - if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateW2Address(formats strfmt.Registry) error { - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if m.W2Address != nil { - if err := m.W2Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateWeightTickets(formats strfmt.Registry) error { - if swag.IsZero(m.WeightTickets) { // not required - return nil - } - - if err := m.WeightTickets.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weightTickets") - } - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment based on the context it is used -func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSignedCertification(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateW2Address(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightTickets(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.AdvanceStatus != nil { - - if swag.IsZero(m.AdvanceStatus) { // not required - return nil - } - - if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("advanceStatus") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("advanceStatus") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MovingExpenses); i++ { - - if m.MovingExpenses[i] != nil { - - if swag.IsZero(m.MovingExpenses[i]) { // not required - return nil - } - - if err := m.MovingExpenses[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.ProGearWeightTickets); i++ { - - if m.ProGearWeightTickets[i] != nil { - - if swag.IsZero(m.ProGearWeightTickets[i]) { // not required - return nil - } - - if err := m.ProGearWeightTickets[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDestinationAddress != nil { - - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateSignedCertification(ctx context.Context, formats strfmt.Registry) error { - - if m.SignedCertification != nil { - - if swag.IsZero(m.SignedCertification) { // not required - return nil - } - - if err := m.SignedCertification.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("signedCertification") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("signedCertification") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDestinationAddress != nil { - - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { - - if m.W2Address != nil { - - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if err := m.W2Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { - - if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weightTickets") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weightTickets") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment) UnmarshalBinary(b []byte) error { - var res PPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/p_p_m_shipment_status.go b/pkg/gen/internalmessages/p_p_m_shipment_status.go deleted file mode 100644 index eade223927b..00000000000 --- a/pkg/gen/internalmessages/p_p_m_shipment_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMShipmentStatus Status of the PPM Shipment: -// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. -// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. -// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. -// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. -// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. -// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. -// -// swagger:model PPMShipmentStatus -type PPMShipmentStatus string - -func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. -func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { - return &m -} - -const ( - - // PPMShipmentStatusDRAFT captures enum value "DRAFT" - PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" - - // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" - PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" - - // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" - - // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" - - // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" - - // PPMShipmentStatusCANCELED captures enum value "CANCELED" - PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" -) - -// for schema -var pPMShipmentStatusEnum []interface{} - -func init() { - var res []PPMShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) - } -} - -func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { - if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m shipment status -func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p p m shipment status based on the context it is used -func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/patch_move_payload.go b/pkg/gen/internalmessages/patch_move_payload.go deleted file mode 100644 index 588b051ced0..00000000000 --- a/pkg/gen/internalmessages/patch_move_payload.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PatchMovePayload patch move payload -// -// swagger:model PatchMovePayload -type PatchMovePayload struct { - - // The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members - // Required: true - // Format: uuid - CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId"` -} - -// Validate validates this patch move payload -func (m *PatchMovePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCloseoutOfficeID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PatchMovePayload) validateCloseoutOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("closeoutOfficeId", "body", m.CloseoutOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("closeoutOfficeId", "body", "uuid", m.CloseoutOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this patch move payload based on context it is used -func (m *PatchMovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PatchMovePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PatchMovePayload) UnmarshalBinary(b []byte) error { - var res PatchMovePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/patch_service_member_payload.go b/pkg/gen/internalmessages/patch_service_member_payload.go deleted file mode 100644 index a85374ad1eb..00000000000 --- a/pkg/gen/internalmessages/patch_service_member_payload.go +++ /dev/null @@ -1,401 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PatchServiceMemberPayload patch service member payload -// -// swagger:model PatchServiceMemberPayload -type PatchServiceMemberPayload struct { - - // affiliation - Affiliation *Affiliation `json:"affiliation,omitempty"` - - // backup mailing address - BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` - - // current location id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CurrentLocationID *strfmt.UUID `json:"current_location_id,omitempty"` - - // DoD ID number - // Example: 5789345789 - // Max Length: 10 - // Min Length: 10 - // Pattern: ^\d{10}$ - Edipi *string `json:"edipi,omitempty"` - - // Email - EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` - - // USCG EMPLID - // Example: 5789345 - // Max Length: 7 - // Min Length: 7 - // Pattern: ^\d{7}$ - Emplid *string `json:"emplid,omitempty"` - - // First name - // Example: John - FirstName *string `json:"first_name,omitempty"` - - // Last name - // Example: Donut - LastName *string `json:"last_name,omitempty"` - - // Middle name - // Example: L. - MiddleName *string `json:"middle_name,omitempty"` - - // Personal Email - // Example: john_bob@example.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail *string `json:"personal_email,omitempty"` - - // Phone - PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` - - // residential address - ResidentialAddress *Address `json:"residential_address,omitempty"` - - // Alternate Phone - // Example: 212-555-5555 - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - SecondaryTelephone *string `json:"secondary_telephone,omitempty"` - - // Suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // Best Contact Phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // user id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UserID strfmt.UUID `json:"user_id,omitempty"` -} - -// Validate validates this patch service member payload -func (m *PatchServiceMemberPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffiliation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupMailingAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCurrentLocationID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmplid(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResidentialAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PatchServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if m.Affiliation != nil { - if err := m.Affiliation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if m.BackupMailingAddress != nil { - if err := m.BackupMailingAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateCurrentLocationID(formats strfmt.Registry) error { - if swag.IsZero(m.CurrentLocationID) { // not required - return nil - } - - if err := validate.FormatOf("current_location_id", "body", "uuid", m.CurrentLocationID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.Edipi) { // not required - return nil - } - - if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateEmplid(formats strfmt.Registry) error { - if swag.IsZero(m.Emplid) { // not required - return nil - } - - if err := validate.MinLength("emplid", "body", *m.Emplid, 7); err != nil { - return err - } - - if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { - return err - } - - if err := validate.Pattern("emplid", "body", *m.Emplid, `^\d{7}$`); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if m.ResidentialAddress != nil { - if err := m.ResidentialAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *PatchServiceMemberPayload) validateUserID(formats strfmt.Registry) error { - if swag.IsZero(m.UserID) { // not required - return nil - } - - if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this patch service member payload based on the context it is used -func (m *PatchServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAffiliation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PatchServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { - - if m.Affiliation != nil { - - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *PatchServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupMailingAddress != nil { - - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *PatchServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.ResidentialAddress != nil { - - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PatchServiceMemberPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PatchServiceMemberPayload) UnmarshalBinary(b []byte) error { - var res PatchServiceMemberPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/post_document_payload.go b/pkg/gen/internalmessages/post_document_payload.go deleted file mode 100644 index 54e2803c022..00000000000 --- a/pkg/gen/internalmessages/post_document_payload.go +++ /dev/null @@ -1,74 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PostDocumentPayload post document payload -// -// swagger:model PostDocumentPayload -type PostDocumentPayload struct { - - // The service member this document belongs to - // Format: uuid - ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` -} - -// Validate validates this post document payload -func (m *PostDocumentPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PostDocumentPayload) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this post document payload based on context it is used -func (m *PostDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *PostDocumentPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PostDocumentPayload) UnmarshalBinary(b []byte) error { - var res PostDocumentPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/ppm_id.go b/pkg/gen/internalmessages/ppm_id.go deleted file mode 100644 index 94bd6d4fbda..00000000000 --- a/pkg/gen/internalmessages/ppm_id.go +++ /dev/null @@ -1,40 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PpmID The PPM Shipment ID to associate with the assigned certificate. -// -// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 -// -// swagger:model PpmID -type PpmID strfmt.UUID - -// Validate validates this ppm ID -func (m PpmID) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this ppm ID based on context it is used -func (m PpmID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/privilege.go b/pkg/gen/internalmessages/privilege.go deleted file mode 100644 index 0e095e75b9a..00000000000 --- a/pkg/gen/internalmessages/privilege.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Privilege privilege -// -// swagger:model Privilege -type Privilege struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // id - // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // privilege name - // Example: Supervisor - PrivilegeName string `json:"privilegeName,omitempty"` - - // privilege type - // Example: supervisor - PrivilegeType string `json:"privilegeType,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this privilege -func (m *Privilege) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Privilege) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Privilege) 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 *Privilege) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this privilege based on the context it is used -func (m *Privilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Privilege) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Privilege) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Privilege) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Privilege) UnmarshalBinary(b []byte) error { - var res Privilege - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/pro_gear_weight_ticket.go b/pkg/gen/internalmessages/pro_gear_weight_ticket.go deleted file mode 100644 index 0de694bb219..00000000000 --- a/pkg/gen/internalmessages/pro_gear_weight_ticket.go +++ /dev/null @@ -1,463 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProGearWeightTicket Pro-gear associated information and weight docs for a PPM shipment -// -// swagger:model ProGearWeightTicket -type ProGearWeightTicket struct { - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - BelongsToSelf *bool `json:"belongsToSelf"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // Describes the pro-gear that was moved. - Description *string `json:"description"` - - // document - // Required: true - Document *Document `json:"document"` - - // The ID of the document that is associated with the user uploads containing the pro-gear weight. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - DocumentID strfmt.UUID `json:"documentId"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - HasWeightTickets *bool `json:"hasWeightTickets"` - - // The ID of the pro-gear weight ticket. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // The ID of the PPM shipment that this pro-gear weight ticket is associated with. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - SubmittedBelongsToSelf *bool `json:"submittedBelongsToSelf"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - SubmittedHasWeightTickets *bool `json:"submittedHasWeightTickets"` - - // Customer submitted weight of the pro-gear. - // Minimum: 0 - SubmittedWeight *int64 `json:"submittedWeight"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // Weight of the pro-gear. - // Minimum: 0 - Weight *int64 `json:"weight"` -} - -// Validate validates this pro gear weight ticket -func (m *ProGearWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProGearWeightTicket) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateDocument(formats strfmt.Registry) error { - - if err := validate.Required("document", "body", m.Document); err != nil { - return err - } - - if m.Document != nil { - if err := m.Document.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) 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 *ProGearWeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) validateSubmittedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedWeight", "body", *m.SubmittedWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this pro gear weight ticket based on the context it is used -func (m *ProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProGearWeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.Document != nil { - - if err := m.Document.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("document") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("document") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *ProGearWeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProGearWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProGearWeightTicket) UnmarshalBinary(b []byte) error { - var res ProGearWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/rate_engine_postal_code_payload.go b/pkg/gen/internalmessages/rate_engine_postal_code_payload.go deleted file mode 100644 index ae8d4800198..00000000000 --- a/pkg/gen/internalmessages/rate_engine_postal_code_payload.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RateEnginePostalCodePayload rate engine postal code payload -// -// swagger:model RateEnginePostalCodePayload -type RateEnginePostalCodePayload struct { - - // ZIP - // - // zip code, international allowed - // Example: '90210' or 'N15 3NL' - // Required: true - PostalCode *string `json:"postal_code"` - - // postal code type - // Required: true - // Enum: [origin destination] - PostalCodeType *string `json:"postal_code_type"` - - // valid - // Example: false - // Required: true - Valid *bool `json:"valid"` -} - -// Validate validates this rate engine postal code payload -func (m *RateEnginePostalCodePayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostalCodeType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateValid(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RateEnginePostalCodePayload) validatePostalCode(formats strfmt.Registry) error { - - if err := validate.Required("postal_code", "body", m.PostalCode); err != nil { - return err - } - - return nil -} - -var rateEnginePostalCodePayloadTypePostalCodeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["origin","destination"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - rateEnginePostalCodePayloadTypePostalCodeTypePropEnum = append(rateEnginePostalCodePayloadTypePostalCodeTypePropEnum, v) - } -} - -const ( - - // RateEnginePostalCodePayloadPostalCodeTypeOrigin captures enum value "origin" - RateEnginePostalCodePayloadPostalCodeTypeOrigin string = "origin" - - // RateEnginePostalCodePayloadPostalCodeTypeDestination captures enum value "destination" - RateEnginePostalCodePayloadPostalCodeTypeDestination string = "destination" -) - -// prop value enum -func (m *RateEnginePostalCodePayload) validatePostalCodeTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, rateEnginePostalCodePayloadTypePostalCodeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *RateEnginePostalCodePayload) validatePostalCodeType(formats strfmt.Registry) error { - - if err := validate.Required("postal_code_type", "body", m.PostalCodeType); err != nil { - return err - } - - // value enum - if err := m.validatePostalCodeTypeEnum("postal_code_type", "body", *m.PostalCodeType); err != nil { - return err - } - - return nil -} - -func (m *RateEnginePostalCodePayload) validateValid(formats strfmt.Registry) error { - - if err := validate.Required("valid", "body", m.Valid); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this rate engine postal code payload based on context it is used -func (m *RateEnginePostalCodePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RateEnginePostalCodePayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RateEnginePostalCodePayload) UnmarshalBinary(b []byte) error { - var res RateEnginePostalCodePayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/reimbursement.go b/pkg/gen/internalmessages/reimbursement.go deleted file mode 100644 index 1d36c7a15ca..00000000000 --- a/pkg/gen/internalmessages/reimbursement.go +++ /dev/null @@ -1,229 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reimbursement reimbursement -// -// swagger:model Reimbursement -type Reimbursement struct { - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // method of receipt - // Required: true - MethodOfReceipt *MethodOfReceipt `json:"method_of_receipt"` - - // Requested Amount - // - // unit is cents - // Required: true - // Minimum: 1 - RequestedAmount *int64 `json:"requested_amount"` - - // Requested Date - // Example: 2018-04-26 - // Format: date - RequestedDate *strfmt.Date `json:"requested_date,omitempty"` - - // status - Status *ReimbursementStatus `json:"status,omitempty"` -} - -// Validate validates this reimbursement -func (m *Reimbursement) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMethodOfReceipt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAmount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDate(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 *Reimbursement) 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 *Reimbursement) validateMethodOfReceipt(formats strfmt.Registry) error { - - if err := validate.Required("method_of_receipt", "body", m.MethodOfReceipt); err != nil { - return err - } - - if err := validate.Required("method_of_receipt", "body", m.MethodOfReceipt); err != nil { - return err - } - - if m.MethodOfReceipt != nil { - if err := m.MethodOfReceipt.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method_of_receipt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("method_of_receipt") - } - return err - } - } - - return nil -} - -func (m *Reimbursement) validateRequestedAmount(formats strfmt.Registry) error { - - if err := validate.Required("requested_amount", "body", m.RequestedAmount); err != nil { - return err - } - - if err := validate.MinimumInt("requested_amount", "body", *m.RequestedAmount, 1, false); err != nil { - return err - } - - return nil -} - -func (m *Reimbursement) validateRequestedDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDate) { // not required - return nil - } - - if err := validate.FormatOf("requested_date", "body", "date", m.RequestedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reimbursement) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// ContextValidate validate this reimbursement based on the context it is used -func (m *Reimbursement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMethodOfReceipt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reimbursement) contextValidateMethodOfReceipt(ctx context.Context, formats strfmt.Registry) error { - - if m.MethodOfReceipt != nil { - - if err := m.MethodOfReceipt.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("method_of_receipt") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("method_of_receipt") - } - return err - } - } - - return nil -} - -func (m *Reimbursement) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reimbursement) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reimbursement) UnmarshalBinary(b []byte) error { - var res Reimbursement - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/reimbursement_status.go b/pkg/gen/internalmessages/reimbursement_status.go deleted file mode 100644 index 277cbd374e5..00000000000 --- a/pkg/gen/internalmessages/reimbursement_status.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReimbursementStatus Reimbursement -// -// swagger:model ReimbursementStatus -type ReimbursementStatus string - -func NewReimbursementStatus(value ReimbursementStatus) *ReimbursementStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReimbursementStatus. -func (m ReimbursementStatus) Pointer() *ReimbursementStatus { - return &m -} - -const ( - - // ReimbursementStatusDRAFT captures enum value "DRAFT" - ReimbursementStatusDRAFT ReimbursementStatus = "DRAFT" - - // ReimbursementStatusREQUESTED captures enum value "REQUESTED" - ReimbursementStatusREQUESTED ReimbursementStatus = "REQUESTED" - - // ReimbursementStatusAPPROVED captures enum value "APPROVED" - ReimbursementStatusAPPROVED ReimbursementStatus = "APPROVED" - - // ReimbursementStatusREJECTED captures enum value "REJECTED" - ReimbursementStatusREJECTED ReimbursementStatus = "REJECTED" - - // ReimbursementStatusPAID captures enum value "PAID" - ReimbursementStatusPAID ReimbursementStatus = "PAID" -) - -// for schema -var reimbursementStatusEnum []interface{} - -func init() { - var res []ReimbursementStatus - if err := json.Unmarshal([]byte(`["DRAFT","REQUESTED","APPROVED","REJECTED","PAID"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reimbursementStatusEnum = append(reimbursementStatusEnum, v) - } -} - -func (m ReimbursementStatus) validateReimbursementStatusEnum(path, location string, value ReimbursementStatus) error { - if err := validate.EnumCase(path, location, value, reimbursementStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reimbursement status -func (m ReimbursementStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReimbursementStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reimbursement status based on context it is used -func (m ReimbursementStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/role.go b/pkg/gen/internalmessages/role.go deleted file mode 100644 index ca1681fc08b..00000000000 --- a/pkg/gen/internalmessages/role.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Role role -// -// swagger:model Role -type Role struct { - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"createdAt"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // role type - // Example: customer - // Required: true - RoleType *string `json:"roleType"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this role -func (m *Role) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRoleType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Role) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Role) validateRoleType(formats strfmt.Registry) error { - - if err := validate.Required("roleType", "body", m.RoleType); err != nil { - return err - } - - return nil -} - -func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this role based on context it is used -func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Role) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Role) UnmarshalBinary(b []byte) error { - var res Role - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/s_i_t_location_type.go b/pkg/gen/internalmessages/s_i_t_location_type.go deleted file mode 100644 index 3f5aa07f951..00000000000 --- a/pkg/gen/internalmessages/s_i_t_location_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SITLocationType The list of SIT location types. -// -// swagger:model SITLocationType -type SITLocationType string - -func NewSITLocationType(value SITLocationType) *SITLocationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SITLocationType. -func (m SITLocationType) Pointer() *SITLocationType { - return &m -} - -const ( - - // SITLocationTypeORIGIN captures enum value "ORIGIN" - SITLocationTypeORIGIN SITLocationType = "ORIGIN" - - // SITLocationTypeDESTINATION captures enum value "DESTINATION" - SITLocationTypeDESTINATION SITLocationType = "DESTINATION" -) - -// for schema -var sITLocationTypeEnum []interface{} - -func init() { - var res []SITLocationType - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITLocationTypeEnum = append(sITLocationTypeEnum, v) - } -} - -func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { - if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this s i t location type -func (m SITLocationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this s i t location type based on context it is used -func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go b/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go deleted file mode 100644 index edeb668347c..00000000000 --- a/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go +++ /dev/null @@ -1,110 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SavePPMShipmentSignedCertification save p p m shipment signed certification -// -// swagger:model SavePPMShipmentSignedCertification -type SavePPMShipmentSignedCertification struct { - - // Text that the customer is agreeing to and signing. - // Required: true - CertificationText *string `json:"certification_text"` - - // Date of signature - // Required: true - // Format: date - Date *strfmt.Date `json:"date"` - - // Customer signature - // Required: true - Signature *string `json:"signature"` -} - -// Validate validates this save p p m shipment signed certification -func (m *SavePPMShipmentSignedCertification) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificationText(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignature(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SavePPMShipmentSignedCertification) validateCertificationText(formats strfmt.Registry) error { - - if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { - return err - } - - return nil -} - -func (m *SavePPMShipmentSignedCertification) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SavePPMShipmentSignedCertification) validateSignature(formats strfmt.Registry) error { - - if err := validate.Required("signature", "body", m.Signature); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this save p p m shipment signed certification based on context it is used -func (m *SavePPMShipmentSignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *SavePPMShipmentSignedCertification) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SavePPMShipmentSignedCertification) UnmarshalBinary(b []byte) error { - var res SavePPMShipmentSignedCertification - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/service_member_backup_contact_payload.go b/pkg/gen/internalmessages/service_member_backup_contact_payload.go deleted file mode 100644 index 113c2055656..00000000000 --- a/pkg/gen/internalmessages/service_member_backup_contact_payload.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceMemberBackupContactPayload service member backup contact payload -// -// swagger:model ServiceMemberBackupContactPayload -type ServiceMemberBackupContactPayload struct { - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // Email - // Example: john_bob@example.com - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Name - // Example: Susan Smith - // Required: true - Name *string `json:"name"` - - // permission - // Required: true - Permission *BackupContactPermission `json:"permission"` - - // service member id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` - - // Phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this service member backup contact payload -func (m *ServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePermission(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceMemberID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if m.Permission != nil { - if err := m.Permission.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateServiceMemberID(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceMemberID) { // not required - return nil - } - - if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this service member backup contact payload based on the context it is used -func (m *ServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePermission(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { - - if m.Permission != nil { - - if err := m.Permission.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberBackupContactPayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { - var res ServiceMemberBackupContactPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/service_member_payload.go b/pkg/gen/internalmessages/service_member_payload.go deleted file mode 100644 index a288cfba291..00000000000 --- a/pkg/gen/internalmessages/service_member_payload.go +++ /dev/null @@ -1,676 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceMemberPayload service member payload -// -// swagger:model ServiceMemberPayload -type ServiceMemberPayload struct { - - // Branch - Affiliation *Affiliation `json:"affiliation,omitempty"` - - // backup contacts - BackupContacts IndexServiceMemberBackupContactsPayload `json:"backup_contacts,omitempty"` - - // backup mailing address - BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` - - // cac validated - CacValidated bool `json:"cac_validated,omitempty"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // DoD ID number - // Example: 5789345789 - // Max Length: 10 - // Min Length: 10 - // Pattern: ^\d{10}$ - Edipi *string `json:"edipi,omitempty"` - - // Email - EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` - - // USCG EMPLID - // Example: 5789345 - // Max Length: 7 - // Min Length: 7 - // Pattern: ^\d{7}$ - Emplid *string `json:"emplid,omitempty"` - - // First name - // Example: John - FirstName *string `json:"first_name,omitempty"` - - // Grade - Grade *OrderPayGrade `json:"grade,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // is profile complete - // Required: true - IsProfileComplete *bool `json:"is_profile_complete"` - - // Last name - // Example: Donut - LastName *string `json:"last_name,omitempty"` - - // Middle name - // Example: L. - MiddleName *string `json:"middle_name,omitempty"` - - // orders - Orders []*Orders `json:"orders"` - - // Personal Email Address - // Example: john_bob@example.com - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - PersonalEmail *string `json:"personal_email,omitempty"` - - // Telephone - PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` - - // Residential Address - ResidentialAddress *Address `json:"residential_address,omitempty"` - - // Secondary Phone - // Example: 212-555-5555 - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - SecondaryTelephone *string `json:"secondary_telephone,omitempty"` - - // Suffix - // Example: Jr. - Suffix *string `json:"suffix,omitempty"` - - // Best contact phone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` - - // user id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - UserID *strfmt.UUID `json:"user_id"` - - // weight allotment - WeightAllotment *WeightAllotment `json:"weight_allotment,omitempty"` -} - -// Validate validates this service member payload -func (m *ServiceMemberPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAffiliation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupContacts(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBackupMailingAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEdipi(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmplid(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGrade(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateIsProfileComplete(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrders(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonalEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateResidentialAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWeightAllotment(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if m.Affiliation != nil { - if err := m.Affiliation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) validateBackupContacts(formats strfmt.Registry) error { - if swag.IsZero(m.BackupContacts) { // not required - return nil - } - - if err := m.BackupContacts.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contacts") - } - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if m.BackupMailingAddress != nil { - if err := m.BackupMailingAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { - if swag.IsZero(m.Edipi) { // not required - return nil - } - - if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { - return err - } - - if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateEmplid(formats strfmt.Registry) error { - if swag.IsZero(m.Emplid) { // not required - return nil - } - - if err := validate.MinLength("emplid", "body", *m.Emplid, 7); err != nil { - return err - } - - if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { - return err - } - - if err := validate.Pattern("emplid", "body", *m.Emplid, `^\d{7}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateGrade(formats strfmt.Registry) error { - if swag.IsZero(m.Grade) { // not required - return nil - } - - if m.Grade != nil { - if err := m.Grade.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateIsProfileComplete(formats strfmt.Registry) error { - - if err := validate.Required("is_profile_complete", "body", m.IsProfileComplete); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateOrders(formats strfmt.Registry) error { - if swag.IsZero(m.Orders) { // not required - return nil - } - - for i := 0; i < len(m.Orders); i++ { - if swag.IsZero(m.Orders[i]) { // not required - continue - } - - if m.Orders[i] != nil { - if err := m.Orders[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { - if swag.IsZero(m.PersonalEmail) { // not required - return nil - } - - if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if m.ResidentialAddress != nil { - if err := m.ResidentialAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryTelephone) { // not required - return nil - } - - if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateUserID(formats strfmt.Registry) error { - - if err := validate.Required("user_id", "body", m.UserID); err != nil { - return err - } - - if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ServiceMemberPayload) validateWeightAllotment(formats strfmt.Registry) error { - if swag.IsZero(m.WeightAllotment) { // not required - return nil - } - - if m.WeightAllotment != nil { - if err := m.WeightAllotment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_allotment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_allotment") - } - return err - } - } - - return nil -} - -// ContextValidate validate this service member payload based on the context it is used -func (m *ServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAffiliation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupContacts(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateGrade(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrders(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateWeightAllotment(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { - - if m.Affiliation != nil { - - if swag.IsZero(m.Affiliation) { // not required - return nil - } - - if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("affiliation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("affiliation") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateBackupContacts(ctx context.Context, formats strfmt.Registry) error { - - if err := m.BackupContacts.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_contacts") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_contacts") - } - return err - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.BackupMailingAddress != nil { - - if swag.IsZero(m.BackupMailingAddress) { // not required - return nil - } - - if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("backup_mailing_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("backup_mailing_address") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { - - if m.Grade != nil { - - if swag.IsZero(m.Grade) { // not required - return nil - } - - if err := m.Grade.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("grade") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("grade") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateOrders(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Orders); i++ { - - if m.Orders[i] != nil { - - if swag.IsZero(m.Orders[i]) { // not required - return nil - } - - if err := m.Orders[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("orders" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("orders" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.ResidentialAddress != nil { - - if swag.IsZero(m.ResidentialAddress) { // not required - return nil - } - - if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("residential_address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("residential_address") - } - return err - } - } - - return nil -} - -func (m *ServiceMemberPayload) contextValidateWeightAllotment(ctx context.Context, formats strfmt.Registry) error { - - if m.WeightAllotment != nil { - - if swag.IsZero(m.WeightAllotment) { // not required - return nil - } - - if err := m.WeightAllotment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("weight_allotment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("weight_allotment") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceMemberPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceMemberPayload) UnmarshalBinary(b []byte) error { - var res ServiceMemberPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/signed_certification.go b/pkg/gen/internalmessages/signed_certification.go deleted file mode 100644 index e4329672377..00000000000 --- a/pkg/gen/internalmessages/signed_certification.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SignedCertification Signed certification -// -// swagger:model SignedCertification -type SignedCertification struct { - - // Full text that the customer agreed to and signed. - // Required: true - CertificationText *string `json:"certificationText"` - - // certification type - // Required: true - CertificationType SignedCertificationType `json:"certificationType"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // Date that the customer signed the certification. - // Required: true - // Format: date - Date *strfmt.Date `json:"date"` - - // A hash that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The ID of the signed certification. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // The ID of the move associated with this signed certification. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - MoveID strfmt.UUID `json:"moveId"` - - // The ID of the PPM shipment associated with this signed certification, if any. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - PpmID *strfmt.UUID `json:"ppmId"` - - // The signature that the customer provided. - // Required: true - Signature *string `json:"signature"` - - // The ID of the user that signed. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - SubmittingUserID strfmt.UUID `json:"submittingUserId"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` -} - -// Validate validates this signed certification -func (m *SignedCertification) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificationText(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignature(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittingUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertification) validateCertificationText(formats strfmt.Registry) error { - - if err := validate.Required("certificationText", "body", m.CertificationText); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateCertificationType(formats strfmt.Registry) error { - - if err := validate.Required("certificationType", "body", SignedCertificationType(m.CertificationType)); err != nil { - return err - } - - if err := m.CertificationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificationType") - } - return err - } - - return nil -} - -func (m *SignedCertification) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("moveId", "body", strfmt.UUID(m.MoveID)); err != nil { - return err - } - - if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validatePpmID(formats strfmt.Registry) error { - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if err := validate.FormatOf("ppmId", "body", "uuid", m.PpmID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateSignature(formats strfmt.Registry) error { - - if err := validate.Required("signature", "body", m.Signature); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateSubmittingUserID(formats strfmt.Registry) error { - - if err := validate.Required("submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { - return err - } - - if err := validate.FormatOf("submittingUserId", "body", "uuid", m.SubmittingUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this signed certification based on the context it is used -func (m *SignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSubmittingUserID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertification) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificationType") - } - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveId", "body", strfmt.UUID(m.MoveID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmId", "body", m.PpmID); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateSubmittingUserID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { - return err - } - - return nil -} - -func (m *SignedCertification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SignedCertification) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SignedCertification) UnmarshalBinary(b []byte) error { - var res SignedCertification - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/signed_certification_payload.go b/pkg/gen/internalmessages/signed_certification_payload.go deleted file mode 100644 index 271f6e0cd0c..00000000000 --- a/pkg/gen/internalmessages/signed_certification_payload.go +++ /dev/null @@ -1,327 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SignedCertificationPayload signed certification payload -// -// swagger:model SignedCertificationPayload -type SignedCertificationPayload struct { - - // certification text - // Required: true - CertificationText *string `json:"certification_text"` - - // certification type - CertificationType *NullableSignedCertificationType `json:"certification_type,omitempty"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // Date - // Required: true - // Format: date-time - Date *strfmt.DateTime `json:"date"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // move id - // Required: true - // Format: uuid - MoveID *strfmt.UUID `json:"move_id"` - - // personally procured move id - // Format: uuid - PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` - - // ppm id - // Format: uuid - PpmID *PpmID `json:"ppm_id,omitempty"` - - // Signature - // Required: true - Signature *string `json:"signature"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this signed certification payload -func (m *SignedCertificationPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificationText(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCertificationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePersonallyProcuredMoveID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSignature(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertificationPayload) validateCertificationText(formats strfmt.Registry) error { - - if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validateCertificationType(formats strfmt.Registry) error { - if swag.IsZero(m.CertificationType) { // not required - return nil - } - - if m.CertificationType != nil { - if err := m.CertificationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certification_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certification_type") - } - return err - } - } - - return nil -} - -func (m *SignedCertificationPayload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validateDate(formats strfmt.Registry) error { - - if err := validate.Required("date", "body", m.Date); err != nil { - return err - } - - if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("move_id", "body", m.MoveID); err != nil { - return err - } - - if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { - if swag.IsZero(m.PersonallyProcuredMoveID) { // not required - return nil - } - - if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validatePpmID(formats strfmt.Registry) error { - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if m.PpmID != nil { - if err := m.PpmID.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppm_id") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppm_id") - } - return err - } - } - - return nil -} - -func (m *SignedCertificationPayload) validateSignature(formats strfmt.Registry) error { - - if err := validate.Required("signature", "body", m.Signature); err != nil { - return err - } - - return nil -} - -func (m *SignedCertificationPayload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this signed certification payload based on the context it is used -func (m *SignedCertificationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SignedCertificationPayload) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { - - if m.CertificationType != nil { - - if swag.IsZero(m.CertificationType) { // not required - return nil - } - - if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certification_type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certification_type") - } - return err - } - } - - return nil -} - -func (m *SignedCertificationPayload) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmID != nil { - - if swag.IsZero(m.PpmID) { // not required - return nil - } - - if err := m.PpmID.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppm_id") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppm_id") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SignedCertificationPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SignedCertificationPayload) UnmarshalBinary(b []byte) error { - var res SignedCertificationPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/signed_certification_type.go b/pkg/gen/internalmessages/signed_certification_type.go deleted file mode 100644 index cf79774d80d..00000000000 --- a/pkg/gen/internalmessages/signed_certification_type.go +++ /dev/null @@ -1,100 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SignedCertificationType The type of signed certification: -// - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are -// ready to submit their documentation for review. When they submit, they will be asked to sign certifying the -// information is correct. -// - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users. -// - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to -// service-counseling-completed "Submit move details" by service counselor. -// - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue. -// -// swagger:model SignedCertificationType -type SignedCertificationType string - -func NewSignedCertificationType(value SignedCertificationType) *SignedCertificationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SignedCertificationType. -func (m SignedCertificationType) Pointer() *SignedCertificationType { - return &m -} - -const ( - - // SignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" - SignedCertificationTypePPMPAYMENT SignedCertificationType = "PPM_PAYMENT" - - // SignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" - SignedCertificationTypeSHIPMENT SignedCertificationType = "SHIPMENT" - - // SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - - // SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "CLOSEOUT_REVIEWED_PPM_PAYMENT" -) - -// for schema -var signedCertificationTypeEnum []interface{} - -func init() { - var res []SignedCertificationType - if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - signedCertificationTypeEnum = append(signedCertificationTypeEnum, v) - } -} - -func (m SignedCertificationType) validateSignedCertificationTypeEnum(path, location string, value SignedCertificationType) error { - if err := validate.EnumCase(path, location, value, signedCertificationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this signed certification type -func (m SignedCertificationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSignedCertificationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this signed certification type based on the context it is used -func (m SignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", SignedCertificationType(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/signed_certification_type_create.go b/pkg/gen/internalmessages/signed_certification_type_create.go deleted file mode 100644 index 080f0cde1d6..00000000000 --- a/pkg/gen/internalmessages/signed_certification_type_create.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SignedCertificationTypeCreate signed certification type create -// -// swagger:model SignedCertificationTypeCreate -type SignedCertificationTypeCreate string - -func NewSignedCertificationTypeCreate(value SignedCertificationTypeCreate) *SignedCertificationTypeCreate { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SignedCertificationTypeCreate. -func (m SignedCertificationTypeCreate) Pointer() *SignedCertificationTypeCreate { - return &m -} - -const ( - - // SignedCertificationTypeCreatePPMPAYMENT captures enum value "PPM_PAYMENT" - SignedCertificationTypeCreatePPMPAYMENT SignedCertificationTypeCreate = "PPM_PAYMENT" - - // SignedCertificationTypeCreateSHIPMENT captures enum value "SHIPMENT" - SignedCertificationTypeCreateSHIPMENT SignedCertificationTypeCreate = "SHIPMENT" - - // SignedCertificationTypeCreatePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypeCreatePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationTypeCreate = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" - - // SignedCertificationTypeCreateCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" - SignedCertificationTypeCreateCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationTypeCreate = "CLOSEOUT_REVIEWED_PPM_PAYMENT" -) - -// for schema -var signedCertificationTypeCreateEnum []interface{} - -func init() { - var res []SignedCertificationTypeCreate - if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - signedCertificationTypeCreateEnum = append(signedCertificationTypeCreateEnum, v) - } -} - -func (m SignedCertificationTypeCreate) validateSignedCertificationTypeCreateEnum(path, location string, value SignedCertificationTypeCreate) error { - if err := validate.EnumCase(path, location, value, signedCertificationTypeCreateEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this signed certification type create -func (m SignedCertificationTypeCreate) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSignedCertificationTypeCreateEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this signed certification type create based on context it is used -func (m SignedCertificationTypeCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/signed_certifications.go b/pkg/gen/internalmessages/signed_certifications.go deleted file mode 100644 index e88b115a86b..00000000000 --- a/pkg/gen/internalmessages/signed_certifications.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SignedCertifications signed certifications -// -// swagger:model SignedCertifications -type SignedCertifications []*SignedCertificationPayload - -// Validate validates this signed certifications -func (m SignedCertifications) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this signed certifications based on the context it is used -func (m SignedCertifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/submit_move_for_approval_payload.go b/pkg/gen/internalmessages/submit_move_for_approval_payload.go deleted file mode 100644 index 12a5909e29a..00000000000 --- a/pkg/gen/internalmessages/submit_move_for_approval_payload.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SubmitMoveForApprovalPayload submit move for approval payload -// -// swagger:model SubmitMoveForApprovalPayload -type SubmitMoveForApprovalPayload struct { - - // certificate - Certificate *CreateSignedCertificationPayload `json:"certificate,omitempty"` -} - -// Validate validates this submit move for approval payload -func (m *SubmitMoveForApprovalPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCertificate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SubmitMoveForApprovalPayload) validateCertificate(formats strfmt.Registry) error { - if swag.IsZero(m.Certificate) { // not required - return nil - } - - if m.Certificate != nil { - if err := m.Certificate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificate") - } - return err - } - } - - return nil -} - -// ContextValidate validate this submit move for approval payload based on the context it is used -func (m *SubmitMoveForApprovalPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCertificate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SubmitMoveForApprovalPayload) contextValidateCertificate(ctx context.Context, formats strfmt.Registry) error { - - if m.Certificate != nil { - - if swag.IsZero(m.Certificate) { // not required - return nil - } - - if err := m.Certificate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("certificate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("certificate") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SubmitMoveForApprovalPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SubmitMoveForApprovalPayload) UnmarshalBinary(b []byte) error { - var res SubmitMoveForApprovalPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/submitted_moving_expense_type.go b/pkg/gen/internalmessages/submitted_moving_expense_type.go deleted file mode 100644 index 6213390bb21..00000000000 --- a/pkg/gen/internalmessages/submitted_moving_expense_type.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SubmittedMovingExpenseType Customer Submitted Moving Expense Type -// -// swagger:model SubmittedMovingExpenseType -type SubmittedMovingExpenseType string - -func NewSubmittedMovingExpenseType(value SubmittedMovingExpenseType) *SubmittedMovingExpenseType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SubmittedMovingExpenseType. -func (m SubmittedMovingExpenseType) Pointer() *SubmittedMovingExpenseType { - return &m -} - -const ( - - // SubmittedMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" - SubmittedMovingExpenseTypeCONTRACTEDEXPENSE SubmittedMovingExpenseType = "CONTRACTED_EXPENSE" - - // SubmittedMovingExpenseTypeGAS captures enum value "GAS" - SubmittedMovingExpenseTypeGAS SubmittedMovingExpenseType = "GAS" - - // SubmittedMovingExpenseTypeOIL captures enum value "OIL" - SubmittedMovingExpenseTypeOIL SubmittedMovingExpenseType = "OIL" - - // SubmittedMovingExpenseTypeOTHER captures enum value "OTHER" - SubmittedMovingExpenseTypeOTHER SubmittedMovingExpenseType = "OTHER" - - // SubmittedMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" - SubmittedMovingExpenseTypePACKINGMATERIALS SubmittedMovingExpenseType = "PACKING_MATERIALS" - - // SubmittedMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" - SubmittedMovingExpenseTypeRENTALEQUIPMENT SubmittedMovingExpenseType = "RENTAL_EQUIPMENT" - - // SubmittedMovingExpenseTypeSTORAGE captures enum value "STORAGE" - SubmittedMovingExpenseTypeSTORAGE SubmittedMovingExpenseType = "STORAGE" - - // SubmittedMovingExpenseTypeTOLLS captures enum value "TOLLS" - SubmittedMovingExpenseTypeTOLLS SubmittedMovingExpenseType = "TOLLS" - - // SubmittedMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" - SubmittedMovingExpenseTypeWEIGHINGFEE SubmittedMovingExpenseType = "WEIGHING_FEE" -) - -// for schema -var submittedMovingExpenseTypeEnum []interface{} - -func init() { - var res []SubmittedMovingExpenseType - if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - submittedMovingExpenseTypeEnum = append(submittedMovingExpenseTypeEnum, v) - } -} - -func (m SubmittedMovingExpenseType) validateSubmittedMovingExpenseTypeEnum(path, location string, value SubmittedMovingExpenseType) error { - if err := validate.EnumCase(path, location, value, submittedMovingExpenseTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this submitted moving expense type -func (m SubmittedMovingExpenseType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSubmittedMovingExpenseTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this submitted moving expense type based on context it is used -func (m SubmittedMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/transportation_office.go b/pkg/gen/internalmessages/transportation_office.go deleted file mode 100644 index c49e4bd4a90..00000000000 --- a/pkg/gen/internalmessages/transportation_office.go +++ /dev/null @@ -1,246 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOffice transportation office -// -// swagger:model TransportationOffice -type TransportationOffice struct { - - // address - // Required: true - Address *Address `json:"address"` - - // created at - // Required: true - // Format: date-time - CreatedAt *strfmt.DateTime `json:"created_at"` - - // gbloc - // Example: JENQ - // Pattern: ^[A-Z]{4}$ - Gbloc string `json:"gbloc,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // latitude - // Example: 29.382973 - Latitude float32 `json:"latitude,omitempty"` - - // longitude - // Example: -98.62759 - Longitude float32 `json:"longitude,omitempty"` - - // name - // Example: Fort Bragg North Station - // Required: true - Name *string `json:"name"` - - // phone lines - PhoneLines []string `json:"phone_lines"` - - // updated at - // Required: true - // Format: date-time - UpdatedAt *strfmt.DateTime `json:"updated_at"` -} - -// Validate validates this transportation office -func (m *TransportationOffice) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateGbloc(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhoneLines(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { - - if err := validate.Required("address", "body", m.Address); err != nil { - return err - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { - return err - } - - if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { - if swag.IsZero(m.Gbloc) { // not required - return nil - } - - if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { - if swag.IsZero(m.PhoneLines) { // not required - return nil - } - - for i := 0; i < len(m.PhoneLines); i++ { - - if err := validate.Pattern("phone_lines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - } - - return nil -} - -func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { - return err - } - - if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office based on the context it is used -func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOffice) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOffice) UnmarshalBinary(b []byte) error { - var res TransportationOffice - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/transportation_office_assignment.go b/pkg/gen/internalmessages/transportation_office_assignment.go deleted file mode 100644 index 133dca464db..00000000000 --- a/pkg/gen/internalmessages/transportation_office_assignment.go +++ /dev/null @@ -1,241 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// TransportationOfficeAssignment transportation office assignment -// -// swagger:model TransportationOfficeAssignment -type TransportationOfficeAssignment struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // office user Id - // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 - // Required: true - // Format: uuid - OfficeUserID *strfmt.UUID `json:"officeUserId"` - - // primary office - // Required: true - PrimaryOffice *bool `json:"primaryOffice"` - - // transportation office - TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` - - // transportation office Id - // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 - // Required: true - // Format: uuid - TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this transportation office assignment -func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOfficeUserID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimaryOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOffice(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTransportationOfficeID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { - - if err := validate.Required("officeUserId", "body", m.OfficeUserID); err != nil { - return err - } - - if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validatePrimaryOffice(formats strfmt.Registry) error { - - if err := validate.Required("primaryOffice", "body", m.PrimaryOffice); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if m.TransportationOffice != nil { - if err := m.TransportationOffice.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { - - if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { - return err - } - - if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this transportation office assignment based on the context it is used -func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { - - if m.TransportationOffice != nil { - - if swag.IsZero(m.TransportationOffice) { // not required - return nil - } - - if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("transportationOffice") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("transportationOffice") - } - return err - } - } - - return nil -} - -func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { - var res TransportationOfficeAssignment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/transportation_offices.go b/pkg/gen/internalmessages/transportation_offices.go deleted file mode 100644 index 1068fa9565e..00000000000 --- a/pkg/gen/internalmessages/transportation_offices.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// TransportationOffices transportation offices -// -// swagger:model TransportationOffices -type TransportationOffices []*TransportationOffice - -// Validate validates this transportation offices -func (m TransportationOffices) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this transportation offices based on the context it is used -func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/update_boat_shipment.go b/pkg/gen/internalmessages/update_boat_shipment.go deleted file mode 100644 index c75a83db0ea..00000000000 --- a/pkg/gen/internalmessages/update_boat_shipment.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateBoatShipment update boat shipment -// -// swagger:model UpdateBoatShipment -type UpdateBoatShipment struct { - - // Does the boat have a trailer - HasTrailer *bool `json:"hasTrailer,omitempty"` - - // Height of the Boat in inches - HeightInInches *int64 `json:"heightInInches,omitempty"` - - // Is the trailer roadworthy - IsRoadworthy *bool `json:"isRoadworthy,omitempty"` - - // Length of the Boat in inches - LengthInInches *int64 `json:"lengthInInches,omitempty"` - - // Make of the Boat - Make *string `json:"make,omitempty"` - - // Model of the Boat - Model *string `json:"model,omitempty"` - - // type - // Enum: [HAUL_AWAY TOW_AWAY] - Type *string `json:"type,omitempty"` - - // Width of the Boat in inches - WidthInInches *int64 `json:"widthInInches,omitempty"` - - // Year of the Boat - Year *int64 `json:"year,omitempty"` -} - -// Validate validates this update boat shipment -func (m *UpdateBoatShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -var updateBoatShipmentTypeTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateBoatShipmentTypeTypePropEnum = append(updateBoatShipmentTypeTypePropEnum, v) - } -} - -const ( - - // UpdateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" - UpdateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" - - // UpdateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" - UpdateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" -) - -// prop value enum -func (m *UpdateBoatShipment) validateTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateBoatShipmentTypeTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateBoatShipment) 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 -} - -// ContextValidate validates this update boat shipment based on context it is used -func (m *UpdateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateBoatShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateBoatShipment) UnmarshalBinary(b []byte) error { - var res UpdateBoatShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_mobile_home_shipment.go b/pkg/gen/internalmessages/update_mobile_home_shipment.go deleted file mode 100644 index a611331a77a..00000000000 --- a/pkg/gen/internalmessages/update_mobile_home_shipment.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateMobileHomeShipment update mobile home shipment -// -// swagger:model UpdateMobileHomeShipment -type UpdateMobileHomeShipment struct { - - // Height of the Mobile Home in inches - HeightInInches *int64 `json:"heightInInches,omitempty"` - - // Length of the Mobile Home in inches - LengthInInches *int64 `json:"lengthInInches,omitempty"` - - // Make of the Mobile Home - Make *string `json:"make,omitempty"` - - // Model of the Mobile Home - Model *string `json:"model,omitempty"` - - // Width of the Mobile Home in inches - WidthInInches *int64 `json:"widthInInches,omitempty"` - - // Year of the Mobile Home - Year *int64 `json:"year,omitempty"` -} - -// Validate validates this update mobile home shipment -func (m *UpdateMobileHomeShipment) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this update mobile home shipment based on context it is used -func (m *UpdateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMobileHomeShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMobileHomeShipment) UnmarshalBinary(b []byte) error { - var res UpdateMobileHomeShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_moving_expense.go b/pkg/gen/internalmessages/update_moving_expense.go deleted file mode 100644 index a757111380f..00000000000 --- a/pkg/gen/internalmessages/update_moving_expense.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMovingExpense update moving expense -// -// swagger:model UpdateMovingExpense -type UpdateMovingExpense struct { - - // The total amount of the expense as indicated on the receipt - // Required: true - Amount *int64 `json:"amount"` - - // A brief description of the expense - // Required: true - Description *string `json:"description"` - - // Indicates if the customer is missing the receipt for their expense. - // Required: true - MissingReceipt *bool `json:"missingReceipt"` - - // moving expense type - // Required: true - MovingExpenseType *MovingExpenseType `json:"movingExpenseType"` - - // Indicates if the service member used their government issued card to pay for the expense - // Required: true - PaidWithGTCC *bool `json:"paidWithGTCC"` - - // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only - // Format: date - SitEndDate strfmt.Date `json:"sitEndDate,omitempty"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The amount of SIT that will be reimbursed - SitReimburseableAmount *int64 `json:"sitReimburseableAmount,omitempty"` - - // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only - // Format: date - SitStartDate strfmt.Date `json:"sitStartDate,omitempty"` - - // The total weight stored in PPM SIT - WeightStored int64 `json:"weightStored,omitempty"` -} - -// Validate validates this update moving expense -func (m *UpdateMovingExpense) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAmount(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMissingReceipt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMovingExpenseType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaidWithGTCC(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitStartDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMovingExpense) validateAmount(formats strfmt.Registry) error { - - if err := validate.Required("amount", "body", m.Amount); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateMissingReceipt(formats strfmt.Registry) error { - - if err := validate.Required("missingReceipt", "body", m.MissingReceipt); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { - - if err := validate.Required("movingExpenseType", "body", m.MovingExpenseType); err != nil { - return err - } - - if err := validate.Required("movingExpenseType", "body", m.MovingExpenseType); err != nil { - return err - } - - if m.MovingExpenseType != nil { - if err := m.MovingExpenseType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) validatePaidWithGTCC(formats strfmt.Registry) error { - - if err := validate.Required("paidWithGTCC", "body", m.PaidWithGTCC); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEndDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) validateSitStartDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitStartDate) { // not required - return nil - } - - if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update moving expense based on the context it is used -func (m *UpdateMovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { - - if m.MovingExpenseType != nil { - - if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("movingExpenseType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("movingExpenseType") - } - return err - } - } - - return nil -} - -func (m *UpdateMovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMovingExpense) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMovingExpense) UnmarshalBinary(b []byte) error { - var res UpdateMovingExpense - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_okta_user_profile_data.go b/pkg/gen/internalmessages/update_okta_user_profile_data.go deleted file mode 100644 index 04f8aff0d1f..00000000000 --- a/pkg/gen/internalmessages/update_okta_user_profile_data.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateOktaUserProfileData update okta user profile data -// -// swagger:model UpdateOktaUserProfileData -type UpdateOktaUserProfileData struct { - - // profile - Profile *OktaUserProfileData `json:"profile,omitempty"` -} - -// Validate validates this update okta user profile data -func (m *UpdateOktaUserProfileData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProfile(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateOktaUserProfileData) validateProfile(formats strfmt.Registry) error { - if swag.IsZero(m.Profile) { // not required - return nil - } - - if m.Profile != nil { - if err := m.Profile.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("profile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("profile") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update okta user profile data based on the context it is used -func (m *UpdateOktaUserProfileData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateProfile(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateOktaUserProfileData) contextValidateProfile(ctx context.Context, formats strfmt.Registry) error { - - if m.Profile != nil { - - if swag.IsZero(m.Profile) { // not required - return nil - } - - if err := m.Profile.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("profile") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("profile") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateOktaUserProfileData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateOktaUserProfileData) UnmarshalBinary(b []byte) error { - var res UpdateOktaUserProfileData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_p_p_m_shipment.go b/pkg/gen/internalmessages/update_p_p_m_shipment.go deleted file mode 100644 index 2e1be3bd9cb..00000000000 --- a/pkg/gen/internalmessages/update_p_p_m_shipment.go +++ /dev/null @@ -1,572 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePPMShipment update p p m shipment -// -// swagger:model UpdatePPMShipment -type UpdatePPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode,omitempty"` - - // actual move date - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate,omitempty"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode,omitempty"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived,omitempty"` - - // The amount requested for an advance, or null if no advance is requested - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested,omitempty"` - - // destination address - DestinationAddress *PPMDestinationAddress `json:"destinationAddress,omitempty"` - - // estimated weight - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // Date the customer expects to move. - // - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` - - // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. - // - // Read Only: true - FinalIncentive *int64 `json:"finalIncentive"` - - // Indicates whether PPM shipment has pro gear. - // - HasProGear *bool `json:"hasProGear,omitempty"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance,omitempty"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance,omitempty"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // pro gear weight - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // secondary destination address - SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // sit expected - SitExpected *bool `json:"sitExpected,omitempty"` - - // spouse pro gear weight - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` - - // tertiary destination address - TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // w2 address - W2Address *Address `json:"w2Address,omitempty"` -} - -// Validate validates this update p p m shipment -func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateW2Address(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.ExpectedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if m.SecondaryDestinationAddress != nil { - if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if m.TertiaryDestinationAddress != nil { - if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateW2Address(formats strfmt.Registry) error { - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if m.W2Address != nil { - if err := m.W2Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update p p m shipment based on the context it is used -func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateW2Address(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDestinationAddress != nil { - - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDestinationAddress != nil { - - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { - - if m.W2Address != nil { - - if swag.IsZero(m.W2Address) { // not required - return nil - } - - if err := m.W2Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("w2Address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("w2Address") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { - var res UpdatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go b/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go deleted file mode 100644 index 13fd10c4cd0..00000000000 --- a/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateProGearWeightTicket update pro gear weight ticket -// -// swagger:model UpdateProGearWeightTicket -type UpdateProGearWeightTicket struct { - - // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. - BelongsToSelf bool `json:"belongsToSelf,omitempty"` - - // Describes the pro-gear that was moved. - Description string `json:"description,omitempty"` - - // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. - HasWeightTickets bool `json:"hasWeightTickets,omitempty"` - - // Weight of the vehicle not including the pro-gear. - // Minimum: 0 - Weight *int64 `json:"weight,omitempty"` -} - -// Validate validates this update pro gear weight ticket -func (m *UpdateProGearWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateProGearWeightTicket) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update pro gear weight ticket based on context it is used -func (m *UpdateProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateProGearWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateProGearWeightTicket) UnmarshalBinary(b []byte) error { - var res UpdateProGearWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go b/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go deleted file mode 100644 index 3d2356f550b..00000000000 --- a/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateServiceMemberBackupContactPayload update service member backup contact payload -// -// swagger:model UpdateServiceMemberBackupContactPayload -type UpdateServiceMemberBackupContactPayload struct { - - // email address - // Example: john_bob@example.com - // Required: true - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email"` - - // name - // Example: Susan Smith - // Required: true - Name *string `json:"name"` - - // permission - // Required: true - Permission *BackupContactPermission `json:"permission"` - - // telephone - // Example: 212-555-5555 - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Telephone *string `json:"telephone,omitempty"` -} - -// Validate validates this update service member backup contact payload -func (m *UpdateServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateName(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePermission(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTelephone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { - - if err := validate.Required("email", "body", m.Email); err != nil { - return err - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { - - if err := validate.Required("name", "body", m.Name); err != nil { - return err - } - - return nil -} - -func (m *UpdateServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if err := validate.Required("permission", "body", m.Permission); err != nil { - return err - } - - if m.Permission != nil { - if err := m.Permission.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -func (m *UpdateServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { - if swag.IsZero(m.Telephone) { // not required - return nil - } - - if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update service member backup contact payload based on the context it is used -func (m *UpdateServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidatePermission(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { - - if m.Permission != nil { - - if err := m.Permission.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("permission") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("permission") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { - var res UpdateServiceMemberBackupContactPayload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_shipment.go b/pkg/gen/internalmessages/update_shipment.go deleted file mode 100644 index 9add7ba28be..00000000000 --- a/pkg/gen/internalmessages/update_shipment.go +++ /dev/null @@ -1,714 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateShipment update shipment -// -// swagger:model UpdateShipment -type UpdateShipment struct { - - // actual pro gear weight - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // actual spouse pro gear weight - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // boat shipment - BoatShipment *UpdateBoatShipment `json:"boatShipment,omitempty"` - - // customer remarks - // Example: handle with care - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // destination address - DestinationAddress *Address `json:"destinationAddress,omitempty"` - - // has secondary delivery address - HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary delivery address - HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // mobile home shipment - MobileHomeShipment *UpdateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` - - // pickup address - PickupAddress *Address `json:"pickupAddress,omitempty"` - - // ppm shipment - PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` - - // requested delivery date - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` - - // requested pickup date - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` - - // secondary delivery address - SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // status - Status MTOShipmentStatus `json:"status,omitempty"` - - // tertiary delivery address - TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this update shipment -func (m *UpdateShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipment) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if m.SecondaryDeliveryAddress != nil { - if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *UpdateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if m.TertiaryDeliveryAddress != nil { - if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update shipment based on the context it is used -func (m *UpdateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDeliveryAddress != nil { - - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *UpdateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDeliveryAddress != nil { - - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateShipment) UnmarshalBinary(b []byte) error { - var res UpdateShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/update_weight_ticket.go b/pkg/gen/internalmessages/update_weight_ticket.go deleted file mode 100644 index 8b513988e59..00000000000 --- a/pkg/gen/internalmessages/update_weight_ticket.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateWeightTicket update weight ticket -// -// swagger:model UpdateWeightTicket -type UpdateWeightTicket struct { - - // Indicates the adjusted net weight of the vehicle - // Minimum: 0 - AdjustedNetWeight *int64 `json:"adjustedNetWeight,omitempty"` - - // Weight of the vehicle when empty. - // Minimum: 0 - EmptyWeight *int64 `json:"emptyWeight,omitempty"` - - // The weight of the vehicle when full. - // Minimum: 0 - FullWeight *int64 `json:"fullWeight,omitempty"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. - MissingEmptyWeightTicket bool `json:"missingEmptyWeightTicket,omitempty"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when full. - MissingFullWeightTicket bool `json:"missingFullWeightTicket,omitempty"` - - // Remarks explaining any edits made to the net weight - NetWeightRemarks string `json:"netWeightRemarks,omitempty"` - - // Indicates if the customer used a trailer they own for the move. - OwnsTrailer bool `json:"ownsTrailer,omitempty"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - TrailerMeetsCriteria bool `json:"trailerMeetsCriteria,omitempty"` - - // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. - VehicleDescription string `json:"vehicleDescription,omitempty"` -} - -// Validate validates this update weight ticket -func (m *UpdateWeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdjustedNetWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateWeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AdjustedNetWeight) { // not required - return nil - } - - if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateWeightTicket) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateWeightTicket) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update weight ticket based on context it is used -func (m *UpdateWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateWeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateWeightTicket) UnmarshalBinary(b []byte) error { - var res UpdateWeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/upload.go b/pkg/gen/internalmessages/upload.go deleted file mode 100644 index d3dd402a82d..00000000000 --- a/pkg/gen/internalmessages/upload.go +++ /dev/null @@ -1,477 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Upload An uploaded file. -// -// swagger:model Upload -type Upload struct { - - // bytes - // Required: true - // Read Only: true - Bytes int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - // Read Only: true - ContentType string `json:"contentType"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // deleted at - // Read Only: true - // Format: date-time - DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - // Read Only: true - Filename string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // is weight ticket - IsWeightTicket bool `json:"isWeightTicket,omitempty"` - - // rotation - // Example: 2 - Rotation int64 `json:"rotation,omitempty"` - - // status - // Read Only: true - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // upload type - // Example: OFFICE - // Read Only: true - // Enum: [USER PRIME OFFICE] - UploadType string `json:"uploadType,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uri - URL strfmt.URI `json:"url"` -} - -// Validate validates this upload -func (m *Upload) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploadType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Upload) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", int64(m.Bytes)); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateContentType(formats strfmt.Registry) error { - - if err := validate.RequiredString("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateDeletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.DeletedAt) { // not required - return nil - } - - if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateFilename(formats strfmt.Registry) error { - - if err := validate.RequiredString("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -var uploadTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadTypeStatusPropEnum = append(uploadTypeStatusPropEnum, v) - } -} - -const ( - - // UploadStatusINFECTED captures enum value "INFECTED" - UploadStatusINFECTED string = "INFECTED" - - // UploadStatusCLEAN captures enum value "CLEAN" - UploadStatusCLEAN string = "CLEAN" - - // UploadStatusPROCESSING captures enum value "PROCESSING" - UploadStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *Upload) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Upload) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -var uploadTypeUploadTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["USER","PRIME","OFFICE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadTypeUploadTypePropEnum = append(uploadTypeUploadTypePropEnum, v) - } -} - -const ( - - // UploadUploadTypeUSER captures enum value "USER" - UploadUploadTypeUSER string = "USER" - - // UploadUploadTypePRIME captures enum value "PRIME" - UploadUploadTypePRIME string = "PRIME" - - // UploadUploadTypeOFFICE captures enum value "OFFICE" - UploadUploadTypeOFFICE string = "OFFICE" -) - -// prop value enum -func (m *Upload) validateUploadTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadTypeUploadTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Upload) validateUploadType(formats strfmt.Registry) error { - if swag.IsZero(m.UploadType) { // not required - return nil - } - - // value enum - if err := m.validateUploadTypeEnum("uploadType", "body", m.UploadType); err != nil { - return err - } - - return nil -} - -func (m *Upload) validateURL(formats strfmt.Registry) error { - - if err := validate.Required("url", "body", strfmt.URI(m.URL)); err != nil { - return err - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload based on the context it is used -func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateBytes(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFilename(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUploadType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateURL(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Upload) contextValidateBytes(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "bytes", "body", int64(m.Bytes)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateContentType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contentType", "body", string(m.ContentType)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateDeletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "deletedAt", "body", m.DeletedAt); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateFilename(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "filename", "body", string(m.Filename)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateUploadType(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "uploadType", "body", string(m.UploadType)); err != nil { - return err - } - - return nil -} - -func (m *Upload) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Upload) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Upload) UnmarshalBinary(b []byte) error { - var res Upload - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/v_location.go b/pkg/gen/internalmessages/v_location.go deleted file mode 100644 index ee91f43216f..00000000000 --- a/pkg/gen/internalmessages/v_location.go +++ /dev/null @@ -1,302 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// VLocation A postal code, city, and state lookup -// -// swagger:model VLocation -type VLocation struct { - - // City - // Example: Anytown - City string `json:"city,omitempty"` - - // County - // Example: LOS ANGELES - County *string `json:"county,omitempty"` - - // ZIP - // Example: 90210 - // Pattern: ^(\d{5}?)$ - PostalCode string `json:"postalCode,omitempty"` - - // State - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State string `json:"state,omitempty"` - - // us post region cities ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` -} - -// Validate validates this v location -func (m *VLocation) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsPostRegionCitiesID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *VLocation) validatePostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.PostalCode) { // not required - return nil - } - - if err := validate.Pattern("postalCode", "body", m.PostalCode, `^(\d{5}?)$`); err != nil { - return err - } - - return nil -} - -var vLocationTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - vLocationTypeStatePropEnum = append(vLocationTypeStatePropEnum, v) - } -} - -const ( - - // VLocationStateAL captures enum value "AL" - VLocationStateAL string = "AL" - - // VLocationStateAK captures enum value "AK" - VLocationStateAK string = "AK" - - // VLocationStateAR captures enum value "AR" - VLocationStateAR string = "AR" - - // VLocationStateAZ captures enum value "AZ" - VLocationStateAZ string = "AZ" - - // VLocationStateCA captures enum value "CA" - VLocationStateCA string = "CA" - - // VLocationStateCO captures enum value "CO" - VLocationStateCO string = "CO" - - // VLocationStateCT captures enum value "CT" - VLocationStateCT string = "CT" - - // VLocationStateDC captures enum value "DC" - VLocationStateDC string = "DC" - - // VLocationStateDE captures enum value "DE" - VLocationStateDE string = "DE" - - // VLocationStateFL captures enum value "FL" - VLocationStateFL string = "FL" - - // VLocationStateGA captures enum value "GA" - VLocationStateGA string = "GA" - - // VLocationStateHI captures enum value "HI" - VLocationStateHI string = "HI" - - // VLocationStateIA captures enum value "IA" - VLocationStateIA string = "IA" - - // VLocationStateID captures enum value "ID" - VLocationStateID string = "ID" - - // VLocationStateIL captures enum value "IL" - VLocationStateIL string = "IL" - - // VLocationStateIN captures enum value "IN" - VLocationStateIN string = "IN" - - // VLocationStateKS captures enum value "KS" - VLocationStateKS string = "KS" - - // VLocationStateKY captures enum value "KY" - VLocationStateKY string = "KY" - - // VLocationStateLA captures enum value "LA" - VLocationStateLA string = "LA" - - // VLocationStateMA captures enum value "MA" - VLocationStateMA string = "MA" - - // VLocationStateMD captures enum value "MD" - VLocationStateMD string = "MD" - - // VLocationStateME captures enum value "ME" - VLocationStateME string = "ME" - - // VLocationStateMI captures enum value "MI" - VLocationStateMI string = "MI" - - // VLocationStateMN captures enum value "MN" - VLocationStateMN string = "MN" - - // VLocationStateMO captures enum value "MO" - VLocationStateMO string = "MO" - - // VLocationStateMS captures enum value "MS" - VLocationStateMS string = "MS" - - // VLocationStateMT captures enum value "MT" - VLocationStateMT string = "MT" - - // VLocationStateNC captures enum value "NC" - VLocationStateNC string = "NC" - - // VLocationStateND captures enum value "ND" - VLocationStateND string = "ND" - - // VLocationStateNE captures enum value "NE" - VLocationStateNE string = "NE" - - // VLocationStateNH captures enum value "NH" - VLocationStateNH string = "NH" - - // VLocationStateNJ captures enum value "NJ" - VLocationStateNJ string = "NJ" - - // VLocationStateNM captures enum value "NM" - VLocationStateNM string = "NM" - - // VLocationStateNV captures enum value "NV" - VLocationStateNV string = "NV" - - // VLocationStateNY captures enum value "NY" - VLocationStateNY string = "NY" - - // VLocationStateOH captures enum value "OH" - VLocationStateOH string = "OH" - - // VLocationStateOK captures enum value "OK" - VLocationStateOK string = "OK" - - // VLocationStateOR captures enum value "OR" - VLocationStateOR string = "OR" - - // VLocationStatePA captures enum value "PA" - VLocationStatePA string = "PA" - - // VLocationStateRI captures enum value "RI" - VLocationStateRI string = "RI" - - // VLocationStateSC captures enum value "SC" - VLocationStateSC string = "SC" - - // VLocationStateSD captures enum value "SD" - VLocationStateSD string = "SD" - - // VLocationStateTN captures enum value "TN" - VLocationStateTN string = "TN" - - // VLocationStateTX captures enum value "TX" - VLocationStateTX string = "TX" - - // VLocationStateUT captures enum value "UT" - VLocationStateUT string = "UT" - - // VLocationStateVA captures enum value "VA" - VLocationStateVA string = "VA" - - // VLocationStateVT captures enum value "VT" - VLocationStateVT string = "VT" - - // VLocationStateWA captures enum value "WA" - VLocationStateWA string = "WA" - - // VLocationStateWI captures enum value "WI" - VLocationStateWI string = "WI" - - // VLocationStateWV captures enum value "WV" - VLocationStateWV string = "WV" - - // VLocationStateWY captures enum value "WY" - VLocationStateWY string = "WY" -) - -// prop value enum -func (m *VLocation) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, vLocationTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *VLocation) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *VLocation) validateUsPostRegionCitiesID(formats strfmt.Registry) error { - if swag.IsZero(m.UsPostRegionCitiesID) { // not required - return nil - } - - if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this v location based on context it is used -func (m *VLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *VLocation) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *VLocation) UnmarshalBinary(b []byte) error { - var res VLocation - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/v_locations.go b/pkg/gen/internalmessages/v_locations.go deleted file mode 100644 index 4a2e1f0b605..00000000000 --- a/pkg/gen/internalmessages/v_locations.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// VLocations v locations -// -// swagger:model VLocations -type VLocations []*VLocation - -// Validate validates this v locations -func (m VLocations) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this v locations based on the context it is used -func (m VLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/internalmessages/validation_error.go b/pkg/gen/internalmessages/validation_error.go deleted file mode 100644 index 736216e86c4..00000000000 --- a/pkg/gen/internalmessages/validation_error.go +++ /dev/null @@ -1,154 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - ValidationErrorAllOf1 - - // invalid fields - // Required: true - InvalidFields map[string][]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var aO1 ValidationErrorAllOf1 - if err := swag.ReadJSON(raw, &aO1); err != nil { - return err - } - m.ValidationErrorAllOf1 = aO1 - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &propsValidationError); err != nil { - return err - } - m.InvalidFields = propsValidationError.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - - aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) - if err != nil { - return nil, err - } - _parts = append(_parts, aO1) - - // now for regular properties - var propsValidationError struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - propsValidationError.InvalidFields = m.InvalidFields - - jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) - if errValidationError != nil { - return nil, errValidationError - } - _parts = append(_parts, jsonDataPropsValidationError) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - // validation for a type composition with ValidationErrorAllOf1 - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ValidationErrorAllOf1 validation error all of1 -// -// swagger:model ValidationErrorAllOf1 -type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/internalmessages/weight_allotment.go b/pkg/gen/internalmessages/weight_allotment.go deleted file mode 100644 index 0ff747d9f00..00000000000 --- a/pkg/gen/internalmessages/weight_allotment.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WeightAllotment weight allotment -// -// swagger:model WeightAllotment -type WeightAllotment struct { - - // pro gear weight - // Example: 2000 - // Required: true - ProGearWeight *int64 `json:"pro_gear_weight"` - - // pro gear weight spouse - // Example: 500 - // Required: true - ProGearWeightSpouse *int64 `json:"pro_gear_weight_spouse"` - - // total weight self - // Example: 18000 - // Required: true - TotalWeightSelf *int64 `json:"total_weight_self"` - - // total weight self plus dependents - // Example: 18000 - // Required: true - TotalWeightSelfPlusDependents *int64 `json:"total_weight_self_plus_dependents"` -} - -// Validate validates this weight allotment -func (m *WeightAllotment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateProGearWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProGearWeightSpouse(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalWeightSelf(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTotalWeightSelfPlusDependents(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WeightAllotment) validateProGearWeight(formats strfmt.Registry) error { - - if err := validate.Required("pro_gear_weight", "body", m.ProGearWeight); err != nil { - return err - } - - return nil -} - -func (m *WeightAllotment) validateProGearWeightSpouse(formats strfmt.Registry) error { - - if err := validate.Required("pro_gear_weight_spouse", "body", m.ProGearWeightSpouse); err != nil { - return err - } - - return nil -} - -func (m *WeightAllotment) validateTotalWeightSelf(formats strfmt.Registry) error { - - if err := validate.Required("total_weight_self", "body", m.TotalWeightSelf); err != nil { - return err - } - - return nil -} - -func (m *WeightAllotment) validateTotalWeightSelfPlusDependents(formats strfmt.Registry) error { - - if err := validate.Required("total_weight_self_plus_dependents", "body", m.TotalWeightSelfPlusDependents); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this weight allotment based on context it is used -func (m *WeightAllotment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *WeightAllotment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WeightAllotment) UnmarshalBinary(b []byte) error { - var res WeightAllotment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/weight_ticket.go b/pkg/gen/internalmessages/weight_ticket.go deleted file mode 100644 index 0a3c5f9afdc..00000000000 --- a/pkg/gen/internalmessages/weight_ticket.go +++ /dev/null @@ -1,703 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WeightTicket Vehicle and optional trailer information and weight documents used to move this PPM shipment. -// -// swagger:model WeightTicket -type WeightTicket struct { - - // Indicates the adjusted net weight of the vehicle - // Minimum: 0 - AdjustedNetWeight *int64 `json:"adjustedNetWeight"` - - // created at - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A hash that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // empty document - // Required: true - EmptyDocument *Document `json:"emptyDocument"` - - // ID of the document that is associated with the user uploads containing the vehicle weight when empty. - // Required: true - // Read Only: true - // Format: uuid - EmptyDocumentID strfmt.UUID `json:"emptyDocumentId"` - - // Weight of the vehicle when empty. - // Minimum: 0 - EmptyWeight *int64 `json:"emptyWeight"` - - // full document - // Required: true - FullDocument *Document `json:"fullDocument"` - - // ID of the document that is associated with the user uploads containing the vehicle weight when full. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - FullDocumentID strfmt.UUID `json:"fullDocumentId"` - - // The weight of the vehicle when full. - // Minimum: 0 - FullWeight *int64 `json:"fullWeight"` - - // ID of this set of weight tickets. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. - MissingEmptyWeightTicket *bool `json:"missingEmptyWeightTicket"` - - // Indicates if the customer is missing a weight ticket for the vehicle weight when full. - MissingFullWeightTicket *bool `json:"missingFullWeightTicket"` - - // Remarks explaining any edits made to the net weight - NetWeightRemarks *string `json:"netWeightRemarks"` - - // Indicates if the customer used a trailer they own for the move. - OwnsTrailer *bool `json:"ownsTrailer"` - - // The ID of the PPM shipment that this set of weight tickets is for. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` - - // proof of trailer ownership document - // Required: true - ProofOfTrailerOwnershipDocument *Document `json:"proofOfTrailerOwnershipDocument"` - - // ID of the document that is associated with the user uploads containing the proof of trailer ownership. - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ProofOfTrailerOwnershipDocumentID strfmt.UUID `json:"proofOfTrailerOwnershipDocumentId"` - - // reason - Reason *PPMDocumentStatusReason `json:"reason"` - - // status - Status *OmittablePPMDocumentStatus `json:"status"` - - // Customer submitted weight of the vehicle when empty. - // Minimum: 0 - SubmittedEmptyWeight *int64 `json:"submittedEmptyWeight"` - - // Customer submitted weight of the vehicle when full. - // Minimum: 0 - SubmittedFullWeight *int64 `json:"submittedFullWeight"` - - // Indicates if the customer used a trailer they own for the move. - SubmittedOwnsTrailer *bool `json:"submittedOwnsTrailer"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - SubmittedTrailerMeetsCriteria *bool `json:"submittedTrailerMeetsCriteria"` - - // Indicates if the trailer that the customer used meets all the criteria to be claimable. - TrailerMeetsCriteria *bool `json:"trailerMeetsCriteria"` - - // updated at - // Required: true - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt"` - - // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. - VehicleDescription *string `json:"vehicleDescription"` -} - -// Validate validates this weight ticket -func (m *WeightTicket) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAdjustedNetWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfTrailerOwnershipDocument(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfTrailerOwnershipDocumentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedEmptyWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedFullWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { - if swag.IsZero(m.AdjustedNetWeight) { // not required - return nil - } - - if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateEmptyDocument(formats strfmt.Registry) error { - - if err := validate.Required("emptyDocument", "body", m.EmptyDocument); err != nil { - return err - } - - if m.EmptyDocument != nil { - if err := m.EmptyDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emptyDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("emptyDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateEmptyDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("emptyDocumentId", "body", "uuid", m.EmptyDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.EmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateFullDocument(formats strfmt.Registry) error { - - if err := validate.Required("fullDocument", "body", m.FullDocument); err != nil { - return err - } - - if m.FullDocument != nil { - if err := m.FullDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fullDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateFullDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("fullDocumentId", "body", "uuid", m.FullDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.FullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) 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 *WeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateProofOfTrailerOwnershipDocument(formats strfmt.Registry) error { - - if err := validate.Required("proofOfTrailerOwnershipDocument", "body", m.ProofOfTrailerOwnershipDocument); err != nil { - return err - } - - if m.ProofOfTrailerOwnershipDocument != nil { - if err := m.ProofOfTrailerOwnershipDocument.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfTrailerOwnershipDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfTrailerOwnershipDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateProofOfTrailerOwnershipDocumentID(formats strfmt.Registry) error { - - if err := validate.Required("proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { - return err - } - - if err := validate.FormatOf("proofOfTrailerOwnershipDocumentId", "body", "uuid", m.ProofOfTrailerOwnershipDocumentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateReason(formats strfmt.Registry) error { - if swag.IsZero(m.Reason) { // not required - return nil - } - - if m.Reason != nil { - if err := m.Reason.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - if m.Status != nil { - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) validateSubmittedEmptyWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedEmptyWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedEmptyWeight", "body", *m.SubmittedEmptyWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateSubmittedFullWeight(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedFullWeight) { // not required - return nil - } - - if err := validate.MinimumInt("submittedFullWeight", "body", *m.SubmittedFullWeight, 0, false); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) validateUpdatedAt(formats strfmt.Registry) error { - - if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this weight ticket based on the context it is used -func (m *WeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEmptyDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEmptyDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFullDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFullDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfTrailerOwnershipDocument(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfTrailerOwnershipDocumentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateEmptyDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.EmptyDocument != nil { - - if err := m.EmptyDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("emptyDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("emptyDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateEmptyDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateFullDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.FullDocument != nil { - - if err := m.FullDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("fullDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("fullDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateFullDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocument(ctx context.Context, formats strfmt.Registry) error { - - if m.ProofOfTrailerOwnershipDocument != nil { - - if err := m.ProofOfTrailerOwnershipDocument.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfTrailerOwnershipDocument") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfTrailerOwnershipDocument") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocumentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { - return err - } - - return nil -} - -func (m *WeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { - - if m.Reason != nil { - - if swag.IsZero(m.Reason) { // not required - return nil - } - - if err := m.Reason.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reason") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reason") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if m.Status != nil { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - } - - return nil -} - -func (m *WeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WeightTicket) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WeightTicket) UnmarshalBinary(b []byte) error { - var res WeightTicket - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/internalmessages/weight_ticket_set_type.go b/pkg/gen/internalmessages/weight_ticket_set_type.go deleted file mode 100644 index ad72c048640..00000000000 --- a/pkg/gen/internalmessages/weight_ticket_set_type.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// WeightTicketSetType Select weight ticket type -// -// swagger:model WeightTicketSetType -type WeightTicketSetType string - -func NewWeightTicketSetType(value WeightTicketSetType) *WeightTicketSetType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated WeightTicketSetType. -func (m WeightTicketSetType) Pointer() *WeightTicketSetType { - return &m -} - -const ( - - // WeightTicketSetTypeCAR captures enum value "CAR" - WeightTicketSetTypeCAR WeightTicketSetType = "CAR" - - // WeightTicketSetTypeCARTRAILER captures enum value "CAR_TRAILER" - WeightTicketSetTypeCARTRAILER WeightTicketSetType = "CAR_TRAILER" - - // WeightTicketSetTypeBOXTRUCK captures enum value "BOX_TRUCK" - WeightTicketSetTypeBOXTRUCK WeightTicketSetType = "BOX_TRUCK" - - // WeightTicketSetTypePROGEAR captures enum value "PRO_GEAR" - WeightTicketSetTypePROGEAR WeightTicketSetType = "PRO_GEAR" -) - -// for schema -var weightTicketSetTypeEnum []interface{} - -func init() { - var res []WeightTicketSetType - if err := json.Unmarshal([]byte(`["CAR","CAR_TRAILER","BOX_TRUCK","PRO_GEAR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - weightTicketSetTypeEnum = append(weightTicketSetTypeEnum, v) - } -} - -func (m WeightTicketSetType) validateWeightTicketSetTypeEnum(path, location string, value WeightTicketSetType) error { - if err := validate.EnumCase(path, location, value, weightTicketSetTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this weight ticket set type -func (m WeightTicketSetType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateWeightTicketSetTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this weight ticket set type based on context it is used -func (m WeightTicketSetType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/internalmessages/weight_tickets.go b/pkg/gen/internalmessages/weight_tickets.go deleted file mode 100644 index a25a4755ecc..00000000000 --- a/pkg/gen/internalmessages/weight_tickets.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package internalmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// WeightTickets All weight tickets associated with a PPM shipment. -// -// swagger:model WeightTickets -type WeightTickets []*WeightTicket - -// Validate validates this weight tickets -func (m WeightTickets) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this weight tickets based on the context it is used -func (m WeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeapi/configure_mymove.go b/pkg/gen/primeapi/configure_mymove.go deleted file mode 100644 index c538a478d02..00000000000 --- a/pkg/gen/primeapi/configure_mymove.go +++ /dev/null @@ -1,183 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package primeapi - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/payment_request" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime.yaml --api-package primeoperations --model-package primemessages --server-package primeapi --principal interface{} --exclude-main - -func configureFlags(api *primeoperations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *primeoperations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - api.MultipartformConsumer = runtime.DiscardConsumer - - api.BinProducer = runtime.ByteStreamProducer() - api.JSONProducer = runtime.JSONProducer() - - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // move_task_order.CreateExcessWeightRecordMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // mto_service_item.CreateServiceRequestDocumentUploadMaxParseMemory = 32 << 20 - // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). - // payment_request.CreateUploadMaxParseMemory = 32 << 20 - - if api.MoveTaskOrderCreateExcessWeightRecordHandler == nil { - api.MoveTaskOrderCreateExcessWeightRecordHandler = move_task_order.CreateExcessWeightRecordHandlerFunc(func(params move_task_order.CreateExcessWeightRecordParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.CreateExcessWeightRecord has not yet been implemented") - }) - } - if api.MtoShipmentCreateMTOAgentHandler == nil { - api.MtoShipmentCreateMTOAgentHandler = mto_shipment.CreateMTOAgentHandlerFunc(func(params mto_shipment.CreateMTOAgentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOAgent has not yet been implemented") - }) - } - if api.MtoServiceItemCreateMTOServiceItemHandler == nil { - api.MtoServiceItemCreateMTOServiceItemHandler = mto_service_item.CreateMTOServiceItemHandlerFunc(func(params mto_service_item.CreateMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.CreateMTOServiceItem has not yet been implemented") - }) - } - if api.MtoShipmentCreateMTOShipmentHandler == nil { - api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }) - } - if api.PaymentRequestCreatePaymentRequestHandler == nil { - api.PaymentRequestCreatePaymentRequestHandler = payment_request.CreatePaymentRequestHandlerFunc(func(params payment_request.CreatePaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.CreatePaymentRequest has not yet been implemented") - }) - } - if api.MtoShipmentCreateSITExtensionHandler == nil { - api.MtoShipmentCreateSITExtensionHandler = mto_shipment.CreateSITExtensionHandlerFunc(func(params mto_shipment.CreateSITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateSITExtension has not yet been implemented") - }) - } - if api.MtoServiceItemCreateServiceRequestDocumentUploadHandler == nil { - api.MtoServiceItemCreateServiceRequestDocumentUploadHandler = mto_service_item.CreateServiceRequestDocumentUploadHandlerFunc(func(params mto_service_item.CreateServiceRequestDocumentUploadParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.CreateServiceRequestDocumentUpload has not yet been implemented") - }) - } - if api.PaymentRequestCreateUploadHandler == nil { - api.PaymentRequestCreateUploadHandler = payment_request.CreateUploadHandlerFunc(func(params payment_request.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.CreateUpload has not yet been implemented") - }) - } - if api.MtoShipmentDeleteMTOShipmentHandler == nil { - api.MtoShipmentDeleteMTOShipmentHandler = mto_shipment.DeleteMTOShipmentHandlerFunc(func(params mto_shipment.DeleteMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.DeleteMTOShipment has not yet been implemented") - }) - } - if api.MoveTaskOrderDownloadMoveOrderHandler == nil { - api.MoveTaskOrderDownloadMoveOrderHandler = move_task_order.DownloadMoveOrderHandlerFunc(func(params move_task_order.DownloadMoveOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.DownloadMoveOrder has not yet been implemented") - }) - } - if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { - api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }) - } - if api.MoveTaskOrderListMovesHandler == nil { - api.MoveTaskOrderListMovesHandler = move_task_order.ListMovesHandlerFunc(func(params move_task_order.ListMovesParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.ListMoves has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOAgentHandler == nil { - api.MtoShipmentUpdateMTOAgentHandler = mto_shipment.UpdateMTOAgentHandlerFunc(func(params mto_shipment.UpdateMTOAgentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOAgent has not yet been implemented") - }) - } - if api.MoveTaskOrderUpdateMTOPostCounselingInformationHandler == nil { - api.MoveTaskOrderUpdateMTOPostCounselingInformationHandler = move_task_order.UpdateMTOPostCounselingInformationHandlerFunc(func(params move_task_order.UpdateMTOPostCounselingInformationParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOPostCounselingInformation has not yet been implemented") - }) - } - if api.MtoServiceItemUpdateMTOServiceItemHandler == nil { - api.MtoServiceItemUpdateMTOServiceItemHandler = mto_service_item.UpdateMTOServiceItemHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItem has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentHandler == nil { - api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentAddressHandler == nil { - api.MtoShipmentUpdateMTOShipmentAddressHandler = mto_shipment.UpdateMTOShipmentAddressHandlerFunc(func(params mto_shipment.UpdateMTOShipmentAddressParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentAddress has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentStatusHandler == nil { - api.MtoShipmentUpdateMTOShipmentStatusHandler = mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") - }) - } - if api.MtoShipmentUpdateReweighHandler == nil { - api.MtoShipmentUpdateReweighHandler = mto_shipment.UpdateReweighHandlerFunc(func(params mto_shipment.UpdateReweighParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateReweigh has not yet been implemented") - }) - } - if api.MtoShipmentUpdateShipmentDestinationAddressHandler == nil { - api.MtoShipmentUpdateShipmentDestinationAddressHandler = mto_shipment.UpdateShipmentDestinationAddressHandlerFunc(func(params mto_shipment.UpdateShipmentDestinationAddressParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateShipmentDestinationAddress has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/primeapi/doc.go b/pkg/gen/primeapi/doc.go deleted file mode 100644 index 3ad89caf91a..00000000000 --- a/pkg/gen/primeapi/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package primeapi MilMove Prime API -// -// The Prime API is a RESTful API that enables the Prime contractor to request -// information about upcoming moves, update the details and status of those moves, -// and make payment requests. It uses Mutual TLS for authentication procedures. -// -// All endpoints are located at `/prime/v1/`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /prime/v1 -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// - multipart/form-data -// -// Produces: -// - application/pdf -// - application/json -// -// swagger:meta -package primeapi diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go deleted file mode 100644 index 5ce22a16bfb..00000000000 --- a/pkg/gen/primeapi/embedded_spec.go +++ /dev/null @@ -1,9491 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primeapi - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v1/` + "`" + `.\n", - "title": "MilMove Prime API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v1", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use.", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/excess-weight-record": { - "post": { - "description": "Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "createExcessWeightRecord", - "operationId": "createExcessWeightRecord", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move being updated.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully uploaded the excess weight record file.", - "schema": { - "$ref": "#/definitions/ExcessWeightRecord" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/post-counseling-info": { - "patch": { - "description": "### Functionality\nThis endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling.\nThis update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update.\nNo body object is expected for this request.\n\n**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs.\n\n**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "updateMTOPostCounselingInformation", - "operationId": "updateMTOPostCounselingInformation", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order with post counseling information.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move task order to use.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/moves": { - "get": { - "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "listMoves", - "operationId": "listMoves", - "parameters": [ - { - "type": "string", - "format": "date-time", - "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/ListMoves" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/moves/{locator}/documents": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentations into one download file by locator.\n\n### Errors\n* The move must be in need counseling state.\n* The move client's origin duty location must not currently have gov counseling.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Downloads move order as a PDF", - "operationId": "downloadMoveOrder", - "parameters": [ - { - "type": "string", - "description": "the locator code for move order to be downloaded", - "name": "locator", - "in": "path", - "required": true - }, - { - "enum": [ - "ALL", - "ORDERS", - "AMENDMENTS" - ], - "type": "string", - "default": "ALL", - "description": "upload type", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Move Order PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-service-items": { - "post": { - "description": "Creates one or more MTOServiceItems. Not all service items may be created, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to create and the documentation will update with the new definition.\n\nUpon creation these items are associated with a Move Task Order and an MTO Shipment.\nThe request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require\nadditional service items to be autogenerated when added - all created service items, autogenerated included,\nwill be returned in the response.\n\nTo update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint.\n\n---\n\n**` + "`" + `MTOServiceItemOriginSIT` + "`" + `**\n\nMTOServiceItemOriginSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic origin SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DOFSIT**\n\n**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items:\n * DOFSIT - Domestic origin 1st day SIT\n * DOASIT - Domestic origin Additional day SIT\n * DOPSIT - Domestic origin SIT pickup\n * DOSFSC - Domestic origin SIT fuel surcharge\n\n**DOASIT**\n\n**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item.\nAdditional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**.\n\n---\n\n**` + "`" + `MTOServiceItemDestSIT` + "`" + `**\n\nMTOServiceItemDestSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic destination SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DDFSIT**\n\n**1st day destination SIT service item**.\n\nThese additional fields are optional for creating a DDFSIT:\n * ` + "`" + `firstAvailableDeliveryDate1` + "`" + `\n * string \u003cdate\u003e\n * First available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together\n * ` + "`" + `dateOfContact1` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `\n * dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `timeMilitary1` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.\n * timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `firstAvailableDeliveryDate2` + "`" + `\n * string \u003cdate\u003e\n * Second available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together\n * ` + "`" + `dateOfContact2` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact delivery by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `\n * dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together\n * ` + "`" + `timeMilitary2` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.\n * timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together\n\nWhen a DDFSIT is requested, the API will auto-create the following group of service items:\n * DDFSIT - Domestic destination 1st day SIT\n * DDASIT - Domestic destination Additional day SIT\n * DDDSIT - Domestic destination SIT delivery\n * DDSFSC - Domestic destination SIT fuel surcharge\n\n**NOTE** When providing the ` + "`" + `sitEntryDate` + "`" + ` value in the payload, please ensure that the date is not BEFORE\n` + "`" + `firstAvailableDeliveryDate1` + "`" + ` or ` + "`" + `firstAvailableDeliveryDate2` + "`" + `. If it is, you will receive an error response.\n\n**DDASIT**\n\n**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item.\nAdditional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "createMTOServiceItem", - "operationId": "createMTOServiceItem", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - } - ], - "responses": { - "200": { - "description": "Successfully created an MTO service item.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}": { - "patch": { - "description": "Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to update and the documentation will update with the new definition.\n\n* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address.\nFor approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress).\nFor shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress).\n\n* SIT Service Items: Take note that when updating ` + "`" + `sitCustomerContacted` + "`" + `, ` + "`" + `sitDepartureDate` + "`" + `, or ` + "`" + `sitRequestedDelivery` + "`" + `, we want\nthose to be updated on ` + "`" + `DOASIT` + "`" + ` (for origin SIT) and ` + "`" + `DDASIT` + "`" + ` (for destination SIT). If updating those values in other service\nitems, the office users will not have as much attention to those values.\n\nTo create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint.\n\n* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from\nREJECTED to SUBMITTED. Please provide the ` + "`" + `requestedApprovalsRequestedStatus: true` + "`" + ` when resubmitting as this will give attention to the TOO to\nreview the resubmitted SIT service item. Another note, ` + "`" + `updateReason` + "`" + ` must have a different value than the current ` + "`" + `reason` + "`" + ` value on the service item.\nIf this value is not updated, then an error will be sent back.\n\nThe following SIT service items can be resubmitted following a rejection:\n- DDASIT\n- DDDSIT\n- DDFSIT\n- DOASIT\n- DOPSIT\n- DOFSIT\n- DDSFSC\n- DOSFSC\n\nAt a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"reServiceCode\": \"DDFSIT\",\n \"updateReason\": \"A reason that differs from the previous reason\",\n \"modelType\": \"UpdateMTOServiceItemSIT\",\n \"requestApprovalsRequestedStatus\": true\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nThe following service items allow you to update the Port that the shipment will use:\n- PODFSC (Port of Debarkation can be updated)\n- POEFSC (Port of Embarkation can be updated)\n\nAt a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item.\nPlease see the example payload below:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"id\": \"1ed224b6-c65e-4616-b88e-8304d26c9562\",\n \"modelType\": \"UpdateMTOServiceItemInternationalPortFSC\",\n \"portCode\": \"SEA\",\n \"reServiceCode\": \"POEFSC\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "updateMTOServiceItem", - "operationId": "updateMTOServiceItem", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOServiceItem" - } - }, - { - "type": "string", - "description": "UUID of service item to update.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO service item.", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}/uploads": { - "post": { - "description": "### Functionality\n\nThis endpoint **uploads** a Service Request document for a\nServiceItem.\n\nThe ServiceItem should already exist.\n\nServiceItems are created with the\n[createMTOServiceItem](#operation/createMTOServiceItem)\nendpoint.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "createServiceRequestDocumentUpload", - "operationId": "createServiceRequestDocumentUpload", - "parameters": [ - { - "type": "string", - "description": "UUID of the service item to use.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully created upload of digital file.", - "schema": { - "$ref": "#/definitions/UploadWithOmissions" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead.\n", - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "deprecated": true, - "responses": { - "410": { - "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead." - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "delete": { - "description": "### Functionality\nThis endpoint deletes an individual shipment by ID.\n\n### Errors\n* The mtoShipment should be associated with an MTO that is available to prime.\n* The mtoShipment must be a PPM shipment.\n* Counseling should not have already been completed for the associated MTO.\n", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "deleteMTOShipment", - "operationId": "deleteMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment to be deleted", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully deleted the MTO shipment." - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "patch": { - "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead.\n", - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "410": { - "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead." - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/addresses/{addressID}": { - "put": { - "description": "### Functionality\nThis endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID.\nTherefore a complete address should be sent in the request.\nWhen a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match.\n\nThis endpoint **cannot create** an address.\nTo create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address.\n\n### Errors\nThe address must be associated with the mtoShipment passed in the url.\nIn other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided.\nIf it is not, caller will receive a **Conflict** Error.\n\nThe mtoShipment should be associated with an MTO that is available to prime.\nIf the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentAddress", - "operationId": "updateMTOShipmentAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the address", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the address being updated", - "name": "addressID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Address" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the address.", - "schema": { - "$ref": "#/definitions/Address" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/agents": { - "post": { - "description": "### Functionality\nThis endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Pime.\nIf the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOAgent", - "operationId": "createMTOAgent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOAgent" - } - } - ], - "responses": { - "200": { - "description": "Successfully added the agent.", - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/agents/{agentID}": { - "put": { - "description": "### Functionality\nThis endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors:\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Prime.\nIf the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOAgent", - "operationId": "updateMTOAgent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the agent being updated", - "name": "agentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the agent.", - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}": { - "patch": { - "description": "### Functionality\nThis endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur.\nOnly one of weight or verificationReason should be sent in the request body.\n\nA reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment.\nA reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed,\nso not all shipments will have a reweigh weight.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateReweigh", - "operationId": "updateReweigh", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the reweigh", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the reweigh being updated", - "name": "reweighID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateReweigh" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the reweigh.", - "schema": { - "$ref": "#/definitions/Reweigh" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/shipment-address-updates": { - "post": { - "description": "### Functionality\nThis endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment,\nafter the delivery address has already been approved.\n\nThis endpoint and operation only supports the following shipment types:\n- HHG\n- NTSR\n\nFor HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved.\n\nAddress updates will be automatically approved unless they change:\n - The service area\n - Mileage bracket for direct delivery\n - the address and the distance between the old and new address is \u003e 50\n - Domestic Short Haul to Domestic Line Haul or vice versa\n - Shipments that start and end in one ZIP3 use Short Haul pricing\n - Shipments that start and end in different ZIP3s use Line Haul pricing\n\nFor those, changes will require TOO approval.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateShipmentDestinationAddress", - "operationId": "updateShipmentDestinationAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the address", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateShipmentDestinationAddress" - } - }, - { - "type": "string", - "description": "Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully created the address update request.", - "schema": { - "$ref": "#/definitions/ShipmentAddressUpdate" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/sit-extensions": { - "post": { - "description": "### Functionality\nThis endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an\nincrease in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance\nincludes time spent in both origin and destination SIT.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createSITExtension", - "operationId": "createSITExtension", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateSITExtension" - } - } - ], - "responses": { - "201": { - "description": "Successfully created the sit extension request.", - "schema": { - "$ref": "#/definitions/SITExtension" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/status": { - "patch": { - "description": "### Functionality\nThis endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment\nstatus to be changed to \"CANCELED.\" Currently, the Prime cannot update the shipment to any other status.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentStatus", - "operationId": "updateMTOShipmentStatus", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipmentStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the shipment's status.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/payment-requests": { - "post": { - "description": "Creates a new instance of a paymentRequest and is assigned the status ` + "`" + `PENDING` + "`" + `.\nA move task order can have multiple payment requests, and\na final payment request can be marked using boolean ` + "`" + `isFinal` + "`" + `.\n\nIf a ` + "`" + `PENDING` + "`" + ` payment request is recalculated,\na new payment request is created and the original request is\nmarked with the status ` + "`" + `DEPRECATED` + "`" + `.\n\n**NOTE**: In order to create a payment request for most service items, the shipment *must*\nbe updated with the ` + "`" + `PrimeActualWeight` + "`" + ` value via [updateMTOShipment](#operation/updateMTOShipment).\n\nIf ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n\n**NOTE**: Diversions have a unique calcuation for payment requests without a ` + "`" + `WeightBilled` + "`" + ` parameter.\n\nIf you created a payment request for a diversion and ` + "`" + `WeightBilled` + "`" + ` is not provided, then the following will be used in the calculation:\n- The lowest shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) found in the diverted shipment chain.\n- The lowest reweigh weight found in the diverted shipment chain.\n\nThe diverted shipment chain is created by referencing the ` + "`" + `diversion` + "`" + ` boolean, ` + "`" + `divertedFromShipmentId` + "`" + ` UUID, and matching destination to pickup addresses.\nIf the chain cannot be established it will fall back to the ` + "`" + `PrimeActualWeight` + "`" + ` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations.\nThe lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found.\n\nA service item can be on several payment requests in the case of partial payment requests and payments.\n\nIn the request, if no params are necessary, then just the ` + "`" + `serviceItem` + "`" + ` ` + "`" + `id` + "`" + ` is required. For example:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"isFinal\": false,\n \"moveTaskOrderID\": \"uuid\",\n \"serviceItems\": [\n {\n \"id\": \"uuid\",\n },\n {\n \"id\": \"uuid\",\n \"params\": [\n {\n \"key\": \"Service Item Parameter Name\",\n \"value\": \"Service Item Parameter Value\"\n }\n ]\n }\n ],\n \"pointOfContact\": \"string\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DLH - Domestic Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DSH - Domestic Shorthaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**FSC - Fuel Surcharge**\n**NOTE**: FSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DUPK - Domestic Unpacking**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DNPK - Domestic NTS Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOP - Domestic Origin Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDP - Domestic Destination Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic SIT Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DOFSIT - Domestic origin 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOPSIT - Domestic origin SIT pickup**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOSHUT - Domestic origin shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDFSIT - Domestic destination 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDDSIT - Domestic destination SIT delivery**\n*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDSHUT - Domestic destination shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n\nInternational Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\nJust like domestic shipments \u0026 service items, if ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n**NOTE**: ` + "`" + `POEFSC` + "`" + ` \u0026 ` + "`" + `PODFSC` + "`" + ` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint.\n\n**ISLH - International Shipping \u0026 Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHPK - International HHG Pack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHUPK - International HHG Unpack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**POEFSC - International Port of Embarkation Fuel Surcharge**\n **NOTE**: POEFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `POELocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**PODFSC - International Port of Debarkation Fuel Surcharge**\n**NOTE**: PODFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `PODLocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "createPaymentRequest", - "operationId": "createPaymentRequest", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreatePaymentRequest" - } - } - ], - "responses": { - "201": { - "description": "Successfully created a paymentRequest object.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "Request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/payment-requests/{paymentRequestID}/uploads": { - "post": { - "description": "### Functionality\nThis endpoint **uploads** a Proof of Service document for a PaymentRequest.\n\nThe PaymentRequest should already exist.\n\nOptional key of **isWeightTicket** indicates if the document is a weight ticket or not.\nThis will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents.\nIf left empty, it will assume it is NOT a weight ticket.\n\nThe formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": true\n }\n ` + "`" + `` + "`" + `` + "`" + `\n If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": false\n }\n ` + "`" + `` + "`" + `` + "`" + `\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n }\n ` + "`" + `` + "`" + `` + "`" + `\n\nPaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "createUpload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "description": "UUID of payment request to use.", - "name": "paymentRequestID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "boolean", - "description": "Indicates whether the file is a weight ticket.", - "name": "isWeightTicket", - "in": "formData" - } - ], - "responses": { - "201": { - "description": "Successfully created upload of digital file.", - "schema": { - "$ref": "#/definitions/UploadWithOmissions" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Amendments": { - "description": "Metadata outlining number of amendments for given order.\n", - "type": "object", - "required": [ - "total", - "availableSince" - ], - "properties": { - "availableSince": { - "description": "The total count of amendments available since specified time.", - "type": "integer" - }, - "total": { - "description": "The total count of amendments.", - "type": "integer" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - } - } - }, - "CreatePaymentRequest": { - "type": "object", - "required": [ - "moveTaskOrderID", - "serviceItems" - ], - "properties": { - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "pointOfContact": { - "description": "Email or id of a contact person for this update.", - "type": "string" - }, - "serviceItems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/ServiceItem" - } - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "ExcessWeightRecord": { - "description": "A document uploaded by the movers proving that the customer has been counseled about excess weight.", - "allOf": [ - { - "$ref": "#/definitions/UploadWithOmissions" - }, - { - "type": "object", - "required": [ - "moveId" - ], - "properties": { - "moveExcessWeightAcknowledgedAt": { - "description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "moveExcessWeightQualifiedAt": { - "description": "The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "moveId": { - "description": "The UUID of the move this excess weight record belongs to.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - } - ] - }, - "ListMove": { - "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", - "type": "object", - "properties": { - "amendments": { - "$ref": "#/definitions/Amendments" - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "JFK" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ListMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/ListMove" - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalFuelSurcharge": { - "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "properties": { - "portCode": { - "description": "A unique code for a Port", - "type": "string" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).", - "type": "string", - "enum": [ - "PODFSC", - "POEFSC" - ] - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "params": { - "description": "This should be populated for the following service items:\n * DOASIT(Domestic origin Additional day SIT)\n * DDASIT(Domestic destination Additional day SIT)\n\nBoth take in the following param keys:\n * ` + "`" + `SITPaymentRequestStart` + "`" + `\n * ` + "`" + `SITPaymentRequestEnd` + "`" + `\n\nThe value of each is a date string in the format \"YYYY-MM-DD\" (e.g. \"2023-01-15\")\n", - "type": "array", - "items": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "Service Item Parameter Name" - }, - "value": { - "type": "string", - "example": "Service Item Parameter Value" - } - } - } - } - } - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemInternationalPortFSC": { - "description": "Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "portCode": { - "description": "Port used for the shipment. Relevant for moving (PODFSC \u0026 POEFSC) service items.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "PDX" - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "PODFSC", - "POEFSC" - ] - } - } - } - ] - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DDFSIT - UpdateMTOServiceItemSIT\n * DDASIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DOSFSC - UpdateMTOServiceItemSIT\n * DDSFSC - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n * PODFSC - UpdateMTOServiceItemInternationalPortFSC\n * POEFSC - UpdateMTOServiceItemInternationalPortFSC\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle", - "UpdateMTOServiceItemInternationalPortFSC" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DDASIT", - "DDFSIT", - "DDSFSC", - "DOPSIT", - "DOASIT", - "DOFSIT", - "DOSFSC" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotImplemented": { - "description": "The requested feature is still in development.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - }, - { - "description": "A service item is a service that the contractor can bill for. For example, if the movers pack and/or unpack a\ncustomer's belongings, those are billable services (packing and unpacking). All **mtoServiceItems** must be\napproved by the TOO before payment can be requested.\n\nThere are three types of service items: accessorial, MTO-level, and standard.\n\n**WIP:** Add an external link to an article that explains the different types of service items in more detail.\n", - "name": "mtoServiceItem" - }, - { - "description": "The contractor submits a **paymentRequest** to the TIO for approval in order to be reimbursed for 1 or more\n**mtoServiceItems** on a **moveTaskOrder**. A service item can be on multiple payment requests if necessary.\n\nProof of service documentation may be uploaded for each **mtoServiceItem** in a **paymentRequest** after the payment\nrequest is created via the endpoint [createUpload](#operation/createUpload).\n\nAll weight entered should be in *pounds* and no other unit of measurement.\n", - "name": "paymentRequest" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment", - "mtoServiceItem", - "paymentRequest" - ] - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v1/` + "`" + `.\n", - "title": "MilMove Prime API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v1", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use.", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/excess-weight-record": { - "post": { - "description": "Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "createExcessWeightRecord", - "operationId": "createExcessWeightRecord", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the move being updated.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully uploaded the excess weight record file.", - "schema": { - "$ref": "#/definitions/ExcessWeightRecord" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}/post-counseling-info": { - "patch": { - "description": "### Functionality\nThis endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling.\nThis update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update.\nNo body object is expected for this request.\n\n**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs.\n\n**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "updateMTOPostCounselingInformation", - "operationId": "updateMTOPostCounselingInformation", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated move task order with post counseling information.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "ID of move task order to use.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/moves": { - "get": { - "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "listMoves", - "operationId": "listMoves", - "parameters": [ - { - "type": "string", - "format": "date-time", - "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", - "schema": { - "$ref": "#/definitions/ListMoves" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/moves/{locator}/documents": { - "get": { - "description": "### Functionality\nThis endpoint downloads all uploaded move order documentations into one download file by locator.\n\n### Errors\n* The move must be in need counseling state.\n* The move client's origin duty location must not currently have gov counseling.\n", - "produces": [ - "application/pdf" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "Downloads move order as a PDF", - "operationId": "downloadMoveOrder", - "parameters": [ - { - "type": "string", - "description": "the locator code for move order to be downloaded", - "name": "locator", - "in": "path", - "required": true - }, - { - "enum": [ - "ALL", - "ORDERS", - "AMENDMENTS" - ], - "type": "string", - "default": "ALL", - "description": "upload type", - "name": "type", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Move Order PDF", - "schema": { - "type": "file", - "format": "binary" - }, - "headers": { - "Content-Disposition": { - "type": "string", - "description": "File name to download" - } - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-service-items": { - "post": { - "description": "Creates one or more MTOServiceItems. Not all service items may be created, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to create and the documentation will update with the new definition.\n\nUpon creation these items are associated with a Move Task Order and an MTO Shipment.\nThe request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require\nadditional service items to be autogenerated when added - all created service items, autogenerated included,\nwill be returned in the response.\n\nTo update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint.\n\n---\n\n**` + "`" + `MTOServiceItemOriginSIT` + "`" + `**\n\nMTOServiceItemOriginSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic origin SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DOFSIT**\n\n**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items:\n * DOFSIT - Domestic origin 1st day SIT\n * DOASIT - Domestic origin Additional day SIT\n * DOPSIT - Domestic origin SIT pickup\n * DOSFSC - Domestic origin SIT fuel surcharge\n\n**DOASIT**\n\n**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item.\nAdditional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**.\n\n---\n\n**` + "`" + `MTOServiceItemDestSIT` + "`" + `**\n\nMTOServiceItemDestSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic destination SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DDFSIT**\n\n**1st day destination SIT service item**.\n\nThese additional fields are optional for creating a DDFSIT:\n * ` + "`" + `firstAvailableDeliveryDate1` + "`" + `\n * string \u003cdate\u003e\n * First available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together\n * ` + "`" + `dateOfContact1` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `\n * dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `timeMilitary1` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.\n * timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `firstAvailableDeliveryDate2` + "`" + `\n * string \u003cdate\u003e\n * Second available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together\n * ` + "`" + `dateOfContact2` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact delivery by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `\n * dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together\n * ` + "`" + `timeMilitary2` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.\n * timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together\n\nWhen a DDFSIT is requested, the API will auto-create the following group of service items:\n * DDFSIT - Domestic destination 1st day SIT\n * DDASIT - Domestic destination Additional day SIT\n * DDDSIT - Domestic destination SIT delivery\n * DDSFSC - Domestic destination SIT fuel surcharge\n\n**NOTE** When providing the ` + "`" + `sitEntryDate` + "`" + ` value in the payload, please ensure that the date is not BEFORE\n` + "`" + `firstAvailableDeliveryDate1` + "`" + ` or ` + "`" + `firstAvailableDeliveryDate2` + "`" + `. If it is, you will receive an error response.\n\n**DDASIT**\n\n**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item.\nAdditional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "createMTOServiceItem", - "operationId": "createMTOServiceItem", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - } - ], - "responses": { - "200": { - "description": "Successfully created an MTO service item.", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}": { - "patch": { - "description": "Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to update and the documentation will update with the new definition.\n\n* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address.\nFor approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress).\nFor shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress).\n\n* SIT Service Items: Take note that when updating ` + "`" + `sitCustomerContacted` + "`" + `, ` + "`" + `sitDepartureDate` + "`" + `, or ` + "`" + `sitRequestedDelivery` + "`" + `, we want\nthose to be updated on ` + "`" + `DOASIT` + "`" + ` (for origin SIT) and ` + "`" + `DDASIT` + "`" + ` (for destination SIT). If updating those values in other service\nitems, the office users will not have as much attention to those values.\n\nTo create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint.\n\n* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from\nREJECTED to SUBMITTED. Please provide the ` + "`" + `requestedApprovalsRequestedStatus: true` + "`" + ` when resubmitting as this will give attention to the TOO to\nreview the resubmitted SIT service item. Another note, ` + "`" + `updateReason` + "`" + ` must have a different value than the current ` + "`" + `reason` + "`" + ` value on the service item.\nIf this value is not updated, then an error will be sent back.\n\nThe following SIT service items can be resubmitted following a rejection:\n- DDASIT\n- DDDSIT\n- DDFSIT\n- DOASIT\n- DOPSIT\n- DOFSIT\n- DDSFSC\n- DOSFSC\n\nAt a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"reServiceCode\": \"DDFSIT\",\n \"updateReason\": \"A reason that differs from the previous reason\",\n \"modelType\": \"UpdateMTOServiceItemSIT\",\n \"requestApprovalsRequestedStatus\": true\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nThe following service items allow you to update the Port that the shipment will use:\n- PODFSC (Port of Debarkation can be updated)\n- POEFSC (Port of Embarkation can be updated)\n\nAt a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item.\nPlease see the example payload below:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"id\": \"1ed224b6-c65e-4616-b88e-8304d26c9562\",\n \"modelType\": \"UpdateMTOServiceItemInternationalPortFSC\",\n \"portCode\": \"SEA\",\n \"reServiceCode\": \"POEFSC\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "updateMTOServiceItem", - "operationId": "updateMTOServiceItem", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOServiceItem" - } - }, - { - "type": "string", - "description": "UUID of service item to update.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO service item.", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}/uploads": { - "post": { - "description": "### Functionality\n\nThis endpoint **uploads** a Service Request document for a\nServiceItem.\n\nThe ServiceItem should already exist.\n\nServiceItems are created with the\n[createMTOServiceItem](#operation/createMTOServiceItem)\nendpoint.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "createServiceRequestDocumentUpload", - "operationId": "createServiceRequestDocumentUpload", - "parameters": [ - { - "type": "string", - "description": "UUID of the service item to use.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully created upload of digital file.", - "schema": { - "$ref": "#/definitions/UploadWithOmissions" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead.\n", - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "deprecated": true, - "responses": { - "410": { - "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead." - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "delete": { - "description": "### Functionality\nThis endpoint deletes an individual shipment by ID.\n\n### Errors\n* The mtoShipment should be associated with an MTO that is available to prime.\n* The mtoShipment must be a PPM shipment.\n* Counseling should not have already been completed for the associated MTO.\n", - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "deleteMTOShipment", - "operationId": "deleteMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment to be deleted", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "204": { - "description": "Successfully deleted the MTO shipment." - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "patch": { - "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead.\n", - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "deprecated": true, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ], - "responses": { - "410": { - "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead." - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/addresses/{addressID}": { - "put": { - "description": "### Functionality\nThis endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID.\nTherefore a complete address should be sent in the request.\nWhen a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match.\n\nThis endpoint **cannot create** an address.\nTo create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address.\n\n### Errors\nThe address must be associated with the mtoShipment passed in the url.\nIn other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided.\nIf it is not, caller will receive a **Conflict** Error.\n\nThe mtoShipment should be associated with an MTO that is available to prime.\nIf the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentAddress", - "operationId": "updateMTOShipmentAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the address", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the address being updated", - "name": "addressID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/Address" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the address.", - "schema": { - "$ref": "#/definitions/Address" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/agents": { - "post": { - "description": "### Functionality\nThis endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Pime.\nIf the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOAgent", - "operationId": "createMTOAgent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOAgent" - } - } - ], - "responses": { - "200": { - "description": "Successfully added the agent.", - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/agents/{agentID}": { - "put": { - "description": "### Functionality\nThis endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors:\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Prime.\nIf the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOAgent", - "operationId": "updateMTOAgent", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the agent being updated", - "name": "agentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the agent.", - "schema": { - "$ref": "#/definitions/MTOAgent" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}": { - "patch": { - "description": "### Functionality\nThis endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur.\nOnly one of weight or verificationReason should be sent in the request body.\n\nA reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment.\nA reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed,\nso not all shipments will have a reweigh weight.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateReweigh", - "operationId": "updateReweigh", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the reweigh", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "format": "uuid", - "description": "UUID of the reweigh being updated", - "name": "reweighID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateReweigh" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the reweigh.", - "schema": { - "$ref": "#/definitions/Reweigh" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/shipment-address-updates": { - "post": { - "description": "### Functionality\nThis endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment,\nafter the delivery address has already been approved.\n\nThis endpoint and operation only supports the following shipment types:\n- HHG\n- NTSR\n\nFor HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved.\n\nAddress updates will be automatically approved unless they change:\n - The service area\n - Mileage bracket for direct delivery\n - the address and the distance between the old and new address is \u003e 50\n - Domestic Short Haul to Domestic Line Haul or vice versa\n - Shipments that start and end in one ZIP3 use Short Haul pricing\n - Shipments that start and end in different ZIP3s use Line Haul pricing\n\nFor those, changes will require TOO approval.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateShipmentDestinationAddress", - "operationId": "updateShipmentDestinationAddress", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the address", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateShipmentDestinationAddress" - } - }, - { - "type": "string", - "description": "Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "201": { - "description": "Successfully created the address update request.", - "schema": { - "$ref": "#/definitions/ShipmentAddressUpdate" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/sit-extensions": { - "post": { - "description": "### Functionality\nThis endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an\nincrease in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance\nincludes time spent in both origin and destination SIT.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createSITExtension", - "operationId": "createSITExtension", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/CreateSITExtension" - } - } - ], - "responses": { - "201": { - "description": "Successfully created the sit extension request.", - "schema": { - "$ref": "#/definitions/SITExtension" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}/status": { - "patch": { - "description": "### Functionality\nThis endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment\nstatus to be changed to \"CANCELED.\" Currently, the Prime cannot update the shipment to any other status.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentStatus", - "operationId": "updateMTOShipmentStatus", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment associated with the agent", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipmentStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the shipment's status.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/payment-requests": { - "post": { - "description": "Creates a new instance of a paymentRequest and is assigned the status ` + "`" + `PENDING` + "`" + `.\nA move task order can have multiple payment requests, and\na final payment request can be marked using boolean ` + "`" + `isFinal` + "`" + `.\n\nIf a ` + "`" + `PENDING` + "`" + ` payment request is recalculated,\na new payment request is created and the original request is\nmarked with the status ` + "`" + `DEPRECATED` + "`" + `.\n\n**NOTE**: In order to create a payment request for most service items, the shipment *must*\nbe updated with the ` + "`" + `PrimeActualWeight` + "`" + ` value via [updateMTOShipment](#operation/updateMTOShipment).\n\nIf ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n\n**NOTE**: Diversions have a unique calcuation for payment requests without a ` + "`" + `WeightBilled` + "`" + ` parameter.\n\nIf you created a payment request for a diversion and ` + "`" + `WeightBilled` + "`" + ` is not provided, then the following will be used in the calculation:\n- The lowest shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) found in the diverted shipment chain.\n- The lowest reweigh weight found in the diverted shipment chain.\n\nThe diverted shipment chain is created by referencing the ` + "`" + `diversion` + "`" + ` boolean, ` + "`" + `divertedFromShipmentId` + "`" + ` UUID, and matching destination to pickup addresses.\nIf the chain cannot be established it will fall back to the ` + "`" + `PrimeActualWeight` + "`" + ` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations.\nThe lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found.\n\nA service item can be on several payment requests in the case of partial payment requests and payments.\n\nIn the request, if no params are necessary, then just the ` + "`" + `serviceItem` + "`" + ` ` + "`" + `id` + "`" + ` is required. For example:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"isFinal\": false,\n \"moveTaskOrderID\": \"uuid\",\n \"serviceItems\": [\n {\n \"id\": \"uuid\",\n },\n {\n \"id\": \"uuid\",\n \"params\": [\n {\n \"key\": \"Service Item Parameter Name\",\n \"value\": \"Service Item Parameter Value\"\n }\n ]\n }\n ],\n \"pointOfContact\": \"string\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DLH - Domestic Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DSH - Domestic Shorthaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**FSC - Fuel Surcharge**\n**NOTE**: FSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DUPK - Domestic Unpacking**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DNPK - Domestic NTS Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOP - Domestic Origin Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDP - Domestic Destination Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic SIT Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DOFSIT - Domestic origin 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOPSIT - Domestic origin SIT pickup**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOSHUT - Domestic origin shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDFSIT - Domestic destination 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDDSIT - Domestic destination SIT delivery**\n*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDSHUT - Domestic destination shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n\nInternational Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\nJust like domestic shipments \u0026 service items, if ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n**NOTE**: ` + "`" + `POEFSC` + "`" + ` \u0026 ` + "`" + `PODFSC` + "`" + ` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint.\n\n**ISLH - International Shipping \u0026 Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHPK - International HHG Pack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHUPK - International HHG Unpack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**POEFSC - International Port of Embarkation Fuel Surcharge**\n **NOTE**: POEFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `POELocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**PODFSC - International Port of Debarkation Fuel Surcharge**\n**NOTE**: PODFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `PODLocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "createPaymentRequest", - "operationId": "createPaymentRequest", - "parameters": [ - { - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreatePaymentRequest" - } - } - ], - "responses": { - "201": { - "description": "Successfully created a paymentRequest object.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "Request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/payment-requests/{paymentRequestID}/uploads": { - "post": { - "description": "### Functionality\nThis endpoint **uploads** a Proof of Service document for a PaymentRequest.\n\nThe PaymentRequest should already exist.\n\nOptional key of **isWeightTicket** indicates if the document is a weight ticket or not.\nThis will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents.\nIf left empty, it will assume it is NOT a weight ticket.\n\nThe formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": true\n }\n ` + "`" + `` + "`" + `` + "`" + `\n If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": false\n }\n ` + "`" + `` + "`" + `` + "`" + `\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n }\n ` + "`" + `` + "`" + `` + "`" + `\n\nPaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint.\n", - "consumes": [ - "multipart/form-data" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "createUpload", - "operationId": "createUpload", - "parameters": [ - { - "type": "string", - "description": "UUID of payment request to use.", - "name": "paymentRequestID", - "in": "path", - "required": true - }, - { - "type": "file", - "description": "The file to upload.", - "name": "file", - "in": "formData", - "required": true - }, - { - "type": "boolean", - "description": "Indicates whether the file is a weight ticket.", - "name": "isWeightTicket", - "in": "formData" - } - ], - "responses": { - "201": { - "description": "Successfully created upload of digital file.", - "schema": { - "$ref": "#/definitions/UploadWithOmissions" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "Amendments": { - "description": "Metadata outlining number of amendments for given order.\n", - "type": "object", - "required": [ - "total", - "availableSince" - ], - "properties": { - "availableSince": { - "description": "The total count of amendments available since specified time.", - "type": "integer" - }, - "total": { - "description": "The total count of amendments.", - "type": "integer" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - } - } - }, - "CreatePaymentRequest": { - "type": "object", - "required": [ - "moveTaskOrderID", - "serviceItems" - ], - "properties": { - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "pointOfContact": { - "description": "Email or id of a contact person for this update.", - "type": "string" - }, - "serviceItems": { - "type": "array", - "minItems": 1, - "items": { - "$ref": "#/definitions/ServiceItem" - } - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "ExcessWeightRecord": { - "description": "A document uploaded by the movers proving that the customer has been counseled about excess weight.", - "allOf": [ - { - "$ref": "#/definitions/UploadWithOmissions" - }, - { - "type": "object", - "required": [ - "moveId" - ], - "properties": { - "moveExcessWeightAcknowledgedAt": { - "description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "moveExcessWeightQualifiedAt": { - "description": "The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "moveId": { - "description": "The UUID of the move this excess weight record belongs to.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - } - ] - }, - "ListMove": { - "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", - "type": "object", - "properties": { - "amendments": { - "$ref": "#/definitions/Amendments" - }, - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "JFK" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "ppmType": { - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "ListMoves": { - "type": "array", - "items": { - "$ref": "#/definitions/ListMove" - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalFuelSurcharge": { - "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "properties": { - "portCode": { - "description": "A unique code for a Port", - "type": "string" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).", - "type": "string", - "enum": [ - "PODFSC", - "POEFSC" - ] - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "params": { - "description": "This should be populated for the following service items:\n * DOASIT(Domestic origin Additional day SIT)\n * DDASIT(Domestic destination Additional day SIT)\n\nBoth take in the following param keys:\n * ` + "`" + `SITPaymentRequestStart` + "`" + `\n * ` + "`" + `SITPaymentRequestEnd` + "`" + `\n\nThe value of each is a date string in the format \"YYYY-MM-DD\" (e.g. \"2023-01-15\")\n", - "type": "array", - "items": { - "$ref": "#/definitions/ServiceItemParamsItems0" - } - } - } - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceItemParamsItems0": { - "type": "object", - "properties": { - "key": { - "type": "string", - "example": "Service Item Parameter Name" - }, - "value": { - "type": "string", - "example": "Service Item Parameter Value" - } - } - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemInternationalPortFSC": { - "description": "Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "portCode": { - "description": "Port used for the shipment. Relevant for moving (PODFSC \u0026 POEFSC) service items.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "PDX" - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "PODFSC", - "POEFSC" - ] - } - } - } - ] - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DDFSIT - UpdateMTOServiceItemSIT\n * DDASIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DOSFSC - UpdateMTOServiceItemSIT\n * DDSFSC - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n * PODFSC - UpdateMTOServiceItemInternationalPortFSC\n * POEFSC - UpdateMTOServiceItemInternationalPortFSC\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle", - "UpdateMTOServiceItemInternationalPortFSC" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DDASIT", - "DDFSIT", - "DDSFSC", - "DOPSIT", - "DOASIT", - "DOFSIT", - "DOSFSC" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "The request could not be processed because of conflict in the current state of the resource.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotImplemented": { - "description": "The requested feature is still in development.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - }, - { - "description": "A service item is a service that the contractor can bill for. For example, if the movers pack and/or unpack a\ncustomer's belongings, those are billable services (packing and unpacking). All **mtoServiceItems** must be\napproved by the TOO before payment can be requested.\n\nThere are three types of service items: accessorial, MTO-level, and standard.\n\n**WIP:** Add an external link to an article that explains the different types of service items in more detail.\n", - "name": "mtoServiceItem" - }, - { - "description": "The contractor submits a **paymentRequest** to the TIO for approval in order to be reimbursed for 1 or more\n**mtoServiceItems** on a **moveTaskOrder**. A service item can be on multiple payment requests if necessary.\n\nProof of service documentation may be uploaded for each **mtoServiceItem** in a **paymentRequest** after the payment\nrequest is created via the endpoint [createUpload](#operation/createUpload).\n\nAll weight entered should be in *pounds* and no other unit of measurement.\n", - "name": "paymentRequest" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment", - "mtoServiceItem", - "paymentRequest" - ] - } - ] -}`)) -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go deleted file mode 100644 index 4a89c84cc04..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateExcessWeightRecordHandlerFunc turns a function with the right signature into a create excess weight record handler -type CreateExcessWeightRecordHandlerFunc func(CreateExcessWeightRecordParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateExcessWeightRecordHandlerFunc) Handle(params CreateExcessWeightRecordParams) middleware.Responder { - return fn(params) -} - -// CreateExcessWeightRecordHandler interface for that can handle valid create excess weight record params -type CreateExcessWeightRecordHandler interface { - Handle(CreateExcessWeightRecordParams) middleware.Responder -} - -// NewCreateExcessWeightRecord creates a new http.Handler for the create excess weight record operation -func NewCreateExcessWeightRecord(ctx *middleware.Context, handler CreateExcessWeightRecordHandler) *CreateExcessWeightRecord { - return &CreateExcessWeightRecord{Context: ctx, Handler: handler} -} - -/* - CreateExcessWeightRecord swagger:route POST /move-task-orders/{moveTaskOrderID}/excess-weight-record moveTaskOrder createExcessWeightRecord - -createExcessWeightRecord - -Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold. -*/ -type CreateExcessWeightRecord struct { - Context *middleware.Context - Handler CreateExcessWeightRecordHandler -} - -func (o *CreateExcessWeightRecord) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateExcessWeightRecordParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go deleted file mode 100644 index 8fcd601f0b2..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go +++ /dev/null @@ -1,131 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// CreateExcessWeightRecordMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreateExcessWeightRecordMaxParseMemory int64 = 32 << 20 - -// NewCreateExcessWeightRecordParams creates a new CreateExcessWeightRecordParams object -// -// There are no default values defined in the spec. -func NewCreateExcessWeightRecordParams() CreateExcessWeightRecordParams { - - return CreateExcessWeightRecordParams{} -} - -// CreateExcessWeightRecordParams contains all the bound params for the create excess weight record operation -// typically these are obtained from a http.Request -// -// swagger:parameters createExcessWeightRecord -type CreateExcessWeightRecordParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the move being updated. - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateExcessWeightRecordParams() beforehand. -func (o *CreateExcessWeightRecordParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(CreateExcessWeightRecordMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreateExcessWeightRecordParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *CreateExcessWeightRecordParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *CreateExcessWeightRecordParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go deleted file mode 100644 index 04fafdfb0ed..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go +++ /dev/null @@ -1,284 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateExcessWeightRecordCreatedCode is the HTTP code returned for type CreateExcessWeightRecordCreated -const CreateExcessWeightRecordCreatedCode int = 201 - -/* -CreateExcessWeightRecordCreated Successfully uploaded the excess weight record file. - -swagger:response createExcessWeightRecordCreated -*/ -type CreateExcessWeightRecordCreated struct { - - /* - In: Body - */ - Payload *primemessages.ExcessWeightRecord `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordCreated creates CreateExcessWeightRecordCreated with default headers values -func NewCreateExcessWeightRecordCreated() *CreateExcessWeightRecordCreated { - - return &CreateExcessWeightRecordCreated{} -} - -// WithPayload adds the payload to the create excess weight record created response -func (o *CreateExcessWeightRecordCreated) WithPayload(payload *primemessages.ExcessWeightRecord) *CreateExcessWeightRecordCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record created response -func (o *CreateExcessWeightRecordCreated) SetPayload(payload *primemessages.ExcessWeightRecord) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExcessWeightRecordUnauthorizedCode is the HTTP code returned for type CreateExcessWeightRecordUnauthorized -const CreateExcessWeightRecordUnauthorizedCode int = 401 - -/* -CreateExcessWeightRecordUnauthorized The request was denied. - -swagger:response createExcessWeightRecordUnauthorized -*/ -type CreateExcessWeightRecordUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordUnauthorized creates CreateExcessWeightRecordUnauthorized with default headers values -func NewCreateExcessWeightRecordUnauthorized() *CreateExcessWeightRecordUnauthorized { - - return &CreateExcessWeightRecordUnauthorized{} -} - -// WithPayload adds the payload to the create excess weight record unauthorized response -func (o *CreateExcessWeightRecordUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record unauthorized response -func (o *CreateExcessWeightRecordUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExcessWeightRecordForbiddenCode is the HTTP code returned for type CreateExcessWeightRecordForbidden -const CreateExcessWeightRecordForbiddenCode int = 403 - -/* -CreateExcessWeightRecordForbidden The request was denied. - -swagger:response createExcessWeightRecordForbidden -*/ -type CreateExcessWeightRecordForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordForbidden creates CreateExcessWeightRecordForbidden with default headers values -func NewCreateExcessWeightRecordForbidden() *CreateExcessWeightRecordForbidden { - - return &CreateExcessWeightRecordForbidden{} -} - -// WithPayload adds the payload to the create excess weight record forbidden response -func (o *CreateExcessWeightRecordForbidden) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record forbidden response -func (o *CreateExcessWeightRecordForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExcessWeightRecordNotFoundCode is the HTTP code returned for type CreateExcessWeightRecordNotFound -const CreateExcessWeightRecordNotFoundCode int = 404 - -/* -CreateExcessWeightRecordNotFound The requested resource wasn't found. - -swagger:response createExcessWeightRecordNotFound -*/ -type CreateExcessWeightRecordNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordNotFound creates CreateExcessWeightRecordNotFound with default headers values -func NewCreateExcessWeightRecordNotFound() *CreateExcessWeightRecordNotFound { - - return &CreateExcessWeightRecordNotFound{} -} - -// WithPayload adds the payload to the create excess weight record not found response -func (o *CreateExcessWeightRecordNotFound) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record not found response -func (o *CreateExcessWeightRecordNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExcessWeightRecordUnprocessableEntityCode is the HTTP code returned for type CreateExcessWeightRecordUnprocessableEntity -const CreateExcessWeightRecordUnprocessableEntityCode int = 422 - -/* -CreateExcessWeightRecordUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createExcessWeightRecordUnprocessableEntity -*/ -type CreateExcessWeightRecordUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordUnprocessableEntity creates CreateExcessWeightRecordUnprocessableEntity with default headers values -func NewCreateExcessWeightRecordUnprocessableEntity() *CreateExcessWeightRecordUnprocessableEntity { - - return &CreateExcessWeightRecordUnprocessableEntity{} -} - -// WithPayload adds the payload to the create excess weight record unprocessable entity response -func (o *CreateExcessWeightRecordUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateExcessWeightRecordUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record unprocessable entity response -func (o *CreateExcessWeightRecordUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateExcessWeightRecordInternalServerErrorCode is the HTTP code returned for type CreateExcessWeightRecordInternalServerError -const CreateExcessWeightRecordInternalServerErrorCode int = 500 - -/* -CreateExcessWeightRecordInternalServerError A server error occurred. - -swagger:response createExcessWeightRecordInternalServerError -*/ -type CreateExcessWeightRecordInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateExcessWeightRecordInternalServerError creates CreateExcessWeightRecordInternalServerError with default headers values -func NewCreateExcessWeightRecordInternalServerError() *CreateExcessWeightRecordInternalServerError { - - return &CreateExcessWeightRecordInternalServerError{} -} - -// WithPayload adds the payload to the create excess weight record internal server error response -func (o *CreateExcessWeightRecordInternalServerError) WithPayload(payload *primemessages.Error) *CreateExcessWeightRecordInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create excess weight record internal server error response -func (o *CreateExcessWeightRecordInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateExcessWeightRecordInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go deleted file mode 100644 index 3c2094a09b1..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateExcessWeightRecordURL generates an URL for the create excess weight record operation -type CreateExcessWeightRecordURL struct { - MoveTaskOrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateExcessWeightRecordURL) WithBasePath(bp string) *CreateExcessWeightRecordURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateExcessWeightRecordURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateExcessWeightRecordURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/excess-weight-record" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on CreateExcessWeightRecordURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateExcessWeightRecordURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateExcessWeightRecordURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateExcessWeightRecordURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateExcessWeightRecordURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateExcessWeightRecordURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateExcessWeightRecordURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go deleted file mode 100644 index ce28eeae6e8..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DownloadMoveOrderHandlerFunc turns a function with the right signature into a download move order handler -type DownloadMoveOrderHandlerFunc func(DownloadMoveOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DownloadMoveOrderHandlerFunc) Handle(params DownloadMoveOrderParams) middleware.Responder { - return fn(params) -} - -// DownloadMoveOrderHandler interface for that can handle valid download move order params -type DownloadMoveOrderHandler interface { - Handle(DownloadMoveOrderParams) middleware.Responder -} - -// NewDownloadMoveOrder creates a new http.Handler for the download move order operation -func NewDownloadMoveOrder(ctx *middleware.Context, handler DownloadMoveOrderHandler) *DownloadMoveOrder { - return &DownloadMoveOrder{Context: ctx, Handler: handler} -} - -/* - DownloadMoveOrder swagger:route GET /moves/{locator}/documents moveTaskOrder downloadMoveOrder - -# Downloads move order as a PDF - -### Functionality -This endpoint downloads all uploaded move order documentations into one download file by locator. - -### Errors -* The move must be in need counseling state. -* The move client's origin duty location must not currently have gov counseling. -*/ -type DownloadMoveOrder struct { - Context *middleware.Context - Handler DownloadMoveOrderHandler -} - -func (o *DownloadMoveOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDownloadMoveOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go deleted file mode 100644 index a28a34d1121..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go +++ /dev/null @@ -1,125 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDownloadMoveOrderParams creates a new DownloadMoveOrderParams object -// with the default values initialized. -func NewDownloadMoveOrderParams() DownloadMoveOrderParams { - - var ( - // initialize parameters with default values - - typeVarDefault = string("ALL") - ) - - return DownloadMoveOrderParams{ - Type: &typeVarDefault, - } -} - -// DownloadMoveOrderParams contains all the bound params for the download move order operation -// typically these are obtained from a http.Request -// -// swagger:parameters downloadMoveOrder -type DownloadMoveOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*the locator code for move order to be downloaded - Required: true - In: path - */ - Locator string - /*upload type - In: query - Default: "ALL" - */ - Type *string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDownloadMoveOrderParams() beforehand. -func (o *DownloadMoveOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - rLocator, rhkLocator, _ := route.Params.GetOK("locator") - if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { - res = append(res, err) - } - - qType, qhkType, _ := qs.GetOK("type") - if err := o.bindType(qType, qhkType, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindLocator binds and validates parameter Locator from path. -func (o *DownloadMoveOrderParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.Locator = raw - - return nil -} - -// bindType binds and validates parameter Type from query. -func (o *DownloadMoveOrderParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - // Default values have been previously initialized by NewDownloadMoveOrderParams() - return nil - } - o.Type = &raw - - if err := o.validateType(formats); err != nil { - return err - } - - return nil -} - -// validateType carries on validations for parameter Type -func (o *DownloadMoveOrderParams) validateType(formats strfmt.Registry) error { - - if err := validate.EnumCase("type", "query", *o.Type, []interface{}{"ALL", "ORDERS", "AMENDMENTS"}, true); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go deleted file mode 100644 index 626e6479342..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go +++ /dev/null @@ -1,305 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// DownloadMoveOrderOKCode is the HTTP code returned for type DownloadMoveOrderOK -const DownloadMoveOrderOKCode int = 200 - -/* -DownloadMoveOrderOK Move Order PDF - -swagger:response downloadMoveOrderOK -*/ -type DownloadMoveOrderOK struct { - /*File name to download - - */ - ContentDisposition string `json:"Content-Disposition"` - - /* - In: Body - */ - Payload io.ReadCloser `json:"body,omitempty"` -} - -// NewDownloadMoveOrderOK creates DownloadMoveOrderOK with default headers values -func NewDownloadMoveOrderOK() *DownloadMoveOrderOK { - - return &DownloadMoveOrderOK{} -} - -// WithContentDisposition adds the contentDisposition to the download move order o k response -func (o *DownloadMoveOrderOK) WithContentDisposition(contentDisposition string) *DownloadMoveOrderOK { - o.ContentDisposition = contentDisposition - return o -} - -// SetContentDisposition sets the contentDisposition to the download move order o k response -func (o *DownloadMoveOrderOK) SetContentDisposition(contentDisposition string) { - o.ContentDisposition = contentDisposition -} - -// WithPayload adds the payload to the download move order o k response -func (o *DownloadMoveOrderOK) WithPayload(payload io.ReadCloser) *DownloadMoveOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order o k response -func (o *DownloadMoveOrderOK) SetPayload(payload io.ReadCloser) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - // response header Content-Disposition - - contentDisposition := o.ContentDisposition - if contentDisposition != "" { - rw.Header().Set("Content-Disposition", contentDisposition) - } - - rw.WriteHeader(200) - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// DownloadMoveOrderBadRequestCode is the HTTP code returned for type DownloadMoveOrderBadRequest -const DownloadMoveOrderBadRequestCode int = 400 - -/* -DownloadMoveOrderBadRequest The request payload is invalid. - -swagger:response downloadMoveOrderBadRequest -*/ -type DownloadMoveOrderBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDownloadMoveOrderBadRequest creates DownloadMoveOrderBadRequest with default headers values -func NewDownloadMoveOrderBadRequest() *DownloadMoveOrderBadRequest { - - return &DownloadMoveOrderBadRequest{} -} - -// WithPayload adds the payload to the download move order bad request response -func (o *DownloadMoveOrderBadRequest) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order bad request response -func (o *DownloadMoveOrderBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadMoveOrderForbiddenCode is the HTTP code returned for type DownloadMoveOrderForbidden -const DownloadMoveOrderForbiddenCode int = 403 - -/* -DownloadMoveOrderForbidden The request was denied. - -swagger:response downloadMoveOrderForbidden -*/ -type DownloadMoveOrderForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDownloadMoveOrderForbidden creates DownloadMoveOrderForbidden with default headers values -func NewDownloadMoveOrderForbidden() *DownloadMoveOrderForbidden { - - return &DownloadMoveOrderForbidden{} -} - -// WithPayload adds the payload to the download move order forbidden response -func (o *DownloadMoveOrderForbidden) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order forbidden response -func (o *DownloadMoveOrderForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadMoveOrderNotFoundCode is the HTTP code returned for type DownloadMoveOrderNotFound -const DownloadMoveOrderNotFoundCode int = 404 - -/* -DownloadMoveOrderNotFound The requested resource wasn't found. - -swagger:response downloadMoveOrderNotFound -*/ -type DownloadMoveOrderNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDownloadMoveOrderNotFound creates DownloadMoveOrderNotFound with default headers values -func NewDownloadMoveOrderNotFound() *DownloadMoveOrderNotFound { - - return &DownloadMoveOrderNotFound{} -} - -// WithPayload adds the payload to the download move order not found response -func (o *DownloadMoveOrderNotFound) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order not found response -func (o *DownloadMoveOrderNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadMoveOrderUnprocessableEntityCode is the HTTP code returned for type DownloadMoveOrderUnprocessableEntity -const DownloadMoveOrderUnprocessableEntityCode int = 422 - -/* -DownloadMoveOrderUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response downloadMoveOrderUnprocessableEntity -*/ -type DownloadMoveOrderUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewDownloadMoveOrderUnprocessableEntity creates DownloadMoveOrderUnprocessableEntity with default headers values -func NewDownloadMoveOrderUnprocessableEntity() *DownloadMoveOrderUnprocessableEntity { - - return &DownloadMoveOrderUnprocessableEntity{} -} - -// WithPayload adds the payload to the download move order unprocessable entity response -func (o *DownloadMoveOrderUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *DownloadMoveOrderUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order unprocessable entity response -func (o *DownloadMoveOrderUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DownloadMoveOrderInternalServerErrorCode is the HTTP code returned for type DownloadMoveOrderInternalServerError -const DownloadMoveOrderInternalServerErrorCode int = 500 - -/* -DownloadMoveOrderInternalServerError A server error occurred. - -swagger:response downloadMoveOrderInternalServerError -*/ -type DownloadMoveOrderInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewDownloadMoveOrderInternalServerError creates DownloadMoveOrderInternalServerError with default headers values -func NewDownloadMoveOrderInternalServerError() *DownloadMoveOrderInternalServerError { - - return &DownloadMoveOrderInternalServerError{} -} - -// WithPayload adds the payload to the download move order internal server error response -func (o *DownloadMoveOrderInternalServerError) WithPayload(payload *primemessages.Error) *DownloadMoveOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the download move order internal server error response -func (o *DownloadMoveOrderInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DownloadMoveOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go deleted file mode 100644 index 96e86c4936e..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// DownloadMoveOrderURL generates an URL for the download move order operation -type DownloadMoveOrderURL struct { - Locator string - - Type *string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DownloadMoveOrderURL) WithBasePath(bp string) *DownloadMoveOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DownloadMoveOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DownloadMoveOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves/{locator}/documents" - - locator := o.Locator - if locator != "" { - _path = strings.Replace(_path, "{locator}", locator, -1) - } else { - return nil, errors.New("locator is required on DownloadMoveOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var typeVarQ string - if o.Type != nil { - typeVarQ = *o.Type - } - if typeVarQ != "" { - qs.Set("type", typeVarQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DownloadMoveOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DownloadMoveOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DownloadMoveOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DownloadMoveOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DownloadMoveOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DownloadMoveOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go deleted file mode 100644 index d02fb4d0c9d..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler -type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// GetMoveTaskOrderHandler interface for that can handle valid get move task order params -type GetMoveTaskOrderHandler interface { - Handle(GetMoveTaskOrderParams) middleware.Responder -} - -// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation -func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { - return &GetMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder - -getMoveTaskOrder - -### Functionality -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -type GetMoveTaskOrder struct { - Context *middleware.Context - Handler GetMoveTaskOrderHandler -} - -func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index fc2c39ef759..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { - - return GetMoveTaskOrderParams{} -} - -// GetMoveTaskOrderParams contains all the bound params for the get move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveTaskOrder -type GetMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID or MoveCode of move task order to use. - Required: true - In: path - */ - MoveID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. -func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveID = raw - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 571bde81ff9..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK -const GetMoveTaskOrderOKCode int = 200 - -/* -GetMoveTaskOrderOK Successfully retrieve an individual move task order. - -swagger:response getMoveTaskOrderOK -*/ -type GetMoveTaskOrderOK struct { - - /* - In: Body - */ - Payload *primemessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - - return &GetMoveTaskOrderOK{} -} - -// WithPayload adds the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) WithPayload(payload *primemessages.MoveTaskOrder) *GetMoveTaskOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) SetPayload(payload *primemessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized -const GetMoveTaskOrderUnauthorizedCode int = 401 - -/* -GetMoveTaskOrderUnauthorized The request was denied. - -swagger:response getMoveTaskOrderUnauthorized -*/ -type GetMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - - return &GetMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden -const GetMoveTaskOrderForbiddenCode int = 403 - -/* -GetMoveTaskOrderForbidden The request was denied. - -swagger:response getMoveTaskOrderForbidden -*/ -type GetMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - - return &GetMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound -const GetMoveTaskOrderNotFoundCode int = 404 - -/* -GetMoveTaskOrderNotFound The requested resource wasn't found. - -swagger:response getMoveTaskOrderNotFound -*/ -type GetMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - - return &GetMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError -const GetMoveTaskOrderInternalServerErrorCode int = 500 - -/* -GetMoveTaskOrderInternalServerError A server error occurred. - -swagger:response getMoveTaskOrderInternalServerError -*/ -type GetMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - - return &GetMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primemessages.Error) *GetMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go deleted file mode 100644 index 6455770de3b..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveTaskOrderURL generates an URL for the get move task order operation -type GetMoveTaskOrderURL struct { - MoveID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveID}" - - moveID := o.MoveID - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveTaskOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go deleted file mode 100644 index 8b4e83794b5..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMovesHandlerFunc turns a function with the right signature into a list moves handler -type ListMovesHandlerFunc func(ListMovesParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMovesHandlerFunc) Handle(params ListMovesParams) middleware.Responder { - return fn(params) -} - -// ListMovesHandler interface for that can handle valid list moves params -type ListMovesHandler interface { - Handle(ListMovesParams) middleware.Responder -} - -// NewListMoves creates a new http.Handler for the list moves operation -func NewListMoves(ctx *middleware.Context, handler ListMovesHandler) *ListMoves { - return &ListMoves{Context: ctx, Handler: handler} -} - -/* - ListMoves swagger:route GET /moves moveTaskOrder listMoves - -listMoves - -Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this -list down to only the moves that have been updated since the provided timestamp. A move will be considered -updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment -requests, is later than the provided date and time. - -**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has -been set, that move will always appear in this list. -*/ -type ListMoves struct { - Context *middleware.Context - Handler ListMovesHandler -} - -func (o *ListMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMovesParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go deleted file mode 100644 index e7e72187174..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go +++ /dev/null @@ -1,97 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewListMovesParams creates a new ListMovesParams object -// -// There are no default values defined in the spec. -func NewListMovesParams() ListMovesParams { - - return ListMovesParams{} -} - -// ListMovesParams contains all the bound params for the list moves operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMoves -type ListMovesParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" - In: query - */ - Since *strfmt.DateTime -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMovesParams() beforehand. -func (o *ListMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSince, qhkSince, _ := qs.GetOK("since") - if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSince binds and validates parameter Since from query. -func (o *ListMovesParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - // Format: date-time - value, err := formats.Parse("date-time", raw) - if err != nil { - return errors.InvalidType("since", "query", "strfmt.DateTime", raw) - } - o.Since = (value.(*strfmt.DateTime)) - - if err := o.validateSince(formats); err != nil { - return err - } - - return nil -} - -// validateSince carries on validations for parameter Since -func (o *ListMovesParams) validateSince(formats strfmt.Registry) error { - - if err := validate.FormatOf("since", "query", "date-time", o.Since.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go deleted file mode 100644 index d68ab7f3cb4..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// ListMovesOKCode is the HTTP code returned for type ListMovesOK -const ListMovesOKCode int = 200 - -/* -ListMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. - -swagger:response listMovesOK -*/ -type ListMovesOK struct { - - /* - In: Body - */ - Payload primemessages.ListMoves `json:"body,omitempty"` -} - -// NewListMovesOK creates ListMovesOK with default headers values -func NewListMovesOK() *ListMovesOK { - - return &ListMovesOK{} -} - -// WithPayload adds the payload to the list moves o k response -func (o *ListMovesOK) WithPayload(payload primemessages.ListMoves) *ListMovesOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list moves o k response -func (o *ListMovesOK) SetPayload(payload primemessages.ListMoves) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = primemessages.ListMoves{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMovesUnauthorizedCode is the HTTP code returned for type ListMovesUnauthorized -const ListMovesUnauthorizedCode int = 401 - -/* -ListMovesUnauthorized The request was denied. - -swagger:response listMovesUnauthorized -*/ -type ListMovesUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewListMovesUnauthorized creates ListMovesUnauthorized with default headers values -func NewListMovesUnauthorized() *ListMovesUnauthorized { - - return &ListMovesUnauthorized{} -} - -// WithPayload adds the payload to the list moves unauthorized response -func (o *ListMovesUnauthorized) WithPayload(payload *primemessages.ClientError) *ListMovesUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list moves unauthorized response -func (o *ListMovesUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMovesForbiddenCode is the HTTP code returned for type ListMovesForbidden -const ListMovesForbiddenCode int = 403 - -/* -ListMovesForbidden The request was denied. - -swagger:response listMovesForbidden -*/ -type ListMovesForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewListMovesForbidden creates ListMovesForbidden with default headers values -func NewListMovesForbidden() *ListMovesForbidden { - - return &ListMovesForbidden{} -} - -// WithPayload adds the payload to the list moves forbidden response -func (o *ListMovesForbidden) WithPayload(payload *primemessages.ClientError) *ListMovesForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list moves forbidden response -func (o *ListMovesForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMovesInternalServerErrorCode is the HTTP code returned for type ListMovesInternalServerError -const ListMovesInternalServerErrorCode int = 500 - -/* -ListMovesInternalServerError A server error occurred. - -swagger:response listMovesInternalServerError -*/ -type ListMovesInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewListMovesInternalServerError creates ListMovesInternalServerError with default headers values -func NewListMovesInternalServerError() *ListMovesInternalServerError { - - return &ListMovesInternalServerError{} -} - -// WithPayload adds the payload to the list moves internal server error response -func (o *ListMovesInternalServerError) WithPayload(payload *primemessages.Error) *ListMovesInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list moves internal server error response -func (o *ListMovesInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go deleted file mode 100644 index ac31049929d..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/strfmt" -) - -// ListMovesURL generates an URL for the list moves operation -type ListMovesURL struct { - Since *strfmt.DateTime - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMovesURL) WithBasePath(bp string) *ListMovesURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMovesURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMovesURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/moves" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var sinceQ string - if o.Since != nil { - sinceQ = o.Since.String() - } - if sinceQ != "" { - qs.Set("since", sinceQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMovesURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMovesURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMovesURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMovesURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMovesURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMovesURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go deleted file mode 100644 index 626b4778d88..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOPostCounselingInformationHandlerFunc turns a function with the right signature into a update m t o post counseling information handler -type UpdateMTOPostCounselingInformationHandlerFunc func(UpdateMTOPostCounselingInformationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOPostCounselingInformationHandlerFunc) Handle(params UpdateMTOPostCounselingInformationParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOPostCounselingInformationHandler interface for that can handle valid update m t o post counseling information params -type UpdateMTOPostCounselingInformationHandler interface { - Handle(UpdateMTOPostCounselingInformationParams) middleware.Responder -} - -// NewUpdateMTOPostCounselingInformation creates a new http.Handler for the update m t o post counseling information operation -func NewUpdateMTOPostCounselingInformation(ctx *middleware.Context, handler UpdateMTOPostCounselingInformationHandler) *UpdateMTOPostCounselingInformation { - return &UpdateMTOPostCounselingInformation{Context: ctx, Handler: handler} -} - -/* - UpdateMTOPostCounselingInformation swagger:route PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info moveTaskOrder updateMTOPostCounselingInformation - -updateMTOPostCounselingInformation - -### Functionality -This endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling. -This update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update. -No body object is expected for this request. - -**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs. - -**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer. -*/ -type UpdateMTOPostCounselingInformation struct { - Context *middleware.Context - Handler UpdateMTOPostCounselingInformationHandler -} - -func (o *UpdateMTOPostCounselingInformation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOPostCounselingInformationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go deleted file mode 100644 index 60041283063..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateMTOPostCounselingInformationParams creates a new UpdateMTOPostCounselingInformationParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOPostCounselingInformationParams() UpdateMTOPostCounselingInformationParams { - - return UpdateMTOPostCounselingInformationParams{} -} - -// UpdateMTOPostCounselingInformationParams contains all the bound params for the update m t o post counseling information operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOPostCounselingInformation -type UpdateMTOPostCounselingInformationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*ID of move task order to use. - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOPostCounselingInformationParams() beforehand. -func (o *UpdateMTOPostCounselingInformationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOPostCounselingInformationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *UpdateMTOPostCounselingInformationParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go deleted file mode 100644 index 2e223de9e89..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOPostCounselingInformationOKCode is the HTTP code returned for type UpdateMTOPostCounselingInformationOK -const UpdateMTOPostCounselingInformationOKCode int = 200 - -/* -UpdateMTOPostCounselingInformationOK Successfully updated move task order with post counseling information. - -swagger:response updateMTOPostCounselingInformationOK -*/ -type UpdateMTOPostCounselingInformationOK struct { - - /* - In: Body - */ - Payload *primemessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationOK creates UpdateMTOPostCounselingInformationOK with default headers values -func NewUpdateMTOPostCounselingInformationOK() *UpdateMTOPostCounselingInformationOK { - - return &UpdateMTOPostCounselingInformationOK{} -} - -// WithPayload adds the payload to the update m t o post counseling information o k response -func (o *UpdateMTOPostCounselingInformationOK) WithPayload(payload *primemessages.MoveTaskOrder) *UpdateMTOPostCounselingInformationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information o k response -func (o *UpdateMTOPostCounselingInformationOK) SetPayload(payload *primemessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationUnauthorizedCode is the HTTP code returned for type UpdateMTOPostCounselingInformationUnauthorized -const UpdateMTOPostCounselingInformationUnauthorizedCode int = 401 - -/* -UpdateMTOPostCounselingInformationUnauthorized The request was denied. - -swagger:response updateMTOPostCounselingInformationUnauthorized -*/ -type UpdateMTOPostCounselingInformationUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationUnauthorized creates UpdateMTOPostCounselingInformationUnauthorized with default headers values -func NewUpdateMTOPostCounselingInformationUnauthorized() *UpdateMTOPostCounselingInformationUnauthorized { - - return &UpdateMTOPostCounselingInformationUnauthorized{} -} - -// WithPayload adds the payload to the update m t o post counseling information unauthorized response -func (o *UpdateMTOPostCounselingInformationUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information unauthorized response -func (o *UpdateMTOPostCounselingInformationUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationForbiddenCode is the HTTP code returned for type UpdateMTOPostCounselingInformationForbidden -const UpdateMTOPostCounselingInformationForbiddenCode int = 403 - -/* -UpdateMTOPostCounselingInformationForbidden The request was denied. - -swagger:response updateMTOPostCounselingInformationForbidden -*/ -type UpdateMTOPostCounselingInformationForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationForbidden creates UpdateMTOPostCounselingInformationForbidden with default headers values -func NewUpdateMTOPostCounselingInformationForbidden() *UpdateMTOPostCounselingInformationForbidden { - - return &UpdateMTOPostCounselingInformationForbidden{} -} - -// WithPayload adds the payload to the update m t o post counseling information forbidden response -func (o *UpdateMTOPostCounselingInformationForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information forbidden response -func (o *UpdateMTOPostCounselingInformationForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationNotFoundCode is the HTTP code returned for type UpdateMTOPostCounselingInformationNotFound -const UpdateMTOPostCounselingInformationNotFoundCode int = 404 - -/* -UpdateMTOPostCounselingInformationNotFound The requested resource wasn't found. - -swagger:response updateMTOPostCounselingInformationNotFound -*/ -type UpdateMTOPostCounselingInformationNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationNotFound creates UpdateMTOPostCounselingInformationNotFound with default headers values -func NewUpdateMTOPostCounselingInformationNotFound() *UpdateMTOPostCounselingInformationNotFound { - - return &UpdateMTOPostCounselingInformationNotFound{} -} - -// WithPayload adds the payload to the update m t o post counseling information not found response -func (o *UpdateMTOPostCounselingInformationNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information not found response -func (o *UpdateMTOPostCounselingInformationNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationConflictCode is the HTTP code returned for type UpdateMTOPostCounselingInformationConflict -const UpdateMTOPostCounselingInformationConflictCode int = 409 - -/* -UpdateMTOPostCounselingInformationConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateMTOPostCounselingInformationConflict -*/ -type UpdateMTOPostCounselingInformationConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationConflict creates UpdateMTOPostCounselingInformationConflict with default headers values -func NewUpdateMTOPostCounselingInformationConflict() *UpdateMTOPostCounselingInformationConflict { - - return &UpdateMTOPostCounselingInformationConflict{} -} - -// WithPayload adds the payload to the update m t o post counseling information conflict response -func (o *UpdateMTOPostCounselingInformationConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information conflict response -func (o *UpdateMTOPostCounselingInformationConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationPreconditionFailedCode is the HTTP code returned for type UpdateMTOPostCounselingInformationPreconditionFailed -const UpdateMTOPostCounselingInformationPreconditionFailedCode int = 412 - -/* -UpdateMTOPostCounselingInformationPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOPostCounselingInformationPreconditionFailed -*/ -type UpdateMTOPostCounselingInformationPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationPreconditionFailed creates UpdateMTOPostCounselingInformationPreconditionFailed with default headers values -func NewUpdateMTOPostCounselingInformationPreconditionFailed() *UpdateMTOPostCounselingInformationPreconditionFailed { - - return &UpdateMTOPostCounselingInformationPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o post counseling information precondition failed response -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information precondition failed response -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationUnprocessableEntityCode is the HTTP code returned for type UpdateMTOPostCounselingInformationUnprocessableEntity -const UpdateMTOPostCounselingInformationUnprocessableEntityCode int = 422 - -/* -UpdateMTOPostCounselingInformationUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOPostCounselingInformationUnprocessableEntity -*/ -type UpdateMTOPostCounselingInformationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationUnprocessableEntity creates UpdateMTOPostCounselingInformationUnprocessableEntity with default headers values -func NewUpdateMTOPostCounselingInformationUnprocessableEntity() *UpdateMTOPostCounselingInformationUnprocessableEntity { - - return &UpdateMTOPostCounselingInformationUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o post counseling information unprocessable entity response -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOPostCounselingInformationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information unprocessable entity response -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOPostCounselingInformationInternalServerErrorCode is the HTTP code returned for type UpdateMTOPostCounselingInformationInternalServerError -const UpdateMTOPostCounselingInformationInternalServerErrorCode int = 500 - -/* -UpdateMTOPostCounselingInformationInternalServerError A server error occurred. - -swagger:response updateMTOPostCounselingInformationInternalServerError -*/ -type UpdateMTOPostCounselingInformationInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOPostCounselingInformationInternalServerError creates UpdateMTOPostCounselingInformationInternalServerError with default headers values -func NewUpdateMTOPostCounselingInformationInternalServerError() *UpdateMTOPostCounselingInformationInternalServerError { - - return &UpdateMTOPostCounselingInformationInternalServerError{} -} - -// WithPayload adds the payload to the update m t o post counseling information internal server error response -func (o *UpdateMTOPostCounselingInformationInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOPostCounselingInformationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o post counseling information internal server error response -func (o *UpdateMTOPostCounselingInformationInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOPostCounselingInformationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go deleted file mode 100644 index 8afed9e8f90..00000000000 --- a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOPostCounselingInformationURL generates an URL for the update m t o post counseling information operation -type UpdateMTOPostCounselingInformationURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOPostCounselingInformationURL) WithBasePath(bp string) *UpdateMTOPostCounselingInformationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOPostCounselingInformationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOPostCounselingInformationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/post-counseling-info" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on UpdateMTOPostCounselingInformationURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOPostCounselingInformationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOPostCounselingInformationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOPostCounselingInformationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOPostCounselingInformationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOPostCounselingInformationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOPostCounselingInformationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go deleted file mode 100644 index 85456161f0c..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOServiceItemHandlerFunc turns a function with the right signature into a create m t o service item handler -type CreateMTOServiceItemHandlerFunc func(CreateMTOServiceItemParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOServiceItemHandlerFunc) Handle(params CreateMTOServiceItemParams) middleware.Responder { - return fn(params) -} - -// CreateMTOServiceItemHandler interface for that can handle valid create m t o service item params -type CreateMTOServiceItemHandler interface { - Handle(CreateMTOServiceItemParams) middleware.Responder -} - -// NewCreateMTOServiceItem creates a new http.Handler for the create m t o service item operation -func NewCreateMTOServiceItem(ctx *middleware.Context, handler CreateMTOServiceItemHandler) *CreateMTOServiceItem { - return &CreateMTOServiceItem{Context: ctx, Handler: handler} -} - -/* - CreateMTOServiceItem swagger:route POST /mto-service-items mtoServiceItem createMTOServiceItem - -createMTOServiceItem - -Creates one or more MTOServiceItems. Not all service items may be created, please see details below. - -This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding - - to the service item you wish to create and the documentation will update with the new definition. - -Upon creation these items are associated with a Move Task Order and an MTO Shipment. -The request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require -additional service items to be autogenerated when added - all created service items, autogenerated included, -will be returned in the response. - -To update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint. - ---- - -**`MTOServiceItemOriginSIT`** - -MTOServiceItemOriginSIT is a subtype of MTOServiceItem. - -This model type describes a domestic origin SIT service item. Items can be created using this -model type with the following codes: - -**DOFSIT** - -**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items: - - DOFSIT - Domestic origin 1st day SIT - - DOASIT - Domestic origin Additional day SIT - - DOPSIT - Domestic origin SIT pickup - - DOSFSC - Domestic origin SIT fuel surcharge - -**DOASIT** - -**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item. -Additional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**. - ---- - -**`MTOServiceItemDestSIT`** - -MTOServiceItemDestSIT is a subtype of MTOServiceItem. - -This model type describes a domestic destination SIT service item. Items can be created using this -model type with the following codes: - -**DDFSIT** - -**1st day destination SIT service item**. - -These additional fields are optional for creating a DDFSIT: - - `firstAvailableDeliveryDate1` - - string - - First available date that Prime can deliver SIT service item. - - firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together - - `dateOfContact1` - - string - - Date of attempted contact by the prime corresponding to `timeMilitary1` - - dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together - - `timeMilitary1` - - string\d{4}Z - - Time of attempted contact corresponding to `dateOfContact1`, in military format. - - timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together - - `firstAvailableDeliveryDate2` - - string - - Second available date that Prime can deliver SIT service item. - - firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together - - `dateOfContact2` - - string - - Date of attempted contact delivery by the prime corresponding to `timeMilitary2` - - dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together - - `timeMilitary2` - - string\d{4}Z - - Time of attempted contact corresponding to `dateOfContact2`, in military format. - - timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together - -When a DDFSIT is requested, the API will auto-create the following group of service items: - - DDFSIT - Domestic destination 1st day SIT - - DDASIT - Domestic destination Additional day SIT - - DDDSIT - Domestic destination SIT delivery - - DDSFSC - Domestic destination SIT fuel surcharge - -**NOTE** When providing the `sitEntryDate` value in the payload, please ensure that the date is not BEFORE -`firstAvailableDeliveryDate1` or `firstAvailableDeliveryDate2`. If it is, you will receive an error response. - -**DDASIT** - -**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item. -Additional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**. -*/ -type CreateMTOServiceItem struct { - Context *middleware.Context - Handler CreateMTOServiceItemHandler -} - -func (o *CreateMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOServiceItemParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go deleted file mode 100644 index 594e1108b21..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateMTOServiceItemParams creates a new CreateMTOServiceItemParams object -// -// There are no default values defined in the spec. -func NewCreateMTOServiceItemParams() CreateMTOServiceItemParams { - - return CreateMTOServiceItemParams{} -} - -// CreateMTOServiceItemParams contains all the bound params for the create m t o service item operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOServiceItem -type CreateMTOServiceItemParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body primemessages.MTOServiceItem -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOServiceItemParams() beforehand. -func (o *CreateMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := primemessages.UnmarshalMTOServiceItem(r.Body, route.Consumer) - if err != nil { - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go deleted file mode 100644 index 89109acacbc..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go +++ /dev/null @@ -1,377 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateMTOServiceItemOKCode is the HTTP code returned for type CreateMTOServiceItemOK -const CreateMTOServiceItemOKCode int = 200 - -/* -CreateMTOServiceItemOK Successfully created an MTO service item. - -swagger:response createMTOServiceItemOK -*/ -type CreateMTOServiceItemOK struct { - - /* - In: Body - */ - Payload []primemessages.MTOServiceItem `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemOK creates CreateMTOServiceItemOK with default headers values -func NewCreateMTOServiceItemOK() *CreateMTOServiceItemOK { - - return &CreateMTOServiceItemOK{} -} - -// WithPayload adds the payload to the create m t o service item o k response -func (o *CreateMTOServiceItemOK) WithPayload(payload []primemessages.MTOServiceItem) *CreateMTOServiceItemOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item o k response -func (o *CreateMTOServiceItemOK) SetPayload(payload []primemessages.MTOServiceItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = make([]primemessages.MTOServiceItem, 0, 50) - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// CreateMTOServiceItemBadRequestCode is the HTTP code returned for type CreateMTOServiceItemBadRequest -const CreateMTOServiceItemBadRequestCode int = 400 - -/* -CreateMTOServiceItemBadRequest The request payload is invalid. - -swagger:response createMTOServiceItemBadRequest -*/ -type CreateMTOServiceItemBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemBadRequest creates CreateMTOServiceItemBadRequest with default headers values -func NewCreateMTOServiceItemBadRequest() *CreateMTOServiceItemBadRequest { - - return &CreateMTOServiceItemBadRequest{} -} - -// WithPayload adds the payload to the create m t o service item bad request response -func (o *CreateMTOServiceItemBadRequest) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item bad request response -func (o *CreateMTOServiceItemBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemUnauthorizedCode is the HTTP code returned for type CreateMTOServiceItemUnauthorized -const CreateMTOServiceItemUnauthorizedCode int = 401 - -/* -CreateMTOServiceItemUnauthorized The request was denied. - -swagger:response createMTOServiceItemUnauthorized -*/ -type CreateMTOServiceItemUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemUnauthorized creates CreateMTOServiceItemUnauthorized with default headers values -func NewCreateMTOServiceItemUnauthorized() *CreateMTOServiceItemUnauthorized { - - return &CreateMTOServiceItemUnauthorized{} -} - -// WithPayload adds the payload to the create m t o service item unauthorized response -func (o *CreateMTOServiceItemUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item unauthorized response -func (o *CreateMTOServiceItemUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemForbiddenCode is the HTTP code returned for type CreateMTOServiceItemForbidden -const CreateMTOServiceItemForbiddenCode int = 403 - -/* -CreateMTOServiceItemForbidden The request was denied. - -swagger:response createMTOServiceItemForbidden -*/ -type CreateMTOServiceItemForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemForbidden creates CreateMTOServiceItemForbidden with default headers values -func NewCreateMTOServiceItemForbidden() *CreateMTOServiceItemForbidden { - - return &CreateMTOServiceItemForbidden{} -} - -// WithPayload adds the payload to the create m t o service item forbidden response -func (o *CreateMTOServiceItemForbidden) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item forbidden response -func (o *CreateMTOServiceItemForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemNotFoundCode is the HTTP code returned for type CreateMTOServiceItemNotFound -const CreateMTOServiceItemNotFoundCode int = 404 - -/* -CreateMTOServiceItemNotFound The requested resource wasn't found. - -swagger:response createMTOServiceItemNotFound -*/ -type CreateMTOServiceItemNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemNotFound creates CreateMTOServiceItemNotFound with default headers values -func NewCreateMTOServiceItemNotFound() *CreateMTOServiceItemNotFound { - - return &CreateMTOServiceItemNotFound{} -} - -// WithPayload adds the payload to the create m t o service item not found response -func (o *CreateMTOServiceItemNotFound) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item not found response -func (o *CreateMTOServiceItemNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemConflictCode is the HTTP code returned for type CreateMTOServiceItemConflict -const CreateMTOServiceItemConflictCode int = 409 - -/* -CreateMTOServiceItemConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response createMTOServiceItemConflict -*/ -type CreateMTOServiceItemConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemConflict creates CreateMTOServiceItemConflict with default headers values -func NewCreateMTOServiceItemConflict() *CreateMTOServiceItemConflict { - - return &CreateMTOServiceItemConflict{} -} - -// WithPayload adds the payload to the create m t o service item conflict response -func (o *CreateMTOServiceItemConflict) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item conflict response -func (o *CreateMTOServiceItemConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemUnprocessableEntityCode is the HTTP code returned for type CreateMTOServiceItemUnprocessableEntity -const CreateMTOServiceItemUnprocessableEntityCode int = 422 - -/* -CreateMTOServiceItemUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createMTOServiceItemUnprocessableEntity -*/ -type CreateMTOServiceItemUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemUnprocessableEntity creates CreateMTOServiceItemUnprocessableEntity with default headers values -func NewCreateMTOServiceItemUnprocessableEntity() *CreateMTOServiceItemUnprocessableEntity { - - return &CreateMTOServiceItemUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o service item unprocessable entity response -func (o *CreateMTOServiceItemUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateMTOServiceItemUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item unprocessable entity response -func (o *CreateMTOServiceItemUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOServiceItemInternalServerErrorCode is the HTTP code returned for type CreateMTOServiceItemInternalServerError -const CreateMTOServiceItemInternalServerErrorCode int = 500 - -/* -CreateMTOServiceItemInternalServerError A server error occurred. - -swagger:response createMTOServiceItemInternalServerError -*/ -type CreateMTOServiceItemInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOServiceItemInternalServerError creates CreateMTOServiceItemInternalServerError with default headers values -func NewCreateMTOServiceItemInternalServerError() *CreateMTOServiceItemInternalServerError { - - return &CreateMTOServiceItemInternalServerError{} -} - -// WithPayload adds the payload to the create m t o service item internal server error response -func (o *CreateMTOServiceItemInternalServerError) WithPayload(payload *primemessages.Error) *CreateMTOServiceItemInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o service item internal server error response -func (o *CreateMTOServiceItemInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go deleted file mode 100644 index 3646b39de80..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOServiceItemURL generates an URL for the create m t o service item operation -type CreateMTOServiceItemURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOServiceItemURL) WithBasePath(bp string) *CreateMTOServiceItemURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOServiceItemURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOServiceItemURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-service-items" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOServiceItemURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOServiceItemURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOServiceItemURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOServiceItemURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go deleted file mode 100644 index c31e66f050d..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateServiceRequestDocumentUploadHandlerFunc turns a function with the right signature into a create service request document upload handler -type CreateServiceRequestDocumentUploadHandlerFunc func(CreateServiceRequestDocumentUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateServiceRequestDocumentUploadHandlerFunc) Handle(params CreateServiceRequestDocumentUploadParams) middleware.Responder { - return fn(params) -} - -// CreateServiceRequestDocumentUploadHandler interface for that can handle valid create service request document upload params -type CreateServiceRequestDocumentUploadHandler interface { - Handle(CreateServiceRequestDocumentUploadParams) middleware.Responder -} - -// NewCreateServiceRequestDocumentUpload creates a new http.Handler for the create service request document upload operation -func NewCreateServiceRequestDocumentUpload(ctx *middleware.Context, handler CreateServiceRequestDocumentUploadHandler) *CreateServiceRequestDocumentUpload { - return &CreateServiceRequestDocumentUpload{Context: ctx, Handler: handler} -} - -/* - CreateServiceRequestDocumentUpload swagger:route POST /mto-service-items/{mtoServiceItemID}/uploads mtoServiceItem createServiceRequestDocumentUpload - -createServiceRequestDocumentUpload - -### Functionality - -This endpoint **uploads** a Service Request document for a -ServiceItem. - -The ServiceItem should already exist. - -ServiceItems are created with the -[createMTOServiceItem](#operation/createMTOServiceItem) -endpoint. -*/ -type CreateServiceRequestDocumentUpload struct { - Context *middleware.Context - Handler CreateServiceRequestDocumentUploadHandler -} - -func (o *CreateServiceRequestDocumentUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateServiceRequestDocumentUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go deleted file mode 100644 index 8dad929e210..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// CreateServiceRequestDocumentUploadMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreateServiceRequestDocumentUploadMaxParseMemory int64 = 32 << 20 - -// NewCreateServiceRequestDocumentUploadParams creates a new CreateServiceRequestDocumentUploadParams object -// -// There are no default values defined in the spec. -func NewCreateServiceRequestDocumentUploadParams() CreateServiceRequestDocumentUploadParams { - - return CreateServiceRequestDocumentUploadParams{} -} - -// CreateServiceRequestDocumentUploadParams contains all the bound params for the create service request document upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters createServiceRequestDocumentUpload -type CreateServiceRequestDocumentUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*UUID of the service item to use. - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateServiceRequestDocumentUploadParams() beforehand. -func (o *CreateServiceRequestDocumentUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(CreateServiceRequestDocumentUploadMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreateServiceRequestDocumentUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *CreateServiceRequestDocumentUploadParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go deleted file mode 100644 index 4ea1740617a..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateServiceRequestDocumentUploadCreatedCode is the HTTP code returned for type CreateServiceRequestDocumentUploadCreated -const CreateServiceRequestDocumentUploadCreatedCode int = 201 - -/* -CreateServiceRequestDocumentUploadCreated Successfully created upload of digital file. - -swagger:response createServiceRequestDocumentUploadCreated -*/ -type CreateServiceRequestDocumentUploadCreated struct { - - /* - In: Body - */ - Payload *primemessages.UploadWithOmissions `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadCreated creates CreateServiceRequestDocumentUploadCreated with default headers values -func NewCreateServiceRequestDocumentUploadCreated() *CreateServiceRequestDocumentUploadCreated { - - return &CreateServiceRequestDocumentUploadCreated{} -} - -// WithPayload adds the payload to the create service request document upload created response -func (o *CreateServiceRequestDocumentUploadCreated) WithPayload(payload *primemessages.UploadWithOmissions) *CreateServiceRequestDocumentUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload created response -func (o *CreateServiceRequestDocumentUploadCreated) SetPayload(payload *primemessages.UploadWithOmissions) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadBadRequestCode is the HTTP code returned for type CreateServiceRequestDocumentUploadBadRequest -const CreateServiceRequestDocumentUploadBadRequestCode int = 400 - -/* -CreateServiceRequestDocumentUploadBadRequest The request payload is invalid. - -swagger:response createServiceRequestDocumentUploadBadRequest -*/ -type CreateServiceRequestDocumentUploadBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadBadRequest creates CreateServiceRequestDocumentUploadBadRequest with default headers values -func NewCreateServiceRequestDocumentUploadBadRequest() *CreateServiceRequestDocumentUploadBadRequest { - - return &CreateServiceRequestDocumentUploadBadRequest{} -} - -// WithPayload adds the payload to the create service request document upload bad request response -func (o *CreateServiceRequestDocumentUploadBadRequest) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload bad request response -func (o *CreateServiceRequestDocumentUploadBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadUnauthorizedCode is the HTTP code returned for type CreateServiceRequestDocumentUploadUnauthorized -const CreateServiceRequestDocumentUploadUnauthorizedCode int = 401 - -/* -CreateServiceRequestDocumentUploadUnauthorized The request was denied. - -swagger:response createServiceRequestDocumentUploadUnauthorized -*/ -type CreateServiceRequestDocumentUploadUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadUnauthorized creates CreateServiceRequestDocumentUploadUnauthorized with default headers values -func NewCreateServiceRequestDocumentUploadUnauthorized() *CreateServiceRequestDocumentUploadUnauthorized { - - return &CreateServiceRequestDocumentUploadUnauthorized{} -} - -// WithPayload adds the payload to the create service request document upload unauthorized response -func (o *CreateServiceRequestDocumentUploadUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload unauthorized response -func (o *CreateServiceRequestDocumentUploadUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadForbiddenCode is the HTTP code returned for type CreateServiceRequestDocumentUploadForbidden -const CreateServiceRequestDocumentUploadForbiddenCode int = 403 - -/* -CreateServiceRequestDocumentUploadForbidden The request was denied. - -swagger:response createServiceRequestDocumentUploadForbidden -*/ -type CreateServiceRequestDocumentUploadForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadForbidden creates CreateServiceRequestDocumentUploadForbidden with default headers values -func NewCreateServiceRequestDocumentUploadForbidden() *CreateServiceRequestDocumentUploadForbidden { - - return &CreateServiceRequestDocumentUploadForbidden{} -} - -// WithPayload adds the payload to the create service request document upload forbidden response -func (o *CreateServiceRequestDocumentUploadForbidden) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload forbidden response -func (o *CreateServiceRequestDocumentUploadForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadNotFoundCode is the HTTP code returned for type CreateServiceRequestDocumentUploadNotFound -const CreateServiceRequestDocumentUploadNotFoundCode int = 404 - -/* -CreateServiceRequestDocumentUploadNotFound The requested resource wasn't found. - -swagger:response createServiceRequestDocumentUploadNotFound -*/ -type CreateServiceRequestDocumentUploadNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadNotFound creates CreateServiceRequestDocumentUploadNotFound with default headers values -func NewCreateServiceRequestDocumentUploadNotFound() *CreateServiceRequestDocumentUploadNotFound { - - return &CreateServiceRequestDocumentUploadNotFound{} -} - -// WithPayload adds the payload to the create service request document upload not found response -func (o *CreateServiceRequestDocumentUploadNotFound) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload not found response -func (o *CreateServiceRequestDocumentUploadNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadUnprocessableEntityCode is the HTTP code returned for type CreateServiceRequestDocumentUploadUnprocessableEntity -const CreateServiceRequestDocumentUploadUnprocessableEntityCode int = 422 - -/* -CreateServiceRequestDocumentUploadUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createServiceRequestDocumentUploadUnprocessableEntity -*/ -type CreateServiceRequestDocumentUploadUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadUnprocessableEntity creates CreateServiceRequestDocumentUploadUnprocessableEntity with default headers values -func NewCreateServiceRequestDocumentUploadUnprocessableEntity() *CreateServiceRequestDocumentUploadUnprocessableEntity { - - return &CreateServiceRequestDocumentUploadUnprocessableEntity{} -} - -// WithPayload adds the payload to the create service request document upload unprocessable entity response -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateServiceRequestDocumentUploadUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload unprocessable entity response -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateServiceRequestDocumentUploadInternalServerErrorCode is the HTTP code returned for type CreateServiceRequestDocumentUploadInternalServerError -const CreateServiceRequestDocumentUploadInternalServerErrorCode int = 500 - -/* -CreateServiceRequestDocumentUploadInternalServerError A server error occurred. - -swagger:response createServiceRequestDocumentUploadInternalServerError -*/ -type CreateServiceRequestDocumentUploadInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateServiceRequestDocumentUploadInternalServerError creates CreateServiceRequestDocumentUploadInternalServerError with default headers values -func NewCreateServiceRequestDocumentUploadInternalServerError() *CreateServiceRequestDocumentUploadInternalServerError { - - return &CreateServiceRequestDocumentUploadInternalServerError{} -} - -// WithPayload adds the payload to the create service request document upload internal server error response -func (o *CreateServiceRequestDocumentUploadInternalServerError) WithPayload(payload *primemessages.Error) *CreateServiceRequestDocumentUploadInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create service request document upload internal server error response -func (o *CreateServiceRequestDocumentUploadInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateServiceRequestDocumentUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go deleted file mode 100644 index ff4ca67d805..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// CreateServiceRequestDocumentUploadURL generates an URL for the create service request document upload operation -type CreateServiceRequestDocumentUploadURL struct { - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceRequestDocumentUploadURL) WithBasePath(bp string) *CreateServiceRequestDocumentUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateServiceRequestDocumentUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateServiceRequestDocumentUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-service-items/{mtoServiceItemID}/uploads" - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on CreateServiceRequestDocumentUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateServiceRequestDocumentUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateServiceRequestDocumentUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateServiceRequestDocumentUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateServiceRequestDocumentUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateServiceRequestDocumentUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateServiceRequestDocumentUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go deleted file mode 100644 index d5ba2aa78de..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go +++ /dev/null @@ -1,116 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOServiceItemHandlerFunc turns a function with the right signature into a update m t o service item handler -type UpdateMTOServiceItemHandlerFunc func(UpdateMTOServiceItemParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOServiceItemHandlerFunc) Handle(params UpdateMTOServiceItemParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOServiceItemHandler interface for that can handle valid update m t o service item params -type UpdateMTOServiceItemHandler interface { - Handle(UpdateMTOServiceItemParams) middleware.Responder -} - -// NewUpdateMTOServiceItem creates a new http.Handler for the update m t o service item operation -func NewUpdateMTOServiceItem(ctx *middleware.Context, handler UpdateMTOServiceItemHandler) *UpdateMTOServiceItem { - return &UpdateMTOServiceItem{Context: ctx, Handler: handler} -} - -/* - UpdateMTOServiceItem swagger:route PATCH /mto-service-items/{mtoServiceItemID} mtoServiceItem updateMTOServiceItem - -updateMTOServiceItem - -Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below. - -This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding - - to the service item you wish to update and the documentation will update with the new definition. - -* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address. -For approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress). -For shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress). - -* SIT Service Items: Take note that when updating `sitCustomerContacted`, `sitDepartureDate`, or `sitRequestedDelivery`, we want -those to be updated on `DOASIT` (for origin SIT) and `DDASIT` (for destination SIT). If updating those values in other service -items, the office users will not have as much attention to those values. - -To create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint. - -* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from -REJECTED to SUBMITTED. Please provide the `requestedApprovalsRequestedStatus: true` when resubmitting as this will give attention to the TOO to -review the resubmitted SIT service item. Another note, `updateReason` must have a different value than the current `reason` value on the service item. -If this value is not updated, then an error will be sent back. - -The following SIT service items can be resubmitted following a rejection: -- DDASIT -- DDDSIT -- DDFSIT -- DOASIT -- DOPSIT -- DOFSIT -- DDSFSC -- DOSFSC - -At a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this: -```json - - { - "reServiceCode": "DDFSIT", - "updateReason": "A reason that differs from the previous reason", - "modelType": "UpdateMTOServiceItemSIT", - "requestApprovalsRequestedStatus": true - } - -``` - -The following service items allow you to update the Port that the shipment will use: -- PODFSC (Port of Debarkation can be updated) -- POEFSC (Port of Embarkation can be updated) - -At a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item. -Please see the example payload below: -```json - - { - "id": "1ed224b6-c65e-4616-b88e-8304d26c9562", - "modelType": "UpdateMTOServiceItemInternationalPortFSC", - "portCode": "SEA", - "reServiceCode": "POEFSC" - } - -``` -*/ -type UpdateMTOServiceItem struct { - Context *middleware.Context - Handler UpdateMTOServiceItemHandler -} - -func (o *UpdateMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOServiceItemParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go deleted file mode 100644 index 70c96a425e3..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go +++ /dev/null @@ -1,138 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOServiceItemParams creates a new UpdateMTOServiceItemParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOServiceItemParams() UpdateMTOServiceItemParams { - - return UpdateMTOServiceItemParams{} -} - -// UpdateMTOServiceItemParams contains all the bound params for the update m t o service item operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOServiceItem -type UpdateMTOServiceItemParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body primemessages.UpdateMTOServiceItem - /*UUID of service item to update. - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemParams() beforehand. -func (o *UpdateMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - body, err := primemessages.UnmarshalUpdateMTOServiceItem(r.Body, route.Consumer) - if err != nil { - if err == io.EOF { - err = errors.Required("body", "body", "") - } - res = append(res, err) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOServiceItemParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *UpdateMTOServiceItemParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go deleted file mode 100644 index bb39b1a813f..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOServiceItemOKCode is the HTTP code returned for type UpdateMTOServiceItemOK -const UpdateMTOServiceItemOKCode int = 200 - -/* -UpdateMTOServiceItemOK Successfully updated the MTO service item. - -swagger:response updateMTOServiceItemOK -*/ -type UpdateMTOServiceItemOK struct { - - /* - In: Body - */ - Payload primemessages.MTOServiceItem `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemOK creates UpdateMTOServiceItemOK with default headers values -func NewUpdateMTOServiceItemOK() *UpdateMTOServiceItemOK { - - return &UpdateMTOServiceItemOK{} -} - -// WithPayload adds the payload to the update m t o service item o k response -func (o *UpdateMTOServiceItemOK) WithPayload(payload primemessages.MTOServiceItem) *UpdateMTOServiceItemOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item o k response -func (o *UpdateMTOServiceItemOK) SetPayload(payload primemessages.MTOServiceItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemBadRequest -const UpdateMTOServiceItemBadRequestCode int = 400 - -/* -UpdateMTOServiceItemBadRequest The request payload is invalid. - -swagger:response updateMTOServiceItemBadRequest -*/ -type UpdateMTOServiceItemBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemBadRequest creates UpdateMTOServiceItemBadRequest with default headers values -func NewUpdateMTOServiceItemBadRequest() *UpdateMTOServiceItemBadRequest { - - return &UpdateMTOServiceItemBadRequest{} -} - -// WithPayload adds the payload to the update m t o service item bad request response -func (o *UpdateMTOServiceItemBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item bad request response -func (o *UpdateMTOServiceItemBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemUnauthorized -const UpdateMTOServiceItemUnauthorizedCode int = 401 - -/* -UpdateMTOServiceItemUnauthorized The request was denied. - -swagger:response updateMTOServiceItemUnauthorized -*/ -type UpdateMTOServiceItemUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemUnauthorized creates UpdateMTOServiceItemUnauthorized with default headers values -func NewUpdateMTOServiceItemUnauthorized() *UpdateMTOServiceItemUnauthorized { - - return &UpdateMTOServiceItemUnauthorized{} -} - -// WithPayload adds the payload to the update m t o service item unauthorized response -func (o *UpdateMTOServiceItemUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item unauthorized response -func (o *UpdateMTOServiceItemUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemForbidden -const UpdateMTOServiceItemForbiddenCode int = 403 - -/* -UpdateMTOServiceItemForbidden The request was denied. - -swagger:response updateMTOServiceItemForbidden -*/ -type UpdateMTOServiceItemForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemForbidden creates UpdateMTOServiceItemForbidden with default headers values -func NewUpdateMTOServiceItemForbidden() *UpdateMTOServiceItemForbidden { - - return &UpdateMTOServiceItemForbidden{} -} - -// WithPayload adds the payload to the update m t o service item forbidden response -func (o *UpdateMTOServiceItemForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item forbidden response -func (o *UpdateMTOServiceItemForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemNotFound -const UpdateMTOServiceItemNotFoundCode int = 404 - -/* -UpdateMTOServiceItemNotFound The requested resource wasn't found. - -swagger:response updateMTOServiceItemNotFound -*/ -type UpdateMTOServiceItemNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemNotFound creates UpdateMTOServiceItemNotFound with default headers values -func NewUpdateMTOServiceItemNotFound() *UpdateMTOServiceItemNotFound { - - return &UpdateMTOServiceItemNotFound{} -} - -// WithPayload adds the payload to the update m t o service item not found response -func (o *UpdateMTOServiceItemNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item not found response -func (o *UpdateMTOServiceItemNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemConflictCode is the HTTP code returned for type UpdateMTOServiceItemConflict -const UpdateMTOServiceItemConflictCode int = 409 - -/* -UpdateMTOServiceItemConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateMTOServiceItemConflict -*/ -type UpdateMTOServiceItemConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemConflict creates UpdateMTOServiceItemConflict with default headers values -func NewUpdateMTOServiceItemConflict() *UpdateMTOServiceItemConflict { - - return &UpdateMTOServiceItemConflict{} -} - -// WithPayload adds the payload to the update m t o service item conflict response -func (o *UpdateMTOServiceItemConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item conflict response -func (o *UpdateMTOServiceItemConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemPreconditionFailed -const UpdateMTOServiceItemPreconditionFailedCode int = 412 - -/* -UpdateMTOServiceItemPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOServiceItemPreconditionFailed -*/ -type UpdateMTOServiceItemPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemPreconditionFailed creates UpdateMTOServiceItemPreconditionFailed with default headers values -func NewUpdateMTOServiceItemPreconditionFailed() *UpdateMTOServiceItemPreconditionFailed { - - return &UpdateMTOServiceItemPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o service item precondition failed response -func (o *UpdateMTOServiceItemPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item precondition failed response -func (o *UpdateMTOServiceItemPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemUnprocessableEntity -const UpdateMTOServiceItemUnprocessableEntityCode int = 422 - -/* -UpdateMTOServiceItemUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOServiceItemUnprocessableEntity -*/ -type UpdateMTOServiceItemUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemUnprocessableEntity creates UpdateMTOServiceItemUnprocessableEntity with default headers values -func NewUpdateMTOServiceItemUnprocessableEntity() *UpdateMTOServiceItemUnprocessableEntity { - - return &UpdateMTOServiceItemUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o service item unprocessable entity response -func (o *UpdateMTOServiceItemUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOServiceItemUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item unprocessable entity response -func (o *UpdateMTOServiceItemUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemInternalServerError -const UpdateMTOServiceItemInternalServerErrorCode int = 500 - -/* -UpdateMTOServiceItemInternalServerError A server error occurred. - -swagger:response updateMTOServiceItemInternalServerError -*/ -type UpdateMTOServiceItemInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemInternalServerError creates UpdateMTOServiceItemInternalServerError with default headers values -func NewUpdateMTOServiceItemInternalServerError() *UpdateMTOServiceItemInternalServerError { - - return &UpdateMTOServiceItemInternalServerError{} -} - -// WithPayload adds the payload to the update m t o service item internal server error response -func (o *UpdateMTOServiceItemInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOServiceItemInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item internal server error response -func (o *UpdateMTOServiceItemInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go deleted file mode 100644 index 049813f133d..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOServiceItemURL generates an URL for the update m t o service item operation -type UpdateMTOServiceItemURL struct { - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemURL) WithBasePath(bp string) *UpdateMTOServiceItemURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOServiceItemURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-service-items/{mtoServiceItemID}" - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOServiceItemURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOServiceItemURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOServiceItemURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go deleted file mode 100644 index 0170d8c146d..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOAgentHandlerFunc turns a function with the right signature into a create m t o agent handler -type CreateMTOAgentHandlerFunc func(CreateMTOAgentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOAgentHandlerFunc) Handle(params CreateMTOAgentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOAgentHandler interface for that can handle valid create m t o agent params -type CreateMTOAgentHandler interface { - Handle(CreateMTOAgentParams) middleware.Responder -} - -// NewCreateMTOAgent creates a new http.Handler for the create m t o agent operation -func NewCreateMTOAgent(ctx *middleware.Context, handler CreateMTOAgentHandler) *CreateMTOAgent { - return &CreateMTOAgent{Context: ctx, Handler: handler} -} - -/* - CreateMTOAgent swagger:route POST /mto-shipments/{mtoShipmentID}/agents mtoShipment createMTOAgent - -createMTOAgent - -### Functionality -This endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body. - -### Errors -The agent must always have a name and at least one method of contact (either `email` or `phone`). - -The agent must be associated with the MTO shipment passed in the url. - -The shipment should be associated with an MTO that is available to the Pime. -If the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. -*/ -type CreateMTOAgent struct { - Context *middleware.Context - Handler CreateMTOAgentHandler -} - -func (o *CreateMTOAgent) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOAgentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go deleted file mode 100644 index f009dad1ae5..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateMTOAgentParams creates a new CreateMTOAgentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOAgentParams() CreateMTOAgentParams { - - return CreateMTOAgentParams{} -} - -// CreateMTOAgentParams contains all the bound params for the create m t o agent operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOAgent -type CreateMTOAgentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *primemessages.MTOAgent - /*UUID of the shipment associated with the agent - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOAgentParams() beforehand. -func (o *CreateMTOAgentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.MTOAgent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *CreateMTOAgentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *CreateMTOAgentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go deleted file mode 100644 index e1fc472b094..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateMTOAgentOKCode is the HTTP code returned for type CreateMTOAgentOK -const CreateMTOAgentOKCode int = 200 - -/* -CreateMTOAgentOK Successfully added the agent. - -swagger:response createMTOAgentOK -*/ -type CreateMTOAgentOK struct { - - /* - In: Body - */ - Payload *primemessages.MTOAgent `json:"body,omitempty"` -} - -// NewCreateMTOAgentOK creates CreateMTOAgentOK with default headers values -func NewCreateMTOAgentOK() *CreateMTOAgentOK { - - return &CreateMTOAgentOK{} -} - -// WithPayload adds the payload to the create m t o agent o k response -func (o *CreateMTOAgentOK) WithPayload(payload *primemessages.MTOAgent) *CreateMTOAgentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent o k response -func (o *CreateMTOAgentOK) SetPayload(payload *primemessages.MTOAgent) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentBadRequestCode is the HTTP code returned for type CreateMTOAgentBadRequest -const CreateMTOAgentBadRequestCode int = 400 - -/* -CreateMTOAgentBadRequest The request payload is invalid. - -swagger:response createMTOAgentBadRequest -*/ -type CreateMTOAgentBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOAgentBadRequest creates CreateMTOAgentBadRequest with default headers values -func NewCreateMTOAgentBadRequest() *CreateMTOAgentBadRequest { - - return &CreateMTOAgentBadRequest{} -} - -// WithPayload adds the payload to the create m t o agent bad request response -func (o *CreateMTOAgentBadRequest) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent bad request response -func (o *CreateMTOAgentBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentUnauthorizedCode is the HTTP code returned for type CreateMTOAgentUnauthorized -const CreateMTOAgentUnauthorizedCode int = 401 - -/* -CreateMTOAgentUnauthorized The request was denied. - -swagger:response createMTOAgentUnauthorized -*/ -type CreateMTOAgentUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOAgentUnauthorized creates CreateMTOAgentUnauthorized with default headers values -func NewCreateMTOAgentUnauthorized() *CreateMTOAgentUnauthorized { - - return &CreateMTOAgentUnauthorized{} -} - -// WithPayload adds the payload to the create m t o agent unauthorized response -func (o *CreateMTOAgentUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent unauthorized response -func (o *CreateMTOAgentUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentForbiddenCode is the HTTP code returned for type CreateMTOAgentForbidden -const CreateMTOAgentForbiddenCode int = 403 - -/* -CreateMTOAgentForbidden The request was denied. - -swagger:response createMTOAgentForbidden -*/ -type CreateMTOAgentForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOAgentForbidden creates CreateMTOAgentForbidden with default headers values -func NewCreateMTOAgentForbidden() *CreateMTOAgentForbidden { - - return &CreateMTOAgentForbidden{} -} - -// WithPayload adds the payload to the create m t o agent forbidden response -func (o *CreateMTOAgentForbidden) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent forbidden response -func (o *CreateMTOAgentForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentNotFoundCode is the HTTP code returned for type CreateMTOAgentNotFound -const CreateMTOAgentNotFoundCode int = 404 - -/* -CreateMTOAgentNotFound The requested resource wasn't found. - -swagger:response createMTOAgentNotFound -*/ -type CreateMTOAgentNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOAgentNotFound creates CreateMTOAgentNotFound with default headers values -func NewCreateMTOAgentNotFound() *CreateMTOAgentNotFound { - - return &CreateMTOAgentNotFound{} -} - -// WithPayload adds the payload to the create m t o agent not found response -func (o *CreateMTOAgentNotFound) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent not found response -func (o *CreateMTOAgentNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentConflictCode is the HTTP code returned for type CreateMTOAgentConflict -const CreateMTOAgentConflictCode int = 409 - -/* -CreateMTOAgentConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response createMTOAgentConflict -*/ -type CreateMTOAgentConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOAgentConflict creates CreateMTOAgentConflict with default headers values -func NewCreateMTOAgentConflict() *CreateMTOAgentConflict { - - return &CreateMTOAgentConflict{} -} - -// WithPayload adds the payload to the create m t o agent conflict response -func (o *CreateMTOAgentConflict) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent conflict response -func (o *CreateMTOAgentConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentUnprocessableEntityCode is the HTTP code returned for type CreateMTOAgentUnprocessableEntity -const CreateMTOAgentUnprocessableEntityCode int = 422 - -/* -CreateMTOAgentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createMTOAgentUnprocessableEntity -*/ -type CreateMTOAgentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOAgentUnprocessableEntity creates CreateMTOAgentUnprocessableEntity with default headers values -func NewCreateMTOAgentUnprocessableEntity() *CreateMTOAgentUnprocessableEntity { - - return &CreateMTOAgentUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o agent unprocessable entity response -func (o *CreateMTOAgentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateMTOAgentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent unprocessable entity response -func (o *CreateMTOAgentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOAgentInternalServerErrorCode is the HTTP code returned for type CreateMTOAgentInternalServerError -const CreateMTOAgentInternalServerErrorCode int = 500 - -/* -CreateMTOAgentInternalServerError A server error occurred. - -swagger:response createMTOAgentInternalServerError -*/ -type CreateMTOAgentInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateMTOAgentInternalServerError creates CreateMTOAgentInternalServerError with default headers values -func NewCreateMTOAgentInternalServerError() *CreateMTOAgentInternalServerError { - - return &CreateMTOAgentInternalServerError{} -} - -// WithPayload adds the payload to the create m t o agent internal server error response -func (o *CreateMTOAgentInternalServerError) WithPayload(payload *primemessages.Error) *CreateMTOAgentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o agent internal server error response -func (o *CreateMTOAgentInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOAgentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go deleted file mode 100644 index 3388e32e0f9..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateMTOAgentURL generates an URL for the create m t o agent operation -type CreateMTOAgentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOAgentURL) WithBasePath(bp string) *CreateMTOAgentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOAgentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOAgentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/agents" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on CreateMTOAgentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOAgentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOAgentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOAgentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOAgentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOAgentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOAgentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go deleted file mode 100644 index f7051d2b705..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler -type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params -type CreateMTOShipmentHandler interface { - Handle(CreateMTOShipmentParams) middleware.Responder -} - -// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation -func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { - return &CreateMTOShipment{Context: ctx, Handler: handler} -} - -/* - CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment - -createMTOShipment - -_[Deprecated: this endpoint was deprecated on August 5th, 2024]_ -Please use the new endpoint at `/prime/v3/createMTOShipment` instead. -*/ -type CreateMTOShipment struct { - Context *middleware.Context - Handler CreateMTOShipmentHandler -} - -func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 5d39b1ed3e7..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOShipmentParams() CreateMTOShipmentParams { - - return CreateMTOShipmentParams{} -} - -// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOShipment -type CreateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. -func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index e663c5ed29a..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// CreateMTOShipmentGoneCode is the HTTP code returned for type CreateMTOShipmentGone -const CreateMTOShipmentGoneCode int = 410 - -/* -CreateMTOShipmentGone This endpoint is deprecated. Please use `/prime/v3/createMTOShipment` instead. - -swagger:response createMTOShipmentGone -*/ -type CreateMTOShipmentGone struct { -} - -// NewCreateMTOShipmentGone creates CreateMTOShipmentGone with default headers values -func NewCreateMTOShipmentGone() *CreateMTOShipmentGone { - - return &CreateMTOShipmentGone{} -} - -// WriteResponse to the client -func (o *CreateMTOShipmentGone) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(410) -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index cb59a0fdacf..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOShipmentURL generates an URL for the create m t o shipment operation -type CreateMTOShipmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go deleted file mode 100644 index cebd6a4fd39..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateSITExtensionHandlerFunc turns a function with the right signature into a create s i t extension handler -type CreateSITExtensionHandlerFunc func(CreateSITExtensionParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateSITExtensionHandlerFunc) Handle(params CreateSITExtensionParams) middleware.Responder { - return fn(params) -} - -// CreateSITExtensionHandler interface for that can handle valid create s i t extension params -type CreateSITExtensionHandler interface { - Handle(CreateSITExtensionParams) middleware.Responder -} - -// NewCreateSITExtension creates a new http.Handler for the create s i t extension operation -func NewCreateSITExtension(ctx *middleware.Context, handler CreateSITExtensionHandler) *CreateSITExtension { - return &CreateSITExtension{Context: ctx, Handler: handler} -} - -/* - CreateSITExtension swagger:route POST /mto-shipments/{mtoShipmentID}/sit-extensions mtoShipment createSITExtension - -createSITExtension - -### Functionality -This endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an -increase in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance -includes time spent in both origin and destination SIT. -*/ -type CreateSITExtension struct { - Context *middleware.Context - Handler CreateSITExtensionHandler -} - -func (o *CreateSITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateSITExtensionParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go deleted file mode 100644 index 80aaffb9c8d..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateSITExtensionParams creates a new CreateSITExtensionParams object -// -// There are no default values defined in the spec. -func NewCreateSITExtensionParams() CreateSITExtensionParams { - - return CreateSITExtensionParams{} -} - -// CreateSITExtensionParams contains all the bound params for the create s i t extension operation -// typically these are obtained from a http.Request -// -// swagger:parameters createSITExtension -type CreateSITExtensionParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *primemessages.CreateSITExtension - /*UUID of the shipment associated with the agent - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateSITExtensionParams() beforehand. -func (o *CreateSITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.CreateSITExtension - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *CreateSITExtensionParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *CreateSITExtensionParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go deleted file mode 100644 index 6a1afb99bb1..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateSITExtensionCreatedCode is the HTTP code returned for type CreateSITExtensionCreated -const CreateSITExtensionCreatedCode int = 201 - -/* -CreateSITExtensionCreated Successfully created the sit extension request. - -swagger:response createSITExtensionCreated -*/ -type CreateSITExtensionCreated struct { - - /* - In: Body - */ - Payload *primemessages.SITExtension `json:"body,omitempty"` -} - -// NewCreateSITExtensionCreated creates CreateSITExtensionCreated with default headers values -func NewCreateSITExtensionCreated() *CreateSITExtensionCreated { - - return &CreateSITExtensionCreated{} -} - -// WithPayload adds the payload to the create s i t extension created response -func (o *CreateSITExtensionCreated) WithPayload(payload *primemessages.SITExtension) *CreateSITExtensionCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension created response -func (o *CreateSITExtensionCreated) SetPayload(payload *primemessages.SITExtension) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionBadRequestCode is the HTTP code returned for type CreateSITExtensionBadRequest -const CreateSITExtensionBadRequestCode int = 400 - -/* -CreateSITExtensionBadRequest The request payload is invalid. - -swagger:response createSITExtensionBadRequest -*/ -type CreateSITExtensionBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateSITExtensionBadRequest creates CreateSITExtensionBadRequest with default headers values -func NewCreateSITExtensionBadRequest() *CreateSITExtensionBadRequest { - - return &CreateSITExtensionBadRequest{} -} - -// WithPayload adds the payload to the create s i t extension bad request response -func (o *CreateSITExtensionBadRequest) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension bad request response -func (o *CreateSITExtensionBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionUnauthorizedCode is the HTTP code returned for type CreateSITExtensionUnauthorized -const CreateSITExtensionUnauthorizedCode int = 401 - -/* -CreateSITExtensionUnauthorized The request was denied. - -swagger:response createSITExtensionUnauthorized -*/ -type CreateSITExtensionUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateSITExtensionUnauthorized creates CreateSITExtensionUnauthorized with default headers values -func NewCreateSITExtensionUnauthorized() *CreateSITExtensionUnauthorized { - - return &CreateSITExtensionUnauthorized{} -} - -// WithPayload adds the payload to the create s i t extension unauthorized response -func (o *CreateSITExtensionUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension unauthorized response -func (o *CreateSITExtensionUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionForbiddenCode is the HTTP code returned for type CreateSITExtensionForbidden -const CreateSITExtensionForbiddenCode int = 403 - -/* -CreateSITExtensionForbidden The request was denied. - -swagger:response createSITExtensionForbidden -*/ -type CreateSITExtensionForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateSITExtensionForbidden creates CreateSITExtensionForbidden with default headers values -func NewCreateSITExtensionForbidden() *CreateSITExtensionForbidden { - - return &CreateSITExtensionForbidden{} -} - -// WithPayload adds the payload to the create s i t extension forbidden response -func (o *CreateSITExtensionForbidden) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension forbidden response -func (o *CreateSITExtensionForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionNotFoundCode is the HTTP code returned for type CreateSITExtensionNotFound -const CreateSITExtensionNotFoundCode int = 404 - -/* -CreateSITExtensionNotFound The requested resource wasn't found. - -swagger:response createSITExtensionNotFound -*/ -type CreateSITExtensionNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateSITExtensionNotFound creates CreateSITExtensionNotFound with default headers values -func NewCreateSITExtensionNotFound() *CreateSITExtensionNotFound { - - return &CreateSITExtensionNotFound{} -} - -// WithPayload adds the payload to the create s i t extension not found response -func (o *CreateSITExtensionNotFound) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension not found response -func (o *CreateSITExtensionNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionConflictCode is the HTTP code returned for type CreateSITExtensionConflict -const CreateSITExtensionConflictCode int = 409 - -/* -CreateSITExtensionConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response createSITExtensionConflict -*/ -type CreateSITExtensionConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateSITExtensionConflict creates CreateSITExtensionConflict with default headers values -func NewCreateSITExtensionConflict() *CreateSITExtensionConflict { - - return &CreateSITExtensionConflict{} -} - -// WithPayload adds the payload to the create s i t extension conflict response -func (o *CreateSITExtensionConflict) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension conflict response -func (o *CreateSITExtensionConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionUnprocessableEntityCode is the HTTP code returned for type CreateSITExtensionUnprocessableEntity -const CreateSITExtensionUnprocessableEntityCode int = 422 - -/* -CreateSITExtensionUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createSITExtensionUnprocessableEntity -*/ -type CreateSITExtensionUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateSITExtensionUnprocessableEntity creates CreateSITExtensionUnprocessableEntity with default headers values -func NewCreateSITExtensionUnprocessableEntity() *CreateSITExtensionUnprocessableEntity { - - return &CreateSITExtensionUnprocessableEntity{} -} - -// WithPayload adds the payload to the create s i t extension unprocessable entity response -func (o *CreateSITExtensionUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateSITExtensionUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension unprocessable entity response -func (o *CreateSITExtensionUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateSITExtensionInternalServerErrorCode is the HTTP code returned for type CreateSITExtensionInternalServerError -const CreateSITExtensionInternalServerErrorCode int = 500 - -/* -CreateSITExtensionInternalServerError A server error occurred. - -swagger:response createSITExtensionInternalServerError -*/ -type CreateSITExtensionInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateSITExtensionInternalServerError creates CreateSITExtensionInternalServerError with default headers values -func NewCreateSITExtensionInternalServerError() *CreateSITExtensionInternalServerError { - - return &CreateSITExtensionInternalServerError{} -} - -// WithPayload adds the payload to the create s i t extension internal server error response -func (o *CreateSITExtensionInternalServerError) WithPayload(payload *primemessages.Error) *CreateSITExtensionInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create s i t extension internal server error response -func (o *CreateSITExtensionInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateSITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go deleted file mode 100644 index d3322175d47..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// CreateSITExtensionURL generates an URL for the create s i t extension operation -type CreateSITExtensionURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSITExtensionURL) WithBasePath(bp string) *CreateSITExtensionURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateSITExtensionURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateSITExtensionURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/sit-extensions" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on CreateSITExtensionURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateSITExtensionURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateSITExtensionURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateSITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateSITExtensionURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateSITExtensionURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateSITExtensionURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go deleted file mode 100644 index 72e5243a185..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// DeleteMTOShipmentHandlerFunc turns a function with the right signature into a delete m t o shipment handler -type DeleteMTOShipmentHandlerFunc func(DeleteMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn DeleteMTOShipmentHandlerFunc) Handle(params DeleteMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// DeleteMTOShipmentHandler interface for that can handle valid delete m t o shipment params -type DeleteMTOShipmentHandler interface { - Handle(DeleteMTOShipmentParams) middleware.Responder -} - -// NewDeleteMTOShipment creates a new http.Handler for the delete m t o shipment operation -func NewDeleteMTOShipment(ctx *middleware.Context, handler DeleteMTOShipmentHandler) *DeleteMTOShipment { - return &DeleteMTOShipment{Context: ctx, Handler: handler} -} - -/* - DeleteMTOShipment swagger:route DELETE /mto-shipments/{mtoShipmentID} mtoShipment deleteMTOShipment - -deleteMTOShipment - -### Functionality -This endpoint deletes an individual shipment by ID. - -### Errors -* The mtoShipment should be associated with an MTO that is available to prime. -* The mtoShipment must be a PPM shipment. -* Counseling should not have already been completed for the associated MTO. -*/ -type DeleteMTOShipment struct { - Context *middleware.Context - Handler DeleteMTOShipmentHandler -} - -func (o *DeleteMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewDeleteMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go deleted file mode 100644 index b1942efcb15..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewDeleteMTOShipmentParams creates a new DeleteMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewDeleteMTOShipmentParams() DeleteMTOShipmentParams { - - return DeleteMTOShipmentParams{} -} - -// DeleteMTOShipmentParams contains all the bound params for the delete m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters deleteMTOShipment -type DeleteMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the shipment to be deleted - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewDeleteMTOShipmentParams() beforehand. -func (o *DeleteMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *DeleteMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *DeleteMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go deleted file mode 100644 index 1dda539192f..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go +++ /dev/null @@ -1,309 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// DeleteMTOShipmentNoContentCode is the HTTP code returned for type DeleteMTOShipmentNoContent -const DeleteMTOShipmentNoContentCode int = 204 - -/* -DeleteMTOShipmentNoContent Successfully deleted the MTO shipment. - -swagger:response deleteMTOShipmentNoContent -*/ -type DeleteMTOShipmentNoContent struct { -} - -// NewDeleteMTOShipmentNoContent creates DeleteMTOShipmentNoContent with default headers values -func NewDeleteMTOShipmentNoContent() *DeleteMTOShipmentNoContent { - - return &DeleteMTOShipmentNoContent{} -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(204) -} - -// DeleteMTOShipmentBadRequestCode is the HTTP code returned for type DeleteMTOShipmentBadRequest -const DeleteMTOShipmentBadRequestCode int = 400 - -/* -DeleteMTOShipmentBadRequest The request payload is invalid. - -swagger:response deleteMTOShipmentBadRequest -*/ -type DeleteMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentBadRequest creates DeleteMTOShipmentBadRequest with default headers values -func NewDeleteMTOShipmentBadRequest() *DeleteMTOShipmentBadRequest { - - return &DeleteMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the delete m t o shipment bad request response -func (o *DeleteMTOShipmentBadRequest) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment bad request response -func (o *DeleteMTOShipmentBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMTOShipmentForbiddenCode is the HTTP code returned for type DeleteMTOShipmentForbidden -const DeleteMTOShipmentForbiddenCode int = 403 - -/* -DeleteMTOShipmentForbidden The request was denied. - -swagger:response deleteMTOShipmentForbidden -*/ -type DeleteMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentForbidden creates DeleteMTOShipmentForbidden with default headers values -func NewDeleteMTOShipmentForbidden() *DeleteMTOShipmentForbidden { - - return &DeleteMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the delete m t o shipment forbidden response -func (o *DeleteMTOShipmentForbidden) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment forbidden response -func (o *DeleteMTOShipmentForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMTOShipmentNotFoundCode is the HTTP code returned for type DeleteMTOShipmentNotFound -const DeleteMTOShipmentNotFoundCode int = 404 - -/* -DeleteMTOShipmentNotFound The requested resource wasn't found. - -swagger:response deleteMTOShipmentNotFound -*/ -type DeleteMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentNotFound creates DeleteMTOShipmentNotFound with default headers values -func NewDeleteMTOShipmentNotFound() *DeleteMTOShipmentNotFound { - - return &DeleteMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the delete m t o shipment not found response -func (o *DeleteMTOShipmentNotFound) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment not found response -func (o *DeleteMTOShipmentNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMTOShipmentConflictCode is the HTTP code returned for type DeleteMTOShipmentConflict -const DeleteMTOShipmentConflictCode int = 409 - -/* -DeleteMTOShipmentConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response deleteMTOShipmentConflict -*/ -type DeleteMTOShipmentConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentConflict creates DeleteMTOShipmentConflict with default headers values -func NewDeleteMTOShipmentConflict() *DeleteMTOShipmentConflict { - - return &DeleteMTOShipmentConflict{} -} - -// WithPayload adds the payload to the delete m t o shipment conflict response -func (o *DeleteMTOShipmentConflict) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment conflict response -func (o *DeleteMTOShipmentConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMTOShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteMTOShipmentUnprocessableEntity -const DeleteMTOShipmentUnprocessableEntityCode int = 422 - -/* -DeleteMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response deleteMTOShipmentUnprocessableEntity -*/ -type DeleteMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentUnprocessableEntity creates DeleteMTOShipmentUnprocessableEntity with default headers values -func NewDeleteMTOShipmentUnprocessableEntity() *DeleteMTOShipmentUnprocessableEntity { - - return &DeleteMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the delete m t o shipment unprocessable entity response -func (o *DeleteMTOShipmentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *DeleteMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment unprocessable entity response -func (o *DeleteMTOShipmentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// DeleteMTOShipmentInternalServerErrorCode is the HTTP code returned for type DeleteMTOShipmentInternalServerError -const DeleteMTOShipmentInternalServerErrorCode int = 500 - -/* -DeleteMTOShipmentInternalServerError A server error occurred. - -swagger:response deleteMTOShipmentInternalServerError -*/ -type DeleteMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewDeleteMTOShipmentInternalServerError creates DeleteMTOShipmentInternalServerError with default headers values -func NewDeleteMTOShipmentInternalServerError() *DeleteMTOShipmentInternalServerError { - - return &DeleteMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the delete m t o shipment internal server error response -func (o *DeleteMTOShipmentInternalServerError) WithPayload(payload *primemessages.Error) *DeleteMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the delete m t o shipment internal server error response -func (o *DeleteMTOShipmentInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *DeleteMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index bc4a74a9c67..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// DeleteMTOShipmentURL generates an URL for the delete m t o shipment operation -type DeleteMTOShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMTOShipmentURL) WithBasePath(bp string) *DeleteMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *DeleteMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *DeleteMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on DeleteMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *DeleteMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *DeleteMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *DeleteMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on DeleteMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on DeleteMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *DeleteMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go deleted file mode 100644 index c82cd695e18..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go +++ /dev/null @@ -1,67 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOAgentHandlerFunc turns a function with the right signature into a update m t o agent handler -type UpdateMTOAgentHandlerFunc func(UpdateMTOAgentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOAgentHandlerFunc) Handle(params UpdateMTOAgentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOAgentHandler interface for that can handle valid update m t o agent params -type UpdateMTOAgentHandler interface { - Handle(UpdateMTOAgentParams) middleware.Responder -} - -// NewUpdateMTOAgent creates a new http.Handler for the update m t o agent operation -func NewUpdateMTOAgent(ctx *middleware.Context, handler UpdateMTOAgentHandler) *UpdateMTOAgent { - return &UpdateMTOAgent{Context: ctx, Handler: handler} -} - -/* - UpdateMTOAgent swagger:route PUT /mto-shipments/{mtoShipmentID}/agents/{agentID} mtoShipment updateMTOAgent - -updateMTOAgent - -### Functionality -This endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body. - -### Errors: -The agent must always have a name and at least one method of contact (either `email` or `phone`). - -The agent must be associated with the MTO shipment passed in the url. - -The shipment should be associated with an MTO that is available to the Prime. -If the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. -*/ -type UpdateMTOAgent struct { - Context *middleware.Context - Handler UpdateMTOAgentHandler -} - -func (o *UpdateMTOAgent) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOAgentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go deleted file mode 100644 index dd9b1781b68..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOAgentParams creates a new UpdateMTOAgentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOAgentParams() UpdateMTOAgentParams { - - return UpdateMTOAgentParams{} -} - -// UpdateMTOAgentParams contains all the bound params for the update m t o agent operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOAgent -type UpdateMTOAgentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the agent being updated - Required: true - In: path - */ - AgentID strfmt.UUID - /* - Required: true - In: body - */ - Body *primemessages.MTOAgent - /*UUID of the shipment associated with the agent - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOAgentParams() beforehand. -func (o *UpdateMTOAgentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rAgentID, rhkAgentID, _ := route.Params.GetOK("agentID") - if err := o.bindAgentID(rAgentID, rhkAgentID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.MTOAgent - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOAgentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindAgentID binds and validates parameter AgentID from path. -func (o *UpdateMTOAgentParams) bindAgentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("agentID", "path", "strfmt.UUID", raw) - } - o.AgentID = *(value.(*strfmt.UUID)) - - if err := o.validateAgentID(formats); err != nil { - return err - } - - return nil -} - -// validateAgentID carries on validations for parameter AgentID -func (o *UpdateMTOAgentParams) validateAgentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("agentID", "path", "uuid", o.AgentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOAgentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOAgentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go deleted file mode 100644 index ec36801533c..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOAgentOKCode is the HTTP code returned for type UpdateMTOAgentOK -const UpdateMTOAgentOKCode int = 200 - -/* -UpdateMTOAgentOK Successfully updated the agent. - -swagger:response updateMTOAgentOK -*/ -type UpdateMTOAgentOK struct { - - /* - In: Body - */ - Payload *primemessages.MTOAgent `json:"body,omitempty"` -} - -// NewUpdateMTOAgentOK creates UpdateMTOAgentOK with default headers values -func NewUpdateMTOAgentOK() *UpdateMTOAgentOK { - - return &UpdateMTOAgentOK{} -} - -// WithPayload adds the payload to the update m t o agent o k response -func (o *UpdateMTOAgentOK) WithPayload(payload *primemessages.MTOAgent) *UpdateMTOAgentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent o k response -func (o *UpdateMTOAgentOK) SetPayload(payload *primemessages.MTOAgent) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentBadRequestCode is the HTTP code returned for type UpdateMTOAgentBadRequest -const UpdateMTOAgentBadRequestCode int = 400 - -/* -UpdateMTOAgentBadRequest The request payload is invalid. - -swagger:response updateMTOAgentBadRequest -*/ -type UpdateMTOAgentBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentBadRequest creates UpdateMTOAgentBadRequest with default headers values -func NewUpdateMTOAgentBadRequest() *UpdateMTOAgentBadRequest { - - return &UpdateMTOAgentBadRequest{} -} - -// WithPayload adds the payload to the update m t o agent bad request response -func (o *UpdateMTOAgentBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent bad request response -func (o *UpdateMTOAgentBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentUnauthorizedCode is the HTTP code returned for type UpdateMTOAgentUnauthorized -const UpdateMTOAgentUnauthorizedCode int = 401 - -/* -UpdateMTOAgentUnauthorized The request was denied. - -swagger:response updateMTOAgentUnauthorized -*/ -type UpdateMTOAgentUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentUnauthorized creates UpdateMTOAgentUnauthorized with default headers values -func NewUpdateMTOAgentUnauthorized() *UpdateMTOAgentUnauthorized { - - return &UpdateMTOAgentUnauthorized{} -} - -// WithPayload adds the payload to the update m t o agent unauthorized response -func (o *UpdateMTOAgentUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent unauthorized response -func (o *UpdateMTOAgentUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentForbiddenCode is the HTTP code returned for type UpdateMTOAgentForbidden -const UpdateMTOAgentForbiddenCode int = 403 - -/* -UpdateMTOAgentForbidden The request was denied. - -swagger:response updateMTOAgentForbidden -*/ -type UpdateMTOAgentForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentForbidden creates UpdateMTOAgentForbidden with default headers values -func NewUpdateMTOAgentForbidden() *UpdateMTOAgentForbidden { - - return &UpdateMTOAgentForbidden{} -} - -// WithPayload adds the payload to the update m t o agent forbidden response -func (o *UpdateMTOAgentForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent forbidden response -func (o *UpdateMTOAgentForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentNotFoundCode is the HTTP code returned for type UpdateMTOAgentNotFound -const UpdateMTOAgentNotFoundCode int = 404 - -/* -UpdateMTOAgentNotFound The requested resource wasn't found. - -swagger:response updateMTOAgentNotFound -*/ -type UpdateMTOAgentNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentNotFound creates UpdateMTOAgentNotFound with default headers values -func NewUpdateMTOAgentNotFound() *UpdateMTOAgentNotFound { - - return &UpdateMTOAgentNotFound{} -} - -// WithPayload adds the payload to the update m t o agent not found response -func (o *UpdateMTOAgentNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent not found response -func (o *UpdateMTOAgentNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentPreconditionFailedCode is the HTTP code returned for type UpdateMTOAgentPreconditionFailed -const UpdateMTOAgentPreconditionFailedCode int = 412 - -/* -UpdateMTOAgentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOAgentPreconditionFailed -*/ -type UpdateMTOAgentPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentPreconditionFailed creates UpdateMTOAgentPreconditionFailed with default headers values -func NewUpdateMTOAgentPreconditionFailed() *UpdateMTOAgentPreconditionFailed { - - return &UpdateMTOAgentPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o agent precondition failed response -func (o *UpdateMTOAgentPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent precondition failed response -func (o *UpdateMTOAgentPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOAgentUnprocessableEntity -const UpdateMTOAgentUnprocessableEntityCode int = 422 - -/* -UpdateMTOAgentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOAgentUnprocessableEntity -*/ -type UpdateMTOAgentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOAgentUnprocessableEntity creates UpdateMTOAgentUnprocessableEntity with default headers values -func NewUpdateMTOAgentUnprocessableEntity() *UpdateMTOAgentUnprocessableEntity { - - return &UpdateMTOAgentUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o agent unprocessable entity response -func (o *UpdateMTOAgentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOAgentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent unprocessable entity response -func (o *UpdateMTOAgentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOAgentInternalServerErrorCode is the HTTP code returned for type UpdateMTOAgentInternalServerError -const UpdateMTOAgentInternalServerErrorCode int = 500 - -/* -UpdateMTOAgentInternalServerError A server error occurred. - -swagger:response updateMTOAgentInternalServerError -*/ -type UpdateMTOAgentInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOAgentInternalServerError creates UpdateMTOAgentInternalServerError with default headers values -func NewUpdateMTOAgentInternalServerError() *UpdateMTOAgentInternalServerError { - - return &UpdateMTOAgentInternalServerError{} -} - -// WithPayload adds the payload to the update m t o agent internal server error response -func (o *UpdateMTOAgentInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOAgentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o agent internal server error response -func (o *UpdateMTOAgentInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOAgentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go deleted file mode 100644 index 4f9c1234a13..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOAgentURL generates an URL for the update m t o agent operation -type UpdateMTOAgentURL struct { - AgentID strfmt.UUID - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOAgentURL) WithBasePath(bp string) *UpdateMTOAgentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOAgentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOAgentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/agents/{agentID}" - - agentID := o.AgentID.String() - if agentID != "" { - _path = strings.Replace(_path, "{agentID}", agentID, -1) - } else { - return nil, errors.New("agentId is required on UpdateMTOAgentURL") - } - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOAgentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOAgentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOAgentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOAgentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOAgentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOAgentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOAgentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go deleted file mode 100644 index 588bc361b08..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go +++ /dev/null @@ -1,59 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler -type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params -type UpdateMTOShipmentHandler interface { - Handle(UpdateMTOShipmentParams) middleware.Responder -} - -// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation -func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { - return &UpdateMTOShipment{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment - -updateMTOShipment - -_[Deprecated: this endpoint was deprecated on August 5th, 2024]_ -Please use the new endpoint at `/prime/v3/updateMTOShipment` instead. -*/ -type UpdateMTOShipment struct { - Context *middleware.Context - Handler UpdateMTOShipmentHandler -} - -func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go deleted file mode 100644 index b5d1e738c34..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentAddressHandlerFunc turns a function with the right signature into a update m t o shipment address handler -type UpdateMTOShipmentAddressHandlerFunc func(UpdateMTOShipmentAddressParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentAddressHandlerFunc) Handle(params UpdateMTOShipmentAddressParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentAddressHandler interface for that can handle valid update m t o shipment address params -type UpdateMTOShipmentAddressHandler interface { - Handle(UpdateMTOShipmentAddressParams) middleware.Responder -} - -// NewUpdateMTOShipmentAddress creates a new http.Handler for the update m t o shipment address operation -func NewUpdateMTOShipmentAddress(ctx *middleware.Context, handler UpdateMTOShipmentAddressHandler) *UpdateMTOShipmentAddress { - return &UpdateMTOShipmentAddress{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipmentAddress swagger:route PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID} mtoShipment updateMTOShipmentAddress - -updateMTOShipmentAddress - -### Functionality -This endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID. -Therefore a complete address should be sent in the request. -When a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match. - -This endpoint **cannot create** an address. -To create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address. - -### Errors -The address must be associated with the mtoShipment passed in the url. -In other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided. -If it is not, caller will receive a **Conflict** Error. - -The mtoShipment should be associated with an MTO that is available to prime. -If the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error. -*/ -type UpdateMTOShipmentAddress struct { - Context *middleware.Context - Handler UpdateMTOShipmentAddressHandler -} - -func (o *UpdateMTOShipmentAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentAddressParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go deleted file mode 100644 index 523f692c9b8..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOShipmentAddressParams creates a new UpdateMTOShipmentAddressParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentAddressParams() UpdateMTOShipmentAddressParams { - - return UpdateMTOShipmentAddressParams{} -} - -// UpdateMTOShipmentAddressParams contains all the bound params for the update m t o shipment address operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipmentAddress -type UpdateMTOShipmentAddressParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of the address being updated - Required: true - In: path - */ - AddressID strfmt.UUID - /* - Required: true - In: body - */ - Body *primemessages.Address - /*UUID of the shipment associated with the address - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentAddressParams() beforehand. -func (o *UpdateMTOShipmentAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rAddressID, rhkAddressID, _ := route.Params.GetOK("addressID") - if err := o.bindAddressID(rAddressID, rhkAddressID, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.Address - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentAddressParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindAddressID binds and validates parameter AddressID from path. -func (o *UpdateMTOShipmentAddressParams) bindAddressID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("addressID", "path", "strfmt.UUID", raw) - } - o.AddressID = *(value.(*strfmt.UUID)) - - if err := o.validateAddressID(formats); err != nil { - return err - } - - return nil -} - -// validateAddressID carries on validations for parameter AddressID -func (o *UpdateMTOShipmentAddressParams) validateAddressID(formats strfmt.Registry) error { - - if err := validate.FormatOf("addressID", "path", "uuid", o.AddressID.String(), formats); err != nil { - return err - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentAddressParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentAddressParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go deleted file mode 100644 index a4141c254d3..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOShipmentAddressOKCode is the HTTP code returned for type UpdateMTOShipmentAddressOK -const UpdateMTOShipmentAddressOKCode int = 200 - -/* -UpdateMTOShipmentAddressOK Successfully updated the address. - -swagger:response updateMTOShipmentAddressOK -*/ -type UpdateMTOShipmentAddressOK struct { - - /* - In: Body - */ - Payload *primemessages.Address `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressOK creates UpdateMTOShipmentAddressOK with default headers values -func NewUpdateMTOShipmentAddressOK() *UpdateMTOShipmentAddressOK { - - return &UpdateMTOShipmentAddressOK{} -} - -// WithPayload adds the payload to the update m t o shipment address o k response -func (o *UpdateMTOShipmentAddressOK) WithPayload(payload *primemessages.Address) *UpdateMTOShipmentAddressOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address o k response -func (o *UpdateMTOShipmentAddressOK) SetPayload(payload *primemessages.Address) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressBadRequestCode is the HTTP code returned for type UpdateMTOShipmentAddressBadRequest -const UpdateMTOShipmentAddressBadRequestCode int = 400 - -/* -UpdateMTOShipmentAddressBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentAddressBadRequest -*/ -type UpdateMTOShipmentAddressBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressBadRequest creates UpdateMTOShipmentAddressBadRequest with default headers values -func NewUpdateMTOShipmentAddressBadRequest() *UpdateMTOShipmentAddressBadRequest { - - return &UpdateMTOShipmentAddressBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment address bad request response -func (o *UpdateMTOShipmentAddressBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address bad request response -func (o *UpdateMTOShipmentAddressBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentAddressUnauthorized -const UpdateMTOShipmentAddressUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentAddressUnauthorized The request was denied. - -swagger:response updateMTOShipmentAddressUnauthorized -*/ -type UpdateMTOShipmentAddressUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressUnauthorized creates UpdateMTOShipmentAddressUnauthorized with default headers values -func NewUpdateMTOShipmentAddressUnauthorized() *UpdateMTOShipmentAddressUnauthorized { - - return &UpdateMTOShipmentAddressUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment address unauthorized response -func (o *UpdateMTOShipmentAddressUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address unauthorized response -func (o *UpdateMTOShipmentAddressUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressForbiddenCode is the HTTP code returned for type UpdateMTOShipmentAddressForbidden -const UpdateMTOShipmentAddressForbiddenCode int = 403 - -/* -UpdateMTOShipmentAddressForbidden The request was denied. - -swagger:response updateMTOShipmentAddressForbidden -*/ -type UpdateMTOShipmentAddressForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressForbidden creates UpdateMTOShipmentAddressForbidden with default headers values -func NewUpdateMTOShipmentAddressForbidden() *UpdateMTOShipmentAddressForbidden { - - return &UpdateMTOShipmentAddressForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment address forbidden response -func (o *UpdateMTOShipmentAddressForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address forbidden response -func (o *UpdateMTOShipmentAddressForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressNotFoundCode is the HTTP code returned for type UpdateMTOShipmentAddressNotFound -const UpdateMTOShipmentAddressNotFoundCode int = 404 - -/* -UpdateMTOShipmentAddressNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentAddressNotFound -*/ -type UpdateMTOShipmentAddressNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressNotFound creates UpdateMTOShipmentAddressNotFound with default headers values -func NewUpdateMTOShipmentAddressNotFound() *UpdateMTOShipmentAddressNotFound { - - return &UpdateMTOShipmentAddressNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment address not found response -func (o *UpdateMTOShipmentAddressNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address not found response -func (o *UpdateMTOShipmentAddressNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressConflictCode is the HTTP code returned for type UpdateMTOShipmentAddressConflict -const UpdateMTOShipmentAddressConflictCode int = 409 - -/* -UpdateMTOShipmentAddressConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateMTOShipmentAddressConflict -*/ -type UpdateMTOShipmentAddressConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressConflict creates UpdateMTOShipmentAddressConflict with default headers values -func NewUpdateMTOShipmentAddressConflict() *UpdateMTOShipmentAddressConflict { - - return &UpdateMTOShipmentAddressConflict{} -} - -// WithPayload adds the payload to the update m t o shipment address conflict response -func (o *UpdateMTOShipmentAddressConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address conflict response -func (o *UpdateMTOShipmentAddressConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentAddressPreconditionFailed -const UpdateMTOShipmentAddressPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentAddressPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentAddressPreconditionFailed -*/ -type UpdateMTOShipmentAddressPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressPreconditionFailed creates UpdateMTOShipmentAddressPreconditionFailed with default headers values -func NewUpdateMTOShipmentAddressPreconditionFailed() *UpdateMTOShipmentAddressPreconditionFailed { - - return &UpdateMTOShipmentAddressPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment address precondition failed response -func (o *UpdateMTOShipmentAddressPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address precondition failed response -func (o *UpdateMTOShipmentAddressPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentAddressUnprocessableEntity -const UpdateMTOShipmentAddressUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentAddressUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOShipmentAddressUnprocessableEntity -*/ -type UpdateMTOShipmentAddressUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressUnprocessableEntity creates UpdateMTOShipmentAddressUnprocessableEntity with default headers values -func NewUpdateMTOShipmentAddressUnprocessableEntity() *UpdateMTOShipmentAddressUnprocessableEntity { - - return &UpdateMTOShipmentAddressUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment address unprocessable entity response -func (o *UpdateMTOShipmentAddressUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOShipmentAddressUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address unprocessable entity response -func (o *UpdateMTOShipmentAddressUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentAddressInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentAddressInternalServerError -const UpdateMTOShipmentAddressInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentAddressInternalServerError A server error occurred. - -swagger:response updateMTOShipmentAddressInternalServerError -*/ -type UpdateMTOShipmentAddressInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentAddressInternalServerError creates UpdateMTOShipmentAddressInternalServerError with default headers values -func NewUpdateMTOShipmentAddressInternalServerError() *UpdateMTOShipmentAddressInternalServerError { - - return &UpdateMTOShipmentAddressInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment address internal server error response -func (o *UpdateMTOShipmentAddressInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOShipmentAddressInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment address internal server error response -func (o *UpdateMTOShipmentAddressInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go deleted file mode 100644 index f6f4c63bb6f..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentAddressURL generates an URL for the update m t o shipment address operation -type UpdateMTOShipmentAddressURL struct { - AddressID strfmt.UUID - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentAddressURL) WithBasePath(bp string) *UpdateMTOShipmentAddressURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentAddressURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentAddressURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/addresses/{addressID}" - - addressID := o.AddressID.String() - if addressID != "" { - _path = strings.Replace(_path, "{addressID}", addressID, -1) - } else { - return nil, errors.New("addressId is required on UpdateMTOShipmentAddressURL") - } - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentAddressURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentAddressURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentAddressURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentAddressURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentAddressURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentAddressURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentAddressURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index 92beebf098c..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { - - return UpdateMTOShipmentParams{} -} - -// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipment -type UpdateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the shipment being updated. - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. -func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 9c59dbe036f..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,37 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" -) - -// UpdateMTOShipmentGoneCode is the HTTP code returned for type UpdateMTOShipmentGone -const UpdateMTOShipmentGoneCode int = 410 - -/* -UpdateMTOShipmentGone This endpoint is deprecated. Please use `/prime/v3/updateMTOShipment` instead. - -swagger:response updateMTOShipmentGone -*/ -type UpdateMTOShipmentGone struct { -} - -// NewUpdateMTOShipmentGone creates UpdateMTOShipmentGone with default headers values -func NewUpdateMTOShipmentGone() *UpdateMTOShipmentGone { - - return &UpdateMTOShipmentGone{} -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentGone) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses - - rw.WriteHeader(410) -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go deleted file mode 100644 index 2dd72d33fed..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentStatusHandlerFunc turns a function with the right signature into a update m t o shipment status handler -type UpdateMTOShipmentStatusHandlerFunc func(UpdateMTOShipmentStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentStatusHandlerFunc) Handle(params UpdateMTOShipmentStatusParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentStatusHandler interface for that can handle valid update m t o shipment status params -type UpdateMTOShipmentStatusHandler interface { - Handle(UpdateMTOShipmentStatusParams) middleware.Responder -} - -// NewUpdateMTOShipmentStatus creates a new http.Handler for the update m t o shipment status operation -func NewUpdateMTOShipmentStatus(ctx *middleware.Context, handler UpdateMTOShipmentStatusHandler) *UpdateMTOShipmentStatus { - return &UpdateMTOShipmentStatus{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipmentStatus swagger:route PATCH /mto-shipments/{mtoShipmentID}/status mtoShipment updateMTOShipmentStatus - -updateMTOShipmentStatus - -### Functionality -This endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment -status to be changed to "CANCELED." Currently, the Prime cannot update the shipment to any other status. -*/ -type UpdateMTOShipmentStatus struct { - Context *middleware.Context - Handler UpdateMTOShipmentStatusHandler -} - -func (o *UpdateMTOShipmentStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go deleted file mode 100644 index 2fb252a4602..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentStatusParams() UpdateMTOShipmentStatusParams { - - return UpdateMTOShipmentStatusParams{} -} - -// UpdateMTOShipmentStatusParams contains all the bound params for the update m t o shipment status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipmentStatus -type UpdateMTOShipmentStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *primemessages.UpdateMTOShipmentStatus - /*UUID of the shipment associated with the agent - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentStatusParams() beforehand. -func (o *UpdateMTOShipmentStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.UpdateMTOShipmentStatus - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentStatusParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentStatusParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go deleted file mode 100644 index c6f6c5b9794..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOShipmentStatusOKCode is the HTTP code returned for type UpdateMTOShipmentStatusOK -const UpdateMTOShipmentStatusOKCode int = 200 - -/* -UpdateMTOShipmentStatusOK Successfully updated the shipment's status. - -swagger:response updateMTOShipmentStatusOK -*/ -type UpdateMTOShipmentStatusOK struct { - - /* - In: Body - */ - Payload *primemessages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusOK creates UpdateMTOShipmentStatusOK with default headers values -func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { - - return &UpdateMTOShipmentStatusOK{} -} - -// WithPayload adds the payload to the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) WithPayload(payload *primemessages.MTOShipment) *UpdateMTOShipmentStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) SetPayload(payload *primemessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusBadRequestCode is the HTTP code returned for type UpdateMTOShipmentStatusBadRequest -const UpdateMTOShipmentStatusBadRequestCode int = 400 - -/* -UpdateMTOShipmentStatusBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentStatusBadRequest -*/ -type UpdateMTOShipmentStatusBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusBadRequest creates UpdateMTOShipmentStatusBadRequest with default headers values -func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { - - return &UpdateMTOShipmentStatusBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentStatusUnauthorized -const UpdateMTOShipmentStatusUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentStatusUnauthorized The request was denied. - -swagger:response updateMTOShipmentStatusUnauthorized -*/ -type UpdateMTOShipmentStatusUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusUnauthorized creates UpdateMTOShipmentStatusUnauthorized with default headers values -func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { - - return &UpdateMTOShipmentStatusUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusForbiddenCode is the HTTP code returned for type UpdateMTOShipmentStatusForbidden -const UpdateMTOShipmentStatusForbiddenCode int = 403 - -/* -UpdateMTOShipmentStatusForbidden The request was denied. - -swagger:response updateMTOShipmentStatusForbidden -*/ -type UpdateMTOShipmentStatusForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusForbidden creates UpdateMTOShipmentStatusForbidden with default headers values -func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { - - return &UpdateMTOShipmentStatusForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusNotFoundCode is the HTTP code returned for type UpdateMTOShipmentStatusNotFound -const UpdateMTOShipmentStatusNotFoundCode int = 404 - -/* -UpdateMTOShipmentStatusNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentStatusNotFound -*/ -type UpdateMTOShipmentStatusNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusNotFound creates UpdateMTOShipmentStatusNotFound with default headers values -func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { - - return &UpdateMTOShipmentStatusNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusConflictCode is the HTTP code returned for type UpdateMTOShipmentStatusConflict -const UpdateMTOShipmentStatusConflictCode int = 409 - -/* -UpdateMTOShipmentStatusConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateMTOShipmentStatusConflict -*/ -type UpdateMTOShipmentStatusConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusConflict creates UpdateMTOShipmentStatusConflict with default headers values -func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { - - return &UpdateMTOShipmentStatusConflict{} -} - -// WithPayload adds the payload to the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentStatusPreconditionFailed -const UpdateMTOShipmentStatusPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentStatusPreconditionFailed -*/ -type UpdateMTOShipmentStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusPreconditionFailed creates UpdateMTOShipmentStatusPreconditionFailed with default headers values -func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { - - return &UpdateMTOShipmentStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentStatusUnprocessableEntity -const UpdateMTOShipmentStatusUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentStatusUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOShipmentStatusUnprocessableEntity -*/ -type UpdateMTOShipmentStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusUnprocessableEntity creates UpdateMTOShipmentStatusUnprocessableEntity with default headers values -func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { - - return &UpdateMTOShipmentStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOShipmentStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentStatusInternalServerError -const UpdateMTOShipmentStatusInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentStatusInternalServerError A server error occurred. - -swagger:response updateMTOShipmentStatusInternalServerError -*/ -type UpdateMTOShipmentStatusInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusInternalServerError creates UpdateMTOShipmentStatusInternalServerError with default headers values -func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { - - return &UpdateMTOShipmentStatusInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOShipmentStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go deleted file mode 100644 index cb67f2877e5..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentStatusURL generates an URL for the update m t o shipment status operation -type UpdateMTOShipmentStatusURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentStatusURL) WithBasePath(bp string) *UpdateMTOShipmentStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/status" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index 8de892a250c..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation -type UpdateMTOShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go deleted file mode 100644 index 9b4b09909ad..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go +++ /dev/null @@ -1,64 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateReweighHandlerFunc turns a function with the right signature into a update reweigh handler -type UpdateReweighHandlerFunc func(UpdateReweighParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateReweighHandlerFunc) Handle(params UpdateReweighParams) middleware.Responder { - return fn(params) -} - -// UpdateReweighHandler interface for that can handle valid update reweigh params -type UpdateReweighHandler interface { - Handle(UpdateReweighParams) middleware.Responder -} - -// NewUpdateReweigh creates a new http.Handler for the update reweigh operation -func NewUpdateReweigh(ctx *middleware.Context, handler UpdateReweighHandler) *UpdateReweigh { - return &UpdateReweigh{Context: ctx, Handler: handler} -} - -/* - UpdateReweigh swagger:route PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID} mtoShipment updateReweigh - -updateReweigh - -### Functionality -This endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur. -Only one of weight or verificationReason should be sent in the request body. - -A reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment. -A reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed, -so not all shipments will have a reweigh weight. -*/ -type UpdateReweigh struct { - Context *middleware.Context - Handler UpdateReweighHandler -} - -func (o *UpdateReweigh) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateReweighParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go deleted file mode 100644 index 6cc7a0ba346..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go +++ /dev/null @@ -1,201 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateReweighParams creates a new UpdateReweighParams object -// -// There are no default values defined in the spec. -func NewUpdateReweighParams() UpdateReweighParams { - - return UpdateReweighParams{} -} - -// UpdateReweighParams contains all the bound params for the update reweigh operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateReweigh -type UpdateReweighParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *primemessages.UpdateReweigh - /*UUID of the shipment associated with the reweigh - Required: true - In: path - */ - MtoShipmentID strfmt.UUID - /*UUID of the reweigh being updated - Required: true - In: path - */ - ReweighID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateReweighParams() beforehand. -func (o *UpdateReweighParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.UpdateReweigh - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - - rReweighID, rhkReweighID, _ := route.Params.GetOK("reweighID") - if err := o.bindReweighID(rReweighID, rhkReweighID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateReweighParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateReweighParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateReweighParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} - -// bindReweighID binds and validates parameter ReweighID from path. -func (o *UpdateReweighParams) bindReweighID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("reweighID", "path", "strfmt.UUID", raw) - } - o.ReweighID = *(value.(*strfmt.UUID)) - - if err := o.validateReweighID(formats); err != nil { - return err - } - - return nil -} - -// validateReweighID carries on validations for parameter ReweighID -func (o *UpdateReweighParams) validateReweighID(formats strfmt.Registry) error { - - if err := validate.FormatOf("reweighID", "path", "uuid", o.ReweighID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go deleted file mode 100644 index 1c9d57bb6e7..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateReweighOKCode is the HTTP code returned for type UpdateReweighOK -const UpdateReweighOKCode int = 200 - -/* -UpdateReweighOK Successfully updated the reweigh. - -swagger:response updateReweighOK -*/ -type UpdateReweighOK struct { - - /* - In: Body - */ - Payload *primemessages.Reweigh `json:"body,omitempty"` -} - -// NewUpdateReweighOK creates UpdateReweighOK with default headers values -func NewUpdateReweighOK() *UpdateReweighOK { - - return &UpdateReweighOK{} -} - -// WithPayload adds the payload to the update reweigh o k response -func (o *UpdateReweighOK) WithPayload(payload *primemessages.Reweigh) *UpdateReweighOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh o k response -func (o *UpdateReweighOK) SetPayload(payload *primemessages.Reweigh) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighBadRequestCode is the HTTP code returned for type UpdateReweighBadRequest -const UpdateReweighBadRequestCode int = 400 - -/* -UpdateReweighBadRequest The request payload is invalid. - -swagger:response updateReweighBadRequest -*/ -type UpdateReweighBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighBadRequest creates UpdateReweighBadRequest with default headers values -func NewUpdateReweighBadRequest() *UpdateReweighBadRequest { - - return &UpdateReweighBadRequest{} -} - -// WithPayload adds the payload to the update reweigh bad request response -func (o *UpdateReweighBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateReweighBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh bad request response -func (o *UpdateReweighBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighUnauthorizedCode is the HTTP code returned for type UpdateReweighUnauthorized -const UpdateReweighUnauthorizedCode int = 401 - -/* -UpdateReweighUnauthorized The request was denied. - -swagger:response updateReweighUnauthorized -*/ -type UpdateReweighUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighUnauthorized creates UpdateReweighUnauthorized with default headers values -func NewUpdateReweighUnauthorized() *UpdateReweighUnauthorized { - - return &UpdateReweighUnauthorized{} -} - -// WithPayload adds the payload to the update reweigh unauthorized response -func (o *UpdateReweighUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateReweighUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh unauthorized response -func (o *UpdateReweighUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighForbiddenCode is the HTTP code returned for type UpdateReweighForbidden -const UpdateReweighForbiddenCode int = 403 - -/* -UpdateReweighForbidden The request was denied. - -swagger:response updateReweighForbidden -*/ -type UpdateReweighForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighForbidden creates UpdateReweighForbidden with default headers values -func NewUpdateReweighForbidden() *UpdateReweighForbidden { - - return &UpdateReweighForbidden{} -} - -// WithPayload adds the payload to the update reweigh forbidden response -func (o *UpdateReweighForbidden) WithPayload(payload *primemessages.ClientError) *UpdateReweighForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh forbidden response -func (o *UpdateReweighForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighNotFoundCode is the HTTP code returned for type UpdateReweighNotFound -const UpdateReweighNotFoundCode int = 404 - -/* -UpdateReweighNotFound The requested resource wasn't found. - -swagger:response updateReweighNotFound -*/ -type UpdateReweighNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighNotFound creates UpdateReweighNotFound with default headers values -func NewUpdateReweighNotFound() *UpdateReweighNotFound { - - return &UpdateReweighNotFound{} -} - -// WithPayload adds the payload to the update reweigh not found response -func (o *UpdateReweighNotFound) WithPayload(payload *primemessages.ClientError) *UpdateReweighNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh not found response -func (o *UpdateReweighNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighConflictCode is the HTTP code returned for type UpdateReweighConflict -const UpdateReweighConflictCode int = 409 - -/* -UpdateReweighConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateReweighConflict -*/ -type UpdateReweighConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighConflict creates UpdateReweighConflict with default headers values -func NewUpdateReweighConflict() *UpdateReweighConflict { - - return &UpdateReweighConflict{} -} - -// WithPayload adds the payload to the update reweigh conflict response -func (o *UpdateReweighConflict) WithPayload(payload *primemessages.ClientError) *UpdateReweighConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh conflict response -func (o *UpdateReweighConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighPreconditionFailedCode is the HTTP code returned for type UpdateReweighPreconditionFailed -const UpdateReweighPreconditionFailedCode int = 412 - -/* -UpdateReweighPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateReweighPreconditionFailed -*/ -type UpdateReweighPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateReweighPreconditionFailed creates UpdateReweighPreconditionFailed with default headers values -func NewUpdateReweighPreconditionFailed() *UpdateReweighPreconditionFailed { - - return &UpdateReweighPreconditionFailed{} -} - -// WithPayload adds the payload to the update reweigh precondition failed response -func (o *UpdateReweighPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateReweighPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh precondition failed response -func (o *UpdateReweighPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighUnprocessableEntityCode is the HTTP code returned for type UpdateReweighUnprocessableEntity -const UpdateReweighUnprocessableEntityCode int = 422 - -/* -UpdateReweighUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateReweighUnprocessableEntity -*/ -type UpdateReweighUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateReweighUnprocessableEntity creates UpdateReweighUnprocessableEntity with default headers values -func NewUpdateReweighUnprocessableEntity() *UpdateReweighUnprocessableEntity { - - return &UpdateReweighUnprocessableEntity{} -} - -// WithPayload adds the payload to the update reweigh unprocessable entity response -func (o *UpdateReweighUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateReweighUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh unprocessable entity response -func (o *UpdateReweighUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateReweighInternalServerErrorCode is the HTTP code returned for type UpdateReweighInternalServerError -const UpdateReweighInternalServerErrorCode int = 500 - -/* -UpdateReweighInternalServerError A server error occurred. - -swagger:response updateReweighInternalServerError -*/ -type UpdateReweighInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateReweighInternalServerError creates UpdateReweighInternalServerError with default headers values -func NewUpdateReweighInternalServerError() *UpdateReweighInternalServerError { - - return &UpdateReweighInternalServerError{} -} - -// WithPayload adds the payload to the update reweigh internal server error response -func (o *UpdateReweighInternalServerError) WithPayload(payload *primemessages.Error) *UpdateReweighInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update reweigh internal server error response -func (o *UpdateReweighInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateReweighInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go deleted file mode 100644 index c93040e0506..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateReweighURL generates an URL for the update reweigh operation -type UpdateReweighURL struct { - MtoShipmentID strfmt.UUID - ReweighID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateReweighURL) WithBasePath(bp string) *UpdateReweighURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateReweighURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateReweighURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateReweighURL") - } - - reweighID := o.ReweighID.String() - if reweighID != "" { - _path = strings.Replace(_path, "{reweighID}", reweighID, -1) - } else { - return nil, errors.New("reweighId is required on UpdateReweighURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateReweighURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateReweighURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateReweighURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateReweighURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateReweighURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateReweighURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go deleted file mode 100644 index 05d4da3e964..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateShipmentDestinationAddressHandlerFunc turns a function with the right signature into a update shipment destination address handler -type UpdateShipmentDestinationAddressHandlerFunc func(UpdateShipmentDestinationAddressParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateShipmentDestinationAddressHandlerFunc) Handle(params UpdateShipmentDestinationAddressParams) middleware.Responder { - return fn(params) -} - -// UpdateShipmentDestinationAddressHandler interface for that can handle valid update shipment destination address params -type UpdateShipmentDestinationAddressHandler interface { - Handle(UpdateShipmentDestinationAddressParams) middleware.Responder -} - -// NewUpdateShipmentDestinationAddress creates a new http.Handler for the update shipment destination address operation -func NewUpdateShipmentDestinationAddress(ctx *middleware.Context, handler UpdateShipmentDestinationAddressHandler) *UpdateShipmentDestinationAddress { - return &UpdateShipmentDestinationAddress{Context: ctx, Handler: handler} -} - -/* - UpdateShipmentDestinationAddress swagger:route POST /mto-shipments/{mtoShipmentID}/shipment-address-updates mtoShipment updateShipmentDestinationAddress - -updateShipmentDestinationAddress - -### Functionality -This endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment, -after the delivery address has already been approved. - -This endpoint and operation only supports the following shipment types: -- HHG -- NTSR - -For HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved. - -Address updates will be automatically approved unless they change: - - The service area - - Mileage bracket for direct delivery - - the address and the distance between the old and new address is > 50 - - Domestic Short Haul to Domestic Line Haul or vice versa - - Shipments that start and end in one ZIP3 use Short Haul pricing - - Shipments that start and end in different ZIP3s use Line Haul pricing - -For those, changes will require TOO approval. -*/ -type UpdateShipmentDestinationAddress struct { - Context *middleware.Context - Handler UpdateShipmentDestinationAddressHandler -} - -func (o *UpdateShipmentDestinationAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateShipmentDestinationAddressParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go deleted file mode 100644 index 5017b9a9912..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateShipmentDestinationAddressParams creates a new UpdateShipmentDestinationAddressParams object -// -// There are no default values defined in the spec. -func NewUpdateShipmentDestinationAddressParams() UpdateShipmentDestinationAddressParams { - - return UpdateShipmentDestinationAddressParams{} -} - -// UpdateShipmentDestinationAddressParams contains all the bound params for the update shipment destination address operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateShipmentDestinationAddress -type UpdateShipmentDestinationAddressParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *primemessages.UpdateShipmentDestinationAddress - /*UUID of the shipment associated with the address - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateShipmentDestinationAddressParams() beforehand. -func (o *UpdateShipmentDestinationAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.UpdateShipmentDestinationAddress - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateShipmentDestinationAddressParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateShipmentDestinationAddressParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateShipmentDestinationAddressParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go deleted file mode 100644 index 409fd04c241..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateShipmentDestinationAddressCreatedCode is the HTTP code returned for type UpdateShipmentDestinationAddressCreated -const UpdateShipmentDestinationAddressCreatedCode int = 201 - -/* -UpdateShipmentDestinationAddressCreated Successfully created the address update request. - -swagger:response updateShipmentDestinationAddressCreated -*/ -type UpdateShipmentDestinationAddressCreated struct { - - /* - In: Body - */ - Payload *primemessages.ShipmentAddressUpdate `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressCreated creates UpdateShipmentDestinationAddressCreated with default headers values -func NewUpdateShipmentDestinationAddressCreated() *UpdateShipmentDestinationAddressCreated { - - return &UpdateShipmentDestinationAddressCreated{} -} - -// WithPayload adds the payload to the update shipment destination address created response -func (o *UpdateShipmentDestinationAddressCreated) WithPayload(payload *primemessages.ShipmentAddressUpdate) *UpdateShipmentDestinationAddressCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address created response -func (o *UpdateShipmentDestinationAddressCreated) SetPayload(payload *primemessages.ShipmentAddressUpdate) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressBadRequestCode is the HTTP code returned for type UpdateShipmentDestinationAddressBadRequest -const UpdateShipmentDestinationAddressBadRequestCode int = 400 - -/* -UpdateShipmentDestinationAddressBadRequest The request payload is invalid. - -swagger:response updateShipmentDestinationAddressBadRequest -*/ -type UpdateShipmentDestinationAddressBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressBadRequest creates UpdateShipmentDestinationAddressBadRequest with default headers values -func NewUpdateShipmentDestinationAddressBadRequest() *UpdateShipmentDestinationAddressBadRequest { - - return &UpdateShipmentDestinationAddressBadRequest{} -} - -// WithPayload adds the payload to the update shipment destination address bad request response -func (o *UpdateShipmentDestinationAddressBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address bad request response -func (o *UpdateShipmentDestinationAddressBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressUnauthorizedCode is the HTTP code returned for type UpdateShipmentDestinationAddressUnauthorized -const UpdateShipmentDestinationAddressUnauthorizedCode int = 401 - -/* -UpdateShipmentDestinationAddressUnauthorized The request was denied. - -swagger:response updateShipmentDestinationAddressUnauthorized -*/ -type UpdateShipmentDestinationAddressUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressUnauthorized creates UpdateShipmentDestinationAddressUnauthorized with default headers values -func NewUpdateShipmentDestinationAddressUnauthorized() *UpdateShipmentDestinationAddressUnauthorized { - - return &UpdateShipmentDestinationAddressUnauthorized{} -} - -// WithPayload adds the payload to the update shipment destination address unauthorized response -func (o *UpdateShipmentDestinationAddressUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address unauthorized response -func (o *UpdateShipmentDestinationAddressUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressForbiddenCode is the HTTP code returned for type UpdateShipmentDestinationAddressForbidden -const UpdateShipmentDestinationAddressForbiddenCode int = 403 - -/* -UpdateShipmentDestinationAddressForbidden The request was denied. - -swagger:response updateShipmentDestinationAddressForbidden -*/ -type UpdateShipmentDestinationAddressForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressForbidden creates UpdateShipmentDestinationAddressForbidden with default headers values -func NewUpdateShipmentDestinationAddressForbidden() *UpdateShipmentDestinationAddressForbidden { - - return &UpdateShipmentDestinationAddressForbidden{} -} - -// WithPayload adds the payload to the update shipment destination address forbidden response -func (o *UpdateShipmentDestinationAddressForbidden) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address forbidden response -func (o *UpdateShipmentDestinationAddressForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressNotFoundCode is the HTTP code returned for type UpdateShipmentDestinationAddressNotFound -const UpdateShipmentDestinationAddressNotFoundCode int = 404 - -/* -UpdateShipmentDestinationAddressNotFound The requested resource wasn't found. - -swagger:response updateShipmentDestinationAddressNotFound -*/ -type UpdateShipmentDestinationAddressNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressNotFound creates UpdateShipmentDestinationAddressNotFound with default headers values -func NewUpdateShipmentDestinationAddressNotFound() *UpdateShipmentDestinationAddressNotFound { - - return &UpdateShipmentDestinationAddressNotFound{} -} - -// WithPayload adds the payload to the update shipment destination address not found response -func (o *UpdateShipmentDestinationAddressNotFound) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address not found response -func (o *UpdateShipmentDestinationAddressNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressConflictCode is the HTTP code returned for type UpdateShipmentDestinationAddressConflict -const UpdateShipmentDestinationAddressConflictCode int = 409 - -/* -UpdateShipmentDestinationAddressConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response updateShipmentDestinationAddressConflict -*/ -type UpdateShipmentDestinationAddressConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressConflict creates UpdateShipmentDestinationAddressConflict with default headers values -func NewUpdateShipmentDestinationAddressConflict() *UpdateShipmentDestinationAddressConflict { - - return &UpdateShipmentDestinationAddressConflict{} -} - -// WithPayload adds the payload to the update shipment destination address conflict response -func (o *UpdateShipmentDestinationAddressConflict) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address conflict response -func (o *UpdateShipmentDestinationAddressConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressPreconditionFailedCode is the HTTP code returned for type UpdateShipmentDestinationAddressPreconditionFailed -const UpdateShipmentDestinationAddressPreconditionFailedCode int = 412 - -/* -UpdateShipmentDestinationAddressPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateShipmentDestinationAddressPreconditionFailed -*/ -type UpdateShipmentDestinationAddressPreconditionFailed struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressPreconditionFailed creates UpdateShipmentDestinationAddressPreconditionFailed with default headers values -func NewUpdateShipmentDestinationAddressPreconditionFailed() *UpdateShipmentDestinationAddressPreconditionFailed { - - return &UpdateShipmentDestinationAddressPreconditionFailed{} -} - -// WithPayload adds the payload to the update shipment destination address precondition failed response -func (o *UpdateShipmentDestinationAddressPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address precondition failed response -func (o *UpdateShipmentDestinationAddressPreconditionFailed) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressUnprocessableEntityCode is the HTTP code returned for type UpdateShipmentDestinationAddressUnprocessableEntity -const UpdateShipmentDestinationAddressUnprocessableEntityCode int = 422 - -/* -UpdateShipmentDestinationAddressUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateShipmentDestinationAddressUnprocessableEntity -*/ -type UpdateShipmentDestinationAddressUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressUnprocessableEntity creates UpdateShipmentDestinationAddressUnprocessableEntity with default headers values -func NewUpdateShipmentDestinationAddressUnprocessableEntity() *UpdateShipmentDestinationAddressUnprocessableEntity { - - return &UpdateShipmentDestinationAddressUnprocessableEntity{} -} - -// WithPayload adds the payload to the update shipment destination address unprocessable entity response -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateShipmentDestinationAddressUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address unprocessable entity response -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateShipmentDestinationAddressInternalServerErrorCode is the HTTP code returned for type UpdateShipmentDestinationAddressInternalServerError -const UpdateShipmentDestinationAddressInternalServerErrorCode int = 500 - -/* -UpdateShipmentDestinationAddressInternalServerError A server error occurred. - -swagger:response updateShipmentDestinationAddressInternalServerError -*/ -type UpdateShipmentDestinationAddressInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewUpdateShipmentDestinationAddressInternalServerError creates UpdateShipmentDestinationAddressInternalServerError with default headers values -func NewUpdateShipmentDestinationAddressInternalServerError() *UpdateShipmentDestinationAddressInternalServerError { - - return &UpdateShipmentDestinationAddressInternalServerError{} -} - -// WithPayload adds the payload to the update shipment destination address internal server error response -func (o *UpdateShipmentDestinationAddressInternalServerError) WithPayload(payload *primemessages.Error) *UpdateShipmentDestinationAddressInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update shipment destination address internal server error response -func (o *UpdateShipmentDestinationAddressInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateShipmentDestinationAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go deleted file mode 100644 index 302bec38b03..00000000000 --- a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateShipmentDestinationAddressURL generates an URL for the update shipment destination address operation -type UpdateShipmentDestinationAddressURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateShipmentDestinationAddressURL) WithBasePath(bp string) *UpdateShipmentDestinationAddressURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateShipmentDestinationAddressURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateShipmentDestinationAddressURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/shipment-address-updates" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateShipmentDestinationAddressURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateShipmentDestinationAddressURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateShipmentDestinationAddressURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateShipmentDestinationAddressURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateShipmentDestinationAddressURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateShipmentDestinationAddressURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateShipmentDestinationAddressURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/mymove_api.go b/pkg/gen/primeapi/primeoperations/mymove_api.go deleted file mode 100644 index b9e44b2190c..00000000000 --- a/pkg/gen/primeapi/primeoperations/mymove_api.go +++ /dev/null @@ -1,558 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primeoperations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/payment_request" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - MultipartformConsumer: runtime.DiscardConsumer, - - BinProducer: runtime.ByteStreamProducer(), - JSONProducer: runtime.JSONProducer(), - - MoveTaskOrderCreateExcessWeightRecordHandler: move_task_order.CreateExcessWeightRecordHandlerFunc(func(params move_task_order.CreateExcessWeightRecordParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.CreateExcessWeightRecord has not yet been implemented") - }), - MtoShipmentCreateMTOAgentHandler: mto_shipment.CreateMTOAgentHandlerFunc(func(params mto_shipment.CreateMTOAgentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOAgent has not yet been implemented") - }), - MtoServiceItemCreateMTOServiceItemHandler: mto_service_item.CreateMTOServiceItemHandlerFunc(func(params mto_service_item.CreateMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.CreateMTOServiceItem has not yet been implemented") - }), - MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }), - PaymentRequestCreatePaymentRequestHandler: payment_request.CreatePaymentRequestHandlerFunc(func(params payment_request.CreatePaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.CreatePaymentRequest has not yet been implemented") - }), - MtoShipmentCreateSITExtensionHandler: mto_shipment.CreateSITExtensionHandlerFunc(func(params mto_shipment.CreateSITExtensionParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateSITExtension has not yet been implemented") - }), - MtoServiceItemCreateServiceRequestDocumentUploadHandler: mto_service_item.CreateServiceRequestDocumentUploadHandlerFunc(func(params mto_service_item.CreateServiceRequestDocumentUploadParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.CreateServiceRequestDocumentUpload has not yet been implemented") - }), - PaymentRequestCreateUploadHandler: payment_request.CreateUploadHandlerFunc(func(params payment_request.CreateUploadParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.CreateUpload has not yet been implemented") - }), - MtoShipmentDeleteMTOShipmentHandler: mto_shipment.DeleteMTOShipmentHandlerFunc(func(params mto_shipment.DeleteMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.DeleteMTOShipment has not yet been implemented") - }), - MoveTaskOrderDownloadMoveOrderHandler: move_task_order.DownloadMoveOrderHandlerFunc(func(params move_task_order.DownloadMoveOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.DownloadMoveOrder has not yet been implemented") - }), - MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }), - MoveTaskOrderListMovesHandler: move_task_order.ListMovesHandlerFunc(func(params move_task_order.ListMovesParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.ListMoves has not yet been implemented") - }), - MtoShipmentUpdateMTOAgentHandler: mto_shipment.UpdateMTOAgentHandlerFunc(func(params mto_shipment.UpdateMTOAgentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOAgent has not yet been implemented") - }), - MoveTaskOrderUpdateMTOPostCounselingInformationHandler: move_task_order.UpdateMTOPostCounselingInformationHandlerFunc(func(params move_task_order.UpdateMTOPostCounselingInformationParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.UpdateMTOPostCounselingInformation has not yet been implemented") - }), - MtoServiceItemUpdateMTOServiceItemHandler: mto_service_item.UpdateMTOServiceItemHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItem has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentAddressHandler: mto_shipment.UpdateMTOShipmentAddressHandlerFunc(func(params mto_shipment.UpdateMTOShipmentAddressParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentAddress has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentStatusHandler: mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") - }), - MtoShipmentUpdateReweighHandler: mto_shipment.UpdateReweighHandlerFunc(func(params mto_shipment.UpdateReweighParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateReweigh has not yet been implemented") - }), - MtoShipmentUpdateShipmentDestinationAddressHandler: mto_shipment.UpdateShipmentDestinationAddressHandlerFunc(func(params mto_shipment.UpdateShipmentDestinationAddressParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateShipmentDestinationAddress has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Prime API is a RESTful API that enables the Prime contractor to request -information about upcoming moves, update the details and status of those moves, -and make payment requests. It uses Mutual TLS for authentication procedures. - -All endpoints are located at `/prime/v1/`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - // MultipartformConsumer registers a consumer for the following mime types: - // - multipart/form-data - MultipartformConsumer runtime.Consumer - - // BinProducer registers a producer for the following mime types: - // - application/pdf - BinProducer runtime.Producer - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // MoveTaskOrderCreateExcessWeightRecordHandler sets the operation handler for the create excess weight record operation - MoveTaskOrderCreateExcessWeightRecordHandler move_task_order.CreateExcessWeightRecordHandler - // MtoShipmentCreateMTOAgentHandler sets the operation handler for the create m t o agent operation - MtoShipmentCreateMTOAgentHandler mto_shipment.CreateMTOAgentHandler - // MtoServiceItemCreateMTOServiceItemHandler sets the operation handler for the create m t o service item operation - MtoServiceItemCreateMTOServiceItemHandler mto_service_item.CreateMTOServiceItemHandler - // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation - MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler - // PaymentRequestCreatePaymentRequestHandler sets the operation handler for the create payment request operation - PaymentRequestCreatePaymentRequestHandler payment_request.CreatePaymentRequestHandler - // MtoShipmentCreateSITExtensionHandler sets the operation handler for the create s i t extension operation - MtoShipmentCreateSITExtensionHandler mto_shipment.CreateSITExtensionHandler - // MtoServiceItemCreateServiceRequestDocumentUploadHandler sets the operation handler for the create service request document upload operation - MtoServiceItemCreateServiceRequestDocumentUploadHandler mto_service_item.CreateServiceRequestDocumentUploadHandler - // PaymentRequestCreateUploadHandler sets the operation handler for the create upload operation - PaymentRequestCreateUploadHandler payment_request.CreateUploadHandler - // MtoShipmentDeleteMTOShipmentHandler sets the operation handler for the delete m t o shipment operation - MtoShipmentDeleteMTOShipmentHandler mto_shipment.DeleteMTOShipmentHandler - // MoveTaskOrderDownloadMoveOrderHandler sets the operation handler for the download move order operation - MoveTaskOrderDownloadMoveOrderHandler move_task_order.DownloadMoveOrderHandler - // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation - MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler - // MoveTaskOrderListMovesHandler sets the operation handler for the list moves operation - MoveTaskOrderListMovesHandler move_task_order.ListMovesHandler - // MtoShipmentUpdateMTOAgentHandler sets the operation handler for the update m t o agent operation - MtoShipmentUpdateMTOAgentHandler mto_shipment.UpdateMTOAgentHandler - // MoveTaskOrderUpdateMTOPostCounselingInformationHandler sets the operation handler for the update m t o post counseling information operation - MoveTaskOrderUpdateMTOPostCounselingInformationHandler move_task_order.UpdateMTOPostCounselingInformationHandler - // MtoServiceItemUpdateMTOServiceItemHandler sets the operation handler for the update m t o service item operation - MtoServiceItemUpdateMTOServiceItemHandler mto_service_item.UpdateMTOServiceItemHandler - // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation - MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler - // MtoShipmentUpdateMTOShipmentAddressHandler sets the operation handler for the update m t o shipment address operation - MtoShipmentUpdateMTOShipmentAddressHandler mto_shipment.UpdateMTOShipmentAddressHandler - // MtoShipmentUpdateMTOShipmentStatusHandler sets the operation handler for the update m t o shipment status operation - MtoShipmentUpdateMTOShipmentStatusHandler mto_shipment.UpdateMTOShipmentStatusHandler - // MtoShipmentUpdateReweighHandler sets the operation handler for the update reweigh operation - MtoShipmentUpdateReweighHandler mto_shipment.UpdateReweighHandler - // MtoShipmentUpdateShipmentDestinationAddressHandler sets the operation handler for the update shipment destination address operation - MtoShipmentUpdateShipmentDestinationAddressHandler mto_shipment.UpdateShipmentDestinationAddressHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - if o.MultipartformConsumer == nil { - unregistered = append(unregistered, "MultipartformConsumer") - } - - if o.BinProducer == nil { - unregistered = append(unregistered, "BinProducer") - } - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.MoveTaskOrderCreateExcessWeightRecordHandler == nil { - unregistered = append(unregistered, "move_task_order.CreateExcessWeightRecordHandler") - } - if o.MtoShipmentCreateMTOAgentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOAgentHandler") - } - if o.MtoServiceItemCreateMTOServiceItemHandler == nil { - unregistered = append(unregistered, "mto_service_item.CreateMTOServiceItemHandler") - } - if o.MtoShipmentCreateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") - } - if o.PaymentRequestCreatePaymentRequestHandler == nil { - unregistered = append(unregistered, "payment_request.CreatePaymentRequestHandler") - } - if o.MtoShipmentCreateSITExtensionHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateSITExtensionHandler") - } - if o.MtoServiceItemCreateServiceRequestDocumentUploadHandler == nil { - unregistered = append(unregistered, "mto_service_item.CreateServiceRequestDocumentUploadHandler") - } - if o.PaymentRequestCreateUploadHandler == nil { - unregistered = append(unregistered, "payment_request.CreateUploadHandler") - } - if o.MtoShipmentDeleteMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.DeleteMTOShipmentHandler") - } - if o.MoveTaskOrderDownloadMoveOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.DownloadMoveOrderHandler") - } - if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") - } - if o.MoveTaskOrderListMovesHandler == nil { - unregistered = append(unregistered, "move_task_order.ListMovesHandler") - } - if o.MtoShipmentUpdateMTOAgentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOAgentHandler") - } - if o.MoveTaskOrderUpdateMTOPostCounselingInformationHandler == nil { - unregistered = append(unregistered, "move_task_order.UpdateMTOPostCounselingInformationHandler") - } - if o.MtoServiceItemUpdateMTOServiceItemHandler == nil { - unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemHandler") - } - if o.MtoShipmentUpdateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") - } - if o.MtoShipmentUpdateMTOShipmentAddressHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentAddressHandler") - } - if o.MtoShipmentUpdateMTOShipmentStatusHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentStatusHandler") - } - if o.MtoShipmentUpdateReweighHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateReweighHandler") - } - if o.MtoShipmentUpdateShipmentDestinationAddressHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateShipmentDestinationAddressHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - case "multipart/form-data": - result["multipart/form-data"] = o.MultipartformConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/pdf": - result["application/pdf"] = o.BinProducer - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/move-task-orders/{moveTaskOrderID}/excess-weight-record"] = move_task_order.NewCreateExcessWeightRecord(o.context, o.MoveTaskOrderCreateExcessWeightRecordHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/agents"] = mto_shipment.NewCreateMTOAgent(o.context, o.MtoShipmentCreateMTOAgentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-service-items"] = mto_service_item.NewCreateMTOServiceItem(o.context, o.MtoServiceItemCreateMTOServiceItemHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/payment-requests"] = payment_request.NewCreatePaymentRequest(o.context, o.PaymentRequestCreatePaymentRequestHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/sit-extensions"] = mto_shipment.NewCreateSITExtension(o.context, o.MtoShipmentCreateSITExtensionHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-service-items/{mtoServiceItemID}/uploads"] = mto_service_item.NewCreateServiceRequestDocumentUpload(o.context, o.MtoServiceItemCreateServiceRequestDocumentUploadHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/payment-requests/{paymentRequestID}/uploads"] = payment_request.NewCreateUpload(o.context, o.PaymentRequestCreateUploadHandler) - if o.handlers["DELETE"] == nil { - o.handlers["DELETE"] = make(map[string]http.Handler) - } - o.handlers["DELETE"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewDeleteMTOShipment(o.context, o.MtoShipmentDeleteMTOShipmentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves/{locator}/documents"] = move_task_order.NewDownloadMoveOrder(o.context, o.MoveTaskOrderDownloadMoveOrderHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/moves"] = move_task_order.NewListMoves(o.context, o.MoveTaskOrderListMovesHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/mto-shipments/{mtoShipmentID}/agents/{agentID}"] = mto_shipment.NewUpdateMTOAgent(o.context, o.MtoShipmentUpdateMTOAgentHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/post-counseling-info"] = move_task_order.NewUpdateMTOPostCounselingInformation(o.context, o.MoveTaskOrderUpdateMTOPostCounselingInformationHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-service-items/{mtoServiceItemID}"] = mto_service_item.NewUpdateMTOServiceItem(o.context, o.MtoServiceItemUpdateMTOServiceItemHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) - if o.handlers["PUT"] == nil { - o.handlers["PUT"] = make(map[string]http.Handler) - } - o.handlers["PUT"]["/mto-shipments/{mtoShipmentID}/addresses/{addressID}"] = mto_shipment.NewUpdateMTOShipmentAddress(o.context, o.MtoShipmentUpdateMTOShipmentAddressHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/status"] = mto_shipment.NewUpdateMTOShipmentStatus(o.context, o.MtoShipmentUpdateMTOShipmentStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}"] = mto_shipment.NewUpdateReweigh(o.context, o.MtoShipmentUpdateReweighHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/shipment-address-updates"] = mto_shipment.NewUpdateShipmentDestinationAddress(o.context, o.MtoShipmentUpdateShipmentDestinationAddressHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go deleted file mode 100644 index d1ca6a38ab8..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go +++ /dev/null @@ -1,407 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreatePaymentRequestHandlerFunc turns a function with the right signature into a create payment request handler -type CreatePaymentRequestHandlerFunc func(CreatePaymentRequestParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreatePaymentRequestHandlerFunc) Handle(params CreatePaymentRequestParams) middleware.Responder { - return fn(params) -} - -// CreatePaymentRequestHandler interface for that can handle valid create payment request params -type CreatePaymentRequestHandler interface { - Handle(CreatePaymentRequestParams) middleware.Responder -} - -// NewCreatePaymentRequest creates a new http.Handler for the create payment request operation -func NewCreatePaymentRequest(ctx *middleware.Context, handler CreatePaymentRequestHandler) *CreatePaymentRequest { - return &CreatePaymentRequest{Context: ctx, Handler: handler} -} - -/* - CreatePaymentRequest swagger:route POST /payment-requests paymentRequest createPaymentRequest - -createPaymentRequest - -Creates a new instance of a paymentRequest and is assigned the status `PENDING`. -A move task order can have multiple payment requests, and -a final payment request can be marked using boolean `isFinal`. - -If a `PENDING` payment request is recalculated, -a new payment request is created and the original request is -marked with the status `DEPRECATED`. - -**NOTE**: In order to create a payment request for most service items, the shipment *must* -be updated with the `PrimeActualWeight` value via [updateMTOShipment](#operation/updateMTOShipment). - -If `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. - -**NOTE**: Diversions have a unique calcuation for payment requests without a `WeightBilled` parameter. - -If you created a payment request for a diversion and `WeightBilled` is not provided, then the following will be used in the calculation: -- The lowest shipment weight (`PrimeActualWeight`) found in the diverted shipment chain. -- The lowest reweigh weight found in the diverted shipment chain. - -The diverted shipment chain is created by referencing the `diversion` boolean, `divertedFromShipmentId` UUID, and matching destination to pickup addresses. -If the chain cannot be established it will fall back to the `PrimeActualWeight` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations. -The lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found. - -A service item can be on several payment requests in the case of partial payment requests and payments. - -In the request, if no params are necessary, then just the `serviceItem` `id` is required. For example: -```json - - { - "isFinal": false, - "moveTaskOrderID": "uuid", - "serviceItems": [ - { - "id": "uuid", - }, - { - "id": "uuid", - "params": [ - { - "key": "Service Item Parameter Name", - "value": "Service Item Parameter Value" - } - ] - } - ], - "pointOfContact": "string" - } - -``` - -Domestic Basic Service Items & Accepted Payment Request Parameters: ---- - -**DLH - Domestic Linehaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DSH - Domestic Shorthaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**FSC - Fuel Surcharge** -**NOTE**: FSC requires `ActualPickupDate` to be updated on the shipment. -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DUPK - Domestic Unpacking** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DPK - Domestic Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DNPK - Domestic NTS Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DPK - Domestic Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOP - Domestic Origin Price** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDP - Domestic Destination Price** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -Domestic SIT Service Items & Accepted Payment Request Parameters: ---- - -**DOFSIT - Domestic origin 1st day SIT** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* -*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - }, - { - "key": "SITPaymentRequestStart", - "value": "date" - }, - { - "key": "SITPaymentRequestEnd", - "value": "date" - } - ] - -``` - -**DOPSIT - Domestic origin SIT pickup** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOSHUT - Domestic origin shuttle service** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDFSIT - Domestic destination 1st day SIT** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* -*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - }, - { - "key": "SITPaymentRequestStart", - "value": "date" - }, - { - "key": "SITPaymentRequestEnd", - "value": "date" - } - ] - -``` - -**DDDSIT - Domestic destination SIT delivery** -*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDSHUT - Domestic destination shuttle service** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` ---- - -International Basic Service Items & Accepted Payment Request Parameters: ---- -Just like domestic shipments & service items, if `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. -**NOTE**: `POEFSC` & `PODFSC` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint. - -**ISLH - International Shipping & Linehaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**IHPK - International HHG Pack** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**IHUPK - International HHG Unpack** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**POEFSC - International Port of Embarkation Fuel Surcharge** - - **NOTE**: POEFSC requires `ActualPickupDate` to be updated on the shipment & `POELocation` on the service item. - -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**PODFSC - International Port of Debarkation Fuel Surcharge** -**NOTE**: PODFSC requires `ActualPickupDate` to be updated on the shipment & `PODLocation` on the service item. -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` ---- -*/ -type CreatePaymentRequest struct { - Context *middleware.Context - Handler CreatePaymentRequestHandler -} - -func (o *CreatePaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreatePaymentRequestParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go deleted file mode 100644 index a6f23bc54a9..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreatePaymentRequestParams creates a new CreatePaymentRequestParams object -// -// There are no default values defined in the spec. -func NewCreatePaymentRequestParams() CreatePaymentRequestParams { - - return CreatePaymentRequestParams{} -} - -// CreatePaymentRequestParams contains all the bound params for the create payment request operation -// typically these are obtained from a http.Request -// -// swagger:parameters createPaymentRequest -type CreatePaymentRequestParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *primemessages.CreatePaymentRequest -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreatePaymentRequestParams() beforehand. -func (o *CreatePaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primemessages.CreatePaymentRequest - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go deleted file mode 100644 index f0ceacac59b..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreatePaymentRequestCreatedCode is the HTTP code returned for type CreatePaymentRequestCreated -const CreatePaymentRequestCreatedCode int = 201 - -/* -CreatePaymentRequestCreated Successfully created a paymentRequest object. - -swagger:response createPaymentRequestCreated -*/ -type CreatePaymentRequestCreated struct { - - /* - In: Body - */ - Payload *primemessages.PaymentRequest `json:"body,omitempty"` -} - -// NewCreatePaymentRequestCreated creates CreatePaymentRequestCreated with default headers values -func NewCreatePaymentRequestCreated() *CreatePaymentRequestCreated { - - return &CreatePaymentRequestCreated{} -} - -// WithPayload adds the payload to the create payment request created response -func (o *CreatePaymentRequestCreated) WithPayload(payload *primemessages.PaymentRequest) *CreatePaymentRequestCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request created response -func (o *CreatePaymentRequestCreated) SetPayload(payload *primemessages.PaymentRequest) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestBadRequestCode is the HTTP code returned for type CreatePaymentRequestBadRequest -const CreatePaymentRequestBadRequestCode int = 400 - -/* -CreatePaymentRequestBadRequest Request payload is invalid. - -swagger:response createPaymentRequestBadRequest -*/ -type CreatePaymentRequestBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestBadRequest creates CreatePaymentRequestBadRequest with default headers values -func NewCreatePaymentRequestBadRequest() *CreatePaymentRequestBadRequest { - - return &CreatePaymentRequestBadRequest{} -} - -// WithPayload adds the payload to the create payment request bad request response -func (o *CreatePaymentRequestBadRequest) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request bad request response -func (o *CreatePaymentRequestBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestUnauthorizedCode is the HTTP code returned for type CreatePaymentRequestUnauthorized -const CreatePaymentRequestUnauthorizedCode int = 401 - -/* -CreatePaymentRequestUnauthorized The request was denied. - -swagger:response createPaymentRequestUnauthorized -*/ -type CreatePaymentRequestUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestUnauthorized creates CreatePaymentRequestUnauthorized with default headers values -func NewCreatePaymentRequestUnauthorized() *CreatePaymentRequestUnauthorized { - - return &CreatePaymentRequestUnauthorized{} -} - -// WithPayload adds the payload to the create payment request unauthorized response -func (o *CreatePaymentRequestUnauthorized) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request unauthorized response -func (o *CreatePaymentRequestUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestForbiddenCode is the HTTP code returned for type CreatePaymentRequestForbidden -const CreatePaymentRequestForbiddenCode int = 403 - -/* -CreatePaymentRequestForbidden The request was denied. - -swagger:response createPaymentRequestForbidden -*/ -type CreatePaymentRequestForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestForbidden creates CreatePaymentRequestForbidden with default headers values -func NewCreatePaymentRequestForbidden() *CreatePaymentRequestForbidden { - - return &CreatePaymentRequestForbidden{} -} - -// WithPayload adds the payload to the create payment request forbidden response -func (o *CreatePaymentRequestForbidden) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request forbidden response -func (o *CreatePaymentRequestForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestNotFoundCode is the HTTP code returned for type CreatePaymentRequestNotFound -const CreatePaymentRequestNotFoundCode int = 404 - -/* -CreatePaymentRequestNotFound The requested resource wasn't found. - -swagger:response createPaymentRequestNotFound -*/ -type CreatePaymentRequestNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestNotFound creates CreatePaymentRequestNotFound with default headers values -func NewCreatePaymentRequestNotFound() *CreatePaymentRequestNotFound { - - return &CreatePaymentRequestNotFound{} -} - -// WithPayload adds the payload to the create payment request not found response -func (o *CreatePaymentRequestNotFound) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request not found response -func (o *CreatePaymentRequestNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestConflictCode is the HTTP code returned for type CreatePaymentRequestConflict -const CreatePaymentRequestConflictCode int = 409 - -/* -CreatePaymentRequestConflict The request could not be processed because of conflict in the current state of the resource. - -swagger:response createPaymentRequestConflict -*/ -type CreatePaymentRequestConflict struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestConflict creates CreatePaymentRequestConflict with default headers values -func NewCreatePaymentRequestConflict() *CreatePaymentRequestConflict { - - return &CreatePaymentRequestConflict{} -} - -// WithPayload adds the payload to the create payment request conflict response -func (o *CreatePaymentRequestConflict) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request conflict response -func (o *CreatePaymentRequestConflict) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestUnprocessableEntityCode is the HTTP code returned for type CreatePaymentRequestUnprocessableEntity -const CreatePaymentRequestUnprocessableEntityCode int = 422 - -/* -CreatePaymentRequestUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createPaymentRequestUnprocessableEntity -*/ -type CreatePaymentRequestUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreatePaymentRequestUnprocessableEntity creates CreatePaymentRequestUnprocessableEntity with default headers values -func NewCreatePaymentRequestUnprocessableEntity() *CreatePaymentRequestUnprocessableEntity { - - return &CreatePaymentRequestUnprocessableEntity{} -} - -// WithPayload adds the payload to the create payment request unprocessable entity response -func (o *CreatePaymentRequestUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreatePaymentRequestUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request unprocessable entity response -func (o *CreatePaymentRequestUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreatePaymentRequestInternalServerErrorCode is the HTTP code returned for type CreatePaymentRequestInternalServerError -const CreatePaymentRequestInternalServerErrorCode int = 500 - -/* -CreatePaymentRequestInternalServerError A server error occurred. - -swagger:response createPaymentRequestInternalServerError -*/ -type CreatePaymentRequestInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreatePaymentRequestInternalServerError creates CreatePaymentRequestInternalServerError with default headers values -func NewCreatePaymentRequestInternalServerError() *CreatePaymentRequestInternalServerError { - - return &CreatePaymentRequestInternalServerError{} -} - -// WithPayload adds the payload to the create payment request internal server error response -func (o *CreatePaymentRequestInternalServerError) WithPayload(payload *primemessages.Error) *CreatePaymentRequestInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create payment request internal server error response -func (o *CreatePaymentRequestInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreatePaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go deleted file mode 100644 index 44a4e7cd0e6..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreatePaymentRequestURL generates an URL for the create payment request operation -type CreatePaymentRequestURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePaymentRequestURL) WithBasePath(bp string) *CreatePaymentRequestURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreatePaymentRequestURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreatePaymentRequestURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreatePaymentRequestURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreatePaymentRequestURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreatePaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreatePaymentRequestURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreatePaymentRequestURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreatePaymentRequestURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go deleted file mode 100644 index d12433e4846..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler -type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { - return fn(params) -} - -// CreateUploadHandler interface for that can handle valid create upload params -type CreateUploadHandler interface { - Handle(CreateUploadParams) middleware.Responder -} - -// NewCreateUpload creates a new http.Handler for the create upload operation -func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { - return &CreateUpload{Context: ctx, Handler: handler} -} - -/* - CreateUpload swagger:route POST /payment-requests/{paymentRequestID}/uploads paymentRequest createUpload - -createUpload - -### Functionality -This endpoint **uploads** a Proof of Service document for a PaymentRequest. - -The PaymentRequest should already exist. - -Optional key of **isWeightTicket** indicates if the document is a weight ticket or not. -This will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents. -If left empty, it will assume it is NOT a weight ticket. - -The formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request: - - ```json - { - "file": "filePath", - "isWeightTicket": true - } - ``` - If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty: - ```json - { - "file": "filePath", - "isWeightTicket": false - } - ``` - ```json - { - "file": "filePath", - } - ``` - -PaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint. -*/ -type CreateUpload struct { - Context *middleware.Context - Handler CreateUploadHandler -} - -func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateUploadParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go deleted file mode 100644 index 427d10fdd72..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go +++ /dev/null @@ -1,144 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "mime/multipart" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// CreateUploadMaxParseMemory sets the maximum size in bytes for -// the multipart form parser for this operation. -// -// The default value is 32 MB. -// The multipart parser stores up to this + 10MB. -var CreateUploadMaxParseMemory int64 = 32 << 20 - -// NewCreateUploadParams creates a new CreateUploadParams object -// -// There are no default values defined in the spec. -func NewCreateUploadParams() CreateUploadParams { - - return CreateUploadParams{} -} - -// CreateUploadParams contains all the bound params for the create upload operation -// typically these are obtained from a http.Request -// -// swagger:parameters createUpload -type CreateUploadParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The file to upload. - Required: true - In: formData - */ - File io.ReadCloser - /*Indicates whether the file is a weight ticket. - In: formData - */ - IsWeightTicket *bool - /*UUID of payment request to use. - Required: true - In: path - */ - PaymentRequestID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. -func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { - if err != http.ErrNotMultipart { - return errors.New(400, "%v", err) - } else if err := r.ParseForm(); err != nil { - return errors.New(400, "%v", err) - } - } - fds := runtime.Values(r.Form) - - file, fileHeader, err := r.FormFile("file") - if err != nil { - res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) - } else if err := o.bindFile(file, fileHeader); err != nil { - // Required: true - res = append(res, err) - } else { - o.File = &runtime.File{Data: file, Header: fileHeader} - } - - fdIsWeightTicket, fdhkIsWeightTicket, _ := fds.GetOK("isWeightTicket") - if err := o.bindIsWeightTicket(fdIsWeightTicket, fdhkIsWeightTicket, route.Formats); err != nil { - res = append(res, err) - } - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindFile binds file parameter File. -// -// The only supported validations on files are MinLength and MaxLength -func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { - return nil -} - -// bindIsWeightTicket binds and validates parameter IsWeightTicket from formData. -func (o *CreateUploadParams) bindIsWeightTicket(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertBool(raw) - if err != nil { - return errors.InvalidType("isWeightTicket", "formData", "bool", raw) - } - o.IsWeightTicket = &value - - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *CreateUploadParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.PaymentRequestID = raw - - return nil -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go deleted file mode 100644 index 77840f7e5de..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated -const CreateUploadCreatedCode int = 201 - -/* -CreateUploadCreated Successfully created upload of digital file. - -swagger:response createUploadCreated -*/ -type CreateUploadCreated struct { - - /* - In: Body - */ - Payload *primemessages.UploadWithOmissions `json:"body,omitempty"` -} - -// NewCreateUploadCreated creates CreateUploadCreated with default headers values -func NewCreateUploadCreated() *CreateUploadCreated { - - return &CreateUploadCreated{} -} - -// WithPayload adds the payload to the create upload created response -func (o *CreateUploadCreated) WithPayload(payload *primemessages.UploadWithOmissions) *CreateUploadCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload created response -func (o *CreateUploadCreated) SetPayload(payload *primemessages.UploadWithOmissions) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest -const CreateUploadBadRequestCode int = 400 - -/* -CreateUploadBadRequest The request payload is invalid. - -swagger:response createUploadBadRequest -*/ -type CreateUploadBadRequest struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values -func NewCreateUploadBadRequest() *CreateUploadBadRequest { - - return &CreateUploadBadRequest{} -} - -// WithPayload adds the payload to the create upload bad request response -func (o *CreateUploadBadRequest) WithPayload(payload *primemessages.ClientError) *CreateUploadBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload bad request response -func (o *CreateUploadBadRequest) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadUnauthorizedCode is the HTTP code returned for type CreateUploadUnauthorized -const CreateUploadUnauthorizedCode int = 401 - -/* -CreateUploadUnauthorized The request was denied. - -swagger:response createUploadUnauthorized -*/ -type CreateUploadUnauthorized struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateUploadUnauthorized creates CreateUploadUnauthorized with default headers values -func NewCreateUploadUnauthorized() *CreateUploadUnauthorized { - - return &CreateUploadUnauthorized{} -} - -// WithPayload adds the payload to the create upload unauthorized response -func (o *CreateUploadUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateUploadUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload unauthorized response -func (o *CreateUploadUnauthorized) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden -const CreateUploadForbiddenCode int = 403 - -/* -CreateUploadForbidden The request was denied. - -swagger:response createUploadForbidden -*/ -type CreateUploadForbidden struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values -func NewCreateUploadForbidden() *CreateUploadForbidden { - - return &CreateUploadForbidden{} -} - -// WithPayload adds the payload to the create upload forbidden response -func (o *CreateUploadForbidden) WithPayload(payload *primemessages.ClientError) *CreateUploadForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload forbidden response -func (o *CreateUploadForbidden) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound -const CreateUploadNotFoundCode int = 404 - -/* -CreateUploadNotFound The requested resource wasn't found. - -swagger:response createUploadNotFound -*/ -type CreateUploadNotFound struct { - - /* - In: Body - */ - Payload *primemessages.ClientError `json:"body,omitempty"` -} - -// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values -func NewCreateUploadNotFound() *CreateUploadNotFound { - - return &CreateUploadNotFound{} -} - -// WithPayload adds the payload to the create upload not found response -func (o *CreateUploadNotFound) WithPayload(payload *primemessages.ClientError) *CreateUploadNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload not found response -func (o *CreateUploadNotFound) SetPayload(payload *primemessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadUnprocessableEntityCode is the HTTP code returned for type CreateUploadUnprocessableEntity -const CreateUploadUnprocessableEntityCode int = 422 - -/* -CreateUploadUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createUploadUnprocessableEntity -*/ -type CreateUploadUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primemessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateUploadUnprocessableEntity creates CreateUploadUnprocessableEntity with default headers values -func NewCreateUploadUnprocessableEntity() *CreateUploadUnprocessableEntity { - - return &CreateUploadUnprocessableEntity{} -} - -// WithPayload adds the payload to the create upload unprocessable entity response -func (o *CreateUploadUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateUploadUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload unprocessable entity response -func (o *CreateUploadUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError -const CreateUploadInternalServerErrorCode int = 500 - -/* -CreateUploadInternalServerError A server error occurred. - -swagger:response createUploadInternalServerError -*/ -type CreateUploadInternalServerError struct { - - /* - In: Body - */ - Payload *primemessages.Error `json:"body,omitempty"` -} - -// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values -func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { - - return &CreateUploadInternalServerError{} -} - -// WithPayload adds the payload to the create upload internal server error response -func (o *CreateUploadInternalServerError) WithPayload(payload *primemessages.Error) *CreateUploadInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create upload internal server error response -func (o *CreateUploadInternalServerError) SetPayload(payload *primemessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go deleted file mode 100644 index 183790a648d..00000000000 --- a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// CreateUploadURL generates an URL for the create upload operation -type CreateUploadURL struct { - PaymentRequestID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateUploadURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateUploadURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/uploads" - - paymentRequestID := o.PaymentRequestID - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on CreateUploadURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateUploadURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateUploadURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateUploadURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateUploadURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primeapi/server.go b/pkg/gen/primeapi/server.go deleted file mode 100644 index a03d46dfb32..00000000000 --- a/pkg/gen/primeapi/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primeapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *primeoperations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *primeoperations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *primeoperations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go deleted file mode 100644 index f43b2ab2556..00000000000 --- a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateExcessWeightRecordParams creates a new CreateExcessWeightRecordParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateExcessWeightRecordParams() *CreateExcessWeightRecordParams { - return &CreateExcessWeightRecordParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateExcessWeightRecordParamsWithTimeout creates a new CreateExcessWeightRecordParams object -// with the ability to set a timeout on a request. -func NewCreateExcessWeightRecordParamsWithTimeout(timeout time.Duration) *CreateExcessWeightRecordParams { - return &CreateExcessWeightRecordParams{ - timeout: timeout, - } -} - -// NewCreateExcessWeightRecordParamsWithContext creates a new CreateExcessWeightRecordParams object -// with the ability to set a context for a request. -func NewCreateExcessWeightRecordParamsWithContext(ctx context.Context) *CreateExcessWeightRecordParams { - return &CreateExcessWeightRecordParams{ - Context: ctx, - } -} - -// NewCreateExcessWeightRecordParamsWithHTTPClient creates a new CreateExcessWeightRecordParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateExcessWeightRecordParamsWithHTTPClient(client *http.Client) *CreateExcessWeightRecordParams { - return &CreateExcessWeightRecordParams{ - HTTPClient: client, - } -} - -/* -CreateExcessWeightRecordParams contains all the parameters to send to the API endpoint - - for the create excess weight record operation. - - Typically these are written to a http.Request. -*/ -type CreateExcessWeightRecordParams struct { - - /* File. - - The file to upload. - */ - File runtime.NamedReadCloser - - /* MoveTaskOrderID. - - UUID of the move being updated. - - Format: uuid - */ - MoveTaskOrderID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create excess weight record params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateExcessWeightRecordParams) WithDefaults() *CreateExcessWeightRecordParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create excess weight record params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateExcessWeightRecordParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create excess weight record params -func (o *CreateExcessWeightRecordParams) WithTimeout(timeout time.Duration) *CreateExcessWeightRecordParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create excess weight record params -func (o *CreateExcessWeightRecordParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create excess weight record params -func (o *CreateExcessWeightRecordParams) WithContext(ctx context.Context) *CreateExcessWeightRecordParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create excess weight record params -func (o *CreateExcessWeightRecordParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create excess weight record params -func (o *CreateExcessWeightRecordParams) WithHTTPClient(client *http.Client) *CreateExcessWeightRecordParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create excess weight record params -func (o *CreateExcessWeightRecordParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFile adds the file to the create excess weight record params -func (o *CreateExcessWeightRecordParams) WithFile(file runtime.NamedReadCloser) *CreateExcessWeightRecordParams { - o.SetFile(file) - return o -} - -// SetFile adds the file to the create excess weight record params -func (o *CreateExcessWeightRecordParams) SetFile(file runtime.NamedReadCloser) { - o.File = file -} - -// WithMoveTaskOrderID adds the moveTaskOrderID to the create excess weight record params -func (o *CreateExcessWeightRecordParams) WithMoveTaskOrderID(moveTaskOrderID strfmt.UUID) *CreateExcessWeightRecordParams { - o.SetMoveTaskOrderID(moveTaskOrderID) - return o -} - -// SetMoveTaskOrderID adds the moveTaskOrderId to the create excess weight record params -func (o *CreateExcessWeightRecordParams) SetMoveTaskOrderID(moveTaskOrderID strfmt.UUID) { - o.MoveTaskOrderID = moveTaskOrderID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateExcessWeightRecordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - // form file param file - if err := r.SetFileParam("file", o.File); err != nil { - return err - } - - // path param moveTaskOrderID - if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go deleted file mode 100644 index 6a258392730..00000000000 --- a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateExcessWeightRecordReader is a Reader for the CreateExcessWeightRecord structure. -type CreateExcessWeightRecordReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateExcessWeightRecordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateExcessWeightRecordCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewCreateExcessWeightRecordUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateExcessWeightRecordForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateExcessWeightRecordNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateExcessWeightRecordUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateExcessWeightRecordInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record] createExcessWeightRecord", response, response.Code()) - } -} - -// NewCreateExcessWeightRecordCreated creates a CreateExcessWeightRecordCreated with default headers values -func NewCreateExcessWeightRecordCreated() *CreateExcessWeightRecordCreated { - return &CreateExcessWeightRecordCreated{} -} - -/* -CreateExcessWeightRecordCreated describes a response with status code 201, with default header values. - -Successfully uploaded the excess weight record file. -*/ -type CreateExcessWeightRecordCreated struct { - Payload *primemessages.ExcessWeightRecord -} - -// IsSuccess returns true when this create excess weight record created response has a 2xx status code -func (o *CreateExcessWeightRecordCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create excess weight record created response has a 3xx status code -func (o *CreateExcessWeightRecordCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record created response has a 4xx status code -func (o *CreateExcessWeightRecordCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create excess weight record created response has a 5xx status code -func (o *CreateExcessWeightRecordCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create excess weight record created response a status code equal to that given -func (o *CreateExcessWeightRecordCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create excess weight record created response -func (o *CreateExcessWeightRecordCreated) Code() int { - return 201 -} - -func (o *CreateExcessWeightRecordCreated) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordCreated %+v", 201, o.Payload) -} - -func (o *CreateExcessWeightRecordCreated) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordCreated %+v", 201, o.Payload) -} - -func (o *CreateExcessWeightRecordCreated) GetPayload() *primemessages.ExcessWeightRecord { - return o.Payload -} - -func (o *CreateExcessWeightRecordCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ExcessWeightRecord) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExcessWeightRecordUnauthorized creates a CreateExcessWeightRecordUnauthorized with default headers values -func NewCreateExcessWeightRecordUnauthorized() *CreateExcessWeightRecordUnauthorized { - return &CreateExcessWeightRecordUnauthorized{} -} - -/* -CreateExcessWeightRecordUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateExcessWeightRecordUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create excess weight record unauthorized response has a 2xx status code -func (o *CreateExcessWeightRecordUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create excess weight record unauthorized response has a 3xx status code -func (o *CreateExcessWeightRecordUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record unauthorized response has a 4xx status code -func (o *CreateExcessWeightRecordUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create excess weight record unauthorized response has a 5xx status code -func (o *CreateExcessWeightRecordUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create excess weight record unauthorized response a status code equal to that given -func (o *CreateExcessWeightRecordUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create excess weight record unauthorized response -func (o *CreateExcessWeightRecordUnauthorized) Code() int { - return 401 -} - -func (o *CreateExcessWeightRecordUnauthorized) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateExcessWeightRecordUnauthorized) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateExcessWeightRecordUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateExcessWeightRecordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExcessWeightRecordForbidden creates a CreateExcessWeightRecordForbidden with default headers values -func NewCreateExcessWeightRecordForbidden() *CreateExcessWeightRecordForbidden { - return &CreateExcessWeightRecordForbidden{} -} - -/* -CreateExcessWeightRecordForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateExcessWeightRecordForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create excess weight record forbidden response has a 2xx status code -func (o *CreateExcessWeightRecordForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create excess weight record forbidden response has a 3xx status code -func (o *CreateExcessWeightRecordForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record forbidden response has a 4xx status code -func (o *CreateExcessWeightRecordForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create excess weight record forbidden response has a 5xx status code -func (o *CreateExcessWeightRecordForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create excess weight record forbidden response a status code equal to that given -func (o *CreateExcessWeightRecordForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create excess weight record forbidden response -func (o *CreateExcessWeightRecordForbidden) Code() int { - return 403 -} - -func (o *CreateExcessWeightRecordForbidden) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordForbidden %+v", 403, o.Payload) -} - -func (o *CreateExcessWeightRecordForbidden) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordForbidden %+v", 403, o.Payload) -} - -func (o *CreateExcessWeightRecordForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateExcessWeightRecordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExcessWeightRecordNotFound creates a CreateExcessWeightRecordNotFound with default headers values -func NewCreateExcessWeightRecordNotFound() *CreateExcessWeightRecordNotFound { - return &CreateExcessWeightRecordNotFound{} -} - -/* -CreateExcessWeightRecordNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateExcessWeightRecordNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create excess weight record not found response has a 2xx status code -func (o *CreateExcessWeightRecordNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create excess weight record not found response has a 3xx status code -func (o *CreateExcessWeightRecordNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record not found response has a 4xx status code -func (o *CreateExcessWeightRecordNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create excess weight record not found response has a 5xx status code -func (o *CreateExcessWeightRecordNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create excess weight record not found response a status code equal to that given -func (o *CreateExcessWeightRecordNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create excess weight record not found response -func (o *CreateExcessWeightRecordNotFound) Code() int { - return 404 -} - -func (o *CreateExcessWeightRecordNotFound) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordNotFound %+v", 404, o.Payload) -} - -func (o *CreateExcessWeightRecordNotFound) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordNotFound %+v", 404, o.Payload) -} - -func (o *CreateExcessWeightRecordNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateExcessWeightRecordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExcessWeightRecordUnprocessableEntity creates a CreateExcessWeightRecordUnprocessableEntity with default headers values -func NewCreateExcessWeightRecordUnprocessableEntity() *CreateExcessWeightRecordUnprocessableEntity { - return &CreateExcessWeightRecordUnprocessableEntity{} -} - -/* -CreateExcessWeightRecordUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateExcessWeightRecordUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create excess weight record unprocessable entity response has a 2xx status code -func (o *CreateExcessWeightRecordUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create excess weight record unprocessable entity response has a 3xx status code -func (o *CreateExcessWeightRecordUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record unprocessable entity response has a 4xx status code -func (o *CreateExcessWeightRecordUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create excess weight record unprocessable entity response has a 5xx status code -func (o *CreateExcessWeightRecordUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create excess weight record unprocessable entity response a status code equal to that given -func (o *CreateExcessWeightRecordUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create excess weight record unprocessable entity response -func (o *CreateExcessWeightRecordUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateExcessWeightRecordUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateExcessWeightRecordUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateExcessWeightRecordUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateExcessWeightRecordUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateExcessWeightRecordInternalServerError creates a CreateExcessWeightRecordInternalServerError with default headers values -func NewCreateExcessWeightRecordInternalServerError() *CreateExcessWeightRecordInternalServerError { - return &CreateExcessWeightRecordInternalServerError{} -} - -/* -CreateExcessWeightRecordInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateExcessWeightRecordInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create excess weight record internal server error response has a 2xx status code -func (o *CreateExcessWeightRecordInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create excess weight record internal server error response has a 3xx status code -func (o *CreateExcessWeightRecordInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create excess weight record internal server error response has a 4xx status code -func (o *CreateExcessWeightRecordInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create excess weight record internal server error response has a 5xx status code -func (o *CreateExcessWeightRecordInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create excess weight record internal server error response a status code equal to that given -func (o *CreateExcessWeightRecordInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create excess weight record internal server error response -func (o *CreateExcessWeightRecordInternalServerError) Code() int { - return 500 -} - -func (o *CreateExcessWeightRecordInternalServerError) Error() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateExcessWeightRecordInternalServerError) String() string { - return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateExcessWeightRecordInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateExcessWeightRecordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go b/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go deleted file mode 100644 index 842c81f7830..00000000000 --- a/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go +++ /dev/null @@ -1,198 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDownloadMoveOrderParams creates a new DownloadMoveOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDownloadMoveOrderParams() *DownloadMoveOrderParams { - return &DownloadMoveOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDownloadMoveOrderParamsWithTimeout creates a new DownloadMoveOrderParams object -// with the ability to set a timeout on a request. -func NewDownloadMoveOrderParamsWithTimeout(timeout time.Duration) *DownloadMoveOrderParams { - return &DownloadMoveOrderParams{ - timeout: timeout, - } -} - -// NewDownloadMoveOrderParamsWithContext creates a new DownloadMoveOrderParams object -// with the ability to set a context for a request. -func NewDownloadMoveOrderParamsWithContext(ctx context.Context) *DownloadMoveOrderParams { - return &DownloadMoveOrderParams{ - Context: ctx, - } -} - -// NewDownloadMoveOrderParamsWithHTTPClient creates a new DownloadMoveOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewDownloadMoveOrderParamsWithHTTPClient(client *http.Client) *DownloadMoveOrderParams { - return &DownloadMoveOrderParams{ - HTTPClient: client, - } -} - -/* -DownloadMoveOrderParams contains all the parameters to send to the API endpoint - - for the download move order operation. - - Typically these are written to a http.Request. -*/ -type DownloadMoveOrderParams struct { - - /* Locator. - - the locator code for move order to be downloaded - */ - Locator string - - /* Type. - - upload type - - Default: "ALL" - */ - Type *string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the download move order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DownloadMoveOrderParams) WithDefaults() *DownloadMoveOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the download move order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DownloadMoveOrderParams) SetDefaults() { - var ( - typeVarDefault = string("ALL") - ) - - val := DownloadMoveOrderParams{ - Type: &typeVarDefault, - } - - val.timeout = o.timeout - val.Context = o.Context - val.HTTPClient = o.HTTPClient - *o = val -} - -// WithTimeout adds the timeout to the download move order params -func (o *DownloadMoveOrderParams) WithTimeout(timeout time.Duration) *DownloadMoveOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the download move order params -func (o *DownloadMoveOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the download move order params -func (o *DownloadMoveOrderParams) WithContext(ctx context.Context) *DownloadMoveOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the download move order params -func (o *DownloadMoveOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the download move order params -func (o *DownloadMoveOrderParams) WithHTTPClient(client *http.Client) *DownloadMoveOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the download move order params -func (o *DownloadMoveOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithLocator adds the locator to the download move order params -func (o *DownloadMoveOrderParams) WithLocator(locator string) *DownloadMoveOrderParams { - o.SetLocator(locator) - return o -} - -// SetLocator adds the locator to the download move order params -func (o *DownloadMoveOrderParams) SetLocator(locator string) { - o.Locator = locator -} - -// WithType adds the typeVar to the download move order params -func (o *DownloadMoveOrderParams) WithType(typeVar *string) *DownloadMoveOrderParams { - o.SetType(typeVar) - return o -} - -// SetType adds the type to the download move order params -func (o *DownloadMoveOrderParams) SetType(typeVar *string) { - o.Type = typeVar -} - -// WriteToRequest writes these params to a swagger request -func (o *DownloadMoveOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param locator - if err := r.SetPathParam("locator", o.Locator); err != nil { - return err - } - - if o.Type != nil { - - // query param type - var qrType string - - if o.Type != nil { - qrType = *o.Type - } - qType := qrType - if qType != "" { - - if err := r.SetQueryParam("type", qType); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/download_move_order_responses.go b/pkg/gen/primeclient/move_task_order/download_move_order_responses.go deleted file mode 100644 index d1e099f4715..00000000000 --- a/pkg/gen/primeclient/move_task_order/download_move_order_responses.go +++ /dev/null @@ -1,487 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// DownloadMoveOrderReader is a Reader for the DownloadMoveOrder structure. -type DownloadMoveOrderReader struct { - formats strfmt.Registry - writer io.Writer -} - -// ReadResponse reads a server response into the received o. -func (o *DownloadMoveOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewDownloadMoveOrderOK(o.writer) - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDownloadMoveOrderBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDownloadMoveOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDownloadMoveOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewDownloadMoveOrderUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDownloadMoveOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /moves/{locator}/documents] downloadMoveOrder", response, response.Code()) - } -} - -// NewDownloadMoveOrderOK creates a DownloadMoveOrderOK with default headers values -func NewDownloadMoveOrderOK(writer io.Writer) *DownloadMoveOrderOK { - return &DownloadMoveOrderOK{ - - Payload: writer, - } -} - -/* -DownloadMoveOrderOK describes a response with status code 200, with default header values. - -Move Order PDF -*/ -type DownloadMoveOrderOK struct { - - /* File name to download - */ - ContentDisposition string - - Payload io.Writer -} - -// IsSuccess returns true when this download move order o k response has a 2xx status code -func (o *DownloadMoveOrderOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this download move order o k response has a 3xx status code -func (o *DownloadMoveOrderOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order o k response has a 4xx status code -func (o *DownloadMoveOrderOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this download move order o k response has a 5xx status code -func (o *DownloadMoveOrderOK) IsServerError() bool { - return false -} - -// IsCode returns true when this download move order o k response a status code equal to that given -func (o *DownloadMoveOrderOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the download move order o k response -func (o *DownloadMoveOrderOK) Code() int { - return 200 -} - -func (o *DownloadMoveOrderOK) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderOK %+v", 200, o.Payload) -} - -func (o *DownloadMoveOrderOK) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderOK %+v", 200, o.Payload) -} - -func (o *DownloadMoveOrderOK) GetPayload() io.Writer { - return o.Payload -} - -func (o *DownloadMoveOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // hydrates response header Content-Disposition - hdrContentDisposition := response.GetHeader("Content-Disposition") - - if hdrContentDisposition != "" { - o.ContentDisposition = hdrContentDisposition - } - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDownloadMoveOrderBadRequest creates a DownloadMoveOrderBadRequest with default headers values -func NewDownloadMoveOrderBadRequest() *DownloadMoveOrderBadRequest { - return &DownloadMoveOrderBadRequest{} -} - -/* -DownloadMoveOrderBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type DownloadMoveOrderBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this download move order bad request response has a 2xx status code -func (o *DownloadMoveOrderBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this download move order bad request response has a 3xx status code -func (o *DownloadMoveOrderBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order bad request response has a 4xx status code -func (o *DownloadMoveOrderBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this download move order bad request response has a 5xx status code -func (o *DownloadMoveOrderBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this download move order bad request response a status code equal to that given -func (o *DownloadMoveOrderBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the download move order bad request response -func (o *DownloadMoveOrderBadRequest) Code() int { - return 400 -} - -func (o *DownloadMoveOrderBadRequest) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderBadRequest %+v", 400, o.Payload) -} - -func (o *DownloadMoveOrderBadRequest) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderBadRequest %+v", 400, o.Payload) -} - -func (o *DownloadMoveOrderBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DownloadMoveOrderBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDownloadMoveOrderForbidden creates a DownloadMoveOrderForbidden with default headers values -func NewDownloadMoveOrderForbidden() *DownloadMoveOrderForbidden { - return &DownloadMoveOrderForbidden{} -} - -/* -DownloadMoveOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type DownloadMoveOrderForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this download move order forbidden response has a 2xx status code -func (o *DownloadMoveOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this download move order forbidden response has a 3xx status code -func (o *DownloadMoveOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order forbidden response has a 4xx status code -func (o *DownloadMoveOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this download move order forbidden response has a 5xx status code -func (o *DownloadMoveOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this download move order forbidden response a status code equal to that given -func (o *DownloadMoveOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the download move order forbidden response -func (o *DownloadMoveOrderForbidden) Code() int { - return 403 -} - -func (o *DownloadMoveOrderForbidden) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderForbidden %+v", 403, o.Payload) -} - -func (o *DownloadMoveOrderForbidden) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderForbidden %+v", 403, o.Payload) -} - -func (o *DownloadMoveOrderForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DownloadMoveOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDownloadMoveOrderNotFound creates a DownloadMoveOrderNotFound with default headers values -func NewDownloadMoveOrderNotFound() *DownloadMoveOrderNotFound { - return &DownloadMoveOrderNotFound{} -} - -/* -DownloadMoveOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type DownloadMoveOrderNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this download move order not found response has a 2xx status code -func (o *DownloadMoveOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this download move order not found response has a 3xx status code -func (o *DownloadMoveOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order not found response has a 4xx status code -func (o *DownloadMoveOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this download move order not found response has a 5xx status code -func (o *DownloadMoveOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this download move order not found response a status code equal to that given -func (o *DownloadMoveOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the download move order not found response -func (o *DownloadMoveOrderNotFound) Code() int { - return 404 -} - -func (o *DownloadMoveOrderNotFound) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderNotFound %+v", 404, o.Payload) -} - -func (o *DownloadMoveOrderNotFound) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderNotFound %+v", 404, o.Payload) -} - -func (o *DownloadMoveOrderNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DownloadMoveOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDownloadMoveOrderUnprocessableEntity creates a DownloadMoveOrderUnprocessableEntity with default headers values -func NewDownloadMoveOrderUnprocessableEntity() *DownloadMoveOrderUnprocessableEntity { - return &DownloadMoveOrderUnprocessableEntity{} -} - -/* -DownloadMoveOrderUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type DownloadMoveOrderUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this download move order unprocessable entity response has a 2xx status code -func (o *DownloadMoveOrderUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this download move order unprocessable entity response has a 3xx status code -func (o *DownloadMoveOrderUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order unprocessable entity response has a 4xx status code -func (o *DownloadMoveOrderUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this download move order unprocessable entity response has a 5xx status code -func (o *DownloadMoveOrderUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this download move order unprocessable entity response a status code equal to that given -func (o *DownloadMoveOrderUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the download move order unprocessable entity response -func (o *DownloadMoveOrderUnprocessableEntity) Code() int { - return 422 -} - -func (o *DownloadMoveOrderUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *DownloadMoveOrderUnprocessableEntity) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *DownloadMoveOrderUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *DownloadMoveOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDownloadMoveOrderInternalServerError creates a DownloadMoveOrderInternalServerError with default headers values -func NewDownloadMoveOrderInternalServerError() *DownloadMoveOrderInternalServerError { - return &DownloadMoveOrderInternalServerError{} -} - -/* -DownloadMoveOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type DownloadMoveOrderInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this download move order internal server error response has a 2xx status code -func (o *DownloadMoveOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this download move order internal server error response has a 3xx status code -func (o *DownloadMoveOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this download move order internal server error response has a 4xx status code -func (o *DownloadMoveOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this download move order internal server error response has a 5xx status code -func (o *DownloadMoveOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this download move order internal server error response a status code equal to that given -func (o *DownloadMoveOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the download move order internal server error response -func (o *DownloadMoveOrderInternalServerError) Code() int { - return 500 -} - -func (o *DownloadMoveOrderInternalServerError) Error() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *DownloadMoveOrderInternalServerError) String() string { - return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *DownloadMoveOrderInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *DownloadMoveOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index e6dea099e1e..00000000000 --- a/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object -// with the ability to set a timeout on a request. -func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: timeout, - } -} - -// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object -// with the ability to set a context for a request. -func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - Context: ctx, - } -} - -// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - HTTPClient: client, - } -} - -/* -GetMoveTaskOrderParams contains all the parameters to send to the API endpoint - - for the get move task order operation. - - Typically these are written to a http.Request. -*/ -type GetMoveTaskOrderParams struct { - - /* MoveID. - - UUID or MoveCode of move task order to use. - */ - MoveID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMoveID adds the moveID to the get move task order params -func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { - o.SetMoveID(moveID) - return o -} - -// SetMoveID adds the moveId to the get move task order params -func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { - o.MoveID = moveID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param moveID - if err := r.SetPathParam("moveID", o.MoveID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go b/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 9c305610df2..00000000000 --- a/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. -type GetMoveTaskOrderReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetMoveTaskOrderOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetMoveTaskOrderUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetMoveTaskOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetMoveTaskOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetMoveTaskOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) - } -} - -// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - return &GetMoveTaskOrderOK{} -} - -/* -GetMoveTaskOrderOK describes a response with status code 200, with default header values. - -Successfully retrieve an individual move task order. -*/ -type GetMoveTaskOrderOK struct { - Payload *primemessages.MoveTaskOrder -} - -// IsSuccess returns true when this get move task order o k response has a 2xx status code -func (o *GetMoveTaskOrderOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get move task order o k response has a 3xx status code -func (o *GetMoveTaskOrderOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order o k response has a 4xx status code -func (o *GetMoveTaskOrderOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order o k response has a 5xx status code -func (o *GetMoveTaskOrderOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order o k response a status code equal to that given -func (o *GetMoveTaskOrderOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get move task order o k response -func (o *GetMoveTaskOrderOK) Code() int { - return 200 -} - -func (o *GetMoveTaskOrderOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) GetPayload() *primemessages.MoveTaskOrder { - return o.Payload -} - -func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - return &GetMoveTaskOrderUnauthorized{} -} - -/* -GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code -func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code -func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order unauthorized response has a 4xx status code -func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order unauthorized response has a 5xx status code -func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order unauthorized response a status code equal to that given -func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) Code() int { - return 401 -} - -func (o *GetMoveTaskOrderUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - return &GetMoveTaskOrderForbidden{} -} - -/* -GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this get move task order forbidden response has a 2xx status code -func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order forbidden response has a 3xx status code -func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order forbidden response has a 4xx status code -func (o *GetMoveTaskOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order forbidden response has a 5xx status code -func (o *GetMoveTaskOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order forbidden response a status code equal to that given -func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) Code() int { - return 403 -} - -func (o *GetMoveTaskOrderForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - return &GetMoveTaskOrderNotFound{} -} - -/* -GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type GetMoveTaskOrderNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this get move task order not found response has a 2xx status code -func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order not found response has a 3xx status code -func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order not found response has a 4xx status code -func (o *GetMoveTaskOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order not found response has a 5xx status code -func (o *GetMoveTaskOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order not found response a status code equal to that given -func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get move task order not found response -func (o *GetMoveTaskOrderNotFound) Code() int { - return 404 -} - -func (o *GetMoveTaskOrderNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - return &GetMoveTaskOrderInternalServerError{} -} - -/* -GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type GetMoveTaskOrderInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this get move task order internal server error response has a 2xx status code -func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order internal server error response has a 3xx status code -func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order internal server error response has a 4xx status code -func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order internal server error response has a 5xx status code -func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get move task order internal server error response a status code equal to that given -func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) Code() int { - return 500 -} - -func (o *GetMoveTaskOrderInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/list_moves_parameters.go b/pkg/gen/primeclient/move_task_order/list_moves_parameters.go deleted file mode 100644 index 3a2cad3aaec..00000000000 --- a/pkg/gen/primeclient/move_task_order/list_moves_parameters.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListMovesParams creates a new ListMovesParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListMovesParams() *ListMovesParams { - return &ListMovesParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListMovesParamsWithTimeout creates a new ListMovesParams object -// with the ability to set a timeout on a request. -func NewListMovesParamsWithTimeout(timeout time.Duration) *ListMovesParams { - return &ListMovesParams{ - timeout: timeout, - } -} - -// NewListMovesParamsWithContext creates a new ListMovesParams object -// with the ability to set a context for a request. -func NewListMovesParamsWithContext(ctx context.Context) *ListMovesParams { - return &ListMovesParams{ - Context: ctx, - } -} - -// NewListMovesParamsWithHTTPClient creates a new ListMovesParams object -// with the ability to set a custom HTTPClient for a request. -func NewListMovesParamsWithHTTPClient(client *http.Client) *ListMovesParams { - return &ListMovesParams{ - HTTPClient: client, - } -} - -/* -ListMovesParams contains all the parameters to send to the API endpoint - - for the list moves operation. - - Typically these are written to a http.Request. -*/ -type ListMovesParams struct { - - /* Since. - - Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" - - Format: date-time - */ - Since *strfmt.DateTime - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list moves params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMovesParams) WithDefaults() *ListMovesParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list moves params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMovesParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list moves params -func (o *ListMovesParams) WithTimeout(timeout time.Duration) *ListMovesParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list moves params -func (o *ListMovesParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list moves params -func (o *ListMovesParams) WithContext(ctx context.Context) *ListMovesParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list moves params -func (o *ListMovesParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list moves params -func (o *ListMovesParams) WithHTTPClient(client *http.Client) *ListMovesParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list moves params -func (o *ListMovesParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSince adds the since to the list moves params -func (o *ListMovesParams) WithSince(since *strfmt.DateTime) *ListMovesParams { - o.SetSince(since) - return o -} - -// SetSince adds the since to the list moves params -func (o *ListMovesParams) SetSince(since *strfmt.DateTime) { - o.Since = since -} - -// WriteToRequest writes these params to a swagger request -func (o *ListMovesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Since != nil { - - // query param since - var qrSince strfmt.DateTime - - if o.Since != nil { - qrSince = *o.Since - } - qSince := qrSince.String() - if qSince != "" { - - if err := r.SetQueryParam("since", qSince); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/list_moves_responses.go b/pkg/gen/primeclient/move_task_order/list_moves_responses.go deleted file mode 100644 index 3169c90996a..00000000000 --- a/pkg/gen/primeclient/move_task_order/list_moves_responses.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// ListMovesReader is a Reader for the ListMoves structure. -type ListMovesReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListMovesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListMovesOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewListMovesUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListMovesForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListMovesInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /moves] listMoves", response, response.Code()) - } -} - -// NewListMovesOK creates a ListMovesOK with default headers values -func NewListMovesOK() *ListMovesOK { - return &ListMovesOK{} -} - -/* -ListMovesOK describes a response with status code 200, with default header values. - -Successfully retrieved moves. A successful fetch might still return zero moves. -*/ -type ListMovesOK struct { - Payload primemessages.ListMoves -} - -// IsSuccess returns true when this list moves o k response has a 2xx status code -func (o *ListMovesOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list moves o k response has a 3xx status code -func (o *ListMovesOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list moves o k response has a 4xx status code -func (o *ListMovesOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list moves o k response has a 5xx status code -func (o *ListMovesOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list moves o k response a status code equal to that given -func (o *ListMovesOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list moves o k response -func (o *ListMovesOK) Code() int { - return 200 -} - -func (o *ListMovesOK) Error() string { - return fmt.Sprintf("[GET /moves][%d] listMovesOK %+v", 200, o.Payload) -} - -func (o *ListMovesOK) String() string { - return fmt.Sprintf("[GET /moves][%d] listMovesOK %+v", 200, o.Payload) -} - -func (o *ListMovesOK) GetPayload() primemessages.ListMoves { - return o.Payload -} - -func (o *ListMovesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMovesUnauthorized creates a ListMovesUnauthorized with default headers values -func NewListMovesUnauthorized() *ListMovesUnauthorized { - return &ListMovesUnauthorized{} -} - -/* -ListMovesUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type ListMovesUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this list moves unauthorized response has a 2xx status code -func (o *ListMovesUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list moves unauthorized response has a 3xx status code -func (o *ListMovesUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list moves unauthorized response has a 4xx status code -func (o *ListMovesUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list moves unauthorized response has a 5xx status code -func (o *ListMovesUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list moves unauthorized response a status code equal to that given -func (o *ListMovesUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list moves unauthorized response -func (o *ListMovesUnauthorized) Code() int { - return 401 -} - -func (o *ListMovesUnauthorized) Error() string { - return fmt.Sprintf("[GET /moves][%d] listMovesUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMovesUnauthorized) String() string { - return fmt.Sprintf("[GET /moves][%d] listMovesUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMovesUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *ListMovesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMovesForbidden creates a ListMovesForbidden with default headers values -func NewListMovesForbidden() *ListMovesForbidden { - return &ListMovesForbidden{} -} - -/* -ListMovesForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type ListMovesForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this list moves forbidden response has a 2xx status code -func (o *ListMovesForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list moves forbidden response has a 3xx status code -func (o *ListMovesForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list moves forbidden response has a 4xx status code -func (o *ListMovesForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list moves forbidden response has a 5xx status code -func (o *ListMovesForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list moves forbidden response a status code equal to that given -func (o *ListMovesForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list moves forbidden response -func (o *ListMovesForbidden) Code() int { - return 403 -} - -func (o *ListMovesForbidden) Error() string { - return fmt.Sprintf("[GET /moves][%d] listMovesForbidden %+v", 403, o.Payload) -} - -func (o *ListMovesForbidden) String() string { - return fmt.Sprintf("[GET /moves][%d] listMovesForbidden %+v", 403, o.Payload) -} - -func (o *ListMovesForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *ListMovesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMovesInternalServerError creates a ListMovesInternalServerError with default headers values -func NewListMovesInternalServerError() *ListMovesInternalServerError { - return &ListMovesInternalServerError{} -} - -/* -ListMovesInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type ListMovesInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this list moves internal server error response has a 2xx status code -func (o *ListMovesInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list moves internal server error response has a 3xx status code -func (o *ListMovesInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list moves internal server error response has a 4xx status code -func (o *ListMovesInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list moves internal server error response has a 5xx status code -func (o *ListMovesInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list moves internal server error response a status code equal to that given -func (o *ListMovesInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list moves internal server error response -func (o *ListMovesInternalServerError) Code() int { - return 500 -} - -func (o *ListMovesInternalServerError) Error() string { - return fmt.Sprintf("[GET /moves][%d] listMovesInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMovesInternalServerError) String() string { - return fmt.Sprintf("[GET /moves][%d] listMovesInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMovesInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *ListMovesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/move_task_order_client.go b/pkg/gen/primeclient/move_task_order/move_task_order_client.go deleted file mode 100644 index b1d0d6c8a1b..00000000000 --- a/pkg/gen/primeclient/move_task_order/move_task_order_client.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" -) - -// New creates a new move task order API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for move task order API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateExcessWeightRecord(params *CreateExcessWeightRecordParams, opts ...ClientOption) (*CreateExcessWeightRecordCreated, error) - - DownloadMoveOrder(params *DownloadMoveOrderParams, writer io.Writer, opts ...ClientOption) (*DownloadMoveOrderOK, error) - - GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) - - ListMoves(params *ListMovesParams, opts ...ClientOption) (*ListMovesOK, error) - - UpdateMTOPostCounselingInformation(params *UpdateMTOPostCounselingInformationParams, opts ...ClientOption) (*UpdateMTOPostCounselingInformationOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateExcessWeightRecord creates excess weight record - -Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold. -*/ -func (a *Client) CreateExcessWeightRecord(params *CreateExcessWeightRecordParams, opts ...ClientOption) (*CreateExcessWeightRecordCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateExcessWeightRecordParams() - } - op := &runtime.ClientOperation{ - ID: "createExcessWeightRecord", - Method: "POST", - PathPattern: "/move-task-orders/{moveTaskOrderID}/excess-weight-record", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateExcessWeightRecordReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateExcessWeightRecordCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createExcessWeightRecord: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DownloadMoveOrder downloads move order as a p d f - - ### Functionality - -This endpoint downloads all uploaded move order documentations into one download file by locator. - -### Errors -* The move must be in need counseling state. -* The move client's origin duty location must not currently have gov counseling. -*/ -func (a *Client) DownloadMoveOrder(params *DownloadMoveOrderParams, writer io.Writer, opts ...ClientOption) (*DownloadMoveOrderOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDownloadMoveOrderParams() - } - op := &runtime.ClientOperation{ - ID: "downloadMoveOrder", - Method: "GET", - PathPattern: "/moves/{locator}/documents", - ProducesMediaTypes: []string{"application/pdf"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DownloadMoveOrderReader{formats: a.formats, writer: writer}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DownloadMoveOrderOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for downloadMoveOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetMoveTaskOrder gets move task order - - ### Functionality - -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMoveTaskOrderParams() - } - op := &runtime.ClientOperation{ - ID: "getMoveTaskOrder", - Method: "GET", - PathPattern: "/move-task-orders/{moveID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetMoveTaskOrderReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetMoveTaskOrderOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListMoves lists moves - - Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this - -list down to only the moves that have been updated since the provided timestamp. A move will be considered -updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment -requests, is later than the provided date and time. - -**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has -been set, that move will always appear in this list. -*/ -func (a *Client) ListMoves(params *ListMovesParams, opts ...ClientOption) (*ListMovesOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListMovesParams() - } - op := &runtime.ClientOperation{ - ID: "listMoves", - Method: "GET", - PathPattern: "/moves", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListMovesReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListMovesOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listMoves: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOPostCounselingInformation updates m t o post counseling information - - ### Functionality - -This endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling. -This update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update. -No body object is expected for this request. - -**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs. - -**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer. -*/ -func (a *Client) UpdateMTOPostCounselingInformation(params *UpdateMTOPostCounselingInformationParams, opts ...ClientOption) (*UpdateMTOPostCounselingInformationOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOPostCounselingInformationParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOPostCounselingInformation", - Method: "PATCH", - PathPattern: "/move-task-orders/{moveTaskOrderID}/post-counseling-info", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOPostCounselingInformationReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOPostCounselingInformationOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOPostCounselingInformation: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go deleted file mode 100644 index 4f3b94a8bf4..00000000000 --- a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateMTOPostCounselingInformationParams creates a new UpdateMTOPostCounselingInformationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOPostCounselingInformationParams() *UpdateMTOPostCounselingInformationParams { - return &UpdateMTOPostCounselingInformationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOPostCounselingInformationParamsWithTimeout creates a new UpdateMTOPostCounselingInformationParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOPostCounselingInformationParamsWithTimeout(timeout time.Duration) *UpdateMTOPostCounselingInformationParams { - return &UpdateMTOPostCounselingInformationParams{ - timeout: timeout, - } -} - -// NewUpdateMTOPostCounselingInformationParamsWithContext creates a new UpdateMTOPostCounselingInformationParams object -// with the ability to set a context for a request. -func NewUpdateMTOPostCounselingInformationParamsWithContext(ctx context.Context) *UpdateMTOPostCounselingInformationParams { - return &UpdateMTOPostCounselingInformationParams{ - Context: ctx, - } -} - -// NewUpdateMTOPostCounselingInformationParamsWithHTTPClient creates a new UpdateMTOPostCounselingInformationParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOPostCounselingInformationParamsWithHTTPClient(client *http.Client) *UpdateMTOPostCounselingInformationParams { - return &UpdateMTOPostCounselingInformationParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOPostCounselingInformationParams contains all the parameters to send to the API endpoint - - for the update m t o post counseling information operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOPostCounselingInformationParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - /* MoveTaskOrderID. - - ID of move task order to use. - */ - MoveTaskOrderID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o post counseling information params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOPostCounselingInformationParams) WithDefaults() *UpdateMTOPostCounselingInformationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o post counseling information params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOPostCounselingInformationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) WithTimeout(timeout time.Duration) *UpdateMTOPostCounselingInformationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) WithContext(ctx context.Context) *UpdateMTOPostCounselingInformationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) WithHTTPClient(client *http.Client) *UpdateMTOPostCounselingInformationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) WithIfMatch(ifMatch string) *UpdateMTOPostCounselingInformationParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithMoveTaskOrderID adds the moveTaskOrderID to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) WithMoveTaskOrderID(moveTaskOrderID string) *UpdateMTOPostCounselingInformationParams { - o.SetMoveTaskOrderID(moveTaskOrderID) - return o -} - -// SetMoveTaskOrderID adds the moveTaskOrderId to the update m t o post counseling information params -func (o *UpdateMTOPostCounselingInformationParams) SetMoveTaskOrderID(moveTaskOrderID string) { - o.MoveTaskOrderID = moveTaskOrderID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOPostCounselingInformationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - - // path param moveTaskOrderID - if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go deleted file mode 100644 index 400317d24eb..00000000000 --- a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOPostCounselingInformationReader is a Reader for the UpdateMTOPostCounselingInformation structure. -type UpdateMTOPostCounselingInformationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOPostCounselingInformationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOPostCounselingInformationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewUpdateMTOPostCounselingInformationUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOPostCounselingInformationForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOPostCounselingInformationNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOPostCounselingInformationConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOPostCounselingInformationPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOPostCounselingInformationUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOPostCounselingInformationInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info] updateMTOPostCounselingInformation", response, response.Code()) - } -} - -// NewUpdateMTOPostCounselingInformationOK creates a UpdateMTOPostCounselingInformationOK with default headers values -func NewUpdateMTOPostCounselingInformationOK() *UpdateMTOPostCounselingInformationOK { - return &UpdateMTOPostCounselingInformationOK{} -} - -/* -UpdateMTOPostCounselingInformationOK describes a response with status code 200, with default header values. - -Successfully updated move task order with post counseling information. -*/ -type UpdateMTOPostCounselingInformationOK struct { - Payload *primemessages.MoveTaskOrder -} - -// IsSuccess returns true when this update m t o post counseling information o k response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o post counseling information o k response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information o k response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o post counseling information o k response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information o k response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o post counseling information o k response -func (o *UpdateMTOPostCounselingInformationOK) Code() int { - return 200 -} - -func (o *UpdateMTOPostCounselingInformationOK) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationOK) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationOK) GetPayload() *primemessages.MoveTaskOrder { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationUnauthorized creates a UpdateMTOPostCounselingInformationUnauthorized with default headers values -func NewUpdateMTOPostCounselingInformationUnauthorized() *UpdateMTOPostCounselingInformationUnauthorized { - return &UpdateMTOPostCounselingInformationUnauthorized{} -} - -/* -UpdateMTOPostCounselingInformationUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOPostCounselingInformationUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o post counseling information unauthorized response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information unauthorized response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information unauthorized response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information unauthorized response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information unauthorized response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o post counseling information unauthorized response -func (o *UpdateMTOPostCounselingInformationUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOPostCounselingInformationUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationUnauthorized) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationForbidden creates a UpdateMTOPostCounselingInformationForbidden with default headers values -func NewUpdateMTOPostCounselingInformationForbidden() *UpdateMTOPostCounselingInformationForbidden { - return &UpdateMTOPostCounselingInformationForbidden{} -} - -/* -UpdateMTOPostCounselingInformationForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOPostCounselingInformationForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o post counseling information forbidden response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information forbidden response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information forbidden response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information forbidden response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information forbidden response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o post counseling information forbidden response -func (o *UpdateMTOPostCounselingInformationForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOPostCounselingInformationForbidden) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationForbidden) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationNotFound creates a UpdateMTOPostCounselingInformationNotFound with default headers values -func NewUpdateMTOPostCounselingInformationNotFound() *UpdateMTOPostCounselingInformationNotFound { - return &UpdateMTOPostCounselingInformationNotFound{} -} - -/* -UpdateMTOPostCounselingInformationNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOPostCounselingInformationNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o post counseling information not found response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information not found response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information not found response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information not found response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information not found response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o post counseling information not found response -func (o *UpdateMTOPostCounselingInformationNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOPostCounselingInformationNotFound) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationNotFound) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationConflict creates a UpdateMTOPostCounselingInformationConflict with default headers values -func NewUpdateMTOPostCounselingInformationConflict() *UpdateMTOPostCounselingInformationConflict { - return &UpdateMTOPostCounselingInformationConflict{} -} - -/* -UpdateMTOPostCounselingInformationConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateMTOPostCounselingInformationConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o post counseling information conflict response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information conflict response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information conflict response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information conflict response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information conflict response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o post counseling information conflict response -func (o *UpdateMTOPostCounselingInformationConflict) Code() int { - return 409 -} - -func (o *UpdateMTOPostCounselingInformationConflict) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationConflict) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationPreconditionFailed creates a UpdateMTOPostCounselingInformationPreconditionFailed with default headers values -func NewUpdateMTOPostCounselingInformationPreconditionFailed() *UpdateMTOPostCounselingInformationPreconditionFailed { - return &UpdateMTOPostCounselingInformationPreconditionFailed{} -} - -/* -UpdateMTOPostCounselingInformationPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOPostCounselingInformationPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o post counseling information precondition failed response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information precondition failed response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information precondition failed response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information precondition failed response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information precondition failed response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o post counseling information precondition failed response -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationUnprocessableEntity creates a UpdateMTOPostCounselingInformationUnprocessableEntity with default headers values -func NewUpdateMTOPostCounselingInformationUnprocessableEntity() *UpdateMTOPostCounselingInformationUnprocessableEntity { - return &UpdateMTOPostCounselingInformationUnprocessableEntity{} -} - -/* -UpdateMTOPostCounselingInformationUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOPostCounselingInformationUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update m t o post counseling information unprocessable entity response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information unprocessable entity response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information unprocessable entity response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o post counseling information unprocessable entity response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o post counseling information unprocessable entity response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o post counseling information unprocessable entity response -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOPostCounselingInformationInternalServerError creates a UpdateMTOPostCounselingInformationInternalServerError with default headers values -func NewUpdateMTOPostCounselingInformationInternalServerError() *UpdateMTOPostCounselingInformationInternalServerError { - return &UpdateMTOPostCounselingInformationInternalServerError{} -} - -/* -UpdateMTOPostCounselingInformationInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOPostCounselingInformationInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update m t o post counseling information internal server error response has a 2xx status code -func (o *UpdateMTOPostCounselingInformationInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o post counseling information internal server error response has a 3xx status code -func (o *UpdateMTOPostCounselingInformationInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o post counseling information internal server error response has a 4xx status code -func (o *UpdateMTOPostCounselingInformationInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o post counseling information internal server error response has a 5xx status code -func (o *UpdateMTOPostCounselingInformationInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o post counseling information internal server error response a status code equal to that given -func (o *UpdateMTOPostCounselingInformationInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o post counseling information internal server error response -func (o *UpdateMTOPostCounselingInformationInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOPostCounselingInformationInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationInternalServerError) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOPostCounselingInformationInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateMTOPostCounselingInformationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go deleted file mode 100644 index 506f1266c00..00000000000 --- a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateMTOServiceItemParams creates a new CreateMTOServiceItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMTOServiceItemParams() *CreateMTOServiceItemParams { - return &CreateMTOServiceItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMTOServiceItemParamsWithTimeout creates a new CreateMTOServiceItemParams object -// with the ability to set a timeout on a request. -func NewCreateMTOServiceItemParamsWithTimeout(timeout time.Duration) *CreateMTOServiceItemParams { - return &CreateMTOServiceItemParams{ - timeout: timeout, - } -} - -// NewCreateMTOServiceItemParamsWithContext creates a new CreateMTOServiceItemParams object -// with the ability to set a context for a request. -func NewCreateMTOServiceItemParamsWithContext(ctx context.Context) *CreateMTOServiceItemParams { - return &CreateMTOServiceItemParams{ - Context: ctx, - } -} - -// NewCreateMTOServiceItemParamsWithHTTPClient creates a new CreateMTOServiceItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMTOServiceItemParamsWithHTTPClient(client *http.Client) *CreateMTOServiceItemParams { - return &CreateMTOServiceItemParams{ - HTTPClient: client, - } -} - -/* -CreateMTOServiceItemParams contains all the parameters to send to the API endpoint - - for the create m t o service item operation. - - Typically these are written to a http.Request. -*/ -type CreateMTOServiceItemParams struct { - - // Body. - Body primemessages.MTOServiceItem - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create m t o service item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOServiceItemParams) WithDefaults() *CreateMTOServiceItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create m t o service item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOServiceItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create m t o service item params -func (o *CreateMTOServiceItemParams) WithTimeout(timeout time.Duration) *CreateMTOServiceItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create m t o service item params -func (o *CreateMTOServiceItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create m t o service item params -func (o *CreateMTOServiceItemParams) WithContext(ctx context.Context) *CreateMTOServiceItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create m t o service item params -func (o *CreateMTOServiceItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create m t o service item params -func (o *CreateMTOServiceItemParams) WithHTTPClient(client *http.Client) *CreateMTOServiceItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create m t o service item params -func (o *CreateMTOServiceItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create m t o service item params -func (o *CreateMTOServiceItemParams) WithBody(body primemessages.MTOServiceItem) *CreateMTOServiceItemParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create m t o service item params -func (o *CreateMTOServiceItemParams) SetBody(body primemessages.MTOServiceItem) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMTOServiceItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go deleted file mode 100644 index e8752fe9b90..00000000000 --- a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateMTOServiceItemReader is a Reader for the CreateMTOServiceItem structure. -type CreateMTOServiceItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMTOServiceItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMTOServiceItemOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateMTOServiceItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateMTOServiceItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateMTOServiceItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMTOServiceItemNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateMTOServiceItemConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateMTOServiceItemUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateMTOServiceItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-service-items] createMTOServiceItem", response, response.Code()) - } -} - -// NewCreateMTOServiceItemOK creates a CreateMTOServiceItemOK with default headers values -func NewCreateMTOServiceItemOK() *CreateMTOServiceItemOK { - return &CreateMTOServiceItemOK{} -} - -/* -CreateMTOServiceItemOK describes a response with status code 200, with default header values. - -Successfully created an MTO service item. -*/ -type CreateMTOServiceItemOK struct { - Payload []primemessages.MTOServiceItem -} - -// IsSuccess returns true when this create m t o service item o k response has a 2xx status code -func (o *CreateMTOServiceItemOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create m t o service item o k response has a 3xx status code -func (o *CreateMTOServiceItemOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item o k response has a 4xx status code -func (o *CreateMTOServiceItemOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o service item o k response has a 5xx status code -func (o *CreateMTOServiceItemOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item o k response a status code equal to that given -func (o *CreateMTOServiceItemOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create m t o service item o k response -func (o *CreateMTOServiceItemOK) Code() int { - return 200 -} - -func (o *CreateMTOServiceItemOK) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemOK %+v", 200, o.Payload) -} - -func (o *CreateMTOServiceItemOK) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemOK %+v", 200, o.Payload) -} - -func (o *CreateMTOServiceItemOK) GetPayload() []primemessages.MTOServiceItem { - return o.Payload -} - -func (o *CreateMTOServiceItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload as interface type - payload, err := primemessages.UnmarshalMTOServiceItemSlice(response.Body(), consumer) - if err != nil { - return err - } - o.Payload = payload - - return nil -} - -// NewCreateMTOServiceItemBadRequest creates a CreateMTOServiceItemBadRequest with default headers values -func NewCreateMTOServiceItemBadRequest() *CreateMTOServiceItemBadRequest { - return &CreateMTOServiceItemBadRequest{} -} - -/* -CreateMTOServiceItemBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateMTOServiceItemBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o service item bad request response has a 2xx status code -func (o *CreateMTOServiceItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item bad request response has a 3xx status code -func (o *CreateMTOServiceItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item bad request response has a 4xx status code -func (o *CreateMTOServiceItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item bad request response has a 5xx status code -func (o *CreateMTOServiceItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item bad request response a status code equal to that given -func (o *CreateMTOServiceItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create m t o service item bad request response -func (o *CreateMTOServiceItemBadRequest) Code() int { - return 400 -} - -func (o *CreateMTOServiceItemBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOServiceItemBadRequest) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOServiceItemBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOServiceItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemUnauthorized creates a CreateMTOServiceItemUnauthorized with default headers values -func NewCreateMTOServiceItemUnauthorized() *CreateMTOServiceItemUnauthorized { - return &CreateMTOServiceItemUnauthorized{} -} - -/* -CreateMTOServiceItemUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateMTOServiceItemUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o service item unauthorized response has a 2xx status code -func (o *CreateMTOServiceItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item unauthorized response has a 3xx status code -func (o *CreateMTOServiceItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item unauthorized response has a 4xx status code -func (o *CreateMTOServiceItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item unauthorized response has a 5xx status code -func (o *CreateMTOServiceItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item unauthorized response a status code equal to that given -func (o *CreateMTOServiceItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create m t o service item unauthorized response -func (o *CreateMTOServiceItemUnauthorized) Code() int { - return 401 -} - -func (o *CreateMTOServiceItemUnauthorized) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMTOServiceItemUnauthorized) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMTOServiceItemUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOServiceItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemForbidden creates a CreateMTOServiceItemForbidden with default headers values -func NewCreateMTOServiceItemForbidden() *CreateMTOServiceItemForbidden { - return &CreateMTOServiceItemForbidden{} -} - -/* -CreateMTOServiceItemForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateMTOServiceItemForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o service item forbidden response has a 2xx status code -func (o *CreateMTOServiceItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item forbidden response has a 3xx status code -func (o *CreateMTOServiceItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item forbidden response has a 4xx status code -func (o *CreateMTOServiceItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item forbidden response has a 5xx status code -func (o *CreateMTOServiceItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item forbidden response a status code equal to that given -func (o *CreateMTOServiceItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create m t o service item forbidden response -func (o *CreateMTOServiceItemForbidden) Code() int { - return 403 -} - -func (o *CreateMTOServiceItemForbidden) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemForbidden %+v", 403, o.Payload) -} - -func (o *CreateMTOServiceItemForbidden) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemForbidden %+v", 403, o.Payload) -} - -func (o *CreateMTOServiceItemForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOServiceItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemNotFound creates a CreateMTOServiceItemNotFound with default headers values -func NewCreateMTOServiceItemNotFound() *CreateMTOServiceItemNotFound { - return &CreateMTOServiceItemNotFound{} -} - -/* -CreateMTOServiceItemNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateMTOServiceItemNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o service item not found response has a 2xx status code -func (o *CreateMTOServiceItemNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item not found response has a 3xx status code -func (o *CreateMTOServiceItemNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item not found response has a 4xx status code -func (o *CreateMTOServiceItemNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item not found response has a 5xx status code -func (o *CreateMTOServiceItemNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item not found response a status code equal to that given -func (o *CreateMTOServiceItemNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create m t o service item not found response -func (o *CreateMTOServiceItemNotFound) Code() int { - return 404 -} - -func (o *CreateMTOServiceItemNotFound) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOServiceItemNotFound) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOServiceItemNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOServiceItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemConflict creates a CreateMTOServiceItemConflict with default headers values -func NewCreateMTOServiceItemConflict() *CreateMTOServiceItemConflict { - return &CreateMTOServiceItemConflict{} -} - -/* -CreateMTOServiceItemConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type CreateMTOServiceItemConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o service item conflict response has a 2xx status code -func (o *CreateMTOServiceItemConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item conflict response has a 3xx status code -func (o *CreateMTOServiceItemConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item conflict response has a 4xx status code -func (o *CreateMTOServiceItemConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item conflict response has a 5xx status code -func (o *CreateMTOServiceItemConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item conflict response a status code equal to that given -func (o *CreateMTOServiceItemConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create m t o service item conflict response -func (o *CreateMTOServiceItemConflict) Code() int { - return 409 -} - -func (o *CreateMTOServiceItemConflict) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemConflict %+v", 409, o.Payload) -} - -func (o *CreateMTOServiceItemConflict) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemConflict %+v", 409, o.Payload) -} - -func (o *CreateMTOServiceItemConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOServiceItemConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemUnprocessableEntity creates a CreateMTOServiceItemUnprocessableEntity with default headers values -func NewCreateMTOServiceItemUnprocessableEntity() *CreateMTOServiceItemUnprocessableEntity { - return &CreateMTOServiceItemUnprocessableEntity{} -} - -/* -CreateMTOServiceItemUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateMTOServiceItemUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create m t o service item unprocessable entity response has a 2xx status code -func (o *CreateMTOServiceItemUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item unprocessable entity response has a 3xx status code -func (o *CreateMTOServiceItemUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item unprocessable entity response has a 4xx status code -func (o *CreateMTOServiceItemUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o service item unprocessable entity response has a 5xx status code -func (o *CreateMTOServiceItemUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o service item unprocessable entity response a status code equal to that given -func (o *CreateMTOServiceItemUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create m t o service item unprocessable entity response -func (o *CreateMTOServiceItemUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateMTOServiceItemUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOServiceItemUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOServiceItemUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateMTOServiceItemUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOServiceItemInternalServerError creates a CreateMTOServiceItemInternalServerError with default headers values -func NewCreateMTOServiceItemInternalServerError() *CreateMTOServiceItemInternalServerError { - return &CreateMTOServiceItemInternalServerError{} -} - -/* -CreateMTOServiceItemInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateMTOServiceItemInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create m t o service item internal server error response has a 2xx status code -func (o *CreateMTOServiceItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o service item internal server error response has a 3xx status code -func (o *CreateMTOServiceItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o service item internal server error response has a 4xx status code -func (o *CreateMTOServiceItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o service item internal server error response has a 5xx status code -func (o *CreateMTOServiceItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create m t o service item internal server error response a status code equal to that given -func (o *CreateMTOServiceItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create m t o service item internal server error response -func (o *CreateMTOServiceItemInternalServerError) Code() int { - return 500 -} - -func (o *CreateMTOServiceItemInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOServiceItemInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOServiceItemInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateMTOServiceItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go deleted file mode 100644 index 28def5694bf..00000000000 --- a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateServiceRequestDocumentUploadParams creates a new CreateServiceRequestDocumentUploadParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateServiceRequestDocumentUploadParams() *CreateServiceRequestDocumentUploadParams { - return &CreateServiceRequestDocumentUploadParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateServiceRequestDocumentUploadParamsWithTimeout creates a new CreateServiceRequestDocumentUploadParams object -// with the ability to set a timeout on a request. -func NewCreateServiceRequestDocumentUploadParamsWithTimeout(timeout time.Duration) *CreateServiceRequestDocumentUploadParams { - return &CreateServiceRequestDocumentUploadParams{ - timeout: timeout, - } -} - -// NewCreateServiceRequestDocumentUploadParamsWithContext creates a new CreateServiceRequestDocumentUploadParams object -// with the ability to set a context for a request. -func NewCreateServiceRequestDocumentUploadParamsWithContext(ctx context.Context) *CreateServiceRequestDocumentUploadParams { - return &CreateServiceRequestDocumentUploadParams{ - Context: ctx, - } -} - -// NewCreateServiceRequestDocumentUploadParamsWithHTTPClient creates a new CreateServiceRequestDocumentUploadParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateServiceRequestDocumentUploadParamsWithHTTPClient(client *http.Client) *CreateServiceRequestDocumentUploadParams { - return &CreateServiceRequestDocumentUploadParams{ - HTTPClient: client, - } -} - -/* -CreateServiceRequestDocumentUploadParams contains all the parameters to send to the API endpoint - - for the create service request document upload operation. - - Typically these are written to a http.Request. -*/ -type CreateServiceRequestDocumentUploadParams struct { - - /* File. - - The file to upload. - */ - File runtime.NamedReadCloser - - /* MtoServiceItemID. - - UUID of the service item to use. - */ - MtoServiceItemID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create service request document upload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceRequestDocumentUploadParams) WithDefaults() *CreateServiceRequestDocumentUploadParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create service request document upload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateServiceRequestDocumentUploadParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) WithTimeout(timeout time.Duration) *CreateServiceRequestDocumentUploadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) WithContext(ctx context.Context) *CreateServiceRequestDocumentUploadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) WithHTTPClient(client *http.Client) *CreateServiceRequestDocumentUploadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFile adds the file to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) WithFile(file runtime.NamedReadCloser) *CreateServiceRequestDocumentUploadParams { - o.SetFile(file) - return o -} - -// SetFile adds the file to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) SetFile(file runtime.NamedReadCloser) { - o.File = file -} - -// WithMtoServiceItemID adds the mtoServiceItemID to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) WithMtoServiceItemID(mtoServiceItemID string) *CreateServiceRequestDocumentUploadParams { - o.SetMtoServiceItemID(mtoServiceItemID) - return o -} - -// SetMtoServiceItemID adds the mtoServiceItemId to the create service request document upload params -func (o *CreateServiceRequestDocumentUploadParams) SetMtoServiceItemID(mtoServiceItemID string) { - o.MtoServiceItemID = mtoServiceItemID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateServiceRequestDocumentUploadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - // form file param file - if err := r.SetFileParam("file", o.File); err != nil { - return err - } - - // path param mtoServiceItemID - if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go deleted file mode 100644 index 01110093943..00000000000 --- a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateServiceRequestDocumentUploadReader is a Reader for the CreateServiceRequestDocumentUpload structure. -type CreateServiceRequestDocumentUploadReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateServiceRequestDocumentUploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateServiceRequestDocumentUploadCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateServiceRequestDocumentUploadBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateServiceRequestDocumentUploadUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateServiceRequestDocumentUploadForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateServiceRequestDocumentUploadNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateServiceRequestDocumentUploadUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateServiceRequestDocumentUploadInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-service-items/{mtoServiceItemID}/uploads] createServiceRequestDocumentUpload", response, response.Code()) - } -} - -// NewCreateServiceRequestDocumentUploadCreated creates a CreateServiceRequestDocumentUploadCreated with default headers values -func NewCreateServiceRequestDocumentUploadCreated() *CreateServiceRequestDocumentUploadCreated { - return &CreateServiceRequestDocumentUploadCreated{} -} - -/* -CreateServiceRequestDocumentUploadCreated describes a response with status code 201, with default header values. - -Successfully created upload of digital file. -*/ -type CreateServiceRequestDocumentUploadCreated struct { - Payload *primemessages.UploadWithOmissions -} - -// IsSuccess returns true when this create service request document upload created response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create service request document upload created response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload created response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create service request document upload created response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload created response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create service request document upload created response -func (o *CreateServiceRequestDocumentUploadCreated) Code() int { - return 201 -} - -func (o *CreateServiceRequestDocumentUploadCreated) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadCreated %+v", 201, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadCreated) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadCreated %+v", 201, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadCreated) GetPayload() *primemessages.UploadWithOmissions { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.UploadWithOmissions) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadBadRequest creates a CreateServiceRequestDocumentUploadBadRequest with default headers values -func NewCreateServiceRequestDocumentUploadBadRequest() *CreateServiceRequestDocumentUploadBadRequest { - return &CreateServiceRequestDocumentUploadBadRequest{} -} - -/* -CreateServiceRequestDocumentUploadBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateServiceRequestDocumentUploadBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create service request document upload bad request response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload bad request response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload bad request response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create service request document upload bad request response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload bad request response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create service request document upload bad request response -func (o *CreateServiceRequestDocumentUploadBadRequest) Code() int { - return 400 -} - -func (o *CreateServiceRequestDocumentUploadBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadBadRequest %+v", 400, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadBadRequest) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadBadRequest %+v", 400, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadUnauthorized creates a CreateServiceRequestDocumentUploadUnauthorized with default headers values -func NewCreateServiceRequestDocumentUploadUnauthorized() *CreateServiceRequestDocumentUploadUnauthorized { - return &CreateServiceRequestDocumentUploadUnauthorized{} -} - -/* -CreateServiceRequestDocumentUploadUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateServiceRequestDocumentUploadUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create service request document upload unauthorized response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload unauthorized response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload unauthorized response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create service request document upload unauthorized response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload unauthorized response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create service request document upload unauthorized response -func (o *CreateServiceRequestDocumentUploadUnauthorized) Code() int { - return 401 -} - -func (o *CreateServiceRequestDocumentUploadUnauthorized) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadUnauthorized) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadForbidden creates a CreateServiceRequestDocumentUploadForbidden with default headers values -func NewCreateServiceRequestDocumentUploadForbidden() *CreateServiceRequestDocumentUploadForbidden { - return &CreateServiceRequestDocumentUploadForbidden{} -} - -/* -CreateServiceRequestDocumentUploadForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateServiceRequestDocumentUploadForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create service request document upload forbidden response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload forbidden response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload forbidden response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create service request document upload forbidden response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload forbidden response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create service request document upload forbidden response -func (o *CreateServiceRequestDocumentUploadForbidden) Code() int { - return 403 -} - -func (o *CreateServiceRequestDocumentUploadForbidden) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadForbidden %+v", 403, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadForbidden) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadForbidden %+v", 403, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadNotFound creates a CreateServiceRequestDocumentUploadNotFound with default headers values -func NewCreateServiceRequestDocumentUploadNotFound() *CreateServiceRequestDocumentUploadNotFound { - return &CreateServiceRequestDocumentUploadNotFound{} -} - -/* -CreateServiceRequestDocumentUploadNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateServiceRequestDocumentUploadNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create service request document upload not found response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload not found response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload not found response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create service request document upload not found response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload not found response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create service request document upload not found response -func (o *CreateServiceRequestDocumentUploadNotFound) Code() int { - return 404 -} - -func (o *CreateServiceRequestDocumentUploadNotFound) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadNotFound %+v", 404, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadNotFound) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadNotFound %+v", 404, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadUnprocessableEntity creates a CreateServiceRequestDocumentUploadUnprocessableEntity with default headers values -func NewCreateServiceRequestDocumentUploadUnprocessableEntity() *CreateServiceRequestDocumentUploadUnprocessableEntity { - return &CreateServiceRequestDocumentUploadUnprocessableEntity{} -} - -/* -CreateServiceRequestDocumentUploadUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateServiceRequestDocumentUploadUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create service request document upload unprocessable entity response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload unprocessable entity response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload unprocessable entity response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create service request document upload unprocessable entity response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create service request document upload unprocessable entity response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create service request document upload unprocessable entity response -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateServiceRequestDocumentUploadInternalServerError creates a CreateServiceRequestDocumentUploadInternalServerError with default headers values -func NewCreateServiceRequestDocumentUploadInternalServerError() *CreateServiceRequestDocumentUploadInternalServerError { - return &CreateServiceRequestDocumentUploadInternalServerError{} -} - -/* -CreateServiceRequestDocumentUploadInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateServiceRequestDocumentUploadInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create service request document upload internal server error response has a 2xx status code -func (o *CreateServiceRequestDocumentUploadInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create service request document upload internal server error response has a 3xx status code -func (o *CreateServiceRequestDocumentUploadInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create service request document upload internal server error response has a 4xx status code -func (o *CreateServiceRequestDocumentUploadInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create service request document upload internal server error response has a 5xx status code -func (o *CreateServiceRequestDocumentUploadInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create service request document upload internal server error response a status code equal to that given -func (o *CreateServiceRequestDocumentUploadInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create service request document upload internal server error response -func (o *CreateServiceRequestDocumentUploadInternalServerError) Code() int { - return 500 -} - -func (o *CreateServiceRequestDocumentUploadInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateServiceRequestDocumentUploadInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateServiceRequestDocumentUploadInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go b/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go deleted file mode 100644 index 1f1299ebd67..00000000000 --- a/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go +++ /dev/null @@ -1,318 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto service item API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto service item API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMTOServiceItem(params *CreateMTOServiceItemParams, opts ...ClientOption) (*CreateMTOServiceItemOK, error) - - CreateServiceRequestDocumentUpload(params *CreateServiceRequestDocumentUploadParams, opts ...ClientOption) (*CreateServiceRequestDocumentUploadCreated, error) - - UpdateMTOServiceItem(params *UpdateMTOServiceItemParams, opts ...ClientOption) (*UpdateMTOServiceItemOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMTOServiceItem creates m t o service item - - Creates one or more MTOServiceItems. Not all service items may be created, please see details below. - -This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding - - to the service item you wish to create and the documentation will update with the new definition. - -Upon creation these items are associated with a Move Task Order and an MTO Shipment. -The request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require -additional service items to be autogenerated when added - all created service items, autogenerated included, -will be returned in the response. - -To update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint. - ---- - -**`MTOServiceItemOriginSIT`** - -MTOServiceItemOriginSIT is a subtype of MTOServiceItem. - -This model type describes a domestic origin SIT service item. Items can be created using this -model type with the following codes: - -**DOFSIT** - -**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items: - - DOFSIT - Domestic origin 1st day SIT - - DOASIT - Domestic origin Additional day SIT - - DOPSIT - Domestic origin SIT pickup - - DOSFSC - Domestic origin SIT fuel surcharge - -**DOASIT** - -**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item. -Additional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**. - ---- - -**`MTOServiceItemDestSIT`** - -MTOServiceItemDestSIT is a subtype of MTOServiceItem. - -This model type describes a domestic destination SIT service item. Items can be created using this -model type with the following codes: - -**DDFSIT** - -**1st day destination SIT service item**. - -These additional fields are optional for creating a DDFSIT: - - `firstAvailableDeliveryDate1` - - string - - First available date that Prime can deliver SIT service item. - - firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together - - `dateOfContact1` - - string - - Date of attempted contact by the prime corresponding to `timeMilitary1` - - dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together - - `timeMilitary1` - - string\d{4}Z - - Time of attempted contact corresponding to `dateOfContact1`, in military format. - - timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together - - `firstAvailableDeliveryDate2` - - string - - Second available date that Prime can deliver SIT service item. - - firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together - - `dateOfContact2` - - string - - Date of attempted contact delivery by the prime corresponding to `timeMilitary2` - - dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together - - `timeMilitary2` - - string\d{4}Z - - Time of attempted contact corresponding to `dateOfContact2`, in military format. - - timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together - -When a DDFSIT is requested, the API will auto-create the following group of service items: - - DDFSIT - Domestic destination 1st day SIT - - DDASIT - Domestic destination Additional day SIT - - DDDSIT - Domestic destination SIT delivery - - DDSFSC - Domestic destination SIT fuel surcharge - -**NOTE** When providing the `sitEntryDate` value in the payload, please ensure that the date is not BEFORE -`firstAvailableDeliveryDate1` or `firstAvailableDeliveryDate2`. If it is, you will receive an error response. - -**DDASIT** - -**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item. -Additional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**. -*/ -func (a *Client) CreateMTOServiceItem(params *CreateMTOServiceItemParams, opts ...ClientOption) (*CreateMTOServiceItemOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMTOServiceItemParams() - } - op := &runtime.ClientOperation{ - ID: "createMTOServiceItem", - Method: "POST", - PathPattern: "/mto-service-items", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMTOServiceItemReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMTOServiceItemOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMTOServiceItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateServiceRequestDocumentUpload creates service request document upload - - ### Functionality - -This endpoint **uploads** a Service Request document for a -ServiceItem. - -The ServiceItem should already exist. - -ServiceItems are created with the -[createMTOServiceItem](#operation/createMTOServiceItem) -endpoint. -*/ -func (a *Client) CreateServiceRequestDocumentUpload(params *CreateServiceRequestDocumentUploadParams, opts ...ClientOption) (*CreateServiceRequestDocumentUploadCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateServiceRequestDocumentUploadParams() - } - op := &runtime.ClientOperation{ - ID: "createServiceRequestDocumentUpload", - Method: "POST", - PathPattern: "/mto-service-items/{mtoServiceItemID}/uploads", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateServiceRequestDocumentUploadReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateServiceRequestDocumentUploadCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createServiceRequestDocumentUpload: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOServiceItem updates m t o service item - - Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below. - -This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding - - to the service item you wish to update and the documentation will update with the new definition. - -* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address. -For approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress). -For shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress). - -* SIT Service Items: Take note that when updating `sitCustomerContacted`, `sitDepartureDate`, or `sitRequestedDelivery`, we want -those to be updated on `DOASIT` (for origin SIT) and `DDASIT` (for destination SIT). If updating those values in other service -items, the office users will not have as much attention to those values. - -To create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint. - -* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from -REJECTED to SUBMITTED. Please provide the `requestedApprovalsRequestedStatus: true` when resubmitting as this will give attention to the TOO to -review the resubmitted SIT service item. Another note, `updateReason` must have a different value than the current `reason` value on the service item. -If this value is not updated, then an error will be sent back. - -The following SIT service items can be resubmitted following a rejection: -- DDASIT -- DDDSIT -- DDFSIT -- DOASIT -- DOPSIT -- DOFSIT -- DDSFSC -- DOSFSC - -At a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this: -```json - - { - "reServiceCode": "DDFSIT", - "updateReason": "A reason that differs from the previous reason", - "modelType": "UpdateMTOServiceItemSIT", - "requestApprovalsRequestedStatus": true - } - -``` - -The following service items allow you to update the Port that the shipment will use: -- PODFSC (Port of Debarkation can be updated) -- POEFSC (Port of Embarkation can be updated) - -At a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item. -Please see the example payload below: -```json - - { - "id": "1ed224b6-c65e-4616-b88e-8304d26c9562", - "modelType": "UpdateMTOServiceItemInternationalPortFSC", - "portCode": "SEA", - "reServiceCode": "POEFSC" - } - -``` -*/ -func (a *Client) UpdateMTOServiceItem(params *UpdateMTOServiceItemParams, opts ...ClientOption) (*UpdateMTOServiceItemOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOServiceItemParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOServiceItem", - Method: "PATCH", - PathPattern: "/mto-service-items/{mtoServiceItemID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOServiceItemReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOServiceItemOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOServiceItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go deleted file mode 100644 index 4e9019c7cf1..00000000000 --- a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go +++ /dev/null @@ -1,193 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOServiceItemParams creates a new UpdateMTOServiceItemParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOServiceItemParams() *UpdateMTOServiceItemParams { - return &UpdateMTOServiceItemParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOServiceItemParamsWithTimeout creates a new UpdateMTOServiceItemParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOServiceItemParamsWithTimeout(timeout time.Duration) *UpdateMTOServiceItemParams { - return &UpdateMTOServiceItemParams{ - timeout: timeout, - } -} - -// NewUpdateMTOServiceItemParamsWithContext creates a new UpdateMTOServiceItemParams object -// with the ability to set a context for a request. -func NewUpdateMTOServiceItemParamsWithContext(ctx context.Context) *UpdateMTOServiceItemParams { - return &UpdateMTOServiceItemParams{ - Context: ctx, - } -} - -// NewUpdateMTOServiceItemParamsWithHTTPClient creates a new UpdateMTOServiceItemParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOServiceItemParamsWithHTTPClient(client *http.Client) *UpdateMTOServiceItemParams { - return &UpdateMTOServiceItemParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOServiceItemParams contains all the parameters to send to the API endpoint - - for the update m t o service item operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOServiceItemParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body primemessages.UpdateMTOServiceItem - - /* MtoServiceItemID. - - UUID of service item to update. - */ - MtoServiceItemID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o service item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOServiceItemParams) WithDefaults() *UpdateMTOServiceItemParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o service item params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOServiceItemParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithTimeout(timeout time.Duration) *UpdateMTOServiceItemParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithContext(ctx context.Context) *UpdateMTOServiceItemParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithHTTPClient(client *http.Client) *UpdateMTOServiceItemParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithIfMatch(ifMatch string) *UpdateMTOServiceItemParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithBody(body primemessages.UpdateMTOServiceItem) *UpdateMTOServiceItemParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetBody(body primemessages.UpdateMTOServiceItem) { - o.Body = body -} - -// WithMtoServiceItemID adds the mtoServiceItemID to the update m t o service item params -func (o *UpdateMTOServiceItemParams) WithMtoServiceItemID(mtoServiceItemID string) *UpdateMTOServiceItemParams { - o.SetMtoServiceItemID(mtoServiceItemID) - return o -} - -// SetMtoServiceItemID adds the mtoServiceItemId to the update m t o service item params -func (o *UpdateMTOServiceItemParams) SetMtoServiceItemID(mtoServiceItemID string) { - o.MtoServiceItemID = mtoServiceItemID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOServiceItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - - // path param mtoServiceItemID - if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go deleted file mode 100644 index 6e828df911d..00000000000 --- a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOServiceItemReader is a Reader for the UpdateMTOServiceItem structure. -type UpdateMTOServiceItemReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOServiceItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOServiceItemOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOServiceItemBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOServiceItemUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOServiceItemForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOServiceItemNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOServiceItemConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOServiceItemPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOServiceItemUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOServiceItemInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-service-items/{mtoServiceItemID}] updateMTOServiceItem", response, response.Code()) - } -} - -// NewUpdateMTOServiceItemOK creates a UpdateMTOServiceItemOK with default headers values -func NewUpdateMTOServiceItemOK() *UpdateMTOServiceItemOK { - return &UpdateMTOServiceItemOK{} -} - -/* -UpdateMTOServiceItemOK describes a response with status code 200, with default header values. - -Successfully updated the MTO service item. -*/ -type UpdateMTOServiceItemOK struct { - Payload primemessages.MTOServiceItem -} - -// IsSuccess returns true when this update m t o service item o k response has a 2xx status code -func (o *UpdateMTOServiceItemOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o service item o k response has a 3xx status code -func (o *UpdateMTOServiceItemOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item o k response has a 4xx status code -func (o *UpdateMTOServiceItemOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o service item o k response has a 5xx status code -func (o *UpdateMTOServiceItemOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item o k response a status code equal to that given -func (o *UpdateMTOServiceItemOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o service item o k response -func (o *UpdateMTOServiceItemOK) Code() int { - return 200 -} - -func (o *UpdateMTOServiceItemOK) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOServiceItemOK) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOServiceItemOK) GetPayload() primemessages.MTOServiceItem { - return o.Payload -} - -func (o *UpdateMTOServiceItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload as interface type - payload, err := primemessages.UnmarshalMTOServiceItem(response.Body(), consumer) - if err != nil { - return err - } - o.Payload = payload - - return nil -} - -// NewUpdateMTOServiceItemBadRequest creates a UpdateMTOServiceItemBadRequest with default headers values -func NewUpdateMTOServiceItemBadRequest() *UpdateMTOServiceItemBadRequest { - return &UpdateMTOServiceItemBadRequest{} -} - -/* -UpdateMTOServiceItemBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOServiceItemBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item bad request response has a 2xx status code -func (o *UpdateMTOServiceItemBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item bad request response has a 3xx status code -func (o *UpdateMTOServiceItemBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item bad request response has a 4xx status code -func (o *UpdateMTOServiceItemBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item bad request response has a 5xx status code -func (o *UpdateMTOServiceItemBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item bad request response a status code equal to that given -func (o *UpdateMTOServiceItemBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o service item bad request response -func (o *UpdateMTOServiceItemBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOServiceItemBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOServiceItemBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOServiceItemBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemUnauthorized creates a UpdateMTOServiceItemUnauthorized with default headers values -func NewUpdateMTOServiceItemUnauthorized() *UpdateMTOServiceItemUnauthorized { - return &UpdateMTOServiceItemUnauthorized{} -} - -/* -UpdateMTOServiceItemUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOServiceItemUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item unauthorized response has a 2xx status code -func (o *UpdateMTOServiceItemUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item unauthorized response has a 3xx status code -func (o *UpdateMTOServiceItemUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item unauthorized response has a 4xx status code -func (o *UpdateMTOServiceItemUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item unauthorized response has a 5xx status code -func (o *UpdateMTOServiceItemUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item unauthorized response a status code equal to that given -func (o *UpdateMTOServiceItemUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o service item unauthorized response -func (o *UpdateMTOServiceItemUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOServiceItemUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOServiceItemUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOServiceItemUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemForbidden creates a UpdateMTOServiceItemForbidden with default headers values -func NewUpdateMTOServiceItemForbidden() *UpdateMTOServiceItemForbidden { - return &UpdateMTOServiceItemForbidden{} -} - -/* -UpdateMTOServiceItemForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOServiceItemForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item forbidden response has a 2xx status code -func (o *UpdateMTOServiceItemForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item forbidden response has a 3xx status code -func (o *UpdateMTOServiceItemForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item forbidden response has a 4xx status code -func (o *UpdateMTOServiceItemForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item forbidden response has a 5xx status code -func (o *UpdateMTOServiceItemForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item forbidden response a status code equal to that given -func (o *UpdateMTOServiceItemForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o service item forbidden response -func (o *UpdateMTOServiceItemForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOServiceItemForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOServiceItemForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOServiceItemForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemNotFound creates a UpdateMTOServiceItemNotFound with default headers values -func NewUpdateMTOServiceItemNotFound() *UpdateMTOServiceItemNotFound { - return &UpdateMTOServiceItemNotFound{} -} - -/* -UpdateMTOServiceItemNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOServiceItemNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item not found response has a 2xx status code -func (o *UpdateMTOServiceItemNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item not found response has a 3xx status code -func (o *UpdateMTOServiceItemNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item not found response has a 4xx status code -func (o *UpdateMTOServiceItemNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item not found response has a 5xx status code -func (o *UpdateMTOServiceItemNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item not found response a status code equal to that given -func (o *UpdateMTOServiceItemNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o service item not found response -func (o *UpdateMTOServiceItemNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOServiceItemNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOServiceItemNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOServiceItemNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemConflict creates a UpdateMTOServiceItemConflict with default headers values -func NewUpdateMTOServiceItemConflict() *UpdateMTOServiceItemConflict { - return &UpdateMTOServiceItemConflict{} -} - -/* -UpdateMTOServiceItemConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateMTOServiceItemConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item conflict response has a 2xx status code -func (o *UpdateMTOServiceItemConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item conflict response has a 3xx status code -func (o *UpdateMTOServiceItemConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item conflict response has a 4xx status code -func (o *UpdateMTOServiceItemConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item conflict response has a 5xx status code -func (o *UpdateMTOServiceItemConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item conflict response a status code equal to that given -func (o *UpdateMTOServiceItemConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o service item conflict response -func (o *UpdateMTOServiceItemConflict) Code() int { - return 409 -} - -func (o *UpdateMTOServiceItemConflict) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOServiceItemConflict) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOServiceItemConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemPreconditionFailed creates a UpdateMTOServiceItemPreconditionFailed with default headers values -func NewUpdateMTOServiceItemPreconditionFailed() *UpdateMTOServiceItemPreconditionFailed { - return &UpdateMTOServiceItemPreconditionFailed{} -} - -/* -UpdateMTOServiceItemPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOServiceItemPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o service item precondition failed response has a 2xx status code -func (o *UpdateMTOServiceItemPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item precondition failed response has a 3xx status code -func (o *UpdateMTOServiceItemPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item precondition failed response has a 4xx status code -func (o *UpdateMTOServiceItemPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item precondition failed response has a 5xx status code -func (o *UpdateMTOServiceItemPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item precondition failed response a status code equal to that given -func (o *UpdateMTOServiceItemPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o service item precondition failed response -func (o *UpdateMTOServiceItemPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOServiceItemPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOServiceItemPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOServiceItemPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemUnprocessableEntity creates a UpdateMTOServiceItemUnprocessableEntity with default headers values -func NewUpdateMTOServiceItemUnprocessableEntity() *UpdateMTOServiceItemUnprocessableEntity { - return &UpdateMTOServiceItemUnprocessableEntity{} -} - -/* -UpdateMTOServiceItemUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOServiceItemUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update m t o service item unprocessable entity response has a 2xx status code -func (o *UpdateMTOServiceItemUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item unprocessable entity response has a 3xx status code -func (o *UpdateMTOServiceItemUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item unprocessable entity response has a 4xx status code -func (o *UpdateMTOServiceItemUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item unprocessable entity response has a 5xx status code -func (o *UpdateMTOServiceItemUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item unprocessable entity response a status code equal to that given -func (o *UpdateMTOServiceItemUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o service item unprocessable entity response -func (o *UpdateMTOServiceItemUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOServiceItemUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOServiceItemUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOServiceItemUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOServiceItemUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemInternalServerError creates a UpdateMTOServiceItemInternalServerError with default headers values -func NewUpdateMTOServiceItemInternalServerError() *UpdateMTOServiceItemInternalServerError { - return &UpdateMTOServiceItemInternalServerError{} -} - -/* -UpdateMTOServiceItemInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOServiceItemInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update m t o service item internal server error response has a 2xx status code -func (o *UpdateMTOServiceItemInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item internal server error response has a 3xx status code -func (o *UpdateMTOServiceItemInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item internal server error response has a 4xx status code -func (o *UpdateMTOServiceItemInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o service item internal server error response has a 5xx status code -func (o *UpdateMTOServiceItemInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o service item internal server error response a status code equal to that given -func (o *UpdateMTOServiceItemInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o service item internal server error response -func (o *UpdateMTOServiceItemInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOServiceItemInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOServiceItemInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOServiceItemInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateMTOServiceItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go deleted file mode 100644 index 384fe947303..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateMTOAgentParams creates a new CreateMTOAgentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMTOAgentParams() *CreateMTOAgentParams { - return &CreateMTOAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMTOAgentParamsWithTimeout creates a new CreateMTOAgentParams object -// with the ability to set a timeout on a request. -func NewCreateMTOAgentParamsWithTimeout(timeout time.Duration) *CreateMTOAgentParams { - return &CreateMTOAgentParams{ - timeout: timeout, - } -} - -// NewCreateMTOAgentParamsWithContext creates a new CreateMTOAgentParams object -// with the ability to set a context for a request. -func NewCreateMTOAgentParamsWithContext(ctx context.Context) *CreateMTOAgentParams { - return &CreateMTOAgentParams{ - Context: ctx, - } -} - -// NewCreateMTOAgentParamsWithHTTPClient creates a new CreateMTOAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMTOAgentParamsWithHTTPClient(client *http.Client) *CreateMTOAgentParams { - return &CreateMTOAgentParams{ - HTTPClient: client, - } -} - -/* -CreateMTOAgentParams contains all the parameters to send to the API endpoint - - for the create m t o agent operation. - - Typically these are written to a http.Request. -*/ -type CreateMTOAgentParams struct { - - // Body. - Body *primemessages.MTOAgent - - /* MtoShipmentID. - - UUID of the shipment associated with the agent - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create m t o agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOAgentParams) WithDefaults() *CreateMTOAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create m t o agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create m t o agent params -func (o *CreateMTOAgentParams) WithTimeout(timeout time.Duration) *CreateMTOAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create m t o agent params -func (o *CreateMTOAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create m t o agent params -func (o *CreateMTOAgentParams) WithContext(ctx context.Context) *CreateMTOAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create m t o agent params -func (o *CreateMTOAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create m t o agent params -func (o *CreateMTOAgentParams) WithHTTPClient(client *http.Client) *CreateMTOAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create m t o agent params -func (o *CreateMTOAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create m t o agent params -func (o *CreateMTOAgentParams) WithBody(body *primemessages.MTOAgent) *CreateMTOAgentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create m t o agent params -func (o *CreateMTOAgentParams) SetBody(body *primemessages.MTOAgent) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the create m t o agent params -func (o *CreateMTOAgentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *CreateMTOAgentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the create m t o agent params -func (o *CreateMTOAgentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMTOAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go deleted file mode 100644 index 9ea9f7a24a6..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateMTOAgentReader is a Reader for the CreateMTOAgent structure. -type CreateMTOAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMTOAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMTOAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateMTOAgentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateMTOAgentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateMTOAgentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMTOAgentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateMTOAgentConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateMTOAgentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateMTOAgentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/agents] createMTOAgent", response, response.Code()) - } -} - -// NewCreateMTOAgentOK creates a CreateMTOAgentOK with default headers values -func NewCreateMTOAgentOK() *CreateMTOAgentOK { - return &CreateMTOAgentOK{} -} - -/* -CreateMTOAgentOK describes a response with status code 200, with default header values. - -Successfully added the agent. -*/ -type CreateMTOAgentOK struct { - Payload *primemessages.MTOAgent -} - -// IsSuccess returns true when this create m t o agent o k response has a 2xx status code -func (o *CreateMTOAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create m t o agent o k response has a 3xx status code -func (o *CreateMTOAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent o k response has a 4xx status code -func (o *CreateMTOAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o agent o k response has a 5xx status code -func (o *CreateMTOAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent o k response a status code equal to that given -func (o *CreateMTOAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create m t o agent o k response -func (o *CreateMTOAgentOK) Code() int { - return 200 -} - -func (o *CreateMTOAgentOK) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOAgentOK) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOAgentOK) GetPayload() *primemessages.MTOAgent { - return o.Payload -} - -func (o *CreateMTOAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.MTOAgent) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentBadRequest creates a CreateMTOAgentBadRequest with default headers values -func NewCreateMTOAgentBadRequest() *CreateMTOAgentBadRequest { - return &CreateMTOAgentBadRequest{} -} - -/* -CreateMTOAgentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateMTOAgentBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o agent bad request response has a 2xx status code -func (o *CreateMTOAgentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent bad request response has a 3xx status code -func (o *CreateMTOAgentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent bad request response has a 4xx status code -func (o *CreateMTOAgentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent bad request response has a 5xx status code -func (o *CreateMTOAgentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent bad request response a status code equal to that given -func (o *CreateMTOAgentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create m t o agent bad request response -func (o *CreateMTOAgentBadRequest) Code() int { - return 400 -} - -func (o *CreateMTOAgentBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOAgentBadRequest) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOAgentBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOAgentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentUnauthorized creates a CreateMTOAgentUnauthorized with default headers values -func NewCreateMTOAgentUnauthorized() *CreateMTOAgentUnauthorized { - return &CreateMTOAgentUnauthorized{} -} - -/* -CreateMTOAgentUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateMTOAgentUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o agent unauthorized response has a 2xx status code -func (o *CreateMTOAgentUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent unauthorized response has a 3xx status code -func (o *CreateMTOAgentUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent unauthorized response has a 4xx status code -func (o *CreateMTOAgentUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent unauthorized response has a 5xx status code -func (o *CreateMTOAgentUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent unauthorized response a status code equal to that given -func (o *CreateMTOAgentUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create m t o agent unauthorized response -func (o *CreateMTOAgentUnauthorized) Code() int { - return 401 -} - -func (o *CreateMTOAgentUnauthorized) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMTOAgentUnauthorized) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMTOAgentUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOAgentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentForbidden creates a CreateMTOAgentForbidden with default headers values -func NewCreateMTOAgentForbidden() *CreateMTOAgentForbidden { - return &CreateMTOAgentForbidden{} -} - -/* -CreateMTOAgentForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateMTOAgentForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o agent forbidden response has a 2xx status code -func (o *CreateMTOAgentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent forbidden response has a 3xx status code -func (o *CreateMTOAgentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent forbidden response has a 4xx status code -func (o *CreateMTOAgentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent forbidden response has a 5xx status code -func (o *CreateMTOAgentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent forbidden response a status code equal to that given -func (o *CreateMTOAgentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create m t o agent forbidden response -func (o *CreateMTOAgentForbidden) Code() int { - return 403 -} - -func (o *CreateMTOAgentForbidden) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentForbidden %+v", 403, o.Payload) -} - -func (o *CreateMTOAgentForbidden) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentForbidden %+v", 403, o.Payload) -} - -func (o *CreateMTOAgentForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentNotFound creates a CreateMTOAgentNotFound with default headers values -func NewCreateMTOAgentNotFound() *CreateMTOAgentNotFound { - return &CreateMTOAgentNotFound{} -} - -/* -CreateMTOAgentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateMTOAgentNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o agent not found response has a 2xx status code -func (o *CreateMTOAgentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent not found response has a 3xx status code -func (o *CreateMTOAgentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent not found response has a 4xx status code -func (o *CreateMTOAgentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent not found response has a 5xx status code -func (o *CreateMTOAgentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent not found response a status code equal to that given -func (o *CreateMTOAgentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create m t o agent not found response -func (o *CreateMTOAgentNotFound) Code() int { - return 404 -} - -func (o *CreateMTOAgentNotFound) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOAgentNotFound) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOAgentNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentConflict creates a CreateMTOAgentConflict with default headers values -func NewCreateMTOAgentConflict() *CreateMTOAgentConflict { - return &CreateMTOAgentConflict{} -} - -/* -CreateMTOAgentConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type CreateMTOAgentConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create m t o agent conflict response has a 2xx status code -func (o *CreateMTOAgentConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent conflict response has a 3xx status code -func (o *CreateMTOAgentConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent conflict response has a 4xx status code -func (o *CreateMTOAgentConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent conflict response has a 5xx status code -func (o *CreateMTOAgentConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent conflict response a status code equal to that given -func (o *CreateMTOAgentConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create m t o agent conflict response -func (o *CreateMTOAgentConflict) Code() int { - return 409 -} - -func (o *CreateMTOAgentConflict) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentConflict %+v", 409, o.Payload) -} - -func (o *CreateMTOAgentConflict) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentConflict %+v", 409, o.Payload) -} - -func (o *CreateMTOAgentConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateMTOAgentConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentUnprocessableEntity creates a CreateMTOAgentUnprocessableEntity with default headers values -func NewCreateMTOAgentUnprocessableEntity() *CreateMTOAgentUnprocessableEntity { - return &CreateMTOAgentUnprocessableEntity{} -} - -/* -CreateMTOAgentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateMTOAgentUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create m t o agent unprocessable entity response has a 2xx status code -func (o *CreateMTOAgentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent unprocessable entity response has a 3xx status code -func (o *CreateMTOAgentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent unprocessable entity response has a 4xx status code -func (o *CreateMTOAgentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o agent unprocessable entity response has a 5xx status code -func (o *CreateMTOAgentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o agent unprocessable entity response a status code equal to that given -func (o *CreateMTOAgentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create m t o agent unprocessable entity response -func (o *CreateMTOAgentUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateMTOAgentUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOAgentUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOAgentUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateMTOAgentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOAgentInternalServerError creates a CreateMTOAgentInternalServerError with default headers values -func NewCreateMTOAgentInternalServerError() *CreateMTOAgentInternalServerError { - return &CreateMTOAgentInternalServerError{} -} - -/* -CreateMTOAgentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateMTOAgentInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create m t o agent internal server error response has a 2xx status code -func (o *CreateMTOAgentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o agent internal server error response has a 3xx status code -func (o *CreateMTOAgentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o agent internal server error response has a 4xx status code -func (o *CreateMTOAgentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o agent internal server error response has a 5xx status code -func (o *CreateMTOAgentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create m t o agent internal server error response a status code equal to that given -func (o *CreateMTOAgentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create m t o agent internal server error response -func (o *CreateMTOAgentInternalServerError) Code() int { - return 500 -} - -func (o *CreateMTOAgentInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOAgentInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOAgentInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateMTOAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 1cf6aa6d3a2..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object -// with the ability to set a context for a request. -func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - Context: ctx, - } -} - -// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -CreateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the create m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type CreateMTOShipmentParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index be658169f6d..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. -type CreateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 410: - result := NewCreateMTOShipmentGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) - } -} - -// NewCreateMTOShipmentGone creates a CreateMTOShipmentGone with default headers values -func NewCreateMTOShipmentGone() *CreateMTOShipmentGone { - return &CreateMTOShipmentGone{} -} - -/* -CreateMTOShipmentGone describes a response with status code 410, with default header values. - -This endpoint is deprecated. Please use `/prime/v3/createMTOShipment` instead. -*/ -type CreateMTOShipmentGone struct { -} - -// IsSuccess returns true when this create m t o shipment gone response has a 2xx status code -func (o *CreateMTOShipmentGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment gone response has a 3xx status code -func (o *CreateMTOShipmentGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment gone response has a 4xx status code -func (o *CreateMTOShipmentGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment gone response has a 5xx status code -func (o *CreateMTOShipmentGone) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment gone response a status code equal to that given -func (o *CreateMTOShipmentGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the create m t o shipment gone response -func (o *CreateMTOShipmentGone) Code() int { - return 410 -} - -func (o *CreateMTOShipmentGone) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentGone ", 410) -} - -func (o *CreateMTOShipmentGone) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentGone ", 410) -} - -func (o *CreateMTOShipmentGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go deleted file mode 100644 index 27c02b10986..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreateSITExtensionParams creates a new CreateSITExtensionParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateSITExtensionParams() *CreateSITExtensionParams { - return &CreateSITExtensionParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateSITExtensionParamsWithTimeout creates a new CreateSITExtensionParams object -// with the ability to set a timeout on a request. -func NewCreateSITExtensionParamsWithTimeout(timeout time.Duration) *CreateSITExtensionParams { - return &CreateSITExtensionParams{ - timeout: timeout, - } -} - -// NewCreateSITExtensionParamsWithContext creates a new CreateSITExtensionParams object -// with the ability to set a context for a request. -func NewCreateSITExtensionParamsWithContext(ctx context.Context) *CreateSITExtensionParams { - return &CreateSITExtensionParams{ - Context: ctx, - } -} - -// NewCreateSITExtensionParamsWithHTTPClient creates a new CreateSITExtensionParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateSITExtensionParamsWithHTTPClient(client *http.Client) *CreateSITExtensionParams { - return &CreateSITExtensionParams{ - HTTPClient: client, - } -} - -/* -CreateSITExtensionParams contains all the parameters to send to the API endpoint - - for the create s i t extension operation. - - Typically these are written to a http.Request. -*/ -type CreateSITExtensionParams struct { - - // Body. - Body *primemessages.CreateSITExtension - - /* MtoShipmentID. - - UUID of the shipment associated with the agent - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create s i t extension params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSITExtensionParams) WithDefaults() *CreateSITExtensionParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create s i t extension params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateSITExtensionParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create s i t extension params -func (o *CreateSITExtensionParams) WithTimeout(timeout time.Duration) *CreateSITExtensionParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create s i t extension params -func (o *CreateSITExtensionParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create s i t extension params -func (o *CreateSITExtensionParams) WithContext(ctx context.Context) *CreateSITExtensionParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create s i t extension params -func (o *CreateSITExtensionParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create s i t extension params -func (o *CreateSITExtensionParams) WithHTTPClient(client *http.Client) *CreateSITExtensionParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create s i t extension params -func (o *CreateSITExtensionParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create s i t extension params -func (o *CreateSITExtensionParams) WithBody(body *primemessages.CreateSITExtension) *CreateSITExtensionParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create s i t extension params -func (o *CreateSITExtensionParams) SetBody(body *primemessages.CreateSITExtension) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the create s i t extension params -func (o *CreateSITExtensionParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *CreateSITExtensionParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the create s i t extension params -func (o *CreateSITExtensionParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateSITExtensionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go deleted file mode 100644 index 7f1e398fbfa..00000000000 --- a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateSITExtensionReader is a Reader for the CreateSITExtension structure. -type CreateSITExtensionReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateSITExtensionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateSITExtensionCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateSITExtensionBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateSITExtensionUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateSITExtensionForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateSITExtensionNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreateSITExtensionConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateSITExtensionUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateSITExtensionInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/sit-extensions] createSITExtension", response, response.Code()) - } -} - -// NewCreateSITExtensionCreated creates a CreateSITExtensionCreated with default headers values -func NewCreateSITExtensionCreated() *CreateSITExtensionCreated { - return &CreateSITExtensionCreated{} -} - -/* -CreateSITExtensionCreated describes a response with status code 201, with default header values. - -Successfully created the sit extension request. -*/ -type CreateSITExtensionCreated struct { - Payload *primemessages.SITExtension -} - -// IsSuccess returns true when this create s i t extension created response has a 2xx status code -func (o *CreateSITExtensionCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create s i t extension created response has a 3xx status code -func (o *CreateSITExtensionCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension created response has a 4xx status code -func (o *CreateSITExtensionCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create s i t extension created response has a 5xx status code -func (o *CreateSITExtensionCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension created response a status code equal to that given -func (o *CreateSITExtensionCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create s i t extension created response -func (o *CreateSITExtensionCreated) Code() int { - return 201 -} - -func (o *CreateSITExtensionCreated) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionCreated %+v", 201, o.Payload) -} - -func (o *CreateSITExtensionCreated) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionCreated %+v", 201, o.Payload) -} - -func (o *CreateSITExtensionCreated) GetPayload() *primemessages.SITExtension { - return o.Payload -} - -func (o *CreateSITExtensionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.SITExtension) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionBadRequest creates a CreateSITExtensionBadRequest with default headers values -func NewCreateSITExtensionBadRequest() *CreateSITExtensionBadRequest { - return &CreateSITExtensionBadRequest{} -} - -/* -CreateSITExtensionBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateSITExtensionBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create s i t extension bad request response has a 2xx status code -func (o *CreateSITExtensionBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension bad request response has a 3xx status code -func (o *CreateSITExtensionBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension bad request response has a 4xx status code -func (o *CreateSITExtensionBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension bad request response has a 5xx status code -func (o *CreateSITExtensionBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension bad request response a status code equal to that given -func (o *CreateSITExtensionBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create s i t extension bad request response -func (o *CreateSITExtensionBadRequest) Code() int { - return 400 -} - -func (o *CreateSITExtensionBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionBadRequest %+v", 400, o.Payload) -} - -func (o *CreateSITExtensionBadRequest) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionBadRequest %+v", 400, o.Payload) -} - -func (o *CreateSITExtensionBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateSITExtensionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionUnauthorized creates a CreateSITExtensionUnauthorized with default headers values -func NewCreateSITExtensionUnauthorized() *CreateSITExtensionUnauthorized { - return &CreateSITExtensionUnauthorized{} -} - -/* -CreateSITExtensionUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateSITExtensionUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create s i t extension unauthorized response has a 2xx status code -func (o *CreateSITExtensionUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension unauthorized response has a 3xx status code -func (o *CreateSITExtensionUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension unauthorized response has a 4xx status code -func (o *CreateSITExtensionUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension unauthorized response has a 5xx status code -func (o *CreateSITExtensionUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension unauthorized response a status code equal to that given -func (o *CreateSITExtensionUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create s i t extension unauthorized response -func (o *CreateSITExtensionUnauthorized) Code() int { - return 401 -} - -func (o *CreateSITExtensionUnauthorized) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateSITExtensionUnauthorized) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateSITExtensionUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateSITExtensionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionForbidden creates a CreateSITExtensionForbidden with default headers values -func NewCreateSITExtensionForbidden() *CreateSITExtensionForbidden { - return &CreateSITExtensionForbidden{} -} - -/* -CreateSITExtensionForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateSITExtensionForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create s i t extension forbidden response has a 2xx status code -func (o *CreateSITExtensionForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension forbidden response has a 3xx status code -func (o *CreateSITExtensionForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension forbidden response has a 4xx status code -func (o *CreateSITExtensionForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension forbidden response has a 5xx status code -func (o *CreateSITExtensionForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension forbidden response a status code equal to that given -func (o *CreateSITExtensionForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create s i t extension forbidden response -func (o *CreateSITExtensionForbidden) Code() int { - return 403 -} - -func (o *CreateSITExtensionForbidden) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionForbidden %+v", 403, o.Payload) -} - -func (o *CreateSITExtensionForbidden) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionForbidden %+v", 403, o.Payload) -} - -func (o *CreateSITExtensionForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateSITExtensionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionNotFound creates a CreateSITExtensionNotFound with default headers values -func NewCreateSITExtensionNotFound() *CreateSITExtensionNotFound { - return &CreateSITExtensionNotFound{} -} - -/* -CreateSITExtensionNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateSITExtensionNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create s i t extension not found response has a 2xx status code -func (o *CreateSITExtensionNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension not found response has a 3xx status code -func (o *CreateSITExtensionNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension not found response has a 4xx status code -func (o *CreateSITExtensionNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension not found response has a 5xx status code -func (o *CreateSITExtensionNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension not found response a status code equal to that given -func (o *CreateSITExtensionNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create s i t extension not found response -func (o *CreateSITExtensionNotFound) Code() int { - return 404 -} - -func (o *CreateSITExtensionNotFound) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionNotFound %+v", 404, o.Payload) -} - -func (o *CreateSITExtensionNotFound) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionNotFound %+v", 404, o.Payload) -} - -func (o *CreateSITExtensionNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateSITExtensionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionConflict creates a CreateSITExtensionConflict with default headers values -func NewCreateSITExtensionConflict() *CreateSITExtensionConflict { - return &CreateSITExtensionConflict{} -} - -/* -CreateSITExtensionConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type CreateSITExtensionConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create s i t extension conflict response has a 2xx status code -func (o *CreateSITExtensionConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension conflict response has a 3xx status code -func (o *CreateSITExtensionConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension conflict response has a 4xx status code -func (o *CreateSITExtensionConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension conflict response has a 5xx status code -func (o *CreateSITExtensionConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension conflict response a status code equal to that given -func (o *CreateSITExtensionConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create s i t extension conflict response -func (o *CreateSITExtensionConflict) Code() int { - return 409 -} - -func (o *CreateSITExtensionConflict) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionConflict %+v", 409, o.Payload) -} - -func (o *CreateSITExtensionConflict) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionConflict %+v", 409, o.Payload) -} - -func (o *CreateSITExtensionConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateSITExtensionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionUnprocessableEntity creates a CreateSITExtensionUnprocessableEntity with default headers values -func NewCreateSITExtensionUnprocessableEntity() *CreateSITExtensionUnprocessableEntity { - return &CreateSITExtensionUnprocessableEntity{} -} - -/* -CreateSITExtensionUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateSITExtensionUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create s i t extension unprocessable entity response has a 2xx status code -func (o *CreateSITExtensionUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension unprocessable entity response has a 3xx status code -func (o *CreateSITExtensionUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension unprocessable entity response has a 4xx status code -func (o *CreateSITExtensionUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create s i t extension unprocessable entity response has a 5xx status code -func (o *CreateSITExtensionUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create s i t extension unprocessable entity response a status code equal to that given -func (o *CreateSITExtensionUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create s i t extension unprocessable entity response -func (o *CreateSITExtensionUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateSITExtensionUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateSITExtensionUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateSITExtensionUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateSITExtensionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateSITExtensionInternalServerError creates a CreateSITExtensionInternalServerError with default headers values -func NewCreateSITExtensionInternalServerError() *CreateSITExtensionInternalServerError { - return &CreateSITExtensionInternalServerError{} -} - -/* -CreateSITExtensionInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateSITExtensionInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create s i t extension internal server error response has a 2xx status code -func (o *CreateSITExtensionInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create s i t extension internal server error response has a 3xx status code -func (o *CreateSITExtensionInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create s i t extension internal server error response has a 4xx status code -func (o *CreateSITExtensionInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create s i t extension internal server error response has a 5xx status code -func (o *CreateSITExtensionInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create s i t extension internal server error response a status code equal to that given -func (o *CreateSITExtensionInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create s i t extension internal server error response -func (o *CreateSITExtensionInternalServerError) Code() int { - return 500 -} - -func (o *CreateSITExtensionInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateSITExtensionInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateSITExtensionInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateSITExtensionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go deleted file mode 100644 index a26a7fd7312..00000000000 --- a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewDeleteMTOShipmentParams creates a new DeleteMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewDeleteMTOShipmentParams() *DeleteMTOShipmentParams { - return &DeleteMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewDeleteMTOShipmentParamsWithTimeout creates a new DeleteMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewDeleteMTOShipmentParamsWithTimeout(timeout time.Duration) *DeleteMTOShipmentParams { - return &DeleteMTOShipmentParams{ - timeout: timeout, - } -} - -// NewDeleteMTOShipmentParamsWithContext creates a new DeleteMTOShipmentParams object -// with the ability to set a context for a request. -func NewDeleteMTOShipmentParamsWithContext(ctx context.Context) *DeleteMTOShipmentParams { - return &DeleteMTOShipmentParams{ - Context: ctx, - } -} - -// NewDeleteMTOShipmentParamsWithHTTPClient creates a new DeleteMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewDeleteMTOShipmentParamsWithHTTPClient(client *http.Client) *DeleteMTOShipmentParams { - return &DeleteMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -DeleteMTOShipmentParams contains all the parameters to send to the API endpoint - - for the delete m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type DeleteMTOShipmentParams struct { - - /* MtoShipmentID. - - UUID of the shipment to be deleted - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the delete m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMTOShipmentParams) WithDefaults() *DeleteMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the delete m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *DeleteMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) WithTimeout(timeout time.Duration) *DeleteMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) WithContext(ctx context.Context) *DeleteMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) WithHTTPClient(client *http.Client) *DeleteMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMtoShipmentID adds the mtoShipmentID to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *DeleteMTOShipmentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the delete m t o shipment params -func (o *DeleteMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *DeleteMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go deleted file mode 100644 index 2baf1703b9b..00000000000 --- a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go +++ /dev/null @@ -1,535 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// DeleteMTOShipmentReader is a Reader for the DeleteMTOShipment structure. -type DeleteMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *DeleteMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 204: - result := NewDeleteMTOShipmentNoContent() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewDeleteMTOShipmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewDeleteMTOShipmentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewDeleteMTOShipmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewDeleteMTOShipmentConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewDeleteMTOShipmentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewDeleteMTOShipmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[DELETE /mto-shipments/{mtoShipmentID}] deleteMTOShipment", response, response.Code()) - } -} - -// NewDeleteMTOShipmentNoContent creates a DeleteMTOShipmentNoContent with default headers values -func NewDeleteMTOShipmentNoContent() *DeleteMTOShipmentNoContent { - return &DeleteMTOShipmentNoContent{} -} - -/* -DeleteMTOShipmentNoContent describes a response with status code 204, with default header values. - -Successfully deleted the MTO shipment. -*/ -type DeleteMTOShipmentNoContent struct { -} - -// IsSuccess returns true when this delete m t o shipment no content response has a 2xx status code -func (o *DeleteMTOShipmentNoContent) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this delete m t o shipment no content response has a 3xx status code -func (o *DeleteMTOShipmentNoContent) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment no content response has a 4xx status code -func (o *DeleteMTOShipmentNoContent) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete m t o shipment no content response has a 5xx status code -func (o *DeleteMTOShipmentNoContent) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment no content response a status code equal to that given -func (o *DeleteMTOShipmentNoContent) IsCode(code int) bool { - return code == 204 -} - -// Code gets the status code for the delete m t o shipment no content response -func (o *DeleteMTOShipmentNoContent) Code() int { - return 204 -} - -func (o *DeleteMTOShipmentNoContent) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNoContent ", 204) -} - -func (o *DeleteMTOShipmentNoContent) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNoContent ", 204) -} - -func (o *DeleteMTOShipmentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} - -// NewDeleteMTOShipmentBadRequest creates a DeleteMTOShipmentBadRequest with default headers values -func NewDeleteMTOShipmentBadRequest() *DeleteMTOShipmentBadRequest { - return &DeleteMTOShipmentBadRequest{} -} - -/* -DeleteMTOShipmentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type DeleteMTOShipmentBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this delete m t o shipment bad request response has a 2xx status code -func (o *DeleteMTOShipmentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment bad request response has a 3xx status code -func (o *DeleteMTOShipmentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment bad request response has a 4xx status code -func (o *DeleteMTOShipmentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete m t o shipment bad request response has a 5xx status code -func (o *DeleteMTOShipmentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment bad request response a status code equal to that given -func (o *DeleteMTOShipmentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the delete m t o shipment bad request response -func (o *DeleteMTOShipmentBadRequest) Code() int { - return 400 -} - -func (o *DeleteMTOShipmentBadRequest) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *DeleteMTOShipmentBadRequest) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *DeleteMTOShipmentBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DeleteMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMTOShipmentForbidden creates a DeleteMTOShipmentForbidden with default headers values -func NewDeleteMTOShipmentForbidden() *DeleteMTOShipmentForbidden { - return &DeleteMTOShipmentForbidden{} -} - -/* -DeleteMTOShipmentForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type DeleteMTOShipmentForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this delete m t o shipment forbidden response has a 2xx status code -func (o *DeleteMTOShipmentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment forbidden response has a 3xx status code -func (o *DeleteMTOShipmentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment forbidden response has a 4xx status code -func (o *DeleteMTOShipmentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete m t o shipment forbidden response has a 5xx status code -func (o *DeleteMTOShipmentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment forbidden response a status code equal to that given -func (o *DeleteMTOShipmentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the delete m t o shipment forbidden response -func (o *DeleteMTOShipmentForbidden) Code() int { - return 403 -} - -func (o *DeleteMTOShipmentForbidden) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *DeleteMTOShipmentForbidden) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *DeleteMTOShipmentForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DeleteMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMTOShipmentNotFound creates a DeleteMTOShipmentNotFound with default headers values -func NewDeleteMTOShipmentNotFound() *DeleteMTOShipmentNotFound { - return &DeleteMTOShipmentNotFound{} -} - -/* -DeleteMTOShipmentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type DeleteMTOShipmentNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this delete m t o shipment not found response has a 2xx status code -func (o *DeleteMTOShipmentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment not found response has a 3xx status code -func (o *DeleteMTOShipmentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment not found response has a 4xx status code -func (o *DeleteMTOShipmentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete m t o shipment not found response has a 5xx status code -func (o *DeleteMTOShipmentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment not found response a status code equal to that given -func (o *DeleteMTOShipmentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the delete m t o shipment not found response -func (o *DeleteMTOShipmentNotFound) Code() int { - return 404 -} - -func (o *DeleteMTOShipmentNotFound) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *DeleteMTOShipmentNotFound) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *DeleteMTOShipmentNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DeleteMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMTOShipmentConflict creates a DeleteMTOShipmentConflict with default headers values -func NewDeleteMTOShipmentConflict() *DeleteMTOShipmentConflict { - return &DeleteMTOShipmentConflict{} -} - -/* -DeleteMTOShipmentConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type DeleteMTOShipmentConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this delete m t o shipment conflict response has a 2xx status code -func (o *DeleteMTOShipmentConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment conflict response has a 3xx status code -func (o *DeleteMTOShipmentConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment conflict response has a 4xx status code -func (o *DeleteMTOShipmentConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete m t o shipment conflict response has a 5xx status code -func (o *DeleteMTOShipmentConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment conflict response a status code equal to that given -func (o *DeleteMTOShipmentConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the delete m t o shipment conflict response -func (o *DeleteMTOShipmentConflict) Code() int { - return 409 -} - -func (o *DeleteMTOShipmentConflict) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentConflict %+v", 409, o.Payload) -} - -func (o *DeleteMTOShipmentConflict) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentConflict %+v", 409, o.Payload) -} - -func (o *DeleteMTOShipmentConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *DeleteMTOShipmentConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMTOShipmentUnprocessableEntity creates a DeleteMTOShipmentUnprocessableEntity with default headers values -func NewDeleteMTOShipmentUnprocessableEntity() *DeleteMTOShipmentUnprocessableEntity { - return &DeleteMTOShipmentUnprocessableEntity{} -} - -/* -DeleteMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type DeleteMTOShipmentUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this delete m t o shipment unprocessable entity response has a 2xx status code -func (o *DeleteMTOShipmentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment unprocessable entity response has a 3xx status code -func (o *DeleteMTOShipmentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment unprocessable entity response has a 4xx status code -func (o *DeleteMTOShipmentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this delete m t o shipment unprocessable entity response has a 5xx status code -func (o *DeleteMTOShipmentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this delete m t o shipment unprocessable entity response a status code equal to that given -func (o *DeleteMTOShipmentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the delete m t o shipment unprocessable entity response -func (o *DeleteMTOShipmentUnprocessableEntity) Code() int { - return 422 -} - -func (o *DeleteMTOShipmentUnprocessableEntity) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *DeleteMTOShipmentUnprocessableEntity) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *DeleteMTOShipmentUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *DeleteMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewDeleteMTOShipmentInternalServerError creates a DeleteMTOShipmentInternalServerError with default headers values -func NewDeleteMTOShipmentInternalServerError() *DeleteMTOShipmentInternalServerError { - return &DeleteMTOShipmentInternalServerError{} -} - -/* -DeleteMTOShipmentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type DeleteMTOShipmentInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this delete m t o shipment internal server error response has a 2xx status code -func (o *DeleteMTOShipmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this delete m t o shipment internal server error response has a 3xx status code -func (o *DeleteMTOShipmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this delete m t o shipment internal server error response has a 4xx status code -func (o *DeleteMTOShipmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this delete m t o shipment internal server error response has a 5xx status code -func (o *DeleteMTOShipmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this delete m t o shipment internal server error response a status code equal to that given -func (o *DeleteMTOShipmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the delete m t o shipment internal server error response -func (o *DeleteMTOShipmentInternalServerError) Code() int { - return 500 -} - -func (o *DeleteMTOShipmentInternalServerError) Error() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *DeleteMTOShipmentInternalServerError) String() string { - return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *DeleteMTOShipmentInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *DeleteMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go b/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go deleted file mode 100644 index 2051172f1d1..00000000000 --- a/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go +++ /dev/null @@ -1,524 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto shipment API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto shipment API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMTOAgent(params *CreateMTOAgentParams, opts ...ClientOption) (*CreateMTOAgentOK, error) - - CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) error - - CreateSITExtension(params *CreateSITExtensionParams, opts ...ClientOption) (*CreateSITExtensionCreated, error) - - DeleteMTOShipment(params *DeleteMTOShipmentParams, opts ...ClientOption) (*DeleteMTOShipmentNoContent, error) - - UpdateMTOAgent(params *UpdateMTOAgentParams, opts ...ClientOption) (*UpdateMTOAgentOK, error) - - UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) error - - UpdateMTOShipmentAddress(params *UpdateMTOShipmentAddressParams, opts ...ClientOption) (*UpdateMTOShipmentAddressOK, error) - - UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) - - UpdateReweigh(params *UpdateReweighParams, opts ...ClientOption) (*UpdateReweighOK, error) - - UpdateShipmentDestinationAddress(params *UpdateShipmentDestinationAddressParams, opts ...ClientOption) (*UpdateShipmentDestinationAddressCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMTOAgent creates m t o agent - - ### Functionality - -This endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body. - -### Errors -The agent must always have a name and at least one method of contact (either `email` or `phone`). - -The agent must be associated with the MTO shipment passed in the url. - -The shipment should be associated with an MTO that is available to the Pime. -If the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. -*/ -func (a *Client) CreateMTOAgent(params *CreateMTOAgentParams, opts ...ClientOption) (*CreateMTOAgentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMTOAgentParams() - } - op := &runtime.ClientOperation{ - ID: "createMTOAgent", - Method: "POST", - PathPattern: "/mto-shipments/{mtoShipmentID}/agents", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMTOAgentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMTOAgentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMTOAgent: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateMTOShipment creates m t o shipment - - _[Deprecated: this endpoint was deprecated on August 5th, 2024]_ - -Please use the new endpoint at `/prime/v3/createMTOShipment` instead. -*/ -func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) error { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "createMTOShipment", - Method: "POST", - PathPattern: "/mto-shipments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) - if err != nil { - return err - } - return nil -} - -/* - CreateSITExtension creates s i t extension - - ### Functionality - -This endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an -increase in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance -includes time spent in both origin and destination SIT. -*/ -func (a *Client) CreateSITExtension(params *CreateSITExtensionParams, opts ...ClientOption) (*CreateSITExtensionCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateSITExtensionParams() - } - op := &runtime.ClientOperation{ - ID: "createSITExtension", - Method: "POST", - PathPattern: "/mto-shipments/{mtoShipmentID}/sit-extensions", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateSITExtensionReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateSITExtensionCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createSITExtension: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - DeleteMTOShipment deletes m t o shipment - - ### Functionality - -This endpoint deletes an individual shipment by ID. - -### Errors -* The mtoShipment should be associated with an MTO that is available to prime. -* The mtoShipment must be a PPM shipment. -* Counseling should not have already been completed for the associated MTO. -*/ -func (a *Client) DeleteMTOShipment(params *DeleteMTOShipmentParams, opts ...ClientOption) (*DeleteMTOShipmentNoContent, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewDeleteMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "deleteMTOShipment", - Method: "DELETE", - PathPattern: "/mto-shipments/{mtoShipmentID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &DeleteMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*DeleteMTOShipmentNoContent) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for deleteMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOAgent updates m t o agent - - ### Functionality - -This endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body. - -### Errors: -The agent must always have a name and at least one method of contact (either `email` or `phone`). - -The agent must be associated with the MTO shipment passed in the url. - -The shipment should be associated with an MTO that is available to the Prime. -If the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. -*/ -func (a *Client) UpdateMTOAgent(params *UpdateMTOAgentParams, opts ...ClientOption) (*UpdateMTOAgentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOAgentParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOAgent", - Method: "PUT", - PathPattern: "/mto-shipments/{mtoShipmentID}/agents/{agentID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOAgentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOAgentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOAgent: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOShipment updates m t o shipment - - _[Deprecated: this endpoint was deprecated on August 5th, 2024]_ - -Please use the new endpoint at `/prime/v3/updateMTOShipment` instead. -*/ -func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) error { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipment", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - _, err := a.transport.Submit(op) - if err != nil { - return err - } - return nil -} - -/* - UpdateMTOShipmentAddress updates m t o shipment address - - ### Functionality - -This endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID. -Therefore a complete address should be sent in the request. -When a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match. - -This endpoint **cannot create** an address. -To create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address. - -### Errors -The address must be associated with the mtoShipment passed in the url. -In other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided. -If it is not, caller will receive a **Conflict** Error. - -The mtoShipment should be associated with an MTO that is available to prime. -If the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error. -*/ -func (a *Client) UpdateMTOShipmentAddress(params *UpdateMTOShipmentAddressParams, opts ...ClientOption) (*UpdateMTOShipmentAddressOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentAddressParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipmentAddress", - Method: "PUT", - PathPattern: "/mto-shipments/{mtoShipmentID}/addresses/{addressID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentAddressReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOShipmentAddressOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOShipmentAddress: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOShipmentStatus updates m t o shipment status - - ### Functionality - -This endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment -status to be changed to "CANCELED." Currently, the Prime cannot update the shipment to any other status. -*/ -func (a *Client) UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentStatusParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipmentStatus", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentStatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOShipmentStatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOShipmentStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateReweigh updates reweigh - - ### Functionality - -This endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur. -Only one of weight or verificationReason should be sent in the request body. - -A reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment. -A reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed, -so not all shipments will have a reweigh weight. -*/ -func (a *Client) UpdateReweigh(params *UpdateReweighParams, opts ...ClientOption) (*UpdateReweighOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateReweighParams() - } - op := &runtime.ClientOperation{ - ID: "updateReweigh", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateReweighReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateReweighOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateReweigh: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateShipmentDestinationAddress updates shipment destination address - - ### Functionality - -This endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment, -after the delivery address has already been approved. - -This endpoint and operation only supports the following shipment types: -- HHG -- NTSR - -For HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved. - -Address updates will be automatically approved unless they change: - - The service area - - Mileage bracket for direct delivery - - the address and the distance between the old and new address is > 50 - - Domestic Short Haul to Domestic Line Haul or vice versa - - Shipments that start and end in one ZIP3 use Short Haul pricing - - Shipments that start and end in different ZIP3s use Line Haul pricing - -For those, changes will require TOO approval. -*/ -func (a *Client) UpdateShipmentDestinationAddress(params *UpdateShipmentDestinationAddressParams, opts ...ClientOption) (*UpdateShipmentDestinationAddressCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateShipmentDestinationAddressParams() - } - op := &runtime.ClientOperation{ - ID: "updateShipmentDestinationAddress", - Method: "POST", - PathPattern: "/mto-shipments/{mtoShipmentID}/shipment-address-updates", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateShipmentDestinationAddressReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateShipmentDestinationAddressCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateShipmentDestinationAddress: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go deleted file mode 100644 index 611cd7b791b..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOAgentParams creates a new UpdateMTOAgentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOAgentParams() *UpdateMTOAgentParams { - return &UpdateMTOAgentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOAgentParamsWithTimeout creates a new UpdateMTOAgentParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOAgentParamsWithTimeout(timeout time.Duration) *UpdateMTOAgentParams { - return &UpdateMTOAgentParams{ - timeout: timeout, - } -} - -// NewUpdateMTOAgentParamsWithContext creates a new UpdateMTOAgentParams object -// with the ability to set a context for a request. -func NewUpdateMTOAgentParamsWithContext(ctx context.Context) *UpdateMTOAgentParams { - return &UpdateMTOAgentParams{ - Context: ctx, - } -} - -// NewUpdateMTOAgentParamsWithHTTPClient creates a new UpdateMTOAgentParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOAgentParamsWithHTTPClient(client *http.Client) *UpdateMTOAgentParams { - return &UpdateMTOAgentParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOAgentParams contains all the parameters to send to the API endpoint - - for the update m t o agent operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOAgentParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - /* AgentID. - - UUID of the agent being updated - - Format: uuid - */ - AgentID strfmt.UUID - - // Body. - Body *primemessages.MTOAgent - - /* MtoShipmentID. - - UUID of the shipment associated with the agent - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOAgentParams) WithDefaults() *UpdateMTOAgentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o agent params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOAgentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o agent params -func (o *UpdateMTOAgentParams) WithTimeout(timeout time.Duration) *UpdateMTOAgentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o agent params -func (o *UpdateMTOAgentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o agent params -func (o *UpdateMTOAgentParams) WithContext(ctx context.Context) *UpdateMTOAgentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o agent params -func (o *UpdateMTOAgentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o agent params -func (o *UpdateMTOAgentParams) WithHTTPClient(client *http.Client) *UpdateMTOAgentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o agent params -func (o *UpdateMTOAgentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o agent params -func (o *UpdateMTOAgentParams) WithIfMatch(ifMatch string) *UpdateMTOAgentParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o agent params -func (o *UpdateMTOAgentParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithAgentID adds the agentID to the update m t o agent params -func (o *UpdateMTOAgentParams) WithAgentID(agentID strfmt.UUID) *UpdateMTOAgentParams { - o.SetAgentID(agentID) - return o -} - -// SetAgentID adds the agentId to the update m t o agent params -func (o *UpdateMTOAgentParams) SetAgentID(agentID strfmt.UUID) { - o.AgentID = agentID -} - -// WithBody adds the body to the update m t o agent params -func (o *UpdateMTOAgentParams) WithBody(body *primemessages.MTOAgent) *UpdateMTOAgentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o agent params -func (o *UpdateMTOAgentParams) SetBody(body *primemessages.MTOAgent) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o agent params -func (o *UpdateMTOAgentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOAgentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o agent params -func (o *UpdateMTOAgentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - - // path param agentID - if err := r.SetPathParam("agentID", o.AgentID.String()); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go deleted file mode 100644 index fddd31990bc..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOAgentReader is a Reader for the UpdateMTOAgent structure. -type UpdateMTOAgentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOAgentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOAgentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOAgentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOAgentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOAgentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOAgentPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOAgentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOAgentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}] updateMTOAgent", response, response.Code()) - } -} - -// NewUpdateMTOAgentOK creates a UpdateMTOAgentOK with default headers values -func NewUpdateMTOAgentOK() *UpdateMTOAgentOK { - return &UpdateMTOAgentOK{} -} - -/* -UpdateMTOAgentOK describes a response with status code 200, with default header values. - -Successfully updated the agent. -*/ -type UpdateMTOAgentOK struct { - Payload *primemessages.MTOAgent -} - -// IsSuccess returns true when this update m t o agent o k response has a 2xx status code -func (o *UpdateMTOAgentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o agent o k response has a 3xx status code -func (o *UpdateMTOAgentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent o k response has a 4xx status code -func (o *UpdateMTOAgentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o agent o k response has a 5xx status code -func (o *UpdateMTOAgentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent o k response a status code equal to that given -func (o *UpdateMTOAgentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o agent o k response -func (o *UpdateMTOAgentOK) Code() int { - return 200 -} - -func (o *UpdateMTOAgentOK) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOAgentOK) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOAgentOK) GetPayload() *primemessages.MTOAgent { - return o.Payload -} - -func (o *UpdateMTOAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.MTOAgent) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentBadRequest creates a UpdateMTOAgentBadRequest with default headers values -func NewUpdateMTOAgentBadRequest() *UpdateMTOAgentBadRequest { - return &UpdateMTOAgentBadRequest{} -} - -/* -UpdateMTOAgentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOAgentBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o agent bad request response has a 2xx status code -func (o *UpdateMTOAgentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent bad request response has a 3xx status code -func (o *UpdateMTOAgentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent bad request response has a 4xx status code -func (o *UpdateMTOAgentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent bad request response has a 5xx status code -func (o *UpdateMTOAgentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent bad request response a status code equal to that given -func (o *UpdateMTOAgentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o agent bad request response -func (o *UpdateMTOAgentBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOAgentBadRequest) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOAgentBadRequest) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOAgentBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOAgentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentUnauthorized creates a UpdateMTOAgentUnauthorized with default headers values -func NewUpdateMTOAgentUnauthorized() *UpdateMTOAgentUnauthorized { - return &UpdateMTOAgentUnauthorized{} -} - -/* -UpdateMTOAgentUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOAgentUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o agent unauthorized response has a 2xx status code -func (o *UpdateMTOAgentUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent unauthorized response has a 3xx status code -func (o *UpdateMTOAgentUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent unauthorized response has a 4xx status code -func (o *UpdateMTOAgentUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent unauthorized response has a 5xx status code -func (o *UpdateMTOAgentUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent unauthorized response a status code equal to that given -func (o *UpdateMTOAgentUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o agent unauthorized response -func (o *UpdateMTOAgentUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOAgentUnauthorized) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOAgentUnauthorized) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOAgentUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOAgentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentForbidden creates a UpdateMTOAgentForbidden with default headers values -func NewUpdateMTOAgentForbidden() *UpdateMTOAgentForbidden { - return &UpdateMTOAgentForbidden{} -} - -/* -UpdateMTOAgentForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOAgentForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o agent forbidden response has a 2xx status code -func (o *UpdateMTOAgentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent forbidden response has a 3xx status code -func (o *UpdateMTOAgentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent forbidden response has a 4xx status code -func (o *UpdateMTOAgentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent forbidden response has a 5xx status code -func (o *UpdateMTOAgentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent forbidden response a status code equal to that given -func (o *UpdateMTOAgentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o agent forbidden response -func (o *UpdateMTOAgentForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOAgentForbidden) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOAgentForbidden) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOAgentForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentNotFound creates a UpdateMTOAgentNotFound with default headers values -func NewUpdateMTOAgentNotFound() *UpdateMTOAgentNotFound { - return &UpdateMTOAgentNotFound{} -} - -/* -UpdateMTOAgentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOAgentNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o agent not found response has a 2xx status code -func (o *UpdateMTOAgentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent not found response has a 3xx status code -func (o *UpdateMTOAgentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent not found response has a 4xx status code -func (o *UpdateMTOAgentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent not found response has a 5xx status code -func (o *UpdateMTOAgentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent not found response a status code equal to that given -func (o *UpdateMTOAgentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o agent not found response -func (o *UpdateMTOAgentNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOAgentNotFound) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOAgentNotFound) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOAgentNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentPreconditionFailed creates a UpdateMTOAgentPreconditionFailed with default headers values -func NewUpdateMTOAgentPreconditionFailed() *UpdateMTOAgentPreconditionFailed { - return &UpdateMTOAgentPreconditionFailed{} -} - -/* -UpdateMTOAgentPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOAgentPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o agent precondition failed response has a 2xx status code -func (o *UpdateMTOAgentPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent precondition failed response has a 3xx status code -func (o *UpdateMTOAgentPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent precondition failed response has a 4xx status code -func (o *UpdateMTOAgentPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent precondition failed response has a 5xx status code -func (o *UpdateMTOAgentPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent precondition failed response a status code equal to that given -func (o *UpdateMTOAgentPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o agent precondition failed response -func (o *UpdateMTOAgentPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOAgentPreconditionFailed) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOAgentPreconditionFailed) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOAgentPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOAgentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentUnprocessableEntity creates a UpdateMTOAgentUnprocessableEntity with default headers values -func NewUpdateMTOAgentUnprocessableEntity() *UpdateMTOAgentUnprocessableEntity { - return &UpdateMTOAgentUnprocessableEntity{} -} - -/* -UpdateMTOAgentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOAgentUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update m t o agent unprocessable entity response has a 2xx status code -func (o *UpdateMTOAgentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent unprocessable entity response has a 3xx status code -func (o *UpdateMTOAgentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent unprocessable entity response has a 4xx status code -func (o *UpdateMTOAgentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o agent unprocessable entity response has a 5xx status code -func (o *UpdateMTOAgentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o agent unprocessable entity response a status code equal to that given -func (o *UpdateMTOAgentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o agent unprocessable entity response -func (o *UpdateMTOAgentUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOAgentUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOAgentUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOAgentUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOAgentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOAgentInternalServerError creates a UpdateMTOAgentInternalServerError with default headers values -func NewUpdateMTOAgentInternalServerError() *UpdateMTOAgentInternalServerError { - return &UpdateMTOAgentInternalServerError{} -} - -/* -UpdateMTOAgentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOAgentInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update m t o agent internal server error response has a 2xx status code -func (o *UpdateMTOAgentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o agent internal server error response has a 3xx status code -func (o *UpdateMTOAgentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o agent internal server error response has a 4xx status code -func (o *UpdateMTOAgentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o agent internal server error response has a 5xx status code -func (o *UpdateMTOAgentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o agent internal server error response a status code equal to that given -func (o *UpdateMTOAgentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o agent internal server error response -func (o *UpdateMTOAgentInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOAgentInternalServerError) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOAgentInternalServerError) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOAgentInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateMTOAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go deleted file mode 100644 index 332c013d92c..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOShipmentAddressParams creates a new UpdateMTOShipmentAddressParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentAddressParams() *UpdateMTOShipmentAddressParams { - return &UpdateMTOShipmentAddressParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentAddressParamsWithTimeout creates a new UpdateMTOShipmentAddressParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentAddressParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentAddressParams { - return &UpdateMTOShipmentAddressParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentAddressParamsWithContext creates a new UpdateMTOShipmentAddressParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentAddressParamsWithContext(ctx context.Context) *UpdateMTOShipmentAddressParams { - return &UpdateMTOShipmentAddressParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentAddressParamsWithHTTPClient creates a new UpdateMTOShipmentAddressParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentAddressParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentAddressParams { - return &UpdateMTOShipmentAddressParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentAddressParams contains all the parameters to send to the API endpoint - - for the update m t o shipment address operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentAddressParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - /* AddressID. - - UUID of the address being updated - - Format: uuid - */ - AddressID strfmt.UUID - - // Body. - Body *primemessages.Address - - /* MtoShipmentID. - - UUID of the shipment associated with the address - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment address params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentAddressParams) WithDefaults() *UpdateMTOShipmentAddressParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment address params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentAddressParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentAddressParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithContext(ctx context.Context) *UpdateMTOShipmentAddressParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentAddressParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentAddressParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithAddressID adds the addressID to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithAddressID(addressID strfmt.UUID) *UpdateMTOShipmentAddressParams { - o.SetAddressID(addressID) - return o -} - -// SetAddressID adds the addressId to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetAddressID(addressID strfmt.UUID) { - o.AddressID = addressID -} - -// WithBody adds the body to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithBody(body *primemessages.Address) *UpdateMTOShipmentAddressParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetBody(body *primemessages.Address) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentAddressParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment address params -func (o *UpdateMTOShipmentAddressParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - - // path param addressID - if err := r.SetPathParam("addressID", o.AddressID.String()); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go deleted file mode 100644 index cd19899d62b..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOShipmentAddressReader is a Reader for the UpdateMTOShipmentAddress structure. -type UpdateMTOShipmentAddressReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOShipmentAddressOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOShipmentAddressBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOShipmentAddressUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOShipmentAddressForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOShipmentAddressNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOShipmentAddressConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOShipmentAddressPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOShipmentAddressUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOShipmentAddressInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}] updateMTOShipmentAddress", response, response.Code()) - } -} - -// NewUpdateMTOShipmentAddressOK creates a UpdateMTOShipmentAddressOK with default headers values -func NewUpdateMTOShipmentAddressOK() *UpdateMTOShipmentAddressOK { - return &UpdateMTOShipmentAddressOK{} -} - -/* -UpdateMTOShipmentAddressOK describes a response with status code 200, with default header values. - -Successfully updated the address. -*/ -type UpdateMTOShipmentAddressOK struct { - Payload *primemessages.Address -} - -// IsSuccess returns true when this update m t o shipment address o k response has a 2xx status code -func (o *UpdateMTOShipmentAddressOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o shipment address o k response has a 3xx status code -func (o *UpdateMTOShipmentAddressOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address o k response has a 4xx status code -func (o *UpdateMTOShipmentAddressOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment address o k response has a 5xx status code -func (o *UpdateMTOShipmentAddressOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address o k response a status code equal to that given -func (o *UpdateMTOShipmentAddressOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o shipment address o k response -func (o *UpdateMTOShipmentAddressOK) Code() int { - return 200 -} - -func (o *UpdateMTOShipmentAddressOK) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentAddressOK) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentAddressOK) GetPayload() *primemessages.Address { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Address) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressBadRequest creates a UpdateMTOShipmentAddressBadRequest with default headers values -func NewUpdateMTOShipmentAddressBadRequest() *UpdateMTOShipmentAddressBadRequest { - return &UpdateMTOShipmentAddressBadRequest{} -} - -/* -UpdateMTOShipmentAddressBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOShipmentAddressBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address bad request response has a 2xx status code -func (o *UpdateMTOShipmentAddressBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address bad request response has a 3xx status code -func (o *UpdateMTOShipmentAddressBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address bad request response has a 4xx status code -func (o *UpdateMTOShipmentAddressBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address bad request response has a 5xx status code -func (o *UpdateMTOShipmentAddressBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address bad request response a status code equal to that given -func (o *UpdateMTOShipmentAddressBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o shipment address bad request response -func (o *UpdateMTOShipmentAddressBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOShipmentAddressBadRequest) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentAddressBadRequest) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentAddressBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressUnauthorized creates a UpdateMTOShipmentAddressUnauthorized with default headers values -func NewUpdateMTOShipmentAddressUnauthorized() *UpdateMTOShipmentAddressUnauthorized { - return &UpdateMTOShipmentAddressUnauthorized{} -} - -/* -UpdateMTOShipmentAddressUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentAddressUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address unauthorized response has a 2xx status code -func (o *UpdateMTOShipmentAddressUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address unauthorized response has a 3xx status code -func (o *UpdateMTOShipmentAddressUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address unauthorized response has a 4xx status code -func (o *UpdateMTOShipmentAddressUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address unauthorized response has a 5xx status code -func (o *UpdateMTOShipmentAddressUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address unauthorized response a status code equal to that given -func (o *UpdateMTOShipmentAddressUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o shipment address unauthorized response -func (o *UpdateMTOShipmentAddressUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOShipmentAddressUnauthorized) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentAddressUnauthorized) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentAddressUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressForbidden creates a UpdateMTOShipmentAddressForbidden with default headers values -func NewUpdateMTOShipmentAddressForbidden() *UpdateMTOShipmentAddressForbidden { - return &UpdateMTOShipmentAddressForbidden{} -} - -/* -UpdateMTOShipmentAddressForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentAddressForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address forbidden response has a 2xx status code -func (o *UpdateMTOShipmentAddressForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address forbidden response has a 3xx status code -func (o *UpdateMTOShipmentAddressForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address forbidden response has a 4xx status code -func (o *UpdateMTOShipmentAddressForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address forbidden response has a 5xx status code -func (o *UpdateMTOShipmentAddressForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address forbidden response a status code equal to that given -func (o *UpdateMTOShipmentAddressForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o shipment address forbidden response -func (o *UpdateMTOShipmentAddressForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOShipmentAddressForbidden) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentAddressForbidden) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentAddressForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressNotFound creates a UpdateMTOShipmentAddressNotFound with default headers values -func NewUpdateMTOShipmentAddressNotFound() *UpdateMTOShipmentAddressNotFound { - return &UpdateMTOShipmentAddressNotFound{} -} - -/* -UpdateMTOShipmentAddressNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOShipmentAddressNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address not found response has a 2xx status code -func (o *UpdateMTOShipmentAddressNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address not found response has a 3xx status code -func (o *UpdateMTOShipmentAddressNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address not found response has a 4xx status code -func (o *UpdateMTOShipmentAddressNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address not found response has a 5xx status code -func (o *UpdateMTOShipmentAddressNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address not found response a status code equal to that given -func (o *UpdateMTOShipmentAddressNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o shipment address not found response -func (o *UpdateMTOShipmentAddressNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOShipmentAddressNotFound) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentAddressNotFound) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentAddressNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressConflict creates a UpdateMTOShipmentAddressConflict with default headers values -func NewUpdateMTOShipmentAddressConflict() *UpdateMTOShipmentAddressConflict { - return &UpdateMTOShipmentAddressConflict{} -} - -/* -UpdateMTOShipmentAddressConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateMTOShipmentAddressConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address conflict response has a 2xx status code -func (o *UpdateMTOShipmentAddressConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address conflict response has a 3xx status code -func (o *UpdateMTOShipmentAddressConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address conflict response has a 4xx status code -func (o *UpdateMTOShipmentAddressConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address conflict response has a 5xx status code -func (o *UpdateMTOShipmentAddressConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address conflict response a status code equal to that given -func (o *UpdateMTOShipmentAddressConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o shipment address conflict response -func (o *UpdateMTOShipmentAddressConflict) Code() int { - return 409 -} - -func (o *UpdateMTOShipmentAddressConflict) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentAddressConflict) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentAddressConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressPreconditionFailed creates a UpdateMTOShipmentAddressPreconditionFailed with default headers values -func NewUpdateMTOShipmentAddressPreconditionFailed() *UpdateMTOShipmentAddressPreconditionFailed { - return &UpdateMTOShipmentAddressPreconditionFailed{} -} - -/* -UpdateMTOShipmentAddressPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOShipmentAddressPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment address precondition failed response has a 2xx status code -func (o *UpdateMTOShipmentAddressPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address precondition failed response has a 3xx status code -func (o *UpdateMTOShipmentAddressPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address precondition failed response has a 4xx status code -func (o *UpdateMTOShipmentAddressPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address precondition failed response has a 5xx status code -func (o *UpdateMTOShipmentAddressPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address precondition failed response a status code equal to that given -func (o *UpdateMTOShipmentAddressPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o shipment address precondition failed response -func (o *UpdateMTOShipmentAddressPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOShipmentAddressPreconditionFailed) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentAddressPreconditionFailed) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentAddressPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressUnprocessableEntity creates a UpdateMTOShipmentAddressUnprocessableEntity with default headers values -func NewUpdateMTOShipmentAddressUnprocessableEntity() *UpdateMTOShipmentAddressUnprocessableEntity { - return &UpdateMTOShipmentAddressUnprocessableEntity{} -} - -/* -UpdateMTOShipmentAddressUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOShipmentAddressUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update m t o shipment address unprocessable entity response has a 2xx status code -func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address unprocessable entity response has a 3xx status code -func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address unprocessable entity response has a 4xx status code -func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment address unprocessable entity response has a 5xx status code -func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment address unprocessable entity response a status code equal to that given -func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o shipment address unprocessable entity response -func (o *UpdateMTOShipmentAddressUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOShipmentAddressUnprocessableEntity) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentAddressUnprocessableEntity) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentAddressUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentAddressInternalServerError creates a UpdateMTOShipmentAddressInternalServerError with default headers values -func NewUpdateMTOShipmentAddressInternalServerError() *UpdateMTOShipmentAddressInternalServerError { - return &UpdateMTOShipmentAddressInternalServerError{} -} - -/* -UpdateMTOShipmentAddressInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOShipmentAddressInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update m t o shipment address internal server error response has a 2xx status code -func (o *UpdateMTOShipmentAddressInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment address internal server error response has a 3xx status code -func (o *UpdateMTOShipmentAddressInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment address internal server error response has a 4xx status code -func (o *UpdateMTOShipmentAddressInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment address internal server error response has a 5xx status code -func (o *UpdateMTOShipmentAddressInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o shipment address internal server error response a status code equal to that given -func (o *UpdateMTOShipmentAddressInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o shipment address internal server error response -func (o *UpdateMTOShipmentAddressInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOShipmentAddressInternalServerError) Error() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentAddressInternalServerError) String() string { - return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentAddressInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateMTOShipmentAddressInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index f31813c4262..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the update m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentParams struct { - - /* MtoShipmentID. - - UUID of the shipment being updated. - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 5782f7b66ac..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,88 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. -type UpdateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 410: - result := NewUpdateMTOShipmentGone() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) - } -} - -// NewUpdateMTOShipmentGone creates a UpdateMTOShipmentGone with default headers values -func NewUpdateMTOShipmentGone() *UpdateMTOShipmentGone { - return &UpdateMTOShipmentGone{} -} - -/* -UpdateMTOShipmentGone describes a response with status code 410, with default header values. - -This endpoint is deprecated. Please use `/prime/v3/updateMTOShipment` instead. -*/ -type UpdateMTOShipmentGone struct { -} - -// IsSuccess returns true when this update m t o shipment gone response has a 2xx status code -func (o *UpdateMTOShipmentGone) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment gone response has a 3xx status code -func (o *UpdateMTOShipmentGone) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment gone response has a 4xx status code -func (o *UpdateMTOShipmentGone) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment gone response has a 5xx status code -func (o *UpdateMTOShipmentGone) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment gone response a status code equal to that given -func (o *UpdateMTOShipmentGone) IsCode(code int) bool { - return code == 410 -} - -// Code gets the status code for the update m t o shipment gone response -func (o *UpdateMTOShipmentGone) Code() int { - return 410 -} - -func (o *UpdateMTOShipmentGone) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentGone ", 410) -} - -func (o *UpdateMTOShipmentGone) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentGone ", 410) -} - -func (o *UpdateMTOShipmentGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go deleted file mode 100644 index 9d2b81b6c2e..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentStatusParams() *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentStatusParamsWithTimeout creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentStatusParamsWithContext creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentStatusParamsWithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentStatusParamsWithHTTPClient creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentStatusParams contains all the parameters to send to the API endpoint - - for the update m t o shipment status operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentStatusParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *primemessages.UpdateMTOShipmentStatus - - /* MtoShipmentID. - - UUID of the shipment associated with the agent - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentStatusParams) WithDefaults() *UpdateMTOShipmentStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentStatusParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithBody(body *primemessages.UpdateMTOShipmentStatus) *UpdateMTOShipmentStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetBody(body *primemessages.UpdateMTOShipmentStatus) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentStatusParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go deleted file mode 100644 index 45dd6401c29..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateMTOShipmentStatusReader is a Reader for the UpdateMTOShipmentStatus structure. -type UpdateMTOShipmentStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOShipmentStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOShipmentStatusBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOShipmentStatusUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOShipmentStatusForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOShipmentStatusNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOShipmentStatusConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOShipmentStatusPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOShipmentStatusUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOShipmentStatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/status] updateMTOShipmentStatus", response, response.Code()) - } -} - -// NewUpdateMTOShipmentStatusOK creates a UpdateMTOShipmentStatusOK with default headers values -func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { - return &UpdateMTOShipmentStatusOK{} -} - -/* -UpdateMTOShipmentStatusOK describes a response with status code 200, with default header values. - -Successfully updated the shipment's status. -*/ -type UpdateMTOShipmentStatusOK struct { - Payload *primemessages.MTOShipment -} - -// IsSuccess returns true when this update m t o shipment status o k response has a 2xx status code -func (o *UpdateMTOShipmentStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o shipment status o k response has a 3xx status code -func (o *UpdateMTOShipmentStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status o k response has a 4xx status code -func (o *UpdateMTOShipmentStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment status o k response has a 5xx status code -func (o *UpdateMTOShipmentStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status o k response a status code equal to that given -func (o *UpdateMTOShipmentStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) Code() int { - return 200 -} - -func (o *UpdateMTOShipmentStatusOK) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentStatusOK) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentStatusOK) GetPayload() *primemessages.MTOShipment { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusBadRequest creates a UpdateMTOShipmentStatusBadRequest with default headers values -func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { - return &UpdateMTOShipmentStatusBadRequest{} -} - -/* -UpdateMTOShipmentStatusBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOShipmentStatusBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status bad request response has a 2xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status bad request response has a 3xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status bad request response has a 4xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status bad request response has a 5xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status bad request response a status code equal to that given -func (o *UpdateMTOShipmentStatusBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOShipmentStatusBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentStatusBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentStatusBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusUnauthorized creates a UpdateMTOShipmentStatusUnauthorized with default headers values -func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { - return &UpdateMTOShipmentStatusUnauthorized{} -} - -/* -UpdateMTOShipmentStatusUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentStatusUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status unauthorized response has a 2xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status unauthorized response has a 3xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status unauthorized response has a 4xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status unauthorized response has a 5xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status unauthorized response a status code equal to that given -func (o *UpdateMTOShipmentStatusUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOShipmentStatusUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusForbidden creates a UpdateMTOShipmentStatusForbidden with default headers values -func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { - return &UpdateMTOShipmentStatusForbidden{} -} - -/* -UpdateMTOShipmentStatusForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentStatusForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status forbidden response has a 2xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status forbidden response has a 3xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status forbidden response has a 4xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status forbidden response has a 5xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status forbidden response a status code equal to that given -func (o *UpdateMTOShipmentStatusForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOShipmentStatusForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentStatusForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentStatusForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusNotFound creates a UpdateMTOShipmentStatusNotFound with default headers values -func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { - return &UpdateMTOShipmentStatusNotFound{} -} - -/* -UpdateMTOShipmentStatusNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOShipmentStatusNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status not found response has a 2xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status not found response has a 3xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status not found response has a 4xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status not found response has a 5xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status not found response a status code equal to that given -func (o *UpdateMTOShipmentStatusNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOShipmentStatusNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentStatusNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentStatusNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusConflict creates a UpdateMTOShipmentStatusConflict with default headers values -func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { - return &UpdateMTOShipmentStatusConflict{} -} - -/* -UpdateMTOShipmentStatusConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateMTOShipmentStatusConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status conflict response has a 2xx status code -func (o *UpdateMTOShipmentStatusConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status conflict response has a 3xx status code -func (o *UpdateMTOShipmentStatusConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status conflict response has a 4xx status code -func (o *UpdateMTOShipmentStatusConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status conflict response has a 5xx status code -func (o *UpdateMTOShipmentStatusConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status conflict response a status code equal to that given -func (o *UpdateMTOShipmentStatusConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) Code() int { - return 409 -} - -func (o *UpdateMTOShipmentStatusConflict) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentStatusConflict) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentStatusConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusPreconditionFailed creates a UpdateMTOShipmentStatusPreconditionFailed with default headers values -func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { - return &UpdateMTOShipmentStatusPreconditionFailed{} -} - -/* -UpdateMTOShipmentStatusPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOShipmentStatusPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status precondition failed response has a 2xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status precondition failed response has a 3xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status precondition failed response has a 4xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status precondition failed response has a 5xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status precondition failed response a status code equal to that given -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusUnprocessableEntity creates a UpdateMTOShipmentStatusUnprocessableEntity with default headers values -func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { - return &UpdateMTOShipmentStatusUnprocessableEntity{} -} - -/* -UpdateMTOShipmentStatusUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOShipmentStatusUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update m t o shipment status unprocessable entity response has a 2xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status unprocessable entity response has a 3xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status unprocessable entity response has a 4xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status unprocessable entity response has a 5xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status unprocessable entity response a status code equal to that given -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusInternalServerError creates a UpdateMTOShipmentStatusInternalServerError with default headers values -func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { - return &UpdateMTOShipmentStatusInternalServerError{} -} - -/* -UpdateMTOShipmentStatusInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOShipmentStatusInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update m t o shipment status internal server error response has a 2xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status internal server error response has a 3xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status internal server error response has a 4xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment status internal server error response has a 5xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o shipment status internal server error response a status code equal to that given -func (o *UpdateMTOShipmentStatusInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOShipmentStatusInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentStatusInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentStatusInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go b/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go deleted file mode 100644 index 79abdbab5dd..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go +++ /dev/null @@ -1,221 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateReweighParams creates a new UpdateReweighParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateReweighParams() *UpdateReweighParams { - return &UpdateReweighParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateReweighParamsWithTimeout creates a new UpdateReweighParams object -// with the ability to set a timeout on a request. -func NewUpdateReweighParamsWithTimeout(timeout time.Duration) *UpdateReweighParams { - return &UpdateReweighParams{ - timeout: timeout, - } -} - -// NewUpdateReweighParamsWithContext creates a new UpdateReweighParams object -// with the ability to set a context for a request. -func NewUpdateReweighParamsWithContext(ctx context.Context) *UpdateReweighParams { - return &UpdateReweighParams{ - Context: ctx, - } -} - -// NewUpdateReweighParamsWithHTTPClient creates a new UpdateReweighParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateReweighParamsWithHTTPClient(client *http.Client) *UpdateReweighParams { - return &UpdateReweighParams{ - HTTPClient: client, - } -} - -/* -UpdateReweighParams contains all the parameters to send to the API endpoint - - for the update reweigh operation. - - Typically these are written to a http.Request. -*/ -type UpdateReweighParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *primemessages.UpdateReweigh - - /* MtoShipmentID. - - UUID of the shipment associated with the reweigh - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - /* ReweighID. - - UUID of the reweigh being updated - - Format: uuid - */ - ReweighID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update reweigh params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateReweighParams) WithDefaults() *UpdateReweighParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update reweigh params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateReweighParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update reweigh params -func (o *UpdateReweighParams) WithTimeout(timeout time.Duration) *UpdateReweighParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update reweigh params -func (o *UpdateReweighParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update reweigh params -func (o *UpdateReweighParams) WithContext(ctx context.Context) *UpdateReweighParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update reweigh params -func (o *UpdateReweighParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update reweigh params -func (o *UpdateReweighParams) WithHTTPClient(client *http.Client) *UpdateReweighParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update reweigh params -func (o *UpdateReweighParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update reweigh params -func (o *UpdateReweighParams) WithIfMatch(ifMatch string) *UpdateReweighParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update reweigh params -func (o *UpdateReweighParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update reweigh params -func (o *UpdateReweighParams) WithBody(body *primemessages.UpdateReweigh) *UpdateReweighParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update reweigh params -func (o *UpdateReweighParams) SetBody(body *primemessages.UpdateReweigh) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update reweigh params -func (o *UpdateReweighParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateReweighParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update reweigh params -func (o *UpdateReweighParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WithReweighID adds the reweighID to the update reweigh params -func (o *UpdateReweighParams) WithReweighID(reweighID strfmt.UUID) *UpdateReweighParams { - o.SetReweighID(reweighID) - return o -} - -// SetReweighID adds the reweighId to the update reweigh params -func (o *UpdateReweighParams) SetReweighID(reweighID strfmt.UUID) { - o.ReweighID = reweighID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateReweighParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - // path param reweighID - if err := r.SetPathParam("reweighID", o.ReweighID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go b/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go deleted file mode 100644 index 40887991a4c..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateReweighReader is a Reader for the UpdateReweigh structure. -type UpdateReweighReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateReweighReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateReweighOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateReweighBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateReweighUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateReweighForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateReweighNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateReweighConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateReweighPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateReweighUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateReweighInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}] updateReweigh", response, response.Code()) - } -} - -// NewUpdateReweighOK creates a UpdateReweighOK with default headers values -func NewUpdateReweighOK() *UpdateReweighOK { - return &UpdateReweighOK{} -} - -/* -UpdateReweighOK describes a response with status code 200, with default header values. - -Successfully updated the reweigh. -*/ -type UpdateReweighOK struct { - Payload *primemessages.Reweigh -} - -// IsSuccess returns true when this update reweigh o k response has a 2xx status code -func (o *UpdateReweighOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update reweigh o k response has a 3xx status code -func (o *UpdateReweighOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh o k response has a 4xx status code -func (o *UpdateReweighOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update reweigh o k response has a 5xx status code -func (o *UpdateReweighOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh o k response a status code equal to that given -func (o *UpdateReweighOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update reweigh o k response -func (o *UpdateReweighOK) Code() int { - return 200 -} - -func (o *UpdateReweighOK) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighOK %+v", 200, o.Payload) -} - -func (o *UpdateReweighOK) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighOK %+v", 200, o.Payload) -} - -func (o *UpdateReweighOK) GetPayload() *primemessages.Reweigh { - return o.Payload -} - -func (o *UpdateReweighOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Reweigh) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighBadRequest creates a UpdateReweighBadRequest with default headers values -func NewUpdateReweighBadRequest() *UpdateReweighBadRequest { - return &UpdateReweighBadRequest{} -} - -/* -UpdateReweighBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateReweighBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh bad request response has a 2xx status code -func (o *UpdateReweighBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh bad request response has a 3xx status code -func (o *UpdateReweighBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh bad request response has a 4xx status code -func (o *UpdateReweighBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh bad request response has a 5xx status code -func (o *UpdateReweighBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh bad request response a status code equal to that given -func (o *UpdateReweighBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update reweigh bad request response -func (o *UpdateReweighBadRequest) Code() int { - return 400 -} - -func (o *UpdateReweighBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateReweighBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateReweighBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighUnauthorized creates a UpdateReweighUnauthorized with default headers values -func NewUpdateReweighUnauthorized() *UpdateReweighUnauthorized { - return &UpdateReweighUnauthorized{} -} - -/* -UpdateReweighUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateReweighUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh unauthorized response has a 2xx status code -func (o *UpdateReweighUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh unauthorized response has a 3xx status code -func (o *UpdateReweighUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh unauthorized response has a 4xx status code -func (o *UpdateReweighUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh unauthorized response has a 5xx status code -func (o *UpdateReweighUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh unauthorized response a status code equal to that given -func (o *UpdateReweighUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update reweigh unauthorized response -func (o *UpdateReweighUnauthorized) Code() int { - return 401 -} - -func (o *UpdateReweighUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateReweighUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateReweighUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighForbidden creates a UpdateReweighForbidden with default headers values -func NewUpdateReweighForbidden() *UpdateReweighForbidden { - return &UpdateReweighForbidden{} -} - -/* -UpdateReweighForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateReweighForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh forbidden response has a 2xx status code -func (o *UpdateReweighForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh forbidden response has a 3xx status code -func (o *UpdateReweighForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh forbidden response has a 4xx status code -func (o *UpdateReweighForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh forbidden response has a 5xx status code -func (o *UpdateReweighForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh forbidden response a status code equal to that given -func (o *UpdateReweighForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update reweigh forbidden response -func (o *UpdateReweighForbidden) Code() int { - return 403 -} - -func (o *UpdateReweighForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighForbidden %+v", 403, o.Payload) -} - -func (o *UpdateReweighForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighForbidden %+v", 403, o.Payload) -} - -func (o *UpdateReweighForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighNotFound creates a UpdateReweighNotFound with default headers values -func NewUpdateReweighNotFound() *UpdateReweighNotFound { - return &UpdateReweighNotFound{} -} - -/* -UpdateReweighNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateReweighNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh not found response has a 2xx status code -func (o *UpdateReweighNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh not found response has a 3xx status code -func (o *UpdateReweighNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh not found response has a 4xx status code -func (o *UpdateReweighNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh not found response has a 5xx status code -func (o *UpdateReweighNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh not found response a status code equal to that given -func (o *UpdateReweighNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update reweigh not found response -func (o *UpdateReweighNotFound) Code() int { - return 404 -} - -func (o *UpdateReweighNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighNotFound %+v", 404, o.Payload) -} - -func (o *UpdateReweighNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighNotFound %+v", 404, o.Payload) -} - -func (o *UpdateReweighNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighConflict creates a UpdateReweighConflict with default headers values -func NewUpdateReweighConflict() *UpdateReweighConflict { - return &UpdateReweighConflict{} -} - -/* -UpdateReweighConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateReweighConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh conflict response has a 2xx status code -func (o *UpdateReweighConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh conflict response has a 3xx status code -func (o *UpdateReweighConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh conflict response has a 4xx status code -func (o *UpdateReweighConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh conflict response has a 5xx status code -func (o *UpdateReweighConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh conflict response a status code equal to that given -func (o *UpdateReweighConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update reweigh conflict response -func (o *UpdateReweighConflict) Code() int { - return 409 -} - -func (o *UpdateReweighConflict) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighConflict %+v", 409, o.Payload) -} - -func (o *UpdateReweighConflict) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighConflict %+v", 409, o.Payload) -} - -func (o *UpdateReweighConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighPreconditionFailed creates a UpdateReweighPreconditionFailed with default headers values -func NewUpdateReweighPreconditionFailed() *UpdateReweighPreconditionFailed { - return &UpdateReweighPreconditionFailed{} -} - -/* -UpdateReweighPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateReweighPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update reweigh precondition failed response has a 2xx status code -func (o *UpdateReweighPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh precondition failed response has a 3xx status code -func (o *UpdateReweighPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh precondition failed response has a 4xx status code -func (o *UpdateReweighPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh precondition failed response has a 5xx status code -func (o *UpdateReweighPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh precondition failed response a status code equal to that given -func (o *UpdateReweighPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update reweigh precondition failed response -func (o *UpdateReweighPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateReweighPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateReweighPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateReweighPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateReweighPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighUnprocessableEntity creates a UpdateReweighUnprocessableEntity with default headers values -func NewUpdateReweighUnprocessableEntity() *UpdateReweighUnprocessableEntity { - return &UpdateReweighUnprocessableEntity{} -} - -/* -UpdateReweighUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateReweighUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update reweigh unprocessable entity response has a 2xx status code -func (o *UpdateReweighUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh unprocessable entity response has a 3xx status code -func (o *UpdateReweighUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh unprocessable entity response has a 4xx status code -func (o *UpdateReweighUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update reweigh unprocessable entity response has a 5xx status code -func (o *UpdateReweighUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update reweigh unprocessable entity response a status code equal to that given -func (o *UpdateReweighUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update reweigh unprocessable entity response -func (o *UpdateReweighUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateReweighUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateReweighUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateReweighUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateReweighUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateReweighInternalServerError creates a UpdateReweighInternalServerError with default headers values -func NewUpdateReweighInternalServerError() *UpdateReweighInternalServerError { - return &UpdateReweighInternalServerError{} -} - -/* -UpdateReweighInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateReweighInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update reweigh internal server error response has a 2xx status code -func (o *UpdateReweighInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update reweigh internal server error response has a 3xx status code -func (o *UpdateReweighInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update reweigh internal server error response has a 4xx status code -func (o *UpdateReweighInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update reweigh internal server error response has a 5xx status code -func (o *UpdateReweighInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update reweigh internal server error response a status code equal to that given -func (o *UpdateReweighInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update reweigh internal server error response -func (o *UpdateReweighInternalServerError) Code() int { - return 500 -} - -func (o *UpdateReweighInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateReweighInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateReweighInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateReweighInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go deleted file mode 100644 index ae9cea49739..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewUpdateShipmentDestinationAddressParams creates a new UpdateShipmentDestinationAddressParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateShipmentDestinationAddressParams() *UpdateShipmentDestinationAddressParams { - return &UpdateShipmentDestinationAddressParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateShipmentDestinationAddressParamsWithTimeout creates a new UpdateShipmentDestinationAddressParams object -// with the ability to set a timeout on a request. -func NewUpdateShipmentDestinationAddressParamsWithTimeout(timeout time.Duration) *UpdateShipmentDestinationAddressParams { - return &UpdateShipmentDestinationAddressParams{ - timeout: timeout, - } -} - -// NewUpdateShipmentDestinationAddressParamsWithContext creates a new UpdateShipmentDestinationAddressParams object -// with the ability to set a context for a request. -func NewUpdateShipmentDestinationAddressParamsWithContext(ctx context.Context) *UpdateShipmentDestinationAddressParams { - return &UpdateShipmentDestinationAddressParams{ - Context: ctx, - } -} - -// NewUpdateShipmentDestinationAddressParamsWithHTTPClient creates a new UpdateShipmentDestinationAddressParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateShipmentDestinationAddressParamsWithHTTPClient(client *http.Client) *UpdateShipmentDestinationAddressParams { - return &UpdateShipmentDestinationAddressParams{ - HTTPClient: client, - } -} - -/* -UpdateShipmentDestinationAddressParams contains all the parameters to send to the API endpoint - - for the update shipment destination address operation. - - Typically these are written to a http.Request. -*/ -type UpdateShipmentDestinationAddressParams struct { - - /* IfMatch. - - Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *primemessages.UpdateShipmentDestinationAddress - - /* MtoShipmentID. - - UUID of the shipment associated with the address - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update shipment destination address params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateShipmentDestinationAddressParams) WithDefaults() *UpdateShipmentDestinationAddressParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update shipment destination address params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateShipmentDestinationAddressParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithTimeout(timeout time.Duration) *UpdateShipmentDestinationAddressParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithContext(ctx context.Context) *UpdateShipmentDestinationAddressParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithHTTPClient(client *http.Client) *UpdateShipmentDestinationAddressParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithIfMatch(ifMatch string) *UpdateShipmentDestinationAddressParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithBody(body *primemessages.UpdateShipmentDestinationAddress) *UpdateShipmentDestinationAddressParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetBody(body *primemessages.UpdateShipmentDestinationAddress) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateShipmentDestinationAddressParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update shipment destination address params -func (o *UpdateShipmentDestinationAddressParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateShipmentDestinationAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go deleted file mode 100644 index 6d3cb835a36..00000000000 --- a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// UpdateShipmentDestinationAddressReader is a Reader for the UpdateShipmentDestinationAddress structure. -type UpdateShipmentDestinationAddressReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateShipmentDestinationAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewUpdateShipmentDestinationAddressCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateShipmentDestinationAddressBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateShipmentDestinationAddressUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateShipmentDestinationAddressForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateShipmentDestinationAddressNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateShipmentDestinationAddressConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateShipmentDestinationAddressPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateShipmentDestinationAddressUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateShipmentDestinationAddressInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates] updateShipmentDestinationAddress", response, response.Code()) - } -} - -// NewUpdateShipmentDestinationAddressCreated creates a UpdateShipmentDestinationAddressCreated with default headers values -func NewUpdateShipmentDestinationAddressCreated() *UpdateShipmentDestinationAddressCreated { - return &UpdateShipmentDestinationAddressCreated{} -} - -/* -UpdateShipmentDestinationAddressCreated describes a response with status code 201, with default header values. - -Successfully created the address update request. -*/ -type UpdateShipmentDestinationAddressCreated struct { - Payload *primemessages.ShipmentAddressUpdate -} - -// IsSuccess returns true when this update shipment destination address created response has a 2xx status code -func (o *UpdateShipmentDestinationAddressCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update shipment destination address created response has a 3xx status code -func (o *UpdateShipmentDestinationAddressCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address created response has a 4xx status code -func (o *UpdateShipmentDestinationAddressCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this update shipment destination address created response has a 5xx status code -func (o *UpdateShipmentDestinationAddressCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address created response a status code equal to that given -func (o *UpdateShipmentDestinationAddressCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the update shipment destination address created response -func (o *UpdateShipmentDestinationAddressCreated) Code() int { - return 201 -} - -func (o *UpdateShipmentDestinationAddressCreated) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressCreated %+v", 201, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressCreated) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressCreated %+v", 201, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressCreated) GetPayload() *primemessages.ShipmentAddressUpdate { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ShipmentAddressUpdate) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressBadRequest creates a UpdateShipmentDestinationAddressBadRequest with default headers values -func NewUpdateShipmentDestinationAddressBadRequest() *UpdateShipmentDestinationAddressBadRequest { - return &UpdateShipmentDestinationAddressBadRequest{} -} - -/* -UpdateShipmentDestinationAddressBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateShipmentDestinationAddressBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address bad request response has a 2xx status code -func (o *UpdateShipmentDestinationAddressBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address bad request response has a 3xx status code -func (o *UpdateShipmentDestinationAddressBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address bad request response has a 4xx status code -func (o *UpdateShipmentDestinationAddressBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address bad request response has a 5xx status code -func (o *UpdateShipmentDestinationAddressBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address bad request response a status code equal to that given -func (o *UpdateShipmentDestinationAddressBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update shipment destination address bad request response -func (o *UpdateShipmentDestinationAddressBadRequest) Code() int { - return 400 -} - -func (o *UpdateShipmentDestinationAddressBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressBadRequest) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressUnauthorized creates a UpdateShipmentDestinationAddressUnauthorized with default headers values -func NewUpdateShipmentDestinationAddressUnauthorized() *UpdateShipmentDestinationAddressUnauthorized { - return &UpdateShipmentDestinationAddressUnauthorized{} -} - -/* -UpdateShipmentDestinationAddressUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateShipmentDestinationAddressUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address unauthorized response has a 2xx status code -func (o *UpdateShipmentDestinationAddressUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address unauthorized response has a 3xx status code -func (o *UpdateShipmentDestinationAddressUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address unauthorized response has a 4xx status code -func (o *UpdateShipmentDestinationAddressUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address unauthorized response has a 5xx status code -func (o *UpdateShipmentDestinationAddressUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address unauthorized response a status code equal to that given -func (o *UpdateShipmentDestinationAddressUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update shipment destination address unauthorized response -func (o *UpdateShipmentDestinationAddressUnauthorized) Code() int { - return 401 -} - -func (o *UpdateShipmentDestinationAddressUnauthorized) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressUnauthorized) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressForbidden creates a UpdateShipmentDestinationAddressForbidden with default headers values -func NewUpdateShipmentDestinationAddressForbidden() *UpdateShipmentDestinationAddressForbidden { - return &UpdateShipmentDestinationAddressForbidden{} -} - -/* -UpdateShipmentDestinationAddressForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateShipmentDestinationAddressForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address forbidden response has a 2xx status code -func (o *UpdateShipmentDestinationAddressForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address forbidden response has a 3xx status code -func (o *UpdateShipmentDestinationAddressForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address forbidden response has a 4xx status code -func (o *UpdateShipmentDestinationAddressForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address forbidden response has a 5xx status code -func (o *UpdateShipmentDestinationAddressForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address forbidden response a status code equal to that given -func (o *UpdateShipmentDestinationAddressForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update shipment destination address forbidden response -func (o *UpdateShipmentDestinationAddressForbidden) Code() int { - return 403 -} - -func (o *UpdateShipmentDestinationAddressForbidden) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressForbidden %+v", 403, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressForbidden) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressForbidden %+v", 403, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressNotFound creates a UpdateShipmentDestinationAddressNotFound with default headers values -func NewUpdateShipmentDestinationAddressNotFound() *UpdateShipmentDestinationAddressNotFound { - return &UpdateShipmentDestinationAddressNotFound{} -} - -/* -UpdateShipmentDestinationAddressNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateShipmentDestinationAddressNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address not found response has a 2xx status code -func (o *UpdateShipmentDestinationAddressNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address not found response has a 3xx status code -func (o *UpdateShipmentDestinationAddressNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address not found response has a 4xx status code -func (o *UpdateShipmentDestinationAddressNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address not found response has a 5xx status code -func (o *UpdateShipmentDestinationAddressNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address not found response a status code equal to that given -func (o *UpdateShipmentDestinationAddressNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update shipment destination address not found response -func (o *UpdateShipmentDestinationAddressNotFound) Code() int { - return 404 -} - -func (o *UpdateShipmentDestinationAddressNotFound) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressNotFound %+v", 404, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressNotFound) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressNotFound %+v", 404, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressConflict creates a UpdateShipmentDestinationAddressConflict with default headers values -func NewUpdateShipmentDestinationAddressConflict() *UpdateShipmentDestinationAddressConflict { - return &UpdateShipmentDestinationAddressConflict{} -} - -/* -UpdateShipmentDestinationAddressConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type UpdateShipmentDestinationAddressConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address conflict response has a 2xx status code -func (o *UpdateShipmentDestinationAddressConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address conflict response has a 3xx status code -func (o *UpdateShipmentDestinationAddressConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address conflict response has a 4xx status code -func (o *UpdateShipmentDestinationAddressConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address conflict response has a 5xx status code -func (o *UpdateShipmentDestinationAddressConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address conflict response a status code equal to that given -func (o *UpdateShipmentDestinationAddressConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update shipment destination address conflict response -func (o *UpdateShipmentDestinationAddressConflict) Code() int { - return 409 -} - -func (o *UpdateShipmentDestinationAddressConflict) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressConflict %+v", 409, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressConflict) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressConflict %+v", 409, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressPreconditionFailed creates a UpdateShipmentDestinationAddressPreconditionFailed with default headers values -func NewUpdateShipmentDestinationAddressPreconditionFailed() *UpdateShipmentDestinationAddressPreconditionFailed { - return &UpdateShipmentDestinationAddressPreconditionFailed{} -} - -/* -UpdateShipmentDestinationAddressPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateShipmentDestinationAddressPreconditionFailed struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this update shipment destination address precondition failed response has a 2xx status code -func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address precondition failed response has a 3xx status code -func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address precondition failed response has a 4xx status code -func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address precondition failed response has a 5xx status code -func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address precondition failed response a status code equal to that given -func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update shipment destination address precondition failed response -func (o *UpdateShipmentDestinationAddressPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateShipmentDestinationAddressPreconditionFailed) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressPreconditionFailed) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressPreconditionFailed) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressUnprocessableEntity creates a UpdateShipmentDestinationAddressUnprocessableEntity with default headers values -func NewUpdateShipmentDestinationAddressUnprocessableEntity() *UpdateShipmentDestinationAddressUnprocessableEntity { - return &UpdateShipmentDestinationAddressUnprocessableEntity{} -} - -/* -UpdateShipmentDestinationAddressUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateShipmentDestinationAddressUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this update shipment destination address unprocessable entity response has a 2xx status code -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address unprocessable entity response has a 3xx status code -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address unprocessable entity response has a 4xx status code -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update shipment destination address unprocessable entity response has a 5xx status code -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update shipment destination address unprocessable entity response a status code equal to that given -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update shipment destination address unprocessable entity response -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateShipmentDestinationAddressInternalServerError creates a UpdateShipmentDestinationAddressInternalServerError with default headers values -func NewUpdateShipmentDestinationAddressInternalServerError() *UpdateShipmentDestinationAddressInternalServerError { - return &UpdateShipmentDestinationAddressInternalServerError{} -} - -/* -UpdateShipmentDestinationAddressInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateShipmentDestinationAddressInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this update shipment destination address internal server error response has a 2xx status code -func (o *UpdateShipmentDestinationAddressInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update shipment destination address internal server error response has a 3xx status code -func (o *UpdateShipmentDestinationAddressInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update shipment destination address internal server error response has a 4xx status code -func (o *UpdateShipmentDestinationAddressInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update shipment destination address internal server error response has a 5xx status code -func (o *UpdateShipmentDestinationAddressInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update shipment destination address internal server error response a status code equal to that given -func (o *UpdateShipmentDestinationAddressInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update shipment destination address internal server error response -func (o *UpdateShipmentDestinationAddressInternalServerError) Code() int { - return 500 -} - -func (o *UpdateShipmentDestinationAddressInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateShipmentDestinationAddressInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *UpdateShipmentDestinationAddressInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/mymove_client.go b/pkg/gen/primeclient/mymove_client.go deleted file mode 100644 index 5a6cf119393..00000000000 --- a/pkg/gen/primeclient/mymove_client.go +++ /dev/null @@ -1,127 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primeclient - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primeclient/move_task_order" - "github.com/transcom/mymove/pkg/gen/primeclient/mto_service_item" - "github.com/transcom/mymove/pkg/gen/primeclient/mto_shipment" - "github.com/transcom/mymove/pkg/gen/primeclient/payment_request" -) - -// Default mymove HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/prime/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new mymove HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Mymove { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new mymove HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new mymove client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Mymove) - cli.Transport = transport - cli.MoveTaskOrder = move_task_order.New(transport, formats) - cli.MtoServiceItem = mto_service_item.New(transport, formats) - cli.MtoShipment = mto_shipment.New(transport, formats) - cli.PaymentRequest = payment_request.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Mymove is a client for mymove -type Mymove struct { - MoveTaskOrder move_task_order.ClientService - - MtoServiceItem mto_service_item.ClientService - - MtoShipment mto_shipment.ClientService - - PaymentRequest payment_request.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Mymove) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.MoveTaskOrder.SetTransport(transport) - c.MtoServiceItem.SetTransport(transport) - c.MtoShipment.SetTransport(transport) - c.PaymentRequest.SetTransport(transport) -} diff --git a/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go b/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go deleted file mode 100644 index 8a233b2ef07..00000000000 --- a/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// NewCreatePaymentRequestParams creates a new CreatePaymentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreatePaymentRequestParams() *CreatePaymentRequestParams { - return &CreatePaymentRequestParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreatePaymentRequestParamsWithTimeout creates a new CreatePaymentRequestParams object -// with the ability to set a timeout on a request. -func NewCreatePaymentRequestParamsWithTimeout(timeout time.Duration) *CreatePaymentRequestParams { - return &CreatePaymentRequestParams{ - timeout: timeout, - } -} - -// NewCreatePaymentRequestParamsWithContext creates a new CreatePaymentRequestParams object -// with the ability to set a context for a request. -func NewCreatePaymentRequestParamsWithContext(ctx context.Context) *CreatePaymentRequestParams { - return &CreatePaymentRequestParams{ - Context: ctx, - } -} - -// NewCreatePaymentRequestParamsWithHTTPClient creates a new CreatePaymentRequestParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreatePaymentRequestParamsWithHTTPClient(client *http.Client) *CreatePaymentRequestParams { - return &CreatePaymentRequestParams{ - HTTPClient: client, - } -} - -/* -CreatePaymentRequestParams contains all the parameters to send to the API endpoint - - for the create payment request operation. - - Typically these are written to a http.Request. -*/ -type CreatePaymentRequestParams struct { - - // Body. - Body *primemessages.CreatePaymentRequest - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create payment request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePaymentRequestParams) WithDefaults() *CreatePaymentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create payment request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreatePaymentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create payment request params -func (o *CreatePaymentRequestParams) WithTimeout(timeout time.Duration) *CreatePaymentRequestParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create payment request params -func (o *CreatePaymentRequestParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create payment request params -func (o *CreatePaymentRequestParams) WithContext(ctx context.Context) *CreatePaymentRequestParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create payment request params -func (o *CreatePaymentRequestParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create payment request params -func (o *CreatePaymentRequestParams) WithHTTPClient(client *http.Client) *CreatePaymentRequestParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create payment request params -func (o *CreatePaymentRequestParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create payment request params -func (o *CreatePaymentRequestParams) WithBody(body *primemessages.CreatePaymentRequest) *CreatePaymentRequestParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create payment request params -func (o *CreatePaymentRequestParams) SetBody(body *primemessages.CreatePaymentRequest) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreatePaymentRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/payment_request/create_payment_request_responses.go b/pkg/gen/primeclient/payment_request/create_payment_request_responses.go deleted file mode 100644 index 9a28017a121..00000000000 --- a/pkg/gen/primeclient/payment_request/create_payment_request_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreatePaymentRequestReader is a Reader for the CreatePaymentRequest structure. -type CreatePaymentRequestReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreatePaymentRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreatePaymentRequestCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreatePaymentRequestBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreatePaymentRequestUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreatePaymentRequestForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreatePaymentRequestNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewCreatePaymentRequestConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreatePaymentRequestUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreatePaymentRequestInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /payment-requests] createPaymentRequest", response, response.Code()) - } -} - -// NewCreatePaymentRequestCreated creates a CreatePaymentRequestCreated with default headers values -func NewCreatePaymentRequestCreated() *CreatePaymentRequestCreated { - return &CreatePaymentRequestCreated{} -} - -/* -CreatePaymentRequestCreated describes a response with status code 201, with default header values. - -Successfully created a paymentRequest object. -*/ -type CreatePaymentRequestCreated struct { - Payload *primemessages.PaymentRequest -} - -// IsSuccess returns true when this create payment request created response has a 2xx status code -func (o *CreatePaymentRequestCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create payment request created response has a 3xx status code -func (o *CreatePaymentRequestCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request created response has a 4xx status code -func (o *CreatePaymentRequestCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create payment request created response has a 5xx status code -func (o *CreatePaymentRequestCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request created response a status code equal to that given -func (o *CreatePaymentRequestCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create payment request created response -func (o *CreatePaymentRequestCreated) Code() int { - return 201 -} - -func (o *CreatePaymentRequestCreated) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestCreated %+v", 201, o.Payload) -} - -func (o *CreatePaymentRequestCreated) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestCreated %+v", 201, o.Payload) -} - -func (o *CreatePaymentRequestCreated) GetPayload() *primemessages.PaymentRequest { - return o.Payload -} - -func (o *CreatePaymentRequestCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.PaymentRequest) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestBadRequest creates a CreatePaymentRequestBadRequest with default headers values -func NewCreatePaymentRequestBadRequest() *CreatePaymentRequestBadRequest { - return &CreatePaymentRequestBadRequest{} -} - -/* -CreatePaymentRequestBadRequest describes a response with status code 400, with default header values. - -Request payload is invalid. -*/ -type CreatePaymentRequestBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create payment request bad request response has a 2xx status code -func (o *CreatePaymentRequestBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request bad request response has a 3xx status code -func (o *CreatePaymentRequestBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request bad request response has a 4xx status code -func (o *CreatePaymentRequestBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request bad request response has a 5xx status code -func (o *CreatePaymentRequestBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request bad request response a status code equal to that given -func (o *CreatePaymentRequestBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create payment request bad request response -func (o *CreatePaymentRequestBadRequest) Code() int { - return 400 -} - -func (o *CreatePaymentRequestBadRequest) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestBadRequest %+v", 400, o.Payload) -} - -func (o *CreatePaymentRequestBadRequest) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestBadRequest %+v", 400, o.Payload) -} - -func (o *CreatePaymentRequestBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreatePaymentRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestUnauthorized creates a CreatePaymentRequestUnauthorized with default headers values -func NewCreatePaymentRequestUnauthorized() *CreatePaymentRequestUnauthorized { - return &CreatePaymentRequestUnauthorized{} -} - -/* -CreatePaymentRequestUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreatePaymentRequestUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create payment request unauthorized response has a 2xx status code -func (o *CreatePaymentRequestUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request unauthorized response has a 3xx status code -func (o *CreatePaymentRequestUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request unauthorized response has a 4xx status code -func (o *CreatePaymentRequestUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request unauthorized response has a 5xx status code -func (o *CreatePaymentRequestUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request unauthorized response a status code equal to that given -func (o *CreatePaymentRequestUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create payment request unauthorized response -func (o *CreatePaymentRequestUnauthorized) Code() int { - return 401 -} - -func (o *CreatePaymentRequestUnauthorized) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnauthorized %+v", 401, o.Payload) -} - -func (o *CreatePaymentRequestUnauthorized) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnauthorized %+v", 401, o.Payload) -} - -func (o *CreatePaymentRequestUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreatePaymentRequestUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestForbidden creates a CreatePaymentRequestForbidden with default headers values -func NewCreatePaymentRequestForbidden() *CreatePaymentRequestForbidden { - return &CreatePaymentRequestForbidden{} -} - -/* -CreatePaymentRequestForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreatePaymentRequestForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create payment request forbidden response has a 2xx status code -func (o *CreatePaymentRequestForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request forbidden response has a 3xx status code -func (o *CreatePaymentRequestForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request forbidden response has a 4xx status code -func (o *CreatePaymentRequestForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request forbidden response has a 5xx status code -func (o *CreatePaymentRequestForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request forbidden response a status code equal to that given -func (o *CreatePaymentRequestForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create payment request forbidden response -func (o *CreatePaymentRequestForbidden) Code() int { - return 403 -} - -func (o *CreatePaymentRequestForbidden) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestForbidden %+v", 403, o.Payload) -} - -func (o *CreatePaymentRequestForbidden) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestForbidden %+v", 403, o.Payload) -} - -func (o *CreatePaymentRequestForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreatePaymentRequestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestNotFound creates a CreatePaymentRequestNotFound with default headers values -func NewCreatePaymentRequestNotFound() *CreatePaymentRequestNotFound { - return &CreatePaymentRequestNotFound{} -} - -/* -CreatePaymentRequestNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreatePaymentRequestNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create payment request not found response has a 2xx status code -func (o *CreatePaymentRequestNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request not found response has a 3xx status code -func (o *CreatePaymentRequestNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request not found response has a 4xx status code -func (o *CreatePaymentRequestNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request not found response has a 5xx status code -func (o *CreatePaymentRequestNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request not found response a status code equal to that given -func (o *CreatePaymentRequestNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create payment request not found response -func (o *CreatePaymentRequestNotFound) Code() int { - return 404 -} - -func (o *CreatePaymentRequestNotFound) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestNotFound %+v", 404, o.Payload) -} - -func (o *CreatePaymentRequestNotFound) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestNotFound %+v", 404, o.Payload) -} - -func (o *CreatePaymentRequestNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreatePaymentRequestNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestConflict creates a CreatePaymentRequestConflict with default headers values -func NewCreatePaymentRequestConflict() *CreatePaymentRequestConflict { - return &CreatePaymentRequestConflict{} -} - -/* -CreatePaymentRequestConflict describes a response with status code 409, with default header values. - -The request could not be processed because of conflict in the current state of the resource. -*/ -type CreatePaymentRequestConflict struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create payment request conflict response has a 2xx status code -func (o *CreatePaymentRequestConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request conflict response has a 3xx status code -func (o *CreatePaymentRequestConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request conflict response has a 4xx status code -func (o *CreatePaymentRequestConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request conflict response has a 5xx status code -func (o *CreatePaymentRequestConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request conflict response a status code equal to that given -func (o *CreatePaymentRequestConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the create payment request conflict response -func (o *CreatePaymentRequestConflict) Code() int { - return 409 -} - -func (o *CreatePaymentRequestConflict) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestConflict %+v", 409, o.Payload) -} - -func (o *CreatePaymentRequestConflict) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestConflict %+v", 409, o.Payload) -} - -func (o *CreatePaymentRequestConflict) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreatePaymentRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestUnprocessableEntity creates a CreatePaymentRequestUnprocessableEntity with default headers values -func NewCreatePaymentRequestUnprocessableEntity() *CreatePaymentRequestUnprocessableEntity { - return &CreatePaymentRequestUnprocessableEntity{} -} - -/* -CreatePaymentRequestUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreatePaymentRequestUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create payment request unprocessable entity response has a 2xx status code -func (o *CreatePaymentRequestUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request unprocessable entity response has a 3xx status code -func (o *CreatePaymentRequestUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request unprocessable entity response has a 4xx status code -func (o *CreatePaymentRequestUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create payment request unprocessable entity response has a 5xx status code -func (o *CreatePaymentRequestUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create payment request unprocessable entity response a status code equal to that given -func (o *CreatePaymentRequestUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create payment request unprocessable entity response -func (o *CreatePaymentRequestUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreatePaymentRequestUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreatePaymentRequestUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreatePaymentRequestUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreatePaymentRequestUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreatePaymentRequestInternalServerError creates a CreatePaymentRequestInternalServerError with default headers values -func NewCreatePaymentRequestInternalServerError() *CreatePaymentRequestInternalServerError { - return &CreatePaymentRequestInternalServerError{} -} - -/* -CreatePaymentRequestInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreatePaymentRequestInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create payment request internal server error response has a 2xx status code -func (o *CreatePaymentRequestInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create payment request internal server error response has a 3xx status code -func (o *CreatePaymentRequestInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create payment request internal server error response has a 4xx status code -func (o *CreatePaymentRequestInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create payment request internal server error response has a 5xx status code -func (o *CreatePaymentRequestInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create payment request internal server error response a status code equal to that given -func (o *CreatePaymentRequestInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create payment request internal server error response -func (o *CreatePaymentRequestInternalServerError) Code() int { - return 500 -} - -func (o *CreatePaymentRequestInternalServerError) Error() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestInternalServerError %+v", 500, o.Payload) -} - -func (o *CreatePaymentRequestInternalServerError) String() string { - return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestInternalServerError %+v", 500, o.Payload) -} - -func (o *CreatePaymentRequestInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreatePaymentRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/payment_request/create_upload_parameters.go b/pkg/gen/primeclient/payment_request/create_upload_parameters.go deleted file mode 100644 index 6c89d2949ae..00000000000 --- a/pkg/gen/primeclient/payment_request/create_upload_parameters.go +++ /dev/null @@ -1,205 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewCreateUploadParams creates a new CreateUploadParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateUploadParams() *CreateUploadParams { - return &CreateUploadParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateUploadParamsWithTimeout creates a new CreateUploadParams object -// with the ability to set a timeout on a request. -func NewCreateUploadParamsWithTimeout(timeout time.Duration) *CreateUploadParams { - return &CreateUploadParams{ - timeout: timeout, - } -} - -// NewCreateUploadParamsWithContext creates a new CreateUploadParams object -// with the ability to set a context for a request. -func NewCreateUploadParamsWithContext(ctx context.Context) *CreateUploadParams { - return &CreateUploadParams{ - Context: ctx, - } -} - -// NewCreateUploadParamsWithHTTPClient creates a new CreateUploadParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateUploadParamsWithHTTPClient(client *http.Client) *CreateUploadParams { - return &CreateUploadParams{ - HTTPClient: client, - } -} - -/* -CreateUploadParams contains all the parameters to send to the API endpoint - - for the create upload operation. - - Typically these are written to a http.Request. -*/ -type CreateUploadParams struct { - - /* File. - - The file to upload. - */ - File runtime.NamedReadCloser - - /* IsWeightTicket. - - Indicates whether the file is a weight ticket. - */ - IsWeightTicket *bool - - /* PaymentRequestID. - - UUID of payment request to use. - */ - PaymentRequestID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create upload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateUploadParams) WithDefaults() *CreateUploadParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create upload params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateUploadParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create upload params -func (o *CreateUploadParams) WithTimeout(timeout time.Duration) *CreateUploadParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create upload params -func (o *CreateUploadParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create upload params -func (o *CreateUploadParams) WithContext(ctx context.Context) *CreateUploadParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create upload params -func (o *CreateUploadParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create upload params -func (o *CreateUploadParams) WithHTTPClient(client *http.Client) *CreateUploadParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create upload params -func (o *CreateUploadParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithFile adds the file to the create upload params -func (o *CreateUploadParams) WithFile(file runtime.NamedReadCloser) *CreateUploadParams { - o.SetFile(file) - return o -} - -// SetFile adds the file to the create upload params -func (o *CreateUploadParams) SetFile(file runtime.NamedReadCloser) { - o.File = file -} - -// WithIsWeightTicket adds the isWeightTicket to the create upload params -func (o *CreateUploadParams) WithIsWeightTicket(isWeightTicket *bool) *CreateUploadParams { - o.SetIsWeightTicket(isWeightTicket) - return o -} - -// SetIsWeightTicket adds the isWeightTicket to the create upload params -func (o *CreateUploadParams) SetIsWeightTicket(isWeightTicket *bool) { - o.IsWeightTicket = isWeightTicket -} - -// WithPaymentRequestID adds the paymentRequestID to the create upload params -func (o *CreateUploadParams) WithPaymentRequestID(paymentRequestID string) *CreateUploadParams { - o.SetPaymentRequestID(paymentRequestID) - return o -} - -// SetPaymentRequestID adds the paymentRequestId to the create upload params -func (o *CreateUploadParams) SetPaymentRequestID(paymentRequestID string) { - o.PaymentRequestID = paymentRequestID -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateUploadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - // form file param file - if err := r.SetFileParam("file", o.File); err != nil { - return err - } - - if o.IsWeightTicket != nil { - - // form param isWeightTicket - var frIsWeightTicket bool - if o.IsWeightTicket != nil { - frIsWeightTicket = *o.IsWeightTicket - } - fIsWeightTicket := swag.FormatBool(frIsWeightTicket) - if fIsWeightTicket != "" { - if err := r.SetFormParam("isWeightTicket", fIsWeightTicket); err != nil { - return err - } - } - } - - // path param paymentRequestID - if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primeclient/payment_request/create_upload_responses.go b/pkg/gen/primeclient/payment_request/create_upload_responses.go deleted file mode 100644 index 3236c327ad1..00000000000 --- a/pkg/gen/primeclient/payment_request/create_upload_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primemessages" -) - -// CreateUploadReader is a Reader for the CreateUpload structure. -type CreateUploadReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateUploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateUploadCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateUploadBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateUploadUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateUploadForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateUploadNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateUploadUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateUploadInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /payment-requests/{paymentRequestID}/uploads] createUpload", response, response.Code()) - } -} - -// NewCreateUploadCreated creates a CreateUploadCreated with default headers values -func NewCreateUploadCreated() *CreateUploadCreated { - return &CreateUploadCreated{} -} - -/* -CreateUploadCreated describes a response with status code 201, with default header values. - -Successfully created upload of digital file. -*/ -type CreateUploadCreated struct { - Payload *primemessages.UploadWithOmissions -} - -// IsSuccess returns true when this create upload created response has a 2xx status code -func (o *CreateUploadCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create upload created response has a 3xx status code -func (o *CreateUploadCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload created response has a 4xx status code -func (o *CreateUploadCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create upload created response has a 5xx status code -func (o *CreateUploadCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload created response a status code equal to that given -func (o *CreateUploadCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create upload created response -func (o *CreateUploadCreated) Code() int { - return 201 -} - -func (o *CreateUploadCreated) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadCreated %+v", 201, o.Payload) -} - -func (o *CreateUploadCreated) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadCreated %+v", 201, o.Payload) -} - -func (o *CreateUploadCreated) GetPayload() *primemessages.UploadWithOmissions { - return o.Payload -} - -func (o *CreateUploadCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.UploadWithOmissions) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadBadRequest creates a CreateUploadBadRequest with default headers values -func NewCreateUploadBadRequest() *CreateUploadBadRequest { - return &CreateUploadBadRequest{} -} - -/* -CreateUploadBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateUploadBadRequest struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create upload bad request response has a 2xx status code -func (o *CreateUploadBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload bad request response has a 3xx status code -func (o *CreateUploadBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload bad request response has a 4xx status code -func (o *CreateUploadBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create upload bad request response has a 5xx status code -func (o *CreateUploadBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload bad request response a status code equal to that given -func (o *CreateUploadBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create upload bad request response -func (o *CreateUploadBadRequest) Code() int { - return 400 -} - -func (o *CreateUploadBadRequest) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadBadRequest %+v", 400, o.Payload) -} - -func (o *CreateUploadBadRequest) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadBadRequest %+v", 400, o.Payload) -} - -func (o *CreateUploadBadRequest) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateUploadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadUnauthorized creates a CreateUploadUnauthorized with default headers values -func NewCreateUploadUnauthorized() *CreateUploadUnauthorized { - return &CreateUploadUnauthorized{} -} - -/* -CreateUploadUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateUploadUnauthorized struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create upload unauthorized response has a 2xx status code -func (o *CreateUploadUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload unauthorized response has a 3xx status code -func (o *CreateUploadUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload unauthorized response has a 4xx status code -func (o *CreateUploadUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create upload unauthorized response has a 5xx status code -func (o *CreateUploadUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload unauthorized response a status code equal to that given -func (o *CreateUploadUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create upload unauthorized response -func (o *CreateUploadUnauthorized) Code() int { - return 401 -} - -func (o *CreateUploadUnauthorized) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateUploadUnauthorized) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateUploadUnauthorized) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateUploadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadForbidden creates a CreateUploadForbidden with default headers values -func NewCreateUploadForbidden() *CreateUploadForbidden { - return &CreateUploadForbidden{} -} - -/* -CreateUploadForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateUploadForbidden struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create upload forbidden response has a 2xx status code -func (o *CreateUploadForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload forbidden response has a 3xx status code -func (o *CreateUploadForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload forbidden response has a 4xx status code -func (o *CreateUploadForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create upload forbidden response has a 5xx status code -func (o *CreateUploadForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload forbidden response a status code equal to that given -func (o *CreateUploadForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create upload forbidden response -func (o *CreateUploadForbidden) Code() int { - return 403 -} - -func (o *CreateUploadForbidden) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadForbidden %+v", 403, o.Payload) -} - -func (o *CreateUploadForbidden) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadForbidden %+v", 403, o.Payload) -} - -func (o *CreateUploadForbidden) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateUploadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadNotFound creates a CreateUploadNotFound with default headers values -func NewCreateUploadNotFound() *CreateUploadNotFound { - return &CreateUploadNotFound{} -} - -/* -CreateUploadNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateUploadNotFound struct { - Payload *primemessages.ClientError -} - -// IsSuccess returns true when this create upload not found response has a 2xx status code -func (o *CreateUploadNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload not found response has a 3xx status code -func (o *CreateUploadNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload not found response has a 4xx status code -func (o *CreateUploadNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create upload not found response has a 5xx status code -func (o *CreateUploadNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload not found response a status code equal to that given -func (o *CreateUploadNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create upload not found response -func (o *CreateUploadNotFound) Code() int { - return 404 -} - -func (o *CreateUploadNotFound) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadNotFound %+v", 404, o.Payload) -} - -func (o *CreateUploadNotFound) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadNotFound %+v", 404, o.Payload) -} - -func (o *CreateUploadNotFound) GetPayload() *primemessages.ClientError { - return o.Payload -} - -func (o *CreateUploadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadUnprocessableEntity creates a CreateUploadUnprocessableEntity with default headers values -func NewCreateUploadUnprocessableEntity() *CreateUploadUnprocessableEntity { - return &CreateUploadUnprocessableEntity{} -} - -/* -CreateUploadUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateUploadUnprocessableEntity struct { - Payload *primemessages.ValidationError -} - -// IsSuccess returns true when this create upload unprocessable entity response has a 2xx status code -func (o *CreateUploadUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload unprocessable entity response has a 3xx status code -func (o *CreateUploadUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload unprocessable entity response has a 4xx status code -func (o *CreateUploadUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create upload unprocessable entity response has a 5xx status code -func (o *CreateUploadUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create upload unprocessable entity response a status code equal to that given -func (o *CreateUploadUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create upload unprocessable entity response -func (o *CreateUploadUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateUploadUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateUploadUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateUploadUnprocessableEntity) GetPayload() *primemessages.ValidationError { - return o.Payload -} - -func (o *CreateUploadUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateUploadInternalServerError creates a CreateUploadInternalServerError with default headers values -func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { - return &CreateUploadInternalServerError{} -} - -/* -CreateUploadInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateUploadInternalServerError struct { - Payload *primemessages.Error -} - -// IsSuccess returns true when this create upload internal server error response has a 2xx status code -func (o *CreateUploadInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create upload internal server error response has a 3xx status code -func (o *CreateUploadInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create upload internal server error response has a 4xx status code -func (o *CreateUploadInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create upload internal server error response has a 5xx status code -func (o *CreateUploadInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create upload internal server error response a status code equal to that given -func (o *CreateUploadInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create upload internal server error response -func (o *CreateUploadInternalServerError) Code() int { - return 500 -} - -func (o *CreateUploadInternalServerError) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateUploadInternalServerError) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateUploadInternalServerError) GetPayload() *primemessages.Error { - return o.Payload -} - -func (o *CreateUploadInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primemessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primeclient/payment_request/payment_request_client.go b/pkg/gen/primeclient/payment_request/payment_request_client.go deleted file mode 100644 index b10b46d87cf..00000000000 --- a/pkg/gen/primeclient/payment_request/payment_request_client.go +++ /dev/null @@ -1,504 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new payment request API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for payment request API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreatePaymentRequest(params *CreatePaymentRequestParams, opts ...ClientOption) (*CreatePaymentRequestCreated, error) - - CreateUpload(params *CreateUploadParams, opts ...ClientOption) (*CreateUploadCreated, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreatePaymentRequest creates payment request - - Creates a new instance of a paymentRequest and is assigned the status `PENDING`. - -A move task order can have multiple payment requests, and -a final payment request can be marked using boolean `isFinal`. - -If a `PENDING` payment request is recalculated, -a new payment request is created and the original request is -marked with the status `DEPRECATED`. - -**NOTE**: In order to create a payment request for most service items, the shipment *must* -be updated with the `PrimeActualWeight` value via [updateMTOShipment](#operation/updateMTOShipment). - -If `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. - -**NOTE**: Diversions have a unique calcuation for payment requests without a `WeightBilled` parameter. - -If you created a payment request for a diversion and `WeightBilled` is not provided, then the following will be used in the calculation: -- The lowest shipment weight (`PrimeActualWeight`) found in the diverted shipment chain. -- The lowest reweigh weight found in the diverted shipment chain. - -The diverted shipment chain is created by referencing the `diversion` boolean, `divertedFromShipmentId` UUID, and matching destination to pickup addresses. -If the chain cannot be established it will fall back to the `PrimeActualWeight` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations. -The lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found. - -A service item can be on several payment requests in the case of partial payment requests and payments. - -In the request, if no params are necessary, then just the `serviceItem` `id` is required. For example: -```json - - { - "isFinal": false, - "moveTaskOrderID": "uuid", - "serviceItems": [ - { - "id": "uuid", - }, - { - "id": "uuid", - "params": [ - { - "key": "Service Item Parameter Name", - "value": "Service Item Parameter Value" - } - ] - } - ], - "pointOfContact": "string" - } - -``` - -Domestic Basic Service Items & Accepted Payment Request Parameters: ---- - -**DLH - Domestic Linehaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DSH - Domestic Shorthaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**FSC - Fuel Surcharge** -**NOTE**: FSC requires `ActualPickupDate` to be updated on the shipment. -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DUPK - Domestic Unpacking** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DPK - Domestic Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DNPK - Domestic NTS Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DPK - Domestic Packing** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOP - Domestic Origin Price** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDP - Domestic Destination Price** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -Domestic SIT Service Items & Accepted Payment Request Parameters: ---- - -**DOFSIT - Domestic origin 1st day SIT** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* -*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - }, - { - "key": "SITPaymentRequestStart", - "value": "date" - }, - { - "key": "SITPaymentRequestEnd", - "value": "date" - } - ] - -``` - -**DOPSIT - Domestic origin SIT pickup** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DOSHUT - Domestic origin shuttle service** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDFSIT - Domestic destination 1st day SIT** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* -*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - }, - { - "key": "SITPaymentRequestStart", - "value": "date" - }, - { - "key": "SITPaymentRequestEnd", - "value": "date" - } - ] - -``` - -**DDDSIT - Domestic destination SIT delivery** -*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).* -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**DDSHUT - Domestic destination shuttle service** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` ---- - -International Basic Service Items & Accepted Payment Request Parameters: ---- -Just like domestic shipments & service items, if `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. -**NOTE**: `POEFSC` & `PODFSC` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint. - -**ISLH - International Shipping & Linehaul** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**IHPK - International HHG Pack** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**IHUPK - International HHG Unpack** -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**POEFSC - International Port of Embarkation Fuel Surcharge** - - **NOTE**: POEFSC requires `ActualPickupDate` to be updated on the shipment & `POELocation` on the service item. - -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` - -**PODFSC - International Port of Debarkation Fuel Surcharge** -**NOTE**: PODFSC requires `ActualPickupDate` to be updated on the shipment & `PODLocation` on the service item. -```json - - "params": [ - { - "key": "WeightBilled", - "value": "integer" - } - ] - -``` ---- -*/ -func (a *Client) CreatePaymentRequest(params *CreatePaymentRequestParams, opts ...ClientOption) (*CreatePaymentRequestCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreatePaymentRequestParams() - } - op := &runtime.ClientOperation{ - ID: "createPaymentRequest", - Method: "POST", - PathPattern: "/payment-requests", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreatePaymentRequestReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreatePaymentRequestCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createPaymentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - CreateUpload creates upload - - ### Functionality - -This endpoint **uploads** a Proof of Service document for a PaymentRequest. - -The PaymentRequest should already exist. - -Optional key of **isWeightTicket** indicates if the document is a weight ticket or not. -This will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents. -If left empty, it will assume it is NOT a weight ticket. - -The formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request: - - ```json - { - "file": "filePath", - "isWeightTicket": true - } - ``` - If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty: - ```json - { - "file": "filePath", - "isWeightTicket": false - } - ``` - ```json - { - "file": "filePath", - } - ``` - -PaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint. -*/ -func (a *Client) CreateUpload(params *CreateUploadParams, opts ...ClientOption) (*CreateUploadCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateUploadParams() - } - op := &runtime.ClientOperation{ - ID: "createUpload", - Method: "POST", - PathPattern: "/payment-requests/{paymentRequestID}/uploads", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"multipart/form-data"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateUploadReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateUploadCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createUpload: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primemessages/excess_weight_record.go b/pkg/gen/primemessages/excess_weight_record.go deleted file mode 100644 index 03c572134ba..00000000000 --- a/pkg/gen/primemessages/excess_weight_record.go +++ /dev/null @@ -1,226 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ExcessWeightRecord A document uploaded by the movers proving that the customer has been counseled about excess weight. -// -// swagger:model ExcessWeightRecord -type ExcessWeightRecord struct { - UploadWithOmissions - - // The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded. - // - // Read Only: true - // Format: date-time - MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` - - // The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically. - // - // Read Only: true - // Format: date-time - MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` - - // The UUID of the move this excess weight record belongs to. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveID *strfmt.UUID `json:"moveId"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ExcessWeightRecord) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 UploadWithOmissions - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.UploadWithOmissions = aO0 - - // AO1 - var dataAO1 struct { - MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` - - MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` - - MoveID *strfmt.UUID `json:"moveId"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.MoveExcessWeightAcknowledgedAt = dataAO1.MoveExcessWeightAcknowledgedAt - - m.MoveExcessWeightQualifiedAt = dataAO1.MoveExcessWeightQualifiedAt - - m.MoveID = dataAO1.MoveID - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ExcessWeightRecord) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.UploadWithOmissions) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` - - MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` - - MoveID *strfmt.UUID `json:"moveId"` - } - - dataAO1.MoveExcessWeightAcknowledgedAt = m.MoveExcessWeightAcknowledgedAt - - dataAO1.MoveExcessWeightQualifiedAt = m.MoveExcessWeightQualifiedAt - - dataAO1.MoveID = m.MoveID - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this excess weight record -func (m *ExcessWeightRecord) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with UploadWithOmissions - if err := m.UploadWithOmissions.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExcessWeightRecord) validateMoveExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.MoveExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("moveExcessWeightAcknowledgedAt", "body", "date-time", m.MoveExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExcessWeightRecord) validateMoveExcessWeightQualifiedAt(formats strfmt.Registry) error { - - if swag.IsZero(m.MoveExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("moveExcessWeightQualifiedAt", "body", "date-time", m.MoveExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ExcessWeightRecord) validateMoveID(formats strfmt.Registry) error { - - if err := validate.Required("moveId", "body", m.MoveID); err != nil { - return err - } - - if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this excess weight record based on the context it is used -func (m *ExcessWeightRecord) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with UploadWithOmissions - if err := m.UploadWithOmissions.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ExcessWeightRecord) contextValidateMoveExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveExcessWeightAcknowledgedAt", "body", m.MoveExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *ExcessWeightRecord) contextValidateMoveExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveExcessWeightQualifiedAt", "body", m.MoveExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ExcessWeightRecord) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ExcessWeightRecord) UnmarshalBinary(b []byte) error { - var res ExcessWeightRecord - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/list_move.go b/pkg/gen/primemessages/list_move.go deleted file mode 100644 index 27440ca263b..00000000000 --- a/pkg/gen/primemessages/list_move.go +++ /dev/null @@ -1,414 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ListMove An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently. -// -// swagger:model ListMove -type ListMove struct { - - // amendments - Amendments *Amendments `json:"amendments,omitempty"` - - // approved at - // Read Only: true - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination g b l o c - // Example: JFK - // Read Only: true - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - // destination postal code - // Example: 90210 - // Read Only: true - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // ppm type - // Enum: [FULL PARTIAL] - PpmType string `json:"ppmType,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this list move -func (m *ListMove) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAmendments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListMove) validateAmendments(formats strfmt.Registry) error { - if swag.IsZero(m.Amendments) { // not required - return nil - } - - if m.Amendments != nil { - if err := m.Amendments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("amendments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amendments") - } - return err - } - } - - return nil -} - -func (m *ListMove) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListMove) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListMove) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ListMove) 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 *ListMove) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -var listMoveTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - listMoveTypePpmTypePropEnum = append(listMoveTypePpmTypePropEnum, v) - } -} - -const ( - - // ListMovePpmTypeFULL captures enum value "FULL" - ListMovePpmTypeFULL string = "FULL" - - // ListMovePpmTypePARTIAL captures enum value "PARTIAL" - ListMovePpmTypePARTIAL string = "PARTIAL" -) - -// prop value enum -func (m *ListMove) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, listMoveTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *ListMove) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *ListMove) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this list move based on the context it is used -func (m *ListMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAmendments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateApprovedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ListMove) contextValidateAmendments(ctx context.Context, formats strfmt.Registry) error { - - if m.Amendments != nil { - - if swag.IsZero(m.Amendments) { // not required - return nil - } - - if err := m.Amendments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("amendments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("amendments") - } - return err - } - } - - return nil -} - -func (m *ListMove) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *ListMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ListMove) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ListMove) UnmarshalBinary(b []byte) error { - var res ListMove - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/list_moves.go b/pkg/gen/primemessages/list_moves.go deleted file mode 100644 index 87569e32a25..00000000000 --- a/pkg/gen/primemessages/list_moves.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ListMoves list moves -// -// swagger:model ListMoves -type ListMoves []*ListMove - -// Validate validates this list moves -func (m ListMoves) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this list moves based on the context it is used -func (m ListMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_agent.go b/pkg/gen/primemessages/m_t_o_agent.go deleted file mode 100644 index 8aaa1b947f2..00000000000 --- a/pkg/gen/primemessages/m_t_o_agent.go +++ /dev/null @@ -1,306 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgent m t o agent -// -// swagger:model MTOAgent -type MTOAgent struct { - - // agent type - AgentType MTOAgentType `json:"agentType,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ - Email *string `json:"email,omitempty"` - - // first name - FirstName *string `json:"firstName,omitempty"` - - // The ID of the agent. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName *string `json:"lastName,omitempty"` - - // The ID of the shipment this agent is permitted to release/receive. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // phone - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - Phone *string `json:"phone,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o agent -func (m *MTOAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o agent based on the context it is used -func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOAgent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOAgent) UnmarshalBinary(b []byte) error { - var res MTOAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_agent_type.go b/pkg/gen/primemessages/m_t_o_agent_type.go deleted file mode 100644 index b17beab73d9..00000000000 --- a/pkg/gen/primemessages/m_t_o_agent_type.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOAgentType Agent Type -// -// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. -// -// Example: RELEASING_AGENT -// -// swagger:model MTOAgentType -type MTOAgentType string - -func NewMTOAgentType(value MTOAgentType) *MTOAgentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOAgentType. -func (m MTOAgentType) Pointer() *MTOAgentType { - return &m -} - -const ( - - // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" - - // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" -) - -// for schema -var mTOAgentTypeEnum []interface{} - -func init() { - var res []MTOAgentType - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) - } -} - -func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { - if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o agent type -func (m MTOAgentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o agent type based on context it is used -func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_agents.go b/pkg/gen/primemessages/m_t_o_agents.go deleted file mode 100644 index 581e925c72e..00000000000 --- a/pkg/gen/primemessages/m_t_o_agents.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. -// -// swagger:model MTOAgents -type MTOAgents []*MTOAgent - -// Validate validates this m t o agents -func (m MTOAgents) Validate(formats strfmt.Registry) error { - var res []error - - iMTOAgentsSize := int64(len(m)) - - if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { - return err - } - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents based on the context it is used -func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item.go b/pkg/gen/primemessages/m_t_o_service_item.go deleted file mode 100644 index 1db2b84d144..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item.go +++ /dev/null @@ -1,523 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. -// -// swagger:discriminator MTOServiceItem modelType -type MTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // A hash unique to this service item that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag() string - SetETag(string) - - // The ID of the service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // locked price cents - LockedPriceCents() *int64 - SetLockedPriceCents(*int64) - - // model type - // Required: true - ModelType() MTOServiceItemModelType - SetModelType(MTOServiceItemModelType) - - // The ID of the move for this service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID() *strfmt.UUID - SetMoveTaskOrderID(*strfmt.UUID) - - // The ID of the shipment this service is for, if any. Optional. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID() strfmt.UUID - SetMtoShipmentID(strfmt.UUID) - - // The full descriptive name of the service. - // Read Only: true - ReServiceName() string - SetReServiceName(string) - - // The reason why this service item was rejected by the TOO. - // Example: item was too heavy - // Read Only: true - RejectionReason() *string - SetRejectionReason(*string) - - // service request documents - ServiceRequestDocuments() ServiceRequestDocuments - SetServiceRequestDocuments(ServiceRequestDocuments) - - // status - Status() MTOServiceItemStatus - SetStatus(MTOServiceItemStatus) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type mTOServiceItem struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - modelTypeField MTOServiceItemModelType - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus -} - -// ETag gets the e tag of this polymorphic type -func (m *mTOServiceItem) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this polymorphic type -func (m *mTOServiceItem) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this polymorphic type -func (m *mTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *mTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this polymorphic type -func (m *mTOServiceItem) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this polymorphic type -func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { - return "MTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this polymorphic type -func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this polymorphic type -func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this polymorphic type -func (m *mTOServiceItem) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this polymorphic type -func (m *mTOServiceItem) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this polymorphic type -func (m *mTOServiceItem) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this polymorphic type -func (m *mTOServiceItem) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this polymorphic type -func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this polymorphic type -func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this polymorphic type -func (m *mTOServiceItem) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this polymorphic type -func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem -func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []MTOServiceItem - for _, element := range elements { - obj, err := unmarshalMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem -func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalMTOServiceItem(data, consumer) -} - -func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "MTOServiceItem": - var result mTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemBasic": - var result MTOServiceItemBasic - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDestSIT": - var result MTOServiceItemDestSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDomesticCrating": - var result MTOServiceItemDomesticCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemInternationalCrating": - var result MTOServiceItemInternationalCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemInternationalFuelSurcharge": - var result MTOServiceItemInternationalFuelSurcharge - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemOriginSIT": - var result MTOServiceItemOriginSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemShuttle": - var result MTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this m t o service item -func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this m t o service item based on the context it is used -func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_basic.go b/pkg/gen/primemessages/m_t_o_service_item_basic.go deleted file mode 100644 index f3f54f1006d..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_basic.go +++ /dev/null @@ -1,574 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemBasic -type MTOServiceItemBasic struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemBasic) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemBasic) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemBasic) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { - return "MTOServiceItemBasic" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemBasic) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemBasic) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemBasic) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { - var data struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemBasic - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - }{ - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item basic -func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if m.ReServiceCode != nil { - if err := m.ReServiceCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// ContextValidate validate this m t o service item basic based on the context it is used -func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceCode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { - - if m.ReServiceCode != nil { - - if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { - var res MTOServiceItemBasic - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go deleted file mode 100644 index 5d59ad3dfd3..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go +++ /dev/null @@ -1,987 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDestSIT -type MTOServiceItemDestSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDestSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDestSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDestSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDestSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDestSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item dest s i t -func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item dest s i t based on the context it is used -func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDestSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_dimension.go b/pkg/gen/primemessages/m_t_o_service_item_dimension.go deleted file mode 100644 index f421da2f819..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_dimension.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. -// -// swagger:model MTOServiceItemDimension -type MTOServiceItemDimension struct { - - // Height in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Height *int32 `json:"height"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Length in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Length *int32 `json:"length"` - - // Width in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Width *int32 `json:"width"` -} - -// Validate validates this m t o service item dimension -func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLength(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidth(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { - - if err := validate.Required("height", "body", m.Height); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { - - if err := validate.Required("length", "body", m.Length); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { - - if err := validate.Required("width", "body", m.Width); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this m t o service item dimension based on context it is used -func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDimension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go deleted file mode 100644 index edbed95f813..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDomesticCrating -type MTOServiceItemDomesticCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDomesticCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDomesticCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.Item = data.Item - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - Item: m.Item, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item domestic crating -func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item domestic crating based on the context it is used -func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDomesticCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_international_crating.go b/pkg/gen/primemessages/m_t_o_service_item_international_crating.go deleted file mode 100644 index eaac651416d..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_international_crating.go +++ /dev/null @@ -1,773 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemInternationalCrating -type MTOServiceItemInternationalCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemInternationalCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemInternationalCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.ExternalCrate = data.ExternalCrate - result.Item = data.Item - result.Market = data.Market - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - ExternalCrate: m.ExternalCrate, - - Item: m.Item, - - Market: m.Market, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item international crating -func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarket(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { - - if swag.IsZero(m.Market) { // not required - return nil - } - - // value enum - if err := m.validateMarketEnum("market", "body", m.Market); err != nil { - return err - } - - return nil -} - -var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item international crating based on the context it is used -func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemInternationalCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go b/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go deleted file mode 100644 index 97290b6cc40..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go +++ /dev/null @@ -1,575 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemInternationalFuelSurcharge Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemInternationalFuelSurcharge -type MTOServiceItemInternationalFuelSurcharge struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // A unique code for a Port - PortCode string `json:"portCode,omitempty"` - - // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) ModelType() MTOServiceItemModelType { - return "MTOServiceItemInternationalFuelSurcharge" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemInternationalFuelSurcharge) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalJSON(raw []byte) error { - var data struct { - - // A unique code for a Port - PortCode string `json:"portCode,omitempty"` - - // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemInternationalFuelSurcharge - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.PortCode = data.PortCode - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemInternationalFuelSurcharge) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // A unique code for a Port - PortCode string `json:"portCode,omitempty"` - - // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - }{ - - PortCode: m.PortCode, - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item international fuel surcharge -func (m *MTOServiceItemInternationalFuelSurcharge) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) 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 *MTOServiceItemInternationalFuelSurcharge) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PODFSC","POEFSC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum = append(mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item international fuel surcharge based on the context it is used -func (m *MTOServiceItemInternationalFuelSurcharge) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemInternationalFuelSurcharge) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalBinary(b []byte) error { - var res MTOServiceItemInternationalFuelSurcharge - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_model_type.go b/pkg/gen/primemessages/m_t_o_service_item_model_type.go deleted file mode 100644 index ffdea3d8c15..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_model_type.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. -// -// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DOFSIT, DOASIT - MTOServiceItemOriginSIT -// - DDFSIT, DDASIT - MTOServiceItemDestSIT -// - DOSHUT, DDSHUT - MTOServiceItemShuttle -// - DCRT, DUCRT - MTOServiceItemDomesticCrating -// - ICRT, IUCRT - MTOServiceItemInternationalCrating -// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge -// -// The documentation will then update with the supported fields. -// -// swagger:model MTOServiceItemModelType -type MTOServiceItemModelType string - -func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. -func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { - return &m -} - -const ( - - // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" - MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" - - // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" - MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" - - // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" - MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" - - // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" - MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" - - // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" - MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" - - // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" - MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" - - // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" - MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" -) - -// for schema -var mTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) - } -} - -func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item model type -func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o service item model type based on context it is used -func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go deleted file mode 100644 index fc2af97e4e5..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go +++ /dev/null @@ -1,900 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemOriginSIT -type MTOServiceItemOriginSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemOriginSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemOriginSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitEntryDate = data.SitEntryDate - result.SitHHGActualOrigin = data.SitHHGActualOrigin - result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - }{ - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitEntryDate: m.SitEntryDate, - - SitHHGActualOrigin: m.SitHHGActualOrigin, - - SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item origin s i t -func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGActualOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGOriginalOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if m.SitHHGActualOrigin != nil { - if err := m.SitHHGActualOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if m.SitHHGOriginalOrigin != nil { - if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { - return err - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item origin s i t based on the context it is used -func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGActualOrigin != nil { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGOriginalOrigin != nil { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemOriginSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_shuttle.go b/pkg/gen/primemessages/m_t_o_service_item_shuttle.go deleted file mode 100644 index b479f43283c..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,633 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemShuttle Describes a shuttle service item. -// -// swagger:model MTOServiceItemShuttle -type MTOServiceItemShuttle struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemShuttle) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemShuttle) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { - return "MTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemShuttle) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemShuttle) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemShuttle - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item shuttle -func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item shuttle based on the context it is used -func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res MTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_service_item_status.go b/pkg/gen/primemessages/m_t_o_service_item_status.go deleted file mode 100644 index 2670354b836..00000000000 --- a/pkg/gen/primemessages/m_t_o_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. -// -// swagger:model MTOServiceItemStatus -type MTOServiceItemStatus string - -func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. -func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { - return &m -} - -const ( - - // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" - MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" - - // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" - MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" - - // MTOServiceItemStatusREJECTED captures enum value "REJECTED" - MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" -) - -// for schema -var mTOServiceItemStatusEnum []interface{} - -func init() { - var res []MTOServiceItemStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) - } -} - -func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item status -func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item status based on the context it is used -func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_shipment.go b/pkg/gen/primemessages/m_t_o_shipment.go deleted file mode 100644 index a5ca83244c0..00000000000 --- a/pkg/gen/primemessages/m_t_o_shipment.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipment m t o shipment -// -// swagger:model MTOShipment -type MTOShipment struct { - MTOShipmentWithoutServiceItems - - mtoServiceItemsField []MTOServiceItem -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOShipment) UnmarshalJSON(raw []byte) error { - var data struct { - MTOShipmentWithoutServiceItems - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var propMtoServiceItems []MTOServiceItem - if string(data.MtoServiceItems) != "null" { - mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - propMtoServiceItems = mtoServiceItems - } - - var result MTOShipment - - result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOShipment) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - MTOShipmentWithoutServiceItems - }{ - - MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o shipment -func (m *MTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItems()) { // not required - return nil - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this m t o shipment based on the context it is used -func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipment) UnmarshalBinary(b []byte) error { - var res MTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_shipment_type.go b/pkg/gen/primemessages/m_t_o_shipment_type.go deleted file mode 100644 index 45ce8a14201..00000000000 --- a/pkg/gen/primemessages/m_t_o_shipment_type.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType Shipment Type -// -// The type of shipment. -// - `HHG` = Household goods move -// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) -// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) -// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) -// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination -// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer -// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. -// -// Example: HHG -// -// swagger:model MTOShipmentType -type MTOShipmentType string - -func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType. -func (m MTOShipmentType) Pointer() *MTOShipmentType { - return &m -} - -const ( - - // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" - - // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" - - // MTOShipmentTypeHHG captures enum value "HHG" - MTOShipmentTypeHHG MTOShipmentType = "HHG" - - // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" - - // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" - - // MTOShipmentTypePPM captures enum value "PPM" - MTOShipmentTypePPM MTOShipmentType = "PPM" - - // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" -) - -// for schema -var mTOShipmentTypeEnum []interface{} - -func init() { - var res []MTOShipmentType - if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) - } -} - -func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type -func (m MTOShipmentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type based on context it is used -func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go b/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go deleted file mode 100644 index f3cbfc05c16..00000000000 --- a/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go +++ /dev/null @@ -1,1282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipmentWithoutServiceItems m t o shipment without service items -// -// swagger:model MTOShipmentWithoutServiceItems -type MTOShipmentWithoutServiceItems struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // The actual weight of any pro gear being shipped. - // - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // The actual weight of any spouse pro gear being shipped. - // - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // The date when the Task Ordering Officer first approved this shipment for the move. - // Read Only: true - // Format: date - ApprovedDate *strfmt.Date `json:"approvedDate"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - // Read Only: true - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // The customer can use the customer remarks field to inform the services counselor and the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Customer enters this information during onboarding. Optional field. - // - // Example: handle with care - // Read Only: true - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // delivery address update - DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // The SIT authorized end date for destination SIT. - // Format: date - DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The reason the TOO provided when requesting a diversion for this shipment. - // - // Read Only: true - DiversionReason *string `json:"diversionReason,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The ID of the shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Single-letter designator for domestic (d) or international (i) shipments - // Example: d - // Enum: [d i] - MarketCode string `json:"marketCode,omitempty"` - - // The ID of the move for this shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The SIT authorized end date for origin SIT. - // Format: date - OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date when the Prime contractor recorded the shipment's estimated weight. - // Read Only: true - // Format: date - PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` - - // The customer's preferred delivery date. - // Read Only: true - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` - - // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. - // - // Read Only: true - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` - - // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. - // - // Read Only: true - // Format: date - RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` - - // reweigh - Reweigh *Reweigh `json:"reweigh,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // sit extensions - SitExtensions SITExtensions `json:"sitExtensions,omitempty"` - - // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. - // - // Read Only: true - // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] - Status string `json:"status,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o shipment without service items -func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveryAddressUpdate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReweigh(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExtensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if m.DeliveryAddressUpdate != nil { - if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) 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 -} - -var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" - MTOShipmentWithoutServiceItemsMarketCodeD string = "d" - - // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" - MTOShipmentWithoutServiceItemsMarketCodeI string = "i" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required - return nil - } - - if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if m.Reweigh != nil { - if err := m.Reweigh.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { - if swag.IsZero(m.SitExtensions) { // not required - return nil - } - - if err := m.SitExtensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" - - // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" - MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" - - // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" - MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" - MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" - - // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment without service items based on the context it is used -func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateApprovedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDiversionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReweigh(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitExtensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.DeliveryAddressUpdate != nil { - - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { - - if m.Reweigh != nil { - - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { - var res MTOShipmentWithoutServiceItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go deleted file mode 100644 index bfdddceba39..00000000000 --- a/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. -// -// swagger:model MTOShipmentsWithoutServiceObjects -type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems - -// Validate validates this m t o shipments without service objects -func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments without service objects based on the context it is used -func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/move_task_order.go b/pkg/gen/primemessages/move_task_order.go deleted file mode 100644 index befdf8fe3d0..00000000000 --- a/pkg/gen/primemessages/move_task_order.go +++ /dev/null @@ -1,939 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveTaskOrder move task order -// -// swagger:model MoveTaskOrder -type MoveTaskOrder struct { - - // approved at - // Read Only: true - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination g b l o c - // Example: KKFA - // Read Only: true - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - // destination postal code - // Example: 90210 - // Read Only: true - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // excess weight acknowledged at - // Read Only: true - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - // excess weight qualified at - // Read Only: true - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - // excess weight upload Id - // Read Only: true - // Format: uuid - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - // id - // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - mtoServiceItemsField []MTOServiceItem - - // mto shipments - // Required: true - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - // order - Order *Order `json:"order,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // payment requests - // Required: true - PaymentRequests PaymentRequests `json:"paymentRequests"` - - // ppm estimated weight - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - // ppm type - // Enum: [PARTIAL FULL] - PpmType string `json:"ppmType,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { - var data struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result MoveTaskOrder - - // approvedAt - result.ApprovedAt = data.ApprovedAt - - // availableToPrimeAt - result.AvailableToPrimeAt = data.AvailableToPrimeAt - - // createdAt - result.CreatedAt = data.CreatedAt - - // destinationGBLOC - result.DestinationGBLOC = data.DestinationGBLOC - - // destinationPostalCode - result.DestinationPostalCode = data.DestinationPostalCode - - // eTag - result.ETag = data.ETag - - // excessWeightAcknowledgedAt - result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt - - // excessWeightQualifiedAt - result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt - - // excessWeightUploadId - result.ExcessWeightUploadID = data.ExcessWeightUploadID - - // id - result.ID = data.ID - - // moveCode - result.MoveCode = data.MoveCode - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - // mtoShipments - result.MtoShipments = data.MtoShipments - - // order - result.Order = data.Order - - // orderID - result.OrderID = data.OrderID - - // paymentRequests - result.PaymentRequests = data.PaymentRequests - - // ppmEstimatedWeight - result.PpmEstimatedWeight = data.PpmEstimatedWeight - - // ppmType - result.PpmType = data.PpmType - - // primeCounselingCompletedAt - result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt - - // referenceId - result.ReferenceID = data.ReferenceID - - // updatedAt - result.UpdatedAt = data.UpdatedAt - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - }{ - - ApprovedAt: m.ApprovedAt, - - AvailableToPrimeAt: m.AvailableToPrimeAt, - - CreatedAt: m.CreatedAt, - - DestinationGBLOC: m.DestinationGBLOC, - - DestinationPostalCode: m.DestinationPostalCode, - - ETag: m.ETag, - - ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, - - ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, - - ExcessWeightUploadID: m.ExcessWeightUploadID, - - ID: m.ID, - - MoveCode: m.MoveCode, - - MtoShipments: m.MtoShipments, - - Order: m.Order, - - OrderID: m.OrderID, - - PaymentRequests: m.PaymentRequests, - - PpmEstimatedWeight: m.PpmEstimatedWeight, - - PpmType: m.PpmType, - - PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, - - ReferenceID: m.ReferenceID, - - UpdatedAt: m.UpdatedAt, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this move task order -func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightUploadID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequests(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightUploadID) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { - - if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { - - if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { - return err - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(m.Order) { // not required - return nil - } - - if m.Order != nil { - if err := m.Order.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { - - if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { - return err - } - - if err := m.PaymentRequests.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -var moveTaskOrderTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) - } -} - -const ( - - // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" - MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" - - // MoveTaskOrderPpmTypeFULL captures enum value "FULL" - MoveTaskOrderPpmTypeFULL string = "FULL" -) - -// prop value enum -func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move task order based on the context it is used -func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateApprovedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.Order != nil { - - if swag.IsZero(m.Order) { // not required - return nil - } - - if err := m.Order.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { - var res MoveTaskOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/order.go b/pkg/gen/primemessages/order.go deleted file mode 100644 index d19b30056eb..00000000000 --- a/pkg/gen/primemessages/order.go +++ /dev/null @@ -1,448 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // customer - Customer *Customer `json:"customer,omitempty"` - - // customer ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CustomerID strfmt.UUID `json:"customerID,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // destination duty location g b l o c - // Example: KKFA - DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // entitlement - Entitlement *Entitlements `json:"entitlement,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lines of accounting - // Required: true - LinesOfAccounting *string `json:"linesOfAccounting"` - - // order number - // Required: true - OrderNumber *string `json:"orderNumber"` - - // orders type - OrdersType OrdersType `json:"ordersType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin duty location g b l o c - // Example: KKFA - OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` - - // rank - // Example: E_5 - // Required: true - Rank *string `json:"rank"` - - // report by date - // Format: date - ReportByDate strfmt.Date `json:"reportByDate,omitempty"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLinesOfAccounting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRank(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) validateCustomerID(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerID) { // not required - return nil - } - - if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { - - if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderNumber(formats strfmt.Registry) error { - - if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrdersType(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateRank(formats strfmt.Registry) error { - - if err := validate.Required("rank", "body", m.Rank); err != nil { - return err - } - - return nil -} - -func (m *Order) validateReportByDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReportByDate) { // not required - return nil - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/orders_type.go b/pkg/gen/primemessages/orders_type.go deleted file mode 100644 index 84f9bf262bc..00000000000 --- a/pkg/gen/primemessages/orders_type.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersType Orders type -// -// swagger:model OrdersType -type OrdersType string - -func NewOrdersType(value OrdersType) *OrdersType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersType. -func (m OrdersType) Pointer() *OrdersType { - return &m -} - -const ( - - // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" - OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" - - // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" - OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" - - // OrdersTypeRETIREMENT captures enum value "RETIREMENT" - OrdersTypeRETIREMENT OrdersType = "RETIREMENT" - - // OrdersTypeSEPARATION captures enum value "SEPARATION" - OrdersTypeSEPARATION OrdersType = "SEPARATION" - - // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" - OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" - - // OrdersTypeBLUEBARK captures enum value "BLUEBARK" - OrdersTypeBLUEBARK OrdersType = "BLUEBARK" - - // OrdersTypeSAFETY captures enum value "SAFETY" - OrdersTypeSAFETY OrdersType = "SAFETY" - - // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" - OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" - - // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" - OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" - - // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" - OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" -) - -// for schema -var ordersTypeEnum []interface{} - -func init() { - var res []OrdersType - if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeEnum = append(ordersTypeEnum, v) - } -} - -func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { - if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type -func (m OrdersType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type based on context it is used -func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/p_p_m_shipment.go b/pkg/gen/primemessages/p_p_m_shipment.go deleted file mode 100644 index 245ad0bbdf8..00000000000 --- a/pkg/gen/primemessages/p_p_m_shipment.go +++ /dev/null @@ -1,587 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment -type PPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // The timestamp of when the PPM shipment was created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved in pounds. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin moving from their origin. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // The primary unique identifier of this PPM shipment - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - MaxIncentive *int64 `json:"maxIncentive"` - - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. - ProGearWeight *int64 `json:"proGearWeight"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // The id of the parent MTOShipment record - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage in pounds. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // The timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this p p m shipment -func (m *PPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment based on the context it is used -func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment) UnmarshalBinary(b []byte) error { - var res PPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/p_p_m_shipment_status.go b/pkg/gen/primemessages/p_p_m_shipment_status.go deleted file mode 100644 index 8c3914c3f73..00000000000 --- a/pkg/gen/primemessages/p_p_m_shipment_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMShipmentStatus Status of the PPM Shipment: -// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. -// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. -// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. -// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. -// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. -// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. -// -// swagger:model PPMShipmentStatus -type PPMShipmentStatus string - -func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. -func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { - return &m -} - -const ( - - // PPMShipmentStatusDRAFT captures enum value "DRAFT" - PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" - - // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" - PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" - - // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" - - // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" - - // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" - - // PPMShipmentStatusCANCELED captures enum value "CANCELED" - PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" -) - -// for schema -var pPMShipmentStatusEnum []interface{} - -func init() { - var res []PPMShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) - } -} - -func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { - if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m shipment status -func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p p m shipment status based on the context it is used -func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/payment_request.go b/pkg/gen/primemessages/payment_request.go deleted file mode 100644 index 48ab8978bdf..00000000000 --- a/pkg/gen/primemessages/payment_request.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // payment service items - PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` - - // proof of service docs - ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfServiceDocs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItems) { // not required - return nil - } - - if err := m.PaymentServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { - if swag.IsZero(m.ProofOfServiceDocs) { // not required - return nil - } - - if err := m.ProofOfServiceDocs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/payment_request_status.go b/pkg/gen/primemessages/payment_request_status.go deleted file mode 100644 index 20f20f17521..00000000000 --- a/pkg/gen/primemessages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" - PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/payment_requests.go b/pkg/gen/primemessages/payment_requests.go deleted file mode 100644 index 0c9e1a8df23..00000000000 --- a/pkg/gen/primemessages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/payment_service_item.go b/pkg/gen/primemessages/payment_service_item.go deleted file mode 100644 index 71949ff2851..00000000000 --- a/pkg/gen/primemessages/payment_service_item.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItem payment service item -// -// swagger:model PaymentServiceItem -type PaymentServiceItem struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // payment service item params - PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` - - // Price of the service item in cents - PriceCents *int64 `json:"priceCents,omitempty"` - - // reference ID - // Example: 1234-5678-c56a4180 - // Read Only: true - ReferenceID string `json:"referenceID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentServiceItemStatus `json:"status,omitempty"` -} - -// Validate validates this payment service item -func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemParams) { // not required - return nil - } - - if err := m.PaymentServiceItemParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item based on the context it is used -func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReferenceID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { - var res PaymentServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/payment_service_item_param.go b/pkg/gen/primemessages/payment_service_item_param.go deleted file mode 100644 index e21fefaa831..00000000000 --- a/pkg/gen/primemessages/payment_service_item_param.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemParam payment service item param -// -// swagger:model PaymentServiceItemParam -type PaymentServiceItemParam struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // key - Key ServiceItemParamName `json:"key,omitempty"` - - // origin - Origin ServiceItemParamOrigin `json:"origin,omitempty"` - - // payment service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` - - // type - Type ServiceItemParamType `json:"type,omitempty"` - - // value - // Example: 3025 - Value string `json:"value,omitempty"` -} - -// Validate validates this payment service item param -func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item param based on the context it is used -func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKey(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { - var res PaymentServiceItemParam - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/payment_service_item_params.go b/pkg/gen/primemessages/payment_service_item_params.go deleted file mode 100644 index 39fa10e8c35..00000000000 --- a/pkg/gen/primemessages/payment_service_item_params.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItemParams payment service item params -// -// swagger:model PaymentServiceItemParams -type PaymentServiceItemParams []*PaymentServiceItemParam - -// Validate validates this payment service item params -func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service item params based on the context it is used -func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/payment_service_item_status.go b/pkg/gen/primemessages/payment_service_item_status.go deleted file mode 100644 index a15c35ec7e6..00000000000 --- a/pkg/gen/primemessages/payment_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemStatus Payment Service Item Status -// -// swagger:model PaymentServiceItemStatus -type PaymentServiceItemStatus string - -func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. -func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { - return &m -} - -const ( - - // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" - PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" - - // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" - PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" - - // PaymentServiceItemStatusDENIED captures enum value "DENIED" - PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" - - // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" - - // PaymentServiceItemStatusPAID captures enum value "PAID" - PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" - - // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" - PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" -) - -// for schema -var paymentServiceItemStatusEnum []interface{} - -func init() { - var res []PaymentServiceItemStatus - if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) - } -} - -func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment service item status -func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment service item status based on context it is used -func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/payment_service_items.go b/pkg/gen/primemessages/payment_service_items.go deleted file mode 100644 index be1287570cb..00000000000 --- a/pkg/gen/primemessages/payment_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItems payment service items -// -// swagger:model PaymentServiceItems -type PaymentServiceItems []*PaymentServiceItem - -// Validate validates this payment service items -func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service items based on the context it is used -func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/proof_of_service_doc.go b/pkg/gen/primemessages/proof_of_service_doc.go deleted file mode 100644 index 3833a3354f9..00000000000 --- a/pkg/gen/primemessages/proof_of_service_doc.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDoc proof of service doc -// -// swagger:model ProofOfServiceDoc -type ProofOfServiceDoc struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this proof of service doc -func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service doc based on the context it is used -func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { - var res ProofOfServiceDoc - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/proof_of_service_docs.go b/pkg/gen/primemessages/proof_of_service_docs.go deleted file mode 100644 index 94eb375c5ed..00000000000 --- a/pkg/gen/primemessages/proof_of_service_docs.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDocs proof of service docs -// -// swagger:model ProofOfServiceDocs -type ProofOfServiceDocs []*ProofOfServiceDoc - -// Validate validates this proof of service docs -func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this proof of service docs based on the context it is used -func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/re_service_code.go b/pkg/gen/primemessages/re_service_code.go deleted file mode 100644 index 33db5909d41..00000000000 --- a/pkg/gen/primemessages/re_service_code.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items -// may be requested by the Prime, but may be returned in a response. -// -// Documentation of all the service items will be provided. -// -// swagger:model ReServiceCode -type ReServiceCode string - -func NewReServiceCode(value ReServiceCode) *ReServiceCode { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReServiceCode. -func (m ReServiceCode) Pointer() *ReServiceCode { - return &m -} - -const ( - - // ReServiceCodeCS captures enum value "CS" - ReServiceCodeCS ReServiceCode = "CS" - - // ReServiceCodeDBHF captures enum value "DBHF" - ReServiceCodeDBHF ReServiceCode = "DBHF" - - // ReServiceCodeDBTF captures enum value "DBTF" - ReServiceCodeDBTF ReServiceCode = "DBTF" - - // ReServiceCodeDCRT captures enum value "DCRT" - ReServiceCodeDCRT ReServiceCode = "DCRT" - - // ReServiceCodeDDASIT captures enum value "DDASIT" - ReServiceCodeDDASIT ReServiceCode = "DDASIT" - - // ReServiceCodeDDDSIT captures enum value "DDDSIT" - ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" - - // ReServiceCodeDDFSIT captures enum value "DDFSIT" - ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" - - // ReServiceCodeDDP captures enum value "DDP" - ReServiceCodeDDP ReServiceCode = "DDP" - - // ReServiceCodeDDSHUT captures enum value "DDSHUT" - ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" - - // ReServiceCodeDLH captures enum value "DLH" - ReServiceCodeDLH ReServiceCode = "DLH" - - // ReServiceCodeDMHF captures enum value "DMHF" - ReServiceCodeDMHF ReServiceCode = "DMHF" - - // ReServiceCodeDNPK captures enum value "DNPK" - ReServiceCodeDNPK ReServiceCode = "DNPK" - - // ReServiceCodeDOASIT captures enum value "DOASIT" - ReServiceCodeDOASIT ReServiceCode = "DOASIT" - - // ReServiceCodeDOFSIT captures enum value "DOFSIT" - ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" - - // ReServiceCodeDOP captures enum value "DOP" - ReServiceCodeDOP ReServiceCode = "DOP" - - // ReServiceCodeDOPSIT captures enum value "DOPSIT" - ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" - - // ReServiceCodeDOSHUT captures enum value "DOSHUT" - ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" - - // ReServiceCodeDPK captures enum value "DPK" - ReServiceCodeDPK ReServiceCode = "DPK" - - // ReServiceCodeDSH captures enum value "DSH" - ReServiceCodeDSH ReServiceCode = "DSH" - - // ReServiceCodeDUCRT captures enum value "DUCRT" - ReServiceCodeDUCRT ReServiceCode = "DUCRT" - - // ReServiceCodeDUPK captures enum value "DUPK" - ReServiceCodeDUPK ReServiceCode = "DUPK" - - // ReServiceCodeFSC captures enum value "FSC" - ReServiceCodeFSC ReServiceCode = "FSC" - - // ReServiceCodeIBHF captures enum value "IBHF" - ReServiceCodeIBHF ReServiceCode = "IBHF" - - // ReServiceCodeIBTF captures enum value "IBTF" - ReServiceCodeIBTF ReServiceCode = "IBTF" - - // ReServiceCodeICOLH captures enum value "ICOLH" - ReServiceCodeICOLH ReServiceCode = "ICOLH" - - // ReServiceCodeICOUB captures enum value "ICOUB" - ReServiceCodeICOUB ReServiceCode = "ICOUB" - - // ReServiceCodeICRT captures enum value "ICRT" - ReServiceCodeICRT ReServiceCode = "ICRT" - - // ReServiceCodeIDASIT captures enum value "IDASIT" - ReServiceCodeIDASIT ReServiceCode = "IDASIT" - - // ReServiceCodeIDDSIT captures enum value "IDDSIT" - ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" - - // ReServiceCodeIDFSIT captures enum value "IDFSIT" - ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" - - // ReServiceCodeIDSHUT captures enum value "IDSHUT" - ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" - - // ReServiceCodeIHPK captures enum value "IHPK" - ReServiceCodeIHPK ReServiceCode = "IHPK" - - // ReServiceCodeIHUPK captures enum value "IHUPK" - ReServiceCodeIHUPK ReServiceCode = "IHUPK" - - // ReServiceCodeINPK captures enum value "INPK" - ReServiceCodeINPK ReServiceCode = "INPK" - - // ReServiceCodeIOASIT captures enum value "IOASIT" - ReServiceCodeIOASIT ReServiceCode = "IOASIT" - - // ReServiceCodeIOCLH captures enum value "IOCLH" - ReServiceCodeIOCLH ReServiceCode = "IOCLH" - - // ReServiceCodeIOCUB captures enum value "IOCUB" - ReServiceCodeIOCUB ReServiceCode = "IOCUB" - - // ReServiceCodeIOFSIT captures enum value "IOFSIT" - ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" - - // ReServiceCodeIOOLH captures enum value "IOOLH" - ReServiceCodeIOOLH ReServiceCode = "IOOLH" - - // ReServiceCodeIOOUB captures enum value "IOOUB" - ReServiceCodeIOOUB ReServiceCode = "IOOUB" - - // ReServiceCodeIOPSIT captures enum value "IOPSIT" - ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" - - // ReServiceCodeIOSHUT captures enum value "IOSHUT" - ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" - - // ReServiceCodeIUBPK captures enum value "IUBPK" - ReServiceCodeIUBPK ReServiceCode = "IUBPK" - - // ReServiceCodeIUBUPK captures enum value "IUBUPK" - ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" - - // ReServiceCodeIUCRT captures enum value "IUCRT" - ReServiceCodeIUCRT ReServiceCode = "IUCRT" - - // ReServiceCodeMS captures enum value "MS" - ReServiceCodeMS ReServiceCode = "MS" - - // ReServiceCodeNSTH captures enum value "NSTH" - ReServiceCodeNSTH ReServiceCode = "NSTH" - - // ReServiceCodeNSTUB captures enum value "NSTUB" - ReServiceCodeNSTUB ReServiceCode = "NSTUB" -) - -// for schema -var reServiceCodeEnum []interface{} - -func init() { - var res []ReServiceCode - if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceCodeEnum = append(reServiceCodeEnum, v) - } -} - -func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { - if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this re service code -func (m ReServiceCode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReServiceCodeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this re service code based on context it is used -func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/reweigh.go b/pkg/gen/primemessages/reweigh.go deleted file mode 100644 index 45bfe416ce5..00000000000 --- a/pkg/gen/primemessages/reweigh.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. -// -// swagger:model Reweigh -type Reweigh struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // requested at - // Format: date-time - RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` - - // requested by - RequestedBy ReweighRequester `json:"requestedBy,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // verification provided at - // Format: date-time - VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` - - // verification reason - // Example: The reweigh was not performed due to some justification provided by the Prime - VerificationReason *string `json:"verificationReason"` - - // weight - // Example: 2000 - Weight *int64 `json:"weight"` -} - -// Validate validates this reweigh -func (m *Reweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationProvidedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { - if swag.IsZero(m.VerificationProvidedAt) { // not required - return nil - } - - if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this reweigh based on the context it is used -func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedBy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reweigh) UnmarshalBinary(b []byte) error { - var res Reweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/reweigh_requester.go b/pkg/gen/primemessages/reweigh_requester.go deleted file mode 100644 index 52c3cbd7f1c..00000000000 --- a/pkg/gen/primemessages/reweigh_requester.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReweighRequester reweigh requester -// -// swagger:model ReweighRequester -type ReweighRequester string - -func NewReweighRequester(value ReweighRequester) *ReweighRequester { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReweighRequester. -func (m ReweighRequester) Pointer() *ReweighRequester { - return &m -} - -const ( - - // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" - ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" - - // ReweighRequesterPRIME captures enum value "PRIME" - ReweighRequesterPRIME ReweighRequester = "PRIME" - - // ReweighRequesterSYSTEM captures enum value "SYSTEM" - ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" - - // ReweighRequesterTOO captures enum value "TOO" - ReweighRequesterTOO ReweighRequester = "TOO" -) - -// for schema -var reweighRequesterEnum []interface{} - -func init() { - var res []ReweighRequester - if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reweighRequesterEnum = append(reweighRequesterEnum, v) - } -} - -func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { - if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reweigh requester -func (m ReweighRequester) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReweighRequesterEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reweigh requester based on context it is used -func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/s_i_t_extension.go b/pkg/gen/primemessages/s_i_t_extension.go deleted file mode 100644 index d285ce4b0ab..00000000000 --- a/pkg/gen/primemessages/s_i_t_extension.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. -// -// swagger:model SITExtension -type SITExtension struct { - - // approved days - // Example: 30 - ApprovedDays *int64 `json:"approvedDays"` - - // contractor remarks - // Example: We need SIT additional days. The customer has not found a house yet. - ContractorRemarks *string `json:"contractorRemarks"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // decision date - // Format: date-time - DecisionDate *strfmt.DateTime `json:"decisionDate"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // office remarks - OfficeRemarks *string `json:"officeRemarks"` - - // request reason - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason string `json:"requestReason,omitempty"` - - // requested days - // Example: 30 - RequestedDays int64 `json:"requestedDays,omitempty"` - - // status - // Enum: [PENDING APPROVED DENIED] - Status interface{} `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this s i t extension -func (m *SITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDecisionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { - if swag.IsZero(m.DecisionDate) { // not required - return nil - } - - if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -var sITExtensionTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) - } -} - -const ( - - // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // SITExtensionRequestReasonOTHER captures enum value "OTHER" - SITExtensionRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { - if swag.IsZero(m.RequestReason) { // not required - return nil - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t extension based on the context it is used -func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITExtension) UnmarshalBinary(b []byte) error { - var res SITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/s_i_t_extensions.go b/pkg/gen/primemessages/s_i_t_extensions.go deleted file mode 100644 index 58246c7360c..00000000000 --- a/pkg/gen/primemessages/s_i_t_extensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITExtensions s i t extensions -// -// swagger:model SITExtensions -type SITExtensions []*SITExtension - -// Validate validates this s i t extensions -func (m SITExtensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t extensions based on the context it is used -func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/s_i_t_location_type.go b/pkg/gen/primemessages/s_i_t_location_type.go deleted file mode 100644 index dd5f183aa24..00000000000 --- a/pkg/gen/primemessages/s_i_t_location_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SITLocationType The list of SIT location types. -// -// swagger:model SITLocationType -type SITLocationType string - -func NewSITLocationType(value SITLocationType) *SITLocationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SITLocationType. -func (m SITLocationType) Pointer() *SITLocationType { - return &m -} - -const ( - - // SITLocationTypeORIGIN captures enum value "ORIGIN" - SITLocationTypeORIGIN SITLocationType = "ORIGIN" - - // SITLocationTypeDESTINATION captures enum value "DESTINATION" - SITLocationTypeDESTINATION SITLocationType = "DESTINATION" -) - -// for schema -var sITLocationTypeEnum []interface{} - -func init() { - var res []SITLocationType - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITLocationTypeEnum = append(sITLocationTypeEnum, v) - } -} - -func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { - if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this s i t location type -func (m SITLocationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this s i t location type based on context it is used -func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/service_item.go b/pkg/gen/primemessages/service_item.go deleted file mode 100644 index 9f41d0b13e2..00000000000 --- a/pkg/gen/primemessages/service_item.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ServiceItem service item -// -// swagger:model ServiceItem -type ServiceItem struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // This should be populated for the following service items: - // * DOASIT(Domestic origin Additional day SIT) - // * DDASIT(Domestic destination Additional day SIT) - // - // Both take in the following param keys: - // * `SITPaymentRequestStart` - // * `SITPaymentRequestEnd` - // - // The value of each is a date string in the format "YYYY-MM-DD" (e.g. "2023-01-15") - // - Params []*ServiceItemParamsItems0 `json:"params"` -} - -// Validate validates this service item -func (m *ServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateParams(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceItem) 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 *ServiceItem) validateParams(formats strfmt.Registry) error { - if swag.IsZero(m.Params) { // not required - return nil - } - - for i := 0; i < len(m.Params); i++ { - if swag.IsZero(m.Params[i]) { // not required - continue - } - - if m.Params[i] != nil { - if err := m.Params[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service item based on the context it is used -func (m *ServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateParams(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *ServiceItem) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Params); i++ { - - if m.Params[i] != nil { - - if swag.IsZero(m.Params[i]) { // not required - return nil - } - - if err := m.Params[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("params" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("params" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceItem) UnmarshalBinary(b []byte) error { - var res ServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} - -// ServiceItemParamsItems0 service item params items0 -// -// swagger:model ServiceItemParamsItems0 -type ServiceItemParamsItems0 struct { - - // key - // Example: Service Item Parameter Name - Key string `json:"key,omitempty"` - - // value - // Example: Service Item Parameter Value - Value string `json:"value,omitempty"` -} - -// Validate validates this service item params items0 -func (m *ServiceItemParamsItems0) Validate(formats strfmt.Registry) error { - return nil -} - -// ContextValidate validates this service item params items0 based on context it is used -func (m *ServiceItemParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceItemParamsItems0) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceItemParamsItems0) UnmarshalBinary(b []byte) error { - var res ServiceItemParamsItems0 - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/service_item_param_name.go b/pkg/gen/primemessages/service_item_param_name.go deleted file mode 100644 index d43a63a69f7..00000000000 --- a/pkg/gen/primemessages/service_item_param_name.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamName service item param name -// -// swagger:model ServiceItemParamName -type ServiceItemParamName string - -func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. -func (m ServiceItemParamName) Pointer() *ServiceItemParamName { - return &m -} - -const ( - - // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" - ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" - - // ServiceItemParamNameContractCode captures enum value "ContractCode" - ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" - - // ServiceItemParamNameContractYearName captures enum value "ContractYearName" - ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" - - // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" - ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" - - // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" - ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" - - // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" - ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" - - // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" - ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" - - // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" - ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" - - // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" - ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" - - // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" - ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" - - // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" - ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" - - // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" - ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" - - // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" - ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" - - // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" - ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" - - // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" - ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" - - // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" - ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" - - // ServiceItemParamNameIsPeak captures enum value "IsPeak" - ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" - - // ServiceItemParamNameMarketDest captures enum value "MarketDest" - ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" - - // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" - ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" - - // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" - ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" - - // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" - ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" - - // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" - ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" - - // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" - ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" - - // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" - ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" - - // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" - ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" - - // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" - ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" - - // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" - ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" - - // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" - ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" - - // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" - ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" - - // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" - ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" - - // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" - ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" - - // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" - ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" - - // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" - ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" - - // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" - ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" - - // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" - ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" - ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" - - // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" - ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" - - // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" - ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" - - // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" - - // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" - ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" - - // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" - ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" - - // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" - ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" - - // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" - ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" - - // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" - ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" - - // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" - ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" - - // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" - ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" - - // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" - ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" - - // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" - ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" - - // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" - ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" - - // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" - ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" - - // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" - ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" - - // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" - ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" - - // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" - ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" - - // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" - ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" - - // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" - ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" - - // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" - ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" - - // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" - ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" - - // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" - ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" - - // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" - ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" - - // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" - ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" - - // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" - ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" - - // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" - ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" - - // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" - ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" - - // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" - ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" - - // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" - ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" - - // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" - ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" - - // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" - ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" - - // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" - ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" -) - -// for schema -var serviceItemParamNameEnum []interface{} - -func init() { - var res []ServiceItemParamName - if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) - } -} - -func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { - if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param name -func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param name based on context it is used -func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/service_item_param_origin.go b/pkg/gen/primemessages/service_item_param_origin.go deleted file mode 100644 index 9e65ab4adb7..00000000000 --- a/pkg/gen/primemessages/service_item_param_origin.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamOrigin service item param origin -// -// swagger:model ServiceItemParamOrigin -type ServiceItemParamOrigin string - -func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. -func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { - return &m -} - -const ( - - // ServiceItemParamOriginPRIME captures enum value "PRIME" - ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" - - // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" - ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" - - // ServiceItemParamOriginPRICER captures enum value "PRICER" - ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" - - // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" - ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" -) - -// for schema -var serviceItemParamOriginEnum []interface{} - -func init() { - var res []ServiceItemParamOrigin - if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) - } -} - -func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { - if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param origin -func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param origin based on context it is used -func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/service_item_param_type.go b/pkg/gen/primemessages/service_item_param_type.go deleted file mode 100644 index d0ca0c2a63c..00000000000 --- a/pkg/gen/primemessages/service_item_param_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamType service item param type -// -// swagger:model ServiceItemParamType -type ServiceItemParamType string - -func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. -func (m ServiceItemParamType) Pointer() *ServiceItemParamType { - return &m -} - -const ( - - // ServiceItemParamTypeSTRING captures enum value "STRING" - ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" - - // ServiceItemParamTypeDATE captures enum value "DATE" - ServiceItemParamTypeDATE ServiceItemParamType = "DATE" - - // ServiceItemParamTypeINTEGER captures enum value "INTEGER" - ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" - - // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" - ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" - - // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" - ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" - - // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" - ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" - - // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" - ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" -) - -// for schema -var serviceItemParamTypeEnum []interface{} - -func init() { - var res []ServiceItemParamType - if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) - } -} - -func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { - if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param type -func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param type based on context it is used -func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/service_request_document.go b/pkg/gen/primemessages/service_request_document.go deleted file mode 100644 index e979808d909..00000000000 --- a/pkg/gen/primemessages/service_request_document.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocument service request document -// -// swagger:model ServiceRequestDocument -type ServiceRequestDocument struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this service request document -func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service request document based on the context it is used -func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { - var res ServiceRequestDocument - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/service_request_documents.go b/pkg/gen/primemessages/service_request_documents.go deleted file mode 100644 index 0f308719a75..00000000000 --- a/pkg/gen/primemessages/service_request_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocuments service request documents -// -// swagger:model ServiceRequestDocuments -type ServiceRequestDocuments []*ServiceRequestDocument - -// Validate validates this service request documents -func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service request documents based on the context it is used -func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/shipment_address_update.go b/pkg/gen/primemessages/shipment_address_update.go deleted file mode 100644 index 0e5b4258565..00000000000 --- a/pkg/gen/primemessages/shipment_address_update.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. -// -// swagger:model ShipmentAddressUpdate -type ShipmentAddressUpdate struct { - - // Contractor Remarks - // - // The reason there is an address change. - // Example: This is a contractor remark - // Required: true - // Read Only: true - ContractorRemarks string `json:"contractorRemarks"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` - - // The distance between the original SIT address and requested new delivery address of shipment - // Example: 88 - // Minimum: 0 - NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` - - // Office Remarks - // - // The TOO comment on approval or rejection. - // Example: This is an office remark - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // The distance between the original SIT address and the previous/old delivery address of shipment - // Example: 50 - // Minimum: 0 - OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` - - // original address - // Required: true - OriginalAddress *Address `json:"originalAddress"` - - // shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID"` - - // sit original address - SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` - - // status - // Required: true - Status ShipmentAddressUpdateStatus `json:"status"` -} - -// Validate validates this shipment address update -func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOldSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.NewSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.OldSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { - - if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { - return err - } - - if m.OriginalAddress != nil { - if err := m.OriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if m.SitOriginalAddress != nil { - if err := m.SitOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this shipment address update based on the context it is used -func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginalAddress != nil { - - if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginalAddress != nil { - - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { - var res ShipmentAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/shipment_address_update_status.go b/pkg/gen/primemessages/shipment_address_update_status.go deleted file mode 100644 index 9eb92bd7d2d..00000000000 --- a/pkg/gen/primemessages/shipment_address_update_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdateStatus Status -// -// swagger:model ShipmentAddressUpdateStatus -type ShipmentAddressUpdateStatus string - -func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. -func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { - return &m -} - -const ( - - // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" - ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" - - // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" - ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" - - // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" - ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" -) - -// for schema -var shipmentAddressUpdateStatusEnum []interface{} - -func init() { - var res []ShipmentAddressUpdateStatus - if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) - } -} - -func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { - if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this shipment address update status -func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipment address update status based on the context it is used -func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primemessages/storage_facility.go b/pkg/gen/primemessages/storage_facility.go deleted file mode 100644 index 02296c4b90d..00000000000 --- a/pkg/gen/primemessages/storage_facility.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageFacility The Storage Facility information for the shipment -// -// swagger:model StorageFacility -type StorageFacility struct { - - // address - Address *Address `json:"address,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // facility name - FacilityName string `json:"facilityName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lot number - LotNumber *string `json:"lotNumber,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` -} - -// Validate validates this storage facility -func (m *StorageFacility) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage facility based on the context it is used -func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageFacility) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageFacility) UnmarshalBinary(b []byte) error { - var res StorageFacility - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item.go b/pkg/gen/primemessages/update_m_t_o_service_item.go deleted file mode 100644 index 3afb12a256e..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_service_item.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. -// -// swagger:discriminator UpdateMTOServiceItem modelType -type UpdateMTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // ID of the service item. Must match path. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // model type - // Required: true - ModelType() UpdateMTOServiceItemModelType - SetModelType(UpdateMTOServiceItemModelType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type updateMTOServiceItem struct { - idField strfmt.UUID - - modelTypeField UpdateMTOServiceItemModelType -} - -// ID gets the id of this polymorphic type -func (m *updateMTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []UpdateMTOServiceItem - for _, element := range elements { - obj, err := unmarshalUpdateMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalUpdateMTOServiceItem(data, consumer) -} - -func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "UpdateMTOServiceItem": - var result updateMTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemInternationalPortFSC": - var result UpdateMTOServiceItemInternationalPortFSC - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemSIT": - var result UpdateMTOServiceItemSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemShuttle": - var result UpdateMTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this update m t o service item -func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) 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 -} - -// ContextValidate validate this update m t o service item based on the context it is used -func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go b/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go deleted file mode 100644 index 93dfacaf425..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go +++ /dev/null @@ -1,249 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemInternationalPortFSC Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item. -// -// swagger:model UpdateMTOServiceItemInternationalPortFSC -type UpdateMTOServiceItemInternationalPortFSC struct { - idField strfmt.UUID - - // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. - // Example: PDX - PortCode *string `json:"portCode"` - - // Service code allowed for this model type. - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemInternationalPortFSC) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemInternationalPortFSC) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemInternationalPortFSC) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemInternationalPortFSC" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemInternationalPortFSC) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemInternationalPortFSC) UnmarshalJSON(raw []byte) error { - var data struct { - - // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. - // Example: PDX - PortCode *string `json:"portCode"` - - // Service code allowed for this model type. - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemInternationalPortFSC - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.PortCode = data.PortCode - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemInternationalPortFSC) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. - // Example: PDX - PortCode *string `json:"portCode"` - - // Service code allowed for this model type. - // Enum: [PODFSC POEFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - }{ - - PortCode: m.PortCode, - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item international port f s c -func (m *UpdateMTOServiceItemInternationalPortFSC) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemInternationalPortFSC) 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 -} - -var updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PODFSC","POEFSC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum = append(updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemInternationalPortFSC) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemInternationalPortFSC) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item international port f s c based on the context it is used -func (m *UpdateMTOServiceItemInternationalPortFSC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemInternationalPortFSC) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemInternationalPortFSC) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemInternationalPortFSC) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemInternationalPortFSC - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go b/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go deleted file mode 100644 index 40e86f82729..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go +++ /dev/null @@ -1,95 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DDDSIT - UpdateMTOServiceItemSIT -// - DDFSIT - UpdateMTOServiceItemSIT -// - DDASIT - UpdateMTOServiceItemSIT -// - DOPSIT - UpdateMTOServiceItemSIT -// - DOASIT - UpdateMTOServiceItemSIT -// - DOFSIT - UpdateMTOServiceItemSIT -// - DOSFSC - UpdateMTOServiceItemSIT -// - DDSFSC - UpdateMTOServiceItemSIT -// - DDSHUT - UpdateMTOServiceItemShuttle -// - DOSHUT - UpdateMTOServiceItemShuttle -// - PODFSC - UpdateMTOServiceItemInternationalPortFSC -// - POEFSC - UpdateMTOServiceItemInternationalPortFSC -// -// The documentation will then update with the supported fields. -// -// swagger:model UpdateMTOServiceItemModelType -type UpdateMTOServiceItemModelType string - -func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. -func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { - return &m -} - -const ( - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemInternationalPortFSC captures enum value "UpdateMTOServiceItemInternationalPortFSC" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemInternationalPortFSC UpdateMTOServiceItemModelType = "UpdateMTOServiceItemInternationalPortFSC" -) - -// for schema -var updateMTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []UpdateMTOServiceItemModelType - if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle","UpdateMTOServiceItemInternationalPortFSC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) - } -} - -func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this update m t o service item model type -func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this update m t o service item model type based on context it is used -func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go deleted file mode 100644 index 34fed36c1aa..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item. -// -// swagger:model UpdateMTOServiceItemSIT -type UpdateMTOServiceItemSIT struct { - idField strfmt.UUID - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemSIT" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemSIT - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - result.UpdateReason = data.UpdateReason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - - UpdateReason: m.UpdateReason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item s i t -func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDDSIT","DDASIT","DDFSIT","DDSFSC","DOPSIT","DOASIT","DOFSIT","DOSFSC"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if swag.IsZero(m.SitPostalCode) { // not required - return nil - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item s i t based on the context it is used -func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go deleted file mode 100644 index f8c82a1a9e7..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. -// -// swagger:model UpdateMTOServiceItemShuttle -type UpdateMTOServiceItemShuttle struct { - idField strfmt.UUID - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemShuttle - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item shuttle -func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) 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 -} - -var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item shuttle based on the context it is used -func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_shipment.go b/pkg/gen/primemessages/update_m_t_o_shipment.go deleted file mode 100644 index 074e9772850..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_shipment.go +++ /dev/null @@ -1,570 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipment update m t o shipment -// -// swagger:model UpdateMTOShipment -type UpdateMTOShipment struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // The actual weight of any pro gear shipped during a move. - // Example: 4500 - // Minimum: 1 - ActualProGearWeight *int64 `json:"actualProGearWeight,omitempty"` - - // The actual weight of any pro gear shipped during a move. - // Example: 4500 - // Minimum: 1 - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight,omitempty"` - - // counselor remarks - // Example: counselor approved - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // ppm shipment - PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` -} - -// Validate validates this update m t o shipment -func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualProGearWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualSpouseProGearWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateActualProGearWeight(formats strfmt.Registry) error { - if swag.IsZero(m.ActualProGearWeight) { // not required - return nil - } - - if err := validate.MinimumInt("actualProGearWeight", "body", *m.ActualProGearWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateActualSpouseProGearWeight(formats strfmt.Registry) error { - if swag.IsZero(m.ActualSpouseProGearWeight) { // not required - return nil - } - - if err := validate.MinimumInt("actualSpouseProGearWeight", "body", *m.ActualSpouseProGearWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update m t o shipment based on the context it is used -func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_m_t_o_shipment_status.go b/pkg/gen/primemessages/update_m_t_o_shipment_status.go deleted file mode 100644 index d983851f06a..00000000000 --- a/pkg/gen/primemessages/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. -// -// swagger:model UpdateMTOShipmentStatus -type UpdateMTOShipmentStatus struct { - - // status - // Enum: [CANCELED] - Status string `json:"status,omitempty"` -} - -// Validate validates this update m t o shipment status -func (m *UpdateMTOShipmentStatus) 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 -} - -var updateMTOShipmentStatusTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) - } -} - -const ( - - // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" - UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" -) - -// prop value enum -func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update m t o shipment status based on context it is used -func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipmentStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_p_p_m_shipment.go b/pkg/gen/primemessages/update_p_p_m_shipment.go deleted file mode 100644 index c0601dd92a1..00000000000 --- a/pkg/gen/primemessages/update_p_p_m_shipment.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePPMShipment The PPM specific fields of the shipment with values being changed -// -// swagger:model UpdatePPMShipment -type UpdatePPMShipment struct { - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // Date the customer expects to begin moving from their origin. - // - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear,omitempty"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` - - // The estimated weight of the goods being put into storage. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - SitExpected *bool `json:"sitExpected,omitempty"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` -} - -// Validate validates this update p p m shipment -func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.ExpectedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update p p m shipment based on the context it is used -func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { - var res UpdatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_reweigh.go b/pkg/gen/primemessages/update_reweigh.go deleted file mode 100644 index 0f97c6ae50b..00000000000 --- a/pkg/gen/primemessages/update_reweigh.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. -// -// swagger:model UpdateReweigh -type UpdateReweigh struct { - - // In lieu of a document being uploaded indicating why a reweigh did not occur. - // Example: The reweigh was not performed because the shipment was already delivered - VerificationReason *string `json:"verificationReason"` - - // The total reweighed weight for the shipment in pounds. - // Example: 2000 - // Minimum: 1 - Weight *int64 `json:"weight"` -} - -// Validate validates this update reweigh -func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update reweigh based on context it is used -func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { - var res UpdateReweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/update_shipment_destination_address.go b/pkg/gen/primemessages/update_shipment_destination_address.go deleted file mode 100644 index 6089fccc289..00000000000 --- a/pkg/gen/primemessages/update_shipment_destination_address.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. -// -// swagger:model UpdateShipmentDestinationAddress -type UpdateShipmentDestinationAddress struct { - - // This is the remark the Prime has entered, which would be the reason there is an address change. - // Example: Customer reached out to me this week and let me know they want to move somewhere else. - // Required: true - ContractorRemarks *string `json:"contractorRemarks"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` -} - -// Validate validates this update shipment destination address -func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update shipment destination address based on the context it is used -func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { - var res UpdateShipmentDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/upload_with_omissions.go b/pkg/gen/primemessages/upload_with_omissions.go deleted file mode 100644 index 38d228e510a..00000000000 --- a/pkg/gen/primemessages/upload_with_omissions.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadWithOmissions An uploaded file. -// -// swagger:model UploadWithOmissions -type UploadWithOmissions struct { - - // bytes - // Required: true - Bytes *int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - ContentType *string `json:"contentType"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - Filename *string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // rotation - Rotation int64 `json:"rotation,omitempty"` - - // status - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uri - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this upload with omissions -func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", m.Bytes); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { - - if err := validate.Required("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) 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 -} - -var uploadWithOmissionsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) - } -} - -const ( - - // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" - UploadWithOmissionsStatusINFECTED string = "INFECTED" - - // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" - UploadWithOmissionsStatusCLEAN string = "CLEAN" - - // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" - UploadWithOmissionsStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { - if swag.IsZero(m.URL) { // not required - return nil - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload with omissions based on the context it is used -func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { - var res UploadWithOmissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primemessages/validation_error.go b/pkg/gen/primemessages/validation_error.go deleted file mode 100644 index 53e9aecf86a..00000000000 --- a/pkg/gen/primemessages/validation_error.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primemessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - // invalid fields - // Required: true - InvalidFields map[string][]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.InvalidFields = dataAO1.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - - dataAO1.InvalidFields = m.InvalidFields - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2api/configure_mymove.go b/pkg/gen/primev2api/configure_mymove.go deleted file mode 100644 index 9110ba549e9..00000000000 --- a/pkg/gen/primev2api/configure_mymove.go +++ /dev/null @@ -1,87 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package primev2api - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations" - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/mto_shipment" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime_v2.yaml --api-package primev2operations --model-package primev2messages --server-package primev2api --principal interface{} --exclude-main - -func configureFlags(api *primev2operations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *primev2operations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - - api.JSONProducer = runtime.JSONProducer() - - if api.MtoShipmentCreateMTOShipmentHandler == nil { - api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }) - } - if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { - api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentHandler == nil { - api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/primev2api/doc.go b/pkg/gen/primev2api/doc.go deleted file mode 100644 index 752c26133aa..00000000000 --- a/pkg/gen/primev2api/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package primev2api MilMove Prime V2 API -// -// The Prime V2 API is a RESTful API that enables the Prime contractor to request -// information about upcoming moves, update the details and status of those moves, -// and make payment requests. It uses Mutual TLS for authentication procedures. -// -// All endpoints are located at `/prime/v2/`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /prime/v2 -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// -// Produces: -// - application/json -// -// swagger:meta -package primev2api diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go deleted file mode 100644 index f907813b53b..00000000000 --- a/pkg/gen/primev2api/embedded_spec.go +++ /dev/null @@ -1,7217 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2api - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime V2 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v2/` + "`" + `.\n", - "title": "MilMove Prime V2 API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v2", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\n**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use.", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "x-examples": { - "application/json": { - "boat": { - "summary": "Boat Shipment", - "value": { - "boatShipment": { - "hasTrailer": true, - "heightFeet": 2, - "heightInches": 2, - "isRoadworthy": false, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "counselorRemarks": "test", - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "HAUL_AWAY" - } - }, - "hhg": { - "summary": "HHG", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG" - } - }, - "mobileHome": { - "summary": "Mobile Home Shipment", - "value": { - "counselorRemarks": "test", - "mobileHomeShipment": { - "heightFeet": 2, - "heightInches": 2, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "MOBILE_HOME" - } - }, - "nts": { - "summary": "NTS", - "value": { - "agents": [ - { - "agentType": "RELEASING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG_INTO_NTS" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "agents": [ - { - "agentType": "RECEIVING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "estimatedWeight": 4999, - "expectedDepartureDate": "2022-10-01", - "hasProGear": false, - "sitExpected": false - }, - "shipmentType": "PPM" - } - } - } - }, - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "patch": { - "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "x-examples": { - "application/json": { - "hhg": { - "summary": "HHG", - "value": { - "actualPickupDate": "2022-12-29", - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "destinationAddress": { - "city": "Great Bend", - "postalCode": "13643", - "state": "NY", - "streetAddress1": "6622 Airport Way S", - "streetAddress2": "#1430" - }, - "firstAvailableDeliveryDate": "2023-01-04", - "pointOfContact": "peyton.wing@example.com", - "primeActualWeight": 4500, - "primeEstimatedWeight": 4250, - "scheduledPickupDate": "2022-12-30" - } - }, - "nts": { - "summary": "NTS", - "value": { - "actualPickupDate": "2022-12-29", - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "actualWeight": 4500, - "counselorRemarks": "Beware of dogs on property", - "estimatedWeight": 4250, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "scheduledPickupDate": "2022-12-30" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "destinationAddress": { - "city": "San Antonio", - "postalCode": "78245", - "state": "TX", - "streetAddress1": "812 S 129th Street" - }, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ntsRecordedWeight": 4500 - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "hasProGear": true, - "proGearWeight": 830, - "sitEstimatedDepartureDate": "2022-10-13", - "sitEstimatedEntryDate": "2022-10-06", - "sitEstimatedWeight": 1760, - "sitExpected": true, - "sitLocation": "DESTINATION", - "spouseProGearWeight": 366 - } - } - } - } - }, - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipment" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateBoatShipment": { - "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", - "type": "boolean" - }, - "divertedFromShipmentId": { - "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - } - } - }, - "CreateMobileHomeShipment": { - "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "contractNumber": { - "type": "string", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "methodOfPayment": { - "type": "string", - "readOnly": true - }, - "naics": { - "type": "string", - "readOnly": true - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "packingAndShippingInstructions": { - "type": "string", - "readOnly": true - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - }, - "supplyAndServicesCostEstimate": { - "type": "string", - "readOnly": true - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DOPSIT", - "DOASIT", - "DOFSIT" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment" - ] - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime V2 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v2/` + "`" + `.\n", - "title": "MilMove Prime V2 API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v2", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\n**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use.", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "x-examples": { - "application/json": { - "boat": { - "summary": "Boat Shipment", - "value": { - "boatShipment": { - "hasTrailer": true, - "heightFeet": 2, - "heightInches": 2, - "isRoadworthy": false, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "counselorRemarks": "test", - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "HAUL_AWAY" - } - }, - "hhg": { - "summary": "HHG", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG" - } - }, - "mobileHome": { - "summary": "Mobile Home Shipment", - "value": { - "counselorRemarks": "test", - "mobileHomeShipment": { - "heightFeet": 2, - "heightInches": 2, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "MOBILE_HOME" - } - }, - "nts": { - "summary": "NTS", - "value": { - "agents": [ - { - "agentType": "RELEASING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG_INTO_NTS" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "agents": [ - { - "agentType": "RECEIVING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "estimatedWeight": 4999, - "expectedDepartureDate": "2022-10-01", - "hasProGear": false, - "sitExpected": false - }, - "shipmentType": "PPM" - } - } - } - }, - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "patch": { - "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "x-examples": { - "application/json": { - "hhg": { - "summary": "HHG", - "value": { - "actualPickupDate": "2022-12-29", - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "destinationAddress": { - "city": "Great Bend", - "postalCode": "13643", - "state": "NY", - "streetAddress1": "6622 Airport Way S", - "streetAddress2": "#1430" - }, - "firstAvailableDeliveryDate": "2023-01-04", - "pointOfContact": "peyton.wing@example.com", - "primeActualWeight": 4500, - "primeEstimatedWeight": 4250, - "scheduledPickupDate": "2022-12-30" - } - }, - "nts": { - "summary": "NTS", - "value": { - "actualPickupDate": "2022-12-29", - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "actualWeight": 4500, - "counselorRemarks": "Beware of dogs on property", - "estimatedWeight": 4250, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "scheduledPickupDate": "2022-12-30" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "actualProGearWeight": 1053, - "actualSpouseProGearWeight": 253, - "destinationAddress": { - "city": "San Antonio", - "postalCode": "78245", - "state": "TX", - "streetAddress1": "812 S 129th Street" - }, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ntsRecordedWeight": 4500 - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "hasProGear": true, - "proGearWeight": 830, - "sitEstimatedDepartureDate": "2022-10-13", - "sitEstimatedEntryDate": "2022-10-06", - "sitEstimatedWeight": 1760, - "sitExpected": true, - "sitLocation": "DESTINATION", - "spouseProGearWeight": 366 - } - } - } - } - }, - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipment" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateBoatShipment": { - "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", - "type": "boolean" - }, - "divertedFromShipmentId": { - "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - } - } - }, - "CreateMobileHomeShipment": { - "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "contractNumber": { - "type": "string", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "methodOfPayment": { - "type": "string", - "readOnly": true - }, - "naics": { - "type": "string", - "readOnly": true - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "packingAndShippingInstructions": { - "type": "string", - "readOnly": true - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - }, - "supplyAndServicesCostEstimate": { - "type": "string", - "readOnly": true - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DOPSIT", - "DOASIT", - "DOFSIT" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment" - ] - } - ] -}`)) -} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go deleted file mode 100644 index be121807bb6..00000000000 --- a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go +++ /dev/null @@ -1,65 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler -type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// GetMoveTaskOrderHandler interface for that can handle valid get move task order params -type GetMoveTaskOrderHandler interface { - Handle(GetMoveTaskOrderParams) middleware.Responder -} - -// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation -func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { - return &GetMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder - -getMoveTaskOrder - -### Functionality -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. - -**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. -*/ -type GetMoveTaskOrder struct { - Context *middleware.Context - Handler GetMoveTaskOrderHandler -} - -func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index fc2c39ef759..00000000000 --- a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { - - return GetMoveTaskOrderParams{} -} - -// GetMoveTaskOrderParams contains all the bound params for the get move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveTaskOrder -type GetMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID or MoveCode of move task order to use. - Required: true - In: path - */ - MoveID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. -func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveID = raw - - return nil -} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 282a88ce3b0..00000000000 --- a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK -const GetMoveTaskOrderOKCode int = 200 - -/* -GetMoveTaskOrderOK Successfully retrieve an individual move task order. - -swagger:response getMoveTaskOrderOK -*/ -type GetMoveTaskOrderOK struct { - - /* - In: Body - */ - Payload *primev2messages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - - return &GetMoveTaskOrderOK{} -} - -// WithPayload adds the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) WithPayload(payload *primev2messages.MoveTaskOrder) *GetMoveTaskOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) SetPayload(payload *primev2messages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized -const GetMoveTaskOrderUnauthorizedCode int = 401 - -/* -GetMoveTaskOrderUnauthorized The request was denied. - -swagger:response getMoveTaskOrderUnauthorized -*/ -type GetMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - - return &GetMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden -const GetMoveTaskOrderForbiddenCode int = 403 - -/* -GetMoveTaskOrderForbidden The request was denied. - -swagger:response getMoveTaskOrderForbidden -*/ -type GetMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - - return &GetMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound -const GetMoveTaskOrderNotFoundCode int = 404 - -/* -GetMoveTaskOrderNotFound The requested resource wasn't found. - -swagger:response getMoveTaskOrderNotFound -*/ -type GetMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - - return &GetMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError -const GetMoveTaskOrderInternalServerErrorCode int = 500 - -/* -GetMoveTaskOrderInternalServerError A server error occurred. - -swagger:response getMoveTaskOrderInternalServerError -*/ -type GetMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *primev2messages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - - return &GetMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primev2messages.Error) *GetMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primev2messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go deleted file mode 100644 index 403220622c7..00000000000 --- a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveTaskOrderURL generates an URL for the get move task order operation -type GetMoveTaskOrderURL struct { - MoveID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveID}" - - moveID := o.MoveID - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveTaskOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v2" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go deleted file mode 100644 index e1bcda5afd9..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go +++ /dev/null @@ -1,73 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler -type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params -type CreateMTOShipmentHandler interface { - Handle(CreateMTOShipmentParams) middleware.Responder -} - -// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation -func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { - return &CreateMTOShipment{Context: ctx, Handler: handler} -} - -/* - CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment - -createMTOShipment - -Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a -need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must -approve it before the contractor can proceed with billing. - -**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. -If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically -inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize -the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. - -**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. - -**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to -one of their moves. Otherwise, the Prime can fetch the related move using the -[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. -*/ -type CreateMTOShipment struct { - Context *middleware.Context - Handler CreateMTOShipmentHandler -} - -func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 4e2cb59c04b..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOShipmentParams() CreateMTOShipmentParams { - - return CreateMTOShipmentParams{} -} - -// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOShipment -type CreateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *primev2messages.CreateMTOShipment -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. -func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primev2messages.CreateMTOShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index 57816d6eac0..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK -const CreateMTOShipmentOKCode int = 200 - -/* -CreateMTOShipmentOK Successfully created a MTO shipment. - -swagger:response createMTOShipmentOK -*/ -type CreateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *primev2messages.MTOShipment `json:"body,omitempty"` -} - -// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - - return &CreateMTOShipmentOK{} -} - -// WithPayload adds the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) WithPayload(payload *primev2messages.MTOShipment) *CreateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) SetPayload(payload *primev2messages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest -const CreateMTOShipmentBadRequestCode int = 400 - -/* -CreateMTOShipmentBadRequest The request payload is invalid. - -swagger:response createMTOShipmentBadRequest -*/ -type CreateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - - return &CreateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) WithPayload(payload *primev2messages.ClientError) *CreateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound -const CreateMTOShipmentNotFoundCode int = 404 - -/* -CreateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response createMTOShipmentNotFound -*/ -type CreateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - - return &CreateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) WithPayload(payload *primev2messages.ClientError) *CreateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity -const CreateMTOShipmentUnprocessableEntityCode int = 422 - -/* -CreateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createMTOShipmentUnprocessableEntity -*/ -type CreateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primev2messages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - - return &CreateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *primev2messages.ValidationError) *CreateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *primev2messages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError -const CreateMTOShipmentInternalServerErrorCode int = 500 - -/* -CreateMTOShipmentInternalServerError A server error occurred. - -swagger:response createMTOShipmentInternalServerError -*/ -type CreateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *primev2messages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - - return &CreateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *primev2messages.Error) *CreateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *primev2messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index f64c5e4ffcd..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOShipmentURL generates an URL for the create m t o shipment operation -type CreateMTOShipmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v2" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go deleted file mode 100644 index c4d6e9d31ba..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go +++ /dev/null @@ -1,72 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler -type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params -type UpdateMTOShipmentHandler interface { - Handle(UpdateMTOShipmentParams) middleware.Responder -} - -// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation -func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { - return &UpdateMTOShipment{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment - -updateMTOShipment - -Updates an existing shipment for a move. - -Note that there are some restrictions on nested objects: - -* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. -* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. -* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. - -These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. - -Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. - -**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. -*/ -type UpdateMTOShipment struct { - Context *middleware.Context - Handler UpdateMTOShipmentHandler -} - -func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index 3a431676a7e..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { - - return UpdateMTOShipmentParams{} -} - -// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipment -type UpdateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *primev2messages.UpdateMTOShipment - /*UUID of the shipment being updated. - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. -func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primev2messages.UpdateMTOShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 18034975fa5..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK -const UpdateMTOShipmentOKCode int = 200 - -/* -UpdateMTOShipmentOK Successfully updated the MTO shipment. - -swagger:response updateMTOShipmentOK -*/ -type UpdateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *primev2messages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - - return &UpdateMTOShipmentOK{} -} - -// WithPayload adds the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) WithPayload(payload *primev2messages.MTOShipment) *UpdateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) SetPayload(payload *primev2messages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest -const UpdateMTOShipmentBadRequestCode int = 400 - -/* -UpdateMTOShipmentBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentBadRequest -*/ -type UpdateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - - return &UpdateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized -const UpdateMTOShipmentUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentUnauthorized The request was denied. - -swagger:response updateMTOShipmentUnauthorized -*/ -type UpdateMTOShipmentUnauthorized struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - - return &UpdateMTOShipmentUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden -const UpdateMTOShipmentForbiddenCode int = 403 - -/* -UpdateMTOShipmentForbidden The request was denied. - -swagger:response updateMTOShipmentForbidden -*/ -type UpdateMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - - return &UpdateMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound -const UpdateMTOShipmentNotFoundCode int = 404 - -/* -UpdateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentNotFound -*/ -type UpdateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - - return &UpdateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed -const UpdateMTOShipmentPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentPreconditionFailed -*/ -type UpdateMTOShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *primev2messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - - return &UpdateMTOShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *primev2messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity -const UpdateMTOShipmentUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOShipmentUnprocessableEntity -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primev2messages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - - return &UpdateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *primev2messages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *primev2messages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError -const UpdateMTOShipmentInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentInternalServerError A server error occurred. - -swagger:response updateMTOShipmentInternalServerError -*/ -type UpdateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *primev2messages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - - return &UpdateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *primev2messages.Error) *UpdateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *primev2messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index 563ca5598fa..00000000000 --- a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation -type UpdateMTOShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v2" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev2api/primev2operations/mymove_api.go b/pkg/gen/primev2api/primev2operations/mymove_api.go deleted file mode 100644 index b2e00bf7989..00000000000 --- a/pkg/gen/primev2api/primev2operations/mymove_api.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/mto_shipment" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - - JSONProducer: runtime.JSONProducer(), - - MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }), - MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Prime V2 API is a RESTful API that enables the Prime contractor to request -information about upcoming moves, update the details and status of those moves, -and make payment requests. It uses Mutual TLS for authentication procedures. - -All endpoints are located at `/prime/v2/`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation - MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler - // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation - MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler - // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation - MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.MtoShipmentCreateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") - } - if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") - } - if o.MtoShipmentUpdateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/primev2api/server.go b/pkg/gen/primev2api/server.go deleted file mode 100644 index 582e2d7a63d..00000000000 --- a/pkg/gen/primev2api/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2api - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *primev2operations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *primev2operations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *primev2operations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index e6dea099e1e..00000000000 --- a/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object -// with the ability to set a timeout on a request. -func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: timeout, - } -} - -// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object -// with the ability to set a context for a request. -func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - Context: ctx, - } -} - -// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - HTTPClient: client, - } -} - -/* -GetMoveTaskOrderParams contains all the parameters to send to the API endpoint - - for the get move task order operation. - - Typically these are written to a http.Request. -*/ -type GetMoveTaskOrderParams struct { - - /* MoveID. - - UUID or MoveCode of move task order to use. - */ - MoveID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMoveID adds the moveID to the get move task order params -func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { - o.SetMoveID(moveID) - return o -} - -// SetMoveID adds the moveId to the get move task order params -func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { - o.MoveID = moveID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param moveID - if err := r.SetPathParam("moveID", o.MoveID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index c6d8c68794a..00000000000 --- a/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. -type GetMoveTaskOrderReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetMoveTaskOrderOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetMoveTaskOrderUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetMoveTaskOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetMoveTaskOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetMoveTaskOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) - } -} - -// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - return &GetMoveTaskOrderOK{} -} - -/* -GetMoveTaskOrderOK describes a response with status code 200, with default header values. - -Successfully retrieve an individual move task order. -*/ -type GetMoveTaskOrderOK struct { - Payload *primev2messages.MoveTaskOrder -} - -// IsSuccess returns true when this get move task order o k response has a 2xx status code -func (o *GetMoveTaskOrderOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get move task order o k response has a 3xx status code -func (o *GetMoveTaskOrderOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order o k response has a 4xx status code -func (o *GetMoveTaskOrderOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order o k response has a 5xx status code -func (o *GetMoveTaskOrderOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order o k response a status code equal to that given -func (o *GetMoveTaskOrderOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get move task order o k response -func (o *GetMoveTaskOrderOK) Code() int { - return 200 -} - -func (o *GetMoveTaskOrderOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) GetPayload() *primev2messages.MoveTaskOrder { - return o.Payload -} - -func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - return &GetMoveTaskOrderUnauthorized{} -} - -/* -GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderUnauthorized struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code -func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code -func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order unauthorized response has a 4xx status code -func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order unauthorized response has a 5xx status code -func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order unauthorized response a status code equal to that given -func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) Code() int { - return 401 -} - -func (o *GetMoveTaskOrderUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - return &GetMoveTaskOrderForbidden{} -} - -/* -GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderForbidden struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this get move task order forbidden response has a 2xx status code -func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order forbidden response has a 3xx status code -func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order forbidden response has a 4xx status code -func (o *GetMoveTaskOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order forbidden response has a 5xx status code -func (o *GetMoveTaskOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order forbidden response a status code equal to that given -func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) Code() int { - return 403 -} - -func (o *GetMoveTaskOrderForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - return &GetMoveTaskOrderNotFound{} -} - -/* -GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type GetMoveTaskOrderNotFound struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this get move task order not found response has a 2xx status code -func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order not found response has a 3xx status code -func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order not found response has a 4xx status code -func (o *GetMoveTaskOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order not found response has a 5xx status code -func (o *GetMoveTaskOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order not found response a status code equal to that given -func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get move task order not found response -func (o *GetMoveTaskOrderNotFound) Code() int { - return 404 -} - -func (o *GetMoveTaskOrderNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - return &GetMoveTaskOrderInternalServerError{} -} - -/* -GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type GetMoveTaskOrderInternalServerError struct { - Payload *primev2messages.Error -} - -// IsSuccess returns true when this get move task order internal server error response has a 2xx status code -func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order internal server error response has a 3xx status code -func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order internal server error response has a 4xx status code -func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order internal server error response has a 5xx status code -func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get move task order internal server error response a status code equal to that given -func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) Code() int { - return 500 -} - -func (o *GetMoveTaskOrderInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primev2messages.Error { - return o.Payload -} - -func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev2client/move_task_order/move_task_order_client.go b/pkg/gen/primev2client/move_task_order/move_task_order_client.go deleted file mode 100644 index ee466fccf62..00000000000 --- a/pkg/gen/primev2client/move_task_order/move_task_order_client.go +++ /dev/null @@ -1,89 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new move task order API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for move task order API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetMoveTaskOrder gets move task order - - ### Functionality - -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. - -**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. -*/ -func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMoveTaskOrderParams() - } - op := &runtime.ClientOperation{ - ID: "getMoveTaskOrder", - Method: "GET", - PathPattern: "/move-task-orders/{moveID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetMoveTaskOrderReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetMoveTaskOrderOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 2eb88a610d5..00000000000 --- a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object -// with the ability to set a context for a request. -func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - Context: ctx, - } -} - -// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -CreateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the create m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type CreateMTOShipmentParams struct { - - // Body. - Body *primev2messages.CreateMTOShipment - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithBody(body *primev2messages.CreateMTOShipment) *CreateMTOShipmentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetBody(body *primev2messages.CreateMTOShipment) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index c0f5592b984..00000000000 --- a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. -type CreateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMTOShipmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateMTOShipmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMTOShipmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateMTOShipmentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateMTOShipmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) - } -} - -// NewCreateMTOShipmentOK creates a CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - return &CreateMTOShipmentOK{} -} - -/* -CreateMTOShipmentOK describes a response with status code 200, with default header values. - -Successfully created a MTO shipment. -*/ -type CreateMTOShipmentOK struct { - Payload *primev2messages.MTOShipment -} - -// IsSuccess returns true when this create m t o shipment o k response has a 2xx status code -func (o *CreateMTOShipmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create m t o shipment o k response has a 3xx status code -func (o *CreateMTOShipmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment o k response has a 4xx status code -func (o *CreateMTOShipmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o shipment o k response has a 5xx status code -func (o *CreateMTOShipmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment o k response a status code equal to that given -func (o *CreateMTOShipmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create m t o shipment o k response -func (o *CreateMTOShipmentOK) Code() int { - return 200 -} - -func (o *CreateMTOShipmentOK) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOShipmentOK) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOShipmentOK) GetPayload() *primev2messages.MTOShipment { - return o.Payload -} - -func (o *CreateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentBadRequest creates a CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - return &CreateMTOShipmentBadRequest{} -} - -/* -CreateMTOShipmentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateMTOShipmentBadRequest struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this create m t o shipment bad request response has a 2xx status code -func (o *CreateMTOShipmentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment bad request response has a 3xx status code -func (o *CreateMTOShipmentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment bad request response has a 4xx status code -func (o *CreateMTOShipmentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment bad request response has a 5xx status code -func (o *CreateMTOShipmentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment bad request response a status code equal to that given -func (o *CreateMTOShipmentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) Code() int { - return 400 -} - -func (o *CreateMTOShipmentBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOShipmentBadRequest) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOShipmentBadRequest) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *CreateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentNotFound creates a CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - return &CreateMTOShipmentNotFound{} -} - -/* -CreateMTOShipmentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateMTOShipmentNotFound struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this create m t o shipment not found response has a 2xx status code -func (o *CreateMTOShipmentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment not found response has a 3xx status code -func (o *CreateMTOShipmentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment not found response has a 4xx status code -func (o *CreateMTOShipmentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment not found response has a 5xx status code -func (o *CreateMTOShipmentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment not found response a status code equal to that given -func (o *CreateMTOShipmentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) Code() int { - return 404 -} - -func (o *CreateMTOShipmentNotFound) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOShipmentNotFound) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOShipmentNotFound) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *CreateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentUnprocessableEntity creates a CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - return &CreateMTOShipmentUnprocessableEntity{} -} - -/* -CreateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateMTOShipmentUnprocessableEntity struct { - Payload *primev2messages.ValidationError -} - -// IsSuccess returns true when this create m t o shipment unprocessable entity response has a 2xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment unprocessable entity response has a 3xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment unprocessable entity response has a 4xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment unprocessable entity response has a 5xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment unprocessable entity response a status code equal to that given -func (o *CreateMTOShipmentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateMTOShipmentUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOShipmentUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOShipmentUnprocessableEntity) GetPayload() *primev2messages.ValidationError { - return o.Payload -} - -func (o *CreateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentInternalServerError creates a CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - return &CreateMTOShipmentInternalServerError{} -} - -/* -CreateMTOShipmentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateMTOShipmentInternalServerError struct { - Payload *primev2messages.Error -} - -// IsSuccess returns true when this create m t o shipment internal server error response has a 2xx status code -func (o *CreateMTOShipmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment internal server error response has a 3xx status code -func (o *CreateMTOShipmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment internal server error response has a 4xx status code -func (o *CreateMTOShipmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o shipment internal server error response has a 5xx status code -func (o *CreateMTOShipmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create m t o shipment internal server error response a status code equal to that given -func (o *CreateMTOShipmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) Code() int { - return 500 -} - -func (o *CreateMTOShipmentInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOShipmentInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOShipmentInternalServerError) GetPayload() *primev2messages.Error { - return o.Payload -} - -func (o *CreateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go b/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go deleted file mode 100644 index e71acd78773..00000000000 --- a/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto shipment API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto shipment API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) - - UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMTOShipment creates m t o shipment - - Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a - -need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must -approve it before the contractor can proceed with billing. - -**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. -If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically -inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize -the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. - -**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. - -**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to -one of their moves. Otherwise, the Prime can fetch the related move using the -[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. -*/ -func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "createMTOShipment", - Method: "POST", - PathPattern: "/mto-shipments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMTOShipmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOShipment updates m t o shipment - - Updates an existing shipment for a move. - -Note that there are some restrictions on nested objects: - -* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. -* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. -* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. - -These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. - -Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. - -**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress -secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, -destinationPostalCode and secondaryDestinationPostalCode]. -*/ -func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipment", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOShipmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index 0d4dfd95650..00000000000 --- a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the update m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *primev2messages.UpdateMTOShipment - - /* MtoShipmentID. - - UUID of the shipment being updated. - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithBody(body *primev2messages.UpdateMTOShipment) *UpdateMTOShipmentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetBody(body *primev2messages.UpdateMTOShipment) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 3d3c9f9e198..00000000000 --- a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2messages" -) - -// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. -type UpdateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOShipmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOShipmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOShipmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOShipmentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOShipmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOShipmentPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOShipmentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOShipmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) - } -} - -// NewUpdateMTOShipmentOK creates a UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - return &UpdateMTOShipmentOK{} -} - -/* -UpdateMTOShipmentOK describes a response with status code 200, with default header values. - -Successfully updated the MTO shipment. -*/ -type UpdateMTOShipmentOK struct { - Payload *primev2messages.MTOShipment -} - -// IsSuccess returns true when this update m t o shipment o k response has a 2xx status code -func (o *UpdateMTOShipmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o shipment o k response has a 3xx status code -func (o *UpdateMTOShipmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment o k response has a 4xx status code -func (o *UpdateMTOShipmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment o k response has a 5xx status code -func (o *UpdateMTOShipmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment o k response a status code equal to that given -func (o *UpdateMTOShipmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) Code() int { - return 200 -} - -func (o *UpdateMTOShipmentOK) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentOK) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentOK) GetPayload() *primev2messages.MTOShipment { - return o.Payload -} - -func (o *UpdateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentBadRequest creates a UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - return &UpdateMTOShipmentBadRequest{} -} - -/* -UpdateMTOShipmentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOShipmentBadRequest struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment bad request response has a 2xx status code -func (o *UpdateMTOShipmentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment bad request response has a 3xx status code -func (o *UpdateMTOShipmentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment bad request response has a 4xx status code -func (o *UpdateMTOShipmentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment bad request response has a 5xx status code -func (o *UpdateMTOShipmentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment bad request response a status code equal to that given -func (o *UpdateMTOShipmentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOShipmentBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentBadRequest) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentUnauthorized creates a UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - return &UpdateMTOShipmentUnauthorized{} -} - -/* -UpdateMTOShipmentUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentUnauthorized struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment unauthorized response has a 2xx status code -func (o *UpdateMTOShipmentUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment unauthorized response has a 3xx status code -func (o *UpdateMTOShipmentUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment unauthorized response has a 4xx status code -func (o *UpdateMTOShipmentUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment unauthorized response has a 5xx status code -func (o *UpdateMTOShipmentUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment unauthorized response a status code equal to that given -func (o *UpdateMTOShipmentUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOShipmentUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentUnauthorized) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentForbidden creates a UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - return &UpdateMTOShipmentForbidden{} -} - -/* -UpdateMTOShipmentForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentForbidden struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment forbidden response has a 2xx status code -func (o *UpdateMTOShipmentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment forbidden response has a 3xx status code -func (o *UpdateMTOShipmentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment forbidden response has a 4xx status code -func (o *UpdateMTOShipmentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment forbidden response has a 5xx status code -func (o *UpdateMTOShipmentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment forbidden response a status code equal to that given -func (o *UpdateMTOShipmentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOShipmentForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentForbidden) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentNotFound creates a UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - return &UpdateMTOShipmentNotFound{} -} - -/* -UpdateMTOShipmentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOShipmentNotFound struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment not found response has a 2xx status code -func (o *UpdateMTOShipmentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment not found response has a 3xx status code -func (o *UpdateMTOShipmentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment not found response has a 4xx status code -func (o *UpdateMTOShipmentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment not found response has a 5xx status code -func (o *UpdateMTOShipmentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment not found response a status code equal to that given -func (o *UpdateMTOShipmentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOShipmentNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentNotFound) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentPreconditionFailed creates a UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - return &UpdateMTOShipmentPreconditionFailed{} -} - -/* -UpdateMTOShipmentPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOShipmentPreconditionFailed struct { - Payload *primev2messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment precondition failed response has a 2xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment precondition failed response has a 3xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment precondition failed response has a 4xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment precondition failed response has a 5xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment precondition failed response a status code equal to that given -func (o *UpdateMTOShipmentPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOShipmentPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentPreconditionFailed) GetPayload() *primev2messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentUnprocessableEntity creates a UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - return &UpdateMTOShipmentUnprocessableEntity{} -} - -/* -UpdateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - Payload *primev2messages.ValidationError -} - -// IsSuccess returns true when this update m t o shipment unprocessable entity response has a 2xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment unprocessable entity response has a 3xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment unprocessable entity response has a 4xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment unprocessable entity response has a 5xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment unprocessable entity response a status code equal to that given -func (o *UpdateMTOShipmentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOShipmentUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentUnprocessableEntity) GetPayload() *primev2messages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentInternalServerError creates a UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - return &UpdateMTOShipmentInternalServerError{} -} - -/* -UpdateMTOShipmentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOShipmentInternalServerError struct { - Payload *primev2messages.Error -} - -// IsSuccess returns true when this update m t o shipment internal server error response has a 2xx status code -func (o *UpdateMTOShipmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment internal server error response has a 3xx status code -func (o *UpdateMTOShipmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment internal server error response has a 4xx status code -func (o *UpdateMTOShipmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment internal server error response has a 5xx status code -func (o *UpdateMTOShipmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o shipment internal server error response a status code equal to that given -func (o *UpdateMTOShipmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOShipmentInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentInternalServerError) GetPayload() *primev2messages.Error { - return o.Payload -} - -func (o *UpdateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev2messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev2client/mymove_client.go b/pkg/gen/primev2client/mymove_client.go deleted file mode 100644 index c13a00c5d64..00000000000 --- a/pkg/gen/primev2client/mymove_client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev2client/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev2client/mto_shipment" -) - -// Default mymove HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/prime/v2" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new mymove HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Mymove { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new mymove HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new mymove client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Mymove) - cli.Transport = transport - cli.MoveTaskOrder = move_task_order.New(transport, formats) - cli.MtoShipment = mto_shipment.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Mymove is a client for mymove -type Mymove struct { - MoveTaskOrder move_task_order.ClientService - - MtoShipment mto_shipment.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Mymove) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.MoveTaskOrder.SetTransport(transport) - c.MtoShipment.SetTransport(transport) -} diff --git a/pkg/gen/primev2messages/m_t_o_agent_type.go b/pkg/gen/primev2messages/m_t_o_agent_type.go deleted file mode 100644 index 4264c873af1..00000000000 --- a/pkg/gen/primev2messages/m_t_o_agent_type.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOAgentType Agent Type -// -// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. -// -// Example: RELEASING_AGENT -// -// swagger:model MTOAgentType -type MTOAgentType string - -func NewMTOAgentType(value MTOAgentType) *MTOAgentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOAgentType. -func (m MTOAgentType) Pointer() *MTOAgentType { - return &m -} - -const ( - - // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" - - // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" -) - -// for schema -var mTOAgentTypeEnum []interface{} - -func init() { - var res []MTOAgentType - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) - } -} - -func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { - if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o agent type -func (m MTOAgentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o agent type based on context it is used -func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_agents.go b/pkg/gen/primev2messages/m_t_o_agents.go deleted file mode 100644 index a7bacab891b..00000000000 --- a/pkg/gen/primev2messages/m_t_o_agents.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. -// -// swagger:model MTOAgents -type MTOAgents []*MTOAgent - -// Validate validates this m t o agents -func (m MTOAgents) Validate(formats strfmt.Registry) error { - var res []error - - iMTOAgentsSize := int64(len(m)) - - if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { - return err - } - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents based on the context it is used -func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item.go b/pkg/gen/primev2messages/m_t_o_service_item.go deleted file mode 100644 index 58ae8130bb3..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. -// -// swagger:discriminator MTOServiceItem modelType -type MTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // A hash unique to this service item that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag() string - SetETag(string) - - // The ID of the service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // locked price cents - LockedPriceCents() *int64 - SetLockedPriceCents(*int64) - - // model type - // Required: true - ModelType() MTOServiceItemModelType - SetModelType(MTOServiceItemModelType) - - // The ID of the move for this service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID() *strfmt.UUID - SetMoveTaskOrderID(*strfmt.UUID) - - // The ID of the shipment this service is for, if any. Optional. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID() strfmt.UUID - SetMtoShipmentID(strfmt.UUID) - - // The full descriptive name of the service. - // Read Only: true - ReServiceName() string - SetReServiceName(string) - - // The reason why this service item was rejected by the TOO. - // Example: item was too heavy - // Read Only: true - RejectionReason() *string - SetRejectionReason(*string) - - // service request documents - ServiceRequestDocuments() ServiceRequestDocuments - SetServiceRequestDocuments(ServiceRequestDocuments) - - // status - Status() MTOServiceItemStatus - SetStatus(MTOServiceItemStatus) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type mTOServiceItem struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - modelTypeField MTOServiceItemModelType - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus -} - -// ETag gets the e tag of this polymorphic type -func (m *mTOServiceItem) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this polymorphic type -func (m *mTOServiceItem) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this polymorphic type -func (m *mTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *mTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this polymorphic type -func (m *mTOServiceItem) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this polymorphic type -func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { - return "MTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this polymorphic type -func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this polymorphic type -func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this polymorphic type -func (m *mTOServiceItem) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this polymorphic type -func (m *mTOServiceItem) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this polymorphic type -func (m *mTOServiceItem) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this polymorphic type -func (m *mTOServiceItem) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this polymorphic type -func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this polymorphic type -func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this polymorphic type -func (m *mTOServiceItem) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this polymorphic type -func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem -func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []MTOServiceItem - for _, element := range elements { - obj, err := unmarshalMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem -func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalMTOServiceItem(data, consumer) -} - -func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "MTOServiceItem": - var result mTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemBasic": - var result MTOServiceItemBasic - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDestSIT": - var result MTOServiceItemDestSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDomesticCrating": - var result MTOServiceItemDomesticCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemInternationalCrating": - var result MTOServiceItemInternationalCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemOriginSIT": - var result MTOServiceItemOriginSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemShuttle": - var result MTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this m t o service item -func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this m t o service item based on the context it is used -func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_basic.go b/pkg/gen/primev2messages/m_t_o_service_item_basic.go deleted file mode 100644 index 3feb6f088c5..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_basic.go +++ /dev/null @@ -1,574 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemBasic -type MTOServiceItemBasic struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemBasic) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemBasic) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemBasic) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { - return "MTOServiceItemBasic" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemBasic) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemBasic) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemBasic) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { - var data struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemBasic - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - }{ - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item basic -func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if m.ReServiceCode != nil { - if err := m.ReServiceCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// ContextValidate validate this m t o service item basic based on the context it is used -func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceCode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { - - if m.ReServiceCode != nil { - - if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { - var res MTOServiceItemBasic - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go deleted file mode 100644 index 86e2a49a773..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go +++ /dev/null @@ -1,987 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDestSIT -type MTOServiceItemDestSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDestSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDestSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDestSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDestSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDestSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item dest s i t -func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item dest s i t based on the context it is used -func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDestSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_dimension.go b/pkg/gen/primev2messages/m_t_o_service_item_dimension.go deleted file mode 100644 index cb94e39e084..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_dimension.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. -// -// swagger:model MTOServiceItemDimension -type MTOServiceItemDimension struct { - - // Height in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Height *int32 `json:"height"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Length in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Length *int32 `json:"length"` - - // Width in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Width *int32 `json:"width"` -} - -// Validate validates this m t o service item dimension -func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLength(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidth(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { - - if err := validate.Required("height", "body", m.Height); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { - - if err := validate.Required("length", "body", m.Length); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { - - if err := validate.Required("width", "body", m.Width); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this m t o service item dimension based on context it is used -func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDimension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go deleted file mode 100644 index 6d1a0a90ae2..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDomesticCrating -type MTOServiceItemDomesticCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDomesticCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDomesticCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.Item = data.Item - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - Item: m.Item, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item domestic crating -func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item domestic crating based on the context it is used -func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDomesticCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go b/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go deleted file mode 100644 index f644a7a869f..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go +++ /dev/null @@ -1,773 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemInternationalCrating -type MTOServiceItemInternationalCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemInternationalCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemInternationalCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.ExternalCrate = data.ExternalCrate - result.Item = data.Item - result.Market = data.Market - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - ExternalCrate: m.ExternalCrate, - - Item: m.Item, - - Market: m.Market, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item international crating -func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarket(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { - - if swag.IsZero(m.Market) { // not required - return nil - } - - // value enum - if err := m.validateMarketEnum("market", "body", m.Market); err != nil { - return err - } - - return nil -} - -var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item international crating based on the context it is used -func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemInternationalCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_model_type.go b/pkg/gen/primev2messages/m_t_o_service_item_model_type.go deleted file mode 100644 index 58755658344..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_model_type.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. -// -// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DOFSIT, DOASIT - MTOServiceItemOriginSIT -// - DDFSIT, DDASIT - MTOServiceItemDestSIT -// - DOSHUT, DDSHUT - MTOServiceItemShuttle -// - DCRT, DUCRT - MTOServiceItemDomesticCrating -// - ICRT, IUCRT - MTOServiceItemInternationalCrating -// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge -// -// The documentation will then update with the supported fields. -// -// swagger:model MTOServiceItemModelType -type MTOServiceItemModelType string - -func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. -func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { - return &m -} - -const ( - - // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" - MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" - - // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" - MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" - - // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" - MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" - - // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" - MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" - - // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" - MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" - - // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" - MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" - - // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" - MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" -) - -// for schema -var mTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) - } -} - -func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item model type -func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o service item model type based on context it is used -func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go deleted file mode 100644 index 9e80dd21eb8..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go +++ /dev/null @@ -1,900 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemOriginSIT -type MTOServiceItemOriginSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemOriginSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemOriginSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitEntryDate = data.SitEntryDate - result.SitHHGActualOrigin = data.SitHHGActualOrigin - result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - }{ - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitEntryDate: m.SitEntryDate, - - SitHHGActualOrigin: m.SitHHGActualOrigin, - - SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item origin s i t -func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGActualOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGOriginalOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if m.SitHHGActualOrigin != nil { - if err := m.SitHHGActualOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if m.SitHHGOriginalOrigin != nil { - if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { - return err - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item origin s i t based on the context it is used -func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGActualOrigin != nil { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGOriginalOrigin != nil { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemOriginSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go b/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go deleted file mode 100644 index 0d244875c9a..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,633 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemShuttle Describes a shuttle service item. -// -// swagger:model MTOServiceItemShuttle -type MTOServiceItemShuttle struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemShuttle) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemShuttle) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { - return "MTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemShuttle) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemShuttle) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemShuttle - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item shuttle -func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item shuttle based on the context it is used -func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res MTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_status.go b/pkg/gen/primev2messages/m_t_o_service_item_status.go deleted file mode 100644 index 4d0ca21e62d..00000000000 --- a/pkg/gen/primev2messages/m_t_o_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. -// -// swagger:model MTOServiceItemStatus -type MTOServiceItemStatus string - -func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. -func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { - return &m -} - -const ( - - // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" - MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" - - // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" - MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" - - // MTOServiceItemStatusREJECTED captures enum value "REJECTED" - MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" -) - -// for schema -var mTOServiceItemStatusEnum []interface{} - -func init() { - var res []MTOServiceItemStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) - } -} - -func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item status -func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item status based on the context it is used -func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_shipment.go b/pkg/gen/primev2messages/m_t_o_shipment.go deleted file mode 100644 index c22be98ca9f..00000000000 --- a/pkg/gen/primev2messages/m_t_o_shipment.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipment m t o shipment -// -// swagger:model MTOShipment -type MTOShipment struct { - MTOShipmentWithoutServiceItems - - mtoServiceItemsField []MTOServiceItem -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOShipment) UnmarshalJSON(raw []byte) error { - var data struct { - MTOShipmentWithoutServiceItems - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var propMtoServiceItems []MTOServiceItem - if string(data.MtoServiceItems) != "null" { - mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - propMtoServiceItems = mtoServiceItems - } - - var result MTOShipment - - result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOShipment) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - MTOShipmentWithoutServiceItems - }{ - - MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o shipment -func (m *MTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItems()) { // not required - return nil - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this m t o shipment based on the context it is used -func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipment) UnmarshalBinary(b []byte) error { - var res MTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_shipment_type.go b/pkg/gen/primev2messages/m_t_o_shipment_type.go deleted file mode 100644 index 79fe1f1ef90..00000000000 --- a/pkg/gen/primev2messages/m_t_o_shipment_type.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType Shipment Type -// -// The type of shipment. -// - `HHG` = Household goods move -// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) -// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) -// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) -// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination -// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer -// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. -// -// Example: HHG -// -// swagger:model MTOShipmentType -type MTOShipmentType string - -func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType. -func (m MTOShipmentType) Pointer() *MTOShipmentType { - return &m -} - -const ( - - // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" - - // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" - - // MTOShipmentTypeHHG captures enum value "HHG" - MTOShipmentTypeHHG MTOShipmentType = "HHG" - - // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" - - // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" - - // MTOShipmentTypePPM captures enum value "PPM" - MTOShipmentTypePPM MTOShipmentType = "PPM" - - // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" -) - -// for schema -var mTOShipmentTypeEnum []interface{} - -func init() { - var res []MTOShipmentType - if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) - } -} - -func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type -func (m MTOShipmentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type based on context it is used -func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go b/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go deleted file mode 100644 index 61ca96b1fe5..00000000000 --- a/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go +++ /dev/null @@ -1,1282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipmentWithoutServiceItems m t o shipment without service items -// -// swagger:model MTOShipmentWithoutServiceItems -type MTOShipmentWithoutServiceItems struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // The actual weight of any pro gear being shipped. - // - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // The actual weight of any spouse pro gear being shipped. - // - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // The date when the Task Ordering Officer first approved this shipment for the move. - // Read Only: true - // Format: date - ApprovedDate *strfmt.Date `json:"approvedDate"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - // Read Only: true - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // The customer can use the customer remarks field to inform the services counselor and the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Customer enters this information during onboarding. Optional field. - // - // Example: handle with care - // Read Only: true - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // delivery address update - DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // The SIT authorized end date for destination SIT. - // Format: date - DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The reason the TOO provided when requesting a diversion for this shipment. - // - // Read Only: true - DiversionReason *string `json:"diversionReason,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The ID of the shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Single-letter designator for domestic (d) or international (i) shipments - // Example: d - // Enum: [d i] - MarketCode string `json:"marketCode,omitempty"` - - // The ID of the move for this shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The SIT authorized end date for origin SIT. - // Format: date - OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date when the Prime contractor recorded the shipment's estimated weight. - // Read Only: true - // Format: date - PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` - - // The customer's preferred delivery date. - // Read Only: true - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` - - // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. - // - // Read Only: true - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` - - // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. - // - // Read Only: true - // Format: date - RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` - - // reweigh - Reweigh *Reweigh `json:"reweigh,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // sit extensions - SitExtensions SITExtensions `json:"sitExtensions,omitempty"` - - // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. - // - // Read Only: true - // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] - Status string `json:"status,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o shipment without service items -func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveryAddressUpdate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReweigh(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExtensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if m.DeliveryAddressUpdate != nil { - if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) 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 -} - -var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" - MTOShipmentWithoutServiceItemsMarketCodeD string = "d" - - // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" - MTOShipmentWithoutServiceItemsMarketCodeI string = "i" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required - return nil - } - - if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if m.Reweigh != nil { - if err := m.Reweigh.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { - if swag.IsZero(m.SitExtensions) { // not required - return nil - } - - if err := m.SitExtensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" - - // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" - MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" - - // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" - MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" - MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" - - // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment without service items based on the context it is used -func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateApprovedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDiversionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReweigh(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitExtensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.DeliveryAddressUpdate != nil { - - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { - - if m.Reweigh != nil { - - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { - var res MTOShipmentWithoutServiceItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go deleted file mode 100644 index a3a91cb9226..00000000000 --- a/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. -// -// swagger:model MTOShipmentsWithoutServiceObjects -type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems - -// Validate validates this m t o shipments without service objects -func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments without service objects based on the context it is used -func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/move_task_order.go b/pkg/gen/primev2messages/move_task_order.go deleted file mode 100644 index c5e6cf21146..00000000000 --- a/pkg/gen/primev2messages/move_task_order.go +++ /dev/null @@ -1,965 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveTaskOrder move task order -// -// swagger:model MoveTaskOrder -type MoveTaskOrder struct { - - // approved at - // Read Only: true - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // contract number - // Read Only: true - ContractNumber string `json:"contractNumber,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination g b l o c - // Example: KKFA - // Read Only: true - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - // destination postal code - // Example: 90210 - // Read Only: true - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // excess weight acknowledged at - // Read Only: true - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - // excess weight qualified at - // Read Only: true - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - // excess weight upload Id - // Read Only: true - // Format: uuid - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - // id - // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - mtoServiceItemsField []MTOServiceItem - - // mto shipments - // Required: true - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - // order - Order *Order `json:"order,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // payment requests - // Required: true - PaymentRequests PaymentRequests `json:"paymentRequests"` - - // ppm estimated weight - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - // ppm type - // Enum: [PARTIAL FULL] - PpmType string `json:"ppmType,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { - var data struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - ContractNumber string `json:"contractNumber,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result MoveTaskOrder - - // approvedAt - result.ApprovedAt = data.ApprovedAt - - // availableToPrimeAt - result.AvailableToPrimeAt = data.AvailableToPrimeAt - - // contractNumber - result.ContractNumber = data.ContractNumber - - // createdAt - result.CreatedAt = data.CreatedAt - - // destinationGBLOC - result.DestinationGBLOC = data.DestinationGBLOC - - // destinationPostalCode - result.DestinationPostalCode = data.DestinationPostalCode - - // eTag - result.ETag = data.ETag - - // excessWeightAcknowledgedAt - result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt - - // excessWeightQualifiedAt - result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt - - // excessWeightUploadId - result.ExcessWeightUploadID = data.ExcessWeightUploadID - - // id - result.ID = data.ID - - // moveCode - result.MoveCode = data.MoveCode - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - // mtoShipments - result.MtoShipments = data.MtoShipments - - // order - result.Order = data.Order - - // orderID - result.OrderID = data.OrderID - - // paymentRequests - result.PaymentRequests = data.PaymentRequests - - // ppmEstimatedWeight - result.PpmEstimatedWeight = data.PpmEstimatedWeight - - // ppmType - result.PpmType = data.PpmType - - // primeCounselingCompletedAt - result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt - - // referenceId - result.ReferenceID = data.ReferenceID - - // updatedAt - result.UpdatedAt = data.UpdatedAt - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - ContractNumber string `json:"contractNumber,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - }{ - - ApprovedAt: m.ApprovedAt, - - AvailableToPrimeAt: m.AvailableToPrimeAt, - - ContractNumber: m.ContractNumber, - - CreatedAt: m.CreatedAt, - - DestinationGBLOC: m.DestinationGBLOC, - - DestinationPostalCode: m.DestinationPostalCode, - - ETag: m.ETag, - - ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, - - ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, - - ExcessWeightUploadID: m.ExcessWeightUploadID, - - ID: m.ID, - - MoveCode: m.MoveCode, - - MtoShipments: m.MtoShipments, - - Order: m.Order, - - OrderID: m.OrderID, - - PaymentRequests: m.PaymentRequests, - - PpmEstimatedWeight: m.PpmEstimatedWeight, - - PpmType: m.PpmType, - - PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, - - ReferenceID: m.ReferenceID, - - UpdatedAt: m.UpdatedAt, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this move task order -func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightUploadID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequests(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightUploadID) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { - - if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { - - if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { - return err - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(m.Order) { // not required - return nil - } - - if m.Order != nil { - if err := m.Order.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { - - if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { - return err - } - - if err := m.PaymentRequests.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -var moveTaskOrderTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) - } -} - -const ( - - // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" - MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" - - // MoveTaskOrderPpmTypeFULL captures enum value "FULL" - MoveTaskOrderPpmTypeFULL string = "FULL" -) - -// prop value enum -func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move task order based on the context it is used -func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateApprovedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContractNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateContractNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractNumber", "body", string(m.ContractNumber)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.Order != nil { - - if swag.IsZero(m.Order) { // not required - return nil - } - - if err := m.Order.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { - var res MoveTaskOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/order.go b/pkg/gen/primev2messages/order.go deleted file mode 100644 index e5ca0e8bc21..00000000000 --- a/pkg/gen/primev2messages/order.go +++ /dev/null @@ -1,516 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // customer - Customer *Customer `json:"customer,omitempty"` - - // customer ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CustomerID strfmt.UUID `json:"customerID,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // destination duty location g b l o c - // Example: KKFA - DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // entitlement - Entitlement *Entitlements `json:"entitlement,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lines of accounting - // Required: true - LinesOfAccounting *string `json:"linesOfAccounting"` - - // method of payment - // Read Only: true - MethodOfPayment string `json:"methodOfPayment,omitempty"` - - // naics - // Read Only: true - Naics string `json:"naics,omitempty"` - - // order number - // Required: true - OrderNumber *string `json:"orderNumber"` - - // orders type - OrdersType OrdersType `json:"ordersType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin duty location g b l o c - // Example: KKFA - OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` - - // packing and shipping instructions - // Read Only: true - PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` - - // rank - // Example: E_5 - // Required: true - Rank *string `json:"rank"` - - // report by date - // Format: date - ReportByDate strfmt.Date `json:"reportByDate,omitempty"` - - // supply and services cost estimate - // Read Only: true - SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLinesOfAccounting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRank(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) validateCustomerID(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerID) { // not required - return nil - } - - if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { - - if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderNumber(formats strfmt.Registry) error { - - if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrdersType(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateRank(formats strfmt.Registry) error { - - if err := validate.Required("rank", "body", m.Rank); err != nil { - return err - } - - return nil -} - -func (m *Order) validateReportByDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReportByDate) { // not required - return nil - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethodOfPayment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNaics(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePackingAndShippingInstructions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSupplyAndServicesCostEstimate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateMethodOfPayment(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "methodOfPayment", "body", string(m.MethodOfPayment)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateNaics(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "naics", "body", string(m.Naics)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidatePackingAndShippingInstructions(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "packingAndShippingInstructions", "body", string(m.PackingAndShippingInstructions)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateSupplyAndServicesCostEstimate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "supplyAndServicesCostEstimate", "body", string(m.SupplyAndServicesCostEstimate)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/orders_type.go b/pkg/gen/primev2messages/orders_type.go deleted file mode 100644 index a5f02303750..00000000000 --- a/pkg/gen/primev2messages/orders_type.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersType Orders type -// -// swagger:model OrdersType -type OrdersType string - -func NewOrdersType(value OrdersType) *OrdersType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersType. -func (m OrdersType) Pointer() *OrdersType { - return &m -} - -const ( - - // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" - OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" - - // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" - OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" - - // OrdersTypeRETIREMENT captures enum value "RETIREMENT" - OrdersTypeRETIREMENT OrdersType = "RETIREMENT" - - // OrdersTypeSEPARATION captures enum value "SEPARATION" - OrdersTypeSEPARATION OrdersType = "SEPARATION" - - // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" - OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" - - // OrdersTypeBLUEBARK captures enum value "BLUEBARK" - OrdersTypeBLUEBARK OrdersType = "BLUEBARK" - - // OrdersTypeSAFETY captures enum value "SAFETY" - OrdersTypeSAFETY OrdersType = "SAFETY" - - // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" - OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" - - // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" - OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" - - // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" - OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" -) - -// for schema -var ordersTypeEnum []interface{} - -func init() { - var res []OrdersType - if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeEnum = append(ordersTypeEnum, v) - } -} - -func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { - if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type -func (m OrdersType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type based on context it is used -func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/p_p_m_shipment.go b/pkg/gen/primev2messages/p_p_m_shipment.go deleted file mode 100644 index 7cb11f73406..00000000000 --- a/pkg/gen/primev2messages/p_p_m_shipment.go +++ /dev/null @@ -1,587 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment -type PPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // The timestamp of when the PPM shipment was created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved in pounds. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin moving from their origin. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // The primary unique identifier of this PPM shipment - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - MaxIncentive *int64 `json:"maxIncentive"` - - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. - ProGearWeight *int64 `json:"proGearWeight"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // The id of the parent MTOShipment record - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage in pounds. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // The timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this p p m shipment -func (m *PPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment based on the context it is used -func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment) UnmarshalBinary(b []byte) error { - var res PPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/p_p_m_shipment_status.go b/pkg/gen/primev2messages/p_p_m_shipment_status.go deleted file mode 100644 index ccbf00e05d1..00000000000 --- a/pkg/gen/primev2messages/p_p_m_shipment_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMShipmentStatus Status of the PPM Shipment: -// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. -// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. -// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. -// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. -// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. -// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. -// -// swagger:model PPMShipmentStatus -type PPMShipmentStatus string - -func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. -func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { - return &m -} - -const ( - - // PPMShipmentStatusDRAFT captures enum value "DRAFT" - PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" - - // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" - PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" - - // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" - - // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" - - // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" - - // PPMShipmentStatusCANCELED captures enum value "CANCELED" - PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" -) - -// for schema -var pPMShipmentStatusEnum []interface{} - -func init() { - var res []PPMShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) - } -} - -func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { - if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m shipment status -func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p p m shipment status based on the context it is used -func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/payment_request.go b/pkg/gen/primev2messages/payment_request.go deleted file mode 100644 index 76c4688a11b..00000000000 --- a/pkg/gen/primev2messages/payment_request.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // payment service items - PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` - - // proof of service docs - ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfServiceDocs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItems) { // not required - return nil - } - - if err := m.PaymentServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { - if swag.IsZero(m.ProofOfServiceDocs) { // not required - return nil - } - - if err := m.ProofOfServiceDocs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/payment_request_status.go b/pkg/gen/primev2messages/payment_request_status.go deleted file mode 100644 index ba2eb3a5788..00000000000 --- a/pkg/gen/primev2messages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" - PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/payment_requests.go b/pkg/gen/primev2messages/payment_requests.go deleted file mode 100644 index 0599f81434f..00000000000 --- a/pkg/gen/primev2messages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/payment_service_item.go b/pkg/gen/primev2messages/payment_service_item.go deleted file mode 100644 index bf995a97438..00000000000 --- a/pkg/gen/primev2messages/payment_service_item.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItem payment service item -// -// swagger:model PaymentServiceItem -type PaymentServiceItem struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // payment service item params - PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` - - // Price of the service item in cents - PriceCents *int64 `json:"priceCents,omitempty"` - - // reference ID - // Example: 1234-5678-c56a4180 - // Read Only: true - ReferenceID string `json:"referenceID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentServiceItemStatus `json:"status,omitempty"` -} - -// Validate validates this payment service item -func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemParams) { // not required - return nil - } - - if err := m.PaymentServiceItemParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item based on the context it is used -func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReferenceID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { - var res PaymentServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/payment_service_item_param.go b/pkg/gen/primev2messages/payment_service_item_param.go deleted file mode 100644 index 5f1c86b59b1..00000000000 --- a/pkg/gen/primev2messages/payment_service_item_param.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemParam payment service item param -// -// swagger:model PaymentServiceItemParam -type PaymentServiceItemParam struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // key - Key ServiceItemParamName `json:"key,omitempty"` - - // origin - Origin ServiceItemParamOrigin `json:"origin,omitempty"` - - // payment service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` - - // type - Type ServiceItemParamType `json:"type,omitempty"` - - // value - // Example: 3025 - Value string `json:"value,omitempty"` -} - -// Validate validates this payment service item param -func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item param based on the context it is used -func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKey(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { - var res PaymentServiceItemParam - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/payment_service_item_params.go b/pkg/gen/primev2messages/payment_service_item_params.go deleted file mode 100644 index e9153604876..00000000000 --- a/pkg/gen/primev2messages/payment_service_item_params.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItemParams payment service item params -// -// swagger:model PaymentServiceItemParams -type PaymentServiceItemParams []*PaymentServiceItemParam - -// Validate validates this payment service item params -func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service item params based on the context it is used -func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/payment_service_item_status.go b/pkg/gen/primev2messages/payment_service_item_status.go deleted file mode 100644 index 950b07812d7..00000000000 --- a/pkg/gen/primev2messages/payment_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemStatus Payment Service Item Status -// -// swagger:model PaymentServiceItemStatus -type PaymentServiceItemStatus string - -func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. -func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { - return &m -} - -const ( - - // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" - PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" - - // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" - PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" - - // PaymentServiceItemStatusDENIED captures enum value "DENIED" - PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" - - // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" - - // PaymentServiceItemStatusPAID captures enum value "PAID" - PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" - - // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" - PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" -) - -// for schema -var paymentServiceItemStatusEnum []interface{} - -func init() { - var res []PaymentServiceItemStatus - if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) - } -} - -func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment service item status -func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment service item status based on context it is used -func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/payment_service_items.go b/pkg/gen/primev2messages/payment_service_items.go deleted file mode 100644 index bc947193108..00000000000 --- a/pkg/gen/primev2messages/payment_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItems payment service items -// -// swagger:model PaymentServiceItems -type PaymentServiceItems []*PaymentServiceItem - -// Validate validates this payment service items -func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service items based on the context it is used -func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/proof_of_service_doc.go b/pkg/gen/primev2messages/proof_of_service_doc.go deleted file mode 100644 index 3ee86851448..00000000000 --- a/pkg/gen/primev2messages/proof_of_service_doc.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDoc proof of service doc -// -// swagger:model ProofOfServiceDoc -type ProofOfServiceDoc struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this proof of service doc -func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service doc based on the context it is used -func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { - var res ProofOfServiceDoc - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/proof_of_service_docs.go b/pkg/gen/primev2messages/proof_of_service_docs.go deleted file mode 100644 index 18000e74808..00000000000 --- a/pkg/gen/primev2messages/proof_of_service_docs.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDocs proof of service docs -// -// swagger:model ProofOfServiceDocs -type ProofOfServiceDocs []*ProofOfServiceDoc - -// Validate validates this proof of service docs -func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this proof of service docs based on the context it is used -func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/re_service_code.go b/pkg/gen/primev2messages/re_service_code.go deleted file mode 100644 index e173f0bc308..00000000000 --- a/pkg/gen/primev2messages/re_service_code.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items -// may be requested by the Prime, but may be returned in a response. -// -// Documentation of all the service items will be provided. -// -// swagger:model ReServiceCode -type ReServiceCode string - -func NewReServiceCode(value ReServiceCode) *ReServiceCode { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReServiceCode. -func (m ReServiceCode) Pointer() *ReServiceCode { - return &m -} - -const ( - - // ReServiceCodeCS captures enum value "CS" - ReServiceCodeCS ReServiceCode = "CS" - - // ReServiceCodeDBHF captures enum value "DBHF" - ReServiceCodeDBHF ReServiceCode = "DBHF" - - // ReServiceCodeDBTF captures enum value "DBTF" - ReServiceCodeDBTF ReServiceCode = "DBTF" - - // ReServiceCodeDCRT captures enum value "DCRT" - ReServiceCodeDCRT ReServiceCode = "DCRT" - - // ReServiceCodeDDASIT captures enum value "DDASIT" - ReServiceCodeDDASIT ReServiceCode = "DDASIT" - - // ReServiceCodeDDDSIT captures enum value "DDDSIT" - ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" - - // ReServiceCodeDDFSIT captures enum value "DDFSIT" - ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" - - // ReServiceCodeDDP captures enum value "DDP" - ReServiceCodeDDP ReServiceCode = "DDP" - - // ReServiceCodeDDSHUT captures enum value "DDSHUT" - ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" - - // ReServiceCodeDLH captures enum value "DLH" - ReServiceCodeDLH ReServiceCode = "DLH" - - // ReServiceCodeDMHF captures enum value "DMHF" - ReServiceCodeDMHF ReServiceCode = "DMHF" - - // ReServiceCodeDNPK captures enum value "DNPK" - ReServiceCodeDNPK ReServiceCode = "DNPK" - - // ReServiceCodeDOASIT captures enum value "DOASIT" - ReServiceCodeDOASIT ReServiceCode = "DOASIT" - - // ReServiceCodeDOFSIT captures enum value "DOFSIT" - ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" - - // ReServiceCodeDOP captures enum value "DOP" - ReServiceCodeDOP ReServiceCode = "DOP" - - // ReServiceCodeDOPSIT captures enum value "DOPSIT" - ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" - - // ReServiceCodeDOSHUT captures enum value "DOSHUT" - ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" - - // ReServiceCodeDPK captures enum value "DPK" - ReServiceCodeDPK ReServiceCode = "DPK" - - // ReServiceCodeDSH captures enum value "DSH" - ReServiceCodeDSH ReServiceCode = "DSH" - - // ReServiceCodeDUCRT captures enum value "DUCRT" - ReServiceCodeDUCRT ReServiceCode = "DUCRT" - - // ReServiceCodeDUPK captures enum value "DUPK" - ReServiceCodeDUPK ReServiceCode = "DUPK" - - // ReServiceCodeFSC captures enum value "FSC" - ReServiceCodeFSC ReServiceCode = "FSC" - - // ReServiceCodeIBHF captures enum value "IBHF" - ReServiceCodeIBHF ReServiceCode = "IBHF" - - // ReServiceCodeIBTF captures enum value "IBTF" - ReServiceCodeIBTF ReServiceCode = "IBTF" - - // ReServiceCodeICOLH captures enum value "ICOLH" - ReServiceCodeICOLH ReServiceCode = "ICOLH" - - // ReServiceCodeICOUB captures enum value "ICOUB" - ReServiceCodeICOUB ReServiceCode = "ICOUB" - - // ReServiceCodeICRT captures enum value "ICRT" - ReServiceCodeICRT ReServiceCode = "ICRT" - - // ReServiceCodeIDASIT captures enum value "IDASIT" - ReServiceCodeIDASIT ReServiceCode = "IDASIT" - - // ReServiceCodeIDDSIT captures enum value "IDDSIT" - ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" - - // ReServiceCodeIDFSIT captures enum value "IDFSIT" - ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" - - // ReServiceCodeIDSHUT captures enum value "IDSHUT" - ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" - - // ReServiceCodeIHPK captures enum value "IHPK" - ReServiceCodeIHPK ReServiceCode = "IHPK" - - // ReServiceCodeIHUPK captures enum value "IHUPK" - ReServiceCodeIHUPK ReServiceCode = "IHUPK" - - // ReServiceCodeINPK captures enum value "INPK" - ReServiceCodeINPK ReServiceCode = "INPK" - - // ReServiceCodeIOASIT captures enum value "IOASIT" - ReServiceCodeIOASIT ReServiceCode = "IOASIT" - - // ReServiceCodeIOCLH captures enum value "IOCLH" - ReServiceCodeIOCLH ReServiceCode = "IOCLH" - - // ReServiceCodeIOCUB captures enum value "IOCUB" - ReServiceCodeIOCUB ReServiceCode = "IOCUB" - - // ReServiceCodeIOFSIT captures enum value "IOFSIT" - ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" - - // ReServiceCodeIOOLH captures enum value "IOOLH" - ReServiceCodeIOOLH ReServiceCode = "IOOLH" - - // ReServiceCodeIOOUB captures enum value "IOOUB" - ReServiceCodeIOOUB ReServiceCode = "IOOUB" - - // ReServiceCodeIOPSIT captures enum value "IOPSIT" - ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" - - // ReServiceCodeIOSHUT captures enum value "IOSHUT" - ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" - - // ReServiceCodeIUBPK captures enum value "IUBPK" - ReServiceCodeIUBPK ReServiceCode = "IUBPK" - - // ReServiceCodeIUBUPK captures enum value "IUBUPK" - ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" - - // ReServiceCodeIUCRT captures enum value "IUCRT" - ReServiceCodeIUCRT ReServiceCode = "IUCRT" - - // ReServiceCodeMS captures enum value "MS" - ReServiceCodeMS ReServiceCode = "MS" - - // ReServiceCodeNSTH captures enum value "NSTH" - ReServiceCodeNSTH ReServiceCode = "NSTH" - - // ReServiceCodeNSTUB captures enum value "NSTUB" - ReServiceCodeNSTUB ReServiceCode = "NSTUB" -) - -// for schema -var reServiceCodeEnum []interface{} - -func init() { - var res []ReServiceCode - if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceCodeEnum = append(reServiceCodeEnum, v) - } -} - -func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { - if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this re service code -func (m ReServiceCode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReServiceCodeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this re service code based on context it is used -func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/reweigh.go b/pkg/gen/primev2messages/reweigh.go deleted file mode 100644 index 8b4b29c7982..00000000000 --- a/pkg/gen/primev2messages/reweigh.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. -// -// swagger:model Reweigh -type Reweigh struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // requested at - // Format: date-time - RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` - - // requested by - RequestedBy ReweighRequester `json:"requestedBy,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // verification provided at - // Format: date-time - VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` - - // verification reason - // Example: The reweigh was not performed due to some justification provided by the Prime - VerificationReason *string `json:"verificationReason"` - - // weight - // Example: 2000 - Weight *int64 `json:"weight"` -} - -// Validate validates this reweigh -func (m *Reweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationProvidedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { - if swag.IsZero(m.VerificationProvidedAt) { // not required - return nil - } - - if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this reweigh based on the context it is used -func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedBy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reweigh) UnmarshalBinary(b []byte) error { - var res Reweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/reweigh_requester.go b/pkg/gen/primev2messages/reweigh_requester.go deleted file mode 100644 index dc743e74868..00000000000 --- a/pkg/gen/primev2messages/reweigh_requester.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReweighRequester reweigh requester -// -// swagger:model ReweighRequester -type ReweighRequester string - -func NewReweighRequester(value ReweighRequester) *ReweighRequester { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReweighRequester. -func (m ReweighRequester) Pointer() *ReweighRequester { - return &m -} - -const ( - - // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" - ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" - - // ReweighRequesterPRIME captures enum value "PRIME" - ReweighRequesterPRIME ReweighRequester = "PRIME" - - // ReweighRequesterSYSTEM captures enum value "SYSTEM" - ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" - - // ReweighRequesterTOO captures enum value "TOO" - ReweighRequesterTOO ReweighRequester = "TOO" -) - -// for schema -var reweighRequesterEnum []interface{} - -func init() { - var res []ReweighRequester - if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reweighRequesterEnum = append(reweighRequesterEnum, v) - } -} - -func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { - if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reweigh requester -func (m ReweighRequester) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReweighRequesterEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reweigh requester based on context it is used -func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/s_i_t_extension.go b/pkg/gen/primev2messages/s_i_t_extension.go deleted file mode 100644 index 96f6f518790..00000000000 --- a/pkg/gen/primev2messages/s_i_t_extension.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. -// -// swagger:model SITExtension -type SITExtension struct { - - // approved days - // Example: 30 - ApprovedDays *int64 `json:"approvedDays"` - - // contractor remarks - // Example: We need SIT additional days. The customer has not found a house yet. - ContractorRemarks *string `json:"contractorRemarks"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // decision date - // Format: date-time - DecisionDate *strfmt.DateTime `json:"decisionDate"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // office remarks - OfficeRemarks *string `json:"officeRemarks"` - - // request reason - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason string `json:"requestReason,omitempty"` - - // requested days - // Example: 30 - RequestedDays int64 `json:"requestedDays,omitempty"` - - // status - // Enum: [PENDING APPROVED DENIED] - Status interface{} `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this s i t extension -func (m *SITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDecisionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { - if swag.IsZero(m.DecisionDate) { // not required - return nil - } - - if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -var sITExtensionTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) - } -} - -const ( - - // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // SITExtensionRequestReasonOTHER captures enum value "OTHER" - SITExtensionRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { - if swag.IsZero(m.RequestReason) { // not required - return nil - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t extension based on the context it is used -func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITExtension) UnmarshalBinary(b []byte) error { - var res SITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/s_i_t_extensions.go b/pkg/gen/primev2messages/s_i_t_extensions.go deleted file mode 100644 index f796a4525ed..00000000000 --- a/pkg/gen/primev2messages/s_i_t_extensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITExtensions s i t extensions -// -// swagger:model SITExtensions -type SITExtensions []*SITExtension - -// Validate validates this s i t extensions -func (m SITExtensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t extensions based on the context it is used -func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/s_i_t_location_type.go b/pkg/gen/primev2messages/s_i_t_location_type.go deleted file mode 100644 index 0f7c75fce4a..00000000000 --- a/pkg/gen/primev2messages/s_i_t_location_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SITLocationType The list of SIT location types. -// -// swagger:model SITLocationType -type SITLocationType string - -func NewSITLocationType(value SITLocationType) *SITLocationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SITLocationType. -func (m SITLocationType) Pointer() *SITLocationType { - return &m -} - -const ( - - // SITLocationTypeORIGIN captures enum value "ORIGIN" - SITLocationTypeORIGIN SITLocationType = "ORIGIN" - - // SITLocationTypeDESTINATION captures enum value "DESTINATION" - SITLocationTypeDESTINATION SITLocationType = "DESTINATION" -) - -// for schema -var sITLocationTypeEnum []interface{} - -func init() { - var res []SITLocationType - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITLocationTypeEnum = append(sITLocationTypeEnum, v) - } -} - -func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { - if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this s i t location type -func (m SITLocationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this s i t location type based on context it is used -func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/service_item_param_name.go b/pkg/gen/primev2messages/service_item_param_name.go deleted file mode 100644 index fb2d4097030..00000000000 --- a/pkg/gen/primev2messages/service_item_param_name.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamName service item param name -// -// swagger:model ServiceItemParamName -type ServiceItemParamName string - -func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. -func (m ServiceItemParamName) Pointer() *ServiceItemParamName { - return &m -} - -const ( - - // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" - ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" - - // ServiceItemParamNameContractCode captures enum value "ContractCode" - ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" - - // ServiceItemParamNameContractYearName captures enum value "ContractYearName" - ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" - - // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" - ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" - - // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" - ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" - - // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" - ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" - - // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" - ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" - - // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" - ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" - - // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" - ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" - - // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" - ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" - - // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" - ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" - - // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" - ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" - - // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" - ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" - - // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" - ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" - - // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" - ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" - - // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" - ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" - - // ServiceItemParamNameIsPeak captures enum value "IsPeak" - ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" - - // ServiceItemParamNameMarketDest captures enum value "MarketDest" - ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" - - // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" - ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" - - // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" - ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" - - // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" - ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" - - // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" - ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" - - // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" - ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" - - // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" - ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" - - // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" - ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" - - // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" - ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" - - // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" - ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" - - // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" - ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" - - // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" - ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" - - // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" - ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" - - // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" - ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" - - // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" - ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" - - // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" - ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" - - // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" - ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" - - // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" - ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" - ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" - - // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" - ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" - - // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" - ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" - - // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" - - // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" - ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" - - // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" - ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" - - // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" - ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" - - // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" - ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" - - // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" - ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" - - // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" - ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" - - // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" - ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" - - // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" - ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" - - // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" - ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" - - // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" - ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" - - // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" - ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" - - // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" - ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" - - // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" - ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" - - // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" - ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" - - // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" - ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" - - // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" - ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" - - // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" - ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" - - // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" - ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" - - // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" - ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" - - // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" - ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" - - // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" - ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" - - // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" - ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" - - // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" - ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" - - // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" - ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" - - // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" - ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" - - // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" - ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" - - // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" - ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" - - // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" - ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" - - // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" - ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" -) - -// for schema -var serviceItemParamNameEnum []interface{} - -func init() { - var res []ServiceItemParamName - if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) - } -} - -func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { - if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param name -func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param name based on context it is used -func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/service_item_param_origin.go b/pkg/gen/primev2messages/service_item_param_origin.go deleted file mode 100644 index f538d3d3e0a..00000000000 --- a/pkg/gen/primev2messages/service_item_param_origin.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamOrigin service item param origin -// -// swagger:model ServiceItemParamOrigin -type ServiceItemParamOrigin string - -func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. -func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { - return &m -} - -const ( - - // ServiceItemParamOriginPRIME captures enum value "PRIME" - ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" - - // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" - ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" - - // ServiceItemParamOriginPRICER captures enum value "PRICER" - ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" - - // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" - ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" -) - -// for schema -var serviceItemParamOriginEnum []interface{} - -func init() { - var res []ServiceItemParamOrigin - if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) - } -} - -func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { - if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param origin -func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param origin based on context it is used -func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/service_item_param_type.go b/pkg/gen/primev2messages/service_item_param_type.go deleted file mode 100644 index 5b54bf45395..00000000000 --- a/pkg/gen/primev2messages/service_item_param_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamType service item param type -// -// swagger:model ServiceItemParamType -type ServiceItemParamType string - -func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. -func (m ServiceItemParamType) Pointer() *ServiceItemParamType { - return &m -} - -const ( - - // ServiceItemParamTypeSTRING captures enum value "STRING" - ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" - - // ServiceItemParamTypeDATE captures enum value "DATE" - ServiceItemParamTypeDATE ServiceItemParamType = "DATE" - - // ServiceItemParamTypeINTEGER captures enum value "INTEGER" - ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" - - // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" - ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" - - // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" - ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" - - // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" - ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" - - // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" - ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" -) - -// for schema -var serviceItemParamTypeEnum []interface{} - -func init() { - var res []ServiceItemParamType - if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) - } -} - -func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { - if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param type -func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param type based on context it is used -func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/service_request_document.go b/pkg/gen/primev2messages/service_request_document.go deleted file mode 100644 index 403b8ec71d8..00000000000 --- a/pkg/gen/primev2messages/service_request_document.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocument service request document -// -// swagger:model ServiceRequestDocument -type ServiceRequestDocument struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this service request document -func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service request document based on the context it is used -func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { - var res ServiceRequestDocument - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/service_request_documents.go b/pkg/gen/primev2messages/service_request_documents.go deleted file mode 100644 index 5f2981f337c..00000000000 --- a/pkg/gen/primev2messages/service_request_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocuments service request documents -// -// swagger:model ServiceRequestDocuments -type ServiceRequestDocuments []*ServiceRequestDocument - -// Validate validates this service request documents -func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service request documents based on the context it is used -func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/shipment_address_update.go b/pkg/gen/primev2messages/shipment_address_update.go deleted file mode 100644 index af7df83363b..00000000000 --- a/pkg/gen/primev2messages/shipment_address_update.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. -// -// swagger:model ShipmentAddressUpdate -type ShipmentAddressUpdate struct { - - // Contractor Remarks - // - // The reason there is an address change. - // Example: This is a contractor remark - // Required: true - // Read Only: true - ContractorRemarks string `json:"contractorRemarks"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` - - // The distance between the original SIT address and requested new delivery address of shipment - // Example: 88 - // Minimum: 0 - NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` - - // Office Remarks - // - // The TOO comment on approval or rejection. - // Example: This is an office remark - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // The distance between the original SIT address and the previous/old delivery address of shipment - // Example: 50 - // Minimum: 0 - OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` - - // original address - // Required: true - OriginalAddress *Address `json:"originalAddress"` - - // shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID"` - - // sit original address - SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` - - // status - // Required: true - Status ShipmentAddressUpdateStatus `json:"status"` -} - -// Validate validates this shipment address update -func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOldSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.NewSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.OldSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { - - if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { - return err - } - - if m.OriginalAddress != nil { - if err := m.OriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if m.SitOriginalAddress != nil { - if err := m.SitOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this shipment address update based on the context it is used -func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginalAddress != nil { - - if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginalAddress != nil { - - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { - var res ShipmentAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/shipment_address_update_status.go b/pkg/gen/primev2messages/shipment_address_update_status.go deleted file mode 100644 index fe9f0082eb6..00000000000 --- a/pkg/gen/primev2messages/shipment_address_update_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdateStatus Status -// -// swagger:model ShipmentAddressUpdateStatus -type ShipmentAddressUpdateStatus string - -func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. -func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { - return &m -} - -const ( - - // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" - ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" - - // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" - ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" - - // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" - ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" -) - -// for schema -var shipmentAddressUpdateStatusEnum []interface{} - -func init() { - var res []ShipmentAddressUpdateStatus - if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) - } -} - -func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { - if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this shipment address update status -func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipment address update status based on the context it is used -func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev2messages/storage_facility.go b/pkg/gen/primev2messages/storage_facility.go deleted file mode 100644 index 347c8629822..00000000000 --- a/pkg/gen/primev2messages/storage_facility.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageFacility The Storage Facility information for the shipment -// -// swagger:model StorageFacility -type StorageFacility struct { - - // address - Address *Address `json:"address,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // facility name - FacilityName string `json:"facilityName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lot number - LotNumber *string `json:"lotNumber,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` -} - -// Validate validates this storage facility -func (m *StorageFacility) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage facility based on the context it is used -func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageFacility) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageFacility) UnmarshalBinary(b []byte) error { - var res StorageFacility - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item.go b/pkg/gen/primev2messages/update_m_t_o_service_item.go deleted file mode 100644 index 659a4a1904a..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_service_item.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. -// -// swagger:discriminator UpdateMTOServiceItem modelType -type UpdateMTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // ID of the service item. Must match path. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // model type - // Required: true - ModelType() UpdateMTOServiceItemModelType - SetModelType(UpdateMTOServiceItemModelType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type updateMTOServiceItem struct { - idField strfmt.UUID - - modelTypeField UpdateMTOServiceItemModelType -} - -// ID gets the id of this polymorphic type -func (m *updateMTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []UpdateMTOServiceItem - for _, element := range elements { - obj, err := unmarshalUpdateMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalUpdateMTOServiceItem(data, consumer) -} - -func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "UpdateMTOServiceItem": - var result updateMTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemSIT": - var result UpdateMTOServiceItemSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemShuttle": - var result UpdateMTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this update m t o service item -func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) 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 -} - -// ContextValidate validate this update m t o service item based on the context it is used -func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go b/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go deleted file mode 100644 index 6d9ea3d53ee..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DDDSIT - UpdateMTOServiceItemSIT -// - DOPSIT - UpdateMTOServiceItemSIT -// - DOASIT - UpdateMTOServiceItemSIT -// - DOFSIT - UpdateMTOServiceItemSIT -// - DDSHUT - UpdateMTOServiceItemShuttle -// - DOSHUT - UpdateMTOServiceItemShuttle -// -// The documentation will then update with the supported fields. -// -// swagger:model UpdateMTOServiceItemModelType -type UpdateMTOServiceItemModelType string - -func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. -func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { - return &m -} - -const ( - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" -) - -// for schema -var updateMTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []UpdateMTOServiceItemModelType - if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) - } -} - -func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this update m t o service item model type -func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this update m t o service item model type based on context it is used -func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go deleted file mode 100644 index 558e84ba19c..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item. -// -// swagger:model UpdateMTOServiceItemSIT -type UpdateMTOServiceItemSIT struct { - idField strfmt.UUID - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemSIT" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemSIT - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - result.UpdateReason = data.UpdateReason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - - UpdateReason: m.UpdateReason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item s i t -func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDDSIT","DOPSIT","DOASIT","DOFSIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if swag.IsZero(m.SitPostalCode) { // not required - return nil - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item s i t based on the context it is used -func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go deleted file mode 100644 index cafb9b20492..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. -// -// swagger:model UpdateMTOServiceItemShuttle -type UpdateMTOServiceItemShuttle struct { - idField strfmt.UUID - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemShuttle - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item shuttle -func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) 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 -} - -var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item shuttle based on the context it is used -func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_shipment.go b/pkg/gen/primev2messages/update_m_t_o_shipment.go deleted file mode 100644 index 6ac1dc7ebd6..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_shipment.go +++ /dev/null @@ -1,534 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipment update m t o shipment -// -// swagger:model UpdateMTOShipment -type UpdateMTOShipment struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // actual pro gear weight - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // actual spouse pro gear weight - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // counselor remarks - // Example: counselor approved - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // ppm shipment - PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` -} - -// Validate validates this update m t o shipment -func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update m t o shipment based on the context it is used -func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_m_t_o_shipment_status.go b/pkg/gen/primev2messages/update_m_t_o_shipment_status.go deleted file mode 100644 index e5804c0173c..00000000000 --- a/pkg/gen/primev2messages/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. -// -// swagger:model UpdateMTOShipmentStatus -type UpdateMTOShipmentStatus struct { - - // status - // Enum: [CANCELED] - Status string `json:"status,omitempty"` -} - -// Validate validates this update m t o shipment status -func (m *UpdateMTOShipmentStatus) 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 -} - -var updateMTOShipmentStatusTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) - } -} - -const ( - - // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" - UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" -) - -// prop value enum -func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update m t o shipment status based on context it is used -func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipmentStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_p_p_m_shipment.go b/pkg/gen/primev2messages/update_p_p_m_shipment.go deleted file mode 100644 index b0310f92f8b..00000000000 --- a/pkg/gen/primev2messages/update_p_p_m_shipment.go +++ /dev/null @@ -1,199 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePPMShipment The PPM specific fields of the shipment with values being changed -// -// swagger:model UpdatePPMShipment -type UpdatePPMShipment struct { - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // Date the customer expects to begin moving from their origin. - // - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear,omitempty"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` - - // The estimated weight of the goods being put into storage. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - SitExpected *bool `json:"sitExpected,omitempty"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` -} - -// Validate validates this update p p m shipment -func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.ExpectedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update p p m shipment based on the context it is used -func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { - var res UpdatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_reweigh.go b/pkg/gen/primev2messages/update_reweigh.go deleted file mode 100644 index 3d2c861ac7c..00000000000 --- a/pkg/gen/primev2messages/update_reweigh.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. -// -// swagger:model UpdateReweigh -type UpdateReweigh struct { - - // In lieu of a document being uploaded indicating why a reweigh did not occur. - // Example: The reweigh was not performed because the shipment was already delivered - VerificationReason *string `json:"verificationReason"` - - // The total reweighed weight for the shipment in pounds. - // Example: 2000 - // Minimum: 1 - Weight *int64 `json:"weight"` -} - -// Validate validates this update reweigh -func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update reweigh based on context it is used -func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { - var res UpdateReweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/update_shipment_destination_address.go b/pkg/gen/primev2messages/update_shipment_destination_address.go deleted file mode 100644 index aa41a7747d8..00000000000 --- a/pkg/gen/primev2messages/update_shipment_destination_address.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. -// -// swagger:model UpdateShipmentDestinationAddress -type UpdateShipmentDestinationAddress struct { - - // This is the remark the Prime has entered, which would be the reason there is an address change. - // Example: Customer reached out to me this week and let me know they want to move somewhere else. - // Required: true - ContractorRemarks *string `json:"contractorRemarks"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` -} - -// Validate validates this update shipment destination address -func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update shipment destination address based on the context it is used -func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { - var res UpdateShipmentDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/upload_with_omissions.go b/pkg/gen/primev2messages/upload_with_omissions.go deleted file mode 100644 index b57f9bc715e..00000000000 --- a/pkg/gen/primev2messages/upload_with_omissions.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadWithOmissions An uploaded file. -// -// swagger:model UploadWithOmissions -type UploadWithOmissions struct { - - // bytes - // Required: true - Bytes *int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - ContentType *string `json:"contentType"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - Filename *string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // rotation - Rotation int64 `json:"rotation,omitempty"` - - // status - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uri - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this upload with omissions -func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", m.Bytes); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { - - if err := validate.Required("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) 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 -} - -var uploadWithOmissionsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) - } -} - -const ( - - // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" - UploadWithOmissionsStatusINFECTED string = "INFECTED" - - // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" - UploadWithOmissionsStatusCLEAN string = "CLEAN" - - // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" - UploadWithOmissionsStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { - if swag.IsZero(m.URL) { // not required - return nil - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload with omissions based on the context it is used -func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { - var res UploadWithOmissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev2messages/validation_error.go b/pkg/gen/primev2messages/validation_error.go deleted file mode 100644 index 78fe0f38f69..00000000000 --- a/pkg/gen/primev2messages/validation_error.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev2messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - // invalid fields - // Required: true - InvalidFields map[string][]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.InvalidFields = dataAO1.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - - dataAO1.InvalidFields = m.InvalidFields - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3api/configure_mymove.go b/pkg/gen/primev3api/configure_mymove.go deleted file mode 100644 index 9ed63a0cd02..00000000000 --- a/pkg/gen/primev3api/configure_mymove.go +++ /dev/null @@ -1,87 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package primev3api - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations" - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/mto_shipment" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime_v3.yaml --api-package primev3operations --model-package primev3messages --server-package primev3api --principal interface{} --exclude-main - -func configureFlags(api *primev3operations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *primev3operations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - - api.JSONProducer = runtime.JSONProducer() - - if api.MtoShipmentCreateMTOShipmentHandler == nil { - api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }) - } - if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { - api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentHandler == nil { - api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/primev3api/doc.go b/pkg/gen/primev3api/doc.go deleted file mode 100644 index f2f42eb107e..00000000000 --- a/pkg/gen/primev3api/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package primev3api MilMove Prime V3 API -// -// The Prime V3 API is a RESTful API that enables the Prime contractor to request -// information about upcoming moves, update the details and status of those moves, -// and make payment requests. It uses Mutual TLS for authentication procedures. -// -// All endpoints are located at `/prime/v3/`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /prime/v3 -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// -// Produces: -// - application/json -// -// swagger:meta -package primev3api diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go deleted file mode 100644 index df6a51d3016..00000000000 --- a/pkg/gen/primev3api/embedded_spec.go +++ /dev/null @@ -1,8587 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3api - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime V3 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v3/` + "`" + `.\n", - "title": "MilMove Prime V3 API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v3", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use........", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "x-examples": { - "application/json": { - "boat": { - "summary": "Boat Shipment", - "value": { - "boatShipment": { - "hasTrailer": true, - "heightFeet": 2, - "heightInches": 2, - "isRoadworthy": false, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "counselorRemarks": "test", - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "HAUL_AWAY" - } - }, - "hhg": { - "summary": "HHG", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG" - } - }, - "mobileHome": { - "summary": "Mobile Home Shipment", - "value": { - "counselorRemarks": "test", - "mobileHomeShipment": { - "heightFeet": 2, - "heightInches": 2, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "MOBILE_HOME" - } - }, - "nts": { - "summary": "NTS", - "value": { - "agents": [ - { - "agentType": "RELEASING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG_INTO_NTS" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "agents": [ - { - "agentType": "RECEIVING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "destinationAddress": { - "city": "NY", - "postalCode": "10001", - "state": "NY", - "streetAddress1": "123 Street" - }, - "estimatedWeight": 4999, - "expectedDepartureDate": "2022-10-01", - "hasProGear": false, - "pickupAddress": { - "city": "Beverly Hills", - "postalCode": "90210", - "state": "CA", - "streetAddress1": "204 South Prospect Lane" - }, - "sitExpected": false - }, - "shipmentType": "PPM" - } - } - } - }, - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "patch": { - "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "x-examples": { - "application/json": { - "hhg": { - "summary": "HHG", - "value": { - "actualPickupDate": "2022-12-29", - "destinationAddress": { - "city": "Great Bend", - "postalCode": "13643", - "state": "NY", - "streetAddress1": "6622 Airport Way S", - "streetAddress2": "#1430" - }, - "firstAvailableDeliveryDate": "2023-01-04", - "pointOfContact": "peyton.wing@example.com", - "primeActualWeight": 4500, - "primeEstimatedWeight": 4250, - "scheduledPickupDate": "2022-12-30" - } - }, - "nts": { - "summary": "NTS", - "value": { - "actualPickupDate": "2022-12-29", - "actualWeight": 4500, - "counselorRemarks": "Beware of dogs on property", - "estimatedWeight": 4250, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "scheduledPickupDate": "2022-12-30" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "destinationAddress": { - "city": "San Antonio", - "postalCode": "78245", - "state": "TX", - "streetAddress1": "812 S 129th Street" - }, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ntsRecordedWeight": 4500 - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "hasProGear": true, - "proGearWeight": 830, - "sitEstimatedDepartureDate": "2022-10-13", - "sitEstimatedEntryDate": "2022-10-06", - "sitEstimatedWeight": 1760, - "sitExpected": true, - "sitLocation": "DESTINATION", - "spouseProGearWeight": 366 - } - } - } - } - }, - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipment" - } - }, - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateBoatShipment": { - "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "primary location the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", - "type": "boolean" - }, - "divertedFromShipmentId": { - "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The primary address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "second location where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "The second address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "tertiaryDestinationAddress": { - "description": "third location where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "The third address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreateMobileHomeShipment": { - "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "An optional secondary address near the destination where goods will be dropped off.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "An optional secondary Pickup Address address near the origin where additional goods exist.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "description": "An optional tertiary address near the destination where goods will be dropped off.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "An optional tertiary Pickup Address address near the origin where additional goods exist.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationRateArea": { - "$ref": "#/definitions/RateArea" - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originRateArea": { - "$ref": "#/definitions/RateArea" - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "portOfDebarkation": { - "$ref": "#/definitions/Port" - }, - "portOfEmbarkation": { - "$ref": "#/definitions/Port" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "contractNumber": { - "type": "string", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "methodOfPayment": { - "type": "string", - "readOnly": true - }, - "naics": { - "type": "string", - "readOnly": true - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "packingAndShippingInstructions": { - "type": "string", - "readOnly": true - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - }, - "supplyAndServicesCostEstimate": { - "type": "string", - "readOnly": true - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "destinationRateArea": { - "$ref": "#/definitions/RateArea" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "originRateArea": { - "$ref": "#/definitions/RateArea" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "Port": { - "description": "A port that is used to move an international shipment.", - "type": "object", - "properties": { - "city": { - "type": "string", - "example": "PORTLAND" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "pattern": "^[A-Z]{2}$", - "example": "US" - }, - "county": { - "type": "string", - "example": "MULTNOMAH" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "portCode": { - "description": "3 or 4 digit port code", - "type": "string", - "example": "0431" - }, - "portName": { - "description": "Name of the port", - "type": "string", - "example": "PORTLAND INTL" - }, - "portType": { - "description": "Port type A (Air), B (Border Crossing), S (Sea)", - "type": "string", - "enum": [ - "A", - "B", - "S" - ] - }, - "state": { - "description": "US state", - "type": "string", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "example": "OR" - }, - "zip": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "99501" - } - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "RateArea": { - "description": "Rate area info for OCONUS postal code", - "type": "object", - "required": [ - "id", - "rateAreaId", - "rateAreaName" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "rateAreaId": { - "description": "Rate area code", - "type": "string", - "example": "US8101000" - }, - "rateAreaName": { - "description": "Rate area name", - "type": "string", - "example": "Alaska (Zone) I" - } - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DOPSIT", - "DOASIT", - "DOFSIT" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "x-nullable": true, - "example": 4500 - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "x-nullable": true, - "example": 4500 - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "portOfDebarkation": { - "$ref": "#/definitions/Port" - }, - "portOfEmbarkation": { - "$ref": "#/definitions/Port" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "tertiaryDeliveryAddress": { - "description": "A third delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "A third pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.\n", - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "An optional secondary address near the destination where goods will be dropped off.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "An optional secondary Pickup Address near the origin where additional goods exist.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "description": "An optional third address near the destination where goods will be dropped off.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "An optional third Pickup Address near the origin where additional goods exist.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment" - ] - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Prime V3 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v3/` + "`" + `.\n", - "title": "MilMove Prime V3 API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/prime/v3", - "paths": { - "/move-task-orders/{moveID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "parameters": [ - { - "type": "string", - "description": "UUID or MoveCode of move task order to use........", - "name": "moveID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments": { - "post": { - "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "createMTOShipment", - "operationId": "createMTOShipment", - "parameters": [ - { - "x-examples": { - "application/json": { - "boat": { - "summary": "Boat Shipment", - "value": { - "boatShipment": { - "hasTrailer": true, - "heightFeet": 2, - "heightInches": 2, - "isRoadworthy": false, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "counselorRemarks": "test", - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "HAUL_AWAY" - } - }, - "hhg": { - "summary": "HHG", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG" - } - }, - "mobileHome": { - "summary": "Mobile Home Shipment", - "value": { - "counselorRemarks": "test", - "mobileHomeShipment": { - "heightFeet": 2, - "heightInches": 2, - "lengthFeet": 2, - "lengthInches": 0, - "make": "make", - "model": "model", - "widthFeet": 2, - "widthInches": 2, - "year": 1999 - }, - "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", - "shipmentType": "MOBILE_HOME" - } - }, - "nts": { - "summary": "NTS", - "value": { - "agents": [ - { - "agentType": "RELEASING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "pickupAddress": { - "city": "Muldraugh", - "postalCode": "40155", - "state": "KY", - "streetAddress1": "204 South Prospect Lane" - }, - "requestedPickupDate": "2022-12-31", - "shipmentType": "HHG_INTO_NTS" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "agents": [ - { - "agentType": "RECEIVING_AGENT", - "email": "edgar.taylor@example.com", - "firstName": "Edgar", - "lastName": "Taylor", - "phone": "555-555-5555" - } - ], - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "destinationAddress": { - "city": "NY", - "postalCode": "10001", - "state": "NY", - "streetAddress1": "123 Street" - }, - "estimatedWeight": 4999, - "expectedDepartureDate": "2022-10-01", - "hasProGear": false, - "pickupAddress": { - "city": "Beverly Hills", - "postalCode": "90210", - "state": "CA", - "streetAddress1": "204 South Prospect Lane" - }, - "sitExpected": false - }, - "shipmentType": "PPM" - } - } - } - }, - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/CreateMTOShipment" - } - } - ], - "responses": { - "200": { - "description": "Successfully created a MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-shipments/{mtoShipmentID}": { - "patch": { - "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipment", - "operationId": "updateMTOShipment", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - }, - { - "x-examples": { - "application/json": { - "hhg": { - "summary": "HHG", - "value": { - "actualPickupDate": "2022-12-29", - "destinationAddress": { - "city": "Great Bend", - "postalCode": "13643", - "state": "NY", - "streetAddress1": "6622 Airport Way S", - "streetAddress2": "#1430" - }, - "firstAvailableDeliveryDate": "2023-01-04", - "pointOfContact": "peyton.wing@example.com", - "primeActualWeight": 4500, - "primeEstimatedWeight": 4250, - "scheduledPickupDate": "2022-12-30" - } - }, - "nts": { - "summary": "NTS", - "value": { - "actualPickupDate": "2022-12-29", - "actualWeight": 4500, - "counselorRemarks": "Beware of dogs on property", - "estimatedWeight": 4250, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "scheduledPickupDate": "2022-12-30" - } - }, - "nts-r": { - "summary": "NTS Release", - "value": { - "destinationAddress": { - "city": "San Antonio", - "postalCode": "78245", - "state": "TX", - "streetAddress1": "812 S 129th Street" - }, - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ntsRecordedWeight": 4500 - } - }, - "ppm": { - "summary": "PPM", - "value": { - "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", - "ppmShipment": { - "hasProGear": true, - "proGearWeight": 830, - "sitEstimatedDepartureDate": "2022-10-13", - "sitEstimatedEntryDate": "2022-10-06", - "sitEstimatedWeight": 1760, - "sitExpected": true, - "sitLocation": "DESTINATION", - "spouseProGearWeight": 366 - } - } - } - } - }, - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipment" - } - }, - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully updated the MTO shipment.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Address": { - "description": "A postal address", - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "destinationGbloc": { - "type": "string", - "pattern": "^[A-Z]{4}$", - "x-nullable": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "BoatShipment": { - "required": [ - "id", - "shipmentId", - "createdAt", - "type", - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer", - "eTag" - ], - "properties": { - "createdAt": { - "description": "Timestamp of when the Boat Shipment was initially created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Boat shipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "type": { - "type": "string", - "enum": [ - "HAUL_AWAY", - "TOW_AWAY" - ] - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - }, - "x-nullable": true - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "CreateBoatShipment": { - "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches", - "hasTrailer" - ], - "properties": { - "hasTrailer": { - "description": "Does the boat have a trailer", - "type": "boolean" - }, - "heightInInches": { - "description": "Height of the Boat in inches", - "type": "integer" - }, - "isRoadworthy": { - "description": "Is the trailer roadworthy", - "type": "boolean", - "x-nullable": true - }, - "lengthInInches": { - "description": "Length of the Boat in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Boat", - "type": "string" - }, - "model": { - "description": "Model of the Boat", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Boat in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Boat", - "type": "integer" - } - } - }, - "CreateMTOShipment": { - "type": "object", - "required": [ - "moveTaskOrderID", - "shipmentType" - ], - "properties": { - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "boatShipment": { - "$ref": "#/definitions/CreateBoatShipment" - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "example": "handle with care" - }, - "destinationAddress": { - "description": "primary location the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", - "type": "boolean" - }, - "divertedFromShipmentId": { - "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/CreateMobileHomeShipment" - }, - "moveTaskOrderID": { - "description": "The ID of the move this new shipment is for.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "description": "The primary address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "ppmShipment": { - "$ref": "#/definitions/CreatePPMShipment" - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "requestedPickupDate": { - "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "second location where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "The second address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "tertiaryDestinationAddress": { - "description": "third location where the movers should deliver this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "The third address where the movers should pick up this shipment.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreateMobileHomeShipment": { - "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "year", - "make", - "model", - "lengthInInches", - "widthInInches", - "heightInInches" - ], - "properties": { - "heightInInches": { - "description": "Height of the Mobile Home in inches", - "type": "integer" - }, - "lengthInInches": { - "description": "Length of the Mobile Home in inches", - "type": "integer" - }, - "make": { - "description": "Make of the Mobile Home", - "type": "string" - }, - "model": { - "description": "Model of the Mobile Home", - "type": "string" - }, - "widthInInches": { - "description": "Width of the Mobile Home in inches", - "type": "integer" - }, - "year": { - "description": "Year of the Mobile Home", - "type": "integer" - } - } - }, - "CreatePPMShipment": { - "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", - "type": "object", - "required": [ - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "estimatedWeight", - "hasProGear" - ], - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.", - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "An optional secondary address near the destination where goods will be dropped off.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "An optional secondary Pickup Address address near the origin where additional goods exist.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "description": "An optional tertiary address near the destination where goods will be dropped off.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "An optional tertiary Pickup Address address near the origin where additional goods exist.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "CreateSITExtension": { - "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", - "type": "object", - "required": [ - "requestReason", - "contractorRemarks", - "requestedDays" - ], - "properties": { - "contractorRemarks": { - "type": "string", - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "minimum": 1, - "example": 30 - } - } - }, - "Customer": { - "type": "object", - "properties": { - "branch": { - "type": "string", - "example": "COAST_GUARD" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "example": "fake@example.com" - }, - "emplid": { - "type": "string" - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DestinationType": { - "type": "string", - "title": "Destination Type", - "enum": [ - "HOME_OF_RECORD", - "HOME_OF_SELECTION", - "PLACE_ENTERED_ACTIVE_DUTY", - "OTHER_THAN_AUTHORIZED" - ], - "x-nullable": true, - "example": "OTHER_THAN_AUTHORIZED" - }, - "DutyLocation": { - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "addressID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlements": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "description": "The ID of the agent.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "description": "The ID of the shipment this agent is permitted to release/receive.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", - "type": "string", - "title": "Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "id": { - "description": "The ID of the service item.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lockedPriceCents": { - "type": "integer", - "format": "cents", - "x-nullable": true - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this service item.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "The ID of the shipment this service is for, if any. Optional.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "The full descriptive name of the service.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "The reason why this service item was rejected by the TOO.", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "item was too heavy" - }, - "serviceRequestDocuments": { - "$ref": "#/definitions/ServiceRequestDocuments" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "sitEntryDate", - "reason" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "reason": { - "description": "The reason item has been placed in SIT.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "The dimensions for either the item or the crate associated with a crating service item.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemInternationalCrating": { - "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "description": "The dimensions for the crate the item will be shipped in.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "description": { - "description": "A description of the item being crated.", - "type": "string", - "example": "Decorated horse head to be crated." - }, - "externalCrate": { - "type": "boolean", - "x-nullable": true - }, - "item": { - "description": "The dimensions of the item being crated.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItemDimension" - } - ] - }, - "market": { - "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", - "type": "string", - "enum": [ - "CONUS", - "OCONUS" - ], - "example": "CONUS" - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", - "type": "string", - "enum": [ - "ICRT", - "IUCRT" - ] - }, - "reason": { - "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "Storage items need to be picked up" - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating", - "MTOSerivceItemInternationalFuelSurcharge" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "requestApprovalsRequestedStatus": { - "type": "boolean" - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitHHGActualOrigin": { - "$ref": "#/definitions/Address" - }, - "sitHHGOriginalOrigin": { - "$ref": "#/definitions/Address" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode" - ], - "properties": { - "actualWeight": { - "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "The status of a service item, indicating where it is in the TOO's approval process.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ], - "readOnly": true - }, - "MTOShipment": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - ], - "properties": { - "mtoServiceItems": { - "description": "A list of service items connected to this shipment.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - }, - "readOnly": true - } - } - }, - "MTOShipmentType": { - "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", - "type": "string", - "title": "Shipment Type", - "enum": [ - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "MOBILE_HOME", - "PPM", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", - "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", - "HHG": "Household goods move (HHG)", - "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", - "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", - "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipmentWithoutServiceItems": { - "type": "object", - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any spouse pro gear being shipped.\n", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "The date when the Task Ordering Officer first approved this shipment for the move.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "boatShipment": { - "$ref": "#/definitions/BoatShipment" - }, - "counselorRemarks": { - "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "deliveryAddressUpdate": { - "$ref": "#/definitions/ShipmentAddressUpdate" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationRateArea": { - "$ref": "#/definitions/RateArea" - }, - "destinationSitAuthEndDate": { - "description": "The SIT authorized end date for destination SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "diversionReason": { - "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", - "type": "string", - "x-nullable": true, - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The ID of the shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "mobileHomeShipment": { - "$ref": "#/definitions/MobileHome" - }, - "moveTaskOrderID": { - "description": "The ID of the move for this shipment.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "originRateArea": { - "$ref": "#/definitions/RateArea" - }, - "originSitAuthEndDate": { - "description": "The SIT authorized end date for origin SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "portOfDebarkation": { - "$ref": "#/definitions/Port" - }, - "portOfEmbarkation": { - "$ref": "#/definitions/Port" - }, - "ppmShipment": { - "$ref": "#/definitions/PPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "description": "The date when the Prime contractor recorded the shipment's estimated weight.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedDeliveryDate": { - "description": "The customer's preferred delivery date.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requestedPickupDate": { - "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "requiredDeliveryDate": { - "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "reweigh": { - "$ref": "#/definitions/Reweigh" - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "sitExtensions": { - "$ref": "#/definitions/SITExtensions" - }, - "status": { - "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentsWithoutServiceObjects": { - "description": "A list of shipments without their associated service items.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipmentWithoutServiceItems" - } - }, - "MobileHome": { - "description": "A mobile home is a type of shipment that a service member moves a mobile home.", - "properties": { - "createdAt": { - "description": "Timestamp of when a property of this object was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "heightInInches": { - "type": "integer" - }, - "id": { - "description": "Primary auto-generated unique identifier of the Mobile Home object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lengthInInches": { - "type": "integer" - }, - "make": { - "description": "The make of the mobile home", - "type": "string" - }, - "model": { - "description": "The model of the mobile home.", - "type": "string" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment object", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "description": "Timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "widthInInches": { - "type": "integer" - }, - "year": { - "description": "The year the mobile home was made.", - "type": "integer" - } - }, - "x-nullable": true - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "mtoShipments", - "mtoServiceItems", - "paymentRequests" - ], - "properties": { - "approvedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "availableToPrimeAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "contractNumber": { - "type": "string", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationGBLOC": { - "type": "string", - "readOnly": true, - "example": "KKFA" - }, - "destinationPostalCode": { - "type": "string", - "readOnly": true, - "example": "90210" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "excessWeightAcknowledgedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightQualifiedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "excessWeightUploadId": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "x-omitempty": false, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" - }, - "moveCode": { - "type": "string", - "readOnly": true, - "example": "HYXFJF" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "type": "integer" - }, - "ppmType": { - "type": "string", - "enum": [ - "PARTIAL", - "FULL" - ] - }, - "primeCounselingCompletedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "referenceId": { - "type": "string", - "example": "1001-3456" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "rank", - "linesOfAccounting" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlements" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "linesOfAccounting": { - "type": "string" - }, - "methodOfPayment": { - "type": "string", - "readOnly": true - }, - "naics": { - "type": "string", - "readOnly": true - }, - "orderNumber": { - "type": "string" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationGBLOC": { - "type": "string", - "example": "KKFA" - }, - "packingAndShippingInstructions": { - "type": "string", - "readOnly": true - }, - "rank": { - "type": "string", - "example": "E_5" - }, - "reportByDate": { - "type": "string", - "format": "date" - }, - "supplyAndServicesCostEstimate": { - "type": "string", - "readOnly": true - } - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "WOUNDED_WARRIOR", - "BLUEBARK", - "SAFETY", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "LOCAL_MOVE": "Local Move", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", - "RETIREMENT": "Retirement", - "SAFETY": "Safety", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "PPMDestinationAddress": { - "description": "A postal address", - "type": "object", - "required": [ - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "type": "string", - "title": "Country", - "default": "USA", - "x-nullable": true, - "example": "USA" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "x-nullable": true, - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - }, - "usPostRegionCitiesID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PPMShipment": { - "description": "A personally procured move is a type of shipment that a service member moves themselves.", - "required": [ - "id", - "shipmentId", - "createdAt", - "status", - "expectedDepartureDate", - "pickupAddress", - "destinationAddress", - "sitExpected", - "eTag" - ], - "properties": { - "actualDestinationPostalCode": { - "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "actualMoveDate": { - "description": "The actual start date of when the PPM shipment left the origin.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupPostalCode": { - "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5})$", - "x-nullable": true, - "x-omitempty": false, - "example": "90210" - }, - "advanceAmountReceived": { - "description": "The amount received for an advance, or null if no advance is received.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "advanceAmountRequested": { - "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "approvedAt": { - "description": "The timestamp of when the shipment was approved and the service member can begin their move.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "createdAt": { - "description": "The timestamp of when the PPM shipment was created (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "destinationAddress": { - "$ref": "#/definitions/PPMDestinationAddress" - }, - "destinationRateArea": { - "$ref": "#/definitions/RateArea" - }, - "eTag": { - "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", - "type": "string", - "readOnly": true - }, - "estimatedIncentive": { - "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date" - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasReceivedAdvance": { - "description": "Indicates whether an advance was received for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasRequestedAdvance": { - "description": "Indicates whether an advance has been requested for the PPM shipment.\n", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "id": { - "description": "The primary unique identifier of this PPM shipment", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "maxIncentive": { - "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "originRateArea": { - "$ref": "#/definitions/RateArea" - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "reviewedAt": { - "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentId": { - "description": "The id of the parent MTOShipment record", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "sitEstimatedCost": { - "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", - "type": "integer", - "format": "cents", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean" - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - }, - { - "x-omitempty": false - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false - }, - "status": { - "$ref": "#/definitions/PPMShipmentStatus" - }, - "submittedAt": { - "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "tertiaryDestinationAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "description": "The timestamp of when a property of this object was last updated (UTC)", - "type": "string", - "format": "date-time", - "readOnly": true - } - }, - "x-nullable": true - }, - "PPMShipmentStatus": { - "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "WAITING_ON_CUSTOMER", - "NEEDS_ADVANCE_APPROVAL", - "NEEDS_CLOSEOUT", - "CLOSEOUT_COMPLETE", - "CANCELED" - ], - "readOnly": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "paymentServiceItems": { - "$ref": "#/definitions/PaymentServiceItems" - }, - "proofOfServiceDocs": { - "$ref": "#/definitions/ProofOfServiceDocs" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "PaymentServiceItem": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "mtoServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentServiceItemParams": { - "$ref": "#/definitions/PaymentServiceItemParams" - }, - "priceCents": { - "type": "integer", - "format": "cents", - "title": "Price of the service item in cents", - "x-nullable": true - }, - "referenceID": { - "format": "string", - "readOnly": true, - "example": "1234-5678-c56a4180" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentServiceItemStatus" - } - } - }, - "PaymentServiceItemParam": { - "type": "object", - "properties": { - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "key": { - "$ref": "#/definitions/ServiceItemParamName" - }, - "origin": { - "$ref": "#/definitions/ServiceItemParamOrigin" - }, - "paymentServiceItemID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "type": { - "$ref": "#/definitions/ServiceItemParamType" - }, - "value": { - "type": "string", - "example": "3025" - } - } - }, - "PaymentServiceItemParams": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItemParam" - } - }, - "PaymentServiceItemStatus": { - "type": "string", - "title": "Payment Service Item Status", - "enum": [ - "REQUESTED", - "APPROVED", - "DENIED", - "SENT_TO_GEX", - "PAID", - "EDI_ERROR" - ] - }, - "PaymentServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentServiceItem" - } - }, - "Port": { - "description": "A port that is used to move an international shipment.", - "type": "object", - "properties": { - "city": { - "type": "string", - "example": "PORTLAND" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "pattern": "^[A-Z]{2}$", - "example": "US" - }, - "county": { - "type": "string", - "example": "MULTNOMAH" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "portCode": { - "description": "3 or 4 digit port code", - "type": "string", - "example": "0431" - }, - "portName": { - "description": "Name of the port", - "type": "string", - "example": "PORTLAND INTL" - }, - "portType": { - "description": "Port type A (Air), B (Border Crossing), S (Sea)", - "type": "string", - "enum": [ - "A", - "B", - "S" - ] - }, - "state": { - "description": "US state", - "type": "string", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "example": "OR" - }, - "zip": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "99501" - } - } - }, - "ProofOfServiceDoc": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ProofOfServiceDocs": { - "type": "array", - "items": { - "$ref": "#/definitions/ProofOfServiceDoc" - } - }, - "RateArea": { - "description": "Rate area info for OCONUS postal code", - "type": "object", - "required": [ - "id", - "rateAreaId", - "rateAreaName" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "rateAreaId": { - "description": "Rate area code", - "type": "string", - "example": "US8101000" - }, - "rateAreaName": { - "description": "Rate area name", - "type": "string", - "example": "Alaska (Zone) I" - } - } - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "Reweigh": { - "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", - "properties": { - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "requestedAt": { - "type": "string", - "format": "date-time" - }, - "requestedBy": { - "$ref": "#/definitions/ReweighRequester" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "verificationProvidedAt": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "verificationReason": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed due to some justification provided by the Prime" - }, - "weight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "ReweighRequester": { - "type": "string", - "enum": [ - "CUSTOMER", - "PRIME", - "SYSTEM", - "TOO" - ] - }, - "SITExtension": { - "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", - "type": "object", - "properties": { - "approvedDays": { - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 30 - }, - "contractorRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "We need SIT additional days. The customer has not found a house yet." - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "decisionDate": { - "type": "string", - "format": "date-time", - "x-nullable": true, - "x-omitempty": false - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "officeRemarks": { - "type": "string", - "x-nullable": true, - "x-omitempty": false - }, - "requestReason": { - "type": "string", - "enum": [ - "SERIOUS_ILLNESS_MEMBER", - "SERIOUS_ILLNESS_DEPENDENT", - "IMPENDING_ASSIGNEMENT", - "DIRECTED_TEMPORARY_DUTY", - "NONAVAILABILITY_OF_CIVILIAN_HOUSING", - "AWAITING_COMPLETION_OF_RESIDENCE", - "OTHER" - ] - }, - "requestedDays": { - "type": "integer", - "example": 30 - }, - "status": { - "enum": [ - "PENDING", - "APPROVED", - "DENIED" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "SITExtensions": { - "type": "array", - "items": { - "$ref": "#/definitions/SITExtension" - } - }, - "SITLocationType": { - "description": "The list of SIT location types.", - "type": "string", - "enum": [ - "ORIGIN", - "DESTINATION" - ] - }, - "ServiceItemParamName": { - "type": "string", - "enum": [ - "ActualPickupDate", - "ContractCode", - "ContractYearName", - "CubicFeetBilled", - "CubicFeetCrating", - "DimensionHeight", - "DimensionLength", - "DimensionWidth", - "DistanceZip", - "DistanceZipSITDest", - "DistanceZipSITOrigin", - "EIAFuelPrice", - "EscalationCompounded", - "FSCMultiplier", - "FSCPriceDifferenceInCents", - "FSCWeightBasedDistanceMultiplier", - "IsPeak", - "MarketDest", - "MarketOrigin", - "MTOAvailableToPrimeAt", - "NTSPackingFactor", - "NumberDaysSIT", - "PriceAreaDest", - "PriceAreaIntlDest", - "PriceAreaIntlOrigin", - "PriceAreaOrigin", - "PriceRateOrFactor", - "PSI_LinehaulDom", - "PSI_LinehaulDomPrice", - "PSI_LinehaulShort", - "PSI_LinehaulShortPrice", - "PSI_PriceDomDest", - "PSI_PriceDomDestPrice", - "PSI_PriceDomOrigin", - "PSI_PriceDomOriginPrice", - "PSI_ShippingLinehaulIntlCO", - "PSI_ShippingLinehaulIntlCOPrice", - "PSI_ShippingLinehaulIntlOC", - "PSI_ShippingLinehaulIntlOCPrice", - "PSI_ShippingLinehaulIntlOO", - "PSI_ShippingLinehaulIntlOOPrice", - "RateAreaNonStdDest", - "RateAreaNonStdOrigin", - "ReferenceDate", - "RequestedPickupDate", - "ServiceAreaDest", - "ServiceAreaOrigin", - "ServicesScheduleDest", - "ServicesScheduleOrigin", - "SITPaymentRequestEnd", - "SITPaymentRequestStart", - "SITScheduleDest", - "SITScheduleOrigin", - "SITServiceAreaDest", - "SITServiceAreaOrigin", - "WeightAdjusted", - "WeightBilled", - "WeightEstimated", - "WeightOriginal", - "WeightReweigh", - "ZipDestAddress", - "ZipPickupAddress", - "ZipSITDestHHGFinalAddress", - "ZipSITDestHHGOriginalAddress", - "ZipSITOriginHHGActualAddress", - "ZipSITOriginHHGOriginalAddress", - "StandaloneCrate", - "StandaloneCrateCap", - "UncappedRequestTotal", - "LockedPriceCents" - ] - }, - "ServiceItemParamOrigin": { - "type": "string", - "enum": [ - "PRIME", - "SYSTEM", - "PRICER", - "PAYMENT_REQUEST" - ] - }, - "ServiceItemParamType": { - "type": "string", - "enum": [ - "STRING", - "DATE", - "INTEGER", - "DECIMAL", - "TIMESTAMP", - "PaymentServiceItemUUID", - "BOOLEAN" - ] - }, - "ServiceRequestDocument": { - "type": "object", - "properties": { - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "ServiceRequestDocuments": { - "type": "array", - "items": { - "$ref": "#/definitions/ServiceRequestDocument" - } - }, - "ShipmentAddressUpdate": { - "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", - "type": "object", - "required": [ - "id", - "status", - "shipmentID", - "originalAddress", - "newAddress", - "contractorRemarks" - ], - "properties": { - "contractorRemarks": { - "description": "The reason there is an address change.", - "type": "string", - "title": "Contractor Remarks", - "readOnly": true, - "example": "This is a contractor remark" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "newAddress": { - "$ref": "#/definitions/Address" - }, - "newSitDistanceBetween": { - "description": "The distance between the original SIT address and requested new delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 88 - }, - "officeRemarks": { - "description": "The TOO comment on approval or rejection.", - "type": "string", - "title": "Office Remarks", - "x-nullable": true, - "example": "This is an office remark" - }, - "oldSitDistanceBetween": { - "description": "The distance between the original SIT address and the previous/old delivery address of shipment", - "type": "integer", - "minimum": 0, - "example": 50 - }, - "originalAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "sitOriginalAddress": { - "$ref": "#/definitions/Address" - }, - "status": { - "$ref": "#/definitions/ShipmentAddressUpdateStatus" - } - } - }, - "ShipmentAddressUpdateStatus": { - "type": "string", - "title": "Status", - "enum": [ - "REQUESTED", - "REJECTED", - "APPROVED" - ], - "x-display-value": { - "APPROVED": "APPROVED", - "REJECTED": "REJECTED", - "REQUESTED": "REQUESTED" - }, - "readOnly": true - }, - "StorageFacility": { - "description": "The Storage Facility information for the shipment", - "type": "object", - "properties": { - "address": { - "$ref": "#/definitions/Address" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "facilityName": { - "type": "string" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lotNumber": { - "type": "string", - "x-nullable": true - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - } - } - }, - "UpdateMTOServiceItem": { - "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType" - ], - "properties": { - "id": { - "description": "ID of the service item. Must match path.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/UpdateMTOServiceItemModelType" - } - }, - "discriminator": "modelType" - }, - "UpdateMTOServiceItemModelType": { - "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "UpdateMTOServiceItemSIT", - "UpdateMTOServiceItemShuttle" - ] - }, - "UpdateMTOServiceItemSIT": { - "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDDSIT", - "DOPSIT", - "DOASIT", - "DOFSIT" - ] - }, - "requestApprovalsRequestedStatus": { - "description": "Indicates if \"Approvals Requested\" status is being requested.", - "type": "boolean", - "x-nullable": true - }, - "sitCustomerContacted": { - "description": "Date when the customer contacted the prime for a delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", - "type": "string", - "format": "date" - }, - "sitDestinationFinalAddress": { - "$ref": "#/definitions/Address" - }, - "sitEntryDate": { - "description": "Entry date for the SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "x-nullable": true, - "example": "90210" - }, - "sitRequestedDelivery": { - "description": "Date when the customer has requested delivery out of SIT.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "timeMilitary1": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "x-nullable": true, - "example": "1400Z" - }, - "updateReason": { - "description": "Reason for updating service item.", - "type": "string", - "x-nullable": true - } - } - } - ] - }, - "UpdateMTOServiceItemShuttle": { - "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", - "allOf": [ - { - "$ref": "#/definitions/UpdateMTOServiceItem" - }, - { - "type": "object", - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDSHUT", - "DOSHUT" - ] - } - } - } - ] - }, - "UpdateMTOShipment": { - "properties": { - "actualDeliveryDate": { - "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualPickupDate": { - "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "actualProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "x-nullable": true, - "example": 4500 - }, - "actualSpouseProGearWeight": { - "description": "The actual weight of any pro gear shipped during a move.", - "type": "integer", - "x-nullable": true, - "example": 4500 - }, - "counselorRemarks": { - "type": "string", - "x-nullable": true, - "example": "counselor approved" - }, - "destinationAddress": { - "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "destinationType": { - "$ref": "#/definitions/DestinationType" - }, - "diversion": { - "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", - "type": "boolean" - }, - "firstAvailableDeliveryDate": { - "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "ntsRecordedWeight": { - "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 4500 - }, - "pickupAddress": { - "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "pointOfContact": { - "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", - "type": "string" - }, - "portOfDebarkation": { - "$ref": "#/definitions/Port" - }, - "portOfEmbarkation": { - "$ref": "#/definitions/Port" - }, - "ppmShipment": { - "$ref": "#/definitions/UpdatePPMShipment" - }, - "primeActualWeight": { - "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "primeEstimatedWeight": { - "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", - "type": "integer", - "minimum": 1, - "x-nullable": true, - "example": 4500 - }, - "scheduledDeliveryDate": { - "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "scheduledPickupDate": { - "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", - "type": "string", - "format": "date", - "x-nullable": true, - "x-omitempty": false - }, - "secondaryDeliveryAddress": { - "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "storageFacility": { - "allOf": [ - { - "x-nullable": true - }, - { - "$ref": "#/definitions/StorageFacility" - } - ] - }, - "tertiaryDeliveryAddress": { - "description": "A third delivery address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "A third pickup address for this shipment, if the customer entered one. An optional field.", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "UpdateMTOShipmentStatus": { - "description": "Contains the statuses available to the Prime when updating the state of a shipment.", - "type": "object", - "properties": { - "status": { - "type": "string", - "enum": [ - "CANCELED" - ] - } - } - }, - "UpdatePPMShipment": { - "description": "The PPM specific fields of the shipment with values being changed", - "type": "object", - "properties": { - "destinationAddress": { - "description": "The address of the destination location where goods are being delivered to.\n", - "allOf": [ - { - "$ref": "#/definitions/PPMDestinationAddress" - } - ] - }, - "estimatedWeight": { - "description": "The estimated weight of the PPM shipment goods being moved.", - "type": "integer", - "x-nullable": true, - "example": 4200 - }, - "expectedDepartureDate": { - "description": "Date the customer expects to begin moving from their origin.\n", - "type": "string", - "format": "date", - "x-nullable": true - }, - "hasProGear": { - "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", - "type": "boolean", - "x-nullable": true - }, - "hasSecondaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasSecondaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryDestinationAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "hasTertiaryPickupAddress": { - "type": "boolean", - "x-nullable": true, - "x-omitempty": false - }, - "isActualExpenseReimbursement": { - "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", - "type": "boolean", - "x-nullable": true, - "x-omitempty": false, - "example": false - }, - "pickupAddress": { - "description": "The address of the origin location where goods are being moved from.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "proGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to the service member.", - "type": "integer", - "x-nullable": true - }, - "secondaryDestinationAddress": { - "description": "An optional secondary address near the destination where goods will be dropped off.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "secondaryPickupAddress": { - "description": "An optional secondary Pickup Address near the origin where additional goods exist.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "sitEstimatedDepartureDate": { - "description": "The date that goods will exit the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedEntryDate": { - "description": "The date that goods will first enter the storage location.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEstimatedWeight": { - "description": "The estimated weight of the goods being put into storage.", - "type": "integer", - "x-nullable": true, - "example": 2000 - }, - "sitExpected": { - "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", - "type": "boolean", - "x-nullable": true - }, - "sitLocation": { - "allOf": [ - { - "$ref": "#/definitions/SITLocationType" - }, - { - "x-nullable": true - } - ] - }, - "spouseProGearWeight": { - "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", - "type": "integer", - "x-nullable": true - }, - "tertiaryDestinationAddress": { - "description": "An optional third address near the destination where goods will be dropped off.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - }, - "tertiaryPickupAddress": { - "description": "An optional third Pickup Address near the origin where additional goods exist.\n", - "allOf": [ - { - "$ref": "#/definitions/Address" - } - ] - } - } - }, - "UpdateReweigh": { - "description": "Contains the fields available to the Prime when updating a reweigh record.", - "type": "object", - "properties": { - "verificationReason": { - "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", - "type": "string", - "x-nullable": true, - "x-omitempty": false, - "example": "The reweigh was not performed because the shipment was already delivered" - }, - "weight": { - "description": "The total reweighed weight for the shipment in pounds.", - "type": "integer", - "minimum": 1, - "x-formatting": "weight", - "x-nullable": true, - "x-omitempty": false, - "example": 2000 - } - } - }, - "UpdateShipmentDestinationAddress": { - "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", - "type": "object", - "required": [ - "contractorRemarks", - "newAddress" - ], - "properties": { - "contractorRemarks": { - "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", - "type": "string", - "example": "Customer reached out to me this week and let me know they want to move somewhere else." - }, - "newAddress": { - "$ref": "#/definitions/Address" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The request was unprocessable, likely due to bad input from the requester.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", - "name": "mtoShipment" - } - ], - "x-tagGroups": [ - { - "name": "Endpoints", - "tags": [ - "moveTaskOrder", - "mtoShipment" - ] - } - ] -}`)) -} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go deleted file mode 100644 index d02fb4d0c9d..00000000000 --- a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler -type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// GetMoveTaskOrderHandler interface for that can handle valid get move task order params -type GetMoveTaskOrderHandler interface { - Handle(GetMoveTaskOrderParams) middleware.Responder -} - -// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation -func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { - return &GetMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder - -getMoveTaskOrder - -### Functionality -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -type GetMoveTaskOrder struct { - Context *middleware.Context - Handler GetMoveTaskOrderHandler -} - -func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index a7c4913dc67..00000000000 --- a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { - - return GetMoveTaskOrderParams{} -} - -// GetMoveTaskOrderParams contains all the bound params for the get move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveTaskOrder -type GetMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID or MoveCode of move task order to use........ - Required: true - In: path - */ - MoveID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. -func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") - if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveID binds and validates parameter MoveID from path. -func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveID = raw - - return nil -} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 9ec16dc1e22..00000000000 --- a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK -const GetMoveTaskOrderOKCode int = 200 - -/* -GetMoveTaskOrderOK Successfully retrieve an individual move task order. - -swagger:response getMoveTaskOrderOK -*/ -type GetMoveTaskOrderOK struct { - - /* - In: Body - */ - Payload *primev3messages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - - return &GetMoveTaskOrderOK{} -} - -// WithPayload adds the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) WithPayload(payload *primev3messages.MoveTaskOrder) *GetMoveTaskOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) SetPayload(payload *primev3messages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized -const GetMoveTaskOrderUnauthorizedCode int = 401 - -/* -GetMoveTaskOrderUnauthorized The request was denied. - -swagger:response getMoveTaskOrderUnauthorized -*/ -type GetMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - - return &GetMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden -const GetMoveTaskOrderForbiddenCode int = 403 - -/* -GetMoveTaskOrderForbidden The request was denied. - -swagger:response getMoveTaskOrderForbidden -*/ -type GetMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - - return &GetMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound -const GetMoveTaskOrderNotFoundCode int = 404 - -/* -GetMoveTaskOrderNotFound The requested resource wasn't found. - -swagger:response getMoveTaskOrderNotFound -*/ -type GetMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - - return &GetMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError -const GetMoveTaskOrderInternalServerErrorCode int = 500 - -/* -GetMoveTaskOrderInternalServerError A server error occurred. - -swagger:response getMoveTaskOrderInternalServerError -*/ -type GetMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *primev3messages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - - return &GetMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primev3messages.Error) *GetMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primev3messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go deleted file mode 100644 index 45f557a2dd7..00000000000 --- a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveTaskOrderURL generates an URL for the get move task order operation -type GetMoveTaskOrderURL struct { - MoveID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveID}" - - moveID := o.MoveID - if moveID != "" { - _path = strings.Replace(_path, "{moveID}", moveID, -1) - } else { - return nil, errors.New("moveId is required on GetMoveTaskOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v3" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go deleted file mode 100644 index 54ce5c4cc60..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go +++ /dev/null @@ -1,69 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler -type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params -type CreateMTOShipmentHandler interface { - Handle(CreateMTOShipmentParams) middleware.Responder -} - -// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation -func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { - return &CreateMTOShipment{Context: ctx, Handler: handler} -} - -/* - CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment - -createMTOShipment - -Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a -need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must -approve it before the contractor can proceed with billing. - -**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. -If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically -inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize -the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. - -**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to -one of their moves. Otherwise, the Prime can fetch the related move using the -[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. -*/ -type CreateMTOShipment struct { - Context *middleware.Context - Handler CreateMTOShipmentHandler -} - -func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 010bf69a479..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewCreateMTOShipmentParams() CreateMTOShipmentParams { - - return CreateMTOShipmentParams{} -} - -// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMTOShipment -type CreateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - In: body - */ - Body *primev3messages.CreateMTOShipment -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. -func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primev3messages.CreateMTOShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index 89ae328d45d..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK -const CreateMTOShipmentOKCode int = 200 - -/* -CreateMTOShipmentOK Successfully created a MTO shipment. - -swagger:response createMTOShipmentOK -*/ -type CreateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *primev3messages.MTOShipment `json:"body,omitempty"` -} - -// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - - return &CreateMTOShipmentOK{} -} - -// WithPayload adds the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) WithPayload(payload *primev3messages.MTOShipment) *CreateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment o k response -func (o *CreateMTOShipmentOK) SetPayload(payload *primev3messages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest -const CreateMTOShipmentBadRequestCode int = 400 - -/* -CreateMTOShipmentBadRequest The request payload is invalid. - -swagger:response createMTOShipmentBadRequest -*/ -type CreateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - - return &CreateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) WithPayload(payload *primev3messages.ClientError) *CreateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound -const CreateMTOShipmentNotFoundCode int = 404 - -/* -CreateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response createMTOShipmentNotFound -*/ -type CreateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - - return &CreateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) WithPayload(payload *primev3messages.ClientError) *CreateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity -const CreateMTOShipmentUnprocessableEntityCode int = 422 - -/* -CreateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response createMTOShipmentUnprocessableEntity -*/ -type CreateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primev3messages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - - return &CreateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *primev3messages.ValidationError) *CreateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *primev3messages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError -const CreateMTOShipmentInternalServerErrorCode int = 500 - -/* -CreateMTOShipmentInternalServerError A server error occurred. - -swagger:response createMTOShipmentInternalServerError -*/ -type CreateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *primev3messages.Error `json:"body,omitempty"` -} - -// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - - return &CreateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *primev3messages.Error) *CreateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *primev3messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index 08004139c96..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMTOShipmentURL generates an URL for the create m t o shipment operation -type CreateMTOShipmentURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v3" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go deleted file mode 100644 index f1effe18a55..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go +++ /dev/null @@ -1,68 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler -type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params -type UpdateMTOShipmentHandler interface { - Handle(UpdateMTOShipmentParams) middleware.Responder -} - -// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation -func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { - return &UpdateMTOShipment{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment - -updateMTOShipment - -Updates an existing shipment for a move. - -Note that there are some restrictions on nested objects: - -* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. -* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. -* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. - -These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. - -Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. -*/ -type UpdateMTOShipment struct { - Context *middleware.Context - Handler UpdateMTOShipmentHandler -} - -func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index ac437fff00f..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { - - return UpdateMTOShipmentParams{} -} - -// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipment -type UpdateMTOShipmentParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *primev3messages.UpdateMTOShipment - /*UUID of the shipment being updated. - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. -func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body primev3messages.UpdateMTOShipment - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index 9f2a9bd8fe7..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK -const UpdateMTOShipmentOKCode int = 200 - -/* -UpdateMTOShipmentOK Successfully updated the MTO shipment. - -swagger:response updateMTOShipmentOK -*/ -type UpdateMTOShipmentOK struct { - - /* - In: Body - */ - Payload *primev3messages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - - return &UpdateMTOShipmentOK{} -} - -// WithPayload adds the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) WithPayload(payload *primev3messages.MTOShipment) *UpdateMTOShipmentOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) SetPayload(payload *primev3messages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest -const UpdateMTOShipmentBadRequestCode int = 400 - -/* -UpdateMTOShipmentBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentBadRequest -*/ -type UpdateMTOShipmentBadRequest struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - - return &UpdateMTOShipmentBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized -const UpdateMTOShipmentUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentUnauthorized The request was denied. - -swagger:response updateMTOShipmentUnauthorized -*/ -type UpdateMTOShipmentUnauthorized struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - - return &UpdateMTOShipmentUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden -const UpdateMTOShipmentForbiddenCode int = 403 - -/* -UpdateMTOShipmentForbidden The request was denied. - -swagger:response updateMTOShipmentForbidden -*/ -type UpdateMTOShipmentForbidden struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - - return &UpdateMTOShipmentForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound -const UpdateMTOShipmentNotFoundCode int = 404 - -/* -UpdateMTOShipmentNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentNotFound -*/ -type UpdateMTOShipmentNotFound struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - - return &UpdateMTOShipmentNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed -const UpdateMTOShipmentPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentPreconditionFailed -*/ -type UpdateMTOShipmentPreconditionFailed struct { - - /* - In: Body - */ - Payload *primev3messages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - - return &UpdateMTOShipmentPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *primev3messages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity -const UpdateMTOShipmentUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. - -swagger:response updateMTOShipmentUnprocessableEntity -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - - /* - In: Body - */ - Payload *primev3messages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - - return &UpdateMTOShipmentUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *primev3messages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *primev3messages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError -const UpdateMTOShipmentInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentInternalServerError A server error occurred. - -swagger:response updateMTOShipmentInternalServerError -*/ -type UpdateMTOShipmentInternalServerError struct { - - /* - In: Body - */ - Payload *primev3messages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - - return &UpdateMTOShipmentInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *primev3messages.Error) *UpdateMTOShipmentInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *primev3messages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go deleted file mode 100644 index de594468f26..00000000000 --- a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation -type UpdateMTOShipmentURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/prime/v3" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/primev3api/primev3operations/mymove_api.go b/pkg/gen/primev3api/primev3operations/mymove_api.go deleted file mode 100644 index 260daf28f29..00000000000 --- a/pkg/gen/primev3api/primev3operations/mymove_api.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3operations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/mto_shipment" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - - JSONProducer: runtime.JSONProducer(), - - MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") - }), - MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Prime V3 API is a RESTful API that enables the Prime contractor to request -information about upcoming moves, update the details and status of those moves, -and make payment requests. It uses Mutual TLS for authentication procedures. - -All endpoints are located at `/prime/v3/`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation - MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler - // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation - MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler - // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation - MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.MtoShipmentCreateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") - } - if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") - } - if o.MtoShipmentUpdateMTOShipmentHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/primev3api/server.go b/pkg/gen/primev3api/server.go deleted file mode 100644 index 50e357fff55..00000000000 --- a/pkg/gen/primev3api/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3api - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *primev3operations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *primev3operations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *primev3operations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index 6a12e040300..00000000000 --- a/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object -// with the ability to set a timeout on a request. -func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: timeout, - } -} - -// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object -// with the ability to set a context for a request. -func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - Context: ctx, - } -} - -// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - HTTPClient: client, - } -} - -/* -GetMoveTaskOrderParams contains all the parameters to send to the API endpoint - - for the get move task order operation. - - Typically these are written to a http.Request. -*/ -type GetMoveTaskOrderParams struct { - - /* MoveID. - - UUID or MoveCode of move task order to use........ - */ - MoveID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMoveID adds the moveID to the get move task order params -func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { - o.SetMoveID(moveID) - return o -} - -// SetMoveID adds the moveId to the get move task order params -func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { - o.MoveID = moveID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param moveID - if err := r.SetPathParam("moveID", o.MoveID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index c41562fe0dd..00000000000 --- a/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. -type GetMoveTaskOrderReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetMoveTaskOrderOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetMoveTaskOrderUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetMoveTaskOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetMoveTaskOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetMoveTaskOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) - } -} - -// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - return &GetMoveTaskOrderOK{} -} - -/* -GetMoveTaskOrderOK describes a response with status code 200, with default header values. - -Successfully retrieve an individual move task order. -*/ -type GetMoveTaskOrderOK struct { - Payload *primev3messages.MoveTaskOrder -} - -// IsSuccess returns true when this get move task order o k response has a 2xx status code -func (o *GetMoveTaskOrderOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get move task order o k response has a 3xx status code -func (o *GetMoveTaskOrderOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order o k response has a 4xx status code -func (o *GetMoveTaskOrderOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order o k response has a 5xx status code -func (o *GetMoveTaskOrderOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order o k response a status code equal to that given -func (o *GetMoveTaskOrderOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get move task order o k response -func (o *GetMoveTaskOrderOK) Code() int { - return 200 -} - -func (o *GetMoveTaskOrderOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) GetPayload() *primev3messages.MoveTaskOrder { - return o.Payload -} - -func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - return &GetMoveTaskOrderUnauthorized{} -} - -/* -GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderUnauthorized struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code -func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code -func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order unauthorized response has a 4xx status code -func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order unauthorized response has a 5xx status code -func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order unauthorized response a status code equal to that given -func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) Code() int { - return 401 -} - -func (o *GetMoveTaskOrderUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - return &GetMoveTaskOrderForbidden{} -} - -/* -GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderForbidden struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this get move task order forbidden response has a 2xx status code -func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order forbidden response has a 3xx status code -func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order forbidden response has a 4xx status code -func (o *GetMoveTaskOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order forbidden response has a 5xx status code -func (o *GetMoveTaskOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order forbidden response a status code equal to that given -func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) Code() int { - return 403 -} - -func (o *GetMoveTaskOrderForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - return &GetMoveTaskOrderNotFound{} -} - -/* -GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type GetMoveTaskOrderNotFound struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this get move task order not found response has a 2xx status code -func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order not found response has a 3xx status code -func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order not found response has a 4xx status code -func (o *GetMoveTaskOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order not found response has a 5xx status code -func (o *GetMoveTaskOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order not found response a status code equal to that given -func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get move task order not found response -func (o *GetMoveTaskOrderNotFound) Code() int { - return 404 -} - -func (o *GetMoveTaskOrderNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - return &GetMoveTaskOrderInternalServerError{} -} - -/* -GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type GetMoveTaskOrderInternalServerError struct { - Payload *primev3messages.Error -} - -// IsSuccess returns true when this get move task order internal server error response has a 2xx status code -func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order internal server error response has a 3xx status code -func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order internal server error response has a 4xx status code -func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order internal server error response has a 5xx status code -func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get move task order internal server error response a status code equal to that given -func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) Code() int { - return 500 -} - -func (o *GetMoveTaskOrderInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primev3messages.Error { - return o.Payload -} - -func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev3client/move_task_order/move_task_order_client.go b/pkg/gen/primev3client/move_task_order/move_task_order_client.go deleted file mode 100644 index d579dc49d44..00000000000 --- a/pkg/gen/primev3client/move_task_order/move_task_order_client.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new move task order API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for move task order API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetMoveTaskOrder gets move task order - - ### Functionality - -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMoveTaskOrderParams() - } - op := &runtime.ClientOperation{ - ID: "getMoveTaskOrder", - Method: "GET", - PathPattern: "/move-task-orders/{moveID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetMoveTaskOrderReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetMoveTaskOrderOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go deleted file mode 100644 index 9f53b548412..00000000000 --- a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object -// with the ability to set a context for a request. -func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - Context: ctx, - } -} - -// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - return &CreateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -CreateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the create m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type CreateMTOShipmentParams struct { - - // Body. - Body *primev3messages.CreateMTOShipment - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create m t o shipment params -func (o *CreateMTOShipmentParams) WithBody(body *primev3messages.CreateMTOShipment) *CreateMTOShipmentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create m t o shipment params -func (o *CreateMTOShipmentParams) SetBody(body *primev3messages.CreateMTOShipment) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go deleted file mode 100644 index 7aeaf510b18..00000000000 --- a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. -type CreateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewCreateMTOShipmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateMTOShipmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMTOShipmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateMTOShipmentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateMTOShipmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) - } -} - -// NewCreateMTOShipmentOK creates a CreateMTOShipmentOK with default headers values -func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { - return &CreateMTOShipmentOK{} -} - -/* -CreateMTOShipmentOK describes a response with status code 200, with default header values. - -Successfully created a MTO shipment. -*/ -type CreateMTOShipmentOK struct { - Payload *primev3messages.MTOShipment -} - -// IsSuccess returns true when this create m t o shipment o k response has a 2xx status code -func (o *CreateMTOShipmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create m t o shipment o k response has a 3xx status code -func (o *CreateMTOShipmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment o k response has a 4xx status code -func (o *CreateMTOShipmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o shipment o k response has a 5xx status code -func (o *CreateMTOShipmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment o k response a status code equal to that given -func (o *CreateMTOShipmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the create m t o shipment o k response -func (o *CreateMTOShipmentOK) Code() int { - return 200 -} - -func (o *CreateMTOShipmentOK) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOShipmentOK) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *CreateMTOShipmentOK) GetPayload() *primev3messages.MTOShipment { - return o.Payload -} - -func (o *CreateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentBadRequest creates a CreateMTOShipmentBadRequest with default headers values -func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { - return &CreateMTOShipmentBadRequest{} -} - -/* -CreateMTOShipmentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateMTOShipmentBadRequest struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this create m t o shipment bad request response has a 2xx status code -func (o *CreateMTOShipmentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment bad request response has a 3xx status code -func (o *CreateMTOShipmentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment bad request response has a 4xx status code -func (o *CreateMTOShipmentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment bad request response has a 5xx status code -func (o *CreateMTOShipmentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment bad request response a status code equal to that given -func (o *CreateMTOShipmentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create m t o shipment bad request response -func (o *CreateMTOShipmentBadRequest) Code() int { - return 400 -} - -func (o *CreateMTOShipmentBadRequest) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOShipmentBadRequest) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMTOShipmentBadRequest) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *CreateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentNotFound creates a CreateMTOShipmentNotFound with default headers values -func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { - return &CreateMTOShipmentNotFound{} -} - -/* -CreateMTOShipmentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateMTOShipmentNotFound struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this create m t o shipment not found response has a 2xx status code -func (o *CreateMTOShipmentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment not found response has a 3xx status code -func (o *CreateMTOShipmentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment not found response has a 4xx status code -func (o *CreateMTOShipmentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment not found response has a 5xx status code -func (o *CreateMTOShipmentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment not found response a status code equal to that given -func (o *CreateMTOShipmentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create m t o shipment not found response -func (o *CreateMTOShipmentNotFound) Code() int { - return 404 -} - -func (o *CreateMTOShipmentNotFound) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOShipmentNotFound) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *CreateMTOShipmentNotFound) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *CreateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentUnprocessableEntity creates a CreateMTOShipmentUnprocessableEntity with default headers values -func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { - return &CreateMTOShipmentUnprocessableEntity{} -} - -/* -CreateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type CreateMTOShipmentUnprocessableEntity struct { - Payload *primev3messages.ValidationError -} - -// IsSuccess returns true when this create m t o shipment unprocessable entity response has a 2xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment unprocessable entity response has a 3xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment unprocessable entity response has a 4xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create m t o shipment unprocessable entity response has a 5xx status code -func (o *CreateMTOShipmentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create m t o shipment unprocessable entity response a status code equal to that given -func (o *CreateMTOShipmentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create m t o shipment unprocessable entity response -func (o *CreateMTOShipmentUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateMTOShipmentUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOShipmentUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMTOShipmentUnprocessableEntity) GetPayload() *primev3messages.ValidationError { - return o.Payload -} - -func (o *CreateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMTOShipmentInternalServerError creates a CreateMTOShipmentInternalServerError with default headers values -func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { - return &CreateMTOShipmentInternalServerError{} -} - -/* -CreateMTOShipmentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateMTOShipmentInternalServerError struct { - Payload *primev3messages.Error -} - -// IsSuccess returns true when this create m t o shipment internal server error response has a 2xx status code -func (o *CreateMTOShipmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create m t o shipment internal server error response has a 3xx status code -func (o *CreateMTOShipmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create m t o shipment internal server error response has a 4xx status code -func (o *CreateMTOShipmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create m t o shipment internal server error response has a 5xx status code -func (o *CreateMTOShipmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create m t o shipment internal server error response a status code equal to that given -func (o *CreateMTOShipmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create m t o shipment internal server error response -func (o *CreateMTOShipmentInternalServerError) Code() int { - return 500 -} - -func (o *CreateMTOShipmentInternalServerError) Error() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOShipmentInternalServerError) String() string { - return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMTOShipmentInternalServerError) GetPayload() *primev3messages.Error { - return o.Payload -} - -func (o *CreateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go b/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go deleted file mode 100644 index 57a78b05570..00000000000 --- a/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go +++ /dev/null @@ -1,145 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto shipment API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto shipment API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) - - UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMTOShipment creates m t o shipment - - Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a - -need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must -approve it before the contractor can proceed with billing. - -**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. -If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically -inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize -the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. - -**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to -one of their moves. Otherwise, the Prime can fetch the related move using the -[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. -*/ -func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "createMTOShipment", - Method: "POST", - PathPattern: "/mto-shipments", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMTOShipmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdateMTOShipment updates m t o shipment - - Updates an existing shipment for a move. - -Note that there are some restrictions on nested objects: - -* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. -* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. -* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. - -These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. - -Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. -*/ -func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipment", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOShipmentOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go deleted file mode 100644 index 2ea2f86e0ab..00000000000 --- a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - return &UpdateMTOShipmentParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentParams contains all the parameters to send to the API endpoint - - for the update m t o shipment operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *primev3messages.UpdateMTOShipment - - /* MtoShipmentID. - - UUID of the shipment being updated. - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithBody(body *primev3messages.UpdateMTOShipment) *UpdateMTOShipmentParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetBody(body *primev3messages.UpdateMTOShipment) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params -func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params -func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go deleted file mode 100644 index f798331bd50..00000000000 --- a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3messages" -) - -// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. -type UpdateMTOShipmentReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOShipmentOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOShipmentBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOShipmentUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOShipmentForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOShipmentNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOShipmentPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOShipmentUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOShipmentInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) - } -} - -// NewUpdateMTOShipmentOK creates a UpdateMTOShipmentOK with default headers values -func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { - return &UpdateMTOShipmentOK{} -} - -/* -UpdateMTOShipmentOK describes a response with status code 200, with default header values. - -Successfully updated the MTO shipment. -*/ -type UpdateMTOShipmentOK struct { - Payload *primev3messages.MTOShipment -} - -// IsSuccess returns true when this update m t o shipment o k response has a 2xx status code -func (o *UpdateMTOShipmentOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o shipment o k response has a 3xx status code -func (o *UpdateMTOShipmentOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment o k response has a 4xx status code -func (o *UpdateMTOShipmentOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment o k response has a 5xx status code -func (o *UpdateMTOShipmentOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment o k response a status code equal to that given -func (o *UpdateMTOShipmentOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o shipment o k response -func (o *UpdateMTOShipmentOK) Code() int { - return 200 -} - -func (o *UpdateMTOShipmentOK) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentOK) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentOK) GetPayload() *primev3messages.MTOShipment { - return o.Payload -} - -func (o *UpdateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentBadRequest creates a UpdateMTOShipmentBadRequest with default headers values -func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { - return &UpdateMTOShipmentBadRequest{} -} - -/* -UpdateMTOShipmentBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOShipmentBadRequest struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment bad request response has a 2xx status code -func (o *UpdateMTOShipmentBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment bad request response has a 3xx status code -func (o *UpdateMTOShipmentBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment bad request response has a 4xx status code -func (o *UpdateMTOShipmentBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment bad request response has a 5xx status code -func (o *UpdateMTOShipmentBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment bad request response a status code equal to that given -func (o *UpdateMTOShipmentBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o shipment bad request response -func (o *UpdateMTOShipmentBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOShipmentBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentBadRequest) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentUnauthorized creates a UpdateMTOShipmentUnauthorized with default headers values -func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { - return &UpdateMTOShipmentUnauthorized{} -} - -/* -UpdateMTOShipmentUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentUnauthorized struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment unauthorized response has a 2xx status code -func (o *UpdateMTOShipmentUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment unauthorized response has a 3xx status code -func (o *UpdateMTOShipmentUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment unauthorized response has a 4xx status code -func (o *UpdateMTOShipmentUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment unauthorized response has a 5xx status code -func (o *UpdateMTOShipmentUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment unauthorized response a status code equal to that given -func (o *UpdateMTOShipmentUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o shipment unauthorized response -func (o *UpdateMTOShipmentUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOShipmentUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentUnauthorized) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentForbidden creates a UpdateMTOShipmentForbidden with default headers values -func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { - return &UpdateMTOShipmentForbidden{} -} - -/* -UpdateMTOShipmentForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentForbidden struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment forbidden response has a 2xx status code -func (o *UpdateMTOShipmentForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment forbidden response has a 3xx status code -func (o *UpdateMTOShipmentForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment forbidden response has a 4xx status code -func (o *UpdateMTOShipmentForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment forbidden response has a 5xx status code -func (o *UpdateMTOShipmentForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment forbidden response a status code equal to that given -func (o *UpdateMTOShipmentForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o shipment forbidden response -func (o *UpdateMTOShipmentForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOShipmentForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentForbidden) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentNotFound creates a UpdateMTOShipmentNotFound with default headers values -func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { - return &UpdateMTOShipmentNotFound{} -} - -/* -UpdateMTOShipmentNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOShipmentNotFound struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment not found response has a 2xx status code -func (o *UpdateMTOShipmentNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment not found response has a 3xx status code -func (o *UpdateMTOShipmentNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment not found response has a 4xx status code -func (o *UpdateMTOShipmentNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment not found response has a 5xx status code -func (o *UpdateMTOShipmentNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment not found response a status code equal to that given -func (o *UpdateMTOShipmentNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o shipment not found response -func (o *UpdateMTOShipmentNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOShipmentNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentNotFound) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentPreconditionFailed creates a UpdateMTOShipmentPreconditionFailed with default headers values -func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { - return &UpdateMTOShipmentPreconditionFailed{} -} - -/* -UpdateMTOShipmentPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOShipmentPreconditionFailed struct { - Payload *primev3messages.ClientError -} - -// IsSuccess returns true when this update m t o shipment precondition failed response has a 2xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment precondition failed response has a 3xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment precondition failed response has a 4xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment precondition failed response has a 5xx status code -func (o *UpdateMTOShipmentPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment precondition failed response a status code equal to that given -func (o *UpdateMTOShipmentPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o shipment precondition failed response -func (o *UpdateMTOShipmentPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOShipmentPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentPreconditionFailed) GetPayload() *primev3messages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentUnprocessableEntity creates a UpdateMTOShipmentUnprocessableEntity with default headers values -func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { - return &UpdateMTOShipmentUnprocessableEntity{} -} - -/* -UpdateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. - -The request was unprocessable, likely due to bad input from the requester. -*/ -type UpdateMTOShipmentUnprocessableEntity struct { - Payload *primev3messages.ValidationError -} - -// IsSuccess returns true when this update m t o shipment unprocessable entity response has a 2xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment unprocessable entity response has a 3xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment unprocessable entity response has a 4xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment unprocessable entity response has a 5xx status code -func (o *UpdateMTOShipmentUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment unprocessable entity response a status code equal to that given -func (o *UpdateMTOShipmentUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o shipment unprocessable entity response -func (o *UpdateMTOShipmentUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOShipmentUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentUnprocessableEntity) GetPayload() *primev3messages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentInternalServerError creates a UpdateMTOShipmentInternalServerError with default headers values -func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { - return &UpdateMTOShipmentInternalServerError{} -} - -/* -UpdateMTOShipmentInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOShipmentInternalServerError struct { - Payload *primev3messages.Error -} - -// IsSuccess returns true when this update m t o shipment internal server error response has a 2xx status code -func (o *UpdateMTOShipmentInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment internal server error response has a 3xx status code -func (o *UpdateMTOShipmentInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment internal server error response has a 4xx status code -func (o *UpdateMTOShipmentInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment internal server error response has a 5xx status code -func (o *UpdateMTOShipmentInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o shipment internal server error response a status code equal to that given -func (o *UpdateMTOShipmentInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o shipment internal server error response -func (o *UpdateMTOShipmentInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOShipmentInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentInternalServerError) GetPayload() *primev3messages.Error { - return o.Payload -} - -func (o *UpdateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(primev3messages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/primev3client/mymove_client.go b/pkg/gen/primev3client/mymove_client.go deleted file mode 100644 index e3e47c26d04..00000000000 --- a/pkg/gen/primev3client/mymove_client.go +++ /dev/null @@ -1,117 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3client - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/primev3client/move_task_order" - "github.com/transcom/mymove/pkg/gen/primev3client/mto_shipment" -) - -// Default mymove HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/prime/v3" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new mymove HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Mymove { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new mymove HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new mymove client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Mymove) - cli.Transport = transport - cli.MoveTaskOrder = move_task_order.New(transport, formats) - cli.MtoShipment = mto_shipment.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Mymove is a client for mymove -type Mymove struct { - MoveTaskOrder move_task_order.ClientService - - MtoShipment mto_shipment.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Mymove) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.MoveTaskOrder.SetTransport(transport) - c.MtoShipment.SetTransport(transport) -} diff --git a/pkg/gen/primev3messages/error.go b/pkg/gen/primev3messages/error.go deleted file mode 100644 index a96ae76f88f..00000000000 --- a/pkg/gen/primev3messages/error.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Error error -// -// swagger:model Error -type Error struct { - - // detail - // Required: true - Detail *string `json:"detail"` - - // instance - // Format: uuid - Instance strfmt.UUID `json:"instance,omitempty"` - - // title - // Required: true - Title *string `json:"title"` -} - -// Validate validates this error -func (m *Error) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDetail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInstance(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTitle(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Error) validateDetail(formats strfmt.Registry) error { - - if err := validate.Required("detail", "body", m.Detail); err != nil { - return err - } - - return nil -} - -func (m *Error) validateInstance(formats strfmt.Registry) error { - if swag.IsZero(m.Instance) { // not required - return nil - } - - if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Error) validateTitle(formats strfmt.Registry) error { - - if err := validate.Required("title", "body", m.Title); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this error based on context it is used -func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Error) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Error) UnmarshalBinary(b []byte) error { - var res Error - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_agent.go b/pkg/gen/primev3messages/m_t_o_agent.go deleted file mode 100644 index 440417f3452..00000000000 --- a/pkg/gen/primev3messages/m_t_o_agent.go +++ /dev/null @@ -1,306 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgent m t o agent -// -// swagger:model MTOAgent -type MTOAgent struct { - - // agent type - AgentType MTOAgentType `json:"agentType,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ - Email *string `json:"email,omitempty"` - - // first name - FirstName *string `json:"firstName,omitempty"` - - // The ID of the agent. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // last name - LastName *string `json:"lastName,omitempty"` - - // The ID of the shipment this agent is permitted to release/receive. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // phone - // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ - Phone *string `json:"phone,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o agent -func (m *MTOAgent) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAgentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o agent based on the context it is used -func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.AgentType) { // not required - return nil - } - - if err := m.AgentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agentType") - } - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOAgent) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOAgent) UnmarshalBinary(b []byte) error { - var res MTOAgent - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_agent_type.go b/pkg/gen/primev3messages/m_t_o_agent_type.go deleted file mode 100644 index 08217d25ddd..00000000000 --- a/pkg/gen/primev3messages/m_t_o_agent_type.go +++ /dev/null @@ -1,82 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOAgentType Agent Type -// -// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. -// -// Example: RELEASING_AGENT -// -// swagger:model MTOAgentType -type MTOAgentType string - -func NewMTOAgentType(value MTOAgentType) *MTOAgentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOAgentType. -func (m MTOAgentType) Pointer() *MTOAgentType { - return &m -} - -const ( - - // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" - MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" - - // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" - MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" -) - -// for schema -var mTOAgentTypeEnum []interface{} - -func init() { - var res []MTOAgentType - if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) - } -} - -func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { - if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o agent type -func (m MTOAgentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o agent type based on context it is used -func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_agents.go b/pkg/gen/primev3messages/m_t_o_agents.go deleted file mode 100644 index d1bb76d9f57..00000000000 --- a/pkg/gen/primev3messages/m_t_o_agents.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. -// -// swagger:model MTOAgents -type MTOAgents []*MTOAgent - -// Validate validates this m t o agents -func (m MTOAgents) Validate(formats strfmt.Registry) error { - var res []error - - iMTOAgentsSize := int64(len(m)) - - if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { - return err - } - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o agents based on the context it is used -func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item.go b/pkg/gen/primev3messages/m_t_o_service_item.go deleted file mode 100644 index 9559114c004..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item.go +++ /dev/null @@ -1,517 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. -// -// swagger:discriminator MTOServiceItem modelType -type MTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // A hash unique to this service item that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag() string - SetETag(string) - - // The ID of the service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // locked price cents - LockedPriceCents() *int64 - SetLockedPriceCents(*int64) - - // model type - // Required: true - ModelType() MTOServiceItemModelType - SetModelType(MTOServiceItemModelType) - - // The ID of the move for this service item. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - MoveTaskOrderID() *strfmt.UUID - SetMoveTaskOrderID(*strfmt.UUID) - - // The ID of the shipment this service is for, if any. Optional. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID() strfmt.UUID - SetMtoShipmentID(strfmt.UUID) - - // The full descriptive name of the service. - // Read Only: true - ReServiceName() string - SetReServiceName(string) - - // The reason why this service item was rejected by the TOO. - // Example: item was too heavy - // Read Only: true - RejectionReason() *string - SetRejectionReason(*string) - - // service request documents - ServiceRequestDocuments() ServiceRequestDocuments - SetServiceRequestDocuments(ServiceRequestDocuments) - - // status - Status() MTOServiceItemStatus - SetStatus(MTOServiceItemStatus) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type mTOServiceItem struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - modelTypeField MTOServiceItemModelType - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus -} - -// ETag gets the e tag of this polymorphic type -func (m *mTOServiceItem) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this polymorphic type -func (m *mTOServiceItem) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this polymorphic type -func (m *mTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *mTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this polymorphic type -func (m *mTOServiceItem) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this polymorphic type -func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { - return "MTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this polymorphic type -func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this polymorphic type -func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this polymorphic type -func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this polymorphic type -func (m *mTOServiceItem) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this polymorphic type -func (m *mTOServiceItem) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this polymorphic type -func (m *mTOServiceItem) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this polymorphic type -func (m *mTOServiceItem) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this polymorphic type -func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this polymorphic type -func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this polymorphic type -func (m *mTOServiceItem) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this polymorphic type -func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem -func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []MTOServiceItem - for _, element := range elements { - obj, err := unmarshalMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem -func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalMTOServiceItem(data, consumer) -} - -func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "MTOServiceItem": - var result mTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemBasic": - var result MTOServiceItemBasic - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDestSIT": - var result MTOServiceItemDestSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemDomesticCrating": - var result MTOServiceItemDomesticCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemInternationalCrating": - var result MTOServiceItemInternationalCrating - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemOriginSIT": - var result MTOServiceItemOriginSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "MTOServiceItemShuttle": - var result MTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this m t o service item -func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this m t o service item based on the context it is used -func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_basic.go b/pkg/gen/primev3messages/m_t_o_service_item_basic.go deleted file mode 100644 index 57e85ed0f7d..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_basic.go +++ /dev/null @@ -1,574 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemBasic -type MTOServiceItemBasic struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemBasic) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemBasic) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemBasic) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { - return "MTOServiceItemBasic" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemBasic) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemBasic) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemBasic) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { - var data struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemBasic - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // re service code - // Required: true - ReServiceCode *ReServiceCode `json:"reServiceCode"` - }{ - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item basic -func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - if m.ReServiceCode != nil { - if err := m.ReServiceCode.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// ContextValidate validate this m t o service item basic based on the context it is used -func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceCode(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { - - if m.ReServiceCode != nil { - - if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reServiceCode") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reServiceCode") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { - var res MTOServiceItemBasic - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go deleted file mode 100644 index 7e6333c32c3..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go +++ /dev/null @@ -1,987 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDestSIT -type MTOServiceItemDestSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDestSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDestSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDestSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDestSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDestSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to `timeMilitary1`. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to `timeMilitary2`. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Required: true - // Enum: [DDFSIT DDASIT] - ReServiceCode *string `json:"reServiceCode"` - - // The reason item has been placed in SIT. - // - // Required: true - Reason *string `json:"reason"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact1`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact corresponding to `dateOfContact2`, in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item dest s i t -func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item dest s i t based on the context it is used -func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDestSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_dimension.go b/pkg/gen/primev3messages/m_t_o_service_item_dimension.go deleted file mode 100644 index f3a3d8ed23f..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_dimension.go +++ /dev/null @@ -1,129 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. -// -// swagger:model MTOServiceItemDimension -type MTOServiceItemDimension struct { - - // Height in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Height *int32 `json:"height"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Length in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Length *int32 `json:"length"` - - // Width in thousandth inches. 1000 thou = 1 inch. - // Example: 1000 - // Required: true - Width *int32 `json:"width"` -} - -// Validate validates this m t o service item dimension -func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateHeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLength(formats); err != nil { - res = append(res, err) - } - - if err := m.validateWidth(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { - - if err := validate.Required("height", "body", m.Height); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { - - if err := validate.Required("length", "body", m.Length); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { - - if err := validate.Required("width", "body", m.Width); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this m t o service item dimension based on context it is used -func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDimension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go deleted file mode 100644 index 83e39efa302..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go +++ /dev/null @@ -1,705 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemDomesticCrating -type MTOServiceItemDomesticCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemDomesticCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemDomesticCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemDomesticCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.Item = data.Item - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). - // Required: true - // Enum: [DCRT DUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - Item: m.Item, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item domestic crating -func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item domestic crating based on the context it is used -func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemDomesticCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go b/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go deleted file mode 100644 index 55a759a0682..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go +++ /dev/null @@ -1,773 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemInternationalCrating -type MTOServiceItemInternationalCrating struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemInternationalCrating) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { - return "MTOServiceItemInternationalCrating" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { - var data struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemInternationalCrating - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.Crate = data.Crate - result.Description = data.Description - result.ExternalCrate = data.ExternalCrate - result.Item = data.Item - result.Market = data.Market - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.StandaloneCrate = data.StandaloneCrate - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // The dimensions for the crate the item will be shipped in. - // Required: true - Crate struct { - MTOServiceItemDimension - } `json:"crate"` - - // A description of the item being crated. - // Example: Decorated horse head to be crated. - // Required: true - Description *string `json:"description"` - - // external crate - ExternalCrate *bool `json:"externalCrate,omitempty"` - - // The dimensions of the item being crated. - // Required: true - Item struct { - MTOServiceItemDimension - } `json:"item"` - - // To identify whether the service was provided within (CONUS) or (OCONUS) - // Example: CONUS - // Enum: [CONUS OCONUS] - Market string `json:"market,omitempty"` - - // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). - // Required: true - // Enum: [ICRT IUCRT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up - Reason *string `json:"reason"` - - // standalone crate - StandaloneCrate *bool `json:"standaloneCrate,omitempty"` - }{ - - Crate: m.Crate, - - Description: m.Description, - - ExternalCrate: m.ExternalCrate, - - Item: m.Item, - - Market: m.Market, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - StandaloneCrate: m.StandaloneCrate, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item international crating -func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCrate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDescription(formats); err != nil { - res = append(res, err) - } - - if err := m.validateItem(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarket(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { - - if err := validate.Required("description", "body", m.Description); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { - - return nil -} - -var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { - - if swag.IsZero(m.Market) { // not required - return nil - } - - // value enum - if err := m.validateMarketEnum("market", "body", m.Market); err != nil { - return err - } - - return nil -} - -var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item international crating based on the context it is used -func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCrate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateItem(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { - var res MTOServiceItemInternationalCrating - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_model_type.go b/pkg/gen/primev3messages/m_t_o_service_item_model_type.go deleted file mode 100644 index 50a9d22e418..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_model_type.go +++ /dev/null @@ -1,103 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. -// -// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DOFSIT, DOASIT - MTOServiceItemOriginSIT -// - DDFSIT, DDASIT - MTOServiceItemDestSIT -// - DOSHUT, DDSHUT - MTOServiceItemShuttle -// - DCRT, DUCRT - MTOServiceItemDomesticCrating -// - ICRT, IUCRT - MTOServiceItemInternationalCrating -// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge -// -// The documentation will then update with the supported fields. -// -// swagger:model MTOServiceItemModelType -type MTOServiceItemModelType string - -func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. -func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { - return &m -} - -const ( - - // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" - MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" - - // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" - MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" - - // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" - MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" - - // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" - MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" - - // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" - MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" - - // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" - MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" - - // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" - MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" -) - -// for schema -var mTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) - } -} - -func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item model type -func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o service item model type based on context it is used -func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go deleted file mode 100644 index 1ca4558a59c..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go +++ /dev/null @@ -1,900 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. -// -// swagger:model MTOServiceItemOriginSIT -type MTOServiceItemOriginSIT struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemOriginSIT) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { - return "MTOServiceItemOriginSIT" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemOriginSIT - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitEntryDate = data.SitEntryDate - result.SitHHGActualOrigin = data.SitHHGActualOrigin - result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Service code allowed for this model type. - // Required: true - // Enum: [DOFSIT DOASIT] - ReServiceCode *string `json:"reServiceCode"` - - // Explanation of why Prime is picking up SIT item. - // Example: Storage items need to be picked up - // Required: true - Reason *string `json:"reason"` - - // request approvals requested status - RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. - // Format: date - SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` - - // Entry date for the SIT - // Required: true - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate"` - - // sit h h g actual origin - SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` - - // sit h h g original origin - SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` - - // sit postal code - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - }{ - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitEntryDate: m.SitEntryDate, - - SitHHGActualOrigin: m.SitHHGActualOrigin, - - SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item origin s i t -func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGActualOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitHHGOriginalOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { - return err - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if m.SitHHGActualOrigin != nil { - if err := m.SitHHGActualOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if m.SitHHGOriginalOrigin != nil { - if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { - return err - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item origin s i t based on the context it is used -func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGActualOrigin != nil { - - if swag.IsZero(m.SitHHGActualOrigin) { // not required - return nil - } - - if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGActualOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGActualOrigin") - } - return err - } - } - - return nil -} - -func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { - - if m.SitHHGOriginalOrigin != nil { - - if swag.IsZero(m.SitHHGOriginalOrigin) { // not required - return nil - } - - if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitHHGOriginalOrigin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitHHGOriginalOrigin") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { - var res MTOServiceItemOriginSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go b/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go deleted file mode 100644 index a89fa1024b7..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,633 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOServiceItemShuttle Describes a shuttle service item. -// -// swagger:model MTOServiceItemShuttle -type MTOServiceItemShuttle struct { - eTagField string - - idField strfmt.UUID - - lockedPriceCentsField *int64 - - moveTaskOrderIdField *strfmt.UUID - - mtoShipmentIdField strfmt.UUID - - reServiceNameField string - - rejectionReasonField *string - - serviceRequestDocumentsField ServiceRequestDocuments - - statusField MTOServiceItemStatus - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` -} - -// ETag gets the e tag of this subtype -func (m *MTOServiceItemShuttle) ETag() string { - return m.eTagField -} - -// SetETag sets the e tag of this subtype -func (m *MTOServiceItemShuttle) SetETag(val string) { - m.eTagField = val -} - -// ID gets the id of this subtype -func (m *MTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// LockedPriceCents gets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { - return m.lockedPriceCentsField -} - -// SetLockedPriceCents sets the locked price cents of this subtype -func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { - m.lockedPriceCentsField = val -} - -// ModelType gets the model type of this subtype -func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { - return "MTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { -} - -// MoveTaskOrderID gets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { - return m.moveTaskOrderIdField -} - -// SetMoveTaskOrderID sets the move task order ID of this subtype -func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { - m.moveTaskOrderIdField = val -} - -// MtoShipmentID gets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { - return m.mtoShipmentIdField -} - -// SetMtoShipmentID sets the mto shipment ID of this subtype -func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { - m.mtoShipmentIdField = val -} - -// ReServiceName gets the re service name of this subtype -func (m *MTOServiceItemShuttle) ReServiceName() string { - return m.reServiceNameField -} - -// SetReServiceName sets the re service name of this subtype -func (m *MTOServiceItemShuttle) SetReServiceName(val string) { - m.reServiceNameField = val -} - -// RejectionReason gets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) RejectionReason() *string { - return m.rejectionReasonField -} - -// SetRejectionReason sets the rejection reason of this subtype -func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { - m.rejectionReasonField = val -} - -// ServiceRequestDocuments gets the service request documents of this subtype -func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { - return m.serviceRequestDocumentsField -} - -// SetServiceRequestDocuments sets the service request documents of this subtype -func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { - m.serviceRequestDocumentsField = val -} - -// Status gets the status of this subtype -func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { - return m.statusField -} - -// SetStatus sets the status of this subtype -func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { - m.statusField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result MTOServiceItemShuttle - - result.eTagField = base.ETag - - result.idField = base.ID - - result.lockedPriceCentsField = base.LockedPriceCents - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - result.moveTaskOrderIdField = base.MoveTaskOrderID - - result.mtoShipmentIdField = base.MtoShipmentID - - result.reServiceNameField = base.ReServiceName - - result.rejectionReasonField = base.RejectionReason - - result.serviceRequestDocumentsField = base.ServiceRequestDocuments - - result.statusField = base.Status - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - result.Reason = data.Reason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in the shuttling service. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). - // - // Required: true - // Enum: [DOSHUT DDSHUT] - ReServiceCode *string `json:"reServiceCode"` - - // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. - // - // Example: Storage items need to be picked up. - // Required: true - Reason *string `json:"reason"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - - Reason: m.Reason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ETag string `json:"eTag,omitempty"` - - ID strfmt.UUID `json:"id,omitempty"` - - LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` - - ModelType MTOServiceItemModelType `json:"modelType"` - - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` - - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - ReServiceName string `json:"reServiceName,omitempty"` - - RejectionReason *string `json:"rejectionReason,omitempty"` - - ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` - - Status MTOServiceItemStatus `json:"status,omitempty"` - }{ - - ETag: m.ETag(), - - ID: m.ID(), - - LockedPriceCents: m.LockedPriceCents(), - - ModelType: m.ModelType(), - - MoveTaskOrderID: m.MoveTaskOrderID(), - - MtoShipmentID: m.MtoShipmentID(), - - ReServiceName: m.ReServiceName(), - - RejectionReason: m.RejectionReason(), - - ServiceRequestDocuments: m.ServiceRequestDocuments(), - - Status: m.Status(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o service item shuttle -func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateServiceRequestDocuments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReason(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { - return err - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { - - if swag.IsZero(m.MtoShipmentID()) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { - - if swag.IsZero(m.ServiceRequestDocuments()) { // not required - return nil - } - - if err := m.ServiceRequestDocuments().Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { - - if err := validate.Required("reason", "body", m.Reason); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o service item shuttle based on the context it is used -func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReServiceName(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRejectionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("serviceRequestDocuments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("serviceRequestDocuments") - } - return err - } - - return nil -} - -func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status()) { // not required - return nil - } - - if err := m.Status().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res MTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_status.go b/pkg/gen/primev3messages/m_t_o_service_item_status.go deleted file mode 100644 index 7f21cbf7c27..00000000000 --- a/pkg/gen/primev3messages/m_t_o_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. -// -// swagger:model MTOServiceItemStatus -type MTOServiceItemStatus string - -func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. -func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { - return &m -} - -const ( - - // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" - MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" - - // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" - MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" - - // MTOServiceItemStatusREJECTED captures enum value "REJECTED" - MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" -) - -// for schema -var mTOServiceItemStatusEnum []interface{} - -func init() { - var res []MTOServiceItemStatus - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) - } -} - -func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o service item status -func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o service item status based on the context it is used -func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_shipment.go b/pkg/gen/primev3messages/m_t_o_shipment.go deleted file mode 100644 index 725608c2257..00000000000 --- a/pkg/gen/primev3messages/m_t_o_shipment.go +++ /dev/null @@ -1,204 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipment m t o shipment -// -// swagger:model MTOShipment -type MTOShipment struct { - MTOShipmentWithoutServiceItems - - mtoServiceItemsField []MTOServiceItem -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MTOShipment) UnmarshalJSON(raw []byte) error { - var data struct { - MTOShipmentWithoutServiceItems - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var propMtoServiceItems []MTOServiceItem - if string(data.MtoServiceItems) != "null" { - mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - propMtoServiceItems = mtoServiceItems - } - - var result MTOShipment - - result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MTOShipment) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - MTOShipmentWithoutServiceItems - }{ - - MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this m t o shipment -func (m *MTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItems()) { // not required - return nil - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// ContextValidate validate this m t o shipment based on the context it is used -func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with MTOShipmentWithoutServiceItems - if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipment) UnmarshalBinary(b []byte) error { - var res MTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_shipment_type.go b/pkg/gen/primev3messages/m_t_o_shipment_type.go deleted file mode 100644 index cbcda952606..00000000000 --- a/pkg/gen/primev3messages/m_t_o_shipment_type.go +++ /dev/null @@ -1,107 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// MTOShipmentType Shipment Type -// -// The type of shipment. -// - `HHG` = Household goods move -// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) -// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) -// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) -// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination -// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer -// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. -// -// Example: HHG -// -// swagger:model MTOShipmentType -type MTOShipmentType string - -func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated MTOShipmentType. -func (m MTOShipmentType) Pointer() *MTOShipmentType { - return &m -} - -const ( - - // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" - MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" - - // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" - MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" - - // MTOShipmentTypeHHG captures enum value "HHG" - MTOShipmentTypeHHG MTOShipmentType = "HHG" - - // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" - MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" - - // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" - MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" - - // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" - MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" - - // MTOShipmentTypePPM captures enum value "PPM" - MTOShipmentTypePPM MTOShipmentType = "PPM" - - // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" - MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" -) - -// for schema -var mTOShipmentTypeEnum []interface{} - -func init() { - var res []MTOShipmentType - if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) - } -} - -func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { - if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this m t o shipment type -func (m MTOShipmentType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this m t o shipment type based on context it is used -func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go b/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go deleted file mode 100644 index 6fff06e8de3..00000000000 --- a/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go +++ /dev/null @@ -1,1740 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MTOShipmentWithoutServiceItems m t o shipment without service items -// -// swagger:model MTOShipmentWithoutServiceItems -type MTOShipmentWithoutServiceItems struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // The actual weight of any pro gear being shipped. - // - ActualProGearWeight *int64 `json:"actualProGearWeight"` - - // The actual weight of any spouse pro gear being shipped. - // - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` - - // agents - Agents MTOAgents `json:"agents,omitempty"` - - // The date when the Task Ordering Officer first approved this shipment for the move. - // Read Only: true - // Format: date - ApprovedDate *strfmt.Date `json:"approvedDate"` - - // boat shipment - BoatShipment *BoatShipment `json:"boatShipment,omitempty"` - - // The counselor can use the counselor remarks field to inform the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Counselors enters this information when creating or editing an MTO Shipment. Optional field. - // - // Example: handle with care - // Read Only: true - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // The customer can use the customer remarks field to inform the services counselor and the movers about any - // special circumstances for this shipment. Typical examples: - // * bulky or fragile items, - // * weapons, - // * access info for their address. - // - // Customer enters this information during onboarding. Optional field. - // - // Example: handle with care - // Read Only: true - CustomerRemarks *string `json:"customerRemarks,omitempty"` - - // delivery address update - DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination rate area - DestinationRateArea *RateArea `json:"destinationRateArea,omitempty"` - - // The SIT authorized end date for destination SIT. - // Format: date - DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The reason the TOO provided when requesting a diversion for this shipment. - // - // Read Only: true - DiversionReason *string `json:"diversionReason,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The ID of the shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // Single-letter designator for domestic (d) or international (i) shipments - // Example: d - // Enum: [d i] - MarketCode string `json:"marketCode,omitempty"` - - // mobile home shipment - MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` - - // The ID of the move for this shipment. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // origin rate area - OriginRateArea *RateArea `json:"originRateArea,omitempty"` - - // The SIT authorized end date for origin SIT. - // Format: date - OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // port of debarkation - PortOfDebarkation *Port `json:"portOfDebarkation,omitempty"` - - // port of embarkation - PortOfEmbarkation *Port `json:"portOfEmbarkation,omitempty"` - - // ppm shipment - PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date when the Prime contractor recorded the shipment's estimated weight. - // Read Only: true - // Format: date - PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` - - // The customer's preferred delivery date. - // Read Only: true - // Format: date - RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` - - // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. - // - // Read Only: true - // Format: date - RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` - - // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. - // - // Read Only: true - // Format: date - RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` - - // reweigh - Reweigh *Reweigh `json:"reweigh,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // secondary delivery address - SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // sit extensions - SitExtensions SITExtensions `json:"sitExtensions,omitempty"` - - // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. - // - // Read Only: true - // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] - Status string `json:"status,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // tertiary delivery address - TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this m t o shipment without service items -func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAgents(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBoatShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDeliveryAddressUpdate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationRateArea(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMarketCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMobileHomeShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginRateArea(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginSitAuthEndDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortOfDebarkation(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortOfEmbarkation(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequiredDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReweigh(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExtensions(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { - if swag.IsZero(m.Agents) { // not required - return nil - } - - if err := m.Agents.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedDate) { // not required - return nil - } - - if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateBoatShipment(formats strfmt.Registry) error { - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if m.BoatShipment != nil { - if err := m.BoatShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if m.DeliveryAddressUpdate != nil { - if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationRateArea(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationRateArea) { // not required - return nil - } - - if m.DestinationRateArea != nil { - if err := m.DestinationRateArea.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationRateArea") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) 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 -} - -var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" - MTOShipmentWithoutServiceItemsMarketCodeD string = "d" - - // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" - MTOShipmentWithoutServiceItemsMarketCodeI string = "i" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { - if swag.IsZero(m.MarketCode) { // not required - return nil - } - - // value enum - if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMobileHomeShipment(formats strfmt.Registry) error { - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if m.MobileHomeShipment != nil { - if err := m.MobileHomeShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateOriginRateArea(formats strfmt.Registry) error { - if swag.IsZero(m.OriginRateArea) { // not required - return nil - } - - if m.OriginRateArea != nil { - if err := m.OriginRateArea.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originRateArea") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { - if swag.IsZero(m.OriginSitAuthEndDate) { // not required - return nil - } - - if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePortOfDebarkation(formats strfmt.Registry) error { - if swag.IsZero(m.PortOfDebarkation) { // not required - return nil - } - - if m.PortOfDebarkation != nil { - if err := m.PortOfDebarkation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfDebarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfDebarkation") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePortOfEmbarkation(formats strfmt.Registry) error { - if swag.IsZero(m.PortOfEmbarkation) { // not required - return nil - } - - if m.PortOfEmbarkation != nil { - if err := m.PortOfEmbarkation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfEmbarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfEmbarkation") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required - return nil - } - - if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.RequiredDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if m.Reweigh != nil { - if err := m.Reweigh.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if m.SecondaryDeliveryAddress != nil { - if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { - if swag.IsZero(m.SitExtensions) { // not required - return nil - } - - if err := m.SitExtensions.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) - } -} - -const ( - - // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" - MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" - - // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" - MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" - - // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" - MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" - - // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" - MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" - - // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" -) - -// prop value enum -func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if m.TertiaryDeliveryAddress != nil { - if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this m t o shipment without service items based on the context it is used -func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAgents(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateApprovedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBoatShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationRateArea(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDiversionReason(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginRateArea(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePortOfDebarkation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePortOfEmbarkation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReweigh(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitExtensions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Agents.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("agents") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("agents") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.BoatShipment != nil { - - if swag.IsZero(m.BoatShipment) { // not required - return nil - } - - if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("boatShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("boatShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { - - if m.DeliveryAddressUpdate != nil { - - if swag.IsZero(m.DeliveryAddressUpdate) { // not required - return nil - } - - if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("deliveryAddressUpdate") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("deliveryAddressUpdate") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationRateArea(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationRateArea != nil { - - if swag.IsZero(m.DestinationRateArea) { // not required - return nil - } - - if err := m.DestinationRateArea.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationRateArea") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.MobileHomeShipment != nil { - - if swag.IsZero(m.MobileHomeShipment) { // not required - return nil - } - - if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mobileHomeShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mobileHomeShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateOriginRateArea(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginRateArea != nil { - - if swag.IsZero(m.OriginRateArea) { // not required - return nil - } - - if err := m.OriginRateArea.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originRateArea") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePortOfDebarkation(ctx context.Context, formats strfmt.Registry) error { - - if m.PortOfDebarkation != nil { - - if swag.IsZero(m.PortOfDebarkation) { // not required - return nil - } - - if err := m.PortOfDebarkation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfDebarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfDebarkation") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePortOfEmbarkation(ctx context.Context, formats strfmt.Registry) error { - - if m.PortOfEmbarkation != nil { - - if swag.IsZero(m.PortOfEmbarkation) { // not required - return nil - } - - if err := m.PortOfEmbarkation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfEmbarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfEmbarkation") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { - - if m.Reweigh != nil { - - if swag.IsZero(m.Reweigh) { // not required - return nil - } - - if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("reweigh") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("reweigh") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDeliveryAddress != nil { - - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { - - if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitExtensions") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitExtensions") - } - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { - return err - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDeliveryAddress != nil { - - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDeliveryAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDeliveryAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { - var res MTOShipmentWithoutServiceItems - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go deleted file mode 100644 index 71ebac8e852..00000000000 --- a/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. -// -// swagger:model MTOShipmentsWithoutServiceObjects -type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems - -// Validate validates this m t o shipments without service objects -func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this m t o shipments without service objects based on the context it is used -func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/mobile_home.go b/pkg/gen/primev3messages/mobile_home.go deleted file mode 100644 index 7358b0a8421..00000000000 --- a/pkg/gen/primev3messages/mobile_home.go +++ /dev/null @@ -1,232 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. -// -// swagger:model MobileHome -type MobileHome struct { - - // Timestamp of when a property of this object was created (UTC) - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // height in inches - HeightInInches int64 `json:"heightInInches,omitempty"` - - // Primary auto-generated unique identifier of the Mobile Home object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // length in inches - LengthInInches int64 `json:"lengthInInches,omitempty"` - - // The make of the mobile home - Make string `json:"make,omitempty"` - - // The model of the mobile home. - Model string `json:"model,omitempty"` - - // The id of the parent MTOShipment object - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` - - // Timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // width in inches - WidthInInches int64 `json:"widthInInches,omitempty"` - - // The year the mobile home was made. - Year int64 `json:"year,omitempty"` -} - -// Validate validates this mobile home -func (m *MobileHome) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this mobile home based on the context it is used -func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MobileHome) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MobileHome) UnmarshalBinary(b []byte) error { - var res MobileHome - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/move_task_order.go b/pkg/gen/primev3messages/move_task_order.go deleted file mode 100644 index 02b991a0a16..00000000000 --- a/pkg/gen/primev3messages/move_task_order.go +++ /dev/null @@ -1,965 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// MoveTaskOrder move task order -// -// swagger:model MoveTaskOrder -type MoveTaskOrder struct { - - // approved at - // Read Only: true - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - // available to prime at - // Read Only: true - // Format: date-time - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - // contract number - // Read Only: true - ContractNumber string `json:"contractNumber,omitempty"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // destination g b l o c - // Example: KKFA - // Read Only: true - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - // destination postal code - // Example: 90210 - // Read Only: true - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // excess weight acknowledged at - // Read Only: true - // Format: date-time - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - // excess weight qualified at - // Read Only: true - // Format: date-time - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - // excess weight upload Id - // Read Only: true - // Format: uuid - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - // id - // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move code - // Example: HYXFJF - // Read Only: true - MoveCode string `json:"moveCode,omitempty"` - - mtoServiceItemsField []MTOServiceItem - - // mto shipments - // Required: true - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - // order - Order *Order `json:"order,omitempty"` - - // order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - OrderID strfmt.UUID `json:"orderID,omitempty"` - - // payment requests - // Required: true - PaymentRequests PaymentRequests `json:"paymentRequests"` - - // ppm estimated weight - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - // ppm type - // Enum: [PARTIAL FULL] - PpmType string `json:"ppmType,omitempty"` - - // prime counseling completed at - // Read Only: true - // Format: date-time - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - // reference Id - // Example: 1001-3456 - ReferenceID string `json:"referenceId,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// MtoServiceItems gets the mto service items of this base type -func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { - return m.mtoServiceItemsField -} - -// SetMtoServiceItems sets the mto service items of this base type -func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { - m.mtoServiceItemsField = val -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { - var data struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - ContractNumber string `json:"contractNumber,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoServiceItems json.RawMessage `json:"mtoServiceItems"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) - if err != nil && err != io.EOF { - return err - } - - var result MoveTaskOrder - - // approvedAt - result.ApprovedAt = data.ApprovedAt - - // availableToPrimeAt - result.AvailableToPrimeAt = data.AvailableToPrimeAt - - // contractNumber - result.ContractNumber = data.ContractNumber - - // createdAt - result.CreatedAt = data.CreatedAt - - // destinationGBLOC - result.DestinationGBLOC = data.DestinationGBLOC - - // destinationPostalCode - result.DestinationPostalCode = data.DestinationPostalCode - - // eTag - result.ETag = data.ETag - - // excessWeightAcknowledgedAt - result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt - - // excessWeightQualifiedAt - result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt - - // excessWeightUploadId - result.ExcessWeightUploadID = data.ExcessWeightUploadID - - // id - result.ID = data.ID - - // moveCode - result.MoveCode = data.MoveCode - - // mtoServiceItems - result.mtoServiceItemsField = propMtoServiceItems - - // mtoShipments - result.MtoShipments = data.MtoShipments - - // order - result.Order = data.Order - - // orderID - result.OrderID = data.OrderID - - // paymentRequests - result.PaymentRequests = data.PaymentRequests - - // ppmEstimatedWeight - result.PpmEstimatedWeight = data.PpmEstimatedWeight - - // ppmType - result.PpmType = data.PpmType - - // primeCounselingCompletedAt - result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt - - // referenceId - result.ReferenceID = data.ReferenceID - - // updatedAt - result.UpdatedAt = data.UpdatedAt - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` - - AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` - - ContractNumber string `json:"contractNumber,omitempty"` - - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - DestinationGBLOC string `json:"destinationGBLOC,omitempty"` - - DestinationPostalCode string `json:"destinationPostalCode,omitempty"` - - ETag string `json:"eTag,omitempty"` - - ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` - - ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` - - ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` - - ID strfmt.UUID `json:"id,omitempty"` - - MoveCode string `json:"moveCode,omitempty"` - - MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` - - Order *Order `json:"order,omitempty"` - - OrderID strfmt.UUID `json:"orderID,omitempty"` - - PaymentRequests PaymentRequests `json:"paymentRequests"` - - PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` - - PpmType string `json:"ppmType,omitempty"` - - PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` - - ReferenceID string `json:"referenceId,omitempty"` - - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - }{ - - ApprovedAt: m.ApprovedAt, - - AvailableToPrimeAt: m.AvailableToPrimeAt, - - ContractNumber: m.ContractNumber, - - CreatedAt: m.CreatedAt, - - DestinationGBLOC: m.DestinationGBLOC, - - DestinationPostalCode: m.DestinationPostalCode, - - ETag: m.ETag, - - ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, - - ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, - - ExcessWeightUploadID: m.ExcessWeightUploadID, - - ID: m.ID, - - MoveCode: m.MoveCode, - - MtoShipments: m.MtoShipments, - - Order: m.Order, - - OrderID: m.OrderID, - - PaymentRequests: m.PaymentRequests, - - PpmEstimatedWeight: m.PpmEstimatedWeight, - - PpmType: m.PpmType, - - PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, - - ReferenceID: m.ReferenceID, - - UpdatedAt: m.UpdatedAt, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` - }{ - - MtoServiceItems: m.mtoServiceItemsField, - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this move task order -func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateAvailableToPrimeAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightQualifiedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExcessWeightUploadID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipments(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrder(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequests(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmType(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableToPrimeAt) { // not required - return nil - } - - if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { - if swag.IsZero(m.ExcessWeightUploadID) { // not required - return nil - } - - if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { - - if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { - return err - } - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { - - if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { - return err - } - - if err := m.MtoShipments.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { - if swag.IsZero(m.Order) { // not required - return nil - } - - if m.Order != nil { - if err := m.Order.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.OrderID) { // not required - return nil - } - - if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { - - if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { - return err - } - - if err := m.PaymentRequests.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -var moveTaskOrderTypePpmTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) - } -} - -const ( - - // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" - MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" - - // MoveTaskOrderPpmTypeFULL captures enum value "FULL" - MoveTaskOrderPpmTypeFULL string = "FULL" -) - -// prop value enum -func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { - if swag.IsZero(m.PpmType) { // not required - return nil - } - - // value enum - if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required - return nil - } - - if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this move task order based on the context it is used -func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateApprovedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateContractNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMoveCode(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMtoShipments(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrder(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateContractNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractNumber", "body", string(m.ContractNumber)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.MtoServiceItems()); i++ { - - if swag.IsZero(m.mtoServiceItemsField[i]) { // not required - return nil - } - - if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) - } - return err - } - - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { - - if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("mtoShipments") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("mtoShipments") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { - - if m.Order != nil { - - if swag.IsZero(m.Order) { // not required - return nil - } - - if err := m.Order.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("order") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("order") - } - return err - } - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentRequests") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentRequests") - } - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { - return err - } - - return nil -} - -func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { - var res MoveTaskOrder - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/order.go b/pkg/gen/primev3messages/order.go deleted file mode 100644 index e4b6fafdfb5..00000000000 --- a/pkg/gen/primev3messages/order.go +++ /dev/null @@ -1,516 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Order order -// -// swagger:model Order -type Order struct { - - // customer - Customer *Customer `json:"customer,omitempty"` - - // customer ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - CustomerID strfmt.UUID `json:"customerID,omitempty"` - - // destination duty location - DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` - - // destination duty location g b l o c - // Example: KKFA - DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // entitlement - Entitlement *Entitlements `json:"entitlement,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lines of accounting - // Required: true - LinesOfAccounting *string `json:"linesOfAccounting"` - - // method of payment - // Read Only: true - MethodOfPayment string `json:"methodOfPayment,omitempty"` - - // naics - // Read Only: true - Naics string `json:"naics,omitempty"` - - // order number - // Required: true - OrderNumber *string `json:"orderNumber"` - - // orders type - OrdersType OrdersType `json:"ordersType,omitempty"` - - // origin duty location - OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` - - // origin duty location g b l o c - // Example: KKFA - OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` - - // packing and shipping instructions - // Read Only: true - PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` - - // rank - // Example: E_5 - // Required: true - Rank *string `json:"rank"` - - // report by date - // Format: date - ReportByDate strfmt.Date `json:"reportByDate,omitempty"` - - // supply and services cost estimate - // Read Only: true - SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` -} - -// Validate validates this order -func (m *Order) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCustomer(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCustomerID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEntitlement(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateLinesOfAccounting(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrderNumber(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrdersType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginDutyLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRank(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReportByDate(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) validateCustomer(formats strfmt.Registry) error { - if swag.IsZero(m.Customer) { // not required - return nil - } - - if m.Customer != nil { - if err := m.Customer.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) validateCustomerID(formats strfmt.Registry) error { - if swag.IsZero(m.CustomerID) { // not required - return nil - } - - if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if m.DestinationDutyLocation != nil { - if err := m.DestinationDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateEntitlement(formats strfmt.Registry) error { - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if m.Entitlement != nil { - if err := m.Entitlement.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { - - if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrderNumber(formats strfmt.Registry) error { - - if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { - return err - } - - return nil -} - -func (m *Order) validateOrdersType(formats strfmt.Registry) error { - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if m.OriginDutyLocation != nil { - if err := m.OriginDutyLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) validateRank(formats strfmt.Registry) error { - - if err := validate.Required("rank", "body", m.Rank); err != nil { - return err - } - - return nil -} - -func (m *Order) validateReportByDate(formats strfmt.Registry) error { - if swag.IsZero(m.ReportByDate) { // not required - return nil - } - - if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this order based on the context it is used -func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCustomer(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateEntitlement(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateMethodOfPayment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNaics(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrdersType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePackingAndShippingInstructions(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSupplyAndServicesCostEstimate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { - - if m.Customer != nil { - - if swag.IsZero(m.Customer) { // not required - return nil - } - - if err := m.Customer.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("customer") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("customer") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationDutyLocation != nil { - - if swag.IsZero(m.DestinationDutyLocation) { // not required - return nil - } - - if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { - - if m.Entitlement != nil { - - if swag.IsZero(m.Entitlement) { // not required - return nil - } - - if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("entitlement") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("entitlement") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidateMethodOfPayment(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "methodOfPayment", "body", string(m.MethodOfPayment)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateNaics(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "naics", "body", string(m.Naics)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.OrdersType) { // not required - return nil - } - - if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ordersType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ordersType") - } - return err - } - - return nil -} - -func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginDutyLocation != nil { - - if swag.IsZero(m.OriginDutyLocation) { // not required - return nil - } - - if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originDutyLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originDutyLocation") - } - return err - } - } - - return nil -} - -func (m *Order) contextValidatePackingAndShippingInstructions(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "packingAndShippingInstructions", "body", string(m.PackingAndShippingInstructions)); err != nil { - return err - } - - return nil -} - -func (m *Order) contextValidateSupplyAndServicesCostEstimate(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "supplyAndServicesCostEstimate", "body", string(m.SupplyAndServicesCostEstimate)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Order) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Order) UnmarshalBinary(b []byte) error { - var res Order - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/orders_type.go b/pkg/gen/primev3messages/orders_type.go deleted file mode 100644 index ee3a1d78344..00000000000 --- a/pkg/gen/primev3messages/orders_type.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersType Orders type -// -// swagger:model OrdersType -type OrdersType string - -func NewOrdersType(value OrdersType) *OrdersType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersType. -func (m OrdersType) Pointer() *OrdersType { - return &m -} - -const ( - - // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" - OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" - - // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" - OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" - - // OrdersTypeRETIREMENT captures enum value "RETIREMENT" - OrdersTypeRETIREMENT OrdersType = "RETIREMENT" - - // OrdersTypeSEPARATION captures enum value "SEPARATION" - OrdersTypeSEPARATION OrdersType = "SEPARATION" - - // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" - OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" - - // OrdersTypeBLUEBARK captures enum value "BLUEBARK" - OrdersTypeBLUEBARK OrdersType = "BLUEBARK" - - // OrdersTypeSAFETY captures enum value "SAFETY" - OrdersTypeSAFETY OrdersType = "SAFETY" - - // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" - OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" - - // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" - OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" - - // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" - OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" -) - -// for schema -var ordersTypeEnum []interface{} - -func init() { - var res []OrdersType - if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeEnum = append(ordersTypeEnum, v) - } -} - -func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { - if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type -func (m OrdersType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type based on context it is used -func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/p_p_m_destination_address.go b/pkg/gen/primev3messages/p_p_m_destination_address.go deleted file mode 100644 index 8d5640f1047..00000000000 --- a/pkg/gen/primev3messages/p_p_m_destination_address.go +++ /dev/null @@ -1,379 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMDestinationAddress A postal address -// -// swagger:model PPMDestinationAddress -type PPMDestinationAddress struct { - - // City - // Example: Anytown - // Required: true - City *string `json:"city"` - - // Country - // Example: USA - Country *string `json:"country,omitempty"` - - // County - // Example: LOS ANGELES - County *string `json:"county,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // ZIP - // Example: 90210 - // Required: true - // Pattern: ^(\d{5}([\-]\d{4})?)$ - PostalCode *string `json:"postalCode"` - - // State - // Required: true - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State *string `json:"state"` - - // Street address 1 - // Example: 123 Main Ave - StreetAddress1 *string `json:"streetAddress1,omitempty"` - - // Street address 2 - // Example: Apartment 9000 - StreetAddress2 *string `json:"streetAddress2,omitempty"` - - // Address Line 3 - // Example: Montmârtre - StreetAddress3 *string `json:"streetAddress3,omitempty"` - - // us post region cities ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` -} - -// Validate validates this p p m destination address -func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCity(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUsPostRegionCitiesID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { - - if err := validate.Required("city", "body", m.City); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { - - if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { - return err - } - - if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -var pPMDestinationAddressTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) - } -} - -const ( - - // PPMDestinationAddressStateAL captures enum value "AL" - PPMDestinationAddressStateAL string = "AL" - - // PPMDestinationAddressStateAK captures enum value "AK" - PPMDestinationAddressStateAK string = "AK" - - // PPMDestinationAddressStateAR captures enum value "AR" - PPMDestinationAddressStateAR string = "AR" - - // PPMDestinationAddressStateAZ captures enum value "AZ" - PPMDestinationAddressStateAZ string = "AZ" - - // PPMDestinationAddressStateCA captures enum value "CA" - PPMDestinationAddressStateCA string = "CA" - - // PPMDestinationAddressStateCO captures enum value "CO" - PPMDestinationAddressStateCO string = "CO" - - // PPMDestinationAddressStateCT captures enum value "CT" - PPMDestinationAddressStateCT string = "CT" - - // PPMDestinationAddressStateDC captures enum value "DC" - PPMDestinationAddressStateDC string = "DC" - - // PPMDestinationAddressStateDE captures enum value "DE" - PPMDestinationAddressStateDE string = "DE" - - // PPMDestinationAddressStateFL captures enum value "FL" - PPMDestinationAddressStateFL string = "FL" - - // PPMDestinationAddressStateGA captures enum value "GA" - PPMDestinationAddressStateGA string = "GA" - - // PPMDestinationAddressStateHI captures enum value "HI" - PPMDestinationAddressStateHI string = "HI" - - // PPMDestinationAddressStateIA captures enum value "IA" - PPMDestinationAddressStateIA string = "IA" - - // PPMDestinationAddressStateID captures enum value "ID" - PPMDestinationAddressStateID string = "ID" - - // PPMDestinationAddressStateIL captures enum value "IL" - PPMDestinationAddressStateIL string = "IL" - - // PPMDestinationAddressStateIN captures enum value "IN" - PPMDestinationAddressStateIN string = "IN" - - // PPMDestinationAddressStateKS captures enum value "KS" - PPMDestinationAddressStateKS string = "KS" - - // PPMDestinationAddressStateKY captures enum value "KY" - PPMDestinationAddressStateKY string = "KY" - - // PPMDestinationAddressStateLA captures enum value "LA" - PPMDestinationAddressStateLA string = "LA" - - // PPMDestinationAddressStateMA captures enum value "MA" - PPMDestinationAddressStateMA string = "MA" - - // PPMDestinationAddressStateMD captures enum value "MD" - PPMDestinationAddressStateMD string = "MD" - - // PPMDestinationAddressStateME captures enum value "ME" - PPMDestinationAddressStateME string = "ME" - - // PPMDestinationAddressStateMI captures enum value "MI" - PPMDestinationAddressStateMI string = "MI" - - // PPMDestinationAddressStateMN captures enum value "MN" - PPMDestinationAddressStateMN string = "MN" - - // PPMDestinationAddressStateMO captures enum value "MO" - PPMDestinationAddressStateMO string = "MO" - - // PPMDestinationAddressStateMS captures enum value "MS" - PPMDestinationAddressStateMS string = "MS" - - // PPMDestinationAddressStateMT captures enum value "MT" - PPMDestinationAddressStateMT string = "MT" - - // PPMDestinationAddressStateNC captures enum value "NC" - PPMDestinationAddressStateNC string = "NC" - - // PPMDestinationAddressStateND captures enum value "ND" - PPMDestinationAddressStateND string = "ND" - - // PPMDestinationAddressStateNE captures enum value "NE" - PPMDestinationAddressStateNE string = "NE" - - // PPMDestinationAddressStateNH captures enum value "NH" - PPMDestinationAddressStateNH string = "NH" - - // PPMDestinationAddressStateNJ captures enum value "NJ" - PPMDestinationAddressStateNJ string = "NJ" - - // PPMDestinationAddressStateNM captures enum value "NM" - PPMDestinationAddressStateNM string = "NM" - - // PPMDestinationAddressStateNV captures enum value "NV" - PPMDestinationAddressStateNV string = "NV" - - // PPMDestinationAddressStateNY captures enum value "NY" - PPMDestinationAddressStateNY string = "NY" - - // PPMDestinationAddressStateOH captures enum value "OH" - PPMDestinationAddressStateOH string = "OH" - - // PPMDestinationAddressStateOK captures enum value "OK" - PPMDestinationAddressStateOK string = "OK" - - // PPMDestinationAddressStateOR captures enum value "OR" - PPMDestinationAddressStateOR string = "OR" - - // PPMDestinationAddressStatePA captures enum value "PA" - PPMDestinationAddressStatePA string = "PA" - - // PPMDestinationAddressStateRI captures enum value "RI" - PPMDestinationAddressStateRI string = "RI" - - // PPMDestinationAddressStateSC captures enum value "SC" - PPMDestinationAddressStateSC string = "SC" - - // PPMDestinationAddressStateSD captures enum value "SD" - PPMDestinationAddressStateSD string = "SD" - - // PPMDestinationAddressStateTN captures enum value "TN" - PPMDestinationAddressStateTN string = "TN" - - // PPMDestinationAddressStateTX captures enum value "TX" - PPMDestinationAddressStateTX string = "TX" - - // PPMDestinationAddressStateUT captures enum value "UT" - PPMDestinationAddressStateUT string = "UT" - - // PPMDestinationAddressStateVA captures enum value "VA" - PPMDestinationAddressStateVA string = "VA" - - // PPMDestinationAddressStateVT captures enum value "VT" - PPMDestinationAddressStateVT string = "VT" - - // PPMDestinationAddressStateWA captures enum value "WA" - PPMDestinationAddressStateWA string = "WA" - - // PPMDestinationAddressStateWI captures enum value "WI" - PPMDestinationAddressStateWI string = "WI" - - // PPMDestinationAddressStateWV captures enum value "WV" - PPMDestinationAddressStateWV string = "WV" - - // PPMDestinationAddressStateWY captures enum value "WY" - PPMDestinationAddressStateWY string = "WY" -) - -// prop value enum -func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { - - if err := validate.Required("state", "body", m.State); err != nil { - return err - } - - // value enum - if err := m.validateStateEnum("state", "body", *m.State); err != nil { - return err - } - - return nil -} - -func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { - if swag.IsZero(m.UsPostRegionCitiesID) { // not required - return nil - } - - if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m destination address based on the context it is used -func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { - var res PPMDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/p_p_m_shipment.go b/pkg/gen/primev3messages/p_p_m_shipment.go deleted file mode 100644 index a765ef630c1..00000000000 --- a/pkg/gen/primev3messages/p_p_m_shipment.go +++ /dev/null @@ -1,1003 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. -// -// swagger:model PPMShipment -type PPMShipment struct { - - // ZIP - // - // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` - - // The actual start date of when the PPM shipment left the origin. - // Format: date - ActualMoveDate *strfmt.Date `json:"actualMoveDate"` - - // ZIP - // - // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. - // - // Example: 90210 - // Pattern: ^(\d{5})$ - ActualPickupPostalCode *string `json:"actualPickupPostalCode"` - - // The amount received for an advance, or null if no advance is received. - // - AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` - - // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. - // - AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` - - // The timestamp of when the shipment was approved and the service member can begin their move. - // Format: date-time - ApprovedAt *strfmt.DateTime `json:"approvedAt"` - - // The timestamp of when the PPM shipment was created (UTC) - // Required: true - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt"` - - // destination address - // Required: true - DestinationAddress *PPMDestinationAddress `json:"destinationAddress"` - - // destination rate area - DestinationRateArea *RateArea `json:"destinationRateArea,omitempty"` - - // A hash unique to this shipment that should be used as the "If-Match" header for any updates. - // Required: true - // Read Only: true - ETag string `json:"eTag"` - - // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - EstimatedIncentive *int64 `json:"estimatedIncentive"` - - // The estimated weight of the PPM shipment goods being moved in pounds. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Date the customer expects to begin moving from their origin. - // - // Required: true - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear"` - - // Indicates whether an advance was received for the PPM shipment. - // - HasReceivedAdvance *bool `json:"hasReceivedAdvance"` - - // Indicates whether an advance has been requested for the PPM shipment. - // - HasRequestedAdvance *bool `json:"hasRequestedAdvance"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // The primary unique identifier of this PPM shipment - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. - MaxIncentive *int64 `json:"maxIncentive"` - - // origin rate area - OriginRateArea *RateArea `json:"originRateArea,omitempty"` - - // pickup address - // Required: true - PickupAddress *Address `json:"pickupAddress"` - - // The estimated weight of the pro-gear being moved belonging to the service member in pounds. - ProGearWeight *int64 `json:"proGearWeight"` - - // The timestamp of when the Service Counselor has reviewed all of the closeout documents. - // Format: date-time - ReviewedAt *strfmt.DateTime `json:"reviewedAt"` - - // secondary destination address - SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` - - // secondary pickup address - SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` - - // The id of the parent MTOShipment record - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentId"` - - // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. - SitEstimatedCost *int64 `json:"sitEstimatedCost"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` - - // The estimated weight of the goods being put into storage in pounds. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - // Required: true - SitExpected *bool `json:"sitExpected"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. - SpouseProGearWeight *int64 `json:"spouseProGearWeight"` - - // status - // Required: true - Status PPMShipmentStatus `json:"status"` - - // The timestamp of when the customer submitted their PPM documentation to the counselor for review. - // Format: date-time - SubmittedAt *strfmt.DateTime `json:"submittedAt"` - - // tertiary destination address - TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` - - // tertiary pickup address - TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` - - // The timestamp of when a property of this object was last updated (UTC) - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this p p m shipment -func (m *PPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDestinationPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualMoveDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateApprovedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationRateArea(formats); err != nil { - res = append(res, err) - } - - if err := m.validateETag(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginRateArea(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReviewedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitExpected(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSubmittedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDestinationPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualMoveDate) { // not required - return nil - } - - if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupPostalCode) { // not required - return nil - } - - if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ApprovedAt) { // not required - return nil - } - - if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { - - if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - - if err := validate.Required("destinationAddress", "body", m.DestinationAddress); err != nil { - return err - } - - if m.DestinationAddress != nil { - if err := m.DestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateDestinationRateArea(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationRateArea) { // not required - return nil - } - - if m.DestinationRateArea != nil { - if err := m.DestinationRateArea.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationRateArea") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateETag(formats strfmt.Registry) error { - - if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - - if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { - return err - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateOriginRateArea(formats strfmt.Registry) error { - if swag.IsZero(m.OriginRateArea) { // not required - return nil - } - - if m.OriginRateArea != nil { - if err := m.OriginRateArea.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originRateArea") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { - - if err := validate.Required("pickupAddress", "body", m.PickupAddress); err != nil { - return err - } - - if m.PickupAddress != nil { - if err := m.PickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { - if swag.IsZero(m.ReviewedAt) { // not required - return nil - } - - if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if m.SecondaryDestinationAddress != nil { - if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if m.SecondaryPickupAddress != nil { - if err := m.SecondaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { - - if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { - if swag.IsZero(m.SubmittedAt) { // not required - return nil - } - - if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if m.TertiaryDestinationAddress != nil { - if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if m.TertiaryPickupAddress != nil { - if err := m.TertiaryPickupAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this p p m shipment based on the context it is used -func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationRateArea(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginRateArea(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationAddress != nil { - - if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateDestinationRateArea(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationRateArea != nil { - - if swag.IsZero(m.DestinationRateArea) { // not required - return nil - } - - if err := m.DestinationRateArea.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationRateArea") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateOriginRateArea(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginRateArea != nil { - - if swag.IsZero(m.OriginRateArea) { // not required - return nil - } - - if err := m.OriginRateArea.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originRateArea") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originRateArea") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.PickupAddress != nil { - - if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("pickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("pickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryDestinationAddress != nil { - - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SecondaryPickupAddress != nil { - - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("secondaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("secondaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryDestinationAddress != nil { - - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryDestinationAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryDestinationAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.TertiaryPickupAddress != nil { - - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("tertiaryPickupAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("tertiaryPickupAddress") - } - return err - } - } - - return nil -} - -func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PPMShipment) UnmarshalBinary(b []byte) error { - var res PPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/p_p_m_shipment_status.go b/pkg/gen/primev3messages/p_p_m_shipment_status.go deleted file mode 100644 index a2f5bd086cd..00000000000 --- a/pkg/gen/primev3messages/p_p_m_shipment_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PPMShipmentStatus Status of the PPM Shipment: -// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. -// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. -// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. -// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. -// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. -// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. -// -// swagger:model PPMShipmentStatus -type PPMShipmentStatus string - -func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. -func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { - return &m -} - -const ( - - // PPMShipmentStatusDRAFT captures enum value "DRAFT" - PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" - - // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" - PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" - - // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" - PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" - - // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" - PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" - - // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" - PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" - - // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" - PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" - - // PPMShipmentStatusCANCELED captures enum value "CANCELED" - PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" -) - -// for schema -var pPMShipmentStatusEnum []interface{} - -func init() { - var res []PPMShipmentStatus - if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) - } -} - -func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { - if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this p p m shipment status -func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this p p m shipment status based on the context it is used -func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/payment_request.go b/pkg/gen/primev3messages/payment_request.go deleted file mode 100644 index e40d082f0c1..00000000000 --- a/pkg/gen/primev3messages/payment_request.go +++ /dev/null @@ -1,322 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // payment service items - PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` - - // proof of service docs - ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItems(formats); err != nil { - res = append(res, err) - } - - if err := m.validateProofOfServiceDocs(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItems) { // not required - return nil - } - - if err := m.PaymentServiceItems.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { - if swag.IsZero(m.ProofOfServiceDocs) { // not required - return nil - } - - if err := m.ProofOfServiceDocs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItems") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItems") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("proofOfServiceDocs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("proofOfServiceDocs") - } - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/payment_request_status.go b/pkg/gen/primev3messages/payment_request_status.go deleted file mode 100644 index 9299eb2f459..00000000000 --- a/pkg/gen/primev3messages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" - PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/payment_requests.go b/pkg/gen/primev3messages/payment_requests.go deleted file mode 100644 index b538872d415..00000000000 --- a/pkg/gen/primev3messages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/payment_service_item.go b/pkg/gen/primev3messages/payment_service_item.go deleted file mode 100644 index 28d555821a5..00000000000 --- a/pkg/gen/primev3messages/payment_service_item.go +++ /dev/null @@ -1,266 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItem payment service item -// -// swagger:model PaymentServiceItem -type PaymentServiceItem struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` - - // payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // payment service item params - PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` - - // Price of the service item in cents - PriceCents *int64 `json:"priceCents,omitempty"` - - // reference ID - // Example: 1234-5678-c56a4180 - // Read Only: true - ReferenceID string `json:"referenceID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentServiceItemStatus `json:"status,omitempty"` -} - -// Validate validates this payment service item -func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemParams) { // not required - return nil - } - - if err := m.PaymentServiceItemParams.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item based on the context it is used -func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateReferenceID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { - - if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("paymentServiceItemParams") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("paymentServiceItemParams") - } - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { - var res PaymentServiceItem - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/payment_service_item_param.go b/pkg/gen/primev3messages/payment_service_item_param.go deleted file mode 100644 index 7ae30092a6a..00000000000 --- a/pkg/gen/primev3messages/payment_service_item_param.go +++ /dev/null @@ -1,274 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemParam payment service item param -// -// swagger:model PaymentServiceItemParam -type PaymentServiceItemParam struct { - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // key - Key ServiceItemParamName `json:"key,omitempty"` - - // origin - Origin ServiceItemParamOrigin `json:"origin,omitempty"` - - // payment service item ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` - - // type - Type ServiceItemParamType `json:"type,omitempty"` - - // value - // Example: 3025 - Value string `json:"value,omitempty"` -} - -// Validate validates this payment service item param -func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateKey(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOrigin(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentServiceItemID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateType(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentServiceItemID) { // not required - return nil - } - - if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// ContextValidate validate this payment service item param based on the context it is used -func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateKey(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOrigin(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Key) { // not required - return nil - } - - if err := m.Key.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("key") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("key") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Origin) { // not required - return nil - } - - if err := m.Origin.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("origin") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("origin") - } - return err - } - - return nil -} - -func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Type) { // not required - return nil - } - - if err := m.Type.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("type") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("type") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { - var res PaymentServiceItemParam - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/payment_service_item_params.go b/pkg/gen/primev3messages/payment_service_item_params.go deleted file mode 100644 index 1d7582daf0b..00000000000 --- a/pkg/gen/primev3messages/payment_service_item_params.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItemParams payment service item params -// -// swagger:model PaymentServiceItemParams -type PaymentServiceItemParams []*PaymentServiceItemParam - -// Validate validates this payment service item params -func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service item params based on the context it is used -func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/payment_service_item_status.go b/pkg/gen/primev3messages/payment_service_item_status.go deleted file mode 100644 index ba7c8ae4688..00000000000 --- a/pkg/gen/primev3messages/payment_service_item_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentServiceItemStatus Payment Service Item Status -// -// swagger:model PaymentServiceItemStatus -type PaymentServiceItemStatus string - -func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. -func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { - return &m -} - -const ( - - // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" - PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" - - // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" - PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" - - // PaymentServiceItemStatusDENIED captures enum value "DENIED" - PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" - - // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" - - // PaymentServiceItemStatusPAID captures enum value "PAID" - PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" - - // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" - PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" -) - -// for schema -var paymentServiceItemStatusEnum []interface{} - -func init() { - var res []PaymentServiceItemStatus - if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) - } -} - -func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { - if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment service item status -func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment service item status based on context it is used -func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/payment_service_items.go b/pkg/gen/primev3messages/payment_service_items.go deleted file mode 100644 index cd984ba3eb9..00000000000 --- a/pkg/gen/primev3messages/payment_service_items.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentServiceItems payment service items -// -// swagger:model PaymentServiceItems -type PaymentServiceItems []*PaymentServiceItem - -// Validate validates this payment service items -func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment service items based on the context it is used -func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/port.go b/pkg/gen/primev3messages/port.go deleted file mode 100644 index f511e6b8198..00000000000 --- a/pkg/gen/primev3messages/port.go +++ /dev/null @@ -1,385 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Port A port that is used to move an international shipment. -// -// swagger:model Port -type Port struct { - - // city - // Example: PORTLAND - City string `json:"city,omitempty"` - - // Two-letter country code - // Example: US - // Pattern: ^[A-Z]{2}$ - Country string `json:"country,omitempty"` - - // county - // Example: MULTNOMAH - County string `json:"county,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // 3 or 4 digit port code - // Example: 0431 - PortCode string `json:"portCode,omitempty"` - - // Name of the port - // Example: PORTLAND INTL - PortName string `json:"portName,omitempty"` - - // Port type A (Air), B (Border Crossing), S (Sea) - // Enum: [A B S] - PortType string `json:"portType,omitempty"` - - // US state - // Example: OR - // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] - State string `json:"state,omitempty"` - - // ZIP - // Example: 99501 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - Zip string `json:"zip,omitempty"` -} - -// Validate validates this port -func (m *Port) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCountry(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateState(formats); err != nil { - res = append(res, err) - } - - if err := m.validateZip(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Port) validateCountry(formats strfmt.Registry) error { - if swag.IsZero(m.Country) { // not required - return nil - } - - if err := validate.Pattern("country", "body", m.Country, `^[A-Z]{2}$`); err != nil { - return err - } - - return nil -} - -func (m *Port) 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 -} - -var portTypePortTypePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["A","B","S"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - portTypePortTypePropEnum = append(portTypePortTypePropEnum, v) - } -} - -const ( - - // PortPortTypeA captures enum value "A" - PortPortTypeA string = "A" - - // PortPortTypeB captures enum value "B" - PortPortTypeB string = "B" - - // PortPortTypeS captures enum value "S" - PortPortTypeS string = "S" -) - -// prop value enum -func (m *Port) validatePortTypeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, portTypePortTypePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Port) validatePortType(formats strfmt.Registry) error { - if swag.IsZero(m.PortType) { // not required - return nil - } - - // value enum - if err := m.validatePortTypeEnum("portType", "body", m.PortType); err != nil { - return err - } - - return nil -} - -var portTypeStatePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - portTypeStatePropEnum = append(portTypeStatePropEnum, v) - } -} - -const ( - - // PortStateAL captures enum value "AL" - PortStateAL string = "AL" - - // PortStateAK captures enum value "AK" - PortStateAK string = "AK" - - // PortStateAR captures enum value "AR" - PortStateAR string = "AR" - - // PortStateAZ captures enum value "AZ" - PortStateAZ string = "AZ" - - // PortStateCA captures enum value "CA" - PortStateCA string = "CA" - - // PortStateCO captures enum value "CO" - PortStateCO string = "CO" - - // PortStateCT captures enum value "CT" - PortStateCT string = "CT" - - // PortStateDC captures enum value "DC" - PortStateDC string = "DC" - - // PortStateDE captures enum value "DE" - PortStateDE string = "DE" - - // PortStateFL captures enum value "FL" - PortStateFL string = "FL" - - // PortStateGA captures enum value "GA" - PortStateGA string = "GA" - - // PortStateHI captures enum value "HI" - PortStateHI string = "HI" - - // PortStateIA captures enum value "IA" - PortStateIA string = "IA" - - // PortStateID captures enum value "ID" - PortStateID string = "ID" - - // PortStateIL captures enum value "IL" - PortStateIL string = "IL" - - // PortStateIN captures enum value "IN" - PortStateIN string = "IN" - - // PortStateKS captures enum value "KS" - PortStateKS string = "KS" - - // PortStateKY captures enum value "KY" - PortStateKY string = "KY" - - // PortStateLA captures enum value "LA" - PortStateLA string = "LA" - - // PortStateMA captures enum value "MA" - PortStateMA string = "MA" - - // PortStateMD captures enum value "MD" - PortStateMD string = "MD" - - // PortStateME captures enum value "ME" - PortStateME string = "ME" - - // PortStateMI captures enum value "MI" - PortStateMI string = "MI" - - // PortStateMN captures enum value "MN" - PortStateMN string = "MN" - - // PortStateMO captures enum value "MO" - PortStateMO string = "MO" - - // PortStateMS captures enum value "MS" - PortStateMS string = "MS" - - // PortStateMT captures enum value "MT" - PortStateMT string = "MT" - - // PortStateNC captures enum value "NC" - PortStateNC string = "NC" - - // PortStateND captures enum value "ND" - PortStateND string = "ND" - - // PortStateNE captures enum value "NE" - PortStateNE string = "NE" - - // PortStateNH captures enum value "NH" - PortStateNH string = "NH" - - // PortStateNJ captures enum value "NJ" - PortStateNJ string = "NJ" - - // PortStateNM captures enum value "NM" - PortStateNM string = "NM" - - // PortStateNV captures enum value "NV" - PortStateNV string = "NV" - - // PortStateNY captures enum value "NY" - PortStateNY string = "NY" - - // PortStateOH captures enum value "OH" - PortStateOH string = "OH" - - // PortStateOK captures enum value "OK" - PortStateOK string = "OK" - - // PortStateOR captures enum value "OR" - PortStateOR string = "OR" - - // PortStatePA captures enum value "PA" - PortStatePA string = "PA" - - // PortStateRI captures enum value "RI" - PortStateRI string = "RI" - - // PortStateSC captures enum value "SC" - PortStateSC string = "SC" - - // PortStateSD captures enum value "SD" - PortStateSD string = "SD" - - // PortStateTN captures enum value "TN" - PortStateTN string = "TN" - - // PortStateTX captures enum value "TX" - PortStateTX string = "TX" - - // PortStateUT captures enum value "UT" - PortStateUT string = "UT" - - // PortStateVA captures enum value "VA" - PortStateVA string = "VA" - - // PortStateVT captures enum value "VT" - PortStateVT string = "VT" - - // PortStateWA captures enum value "WA" - PortStateWA string = "WA" - - // PortStateWI captures enum value "WI" - PortStateWI string = "WI" - - // PortStateWV captures enum value "WV" - PortStateWV string = "WV" - - // PortStateWY captures enum value "WY" - PortStateWY string = "WY" -) - -// prop value enum -func (m *Port) validateStateEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, portTypeStatePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *Port) validateState(formats strfmt.Registry) error { - if swag.IsZero(m.State) { // not required - return nil - } - - // value enum - if err := m.validateStateEnum("state", "body", m.State); err != nil { - return err - } - - return nil -} - -func (m *Port) validateZip(formats strfmt.Registry) error { - if swag.IsZero(m.Zip) { // not required - return nil - } - - if err := validate.Pattern("zip", "body", m.Zip, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this port based on context it is used -func (m *Port) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *Port) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Port) UnmarshalBinary(b []byte) error { - var res Port - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/proof_of_service_doc.go b/pkg/gen/primev3messages/proof_of_service_doc.go deleted file mode 100644 index 41e1eb3b878..00000000000 --- a/pkg/gen/primev3messages/proof_of_service_doc.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDoc proof of service doc -// -// swagger:model ProofOfServiceDoc -type ProofOfServiceDoc struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this proof of service doc -func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service doc based on the context it is used -func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { - var res ProofOfServiceDoc - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/proof_of_service_docs.go b/pkg/gen/primev3messages/proof_of_service_docs.go deleted file mode 100644 index 352538736d6..00000000000 --- a/pkg/gen/primev3messages/proof_of_service_docs.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ProofOfServiceDocs proof of service docs -// -// swagger:model ProofOfServiceDocs -type ProofOfServiceDocs []*ProofOfServiceDoc - -// Validate validates this proof of service docs -func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this proof of service docs based on the context it is used -func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/rate_area.go b/pkg/gen/primev3messages/rate_area.go deleted file mode 100644 index 2d98c400ebb..00000000000 --- a/pkg/gen/primev3messages/rate_area.go +++ /dev/null @@ -1,113 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// RateArea Rate area info for OCONUS postal code -// -// swagger:model RateArea -type RateArea struct { - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Required: true - // Format: uuid - ID *strfmt.UUID `json:"id"` - - // Rate area code - // Example: US8101000 - // Required: true - RateAreaID *string `json:"rateAreaId"` - - // Rate area name - // Example: Alaska (Zone) I - // Required: true - RateAreaName *string `json:"rateAreaName"` -} - -// Validate validates this rate area -func (m *RateArea) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRateAreaID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRateAreaName(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *RateArea) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", m.ID); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *RateArea) validateRateAreaID(formats strfmt.Registry) error { - - if err := validate.Required("rateAreaId", "body", m.RateAreaID); err != nil { - return err - } - - return nil -} - -func (m *RateArea) validateRateAreaName(formats strfmt.Registry) error { - - if err := validate.Required("rateAreaName", "body", m.RateAreaName); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this rate area based on context it is used -func (m *RateArea) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *RateArea) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *RateArea) UnmarshalBinary(b []byte) error { - var res RateArea - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/re_service_code.go b/pkg/gen/primev3messages/re_service_code.go deleted file mode 100644 index 2028866f693..00000000000 --- a/pkg/gen/primev3messages/re_service_code.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items -// may be requested by the Prime, but may be returned in a response. -// -// Documentation of all the service items will be provided. -// -// swagger:model ReServiceCode -type ReServiceCode string - -func NewReServiceCode(value ReServiceCode) *ReServiceCode { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReServiceCode. -func (m ReServiceCode) Pointer() *ReServiceCode { - return &m -} - -const ( - - // ReServiceCodeCS captures enum value "CS" - ReServiceCodeCS ReServiceCode = "CS" - - // ReServiceCodeDBHF captures enum value "DBHF" - ReServiceCodeDBHF ReServiceCode = "DBHF" - - // ReServiceCodeDBTF captures enum value "DBTF" - ReServiceCodeDBTF ReServiceCode = "DBTF" - - // ReServiceCodeDCRT captures enum value "DCRT" - ReServiceCodeDCRT ReServiceCode = "DCRT" - - // ReServiceCodeDDASIT captures enum value "DDASIT" - ReServiceCodeDDASIT ReServiceCode = "DDASIT" - - // ReServiceCodeDDDSIT captures enum value "DDDSIT" - ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" - - // ReServiceCodeDDFSIT captures enum value "DDFSIT" - ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" - - // ReServiceCodeDDP captures enum value "DDP" - ReServiceCodeDDP ReServiceCode = "DDP" - - // ReServiceCodeDDSHUT captures enum value "DDSHUT" - ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" - - // ReServiceCodeDLH captures enum value "DLH" - ReServiceCodeDLH ReServiceCode = "DLH" - - // ReServiceCodeDMHF captures enum value "DMHF" - ReServiceCodeDMHF ReServiceCode = "DMHF" - - // ReServiceCodeDNPK captures enum value "DNPK" - ReServiceCodeDNPK ReServiceCode = "DNPK" - - // ReServiceCodeDOASIT captures enum value "DOASIT" - ReServiceCodeDOASIT ReServiceCode = "DOASIT" - - // ReServiceCodeDOFSIT captures enum value "DOFSIT" - ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" - - // ReServiceCodeDOP captures enum value "DOP" - ReServiceCodeDOP ReServiceCode = "DOP" - - // ReServiceCodeDOPSIT captures enum value "DOPSIT" - ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" - - // ReServiceCodeDOSHUT captures enum value "DOSHUT" - ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" - - // ReServiceCodeDPK captures enum value "DPK" - ReServiceCodeDPK ReServiceCode = "DPK" - - // ReServiceCodeDSH captures enum value "DSH" - ReServiceCodeDSH ReServiceCode = "DSH" - - // ReServiceCodeDUCRT captures enum value "DUCRT" - ReServiceCodeDUCRT ReServiceCode = "DUCRT" - - // ReServiceCodeDUPK captures enum value "DUPK" - ReServiceCodeDUPK ReServiceCode = "DUPK" - - // ReServiceCodeFSC captures enum value "FSC" - ReServiceCodeFSC ReServiceCode = "FSC" - - // ReServiceCodeIBHF captures enum value "IBHF" - ReServiceCodeIBHF ReServiceCode = "IBHF" - - // ReServiceCodeIBTF captures enum value "IBTF" - ReServiceCodeIBTF ReServiceCode = "IBTF" - - // ReServiceCodeICOLH captures enum value "ICOLH" - ReServiceCodeICOLH ReServiceCode = "ICOLH" - - // ReServiceCodeICOUB captures enum value "ICOUB" - ReServiceCodeICOUB ReServiceCode = "ICOUB" - - // ReServiceCodeICRT captures enum value "ICRT" - ReServiceCodeICRT ReServiceCode = "ICRT" - - // ReServiceCodeIDASIT captures enum value "IDASIT" - ReServiceCodeIDASIT ReServiceCode = "IDASIT" - - // ReServiceCodeIDDSIT captures enum value "IDDSIT" - ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" - - // ReServiceCodeIDFSIT captures enum value "IDFSIT" - ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" - - // ReServiceCodeIDSHUT captures enum value "IDSHUT" - ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" - - // ReServiceCodeIHPK captures enum value "IHPK" - ReServiceCodeIHPK ReServiceCode = "IHPK" - - // ReServiceCodeIHUPK captures enum value "IHUPK" - ReServiceCodeIHUPK ReServiceCode = "IHUPK" - - // ReServiceCodeINPK captures enum value "INPK" - ReServiceCodeINPK ReServiceCode = "INPK" - - // ReServiceCodeIOASIT captures enum value "IOASIT" - ReServiceCodeIOASIT ReServiceCode = "IOASIT" - - // ReServiceCodeIOCLH captures enum value "IOCLH" - ReServiceCodeIOCLH ReServiceCode = "IOCLH" - - // ReServiceCodeIOCUB captures enum value "IOCUB" - ReServiceCodeIOCUB ReServiceCode = "IOCUB" - - // ReServiceCodeIOFSIT captures enum value "IOFSIT" - ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" - - // ReServiceCodeIOOLH captures enum value "IOOLH" - ReServiceCodeIOOLH ReServiceCode = "IOOLH" - - // ReServiceCodeIOOUB captures enum value "IOOUB" - ReServiceCodeIOOUB ReServiceCode = "IOOUB" - - // ReServiceCodeIOPSIT captures enum value "IOPSIT" - ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" - - // ReServiceCodeIOSHUT captures enum value "IOSHUT" - ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" - - // ReServiceCodeIUBPK captures enum value "IUBPK" - ReServiceCodeIUBPK ReServiceCode = "IUBPK" - - // ReServiceCodeIUBUPK captures enum value "IUBUPK" - ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" - - // ReServiceCodeIUCRT captures enum value "IUCRT" - ReServiceCodeIUCRT ReServiceCode = "IUCRT" - - // ReServiceCodeMS captures enum value "MS" - ReServiceCodeMS ReServiceCode = "MS" - - // ReServiceCodeNSTH captures enum value "NSTH" - ReServiceCodeNSTH ReServiceCode = "NSTH" - - // ReServiceCodeNSTUB captures enum value "NSTUB" - ReServiceCodeNSTUB ReServiceCode = "NSTUB" -) - -// for schema -var reServiceCodeEnum []interface{} - -func init() { - var res []ReServiceCode - if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceCodeEnum = append(reServiceCodeEnum, v) - } -} - -func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { - if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this re service code -func (m ReServiceCode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReServiceCodeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this re service code based on context it is used -func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/reweigh.go b/pkg/gen/primev3messages/reweigh.go deleted file mode 100644 index 8e89006727c..00000000000 --- a/pkg/gen/primev3messages/reweigh.go +++ /dev/null @@ -1,280 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. -// -// swagger:model Reweigh -type Reweigh struct { - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // requested at - // Format: date-time - RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` - - // requested by - RequestedBy ReweighRequester `json:"requestedBy,omitempty"` - - // shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // verification provided at - // Format: date-time - VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` - - // verification reason - // Example: The reweigh was not performed due to some justification provided by the Prime - VerificationReason *string `json:"verificationReason"` - - // weight - // Example: 2000 - Weight *int64 `json:"weight"` -} - -// Validate validates this reweigh -func (m *Reweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestedBy(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateVerificationProvidedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedAt) { // not required - return nil - } - - if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { - if swag.IsZero(m.VerificationProvidedAt) { // not required - return nil - } - - if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this reweigh based on the context it is used -func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRequestedBy(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.RequestedBy) { // not required - return nil - } - - if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("requestedBy") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("requestedBy") - } - return err - } - - return nil -} - -func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *Reweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *Reweigh) UnmarshalBinary(b []byte) error { - var res Reweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/reweigh_requester.go b/pkg/gen/primev3messages/reweigh_requester.go deleted file mode 100644 index 80d6638790e..00000000000 --- a/pkg/gen/primev3messages/reweigh_requester.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReweighRequester reweigh requester -// -// swagger:model ReweighRequester -type ReweighRequester string - -func NewReweighRequester(value ReweighRequester) *ReweighRequester { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReweighRequester. -func (m ReweighRequester) Pointer() *ReweighRequester { - return &m -} - -const ( - - // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" - ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" - - // ReweighRequesterPRIME captures enum value "PRIME" - ReweighRequesterPRIME ReweighRequester = "PRIME" - - // ReweighRequesterSYSTEM captures enum value "SYSTEM" - ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" - - // ReweighRequesterTOO captures enum value "TOO" - ReweighRequesterTOO ReweighRequester = "TOO" -) - -// for schema -var reweighRequesterEnum []interface{} - -func init() { - var res []ReweighRequester - if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reweighRequesterEnum = append(reweighRequesterEnum, v) - } -} - -func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { - if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this reweigh requester -func (m ReweighRequester) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReweighRequesterEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this reweigh requester based on context it is used -func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/s_i_t_extension.go b/pkg/gen/primev3messages/s_i_t_extension.go deleted file mode 100644 index e311a2ec746..00000000000 --- a/pkg/gen/primev3messages/s_i_t_extension.go +++ /dev/null @@ -1,291 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. -// -// swagger:model SITExtension -type SITExtension struct { - - // approved days - // Example: 30 - ApprovedDays *int64 `json:"approvedDays"` - - // contractor remarks - // Example: We need SIT additional days. The customer has not found a house yet. - ContractorRemarks *string `json:"contractorRemarks"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // decision date - // Format: date-time - DecisionDate *strfmt.DateTime `json:"decisionDate"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // mto shipment ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` - - // office remarks - OfficeRemarks *string `json:"officeRemarks"` - - // request reason - // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] - RequestReason string `json:"requestReason,omitempty"` - - // requested days - // Example: 30 - RequestedDays int64 `json:"requestedDays,omitempty"` - - // status - // Enum: [PENDING APPROVED DENIED] - Status interface{} `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this s i t extension -func (m *SITExtension) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDecisionDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMtoShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRequestReason(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { - if swag.IsZero(m.DecisionDate) { // not required - return nil - } - - if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { - if swag.IsZero(m.MtoShipmentID) { // not required - return nil - } - - if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -var sITExtensionTypeRequestReasonPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) - } -} - -const ( - - // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" - SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" - - // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" - SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" - - // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" - SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" - - // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" - SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" - - // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" - - // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" - SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" - - // SITExtensionRequestReasonOTHER captures enum value "OTHER" - SITExtensionRequestReasonOTHER string = "OTHER" -) - -// prop value enum -func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { - if swag.IsZero(m.RequestReason) { // not required - return nil - } - - // value enum - if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this s i t extension based on the context it is used -func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *SITExtension) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *SITExtension) UnmarshalBinary(b []byte) error { - var res SITExtension - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/s_i_t_extensions.go b/pkg/gen/primev3messages/s_i_t_extensions.go deleted file mode 100644 index bb884e12a92..00000000000 --- a/pkg/gen/primev3messages/s_i_t_extensions.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// SITExtensions s i t extensions -// -// swagger:model SITExtensions -type SITExtensions []*SITExtension - -// Validate validates this s i t extensions -func (m SITExtensions) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this s i t extensions based on the context it is used -func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/s_i_t_location_type.go b/pkg/gen/primev3messages/s_i_t_location_type.go deleted file mode 100644 index c4b856e95b2..00000000000 --- a/pkg/gen/primev3messages/s_i_t_location_type.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// SITLocationType The list of SIT location types. -// -// swagger:model SITLocationType -type SITLocationType string - -func NewSITLocationType(value SITLocationType) *SITLocationType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated SITLocationType. -func (m SITLocationType) Pointer() *SITLocationType { - return &m -} - -const ( - - // SITLocationTypeORIGIN captures enum value "ORIGIN" - SITLocationTypeORIGIN SITLocationType = "ORIGIN" - - // SITLocationTypeDESTINATION captures enum value "DESTINATION" - SITLocationTypeDESTINATION SITLocationType = "DESTINATION" -) - -// for schema -var sITLocationTypeEnum []interface{} - -func init() { - var res []SITLocationType - if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - sITLocationTypeEnum = append(sITLocationTypeEnum, v) - } -} - -func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { - if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this s i t location type -func (m SITLocationType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this s i t location type based on context it is used -func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/service_item_param_name.go b/pkg/gen/primev3messages/service_item_param_name.go deleted file mode 100644 index a7e2fdf7ea3..00000000000 --- a/pkg/gen/primev3messages/service_item_param_name.go +++ /dev/null @@ -1,282 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamName service item param name -// -// swagger:model ServiceItemParamName -type ServiceItemParamName string - -func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. -func (m ServiceItemParamName) Pointer() *ServiceItemParamName { - return &m -} - -const ( - - // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" - ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" - - // ServiceItemParamNameContractCode captures enum value "ContractCode" - ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" - - // ServiceItemParamNameContractYearName captures enum value "ContractYearName" - ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" - - // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" - ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" - - // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" - ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" - - // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" - ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" - - // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" - ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" - - // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" - ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" - - // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" - ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" - - // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" - ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" - - // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" - ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" - - // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" - ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" - - // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" - ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" - - // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" - ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" - - // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" - ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" - - // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" - ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" - - // ServiceItemParamNameIsPeak captures enum value "IsPeak" - ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" - - // ServiceItemParamNameMarketDest captures enum value "MarketDest" - ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" - - // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" - ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" - - // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" - ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" - - // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" - ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" - - // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" - ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" - - // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" - ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" - - // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" - ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" - - // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" - ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" - - // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" - ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" - - // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" - ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" - - // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" - ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" - - // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" - ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" - - // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" - ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" - - // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" - ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" - - // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" - ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" - - // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" - ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" - - // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" - ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" - - // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" - ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" - ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" - - // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" - ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" - - // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" - - // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" - ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" - - // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" - ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" - - // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" - ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" - - // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" - ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" - - // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" - ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" - - // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" - ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" - - // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" - ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" - - // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" - ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" - - // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" - ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" - - // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" - ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" - - // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" - ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" - - // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" - ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" - - // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" - ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" - - // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" - ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" - - // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" - ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" - - // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" - ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" - - // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" - ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" - - // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" - ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" - - // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" - ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" - - // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" - ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" - - // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" - ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" - - // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" - ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" - - // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" - ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" - - // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" - ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" - - // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" - ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" - - // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" - ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" - - // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" - ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" - - // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" - ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" - - // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" - ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" - - // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" - ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" - - // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" - ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" -) - -// for schema -var serviceItemParamNameEnum []interface{} - -func init() { - var res []ServiceItemParamName - if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) - } -} - -func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { - if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param name -func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param name based on context it is used -func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/service_item_param_origin.go b/pkg/gen/primev3messages/service_item_param_origin.go deleted file mode 100644 index da97243453f..00000000000 --- a/pkg/gen/primev3messages/service_item_param_origin.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamOrigin service item param origin -// -// swagger:model ServiceItemParamOrigin -type ServiceItemParamOrigin string - -func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. -func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { - return &m -} - -const ( - - // ServiceItemParamOriginPRIME captures enum value "PRIME" - ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" - - // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" - ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" - - // ServiceItemParamOriginPRICER captures enum value "PRICER" - ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" - - // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" - ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" -) - -// for schema -var serviceItemParamOriginEnum []interface{} - -func init() { - var res []ServiceItemParamOrigin - if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) - } -} - -func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { - if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param origin -func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param origin based on context it is used -func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/service_item_param_type.go b/pkg/gen/primev3messages/service_item_param_type.go deleted file mode 100644 index 487524f3bf4..00000000000 --- a/pkg/gen/primev3messages/service_item_param_type.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ServiceItemParamType service item param type -// -// swagger:model ServiceItemParamType -type ServiceItemParamType string - -func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. -func (m ServiceItemParamType) Pointer() *ServiceItemParamType { - return &m -} - -const ( - - // ServiceItemParamTypeSTRING captures enum value "STRING" - ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" - - // ServiceItemParamTypeDATE captures enum value "DATE" - ServiceItemParamTypeDATE ServiceItemParamType = "DATE" - - // ServiceItemParamTypeINTEGER captures enum value "INTEGER" - ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" - - // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" - ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" - - // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" - ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" - - // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" - ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" - - // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" - ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" -) - -// for schema -var serviceItemParamTypeEnum []interface{} - -func init() { - var res []ServiceItemParamType - if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) - } -} - -func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { - if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this service item param type -func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this service item param type based on context it is used -func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/service_request_document.go b/pkg/gen/primev3messages/service_request_document.go deleted file mode 100644 index 33f7037ba64..00000000000 --- a/pkg/gen/primev3messages/service_request_document.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocument service request document -// -// swagger:model ServiceRequestDocument -type ServiceRequestDocument struct { - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this service request document -func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this service request document based on the context it is used -func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { - var res ServiceRequestDocument - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/service_request_documents.go b/pkg/gen/primev3messages/service_request_documents.go deleted file mode 100644 index 26f5acb9a4c..00000000000 --- a/pkg/gen/primev3messages/service_request_documents.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// ServiceRequestDocuments service request documents -// -// swagger:model ServiceRequestDocuments -type ServiceRequestDocuments []*ServiceRequestDocument - -// Validate validates this service request documents -func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this service request documents based on the context it is used -func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/shipment_address_update.go b/pkg/gen/primev3messages/shipment_address_update.go deleted file mode 100644 index f18dd49e3ee..00000000000 --- a/pkg/gen/primev3messages/shipment_address_update.go +++ /dev/null @@ -1,408 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. -// -// swagger:model ShipmentAddressUpdate -type ShipmentAddressUpdate struct { - - // Contractor Remarks - // - // The reason there is an address change. - // Example: This is a contractor remark - // Required: true - // Read Only: true - ContractorRemarks string `json:"contractorRemarks"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` - - // The distance between the original SIT address and requested new delivery address of shipment - // Example: 88 - // Minimum: 0 - NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` - - // Office Remarks - // - // The TOO comment on approval or rejection. - // Example: This is an office remark - OfficeRemarks *string `json:"officeRemarks,omitempty"` - - // The distance between the original SIT address and the previous/old delivery address of shipment - // Example: 50 - // Minimum: 0 - OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` - - // original address - // Required: true - OriginalAddress *Address `json:"originalAddress"` - - // shipment ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Required: true - // Read Only: true - // Format: uuid - ShipmentID strfmt.UUID `json:"shipmentID"` - - // sit original address - SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` - - // status - // Required: true - Status ShipmentAddressUpdateStatus `json:"status"` -} - -// Validate validates this shipment address update -func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOldSitDistanceBetween(formats); err != nil { - res = append(res, err) - } - - if err := m.validateOriginalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { - - if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.NewSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { - if swag.IsZero(m.OldSitDistanceBetween) { // not required - return nil - } - - if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { - - if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { - return err - } - - if m.OriginalAddress != nil { - if err := m.OriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { - - if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if m.SitOriginalAddress != nil { - if err := m.SitOriginalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { - - if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { - return err - } - - if err := m.Status.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this shipment address update based on the context it is used -func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.OriginalAddress != nil { - - if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("originalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("originalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { - return err - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitOriginalAddress != nil { - - if swag.IsZero(m.SitOriginalAddress) { // not required - return nil - } - - if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitOriginalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitOriginalAddress") - } - return err - } - } - - return nil -} - -func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { - var res ShipmentAddressUpdate - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/shipment_address_update_status.go b/pkg/gen/primev3messages/shipment_address_update_status.go deleted file mode 100644 index f6c854c1095..00000000000 --- a/pkg/gen/primev3messages/shipment_address_update_status.go +++ /dev/null @@ -1,90 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ShipmentAddressUpdateStatus Status -// -// swagger:model ShipmentAddressUpdateStatus -type ShipmentAddressUpdateStatus string - -func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. -func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { - return &m -} - -const ( - - // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" - ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" - - // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" - ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" - - // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" - ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" -) - -// for schema -var shipmentAddressUpdateStatusEnum []interface{} - -func init() { - var res []ShipmentAddressUpdateStatus - if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) - } -} - -func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { - if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this shipment address update status -func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this shipment address update status based on the context it is used -func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/primev3messages/storage_facility.go b/pkg/gen/primev3messages/storage_facility.go deleted file mode 100644 index ca0fb229cd4..00000000000 --- a/pkg/gen/primev3messages/storage_facility.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// StorageFacility The Storage Facility information for the shipment -// -// swagger:model StorageFacility -type StorageFacility struct { - - // address - Address *Address `json:"address,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // email - // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ - Email *string `json:"email,omitempty"` - - // facility name - FacilityName string `json:"facilityName,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // lot number - LotNumber *string `json:"lotNumber,omitempty"` - - // phone - // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ - Phone *string `json:"phone,omitempty"` -} - -// Validate validates this storage facility -func (m *StorageFacility) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateEmail(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePhone(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { - if swag.IsZero(m.Address) { // not required - return nil - } - - if m.Address != nil { - if err := m.Address.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { - if swag.IsZero(m.Email) { // not required - return nil - } - - if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { - return err - } - - return nil -} - -func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { - if swag.IsZero(m.Phone) { // not required - return nil - } - - if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this storage facility based on the context it is used -func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.Address != nil { - - if swag.IsZero(m.Address) { // not required - return nil - } - - if err := m.Address.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("address") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("address") - } - return err - } - } - - return nil -} - -func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *StorageFacility) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *StorageFacility) UnmarshalBinary(b []byte) error { - var res StorageFacility - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item.go b/pkg/gen/primev3messages/update_m_t_o_service_item.go deleted file mode 100644 index 458956f1f1d..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_service_item.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - "io" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. -// -// swagger:discriminator UpdateMTOServiceItem modelType -type UpdateMTOServiceItem interface { - runtime.Validatable - runtime.ContextValidatable - - // ID of the service item. Must match path. - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - ID() strfmt.UUID - SetID(strfmt.UUID) - - // model type - // Required: true - ModelType() UpdateMTOServiceItemModelType - SetModelType(UpdateMTOServiceItemModelType) - - // AdditionalProperties in base type shoud be handled just like regular properties - // At this moment, the base type property is pushed down to the subtype -} - -type updateMTOServiceItem struct { - idField strfmt.UUID - - modelTypeField UpdateMTOServiceItemModelType -} - -// ID gets the id of this polymorphic type -func (m *updateMTOServiceItem) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this polymorphic type -func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this polymorphic type -func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItem" -} - -// SetModelType sets the model type of this polymorphic type -func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { - var elements []json.RawMessage - if err := consumer.Consume(reader, &elements); err != nil { - return nil, err - } - - var result []UpdateMTOServiceItem - for _, element := range elements { - obj, err := unmarshalUpdateMTOServiceItem(element, consumer) - if err != nil { - return nil, err - } - result = append(result, obj) - } - return result, nil -} - -// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem -func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - // we need to read this twice, so first into a buffer - data, err := io.ReadAll(reader) - if err != nil { - return nil, err - } - return unmarshalUpdateMTOServiceItem(data, consumer) -} - -func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { - buf := bytes.NewBuffer(data) - buf2 := bytes.NewBuffer(data) - - // the first time this is read is to fetch the value of the modelType property. - var getType struct { - ModelType string `json:"modelType"` - } - if err := consumer.Consume(buf, &getType); err != nil { - return nil, err - } - - if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { - return nil, err - } - - // The value of modelType is used to determine which type to create and unmarshal the data into - switch getType.ModelType { - case "UpdateMTOServiceItem": - var result updateMTOServiceItem - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemSIT": - var result UpdateMTOServiceItemSIT - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - case "UpdateMTOServiceItemShuttle": - var result UpdateMTOServiceItemShuttle - if err := consumer.Consume(buf2, &result); err != nil { - return nil, err - } - return &result, nil - } - return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) -} - -// Validate validates this update m t o service item -func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) 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 -} - -// ContextValidate validate this update m t o service item based on the context it is used -func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateModelType(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go b/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go deleted file mode 100644 index a1d95c43bb3..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go +++ /dev/null @@ -1,86 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. -// - DDDSIT - UpdateMTOServiceItemSIT -// - DOPSIT - UpdateMTOServiceItemSIT -// - DOASIT - UpdateMTOServiceItemSIT -// - DOFSIT - UpdateMTOServiceItemSIT -// - DDSHUT - UpdateMTOServiceItemShuttle -// - DOSHUT - UpdateMTOServiceItemShuttle -// -// The documentation will then update with the supported fields. -// -// swagger:model UpdateMTOServiceItemModelType -type UpdateMTOServiceItemModelType string - -func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { - return &value -} - -// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. -func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { - return &m -} - -const ( - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" - - // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" - UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" -) - -// for schema -var updateMTOServiceItemModelTypeEnum []interface{} - -func init() { - var res []UpdateMTOServiceItemModelType - if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) - } -} - -func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this update m t o service item model type -func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this update m t o service item model type based on context it is used -func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go deleted file mode 100644 index 7012106e91e..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go +++ /dev/null @@ -1,680 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item. -// -// swagger:model UpdateMTOServiceItemSIT -type UpdateMTOServiceItemSIT struct { - idField strfmt.UUID - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemSIT" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { - var data struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemSIT - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.DateOfContact1 = data.DateOfContact1 - result.DateOfContact2 = data.DateOfContact2 - result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 - result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 - result.ReServiceCode = data.ReServiceCode - result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus - result.SitCustomerContacted = data.SitCustomerContacted - result.SitDepartureDate = data.SitDepartureDate - result.SitDestinationFinalAddress = data.SitDestinationFinalAddress - result.SitEntryDate = data.SitEntryDate - result.SitPostalCode = data.SitPostalCode - result.SitRequestedDelivery = data.SitRequestedDelivery - result.TimeMilitary1 = data.TimeMilitary1 - result.TimeMilitary2 = data.TimeMilitary2 - result.UpdateReason = data.UpdateReason - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Date of attempted contact by the prime corresponding to 'timeMilitary1'. - // Format: date - DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` - - // Date of attempted contact by the prime corresponding to 'timeMilitary2'. - // Format: date - DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` - - // First available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` - - // Second available date that Prime can deliver SIT service item. - // Format: date - FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` - - // Service code allowed for this model type. - // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] - ReServiceCode string `json:"reServiceCode,omitempty"` - - // Indicates if "Approvals Requested" status is being requested. - RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` - - // Date when the customer contacted the prime for a delivery out of SIT. - // Format: date - SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` - - // Departure date for SIT. This is the end date of the SIT at either origin or destination. - // Format: date - SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` - - // sit destination final address - SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` - - // Entry date for the SIT. - // Format: date - SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` - - // sit postal code - // Example: 90210 - // Pattern: ^(\d{5}([\-]\d{4})?)$ - SitPostalCode *string `json:"sitPostalCode,omitempty"` - - // Date when the customer has requested delivery out of SIT. - // Format: date - SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary1 *string `json:"timeMilitary1,omitempty"` - - // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. - // Example: 1400Z - // Pattern: \d{4}Z - TimeMilitary2 *string `json:"timeMilitary2,omitempty"` - - // Reason for updating service item. - UpdateReason *string `json:"updateReason,omitempty"` - }{ - - DateOfContact1: m.DateOfContact1, - - DateOfContact2: m.DateOfContact2, - - FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, - - FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, - - ReServiceCode: m.ReServiceCode, - - RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, - - SitCustomerContacted: m.SitCustomerContacted, - - SitDepartureDate: m.SitDepartureDate, - - SitDestinationFinalAddress: m.SitDestinationFinalAddress, - - SitEntryDate: m.SitEntryDate, - - SitPostalCode: m.SitPostalCode, - - SitRequestedDelivery: m.SitRequestedDelivery, - - TimeMilitary1: m.TimeMilitary1, - - TimeMilitary2: m.TimeMilitary2, - - UpdateReason: m.UpdateReason, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item s i t -func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDateOfContact2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitCustomerContacted(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitDestinationFinalAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitPostalCode(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitRequestedDelivery(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary1(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTimeMilitary2(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact1) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { - - if swag.IsZero(m.DateOfContact2) { // not required - return nil - } - - if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { - - if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { - return err - } - - return nil -} - -var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDDSIT","DOPSIT","DOASIT","DOFSIT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { - - if swag.IsZero(m.SitCustomerContacted) { // not required - return nil - } - - if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if m.SitDestinationFinalAddress != nil { - if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { - - if swag.IsZero(m.SitEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { - - if swag.IsZero(m.SitPostalCode) { // not required - return nil - } - - if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { - - if swag.IsZero(m.SitRequestedDelivery) { // not required - return nil - } - - if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary1) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { - - if swag.IsZero(m.TimeMilitary2) { // not required - return nil - } - - if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item s i t based on the context it is used -func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.SitDestinationFinalAddress != nil { - - if swag.IsZero(m.SitDestinationFinalAddress) { // not required - return nil - } - - if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitDestinationFinalAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitDestinationFinalAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemSIT - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go deleted file mode 100644 index b362432b80e..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go +++ /dev/null @@ -1,264 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "bytes" - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. -// -// swagger:model UpdateMTOServiceItemShuttle -type UpdateMTOServiceItemShuttle struct { - idField strfmt.UUID - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` -} - -// ID gets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { - return m.idField -} - -// SetID sets the id of this subtype -func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { - m.idField = val -} - -// ModelType gets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { - return "UpdateMTOServiceItemShuttle" -} - -// SetModelType sets the model type of this subtype -func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { -} - -// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure -func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { - var data struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - } - buf := bytes.NewBuffer(raw) - dec := json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&data); err != nil { - return err - } - - var base struct { - /* Just the base type fields. Used for unmashalling polymorphic types.*/ - - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - } - buf = bytes.NewBuffer(raw) - dec = json.NewDecoder(buf) - dec.UseNumber() - - if err := dec.Decode(&base); err != nil { - return err - } - - var result UpdateMTOServiceItemShuttle - - result.idField = base.ID - - if base.ModelType != result.ModelType() { - /* Not the type we're looking for. */ - return errors.New(422, "invalid modelType value: %q", base.ModelType) - } - - result.ActualWeight = data.ActualWeight - result.EstimatedWeight = data.EstimatedWeight - result.ReServiceCode = data.ReServiceCode - - *m = result - - return nil -} - -// MarshalJSON marshals this object with a polymorphic type to a JSON structure -func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { - var b1, b2, b3 []byte - var err error - b1, err = json.Marshal(struct { - - // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. - // Example: 4000 - ActualWeight *int64 `json:"actualWeight"` - - // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight"` - - // Service code allowed for this model type. - // Enum: [DDSHUT DOSHUT] - ReServiceCode string `json:"reServiceCode,omitempty"` - }{ - - ActualWeight: m.ActualWeight, - - EstimatedWeight: m.EstimatedWeight, - - ReServiceCode: m.ReServiceCode, - }) - if err != nil { - return nil, err - } - b2, err = json.Marshal(struct { - ID strfmt.UUID `json:"id,omitempty"` - - ModelType UpdateMTOServiceItemModelType `json:"modelType"` - }{ - - ID: m.ID(), - - ModelType: m.ModelType(), - }) - if err != nil { - return nil, err - } - - return swag.ConcatJSON(b1, b2, b3), nil -} - -// Validate validates this update m t o service item shuttle -func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReServiceCode(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) 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 -} - -var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) - } -} - -// property enum -func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { - - if swag.IsZero(m.ReServiceCode) { // not required - return nil - } - - // value enum - if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item shuttle based on the context it is used -func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { - - if err := m.ModelType().ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("modelType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("modelType") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemShuttle - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_shipment.go b/pkg/gen/primev3messages/update_m_t_o_shipment.go deleted file mode 100644 index f59cf73c256..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_shipment.go +++ /dev/null @@ -1,690 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipment update m t o shipment -// -// swagger:model UpdateMTOShipment -type UpdateMTOShipment struct { - - // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. - // Format: date - ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` - - // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. - // Format: date - ActualPickupDate *strfmt.Date `json:"actualPickupDate"` - - // The actual weight of any pro gear shipped during a move. - // Example: 4500 - ActualProGearWeight *int64 `json:"actualProGearWeight,omitempty"` - - // The actual weight of any pro gear shipped during a move. - // Example: 4500 - ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight,omitempty"` - - // counselor remarks - // Example: counselor approved - CounselorRemarks *string `json:"counselorRemarks,omitempty"` - - // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details - // during onboarding, if they know their new address already. - // - // May be blank when entered by the customer, required when entered by the Prime. May not represent the true - // final destination due to the shipment being diverted or placed in SIT. - // - DestinationAddress struct { - Address - } `json:"destinationAddress,omitempty"` - - // destination type - DestinationType *DestinationType `json:"destinationType,omitempty"` - - // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. - // - Diversion bool `json:"diversion,omitempty"` - - // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. - // - // Format: date - FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` - - // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. - // Example: 4500 - NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` - - // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. - // - PointOfContact string `json:"pointOfContact,omitempty"` - - // port of debarkation - PortOfDebarkation *Port `json:"portOfDebarkation,omitempty"` - - // port of embarkation - PortOfEmbarkation *Port `json:"portOfEmbarkation,omitempty"` - - // ppm shipment - PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` - - // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. - // Example: 4500 - // Minimum: 1 - PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` - - // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. - // - // Example: 4500 - // Minimum: 1 - PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` - - // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. - // Format: date - ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` - - // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. - // Format: date - ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` - - // A second delivery address for this shipment, if the customer entered one. An optional field. - SecondaryDeliveryAddress struct { - Address - } `json:"secondaryDeliveryAddress,omitempty"` - - // A second pickup address for this shipment, if the customer entered one. An optional field. - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // shipment type - ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` - - // storage facility - StorageFacility *StorageFacility `json:"storageFacility,omitempty"` - - // A third delivery address for this shipment, if the customer entered one. An optional field. - TertiaryDeliveryAddress struct { - Address - } `json:"tertiaryDeliveryAddress,omitempty"` - - // A third pickup address for this shipment, if the customer entered one. An optional field. - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this update m t o shipment -func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateActualDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateActualPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateDestinationType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortOfDebarkation(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePortOfEmbarkation(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePpmShipment(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeActualWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePrimeEstimatedWeight(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledDeliveryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateScheduledPickupDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateShipmentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStorageFacility(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDeliveryAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ActualPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if m.DestinationType != nil { - if err := m.DestinationType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validatePortOfDebarkation(formats strfmt.Registry) error { - if swag.IsZero(m.PortOfDebarkation) { // not required - return nil - } - - if m.PortOfDebarkation != nil { - if err := m.PortOfDebarkation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfDebarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfDebarkation") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validatePortOfEmbarkation(formats strfmt.Registry) error { - if swag.IsZero(m.PortOfEmbarkation) { // not required - return nil - } - - if m.PortOfEmbarkation != nil { - if err := m.PortOfEmbarkation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfEmbarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfEmbarkation") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if m.PpmShipment != nil { - if err := m.PpmShipment.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeActualWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { - if swag.IsZero(m.PrimeEstimatedWeight) { // not required - return nil - } - - if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledDeliveryDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { - if swag.IsZero(m.ScheduledPickupDate) { // not required - return nil - } - - if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if m.StorageFacility != nil { - if err := m.StorageFacility.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDeliveryAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdateMTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -// ContextValidate validate this update m t o shipment based on the context it is used -func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateDestinationType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePortOfDebarkation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePortOfEmbarkation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePpmShipment(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateShipmentType(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStorageFacility(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { - - if m.DestinationType != nil { - - if swag.IsZero(m.DestinationType) { // not required - return nil - } - - if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("destinationType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("destinationType") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePortOfDebarkation(ctx context.Context, formats strfmt.Registry) error { - - if m.PortOfDebarkation != nil { - - if swag.IsZero(m.PortOfDebarkation) { // not required - return nil - } - - if err := m.PortOfDebarkation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfDebarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfDebarkation") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePortOfEmbarkation(ctx context.Context, formats strfmt.Registry) error { - - if m.PortOfEmbarkation != nil { - - if swag.IsZero(m.PortOfEmbarkation) { // not required - return nil - } - - if err := m.PortOfEmbarkation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("portOfEmbarkation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("portOfEmbarkation") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { - - if m.PpmShipment != nil { - - if swag.IsZero(m.PpmShipment) { // not required - return nil - } - - if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("ppmShipment") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("ppmShipment") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.ShipmentType) { // not required - return nil - } - - if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("shipmentType") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("shipmentType") - } - return err - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { - - if m.StorageFacility != nil { - - if swag.IsZero(m.StorageFacility) { // not required - return nil - } - - if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("storageFacility") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("storageFacility") - } - return err - } - } - - return nil -} - -func (m *UpdateMTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdateMTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_m_t_o_shipment_status.go b/pkg/gen/primev3messages/update_m_t_o_shipment_status.go deleted file mode 100644 index d1831f0f42b..00000000000 --- a/pkg/gen/primev3messages/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. -// -// swagger:model UpdateMTOShipmentStatus -type UpdateMTOShipmentStatus struct { - - // status - // Enum: [CANCELED] - Status string `json:"status,omitempty"` -} - -// Validate validates this update m t o shipment status -func (m *UpdateMTOShipmentStatus) 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 -} - -var updateMTOShipmentStatusTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) - } -} - -const ( - - // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" - UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" -) - -// prop value enum -func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update m t o shipment status based on context it is used -func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipmentStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_p_p_m_shipment.go b/pkg/gen/primev3messages/update_p_p_m_shipment.go deleted file mode 100644 index 097575b0240..00000000000 --- a/pkg/gen/primev3messages/update_p_p_m_shipment.go +++ /dev/null @@ -1,373 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePPMShipment The PPM specific fields of the shipment with values being changed -// -// swagger:model UpdatePPMShipment -type UpdatePPMShipment struct { - - // The address of the destination location where goods are being delivered to. - // - DestinationAddress struct { - PPMDestinationAddress - } `json:"destinationAddress,omitempty"` - - // The estimated weight of the PPM shipment goods being moved. - // Example: 4200 - EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` - - // Date the customer expects to begin moving from their origin. - // - // Format: date - ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` - - // Indicates whether PPM shipment has pro gear for themselves or their spouse. - // - HasProGear *bool `json:"hasProGear,omitempty"` - - // has secondary destination address - HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` - - // has secondary pickup address - HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` - - // has tertiary destination address - HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` - - // has tertiary pickup address - HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` - - // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. - // Example: false - IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` - - // The address of the origin location where goods are being moved from. - // - PickupAddress struct { - Address - } `json:"pickupAddress,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to the service member. - ProGearWeight *int64 `json:"proGearWeight,omitempty"` - - // An optional secondary address near the destination where goods will be dropped off. - // - SecondaryDestinationAddress struct { - Address - } `json:"secondaryDestinationAddress,omitempty"` - - // An optional secondary Pickup Address near the origin where additional goods exist. - // - SecondaryPickupAddress struct { - Address - } `json:"secondaryPickupAddress,omitempty"` - - // The date that goods will exit the storage location. - // Format: date - SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` - - // The date that goods will first enter the storage location. - // Format: date - SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` - - // The estimated weight of the goods being put into storage. - // Example: 2000 - SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` - - // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. - // - // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. - // - SitExpected *bool `json:"sitExpected,omitempty"` - - // sit location - SitLocation *SITLocationType `json:"sitLocation,omitempty"` - - // The estimated weight of the pro-gear being moved belonging to a spouse. - SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` - - // An optional third address near the destination where goods will be dropped off. - // - TertiaryDestinationAddress struct { - Address - } `json:"tertiaryDestinationAddress,omitempty"` - - // An optional third Pickup Address near the origin where additional goods exist. - // - TertiaryPickupAddress struct { - Address - } `json:"tertiaryPickupAddress,omitempty"` -} - -// Validate validates this update p p m shipment -func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateExpectedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSecondaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedDepartureDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitEstimatedEntryDate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSitLocation(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryDestinationAddress(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTertiaryPickupAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.DestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.ExpectedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.PickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.SecondaryPickupAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedDepartureDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { - if swag.IsZero(m.SitEstimatedEntryDate) { // not required - return nil - } - - if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if m.SitLocation != nil { - if err := m.SitLocation.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryDestinationAddress) { // not required - return nil - } - - return nil -} - -func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { - if swag.IsZero(m.TertiaryPickupAddress) { // not required - return nil - } - - return nil -} - -// ContextValidate validate this update p p m shipment based on the context it is used -func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateSitLocation(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { - - if m.SitLocation != nil { - - if swag.IsZero(m.SitLocation) { // not required - return nil - } - - if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("sitLocation") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("sitLocation") - } - return err - } - } - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { - var res UpdatePPMShipment - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_reweigh.go b/pkg/gen/primev3messages/update_reweigh.go deleted file mode 100644 index f33b8152c13..00000000000 --- a/pkg/gen/primev3messages/update_reweigh.go +++ /dev/null @@ -1,79 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. -// -// swagger:model UpdateReweigh -type UpdateReweigh struct { - - // In lieu of a document being uploaded indicating why a reweigh did not occur. - // Example: The reweigh was not performed because the shipment was already delivered - VerificationReason *string `json:"verificationReason"` - - // The total reweighed weight for the shipment in pounds. - // Example: 2000 - // Minimum: 1 - Weight *int64 `json:"weight"` -} - -// Validate validates this update reweigh -func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateWeight(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { - if swag.IsZero(m.Weight) { // not required - return nil - } - - if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update reweigh based on context it is used -func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { - var res UpdateReweigh - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/update_shipment_destination_address.go b/pkg/gen/primev3messages/update_shipment_destination_address.go deleted file mode 100644 index c4d7dd58866..00000000000 --- a/pkg/gen/primev3messages/update_shipment_destination_address.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. -// -// swagger:model UpdateShipmentDestinationAddress -type UpdateShipmentDestinationAddress struct { - - // This is the remark the Prime has entered, which would be the reason there is an address change. - // Example: Customer reached out to me this week and let me know they want to move somewhere else. - // Required: true - ContractorRemarks *string `json:"contractorRemarks"` - - // new address - // Required: true - NewAddress *Address `json:"newAddress"` -} - -// Validate validates this update shipment destination address -func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateContractorRemarks(formats); err != nil { - res = append(res, err) - } - - if err := m.validateNewAddress(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { - - if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { - return err - } - - return nil -} - -func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { - - if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { - return err - } - - if m.NewAddress != nil { - if err := m.NewAddress.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// ContextValidate validate this update shipment destination address based on the context it is used -func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateNewAddress(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { - - if m.NewAddress != nil { - - if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("newAddress") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("newAddress") - } - return err - } - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { - var res UpdateShipmentDestinationAddress - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/upload_with_omissions.go b/pkg/gen/primev3messages/upload_with_omissions.go deleted file mode 100644 index 5f1f05294c0..00000000000 --- a/pkg/gen/primev3messages/upload_with_omissions.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadWithOmissions An uploaded file. -// -// swagger:model UploadWithOmissions -type UploadWithOmissions struct { - - // bytes - // Required: true - Bytes *int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - ContentType *string `json:"contentType"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - Filename *string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // rotation - Rotation int64 `json:"rotation,omitempty"` - - // status - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uri - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this upload with omissions -func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", m.Bytes); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { - - if err := validate.Required("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) 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 -} - -var uploadWithOmissionsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) - } -} - -const ( - - // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" - UploadWithOmissionsStatusINFECTED string = "INFECTED" - - // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" - UploadWithOmissionsStatusCLEAN string = "CLEAN" - - // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" - UploadWithOmissionsStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { - if swag.IsZero(m.URL) { // not required - return nil - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload with omissions based on the context it is used -func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { - var res UploadWithOmissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/primev3messages/validation_error.go b/pkg/gen/primev3messages/validation_error.go deleted file mode 100644 index 7494eb49eb9..00000000000 --- a/pkg/gen/primev3messages/validation_error.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package primev3messages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - // invalid fields - // Required: true - InvalidFields map[string][]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.InvalidFields = dataAO1.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - - dataAO1.InvalidFields = m.InvalidFields - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportapi/configure_mymove.go b/pkg/gen/supportapi/configure_mymove.go deleted file mode 100644 index ff1c6783df9..00000000000 --- a/pkg/gen/supportapi/configure_mymove.go +++ /dev/null @@ -1,145 +0,0 @@ -// This file is safe to edit. Once it exists it will not be overwritten - -package supportapi - -import ( - "crypto/tls" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/payment_request" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/webhook" -) - -//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/support.yaml --api-package supportoperations --model-package supportmessages --server-package supportapi --principal interface{} --exclude-main - -func configureFlags(api *supportoperations.MymoveAPI) { - // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } -} - -func configureAPI(api *supportoperations.MymoveAPI) http.Handler { - // configure the api here - api.ServeError = errors.ServeError - - // Set your custom logger if needed. Default one is log.Printf - // Expected interface func(string, ...interface{}) - // - // Example: - // api.Logger = log.Printf - - api.UseSwaggerUI() - // To continue using redoc as your UI, uncomment the following line - // api.UseRedoc() - - api.JSONConsumer = runtime.JSONConsumer() - - api.JSONProducer = runtime.JSONProducer() - - if api.MoveTaskOrderCreateMoveTaskOrderHandler == nil { - api.MoveTaskOrderCreateMoveTaskOrderHandler = move_task_order.CreateMoveTaskOrderHandlerFunc(func(params move_task_order.CreateMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.CreateMoveTaskOrder has not yet been implemented") - }) - } - if api.WebhookCreateWebhookNotificationHandler == nil { - api.WebhookCreateWebhookNotificationHandler = webhook.CreateWebhookNotificationHandlerFunc(func(params webhook.CreateWebhookNotificationParams) middleware.Responder { - return middleware.NotImplemented("operation webhook.CreateWebhookNotification has not yet been implemented") - }) - } - if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { - api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }) - } - if api.PaymentRequestGetPaymentRequestEDIHandler == nil { - api.PaymentRequestGetPaymentRequestEDIHandler = payment_request.GetPaymentRequestEDIHandlerFunc(func(params payment_request.GetPaymentRequestEDIParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.GetPaymentRequestEDI has not yet been implemented") - }) - } - if api.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler == nil { - api.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler = move_task_order.HideNonFakeMoveTaskOrdersHandlerFunc(func(params move_task_order.HideNonFakeMoveTaskOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.HideNonFakeMoveTaskOrders has not yet been implemented") - }) - } - if api.PaymentRequestListMTOPaymentRequestsHandler == nil { - api.PaymentRequestListMTOPaymentRequestsHandler = payment_request.ListMTOPaymentRequestsHandlerFunc(func(params payment_request.ListMTOPaymentRequestsParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.ListMTOPaymentRequests has not yet been implemented") - }) - } - if api.MoveTaskOrderListMTOsHandler == nil { - api.MoveTaskOrderListMTOsHandler = move_task_order.ListMTOsHandlerFunc(func(params move_task_order.ListMTOsParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.ListMTOs has not yet been implemented") - }) - } - if api.MoveTaskOrderMakeMoveTaskOrderAvailableHandler == nil { - api.MoveTaskOrderMakeMoveTaskOrderAvailableHandler = move_task_order.MakeMoveTaskOrderAvailableHandlerFunc(func(params move_task_order.MakeMoveTaskOrderAvailableParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.MakeMoveTaskOrderAvailable has not yet been implemented") - }) - } - if api.PaymentRequestProcessReviewedPaymentRequestsHandler == nil { - api.PaymentRequestProcessReviewedPaymentRequestsHandler = payment_request.ProcessReviewedPaymentRequestsHandlerFunc(func(params payment_request.ProcessReviewedPaymentRequestsParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.ProcessReviewedPaymentRequests has not yet been implemented") - }) - } - if api.PaymentRequestRecalculatePaymentRequestHandler == nil { - api.PaymentRequestRecalculatePaymentRequestHandler = payment_request.RecalculatePaymentRequestHandlerFunc(func(params payment_request.RecalculatePaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.RecalculatePaymentRequest has not yet been implemented") - }) - } - if api.WebhookReceiveWebhookNotificationHandler == nil { - api.WebhookReceiveWebhookNotificationHandler = webhook.ReceiveWebhookNotificationHandlerFunc(func(params webhook.ReceiveWebhookNotificationParams) middleware.Responder { - return middleware.NotImplemented("operation webhook.ReceiveWebhookNotification has not yet been implemented") - }) - } - if api.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { - api.MtoServiceItemUpdateMTOServiceItemStatusHandler = mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") - }) - } - if api.MtoShipmentUpdateMTOShipmentStatusHandler == nil { - api.MtoShipmentUpdateMTOShipmentStatusHandler = mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") - }) - } - if api.PaymentRequestUpdatePaymentRequestStatusHandler == nil { - api.PaymentRequestUpdatePaymentRequestStatusHandler = payment_request.UpdatePaymentRequestStatusHandlerFunc(func(params payment_request.UpdatePaymentRequestStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.UpdatePaymentRequestStatus has not yet been implemented") - }) - } - - api.PreServerShutdown = func() {} - - api.ServerShutdown = func() {} - - return setupGlobalMiddleware(api.Serve(setupMiddlewares)) -} - -// The TLS configuration before HTTPS server starts. -func configureTLS(tlsConfig *tls.Config) { - // Make all necessary changes to the TLS configuration here. -} - -// As soon as server is initialized but not run yet, this function will be called. -// If you need to modify a config, store server instance to stop it individually later, this is the place. -// This function can be called multiple times, depending on the number of serving schemes. -// scheme value will be set accordingly: "http", "https" or "unix". -func configureServer(s *http.Server, scheme, addr string) { -} - -// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. -// The middleware executes after routing but before authentication, binding and validation. -func setupMiddlewares(handler http.Handler) http.Handler { - return handler -} - -// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. -// So this is a good place to plug in a panic handling middleware, logging and metrics. -func setupGlobalMiddleware(handler http.Handler) http.Handler { - return handler -} diff --git a/pkg/gen/supportapi/doc.go b/pkg/gen/supportapi/doc.go deleted file mode 100644 index b7c7b94796e..00000000000 --- a/pkg/gen/supportapi/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -// Package supportapi MilMove Support API -// -// The Support API gives you programmatic access to support functionality useful -// for testing and debugging. **This API is not available in the Production -// environment**. -// -// All endpoints are located at `/support/v1/`. -// -// Schemes: -// http -// Host: localhost -// BasePath: /support/v1 -// Version: 0.0.1 -// License: MIT https://opensource.org/licenses/MIT -// Contact: -// -// Consumes: -// - application/json -// -// Produces: -// - application/json -// -// swagger:meta -package supportapi diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go deleted file mode 100644 index 65ee2ddea96..00000000000 --- a/pkg/gen/supportapi/embedded_spec.go +++ /dev/null @@ -1,5480 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportapi - -// 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" -) - -var ( - // SwaggerJSON embedded version of the swagger document used at generation time - SwaggerJSON json.RawMessage - // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time - FlatSwaggerJSON json.RawMessage -) - -func init() { - SwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Support API gives you programmatic access to support functionality useful\nfor testing and debugging. **This API is not available in the Production\nenvironment**.\n\nAll endpoints are located at ` + "`" + `/support/v1/` + "`" + `.\n", - "title": "MilMove Support API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/support/v1", - "paths": { - "/move-task-orders": { - "get": { - "description": "### Functionality\nThis endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "listMTOs", - "operationId": "listMTOs", - "parameters": [ - { - "type": "integer", - "format": "timestamp", - "description": "Only return move task orders updated since this time.", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved all move task orders.", - "schema": { - "$ref": "#/definitions/MoveTaskOrders" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "post": { - "description": "Creates an instance of moveTaskOrder.\nCurrently this will also create a number of nested objects but not all.\nIt will currently create\n* MoveTaskOrder\n* Order\n* Customer\n* User\n* Entitlement\n\nIt will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID,\norigin duty station ID, and an uploaded orders ID to be passed into the request.\n\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "createMoveTaskOrder", - "operationId": "createMoveTaskOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - } - ], - "responses": { - "201": { - "description": "Successfully created MoveTaskOrder object.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/hide": { - "patch": { - "description": "Updates move task order without fake user data ` + "`" + `show` + "`" + ` to false. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "hideNonFakeMoveTaskOrders", - "operationId": "hideNonFakeMoveTaskOrders", - "responses": { - "200": { - "description": "Successfully hid MTOs.", - "schema": { - "$ref": "#/definitions/MTOHideMovesResponse" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\nThis is a support endpoint and is not available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of move task order to use.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/available-to-prime": { - "patch": { - "description": "Updates move task order ` + "`" + `availableToPrimeAt` + "`" + ` to make it available to prime. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "makeMoveTaskOrderAvailable", - "operationId": "makeMoveTaskOrderAvailable", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - } - ], - "responses": { - "200": { - "description": "Successfully made MTO available to Prime.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of move task order.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/payment-requests": { - "get": { - "description": "### Functionality\n\nThis endpoint lists all PaymentRequests associated with a given MoveTaskOrder.\n\nThis is a support endpoint and is not available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "listMTOPaymentRequests", - "operationId": "listMTOPaymentRequests", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Only return move task orders updated since this time.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved payment requests associated with a given move task order", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}/status": { - "patch": { - "description": "Updates the status of a service item for a move to APPROVED or REJECTED. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "updateMTOServiceItemStatus", - "operationId": "updateMTOServiceItemStatus", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOServiceItemStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated service item status for a move task order.", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of mto service item to use.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/mto-shipments/{mtoShipmentID}/status": { - "patch": { - "description": "Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, ` + "`" + `rejectionReason` + "`" + ` should be blank and any value passed through the body will be ignored. If REJECTED, a value in ` + "`" + `rejectionReason` + "`" + ` is required. \u003cbr /\u003e \u003cbr /\u003e This is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentStatus", - "operationId": "updateMTOShipmentStatus", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipmentStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the shipment's status.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/process-reviewed": { - "patch": { - "description": "Updates the status of reviewed payment requests and sends PRs to Syncada if\nthe SendToSyncada flag is set\n\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "processReviewedPaymentRequests", - "operationId": "processReviewedPaymentRequests", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ProcessReviewedPaymentRequests" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated status of reviewed payment request and sent to Syncada if that flag is set", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/payment-requests/{paymentRequestID}/edi": { - "get": { - "description": "Returns the EDI (Electronic Data Interchange) message for the payment request identified\nby the given payment request ID. Note that the EDI returned in the JSON payload will have where there\nwould normally be line breaks (due to JSON not allowing line breaks in a string).\n\nThis is a support endpoint and will not be available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "getPaymentRequestEDI", - "operationId": "getPaymentRequestEDI", - "responses": { - "200": { - "description": "Successfully retrieved payment requests associated with a given move task order", - "schema": { - "$ref": "#/definitions/PaymentRequestEDI" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the payment request for which EDI should be generated.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/recalculate": { - "post": { - "description": "Recalculates an existing pending payment request by creating a new payment request for the same service\nitems but is priced based on the current inputs (weights, dates, etc.). The previously existing payment\nrequest is then deprecated. A link is made between the new and existing payment requests.\n\nThis is a support endpoint and will not be available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "recalculatePaymentRequest", - "operationId": "recalculatePaymentRequest", - "responses": { - "201": { - "description": "The new payment request with recalculated pricing.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the payment request to recalculate.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/status": { - "patch": { - "description": "Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED.\n\nA status of REVIEWED can optionally have a ` + "`" + `rejectionReason` + "`" + `.\n\nThis is a support endpoint and is not available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "updatePaymentRequestStatus", - "operationId": "updatePaymentRequestStatus", - "parameters": [ - { - "$ref": "#/parameters/ifMatch" - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePaymentRequestStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated payment request status.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "409": { - "$ref": "#/responses/Conflict" - }, - "412": { - "$ref": "#/responses/PreconditionFailed" - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/webhook-notifications": { - "post": { - "description": "This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "webhook" - ], - "summary": "Test endpoint for creating webhook notifications", - "operationId": "createWebhookNotification", - "parameters": [ - { - "description": "The notification sent by webhook-client.", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - } - ], - "responses": { - "201": { - "description": "Successful creation", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - }, - "422": { - "$ref": "#/responses/UnprocessableEntity" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, - "/webhook-notify": { - "post": { - "description": "This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The ` + "`" + `webhook-client` + "`" + ` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "webhook" - ], - "summary": "Test endpoint for receiving messages from our own webhook-client", - "operationId": "receiveWebhookNotification", - "parameters": [ - { - "description": "The webhook notification being sent", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - } - ], - "responses": { - "200": { - "description": "Received notification", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - }, - "400": { - "$ref": "#/responses/InvalidRequest" - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "403": { - "$ref": "#/responses/PermissionDenied" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - } - }, - "definitions": { - "Address": { - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "Customer": { - "type": "object", - "required": [ - "firstName", - "lastName", - "dodID", - "rank", - "agency" - ], - "properties": { - "agency": { - "type": "string", - "title": "Agency customer is affilated with" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "rank": { - "$ref": "#/definitions/Rank" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "Document": { - "type": "object", - "required": [ - "id", - "serviceMemberID", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMemberID": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "DutyLocation": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlement": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "readOnly": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "readOnly": true, - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "type": "string", - "title": "MTO Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOHideMove": { - "description": "describes the MTO ID and a description reason why the move was hidden.", - "type": "object", - "properties": { - "hideReason": { - "description": "Reason the move was selected to be hidden", - "type": "string", - "x-nullable": true, - "example": "invalid name" - }, - "moveTaskOrderID": { - "description": "ID of the associated moveTaskOrder", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "MTOHideMovesResponse": { - "description": "describes the moves that were hidden that contained non-approved fake data to use in the MilMove system.", - "type": "object", - "properties": { - "moves": { - "description": "Array of moves that were hidden.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOHideMove" - } - }, - "numberMovesHidden": { - "description": "Number of moves that were hidden", - "type": "integer" - } - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "ETag identifier required to update this object", - "type": "string", - "readOnly": true - }, - "id": { - "description": "ID of the service item", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "ID of the associated moveTaskOrder", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "ID of the associated mtoShipment", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "Full descriptive name of the service", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "Reason the service item was rejected by the TOO", - "type": "string", - "x-nullable": true, - "example": "item was too heavy" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "dateOfContact1", - "timeMilitary1", - "firstAvailableDeliveryDate1", - "dateOfContact2", - "timeMilitary2", - "firstAvailableDeliveryDate2", - "sitEntryDate" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date" - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date" - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "Describes a dimension object for the MTOServiceItem.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "$ref": "#/definitions/MTOServiceItemDimension" - }, - "description": { - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "$ref": "#/definitions/MTOServiceItemDimension" - }, - "reServiceCode": { - "description": "Service codes allowed for this model type.", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode", - "description" - ], - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service codes allowed for this model type.", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "Explanation of why a shuttle service is required.", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "Describes all statuses for a MTOServiceItem.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - }, - "MTOShipment": { - "properties": { - "actualPickupDate": { - "type": "string", - "format": "date" - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "date when the shipment was given the status \"APPROVED\"", - "type": "string", - "format": "date", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "diversion": { - "type": "boolean" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "type": "string", - "format": "date" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "pointOfContact": { - "description": "Email or id of a contact person for this update.", - "type": "string" - }, - "primeActualWeight": { - "type": "integer", - "example": 4500 - }, - "primeEstimatedWeight": { - "type": "integer", - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "MTO Shipment not good enough" - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "requiredDeliveryDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "scheduledPickupDate": { - "type": "string", - "format": "date" - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "SUBMITTED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MoveStatus": { - "description": "Current status of this MoveTaskOrder", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "order", - "contractorID" - ], - "properties": { - "approvedAt": { - "description": "Indicates this MoveTaskOrder has been approved by an office user such as the Task Ordering Officer (TOO).\n", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "description": "Indicates this MoveTaskOrder is available for Prime API handling.\n\nIn production, only MoveTaskOrders for which this is set will be available to the API.\n", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "contractorID": { - "description": "ID associated with the contractor, in this case Prime\n", - "type": "string", - "format": "uuid", - "example": "5db13bb4-6d29-4bdb-bc81-262f4513ecf6" - }, - "createdAt": { - "description": "Date the MoveTaskOrder was created on.", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "Uniquely identifies the state of the MoveTaskOrder object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this MoveTaskOrder will require that this eTag be passed in with the If-Match header.\n", - "type": "string", - "readOnly": true - }, - "id": { - "description": "ID of the MoveTaskOrder object.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "description": "Unique 6-character code the customer can use to refer to their move", - "type": "string", - "readOnly": true, - "example": "ABC123" - }, - "mtoServiceItems": { - "description": "Array of MTOServiceItems associated with this MoveTaskOrder.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "description": "ID of the Order object", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "description": "If the move is a PPM, this is the estimated weight in lbs.", - "type": "integer" - }, - "ppmType": { - "description": "If the move is a PPM, indicates whether it is full or partial.", - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "description": "Unique ID associated with this Order.\n\nNo two MoveTaskOrders may have the same ID.\nAttempting to create a MoveTaskOrder may fail if this referenceId has been used already.\n", - "type": "string", - "readOnly": true, - "example": "1001-3456" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "updatedAt": { - "description": "Date on which this MoveTaskOrder was last updated.", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MoveTaskOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "ordersType", - "ordersTypeDetail", - "rank", - "reportByDate", - "issueDate", - "status", - "uploadedOrdersID", - "tac", - "originDutyLocationID", - "destinationDutyLocationID", - "departmentIndicator" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "description": "ID of the Customer this Order belongs to.\n\nIf creating a MoveTaskOrder. either an existing customerID should be provided or the nested customer object should be populated for creation.\n", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationID": { - "description": "ID of the destination duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "Uniquely identifies the state of the Order object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this Order will require that this eTag be passed in with the If-Match header.\n", - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlement" - }, - "id": { - "description": "ID of the Order object.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "issueDate": { - "description": "The date the orders were issued.", - "type": "string", - "format": "date" - }, - "orderNumber": { - "description": "ID of the military orders associated with this move.", - "type": "string", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationID": { - "description": "ID of the origin duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rank": { - "$ref": "#/definitions/Rank" - }, - "reportByDate": { - "description": "Date that the service member must report to the new DutyLocation by.", - "type": "string", - "format": "date" - }, - "status": { - "$ref": "#/definitions/OrdersStatus" - }, - "tac": { - "type": "string", - "title": "TAC", - "example": "F8J1" - }, - "uploadedOrders": { - "$ref": "#/definitions/Document" - }, - "uploadedOrdersID": { - "description": "ID of the uploaded document.", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OrdersStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "GHC", - "NTS", - "WOUNDED_WARRIOR", - "BLUEBARK", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "GHC": "GHC", - "LOCAL_MOVE": "Local Move", - "NTS": "NTS", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", - "RETIREMENT": "Retirement", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "documentPackage": { - "$ref": "#/definitions/ProofOfServicePackage" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestEDI": { - "type": "object", - "properties": { - "edi": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "ProcessReviewedPaymentRequests": { - "type": "object", - "required": [ - "sendToSyncada", - "readFromSyncada", - "deleteFromSyncada" - ], - "properties": { - "deleteFromSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "readFromSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "sendToSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "ProofOfServicePackage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "Rank": { - "description": "Rank of the service member, must match specific list of available ranks.", - "type": "string", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ] - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "UpdateMTOServiceItemStatus": { - "properties": { - "rejectionReason": { - "description": "Reason the service item was rejected by the TOO\"\"", - "type": "string", - "x-nullable": true, - "example": "item was too heavy" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - } - }, - "UpdateMTOShipmentStatus": { - "properties": { - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment not good enough" - }, - "status": { - "type": "string", - "enum": [ - "REJECTED", - "APPROVED", - "SUBMITTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ] - } - } - }, - "UpdatePaymentRequestStatus": { - "type": "object", - "properties": { - "eTag": { - "description": "Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for ` + "`" + `If-Match` + "`" + `. Required when sending PUT or PATCH requests to prevent updating stale data.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "A written reason to provide context for the status.", - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - }, - "WebhookNotification": { - "type": "object", - "properties": { - "createdAt": { - "description": "Time representing when the event was triggered", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eventKey": { - "description": "Name of event triggered", - "type": "string", - "example": "PaymentRequest.Update" - }, - "firstAttemptedAt": { - "description": "Time representing when the system firstAttempted to send this notification", - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "object": { - "type": "string", - "format": "JSON", - "x-nullable": true - }, - "objectID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/WebhookNotificationStatus" - }, - "traceID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "description": "Time representing when the notification was last updated", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "WebhookNotificationStatus": { - "description": "Statuses available for a Webhook Notification", - "type": "string", - "enum": [ - "PENDING", - "SENT", - "SKIPPED", - "FAILING", - "FAILED" - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "name": "paymentRequest" - }, - { - "name": "mtoServiceItem" - }, - { - "name": "mtoShipment" - }, - { - "name": "webhook" - } - ] -}`)) - FlatSwaggerJSON = json.RawMessage([]byte(`{ - "schemes": [ - "http" - ], - "swagger": "2.0", - "info": { - "description": "The Support API gives you programmatic access to support functionality useful\nfor testing and debugging. **This API is not available in the Production\nenvironment**.\n\nAll endpoints are located at ` + "`" + `/support/v1/` + "`" + `.\n", - "title": "MilMove Support API", - "contact": { - "email": "milmove-developers@caci.com" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - }, - "version": "0.0.1" - }, - "basePath": "/support/v1", - "paths": { - "/move-task-orders": { - "get": { - "description": "### Functionality\nThis endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "listMTOs", - "operationId": "listMTOs", - "parameters": [ - { - "type": "integer", - "format": "timestamp", - "description": "Only return move task orders updated since this time.", - "name": "since", - "in": "query" - } - ], - "responses": { - "200": { - "description": "Successfully retrieved all move task orders.", - "schema": { - "$ref": "#/definitions/MoveTaskOrders" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "post": { - "description": "Creates an instance of moveTaskOrder.\nCurrently this will also create a number of nested objects but not all.\nIt will currently create\n* MoveTaskOrder\n* Order\n* Customer\n* User\n* Entitlement\n\nIt will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID,\norigin duty station ID, and an uploaded orders ID to be passed into the request.\n\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "createMoveTaskOrder", - "operationId": "createMoveTaskOrder", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - } - ], - "responses": { - "201": { - "description": "Successfully created MoveTaskOrder object.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/hide": { - "patch": { - "description": "Updates move task order without fake user data ` + "`" + `show` + "`" + ` to false. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "hideNonFakeMoveTaskOrders", - "operationId": "hideNonFakeMoveTaskOrders", - "responses": { - "200": { - "description": "Successfully hid MTOs.", - "schema": { - "$ref": "#/definitions/MTOHideMovesResponse" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/move-task-orders/{moveTaskOrderID}": { - "get": { - "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\nThis is a support endpoint and is not available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "getMoveTaskOrder", - "operationId": "getMoveTaskOrder", - "responses": { - "200": { - "description": "Successfully retrieve an individual move task order.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of move task order to use.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/available-to-prime": { - "patch": { - "description": "Updates move task order ` + "`" + `availableToPrimeAt` + "`" + ` to make it available to prime. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "moveTaskOrder" - ], - "summary": "makeMoveTaskOrderAvailable", - "operationId": "makeMoveTaskOrderAvailable", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully made MTO available to Prime.", - "schema": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of move task order.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ] - }, - "/move-task-orders/{moveTaskOrderID}/payment-requests": { - "get": { - "description": "### Functionality\n\nThis endpoint lists all PaymentRequests associated with a given MoveTaskOrder.\n\nThis is a support endpoint and is not available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "listMTOPaymentRequests", - "operationId": "listMTOPaymentRequests", - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "Only return move task orders updated since this time.", - "name": "moveTaskOrderID", - "in": "path", - "required": true - } - ], - "responses": { - "200": { - "description": "Successfully retrieved payment requests associated with a given move task order", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/mto-service-items/{mtoServiceItemID}/status": { - "patch": { - "description": "Updates the status of a service item for a move to APPROVED or REJECTED. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoServiceItem" - ], - "summary": "updateMTOServiceItemStatus", - "operationId": "updateMTOServiceItemStatus", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOServiceItemStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated service item status for a move task order.", - "schema": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "description": "UUID of mto service item to use.", - "name": "mtoServiceItemID", - "in": "path", - "required": true - } - ] - }, - "/mto-shipments/{mtoShipmentID}/status": { - "patch": { - "description": "Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, ` + "`" + `rejectionReason` + "`" + ` should be blank and any value passed through the body will be ignored. If REJECTED, a value in ` + "`" + `rejectionReason` + "`" + ` is required. \u003cbr /\u003e \u003cbr /\u003e This is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "mtoShipment" - ], - "summary": "updateMTOShipmentStatus", - "operationId": "updateMTOShipmentStatus", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdateMTOShipmentStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated the shipment's status.", - "schema": { - "$ref": "#/definitions/MTOShipment" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the shipment being updated.", - "name": "mtoShipmentID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/process-reviewed": { - "patch": { - "description": "Updates the status of reviewed payment requests and sends PRs to Syncada if\nthe SendToSyncada flag is set\n\nThis is a support endpoint and will not be available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "processReviewedPaymentRequests", - "operationId": "processReviewedPaymentRequests", - "parameters": [ - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/ProcessReviewedPaymentRequests" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated status of reviewed payment request and sent to Syncada if that flag is set", - "schema": { - "$ref": "#/definitions/PaymentRequests" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/payment-requests/{paymentRequestID}/edi": { - "get": { - "description": "Returns the EDI (Electronic Data Interchange) message for the payment request identified\nby the given payment request ID. Note that the EDI returned in the JSON payload will have where there\nwould normally be line breaks (due to JSON not allowing line breaks in a string).\n\nThis is a support endpoint and will not be available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "getPaymentRequestEDI", - "operationId": "getPaymentRequestEDI", - "responses": { - "200": { - "description": "Successfully retrieved payment requests associated with a given move task order", - "schema": { - "$ref": "#/definitions/PaymentRequestEDI" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the payment request for which EDI should be generated.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/recalculate": { - "post": { - "description": "Recalculates an existing pending payment request by creating a new payment request for the same service\nitems but is priced based on the current inputs (weights, dates, etc.). The previously existing payment\nrequest is then deprecated. A link is made between the new and existing payment requests.\n\nThis is a support endpoint and will not be available in production.\n", - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "recalculatePaymentRequest", - "operationId": "recalculatePaymentRequest", - "responses": { - "201": { - "description": "The new payment request with recalculated pricing.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of the payment request to recalculate.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/payment-requests/{paymentRequestID}/status": { - "patch": { - "description": "Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED.\n\nA status of REVIEWED can optionally have a ` + "`" + `rejectionReason` + "`" + `.\n\nThis is a support endpoint and is not available in production.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "paymentRequest" - ], - "summary": "updatePaymentRequestStatus", - "operationId": "updatePaymentRequestStatus", - "parameters": [ - { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - }, - { - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/UpdatePaymentRequestStatus" - } - } - ], - "responses": { - "200": { - "description": "Successfully updated payment request status.", - "schema": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "404": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "409": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "412": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - }, - "parameters": [ - { - "type": "string", - "format": "uuid", - "description": "UUID of payment request.", - "name": "paymentRequestID", - "in": "path", - "required": true - } - ] - }, - "/webhook-notifications": { - "post": { - "description": "This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "webhook" - ], - "summary": "Test endpoint for creating webhook notifications", - "operationId": "createWebhookNotification", - "parameters": [ - { - "description": "The notification sent by webhook-client.", - "name": "body", - "in": "body", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - } - ], - "responses": { - "201": { - "description": "Successful creation", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - }, - "422": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, - "/webhook-notify": { - "post": { - "description": "This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The ` + "`" + `webhook-client` + "`" + ` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection.\n", - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "webhook" - ], - "summary": "Test endpoint for receiving messages from our own webhook-client", - "operationId": "receiveWebhookNotification", - "parameters": [ - { - "description": "The webhook notification being sent", - "name": "body", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - } - ], - "responses": { - "200": { - "description": "Received notification", - "schema": { - "$ref": "#/definitions/WebhookNotification" - } - }, - "400": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "401": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "403": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "500": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - } - }, - "definitions": { - "Address": { - "type": "object", - "required": [ - "streetAddress1", - "city", - "state", - "postalCode" - ], - "properties": { - "city": { - "type": "string", - "title": "City", - "example": "Anytown" - }, - "country": { - "description": "Two-letter country code", - "type": "string", - "title": "Country", - "default": "US", - "pattern": "^[A-Z]{2}$", - "x-nullable": true, - "example": "US" - }, - "county": { - "type": "string", - "title": "County", - "x-nullable": true, - "example": "LOS ANGELES" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isOconus": { - "type": "boolean", - "title": "isOconus", - "x-nullable": true, - "example": false - }, - "postalCode": { - "type": "string", - "format": "zip", - "title": "ZIP", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - }, - "state": { - "type": "string", - "title": "State", - "enum": [ - "AL", - "AK", - "AR", - "AZ", - "CA", - "CO", - "CT", - "DC", - "DE", - "FL", - "GA", - "HI", - "IA", - "ID", - "IL", - "IN", - "KS", - "KY", - "LA", - "MA", - "MD", - "ME", - "MI", - "MN", - "MO", - "MS", - "MT", - "NC", - "ND", - "NE", - "NH", - "NJ", - "NM", - "NV", - "NY", - "OH", - "OK", - "OR", - "PA", - "RI", - "SC", - "SD", - "TN", - "TX", - "UT", - "VA", - "VT", - "WA", - "WI", - "WV", - "WY" - ], - "x-display-value": { - "AK": "AK", - "AL": "AL", - "AR": "AR", - "AZ": "AZ", - "CA": "CA", - "CO": "CO", - "CT": "CT", - "DC": "DC", - "DE": "DE", - "FL": "FL", - "GA": "GA", - "HI": "HI", - "IA": "IA", - "ID": "ID", - "IL": "IL", - "IN": "IN", - "KS": "KS", - "KY": "KY", - "LA": "LA", - "MA": "MA", - "MD": "MD", - "ME": "ME", - "MI": "MI", - "MN": "MN", - "MO": "MO", - "MS": "MS", - "MT": "MT", - "NC": "NC", - "ND": "ND", - "NE": "NE", - "NH": "NH", - "NJ": "NJ", - "NM": "NM", - "NV": "NV", - "NY": "NY", - "OH": "OH", - "OK": "OK", - "OR": "OR", - "PA": "PA", - "RI": "RI", - "SC": "SC", - "SD": "SD", - "TN": "TN", - "TX": "TX", - "UT": "UT", - "VA": "VA", - "VT": "VT", - "WA": "WA", - "WI": "WI", - "WV": "WV", - "WY": "WY" - } - }, - "streetAddress1": { - "type": "string", - "title": "Street address 1", - "example": "123 Main Ave" - }, - "streetAddress2": { - "type": "string", - "title": "Street address 2", - "x-nullable": true, - "example": "Apartment 9000" - }, - "streetAddress3": { - "type": "string", - "title": "Address Line 3", - "x-nullable": true, - "example": "Montmârtre" - } - } - }, - "ClientError": { - "type": "object", - "required": [ - "title", - "detail", - "instance" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "Customer": { - "type": "object", - "required": [ - "firstName", - "lastName", - "dodID", - "rank", - "agency" - ], - "properties": { - "agency": { - "type": "string", - "title": "Agency customer is affilated with" - }, - "currentAddress": { - "$ref": "#/definitions/Address" - }, - "dodID": { - "type": "string" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "example": "Vanya" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "lastName": { - "type": "string", - "example": "Petrovna" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", - "x-nullable": true - }, - "rank": { - "$ref": "#/definitions/Rank" - }, - "userID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "DeptIndicator": { - "type": "string", - "title": "Dept. indicator", - "enum": [ - "NAVY_AND_MARINES", - "ARMY", - "ARMY_CORPS_OF_ENGINEERS", - "AIR_AND_SPACE_FORCE", - "COAST_GUARD", - "OFFICE_OF_SECRETARY_OF_DEFENSE" - ], - "x-display-value": { - "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", - "ARMY": "21 Army", - "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", - "COAST_GUARD": "70 Coast Guard", - "NAVY_AND_MARINES": "17 Navy and Marine Corps", - "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" - }, - "x-nullable": true - }, - "Document": { - "type": "object", - "required": [ - "id", - "serviceMemberID", - "uploads" - ], - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "serviceMemberID": { - "type": "string", - "format": "uuid", - "title": "The service member this document belongs to" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "DutyLocation": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "name": { - "type": "string", - "example": "Fort Bragg North Station" - } - } - }, - "Entitlement": { - "type": "object", - "properties": { - "authorizedWeight": { - "type": "integer", - "x-formatting": "weight", - "x-nullable": true, - "example": 2000 - }, - "dependentsAuthorized": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "gunSafe": { - "type": "boolean", - "example": false - }, - "id": { - "type": "string", - "format": "uuid", - "example": "571008b1-b0de-454d-b843-d71be9f02c04" - }, - "nonTemporaryStorage": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "organizationalClothingAndIndividualEquipment": { - "type": "boolean", - "example": false - }, - "privatelyOwnedVehicle": { - "type": "boolean", - "x-nullable": true, - "example": false - }, - "proGearWeight": { - "type": "integer", - "x-formatting": "weight", - "readOnly": true, - "example": 2000 - }, - "proGearWeightSpouse": { - "type": "integer", - "x-formatting": "weight", - "readOnly": true, - "example": 500 - }, - "requiredMedicalEquipmentWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "storageInTransit": { - "type": "integer", - "example": 90 - }, - "totalDependents": { - "type": "integer", - "example": 2 - }, - "totalWeight": { - "type": "integer", - "x-formatting": "weight", - "example": 500 - }, - "unaccompaniedBaggageAllowance": { - "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", - "type": "integer", - "x-nullable": true, - "example": 3 - } - } - }, - "Error": { - "type": "object", - "required": [ - "title", - "detail" - ], - "properties": { - "detail": { - "type": "string" - }, - "instance": { - "type": "string", - "format": "uuid" - }, - "title": { - "type": "string" - } - } - }, - "MTOAgent": { - "type": "object", - "properties": { - "agentType": { - "$ref": "#/definitions/MTOAgentType" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "email": { - "type": "string", - "format": "x-email", - "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", - "x-nullable": true - }, - "firstName": { - "type": "string", - "x-nullable": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "lastName": { - "type": "string", - "x-nullable": true - }, - "mtoShipmentID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "phone": { - "type": "string", - "format": "telephone", - "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", - "x-nullable": true - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOAgentType": { - "type": "string", - "title": "MTO Agent Type", - "enum": [ - "RELEASING_AGENT", - "RECEIVING_AGENT" - ], - "example": "RELEASING_AGENT" - }, - "MTOAgents": { - "type": "array", - "maxItems": 2, - "items": { - "$ref": "#/definitions/MTOAgent" - } - }, - "MTOHideMove": { - "description": "describes the MTO ID and a description reason why the move was hidden.", - "type": "object", - "properties": { - "hideReason": { - "description": "Reason the move was selected to be hidden", - "type": "string", - "x-nullable": true, - "example": "invalid name" - }, - "moveTaskOrderID": { - "description": "ID of the associated moveTaskOrder", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - } - } - }, - "MTOHideMovesResponse": { - "description": "describes the moves that were hidden that contained non-approved fake data to use in the MilMove system.", - "type": "object", - "properties": { - "moves": { - "description": "Array of moves that were hidden.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOHideMove" - } - }, - "numberMovesHidden": { - "description": "Number of moves that were hidden", - "type": "integer" - } - } - }, - "MTOServiceItem": { - "description": "MTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", - "type": "object", - "required": [ - "modelType", - "moveTaskOrderID" - ], - "properties": { - "eTag": { - "description": "ETag identifier required to update this object", - "type": "string", - "readOnly": true - }, - "id": { - "description": "ID of the service item", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "modelType": { - "$ref": "#/definitions/MTOServiceItemModelType" - }, - "moveTaskOrderID": { - "description": "ID of the associated moveTaskOrder", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoShipmentID": { - "description": "ID of the associated mtoShipment", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "reServiceName": { - "description": "Full descriptive name of the service", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "Reason the service item was rejected by the TOO", - "type": "string", - "x-nullable": true, - "example": "item was too heavy" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - }, - "discriminator": "modelType" - }, - "MTOServiceItemBasic": { - "description": "Describes a basic service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode" - ], - "properties": { - "reServiceCode": { - "$ref": "#/definitions/ReServiceCode" - } - } - } - ] - }, - "MTOServiceItemDestSIT": { - "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "dateOfContact1", - "timeMilitary1", - "firstAvailableDeliveryDate1", - "dateOfContact2", - "timeMilitary2", - "firstAvailableDeliveryDate2", - "sitEntryDate" - ], - "properties": { - "dateOfContact1": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "dateOfContact2": { - "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "firstAvailableDeliveryDate1": { - "description": "First available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date" - }, - "firstAvailableDeliveryDate2": { - "description": "Second available date that Prime can deliver SIT service item.", - "type": "string", - "format": "date" - }, - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DDFSIT", - "DDASIT" - ] - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "timeMilitary1": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "example": "1400Z" - }, - "timeMilitary2": { - "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", - "type": "string", - "pattern": "\\d{4}Z", - "example": "1400Z" - } - } - } - ] - }, - "MTOServiceItemDimension": { - "description": "Describes a dimension object for the MTOServiceItem.", - "type": "object", - "required": [ - "length", - "width", - "height" - ], - "properties": { - "height": { - "description": "Height in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "id": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "length": { - "description": "Length in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - }, - "width": { - "description": "Width in thousandth inches. 1000 thou = 1 inch.", - "type": "integer", - "format": "int32", - "example": 1000 - } - } - }, - "MTOServiceItemDomesticCrating": { - "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "item", - "crate", - "description" - ], - "properties": { - "crate": { - "$ref": "#/definitions/MTOServiceItemDimension" - }, - "description": { - "type": "string", - "example": "Decorated horse head to be crated." - }, - "item": { - "$ref": "#/definitions/MTOServiceItemDimension" - }, - "reServiceCode": { - "description": "Service codes allowed for this model type.", - "type": "string", - "enum": [ - "DCRT", - "DUCRT" - ] - }, - "standaloneCrate": { - "type": "boolean", - "x-nullable": true - } - } - } - ] - }, - "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", - "type": "string", - "enum": [ - "MTOServiceItemBasic", - "MTOServiceItemOriginSIT", - "MTOServiceItemDestSIT", - "MTOServiceItemShuttle", - "MTOServiceItemDomesticCrating", - "MTOServiceItemInternationalCrating" - ] - }, - "MTOServiceItemOriginSIT": { - "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reServiceCode", - "reason", - "sitPostalCode", - "sitEntryDate" - ], - "properties": { - "reServiceCode": { - "description": "Service code allowed for this model type.", - "type": "string", - "enum": [ - "DOFSIT", - "DOASIT" - ] - }, - "reason": { - "description": "Explanation of why Prime is picking up SIT item.", - "type": "string", - "example": "Storage items need to be picked up" - }, - "sitDepartureDate": { - "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", - "type": "string", - "format": "date", - "x-nullable": true - }, - "sitEntryDate": { - "description": "Entry date for the SIT", - "type": "string", - "format": "date" - }, - "sitPostalCode": { - "type": "string", - "format": "zip", - "pattern": "^(\\d{5}([\\-]\\d{4})?)$", - "example": "90210" - } - } - } - ] - }, - "MTOServiceItemShuttle": { - "description": "Describes a shuttle service item.", - "allOf": [ - { - "$ref": "#/definitions/MTOServiceItem" - }, - { - "type": "object", - "required": [ - "reason", - "reServiceCode", - "description" - ], - "properties": { - "actualWeight": { - "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4000 - }, - "estimatedWeight": { - "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", - "type": "integer", - "x-nullable": true, - "x-omitempty": false, - "example": 4200 - }, - "reServiceCode": { - "description": "Service codes allowed for this model type.", - "type": "string", - "enum": [ - "DOSHUT", - "DDSHUT" - ] - }, - "reason": { - "description": "Explanation of why a shuttle service is required.", - "type": "string", - "example": "Storage items need to be picked up." - } - } - } - ] - }, - "MTOServiceItemStatus": { - "description": "Describes all statuses for a MTOServiceItem.", - "type": "string", - "enum": [ - "SUBMITTED", - "APPROVED", - "REJECTED" - ] - }, - "MTOShipment": { - "properties": { - "actualPickupDate": { - "type": "string", - "format": "date" - }, - "agents": { - "$ref": "#/definitions/MTOAgents" - }, - "approvedDate": { - "description": "date when the shipment was given the status \"APPROVED\"", - "type": "string", - "format": "date", - "readOnly": true - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "customerRemarks": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "handle with care" - }, - "destinationAddress": { - "$ref": "#/definitions/Address" - }, - "diversion": { - "type": "boolean" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "firstAvailableDeliveryDate": { - "type": "string", - "format": "date" - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "marketCode": { - "description": "Single-letter designator for domestic (d) or international (i) shipments", - "type": "string", - "enum": [ - "d", - "i" - ], - "example": "d" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "mtoServiceItems": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "pickupAddress": { - "$ref": "#/definitions/Address" - }, - "pointOfContact": { - "description": "Email or id of a contact person for this update.", - "type": "string" - }, - "primeActualWeight": { - "type": "integer", - "example": 4500 - }, - "primeEstimatedWeight": { - "type": "integer", - "example": 4500 - }, - "primeEstimatedWeightRecordedDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "readOnly": true, - "example": "MTO Shipment not good enough" - }, - "requestedPickupDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "requiredDeliveryDate": { - "type": "string", - "format": "date", - "readOnly": true - }, - "scheduledPickupDate": { - "type": "string", - "format": "date" - }, - "secondaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "secondaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "shipmentType": { - "$ref": "#/definitions/MTOShipmentType" - }, - "status": { - "type": "string", - "enum": [ - "APPROVED", - "SUBMITTED", - "REJECTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ], - "readOnly": true - }, - "tertiaryDeliveryAddress": { - "$ref": "#/definitions/Address" - }, - "tertiaryPickupAddress": { - "$ref": "#/definitions/Address" - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MTOShipmentType": { - "type": "string", - "title": "Shipment Type", - "enum": [ - "HHG", - "HHG_INTO_NTS", - "HHG_OUTOF_NTS_DOMESTIC", - "PPM", - "BOAT_HAUL_AWAY", - "BOAT_TOW_AWAY", - "MOBILE_HOME", - "UNACCOMPANIED_BAGGAGE" - ], - "x-display-value": { - "BOAT_HAUL_AWAY": "Boat Haul-Away", - "BOAT_TOW_AWAY": "Boat Tow-Away", - "HHG": "HHG", - "HHG_INTO_NTS": "NTS", - "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", - "MOBILE_HOME": "Mobile Home", - "PPM": "PPM", - "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" - }, - "example": "HHG" - }, - "MTOShipments": { - "type": "array", - "items": { - "$ref": "#/definitions/MTOShipment" - } - }, - "MoveStatus": { - "description": "Current status of this MoveTaskOrder", - "type": "string", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "MoveTaskOrder": { - "type": "object", - "required": [ - "order", - "contractorID" - ], - "properties": { - "approvedAt": { - "description": "Indicates this MoveTaskOrder has been approved by an office user such as the Task Ordering Officer (TOO).\n", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "availableToPrimeAt": { - "description": "Indicates this MoveTaskOrder is available for Prime API handling.\n\nIn production, only MoveTaskOrders for which this is set will be available to the API.\n", - "type": "string", - "format": "date-time", - "x-nullable": true - }, - "contractorID": { - "description": "ID associated with the contractor, in this case Prime\n", - "type": "string", - "format": "uuid", - "example": "5db13bb4-6d29-4bdb-bc81-262f4513ecf6" - }, - "createdAt": { - "description": "Date the MoveTaskOrder was created on.", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eTag": { - "description": "Uniquely identifies the state of the MoveTaskOrder object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this MoveTaskOrder will require that this eTag be passed in with the If-Match header.\n", - "type": "string", - "readOnly": true - }, - "id": { - "description": "ID of the MoveTaskOrder object.", - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "moveCode": { - "description": "Unique 6-character code the customer can use to refer to their move", - "type": "string", - "readOnly": true, - "example": "ABC123" - }, - "mtoServiceItems": { - "description": "Array of MTOServiceItems associated with this MoveTaskOrder.", - "type": "array", - "items": { - "$ref": "#/definitions/MTOServiceItem" - } - }, - "mtoShipments": { - "$ref": "#/definitions/MTOShipments" - }, - "order": { - "$ref": "#/definitions/Order" - }, - "orderID": { - "description": "ID of the Order object", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequests": { - "$ref": "#/definitions/PaymentRequests" - }, - "ppmEstimatedWeight": { - "description": "If the move is a PPM, this is the estimated weight in lbs.", - "type": "integer" - }, - "ppmType": { - "description": "If the move is a PPM, indicates whether it is full or partial.", - "type": "string", - "enum": [ - "FULL", - "PARTIAL" - ] - }, - "referenceId": { - "description": "Unique ID associated with this Order.\n\nNo two MoveTaskOrders may have the same ID.\nAttempting to create a MoveTaskOrder may fail if this referenceId has been used already.\n", - "type": "string", - "readOnly": true, - "example": "1001-3456" - }, - "status": { - "$ref": "#/definitions/MoveStatus" - }, - "updatedAt": { - "description": "Date on which this MoveTaskOrder was last updated.", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "MoveTaskOrders": { - "type": "array", - "items": { - "$ref": "#/definitions/MoveTaskOrder" - } - }, - "Order": { - "type": "object", - "required": [ - "orderNumber", - "ordersType", - "ordersTypeDetail", - "rank", - "reportByDate", - "issueDate", - "status", - "uploadedOrdersID", - "tac", - "originDutyLocationID", - "destinationDutyLocationID", - "departmentIndicator" - ], - "properties": { - "customer": { - "$ref": "#/definitions/Customer" - }, - "customerID": { - "description": "ID of the Customer this Order belongs to.\n\nIf creating a MoveTaskOrder. either an existing customerID should be provided or the nested customer object should be populated for creation.\n", - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "departmentIndicator": { - "$ref": "#/definitions/DeptIndicator" - }, - "destinationDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "destinationDutyLocationID": { - "description": "ID of the destination duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "eTag": { - "description": "Uniquely identifies the state of the Order object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this Order will require that this eTag be passed in with the If-Match header.\n", - "type": "string", - "readOnly": true - }, - "entitlement": { - "$ref": "#/definitions/Entitlement" - }, - "id": { - "description": "ID of the Order object.", - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "issueDate": { - "description": "The date the orders were issued.", - "type": "string", - "format": "date" - }, - "orderNumber": { - "description": "ID of the military orders associated with this move.", - "type": "string", - "x-nullable": true, - "example": "030-00362" - }, - "ordersType": { - "$ref": "#/definitions/OrdersType" - }, - "ordersTypeDetail": { - "$ref": "#/definitions/OrdersTypeDetail" - }, - "originDutyLocation": { - "$ref": "#/definitions/DutyLocation" - }, - "originDutyLocationID": { - "description": "ID of the origin duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rank": { - "$ref": "#/definitions/Rank" - }, - "reportByDate": { - "description": "Date that the service member must report to the new DutyLocation by.", - "type": "string", - "format": "date" - }, - "status": { - "$ref": "#/definitions/OrdersStatus" - }, - "tac": { - "type": "string", - "title": "TAC", - "example": "F8J1" - }, - "uploadedOrders": { - "$ref": "#/definitions/Document" - }, - "uploadedOrdersID": { - "description": "ID of the uploaded document.", - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "OrdersStatus": { - "type": "string", - "title": "Move status", - "enum": [ - "DRAFT", - "SUBMITTED", - "APPROVED", - "CANCELED" - ], - "x-display-value": { - "APPROVED": "Approved", - "CANCELED": "Canceled", - "DRAFT": "Draft", - "SUBMITTED": "Submitted" - } - }, - "OrdersType": { - "type": "string", - "title": "Orders type", - "enum": [ - "PERMANENT_CHANGE_OF_STATION", - "LOCAL_MOVE", - "RETIREMENT", - "SEPARATION", - "GHC", - "NTS", - "WOUNDED_WARRIOR", - "BLUEBARK", - "TEMPORARY_DUTY", - "EARLY_RETURN_OF_DEPENDENTS", - "STUDENT_TRAVEL" - ], - "x-display-value": { - "BLUEBARK": "BLUEBARK", - "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", - "GHC": "GHC", - "LOCAL_MOVE": "Local Move", - "NTS": "NTS", - "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", - "RETIREMENT": "Retirement", - "SEPARATION": "Separation", - "STUDENT_TRAVEL": "Student Travel", - "TEMPORARY_DUTY": "Temporary Duty (TDY)", - "WOUNDED_WARRIOR": "Wounded Warrior" - } - }, - "OrdersTypeDetail": { - "type": "string", - "title": "Orders type detail", - "enum": [ - "HHG_PERMITTED", - "PCS_TDY", - "HHG_RESTRICTED_PROHIBITED", - "HHG_RESTRICTED_AREA", - "INSTRUCTION_20_WEEKS", - "HHG_PROHIBITED_20_WEEKS", - "DELAYED_APPROVAL" - ], - "x-display-value": { - "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", - "HHG_PERMITTED": "Shipment of HHG Permitted", - "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", - "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", - "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", - "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", - "PCS_TDY": "PCS with TDY Enroute" - }, - "x-nullable": true - }, - "PaymentRequest": { - "type": "object", - "properties": { - "documentPackage": { - "$ref": "#/definitions/ProofOfServicePackage" - }, - "eTag": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "isFinal": { - "type": "boolean", - "default": false - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "paymentRequestNumber": { - "type": "string", - "readOnly": true, - "example": "1234-5678-1" - }, - "recalculationOfPaymentRequestID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "PaymentRequestEDI": { - "type": "object", - "properties": { - "edi": { - "type": "string", - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "PaymentRequestStatus": { - "type": "string", - "title": "Payment Request Status", - "enum": [ - "PENDING", - "REVIEWED", - "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", - "SENT_TO_GEX", - "TPPS_RECEIVED", - "PAID", - "EDI_ERROR", - "DEPRECATED" - ] - }, - "PaymentRequests": { - "type": "array", - "items": { - "$ref": "#/definitions/PaymentRequest" - } - }, - "ProcessReviewedPaymentRequests": { - "type": "object", - "required": [ - "sendToSyncada", - "readFromSyncada", - "deleteFromSyncada" - ], - "properties": { - "deleteFromSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "paymentRequestID": { - "type": "string", - "format": "uuid", - "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" - }, - "readFromSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "sendToSyncada": { - "type": "boolean", - "x-nullable": true, - "example": true - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "ProofOfServicePackage": { - "type": "object", - "properties": { - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "uploads": { - "type": "array", - "items": { - "$ref": "#/definitions/UploadWithOmissions" - } - } - } - }, - "Rank": { - "description": "Rank of the service member, must match specific list of available ranks.", - "type": "string", - "enum": [ - "E_1", - "E_2", - "E_3", - "E_4", - "E_5", - "E_6", - "E_7", - "E_8", - "E_9", - "E_9_SPECIAL_SENIOR_ENLISTED", - "O_1_ACADEMY_GRADUATE", - "O_2", - "O_3", - "O_4", - "O_5", - "O_6", - "O_7", - "O_8", - "O_9", - "O_10", - "W_1", - "W_2", - "W_3", - "W_4", - "W_5", - "AVIATION_CADET", - "CIVILIAN_EMPLOYEE", - "ACADEMY_CADET", - "MIDSHIPMAN" - ] - }, - "ReServiceCode": { - "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", - "type": "string", - "enum": [ - "CS", - "DBHF", - "DBTF", - "DCRT", - "DDASIT", - "DDDSIT", - "DDFSIT", - "DDP", - "DDSHUT", - "DLH", - "DMHF", - "DNPK", - "DOASIT", - "DOFSIT", - "DOP", - "DOPSIT", - "DOSHUT", - "DPK", - "DSH", - "DUCRT", - "DUPK", - "FSC", - "IBHF", - "IBTF", - "ICOLH", - "ICOUB", - "ICRT", - "IDASIT", - "IDDSIT", - "IDFSIT", - "IDSHUT", - "IHPK", - "IHUPK", - "INPK", - "IOASIT", - "IOCLH", - "IOCUB", - "IOFSIT", - "IOOLH", - "IOOUB", - "IOPSIT", - "IOSHUT", - "IUBPK", - "IUBUPK", - "IUCRT", - "MS", - "NSTH", - "NSTUB" - ] - }, - "UpdateMTOServiceItemStatus": { - "properties": { - "rejectionReason": { - "description": "Reason the service item was rejected by the TOO\"\"", - "type": "string", - "x-nullable": true, - "example": "item was too heavy" - }, - "status": { - "$ref": "#/definitions/MTOServiceItemStatus" - } - } - }, - "UpdateMTOShipmentStatus": { - "properties": { - "rejectionReason": { - "type": "string", - "x-nullable": true, - "example": "MTO Shipment not good enough" - }, - "status": { - "type": "string", - "enum": [ - "REJECTED", - "APPROVED", - "SUBMITTED", - "CANCELLATION_REQUESTED", - "CANCELED", - "DIVERSION_REQUESTED" - ] - } - } - }, - "UpdatePaymentRequestStatus": { - "type": "object", - "properties": { - "eTag": { - "description": "Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for ` + "`" + `If-Match` + "`" + `. Required when sending PUT or PATCH requests to prevent updating stale data.", - "type": "string", - "readOnly": true - }, - "rejectionReason": { - "description": "A written reason to provide context for the status.", - "type": "string", - "x-nullable": true, - "example": "documentation was incomplete" - }, - "status": { - "$ref": "#/definitions/PaymentRequestStatus" - } - } - }, - "UploadWithOmissions": { - "description": "An uploaded file.", - "type": "object", - "required": [ - "filename", - "contentType", - "bytes" - ], - "properties": { - "bytes": { - "type": "integer" - }, - "contentType": { - "type": "string", - "format": "mime-type", - "example": "application/pdf" - }, - "createdAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "filename": { - "type": "string", - "example": "filename.pdf" - }, - "id": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "rotation": { - "type": "integer" - }, - "status": { - "type": "string", - "enum": [ - "INFECTED", - "CLEAN", - "PROCESSING" - ] - }, - "updatedAt": { - "type": "string", - "format": "date-time", - "readOnly": true - }, - "url": { - "type": "string", - "format": "uri", - "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" - } - } - }, - "ValidationError": { - "allOf": [ - { - "$ref": "#/definitions/ClientError" - }, - { - "type": "object", - "required": [ - "invalidFields" - ], - "properties": { - "invalidFields": { - "type": "object", - "additionalProperties": { - "description": "List of errors for the field", - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - ] - }, - "WebhookNotification": { - "type": "object", - "properties": { - "createdAt": { - "description": "Time representing when the event was triggered", - "type": "string", - "format": "date-time", - "readOnly": true - }, - "eventKey": { - "description": "Name of event triggered", - "type": "string", - "example": "PaymentRequest.Update" - }, - "firstAttemptedAt": { - "description": "Time representing when the system firstAttempted to send this notification", - "type": "string", - "format": "date-time", - "x-nullable": true, - "readOnly": true - }, - "id": { - "type": "string", - "format": "uuid", - "readOnly": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "moveTaskOrderID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "object": { - "type": "string", - "format": "JSON", - "x-nullable": true - }, - "objectID": { - "type": "string", - "format": "uuid", - "x-nullable": true, - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "status": { - "$ref": "#/definitions/WebhookNotificationStatus" - }, - "traceID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "updatedAt": { - "description": "Time representing when the notification was last updated", - "type": "string", - "format": "date-time", - "readOnly": true - } - } - }, - "WebhookNotificationStatus": { - "description": "Statuses available for a Webhook Notification", - "type": "string", - "enum": [ - "PENDING", - "SENT", - "SKIPPED", - "FAILING", - "FAILED" - ] - } - }, - "parameters": { - "ifMatch": { - "type": "string", - "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", - "name": "If-Match", - "in": "header", - "required": true - } - }, - "responses": { - "Conflict": { - "description": "There was a conflict with the request.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "InvalidRequest": { - "description": "The request payload is invalid.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "NotFound": { - "description": "The requested resource wasn't found.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PermissionDenied": { - "description": "The request was denied.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "PreconditionFailed": { - "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", - "schema": { - "$ref": "#/definitions/ClientError" - } - }, - "ServerError": { - "description": "A server error occurred.", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "UnprocessableEntity": { - "description": "The payload was unprocessable.", - "schema": { - "$ref": "#/definitions/ValidationError" - } - } - }, - "tags": [ - { - "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", - "name": "moveTaskOrder" - }, - { - "name": "paymentRequest" - }, - { - "name": "mtoServiceItem" - }, - { - "name": "mtoShipment" - }, - { - "name": "webhook" - } - ] -}`)) -} diff --git a/pkg/gen/supportapi/server.go b/pkg/gen/supportapi/server.go deleted file mode 100644 index bfa7a7c2ea0..00000000000 --- a/pkg/gen/supportapi/server.go +++ /dev/null @@ -1,507 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportapi - -import ( - "context" - "crypto/tls" - "crypto/x509" - "errors" - "fmt" - "log" - "net" - "net/http" - "os" - "os/signal" - "strconv" - "sync" - "sync/atomic" - "syscall" - "time" - - "github.com/go-openapi/runtime/flagext" - "github.com/go-openapi/swag" - flags "github.com/jessevdk/go-flags" - "golang.org/x/net/netutil" - - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations" -) - -const ( - schemeHTTP = "http" - schemeHTTPS = "https" - schemeUnix = "unix" -) - -var defaultSchemes []string - -func init() { - defaultSchemes = []string{ - schemeHTTP, - } -} - -// NewServer creates a new api mymove server but does not configure it -func NewServer(api *supportoperations.MymoveAPI) *Server { - s := new(Server) - - s.shutdown = make(chan struct{}) - s.api = api - s.interrupt = make(chan os.Signal, 1) - return s -} - -// ConfigureAPI configures the API and handlers. -func (s *Server) ConfigureAPI() { - if s.api != nil { - s.handler = configureAPI(s.api) - } -} - -// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse -func (s *Server) ConfigureFlags() { - if s.api != nil { - configureFlags(s.api) - } -} - -// Server for the mymove API -type Server struct { - EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` - CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` - GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` - MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` - - SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` - domainSocketL net.Listener - - Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` - Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` - ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` - KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` - ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` - WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` - httpServerL net.Listener - - TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` - TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` - TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` - TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` - TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` - TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` - TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` - TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` - TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` - httpsServerL net.Listener - - api *supportoperations.MymoveAPI - handler http.Handler - hasListeners bool - shutdown chan struct{} - shuttingDown int32 - interrupted bool - interrupt chan os.Signal -} - -// Logf logs message either via defined user logger or via system one if no user logger is defined. -func (s *Server) Logf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - } else { - log.Printf(f, args...) - } -} - -// Fatalf logs message either via defined user logger or via system one if no user logger is defined. -// Exits with non-zero status after printing -func (s *Server) Fatalf(f string, args ...interface{}) { - if s.api != nil && s.api.Logger != nil { - s.api.Logger(f, args...) - os.Exit(1) - } else { - log.Fatalf(f, args...) - } -} - -// SetAPI configures the server with the specified API. Needs to be called before Serve -func (s *Server) SetAPI(api *supportoperations.MymoveAPI) { - if api == nil { - s.api = nil - s.handler = nil - return - } - - s.api = api - s.handler = configureAPI(api) -} - -func (s *Server) hasScheme(scheme string) bool { - schemes := s.EnabledListeners - if len(schemes) == 0 { - schemes = defaultSchemes - } - - for _, v := range schemes { - if v == scheme { - return true - } - } - return false -} - -// Serve the api -func (s *Server) Serve() (err error) { - if !s.hasListeners { - if err = s.Listen(); err != nil { - return err - } - } - - // set default handler, if none is set - if s.handler == nil { - if s.api == nil { - return errors.New("can't create the default handler, as no api is set") - } - - s.SetHandler(s.api.Serve(nil)) - } - - wg := new(sync.WaitGroup) - once := new(sync.Once) - signalNotify(s.interrupt) - go handleInterrupt(once, s) - - servers := []*http.Server{} - - if s.hasScheme(schemeUnix) { - domainSocket := new(http.Server) - domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) - domainSocket.Handler = s.handler - if int64(s.CleanupTimeout) > 0 { - domainSocket.IdleTimeout = s.CleanupTimeout - } - - configureServer(domainSocket, "unix", string(s.SocketPath)) - - servers = append(servers, domainSocket) - wg.Add(1) - s.Logf("Serving mymove at unix://%s", s.SocketPath) - go func(l net.Listener) { - defer wg.Done() - if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) - }(s.domainSocketL) - } - - if s.hasScheme(schemeHTTP) { - httpServer := new(http.Server) - httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpServer.ReadTimeout = s.ReadTimeout - httpServer.WriteTimeout = s.WriteTimeout - httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) - if s.ListenLimit > 0 { - s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) - } - - if int64(s.CleanupTimeout) > 0 { - httpServer.IdleTimeout = s.CleanupTimeout - } - - httpServer.Handler = s.handler - - configureServer(httpServer, "http", s.httpServerL.Addr().String()) - - servers = append(servers, httpServer) - wg.Add(1) - s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at http://%s", l.Addr()) - }(s.httpServerL) - } - - if s.hasScheme(schemeHTTPS) { - httpsServer := new(http.Server) - httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) - httpsServer.ReadTimeout = s.TLSReadTimeout - httpsServer.WriteTimeout = s.TLSWriteTimeout - httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) - if s.TLSListenLimit > 0 { - s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) - } - if int64(s.CleanupTimeout) > 0 { - httpsServer.IdleTimeout = s.CleanupTimeout - } - httpsServer.Handler = s.handler - - // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go - httpsServer.TLSConfig = &tls.Config{ - // Causes servers to use Go's default ciphersuite preferences, - // which are tuned to avoid attacks. Does nothing on clients. - PreferServerCipherSuites: true, - // Only use curves which have assembly implementations - // https://github.com/golang/go/tree/master/src/crypto/elliptic - CurvePreferences: []tls.CurveID{tls.CurveP256}, - // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility - NextProtos: []string{"h2", "http/1.1"}, - // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols - MinVersion: tls.VersionTLS12, - // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy - CipherSuites: []uint16{ - tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, - tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, - tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, - tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, - }, - } - - // build standard config from server options - if s.TLSCertificate != "" && s.TLSCertificateKey != "" { - httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) - httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) - if err != nil { - return err - } - } - - if s.TLSCACertificate != "" { - // include specified CA certificate - caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) - if caCertErr != nil { - return caCertErr - } - caCertPool := x509.NewCertPool() - ok := caCertPool.AppendCertsFromPEM(caCert) - if !ok { - return fmt.Errorf("cannot parse CA certificate") - } - httpsServer.TLSConfig.ClientCAs = caCertPool - httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert - } - - // call custom TLS configurator - configureTLS(httpsServer.TLSConfig) - - if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { - // after standard and custom config are passed, this ends up with no certificate - if s.TLSCertificate == "" { - if s.TLSCertificateKey == "" { - s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") - } - s.Fatalf("the required flag `--tls-certificate` was not specified") - } - if s.TLSCertificateKey == "" { - s.Fatalf("the required flag `--tls-key` was not specified") - } - // this happens with a wrong custom TLS configurator - s.Fatalf("no certificate was configured for TLS") - } - - configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) - - servers = append(servers, httpsServer) - wg.Add(1) - s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) - go func(l net.Listener) { - defer wg.Done() - if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { - s.Fatalf("%v", err) - } - s.Logf("Stopped serving mymove at https://%s", l.Addr()) - }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) - } - - wg.Add(1) - go s.handleShutdown(wg, &servers) - - wg.Wait() - return nil -} - -// Listen creates the listeners for the server -func (s *Server) Listen() error { - if s.hasListeners { // already done this - return nil - } - - if s.hasScheme(schemeHTTPS) { - // Use http host if https host wasn't defined - if s.TLSHost == "" { - s.TLSHost = s.Host - } - // Use http listen limit if https listen limit wasn't defined - if s.TLSListenLimit == 0 { - s.TLSListenLimit = s.ListenLimit - } - // Use http tcp keep alive if https tcp keep alive wasn't defined - if int64(s.TLSKeepAlive) == 0 { - s.TLSKeepAlive = s.KeepAlive - } - // Use http read timeout if https read timeout wasn't defined - if int64(s.TLSReadTimeout) == 0 { - s.TLSReadTimeout = s.ReadTimeout - } - // Use http write timeout if https write timeout wasn't defined - if int64(s.TLSWriteTimeout) == 0 { - s.TLSWriteTimeout = s.WriteTimeout - } - } - - if s.hasScheme(schemeUnix) { - domSockListener, err := net.Listen("unix", string(s.SocketPath)) - if err != nil { - return err - } - s.domainSocketL = domSockListener - } - - if s.hasScheme(schemeHTTP) { - listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) - if err != nil { - return err - } - - h, p, err := swag.SplitHostPort(listener.Addr().String()) - if err != nil { - return err - } - s.Host = h - s.Port = p - s.httpServerL = listener - } - - if s.hasScheme(schemeHTTPS) { - tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) - if err != nil { - return err - } - - sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) - if err != nil { - return err - } - s.TLSHost = sh - s.TLSPort = sp - s.httpsServerL = tlsListener - } - - s.hasListeners = true - return nil -} - -// Shutdown server and clean up resources -func (s *Server) Shutdown() error { - if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { - close(s.shutdown) - } - return nil -} - -func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { - // wg.Done must occur last, after s.api.ServerShutdown() - // (to preserve old behaviour) - defer wg.Done() - - <-s.shutdown - - servers := *serversPtr - - ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) - defer cancel() - - // first execute the pre-shutdown hook - s.api.PreServerShutdown() - - shutdownChan := make(chan bool) - for i := range servers { - server := servers[i] - go func() { - var success bool - defer func() { - shutdownChan <- success - }() - if err := server.Shutdown(ctx); err != nil { - // Error from closing listeners, or context timeout: - s.Logf("HTTP server Shutdown: %v", err) - } else { - success = true - } - }() - } - - // Wait until all listeners have successfully shut down before calling ServerShutdown - success := true - for range servers { - success = success && <-shutdownChan - } - if success { - s.api.ServerShutdown() - } -} - -// GetHandler returns a handler useful for testing -func (s *Server) GetHandler() http.Handler { - return s.handler -} - -// SetHandler allows for setting a http handler on this server -func (s *Server) SetHandler(handler http.Handler) { - s.handler = handler -} - -// UnixListener returns the domain socket listener -func (s *Server) UnixListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.domainSocketL, nil -} - -// HTTPListener returns the http listener -func (s *Server) HTTPListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpServerL, nil -} - -// TLSListener returns the https listener -func (s *Server) TLSListener() (net.Listener, error) { - if !s.hasListeners { - if err := s.Listen(); err != nil { - return nil, err - } - } - return s.httpsServerL, nil -} - -func handleInterrupt(once *sync.Once, s *Server) { - once.Do(func() { - for range s.interrupt { - if s.interrupted { - s.Logf("Server already shutting down") - continue - } - s.interrupted = true - s.Logf("Shutting down... ") - if err := s.Shutdown(); err != nil { - s.Logf("HTTP server Shutdown: %v", err) - } - } - }) -} - -func signalNotify(interrupt chan<- os.Signal) { - signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go deleted file mode 100644 index e2b0a3a966b..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateMoveTaskOrderHandlerFunc turns a function with the right signature into a create move task order handler -type CreateMoveTaskOrderHandlerFunc func(CreateMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateMoveTaskOrderHandlerFunc) Handle(params CreateMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// CreateMoveTaskOrderHandler interface for that can handle valid create move task order params -type CreateMoveTaskOrderHandler interface { - Handle(CreateMoveTaskOrderParams) middleware.Responder -} - -// NewCreateMoveTaskOrder creates a new http.Handler for the create move task order operation -func NewCreateMoveTaskOrder(ctx *middleware.Context, handler CreateMoveTaskOrderHandler) *CreateMoveTaskOrder { - return &CreateMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - CreateMoveTaskOrder swagger:route POST /move-task-orders moveTaskOrder createMoveTaskOrder - -createMoveTaskOrder - -Creates an instance of moveTaskOrder. -Currently this will also create a number of nested objects but not all. -It will currently create -* MoveTaskOrder -* Order -* Customer -* User -* Entitlement - -It will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID, -origin duty station ID, and an uploaded orders ID to be passed into the request. - -This is a support endpoint and will not be available in production. -*/ -type CreateMoveTaskOrder struct { - Context *middleware.Context - Handler CreateMoveTaskOrderHandler -} - -func (o *CreateMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go deleted file mode 100644 index fd9e4a1971c..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewCreateMoveTaskOrderParams creates a new CreateMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewCreateMoveTaskOrderParams() CreateMoveTaskOrderParams { - - return CreateMoveTaskOrderParams{} -} - -// CreateMoveTaskOrderParams contains all the bound params for the create move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters createMoveTaskOrder -type CreateMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *supportmessages.MoveTaskOrder -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateMoveTaskOrderParams() beforehand. -func (o *CreateMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.MoveTaskOrder - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go deleted file mode 100644 index 77d995a68be..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go +++ /dev/null @@ -1,329 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// CreateMoveTaskOrderCreatedCode is the HTTP code returned for type CreateMoveTaskOrderCreated -const CreateMoveTaskOrderCreatedCode int = 201 - -/* -CreateMoveTaskOrderCreated Successfully created MoveTaskOrder object. - -swagger:response createMoveTaskOrderCreated -*/ -type CreateMoveTaskOrderCreated struct { - - /* - In: Body - */ - Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderCreated creates CreateMoveTaskOrderCreated with default headers values -func NewCreateMoveTaskOrderCreated() *CreateMoveTaskOrderCreated { - - return &CreateMoveTaskOrderCreated{} -} - -// WithPayload adds the payload to the create move task order created response -func (o *CreateMoveTaskOrderCreated) WithPayload(payload *supportmessages.MoveTaskOrder) *CreateMoveTaskOrderCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order created response -func (o *CreateMoveTaskOrderCreated) SetPayload(payload *supportmessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderBadRequestCode is the HTTP code returned for type CreateMoveTaskOrderBadRequest -const CreateMoveTaskOrderBadRequestCode int = 400 - -/* -CreateMoveTaskOrderBadRequest The request payload is invalid. - -swagger:response createMoveTaskOrderBadRequest -*/ -type CreateMoveTaskOrderBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderBadRequest creates CreateMoveTaskOrderBadRequest with default headers values -func NewCreateMoveTaskOrderBadRequest() *CreateMoveTaskOrderBadRequest { - - return &CreateMoveTaskOrderBadRequest{} -} - -// WithPayload adds the payload to the create move task order bad request response -func (o *CreateMoveTaskOrderBadRequest) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order bad request response -func (o *CreateMoveTaskOrderBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderUnauthorizedCode is the HTTP code returned for type CreateMoveTaskOrderUnauthorized -const CreateMoveTaskOrderUnauthorizedCode int = 401 - -/* -CreateMoveTaskOrderUnauthorized The request was denied. - -swagger:response createMoveTaskOrderUnauthorized -*/ -type CreateMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderUnauthorized creates CreateMoveTaskOrderUnauthorized with default headers values -func NewCreateMoveTaskOrderUnauthorized() *CreateMoveTaskOrderUnauthorized { - - return &CreateMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the create move task order unauthorized response -func (o *CreateMoveTaskOrderUnauthorized) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order unauthorized response -func (o *CreateMoveTaskOrderUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderForbiddenCode is the HTTP code returned for type CreateMoveTaskOrderForbidden -const CreateMoveTaskOrderForbiddenCode int = 403 - -/* -CreateMoveTaskOrderForbidden The request was denied. - -swagger:response createMoveTaskOrderForbidden -*/ -type CreateMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderForbidden creates CreateMoveTaskOrderForbidden with default headers values -func NewCreateMoveTaskOrderForbidden() *CreateMoveTaskOrderForbidden { - - return &CreateMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the create move task order forbidden response -func (o *CreateMoveTaskOrderForbidden) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order forbidden response -func (o *CreateMoveTaskOrderForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderNotFoundCode is the HTTP code returned for type CreateMoveTaskOrderNotFound -const CreateMoveTaskOrderNotFoundCode int = 404 - -/* -CreateMoveTaskOrderNotFound The requested resource wasn't found. - -swagger:response createMoveTaskOrderNotFound -*/ -type CreateMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderNotFound creates CreateMoveTaskOrderNotFound with default headers values -func NewCreateMoveTaskOrderNotFound() *CreateMoveTaskOrderNotFound { - - return &CreateMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the create move task order not found response -func (o *CreateMoveTaskOrderNotFound) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order not found response -func (o *CreateMoveTaskOrderNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderUnprocessableEntityCode is the HTTP code returned for type CreateMoveTaskOrderUnprocessableEntity -const CreateMoveTaskOrderUnprocessableEntityCode int = 422 - -/* -CreateMoveTaskOrderUnprocessableEntity The payload was unprocessable. - -swagger:response createMoveTaskOrderUnprocessableEntity -*/ -type CreateMoveTaskOrderUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderUnprocessableEntity creates CreateMoveTaskOrderUnprocessableEntity with default headers values -func NewCreateMoveTaskOrderUnprocessableEntity() *CreateMoveTaskOrderUnprocessableEntity { - - return &CreateMoveTaskOrderUnprocessableEntity{} -} - -// WithPayload adds the payload to the create move task order unprocessable entity response -func (o *CreateMoveTaskOrderUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *CreateMoveTaskOrderUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order unprocessable entity response -func (o *CreateMoveTaskOrderUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type CreateMoveTaskOrderInternalServerError -const CreateMoveTaskOrderInternalServerErrorCode int = 500 - -/* -CreateMoveTaskOrderInternalServerError A server error occurred. - -swagger:response createMoveTaskOrderInternalServerError -*/ -type CreateMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewCreateMoveTaskOrderInternalServerError creates CreateMoveTaskOrderInternalServerError with default headers values -func NewCreateMoveTaskOrderInternalServerError() *CreateMoveTaskOrderInternalServerError { - - return &CreateMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the create move task order internal server error response -func (o *CreateMoveTaskOrderInternalServerError) WithPayload(payload *supportmessages.Error) *CreateMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create move task order internal server error response -func (o *CreateMoveTaskOrderInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go deleted file mode 100644 index 02b026b8c23..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateMoveTaskOrderURL generates an URL for the create move task order operation -type CreateMoveTaskOrderURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMoveTaskOrderURL) WithBasePath(bp string) *CreateMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go deleted file mode 100644 index 06ac6848cb3..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go +++ /dev/null @@ -1,63 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler -type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { - return fn(params) -} - -// GetMoveTaskOrderHandler interface for that can handle valid get move task order params -type GetMoveTaskOrderHandler interface { - Handle(GetMoveTaskOrderParams) middleware.Responder -} - -// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation -func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { - return &GetMoveTaskOrder{Context: ctx, Handler: handler} -} - -/* - GetMoveTaskOrder swagger:route GET /move-task-orders/{moveTaskOrderID} moveTaskOrder getMoveTaskOrder - -getMoveTaskOrder - -### Functionality -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. - -This is a support endpoint and is not available in production. -*/ -type GetMoveTaskOrder struct { - Context *middleware.Context - Handler GetMoveTaskOrderHandler -} - -func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetMoveTaskOrderParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index 0e5f3196d46..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,71 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object -// -// There are no default values defined in the spec. -func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { - - return GetMoveTaskOrderParams{} -} - -// GetMoveTaskOrderParams contains all the bound params for the get move task order operation -// typically these are obtained from a http.Request -// -// swagger:parameters getMoveTaskOrder -type GetMoveTaskOrderParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of move task order to use. - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. -func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *GetMoveTaskOrderParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 6b7a03369f0..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK -const GetMoveTaskOrderOKCode int = 200 - -/* -GetMoveTaskOrderOK Successfully retrieve an individual move task order. - -swagger:response getMoveTaskOrderOK -*/ -type GetMoveTaskOrderOK struct { - - /* - In: Body - */ - Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - - return &GetMoveTaskOrderOK{} -} - -// WithPayload adds the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) WithPayload(payload *supportmessages.MoveTaskOrder) *GetMoveTaskOrderOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order o k response -func (o *GetMoveTaskOrderOK) SetPayload(payload *supportmessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized -const GetMoveTaskOrderUnauthorizedCode int = 401 - -/* -GetMoveTaskOrderUnauthorized The request was denied. - -swagger:response getMoveTaskOrderUnauthorized -*/ -type GetMoveTaskOrderUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - - return &GetMoveTaskOrderUnauthorized{} -} - -// WithPayload adds the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden -const GetMoveTaskOrderForbiddenCode int = 403 - -/* -GetMoveTaskOrderForbidden The request was denied. - -swagger:response getMoveTaskOrderForbidden -*/ -type GetMoveTaskOrderForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - - return &GetMoveTaskOrderForbidden{} -} - -// WithPayload adds the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound -const GetMoveTaskOrderNotFoundCode int = 404 - -/* -GetMoveTaskOrderNotFound The requested resource wasn't found. - -swagger:response getMoveTaskOrderNotFound -*/ -type GetMoveTaskOrderNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - - return &GetMoveTaskOrderNotFound{} -} - -// WithPayload adds the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order not found response -func (o *GetMoveTaskOrderNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError -const GetMoveTaskOrderInternalServerErrorCode int = 500 - -/* -GetMoveTaskOrderInternalServerError A server error occurred. - -swagger:response getMoveTaskOrderInternalServerError -*/ -type GetMoveTaskOrderInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - - return &GetMoveTaskOrderInternalServerError{} -} - -// WithPayload adds the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *supportmessages.Error) *GetMoveTaskOrderInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go deleted file mode 100644 index e242bf4cb95..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// GetMoveTaskOrderURL generates an URL for the get move task order operation -type GetMoveTaskOrderURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on GetMoveTaskOrderURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetMoveTaskOrderURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go deleted file mode 100644 index ae4ef40e9a1..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// HideNonFakeMoveTaskOrdersHandlerFunc turns a function with the right signature into a hide non fake move task orders handler -type HideNonFakeMoveTaskOrdersHandlerFunc func(HideNonFakeMoveTaskOrdersParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn HideNonFakeMoveTaskOrdersHandlerFunc) Handle(params HideNonFakeMoveTaskOrdersParams) middleware.Responder { - return fn(params) -} - -// HideNonFakeMoveTaskOrdersHandler interface for that can handle valid hide non fake move task orders params -type HideNonFakeMoveTaskOrdersHandler interface { - Handle(HideNonFakeMoveTaskOrdersParams) middleware.Responder -} - -// NewHideNonFakeMoveTaskOrders creates a new http.Handler for the hide non fake move task orders operation -func NewHideNonFakeMoveTaskOrders(ctx *middleware.Context, handler HideNonFakeMoveTaskOrdersHandler) *HideNonFakeMoveTaskOrders { - return &HideNonFakeMoveTaskOrders{Context: ctx, Handler: handler} -} - -/* - HideNonFakeMoveTaskOrders swagger:route PATCH /move-task-orders/hide moveTaskOrder hideNonFakeMoveTaskOrders - -hideNonFakeMoveTaskOrders - -Updates move task order without fake user data `show` to false. No request body required.
-
-This is a support endpoint and will not be available in production. -*/ -type HideNonFakeMoveTaskOrders struct { - Context *middleware.Context - Handler HideNonFakeMoveTaskOrdersHandler -} - -func (o *HideNonFakeMoveTaskOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewHideNonFakeMoveTaskOrdersParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go deleted file mode 100644 index b28c903b281..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewHideNonFakeMoveTaskOrdersParams creates a new HideNonFakeMoveTaskOrdersParams object -// -// There are no default values defined in the spec. -func NewHideNonFakeMoveTaskOrdersParams() HideNonFakeMoveTaskOrdersParams { - - return HideNonFakeMoveTaskOrdersParams{} -} - -// HideNonFakeMoveTaskOrdersParams contains all the bound params for the hide non fake move task orders operation -// typically these are obtained from a http.Request -// -// swagger:parameters hideNonFakeMoveTaskOrders -type HideNonFakeMoveTaskOrdersParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewHideNonFakeMoveTaskOrdersParams() beforehand. -func (o *HideNonFakeMoveTaskOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go deleted file mode 100644 index 3b8610b7ad1..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// HideNonFakeMoveTaskOrdersOKCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersOK -const HideNonFakeMoveTaskOrdersOKCode int = 200 - -/* -HideNonFakeMoveTaskOrdersOK Successfully hid MTOs. - -swagger:response hideNonFakeMoveTaskOrdersOK -*/ -type HideNonFakeMoveTaskOrdersOK struct { - - /* - In: Body - */ - Payload *supportmessages.MTOHideMovesResponse `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersOK creates HideNonFakeMoveTaskOrdersOK with default headers values -func NewHideNonFakeMoveTaskOrdersOK() *HideNonFakeMoveTaskOrdersOK { - - return &HideNonFakeMoveTaskOrdersOK{} -} - -// WithPayload adds the payload to the hide non fake move task orders o k response -func (o *HideNonFakeMoveTaskOrdersOK) WithPayload(payload *supportmessages.MTOHideMovesResponse) *HideNonFakeMoveTaskOrdersOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders o k response -func (o *HideNonFakeMoveTaskOrdersOK) SetPayload(payload *supportmessages.MTOHideMovesResponse) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersBadRequestCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersBadRequest -const HideNonFakeMoveTaskOrdersBadRequestCode int = 400 - -/* -HideNonFakeMoveTaskOrdersBadRequest The request payload is invalid. - -swagger:response hideNonFakeMoveTaskOrdersBadRequest -*/ -type HideNonFakeMoveTaskOrdersBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersBadRequest creates HideNonFakeMoveTaskOrdersBadRequest with default headers values -func NewHideNonFakeMoveTaskOrdersBadRequest() *HideNonFakeMoveTaskOrdersBadRequest { - - return &HideNonFakeMoveTaskOrdersBadRequest{} -} - -// WithPayload adds the payload to the hide non fake move task orders bad request response -func (o *HideNonFakeMoveTaskOrdersBadRequest) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders bad request response -func (o *HideNonFakeMoveTaskOrdersBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersUnauthorizedCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersUnauthorized -const HideNonFakeMoveTaskOrdersUnauthorizedCode int = 401 - -/* -HideNonFakeMoveTaskOrdersUnauthorized The request was denied. - -swagger:response hideNonFakeMoveTaskOrdersUnauthorized -*/ -type HideNonFakeMoveTaskOrdersUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersUnauthorized creates HideNonFakeMoveTaskOrdersUnauthorized with default headers values -func NewHideNonFakeMoveTaskOrdersUnauthorized() *HideNonFakeMoveTaskOrdersUnauthorized { - - return &HideNonFakeMoveTaskOrdersUnauthorized{} -} - -// WithPayload adds the payload to the hide non fake move task orders unauthorized response -func (o *HideNonFakeMoveTaskOrdersUnauthorized) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders unauthorized response -func (o *HideNonFakeMoveTaskOrdersUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersForbiddenCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersForbidden -const HideNonFakeMoveTaskOrdersForbiddenCode int = 403 - -/* -HideNonFakeMoveTaskOrdersForbidden The request was denied. - -swagger:response hideNonFakeMoveTaskOrdersForbidden -*/ -type HideNonFakeMoveTaskOrdersForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersForbidden creates HideNonFakeMoveTaskOrdersForbidden with default headers values -func NewHideNonFakeMoveTaskOrdersForbidden() *HideNonFakeMoveTaskOrdersForbidden { - - return &HideNonFakeMoveTaskOrdersForbidden{} -} - -// WithPayload adds the payload to the hide non fake move task orders forbidden response -func (o *HideNonFakeMoveTaskOrdersForbidden) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders forbidden response -func (o *HideNonFakeMoveTaskOrdersForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersNotFoundCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersNotFound -const HideNonFakeMoveTaskOrdersNotFoundCode int = 404 - -/* -HideNonFakeMoveTaskOrdersNotFound The requested resource wasn't found. - -swagger:response hideNonFakeMoveTaskOrdersNotFound -*/ -type HideNonFakeMoveTaskOrdersNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersNotFound creates HideNonFakeMoveTaskOrdersNotFound with default headers values -func NewHideNonFakeMoveTaskOrdersNotFound() *HideNonFakeMoveTaskOrdersNotFound { - - return &HideNonFakeMoveTaskOrdersNotFound{} -} - -// WithPayload adds the payload to the hide non fake move task orders not found response -func (o *HideNonFakeMoveTaskOrdersNotFound) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders not found response -func (o *HideNonFakeMoveTaskOrdersNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersConflictCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersConflict -const HideNonFakeMoveTaskOrdersConflictCode int = 409 - -/* -HideNonFakeMoveTaskOrdersConflict There was a conflict with the request. - -swagger:response hideNonFakeMoveTaskOrdersConflict -*/ -type HideNonFakeMoveTaskOrdersConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersConflict creates HideNonFakeMoveTaskOrdersConflict with default headers values -func NewHideNonFakeMoveTaskOrdersConflict() *HideNonFakeMoveTaskOrdersConflict { - - return &HideNonFakeMoveTaskOrdersConflict{} -} - -// WithPayload adds the payload to the hide non fake move task orders conflict response -func (o *HideNonFakeMoveTaskOrdersConflict) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders conflict response -func (o *HideNonFakeMoveTaskOrdersConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersPreconditionFailedCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersPreconditionFailed -const HideNonFakeMoveTaskOrdersPreconditionFailedCode int = 412 - -/* -HideNonFakeMoveTaskOrdersPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response hideNonFakeMoveTaskOrdersPreconditionFailed -*/ -type HideNonFakeMoveTaskOrdersPreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersPreconditionFailed creates HideNonFakeMoveTaskOrdersPreconditionFailed with default headers values -func NewHideNonFakeMoveTaskOrdersPreconditionFailed() *HideNonFakeMoveTaskOrdersPreconditionFailed { - - return &HideNonFakeMoveTaskOrdersPreconditionFailed{} -} - -// WithPayload adds the payload to the hide non fake move task orders precondition failed response -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders precondition failed response -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersUnprocessableEntityCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersUnprocessableEntity -const HideNonFakeMoveTaskOrdersUnprocessableEntityCode int = 422 - -/* -HideNonFakeMoveTaskOrdersUnprocessableEntity The payload was unprocessable. - -swagger:response hideNonFakeMoveTaskOrdersUnprocessableEntity -*/ -type HideNonFakeMoveTaskOrdersUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersUnprocessableEntity creates HideNonFakeMoveTaskOrdersUnprocessableEntity with default headers values -func NewHideNonFakeMoveTaskOrdersUnprocessableEntity() *HideNonFakeMoveTaskOrdersUnprocessableEntity { - - return &HideNonFakeMoveTaskOrdersUnprocessableEntity{} -} - -// WithPayload adds the payload to the hide non fake move task orders unprocessable entity response -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *HideNonFakeMoveTaskOrdersUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders unprocessable entity response -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// HideNonFakeMoveTaskOrdersInternalServerErrorCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersInternalServerError -const HideNonFakeMoveTaskOrdersInternalServerErrorCode int = 500 - -/* -HideNonFakeMoveTaskOrdersInternalServerError A server error occurred. - -swagger:response hideNonFakeMoveTaskOrdersInternalServerError -*/ -type HideNonFakeMoveTaskOrdersInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewHideNonFakeMoveTaskOrdersInternalServerError creates HideNonFakeMoveTaskOrdersInternalServerError with default headers values -func NewHideNonFakeMoveTaskOrdersInternalServerError() *HideNonFakeMoveTaskOrdersInternalServerError { - - return &HideNonFakeMoveTaskOrdersInternalServerError{} -} - -// WithPayload adds the payload to the hide non fake move task orders internal server error response -func (o *HideNonFakeMoveTaskOrdersInternalServerError) WithPayload(payload *supportmessages.Error) *HideNonFakeMoveTaskOrdersInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the hide non fake move task orders internal server error response -func (o *HideNonFakeMoveTaskOrdersInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *HideNonFakeMoveTaskOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go deleted file mode 100644 index ba5762da8b9..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// HideNonFakeMoveTaskOrdersURL generates an URL for the hide non fake move task orders operation -type HideNonFakeMoveTaskOrdersURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *HideNonFakeMoveTaskOrdersURL) WithBasePath(bp string) *HideNonFakeMoveTaskOrdersURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *HideNonFakeMoveTaskOrdersURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *HideNonFakeMoveTaskOrdersURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/hide" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *HideNonFakeMoveTaskOrdersURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *HideNonFakeMoveTaskOrdersURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *HideNonFakeMoveTaskOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on HideNonFakeMoveTaskOrdersURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on HideNonFakeMoveTaskOrdersURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *HideNonFakeMoveTaskOrdersURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go deleted file mode 100644 index bdbbabe2ec8..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMTOsHandlerFunc turns a function with the right signature into a list m t os handler -type ListMTOsHandlerFunc func(ListMTOsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMTOsHandlerFunc) Handle(params ListMTOsParams) middleware.Responder { - return fn(params) -} - -// ListMTOsHandler interface for that can handle valid list m t os params -type ListMTOsHandler interface { - Handle(ListMTOsParams) middleware.Responder -} - -// NewListMTOs creates a new http.Handler for the list m t os operation -func NewListMTOs(ctx *middleware.Context, handler ListMTOsHandler) *ListMTOs { - return &ListMTOs{Context: ctx, Handler: handler} -} - -/* - ListMTOs swagger:route GET /move-task-orders moveTaskOrder listMTOs - -listMTOs - -### Functionality -This endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime. - -It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -type ListMTOs struct { - Context *middleware.Context - Handler ListMTOsHandler -} - -func (o *ListMTOs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMTOsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go deleted file mode 100644 index 754c2290e71..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go +++ /dev/null @@ -1,83 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListMTOsParams creates a new ListMTOsParams object -// -// There are no default values defined in the spec. -func NewListMTOsParams() ListMTOsParams { - - return ListMTOsParams{} -} - -// ListMTOsParams contains all the bound params for the list m t os operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMTOs -type ListMTOsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Only return move task orders updated since this time. - In: query - */ - Since *int64 -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMTOsParams() beforehand. -func (o *ListMTOsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - qs := runtime.Values(r.URL.Query()) - - qSince, qhkSince, _ := qs.GetOK("since") - if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindSince binds and validates parameter Since from query. -func (o *ListMTOsParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - - value, err := swag.ConvertInt64(raw) - if err != nil { - return errors.InvalidType("since", "query", "int64", raw) - } - o.Since = &value - - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go deleted file mode 100644 index be3f9c979c0..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ListMTOsOKCode is the HTTP code returned for type ListMTOsOK -const ListMTOsOKCode int = 200 - -/* -ListMTOsOK Successfully retrieved all move task orders. - -swagger:response listMTOsOK -*/ -type ListMTOsOK struct { - - /* - In: Body - */ - Payload supportmessages.MoveTaskOrders `json:"body,omitempty"` -} - -// NewListMTOsOK creates ListMTOsOK with default headers values -func NewListMTOsOK() *ListMTOsOK { - - return &ListMTOsOK{} -} - -// WithPayload adds the payload to the list m t os o k response -func (o *ListMTOsOK) WithPayload(payload supportmessages.MoveTaskOrders) *ListMTOsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os o k response -func (o *ListMTOsOK) SetPayload(payload supportmessages.MoveTaskOrders) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = supportmessages.MoveTaskOrders{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMTOsBadRequestCode is the HTTP code returned for type ListMTOsBadRequest -const ListMTOsBadRequestCode int = 400 - -/* -ListMTOsBadRequest The request payload is invalid. - -swagger:response listMTOsBadRequest -*/ -type ListMTOsBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOsBadRequest creates ListMTOsBadRequest with default headers values -func NewListMTOsBadRequest() *ListMTOsBadRequest { - - return &ListMTOsBadRequest{} -} - -// WithPayload adds the payload to the list m t os bad request response -func (o *ListMTOsBadRequest) WithPayload(payload *supportmessages.ClientError) *ListMTOsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os bad request response -func (o *ListMTOsBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOsUnauthorizedCode is the HTTP code returned for type ListMTOsUnauthorized -const ListMTOsUnauthorizedCode int = 401 - -/* -ListMTOsUnauthorized The request was denied. - -swagger:response listMTOsUnauthorized -*/ -type ListMTOsUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOsUnauthorized creates ListMTOsUnauthorized with default headers values -func NewListMTOsUnauthorized() *ListMTOsUnauthorized { - - return &ListMTOsUnauthorized{} -} - -// WithPayload adds the payload to the list m t os unauthorized response -func (o *ListMTOsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ListMTOsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os unauthorized response -func (o *ListMTOsUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOsForbiddenCode is the HTTP code returned for type ListMTOsForbidden -const ListMTOsForbiddenCode int = 403 - -/* -ListMTOsForbidden The request was denied. - -swagger:response listMTOsForbidden -*/ -type ListMTOsForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOsForbidden creates ListMTOsForbidden with default headers values -func NewListMTOsForbidden() *ListMTOsForbidden { - - return &ListMTOsForbidden{} -} - -// WithPayload adds the payload to the list m t os forbidden response -func (o *ListMTOsForbidden) WithPayload(payload *supportmessages.ClientError) *ListMTOsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os forbidden response -func (o *ListMTOsForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOsNotFoundCode is the HTTP code returned for type ListMTOsNotFound -const ListMTOsNotFoundCode int = 404 - -/* -ListMTOsNotFound The requested resource wasn't found. - -swagger:response listMTOsNotFound -*/ -type ListMTOsNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOsNotFound creates ListMTOsNotFound with default headers values -func NewListMTOsNotFound() *ListMTOsNotFound { - - return &ListMTOsNotFound{} -} - -// WithPayload adds the payload to the list m t os not found response -func (o *ListMTOsNotFound) WithPayload(payload *supportmessages.ClientError) *ListMTOsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os not found response -func (o *ListMTOsNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOsInternalServerErrorCode is the HTTP code returned for type ListMTOsInternalServerError -const ListMTOsInternalServerErrorCode int = 500 - -/* -ListMTOsInternalServerError A server error occurred. - -swagger:response listMTOsInternalServerError -*/ -type ListMTOsInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewListMTOsInternalServerError creates ListMTOsInternalServerError with default headers values -func NewListMTOsInternalServerError() *ListMTOsInternalServerError { - - return &ListMTOsInternalServerError{} -} - -// WithPayload adds the payload to the list m t os internal server error response -func (o *ListMTOsInternalServerError) WithPayload(payload *supportmessages.Error) *ListMTOsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t os internal server error response -func (o *ListMTOsInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go deleted file mode 100644 index b78ce93d9e8..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go +++ /dev/null @@ -1,105 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - - "github.com/go-openapi/swag" -) - -// ListMTOsURL generates an URL for the list m t os operation -type ListMTOsURL struct { - Since *int64 - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOsURL) WithBasePath(bp string) *ListMTOsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMTOsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - qs := make(url.Values) - - var sinceQ string - if o.Since != nil { - sinceQ = swag.FormatInt64(*o.Since) - } - if sinceQ != "" { - qs.Set("since", sinceQ) - } - - _result.RawQuery = qs.Encode() - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMTOsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMTOsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMTOsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMTOsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMTOsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMTOsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go deleted file mode 100644 index 203b0a2c1a2..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// MakeMoveTaskOrderAvailableHandlerFunc turns a function with the right signature into a make move task order available handler -type MakeMoveTaskOrderAvailableHandlerFunc func(MakeMoveTaskOrderAvailableParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn MakeMoveTaskOrderAvailableHandlerFunc) Handle(params MakeMoveTaskOrderAvailableParams) middleware.Responder { - return fn(params) -} - -// MakeMoveTaskOrderAvailableHandler interface for that can handle valid make move task order available params -type MakeMoveTaskOrderAvailableHandler interface { - Handle(MakeMoveTaskOrderAvailableParams) middleware.Responder -} - -// NewMakeMoveTaskOrderAvailable creates a new http.Handler for the make move task order available operation -func NewMakeMoveTaskOrderAvailable(ctx *middleware.Context, handler MakeMoveTaskOrderAvailableHandler) *MakeMoveTaskOrderAvailable { - return &MakeMoveTaskOrderAvailable{Context: ctx, Handler: handler} -} - -/* - MakeMoveTaskOrderAvailable swagger:route PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime moveTaskOrder makeMoveTaskOrderAvailable - -makeMoveTaskOrderAvailable - -Updates move task order `availableToPrimeAt` to make it available to prime. No request body required.
-
-This is a support endpoint and will not be available in production. -*/ -type MakeMoveTaskOrderAvailable struct { - Context *middleware.Context - Handler MakeMoveTaskOrderAvailableHandler -} - -func (o *MakeMoveTaskOrderAvailable) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewMakeMoveTaskOrderAvailableParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go deleted file mode 100644 index f4b48155900..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go +++ /dev/null @@ -1,102 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewMakeMoveTaskOrderAvailableParams creates a new MakeMoveTaskOrderAvailableParams object -// -// There are no default values defined in the spec. -func NewMakeMoveTaskOrderAvailableParams() MakeMoveTaskOrderAvailableParams { - - return MakeMoveTaskOrderAvailableParams{} -} - -// MakeMoveTaskOrderAvailableParams contains all the bound params for the make move task order available operation -// typically these are obtained from a http.Request -// -// swagger:parameters makeMoveTaskOrderAvailable -type MakeMoveTaskOrderAvailableParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /*UUID of move task order. - Required: true - In: path - */ - MoveTaskOrderID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewMakeMoveTaskOrderAvailableParams() beforehand. -func (o *MakeMoveTaskOrderAvailableParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *MakeMoveTaskOrderAvailableParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *MakeMoveTaskOrderAvailableParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MoveTaskOrderID = raw - - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go deleted file mode 100644 index 9db559ee96c..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// MakeMoveTaskOrderAvailableOKCode is the HTTP code returned for type MakeMoveTaskOrderAvailableOK -const MakeMoveTaskOrderAvailableOKCode int = 200 - -/* -MakeMoveTaskOrderAvailableOK Successfully made MTO available to Prime. - -swagger:response makeMoveTaskOrderAvailableOK -*/ -type MakeMoveTaskOrderAvailableOK struct { - - /* - In: Body - */ - Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableOK creates MakeMoveTaskOrderAvailableOK with default headers values -func NewMakeMoveTaskOrderAvailableOK() *MakeMoveTaskOrderAvailableOK { - - return &MakeMoveTaskOrderAvailableOK{} -} - -// WithPayload adds the payload to the make move task order available o k response -func (o *MakeMoveTaskOrderAvailableOK) WithPayload(payload *supportmessages.MoveTaskOrder) *MakeMoveTaskOrderAvailableOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available o k response -func (o *MakeMoveTaskOrderAvailableOK) SetPayload(payload *supportmessages.MoveTaskOrder) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableBadRequestCode is the HTTP code returned for type MakeMoveTaskOrderAvailableBadRequest -const MakeMoveTaskOrderAvailableBadRequestCode int = 400 - -/* -MakeMoveTaskOrderAvailableBadRequest The request payload is invalid. - -swagger:response makeMoveTaskOrderAvailableBadRequest -*/ -type MakeMoveTaskOrderAvailableBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableBadRequest creates MakeMoveTaskOrderAvailableBadRequest with default headers values -func NewMakeMoveTaskOrderAvailableBadRequest() *MakeMoveTaskOrderAvailableBadRequest { - - return &MakeMoveTaskOrderAvailableBadRequest{} -} - -// WithPayload adds the payload to the make move task order available bad request response -func (o *MakeMoveTaskOrderAvailableBadRequest) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available bad request response -func (o *MakeMoveTaskOrderAvailableBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableUnauthorizedCode is the HTTP code returned for type MakeMoveTaskOrderAvailableUnauthorized -const MakeMoveTaskOrderAvailableUnauthorizedCode int = 401 - -/* -MakeMoveTaskOrderAvailableUnauthorized The request was denied. - -swagger:response makeMoveTaskOrderAvailableUnauthorized -*/ -type MakeMoveTaskOrderAvailableUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableUnauthorized creates MakeMoveTaskOrderAvailableUnauthorized with default headers values -func NewMakeMoveTaskOrderAvailableUnauthorized() *MakeMoveTaskOrderAvailableUnauthorized { - - return &MakeMoveTaskOrderAvailableUnauthorized{} -} - -// WithPayload adds the payload to the make move task order available unauthorized response -func (o *MakeMoveTaskOrderAvailableUnauthorized) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available unauthorized response -func (o *MakeMoveTaskOrderAvailableUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableForbiddenCode is the HTTP code returned for type MakeMoveTaskOrderAvailableForbidden -const MakeMoveTaskOrderAvailableForbiddenCode int = 403 - -/* -MakeMoveTaskOrderAvailableForbidden The request was denied. - -swagger:response makeMoveTaskOrderAvailableForbidden -*/ -type MakeMoveTaskOrderAvailableForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableForbidden creates MakeMoveTaskOrderAvailableForbidden with default headers values -func NewMakeMoveTaskOrderAvailableForbidden() *MakeMoveTaskOrderAvailableForbidden { - - return &MakeMoveTaskOrderAvailableForbidden{} -} - -// WithPayload adds the payload to the make move task order available forbidden response -func (o *MakeMoveTaskOrderAvailableForbidden) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available forbidden response -func (o *MakeMoveTaskOrderAvailableForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableNotFoundCode is the HTTP code returned for type MakeMoveTaskOrderAvailableNotFound -const MakeMoveTaskOrderAvailableNotFoundCode int = 404 - -/* -MakeMoveTaskOrderAvailableNotFound The requested resource wasn't found. - -swagger:response makeMoveTaskOrderAvailableNotFound -*/ -type MakeMoveTaskOrderAvailableNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableNotFound creates MakeMoveTaskOrderAvailableNotFound with default headers values -func NewMakeMoveTaskOrderAvailableNotFound() *MakeMoveTaskOrderAvailableNotFound { - - return &MakeMoveTaskOrderAvailableNotFound{} -} - -// WithPayload adds the payload to the make move task order available not found response -func (o *MakeMoveTaskOrderAvailableNotFound) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available not found response -func (o *MakeMoveTaskOrderAvailableNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailablePreconditionFailedCode is the HTTP code returned for type MakeMoveTaskOrderAvailablePreconditionFailed -const MakeMoveTaskOrderAvailablePreconditionFailedCode int = 412 - -/* -MakeMoveTaskOrderAvailablePreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response makeMoveTaskOrderAvailablePreconditionFailed -*/ -type MakeMoveTaskOrderAvailablePreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailablePreconditionFailed creates MakeMoveTaskOrderAvailablePreconditionFailed with default headers values -func NewMakeMoveTaskOrderAvailablePreconditionFailed() *MakeMoveTaskOrderAvailablePreconditionFailed { - - return &MakeMoveTaskOrderAvailablePreconditionFailed{} -} - -// WithPayload adds the payload to the make move task order available precondition failed response -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailablePreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available precondition failed response -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableUnprocessableEntityCode is the HTTP code returned for type MakeMoveTaskOrderAvailableUnprocessableEntity -const MakeMoveTaskOrderAvailableUnprocessableEntityCode int = 422 - -/* -MakeMoveTaskOrderAvailableUnprocessableEntity The payload was unprocessable. - -swagger:response makeMoveTaskOrderAvailableUnprocessableEntity -*/ -type MakeMoveTaskOrderAvailableUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableUnprocessableEntity creates MakeMoveTaskOrderAvailableUnprocessableEntity with default headers values -func NewMakeMoveTaskOrderAvailableUnprocessableEntity() *MakeMoveTaskOrderAvailableUnprocessableEntity { - - return &MakeMoveTaskOrderAvailableUnprocessableEntity{} -} - -// WithPayload adds the payload to the make move task order available unprocessable entity response -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *MakeMoveTaskOrderAvailableUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available unprocessable entity response -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// MakeMoveTaskOrderAvailableInternalServerErrorCode is the HTTP code returned for type MakeMoveTaskOrderAvailableInternalServerError -const MakeMoveTaskOrderAvailableInternalServerErrorCode int = 500 - -/* -MakeMoveTaskOrderAvailableInternalServerError A server error occurred. - -swagger:response makeMoveTaskOrderAvailableInternalServerError -*/ -type MakeMoveTaskOrderAvailableInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewMakeMoveTaskOrderAvailableInternalServerError creates MakeMoveTaskOrderAvailableInternalServerError with default headers values -func NewMakeMoveTaskOrderAvailableInternalServerError() *MakeMoveTaskOrderAvailableInternalServerError { - - return &MakeMoveTaskOrderAvailableInternalServerError{} -} - -// WithPayload adds the payload to the make move task order available internal server error response -func (o *MakeMoveTaskOrderAvailableInternalServerError) WithPayload(payload *supportmessages.Error) *MakeMoveTaskOrderAvailableInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the make move task order available internal server error response -func (o *MakeMoveTaskOrderAvailableInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *MakeMoveTaskOrderAvailableInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go deleted file mode 100644 index 876b193942f..00000000000 --- a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// MakeMoveTaskOrderAvailableURL generates an URL for the make move task order available operation -type MakeMoveTaskOrderAvailableURL struct { - MoveTaskOrderID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *MakeMoveTaskOrderAvailableURL) WithBasePath(bp string) *MakeMoveTaskOrderAvailableURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *MakeMoveTaskOrderAvailableURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *MakeMoveTaskOrderAvailableURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/available-to-prime" - - moveTaskOrderID := o.MoveTaskOrderID - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on MakeMoveTaskOrderAvailableURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *MakeMoveTaskOrderAvailableURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *MakeMoveTaskOrderAvailableURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *MakeMoveTaskOrderAvailableURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on MakeMoveTaskOrderAvailableURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on MakeMoveTaskOrderAvailableURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *MakeMoveTaskOrderAvailableURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go deleted file mode 100644 index 795ce4b9285..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOServiceItemStatusHandlerFunc turns a function with the right signature into a update m t o service item status handler -type UpdateMTOServiceItemStatusHandlerFunc func(UpdateMTOServiceItemStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOServiceItemStatusHandlerFunc) Handle(params UpdateMTOServiceItemStatusParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOServiceItemStatusHandler interface for that can handle valid update m t o service item status params -type UpdateMTOServiceItemStatusHandler interface { - Handle(UpdateMTOServiceItemStatusParams) middleware.Responder -} - -// NewUpdateMTOServiceItemStatus creates a new http.Handler for the update m t o service item status operation -func NewUpdateMTOServiceItemStatus(ctx *middleware.Context, handler UpdateMTOServiceItemStatusHandler) *UpdateMTOServiceItemStatus { - return &UpdateMTOServiceItemStatus{Context: ctx, Handler: handler} -} - -/* - UpdateMTOServiceItemStatus swagger:route PATCH /mto-service-items/{mtoServiceItemID}/status mtoServiceItem updateMTOServiceItemStatus - -updateMTOServiceItemStatus - -Updates the status of a service item for a move to APPROVED or REJECTED.
-
-This is a support endpoint and will not be available in production. -*/ -type UpdateMTOServiceItemStatus struct { - Context *middleware.Context - Handler UpdateMTOServiceItemStatusHandler -} - -func (o *UpdateMTOServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOServiceItemStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go deleted file mode 100644 index 84aff8969a1..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOServiceItemStatusParams() UpdateMTOServiceItemStatusParams { - - return UpdateMTOServiceItemStatusParams{} -} - -// UpdateMTOServiceItemStatusParams contains all the bound params for the update m t o service item status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOServiceItemStatus -type UpdateMTOServiceItemStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *supportmessages.UpdateMTOServiceItemStatus - /*UUID of mto service item to use. - Required: true - In: path - */ - MtoServiceItemID string -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemStatusParams() beforehand. -func (o *UpdateMTOServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.UpdateMTOServiceItemStatus - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") - if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. -func (o *UpdateMTOServiceItemStatusParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - o.MtoServiceItemID = raw - - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go deleted file mode 100644 index 8ef6bd9a8d4..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdateMTOServiceItemStatusOKCode is the HTTP code returned for type UpdateMTOServiceItemStatusOK -const UpdateMTOServiceItemStatusOKCode int = 200 - -/* -UpdateMTOServiceItemStatusOK Successfully updated service item status for a move task order. - -swagger:response updateMTOServiceItemStatusOK -*/ -type UpdateMTOServiceItemStatusOK struct { - - /* - In: Body - */ - Payload supportmessages.MTOServiceItem `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusOK creates UpdateMTOServiceItemStatusOK with default headers values -func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { - - return &UpdateMTOServiceItemStatusOK{} -} - -// WithPayload adds the payload to the update m t o service item status o k response -func (o *UpdateMTOServiceItemStatusOK) WithPayload(payload supportmessages.MTOServiceItem) *UpdateMTOServiceItemStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status o k response -func (o *UpdateMTOServiceItemStatusOK) SetPayload(payload supportmessages.MTOServiceItem) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemStatusBadRequest -const UpdateMTOServiceItemStatusBadRequestCode int = 400 - -/* -UpdateMTOServiceItemStatusBadRequest The request payload is invalid. - -swagger:response updateMTOServiceItemStatusBadRequest -*/ -type UpdateMTOServiceItemStatusBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusBadRequest creates UpdateMTOServiceItemStatusBadRequest with default headers values -func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { - - return &UpdateMTOServiceItemStatusBadRequest{} -} - -// WithPayload adds the payload to the update m t o service item status bad request response -func (o *UpdateMTOServiceItemStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status bad request response -func (o *UpdateMTOServiceItemStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnauthorized -const UpdateMTOServiceItemStatusUnauthorizedCode int = 401 - -/* -UpdateMTOServiceItemStatusUnauthorized The request was denied. - -swagger:response updateMTOServiceItemStatusUnauthorized -*/ -type UpdateMTOServiceItemStatusUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusUnauthorized creates UpdateMTOServiceItemStatusUnauthorized with default headers values -func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { - - return &UpdateMTOServiceItemStatusUnauthorized{} -} - -// WithPayload adds the payload to the update m t o service item status unauthorized response -func (o *UpdateMTOServiceItemStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status unauthorized response -func (o *UpdateMTOServiceItemStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemStatusForbidden -const UpdateMTOServiceItemStatusForbiddenCode int = 403 - -/* -UpdateMTOServiceItemStatusForbidden The request was denied. - -swagger:response updateMTOServiceItemStatusForbidden -*/ -type UpdateMTOServiceItemStatusForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusForbidden creates UpdateMTOServiceItemStatusForbidden with default headers values -func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { - - return &UpdateMTOServiceItemStatusForbidden{} -} - -// WithPayload adds the payload to the update m t o service item status forbidden response -func (o *UpdateMTOServiceItemStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status forbidden response -func (o *UpdateMTOServiceItemStatusForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemStatusNotFound -const UpdateMTOServiceItemStatusNotFoundCode int = 404 - -/* -UpdateMTOServiceItemStatusNotFound The requested resource wasn't found. - -swagger:response updateMTOServiceItemStatusNotFound -*/ -type UpdateMTOServiceItemStatusNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusNotFound creates UpdateMTOServiceItemStatusNotFound with default headers values -func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { - - return &UpdateMTOServiceItemStatusNotFound{} -} - -// WithPayload adds the payload to the update m t o service item status not found response -func (o *UpdateMTOServiceItemStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status not found response -func (o *UpdateMTOServiceItemStatusNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusConflictCode is the HTTP code returned for type UpdateMTOServiceItemStatusConflict -const UpdateMTOServiceItemStatusConflictCode int = 409 - -/* -UpdateMTOServiceItemStatusConflict There was a conflict with the request. - -swagger:response updateMTOServiceItemStatusConflict -*/ -type UpdateMTOServiceItemStatusConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusConflict creates UpdateMTOServiceItemStatusConflict with default headers values -func NewUpdateMTOServiceItemStatusConflict() *UpdateMTOServiceItemStatusConflict { - - return &UpdateMTOServiceItemStatusConflict{} -} - -// WithPayload adds the payload to the update m t o service item status conflict response -func (o *UpdateMTOServiceItemStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status conflict response -func (o *UpdateMTOServiceItemStatusConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemStatusPreconditionFailed -const UpdateMTOServiceItemStatusPreconditionFailedCode int = 412 - -/* -UpdateMTOServiceItemStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOServiceItemStatusPreconditionFailed -*/ -type UpdateMTOServiceItemStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusPreconditionFailed creates UpdateMTOServiceItemStatusPreconditionFailed with default headers values -func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { - - return &UpdateMTOServiceItemStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o service item status precondition failed response -func (o *UpdateMTOServiceItemStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status precondition failed response -func (o *UpdateMTOServiceItemStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnprocessableEntity -const UpdateMTOServiceItemStatusUnprocessableEntityCode int = 422 - -/* -UpdateMTOServiceItemStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOServiceItemStatusUnprocessableEntity -*/ -type UpdateMTOServiceItemStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusUnprocessableEntity creates UpdateMTOServiceItemStatusUnprocessableEntity with default headers values -func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { - - return &UpdateMTOServiceItemStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o service item status unprocessable entity response -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdateMTOServiceItemStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status unprocessable entity response -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemStatusInternalServerError -const UpdateMTOServiceItemStatusInternalServerErrorCode int = 500 - -/* -UpdateMTOServiceItemStatusInternalServerError A server error occurred. - -swagger:response updateMTOServiceItemStatusInternalServerError -*/ -type UpdateMTOServiceItemStatusInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOServiceItemStatusInternalServerError creates UpdateMTOServiceItemStatusInternalServerError with default headers values -func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { - - return &UpdateMTOServiceItemStatusInternalServerError{} -} - -// WithPayload adds the payload to the update m t o service item status internal server error response -func (o *UpdateMTOServiceItemStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdateMTOServiceItemStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o service item status internal server error response -func (o *UpdateMTOServiceItemStatusInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go deleted file mode 100644 index c9255587b06..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go +++ /dev/null @@ -1,99 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" -) - -// UpdateMTOServiceItemStatusURL generates an URL for the update m t o service item status operation -type UpdateMTOServiceItemStatusURL struct { - MtoServiceItemID string - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemStatusURL) WithBasePath(bp string) *UpdateMTOServiceItemStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOServiceItemStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOServiceItemStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-service-items/{mtoServiceItemID}/status" - - mtoServiceItemID := o.MtoServiceItemID - if mtoServiceItemID != "" { - _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) - } else { - return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOServiceItemStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOServiceItemStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOServiceItemStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go deleted file mode 100644 index b99cc684796..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdateMTOShipmentStatusHandlerFunc turns a function with the right signature into a update m t o shipment status handler -type UpdateMTOShipmentStatusHandlerFunc func(UpdateMTOShipmentStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdateMTOShipmentStatusHandlerFunc) Handle(params UpdateMTOShipmentStatusParams) middleware.Responder { - return fn(params) -} - -// UpdateMTOShipmentStatusHandler interface for that can handle valid update m t o shipment status params -type UpdateMTOShipmentStatusHandler interface { - Handle(UpdateMTOShipmentStatusParams) middleware.Responder -} - -// NewUpdateMTOShipmentStatus creates a new http.Handler for the update m t o shipment status operation -func NewUpdateMTOShipmentStatus(ctx *middleware.Context, handler UpdateMTOShipmentStatusHandler) *UpdateMTOShipmentStatus { - return &UpdateMTOShipmentStatus{Context: ctx, Handler: handler} -} - -/* - UpdateMTOShipmentStatus swagger:route PATCH /mto-shipments/{mtoShipmentID}/status mtoShipment updateMTOShipmentStatus - -updateMTOShipmentStatus - -Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, `rejectionReason` should be blank and any value passed through the body will be ignored. If REJECTED, a value in `rejectionReason` is required.

This is a support endpoint and will not be available in production. -*/ -type UpdateMTOShipmentStatus struct { - Context *middleware.Context - Handler UpdateMTOShipmentStatusHandler -} - -func (o *UpdateMTOShipmentStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdateMTOShipmentStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go deleted file mode 100644 index 730d906a24d..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object -// -// There are no default values defined in the spec. -func NewUpdateMTOShipmentStatusParams() UpdateMTOShipmentStatusParams { - - return UpdateMTOShipmentStatusParams{} -} - -// UpdateMTOShipmentStatusParams contains all the bound params for the update m t o shipment status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updateMTOShipmentStatus -type UpdateMTOShipmentStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *supportmessages.UpdateMTOShipmentStatus - /*UUID of the shipment being updated. - Required: true - In: path - */ - MtoShipmentID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentStatusParams() beforehand. -func (o *UpdateMTOShipmentStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.UpdateMTOShipmentStatus - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") - if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdateMTOShipmentStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. -func (o *UpdateMTOShipmentStatusParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) - } - o.MtoShipmentID = *(value.(*strfmt.UUID)) - - if err := o.validateMtoShipmentID(formats); err != nil { - return err - } - - return nil -} - -// validateMtoShipmentID carries on validations for parameter MtoShipmentID -func (o *UpdateMTOShipmentStatusParams) validateMtoShipmentID(formats strfmt.Registry) error { - - if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go deleted file mode 100644 index 8fb69fb0fdd..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdateMTOShipmentStatusOKCode is the HTTP code returned for type UpdateMTOShipmentStatusOK -const UpdateMTOShipmentStatusOKCode int = 200 - -/* -UpdateMTOShipmentStatusOK Successfully updated the shipment's status. - -swagger:response updateMTOShipmentStatusOK -*/ -type UpdateMTOShipmentStatusOK struct { - - /* - In: Body - */ - Payload *supportmessages.MTOShipment `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusOK creates UpdateMTOShipmentStatusOK with default headers values -func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { - - return &UpdateMTOShipmentStatusOK{} -} - -// WithPayload adds the payload to the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) WithPayload(payload *supportmessages.MTOShipment) *UpdateMTOShipmentStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) SetPayload(payload *supportmessages.MTOShipment) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusBadRequestCode is the HTTP code returned for type UpdateMTOShipmentStatusBadRequest -const UpdateMTOShipmentStatusBadRequestCode int = 400 - -/* -UpdateMTOShipmentStatusBadRequest The request payload is invalid. - -swagger:response updateMTOShipmentStatusBadRequest -*/ -type UpdateMTOShipmentStatusBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusBadRequest creates UpdateMTOShipmentStatusBadRequest with default headers values -func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { - - return &UpdateMTOShipmentStatusBadRequest{} -} - -// WithPayload adds the payload to the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentStatusUnauthorized -const UpdateMTOShipmentStatusUnauthorizedCode int = 401 - -/* -UpdateMTOShipmentStatusUnauthorized The request was denied. - -swagger:response updateMTOShipmentStatusUnauthorized -*/ -type UpdateMTOShipmentStatusUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusUnauthorized creates UpdateMTOShipmentStatusUnauthorized with default headers values -func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { - - return &UpdateMTOShipmentStatusUnauthorized{} -} - -// WithPayload adds the payload to the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusForbiddenCode is the HTTP code returned for type UpdateMTOShipmentStatusForbidden -const UpdateMTOShipmentStatusForbiddenCode int = 403 - -/* -UpdateMTOShipmentStatusForbidden The request was denied. - -swagger:response updateMTOShipmentStatusForbidden -*/ -type UpdateMTOShipmentStatusForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusForbidden creates UpdateMTOShipmentStatusForbidden with default headers values -func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { - - return &UpdateMTOShipmentStatusForbidden{} -} - -// WithPayload adds the payload to the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusNotFoundCode is the HTTP code returned for type UpdateMTOShipmentStatusNotFound -const UpdateMTOShipmentStatusNotFoundCode int = 404 - -/* -UpdateMTOShipmentStatusNotFound The requested resource wasn't found. - -swagger:response updateMTOShipmentStatusNotFound -*/ -type UpdateMTOShipmentStatusNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusNotFound creates UpdateMTOShipmentStatusNotFound with default headers values -func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { - - return &UpdateMTOShipmentStatusNotFound{} -} - -// WithPayload adds the payload to the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusConflictCode is the HTTP code returned for type UpdateMTOShipmentStatusConflict -const UpdateMTOShipmentStatusConflictCode int = 409 - -/* -UpdateMTOShipmentStatusConflict There was a conflict with the request. - -swagger:response updateMTOShipmentStatusConflict -*/ -type UpdateMTOShipmentStatusConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusConflict creates UpdateMTOShipmentStatusConflict with default headers values -func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { - - return &UpdateMTOShipmentStatusConflict{} -} - -// WithPayload adds the payload to the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentStatusPreconditionFailed -const UpdateMTOShipmentStatusPreconditionFailedCode int = 412 - -/* -UpdateMTOShipmentStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updateMTOShipmentStatusPreconditionFailed -*/ -type UpdateMTOShipmentStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusPreconditionFailed creates UpdateMTOShipmentStatusPreconditionFailed with default headers values -func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { - - return &UpdateMTOShipmentStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentStatusUnprocessableEntity -const UpdateMTOShipmentStatusUnprocessableEntityCode int = 422 - -/* -UpdateMTOShipmentStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updateMTOShipmentStatusUnprocessableEntity -*/ -type UpdateMTOShipmentStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusUnprocessableEntity creates UpdateMTOShipmentStatusUnprocessableEntity with default headers values -func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { - - return &UpdateMTOShipmentStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdateMTOShipmentStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdateMTOShipmentStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentStatusInternalServerError -const UpdateMTOShipmentStatusInternalServerErrorCode int = 500 - -/* -UpdateMTOShipmentStatusInternalServerError A server error occurred. - -swagger:response updateMTOShipmentStatusInternalServerError -*/ -type UpdateMTOShipmentStatusInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewUpdateMTOShipmentStatusInternalServerError creates UpdateMTOShipmentStatusInternalServerError with default headers values -func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { - - return &UpdateMTOShipmentStatusInternalServerError{} -} - -// WithPayload adds the payload to the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdateMTOShipmentStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdateMTOShipmentStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go deleted file mode 100644 index 6637961762f..00000000000 --- a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdateMTOShipmentStatusURL generates an URL for the update m t o shipment status operation -type UpdateMTOShipmentStatusURL struct { - MtoShipmentID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentStatusURL) WithBasePath(bp string) *UpdateMTOShipmentStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdateMTOShipmentStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdateMTOShipmentStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/mto-shipments/{mtoShipmentID}/status" - - mtoShipmentID := o.MtoShipmentID.String() - if mtoShipmentID != "" { - _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) - } else { - return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdateMTOShipmentStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdateMTOShipmentStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdateMTOShipmentStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdateMTOShipmentStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdateMTOShipmentStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/mymove_api.go b/pkg/gen/supportapi/supportoperations/mymove_api.go deleted file mode 100644 index 7a9a7b04e5b..00000000000 --- a/pkg/gen/supportapi/supportoperations/mymove_api.go +++ /dev/null @@ -1,469 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportoperations - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - "net/http" - "strings" - - "github.com/go-openapi/errors" - "github.com/go-openapi/loads" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/runtime/security" - "github.com/go-openapi/spec" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/move_task_order" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_service_item" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_shipment" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/payment_request" - "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/webhook" -) - -// NewMymoveAPI creates a new Mymove instance -func NewMymoveAPI(spec *loads.Document) *MymoveAPI { - return &MymoveAPI{ - handlers: make(map[string]map[string]http.Handler), - formats: strfmt.Default, - defaultConsumes: "application/json", - defaultProduces: "application/json", - customConsumers: make(map[string]runtime.Consumer), - customProducers: make(map[string]runtime.Producer), - PreServerShutdown: func() {}, - ServerShutdown: func() {}, - spec: spec, - useSwaggerUI: false, - ServeError: errors.ServeError, - BasicAuthenticator: security.BasicAuth, - APIKeyAuthenticator: security.APIKeyAuth, - BearerAuthenticator: security.BearerAuth, - - JSONConsumer: runtime.JSONConsumer(), - - JSONProducer: runtime.JSONProducer(), - - MoveTaskOrderCreateMoveTaskOrderHandler: move_task_order.CreateMoveTaskOrderHandlerFunc(func(params move_task_order.CreateMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.CreateMoveTaskOrder has not yet been implemented") - }), - WebhookCreateWebhookNotificationHandler: webhook.CreateWebhookNotificationHandlerFunc(func(params webhook.CreateWebhookNotificationParams) middleware.Responder { - return middleware.NotImplemented("operation webhook.CreateWebhookNotification has not yet been implemented") - }), - MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") - }), - PaymentRequestGetPaymentRequestEDIHandler: payment_request.GetPaymentRequestEDIHandlerFunc(func(params payment_request.GetPaymentRequestEDIParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.GetPaymentRequestEDI has not yet been implemented") - }), - MoveTaskOrderHideNonFakeMoveTaskOrdersHandler: move_task_order.HideNonFakeMoveTaskOrdersHandlerFunc(func(params move_task_order.HideNonFakeMoveTaskOrdersParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.HideNonFakeMoveTaskOrders has not yet been implemented") - }), - PaymentRequestListMTOPaymentRequestsHandler: payment_request.ListMTOPaymentRequestsHandlerFunc(func(params payment_request.ListMTOPaymentRequestsParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.ListMTOPaymentRequests has not yet been implemented") - }), - MoveTaskOrderListMTOsHandler: move_task_order.ListMTOsHandlerFunc(func(params move_task_order.ListMTOsParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.ListMTOs has not yet been implemented") - }), - MoveTaskOrderMakeMoveTaskOrderAvailableHandler: move_task_order.MakeMoveTaskOrderAvailableHandlerFunc(func(params move_task_order.MakeMoveTaskOrderAvailableParams) middleware.Responder { - return middleware.NotImplemented("operation move_task_order.MakeMoveTaskOrderAvailable has not yet been implemented") - }), - PaymentRequestProcessReviewedPaymentRequestsHandler: payment_request.ProcessReviewedPaymentRequestsHandlerFunc(func(params payment_request.ProcessReviewedPaymentRequestsParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.ProcessReviewedPaymentRequests has not yet been implemented") - }), - PaymentRequestRecalculatePaymentRequestHandler: payment_request.RecalculatePaymentRequestHandlerFunc(func(params payment_request.RecalculatePaymentRequestParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.RecalculatePaymentRequest has not yet been implemented") - }), - WebhookReceiveWebhookNotificationHandler: webhook.ReceiveWebhookNotificationHandlerFunc(func(params webhook.ReceiveWebhookNotificationParams) middleware.Responder { - return middleware.NotImplemented("operation webhook.ReceiveWebhookNotification has not yet been implemented") - }), - MtoServiceItemUpdateMTOServiceItemStatusHandler: mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") - }), - MtoShipmentUpdateMTOShipmentStatusHandler: mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { - return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") - }), - PaymentRequestUpdatePaymentRequestStatusHandler: payment_request.UpdatePaymentRequestStatusHandlerFunc(func(params payment_request.UpdatePaymentRequestStatusParams) middleware.Responder { - return middleware.NotImplemented("operation payment_request.UpdatePaymentRequestStatus has not yet been implemented") - }), - } -} - -/* -MymoveAPI The Support API gives you programmatic access to support functionality useful -for testing and debugging. **This API is not available in the Production -environment**. - -All endpoints are located at `/support/v1/`. -*/ -type MymoveAPI struct { - spec *loads.Document - context *middleware.Context - handlers map[string]map[string]http.Handler - formats strfmt.Registry - customConsumers map[string]runtime.Consumer - customProducers map[string]runtime.Producer - defaultConsumes string - defaultProduces string - Middleware func(middleware.Builder) http.Handler - useSwaggerUI bool - - // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator - - // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator - - // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. - // It has a default implementation in the security package, however you can replace it for your particular usage. - BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator - - // JSONConsumer registers a consumer for the following mime types: - // - application/json - JSONConsumer runtime.Consumer - - // JSONProducer registers a producer for the following mime types: - // - application/json - JSONProducer runtime.Producer - - // MoveTaskOrderCreateMoveTaskOrderHandler sets the operation handler for the create move task order operation - MoveTaskOrderCreateMoveTaskOrderHandler move_task_order.CreateMoveTaskOrderHandler - // WebhookCreateWebhookNotificationHandler sets the operation handler for the create webhook notification operation - WebhookCreateWebhookNotificationHandler webhook.CreateWebhookNotificationHandler - // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation - MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler - // PaymentRequestGetPaymentRequestEDIHandler sets the operation handler for the get payment request e d i operation - PaymentRequestGetPaymentRequestEDIHandler payment_request.GetPaymentRequestEDIHandler - // MoveTaskOrderHideNonFakeMoveTaskOrdersHandler sets the operation handler for the hide non fake move task orders operation - MoveTaskOrderHideNonFakeMoveTaskOrdersHandler move_task_order.HideNonFakeMoveTaskOrdersHandler - // PaymentRequestListMTOPaymentRequestsHandler sets the operation handler for the list m t o payment requests operation - PaymentRequestListMTOPaymentRequestsHandler payment_request.ListMTOPaymentRequestsHandler - // MoveTaskOrderListMTOsHandler sets the operation handler for the list m t os operation - MoveTaskOrderListMTOsHandler move_task_order.ListMTOsHandler - // MoveTaskOrderMakeMoveTaskOrderAvailableHandler sets the operation handler for the make move task order available operation - MoveTaskOrderMakeMoveTaskOrderAvailableHandler move_task_order.MakeMoveTaskOrderAvailableHandler - // PaymentRequestProcessReviewedPaymentRequestsHandler sets the operation handler for the process reviewed payment requests operation - PaymentRequestProcessReviewedPaymentRequestsHandler payment_request.ProcessReviewedPaymentRequestsHandler - // PaymentRequestRecalculatePaymentRequestHandler sets the operation handler for the recalculate payment request operation - PaymentRequestRecalculatePaymentRequestHandler payment_request.RecalculatePaymentRequestHandler - // WebhookReceiveWebhookNotificationHandler sets the operation handler for the receive webhook notification operation - WebhookReceiveWebhookNotificationHandler webhook.ReceiveWebhookNotificationHandler - // MtoServiceItemUpdateMTOServiceItemStatusHandler sets the operation handler for the update m t o service item status operation - MtoServiceItemUpdateMTOServiceItemStatusHandler mto_service_item.UpdateMTOServiceItemStatusHandler - // MtoShipmentUpdateMTOShipmentStatusHandler sets the operation handler for the update m t o shipment status operation - MtoShipmentUpdateMTOShipmentStatusHandler mto_shipment.UpdateMTOShipmentStatusHandler - // PaymentRequestUpdatePaymentRequestStatusHandler sets the operation handler for the update payment request status operation - PaymentRequestUpdatePaymentRequestStatusHandler payment_request.UpdatePaymentRequestStatusHandler - - // ServeError is called when an error is received, there is a default handler - // but you can set your own with this - ServeError func(http.ResponseWriter, *http.Request, error) - - // PreServerShutdown is called before the HTTP(S) server is shutdown - // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic - PreServerShutdown func() - - // ServerShutdown is called when the HTTP(S) server is shut down and done - // handling all active connections and does not accept connections any more - ServerShutdown func() - - // Custom command line argument groups with their descriptions - CommandLineOptionsGroups []swag.CommandLineOptionsGroup - - // User defined logger function. - Logger func(string, ...interface{}) -} - -// UseRedoc for documentation at /docs -func (o *MymoveAPI) UseRedoc() { - o.useSwaggerUI = false -} - -// UseSwaggerUI for documentation at /docs -func (o *MymoveAPI) UseSwaggerUI() { - o.useSwaggerUI = true -} - -// SetDefaultProduces sets the default produces media type -func (o *MymoveAPI) SetDefaultProduces(mediaType string) { - o.defaultProduces = mediaType -} - -// SetDefaultConsumes returns the default consumes media type -func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { - o.defaultConsumes = mediaType -} - -// SetSpec sets a spec that will be served for the clients. -func (o *MymoveAPI) SetSpec(spec *loads.Document) { - o.spec = spec -} - -// DefaultProduces returns the default produces media type -func (o *MymoveAPI) DefaultProduces() string { - return o.defaultProduces -} - -// DefaultConsumes returns the default consumes media type -func (o *MymoveAPI) DefaultConsumes() string { - return o.defaultConsumes -} - -// Formats returns the registered string formats -func (o *MymoveAPI) Formats() strfmt.Registry { - return o.formats -} - -// RegisterFormat registers a custom format validator -func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { - o.formats.Add(name, format, validator) -} - -// Validate validates the registrations in the MymoveAPI -func (o *MymoveAPI) Validate() error { - var unregistered []string - - if o.JSONConsumer == nil { - unregistered = append(unregistered, "JSONConsumer") - } - - if o.JSONProducer == nil { - unregistered = append(unregistered, "JSONProducer") - } - - if o.MoveTaskOrderCreateMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.CreateMoveTaskOrderHandler") - } - if o.WebhookCreateWebhookNotificationHandler == nil { - unregistered = append(unregistered, "webhook.CreateWebhookNotificationHandler") - } - if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { - unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") - } - if o.PaymentRequestGetPaymentRequestEDIHandler == nil { - unregistered = append(unregistered, "payment_request.GetPaymentRequestEDIHandler") - } - if o.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler == nil { - unregistered = append(unregistered, "move_task_order.HideNonFakeMoveTaskOrdersHandler") - } - if o.PaymentRequestListMTOPaymentRequestsHandler == nil { - unregistered = append(unregistered, "payment_request.ListMTOPaymentRequestsHandler") - } - if o.MoveTaskOrderListMTOsHandler == nil { - unregistered = append(unregistered, "move_task_order.ListMTOsHandler") - } - if o.MoveTaskOrderMakeMoveTaskOrderAvailableHandler == nil { - unregistered = append(unregistered, "move_task_order.MakeMoveTaskOrderAvailableHandler") - } - if o.PaymentRequestProcessReviewedPaymentRequestsHandler == nil { - unregistered = append(unregistered, "payment_request.ProcessReviewedPaymentRequestsHandler") - } - if o.PaymentRequestRecalculatePaymentRequestHandler == nil { - unregistered = append(unregistered, "payment_request.RecalculatePaymentRequestHandler") - } - if o.WebhookReceiveWebhookNotificationHandler == nil { - unregistered = append(unregistered, "webhook.ReceiveWebhookNotificationHandler") - } - if o.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { - unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemStatusHandler") - } - if o.MtoShipmentUpdateMTOShipmentStatusHandler == nil { - unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentStatusHandler") - } - if o.PaymentRequestUpdatePaymentRequestStatusHandler == nil { - unregistered = append(unregistered, "payment_request.UpdatePaymentRequestStatusHandler") - } - - if len(unregistered) > 0 { - return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) - } - - return nil -} - -// ServeErrorFor gets a error handler for a given operation id -func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { - return o.ServeError -} - -// AuthenticatorsFor gets the authenticators for the specified security schemes -func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { - return nil -} - -// Authorizer returns the registered authorizer -func (o *MymoveAPI) Authorizer() runtime.Authorizer { - return nil -} - -// ConsumersFor gets the consumers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { - result := make(map[string]runtime.Consumer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONConsumer - } - - if c, ok := o.customConsumers[mt]; ok { - result[mt] = c - } - } - return result -} - -// ProducersFor gets the producers for the specified media types. -// MIME type parameters are ignored here. -func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { - result := make(map[string]runtime.Producer, len(mediaTypes)) - for _, mt := range mediaTypes { - switch mt { - case "application/json": - result["application/json"] = o.JSONProducer - } - - if p, ok := o.customProducers[mt]; ok { - result[mt] = p - } - } - return result -} - -// HandlerFor gets a http.Handler for the provided operation method and path -func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { - if o.handlers == nil { - return nil, false - } - um := strings.ToUpper(method) - if _, ok := o.handlers[um]; !ok { - return nil, false - } - if path == "/" { - path = "" - } - h, ok := o.handlers[um][path] - return h, ok -} - -// Context returns the middleware context for the mymove API -func (o *MymoveAPI) Context() *middleware.Context { - if o.context == nil { - o.context = middleware.NewRoutableContext(o.spec, o, nil) - } - - return o.context -} - -func (o *MymoveAPI) initHandlerCache() { - o.Context() // don't care about the result, just that the initialization happened - if o.handlers == nil { - o.handlers = make(map[string]map[string]http.Handler) - } - - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/move-task-orders"] = move_task_order.NewCreateMoveTaskOrder(o.context, o.MoveTaskOrderCreateMoveTaskOrderHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/webhook-notifications"] = webhook.NewCreateWebhookNotification(o.context, o.WebhookCreateWebhookNotificationHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/payment-requests/{paymentRequestID}/edi"] = payment_request.NewGetPaymentRequestEDI(o.context, o.PaymentRequestGetPaymentRequestEDIHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/hide"] = move_task_order.NewHideNonFakeMoveTaskOrders(o.context, o.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/payment-requests"] = payment_request.NewListMTOPaymentRequests(o.context, o.PaymentRequestListMTOPaymentRequestsHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } - o.handlers["GET"]["/move-task-orders"] = move_task_order.NewListMTOs(o.context, o.MoveTaskOrderListMTOsHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/available-to-prime"] = move_task_order.NewMakeMoveTaskOrderAvailable(o.context, o.MoveTaskOrderMakeMoveTaskOrderAvailableHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/payment-requests/process-reviewed"] = payment_request.NewProcessReviewedPaymentRequests(o.context, o.PaymentRequestProcessReviewedPaymentRequestsHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/payment-requests/{paymentRequestID}/recalculate"] = payment_request.NewRecalculatePaymentRequest(o.context, o.PaymentRequestRecalculatePaymentRequestHandler) - if o.handlers["POST"] == nil { - o.handlers["POST"] = make(map[string]http.Handler) - } - o.handlers["POST"]["/webhook-notify"] = webhook.NewReceiveWebhookNotification(o.context, o.WebhookReceiveWebhookNotificationHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-service-items/{mtoServiceItemID}/status"] = mto_service_item.NewUpdateMTOServiceItemStatus(o.context, o.MtoServiceItemUpdateMTOServiceItemStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/status"] = mto_shipment.NewUpdateMTOShipmentStatus(o.context, o.MtoShipmentUpdateMTOShipmentStatusHandler) - if o.handlers["PATCH"] == nil { - o.handlers["PATCH"] = make(map[string]http.Handler) - } - o.handlers["PATCH"]["/payment-requests/{paymentRequestID}/status"] = payment_request.NewUpdatePaymentRequestStatus(o.context, o.PaymentRequestUpdatePaymentRequestStatusHandler) -} - -// Serve creates a http handler to serve the API over HTTP -// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) -func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { - o.Init() - - if o.Middleware != nil { - return o.Middleware(builder) - } - if o.useSwaggerUI { - return o.context.APIHandlerSwaggerUI(builder) - } - return o.context.APIHandler(builder) -} - -// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit -func (o *MymoveAPI) Init() { - if len(o.handlers) == 0 { - o.initHandlerCache() - } -} - -// RegisterConsumer allows you to add (or override) a consumer for a media type. -func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { - o.customConsumers[mediaType] = consumer -} - -// RegisterProducer allows you to add (or override) a producer for a media type. -func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { - o.customProducers[mediaType] = producer -} - -// AddMiddlewareFor adds a http middleware to existing handler -func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { - um := strings.ToUpper(method) - if path == "/" { - path = "" - } - o.Init() - if h, ok := o.handlers[um][path]; ok { - o.handlers[um][path] = builder(h) - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go deleted file mode 100644 index 8e6f851556e..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetPaymentRequestEDIHandlerFunc turns a function with the right signature into a get payment request e d i handler -type GetPaymentRequestEDIHandlerFunc func(GetPaymentRequestEDIParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetPaymentRequestEDIHandlerFunc) Handle(params GetPaymentRequestEDIParams) middleware.Responder { - return fn(params) -} - -// GetPaymentRequestEDIHandler interface for that can handle valid get payment request e d i params -type GetPaymentRequestEDIHandler interface { - Handle(GetPaymentRequestEDIParams) middleware.Responder -} - -// NewGetPaymentRequestEDI creates a new http.Handler for the get payment request e d i operation -func NewGetPaymentRequestEDI(ctx *middleware.Context, handler GetPaymentRequestEDIHandler) *GetPaymentRequestEDI { - return &GetPaymentRequestEDI{Context: ctx, Handler: handler} -} - -/* - GetPaymentRequestEDI swagger:route GET /payment-requests/{paymentRequestID}/edi paymentRequest getPaymentRequestEDI - -getPaymentRequestEDI - -Returns the EDI (Electronic Data Interchange) message for the payment request identified -by the given payment request ID. Note that the EDI returned in the JSON payload will have where there -would normally be line breaks (due to JSON not allowing line breaks in a string). - -This is a support endpoint and will not be available in production. -*/ -type GetPaymentRequestEDI struct { - Context *middleware.Context - Handler GetPaymentRequestEDIHandler -} - -func (o *GetPaymentRequestEDI) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetPaymentRequestEDIParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go deleted file mode 100644 index ee326f2cdea..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewGetPaymentRequestEDIParams creates a new GetPaymentRequestEDIParams object -// -// There are no default values defined in the spec. -func NewGetPaymentRequestEDIParams() GetPaymentRequestEDIParams { - - return GetPaymentRequestEDIParams{} -} - -// GetPaymentRequestEDIParams contains all the bound params for the get payment request e d i operation -// typically these are obtained from a http.Request -// -// swagger:parameters getPaymentRequestEDI -type GetPaymentRequestEDIParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the payment request for which EDI should be generated. - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetPaymentRequestEDIParams() beforehand. -func (o *GetPaymentRequestEDIParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *GetPaymentRequestEDIParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *GetPaymentRequestEDIParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go deleted file mode 100644 index 28033983281..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go +++ /dev/null @@ -1,374 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// GetPaymentRequestEDIOKCode is the HTTP code returned for type GetPaymentRequestEDIOK -const GetPaymentRequestEDIOKCode int = 200 - -/* -GetPaymentRequestEDIOK Successfully retrieved payment requests associated with a given move task order - -swagger:response getPaymentRequestEDIOK -*/ -type GetPaymentRequestEDIOK struct { - - /* - In: Body - */ - Payload *supportmessages.PaymentRequestEDI `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIOK creates GetPaymentRequestEDIOK with default headers values -func NewGetPaymentRequestEDIOK() *GetPaymentRequestEDIOK { - - return &GetPaymentRequestEDIOK{} -} - -// WithPayload adds the payload to the get payment request e d i o k response -func (o *GetPaymentRequestEDIOK) WithPayload(payload *supportmessages.PaymentRequestEDI) *GetPaymentRequestEDIOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i o k response -func (o *GetPaymentRequestEDIOK) SetPayload(payload *supportmessages.PaymentRequestEDI) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIBadRequestCode is the HTTP code returned for type GetPaymentRequestEDIBadRequest -const GetPaymentRequestEDIBadRequestCode int = 400 - -/* -GetPaymentRequestEDIBadRequest The request payload is invalid. - -swagger:response getPaymentRequestEDIBadRequest -*/ -type GetPaymentRequestEDIBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIBadRequest creates GetPaymentRequestEDIBadRequest with default headers values -func NewGetPaymentRequestEDIBadRequest() *GetPaymentRequestEDIBadRequest { - - return &GetPaymentRequestEDIBadRequest{} -} - -// WithPayload adds the payload to the get payment request e d i bad request response -func (o *GetPaymentRequestEDIBadRequest) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i bad request response -func (o *GetPaymentRequestEDIBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIUnauthorizedCode is the HTTP code returned for type GetPaymentRequestEDIUnauthorized -const GetPaymentRequestEDIUnauthorizedCode int = 401 - -/* -GetPaymentRequestEDIUnauthorized The request was denied. - -swagger:response getPaymentRequestEDIUnauthorized -*/ -type GetPaymentRequestEDIUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIUnauthorized creates GetPaymentRequestEDIUnauthorized with default headers values -func NewGetPaymentRequestEDIUnauthorized() *GetPaymentRequestEDIUnauthorized { - - return &GetPaymentRequestEDIUnauthorized{} -} - -// WithPayload adds the payload to the get payment request e d i unauthorized response -func (o *GetPaymentRequestEDIUnauthorized) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i unauthorized response -func (o *GetPaymentRequestEDIUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIForbiddenCode is the HTTP code returned for type GetPaymentRequestEDIForbidden -const GetPaymentRequestEDIForbiddenCode int = 403 - -/* -GetPaymentRequestEDIForbidden The request was denied. - -swagger:response getPaymentRequestEDIForbidden -*/ -type GetPaymentRequestEDIForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIForbidden creates GetPaymentRequestEDIForbidden with default headers values -func NewGetPaymentRequestEDIForbidden() *GetPaymentRequestEDIForbidden { - - return &GetPaymentRequestEDIForbidden{} -} - -// WithPayload adds the payload to the get payment request e d i forbidden response -func (o *GetPaymentRequestEDIForbidden) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i forbidden response -func (o *GetPaymentRequestEDIForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDINotFoundCode is the HTTP code returned for type GetPaymentRequestEDINotFound -const GetPaymentRequestEDINotFoundCode int = 404 - -/* -GetPaymentRequestEDINotFound The requested resource wasn't found. - -swagger:response getPaymentRequestEDINotFound -*/ -type GetPaymentRequestEDINotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDINotFound creates GetPaymentRequestEDINotFound with default headers values -func NewGetPaymentRequestEDINotFound() *GetPaymentRequestEDINotFound { - - return &GetPaymentRequestEDINotFound{} -} - -// WithPayload adds the payload to the get payment request e d i not found response -func (o *GetPaymentRequestEDINotFound) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDINotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i not found response -func (o *GetPaymentRequestEDINotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDINotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIConflictCode is the HTTP code returned for type GetPaymentRequestEDIConflict -const GetPaymentRequestEDIConflictCode int = 409 - -/* -GetPaymentRequestEDIConflict There was a conflict with the request. - -swagger:response getPaymentRequestEDIConflict -*/ -type GetPaymentRequestEDIConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIConflict creates GetPaymentRequestEDIConflict with default headers values -func NewGetPaymentRequestEDIConflict() *GetPaymentRequestEDIConflict { - - return &GetPaymentRequestEDIConflict{} -} - -// WithPayload adds the payload to the get payment request e d i conflict response -func (o *GetPaymentRequestEDIConflict) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i conflict response -func (o *GetPaymentRequestEDIConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIUnprocessableEntityCode is the HTTP code returned for type GetPaymentRequestEDIUnprocessableEntity -const GetPaymentRequestEDIUnprocessableEntityCode int = 422 - -/* -GetPaymentRequestEDIUnprocessableEntity The payload was unprocessable. - -swagger:response getPaymentRequestEDIUnprocessableEntity -*/ -type GetPaymentRequestEDIUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIUnprocessableEntity creates GetPaymentRequestEDIUnprocessableEntity with default headers values -func NewGetPaymentRequestEDIUnprocessableEntity() *GetPaymentRequestEDIUnprocessableEntity { - - return &GetPaymentRequestEDIUnprocessableEntity{} -} - -// WithPayload adds the payload to the get payment request e d i unprocessable entity response -func (o *GetPaymentRequestEDIUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *GetPaymentRequestEDIUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i unprocessable entity response -func (o *GetPaymentRequestEDIUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetPaymentRequestEDIInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestEDIInternalServerError -const GetPaymentRequestEDIInternalServerErrorCode int = 500 - -/* -GetPaymentRequestEDIInternalServerError A server error occurred. - -swagger:response getPaymentRequestEDIInternalServerError -*/ -type GetPaymentRequestEDIInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewGetPaymentRequestEDIInternalServerError creates GetPaymentRequestEDIInternalServerError with default headers values -func NewGetPaymentRequestEDIInternalServerError() *GetPaymentRequestEDIInternalServerError { - - return &GetPaymentRequestEDIInternalServerError{} -} - -// WithPayload adds the payload to the get payment request e d i internal server error response -func (o *GetPaymentRequestEDIInternalServerError) WithPayload(payload *supportmessages.Error) *GetPaymentRequestEDIInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get payment request e d i internal server error response -func (o *GetPaymentRequestEDIInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetPaymentRequestEDIInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go deleted file mode 100644 index e5c52694d20..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// GetPaymentRequestEDIURL generates an URL for the get payment request e d i operation -type GetPaymentRequestEDIURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestEDIURL) WithBasePath(bp string) *GetPaymentRequestEDIURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetPaymentRequestEDIURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetPaymentRequestEDIURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/edi" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on GetPaymentRequestEDIURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetPaymentRequestEDIURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetPaymentRequestEDIURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetPaymentRequestEDIURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetPaymentRequestEDIURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetPaymentRequestEDIURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetPaymentRequestEDIURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go deleted file mode 100644 index 8f2990500fb..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ListMTOPaymentRequestsHandlerFunc turns a function with the right signature into a list m t o payment requests handler -type ListMTOPaymentRequestsHandlerFunc func(ListMTOPaymentRequestsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ListMTOPaymentRequestsHandlerFunc) Handle(params ListMTOPaymentRequestsParams) middleware.Responder { - return fn(params) -} - -// ListMTOPaymentRequestsHandler interface for that can handle valid list m t o payment requests params -type ListMTOPaymentRequestsHandler interface { - Handle(ListMTOPaymentRequestsParams) middleware.Responder -} - -// NewListMTOPaymentRequests creates a new http.Handler for the list m t o payment requests operation -func NewListMTOPaymentRequests(ctx *middleware.Context, handler ListMTOPaymentRequestsHandler) *ListMTOPaymentRequests { - return &ListMTOPaymentRequests{Context: ctx, Handler: handler} -} - -/* - ListMTOPaymentRequests swagger:route GET /move-task-orders/{moveTaskOrderID}/payment-requests paymentRequest listMTOPaymentRequests - -listMTOPaymentRequests - -### Functionality - -This endpoint lists all PaymentRequests associated with a given MoveTaskOrder. - -This is a support endpoint and is not available in production. -*/ -type ListMTOPaymentRequests struct { - Context *middleware.Context - Handler ListMTOPaymentRequestsHandler -} - -func (o *ListMTOPaymentRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewListMTOPaymentRequestsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go deleted file mode 100644 index 87340033535..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewListMTOPaymentRequestsParams creates a new ListMTOPaymentRequestsParams object -// -// There are no default values defined in the spec. -func NewListMTOPaymentRequestsParams() ListMTOPaymentRequestsParams { - - return ListMTOPaymentRequestsParams{} -} - -// ListMTOPaymentRequestsParams contains all the bound params for the list m t o payment requests operation -// typically these are obtained from a http.Request -// -// swagger:parameters listMTOPaymentRequests -type ListMTOPaymentRequestsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Only return move task orders updated since this time. - Required: true - In: path - */ - MoveTaskOrderID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewListMTOPaymentRequestsParams() beforehand. -func (o *ListMTOPaymentRequestsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") - if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. -func (o *ListMTOPaymentRequestsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) - } - o.MoveTaskOrderID = *(value.(*strfmt.UUID)) - - if err := o.validateMoveTaskOrderID(formats); err != nil { - return err - } - - return nil -} - -// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID -func (o *ListMTOPaymentRequestsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { - - if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go deleted file mode 100644 index 78390d49ed1..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ListMTOPaymentRequestsOKCode is the HTTP code returned for type ListMTOPaymentRequestsOK -const ListMTOPaymentRequestsOKCode int = 200 - -/* -ListMTOPaymentRequestsOK Successfully retrieved payment requests associated with a given move task order - -swagger:response listMTOPaymentRequestsOK -*/ -type ListMTOPaymentRequestsOK struct { - - /* - In: Body - */ - Payload supportmessages.PaymentRequests `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsOK creates ListMTOPaymentRequestsOK with default headers values -func NewListMTOPaymentRequestsOK() *ListMTOPaymentRequestsOK { - - return &ListMTOPaymentRequestsOK{} -} - -// WithPayload adds the payload to the list m t o payment requests o k response -func (o *ListMTOPaymentRequestsOK) WithPayload(payload supportmessages.PaymentRequests) *ListMTOPaymentRequestsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests o k response -func (o *ListMTOPaymentRequestsOK) SetPayload(payload supportmessages.PaymentRequests) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = supportmessages.PaymentRequests{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ListMTOPaymentRequestsBadRequestCode is the HTTP code returned for type ListMTOPaymentRequestsBadRequest -const ListMTOPaymentRequestsBadRequestCode int = 400 - -/* -ListMTOPaymentRequestsBadRequest The request payload is invalid. - -swagger:response listMTOPaymentRequestsBadRequest -*/ -type ListMTOPaymentRequestsBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsBadRequest creates ListMTOPaymentRequestsBadRequest with default headers values -func NewListMTOPaymentRequestsBadRequest() *ListMTOPaymentRequestsBadRequest { - - return &ListMTOPaymentRequestsBadRequest{} -} - -// WithPayload adds the payload to the list m t o payment requests bad request response -func (o *ListMTOPaymentRequestsBadRequest) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests bad request response -func (o *ListMTOPaymentRequestsBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOPaymentRequestsUnauthorizedCode is the HTTP code returned for type ListMTOPaymentRequestsUnauthorized -const ListMTOPaymentRequestsUnauthorizedCode int = 401 - -/* -ListMTOPaymentRequestsUnauthorized The request was denied. - -swagger:response listMTOPaymentRequestsUnauthorized -*/ -type ListMTOPaymentRequestsUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsUnauthorized creates ListMTOPaymentRequestsUnauthorized with default headers values -func NewListMTOPaymentRequestsUnauthorized() *ListMTOPaymentRequestsUnauthorized { - - return &ListMTOPaymentRequestsUnauthorized{} -} - -// WithPayload adds the payload to the list m t o payment requests unauthorized response -func (o *ListMTOPaymentRequestsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests unauthorized response -func (o *ListMTOPaymentRequestsUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOPaymentRequestsForbiddenCode is the HTTP code returned for type ListMTOPaymentRequestsForbidden -const ListMTOPaymentRequestsForbiddenCode int = 403 - -/* -ListMTOPaymentRequestsForbidden The request was denied. - -swagger:response listMTOPaymentRequestsForbidden -*/ -type ListMTOPaymentRequestsForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsForbidden creates ListMTOPaymentRequestsForbidden with default headers values -func NewListMTOPaymentRequestsForbidden() *ListMTOPaymentRequestsForbidden { - - return &ListMTOPaymentRequestsForbidden{} -} - -// WithPayload adds the payload to the list m t o payment requests forbidden response -func (o *ListMTOPaymentRequestsForbidden) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests forbidden response -func (o *ListMTOPaymentRequestsForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOPaymentRequestsNotFoundCode is the HTTP code returned for type ListMTOPaymentRequestsNotFound -const ListMTOPaymentRequestsNotFoundCode int = 404 - -/* -ListMTOPaymentRequestsNotFound The requested resource wasn't found. - -swagger:response listMTOPaymentRequestsNotFound -*/ -type ListMTOPaymentRequestsNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsNotFound creates ListMTOPaymentRequestsNotFound with default headers values -func NewListMTOPaymentRequestsNotFound() *ListMTOPaymentRequestsNotFound { - - return &ListMTOPaymentRequestsNotFound{} -} - -// WithPayload adds the payload to the list m t o payment requests not found response -func (o *ListMTOPaymentRequestsNotFound) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests not found response -func (o *ListMTOPaymentRequestsNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ListMTOPaymentRequestsInternalServerErrorCode is the HTTP code returned for type ListMTOPaymentRequestsInternalServerError -const ListMTOPaymentRequestsInternalServerErrorCode int = 500 - -/* -ListMTOPaymentRequestsInternalServerError A server error occurred. - -swagger:response listMTOPaymentRequestsInternalServerError -*/ -type ListMTOPaymentRequestsInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewListMTOPaymentRequestsInternalServerError creates ListMTOPaymentRequestsInternalServerError with default headers values -func NewListMTOPaymentRequestsInternalServerError() *ListMTOPaymentRequestsInternalServerError { - - return &ListMTOPaymentRequestsInternalServerError{} -} - -// WithPayload adds the payload to the list m t o payment requests internal server error response -func (o *ListMTOPaymentRequestsInternalServerError) WithPayload(payload *supportmessages.Error) *ListMTOPaymentRequestsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the list m t o payment requests internal server error response -func (o *ListMTOPaymentRequestsInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ListMTOPaymentRequestsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go deleted file mode 100644 index f55d63b7339..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// ListMTOPaymentRequestsURL generates an URL for the list m t o payment requests operation -type ListMTOPaymentRequestsURL struct { - MoveTaskOrderID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOPaymentRequestsURL) WithBasePath(bp string) *ListMTOPaymentRequestsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ListMTOPaymentRequestsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ListMTOPaymentRequestsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/move-task-orders/{moveTaskOrderID}/payment-requests" - - moveTaskOrderID := o.MoveTaskOrderID.String() - if moveTaskOrderID != "" { - _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) - } else { - return nil, errors.New("moveTaskOrderId is required on ListMTOPaymentRequestsURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ListMTOPaymentRequestsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ListMTOPaymentRequestsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ListMTOPaymentRequestsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ListMTOPaymentRequestsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ListMTOPaymentRequestsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ListMTOPaymentRequestsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go deleted file mode 100644 index efefe2dd1b7..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go +++ /dev/null @@ -1,61 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ProcessReviewedPaymentRequestsHandlerFunc turns a function with the right signature into a process reviewed payment requests handler -type ProcessReviewedPaymentRequestsHandlerFunc func(ProcessReviewedPaymentRequestsParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ProcessReviewedPaymentRequestsHandlerFunc) Handle(params ProcessReviewedPaymentRequestsParams) middleware.Responder { - return fn(params) -} - -// ProcessReviewedPaymentRequestsHandler interface for that can handle valid process reviewed payment requests params -type ProcessReviewedPaymentRequestsHandler interface { - Handle(ProcessReviewedPaymentRequestsParams) middleware.Responder -} - -// NewProcessReviewedPaymentRequests creates a new http.Handler for the process reviewed payment requests operation -func NewProcessReviewedPaymentRequests(ctx *middleware.Context, handler ProcessReviewedPaymentRequestsHandler) *ProcessReviewedPaymentRequests { - return &ProcessReviewedPaymentRequests{Context: ctx, Handler: handler} -} - -/* - ProcessReviewedPaymentRequests swagger:route PATCH /payment-requests/process-reviewed paymentRequest processReviewedPaymentRequests - -processReviewedPaymentRequests - -Updates the status of reviewed payment requests and sends PRs to Syncada if -the SendToSyncada flag is set - -This is a support endpoint and will not be available in production. -*/ -type ProcessReviewedPaymentRequests struct { - Context *middleware.Context - Handler ProcessReviewedPaymentRequestsHandler -} - -func (o *ProcessReviewedPaymentRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewProcessReviewedPaymentRequestsParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go deleted file mode 100644 index 644c93041ee..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewProcessReviewedPaymentRequestsParams creates a new ProcessReviewedPaymentRequestsParams object -// -// There are no default values defined in the spec. -func NewProcessReviewedPaymentRequestsParams() ProcessReviewedPaymentRequestsParams { - - return ProcessReviewedPaymentRequestsParams{} -} - -// ProcessReviewedPaymentRequestsParams contains all the bound params for the process reviewed payment requests operation -// typically these are obtained from a http.Request -// -// swagger:parameters processReviewedPaymentRequests -type ProcessReviewedPaymentRequestsParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /* - Required: true - In: body - */ - Body *supportmessages.ProcessReviewedPaymentRequests -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewProcessReviewedPaymentRequestsParams() beforehand. -func (o *ProcessReviewedPaymentRequestsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.ProcessReviewedPaymentRequests - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go deleted file mode 100644 index 56b1631599a..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ProcessReviewedPaymentRequestsOKCode is the HTTP code returned for type ProcessReviewedPaymentRequestsOK -const ProcessReviewedPaymentRequestsOKCode int = 200 - -/* -ProcessReviewedPaymentRequestsOK Successfully updated status of reviewed payment request and sent to Syncada if that flag is set - -swagger:response processReviewedPaymentRequestsOK -*/ -type ProcessReviewedPaymentRequestsOK struct { - - /* - In: Body - */ - Payload supportmessages.PaymentRequests `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsOK creates ProcessReviewedPaymentRequestsOK with default headers values -func NewProcessReviewedPaymentRequestsOK() *ProcessReviewedPaymentRequestsOK { - - return &ProcessReviewedPaymentRequestsOK{} -} - -// WithPayload adds the payload to the process reviewed payment requests o k response -func (o *ProcessReviewedPaymentRequestsOK) WithPayload(payload supportmessages.PaymentRequests) *ProcessReviewedPaymentRequestsOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests o k response -func (o *ProcessReviewedPaymentRequestsOK) SetPayload(payload supportmessages.PaymentRequests) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - payload := o.Payload - if payload == nil { - // return empty array - payload = supportmessages.PaymentRequests{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } -} - -// ProcessReviewedPaymentRequestsBadRequestCode is the HTTP code returned for type ProcessReviewedPaymentRequestsBadRequest -const ProcessReviewedPaymentRequestsBadRequestCode int = 400 - -/* -ProcessReviewedPaymentRequestsBadRequest The request payload is invalid. - -swagger:response processReviewedPaymentRequestsBadRequest -*/ -type ProcessReviewedPaymentRequestsBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsBadRequest creates ProcessReviewedPaymentRequestsBadRequest with default headers values -func NewProcessReviewedPaymentRequestsBadRequest() *ProcessReviewedPaymentRequestsBadRequest { - - return &ProcessReviewedPaymentRequestsBadRequest{} -} - -// WithPayload adds the payload to the process reviewed payment requests bad request response -func (o *ProcessReviewedPaymentRequestsBadRequest) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests bad request response -func (o *ProcessReviewedPaymentRequestsBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ProcessReviewedPaymentRequestsUnauthorizedCode is the HTTP code returned for type ProcessReviewedPaymentRequestsUnauthorized -const ProcessReviewedPaymentRequestsUnauthorizedCode int = 401 - -/* -ProcessReviewedPaymentRequestsUnauthorized The request was denied. - -swagger:response processReviewedPaymentRequestsUnauthorized -*/ -type ProcessReviewedPaymentRequestsUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsUnauthorized creates ProcessReviewedPaymentRequestsUnauthorized with default headers values -func NewProcessReviewedPaymentRequestsUnauthorized() *ProcessReviewedPaymentRequestsUnauthorized { - - return &ProcessReviewedPaymentRequestsUnauthorized{} -} - -// WithPayload adds the payload to the process reviewed payment requests unauthorized response -func (o *ProcessReviewedPaymentRequestsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests unauthorized response -func (o *ProcessReviewedPaymentRequestsUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ProcessReviewedPaymentRequestsForbiddenCode is the HTTP code returned for type ProcessReviewedPaymentRequestsForbidden -const ProcessReviewedPaymentRequestsForbiddenCode int = 403 - -/* -ProcessReviewedPaymentRequestsForbidden The request was denied. - -swagger:response processReviewedPaymentRequestsForbidden -*/ -type ProcessReviewedPaymentRequestsForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsForbidden creates ProcessReviewedPaymentRequestsForbidden with default headers values -func NewProcessReviewedPaymentRequestsForbidden() *ProcessReviewedPaymentRequestsForbidden { - - return &ProcessReviewedPaymentRequestsForbidden{} -} - -// WithPayload adds the payload to the process reviewed payment requests forbidden response -func (o *ProcessReviewedPaymentRequestsForbidden) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests forbidden response -func (o *ProcessReviewedPaymentRequestsForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ProcessReviewedPaymentRequestsNotFoundCode is the HTTP code returned for type ProcessReviewedPaymentRequestsNotFound -const ProcessReviewedPaymentRequestsNotFoundCode int = 404 - -/* -ProcessReviewedPaymentRequestsNotFound The requested resource wasn't found. - -swagger:response processReviewedPaymentRequestsNotFound -*/ -type ProcessReviewedPaymentRequestsNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsNotFound creates ProcessReviewedPaymentRequestsNotFound with default headers values -func NewProcessReviewedPaymentRequestsNotFound() *ProcessReviewedPaymentRequestsNotFound { - - return &ProcessReviewedPaymentRequestsNotFound{} -} - -// WithPayload adds the payload to the process reviewed payment requests not found response -func (o *ProcessReviewedPaymentRequestsNotFound) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests not found response -func (o *ProcessReviewedPaymentRequestsNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ProcessReviewedPaymentRequestsUnprocessableEntityCode is the HTTP code returned for type ProcessReviewedPaymentRequestsUnprocessableEntity -const ProcessReviewedPaymentRequestsUnprocessableEntityCode int = 422 - -/* -ProcessReviewedPaymentRequestsUnprocessableEntity The payload was unprocessable. - -swagger:response processReviewedPaymentRequestsUnprocessableEntity -*/ -type ProcessReviewedPaymentRequestsUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsUnprocessableEntity creates ProcessReviewedPaymentRequestsUnprocessableEntity with default headers values -func NewProcessReviewedPaymentRequestsUnprocessableEntity() *ProcessReviewedPaymentRequestsUnprocessableEntity { - - return &ProcessReviewedPaymentRequestsUnprocessableEntity{} -} - -// WithPayload adds the payload to the process reviewed payment requests unprocessable entity response -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *ProcessReviewedPaymentRequestsUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests unprocessable entity response -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ProcessReviewedPaymentRequestsInternalServerErrorCode is the HTTP code returned for type ProcessReviewedPaymentRequestsInternalServerError -const ProcessReviewedPaymentRequestsInternalServerErrorCode int = 500 - -/* -ProcessReviewedPaymentRequestsInternalServerError A server error occurred. - -swagger:response processReviewedPaymentRequestsInternalServerError -*/ -type ProcessReviewedPaymentRequestsInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewProcessReviewedPaymentRequestsInternalServerError creates ProcessReviewedPaymentRequestsInternalServerError with default headers values -func NewProcessReviewedPaymentRequestsInternalServerError() *ProcessReviewedPaymentRequestsInternalServerError { - - return &ProcessReviewedPaymentRequestsInternalServerError{} -} - -// WithPayload adds the payload to the process reviewed payment requests internal server error response -func (o *ProcessReviewedPaymentRequestsInternalServerError) WithPayload(payload *supportmessages.Error) *ProcessReviewedPaymentRequestsInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the process reviewed payment requests internal server error response -func (o *ProcessReviewedPaymentRequestsInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ProcessReviewedPaymentRequestsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go deleted file mode 100644 index dfabf79ef51..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ProcessReviewedPaymentRequestsURL generates an URL for the process reviewed payment requests operation -type ProcessReviewedPaymentRequestsURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ProcessReviewedPaymentRequestsURL) WithBasePath(bp string) *ProcessReviewedPaymentRequestsURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ProcessReviewedPaymentRequestsURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ProcessReviewedPaymentRequestsURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/process-reviewed" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ProcessReviewedPaymentRequestsURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ProcessReviewedPaymentRequestsURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ProcessReviewedPaymentRequestsURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ProcessReviewedPaymentRequestsURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ProcessReviewedPaymentRequestsURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ProcessReviewedPaymentRequestsURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go deleted file mode 100644 index fb6b1a7f92a..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// RecalculatePaymentRequestHandlerFunc turns a function with the right signature into a recalculate payment request handler -type RecalculatePaymentRequestHandlerFunc func(RecalculatePaymentRequestParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn RecalculatePaymentRequestHandlerFunc) Handle(params RecalculatePaymentRequestParams) middleware.Responder { - return fn(params) -} - -// RecalculatePaymentRequestHandler interface for that can handle valid recalculate payment request params -type RecalculatePaymentRequestHandler interface { - Handle(RecalculatePaymentRequestParams) middleware.Responder -} - -// NewRecalculatePaymentRequest creates a new http.Handler for the recalculate payment request operation -func NewRecalculatePaymentRequest(ctx *middleware.Context, handler RecalculatePaymentRequestHandler) *RecalculatePaymentRequest { - return &RecalculatePaymentRequest{Context: ctx, Handler: handler} -} - -/* - RecalculatePaymentRequest swagger:route POST /payment-requests/{paymentRequestID}/recalculate paymentRequest recalculatePaymentRequest - -recalculatePaymentRequest - -Recalculates an existing pending payment request by creating a new payment request for the same service -items but is priced based on the current inputs (weights, dates, etc.). The previously existing payment -request is then deprecated. A link is made between the new and existing payment requests. - -This is a support endpoint and will not be available in production. -*/ -type RecalculatePaymentRequest struct { - Context *middleware.Context - Handler RecalculatePaymentRequestHandler -} - -func (o *RecalculatePaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewRecalculatePaymentRequestParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go deleted file mode 100644 index d747015620e..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go +++ /dev/null @@ -1,91 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// NewRecalculatePaymentRequestParams creates a new RecalculatePaymentRequestParams object -// -// There are no default values defined in the spec. -func NewRecalculatePaymentRequestParams() RecalculatePaymentRequestParams { - - return RecalculatePaymentRequestParams{} -} - -// RecalculatePaymentRequestParams contains all the bound params for the recalculate payment request operation -// typically these are obtained from a http.Request -// -// swagger:parameters recalculatePaymentRequest -type RecalculatePaymentRequestParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*UUID of the payment request to recalculate. - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewRecalculatePaymentRequestParams() beforehand. -func (o *RecalculatePaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *RecalculatePaymentRequestParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *RecalculatePaymentRequestParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go deleted file mode 100644 index 68d893ca414..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// RecalculatePaymentRequestCreatedCode is the HTTP code returned for type RecalculatePaymentRequestCreated -const RecalculatePaymentRequestCreatedCode int = 201 - -/* -RecalculatePaymentRequestCreated The new payment request with recalculated pricing. - -swagger:response recalculatePaymentRequestCreated -*/ -type RecalculatePaymentRequestCreated struct { - - /* - In: Body - */ - Payload *supportmessages.PaymentRequest `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestCreated creates RecalculatePaymentRequestCreated with default headers values -func NewRecalculatePaymentRequestCreated() *RecalculatePaymentRequestCreated { - - return &RecalculatePaymentRequestCreated{} -} - -// WithPayload adds the payload to the recalculate payment request created response -func (o *RecalculatePaymentRequestCreated) WithPayload(payload *supportmessages.PaymentRequest) *RecalculatePaymentRequestCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request created response -func (o *RecalculatePaymentRequestCreated) SetPayload(payload *supportmessages.PaymentRequest) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestBadRequestCode is the HTTP code returned for type RecalculatePaymentRequestBadRequest -const RecalculatePaymentRequestBadRequestCode int = 400 - -/* -RecalculatePaymentRequestBadRequest The request payload is invalid. - -swagger:response recalculatePaymentRequestBadRequest -*/ -type RecalculatePaymentRequestBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestBadRequest creates RecalculatePaymentRequestBadRequest with default headers values -func NewRecalculatePaymentRequestBadRequest() *RecalculatePaymentRequestBadRequest { - - return &RecalculatePaymentRequestBadRequest{} -} - -// WithPayload adds the payload to the recalculate payment request bad request response -func (o *RecalculatePaymentRequestBadRequest) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request bad request response -func (o *RecalculatePaymentRequestBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestUnauthorizedCode is the HTTP code returned for type RecalculatePaymentRequestUnauthorized -const RecalculatePaymentRequestUnauthorizedCode int = 401 - -/* -RecalculatePaymentRequestUnauthorized The request was denied. - -swagger:response recalculatePaymentRequestUnauthorized -*/ -type RecalculatePaymentRequestUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestUnauthorized creates RecalculatePaymentRequestUnauthorized with default headers values -func NewRecalculatePaymentRequestUnauthorized() *RecalculatePaymentRequestUnauthorized { - - return &RecalculatePaymentRequestUnauthorized{} -} - -// WithPayload adds the payload to the recalculate payment request unauthorized response -func (o *RecalculatePaymentRequestUnauthorized) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request unauthorized response -func (o *RecalculatePaymentRequestUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestForbiddenCode is the HTTP code returned for type RecalculatePaymentRequestForbidden -const RecalculatePaymentRequestForbiddenCode int = 403 - -/* -RecalculatePaymentRequestForbidden The request was denied. - -swagger:response recalculatePaymentRequestForbidden -*/ -type RecalculatePaymentRequestForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestForbidden creates RecalculatePaymentRequestForbidden with default headers values -func NewRecalculatePaymentRequestForbidden() *RecalculatePaymentRequestForbidden { - - return &RecalculatePaymentRequestForbidden{} -} - -// WithPayload adds the payload to the recalculate payment request forbidden response -func (o *RecalculatePaymentRequestForbidden) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request forbidden response -func (o *RecalculatePaymentRequestForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestNotFoundCode is the HTTP code returned for type RecalculatePaymentRequestNotFound -const RecalculatePaymentRequestNotFoundCode int = 404 - -/* -RecalculatePaymentRequestNotFound The requested resource wasn't found. - -swagger:response recalculatePaymentRequestNotFound -*/ -type RecalculatePaymentRequestNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestNotFound creates RecalculatePaymentRequestNotFound with default headers values -func NewRecalculatePaymentRequestNotFound() *RecalculatePaymentRequestNotFound { - - return &RecalculatePaymentRequestNotFound{} -} - -// WithPayload adds the payload to the recalculate payment request not found response -func (o *RecalculatePaymentRequestNotFound) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request not found response -func (o *RecalculatePaymentRequestNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestConflictCode is the HTTP code returned for type RecalculatePaymentRequestConflict -const RecalculatePaymentRequestConflictCode int = 409 - -/* -RecalculatePaymentRequestConflict There was a conflict with the request. - -swagger:response recalculatePaymentRequestConflict -*/ -type RecalculatePaymentRequestConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestConflict creates RecalculatePaymentRequestConflict with default headers values -func NewRecalculatePaymentRequestConflict() *RecalculatePaymentRequestConflict { - - return &RecalculatePaymentRequestConflict{} -} - -// WithPayload adds the payload to the recalculate payment request conflict response -func (o *RecalculatePaymentRequestConflict) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request conflict response -func (o *RecalculatePaymentRequestConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestPreconditionFailedCode is the HTTP code returned for type RecalculatePaymentRequestPreconditionFailed -const RecalculatePaymentRequestPreconditionFailedCode int = 412 - -/* -RecalculatePaymentRequestPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response recalculatePaymentRequestPreconditionFailed -*/ -type RecalculatePaymentRequestPreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestPreconditionFailed creates RecalculatePaymentRequestPreconditionFailed with default headers values -func NewRecalculatePaymentRequestPreconditionFailed() *RecalculatePaymentRequestPreconditionFailed { - - return &RecalculatePaymentRequestPreconditionFailed{} -} - -// WithPayload adds the payload to the recalculate payment request precondition failed response -func (o *RecalculatePaymentRequestPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request precondition failed response -func (o *RecalculatePaymentRequestPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestUnprocessableEntityCode is the HTTP code returned for type RecalculatePaymentRequestUnprocessableEntity -const RecalculatePaymentRequestUnprocessableEntityCode int = 422 - -/* -RecalculatePaymentRequestUnprocessableEntity The payload was unprocessable. - -swagger:response recalculatePaymentRequestUnprocessableEntity -*/ -type RecalculatePaymentRequestUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestUnprocessableEntity creates RecalculatePaymentRequestUnprocessableEntity with default headers values -func NewRecalculatePaymentRequestUnprocessableEntity() *RecalculatePaymentRequestUnprocessableEntity { - - return &RecalculatePaymentRequestUnprocessableEntity{} -} - -// WithPayload adds the payload to the recalculate payment request unprocessable entity response -func (o *RecalculatePaymentRequestUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *RecalculatePaymentRequestUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request unprocessable entity response -func (o *RecalculatePaymentRequestUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// RecalculatePaymentRequestInternalServerErrorCode is the HTTP code returned for type RecalculatePaymentRequestInternalServerError -const RecalculatePaymentRequestInternalServerErrorCode int = 500 - -/* -RecalculatePaymentRequestInternalServerError A server error occurred. - -swagger:response recalculatePaymentRequestInternalServerError -*/ -type RecalculatePaymentRequestInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewRecalculatePaymentRequestInternalServerError creates RecalculatePaymentRequestInternalServerError with default headers values -func NewRecalculatePaymentRequestInternalServerError() *RecalculatePaymentRequestInternalServerError { - - return &RecalculatePaymentRequestInternalServerError{} -} - -// WithPayload adds the payload to the recalculate payment request internal server error response -func (o *RecalculatePaymentRequestInternalServerError) WithPayload(payload *supportmessages.Error) *RecalculatePaymentRequestInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the recalculate payment request internal server error response -func (o *RecalculatePaymentRequestInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *RecalculatePaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go deleted file mode 100644 index 61c73beca5e..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// RecalculatePaymentRequestURL generates an URL for the recalculate payment request operation -type RecalculatePaymentRequestURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RecalculatePaymentRequestURL) WithBasePath(bp string) *RecalculatePaymentRequestURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *RecalculatePaymentRequestURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *RecalculatePaymentRequestURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/recalculate" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on RecalculatePaymentRequestURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *RecalculatePaymentRequestURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *RecalculatePaymentRequestURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *RecalculatePaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on RecalculatePaymentRequestURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on RecalculatePaymentRequestURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *RecalculatePaymentRequestURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go deleted file mode 100644 index 2d608c5d45b..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go +++ /dev/null @@ -1,62 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// UpdatePaymentRequestStatusHandlerFunc turns a function with the right signature into a update payment request status handler -type UpdatePaymentRequestStatusHandlerFunc func(UpdatePaymentRequestStatusParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn UpdatePaymentRequestStatusHandlerFunc) Handle(params UpdatePaymentRequestStatusParams) middleware.Responder { - return fn(params) -} - -// UpdatePaymentRequestStatusHandler interface for that can handle valid update payment request status params -type UpdatePaymentRequestStatusHandler interface { - Handle(UpdatePaymentRequestStatusParams) middleware.Responder -} - -// NewUpdatePaymentRequestStatus creates a new http.Handler for the update payment request status operation -func NewUpdatePaymentRequestStatus(ctx *middleware.Context, handler UpdatePaymentRequestStatusHandler) *UpdatePaymentRequestStatus { - return &UpdatePaymentRequestStatus{Context: ctx, Handler: handler} -} - -/* - UpdatePaymentRequestStatus swagger:route PATCH /payment-requests/{paymentRequestID}/status paymentRequest updatePaymentRequestStatus - -updatePaymentRequestStatus - -Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED. - -A status of REVIEWED can optionally have a `rejectionReason`. - -This is a support endpoint and is not available in production. -*/ -type UpdatePaymentRequestStatus struct { - Context *middleware.Context - Handler UpdatePaymentRequestStatusHandler -} - -func (o *UpdatePaymentRequestStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewUpdatePaymentRequestStatusParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go deleted file mode 100644 index c2d24299565..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go +++ /dev/null @@ -1,158 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object -// -// There are no default values defined in the spec. -func NewUpdatePaymentRequestStatusParams() UpdatePaymentRequestStatusParams { - - return UpdatePaymentRequestStatusParams{} -} - -// UpdatePaymentRequestStatusParams contains all the bound params for the update payment request status operation -// typically these are obtained from a http.Request -// -// swagger:parameters updatePaymentRequestStatus -type UpdatePaymentRequestStatusParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - Required: true - In: header - */ - IfMatch string - /* - Required: true - In: body - */ - Body *supportmessages.UpdatePaymentRequestStatus - /*UUID of payment request. - Required: true - In: path - */ - PaymentRequestID strfmt.UUID -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewUpdatePaymentRequestStatusParams() beforehand. -func (o *UpdatePaymentRequestStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { - res = append(res, err) - } - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.UpdatePaymentRequestStatus - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - - rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") - if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { - res = append(res, err) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// bindIfMatch binds and validates parameter IfMatch from header. -func (o *UpdatePaymentRequestStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { - if !hasKey { - return errors.Required("If-Match", "header", rawData) - } - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - - if err := validate.RequiredString("If-Match", "header", raw); err != nil { - return err - } - o.IfMatch = raw - - return nil -} - -// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. -func (o *UpdatePaymentRequestStatusParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: true - // Parameter is provided by construction from the route - - // Format: uuid - value, err := formats.Parse("uuid", raw) - if err != nil { - return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) - } - o.PaymentRequestID = *(value.(*strfmt.UUID)) - - if err := o.validatePaymentRequestID(formats); err != nil { - return err - } - - return nil -} - -// validatePaymentRequestID carries on validations for parameter PaymentRequestID -func (o *UpdatePaymentRequestStatusParams) validatePaymentRequestID(formats strfmt.Registry) error { - - if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { - return err - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go deleted file mode 100644 index 2fbd739f80d..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go +++ /dev/null @@ -1,419 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdatePaymentRequestStatusOKCode is the HTTP code returned for type UpdatePaymentRequestStatusOK -const UpdatePaymentRequestStatusOKCode int = 200 - -/* -UpdatePaymentRequestStatusOK Successfully updated payment request status. - -swagger:response updatePaymentRequestStatusOK -*/ -type UpdatePaymentRequestStatusOK struct { - - /* - In: Body - */ - Payload *supportmessages.PaymentRequest `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusOK creates UpdatePaymentRequestStatusOK with default headers values -func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { - - return &UpdatePaymentRequestStatusOK{} -} - -// WithPayload adds the payload to the update payment request status o k response -func (o *UpdatePaymentRequestStatusOK) WithPayload(payload *supportmessages.PaymentRequest) *UpdatePaymentRequestStatusOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status o k response -func (o *UpdatePaymentRequestStatusOK) SetPayload(payload *supportmessages.PaymentRequest) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusBadRequestCode is the HTTP code returned for type UpdatePaymentRequestStatusBadRequest -const UpdatePaymentRequestStatusBadRequestCode int = 400 - -/* -UpdatePaymentRequestStatusBadRequest The request payload is invalid. - -swagger:response updatePaymentRequestStatusBadRequest -*/ -type UpdatePaymentRequestStatusBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusBadRequest creates UpdatePaymentRequestStatusBadRequest with default headers values -func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { - - return &UpdatePaymentRequestStatusBadRequest{} -} - -// WithPayload adds the payload to the update payment request status bad request response -func (o *UpdatePaymentRequestStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status bad request response -func (o *UpdatePaymentRequestStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentRequestStatusUnauthorized -const UpdatePaymentRequestStatusUnauthorizedCode int = 401 - -/* -UpdatePaymentRequestStatusUnauthorized The request was denied. - -swagger:response updatePaymentRequestStatusUnauthorized -*/ -type UpdatePaymentRequestStatusUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusUnauthorized creates UpdatePaymentRequestStatusUnauthorized with default headers values -func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { - - return &UpdatePaymentRequestStatusUnauthorized{} -} - -// WithPayload adds the payload to the update payment request status unauthorized response -func (o *UpdatePaymentRequestStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status unauthorized response -func (o *UpdatePaymentRequestStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusForbiddenCode is the HTTP code returned for type UpdatePaymentRequestStatusForbidden -const UpdatePaymentRequestStatusForbiddenCode int = 403 - -/* -UpdatePaymentRequestStatusForbidden The request was denied. - -swagger:response updatePaymentRequestStatusForbidden -*/ -type UpdatePaymentRequestStatusForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusForbidden creates UpdatePaymentRequestStatusForbidden with default headers values -func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { - - return &UpdatePaymentRequestStatusForbidden{} -} - -// WithPayload adds the payload to the update payment request status forbidden response -func (o *UpdatePaymentRequestStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status forbidden response -func (o *UpdatePaymentRequestStatusForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusNotFoundCode is the HTTP code returned for type UpdatePaymentRequestStatusNotFound -const UpdatePaymentRequestStatusNotFoundCode int = 404 - -/* -UpdatePaymentRequestStatusNotFound The requested resource wasn't found. - -swagger:response updatePaymentRequestStatusNotFound -*/ -type UpdatePaymentRequestStatusNotFound struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusNotFound creates UpdatePaymentRequestStatusNotFound with default headers values -func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { - - return &UpdatePaymentRequestStatusNotFound{} -} - -// WithPayload adds the payload to the update payment request status not found response -func (o *UpdatePaymentRequestStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status not found response -func (o *UpdatePaymentRequestStatusNotFound) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusConflictCode is the HTTP code returned for type UpdatePaymentRequestStatusConflict -const UpdatePaymentRequestStatusConflictCode int = 409 - -/* -UpdatePaymentRequestStatusConflict There was a conflict with the request. - -swagger:response updatePaymentRequestStatusConflict -*/ -type UpdatePaymentRequestStatusConflict struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusConflict creates UpdatePaymentRequestStatusConflict with default headers values -func NewUpdatePaymentRequestStatusConflict() *UpdatePaymentRequestStatusConflict { - - return &UpdatePaymentRequestStatusConflict{} -} - -// WithPayload adds the payload to the update payment request status conflict response -func (o *UpdatePaymentRequestStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusConflict { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status conflict response -func (o *UpdatePaymentRequestStatusConflict) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(409) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentRequestStatusPreconditionFailed -const UpdatePaymentRequestStatusPreconditionFailedCode int = 412 - -/* -UpdatePaymentRequestStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. - -swagger:response updatePaymentRequestStatusPreconditionFailed -*/ -type UpdatePaymentRequestStatusPreconditionFailed struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusPreconditionFailed creates UpdatePaymentRequestStatusPreconditionFailed with default headers values -func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { - - return &UpdatePaymentRequestStatusPreconditionFailed{} -} - -// WithPayload adds the payload to the update payment request status precondition failed response -func (o *UpdatePaymentRequestStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusPreconditionFailed { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status precondition failed response -func (o *UpdatePaymentRequestStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(412) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentRequestStatusUnprocessableEntity -const UpdatePaymentRequestStatusUnprocessableEntityCode int = 422 - -/* -UpdatePaymentRequestStatusUnprocessableEntity The payload was unprocessable. - -swagger:response updatePaymentRequestStatusUnprocessableEntity -*/ -type UpdatePaymentRequestStatusUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusUnprocessableEntity creates UpdatePaymentRequestStatusUnprocessableEntity with default headers values -func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { - - return &UpdatePaymentRequestStatusUnprocessableEntity{} -} - -// WithPayload adds the payload to the update payment request status unprocessable entity response -func (o *UpdatePaymentRequestStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdatePaymentRequestStatusUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status unprocessable entity response -func (o *UpdatePaymentRequestStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// UpdatePaymentRequestStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentRequestStatusInternalServerError -const UpdatePaymentRequestStatusInternalServerErrorCode int = 500 - -/* -UpdatePaymentRequestStatusInternalServerError A server error occurred. - -swagger:response updatePaymentRequestStatusInternalServerError -*/ -type UpdatePaymentRequestStatusInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewUpdatePaymentRequestStatusInternalServerError creates UpdatePaymentRequestStatusInternalServerError with default headers values -func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { - - return &UpdatePaymentRequestStatusInternalServerError{} -} - -// WithPayload adds the payload to the update payment request status internal server error response -func (o *UpdatePaymentRequestStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdatePaymentRequestStatusInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the update payment request status internal server error response -func (o *UpdatePaymentRequestStatusInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *UpdatePaymentRequestStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go deleted file mode 100644 index 8d337b7e665..00000000000 --- a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go +++ /dev/null @@ -1,101 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" - "strings" - - "github.com/go-openapi/strfmt" -) - -// UpdatePaymentRequestStatusURL generates an URL for the update payment request status operation -type UpdatePaymentRequestStatusURL struct { - PaymentRequestID strfmt.UUID - - _basePath string - // avoid unkeyed usage - _ struct{} -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentRequestStatusURL) WithBasePath(bp string) *UpdatePaymentRequestStatusURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *UpdatePaymentRequestStatusURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *UpdatePaymentRequestStatusURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/payment-requests/{paymentRequestID}/status" - - paymentRequestID := o.PaymentRequestID.String() - if paymentRequestID != "" { - _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) - } else { - return nil, errors.New("paymentRequestId is required on UpdatePaymentRequestStatusURL") - } - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *UpdatePaymentRequestStatusURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *UpdatePaymentRequestStatusURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *UpdatePaymentRequestStatusURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on UpdatePaymentRequestStatusURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on UpdatePaymentRequestStatusURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *UpdatePaymentRequestStatusURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go deleted file mode 100644 index 15b207c8460..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// CreateWebhookNotificationHandlerFunc turns a function with the right signature into a create webhook notification handler -type CreateWebhookNotificationHandlerFunc func(CreateWebhookNotificationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn CreateWebhookNotificationHandlerFunc) Handle(params CreateWebhookNotificationParams) middleware.Responder { - return fn(params) -} - -// CreateWebhookNotificationHandler interface for that can handle valid create webhook notification params -type CreateWebhookNotificationHandler interface { - Handle(CreateWebhookNotificationParams) middleware.Responder -} - -// NewCreateWebhookNotification creates a new http.Handler for the create webhook notification operation -func NewCreateWebhookNotification(ctx *middleware.Context, handler CreateWebhookNotificationHandler) *CreateWebhookNotification { - return &CreateWebhookNotification{Context: ctx, Handler: handler} -} - -/* - CreateWebhookNotification swagger:route POST /webhook-notifications webhook createWebhookNotification - -# Test endpoint for creating webhook notifications - -This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation. -*/ -type CreateWebhookNotification struct { - Context *middleware.Context - Handler CreateWebhookNotificationHandler -} - -func (o *CreateWebhookNotification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewCreateWebhookNotificationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go deleted file mode 100644 index aeeedc93343..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go +++ /dev/null @@ -1,76 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewCreateWebhookNotificationParams creates a new CreateWebhookNotificationParams object -// -// There are no default values defined in the spec. -func NewCreateWebhookNotificationParams() CreateWebhookNotificationParams { - - return CreateWebhookNotificationParams{} -} - -// CreateWebhookNotificationParams contains all the bound params for the create webhook notification operation -// typically these are obtained from a http.Request -// -// swagger:parameters createWebhookNotification -type CreateWebhookNotificationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The notification sent by webhook-client. - In: body - */ - Body *supportmessages.WebhookNotification -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewCreateWebhookNotificationParams() beforehand. -func (o *CreateWebhookNotificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.WebhookNotification - if err := route.Consumer.Consume(r.Body, &body); err != nil { - res = append(res, errors.NewParseError("body", "body", "", err)) - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go deleted file mode 100644 index f697cc5bf92..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go +++ /dev/null @@ -1,149 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// CreateWebhookNotificationCreatedCode is the HTTP code returned for type CreateWebhookNotificationCreated -const CreateWebhookNotificationCreatedCode int = 201 - -/* -CreateWebhookNotificationCreated Successful creation - -swagger:response createWebhookNotificationCreated -*/ -type CreateWebhookNotificationCreated struct { - - /* - In: Body - */ - Payload *supportmessages.WebhookNotification `json:"body,omitempty"` -} - -// NewCreateWebhookNotificationCreated creates CreateWebhookNotificationCreated with default headers values -func NewCreateWebhookNotificationCreated() *CreateWebhookNotificationCreated { - - return &CreateWebhookNotificationCreated{} -} - -// WithPayload adds the payload to the create webhook notification created response -func (o *CreateWebhookNotificationCreated) WithPayload(payload *supportmessages.WebhookNotification) *CreateWebhookNotificationCreated { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create webhook notification created response -func (o *CreateWebhookNotificationCreated) SetPayload(payload *supportmessages.WebhookNotification) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWebhookNotificationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(201) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWebhookNotificationUnprocessableEntityCode is the HTTP code returned for type CreateWebhookNotificationUnprocessableEntity -const CreateWebhookNotificationUnprocessableEntityCode int = 422 - -/* -CreateWebhookNotificationUnprocessableEntity The payload was unprocessable. - -swagger:response createWebhookNotificationUnprocessableEntity -*/ -type CreateWebhookNotificationUnprocessableEntity struct { - - /* - In: Body - */ - Payload *supportmessages.ValidationError `json:"body,omitempty"` -} - -// NewCreateWebhookNotificationUnprocessableEntity creates CreateWebhookNotificationUnprocessableEntity with default headers values -func NewCreateWebhookNotificationUnprocessableEntity() *CreateWebhookNotificationUnprocessableEntity { - - return &CreateWebhookNotificationUnprocessableEntity{} -} - -// WithPayload adds the payload to the create webhook notification unprocessable entity response -func (o *CreateWebhookNotificationUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *CreateWebhookNotificationUnprocessableEntity { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create webhook notification unprocessable entity response -func (o *CreateWebhookNotificationUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWebhookNotificationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(422) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// CreateWebhookNotificationInternalServerErrorCode is the HTTP code returned for type CreateWebhookNotificationInternalServerError -const CreateWebhookNotificationInternalServerErrorCode int = 500 - -/* -CreateWebhookNotificationInternalServerError A server error occurred. - -swagger:response createWebhookNotificationInternalServerError -*/ -type CreateWebhookNotificationInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewCreateWebhookNotificationInternalServerError creates CreateWebhookNotificationInternalServerError with default headers values -func NewCreateWebhookNotificationInternalServerError() *CreateWebhookNotificationInternalServerError { - - return &CreateWebhookNotificationInternalServerError{} -} - -// WithPayload adds the payload to the create webhook notification internal server error response -func (o *CreateWebhookNotificationInternalServerError) WithPayload(payload *supportmessages.Error) *CreateWebhookNotificationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the create webhook notification internal server error response -func (o *CreateWebhookNotificationInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *CreateWebhookNotificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go deleted file mode 100644 index ac3646fd8a0..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// CreateWebhookNotificationURL generates an URL for the create webhook notification operation -type CreateWebhookNotificationURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWebhookNotificationURL) WithBasePath(bp string) *CreateWebhookNotificationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *CreateWebhookNotificationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *CreateWebhookNotificationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-notifications" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *CreateWebhookNotificationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *CreateWebhookNotificationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *CreateWebhookNotificationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on CreateWebhookNotificationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on CreateWebhookNotificationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *CreateWebhookNotificationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go deleted file mode 100644 index 900907c8d0d..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// ReceiveWebhookNotificationHandlerFunc turns a function with the right signature into a receive webhook notification handler -type ReceiveWebhookNotificationHandlerFunc func(ReceiveWebhookNotificationParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn ReceiveWebhookNotificationHandlerFunc) Handle(params ReceiveWebhookNotificationParams) middleware.Responder { - return fn(params) -} - -// ReceiveWebhookNotificationHandler interface for that can handle valid receive webhook notification params -type ReceiveWebhookNotificationHandler interface { - Handle(ReceiveWebhookNotificationParams) middleware.Responder -} - -// NewReceiveWebhookNotification creates a new http.Handler for the receive webhook notification operation -func NewReceiveWebhookNotification(ctx *middleware.Context, handler ReceiveWebhookNotificationHandler) *ReceiveWebhookNotification { - return &ReceiveWebhookNotification{Context: ctx, Handler: handler} -} - -/* - ReceiveWebhookNotification swagger:route POST /webhook-notify webhook receiveWebhookNotification - -# Test endpoint for receiving messages from our own webhook-client - -This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The `webhook-client` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection. -*/ -type ReceiveWebhookNotification struct { - Context *middleware.Context - Handler ReceiveWebhookNotificationHandler -} - -func (o *ReceiveWebhookNotification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewReceiveWebhookNotificationParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go deleted file mode 100644 index 633b176db6a..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "io" - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/validate" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewReceiveWebhookNotificationParams creates a new ReceiveWebhookNotificationParams object -// -// There are no default values defined in the spec. -func NewReceiveWebhookNotificationParams() ReceiveWebhookNotificationParams { - - return ReceiveWebhookNotificationParams{} -} - -// ReceiveWebhookNotificationParams contains all the bound params for the receive webhook notification operation -// typically these are obtained from a http.Request -// -// swagger:parameters receiveWebhookNotification -type ReceiveWebhookNotificationParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` - - /*The webhook notification being sent - Required: true - In: body - */ - Body *supportmessages.WebhookNotification -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewReceiveWebhookNotificationParams() beforehand. -func (o *ReceiveWebhookNotificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if runtime.HasBody(r) { - defer r.Body.Close() - var body supportmessages.WebhookNotification - if err := route.Consumer.Consume(r.Body, &body); err != nil { - if err == io.EOF { - res = append(res, errors.Required("body", "body", "")) - } else { - res = append(res, errors.NewParseError("body", "body", "", err)) - } - } else { - // validate body object - if err := body.Validate(route.Formats); err != nil { - res = append(res, err) - } - - ctx := validate.WithOperationRequest(r.Context()) - if err := body.ContextValidate(ctx, route.Formats); err != nil { - res = append(res, err) - } - - if len(res) == 0 { - o.Body = &body - } - } - } else { - res = append(res, errors.Required("body", "body", "")) - } - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go deleted file mode 100644 index 4bc18b5f51f..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go +++ /dev/null @@ -1,239 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ReceiveWebhookNotificationOKCode is the HTTP code returned for type ReceiveWebhookNotificationOK -const ReceiveWebhookNotificationOKCode int = 200 - -/* -ReceiveWebhookNotificationOK Received notification - -swagger:response receiveWebhookNotificationOK -*/ -type ReceiveWebhookNotificationOK struct { - - /* - In: Body - */ - Payload *supportmessages.WebhookNotification `json:"body,omitempty"` -} - -// NewReceiveWebhookNotificationOK creates ReceiveWebhookNotificationOK with default headers values -func NewReceiveWebhookNotificationOK() *ReceiveWebhookNotificationOK { - - return &ReceiveWebhookNotificationOK{} -} - -// WithPayload adds the payload to the receive webhook notification o k response -func (o *ReceiveWebhookNotificationOK) WithPayload(payload *supportmessages.WebhookNotification) *ReceiveWebhookNotificationOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the receive webhook notification o k response -func (o *ReceiveWebhookNotificationOK) SetPayload(payload *supportmessages.WebhookNotification) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReceiveWebhookNotificationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReceiveWebhookNotificationBadRequestCode is the HTTP code returned for type ReceiveWebhookNotificationBadRequest -const ReceiveWebhookNotificationBadRequestCode int = 400 - -/* -ReceiveWebhookNotificationBadRequest The request payload is invalid. - -swagger:response receiveWebhookNotificationBadRequest -*/ -type ReceiveWebhookNotificationBadRequest struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewReceiveWebhookNotificationBadRequest creates ReceiveWebhookNotificationBadRequest with default headers values -func NewReceiveWebhookNotificationBadRequest() *ReceiveWebhookNotificationBadRequest { - - return &ReceiveWebhookNotificationBadRequest{} -} - -// WithPayload adds the payload to the receive webhook notification bad request response -func (o *ReceiveWebhookNotificationBadRequest) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationBadRequest { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the receive webhook notification bad request response -func (o *ReceiveWebhookNotificationBadRequest) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReceiveWebhookNotificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(400) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReceiveWebhookNotificationUnauthorizedCode is the HTTP code returned for type ReceiveWebhookNotificationUnauthorized -const ReceiveWebhookNotificationUnauthorizedCode int = 401 - -/* -ReceiveWebhookNotificationUnauthorized The request was denied. - -swagger:response receiveWebhookNotificationUnauthorized -*/ -type ReceiveWebhookNotificationUnauthorized struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewReceiveWebhookNotificationUnauthorized creates ReceiveWebhookNotificationUnauthorized with default headers values -func NewReceiveWebhookNotificationUnauthorized() *ReceiveWebhookNotificationUnauthorized { - - return &ReceiveWebhookNotificationUnauthorized{} -} - -// WithPayload adds the payload to the receive webhook notification unauthorized response -func (o *ReceiveWebhookNotificationUnauthorized) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the receive webhook notification unauthorized response -func (o *ReceiveWebhookNotificationUnauthorized) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReceiveWebhookNotificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReceiveWebhookNotificationForbiddenCode is the HTTP code returned for type ReceiveWebhookNotificationForbidden -const ReceiveWebhookNotificationForbiddenCode int = 403 - -/* -ReceiveWebhookNotificationForbidden The request was denied. - -swagger:response receiveWebhookNotificationForbidden -*/ -type ReceiveWebhookNotificationForbidden struct { - - /* - In: Body - */ - Payload *supportmessages.ClientError `json:"body,omitempty"` -} - -// NewReceiveWebhookNotificationForbidden creates ReceiveWebhookNotificationForbidden with default headers values -func NewReceiveWebhookNotificationForbidden() *ReceiveWebhookNotificationForbidden { - - return &ReceiveWebhookNotificationForbidden{} -} - -// WithPayload adds the payload to the receive webhook notification forbidden response -func (o *ReceiveWebhookNotificationForbidden) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationForbidden { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the receive webhook notification forbidden response -func (o *ReceiveWebhookNotificationForbidden) SetPayload(payload *supportmessages.ClientError) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReceiveWebhookNotificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(403) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// ReceiveWebhookNotificationInternalServerErrorCode is the HTTP code returned for type ReceiveWebhookNotificationInternalServerError -const ReceiveWebhookNotificationInternalServerErrorCode int = 500 - -/* -ReceiveWebhookNotificationInternalServerError A server error occurred. - -swagger:response receiveWebhookNotificationInternalServerError -*/ -type ReceiveWebhookNotificationInternalServerError struct { - - /* - In: Body - */ - Payload *supportmessages.Error `json:"body,omitempty"` -} - -// NewReceiveWebhookNotificationInternalServerError creates ReceiveWebhookNotificationInternalServerError with default headers values -func NewReceiveWebhookNotificationInternalServerError() *ReceiveWebhookNotificationInternalServerError { - - return &ReceiveWebhookNotificationInternalServerError{} -} - -// WithPayload adds the payload to the receive webhook notification internal server error response -func (o *ReceiveWebhookNotificationInternalServerError) WithPayload(payload *supportmessages.Error) *ReceiveWebhookNotificationInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the receive webhook notification internal server error response -func (o *ReceiveWebhookNotificationInternalServerError) SetPayload(payload *supportmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *ReceiveWebhookNotificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go deleted file mode 100644 index 37421521ef9..00000000000 --- a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// ReceiveWebhookNotificationURL generates an URL for the receive webhook notification operation -type ReceiveWebhookNotificationURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReceiveWebhookNotificationURL) WithBasePath(bp string) *ReceiveWebhookNotificationURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *ReceiveWebhookNotificationURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *ReceiveWebhookNotificationURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/webhook-notify" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/support/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *ReceiveWebhookNotificationURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *ReceiveWebhookNotificationURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *ReceiveWebhookNotificationURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on ReceiveWebhookNotificationURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on ReceiveWebhookNotificationURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *ReceiveWebhookNotificationURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go b/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go deleted file mode 100644 index 7e35818353c..00000000000 --- a/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewCreateMoveTaskOrderParams creates a new CreateMoveTaskOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateMoveTaskOrderParams() *CreateMoveTaskOrderParams { - return &CreateMoveTaskOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateMoveTaskOrderParamsWithTimeout creates a new CreateMoveTaskOrderParams object -// with the ability to set a timeout on a request. -func NewCreateMoveTaskOrderParamsWithTimeout(timeout time.Duration) *CreateMoveTaskOrderParams { - return &CreateMoveTaskOrderParams{ - timeout: timeout, - } -} - -// NewCreateMoveTaskOrderParamsWithContext creates a new CreateMoveTaskOrderParams object -// with the ability to set a context for a request. -func NewCreateMoveTaskOrderParamsWithContext(ctx context.Context) *CreateMoveTaskOrderParams { - return &CreateMoveTaskOrderParams{ - Context: ctx, - } -} - -// NewCreateMoveTaskOrderParamsWithHTTPClient creates a new CreateMoveTaskOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateMoveTaskOrderParamsWithHTTPClient(client *http.Client) *CreateMoveTaskOrderParams { - return &CreateMoveTaskOrderParams{ - HTTPClient: client, - } -} - -/* -CreateMoveTaskOrderParams contains all the parameters to send to the API endpoint - - for the create move task order operation. - - Typically these are written to a http.Request. -*/ -type CreateMoveTaskOrderParams struct { - - // Body. - Body *supportmessages.MoveTaskOrder - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMoveTaskOrderParams) WithDefaults() *CreateMoveTaskOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateMoveTaskOrderParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create move task order params -func (o *CreateMoveTaskOrderParams) WithTimeout(timeout time.Duration) *CreateMoveTaskOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create move task order params -func (o *CreateMoveTaskOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create move task order params -func (o *CreateMoveTaskOrderParams) WithContext(ctx context.Context) *CreateMoveTaskOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create move task order params -func (o *CreateMoveTaskOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create move task order params -func (o *CreateMoveTaskOrderParams) WithHTTPClient(client *http.Client) *CreateMoveTaskOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create move task order params -func (o *CreateMoveTaskOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create move task order params -func (o *CreateMoveTaskOrderParams) WithBody(body *supportmessages.MoveTaskOrder) *CreateMoveTaskOrderParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create move task order params -func (o *CreateMoveTaskOrderParams) SetBody(body *supportmessages.MoveTaskOrder) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go b/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go deleted file mode 100644 index 3a902aaa15e..00000000000 --- a/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go +++ /dev/null @@ -1,547 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// CreateMoveTaskOrderReader is a Reader for the CreateMoveTaskOrder structure. -type CreateMoveTaskOrderReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateMoveTaskOrderCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewCreateMoveTaskOrderBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewCreateMoveTaskOrderUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewCreateMoveTaskOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewCreateMoveTaskOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewCreateMoveTaskOrderUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateMoveTaskOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /move-task-orders] createMoveTaskOrder", response, response.Code()) - } -} - -// NewCreateMoveTaskOrderCreated creates a CreateMoveTaskOrderCreated with default headers values -func NewCreateMoveTaskOrderCreated() *CreateMoveTaskOrderCreated { - return &CreateMoveTaskOrderCreated{} -} - -/* -CreateMoveTaskOrderCreated describes a response with status code 201, with default header values. - -Successfully created MoveTaskOrder object. -*/ -type CreateMoveTaskOrderCreated struct { - Payload *supportmessages.MoveTaskOrder -} - -// IsSuccess returns true when this create move task order created response has a 2xx status code -func (o *CreateMoveTaskOrderCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create move task order created response has a 3xx status code -func (o *CreateMoveTaskOrderCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order created response has a 4xx status code -func (o *CreateMoveTaskOrderCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create move task order created response has a 5xx status code -func (o *CreateMoveTaskOrderCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order created response a status code equal to that given -func (o *CreateMoveTaskOrderCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create move task order created response -func (o *CreateMoveTaskOrderCreated) Code() int { - return 201 -} - -func (o *CreateMoveTaskOrderCreated) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderCreated %+v", 201, o.Payload) -} - -func (o *CreateMoveTaskOrderCreated) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderCreated %+v", 201, o.Payload) -} - -func (o *CreateMoveTaskOrderCreated) GetPayload() *supportmessages.MoveTaskOrder { - return o.Payload -} - -func (o *CreateMoveTaskOrderCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderBadRequest creates a CreateMoveTaskOrderBadRequest with default headers values -func NewCreateMoveTaskOrderBadRequest() *CreateMoveTaskOrderBadRequest { - return &CreateMoveTaskOrderBadRequest{} -} - -/* -CreateMoveTaskOrderBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type CreateMoveTaskOrderBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this create move task order bad request response has a 2xx status code -func (o *CreateMoveTaskOrderBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order bad request response has a 3xx status code -func (o *CreateMoveTaskOrderBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order bad request response has a 4xx status code -func (o *CreateMoveTaskOrderBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this create move task order bad request response has a 5xx status code -func (o *CreateMoveTaskOrderBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order bad request response a status code equal to that given -func (o *CreateMoveTaskOrderBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the create move task order bad request response -func (o *CreateMoveTaskOrderBadRequest) Code() int { - return 400 -} - -func (o *CreateMoveTaskOrderBadRequest) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMoveTaskOrderBadRequest) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderBadRequest %+v", 400, o.Payload) -} - -func (o *CreateMoveTaskOrderBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *CreateMoveTaskOrderBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderUnauthorized creates a CreateMoveTaskOrderUnauthorized with default headers values -func NewCreateMoveTaskOrderUnauthorized() *CreateMoveTaskOrderUnauthorized { - return &CreateMoveTaskOrderUnauthorized{} -} - -/* -CreateMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type CreateMoveTaskOrderUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this create move task order unauthorized response has a 2xx status code -func (o *CreateMoveTaskOrderUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order unauthorized response has a 3xx status code -func (o *CreateMoveTaskOrderUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order unauthorized response has a 4xx status code -func (o *CreateMoveTaskOrderUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this create move task order unauthorized response has a 5xx status code -func (o *CreateMoveTaskOrderUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order unauthorized response a status code equal to that given -func (o *CreateMoveTaskOrderUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the create move task order unauthorized response -func (o *CreateMoveTaskOrderUnauthorized) Code() int { - return 401 -} - -func (o *CreateMoveTaskOrderUnauthorized) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMoveTaskOrderUnauthorized) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *CreateMoveTaskOrderUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *CreateMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderForbidden creates a CreateMoveTaskOrderForbidden with default headers values -func NewCreateMoveTaskOrderForbidden() *CreateMoveTaskOrderForbidden { - return &CreateMoveTaskOrderForbidden{} -} - -/* -CreateMoveTaskOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type CreateMoveTaskOrderForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this create move task order forbidden response has a 2xx status code -func (o *CreateMoveTaskOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order forbidden response has a 3xx status code -func (o *CreateMoveTaskOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order forbidden response has a 4xx status code -func (o *CreateMoveTaskOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this create move task order forbidden response has a 5xx status code -func (o *CreateMoveTaskOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order forbidden response a status code equal to that given -func (o *CreateMoveTaskOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the create move task order forbidden response -func (o *CreateMoveTaskOrderForbidden) Code() int { - return 403 -} - -func (o *CreateMoveTaskOrderForbidden) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *CreateMoveTaskOrderForbidden) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *CreateMoveTaskOrderForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *CreateMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderNotFound creates a CreateMoveTaskOrderNotFound with default headers values -func NewCreateMoveTaskOrderNotFound() *CreateMoveTaskOrderNotFound { - return &CreateMoveTaskOrderNotFound{} -} - -/* -CreateMoveTaskOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type CreateMoveTaskOrderNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this create move task order not found response has a 2xx status code -func (o *CreateMoveTaskOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order not found response has a 3xx status code -func (o *CreateMoveTaskOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order not found response has a 4xx status code -func (o *CreateMoveTaskOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this create move task order not found response has a 5xx status code -func (o *CreateMoveTaskOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order not found response a status code equal to that given -func (o *CreateMoveTaskOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the create move task order not found response -func (o *CreateMoveTaskOrderNotFound) Code() int { - return 404 -} - -func (o *CreateMoveTaskOrderNotFound) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *CreateMoveTaskOrderNotFound) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *CreateMoveTaskOrderNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *CreateMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderUnprocessableEntity creates a CreateMoveTaskOrderUnprocessableEntity with default headers values -func NewCreateMoveTaskOrderUnprocessableEntity() *CreateMoveTaskOrderUnprocessableEntity { - return &CreateMoveTaskOrderUnprocessableEntity{} -} - -/* -CreateMoveTaskOrderUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type CreateMoveTaskOrderUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this create move task order unprocessable entity response has a 2xx status code -func (o *CreateMoveTaskOrderUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order unprocessable entity response has a 3xx status code -func (o *CreateMoveTaskOrderUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order unprocessable entity response has a 4xx status code -func (o *CreateMoveTaskOrderUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create move task order unprocessable entity response has a 5xx status code -func (o *CreateMoveTaskOrderUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create move task order unprocessable entity response a status code equal to that given -func (o *CreateMoveTaskOrderUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create move task order unprocessable entity response -func (o *CreateMoveTaskOrderUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateMoveTaskOrderUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMoveTaskOrderUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateMoveTaskOrderUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *CreateMoveTaskOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateMoveTaskOrderInternalServerError creates a CreateMoveTaskOrderInternalServerError with default headers values -func NewCreateMoveTaskOrderInternalServerError() *CreateMoveTaskOrderInternalServerError { - return &CreateMoveTaskOrderInternalServerError{} -} - -/* -CreateMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateMoveTaskOrderInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this create move task order internal server error response has a 2xx status code -func (o *CreateMoveTaskOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create move task order internal server error response has a 3xx status code -func (o *CreateMoveTaskOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create move task order internal server error response has a 4xx status code -func (o *CreateMoveTaskOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create move task order internal server error response has a 5xx status code -func (o *CreateMoveTaskOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create move task order internal server error response a status code equal to that given -func (o *CreateMoveTaskOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create move task order internal server error response -func (o *CreateMoveTaskOrderInternalServerError) Code() int { - return 500 -} - -func (o *CreateMoveTaskOrderInternalServerError) Error() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMoveTaskOrderInternalServerError) String() string { - return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateMoveTaskOrderInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *CreateMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go b/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go deleted file mode 100644 index e7b0c9c9eed..00000000000 --- a/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go +++ /dev/null @@ -1,151 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object -// with the ability to set a timeout on a request. -func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - timeout: timeout, - } -} - -// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object -// with the ability to set a context for a request. -func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - Context: ctx, - } -} - -// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - return &GetMoveTaskOrderParams{ - HTTPClient: client, - } -} - -/* -GetMoveTaskOrderParams contains all the parameters to send to the API endpoint - - for the get move task order operation. - - Typically these are written to a http.Request. -*/ -type GetMoveTaskOrderParams struct { - - /* MoveTaskOrderID. - - UUID of move task order to use. - */ - MoveTaskOrderID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get move task order params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetMoveTaskOrderParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get move task order params -func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get move task order params -func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get move task order params -func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMoveTaskOrderID adds the moveTaskOrderID to the get move task order params -func (o *GetMoveTaskOrderParams) WithMoveTaskOrderID(moveTaskOrderID string) *GetMoveTaskOrderParams { - o.SetMoveTaskOrderID(moveTaskOrderID) - return o -} - -// SetMoveTaskOrderID adds the moveTaskOrderId to the get move task order params -func (o *GetMoveTaskOrderParams) SetMoveTaskOrderID(moveTaskOrderID string) { - o.MoveTaskOrderID = moveTaskOrderID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param moveTaskOrderID - if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go b/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go deleted file mode 100644 index 09f4fc6e91c..00000000000 --- a/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. -type GetMoveTaskOrderReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetMoveTaskOrderOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 401: - result := NewGetMoveTaskOrderUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetMoveTaskOrderForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetMoveTaskOrderNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetMoveTaskOrderInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders/{moveTaskOrderID}] getMoveTaskOrder", response, response.Code()) - } -} - -// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values -func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { - return &GetMoveTaskOrderOK{} -} - -/* -GetMoveTaskOrderOK describes a response with status code 200, with default header values. - -Successfully retrieve an individual move task order. -*/ -type GetMoveTaskOrderOK struct { - Payload *supportmessages.MoveTaskOrder -} - -// IsSuccess returns true when this get move task order o k response has a 2xx status code -func (o *GetMoveTaskOrderOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get move task order o k response has a 3xx status code -func (o *GetMoveTaskOrderOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order o k response has a 4xx status code -func (o *GetMoveTaskOrderOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order o k response has a 5xx status code -func (o *GetMoveTaskOrderOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order o k response a status code equal to that given -func (o *GetMoveTaskOrderOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get move task order o k response -func (o *GetMoveTaskOrderOK) Code() int { - return 200 -} - -func (o *GetMoveTaskOrderOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) -} - -func (o *GetMoveTaskOrderOK) GetPayload() *supportmessages.MoveTaskOrder { - return o.Payload -} - -func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values -func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { - return &GetMoveTaskOrderUnauthorized{} -} - -/* -GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code -func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code -func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order unauthorized response has a 4xx status code -func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order unauthorized response has a 5xx status code -func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order unauthorized response a status code equal to that given -func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get move task order unauthorized response -func (o *GetMoveTaskOrderUnauthorized) Code() int { - return 401 -} - -func (o *GetMoveTaskOrderUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) -} - -func (o *GetMoveTaskOrderUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values -func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { - return &GetMoveTaskOrderForbidden{} -} - -/* -GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type GetMoveTaskOrderForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get move task order forbidden response has a 2xx status code -func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order forbidden response has a 3xx status code -func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order forbidden response has a 4xx status code -func (o *GetMoveTaskOrderForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order forbidden response has a 5xx status code -func (o *GetMoveTaskOrderForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order forbidden response a status code equal to that given -func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get move task order forbidden response -func (o *GetMoveTaskOrderForbidden) Code() int { - return 403 -} - -func (o *GetMoveTaskOrderForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) -} - -func (o *GetMoveTaskOrderForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values -func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { - return &GetMoveTaskOrderNotFound{} -} - -/* -GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type GetMoveTaskOrderNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get move task order not found response has a 2xx status code -func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order not found response has a 3xx status code -func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order not found response has a 4xx status code -func (o *GetMoveTaskOrderNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get move task order not found response has a 5xx status code -func (o *GetMoveTaskOrderNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get move task order not found response a status code equal to that given -func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get move task order not found response -func (o *GetMoveTaskOrderNotFound) Code() int { - return 404 -} - -func (o *GetMoveTaskOrderNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) -} - -func (o *GetMoveTaskOrderNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values -func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { - return &GetMoveTaskOrderInternalServerError{} -} - -/* -GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type GetMoveTaskOrderInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this get move task order internal server error response has a 2xx status code -func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get move task order internal server error response has a 3xx status code -func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get move task order internal server error response has a 4xx status code -func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get move task order internal server error response has a 5xx status code -func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get move task order internal server error response a status code equal to that given -func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get move task order internal server error response -func (o *GetMoveTaskOrderInternalServerError) Code() int { - return 500 -} - -func (o *GetMoveTaskOrderInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) -} - -func (o *GetMoveTaskOrderInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go deleted file mode 100644 index a88f31ff1a6..00000000000 --- a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go +++ /dev/null @@ -1,128 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewHideNonFakeMoveTaskOrdersParams creates a new HideNonFakeMoveTaskOrdersParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewHideNonFakeMoveTaskOrdersParams() *HideNonFakeMoveTaskOrdersParams { - return &HideNonFakeMoveTaskOrdersParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewHideNonFakeMoveTaskOrdersParamsWithTimeout creates a new HideNonFakeMoveTaskOrdersParams object -// with the ability to set a timeout on a request. -func NewHideNonFakeMoveTaskOrdersParamsWithTimeout(timeout time.Duration) *HideNonFakeMoveTaskOrdersParams { - return &HideNonFakeMoveTaskOrdersParams{ - timeout: timeout, - } -} - -// NewHideNonFakeMoveTaskOrdersParamsWithContext creates a new HideNonFakeMoveTaskOrdersParams object -// with the ability to set a context for a request. -func NewHideNonFakeMoveTaskOrdersParamsWithContext(ctx context.Context) *HideNonFakeMoveTaskOrdersParams { - return &HideNonFakeMoveTaskOrdersParams{ - Context: ctx, - } -} - -// NewHideNonFakeMoveTaskOrdersParamsWithHTTPClient creates a new HideNonFakeMoveTaskOrdersParams object -// with the ability to set a custom HTTPClient for a request. -func NewHideNonFakeMoveTaskOrdersParamsWithHTTPClient(client *http.Client) *HideNonFakeMoveTaskOrdersParams { - return &HideNonFakeMoveTaskOrdersParams{ - HTTPClient: client, - } -} - -/* -HideNonFakeMoveTaskOrdersParams contains all the parameters to send to the API endpoint - - for the hide non fake move task orders operation. - - Typically these are written to a http.Request. -*/ -type HideNonFakeMoveTaskOrdersParams struct { - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the hide non fake move task orders params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *HideNonFakeMoveTaskOrdersParams) WithDefaults() *HideNonFakeMoveTaskOrdersParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the hide non fake move task orders params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *HideNonFakeMoveTaskOrdersParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) WithTimeout(timeout time.Duration) *HideNonFakeMoveTaskOrdersParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) WithContext(ctx context.Context) *HideNonFakeMoveTaskOrdersParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) WithHTTPClient(client *http.Client) *HideNonFakeMoveTaskOrdersParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the hide non fake move task orders params -func (o *HideNonFakeMoveTaskOrdersParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WriteToRequest writes these params to a swagger request -func (o *HideNonFakeMoveTaskOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go deleted file mode 100644 index 8b3cf4daada..00000000000 --- a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// HideNonFakeMoveTaskOrdersReader is a Reader for the HideNonFakeMoveTaskOrders structure. -type HideNonFakeMoveTaskOrdersReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *HideNonFakeMoveTaskOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewHideNonFakeMoveTaskOrdersOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewHideNonFakeMoveTaskOrdersBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewHideNonFakeMoveTaskOrdersUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewHideNonFakeMoveTaskOrdersForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewHideNonFakeMoveTaskOrdersNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewHideNonFakeMoveTaskOrdersConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewHideNonFakeMoveTaskOrdersPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewHideNonFakeMoveTaskOrdersUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewHideNonFakeMoveTaskOrdersInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /move-task-orders/hide] hideNonFakeMoveTaskOrders", response, response.Code()) - } -} - -// NewHideNonFakeMoveTaskOrdersOK creates a HideNonFakeMoveTaskOrdersOK with default headers values -func NewHideNonFakeMoveTaskOrdersOK() *HideNonFakeMoveTaskOrdersOK { - return &HideNonFakeMoveTaskOrdersOK{} -} - -/* -HideNonFakeMoveTaskOrdersOK describes a response with status code 200, with default header values. - -Successfully hid MTOs. -*/ -type HideNonFakeMoveTaskOrdersOK struct { - Payload *supportmessages.MTOHideMovesResponse -} - -// IsSuccess returns true when this hide non fake move task orders o k response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this hide non fake move task orders o k response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders o k response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this hide non fake move task orders o k response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersOK) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders o k response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the hide non fake move task orders o k response -func (o *HideNonFakeMoveTaskOrdersOK) Code() int { - return 200 -} - -func (o *HideNonFakeMoveTaskOrdersOK) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersOK %+v", 200, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersOK) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersOK %+v", 200, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersOK) GetPayload() *supportmessages.MTOHideMovesResponse { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.MTOHideMovesResponse) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersBadRequest creates a HideNonFakeMoveTaskOrdersBadRequest with default headers values -func NewHideNonFakeMoveTaskOrdersBadRequest() *HideNonFakeMoveTaskOrdersBadRequest { - return &HideNonFakeMoveTaskOrdersBadRequest{} -} - -/* -HideNonFakeMoveTaskOrdersBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type HideNonFakeMoveTaskOrdersBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders bad request response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders bad request response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders bad request response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders bad request response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders bad request response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the hide non fake move task orders bad request response -func (o *HideNonFakeMoveTaskOrdersBadRequest) Code() int { - return 400 -} - -func (o *HideNonFakeMoveTaskOrdersBadRequest) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersBadRequest %+v", 400, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersBadRequest) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersBadRequest %+v", 400, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersUnauthorized creates a HideNonFakeMoveTaskOrdersUnauthorized with default headers values -func NewHideNonFakeMoveTaskOrdersUnauthorized() *HideNonFakeMoveTaskOrdersUnauthorized { - return &HideNonFakeMoveTaskOrdersUnauthorized{} -} - -/* -HideNonFakeMoveTaskOrdersUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type HideNonFakeMoveTaskOrdersUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders unauthorized response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders unauthorized response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders unauthorized response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders unauthorized response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders unauthorized response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the hide non fake move task orders unauthorized response -func (o *HideNonFakeMoveTaskOrdersUnauthorized) Code() int { - return 401 -} - -func (o *HideNonFakeMoveTaskOrdersUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnauthorized %+v", 401, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersUnauthorized) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnauthorized %+v", 401, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersForbidden creates a HideNonFakeMoveTaskOrdersForbidden with default headers values -func NewHideNonFakeMoveTaskOrdersForbidden() *HideNonFakeMoveTaskOrdersForbidden { - return &HideNonFakeMoveTaskOrdersForbidden{} -} - -/* -HideNonFakeMoveTaskOrdersForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type HideNonFakeMoveTaskOrdersForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders forbidden response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders forbidden response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders forbidden response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders forbidden response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders forbidden response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the hide non fake move task orders forbidden response -func (o *HideNonFakeMoveTaskOrdersForbidden) Code() int { - return 403 -} - -func (o *HideNonFakeMoveTaskOrdersForbidden) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersForbidden %+v", 403, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersForbidden) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersForbidden %+v", 403, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersNotFound creates a HideNonFakeMoveTaskOrdersNotFound with default headers values -func NewHideNonFakeMoveTaskOrdersNotFound() *HideNonFakeMoveTaskOrdersNotFound { - return &HideNonFakeMoveTaskOrdersNotFound{} -} - -/* -HideNonFakeMoveTaskOrdersNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type HideNonFakeMoveTaskOrdersNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders not found response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders not found response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders not found response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders not found response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders not found response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the hide non fake move task orders not found response -func (o *HideNonFakeMoveTaskOrdersNotFound) Code() int { - return 404 -} - -func (o *HideNonFakeMoveTaskOrdersNotFound) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersNotFound %+v", 404, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersNotFound) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersNotFound %+v", 404, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersConflict creates a HideNonFakeMoveTaskOrdersConflict with default headers values -func NewHideNonFakeMoveTaskOrdersConflict() *HideNonFakeMoveTaskOrdersConflict { - return &HideNonFakeMoveTaskOrdersConflict{} -} - -/* -HideNonFakeMoveTaskOrdersConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type HideNonFakeMoveTaskOrdersConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders conflict response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders conflict response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders conflict response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders conflict response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders conflict response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the hide non fake move task orders conflict response -func (o *HideNonFakeMoveTaskOrdersConflict) Code() int { - return 409 -} - -func (o *HideNonFakeMoveTaskOrdersConflict) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersConflict %+v", 409, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersConflict) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersConflict %+v", 409, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersPreconditionFailed creates a HideNonFakeMoveTaskOrdersPreconditionFailed with default headers values -func NewHideNonFakeMoveTaskOrdersPreconditionFailed() *HideNonFakeMoveTaskOrdersPreconditionFailed { - return &HideNonFakeMoveTaskOrdersPreconditionFailed{} -} - -/* -HideNonFakeMoveTaskOrdersPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type HideNonFakeMoveTaskOrdersPreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this hide non fake move task orders precondition failed response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders precondition failed response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders precondition failed response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders precondition failed response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders precondition failed response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the hide non fake move task orders precondition failed response -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) Code() int { - return 412 -} - -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersPreconditionFailed %+v", 412, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersPreconditionFailed %+v", 412, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersUnprocessableEntity creates a HideNonFakeMoveTaskOrdersUnprocessableEntity with default headers values -func NewHideNonFakeMoveTaskOrdersUnprocessableEntity() *HideNonFakeMoveTaskOrdersUnprocessableEntity { - return &HideNonFakeMoveTaskOrdersUnprocessableEntity{} -} - -/* -HideNonFakeMoveTaskOrdersUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type HideNonFakeMoveTaskOrdersUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this hide non fake move task orders unprocessable entity response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders unprocessable entity response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders unprocessable entity response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this hide non fake move task orders unprocessable entity response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this hide non fake move task orders unprocessable entity response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the hide non fake move task orders unprocessable entity response -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) Code() int { - return 422 -} - -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewHideNonFakeMoveTaskOrdersInternalServerError creates a HideNonFakeMoveTaskOrdersInternalServerError with default headers values -func NewHideNonFakeMoveTaskOrdersInternalServerError() *HideNonFakeMoveTaskOrdersInternalServerError { - return &HideNonFakeMoveTaskOrdersInternalServerError{} -} - -/* -HideNonFakeMoveTaskOrdersInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type HideNonFakeMoveTaskOrdersInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this hide non fake move task orders internal server error response has a 2xx status code -func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this hide non fake move task orders internal server error response has a 3xx status code -func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this hide non fake move task orders internal server error response has a 4xx status code -func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this hide non fake move task orders internal server error response has a 5xx status code -func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this hide non fake move task orders internal server error response a status code equal to that given -func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the hide non fake move task orders internal server error response -func (o *HideNonFakeMoveTaskOrdersInternalServerError) Code() int { - return 500 -} - -func (o *HideNonFakeMoveTaskOrdersInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersInternalServerError %+v", 500, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersInternalServerError) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersInternalServerError %+v", 500, o.Payload) -} - -func (o *HideNonFakeMoveTaskOrdersInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *HideNonFakeMoveTaskOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go b/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go deleted file mode 100644 index 152e1d4d21f..00000000000 --- a/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go +++ /dev/null @@ -1,166 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// NewListMTOsParams creates a new ListMTOsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListMTOsParams() *ListMTOsParams { - return &ListMTOsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListMTOsParamsWithTimeout creates a new ListMTOsParams object -// with the ability to set a timeout on a request. -func NewListMTOsParamsWithTimeout(timeout time.Duration) *ListMTOsParams { - return &ListMTOsParams{ - timeout: timeout, - } -} - -// NewListMTOsParamsWithContext creates a new ListMTOsParams object -// with the ability to set a context for a request. -func NewListMTOsParamsWithContext(ctx context.Context) *ListMTOsParams { - return &ListMTOsParams{ - Context: ctx, - } -} - -// NewListMTOsParamsWithHTTPClient creates a new ListMTOsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListMTOsParamsWithHTTPClient(client *http.Client) *ListMTOsParams { - return &ListMTOsParams{ - HTTPClient: client, - } -} - -/* -ListMTOsParams contains all the parameters to send to the API endpoint - - for the list m t os operation. - - Typically these are written to a http.Request. -*/ -type ListMTOsParams struct { - - /* Since. - - Only return move task orders updated since this time. - - Format: timestamp - */ - Since *int64 - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list m t os params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMTOsParams) WithDefaults() *ListMTOsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list m t os params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMTOsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list m t os params -func (o *ListMTOsParams) WithTimeout(timeout time.Duration) *ListMTOsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list m t os params -func (o *ListMTOsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list m t os params -func (o *ListMTOsParams) WithContext(ctx context.Context) *ListMTOsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list m t os params -func (o *ListMTOsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list m t os params -func (o *ListMTOsParams) WithHTTPClient(client *http.Client) *ListMTOsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list m t os params -func (o *ListMTOsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithSince adds the since to the list m t os params -func (o *ListMTOsParams) WithSince(since *int64) *ListMTOsParams { - o.SetSince(since) - return o -} - -// SetSince adds the since to the list m t os params -func (o *ListMTOsParams) SetSince(since *int64) { - o.Since = since -} - -// WriteToRequest writes these params to a swagger request -func (o *ListMTOsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - if o.Since != nil { - - // query param since - var qrSince int64 - - if o.Since != nil { - qrSince = *o.Since - } - qSince := swag.FormatInt64(qrSince) - if qSince != "" { - - if err := r.SetQueryParam("since", qSince); err != nil { - return err - } - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go b/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go deleted file mode 100644 index 8f622a31f3d..00000000000 --- a/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ListMTOsReader is a Reader for the ListMTOs structure. -type ListMTOsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListMTOsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListMTOsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListMTOsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListMTOsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListMTOsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListMTOsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListMTOsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders] listMTOs", response, response.Code()) - } -} - -// NewListMTOsOK creates a ListMTOsOK with default headers values -func NewListMTOsOK() *ListMTOsOK { - return &ListMTOsOK{} -} - -/* -ListMTOsOK describes a response with status code 200, with default header values. - -Successfully retrieved all move task orders. -*/ -type ListMTOsOK struct { - Payload supportmessages.MoveTaskOrders -} - -// IsSuccess returns true when this list m t os o k response has a 2xx status code -func (o *ListMTOsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list m t os o k response has a 3xx status code -func (o *ListMTOsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os o k response has a 4xx status code -func (o *ListMTOsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list m t os o k response has a 5xx status code -func (o *ListMTOsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t os o k response a status code equal to that given -func (o *ListMTOsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list m t os o k response -func (o *ListMTOsOK) Code() int { - return 200 -} - -func (o *ListMTOsOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsOK %+v", 200, o.Payload) -} - -func (o *ListMTOsOK) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsOK %+v", 200, o.Payload) -} - -func (o *ListMTOsOK) GetPayload() supportmessages.MoveTaskOrders { - return o.Payload -} - -func (o *ListMTOsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOsBadRequest creates a ListMTOsBadRequest with default headers values -func NewListMTOsBadRequest() *ListMTOsBadRequest { - return &ListMTOsBadRequest{} -} - -/* -ListMTOsBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type ListMTOsBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t os bad request response has a 2xx status code -func (o *ListMTOsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t os bad request response has a 3xx status code -func (o *ListMTOsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os bad request response has a 4xx status code -func (o *ListMTOsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t os bad request response has a 5xx status code -func (o *ListMTOsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t os bad request response a status code equal to that given -func (o *ListMTOsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the list m t os bad request response -func (o *ListMTOsBadRequest) Code() int { - return 400 -} - -func (o *ListMTOsBadRequest) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsBadRequest %+v", 400, o.Payload) -} - -func (o *ListMTOsBadRequest) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsBadRequest %+v", 400, o.Payload) -} - -func (o *ListMTOsBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOsUnauthorized creates a ListMTOsUnauthorized with default headers values -func NewListMTOsUnauthorized() *ListMTOsUnauthorized { - return &ListMTOsUnauthorized{} -} - -/* -ListMTOsUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type ListMTOsUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t os unauthorized response has a 2xx status code -func (o *ListMTOsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t os unauthorized response has a 3xx status code -func (o *ListMTOsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os unauthorized response has a 4xx status code -func (o *ListMTOsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t os unauthorized response has a 5xx status code -func (o *ListMTOsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t os unauthorized response a status code equal to that given -func (o *ListMTOsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list m t os unauthorized response -func (o *ListMTOsUnauthorized) Code() int { - return 401 -} - -func (o *ListMTOsUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMTOsUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMTOsUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOsForbidden creates a ListMTOsForbidden with default headers values -func NewListMTOsForbidden() *ListMTOsForbidden { - return &ListMTOsForbidden{} -} - -/* -ListMTOsForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type ListMTOsForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t os forbidden response has a 2xx status code -func (o *ListMTOsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t os forbidden response has a 3xx status code -func (o *ListMTOsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os forbidden response has a 4xx status code -func (o *ListMTOsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t os forbidden response has a 5xx status code -func (o *ListMTOsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t os forbidden response a status code equal to that given -func (o *ListMTOsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list m t os forbidden response -func (o *ListMTOsForbidden) Code() int { - return 403 -} - -func (o *ListMTOsForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsForbidden %+v", 403, o.Payload) -} - -func (o *ListMTOsForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsForbidden %+v", 403, o.Payload) -} - -func (o *ListMTOsForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOsNotFound creates a ListMTOsNotFound with default headers values -func NewListMTOsNotFound() *ListMTOsNotFound { - return &ListMTOsNotFound{} -} - -/* -ListMTOsNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type ListMTOsNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t os not found response has a 2xx status code -func (o *ListMTOsNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t os not found response has a 3xx status code -func (o *ListMTOsNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os not found response has a 4xx status code -func (o *ListMTOsNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t os not found response has a 5xx status code -func (o *ListMTOsNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t os not found response a status code equal to that given -func (o *ListMTOsNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the list m t os not found response -func (o *ListMTOsNotFound) Code() int { - return 404 -} - -func (o *ListMTOsNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsNotFound %+v", 404, o.Payload) -} - -func (o *ListMTOsNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsNotFound %+v", 404, o.Payload) -} - -func (o *ListMTOsNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOsInternalServerError creates a ListMTOsInternalServerError with default headers values -func NewListMTOsInternalServerError() *ListMTOsInternalServerError { - return &ListMTOsInternalServerError{} -} - -/* -ListMTOsInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type ListMTOsInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this list m t os internal server error response has a 2xx status code -func (o *ListMTOsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t os internal server error response has a 3xx status code -func (o *ListMTOsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t os internal server error response has a 4xx status code -func (o *ListMTOsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list m t os internal server error response has a 5xx status code -func (o *ListMTOsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list m t os internal server error response a status code equal to that given -func (o *ListMTOsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list m t os internal server error response -func (o *ListMTOsInternalServerError) Code() int { - return 500 -} - -func (o *ListMTOsInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMTOsInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMTOsInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *ListMTOsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go deleted file mode 100644 index 765ce898477..00000000000 --- a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewMakeMoveTaskOrderAvailableParams creates a new MakeMoveTaskOrderAvailableParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewMakeMoveTaskOrderAvailableParams() *MakeMoveTaskOrderAvailableParams { - return &MakeMoveTaskOrderAvailableParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewMakeMoveTaskOrderAvailableParamsWithTimeout creates a new MakeMoveTaskOrderAvailableParams object -// with the ability to set a timeout on a request. -func NewMakeMoveTaskOrderAvailableParamsWithTimeout(timeout time.Duration) *MakeMoveTaskOrderAvailableParams { - return &MakeMoveTaskOrderAvailableParams{ - timeout: timeout, - } -} - -// NewMakeMoveTaskOrderAvailableParamsWithContext creates a new MakeMoveTaskOrderAvailableParams object -// with the ability to set a context for a request. -func NewMakeMoveTaskOrderAvailableParamsWithContext(ctx context.Context) *MakeMoveTaskOrderAvailableParams { - return &MakeMoveTaskOrderAvailableParams{ - Context: ctx, - } -} - -// NewMakeMoveTaskOrderAvailableParamsWithHTTPClient creates a new MakeMoveTaskOrderAvailableParams object -// with the ability to set a custom HTTPClient for a request. -func NewMakeMoveTaskOrderAvailableParamsWithHTTPClient(client *http.Client) *MakeMoveTaskOrderAvailableParams { - return &MakeMoveTaskOrderAvailableParams{ - HTTPClient: client, - } -} - -/* -MakeMoveTaskOrderAvailableParams contains all the parameters to send to the API endpoint - - for the make move task order available operation. - - Typically these are written to a http.Request. -*/ -type MakeMoveTaskOrderAvailableParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - /* MoveTaskOrderID. - - UUID of move task order. - */ - MoveTaskOrderID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the make move task order available params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *MakeMoveTaskOrderAvailableParams) WithDefaults() *MakeMoveTaskOrderAvailableParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the make move task order available params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *MakeMoveTaskOrderAvailableParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) WithTimeout(timeout time.Duration) *MakeMoveTaskOrderAvailableParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) WithContext(ctx context.Context) *MakeMoveTaskOrderAvailableParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) WithHTTPClient(client *http.Client) *MakeMoveTaskOrderAvailableParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) WithIfMatch(ifMatch string) *MakeMoveTaskOrderAvailableParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithMoveTaskOrderID adds the moveTaskOrderID to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) WithMoveTaskOrderID(moveTaskOrderID string) *MakeMoveTaskOrderAvailableParams { - o.SetMoveTaskOrderID(moveTaskOrderID) - return o -} - -// SetMoveTaskOrderID adds the moveTaskOrderId to the make move task order available params -func (o *MakeMoveTaskOrderAvailableParams) SetMoveTaskOrderID(moveTaskOrderID string) { - o.MoveTaskOrderID = moveTaskOrderID -} - -// WriteToRequest writes these params to a swagger request -func (o *MakeMoveTaskOrderAvailableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - - // path param moveTaskOrderID - if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go deleted file mode 100644 index 8e488681cef..00000000000 --- a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// MakeMoveTaskOrderAvailableReader is a Reader for the MakeMoveTaskOrderAvailable structure. -type MakeMoveTaskOrderAvailableReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *MakeMoveTaskOrderAvailableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewMakeMoveTaskOrderAvailableOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewMakeMoveTaskOrderAvailableBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewMakeMoveTaskOrderAvailableUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewMakeMoveTaskOrderAvailableForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewMakeMoveTaskOrderAvailableNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewMakeMoveTaskOrderAvailablePreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewMakeMoveTaskOrderAvailableUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewMakeMoveTaskOrderAvailableInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime] makeMoveTaskOrderAvailable", response, response.Code()) - } -} - -// NewMakeMoveTaskOrderAvailableOK creates a MakeMoveTaskOrderAvailableOK with default headers values -func NewMakeMoveTaskOrderAvailableOK() *MakeMoveTaskOrderAvailableOK { - return &MakeMoveTaskOrderAvailableOK{} -} - -/* -MakeMoveTaskOrderAvailableOK describes a response with status code 200, with default header values. - -Successfully made MTO available to Prime. -*/ -type MakeMoveTaskOrderAvailableOK struct { - Payload *supportmessages.MoveTaskOrder -} - -// IsSuccess returns true when this make move task order available o k response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this make move task order available o k response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available o k response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this make move task order available o k response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableOK) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available o k response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the make move task order available o k response -func (o *MakeMoveTaskOrderAvailableOK) Code() int { - return 200 -} - -func (o *MakeMoveTaskOrderAvailableOK) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableOK %+v", 200, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableOK) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableOK %+v", 200, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableOK) GetPayload() *supportmessages.MoveTaskOrder { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.MoveTaskOrder) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableBadRequest creates a MakeMoveTaskOrderAvailableBadRequest with default headers values -func NewMakeMoveTaskOrderAvailableBadRequest() *MakeMoveTaskOrderAvailableBadRequest { - return &MakeMoveTaskOrderAvailableBadRequest{} -} - -/* -MakeMoveTaskOrderAvailableBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type MakeMoveTaskOrderAvailableBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this make move task order available bad request response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available bad request response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available bad request response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available bad request response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available bad request response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the make move task order available bad request response -func (o *MakeMoveTaskOrderAvailableBadRequest) Code() int { - return 400 -} - -func (o *MakeMoveTaskOrderAvailableBadRequest) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableBadRequest %+v", 400, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableBadRequest) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableBadRequest %+v", 400, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableUnauthorized creates a MakeMoveTaskOrderAvailableUnauthorized with default headers values -func NewMakeMoveTaskOrderAvailableUnauthorized() *MakeMoveTaskOrderAvailableUnauthorized { - return &MakeMoveTaskOrderAvailableUnauthorized{} -} - -/* -MakeMoveTaskOrderAvailableUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type MakeMoveTaskOrderAvailableUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this make move task order available unauthorized response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available unauthorized response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available unauthorized response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available unauthorized response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available unauthorized response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the make move task order available unauthorized response -func (o *MakeMoveTaskOrderAvailableUnauthorized) Code() int { - return 401 -} - -func (o *MakeMoveTaskOrderAvailableUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnauthorized %+v", 401, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableUnauthorized) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnauthorized %+v", 401, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableForbidden creates a MakeMoveTaskOrderAvailableForbidden with default headers values -func NewMakeMoveTaskOrderAvailableForbidden() *MakeMoveTaskOrderAvailableForbidden { - return &MakeMoveTaskOrderAvailableForbidden{} -} - -/* -MakeMoveTaskOrderAvailableForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type MakeMoveTaskOrderAvailableForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this make move task order available forbidden response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available forbidden response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available forbidden response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available forbidden response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available forbidden response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the make move task order available forbidden response -func (o *MakeMoveTaskOrderAvailableForbidden) Code() int { - return 403 -} - -func (o *MakeMoveTaskOrderAvailableForbidden) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableForbidden %+v", 403, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableForbidden) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableForbidden %+v", 403, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableNotFound creates a MakeMoveTaskOrderAvailableNotFound with default headers values -func NewMakeMoveTaskOrderAvailableNotFound() *MakeMoveTaskOrderAvailableNotFound { - return &MakeMoveTaskOrderAvailableNotFound{} -} - -/* -MakeMoveTaskOrderAvailableNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type MakeMoveTaskOrderAvailableNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this make move task order available not found response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available not found response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available not found response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available not found response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available not found response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the make move task order available not found response -func (o *MakeMoveTaskOrderAvailableNotFound) Code() int { - return 404 -} - -func (o *MakeMoveTaskOrderAvailableNotFound) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableNotFound %+v", 404, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableNotFound) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableNotFound %+v", 404, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailablePreconditionFailed creates a MakeMoveTaskOrderAvailablePreconditionFailed with default headers values -func NewMakeMoveTaskOrderAvailablePreconditionFailed() *MakeMoveTaskOrderAvailablePreconditionFailed { - return &MakeMoveTaskOrderAvailablePreconditionFailed{} -} - -/* -MakeMoveTaskOrderAvailablePreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type MakeMoveTaskOrderAvailablePreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this make move task order available precondition failed response has a 2xx status code -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available precondition failed response has a 3xx status code -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available precondition failed response has a 4xx status code -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available precondition failed response has a 5xx status code -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available precondition failed response a status code equal to that given -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the make move task order available precondition failed response -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) Code() int { - return 412 -} - -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailablePreconditionFailed %+v", 412, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailablePreconditionFailed %+v", 412, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailablePreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableUnprocessableEntity creates a MakeMoveTaskOrderAvailableUnprocessableEntity with default headers values -func NewMakeMoveTaskOrderAvailableUnprocessableEntity() *MakeMoveTaskOrderAvailableUnprocessableEntity { - return &MakeMoveTaskOrderAvailableUnprocessableEntity{} -} - -/* -MakeMoveTaskOrderAvailableUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type MakeMoveTaskOrderAvailableUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this make move task order available unprocessable entity response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available unprocessable entity response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available unprocessable entity response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this make move task order available unprocessable entity response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this make move task order available unprocessable entity response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the make move task order available unprocessable entity response -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) Code() int { - return 422 -} - -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewMakeMoveTaskOrderAvailableInternalServerError creates a MakeMoveTaskOrderAvailableInternalServerError with default headers values -func NewMakeMoveTaskOrderAvailableInternalServerError() *MakeMoveTaskOrderAvailableInternalServerError { - return &MakeMoveTaskOrderAvailableInternalServerError{} -} - -/* -MakeMoveTaskOrderAvailableInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type MakeMoveTaskOrderAvailableInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this make move task order available internal server error response has a 2xx status code -func (o *MakeMoveTaskOrderAvailableInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this make move task order available internal server error response has a 3xx status code -func (o *MakeMoveTaskOrderAvailableInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this make move task order available internal server error response has a 4xx status code -func (o *MakeMoveTaskOrderAvailableInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this make move task order available internal server error response has a 5xx status code -func (o *MakeMoveTaskOrderAvailableInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this make move task order available internal server error response a status code equal to that given -func (o *MakeMoveTaskOrderAvailableInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the make move task order available internal server error response -func (o *MakeMoveTaskOrderAvailableInternalServerError) Code() int { - return 500 -} - -func (o *MakeMoveTaskOrderAvailableInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableInternalServerError %+v", 500, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableInternalServerError) String() string { - return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableInternalServerError %+v", 500, o.Payload) -} - -func (o *MakeMoveTaskOrderAvailableInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *MakeMoveTaskOrderAvailableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/move_task_order/move_task_order_client.go b/pkg/gen/supportclient/move_task_order/move_task_order_client.go deleted file mode 100644 index fb46a6a86ba..00000000000 --- a/pkg/gen/supportclient/move_task_order/move_task_order_client.go +++ /dev/null @@ -1,278 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package move_task_order - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new move task order API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for move task order API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateMoveTaskOrder(params *CreateMoveTaskOrderParams, opts ...ClientOption) (*CreateMoveTaskOrderCreated, error) - - GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) - - HideNonFakeMoveTaskOrders(params *HideNonFakeMoveTaskOrdersParams, opts ...ClientOption) (*HideNonFakeMoveTaskOrdersOK, error) - - ListMTOs(params *ListMTOsParams, opts ...ClientOption) (*ListMTOsOK, error) - - MakeMoveTaskOrderAvailable(params *MakeMoveTaskOrderAvailableParams, opts ...ClientOption) (*MakeMoveTaskOrderAvailableOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - CreateMoveTaskOrder creates move task order - - Creates an instance of moveTaskOrder. - -Currently this will also create a number of nested objects but not all. -It will currently create -* MoveTaskOrder -* Order -* Customer -* User -* Entitlement - -It will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID, -origin duty station ID, and an uploaded orders ID to be passed into the request. - -This is a support endpoint and will not be available in production. -*/ -func (a *Client) CreateMoveTaskOrder(params *CreateMoveTaskOrderParams, opts ...ClientOption) (*CreateMoveTaskOrderCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateMoveTaskOrderParams() - } - op := &runtime.ClientOperation{ - ID: "createMoveTaskOrder", - Method: "POST", - PathPattern: "/move-task-orders", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateMoveTaskOrderReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateMoveTaskOrderCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - GetMoveTaskOrder gets move task order - - ### Functionality - -This endpoint gets an individual MoveTaskOrder by ID. - -It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. - -This is a support endpoint and is not available in production. -*/ -func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetMoveTaskOrderParams() - } - op := &runtime.ClientOperation{ - ID: "getMoveTaskOrder", - Method: "GET", - PathPattern: "/move-task-orders/{moveTaskOrderID}", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetMoveTaskOrderReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetMoveTaskOrderOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - HideNonFakeMoveTaskOrders hides non fake move task orders - - Updates move task order without fake user data `show` to false. No request body required.
- -
-This is a support endpoint and will not be available in production. -*/ -func (a *Client) HideNonFakeMoveTaskOrders(params *HideNonFakeMoveTaskOrdersParams, opts ...ClientOption) (*HideNonFakeMoveTaskOrdersOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewHideNonFakeMoveTaskOrdersParams() - } - op := &runtime.ClientOperation{ - ID: "hideNonFakeMoveTaskOrders", - Method: "PATCH", - PathPattern: "/move-task-orders/hide", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &HideNonFakeMoveTaskOrdersReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*HideNonFakeMoveTaskOrdersOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for hideNonFakeMoveTaskOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListMTOs lists m t os - - ### Functionality - -This endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime. - -It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. -*/ -func (a *Client) ListMTOs(params *ListMTOsParams, opts ...ClientOption) (*ListMTOsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListMTOsParams() - } - op := &runtime.ClientOperation{ - ID: "listMTOs", - Method: "GET", - PathPattern: "/move-task-orders", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListMTOsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListMTOsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listMTOs: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - MakeMoveTaskOrderAvailable makes move task order available - - Updates move task order `availableToPrimeAt` to make it available to prime. No request body required.
- -
-This is a support endpoint and will not be available in production. -*/ -func (a *Client) MakeMoveTaskOrderAvailable(params *MakeMoveTaskOrderAvailableParams, opts ...ClientOption) (*MakeMoveTaskOrderAvailableOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewMakeMoveTaskOrderAvailableParams() - } - op := &runtime.ClientOperation{ - ID: "makeMoveTaskOrderAvailable", - Method: "PATCH", - PathPattern: "/move-task-orders/{moveTaskOrderID}/available-to-prime", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &MakeMoveTaskOrderAvailableReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*MakeMoveTaskOrderAvailableOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for makeMoveTaskOrderAvailable: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go b/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go deleted file mode 100644 index 43ba2309d44..00000000000 --- a/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go +++ /dev/null @@ -1,84 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto service item API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto service item API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - UpdateMTOServiceItemStatus(params *UpdateMTOServiceItemStatusParams, opts ...ClientOption) (*UpdateMTOServiceItemStatusOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - UpdateMTOServiceItemStatus updates m t o service item status - - Updates the status of a service item for a move to APPROVED or REJECTED.
- -
-This is a support endpoint and will not be available in production. -*/ -func (a *Client) UpdateMTOServiceItemStatus(params *UpdateMTOServiceItemStatusParams, opts ...ClientOption) (*UpdateMTOServiceItemStatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOServiceItemStatusParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOServiceItemStatus", - Method: "PATCH", - PathPattern: "/mto-service-items/{mtoServiceItemID}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOServiceItemStatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOServiceItemStatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOServiceItemStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go deleted file mode 100644 index b8fd5908aaf..00000000000 --- a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOServiceItemStatusParams() *UpdateMTOServiceItemStatusParams { - return &UpdateMTOServiceItemStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOServiceItemStatusParamsWithTimeout creates a new UpdateMTOServiceItemStatusParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOServiceItemStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOServiceItemStatusParams { - return &UpdateMTOServiceItemStatusParams{ - timeout: timeout, - } -} - -// NewUpdateMTOServiceItemStatusParamsWithContext creates a new UpdateMTOServiceItemStatusParams object -// with the ability to set a context for a request. -func NewUpdateMTOServiceItemStatusParamsWithContext(ctx context.Context) *UpdateMTOServiceItemStatusParams { - return &UpdateMTOServiceItemStatusParams{ - Context: ctx, - } -} - -// NewUpdateMTOServiceItemStatusParamsWithHTTPClient creates a new UpdateMTOServiceItemStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOServiceItemStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOServiceItemStatusParams { - return &UpdateMTOServiceItemStatusParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOServiceItemStatusParams contains all the parameters to send to the API endpoint - - for the update m t o service item status operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOServiceItemStatusParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *supportmessages.UpdateMTOServiceItemStatus - - /* MtoServiceItemID. - - UUID of mto service item to use. - */ - MtoServiceItemID string - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o service item status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOServiceItemStatusParams) WithDefaults() *UpdateMTOServiceItemStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o service item status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOServiceItemStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOServiceItemStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithContext(ctx context.Context) *UpdateMTOServiceItemStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOServiceItemStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithIfMatch(ifMatch string) *UpdateMTOServiceItemStatusParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithBody(body *supportmessages.UpdateMTOServiceItemStatus) *UpdateMTOServiceItemStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetBody(body *supportmessages.UpdateMTOServiceItemStatus) { - o.Body = body -} - -// WithMtoServiceItemID adds the mtoServiceItemID to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) WithMtoServiceItemID(mtoServiceItemID string) *UpdateMTOServiceItemStatusParams { - o.SetMtoServiceItemID(mtoServiceItemID) - return o -} - -// SetMtoServiceItemID adds the mtoServiceItemId to the update m t o service item status params -func (o *UpdateMTOServiceItemStatusParams) SetMtoServiceItemID(mtoServiceItemID string) { - o.MtoServiceItemID = mtoServiceItemID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOServiceItemStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoServiceItemID - if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go deleted file mode 100644 index cd3f6ec6339..00000000000 --- a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_service_item - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdateMTOServiceItemStatusReader is a Reader for the UpdateMTOServiceItemStatus structure. -type UpdateMTOServiceItemStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOServiceItemStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOServiceItemStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOServiceItemStatusBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOServiceItemStatusUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOServiceItemStatusForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOServiceItemStatusNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOServiceItemStatusConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOServiceItemStatusPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOServiceItemStatusUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOServiceItemStatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-service-items/{mtoServiceItemID}/status] updateMTOServiceItemStatus", response, response.Code()) - } -} - -// NewUpdateMTOServiceItemStatusOK creates a UpdateMTOServiceItemStatusOK with default headers values -func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { - return &UpdateMTOServiceItemStatusOK{} -} - -/* -UpdateMTOServiceItemStatusOK describes a response with status code 200, with default header values. - -Successfully updated service item status for a move task order. -*/ -type UpdateMTOServiceItemStatusOK struct { - Payload supportmessages.MTOServiceItem -} - -// IsSuccess returns true when this update m t o service item status o k response has a 2xx status code -func (o *UpdateMTOServiceItemStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o service item status o k response has a 3xx status code -func (o *UpdateMTOServiceItemStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status o k response has a 4xx status code -func (o *UpdateMTOServiceItemStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o service item status o k response has a 5xx status code -func (o *UpdateMTOServiceItemStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status o k response a status code equal to that given -func (o *UpdateMTOServiceItemStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o service item status o k response -func (o *UpdateMTOServiceItemStatusOK) Code() int { - return 200 -} - -func (o *UpdateMTOServiceItemStatusOK) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusOK) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusOK) GetPayload() supportmessages.MTOServiceItem { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload as interface type - payload, err := supportmessages.UnmarshalMTOServiceItem(response.Body(), consumer) - if err != nil { - return err - } - o.Payload = payload - - return nil -} - -// NewUpdateMTOServiceItemStatusBadRequest creates a UpdateMTOServiceItemStatusBadRequest with default headers values -func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { - return &UpdateMTOServiceItemStatusBadRequest{} -} - -/* -UpdateMTOServiceItemStatusBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOServiceItemStatusBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status bad request response has a 2xx status code -func (o *UpdateMTOServiceItemStatusBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status bad request response has a 3xx status code -func (o *UpdateMTOServiceItemStatusBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status bad request response has a 4xx status code -func (o *UpdateMTOServiceItemStatusBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status bad request response has a 5xx status code -func (o *UpdateMTOServiceItemStatusBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status bad request response a status code equal to that given -func (o *UpdateMTOServiceItemStatusBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o service item status bad request response -func (o *UpdateMTOServiceItemStatusBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOServiceItemStatusBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusUnauthorized creates a UpdateMTOServiceItemStatusUnauthorized with default headers values -func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { - return &UpdateMTOServiceItemStatusUnauthorized{} -} - -/* -UpdateMTOServiceItemStatusUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOServiceItemStatusUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status unauthorized response has a 2xx status code -func (o *UpdateMTOServiceItemStatusUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status unauthorized response has a 3xx status code -func (o *UpdateMTOServiceItemStatusUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status unauthorized response has a 4xx status code -func (o *UpdateMTOServiceItemStatusUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status unauthorized response has a 5xx status code -func (o *UpdateMTOServiceItemStatusUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status unauthorized response a status code equal to that given -func (o *UpdateMTOServiceItemStatusUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o service item status unauthorized response -func (o *UpdateMTOServiceItemStatusUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOServiceItemStatusUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusForbidden creates a UpdateMTOServiceItemStatusForbidden with default headers values -func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { - return &UpdateMTOServiceItemStatusForbidden{} -} - -/* -UpdateMTOServiceItemStatusForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOServiceItemStatusForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status forbidden response has a 2xx status code -func (o *UpdateMTOServiceItemStatusForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status forbidden response has a 3xx status code -func (o *UpdateMTOServiceItemStatusForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status forbidden response has a 4xx status code -func (o *UpdateMTOServiceItemStatusForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status forbidden response has a 5xx status code -func (o *UpdateMTOServiceItemStatusForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status forbidden response a status code equal to that given -func (o *UpdateMTOServiceItemStatusForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o service item status forbidden response -func (o *UpdateMTOServiceItemStatusForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOServiceItemStatusForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusNotFound creates a UpdateMTOServiceItemStatusNotFound with default headers values -func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { - return &UpdateMTOServiceItemStatusNotFound{} -} - -/* -UpdateMTOServiceItemStatusNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOServiceItemStatusNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status not found response has a 2xx status code -func (o *UpdateMTOServiceItemStatusNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status not found response has a 3xx status code -func (o *UpdateMTOServiceItemStatusNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status not found response has a 4xx status code -func (o *UpdateMTOServiceItemStatusNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status not found response has a 5xx status code -func (o *UpdateMTOServiceItemStatusNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status not found response a status code equal to that given -func (o *UpdateMTOServiceItemStatusNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o service item status not found response -func (o *UpdateMTOServiceItemStatusNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOServiceItemStatusNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusConflict creates a UpdateMTOServiceItemStatusConflict with default headers values -func NewUpdateMTOServiceItemStatusConflict() *UpdateMTOServiceItemStatusConflict { - return &UpdateMTOServiceItemStatusConflict{} -} - -/* -UpdateMTOServiceItemStatusConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type UpdateMTOServiceItemStatusConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status conflict response has a 2xx status code -func (o *UpdateMTOServiceItemStatusConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status conflict response has a 3xx status code -func (o *UpdateMTOServiceItemStatusConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status conflict response has a 4xx status code -func (o *UpdateMTOServiceItemStatusConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status conflict response has a 5xx status code -func (o *UpdateMTOServiceItemStatusConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status conflict response a status code equal to that given -func (o *UpdateMTOServiceItemStatusConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o service item status conflict response -func (o *UpdateMTOServiceItemStatusConflict) Code() int { - return 409 -} - -func (o *UpdateMTOServiceItemStatusConflict) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusConflict) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusPreconditionFailed creates a UpdateMTOServiceItemStatusPreconditionFailed with default headers values -func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { - return &UpdateMTOServiceItemStatusPreconditionFailed{} -} - -/* -UpdateMTOServiceItemStatusPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOServiceItemStatusPreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o service item status precondition failed response has a 2xx status code -func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status precondition failed response has a 3xx status code -func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status precondition failed response has a 4xx status code -func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status precondition failed response has a 5xx status code -func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status precondition failed response a status code equal to that given -func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o service item status precondition failed response -func (o *UpdateMTOServiceItemStatusPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOServiceItemStatusPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusUnprocessableEntity creates a UpdateMTOServiceItemStatusUnprocessableEntity with default headers values -func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { - return &UpdateMTOServiceItemStatusUnprocessableEntity{} -} - -/* -UpdateMTOServiceItemStatusUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type UpdateMTOServiceItemStatusUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this update m t o service item status unprocessable entity response has a 2xx status code -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status unprocessable entity response has a 3xx status code -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status unprocessable entity response has a 4xx status code -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o service item status unprocessable entity response has a 5xx status code -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o service item status unprocessable entity response a status code equal to that given -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o service item status unprocessable entity response -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOServiceItemStatusInternalServerError creates a UpdateMTOServiceItemStatusInternalServerError with default headers values -func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { - return &UpdateMTOServiceItemStatusInternalServerError{} -} - -/* -UpdateMTOServiceItemStatusInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOServiceItemStatusInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this update m t o service item status internal server error response has a 2xx status code -func (o *UpdateMTOServiceItemStatusInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o service item status internal server error response has a 3xx status code -func (o *UpdateMTOServiceItemStatusInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o service item status internal server error response has a 4xx status code -func (o *UpdateMTOServiceItemStatusInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o service item status internal server error response has a 5xx status code -func (o *UpdateMTOServiceItemStatusInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o service item status internal server error response a status code equal to that given -func (o *UpdateMTOServiceItemStatusInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o service item status internal server error response -func (o *UpdateMTOServiceItemStatusInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOServiceItemStatusInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOServiceItemStatusInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *UpdateMTOServiceItemStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go b/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go deleted file mode 100644 index b61940f4c96..00000000000 --- a/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go +++ /dev/null @@ -1,81 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new mto shipment API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for mto shipment API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -UpdateMTOShipmentStatus updates m t o shipment status - -Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, `rejectionReason` should be blank and any value passed through the body will be ignored. If REJECTED, a value in `rejectionReason` is required.

This is a support endpoint and will not be available in production. -*/ -func (a *Client) UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdateMTOShipmentStatusParams() - } - op := &runtime.ClientOperation{ - ID: "updateMTOShipmentStatus", - Method: "PATCH", - PathPattern: "/mto-shipments/{mtoShipmentID}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdateMTOShipmentStatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdateMTOShipmentStatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updateMTOShipmentStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go deleted file mode 100644 index 5b7ddf4db0c..00000000000 --- a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdateMTOShipmentStatusParams() *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdateMTOShipmentStatusParamsWithTimeout creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a timeout on a request. -func NewUpdateMTOShipmentStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - timeout: timeout, - } -} - -// NewUpdateMTOShipmentStatusParamsWithContext creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a context for a request. -func NewUpdateMTOShipmentStatusParamsWithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - Context: ctx, - } -} - -// NewUpdateMTOShipmentStatusParamsWithHTTPClient creates a new UpdateMTOShipmentStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdateMTOShipmentStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { - return &UpdateMTOShipmentStatusParams{ - HTTPClient: client, - } -} - -/* -UpdateMTOShipmentStatusParams contains all the parameters to send to the API endpoint - - for the update m t o shipment status operation. - - Typically these are written to a http.Request. -*/ -type UpdateMTOShipmentStatusParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *supportmessages.UpdateMTOShipmentStatus - - /* MtoShipmentID. - - UUID of the shipment being updated. - - Format: uuid - */ - MtoShipmentID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update m t o shipment status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentStatusParams) WithDefaults() *UpdateMTOShipmentStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update m t o shipment status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdateMTOShipmentStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentStatusParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithBody(body *supportmessages.UpdateMTOShipmentStatus) *UpdateMTOShipmentStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetBody(body *supportmessages.UpdateMTOShipmentStatus) { - o.Body = body -} - -// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentStatusParams { - o.SetMtoShipmentID(mtoShipmentID) - return o -} - -// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment status params -func (o *UpdateMTOShipmentStatusParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { - o.MtoShipmentID = mtoShipmentID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdateMTOShipmentStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param mtoShipmentID - if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go deleted file mode 100644 index 943de2db2d9..00000000000 --- a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package mto_shipment - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdateMTOShipmentStatusReader is a Reader for the UpdateMTOShipmentStatus structure. -type UpdateMTOShipmentStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdateMTOShipmentStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdateMTOShipmentStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdateMTOShipmentStatusBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdateMTOShipmentStatusUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdateMTOShipmentStatusForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdateMTOShipmentStatusNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdateMTOShipmentStatusConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdateMTOShipmentStatusPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdateMTOShipmentStatusUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdateMTOShipmentStatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/status] updateMTOShipmentStatus", response, response.Code()) - } -} - -// NewUpdateMTOShipmentStatusOK creates a UpdateMTOShipmentStatusOK with default headers values -func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { - return &UpdateMTOShipmentStatusOK{} -} - -/* -UpdateMTOShipmentStatusOK describes a response with status code 200, with default header values. - -Successfully updated the shipment's status. -*/ -type UpdateMTOShipmentStatusOK struct { - Payload *supportmessages.MTOShipment -} - -// IsSuccess returns true when this update m t o shipment status o k response has a 2xx status code -func (o *UpdateMTOShipmentStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update m t o shipment status o k response has a 3xx status code -func (o *UpdateMTOShipmentStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status o k response has a 4xx status code -func (o *UpdateMTOShipmentStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment status o k response has a 5xx status code -func (o *UpdateMTOShipmentStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status o k response a status code equal to that given -func (o *UpdateMTOShipmentStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update m t o shipment status o k response -func (o *UpdateMTOShipmentStatusOK) Code() int { - return 200 -} - -func (o *UpdateMTOShipmentStatusOK) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentStatusOK) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) -} - -func (o *UpdateMTOShipmentStatusOK) GetPayload() *supportmessages.MTOShipment { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.MTOShipment) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusBadRequest creates a UpdateMTOShipmentStatusBadRequest with default headers values -func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { - return &UpdateMTOShipmentStatusBadRequest{} -} - -/* -UpdateMTOShipmentStatusBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdateMTOShipmentStatusBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status bad request response has a 2xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status bad request response has a 3xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status bad request response has a 4xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status bad request response has a 5xx status code -func (o *UpdateMTOShipmentStatusBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status bad request response a status code equal to that given -func (o *UpdateMTOShipmentStatusBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update m t o shipment status bad request response -func (o *UpdateMTOShipmentStatusBadRequest) Code() int { - return 400 -} - -func (o *UpdateMTOShipmentStatusBadRequest) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentStatusBadRequest) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdateMTOShipmentStatusBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusUnauthorized creates a UpdateMTOShipmentStatusUnauthorized with default headers values -func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { - return &UpdateMTOShipmentStatusUnauthorized{} -} - -/* -UpdateMTOShipmentStatusUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentStatusUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status unauthorized response has a 2xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status unauthorized response has a 3xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status unauthorized response has a 4xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status unauthorized response has a 5xx status code -func (o *UpdateMTOShipmentStatusUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status unauthorized response a status code equal to that given -func (o *UpdateMTOShipmentStatusUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update m t o shipment status unauthorized response -func (o *UpdateMTOShipmentStatusUnauthorized) Code() int { - return 401 -} - -func (o *UpdateMTOShipmentStatusUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnauthorized) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusForbidden creates a UpdateMTOShipmentStatusForbidden with default headers values -func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { - return &UpdateMTOShipmentStatusForbidden{} -} - -/* -UpdateMTOShipmentStatusForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdateMTOShipmentStatusForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status forbidden response has a 2xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status forbidden response has a 3xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status forbidden response has a 4xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status forbidden response has a 5xx status code -func (o *UpdateMTOShipmentStatusForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status forbidden response a status code equal to that given -func (o *UpdateMTOShipmentStatusForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update m t o shipment status forbidden response -func (o *UpdateMTOShipmentStatusForbidden) Code() int { - return 403 -} - -func (o *UpdateMTOShipmentStatusForbidden) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentStatusForbidden) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdateMTOShipmentStatusForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusNotFound creates a UpdateMTOShipmentStatusNotFound with default headers values -func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { - return &UpdateMTOShipmentStatusNotFound{} -} - -/* -UpdateMTOShipmentStatusNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdateMTOShipmentStatusNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status not found response has a 2xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status not found response has a 3xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status not found response has a 4xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status not found response has a 5xx status code -func (o *UpdateMTOShipmentStatusNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status not found response a status code equal to that given -func (o *UpdateMTOShipmentStatusNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update m t o shipment status not found response -func (o *UpdateMTOShipmentStatusNotFound) Code() int { - return 404 -} - -func (o *UpdateMTOShipmentStatusNotFound) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentStatusNotFound) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdateMTOShipmentStatusNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusConflict creates a UpdateMTOShipmentStatusConflict with default headers values -func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { - return &UpdateMTOShipmentStatusConflict{} -} - -/* -UpdateMTOShipmentStatusConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type UpdateMTOShipmentStatusConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status conflict response has a 2xx status code -func (o *UpdateMTOShipmentStatusConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status conflict response has a 3xx status code -func (o *UpdateMTOShipmentStatusConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status conflict response has a 4xx status code -func (o *UpdateMTOShipmentStatusConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status conflict response has a 5xx status code -func (o *UpdateMTOShipmentStatusConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status conflict response a status code equal to that given -func (o *UpdateMTOShipmentStatusConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update m t o shipment status conflict response -func (o *UpdateMTOShipmentStatusConflict) Code() int { - return 409 -} - -func (o *UpdateMTOShipmentStatusConflict) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentStatusConflict) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdateMTOShipmentStatusConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusPreconditionFailed creates a UpdateMTOShipmentStatusPreconditionFailed with default headers values -func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { - return &UpdateMTOShipmentStatusPreconditionFailed{} -} - -/* -UpdateMTOShipmentStatusPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdateMTOShipmentStatusPreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update m t o shipment status precondition failed response has a 2xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status precondition failed response has a 3xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status precondition failed response has a 4xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status precondition failed response has a 5xx status code -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status precondition failed response a status code equal to that given -func (o *UpdateMTOShipmentStatusPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update m t o shipment status precondition failed response -func (o *UpdateMTOShipmentStatusPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusUnprocessableEntity creates a UpdateMTOShipmentStatusUnprocessableEntity with default headers values -func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { - return &UpdateMTOShipmentStatusUnprocessableEntity{} -} - -/* -UpdateMTOShipmentStatusUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type UpdateMTOShipmentStatusUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this update m t o shipment status unprocessable entity response has a 2xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status unprocessable entity response has a 3xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status unprocessable entity response has a 4xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update m t o shipment status unprocessable entity response has a 5xx status code -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update m t o shipment status unprocessable entity response a status code equal to that given -func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update m t o shipment status unprocessable entity response -func (o *UpdateMTOShipmentStatusUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdateMTOShipmentStatusInternalServerError creates a UpdateMTOShipmentStatusInternalServerError with default headers values -func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { - return &UpdateMTOShipmentStatusInternalServerError{} -} - -/* -UpdateMTOShipmentStatusInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdateMTOShipmentStatusInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this update m t o shipment status internal server error response has a 2xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update m t o shipment status internal server error response has a 3xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update m t o shipment status internal server error response has a 4xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update m t o shipment status internal server error response has a 5xx status code -func (o *UpdateMTOShipmentStatusInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update m t o shipment status internal server error response a status code equal to that given -func (o *UpdateMTOShipmentStatusInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update m t o shipment status internal server error response -func (o *UpdateMTOShipmentStatusInternalServerError) Code() int { - return 500 -} - -func (o *UpdateMTOShipmentStatusInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentStatusInternalServerError) String() string { - return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdateMTOShipmentStatusInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *UpdateMTOShipmentStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/mymove_client.go b/pkg/gen/supportclient/mymove_client.go deleted file mode 100644 index 4df4df28067..00000000000 --- a/pkg/gen/supportclient/mymove_client.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportclient - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "github.com/go-openapi/runtime" - httptransport "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportclient/move_task_order" - "github.com/transcom/mymove/pkg/gen/supportclient/mto_service_item" - "github.com/transcom/mymove/pkg/gen/supportclient/mto_shipment" - "github.com/transcom/mymove/pkg/gen/supportclient/payment_request" - "github.com/transcom/mymove/pkg/gen/supportclient/webhook" -) - -// Default mymove HTTP client. -var Default = NewHTTPClient(nil) - -const ( - // DefaultHost is the default Host - // found in Meta (info) section of spec file - DefaultHost string = "localhost" - // DefaultBasePath is the default BasePath - // found in Meta (info) section of spec file - DefaultBasePath string = "/support/v1" -) - -// DefaultSchemes are the default schemes found in Meta (info) section of spec file -var DefaultSchemes = []string{"http"} - -// NewHTTPClient creates a new mymove HTTP client. -func NewHTTPClient(formats strfmt.Registry) *Mymove { - return NewHTTPClientWithConfig(formats, nil) -} - -// NewHTTPClientWithConfig creates a new mymove HTTP client, -// using a customizable transport config. -func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { - // ensure nullable parameters have default - if cfg == nil { - cfg = DefaultTransportConfig() - } - - // create transport and client - transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) - return New(transport, formats) -} - -// New creates a new mymove client -func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { - // ensure nullable parameters have default - if formats == nil { - formats = strfmt.Default - } - - cli := new(Mymove) - cli.Transport = transport - cli.MoveTaskOrder = move_task_order.New(transport, formats) - cli.MtoServiceItem = mto_service_item.New(transport, formats) - cli.MtoShipment = mto_shipment.New(transport, formats) - cli.PaymentRequest = payment_request.New(transport, formats) - cli.Webhook = webhook.New(transport, formats) - return cli -} - -// DefaultTransportConfig creates a TransportConfig with the -// default settings taken from the meta section of the spec file. -func DefaultTransportConfig() *TransportConfig { - return &TransportConfig{ - Host: DefaultHost, - BasePath: DefaultBasePath, - Schemes: DefaultSchemes, - } -} - -// TransportConfig contains the transport related info, -// found in the meta section of the spec file. -type TransportConfig struct { - Host string - BasePath string - Schemes []string -} - -// WithHost overrides the default host, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithHost(host string) *TransportConfig { - cfg.Host = host - return cfg -} - -// WithBasePath overrides the default basePath, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { - cfg.BasePath = basePath - return cfg -} - -// WithSchemes overrides the default schemes, -// provided by the meta section of the spec file. -func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { - cfg.Schemes = schemes - return cfg -} - -// Mymove is a client for mymove -type Mymove struct { - MoveTaskOrder move_task_order.ClientService - - MtoServiceItem mto_service_item.ClientService - - MtoShipment mto_shipment.ClientService - - PaymentRequest payment_request.ClientService - - Webhook webhook.ClientService - - Transport runtime.ClientTransport -} - -// SetTransport changes the transport on the client and all its subresources -func (c *Mymove) SetTransport(transport runtime.ClientTransport) { - c.Transport = transport - c.MoveTaskOrder.SetTransport(transport) - c.MtoServiceItem.SetTransport(transport) - c.MtoShipment.SetTransport(transport) - c.PaymentRequest.SetTransport(transport) - c.Webhook.SetTransport(transport) -} diff --git a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go deleted file mode 100644 index d4632c91481..00000000000 --- a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewGetPaymentRequestEDIParams creates a new GetPaymentRequestEDIParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewGetPaymentRequestEDIParams() *GetPaymentRequestEDIParams { - return &GetPaymentRequestEDIParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewGetPaymentRequestEDIParamsWithTimeout creates a new GetPaymentRequestEDIParams object -// with the ability to set a timeout on a request. -func NewGetPaymentRequestEDIParamsWithTimeout(timeout time.Duration) *GetPaymentRequestEDIParams { - return &GetPaymentRequestEDIParams{ - timeout: timeout, - } -} - -// NewGetPaymentRequestEDIParamsWithContext creates a new GetPaymentRequestEDIParams object -// with the ability to set a context for a request. -func NewGetPaymentRequestEDIParamsWithContext(ctx context.Context) *GetPaymentRequestEDIParams { - return &GetPaymentRequestEDIParams{ - Context: ctx, - } -} - -// NewGetPaymentRequestEDIParamsWithHTTPClient creates a new GetPaymentRequestEDIParams object -// with the ability to set a custom HTTPClient for a request. -func NewGetPaymentRequestEDIParamsWithHTTPClient(client *http.Client) *GetPaymentRequestEDIParams { - return &GetPaymentRequestEDIParams{ - HTTPClient: client, - } -} - -/* -GetPaymentRequestEDIParams contains all the parameters to send to the API endpoint - - for the get payment request e d i operation. - - Typically these are written to a http.Request. -*/ -type GetPaymentRequestEDIParams struct { - - /* PaymentRequestID. - - UUID of the payment request for which EDI should be generated. - - Format: uuid - */ - PaymentRequestID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the get payment request e d i params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetPaymentRequestEDIParams) WithDefaults() *GetPaymentRequestEDIParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the get payment request e d i params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *GetPaymentRequestEDIParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) WithTimeout(timeout time.Duration) *GetPaymentRequestEDIParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) WithContext(ctx context.Context) *GetPaymentRequestEDIParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) WithHTTPClient(client *http.Client) *GetPaymentRequestEDIParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPaymentRequestID adds the paymentRequestID to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *GetPaymentRequestEDIParams { - o.SetPaymentRequestID(paymentRequestID) - return o -} - -// SetPaymentRequestID adds the paymentRequestId to the get payment request e d i params -func (o *GetPaymentRequestEDIParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { - o.PaymentRequestID = paymentRequestID -} - -// WriteToRequest writes these params to a swagger request -func (o *GetPaymentRequestEDIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param paymentRequestID - if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go deleted file mode 100644 index cec8b4f5b7e..00000000000 --- a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go +++ /dev/null @@ -1,621 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// GetPaymentRequestEDIReader is a Reader for the GetPaymentRequestEDI structure. -type GetPaymentRequestEDIReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *GetPaymentRequestEDIReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewGetPaymentRequestEDIOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewGetPaymentRequestEDIBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewGetPaymentRequestEDIUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewGetPaymentRequestEDIForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewGetPaymentRequestEDINotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewGetPaymentRequestEDIConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewGetPaymentRequestEDIUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewGetPaymentRequestEDIInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /payment-requests/{paymentRequestID}/edi] getPaymentRequestEDI", response, response.Code()) - } -} - -// NewGetPaymentRequestEDIOK creates a GetPaymentRequestEDIOK with default headers values -func NewGetPaymentRequestEDIOK() *GetPaymentRequestEDIOK { - return &GetPaymentRequestEDIOK{} -} - -/* -GetPaymentRequestEDIOK describes a response with status code 200, with default header values. - -Successfully retrieved payment requests associated with a given move task order -*/ -type GetPaymentRequestEDIOK struct { - Payload *supportmessages.PaymentRequestEDI -} - -// IsSuccess returns true when this get payment request e d i o k response has a 2xx status code -func (o *GetPaymentRequestEDIOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this get payment request e d i o k response has a 3xx status code -func (o *GetPaymentRequestEDIOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i o k response has a 4xx status code -func (o *GetPaymentRequestEDIOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this get payment request e d i o k response has a 5xx status code -func (o *GetPaymentRequestEDIOK) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i o k response a status code equal to that given -func (o *GetPaymentRequestEDIOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the get payment request e d i o k response -func (o *GetPaymentRequestEDIOK) Code() int { - return 200 -} - -func (o *GetPaymentRequestEDIOK) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIOK %+v", 200, o.Payload) -} - -func (o *GetPaymentRequestEDIOK) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIOK %+v", 200, o.Payload) -} - -func (o *GetPaymentRequestEDIOK) GetPayload() *supportmessages.PaymentRequestEDI { - return o.Payload -} - -func (o *GetPaymentRequestEDIOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.PaymentRequestEDI) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIBadRequest creates a GetPaymentRequestEDIBadRequest with default headers values -func NewGetPaymentRequestEDIBadRequest() *GetPaymentRequestEDIBadRequest { - return &GetPaymentRequestEDIBadRequest{} -} - -/* -GetPaymentRequestEDIBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type GetPaymentRequestEDIBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get payment request e d i bad request response has a 2xx status code -func (o *GetPaymentRequestEDIBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i bad request response has a 3xx status code -func (o *GetPaymentRequestEDIBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i bad request response has a 4xx status code -func (o *GetPaymentRequestEDIBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i bad request response has a 5xx status code -func (o *GetPaymentRequestEDIBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i bad request response a status code equal to that given -func (o *GetPaymentRequestEDIBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the get payment request e d i bad request response -func (o *GetPaymentRequestEDIBadRequest) Code() int { - return 400 -} - -func (o *GetPaymentRequestEDIBadRequest) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIBadRequest %+v", 400, o.Payload) -} - -func (o *GetPaymentRequestEDIBadRequest) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIBadRequest %+v", 400, o.Payload) -} - -func (o *GetPaymentRequestEDIBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetPaymentRequestEDIBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIUnauthorized creates a GetPaymentRequestEDIUnauthorized with default headers values -func NewGetPaymentRequestEDIUnauthorized() *GetPaymentRequestEDIUnauthorized { - return &GetPaymentRequestEDIUnauthorized{} -} - -/* -GetPaymentRequestEDIUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type GetPaymentRequestEDIUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get payment request e d i unauthorized response has a 2xx status code -func (o *GetPaymentRequestEDIUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i unauthorized response has a 3xx status code -func (o *GetPaymentRequestEDIUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i unauthorized response has a 4xx status code -func (o *GetPaymentRequestEDIUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i unauthorized response has a 5xx status code -func (o *GetPaymentRequestEDIUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i unauthorized response a status code equal to that given -func (o *GetPaymentRequestEDIUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the get payment request e d i unauthorized response -func (o *GetPaymentRequestEDIUnauthorized) Code() int { - return 401 -} - -func (o *GetPaymentRequestEDIUnauthorized) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnauthorized %+v", 401, o.Payload) -} - -func (o *GetPaymentRequestEDIUnauthorized) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnauthorized %+v", 401, o.Payload) -} - -func (o *GetPaymentRequestEDIUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetPaymentRequestEDIUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIForbidden creates a GetPaymentRequestEDIForbidden with default headers values -func NewGetPaymentRequestEDIForbidden() *GetPaymentRequestEDIForbidden { - return &GetPaymentRequestEDIForbidden{} -} - -/* -GetPaymentRequestEDIForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type GetPaymentRequestEDIForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get payment request e d i forbidden response has a 2xx status code -func (o *GetPaymentRequestEDIForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i forbidden response has a 3xx status code -func (o *GetPaymentRequestEDIForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i forbidden response has a 4xx status code -func (o *GetPaymentRequestEDIForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i forbidden response has a 5xx status code -func (o *GetPaymentRequestEDIForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i forbidden response a status code equal to that given -func (o *GetPaymentRequestEDIForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the get payment request e d i forbidden response -func (o *GetPaymentRequestEDIForbidden) Code() int { - return 403 -} - -func (o *GetPaymentRequestEDIForbidden) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIForbidden %+v", 403, o.Payload) -} - -func (o *GetPaymentRequestEDIForbidden) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIForbidden %+v", 403, o.Payload) -} - -func (o *GetPaymentRequestEDIForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetPaymentRequestEDIForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDINotFound creates a GetPaymentRequestEDINotFound with default headers values -func NewGetPaymentRequestEDINotFound() *GetPaymentRequestEDINotFound { - return &GetPaymentRequestEDINotFound{} -} - -/* -GetPaymentRequestEDINotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type GetPaymentRequestEDINotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get payment request e d i not found response has a 2xx status code -func (o *GetPaymentRequestEDINotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i not found response has a 3xx status code -func (o *GetPaymentRequestEDINotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i not found response has a 4xx status code -func (o *GetPaymentRequestEDINotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i not found response has a 5xx status code -func (o *GetPaymentRequestEDINotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i not found response a status code equal to that given -func (o *GetPaymentRequestEDINotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the get payment request e d i not found response -func (o *GetPaymentRequestEDINotFound) Code() int { - return 404 -} - -func (o *GetPaymentRequestEDINotFound) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDINotFound %+v", 404, o.Payload) -} - -func (o *GetPaymentRequestEDINotFound) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDINotFound %+v", 404, o.Payload) -} - -func (o *GetPaymentRequestEDINotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetPaymentRequestEDINotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIConflict creates a GetPaymentRequestEDIConflict with default headers values -func NewGetPaymentRequestEDIConflict() *GetPaymentRequestEDIConflict { - return &GetPaymentRequestEDIConflict{} -} - -/* -GetPaymentRequestEDIConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type GetPaymentRequestEDIConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this get payment request e d i conflict response has a 2xx status code -func (o *GetPaymentRequestEDIConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i conflict response has a 3xx status code -func (o *GetPaymentRequestEDIConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i conflict response has a 4xx status code -func (o *GetPaymentRequestEDIConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i conflict response has a 5xx status code -func (o *GetPaymentRequestEDIConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i conflict response a status code equal to that given -func (o *GetPaymentRequestEDIConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the get payment request e d i conflict response -func (o *GetPaymentRequestEDIConflict) Code() int { - return 409 -} - -func (o *GetPaymentRequestEDIConflict) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIConflict %+v", 409, o.Payload) -} - -func (o *GetPaymentRequestEDIConflict) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIConflict %+v", 409, o.Payload) -} - -func (o *GetPaymentRequestEDIConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *GetPaymentRequestEDIConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIUnprocessableEntity creates a GetPaymentRequestEDIUnprocessableEntity with default headers values -func NewGetPaymentRequestEDIUnprocessableEntity() *GetPaymentRequestEDIUnprocessableEntity { - return &GetPaymentRequestEDIUnprocessableEntity{} -} - -/* -GetPaymentRequestEDIUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type GetPaymentRequestEDIUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this get payment request e d i unprocessable entity response has a 2xx status code -func (o *GetPaymentRequestEDIUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i unprocessable entity response has a 3xx status code -func (o *GetPaymentRequestEDIUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i unprocessable entity response has a 4xx status code -func (o *GetPaymentRequestEDIUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this get payment request e d i unprocessable entity response has a 5xx status code -func (o *GetPaymentRequestEDIUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this get payment request e d i unprocessable entity response a status code equal to that given -func (o *GetPaymentRequestEDIUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the get payment request e d i unprocessable entity response -func (o *GetPaymentRequestEDIUnprocessableEntity) Code() int { - return 422 -} - -func (o *GetPaymentRequestEDIUnprocessableEntity) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *GetPaymentRequestEDIUnprocessableEntity) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *GetPaymentRequestEDIUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *GetPaymentRequestEDIUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewGetPaymentRequestEDIInternalServerError creates a GetPaymentRequestEDIInternalServerError with default headers values -func NewGetPaymentRequestEDIInternalServerError() *GetPaymentRequestEDIInternalServerError { - return &GetPaymentRequestEDIInternalServerError{} -} - -/* -GetPaymentRequestEDIInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type GetPaymentRequestEDIInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this get payment request e d i internal server error response has a 2xx status code -func (o *GetPaymentRequestEDIInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this get payment request e d i internal server error response has a 3xx status code -func (o *GetPaymentRequestEDIInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this get payment request e d i internal server error response has a 4xx status code -func (o *GetPaymentRequestEDIInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this get payment request e d i internal server error response has a 5xx status code -func (o *GetPaymentRequestEDIInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this get payment request e d i internal server error response a status code equal to that given -func (o *GetPaymentRequestEDIInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the get payment request e d i internal server error response -func (o *GetPaymentRequestEDIInternalServerError) Code() int { - return 500 -} - -func (o *GetPaymentRequestEDIInternalServerError) Error() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIInternalServerError %+v", 500, o.Payload) -} - -func (o *GetPaymentRequestEDIInternalServerError) String() string { - return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIInternalServerError %+v", 500, o.Payload) -} - -func (o *GetPaymentRequestEDIInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *GetPaymentRequestEDIInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go deleted file mode 100644 index 30d1611d01c..00000000000 --- a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewListMTOPaymentRequestsParams creates a new ListMTOPaymentRequestsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewListMTOPaymentRequestsParams() *ListMTOPaymentRequestsParams { - return &ListMTOPaymentRequestsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewListMTOPaymentRequestsParamsWithTimeout creates a new ListMTOPaymentRequestsParams object -// with the ability to set a timeout on a request. -func NewListMTOPaymentRequestsParamsWithTimeout(timeout time.Duration) *ListMTOPaymentRequestsParams { - return &ListMTOPaymentRequestsParams{ - timeout: timeout, - } -} - -// NewListMTOPaymentRequestsParamsWithContext creates a new ListMTOPaymentRequestsParams object -// with the ability to set a context for a request. -func NewListMTOPaymentRequestsParamsWithContext(ctx context.Context) *ListMTOPaymentRequestsParams { - return &ListMTOPaymentRequestsParams{ - Context: ctx, - } -} - -// NewListMTOPaymentRequestsParamsWithHTTPClient creates a new ListMTOPaymentRequestsParams object -// with the ability to set a custom HTTPClient for a request. -func NewListMTOPaymentRequestsParamsWithHTTPClient(client *http.Client) *ListMTOPaymentRequestsParams { - return &ListMTOPaymentRequestsParams{ - HTTPClient: client, - } -} - -/* -ListMTOPaymentRequestsParams contains all the parameters to send to the API endpoint - - for the list m t o payment requests operation. - - Typically these are written to a http.Request. -*/ -type ListMTOPaymentRequestsParams struct { - - /* MoveTaskOrderID. - - Only return move task orders updated since this time. - - Format: uuid - */ - MoveTaskOrderID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the list m t o payment requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMTOPaymentRequestsParams) WithDefaults() *ListMTOPaymentRequestsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the list m t o payment requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ListMTOPaymentRequestsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) WithTimeout(timeout time.Duration) *ListMTOPaymentRequestsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) WithContext(ctx context.Context) *ListMTOPaymentRequestsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) WithHTTPClient(client *http.Client) *ListMTOPaymentRequestsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithMoveTaskOrderID adds the moveTaskOrderID to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) WithMoveTaskOrderID(moveTaskOrderID strfmt.UUID) *ListMTOPaymentRequestsParams { - o.SetMoveTaskOrderID(moveTaskOrderID) - return o -} - -// SetMoveTaskOrderID adds the moveTaskOrderId to the list m t o payment requests params -func (o *ListMTOPaymentRequestsParams) SetMoveTaskOrderID(moveTaskOrderID strfmt.UUID) { - o.MoveTaskOrderID = moveTaskOrderID -} - -// WriteToRequest writes these params to a swagger request -func (o *ListMTOPaymentRequestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param moveTaskOrderID - if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go deleted file mode 100644 index 0a969ab9f9f..00000000000 --- a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go +++ /dev/null @@ -1,471 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ListMTOPaymentRequestsReader is a Reader for the ListMTOPaymentRequests structure. -type ListMTOPaymentRequestsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ListMTOPaymentRequestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewListMTOPaymentRequestsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewListMTOPaymentRequestsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewListMTOPaymentRequestsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewListMTOPaymentRequestsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewListMTOPaymentRequestsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewListMTOPaymentRequestsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[GET /move-task-orders/{moveTaskOrderID}/payment-requests] listMTOPaymentRequests", response, response.Code()) - } -} - -// NewListMTOPaymentRequestsOK creates a ListMTOPaymentRequestsOK with default headers values -func NewListMTOPaymentRequestsOK() *ListMTOPaymentRequestsOK { - return &ListMTOPaymentRequestsOK{} -} - -/* -ListMTOPaymentRequestsOK describes a response with status code 200, with default header values. - -Successfully retrieved payment requests associated with a given move task order -*/ -type ListMTOPaymentRequestsOK struct { - Payload supportmessages.PaymentRequests -} - -// IsSuccess returns true when this list m t o payment requests o k response has a 2xx status code -func (o *ListMTOPaymentRequestsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this list m t o payment requests o k response has a 3xx status code -func (o *ListMTOPaymentRequestsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests o k response has a 4xx status code -func (o *ListMTOPaymentRequestsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this list m t o payment requests o k response has a 5xx status code -func (o *ListMTOPaymentRequestsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t o payment requests o k response a status code equal to that given -func (o *ListMTOPaymentRequestsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the list m t o payment requests o k response -func (o *ListMTOPaymentRequestsOK) Code() int { - return 200 -} - -func (o *ListMTOPaymentRequestsOK) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsOK %+v", 200, o.Payload) -} - -func (o *ListMTOPaymentRequestsOK) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsOK %+v", 200, o.Payload) -} - -func (o *ListMTOPaymentRequestsOK) GetPayload() supportmessages.PaymentRequests { - return o.Payload -} - -func (o *ListMTOPaymentRequestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOPaymentRequestsBadRequest creates a ListMTOPaymentRequestsBadRequest with default headers values -func NewListMTOPaymentRequestsBadRequest() *ListMTOPaymentRequestsBadRequest { - return &ListMTOPaymentRequestsBadRequest{} -} - -/* -ListMTOPaymentRequestsBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type ListMTOPaymentRequestsBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t o payment requests bad request response has a 2xx status code -func (o *ListMTOPaymentRequestsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t o payment requests bad request response has a 3xx status code -func (o *ListMTOPaymentRequestsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests bad request response has a 4xx status code -func (o *ListMTOPaymentRequestsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t o payment requests bad request response has a 5xx status code -func (o *ListMTOPaymentRequestsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t o payment requests bad request response a status code equal to that given -func (o *ListMTOPaymentRequestsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the list m t o payment requests bad request response -func (o *ListMTOPaymentRequestsBadRequest) Code() int { - return 400 -} - -func (o *ListMTOPaymentRequestsBadRequest) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsBadRequest %+v", 400, o.Payload) -} - -func (o *ListMTOPaymentRequestsBadRequest) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsBadRequest %+v", 400, o.Payload) -} - -func (o *ListMTOPaymentRequestsBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOPaymentRequestsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOPaymentRequestsUnauthorized creates a ListMTOPaymentRequestsUnauthorized with default headers values -func NewListMTOPaymentRequestsUnauthorized() *ListMTOPaymentRequestsUnauthorized { - return &ListMTOPaymentRequestsUnauthorized{} -} - -/* -ListMTOPaymentRequestsUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type ListMTOPaymentRequestsUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t o payment requests unauthorized response has a 2xx status code -func (o *ListMTOPaymentRequestsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t o payment requests unauthorized response has a 3xx status code -func (o *ListMTOPaymentRequestsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests unauthorized response has a 4xx status code -func (o *ListMTOPaymentRequestsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t o payment requests unauthorized response has a 5xx status code -func (o *ListMTOPaymentRequestsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t o payment requests unauthorized response a status code equal to that given -func (o *ListMTOPaymentRequestsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the list m t o payment requests unauthorized response -func (o *ListMTOPaymentRequestsUnauthorized) Code() int { - return 401 -} - -func (o *ListMTOPaymentRequestsUnauthorized) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMTOPaymentRequestsUnauthorized) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsUnauthorized %+v", 401, o.Payload) -} - -func (o *ListMTOPaymentRequestsUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOPaymentRequestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOPaymentRequestsForbidden creates a ListMTOPaymentRequestsForbidden with default headers values -func NewListMTOPaymentRequestsForbidden() *ListMTOPaymentRequestsForbidden { - return &ListMTOPaymentRequestsForbidden{} -} - -/* -ListMTOPaymentRequestsForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type ListMTOPaymentRequestsForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t o payment requests forbidden response has a 2xx status code -func (o *ListMTOPaymentRequestsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t o payment requests forbidden response has a 3xx status code -func (o *ListMTOPaymentRequestsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests forbidden response has a 4xx status code -func (o *ListMTOPaymentRequestsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t o payment requests forbidden response has a 5xx status code -func (o *ListMTOPaymentRequestsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t o payment requests forbidden response a status code equal to that given -func (o *ListMTOPaymentRequestsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the list m t o payment requests forbidden response -func (o *ListMTOPaymentRequestsForbidden) Code() int { - return 403 -} - -func (o *ListMTOPaymentRequestsForbidden) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsForbidden %+v", 403, o.Payload) -} - -func (o *ListMTOPaymentRequestsForbidden) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsForbidden %+v", 403, o.Payload) -} - -func (o *ListMTOPaymentRequestsForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOPaymentRequestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOPaymentRequestsNotFound creates a ListMTOPaymentRequestsNotFound with default headers values -func NewListMTOPaymentRequestsNotFound() *ListMTOPaymentRequestsNotFound { - return &ListMTOPaymentRequestsNotFound{} -} - -/* -ListMTOPaymentRequestsNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type ListMTOPaymentRequestsNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this list m t o payment requests not found response has a 2xx status code -func (o *ListMTOPaymentRequestsNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t o payment requests not found response has a 3xx status code -func (o *ListMTOPaymentRequestsNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests not found response has a 4xx status code -func (o *ListMTOPaymentRequestsNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this list m t o payment requests not found response has a 5xx status code -func (o *ListMTOPaymentRequestsNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this list m t o payment requests not found response a status code equal to that given -func (o *ListMTOPaymentRequestsNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the list m t o payment requests not found response -func (o *ListMTOPaymentRequestsNotFound) Code() int { - return 404 -} - -func (o *ListMTOPaymentRequestsNotFound) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsNotFound %+v", 404, o.Payload) -} - -func (o *ListMTOPaymentRequestsNotFound) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsNotFound %+v", 404, o.Payload) -} - -func (o *ListMTOPaymentRequestsNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ListMTOPaymentRequestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewListMTOPaymentRequestsInternalServerError creates a ListMTOPaymentRequestsInternalServerError with default headers values -func NewListMTOPaymentRequestsInternalServerError() *ListMTOPaymentRequestsInternalServerError { - return &ListMTOPaymentRequestsInternalServerError{} -} - -/* -ListMTOPaymentRequestsInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type ListMTOPaymentRequestsInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this list m t o payment requests internal server error response has a 2xx status code -func (o *ListMTOPaymentRequestsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this list m t o payment requests internal server error response has a 3xx status code -func (o *ListMTOPaymentRequestsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this list m t o payment requests internal server error response has a 4xx status code -func (o *ListMTOPaymentRequestsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this list m t o payment requests internal server error response has a 5xx status code -func (o *ListMTOPaymentRequestsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this list m t o payment requests internal server error response a status code equal to that given -func (o *ListMTOPaymentRequestsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the list m t o payment requests internal server error response -func (o *ListMTOPaymentRequestsInternalServerError) Code() int { - return 500 -} - -func (o *ListMTOPaymentRequestsInternalServerError) Error() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMTOPaymentRequestsInternalServerError) String() string { - return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsInternalServerError %+v", 500, o.Payload) -} - -func (o *ListMTOPaymentRequestsInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *ListMTOPaymentRequestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/payment_request/payment_request_client.go b/pkg/gen/supportclient/payment_request/payment_request_client.go deleted file mode 100644 index dae7a0dbbce..00000000000 --- a/pkg/gen/supportclient/payment_request/payment_request_client.go +++ /dev/null @@ -1,271 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new payment request API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for payment request API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - GetPaymentRequestEDI(params *GetPaymentRequestEDIParams, opts ...ClientOption) (*GetPaymentRequestEDIOK, error) - - ListMTOPaymentRequests(params *ListMTOPaymentRequestsParams, opts ...ClientOption) (*ListMTOPaymentRequestsOK, error) - - ProcessReviewedPaymentRequests(params *ProcessReviewedPaymentRequestsParams, opts ...ClientOption) (*ProcessReviewedPaymentRequestsOK, error) - - RecalculatePaymentRequest(params *RecalculatePaymentRequestParams, opts ...ClientOption) (*RecalculatePaymentRequestCreated, error) - - UpdatePaymentRequestStatus(params *UpdatePaymentRequestStatusParams, opts ...ClientOption) (*UpdatePaymentRequestStatusOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* - GetPaymentRequestEDI gets payment request e d i - - Returns the EDI (Electronic Data Interchange) message for the payment request identified - -by the given payment request ID. Note that the EDI returned in the JSON payload will have where there -would normally be line breaks (due to JSON not allowing line breaks in a string). - -This is a support endpoint and will not be available in production. -*/ -func (a *Client) GetPaymentRequestEDI(params *GetPaymentRequestEDIParams, opts ...ClientOption) (*GetPaymentRequestEDIOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewGetPaymentRequestEDIParams() - } - op := &runtime.ClientOperation{ - ID: "getPaymentRequestEDI", - Method: "GET", - PathPattern: "/payment-requests/{paymentRequestID}/edi", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &GetPaymentRequestEDIReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*GetPaymentRequestEDIOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for getPaymentRequestEDI: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ListMTOPaymentRequests lists m t o payment requests - - ### Functionality - -This endpoint lists all PaymentRequests associated with a given MoveTaskOrder. - -This is a support endpoint and is not available in production. -*/ -func (a *Client) ListMTOPaymentRequests(params *ListMTOPaymentRequestsParams, opts ...ClientOption) (*ListMTOPaymentRequestsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewListMTOPaymentRequestsParams() - } - op := &runtime.ClientOperation{ - ID: "listMTOPaymentRequests", - Method: "GET", - PathPattern: "/move-task-orders/{moveTaskOrderID}/payment-requests", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ListMTOPaymentRequestsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ListMTOPaymentRequestsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for listMTOPaymentRequests: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - ProcessReviewedPaymentRequests processes reviewed payment requests - - Updates the status of reviewed payment requests and sends PRs to Syncada if - -the SendToSyncada flag is set - -This is a support endpoint and will not be available in production. -*/ -func (a *Client) ProcessReviewedPaymentRequests(params *ProcessReviewedPaymentRequestsParams, opts ...ClientOption) (*ProcessReviewedPaymentRequestsOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewProcessReviewedPaymentRequestsParams() - } - op := &runtime.ClientOperation{ - ID: "processReviewedPaymentRequests", - Method: "PATCH", - PathPattern: "/payment-requests/process-reviewed", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ProcessReviewedPaymentRequestsReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ProcessReviewedPaymentRequestsOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for processReviewedPaymentRequests: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - RecalculatePaymentRequest recalculates payment request - - Recalculates an existing pending payment request by creating a new payment request for the same service - -items but is priced based on the current inputs (weights, dates, etc.). The previously existing payment -request is then deprecated. A link is made between the new and existing payment requests. - -This is a support endpoint and will not be available in production. -*/ -func (a *Client) RecalculatePaymentRequest(params *RecalculatePaymentRequestParams, opts ...ClientOption) (*RecalculatePaymentRequestCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewRecalculatePaymentRequestParams() - } - op := &runtime.ClientOperation{ - ID: "recalculatePaymentRequest", - Method: "POST", - PathPattern: "/payment-requests/{paymentRequestID}/recalculate", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &RecalculatePaymentRequestReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*RecalculatePaymentRequestCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for recalculatePaymentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* - UpdatePaymentRequestStatus updates payment request status - - Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED. - -A status of REVIEWED can optionally have a `rejectionReason`. - -This is a support endpoint and is not available in production. -*/ -func (a *Client) UpdatePaymentRequestStatus(params *UpdatePaymentRequestStatusParams, opts ...ClientOption) (*UpdatePaymentRequestStatusOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewUpdatePaymentRequestStatusParams() - } - op := &runtime.ClientOperation{ - ID: "updatePaymentRequestStatus", - Method: "PATCH", - PathPattern: "/payment-requests/{paymentRequestID}/status", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &UpdatePaymentRequestStatusReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*UpdatePaymentRequestStatusOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for updatePaymentRequestStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go deleted file mode 100644 index 9323038f443..00000000000 --- a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go +++ /dev/null @@ -1,150 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewProcessReviewedPaymentRequestsParams creates a new ProcessReviewedPaymentRequestsParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewProcessReviewedPaymentRequestsParams() *ProcessReviewedPaymentRequestsParams { - return &ProcessReviewedPaymentRequestsParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewProcessReviewedPaymentRequestsParamsWithTimeout creates a new ProcessReviewedPaymentRequestsParams object -// with the ability to set a timeout on a request. -func NewProcessReviewedPaymentRequestsParamsWithTimeout(timeout time.Duration) *ProcessReviewedPaymentRequestsParams { - return &ProcessReviewedPaymentRequestsParams{ - timeout: timeout, - } -} - -// NewProcessReviewedPaymentRequestsParamsWithContext creates a new ProcessReviewedPaymentRequestsParams object -// with the ability to set a context for a request. -func NewProcessReviewedPaymentRequestsParamsWithContext(ctx context.Context) *ProcessReviewedPaymentRequestsParams { - return &ProcessReviewedPaymentRequestsParams{ - Context: ctx, - } -} - -// NewProcessReviewedPaymentRequestsParamsWithHTTPClient creates a new ProcessReviewedPaymentRequestsParams object -// with the ability to set a custom HTTPClient for a request. -func NewProcessReviewedPaymentRequestsParamsWithHTTPClient(client *http.Client) *ProcessReviewedPaymentRequestsParams { - return &ProcessReviewedPaymentRequestsParams{ - HTTPClient: client, - } -} - -/* -ProcessReviewedPaymentRequestsParams contains all the parameters to send to the API endpoint - - for the process reviewed payment requests operation. - - Typically these are written to a http.Request. -*/ -type ProcessReviewedPaymentRequestsParams struct { - - // Body. - Body *supportmessages.ProcessReviewedPaymentRequests - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the process reviewed payment requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ProcessReviewedPaymentRequestsParams) WithDefaults() *ProcessReviewedPaymentRequestsParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the process reviewed payment requests params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ProcessReviewedPaymentRequestsParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) WithTimeout(timeout time.Duration) *ProcessReviewedPaymentRequestsParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) WithContext(ctx context.Context) *ProcessReviewedPaymentRequestsParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) WithHTTPClient(client *http.Client) *ProcessReviewedPaymentRequestsParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) WithBody(body *supportmessages.ProcessReviewedPaymentRequests) *ProcessReviewedPaymentRequestsParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the process reviewed payment requests params -func (o *ProcessReviewedPaymentRequestsParams) SetBody(body *supportmessages.ProcessReviewedPaymentRequests) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ProcessReviewedPaymentRequestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go deleted file mode 100644 index e853c7905ef..00000000000 --- a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go +++ /dev/null @@ -1,545 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ProcessReviewedPaymentRequestsReader is a Reader for the ProcessReviewedPaymentRequests structure. -type ProcessReviewedPaymentRequestsReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ProcessReviewedPaymentRequestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewProcessReviewedPaymentRequestsOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewProcessReviewedPaymentRequestsBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewProcessReviewedPaymentRequestsUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewProcessReviewedPaymentRequestsForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewProcessReviewedPaymentRequestsNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewProcessReviewedPaymentRequestsUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewProcessReviewedPaymentRequestsInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /payment-requests/process-reviewed] processReviewedPaymentRequests", response, response.Code()) - } -} - -// NewProcessReviewedPaymentRequestsOK creates a ProcessReviewedPaymentRequestsOK with default headers values -func NewProcessReviewedPaymentRequestsOK() *ProcessReviewedPaymentRequestsOK { - return &ProcessReviewedPaymentRequestsOK{} -} - -/* -ProcessReviewedPaymentRequestsOK describes a response with status code 200, with default header values. - -Successfully updated status of reviewed payment request and sent to Syncada if that flag is set -*/ -type ProcessReviewedPaymentRequestsOK struct { - Payload supportmessages.PaymentRequests -} - -// IsSuccess returns true when this process reviewed payment requests o k response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this process reviewed payment requests o k response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests o k response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this process reviewed payment requests o k response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsOK) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests o k response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the process reviewed payment requests o k response -func (o *ProcessReviewedPaymentRequestsOK) Code() int { - return 200 -} - -func (o *ProcessReviewedPaymentRequestsOK) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsOK %+v", 200, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsOK) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsOK %+v", 200, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsOK) GetPayload() supportmessages.PaymentRequests { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - // response payload - if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsBadRequest creates a ProcessReviewedPaymentRequestsBadRequest with default headers values -func NewProcessReviewedPaymentRequestsBadRequest() *ProcessReviewedPaymentRequestsBadRequest { - return &ProcessReviewedPaymentRequestsBadRequest{} -} - -/* -ProcessReviewedPaymentRequestsBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type ProcessReviewedPaymentRequestsBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this process reviewed payment requests bad request response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests bad request response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests bad request response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this process reviewed payment requests bad request response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests bad request response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the process reviewed payment requests bad request response -func (o *ProcessReviewedPaymentRequestsBadRequest) Code() int { - return 400 -} - -func (o *ProcessReviewedPaymentRequestsBadRequest) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsBadRequest %+v", 400, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsBadRequest) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsBadRequest %+v", 400, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsUnauthorized creates a ProcessReviewedPaymentRequestsUnauthorized with default headers values -func NewProcessReviewedPaymentRequestsUnauthorized() *ProcessReviewedPaymentRequestsUnauthorized { - return &ProcessReviewedPaymentRequestsUnauthorized{} -} - -/* -ProcessReviewedPaymentRequestsUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type ProcessReviewedPaymentRequestsUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this process reviewed payment requests unauthorized response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests unauthorized response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests unauthorized response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this process reviewed payment requests unauthorized response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests unauthorized response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the process reviewed payment requests unauthorized response -func (o *ProcessReviewedPaymentRequestsUnauthorized) Code() int { - return 401 -} - -func (o *ProcessReviewedPaymentRequestsUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnauthorized %+v", 401, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsUnauthorized) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnauthorized %+v", 401, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsForbidden creates a ProcessReviewedPaymentRequestsForbidden with default headers values -func NewProcessReviewedPaymentRequestsForbidden() *ProcessReviewedPaymentRequestsForbidden { - return &ProcessReviewedPaymentRequestsForbidden{} -} - -/* -ProcessReviewedPaymentRequestsForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type ProcessReviewedPaymentRequestsForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this process reviewed payment requests forbidden response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests forbidden response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests forbidden response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this process reviewed payment requests forbidden response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests forbidden response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the process reviewed payment requests forbidden response -func (o *ProcessReviewedPaymentRequestsForbidden) Code() int { - return 403 -} - -func (o *ProcessReviewedPaymentRequestsForbidden) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsForbidden %+v", 403, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsForbidden) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsForbidden %+v", 403, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsNotFound creates a ProcessReviewedPaymentRequestsNotFound with default headers values -func NewProcessReviewedPaymentRequestsNotFound() *ProcessReviewedPaymentRequestsNotFound { - return &ProcessReviewedPaymentRequestsNotFound{} -} - -/* -ProcessReviewedPaymentRequestsNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type ProcessReviewedPaymentRequestsNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this process reviewed payment requests not found response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests not found response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests not found response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this process reviewed payment requests not found response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests not found response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the process reviewed payment requests not found response -func (o *ProcessReviewedPaymentRequestsNotFound) Code() int { - return 404 -} - -func (o *ProcessReviewedPaymentRequestsNotFound) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsNotFound %+v", 404, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsNotFound) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsNotFound %+v", 404, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsUnprocessableEntity creates a ProcessReviewedPaymentRequestsUnprocessableEntity with default headers values -func NewProcessReviewedPaymentRequestsUnprocessableEntity() *ProcessReviewedPaymentRequestsUnprocessableEntity { - return &ProcessReviewedPaymentRequestsUnprocessableEntity{} -} - -/* -ProcessReviewedPaymentRequestsUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type ProcessReviewedPaymentRequestsUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this process reviewed payment requests unprocessable entity response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests unprocessable entity response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests unprocessable entity response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this process reviewed payment requests unprocessable entity response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this process reviewed payment requests unprocessable entity response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the process reviewed payment requests unprocessable entity response -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) Code() int { - return 422 -} - -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewProcessReviewedPaymentRequestsInternalServerError creates a ProcessReviewedPaymentRequestsInternalServerError with default headers values -func NewProcessReviewedPaymentRequestsInternalServerError() *ProcessReviewedPaymentRequestsInternalServerError { - return &ProcessReviewedPaymentRequestsInternalServerError{} -} - -/* -ProcessReviewedPaymentRequestsInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type ProcessReviewedPaymentRequestsInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this process reviewed payment requests internal server error response has a 2xx status code -func (o *ProcessReviewedPaymentRequestsInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this process reviewed payment requests internal server error response has a 3xx status code -func (o *ProcessReviewedPaymentRequestsInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this process reviewed payment requests internal server error response has a 4xx status code -func (o *ProcessReviewedPaymentRequestsInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this process reviewed payment requests internal server error response has a 5xx status code -func (o *ProcessReviewedPaymentRequestsInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this process reviewed payment requests internal server error response a status code equal to that given -func (o *ProcessReviewedPaymentRequestsInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the process reviewed payment requests internal server error response -func (o *ProcessReviewedPaymentRequestsInternalServerError) Code() int { - return 500 -} - -func (o *ProcessReviewedPaymentRequestsInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsInternalServerError %+v", 500, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsInternalServerError) String() string { - return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsInternalServerError %+v", 500, o.Payload) -} - -func (o *ProcessReviewedPaymentRequestsInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *ProcessReviewedPaymentRequestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go b/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go deleted file mode 100644 index a6660aa968f..00000000000 --- a/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" -) - -// NewRecalculatePaymentRequestParams creates a new RecalculatePaymentRequestParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewRecalculatePaymentRequestParams() *RecalculatePaymentRequestParams { - return &RecalculatePaymentRequestParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewRecalculatePaymentRequestParamsWithTimeout creates a new RecalculatePaymentRequestParams object -// with the ability to set a timeout on a request. -func NewRecalculatePaymentRequestParamsWithTimeout(timeout time.Duration) *RecalculatePaymentRequestParams { - return &RecalculatePaymentRequestParams{ - timeout: timeout, - } -} - -// NewRecalculatePaymentRequestParamsWithContext creates a new RecalculatePaymentRequestParams object -// with the ability to set a context for a request. -func NewRecalculatePaymentRequestParamsWithContext(ctx context.Context) *RecalculatePaymentRequestParams { - return &RecalculatePaymentRequestParams{ - Context: ctx, - } -} - -// NewRecalculatePaymentRequestParamsWithHTTPClient creates a new RecalculatePaymentRequestParams object -// with the ability to set a custom HTTPClient for a request. -func NewRecalculatePaymentRequestParamsWithHTTPClient(client *http.Client) *RecalculatePaymentRequestParams { - return &RecalculatePaymentRequestParams{ - HTTPClient: client, - } -} - -/* -RecalculatePaymentRequestParams contains all the parameters to send to the API endpoint - - for the recalculate payment request operation. - - Typically these are written to a http.Request. -*/ -type RecalculatePaymentRequestParams struct { - - /* PaymentRequestID. - - UUID of the payment request to recalculate. - - Format: uuid - */ - PaymentRequestID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the recalculate payment request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RecalculatePaymentRequestParams) WithDefaults() *RecalculatePaymentRequestParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the recalculate payment request params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *RecalculatePaymentRequestParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) WithTimeout(timeout time.Duration) *RecalculatePaymentRequestParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) WithContext(ctx context.Context) *RecalculatePaymentRequestParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) WithHTTPClient(client *http.Client) *RecalculatePaymentRequestParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithPaymentRequestID adds the paymentRequestID to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *RecalculatePaymentRequestParams { - o.SetPaymentRequestID(paymentRequestID) - return o -} - -// SetPaymentRequestID adds the paymentRequestId to the recalculate payment request params -func (o *RecalculatePaymentRequestParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { - o.PaymentRequestID = paymentRequestID -} - -// WriteToRequest writes these params to a swagger request -func (o *RecalculatePaymentRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // path param paymentRequestID - if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go b/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go deleted file mode 100644 index b604df58365..00000000000 --- a/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// RecalculatePaymentRequestReader is a Reader for the RecalculatePaymentRequest structure. -type RecalculatePaymentRequestReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *RecalculatePaymentRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewRecalculatePaymentRequestCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewRecalculatePaymentRequestBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewRecalculatePaymentRequestUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewRecalculatePaymentRequestForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewRecalculatePaymentRequestNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewRecalculatePaymentRequestConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewRecalculatePaymentRequestPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewRecalculatePaymentRequestUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewRecalculatePaymentRequestInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /payment-requests/{paymentRequestID}/recalculate] recalculatePaymentRequest", response, response.Code()) - } -} - -// NewRecalculatePaymentRequestCreated creates a RecalculatePaymentRequestCreated with default headers values -func NewRecalculatePaymentRequestCreated() *RecalculatePaymentRequestCreated { - return &RecalculatePaymentRequestCreated{} -} - -/* -RecalculatePaymentRequestCreated describes a response with status code 201, with default header values. - -The new payment request with recalculated pricing. -*/ -type RecalculatePaymentRequestCreated struct { - Payload *supportmessages.PaymentRequest -} - -// IsSuccess returns true when this recalculate payment request created response has a 2xx status code -func (o *RecalculatePaymentRequestCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this recalculate payment request created response has a 3xx status code -func (o *RecalculatePaymentRequestCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request created response has a 4xx status code -func (o *RecalculatePaymentRequestCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this recalculate payment request created response has a 5xx status code -func (o *RecalculatePaymentRequestCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request created response a status code equal to that given -func (o *RecalculatePaymentRequestCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the recalculate payment request created response -func (o *RecalculatePaymentRequestCreated) Code() int { - return 201 -} - -func (o *RecalculatePaymentRequestCreated) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestCreated %+v", 201, o.Payload) -} - -func (o *RecalculatePaymentRequestCreated) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestCreated %+v", 201, o.Payload) -} - -func (o *RecalculatePaymentRequestCreated) GetPayload() *supportmessages.PaymentRequest { - return o.Payload -} - -func (o *RecalculatePaymentRequestCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.PaymentRequest) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestBadRequest creates a RecalculatePaymentRequestBadRequest with default headers values -func NewRecalculatePaymentRequestBadRequest() *RecalculatePaymentRequestBadRequest { - return &RecalculatePaymentRequestBadRequest{} -} - -/* -RecalculatePaymentRequestBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type RecalculatePaymentRequestBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request bad request response has a 2xx status code -func (o *RecalculatePaymentRequestBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request bad request response has a 3xx status code -func (o *RecalculatePaymentRequestBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request bad request response has a 4xx status code -func (o *RecalculatePaymentRequestBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request bad request response has a 5xx status code -func (o *RecalculatePaymentRequestBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request bad request response a status code equal to that given -func (o *RecalculatePaymentRequestBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the recalculate payment request bad request response -func (o *RecalculatePaymentRequestBadRequest) Code() int { - return 400 -} - -func (o *RecalculatePaymentRequestBadRequest) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestBadRequest %+v", 400, o.Payload) -} - -func (o *RecalculatePaymentRequestBadRequest) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestBadRequest %+v", 400, o.Payload) -} - -func (o *RecalculatePaymentRequestBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestUnauthorized creates a RecalculatePaymentRequestUnauthorized with default headers values -func NewRecalculatePaymentRequestUnauthorized() *RecalculatePaymentRequestUnauthorized { - return &RecalculatePaymentRequestUnauthorized{} -} - -/* -RecalculatePaymentRequestUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type RecalculatePaymentRequestUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request unauthorized response has a 2xx status code -func (o *RecalculatePaymentRequestUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request unauthorized response has a 3xx status code -func (o *RecalculatePaymentRequestUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request unauthorized response has a 4xx status code -func (o *RecalculatePaymentRequestUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request unauthorized response has a 5xx status code -func (o *RecalculatePaymentRequestUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request unauthorized response a status code equal to that given -func (o *RecalculatePaymentRequestUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the recalculate payment request unauthorized response -func (o *RecalculatePaymentRequestUnauthorized) Code() int { - return 401 -} - -func (o *RecalculatePaymentRequestUnauthorized) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnauthorized %+v", 401, o.Payload) -} - -func (o *RecalculatePaymentRequestUnauthorized) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnauthorized %+v", 401, o.Payload) -} - -func (o *RecalculatePaymentRequestUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestForbidden creates a RecalculatePaymentRequestForbidden with default headers values -func NewRecalculatePaymentRequestForbidden() *RecalculatePaymentRequestForbidden { - return &RecalculatePaymentRequestForbidden{} -} - -/* -RecalculatePaymentRequestForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type RecalculatePaymentRequestForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request forbidden response has a 2xx status code -func (o *RecalculatePaymentRequestForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request forbidden response has a 3xx status code -func (o *RecalculatePaymentRequestForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request forbidden response has a 4xx status code -func (o *RecalculatePaymentRequestForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request forbidden response has a 5xx status code -func (o *RecalculatePaymentRequestForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request forbidden response a status code equal to that given -func (o *RecalculatePaymentRequestForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the recalculate payment request forbidden response -func (o *RecalculatePaymentRequestForbidden) Code() int { - return 403 -} - -func (o *RecalculatePaymentRequestForbidden) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestForbidden %+v", 403, o.Payload) -} - -func (o *RecalculatePaymentRequestForbidden) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestForbidden %+v", 403, o.Payload) -} - -func (o *RecalculatePaymentRequestForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestNotFound creates a RecalculatePaymentRequestNotFound with default headers values -func NewRecalculatePaymentRequestNotFound() *RecalculatePaymentRequestNotFound { - return &RecalculatePaymentRequestNotFound{} -} - -/* -RecalculatePaymentRequestNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type RecalculatePaymentRequestNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request not found response has a 2xx status code -func (o *RecalculatePaymentRequestNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request not found response has a 3xx status code -func (o *RecalculatePaymentRequestNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request not found response has a 4xx status code -func (o *RecalculatePaymentRequestNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request not found response has a 5xx status code -func (o *RecalculatePaymentRequestNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request not found response a status code equal to that given -func (o *RecalculatePaymentRequestNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the recalculate payment request not found response -func (o *RecalculatePaymentRequestNotFound) Code() int { - return 404 -} - -func (o *RecalculatePaymentRequestNotFound) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestNotFound %+v", 404, o.Payload) -} - -func (o *RecalculatePaymentRequestNotFound) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestNotFound %+v", 404, o.Payload) -} - -func (o *RecalculatePaymentRequestNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestConflict creates a RecalculatePaymentRequestConflict with default headers values -func NewRecalculatePaymentRequestConflict() *RecalculatePaymentRequestConflict { - return &RecalculatePaymentRequestConflict{} -} - -/* -RecalculatePaymentRequestConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type RecalculatePaymentRequestConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request conflict response has a 2xx status code -func (o *RecalculatePaymentRequestConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request conflict response has a 3xx status code -func (o *RecalculatePaymentRequestConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request conflict response has a 4xx status code -func (o *RecalculatePaymentRequestConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request conflict response has a 5xx status code -func (o *RecalculatePaymentRequestConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request conflict response a status code equal to that given -func (o *RecalculatePaymentRequestConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the recalculate payment request conflict response -func (o *RecalculatePaymentRequestConflict) Code() int { - return 409 -} - -func (o *RecalculatePaymentRequestConflict) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestConflict %+v", 409, o.Payload) -} - -func (o *RecalculatePaymentRequestConflict) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestConflict %+v", 409, o.Payload) -} - -func (o *RecalculatePaymentRequestConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestPreconditionFailed creates a RecalculatePaymentRequestPreconditionFailed with default headers values -func NewRecalculatePaymentRequestPreconditionFailed() *RecalculatePaymentRequestPreconditionFailed { - return &RecalculatePaymentRequestPreconditionFailed{} -} - -/* -RecalculatePaymentRequestPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type RecalculatePaymentRequestPreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this recalculate payment request precondition failed response has a 2xx status code -func (o *RecalculatePaymentRequestPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request precondition failed response has a 3xx status code -func (o *RecalculatePaymentRequestPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request precondition failed response has a 4xx status code -func (o *RecalculatePaymentRequestPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request precondition failed response has a 5xx status code -func (o *RecalculatePaymentRequestPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request precondition failed response a status code equal to that given -func (o *RecalculatePaymentRequestPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the recalculate payment request precondition failed response -func (o *RecalculatePaymentRequestPreconditionFailed) Code() int { - return 412 -} - -func (o *RecalculatePaymentRequestPreconditionFailed) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestPreconditionFailed %+v", 412, o.Payload) -} - -func (o *RecalculatePaymentRequestPreconditionFailed) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestPreconditionFailed %+v", 412, o.Payload) -} - -func (o *RecalculatePaymentRequestPreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *RecalculatePaymentRequestPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestUnprocessableEntity creates a RecalculatePaymentRequestUnprocessableEntity with default headers values -func NewRecalculatePaymentRequestUnprocessableEntity() *RecalculatePaymentRequestUnprocessableEntity { - return &RecalculatePaymentRequestUnprocessableEntity{} -} - -/* -RecalculatePaymentRequestUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type RecalculatePaymentRequestUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this recalculate payment request unprocessable entity response has a 2xx status code -func (o *RecalculatePaymentRequestUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request unprocessable entity response has a 3xx status code -func (o *RecalculatePaymentRequestUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request unprocessable entity response has a 4xx status code -func (o *RecalculatePaymentRequestUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this recalculate payment request unprocessable entity response has a 5xx status code -func (o *RecalculatePaymentRequestUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this recalculate payment request unprocessable entity response a status code equal to that given -func (o *RecalculatePaymentRequestUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the recalculate payment request unprocessable entity response -func (o *RecalculatePaymentRequestUnprocessableEntity) Code() int { - return 422 -} - -func (o *RecalculatePaymentRequestUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *RecalculatePaymentRequestUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *RecalculatePaymentRequestUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *RecalculatePaymentRequestUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewRecalculatePaymentRequestInternalServerError creates a RecalculatePaymentRequestInternalServerError with default headers values -func NewRecalculatePaymentRequestInternalServerError() *RecalculatePaymentRequestInternalServerError { - return &RecalculatePaymentRequestInternalServerError{} -} - -/* -RecalculatePaymentRequestInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type RecalculatePaymentRequestInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this recalculate payment request internal server error response has a 2xx status code -func (o *RecalculatePaymentRequestInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this recalculate payment request internal server error response has a 3xx status code -func (o *RecalculatePaymentRequestInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this recalculate payment request internal server error response has a 4xx status code -func (o *RecalculatePaymentRequestInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this recalculate payment request internal server error response has a 5xx status code -func (o *RecalculatePaymentRequestInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this recalculate payment request internal server error response a status code equal to that given -func (o *RecalculatePaymentRequestInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the recalculate payment request internal server error response -func (o *RecalculatePaymentRequestInternalServerError) Code() int { - return 500 -} - -func (o *RecalculatePaymentRequestInternalServerError) Error() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestInternalServerError %+v", 500, o.Payload) -} - -func (o *RecalculatePaymentRequestInternalServerError) String() string { - return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestInternalServerError %+v", 500, o.Payload) -} - -func (o *RecalculatePaymentRequestInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *RecalculatePaymentRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go b/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go deleted file mode 100644 index 0f91c418a23..00000000000 --- a/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go +++ /dev/null @@ -1,197 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewUpdatePaymentRequestStatusParams() *UpdatePaymentRequestStatusParams { - return &UpdatePaymentRequestStatusParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewUpdatePaymentRequestStatusParamsWithTimeout creates a new UpdatePaymentRequestStatusParams object -// with the ability to set a timeout on a request. -func NewUpdatePaymentRequestStatusParamsWithTimeout(timeout time.Duration) *UpdatePaymentRequestStatusParams { - return &UpdatePaymentRequestStatusParams{ - timeout: timeout, - } -} - -// NewUpdatePaymentRequestStatusParamsWithContext creates a new UpdatePaymentRequestStatusParams object -// with the ability to set a context for a request. -func NewUpdatePaymentRequestStatusParamsWithContext(ctx context.Context) *UpdatePaymentRequestStatusParams { - return &UpdatePaymentRequestStatusParams{ - Context: ctx, - } -} - -// NewUpdatePaymentRequestStatusParamsWithHTTPClient creates a new UpdatePaymentRequestStatusParams object -// with the ability to set a custom HTTPClient for a request. -func NewUpdatePaymentRequestStatusParamsWithHTTPClient(client *http.Client) *UpdatePaymentRequestStatusParams { - return &UpdatePaymentRequestStatusParams{ - HTTPClient: client, - } -} - -/* -UpdatePaymentRequestStatusParams contains all the parameters to send to the API endpoint - - for the update payment request status operation. - - Typically these are written to a http.Request. -*/ -type UpdatePaymentRequestStatusParams struct { - - /* IfMatch. - - Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. - - */ - IfMatch string - - // Body. - Body *supportmessages.UpdatePaymentRequestStatus - - /* PaymentRequestID. - - UUID of payment request. - - Format: uuid - */ - PaymentRequestID strfmt.UUID - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the update payment request status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdatePaymentRequestStatusParams) WithDefaults() *UpdatePaymentRequestStatusParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the update payment request status params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *UpdatePaymentRequestStatusParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithTimeout(timeout time.Duration) *UpdatePaymentRequestStatusParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithContext(ctx context.Context) *UpdatePaymentRequestStatusParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithHTTPClient(client *http.Client) *UpdatePaymentRequestStatusParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithIfMatch adds the ifMatch to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithIfMatch(ifMatch string) *UpdatePaymentRequestStatusParams { - o.SetIfMatch(ifMatch) - return o -} - -// SetIfMatch adds the ifMatch to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetIfMatch(ifMatch string) { - o.IfMatch = ifMatch -} - -// WithBody adds the body to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithBody(body *supportmessages.UpdatePaymentRequestStatus) *UpdatePaymentRequestStatusParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetBody(body *supportmessages.UpdatePaymentRequestStatus) { - o.Body = body -} - -// WithPaymentRequestID adds the paymentRequestID to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *UpdatePaymentRequestStatusParams { - o.SetPaymentRequestID(paymentRequestID) - return o -} - -// SetPaymentRequestID adds the paymentRequestId to the update payment request status params -func (o *UpdatePaymentRequestStatusParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { - o.PaymentRequestID = paymentRequestID -} - -// WriteToRequest writes these params to a swagger request -func (o *UpdatePaymentRequestStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - - // header param If-Match - if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { - return err - } - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - // path param paymentRequestID - if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go b/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go deleted file mode 100644 index a6b142179ac..00000000000 --- a/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go +++ /dev/null @@ -1,695 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package payment_request - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// UpdatePaymentRequestStatusReader is a Reader for the UpdatePaymentRequestStatus structure. -type UpdatePaymentRequestStatusReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *UpdatePaymentRequestStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewUpdatePaymentRequestStatusOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewUpdatePaymentRequestStatusBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewUpdatePaymentRequestStatusUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewUpdatePaymentRequestStatusForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 404: - result := NewUpdatePaymentRequestStatusNotFound() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 409: - result := NewUpdatePaymentRequestStatusConflict() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 412: - result := NewUpdatePaymentRequestStatusPreconditionFailed() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 422: - result := NewUpdatePaymentRequestStatusUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewUpdatePaymentRequestStatusInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[PATCH /payment-requests/{paymentRequestID}/status] updatePaymentRequestStatus", response, response.Code()) - } -} - -// NewUpdatePaymentRequestStatusOK creates a UpdatePaymentRequestStatusOK with default headers values -func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { - return &UpdatePaymentRequestStatusOK{} -} - -/* -UpdatePaymentRequestStatusOK describes a response with status code 200, with default header values. - -Successfully updated payment request status. -*/ -type UpdatePaymentRequestStatusOK struct { - Payload *supportmessages.PaymentRequest -} - -// IsSuccess returns true when this update payment request status o k response has a 2xx status code -func (o *UpdatePaymentRequestStatusOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this update payment request status o k response has a 3xx status code -func (o *UpdatePaymentRequestStatusOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status o k response has a 4xx status code -func (o *UpdatePaymentRequestStatusOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this update payment request status o k response has a 5xx status code -func (o *UpdatePaymentRequestStatusOK) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status o k response a status code equal to that given -func (o *UpdatePaymentRequestStatusOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the update payment request status o k response -func (o *UpdatePaymentRequestStatusOK) Code() int { - return 200 -} - -func (o *UpdatePaymentRequestStatusOK) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusOK %+v", 200, o.Payload) -} - -func (o *UpdatePaymentRequestStatusOK) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusOK %+v", 200, o.Payload) -} - -func (o *UpdatePaymentRequestStatusOK) GetPayload() *supportmessages.PaymentRequest { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.PaymentRequest) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusBadRequest creates a UpdatePaymentRequestStatusBadRequest with default headers values -func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { - return &UpdatePaymentRequestStatusBadRequest{} -} - -/* -UpdatePaymentRequestStatusBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type UpdatePaymentRequestStatusBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status bad request response has a 2xx status code -func (o *UpdatePaymentRequestStatusBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status bad request response has a 3xx status code -func (o *UpdatePaymentRequestStatusBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status bad request response has a 4xx status code -func (o *UpdatePaymentRequestStatusBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status bad request response has a 5xx status code -func (o *UpdatePaymentRequestStatusBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status bad request response a status code equal to that given -func (o *UpdatePaymentRequestStatusBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the update payment request status bad request response -func (o *UpdatePaymentRequestStatusBadRequest) Code() int { - return 400 -} - -func (o *UpdatePaymentRequestStatusBadRequest) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdatePaymentRequestStatusBadRequest) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusBadRequest %+v", 400, o.Payload) -} - -func (o *UpdatePaymentRequestStatusBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusUnauthorized creates a UpdatePaymentRequestStatusUnauthorized with default headers values -func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { - return &UpdatePaymentRequestStatusUnauthorized{} -} - -/* -UpdatePaymentRequestStatusUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type UpdatePaymentRequestStatusUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status unauthorized response has a 2xx status code -func (o *UpdatePaymentRequestStatusUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status unauthorized response has a 3xx status code -func (o *UpdatePaymentRequestStatusUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status unauthorized response has a 4xx status code -func (o *UpdatePaymentRequestStatusUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status unauthorized response has a 5xx status code -func (o *UpdatePaymentRequestStatusUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status unauthorized response a status code equal to that given -func (o *UpdatePaymentRequestStatusUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the update payment request status unauthorized response -func (o *UpdatePaymentRequestStatusUnauthorized) Code() int { - return 401 -} - -func (o *UpdatePaymentRequestStatusUnauthorized) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdatePaymentRequestStatusUnauthorized) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnauthorized %+v", 401, o.Payload) -} - -func (o *UpdatePaymentRequestStatusUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusForbidden creates a UpdatePaymentRequestStatusForbidden with default headers values -func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { - return &UpdatePaymentRequestStatusForbidden{} -} - -/* -UpdatePaymentRequestStatusForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type UpdatePaymentRequestStatusForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status forbidden response has a 2xx status code -func (o *UpdatePaymentRequestStatusForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status forbidden response has a 3xx status code -func (o *UpdatePaymentRequestStatusForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status forbidden response has a 4xx status code -func (o *UpdatePaymentRequestStatusForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status forbidden response has a 5xx status code -func (o *UpdatePaymentRequestStatusForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status forbidden response a status code equal to that given -func (o *UpdatePaymentRequestStatusForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the update payment request status forbidden response -func (o *UpdatePaymentRequestStatusForbidden) Code() int { - return 403 -} - -func (o *UpdatePaymentRequestStatusForbidden) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdatePaymentRequestStatusForbidden) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusForbidden %+v", 403, o.Payload) -} - -func (o *UpdatePaymentRequestStatusForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusNotFound creates a UpdatePaymentRequestStatusNotFound with default headers values -func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { - return &UpdatePaymentRequestStatusNotFound{} -} - -/* -UpdatePaymentRequestStatusNotFound describes a response with status code 404, with default header values. - -The requested resource wasn't found. -*/ -type UpdatePaymentRequestStatusNotFound struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status not found response has a 2xx status code -func (o *UpdatePaymentRequestStatusNotFound) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status not found response has a 3xx status code -func (o *UpdatePaymentRequestStatusNotFound) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status not found response has a 4xx status code -func (o *UpdatePaymentRequestStatusNotFound) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status not found response has a 5xx status code -func (o *UpdatePaymentRequestStatusNotFound) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status not found response a status code equal to that given -func (o *UpdatePaymentRequestStatusNotFound) IsCode(code int) bool { - return code == 404 -} - -// Code gets the status code for the update payment request status not found response -func (o *UpdatePaymentRequestStatusNotFound) Code() int { - return 404 -} - -func (o *UpdatePaymentRequestStatusNotFound) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdatePaymentRequestStatusNotFound) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusNotFound %+v", 404, o.Payload) -} - -func (o *UpdatePaymentRequestStatusNotFound) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusConflict creates a UpdatePaymentRequestStatusConflict with default headers values -func NewUpdatePaymentRequestStatusConflict() *UpdatePaymentRequestStatusConflict { - return &UpdatePaymentRequestStatusConflict{} -} - -/* -UpdatePaymentRequestStatusConflict describes a response with status code 409, with default header values. - -There was a conflict with the request. -*/ -type UpdatePaymentRequestStatusConflict struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status conflict response has a 2xx status code -func (o *UpdatePaymentRequestStatusConflict) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status conflict response has a 3xx status code -func (o *UpdatePaymentRequestStatusConflict) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status conflict response has a 4xx status code -func (o *UpdatePaymentRequestStatusConflict) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status conflict response has a 5xx status code -func (o *UpdatePaymentRequestStatusConflict) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status conflict response a status code equal to that given -func (o *UpdatePaymentRequestStatusConflict) IsCode(code int) bool { - return code == 409 -} - -// Code gets the status code for the update payment request status conflict response -func (o *UpdatePaymentRequestStatusConflict) Code() int { - return 409 -} - -func (o *UpdatePaymentRequestStatusConflict) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdatePaymentRequestStatusConflict) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusConflict %+v", 409, o.Payload) -} - -func (o *UpdatePaymentRequestStatusConflict) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusPreconditionFailed creates a UpdatePaymentRequestStatusPreconditionFailed with default headers values -func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { - return &UpdatePaymentRequestStatusPreconditionFailed{} -} - -/* -UpdatePaymentRequestStatusPreconditionFailed describes a response with status code 412, with default header values. - -Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. -*/ -type UpdatePaymentRequestStatusPreconditionFailed struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this update payment request status precondition failed response has a 2xx status code -func (o *UpdatePaymentRequestStatusPreconditionFailed) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status precondition failed response has a 3xx status code -func (o *UpdatePaymentRequestStatusPreconditionFailed) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status precondition failed response has a 4xx status code -func (o *UpdatePaymentRequestStatusPreconditionFailed) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status precondition failed response has a 5xx status code -func (o *UpdatePaymentRequestStatusPreconditionFailed) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status precondition failed response a status code equal to that given -func (o *UpdatePaymentRequestStatusPreconditionFailed) IsCode(code int) bool { - return code == 412 -} - -// Code gets the status code for the update payment request status precondition failed response -func (o *UpdatePaymentRequestStatusPreconditionFailed) Code() int { - return 412 -} - -func (o *UpdatePaymentRequestStatusPreconditionFailed) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdatePaymentRequestStatusPreconditionFailed) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusPreconditionFailed %+v", 412, o.Payload) -} - -func (o *UpdatePaymentRequestStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusUnprocessableEntity creates a UpdatePaymentRequestStatusUnprocessableEntity with default headers values -func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { - return &UpdatePaymentRequestStatusUnprocessableEntity{} -} - -/* -UpdatePaymentRequestStatusUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type UpdatePaymentRequestStatusUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this update payment request status unprocessable entity response has a 2xx status code -func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status unprocessable entity response has a 3xx status code -func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status unprocessable entity response has a 4xx status code -func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this update payment request status unprocessable entity response has a 5xx status code -func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this update payment request status unprocessable entity response a status code equal to that given -func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the update payment request status unprocessable entity response -func (o *UpdatePaymentRequestStatusUnprocessableEntity) Code() int { - return 422 -} - -func (o *UpdatePaymentRequestStatusUnprocessableEntity) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdatePaymentRequestStatusUnprocessableEntity) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *UpdatePaymentRequestStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewUpdatePaymentRequestStatusInternalServerError creates a UpdatePaymentRequestStatusInternalServerError with default headers values -func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { - return &UpdatePaymentRequestStatusInternalServerError{} -} - -/* -UpdatePaymentRequestStatusInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type UpdatePaymentRequestStatusInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this update payment request status internal server error response has a 2xx status code -func (o *UpdatePaymentRequestStatusInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this update payment request status internal server error response has a 3xx status code -func (o *UpdatePaymentRequestStatusInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this update payment request status internal server error response has a 4xx status code -func (o *UpdatePaymentRequestStatusInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this update payment request status internal server error response has a 5xx status code -func (o *UpdatePaymentRequestStatusInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this update payment request status internal server error response a status code equal to that given -func (o *UpdatePaymentRequestStatusInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the update payment request status internal server error response -func (o *UpdatePaymentRequestStatusInternalServerError) Code() int { - return 500 -} - -func (o *UpdatePaymentRequestStatusInternalServerError) Error() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdatePaymentRequestStatusInternalServerError) String() string { - return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusInternalServerError %+v", 500, o.Payload) -} - -func (o *UpdatePaymentRequestStatusInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *UpdatePaymentRequestStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go b/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go deleted file mode 100644 index 9b4ee14ea55..00000000000 --- a/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewCreateWebhookNotificationParams creates a new CreateWebhookNotificationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewCreateWebhookNotificationParams() *CreateWebhookNotificationParams { - return &CreateWebhookNotificationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewCreateWebhookNotificationParamsWithTimeout creates a new CreateWebhookNotificationParams object -// with the ability to set a timeout on a request. -func NewCreateWebhookNotificationParamsWithTimeout(timeout time.Duration) *CreateWebhookNotificationParams { - return &CreateWebhookNotificationParams{ - timeout: timeout, - } -} - -// NewCreateWebhookNotificationParamsWithContext creates a new CreateWebhookNotificationParams object -// with the ability to set a context for a request. -func NewCreateWebhookNotificationParamsWithContext(ctx context.Context) *CreateWebhookNotificationParams { - return &CreateWebhookNotificationParams{ - Context: ctx, - } -} - -// NewCreateWebhookNotificationParamsWithHTTPClient creates a new CreateWebhookNotificationParams object -// with the ability to set a custom HTTPClient for a request. -func NewCreateWebhookNotificationParamsWithHTTPClient(client *http.Client) *CreateWebhookNotificationParams { - return &CreateWebhookNotificationParams{ - HTTPClient: client, - } -} - -/* -CreateWebhookNotificationParams contains all the parameters to send to the API endpoint - - for the create webhook notification operation. - - Typically these are written to a http.Request. -*/ -type CreateWebhookNotificationParams struct { - - /* Body. - - The notification sent by webhook-client. - */ - Body *supportmessages.WebhookNotification - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the create webhook notification params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateWebhookNotificationParams) WithDefaults() *CreateWebhookNotificationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the create webhook notification params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *CreateWebhookNotificationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the create webhook notification params -func (o *CreateWebhookNotificationParams) WithTimeout(timeout time.Duration) *CreateWebhookNotificationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the create webhook notification params -func (o *CreateWebhookNotificationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the create webhook notification params -func (o *CreateWebhookNotificationParams) WithContext(ctx context.Context) *CreateWebhookNotificationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the create webhook notification params -func (o *CreateWebhookNotificationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the create webhook notification params -func (o *CreateWebhookNotificationParams) WithHTTPClient(client *http.Client) *CreateWebhookNotificationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the create webhook notification params -func (o *CreateWebhookNotificationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the create webhook notification params -func (o *CreateWebhookNotificationParams) WithBody(body *supportmessages.WebhookNotification) *CreateWebhookNotificationParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the create webhook notification params -func (o *CreateWebhookNotificationParams) SetBody(body *supportmessages.WebhookNotification) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *CreateWebhookNotificationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go b/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go deleted file mode 100644 index c12b9427076..00000000000 --- a/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go +++ /dev/null @@ -1,251 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// CreateWebhookNotificationReader is a Reader for the CreateWebhookNotification structure. -type CreateWebhookNotificationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *CreateWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 201: - result := NewCreateWebhookNotificationCreated() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 422: - result := NewCreateWebhookNotificationUnprocessableEntity() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewCreateWebhookNotificationInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /webhook-notifications] createWebhookNotification", response, response.Code()) - } -} - -// NewCreateWebhookNotificationCreated creates a CreateWebhookNotificationCreated with default headers values -func NewCreateWebhookNotificationCreated() *CreateWebhookNotificationCreated { - return &CreateWebhookNotificationCreated{} -} - -/* -CreateWebhookNotificationCreated describes a response with status code 201, with default header values. - -Successful creation -*/ -type CreateWebhookNotificationCreated struct { - Payload *supportmessages.WebhookNotification -} - -// IsSuccess returns true when this create webhook notification created response has a 2xx status code -func (o *CreateWebhookNotificationCreated) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this create webhook notification created response has a 3xx status code -func (o *CreateWebhookNotificationCreated) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create webhook notification created response has a 4xx status code -func (o *CreateWebhookNotificationCreated) IsClientError() bool { - return false -} - -// IsServerError returns true when this create webhook notification created response has a 5xx status code -func (o *CreateWebhookNotificationCreated) IsServerError() bool { - return false -} - -// IsCode returns true when this create webhook notification created response a status code equal to that given -func (o *CreateWebhookNotificationCreated) IsCode(code int) bool { - return code == 201 -} - -// Code gets the status code for the create webhook notification created response -func (o *CreateWebhookNotificationCreated) Code() int { - return 201 -} - -func (o *CreateWebhookNotificationCreated) Error() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationCreated %+v", 201, o.Payload) -} - -func (o *CreateWebhookNotificationCreated) String() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationCreated %+v", 201, o.Payload) -} - -func (o *CreateWebhookNotificationCreated) GetPayload() *supportmessages.WebhookNotification { - return o.Payload -} - -func (o *CreateWebhookNotificationCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.WebhookNotification) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateWebhookNotificationUnprocessableEntity creates a CreateWebhookNotificationUnprocessableEntity with default headers values -func NewCreateWebhookNotificationUnprocessableEntity() *CreateWebhookNotificationUnprocessableEntity { - return &CreateWebhookNotificationUnprocessableEntity{} -} - -/* -CreateWebhookNotificationUnprocessableEntity describes a response with status code 422, with default header values. - -The payload was unprocessable. -*/ -type CreateWebhookNotificationUnprocessableEntity struct { - Payload *supportmessages.ValidationError -} - -// IsSuccess returns true when this create webhook notification unprocessable entity response has a 2xx status code -func (o *CreateWebhookNotificationUnprocessableEntity) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create webhook notification unprocessable entity response has a 3xx status code -func (o *CreateWebhookNotificationUnprocessableEntity) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create webhook notification unprocessable entity response has a 4xx status code -func (o *CreateWebhookNotificationUnprocessableEntity) IsClientError() bool { - return true -} - -// IsServerError returns true when this create webhook notification unprocessable entity response has a 5xx status code -func (o *CreateWebhookNotificationUnprocessableEntity) IsServerError() bool { - return false -} - -// IsCode returns true when this create webhook notification unprocessable entity response a status code equal to that given -func (o *CreateWebhookNotificationUnprocessableEntity) IsCode(code int) bool { - return code == 422 -} - -// Code gets the status code for the create webhook notification unprocessable entity response -func (o *CreateWebhookNotificationUnprocessableEntity) Code() int { - return 422 -} - -func (o *CreateWebhookNotificationUnprocessableEntity) Error() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateWebhookNotificationUnprocessableEntity) String() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationUnprocessableEntity %+v", 422, o.Payload) -} - -func (o *CreateWebhookNotificationUnprocessableEntity) GetPayload() *supportmessages.ValidationError { - return o.Payload -} - -func (o *CreateWebhookNotificationUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ValidationError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewCreateWebhookNotificationInternalServerError creates a CreateWebhookNotificationInternalServerError with default headers values -func NewCreateWebhookNotificationInternalServerError() *CreateWebhookNotificationInternalServerError { - return &CreateWebhookNotificationInternalServerError{} -} - -/* -CreateWebhookNotificationInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type CreateWebhookNotificationInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this create webhook notification internal server error response has a 2xx status code -func (o *CreateWebhookNotificationInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this create webhook notification internal server error response has a 3xx status code -func (o *CreateWebhookNotificationInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this create webhook notification internal server error response has a 4xx status code -func (o *CreateWebhookNotificationInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this create webhook notification internal server error response has a 5xx status code -func (o *CreateWebhookNotificationInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this create webhook notification internal server error response a status code equal to that given -func (o *CreateWebhookNotificationInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the create webhook notification internal server error response -func (o *CreateWebhookNotificationInternalServerError) Code() int { - return 500 -} - -func (o *CreateWebhookNotificationInternalServerError) Error() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateWebhookNotificationInternalServerError) String() string { - return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationInternalServerError %+v", 500, o.Payload) -} - -func (o *CreateWebhookNotificationInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *CreateWebhookNotificationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go b/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go deleted file mode 100644 index f42c1ff0445..00000000000 --- a/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go +++ /dev/null @@ -1,153 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "net/http" - "time" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" - cr "github.com/go-openapi/runtime/client" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// NewReceiveWebhookNotificationParams creates a new ReceiveWebhookNotificationParams object, -// with the default timeout for this client. -// -// Default values are not hydrated, since defaults are normally applied by the API server side. -// -// To enforce default values in parameter, use SetDefaults or WithDefaults. -func NewReceiveWebhookNotificationParams() *ReceiveWebhookNotificationParams { - return &ReceiveWebhookNotificationParams{ - timeout: cr.DefaultTimeout, - } -} - -// NewReceiveWebhookNotificationParamsWithTimeout creates a new ReceiveWebhookNotificationParams object -// with the ability to set a timeout on a request. -func NewReceiveWebhookNotificationParamsWithTimeout(timeout time.Duration) *ReceiveWebhookNotificationParams { - return &ReceiveWebhookNotificationParams{ - timeout: timeout, - } -} - -// NewReceiveWebhookNotificationParamsWithContext creates a new ReceiveWebhookNotificationParams object -// with the ability to set a context for a request. -func NewReceiveWebhookNotificationParamsWithContext(ctx context.Context) *ReceiveWebhookNotificationParams { - return &ReceiveWebhookNotificationParams{ - Context: ctx, - } -} - -// NewReceiveWebhookNotificationParamsWithHTTPClient creates a new ReceiveWebhookNotificationParams object -// with the ability to set a custom HTTPClient for a request. -func NewReceiveWebhookNotificationParamsWithHTTPClient(client *http.Client) *ReceiveWebhookNotificationParams { - return &ReceiveWebhookNotificationParams{ - HTTPClient: client, - } -} - -/* -ReceiveWebhookNotificationParams contains all the parameters to send to the API endpoint - - for the receive webhook notification operation. - - Typically these are written to a http.Request. -*/ -type ReceiveWebhookNotificationParams struct { - - /* Body. - - The webhook notification being sent - */ - Body *supportmessages.WebhookNotification - - timeout time.Duration - Context context.Context - HTTPClient *http.Client -} - -// WithDefaults hydrates default values in the receive webhook notification params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReceiveWebhookNotificationParams) WithDefaults() *ReceiveWebhookNotificationParams { - o.SetDefaults() - return o -} - -// SetDefaults hydrates default values in the receive webhook notification params (not the query body). -// -// All values with no default are reset to their zero value. -func (o *ReceiveWebhookNotificationParams) SetDefaults() { - // no default values defined for this parameter -} - -// WithTimeout adds the timeout to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) WithTimeout(timeout time.Duration) *ReceiveWebhookNotificationParams { - o.SetTimeout(timeout) - return o -} - -// SetTimeout adds the timeout to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) SetTimeout(timeout time.Duration) { - o.timeout = timeout -} - -// WithContext adds the context to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) WithContext(ctx context.Context) *ReceiveWebhookNotificationParams { - o.SetContext(ctx) - return o -} - -// SetContext adds the context to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) SetContext(ctx context.Context) { - o.Context = ctx -} - -// WithHTTPClient adds the HTTPClient to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) WithHTTPClient(client *http.Client) *ReceiveWebhookNotificationParams { - o.SetHTTPClient(client) - return o -} - -// SetHTTPClient adds the HTTPClient to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) SetHTTPClient(client *http.Client) { - o.HTTPClient = client -} - -// WithBody adds the body to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) WithBody(body *supportmessages.WebhookNotification) *ReceiveWebhookNotificationParams { - o.SetBody(body) - return o -} - -// SetBody adds the body to the receive webhook notification params -func (o *ReceiveWebhookNotificationParams) SetBody(body *supportmessages.WebhookNotification) { - o.Body = body -} - -// WriteToRequest writes these params to a swagger request -func (o *ReceiveWebhookNotificationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { - - if err := r.SetTimeout(o.timeout); err != nil { - return err - } - var res []error - if o.Body != nil { - if err := r.SetBodyParam(o.Body); err != nil { - return err - } - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go b/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go deleted file mode 100644 index ad7f5cadcb3..00000000000 --- a/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go +++ /dev/null @@ -1,399 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// 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" - "github.com/go-openapi/strfmt" - - "github.com/transcom/mymove/pkg/gen/supportmessages" -) - -// ReceiveWebhookNotificationReader is a Reader for the ReceiveWebhookNotification structure. -type ReceiveWebhookNotificationReader struct { - formats strfmt.Registry -} - -// ReadResponse reads a server response into the received o. -func (o *ReceiveWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { - switch response.Code() { - case 200: - result := NewReceiveWebhookNotificationOK() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return result, nil - case 400: - result := NewReceiveWebhookNotificationBadRequest() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 401: - result := NewReceiveWebhookNotificationUnauthorized() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 403: - result := NewReceiveWebhookNotificationForbidden() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - case 500: - result := NewReceiveWebhookNotificationInternalServerError() - if err := result.readResponse(response, consumer, o.formats); err != nil { - return nil, err - } - return nil, result - default: - return nil, runtime.NewAPIError("[POST /webhook-notify] receiveWebhookNotification", response, response.Code()) - } -} - -// NewReceiveWebhookNotificationOK creates a ReceiveWebhookNotificationOK with default headers values -func NewReceiveWebhookNotificationOK() *ReceiveWebhookNotificationOK { - return &ReceiveWebhookNotificationOK{} -} - -/* -ReceiveWebhookNotificationOK describes a response with status code 200, with default header values. - -Received notification -*/ -type ReceiveWebhookNotificationOK struct { - Payload *supportmessages.WebhookNotification -} - -// IsSuccess returns true when this receive webhook notification o k response has a 2xx status code -func (o *ReceiveWebhookNotificationOK) IsSuccess() bool { - return true -} - -// IsRedirect returns true when this receive webhook notification o k response has a 3xx status code -func (o *ReceiveWebhookNotificationOK) IsRedirect() bool { - return false -} - -// IsClientError returns true when this receive webhook notification o k response has a 4xx status code -func (o *ReceiveWebhookNotificationOK) IsClientError() bool { - return false -} - -// IsServerError returns true when this receive webhook notification o k response has a 5xx status code -func (o *ReceiveWebhookNotificationOK) IsServerError() bool { - return false -} - -// IsCode returns true when this receive webhook notification o k response a status code equal to that given -func (o *ReceiveWebhookNotificationOK) IsCode(code int) bool { - return code == 200 -} - -// Code gets the status code for the receive webhook notification o k response -func (o *ReceiveWebhookNotificationOK) Code() int { - return 200 -} - -func (o *ReceiveWebhookNotificationOK) Error() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationOK %+v", 200, o.Payload) -} - -func (o *ReceiveWebhookNotificationOK) String() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationOK %+v", 200, o.Payload) -} - -func (o *ReceiveWebhookNotificationOK) GetPayload() *supportmessages.WebhookNotification { - return o.Payload -} - -func (o *ReceiveWebhookNotificationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.WebhookNotification) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReceiveWebhookNotificationBadRequest creates a ReceiveWebhookNotificationBadRequest with default headers values -func NewReceiveWebhookNotificationBadRequest() *ReceiveWebhookNotificationBadRequest { - return &ReceiveWebhookNotificationBadRequest{} -} - -/* -ReceiveWebhookNotificationBadRequest describes a response with status code 400, with default header values. - -The request payload is invalid. -*/ -type ReceiveWebhookNotificationBadRequest struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this receive webhook notification bad request response has a 2xx status code -func (o *ReceiveWebhookNotificationBadRequest) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this receive webhook notification bad request response has a 3xx status code -func (o *ReceiveWebhookNotificationBadRequest) IsRedirect() bool { - return false -} - -// IsClientError returns true when this receive webhook notification bad request response has a 4xx status code -func (o *ReceiveWebhookNotificationBadRequest) IsClientError() bool { - return true -} - -// IsServerError returns true when this receive webhook notification bad request response has a 5xx status code -func (o *ReceiveWebhookNotificationBadRequest) IsServerError() bool { - return false -} - -// IsCode returns true when this receive webhook notification bad request response a status code equal to that given -func (o *ReceiveWebhookNotificationBadRequest) IsCode(code int) bool { - return code == 400 -} - -// Code gets the status code for the receive webhook notification bad request response -func (o *ReceiveWebhookNotificationBadRequest) Code() int { - return 400 -} - -func (o *ReceiveWebhookNotificationBadRequest) Error() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationBadRequest %+v", 400, o.Payload) -} - -func (o *ReceiveWebhookNotificationBadRequest) String() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationBadRequest %+v", 400, o.Payload) -} - -func (o *ReceiveWebhookNotificationBadRequest) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ReceiveWebhookNotificationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReceiveWebhookNotificationUnauthorized creates a ReceiveWebhookNotificationUnauthorized with default headers values -func NewReceiveWebhookNotificationUnauthorized() *ReceiveWebhookNotificationUnauthorized { - return &ReceiveWebhookNotificationUnauthorized{} -} - -/* -ReceiveWebhookNotificationUnauthorized describes a response with status code 401, with default header values. - -The request was denied. -*/ -type ReceiveWebhookNotificationUnauthorized struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this receive webhook notification unauthorized response has a 2xx status code -func (o *ReceiveWebhookNotificationUnauthorized) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this receive webhook notification unauthorized response has a 3xx status code -func (o *ReceiveWebhookNotificationUnauthorized) IsRedirect() bool { - return false -} - -// IsClientError returns true when this receive webhook notification unauthorized response has a 4xx status code -func (o *ReceiveWebhookNotificationUnauthorized) IsClientError() bool { - return true -} - -// IsServerError returns true when this receive webhook notification unauthorized response has a 5xx status code -func (o *ReceiveWebhookNotificationUnauthorized) IsServerError() bool { - return false -} - -// IsCode returns true when this receive webhook notification unauthorized response a status code equal to that given -func (o *ReceiveWebhookNotificationUnauthorized) IsCode(code int) bool { - return code == 401 -} - -// Code gets the status code for the receive webhook notification unauthorized response -func (o *ReceiveWebhookNotificationUnauthorized) Code() int { - return 401 -} - -func (o *ReceiveWebhookNotificationUnauthorized) Error() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationUnauthorized %+v", 401, o.Payload) -} - -func (o *ReceiveWebhookNotificationUnauthorized) String() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationUnauthorized %+v", 401, o.Payload) -} - -func (o *ReceiveWebhookNotificationUnauthorized) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ReceiveWebhookNotificationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReceiveWebhookNotificationForbidden creates a ReceiveWebhookNotificationForbidden with default headers values -func NewReceiveWebhookNotificationForbidden() *ReceiveWebhookNotificationForbidden { - return &ReceiveWebhookNotificationForbidden{} -} - -/* -ReceiveWebhookNotificationForbidden describes a response with status code 403, with default header values. - -The request was denied. -*/ -type ReceiveWebhookNotificationForbidden struct { - Payload *supportmessages.ClientError -} - -// IsSuccess returns true when this receive webhook notification forbidden response has a 2xx status code -func (o *ReceiveWebhookNotificationForbidden) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this receive webhook notification forbidden response has a 3xx status code -func (o *ReceiveWebhookNotificationForbidden) IsRedirect() bool { - return false -} - -// IsClientError returns true when this receive webhook notification forbidden response has a 4xx status code -func (o *ReceiveWebhookNotificationForbidden) IsClientError() bool { - return true -} - -// IsServerError returns true when this receive webhook notification forbidden response has a 5xx status code -func (o *ReceiveWebhookNotificationForbidden) IsServerError() bool { - return false -} - -// IsCode returns true when this receive webhook notification forbidden response a status code equal to that given -func (o *ReceiveWebhookNotificationForbidden) IsCode(code int) bool { - return code == 403 -} - -// Code gets the status code for the receive webhook notification forbidden response -func (o *ReceiveWebhookNotificationForbidden) Code() int { - return 403 -} - -func (o *ReceiveWebhookNotificationForbidden) Error() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationForbidden %+v", 403, o.Payload) -} - -func (o *ReceiveWebhookNotificationForbidden) String() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationForbidden %+v", 403, o.Payload) -} - -func (o *ReceiveWebhookNotificationForbidden) GetPayload() *supportmessages.ClientError { - return o.Payload -} - -func (o *ReceiveWebhookNotificationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.ClientError) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} - -// NewReceiveWebhookNotificationInternalServerError creates a ReceiveWebhookNotificationInternalServerError with default headers values -func NewReceiveWebhookNotificationInternalServerError() *ReceiveWebhookNotificationInternalServerError { - return &ReceiveWebhookNotificationInternalServerError{} -} - -/* -ReceiveWebhookNotificationInternalServerError describes a response with status code 500, with default header values. - -A server error occurred. -*/ -type ReceiveWebhookNotificationInternalServerError struct { - Payload *supportmessages.Error -} - -// IsSuccess returns true when this receive webhook notification internal server error response has a 2xx status code -func (o *ReceiveWebhookNotificationInternalServerError) IsSuccess() bool { - return false -} - -// IsRedirect returns true when this receive webhook notification internal server error response has a 3xx status code -func (o *ReceiveWebhookNotificationInternalServerError) IsRedirect() bool { - return false -} - -// IsClientError returns true when this receive webhook notification internal server error response has a 4xx status code -func (o *ReceiveWebhookNotificationInternalServerError) IsClientError() bool { - return false -} - -// IsServerError returns true when this receive webhook notification internal server error response has a 5xx status code -func (o *ReceiveWebhookNotificationInternalServerError) IsServerError() bool { - return true -} - -// IsCode returns true when this receive webhook notification internal server error response a status code equal to that given -func (o *ReceiveWebhookNotificationInternalServerError) IsCode(code int) bool { - return code == 500 -} - -// Code gets the status code for the receive webhook notification internal server error response -func (o *ReceiveWebhookNotificationInternalServerError) Code() int { - return 500 -} - -func (o *ReceiveWebhookNotificationInternalServerError) Error() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationInternalServerError %+v", 500, o.Payload) -} - -func (o *ReceiveWebhookNotificationInternalServerError) String() string { - return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationInternalServerError %+v", 500, o.Payload) -} - -func (o *ReceiveWebhookNotificationInternalServerError) GetPayload() *supportmessages.Error { - return o.Payload -} - -func (o *ReceiveWebhookNotificationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { - - o.Payload = new(supportmessages.Error) - - // response payload - if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { - return err - } - - return nil -} diff --git a/pkg/gen/supportclient/webhook/webhook_client.go b/pkg/gen/supportclient/webhook/webhook_client.go deleted file mode 100644 index 0c645fb4d8b..00000000000 --- a/pkg/gen/supportclient/webhook/webhook_client.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package webhook - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "fmt" - - "github.com/go-openapi/runtime" - "github.com/go-openapi/strfmt" -) - -// New creates a new webhook API client. -func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { - return &Client{transport: transport, formats: formats} -} - -/* -Client for webhook API -*/ -type Client struct { - transport runtime.ClientTransport - formats strfmt.Registry -} - -// ClientOption is the option for Client methods -type ClientOption func(*runtime.ClientOperation) - -// ClientService is the interface for Client methods -type ClientService interface { - CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error) - - ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error) - - SetTransport(transport runtime.ClientTransport) -} - -/* -CreateWebhookNotification tests endpoint for creating webhook notifications - -This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation. -*/ -func (a *Client) CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewCreateWebhookNotificationParams() - } - op := &runtime.ClientOperation{ - ID: "createWebhookNotification", - Method: "POST", - PathPattern: "/webhook-notifications", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &CreateWebhookNotificationReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*CreateWebhookNotificationCreated) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for createWebhookNotification: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -/* -ReceiveWebhookNotification tests endpoint for receiving messages from our own webhook client - -This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The `webhook-client` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection. -*/ -func (a *Client) ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error) { - // TODO: Validate the params before sending - if params == nil { - params = NewReceiveWebhookNotificationParams() - } - op := &runtime.ClientOperation{ - ID: "receiveWebhookNotification", - Method: "POST", - PathPattern: "/webhook-notify", - ProducesMediaTypes: []string{"application/json"}, - ConsumesMediaTypes: []string{"application/json"}, - Schemes: []string{"http"}, - Params: params, - Reader: &ReceiveWebhookNotificationReader{formats: a.formats}, - Context: params.Context, - Client: params.HTTPClient, - } - for _, opt := range opts { - opt(op) - } - - result, err := a.transport.Submit(op) - if err != nil { - return nil, err - } - success, ok := result.(*ReceiveWebhookNotificationOK) - if ok { - return success, nil - } - // unexpected success response - // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue - msg := fmt.Sprintf("unexpected success response for receiveWebhookNotification: API contract not enforced by server. Client expected to get an error, but got: %T", result) - panic(msg) -} - -// SetTransport changes the transport on the client -func (a *Client) SetTransport(transport runtime.ClientTransport) { - a.transport = transport -} diff --git a/pkg/gen/supportmessages/orders_type_detail.go b/pkg/gen/supportmessages/orders_type_detail.go deleted file mode 100644 index 55d6d1e2f10..00000000000 --- a/pkg/gen/supportmessages/orders_type_detail.go +++ /dev/null @@ -1,93 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// OrdersTypeDetail Orders type detail -// -// swagger:model OrdersTypeDetail -type OrdersTypeDetail string - -func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { - return &value -} - -// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. -func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { - return &m -} - -const ( - - // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" - OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" - - // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" - OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" - - // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" - OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" - - // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" - OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" - - // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" - OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" - - // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" - OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" - - // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" - OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" -) - -// for schema -var ordersTypeDetailEnum []interface{} - -func init() { - var res []OrdersTypeDetail - if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) - } -} - -func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { - if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this orders type detail -func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this orders type detail based on context it is used -func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/supportmessages/payment_request.go b/pkg/gen/supportmessages/payment_request.go deleted file mode 100644 index b3bd5e62162..00000000000 --- a/pkg/gen/supportmessages/payment_request.go +++ /dev/null @@ -1,289 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequest payment request -// -// swagger:model PaymentRequest -type PaymentRequest struct { - - // document package - DocumentPackage *ProofOfServicePackage `json:"documentPackage,omitempty"` - - // e tag - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // is final - IsFinal *bool `json:"isFinal,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // payment request number - // Example: 1234-5678-1 - // Read Only: true - PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` - - // recalculation of payment request ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` - - // rejection reason - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this payment request -func (m *PaymentRequest) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDocumentPackage(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) validateDocumentPackage(formats strfmt.Registry) error { - if swag.IsZero(m.DocumentPackage) { // not required - return nil - } - - if m.DocumentPackage != nil { - if err := m.DocumentPackage.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("documentPackage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("documentPackage") - } - return err - } - } - - return nil -} - -func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this payment request based on the context it is used -func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateDocumentPackage(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequest) contextValidateDocumentPackage(ctx context.Context, formats strfmt.Registry) error { - - if m.DocumentPackage != nil { - - if swag.IsZero(m.DocumentPackage) { // not required - return nil - } - - if err := m.DocumentPackage.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("documentPackage") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("documentPackage") - } - return err - } - } - - return nil -} - -func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequest) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequest) UnmarshalBinary(b []byte) error { - var res PaymentRequest - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/payment_request_e_d_i.go b/pkg/gen/supportmessages/payment_request_e_d_i.go deleted file mode 100644 index c739c6d72d3..00000000000 --- a/pkg/gen/supportmessages/payment_request_e_d_i.go +++ /dev/null @@ -1,111 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// PaymentRequestEDI payment request e d i -// -// swagger:model PaymentRequestEDI -type PaymentRequestEDI struct { - - // edi - // Read Only: true - Edi string `json:"edi,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` -} - -// Validate validates this payment request e d i -func (m *PaymentRequestEDI) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequestEDI) 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 -} - -// ContextValidate validate this payment request e d i based on the context it is used -func (m *PaymentRequestEDI) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateEdi(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *PaymentRequestEDI) contextValidateEdi(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "edi", "body", string(m.Edi)); err != nil { - return err - } - - return nil -} - -func (m *PaymentRequestEDI) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *PaymentRequestEDI) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *PaymentRequestEDI) UnmarshalBinary(b []byte) error { - var res PaymentRequestEDI - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/payment_request_status.go b/pkg/gen/supportmessages/payment_request_status.go deleted file mode 100644 index 3fd718cfb10..00000000000 --- a/pkg/gen/supportmessages/payment_request_status.go +++ /dev/null @@ -1,96 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// PaymentRequestStatus Payment Request Status -// -// swagger:model PaymentRequestStatus -type PaymentRequestStatus string - -func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. -func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { - return &m -} - -const ( - - // PaymentRequestStatusPENDING captures enum value "PENDING" - PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" - - // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" - PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" - - // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" - - // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" - PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" - - // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" - PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" - - // PaymentRequestStatusPAID captures enum value "PAID" - PaymentRequestStatusPAID PaymentRequestStatus = "PAID" - - // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" - PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" - - // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" - PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" -) - -// for schema -var paymentRequestStatusEnum []interface{} - -func init() { - var res []PaymentRequestStatus - if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) - } -} - -func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { - if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this payment request status -func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this payment request status based on context it is used -func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/supportmessages/payment_requests.go b/pkg/gen/supportmessages/payment_requests.go deleted file mode 100644 index c7802632d9a..00000000000 --- a/pkg/gen/supportmessages/payment_requests.go +++ /dev/null @@ -1,78 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// PaymentRequests payment requests -// -// swagger:model PaymentRequests -type PaymentRequests []*PaymentRequest - -// Validate validates this payment requests -func (m PaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - if swag.IsZero(m[i]) { // not required - continue - } - - if m[i] != nil { - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this payment requests based on the context it is used -func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if m[i] != nil { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/supportmessages/process_reviewed_payment_requests.go b/pkg/gen/supportmessages/process_reviewed_payment_requests.go deleted file mode 100644 index b0f8b9b9ed0..00000000000 --- a/pkg/gen/supportmessages/process_reviewed_payment_requests.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProcessReviewedPaymentRequests process reviewed payment requests -// -// swagger:model ProcessReviewedPaymentRequests -type ProcessReviewedPaymentRequests struct { - - // delete from syncada - // Example: true - // Required: true - DeleteFromSyncada *bool `json:"deleteFromSyncada"` - - // payment request ID - // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 - // Format: uuid - PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` - - // read from syncada - // Example: true - // Required: true - ReadFromSyncada *bool `json:"readFromSyncada"` - - // send to syncada - // Example: true - // Required: true - SendToSyncada *bool `json:"sendToSyncada"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this process reviewed payment requests -func (m *ProcessReviewedPaymentRequests) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateDeleteFromSyncada(formats); err != nil { - res = append(res, err) - } - - if err := m.validatePaymentRequestID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateReadFromSyncada(formats); err != nil { - res = append(res, err) - } - - if err := m.validateSendToSyncada(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 *ProcessReviewedPaymentRequests) validateDeleteFromSyncada(formats strfmt.Registry) error { - - if err := validate.Required("deleteFromSyncada", "body", m.DeleteFromSyncada); err != nil { - return err - } - - return nil -} - -func (m *ProcessReviewedPaymentRequests) validatePaymentRequestID(formats strfmt.Registry) error { - if swag.IsZero(m.PaymentRequestID) { // not required - return nil - } - - if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *ProcessReviewedPaymentRequests) validateReadFromSyncada(formats strfmt.Registry) error { - - if err := validate.Required("readFromSyncada", "body", m.ReadFromSyncada); err != nil { - return err - } - - return nil -} - -func (m *ProcessReviewedPaymentRequests) validateSendToSyncada(formats strfmt.Registry) error { - - if err := validate.Required("sendToSyncada", "body", m.SendToSyncada); err != nil { - return err - } - - return nil -} - -func (m *ProcessReviewedPaymentRequests) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this process reviewed payment requests based on the context it is used -func (m *ProcessReviewedPaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProcessReviewedPaymentRequests) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProcessReviewedPaymentRequests) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProcessReviewedPaymentRequests) UnmarshalBinary(b []byte) error { - var res ProcessReviewedPaymentRequests - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/proof_of_service_package.go b/pkg/gen/supportmessages/proof_of_service_package.go deleted file mode 100644 index c9bd714efea..00000000000 --- a/pkg/gen/supportmessages/proof_of_service_package.go +++ /dev/null @@ -1,143 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ProofOfServicePackage proof of service package -// -// swagger:model ProofOfServicePackage -type ProofOfServicePackage struct { - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // uploads - Uploads []*UploadWithOmissions `json:"uploads"` -} - -// Validate validates this proof of service package -func (m *ProofOfServicePackage) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUploads(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServicePackage) 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 *ProofOfServicePackage) validateUploads(formats strfmt.Registry) error { - if swag.IsZero(m.Uploads) { // not required - return nil - } - - for i := 0; i < len(m.Uploads); i++ { - if swag.IsZero(m.Uploads[i]) { // not required - continue - } - - if m.Uploads[i] != nil { - if err := m.Uploads[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// ContextValidate validate this proof of service package based on the context it is used -func (m *ProofOfServicePackage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateUploads(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ProofOfServicePackage) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { - - for i := 0; i < len(m.Uploads); i++ { - - if m.Uploads[i] != nil { - - if swag.IsZero(m.Uploads[i]) { // not required - return nil - } - - if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) - } - return err - } - } - - } - - return nil -} - -// MarshalBinary interface implementation -func (m *ProofOfServicePackage) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ProofOfServicePackage) UnmarshalBinary(b []byte) error { - var res ProofOfServicePackage - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/rank.go b/pkg/gen/supportmessages/rank.go deleted file mode 100644 index f42c0aec72e..00000000000 --- a/pkg/gen/supportmessages/rank.go +++ /dev/null @@ -1,159 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// Rank Rank of the service member, must match specific list of available ranks. -// -// swagger:model Rank -type Rank string - -func NewRank(value Rank) *Rank { - return &value -} - -// Pointer returns a pointer to a freshly-allocated Rank. -func (m Rank) Pointer() *Rank { - return &m -} - -const ( - - // RankE1 captures enum value "E_1" - RankE1 Rank = "E_1" - - // RankE2 captures enum value "E_2" - RankE2 Rank = "E_2" - - // RankE3 captures enum value "E_3" - RankE3 Rank = "E_3" - - // RankE4 captures enum value "E_4" - RankE4 Rank = "E_4" - - // RankE5 captures enum value "E_5" - RankE5 Rank = "E_5" - - // RankE6 captures enum value "E_6" - RankE6 Rank = "E_6" - - // RankE7 captures enum value "E_7" - RankE7 Rank = "E_7" - - // RankE8 captures enum value "E_8" - RankE8 Rank = "E_8" - - // RankE9 captures enum value "E_9" - RankE9 Rank = "E_9" - - // RankE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" - RankE9SPECIALSENIORENLISTED Rank = "E_9_SPECIAL_SENIOR_ENLISTED" - - // RankO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" - RankO1ACADEMYGRADUATE Rank = "O_1_ACADEMY_GRADUATE" - - // RankO2 captures enum value "O_2" - RankO2 Rank = "O_2" - - // RankO3 captures enum value "O_3" - RankO3 Rank = "O_3" - - // RankO4 captures enum value "O_4" - RankO4 Rank = "O_4" - - // RankO5 captures enum value "O_5" - RankO5 Rank = "O_5" - - // RankO6 captures enum value "O_6" - RankO6 Rank = "O_6" - - // RankO7 captures enum value "O_7" - RankO7 Rank = "O_7" - - // RankO8 captures enum value "O_8" - RankO8 Rank = "O_8" - - // RankO9 captures enum value "O_9" - RankO9 Rank = "O_9" - - // RankO10 captures enum value "O_10" - RankO10 Rank = "O_10" - - // RankW1 captures enum value "W_1" - RankW1 Rank = "W_1" - - // RankW2 captures enum value "W_2" - RankW2 Rank = "W_2" - - // RankW3 captures enum value "W_3" - RankW3 Rank = "W_3" - - // RankW4 captures enum value "W_4" - RankW4 Rank = "W_4" - - // RankW5 captures enum value "W_5" - RankW5 Rank = "W_5" - - // RankAVIATIONCADET captures enum value "AVIATION_CADET" - RankAVIATIONCADET Rank = "AVIATION_CADET" - - // RankCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" - RankCIVILIANEMPLOYEE Rank = "CIVILIAN_EMPLOYEE" - - // RankACADEMYCADET captures enum value "ACADEMY_CADET" - RankACADEMYCADET Rank = "ACADEMY_CADET" - - // RankMIDSHIPMAN captures enum value "MIDSHIPMAN" - RankMIDSHIPMAN Rank = "MIDSHIPMAN" -) - -// for schema -var rankEnum []interface{} - -func init() { - var res []Rank - if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - rankEnum = append(rankEnum, v) - } -} - -func (m Rank) validateRankEnum(path, location string, value Rank) error { - if err := validate.EnumCase(path, location, value, rankEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this rank -func (m Rank) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateRankEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this rank based on context it is used -func (m Rank) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/supportmessages/re_service_code.go b/pkg/gen/supportmessages/re_service_code.go deleted file mode 100644 index ae293c133d2..00000000000 --- a/pkg/gen/supportmessages/re_service_code.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items -// may be requested by the Prime, but may be returned in a response. -// -// Documentation of all the service items will be provided. -// -// swagger:model ReServiceCode -type ReServiceCode string - -func NewReServiceCode(value ReServiceCode) *ReServiceCode { - return &value -} - -// Pointer returns a pointer to a freshly-allocated ReServiceCode. -func (m ReServiceCode) Pointer() *ReServiceCode { - return &m -} - -const ( - - // ReServiceCodeCS captures enum value "CS" - ReServiceCodeCS ReServiceCode = "CS" - - // ReServiceCodeDBHF captures enum value "DBHF" - ReServiceCodeDBHF ReServiceCode = "DBHF" - - // ReServiceCodeDBTF captures enum value "DBTF" - ReServiceCodeDBTF ReServiceCode = "DBTF" - - // ReServiceCodeDCRT captures enum value "DCRT" - ReServiceCodeDCRT ReServiceCode = "DCRT" - - // ReServiceCodeDDASIT captures enum value "DDASIT" - ReServiceCodeDDASIT ReServiceCode = "DDASIT" - - // ReServiceCodeDDDSIT captures enum value "DDDSIT" - ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" - - // ReServiceCodeDDFSIT captures enum value "DDFSIT" - ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" - - // ReServiceCodeDDP captures enum value "DDP" - ReServiceCodeDDP ReServiceCode = "DDP" - - // ReServiceCodeDDSHUT captures enum value "DDSHUT" - ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" - - // ReServiceCodeDLH captures enum value "DLH" - ReServiceCodeDLH ReServiceCode = "DLH" - - // ReServiceCodeDMHF captures enum value "DMHF" - ReServiceCodeDMHF ReServiceCode = "DMHF" - - // ReServiceCodeDNPK captures enum value "DNPK" - ReServiceCodeDNPK ReServiceCode = "DNPK" - - // ReServiceCodeDOASIT captures enum value "DOASIT" - ReServiceCodeDOASIT ReServiceCode = "DOASIT" - - // ReServiceCodeDOFSIT captures enum value "DOFSIT" - ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" - - // ReServiceCodeDOP captures enum value "DOP" - ReServiceCodeDOP ReServiceCode = "DOP" - - // ReServiceCodeDOPSIT captures enum value "DOPSIT" - ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" - - // ReServiceCodeDOSHUT captures enum value "DOSHUT" - ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" - - // ReServiceCodeDPK captures enum value "DPK" - ReServiceCodeDPK ReServiceCode = "DPK" - - // ReServiceCodeDSH captures enum value "DSH" - ReServiceCodeDSH ReServiceCode = "DSH" - - // ReServiceCodeDUCRT captures enum value "DUCRT" - ReServiceCodeDUCRT ReServiceCode = "DUCRT" - - // ReServiceCodeDUPK captures enum value "DUPK" - ReServiceCodeDUPK ReServiceCode = "DUPK" - - // ReServiceCodeFSC captures enum value "FSC" - ReServiceCodeFSC ReServiceCode = "FSC" - - // ReServiceCodeIBHF captures enum value "IBHF" - ReServiceCodeIBHF ReServiceCode = "IBHF" - - // ReServiceCodeIBTF captures enum value "IBTF" - ReServiceCodeIBTF ReServiceCode = "IBTF" - - // ReServiceCodeICOLH captures enum value "ICOLH" - ReServiceCodeICOLH ReServiceCode = "ICOLH" - - // ReServiceCodeICOUB captures enum value "ICOUB" - ReServiceCodeICOUB ReServiceCode = "ICOUB" - - // ReServiceCodeICRT captures enum value "ICRT" - ReServiceCodeICRT ReServiceCode = "ICRT" - - // ReServiceCodeIDASIT captures enum value "IDASIT" - ReServiceCodeIDASIT ReServiceCode = "IDASIT" - - // ReServiceCodeIDDSIT captures enum value "IDDSIT" - ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" - - // ReServiceCodeIDFSIT captures enum value "IDFSIT" - ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" - - // ReServiceCodeIDSHUT captures enum value "IDSHUT" - ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" - - // ReServiceCodeIHPK captures enum value "IHPK" - ReServiceCodeIHPK ReServiceCode = "IHPK" - - // ReServiceCodeIHUPK captures enum value "IHUPK" - ReServiceCodeIHUPK ReServiceCode = "IHUPK" - - // ReServiceCodeINPK captures enum value "INPK" - ReServiceCodeINPK ReServiceCode = "INPK" - - // ReServiceCodeIOASIT captures enum value "IOASIT" - ReServiceCodeIOASIT ReServiceCode = "IOASIT" - - // ReServiceCodeIOCLH captures enum value "IOCLH" - ReServiceCodeIOCLH ReServiceCode = "IOCLH" - - // ReServiceCodeIOCUB captures enum value "IOCUB" - ReServiceCodeIOCUB ReServiceCode = "IOCUB" - - // ReServiceCodeIOFSIT captures enum value "IOFSIT" - ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" - - // ReServiceCodeIOOLH captures enum value "IOOLH" - ReServiceCodeIOOLH ReServiceCode = "IOOLH" - - // ReServiceCodeIOOUB captures enum value "IOOUB" - ReServiceCodeIOOUB ReServiceCode = "IOOUB" - - // ReServiceCodeIOPSIT captures enum value "IOPSIT" - ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" - - // ReServiceCodeIOSHUT captures enum value "IOSHUT" - ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" - - // ReServiceCodeIUBPK captures enum value "IUBPK" - ReServiceCodeIUBPK ReServiceCode = "IUBPK" - - // ReServiceCodeIUBUPK captures enum value "IUBUPK" - ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" - - // ReServiceCodeIUCRT captures enum value "IUCRT" - ReServiceCodeIUCRT ReServiceCode = "IUCRT" - - // ReServiceCodeMS captures enum value "MS" - ReServiceCodeMS ReServiceCode = "MS" - - // ReServiceCodeNSTH captures enum value "NSTH" - ReServiceCodeNSTH ReServiceCode = "NSTH" - - // ReServiceCodeNSTUB captures enum value "NSTUB" - ReServiceCodeNSTUB ReServiceCode = "NSTUB" -) - -// for schema -var reServiceCodeEnum []interface{} - -func init() { - var res []ReServiceCode - if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - reServiceCodeEnum = append(reServiceCodeEnum, v) - } -} - -func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { - if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this re service code -func (m ReServiceCode) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateReServiceCodeEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this re service code based on context it is used -func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/gen/supportmessages/update_m_t_o_service_item_status.go b/pkg/gen/supportmessages/update_m_t_o_service_item_status.go deleted file mode 100644 index a2243ef5595..00000000000 --- a/pkg/gen/supportmessages/update_m_t_o_service_item_status.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// UpdateMTOServiceItemStatus update m t o service item status -// -// swagger:model UpdateMTOServiceItemStatus -type UpdateMTOServiceItemStatus struct { - - // Reason the service item was rejected by the TOO"" - // Example: item was too heavy - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status MTOServiceItemStatus `json:"status,omitempty"` -} - -// Validate validates this update m t o service item status -func (m *UpdateMTOServiceItemStatus) 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 *UpdateMTOServiceItemStatus) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this update m t o service item status based on the context it is used -func (m *UpdateMTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdateMTOServiceItemStatus) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOServiceItemStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOServiceItemStatus) UnmarshalBinary(b []byte) error { - var res UpdateMTOServiceItemStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/update_m_t_o_shipment_status.go b/pkg/gen/supportmessages/update_m_t_o_shipment_status.go deleted file mode 100644 index 201ee90a85b..00000000000 --- a/pkg/gen/supportmessages/update_m_t_o_shipment_status.go +++ /dev/null @@ -1,121 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdateMTOShipmentStatus update m t o shipment status -// -// swagger:model UpdateMTOShipmentStatus -type UpdateMTOShipmentStatus struct { - - // rejection reason - // Example: MTO Shipment not good enough - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - // Enum: [REJECTED APPROVED SUBMITTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] - Status string `json:"status,omitempty"` -} - -// Validate validates this update m t o shipment status -func (m *UpdateMTOShipmentStatus) 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 -} - -var updateMTOShipmentStatusTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["REJECTED","APPROVED","SUBMITTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) - } -} - -const ( - - // UpdateMTOShipmentStatusStatusREJECTED captures enum value "REJECTED" - UpdateMTOShipmentStatusStatusREJECTED string = "REJECTED" - - // UpdateMTOShipmentStatusStatusAPPROVED captures enum value "APPROVED" - UpdateMTOShipmentStatusStatusAPPROVED string = "APPROVED" - - // UpdateMTOShipmentStatusStatusSUBMITTED captures enum value "SUBMITTED" - UpdateMTOShipmentStatusStatusSUBMITTED string = "SUBMITTED" - - // UpdateMTOShipmentStatusStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" - UpdateMTOShipmentStatusStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" - - // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" - UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" - - // UpdateMTOShipmentStatusStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" - UpdateMTOShipmentStatusStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" -) - -// prop value enum -func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -// ContextValidate validates this update m t o shipment status based on context it is used -func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} - -// MarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { - var res UpdateMTOShipmentStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/update_payment_request_status.go b/pkg/gen/supportmessages/update_payment_request_status.go deleted file mode 100644 index 3060670f2ea..00000000000 --- a/pkg/gen/supportmessages/update_payment_request_status.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UpdatePaymentRequestStatus update payment request status -// -// swagger:model UpdatePaymentRequestStatus -type UpdatePaymentRequestStatus struct { - - // Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for `If-Match`. Required when sending PUT or PATCH requests to prevent updating stale data. - // Read Only: true - ETag string `json:"eTag,omitempty"` - - // A written reason to provide context for the status. - // Example: documentation was incomplete - RejectionReason *string `json:"rejectionReason,omitempty"` - - // status - Status PaymentRequestStatus `json:"status,omitempty"` -} - -// Validate validates this update payment request status -func (m *UpdatePaymentRequestStatus) 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 *UpdatePaymentRequestStatus) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// ContextValidate validate this update payment request status based on the context it is used -func (m *UpdatePaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateETag(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UpdatePaymentRequestStatus) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { - return err - } - - return nil -} - -func (m *UpdatePaymentRequestStatus) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UpdatePaymentRequestStatus) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UpdatePaymentRequestStatus) UnmarshalBinary(b []byte) error { - var res UpdatePaymentRequestStatus - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/upload_with_omissions.go b/pkg/gen/supportmessages/upload_with_omissions.go deleted file mode 100644 index f30bb739563..00000000000 --- a/pkg/gen/supportmessages/upload_with_omissions.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// UploadWithOmissions An uploaded file. -// -// swagger:model UploadWithOmissions -type UploadWithOmissions struct { - - // bytes - // Required: true - Bytes *int64 `json:"bytes"` - - // content type - // Example: application/pdf - // Required: true - ContentType *string `json:"contentType"` - - // created at - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // filename - // Example: filename.pdf - // Required: true - Filename *string `json:"filename"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // rotation - Rotation int64 `json:"rotation,omitempty"` - - // status - // Enum: [INFECTED CLEAN PROCESSING] - Status string `json:"status,omitempty"` - - // updated at - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` - - // url - // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uri - URL strfmt.URI `json:"url,omitempty"` -} - -// Validate validates this upload with omissions -func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateBytes(formats); err != nil { - res = append(res, err) - } - - if err := m.validateContentType(formats); err != nil { - res = append(res, err) - } - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFilename(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateURL(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { - - if err := validate.Required("bytes", "body", m.Bytes); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { - - if err := validate.Required("contentType", "body", m.ContentType); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { - - if err := validate.Required("filename", "body", m.Filename); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) 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 -} - -var uploadWithOmissionsTypeStatusPropEnum []interface{} - -func init() { - var res []string - if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) - } -} - -const ( - - // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" - UploadWithOmissionsStatusINFECTED string = "INFECTED" - - // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" - UploadWithOmissionsStatusCLEAN string = "CLEAN" - - // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" - UploadWithOmissionsStatusPROCESSING string = "PROCESSING" -) - -// prop value enum -func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { - if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { - return err - } - return nil -} - -func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { - if swag.IsZero(m.Status) { // not required - return nil - } - - // value enum - if err := m.validateStatusEnum("status", "body", m.Status); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { - if swag.IsZero(m.URL) { // not required - return nil - } - - if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this upload with omissions based on the context it is used -func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { - var res UploadWithOmissions - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/validation_error.go b/pkg/gen/supportmessages/validation_error.go deleted file mode 100644 index 49171854b2a..00000000000 --- a/pkg/gen/supportmessages/validation_error.go +++ /dev/null @@ -1,132 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// ValidationError validation error -// -// swagger:model ValidationError -type ValidationError struct { - ClientError - - // invalid fields - // Required: true - InvalidFields map[string][]string `json:"invalidFields"` -} - -// UnmarshalJSON unmarshals this object from a JSON structure -func (m *ValidationError) UnmarshalJSON(raw []byte) error { - // AO0 - var aO0 ClientError - if err := swag.ReadJSON(raw, &aO0); err != nil { - return err - } - m.ClientError = aO0 - - // AO1 - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - if err := swag.ReadJSON(raw, &dataAO1); err != nil { - return err - } - - m.InvalidFields = dataAO1.InvalidFields - - return nil -} - -// MarshalJSON marshals this object to a JSON structure -func (m ValidationError) MarshalJSON() ([]byte, error) { - _parts := make([][]byte, 0, 2) - - aO0, err := swag.WriteJSON(m.ClientError) - if err != nil { - return nil, err - } - _parts = append(_parts, aO0) - var dataAO1 struct { - InvalidFields map[string][]string `json:"invalidFields"` - } - - dataAO1.InvalidFields = m.InvalidFields - - jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) - if errAO1 != nil { - return nil, errAO1 - } - _parts = append(_parts, jsonDataAO1) - return swag.ConcatJSON(_parts...), nil -} - -// Validate validates this validation error -func (m *ValidationError) Validate(formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.Validate(formats); err != nil { - res = append(res, err) - } - - if err := m.validateInvalidFields(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { - - if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this validation error based on the context it is used -func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - // validation for a type composition with ClientError - if err := m.ClientError.ContextValidate(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// MarshalBinary interface implementation -func (m *ValidationError) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *ValidationError) UnmarshalBinary(b []byte) error { - var res ValidationError - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/webhook_notification.go b/pkg/gen/supportmessages/webhook_notification.go deleted file mode 100644 index acaa8d3f34a..00000000000 --- a/pkg/gen/supportmessages/webhook_notification.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" - "github.com/go-openapi/validate" -) - -// WebhookNotification webhook notification -// -// swagger:model WebhookNotification -type WebhookNotification struct { - - // Time representing when the event was triggered - // Read Only: true - // Format: date-time - CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` - - // Name of event triggered - // Example: PaymentRequest.Update - EventKey string `json:"eventKey,omitempty"` - - // Time representing when the system firstAttempted to send this notification - // Read Only: true - // Format: date-time - FirstAttemptedAt *strfmt.DateTime `json:"firstAttemptedAt,omitempty"` - - // id - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Read Only: true - // Format: uuid - ID strfmt.UUID `json:"id,omitempty"` - - // move task order ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID,omitempty"` - - // object - Object *string `json:"object,omitempty"` - - // object ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - ObjectID *strfmt.UUID `json:"objectID,omitempty"` - - // status - Status WebhookNotificationStatus `json:"status,omitempty"` - - // trace ID - // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 - // Format: uuid - TraceID strfmt.UUID `json:"traceID,omitempty"` - - // Time representing when the notification was last updated - // Read Only: true - // Format: date-time - UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` -} - -// Validate validates this webhook notification -func (m *WebhookNotification) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateCreatedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateFirstAttemptedAt(formats); err != nil { - res = append(res, err) - } - - if err := m.validateID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateMoveTaskOrderID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateObjectID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateStatus(formats); err != nil { - res = append(res, err) - } - - if err := m.validateTraceID(formats); err != nil { - res = append(res, err) - } - - if err := m.validateUpdatedAt(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WebhookNotification) validateCreatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.CreatedAt) { // not required - return nil - } - - if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) validateFirstAttemptedAt(formats strfmt.Registry) error { - if swag.IsZero(m.FirstAttemptedAt) { // not required - return nil - } - - if err := validate.FormatOf("firstAttemptedAt", "body", "date-time", m.FirstAttemptedAt.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) 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 *WebhookNotification) validateMoveTaskOrderID(formats strfmt.Registry) error { - if swag.IsZero(m.MoveTaskOrderID) { // not required - return nil - } - - if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) validateObjectID(formats strfmt.Registry) error { - if swag.IsZero(m.ObjectID) { // not required - return nil - } - - if err := validate.FormatOf("objectID", "body", "uuid", m.ObjectID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) 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("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *WebhookNotification) validateTraceID(formats strfmt.Registry) error { - if swag.IsZero(m.TraceID) { // not required - return nil - } - - if err := validate.FormatOf("traceID", "body", "uuid", m.TraceID.String(), formats); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) validateUpdatedAt(formats strfmt.Registry) error { - if swag.IsZero(m.UpdatedAt) { // not required - return nil - } - - if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { - return err - } - - return nil -} - -// ContextValidate validate this webhook notification based on the context it is used -func (m *WebhookNotification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateCreatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateFirstAttemptedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateID(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateStatus(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *WebhookNotification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) contextValidateFirstAttemptedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "firstAttemptedAt", "body", m.FirstAttemptedAt); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { - return err - } - - return nil -} - -func (m *WebhookNotification) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { - - if swag.IsZero(m.Status) { // not required - return nil - } - - if err := m.Status.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("status") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("status") - } - return err - } - - return nil -} - -func (m *WebhookNotification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { - - if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *WebhookNotification) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *WebhookNotification) UnmarshalBinary(b []byte) error { - var res WebhookNotification - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/supportmessages/webhook_notification_status.go b/pkg/gen/supportmessages/webhook_notification_status.go deleted file mode 100644 index b6ca9f4f176..00000000000 --- a/pkg/gen/supportmessages/webhook_notification_status.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package supportmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "encoding/json" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// WebhookNotificationStatus Statuses available for a Webhook Notification -// -// swagger:model WebhookNotificationStatus -type WebhookNotificationStatus string - -func NewWebhookNotificationStatus(value WebhookNotificationStatus) *WebhookNotificationStatus { - return &value -} - -// Pointer returns a pointer to a freshly-allocated WebhookNotificationStatus. -func (m WebhookNotificationStatus) Pointer() *WebhookNotificationStatus { - return &m -} - -const ( - - // WebhookNotificationStatusPENDING captures enum value "PENDING" - WebhookNotificationStatusPENDING WebhookNotificationStatus = "PENDING" - - // WebhookNotificationStatusSENT captures enum value "SENT" - WebhookNotificationStatusSENT WebhookNotificationStatus = "SENT" - - // WebhookNotificationStatusSKIPPED captures enum value "SKIPPED" - WebhookNotificationStatusSKIPPED WebhookNotificationStatus = "SKIPPED" - - // WebhookNotificationStatusFAILING captures enum value "FAILING" - WebhookNotificationStatusFAILING WebhookNotificationStatus = "FAILING" - - // WebhookNotificationStatusFAILED captures enum value "FAILED" - WebhookNotificationStatusFAILED WebhookNotificationStatus = "FAILED" -) - -// for schema -var webhookNotificationStatusEnum []interface{} - -func init() { - var res []WebhookNotificationStatus - if err := json.Unmarshal([]byte(`["PENDING","SENT","SKIPPED","FAILING","FAILED"]`), &res); err != nil { - panic(err) - } - for _, v := range res { - webhookNotificationStatusEnum = append(webhookNotificationStatusEnum, v) - } -} - -func (m WebhookNotificationStatus) validateWebhookNotificationStatusEnum(path, location string, value WebhookNotificationStatus) error { - if err := validate.EnumCase(path, location, value, webhookNotificationStatusEnum, true); err != nil { - return err - } - return nil -} - -// Validate validates this webhook notification status -func (m WebhookNotificationStatus) Validate(formats strfmt.Registry) error { - var res []error - - // value enum - if err := m.validateWebhookNotificationStatusEnum("", "body", m); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this webhook notification status based on context it is used -func (m WebhookNotificationStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} From 1e75690d950c4b15ef46716ba55e4d01e9385f76 Mon Sep 17 00:00:00 2001 From: Beth Grohmann Date: Mon, 13 Jan 2025 15:25:01 -0600 Subject: [PATCH 027/229] Associate New London CT duty loc to transportation office --- ..._transportation_offices_meridian_ms.up.sql | 5 - .../20250106202424_update_duty_locs.up.sql | 2 + .../admin_users/create_admin_user.go | 60 + .../create_admin_user_parameters.go | 76 + .../create_admin_user_responses.go | 159 + .../create_admin_user_urlbuilder.go | 87 + .../admin_users/get_admin_user.go | 59 + .../admin_users/get_admin_user_parameters.go | 91 + .../admin_users/get_admin_user_responses.go | 159 + .../admin_users/get_admin_user_urlbuilder.go | 101 + .../admin_users/index_admin_users.go | 59 + .../index_admin_users_parameters.go | 210 + .../index_admin_users_responses.go | 184 + .../index_admin_users_urlbuilder.go | 150 + .../admin_users/update_admin_user.go | 59 + .../update_admin_user_parameters.go | 128 + .../update_admin_user_responses.go | 159 + .../update_admin_user_urlbuilder.go | 101 + .../create_client_certificate.go | 60 + .../create_client_certificate_parameters.go | 76 + .../create_client_certificate_responses.go | 159 + .../create_client_certificate_urlbuilder.go | 87 + .../get_client_certificate.go | 60 + .../get_client_certificate_parameters.go | 91 + .../get_client_certificate_responses.go | 159 + .../get_client_certificate_urlbuilder.go | 101 + .../index_client_certificates.go | 60 + .../index_client_certificates_parameters.go | 201 + .../index_client_certificates_responses.go | 184 + .../index_client_certificates_urlbuilder.go | 141 + .../remove_client_certificate.go | 60 + .../remove_client_certificate_parameters.go | 91 + .../remove_client_certificate_responses.go | 159 + .../remove_client_certificate_urlbuilder.go | 101 + .../update_client_certificate.go | 60 + .../update_client_certificate_parameters.go | 128 + .../update_client_certificate_responses.go | 159 + .../update_client_certificate_urlbuilder.go | 101 + .../get_electronic_orders_totals.go | 59 + ...get_electronic_orders_totals_parameters.go | 123 + .../get_electronic_orders_totals_responses.go | 162 + ...get_electronic_orders_totals_urlbuilder.go | 132 + .../index_electronic_orders.go | 59 + .../index_electronic_orders_parameters.go | 210 + .../index_electronic_orders_responses.go | 184 + .../index_electronic_orders_urlbuilder.go | 150 + .../adminoperations/moves/get_move.go | 59 + .../moves/get_move_parameters.go | 91 + .../moves/get_move_responses.go | 159 + .../moves/get_move_urlbuilder.go | 101 + .../adminoperations/moves/index_moves.go | 59 + .../moves/index_moves_parameters.go | 201 + .../moves/index_moves_responses.go | 184 + .../moves/index_moves_urlbuilder.go | 141 + .../adminoperations/moves/update_move.go | 63 + .../moves/update_move_parameters.go | 128 + .../moves/update_move_responses.go | 209 + .../moves/update_move_urlbuilder.go | 101 + .../adminapi/adminoperations/mymove_api.go | 741 + .../notifications/index_notifications.go | 60 + .../index_notifications_parameters.go | 201 + .../index_notifications_responses.go | 184 + .../index_notifications_urlbuilder.go | 141 + .../office_users/create_office_user.go | 62 + .../create_office_user_parameters.go | 76 + .../create_office_user_responses.go | 129 + .../create_office_user_urlbuilder.go | 87 + .../office_users/get_office_user.go | 59 + .../get_office_user_parameters.go | 91 + .../office_users/get_office_user_responses.go | 159 + .../get_office_user_urlbuilder.go | 101 + .../office_users/index_office_users.go | 59 + .../index_office_users_parameters.go | 201 + .../index_office_users_responses.go | 184 + .../index_office_users_urlbuilder.go | 141 + .../office_users/update_office_user.go | 59 + .../update_office_user_parameters.go | 128 + .../update_office_user_responses.go | 159 + .../update_office_user_urlbuilder.go | 101 + .../organizations/index_organizations.go | 59 + .../index_organizations_parameters.go | 210 + .../index_organizations_responses.go | 184 + .../index_organizations_urlbuilder.go | 150 + .../payment_request_syncada_file.go | 58 + ...payment_request_syncada_file_parameters.go | 245 + .../payment_request_syncada_file_responses.go | 181 + ...payment_request_syncada_file_urlbuilder.go | 152 + .../index_payment_request_syncada_files.go | 58 + ...ayment_request_syncada_files_parameters.go | 201 + ...payment_request_syncada_files_responses.go | 184 + ...ayment_request_syncada_files_urlbuilder.go | 141 + .../get_requested_office_user.go | 58 + .../get_requested_office_user_parameters.go | 91 + .../get_requested_office_user_responses.go | 159 + .../get_requested_office_user_urlbuilder.go | 101 + .../index_requested_office_users.go | 59 + ...index_requested_office_users_parameters.go | 201 + .../index_requested_office_users_responses.go | 184 + ...index_requested_office_users_urlbuilder.go | 141 + .../update_requested_office_user.go | 58 + ...update_requested_office_user_parameters.go | 128 + .../update_requested_office_user_responses.go | 179 + ...update_requested_office_user_urlbuilder.go | 101 + .../get_office_by_id.go | 59 + .../get_office_by_id_parameters.go | 91 + .../get_office_by_id_responses.go | 159 + .../get_office_by_id_urlbuilder.go | 101 + .../transportation_offices/index_offices.go | 59 + .../index_offices_parameters.go | 201 + .../index_offices_responses.go | 184 + .../index_offices_urlbuilder.go | 141 + .../adminoperations/uploads/get_upload.go | 60 + .../uploads/get_upload_parameters.go | 91 + .../uploads/get_upload_responses.go | 159 + .../uploads/get_upload_urlbuilder.go | 101 + .../user/get_logged_in_admin_user.go | 58 + .../get_logged_in_admin_user_parameters.go | 46 + .../get_logged_in_admin_user_responses.go | 159 + .../get_logged_in_admin_user_urlbuilder.go | 87 + .../adminoperations/users/get_user.go | 60 + .../users/get_user_parameters.go | 91 + .../users/get_user_responses.go | 159 + .../users/get_user_urlbuilder.go | 101 + .../adminoperations/users/index_users.go | 59 + .../users/index_users_parameters.go | 201 + .../users/index_users_responses.go | 184 + .../users/index_users_urlbuilder.go | 141 + .../adminoperations/users/update_user.go | 60 + .../users/update_user_parameters.go | 128 + .../users/update_user_responses.go | 229 + .../users/update_user_urlbuilder.go | 101 + .../create_webhook_subscription.go | 60 + .../create_webhook_subscription_parameters.go | 76 + .../create_webhook_subscription_responses.go | 159 + .../create_webhook_subscription_urlbuilder.go | 87 + .../get_webhook_subscription.go | 59 + .../get_webhook_subscription_parameters.go | 91 + .../get_webhook_subscription_responses.go | 159 + .../get_webhook_subscription_urlbuilder.go | 101 + .../index_webhook_subscriptions.go | 59 + .../index_webhook_subscriptions_parameters.go | 201 + .../index_webhook_subscriptions_responses.go | 184 + .../index_webhook_subscriptions_urlbuilder.go | 141 + .../update_webhook_subscription.go | 59 + .../update_webhook_subscription_parameters.go | 158 + .../update_webhook_subscription_responses.go | 254 + .../update_webhook_subscription_urlbuilder.go | 101 + pkg/gen/adminapi/configure_mymove.go | 265 + pkg/gen/adminapi/doc.go | 24 + pkg/gen/adminapi/embedded_spec.go | 7339 ++++ pkg/gen/adminapi/server.go | 507 + pkg/gen/adminmessages/electronic_order.go | 224 + pkg/gen/adminmessages/electronic_orders.go | 78 + .../adminmessages/electronic_orders_total.go | 77 + .../adminmessages/electronic_orders_totals.go | 78 + pkg/gen/adminmessages/issuer.go | 87 + pkg/gen/adminmessages/move.go | 295 + pkg/gen/adminmessages/move_status.go | 84 + pkg/gen/adminmessages/move_update.go | 71 + pkg/gen/adminmessages/moves.go | 78 + pkg/gen/adminmessages/notification.go | 224 + pkg/gen/adminmessages/notifications.go | 78 + pkg/gen/adminmessages/office_user.go | 606 + pkg/gen/adminmessages/office_user_create.go | 281 + .../adminmessages/office_user_privilege.go | 55 + pkg/gen/adminmessages/office_user_role.go | 55 + ...e_user_transportation_office_assignment.go | 78 + pkg/gen/adminmessages/office_user_update.go | 280 + pkg/gen/adminmessages/office_users.go | 78 + .../okta_account_info_response.go | 65 + pkg/gen/adminmessages/organization.go | 211 + pkg/gen/adminmessages/organizations.go | 78 + .../payment_request_syncada_file.go | 123 + .../payment_request_syncada_files.go | 78 + pkg/gen/adminmessages/privilege.go | 156 + .../requested_office_user_update.go | 238 + pkg/gen/adminmessages/role.go | 190 + pkg/gen/adminmessages/service_member.go | 138 + .../adminmessages/transportation_office.go | 274 + .../transportation_office_assignment.go | 223 + .../adminmessages/transportation_offices.go | 78 + pkg/gen/adminmessages/upload.go | 153 + pkg/gen/adminmessages/upload_information.go | 201 + pkg/gen/adminmessages/user.go | 245 + pkg/gen/adminmessages/user_update.go | 59 + pkg/gen/adminmessages/users.go | 78 + pkg/gen/adminmessages/validation_error.go | 154 + pkg/gen/adminmessages/webhook_subscription.go | 277 + .../webhook_subscription_status.go | 81 + .../adminmessages/webhook_subscriptions.go | 78 + pkg/gen/ghcapi/configure_mymove.go | 640 + pkg/gen/ghcapi/doc.go | 26 + pkg/gen/ghcapi/embedded_spec.go | 32291 ++++++++++++++++ .../get_location_by_zip_city_state.go | 58 + ...t_location_by_zip_city_state_parameters.go | 71 + ...et_location_by_zip_city_state_responses.go | 242 + ...t_location_by_zip_city_state_urlbuilder.go | 99 + .../application_parameters/get_param.go | 58 + .../get_param_parameters.go | 71 + .../get_param_responses.go | 134 + .../get_param_urlbuilder.go | 99 + .../calendar/is_date_weekend_holiday.go | 58 + .../is_date_weekend_holiday_parameters.go | 129 + .../is_date_weekend_holiday_responses.go | 239 + .../is_date_weekend_holiday_urlbuilder.go | 109 + .../create_customer_with_okta_option.go | 58 + ...te_customer_with_okta_option_parameters.go | 84 + ...ate_customer_with_okta_option_responses.go | 419 + ...te_customer_with_okta_option_urlbuilder.go | 87 + .../ghcoperations/customer/get_customer.go | 58 + .../customer/get_customer_parameters.go | 91 + .../customer/get_customer_responses.go | 284 + .../customer/get_customer_urlbuilder.go | 101 + .../customer/search_customers.go | 311 + .../customer/search_customers_parameters.go | 74 + .../customer/search_customers_responses.go | 149 + .../customer/search_customers_urlbuilder.go | 87 + .../ghcoperations/customer/update_customer.go | 58 + .../customer/update_customer_parameters.go | 157 + .../customer/update_customer_responses.go | 374 + .../customer/update_customer_urlbuilder.go | 101 + ...create_customer_support_remark_for_move.go | 58 + ...omer_support_remark_for_move_parameters.go | 101 + ...tomer_support_remark_for_move_responses.go | 239 + ...omer_support_remark_for_move_urlbuilder.go | 99 + .../delete_customer_support_remark.go | 58 + ...lete_customer_support_remark_parameters.go | 91 + ...elete_customer_support_remark_responses.go | 309 + ...lete_customer_support_remark_urlbuilder.go | 101 + .../get_customer_support_remarks_for_move.go | 58 + ...mer_support_remarks_for_move_parameters.go | 71 + ...omer_support_remarks_for_move_responses.go | 242 + ...mer_support_remarks_for_move_urlbuilder.go | 99 + ...update_customer_support_remark_for_move.go | 58 + ...omer_support_remark_for_move_parameters.go | 128 + ...tomer_support_remark_for_move_responses.go | 284 + ...omer_support_remark_for_move_urlbuilder.go | 101 + .../add_appeal_to_serious_incident.go | 58 + ...d_appeal_to_serious_incident_parameters.go | 120 + ...dd_appeal_to_serious_incident_responses.go | 264 + ...d_appeal_to_serious_incident_urlbuilder.go | 101 + .../add_appeal_to_violation.go | 58 + .../add_appeal_to_violation_parameters.go | 163 + .../add_appeal_to_violation_responses.go | 264 + .../add_appeal_to_violation_urlbuilder.go | 109 + .../create_evaluation_report.go | 58 + .../create_evaluation_report_parameters.go | 101 + .../create_evaluation_report_responses.go | 239 + .../create_evaluation_report_urlbuilder.go | 99 + .../delete_evaluation_report.go | 58 + .../delete_evaluation_report_parameters.go | 91 + .../delete_evaluation_report_responses.go | 309 + .../delete_evaluation_report_urlbuilder.go | 101 + .../download_evaluation_report.go | 58 + .../download_evaluation_report_parameters.go | 91 + .../download_evaluation_report_responses.go | 215 + .../download_evaluation_report_urlbuilder.go | 101 + .../get_evaluation_report.go | 58 + .../get_evaluation_report_parameters.go | 91 + .../get_evaluation_report_responses.go | 239 + .../get_evaluation_report_urlbuilder.go | 101 + .../save_evaluation_report.go | 58 + .../save_evaluation_report_parameters.go | 150 + .../save_evaluation_report_responses.go | 354 + .../save_evaluation_report_urlbuilder.go | 101 + .../submit_evaluation_report.go | 58 + .../submit_evaluation_report_parameters.go | 121 + .../submit_evaluation_report_responses.go | 264 + .../submit_evaluation_report_urlbuilder.go | 101 + .../ghc_documents/create_document.go | 58 + .../create_document_parameters.go | 84 + .../create_document_responses.go | 154 + .../create_document_urlbuilder.go | 87 + .../ghc_documents/get_document.go | 58 + .../ghc_documents/get_document_parameters.go | 91 + .../ghc_documents/get_document_responses.go | 374 + .../ghc_documents/get_document_urlbuilder.go | 101 + .../request_line_of_accounting.go | 58 + .../request_line_of_accounting_parameters.go | 84 + .../request_line_of_accounting_responses.go | 329 + .../request_line_of_accounting_urlbuilder.go | 87 + .../move/check_for_locked_moves_and_unlock.go | 97 + ..._for_locked_moves_and_unlock_parameters.go | 91 + ...k_for_locked_moves_and_unlock_responses.go | 104 + ..._for_locked_moves_and_unlock_urlbuilder.go | 101 + .../move/delete_assigned_office_user.go | 117 + .../delete_assigned_office_user_parameters.go | 118 + .../delete_assigned_office_user_responses.go | 104 + .../delete_assigned_office_user_urlbuilder.go | 101 + pkg/gen/ghcapi/ghcoperations/move/get_move.go | 58 + ...move_counseling_evaluation_reports_list.go | 58 + ...ling_evaluation_reports_list_parameters.go | 91 + ...eling_evaluation_reports_list_responses.go | 287 + ...ling_evaluation_reports_list_urlbuilder.go | 101 + .../ghcoperations/move/get_move_history.go | 58 + .../move/get_move_history_parameters.go | 139 + .../move/get_move_history_responses.go | 284 + .../move/get_move_history_urlbuilder.go | 124 + .../ghcoperations/move/get_move_parameters.go | 71 + .../ghcoperations/move/get_move_responses.go | 284 + ...t_move_shipment_evaluation_reports_list.go | 58 + ...ment_evaluation_reports_list_parameters.go | 91 + ...pment_evaluation_reports_list_responses.go | 287 + ...ment_evaluation_reports_list_urlbuilder.go | 101 + .../ghcoperations/move/get_move_urlbuilder.go | 99 + .../ghcoperations/move/move_canceler.go | 58 + .../move/move_canceler_parameters.go | 91 + .../move/move_canceler_responses.go | 329 + .../move/move_canceler_urlbuilder.go | 101 + .../ghcapi/ghcoperations/move/search_moves.go | 430 + .../move/search_moves_parameters.go | 74 + .../move/search_moves_responses.go | 149 + .../move/search_moves_urlbuilder.go | 87 + .../move/set_financial_review_flag.go | 124 + .../set_financial_review_flag_parameters.go | 143 + .../set_financial_review_flag_responses.go | 284 + .../set_financial_review_flag_urlbuilder.go | 101 + .../move/update_assigned_office_user.go | 56 + .../update_assigned_office_user_parameters.go | 128 + .../update_assigned_office_user_responses.go | 149 + .../update_assigned_office_user_urlbuilder.go | 101 + .../move/update_closeout_office.go | 124 + .../move/update_closeout_office_parameters.go | 128 + .../move/update_closeout_office_responses.go | 374 + .../move/update_closeout_office_urlbuilder.go | 99 + .../move/upload_additional_documents.go | 58 + .../upload_additional_documents_parameters.go | 131 + .../upload_additional_documents_responses.go | 204 + .../upload_additional_documents_urlbuilder.go | 101 + .../move_task_order/get_entitlements.go | 58 + .../get_entitlements_parameters.go | 71 + .../get_entitlements_responses.go | 284 + .../get_entitlements_urlbuilder.go | 99 + .../move_task_order/get_move_task_order.go | 58 + .../get_move_task_order_parameters.go | 71 + .../get_move_task_order_responses.go | 284 + .../get_move_task_order_urlbuilder.go | 99 + ...date_m_t_o_reviewed_billable_weights_at.go | 56 + ...reviewed_billable_weights_at_parameters.go | 101 + ..._reviewed_billable_weights_at_responses.go | 419 + ...reviewed_billable_weights_at_urlbuilder.go | 99 + ...t_o_status_service_counseling_completed.go | 58 + ...service_counseling_completed_parameters.go | 101 + ..._service_counseling_completed_responses.go | 419 + ...service_counseling_completed_urlbuilder.go | 99 + .../update_move_t_i_o_remarks.go | 56 + .../update_move_t_i_o_remarks_parameters.go | 138 + .../update_move_t_i_o_remarks_responses.go | 419 + .../update_move_t_i_o_remarks_urlbuilder.go | 99 + .../update_move_task_order_status.go | 58 + ...pdate_move_task_order_status_parameters.go | 138 + ...update_move_task_order_status_responses.go | 419 + ...pdate_move_task_order_status_urlbuilder.go | 99 + .../mto_agent/fetch_m_t_o_agent_list.go | 58 + .../fetch_m_t_o_agent_list_parameters.go | 134 + .../fetch_m_t_o_agent_list_responses.go | 197 + .../fetch_m_t_o_agent_list_urlbuilder.go | 109 + .../get_m_t_o_service_item.go | 58 + .../get_m_t_o_service_item_parameters.go | 95 + .../get_m_t_o_service_item_responses.go | 284 + .../get_m_t_o_service_item_urlbuilder.go | 107 + .../list_m_t_o_service_items.go | 58 + .../list_m_t_o_service_items_parameters.go | 91 + .../list_m_t_o_service_items_responses.go | 197 + .../list_m_t_o_service_items_urlbuilder.go | 101 + .../update_m_t_o_service_item_status.go | 58 + ...te_m_t_o_service_item_status_parameters.go | 162 + ...ate_m_t_o_service_item_status_responses.go | 374 + ...te_m_t_o_service_item_status_urlbuilder.go | 107 + .../update_service_item_sit_entry_date.go | 58 + ..._service_item_sit_entry_date_parameters.go | 109 + ...e_service_item_sit_entry_date_responses.go | 374 + ..._service_item_sit_entry_date_urlbuilder.go | 99 + .../mto_shipment/create_m_t_o_shipment.go | 69 + .../create_m_t_o_shipment_parameters.go | 76 + .../create_m_t_o_shipment_responses.go | 239 + .../create_m_t_o_shipment_urlbuilder.go | 87 + .../mto_shipment/get_shipment.go | 58 + .../mto_shipment/get_shipment_parameters.go | 91 + .../mto_shipment/get_shipment_responses.go | 284 + .../mto_shipment/get_shipment_urlbuilder.go | 101 + .../mto_shipment/list_m_t_o_shipments.go | 58 + .../list_m_t_o_shipments_parameters.go | 91 + .../list_m_t_o_shipments_responses.go | 242 + .../list_m_t_o_shipments_urlbuilder.go | 101 + .../mto_shipment/update_m_t_o_shipment.go | 76 + .../update_m_t_o_shipment_parameters.go | 193 + .../update_m_t_o_shipment_responses.go | 374 + .../update_m_t_o_shipment_urlbuilder.go | 109 + pkg/gen/ghcapi/ghcoperations/mymove_api.go | 1622 + .../create_requested_office_user.go | 59 + ...create_requested_office_user_parameters.go | 76 + .../create_requested_office_user_responses.go | 129 + ...create_requested_office_user_urlbuilder.go | 87 + .../order/acknowledge_excess_weight_risk.go | 58 + ...knowledge_excess_weight_risk_parameters.go | 120 + ...cknowledge_excess_weight_risk_responses.go | 284 + ...knowledge_excess_weight_risk_urlbuilder.go | 101 + .../order/counseling_update_allowance.go | 58 + .../counseling_update_allowance_parameters.go | 157 + .../counseling_update_allowance_responses.go | 284 + .../counseling_update_allowance_urlbuilder.go | 101 + .../order/counseling_update_order.go | 58 + .../counseling_update_order_parameters.go | 157 + .../counseling_update_order_responses.go | 284 + .../counseling_update_order_urlbuilder.go | 101 + .../ghcoperations/order/create_order.go | 58 + .../order/create_order_parameters.go | 76 + .../order/create_order_responses.go | 204 + .../order/create_order_urlbuilder.go | 87 + .../ghcapi/ghcoperations/order/get_order.go | 58 + .../order/get_order_parameters.go | 91 + .../order/get_order_responses.go | 284 + .../order/get_order_urlbuilder.go | 101 + .../ghcoperations/order/update_allowance.go | 58 + .../order/update_allowance_parameters.go | 157 + .../order/update_allowance_responses.go | 284 + .../order/update_allowance_urlbuilder.go | 101 + .../order/update_billable_weight.go | 58 + .../update_billable_weight_parameters.go | 157 + .../order/update_billable_weight_responses.go | 284 + .../update_billable_weight_urlbuilder.go | 101 + .../update_max_billable_weight_as_t_i_o.go | 58 + ...max_billable_weight_as_t_i_o_parameters.go | 158 + ..._max_billable_weight_as_t_i_o_responses.go | 284 + ...max_billable_weight_as_t_i_o_urlbuilder.go | 101 + .../ghcoperations/order/update_order.go | 58 + .../order/update_order_parameters.go | 157 + .../order/update_order_responses.go | 374 + .../order/update_order_urlbuilder.go | 101 + .../order/upload_amended_orders.go | 58 + .../order/upload_amended_orders_parameters.go | 131 + .../order/upload_amended_orders_responses.go | 204 + .../order/upload_amended_orders_urlbuilder.go | 101 + .../payment_requests/bulk_download.go | 58 + .../bulk_download_parameters.go | 71 + .../bulk_download_responses.go | 170 + .../bulk_download_urlbuilder.go | 99 + .../payment_requests/get_payment_request.go | 58 + .../get_payment_request_parameters.go | 91 + .../get_payment_request_responses.go | 284 + .../get_payment_request_urlbuilder.go | 101 + .../get_payment_requests_for_move.go | 58 + ...et_payment_requests_for_move_parameters.go | 71 + ...get_payment_requests_for_move_responses.go | 242 + ...et_payment_requests_for_move_urlbuilder.go | 99 + .../get_shipments_payment_s_i_t_balance.go | 58 + ...pments_payment_s_i_t_balance_parameters.go | 91 + ...ipments_payment_s_i_t_balance_responses.go | 242 + ...pments_payment_s_i_t_balance_urlbuilder.go | 101 + .../update_payment_request_status.go | 58 + ...pdate_payment_request_status_parameters.go | 157 + ...update_payment_request_status_responses.go | 374 + ...pdate_payment_request_status_urlbuilder.go | 101 + .../update_payment_service_item_status.go | 58 + ..._payment_service_item_status_parameters.go | 162 + ...e_payment_service_item_status_responses.go | 374 + ..._payment_service_item_status_urlbuilder.go | 107 + .../ppm/finish_document_review.go | 58 + .../ppm/finish_document_review_parameters.go | 120 + .../ppm/finish_document_review_responses.go | 419 + .../ppm/finish_document_review_urlbuilder.go | 101 + .../ppm/get_p_p_m_actual_weight.go | 58 + .../ppm/get_p_p_m_actual_weight_parameters.go | 91 + .../ppm/get_p_p_m_actual_weight_responses.go | 284 + .../ppm/get_p_p_m_actual_weight_urlbuilder.go | 101 + .../ghcoperations/ppm/get_p_p_m_closeout.go | 58 + .../ppm/get_p_p_m_closeout_parameters.go | 91 + .../ppm/get_p_p_m_closeout_responses.go | 284 + .../ppm/get_p_p_m_closeout_urlbuilder.go | 101 + .../ghcoperations/ppm/get_p_p_m_documents.go | 59 + .../ppm/get_p_p_m_documents_parameters.go | 91 + .../ppm/get_p_p_m_documents_responses.go | 239 + .../ppm/get_p_p_m_documents_urlbuilder.go | 101 + .../ppm/get_p_p_m_s_i_t_estimated_cost.go | 58 + ...t_p_p_m_s_i_t_estimated_cost_parameters.go | 284 + ...et_p_p_m_s_i_t_estimated_cost_responses.go | 284 + ...t_p_p_m_s_i_t_estimated_cost_urlbuilder.go | 133 + .../ghcoperations/ppm/show_a_o_a_packet.go | 62 + .../ppm/show_a_o_a_packet_parameters.go | 71 + .../ppm/show_a_o_a_packet_responses.go | 305 + .../ppm/show_a_o_a_packet_urlbuilder.go | 99 + .../ghcoperations/ppm/show_payment_packet.go | 58 + .../ppm/show_payment_packet_parameters.go | 91 + .../ppm/show_payment_packet_responses.go | 203 + .../ppm/show_payment_packet_urlbuilder.go | 101 + .../ppm/update_moving_expense.go | 59 + .../ppm/update_moving_expense_parameters.go | 201 + .../ppm/update_moving_expense_responses.go | 374 + .../ppm/update_moving_expense_urlbuilder.go | 109 + .../ghcoperations/ppm/update_p_p_m_s_i_t.go | 58 + .../ppm/update_p_p_m_s_i_t_parameters.go | 149 + .../ppm/update_p_p_m_s_i_t_responses.go | 329 + .../ppm/update_p_p_m_s_i_t_urlbuilder.go | 101 + .../ppm/update_pro_gear_weight_ticket.go | 59 + ...pdate_pro_gear_weight_ticket_parameters.go | 201 + ...update_pro_gear_weight_ticket_responses.go | 374 + ...pdate_pro_gear_weight_ticket_urlbuilder.go | 109 + .../ghcoperations/ppm/update_weight_ticket.go | 59 + .../ppm/update_weight_ticket_parameters.go | 201 + .../ppm/update_weight_ticket_responses.go | 374 + .../ppm/update_weight_ticket_urlbuilder.go | 109 + .../pws_violations/get_p_w_s_violations.go | 58 + .../get_p_w_s_violations_parameters.go | 46 + .../get_p_w_s_violations_responses.go | 242 + .../get_p_w_s_violations_urlbuilder.go | 87 + .../queues/get_bulk_assignment_data.go | 58 + .../get_bulk_assignment_data_parameters.go | 92 + .../get_bulk_assignment_data_responses.go | 194 + .../get_bulk_assignment_data_urlbuilder.go | 103 + .../ghcoperations/queues/get_moves_queue.go | 58 + .../queues/get_moves_queue_parameters.go | 644 + .../queues/get_moves_queue_responses.go | 149 + .../queues/get_moves_queue_urlbuilder.go | 274 + .../queues/get_payment_requests_queue.go | 58 + .../get_payment_requests_queue_parameters.go | 598 + .../get_payment_requests_queue_responses.go | 149 + .../get_payment_requests_queue_urlbuilder.go | 259 + .../get_services_counseling_origin_list.go | 58 + ...vices_counseling_origin_list_parameters.go | 110 + ...rvices_counseling_origin_list_responses.go | 152 + ...vices_counseling_origin_list_urlbuilder.go | 114 + .../queues/get_services_counseling_queue.go | 58 + ...et_services_counseling_queue_parameters.go | 858 + ...get_services_counseling_queue_responses.go | 149 + ...et_services_counseling_queue_urlbuilder.go | 328 + .../ghcoperations/queues/list_prime_moves.go | 64 + .../queues/list_prime_moves_parameters.go | 243 + .../queues/list_prime_moves_responses.go | 149 + .../queues/list_prime_moves_urlbuilder.go | 151 + .../get_all_re_service_items.go | 58 + .../get_all_re_service_items_parameters.go | 46 + .../get_all_re_service_items_responses.go | 242 + .../get_all_re_service_items_urlbuilder.go | 87 + .../associate_report_violations.go | 58 + .../associate_report_violations_parameters.go | 120 + .../associate_report_violations_responses.go | 309 + .../associate_report_violations_urlbuilder.go | 101 + .../get_report_violations_by_report_id.go | 58 + ...port_violations_by_report_id_parameters.go | 91 + ...eport_violations_by_report_id_responses.go | 242 + ...port_violations_by_report_id_urlbuilder.go | 101 + .../shipment/approve_s_i_t_extension.go | 58 + .../approve_s_i_t_extension_parameters.go | 200 + .../approve_s_i_t_extension_responses.go | 329 + .../approve_s_i_t_extension_urlbuilder.go | 109 + .../shipment/approve_shipment.go | 58 + .../shipment/approve_shipment_diversion.go | 58 + .../approve_shipment_diversion_parameters.go | 120 + .../approve_shipment_diversion_responses.go | 329 + .../approve_shipment_diversion_urlbuilder.go | 101 + .../shipment/approve_shipment_parameters.go | 120 + .../shipment/approve_shipment_responses.go | 329 + .../shipment/approve_shipment_urlbuilder.go | 101 + .../create_approved_s_i_t_duration_update.go | 58 + ...proved_s_i_t_duration_update_parameters.go | 157 + ...pproved_s_i_t_duration_update_responses.go | 284 + ...proved_s_i_t_duration_update_urlbuilder.go | 101 + .../ghcoperations/shipment/delete_shipment.go | 58 + .../shipment/delete_shipment_parameters.go | 91 + .../shipment/delete_shipment_responses.go | 309 + .../shipment/delete_shipment_urlbuilder.go | 101 + .../shipment/deny_s_i_t_extension.go | 58 + .../deny_s_i_t_extension_parameters.go | 200 + .../deny_s_i_t_extension_responses.go | 329 + .../deny_s_i_t_extension_urlbuilder.go | 109 + .../ghcoperations/shipment/reject_shipment.go | 58 + .../shipment/reject_shipment_parameters.go | 157 + .../shipment/reject_shipment_responses.go | 329 + .../shipment/reject_shipment_urlbuilder.go | 101 + .../shipment/request_shipment_cancellation.go | 58 + ...equest_shipment_cancellation_parameters.go | 120 + ...request_shipment_cancellation_responses.go | 329 + ...equest_shipment_cancellation_urlbuilder.go | 101 + .../shipment/request_shipment_diversion.go | 58 + .../request_shipment_diversion_parameters.go | 157 + .../request_shipment_diversion_responses.go | 329 + .../request_shipment_diversion_urlbuilder.go | 101 + .../shipment/request_shipment_reweigh.go | 58 + .../request_shipment_reweigh_parameters.go | 91 + .../request_shipment_reweigh_responses.go | 329 + .../request_shipment_reweigh_urlbuilder.go | 101 + .../review_shipment_address_update.go | 172 + ...view_shipment_address_update_parameters.go | 155 + ...eview_shipment_address_update_responses.go | 329 + ...view_shipment_address_update_urlbuilder.go | 101 + ...ate_s_i_t_service_item_customer_expense.go | 58 + ...ervice_item_customer_expense_parameters.go | 157 + ...service_item_customer_expense_responses.go | 329 + ...ervice_item_customer_expense_urlbuilder.go | 101 + .../ghcoperations/tac/tac_validation.go | 58 + .../tac/tac_validation_parameters.go | 82 + .../tac/tac_validation_responses.go | 284 + .../tac/tac_validation_urlbuilder.go | 100 + .../get_transportation_offices.go | 58 + .../get_transportation_offices_g_b_l_o_cs.go | 58 + ...portation_offices_g_b_l_o_cs_parameters.go | 46 + ...sportation_offices_g_b_l_o_cs_responses.go | 287 + ...portation_offices_g_b_l_o_cs_urlbuilder.go | 87 + .../get_transportation_offices_open.go | 58 + ..._transportation_offices_open_parameters.go | 97 + ...t_transportation_offices_open_responses.go | 287 + ..._transportation_offices_open_urlbuilder.go | 100 + .../get_transportation_offices_parameters.go | 97 + .../get_transportation_offices_responses.go | 287 + .../get_transportation_offices_urlbuilder.go | 100 + .../ghcoperations/uploads/create_upload.go | 58 + .../uploads/create_upload_parameters.go | 136 + .../uploads/create_upload_responses.go | 184 + .../uploads/create_upload_urlbuilder.go | 105 + .../ghcoperations/uploads/delete_upload.go | 58 + .../uploads/delete_upload_parameters.go | 140 + .../uploads/delete_upload_responses.go | 159 + .../uploads/delete_upload_urlbuilder.go | 115 + .../ghcoperations/uploads/get_upload.go | 58 + .../uploads/get_upload_parameters.go | 46 + .../uploads/get_upload_responses.go | 284 + .../uploads/get_upload_urlbuilder.go | 87 + .../ghcoperations/uploads/update_upload.go | 127 + .../uploads/update_upload_parameters.go | 126 + .../uploads/update_upload_responses.go | 184 + .../uploads/update_upload_urlbuilder.go | 101 + pkg/gen/ghcapi/server.go | 507 + .../ghcmessages/bulk_assignment_move_i_ds.go | 70 + .../ghcmessages/bulk_assignment_move_id.go | 39 + pkg/gen/ghcmessages/client_error.go | 110 + pkg/gen/ghcmessages/contractor.go | 83 + .../counseling_update_allowance_payload.go | 279 + .../counseling_update_order_payload.go | 533 + pkg/gen/ghcmessages/create_appeal.go | 110 + .../create_approved_s_i_t_duration_update.go | 145 + pkg/gen/ghcmessages/create_boat_shipment.go | 229 + .../ghcmessages/create_customer_payload.go | 344 + .../create_customer_support_remark.go | 95 + .../ghcmessages/create_evaluation_report.go | 75 + pkg/gen/ghcmessages/create_m_t_o_shipment.go | 817 + .../create_mobile_home_shipment.go | 156 + pkg/gen/ghcmessages/create_orders.go | 438 + pkg/gen/ghcmessages/create_p_p_m_shipment.go | 404 + pkg/gen/ghcmessages/created_customer.go | 351 + pkg/gen/ghcmessages/customer.go | 351 + pkg/gen/ghcmessages/customer_contact_type.go | 78 + .../ghcmessages/customer_support_remark.go | 284 + .../ghcmessages/customer_support_remarks.go | 78 + pkg/gen/ghcmessages/deny_s_i_t_extension.go | 90 + pkg/gen/ghcmessages/department_indicator.go | 92 + pkg/gen/ghcmessages/dept_indicator.go | 90 + pkg/gen/ghcmessages/destination_type.go | 85 + pkg/gen/ghcmessages/dimension_type.go | 78 + pkg/gen/ghcmessages/document.go | 169 + pkg/gen/ghcmessages/duty_location.go | 159 + pkg/gen/ghcmessages/entitlements.go | 142 + pkg/gen/ghcmessages/error.go | 71 + pkg/gen/ghcmessages/evaluation_report.go | 794 + .../evaluation_report_inspection_type.go | 81 + pkg/gen/ghcmessages/evaluation_report_list.go | 78 + .../ghcmessages/evaluation_report_location.go | 81 + .../evaluation_report_office_user.go | 126 + pkg/gen/ghcmessages/evaluation_report_type.go | 78 + .../fetch_line_of_accounting_payload.go | 158 + pkg/gen/ghcmessages/g_b_l_o_c.go | 138 + pkg/gen/ghcmessages/g_b_l_o_cs.go | 27 + pkg/gen/ghcmessages/g_s_r_appeal.go | 282 + .../ghcmessages/g_s_r_appeal_status_type.go | 78 + pkg/gen/ghcmessages/g_s_r_appeals.go | 78 + pkg/gen/ghcmessages/grade.go | 159 + .../invalid_request_response_payload.go | 50 + .../is_date_weekend_holiday_info.go | 148 + pkg/gen/ghcmessages/l_o_a_type.go | 79 + pkg/gen/ghcmessages/line_of_accounting.go | 1232 + pkg/gen/ghcmessages/list_prime_move.go | 338 + pkg/gen/ghcmessages/list_prime_moves.go | 78 + .../ghcmessages/list_prime_moves_result.go | 109 + pkg/gen/ghcmessages/location.go | 90 + pkg/gen/ghcmessages/locations.go | 78 + pkg/gen/ghcmessages/locked_office_user.go | 136 + pkg/gen/ghcmessages/m_t_o_agent.go | 236 + pkg/gen/ghcmessages/m_t_o_agents.go | 78 + .../m_t_o_approval_service_item_codes.go | 55 + pkg/gen/ghcmessages/m_t_o_service_item.go | 937 + .../m_t_o_service_item_customer_contact.go | 171 + .../m_t_o_service_item_customer_contacts.go | 78 + .../m_t_o_service_item_dimension.go | 138 + .../m_t_o_service_item_dimensions.go | 78 + .../ghcmessages/m_t_o_service_item_single.go | 390 + .../ghcmessages/m_t_o_service_item_status.go | 81 + pkg/gen/ghcmessages/m_t_o_service_items.go | 78 + pkg/gen/ghcmessages/m_t_o_shipment.go | 1564 + pkg/gen/ghcmessages/m_t_o_shipment_status.go | 91 + pkg/gen/ghcmessages/m_t_o_shipment_type.go | 97 + pkg/gen/ghcmessages/m_t_o_shipments.go | 78 + pkg/gen/ghcmessages/mobile_home.go | 232 + pkg/gen/ghcmessages/move.go | 932 + pkg/gen/ghcmessages/move_audit_histories.go | 78 + pkg/gen/ghcmessages/move_audit_history.go | 244 + .../ghcmessages/move_audit_history_item.go | 53 + .../ghcmessages/move_audit_history_items.go | 78 + pkg/gen/ghcmessages/move_history.go | 130 + pkg/gen/ghcmessages/move_history_result.go | 139 + pkg/gen/ghcmessages/move_payload.go | 467 + pkg/gen/ghcmessages/move_status.go | 93 + pkg/gen/ghcmessages/move_task_order.go | 431 + pkg/gen/ghcmessages/move_task_orders.go | 78 + pkg/gen/ghcmessages/moving_expense.go | 674 + pkg/gen/ghcmessages/moving_expenses.go | 78 + pkg/gen/ghcmessages/office_user.go | 593 + pkg/gen/ghcmessages/office_user_create.go | 250 + pkg/gen/ghcmessages/office_user_role.go | 55 + .../omittable_moving_expense_type.go | 99 + .../omittable_p_p_m_document_status.go | 81 + pkg/gen/ghcmessages/order.go | 901 + pkg/gen/ghcmessages/order_body.go | 74 + pkg/gen/ghcmessages/orders_type.go | 102 + pkg/gen/ghcmessages/orders_type_detail.go | 93 + pkg/gen/ghcmessages/p_p_m_actual_weight.go | 72 + pkg/gen/ghcmessages/p_p_m_advance_status.go | 89 + pkg/gen/ghcmessages/p_p_m_closeout.go | 225 + .../ghcmessages/p_p_m_destination_address.go | 379 + pkg/gen/ghcmessages/p_p_m_document_status.go | 81 + .../p_p_m_document_status_reason.go | 27 + pkg/gen/ghcmessages/p_p_m_documents.go | 184 + .../ghcmessages/p_p_m_s_i_t_estimated_cost.go | 335 + pkg/gen/ghcmessages/p_p_m_shipment.go | 1264 + pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go | 146 + pkg/gen/ghcmessages/p_p_m_shipment_status.go | 108 + pkg/gen/ghcmessages/p_p_m_status.go | 96 + pkg/gen/ghcmessages/p_w_s_violation.go | 116 + pkg/gen/ghcmessages/p_w_s_violations.go | 78 + ...patch_m_t_o_service_item_status_payload.go | 112 + pkg/gen/ghcmessages/payment_request.go | 471 + pkg/gen/ghcmessages/payment_request_status.go | 96 + pkg/gen/ghcmessages/payment_requests.go | 78 + pkg/gen/ghcmessages/payment_service_item.go | 350 + .../ghcmessages/payment_service_item_param.go | 274 + .../payment_service_item_params.go | 78 + .../payment_service_item_status.go | 90 + pkg/gen/ghcmessages/payment_service_items.go | 78 + pkg/gen/ghcmessages/post_document_payload.go | 74 + pkg/gen/ghcmessages/pro_gear_weight_ticket.go | 463 + .../ghcmessages/pro_gear_weight_tickets.go | 78 + pkg/gen/ghcmessages/proof_of_service_doc.go | 124 + pkg/gen/ghcmessages/proof_of_service_docs.go | 78 + pkg/gen/ghcmessages/queue_move.go | 774 + pkg/gen/ghcmessages/queue_moves.go | 78 + pkg/gen/ghcmessages/queue_moves_result.go | 109 + pkg/gen/ghcmessages/queue_payment_request.go | 512 + .../queue_payment_request_status.go | 84 + pkg/gen/ghcmessages/queue_payment_requests.go | 78 + .../queue_payment_requests_result.go | 109 + pkg/gen/ghcmessages/re_service_item.go | 378 + pkg/gen/ghcmessages/re_service_items.go | 78 + pkg/gen/ghcmessages/reject_shipment.go | 72 + pkg/gen/ghcmessages/report_violation.go | 215 + pkg/gen/ghcmessages/report_violations.go | 78 + pkg/gen/ghcmessages/request_diversion.go | 72 + pkg/gen/ghcmessages/reweigh.go | 195 + pkg/gen/ghcmessages/reweigh_requester.go | 84 + pkg/gen/ghcmessages/role.go | 190 + pkg/gen/ghcmessages/s_i_t_extension.go | 291 + pkg/gen/ghcmessages/s_i_t_extensions.go | 78 + pkg/gen/ghcmessages/s_i_t_location_type.go | 78 + .../s_i_t_service_item_grouping.go | 153 + .../s_i_t_service_item_groupings.go | 78 + pkg/gen/ghcmessages/s_i_t_status.go | 397 + pkg/gen/ghcmessages/s_i_t_summary.go | 199 + pkg/gen/ghcmessages/search_customer.go | 132 + pkg/gen/ghcmessages/search_customers.go | 78 + .../ghcmessages/search_customers_result.go | 109 + pkg/gen/ghcmessages/search_move.go | 370 + pkg/gen/ghcmessages/search_moves.go | 78 + pkg/gen/ghcmessages/search_moves_result.go | 109 + .../ghcmessages/service_item_param_name.go | 282 + .../ghcmessages/service_item_param_origin.go | 84 + .../ghcmessages/service_item_param_type.go | 93 + .../service_item_sit_entry_date.go | 95 + .../ghcmessages/service_request_document.go | 142 + .../ghcmessages/service_request_documents.go | 78 + .../ghcmessages/shipment_address_update.go | 408 + .../shipment_address_update_status.go | 90 + .../shipment_payment_s_i_t_balance.go | 186 + .../shipments_payment_s_i_t_balance.go | 78 + pkg/gen/ghcmessages/signed_certification.go | 408 + .../ghcmessages/signed_certification_type.go | 100 + pkg/gen/ghcmessages/storage_facility.go | 194 + .../submitted_moving_expense_type.go | 99 + pkg/gen/ghcmessages/tac_valid.go | 72 + pkg/gen/ghcmessages/transportation_office.go | 246 + .../transportation_office_assignment.go | 241 + pkg/gen/ghcmessages/transportation_offices.go | 78 + .../ghcmessages/update_allowance_payload.go | 279 + .../update_billable_weight_payload.go | 75 + pkg/gen/ghcmessages/update_boat_shipment.go | 129 + .../ghcmessages/update_customer_payload.go | 247 + .../update_customer_support_remark_payload.go | 72 + ...te_max_billable_weight_as_t_i_o_payload.go | 100 + .../update_mobile_home_shipment.go | 65 + pkg/gen/ghcmessages/update_moving_expense.go | 265 + pkg/gen/ghcmessages/update_order_payload.go | 536 + pkg/gen/ghcmessages/update_p_p_m_shipment.go | 571 + .../update_payment_request_status_payload.go | 111 + .../update_pro_gear_weight_ticket.go | 134 + ...ate_s_i_t_service_item_customer_expense.go | 90 + pkg/gen/ghcmessages/update_shipment.go | 736 + pkg/gen/ghcmessages/update_weight_ticket.go | 177 + pkg/gen/ghcmessages/upload.go | 477 + pkg/gen/ghcmessages/v_location.go | 302 + pkg/gen/ghcmessages/v_locations.go | 78 + pkg/gen/ghcmessages/validation_error.go | 154 + pkg/gen/ghcmessages/weight_ticket.go | 703 + pkg/gen/ghcmessages/weight_tickets.go | 78 + pkg/gen/internalapi/configure_mymove.go | 453 + pkg/gen/internalapi/doc.go | 27 + pkg/gen/internalapi/embedded_spec.go | 17822 +++++++++ .../get_location_by_zip_city_state.go | 58 + ...t_location_by_zip_city_state_parameters.go | 71 + ...et_location_by_zip_city_state_responses.go | 242 + ...t_location_by_zip_city_state_urlbuilder.go | 99 + .../addresses/show_address.go | 58 + .../addresses/show_address_parameters.go | 91 + .../addresses/show_address_responses.go | 159 + .../addresses/show_address_urlbuilder.go | 101 + .../application_parameters/validate.go | 58 + .../validate_parameters.go | 84 + .../validate_responses.go | 134 + .../validate_urlbuilder.go | 87 + .../create_service_member_backup_contact.go | 58 + ...ervice_member_backup_contact_parameters.go | 128 + ...service_member_backup_contact_responses.go | 184 + ...ervice_member_backup_contact_urlbuilder.go | 101 + .../index_service_member_backup_contacts.go | 58 + ...rvice_member_backup_contacts_parameters.go | 91 + ...ervice_member_backup_contacts_responses.go | 187 + ...rvice_member_backup_contacts_urlbuilder.go | 101 + .../show_service_member_backup_contact.go | 58 + ...ervice_member_backup_contact_parameters.go | 91 + ...service_member_backup_contact_responses.go | 184 + ...ervice_member_backup_contact_urlbuilder.go | 101 + .../update_service_member_backup_contact.go | 58 + ...ervice_member_backup_contact_parameters.go | 128 + ...service_member_backup_contact_responses.go | 184 + ...ervice_member_backup_contact_urlbuilder.go | 101 + .../calendar/is_date_weekend_holiday.go | 58 + .../is_date_weekend_holiday_parameters.go | 129 + .../is_date_weekend_holiday_responses.go | 239 + .../is_date_weekend_holiday_urlbuilder.go | 109 + .../calendar/show_available_move_dates.go | 58 + .../show_available_move_dates_parameters.go | 101 + .../show_available_move_dates_responses.go | 159 + .../show_available_move_dates_urlbuilder.go | 102 + .../create_signed_certification.go | 58 + .../create_signed_certification_parameters.go | 128 + .../create_signed_certification_responses.go | 184 + .../create_signed_certification_urlbuilder.go | 101 + .../index_signed_certification.go | 58 + .../index_signed_certification_parameters.go | 91 + .../index_signed_certification_responses.go | 187 + .../index_signed_certification_urlbuilder.go | 101 + .../documents/create_document.go | 58 + .../documents/create_document_parameters.go | 84 + .../documents/create_document_responses.go | 109 + .../documents/create_document_urlbuilder.go | 87 + .../documents/show_document.go | 58 + .../documents/show_document_parameters.go | 91 + .../documents/show_document_responses.go | 179 + .../documents/show_document_urlbuilder.go | 101 + .../duty_locations/search_duty_locations.go | 58 + .../search_duty_locations_parameters.go | 82 + .../search_duty_locations_responses.go | 187 + .../search_duty_locations_urlbuilder.go | 100 + .../entitlements/index_entitlements.go | 58 + .../index_entitlements_parameters.go | 46 + .../index_entitlements_responses.go | 62 + .../index_entitlements_urlbuilder.go | 87 + .../boolean_feature_flag_for_user.go | 58 + ...oolean_feature_flag_for_user_parameters.go | 95 + ...boolean_feature_flag_for_user_responses.go | 134 + ...oolean_feature_flag_for_user_urlbuilder.go | 99 + .../variant_feature_flag_for_user.go | 58 + ...ariant_feature_flag_for_user_parameters.go | 95 + ...variant_feature_flag_for_user_responses.go | 134 + ...ariant_feature_flag_for_user_urlbuilder.go | 99 + .../move_docs/create_generic_move_document.go | 58 + ...create_generic_move_document_parameters.go | 128 + .../create_generic_move_document_responses.go | 159 + ...create_generic_move_document_urlbuilder.go | 101 + .../create_weight_ticket_document.go | 58 + ...reate_weight_ticket_document_parameters.go | 128 + ...create_weight_ticket_document_responses.go | 159 + ...reate_weight_ticket_document_urlbuilder.go | 101 + .../move_docs/delete_move_document.go | 58 + .../delete_move_document_parameters.go | 91 + .../delete_move_document_responses.go | 159 + .../delete_move_document_urlbuilder.go | 101 + .../move_docs/index_move_documents.go | 58 + .../index_move_documents_parameters.go | 91 + .../index_move_documents_responses.go | 137 + .../index_move_documents_urlbuilder.go | 101 + .../move_docs/update_move_document.go | 58 + .../update_move_document_parameters.go | 128 + .../update_move_document_responses.go | 184 + .../update_move_document_urlbuilder.go | 101 + .../internaloperations/moves/get_all_moves.go | 58 + .../moves/get_all_moves_parameters.go | 91 + .../moves/get_all_moves_responses.go | 194 + .../moves/get_all_moves_urlbuilder.go | 101 + .../internaloperations/moves/patch_move.go | 58 + .../moves/patch_move_parameters.go | 158 + .../moves/patch_move_responses.go | 234 + .../moves/patch_move_urlbuilder.go | 101 + .../internaloperations/moves/show_move.go | 58 + .../moves/show_move_parameters.go | 91 + .../moves/show_move_responses.go | 184 + .../moves/show_move_urlbuilder.go | 101 + .../moves/submit_amended_orders.go | 58 + .../moves/submit_amended_orders_parameters.go | 91 + .../moves/submit_amended_orders_responses.go | 204 + .../moves/submit_amended_orders_urlbuilder.go | 101 + .../moves/submit_move_for_approval.go | 58 + .../submit_move_for_approval_parameters.go | 128 + .../submit_move_for_approval_responses.go | 204 + .../submit_move_for_approval_urlbuilder.go | 101 + .../moves/upload_additional_documents.go | 58 + .../upload_additional_documents_parameters.go | 131 + .../upload_additional_documents_responses.go | 204 + .../upload_additional_documents_urlbuilder.go | 101 + .../mto_shipment/create_m_t_o_shipment.go | 67 + .../create_m_t_o_shipment_parameters.go | 76 + .../create_m_t_o_shipment_responses.go | 329 + .../create_m_t_o_shipment_urlbuilder.go | 87 + .../mto_shipment/delete_shipment.go | 58 + .../delete_shipment_parameters.go | 91 + .../mto_shipment/delete_shipment_responses.go | 309 + .../delete_shipment_urlbuilder.go | 101 + .../mto_shipment/list_m_t_o_shipments.go | 58 + .../list_m_t_o_shipments_parameters.go | 91 + .../list_m_t_o_shipments_responses.go | 242 + .../list_m_t_o_shipments_urlbuilder.go | 101 + .../mto_shipment/update_m_t_o_shipment.go | 73 + .../update_m_t_o_shipment_parameters.go | 150 + .../update_m_t_o_shipment_responses.go | 374 + .../update_m_t_o_shipment_urlbuilder.go | 101 + .../internaloperations/mymove_api.go | 1175 + .../internaloperations/office/approve_move.go | 58 + .../office/approve_move_parameters.go | 91 + .../office/approve_move_responses.go | 204 + .../office/approve_move_urlbuilder.go | 101 + .../office/approve_reimbursement.go | 58 + .../approve_reimbursement_parameters.go | 91 + .../office/approve_reimbursement_responses.go | 159 + .../approve_reimbursement_urlbuilder.go | 101 + .../internaloperations/office/cancel_move.go | 58 + .../office/cancel_move_parameters.go | 91 + .../office/cancel_move_responses.go | 204 + .../office/cancel_move_urlbuilder.go | 101 + .../office/show_office_orders.go | 58 + .../office/show_office_orders_parameters.go | 91 + .../office/show_office_orders_responses.go | 184 + .../office/show_office_orders_urlbuilder.go | 101 + .../okta_profile/show_okta_info.go | 58 + .../okta_profile/show_okta_info_parameters.go | 46 + .../okta_profile/show_okta_info_responses.go | 184 + .../okta_profile/show_okta_info_urlbuilder.go | 87 + .../okta_profile/update_okta_info.go | 58 + .../update_okta_info_parameters.go | 84 + .../update_okta_info_responses.go | 202 + .../update_okta_info_urlbuilder.go | 87 + .../orders/create_orders.go | 58 + .../orders/create_orders_parameters.go | 84 + .../orders/create_orders_responses.go | 159 + .../orders/create_orders_urlbuilder.go | 87 + .../internaloperations/orders/show_orders.go | 58 + .../orders/show_orders_parameters.go | 91 + .../orders/show_orders_responses.go | 184 + .../orders/show_orders_urlbuilder.go | 101 + .../orders/update_orders.go | 58 + .../orders/update_orders_parameters.go | 128 + .../orders/update_orders_responses.go | 184 + .../orders/update_orders_urlbuilder.go | 101 + .../orders/upload_amended_orders.go | 58 + .../upload_amended_orders_parameters.go | 131 + .../orders/upload_amended_orders_responses.go | 204 + .../upload_amended_orders_urlbuilder.go | 101 + .../validate_postal_code_with_rate_data.go | 58 + ...e_postal_code_with_rate_data_parameters.go | 135 + ...te_postal_code_with_rate_data_responses.go | 159 + ...e_postal_code_with_rate_data_urlbuilder.go | 110 + .../ppm/create_moving_expense.go | 58 + .../ppm/create_moving_expense_parameters.go | 91 + .../ppm/create_moving_expense_responses.go | 329 + .../ppm/create_moving_expense_urlbuilder.go | 101 + .../ppm/create_p_p_m_upload.go | 58 + .../ppm/create_p_p_m_upload_parameters.go | 220 + .../ppm/create_p_p_m_upload_responses.go | 309 + .../ppm/create_p_p_m_upload_urlbuilder.go | 119 + .../ppm/create_pro_gear_weight_ticket.go | 59 + ...reate_pro_gear_weight_ticket_parameters.go | 91 + ...create_pro_gear_weight_ticket_responses.go | 374 + ...reate_pro_gear_weight_ticket_urlbuilder.go | 101 + .../ppm/create_weight_ticket.go | 58 + .../ppm/create_weight_ticket_parameters.go | 91 + .../ppm/create_weight_ticket_responses.go | 329 + .../ppm/create_weight_ticket_urlbuilder.go | 101 + .../ppm/delete_moving_expense.go | 59 + .../ppm/delete_moving_expense_parameters.go | 134 + .../ppm/delete_moving_expense_responses.go | 354 + .../ppm/delete_moving_expense_urlbuilder.go | 109 + .../ppm/delete_pro_gear_weight_ticket.go | 59 + ...elete_pro_gear_weight_ticket_parameters.go | 134 + ...delete_pro_gear_weight_ticket_responses.go | 354 + ...elete_pro_gear_weight_ticket_urlbuilder.go | 109 + .../ppm/delete_weight_ticket.go | 60 + .../ppm/delete_weight_ticket_parameters.go | 134 + .../ppm/delete_weight_ticket_responses.go | 354 + .../ppm/delete_weight_ticket_urlbuilder.go | 109 + .../resubmit_p_p_m_shipment_documentation.go | 59 + ...p_p_m_shipment_documentation_parameters.go | 201 + ..._p_p_m_shipment_documentation_responses.go | 419 + ...p_p_m_shipment_documentation_urlbuilder.go | 109 + .../ppm/show_a_o_a_packet.go | 62 + .../ppm/show_a_o_a_packet_parameters.go | 71 + .../ppm/show_a_o_a_packet_responses.go | 305 + .../ppm/show_a_o_a_packet_urlbuilder.go | 99 + .../ppm/show_payment_packet.go | 58 + .../ppm/show_payment_packet_parameters.go | 91 + .../ppm/show_payment_packet_responses.go | 203 + .../ppm/show_payment_packet_urlbuilder.go | 101 + .../submit_p_p_m_shipment_documentation.go | 59 + ...p_p_m_shipment_documentation_parameters.go | 128 + ..._p_p_m_shipment_documentation_responses.go | 374 + ...p_p_m_shipment_documentation_urlbuilder.go | 101 + .../ppm/update_moving_expense.go | 58 + .../ppm/update_moving_expense_parameters.go | 201 + .../ppm/update_moving_expense_responses.go | 374 + .../ppm/update_moving_expense_urlbuilder.go | 109 + .../ppm/update_pro_gear_weight_ticket.go | 59 + ...pdate_pro_gear_weight_ticket_parameters.go | 201 + ...update_pro_gear_weight_ticket_responses.go | 374 + ...pdate_pro_gear_weight_ticket_urlbuilder.go | 109 + .../ppm/update_weight_ticket.go | 58 + .../ppm/update_weight_ticket_parameters.go | 201 + .../ppm/update_weight_ticket_responses.go | 374 + .../ppm/update_weight_ticket_urlbuilder.go | 109 + .../internaloperations/queues/show_queue.go | 58 + .../queues/show_queue_parameters.go | 86 + .../queues/show_queue_responses.go | 162 + .../queues/show_queue_urlbuilder.go | 99 + .../service_members/create_service_member.go | 58 + .../create_service_member_parameters.go | 84 + .../create_service_member_responses.go | 184 + .../create_service_member_urlbuilder.go | 87 + .../service_members/patch_service_member.go | 58 + .../patch_service_member_parameters.go | 128 + .../patch_service_member_responses.go | 184 + .../patch_service_member_urlbuilder.go | 101 + .../service_members/show_service_member.go | 58 + .../show_service_member_orders.go | 58 + .../show_service_member_orders_parameters.go | 91 + .../show_service_member_orders_responses.go | 184 + .../show_service_member_orders_urlbuilder.go | 101 + .../show_service_member_parameters.go | 91 + .../show_service_member_responses.go | 184 + .../show_service_member_urlbuilder.go | 101 + .../get_transportation_offices.go | 58 + .../get_transportation_offices_parameters.go | 97 + .../get_transportation_offices_responses.go | 287 + .../get_transportation_offices_urlbuilder.go | 100 + .../show_counseling_offices.go | 58 + .../show_counseling_offices_parameters.go | 91 + .../show_counseling_offices_responses.go | 87 + .../show_counseling_offices_urlbuilder.go | 101 + ...how_duty_location_transportation_office.go | 58 + ...cation_transportation_office_parameters.go | 91 + ...ocation_transportation_office_responses.go | 184 + ...cation_transportation_office_urlbuilder.go | 101 + .../uploads/create_upload.go | 58 + .../uploads/create_upload_parameters.go | 136 + .../uploads/create_upload_responses.go | 204 + .../uploads/create_upload_urlbuilder.go | 105 + .../uploads/delete_upload.go | 58 + .../uploads/delete_upload_parameters.go | 232 + .../uploads/delete_upload_responses.go | 159 + .../uploads/delete_upload_urlbuilder.go | 133 + .../uploads/delete_uploads.go | 58 + .../uploads/delete_uploads_parameters.go | 101 + .../uploads/delete_uploads_responses.go | 159 + .../uploads/delete_uploads_urlbuilder.go | 115 + .../users/is_logged_in_user.go | 119 + .../users/is_logged_in_user_parameters.go | 46 + .../users/is_logged_in_user_responses.go | 107 + .../users/is_logged_in_user_urlbuilder.go | 87 + .../users/show_logged_in_user.go | 58 + .../users/show_logged_in_user_parameters.go | 46 + .../users/show_logged_in_user_responses.go | 134 + .../users/show_logged_in_user_urlbuilder.go | 87 + pkg/gen/internalapi/server.go | 507 + .../create_mobile_home_shipment.go | 156 + .../internalmessages/create_p_p_m_shipment.go | 411 + ...e_service_member_backup_contact_payload.go | 174 + .../create_service_member_payload.go | 421 + pkg/gen/internalmessages/create_shipment.go | 680 + .../create_signed_certification_payload.go | 238 + .../internalmessages/create_update_orders.go | 482 + .../create_weight_ticket_documents_payload.go | 280 + pkg/gen/internalmessages/dept_indicator.go | 90 + pkg/gen/internalmessages/document.go | 169 + .../internalmessages/duty_location_payload.go | 346 + .../duty_locations_payload.go | 78 + pkg/gen/internalmessages/entitlement.go | 73 + pkg/gen/internalmessages/error.go | 108 + .../internalmessages/feature_flag_boolean.go | 126 + .../internalmessages/feature_flag_variant.go | 144 + .../internalmessages/index_entitlements.go | 67 + .../internalmessages/index_moves_payload.go | 78 + ..._service_member_backup_contacts_payload.go | 78 + pkg/gen/internalmessages/internal_move.go | 436 + .../invalid_request_response_payload.go | 50 + .../is_date_weekend_holiday_info.go | 148 + .../logged_in_user_payload.go | 365 + pkg/gen/internalmessages/m_t_o_agent.go | 275 + pkg/gen/internalmessages/m_t_o_agent_type.go | 79 + pkg/gen/internalmessages/m_t_o_agents.go | 78 + pkg/gen/internalmessages/m_t_o_shipment.go | 967 + .../internalmessages/m_t_o_shipment_status.go | 93 + .../internalmessages/m_t_o_shipment_type.go | 97 + pkg/gen/internalmessages/m_t_o_shipments.go | 78 + pkg/gen/internalmessages/method_of_receipt.go | 81 + pkg/gen/internalmessages/mobile_home.go | 232 + .../internalmessages/move_document_payload.go | 597 + .../internalmessages/move_document_status.go | 84 + .../internalmessages/move_document_type.go | 91 + pkg/gen/internalmessages/move_documents.go | 78 + pkg/gen/internalmessages/move_payload.go | 518 + pkg/gen/internalmessages/move_queue_item.go | 563 + pkg/gen/internalmessages/move_status.go | 90 + pkg/gen/internalmessages/moves_list.go | 183 + pkg/gen/internalmessages/moving_expense.go | 674 + .../internalmessages/moving_expense_type.go | 99 + .../nullable_signed_certification_type.go | 84 + pkg/gen/internalmessages/office_user.go | 309 + .../okta_user_profile_data.go | 129 + .../omittable_moving_expense_type.go | 99 + .../omittable_p_p_m_document_status.go | 81 + pkg/gen/internalmessages/order_pay_grade.go | 159 + pkg/gen/internalmessages/orders.go | 821 + pkg/gen/internalmessages/orders_status.go | 84 + pkg/gen/internalmessages/orders_type.go | 102 + .../internalmessages/orders_type_detail.go | 93 + .../internalmessages/p_p_m_advance_status.go | 89 + .../p_p_m_destination_address.go | 379 + .../p_p_m_document_status_reason.go | 27 + .../internalmessages/p_p_m_estimate_range.go | 88 + pkg/gen/internalmessages/p_p_m_shipment.go | 1264 + .../internalmessages/p_p_m_shipment_status.go | 108 + .../internalmessages/patch_move_payload.go | 76 + .../patch_service_member_payload.go | 401 + .../internalmessages/post_document_payload.go | 74 + pkg/gen/internalmessages/ppm_id.go | 40 + pkg/gen/internalmessages/privilege.go | 156 + .../pro_gear_weight_ticket.go | 463 + .../rate_engine_postal_code_payload.go | 145 + pkg/gen/internalmessages/reimbursement.go | 229 + .../internalmessages/reimbursement_status.go | 87 + pkg/gen/internalmessages/role.go | 139 + .../internalmessages/s_i_t_location_type.go | 78 + ...ave_p_p_m_shipment_signed_certification.go | 110 + .../service_member_backup_contact_payload.go | 276 + .../service_member_payload.go | 676 + .../internalmessages/signed_certification.go | 408 + .../signed_certification_payload.go | 327 + .../signed_certification_type.go | 100 + .../signed_certification_type_create.go | 84 + .../internalmessages/signed_certifications.go | 78 + .../submit_move_for_approval_payload.go | 109 + .../submitted_moving_expense_type.go | 99 + .../internalmessages/transportation_office.go | 246 + .../transportation_office_assignment.go | 241 + .../transportation_offices.go | 78 + .../internalmessages/update_boat_shipment.go | 129 + .../update_mobile_home_shipment.go | 65 + .../internalmessages/update_moving_expense.go | 277 + .../update_okta_user_profile_data.go | 109 + .../internalmessages/update_p_p_m_shipment.go | 572 + .../update_pro_gear_weight_ticket.go | 83 + ...e_service_member_backup_contact_payload.go | 174 + pkg/gen/internalmessages/update_shipment.go | 714 + .../internalmessages/update_weight_ticket.go | 132 + pkg/gen/internalmessages/upload.go | 477 + pkg/gen/internalmessages/v_location.go | 302 + pkg/gen/internalmessages/v_locations.go | 78 + pkg/gen/internalmessages/validation_error.go | 154 + pkg/gen/internalmessages/weight_allotment.go | 126 + pkg/gen/internalmessages/weight_ticket.go | 703 + .../weight_ticket_set_type.go | 84 + pkg/gen/internalmessages/weight_tickets.go | 78 + pkg/gen/primeapi/configure_mymove.go | 183 + pkg/gen/primeapi/doc.go | 28 + pkg/gen/primeapi/embedded_spec.go | 9491 +++++ .../create_excess_weight_record.go | 58 + .../create_excess_weight_record_parameters.go | 131 + .../create_excess_weight_record_responses.go | 284 + .../create_excess_weight_record_urlbuilder.go | 101 + .../move_task_order/download_move_order.go | 63 + .../download_move_order_parameters.go | 125 + .../download_move_order_responses.go | 305 + .../download_move_order_urlbuilder.go | 113 + .../move_task_order/get_move_task_order.go | 61 + .../get_move_task_order_parameters.go | 71 + .../get_move_task_order_responses.go | 239 + .../get_move_task_order_urlbuilder.go | 99 + .../move_task_order/list_moves.go | 64 + .../move_task_order/list_moves_parameters.go | 97 + .../move_task_order/list_moves_responses.go | 197 + .../move_task_order/list_moves_urlbuilder.go | 105 + ...pdate_m_t_o_post_counseling_information.go | 65 + ..._post_counseling_information_parameters.go | 102 + ...o_post_counseling_information_responses.go | 374 + ..._post_counseling_information_urlbuilder.go | 99 + .../create_m_t_o_service_item.go | 144 + .../create_m_t_o_service_item_parameters.go | 76 + .../create_m_t_o_service_item_responses.go | 377 + .../create_m_t_o_service_item_urlbuilder.go | 87 + .../create_service_request_document_upload.go | 67 + ...vice_request_document_upload_parameters.go | 111 + ...rvice_request_document_upload_responses.go | 329 + ...vice_request_document_upload_urlbuilder.go | 99 + .../update_m_t_o_service_item.go | 116 + .../update_m_t_o_service_item_parameters.go | 138 + .../update_m_t_o_service_item_responses.go | 419 + .../update_m_t_o_service_item_urlbuilder.go | 99 + .../mto_shipment/create_m_t_o_agent.go | 67 + .../create_m_t_o_agent_parameters.go | 128 + .../create_m_t_o_agent_responses.go | 374 + .../create_m_t_o_agent_urlbuilder.go | 101 + .../mto_shipment/create_m_t_o_shipment.go | 59 + .../create_m_t_o_shipment_parameters.go | 46 + .../create_m_t_o_shipment_responses.go | 37 + .../create_m_t_o_shipment_urlbuilder.go | 87 + .../mto_shipment/create_s_i_t_extension.go | 61 + .../create_s_i_t_extension_parameters.go | 128 + .../create_s_i_t_extension_responses.go | 374 + .../create_s_i_t_extension_urlbuilder.go | 101 + .../mto_shipment/delete_m_t_o_shipment.go | 64 + .../delete_m_t_o_shipment_parameters.go | 91 + .../delete_m_t_o_shipment_responses.go | 309 + .../delete_m_t_o_shipment_urlbuilder.go | 101 + .../mto_shipment/update_m_t_o_agent.go | 67 + .../update_m_t_o_agent_parameters.go | 201 + .../update_m_t_o_agent_responses.go | 374 + .../update_m_t_o_agent_urlbuilder.go | 109 + .../mto_shipment/update_m_t_o_shipment.go | 59 + .../update_m_t_o_shipment_address.go | 72 + ...pdate_m_t_o_shipment_address_parameters.go | 201 + ...update_m_t_o_shipment_address_responses.go | 419 + ...pdate_m_t_o_shipment_address_urlbuilder.go | 109 + .../update_m_t_o_shipment_parameters.go | 91 + .../update_m_t_o_shipment_responses.go | 37 + .../update_m_t_o_shipment_status.go | 60 + ...update_m_t_o_shipment_status_parameters.go | 158 + .../update_m_t_o_shipment_status_responses.go | 419 + ...update_m_t_o_shipment_status_urlbuilder.go | 101 + .../update_m_t_o_shipment_urlbuilder.go | 101 + .../mto_shipment/update_reweigh.go | 64 + .../mto_shipment/update_reweigh_parameters.go | 201 + .../mto_shipment/update_reweigh_responses.go | 419 + .../mto_shipment/update_reweigh_urlbuilder.go | 109 + .../update_shipment_destination_address.go | 76 + ...shipment_destination_address_parameters.go | 158 + ..._shipment_destination_address_responses.go | 419 + ...shipment_destination_address_urlbuilder.go | 101 + .../primeapi/primeoperations/mymove_api.go | 558 + .../payment_request/create_payment_request.go | 407 + .../create_payment_request_parameters.go | 76 + .../create_payment_request_responses.go | 374 + .../create_payment_request_urlbuilder.go | 87 + .../payment_request/create_upload.go | 88 + .../create_upload_parameters.go | 144 + .../create_upload_responses.go | 329 + .../create_upload_urlbuilder.go | 99 + pkg/gen/primeapi/server.go | 507 + .../create_excess_weight_record_parameters.go | 174 + .../create_excess_weight_record_responses.go | 473 + .../download_move_order_parameters.go | 198 + .../download_move_order_responses.go | 487 + .../get_move_task_order_parameters.go | 151 + .../get_move_task_order_responses.go | 399 + .../move_task_order/list_moves_parameters.go | 165 + .../move_task_order/list_moves_responses.go | 323 + .../move_task_order/move_task_order_client.go | 275 + ..._post_counseling_information_parameters.go | 174 + ...o_post_counseling_information_responses.go | 621 + .../create_m_t_o_service_item_parameters.go | 148 + .../create_m_t_o_service_item_responses.go | 621 + ...vice_request_document_upload_parameters.go | 172 + ...rvice_request_document_upload_responses.go | 547 + .../mto_service_item_client.go | 318 + .../update_m_t_o_service_item_parameters.go | 193 + .../update_m_t_o_service_item_responses.go | 695 + .../create_m_t_o_agent_parameters.go | 174 + .../create_m_t_o_agent_responses.go | 621 + .../create_m_t_o_shipment_parameters.go | 128 + .../create_m_t_o_shipment_responses.go | 88 + .../create_s_i_t_extension_parameters.go | 174 + .../create_s_i_t_extension_responses.go | 621 + .../delete_m_t_o_shipment_parameters.go | 153 + .../delete_m_t_o_shipment_responses.go | 535 + .../mto_shipment/mto_shipment_client.go | 524 + .../update_m_t_o_agent_parameters.go | 221 + .../update_m_t_o_agent_responses.go | 621 + ...pdate_m_t_o_shipment_address_parameters.go | 221 + ...update_m_t_o_shipment_address_responses.go | 695 + .../update_m_t_o_shipment_parameters.go | 153 + .../update_m_t_o_shipment_responses.go | 88 + ...update_m_t_o_shipment_status_parameters.go | 197 + .../update_m_t_o_shipment_status_responses.go | 695 + .../mto_shipment/update_reweigh_parameters.go | 221 + .../mto_shipment/update_reweigh_responses.go | 695 + ...shipment_destination_address_parameters.go | 197 + ..._shipment_destination_address_responses.go | 695 + pkg/gen/primeclient/mymove_client.go | 127 + .../create_payment_request_parameters.go | 150 + .../create_payment_request_responses.go | 621 + .../create_upload_parameters.go | 205 + .../create_upload_responses.go | 547 + .../payment_request/payment_request_client.go | 504 + pkg/gen/primemessages/excess_weight_record.go | 226 + pkg/gen/primemessages/list_move.go | 414 + pkg/gen/primemessages/list_moves.go | 78 + pkg/gen/primemessages/m_t_o_agent.go | 306 + pkg/gen/primemessages/m_t_o_agent_type.go | 82 + pkg/gen/primemessages/m_t_o_agents.go | 85 + pkg/gen/primemessages/m_t_o_service_item.go | 523 + .../primemessages/m_t_o_service_item_basic.go | 574 + .../m_t_o_service_item_dest_s_i_t.go | 987 + .../m_t_o_service_item_dimension.go | 129 + .../m_t_o_service_item_domestic_crating.go | 705 + ..._t_o_service_item_international_crating.go | 773 + ...rvice_item_international_fuel_surcharge.go | 575 + .../m_t_o_service_item_model_type.go | 103 + .../m_t_o_service_item_origin_s_i_t.go | 900 + .../m_t_o_service_item_shuttle.go | 633 + .../m_t_o_service_item_status.go | 90 + pkg/gen/primemessages/m_t_o_shipment.go | 204 + pkg/gen/primemessages/m_t_o_shipment_type.go | 107 + .../m_t_o_shipment_without_service_items.go | 1282 + ...m_t_o_shipments_without_service_objects.go | 78 + pkg/gen/primemessages/move_task_order.go | 939 + pkg/gen/primemessages/order.go | 448 + pkg/gen/primemessages/orders_type.go | 102 + pkg/gen/primemessages/p_p_m_shipment.go | 587 + .../primemessages/p_p_m_shipment_status.go | 108 + pkg/gen/primemessages/payment_request.go | 322 + .../primemessages/payment_request_status.go | 96 + pkg/gen/primemessages/payment_requests.go | 78 + pkg/gen/primemessages/payment_service_item.go | 266 + .../payment_service_item_param.go | 274 + .../payment_service_item_params.go | 78 + .../payment_service_item_status.go | 90 + .../primemessages/payment_service_items.go | 78 + pkg/gen/primemessages/proof_of_service_doc.go | 121 + .../primemessages/proof_of_service_docs.go | 78 + pkg/gen/primemessages/re_service_code.go | 219 + pkg/gen/primemessages/reweigh.go | 280 + pkg/gen/primemessages/reweigh_requester.go | 84 + pkg/gen/primemessages/s_i_t_extension.go | 291 + pkg/gen/primemessages/s_i_t_extensions.go | 78 + pkg/gen/primemessages/s_i_t_location_type.go | 78 + pkg/gen/primemessages/service_item.go | 211 + .../primemessages/service_item_param_name.go | 282 + .../service_item_param_origin.go | 84 + .../primemessages/service_item_param_type.go | 93 + .../primemessages/service_request_document.go | 121 + .../service_request_documents.go | 78 + .../primemessages/shipment_address_update.go | 408 + .../shipment_address_update_status.go | 90 + pkg/gen/primemessages/storage_facility.go | 194 + .../update_m_t_o_service_item.go | 194 + ...o_service_item_international_port_f_s_c.go | 249 + .../update_m_t_o_service_item_model_type.go | 95 + .../update_m_t_o_service_item_s_i_t.go | 680 + .../update_m_t_o_service_item_shuttle.go | 264 + .../primemessages/update_m_t_o_shipment.go | 570 + .../update_m_t_o_shipment_status.go | 102 + .../primemessages/update_p_p_m_shipment.go | 199 + pkg/gen/primemessages/update_reweigh.go | 79 + .../update_shipment_destination_address.go | 126 + .../primemessages/upload_with_omissions.go | 279 + pkg/gen/primemessages/validation_error.go | 132 + pkg/gen/primev2api/configure_mymove.go | 87 + pkg/gen/primev2api/doc.go | 26 + pkg/gen/primev2api/embedded_spec.go | 7217 ++++ .../move_task_order/get_move_task_order.go | 65 + .../get_move_task_order_parameters.go | 71 + .../get_move_task_order_responses.go | 239 + .../get_move_task_order_urlbuilder.go | 99 + .../mto_shipment/create_m_t_o_shipment.go | 73 + .../create_m_t_o_shipment_parameters.go | 76 + .../create_m_t_o_shipment_responses.go | 239 + .../create_m_t_o_shipment_urlbuilder.go | 87 + .../mto_shipment/update_m_t_o_shipment.go | 72 + .../update_m_t_o_shipment_parameters.go | 158 + .../update_m_t_o_shipment_responses.go | 374 + .../update_m_t_o_shipment_urlbuilder.go | 101 + .../primev2operations/mymove_api.go | 334 + pkg/gen/primev2api/server.go | 507 + .../get_move_task_order_parameters.go | 151 + .../get_move_task_order_responses.go | 399 + .../move_task_order/move_task_order_client.go | 89 + .../create_m_t_o_shipment_parameters.go | 150 + .../create_m_t_o_shipment_responses.go | 399 + .../mto_shipment/mto_shipment_client.go | 153 + .../update_m_t_o_shipment_parameters.go | 197 + .../update_m_t_o_shipment_responses.go | 621 + pkg/gen/primev2client/mymove_client.go | 117 + pkg/gen/primev2messages/m_t_o_agent_type.go | 82 + pkg/gen/primev2messages/m_t_o_agents.go | 85 + pkg/gen/primev2messages/m_t_o_service_item.go | 517 + .../m_t_o_service_item_basic.go | 574 + .../m_t_o_service_item_dest_s_i_t.go | 987 + .../m_t_o_service_item_dimension.go | 129 + .../m_t_o_service_item_domestic_crating.go | 705 + ..._t_o_service_item_international_crating.go | 773 + .../m_t_o_service_item_model_type.go | 103 + .../m_t_o_service_item_origin_s_i_t.go | 900 + .../m_t_o_service_item_shuttle.go | 633 + .../m_t_o_service_item_status.go | 90 + pkg/gen/primev2messages/m_t_o_shipment.go | 204 + .../primev2messages/m_t_o_shipment_type.go | 107 + .../m_t_o_shipment_without_service_items.go | 1282 + ...m_t_o_shipments_without_service_objects.go | 78 + pkg/gen/primev2messages/move_task_order.go | 965 + pkg/gen/primev2messages/order.go | 516 + pkg/gen/primev2messages/orders_type.go | 102 + pkg/gen/primev2messages/p_p_m_shipment.go | 587 + .../primev2messages/p_p_m_shipment_status.go | 108 + pkg/gen/primev2messages/payment_request.go | 322 + .../primev2messages/payment_request_status.go | 96 + pkg/gen/primev2messages/payment_requests.go | 78 + .../primev2messages/payment_service_item.go | 266 + .../payment_service_item_param.go | 274 + .../payment_service_item_params.go | 78 + .../payment_service_item_status.go | 90 + .../primev2messages/payment_service_items.go | 78 + .../primev2messages/proof_of_service_doc.go | 121 + .../primev2messages/proof_of_service_docs.go | 78 + pkg/gen/primev2messages/re_service_code.go | 219 + pkg/gen/primev2messages/reweigh.go | 280 + pkg/gen/primev2messages/reweigh_requester.go | 84 + pkg/gen/primev2messages/s_i_t_extension.go | 291 + pkg/gen/primev2messages/s_i_t_extensions.go | 78 + .../primev2messages/s_i_t_location_type.go | 78 + .../service_item_param_name.go | 282 + .../service_item_param_origin.go | 84 + .../service_item_param_type.go | 93 + .../service_request_document.go | 121 + .../service_request_documents.go | 78 + .../shipment_address_update.go | 408 + .../shipment_address_update_status.go | 90 + pkg/gen/primev2messages/storage_facility.go | 194 + .../update_m_t_o_service_item.go | 188 + .../update_m_t_o_service_item_model_type.go | 86 + .../update_m_t_o_service_item_s_i_t.go | 680 + .../update_m_t_o_service_item_shuttle.go | 264 + .../primev2messages/update_m_t_o_shipment.go | 534 + .../update_m_t_o_shipment_status.go | 102 + .../primev2messages/update_p_p_m_shipment.go | 199 + pkg/gen/primev2messages/update_reweigh.go | 79 + .../update_shipment_destination_address.go | 126 + .../primev2messages/upload_with_omissions.go | 279 + pkg/gen/primev2messages/validation_error.go | 132 + pkg/gen/primev3api/configure_mymove.go | 87 + pkg/gen/primev3api/doc.go | 26 + pkg/gen/primev3api/embedded_spec.go | 8587 ++++ .../move_task_order/get_move_task_order.go | 61 + .../get_move_task_order_parameters.go | 71 + .../get_move_task_order_responses.go | 239 + .../get_move_task_order_urlbuilder.go | 99 + .../mto_shipment/create_m_t_o_shipment.go | 69 + .../create_m_t_o_shipment_parameters.go | 76 + .../create_m_t_o_shipment_responses.go | 239 + .../create_m_t_o_shipment_urlbuilder.go | 87 + .../mto_shipment/update_m_t_o_shipment.go | 68 + .../update_m_t_o_shipment_parameters.go | 158 + .../update_m_t_o_shipment_responses.go | 374 + .../update_m_t_o_shipment_urlbuilder.go | 101 + .../primev3operations/mymove_api.go | 334 + pkg/gen/primev3api/server.go | 507 + .../get_move_task_order_parameters.go | 151 + .../get_move_task_order_responses.go | 399 + .../move_task_order/move_task_order_client.go | 85 + .../create_m_t_o_shipment_parameters.go | 150 + .../create_m_t_o_shipment_responses.go | 399 + .../mto_shipment/mto_shipment_client.go | 145 + .../update_m_t_o_shipment_parameters.go | 197 + .../update_m_t_o_shipment_responses.go | 621 + pkg/gen/primev3client/mymove_client.go | 117 + pkg/gen/primev3messages/error.go | 108 + pkg/gen/primev3messages/m_t_o_agent.go | 306 + pkg/gen/primev3messages/m_t_o_agent_type.go | 82 + pkg/gen/primev3messages/m_t_o_agents.go | 85 + pkg/gen/primev3messages/m_t_o_service_item.go | 517 + .../m_t_o_service_item_basic.go | 574 + .../m_t_o_service_item_dest_s_i_t.go | 987 + .../m_t_o_service_item_dimension.go | 129 + .../m_t_o_service_item_domestic_crating.go | 705 + ..._t_o_service_item_international_crating.go | 773 + .../m_t_o_service_item_model_type.go | 103 + .../m_t_o_service_item_origin_s_i_t.go | 900 + .../m_t_o_service_item_shuttle.go | 633 + .../m_t_o_service_item_status.go | 90 + pkg/gen/primev3messages/m_t_o_shipment.go | 204 + .../primev3messages/m_t_o_shipment_type.go | 107 + .../m_t_o_shipment_without_service_items.go | 1740 + ...m_t_o_shipments_without_service_objects.go | 78 + pkg/gen/primev3messages/mobile_home.go | 232 + pkg/gen/primev3messages/move_task_order.go | 965 + pkg/gen/primev3messages/order.go | 516 + pkg/gen/primev3messages/orders_type.go | 102 + .../p_p_m_destination_address.go | 379 + pkg/gen/primev3messages/p_p_m_shipment.go | 1003 + .../primev3messages/p_p_m_shipment_status.go | 108 + pkg/gen/primev3messages/payment_request.go | 322 + .../primev3messages/payment_request_status.go | 96 + pkg/gen/primev3messages/payment_requests.go | 78 + .../primev3messages/payment_service_item.go | 266 + .../payment_service_item_param.go | 274 + .../payment_service_item_params.go | 78 + .../payment_service_item_status.go | 90 + .../primev3messages/payment_service_items.go | 78 + pkg/gen/primev3messages/port.go | 385 + .../primev3messages/proof_of_service_doc.go | 121 + .../primev3messages/proof_of_service_docs.go | 78 + pkg/gen/primev3messages/rate_area.go | 113 + pkg/gen/primev3messages/re_service_code.go | 219 + pkg/gen/primev3messages/reweigh.go | 280 + pkg/gen/primev3messages/reweigh_requester.go | 84 + pkg/gen/primev3messages/s_i_t_extension.go | 291 + pkg/gen/primev3messages/s_i_t_extensions.go | 78 + .../primev3messages/s_i_t_location_type.go | 78 + .../service_item_param_name.go | 282 + .../service_item_param_origin.go | 84 + .../service_item_param_type.go | 93 + .../service_request_document.go | 121 + .../service_request_documents.go | 78 + .../shipment_address_update.go | 408 + .../shipment_address_update_status.go | 90 + pkg/gen/primev3messages/storage_facility.go | 194 + .../update_m_t_o_service_item.go | 188 + .../update_m_t_o_service_item_model_type.go | 86 + .../update_m_t_o_service_item_s_i_t.go | 680 + .../update_m_t_o_service_item_shuttle.go | 264 + .../primev3messages/update_m_t_o_shipment.go | 690 + .../update_m_t_o_shipment_status.go | 102 + .../primev3messages/update_p_p_m_shipment.go | 373 + pkg/gen/primev3messages/update_reweigh.go | 79 + .../update_shipment_destination_address.go | 126 + .../primev3messages/upload_with_omissions.go | 279 + pkg/gen/primev3messages/validation_error.go | 132 + pkg/gen/supportapi/configure_mymove.go | 145 + pkg/gen/supportapi/doc.go | 26 + pkg/gen/supportapi/embedded_spec.go | 5480 +++ pkg/gen/supportapi/server.go | 507 + .../move_task_order/create_move_task_order.go | 70 + .../create_move_task_order_parameters.go | 84 + .../create_move_task_order_responses.go | 329 + .../create_move_task_order_urlbuilder.go | 87 + .../move_task_order/get_move_task_order.go | 63 + .../get_move_task_order_parameters.go | 71 + .../get_move_task_order_responses.go | 239 + .../get_move_task_order_urlbuilder.go | 99 + .../hide_non_fake_move_task_orders.go | 60 + ...de_non_fake_move_task_orders_parameters.go | 46 + ...ide_non_fake_move_task_orders_responses.go | 419 + ...de_non_fake_move_task_orders_urlbuilder.go | 87 + .../move_task_order/list_m_t_os.go | 61 + .../move_task_order/list_m_t_os_parameters.go | 83 + .../move_task_order/list_m_t_os_responses.go | 287 + .../move_task_order/list_m_t_os_urlbuilder.go | 105 + .../make_move_task_order_available.go | 60 + ...ke_move_task_order_available_parameters.go | 102 + ...ake_move_task_order_available_responses.go | 374 + ...ke_move_task_order_available_urlbuilder.go | 99 + .../update_m_t_o_service_item_status.go | 60 + ...te_m_t_o_service_item_status_parameters.go | 139 + ...ate_m_t_o_service_item_status_responses.go | 419 + ...te_m_t_o_service_item_status_urlbuilder.go | 99 + .../update_m_t_o_shipment_status.go | 58 + ...update_m_t_o_shipment_status_parameters.go | 158 + .../update_m_t_o_shipment_status_responses.go | 419 + ...update_m_t_o_shipment_status_urlbuilder.go | 101 + .../supportoperations/mymove_api.go | 469 + .../get_payment_request_e_d_i.go | 62 + .../get_payment_request_e_d_i_parameters.go | 91 + .../get_payment_request_e_d_i_responses.go | 374 + .../get_payment_request_e_d_i_urlbuilder.go | 101 + .../list_m_t_o_payment_requests.go | 62 + .../list_m_t_o_payment_requests_parameters.go | 91 + .../list_m_t_o_payment_requests_responses.go | 287 + .../list_m_t_o_payment_requests_urlbuilder.go | 101 + .../process_reviewed_payment_requests.go | 61 + ...ss_reviewed_payment_requests_parameters.go | 84 + ...ess_reviewed_payment_requests_responses.go | 332 + ...ss_reviewed_payment_requests_urlbuilder.go | 87 + .../recalculate_payment_request.go | 62 + .../recalculate_payment_request_parameters.go | 91 + .../recalculate_payment_request_responses.go | 419 + .../recalculate_payment_request_urlbuilder.go | 101 + .../update_payment_request_status.go | 62 + ...pdate_payment_request_status_parameters.go | 158 + ...update_payment_request_status_responses.go | 419 + ...pdate_payment_request_status_urlbuilder.go | 101 + .../webhook/create_webhook_notification.go | 58 + .../create_webhook_notification_parameters.go | 76 + .../create_webhook_notification_responses.go | 149 + .../create_webhook_notification_urlbuilder.go | 87 + .../webhook/receive_webhook_notification.go | 58 + ...receive_webhook_notification_parameters.go | 84 + .../receive_webhook_notification_responses.go | 239 + ...receive_webhook_notification_urlbuilder.go | 87 + .../create_move_task_order_parameters.go | 150 + .../create_move_task_order_responses.go | 547 + .../get_move_task_order_parameters.go | 151 + .../get_move_task_order_responses.go | 399 + ...de_non_fake_move_task_orders_parameters.go | 128 + ...ide_non_fake_move_task_orders_responses.go | 695 + .../move_task_order/list_m_t_os_parameters.go | 166 + .../move_task_order/list_m_t_os_responses.go | 471 + ...ke_move_task_order_available_parameters.go | 174 + ...ake_move_task_order_available_responses.go | 621 + .../move_task_order/move_task_order_client.go | 278 + .../mto_service_item_client.go | 84 + ...te_m_t_o_service_item_status_parameters.go | 195 + ...ate_m_t_o_service_item_status_responses.go | 695 + .../mto_shipment/mto_shipment_client.go | 81 + ...update_m_t_o_shipment_status_parameters.go | 197 + .../update_m_t_o_shipment_status_responses.go | 695 + pkg/gen/supportclient/mymove_client.go | 132 + .../get_payment_request_e_d_i_parameters.go | 153 + .../get_payment_request_e_d_i_responses.go | 621 + .../list_m_t_o_payment_requests_parameters.go | 153 + .../list_m_t_o_payment_requests_responses.go | 471 + .../payment_request/payment_request_client.go | 271 + ...ss_reviewed_payment_requests_parameters.go | 150 + ...ess_reviewed_payment_requests_responses.go | 545 + .../recalculate_payment_request_parameters.go | 153 + .../recalculate_payment_request_responses.go | 695 + ...pdate_payment_request_status_parameters.go | 197 + ...update_payment_request_status_responses.go | 695 + .../create_webhook_notification_parameters.go | 153 + .../create_webhook_notification_responses.go | 251 + ...receive_webhook_notification_parameters.go | 153 + .../receive_webhook_notification_responses.go | 399 + .../supportclient/webhook/webhook_client.go | 123 + pkg/gen/supportmessages/orders_type_detail.go | 93 + pkg/gen/supportmessages/payment_request.go | 289 + .../supportmessages/payment_request_e_d_i.go | 111 + .../supportmessages/payment_request_status.go | 96 + pkg/gen/supportmessages/payment_requests.go | 78 + .../process_reviewed_payment_requests.go | 180 + .../proof_of_service_package.go | 143 + pkg/gen/supportmessages/rank.go | 159 + pkg/gen/supportmessages/re_service_code.go | 219 + .../update_m_t_o_service_item_status.go | 108 + .../update_m_t_o_shipment_status.go | 121 + .../update_payment_request_status.go | 126 + .../supportmessages/upload_with_omissions.go | 279 + pkg/gen/supportmessages/validation_error.go | 132 + .../supportmessages/webhook_notification.go | 312 + .../webhook_notification_status.go | 87 + 1668 files changed, 393205 insertions(+), 5 deletions(-) delete mode 100644 migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/mymove_api.go create mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications.go create mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations.go create mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload.go create mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go create mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/users/get_user.go create mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/users/index_users.go create mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/users/update_user.go create mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go create mode 100644 pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go create mode 100644 pkg/gen/adminapi/configure_mymove.go create mode 100644 pkg/gen/adminapi/doc.go create mode 100644 pkg/gen/adminapi/embedded_spec.go create mode 100644 pkg/gen/adminapi/server.go create mode 100644 pkg/gen/adminmessages/electronic_order.go create mode 100644 pkg/gen/adminmessages/electronic_orders.go create mode 100644 pkg/gen/adminmessages/electronic_orders_total.go create mode 100644 pkg/gen/adminmessages/electronic_orders_totals.go create mode 100644 pkg/gen/adminmessages/issuer.go create mode 100644 pkg/gen/adminmessages/move.go create mode 100644 pkg/gen/adminmessages/move_status.go create mode 100644 pkg/gen/adminmessages/move_update.go create mode 100644 pkg/gen/adminmessages/moves.go create mode 100644 pkg/gen/adminmessages/notification.go create mode 100644 pkg/gen/adminmessages/notifications.go create mode 100644 pkg/gen/adminmessages/office_user.go create mode 100644 pkg/gen/adminmessages/office_user_create.go create mode 100644 pkg/gen/adminmessages/office_user_privilege.go create mode 100644 pkg/gen/adminmessages/office_user_role.go create mode 100644 pkg/gen/adminmessages/office_user_transportation_office_assignment.go create mode 100644 pkg/gen/adminmessages/office_user_update.go create mode 100644 pkg/gen/adminmessages/office_users.go create mode 100644 pkg/gen/adminmessages/okta_account_info_response.go create mode 100644 pkg/gen/adminmessages/organization.go create mode 100644 pkg/gen/adminmessages/organizations.go create mode 100644 pkg/gen/adminmessages/payment_request_syncada_file.go create mode 100644 pkg/gen/adminmessages/payment_request_syncada_files.go create mode 100644 pkg/gen/adminmessages/privilege.go create mode 100644 pkg/gen/adminmessages/requested_office_user_update.go create mode 100644 pkg/gen/adminmessages/role.go create mode 100644 pkg/gen/adminmessages/service_member.go create mode 100644 pkg/gen/adminmessages/transportation_office.go create mode 100644 pkg/gen/adminmessages/transportation_office_assignment.go create mode 100644 pkg/gen/adminmessages/transportation_offices.go create mode 100644 pkg/gen/adminmessages/upload.go create mode 100644 pkg/gen/adminmessages/upload_information.go create mode 100644 pkg/gen/adminmessages/user.go create mode 100644 pkg/gen/adminmessages/user_update.go create mode 100644 pkg/gen/adminmessages/users.go create mode 100644 pkg/gen/adminmessages/validation_error.go create mode 100644 pkg/gen/adminmessages/webhook_subscription.go create mode 100644 pkg/gen/adminmessages/webhook_subscription_status.go create mode 100644 pkg/gen/adminmessages/webhook_subscriptions.go create mode 100644 pkg/gen/ghcapi/configure_mymove.go create mode 100644 pkg/gen/ghcapi/doc.go create mode 100644 pkg/gen/ghcapi/embedded_spec.go create mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go create mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go create mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go create mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go create mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/mymove_api.go create mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go create mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go create mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go create mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go create mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go create mode 100644 pkg/gen/ghcapi/server.go create mode 100644 pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go create mode 100644 pkg/gen/ghcmessages/bulk_assignment_move_id.go create mode 100644 pkg/gen/ghcmessages/client_error.go create mode 100644 pkg/gen/ghcmessages/contractor.go create mode 100644 pkg/gen/ghcmessages/counseling_update_allowance_payload.go create mode 100644 pkg/gen/ghcmessages/counseling_update_order_payload.go create mode 100644 pkg/gen/ghcmessages/create_appeal.go create mode 100644 pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go create mode 100644 pkg/gen/ghcmessages/create_boat_shipment.go create mode 100644 pkg/gen/ghcmessages/create_customer_payload.go create mode 100644 pkg/gen/ghcmessages/create_customer_support_remark.go create mode 100644 pkg/gen/ghcmessages/create_evaluation_report.go create mode 100644 pkg/gen/ghcmessages/create_m_t_o_shipment.go create mode 100644 pkg/gen/ghcmessages/create_mobile_home_shipment.go create mode 100644 pkg/gen/ghcmessages/create_orders.go create mode 100644 pkg/gen/ghcmessages/create_p_p_m_shipment.go create mode 100644 pkg/gen/ghcmessages/created_customer.go create mode 100644 pkg/gen/ghcmessages/customer.go create mode 100644 pkg/gen/ghcmessages/customer_contact_type.go create mode 100644 pkg/gen/ghcmessages/customer_support_remark.go create mode 100644 pkg/gen/ghcmessages/customer_support_remarks.go create mode 100644 pkg/gen/ghcmessages/deny_s_i_t_extension.go create mode 100644 pkg/gen/ghcmessages/department_indicator.go create mode 100644 pkg/gen/ghcmessages/dept_indicator.go create mode 100644 pkg/gen/ghcmessages/destination_type.go create mode 100644 pkg/gen/ghcmessages/dimension_type.go create mode 100644 pkg/gen/ghcmessages/document.go create mode 100644 pkg/gen/ghcmessages/duty_location.go create mode 100644 pkg/gen/ghcmessages/entitlements.go create mode 100644 pkg/gen/ghcmessages/error.go create mode 100644 pkg/gen/ghcmessages/evaluation_report.go create mode 100644 pkg/gen/ghcmessages/evaluation_report_inspection_type.go create mode 100644 pkg/gen/ghcmessages/evaluation_report_list.go create mode 100644 pkg/gen/ghcmessages/evaluation_report_location.go create mode 100644 pkg/gen/ghcmessages/evaluation_report_office_user.go create mode 100644 pkg/gen/ghcmessages/evaluation_report_type.go create mode 100644 pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go create mode 100644 pkg/gen/ghcmessages/g_b_l_o_c.go create mode 100644 pkg/gen/ghcmessages/g_b_l_o_cs.go create mode 100644 pkg/gen/ghcmessages/g_s_r_appeal.go create mode 100644 pkg/gen/ghcmessages/g_s_r_appeal_status_type.go create mode 100644 pkg/gen/ghcmessages/g_s_r_appeals.go create mode 100644 pkg/gen/ghcmessages/grade.go create mode 100644 pkg/gen/ghcmessages/invalid_request_response_payload.go create mode 100644 pkg/gen/ghcmessages/is_date_weekend_holiday_info.go create mode 100644 pkg/gen/ghcmessages/l_o_a_type.go create mode 100644 pkg/gen/ghcmessages/line_of_accounting.go create mode 100644 pkg/gen/ghcmessages/list_prime_move.go create mode 100644 pkg/gen/ghcmessages/list_prime_moves.go create mode 100644 pkg/gen/ghcmessages/list_prime_moves_result.go create mode 100644 pkg/gen/ghcmessages/location.go create mode 100644 pkg/gen/ghcmessages/locations.go create mode 100644 pkg/gen/ghcmessages/locked_office_user.go create mode 100644 pkg/gen/ghcmessages/m_t_o_agent.go create mode 100644 pkg/gen/ghcmessages/m_t_o_agents.go create mode 100644 pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_dimension.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_single.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_item_status.go create mode 100644 pkg/gen/ghcmessages/m_t_o_service_items.go create mode 100644 pkg/gen/ghcmessages/m_t_o_shipment.go create mode 100644 pkg/gen/ghcmessages/m_t_o_shipment_status.go create mode 100644 pkg/gen/ghcmessages/m_t_o_shipment_type.go create mode 100644 pkg/gen/ghcmessages/m_t_o_shipments.go create mode 100644 pkg/gen/ghcmessages/mobile_home.go create mode 100644 pkg/gen/ghcmessages/move.go create mode 100644 pkg/gen/ghcmessages/move_audit_histories.go create mode 100644 pkg/gen/ghcmessages/move_audit_history.go create mode 100644 pkg/gen/ghcmessages/move_audit_history_item.go create mode 100644 pkg/gen/ghcmessages/move_audit_history_items.go create mode 100644 pkg/gen/ghcmessages/move_history.go create mode 100644 pkg/gen/ghcmessages/move_history_result.go create mode 100644 pkg/gen/ghcmessages/move_payload.go create mode 100644 pkg/gen/ghcmessages/move_status.go create mode 100644 pkg/gen/ghcmessages/move_task_order.go create mode 100644 pkg/gen/ghcmessages/move_task_orders.go create mode 100644 pkg/gen/ghcmessages/moving_expense.go create mode 100644 pkg/gen/ghcmessages/moving_expenses.go create mode 100644 pkg/gen/ghcmessages/office_user.go create mode 100644 pkg/gen/ghcmessages/office_user_create.go create mode 100644 pkg/gen/ghcmessages/office_user_role.go create mode 100644 pkg/gen/ghcmessages/omittable_moving_expense_type.go create mode 100644 pkg/gen/ghcmessages/omittable_p_p_m_document_status.go create mode 100644 pkg/gen/ghcmessages/order.go create mode 100644 pkg/gen/ghcmessages/order_body.go create mode 100644 pkg/gen/ghcmessages/orders_type.go create mode 100644 pkg/gen/ghcmessages/orders_type_detail.go create mode 100644 pkg/gen/ghcmessages/p_p_m_actual_weight.go create mode 100644 pkg/gen/ghcmessages/p_p_m_advance_status.go create mode 100644 pkg/gen/ghcmessages/p_p_m_closeout.go create mode 100644 pkg/gen/ghcmessages/p_p_m_destination_address.go create mode 100644 pkg/gen/ghcmessages/p_p_m_document_status.go create mode 100644 pkg/gen/ghcmessages/p_p_m_document_status_reason.go create mode 100644 pkg/gen/ghcmessages/p_p_m_documents.go create mode 100644 pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go create mode 100644 pkg/gen/ghcmessages/p_p_m_shipment.go create mode 100644 pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go create mode 100644 pkg/gen/ghcmessages/p_p_m_shipment_status.go create mode 100644 pkg/gen/ghcmessages/p_p_m_status.go create mode 100644 pkg/gen/ghcmessages/p_w_s_violation.go create mode 100644 pkg/gen/ghcmessages/p_w_s_violations.go create mode 100644 pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go create mode 100644 pkg/gen/ghcmessages/payment_request.go create mode 100644 pkg/gen/ghcmessages/payment_request_status.go create mode 100644 pkg/gen/ghcmessages/payment_requests.go create mode 100644 pkg/gen/ghcmessages/payment_service_item.go create mode 100644 pkg/gen/ghcmessages/payment_service_item_param.go create mode 100644 pkg/gen/ghcmessages/payment_service_item_params.go create mode 100644 pkg/gen/ghcmessages/payment_service_item_status.go create mode 100644 pkg/gen/ghcmessages/payment_service_items.go create mode 100644 pkg/gen/ghcmessages/post_document_payload.go create mode 100644 pkg/gen/ghcmessages/pro_gear_weight_ticket.go create mode 100644 pkg/gen/ghcmessages/pro_gear_weight_tickets.go create mode 100644 pkg/gen/ghcmessages/proof_of_service_doc.go create mode 100644 pkg/gen/ghcmessages/proof_of_service_docs.go create mode 100644 pkg/gen/ghcmessages/queue_move.go create mode 100644 pkg/gen/ghcmessages/queue_moves.go create mode 100644 pkg/gen/ghcmessages/queue_moves_result.go create mode 100644 pkg/gen/ghcmessages/queue_payment_request.go create mode 100644 pkg/gen/ghcmessages/queue_payment_request_status.go create mode 100644 pkg/gen/ghcmessages/queue_payment_requests.go create mode 100644 pkg/gen/ghcmessages/queue_payment_requests_result.go create mode 100644 pkg/gen/ghcmessages/re_service_item.go create mode 100644 pkg/gen/ghcmessages/re_service_items.go create mode 100644 pkg/gen/ghcmessages/reject_shipment.go create mode 100644 pkg/gen/ghcmessages/report_violation.go create mode 100644 pkg/gen/ghcmessages/report_violations.go create mode 100644 pkg/gen/ghcmessages/request_diversion.go create mode 100644 pkg/gen/ghcmessages/reweigh.go create mode 100644 pkg/gen/ghcmessages/reweigh_requester.go create mode 100644 pkg/gen/ghcmessages/role.go create mode 100644 pkg/gen/ghcmessages/s_i_t_extension.go create mode 100644 pkg/gen/ghcmessages/s_i_t_extensions.go create mode 100644 pkg/gen/ghcmessages/s_i_t_location_type.go create mode 100644 pkg/gen/ghcmessages/s_i_t_service_item_grouping.go create mode 100644 pkg/gen/ghcmessages/s_i_t_service_item_groupings.go create mode 100644 pkg/gen/ghcmessages/s_i_t_status.go create mode 100644 pkg/gen/ghcmessages/s_i_t_summary.go create mode 100644 pkg/gen/ghcmessages/search_customer.go create mode 100644 pkg/gen/ghcmessages/search_customers.go create mode 100644 pkg/gen/ghcmessages/search_customers_result.go create mode 100644 pkg/gen/ghcmessages/search_move.go create mode 100644 pkg/gen/ghcmessages/search_moves.go create mode 100644 pkg/gen/ghcmessages/search_moves_result.go create mode 100644 pkg/gen/ghcmessages/service_item_param_name.go create mode 100644 pkg/gen/ghcmessages/service_item_param_origin.go create mode 100644 pkg/gen/ghcmessages/service_item_param_type.go create mode 100644 pkg/gen/ghcmessages/service_item_sit_entry_date.go create mode 100644 pkg/gen/ghcmessages/service_request_document.go create mode 100644 pkg/gen/ghcmessages/service_request_documents.go create mode 100644 pkg/gen/ghcmessages/shipment_address_update.go create mode 100644 pkg/gen/ghcmessages/shipment_address_update_status.go create mode 100644 pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go create mode 100644 pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go create mode 100644 pkg/gen/ghcmessages/signed_certification.go create mode 100644 pkg/gen/ghcmessages/signed_certification_type.go create mode 100644 pkg/gen/ghcmessages/storage_facility.go create mode 100644 pkg/gen/ghcmessages/submitted_moving_expense_type.go create mode 100644 pkg/gen/ghcmessages/tac_valid.go create mode 100644 pkg/gen/ghcmessages/transportation_office.go create mode 100644 pkg/gen/ghcmessages/transportation_office_assignment.go create mode 100644 pkg/gen/ghcmessages/transportation_offices.go create mode 100644 pkg/gen/ghcmessages/update_allowance_payload.go create mode 100644 pkg/gen/ghcmessages/update_billable_weight_payload.go create mode 100644 pkg/gen/ghcmessages/update_boat_shipment.go create mode 100644 pkg/gen/ghcmessages/update_customer_payload.go create mode 100644 pkg/gen/ghcmessages/update_customer_support_remark_payload.go create mode 100644 pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go create mode 100644 pkg/gen/ghcmessages/update_mobile_home_shipment.go create mode 100644 pkg/gen/ghcmessages/update_moving_expense.go create mode 100644 pkg/gen/ghcmessages/update_order_payload.go create mode 100644 pkg/gen/ghcmessages/update_p_p_m_shipment.go create mode 100644 pkg/gen/ghcmessages/update_payment_request_status_payload.go create mode 100644 pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go create mode 100644 pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go create mode 100644 pkg/gen/ghcmessages/update_shipment.go create mode 100644 pkg/gen/ghcmessages/update_weight_ticket.go create mode 100644 pkg/gen/ghcmessages/upload.go create mode 100644 pkg/gen/ghcmessages/v_location.go create mode 100644 pkg/gen/ghcmessages/v_locations.go create mode 100644 pkg/gen/ghcmessages/validation_error.go create mode 100644 pkg/gen/ghcmessages/weight_ticket.go create mode 100644 pkg/gen/ghcmessages/weight_tickets.go create mode 100644 pkg/gen/internalapi/configure_mymove.go create mode 100644 pkg/gen/internalapi/doc.go create mode 100644 pkg/gen/internalapi/embedded_spec.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate.go create mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go create mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go create mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/mymove_api.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move.go create mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go create mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue.go create mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go create mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go create mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go create mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go create mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go create mode 100644 pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go create mode 100644 pkg/gen/internalapi/server.go create mode 100644 pkg/gen/internalmessages/create_mobile_home_shipment.go create mode 100644 pkg/gen/internalmessages/create_p_p_m_shipment.go create mode 100644 pkg/gen/internalmessages/create_service_member_backup_contact_payload.go create mode 100644 pkg/gen/internalmessages/create_service_member_payload.go create mode 100644 pkg/gen/internalmessages/create_shipment.go create mode 100644 pkg/gen/internalmessages/create_signed_certification_payload.go create mode 100644 pkg/gen/internalmessages/create_update_orders.go create mode 100644 pkg/gen/internalmessages/create_weight_ticket_documents_payload.go create mode 100644 pkg/gen/internalmessages/dept_indicator.go create mode 100644 pkg/gen/internalmessages/document.go create mode 100644 pkg/gen/internalmessages/duty_location_payload.go create mode 100644 pkg/gen/internalmessages/duty_locations_payload.go create mode 100644 pkg/gen/internalmessages/entitlement.go create mode 100644 pkg/gen/internalmessages/error.go create mode 100644 pkg/gen/internalmessages/feature_flag_boolean.go create mode 100644 pkg/gen/internalmessages/feature_flag_variant.go create mode 100644 pkg/gen/internalmessages/index_entitlements.go create mode 100644 pkg/gen/internalmessages/index_moves_payload.go create mode 100644 pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go create mode 100644 pkg/gen/internalmessages/internal_move.go create mode 100644 pkg/gen/internalmessages/invalid_request_response_payload.go create mode 100644 pkg/gen/internalmessages/is_date_weekend_holiday_info.go create mode 100644 pkg/gen/internalmessages/logged_in_user_payload.go create mode 100644 pkg/gen/internalmessages/m_t_o_agent.go create mode 100644 pkg/gen/internalmessages/m_t_o_agent_type.go create mode 100644 pkg/gen/internalmessages/m_t_o_agents.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipment.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipment_status.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipment_type.go create mode 100644 pkg/gen/internalmessages/m_t_o_shipments.go create mode 100644 pkg/gen/internalmessages/method_of_receipt.go create mode 100644 pkg/gen/internalmessages/mobile_home.go create mode 100644 pkg/gen/internalmessages/move_document_payload.go create mode 100644 pkg/gen/internalmessages/move_document_status.go create mode 100644 pkg/gen/internalmessages/move_document_type.go create mode 100644 pkg/gen/internalmessages/move_documents.go create mode 100644 pkg/gen/internalmessages/move_payload.go create mode 100644 pkg/gen/internalmessages/move_queue_item.go create mode 100644 pkg/gen/internalmessages/move_status.go create mode 100644 pkg/gen/internalmessages/moves_list.go create mode 100644 pkg/gen/internalmessages/moving_expense.go create mode 100644 pkg/gen/internalmessages/moving_expense_type.go create mode 100644 pkg/gen/internalmessages/nullable_signed_certification_type.go create mode 100644 pkg/gen/internalmessages/office_user.go create mode 100644 pkg/gen/internalmessages/okta_user_profile_data.go create mode 100644 pkg/gen/internalmessages/omittable_moving_expense_type.go create mode 100644 pkg/gen/internalmessages/omittable_p_p_m_document_status.go create mode 100644 pkg/gen/internalmessages/order_pay_grade.go create mode 100644 pkg/gen/internalmessages/orders.go create mode 100644 pkg/gen/internalmessages/orders_status.go create mode 100644 pkg/gen/internalmessages/orders_type.go create mode 100644 pkg/gen/internalmessages/orders_type_detail.go create mode 100644 pkg/gen/internalmessages/p_p_m_advance_status.go create mode 100644 pkg/gen/internalmessages/p_p_m_destination_address.go create mode 100644 pkg/gen/internalmessages/p_p_m_document_status_reason.go create mode 100644 pkg/gen/internalmessages/p_p_m_estimate_range.go create mode 100644 pkg/gen/internalmessages/p_p_m_shipment.go create mode 100644 pkg/gen/internalmessages/p_p_m_shipment_status.go create mode 100644 pkg/gen/internalmessages/patch_move_payload.go create mode 100644 pkg/gen/internalmessages/patch_service_member_payload.go create mode 100644 pkg/gen/internalmessages/post_document_payload.go create mode 100644 pkg/gen/internalmessages/ppm_id.go create mode 100644 pkg/gen/internalmessages/privilege.go create mode 100644 pkg/gen/internalmessages/pro_gear_weight_ticket.go create mode 100644 pkg/gen/internalmessages/rate_engine_postal_code_payload.go create mode 100644 pkg/gen/internalmessages/reimbursement.go create mode 100644 pkg/gen/internalmessages/reimbursement_status.go create mode 100644 pkg/gen/internalmessages/role.go create mode 100644 pkg/gen/internalmessages/s_i_t_location_type.go create mode 100644 pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go create mode 100644 pkg/gen/internalmessages/service_member_backup_contact_payload.go create mode 100644 pkg/gen/internalmessages/service_member_payload.go create mode 100644 pkg/gen/internalmessages/signed_certification.go create mode 100644 pkg/gen/internalmessages/signed_certification_payload.go create mode 100644 pkg/gen/internalmessages/signed_certification_type.go create mode 100644 pkg/gen/internalmessages/signed_certification_type_create.go create mode 100644 pkg/gen/internalmessages/signed_certifications.go create mode 100644 pkg/gen/internalmessages/submit_move_for_approval_payload.go create mode 100644 pkg/gen/internalmessages/submitted_moving_expense_type.go create mode 100644 pkg/gen/internalmessages/transportation_office.go create mode 100644 pkg/gen/internalmessages/transportation_office_assignment.go create mode 100644 pkg/gen/internalmessages/transportation_offices.go create mode 100644 pkg/gen/internalmessages/update_boat_shipment.go create mode 100644 pkg/gen/internalmessages/update_mobile_home_shipment.go create mode 100644 pkg/gen/internalmessages/update_moving_expense.go create mode 100644 pkg/gen/internalmessages/update_okta_user_profile_data.go create mode 100644 pkg/gen/internalmessages/update_p_p_m_shipment.go create mode 100644 pkg/gen/internalmessages/update_pro_gear_weight_ticket.go create mode 100644 pkg/gen/internalmessages/update_service_member_backup_contact_payload.go create mode 100644 pkg/gen/internalmessages/update_shipment.go create mode 100644 pkg/gen/internalmessages/update_weight_ticket.go create mode 100644 pkg/gen/internalmessages/upload.go create mode 100644 pkg/gen/internalmessages/v_location.go create mode 100644 pkg/gen/internalmessages/v_locations.go create mode 100644 pkg/gen/internalmessages/validation_error.go create mode 100644 pkg/gen/internalmessages/weight_allotment.go create mode 100644 pkg/gen/internalmessages/weight_ticket.go create mode 100644 pkg/gen/internalmessages/weight_ticket_set_type.go create mode 100644 pkg/gen/internalmessages/weight_tickets.go create mode 100644 pkg/gen/primeapi/configure_mymove.go create mode 100644 pkg/gen/primeapi/doc.go create mode 100644 pkg/gen/primeapi/embedded_spec.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/mymove_api.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go create mode 100644 pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go create mode 100644 pkg/gen/primeapi/server.go create mode 100644 pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go create mode 100644 pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go create mode 100644 pkg/gen/primeclient/move_task_order/download_move_order_parameters.go create mode 100644 pkg/gen/primeclient/move_task_order/download_move_order_responses.go create mode 100644 pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primeclient/move_task_order/list_moves_parameters.go create mode 100644 pkg/gen/primeclient/move_task_order/list_moves_responses.go create mode 100644 pkg/gen/primeclient/move_task_order/move_task_order_client.go create mode 100644 pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go create mode 100644 pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go create mode 100644 pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go create mode 100644 pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go create mode 100644 pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go create mode 100644 pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go create mode 100644 pkg/gen/primeclient/mto_service_item/mto_service_item_client.go create mode 100644 pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go create mode 100644 pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/mto_shipment_client.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go create mode 100644 pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go create mode 100644 pkg/gen/primeclient/mymove_client.go create mode 100644 pkg/gen/primeclient/payment_request/create_payment_request_parameters.go create mode 100644 pkg/gen/primeclient/payment_request/create_payment_request_responses.go create mode 100644 pkg/gen/primeclient/payment_request/create_upload_parameters.go create mode 100644 pkg/gen/primeclient/payment_request/create_upload_responses.go create mode 100644 pkg/gen/primeclient/payment_request/payment_request_client.go create mode 100644 pkg/gen/primemessages/excess_weight_record.go create mode 100644 pkg/gen/primemessages/list_move.go create mode 100644 pkg/gen/primemessages/list_moves.go create mode 100644 pkg/gen/primemessages/m_t_o_agent.go create mode 100644 pkg/gen/primemessages/m_t_o_agent_type.go create mode 100644 pkg/gen/primemessages/m_t_o_agents.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_basic.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_dimension.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_international_crating.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primemessages/m_t_o_service_item_status.go create mode 100644 pkg/gen/primemessages/m_t_o_shipment.go create mode 100644 pkg/gen/primemessages/m_t_o_shipment_type.go create mode 100644 pkg/gen/primemessages/m_t_o_shipment_without_service_items.go create mode 100644 pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go create mode 100644 pkg/gen/primemessages/move_task_order.go create mode 100644 pkg/gen/primemessages/order.go create mode 100644 pkg/gen/primemessages/orders_type.go create mode 100644 pkg/gen/primemessages/p_p_m_shipment.go create mode 100644 pkg/gen/primemessages/p_p_m_shipment_status.go create mode 100644 pkg/gen/primemessages/payment_request.go create mode 100644 pkg/gen/primemessages/payment_request_status.go create mode 100644 pkg/gen/primemessages/payment_requests.go create mode 100644 pkg/gen/primemessages/payment_service_item.go create mode 100644 pkg/gen/primemessages/payment_service_item_param.go create mode 100644 pkg/gen/primemessages/payment_service_item_params.go create mode 100644 pkg/gen/primemessages/payment_service_item_status.go create mode 100644 pkg/gen/primemessages/payment_service_items.go create mode 100644 pkg/gen/primemessages/proof_of_service_doc.go create mode 100644 pkg/gen/primemessages/proof_of_service_docs.go create mode 100644 pkg/gen/primemessages/re_service_code.go create mode 100644 pkg/gen/primemessages/reweigh.go create mode 100644 pkg/gen/primemessages/reweigh_requester.go create mode 100644 pkg/gen/primemessages/s_i_t_extension.go create mode 100644 pkg/gen/primemessages/s_i_t_extensions.go create mode 100644 pkg/gen/primemessages/s_i_t_location_type.go create mode 100644 pkg/gen/primemessages/service_item.go create mode 100644 pkg/gen/primemessages/service_item_param_name.go create mode 100644 pkg/gen/primemessages/service_item_param_origin.go create mode 100644 pkg/gen/primemessages/service_item_param_type.go create mode 100644 pkg/gen/primemessages/service_request_document.go create mode 100644 pkg/gen/primemessages/service_request_documents.go create mode 100644 pkg/gen/primemessages/shipment_address_update.go create mode 100644 pkg/gen/primemessages/shipment_address_update_status.go create mode 100644 pkg/gen/primemessages/storage_facility.go create mode 100644 pkg/gen/primemessages/update_m_t_o_service_item.go create mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go create mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go create mode 100644 pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primemessages/update_m_t_o_shipment.go create mode 100644 pkg/gen/primemessages/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/primemessages/update_p_p_m_shipment.go create mode 100644 pkg/gen/primemessages/update_reweigh.go create mode 100644 pkg/gen/primemessages/update_shipment_destination_address.go create mode 100644 pkg/gen/primemessages/upload_with_omissions.go create mode 100644 pkg/gen/primemessages/validation_error.go create mode 100644 pkg/gen/primev2api/configure_mymove.go create mode 100644 pkg/gen/primev2api/doc.go create mode 100644 pkg/gen/primev2api/embedded_spec.go create mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go create mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primev2api/primev2operations/mymove_api.go create mode 100644 pkg/gen/primev2api/server.go create mode 100644 pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primev2client/move_task_order/move_task_order_client.go create mode 100644 pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev2client/mto_shipment/mto_shipment_client.go create mode 100644 pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev2client/mymove_client.go create mode 100644 pkg/gen/primev2messages/m_t_o_agent_type.go create mode 100644 pkg/gen/primev2messages/m_t_o_agents.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_basic.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_dimension.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_international_crating.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_status.go create mode 100644 pkg/gen/primev2messages/m_t_o_shipment.go create mode 100644 pkg/gen/primev2messages/m_t_o_shipment_type.go create mode 100644 pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go create mode 100644 pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go create mode 100644 pkg/gen/primev2messages/move_task_order.go create mode 100644 pkg/gen/primev2messages/order.go create mode 100644 pkg/gen/primev2messages/orders_type.go create mode 100644 pkg/gen/primev2messages/p_p_m_shipment.go create mode 100644 pkg/gen/primev2messages/p_p_m_shipment_status.go create mode 100644 pkg/gen/primev2messages/payment_request.go create mode 100644 pkg/gen/primev2messages/payment_request_status.go create mode 100644 pkg/gen/primev2messages/payment_requests.go create mode 100644 pkg/gen/primev2messages/payment_service_item.go create mode 100644 pkg/gen/primev2messages/payment_service_item_param.go create mode 100644 pkg/gen/primev2messages/payment_service_item_params.go create mode 100644 pkg/gen/primev2messages/payment_service_item_status.go create mode 100644 pkg/gen/primev2messages/payment_service_items.go create mode 100644 pkg/gen/primev2messages/proof_of_service_doc.go create mode 100644 pkg/gen/primev2messages/proof_of_service_docs.go create mode 100644 pkg/gen/primev2messages/re_service_code.go create mode 100644 pkg/gen/primev2messages/reweigh.go create mode 100644 pkg/gen/primev2messages/reweigh_requester.go create mode 100644 pkg/gen/primev2messages/s_i_t_extension.go create mode 100644 pkg/gen/primev2messages/s_i_t_extensions.go create mode 100644 pkg/gen/primev2messages/s_i_t_location_type.go create mode 100644 pkg/gen/primev2messages/service_item_param_name.go create mode 100644 pkg/gen/primev2messages/service_item_param_origin.go create mode 100644 pkg/gen/primev2messages/service_item_param_type.go create mode 100644 pkg/gen/primev2messages/service_request_document.go create mode 100644 pkg/gen/primev2messages/service_request_documents.go create mode 100644 pkg/gen/primev2messages/shipment_address_update.go create mode 100644 pkg/gen/primev2messages/shipment_address_update_status.go create mode 100644 pkg/gen/primev2messages/storage_facility.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_shipment.go create mode 100644 pkg/gen/primev2messages/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/primev2messages/update_p_p_m_shipment.go create mode 100644 pkg/gen/primev2messages/update_reweigh.go create mode 100644 pkg/gen/primev2messages/update_shipment_destination_address.go create mode 100644 pkg/gen/primev2messages/upload_with_omissions.go create mode 100644 pkg/gen/primev2messages/validation_error.go create mode 100644 pkg/gen/primev3api/configure_mymove.go create mode 100644 pkg/gen/primev3api/doc.go create mode 100644 pkg/gen/primev3api/embedded_spec.go create mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go create mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go create mode 100644 pkg/gen/primev3api/primev3operations/mymove_api.go create mode 100644 pkg/gen/primev3api/server.go create mode 100644 pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/primev3client/move_task_order/move_task_order_client.go create mode 100644 pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev3client/mto_shipment/mto_shipment_client.go create mode 100644 pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go create mode 100644 pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go create mode 100644 pkg/gen/primev3client/mymove_client.go create mode 100644 pkg/gen/primev3messages/error.go create mode 100644 pkg/gen/primev3messages/m_t_o_agent.go create mode 100644 pkg/gen/primev3messages/m_t_o_agent_type.go create mode 100644 pkg/gen/primev3messages/m_t_o_agents.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_basic.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_dimension.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_international_crating.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_status.go create mode 100644 pkg/gen/primev3messages/m_t_o_shipment.go create mode 100644 pkg/gen/primev3messages/m_t_o_shipment_type.go create mode 100644 pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go create mode 100644 pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go create mode 100644 pkg/gen/primev3messages/mobile_home.go create mode 100644 pkg/gen/primev3messages/move_task_order.go create mode 100644 pkg/gen/primev3messages/order.go create mode 100644 pkg/gen/primev3messages/orders_type.go create mode 100644 pkg/gen/primev3messages/p_p_m_destination_address.go create mode 100644 pkg/gen/primev3messages/p_p_m_shipment.go create mode 100644 pkg/gen/primev3messages/p_p_m_shipment_status.go create mode 100644 pkg/gen/primev3messages/payment_request.go create mode 100644 pkg/gen/primev3messages/payment_request_status.go create mode 100644 pkg/gen/primev3messages/payment_requests.go create mode 100644 pkg/gen/primev3messages/payment_service_item.go create mode 100644 pkg/gen/primev3messages/payment_service_item_param.go create mode 100644 pkg/gen/primev3messages/payment_service_item_params.go create mode 100644 pkg/gen/primev3messages/payment_service_item_status.go create mode 100644 pkg/gen/primev3messages/payment_service_items.go create mode 100644 pkg/gen/primev3messages/port.go create mode 100644 pkg/gen/primev3messages/proof_of_service_doc.go create mode 100644 pkg/gen/primev3messages/proof_of_service_docs.go create mode 100644 pkg/gen/primev3messages/rate_area.go create mode 100644 pkg/gen/primev3messages/re_service_code.go create mode 100644 pkg/gen/primev3messages/reweigh.go create mode 100644 pkg/gen/primev3messages/reweigh_requester.go create mode 100644 pkg/gen/primev3messages/s_i_t_extension.go create mode 100644 pkg/gen/primev3messages/s_i_t_extensions.go create mode 100644 pkg/gen/primev3messages/s_i_t_location_type.go create mode 100644 pkg/gen/primev3messages/service_item_param_name.go create mode 100644 pkg/gen/primev3messages/service_item_param_origin.go create mode 100644 pkg/gen/primev3messages/service_item_param_type.go create mode 100644 pkg/gen/primev3messages/service_request_document.go create mode 100644 pkg/gen/primev3messages/service_request_documents.go create mode 100644 pkg/gen/primev3messages/shipment_address_update.go create mode 100644 pkg/gen/primev3messages/shipment_address_update_status.go create mode 100644 pkg/gen/primev3messages/storage_facility.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_shipment.go create mode 100644 pkg/gen/primev3messages/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/primev3messages/update_p_p_m_shipment.go create mode 100644 pkg/gen/primev3messages/update_reweigh.go create mode 100644 pkg/gen/primev3messages/update_shipment_destination_address.go create mode 100644 pkg/gen/primev3messages/upload_with_omissions.go create mode 100644 pkg/gen/primev3messages/validation_error.go create mode 100644 pkg/gen/supportapi/configure_mymove.go create mode 100644 pkg/gen/supportapi/doc.go create mode 100644 pkg/gen/supportapi/embedded_spec.go create mode 100644 pkg/gen/supportapi/server.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/mymove_api.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go create mode 100644 pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go create mode 100644 pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go create mode 100644 pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go create mode 100644 pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go create mode 100644 pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go create mode 100644 pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go create mode 100644 pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go create mode 100644 pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go create mode 100644 pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go create mode 100644 pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go create mode 100644 pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go create mode 100644 pkg/gen/supportclient/move_task_order/move_task_order_client.go create mode 100644 pkg/gen/supportclient/mto_service_item/mto_service_item_client.go create mode 100644 pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go create mode 100644 pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go create mode 100644 pkg/gen/supportclient/mto_shipment/mto_shipment_client.go create mode 100644 pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go create mode 100644 pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go create mode 100644 pkg/gen/supportclient/mymove_client.go create mode 100644 pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go create mode 100644 pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go create mode 100644 pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go create mode 100644 pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go create mode 100644 pkg/gen/supportclient/payment_request/payment_request_client.go create mode 100644 pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go create mode 100644 pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go create mode 100644 pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go create mode 100644 pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go create mode 100644 pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go create mode 100644 pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go create mode 100644 pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go create mode 100644 pkg/gen/supportclient/webhook/create_webhook_notification_responses.go create mode 100644 pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go create mode 100644 pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go create mode 100644 pkg/gen/supportclient/webhook/webhook_client.go create mode 100644 pkg/gen/supportmessages/orders_type_detail.go create mode 100644 pkg/gen/supportmessages/payment_request.go create mode 100644 pkg/gen/supportmessages/payment_request_e_d_i.go create mode 100644 pkg/gen/supportmessages/payment_request_status.go create mode 100644 pkg/gen/supportmessages/payment_requests.go create mode 100644 pkg/gen/supportmessages/process_reviewed_payment_requests.go create mode 100644 pkg/gen/supportmessages/proof_of_service_package.go create mode 100644 pkg/gen/supportmessages/rank.go create mode 100644 pkg/gen/supportmessages/re_service_code.go create mode 100644 pkg/gen/supportmessages/update_m_t_o_service_item_status.go create mode 100644 pkg/gen/supportmessages/update_m_t_o_shipment_status.go create mode 100644 pkg/gen/supportmessages/update_payment_request_status.go create mode 100644 pkg/gen/supportmessages/upload_with_omissions.go create mode 100644 pkg/gen/supportmessages/validation_error.go create mode 100644 pkg/gen/supportmessages/webhook_notification.go create mode 100644 pkg/gen/supportmessages/webhook_notification_status.go diff --git a/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql b/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql deleted file mode 100644 index 167ccf316e3..00000000000 --- a/migrations/app/schema/20250106202424_insert_transportation_offices_meridian_ms.up.sql +++ /dev/null @@ -1,5 +0,0 @@ ---update duty location for NAS Meridian, MS to use zip 39309 -update duty_locations set name = 'NAS Meridian, MS 39309', address_id = '691551c2-71fe-4a15-871f-0c46dff98230' where id = '334fecaf-abeb-49ce-99b5-81d69c8beae5'; - ---remove 39302 duty location -delete from duty_locations where id = 'e55be32c-bf89-4927-8893-4454a26bfd55'; diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql index cd83780df46..4015ffe3e8c 100644 --- a/migrations/app/schema/20250106202424_update_duty_locs.up.sql +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -24,3 +24,5 @@ INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_ INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES ('98beab3c-f8ce-4e3c-b78e-8db614721621'::uuid, 'Cannon AFB, NM 88101',null, 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid,now(),now(),'80796bc4-e494-4b19-bb16-cdcdba187829',true); +--associate New London, CT duty location to New London transportation office +update duty_locations set transportation_office_id = '5eb485ae-fb9c-4c90-80e4-6231158797df' where id = '3a2a84cd-0991-4f40-9a19-f977608d08f0'; \ No newline at end of file diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go new file mode 100644 index 00000000000..126c45c2752 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateAdminUserHandlerFunc turns a function with the right signature into a create admin user handler +type CreateAdminUserHandlerFunc func(CreateAdminUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateAdminUserHandlerFunc) Handle(params CreateAdminUserParams) middleware.Responder { + return fn(params) +} + +// CreateAdminUserHandler interface for that can handle valid create admin user params +type CreateAdminUserHandler interface { + Handle(CreateAdminUserParams) middleware.Responder +} + +// NewCreateAdminUser creates a new http.Handler for the create admin user operation +func NewCreateAdminUser(ctx *middleware.Context, handler CreateAdminUserHandler) *CreateAdminUser { + return &CreateAdminUser{Context: ctx, Handler: handler} +} + +/* + CreateAdminUser swagger:route POST /admin-users Admin users createAdminUser + +# Create an Admin User + +This endpoint creates an Admin User record and returns the created record in the +`201` response. Do not use this endpoint directly as it is meant to be used with +the Admin UI exclusively. +*/ +type CreateAdminUser struct { + Context *middleware.Context + Handler CreateAdminUserHandler +} + +func (o *CreateAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateAdminUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go new file mode 100644 index 00000000000..e7c7e9af6ab --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewCreateAdminUserParams creates a new CreateAdminUserParams object +// +// There are no default values defined in the spec. +func NewCreateAdminUserParams() CreateAdminUserParams { + + return CreateAdminUserParams{} +} + +// CreateAdminUserParams contains all the bound params for the create admin user operation +// typically these are obtained from a http.Request +// +// swagger:parameters createAdminUser +type CreateAdminUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Admin User information + In: body + */ + AdminUser *adminmessages.AdminUserCreate +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateAdminUserParams() beforehand. +func (o *CreateAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.AdminUserCreate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("adminUser", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.AdminUser = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go new file mode 100644 index 00000000000..1ddaeb40fca --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// CreateAdminUserCreatedCode is the HTTP code returned for type CreateAdminUserCreated +const CreateAdminUserCreatedCode int = 201 + +/* +CreateAdminUserCreated Successfully created Admin User + +swagger:response createAdminUserCreated +*/ +type CreateAdminUserCreated struct { + + /* + In: Body + */ + Payload *adminmessages.AdminUser `json:"body,omitempty"` +} + +// NewCreateAdminUserCreated creates CreateAdminUserCreated with default headers values +func NewCreateAdminUserCreated() *CreateAdminUserCreated { + + return &CreateAdminUserCreated{} +} + +// WithPayload adds the payload to the create admin user created response +func (o *CreateAdminUserCreated) WithPayload(payload *adminmessages.AdminUser) *CreateAdminUserCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create admin user created response +func (o *CreateAdminUserCreated) SetPayload(payload *adminmessages.AdminUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateAdminUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateAdminUserBadRequestCode is the HTTP code returned for type CreateAdminUserBadRequest +const CreateAdminUserBadRequestCode int = 400 + +/* +CreateAdminUserBadRequest Invalid Request + +swagger:response createAdminUserBadRequest +*/ +type CreateAdminUserBadRequest struct { +} + +// NewCreateAdminUserBadRequest creates CreateAdminUserBadRequest with default headers values +func NewCreateAdminUserBadRequest() *CreateAdminUserBadRequest { + + return &CreateAdminUserBadRequest{} +} + +// WriteResponse to the client +func (o *CreateAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateAdminUserUnauthorizedCode is the HTTP code returned for type CreateAdminUserUnauthorized +const CreateAdminUserUnauthorizedCode int = 401 + +/* +CreateAdminUserUnauthorized Must be authenticated to use this end point + +swagger:response createAdminUserUnauthorized +*/ +type CreateAdminUserUnauthorized struct { +} + +// NewCreateAdminUserUnauthorized creates CreateAdminUserUnauthorized with default headers values +func NewCreateAdminUserUnauthorized() *CreateAdminUserUnauthorized { + + return &CreateAdminUserUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateAdminUserForbiddenCode is the HTTP code returned for type CreateAdminUserForbidden +const CreateAdminUserForbiddenCode int = 403 + +/* +CreateAdminUserForbidden Not authorized to create an Admin User + +swagger:response createAdminUserForbidden +*/ +type CreateAdminUserForbidden struct { +} + +// NewCreateAdminUserForbidden creates CreateAdminUserForbidden with default headers values +func NewCreateAdminUserForbidden() *CreateAdminUserForbidden { + + return &CreateAdminUserForbidden{} +} + +// WriteResponse to the client +func (o *CreateAdminUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateAdminUserInternalServerErrorCode is the HTTP code returned for type CreateAdminUserInternalServerError +const CreateAdminUserInternalServerErrorCode int = 500 + +/* +CreateAdminUserInternalServerError Server error + +swagger:response createAdminUserInternalServerError +*/ +type CreateAdminUserInternalServerError struct { +} + +// NewCreateAdminUserInternalServerError creates CreateAdminUserInternalServerError with default headers values +func NewCreateAdminUserInternalServerError() *CreateAdminUserInternalServerError { + + return &CreateAdminUserInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go new file mode 100644 index 00000000000..18ce2599074 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/create_admin_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateAdminUserURL generates an URL for the create admin user operation +type CreateAdminUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateAdminUserURL) WithBasePath(bp string) *CreateAdminUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateAdminUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateAdminUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/admin-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateAdminUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateAdminUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateAdminUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateAdminUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateAdminUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go new file mode 100644 index 00000000000..10a6d0c45de --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetAdminUserHandlerFunc turns a function with the right signature into a get admin user handler +type GetAdminUserHandlerFunc func(GetAdminUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetAdminUserHandlerFunc) Handle(params GetAdminUserParams) middleware.Responder { + return fn(params) +} + +// GetAdminUserHandler interface for that can handle valid get admin user params +type GetAdminUserHandler interface { + Handle(GetAdminUserParams) middleware.Responder +} + +// NewGetAdminUser creates a new http.Handler for the get admin user operation +func NewGetAdminUser(ctx *middleware.Context, handler GetAdminUserHandler) *GetAdminUser { + return &GetAdminUser{Context: ctx, Handler: handler} +} + +/* + GetAdminUser swagger:route GET /admin-users/{adminUserId} Admin users getAdminUser + +# Fetch a specific Admin User + +This endpoint returns a single Admin User by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type GetAdminUser struct { + Context *middleware.Context + Handler GetAdminUserHandler +} + +func (o *GetAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetAdminUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go new file mode 100644 index 00000000000..3c91dacf20f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetAdminUserParams creates a new GetAdminUserParams object +// +// There are no default values defined in the spec. +func NewGetAdminUserParams() GetAdminUserParams { + + return GetAdminUserParams{} +} + +// GetAdminUserParams contains all the bound params for the get admin user operation +// typically these are obtained from a http.Request +// +// swagger:parameters getAdminUser +type GetAdminUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + AdminUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetAdminUserParams() beforehand. +func (o *GetAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rAdminUserID, rhkAdminUserID, _ := route.Params.GetOK("adminUserId") + if err := o.bindAdminUserID(rAdminUserID, rhkAdminUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAdminUserID binds and validates parameter AdminUserID from path. +func (o *GetAdminUserParams) bindAdminUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("adminUserId", "path", "strfmt.UUID", raw) + } + o.AdminUserID = *(value.(*strfmt.UUID)) + + if err := o.validateAdminUserID(formats); err != nil { + return err + } + + return nil +} + +// validateAdminUserID carries on validations for parameter AdminUserID +func (o *GetAdminUserParams) validateAdminUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("adminUserId", "path", "uuid", o.AdminUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go new file mode 100644 index 00000000000..dd9c9572e00 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetAdminUserOKCode is the HTTP code returned for type GetAdminUserOK +const GetAdminUserOKCode int = 200 + +/* +GetAdminUserOK success + +swagger:response getAdminUserOK +*/ +type GetAdminUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.AdminUser `json:"body,omitempty"` +} + +// NewGetAdminUserOK creates GetAdminUserOK with default headers values +func NewGetAdminUserOK() *GetAdminUserOK { + + return &GetAdminUserOK{} +} + +// WithPayload adds the payload to the get admin user o k response +func (o *GetAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *GetAdminUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get admin user o k response +func (o *GetAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAdminUserBadRequestCode is the HTTP code returned for type GetAdminUserBadRequest +const GetAdminUserBadRequestCode int = 400 + +/* +GetAdminUserBadRequest invalid request + +swagger:response getAdminUserBadRequest +*/ +type GetAdminUserBadRequest struct { +} + +// NewGetAdminUserBadRequest creates GetAdminUserBadRequest with default headers values +func NewGetAdminUserBadRequest() *GetAdminUserBadRequest { + + return &GetAdminUserBadRequest{} +} + +// WriteResponse to the client +func (o *GetAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetAdminUserUnauthorizedCode is the HTTP code returned for type GetAdminUserUnauthorized +const GetAdminUserUnauthorizedCode int = 401 + +/* +GetAdminUserUnauthorized request requires user authentication + +swagger:response getAdminUserUnauthorized +*/ +type GetAdminUserUnauthorized struct { +} + +// NewGetAdminUserUnauthorized creates GetAdminUserUnauthorized with default headers values +func NewGetAdminUserUnauthorized() *GetAdminUserUnauthorized { + + return &GetAdminUserUnauthorized{} +} + +// WriteResponse to the client +func (o *GetAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetAdminUserNotFoundCode is the HTTP code returned for type GetAdminUserNotFound +const GetAdminUserNotFoundCode int = 404 + +/* +GetAdminUserNotFound Admin User not found + +swagger:response getAdminUserNotFound +*/ +type GetAdminUserNotFound struct { +} + +// NewGetAdminUserNotFound creates GetAdminUserNotFound with default headers values +func NewGetAdminUserNotFound() *GetAdminUserNotFound { + + return &GetAdminUserNotFound{} +} + +// WriteResponse to the client +func (o *GetAdminUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetAdminUserInternalServerErrorCode is the HTTP code returned for type GetAdminUserInternalServerError +const GetAdminUserInternalServerErrorCode int = 500 + +/* +GetAdminUserInternalServerError server error + +swagger:response getAdminUserInternalServerError +*/ +type GetAdminUserInternalServerError struct { +} + +// NewGetAdminUserInternalServerError creates GetAdminUserInternalServerError with default headers values +func NewGetAdminUserInternalServerError() *GetAdminUserInternalServerError { + + return &GetAdminUserInternalServerError{} +} + +// WriteResponse to the client +func (o *GetAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go new file mode 100644 index 00000000000..01e45020d73 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/get_admin_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetAdminUserURL generates an URL for the get admin user operation +type GetAdminUserURL struct { + AdminUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAdminUserURL) WithBasePath(bp string) *GetAdminUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAdminUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetAdminUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/admin-users/{adminUserId}" + + adminUserID := o.AdminUserID.String() + if adminUserID != "" { + _path = strings.Replace(_path, "{adminUserId}", adminUserID, -1) + } else { + return nil, errors.New("adminUserId is required on GetAdminUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetAdminUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetAdminUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetAdminUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetAdminUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetAdminUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go new file mode 100644 index 00000000000..8b9aad66d60 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexAdminUsersHandlerFunc turns a function with the right signature into a index admin users handler +type IndexAdminUsersHandlerFunc func(IndexAdminUsersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexAdminUsersHandlerFunc) Handle(params IndexAdminUsersParams) middleware.Responder { + return fn(params) +} + +// IndexAdminUsersHandler interface for that can handle valid index admin users params +type IndexAdminUsersHandler interface { + Handle(IndexAdminUsersParams) middleware.Responder +} + +// NewIndexAdminUsers creates a new http.Handler for the index admin users operation +func NewIndexAdminUsers(ctx *middleware.Context, handler IndexAdminUsersHandler) *IndexAdminUsers { + return &IndexAdminUsers{Context: ctx, Handler: handler} +} + +/* + IndexAdminUsers swagger:route GET /admin-users Admin users indexAdminUsers + +# List Admin Users + +This endpoint returns a list of Admin Users. Do not use this endpoint directly +as it is meant to be used with the Admin UI exclusively. +*/ +type IndexAdminUsers struct { + Context *middleware.Context + Handler IndexAdminUsersHandler +} + +func (o *IndexAdminUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexAdminUsersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go new file mode 100644 index 00000000000..be0bcb192b1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_parameters.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexAdminUsersParams creates a new IndexAdminUsersParams object +// +// There are no default values defined in the spec. +func NewIndexAdminUsersParams() IndexAdminUsersParams { + + return IndexAdminUsersParams{} +} + +// IndexAdminUsersParams contains all the bound params for the index admin users operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexAdminUsers +type IndexAdminUsersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter []string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexAdminUsersParams() beforehand. +func (o *IndexAdminUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates array parameter Filter from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *IndexAdminUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvFilter string + if len(rawData) > 0 { + qvFilter = rawData[len(rawData)-1] + } + + // CollectionFormat: + filterIC := swag.SplitByFormat(qvFilter, "") + if len(filterIC) == 0 { + return nil + } + + var filterIR []string + for _, filterIV := range filterIC { + filterI := filterIV + + filterIR = append(filterIR, filterI) + } + + o.Filter = filterIR + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexAdminUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexAdminUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexAdminUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexAdminUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go new file mode 100644 index 00000000000..c158b9dddbd --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexAdminUsersOKCode is the HTTP code returned for type IndexAdminUsersOK +const IndexAdminUsersOKCode int = 200 + +/* +IndexAdminUsersOK success + +swagger:response indexAdminUsersOK +*/ +type IndexAdminUsersOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.AdminUsers `json:"body,omitempty"` +} + +// NewIndexAdminUsersOK creates IndexAdminUsersOK with default headers values +func NewIndexAdminUsersOK() *IndexAdminUsersOK { + + return &IndexAdminUsersOK{} +} + +// WithContentRange adds the contentRange to the index admin users o k response +func (o *IndexAdminUsersOK) WithContentRange(contentRange string) *IndexAdminUsersOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index admin users o k response +func (o *IndexAdminUsersOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index admin users o k response +func (o *IndexAdminUsersOK) WithPayload(payload adminmessages.AdminUsers) *IndexAdminUsersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index admin users o k response +func (o *IndexAdminUsersOK) SetPayload(payload adminmessages.AdminUsers) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexAdminUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.AdminUsers{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexAdminUsersBadRequestCode is the HTTP code returned for type IndexAdminUsersBadRequest +const IndexAdminUsersBadRequestCode int = 400 + +/* +IndexAdminUsersBadRequest invalid request + +swagger:response indexAdminUsersBadRequest +*/ +type IndexAdminUsersBadRequest struct { +} + +// NewIndexAdminUsersBadRequest creates IndexAdminUsersBadRequest with default headers values +func NewIndexAdminUsersBadRequest() *IndexAdminUsersBadRequest { + + return &IndexAdminUsersBadRequest{} +} + +// WriteResponse to the client +func (o *IndexAdminUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexAdminUsersUnauthorizedCode is the HTTP code returned for type IndexAdminUsersUnauthorized +const IndexAdminUsersUnauthorizedCode int = 401 + +/* +IndexAdminUsersUnauthorized request requires user authentication + +swagger:response indexAdminUsersUnauthorized +*/ +type IndexAdminUsersUnauthorized struct { +} + +// NewIndexAdminUsersUnauthorized creates IndexAdminUsersUnauthorized with default headers values +func NewIndexAdminUsersUnauthorized() *IndexAdminUsersUnauthorized { + + return &IndexAdminUsersUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexAdminUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexAdminUsersNotFoundCode is the HTTP code returned for type IndexAdminUsersNotFound +const IndexAdminUsersNotFoundCode int = 404 + +/* +IndexAdminUsersNotFound Admin Users not found + +swagger:response indexAdminUsersNotFound +*/ +type IndexAdminUsersNotFound struct { +} + +// NewIndexAdminUsersNotFound creates IndexAdminUsersNotFound with default headers values +func NewIndexAdminUsersNotFound() *IndexAdminUsersNotFound { + + return &IndexAdminUsersNotFound{} +} + +// WriteResponse to the client +func (o *IndexAdminUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexAdminUsersInternalServerErrorCode is the HTTP code returned for type IndexAdminUsersInternalServerError +const IndexAdminUsersInternalServerErrorCode int = 500 + +/* +IndexAdminUsersInternalServerError server error + +swagger:response indexAdminUsersInternalServerError +*/ +type IndexAdminUsersInternalServerError struct { +} + +// NewIndexAdminUsersInternalServerError creates IndexAdminUsersInternalServerError with default headers values +func NewIndexAdminUsersInternalServerError() *IndexAdminUsersInternalServerError { + + return &IndexAdminUsersInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexAdminUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go new file mode 100644 index 00000000000..dc1023af8c9 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/index_admin_users_urlbuilder.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexAdminUsersURL generates an URL for the index admin users operation +type IndexAdminUsersURL struct { + Filter []string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexAdminUsersURL) WithBasePath(bp string) *IndexAdminUsersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexAdminUsersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexAdminUsersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/admin-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterIR []string + for _, filterI := range o.Filter { + filterIS := filterI + if filterIS != "" { + filterIR = append(filterIR, filterIS) + } + } + + filter := swag.JoinByFormat(filterIR, "") + + if len(filter) > 0 { + qsv := filter[0] + if qsv != "" { + qs.Set("filter", qsv) + } + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexAdminUsersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexAdminUsersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexAdminUsersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexAdminUsersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexAdminUsersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexAdminUsersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go new file mode 100644 index 00000000000..67a252b84f2 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateAdminUserHandlerFunc turns a function with the right signature into a update admin user handler +type UpdateAdminUserHandlerFunc func(UpdateAdminUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateAdminUserHandlerFunc) Handle(params UpdateAdminUserParams) middleware.Responder { + return fn(params) +} + +// UpdateAdminUserHandler interface for that can handle valid update admin user params +type UpdateAdminUserHandler interface { + Handle(UpdateAdminUserParams) middleware.Responder +} + +// NewUpdateAdminUser creates a new http.Handler for the update admin user operation +func NewUpdateAdminUser(ctx *middleware.Context, handler UpdateAdminUserHandler) *UpdateAdminUser { + return &UpdateAdminUser{Context: ctx, Handler: handler} +} + +/* + UpdateAdminUser swagger:route PATCH /admin-users/{adminUserId} Admin users updateAdminUser + +# Updates an Admin User + +This endpoint updates a single Admin User by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type UpdateAdminUser struct { + Context *middleware.Context + Handler UpdateAdminUserHandler +} + +func (o *UpdateAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateAdminUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go new file mode 100644 index 00000000000..a1f35214c7d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateAdminUserParams creates a new UpdateAdminUserParams object +// +// There are no default values defined in the spec. +func NewUpdateAdminUserParams() UpdateAdminUserParams { + + return UpdateAdminUserParams{} +} + +// UpdateAdminUserParams contains all the bound params for the update admin user operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateAdminUser +type UpdateAdminUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Admin User information + Required: true + In: body + */ + AdminUser *adminmessages.AdminUserUpdate + /* + Required: true + In: path + */ + AdminUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateAdminUserParams() beforehand. +func (o *UpdateAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.AdminUserUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("adminUser", "body", "")) + } else { + res = append(res, errors.NewParseError("adminUser", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.AdminUser = &body + } + } + } else { + res = append(res, errors.Required("adminUser", "body", "")) + } + + rAdminUserID, rhkAdminUserID, _ := route.Params.GetOK("adminUserId") + if err := o.bindAdminUserID(rAdminUserID, rhkAdminUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAdminUserID binds and validates parameter AdminUserID from path. +func (o *UpdateAdminUserParams) bindAdminUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("adminUserId", "path", "strfmt.UUID", raw) + } + o.AdminUserID = *(value.(*strfmt.UUID)) + + if err := o.validateAdminUserID(formats); err != nil { + return err + } + + return nil +} + +// validateAdminUserID carries on validations for parameter AdminUserID +func (o *UpdateAdminUserParams) validateAdminUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("adminUserId", "path", "uuid", o.AdminUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go new file mode 100644 index 00000000000..0ffb8bbd11d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateAdminUserOKCode is the HTTP code returned for type UpdateAdminUserOK +const UpdateAdminUserOKCode int = 200 + +/* +UpdateAdminUserOK Successfully updated Admin User + +swagger:response updateAdminUserOK +*/ +type UpdateAdminUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.AdminUser `json:"body,omitempty"` +} + +// NewUpdateAdminUserOK creates UpdateAdminUserOK with default headers values +func NewUpdateAdminUserOK() *UpdateAdminUserOK { + + return &UpdateAdminUserOK{} +} + +// WithPayload adds the payload to the update admin user o k response +func (o *UpdateAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *UpdateAdminUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update admin user o k response +func (o *UpdateAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAdminUserBadRequestCode is the HTTP code returned for type UpdateAdminUserBadRequest +const UpdateAdminUserBadRequestCode int = 400 + +/* +UpdateAdminUserBadRequest Invalid Request + +swagger:response updateAdminUserBadRequest +*/ +type UpdateAdminUserBadRequest struct { +} + +// NewUpdateAdminUserBadRequest creates UpdateAdminUserBadRequest with default headers values +func NewUpdateAdminUserBadRequest() *UpdateAdminUserBadRequest { + + return &UpdateAdminUserBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateAdminUserUnauthorizedCode is the HTTP code returned for type UpdateAdminUserUnauthorized +const UpdateAdminUserUnauthorizedCode int = 401 + +/* +UpdateAdminUserUnauthorized Must be authenticated to use this end point + +swagger:response updateAdminUserUnauthorized +*/ +type UpdateAdminUserUnauthorized struct { +} + +// NewUpdateAdminUserUnauthorized creates UpdateAdminUserUnauthorized with default headers values +func NewUpdateAdminUserUnauthorized() *UpdateAdminUserUnauthorized { + + return &UpdateAdminUserUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateAdminUserForbiddenCode is the HTTP code returned for type UpdateAdminUserForbidden +const UpdateAdminUserForbiddenCode int = 403 + +/* +UpdateAdminUserForbidden Not authorized to update an Admin User + +swagger:response updateAdminUserForbidden +*/ +type UpdateAdminUserForbidden struct { +} + +// NewUpdateAdminUserForbidden creates UpdateAdminUserForbidden with default headers values +func NewUpdateAdminUserForbidden() *UpdateAdminUserForbidden { + + return &UpdateAdminUserForbidden{} +} + +// WriteResponse to the client +func (o *UpdateAdminUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateAdminUserInternalServerErrorCode is the HTTP code returned for type UpdateAdminUserInternalServerError +const UpdateAdminUserInternalServerErrorCode int = 500 + +/* +UpdateAdminUserInternalServerError Server error + +swagger:response updateAdminUserInternalServerError +*/ +type UpdateAdminUserInternalServerError struct { +} + +// NewUpdateAdminUserInternalServerError creates UpdateAdminUserInternalServerError with default headers values +func NewUpdateAdminUserInternalServerError() *UpdateAdminUserInternalServerError { + + return &UpdateAdminUserInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go new file mode 100644 index 00000000000..ad34ad03cd5 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/admin_users/update_admin_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package admin_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateAdminUserURL generates an URL for the update admin user operation +type UpdateAdminUserURL struct { + AdminUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAdminUserURL) WithBasePath(bp string) *UpdateAdminUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAdminUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateAdminUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/admin-users/{adminUserId}" + + adminUserID := o.AdminUserID.String() + if adminUserID != "" { + _path = strings.Replace(_path, "{adminUserId}", adminUserID, -1) + } else { + return nil, errors.New("adminUserId is required on UpdateAdminUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateAdminUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateAdminUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateAdminUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateAdminUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateAdminUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go new file mode 100644 index 00000000000..ae7a0a37508 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateClientCertificateHandlerFunc turns a function with the right signature into a create client certificate handler +type CreateClientCertificateHandlerFunc func(CreateClientCertificateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateClientCertificateHandlerFunc) Handle(params CreateClientCertificateParams) middleware.Responder { + return fn(params) +} + +// CreateClientCertificateHandler interface for that can handle valid create client certificate params +type CreateClientCertificateHandler interface { + Handle(CreateClientCertificateParams) middleware.Responder +} + +// NewCreateClientCertificate creates a new http.Handler for the create client certificate operation +func NewCreateClientCertificate(ctx *middleware.Context, handler CreateClientCertificateHandler) *CreateClientCertificate { + return &CreateClientCertificate{Context: ctx, Handler: handler} +} + +/* + CreateClientCertificate swagger:route POST /client-certificates Client certificates createClientCertificate + +create a client cert + +This endpoint creates a Client Certificate record and returns the +created record in the `201` response. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type CreateClientCertificate struct { + Context *middleware.Context + Handler CreateClientCertificateHandler +} + +func (o *CreateClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateClientCertificateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go new file mode 100644 index 00000000000..460aad56134 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewCreateClientCertificateParams creates a new CreateClientCertificateParams object +// +// There are no default values defined in the spec. +func NewCreateClientCertificateParams() CreateClientCertificateParams { + + return CreateClientCertificateParams{} +} + +// CreateClientCertificateParams contains all the bound params for the create client certificate operation +// typically these are obtained from a http.Request +// +// swagger:parameters createClientCertificate +type CreateClientCertificateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*client cert information + In: body + */ + ClientCertificate *adminmessages.ClientCertificateCreate +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateClientCertificateParams() beforehand. +func (o *CreateClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.ClientCertificateCreate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("clientCertificate", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ClientCertificate = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go new file mode 100644 index 00000000000..9aa4feddb1b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// CreateClientCertificateCreatedCode is the HTTP code returned for type CreateClientCertificateCreated +const CreateClientCertificateCreatedCode int = 201 + +/* +CreateClientCertificateCreated Successfully created client certificate + +swagger:response createClientCertificateCreated +*/ +type CreateClientCertificateCreated struct { + + /* + In: Body + */ + Payload *adminmessages.ClientCertificate `json:"body,omitempty"` +} + +// NewCreateClientCertificateCreated creates CreateClientCertificateCreated with default headers values +func NewCreateClientCertificateCreated() *CreateClientCertificateCreated { + + return &CreateClientCertificateCreated{} +} + +// WithPayload adds the payload to the create client certificate created response +func (o *CreateClientCertificateCreated) WithPayload(payload *adminmessages.ClientCertificate) *CreateClientCertificateCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create client certificate created response +func (o *CreateClientCertificateCreated) SetPayload(payload *adminmessages.ClientCertificate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateClientCertificateCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateClientCertificateBadRequestCode is the HTTP code returned for type CreateClientCertificateBadRequest +const CreateClientCertificateBadRequestCode int = 400 + +/* +CreateClientCertificateBadRequest Invalid Request + +swagger:response createClientCertificateBadRequest +*/ +type CreateClientCertificateBadRequest struct { +} + +// NewCreateClientCertificateBadRequest creates CreateClientCertificateBadRequest with default headers values +func NewCreateClientCertificateBadRequest() *CreateClientCertificateBadRequest { + + return &CreateClientCertificateBadRequest{} +} + +// WriteResponse to the client +func (o *CreateClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateClientCertificateUnauthorizedCode is the HTTP code returned for type CreateClientCertificateUnauthorized +const CreateClientCertificateUnauthorizedCode int = 401 + +/* +CreateClientCertificateUnauthorized Must be authenticated to use this end point + +swagger:response createClientCertificateUnauthorized +*/ +type CreateClientCertificateUnauthorized struct { +} + +// NewCreateClientCertificateUnauthorized creates CreateClientCertificateUnauthorized with default headers values +func NewCreateClientCertificateUnauthorized() *CreateClientCertificateUnauthorized { + + return &CreateClientCertificateUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateClientCertificateForbiddenCode is the HTTP code returned for type CreateClientCertificateForbidden +const CreateClientCertificateForbiddenCode int = 403 + +/* +CreateClientCertificateForbidden Not authorized to create a client certificate + +swagger:response createClientCertificateForbidden +*/ +type CreateClientCertificateForbidden struct { +} + +// NewCreateClientCertificateForbidden creates CreateClientCertificateForbidden with default headers values +func NewCreateClientCertificateForbidden() *CreateClientCertificateForbidden { + + return &CreateClientCertificateForbidden{} +} + +// WriteResponse to the client +func (o *CreateClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateClientCertificateInternalServerErrorCode is the HTTP code returned for type CreateClientCertificateInternalServerError +const CreateClientCertificateInternalServerErrorCode int = 500 + +/* +CreateClientCertificateInternalServerError Server error + +swagger:response createClientCertificateInternalServerError +*/ +type CreateClientCertificateInternalServerError struct { +} + +// NewCreateClientCertificateInternalServerError creates CreateClientCertificateInternalServerError with default headers values +func NewCreateClientCertificateInternalServerError() *CreateClientCertificateInternalServerError { + + return &CreateClientCertificateInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go new file mode 100644 index 00000000000..00326141490 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/create_client_certificate_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateClientCertificateURL generates an URL for the create client certificate operation +type CreateClientCertificateURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateClientCertificateURL) WithBasePath(bp string) *CreateClientCertificateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateClientCertificateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateClientCertificateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/client-certificates" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateClientCertificateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateClientCertificateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateClientCertificateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateClientCertificateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateClientCertificateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go new file mode 100644 index 00000000000..59161996b9f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetClientCertificateHandlerFunc turns a function with the right signature into a get client certificate handler +type GetClientCertificateHandlerFunc func(GetClientCertificateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetClientCertificateHandlerFunc) Handle(params GetClientCertificateParams) middleware.Responder { + return fn(params) +} + +// GetClientCertificateHandler interface for that can handle valid get client certificate params +type GetClientCertificateHandler interface { + Handle(GetClientCertificateParams) middleware.Responder +} + +// NewGetClientCertificate creates a new http.Handler for the get client certificate operation +func NewGetClientCertificate(ctx *middleware.Context, handler GetClientCertificateHandler) *GetClientCertificate { + return &GetClientCertificate{Context: ctx, Handler: handler} +} + +/* + GetClientCertificate swagger:route GET /client-certificates/{clientCertificateId} Client certificates getClientCertificate + +# Get a client certificate + +This endpoint returns a single Client Certificate by ID. Do not use +this endpoint directly as it is meant to be used with the Admin UI +exclusively. +*/ +type GetClientCertificate struct { + Context *middleware.Context + Handler GetClientCertificateHandler +} + +func (o *GetClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetClientCertificateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go new file mode 100644 index 00000000000..70a7bd0cefb --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetClientCertificateParams creates a new GetClientCertificateParams object +// +// There are no default values defined in the spec. +func NewGetClientCertificateParams() GetClientCertificateParams { + + return GetClientCertificateParams{} +} + +// GetClientCertificateParams contains all the bound params for the get client certificate operation +// typically these are obtained from a http.Request +// +// swagger:parameters getClientCertificate +type GetClientCertificateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + ClientCertificateID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetClientCertificateParams() beforehand. +func (o *GetClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") + if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindClientCertificateID binds and validates parameter ClientCertificateID from path. +func (o *GetClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) + } + o.ClientCertificateID = *(value.(*strfmt.UUID)) + + if err := o.validateClientCertificateID(formats); err != nil { + return err + } + + return nil +} + +// validateClientCertificateID carries on validations for parameter ClientCertificateID +func (o *GetClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { + + if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go new file mode 100644 index 00000000000..64e5fafce31 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetClientCertificateOKCode is the HTTP code returned for type GetClientCertificateOK +const GetClientCertificateOKCode int = 200 + +/* +GetClientCertificateOK success + +swagger:response getClientCertificateOK +*/ +type GetClientCertificateOK struct { + + /* + In: Body + */ + Payload *adminmessages.ClientCertificate `json:"body,omitempty"` +} + +// NewGetClientCertificateOK creates GetClientCertificateOK with default headers values +func NewGetClientCertificateOK() *GetClientCertificateOK { + + return &GetClientCertificateOK{} +} + +// WithPayload adds the payload to the get client certificate o k response +func (o *GetClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *GetClientCertificateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get client certificate o k response +func (o *GetClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetClientCertificateBadRequestCode is the HTTP code returned for type GetClientCertificateBadRequest +const GetClientCertificateBadRequestCode int = 400 + +/* +GetClientCertificateBadRequest invalid request + +swagger:response getClientCertificateBadRequest +*/ +type GetClientCertificateBadRequest struct { +} + +// NewGetClientCertificateBadRequest creates GetClientCertificateBadRequest with default headers values +func NewGetClientCertificateBadRequest() *GetClientCertificateBadRequest { + + return &GetClientCertificateBadRequest{} +} + +// WriteResponse to the client +func (o *GetClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetClientCertificateUnauthorizedCode is the HTTP code returned for type GetClientCertificateUnauthorized +const GetClientCertificateUnauthorizedCode int = 401 + +/* +GetClientCertificateUnauthorized request requires user authentication + +swagger:response getClientCertificateUnauthorized +*/ +type GetClientCertificateUnauthorized struct { +} + +// NewGetClientCertificateUnauthorized creates GetClientCertificateUnauthorized with default headers values +func NewGetClientCertificateUnauthorized() *GetClientCertificateUnauthorized { + + return &GetClientCertificateUnauthorized{} +} + +// WriteResponse to the client +func (o *GetClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetClientCertificateNotFoundCode is the HTTP code returned for type GetClientCertificateNotFound +const GetClientCertificateNotFoundCode int = 404 + +/* +GetClientCertificateNotFound id not found + +swagger:response getClientCertificateNotFound +*/ +type GetClientCertificateNotFound struct { +} + +// NewGetClientCertificateNotFound creates GetClientCertificateNotFound with default headers values +func NewGetClientCertificateNotFound() *GetClientCertificateNotFound { + + return &GetClientCertificateNotFound{} +} + +// WriteResponse to the client +func (o *GetClientCertificateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetClientCertificateInternalServerErrorCode is the HTTP code returned for type GetClientCertificateInternalServerError +const GetClientCertificateInternalServerErrorCode int = 500 + +/* +GetClientCertificateInternalServerError server error + +swagger:response getClientCertificateInternalServerError +*/ +type GetClientCertificateInternalServerError struct { +} + +// NewGetClientCertificateInternalServerError creates GetClientCertificateInternalServerError with default headers values +func NewGetClientCertificateInternalServerError() *GetClientCertificateInternalServerError { + + return &GetClientCertificateInternalServerError{} +} + +// WriteResponse to the client +func (o *GetClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go new file mode 100644 index 00000000000..ebb693c73e1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/get_client_certificate_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetClientCertificateURL generates an URL for the get client certificate operation +type GetClientCertificateURL struct { + ClientCertificateID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetClientCertificateURL) WithBasePath(bp string) *GetClientCertificateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetClientCertificateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetClientCertificateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/client-certificates/{clientCertificateId}" + + clientCertificateID := o.ClientCertificateID.String() + if clientCertificateID != "" { + _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) + } else { + return nil, errors.New("clientCertificateId is required on GetClientCertificateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetClientCertificateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetClientCertificateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetClientCertificateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetClientCertificateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetClientCertificateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go new file mode 100644 index 00000000000..e70c6c97cf4 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexClientCertificatesHandlerFunc turns a function with the right signature into a index client certificates handler +type IndexClientCertificatesHandlerFunc func(IndexClientCertificatesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexClientCertificatesHandlerFunc) Handle(params IndexClientCertificatesParams) middleware.Responder { + return fn(params) +} + +// IndexClientCertificatesHandler interface for that can handle valid index client certificates params +type IndexClientCertificatesHandler interface { + Handle(IndexClientCertificatesParams) middleware.Responder +} + +// NewIndexClientCertificates creates a new http.Handler for the index client certificates operation +func NewIndexClientCertificates(ctx *middleware.Context, handler IndexClientCertificatesHandler) *IndexClientCertificates { + return &IndexClientCertificates{Context: ctx, Handler: handler} +} + +/* + IndexClientCertificates swagger:route GET /client-certificates Client certificates indexClientCertificates + +# List client certificates + +This endpoint returns a list of Client Certificates. Do not use this +endpoint directly as it is meant to be used with the Admin UI +exclusively. +*/ +type IndexClientCertificates struct { + Context *middleware.Context + Handler IndexClientCertificatesHandler +} + +func (o *IndexClientCertificates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexClientCertificatesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go new file mode 100644 index 00000000000..5dd5e461c9e --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexClientCertificatesParams creates a new IndexClientCertificatesParams object +// +// There are no default values defined in the spec. +func NewIndexClientCertificatesParams() IndexClientCertificatesParams { + + return IndexClientCertificatesParams{} +} + +// IndexClientCertificatesParams contains all the bound params for the index client certificates operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexClientCertificates +type IndexClientCertificatesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexClientCertificatesParams() beforehand. +func (o *IndexClientCertificatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexClientCertificatesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexClientCertificatesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexClientCertificatesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexClientCertificatesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexClientCertificatesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go new file mode 100644 index 00000000000..4bf02a9cf18 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexClientCertificatesOKCode is the HTTP code returned for type IndexClientCertificatesOK +const IndexClientCertificatesOKCode int = 200 + +/* +IndexClientCertificatesOK success + +swagger:response indexClientCertificatesOK +*/ +type IndexClientCertificatesOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.ClientCertificates `json:"body,omitempty"` +} + +// NewIndexClientCertificatesOK creates IndexClientCertificatesOK with default headers values +func NewIndexClientCertificatesOK() *IndexClientCertificatesOK { + + return &IndexClientCertificatesOK{} +} + +// WithContentRange adds the contentRange to the index client certificates o k response +func (o *IndexClientCertificatesOK) WithContentRange(contentRange string) *IndexClientCertificatesOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index client certificates o k response +func (o *IndexClientCertificatesOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index client certificates o k response +func (o *IndexClientCertificatesOK) WithPayload(payload adminmessages.ClientCertificates) *IndexClientCertificatesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index client certificates o k response +func (o *IndexClientCertificatesOK) SetPayload(payload adminmessages.ClientCertificates) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexClientCertificatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.ClientCertificates{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexClientCertificatesBadRequestCode is the HTTP code returned for type IndexClientCertificatesBadRequest +const IndexClientCertificatesBadRequestCode int = 400 + +/* +IndexClientCertificatesBadRequest invalid request + +swagger:response indexClientCertificatesBadRequest +*/ +type IndexClientCertificatesBadRequest struct { +} + +// NewIndexClientCertificatesBadRequest creates IndexClientCertificatesBadRequest with default headers values +func NewIndexClientCertificatesBadRequest() *IndexClientCertificatesBadRequest { + + return &IndexClientCertificatesBadRequest{} +} + +// WriteResponse to the client +func (o *IndexClientCertificatesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexClientCertificatesUnauthorizedCode is the HTTP code returned for type IndexClientCertificatesUnauthorized +const IndexClientCertificatesUnauthorizedCode int = 401 + +/* +IndexClientCertificatesUnauthorized request requires user authentication + +swagger:response indexClientCertificatesUnauthorized +*/ +type IndexClientCertificatesUnauthorized struct { +} + +// NewIndexClientCertificatesUnauthorized creates IndexClientCertificatesUnauthorized with default headers values +func NewIndexClientCertificatesUnauthorized() *IndexClientCertificatesUnauthorized { + + return &IndexClientCertificatesUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexClientCertificatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexClientCertificatesNotFoundCode is the HTTP code returned for type IndexClientCertificatesNotFound +const IndexClientCertificatesNotFoundCode int = 404 + +/* +IndexClientCertificatesNotFound office not found + +swagger:response indexClientCertificatesNotFound +*/ +type IndexClientCertificatesNotFound struct { +} + +// NewIndexClientCertificatesNotFound creates IndexClientCertificatesNotFound with default headers values +func NewIndexClientCertificatesNotFound() *IndexClientCertificatesNotFound { + + return &IndexClientCertificatesNotFound{} +} + +// WriteResponse to the client +func (o *IndexClientCertificatesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexClientCertificatesInternalServerErrorCode is the HTTP code returned for type IndexClientCertificatesInternalServerError +const IndexClientCertificatesInternalServerErrorCode int = 500 + +/* +IndexClientCertificatesInternalServerError server error + +swagger:response indexClientCertificatesInternalServerError +*/ +type IndexClientCertificatesInternalServerError struct { +} + +// NewIndexClientCertificatesInternalServerError creates IndexClientCertificatesInternalServerError with default headers values +func NewIndexClientCertificatesInternalServerError() *IndexClientCertificatesInternalServerError { + + return &IndexClientCertificatesInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexClientCertificatesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go new file mode 100644 index 00000000000..78037d822ca --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/index_client_certificates_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexClientCertificatesURL generates an URL for the index client certificates operation +type IndexClientCertificatesURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexClientCertificatesURL) WithBasePath(bp string) *IndexClientCertificatesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexClientCertificatesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexClientCertificatesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/client-certificates" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexClientCertificatesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexClientCertificatesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexClientCertificatesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexClientCertificatesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexClientCertificatesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexClientCertificatesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go new file mode 100644 index 00000000000..f8dc02bc17e --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RemoveClientCertificateHandlerFunc turns a function with the right signature into a remove client certificate handler +type RemoveClientCertificateHandlerFunc func(RemoveClientCertificateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RemoveClientCertificateHandlerFunc) Handle(params RemoveClientCertificateParams) middleware.Responder { + return fn(params) +} + +// RemoveClientCertificateHandler interface for that can handle valid remove client certificate params +type RemoveClientCertificateHandler interface { + Handle(RemoveClientCertificateParams) middleware.Responder +} + +// NewRemoveClientCertificate creates a new http.Handler for the remove client certificate operation +func NewRemoveClientCertificate(ctx *middleware.Context, handler RemoveClientCertificateHandler) *RemoveClientCertificate { + return &RemoveClientCertificate{Context: ctx, Handler: handler} +} + +/* + RemoveClientCertificate swagger:route DELETE /client-certificates/{clientCertificateId} Client certificates removeClientCertificate + +removes a client certificate + +This endpoint removes a single Client Certificate by ID. Do not use +this endpoint directly as it is meant to be used with the Admin UI +exclusively. +*/ +type RemoveClientCertificate struct { + Context *middleware.Context + Handler RemoveClientCertificateHandler +} + +func (o *RemoveClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRemoveClientCertificateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go new file mode 100644 index 00000000000..6b29aa1cf35 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewRemoveClientCertificateParams creates a new RemoveClientCertificateParams object +// +// There are no default values defined in the spec. +func NewRemoveClientCertificateParams() RemoveClientCertificateParams { + + return RemoveClientCertificateParams{} +} + +// RemoveClientCertificateParams contains all the bound params for the remove client certificate operation +// typically these are obtained from a http.Request +// +// swagger:parameters removeClientCertificate +type RemoveClientCertificateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + ClientCertificateID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRemoveClientCertificateParams() beforehand. +func (o *RemoveClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") + if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindClientCertificateID binds and validates parameter ClientCertificateID from path. +func (o *RemoveClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) + } + o.ClientCertificateID = *(value.(*strfmt.UUID)) + + if err := o.validateClientCertificateID(formats); err != nil { + return err + } + + return nil +} + +// validateClientCertificateID carries on validations for parameter ClientCertificateID +func (o *RemoveClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { + + if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go new file mode 100644 index 00000000000..2d5c13d2656 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// RemoveClientCertificateOKCode is the HTTP code returned for type RemoveClientCertificateOK +const RemoveClientCertificateOKCode int = 200 + +/* +RemoveClientCertificateOK Successfully removed Client Certificate + +swagger:response removeClientCertificateOK +*/ +type RemoveClientCertificateOK struct { + + /* + In: Body + */ + Payload *adminmessages.ClientCertificate `json:"body,omitempty"` +} + +// NewRemoveClientCertificateOK creates RemoveClientCertificateOK with default headers values +func NewRemoveClientCertificateOK() *RemoveClientCertificateOK { + + return &RemoveClientCertificateOK{} +} + +// WithPayload adds the payload to the remove client certificate o k response +func (o *RemoveClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *RemoveClientCertificateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the remove client certificate o k response +func (o *RemoveClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RemoveClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RemoveClientCertificateBadRequestCode is the HTTP code returned for type RemoveClientCertificateBadRequest +const RemoveClientCertificateBadRequestCode int = 400 + +/* +RemoveClientCertificateBadRequest Invalid Request + +swagger:response removeClientCertificateBadRequest +*/ +type RemoveClientCertificateBadRequest struct { +} + +// NewRemoveClientCertificateBadRequest creates RemoveClientCertificateBadRequest with default headers values +func NewRemoveClientCertificateBadRequest() *RemoveClientCertificateBadRequest { + + return &RemoveClientCertificateBadRequest{} +} + +// WriteResponse to the client +func (o *RemoveClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// RemoveClientCertificateUnauthorizedCode is the HTTP code returned for type RemoveClientCertificateUnauthorized +const RemoveClientCertificateUnauthorizedCode int = 401 + +/* +RemoveClientCertificateUnauthorized Must be authenticated to use this end point + +swagger:response removeClientCertificateUnauthorized +*/ +type RemoveClientCertificateUnauthorized struct { +} + +// NewRemoveClientCertificateUnauthorized creates RemoveClientCertificateUnauthorized with default headers values +func NewRemoveClientCertificateUnauthorized() *RemoveClientCertificateUnauthorized { + + return &RemoveClientCertificateUnauthorized{} +} + +// WriteResponse to the client +func (o *RemoveClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// RemoveClientCertificateForbiddenCode is the HTTP code returned for type RemoveClientCertificateForbidden +const RemoveClientCertificateForbiddenCode int = 403 + +/* +RemoveClientCertificateForbidden Not authorized to remove a client certificate + +swagger:response removeClientCertificateForbidden +*/ +type RemoveClientCertificateForbidden struct { +} + +// NewRemoveClientCertificateForbidden creates RemoveClientCertificateForbidden with default headers values +func NewRemoveClientCertificateForbidden() *RemoveClientCertificateForbidden { + + return &RemoveClientCertificateForbidden{} +} + +// WriteResponse to the client +func (o *RemoveClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// RemoveClientCertificateInternalServerErrorCode is the HTTP code returned for type RemoveClientCertificateInternalServerError +const RemoveClientCertificateInternalServerErrorCode int = 500 + +/* +RemoveClientCertificateInternalServerError Server error + +swagger:response removeClientCertificateInternalServerError +*/ +type RemoveClientCertificateInternalServerError struct { +} + +// NewRemoveClientCertificateInternalServerError creates RemoveClientCertificateInternalServerError with default headers values +func NewRemoveClientCertificateInternalServerError() *RemoveClientCertificateInternalServerError { + + return &RemoveClientCertificateInternalServerError{} +} + +// WriteResponse to the client +func (o *RemoveClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go new file mode 100644 index 00000000000..8c2d98a56e4 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/remove_client_certificate_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RemoveClientCertificateURL generates an URL for the remove client certificate operation +type RemoveClientCertificateURL struct { + ClientCertificateID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RemoveClientCertificateURL) WithBasePath(bp string) *RemoveClientCertificateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RemoveClientCertificateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RemoveClientCertificateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/client-certificates/{clientCertificateId}" + + clientCertificateID := o.ClientCertificateID.String() + if clientCertificateID != "" { + _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) + } else { + return nil, errors.New("clientCertificateId is required on RemoveClientCertificateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RemoveClientCertificateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RemoveClientCertificateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RemoveClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RemoveClientCertificateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RemoveClientCertificateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RemoveClientCertificateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go new file mode 100644 index 00000000000..6e013be7628 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateClientCertificateHandlerFunc turns a function with the right signature into a update client certificate handler +type UpdateClientCertificateHandlerFunc func(UpdateClientCertificateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateClientCertificateHandlerFunc) Handle(params UpdateClientCertificateParams) middleware.Responder { + return fn(params) +} + +// UpdateClientCertificateHandler interface for that can handle valid update client certificate params +type UpdateClientCertificateHandler interface { + Handle(UpdateClientCertificateParams) middleware.Responder +} + +// NewUpdateClientCertificate creates a new http.Handler for the update client certificate operation +func NewUpdateClientCertificate(ctx *middleware.Context, handler UpdateClientCertificateHandler) *UpdateClientCertificate { + return &UpdateClientCertificate{Context: ctx, Handler: handler} +} + +/* + UpdateClientCertificate swagger:route PATCH /client-certificates/{clientCertificateId} Client certificates updateClientCertificate + +# Updates a client certificate + +This endpoint updates a single Client Certificate by ID. Do not use +this endpoint directly as it is meant to be used with the Admin UI +exclusively. +*/ +type UpdateClientCertificate struct { + Context *middleware.Context + Handler UpdateClientCertificateHandler +} + +func (o *UpdateClientCertificate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateClientCertificateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go new file mode 100644 index 00000000000..b25f01f232c --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateClientCertificateParams creates a new UpdateClientCertificateParams object +// +// There are no default values defined in the spec. +func NewUpdateClientCertificateParams() UpdateClientCertificateParams { + + return UpdateClientCertificateParams{} +} + +// UpdateClientCertificateParams contains all the bound params for the update client certificate operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateClientCertificate +type UpdateClientCertificateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*client cert information + Required: true + In: body + */ + ClientCertificate *adminmessages.ClientCertificateUpdate + /* + Required: true + In: path + */ + ClientCertificateID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateClientCertificateParams() beforehand. +func (o *UpdateClientCertificateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.ClientCertificateUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("clientCertificate", "body", "")) + } else { + res = append(res, errors.NewParseError("clientCertificate", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ClientCertificate = &body + } + } + } else { + res = append(res, errors.Required("clientCertificate", "body", "")) + } + + rClientCertificateID, rhkClientCertificateID, _ := route.Params.GetOK("clientCertificateId") + if err := o.bindClientCertificateID(rClientCertificateID, rhkClientCertificateID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindClientCertificateID binds and validates parameter ClientCertificateID from path. +func (o *UpdateClientCertificateParams) bindClientCertificateID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("clientCertificateId", "path", "strfmt.UUID", raw) + } + o.ClientCertificateID = *(value.(*strfmt.UUID)) + + if err := o.validateClientCertificateID(formats); err != nil { + return err + } + + return nil +} + +// validateClientCertificateID carries on validations for parameter ClientCertificateID +func (o *UpdateClientCertificateParams) validateClientCertificateID(formats strfmt.Registry) error { + + if err := validate.FormatOf("clientCertificateId", "path", "uuid", o.ClientCertificateID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go new file mode 100644 index 00000000000..32d5fe36e69 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateClientCertificateOKCode is the HTTP code returned for type UpdateClientCertificateOK +const UpdateClientCertificateOKCode int = 200 + +/* +UpdateClientCertificateOK Successfully updated Client Certificate + +swagger:response updateClientCertificateOK +*/ +type UpdateClientCertificateOK struct { + + /* + In: Body + */ + Payload *adminmessages.ClientCertificate `json:"body,omitempty"` +} + +// NewUpdateClientCertificateOK creates UpdateClientCertificateOK with default headers values +func NewUpdateClientCertificateOK() *UpdateClientCertificateOK { + + return &UpdateClientCertificateOK{} +} + +// WithPayload adds the payload to the update client certificate o k response +func (o *UpdateClientCertificateOK) WithPayload(payload *adminmessages.ClientCertificate) *UpdateClientCertificateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update client certificate o k response +func (o *UpdateClientCertificateOK) SetPayload(payload *adminmessages.ClientCertificate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateClientCertificateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateClientCertificateBadRequestCode is the HTTP code returned for type UpdateClientCertificateBadRequest +const UpdateClientCertificateBadRequestCode int = 400 + +/* +UpdateClientCertificateBadRequest Invalid Request + +swagger:response updateClientCertificateBadRequest +*/ +type UpdateClientCertificateBadRequest struct { +} + +// NewUpdateClientCertificateBadRequest creates UpdateClientCertificateBadRequest with default headers values +func NewUpdateClientCertificateBadRequest() *UpdateClientCertificateBadRequest { + + return &UpdateClientCertificateBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateClientCertificateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateClientCertificateUnauthorizedCode is the HTTP code returned for type UpdateClientCertificateUnauthorized +const UpdateClientCertificateUnauthorizedCode int = 401 + +/* +UpdateClientCertificateUnauthorized Must be authenticated to use this end point + +swagger:response updateClientCertificateUnauthorized +*/ +type UpdateClientCertificateUnauthorized struct { +} + +// NewUpdateClientCertificateUnauthorized creates UpdateClientCertificateUnauthorized with default headers values +func NewUpdateClientCertificateUnauthorized() *UpdateClientCertificateUnauthorized { + + return &UpdateClientCertificateUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateClientCertificateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateClientCertificateForbiddenCode is the HTTP code returned for type UpdateClientCertificateForbidden +const UpdateClientCertificateForbiddenCode int = 403 + +/* +UpdateClientCertificateForbidden Not authorized to update a client certificate + +swagger:response updateClientCertificateForbidden +*/ +type UpdateClientCertificateForbidden struct { +} + +// NewUpdateClientCertificateForbidden creates UpdateClientCertificateForbidden with default headers values +func NewUpdateClientCertificateForbidden() *UpdateClientCertificateForbidden { + + return &UpdateClientCertificateForbidden{} +} + +// WriteResponse to the client +func (o *UpdateClientCertificateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateClientCertificateInternalServerErrorCode is the HTTP code returned for type UpdateClientCertificateInternalServerError +const UpdateClientCertificateInternalServerErrorCode int = 500 + +/* +UpdateClientCertificateInternalServerError Server error + +swagger:response updateClientCertificateInternalServerError +*/ +type UpdateClientCertificateInternalServerError struct { +} + +// NewUpdateClientCertificateInternalServerError creates UpdateClientCertificateInternalServerError with default headers values +func NewUpdateClientCertificateInternalServerError() *UpdateClientCertificateInternalServerError { + + return &UpdateClientCertificateInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateClientCertificateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go new file mode 100644 index 00000000000..e9f97f74c63 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/client_certificates/update_client_certificate_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package client_certificates + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateClientCertificateURL generates an URL for the update client certificate operation +type UpdateClientCertificateURL struct { + ClientCertificateID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateClientCertificateURL) WithBasePath(bp string) *UpdateClientCertificateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateClientCertificateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateClientCertificateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/client-certificates/{clientCertificateId}" + + clientCertificateID := o.ClientCertificateID.String() + if clientCertificateID != "" { + _path = strings.Replace(_path, "{clientCertificateId}", clientCertificateID, -1) + } else { + return nil, errors.New("clientCertificateId is required on UpdateClientCertificateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateClientCertificateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateClientCertificateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateClientCertificateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateClientCertificateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateClientCertificateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateClientCertificateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go new file mode 100644 index 00000000000..82450238284 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetElectronicOrdersTotalsHandlerFunc turns a function with the right signature into a get electronic orders totals handler +type GetElectronicOrdersTotalsHandlerFunc func(GetElectronicOrdersTotalsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetElectronicOrdersTotalsHandlerFunc) Handle(params GetElectronicOrdersTotalsParams) middleware.Responder { + return fn(params) +} + +// GetElectronicOrdersTotalsHandler interface for that can handle valid get electronic orders totals params +type GetElectronicOrdersTotalsHandler interface { + Handle(GetElectronicOrdersTotalsParams) middleware.Responder +} + +// NewGetElectronicOrdersTotals creates a new http.Handler for the get electronic orders totals operation +func NewGetElectronicOrdersTotals(ctx *middleware.Context, handler GetElectronicOrdersTotalsHandler) *GetElectronicOrdersTotals { + return &GetElectronicOrdersTotals{Context: ctx, Handler: handler} +} + +/* + GetElectronicOrdersTotals swagger:route GET /electronic-orders/totals Electronic orders getElectronicOrdersTotals + +# Get total counts for the orders stored in MilMove + +This endpoint returns a list of record counts for Electronic Orders. Do not use +this endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type GetElectronicOrdersTotals struct { + Context *middleware.Context + Handler GetElectronicOrdersTotalsHandler +} + +func (o *GetElectronicOrdersTotals) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetElectronicOrdersTotalsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go new file mode 100644 index 00000000000..5db5040c80e --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_parameters.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetElectronicOrdersTotalsParams creates a new GetElectronicOrdersTotalsParams object +// +// There are no default values defined in the spec. +func NewGetElectronicOrdersTotalsParams() GetElectronicOrdersTotalsParams { + + return GetElectronicOrdersTotalsParams{} +} + +// GetElectronicOrdersTotalsParams contains all the bound params for the get electronic orders totals operation +// typically these are obtained from a http.Request +// +// swagger:parameters getElectronicOrdersTotals +type GetElectronicOrdersTotalsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + AndFilter []string + /* + In: query + */ + Filter []string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetElectronicOrdersTotalsParams() beforehand. +func (o *GetElectronicOrdersTotalsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qAndFilter, qhkAndFilter, _ := qs.GetOK("andFilter") + if err := o.bindAndFilter(qAndFilter, qhkAndFilter, route.Formats); err != nil { + res = append(res, err) + } + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAndFilter binds and validates array parameter AndFilter from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *GetElectronicOrdersTotalsParams) bindAndFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvAndFilter string + if len(rawData) > 0 { + qvAndFilter = rawData[len(rawData)-1] + } + + // CollectionFormat: + andFilterIC := swag.SplitByFormat(qvAndFilter, "") + if len(andFilterIC) == 0 { + return nil + } + + var andFilterIR []string + for _, andFilterIV := range andFilterIC { + andFilterI := andFilterIV + + andFilterIR = append(andFilterIR, andFilterI) + } + + o.AndFilter = andFilterIR + + return nil +} + +// bindFilter binds and validates array parameter Filter from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *GetElectronicOrdersTotalsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvFilter string + if len(rawData) > 0 { + qvFilter = rawData[len(rawData)-1] + } + + // CollectionFormat: + filterIC := swag.SplitByFormat(qvFilter, "") + if len(filterIC) == 0 { + return nil + } + + var filterIR []string + for _, filterIV := range filterIC { + filterI := filterIV + + filterIR = append(filterIR, filterI) + } + + o.Filter = filterIR + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go new file mode 100644 index 00000000000..d782dfd0d2b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_responses.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetElectronicOrdersTotalsOKCode is the HTTP code returned for type GetElectronicOrdersTotalsOK +const GetElectronicOrdersTotalsOKCode int = 200 + +/* +GetElectronicOrdersTotalsOK success + +swagger:response getElectronicOrdersTotalsOK +*/ +type GetElectronicOrdersTotalsOK struct { + + /* + In: Body + */ + Payload adminmessages.ElectronicOrdersTotals `json:"body,omitempty"` +} + +// NewGetElectronicOrdersTotalsOK creates GetElectronicOrdersTotalsOK with default headers values +func NewGetElectronicOrdersTotalsOK() *GetElectronicOrdersTotalsOK { + + return &GetElectronicOrdersTotalsOK{} +} + +// WithPayload adds the payload to the get electronic orders totals o k response +func (o *GetElectronicOrdersTotalsOK) WithPayload(payload adminmessages.ElectronicOrdersTotals) *GetElectronicOrdersTotalsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get electronic orders totals o k response +func (o *GetElectronicOrdersTotalsOK) SetPayload(payload adminmessages.ElectronicOrdersTotals) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetElectronicOrdersTotalsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.ElectronicOrdersTotals{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetElectronicOrdersTotalsBadRequestCode is the HTTP code returned for type GetElectronicOrdersTotalsBadRequest +const GetElectronicOrdersTotalsBadRequestCode int = 400 + +/* +GetElectronicOrdersTotalsBadRequest invalid request + +swagger:response getElectronicOrdersTotalsBadRequest +*/ +type GetElectronicOrdersTotalsBadRequest struct { +} + +// NewGetElectronicOrdersTotalsBadRequest creates GetElectronicOrdersTotalsBadRequest with default headers values +func NewGetElectronicOrdersTotalsBadRequest() *GetElectronicOrdersTotalsBadRequest { + + return &GetElectronicOrdersTotalsBadRequest{} +} + +// WriteResponse to the client +func (o *GetElectronicOrdersTotalsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetElectronicOrdersTotalsUnauthorizedCode is the HTTP code returned for type GetElectronicOrdersTotalsUnauthorized +const GetElectronicOrdersTotalsUnauthorizedCode int = 401 + +/* +GetElectronicOrdersTotalsUnauthorized request requires user authentication + +swagger:response getElectronicOrdersTotalsUnauthorized +*/ +type GetElectronicOrdersTotalsUnauthorized struct { +} + +// NewGetElectronicOrdersTotalsUnauthorized creates GetElectronicOrdersTotalsUnauthorized with default headers values +func NewGetElectronicOrdersTotalsUnauthorized() *GetElectronicOrdersTotalsUnauthorized { + + return &GetElectronicOrdersTotalsUnauthorized{} +} + +// WriteResponse to the client +func (o *GetElectronicOrdersTotalsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetElectronicOrdersTotalsNotFoundCode is the HTTP code returned for type GetElectronicOrdersTotalsNotFound +const GetElectronicOrdersTotalsNotFoundCode int = 404 + +/* +GetElectronicOrdersTotalsNotFound Total count for Electronic Orders not found + +swagger:response getElectronicOrdersTotalsNotFound +*/ +type GetElectronicOrdersTotalsNotFound struct { +} + +// NewGetElectronicOrdersTotalsNotFound creates GetElectronicOrdersTotalsNotFound with default headers values +func NewGetElectronicOrdersTotalsNotFound() *GetElectronicOrdersTotalsNotFound { + + return &GetElectronicOrdersTotalsNotFound{} +} + +// WriteResponse to the client +func (o *GetElectronicOrdersTotalsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetElectronicOrdersTotalsInternalServerErrorCode is the HTTP code returned for type GetElectronicOrdersTotalsInternalServerError +const GetElectronicOrdersTotalsInternalServerErrorCode int = 500 + +/* +GetElectronicOrdersTotalsInternalServerError server error + +swagger:response getElectronicOrdersTotalsInternalServerError +*/ +type GetElectronicOrdersTotalsInternalServerError struct { +} + +// NewGetElectronicOrdersTotalsInternalServerError creates GetElectronicOrdersTotalsInternalServerError with default headers values +func NewGetElectronicOrdersTotalsInternalServerError() *GetElectronicOrdersTotalsInternalServerError { + + return &GetElectronicOrdersTotalsInternalServerError{} +} + +// WriteResponse to the client +func (o *GetElectronicOrdersTotalsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go new file mode 100644 index 00000000000..a5a2415e2f9 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/get_electronic_orders_totals_urlbuilder.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// GetElectronicOrdersTotalsURL generates an URL for the get electronic orders totals operation +type GetElectronicOrdersTotalsURL struct { + AndFilter []string + Filter []string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetElectronicOrdersTotalsURL) WithBasePath(bp string) *GetElectronicOrdersTotalsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetElectronicOrdersTotalsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetElectronicOrdersTotalsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/electronic-orders/totals" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var andFilterIR []string + for _, andFilterI := range o.AndFilter { + andFilterIS := andFilterI + if andFilterIS != "" { + andFilterIR = append(andFilterIR, andFilterIS) + } + } + + andFilter := swag.JoinByFormat(andFilterIR, "") + + if len(andFilter) > 0 { + qsv := andFilter[0] + if qsv != "" { + qs.Set("andFilter", qsv) + } + } + + var filterIR []string + for _, filterI := range o.Filter { + filterIS := filterI + if filterIS != "" { + filterIR = append(filterIR, filterIS) + } + } + + filter := swag.JoinByFormat(filterIR, "") + + if len(filter) > 0 { + qsv := filter[0] + if qsv != "" { + qs.Set("filter", qsv) + } + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetElectronicOrdersTotalsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetElectronicOrdersTotalsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetElectronicOrdersTotalsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetElectronicOrdersTotalsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetElectronicOrdersTotalsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetElectronicOrdersTotalsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go new file mode 100644 index 00000000000..79dd17739c7 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexElectronicOrdersHandlerFunc turns a function with the right signature into a index electronic orders handler +type IndexElectronicOrdersHandlerFunc func(IndexElectronicOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexElectronicOrdersHandlerFunc) Handle(params IndexElectronicOrdersParams) middleware.Responder { + return fn(params) +} + +// IndexElectronicOrdersHandler interface for that can handle valid index electronic orders params +type IndexElectronicOrdersHandler interface { + Handle(IndexElectronicOrdersParams) middleware.Responder +} + +// NewIndexElectronicOrders creates a new http.Handler for the index electronic orders operation +func NewIndexElectronicOrders(ctx *middleware.Context, handler IndexElectronicOrdersHandler) *IndexElectronicOrders { + return &IndexElectronicOrders{Context: ctx, Handler: handler} +} + +/* + IndexElectronicOrders swagger:route GET /electronic-orders Electronic orders indexElectronicOrders + +# List Electronic Orders + +This endpoint returns a list of Electronic Orders. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type IndexElectronicOrders struct { + Context *middleware.Context + Handler IndexElectronicOrdersHandler +} + +func (o *IndexElectronicOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexElectronicOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go new file mode 100644 index 00000000000..7cf24f4b208 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_parameters.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexElectronicOrdersParams creates a new IndexElectronicOrdersParams object +// +// There are no default values defined in the spec. +func NewIndexElectronicOrdersParams() IndexElectronicOrdersParams { + + return IndexElectronicOrdersParams{} +} + +// IndexElectronicOrdersParams contains all the bound params for the index electronic orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexElectronicOrders +type IndexElectronicOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter []string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexElectronicOrdersParams() beforehand. +func (o *IndexElectronicOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates array parameter Filter from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *IndexElectronicOrdersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvFilter string + if len(rawData) > 0 { + qvFilter = rawData[len(rawData)-1] + } + + // CollectionFormat: + filterIC := swag.SplitByFormat(qvFilter, "") + if len(filterIC) == 0 { + return nil + } + + var filterIR []string + for _, filterIV := range filterIC { + filterI := filterIV + + filterIR = append(filterIR, filterI) + } + + o.Filter = filterIR + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexElectronicOrdersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexElectronicOrdersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexElectronicOrdersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexElectronicOrdersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go new file mode 100644 index 00000000000..d9a92c28ca7 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexElectronicOrdersOKCode is the HTTP code returned for type IndexElectronicOrdersOK +const IndexElectronicOrdersOKCode int = 200 + +/* +IndexElectronicOrdersOK success + +swagger:response indexElectronicOrdersOK +*/ +type IndexElectronicOrdersOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.ElectronicOrders `json:"body,omitempty"` +} + +// NewIndexElectronicOrdersOK creates IndexElectronicOrdersOK with default headers values +func NewIndexElectronicOrdersOK() *IndexElectronicOrdersOK { + + return &IndexElectronicOrdersOK{} +} + +// WithContentRange adds the contentRange to the index electronic orders o k response +func (o *IndexElectronicOrdersOK) WithContentRange(contentRange string) *IndexElectronicOrdersOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index electronic orders o k response +func (o *IndexElectronicOrdersOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index electronic orders o k response +func (o *IndexElectronicOrdersOK) WithPayload(payload adminmessages.ElectronicOrders) *IndexElectronicOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index electronic orders o k response +func (o *IndexElectronicOrdersOK) SetPayload(payload adminmessages.ElectronicOrders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexElectronicOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.ElectronicOrders{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexElectronicOrdersBadRequestCode is the HTTP code returned for type IndexElectronicOrdersBadRequest +const IndexElectronicOrdersBadRequestCode int = 400 + +/* +IndexElectronicOrdersBadRequest invalid request + +swagger:response indexElectronicOrdersBadRequest +*/ +type IndexElectronicOrdersBadRequest struct { +} + +// NewIndexElectronicOrdersBadRequest creates IndexElectronicOrdersBadRequest with default headers values +func NewIndexElectronicOrdersBadRequest() *IndexElectronicOrdersBadRequest { + + return &IndexElectronicOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *IndexElectronicOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexElectronicOrdersUnauthorizedCode is the HTTP code returned for type IndexElectronicOrdersUnauthorized +const IndexElectronicOrdersUnauthorizedCode int = 401 + +/* +IndexElectronicOrdersUnauthorized request requires user authentication + +swagger:response indexElectronicOrdersUnauthorized +*/ +type IndexElectronicOrdersUnauthorized struct { +} + +// NewIndexElectronicOrdersUnauthorized creates IndexElectronicOrdersUnauthorized with default headers values +func NewIndexElectronicOrdersUnauthorized() *IndexElectronicOrdersUnauthorized { + + return &IndexElectronicOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexElectronicOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexElectronicOrdersNotFoundCode is the HTTP code returned for type IndexElectronicOrdersNotFound +const IndexElectronicOrdersNotFoundCode int = 404 + +/* +IndexElectronicOrdersNotFound Electronic Order not found + +swagger:response indexElectronicOrdersNotFound +*/ +type IndexElectronicOrdersNotFound struct { +} + +// NewIndexElectronicOrdersNotFound creates IndexElectronicOrdersNotFound with default headers values +func NewIndexElectronicOrdersNotFound() *IndexElectronicOrdersNotFound { + + return &IndexElectronicOrdersNotFound{} +} + +// WriteResponse to the client +func (o *IndexElectronicOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexElectronicOrdersInternalServerErrorCode is the HTTP code returned for type IndexElectronicOrdersInternalServerError +const IndexElectronicOrdersInternalServerErrorCode int = 500 + +/* +IndexElectronicOrdersInternalServerError server error + +swagger:response indexElectronicOrdersInternalServerError +*/ +type IndexElectronicOrdersInternalServerError struct { +} + +// NewIndexElectronicOrdersInternalServerError creates IndexElectronicOrdersInternalServerError with default headers values +func NewIndexElectronicOrdersInternalServerError() *IndexElectronicOrdersInternalServerError { + + return &IndexElectronicOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexElectronicOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go new file mode 100644 index 00000000000..534c245c601 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/electronic_orders/index_electronic_orders_urlbuilder.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package electronic_orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexElectronicOrdersURL generates an URL for the index electronic orders operation +type IndexElectronicOrdersURL struct { + Filter []string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexElectronicOrdersURL) WithBasePath(bp string) *IndexElectronicOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexElectronicOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexElectronicOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/electronic-orders" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterIR []string + for _, filterI := range o.Filter { + filterIS := filterI + if filterIS != "" { + filterIR = append(filterIR, filterIS) + } + } + + filter := swag.JoinByFormat(filterIR, "") + + if len(filter) > 0 { + qsv := filter[0] + if qsv != "" { + qs.Set("filter", qsv) + } + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexElectronicOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexElectronicOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexElectronicOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexElectronicOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexElectronicOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexElectronicOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move.go b/pkg/gen/adminapi/adminoperations/moves/get_move.go new file mode 100644 index 00000000000..f674264c30b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/get_move.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveHandlerFunc turns a function with the right signature into a get move handler +type GetMoveHandlerFunc func(GetMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveHandlerFunc) Handle(params GetMoveParams) middleware.Responder { + return fn(params) +} + +// GetMoveHandler interface for that can handle valid get move params +type GetMoveHandler interface { + Handle(GetMoveParams) middleware.Responder +} + +// NewGetMove creates a new http.Handler for the get move operation +func NewGetMove(ctx *middleware.Context, handler GetMoveHandler) *GetMove { + return &GetMove{Context: ctx, Handler: handler} +} + +/* + GetMove swagger:route GET /moves/{moveID} Moves getMove + +# Get information about a Move + +This endpoint returns a single Move by ID. Do not use this endpoint directly as +it is meant to be used with the Admin UI exclusively. +*/ +type GetMove struct { + Context *middleware.Context + Handler GetMoveHandler +} + +func (o *GetMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go b/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go new file mode 100644 index 00000000000..7a3c1185b61 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/get_move_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetMoveParams creates a new GetMoveParams object +// +// There are no default values defined in the spec. +func NewGetMoveParams() GetMoveParams { + + return GetMoveParams{} +} + +// GetMoveParams contains all the bound params for the get move operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMove +type GetMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveParams() beforehand. +func (o *GetMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *GetMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go b/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go new file mode 100644 index 00000000000..f1070aabdb2 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/get_move_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetMoveOKCode is the HTTP code returned for type GetMoveOK +const GetMoveOKCode int = 200 + +/* +GetMoveOK Success + +swagger:response getMoveOK +*/ +type GetMoveOK struct { + + /* + In: Body + */ + Payload *adminmessages.Move `json:"body,omitempty"` +} + +// NewGetMoveOK creates GetMoveOK with default headers values +func NewGetMoveOK() *GetMoveOK { + + return &GetMoveOK{} +} + +// WithPayload adds the payload to the get move o k response +func (o *GetMoveOK) WithPayload(payload *adminmessages.Move) *GetMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move o k response +func (o *GetMoveOK) SetPayload(payload *adminmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveBadRequestCode is the HTTP code returned for type GetMoveBadRequest +const GetMoveBadRequestCode int = 400 + +/* +GetMoveBadRequest Invalid request + +swagger:response getMoveBadRequest +*/ +type GetMoveBadRequest struct { +} + +// NewGetMoveBadRequest creates GetMoveBadRequest with default headers values +func NewGetMoveBadRequest() *GetMoveBadRequest { + + return &GetMoveBadRequest{} +} + +// WriteResponse to the client +func (o *GetMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetMoveUnauthorizedCode is the HTTP code returned for type GetMoveUnauthorized +const GetMoveUnauthorizedCode int = 401 + +/* +GetMoveUnauthorized Must be authenticated to use this endpoint + +swagger:response getMoveUnauthorized +*/ +type GetMoveUnauthorized struct { +} + +// NewGetMoveUnauthorized creates GetMoveUnauthorized with default headers values +func NewGetMoveUnauthorized() *GetMoveUnauthorized { + + return &GetMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *GetMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetMoveNotFoundCode is the HTTP code returned for type GetMoveNotFound +const GetMoveNotFoundCode int = 404 + +/* +GetMoveNotFound Move not found + +swagger:response getMoveNotFound +*/ +type GetMoveNotFound struct { +} + +// NewGetMoveNotFound creates GetMoveNotFound with default headers values +func NewGetMoveNotFound() *GetMoveNotFound { + + return &GetMoveNotFound{} +} + +// WriteResponse to the client +func (o *GetMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetMoveInternalServerErrorCode is the HTTP code returned for type GetMoveInternalServerError +const GetMoveInternalServerErrorCode int = 500 + +/* +GetMoveInternalServerError Server error + +swagger:response getMoveInternalServerError +*/ +type GetMoveInternalServerError struct { +} + +// NewGetMoveInternalServerError creates GetMoveInternalServerError with default headers values +func NewGetMoveInternalServerError() *GetMoveInternalServerError { + + return &GetMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *GetMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go new file mode 100644 index 00000000000..61e83c27c9e --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/get_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetMoveURL generates an URL for the get move operation +type GetMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveURL) WithBasePath(bp string) *GetMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves.go b/pkg/gen/adminapi/adminoperations/moves/index_moves.go new file mode 100644 index 00000000000..d059611a921 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/index_moves.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexMovesHandlerFunc turns a function with the right signature into a index moves handler +type IndexMovesHandlerFunc func(IndexMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexMovesHandlerFunc) Handle(params IndexMovesParams) middleware.Responder { + return fn(params) +} + +// IndexMovesHandler interface for that can handle valid index moves params +type IndexMovesHandler interface { + Handle(IndexMovesParams) middleware.Responder +} + +// NewIndexMoves creates a new http.Handler for the index moves operation +func NewIndexMoves(ctx *middleware.Context, handler IndexMovesHandler) *IndexMoves { + return &IndexMoves{Context: ctx, Handler: handler} +} + +/* + IndexMoves swagger:route GET /moves Moves indexMoves + +# List Moves + +This endpoint returns a list of Moves. Do not use this endpoint directly +as it is meant to be used with the Admin UI exclusively. +*/ +type IndexMoves struct { + Context *middleware.Context + Handler IndexMovesHandler +} + +func (o *IndexMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexMovesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go new file mode 100644 index 00000000000..ccc5e6e210d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/index_moves_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexMovesParams creates a new IndexMovesParams object +// +// There are no default values defined in the spec. +func NewIndexMovesParams() IndexMovesParams { + + return IndexMovesParams{} +} + +// IndexMovesParams contains all the bound params for the index moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexMoves +type IndexMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexMovesParams() beforehand. +func (o *IndexMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexMovesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexMovesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexMovesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexMovesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexMovesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go new file mode 100644 index 00000000000..3199955fe75 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/index_moves_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexMovesOKCode is the HTTP code returned for type IndexMovesOK +const IndexMovesOKCode int = 200 + +/* +IndexMovesOK success + +swagger:response indexMovesOK +*/ +type IndexMovesOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.Moves `json:"body,omitempty"` +} + +// NewIndexMovesOK creates IndexMovesOK with default headers values +func NewIndexMovesOK() *IndexMovesOK { + + return &IndexMovesOK{} +} + +// WithContentRange adds the contentRange to the index moves o k response +func (o *IndexMovesOK) WithContentRange(contentRange string) *IndexMovesOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index moves o k response +func (o *IndexMovesOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index moves o k response +func (o *IndexMovesOK) WithPayload(payload adminmessages.Moves) *IndexMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index moves o k response +func (o *IndexMovesOK) SetPayload(payload adminmessages.Moves) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.Moves{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexMovesBadRequestCode is the HTTP code returned for type IndexMovesBadRequest +const IndexMovesBadRequestCode int = 400 + +/* +IndexMovesBadRequest invalid request + +swagger:response indexMovesBadRequest +*/ +type IndexMovesBadRequest struct { +} + +// NewIndexMovesBadRequest creates IndexMovesBadRequest with default headers values +func NewIndexMovesBadRequest() *IndexMovesBadRequest { + + return &IndexMovesBadRequest{} +} + +// WriteResponse to the client +func (o *IndexMovesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexMovesUnauthorizedCode is the HTTP code returned for type IndexMovesUnauthorized +const IndexMovesUnauthorizedCode int = 401 + +/* +IndexMovesUnauthorized request requires user authentication + +swagger:response indexMovesUnauthorized +*/ +type IndexMovesUnauthorized struct { +} + +// NewIndexMovesUnauthorized creates IndexMovesUnauthorized with default headers values +func NewIndexMovesUnauthorized() *IndexMovesUnauthorized { + + return &IndexMovesUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexMovesNotFoundCode is the HTTP code returned for type IndexMovesNotFound +const IndexMovesNotFoundCode int = 404 + +/* +IndexMovesNotFound Moves not found + +swagger:response indexMovesNotFound +*/ +type IndexMovesNotFound struct { +} + +// NewIndexMovesNotFound creates IndexMovesNotFound with default headers values +func NewIndexMovesNotFound() *IndexMovesNotFound { + + return &IndexMovesNotFound{} +} + +// WriteResponse to the client +func (o *IndexMovesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexMovesInternalServerErrorCode is the HTTP code returned for type IndexMovesInternalServerError +const IndexMovesInternalServerErrorCode int = 500 + +/* +IndexMovesInternalServerError server error + +swagger:response indexMovesInternalServerError +*/ +type IndexMovesInternalServerError struct { +} + +// NewIndexMovesInternalServerError creates IndexMovesInternalServerError with default headers values +func NewIndexMovesInternalServerError() *IndexMovesInternalServerError { + + return &IndexMovesInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go new file mode 100644 index 00000000000..f9bc47252b8 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/index_moves_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexMovesURL generates an URL for the index moves operation +type IndexMovesURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexMovesURL) WithBasePath(bp string) *IndexMovesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexMovesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexMovesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move.go b/pkg/gen/adminapi/adminoperations/moves/update_move.go new file mode 100644 index 00000000000..ef9da3e7970 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/update_move.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMoveHandlerFunc turns a function with the right signature into a update move handler +type UpdateMoveHandlerFunc func(UpdateMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMoveHandlerFunc) Handle(params UpdateMoveParams) middleware.Responder { + return fn(params) +} + +// UpdateMoveHandler interface for that can handle valid update move params +type UpdateMoveHandler interface { + Handle(UpdateMoveParams) middleware.Responder +} + +// NewUpdateMove creates a new http.Handler for the update move operation +func NewUpdateMove(ctx *middleware.Context, handler UpdateMoveHandler) *UpdateMove { + return &UpdateMove{Context: ctx, Handler: handler} +} + +/* + UpdateMove swagger:route PATCH /moves/{moveID} Moves updateMove + +# Toggle Move visibility + +This endpoint updates a single Move by ID. This allows the Admin User to change +the `show` field on the selected field to either `True` or `False`. A "shown" +Move will appear to all users as normal, a "hidden" Move will not be returned or +editable using any other endpoint (besides those in the Support API), and thus +effectively deactivated. Do not use this endpoint directly as it is meant to be +used with the Admin UI exclusively. +*/ +type UpdateMove struct { + Context *middleware.Context + Handler UpdateMoveHandler +} + +func (o *UpdateMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go b/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go new file mode 100644 index 00000000000..768d0b54ee3 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/update_move_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateMoveParams creates a new UpdateMoveParams object +// +// There are no default values defined in the spec. +func NewUpdateMoveParams() UpdateMoveParams { + + return UpdateMoveParams{} +} + +// UpdateMoveParams contains all the bound params for the update move operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMove +type UpdateMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Move information + Required: true + In: body + */ + Move *adminmessages.MoveUpdate + /* + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMoveParams() beforehand. +func (o *UpdateMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.MoveUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("move", "body", "")) + } else { + res = append(res, errors.NewParseError("move", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Move = &body + } + } + } else { + res = append(res, errors.Required("move", "body", "")) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *UpdateMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *UpdateMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go b/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go new file mode 100644 index 00000000000..c56ece6b1f5 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/update_move_responses.go @@ -0,0 +1,209 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateMoveOKCode is the HTTP code returned for type UpdateMoveOK +const UpdateMoveOKCode int = 200 + +/* +UpdateMoveOK Successfully updated the Move + +swagger:response updateMoveOK +*/ +type UpdateMoveOK struct { + + /* + In: Body + */ + Payload *adminmessages.Move `json:"body,omitempty"` +} + +// NewUpdateMoveOK creates UpdateMoveOK with default headers values +func NewUpdateMoveOK() *UpdateMoveOK { + + return &UpdateMoveOK{} +} + +// WithPayload adds the payload to the update move o k response +func (o *UpdateMoveOK) WithPayload(payload *adminmessages.Move) *UpdateMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move o k response +func (o *UpdateMoveOK) SetPayload(payload *adminmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveBadRequestCode is the HTTP code returned for type UpdateMoveBadRequest +const UpdateMoveBadRequestCode int = 400 + +/* +UpdateMoveBadRequest Invalid request + +swagger:response updateMoveBadRequest +*/ +type UpdateMoveBadRequest struct { +} + +// NewUpdateMoveBadRequest creates UpdateMoveBadRequest with default headers values +func NewUpdateMoveBadRequest() *UpdateMoveBadRequest { + + return &UpdateMoveBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateMoveUnauthorizedCode is the HTTP code returned for type UpdateMoveUnauthorized +const UpdateMoveUnauthorizedCode int = 401 + +/* +UpdateMoveUnauthorized Must be authenticated to use this endpoint + +swagger:response updateMoveUnauthorized +*/ +type UpdateMoveUnauthorized struct { +} + +// NewUpdateMoveUnauthorized creates UpdateMoveUnauthorized with default headers values +func NewUpdateMoveUnauthorized() *UpdateMoveUnauthorized { + + return &UpdateMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateMoveForbiddenCode is the HTTP code returned for type UpdateMoveForbidden +const UpdateMoveForbiddenCode int = 403 + +/* +UpdateMoveForbidden Not authorized to update this Move + +swagger:response updateMoveForbidden +*/ +type UpdateMoveForbidden struct { +} + +// NewUpdateMoveForbidden creates UpdateMoveForbidden with default headers values +func NewUpdateMoveForbidden() *UpdateMoveForbidden { + + return &UpdateMoveForbidden{} +} + +// WriteResponse to the client +func (o *UpdateMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateMoveNotFoundCode is the HTTP code returned for type UpdateMoveNotFound +const UpdateMoveNotFoundCode int = 404 + +/* +UpdateMoveNotFound Move not found + +swagger:response updateMoveNotFound +*/ +type UpdateMoveNotFound struct { +} + +// NewUpdateMoveNotFound creates UpdateMoveNotFound with default headers values +func NewUpdateMoveNotFound() *UpdateMoveNotFound { + + return &UpdateMoveNotFound{} +} + +// WriteResponse to the client +func (o *UpdateMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateMoveUnprocessableEntityCode is the HTTP code returned for type UpdateMoveUnprocessableEntity +const UpdateMoveUnprocessableEntityCode int = 422 + +/* +UpdateMoveUnprocessableEntity Invalid input + +swagger:response updateMoveUnprocessableEntity +*/ +type UpdateMoveUnprocessableEntity struct { +} + +// NewUpdateMoveUnprocessableEntity creates UpdateMoveUnprocessableEntity with default headers values +func NewUpdateMoveUnprocessableEntity() *UpdateMoveUnprocessableEntity { + + return &UpdateMoveUnprocessableEntity{} +} + +// WriteResponse to the client +func (o *UpdateMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(422) +} + +// UpdateMoveInternalServerErrorCode is the HTTP code returned for type UpdateMoveInternalServerError +const UpdateMoveInternalServerErrorCode int = 500 + +/* +UpdateMoveInternalServerError Server error + +swagger:response updateMoveInternalServerError +*/ +type UpdateMoveInternalServerError struct { +} + +// NewUpdateMoveInternalServerError creates UpdateMoveInternalServerError with default headers values +func NewUpdateMoveInternalServerError() *UpdateMoveInternalServerError { + + return &UpdateMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go b/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go new file mode 100644 index 00000000000..87f1ef71d15 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/moves/update_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMoveURL generates an URL for the update move operation +type UpdateMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveURL) WithBasePath(bp string) *UpdateMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on UpdateMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/mymove_api.go b/pkg/gen/adminapi/adminoperations/mymove_api.go new file mode 100644 index 00000000000..e2ed2892e29 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/mymove_api.go @@ -0,0 +1,741 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminoperations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/admin_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/client_certificates" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/electronic_orders" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/moves" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/notifications" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/office_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/organizations" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_file" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_files" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/requested_office_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/transportation_offices" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/uploads" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/user" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/webhook_subscriptions" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + AdminUsersCreateAdminUserHandler: admin_users.CreateAdminUserHandlerFunc(func(params admin_users.CreateAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.CreateAdminUser has not yet been implemented") + }), + ClientCertificatesCreateClientCertificateHandler: client_certificates.CreateClientCertificateHandlerFunc(func(params client_certificates.CreateClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.CreateClientCertificate has not yet been implemented") + }), + OfficeUsersCreateOfficeUserHandler: office_users.CreateOfficeUserHandlerFunc(func(params office_users.CreateOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.CreateOfficeUser has not yet been implemented") + }), + WebhookSubscriptionsCreateWebhookSubscriptionHandler: webhook_subscriptions.CreateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.CreateWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.CreateWebhookSubscription has not yet been implemented") + }), + AdminUsersGetAdminUserHandler: admin_users.GetAdminUserHandlerFunc(func(params admin_users.GetAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.GetAdminUser has not yet been implemented") + }), + ClientCertificatesGetClientCertificateHandler: client_certificates.GetClientCertificateHandlerFunc(func(params client_certificates.GetClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.GetClientCertificate has not yet been implemented") + }), + ElectronicOrdersGetElectronicOrdersTotalsHandler: electronic_orders.GetElectronicOrdersTotalsHandlerFunc(func(params electronic_orders.GetElectronicOrdersTotalsParams) middleware.Responder { + return middleware.NotImplemented("operation electronic_orders.GetElectronicOrdersTotals has not yet been implemented") + }), + UserGetLoggedInAdminUserHandler: user.GetLoggedInAdminUserHandlerFunc(func(params user.GetLoggedInAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation user.GetLoggedInAdminUser has not yet been implemented") + }), + MovesGetMoveHandler: moves.GetMoveHandlerFunc(func(params moves.GetMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetMove has not yet been implemented") + }), + TransportationOfficesGetOfficeByIDHandler: transportation_offices.GetOfficeByIDHandlerFunc(func(params transportation_offices.GetOfficeByIDParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.GetOfficeByID has not yet been implemented") + }), + OfficeUsersGetOfficeUserHandler: office_users.GetOfficeUserHandlerFunc(func(params office_users.GetOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.GetOfficeUser has not yet been implemented") + }), + RequestedOfficeUsersGetRequestedOfficeUserHandler: requested_office_users.GetRequestedOfficeUserHandlerFunc(func(params requested_office_users.GetRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.GetRequestedOfficeUser has not yet been implemented") + }), + UploadsGetUploadHandler: uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") + }), + UsersGetUserHandler: users.GetUserHandlerFunc(func(params users.GetUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.GetUser has not yet been implemented") + }), + WebhookSubscriptionsGetWebhookSubscriptionHandler: webhook_subscriptions.GetWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.GetWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.GetWebhookSubscription has not yet been implemented") + }), + AdminUsersIndexAdminUsersHandler: admin_users.IndexAdminUsersHandlerFunc(func(params admin_users.IndexAdminUsersParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.IndexAdminUsers has not yet been implemented") + }), + ClientCertificatesIndexClientCertificatesHandler: client_certificates.IndexClientCertificatesHandlerFunc(func(params client_certificates.IndexClientCertificatesParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.IndexClientCertificates has not yet been implemented") + }), + ElectronicOrdersIndexElectronicOrdersHandler: electronic_orders.IndexElectronicOrdersHandlerFunc(func(params electronic_orders.IndexElectronicOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation electronic_orders.IndexElectronicOrders has not yet been implemented") + }), + MovesIndexMovesHandler: moves.IndexMovesHandlerFunc(func(params moves.IndexMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.IndexMoves has not yet been implemented") + }), + NotificationsIndexNotificationsHandler: notifications.IndexNotificationsHandlerFunc(func(params notifications.IndexNotificationsParams) middleware.Responder { + return middleware.NotImplemented("operation notifications.IndexNotifications has not yet been implemented") + }), + OfficeUsersIndexOfficeUsersHandler: office_users.IndexOfficeUsersHandlerFunc(func(params office_users.IndexOfficeUsersParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.IndexOfficeUsers has not yet been implemented") + }), + TransportationOfficesIndexOfficesHandler: transportation_offices.IndexOfficesHandlerFunc(func(params transportation_offices.IndexOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.IndexOffices has not yet been implemented") + }), + OrganizationsIndexOrganizationsHandler: organizations.IndexOrganizationsHandlerFunc(func(params organizations.IndexOrganizationsParams) middleware.Responder { + return middleware.NotImplemented("operation organizations.IndexOrganizations has not yet been implemented") + }), + PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler: payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandlerFunc(func(params payment_request_syncada_files.IndexPaymentRequestSyncadaFilesParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request_syncada_files.IndexPaymentRequestSyncadaFiles has not yet been implemented") + }), + RequestedOfficeUsersIndexRequestedOfficeUsersHandler: requested_office_users.IndexRequestedOfficeUsersHandlerFunc(func(params requested_office_users.IndexRequestedOfficeUsersParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.IndexRequestedOfficeUsers has not yet been implemented") + }), + UsersIndexUsersHandler: users.IndexUsersHandlerFunc(func(params users.IndexUsersParams) middleware.Responder { + return middleware.NotImplemented("operation users.IndexUsers has not yet been implemented") + }), + WebhookSubscriptionsIndexWebhookSubscriptionsHandler: webhook_subscriptions.IndexWebhookSubscriptionsHandlerFunc(func(params webhook_subscriptions.IndexWebhookSubscriptionsParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.IndexWebhookSubscriptions has not yet been implemented") + }), + PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler: payment_request_syncada_file.PaymentRequestSyncadaFileHandlerFunc(func(params payment_request_syncada_file.PaymentRequestSyncadaFileParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request_syncada_file.PaymentRequestSyncadaFile has not yet been implemented") + }), + ClientCertificatesRemoveClientCertificateHandler: client_certificates.RemoveClientCertificateHandlerFunc(func(params client_certificates.RemoveClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.RemoveClientCertificate has not yet been implemented") + }), + AdminUsersUpdateAdminUserHandler: admin_users.UpdateAdminUserHandlerFunc(func(params admin_users.UpdateAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.UpdateAdminUser has not yet been implemented") + }), + ClientCertificatesUpdateClientCertificateHandler: client_certificates.UpdateClientCertificateHandlerFunc(func(params client_certificates.UpdateClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.UpdateClientCertificate has not yet been implemented") + }), + MovesUpdateMoveHandler: moves.UpdateMoveHandlerFunc(func(params moves.UpdateMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.UpdateMove has not yet been implemented") + }), + OfficeUsersUpdateOfficeUserHandler: office_users.UpdateOfficeUserHandlerFunc(func(params office_users.UpdateOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.UpdateOfficeUser has not yet been implemented") + }), + RequestedOfficeUsersUpdateRequestedOfficeUserHandler: requested_office_users.UpdateRequestedOfficeUserHandlerFunc(func(params requested_office_users.UpdateRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.UpdateRequestedOfficeUser has not yet been implemented") + }), + UsersUpdateUserHandler: users.UpdateUserHandlerFunc(func(params users.UpdateUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.UpdateUser has not yet been implemented") + }), + WebhookSubscriptionsUpdateWebhookSubscriptionHandler: webhook_subscriptions.UpdateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.UpdateWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.UpdateWebhookSubscription has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Admin API is a RESTful API that enables the Admin application for MilMove. + +All endpoints are located under `/admin/v1`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // AdminUsersCreateAdminUserHandler sets the operation handler for the create admin user operation + AdminUsersCreateAdminUserHandler admin_users.CreateAdminUserHandler + // ClientCertificatesCreateClientCertificateHandler sets the operation handler for the create client certificate operation + ClientCertificatesCreateClientCertificateHandler client_certificates.CreateClientCertificateHandler + // OfficeUsersCreateOfficeUserHandler sets the operation handler for the create office user operation + OfficeUsersCreateOfficeUserHandler office_users.CreateOfficeUserHandler + // WebhookSubscriptionsCreateWebhookSubscriptionHandler sets the operation handler for the create webhook subscription operation + WebhookSubscriptionsCreateWebhookSubscriptionHandler webhook_subscriptions.CreateWebhookSubscriptionHandler + // AdminUsersGetAdminUserHandler sets the operation handler for the get admin user operation + AdminUsersGetAdminUserHandler admin_users.GetAdminUserHandler + // ClientCertificatesGetClientCertificateHandler sets the operation handler for the get client certificate operation + ClientCertificatesGetClientCertificateHandler client_certificates.GetClientCertificateHandler + // ElectronicOrdersGetElectronicOrdersTotalsHandler sets the operation handler for the get electronic orders totals operation + ElectronicOrdersGetElectronicOrdersTotalsHandler electronic_orders.GetElectronicOrdersTotalsHandler + // UserGetLoggedInAdminUserHandler sets the operation handler for the get logged in admin user operation + UserGetLoggedInAdminUserHandler user.GetLoggedInAdminUserHandler + // MovesGetMoveHandler sets the operation handler for the get move operation + MovesGetMoveHandler moves.GetMoveHandler + // TransportationOfficesGetOfficeByIDHandler sets the operation handler for the get office by Id operation + TransportationOfficesGetOfficeByIDHandler transportation_offices.GetOfficeByIDHandler + // OfficeUsersGetOfficeUserHandler sets the operation handler for the get office user operation + OfficeUsersGetOfficeUserHandler office_users.GetOfficeUserHandler + // RequestedOfficeUsersGetRequestedOfficeUserHandler sets the operation handler for the get requested office user operation + RequestedOfficeUsersGetRequestedOfficeUserHandler requested_office_users.GetRequestedOfficeUserHandler + // UploadsGetUploadHandler sets the operation handler for the get upload operation + UploadsGetUploadHandler uploads.GetUploadHandler + // UsersGetUserHandler sets the operation handler for the get user operation + UsersGetUserHandler users.GetUserHandler + // WebhookSubscriptionsGetWebhookSubscriptionHandler sets the operation handler for the get webhook subscription operation + WebhookSubscriptionsGetWebhookSubscriptionHandler webhook_subscriptions.GetWebhookSubscriptionHandler + // AdminUsersIndexAdminUsersHandler sets the operation handler for the index admin users operation + AdminUsersIndexAdminUsersHandler admin_users.IndexAdminUsersHandler + // ClientCertificatesIndexClientCertificatesHandler sets the operation handler for the index client certificates operation + ClientCertificatesIndexClientCertificatesHandler client_certificates.IndexClientCertificatesHandler + // ElectronicOrdersIndexElectronicOrdersHandler sets the operation handler for the index electronic orders operation + ElectronicOrdersIndexElectronicOrdersHandler electronic_orders.IndexElectronicOrdersHandler + // MovesIndexMovesHandler sets the operation handler for the index moves operation + MovesIndexMovesHandler moves.IndexMovesHandler + // NotificationsIndexNotificationsHandler sets the operation handler for the index notifications operation + NotificationsIndexNotificationsHandler notifications.IndexNotificationsHandler + // OfficeUsersIndexOfficeUsersHandler sets the operation handler for the index office users operation + OfficeUsersIndexOfficeUsersHandler office_users.IndexOfficeUsersHandler + // TransportationOfficesIndexOfficesHandler sets the operation handler for the index offices operation + TransportationOfficesIndexOfficesHandler transportation_offices.IndexOfficesHandler + // OrganizationsIndexOrganizationsHandler sets the operation handler for the index organizations operation + OrganizationsIndexOrganizationsHandler organizations.IndexOrganizationsHandler + // PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler sets the operation handler for the index payment request syncada files operation + PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandler + // RequestedOfficeUsersIndexRequestedOfficeUsersHandler sets the operation handler for the index requested office users operation + RequestedOfficeUsersIndexRequestedOfficeUsersHandler requested_office_users.IndexRequestedOfficeUsersHandler + // UsersIndexUsersHandler sets the operation handler for the index users operation + UsersIndexUsersHandler users.IndexUsersHandler + // WebhookSubscriptionsIndexWebhookSubscriptionsHandler sets the operation handler for the index webhook subscriptions operation + WebhookSubscriptionsIndexWebhookSubscriptionsHandler webhook_subscriptions.IndexWebhookSubscriptionsHandler + // PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler sets the operation handler for the payment request syncada file operation + PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler payment_request_syncada_file.PaymentRequestSyncadaFileHandler + // ClientCertificatesRemoveClientCertificateHandler sets the operation handler for the remove client certificate operation + ClientCertificatesRemoveClientCertificateHandler client_certificates.RemoveClientCertificateHandler + // AdminUsersUpdateAdminUserHandler sets the operation handler for the update admin user operation + AdminUsersUpdateAdminUserHandler admin_users.UpdateAdminUserHandler + // ClientCertificatesUpdateClientCertificateHandler sets the operation handler for the update client certificate operation + ClientCertificatesUpdateClientCertificateHandler client_certificates.UpdateClientCertificateHandler + // MovesUpdateMoveHandler sets the operation handler for the update move operation + MovesUpdateMoveHandler moves.UpdateMoveHandler + // OfficeUsersUpdateOfficeUserHandler sets the operation handler for the update office user operation + OfficeUsersUpdateOfficeUserHandler office_users.UpdateOfficeUserHandler + // RequestedOfficeUsersUpdateRequestedOfficeUserHandler sets the operation handler for the update requested office user operation + RequestedOfficeUsersUpdateRequestedOfficeUserHandler requested_office_users.UpdateRequestedOfficeUserHandler + // UsersUpdateUserHandler sets the operation handler for the update user operation + UsersUpdateUserHandler users.UpdateUserHandler + // WebhookSubscriptionsUpdateWebhookSubscriptionHandler sets the operation handler for the update webhook subscription operation + WebhookSubscriptionsUpdateWebhookSubscriptionHandler webhook_subscriptions.UpdateWebhookSubscriptionHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.AdminUsersCreateAdminUserHandler == nil { + unregistered = append(unregistered, "admin_users.CreateAdminUserHandler") + } + if o.ClientCertificatesCreateClientCertificateHandler == nil { + unregistered = append(unregistered, "client_certificates.CreateClientCertificateHandler") + } + if o.OfficeUsersCreateOfficeUserHandler == nil { + unregistered = append(unregistered, "office_users.CreateOfficeUserHandler") + } + if o.WebhookSubscriptionsCreateWebhookSubscriptionHandler == nil { + unregistered = append(unregistered, "webhook_subscriptions.CreateWebhookSubscriptionHandler") + } + if o.AdminUsersGetAdminUserHandler == nil { + unregistered = append(unregistered, "admin_users.GetAdminUserHandler") + } + if o.ClientCertificatesGetClientCertificateHandler == nil { + unregistered = append(unregistered, "client_certificates.GetClientCertificateHandler") + } + if o.ElectronicOrdersGetElectronicOrdersTotalsHandler == nil { + unregistered = append(unregistered, "electronic_orders.GetElectronicOrdersTotalsHandler") + } + if o.UserGetLoggedInAdminUserHandler == nil { + unregistered = append(unregistered, "user.GetLoggedInAdminUserHandler") + } + if o.MovesGetMoveHandler == nil { + unregistered = append(unregistered, "moves.GetMoveHandler") + } + if o.TransportationOfficesGetOfficeByIDHandler == nil { + unregistered = append(unregistered, "transportation_offices.GetOfficeByIDHandler") + } + if o.OfficeUsersGetOfficeUserHandler == nil { + unregistered = append(unregistered, "office_users.GetOfficeUserHandler") + } + if o.RequestedOfficeUsersGetRequestedOfficeUserHandler == nil { + unregistered = append(unregistered, "requested_office_users.GetRequestedOfficeUserHandler") + } + if o.UploadsGetUploadHandler == nil { + unregistered = append(unregistered, "uploads.GetUploadHandler") + } + if o.UsersGetUserHandler == nil { + unregistered = append(unregistered, "users.GetUserHandler") + } + if o.WebhookSubscriptionsGetWebhookSubscriptionHandler == nil { + unregistered = append(unregistered, "webhook_subscriptions.GetWebhookSubscriptionHandler") + } + if o.AdminUsersIndexAdminUsersHandler == nil { + unregistered = append(unregistered, "admin_users.IndexAdminUsersHandler") + } + if o.ClientCertificatesIndexClientCertificatesHandler == nil { + unregistered = append(unregistered, "client_certificates.IndexClientCertificatesHandler") + } + if o.ElectronicOrdersIndexElectronicOrdersHandler == nil { + unregistered = append(unregistered, "electronic_orders.IndexElectronicOrdersHandler") + } + if o.MovesIndexMovesHandler == nil { + unregistered = append(unregistered, "moves.IndexMovesHandler") + } + if o.NotificationsIndexNotificationsHandler == nil { + unregistered = append(unregistered, "notifications.IndexNotificationsHandler") + } + if o.OfficeUsersIndexOfficeUsersHandler == nil { + unregistered = append(unregistered, "office_users.IndexOfficeUsersHandler") + } + if o.TransportationOfficesIndexOfficesHandler == nil { + unregistered = append(unregistered, "transportation_offices.IndexOfficesHandler") + } + if o.OrganizationsIndexOrganizationsHandler == nil { + unregistered = append(unregistered, "organizations.IndexOrganizationsHandler") + } + if o.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler == nil { + unregistered = append(unregistered, "payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandler") + } + if o.RequestedOfficeUsersIndexRequestedOfficeUsersHandler == nil { + unregistered = append(unregistered, "requested_office_users.IndexRequestedOfficeUsersHandler") + } + if o.UsersIndexUsersHandler == nil { + unregistered = append(unregistered, "users.IndexUsersHandler") + } + if o.WebhookSubscriptionsIndexWebhookSubscriptionsHandler == nil { + unregistered = append(unregistered, "webhook_subscriptions.IndexWebhookSubscriptionsHandler") + } + if o.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler == nil { + unregistered = append(unregistered, "payment_request_syncada_file.PaymentRequestSyncadaFileHandler") + } + if o.ClientCertificatesRemoveClientCertificateHandler == nil { + unregistered = append(unregistered, "client_certificates.RemoveClientCertificateHandler") + } + if o.AdminUsersUpdateAdminUserHandler == nil { + unregistered = append(unregistered, "admin_users.UpdateAdminUserHandler") + } + if o.ClientCertificatesUpdateClientCertificateHandler == nil { + unregistered = append(unregistered, "client_certificates.UpdateClientCertificateHandler") + } + if o.MovesUpdateMoveHandler == nil { + unregistered = append(unregistered, "moves.UpdateMoveHandler") + } + if o.OfficeUsersUpdateOfficeUserHandler == nil { + unregistered = append(unregistered, "office_users.UpdateOfficeUserHandler") + } + if o.RequestedOfficeUsersUpdateRequestedOfficeUserHandler == nil { + unregistered = append(unregistered, "requested_office_users.UpdateRequestedOfficeUserHandler") + } + if o.UsersUpdateUserHandler == nil { + unregistered = append(unregistered, "users.UpdateUserHandler") + } + if o.WebhookSubscriptionsUpdateWebhookSubscriptionHandler == nil { + unregistered = append(unregistered, "webhook_subscriptions.UpdateWebhookSubscriptionHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/admin-users"] = admin_users.NewCreateAdminUser(o.context, o.AdminUsersCreateAdminUserHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/client-certificates"] = client_certificates.NewCreateClientCertificate(o.context, o.ClientCertificatesCreateClientCertificateHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/office-users"] = office_users.NewCreateOfficeUser(o.context, o.OfficeUsersCreateOfficeUserHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/webhook-subscriptions"] = webhook_subscriptions.NewCreateWebhookSubscription(o.context, o.WebhookSubscriptionsCreateWebhookSubscriptionHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/admin-users/{adminUserId}"] = admin_users.NewGetAdminUser(o.context, o.AdminUsersGetAdminUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewGetClientCertificate(o.context, o.ClientCertificatesGetClientCertificateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/electronic-orders/totals"] = electronic_orders.NewGetElectronicOrdersTotals(o.context, o.ElectronicOrdersGetElectronicOrdersTotalsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/user"] = user.NewGetLoggedInAdminUser(o.context, o.UserGetLoggedInAdminUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveID}"] = moves.NewGetMove(o.context, o.MovesGetMoveHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/offices/{officeId}"] = transportation_offices.NewGetOfficeByID(o.context, o.TransportationOfficesGetOfficeByIDHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/office-users/{officeUserId}"] = office_users.NewGetOfficeUser(o.context, o.OfficeUsersGetOfficeUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/requested-office-users/{officeUserId}"] = requested_office_users.NewGetRequestedOfficeUser(o.context, o.RequestedOfficeUsersGetRequestedOfficeUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/uploads/{uploadId}"] = uploads.NewGetUpload(o.context, o.UploadsGetUploadHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/users/{userId}"] = users.NewGetUser(o.context, o.UsersGetUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/webhook-subscriptions/{webhookSubscriptionId}"] = webhook_subscriptions.NewGetWebhookSubscription(o.context, o.WebhookSubscriptionsGetWebhookSubscriptionHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/admin-users"] = admin_users.NewIndexAdminUsers(o.context, o.AdminUsersIndexAdminUsersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/client-certificates"] = client_certificates.NewIndexClientCertificates(o.context, o.ClientCertificatesIndexClientCertificatesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/electronic-orders"] = electronic_orders.NewIndexElectronicOrders(o.context, o.ElectronicOrdersIndexElectronicOrdersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves"] = moves.NewIndexMoves(o.context, o.MovesIndexMovesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/notifications"] = notifications.NewIndexNotifications(o.context, o.NotificationsIndexNotificationsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/office-users"] = office_users.NewIndexOfficeUsers(o.context, o.OfficeUsersIndexOfficeUsersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/offices"] = transportation_offices.NewIndexOffices(o.context, o.TransportationOfficesIndexOfficesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/organizations"] = organizations.NewIndexOrganizations(o.context, o.OrganizationsIndexOrganizationsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-request-syncada-files"] = payment_request_syncada_files.NewIndexPaymentRequestSyncadaFiles(o.context, o.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/requested-office-users"] = requested_office_users.NewIndexRequestedOfficeUsers(o.context, o.RequestedOfficeUsersIndexRequestedOfficeUsersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/users"] = users.NewIndexUsers(o.context, o.UsersIndexUsersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/webhook-subscriptions"] = webhook_subscriptions.NewIndexWebhookSubscriptions(o.context, o.WebhookSubscriptionsIndexWebhookSubscriptionsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-request-syncada-files/{paymentRequestSyncadaFileId}"] = payment_request_syncada_file.NewPaymentRequestSyncadaFile(o.context, o.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewRemoveClientCertificate(o.context, o.ClientCertificatesRemoveClientCertificateHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/admin-users/{adminUserId}"] = admin_users.NewUpdateAdminUser(o.context, o.AdminUsersUpdateAdminUserHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/client-certificates/{clientCertificateId}"] = client_certificates.NewUpdateClientCertificate(o.context, o.ClientCertificatesUpdateClientCertificateHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveID}"] = moves.NewUpdateMove(o.context, o.MovesUpdateMoveHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/office-users/{officeUserId}"] = office_users.NewUpdateOfficeUser(o.context, o.OfficeUsersUpdateOfficeUserHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/requested-office-users/{officeUserId}"] = requested_office_users.NewUpdateRequestedOfficeUser(o.context, o.RequestedOfficeUsersUpdateRequestedOfficeUserHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/users/{userId}"] = users.NewUpdateUser(o.context, o.UsersUpdateUserHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/webhook-subscriptions/{webhookSubscriptionId}"] = webhook_subscriptions.NewUpdateWebhookSubscription(o.context, o.WebhookSubscriptionsUpdateWebhookSubscriptionHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go new file mode 100644 index 00000000000..ed0d2c255f7 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/notifications/index_notifications.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package notifications + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexNotificationsHandlerFunc turns a function with the right signature into a index notifications handler +type IndexNotificationsHandlerFunc func(IndexNotificationsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexNotificationsHandlerFunc) Handle(params IndexNotificationsParams) middleware.Responder { + return fn(params) +} + +// IndexNotificationsHandler interface for that can handle valid index notifications params +type IndexNotificationsHandler interface { + Handle(IndexNotificationsParams) middleware.Responder +} + +// NewIndexNotifications creates a new http.Handler for the index notifications operation +func NewIndexNotifications(ctx *middleware.Context, handler IndexNotificationsHandler) *IndexNotifications { + return &IndexNotifications{Context: ctx, Handler: handler} +} + +/* + IndexNotifications swagger:route GET /notifications Notifications indexNotifications + +# List Notifications + +This endpoint returns a list of Notifications that have been sent to Service +Members. Do not use this endpoint directly as it is meant to be used with the +Admin UI exclusively. +*/ +type IndexNotifications struct { + Context *middleware.Context + Handler IndexNotificationsHandler +} + +func (o *IndexNotifications) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexNotificationsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go new file mode 100644 index 00000000000..073d74291be --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package notifications + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexNotificationsParams creates a new IndexNotificationsParams object +// +// There are no default values defined in the spec. +func NewIndexNotificationsParams() IndexNotificationsParams { + + return IndexNotificationsParams{} +} + +// IndexNotificationsParams contains all the bound params for the index notifications operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexNotifications +type IndexNotificationsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexNotificationsParams() beforehand. +func (o *IndexNotificationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexNotificationsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexNotificationsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexNotificationsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexNotificationsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexNotificationsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go new file mode 100644 index 00000000000..6c25b154c6f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package notifications + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexNotificationsOKCode is the HTTP code returned for type IndexNotificationsOK +const IndexNotificationsOKCode int = 200 + +/* +IndexNotificationsOK success + +swagger:response indexNotificationsOK +*/ +type IndexNotificationsOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.Notifications `json:"body,omitempty"` +} + +// NewIndexNotificationsOK creates IndexNotificationsOK with default headers values +func NewIndexNotificationsOK() *IndexNotificationsOK { + + return &IndexNotificationsOK{} +} + +// WithContentRange adds the contentRange to the index notifications o k response +func (o *IndexNotificationsOK) WithContentRange(contentRange string) *IndexNotificationsOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index notifications o k response +func (o *IndexNotificationsOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index notifications o k response +func (o *IndexNotificationsOK) WithPayload(payload adminmessages.Notifications) *IndexNotificationsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index notifications o k response +func (o *IndexNotificationsOK) SetPayload(payload adminmessages.Notifications) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexNotificationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.Notifications{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexNotificationsBadRequestCode is the HTTP code returned for type IndexNotificationsBadRequest +const IndexNotificationsBadRequestCode int = 400 + +/* +IndexNotificationsBadRequest invalid request + +swagger:response indexNotificationsBadRequest +*/ +type IndexNotificationsBadRequest struct { +} + +// NewIndexNotificationsBadRequest creates IndexNotificationsBadRequest with default headers values +func NewIndexNotificationsBadRequest() *IndexNotificationsBadRequest { + + return &IndexNotificationsBadRequest{} +} + +// WriteResponse to the client +func (o *IndexNotificationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexNotificationsUnauthorizedCode is the HTTP code returned for type IndexNotificationsUnauthorized +const IndexNotificationsUnauthorizedCode int = 401 + +/* +IndexNotificationsUnauthorized request requires user authentication + +swagger:response indexNotificationsUnauthorized +*/ +type IndexNotificationsUnauthorized struct { +} + +// NewIndexNotificationsUnauthorized creates IndexNotificationsUnauthorized with default headers values +func NewIndexNotificationsUnauthorized() *IndexNotificationsUnauthorized { + + return &IndexNotificationsUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexNotificationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexNotificationsNotFoundCode is the HTTP code returned for type IndexNotificationsNotFound +const IndexNotificationsNotFoundCode int = 404 + +/* +IndexNotificationsNotFound Notifications not found + +swagger:response indexNotificationsNotFound +*/ +type IndexNotificationsNotFound struct { +} + +// NewIndexNotificationsNotFound creates IndexNotificationsNotFound with default headers values +func NewIndexNotificationsNotFound() *IndexNotificationsNotFound { + + return &IndexNotificationsNotFound{} +} + +// WriteResponse to the client +func (o *IndexNotificationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexNotificationsInternalServerErrorCode is the HTTP code returned for type IndexNotificationsInternalServerError +const IndexNotificationsInternalServerErrorCode int = 500 + +/* +IndexNotificationsInternalServerError server error + +swagger:response indexNotificationsInternalServerError +*/ +type IndexNotificationsInternalServerError struct { +} + +// NewIndexNotificationsInternalServerError creates IndexNotificationsInternalServerError with default headers values +func NewIndexNotificationsInternalServerError() *IndexNotificationsInternalServerError { + + return &IndexNotificationsInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexNotificationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go new file mode 100644 index 00000000000..bf720a5a1a6 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/notifications/index_notifications_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package notifications + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexNotificationsURL generates an URL for the index notifications operation +type IndexNotificationsURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexNotificationsURL) WithBasePath(bp string) *IndexNotificationsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexNotificationsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexNotificationsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/notifications" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexNotificationsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexNotificationsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexNotificationsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexNotificationsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexNotificationsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexNotificationsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go new file mode 100644 index 00000000000..e897a55842d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/create_office_user.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateOfficeUserHandlerFunc turns a function with the right signature into a create office user handler +type CreateOfficeUserHandlerFunc func(CreateOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateOfficeUserHandlerFunc) Handle(params CreateOfficeUserParams) middleware.Responder { + return fn(params) +} + +// CreateOfficeUserHandler interface for that can handle valid create office user params +type CreateOfficeUserHandler interface { + Handle(CreateOfficeUserParams) middleware.Responder +} + +// NewCreateOfficeUser creates a new http.Handler for the create office user operation +func NewCreateOfficeUser(ctx *middleware.Context, handler CreateOfficeUserHandler) *CreateOfficeUser { + return &CreateOfficeUser{Context: ctx, Handler: handler} +} + +/* + CreateOfficeUser swagger:route POST /office-users Office users createOfficeUser + +# Create an Office User + +This endpoint creates an Office User record and returns the created record in +the `201` response. If there are issues with the Office User information +provided a `422` response will occur with information about invalid fields and +additional details. Do not use this endpoint directly as it is meant to be used +with the Admin UI exclusively. +*/ +type CreateOfficeUser struct { + Context *middleware.Context + Handler CreateOfficeUserHandler +} + +func (o *CreateOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go new file mode 100644 index 00000000000..d6185c068cd --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewCreateOfficeUserParams creates a new CreateOfficeUserParams object +// +// There are no default values defined in the spec. +func NewCreateOfficeUserParams() CreateOfficeUserParams { + + return CreateOfficeUserParams{} +} + +// CreateOfficeUserParams contains all the bound params for the create office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters createOfficeUser +type CreateOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Office User information + In: body + */ + OfficeUser *adminmessages.OfficeUserCreate +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateOfficeUserParams() beforehand. +func (o *CreateOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.OfficeUserCreate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("officeUser", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.OfficeUser = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go new file mode 100644 index 00000000000..8451a3cdc58 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// CreateOfficeUserCreatedCode is the HTTP code returned for type CreateOfficeUserCreated +const CreateOfficeUserCreatedCode int = 201 + +/* +CreateOfficeUserCreated Successfully created Office User + +swagger:response createOfficeUserCreated +*/ +type CreateOfficeUserCreated struct { + + /* + In: Body + */ + Payload *adminmessages.OfficeUser `json:"body,omitempty"` +} + +// NewCreateOfficeUserCreated creates CreateOfficeUserCreated with default headers values +func NewCreateOfficeUserCreated() *CreateOfficeUserCreated { + + return &CreateOfficeUserCreated{} +} + +// WithPayload adds the payload to the create office user created response +func (o *CreateOfficeUserCreated) WithPayload(payload *adminmessages.OfficeUser) *CreateOfficeUserCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create office user created response +func (o *CreateOfficeUserCreated) SetPayload(payload *adminmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateOfficeUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateOfficeUserUnprocessableEntityCode is the HTTP code returned for type CreateOfficeUserUnprocessableEntity +const CreateOfficeUserUnprocessableEntityCode int = 422 + +/* +CreateOfficeUserUnprocessableEntity validation error + +swagger:response createOfficeUserUnprocessableEntity +*/ +type CreateOfficeUserUnprocessableEntity struct { + + /* + In: Body + */ + Payload *adminmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateOfficeUserUnprocessableEntity creates CreateOfficeUserUnprocessableEntity with default headers values +func NewCreateOfficeUserUnprocessableEntity() *CreateOfficeUserUnprocessableEntity { + + return &CreateOfficeUserUnprocessableEntity{} +} + +// WithPayload adds the payload to the create office user unprocessable entity response +func (o *CreateOfficeUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *CreateOfficeUserUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create office user unprocessable entity response +func (o *CreateOfficeUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateOfficeUserInternalServerErrorCode is the HTTP code returned for type CreateOfficeUserInternalServerError +const CreateOfficeUserInternalServerErrorCode int = 500 + +/* +CreateOfficeUserInternalServerError internal server error + +swagger:response createOfficeUserInternalServerError +*/ +type CreateOfficeUserInternalServerError struct { +} + +// NewCreateOfficeUserInternalServerError creates CreateOfficeUserInternalServerError with default headers values +func NewCreateOfficeUserInternalServerError() *CreateOfficeUserInternalServerError { + + return &CreateOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go new file mode 100644 index 00000000000..33cfe5f1232 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/create_office_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateOfficeUserURL generates an URL for the create office user operation +type CreateOfficeUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOfficeUserURL) WithBasePath(bp string) *CreateOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/office-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go new file mode 100644 index 00000000000..9e17eaf2b8d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/get_office_user.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetOfficeUserHandlerFunc turns a function with the right signature into a get office user handler +type GetOfficeUserHandlerFunc func(GetOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetOfficeUserHandlerFunc) Handle(params GetOfficeUserParams) middleware.Responder { + return fn(params) +} + +// GetOfficeUserHandler interface for that can handle valid get office user params +type GetOfficeUserHandler interface { + Handle(GetOfficeUserParams) middleware.Responder +} + +// NewGetOfficeUser creates a new http.Handler for the get office user operation +func NewGetOfficeUser(ctx *middleware.Context, handler GetOfficeUserHandler) *GetOfficeUser { + return &GetOfficeUser{Context: ctx, Handler: handler} +} + +/* + GetOfficeUser swagger:route GET /office-users/{officeUserId} Office users getOfficeUser + +# Get an Office User + +This endpoint returns a single Office User by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type GetOfficeUser struct { + Context *middleware.Context + Handler GetOfficeUserHandler +} + +func (o *GetOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go new file mode 100644 index 00000000000..3d91ef00de0 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetOfficeUserParams creates a new GetOfficeUserParams object +// +// There are no default values defined in the spec. +func NewGetOfficeUserParams() GetOfficeUserParams { + + return GetOfficeUserParams{} +} + +// GetOfficeUserParams contains all the bound params for the get office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters getOfficeUser +type GetOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + OfficeUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetOfficeUserParams() beforehand. +func (o *GetOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") + if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeUserID binds and validates parameter OfficeUserID from path. +func (o *GetOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) + } + o.OfficeUserID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeUserID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeUserID carries on validations for parameter OfficeUserID +func (o *GetOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go new file mode 100644 index 00000000000..7d5cc7c6fdc --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetOfficeUserOKCode is the HTTP code returned for type GetOfficeUserOK +const GetOfficeUserOKCode int = 200 + +/* +GetOfficeUserOK success + +swagger:response getOfficeUserOK +*/ +type GetOfficeUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.OfficeUser `json:"body,omitempty"` +} + +// NewGetOfficeUserOK creates GetOfficeUserOK with default headers values +func NewGetOfficeUserOK() *GetOfficeUserOK { + + return &GetOfficeUserOK{} +} + +// WithPayload adds the payload to the get office user o k response +func (o *GetOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *GetOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get office user o k response +func (o *GetOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOfficeUserBadRequestCode is the HTTP code returned for type GetOfficeUserBadRequest +const GetOfficeUserBadRequestCode int = 400 + +/* +GetOfficeUserBadRequest invalid request + +swagger:response getOfficeUserBadRequest +*/ +type GetOfficeUserBadRequest struct { +} + +// NewGetOfficeUserBadRequest creates GetOfficeUserBadRequest with default headers values +func NewGetOfficeUserBadRequest() *GetOfficeUserBadRequest { + + return &GetOfficeUserBadRequest{} +} + +// WriteResponse to the client +func (o *GetOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetOfficeUserUnauthorizedCode is the HTTP code returned for type GetOfficeUserUnauthorized +const GetOfficeUserUnauthorizedCode int = 401 + +/* +GetOfficeUserUnauthorized request requires user authentication + +swagger:response getOfficeUserUnauthorized +*/ +type GetOfficeUserUnauthorized struct { +} + +// NewGetOfficeUserUnauthorized creates GetOfficeUserUnauthorized with default headers values +func NewGetOfficeUserUnauthorized() *GetOfficeUserUnauthorized { + + return &GetOfficeUserUnauthorized{} +} + +// WriteResponse to the client +func (o *GetOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetOfficeUserNotFoundCode is the HTTP code returned for type GetOfficeUserNotFound +const GetOfficeUserNotFoundCode int = 404 + +/* +GetOfficeUserNotFound Office User not found + +swagger:response getOfficeUserNotFound +*/ +type GetOfficeUserNotFound struct { +} + +// NewGetOfficeUserNotFound creates GetOfficeUserNotFound with default headers values +func NewGetOfficeUserNotFound() *GetOfficeUserNotFound { + + return &GetOfficeUserNotFound{} +} + +// WriteResponse to the client +func (o *GetOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetOfficeUserInternalServerErrorCode is the HTTP code returned for type GetOfficeUserInternalServerError +const GetOfficeUserInternalServerErrorCode int = 500 + +/* +GetOfficeUserInternalServerError server error + +swagger:response getOfficeUserInternalServerError +*/ +type GetOfficeUserInternalServerError struct { +} + +// NewGetOfficeUserInternalServerError creates GetOfficeUserInternalServerError with default headers values +func NewGetOfficeUserInternalServerError() *GetOfficeUserInternalServerError { + + return &GetOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *GetOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go new file mode 100644 index 00000000000..39f1a8ab469 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/get_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetOfficeUserURL generates an URL for the get office user operation +type GetOfficeUserURL struct { + OfficeUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOfficeUserURL) WithBasePath(bp string) *GetOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/office-users/{officeUserId}" + + officeUserID := o.OfficeUserID.String() + if officeUserID != "" { + _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) + } else { + return nil, errors.New("officeUserId is required on GetOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go new file mode 100644 index 00000000000..d0378388347 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/index_office_users.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexOfficeUsersHandlerFunc turns a function with the right signature into a index office users handler +type IndexOfficeUsersHandlerFunc func(IndexOfficeUsersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexOfficeUsersHandlerFunc) Handle(params IndexOfficeUsersParams) middleware.Responder { + return fn(params) +} + +// IndexOfficeUsersHandler interface for that can handle valid index office users params +type IndexOfficeUsersHandler interface { + Handle(IndexOfficeUsersParams) middleware.Responder +} + +// NewIndexOfficeUsers creates a new http.Handler for the index office users operation +func NewIndexOfficeUsers(ctx *middleware.Context, handler IndexOfficeUsersHandler) *IndexOfficeUsers { + return &IndexOfficeUsers{Context: ctx, Handler: handler} +} + +/* + IndexOfficeUsers swagger:route GET /office-users Office users indexOfficeUsers + +# List of Office Users + +This endpoint returns a list of Office Users. Do not use this endpoint directly +as it is meant to be used with the Admin UI exclusively. +*/ +type IndexOfficeUsers struct { + Context *middleware.Context + Handler IndexOfficeUsersHandler +} + +func (o *IndexOfficeUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexOfficeUsersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go new file mode 100644 index 00000000000..5d48f8cb168 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexOfficeUsersParams creates a new IndexOfficeUsersParams object +// +// There are no default values defined in the spec. +func NewIndexOfficeUsersParams() IndexOfficeUsersParams { + + return IndexOfficeUsersParams{} +} + +// IndexOfficeUsersParams contains all the bound params for the index office users operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexOfficeUsers +type IndexOfficeUsersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexOfficeUsersParams() beforehand. +func (o *IndexOfficeUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexOfficeUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexOfficeUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexOfficeUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexOfficeUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexOfficeUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go new file mode 100644 index 00000000000..98fc5882712 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexOfficeUsersOKCode is the HTTP code returned for type IndexOfficeUsersOK +const IndexOfficeUsersOKCode int = 200 + +/* +IndexOfficeUsersOK success + +swagger:response indexOfficeUsersOK +*/ +type IndexOfficeUsersOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.OfficeUsers `json:"body,omitempty"` +} + +// NewIndexOfficeUsersOK creates IndexOfficeUsersOK with default headers values +func NewIndexOfficeUsersOK() *IndexOfficeUsersOK { + + return &IndexOfficeUsersOK{} +} + +// WithContentRange adds the contentRange to the index office users o k response +func (o *IndexOfficeUsersOK) WithContentRange(contentRange string) *IndexOfficeUsersOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index office users o k response +func (o *IndexOfficeUsersOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index office users o k response +func (o *IndexOfficeUsersOK) WithPayload(payload adminmessages.OfficeUsers) *IndexOfficeUsersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index office users o k response +func (o *IndexOfficeUsersOK) SetPayload(payload adminmessages.OfficeUsers) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexOfficeUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.OfficeUsers{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexOfficeUsersBadRequestCode is the HTTP code returned for type IndexOfficeUsersBadRequest +const IndexOfficeUsersBadRequestCode int = 400 + +/* +IndexOfficeUsersBadRequest invalid request + +swagger:response indexOfficeUsersBadRequest +*/ +type IndexOfficeUsersBadRequest struct { +} + +// NewIndexOfficeUsersBadRequest creates IndexOfficeUsersBadRequest with default headers values +func NewIndexOfficeUsersBadRequest() *IndexOfficeUsersBadRequest { + + return &IndexOfficeUsersBadRequest{} +} + +// WriteResponse to the client +func (o *IndexOfficeUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexOfficeUsersUnauthorizedCode is the HTTP code returned for type IndexOfficeUsersUnauthorized +const IndexOfficeUsersUnauthorizedCode int = 401 + +/* +IndexOfficeUsersUnauthorized request requires user authentication + +swagger:response indexOfficeUsersUnauthorized +*/ +type IndexOfficeUsersUnauthorized struct { +} + +// NewIndexOfficeUsersUnauthorized creates IndexOfficeUsersUnauthorized with default headers values +func NewIndexOfficeUsersUnauthorized() *IndexOfficeUsersUnauthorized { + + return &IndexOfficeUsersUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexOfficeUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexOfficeUsersNotFoundCode is the HTTP code returned for type IndexOfficeUsersNotFound +const IndexOfficeUsersNotFoundCode int = 404 + +/* +IndexOfficeUsersNotFound Office User not found + +swagger:response indexOfficeUsersNotFound +*/ +type IndexOfficeUsersNotFound struct { +} + +// NewIndexOfficeUsersNotFound creates IndexOfficeUsersNotFound with default headers values +func NewIndexOfficeUsersNotFound() *IndexOfficeUsersNotFound { + + return &IndexOfficeUsersNotFound{} +} + +// WriteResponse to the client +func (o *IndexOfficeUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexOfficeUsersInternalServerErrorCode is the HTTP code returned for type IndexOfficeUsersInternalServerError +const IndexOfficeUsersInternalServerErrorCode int = 500 + +/* +IndexOfficeUsersInternalServerError server error + +swagger:response indexOfficeUsersInternalServerError +*/ +type IndexOfficeUsersInternalServerError struct { +} + +// NewIndexOfficeUsersInternalServerError creates IndexOfficeUsersInternalServerError with default headers values +func NewIndexOfficeUsersInternalServerError() *IndexOfficeUsersInternalServerError { + + return &IndexOfficeUsersInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexOfficeUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go new file mode 100644 index 00000000000..c9c775c48ed --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/index_office_users_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexOfficeUsersURL generates an URL for the index office users operation +type IndexOfficeUsersURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOfficeUsersURL) WithBasePath(bp string) *IndexOfficeUsersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOfficeUsersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexOfficeUsersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/office-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexOfficeUsersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexOfficeUsersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexOfficeUsersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexOfficeUsersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexOfficeUsersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexOfficeUsersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go new file mode 100644 index 00000000000..0849e68da77 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/update_office_user.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateOfficeUserHandlerFunc turns a function with the right signature into a update office user handler +type UpdateOfficeUserHandlerFunc func(UpdateOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateOfficeUserHandlerFunc) Handle(params UpdateOfficeUserParams) middleware.Responder { + return fn(params) +} + +// UpdateOfficeUserHandler interface for that can handle valid update office user params +type UpdateOfficeUserHandler interface { + Handle(UpdateOfficeUserParams) middleware.Responder +} + +// NewUpdateOfficeUser creates a new http.Handler for the update office user operation +func NewUpdateOfficeUser(ctx *middleware.Context, handler UpdateOfficeUserHandler) *UpdateOfficeUser { + return &UpdateOfficeUser{Context: ctx, Handler: handler} +} + +/* + UpdateOfficeUser swagger:route PATCH /office-users/{officeUserId} Office users updateOfficeUser + +# Updates an Office User + +This endpoint updates a single Office User by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type UpdateOfficeUser struct { + Context *middleware.Context + Handler UpdateOfficeUserHandler +} + +func (o *UpdateOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go new file mode 100644 index 00000000000..414f49cf99b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateOfficeUserParams creates a new UpdateOfficeUserParams object +// +// There are no default values defined in the spec. +func NewUpdateOfficeUserParams() UpdateOfficeUserParams { + + return UpdateOfficeUserParams{} +} + +// UpdateOfficeUserParams contains all the bound params for the update office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateOfficeUser +type UpdateOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Office User information + Required: true + In: body + */ + OfficeUser *adminmessages.OfficeUserUpdate + /* + Required: true + In: path + */ + OfficeUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateOfficeUserParams() beforehand. +func (o *UpdateOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.OfficeUserUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("officeUser", "body", "")) + } else { + res = append(res, errors.NewParseError("officeUser", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.OfficeUser = &body + } + } + } else { + res = append(res, errors.Required("officeUser", "body", "")) + } + + rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") + if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeUserID binds and validates parameter OfficeUserID from path. +func (o *UpdateOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) + } + o.OfficeUserID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeUserID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeUserID carries on validations for parameter OfficeUserID +func (o *UpdateOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go new file mode 100644 index 00000000000..bce64ffde3a --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateOfficeUserOKCode is the HTTP code returned for type UpdateOfficeUserOK +const UpdateOfficeUserOKCode int = 200 + +/* +UpdateOfficeUserOK Successfully updated Office User + +swagger:response updateOfficeUserOK +*/ +type UpdateOfficeUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.OfficeUser `json:"body,omitempty"` +} + +// NewUpdateOfficeUserOK creates UpdateOfficeUserOK with default headers values +func NewUpdateOfficeUserOK() *UpdateOfficeUserOK { + + return &UpdateOfficeUserOK{} +} + +// WithPayload adds the payload to the update office user o k response +func (o *UpdateOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *UpdateOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update office user o k response +func (o *UpdateOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOfficeUserBadRequestCode is the HTTP code returned for type UpdateOfficeUserBadRequest +const UpdateOfficeUserBadRequestCode int = 400 + +/* +UpdateOfficeUserBadRequest Invalid Request + +swagger:response updateOfficeUserBadRequest +*/ +type UpdateOfficeUserBadRequest struct { +} + +// NewUpdateOfficeUserBadRequest creates UpdateOfficeUserBadRequest with default headers values +func NewUpdateOfficeUserBadRequest() *UpdateOfficeUserBadRequest { + + return &UpdateOfficeUserBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateOfficeUserUnauthorizedCode is the HTTP code returned for type UpdateOfficeUserUnauthorized +const UpdateOfficeUserUnauthorizedCode int = 401 + +/* +UpdateOfficeUserUnauthorized Must be authenticated to use this end point + +swagger:response updateOfficeUserUnauthorized +*/ +type UpdateOfficeUserUnauthorized struct { +} + +// NewUpdateOfficeUserUnauthorized creates UpdateOfficeUserUnauthorized with default headers values +func NewUpdateOfficeUserUnauthorized() *UpdateOfficeUserUnauthorized { + + return &UpdateOfficeUserUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateOfficeUserForbiddenCode is the HTTP code returned for type UpdateOfficeUserForbidden +const UpdateOfficeUserForbiddenCode int = 403 + +/* +UpdateOfficeUserForbidden Not authorized to update an Office User + +swagger:response updateOfficeUserForbidden +*/ +type UpdateOfficeUserForbidden struct { +} + +// NewUpdateOfficeUserForbidden creates UpdateOfficeUserForbidden with default headers values +func NewUpdateOfficeUserForbidden() *UpdateOfficeUserForbidden { + + return &UpdateOfficeUserForbidden{} +} + +// WriteResponse to the client +func (o *UpdateOfficeUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateOfficeUserInternalServerError +const UpdateOfficeUserInternalServerErrorCode int = 500 + +/* +UpdateOfficeUserInternalServerError Server error + +swagger:response updateOfficeUserInternalServerError +*/ +type UpdateOfficeUserInternalServerError struct { +} + +// NewUpdateOfficeUserInternalServerError creates UpdateOfficeUserInternalServerError with default headers values +func NewUpdateOfficeUserInternalServerError() *UpdateOfficeUserInternalServerError { + + return &UpdateOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go new file mode 100644 index 00000000000..a65a776374c --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/office_users/update_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateOfficeUserURL generates an URL for the update office user operation +type UpdateOfficeUserURL struct { + OfficeUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOfficeUserURL) WithBasePath(bp string) *UpdateOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/office-users/{officeUserId}" + + officeUserID := o.OfficeUserID.String() + if officeUserID != "" { + _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) + } else { + return nil, errors.New("officeUserId is required on UpdateOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go new file mode 100644 index 00000000000..e3388257734 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/organizations/index_organizations.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexOrganizationsHandlerFunc turns a function with the right signature into a index organizations handler +type IndexOrganizationsHandlerFunc func(IndexOrganizationsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexOrganizationsHandlerFunc) Handle(params IndexOrganizationsParams) middleware.Responder { + return fn(params) +} + +// IndexOrganizationsHandler interface for that can handle valid index organizations params +type IndexOrganizationsHandler interface { + Handle(IndexOrganizationsParams) middleware.Responder +} + +// NewIndexOrganizations creates a new http.Handler for the index organizations operation +func NewIndexOrganizations(ctx *middleware.Context, handler IndexOrganizationsHandler) *IndexOrganizations { + return &IndexOrganizations{Context: ctx, Handler: handler} +} + +/* + IndexOrganizations swagger:route GET /organizations Organizations indexOrganizations + +# List Organizations + +This endpoint returns a list of Organizations. Do not use this endpoint directly +as it is meant to be used with the Admin UI exclusively. +*/ +type IndexOrganizations struct { + Context *middleware.Context + Handler IndexOrganizationsHandler +} + +func (o *IndexOrganizations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexOrganizationsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go new file mode 100644 index 00000000000..13163956c76 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_parameters.go @@ -0,0 +1,210 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexOrganizationsParams creates a new IndexOrganizationsParams object +// +// There are no default values defined in the spec. +func NewIndexOrganizationsParams() IndexOrganizationsParams { + + return IndexOrganizationsParams{} +} + +// IndexOrganizationsParams contains all the bound params for the index organizations operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexOrganizations +type IndexOrganizationsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter []string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexOrganizationsParams() beforehand. +func (o *IndexOrganizationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates array parameter Filter from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *IndexOrganizationsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvFilter string + if len(rawData) > 0 { + qvFilter = rawData[len(rawData)-1] + } + + // CollectionFormat: + filterIC := swag.SplitByFormat(qvFilter, "") + if len(filterIC) == 0 { + return nil + } + + var filterIR []string + for _, filterIV := range filterIC { + filterI := filterIV + + filterIR = append(filterIR, filterI) + } + + o.Filter = filterIR + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexOrganizationsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexOrganizationsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexOrganizationsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexOrganizationsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go new file mode 100644 index 00000000000..304283f2b85 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexOrganizationsOKCode is the HTTP code returned for type IndexOrganizationsOK +const IndexOrganizationsOKCode int = 200 + +/* +IndexOrganizationsOK success + +swagger:response indexOrganizationsOK +*/ +type IndexOrganizationsOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.Organizations `json:"body,omitempty"` +} + +// NewIndexOrganizationsOK creates IndexOrganizationsOK with default headers values +func NewIndexOrganizationsOK() *IndexOrganizationsOK { + + return &IndexOrganizationsOK{} +} + +// WithContentRange adds the contentRange to the index organizations o k response +func (o *IndexOrganizationsOK) WithContentRange(contentRange string) *IndexOrganizationsOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index organizations o k response +func (o *IndexOrganizationsOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index organizations o k response +func (o *IndexOrganizationsOK) WithPayload(payload adminmessages.Organizations) *IndexOrganizationsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index organizations o k response +func (o *IndexOrganizationsOK) SetPayload(payload adminmessages.Organizations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexOrganizationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.Organizations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexOrganizationsBadRequestCode is the HTTP code returned for type IndexOrganizationsBadRequest +const IndexOrganizationsBadRequestCode int = 400 + +/* +IndexOrganizationsBadRequest invalid request + +swagger:response indexOrganizationsBadRequest +*/ +type IndexOrganizationsBadRequest struct { +} + +// NewIndexOrganizationsBadRequest creates IndexOrganizationsBadRequest with default headers values +func NewIndexOrganizationsBadRequest() *IndexOrganizationsBadRequest { + + return &IndexOrganizationsBadRequest{} +} + +// WriteResponse to the client +func (o *IndexOrganizationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexOrganizationsUnauthorizedCode is the HTTP code returned for type IndexOrganizationsUnauthorized +const IndexOrganizationsUnauthorizedCode int = 401 + +/* +IndexOrganizationsUnauthorized request requires user authentication + +swagger:response indexOrganizationsUnauthorized +*/ +type IndexOrganizationsUnauthorized struct { +} + +// NewIndexOrganizationsUnauthorized creates IndexOrganizationsUnauthorized with default headers values +func NewIndexOrganizationsUnauthorized() *IndexOrganizationsUnauthorized { + + return &IndexOrganizationsUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexOrganizationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexOrganizationsNotFoundCode is the HTTP code returned for type IndexOrganizationsNotFound +const IndexOrganizationsNotFoundCode int = 404 + +/* +IndexOrganizationsNotFound Organizations not found + +swagger:response indexOrganizationsNotFound +*/ +type IndexOrganizationsNotFound struct { +} + +// NewIndexOrganizationsNotFound creates IndexOrganizationsNotFound with default headers values +func NewIndexOrganizationsNotFound() *IndexOrganizationsNotFound { + + return &IndexOrganizationsNotFound{} +} + +// WriteResponse to the client +func (o *IndexOrganizationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexOrganizationsInternalServerErrorCode is the HTTP code returned for type IndexOrganizationsInternalServerError +const IndexOrganizationsInternalServerErrorCode int = 500 + +/* +IndexOrganizationsInternalServerError server error + +swagger:response indexOrganizationsInternalServerError +*/ +type IndexOrganizationsInternalServerError struct { +} + +// NewIndexOrganizationsInternalServerError creates IndexOrganizationsInternalServerError with default headers values +func NewIndexOrganizationsInternalServerError() *IndexOrganizationsInternalServerError { + + return &IndexOrganizationsInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexOrganizationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go new file mode 100644 index 00000000000..f55707d97ec --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/organizations/index_organizations_urlbuilder.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package organizations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexOrganizationsURL generates an URL for the index organizations operation +type IndexOrganizationsURL struct { + Filter []string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOrganizationsURL) WithBasePath(bp string) *IndexOrganizationsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOrganizationsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexOrganizationsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/organizations" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterIR []string + for _, filterI := range o.Filter { + filterIS := filterI + if filterIS != "" { + filterIR = append(filterIR, filterIS) + } + } + + filter := swag.JoinByFormat(filterIR, "") + + if len(filter) > 0 { + qsv := filter[0] + if qsv != "" { + qs.Set("filter", qsv) + } + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexOrganizationsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexOrganizationsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexOrganizationsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexOrganizationsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexOrganizationsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexOrganizationsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go new file mode 100644 index 00000000000..0fd69641d61 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_file + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PaymentRequestSyncadaFileHandlerFunc turns a function with the right signature into a payment request syncada file handler +type PaymentRequestSyncadaFileHandlerFunc func(PaymentRequestSyncadaFileParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PaymentRequestSyncadaFileHandlerFunc) Handle(params PaymentRequestSyncadaFileParams) middleware.Responder { + return fn(params) +} + +// PaymentRequestSyncadaFileHandler interface for that can handle valid payment request syncada file params +type PaymentRequestSyncadaFileHandler interface { + Handle(PaymentRequestSyncadaFileParams) middleware.Responder +} + +// NewPaymentRequestSyncadaFile creates a new http.Handler for the payment request syncada file operation +func NewPaymentRequestSyncadaFile(ctx *middleware.Context, handler PaymentRequestSyncadaFileHandler) *PaymentRequestSyncadaFile { + return &PaymentRequestSyncadaFile{Context: ctx, Handler: handler} +} + +/* + PaymentRequestSyncadaFile swagger:route GET /payment-request-syncada-files/{paymentRequestSyncadaFileId} Payment Request Syncada File paymentRequestSyncadaFile + +# Payment Request EDI File + +Returns a Payment Request EDI858 file +*/ +type PaymentRequestSyncadaFile struct { + Context *middleware.Context + Handler PaymentRequestSyncadaFileHandler +} + +func (o *PaymentRequestSyncadaFile) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewPaymentRequestSyncadaFileParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go new file mode 100644 index 00000000000..4fddbb8299b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_parameters.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_file + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewPaymentRequestSyncadaFileParams creates a new PaymentRequestSyncadaFileParams object +// +// There are no default values defined in the spec. +func NewPaymentRequestSyncadaFileParams() PaymentRequestSyncadaFileParams { + + return PaymentRequestSyncadaFileParams{} +} + +// PaymentRequestSyncadaFileParams contains all the bound params for the payment request syncada file operation +// typically these are obtained from a http.Request +// +// swagger:parameters paymentRequestSyncadaFile +type PaymentRequestSyncadaFileParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + Required: true + In: path + */ + PaymentRequestSyncadaFileID strfmt.UUID + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPaymentRequestSyncadaFileParams() beforehand. +func (o *PaymentRequestSyncadaFileParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + rPaymentRequestSyncadaFileID, rhkPaymentRequestSyncadaFileID, _ := route.Params.GetOK("paymentRequestSyncadaFileId") + if err := o.bindPaymentRequestSyncadaFileID(rPaymentRequestSyncadaFileID, rhkPaymentRequestSyncadaFileID, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *PaymentRequestSyncadaFileParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *PaymentRequestSyncadaFileParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *PaymentRequestSyncadaFileParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPaymentRequestSyncadaFileID binds and validates parameter PaymentRequestSyncadaFileID from path. +func (o *PaymentRequestSyncadaFileParams) bindPaymentRequestSyncadaFileID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestSyncadaFileId", "path", "strfmt.UUID", raw) + } + o.PaymentRequestSyncadaFileID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestSyncadaFileID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestSyncadaFileID carries on validations for parameter PaymentRequestSyncadaFileID +func (o *PaymentRequestSyncadaFileParams) validatePaymentRequestSyncadaFileID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestSyncadaFileId", "path", "uuid", o.PaymentRequestSyncadaFileID.String(), formats); err != nil { + return err + } + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *PaymentRequestSyncadaFileParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *PaymentRequestSyncadaFileParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go new file mode 100644 index 00000000000..768d9302f7c --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_responses.go @@ -0,0 +1,181 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_file + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// PaymentRequestSyncadaFileOKCode is the HTTP code returned for type PaymentRequestSyncadaFileOK +const PaymentRequestSyncadaFileOKCode int = 200 + +/* +PaymentRequestSyncadaFileOK success + +swagger:response paymentRequestSyncadaFileOK +*/ +type PaymentRequestSyncadaFileOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload *adminmessages.PaymentRequestSyncadaFile `json:"body,omitempty"` +} + +// NewPaymentRequestSyncadaFileOK creates PaymentRequestSyncadaFileOK with default headers values +func NewPaymentRequestSyncadaFileOK() *PaymentRequestSyncadaFileOK { + + return &PaymentRequestSyncadaFileOK{} +} + +// WithContentRange adds the contentRange to the payment request syncada file o k response +func (o *PaymentRequestSyncadaFileOK) WithContentRange(contentRange string) *PaymentRequestSyncadaFileOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the payment request syncada file o k response +func (o *PaymentRequestSyncadaFileOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the payment request syncada file o k response +func (o *PaymentRequestSyncadaFileOK) WithPayload(payload *adminmessages.PaymentRequestSyncadaFile) *PaymentRequestSyncadaFileOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the payment request syncada file o k response +func (o *PaymentRequestSyncadaFileOK) SetPayload(payload *adminmessages.PaymentRequestSyncadaFile) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *PaymentRequestSyncadaFileOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// PaymentRequestSyncadaFileBadRequestCode is the HTTP code returned for type PaymentRequestSyncadaFileBadRequest +const PaymentRequestSyncadaFileBadRequestCode int = 400 + +/* +PaymentRequestSyncadaFileBadRequest invalid request + +swagger:response paymentRequestSyncadaFileBadRequest +*/ +type PaymentRequestSyncadaFileBadRequest struct { +} + +// NewPaymentRequestSyncadaFileBadRequest creates PaymentRequestSyncadaFileBadRequest with default headers values +func NewPaymentRequestSyncadaFileBadRequest() *PaymentRequestSyncadaFileBadRequest { + + return &PaymentRequestSyncadaFileBadRequest{} +} + +// WriteResponse to the client +func (o *PaymentRequestSyncadaFileBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PaymentRequestSyncadaFileUnauthorizedCode is the HTTP code returned for type PaymentRequestSyncadaFileUnauthorized +const PaymentRequestSyncadaFileUnauthorizedCode int = 401 + +/* +PaymentRequestSyncadaFileUnauthorized request requires user authentication + +swagger:response paymentRequestSyncadaFileUnauthorized +*/ +type PaymentRequestSyncadaFileUnauthorized struct { +} + +// NewPaymentRequestSyncadaFileUnauthorized creates PaymentRequestSyncadaFileUnauthorized with default headers values +func NewPaymentRequestSyncadaFileUnauthorized() *PaymentRequestSyncadaFileUnauthorized { + + return &PaymentRequestSyncadaFileUnauthorized{} +} + +// WriteResponse to the client +func (o *PaymentRequestSyncadaFileUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// PaymentRequestSyncadaFileNotFoundCode is the HTTP code returned for type PaymentRequestSyncadaFileNotFound +const PaymentRequestSyncadaFileNotFoundCode int = 404 + +/* +PaymentRequestSyncadaFileNotFound Payment Request EDI Files not found + +swagger:response paymentRequestSyncadaFileNotFound +*/ +type PaymentRequestSyncadaFileNotFound struct { +} + +// NewPaymentRequestSyncadaFileNotFound creates PaymentRequestSyncadaFileNotFound with default headers values +func NewPaymentRequestSyncadaFileNotFound() *PaymentRequestSyncadaFileNotFound { + + return &PaymentRequestSyncadaFileNotFound{} +} + +// WriteResponse to the client +func (o *PaymentRequestSyncadaFileNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// PaymentRequestSyncadaFileInternalServerErrorCode is the HTTP code returned for type PaymentRequestSyncadaFileInternalServerError +const PaymentRequestSyncadaFileInternalServerErrorCode int = 500 + +/* +PaymentRequestSyncadaFileInternalServerError server error + +swagger:response paymentRequestSyncadaFileInternalServerError +*/ +type PaymentRequestSyncadaFileInternalServerError struct { +} + +// NewPaymentRequestSyncadaFileInternalServerError creates PaymentRequestSyncadaFileInternalServerError with default headers values +func NewPaymentRequestSyncadaFileInternalServerError() *PaymentRequestSyncadaFileInternalServerError { + + return &PaymentRequestSyncadaFileInternalServerError{} +} + +// WriteResponse to the client +func (o *PaymentRequestSyncadaFileInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go new file mode 100644 index 00000000000..ac95f4dcaf0 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_file/payment_request_syncada_file_urlbuilder.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_file + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequestSyncadaFileURL generates an URL for the payment request syncada file operation +type PaymentRequestSyncadaFileURL struct { + PaymentRequestSyncadaFileID strfmt.UUID + + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PaymentRequestSyncadaFileURL) WithBasePath(bp string) *PaymentRequestSyncadaFileURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PaymentRequestSyncadaFileURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PaymentRequestSyncadaFileURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-request-syncada-files/{paymentRequestSyncadaFileId}" + + paymentRequestSyncadaFileID := o.PaymentRequestSyncadaFileID.String() + if paymentRequestSyncadaFileID != "" { + _path = strings.Replace(_path, "{paymentRequestSyncadaFileId}", paymentRequestSyncadaFileID, -1) + } else { + return nil, errors.New("paymentRequestSyncadaFileId is required on PaymentRequestSyncadaFileURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PaymentRequestSyncadaFileURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PaymentRequestSyncadaFileURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PaymentRequestSyncadaFileURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PaymentRequestSyncadaFileURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PaymentRequestSyncadaFileURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PaymentRequestSyncadaFileURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go new file mode 100644 index 00000000000..6f1a093c000 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_files + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexPaymentRequestSyncadaFilesHandlerFunc turns a function with the right signature into a index payment request syncada files handler +type IndexPaymentRequestSyncadaFilesHandlerFunc func(IndexPaymentRequestSyncadaFilesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexPaymentRequestSyncadaFilesHandlerFunc) Handle(params IndexPaymentRequestSyncadaFilesParams) middleware.Responder { + return fn(params) +} + +// IndexPaymentRequestSyncadaFilesHandler interface for that can handle valid index payment request syncada files params +type IndexPaymentRequestSyncadaFilesHandler interface { + Handle(IndexPaymentRequestSyncadaFilesParams) middleware.Responder +} + +// NewIndexPaymentRequestSyncadaFiles creates a new http.Handler for the index payment request syncada files operation +func NewIndexPaymentRequestSyncadaFiles(ctx *middleware.Context, handler IndexPaymentRequestSyncadaFilesHandler) *IndexPaymentRequestSyncadaFiles { + return &IndexPaymentRequestSyncadaFiles{Context: ctx, Handler: handler} +} + +/* + IndexPaymentRequestSyncadaFiles swagger:route GET /payment-request-syncada-files Payment Request Syncada Files indexPaymentRequestSyncadaFiles + +# List Payment Request EDI Files + +Returns a list of Payment Request EDI files +*/ +type IndexPaymentRequestSyncadaFiles struct { + Context *middleware.Context + Handler IndexPaymentRequestSyncadaFilesHandler +} + +func (o *IndexPaymentRequestSyncadaFiles) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexPaymentRequestSyncadaFilesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go new file mode 100644 index 00000000000..9863485c460 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_files + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexPaymentRequestSyncadaFilesParams creates a new IndexPaymentRequestSyncadaFilesParams object +// +// There are no default values defined in the spec. +func NewIndexPaymentRequestSyncadaFilesParams() IndexPaymentRequestSyncadaFilesParams { + + return IndexPaymentRequestSyncadaFilesParams{} +} + +// IndexPaymentRequestSyncadaFilesParams contains all the bound params for the index payment request syncada files operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexPaymentRequestSyncadaFiles +type IndexPaymentRequestSyncadaFilesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexPaymentRequestSyncadaFilesParams() beforehand. +func (o *IndexPaymentRequestSyncadaFilesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexPaymentRequestSyncadaFilesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexPaymentRequestSyncadaFilesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexPaymentRequestSyncadaFilesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexPaymentRequestSyncadaFilesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexPaymentRequestSyncadaFilesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go new file mode 100644 index 00000000000..a5b535302c4 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_files + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexPaymentRequestSyncadaFilesOKCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesOK +const IndexPaymentRequestSyncadaFilesOKCode int = 200 + +/* +IndexPaymentRequestSyncadaFilesOK success + +swagger:response indexPaymentRequestSyncadaFilesOK +*/ +type IndexPaymentRequestSyncadaFilesOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.PaymentRequestSyncadaFiles `json:"body,omitempty"` +} + +// NewIndexPaymentRequestSyncadaFilesOK creates IndexPaymentRequestSyncadaFilesOK with default headers values +func NewIndexPaymentRequestSyncadaFilesOK() *IndexPaymentRequestSyncadaFilesOK { + + return &IndexPaymentRequestSyncadaFilesOK{} +} + +// WithContentRange adds the contentRange to the index payment request syncada files o k response +func (o *IndexPaymentRequestSyncadaFilesOK) WithContentRange(contentRange string) *IndexPaymentRequestSyncadaFilesOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index payment request syncada files o k response +func (o *IndexPaymentRequestSyncadaFilesOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index payment request syncada files o k response +func (o *IndexPaymentRequestSyncadaFilesOK) WithPayload(payload adminmessages.PaymentRequestSyncadaFiles) *IndexPaymentRequestSyncadaFilesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index payment request syncada files o k response +func (o *IndexPaymentRequestSyncadaFilesOK) SetPayload(payload adminmessages.PaymentRequestSyncadaFiles) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexPaymentRequestSyncadaFilesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.PaymentRequestSyncadaFiles{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexPaymentRequestSyncadaFilesBadRequestCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesBadRequest +const IndexPaymentRequestSyncadaFilesBadRequestCode int = 400 + +/* +IndexPaymentRequestSyncadaFilesBadRequest invalid request + +swagger:response indexPaymentRequestSyncadaFilesBadRequest +*/ +type IndexPaymentRequestSyncadaFilesBadRequest struct { +} + +// NewIndexPaymentRequestSyncadaFilesBadRequest creates IndexPaymentRequestSyncadaFilesBadRequest with default headers values +func NewIndexPaymentRequestSyncadaFilesBadRequest() *IndexPaymentRequestSyncadaFilesBadRequest { + + return &IndexPaymentRequestSyncadaFilesBadRequest{} +} + +// WriteResponse to the client +func (o *IndexPaymentRequestSyncadaFilesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexPaymentRequestSyncadaFilesUnauthorizedCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesUnauthorized +const IndexPaymentRequestSyncadaFilesUnauthorizedCode int = 401 + +/* +IndexPaymentRequestSyncadaFilesUnauthorized request requires user authentication + +swagger:response indexPaymentRequestSyncadaFilesUnauthorized +*/ +type IndexPaymentRequestSyncadaFilesUnauthorized struct { +} + +// NewIndexPaymentRequestSyncadaFilesUnauthorized creates IndexPaymentRequestSyncadaFilesUnauthorized with default headers values +func NewIndexPaymentRequestSyncadaFilesUnauthorized() *IndexPaymentRequestSyncadaFilesUnauthorized { + + return &IndexPaymentRequestSyncadaFilesUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexPaymentRequestSyncadaFilesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexPaymentRequestSyncadaFilesNotFoundCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesNotFound +const IndexPaymentRequestSyncadaFilesNotFoundCode int = 404 + +/* +IndexPaymentRequestSyncadaFilesNotFound Payment Request EDI Files not found + +swagger:response indexPaymentRequestSyncadaFilesNotFound +*/ +type IndexPaymentRequestSyncadaFilesNotFound struct { +} + +// NewIndexPaymentRequestSyncadaFilesNotFound creates IndexPaymentRequestSyncadaFilesNotFound with default headers values +func NewIndexPaymentRequestSyncadaFilesNotFound() *IndexPaymentRequestSyncadaFilesNotFound { + + return &IndexPaymentRequestSyncadaFilesNotFound{} +} + +// WriteResponse to the client +func (o *IndexPaymentRequestSyncadaFilesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexPaymentRequestSyncadaFilesInternalServerErrorCode is the HTTP code returned for type IndexPaymentRequestSyncadaFilesInternalServerError +const IndexPaymentRequestSyncadaFilesInternalServerErrorCode int = 500 + +/* +IndexPaymentRequestSyncadaFilesInternalServerError server error + +swagger:response indexPaymentRequestSyncadaFilesInternalServerError +*/ +type IndexPaymentRequestSyncadaFilesInternalServerError struct { +} + +// NewIndexPaymentRequestSyncadaFilesInternalServerError creates IndexPaymentRequestSyncadaFilesInternalServerError with default headers values +func NewIndexPaymentRequestSyncadaFilesInternalServerError() *IndexPaymentRequestSyncadaFilesInternalServerError { + + return &IndexPaymentRequestSyncadaFilesInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexPaymentRequestSyncadaFilesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go new file mode 100644 index 00000000000..a9174bc35af --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/payment_request_syncada_files/index_payment_request_syncada_files_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request_syncada_files + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexPaymentRequestSyncadaFilesURL generates an URL for the index payment request syncada files operation +type IndexPaymentRequestSyncadaFilesURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexPaymentRequestSyncadaFilesURL) WithBasePath(bp string) *IndexPaymentRequestSyncadaFilesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexPaymentRequestSyncadaFilesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexPaymentRequestSyncadaFilesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-request-syncada-files" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexPaymentRequestSyncadaFilesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexPaymentRequestSyncadaFilesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexPaymentRequestSyncadaFilesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexPaymentRequestSyncadaFilesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexPaymentRequestSyncadaFilesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexPaymentRequestSyncadaFilesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go new file mode 100644 index 00000000000..97efed9ad85 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetRequestedOfficeUserHandlerFunc turns a function with the right signature into a get requested office user handler +type GetRequestedOfficeUserHandlerFunc func(GetRequestedOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetRequestedOfficeUserHandlerFunc) Handle(params GetRequestedOfficeUserParams) middleware.Responder { + return fn(params) +} + +// GetRequestedOfficeUserHandler interface for that can handle valid get requested office user params +type GetRequestedOfficeUserHandler interface { + Handle(GetRequestedOfficeUserParams) middleware.Responder +} + +// NewGetRequestedOfficeUser creates a new http.Handler for the get requested office user operation +func NewGetRequestedOfficeUser(ctx *middleware.Context, handler GetRequestedOfficeUserHandler) *GetRequestedOfficeUser { + return &GetRequestedOfficeUser{Context: ctx, Handler: handler} +} + +/* + GetRequestedOfficeUser swagger:route GET /requested-office-users/{officeUserId} Requested office users getRequestedOfficeUser + +# Get a Requested Office User + +Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data. +*/ +type GetRequestedOfficeUser struct { + Context *middleware.Context + Handler GetRequestedOfficeUserHandler +} + +func (o *GetRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetRequestedOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go new file mode 100644 index 00000000000..bebba5529b5 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetRequestedOfficeUserParams creates a new GetRequestedOfficeUserParams object +// +// There are no default values defined in the spec. +func NewGetRequestedOfficeUserParams() GetRequestedOfficeUserParams { + + return GetRequestedOfficeUserParams{} +} + +// GetRequestedOfficeUserParams contains all the bound params for the get requested office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters getRequestedOfficeUser +type GetRequestedOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + OfficeUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetRequestedOfficeUserParams() beforehand. +func (o *GetRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") + if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeUserID binds and validates parameter OfficeUserID from path. +func (o *GetRequestedOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) + } + o.OfficeUserID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeUserID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeUserID carries on validations for parameter OfficeUserID +func (o *GetRequestedOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go new file mode 100644 index 00000000000..dded1590ba1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetRequestedOfficeUserOKCode is the HTTP code returned for type GetRequestedOfficeUserOK +const GetRequestedOfficeUserOKCode int = 200 + +/* +GetRequestedOfficeUserOK success + +swagger:response getRequestedOfficeUserOK +*/ +type GetRequestedOfficeUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.OfficeUser `json:"body,omitempty"` +} + +// NewGetRequestedOfficeUserOK creates GetRequestedOfficeUserOK with default headers values +func NewGetRequestedOfficeUserOK() *GetRequestedOfficeUserOK { + + return &GetRequestedOfficeUserOK{} +} + +// WithPayload adds the payload to the get requested office user o k response +func (o *GetRequestedOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *GetRequestedOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get requested office user o k response +func (o *GetRequestedOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetRequestedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetRequestedOfficeUserBadRequestCode is the HTTP code returned for type GetRequestedOfficeUserBadRequest +const GetRequestedOfficeUserBadRequestCode int = 400 + +/* +GetRequestedOfficeUserBadRequest invalid request + +swagger:response getRequestedOfficeUserBadRequest +*/ +type GetRequestedOfficeUserBadRequest struct { +} + +// NewGetRequestedOfficeUserBadRequest creates GetRequestedOfficeUserBadRequest with default headers values +func NewGetRequestedOfficeUserBadRequest() *GetRequestedOfficeUserBadRequest { + + return &GetRequestedOfficeUserBadRequest{} +} + +// WriteResponse to the client +func (o *GetRequestedOfficeUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetRequestedOfficeUserUnauthorizedCode is the HTTP code returned for type GetRequestedOfficeUserUnauthorized +const GetRequestedOfficeUserUnauthorizedCode int = 401 + +/* +GetRequestedOfficeUserUnauthorized request requires user authentication + +swagger:response getRequestedOfficeUserUnauthorized +*/ +type GetRequestedOfficeUserUnauthorized struct { +} + +// NewGetRequestedOfficeUserUnauthorized creates GetRequestedOfficeUserUnauthorized with default headers values +func NewGetRequestedOfficeUserUnauthorized() *GetRequestedOfficeUserUnauthorized { + + return &GetRequestedOfficeUserUnauthorized{} +} + +// WriteResponse to the client +func (o *GetRequestedOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetRequestedOfficeUserNotFoundCode is the HTTP code returned for type GetRequestedOfficeUserNotFound +const GetRequestedOfficeUserNotFoundCode int = 404 + +/* +GetRequestedOfficeUserNotFound Office User not found + +swagger:response getRequestedOfficeUserNotFound +*/ +type GetRequestedOfficeUserNotFound struct { +} + +// NewGetRequestedOfficeUserNotFound creates GetRequestedOfficeUserNotFound with default headers values +func NewGetRequestedOfficeUserNotFound() *GetRequestedOfficeUserNotFound { + + return &GetRequestedOfficeUserNotFound{} +} + +// WriteResponse to the client +func (o *GetRequestedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type GetRequestedOfficeUserInternalServerError +const GetRequestedOfficeUserInternalServerErrorCode int = 500 + +/* +GetRequestedOfficeUserInternalServerError server error + +swagger:response getRequestedOfficeUserInternalServerError +*/ +type GetRequestedOfficeUserInternalServerError struct { +} + +// NewGetRequestedOfficeUserInternalServerError creates GetRequestedOfficeUserInternalServerError with default headers values +func NewGetRequestedOfficeUserInternalServerError() *GetRequestedOfficeUserInternalServerError { + + return &GetRequestedOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *GetRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go new file mode 100644 index 00000000000..4cc60c7e91d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/get_requested_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetRequestedOfficeUserURL generates an URL for the get requested office user operation +type GetRequestedOfficeUserURL struct { + OfficeUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetRequestedOfficeUserURL) WithBasePath(bp string) *GetRequestedOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetRequestedOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetRequestedOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/requested-office-users/{officeUserId}" + + officeUserID := o.OfficeUserID.String() + if officeUserID != "" { + _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) + } else { + return nil, errors.New("officeUserId is required on GetRequestedOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetRequestedOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetRequestedOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetRequestedOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetRequestedOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go new file mode 100644 index 00000000000..cf8a8ea73f5 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexRequestedOfficeUsersHandlerFunc turns a function with the right signature into a index requested office users handler +type IndexRequestedOfficeUsersHandlerFunc func(IndexRequestedOfficeUsersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexRequestedOfficeUsersHandlerFunc) Handle(params IndexRequestedOfficeUsersParams) middleware.Responder { + return fn(params) +} + +// IndexRequestedOfficeUsersHandler interface for that can handle valid index requested office users params +type IndexRequestedOfficeUsersHandler interface { + Handle(IndexRequestedOfficeUsersParams) middleware.Responder +} + +// NewIndexRequestedOfficeUsers creates a new http.Handler for the index requested office users operation +func NewIndexRequestedOfficeUsers(ctx *middleware.Context, handler IndexRequestedOfficeUsersHandler) *IndexRequestedOfficeUsers { + return &IndexRequestedOfficeUsers{Context: ctx, Handler: handler} +} + +/* + IndexRequestedOfficeUsers swagger:route GET /requested-office-users Requested office users indexRequestedOfficeUsers + +# List of Office Users Requesting Accounts + +This endpoint returns a list of Office Users. Do not use this endpoint directly +as it is meant to be used with the Admin UI exclusively. +*/ +type IndexRequestedOfficeUsers struct { + Context *middleware.Context + Handler IndexRequestedOfficeUsersHandler +} + +func (o *IndexRequestedOfficeUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexRequestedOfficeUsersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go new file mode 100644 index 00000000000..b2229494363 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexRequestedOfficeUsersParams creates a new IndexRequestedOfficeUsersParams object +// +// There are no default values defined in the spec. +func NewIndexRequestedOfficeUsersParams() IndexRequestedOfficeUsersParams { + + return IndexRequestedOfficeUsersParams{} +} + +// IndexRequestedOfficeUsersParams contains all the bound params for the index requested office users operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexRequestedOfficeUsers +type IndexRequestedOfficeUsersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexRequestedOfficeUsersParams() beforehand. +func (o *IndexRequestedOfficeUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexRequestedOfficeUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexRequestedOfficeUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexRequestedOfficeUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexRequestedOfficeUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexRequestedOfficeUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go new file mode 100644 index 00000000000..d3fe79a41b8 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexRequestedOfficeUsersOKCode is the HTTP code returned for type IndexRequestedOfficeUsersOK +const IndexRequestedOfficeUsersOKCode int = 200 + +/* +IndexRequestedOfficeUsersOK success + +swagger:response indexRequestedOfficeUsersOK +*/ +type IndexRequestedOfficeUsersOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.OfficeUsers `json:"body,omitempty"` +} + +// NewIndexRequestedOfficeUsersOK creates IndexRequestedOfficeUsersOK with default headers values +func NewIndexRequestedOfficeUsersOK() *IndexRequestedOfficeUsersOK { + + return &IndexRequestedOfficeUsersOK{} +} + +// WithContentRange adds the contentRange to the index requested office users o k response +func (o *IndexRequestedOfficeUsersOK) WithContentRange(contentRange string) *IndexRequestedOfficeUsersOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index requested office users o k response +func (o *IndexRequestedOfficeUsersOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index requested office users o k response +func (o *IndexRequestedOfficeUsersOK) WithPayload(payload adminmessages.OfficeUsers) *IndexRequestedOfficeUsersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index requested office users o k response +func (o *IndexRequestedOfficeUsersOK) SetPayload(payload adminmessages.OfficeUsers) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexRequestedOfficeUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.OfficeUsers{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexRequestedOfficeUsersBadRequestCode is the HTTP code returned for type IndexRequestedOfficeUsersBadRequest +const IndexRequestedOfficeUsersBadRequestCode int = 400 + +/* +IndexRequestedOfficeUsersBadRequest invalid request + +swagger:response indexRequestedOfficeUsersBadRequest +*/ +type IndexRequestedOfficeUsersBadRequest struct { +} + +// NewIndexRequestedOfficeUsersBadRequest creates IndexRequestedOfficeUsersBadRequest with default headers values +func NewIndexRequestedOfficeUsersBadRequest() *IndexRequestedOfficeUsersBadRequest { + + return &IndexRequestedOfficeUsersBadRequest{} +} + +// WriteResponse to the client +func (o *IndexRequestedOfficeUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexRequestedOfficeUsersUnauthorizedCode is the HTTP code returned for type IndexRequestedOfficeUsersUnauthorized +const IndexRequestedOfficeUsersUnauthorizedCode int = 401 + +/* +IndexRequestedOfficeUsersUnauthorized request requires user authentication + +swagger:response indexRequestedOfficeUsersUnauthorized +*/ +type IndexRequestedOfficeUsersUnauthorized struct { +} + +// NewIndexRequestedOfficeUsersUnauthorized creates IndexRequestedOfficeUsersUnauthorized with default headers values +func NewIndexRequestedOfficeUsersUnauthorized() *IndexRequestedOfficeUsersUnauthorized { + + return &IndexRequestedOfficeUsersUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexRequestedOfficeUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexRequestedOfficeUsersNotFoundCode is the HTTP code returned for type IndexRequestedOfficeUsersNotFound +const IndexRequestedOfficeUsersNotFoundCode int = 404 + +/* +IndexRequestedOfficeUsersNotFound Office User not found + +swagger:response indexRequestedOfficeUsersNotFound +*/ +type IndexRequestedOfficeUsersNotFound struct { +} + +// NewIndexRequestedOfficeUsersNotFound creates IndexRequestedOfficeUsersNotFound with default headers values +func NewIndexRequestedOfficeUsersNotFound() *IndexRequestedOfficeUsersNotFound { + + return &IndexRequestedOfficeUsersNotFound{} +} + +// WriteResponse to the client +func (o *IndexRequestedOfficeUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexRequestedOfficeUsersInternalServerErrorCode is the HTTP code returned for type IndexRequestedOfficeUsersInternalServerError +const IndexRequestedOfficeUsersInternalServerErrorCode int = 500 + +/* +IndexRequestedOfficeUsersInternalServerError server error + +swagger:response indexRequestedOfficeUsersInternalServerError +*/ +type IndexRequestedOfficeUsersInternalServerError struct { +} + +// NewIndexRequestedOfficeUsersInternalServerError creates IndexRequestedOfficeUsersInternalServerError with default headers values +func NewIndexRequestedOfficeUsersInternalServerError() *IndexRequestedOfficeUsersInternalServerError { + + return &IndexRequestedOfficeUsersInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexRequestedOfficeUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go new file mode 100644 index 00000000000..2169551a3fa --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/index_requested_office_users_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexRequestedOfficeUsersURL generates an URL for the index requested office users operation +type IndexRequestedOfficeUsersURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexRequestedOfficeUsersURL) WithBasePath(bp string) *IndexRequestedOfficeUsersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexRequestedOfficeUsersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexRequestedOfficeUsersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/requested-office-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexRequestedOfficeUsersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexRequestedOfficeUsersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexRequestedOfficeUsersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexRequestedOfficeUsersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexRequestedOfficeUsersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexRequestedOfficeUsersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go new file mode 100644 index 00000000000..42fd8d9c41f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateRequestedOfficeUserHandlerFunc turns a function with the right signature into a update requested office user handler +type UpdateRequestedOfficeUserHandlerFunc func(UpdateRequestedOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateRequestedOfficeUserHandlerFunc) Handle(params UpdateRequestedOfficeUserParams) middleware.Responder { + return fn(params) +} + +// UpdateRequestedOfficeUserHandler interface for that can handle valid update requested office user params +type UpdateRequestedOfficeUserHandler interface { + Handle(UpdateRequestedOfficeUserParams) middleware.Responder +} + +// NewUpdateRequestedOfficeUser creates a new http.Handler for the update requested office user operation +func NewUpdateRequestedOfficeUser(ctx *middleware.Context, handler UpdateRequestedOfficeUserHandler) *UpdateRequestedOfficeUser { + return &UpdateRequestedOfficeUser{Context: ctx, Handler: handler} +} + +/* + UpdateRequestedOfficeUser swagger:route PATCH /requested-office-users/{officeUserId} Requested office users updateRequestedOfficeUser + +# Update a Requested Office User + +Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user. +*/ +type UpdateRequestedOfficeUser struct { + Context *middleware.Context + Handler UpdateRequestedOfficeUserHandler +} + +func (o *UpdateRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateRequestedOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go new file mode 100644 index 00000000000..7e27a4ba306 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateRequestedOfficeUserParams creates a new UpdateRequestedOfficeUserParams object +// +// There are no default values defined in the spec. +func NewUpdateRequestedOfficeUserParams() UpdateRequestedOfficeUserParams { + + return UpdateRequestedOfficeUserParams{} +} + +// UpdateRequestedOfficeUserParams contains all the bound params for the update requested office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateRequestedOfficeUser +type UpdateRequestedOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *adminmessages.RequestedOfficeUserUpdate + /* + Required: true + In: path + */ + OfficeUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateRequestedOfficeUserParams() beforehand. +func (o *UpdateRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.RequestedOfficeUserUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserId") + if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeUserID binds and validates parameter OfficeUserID from path. +func (o *UpdateRequestedOfficeUserParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeUserId", "path", "strfmt.UUID", raw) + } + o.OfficeUserID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeUserID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeUserID carries on validations for parameter OfficeUserID +func (o *UpdateRequestedOfficeUserParams) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeUserId", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go new file mode 100644 index 00000000000..51c533f41fe --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_responses.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateRequestedOfficeUserOKCode is the HTTP code returned for type UpdateRequestedOfficeUserOK +const UpdateRequestedOfficeUserOKCode int = 200 + +/* +UpdateRequestedOfficeUserOK success + +swagger:response updateRequestedOfficeUserOK +*/ +type UpdateRequestedOfficeUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.OfficeUser `json:"body,omitempty"` +} + +// NewUpdateRequestedOfficeUserOK creates UpdateRequestedOfficeUserOK with default headers values +func NewUpdateRequestedOfficeUserOK() *UpdateRequestedOfficeUserOK { + + return &UpdateRequestedOfficeUserOK{} +} + +// WithPayload adds the payload to the update requested office user o k response +func (o *UpdateRequestedOfficeUserOK) WithPayload(payload *adminmessages.OfficeUser) *UpdateRequestedOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update requested office user o k response +func (o *UpdateRequestedOfficeUserOK) SetPayload(payload *adminmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateRequestedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateRequestedOfficeUserUnauthorizedCode is the HTTP code returned for type UpdateRequestedOfficeUserUnauthorized +const UpdateRequestedOfficeUserUnauthorizedCode int = 401 + +/* +UpdateRequestedOfficeUserUnauthorized request requires user authentication + +swagger:response updateRequestedOfficeUserUnauthorized +*/ +type UpdateRequestedOfficeUserUnauthorized struct { +} + +// NewUpdateRequestedOfficeUserUnauthorized creates UpdateRequestedOfficeUserUnauthorized with default headers values +func NewUpdateRequestedOfficeUserUnauthorized() *UpdateRequestedOfficeUserUnauthorized { + + return &UpdateRequestedOfficeUserUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateRequestedOfficeUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateRequestedOfficeUserNotFoundCode is the HTTP code returned for type UpdateRequestedOfficeUserNotFound +const UpdateRequestedOfficeUserNotFoundCode int = 404 + +/* +UpdateRequestedOfficeUserNotFound Office User not found + +swagger:response updateRequestedOfficeUserNotFound +*/ +type UpdateRequestedOfficeUserNotFound struct { +} + +// NewUpdateRequestedOfficeUserNotFound creates UpdateRequestedOfficeUserNotFound with default headers values +func NewUpdateRequestedOfficeUserNotFound() *UpdateRequestedOfficeUserNotFound { + + return &UpdateRequestedOfficeUserNotFound{} +} + +// WriteResponse to the client +func (o *UpdateRequestedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateRequestedOfficeUserUnprocessableEntityCode is the HTTP code returned for type UpdateRequestedOfficeUserUnprocessableEntity +const UpdateRequestedOfficeUserUnprocessableEntityCode int = 422 + +/* +UpdateRequestedOfficeUserUnprocessableEntity validation error + +swagger:response updateRequestedOfficeUserUnprocessableEntity +*/ +type UpdateRequestedOfficeUserUnprocessableEntity struct { + + /* + In: Body + */ + Payload *adminmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateRequestedOfficeUserUnprocessableEntity creates UpdateRequestedOfficeUserUnprocessableEntity with default headers values +func NewUpdateRequestedOfficeUserUnprocessableEntity() *UpdateRequestedOfficeUserUnprocessableEntity { + + return &UpdateRequestedOfficeUserUnprocessableEntity{} +} + +// WithPayload adds the payload to the update requested office user unprocessable entity response +func (o *UpdateRequestedOfficeUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateRequestedOfficeUserUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update requested office user unprocessable entity response +func (o *UpdateRequestedOfficeUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateRequestedOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateRequestedOfficeUserInternalServerError +const UpdateRequestedOfficeUserInternalServerErrorCode int = 500 + +/* +UpdateRequestedOfficeUserInternalServerError server error + +swagger:response updateRequestedOfficeUserInternalServerError +*/ +type UpdateRequestedOfficeUserInternalServerError struct { +} + +// NewUpdateRequestedOfficeUserInternalServerError creates UpdateRequestedOfficeUserInternalServerError with default headers values +func NewUpdateRequestedOfficeUserInternalServerError() *UpdateRequestedOfficeUserInternalServerError { + + return &UpdateRequestedOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go new file mode 100644 index 00000000000..00275564ba1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/requested_office_users/update_requested_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package requested_office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateRequestedOfficeUserURL generates an URL for the update requested office user operation +type UpdateRequestedOfficeUserURL struct { + OfficeUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateRequestedOfficeUserURL) WithBasePath(bp string) *UpdateRequestedOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateRequestedOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateRequestedOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/requested-office-users/{officeUserId}" + + officeUserID := o.OfficeUserID.String() + if officeUserID != "" { + _path = strings.Replace(_path, "{officeUserId}", officeUserID, -1) + } else { + return nil, errors.New("officeUserId is required on UpdateRequestedOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateRequestedOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateRequestedOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateRequestedOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateRequestedOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go new file mode 100644 index 00000000000..ab375956669 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetOfficeByIDHandlerFunc turns a function with the right signature into a get office by Id handler +type GetOfficeByIDHandlerFunc func(GetOfficeByIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetOfficeByIDHandlerFunc) Handle(params GetOfficeByIDParams) middleware.Responder { + return fn(params) +} + +// GetOfficeByIDHandler interface for that can handle valid get office by Id params +type GetOfficeByIDHandler interface { + Handle(GetOfficeByIDParams) middleware.Responder +} + +// NewGetOfficeByID creates a new http.Handler for the get office by Id operation +func NewGetOfficeByID(ctx *middleware.Context, handler GetOfficeByIDHandler) *GetOfficeByID { + return &GetOfficeByID{Context: ctx, Handler: handler} +} + +/* + GetOfficeByID swagger:route GET /offices/{officeId} Transportation offices getOfficeById + +# Get Transportation Office by ID + +This endpoint returns a list of Transportation Offices. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type GetOfficeByID struct { + Context *middleware.Context + Handler GetOfficeByIDHandler +} + +func (o *GetOfficeByID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetOfficeByIDParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go new file mode 100644 index 00000000000..ae0bcafa12e --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetOfficeByIDParams creates a new GetOfficeByIDParams object +// +// There are no default values defined in the spec. +func NewGetOfficeByIDParams() GetOfficeByIDParams { + + return GetOfficeByIDParams{} +} + +// GetOfficeByIDParams contains all the bound params for the get office by Id operation +// typically these are obtained from a http.Request +// +// swagger:parameters getOfficeById +type GetOfficeByIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + OfficeID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetOfficeByIDParams() beforehand. +func (o *GetOfficeByIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOfficeID, rhkOfficeID, _ := route.Params.GetOK("officeId") + if err := o.bindOfficeID(rOfficeID, rhkOfficeID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeID binds and validates parameter OfficeID from path. +func (o *GetOfficeByIDParams) bindOfficeID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeId", "path", "strfmt.UUID", raw) + } + o.OfficeID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeID carries on validations for parameter OfficeID +func (o *GetOfficeByIDParams) validateOfficeID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeId", "path", "uuid", o.OfficeID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go new file mode 100644 index 00000000000..417b2ba1d00 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetOfficeByIDOKCode is the HTTP code returned for type GetOfficeByIDOK +const GetOfficeByIDOKCode int = 200 + +/* +GetOfficeByIDOK success + +swagger:response getOfficeByIdOK +*/ +type GetOfficeByIDOK struct { + + /* + In: Body + */ + Payload *adminmessages.TransportationOffice `json:"body,omitempty"` +} + +// NewGetOfficeByIDOK creates GetOfficeByIDOK with default headers values +func NewGetOfficeByIDOK() *GetOfficeByIDOK { + + return &GetOfficeByIDOK{} +} + +// WithPayload adds the payload to the get office by Id o k response +func (o *GetOfficeByIDOK) WithPayload(payload *adminmessages.TransportationOffice) *GetOfficeByIDOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get office by Id o k response +func (o *GetOfficeByIDOK) SetPayload(payload *adminmessages.TransportationOffice) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOfficeByIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOfficeByIDBadRequestCode is the HTTP code returned for type GetOfficeByIDBadRequest +const GetOfficeByIDBadRequestCode int = 400 + +/* +GetOfficeByIDBadRequest invalid request + +swagger:response getOfficeByIdBadRequest +*/ +type GetOfficeByIDBadRequest struct { +} + +// NewGetOfficeByIDBadRequest creates GetOfficeByIDBadRequest with default headers values +func NewGetOfficeByIDBadRequest() *GetOfficeByIDBadRequest { + + return &GetOfficeByIDBadRequest{} +} + +// WriteResponse to the client +func (o *GetOfficeByIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetOfficeByIDUnauthorizedCode is the HTTP code returned for type GetOfficeByIDUnauthorized +const GetOfficeByIDUnauthorizedCode int = 401 + +/* +GetOfficeByIDUnauthorized request requires user authentication + +swagger:response getOfficeByIdUnauthorized +*/ +type GetOfficeByIDUnauthorized struct { +} + +// NewGetOfficeByIDUnauthorized creates GetOfficeByIDUnauthorized with default headers values +func NewGetOfficeByIDUnauthorized() *GetOfficeByIDUnauthorized { + + return &GetOfficeByIDUnauthorized{} +} + +// WriteResponse to the client +func (o *GetOfficeByIDUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetOfficeByIDNotFoundCode is the HTTP code returned for type GetOfficeByIDNotFound +const GetOfficeByIDNotFoundCode int = 404 + +/* +GetOfficeByIDNotFound Transportation Office not found + +swagger:response getOfficeByIdNotFound +*/ +type GetOfficeByIDNotFound struct { +} + +// NewGetOfficeByIDNotFound creates GetOfficeByIDNotFound with default headers values +func NewGetOfficeByIDNotFound() *GetOfficeByIDNotFound { + + return &GetOfficeByIDNotFound{} +} + +// WriteResponse to the client +func (o *GetOfficeByIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetOfficeByIDInternalServerErrorCode is the HTTP code returned for type GetOfficeByIDInternalServerError +const GetOfficeByIDInternalServerErrorCode int = 500 + +/* +GetOfficeByIDInternalServerError server error + +swagger:response getOfficeByIdInternalServerError +*/ +type GetOfficeByIDInternalServerError struct { +} + +// NewGetOfficeByIDInternalServerError creates GetOfficeByIDInternalServerError with default headers values +func NewGetOfficeByIDInternalServerError() *GetOfficeByIDInternalServerError { + + return &GetOfficeByIDInternalServerError{} +} + +// WriteResponse to the client +func (o *GetOfficeByIDInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go new file mode 100644 index 00000000000..84b2be6dc43 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/get_office_by_id_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetOfficeByIDURL generates an URL for the get office by Id operation +type GetOfficeByIDURL struct { + OfficeID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOfficeByIDURL) WithBasePath(bp string) *GetOfficeByIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOfficeByIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetOfficeByIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/offices/{officeId}" + + officeID := o.OfficeID.String() + if officeID != "" { + _path = strings.Replace(_path, "{officeId}", officeID, -1) + } else { + return nil, errors.New("officeId is required on GetOfficeByIDURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetOfficeByIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetOfficeByIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetOfficeByIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetOfficeByIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetOfficeByIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetOfficeByIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go new file mode 100644 index 00000000000..304c3ad040b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexOfficesHandlerFunc turns a function with the right signature into a index offices handler +type IndexOfficesHandlerFunc func(IndexOfficesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexOfficesHandlerFunc) Handle(params IndexOfficesParams) middleware.Responder { + return fn(params) +} + +// IndexOfficesHandler interface for that can handle valid index offices params +type IndexOfficesHandler interface { + Handle(IndexOfficesParams) middleware.Responder +} + +// NewIndexOffices creates a new http.Handler for the index offices operation +func NewIndexOffices(ctx *middleware.Context, handler IndexOfficesHandler) *IndexOffices { + return &IndexOffices{Context: ctx, Handler: handler} +} + +/* + IndexOffices swagger:route GET /offices Transportation offices indexOffices + +# List Transportation Offices + +This endpoint returns a list of Transportation Offices. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type IndexOffices struct { + Context *middleware.Context + Handler IndexOfficesHandler +} + +func (o *IndexOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexOfficesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go new file mode 100644 index 00000000000..5b863367009 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexOfficesParams creates a new IndexOfficesParams object +// +// There are no default values defined in the spec. +func NewIndexOfficesParams() IndexOfficesParams { + + return IndexOfficesParams{} +} + +// IndexOfficesParams contains all the bound params for the index offices operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexOffices +type IndexOfficesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexOfficesParams() beforehand. +func (o *IndexOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexOfficesParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexOfficesParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexOfficesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexOfficesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexOfficesParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go new file mode 100644 index 00000000000..1a0a824da53 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexOfficesOKCode is the HTTP code returned for type IndexOfficesOK +const IndexOfficesOKCode int = 200 + +/* +IndexOfficesOK success + +swagger:response indexOfficesOK +*/ +type IndexOfficesOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.TransportationOffices `json:"body,omitempty"` +} + +// NewIndexOfficesOK creates IndexOfficesOK with default headers values +func NewIndexOfficesOK() *IndexOfficesOK { + + return &IndexOfficesOK{} +} + +// WithContentRange adds the contentRange to the index offices o k response +func (o *IndexOfficesOK) WithContentRange(contentRange string) *IndexOfficesOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index offices o k response +func (o *IndexOfficesOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index offices o k response +func (o *IndexOfficesOK) WithPayload(payload adminmessages.TransportationOffices) *IndexOfficesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index offices o k response +func (o *IndexOfficesOK) SetPayload(payload adminmessages.TransportationOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.TransportationOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexOfficesBadRequestCode is the HTTP code returned for type IndexOfficesBadRequest +const IndexOfficesBadRequestCode int = 400 + +/* +IndexOfficesBadRequest invalid request + +swagger:response indexOfficesBadRequest +*/ +type IndexOfficesBadRequest struct { +} + +// NewIndexOfficesBadRequest creates IndexOfficesBadRequest with default headers values +func NewIndexOfficesBadRequest() *IndexOfficesBadRequest { + + return &IndexOfficesBadRequest{} +} + +// WriteResponse to the client +func (o *IndexOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexOfficesUnauthorizedCode is the HTTP code returned for type IndexOfficesUnauthorized +const IndexOfficesUnauthorizedCode int = 401 + +/* +IndexOfficesUnauthorized request requires user authentication + +swagger:response indexOfficesUnauthorized +*/ +type IndexOfficesUnauthorized struct { +} + +// NewIndexOfficesUnauthorized creates IndexOfficesUnauthorized with default headers values +func NewIndexOfficesUnauthorized() *IndexOfficesUnauthorized { + + return &IndexOfficesUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexOfficesNotFoundCode is the HTTP code returned for type IndexOfficesNotFound +const IndexOfficesNotFoundCode int = 404 + +/* +IndexOfficesNotFound Transportation Office not found + +swagger:response indexOfficesNotFound +*/ +type IndexOfficesNotFound struct { +} + +// NewIndexOfficesNotFound creates IndexOfficesNotFound with default headers values +func NewIndexOfficesNotFound() *IndexOfficesNotFound { + + return &IndexOfficesNotFound{} +} + +// WriteResponse to the client +func (o *IndexOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexOfficesInternalServerErrorCode is the HTTP code returned for type IndexOfficesInternalServerError +const IndexOfficesInternalServerErrorCode int = 500 + +/* +IndexOfficesInternalServerError server error + +swagger:response indexOfficesInternalServerError +*/ +type IndexOfficesInternalServerError struct { +} + +// NewIndexOfficesInternalServerError creates IndexOfficesInternalServerError with default headers values +func NewIndexOfficesInternalServerError() *IndexOfficesInternalServerError { + + return &IndexOfficesInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go new file mode 100644 index 00000000000..a9d318bc905 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/transportation_offices/index_offices_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexOfficesURL generates an URL for the index offices operation +type IndexOfficesURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOfficesURL) WithBasePath(bp string) *IndexOfficesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexOfficesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexOfficesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/offices" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexOfficesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexOfficesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexOfficesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexOfficesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexOfficesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload.go new file mode 100644 index 00000000000..6b8d2e4ebf8 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/uploads/get_upload.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetUploadHandlerFunc turns a function with the right signature into a get upload handler +type GetUploadHandlerFunc func(GetUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetUploadHandlerFunc) Handle(params GetUploadParams) middleware.Responder { + return fn(params) +} + +// GetUploadHandler interface for that can handle valid get upload params +type GetUploadHandler interface { + Handle(GetUploadParams) middleware.Responder +} + +// NewGetUpload creates a new http.Handler for the get upload operation +func NewGetUpload(ctx *middleware.Context, handler GetUploadHandler) *GetUpload { + return &GetUpload{Context: ctx, Handler: handler} +} + +/* + GetUpload swagger:route GET /uploads/{uploadId} Uploads getUpload + +# Get information about an Upload + +This endpoint returns a single Upload by ID containing the given Upload and +information about the Uploader and Move. Do not use this endpoint directly as it +is meant to be used with the Admin UI exclusively. +*/ +type GetUpload struct { + Context *middleware.Context + Handler GetUploadHandler +} + +func (o *GetUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go new file mode 100644 index 00000000000..7c71f367f8b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/uploads/get_upload_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetUploadParams creates a new GetUploadParams object +// +// There are no default values defined in the spec. +func NewGetUploadParams() GetUploadParams { + + return GetUploadParams{} +} + +// GetUploadParams contains all the bound params for the get upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters getUpload +type GetUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + UploadID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetUploadParams() beforehand. +func (o *GetUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadId") + if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindUploadID binds and validates parameter UploadID from path. +func (o *GetUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("uploadId", "path", "strfmt.UUID", raw) + } + o.UploadID = *(value.(*strfmt.UUID)) + + if err := o.validateUploadID(formats); err != nil { + return err + } + + return nil +} + +// validateUploadID carries on validations for parameter UploadID +func (o *GetUploadParams) validateUploadID(formats strfmt.Registry) error { + + if err := validate.FormatOf("uploadId", "path", "uuid", o.UploadID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go new file mode 100644 index 00000000000..08c26d43da9 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/uploads/get_upload_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetUploadOKCode is the HTTP code returned for type GetUploadOK +const GetUploadOKCode int = 200 + +/* +GetUploadOK success + +swagger:response getUploadOK +*/ +type GetUploadOK struct { + + /* + In: Body + */ + Payload *adminmessages.UploadInformation `json:"body,omitempty"` +} + +// NewGetUploadOK creates GetUploadOK with default headers values +func NewGetUploadOK() *GetUploadOK { + + return &GetUploadOK{} +} + +// WithPayload adds the payload to the get upload o k response +func (o *GetUploadOK) WithPayload(payload *adminmessages.UploadInformation) *GetUploadOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload o k response +func (o *GetUploadOK) SetPayload(payload *adminmessages.UploadInformation) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadBadRequestCode is the HTTP code returned for type GetUploadBadRequest +const GetUploadBadRequestCode int = 400 + +/* +GetUploadBadRequest invalid request + +swagger:response getUploadBadRequest +*/ +type GetUploadBadRequest struct { +} + +// NewGetUploadBadRequest creates GetUploadBadRequest with default headers values +func NewGetUploadBadRequest() *GetUploadBadRequest { + + return &GetUploadBadRequest{} +} + +// WriteResponse to the client +func (o *GetUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetUploadUnauthorizedCode is the HTTP code returned for type GetUploadUnauthorized +const GetUploadUnauthorizedCode int = 401 + +/* +GetUploadUnauthorized request requires user authentication + +swagger:response getUploadUnauthorized +*/ +type GetUploadUnauthorized struct { +} + +// NewGetUploadUnauthorized creates GetUploadUnauthorized with default headers values +func NewGetUploadUnauthorized() *GetUploadUnauthorized { + + return &GetUploadUnauthorized{} +} + +// WriteResponse to the client +func (o *GetUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetUploadNotFoundCode is the HTTP code returned for type GetUploadNotFound +const GetUploadNotFoundCode int = 404 + +/* +GetUploadNotFound Upload not found + +swagger:response getUploadNotFound +*/ +type GetUploadNotFound struct { +} + +// NewGetUploadNotFound creates GetUploadNotFound with default headers values +func NewGetUploadNotFound() *GetUploadNotFound { + + return &GetUploadNotFound{} +} + +// WriteResponse to the client +func (o *GetUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetUploadInternalServerErrorCode is the HTTP code returned for type GetUploadInternalServerError +const GetUploadInternalServerErrorCode int = 500 + +/* +GetUploadInternalServerError server error + +swagger:response getUploadInternalServerError +*/ +type GetUploadInternalServerError struct { +} + +// NewGetUploadInternalServerError creates GetUploadInternalServerError with default headers values +func NewGetUploadInternalServerError() *GetUploadInternalServerError { + + return &GetUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *GetUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go b/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go new file mode 100644 index 00000000000..f7c1dffc860 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/uploads/get_upload_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetUploadURL generates an URL for the get upload operation +type GetUploadURL struct { + UploadID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUploadURL) WithBasePath(bp string) *GetUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads/{uploadId}" + + uploadID := o.UploadID.String() + if uploadID != "" { + _path = strings.Replace(_path, "{uploadId}", uploadID, -1) + } else { + return nil, errors.New("uploadId is required on GetUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go new file mode 100644 index 00000000000..1287028fe78 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetLoggedInAdminUserHandlerFunc turns a function with the right signature into a get logged in admin user handler +type GetLoggedInAdminUserHandlerFunc func(GetLoggedInAdminUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetLoggedInAdminUserHandlerFunc) Handle(params GetLoggedInAdminUserParams) middleware.Responder { + return fn(params) +} + +// GetLoggedInAdminUserHandler interface for that can handle valid get logged in admin user params +type GetLoggedInAdminUserHandler interface { + Handle(GetLoggedInAdminUserParams) middleware.Responder +} + +// NewGetLoggedInAdminUser creates a new http.Handler for the get logged in admin user operation +func NewGetLoggedInAdminUser(ctx *middleware.Context, handler GetLoggedInAdminUserHandler) *GetLoggedInAdminUser { + return &GetLoggedInAdminUser{Context: ctx, Handler: handler} +} + +/* + GetLoggedInAdminUser swagger:route GET /user User getLoggedInAdminUser + +# Gets the data about the currently signed in admin user + +Returns the admin user info for the currently logged in user +*/ +type GetLoggedInAdminUser struct { + Context *middleware.Context + Handler GetLoggedInAdminUserHandler +} + +func (o *GetLoggedInAdminUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetLoggedInAdminUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go new file mode 100644 index 00000000000..ac0b1435402 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetLoggedInAdminUserParams creates a new GetLoggedInAdminUserParams object +// +// There are no default values defined in the spec. +func NewGetLoggedInAdminUserParams() GetLoggedInAdminUserParams { + + return GetLoggedInAdminUserParams{} +} + +// GetLoggedInAdminUserParams contains all the bound params for the get logged in admin user operation +// typically these are obtained from a http.Request +// +// swagger:parameters getLoggedInAdminUser +type GetLoggedInAdminUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetLoggedInAdminUserParams() beforehand. +func (o *GetLoggedInAdminUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go new file mode 100644 index 00000000000..fe630235c59 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetLoggedInAdminUserOKCode is the HTTP code returned for type GetLoggedInAdminUserOK +const GetLoggedInAdminUserOKCode int = 200 + +/* +GetLoggedInAdminUserOK success + +swagger:response getLoggedInAdminUserOK +*/ +type GetLoggedInAdminUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.AdminUser `json:"body,omitempty"` +} + +// NewGetLoggedInAdminUserOK creates GetLoggedInAdminUserOK with default headers values +func NewGetLoggedInAdminUserOK() *GetLoggedInAdminUserOK { + + return &GetLoggedInAdminUserOK{} +} + +// WithPayload adds the payload to the get logged in admin user o k response +func (o *GetLoggedInAdminUserOK) WithPayload(payload *adminmessages.AdminUser) *GetLoggedInAdminUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get logged in admin user o k response +func (o *GetLoggedInAdminUserOK) SetPayload(payload *adminmessages.AdminUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLoggedInAdminUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLoggedInAdminUserBadRequestCode is the HTTP code returned for type GetLoggedInAdminUserBadRequest +const GetLoggedInAdminUserBadRequestCode int = 400 + +/* +GetLoggedInAdminUserBadRequest invalid request + +swagger:response getLoggedInAdminUserBadRequest +*/ +type GetLoggedInAdminUserBadRequest struct { +} + +// NewGetLoggedInAdminUserBadRequest creates GetLoggedInAdminUserBadRequest with default headers values +func NewGetLoggedInAdminUserBadRequest() *GetLoggedInAdminUserBadRequest { + + return &GetLoggedInAdminUserBadRequest{} +} + +// WriteResponse to the client +func (o *GetLoggedInAdminUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetLoggedInAdminUserUnauthorizedCode is the HTTP code returned for type GetLoggedInAdminUserUnauthorized +const GetLoggedInAdminUserUnauthorizedCode int = 401 + +/* +GetLoggedInAdminUserUnauthorized request requires user authentication + +swagger:response getLoggedInAdminUserUnauthorized +*/ +type GetLoggedInAdminUserUnauthorized struct { +} + +// NewGetLoggedInAdminUserUnauthorized creates GetLoggedInAdminUserUnauthorized with default headers values +func NewGetLoggedInAdminUserUnauthorized() *GetLoggedInAdminUserUnauthorized { + + return &GetLoggedInAdminUserUnauthorized{} +} + +// WriteResponse to the client +func (o *GetLoggedInAdminUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetLoggedInAdminUserNotFoundCode is the HTTP code returned for type GetLoggedInAdminUserNotFound +const GetLoggedInAdminUserNotFoundCode int = 404 + +/* +GetLoggedInAdminUserNotFound Admin User not found + +swagger:response getLoggedInAdminUserNotFound +*/ +type GetLoggedInAdminUserNotFound struct { +} + +// NewGetLoggedInAdminUserNotFound creates GetLoggedInAdminUserNotFound with default headers values +func NewGetLoggedInAdminUserNotFound() *GetLoggedInAdminUserNotFound { + + return &GetLoggedInAdminUserNotFound{} +} + +// WriteResponse to the client +func (o *GetLoggedInAdminUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetLoggedInAdminUserInternalServerErrorCode is the HTTP code returned for type GetLoggedInAdminUserInternalServerError +const GetLoggedInAdminUserInternalServerErrorCode int = 500 + +/* +GetLoggedInAdminUserInternalServerError server error + +swagger:response getLoggedInAdminUserInternalServerError +*/ +type GetLoggedInAdminUserInternalServerError struct { +} + +// NewGetLoggedInAdminUserInternalServerError creates GetLoggedInAdminUserInternalServerError with default headers values +func NewGetLoggedInAdminUserInternalServerError() *GetLoggedInAdminUserInternalServerError { + + return &GetLoggedInAdminUserInternalServerError{} +} + +// WriteResponse to the client +func (o *GetLoggedInAdminUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go new file mode 100644 index 00000000000..8be42303ee6 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/user/get_logged_in_admin_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package user + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetLoggedInAdminUserURL generates an URL for the get logged in admin user operation +type GetLoggedInAdminUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLoggedInAdminUserURL) WithBasePath(bp string) *GetLoggedInAdminUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLoggedInAdminUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetLoggedInAdminUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/user" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetLoggedInAdminUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetLoggedInAdminUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetLoggedInAdminUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetLoggedInAdminUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetLoggedInAdminUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetLoggedInAdminUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user.go b/pkg/gen/adminapi/adminoperations/users/get_user.go new file mode 100644 index 00000000000..12fff9039fa --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/get_user.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetUserHandlerFunc turns a function with the right signature into a get user handler +type GetUserHandlerFunc func(GetUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetUserHandlerFunc) Handle(params GetUserParams) middleware.Responder { + return fn(params) +} + +// GetUserHandler interface for that can handle valid get user params +type GetUserHandler interface { + Handle(GetUserParams) middleware.Responder +} + +// NewGetUser creates a new http.Handler for the get user operation +func NewGetUser(ctx *middleware.Context, handler GetUserHandler) *GetUser { + return &GetUser{Context: ctx, Handler: handler} +} + +/* + GetUser swagger:route GET /users/{userId} Users getUser + +# Get information about a User + +This endpoint returns a single User by ID. This also returns the User's sessions +as well. Do not use this endpoint directly as it is meant to be used with the +Admin UI exclusively. +*/ +type GetUser struct { + Context *middleware.Context + Handler GetUserHandler +} + +func (o *GetUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go b/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go new file mode 100644 index 00000000000..c712f83989f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/get_user_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetUserParams creates a new GetUserParams object +// +// There are no default values defined in the spec. +func NewGetUserParams() GetUserParams { + + return GetUserParams{} +} + +// GetUserParams contains all the bound params for the get user operation +// typically these are obtained from a http.Request +// +// swagger:parameters getUser +type GetUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + UserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetUserParams() beforehand. +func (o *GetUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rUserID, rhkUserID, _ := route.Params.GetOK("userId") + if err := o.bindUserID(rUserID, rhkUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindUserID binds and validates parameter UserID from path. +func (o *GetUserParams) bindUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("userId", "path", "strfmt.UUID", raw) + } + o.UserID = *(value.(*strfmt.UUID)) + + if err := o.validateUserID(formats); err != nil { + return err + } + + return nil +} + +// validateUserID carries on validations for parameter UserID +func (o *GetUserParams) validateUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("userId", "path", "uuid", o.UserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_responses.go b/pkg/gen/adminapi/adminoperations/users/get_user_responses.go new file mode 100644 index 00000000000..32d1eb9e0fb --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/get_user_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetUserOKCode is the HTTP code returned for type GetUserOK +const GetUserOKCode int = 200 + +/* +GetUserOK success + +swagger:response getUserOK +*/ +type GetUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.User `json:"body,omitempty"` +} + +// NewGetUserOK creates GetUserOK with default headers values +func NewGetUserOK() *GetUserOK { + + return &GetUserOK{} +} + +// WithPayload adds the payload to the get user o k response +func (o *GetUserOK) WithPayload(payload *adminmessages.User) *GetUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get user o k response +func (o *GetUserOK) SetPayload(payload *adminmessages.User) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUserBadRequestCode is the HTTP code returned for type GetUserBadRequest +const GetUserBadRequestCode int = 400 + +/* +GetUserBadRequest invalid request + +swagger:response getUserBadRequest +*/ +type GetUserBadRequest struct { +} + +// NewGetUserBadRequest creates GetUserBadRequest with default headers values +func NewGetUserBadRequest() *GetUserBadRequest { + + return &GetUserBadRequest{} +} + +// WriteResponse to the client +func (o *GetUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetUserUnauthorizedCode is the HTTP code returned for type GetUserUnauthorized +const GetUserUnauthorizedCode int = 401 + +/* +GetUserUnauthorized request requires user authentication + +swagger:response getUserUnauthorized +*/ +type GetUserUnauthorized struct { +} + +// NewGetUserUnauthorized creates GetUserUnauthorized with default headers values +func NewGetUserUnauthorized() *GetUserUnauthorized { + + return &GetUserUnauthorized{} +} + +// WriteResponse to the client +func (o *GetUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetUserNotFoundCode is the HTTP code returned for type GetUserNotFound +const GetUserNotFoundCode int = 404 + +/* +GetUserNotFound User not found + +swagger:response getUserNotFound +*/ +type GetUserNotFound struct { +} + +// NewGetUserNotFound creates GetUserNotFound with default headers values +func NewGetUserNotFound() *GetUserNotFound { + + return &GetUserNotFound{} +} + +// WriteResponse to the client +func (o *GetUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetUserInternalServerErrorCode is the HTTP code returned for type GetUserInternalServerError +const GetUserInternalServerErrorCode int = 500 + +/* +GetUserInternalServerError server error + +swagger:response getUserInternalServerError +*/ +type GetUserInternalServerError struct { +} + +// NewGetUserInternalServerError creates GetUserInternalServerError with default headers values +func NewGetUserInternalServerError() *GetUserInternalServerError { + + return &GetUserInternalServerError{} +} + +// WriteResponse to the client +func (o *GetUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go new file mode 100644 index 00000000000..9805e8a2ef8 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/get_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetUserURL generates an URL for the get user operation +type GetUserURL struct { + UserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUserURL) WithBasePath(bp string) *GetUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/users/{userId}" + + userID := o.UserID.String() + if userID != "" { + _path = strings.Replace(_path, "{userId}", userID, -1) + } else { + return nil, errors.New("userId is required on GetUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users.go b/pkg/gen/adminapi/adminoperations/users/index_users.go new file mode 100644 index 00000000000..64f2672aeb5 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/index_users.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexUsersHandlerFunc turns a function with the right signature into a index users handler +type IndexUsersHandlerFunc func(IndexUsersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexUsersHandlerFunc) Handle(params IndexUsersParams) middleware.Responder { + return fn(params) +} + +// IndexUsersHandler interface for that can handle valid index users params +type IndexUsersHandler interface { + Handle(IndexUsersParams) middleware.Responder +} + +// NewIndexUsers creates a new http.Handler for the index users operation +func NewIndexUsers(ctx *middleware.Context, handler IndexUsersHandler) *IndexUsers { + return &IndexUsers{Context: ctx, Handler: handler} +} + +/* + IndexUsers swagger:route GET /users Users indexUsers + +# List Users + +This endpoint returns a list of Users. Do not use this endpoint directly as it +is meant to be used with the Admin UI exclusively. +*/ +type IndexUsers struct { + Context *middleware.Context + Handler IndexUsersHandler +} + +func (o *IndexUsers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexUsersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go b/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go new file mode 100644 index 00000000000..cca50547e61 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/index_users_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexUsersParams creates a new IndexUsersParams object +// +// There are no default values defined in the spec. +func NewIndexUsersParams() IndexUsersParams { + + return IndexUsersParams{} +} + +// IndexUsersParams contains all the bound params for the index users operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexUsers +type IndexUsersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexUsersParams() beforehand. +func (o *IndexUsersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexUsersParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexUsersParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexUsersParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexUsersParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexUsersParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_responses.go b/pkg/gen/adminapi/adminoperations/users/index_users_responses.go new file mode 100644 index 00000000000..68090209a4d --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/index_users_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexUsersOKCode is the HTTP code returned for type IndexUsersOK +const IndexUsersOKCode int = 200 + +/* +IndexUsersOK success + +swagger:response indexUsersOK +*/ +type IndexUsersOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.Users `json:"body,omitempty"` +} + +// NewIndexUsersOK creates IndexUsersOK with default headers values +func NewIndexUsersOK() *IndexUsersOK { + + return &IndexUsersOK{} +} + +// WithContentRange adds the contentRange to the index users o k response +func (o *IndexUsersOK) WithContentRange(contentRange string) *IndexUsersOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index users o k response +func (o *IndexUsersOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index users o k response +func (o *IndexUsersOK) WithPayload(payload adminmessages.Users) *IndexUsersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index users o k response +func (o *IndexUsersOK) SetPayload(payload adminmessages.Users) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexUsersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.Users{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexUsersBadRequestCode is the HTTP code returned for type IndexUsersBadRequest +const IndexUsersBadRequestCode int = 400 + +/* +IndexUsersBadRequest invalid request + +swagger:response indexUsersBadRequest +*/ +type IndexUsersBadRequest struct { +} + +// NewIndexUsersBadRequest creates IndexUsersBadRequest with default headers values +func NewIndexUsersBadRequest() *IndexUsersBadRequest { + + return &IndexUsersBadRequest{} +} + +// WriteResponse to the client +func (o *IndexUsersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexUsersUnauthorizedCode is the HTTP code returned for type IndexUsersUnauthorized +const IndexUsersUnauthorizedCode int = 401 + +/* +IndexUsersUnauthorized request requires user authentication + +swagger:response indexUsersUnauthorized +*/ +type IndexUsersUnauthorized struct { +} + +// NewIndexUsersUnauthorized creates IndexUsersUnauthorized with default headers values +func NewIndexUsersUnauthorized() *IndexUsersUnauthorized { + + return &IndexUsersUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexUsersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexUsersNotFoundCode is the HTTP code returned for type IndexUsersNotFound +const IndexUsersNotFoundCode int = 404 + +/* +IndexUsersNotFound Users not found + +swagger:response indexUsersNotFound +*/ +type IndexUsersNotFound struct { +} + +// NewIndexUsersNotFound creates IndexUsersNotFound with default headers values +func NewIndexUsersNotFound() *IndexUsersNotFound { + + return &IndexUsersNotFound{} +} + +// WriteResponse to the client +func (o *IndexUsersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexUsersInternalServerErrorCode is the HTTP code returned for type IndexUsersInternalServerError +const IndexUsersInternalServerErrorCode int = 500 + +/* +IndexUsersInternalServerError server error + +swagger:response indexUsersInternalServerError +*/ +type IndexUsersInternalServerError struct { +} + +// NewIndexUsersInternalServerError creates IndexUsersInternalServerError with default headers values +func NewIndexUsersInternalServerError() *IndexUsersInternalServerError { + + return &IndexUsersInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexUsersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go new file mode 100644 index 00000000000..2c8beeecd36 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/index_users_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexUsersURL generates an URL for the index users operation +type IndexUsersURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexUsersURL) WithBasePath(bp string) *IndexUsersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexUsersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexUsersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexUsersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexUsersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexUsersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexUsersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexUsersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexUsersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user.go b/pkg/gen/adminapi/adminoperations/users/update_user.go new file mode 100644 index 00000000000..ac2a01845f1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/update_user.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateUserHandlerFunc turns a function with the right signature into a update user handler +type UpdateUserHandlerFunc func(UpdateUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateUserHandlerFunc) Handle(params UpdateUserParams) middleware.Responder { + return fn(params) +} + +// UpdateUserHandler interface for that can handle valid update user params +type UpdateUserHandler interface { + Handle(UpdateUserParams) middleware.Responder +} + +// NewUpdateUser creates a new http.Handler for the update user operation +func NewUpdateUser(ctx *middleware.Context, handler UpdateUserHandler) *UpdateUser { + return &UpdateUser{Context: ctx, Handler: handler} +} + +/* + UpdateUser swagger:route PATCH /users/{userId} Users updateUser + +# Update a User's session or active status + +This endpoint updates a single User by ID. This can be used by the Admin User to +update the User's session or the User's active status. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type UpdateUser struct { + Context *middleware.Context + Handler UpdateUserHandler +} + +func (o *UpdateUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go b/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go new file mode 100644 index 00000000000..afb57f89871 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/update_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateUserParams creates a new UpdateUserParams object +// +// There are no default values defined in the spec. +func NewUpdateUserParams() UpdateUserParams { + + return UpdateUserParams{} +} + +// UpdateUserParams contains all the bound params for the update user operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateUser +type UpdateUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*User information + Required: true + In: body + */ + User *adminmessages.UserUpdate + /* + Required: true + In: path + */ + UserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateUserParams() beforehand. +func (o *UpdateUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.UserUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("user", "body", "")) + } else { + res = append(res, errors.NewParseError("user", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.User = &body + } + } + } else { + res = append(res, errors.Required("user", "body", "")) + } + + rUserID, rhkUserID, _ := route.Params.GetOK("userId") + if err := o.bindUserID(rUserID, rhkUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindUserID binds and validates parameter UserID from path. +func (o *UpdateUserParams) bindUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("userId", "path", "strfmt.UUID", raw) + } + o.UserID = *(value.(*strfmt.UUID)) + + if err := o.validateUserID(formats); err != nil { + return err + } + + return nil +} + +// validateUserID carries on validations for parameter UserID +func (o *UpdateUserParams) validateUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("userId", "path", "uuid", o.UserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_responses.go b/pkg/gen/adminapi/adminoperations/users/update_user_responses.go new file mode 100644 index 00000000000..9dc51b7e276 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/update_user_responses.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateUserOKCode is the HTTP code returned for type UpdateUserOK +const UpdateUserOKCode int = 200 + +/* +UpdateUserOK Successfully updated User + +swagger:response updateUserOK +*/ +type UpdateUserOK struct { + + /* + In: Body + */ + Payload *adminmessages.User `json:"body,omitempty"` +} + +// NewUpdateUserOK creates UpdateUserOK with default headers values +func NewUpdateUserOK() *UpdateUserOK { + + return &UpdateUserOK{} +} + +// WithPayload adds the payload to the update user o k response +func (o *UpdateUserOK) WithPayload(payload *adminmessages.User) *UpdateUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update user o k response +func (o *UpdateUserOK) SetPayload(payload *adminmessages.User) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateUserBadRequestCode is the HTTP code returned for type UpdateUserBadRequest +const UpdateUserBadRequestCode int = 400 + +/* +UpdateUserBadRequest Invalid Request + +swagger:response updateUserBadRequest +*/ +type UpdateUserBadRequest struct { +} + +// NewUpdateUserBadRequest creates UpdateUserBadRequest with default headers values +func NewUpdateUserBadRequest() *UpdateUserBadRequest { + + return &UpdateUserBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateUserUnauthorizedCode is the HTTP code returned for type UpdateUserUnauthorized +const UpdateUserUnauthorizedCode int = 401 + +/* +UpdateUserUnauthorized Must be authenticated to use this end point + +swagger:response updateUserUnauthorized +*/ +type UpdateUserUnauthorized struct { +} + +// NewUpdateUserUnauthorized creates UpdateUserUnauthorized with default headers values +func NewUpdateUserUnauthorized() *UpdateUserUnauthorized { + + return &UpdateUserUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateUserForbiddenCode is the HTTP code returned for type UpdateUserForbidden +const UpdateUserForbiddenCode int = 403 + +/* +UpdateUserForbidden Not authorized to update this User + +swagger:response updateUserForbidden +*/ +type UpdateUserForbidden struct { +} + +// NewUpdateUserForbidden creates UpdateUserForbidden with default headers values +func NewUpdateUserForbidden() *UpdateUserForbidden { + + return &UpdateUserForbidden{} +} + +// WriteResponse to the client +func (o *UpdateUserForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateUserNotFoundCode is the HTTP code returned for type UpdateUserNotFound +const UpdateUserNotFoundCode int = 404 + +/* +UpdateUserNotFound Not found + +swagger:response updateUserNotFound +*/ +type UpdateUserNotFound struct { +} + +// NewUpdateUserNotFound creates UpdateUserNotFound with default headers values +func NewUpdateUserNotFound() *UpdateUserNotFound { + + return &UpdateUserNotFound{} +} + +// WriteResponse to the client +func (o *UpdateUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateUserUnprocessableEntityCode is the HTTP code returned for type UpdateUserUnprocessableEntity +const UpdateUserUnprocessableEntityCode int = 422 + +/* +UpdateUserUnprocessableEntity Validation error + +swagger:response updateUserUnprocessableEntity +*/ +type UpdateUserUnprocessableEntity struct { + + /* + In: Body + */ + Payload *adminmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateUserUnprocessableEntity creates UpdateUserUnprocessableEntity with default headers values +func NewUpdateUserUnprocessableEntity() *UpdateUserUnprocessableEntity { + + return &UpdateUserUnprocessableEntity{} +} + +// WithPayload adds the payload to the update user unprocessable entity response +func (o *UpdateUserUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateUserUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update user unprocessable entity response +func (o *UpdateUserUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateUserInternalServerErrorCode is the HTTP code returned for type UpdateUserInternalServerError +const UpdateUserInternalServerErrorCode int = 500 + +/* +UpdateUserInternalServerError Server error + +swagger:response updateUserInternalServerError +*/ +type UpdateUserInternalServerError struct { +} + +// NewUpdateUserInternalServerError creates UpdateUserInternalServerError with default headers values +func NewUpdateUserInternalServerError() *UpdateUserInternalServerError { + + return &UpdateUserInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go b/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go new file mode 100644 index 00000000000..bc5cf0a2e64 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/users/update_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateUserURL generates an URL for the update user operation +type UpdateUserURL struct { + UserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateUserURL) WithBasePath(bp string) *UpdateUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/users/{userId}" + + userID := o.UserID.String() + if userID != "" { + _path = strings.Replace(_path, "{userId}", userID, -1) + } else { + return nil, errors.New("userId is required on UpdateUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go new file mode 100644 index 00000000000..1a9860585aa --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateWebhookSubscriptionHandlerFunc turns a function with the right signature into a create webhook subscription handler +type CreateWebhookSubscriptionHandlerFunc func(CreateWebhookSubscriptionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateWebhookSubscriptionHandlerFunc) Handle(params CreateWebhookSubscriptionParams) middleware.Responder { + return fn(params) +} + +// CreateWebhookSubscriptionHandler interface for that can handle valid create webhook subscription params +type CreateWebhookSubscriptionHandler interface { + Handle(CreateWebhookSubscriptionParams) middleware.Responder +} + +// NewCreateWebhookSubscription creates a new http.Handler for the create webhook subscription operation +func NewCreateWebhookSubscription(ctx *middleware.Context, handler CreateWebhookSubscriptionHandler) *CreateWebhookSubscription { + return &CreateWebhookSubscription{Context: ctx, Handler: handler} +} + +/* + CreateWebhookSubscription swagger:route POST /webhook-subscriptions Webhook subscriptions createWebhookSubscription + +# Create a Webhook Subscription + +This endpoint creates a Webhook Subscription and returns the created record in +the `201` response. Do not use this endpoint directly as it is meant to be used +with the Admin UI exclusively. +*/ +type CreateWebhookSubscription struct { + Context *middleware.Context + Handler CreateWebhookSubscriptionHandler +} + +func (o *CreateWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateWebhookSubscriptionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go new file mode 100644 index 00000000000..0975e49e655 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewCreateWebhookSubscriptionParams creates a new CreateWebhookSubscriptionParams object +// +// There are no default values defined in the spec. +func NewCreateWebhookSubscriptionParams() CreateWebhookSubscriptionParams { + + return CreateWebhookSubscriptionParams{} +} + +// CreateWebhookSubscriptionParams contains all the bound params for the create webhook subscription operation +// typically these are obtained from a http.Request +// +// swagger:parameters createWebhookSubscription +type CreateWebhookSubscriptionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Webhook subscription information + In: body + */ + WebhookSubscription *adminmessages.CreateWebhookSubscription +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateWebhookSubscriptionParams() beforehand. +func (o *CreateWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.CreateWebhookSubscription + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("webhookSubscription", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.WebhookSubscription = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go new file mode 100644 index 00000000000..f98333cce70 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// CreateWebhookSubscriptionCreatedCode is the HTTP code returned for type CreateWebhookSubscriptionCreated +const CreateWebhookSubscriptionCreatedCode int = 201 + +/* +CreateWebhookSubscriptionCreated Successfully created Webhook Subscription + +swagger:response createWebhookSubscriptionCreated +*/ +type CreateWebhookSubscriptionCreated struct { + + /* + In: Body + */ + Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` +} + +// NewCreateWebhookSubscriptionCreated creates CreateWebhookSubscriptionCreated with default headers values +func NewCreateWebhookSubscriptionCreated() *CreateWebhookSubscriptionCreated { + + return &CreateWebhookSubscriptionCreated{} +} + +// WithPayload adds the payload to the create webhook subscription created response +func (o *CreateWebhookSubscriptionCreated) WithPayload(payload *adminmessages.WebhookSubscription) *CreateWebhookSubscriptionCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create webhook subscription created response +func (o *CreateWebhookSubscriptionCreated) SetPayload(payload *adminmessages.WebhookSubscription) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWebhookSubscriptionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWebhookSubscriptionBadRequestCode is the HTTP code returned for type CreateWebhookSubscriptionBadRequest +const CreateWebhookSubscriptionBadRequestCode int = 400 + +/* +CreateWebhookSubscriptionBadRequest Invalid Request + +swagger:response createWebhookSubscriptionBadRequest +*/ +type CreateWebhookSubscriptionBadRequest struct { +} + +// NewCreateWebhookSubscriptionBadRequest creates CreateWebhookSubscriptionBadRequest with default headers values +func NewCreateWebhookSubscriptionBadRequest() *CreateWebhookSubscriptionBadRequest { + + return &CreateWebhookSubscriptionBadRequest{} +} + +// WriteResponse to the client +func (o *CreateWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type CreateWebhookSubscriptionUnauthorized +const CreateWebhookSubscriptionUnauthorizedCode int = 401 + +/* +CreateWebhookSubscriptionUnauthorized Must be authenticated to use this end point + +swagger:response createWebhookSubscriptionUnauthorized +*/ +type CreateWebhookSubscriptionUnauthorized struct { +} + +// NewCreateWebhookSubscriptionUnauthorized creates CreateWebhookSubscriptionUnauthorized with default headers values +func NewCreateWebhookSubscriptionUnauthorized() *CreateWebhookSubscriptionUnauthorized { + + return &CreateWebhookSubscriptionUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateWebhookSubscriptionForbiddenCode is the HTTP code returned for type CreateWebhookSubscriptionForbidden +const CreateWebhookSubscriptionForbiddenCode int = 403 + +/* +CreateWebhookSubscriptionForbidden Not authorized to create a Webhook Subscription + +swagger:response createWebhookSubscriptionForbidden +*/ +type CreateWebhookSubscriptionForbidden struct { +} + +// NewCreateWebhookSubscriptionForbidden creates CreateWebhookSubscriptionForbidden with default headers values +func NewCreateWebhookSubscriptionForbidden() *CreateWebhookSubscriptionForbidden { + + return &CreateWebhookSubscriptionForbidden{} +} + +// WriteResponse to the client +func (o *CreateWebhookSubscriptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type CreateWebhookSubscriptionInternalServerError +const CreateWebhookSubscriptionInternalServerErrorCode int = 500 + +/* +CreateWebhookSubscriptionInternalServerError Server error + +swagger:response createWebhookSubscriptionInternalServerError +*/ +type CreateWebhookSubscriptionInternalServerError struct { +} + +// NewCreateWebhookSubscriptionInternalServerError creates CreateWebhookSubscriptionInternalServerError with default headers values +func NewCreateWebhookSubscriptionInternalServerError() *CreateWebhookSubscriptionInternalServerError { + + return &CreateWebhookSubscriptionInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go new file mode 100644 index 00000000000..e7eb51421fe --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/create_webhook_subscription_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateWebhookSubscriptionURL generates an URL for the create webhook subscription operation +type CreateWebhookSubscriptionURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWebhookSubscriptionURL) WithBasePath(bp string) *CreateWebhookSubscriptionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWebhookSubscriptionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateWebhookSubscriptionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-subscriptions" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateWebhookSubscriptionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateWebhookSubscriptionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateWebhookSubscriptionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateWebhookSubscriptionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go new file mode 100644 index 00000000000..00c08b15816 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetWebhookSubscriptionHandlerFunc turns a function with the right signature into a get webhook subscription handler +type GetWebhookSubscriptionHandlerFunc func(GetWebhookSubscriptionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetWebhookSubscriptionHandlerFunc) Handle(params GetWebhookSubscriptionParams) middleware.Responder { + return fn(params) +} + +// GetWebhookSubscriptionHandler interface for that can handle valid get webhook subscription params +type GetWebhookSubscriptionHandler interface { + Handle(GetWebhookSubscriptionParams) middleware.Responder +} + +// NewGetWebhookSubscription creates a new http.Handler for the get webhook subscription operation +func NewGetWebhookSubscription(ctx *middleware.Context, handler GetWebhookSubscriptionHandler) *GetWebhookSubscription { + return &GetWebhookSubscription{Context: ctx, Handler: handler} +} + +/* + GetWebhookSubscription swagger:route GET /webhook-subscriptions/{webhookSubscriptionId} Webhook subscriptions getWebhookSubscription + +# Get information about a Webhook Subscription + +This endpoint returns a single Webhook Subscription by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type GetWebhookSubscription struct { + Context *middleware.Context + Handler GetWebhookSubscriptionHandler +} + +func (o *GetWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetWebhookSubscriptionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go new file mode 100644 index 00000000000..fc6b2e0649b --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetWebhookSubscriptionParams creates a new GetWebhookSubscriptionParams object +// +// There are no default values defined in the spec. +func NewGetWebhookSubscriptionParams() GetWebhookSubscriptionParams { + + return GetWebhookSubscriptionParams{} +} + +// GetWebhookSubscriptionParams contains all the bound params for the get webhook subscription operation +// typically these are obtained from a http.Request +// +// swagger:parameters getWebhookSubscription +type GetWebhookSubscriptionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + WebhookSubscriptionID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetWebhookSubscriptionParams() beforehand. +func (o *GetWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rWebhookSubscriptionID, rhkWebhookSubscriptionID, _ := route.Params.GetOK("webhookSubscriptionId") + if err := o.bindWebhookSubscriptionID(rWebhookSubscriptionID, rhkWebhookSubscriptionID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindWebhookSubscriptionID binds and validates parameter WebhookSubscriptionID from path. +func (o *GetWebhookSubscriptionParams) bindWebhookSubscriptionID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("webhookSubscriptionId", "path", "strfmt.UUID", raw) + } + o.WebhookSubscriptionID = *(value.(*strfmt.UUID)) + + if err := o.validateWebhookSubscriptionID(formats); err != nil { + return err + } + + return nil +} + +// validateWebhookSubscriptionID carries on validations for parameter WebhookSubscriptionID +func (o *GetWebhookSubscriptionParams) validateWebhookSubscriptionID(formats strfmt.Registry) error { + + if err := validate.FormatOf("webhookSubscriptionId", "path", "uuid", o.WebhookSubscriptionID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go new file mode 100644 index 00000000000..2b6837397dd --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// GetWebhookSubscriptionOKCode is the HTTP code returned for type GetWebhookSubscriptionOK +const GetWebhookSubscriptionOKCode int = 200 + +/* +GetWebhookSubscriptionOK success + +swagger:response getWebhookSubscriptionOK +*/ +type GetWebhookSubscriptionOK struct { + + /* + In: Body + */ + Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` +} + +// NewGetWebhookSubscriptionOK creates GetWebhookSubscriptionOK with default headers values +func NewGetWebhookSubscriptionOK() *GetWebhookSubscriptionOK { + + return &GetWebhookSubscriptionOK{} +} + +// WithPayload adds the payload to the get webhook subscription o k response +func (o *GetWebhookSubscriptionOK) WithPayload(payload *adminmessages.WebhookSubscription) *GetWebhookSubscriptionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get webhook subscription o k response +func (o *GetWebhookSubscriptionOK) SetPayload(payload *adminmessages.WebhookSubscription) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetWebhookSubscriptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetWebhookSubscriptionBadRequestCode is the HTTP code returned for type GetWebhookSubscriptionBadRequest +const GetWebhookSubscriptionBadRequestCode int = 400 + +/* +GetWebhookSubscriptionBadRequest invalid request + +swagger:response getWebhookSubscriptionBadRequest +*/ +type GetWebhookSubscriptionBadRequest struct { +} + +// NewGetWebhookSubscriptionBadRequest creates GetWebhookSubscriptionBadRequest with default headers values +func NewGetWebhookSubscriptionBadRequest() *GetWebhookSubscriptionBadRequest { + + return &GetWebhookSubscriptionBadRequest{} +} + +// WriteResponse to the client +func (o *GetWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type GetWebhookSubscriptionUnauthorized +const GetWebhookSubscriptionUnauthorizedCode int = 401 + +/* +GetWebhookSubscriptionUnauthorized request requires user authentication + +swagger:response getWebhookSubscriptionUnauthorized +*/ +type GetWebhookSubscriptionUnauthorized struct { +} + +// NewGetWebhookSubscriptionUnauthorized creates GetWebhookSubscriptionUnauthorized with default headers values +func NewGetWebhookSubscriptionUnauthorized() *GetWebhookSubscriptionUnauthorized { + + return &GetWebhookSubscriptionUnauthorized{} +} + +// WriteResponse to the client +func (o *GetWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetWebhookSubscriptionNotFoundCode is the HTTP code returned for type GetWebhookSubscriptionNotFound +const GetWebhookSubscriptionNotFoundCode int = 404 + +/* +GetWebhookSubscriptionNotFound Webhook Subscription not found + +swagger:response getWebhookSubscriptionNotFound +*/ +type GetWebhookSubscriptionNotFound struct { +} + +// NewGetWebhookSubscriptionNotFound creates GetWebhookSubscriptionNotFound with default headers values +func NewGetWebhookSubscriptionNotFound() *GetWebhookSubscriptionNotFound { + + return &GetWebhookSubscriptionNotFound{} +} + +// WriteResponse to the client +func (o *GetWebhookSubscriptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// GetWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type GetWebhookSubscriptionInternalServerError +const GetWebhookSubscriptionInternalServerErrorCode int = 500 + +/* +GetWebhookSubscriptionInternalServerError server error + +swagger:response getWebhookSubscriptionInternalServerError +*/ +type GetWebhookSubscriptionInternalServerError struct { +} + +// NewGetWebhookSubscriptionInternalServerError creates GetWebhookSubscriptionInternalServerError with default headers values +func NewGetWebhookSubscriptionInternalServerError() *GetWebhookSubscriptionInternalServerError { + + return &GetWebhookSubscriptionInternalServerError{} +} + +// WriteResponse to the client +func (o *GetWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go new file mode 100644 index 00000000000..433880f27d1 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/get_webhook_subscription_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetWebhookSubscriptionURL generates an URL for the get webhook subscription operation +type GetWebhookSubscriptionURL struct { + WebhookSubscriptionID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetWebhookSubscriptionURL) WithBasePath(bp string) *GetWebhookSubscriptionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetWebhookSubscriptionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetWebhookSubscriptionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-subscriptions/{webhookSubscriptionId}" + + webhookSubscriptionID := o.WebhookSubscriptionID.String() + if webhookSubscriptionID != "" { + _path = strings.Replace(_path, "{webhookSubscriptionId}", webhookSubscriptionID, -1) + } else { + return nil, errors.New("webhookSubscriptionId is required on GetWebhookSubscriptionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetWebhookSubscriptionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetWebhookSubscriptionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetWebhookSubscriptionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetWebhookSubscriptionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go new file mode 100644 index 00000000000..cfcd49ed6d0 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexWebhookSubscriptionsHandlerFunc turns a function with the right signature into a index webhook subscriptions handler +type IndexWebhookSubscriptionsHandlerFunc func(IndexWebhookSubscriptionsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexWebhookSubscriptionsHandlerFunc) Handle(params IndexWebhookSubscriptionsParams) middleware.Responder { + return fn(params) +} + +// IndexWebhookSubscriptionsHandler interface for that can handle valid index webhook subscriptions params +type IndexWebhookSubscriptionsHandler interface { + Handle(IndexWebhookSubscriptionsParams) middleware.Responder +} + +// NewIndexWebhookSubscriptions creates a new http.Handler for the index webhook subscriptions operation +func NewIndexWebhookSubscriptions(ctx *middleware.Context, handler IndexWebhookSubscriptionsHandler) *IndexWebhookSubscriptions { + return &IndexWebhookSubscriptions{Context: ctx, Handler: handler} +} + +/* + IndexWebhookSubscriptions swagger:route GET /webhook-subscriptions Webhook subscriptions indexWebhookSubscriptions + +# Lists Webhook Subscriptions + +This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint +directly as it is meant to be used with the Admin UI exclusively. +*/ +type IndexWebhookSubscriptions struct { + Context *middleware.Context + Handler IndexWebhookSubscriptionsHandler +} + +func (o *IndexWebhookSubscriptions) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexWebhookSubscriptionsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go new file mode 100644 index 00000000000..4a772c8782c --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewIndexWebhookSubscriptionsParams creates a new IndexWebhookSubscriptionsParams object +// +// There are no default values defined in the spec. +func NewIndexWebhookSubscriptionsParams() IndexWebhookSubscriptionsParams { + + return IndexWebhookSubscriptionsParams{} +} + +// IndexWebhookSubscriptionsParams contains all the bound params for the index webhook subscriptions operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexWebhookSubscriptions +type IndexWebhookSubscriptionsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + Filter *string + /* + In: query + */ + Order *bool + /* + In: query + */ + Page *int64 + /* + In: query + */ + PerPage *int64 + /* + In: query + */ + Sort *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexWebhookSubscriptionsParams() beforehand. +func (o *IndexWebhookSubscriptionsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qFilter, qhkFilter, _ := qs.GetOK("filter") + if err := o.bindFilter(qFilter, qhkFilter, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFilter binds and validates parameter Filter from query. +func (o *IndexWebhookSubscriptionsParams) bindFilter(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Filter = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *IndexWebhookSubscriptionsParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("order", "query", "bool", raw) + } + o.Order = &value + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *IndexWebhookSubscriptionsParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *IndexWebhookSubscriptionsParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *IndexWebhookSubscriptionsParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go new file mode 100644 index 00000000000..c021e842203 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// IndexWebhookSubscriptionsOKCode is the HTTP code returned for type IndexWebhookSubscriptionsOK +const IndexWebhookSubscriptionsOKCode int = 200 + +/* +IndexWebhookSubscriptionsOK success + +swagger:response indexWebhookSubscriptionsOK +*/ +type IndexWebhookSubscriptionsOK struct { + /*Used for pagination + + */ + ContentRange string `json:"Content-Range"` + + /* + In: Body + */ + Payload adminmessages.WebhookSubscriptions `json:"body,omitempty"` +} + +// NewIndexWebhookSubscriptionsOK creates IndexWebhookSubscriptionsOK with default headers values +func NewIndexWebhookSubscriptionsOK() *IndexWebhookSubscriptionsOK { + + return &IndexWebhookSubscriptionsOK{} +} + +// WithContentRange adds the contentRange to the index webhook subscriptions o k response +func (o *IndexWebhookSubscriptionsOK) WithContentRange(contentRange string) *IndexWebhookSubscriptionsOK { + o.ContentRange = contentRange + return o +} + +// SetContentRange sets the contentRange to the index webhook subscriptions o k response +func (o *IndexWebhookSubscriptionsOK) SetContentRange(contentRange string) { + o.ContentRange = contentRange +} + +// WithPayload adds the payload to the index webhook subscriptions o k response +func (o *IndexWebhookSubscriptionsOK) WithPayload(payload adminmessages.WebhookSubscriptions) *IndexWebhookSubscriptionsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index webhook subscriptions o k response +func (o *IndexWebhookSubscriptionsOK) SetPayload(payload adminmessages.WebhookSubscriptions) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexWebhookSubscriptionsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Range + + contentRange := o.ContentRange + if contentRange != "" { + rw.Header().Set("Content-Range", contentRange) + } + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = adminmessages.WebhookSubscriptions{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexWebhookSubscriptionsBadRequestCode is the HTTP code returned for type IndexWebhookSubscriptionsBadRequest +const IndexWebhookSubscriptionsBadRequestCode int = 400 + +/* +IndexWebhookSubscriptionsBadRequest Invalid request + +swagger:response indexWebhookSubscriptionsBadRequest +*/ +type IndexWebhookSubscriptionsBadRequest struct { +} + +// NewIndexWebhookSubscriptionsBadRequest creates IndexWebhookSubscriptionsBadRequest with default headers values +func NewIndexWebhookSubscriptionsBadRequest() *IndexWebhookSubscriptionsBadRequest { + + return &IndexWebhookSubscriptionsBadRequest{} +} + +// WriteResponse to the client +func (o *IndexWebhookSubscriptionsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexWebhookSubscriptionsUnauthorizedCode is the HTTP code returned for type IndexWebhookSubscriptionsUnauthorized +const IndexWebhookSubscriptionsUnauthorizedCode int = 401 + +/* +IndexWebhookSubscriptionsUnauthorized Not authenticated for this endpoint + +swagger:response indexWebhookSubscriptionsUnauthorized +*/ +type IndexWebhookSubscriptionsUnauthorized struct { +} + +// NewIndexWebhookSubscriptionsUnauthorized creates IndexWebhookSubscriptionsUnauthorized with default headers values +func NewIndexWebhookSubscriptionsUnauthorized() *IndexWebhookSubscriptionsUnauthorized { + + return &IndexWebhookSubscriptionsUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexWebhookSubscriptionsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexWebhookSubscriptionsNotFoundCode is the HTTP code returned for type IndexWebhookSubscriptionsNotFound +const IndexWebhookSubscriptionsNotFoundCode int = 404 + +/* +IndexWebhookSubscriptionsNotFound Webhook Subscriptions not found + +swagger:response indexWebhookSubscriptionsNotFound +*/ +type IndexWebhookSubscriptionsNotFound struct { +} + +// NewIndexWebhookSubscriptionsNotFound creates IndexWebhookSubscriptionsNotFound with default headers values +func NewIndexWebhookSubscriptionsNotFound() *IndexWebhookSubscriptionsNotFound { + + return &IndexWebhookSubscriptionsNotFound{} +} + +// WriteResponse to the client +func (o *IndexWebhookSubscriptionsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexWebhookSubscriptionsInternalServerErrorCode is the HTTP code returned for type IndexWebhookSubscriptionsInternalServerError +const IndexWebhookSubscriptionsInternalServerErrorCode int = 500 + +/* +IndexWebhookSubscriptionsInternalServerError Server error + +swagger:response indexWebhookSubscriptionsInternalServerError +*/ +type IndexWebhookSubscriptionsInternalServerError struct { +} + +// NewIndexWebhookSubscriptionsInternalServerError creates IndexWebhookSubscriptionsInternalServerError with default headers values +func NewIndexWebhookSubscriptionsInternalServerError() *IndexWebhookSubscriptionsInternalServerError { + + return &IndexWebhookSubscriptionsInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexWebhookSubscriptionsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go new file mode 100644 index 00000000000..1da7c9f4715 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/index_webhook_subscriptions_urlbuilder.go @@ -0,0 +1,141 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// IndexWebhookSubscriptionsURL generates an URL for the index webhook subscriptions operation +type IndexWebhookSubscriptionsURL struct { + Filter *string + Order *bool + Page *int64 + PerPage *int64 + Sort *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexWebhookSubscriptionsURL) WithBasePath(bp string) *IndexWebhookSubscriptionsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexWebhookSubscriptionsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexWebhookSubscriptionsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-subscriptions" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var filterQ string + if o.Filter != nil { + filterQ = *o.Filter + } + if filterQ != "" { + qs.Set("filter", filterQ) + } + + var orderQ string + if o.Order != nil { + orderQ = swag.FormatBool(*o.Order) + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexWebhookSubscriptionsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexWebhookSubscriptionsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexWebhookSubscriptionsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexWebhookSubscriptionsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexWebhookSubscriptionsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexWebhookSubscriptionsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go new file mode 100644 index 00000000000..51c32be2f80 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateWebhookSubscriptionHandlerFunc turns a function with the right signature into a update webhook subscription handler +type UpdateWebhookSubscriptionHandlerFunc func(UpdateWebhookSubscriptionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateWebhookSubscriptionHandlerFunc) Handle(params UpdateWebhookSubscriptionParams) middleware.Responder { + return fn(params) +} + +// UpdateWebhookSubscriptionHandler interface for that can handle valid update webhook subscription params +type UpdateWebhookSubscriptionHandler interface { + Handle(UpdateWebhookSubscriptionParams) middleware.Responder +} + +// NewUpdateWebhookSubscription creates a new http.Handler for the update webhook subscription operation +func NewUpdateWebhookSubscription(ctx *middleware.Context, handler UpdateWebhookSubscriptionHandler) *UpdateWebhookSubscription { + return &UpdateWebhookSubscription{Context: ctx, Handler: handler} +} + +/* + UpdateWebhookSubscription swagger:route PATCH /webhook-subscriptions/{webhookSubscriptionId} Webhook subscriptions updateWebhookSubscription + +# Update a Webhook Subscription + +This endpoint updates a single Webhook Subscription by ID. Do not use this +endpoint directly as it is meant to be used with the Admin UI exclusively. +*/ +type UpdateWebhookSubscription struct { + Context *middleware.Context + Handler UpdateWebhookSubscriptionHandler +} + +func (o *UpdateWebhookSubscription) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateWebhookSubscriptionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go new file mode 100644 index 00000000000..261d30d765f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// NewUpdateWebhookSubscriptionParams creates a new UpdateWebhookSubscriptionParams object +// +// There are no default values defined in the spec. +func NewUpdateWebhookSubscriptionParams() UpdateWebhookSubscriptionParams { + + return UpdateWebhookSubscriptionParams{} +} + +// UpdateWebhookSubscriptionParams contains all the bound params for the update webhook subscription operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateWebhookSubscription +type UpdateWebhookSubscriptionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*Webhook Subscription information + Required: true + In: body + */ + WebhookSubscription *adminmessages.WebhookSubscription + /* + Required: true + In: path + */ + WebhookSubscriptionID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateWebhookSubscriptionParams() beforehand. +func (o *UpdateWebhookSubscriptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body adminmessages.WebhookSubscription + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("webhookSubscription", "body", "")) + } else { + res = append(res, errors.NewParseError("webhookSubscription", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.WebhookSubscription = &body + } + } + } else { + res = append(res, errors.Required("webhookSubscription", "body", "")) + } + + rWebhookSubscriptionID, rhkWebhookSubscriptionID, _ := route.Params.GetOK("webhookSubscriptionId") + if err := o.bindWebhookSubscriptionID(rWebhookSubscriptionID, rhkWebhookSubscriptionID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateWebhookSubscriptionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindWebhookSubscriptionID binds and validates parameter WebhookSubscriptionID from path. +func (o *UpdateWebhookSubscriptionParams) bindWebhookSubscriptionID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("webhookSubscriptionId", "path", "strfmt.UUID", raw) + } + o.WebhookSubscriptionID = *(value.(*strfmt.UUID)) + + if err := o.validateWebhookSubscriptionID(formats); err != nil { + return err + } + + return nil +} + +// validateWebhookSubscriptionID carries on validations for parameter WebhookSubscriptionID +func (o *UpdateWebhookSubscriptionParams) validateWebhookSubscriptionID(formats strfmt.Registry) error { + + if err := validate.FormatOf("webhookSubscriptionId", "path", "uuid", o.WebhookSubscriptionID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go new file mode 100644 index 00000000000..c231b611c3f --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_responses.go @@ -0,0 +1,254 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/adminmessages" +) + +// UpdateWebhookSubscriptionOKCode is the HTTP code returned for type UpdateWebhookSubscriptionOK +const UpdateWebhookSubscriptionOKCode int = 200 + +/* +UpdateWebhookSubscriptionOK Successfully updated Webhook Subscription + +swagger:response updateWebhookSubscriptionOK +*/ +type UpdateWebhookSubscriptionOK struct { + + /* + In: Body + */ + Payload *adminmessages.WebhookSubscription `json:"body,omitempty"` +} + +// NewUpdateWebhookSubscriptionOK creates UpdateWebhookSubscriptionOK with default headers values +func NewUpdateWebhookSubscriptionOK() *UpdateWebhookSubscriptionOK { + + return &UpdateWebhookSubscriptionOK{} +} + +// WithPayload adds the payload to the update webhook subscription o k response +func (o *UpdateWebhookSubscriptionOK) WithPayload(payload *adminmessages.WebhookSubscription) *UpdateWebhookSubscriptionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update webhook subscription o k response +func (o *UpdateWebhookSubscriptionOK) SetPayload(payload *adminmessages.WebhookSubscription) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWebhookSubscriptionBadRequestCode is the HTTP code returned for type UpdateWebhookSubscriptionBadRequest +const UpdateWebhookSubscriptionBadRequestCode int = 400 + +/* +UpdateWebhookSubscriptionBadRequest Invalid Request + +swagger:response updateWebhookSubscriptionBadRequest +*/ +type UpdateWebhookSubscriptionBadRequest struct { +} + +// NewUpdateWebhookSubscriptionBadRequest creates UpdateWebhookSubscriptionBadRequest with default headers values +func NewUpdateWebhookSubscriptionBadRequest() *UpdateWebhookSubscriptionBadRequest { + + return &UpdateWebhookSubscriptionBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateWebhookSubscriptionUnauthorizedCode is the HTTP code returned for type UpdateWebhookSubscriptionUnauthorized +const UpdateWebhookSubscriptionUnauthorizedCode int = 401 + +/* +UpdateWebhookSubscriptionUnauthorized Must be authenticated to use this end point + +swagger:response updateWebhookSubscriptionUnauthorized +*/ +type UpdateWebhookSubscriptionUnauthorized struct { +} + +// NewUpdateWebhookSubscriptionUnauthorized creates UpdateWebhookSubscriptionUnauthorized with default headers values +func NewUpdateWebhookSubscriptionUnauthorized() *UpdateWebhookSubscriptionUnauthorized { + + return &UpdateWebhookSubscriptionUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateWebhookSubscriptionForbiddenCode is the HTTP code returned for type UpdateWebhookSubscriptionForbidden +const UpdateWebhookSubscriptionForbiddenCode int = 403 + +/* +UpdateWebhookSubscriptionForbidden Not authorized to update this Webhook Subscription + +swagger:response updateWebhookSubscriptionForbidden +*/ +type UpdateWebhookSubscriptionForbidden struct { +} + +// NewUpdateWebhookSubscriptionForbidden creates UpdateWebhookSubscriptionForbidden with default headers values +func NewUpdateWebhookSubscriptionForbidden() *UpdateWebhookSubscriptionForbidden { + + return &UpdateWebhookSubscriptionForbidden{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateWebhookSubscriptionNotFoundCode is the HTTP code returned for type UpdateWebhookSubscriptionNotFound +const UpdateWebhookSubscriptionNotFoundCode int = 404 + +/* +UpdateWebhookSubscriptionNotFound Webhook Subscription not found + +swagger:response updateWebhookSubscriptionNotFound +*/ +type UpdateWebhookSubscriptionNotFound struct { +} + +// NewUpdateWebhookSubscriptionNotFound creates UpdateWebhookSubscriptionNotFound with default headers values +func NewUpdateWebhookSubscriptionNotFound() *UpdateWebhookSubscriptionNotFound { + + return &UpdateWebhookSubscriptionNotFound{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateWebhookSubscriptionPreconditionFailedCode is the HTTP code returned for type UpdateWebhookSubscriptionPreconditionFailed +const UpdateWebhookSubscriptionPreconditionFailedCode int = 412 + +/* +UpdateWebhookSubscriptionPreconditionFailed Precondition failed + +swagger:response updateWebhookSubscriptionPreconditionFailed +*/ +type UpdateWebhookSubscriptionPreconditionFailed struct { +} + +// NewUpdateWebhookSubscriptionPreconditionFailed creates UpdateWebhookSubscriptionPreconditionFailed with default headers values +func NewUpdateWebhookSubscriptionPreconditionFailed() *UpdateWebhookSubscriptionPreconditionFailed { + + return &UpdateWebhookSubscriptionPreconditionFailed{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(412) +} + +// UpdateWebhookSubscriptionUnprocessableEntityCode is the HTTP code returned for type UpdateWebhookSubscriptionUnprocessableEntity +const UpdateWebhookSubscriptionUnprocessableEntityCode int = 422 + +/* +UpdateWebhookSubscriptionUnprocessableEntity Validation error + +swagger:response updateWebhookSubscriptionUnprocessableEntity +*/ +type UpdateWebhookSubscriptionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *adminmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateWebhookSubscriptionUnprocessableEntity creates UpdateWebhookSubscriptionUnprocessableEntity with default headers values +func NewUpdateWebhookSubscriptionUnprocessableEntity() *UpdateWebhookSubscriptionUnprocessableEntity { + + return &UpdateWebhookSubscriptionUnprocessableEntity{} +} + +// WithPayload adds the payload to the update webhook subscription unprocessable entity response +func (o *UpdateWebhookSubscriptionUnprocessableEntity) WithPayload(payload *adminmessages.ValidationError) *UpdateWebhookSubscriptionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update webhook subscription unprocessable entity response +func (o *UpdateWebhookSubscriptionUnprocessableEntity) SetPayload(payload *adminmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWebhookSubscriptionInternalServerErrorCode is the HTTP code returned for type UpdateWebhookSubscriptionInternalServerError +const UpdateWebhookSubscriptionInternalServerErrorCode int = 500 + +/* +UpdateWebhookSubscriptionInternalServerError Server error + +swagger:response updateWebhookSubscriptionInternalServerError +*/ +type UpdateWebhookSubscriptionInternalServerError struct { +} + +// NewUpdateWebhookSubscriptionInternalServerError creates UpdateWebhookSubscriptionInternalServerError with default headers values +func NewUpdateWebhookSubscriptionInternalServerError() *UpdateWebhookSubscriptionInternalServerError { + + return &UpdateWebhookSubscriptionInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateWebhookSubscriptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go new file mode 100644 index 00000000000..73337ee6869 --- /dev/null +++ b/pkg/gen/adminapi/adminoperations/webhook_subscriptions/update_webhook_subscription_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook_subscriptions + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateWebhookSubscriptionURL generates an URL for the update webhook subscription operation +type UpdateWebhookSubscriptionURL struct { + WebhookSubscriptionID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWebhookSubscriptionURL) WithBasePath(bp string) *UpdateWebhookSubscriptionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWebhookSubscriptionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateWebhookSubscriptionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-subscriptions/{webhookSubscriptionId}" + + webhookSubscriptionID := o.WebhookSubscriptionID.String() + if webhookSubscriptionID != "" { + _path = strings.Replace(_path, "{webhookSubscriptionId}", webhookSubscriptionID, -1) + } else { + return nil, errors.New("webhookSubscriptionId is required on UpdateWebhookSubscriptionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/admin/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateWebhookSubscriptionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateWebhookSubscriptionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateWebhookSubscriptionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateWebhookSubscriptionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateWebhookSubscriptionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateWebhookSubscriptionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/adminapi/configure_mymove.go b/pkg/gen/adminapi/configure_mymove.go new file mode 100644 index 00000000000..1e8322fbfe9 --- /dev/null +++ b/pkg/gen/adminapi/configure_mymove.go @@ -0,0 +1,265 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package adminapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/admin_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/client_certificates" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/electronic_orders" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/moves" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/notifications" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/office_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/organizations" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_file" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/payment_request_syncada_files" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/requested_office_users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/transportation_offices" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/uploads" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/user" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/users" + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations/webhook_subscriptions" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/admin.yaml --api-package adminoperations --model-package adminmessages --server-package adminapi --principal interface{} --exclude-main + +func configureFlags(api *adminoperations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *adminoperations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + if api.AdminUsersCreateAdminUserHandler == nil { + api.AdminUsersCreateAdminUserHandler = admin_users.CreateAdminUserHandlerFunc(func(params admin_users.CreateAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.CreateAdminUser has not yet been implemented") + }) + } + if api.ClientCertificatesCreateClientCertificateHandler == nil { + api.ClientCertificatesCreateClientCertificateHandler = client_certificates.CreateClientCertificateHandlerFunc(func(params client_certificates.CreateClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.CreateClientCertificate has not yet been implemented") + }) + } + if api.OfficeUsersCreateOfficeUserHandler == nil { + api.OfficeUsersCreateOfficeUserHandler = office_users.CreateOfficeUserHandlerFunc(func(params office_users.CreateOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.CreateOfficeUser has not yet been implemented") + }) + } + if api.WebhookSubscriptionsCreateWebhookSubscriptionHandler == nil { + api.WebhookSubscriptionsCreateWebhookSubscriptionHandler = webhook_subscriptions.CreateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.CreateWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.CreateWebhookSubscription has not yet been implemented") + }) + } + if api.AdminUsersGetAdminUserHandler == nil { + api.AdminUsersGetAdminUserHandler = admin_users.GetAdminUserHandlerFunc(func(params admin_users.GetAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.GetAdminUser has not yet been implemented") + }) + } + if api.ClientCertificatesGetClientCertificateHandler == nil { + api.ClientCertificatesGetClientCertificateHandler = client_certificates.GetClientCertificateHandlerFunc(func(params client_certificates.GetClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.GetClientCertificate has not yet been implemented") + }) + } + if api.ElectronicOrdersGetElectronicOrdersTotalsHandler == nil { + api.ElectronicOrdersGetElectronicOrdersTotalsHandler = electronic_orders.GetElectronicOrdersTotalsHandlerFunc(func(params electronic_orders.GetElectronicOrdersTotalsParams) middleware.Responder { + return middleware.NotImplemented("operation electronic_orders.GetElectronicOrdersTotals has not yet been implemented") + }) + } + if api.UserGetLoggedInAdminUserHandler == nil { + api.UserGetLoggedInAdminUserHandler = user.GetLoggedInAdminUserHandlerFunc(func(params user.GetLoggedInAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation user.GetLoggedInAdminUser has not yet been implemented") + }) + } + if api.MovesGetMoveHandler == nil { + api.MovesGetMoveHandler = moves.GetMoveHandlerFunc(func(params moves.GetMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetMove has not yet been implemented") + }) + } + if api.TransportationOfficesGetOfficeByIDHandler == nil { + api.TransportationOfficesGetOfficeByIDHandler = transportation_offices.GetOfficeByIDHandlerFunc(func(params transportation_offices.GetOfficeByIDParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.GetOfficeByID has not yet been implemented") + }) + } + if api.OfficeUsersGetOfficeUserHandler == nil { + api.OfficeUsersGetOfficeUserHandler = office_users.GetOfficeUserHandlerFunc(func(params office_users.GetOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.GetOfficeUser has not yet been implemented") + }) + } + if api.RequestedOfficeUsersGetRequestedOfficeUserHandler == nil { + api.RequestedOfficeUsersGetRequestedOfficeUserHandler = requested_office_users.GetRequestedOfficeUserHandlerFunc(func(params requested_office_users.GetRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.GetRequestedOfficeUser has not yet been implemented") + }) + } + if api.UploadsGetUploadHandler == nil { + api.UploadsGetUploadHandler = uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") + }) + } + if api.UsersGetUserHandler == nil { + api.UsersGetUserHandler = users.GetUserHandlerFunc(func(params users.GetUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.GetUser has not yet been implemented") + }) + } + if api.WebhookSubscriptionsGetWebhookSubscriptionHandler == nil { + api.WebhookSubscriptionsGetWebhookSubscriptionHandler = webhook_subscriptions.GetWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.GetWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.GetWebhookSubscription has not yet been implemented") + }) + } + if api.AdminUsersIndexAdminUsersHandler == nil { + api.AdminUsersIndexAdminUsersHandler = admin_users.IndexAdminUsersHandlerFunc(func(params admin_users.IndexAdminUsersParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.IndexAdminUsers has not yet been implemented") + }) + } + if api.ClientCertificatesIndexClientCertificatesHandler == nil { + api.ClientCertificatesIndexClientCertificatesHandler = client_certificates.IndexClientCertificatesHandlerFunc(func(params client_certificates.IndexClientCertificatesParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.IndexClientCertificates has not yet been implemented") + }) + } + if api.ElectronicOrdersIndexElectronicOrdersHandler == nil { + api.ElectronicOrdersIndexElectronicOrdersHandler = electronic_orders.IndexElectronicOrdersHandlerFunc(func(params electronic_orders.IndexElectronicOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation electronic_orders.IndexElectronicOrders has not yet been implemented") + }) + } + if api.MovesIndexMovesHandler == nil { + api.MovesIndexMovesHandler = moves.IndexMovesHandlerFunc(func(params moves.IndexMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.IndexMoves has not yet been implemented") + }) + } + if api.NotificationsIndexNotificationsHandler == nil { + api.NotificationsIndexNotificationsHandler = notifications.IndexNotificationsHandlerFunc(func(params notifications.IndexNotificationsParams) middleware.Responder { + return middleware.NotImplemented("operation notifications.IndexNotifications has not yet been implemented") + }) + } + if api.OfficeUsersIndexOfficeUsersHandler == nil { + api.OfficeUsersIndexOfficeUsersHandler = office_users.IndexOfficeUsersHandlerFunc(func(params office_users.IndexOfficeUsersParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.IndexOfficeUsers has not yet been implemented") + }) + } + if api.TransportationOfficesIndexOfficesHandler == nil { + api.TransportationOfficesIndexOfficesHandler = transportation_offices.IndexOfficesHandlerFunc(func(params transportation_offices.IndexOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.IndexOffices has not yet been implemented") + }) + } + if api.OrganizationsIndexOrganizationsHandler == nil { + api.OrganizationsIndexOrganizationsHandler = organizations.IndexOrganizationsHandlerFunc(func(params organizations.IndexOrganizationsParams) middleware.Responder { + return middleware.NotImplemented("operation organizations.IndexOrganizations has not yet been implemented") + }) + } + if api.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler == nil { + api.PaymentRequestSyncadaFilesIndexPaymentRequestSyncadaFilesHandler = payment_request_syncada_files.IndexPaymentRequestSyncadaFilesHandlerFunc(func(params payment_request_syncada_files.IndexPaymentRequestSyncadaFilesParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request_syncada_files.IndexPaymentRequestSyncadaFiles has not yet been implemented") + }) + } + if api.RequestedOfficeUsersIndexRequestedOfficeUsersHandler == nil { + api.RequestedOfficeUsersIndexRequestedOfficeUsersHandler = requested_office_users.IndexRequestedOfficeUsersHandlerFunc(func(params requested_office_users.IndexRequestedOfficeUsersParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.IndexRequestedOfficeUsers has not yet been implemented") + }) + } + if api.UsersIndexUsersHandler == nil { + api.UsersIndexUsersHandler = users.IndexUsersHandlerFunc(func(params users.IndexUsersParams) middleware.Responder { + return middleware.NotImplemented("operation users.IndexUsers has not yet been implemented") + }) + } + if api.WebhookSubscriptionsIndexWebhookSubscriptionsHandler == nil { + api.WebhookSubscriptionsIndexWebhookSubscriptionsHandler = webhook_subscriptions.IndexWebhookSubscriptionsHandlerFunc(func(params webhook_subscriptions.IndexWebhookSubscriptionsParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.IndexWebhookSubscriptions has not yet been implemented") + }) + } + if api.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler == nil { + api.PaymentRequestSyncadaFilePaymentRequestSyncadaFileHandler = payment_request_syncada_file.PaymentRequestSyncadaFileHandlerFunc(func(params payment_request_syncada_file.PaymentRequestSyncadaFileParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request_syncada_file.PaymentRequestSyncadaFile has not yet been implemented") + }) + } + if api.ClientCertificatesRemoveClientCertificateHandler == nil { + api.ClientCertificatesRemoveClientCertificateHandler = client_certificates.RemoveClientCertificateHandlerFunc(func(params client_certificates.RemoveClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.RemoveClientCertificate has not yet been implemented") + }) + } + if api.AdminUsersUpdateAdminUserHandler == nil { + api.AdminUsersUpdateAdminUserHandler = admin_users.UpdateAdminUserHandlerFunc(func(params admin_users.UpdateAdminUserParams) middleware.Responder { + return middleware.NotImplemented("operation admin_users.UpdateAdminUser has not yet been implemented") + }) + } + if api.ClientCertificatesUpdateClientCertificateHandler == nil { + api.ClientCertificatesUpdateClientCertificateHandler = client_certificates.UpdateClientCertificateHandlerFunc(func(params client_certificates.UpdateClientCertificateParams) middleware.Responder { + return middleware.NotImplemented("operation client_certificates.UpdateClientCertificate has not yet been implemented") + }) + } + if api.MovesUpdateMoveHandler == nil { + api.MovesUpdateMoveHandler = moves.UpdateMoveHandlerFunc(func(params moves.UpdateMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.UpdateMove has not yet been implemented") + }) + } + if api.OfficeUsersUpdateOfficeUserHandler == nil { + api.OfficeUsersUpdateOfficeUserHandler = office_users.UpdateOfficeUserHandlerFunc(func(params office_users.UpdateOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.UpdateOfficeUser has not yet been implemented") + }) + } + if api.RequestedOfficeUsersUpdateRequestedOfficeUserHandler == nil { + api.RequestedOfficeUsersUpdateRequestedOfficeUserHandler = requested_office_users.UpdateRequestedOfficeUserHandlerFunc(func(params requested_office_users.UpdateRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation requested_office_users.UpdateRequestedOfficeUser has not yet been implemented") + }) + } + if api.UsersUpdateUserHandler == nil { + api.UsersUpdateUserHandler = users.UpdateUserHandlerFunc(func(params users.UpdateUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.UpdateUser has not yet been implemented") + }) + } + if api.WebhookSubscriptionsUpdateWebhookSubscriptionHandler == nil { + api.WebhookSubscriptionsUpdateWebhookSubscriptionHandler = webhook_subscriptions.UpdateWebhookSubscriptionHandlerFunc(func(params webhook_subscriptions.UpdateWebhookSubscriptionParams) middleware.Responder { + return middleware.NotImplemented("operation webhook_subscriptions.UpdateWebhookSubscription has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/adminapi/doc.go b/pkg/gen/adminapi/doc.go new file mode 100644 index 00000000000..9936bacd9d1 --- /dev/null +++ b/pkg/gen/adminapi/doc.go @@ -0,0 +1,24 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package adminapi MilMove Admin API +// +// The Admin API is a RESTful API that enables the Admin application for MilMove. +// +// All endpoints are located under `/admin/v1`. +// +// Schemes: +// https +// Host: localhost +// BasePath: /admin/v1 +// Version: 1.0.0 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// swagger:meta +package adminapi diff --git a/pkg/gen/adminapi/embedded_spec.go b/pkg/gen/adminapi/embedded_spec.go new file mode 100644 index 00000000000..c92c3d50045 --- /dev/null +++ b/pkg/gen/adminapi/embedded_spec.go @@ -0,0 +1,7339 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminapi + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "swagger": "2.0", + "info": { + "description": "The Admin API is a RESTful API that enables the Admin application for MilMove.\n\nAll endpoints are located under ` + "`" + `/admin/v1` + "`" + `.\n", + "title": "MilMove Admin API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "1.0.0" + }, + "basePath": "/admin/v1", + "paths": { + "/admin-users": { + "get": { + "description": "This endpoint returns a list of Admin Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "List Admin Users", + "operationId": "indexAdminUsers", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin Users not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates an Admin User record and returns the created record in the\n` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used with\nthe Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Create an Admin User", + "operationId": "createAdminUser", + "parameters": [ + { + "description": "Admin User information", + "name": "adminUser", + "in": "body", + "schema": { + "$ref": "#/definitions/AdminUserCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Admin User", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create an Admin User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/admin-users/{adminUserId}": { + "get": { + "description": "This endpoint returns a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Fetch a specific Admin User", + "operationId": "getAdminUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "adminUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Updates an Admin User", + "operationId": "updateAdminUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "adminUserId", + "in": "path", + "required": true + }, + { + "description": "Admin User information", + "name": "adminUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Admin User", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update an Admin User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/client-certificates": { + "get": { + "description": "This endpoint returns a list of Client Certificates. Do not use this\nendpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "List client certificates", + "operationId": "indexClientCertificates", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ClientCertificates" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "office not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates a Client Certificate record and returns the\ncreated record in the ` + "`" + `201` + "`" + ` response. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "create a client cert", + "operationId": "createClientCertificate", + "parameters": [ + { + "description": "client cert information", + "name": "clientCertificate", + "in": "body", + "schema": { + "$ref": "#/definitions/ClientCertificateCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created client certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create a client certificate" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/client-certificates/{clientCertificateId}": { + "get": { + "description": "This endpoint returns a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "Get a client certificate", + "operationId": "getClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "id not found" + }, + "500": { + "description": "server error" + } + } + }, + "delete": { + "description": "This endpoint removes a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "removes a client certificate", + "operationId": "removeClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully removed Client Certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to remove a client certificate" + }, + "500": { + "description": "Server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "Updates a client certificate", + "operationId": "updateClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + }, + { + "description": "client cert information", + "name": "clientCertificate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClientCertificateUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Client Certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update a client certificate" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/electronic-orders": { + "get": { + "description": "This endpoint returns a list of Electronic Orders. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Electronic orders" + ], + "summary": "List Electronic Orders", + "operationId": "indexElectronicOrders", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ElectronicOrders" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Electronic Order not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/electronic-orders/totals": { + "get": { + "description": "This endpoint returns a list of record counts for Electronic Orders. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Electronic orders" + ], + "summary": "Get total counts for the orders stored in MilMove", + "operationId": "getElectronicOrdersTotals", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "andFilter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ElectronicOrdersTotals" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Total count for Electronic Orders not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves": { + "get": { + "description": "This endpoint returns a list of Moves. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "List Moves", + "operationId": "indexMoves", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Moves" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Moves not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveID}": { + "get": { + "description": "This endpoint returns a single Move by ID. Do not use this endpoint directly as\nit is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "Get information about a Move", + "operationId": "getMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Must be authenticated to use this endpoint" + }, + "404": { + "description": "Move not found" + }, + "500": { + "description": "Server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Move by ID. This allows the Admin User to change\nthe ` + "`" + `show` + "`" + ` field on the selected field to either ` + "`" + `True` + "`" + ` or ` + "`" + `False` + "`" + `. A \"shown\"\nMove will appear to all users as normal, a \"hidden\" Move will not be returned or\neditable using any other endpoint (besides those in the Support API), and thus\neffectively deactivated. Do not use this endpoint directly as it is meant to be\nused with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "Toggle Move visibility", + "operationId": "updateMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveID", + "in": "path", + "required": true + }, + { + "description": "Move information", + "name": "Move", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Must be authenticated to use this endpoint" + }, + "403": { + "description": "Not authorized to update this Move" + }, + "404": { + "description": "Move not found" + }, + "422": { + "description": "Invalid input" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/notifications": { + "get": { + "description": "This endpoint returns a list of Notifications that have been sent to Service\nMembers. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "List Notifications", + "operationId": "indexNotifications", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Notifications" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Notifications not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/office-users": { + "get": { + "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "List of Office Users", + "operationId": "indexOfficeUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates an Office User record and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. If there are issues with the Office User information\nprovided a ` + "`" + `422` + "`" + ` response will occur with information about invalid fields and\nadditional details. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Create an Office User", + "operationId": "createOfficeUser", + "parameters": [ + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "schema": { + "$ref": "#/definitions/OfficeUserCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Office User", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/office-users/{officeUserId}": { + "get": { + "description": "This endpoint returns a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Get an Office User", + "operationId": "getOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Updates an Office User", + "operationId": "updateOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + }, + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OfficeUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Office User", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update an Office User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/offices": { + "get": { + "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Transportation offices" + ], + "summary": "List Transportation Offices", + "operationId": "indexOffices", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/TransportationOffices" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Transportation Office not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/offices/{officeId}": { + "get": { + "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Transportation offices" + ], + "summary": "Get Transportation Office by ID", + "operationId": "getOfficeById", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Transportation Office not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/organizations": { + "get": { + "description": "This endpoint returns a list of Organizations. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "List Organizations", + "operationId": "indexOrganizations", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Organizations" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Organizations not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-request-syncada-files": { + "get": { + "description": "Returns a list of Payment Request EDI files", + "produces": [ + "application/json" + ], + "tags": [ + "Payment Request Syncada Files" + ], + "summary": "List Payment Request EDI Files", + "operationId": "indexPaymentRequestSyncadaFiles", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/PaymentRequestSyncadaFiles" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Payment Request EDI Files not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-request-syncada-files/{paymentRequestSyncadaFileId}": { + "get": { + "description": "Returns a Payment Request EDI858 file", + "produces": [ + "application/json" + ], + "tags": [ + "Payment Request Syncada File" + ], + "summary": "Payment Request EDI File", + "operationId": "paymentRequestSyncadaFile", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "paymentRequestSyncadaFileId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/PaymentRequestSyncadaFile" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Payment Request EDI Files not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/requested-office-users": { + "get": { + "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "List of Office Users Requesting Accounts", + "operationId": "indexRequestedOfficeUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/requested-office-users/{officeUserId}": { + "get": { + "description": "Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data.", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "Get a Requested Office User", + "operationId": "getRequestedOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user.", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "Update a Requested Office User", + "operationId": "updateRequestedOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RequestedOfficeUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadId}": { + "get": { + "description": "This endpoint returns a single Upload by ID containing the given Upload and\ninformation about the Uploader and Move. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Uploads" + ], + "summary": "Get information about an Upload", + "operationId": "getUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "uploadId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/UploadInformation" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Upload not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/user": { + "get": { + "description": "Returns the admin user info for the currently logged in user", + "tags": [ + "User" + ], + "summary": "Gets the data about the currently signed in admin user", + "operationId": "getLoggedInAdminUser", + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin User not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users": { + "get": { + "description": "This endpoint returns a list of Users. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "List Users", + "operationId": "indexUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Users" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Users not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/{userId}": { + "get": { + "description": "This endpoint returns a single User by ID. This also returns the User's sessions\nas well. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n\n", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get information about a User", + "operationId": "getUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single User by ID. This can be used by the Admin User to\nupdate the User's session or the User's active status. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update a User's session or active status", + "operationId": "updateUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "userId", + "in": "path", + "required": true + }, + { + "description": "User information", + "name": "User", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated User", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update this User" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "Server error" + } + } + } + }, + "/webhook-subscriptions": { + "get": { + "description": "This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Lists Webhook Subscriptions", + "operationId": "indexWebhookSubscriptions", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/WebhookSubscriptions" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Not authenticated for this endpoint" + }, + "404": { + "description": "Webhook Subscriptions not found" + }, + "500": { + "description": "Server error" + } + } + }, + "post": { + "description": "This endpoint creates a Webhook Subscription and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Create a Webhook Subscription", + "operationId": "createWebhookSubscription", + "parameters": [ + { + "description": "Webhook subscription information", + "name": "webhookSubscription", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateWebhookSubscription" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Webhook Subscription", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create a Webhook Subscription" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/webhook-subscriptions/{webhookSubscriptionId}": { + "get": { + "description": "This endpoint returns a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Get information about a Webhook Subscription", + "operationId": "getWebhookSubscription", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "webhookSubscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Webhook Subscription not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Update a Webhook Subscription", + "operationId": "updateWebhookSubscription", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "webhookSubscriptionId", + "in": "path", + "required": true + }, + { + "description": "Webhook Subscription information", + "name": "WebhookSubscription", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated Webhook Subscription", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update this Webhook Subscription" + }, + "404": { + "description": "Webhook Subscription not found" + }, + "412": { + "description": "Precondition failed" + }, + "422": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "Server error" + } + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "required": [ + "streetAddress1", + "state", + "city", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "description": "zip code, international allowed", + "type": "string", + "format": "zip", + "title": "ZIP", + "example": "'90210' or 'N15 3NL'" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Address line 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Address line 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address line 3", + "x-nullable": true, + "example": "Montmârtre" + } + } + }, + "AdminUser": { + "type": "object", + "required": [ + "id", + "firstName", + "lastName", + "email", + "userId", + "organizationId", + "active", + "super", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "organizationId": { + "type": "string", + "format": "uuid" + }, + "super": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "AdminUserCreate": { + "type": "object", + "properties": { + "email": { + "type": "string", + "title": "Email", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name" + }, + "lastName": { + "type": "string", + "title": "Last Name" + }, + "organizationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "super": { + "type": "boolean" + } + } + }, + "AdminUserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "super": { + "type": "boolean", + "x-nullable": true + } + } + }, + "AdminUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/AdminUser" + } + }, + "ClientCertificate": { + "type": "object", + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean" + }, + "allowAirForceOrdersWrite": { + "type": "boolean" + }, + "allowArmyOrdersRead": { + "type": "boolean" + }, + "allowArmyOrdersWrite": { + "type": "boolean" + }, + "allowCoastGuardOrdersRead": { + "type": "boolean" + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean" + }, + "allowDpsAuthAPI": { + "type": "boolean" + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean" + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean" + }, + "allowNavyOrdersRead": { + "type": "boolean" + }, + "allowNavyOrdersWrite": { + "type": "boolean" + }, + "allowOrdersAPI": { + "type": "boolean" + }, + "allowPPTAS": { + "type": "boolean" + }, + "allowPrime": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ClientCertificateCreate": { + "type": "object", + "required": [ + "sha256Digest", + "subject", + "email" + ], + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean" + }, + "allowAirForceOrdersWrite": { + "type": "boolean" + }, + "allowArmyOrdersRead": { + "type": "boolean" + }, + "allowArmyOrdersWrite": { + "type": "boolean" + }, + "allowCoastGuardOrdersRead": { + "type": "boolean" + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean" + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean" + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean" + }, + "allowNavyOrdersRead": { + "type": "boolean" + }, + "allowNavyOrdersWrite": { + "type": "boolean" + }, + "allowOrdersAPI": { + "type": "boolean" + }, + "allowPPTAS": { + "type": "boolean" + }, + "allowPrime": { + "type": "boolean" + }, + "email": { + "type": "string", + "example": "user@example.com" + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + } + } + }, + "ClientCertificateUpdate": { + "type": "object", + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowAirForceOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowArmyOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowArmyOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowCoastGuardOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowDpsAuthAPI": { + "type": "boolean", + "x-nullable": true + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowNavyOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowNavyOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowOrdersAPI": { + "type": "boolean", + "x-nullable": true + }, + "allowPPTAS": { + "type": "boolean", + "x-nullable": true + }, + "allowPrime": { + "type": "boolean", + "x-nullable": true + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + } + } + }, + "ClientCertificates": { + "type": "array", + "items": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateWebhookSubscription": { + "type": "object", + "required": [ + "subscriberId", + "status", + "eventKey", + "callbackUrl" + ], + "properties": { + "callbackUrl": { + "description": "The URL to which the notifications for this subscription will be pushed to.", + "type": "string" + }, + "eventKey": { + "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/WebhookSubscriptionStatus" + }, + "subscriberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ElectronicOrder": { + "type": "object", + "required": [ + "id", + "issuer", + "ordersNumber", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "issuer": { + "$ref": "#/definitions/Issuer" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "title": "Updated at", + "readOnly": true + } + } + }, + "ElectronicOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/ElectronicOrder" + } + }, + "ElectronicOrdersTotal": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "count": { + "type": "integer", + "title": "Total Orders Count" + } + } + }, + "ElectronicOrdersTotals": { + "type": "array", + "items": { + "$ref": "#/definitions/ElectronicOrdersTotal" + } + }, + "Issuer": { + "description": "Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded.", + "type": "string", + "enum": [ + "army", + "navy", + "air-force", + "marine-corps", + "coast-guard" + ] + }, + "Move": { + "type": "object", + "required": [ + "id", + "ordersId", + "locator", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "ordersId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMember": { + "$ref": "#/definitions/ServiceMember" + }, + "show": { + "type": "boolean", + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MoveStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MoveUpdate": { + "type": "object", + "required": [ + "show" + ], + "properties": { + "show": { + "type": "boolean" + } + } + }, + "Moves": { + "type": "array", + "items": { + "$ref": "#/definitions/Move" + } + }, + "Notification": { + "type": "object", + "required": [ + "id", + "email", + "serviceMemberId", + "sesMessageId", + "notificationType", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "notificationType": { + "type": "string", + "enum": [ + "MOVE_PAYMENT_REMINDER_EMAIL" + ] + }, + "serviceMemberId": { + "type": "string", + "format": "uuid" + }, + "sesMessageId": { + "type": "string" + } + } + }, + "Notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/Notification" + } + }, + "OfficeUser": { + "type": "object", + "required": [ + "id", + "firstName", + "middleInitials", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "transportationOfficeAssignments", + "active", + "roles", + "edipi", + "otherUniqueId", + "rejectionReason", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "middleInitials": { + "type": "string" + }, + "otherUniqueId": { + "type": "string" + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/Privilege" + } + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REQUESTED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "OfficeUserCreate": { + "type": "object", + "properties": { + "email": { + "type": "string", + "title": "Email", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name" + }, + "lastName": { + "type": "string", + "title": "Last Name" + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "L." + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserPrivilege" + }, + "x-nullable": true + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" + } + } + } + }, + "OfficeUserPrivilege": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "title": "privilegeType", + "x-nullable": true, + "example": "supervisor" + } + } + }, + "OfficeUserRole": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "title": "roleType", + "x-nullable": true, + "example": "task_ordering_officer" + } + } + }, + "OfficeUserTransportationOfficeAssignment": { + "type": "object", + "properties": { + "primaryOffice": { + "type": "boolean", + "title": "primaryOffice", + "x-nullable": true + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "title": "transportationOfficeId", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OfficeUserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "Q." + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserPrivilege" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" + } + } + } + }, + "OfficeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUser" + } + }, + "OktaAccountInfoResponse": { + "type": "object", + "properties": { + "activated": { + "type": "string" + }, + "created": { + "type": "string" + }, + "credentials": { + "type": "object" + }, + "id": { + "type": "string" + }, + "profile": { + "type": "object" + }, + "status": { + "type": "string" + } + } + }, + "Organization": { + "type": "object", + "required": [ + "id", + "name", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "title": "Name" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "title": "Updated at", + "readOnly": true + } + } + }, + "Organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + } + }, + "PaymentRequestSyncadaFile": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "ediString": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string" + } + } + }, + "PaymentRequestSyncadaFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequestSyncadaFile" + } + }, + "Privilege": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "privilegeName": { + "type": "string", + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "example": "supervisor" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "RequestedOfficeUserUpdate": { + "type": "object", + "properties": { + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "Q." + }, + "otherUniqueId": { + "type": "string" + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "roleName", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleName": { + "type": "string", + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ServiceMember": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleName": { + "type": "string", + "title": "Middle Name", + "x-nullable": true + }, + "userId": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "createdAt", + "updatedAt" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phoneLines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "Upload": { + "type": "object", + "properties": { + "contentType": { + "type": "string", + "enum": [ + "application/pdf", + "image/jpeg", + "image/png" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "filename": { + "type": "string" + }, + "size": { + "type": "integer", + "title": "Size in Bytes" + } + } + }, + "UploadInformation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveLocator": { + "type": "string", + "x-nullable": true, + "example": "12432" + }, + "officeUserEmail": { + "type": "string", + "x-nullable": true + }, + "officeUserFirstName": { + "type": "string", + "x-nullable": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "officeUserLastName": { + "type": "string", + "x-nullable": true + }, + "officeUserPhone": { + "type": "string", + "x-nullable": true + }, + "serviceMemberEmail": { + "type": "string", + "x-nullable": true + }, + "serviceMemberFirstName": { + "type": "string", + "x-nullable": true + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMemberLastName": { + "type": "string", + "x-nullable": true + }, + "serviceMemberPhone": { + "type": "string", + "x-nullable": true + }, + "upload": { + "$ref": "#/definitions/Upload" + } + } + }, + "User": { + "type": "object", + "required": [ + "oktaEmail", + "active", + "createdAt", + "updatedAt", + "currentAdminSessionId", + "currentMilSessionId", + "currentOfficeSessionId" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "currentAdminSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "currentMilSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "currentOfficeSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "oktaEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "UserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "revokeAdminSession": { + "type": "boolean", + "x-nullable": true + }, + "revokeMilSession": { + "type": "boolean", + "x-nullable": true + }, + "revokeOfficeSession": { + "type": "boolean", + "x-nullable": true + } + } + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "ValidationError": { + "required": [ + "invalidFields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object" + } + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "WebhookSubscription": { + "description": "Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically.", + "type": "object", + "properties": { + "callbackUrl": { + "description": "The URL to which the notifications for this subscription will be pushed to.", + "type": "string", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "eventKey": { + "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "severity": { + "type": "integer", + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/WebhookSubscriptionStatus" + }, + "subscriberId": { + "description": "Unique identifier for the subscriber", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "d494f114-05a2-4b39-840c-3d33243b7e29" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WebhookSubscriptionStatus": { + "type": "string", + "title": "Webhook subscription status", + "enum": [ + "ACTIVE", + "FAILING", + "DISABLED" + ], + "x-display-value": { + "ACTIVE": "Active", + "DISABLED": "Disabled", + "FAILING": "Failing" + }, + "x-nullable": true + }, + "WebhookSubscriptions": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookSubscription" + } + } + }, + "tags": [ + { + "description": "Information about Admin UI users", + "name": "Admin users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about Client Certificates", + "name": "Client certificates", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about electronic orders", + "name": "Electronic orders", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about moves", + "name": "Moves", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about notifications", + "name": "Notifications", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about transportation offices", + "name": "Transportation offices", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about office users", + "name": "Office users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about organizations", + "name": "Organizations", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about uploads", + "name": "Uploads", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about requested office users", + "name": "Requested office users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about users", + "name": "Users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about Webhook subscriptions", + "name": "Webhook subscriptions", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "schemes": [ + "https" + ], + "swagger": "2.0", + "info": { + "description": "The Admin API is a RESTful API that enables the Admin application for MilMove.\n\nAll endpoints are located under ` + "`" + `/admin/v1` + "`" + `.\n", + "title": "MilMove Admin API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "1.0.0" + }, + "basePath": "/admin/v1", + "paths": { + "/admin-users": { + "get": { + "description": "This endpoint returns a list of Admin Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "List Admin Users", + "operationId": "indexAdminUsers", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin Users not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates an Admin User record and returns the created record in the\n` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used with\nthe Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Create an Admin User", + "operationId": "createAdminUser", + "parameters": [ + { + "description": "Admin User information", + "name": "adminUser", + "in": "body", + "schema": { + "$ref": "#/definitions/AdminUserCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Admin User", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create an Admin User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/admin-users/{adminUserId}": { + "get": { + "description": "This endpoint returns a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Fetch a specific Admin User", + "operationId": "getAdminUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "adminUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Admin User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Admin users" + ], + "summary": "Updates an Admin User", + "operationId": "updateAdminUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "adminUserId", + "in": "path", + "required": true + }, + { + "description": "Admin User information", + "name": "adminUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AdminUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Admin User", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update an Admin User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/client-certificates": { + "get": { + "description": "This endpoint returns a list of Client Certificates. Do not use this\nendpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "List client certificates", + "operationId": "indexClientCertificates", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ClientCertificates" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "office not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates a Client Certificate record and returns the\ncreated record in the ` + "`" + `201` + "`" + ` response. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "create a client cert", + "operationId": "createClientCertificate", + "parameters": [ + { + "description": "client cert information", + "name": "clientCertificate", + "in": "body", + "schema": { + "$ref": "#/definitions/ClientCertificateCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created client certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create a client certificate" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/client-certificates/{clientCertificateId}": { + "get": { + "description": "This endpoint returns a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "Get a client certificate", + "operationId": "getClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "id not found" + }, + "500": { + "description": "server error" + } + } + }, + "delete": { + "description": "This endpoint removes a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "removes a client certificate", + "operationId": "removeClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully removed Client Certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to remove a client certificate" + }, + "500": { + "description": "Server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Client Certificate by ID. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI\nexclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Client certificates" + ], + "summary": "Updates a client certificate", + "operationId": "updateClientCertificate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "clientCertificateId", + "in": "path", + "required": true + }, + { + "description": "client cert information", + "name": "clientCertificate", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ClientCertificateUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Client Certificate", + "schema": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update a client certificate" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/electronic-orders": { + "get": { + "description": "This endpoint returns a list of Electronic Orders. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Electronic orders" + ], + "summary": "List Electronic Orders", + "operationId": "indexElectronicOrders", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ElectronicOrders" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Electronic Order not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/electronic-orders/totals": { + "get": { + "description": "This endpoint returns a list of record counts for Electronic Orders. Do not use\nthis endpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Electronic orders" + ], + "summary": "Get total counts for the orders stored in MilMove", + "operationId": "getElectronicOrdersTotals", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "array", + "items": { + "type": "string" + }, + "name": "andFilter", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/ElectronicOrdersTotals" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Total count for Electronic Orders not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves": { + "get": { + "description": "This endpoint returns a list of Moves. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "List Moves", + "operationId": "indexMoves", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Moves" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Moves not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveID}": { + "get": { + "description": "This endpoint returns a single Move by ID. Do not use this endpoint directly as\nit is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "Get information about a Move", + "operationId": "getMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Success", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Must be authenticated to use this endpoint" + }, + "404": { + "description": "Move not found" + }, + "500": { + "description": "Server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Move by ID. This allows the Admin User to change\nthe ` + "`" + `show` + "`" + ` field on the selected field to either ` + "`" + `True` + "`" + ` or ` + "`" + `False` + "`" + `. A \"shown\"\nMove will appear to all users as normal, a \"hidden\" Move will not be returned or\neditable using any other endpoint (besides those in the Support API), and thus\neffectively deactivated. Do not use this endpoint directly as it is meant to be\nused with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Moves" + ], + "summary": "Toggle Move visibility", + "operationId": "updateMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveID", + "in": "path", + "required": true + }, + { + "description": "Move information", + "name": "Move", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Must be authenticated to use this endpoint" + }, + "403": { + "description": "Not authorized to update this Move" + }, + "404": { + "description": "Move not found" + }, + "422": { + "description": "Invalid input" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/notifications": { + "get": { + "description": "This endpoint returns a list of Notifications that have been sent to Service\nMembers. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Notifications" + ], + "summary": "List Notifications", + "operationId": "indexNotifications", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Notifications" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Notifications not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/office-users": { + "get": { + "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "List of Office Users", + "operationId": "indexOfficeUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "post": { + "description": "This endpoint creates an Office User record and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. If there are issues with the Office User information\nprovided a ` + "`" + `422` + "`" + ` response will occur with information about invalid fields and\nadditional details. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Create an Office User", + "operationId": "createOfficeUser", + "parameters": [ + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "schema": { + "$ref": "#/definitions/OfficeUserCreate" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Office User", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/office-users/{officeUserId}": { + "get": { + "description": "This endpoint returns a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Get an Office User", + "operationId": "getOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Office User by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Office users" + ], + "summary": "Updates an Office User", + "operationId": "updateOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + }, + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/OfficeUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated Office User", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update an Office User" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/offices": { + "get": { + "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Transportation offices" + ], + "summary": "List Transportation Offices", + "operationId": "indexOffices", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/TransportationOffices" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Transportation Office not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/offices/{officeId}": { + "get": { + "description": "This endpoint returns a list of Transportation Offices. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Transportation offices" + ], + "summary": "Get Transportation Office by ID", + "operationId": "getOfficeById", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Transportation Office not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/organizations": { + "get": { + "description": "This endpoint returns a list of Organizations. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Organizations" + ], + "summary": "List Organizations", + "operationId": "indexOrganizations", + "parameters": [ + { + "type": "array", + "items": { + "type": "string" + }, + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Organizations" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Organizations not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-request-syncada-files": { + "get": { + "description": "Returns a list of Payment Request EDI files", + "produces": [ + "application/json" + ], + "tags": [ + "Payment Request Syncada Files" + ], + "summary": "List Payment Request EDI Files", + "operationId": "indexPaymentRequestSyncadaFiles", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/PaymentRequestSyncadaFiles" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Payment Request EDI Files not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-request-syncada-files/{paymentRequestSyncadaFileId}": { + "get": { + "description": "Returns a Payment Request EDI858 file", + "produces": [ + "application/json" + ], + "tags": [ + "Payment Request Syncada File" + ], + "summary": "Payment Request EDI File", + "operationId": "paymentRequestSyncadaFile", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "paymentRequestSyncadaFileId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/PaymentRequestSyncadaFile" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Payment Request EDI Files not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/requested-office-users": { + "get": { + "description": "This endpoint returns a list of Office Users. Do not use this endpoint directly\nas it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "List of Office Users Requesting Accounts", + "operationId": "indexRequestedOfficeUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUsers" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/requested-office-users/{officeUserId}": { + "get": { + "description": "Retrieving a single office user in any status. This endpoint is used in the Admin UI that will allow the admin user to view the user's relevant data.", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "Get a Requested Office User", + "operationId": "getRequestedOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "Updates a requested office user to include profile data and status. This will be used in the Admin UI for approving/rejecting/updating a user.", + "produces": [ + "application/json" + ], + "tags": [ + "Requested office users" + ], + "summary": "Update a Requested Office User", + "operationId": "updateRequestedOfficeUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "officeUserId", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RequestedOfficeUserUpdate" + } + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Office User not found" + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadId}": { + "get": { + "description": "This endpoint returns a single Upload by ID containing the given Upload and\ninformation about the Uploader and Move. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Uploads" + ], + "summary": "Get information about an Upload", + "operationId": "getUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "uploadId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/UploadInformation" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Upload not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/user": { + "get": { + "description": "Returns the admin user info for the currently logged in user", + "tags": [ + "User" + ], + "summary": "Gets the data about the currently signed in admin user", + "operationId": "getLoggedInAdminUser", + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/AdminUser" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Admin User not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users": { + "get": { + "description": "This endpoint returns a list of Users. Do not use this endpoint directly as it\nis meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "List Users", + "operationId": "indexUsers", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/Users" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Users not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/{userId}": { + "get": { + "description": "This endpoint returns a single User by ID. This also returns the User's sessions\nas well. Do not use this endpoint directly as it is meant to be used with the\nAdmin UI exclusively.\n\n", + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Get information about a User", + "operationId": "getUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "userId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "User not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single User by ID. This can be used by the Admin User to\nupdate the User's session or the User's active status. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Users" + ], + "summary": "Update a User's session or active status", + "operationId": "updateUser", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "userId", + "in": "path", + "required": true + }, + { + "description": "User information", + "name": "User", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UserUpdate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated User", + "schema": { + "$ref": "#/definitions/User" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update this User" + }, + "404": { + "description": "Not found" + }, + "422": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "Server error" + } + } + } + }, + "/webhook-subscriptions": { + "get": { + "description": "This endpoint returns a list of Webhook Subscriptions. Do not use this endpoint\ndirectly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Lists Webhook Subscriptions", + "operationId": "indexWebhookSubscriptions", + "parameters": [ + { + "type": "string", + "name": "filter", + "in": "query" + }, + { + "type": "integer", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "sort", + "in": "query" + }, + { + "type": "boolean", + "name": "order", + "in": "query" + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/WebhookSubscriptions" + }, + "headers": { + "Content-Range": { + "type": "string", + "description": "Used for pagination" + } + } + }, + "400": { + "description": "Invalid request" + }, + "401": { + "description": "Not authenticated for this endpoint" + }, + "404": { + "description": "Webhook Subscriptions not found" + }, + "500": { + "description": "Server error" + } + } + }, + "post": { + "description": "This endpoint creates a Webhook Subscription and returns the created record in\nthe ` + "`" + `201` + "`" + ` response. Do not use this endpoint directly as it is meant to be used\nwith the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Create a Webhook Subscription", + "operationId": "createWebhookSubscription", + "parameters": [ + { + "description": "Webhook subscription information", + "name": "webhookSubscription", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateWebhookSubscription" + } + } + ], + "responses": { + "201": { + "description": "Successfully created Webhook Subscription", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to create a Webhook Subscription" + }, + "500": { + "description": "Server error" + } + } + } + }, + "/webhook-subscriptions/{webhookSubscriptionId}": { + "get": { + "description": "This endpoint returns a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Get information about a Webhook Subscription", + "operationId": "getWebhookSubscription", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "webhookSubscriptionId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "success", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "404": { + "description": "Webhook Subscription not found" + }, + "500": { + "description": "server error" + } + } + }, + "patch": { + "description": "This endpoint updates a single Webhook Subscription by ID. Do not use this\nendpoint directly as it is meant to be used with the Admin UI exclusively.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "Webhook subscriptions" + ], + "summary": "Update a Webhook Subscription", + "operationId": "updateWebhookSubscription", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "webhookSubscriptionId", + "in": "path", + "required": true + }, + { + "description": "Webhook Subscription information", + "name": "WebhookSubscription", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated Webhook Subscription", + "schema": { + "$ref": "#/definitions/WebhookSubscription" + } + }, + "400": { + "description": "Invalid Request" + }, + "401": { + "description": "Must be authenticated to use this end point" + }, + "403": { + "description": "Not authorized to update this Webhook Subscription" + }, + "404": { + "description": "Webhook Subscription not found" + }, + "412": { + "description": "Precondition failed" + }, + "422": { + "description": "Validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "Server error" + } + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "required": [ + "streetAddress1", + "state", + "city", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "description": "zip code, international allowed", + "type": "string", + "format": "zip", + "title": "ZIP", + "example": "'90210' or 'N15 3NL'" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Address line 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Address line 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address line 3", + "x-nullable": true, + "example": "Montmârtre" + } + } + }, + "AdminUser": { + "type": "object", + "required": [ + "id", + "firstName", + "lastName", + "email", + "userId", + "organizationId", + "active", + "super", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "organizationId": { + "type": "string", + "format": "uuid" + }, + "super": { + "type": "boolean" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "AdminUserCreate": { + "type": "object", + "properties": { + "email": { + "type": "string", + "title": "Email", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name" + }, + "lastName": { + "type": "string", + "title": "Last Name" + }, + "organizationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "super": { + "type": "boolean" + } + } + }, + "AdminUserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "super": { + "type": "boolean", + "x-nullable": true + } + } + }, + "AdminUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/AdminUser" + } + }, + "ClientCertificate": { + "type": "object", + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean" + }, + "allowAirForceOrdersWrite": { + "type": "boolean" + }, + "allowArmyOrdersRead": { + "type": "boolean" + }, + "allowArmyOrdersWrite": { + "type": "boolean" + }, + "allowCoastGuardOrdersRead": { + "type": "boolean" + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean" + }, + "allowDpsAuthAPI": { + "type": "boolean" + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean" + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean" + }, + "allowNavyOrdersRead": { + "type": "boolean" + }, + "allowNavyOrdersWrite": { + "type": "boolean" + }, + "allowOrdersAPI": { + "type": "boolean" + }, + "allowPPTAS": { + "type": "boolean" + }, + "allowPrime": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ClientCertificateCreate": { + "type": "object", + "required": [ + "sha256Digest", + "subject", + "email" + ], + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean" + }, + "allowAirForceOrdersWrite": { + "type": "boolean" + }, + "allowArmyOrdersRead": { + "type": "boolean" + }, + "allowArmyOrdersWrite": { + "type": "boolean" + }, + "allowCoastGuardOrdersRead": { + "type": "boolean" + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean" + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean" + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean" + }, + "allowNavyOrdersRead": { + "type": "boolean" + }, + "allowNavyOrdersWrite": { + "type": "boolean" + }, + "allowOrdersAPI": { + "type": "boolean" + }, + "allowPPTAS": { + "type": "boolean" + }, + "allowPrime": { + "type": "boolean" + }, + "email": { + "type": "string", + "example": "user@example.com" + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + } + } + }, + "ClientCertificateUpdate": { + "type": "object", + "properties": { + "allowAirForceOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowAirForceOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowArmyOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowArmyOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowCoastGuardOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowCoastGuardOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowDpsAuthAPI": { + "type": "boolean", + "x-nullable": true + }, + "allowMarineCorpsOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowMarineCorpsOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowNavyOrdersRead": { + "type": "boolean", + "x-nullable": true + }, + "allowNavyOrdersWrite": { + "type": "boolean", + "x-nullable": true + }, + "allowOrdersAPI": { + "type": "boolean", + "x-nullable": true + }, + "allowPPTAS": { + "type": "boolean", + "x-nullable": true + }, + "allowPrime": { + "type": "boolean", + "x-nullable": true + }, + "sha256Digest": { + "type": "string", + "example": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b" + }, + "subject": { + "type": "string", + "example": "CN=example-user,OU=DoD+OU=PKI+OU=CONTRACTOR,O=U.S. Government,C=US" + } + } + }, + "ClientCertificates": { + "type": "array", + "items": { + "$ref": "#/definitions/ClientCertificate" + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateWebhookSubscription": { + "type": "object", + "required": [ + "subscriberId", + "status", + "eventKey", + "callbackUrl" + ], + "properties": { + "callbackUrl": { + "description": "The URL to which the notifications for this subscription will be pushed to.", + "type": "string" + }, + "eventKey": { + "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/WebhookSubscriptionStatus" + }, + "subscriberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ElectronicOrder": { + "type": "object", + "required": [ + "id", + "issuer", + "ordersNumber", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "issuer": { + "$ref": "#/definitions/Issuer" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "title": "Updated at", + "readOnly": true + } + } + }, + "ElectronicOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/ElectronicOrder" + } + }, + "ElectronicOrdersTotal": { + "type": "object", + "properties": { + "category": { + "type": "string" + }, + "count": { + "type": "integer", + "title": "Total Orders Count", + "minimum": 0 + } + } + }, + "ElectronicOrdersTotals": { + "type": "array", + "items": { + "$ref": "#/definitions/ElectronicOrdersTotal" + } + }, + "Issuer": { + "description": "Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded.", + "type": "string", + "enum": [ + "army", + "navy", + "air-force", + "marine-corps", + "coast-guard" + ] + }, + "Move": { + "type": "object", + "required": [ + "id", + "ordersId", + "locator", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "ordersId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMember": { + "$ref": "#/definitions/ServiceMember" + }, + "show": { + "type": "boolean", + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MoveStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MoveUpdate": { + "type": "object", + "required": [ + "show" + ], + "properties": { + "show": { + "type": "boolean" + } + } + }, + "Moves": { + "type": "array", + "items": { + "$ref": "#/definitions/Move" + } + }, + "Notification": { + "type": "object", + "required": [ + "id", + "email", + "serviceMemberId", + "sesMessageId", + "notificationType", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "notificationType": { + "type": "string", + "enum": [ + "MOVE_PAYMENT_REMINDER_EMAIL" + ] + }, + "serviceMemberId": { + "type": "string", + "format": "uuid" + }, + "sesMessageId": { + "type": "string" + } + } + }, + "Notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/Notification" + } + }, + "OfficeUser": { + "type": "object", + "required": [ + "id", + "firstName", + "middleInitials", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "transportationOfficeAssignments", + "active", + "roles", + "edipi", + "otherUniqueId", + "rejectionReason", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "middleInitials": { + "type": "string" + }, + "otherUniqueId": { + "type": "string" + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/Privilege" + } + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REQUESTED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "OfficeUserCreate": { + "type": "object", + "properties": { + "email": { + "type": "string", + "title": "Email", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name" + }, + "lastName": { + "type": "string", + "title": "Last Name" + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "L." + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserPrivilege" + }, + "x-nullable": true + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" + } + } + } + }, + "OfficeUserPrivilege": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "title": "privilegeType", + "x-nullable": true, + "example": "supervisor" + } + } + }, + "OfficeUserRole": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "title": "roleType", + "x-nullable": true, + "example": "task_ordering_officer" + } + } + }, + "OfficeUserTransportationOfficeAssignment": { + "type": "object", + "properties": { + "primaryOffice": { + "type": "boolean", + "title": "primaryOffice", + "x-nullable": true + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "title": "transportationOfficeId", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OfficeUserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "Q." + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserPrivilege" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserTransportationOfficeAssignment" + } + } + } + }, + "OfficeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUser" + } + }, + "OktaAccountInfoResponse": { + "type": "object", + "properties": { + "activated": { + "type": "string" + }, + "created": { + "type": "string" + }, + "credentials": { + "type": "object" + }, + "id": { + "type": "string" + }, + "profile": { + "type": "object" + }, + "status": { + "type": "string" + } + } + }, + "Organization": { + "type": "object", + "required": [ + "id", + "name", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "title": "Name" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "title": "Updated at", + "readOnly": true + } + } + }, + "Organizations": { + "type": "array", + "items": { + "$ref": "#/definitions/Organization" + } + }, + "PaymentRequestSyncadaFile": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "ediString": { + "type": "string" + }, + "fileName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string" + } + } + }, + "PaymentRequestSyncadaFiles": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequestSyncadaFile" + } + }, + "Privilege": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "privilegeName": { + "type": "string", + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "example": "supervisor" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "RequestedOfficeUserUpdate": { + "type": "object", + "properties": { + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "Q." + }, + "otherUniqueId": { + "type": "string" + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "roleName", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleName": { + "type": "string", + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ServiceMember": { + "type": "object", + "properties": { + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": true + }, + "middleName": { + "type": "string", + "title": "Middle Name", + "x-nullable": true + }, + "userId": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "createdAt", + "updatedAt" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phoneLines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "Upload": { + "type": "object", + "properties": { + "contentType": { + "type": "string", + "enum": [ + "application/pdf", + "image/jpeg", + "image/png" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time", + "title": "Created at", + "readOnly": true + }, + "filename": { + "type": "string" + }, + "size": { + "type": "integer", + "title": "Size in Bytes" + } + } + }, + "UploadInformation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveLocator": { + "type": "string", + "x-nullable": true, + "example": "12432" + }, + "officeUserEmail": { + "type": "string", + "x-nullable": true + }, + "officeUserFirstName": { + "type": "string", + "x-nullable": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "officeUserLastName": { + "type": "string", + "x-nullable": true + }, + "officeUserPhone": { + "type": "string", + "x-nullable": true + }, + "serviceMemberEmail": { + "type": "string", + "x-nullable": true + }, + "serviceMemberFirstName": { + "type": "string", + "x-nullable": true + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMemberLastName": { + "type": "string", + "x-nullable": true + }, + "serviceMemberPhone": { + "type": "string", + "x-nullable": true + }, + "upload": { + "$ref": "#/definitions/Upload" + } + } + }, + "User": { + "type": "object", + "required": [ + "oktaEmail", + "active", + "createdAt", + "updatedAt", + "currentAdminSessionId", + "currentMilSessionId", + "currentOfficeSessionId" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "currentAdminSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "currentMilSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "currentOfficeSessionId": { + "type": "string", + "example": "WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "oktaEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "UserUpdate": { + "type": "object", + "properties": { + "active": { + "type": "boolean", + "x-nullable": true + }, + "revokeAdminSession": { + "type": "boolean", + "x-nullable": true + }, + "revokeMilSession": { + "type": "boolean", + "x-nullable": true + }, + "revokeOfficeSession": { + "type": "boolean", + "x-nullable": true + } + } + }, + "Users": { + "type": "array", + "items": { + "$ref": "#/definitions/User" + } + }, + "ValidationError": { + "required": [ + "invalidFields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "$ref": "#/definitions/ValidationErrorAllOf1" + } + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ValidationErrorAllOf1": { + "type": "object" + }, + "WebhookSubscription": { + "description": "Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically.", + "type": "object", + "properties": { + "callbackUrl": { + "description": "The URL to which the notifications for this subscription will be pushed to.", + "type": "string", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "eventKey": { + "description": "A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications.", + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "severity": { + "type": "integer", + "minimum": 0, + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/WebhookSubscriptionStatus" + }, + "subscriberId": { + "description": "Unique identifier for the subscriber", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "d494f114-05a2-4b39-840c-3d33243b7e29" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WebhookSubscriptionStatus": { + "type": "string", + "title": "Webhook subscription status", + "enum": [ + "ACTIVE", + "FAILING", + "DISABLED" + ], + "x-display-value": { + "ACTIVE": "Active", + "DISABLED": "Disabled", + "FAILING": "Failing" + }, + "x-nullable": true + }, + "WebhookSubscriptions": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookSubscription" + } + } + }, + "tags": [ + { + "description": "Information about Admin UI users", + "name": "Admin users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about Client Certificates", + "name": "Client certificates", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about electronic orders", + "name": "Electronic orders", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about moves", + "name": "Moves", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about notifications", + "name": "Notifications", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about transportation offices", + "name": "Transportation offices", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about office users", + "name": "Office users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about organizations", + "name": "Organizations", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about uploads", + "name": "Uploads", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about requested office users", + "name": "Requested office users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about users", + "name": "Users", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + }, + { + "description": "Information about Webhook subscriptions", + "name": "Webhook subscriptions", + "externalDocs": { + "url": "https://transcom.github.io/mymove-docs/docs/api" + } + } + ] +}`)) +} diff --git a/pkg/gen/adminapi/server.go b/pkg/gen/adminapi/server.go new file mode 100644 index 00000000000..4909a6a53ee --- /dev/null +++ b/pkg/gen/adminapi/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/adminapi/adminoperations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTPS, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *adminoperations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *adminoperations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *adminoperations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/adminmessages/electronic_order.go b/pkg/gen/adminmessages/electronic_order.go new file mode 100644 index 00000000000..0d7f8472aed --- /dev/null +++ b/pkg/gen/adminmessages/electronic_order.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ElectronicOrder electronic order +// +// swagger:model ElectronicOrder +type ElectronicOrder struct { + + // Created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // issuer + // Required: true + Issuer *Issuer `json:"issuer"` + + // Orders Number + // Required: true + OrdersNumber *string `json:"ordersNumber"` + + // Updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this electronic order +func (m *ElectronicOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssuer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ElectronicOrder) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ElectronicOrder) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ElectronicOrder) validateIssuer(formats strfmt.Registry) error { + + if err := validate.Required("issuer", "body", m.Issuer); err != nil { + return err + } + + if err := validate.Required("issuer", "body", m.Issuer); err != nil { + return err + } + + if m.Issuer != nil { + if err := m.Issuer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("issuer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("issuer") + } + return err + } + } + + return nil +} + +func (m *ElectronicOrder) validateOrdersNumber(formats strfmt.Registry) error { + + if err := validate.Required("ordersNumber", "body", m.OrdersNumber); err != nil { + return err + } + + return nil +} + +func (m *ElectronicOrder) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this electronic order based on the context it is used +func (m *ElectronicOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateIssuer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ElectronicOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ElectronicOrder) contextValidateIssuer(ctx context.Context, formats strfmt.Registry) error { + + if m.Issuer != nil { + + if err := m.Issuer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("issuer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("issuer") + } + return err + } + } + + return nil +} + +func (m *ElectronicOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ElectronicOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ElectronicOrder) UnmarshalBinary(b []byte) error { + var res ElectronicOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/electronic_orders.go b/pkg/gen/adminmessages/electronic_orders.go new file mode 100644 index 00000000000..97ce00e09af --- /dev/null +++ b/pkg/gen/adminmessages/electronic_orders.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ElectronicOrders electronic orders +// +// swagger:model ElectronicOrders +type ElectronicOrders []*ElectronicOrder + +// Validate validates this electronic orders +func (m ElectronicOrders) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this electronic orders based on the context it is used +func (m ElectronicOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/electronic_orders_total.go b/pkg/gen/adminmessages/electronic_orders_total.go new file mode 100644 index 00000000000..040fbc49a4e --- /dev/null +++ b/pkg/gen/adminmessages/electronic_orders_total.go @@ -0,0 +1,77 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ElectronicOrdersTotal electronic orders total +// +// swagger:model ElectronicOrdersTotal +type ElectronicOrdersTotal struct { + + // category + Category string `json:"category,omitempty"` + + // Total Orders Count + // Minimum: 0 + Count *int64 `json:"count,omitempty"` +} + +// Validate validates this electronic orders total +func (m *ElectronicOrdersTotal) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCount(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ElectronicOrdersTotal) validateCount(formats strfmt.Registry) error { + if swag.IsZero(m.Count) { // not required + return nil + } + + if err := validate.MinimumInt("count", "body", *m.Count, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this electronic orders total based on context it is used +func (m *ElectronicOrdersTotal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ElectronicOrdersTotal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ElectronicOrdersTotal) UnmarshalBinary(b []byte) error { + var res ElectronicOrdersTotal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/electronic_orders_totals.go b/pkg/gen/adminmessages/electronic_orders_totals.go new file mode 100644 index 00000000000..69925632842 --- /dev/null +++ b/pkg/gen/adminmessages/electronic_orders_totals.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ElectronicOrdersTotals electronic orders totals +// +// swagger:model ElectronicOrdersTotals +type ElectronicOrdersTotals []*ElectronicOrdersTotal + +// Validate validates this electronic orders totals +func (m ElectronicOrdersTotals) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this electronic orders totals based on the context it is used +func (m ElectronicOrdersTotals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/issuer.go b/pkg/gen/adminmessages/issuer.go new file mode 100644 index 00000000000..81dd9693167 --- /dev/null +++ b/pkg/gen/adminmessages/issuer.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Issuer Organization that issues orders. If more organizations, especially civilian ones, become clients of this API in the future, this enumeration may need to be expanded. +// +// swagger:model Issuer +type Issuer string + +func NewIssuer(value Issuer) *Issuer { + return &value +} + +// Pointer returns a pointer to a freshly-allocated Issuer. +func (m Issuer) Pointer() *Issuer { + return &m +} + +const ( + + // IssuerArmy captures enum value "army" + IssuerArmy Issuer = "army" + + // IssuerNavy captures enum value "navy" + IssuerNavy Issuer = "navy" + + // IssuerAirDashForce captures enum value "air-force" + IssuerAirDashForce Issuer = "air-force" + + // IssuerMarineDashCorps captures enum value "marine-corps" + IssuerMarineDashCorps Issuer = "marine-corps" + + // IssuerCoastDashGuard captures enum value "coast-guard" + IssuerCoastDashGuard Issuer = "coast-guard" +) + +// for schema +var issuerEnum []interface{} + +func init() { + var res []Issuer + if err := json.Unmarshal([]byte(`["army","navy","air-force","marine-corps","coast-guard"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + issuerEnum = append(issuerEnum, v) + } +} + +func (m Issuer) validateIssuerEnum(path, location string, value Issuer) error { + if err := validate.EnumCase(path, location, value, issuerEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this issuer +func (m Issuer) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateIssuerEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this issuer based on context it is used +func (m Issuer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/adminmessages/move.go b/pkg/gen/adminmessages/move.go new file mode 100644 index 00000000000..1cdbf840cf1 --- /dev/null +++ b/pkg/gen/adminmessages/move.go @@ -0,0 +1,295 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Move move +// +// swagger:model Move +type Move struct { + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // locator + // Example: 12432 + // Required: true + Locator *string `json:"locator"` + + // orders Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + OrdersID *strfmt.UUID `json:"ordersId"` + + // service member + ServiceMember *ServiceMember `json:"serviceMember,omitempty"` + + // show + Show *bool `json:"show,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this move +func (m *Move) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMember(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Move) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateLocator(formats strfmt.Registry) error { + + if err := validate.Required("locator", "body", m.Locator); err != nil { + return err + } + + return nil +} + +func (m *Move) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.Required("ordersId", "body", m.OrdersID); err != nil { + return err + } + + if err := validate.FormatOf("ordersId", "body", "uuid", m.OrdersID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateServiceMember(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMember) { // not required + return nil + } + + if m.ServiceMember != nil { + if err := m.ServiceMember.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceMember") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceMember") + } + return err + } + } + + return nil +} + +func (m *Move) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *Move) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move based on the context it is used +func (m *Move) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceMember(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Move) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Move) contextValidateServiceMember(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceMember != nil { + + if swag.IsZero(m.ServiceMember) { // not required + return nil + } + + if err := m.ServiceMember.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceMember") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceMember") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *Move) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Move) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Move) UnmarshalBinary(b []byte) error { + var res Move + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/move_status.go b/pkg/gen/adminmessages/move_status.go new file mode 100644 index 00000000000..71801df750f --- /dev/null +++ b/pkg/gen/adminmessages/move_status.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MoveStatus Move status +// +// swagger:model MoveStatus +type MoveStatus string + +func NewMoveStatus(value MoveStatus) *MoveStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MoveStatus. +func (m MoveStatus) Pointer() *MoveStatus { + return &m +} + +const ( + + // MoveStatusDRAFT captures enum value "DRAFT" + MoveStatusDRAFT MoveStatus = "DRAFT" + + // MoveStatusSUBMITTED captures enum value "SUBMITTED" + MoveStatusSUBMITTED MoveStatus = "SUBMITTED" + + // MoveStatusAPPROVED captures enum value "APPROVED" + MoveStatusAPPROVED MoveStatus = "APPROVED" + + // MoveStatusCANCELED captures enum value "CANCELED" + MoveStatusCANCELED MoveStatus = "CANCELED" +) + +// for schema +var moveStatusEnum []interface{} + +func init() { + var res []MoveStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveStatusEnum = append(moveStatusEnum, v) + } +} + +func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { + if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this move status +func (m MoveStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMoveStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this move status based on context it is used +func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/adminmessages/move_update.go b/pkg/gen/adminmessages/move_update.go new file mode 100644 index 00000000000..03c61926b4c --- /dev/null +++ b/pkg/gen/adminmessages/move_update.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveUpdate move update +// +// swagger:model MoveUpdate +type MoveUpdate struct { + + // show + // Required: true + Show *bool `json:"show"` +} + +// Validate validates this move update +func (m *MoveUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateShow(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveUpdate) validateShow(formats strfmt.Registry) error { + + if err := validate.Required("show", "body", m.Show); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this move update based on context it is used +func (m *MoveUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MoveUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveUpdate) UnmarshalBinary(b []byte) error { + var res MoveUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/moves.go b/pkg/gen/adminmessages/moves.go new file mode 100644 index 00000000000..4336a71af8e --- /dev/null +++ b/pkg/gen/adminmessages/moves.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Moves moves +// +// swagger:model Moves +type Moves []*Move + +// Validate validates this moves +func (m Moves) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this moves based on the context it is used +func (m Moves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/notification.go b/pkg/gen/adminmessages/notification.go new file mode 100644 index 00000000000..fb0dafd9ef3 --- /dev/null +++ b/pkg/gen/adminmessages/notification.go @@ -0,0 +1,224 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Notification notification +// +// swagger:model Notification +type Notification struct { + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // email + // Required: true + Email *string `json:"email"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // notification type + // Required: true + // Enum: [MOVE_PAYMENT_REMINDER_EMAIL] + NotificationType *string `json:"notificationType"` + + // service member Id + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"serviceMemberId"` + + // ses message Id + // Required: true + SesMessageID *string `json:"sesMessageId"` +} + +// Validate validates this notification +func (m *Notification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNotificationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSesMessageID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Notification) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Notification) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + return nil +} + +func (m *Notification) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +var notificationTypeNotificationTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["MOVE_PAYMENT_REMINDER_EMAIL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + notificationTypeNotificationTypePropEnum = append(notificationTypeNotificationTypePropEnum, v) + } +} + +const ( + + // NotificationNotificationTypeMOVEPAYMENTREMINDEREMAIL captures enum value "MOVE_PAYMENT_REMINDER_EMAIL" + NotificationNotificationTypeMOVEPAYMENTREMINDEREMAIL string = "MOVE_PAYMENT_REMINDER_EMAIL" +) + +// prop value enum +func (m *Notification) validateNotificationTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, notificationTypeNotificationTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Notification) validateNotificationType(formats strfmt.Registry) error { + + if err := validate.Required("notificationType", "body", m.NotificationType); err != nil { + return err + } + + // value enum + if err := m.validateNotificationTypeEnum("notificationType", "body", *m.NotificationType); err != nil { + return err + } + + return nil +} + +func (m *Notification) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("serviceMemberId", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Notification) validateSesMessageID(formats strfmt.Registry) error { + + if err := validate.Required("sesMessageId", "body", m.SesMessageID); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this notification based on the context it is used +func (m *Notification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Notification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Notification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Notification) UnmarshalBinary(b []byte) error { + var res Notification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/notifications.go b/pkg/gen/adminmessages/notifications.go new file mode 100644 index 00000000000..04ca2ba9f05 --- /dev/null +++ b/pkg/gen/adminmessages/notifications.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Notifications notifications +// +// swagger:model Notifications +type Notifications []*Notification + +// Validate validates this notifications +func (m Notifications) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this notifications based on the context it is used +func (m Notifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/office_user.go b/pkg/gen/adminmessages/office_user.go new file mode 100644 index 00000000000..0a58b7a0861 --- /dev/null +++ b/pkg/gen/adminmessages/office_user.go @@ -0,0 +1,606 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUser office user +// +// swagger:model OfficeUser +type OfficeUser struct { + + // active + // Required: true + Active *bool `json:"active"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // edipi + // Required: true + Edipi *string `json:"edipi"` + + // email + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email"` + + // first name + // Required: true + FirstName *string `json:"firstName"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // last name + // Required: true + LastName *string `json:"lastName"` + + // middle initials + // Required: true + MiddleInitials *string `json:"middleInitials"` + + // other unique Id + // Required: true + OtherUniqueID *string `json:"otherUniqueId"` + + // privileges + Privileges []*Privilege `json:"privileges"` + + // rejection reason + // Required: true + RejectionReason *string `json:"rejectionReason"` + + // roles + // Required: true + Roles []*Role `json:"roles"` + + // status + // Required: true + // Enum: [APPROVED REQUESTED REJECTED] + Status *string `json:"status"` + + // telephone + // Required: true + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone"` + + // transportation office assignments + // Required: true + TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportationOfficeAssignments"` + + // transportation office Id + // Required: true + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // user Id + // Format: uuid + UserID strfmt.UUID `json:"userId,omitempty"` +} + +// Validate validates this office user +func (m *OfficeUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActive(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMiddleInitials(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtherUniqueID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivileges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRejectionReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeAssignments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) validateActive(formats strfmt.Registry) error { + + if err := validate.Required("active", "body", m.Active); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateEdipi(formats strfmt.Registry) error { + + if err := validate.Required("edipi", "body", m.Edipi); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateFirstName(formats strfmt.Registry) error { + + if err := validate.Required("firstName", "body", m.FirstName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateLastName(formats strfmt.Registry) error { + + if err := validate.Required("lastName", "body", m.LastName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateMiddleInitials(formats strfmt.Registry) error { + + if err := validate.Required("middleInitials", "body", m.MiddleInitials); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateOtherUniqueID(formats strfmt.Registry) error { + + if err := validate.Required("otherUniqueId", "body", m.OtherUniqueID); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validatePrivileges(formats strfmt.Registry) error { + if swag.IsZero(m.Privileges) { // not required + return nil + } + + for i := 0; i < len(m.Privileges); i++ { + if swag.IsZero(m.Privileges[i]) { // not required + continue + } + + if m.Privileges[i] != nil { + if err := m.Privileges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) validateRejectionReason(formats strfmt.Registry) error { + + if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateRoles(formats strfmt.Registry) error { + + if err := validate.Required("roles", "body", m.Roles); err != nil { + return err + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var officeUserTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["APPROVED","REQUESTED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + officeUserTypeStatusPropEnum = append(officeUserTypeStatusPropEnum, v) + } +} + +const ( + + // OfficeUserStatusAPPROVED captures enum value "APPROVED" + OfficeUserStatusAPPROVED string = "APPROVED" + + // OfficeUserStatusREQUESTED captures enum value "REQUESTED" + OfficeUserStatusREQUESTED string = "REQUESTED" + + // OfficeUserStatusREJECTED captures enum value "REJECTED" + OfficeUserStatusREJECTED string = "REJECTED" +) + +// prop value enum +func (m *OfficeUser) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, officeUserTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *OfficeUser) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateTelephone(formats strfmt.Registry) error { + + if err := validate.Required("telephone", "body", m.Telephone); err != nil { + return err + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeAssignments", "body", m.TransportationOfficeAssignments); err != nil { + return err + } + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + continue + } + + if m.TransportationOfficeAssignments[i] != nil { + if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this office user based on the context it is used +func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrivileges(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Privileges); i++ { + + if m.Privileges[i] != nil { + + if swag.IsZero(m.Privileges[i]) { // not required + return nil + } + + if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + + if m.TransportationOfficeAssignments[i] != nil { + + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + return nil + } + + if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUser) UnmarshalBinary(b []byte) error { + var res OfficeUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_user_create.go b/pkg/gen/adminmessages/office_user_create.go new file mode 100644 index 00000000000..6ad14306927 --- /dev/null +++ b/pkg/gen/adminmessages/office_user_create.go @@ -0,0 +1,281 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUserCreate office user create +// +// swagger:model OfficeUserCreate +type OfficeUserCreate struct { + + // Email + // Example: user@userdomain.com + Email string `json:"email,omitempty"` + + // First Name + FirstName string `json:"firstName,omitempty"` + + // Last Name + LastName string `json:"lastName,omitempty"` + + // Middle Initials + // Example: L. + MiddleInitials *string `json:"middleInitials,omitempty"` + + // privileges + Privileges []*OfficeUserPrivilege `json:"privileges"` + + // roles + Roles []*OfficeUserRole `json:"roles"` + + // telephone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone string `json:"telephone,omitempty"` + + // transportation office assignments + TransportationOfficeAssignments []*OfficeUserTransportationOfficeAssignment `json:"transportationOfficeAssignments"` +} + +// Validate validates this office user create +func (m *OfficeUserCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrivileges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeAssignments(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserCreate) validatePrivileges(formats strfmt.Registry) error { + if swag.IsZero(m.Privileges) { // not required + return nil + } + + for i := 0; i < len(m.Privileges); i++ { + if swag.IsZero(m.Privileges[i]) { // not required + continue + } + + if m.Privileges[i] != nil { + if err := m.Privileges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserCreate) validateRoles(formats strfmt.Registry) error { + if swag.IsZero(m.Roles) { // not required + return nil + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserCreate) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateTransportationOfficeAssignments(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeAssignments) { // not required + return nil + } + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + continue + } + + if m.TransportationOfficeAssignments[i] != nil { + if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this office user create based on the context it is used +func (m *OfficeUserCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePrivileges(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserCreate) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Privileges); i++ { + + if m.Privileges[i] != nil { + + if swag.IsZero(m.Privileges[i]) { // not required + return nil + } + + if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserCreate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserCreate) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + + if m.TransportationOfficeAssignments[i] != nil { + + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + return nil + } + + if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserCreate) UnmarshalBinary(b []byte) error { + var res OfficeUserCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_user_privilege.go b/pkg/gen/adminmessages/office_user_privilege.go new file mode 100644 index 00000000000..12c03673388 --- /dev/null +++ b/pkg/gen/adminmessages/office_user_privilege.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OfficeUserPrivilege office user privilege +// +// swagger:model OfficeUserPrivilege +type OfficeUserPrivilege struct { + + // name + // Example: Supervisor + Name *string `json:"name,omitempty"` + + // privilegeType + // Example: supervisor + PrivilegeType *string `json:"privilegeType,omitempty"` +} + +// Validate validates this office user privilege +func (m *OfficeUserPrivilege) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this office user privilege based on context it is used +func (m *OfficeUserPrivilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserPrivilege) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserPrivilege) UnmarshalBinary(b []byte) error { + var res OfficeUserPrivilege + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_user_role.go b/pkg/gen/adminmessages/office_user_role.go new file mode 100644 index 00000000000..a3ef0e1e119 --- /dev/null +++ b/pkg/gen/adminmessages/office_user_role.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OfficeUserRole office user role +// +// swagger:model OfficeUserRole +type OfficeUserRole struct { + + // name + // Example: Task Ordering Officer + Name *string `json:"name,omitempty"` + + // roleType + // Example: task_ordering_officer + RoleType *string `json:"roleType,omitempty"` +} + +// Validate validates this office user role +func (m *OfficeUserRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this office user role based on context it is used +func (m *OfficeUserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserRole) UnmarshalBinary(b []byte) error { + var res OfficeUserRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_user_transportation_office_assignment.go b/pkg/gen/adminmessages/office_user_transportation_office_assignment.go new file mode 100644 index 00000000000..ad1fcaffffb --- /dev/null +++ b/pkg/gen/adminmessages/office_user_transportation_office_assignment.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUserTransportationOfficeAssignment office user transportation office assignment +// +// swagger:model OfficeUserTransportationOfficeAssignment +type OfficeUserTransportationOfficeAssignment struct { + + // primaryOffice + PrimaryOffice *bool `json:"primaryOffice,omitempty"` + + // transportationOfficeId + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` +} + +// Validate validates this office user transportation office assignment +func (m *OfficeUserTransportationOfficeAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserTransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this office user transportation office assignment based on context it is used +func (m *OfficeUserTransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserTransportationOfficeAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserTransportationOfficeAssignment) UnmarshalBinary(b []byte) error { + var res OfficeUserTransportationOfficeAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_user_update.go b/pkg/gen/adminmessages/office_user_update.go new file mode 100644 index 00000000000..1210927a8e6 --- /dev/null +++ b/pkg/gen/adminmessages/office_user_update.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUserUpdate office user update +// +// swagger:model OfficeUserUpdate +type OfficeUserUpdate struct { + + // active + Active *bool `json:"active,omitempty"` + + // First Name + FirstName *string `json:"firstName,omitempty"` + + // Last Name + LastName *string `json:"lastName,omitempty"` + + // Middle Initials + // Example: Q. + MiddleInitials *string `json:"middleInitials,omitempty"` + + // privileges + Privileges []*OfficeUserPrivilege `json:"privileges"` + + // roles + Roles []*OfficeUserRole `json:"roles"` + + // telephone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // transportation office assignments + TransportationOfficeAssignments []*OfficeUserTransportationOfficeAssignment `json:"transportationOfficeAssignments"` +} + +// Validate validates this office user update +func (m *OfficeUserUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePrivileges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeAssignments(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserUpdate) validatePrivileges(formats strfmt.Registry) error { + if swag.IsZero(m.Privileges) { // not required + return nil + } + + for i := 0; i < len(m.Privileges); i++ { + if swag.IsZero(m.Privileges[i]) { // not required + continue + } + + if m.Privileges[i] != nil { + if err := m.Privileges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserUpdate) validateRoles(formats strfmt.Registry) error { + if swag.IsZero(m.Roles) { // not required + return nil + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserUpdate) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserUpdate) validateTransportationOfficeAssignments(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeAssignments) { // not required + return nil + } + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + continue + } + + if m.TransportationOfficeAssignments[i] != nil { + if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this office user update based on the context it is used +func (m *OfficeUserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePrivileges(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserUpdate) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Privileges); i++ { + + if m.Privileges[i] != nil { + + if swag.IsZero(m.Privileges[i]) { // not required + return nil + } + + if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserUpdate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserUpdate) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + + if m.TransportationOfficeAssignments[i] != nil { + + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + return nil + } + + if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserUpdate) UnmarshalBinary(b []byte) error { + var res OfficeUserUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/office_users.go b/pkg/gen/adminmessages/office_users.go new file mode 100644 index 00000000000..d7403604137 --- /dev/null +++ b/pkg/gen/adminmessages/office_users.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OfficeUsers office users +// +// swagger:model OfficeUsers +type OfficeUsers []*OfficeUser + +// Validate validates this office users +func (m OfficeUsers) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this office users based on the context it is used +func (m OfficeUsers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/okta_account_info_response.go b/pkg/gen/adminmessages/okta_account_info_response.go new file mode 100644 index 00000000000..aacfee8675f --- /dev/null +++ b/pkg/gen/adminmessages/okta_account_info_response.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OktaAccountInfoResponse okta account info response +// +// swagger:model OktaAccountInfoResponse +type OktaAccountInfoResponse struct { + + // activated + Activated string `json:"activated,omitempty"` + + // created + Created string `json:"created,omitempty"` + + // credentials + Credentials interface{} `json:"credentials,omitempty"` + + // id + ID string `json:"id,omitempty"` + + // profile + Profile interface{} `json:"profile,omitempty"` + + // status + Status string `json:"status,omitempty"` +} + +// Validate validates this okta account info response +func (m *OktaAccountInfoResponse) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this okta account info response based on context it is used +func (m *OktaAccountInfoResponse) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OktaAccountInfoResponse) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OktaAccountInfoResponse) UnmarshalBinary(b []byte) error { + var res OktaAccountInfoResponse + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/organization.go b/pkg/gen/adminmessages/organization.go new file mode 100644 index 00000000000..8e83517d172 --- /dev/null +++ b/pkg/gen/adminmessages/organization.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Organization organization +// +// swagger:model Organization +type Organization struct { + + // Created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // Name + // Required: true + Name *string `json:"name"` + + // telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // Updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this organization +func (m *Organization) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Organization) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Organization) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *Organization) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Organization) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *Organization) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *Organization) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this organization based on the context it is used +func (m *Organization) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Organization) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Organization) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Organization) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Organization) UnmarshalBinary(b []byte) error { + var res Organization + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/organizations.go b/pkg/gen/adminmessages/organizations.go new file mode 100644 index 00000000000..1c90c06aeb1 --- /dev/null +++ b/pkg/gen/adminmessages/organizations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Organizations organizations +// +// swagger:model Organizations +type Organizations []*Organization + +// Validate validates this organizations +func (m Organizations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this organizations based on the context it is used +func (m Organizations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/payment_request_syncada_file.go b/pkg/gen/adminmessages/payment_request_syncada_file.go new file mode 100644 index 00000000000..efc68406b0a --- /dev/null +++ b/pkg/gen/adminmessages/payment_request_syncada_file.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequestSyncadaFile payment request syncada file +// +// swagger:model PaymentRequestSyncadaFile +type PaymentRequestSyncadaFile struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // edi string + EdiString string `json:"ediString,omitempty"` + + // file name + FileName string `json:"fileName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // payment request number + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` +} + +// Validate validates this payment request syncada file +func (m *PaymentRequestSyncadaFile) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequestSyncadaFile) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequestSyncadaFile) 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 +} + +// ContextValidate validate this payment request syncada file based on the context it is used +func (m *PaymentRequestSyncadaFile) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequestSyncadaFile) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequestSyncadaFile) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequestSyncadaFile) UnmarshalBinary(b []byte) error { + var res PaymentRequestSyncadaFile + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/payment_request_syncada_files.go b/pkg/gen/adminmessages/payment_request_syncada_files.go new file mode 100644 index 00000000000..2aa965b1493 --- /dev/null +++ b/pkg/gen/adminmessages/payment_request_syncada_files.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequestSyncadaFiles payment request syncada files +// +// swagger:model PaymentRequestSyncadaFiles +type PaymentRequestSyncadaFiles []*PaymentRequestSyncadaFile + +// Validate validates this payment request syncada files +func (m PaymentRequestSyncadaFiles) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment request syncada files based on the context it is used +func (m PaymentRequestSyncadaFiles) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/privilege.go b/pkg/gen/adminmessages/privilege.go new file mode 100644 index 00000000000..36b0ce80d1f --- /dev/null +++ b/pkg/gen/adminmessages/privilege.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Privilege privilege +// +// swagger:model Privilege +type Privilege struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // id + // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // privilege name + // Example: Supervisor + PrivilegeName string `json:"privilegeName,omitempty"` + + // privilege type + // Example: supervisor + PrivilegeType string `json:"privilegeType,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this privilege +func (m *Privilege) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Privilege) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Privilege) 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 *Privilege) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this privilege based on the context it is used +func (m *Privilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Privilege) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Privilege) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Privilege) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Privilege) UnmarshalBinary(b []byte) error { + var res Privilege + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/requested_office_user_update.go b/pkg/gen/adminmessages/requested_office_user_update.go new file mode 100644 index 00000000000..3002224ef5d --- /dev/null +++ b/pkg/gen/adminmessages/requested_office_user_update.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RequestedOfficeUserUpdate requested office user update +// +// swagger:model RequestedOfficeUserUpdate +type RequestedOfficeUserUpdate struct { + + // edipi + Edipi string `json:"edipi,omitempty"` + + // email + // Example: user@userdomain.com + Email string `json:"email,omitempty"` + + // First Name + FirstName *string `json:"firstName,omitempty"` + + // Last Name + LastName *string `json:"lastName,omitempty"` + + // Middle Initials + // Example: Q. + MiddleInitials *string `json:"middleInitials,omitempty"` + + // other unique Id + OtherUniqueID string `json:"otherUniqueId,omitempty"` + + // rejection reason + RejectionReason string `json:"rejectionReason,omitempty"` + + // roles + Roles []*OfficeUserRole `json:"roles"` + + // status + // Enum: [APPROVED REJECTED] + Status string `json:"status,omitempty"` + + // telephone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // transportation office Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId,omitempty"` +} + +// Validate validates this requested office user update +func (m *RequestedOfficeUserUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestedOfficeUserUpdate) validateRoles(formats strfmt.Registry) error { + if swag.IsZero(m.Roles) { // not required + return nil + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var requestedOfficeUserUpdateTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + requestedOfficeUserUpdateTypeStatusPropEnum = append(requestedOfficeUserUpdateTypeStatusPropEnum, v) + } +} + +const ( + + // RequestedOfficeUserUpdateStatusAPPROVED captures enum value "APPROVED" + RequestedOfficeUserUpdateStatusAPPROVED string = "APPROVED" + + // RequestedOfficeUserUpdateStatusREJECTED captures enum value "REJECTED" + RequestedOfficeUserUpdateStatusREJECTED string = "REJECTED" +) + +// prop value enum +func (m *RequestedOfficeUserUpdate) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, requestedOfficeUserUpdateTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RequestedOfficeUserUpdate) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *RequestedOfficeUserUpdate) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *RequestedOfficeUserUpdate) validateTransportationOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this requested office user update based on the context it is used +func (m *RequestedOfficeUserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestedOfficeUserUpdate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *RequestedOfficeUserUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestedOfficeUserUpdate) UnmarshalBinary(b []byte) error { + var res RequestedOfficeUserUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/role.go b/pkg/gen/adminmessages/role.go new file mode 100644 index 00000000000..d770cf8e622 --- /dev/null +++ b/pkg/gen/adminmessages/role.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Role role +// +// swagger:model Role +type Role struct { + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // role name + // Example: Task Ordering Officer + // Required: true + RoleName *string `json:"roleName"` + + // role type + // Example: customer + // Required: true + RoleType *string `json:"roleType"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateRoleName(formats strfmt.Registry) error { + + if err := validate.Required("roleName", "body", m.RoleName); err != nil { + return err + } + + return nil +} + +func (m *Role) validateRoleType(formats strfmt.Registry) error { + + if err := validate.Required("roleType", "body", m.RoleType); err != nil { + return err + } + + return nil +} + +func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this role based on the context it is used +func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Role) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/service_member.go b/pkg/gen/adminmessages/service_member.go new file mode 100644 index 00000000000..cb730bc165d --- /dev/null +++ b/pkg/gen/adminmessages/service_member.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceMember service member +// +// swagger:model ServiceMember +type ServiceMember struct { + + // First Name + FirstName *string `json:"firstName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Last Name + LastName *string `json:"lastName,omitempty"` + + // Middle Name + MiddleName *string `json:"middleName,omitempty"` + + // user Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + UserID strfmt.UUID `json:"userId,omitempty"` +} + +// Validate validates this service member +func (m *ServiceMember) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMember) 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 *ServiceMember) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this service member based on the context it is used +func (m *ServiceMember) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUserID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMember) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ServiceMember) contextValidateUserID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "userId", "body", strfmt.UUID(m.UserID)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceMember) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceMember) UnmarshalBinary(b []byte) error { + var res ServiceMember + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/transportation_office.go b/pkg/gen/adminmessages/transportation_office.go new file mode 100644 index 00000000000..f291b011d51 --- /dev/null +++ b/pkg/gen/adminmessages/transportation_office.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOffice transportation office +// +// swagger:model TransportationOffice +type TransportationOffice struct { + + // address + // Required: true + Address *Address `json:"address"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // gbloc + // Example: JENQ + // Pattern: ^[A-Z]{4}$ + Gbloc string `json:"gbloc,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // latitude + // Example: 29.382973 + Latitude float32 `json:"latitude,omitempty"` + + // longitude + // Example: -98.62759 + Longitude float32 `json:"longitude,omitempty"` + + // name + // Example: Fort Bragg North Station + // Required: true + Name *string `json:"name"` + + // phone lines + PhoneLines []string `json:"phoneLines"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this transportation office +func (m *TransportationOffice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGbloc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhoneLines(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { + if swag.IsZero(m.Gbloc) { // not required + return nil + } + + if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { + if swag.IsZero(m.PhoneLines) { // not required + return nil + } + + for i := 0; i < len(m.PhoneLines); i++ { + + if err := validate.Pattern("phoneLines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + } + + return nil +} + +func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office based on the context it is used +func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *TransportationOffice) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOffice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOffice) UnmarshalBinary(b []byte) error { + var res TransportationOffice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/transportation_office_assignment.go b/pkg/gen/adminmessages/transportation_office_assignment.go new file mode 100644 index 00000000000..8deb239d7a5 --- /dev/null +++ b/pkg/gen/adminmessages/transportation_office_assignment.go @@ -0,0 +1,223 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOfficeAssignment transportation office assignment +// +// swagger:model TransportationOfficeAssignment +type TransportationOfficeAssignment struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // office user Id + // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 + // Format: uuid + OfficeUserID strfmt.UUID `json:"officeUserId,omitempty"` + + // primary office + PrimaryOffice bool `json:"primaryOffice"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` + + // transportation office Id + // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 + // Format: uuid + TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this transportation office assignment +func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office assignment based on the context it is used +func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { + var res TransportationOfficeAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/transportation_offices.go b/pkg/gen/adminmessages/transportation_offices.go new file mode 100644 index 00000000000..30adb86c204 --- /dev/null +++ b/pkg/gen/adminmessages/transportation_offices.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransportationOffices transportation offices +// +// swagger:model TransportationOffices +type TransportationOffices []*TransportationOffice + +// Validate validates this transportation offices +func (m TransportationOffices) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this transportation offices based on the context it is used +func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/upload.go b/pkg/gen/adminmessages/upload.go new file mode 100644 index 00000000000..83cc5fb4b50 --- /dev/null +++ b/pkg/gen/adminmessages/upload.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Upload upload +// +// swagger:model Upload +type Upload struct { + + // content type + // Enum: [application/pdf image/jpeg image/png] + ContentType string `json:"contentType,omitempty"` + + // Created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + Filename string `json:"filename,omitempty"` + + // Size in Bytes + Size int64 `json:"size,omitempty"` +} + +// Validate validates this upload +func (m *Upload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var uploadTypeContentTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["application/pdf","image/jpeg","image/png"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadTypeContentTypePropEnum = append(uploadTypeContentTypePropEnum, v) + } +} + +const ( + + // UploadContentTypeApplicationPdf captures enum value "application/pdf" + UploadContentTypeApplicationPdf string = "application/pdf" + + // UploadContentTypeImageJpeg captures enum value "image/jpeg" + UploadContentTypeImageJpeg string = "image/jpeg" + + // UploadContentTypeImagePng captures enum value "image/png" + UploadContentTypeImagePng string = "image/png" +) + +// prop value enum +func (m *Upload) validateContentTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadTypeContentTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Upload) validateContentType(formats strfmt.Registry) error { + if swag.IsZero(m.ContentType) { // not required + return nil + } + + // value enum + if err := m.validateContentTypeEnum("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload based on the context it is used +func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Upload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Upload) UnmarshalBinary(b []byte) error { + var res Upload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/upload_information.go b/pkg/gen/adminmessages/upload_information.go new file mode 100644 index 00000000000..f6b8b66dee2 --- /dev/null +++ b/pkg/gen/adminmessages/upload_information.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadInformation upload information +// +// swagger:model UploadInformation +type UploadInformation struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move locator + // Example: 12432 + MoveLocator *string `json:"moveLocator,omitempty"` + + // office user email + OfficeUserEmail *string `json:"officeUserEmail,omitempty"` + + // office user first name + OfficeUserFirstName *string `json:"officeUserFirstName,omitempty"` + + // office user Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OfficeUserID *strfmt.UUID `json:"officeUserId,omitempty"` + + // office user last name + OfficeUserLastName *string `json:"officeUserLastName,omitempty"` + + // office user phone + OfficeUserPhone *string `json:"officeUserPhone,omitempty"` + + // service member email + ServiceMemberEmail *string `json:"serviceMemberEmail,omitempty"` + + // service member first name + ServiceMemberFirstName *string `json:"serviceMemberFirstName,omitempty"` + + // service member Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"serviceMemberId,omitempty"` + + // service member last name + ServiceMemberLastName *string `json:"serviceMemberLastName,omitempty"` + + // service member phone + ServiceMemberPhone *string `json:"serviceMemberPhone,omitempty"` + + // upload + Upload *Upload `json:"upload,omitempty"` +} + +// Validate validates this upload information +func (m *UploadInformation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpload(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadInformation) 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 *UploadInformation) validateOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadInformation) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadInformation) validateUpload(formats strfmt.Registry) error { + if swag.IsZero(m.Upload) { // not required + return nil + } + + if m.Upload != nil { + if err := m.Upload.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("upload") + } + return err + } + } + + return nil +} + +// ContextValidate validate this upload information based on the context it is used +func (m *UploadInformation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUpload(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadInformation) contextValidateUpload(ctx context.Context, formats strfmt.Registry) error { + + if m.Upload != nil { + + if swag.IsZero(m.Upload) { // not required + return nil + } + + if err := m.Upload.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("upload") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("upload") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadInformation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadInformation) UnmarshalBinary(b []byte) error { + var res UploadInformation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/user.go b/pkg/gen/adminmessages/user.go new file mode 100644 index 00000000000..3ff4ba48b7f --- /dev/null +++ b/pkg/gen/adminmessages/user.go @@ -0,0 +1,245 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// User user +// +// swagger:model User +type User struct { + + // active + // Required: true + Active *bool `json:"active"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // current admin session Id + // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w + // Required: true + CurrentAdminSessionID *string `json:"currentAdminSessionId"` + + // current mil session Id + // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w + // Required: true + CurrentMilSessionID *string `json:"currentMilSessionId"` + + // current office session Id + // Example: WiPgsPj-jPySR1d0dpmvIZ-HvZqemjmaQWxGQ6B8K_w + // Required: true + CurrentOfficeSessionID *string `json:"currentOfficeSessionId"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // okta email + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + OktaEmail *string `json:"oktaEmail"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this user +func (m *User) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActive(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentAdminSessionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentMilSessionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentOfficeSessionID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOktaEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) validateActive(formats strfmt.Registry) error { + + if err := validate.Required("active", "body", m.Active); err != nil { + return err + } + + return nil +} + +func (m *User) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *User) validateCurrentAdminSessionID(formats strfmt.Registry) error { + + if err := validate.Required("currentAdminSessionId", "body", m.CurrentAdminSessionID); err != nil { + return err + } + + return nil +} + +func (m *User) validateCurrentMilSessionID(formats strfmt.Registry) error { + + if err := validate.Required("currentMilSessionId", "body", m.CurrentMilSessionID); err != nil { + return err + } + + return nil +} + +func (m *User) validateCurrentOfficeSessionID(formats strfmt.Registry) error { + + if err := validate.Required("currentOfficeSessionId", "body", m.CurrentOfficeSessionID); err != nil { + return err + } + + return nil +} + +func (m *User) 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 *User) validateOktaEmail(formats strfmt.Registry) error { + + if err := validate.Required("oktaEmail", "body", m.OktaEmail); err != nil { + return err + } + + if err := validate.Pattern("oktaEmail", "body", *m.OktaEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *User) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this user based on the context it is used +func (m *User) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *User) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *User) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *User) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *User) UnmarshalBinary(b []byte) error { + var res User + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/user_update.go b/pkg/gen/adminmessages/user_update.go new file mode 100644 index 00000000000..2ea4aac7cf7 --- /dev/null +++ b/pkg/gen/adminmessages/user_update.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UserUpdate user update +// +// swagger:model UserUpdate +type UserUpdate struct { + + // active + Active *bool `json:"active,omitempty"` + + // revoke admin session + RevokeAdminSession *bool `json:"revokeAdminSession,omitempty"` + + // revoke mil session + RevokeMilSession *bool `json:"revokeMilSession,omitempty"` + + // revoke office session + RevokeOfficeSession *bool `json:"revokeOfficeSession,omitempty"` +} + +// Validate validates this user update +func (m *UserUpdate) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this user update based on context it is used +func (m *UserUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UserUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UserUpdate) UnmarshalBinary(b []byte) error { + var res UserUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/users.go b/pkg/gen/adminmessages/users.go new file mode 100644 index 00000000000..2032993a35a --- /dev/null +++ b/pkg/gen/adminmessages/users.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Users users +// +// swagger:model Users +type Users []*User + +// Validate validates this users +func (m Users) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this users based on the context it is used +func (m Users) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/adminmessages/validation_error.go b/pkg/gen/adminmessages/validation_error.go new file mode 100644 index 00000000000..31f9c2c2610 --- /dev/null +++ b/pkg/gen/adminmessages/validation_error.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + ValidationErrorAllOf1 + + // invalid fields + // Required: true + InvalidFields map[string]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var aO1 ValidationErrorAllOf1 + if err := swag.ReadJSON(raw, &aO1); err != nil { + return err + } + m.ValidationErrorAllOf1 = aO1 + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &propsValidationError); err != nil { + return err + } + m.InvalidFields = propsValidationError.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + + aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) + if err != nil { + return nil, err + } + _parts = append(_parts, aO1) + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string]string `json:"invalidFields"` + } + propsValidationError.InvalidFields = m.InvalidFields + + jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) + if errValidationError != nil { + return nil, errValidationError + } + _parts = append(_parts, jsonDataPropsValidationError) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ValidationErrorAllOf1 validation error all of1 +// +// swagger:model ValidationErrorAllOf1 +type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/adminmessages/webhook_subscription.go b/pkg/gen/adminmessages/webhook_subscription.go new file mode 100644 index 00000000000..0d042898e6c --- /dev/null +++ b/pkg/gen/adminmessages/webhook_subscription.go @@ -0,0 +1,277 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WebhookSubscription Represents subscribers who expect certain notifications to be pushed to their servers. Used for the Prime and Prime-related events specifically. +// +// swagger:model WebhookSubscription +type WebhookSubscription struct { + + // The URL to which the notifications for this subscription will be pushed to. + CallbackURL *string `json:"callbackUrl,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // A string used to represent which events this subscriber expects to be notified about. Corresponds to the possible event_key values in webhook_notifications. + EventKey *string `json:"eventKey,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // severity + // Minimum: 0 + Severity *int64 `json:"severity,omitempty"` + + // status + Status *WebhookSubscriptionStatus `json:"status,omitempty"` + + // Unique identifier for the subscriber + // Example: d494f114-05a2-4b39-840c-3d33243b7e29 + // Format: uuid + SubscriberID *strfmt.UUID `json:"subscriberId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this webhook subscription +func (m *WebhookSubscription) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSeverity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubscriberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WebhookSubscription) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) 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 *WebhookSubscription) validateSeverity(formats strfmt.Registry) error { + if swag.IsZero(m.Severity) { // not required + return nil + } + + if err := validate.MinimumInt("severity", "body", *m.Severity, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WebhookSubscription) validateSubscriberID(formats strfmt.Registry) error { + if swag.IsZero(m.SubscriberID) { // not required + return nil + } + + if err := validate.FormatOf("subscriberId", "body", "uuid", m.SubscriberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this webhook subscription based on the context it is used +func (m *WebhookSubscription) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WebhookSubscription) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WebhookSubscription) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WebhookSubscription) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WebhookSubscription) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WebhookSubscription) UnmarshalBinary(b []byte) error { + var res WebhookSubscription + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/adminmessages/webhook_subscription_status.go b/pkg/gen/adminmessages/webhook_subscription_status.go new file mode 100644 index 00000000000..5085d145c8f --- /dev/null +++ b/pkg/gen/adminmessages/webhook_subscription_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// WebhookSubscriptionStatus Webhook subscription status +// +// swagger:model WebhookSubscriptionStatus +type WebhookSubscriptionStatus string + +func NewWebhookSubscriptionStatus(value WebhookSubscriptionStatus) *WebhookSubscriptionStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated WebhookSubscriptionStatus. +func (m WebhookSubscriptionStatus) Pointer() *WebhookSubscriptionStatus { + return &m +} + +const ( + + // WebhookSubscriptionStatusACTIVE captures enum value "ACTIVE" + WebhookSubscriptionStatusACTIVE WebhookSubscriptionStatus = "ACTIVE" + + // WebhookSubscriptionStatusFAILING captures enum value "FAILING" + WebhookSubscriptionStatusFAILING WebhookSubscriptionStatus = "FAILING" + + // WebhookSubscriptionStatusDISABLED captures enum value "DISABLED" + WebhookSubscriptionStatusDISABLED WebhookSubscriptionStatus = "DISABLED" +) + +// for schema +var webhookSubscriptionStatusEnum []interface{} + +func init() { + var res []WebhookSubscriptionStatus + if err := json.Unmarshal([]byte(`["ACTIVE","FAILING","DISABLED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + webhookSubscriptionStatusEnum = append(webhookSubscriptionStatusEnum, v) + } +} + +func (m WebhookSubscriptionStatus) validateWebhookSubscriptionStatusEnum(path, location string, value WebhookSubscriptionStatus) error { + if err := validate.EnumCase(path, location, value, webhookSubscriptionStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this webhook subscription status +func (m WebhookSubscriptionStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateWebhookSubscriptionStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this webhook subscription status based on context it is used +func (m WebhookSubscriptionStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/adminmessages/webhook_subscriptions.go b/pkg/gen/adminmessages/webhook_subscriptions.go new file mode 100644 index 00000000000..cf63024b85c --- /dev/null +++ b/pkg/gen/adminmessages/webhook_subscriptions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package adminmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WebhookSubscriptions webhook subscriptions +// +// swagger:model WebhookSubscriptions +type WebhookSubscriptions []*WebhookSubscription + +// Validate validates this webhook subscriptions +func (m WebhookSubscriptions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this webhook subscriptions based on the context it is used +func (m WebhookSubscriptions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go new file mode 100644 index 00000000000..2c7449ec836 --- /dev/null +++ b/pkg/gen/ghcapi/configure_mymove.go @@ -0,0 +1,640 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package ghcapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/addresses" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/application_parameters" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/calendar" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer_support_remarks" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/evaluation_reports" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ghc_documents" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/lines_of_accounting" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_agent" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/office_users" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/order" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_requests" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_service_item" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ppm" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/pws_violations" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/queues" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/re_service_items" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/report_violations" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/shipment" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/tac" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/transportation_office" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/uploads" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/ghc.yaml --api-package ghcoperations --model-package ghcmessages --server-package ghcapi --principal interface{} --exclude-main + +func configureFlags(api *ghcoperations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + api.MultipartformConsumer = runtime.DiscardConsumer + + api.BinProducer = runtime.ByteStreamProducer() + api.JSONProducer = runtime.JSONProducer() + + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // uploads.CreateUploadMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // move.UploadAdditionalDocumentsMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // order.UploadAmendedOrdersMaxParseMemory = 32 << 20 + + if api.OrderAcknowledgeExcessWeightRiskHandler == nil { + api.OrderAcknowledgeExcessWeightRiskHandler = order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder { + return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented") + }) + } + if api.EvaluationReportsAddAppealToSeriousIncidentHandler == nil { + api.EvaluationReportsAddAppealToSeriousIncidentHandler = evaluation_reports.AddAppealToSeriousIncidentHandlerFunc(func(params evaluation_reports.AddAppealToSeriousIncidentParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.AddAppealToSeriousIncident has not yet been implemented") + }) + } + if api.EvaluationReportsAddAppealToViolationHandler == nil { + api.EvaluationReportsAddAppealToViolationHandler = evaluation_reports.AddAppealToViolationHandlerFunc(func(params evaluation_reports.AddAppealToViolationParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.AddAppealToViolation has not yet been implemented") + }) + } + if api.ShipmentApproveSITExtensionHandler == nil { + api.ShipmentApproveSITExtensionHandler = shipment.ApproveSITExtensionHandlerFunc(func(params shipment.ApproveSITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveSITExtension has not yet been implemented") + }) + } + if api.ShipmentApproveShipmentHandler == nil { + api.ShipmentApproveShipmentHandler = shipment.ApproveShipmentHandlerFunc(func(params shipment.ApproveShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipment has not yet been implemented") + }) + } + if api.ShipmentApproveShipmentDiversionHandler == nil { + api.ShipmentApproveShipmentDiversionHandler = shipment.ApproveShipmentDiversionHandlerFunc(func(params shipment.ApproveShipmentDiversionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") + }) + } + if api.ReportViolationsAssociateReportViolationsHandler == nil { + api.ReportViolationsAssociateReportViolationsHandler = report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { + return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") + }) + } + if api.PaymentRequestsBulkDownloadHandler == nil { + api.PaymentRequestsBulkDownloadHandler = payment_requests.BulkDownloadHandlerFunc(func(params payment_requests.BulkDownloadParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.BulkDownload has not yet been implemented") + }) + } + if api.MoveCheckForLockedMovesAndUnlockHandler == nil { + api.MoveCheckForLockedMovesAndUnlockHandler = move.CheckForLockedMovesAndUnlockHandlerFunc(func(params move.CheckForLockedMovesAndUnlockParams) middleware.Responder { + return middleware.NotImplemented("operation move.CheckForLockedMovesAndUnlock has not yet been implemented") + }) + } + if api.OrderCounselingUpdateAllowanceHandler == nil { + api.OrderCounselingUpdateAllowanceHandler = order.CounselingUpdateAllowanceHandlerFunc(func(params order.CounselingUpdateAllowanceParams) middleware.Responder { + return middleware.NotImplemented("operation order.CounselingUpdateAllowance has not yet been implemented") + }) + } + if api.OrderCounselingUpdateOrderHandler == nil { + api.OrderCounselingUpdateOrderHandler = order.CounselingUpdateOrderHandlerFunc(func(params order.CounselingUpdateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.CounselingUpdateOrder has not yet been implemented") + }) + } + if api.ShipmentCreateApprovedSITDurationUpdateHandler == nil { + api.ShipmentCreateApprovedSITDurationUpdateHandler = shipment.CreateApprovedSITDurationUpdateHandlerFunc(func(params shipment.CreateApprovedSITDurationUpdateParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.CreateApprovedSITDurationUpdate has not yet been implemented") + }) + } + if api.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler == nil { + api.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler = customer_support_remarks.CreateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.CreateCustomerSupportRemarkForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.CreateCustomerSupportRemarkForMove has not yet been implemented") + }) + } + if api.CustomerCreateCustomerWithOktaOptionHandler == nil { + api.CustomerCreateCustomerWithOktaOptionHandler = customer.CreateCustomerWithOktaOptionHandlerFunc(func(params customer.CreateCustomerWithOktaOptionParams) middleware.Responder { + return middleware.NotImplemented("operation customer.CreateCustomerWithOktaOption has not yet been implemented") + }) + } + if api.GhcDocumentsCreateDocumentHandler == nil { + api.GhcDocumentsCreateDocumentHandler = ghc_documents.CreateDocumentHandlerFunc(func(params ghc_documents.CreateDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation ghc_documents.CreateDocument has not yet been implemented") + }) + } + if api.EvaluationReportsCreateEvaluationReportHandler == nil { + api.EvaluationReportsCreateEvaluationReportHandler = evaluation_reports.CreateEvaluationReportHandlerFunc(func(params evaluation_reports.CreateEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.CreateEvaluationReport has not yet been implemented") + }) + } + if api.MtoShipmentCreateMTOShipmentHandler == nil { + api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }) + } + if api.OrderCreateOrderHandler == nil { + api.OrderCreateOrderHandler = order.CreateOrderHandlerFunc(func(params order.CreateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.CreateOrder has not yet been implemented") + }) + } + if api.OfficeUsersCreateRequestedOfficeUserHandler == nil { + api.OfficeUsersCreateRequestedOfficeUserHandler = office_users.CreateRequestedOfficeUserHandlerFunc(func(params office_users.CreateRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.CreateRequestedOfficeUser has not yet been implemented") + }) + } + if api.UploadsCreateUploadHandler == nil { + api.UploadsCreateUploadHandler = uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") + }) + } + if api.MoveDeleteAssignedOfficeUserHandler == nil { + api.MoveDeleteAssignedOfficeUserHandler = move.DeleteAssignedOfficeUserHandlerFunc(func(params move.DeleteAssignedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation move.DeleteAssignedOfficeUser has not yet been implemented") + }) + } + if api.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler == nil { + api.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler = customer_support_remarks.DeleteCustomerSupportRemarkHandlerFunc(func(params customer_support_remarks.DeleteCustomerSupportRemarkParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.DeleteCustomerSupportRemark has not yet been implemented") + }) + } + if api.EvaluationReportsDeleteEvaluationReportHandler == nil { + api.EvaluationReportsDeleteEvaluationReportHandler = evaluation_reports.DeleteEvaluationReportHandlerFunc(func(params evaluation_reports.DeleteEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.DeleteEvaluationReport has not yet been implemented") + }) + } + if api.ShipmentDeleteShipmentHandler == nil { + api.ShipmentDeleteShipmentHandler = shipment.DeleteShipmentHandlerFunc(func(params shipment.DeleteShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.DeleteShipment has not yet been implemented") + }) + } + if api.UploadsDeleteUploadHandler == nil { + api.UploadsDeleteUploadHandler = uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") + }) + } + if api.ShipmentDenySITExtensionHandler == nil { + api.ShipmentDenySITExtensionHandler = shipment.DenySITExtensionHandlerFunc(func(params shipment.DenySITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.DenySITExtension has not yet been implemented") + }) + } + if api.EvaluationReportsDownloadEvaluationReportHandler == nil { + api.EvaluationReportsDownloadEvaluationReportHandler = evaluation_reports.DownloadEvaluationReportHandlerFunc(func(params evaluation_reports.DownloadEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.DownloadEvaluationReport has not yet been implemented") + }) + } + if api.MtoAgentFetchMTOAgentListHandler == nil { + api.MtoAgentFetchMTOAgentListHandler = mto_agent.FetchMTOAgentListHandlerFunc(func(params mto_agent.FetchMTOAgentListParams) middleware.Responder { + return middleware.NotImplemented("operation mto_agent.FetchMTOAgentList has not yet been implemented") + }) + } + if api.PpmFinishDocumentReviewHandler == nil { + api.PpmFinishDocumentReviewHandler = ppm.FinishDocumentReviewHandlerFunc(func(params ppm.FinishDocumentReviewParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.FinishDocumentReview has not yet been implemented") + }) + } + if api.ReServiceItemsGetAllReServiceItemsHandler == nil { + api.ReServiceItemsGetAllReServiceItemsHandler = re_service_items.GetAllReServiceItemsHandlerFunc(func(params re_service_items.GetAllReServiceItemsParams) middleware.Responder { + return middleware.NotImplemented("operation re_service_items.GetAllReServiceItems has not yet been implemented") + }) + } + if api.QueuesGetBulkAssignmentDataHandler == nil { + api.QueuesGetBulkAssignmentDataHandler = queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") + }) + } + if api.CustomerGetCustomerHandler == nil { + api.CustomerGetCustomerHandler = customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { + return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") + }) + } + if api.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler == nil { + api.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler = customer_support_remarks.GetCustomerSupportRemarksForMoveHandlerFunc(func(params customer_support_remarks.GetCustomerSupportRemarksForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.GetCustomerSupportRemarksForMove has not yet been implemented") + }) + } + if api.GhcDocumentsGetDocumentHandler == nil { + api.GhcDocumentsGetDocumentHandler = ghc_documents.GetDocumentHandlerFunc(func(params ghc_documents.GetDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation ghc_documents.GetDocument has not yet been implemented") + }) + } + if api.MoveTaskOrderGetEntitlementsHandler == nil { + api.MoveTaskOrderGetEntitlementsHandler = move_task_order.GetEntitlementsHandlerFunc(func(params move_task_order.GetEntitlementsParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetEntitlements has not yet been implemented") + }) + } + if api.EvaluationReportsGetEvaluationReportHandler == nil { + api.EvaluationReportsGetEvaluationReportHandler = evaluation_reports.GetEvaluationReportHandlerFunc(func(params evaluation_reports.GetEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.GetEvaluationReport has not yet been implemented") + }) + } + if api.AddressesGetLocationByZipCityStateHandler == nil { + api.AddressesGetLocationByZipCityStateHandler = addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") + }) + } + if api.MtoServiceItemGetMTOServiceItemHandler == nil { + api.MtoServiceItemGetMTOServiceItemHandler = mto_service_item.GetMTOServiceItemHandlerFunc(func(params mto_service_item.GetMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.GetMTOServiceItem has not yet been implemented") + }) + } + if api.MoveGetMoveHandler == nil { + api.MoveGetMoveHandler = move.GetMoveHandlerFunc(func(params move.GetMoveParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMove has not yet been implemented") + }) + } + if api.MoveGetMoveCounselingEvaluationReportsListHandler == nil { + api.MoveGetMoveCounselingEvaluationReportsListHandler = move.GetMoveCounselingEvaluationReportsListHandlerFunc(func(params move.GetMoveCounselingEvaluationReportsListParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveCounselingEvaluationReportsList has not yet been implemented") + }) + } + if api.MoveGetMoveHistoryHandler == nil { + api.MoveGetMoveHistoryHandler = move.GetMoveHistoryHandlerFunc(func(params move.GetMoveHistoryParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveHistory has not yet been implemented") + }) + } + if api.MoveGetMoveShipmentEvaluationReportsListHandler == nil { + api.MoveGetMoveShipmentEvaluationReportsListHandler = move.GetMoveShipmentEvaluationReportsListHandlerFunc(func(params move.GetMoveShipmentEvaluationReportsListParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveShipmentEvaluationReportsList has not yet been implemented") + }) + } + if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { + api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }) + } + if api.QueuesGetMovesQueueHandler == nil { + api.QueuesGetMovesQueueHandler = queues.GetMovesQueueHandlerFunc(func(params queues.GetMovesQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetMovesQueue has not yet been implemented") + }) + } + if api.OrderGetOrderHandler == nil { + api.OrderGetOrderHandler = order.GetOrderHandlerFunc(func(params order.GetOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.GetOrder has not yet been implemented") + }) + } + if api.PpmGetPPMActualWeightHandler == nil { + api.PpmGetPPMActualWeightHandler = ppm.GetPPMActualWeightHandlerFunc(func(params ppm.GetPPMActualWeightParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMActualWeight has not yet been implemented") + }) + } + if api.PpmGetPPMCloseoutHandler == nil { + api.PpmGetPPMCloseoutHandler = ppm.GetPPMCloseoutHandlerFunc(func(params ppm.GetPPMCloseoutParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMCloseout has not yet been implemented") + }) + } + if api.PpmGetPPMDocumentsHandler == nil { + api.PpmGetPPMDocumentsHandler = ppm.GetPPMDocumentsHandlerFunc(func(params ppm.GetPPMDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMDocuments has not yet been implemented") + }) + } + if api.PpmGetPPMSITEstimatedCostHandler == nil { + api.PpmGetPPMSITEstimatedCostHandler = ppm.GetPPMSITEstimatedCostHandlerFunc(func(params ppm.GetPPMSITEstimatedCostParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMSITEstimatedCost has not yet been implemented") + }) + } + if api.PwsViolationsGetPWSViolationsHandler == nil { + api.PwsViolationsGetPWSViolationsHandler = pws_violations.GetPWSViolationsHandlerFunc(func(params pws_violations.GetPWSViolationsParams) middleware.Responder { + return middleware.NotImplemented("operation pws_violations.GetPWSViolations has not yet been implemented") + }) + } + if api.ApplicationParametersGetParamHandler == nil { + api.ApplicationParametersGetParamHandler = application_parameters.GetParamHandlerFunc(func(params application_parameters.GetParamParams) middleware.Responder { + return middleware.NotImplemented("operation application_parameters.GetParam has not yet been implemented") + }) + } + if api.PaymentRequestsGetPaymentRequestHandler == nil { + api.PaymentRequestsGetPaymentRequestHandler = payment_requests.GetPaymentRequestHandlerFunc(func(params payment_requests.GetPaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetPaymentRequest has not yet been implemented") + }) + } + if api.PaymentRequestsGetPaymentRequestsForMoveHandler == nil { + api.PaymentRequestsGetPaymentRequestsForMoveHandler = payment_requests.GetPaymentRequestsForMoveHandlerFunc(func(params payment_requests.GetPaymentRequestsForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetPaymentRequestsForMove has not yet been implemented") + }) + } + if api.QueuesGetPaymentRequestsQueueHandler == nil { + api.QueuesGetPaymentRequestsQueueHandler = queues.GetPaymentRequestsQueueHandlerFunc(func(params queues.GetPaymentRequestsQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetPaymentRequestsQueue has not yet been implemented") + }) + } + if api.ReportViolationsGetReportViolationsByReportIDHandler == nil { + api.ReportViolationsGetReportViolationsByReportIDHandler = report_violations.GetReportViolationsByReportIDHandlerFunc(func(params report_violations.GetReportViolationsByReportIDParams) middleware.Responder { + return middleware.NotImplemented("operation report_violations.GetReportViolationsByReportID has not yet been implemented") + }) + } + if api.QueuesGetServicesCounselingOriginListHandler == nil { + api.QueuesGetServicesCounselingOriginListHandler = queues.GetServicesCounselingOriginListHandlerFunc(func(params queues.GetServicesCounselingOriginListParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetServicesCounselingOriginList has not yet been implemented") + }) + } + if api.QueuesGetServicesCounselingQueueHandler == nil { + api.QueuesGetServicesCounselingQueueHandler = queues.GetServicesCounselingQueueHandlerFunc(func(params queues.GetServicesCounselingQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetServicesCounselingQueue has not yet been implemented") + }) + } + if api.MtoShipmentGetShipmentHandler == nil { + api.MtoShipmentGetShipmentHandler = mto_shipment.GetShipmentHandlerFunc(func(params mto_shipment.GetShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.GetShipment has not yet been implemented") + }) + } + if api.PaymentRequestsGetShipmentsPaymentSITBalanceHandler == nil { + api.PaymentRequestsGetShipmentsPaymentSITBalanceHandler = payment_requests.GetShipmentsPaymentSITBalanceHandlerFunc(func(params payment_requests.GetShipmentsPaymentSITBalanceParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetShipmentsPaymentSITBalance has not yet been implemented") + }) + } + if api.TransportationOfficeGetTransportationOfficesHandler == nil { + api.TransportationOfficeGetTransportationOfficesHandler = transportation_office.GetTransportationOfficesHandlerFunc(func(params transportation_office.GetTransportationOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOffices has not yet been implemented") + }) + } + if api.TransportationOfficeGetTransportationOfficesGBLOCsHandler == nil { + api.TransportationOfficeGetTransportationOfficesGBLOCsHandler = transportation_office.GetTransportationOfficesGBLOCsHandlerFunc(func(params transportation_office.GetTransportationOfficesGBLOCsParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesGBLOCs has not yet been implemented") + }) + } + if api.TransportationOfficeGetTransportationOfficesOpenHandler == nil { + api.TransportationOfficeGetTransportationOfficesOpenHandler = transportation_office.GetTransportationOfficesOpenHandlerFunc(func(params transportation_office.GetTransportationOfficesOpenParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesOpen has not yet been implemented") + }) + } + if api.UploadsGetUploadHandler == nil { + api.UploadsGetUploadHandler = uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") + }) + } + if api.CalendarIsDateWeekendHolidayHandler == nil { + api.CalendarIsDateWeekendHolidayHandler = calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") + }) + } + if api.MtoServiceItemListMTOServiceItemsHandler == nil { + api.MtoServiceItemListMTOServiceItemsHandler = mto_service_item.ListMTOServiceItemsHandlerFunc(func(params mto_service_item.ListMTOServiceItemsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.ListMTOServiceItems has not yet been implemented") + }) + } + if api.MtoShipmentListMTOShipmentsHandler == nil { + api.MtoShipmentListMTOShipmentsHandler = mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") + }) + } + if api.QueuesListPrimeMovesHandler == nil { + api.QueuesListPrimeMovesHandler = queues.ListPrimeMovesHandlerFunc(func(params queues.ListPrimeMovesParams) middleware.Responder { + return middleware.NotImplemented("operation queues.ListPrimeMoves has not yet been implemented") + }) + } + if api.MoveMoveCancelerHandler == nil { + api.MoveMoveCancelerHandler = move.MoveCancelerHandlerFunc(func(params move.MoveCancelerParams) middleware.Responder { + return middleware.NotImplemented("operation move.MoveCanceler has not yet been implemented") + }) + } + if api.ShipmentRejectShipmentHandler == nil { + api.ShipmentRejectShipmentHandler = shipment.RejectShipmentHandlerFunc(func(params shipment.RejectShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RejectShipment has not yet been implemented") + }) + } + if api.LinesOfAccountingRequestLineOfAccountingHandler == nil { + api.LinesOfAccountingRequestLineOfAccountingHandler = lines_of_accounting.RequestLineOfAccountingHandlerFunc(func(params lines_of_accounting.RequestLineOfAccountingParams) middleware.Responder { + return middleware.NotImplemented("operation lines_of_accounting.RequestLineOfAccounting has not yet been implemented") + }) + } + if api.ShipmentRequestShipmentCancellationHandler == nil { + api.ShipmentRequestShipmentCancellationHandler = shipment.RequestShipmentCancellationHandlerFunc(func(params shipment.RequestShipmentCancellationParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentCancellation has not yet been implemented") + }) + } + if api.ShipmentRequestShipmentDiversionHandler == nil { + api.ShipmentRequestShipmentDiversionHandler = shipment.RequestShipmentDiversionHandlerFunc(func(params shipment.RequestShipmentDiversionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentDiversion has not yet been implemented") + }) + } + if api.ShipmentRequestShipmentReweighHandler == nil { + api.ShipmentRequestShipmentReweighHandler = shipment.RequestShipmentReweighHandlerFunc(func(params shipment.RequestShipmentReweighParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentReweigh has not yet been implemented") + }) + } + if api.ShipmentReviewShipmentAddressUpdateHandler == nil { + api.ShipmentReviewShipmentAddressUpdateHandler = shipment.ReviewShipmentAddressUpdateHandlerFunc(func(params shipment.ReviewShipmentAddressUpdateParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ReviewShipmentAddressUpdate has not yet been implemented") + }) + } + if api.EvaluationReportsSaveEvaluationReportHandler == nil { + api.EvaluationReportsSaveEvaluationReportHandler = evaluation_reports.SaveEvaluationReportHandlerFunc(func(params evaluation_reports.SaveEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.SaveEvaluationReport has not yet been implemented") + }) + } + if api.CustomerSearchCustomersHandler == nil { + api.CustomerSearchCustomersHandler = customer.SearchCustomersHandlerFunc(func(params customer.SearchCustomersParams) middleware.Responder { + return middleware.NotImplemented("operation customer.SearchCustomers has not yet been implemented") + }) + } + if api.MoveSearchMovesHandler == nil { + api.MoveSearchMovesHandler = move.SearchMovesHandlerFunc(func(params move.SearchMovesParams) middleware.Responder { + return middleware.NotImplemented("operation move.SearchMoves has not yet been implemented") + }) + } + if api.MoveSetFinancialReviewFlagHandler == nil { + api.MoveSetFinancialReviewFlagHandler = move.SetFinancialReviewFlagHandlerFunc(func(params move.SetFinancialReviewFlagParams) middleware.Responder { + return middleware.NotImplemented("operation move.SetFinancialReviewFlag has not yet been implemented") + }) + } + if api.PpmShowAOAPacketHandler == nil { + api.PpmShowAOAPacketHandler = ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") + }) + } + if api.PpmShowPaymentPacketHandler == nil { + api.PpmShowPaymentPacketHandler = ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") + }) + } + if api.EvaluationReportsSubmitEvaluationReportHandler == nil { + api.EvaluationReportsSubmitEvaluationReportHandler = evaluation_reports.SubmitEvaluationReportHandlerFunc(func(params evaluation_reports.SubmitEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.SubmitEvaluationReport has not yet been implemented") + }) + } + if api.TacTacValidationHandler == nil { + api.TacTacValidationHandler = tac.TacValidationHandlerFunc(func(params tac.TacValidationParams) middleware.Responder { + return middleware.NotImplemented("operation tac.TacValidation has not yet been implemented") + }) + } + if api.OrderUpdateAllowanceHandler == nil { + api.OrderUpdateAllowanceHandler = order.UpdateAllowanceHandlerFunc(func(params order.UpdateAllowanceParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateAllowance has not yet been implemented") + }) + } + if api.MoveUpdateAssignedOfficeUserHandler == nil { + api.MoveUpdateAssignedOfficeUserHandler = move.UpdateAssignedOfficeUserHandlerFunc(func(params move.UpdateAssignedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation move.UpdateAssignedOfficeUser has not yet been implemented") + }) + } + if api.OrderUpdateBillableWeightHandler == nil { + api.OrderUpdateBillableWeightHandler = order.UpdateBillableWeightHandlerFunc(func(params order.UpdateBillableWeightParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateBillableWeight has not yet been implemented") + }) + } + if api.MoveUpdateCloseoutOfficeHandler == nil { + api.MoveUpdateCloseoutOfficeHandler = move.UpdateCloseoutOfficeHandlerFunc(func(params move.UpdateCloseoutOfficeParams) middleware.Responder { + return middleware.NotImplemented("operation move.UpdateCloseoutOffice has not yet been implemented") + }) + } + if api.CustomerUpdateCustomerHandler == nil { + api.CustomerUpdateCustomerHandler = customer.UpdateCustomerHandlerFunc(func(params customer.UpdateCustomerParams) middleware.Responder { + return middleware.NotImplemented("operation customer.UpdateCustomer has not yet been implemented") + }) + } + if api.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler == nil { + api.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler = customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.UpdateCustomerSupportRemarkForMove has not yet been implemented") + }) + } + if api.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler == nil { + api.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler = move_task_order.UpdateMTOReviewedBillableWeightsAtHandlerFunc(func(params move_task_order.UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOReviewedBillableWeightsAt has not yet been implemented") + }) + } + if api.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { + api.MtoServiceItemUpdateMTOServiceItemStatusHandler = mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentHandler == nil { + api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }) + } + if api.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler == nil { + api.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler = move_task_order.UpdateMTOStatusServiceCounselingCompletedHandlerFunc(func(params move_task_order.UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOStatusServiceCounselingCompleted has not yet been implemented") + }) + } + if api.OrderUpdateMaxBillableWeightAsTIOHandler == nil { + api.OrderUpdateMaxBillableWeightAsTIOHandler = order.UpdateMaxBillableWeightAsTIOHandlerFunc(func(params order.UpdateMaxBillableWeightAsTIOParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateMaxBillableWeightAsTIO has not yet been implemented") + }) + } + if api.MoveTaskOrderUpdateMoveTIORemarksHandler == nil { + api.MoveTaskOrderUpdateMoveTIORemarksHandler = move_task_order.UpdateMoveTIORemarksHandlerFunc(func(params move_task_order.UpdateMoveTIORemarksParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMoveTIORemarks has not yet been implemented") + }) + } + if api.MoveTaskOrderUpdateMoveTaskOrderStatusHandler == nil { + api.MoveTaskOrderUpdateMoveTaskOrderStatusHandler = move_task_order.UpdateMoveTaskOrderStatusHandlerFunc(func(params move_task_order.UpdateMoveTaskOrderStatusParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMoveTaskOrderStatus has not yet been implemented") + }) + } + if api.PpmUpdateMovingExpenseHandler == nil { + api.PpmUpdateMovingExpenseHandler = ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") + }) + } + if api.OrderUpdateOrderHandler == nil { + api.OrderUpdateOrderHandler = order.UpdateOrderHandlerFunc(func(params order.UpdateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateOrder has not yet been implemented") + }) + } + if api.PpmUpdatePPMSITHandler == nil { + api.PpmUpdatePPMSITHandler = ppm.UpdatePPMSITHandlerFunc(func(params ppm.UpdatePPMSITParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdatePPMSIT has not yet been implemented") + }) + } + if api.PaymentRequestsUpdatePaymentRequestStatusHandler == nil { + api.PaymentRequestsUpdatePaymentRequestStatusHandler = payment_requests.UpdatePaymentRequestStatusHandlerFunc(func(params payment_requests.UpdatePaymentRequestStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.UpdatePaymentRequestStatus has not yet been implemented") + }) + } + if api.PaymentServiceItemUpdatePaymentServiceItemStatusHandler == nil { + api.PaymentServiceItemUpdatePaymentServiceItemStatusHandler = payment_service_item.UpdatePaymentServiceItemStatusHandlerFunc(func(params payment_service_item.UpdatePaymentServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_service_item.UpdatePaymentServiceItemStatus has not yet been implemented") + }) + } + if api.PpmUpdateProGearWeightTicketHandler == nil { + api.PpmUpdateProGearWeightTicketHandler = ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") + }) + } + if api.ShipmentUpdateSITServiceItemCustomerExpenseHandler == nil { + api.ShipmentUpdateSITServiceItemCustomerExpenseHandler = shipment.UpdateSITServiceItemCustomerExpenseHandlerFunc(func(params shipment.UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.UpdateSITServiceItemCustomerExpense has not yet been implemented") + }) + } + if api.MtoServiceItemUpdateServiceItemSitEntryDateHandler == nil { + api.MtoServiceItemUpdateServiceItemSitEntryDateHandler = mto_service_item.UpdateServiceItemSitEntryDateHandlerFunc(func(params mto_service_item.UpdateServiceItemSitEntryDateParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateServiceItemSitEntryDate has not yet been implemented") + }) + } + if api.UploadsUpdateUploadHandler == nil { + api.UploadsUpdateUploadHandler = uploads.UpdateUploadHandlerFunc(func(params uploads.UpdateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.UpdateUpload has not yet been implemented") + }) + } + if api.PpmUpdateWeightTicketHandler == nil { + api.PpmUpdateWeightTicketHandler = ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") + }) + } + if api.MoveUploadAdditionalDocumentsHandler == nil { + api.MoveUploadAdditionalDocumentsHandler = move.UploadAdditionalDocumentsHandlerFunc(func(params move.UploadAdditionalDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation move.UploadAdditionalDocuments has not yet been implemented") + }) + } + if api.OrderUploadAmendedOrdersHandler == nil { + api.OrderUploadAmendedOrdersHandler = order.UploadAmendedOrdersHandlerFunc(func(params order.UploadAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation order.UploadAmendedOrders has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/ghcapi/doc.go b/pkg/gen/ghcapi/doc.go new file mode 100644 index 00000000000..24f788c8fb2 --- /dev/null +++ b/pkg/gen/ghcapi/doc.go @@ -0,0 +1,26 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package ghcapi MilMove GHC API +// +// The GHC API is a RESTful API that enables the Office application for MilMove. +// +// All endpoints are located under `/ghc/v1`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /ghc/v1 +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// - multipart/form-data +// +// Produces: +// - application/pdf +// - application/json +// +// swagger:meta +package ghcapi diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go new file mode 100644 index 00000000000..14b3a43903c --- /dev/null +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -0,0 +1,32291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcapi + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The GHC API is a RESTful API that enables the Office application for MilMove.\n\nAll endpoints are located under ` + "`" + `/ghc/v1` + "`" + `.\n", + "title": "MilMove GHC API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/ghc/v1", + "paths": { + "/addresses/zip-city-lookup/{search}": { + "get": { + "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string", + "operationId": "getLocationByZipCityState", + "parameters": [ + { + "type": "string", + "name": "search", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested list of city, state, county, and postal code matches", + "schema": { + "$ref": "#/definitions/VLocations" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/application_parameters/{parameterName}": { + "get": { + "description": "Searches for an application parameter by name, returns nil if not found", + "tags": [ + "application_parameters" + ], + "summary": "Searches for an application parameter by name, returns nil if not found", + "operationId": "getParam", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Parameter Name", + "name": "parameterName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Application Parameters", + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + }, + "/calendar/{countryCode}/is-weekend-holiday/{date}": { + "get": { + "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", + "produces": [ + "application/json" + ], + "tags": [ + "calendar" + ], + "summary": "Validate move date selection", + "operationId": "isDateWeekendHoliday", + "parameters": [ + { + "enum": [ + "US" + ], + "type": "string", + "description": "country code for context of date", + "name": "countryCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date", + "description": "input date to determine if weekend/holiday for given country.", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully determine if given date is weekend and/or holiday for given country.", + "schema": { + "$ref": "#/definitions/IsDateWeekendHolidayInfo" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/counseling/orders/{orderID}": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an order (performed by a services counselor)", + "operationId": "counselingUpdateOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CounselingUpdateOrderPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to update", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/counseling/orders/{orderID}/allowances": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an allowance (Orders with Entitlements)", + "operationId": "counselingUpdateAllowance", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CounselingUpdateAllowancePayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of allowance", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/customer": { + "post": { + "description": "Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Creates a customer with Okta option", + "operationId": "createCustomerWithOktaOption", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCustomerPayload" + } + } + ], + "responses": { + "200": { + "description": "successfully created the customer", + "schema": { + "$ref": "#/definitions/CreatedCustomer" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/customer-support-remarks/{customerSupportRemarkID}": { + "delete": { + "description": "Soft deletes a customer support remark by ID", + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Soft deletes a customer support remark by ID", + "operationId": "deleteCustomerSupportRemark", + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Updates a customer support remark for a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Updates a customer support remark for a move", + "operationId": "updateCustomerSupportRemarkForMove", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCustomerSupportRemarkPayload" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated customer support remark", + "schema": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the customer support remark ID to be modified", + "name": "customerSupportRemarkID", + "in": "path", + "required": true + } + ] + }, + "/customer/search": { + "post": { + "description": "Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Search customers by DOD ID or customer name", + "operationId": "searchCustomers", + "parameters": [ + { + "description": "field that results should be sorted by", + "name": "body", + "in": "body", + "schema": { + "properties": { + "branch": { + "description": "Branch", + "type": "string", + "minLength": 1 + }, + "customerName": { + "description": "Customer Name", + "type": "string", + "minLength": 1, + "x-nullable": true + }, + "edipi": { + "description": "DOD ID", + "type": "string", + "maxLength": 10, + "minLength": 10, + "x-nullable": true + }, + "emplid": { + "description": "EMPLID", + "type": "string", + "maxLength": 7, + "minLength": 7, + "x-nullable": true + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-nullable": true + }, + "page": { + "description": "requested page of results", + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "sort": { + "type": "string", + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "personalEmail", + "telephone" + ], + "x-nullable": true + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully returned all customers matching the criteria", + "schema": { + "$ref": "#/definitions/SearchCustomersResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/customer/{customerID}": { + "get": { + "description": "Returns a given customer", + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Returns a given customer", + "operationId": "getCustomer", + "responses": { + "200": { + "description": "Successfully retrieved information on an individual customer", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Updates customer info by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Updates customer info", + "operationId": "updateCustomer", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCustomerPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.customer" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of customer to use", + "name": "customerID", + "in": "path", + "required": true + } + ] + }, + "/documents": { + "post": { + "description": "Documents represent a physical artifact such as a scanned document or a PDF file", + "tags": [ + "ghcDocuments" + ], + "summary": "Create a new document", + "operationId": "createDocument", + "parameters": [ + { + "name": "documentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostDocumentPayload" + } + } + ], + "responses": { + "201": { + "description": "created document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "description": "server error" + } + } + } + }, + "/documents/{documentId}": { + "get": { + "description": "Returns a document and its uploads", + "tags": [ + "ghcDocuments" + ], + "summary": "Returns a document", + "operationId": "getDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to return", + "name": "documentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/evaluation-reports/{reportID}": { + "get": { + "description": "Gets an evaluation report by ID", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Gets an evaluation report by ID", + "operationId": "getEvaluationReport", + "responses": { + "200": { + "description": "Successfully got the report", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "put": { + "description": "Saves an evaluation report as a draft", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Saves an evaluation report as a draft", + "operationId": "saveEvaluationReport", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully saved the report" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "delete": { + "description": "Deletes an evaluation report by ID", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Deletes an evaluation report by ID", + "operationId": "deleteEvaluationReport", + "responses": { + "204": { + "description": "Successfully deleted the report" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "delete.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be modified", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/appeal/add": { + "post": { + "description": "Adds an appeal to a serious incident on an evaluation report", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Adds an appeal to a serious incident on an evaluation report", + "operationId": "addAppealToSeriousIncident", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAppeal" + } + } + ], + "responses": { + "204": { + "description": "Successfully added an appeal to a serious incident" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/download": { + "get": { + "description": "Downloads an evaluation report as a PDF", + "produces": [ + "application/pdf" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Downloads an evaluation report as a PDF", + "operationId": "downloadEvaluationReport", + "responses": { + "200": { + "description": "Evaluation report PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be downloaded", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/submit": { + "post": { + "description": "Submits an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Submits an evaluation report", + "operationId": "submitEvaluationReport", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully submitted an evaluation report with the provided ID" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be modified", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": { + "post": { + "description": "Adds an appeal to a violation", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Adds an appeal to a violation", + "operationId": "addAppealToViolation", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAppeal" + } + } + ], + "responses": { + "204": { + "description": "Successfully added an appeal to a violation" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID", + "name": "reportID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "the report violation ID", + "name": "reportViolationID", + "in": "path", + "required": true + } + ] + }, + "/lines-of-accounting": { + "post": { + "description": "Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "linesOfAccounting" + ], + "summary": "Fetch line of accounting", + "operationId": "requestLineOfAccounting", + "parameters": [ + { + "description": "Service member affiliation, effective date, and TAC code.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FetchLineOfAccountingPayload" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved line of accounting", + "schema": { + "$ref": "#/definitions/LineOfAccounting" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}": { + "get": { + "description": "Gets a move", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Gets a move by ID", + "operationId": "getMoveTaskOrder", + "responses": { + "200": { + "description": "Successfully retrieved move task order", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": { + "patch": { + "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "operationId": "updateMTOReviewedBillableWeightsAt", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order billableWeightsReviewedAt field", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/entitlements": { + "get": { + "description": "Gets entitlements", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Gets entitlements for a move by ID", + "operationId": "getEntitlements", + "responses": { + "200": { + "description": "Successfully retrieved entitlements", + "schema": { + "$ref": "#/definitions/Entitlements" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status": { + "patch": { + "description": "Changes the status of a line item for a move by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentServiceItem" + ], + "summary": "Change the status of a payment service item for a move by ID", + "operationId": "updatePaymentServiceItemStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated status for a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.paymentServiceItemStatus" + ] + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of payment service item to use", + "name": "paymentServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": { + "get": { + "description": "Gets a line item by ID for a move by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Gets a line item by ID for a move by ID", + "operationId": "getMTOServiceItem", + "responses": { + "200": { + "description": "Successfully retrieved a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/MTOServiceItemSingle" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of line item to use", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": { + "patch": { + "description": "Changes the status of a line item for a move by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Change the status of a line item for a move by ID", + "operationId": "updateMTOServiceItemStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchMTOServiceItemStatusPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated status for a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.MTOServiceItem" + ] + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of line item to use", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/status": { + "patch": { + "description": "Changes move task order status to make it available to prime", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Change the status of a move task order to make it available to prime", + "operationId": "updateMoveTaskOrderStatus", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "serviceItemCodes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOApprovalServiceItemCodes" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order status", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.move", + "create.serviceItem" + ] + } + }, + "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": { + "patch": { + "description": "Changes move (move task order) status to service counseling completed", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Changes move (move task order) status to service counseling completed", + "operationId": "updateMTOStatusServiceCounselingCompleted", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order status", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/tio-remarks": { + "patch": { + "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "operationId": "updateMoveTIORemarks", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Move" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order tioRemarks field", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move/{locator}": { + "get": { + "description": "Returns a given move for a unique alphanumeric locator string", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns a given move", + "operationId": "getMove", + "responses": { + "200": { + "description": "Successfully retrieved the individual move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "Code used to identify a move in the system", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/move/{locator}/history": { + "get": { + "description": "Returns the history for a given move for a unique alphanumeric locator string", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns the history of an identified move", + "operationId": "getMoveHistory", + "parameters": [ + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the individual move history", + "schema": { + "$ref": "#/definitions/MoveHistoryResult" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "Code used to identify a move in the system", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_service_items": { + "get": { + "description": "Gets all line items for a move", + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Gets all line items for a move", + "operationId": "listMTOServiceItems", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/MTOServiceItems" + } + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move for mto service item to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments": { + "get": { + "description": "Gets all shipments for a move task order", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Gets all shipments for a move task order", + "operationId": "listMTOShipments", + "responses": { + "200": { + "description": "Successfully retrieved all mto shipments for a move task order", + "schema": { + "$ref": "#/definitions/MTOShipments" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": { + "patch": { + "description": "Updates a specified MTO shipment.\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* No fields required in body\nOptional fields include:\n* New shipment status type\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Secondary Pick-up Address\n* SecondaryDelivery Address\n* Delivery Address Type\n* Customer Remarks\n* Counselor Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the MTO Shipment to update", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the specified MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": { + "get": { + "description": "Fetches a list of agents associated with a move task order.", + "produces": [ + "application/json" + ], + "tags": [ + "mtoAgent" + ], + "summary": "Fetch move task order agents.", + "operationId": "fetchMTOAgentList", + "responses": { + "200": { + "description": "Successfully retrieved all agents for a move task order", + "schema": { + "$ref": "#/definitions/MTOAgents" + } + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/moves/search": { + "post": { + "description": "Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Search moves by locator, DOD ID, or customer name", + "operationId": "searchMoves", + "parameters": [ + { + "description": "field that results should be sorted by", + "name": "body", + "in": "body", + "schema": { + "properties": { + "branch": { + "type": "string", + "x-nullable": true + }, + "customerName": { + "description": "Customer Name", + "type": "string", + "minLength": 1, + "x-nullable": true + }, + "deliveryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "destinationPostalCode": { + "type": "string", + "x-nullable": true + }, + "edipi": { + "description": "DOD ID", + "type": "string", + "maxLength": 10, + "minLength": 10, + "x-nullable": true + }, + "emplid": { + "description": "EMPLID", + "type": "string", + "maxLength": 7, + "minLength": 7, + "x-nullable": true + }, + "locator": { + "description": "Move locator", + "type": "string", + "maxLength": 6, + "minLength": 6, + "x-nullable": true + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-nullable": true + }, + "originPostalCode": { + "type": "string", + "x-nullable": true + }, + "page": { + "description": "requested page of results", + "type": "integer" + }, + "paymentRequestCode": { + "type": "string", + "x-nullable": true, + "example": "9551-6199-2" + }, + "perPage": { + "type": "integer" + }, + "pickupDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer", + "x-nullable": true + }, + "sort": { + "type": "string", + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "originPostalCode", + "destinationPostalCode", + "shipmentsCount" + ], + "x-nullable": true + }, + "status": { + "description": "Filtering for the status.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVALS REQUESTED", + "APPROVED", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED", + "CANCELED" + ] + } + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/SearchMovesResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/moves/{locator}/closeout-office": { + "patch": { + "description": "Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Updates a Move's PPM closeout office for Army and Air Force customers", + "operationId": "updateCloseoutOffice", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "closeoutOfficeId" + ], + "properties": { + "closeoutOfficeId": { + "type": "string", + "format": "uuid" + } + } + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully set the closeout office for the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.closeoutOffice" + ] + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/customer-support-remarks": { + "get": { + "description": "Fetches customer support remarks for a move", + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Fetches customer support remarks using the move code (locator).", + "operationId": "getCustomerSupportRemarksForMove", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/CustomerSupportRemarks" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "post": { + "description": "Creates a customer support remark for a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Creates a customer support remark for a move", + "operationId": "createCustomerSupportRemarkForMove", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateCustomerSupportRemark" + } + } + ], + "responses": { + "200": { + "description": "Successfully created customer support remark", + "schema": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move for customer support remarks", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/evaluation-reports": { + "post": { + "description": "Creates an evaluation report", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Creates an evaluation report", + "operationId": "createEvaluationReport", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateEvaluationReport" + } + } + ], + "responses": { + "200": { + "description": "Successfully created evaluation report", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/payment-requests": { + "get": { + "description": "Fetches payment requests for a move", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Fetches payment requests using the move code (locator).", + "operationId": "getPaymentRequestsForMove", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "read.paymentRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move for payment requests", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/assignOfficeUser": { + "patch": { + "description": "assigns either a services counselor, task ordering officer, or task invoicing officer to the move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "updateAssignedOfficeUser", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AssignOfficeUserBody" + } + } + ], + "responses": { + "200": { + "description": "Successfully assigned office user to the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/cancel": { + "post": { + "description": "cancels a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Cancels a move", + "operationId": "moveCanceler", + "responses": { + "200": { + "description": "Successfully canceled move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.cancelMoveFlag" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/counseling-evaluation-reports-list": { + "get": { + "description": "Returns counseling evaluation reports for the specified move that are visible to the current office user", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns counseling evaluation reports for the specified move that are visible to the current office user", + "operationId": "getMoveCounselingEvaluationReportsList", + "responses": { + "200": { + "description": "Successfully retrieved the move's evaluation reports", + "schema": { + "$ref": "#/definitions/EvaluationReportList" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Code used to identify a move in the system", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/financial-review-flag": { + "post": { + "description": "This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Flags a move for financial office review", + "operationId": "setFinancialReviewFlag", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header" + }, + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "flagForReview" + ], + "properties": { + "flagForReview": { + "description": "boolean value representing whether we should flag a move for financial review", + "type": "boolean", + "example": false + }, + "remarks": { + "description": "explanation of why the move is being flagged for financial review", + "type": "string", + "x-nullable": true, + "example": "this address is way too far away" + } + } + } + } + ], + "responses": { + "200": { + "description": "updated Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.financialReviewFlag" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move to flag", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/shipment-evaluation-reports-list": { + "get": { + "description": "Returns shipment evaluation reports for the specified move that are visible to the current office user", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns shipment evaluation reports for the specified move that are visible to the current office user", + "operationId": "getMoveShipmentEvaluationReportsList", + "responses": { + "200": { + "description": "Successfully retrieved the move's evaluation reports", + "schema": { + "$ref": "#/definitions/EvaluationReportList" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Code used to identify a move in the system", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/unassignOfficeUser": { + "patch": { + "description": "unassigns either a services counselor, task ordering officer, or task invoicing officer from the move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "deleteAssignedOfficeUser", + "responses": { + "200": { + "description": "Successfully unassigned office user from the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "roleType" + ], + "properties": { + "roleType": { + "type": "string" + } + } + } + } + ] + }, + "/moves/{moveID}/uploadAdditionalDocuments": { + "patch": { + "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "move" + ], + "summary": "Patch the additional documents for a given move", + "operationId": "uploadAdditionalDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "moveID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + }, + "x-permissions": [ + "create.supportingDocuments" + ] + } + }, + "/moves/{officeUserID}/CheckForLockedMovesAndUnlock": { + "patch": { + "description": "Finds and unlocks any locked moves by an office user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "checkForLockedMovesAndUnlock", + "responses": { + "200": { + "description": "Successfully unlocked officer's move(s).", + "schema": { + "type": "object", + "properties": { + "successMessage": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move's officer", + "name": "officeUserID", + "in": "path", + "required": true + } + ] + }, + "/mto-shipments": { + "post": { + "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Releasing / Receiving agents\nOptional fields include:\n* Delivery Address Type\n* Customer Remarks\n* Releasing / Receiving agents\n* An array of optional accessorial service item codes\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/open/requested-office-users": { + "post": { + "description": "This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account.\nRequest the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an \"OR\" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "officeUsers" + ], + "summary": "Create an Office User", + "operationId": "createRequestedOfficeUser", + "parameters": [ + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "schema": { + "$ref": "#/definitions/OfficeUserCreate" + } + } + ], + "responses": { + "201": { + "description": "successfully requested the creation of provided office user", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/open/transportation-offices": { + "get": { + "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOfficesOpen", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrder", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateOrders" + } + } + ], + "responses": { + "200": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{orderID}": { + "get": { + "description": "Gets an order", + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Gets an order by ID", + "operationId": "getOrder", + "responses": { + "200": { + "description": "Successfully retrieved order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an order", + "operationId": "updateOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrderPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.orders" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/acknowledge-excess-weight-risk": { + "post": { + "description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", + "operationId": "acknowledgeExcessWeightRisk", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.excessWeightRisk" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/allowances": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an allowance (Orders with Entitlements)", + "operationId": "updateAllowance", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAllowancePayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of allowance", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.allowances" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/update-billable-weight": { + "patch": { + "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements=", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates the max billable weight", + "operationId": "updateBillableWeight", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateBillableWeightPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated Order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.billableWeight" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/update-max-billable-weight/tio": { + "patch": { + "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates the max billable weight with TIO remarks", + "operationId": "updateMaxBillableWeightAsTIO", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMaxBillableWeightAsTIOPayload" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "updated Order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.maxBillableWeight" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/upload_amended_orders": { + "post": { + "description": "Create an amended order for a given order", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "order" + ], + "summary": "Create an amended order for a given order", + "operationId": "uploadAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "orderID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-requests/{paymentRequestID}": { + "get": { + "description": "Fetches an instance of a payment request by id", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Fetches a payment request by id", + "operationId": "getPaymentRequest", + "responses": { + "200": { + "description": "fetched instance of payment request", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "read.paymentRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/bulkDownload": { + "get": { + "description": "This endpoint downloads all uploaded payment request documentation combined into a single PDF.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Downloads all Payment Request documents as a PDF", + "operationId": "bulkDownload", + "responses": { + "200": { + "description": "Payment Request Files PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the payment-request with files to be downloaded", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": { + "get": { + "description": "Returns all shipment payment request SIT usage to support partial SIT invoicing", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Returns all shipment payment request SIT usage to support partial SIT invoicing", + "operationId": "getShipmentsPaymentSITBalance", + "responses": { + "200": { + "description": "Successfully retrieved shipments and their SIT days balance from all payment requests on the move", + "schema": { + "$ref": "#/definitions/ShipmentsPaymentSITBalance" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "read.shipmentsPaymentSITBalance" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "payment request ID of the payment request with SIT service items being reviewed", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/status": { + "patch": { + "description": "Updates status of a payment request by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Updates status of a payment request by id", + "operationId": "updatePaymentRequestStatus", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request", + "name": "paymentRequestID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePaymentRequestStatusPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated payment request", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.paymentRequest" + ] + } + }, + "/ppm-shipments/{ppmShipmentId}/actual-weight": { + "get": { + "description": "Retrieves the actual weight for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the actual weight for a PPM shipment", + "operationId": "getPPMActualWeight", + "responses": { + "200": { + "description": "Returns actual weight for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMActualWeight" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/aoa-packet": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Downloads AOA Packet form PPMShipment as a PDF", + "operationId": "showAOAPacket", + "responses": { + "200": { + "description": "AOA PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the ppmshipment with aoa to be downloaded", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/closeout": { + "get": { + "description": "Retrieves the closeout calculations for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the closeout calcuations for the specified PPM shipment", + "operationId": "getPPMCloseout", + "responses": { + "200": { + "description": "Returns closeout for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMCloseout" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/finish-document-review": { + "patch": { + "description": "Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a PPM shipment's status after document review", + "operationId": "finishDocumentReview", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully finished document review", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { + "patch": { + "description": "Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are\neditable because some have to be set by the customer, e.g. the description and the moving expense type.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates the moving expense", + "operationId": "updateMovingExpense", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "updateMovingExpense", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMovingExpense" + } + } + ], + "responses": { + "200": { + "description": "returns an updated moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/movingExpenseId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/payment-packet": { + "get": { + "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Returns PPM payment packet", + "operationId": "showPaymentPacket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppmShipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "PPM Payment Packet PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "ppm not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/ppm-sit": { + "patch": { + "description": "Updates a PPM shipment's SIT values\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a PPM shipment's SIT values", + "operationId": "updatePPMSIT", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/PPMShipmentSIT" + } + } + ], + "responses": { + "200": { + "description": "Successfully finished PPM SIT update", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { + "patch": { + "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a pro-gear weight ticket", + "operationId": "updateProGearWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "updateProGearWeightTicket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateProGearWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/proGearWeightTicketId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost": { + "get": { + "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the SIT estimated cost for a PPM shipment", + "operationId": "getPPMSITEstimatedCost", + "responses": { + "200": { + "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMSITEstimatedCost" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "enum": [ + "ORIGIN", + "DESTINATION" + ], + "type": "string", + "format": "string", + "description": "location of sit", + "name": "sitLocation", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "Date entered into SIT", + "name": "sitEntryDate", + "in": "query", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "Date departed SIT", + "name": "sitDepartureDate", + "in": "query", + "required": true + }, + { + "type": "integer", + "description": "Weight stored in SIT", + "name": "weightStored", + "in": "query", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { + "patch": { + "description": "Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's\nfields are editable because some have to be set by the customer, e.g. vehicle description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a weight ticket document", + "operationId": "updateWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "updateWeightTicketPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/weightTicketId" + } + ] + }, + "/pws-violations": { + "get": { + "description": "Fetch the possible PWS violations for an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "pwsViolations" + ], + "summary": "Fetch the possible PWS violations for an evaluation report", + "operationId": "getPWSViolations", + "responses": { + "200": { + "description": "Successfully retrieved the PWS violations", + "schema": { + "$ref": "#/definitions/PWSViolations" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/bulk-assignment": { + "get": { + "description": "Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets data for bulk assignment modal", + "operationId": "getBulkAssignmentData", + "parameters": [ + { + "enum": [ + "COUNSELING", + "CLOSEOUT", + "TASK_ORDER", + "PAYMENT_REQUEST" + ], + "type": "string", + "description": "A string corresponding to the queue type", + "name": "queueType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned bulk assignment data", + "schema": { + "$ref": "#/definitions/BulkAssignmentData" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/counseling": { + "get": { + "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all customer moves needing services counseling by GBLOC origin", + "operationId": "getServicesCounselingQueue", + "parameters": [ + { + "type": "integer", + "description": "requested page number of paginated move results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "maximum number of moves to show on each page of paginated results", + "name": "perPage", + "in": "query" + }, + { + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "requestedMoveDate", + "submittedAt", + "originGBLOC", + "originDutyLocation", + "destinationDutyLocation", + "ppmType", + "closeoutInitiated", + "closeoutLocation", + "ppmStatus", + "counselingOffice", + "assignedTo" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "string", + "description": "filters by the branch of the move's service member", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique move code locator", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "description": "filters using a prefix match on the service member's last name", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique service member's DoD ID", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique service member's EMPLID", + "name": "emplid", + "in": "query" + }, + { + "type": "string", + "description": "filters the requested pickup date of a shipment on the move", + "name": "requestedMoveDate", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Start of the submitted at date in the user's local time zone converted to UTC", + "name": "submittedAt", + "in": "query" + }, + { + "type": "string", + "description": "filters the GBLOC of the service member's origin duty location", + "name": "originGBLOC", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "filters the name of the origin duty location on the orders", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "description": "filters the name of the destination duty location on the orders", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED" + ], + "type": "string" + }, + "description": "filters the status of the move", + "name": "status", + "in": "query" + }, + { + "type": "boolean", + "description": "Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves.", + "name": "needsPPMCloseout", + "in": "query" + }, + { + "enum": [ + "FULL", + "PARTIAL" + ], + "type": "string", + "description": "filters PPM type", + "name": "ppmType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Latest date that closeout was initiated on a PPM on the move", + "name": "closeoutInitiated", + "in": "query" + }, + { + "type": "string", + "description": "closeout location", + "name": "closeoutLocation", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "enum": [ + "WAITING_ON_CUSTOMER", + "NEEDS_CLOSEOUT" + ], + "type": "string", + "description": "filters the status of the PPM shipment", + "name": "ppmStatus", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this payment request.\n", + "name": "assignedTo", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueueMovesResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/counseling/origin-list": { + "get": { + "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all moves origin locations in the counselors queue", + "operationId": "getServicesCounselingOriginList", + "parameters": [ + { + "type": "boolean", + "description": "Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations.", + "name": "needsPPMCloseout", + "in": "query" + }, + { + "type": "string", + "description": "Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.", + "name": "viewAsGBLOC", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/Locations" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/moves": { + "get": { + "description": "An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all customer moves by GBLOC origin", + "operationId": "getMovesQueue", + "parameters": [ + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + }, + { + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "originDutyLocation", + "destinationDutyLocation", + "requestedMoveDate", + "appearedInTooAt", + "assignedTo", + "counselingOffice" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "string", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "name": "emplid", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "appearedInTooAt", + "in": "query" + }, + { + "type": "string", + "description": "filters the requested pickup date of a shipment on the move", + "name": "requestedMoveDate", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "SUBMITTED", + "SERVICE COUNSELING COMPLETED", + "APPROVALS REQUESTED" + ], + "type": "string" + }, + "description": "Filtering for the status.", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this move.\n", + "name": "assignedTo", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueueMovesResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/payment-requests": { + "get": { + "description": "An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all payment requests by GBLOC origin", + "operationId": "getPaymentRequestsQueue", + "parameters": [ + { + "enum": [ + "customerName", + "locator", + "submittedAt", + "branch", + "status", + "edipi", + "emplid", + "age", + "originDutyLocation", + "assignedTo", + "counselingOffice" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "number of records to include per page", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Start of the submitted at date in the user's local time zone converted to UTC", + "name": "submittedAt", + "in": "query" + }, + { + "type": "string", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "name": "emplid", + "in": "query" + }, + { + "type": "string", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "type": "string", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this payment request.\n", + "name": "assignedTo", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "PAID", + "DEPRECATED", + "EDI_ERROR" + ], + "type": "string" + }, + "description": "Filtering for the status.", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueuePaymentRequestsResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/prime-moves": { + "get": { + "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "getPrimeMovesQueue", + "operationId": "listPrimeMoves", + "parameters": [ + { + "type": "string", + "format": "date-time", + "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", + "name": "since", + "in": "query" + }, + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "moveCode", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/ListPrimeMovesResult" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/re-service-items": { + "get": { + "description": "Get ReServiceItems", + "produces": [ + "application/json" + ], + "tags": [ + "reServiceItems" + ], + "summary": "Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved)", + "operationId": "getAllReServiceItems", + "responses": { + "200": { + "description": "Successfully retrieved all ReServiceItems.", + "schema": { + "$ref": "#/definitions/ReServiceItems" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/report-violations/{reportID}": { + "get": { + "description": "Fetch the report violations for an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "reportViolations" + ], + "summary": "Fetch the report violations for an evaluation report", + "operationId": "getReportViolationsByReportID", + "responses": { + "200": { + "description": "Successfully retrieved the report violations", + "schema": { + "$ref": "#/definitions/ReportViolations" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "post": { + "description": "Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "reportViolations" + ], + "summary": "Associate violations with an evaluation report", + "operationId": "associateReportViolations", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AssociateReportViolations" + } + } + ], + "responses": { + "204": { + "description": "Successfully saved the report violations" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.reportViolation" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID that has associated violations", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/service-item/{mtoServiceItemID}/entry-date-update": { + "patch": { + "description": "Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Updates a service item's SIT entry date by ID", + "operationId": "updateServiceItemSitEntryDate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServiceItemSitEntryDate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated SIT entry date", + "schema": { + "$ref": "#/definitions/MTOServiceItemSingle" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of the service item", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}": { + "get": { + "description": "fetches a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "fetches a shipment by ID", + "operationId": "getShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be fetched", + "name": "shipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully fetched the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "delete": { + "description": "Soft deletes a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Soft deletes a shipment by ID", + "operationId": "deleteShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be deleted", + "name": "shipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/shipments/{shipmentID}/approve": { + "post": { + "description": "Approves a shipment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves a shipment", + "operationId": "approveShipment", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/approve-diversion": { + "post": { + "description": "Approves a shipment diversion", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves a shipment diversion", + "operationId": "approveShipmentDiversion", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipment diversion", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/ppm-documents": { + "get": { + "description": "Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This\nexcludes any deleted PPM documents.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Gets all the PPM documents for a PPM shipment", + "operationId": "getPPMDocuments", + "responses": { + "200": { + "description": "All PPM documents and associated uploads for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMDocuments" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/reject": { + "post": { + "description": "rejects a shipment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "rejects a shipment", + "operationId": "rejectShipment", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RejectShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully rejected the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-cancellation": { + "post": { + "description": "Requests a shipment cancellation", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Requests a shipment cancellation", + "operationId": "requestShipmentCancellation", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully requested the shipment cancellation", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.shipmentCancellation" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-diversion": { + "post": { + "description": "Requests a shipment diversion", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Requests a shipment diversion", + "operationId": "requestShipmentDiversion", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RequestDiversion" + } + } + ], + "responses": { + "200": { + "description": "Successfully requested the shipment diversion", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.shipmentDiversionRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-reweigh": { + "post": { + "description": "Requests a shipment reweigh", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "reweigh" + ], + "summary": "Requests a shipment reweigh", + "operationId": "requestShipmentReweigh", + "responses": { + "200": { + "description": "Successfully requested a reweigh of the shipment", + "schema": { + "$ref": "#/definitions/Reweigh" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.reweighRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/review-shipment-address-update": { + "patch": { + "description": "This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Allows TOO to review a shipment address update", + "operationId": "reviewShipmentAddressUpdate", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "required": [ + "officeRemarks", + "status" + ], + "properties": { + "officeRemarks": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "REJECTED", + "APPROVED" + ] + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully requested a shipment address update", + "schema": { + "$ref": "#/definitions/ShipmentAddressUpdate" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-extensions": { + "post": { + "description": "TOO can creates an already-approved SIT Duration Update on behalf of a customer", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Create an approved SIT Duration Update", + "operationId": "createApprovedSITDurationUpdate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateApprovedSITDurationUpdate" + } + }, + { + "type": "string", + "description": "We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully created a SIT Extension.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "create.SITExtension" + ] + } + }, + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": { + "patch": { + "description": "Approves a SIT extension", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Approves a SIT extension", + "operationId": "approveSITExtension", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApproveSITExtension" + } + }, + { + "type": "string", + "description": "We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved a SIT extension", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.SITExtension" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the SIT extension", + "name": "sitExtensionID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": { + "patch": { + "description": "Denies a SIT extension", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Denies a SIT extension", + "operationId": "denySITExtension", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DenySITExtension" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully denied a SIT extension", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.SITExtension" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the SIT extension", + "name": "sitExtensionID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": { + "patch": { + "description": "Converts a SIT to customer expense", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "mtoServiceItem" + ], + "summary": "Converts a SIT to customer expense", + "operationId": "updateSITServiceItemCustomerExpense", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateSITServiceItemCustomerExpense" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully converted to customer expense", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.MTOServiceItem" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/tac/valid": { + "get": { + "description": "Returns a boolean based on whether a tac value is valid or not", + "tags": [ + "tac", + "order" + ], + "summary": "Validation of a TAC value", + "operationId": "tacValidation", + "parameters": [ + { + "type": "string", + "description": "The tac value to validate", + "name": "tac", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved validation status", + "schema": { + "$ref": "#/definitions/TacValid" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/transportation-offices": { + "get": { + "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", + "operationId": "getTransportationOffices", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/transportation-offices/gblocs": { + "get": { + "description": "Returns a list of distinct GBLOCs that exist in the transportation offices table", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns a list of distinct GBLOCs that exist in the transportation offices table", + "operationId": "getTransportationOfficesGBLOCs", + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/GBLOCs" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/get/": { + "get": { + "description": "Gets an upload", + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Gets an upload by ID", + "operationId": "getUpload", + "responses": { + "200": { + "description": "Successfully retrieved upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/uploads/{uploadID}": { + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes an upload", + "operationId": "deleteUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be deleted", + "name": "uploadID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the order that the upload belongs to", + "name": "orderID", + "in": "query" + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadID}/update": { + "patch": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Update an existing upload. This is only needed currently for updating the image rotation.", + "operationId": "updateUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be updated", + "name": "uploadID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "properties": { + "rotation": { + "description": "The rotation of the image", + "type": "integer", + "maximum": 3 + } + } + } + } + ], + "responses": { + "201": { + "description": "updated upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Affiliation": { + "description": "Military branch of service", + "type": "string", + "title": "Branch of service", + "enum": [ + "ARMY", + "NAVY", + "MARINES", + "AIR_FORCE", + "COAST_GUARD", + "SPACE_FORCE", + "OTHER" + ], + "x-display-value": { + "AIR_FORCE": "Air Force", + "ARMY": "Army", + "COAST_GUARD": "Coast Guard", + "MARINES": "Marine Corps", + "NAVY": "Navy", + "OTHER": "OTHER", + "SPACE_FORCE": "Space Force" + }, + "x-nullable": true + }, + "ApplicationParameters": { + "type": "object", + "properties": { + "parameterName": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "parameterValue": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "validationCode": { + "type": "string", + "format": "string", + "x-nullable": true + } + } + }, + "ApproveSITExtension": { + "required": [ + "approvedDays" + ], + "properties": { + "approvedDays": { + "description": "Number of days approved for SIT extension", + "type": "integer", + "minimum": 1, + "example": 21 + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT approval", + "type": "string", + "x-nullable": true, + "example": "Approved for three weeks rather than requested 45 days" + }, + "requestReason": { + "description": "Reason from service counselor-provided picklist for SIT Duration Update", + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ], + "example": "AWAITING_COMPLETION_OF_RESIDENCE" + } + } + }, + "AssignOfficeUserBody": { + "type": "object", + "required": [ + "officeUserId", + "roleType" + ], + "properties": { + "officeUserId": { + "type": "string", + "format": "uuid" + }, + "roleType": { + "type": "string" + } + } + }, + "AssignedOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "AssociateReportViolations": { + "description": "A list of PWS violation string ids to associate with an evaluation report", + "type": "object", + "properties": { + "violations": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "AvailableOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "hasSafetyPrivilege": { + "type": "boolean" + }, + "lastName": { + "type": "string" + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "workload": { + "type": "integer" + } + } + }, + "AvailableOfficeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/AvailableOfficeUser" + } + }, + "BackupContact": { + "type": "object", + "required": [ + "name", + "email", + "phone" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "example": "backupContact@mail.com" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + } + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "BulkAssignmentData": { + "type": "object", + "properties": { + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "bulkAssignmentMoveIDs": { + "$ref": "#/definitions/BulkAssignmentMoveIDs" + } + } + }, + "BulkAssignmentMoveID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "BulkAssignmentMoveIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/BulkAssignmentMoveID" + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "Contractor": { + "properties": { + "contractNumber": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "CounselingUpdateAllowancePayload": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, + "organizationalClothingAndIndividualEquipment": { + "description": "only for Army", + "type": "boolean", + "x-nullable": true + }, + "proGearWeight": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 2000, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 500, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "requiredMedicalEquipmentWeight": { + "description": "unit is in lbs", + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "storageInTransit": { + "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", + "type": "integer" + }, + "ubAllowance": { + "type": "integer", + "x-nullable": true, + "example": 500 + } + } + }, + "CounselingUpdateOrderPayload": { + "type": "object", + "required": [ + "issueDate", + "reportByDate", + "ordersType", + "originDutyLocationId", + "newDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ntsSac": { + "title": "NTS SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "title": "NTS TAC", + "maxLength": 4, + "minLength": 4, + "$ref": "#/definitions/NullableString", + "example": "F8J1" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "title": "HHG SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "tac": { + "type": "string", + "title": "HHG TAC", + "maxLength": 4, + "minLength": 4, + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreateAppeal": { + "description": "Appeal status and remarks left for a violation, created by a GSR user.", + "type": "object", + "properties": { + "appealStatus": { + "description": "The status of the appeal set by the GSR user", + "type": "string", + "enum": [ + "sustained", + "rejected" + ], + "example": "These are my violation appeal remarks" + }, + "remarks": { + "description": "Remarks left by the GSR user", + "type": "string", + "example": "These are my violation appeal remarks" + } + } + }, + "CreateApprovedSITDurationUpdate": { + "required": [ + "requestReason", + "approvedDays" + ], + "properties": { + "approvedDays": { + "description": "Number of days approved for SIT extension. This will match requested days saved to the SIT extension model.", + "type": "integer", + "example": 21 + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT Duration Update creation", + "type": "string", + "x-nullable": true, + "example": "Customer needs additional storage time as their new place of residence is not yet ready" + }, + "requestReason": { + "description": "Reason from service counselor-provided picklist for SIT Duration Update", + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ], + "example": "AWAITING_COMPLETION_OF_RESIDENCE" + } + } + }, + "CreateBoatShipment": { + "description": "Boat shipment information for the move.", + "required": [ + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateCustomerPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backupContact": { + "$ref": "#/definitions/BackupContact" + }, + "backupMailingAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "cacUser": { + "type": "boolean" + }, + "createOktaAccount": { + "type": "boolean" + }, + "edipi": { + "type": "string", + "maxLength": 10, + "x-nullable": false, + "example": "1234567890" + }, + "emailIsPreferred": { + "type": "boolean" + }, + "emplid": { + "type": "string", + "maxLength": 7, + "x-nullable": true, + "example": "9485155" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "middleName": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "personalEmail@email.com" + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "residentialAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "CreateCustomerSupportRemark": { + "description": "A text remark written by an customer support user that is associated with a specific move.", + "type": "object", + "required": [ + "content", + "officeUserID" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "CreateEvaluationReport": { + "description": "Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID.", + "type": "object", + "properties": { + "shipmentID": { + "description": "The shipment ID of the shipment to be evaluated in the report", + "type": "string", + "format": "uuid", + "example": "01b9671e-b268-4906-967b-ba661a1d3933" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "secondaryDeliveryAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "tertiaryDeliveryAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "usesExternalVendor": { + "type": "boolean", + "x-nullable": true, + "example": false + } + } + }, + "CreateMobileHomeShipment": { + "description": "A mobile home shipment that the prime moves for a service member.", + "required": [ + "make", + "model", + "year", + "lengthInInches", + "heightInInches", + "widthInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreateOrders": { + "type": "object", + "required": [ + "serviceMemberId", + "issueDate", + "reportByDate", + "ordersType", + "hasDependents", + "spouseHasProGear", + "newDutyLocationId" + ], + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "hasDependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouseHasProGear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreatePPMShipment": { + "description": "A personally procured move is a type of shipment that a service members moves themselves.", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean" + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreatedCustomer": { + "type": "object", + "properties": { + "affiliation": { + "type": "string", + "title": "Branch of service customer is affilated with" + }, + "backupAddress": { + "$ref": "#/definitions/Address" + }, + "backupContact": { + "$ref": "#/definitions/BackupContact" + }, + "cacValidated": { + "type": "boolean" + }, + "edipi": { + "type": "string", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "middleName": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "oktaEmail": { + "type": "string" + }, + "oktaID": { + "type": "string" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "residentialAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Customer": { + "type": "object", + "properties": { + "agency": { + "type": "string", + "title": "Agency customer is affilated with" + }, + "backupAddress": { + "$ref": "#/definitions/Address" + }, + "backup_contact": { + "$ref": "#/definitions/BackupContact" + }, + "cacValidated": { + "type": "boolean", + "x-nullable": true + }, + "current_address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "first_name": { + "type": "string", + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "last_name": { + "type": "string", + "example": "Doe" + }, + "middle_name": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "CustomerContactType": { + "description": "Describes a customer contact type for a MTOServiceItem of type domestic destination SIT.", + "type": "string", + "enum": [ + "FIRST", + "SECOND" + ] + }, + "CustomerSupportRemark": { + "description": "A text remark written by an office user that is associated with a specific move.", + "type": "object", + "required": [ + "id", + "moveID", + "officeUserID", + "content" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeUserEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "readOnly": true + }, + "officeUserFirstName": { + "type": "string", + "readOnly": true, + "example": "Grace" + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeUserLastName": { + "type": "string", + "readOnly": true, + "example": "Griffin" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "CustomerSupportRemarks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "DenySITExtension": { + "required": [ + "officeRemarks", + "convertToCustomerExpense" + ], + "properties": { + "convertToCustomerExpense": { + "description": "Whether or not to convert to members expense once SIT extension is denied.", + "type": "boolean", + "example": false + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT denial", + "type": "string", + "x-nullable": true, + "example": "Denied this extension as it does not match the criteria" + } + } + }, + "DepartmentIndicator": { + "description": "Military branch of service indicator for orders", + "type": "string", + "title": "Department indicator", + "enum": [ + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "COAST_GUARD", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of Secretary of Defense" + }, + "x-nullable": true + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DimensionType": { + "description": "Describes a dimension type for a MTOServiceItemDimension.", + "type": "string", + "enum": [ + "ITEM", + "CRATE" + ] + }, + "Document": { + "type": "object", + "required": [ + "id", + "service_member_id", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "address_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "eTag": { + "type": "string" + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": true + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "x-nullable": true, + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "EvaluationReport": { + "description": "An evaluation report", + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string" + }, + "evalEnd": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "18:00" + }, + "evalStart": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "15:00" + }, + "gsrAppeals": { + "x-nullable": true, + "$ref": "#/definitions/GSRAppeals" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "inspectionDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "inspectionType": { + "x-nullable": true, + "$ref": "#/definitions/EvaluationReportInspectionType" + }, + "location": { + "x-nullable": true, + "$ref": "#/definitions/EvaluationReportLocation" + }, + "locationDescription": { + "type": "string", + "x-nullable": true, + "example": "Route 66 at crash inspection site 3" + }, + "moveID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveReferenceID": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "observedClaimsResponseDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupSpreadEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupSpreadStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedShipmentDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedShipmentPhysicalPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "officeUser": { + "$ref": "#/definitions/EvaluationReportOfficeUser" + }, + "remarks": { + "type": "string", + "x-nullable": true + }, + "reportViolations": { + "x-nullable": true, + "$ref": "#/definitions/ReportViolations" + }, + "seriousIncident": { + "type": "boolean", + "x-nullable": true + }, + "seriousIncidentDesc": { + "type": "string", + "x-nullable": true + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "timeDepart": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "14:30" + }, + "type": { + "$ref": "#/definitions/EvaluationReportType" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "violationsObserved": { + "type": "boolean", + "x-nullable": true + } + } + }, + "EvaluationReportInspectionType": { + "type": "string", + "enum": [ + "DATA_REVIEW", + "PHYSICAL", + "VIRTUAL" + ], + "x-nullable": true + }, + "EvaluationReportList": { + "type": "array", + "items": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "EvaluationReportLocation": { + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION", + "OTHER" + ], + "x-nullable": true + }, + "EvaluationReportOfficeUser": { + "description": "The authoring office user for an evaluation report", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + } + }, + "readOnly": true + }, + "EvaluationReportType": { + "type": "string", + "enum": [ + "SHIPMENT", + "COUNSELING" + ] + }, + "FetchLineOfAccountingPayload": { + "type": "object", + "properties": { + "departmentIndicator": { + "$ref": "#/definitions/DepartmentIndicator" + }, + "effectiveDate": { + "description": "The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request).\n", + "type": "string", + "format": "date", + "example": "2023-01-01" + }, + "tacCode": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "F8J1" + } + } + }, + "GBLOC": { + "type": "string", + "enum": [ + "AGFM", + "APAT", + "BGAC", + "BGNC", + "BKAS", + "CFMQ", + "CLPK", + "CNNQ", + "DMAT", + "GSAT", + "HAFC", + "HBAT", + "JEAT", + "JENQ", + "KKFA", + "LHNQ", + "LKNQ", + "MAPK", + "MAPS", + "MBFL", + "MLNQ", + "XXXX" + ] + }, + "GBLOCs": { + "type": "array", + "items": { + "type": "string" + } + }, + "GSRAppeal": { + "description": "An object associating appeals on violations and serious incidents", + "type": "object", + "properties": { + "appealStatus": { + "$ref": "#/definitions/GSRAppealStatusType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isSeriousIncident": { + "type": "boolean", + "example": false + }, + "officeUser": { + "$ref": "#/definitions/EvaluationReportOfficeUser" + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "remarks": { + "type": "string", + "example": "Office user remarks" + }, + "reportID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "violationID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "GSRAppealStatusType": { + "type": "string", + "enum": [ + "SUSTAINED", + "REJECTED" + ] + }, + "GSRAppeals": { + "type": "array", + "items": { + "$ref": "#/definitions/GSRAppeal" + } + }, + "Grade": { + "type": "string", + "title": "grade", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ], + "x-display-value": { + "ACADEMY_CADET": "Service Academy Cadet", + "AVIATION_CADET": "Aviation Cadet", + "CIVILIAN_EMPLOYEE": "Civilian Employee", + "E_1": "E-1", + "E_2": "E-2", + "E_3": "E-3", + "E_4": "E-4", + "E_5": "E-5", + "E_6": "E-6", + "E_7": "E-7", + "E_8": "E-8", + "E_9": "E-9", + "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", + "MIDSHIPMAN": "Midshipman", + "O_10": "O-10", + "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", + "O_2": "O-2", + "O_3": "O-3", + "O_4": "O-4", + "O_5": "O-5", + "O_6": "O-6", + "O_7": "O-7", + "O_8": "O-8", + "O_9": "O-9", + "W_1": "W-1", + "W_2": "W-2", + "W_3": "W-3", + "W_4": "W-4", + "W_5": "W-5" + }, + "x-nullable": true + }, + "InvalidRequestResponsePayload": { + "type": "object", + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "IsDateWeekendHolidayInfo": { + "type": "object", + "required": [ + "country_code", + "country_name", + "date", + "is_weekend", + "is_holiday" + ], + "properties": { + "country_code": { + "type": "string" + }, + "country_name": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + }, + "details": { + "type": "string" + }, + "is_holiday": { + "type": "boolean" + }, + "is_weekend": { + "type": "boolean" + } + } + }, + "LOAType": { + "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", + "type": "string", + "enum": [ + "HHG", + "NTS" + ], + "example": "HHG" + }, + "LOATypeNullable": { + "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", + "type": "string", + "enum": [ + "HHG", + "NTS" + ], + "x-go-type": { + "import": { + "package": "github.com/transcom/mymove/pkg/swagger/nullable" + }, + "type": "String" + }, + "example": "HHG" + }, + "LineOfAccounting": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-08-03T19:17:10.050Z" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "06254fc3-b763-484c-b555-42855d1ad5cd" + }, + "loaActvtyID": { + "type": "string", + "maxLength": 11, + "x-nullable": true + }, + "loaAgncAcntngCd": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaAgncDsbrCd": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaAlltSnID": { + "type": "string", + "maxLength": 5, + "x-nullable": true, + "example": "123A" + }, + "loaBafID": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "1234" + }, + "loaBdgtAcntClsNm": { + "type": "string", + "maxLength": 8, + "x-nullable": true, + "example": "000000" + }, + "loaBetCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaBgFyTx": { + "type": "integer", + "x-nullable": true, + "example": 2006 + }, + "loaBgnDt": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2005-10-01" + }, + "loaBgtLnItmID": { + "type": "string", + "maxLength": 8, + "x-nullable": true + }, + "loaBgtRstrCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaBgtSubActCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaClsRefID": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaCstCd": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "loaCstCntrID": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "loaCustNm": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaDfAgncyAlctnRcpntID": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaDocID": { + "type": "string", + "maxLength": 15, + "x-nullable": true, + "example": "HHG12345678900" + }, + "loaDptID": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "1 " + }, + "loaDscTx": { + "type": "string", + "x-nullable": true, + "example": "PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER)" + }, + "loaDtlRmbsmtSrcID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaEndDt": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2015-10-01" + }, + "loaEndFyTx": { + "type": "integer", + "x-nullable": true, + "example": 2016 + }, + "loaFmsTrnsactnID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaFnclArID": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaFnctPrsNm": { + "type": "string", + "maxLength": 255, + "x-nullable": true + }, + "loaFndCntrID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaFndTyFgCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaHistStatCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaHsGdsCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "HT" + }, + "loaInstlAcntgActID": { + "type": "string", + "maxLength": 6, + "x-nullable": true, + "example": "12345" + }, + "loaJbOrdNm": { + "type": "string", + "maxLength": 10, + "x-nullable": true + }, + "loaLclInstlID": { + "type": "string", + "maxLength": 18, + "x-nullable": true + }, + "loaMajClmNm": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaMajRmbsmtSrcID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaObjClsID": { + "type": "string", + "maxLength": 6, + "x-nullable": true, + "example": "22NL" + }, + "loaOpAgncyID": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "1A" + }, + "loaPgmElmntID": { + "type": "string", + "maxLength": 12, + "x-nullable": true, + "example": "00000000" + }, + "loaPrjID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaSbaltmtRcpntID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaScrtyCoopCustCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaScrtyCoopDsgntrCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaScrtyCoopImplAgncCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaScrtyCoopLnItmID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaSpclIntrID": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaSrvSrcID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaStatCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true, + "example": "U" + }, + "loaSubAcntID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaSysId": { + "type": "string", + "maxLength": 20, + "x-nullable": true, + "example": "10003" + }, + "loaTnsfrDptNm": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaTrnsnID": { + "type": "string", + "maxLength": 3, + "x-nullable": true, + "example": "B1" + }, + "loaTrsySfxTx": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "0000" + }, + "loaTskBdgtSblnTx": { + "type": "string", + "maxLength": 8, + "x-nullable": true + }, + "loaUic": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaWkCntrRcpntNm": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaWrkOrdID": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "orgGrpDfasCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "ZZ" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "example": "2023-08-03T19:17:38.776Z" + }, + "validHhgProgramCodeForLoa": { + "type": "boolean", + "x-nullable": true + }, + "validLoaForTac": { + "type": "boolean", + "x-nullable": true + } + } + }, + "ListPrimeMove": { + "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "example": "AGFM" + }, + "destinationPostalCode": { + "type": "string", + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orderType": { + "type": "string" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ListPrimeMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/ListPrimeMove" + } + }, + "ListPrimeMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queueMoves": { + "$ref": "#/definitions/ListPrimeMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "Location": { + "type": "object", + "required": [ + "label", + "value" + ], + "properties": { + "label": { + "type": "string", + "example": "Label for display" + }, + "value": { + "type": "string", + "example": "Value for location" + } + } + }, + "Locations": { + "type": "array", + "items": { + "$ref": "#/definitions/Location" + } + }, + "LockedOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "type": "string", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOApprovalServiceItemCodes": { + "description": "MTO level service items to create when updating MTO status.", + "type": "object", + "properties": { + "serviceCodeCS": { + "type": "boolean", + "example": true + }, + "serviceCodeMS": { + "type": "boolean", + "example": true + } + } + }, + "MTOServiceItem": { + "type": "object", + "required": [ + "id", + "moveTaskOrderID", + "reServiceID", + "reServiceCode", + "reServiceName" + ], + "properties": { + "SITPostalCode": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "convertToCustomerExpense": { + "type": "boolean", + "x-omitempty": false, + "example": false + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "customerContacts": { + "$ref": "#/definitions/MTOServiceItemCustomerContacts" + }, + "customerExpenseReason": { + "type": "string", + "x-nullable": true + }, + "deletedAt": { + "type": "string", + "format": "date" + }, + "description": { + "type": "string", + "x-nullable": true + }, + "dimensions": { + "$ref": "#/definitions/MTOServiceItemDimensions" + }, + "eTag": { + "type": "string" + }, + "estimatedPrice": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "estimatedWeight": { + "description": "estimated weight of the shuttle service item provided by the prime", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "feeType": { + "type": "string", + "enum": [ + "COUNSELING", + "CRATING", + "TRUCKING", + "SHUTTLE" + ] + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "x-nullable": true, + "example": "CONUS" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupPostalCode": { + "type": "string", + "x-nullable": true + }, + "quantity": { + "type": "integer" + }, + "rate": { + "type": "integer" + }, + "reServiceCode": { + "type": "string" + }, + "reServiceID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "type": "string" + }, + "reason": { + "type": "string", + "x-nullable": true + }, + "rejectedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDeliveryMiles": { + "type": "integer", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitDestinationOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitOriginHHGActualAddress": { + "$ref": "#/definitions/Address" + }, + "sitOriginHHGOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + }, + "submittedAt": { + "type": "string", + "format": "date" + }, + "total": { + "type": "integer", + "format": "cents" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MTOServiceItemCustomerContact": { + "description": "Customer contact information for a destination SIT service item", + "type": "object", + "properties": { + "dateOfContact": { + "description": "Date of attempted contact by the prime.", + "type": "string", + "format": "date" + }, + "firstAvailableDeliveryDate": { + "description": "First available date that the Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "example": "2020-12-31" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "timeMilitary": { + "description": "Time of attempted contact by the prime.", + "type": "string", + "example": "0400Z" + }, + "type": { + "$ref": "#/definitions/CustomerContactType" + } + } + }, + "MTOServiceItemCustomerContacts": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItemCustomerContact" + } + }, + "MTOServiceItemDimension": { + "description": "Describes a dimension object for the MTOServiceItem.", + "type": "object", + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "type": { + "$ref": "#/definitions/DimensionType" + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItemDimension" + } + }, + "MTOServiceItemSingle": { + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "convertToCustomerExpense": { + "type": "boolean", + "x-omitempty": false, + "example": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerExpenseReason": { + "type": "string", + "x-nullable": true + }, + "deletedAt": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupPostalCode": { + "type": "string", + "x-nullable": true + }, + "reServiceCode": { + "type": "string" + }, + "reServiceID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "type": "string" + }, + "rejectedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "status": { + "type": "string", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOServiceItemStatus": { + "description": "Describes all statuses for a MTOServiceItem", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + }, + "MTOServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "MTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The actual date that the shipment was delivered to the delivery address by the Prime", + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "approvedDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "billableWeightCap": { + "description": "TIO override billable weight to be used for calculations", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "billableWeightJustification": { + "type": "string", + "x-nullable": true, + "example": "more weight than expected" + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "calculatedBillableWeight": { + "type": "integer", + "x-nullable": true, + "readOnly": true, + "example": 2000 + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "destinationSitAuthEndDate": { + "type": "string", + "format": "date-time" + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "distance": { + "type": "integer", + "x-nullable": true, + "example": 500 + }, + "diversion": { + "type": "boolean", + "example": true + }, + "diversionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment needs rerouted" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoAgents": { + "$ref": "#/definitions/MTOAgents" + }, + "mtoServiceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "originSitAuthEndDate": { + "type": "string", + "format": "date-time" + }, + "pickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "primeEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment not good enough" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requiredDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "reweigh": { + "x-nullable": true, + "x-omitempty": true, + "$ref": "#/definitions/Reweigh" + }, + "sacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "scheduledDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "scheduledPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDeliveryAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitDaysAllowance": { + "type": "integer", + "x-nullable": true + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "sitStatus": { + "$ref": "#/definitions/SITStatus" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "tertiaryDeliveryAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "usesExternalVendor": { + "type": "boolean", + "example": false + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "title": "Shipment Status", + "enum": [ + "SUBMITTED", + "REJECTED", + "APPROVED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "example": "SUBMITTED" + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "Move": { + "properties": { + "SCAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "TIOAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "TOOAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "approvalsRequestedAt": { + "description": "The time at which a move is sent back to the TOO becuase the prime added a new service item for approval", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "billableWeightsReviewedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "closeoutOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "closeoutOfficeId": { + "description": "The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members", + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "contractor": { + "$ref": "#/definitions/Contractor" + }, + "contractorId": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "excess_weight_acknowledged_at": { + "description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "excess_weight_qualified_at": { + "description": "Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "financialReviewFlag": { + "description": "This flag is set by office users if a move should be reviewed by a Financial Office", + "type": "boolean", + "x-nullable": false, + "readOnly": true, + "example": false + }, + "financialReviewRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "Delivery Address is too far from duty location" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "type": "string", + "example": "1K43AR" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUser": { + "x-nullable": true, + "$ref": "#/definitions/LockedOfficeUser" + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orders": { + "$ref": "#/definitions/Order" + }, + "ordersId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "referenceId": { + "type": "string", + "x-nullable": true, + "example": "1001-3456" + }, + "serviceCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "shipmentGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "tioRemarks": { + "type": "string", + "x-nullable": true, + "example": "approved additional weight" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveAuditHistories": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveAuditHistory" + } + }, + "MoveAuditHistory": { + "properties": { + "action": { + "description": "Action type; I = insert, D = delete, U = update, T = truncate", + "type": "string" + }, + "actionTstampClk": { + "description": "Wall clock time at which audited event's trigger call occurred", + "type": "string", + "format": "date-time" + }, + "actionTstampStm": { + "description": "Statement start timestamp for tx in which audited event occurred", + "type": "string", + "format": "date-time" + }, + "actionTstampTx": { + "description": "Transaction start timestamp for tx in which audited event occurred", + "type": "string", + "format": "date-time" + }, + "changedValues": { + "description": "A list of (changed/updated) MoveAuditHistoryItem's for a record after the change.", + "type": "object", + "additionalProperties": true, + "x-nullable": true + }, + "context": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "x-nullable": true + }, + "contextId": { + "description": "id column for the context table the record belongs to", + "type": "string", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "eventName": { + "description": "API endpoint name that was called to make the change", + "type": "string", + "x-nullable": true + }, + "id": { + "description": "id from audity_history table", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "objectId": { + "description": "id column for the tableName where the data was changed", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "oldValues": { + "description": "A list of (old/previous) MoveAuditHistoryItem's for a record before the change.", + "type": "object", + "additionalProperties": true, + "x-nullable": true + }, + "relId": { + "description": "relation OID. Table OID (object identifier). Changes with drop/create.", + "type": "integer" + }, + "schemaName": { + "description": "Database schema audited table for this event is in", + "type": "string" + }, + "sessionUserEmail": { + "type": "string", + "x-nullable": true, + "example": "foobar@example.com" + }, + "sessionUserFirstName": { + "type": "string", + "x-nullable": true, + "example": "foo" + }, + "sessionUserId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sessionUserLastName": { + "type": "string", + "x-nullable": true, + "example": "bar" + }, + "sessionUserTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "statementOnly": { + "description": "true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW'", + "type": "boolean", + "example": false + }, + "tableName": { + "description": "name of database table that was changed", + "type": "string" + }, + "transactionId": { + "description": "Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx.", + "type": "integer", + "x-nullable": true + } + } + }, + "MoveAuditHistoryItem": { + "properties": { + "columnName": { + "type": "string" + }, + "columnValue": { + "type": "string" + } + } + }, + "MoveAuditHistoryItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveAuditHistoryItem" + } + }, + "MoveHistory": { + "properties": { + "historyRecords": { + "description": "A list of MoveAuditHistory's connected to the move.", + "$ref": "#/definitions/MoveAuditHistories" + }, + "id": { + "description": "move ID", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "description": "move locator", + "type": "string", + "example": "1K43AR" + }, + "referenceId": { + "description": "move referenceID", + "type": "string", + "x-nullable": true, + "example": "1001-3456" + } + } + }, + "MoveHistoryResult": { + "type": "object", + "properties": { + "historyRecords": { + "description": "A list of MoveAuditHistory's connected to the move.", + "$ref": "#/definitions/MoveAuditHistories" + }, + "id": { + "description": "move ID", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "description": "move locator", + "type": "string", + "example": "1K43AR" + }, + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "referenceId": { + "description": "move referenceID", + "type": "string", + "x-nullable": true, + "example": "1001-3456" + }, + "totalCount": { + "type": "integer" + } + } + }, + "MovePayload": { + "type": "object", + "required": [ + "id", + "orders_id", + "locator", + "created_at", + "updated_at", + "eTag" + ], + "properties": { + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + }, + "closeout_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "mto_shipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveStatus": { + "type": "string", + "enum": [ + "DRAFT", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED", + "SUBMITTED", + "APPROVALS REQUESTED", + "APPROVED", + "CANCELED" + ] + }, + "MoveTaskOrder": { + "description": "The Move (MoveTaskOrder)", + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "destinationDutyLocation": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "eTag": { + "type": "string" + }, + "entitlements": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "type": "string", + "example": "1K43AR" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "originDutyLocation": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "requestedPickupDate": { + "type": "string", + "format": "date" + }, + "serviceCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "tioRemarks": { + "type": "string", + "x-nullable": true, + "example": "approved additional weight" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveTaskOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "MovingExpense": { + "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", + "type": "object", + "required": [ + "id", + "createdAt", + "updatedAt", + "ppmShipmentId", + "documentId", + "document" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp the moving expense object was initially created in the system (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "A brief description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "The Document object that contains all file uploads for this expense" + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The id of the Document that contains all file uploads for this expense", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "Unique primary identifier of the Moving Expense object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingReceipt": { + "description": "Indicates if the service member is missing the receipt with the proof of expense amount", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "paidWithGtcc": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The PPM Shipment id that this moving expense belongs to", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedAmount": { + "description": "Customer submitted total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedDescription": { + "description": "Customer submitted description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "submittedMovingExpenseType": { + "$ref": "#/definitions/SubmittedMovingExpenseType" + }, + "submittedSitEndDate": { + "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "submittedSitStartDate": { + "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "updatedAt": { + "description": "Timestamp when a property of this moving expense object was last modified (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "MovingExpenses": { + "description": "All moving expenses associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + }, + "x-omitempty": false + }, + "NullableString": { + "type": "string", + "x-go-type": { + "import": { + "package": "github.com/transcom/mymove/pkg/swagger/nullable" + }, + "type": "String" + } + }, + "OfficeUser": { + "type": "object", + "required": [ + "id", + "firstName", + "middleInitials", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "active", + "roles", + "edipi", + "otherUniqueId", + "rejectionReason", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "middleInitials": { + "type": "string" + }, + "otherUniqueId": { + "type": "string" + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REQUESTED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "OfficeUserCreate": { + "type": "object", + "required": [ + "firstName", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "roles" + ], + "properties": { + "edipi": { + "type": "string", + "title": "EDIPI", + "maxLength": 10, + "x-nullable": true, + "example": "1234567890" + }, + "email": { + "type": "string", + "title": "Email", + "x-nullable": false, + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": false + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": false + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "L." + }, + "otherUniqueId": { + "type": "string", + "title": "Office user identifier when EDIPI is not available", + "x-nullable": true + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + }, + "x-nullable": false + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": false, + "example": "212-555-5555" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "x-nullable": false, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OfficeUserRole": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "title": "roleType", + "x-nullable": true, + "example": "task_ordering_officer" + } + } + }, + "OmittableMovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OmittablePPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + }, + "x-nullable": true, + "x-omitempty": false + }, + "Order": { + "type": "object", + "properties": { + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "amendedOrdersAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "date_issued": { + "type": "string", + "format": "date", + "example": "2020-01-01" + }, + "department_indicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "eTag": { + "type": "string" + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "first_name": { + "type": "string", + "readOnly": true, + "example": "John" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "last_name": { + "type": "string", + "readOnly": true, + "example": "Doe" + }, + "methodOfPayment": { + "type": "string" + }, + "moveCode": { + "type": "string", + "example": "H2XFJF" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "naics": { + "type": "string" + }, + "ntsSac": { + "type": "string", + "title": "NTS SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "type": "string", + "title": "NTS TAC", + "x-nullable": true, + "example": "F8J1" + }, + "order_number": { + "type": "string", + "x-nullable": true, + "example": "030-00362" + }, + "order_type": { + "$ref": "#/definitions/OrdersType" + }, + "order_type_detail": { + "x-nullable": true, + "$ref": "#/definitions/OrdersTypeDetail" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "packingAndShippingInstructions": { + "type": "string" + }, + "report_by_date": { + "type": "string", + "format": "date", + "example": "2020-01-01" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?", + "example": false + }, + "supplyAndServicesCostEstimate": { + "type": "string" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + }, + "uploadedAmendedOrderID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploaded_order_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OrderBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PPMActualWeight": { + "description": "The actual net weight of a single PPM shipment. Used during document review for PPM closeout.", + "required": [ + "actualWeight" + ], + "properties": { + "actualWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "PPMAdvanceStatus": { + "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", + "type": "string", + "title": "PPM Advance Status", + "enum": [ + "APPROVED", + "REJECTED", + "EDITED", + "RECEIVED", + "NOT_RECEIVED" + ], + "x-nullable": true + }, + "PPMCloseout": { + "description": "The calculations needed in the \"Review Documents\" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment.", + "required": [ + "id" + ], + "properties": { + "SITReimbursement": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "aoa": { + "description": "Advance Operating Allowance (AOA).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "ddp": { + "description": "The Domestic Destination Price (DDP).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "dop": { + "description": "The Domestic Origin Price (DOP).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "gcc": { + "description": "Government Constructive Cost (GCC)", + "type": "integer", + "format": "cents", + "title": "GCC", + "x-nullable": true, + "x-omitempty": false + }, + "grossIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "haulFSC": { + "description": "The linehaul/shorthaul Fuel Surcharge (FSC).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "haulPrice": { + "description": "The price of the linehaul or shorthaul.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "haulType": { + "description": "The type of haul calculation used for this shipment (shorthaul or linehaul).", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "miles": { + "description": "The distance between the old address and the new address in miles.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 54 + }, + "packPrice": { + "description": "The full price of all packing/unpacking services.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "plannedMoveDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightCustomer": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightSpouse": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "remainingIncentive": { + "description": "The remaining reimbursement amount that is still owed to the customer.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "unpackPrice": { + "description": "The full price of all packing/unpacking services.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + } + }, + "PPMDocumentStatusReason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "PPMDocuments": { + "description": "All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses.", + "type": "object", + "properties": { + "MovingExpenses": { + "$ref": "#/definitions/MovingExpenses" + }, + "ProGearWeightTickets": { + "$ref": "#/definitions/ProGearWeightTickets" + }, + "WeightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true, + "x-omitempty": false + }, + "PPMSITEstimatedCost": { + "description": "The estimated cost of SIT for a single PPM shipment. Used during document review for PPM.", + "required": [ + "sitCost", + "priceFirstDaySIT", + "priceAdditionalDaySIT" + ], + "properties": { + "paramsAdditionalDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "numberDaysSIT": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "30" + }, + "priceRateOrFactor": { + "type": "string", + "example": "0.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "paramsFirstDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "priceRateOrFactor": { + "type": "string", + "example": "20.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "priceAdditionalDaySIT": { + "type": "integer", + "format": "cents", + "title": "Price of an additional day in SIT", + "example": 2000 + }, + "priceFirstDaySIT": { + "type": "integer", + "format": "cents", + "title": "Price of the first day in SIT", + "example": 2000 + }, + "sitCost": { + "type": "integer", + "example": 2000 + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4300 + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true + }, + "PPMShipmentSIT": { + "description": "SIT related items for a PPM shipment", + "required": [ + "sitLocation" + ], + "properties": { + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PPMStatus": { + "type": "string", + "enum": [ + "CANCELED", + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "COMPLETED" + ] + }, + "PWSViolation": { + "description": "A PWS violation for an evaluation report", + "type": "object", + "properties": { + "additionalDataElem": { + "type": "string", + "example": "QAE Observed Delivery Date" + }, + "category": { + "type": "string", + "example": "Pre-Move Services" + }, + "displayOrder": { + "type": "integer", + "example": 3 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isKpi": { + "type": "boolean", + "example": false + }, + "paragraphNumber": { + "type": "string", + "example": "1.2.3.4.5" + }, + "requirementStatement": { + "type": "string", + "example": "The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS." + }, + "requirementSummary": { + "type": "string", + "example": "Provide a single point of contact (POC)" + }, + "subCategory": { + "type": "string", + "example": "Weight Estimate" + }, + "title": { + "type": "string", + "example": "Customer Support" + } + }, + "readOnly": true + }, + "PWSViolations": { + "type": "array", + "items": { + "$ref": "#/definitions/PWSViolation" + } + }, + "PatchMTOServiceItemStatusPayload": { + "properties": { + "rejectionReason": { + "description": "Reason the service item was rejected", + "type": "string", + "x-nullable": true, + "example": "Insufficent details provided" + }, + "status": { + "description": "Describes all statuses for a MTOServiceItem", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + } + } + }, + "PaymentRequest": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "ediErrorCode": { + "description": "Reported code from syncada for the EDI error encountered", + "type": "string", + "x-nullable": true + }, + "ediErrorDescription": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true + }, + "ediErrorType": { + "description": "Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858.", + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrder": { + "$ref": "#/definitions/Move" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "receivedByGexAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "reviewedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sentToGexAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "serviceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + }, + "tppsInvoiceAmountPaidTotalMillicents": { + "type": "integer", + "format": "millients", + "title": "Total amount that TPPS paid for all service items on the payment request in millicents", + "x-nullable": true + }, + "tppsInvoiceSellerPaidDate": { + "type": "string", + "format": "date-time", + "title": "Date that TPPS paid HS for the payment request", + "x-nullable": true + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemCode": { + "type": "string", + "example": "DLH" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemName": { + "type": "string", + "example": "Move management" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoShipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + }, + "tppsInvoiceAmountPaidPerServiceItemMillicents": { + "type": "integer", + "format": "millicents", + "title": "Amount that TPPS paid for the individual service item in millicents", + "x-nullable": true + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "PostDocumentPayload": { + "type": "object", + "properties": { + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + } + } + }, + "ProGearWeightTicket": { + "description": "Pro-gear associated information and weight docs for a PPM shipment", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "documentId", + "document" + ], + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the pro-gear weight." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the pro-gear weight ticket.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedBelongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedHasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedWeight": { + "description": "Customer submitted weight of the pro-gear.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weight": { + "description": "Weight of the pro-gear.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "ProGearWeightTickets": { + "description": "All progear weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + }, + "x-omitempty": false + }, + "ProofOfServiceDoc": { + "properties": { + "isWeightTicket": { + "type": "boolean" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "QueueMove": { + "type": "object", + "properties": { + "appearedInTooAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "assignable": { + "type": "boolean" + }, + "assignedTo": { + "x-nullable": true, + "$ref": "#/definitions/AssignedOfficeUser" + }, + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "closeoutInitiated": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "closeoutLocation": { + "type": "string", + "x-nullable": true + }, + "counselingOffice": { + "type": "string", + "x-nullable": true + }, + "counselingOfficeID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUser": { + "x-nullable": true, + "$ref": "#/definitions/LockedOfficeUser" + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orderType": { + "type": "string", + "x-nullable": true + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "ppmStatus": { + "x-nullable": true, + "$ref": "#/definitions/PPMStatus" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ], + "x-nullable": true + }, + "requestedMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "QueueMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/QueueMove" + } + }, + "QueueMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queueMoves": { + "$ref": "#/definitions/QueueMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "QueuePaymentRequest": { + "type": "object", + "properties": { + "age": { + "description": "Days since the payment request has been requested. Decimal representation will allow more accurate sorting.", + "type": "number", + "format": "double" + }, + "assignable": { + "type": "boolean" + }, + "assignedTo": { + "x-nullable": true, + "$ref": "#/definitions/AssignedOfficeUser" + }, + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "counselingOffice": { + "type": "string", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "moveID": { + "type": "string", + "format": "uuid" + }, + "orderType": { + "type": "string", + "x-nullable": true + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "status": { + "$ref": "#/definitions/QueuePaymentRequestStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "QueuePaymentRequestStatus": { + "type": "string", + "title": "Queue Payment Request Status", + "enum": [ + "Payment requested", + "Reviewed", + "Rejected", + "Paid" + ] + }, + "QueuePaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/QueuePaymentRequest" + } + }, + "QueuePaymentRequestsResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queuePaymentRequests": { + "$ref": "#/definitions/QueuePaymentRequests" + }, + "totalCount": { + "type": "integer" + } + } + }, + "ReServiceItem": { + "description": "A Service Item which ties an ReService, Market, and Shipment Type together", + "type": "object", + "properties": { + "isAutoApproved": { + "type": "boolean", + "example": true + }, + "marketCode": { + "type": "string", + "enum": [ + "i", + "d" + ], + "example": "i (International), d (Domestic)" + }, + "serviceCode": { + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DCRTSA", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSFSC", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSFSC", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICRT", + "ICRTSA", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSFSC", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOFSIT", + "IOPSIT", + "IOSFSC", + "IOSHUT", + "ISLH", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "PODFSC", + "POEFSC", + "UBP" + ], + "example": "UBP" + }, + "serviceName": { + "type": "string", + "example": "International UB, International Shipping \u0026 Linehaul" + }, + "shipmentType": { + "type": "string", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "example": "HHG, UNACCOMPANIED_BAGGAGE" + } + } + }, + "ReServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ReServiceItem" + } + }, + "RejectShipment": { + "required": [ + "rejectionReason" + ], + "properties": { + "rejectionReason": { + "type": "string", + "example": "MTO Shipment not good enough" + } + } + }, + "ReportViolation": { + "description": "An object associating violations to evaluation reports", + "type": "object", + "properties": { + "gsrAppeals": { + "x-nullable": true, + "$ref": "#/definitions/GSRAppeals" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reportID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "violation": { + "$ref": "#/definitions/PWSViolation" + }, + "violationID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "ReportViolations": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportViolation" + } + }, + "RequestDiversion": { + "required": [ + "diversionReason" + ], + "properties": { + "diversionReason": { + "type": "string", + "example": "Shipment route needs to change" + } + } + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the counselor" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "roleName", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleName": { + "type": "string", + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "SITServiceItemGrouping": { + "properties": { + "serviceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "summary": { + "description": "Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\nThis is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items.\n", + "$ref": "#/definitions/SITSummary" + } + } + }, + "SITServiceItemGroupings": { + "description": "Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\n", + "type": "array", + "items": { + "$ref": "#/definitions/SITServiceItemGrouping" + } + }, + "SITStatus": { + "properties": { + "calculatedTotalDaysInSIT": { + "type": "integer" + }, + "currentSIT": { + "type": "object", + "properties": { + "daysInSIT": { + "type": "integer" + }, + "location": { + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "serviceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitAuthorizedEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + } + } + }, + "pastSITServiceItemGroupings": { + "description": "A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes.\n", + "$ref": "#/definitions/SITServiceItemGroupings" + }, + "totalDaysRemaining": { + "type": "integer" + }, + "totalSITDaysUsed": { + "type": "integer" + } + } + }, + "SITSummary": { + "properties": { + "daysInSIT": { + "type": "integer" + }, + "firstDaySITServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "location": { + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "sitAuthorizedEndDate": { + "type": "string", + "format": "date-time" + }, + "sitCustomerContacted": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date-time" + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "SearchCustomer": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "edipi": { + "type": "string", + "x-nullable": true + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "lastName": { + "type": "string", + "x-nullable": true, + "example": "Doe" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "personalEmail@email.com" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "SearchCustomers": { + "type": "array", + "items": { + "$ref": "#/definitions/SearchCustomer" + } + }, + "SearchCustomersResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "searchCustomers": { + "$ref": "#/definitions/SearchCustomers" + }, + "totalCount": { + "type": "integer" + } + } + }, + "SearchMove": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "destinationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "destinationPostalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "edipi": { + "type": "string", + "x-nullable": true, + "example": 1234567890 + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "lastName": { + "type": "string", + "x-nullable": true, + "example": "Doe" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orderType": { + "type": "string" + }, + "originDutyLocationPostalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "paymentRequestCode": { + "type": "string", + "x-nullable": true, + "example": "9551-6199-2" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + } + } + }, + "SearchMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/SearchMove" + } + }, + "SearchMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "searchMoves": { + "$ref": "#/definitions/SearchMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceItemSitEntryDate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "mtoServiceItemID": { + "type": "string", + "format": "uuid" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "ServiceRequestDocuments": { + "description": "documents uploaded by the Prime as proof of request for service items", + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "ShipmentPaymentSITBalance": { + "properties": { + "pendingBilledEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "pendingBilledStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "pendingSITDaysInvoiced": { + "type": "integer" + }, + "previouslyBilledDays": { + "type": "integer", + "x-nullable": true + }, + "previouslyBilledEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "previouslyBilledStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentID": { + "type": "string", + "format": "uuid" + }, + "totalSITDaysAuthorized": { + "type": "integer" + }, + "totalSITDaysRemaining": { + "type": "integer" + }, + "totalSITEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + } + } + }, + "ShipmentsPaymentSITBalance": { + "type": "array", + "items": { + "$ref": "#/definitions/ShipmentPaymentSITBalance" + } + }, + "SignedCertification": { + "description": "Signed certification", + "type": "object", + "required": [ + "id", + "submittingUserId", + "moveId", + "certificationType", + "certificationText", + "signature", + "date", + "createdAt", + "updatedAt", + "eTag" + ], + "properties": { + "certificationText": { + "description": "Full text that the customer agreed to and signed.", + "type": "string" + }, + "certificationType": { + "$ref": "#/definitions/SignedCertificationType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "date": { + "description": "Date that the customer signed the certification.", + "type": "string", + "format": "date" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveId": { + "description": "The ID of the move associated with this signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmId": { + "description": "The ID of the PPM shipment associated with this signed certification, if any.", + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "signature": { + "description": "The signature that the customer provided.", + "type": "string" + }, + "submittingUserId": { + "description": "The ID of the user that signed.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SignedCertificationType": { + "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "SubmittedMovingExpenseType": { + "description": "Customer Submitted Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "TacValid": { + "type": "object", + "required": [ + "isValid" + ], + "properties": { + "isValid": { + "type": "boolean", + "example": true + } + } + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phone_lines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "required": [ + "officeUserId", + "transportationOfficeId", + "primaryOffice" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "UpdateAllowancePayload": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, + "organizationalClothingAndIndividualEquipment": { + "description": "only for Army", + "type": "boolean", + "x-nullable": true + }, + "proGearWeight": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 2000, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 500, + "x-formatting": "weight", + "x-nullable": true, + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "description": "unit is in lbs", + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "storageInTransit": { + "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", + "type": "integer" + }, + "ubAllowance": { + "type": "integer", + "x-nullable": true, + "example": 500 + } + } + }, + "UpdateBillableWeightPayload": { + "type": "object", + "properties": { + "authorizedWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + } + } + }, + "UpdateBoatShipment": { + "type": "object", + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean", + "x-nullable": true + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ], + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateCustomerPayload": { + "type": "object", + "properties": { + "backupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "backup_contact": { + "$ref": "#/definitions/BackupContact" + }, + "cac_validated": { + "type": "boolean" + }, + "current_address": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "first_name": { + "type": "string", + "example": "John" + }, + "last_name": { + "type": "string", + "example": "Doe" + }, + "middle_name": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + } + } + }, + "UpdateCustomerSupportRemarkPayload": { + "description": "A text remark update to an existing remark created by the current active user (the CSR).", + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + } + } + }, + "UpdateMaxBillableWeightAsTIOPayload": { + "type": "object", + "required": [ + "authorizedWeight", + "tioRemarks" + ], + "properties": { + "authorizedWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "tioRemarks": { + "description": "TIO remarks for updating the max billable weight", + "type": "string", + "minLength": 1, + "x-nullable": true, + "example": "Increasing max billable weight" + } + } + }, + "UpdateMobileHomeShipment": { + "type": "object", + "properties": { + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMovingExpense": { + "type": "object", + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer" + }, + "description": { + "description": "A brief description of the expense.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer" + } + } + }, + "UpdateOrderPayload": { + "type": "object", + "required": [ + "issueDate", + "reportByDate", + "ordersType", + "newDutyLocationId", + "originDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ntsSac": { + "title": "NTS SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "title": "NTS TAC", + "maxLength": 4, + "minLength": 4, + "$ref": "#/definitions/NullableString", + "example": "F8J1" + }, + "ordersAcknowledgement": { + "description": "Confirmation that the new amended orders were reviewed after previously approving the original orders", + "type": "boolean", + "x-nullable": true + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "title": "HHG SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "tac": { + "type": "string", + "title": "HHG TAC", + "maxLength": 4, + "minLength": 4, + "x-nullable": true, + "example": "F8J1" + } + } + }, + "UpdatePPMShipment": { + "type": "object", + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "actualMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceAmountRequested": { + "description": "The amount request for an advance, or null if no advance is requested\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceStatus": { + "x-nullable": true, + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4300 + }, + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean", + "x-nullable": true + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + } + } + }, + "UpdatePaymentRequestStatusPayload": { + "type": "object", + "properties": { + "eTag": { + "type": "string" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "UpdateProGearWeightTicket": { + "type": "object", + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean" + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "weight": { + "description": "Weight of the pro-gear contained in the shipment.", + "type": "integer" + } + } + }, + "UpdateSITServiceItemCustomerExpense": { + "required": [ + "convertToCustomerExpense", + "customerExpenseReason" + ], + "properties": { + "convertToCustomerExpense": { + "type": "boolean", + "example": true + }, + "customerExpenseReason": { + "description": "Reason the service item was rejected", + "type": "string", + "example": "Insufficent details provided" + } + } + }, + "UpdateShipment": { + "type": "object", + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "x-nullable": true, + "$ref": "#/definitions/MTOAgents" + }, + "billableWeightCap": { + "description": "estimated weight of the shuttle service item provided by the prime", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "billableWeightJustification": { + "type": "string", + "x-nullable": true, + "example": "more weight than expected" + }, + "boatShipment": { + "$ref": "#/definitions/UpdateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/UpdateMobileHomeShipment" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sacType": { + "$ref": "#/definitions/LOATypeNullable" + }, + "secondaryDeliveryAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "$ref": "#/definitions/LOATypeNullable" + }, + "tertiaryDeliveryAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "usesExternalVendor": { + "type": "boolean", + "x-nullable": true, + "example": false + } + } + }, + "UpdateWeightTicket": { + "type": "object", + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer" + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer" + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string" + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean" + } + } + }, + "Upload": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "id", + "url", + "filename", + "contentType", + "bytes", + "createdAt", + "updatedAt" + ], + "properties": { + "bytes": { + "type": "integer", + "readOnly": true + }, + "contentType": { + "type": "string", + "format": "mime-type", + "readOnly": true, + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "filename": { + "type": "string", + "readOnly": true, + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isWeightTicket": { + "type": "boolean" + }, + "rotation": { + "type": "integer", + "example": 2 + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ], + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "uploadType": { + "type": "string", + "enum": [ + "USER", + "PRIME", + "OFFICE" + ], + "readOnly": true, + "example": "OFFICE" + }, + "url": { + "type": "string", + "format": "uri", + "readOnly": true, + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocation": { + "description": "A postal code, city, and state lookup", + "type": "object", + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocations": { + "type": "array", + "items": { + "$ref": "#/definitions/VLocation" + } + }, + "ValidationError": { + "required": [ + "invalid_fields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object" + } + ], + "properties": { + "invalid_fields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "WeightTicket": { + "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "emptyDocumentId", + "emptyDocument", + "fullDocument", + "fullDocumentId", + "proofOfTrailerOwnershipDocument", + "proofOfTrailerOwnershipDocumentId" + ], + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "emptyDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when empty." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "emptyDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", + "type": "string", + "format": "uuid", + "readOnly": true + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "fullDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when full." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "fullDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "ID of this set of weight tickets.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this set of weight tickets is for.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "proofOfTrailerOwnershipDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the proof of trailer ownership." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "proofOfTrailerOwnershipDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedEmptyWeight": { + "description": "Customer submitted weight of the vehicle when empty.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedFullWeight": { + "description": "Customer submitted weight of the vehicle when full.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedOwnsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedTrailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "WeightTickets": { + "description": "All weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/WeightTicket" + }, + "x-omitempty": false + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + "movingExpenseId": { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + }, + "ppmShipmentId": { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + "proGearWeightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + }, + "weightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "NotFound": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PermissionDenied": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PreconditionFailed": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "ServerError": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "name": "queues" + }, + { + "name": "move" + }, + { + "description": "Move Orders - Commonly called “Orders,” especially in customer-facing language. Orders are plural because they're a bundle of related orders issued bya Service (e.g. Army, Air Force, Navy) to a customer that authorize (and order) that customer to move from one location to another.\nOrders are backed by $$ in the bank to support that move, which is identified by a Line of Account (LOA) code on the orders document.\n", + "name": "order" + }, + { + "name": "moveTaskOrder" + }, + { + "name": "customer" + }, + { + "name": "mtoServiceItem" + }, + { + "name": "mtoShipment" + }, + { + "name": "shipment" + }, + { + "name": "mtoAgent" + }, + { + "name": "paymentServiceItem" + }, + { + "name": "ppm" + }, + { + "name": "tac" + }, + { + "name": "transportationOffice" + }, + { + "name": "addresses" + }, + { + "name": "uploads" + }, + { + "name": "paymentRequests" + }, + { + "name": "reServiceItems" + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The GHC API is a RESTful API that enables the Office application for MilMove.\n\nAll endpoints are located under ` + "`" + `/ghc/v1` + "`" + `.\n", + "title": "MilMove GHC API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/ghc/v1", + "paths": { + "/addresses/zip-city-lookup/{search}": { + "get": { + "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string", + "operationId": "getLocationByZipCityState", + "parameters": [ + { + "type": "string", + "name": "search", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested list of city, state, county, and postal code matches", + "schema": { + "$ref": "#/definitions/VLocations" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/application_parameters/{parameterName}": { + "get": { + "description": "Searches for an application parameter by name, returns nil if not found", + "tags": [ + "application_parameters" + ], + "summary": "Searches for an application parameter by name, returns nil if not found", + "operationId": "getParam", + "parameters": [ + { + "type": "string", + "format": "string", + "description": "Parameter Name", + "name": "parameterName", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Application Parameters", + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + }, + "/calendar/{countryCode}/is-weekend-holiday/{date}": { + "get": { + "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", + "produces": [ + "application/json" + ], + "tags": [ + "calendar" + ], + "summary": "Validate move date selection", + "operationId": "isDateWeekendHoliday", + "parameters": [ + { + "enum": [ + "US" + ], + "type": "string", + "description": "country code for context of date", + "name": "countryCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date", + "description": "input date to determine if weekend/holiday for given country.", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully determine if given date is weekend and/or holiday for given country.", + "schema": { + "$ref": "#/definitions/IsDateWeekendHolidayInfo" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/counseling/orders/{orderID}": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an order (performed by a services counselor)", + "operationId": "counselingUpdateOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CounselingUpdateOrderPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to update", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/counseling/orders/{orderID}/allowances": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an allowance (Orders with Entitlements)", + "operationId": "counselingUpdateAllowance", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CounselingUpdateAllowancePayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of allowance", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/customer": { + "post": { + "description": "Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Creates a customer with Okta option", + "operationId": "createCustomerWithOktaOption", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateCustomerPayload" + } + } + ], + "responses": { + "200": { + "description": "successfully created the customer", + "schema": { + "$ref": "#/definitions/CreatedCustomer" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/customer-support-remarks/{customerSupportRemarkID}": { + "delete": { + "description": "Soft deletes a customer support remark by ID", + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Soft deletes a customer support remark by ID", + "operationId": "deleteCustomerSupportRemark", + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Updates a customer support remark for a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Updates a customer support remark for a move", + "operationId": "updateCustomerSupportRemarkForMove", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCustomerSupportRemarkPayload" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated customer support remark", + "schema": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the customer support remark ID to be modified", + "name": "customerSupportRemarkID", + "in": "path", + "required": true + } + ] + }, + "/customer/search": { + "post": { + "description": "Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Search customers by DOD ID or customer name", + "operationId": "searchCustomers", + "parameters": [ + { + "description": "field that results should be sorted by", + "name": "body", + "in": "body", + "schema": { + "properties": { + "branch": { + "description": "Branch", + "type": "string", + "minLength": 1 + }, + "customerName": { + "description": "Customer Name", + "type": "string", + "minLength": 1, + "x-nullable": true + }, + "edipi": { + "description": "DOD ID", + "type": "string", + "maxLength": 10, + "minLength": 10, + "x-nullable": true + }, + "emplid": { + "description": "EMPLID", + "type": "string", + "maxLength": 7, + "minLength": 7, + "x-nullable": true + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-nullable": true + }, + "page": { + "description": "requested page of results", + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "sort": { + "type": "string", + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "personalEmail", + "telephone" + ], + "x-nullable": true + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully returned all customers matching the criteria", + "schema": { + "$ref": "#/definitions/SearchCustomersResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/customer/{customerID}": { + "get": { + "description": "Returns a given customer", + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Returns a given customer", + "operationId": "getCustomer", + "responses": { + "200": { + "description": "Successfully retrieved information on an individual customer", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Updates customer info by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customer" + ], + "summary": "Updates customer info", + "operationId": "updateCustomer", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateCustomerPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Customer" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.customer" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of customer to use", + "name": "customerID", + "in": "path", + "required": true + } + ] + }, + "/documents": { + "post": { + "description": "Documents represent a physical artifact such as a scanned document or a PDF file", + "tags": [ + "ghcDocuments" + ], + "summary": "Create a new document", + "operationId": "createDocument", + "parameters": [ + { + "name": "documentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostDocumentPayload" + } + } + ], + "responses": { + "201": { + "description": "created document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/documents/{documentId}": { + "get": { + "description": "Returns a document and its uploads", + "tags": [ + "ghcDocuments" + ], + "summary": "Returns a document", + "operationId": "getDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to return", + "name": "documentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/evaluation-reports/{reportID}": { + "get": { + "description": "Gets an evaluation report by ID", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Gets an evaluation report by ID", + "operationId": "getEvaluationReport", + "responses": { + "200": { + "description": "Successfully got the report", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "put": { + "description": "Saves an evaluation report as a draft", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Saves an evaluation report as a draft", + "operationId": "saveEvaluationReport", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully saved the report" + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "delete": { + "description": "Deletes an evaluation report by ID", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Deletes an evaluation report by ID", + "operationId": "deleteEvaluationReport", + "responses": { + "204": { + "description": "Successfully deleted the report" + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "delete.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be modified", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/appeal/add": { + "post": { + "description": "Adds an appeal to a serious incident on an evaluation report", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Adds an appeal to a serious incident on an evaluation report", + "operationId": "addAppealToSeriousIncident", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAppeal" + } + } + ], + "responses": { + "204": { + "description": "Successfully added an appeal to a serious incident" + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/download": { + "get": { + "description": "Downloads an evaluation report as a PDF", + "produces": [ + "application/pdf" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Downloads an evaluation report as a PDF", + "operationId": "downloadEvaluationReport", + "responses": { + "200": { + "description": "Evaluation report PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be downloaded", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/submit": { + "post": { + "description": "Submits an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Submits an evaluation report", + "operationId": "submitEvaluationReport", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully submitted an evaluation report with the provided ID" + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID to be modified", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": { + "post": { + "description": "Adds an appeal to a violation", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Adds an appeal to a violation", + "operationId": "addAppealToViolation", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateAppeal" + } + } + ], + "responses": { + "204": { + "description": "Successfully added an appeal to a violation" + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID", + "name": "reportID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "the report violation ID", + "name": "reportViolationID", + "in": "path", + "required": true + } + ] + }, + "/lines-of-accounting": { + "post": { + "description": "Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "linesOfAccounting" + ], + "summary": "Fetch line of accounting", + "operationId": "requestLineOfAccounting", + "parameters": [ + { + "description": "Service member affiliation, effective date, and TAC code.", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/FetchLineOfAccountingPayload" + } + } + ], + "responses": { + "200": { + "description": "Successfully retrieved line of accounting", + "schema": { + "$ref": "#/definitions/LineOfAccounting" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}": { + "get": { + "description": "Gets a move", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Gets a move by ID", + "operationId": "getMoveTaskOrder", + "responses": { + "200": { + "description": "Successfully retrieved move task order", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": { + "patch": { + "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "operationId": "updateMTOReviewedBillableWeightsAt", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order billableWeightsReviewedAt field", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/entitlements": { + "get": { + "description": "Gets entitlements", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Gets entitlements for a move by ID", + "operationId": "getEntitlements", + "responses": { + "200": { + "description": "Successfully retrieved entitlements", + "schema": { + "$ref": "#/definitions/Entitlements" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status": { + "patch": { + "description": "Changes the status of a line item for a move by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentServiceItem" + ], + "summary": "Change the status of a payment service item for a move by ID", + "operationId": "updatePaymentServiceItemStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated status for a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.paymentServiceItemStatus" + ] + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of payment service item to use", + "name": "paymentServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": { + "get": { + "description": "Gets a line item by ID for a move by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Gets a line item by ID for a move by ID", + "operationId": "getMTOServiceItem", + "responses": { + "200": { + "description": "Successfully retrieved a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/MTOServiceItemSingle" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of line item to use", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": { + "patch": { + "description": "Changes the status of a line item for a move by ID", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Change the status of a line item for a move by ID", + "operationId": "updateMTOServiceItemStatus", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchMTOServiceItemStatusPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated status for a line item for a move task order by ID", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.MTOServiceItem" + ] + }, + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "ID of line item to use", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/status": { + "patch": { + "description": "Changes move task order status to make it available to prime", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Change the status of a move task order to make it available to prime", + "operationId": "updateMoveTaskOrderStatus", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "serviceItemCodes", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOApprovalServiceItemCodes" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order status", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.move", + "create.serviceItem" + ] + } + }, + "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": { + "patch": { + "description": "Changes move (move task order) status to service counseling completed", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Changes move (move task order) status to service counseling completed", + "operationId": "updateMTOStatusServiceCounselingCompleted", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order status", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/tio-remarks": { + "patch": { + "description": "Changes move (move task order) billableWeightsReviewedAt field to a timestamp", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "operationId": "updateMoveTIORemarks", + "parameters": [ + { + "type": "string", + "description": "ID of move to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Move" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order tioRemarks field", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move/{locator}": { + "get": { + "description": "Returns a given move for a unique alphanumeric locator string", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns a given move", + "operationId": "getMove", + "responses": { + "200": { + "description": "Successfully retrieved the individual move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "Code used to identify a move in the system", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/move/{locator}/history": { + "get": { + "description": "Returns the history for a given move for a unique alphanumeric locator string", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns the history of an identified move", + "operationId": "getMoveHistory", + "parameters": [ + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved the individual move history", + "schema": { + "$ref": "#/definitions/MoveHistoryResult" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "Code used to identify a move in the system", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_service_items": { + "get": { + "description": "Gets all line items for a move", + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Gets all line items for a move", + "operationId": "listMTOServiceItems", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/MTOServiceItems" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move for mto service item to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments": { + "get": { + "description": "Gets all shipments for a move task order", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Gets all shipments for a move task order", + "operationId": "listMTOShipments", + "responses": { + "200": { + "description": "Successfully retrieved all mto shipments for a move task order", + "schema": { + "$ref": "#/definitions/MTOShipments" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": { + "patch": { + "description": "Updates a specified MTO shipment.\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* No fields required in body\nOptional fields include:\n* New shipment status type\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Secondary Pick-up Address\n* SecondaryDelivery Address\n* Delivery Address Type\n* Customer Remarks\n* Counselor Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the MTO Shipment to update", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the specified MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": { + "get": { + "description": "Fetches a list of agents associated with a move task order.", + "produces": [ + "application/json" + ], + "tags": [ + "mtoAgent" + ], + "summary": "Fetch move task order agents.", + "operationId": "fetchMTOAgentList", + "responses": { + "200": { + "description": "Successfully retrieved all agents for a move task order", + "schema": { + "$ref": "#/definitions/MTOAgents" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/moves/search": { + "post": { + "description": "Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Search moves by locator, DOD ID, or customer name", + "operationId": "searchMoves", + "parameters": [ + { + "description": "field that results should be sorted by", + "name": "body", + "in": "body", + "schema": { + "properties": { + "branch": { + "type": "string", + "x-nullable": true + }, + "customerName": { + "description": "Customer Name", + "type": "string", + "minLength": 1, + "x-nullable": true + }, + "deliveryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "destinationPostalCode": { + "type": "string", + "x-nullable": true + }, + "edipi": { + "description": "DOD ID", + "type": "string", + "maxLength": 10, + "minLength": 10, + "x-nullable": true + }, + "emplid": { + "description": "EMPLID", + "type": "string", + "maxLength": 7, + "minLength": 7, + "x-nullable": true + }, + "locator": { + "description": "Move locator", + "type": "string", + "maxLength": 6, + "minLength": 6, + "x-nullable": true + }, + "order": { + "type": "string", + "enum": [ + "asc", + "desc" + ], + "x-nullable": true + }, + "originPostalCode": { + "type": "string", + "x-nullable": true + }, + "page": { + "description": "requested page of results", + "type": "integer" + }, + "paymentRequestCode": { + "type": "string", + "x-nullable": true, + "example": "9551-6199-2" + }, + "perPage": { + "type": "integer" + }, + "pickupDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer", + "x-nullable": true + }, + "sort": { + "type": "string", + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "originPostalCode", + "destinationPostalCode", + "shipmentsCount" + ], + "x-nullable": true + }, + "status": { + "description": "Filtering for the status.", + "type": "array", + "uniqueItems": true, + "items": { + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVALS REQUESTED", + "APPROVED", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED", + "CANCELED" + ] + } + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/SearchMovesResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/moves/{locator}/closeout-office": { + "patch": { + "description": "Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Updates a Move's PPM closeout office for Army and Air Force customers", + "operationId": "updateCloseoutOffice", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "closeoutOfficeId" + ], + "properties": { + "closeoutOfficeId": { + "type": "string", + "format": "uuid" + } + } + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully set the closeout office for the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.closeoutOffice" + ] + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/customer-support-remarks": { + "get": { + "description": "Fetches customer support remarks for a move", + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Fetches customer support remarks using the move code (locator).", + "operationId": "getCustomerSupportRemarksForMove", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/CustomerSupportRemarks" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "post": { + "description": "Creates a customer support remark for a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "customerSupportRemarks" + ], + "summary": "Creates a customer support remark for a move", + "operationId": "createCustomerSupportRemarkForMove", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateCustomerSupportRemark" + } + } + ], + "responses": { + "200": { + "description": "Successfully created customer support remark", + "schema": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move for customer support remarks", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/evaluation-reports": { + "post": { + "description": "Creates an evaluation report", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "evaluationReports" + ], + "summary": "Creates an evaluation report", + "operationId": "createEvaluationReport", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateEvaluationReport" + } + } + ], + "responses": { + "200": { + "description": "Successfully created evaluation report", + "schema": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.evaluationReport" + ] + }, + "parameters": [ + { + "type": "string", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{locator}/payment-requests": { + "get": { + "description": "Fetches payment requests for a move", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Fetches payment requests using the move code (locator).", + "operationId": "getPaymentRequestsForMove", + "responses": { + "200": { + "description": "Successfully retrieved all line items for a move task order", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "read.paymentRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "string", + "description": "move code to identify a move for payment requests", + "name": "locator", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/assignOfficeUser": { + "patch": { + "description": "assigns either a services counselor, task ordering officer, or task invoicing officer to the move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "updateAssignedOfficeUser", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AssignOfficeUserBody" + } + } + ], + "responses": { + "200": { + "description": "Successfully assigned office user to the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/cancel": { + "post": { + "description": "cancels a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Cancels a move", + "operationId": "moveCanceler", + "responses": { + "200": { + "description": "Successfully canceled move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.cancelMoveFlag" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/counseling-evaluation-reports-list": { + "get": { + "description": "Returns counseling evaluation reports for the specified move that are visible to the current office user", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns counseling evaluation reports for the specified move that are visible to the current office user", + "operationId": "getMoveCounselingEvaluationReportsList", + "responses": { + "200": { + "description": "Successfully retrieved the move's evaluation reports", + "schema": { + "$ref": "#/definitions/EvaluationReportList" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Code used to identify a move in the system", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/financial-review-flag": { + "post": { + "description": "This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Flags a move for financial office review", + "operationId": "setFinancialReviewFlag", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header" + }, + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "flagForReview" + ], + "properties": { + "flagForReview": { + "description": "boolean value representing whether we should flag a move for financial review", + "type": "boolean", + "example": false + }, + "remarks": { + "description": "explanation of why the move is being flagged for financial review", + "type": "string", + "x-nullable": true, + "example": "this address is way too far away" + } + } + } + } + ], + "responses": { + "200": { + "description": "updated Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.financialReviewFlag" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move to flag", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/shipment-evaluation-reports-list": { + "get": { + "description": "Returns shipment evaluation reports for the specified move that are visible to the current office user", + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "summary": "Returns shipment evaluation reports for the specified move that are visible to the current office user", + "operationId": "getMoveShipmentEvaluationReportsList", + "responses": { + "200": { + "description": "Successfully retrieved the move's evaluation reports", + "schema": { + "$ref": "#/definitions/EvaluationReportList" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Code used to identify a move in the system", + "name": "moveID", + "in": "path", + "required": true + } + ] + }, + "/moves/{moveID}/unassignOfficeUser": { + "patch": { + "description": "unassigns either a services counselor, task ordering officer, or task invoicing officer from the move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "deleteAssignedOfficeUser", + "responses": { + "200": { + "description": "Successfully unassigned office user from the move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move", + "name": "moveID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "required": [ + "roleType" + ], + "properties": { + "roleType": { + "type": "string" + } + } + } + } + ] + }, + "/moves/{moveID}/uploadAdditionalDocuments": { + "patch": { + "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "move" + ], + "summary": "Patch the additional documents for a given move", + "operationId": "uploadAdditionalDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "moveID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + }, + "x-permissions": [ + "create.supportingDocuments" + ] + } + }, + "/moves/{officeUserID}/CheckForLockedMovesAndUnlock": { + "patch": { + "description": "Finds and unlocks any locked moves by an office user", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "move" + ], + "operationId": "checkForLockedMovesAndUnlock", + "responses": { + "200": { + "description": "Successfully unlocked officer's move(s).", + "schema": { + "type": "object", + "properties": { + "successMessage": { + "type": "string", + "example": "OK" + } + } + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the move's officer", + "name": "officeUserID", + "in": "path", + "required": true + } + ] + }, + "/mto-shipments": { + "post": { + "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Releasing / Receiving agents\nOptional fields include:\n* Delivery Address Type\n* Customer Remarks\n* Releasing / Receiving agents\n* An array of optional accessorial service item codes\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/open/requested-office-users": { + "post": { + "description": "This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account.\nRequest the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an \"OR\" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "officeUsers" + ], + "summary": "Create an Office User", + "operationId": "createRequestedOfficeUser", + "parameters": [ + { + "description": "Office User information", + "name": "officeUser", + "in": "body", + "schema": { + "$ref": "#/definitions/OfficeUserCreate" + } + } + ], + "responses": { + "201": { + "description": "successfully requested the creation of provided office user", + "schema": { + "$ref": "#/definitions/OfficeUser" + } + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/open/transportation-offices": { + "get": { + "description": "This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query.", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOfficesOpen", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrder", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateOrders" + } + } + ], + "responses": { + "200": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{orderID}": { + "get": { + "description": "Gets an order", + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Gets an order by ID", + "operationId": "getOrder", + "responses": { + "200": { + "description": "Successfully retrieved order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an order", + "operationId": "updateOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOrderPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.orders" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/acknowledge-excess-weight-risk": { + "post": { + "description": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert", + "operationId": "acknowledgeExcessWeightRisk", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated Move", + "schema": { + "$ref": "#/definitions/Move" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.excessWeightRisk" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/allowances": { + "patch": { + "description": "All fields sent in this request will be set on the order referenced", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates an allowance (Orders with Entitlements)", + "operationId": "updateAllowance", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateAllowancePayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of allowance", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.allowances" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/update-billable-weight": { + "patch": { + "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements=", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates the max billable weight", + "operationId": "updateBillableWeight", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateBillableWeightPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated Order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.billableWeight" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/update-max-billable-weight/tio": { + "patch": { + "description": "Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "order" + ], + "summary": "Updates the max billable weight with TIO remarks", + "operationId": "updateMaxBillableWeightAsTIO", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMaxBillableWeightAsTIOPayload" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated Order", + "schema": { + "$ref": "#/definitions/Order" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.maxBillableWeight" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of order to use", + "name": "orderID", + "in": "path", + "required": true + } + ] + }, + "/orders/{orderID}/upload_amended_orders": { + "post": { + "description": "Create an amended order for a given order", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "order" + ], + "summary": "Create an amended order for a given order", + "operationId": "uploadAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "orderID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/payment-requests/{paymentRequestID}": { + "get": { + "description": "Fetches an instance of a payment request by id", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Fetches a payment request by id", + "operationId": "getPaymentRequest", + "responses": { + "200": { + "description": "fetched instance of payment request", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "read.paymentRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/bulkDownload": { + "get": { + "description": "This endpoint downloads all uploaded payment request documentation combined into a single PDF.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Downloads all Payment Request documents as a PDF", + "operationId": "bulkDownload", + "responses": { + "200": { + "description": "Payment Request Files PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the payment-request with files to be downloaded", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": { + "get": { + "description": "Returns all shipment payment request SIT usage to support partial SIT invoicing", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Returns all shipment payment request SIT usage to support partial SIT invoicing", + "operationId": "getShipmentsPaymentSITBalance", + "responses": { + "200": { + "description": "Successfully retrieved shipments and their SIT days balance from all payment requests on the move", + "schema": { + "$ref": "#/definitions/ShipmentsPaymentSITBalance" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "read.shipmentsPaymentSITBalance" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "payment request ID of the payment request with SIT service items being reviewed", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/status": { + "patch": { + "description": "Updates status of a payment request by id", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequests" + ], + "summary": "Updates status of a payment request by id", + "operationId": "updatePaymentRequestStatus", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request", + "name": "paymentRequestID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePaymentRequestStatusPayload" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "updated payment request", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.paymentRequest" + ] + } + }, + "/ppm-shipments/{ppmShipmentId}/actual-weight": { + "get": { + "description": "Retrieves the actual weight for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the actual weight for a PPM shipment", + "operationId": "getPPMActualWeight", + "responses": { + "200": { + "description": "Returns actual weight for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMActualWeight" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/aoa-packet": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Downloads AOA Packet form PPMShipment as a PDF", + "operationId": "showAOAPacket", + "responses": { + "200": { + "description": "AOA PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the ppmshipment with aoa to be downloaded", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/closeout": { + "get": { + "description": "Retrieves the closeout calculations for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the closeout calcuations for the specified PPM shipment", + "operationId": "getPPMCloseout", + "responses": { + "200": { + "description": "Returns closeout for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMCloseout" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/finish-document-review": { + "patch": { + "description": "Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a PPM shipment's status after document review", + "operationId": "finishDocumentReview", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully finished document review", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { + "patch": { + "description": "Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are\neditable because some have to be set by the customer, e.g. the description and the moving expense type.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates the moving expense", + "operationId": "updateMovingExpense", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "updateMovingExpense", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMovingExpense" + } + } + ], + "responses": { + "200": { + "description": "returns an updated moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/payment-packet": { + "get": { + "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Returns PPM payment packet", + "operationId": "showPaymentPacket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppmShipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "PPM Payment Packet PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "ppm not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/ppm-sit": { + "patch": { + "description": "Updates a PPM shipment's SIT values\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a PPM shipment's SIT values", + "operationId": "updatePPMSIT", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/PPMShipmentSIT" + } + } + ], + "responses": { + "200": { + "description": "Successfully finished PPM SIT update", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { + "patch": { + "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a pro-gear weight ticket", + "operationId": "updateProGearWeightTicket", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "updateProGearWeightTicket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateProGearWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost": { + "get": { + "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Get the SIT estimated cost for a PPM shipment", + "operationId": "getPPMSITEstimatedCost", + "responses": { + "200": { + "description": "Calculates and returns the SIT estimated cost for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMSITEstimatedCost" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "enum": [ + "ORIGIN", + "DESTINATION" + ], + "type": "string", + "format": "string", + "description": "location of sit", + "name": "sitLocation", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "Date entered into SIT", + "name": "sitEntryDate", + "in": "query", + "required": true + }, + { + "type": "string", + "format": "date-time", + "description": "Date departed SIT", + "name": "sitDepartureDate", + "in": "query", + "required": true + }, + { + "minimum": 0, + "type": "integer", + "description": "Weight stored in SIT", + "name": "weightStored", + "in": "query", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { + "patch": { + "description": "Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's\nfields are editable because some have to be set by the customer, e.g. vehicle description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a weight ticket document", + "operationId": "updateWeightTicket", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "updateWeightTicketPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + } + ] + }, + "/pws-violations": { + "get": { + "description": "Fetch the possible PWS violations for an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "pwsViolations" + ], + "summary": "Fetch the possible PWS violations for an evaluation report", + "operationId": "getPWSViolations", + "responses": { + "200": { + "description": "Successfully retrieved the PWS violations", + "schema": { + "$ref": "#/definitions/PWSViolations" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/bulk-assignment": { + "get": { + "description": "Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets data for bulk assignment modal", + "operationId": "getBulkAssignmentData", + "parameters": [ + { + "enum": [ + "COUNSELING", + "CLOSEOUT", + "TASK_ORDER", + "PAYMENT_REQUEST" + ], + "type": "string", + "description": "A string corresponding to the queue type", + "name": "queueType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned bulk assignment data", + "schema": { + "$ref": "#/definitions/BulkAssignmentData" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/counseling": { + "get": { + "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all customer moves needing services counseling by GBLOC origin", + "operationId": "getServicesCounselingQueue", + "parameters": [ + { + "type": "integer", + "description": "requested page number of paginated move results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "maximum number of moves to show on each page of paginated results", + "name": "perPage", + "in": "query" + }, + { + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "requestedMoveDate", + "submittedAt", + "originGBLOC", + "originDutyLocation", + "destinationDutyLocation", + "ppmType", + "closeoutInitiated", + "closeoutLocation", + "ppmStatus", + "counselingOffice", + "assignedTo" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "string", + "description": "filters by the branch of the move's service member", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique move code locator", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "description": "filters using a prefix match on the service member's last name", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique service member's DoD ID", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "description": "filters to match the unique service member's EMPLID", + "name": "emplid", + "in": "query" + }, + { + "type": "string", + "description": "filters the requested pickup date of a shipment on the move", + "name": "requestedMoveDate", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Start of the submitted at date in the user's local time zone converted to UTC", + "name": "submittedAt", + "in": "query" + }, + { + "type": "string", + "description": "filters the GBLOC of the service member's origin duty location", + "name": "originGBLOC", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "description": "filters the name of the origin duty location on the orders", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "description": "filters the name of the destination duty location on the orders", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED" + ], + "type": "string" + }, + "description": "filters the status of the move", + "name": "status", + "in": "query" + }, + { + "type": "boolean", + "description": "Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves.", + "name": "needsPPMCloseout", + "in": "query" + }, + { + "enum": [ + "FULL", + "PARTIAL" + ], + "type": "string", + "description": "filters PPM type", + "name": "ppmType", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Latest date that closeout was initiated on a PPM on the move", + "name": "closeoutInitiated", + "in": "query" + }, + { + "type": "string", + "description": "closeout location", + "name": "closeoutLocation", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "enum": [ + "WAITING_ON_CUSTOMER", + "NEEDS_CLOSEOUT" + ], + "type": "string", + "description": "filters the status of the PPM shipment", + "name": "ppmStatus", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this payment request.\n", + "name": "assignedTo", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueueMovesResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/counseling/origin-list": { + "get": { + "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all moves origin locations in the counselors queue", + "operationId": "getServicesCounselingOriginList", + "parameters": [ + { + "type": "boolean", + "description": "Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations.", + "name": "needsPPMCloseout", + "in": "query" + }, + { + "type": "string", + "description": "Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.", + "name": "viewAsGBLOC", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/Locations" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/moves": { + "get": { + "description": "An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all customer moves by GBLOC origin", + "operationId": "getMovesQueue", + "parameters": [ + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + }, + { + "enum": [ + "customerName", + "edipi", + "emplid", + "branch", + "locator", + "status", + "originDutyLocation", + "destinationDutyLocation", + "requestedMoveDate", + "appearedInTooAt", + "assignedTo", + "counselingOffice" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "string", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "name": "emplid", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + }, + "collectionFormat": "multi", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "name": "appearedInTooAt", + "in": "query" + }, + { + "type": "string", + "description": "filters the requested pickup date of a shipment on the move", + "name": "requestedMoveDate", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "SUBMITTED", + "SERVICE COUNSELING COMPLETED", + "APPROVALS REQUESTED" + ], + "type": "string" + }, + "description": "Filtering for the status.", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this move.\n", + "name": "assignedTo", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueueMovesResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/payment-requests": { + "get": { + "description": "An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "Gets queued list of all payment requests by GBLOC origin", + "operationId": "getPaymentRequestsQueue", + "parameters": [ + { + "enum": [ + "customerName", + "locator", + "submittedAt", + "branch", + "status", + "edipi", + "emplid", + "age", + "originDutyLocation", + "assignedTo", + "counselingOffice" + ], + "type": "string", + "description": "field that results should be sorted by", + "name": "sort", + "in": "query" + }, + { + "enum": [ + "asc", + "desc" + ], + "type": "string", + "description": "direction of sort order if applied", + "name": "order", + "in": "query" + }, + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "number of records to include per page", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "format": "date-time", + "description": "Start of the submitted at date in the user's local time zone converted to UTC", + "name": "submittedAt", + "in": "query" + }, + { + "type": "string", + "name": "branch", + "in": "query" + }, + { + "type": "string", + "name": "locator", + "in": "query" + }, + { + "type": "string", + "name": "customerName", + "in": "query" + }, + { + "type": "string", + "name": "edipi", + "in": "query" + }, + { + "type": "string", + "name": "emplid", + "in": "query" + }, + { + "type": "string", + "name": "destinationDutyLocation", + "in": "query" + }, + { + "type": "string", + "name": "originDutyLocation", + "in": "query" + }, + { + "type": "string", + "description": "Used to illustrate which user is assigned to this payment request.\n", + "name": "assignedTo", + "in": "query" + }, + { + "type": "string", + "description": "filters using a counselingOffice name of the move", + "name": "counselingOffice", + "in": "query" + }, + { + "uniqueItems": true, + "type": "array", + "items": { + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "PAID", + "DEPRECATED", + "EDI_ERROR" + ], + "type": "string" + }, + "description": "Filtering for the status.", + "name": "status", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + }, + { + "type": "string", + "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", + "name": "viewAsGBLOC", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully returned all moves matching the criteria", + "schema": { + "$ref": "#/definitions/QueuePaymentRequestsResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/prime-moves": { + "get": { + "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", + "produces": [ + "application/json" + ], + "tags": [ + "queues" + ], + "summary": "getPrimeMovesQueue", + "operationId": "listPrimeMoves", + "parameters": [ + { + "type": "string", + "format": "date-time", + "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", + "name": "since", + "in": "query" + }, + { + "type": "integer", + "description": "requested page of results", + "name": "page", + "in": "query" + }, + { + "type": "integer", + "description": "results per page", + "name": "perPage", + "in": "query" + }, + { + "type": "string", + "name": "id", + "in": "query" + }, + { + "type": "string", + "name": "moveCode", + "in": "query" + }, + { + "type": "string", + "description": "order type", + "name": "orderType", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/ListPrimeMovesResult" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/re-service-items": { + "get": { + "description": "Get ReServiceItems", + "produces": [ + "application/json" + ], + "tags": [ + "reServiceItems" + ], + "summary": "Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved)", + "operationId": "getAllReServiceItems", + "responses": { + "200": { + "description": "Successfully retrieved all ReServiceItems.", + "schema": { + "$ref": "#/definitions/ReServiceItems" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/report-violations/{reportID}": { + "get": { + "description": "Fetch the report violations for an evaluation report", + "produces": [ + "application/json" + ], + "tags": [ + "reportViolations" + ], + "summary": "Fetch the report violations for an evaluation report", + "operationId": "getReportViolationsByReportID", + "responses": { + "200": { + "description": "Successfully retrieved the report violations", + "schema": { + "$ref": "#/definitions/ReportViolations" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "post": { + "description": "Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "reportViolations" + ], + "summary": "Associate violations with an evaluation report", + "operationId": "associateReportViolations", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/AssociateReportViolations" + } + } + ], + "responses": { + "204": { + "description": "Successfully saved the report violations" + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.reportViolation" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "the evaluation report ID that has associated violations", + "name": "reportID", + "in": "path", + "required": true + } + ] + }, + "/service-item/{mtoServiceItemID}/entry-date-update": { + "patch": { + "description": "Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "Updates a service item's SIT entry date by ID", + "operationId": "updateServiceItemSitEntryDate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ServiceItemSitEntryDate" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated SIT entry date", + "schema": { + "$ref": "#/definitions/MTOServiceItemSingle" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of the service item", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}": { + "get": { + "description": "fetches a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "fetches a shipment by ID", + "operationId": "getShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be fetched", + "name": "shipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully fetched the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "delete": { + "description": "Soft deletes a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Soft deletes a shipment by ID", + "operationId": "deleteShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be deleted", + "name": "shipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/shipments/{shipmentID}/approve": { + "post": { + "description": "Approves a shipment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves a shipment", + "operationId": "approveShipment", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/approve-diversion": { + "post": { + "description": "Approves a shipment diversion", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves a shipment diversion", + "operationId": "approveShipmentDiversion", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipment diversion", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.shipment" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/ppm-documents": { + "get": { + "description": "Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This\nexcludes any deleted PPM documents.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Gets all the PPM documents for a PPM shipment", + "operationId": "getPPMDocuments", + "responses": { + "200": { + "description": "All PPM documents and associated uploads for the specified PPM shipment.", + "schema": { + "$ref": "#/definitions/PPMDocuments" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/reject": { + "post": { + "description": "rejects a shipment", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "rejects a shipment", + "operationId": "rejectShipment", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RejectShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully rejected the shipment", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-cancellation": { + "post": { + "description": "Requests a shipment cancellation", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Requests a shipment cancellation", + "operationId": "requestShipmentCancellation", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully requested the shipment cancellation", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.shipmentCancellation" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-diversion": { + "post": { + "description": "Requests a shipment diversion", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Requests a shipment diversion", + "operationId": "requestShipmentDiversion", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/RequestDiversion" + } + } + ], + "responses": { + "200": { + "description": "Successfully requested the shipment diversion", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.shipmentDiversionRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/request-reweigh": { + "post": { + "description": "Requests a shipment reweigh", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "reweigh" + ], + "summary": "Requests a shipment reweigh", + "operationId": "requestShipmentReweigh", + "responses": { + "200": { + "description": "Successfully requested a reweigh of the shipment", + "schema": { + "$ref": "#/definitions/Reweigh" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.reweighRequest" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/review-shipment-address-update": { + "patch": { + "description": "This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Allows TOO to review a shipment address update", + "operationId": "reviewShipmentAddressUpdate", + "parameters": [ + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "required": [ + "officeRemarks", + "status" + ], + "properties": { + "officeRemarks": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "REJECTED", + "APPROVED" + ] + } + } + } + } + ], + "responses": { + "200": { + "description": "Successfully requested a shipment address update", + "schema": { + "$ref": "#/definitions/ShipmentAddressUpdate" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-extensions": { + "post": { + "description": "TOO can creates an already-approved SIT Duration Update on behalf of a customer", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Create an approved SIT Duration Update", + "operationId": "createApprovedSITDurationUpdate", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateApprovedSITDurationUpdate" + } + }, + { + "type": "string", + "description": "We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully created a SIT Extension.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "create.SITExtension" + ] + } + }, + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": { + "patch": { + "description": "Approves a SIT extension", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Approves a SIT extension", + "operationId": "approveSITExtension", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApproveSITExtension" + } + }, + { + "type": "string", + "description": "We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully approved a SIT extension", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.SITExtension" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the SIT extension", + "name": "sitExtensionID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": { + "patch": { + "description": "Denies a SIT extension", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "sitExtension" + ], + "summary": "Denies a SIT extension", + "operationId": "denySITExtension", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/DenySITExtension" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully denied a SIT extension", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.SITExtension" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the SIT extension", + "name": "sitExtensionID", + "in": "path", + "required": true + } + ] + }, + "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": { + "patch": { + "description": "Converts a SIT to customer expense", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment", + "mtoServiceItem" + ], + "summary": "Converts a SIT to customer expense", + "operationId": "updateSITServiceItemCustomerExpense", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateSITServiceItemCustomerExpense" + } + }, + { + "type": "string", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully converted to customer expense", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.MTOServiceItem" + ] + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment", + "name": "shipmentID", + "in": "path", + "required": true + } + ] + }, + "/tac/valid": { + "get": { + "description": "Returns a boolean based on whether a tac value is valid or not", + "tags": [ + "tac", + "order" + ], + "summary": "Validation of a TAC value", + "operationId": "tacValidation", + "parameters": [ + { + "type": "string", + "description": "The tac value to validate", + "name": "tac", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved validation status", + "schema": { + "$ref": "#/definitions/TacValid" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/transportation-offices": { + "get": { + "description": "Returns the transportation offices matching the search query that is enabled for PPM closeout", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns the transportation offices matching the search query that is enabled for PPM closeout", + "operationId": "getTransportationOffices", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/transportation-offices/gblocs": { + "get": { + "description": "Returns a list of distinct GBLOCs that exist in the transportation offices table", + "produces": [ + "application/json" + ], + "tags": [ + "transportationOffice" + ], + "summary": "Returns a list of distinct GBLOCs that exist in the transportation offices table", + "operationId": "getTransportationOfficesGBLOCs", + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/GBLOCs" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future.", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/get/": { + "get": { + "description": "Gets an upload", + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Gets an upload by ID", + "operationId": "getUpload", + "responses": { + "200": { + "description": "Successfully retrieved upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "401": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/uploads/{uploadID}": { + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes an upload", + "operationId": "deleteUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be deleted", + "name": "uploadID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the order that the upload belongs to", + "name": "orderID", + "in": "query" + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadID}/update": { + "patch": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "uploads" + ], + "summary": "Update an existing upload. This is only needed currently for updating the image rotation.", + "operationId": "updateUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be updated", + "name": "uploadID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "properties": { + "rotation": { + "description": "The rotation of the image", + "type": "integer", + "maximum": 3, + "minimum": 0 + } + } + } + } + ], + "responses": { + "201": { + "description": "updated upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Affiliation": { + "description": "Military branch of service", + "type": "string", + "title": "Branch of service", + "enum": [ + "ARMY", + "NAVY", + "MARINES", + "AIR_FORCE", + "COAST_GUARD", + "SPACE_FORCE", + "OTHER" + ], + "x-display-value": { + "AIR_FORCE": "Air Force", + "ARMY": "Army", + "COAST_GUARD": "Coast Guard", + "MARINES": "Marine Corps", + "NAVY": "Navy", + "OTHER": "OTHER", + "SPACE_FORCE": "Space Force" + }, + "x-nullable": true + }, + "ApplicationParameters": { + "type": "object", + "properties": { + "parameterName": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "parameterValue": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "validationCode": { + "type": "string", + "format": "string", + "x-nullable": true + } + } + }, + "ApproveSITExtension": { + "required": [ + "approvedDays" + ], + "properties": { + "approvedDays": { + "description": "Number of days approved for SIT extension", + "type": "integer", + "minimum": 1, + "example": 21 + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT approval", + "type": "string", + "x-nullable": true, + "example": "Approved for three weeks rather than requested 45 days" + }, + "requestReason": { + "description": "Reason from service counselor-provided picklist for SIT Duration Update", + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ], + "example": "AWAITING_COMPLETION_OF_RESIDENCE" + } + } + }, + "AssignOfficeUserBody": { + "type": "object", + "required": [ + "officeUserId", + "roleType" + ], + "properties": { + "officeUserId": { + "type": "string", + "format": "uuid" + }, + "roleType": { + "type": "string" + } + } + }, + "AssignedOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "AssociateReportViolations": { + "description": "A list of PWS violation string ids to associate with an evaluation report", + "type": "object", + "properties": { + "violations": { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + } + } + }, + "AvailableOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "hasSafetyPrivilege": { + "type": "boolean" + }, + "lastName": { + "type": "string" + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "workload": { + "type": "integer" + } + } + }, + "AvailableOfficeUsers": { + "type": "array", + "items": { + "$ref": "#/definitions/AvailableOfficeUser" + } + }, + "BackupContact": { + "type": "object", + "required": [ + "name", + "email", + "phone" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "example": "backupContact@mail.com" + }, + "name": { + "type": "string" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + } + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "BulkAssignmentData": { + "type": "object", + "properties": { + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "bulkAssignmentMoveIDs": { + "$ref": "#/definitions/BulkAssignmentMoveIDs" + } + } + }, + "BulkAssignmentMoveID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "BulkAssignmentMoveIDs": { + "type": "array", + "items": { + "$ref": "#/definitions/BulkAssignmentMoveID" + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "Contractor": { + "properties": { + "contractNumber": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string" + }, + "type": { + "type": "string" + } + } + }, + "CounselingUpdateAllowancePayload": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, + "organizationalClothingAndIndividualEquipment": { + "description": "only for Army", + "type": "boolean", + "x-nullable": true + }, + "proGearWeight": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 2000, + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 500, + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "requiredMedicalEquipmentWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 0, + "x-formatting": "weight", + "example": 2000 + }, + "storageInTransit": { + "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", + "type": "integer", + "minimum": 0 + }, + "ubAllowance": { + "type": "integer", + "x-nullable": true, + "example": 500 + } + } + }, + "CounselingUpdateOrderPayload": { + "type": "object", + "required": [ + "issueDate", + "reportByDate", + "ordersType", + "originDutyLocationId", + "newDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ntsSac": { + "title": "NTS SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "title": "NTS TAC", + "maxLength": 4, + "minLength": 4, + "$ref": "#/definitions/NullableString", + "example": "F8J1" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "title": "HHG SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "tac": { + "type": "string", + "title": "HHG TAC", + "maxLength": 4, + "minLength": 4, + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreateAppeal": { + "description": "Appeal status and remarks left for a violation, created by a GSR user.", + "type": "object", + "properties": { + "appealStatus": { + "description": "The status of the appeal set by the GSR user", + "type": "string", + "enum": [ + "sustained", + "rejected" + ], + "example": "These are my violation appeal remarks" + }, + "remarks": { + "description": "Remarks left by the GSR user", + "type": "string", + "example": "These are my violation appeal remarks" + } + } + }, + "CreateApprovedSITDurationUpdate": { + "required": [ + "requestReason", + "approvedDays" + ], + "properties": { + "approvedDays": { + "description": "Number of days approved for SIT extension. This will match requested days saved to the SIT extension model.", + "type": "integer", + "example": 21 + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT Duration Update creation", + "type": "string", + "x-nullable": true, + "example": "Customer needs additional storage time as their new place of residence is not yet ready" + }, + "requestReason": { + "description": "Reason from service counselor-provided picklist for SIT Duration Update", + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ], + "example": "AWAITING_COMPLETION_OF_RESIDENCE" + } + } + }, + "CreateBoatShipment": { + "description": "Boat shipment information for the move.", + "required": [ + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateCustomerPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backupContact": { + "$ref": "#/definitions/BackupContact" + }, + "backupMailingAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "cacUser": { + "type": "boolean" + }, + "createOktaAccount": { + "type": "boolean" + }, + "edipi": { + "type": "string", + "maxLength": 10, + "x-nullable": false, + "example": "1234567890" + }, + "emailIsPreferred": { + "type": "boolean" + }, + "emplid": { + "type": "string", + "maxLength": 7, + "x-nullable": true, + "example": "9485155" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "middleName": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "personalEmail@email.com" + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "residentialAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "CreateCustomerSupportRemark": { + "description": "A text remark written by an customer support user that is associated with a specific move.", + "type": "object", + "required": [ + "content", + "officeUserID" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "CreateEvaluationReport": { + "description": "Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID.", + "type": "object", + "properties": { + "shipmentID": { + "description": "The shipment ID of the shipment to be evaluated in the report", + "type": "string", + "format": "uuid", + "example": "01b9671e-b268-4906-967b-ba661a1d3933" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "secondaryDeliveryAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "tertiaryDeliveryAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "usesExternalVendor": { + "type": "boolean", + "x-nullable": true, + "example": false + } + } + }, + "CreateMobileHomeShipment": { + "description": "A mobile home shipment that the prime moves for a service member.", + "required": [ + "make", + "model", + "year", + "lengthInInches", + "heightInInches", + "widthInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreateOrders": { + "type": "object", + "required": [ + "serviceMemberId", + "issueDate", + "reportByDate", + "ordersType", + "hasDependents", + "spouseHasProGear", + "newDutyLocationId" + ], + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "hasDependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "serviceMemberId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouseHasProGear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreatePPMShipment": { + "description": "A personally procured move is a type of shipment that a service members moves themselves.", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean" + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreatedCustomer": { + "type": "object", + "properties": { + "affiliation": { + "type": "string", + "title": "Branch of service customer is affilated with" + }, + "backupAddress": { + "$ref": "#/definitions/Address" + }, + "backupContact": { + "$ref": "#/definitions/BackupContact" + }, + "cacValidated": { + "type": "boolean" + }, + "edipi": { + "type": "string", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "middleName": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "oktaEmail": { + "type": "string" + }, + "oktaID": { + "type": "string" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "residentialAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Customer": { + "type": "object", + "properties": { + "agency": { + "type": "string", + "title": "Agency customer is affilated with" + }, + "backupAddress": { + "$ref": "#/definitions/Address" + }, + "backup_contact": { + "$ref": "#/definitions/BackupContact" + }, + "cacValidated": { + "type": "boolean", + "x-nullable": true + }, + "current_address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "first_name": { + "type": "string", + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "last_name": { + "type": "string", + "example": "Doe" + }, + "middle_name": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "CustomerContactType": { + "description": "Describes a customer contact type for a MTOServiceItem of type domestic destination SIT.", + "type": "string", + "enum": [ + "FIRST", + "SECOND" + ] + }, + "CustomerSupportRemark": { + "description": "A text remark written by an office user that is associated with a specific move.", + "type": "object", + "required": [ + "id", + "moveID", + "officeUserID", + "content" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeUserEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "readOnly": true + }, + "officeUserFirstName": { + "type": "string", + "readOnly": true, + "example": "Grace" + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeUserLastName": { + "type": "string", + "readOnly": true, + "example": "Griffin" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "CustomerSupportRemarks": { + "type": "array", + "items": { + "$ref": "#/definitions/CustomerSupportRemark" + } + }, + "DenySITExtension": { + "required": [ + "officeRemarks", + "convertToCustomerExpense" + ], + "properties": { + "convertToCustomerExpense": { + "description": "Whether or not to convert to members expense once SIT extension is denied.", + "type": "boolean", + "example": false + }, + "officeRemarks": { + "description": "Remarks from TOO about SIT denial", + "type": "string", + "x-nullable": true, + "example": "Denied this extension as it does not match the criteria" + } + } + }, + "DepartmentIndicator": { + "description": "Military branch of service indicator for orders", + "type": "string", + "title": "Department indicator", + "enum": [ + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "COAST_GUARD", + "NAVY_AND_MARINES", + "AIR_AND_SPACE_FORCE", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of Secretary of Defense" + }, + "x-nullable": true + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DimensionType": { + "description": "Describes a dimension type for a MTOServiceItemDimension.", + "type": "string", + "enum": [ + "ITEM", + "CRATE" + ] + }, + "Document": { + "type": "object", + "required": [ + "id", + "service_member_id", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "address_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "eTag": { + "type": "string" + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": true + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "x-nullable": true, + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "message" + ], + "properties": { + "message": { + "type": "string" + } + } + }, + "EvaluationReport": { + "description": "An evaluation report", + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string" + }, + "evalEnd": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "18:00" + }, + "evalStart": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "15:00" + }, + "gsrAppeals": { + "x-nullable": true, + "$ref": "#/definitions/GSRAppeals" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "inspectionDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "inspectionType": { + "x-nullable": true, + "$ref": "#/definitions/EvaluationReportInspectionType" + }, + "location": { + "x-nullable": true, + "$ref": "#/definitions/EvaluationReportLocation" + }, + "locationDescription": { + "type": "string", + "x-nullable": true, + "example": "Route 66 at crash inspection site 3" + }, + "moveID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveReferenceID": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "observedClaimsResponseDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupSpreadEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedPickupSpreadStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedShipmentDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "observedShipmentPhysicalPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "officeUser": { + "$ref": "#/definitions/EvaluationReportOfficeUser" + }, + "remarks": { + "type": "string", + "x-nullable": true + }, + "reportViolations": { + "x-nullable": true, + "$ref": "#/definitions/ReportViolations" + }, + "seriousIncident": { + "type": "boolean", + "x-nullable": true + }, + "seriousIncidentDesc": { + "type": "string", + "x-nullable": true + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "timeDepart": { + "type": "string", + "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$", + "x-nullable": true, + "example": "14:30" + }, + "type": { + "$ref": "#/definitions/EvaluationReportType" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "violationsObserved": { + "type": "boolean", + "x-nullable": true + } + } + }, + "EvaluationReportInspectionType": { + "type": "string", + "enum": [ + "DATA_REVIEW", + "PHYSICAL", + "VIRTUAL" + ], + "x-nullable": true + }, + "EvaluationReportList": { + "type": "array", + "items": { + "$ref": "#/definitions/EvaluationReport" + } + }, + "EvaluationReportLocation": { + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION", + "OTHER" + ], + "x-nullable": true + }, + "EvaluationReportOfficeUser": { + "description": "The authoring office user for an evaluation report", + "type": "object", + "properties": { + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + } + }, + "readOnly": true + }, + "EvaluationReportType": { + "type": "string", + "enum": [ + "SHIPMENT", + "COUNSELING" + ] + }, + "FetchLineOfAccountingPayload": { + "type": "object", + "properties": { + "departmentIndicator": { + "$ref": "#/definitions/DepartmentIndicator" + }, + "effectiveDate": { + "description": "The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find \"Active\" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request).\n", + "type": "string", + "format": "date", + "example": "2023-01-01" + }, + "tacCode": { + "type": "string", + "maxLength": 4, + "minLength": 4, + "example": "F8J1" + } + } + }, + "GBLOC": { + "type": "string", + "enum": [ + "AGFM", + "APAT", + "BGAC", + "BGNC", + "BKAS", + "CFMQ", + "CLPK", + "CNNQ", + "DMAT", + "GSAT", + "HAFC", + "HBAT", + "JEAT", + "JENQ", + "KKFA", + "LHNQ", + "LKNQ", + "MAPK", + "MAPS", + "MBFL", + "MLNQ", + "XXXX" + ] + }, + "GBLOCs": { + "type": "array", + "items": { + "type": "string" + } + }, + "GSRAppeal": { + "description": "An object associating appeals on violations and serious incidents", + "type": "object", + "properties": { + "appealStatus": { + "$ref": "#/definitions/GSRAppealStatusType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isSeriousIncident": { + "type": "boolean", + "example": false + }, + "officeUser": { + "$ref": "#/definitions/EvaluationReportOfficeUser" + }, + "officeUserID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "remarks": { + "type": "string", + "example": "Office user remarks" + }, + "reportID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "violationID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "GSRAppealStatusType": { + "type": "string", + "enum": [ + "SUSTAINED", + "REJECTED" + ] + }, + "GSRAppeals": { + "type": "array", + "items": { + "$ref": "#/definitions/GSRAppeal" + } + }, + "Grade": { + "type": "string", + "title": "grade", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ], + "x-display-value": { + "ACADEMY_CADET": "Service Academy Cadet", + "AVIATION_CADET": "Aviation Cadet", + "CIVILIAN_EMPLOYEE": "Civilian Employee", + "E_1": "E-1", + "E_2": "E-2", + "E_3": "E-3", + "E_4": "E-4", + "E_5": "E-5", + "E_6": "E-6", + "E_7": "E-7", + "E_8": "E-8", + "E_9": "E-9", + "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", + "MIDSHIPMAN": "Midshipman", + "O_10": "O-10", + "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", + "O_2": "O-2", + "O_3": "O-3", + "O_4": "O-4", + "O_5": "O-5", + "O_6": "O-6", + "O_7": "O-7", + "O_8": "O-8", + "O_9": "O-9", + "W_1": "W-1", + "W_2": "W-2", + "W_3": "W-3", + "W_4": "W-4", + "W_5": "W-5" + }, + "x-nullable": true + }, + "InvalidRequestResponsePayload": { + "type": "object", + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "IsDateWeekendHolidayInfo": { + "type": "object", + "required": [ + "country_code", + "country_name", + "date", + "is_weekend", + "is_holiday" + ], + "properties": { + "country_code": { + "type": "string" + }, + "country_name": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + }, + "details": { + "type": "string" + }, + "is_holiday": { + "type": "boolean" + }, + "is_weekend": { + "type": "boolean" + } + } + }, + "LOAType": { + "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", + "type": "string", + "enum": [ + "HHG", + "NTS" + ], + "example": "HHG" + }, + "LOATypeNullable": { + "description": "The Line of accounting (TAC/SAC) type that will be used for the shipment", + "type": "string", + "enum": [ + "HHG", + "NTS" + ], + "x-go-type": { + "import": { + "package": "github.com/transcom/mymove/pkg/swagger/nullable" + }, + "type": "String" + }, + "example": "HHG" + }, + "LineOfAccounting": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "example": "2023-08-03T19:17:10.050Z" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "06254fc3-b763-484c-b555-42855d1ad5cd" + }, + "loaActvtyID": { + "type": "string", + "maxLength": 11, + "x-nullable": true + }, + "loaAgncAcntngCd": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaAgncDsbrCd": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaAlltSnID": { + "type": "string", + "maxLength": 5, + "x-nullable": true, + "example": "123A" + }, + "loaBafID": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "1234" + }, + "loaBdgtAcntClsNm": { + "type": "string", + "maxLength": 8, + "x-nullable": true, + "example": "000000" + }, + "loaBetCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaBgFyTx": { + "type": "integer", + "x-nullable": true, + "example": 2006 + }, + "loaBgnDt": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2005-10-01" + }, + "loaBgtLnItmID": { + "type": "string", + "maxLength": 8, + "x-nullable": true + }, + "loaBgtRstrCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaBgtSubActCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaClsRefID": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaCstCd": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "loaCstCntrID": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "loaCustNm": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaDfAgncyAlctnRcpntID": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaDocID": { + "type": "string", + "maxLength": 15, + "x-nullable": true, + "example": "HHG12345678900" + }, + "loaDptID": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "1 " + }, + "loaDscTx": { + "type": "string", + "x-nullable": true, + "example": "PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER)" + }, + "loaDtlRmbsmtSrcID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaEndDt": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2015-10-01" + }, + "loaEndFyTx": { + "type": "integer", + "x-nullable": true, + "example": 2016 + }, + "loaFmsTrnsactnID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaFnclArID": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaFnctPrsNm": { + "type": "string", + "maxLength": 255, + "x-nullable": true + }, + "loaFndCntrID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaFndTyFgCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaHistStatCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaHsGdsCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "HT" + }, + "loaInstlAcntgActID": { + "type": "string", + "maxLength": 6, + "x-nullable": true, + "example": "12345" + }, + "loaJbOrdNm": { + "type": "string", + "maxLength": 10, + "x-nullable": true + }, + "loaLclInstlID": { + "type": "string", + "maxLength": 18, + "x-nullable": true + }, + "loaMajClmNm": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaMajRmbsmtSrcID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaObjClsID": { + "type": "string", + "maxLength": 6, + "x-nullable": true, + "example": "22NL" + }, + "loaOpAgncyID": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "1A" + }, + "loaPgmElmntID": { + "type": "string", + "maxLength": 12, + "x-nullable": true, + "example": "00000000" + }, + "loaPrjID": { + "type": "string", + "maxLength": 12, + "x-nullable": true + }, + "loaSbaltmtRcpntID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaScrtyCoopCustCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaScrtyCoopDsgntrCd": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaScrtyCoopImplAgncCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaScrtyCoopLnItmID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaSpclIntrID": { + "type": "string", + "maxLength": 2, + "x-nullable": true + }, + "loaSrvSrcID": { + "type": "string", + "maxLength": 1, + "x-nullable": true + }, + "loaStatCd": { + "type": "string", + "maxLength": 1, + "x-nullable": true, + "example": "U" + }, + "loaSubAcntID": { + "type": "string", + "maxLength": 3, + "x-nullable": true + }, + "loaSysId": { + "type": "string", + "maxLength": 20, + "x-nullable": true, + "example": "10003" + }, + "loaTnsfrDptNm": { + "type": "string", + "maxLength": 4, + "x-nullable": true + }, + "loaTrnsnID": { + "type": "string", + "maxLength": 3, + "x-nullable": true, + "example": "B1" + }, + "loaTrsySfxTx": { + "type": "string", + "maxLength": 4, + "x-nullable": true, + "example": "0000" + }, + "loaTskBdgtSblnTx": { + "type": "string", + "maxLength": 8, + "x-nullable": true + }, + "loaUic": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaWkCntrRcpntNm": { + "type": "string", + "maxLength": 6, + "x-nullable": true + }, + "loaWrkOrdID": { + "type": "string", + "maxLength": 16, + "x-nullable": true + }, + "orgGrpDfasCd": { + "type": "string", + "maxLength": 2, + "x-nullable": true, + "example": "ZZ" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "example": "2023-08-03T19:17:38.776Z" + }, + "validHhgProgramCodeForLoa": { + "type": "boolean", + "x-nullable": true + }, + "validLoaForTac": { + "type": "boolean", + "x-nullable": true + } + } + }, + "ListPrimeMove": { + "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "example": "AGFM" + }, + "destinationPostalCode": { + "type": "string", + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orderType": { + "type": "string" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ListPrimeMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/ListPrimeMove" + } + }, + "ListPrimeMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queueMoves": { + "$ref": "#/definitions/ListPrimeMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "Location": { + "type": "object", + "required": [ + "label", + "value" + ], + "properties": { + "label": { + "type": "string", + "example": "Label for display" + }, + "value": { + "type": "string", + "example": "Value for location" + } + } + }, + "Locations": { + "type": "array", + "items": { + "$ref": "#/definitions/Location" + } + }, + "LockedOfficeUser": { + "type": "object", + "properties": { + "firstName": { + "type": "string" + }, + "lastName": { + "type": "string" + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "type": "string", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ] + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOApprovalServiceItemCodes": { + "description": "MTO level service items to create when updating MTO status.", + "type": "object", + "properties": { + "serviceCodeCS": { + "type": "boolean", + "example": true + }, + "serviceCodeMS": { + "type": "boolean", + "example": true + } + } + }, + "MTOServiceItem": { + "type": "object", + "required": [ + "id", + "moveTaskOrderID", + "reServiceID", + "reServiceCode", + "reServiceName" + ], + "properties": { + "SITPostalCode": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "convertToCustomerExpense": { + "type": "boolean", + "x-omitempty": false, + "example": false + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "customerContacts": { + "$ref": "#/definitions/MTOServiceItemCustomerContacts" + }, + "customerExpenseReason": { + "type": "string", + "x-nullable": true + }, + "deletedAt": { + "type": "string", + "format": "date" + }, + "description": { + "type": "string", + "x-nullable": true + }, + "dimensions": { + "$ref": "#/definitions/MTOServiceItemDimensions" + }, + "eTag": { + "type": "string" + }, + "estimatedPrice": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "estimatedWeight": { + "description": "estimated weight of the shuttle service item provided by the prime", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "feeType": { + "type": "string", + "enum": [ + "COUNSELING", + "CRATING", + "TRUCKING", + "SHUTTLE" + ] + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "x-nullable": true, + "example": "CONUS" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupPostalCode": { + "type": "string", + "x-nullable": true + }, + "quantity": { + "type": "integer" + }, + "rate": { + "type": "integer" + }, + "reServiceCode": { + "type": "string" + }, + "reServiceID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "type": "string" + }, + "reason": { + "type": "string", + "x-nullable": true + }, + "rejectedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDeliveryMiles": { + "type": "integer", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitDestinationOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitOriginHHGActualAddress": { + "$ref": "#/definitions/Address" + }, + "sitOriginHHGOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + }, + "submittedAt": { + "type": "string", + "format": "date" + }, + "total": { + "type": "integer", + "format": "cents" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MTOServiceItemCustomerContact": { + "description": "Customer contact information for a destination SIT service item", + "type": "object", + "properties": { + "dateOfContact": { + "description": "Date of attempted contact by the prime.", + "type": "string", + "format": "date" + }, + "firstAvailableDeliveryDate": { + "description": "First available date that the Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "example": "2020-12-31" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "timeMilitary": { + "description": "Time of attempted contact by the prime.", + "type": "string", + "example": "0400Z" + }, + "type": { + "$ref": "#/definitions/CustomerContactType" + } + } + }, + "MTOServiceItemCustomerContacts": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItemCustomerContact" + } + }, + "MTOServiceItemDimension": { + "description": "Describes a dimension object for the MTOServiceItem.", + "type": "object", + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "type": { + "$ref": "#/definitions/DimensionType" + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItemDimension" + } + }, + "MTOServiceItemSingle": { + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "convertToCustomerExpense": { + "type": "boolean", + "x-omitempty": false, + "example": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerExpenseReason": { + "type": "string", + "x-nullable": true + }, + "deletedAt": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupPostalCode": { + "type": "string", + "x-nullable": true + }, + "reServiceCode": { + "type": "string" + }, + "reServiceID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "type": "string" + }, + "rejectedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "status": { + "type": "string", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOServiceItemStatus": { + "description": "Describes all statuses for a MTOServiceItem", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + }, + "MTOServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "MTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The actual date that the shipment was delivered to the delivery address by the Prime", + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "approvedDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "billableWeightCap": { + "description": "TIO override billable weight to be used for calculations", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "billableWeightJustification": { + "type": "string", + "x-nullable": true, + "example": "more weight than expected" + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "calculatedBillableWeight": { + "type": "integer", + "x-nullable": true, + "readOnly": true, + "example": 2000 + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "destinationSitAuthEndDate": { + "type": "string", + "format": "date-time" + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "distance": { + "type": "integer", + "x-nullable": true, + "example": 500 + }, + "diversion": { + "type": "boolean", + "example": true + }, + "diversionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment needs rerouted" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoAgents": { + "$ref": "#/definitions/MTOAgents" + }, + "mtoServiceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "originSitAuthEndDate": { + "type": "string", + "format": "date-time" + }, + "pickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "primeEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment not good enough" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requiredDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "reweigh": { + "x-nullable": true, + "x-omitempty": true, + "$ref": "#/definitions/Reweigh" + }, + "sacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "scheduledDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "scheduledPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDeliveryAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitDaysAllowance": { + "type": "integer", + "x-nullable": true + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "sitStatus": { + "$ref": "#/definitions/SITStatus" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "allOf": [ + { + "$ref": "#/definitions/LOAType" + }, + { + "x-nullable": true + } + ] + }, + "tertiaryDeliveryAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + }, + "usesExternalVendor": { + "type": "boolean", + "example": false + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "title": "Shipment Status", + "enum": [ + "SUBMITTED", + "REJECTED", + "APPROVED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "example": "SUBMITTED" + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "Move": { + "properties": { + "SCAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "TIOAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "TOOAssignedUser": { + "$ref": "#/definitions/AssignedOfficeUser" + }, + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "approvalsRequestedAt": { + "description": "The time at which a move is sent back to the TOO becuase the prime added a new service item for approval", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "billableWeightsReviewedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "closeoutOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "closeoutOfficeId": { + "description": "The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members", + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "contractor": { + "$ref": "#/definitions/Contractor" + }, + "contractorId": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "excess_weight_acknowledged_at": { + "description": "Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "excess_weight_qualified_at": { + "description": "Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "financialReviewFlag": { + "description": "This flag is set by office users if a move should be reviewed by a Financial Office", + "type": "boolean", + "x-nullable": false, + "readOnly": true, + "example": false + }, + "financialReviewRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "Delivery Address is too far from duty location" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "type": "string", + "example": "1K43AR" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUser": { + "x-nullable": true, + "$ref": "#/definitions/LockedOfficeUser" + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orders": { + "$ref": "#/definitions/Order" + }, + "ordersId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "referenceId": { + "type": "string", + "x-nullable": true, + "example": "1001-3456" + }, + "serviceCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "shipmentGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "tioRemarks": { + "type": "string", + "x-nullable": true, + "example": "approved additional weight" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveAuditHistories": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveAuditHistory" + } + }, + "MoveAuditHistory": { + "properties": { + "action": { + "description": "Action type; I = insert, D = delete, U = update, T = truncate", + "type": "string" + }, + "actionTstampClk": { + "description": "Wall clock time at which audited event's trigger call occurred", + "type": "string", + "format": "date-time" + }, + "actionTstampStm": { + "description": "Statement start timestamp for tx in which audited event occurred", + "type": "string", + "format": "date-time" + }, + "actionTstampTx": { + "description": "Transaction start timestamp for tx in which audited event occurred", + "type": "string", + "format": "date-time" + }, + "changedValues": { + "description": "A list of (changed/updated) MoveAuditHistoryItem's for a record after the change.", + "type": "object", + "additionalProperties": true, + "x-nullable": true + }, + "context": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "x-nullable": true + }, + "contextId": { + "description": "id column for the context table the record belongs to", + "type": "string", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "eventName": { + "description": "API endpoint name that was called to make the change", + "type": "string", + "x-nullable": true + }, + "id": { + "description": "id from audity_history table", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "objectId": { + "description": "id column for the tableName where the data was changed", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "oldValues": { + "description": "A list of (old/previous) MoveAuditHistoryItem's for a record before the change.", + "type": "object", + "additionalProperties": true, + "x-nullable": true + }, + "relId": { + "description": "relation OID. Table OID (object identifier). Changes with drop/create.", + "type": "integer" + }, + "schemaName": { + "description": "Database schema audited table for this event is in", + "type": "string" + }, + "sessionUserEmail": { + "type": "string", + "x-nullable": true, + "example": "foobar@example.com" + }, + "sessionUserFirstName": { + "type": "string", + "x-nullable": true, + "example": "foo" + }, + "sessionUserId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sessionUserLastName": { + "type": "string", + "x-nullable": true, + "example": "bar" + }, + "sessionUserTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "statementOnly": { + "description": "true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW'", + "type": "boolean", + "example": false + }, + "tableName": { + "description": "name of database table that was changed", + "type": "string" + }, + "transactionId": { + "description": "Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx.", + "type": "integer", + "x-nullable": true + } + } + }, + "MoveAuditHistoryItem": { + "properties": { + "columnName": { + "type": "string" + }, + "columnValue": { + "type": "string" + } + } + }, + "MoveAuditHistoryItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveAuditHistoryItem" + } + }, + "MoveHistory": { + "properties": { + "historyRecords": { + "description": "A list of MoveAuditHistory's connected to the move.", + "$ref": "#/definitions/MoveAuditHistories" + }, + "id": { + "description": "move ID", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "description": "move locator", + "type": "string", + "example": "1K43AR" + }, + "referenceId": { + "description": "move referenceID", + "type": "string", + "x-nullable": true, + "example": "1001-3456" + } + } + }, + "MoveHistoryResult": { + "type": "object", + "properties": { + "historyRecords": { + "description": "A list of MoveAuditHistory's connected to the move.", + "$ref": "#/definitions/MoveAuditHistories" + }, + "id": { + "description": "move ID", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "description": "move locator", + "type": "string", + "example": "1K43AR" + }, + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "referenceId": { + "description": "move referenceID", + "type": "string", + "x-nullable": true, + "example": "1001-3456" + }, + "totalCount": { + "type": "integer" + } + } + }, + "MovePayload": { + "type": "object", + "required": [ + "id", + "orders_id", + "locator", + "created_at", + "updated_at", + "eTag" + ], + "properties": { + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + }, + "closeout_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "mto_shipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveStatus": { + "type": "string", + "enum": [ + "DRAFT", + "NEEDS SERVICE COUNSELING", + "SERVICE COUNSELING COMPLETED", + "SUBMITTED", + "APPROVALS REQUESTED", + "APPROVED", + "CANCELED" + ] + }, + "MoveTaskOrder": { + "description": "The Move (MoveTaskOrder)", + "type": "object", + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "createdAt": { + "type": "string", + "format": "date-time" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "destinationDutyLocation": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "eTag": { + "type": "string" + }, + "entitlements": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "locator": { + "type": "string", + "example": "1K43AR" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "originDutyLocation": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "requestedPickupDate": { + "type": "string", + "format": "date" + }, + "serviceCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "tioRemarks": { + "type": "string", + "x-nullable": true, + "example": "approved additional weight" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveTaskOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "MovingExpense": { + "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", + "type": "object", + "required": [ + "id", + "createdAt", + "updatedAt", + "ppmShipmentId", + "documentId", + "document" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp the moving expense object was initially created in the system (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "A brief description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "The Document object that contains all file uploads for this expense" + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The id of the Document that contains all file uploads for this expense", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "Unique primary identifier of the Moving Expense object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingReceipt": { + "description": "Indicates if the service member is missing the receipt with the proof of expense amount", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "paidWithGtcc": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The PPM Shipment id that this moving expense belongs to", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedAmount": { + "description": "Customer submitted total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedDescription": { + "description": "Customer submitted description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "submittedMovingExpenseType": { + "$ref": "#/definitions/SubmittedMovingExpenseType" + }, + "submittedSitEndDate": { + "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "submittedSitStartDate": { + "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "updatedAt": { + "description": "Timestamp when a property of this moving expense object was last modified (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "MovingExpenses": { + "description": "All moving expenses associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + }, + "x-omitempty": false + }, + "NullableString": { + "type": "string", + "x-go-type": { + "import": { + "package": "github.com/transcom/mymove/pkg/swagger/nullable" + }, + "type": "String" + } + }, + "OfficeUser": { + "type": "object", + "required": [ + "id", + "firstName", + "middleInitials", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "active", + "roles", + "edipi", + "otherUniqueId", + "rejectionReason", + "status", + "createdAt", + "updatedAt" + ], + "properties": { + "active": { + "type": "boolean" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "edipi": { + "type": "string" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$" + }, + "firstName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string" + }, + "middleInitials": { + "type": "string" + }, + "otherUniqueId": { + "type": "string" + }, + "rejectionReason": { + "type": "string" + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + } + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "REQUESTED", + "REJECTED" + ] + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$" + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeAssignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "userId": { + "type": "string", + "format": "uuid" + } + } + }, + "OfficeUserCreate": { + "type": "object", + "required": [ + "firstName", + "lastName", + "email", + "telephone", + "transportationOfficeId", + "roles" + ], + "properties": { + "edipi": { + "type": "string", + "title": "EDIPI", + "maxLength": 10, + "x-nullable": true, + "example": "1234567890" + }, + "email": { + "type": "string", + "title": "Email", + "x-nullable": false, + "example": "user@userdomain.com" + }, + "firstName": { + "type": "string", + "title": "First Name", + "x-nullable": false + }, + "lastName": { + "type": "string", + "title": "Last Name", + "x-nullable": false + }, + "middleInitials": { + "type": "string", + "title": "Middle Initials", + "x-nullable": true, + "example": "L." + }, + "otherUniqueId": { + "type": "string", + "title": "Office user identifier when EDIPI is not available", + "x-nullable": true + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/OfficeUserRole" + }, + "x-nullable": false + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": false, + "example": "212-555-5555" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "x-nullable": false, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OfficeUserRole": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "name", + "x-nullable": true, + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "title": "roleType", + "x-nullable": true, + "example": "task_ordering_officer" + } + } + }, + "OmittableMovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OmittablePPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + }, + "x-nullable": true, + "x-omitempty": false + }, + "Order": { + "type": "object", + "properties": { + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "amendedOrdersAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "date_issued": { + "type": "string", + "format": "date", + "example": "2020-01-01" + }, + "department_indicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "eTag": { + "type": "string" + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "first_name": { + "type": "string", + "readOnly": true, + "example": "John" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "last_name": { + "type": "string", + "readOnly": true, + "example": "Doe" + }, + "methodOfPayment": { + "type": "string" + }, + "moveCode": { + "type": "string", + "example": "H2XFJF" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "naics": { + "type": "string" + }, + "ntsSac": { + "type": "string", + "title": "NTS SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "type": "string", + "title": "NTS TAC", + "x-nullable": true, + "example": "F8J1" + }, + "order_number": { + "type": "string", + "x-nullable": true, + "example": "030-00362" + }, + "order_type": { + "$ref": "#/definitions/OrdersType" + }, + "order_type_detail": { + "x-nullable": true, + "$ref": "#/definitions/OrdersTypeDetail" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "packingAndShippingInstructions": { + "type": "string" + }, + "report_by_date": { + "type": "string", + "format": "date", + "example": "2020-01-01" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?", + "example": false + }, + "supplyAndServicesCostEstimate": { + "type": "string" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + }, + "uploadedAmendedOrderID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploaded_order_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OrderBody": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PPMActualWeight": { + "description": "The actual net weight of a single PPM shipment. Used during document review for PPM closeout.", + "required": [ + "actualWeight" + ], + "properties": { + "actualWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "PPMAdvanceStatus": { + "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", + "type": "string", + "title": "PPM Advance Status", + "enum": [ + "APPROVED", + "REJECTED", + "EDITED", + "RECEIVED", + "NOT_RECEIVED" + ], + "x-nullable": true + }, + "PPMCloseout": { + "description": "The calculations needed in the \"Review Documents\" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment.", + "required": [ + "id" + ], + "properties": { + "SITReimbursement": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "aoa": { + "description": "Advance Operating Allowance (AOA).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "ddp": { + "description": "The Domestic Destination Price (DDP).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "dop": { + "description": "The Domestic Origin Price (DOP).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "gcc": { + "description": "Government Constructive Cost (GCC)", + "type": "integer", + "format": "cents", + "title": "GCC", + "x-nullable": true, + "x-omitempty": false + }, + "grossIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "haulFSC": { + "description": "The linehaul/shorthaul Fuel Surcharge (FSC).", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "haulPrice": { + "description": "The price of the linehaul or shorthaul.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "haulType": { + "description": "The type of haul calculation used for this shipment (shorthaul or linehaul).", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "miles": { + "description": "The distance between the old address and the new address in miles.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false, + "example": 54 + }, + "packPrice": { + "description": "The full price of all packing/unpacking services.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "plannedMoveDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightCustomer": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightSpouse": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "remainingIncentive": { + "description": "The remaining reimbursement amount that is still owed to the customer.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "unpackPrice": { + "description": "The full price of all packing/unpacking services.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + } + }, + "PPMDocumentStatusReason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "PPMDocuments": { + "description": "All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses.", + "type": "object", + "properties": { + "MovingExpenses": { + "$ref": "#/definitions/MovingExpenses" + }, + "ProGearWeightTickets": { + "$ref": "#/definitions/ProGearWeightTickets" + }, + "WeightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true, + "x-omitempty": false + }, + "PPMSITEstimatedCost": { + "description": "The estimated cost of SIT for a single PPM shipment. Used during document review for PPM.", + "required": [ + "sitCost", + "priceFirstDaySIT", + "priceAdditionalDaySIT" + ], + "properties": { + "paramsAdditionalDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "numberDaysSIT": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "30" + }, + "priceRateOrFactor": { + "type": "string", + "example": "0.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "paramsFirstDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "priceRateOrFactor": { + "type": "string", + "example": "20.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "priceAdditionalDaySIT": { + "type": "integer", + "format": "cents", + "title": "Price of an additional day in SIT", + "example": 2000 + }, + "priceFirstDaySIT": { + "type": "integer", + "format": "cents", + "title": "Price of the first day in SIT", + "example": 2000 + }, + "sitCost": { + "type": "integer", + "example": 2000 + } + } + }, + "PPMSITEstimatedCostParamsAdditionalDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "numberDaysSIT": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "30" + }, + "priceRateOrFactor": { + "type": "string", + "example": "0.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "PPMSITEstimatedCostParamsFirstDaySIT": { + "type": "object", + "properties": { + "contractYearName": { + "type": "string", + "example": "Award Term 1" + }, + "escalationCompounded": { + "type": "string", + "example": "1.01" + }, + "isPeak": { + "type": "string", + "example": "true" + }, + "priceRateOrFactor": { + "type": "string", + "example": "20.53" + }, + "serviceAreaDestination": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + }, + "serviceAreaOrigin": { + "type": "string", + "x-nullable": true, + "x-omitempty": true, + "example": "252" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false, + "example": 4300 + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true + }, + "PPMShipmentSIT": { + "description": "SIT related items for a PPM shipment", + "required": [ + "sitLocation" + ], + "properties": { + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PPMStatus": { + "type": "string", + "enum": [ + "CANCELED", + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "COMPLETED" + ] + }, + "PWSViolation": { + "description": "A PWS violation for an evaluation report", + "type": "object", + "properties": { + "additionalDataElem": { + "type": "string", + "example": "QAE Observed Delivery Date" + }, + "category": { + "type": "string", + "example": "Pre-Move Services" + }, + "displayOrder": { + "type": "integer", + "example": 3 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isKpi": { + "type": "boolean", + "example": false + }, + "paragraphNumber": { + "type": "string", + "example": "1.2.3.4.5" + }, + "requirementStatement": { + "type": "string", + "example": "The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS." + }, + "requirementSummary": { + "type": "string", + "example": "Provide a single point of contact (POC)" + }, + "subCategory": { + "type": "string", + "example": "Weight Estimate" + }, + "title": { + "type": "string", + "example": "Customer Support" + } + }, + "readOnly": true + }, + "PWSViolations": { + "type": "array", + "items": { + "$ref": "#/definitions/PWSViolation" + } + }, + "PatchMTOServiceItemStatusPayload": { + "properties": { + "rejectionReason": { + "description": "Reason the service item was rejected", + "type": "string", + "x-nullable": true, + "example": "Insufficent details provided" + }, + "status": { + "description": "Describes all statuses for a MTOServiceItem", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + } + } + }, + "PaymentRequest": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "ediErrorCode": { + "description": "Reported code from syncada for the EDI error encountered", + "type": "string", + "x-nullable": true + }, + "ediErrorDescription": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true + }, + "ediErrorType": { + "description": "Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858.", + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrder": { + "$ref": "#/definitions/Move" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "receivedByGexAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "reviewedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sentToGexAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "serviceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + }, + "tppsInvoiceAmountPaidTotalMillicents": { + "type": "integer", + "format": "millients", + "title": "Total amount that TPPS paid for all service items on the payment request in millicents", + "x-nullable": true + }, + "tppsInvoiceSellerPaidDate": { + "type": "string", + "format": "date-time", + "title": "Date that TPPS paid HS for the payment request", + "x-nullable": true + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemCode": { + "type": "string", + "example": "DLH" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemName": { + "type": "string", + "example": "Move management" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoShipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + }, + "tppsInvoiceAmountPaidPerServiceItemMillicents": { + "type": "integer", + "format": "millicents", + "title": "Amount that TPPS paid for the individual service item in millicents", + "x-nullable": true + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "PostDocumentPayload": { + "type": "object", + "properties": { + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + } + } + }, + "ProGearWeightTicket": { + "description": "Pro-gear associated information and weight docs for a PPM shipment", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "documentId", + "document" + ], + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the pro-gear weight." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the pro-gear weight ticket.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedBelongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedHasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedWeight": { + "description": "Customer submitted weight of the pro-gear.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weight": { + "description": "Weight of the pro-gear.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + } + } + }, + "ProGearWeightTickets": { + "description": "All progear weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + }, + "x-omitempty": false + }, + "ProofOfServiceDoc": { + "properties": { + "isWeightTicket": { + "type": "boolean" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "QueueMove": { + "type": "object", + "properties": { + "appearedInTooAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "assignable": { + "type": "boolean" + }, + "assignedTo": { + "x-nullable": true, + "$ref": "#/definitions/AssignedOfficeUser" + }, + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "closeoutInitiated": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "closeoutLocation": { + "type": "string", + "x-nullable": true + }, + "counselingOffice": { + "type": "string", + "x-nullable": true + }, + "counselingOfficeID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUser": { + "x-nullable": true, + "$ref": "#/definitions/LockedOfficeUser" + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orderType": { + "type": "string", + "x-nullable": true + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "ppmStatus": { + "x-nullable": true, + "$ref": "#/definitions/PPMStatus" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ], + "x-nullable": true + }, + "requestedMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "QueueMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/QueueMove" + } + }, + "QueueMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queueMoves": { + "$ref": "#/definitions/QueueMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "QueuePaymentRequest": { + "type": "object", + "properties": { + "age": { + "description": "Days since the payment request has been requested. Decimal representation will allow more accurate sorting.", + "type": "number", + "format": "double" + }, + "assignable": { + "type": "boolean" + }, + "assignedTo": { + "x-nullable": true, + "$ref": "#/definitions/AssignedOfficeUser" + }, + "availableOfficeUsers": { + "$ref": "#/definitions/AvailableOfficeUsers" + }, + "counselingOffice": { + "type": "string", + "x-nullable": true + }, + "customer": { + "$ref": "#/definitions/Customer" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "moveID": { + "type": "string", + "format": "uuid" + }, + "orderType": { + "type": "string", + "x-nullable": true + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "status": { + "$ref": "#/definitions/QueuePaymentRequestStatus" + }, + "submittedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "QueuePaymentRequestStatus": { + "type": "string", + "title": "Queue Payment Request Status", + "enum": [ + "Payment requested", + "Reviewed", + "Rejected", + "Paid" + ] + }, + "QueuePaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/QueuePaymentRequest" + } + }, + "QueuePaymentRequestsResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "queuePaymentRequests": { + "$ref": "#/definitions/QueuePaymentRequests" + }, + "totalCount": { + "type": "integer" + } + } + }, + "ReServiceItem": { + "description": "A Service Item which ties an ReService, Market, and Shipment Type together", + "type": "object", + "properties": { + "isAutoApproved": { + "type": "boolean", + "example": true + }, + "marketCode": { + "type": "string", + "enum": [ + "i", + "d" + ], + "example": "i (International), d (Domestic)" + }, + "serviceCode": { + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DCRTSA", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSFSC", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSFSC", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICRT", + "ICRTSA", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSFSC", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOFSIT", + "IOPSIT", + "IOSFSC", + "IOSHUT", + "ISLH", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "PODFSC", + "POEFSC", + "UBP" + ], + "example": "UBP" + }, + "serviceName": { + "type": "string", + "example": "International UB, International Shipping \u0026 Linehaul" + }, + "shipmentType": { + "type": "string", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "example": "HHG, UNACCOMPANIED_BAGGAGE" + } + } + }, + "ReServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/ReServiceItem" + } + }, + "RejectShipment": { + "required": [ + "rejectionReason" + ], + "properties": { + "rejectionReason": { + "type": "string", + "example": "MTO Shipment not good enough" + } + } + }, + "ReportViolation": { + "description": "An object associating violations to evaluation reports", + "type": "object", + "properties": { + "gsrAppeals": { + "x-nullable": true, + "$ref": "#/definitions/GSRAppeals" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reportID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "violation": { + "$ref": "#/definitions/PWSViolation" + }, + "violationID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "ReportViolations": { + "type": "array", + "items": { + "$ref": "#/definitions/ReportViolation" + } + }, + "RequestDiversion": { + "required": [ + "diversionReason" + ], + "properties": { + "diversionReason": { + "type": "string", + "example": "Shipment route needs to change" + } + } + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the counselor" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "roleName", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleName": { + "type": "string", + "example": "Task Ordering Officer" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "SITServiceItemGrouping": { + "properties": { + "serviceItems": { + "$ref": "#/definitions/MTOServiceItems" + }, + "summary": { + "description": "Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\nThis is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items.\n", + "$ref": "#/definitions/SITSummary" + } + } + }, + "SITServiceItemGroupings": { + "description": "Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date.\n", + "type": "array", + "items": { + "$ref": "#/definitions/SITServiceItemGrouping" + } + }, + "SITStatus": { + "properties": { + "calculatedTotalDaysInSIT": { + "type": "integer", + "minimum": 0 + }, + "currentSIT": { + "type": "object", + "properties": { + "daysInSIT": { + "type": "integer", + "minimum": 0 + }, + "location": { + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "serviceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitAuthorizedEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + } + } + }, + "pastSITServiceItemGroupings": { + "description": "A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes.\n", + "$ref": "#/definitions/SITServiceItemGroupings" + }, + "totalDaysRemaining": { + "type": "integer", + "minimum": 0 + }, + "totalSITDaysUsed": { + "type": "integer", + "minimum": 0 + } + } + }, + "SITStatusCurrentSIT": { + "type": "object", + "properties": { + "daysInSIT": { + "type": "integer", + "minimum": 0 + }, + "location": { + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "serviceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitAuthorizedEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitCustomerContacted": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date", + "x-nullable": true + } + } + }, + "SITSummary": { + "properties": { + "daysInSIT": { + "type": "integer", + "minimum": 0 + }, + "firstDaySITServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "location": { + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "sitAuthorizedEndDate": { + "type": "string", + "format": "date-time" + }, + "sitCustomerContacted": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitDepartureDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "sitEntryDate": { + "type": "string", + "format": "date-time" + }, + "sitRequestedDelivery": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "SearchCustomer": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "edipi": { + "type": "string", + "x-nullable": true + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "lastName": { + "type": "string", + "x-nullable": true, + "example": "Doe" + }, + "personalEmail": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "personalEmail@email.com" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "SearchCustomers": { + "type": "array", + "items": { + "$ref": "#/definitions/SearchCustomer" + } + }, + "SearchCustomersResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "searchCustomers": { + "$ref": "#/definitions/SearchCustomers" + }, + "totalCount": { + "type": "integer" + } + } + }, + "SearchMove": { + "type": "object", + "properties": { + "branch": { + "type": "string" + }, + "destinationGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "destinationPostalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "edipi": { + "type": "string", + "x-nullable": true, + "example": 1234567890 + }, + "emplid": { + "type": "string", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid" + }, + "lastName": { + "type": "string", + "x-nullable": true, + "example": "Doe" + }, + "locator": { + "type": "string" + }, + "lockExpiresAt": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "lockedByOfficeUserID": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "orderType": { + "type": "string" + }, + "originDutyLocationPostalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "example": "90210" + }, + "originGBLOC": { + "$ref": "#/definitions/GBLOC" + }, + "paymentRequestCode": { + "type": "string", + "x-nullable": true, + "example": "9551-6199-2" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentsCount": { + "type": "integer" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + } + } + }, + "SearchMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/SearchMove" + } + }, + "SearchMovesResult": { + "type": "object", + "properties": { + "page": { + "type": "integer" + }, + "perPage": { + "type": "integer" + }, + "searchMoves": { + "$ref": "#/definitions/SearchMoves" + }, + "totalCount": { + "type": "integer" + } + } + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceItemSitEntryDate": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEntryDate": { + "type": "string", + "format": "date-time", + "x-nullable": true + } + } + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "mtoServiceItemID": { + "type": "string", + "format": "uuid" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "ServiceRequestDocuments": { + "description": "documents uploaded by the Prime as proof of request for service items", + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "ShipmentPaymentSITBalance": { + "properties": { + "pendingBilledEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "pendingBilledStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "pendingSITDaysInvoiced": { + "type": "integer" + }, + "previouslyBilledDays": { + "type": "integer", + "x-nullable": true + }, + "previouslyBilledEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "previouslyBilledStartDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentID": { + "type": "string", + "format": "uuid" + }, + "totalSITDaysAuthorized": { + "type": "integer" + }, + "totalSITDaysRemaining": { + "type": "integer" + }, + "totalSITEndDate": { + "type": "string", + "format": "date", + "x-nullable": true + } + } + }, + "ShipmentsPaymentSITBalance": { + "type": "array", + "items": { + "$ref": "#/definitions/ShipmentPaymentSITBalance" + } + }, + "SignedCertification": { + "description": "Signed certification", + "type": "object", + "required": [ + "id", + "submittingUserId", + "moveId", + "certificationType", + "certificationText", + "signature", + "date", + "createdAt", + "updatedAt", + "eTag" + ], + "properties": { + "certificationText": { + "description": "Full text that the customer agreed to and signed.", + "type": "string" + }, + "certificationType": { + "$ref": "#/definitions/SignedCertificationType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "date": { + "description": "Date that the customer signed the certification.", + "type": "string", + "format": "date" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveId": { + "description": "The ID of the move associated with this signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmId": { + "description": "The ID of the PPM shipment associated with this signed certification, if any.", + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "signature": { + "description": "The signature that the customer provided.", + "type": "string" + }, + "submittingUserId": { + "description": "The ID of the user that signed.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SignedCertificationType": { + "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "SubmittedMovingExpenseType": { + "description": "Customer Submitted Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "TacValid": { + "type": "object", + "required": [ + "isValid" + ], + "properties": { + "isValid": { + "type": "boolean", + "example": true + } + } + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phone_lines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "required": [ + "officeUserId", + "transportationOfficeId", + "primaryOffice" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "UpdateAllowancePayload": { + "type": "object", + "properties": { + "accompaniedTour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "agency": { + "$ref": "#/definitions/Affiliation" + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true + }, + "dependentsTwelveAndOver": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependentsUnderTwelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "gunSafe": { + "description": "True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance.", + "type": "boolean", + "x-nullable": true + }, + "organizationalClothingAndIndividualEquipment": { + "description": "only for Army", + "type": "boolean", + "x-nullable": true + }, + "proGearWeight": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 2000, + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "description": "unit is in lbs", + "type": "integer", + "maximum": 500, + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true, + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 0, + "x-formatting": "weight", + "example": 2000 + }, + "storageInTransit": { + "description": "the number of storage in transit days that the customer is entitled to for a given shipment on their move", + "type": "integer", + "minimum": 0 + }, + "ubAllowance": { + "type": "integer", + "x-nullable": true, + "example": 500 + } + } + }, + "UpdateBillableWeightPayload": { + "type": "object", + "properties": { + "authorizedWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + } + } + }, + "UpdateBoatShipment": { + "type": "object", + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean", + "x-nullable": true + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ], + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateCustomerPayload": { + "type": "object", + "properties": { + "backupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "backup_contact": { + "$ref": "#/definitions/BackupContact" + }, + "cac_validated": { + "type": "boolean" + }, + "current_address": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "emailIsPreferred": { + "type": "boolean" + }, + "first_name": { + "type": "string", + "example": "John" + }, + "last_name": { + "type": "string", + "example": "Doe" + }, + "middle_name": { + "type": "string", + "x-nullable": true, + "example": "David" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "phoneIsPreferred": { + "type": "boolean" + }, + "secondaryTelephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$|^$", + "x-nullable": true + }, + "suffix": { + "type": "string", + "x-nullable": true, + "example": "Jr." + } + } + }, + "UpdateCustomerSupportRemarkPayload": { + "description": "A text remark update to an existing remark created by the current active user (the CSR).", + "type": "object", + "required": [ + "content" + ], + "properties": { + "content": { + "type": "string", + "example": "This is a remark about a move." + } + } + }, + "UpdateMaxBillableWeightAsTIOPayload": { + "type": "object", + "required": [ + "authorizedWeight", + "tioRemarks" + ], + "properties": { + "authorizedWeight": { + "description": "unit is in lbs", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "tioRemarks": { + "description": "TIO remarks for updating the max billable weight", + "type": "string", + "minLength": 1, + "x-nullable": true, + "example": "Increasing max billable weight" + } + } + }, + "UpdateMobileHomeShipment": { + "type": "object", + "properties": { + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMovingExpense": { + "type": "object", + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer" + }, + "description": { + "description": "A brief description of the expense.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer" + } + } + }, + "UpdateOrderPayload": { + "type": "object", + "required": [ + "issueDate", + "reportByDate", + "ordersType", + "newDutyLocationId", + "originDutyLocationId" + ], + "properties": { + "departmentIndicator": { + "x-nullable": true, + "$ref": "#/definitions/DeptIndicator" + }, + "grade": { + "$ref": "#/definitions/Grade" + }, + "issueDate": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "newDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ntsSac": { + "title": "NTS SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "ntsTac": { + "title": "NTS TAC", + "maxLength": 4, + "minLength": 4, + "$ref": "#/definitions/NullableString", + "example": "F8J1" + }, + "ordersAcknowledgement": { + "description": "Confirmation that the new amended orders were reviewed after previously approving the original orders", + "type": "boolean", + "x-nullable": true + }, + "ordersNumber": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationId": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reportByDate": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "title": "HHG SAC", + "$ref": "#/definitions/NullableString", + "example": "N002214CSW32Y9" + }, + "tac": { + "type": "string", + "title": "HHG TAC", + "maxLength": 4, + "minLength": 4, + "x-nullable": true, + "example": "F8J1" + } + } + }, + "UpdatePPMShipment": { + "type": "object", + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "actualMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceAmountRequested": { + "description": "The amount request for an advance, or null if no advance is requested\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceStatus": { + "x-nullable": true, + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "example": 4300 + }, + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean", + "x-nullable": true + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + } + } + }, + "UpdatePaymentRequestStatusPayload": { + "type": "object", + "properties": { + "eTag": { + "type": "string" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "UpdateProGearWeightTicket": { + "type": "object", + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean" + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "weight": { + "description": "Weight of the pro-gear contained in the shipment.", + "type": "integer", + "minimum": 0 + } + } + }, + "UpdateSITServiceItemCustomerExpense": { + "required": [ + "convertToCustomerExpense", + "customerExpenseReason" + ], + "properties": { + "convertToCustomerExpense": { + "type": "boolean", + "example": true + }, + "customerExpenseReason": { + "description": "Reason the service item was rejected", + "type": "string", + "example": "Insufficent details provided" + } + } + }, + "UpdateShipment": { + "type": "object", + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "x-nullable": true, + "$ref": "#/definitions/MTOAgents" + }, + "billableWeightCap": { + "description": "estimated weight of the shuttle service item provided by the prime", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2500 + }, + "billableWeightJustification": { + "type": "string", + "x-nullable": true, + "example": "more weight than expected" + }, + "boatShipment": { + "$ref": "#/definitions/UpdateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/UpdateMobileHomeShipment" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "pickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "sacType": { + "$ref": "#/definitions/LOATypeNullable" + }, + "secondaryDeliveryAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "serviceOrderNumber": { + "type": "string", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "x-nullable": true, + "$ref": "#/definitions/StorageFacility" + }, + "tacType": { + "$ref": "#/definitions/LOATypeNullable" + }, + "tertiaryDeliveryAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "usesExternalVendor": { + "type": "boolean", + "x-nullable": true, + "example": false + } + } + }, + "UpdateWeightTicket": { + "type": "object", + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "minimum": 0 + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "minimum": 0 + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "minimum": 0 + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string" + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean" + }, + "reason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string" + }, + "status": { + "$ref": "#/definitions/PPMDocumentStatus" + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean" + } + } + }, + "Upload": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "id", + "url", + "filename", + "contentType", + "bytes", + "createdAt", + "updatedAt" + ], + "properties": { + "bytes": { + "type": "integer", + "readOnly": true + }, + "contentType": { + "type": "string", + "format": "mime-type", + "readOnly": true, + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "filename": { + "type": "string", + "readOnly": true, + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isWeightTicket": { + "type": "boolean" + }, + "rotation": { + "type": "integer", + "example": 2 + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ], + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "uploadType": { + "type": "string", + "enum": [ + "USER", + "PRIME", + "OFFICE" + ], + "readOnly": true, + "example": "OFFICE" + }, + "url": { + "type": "string", + "format": "uri", + "readOnly": true, + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocation": { + "description": "A postal code, city, and state lookup", + "type": "object", + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocations": { + "type": "array", + "items": { + "$ref": "#/definitions/VLocation" + } + }, + "ValidationError": { + "required": [ + "invalid_fields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "$ref": "#/definitions/ValidationErrorAllOf1" + } + ], + "properties": { + "invalid_fields": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "ValidationErrorAllOf1": { + "type": "object" + }, + "WeightTicket": { + "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "emptyDocumentId", + "emptyDocument", + "fullDocument", + "fullDocumentId", + "proofOfTrailerOwnershipDocument", + "proofOfTrailerOwnershipDocumentId" + ], + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "emptyDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when empty." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "emptyDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", + "type": "string", + "format": "uuid", + "readOnly": true + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "fullDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when full." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "fullDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "ID of this set of weight tickets.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this set of weight tickets is for.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "proofOfTrailerOwnershipDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the proof of trailer ownership." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "proofOfTrailerOwnershipDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedEmptyWeight": { + "description": "Customer submitted weight of the vehicle when empty.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "submittedFullWeight": { + "description": "Customer submitted weight of the vehicle when full.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "submittedOwnsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedTrailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "WeightTickets": { + "description": "All weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/WeightTicket" + }, + "x-omitempty": false + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + "movingExpenseId": { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + }, + "ppmShipmentId": { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + "proGearWeightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + }, + "weightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "NotFound": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PermissionDenied": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PreconditionFailed": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "ServerError": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "name": "queues" + }, + { + "name": "move" + }, + { + "description": "Move Orders - Commonly called “Orders,” especially in customer-facing language. Orders are plural because they're a bundle of related orders issued bya Service (e.g. Army, Air Force, Navy) to a customer that authorize (and order) that customer to move from one location to another.\nOrders are backed by $$ in the bank to support that move, which is identified by a Line of Account (LOA) code on the orders document.\n", + "name": "order" + }, + { + "name": "moveTaskOrder" + }, + { + "name": "customer" + }, + { + "name": "mtoServiceItem" + }, + { + "name": "mtoShipment" + }, + { + "name": "shipment" + }, + { + "name": "mtoAgent" + }, + { + "name": "paymentServiceItem" + }, + { + "name": "ppm" + }, + { + "name": "tac" + }, + { + "name": "transportationOffice" + }, + { + "name": "addresses" + }, + { + "name": "uploads" + }, + { + "name": "paymentRequests" + }, + { + "name": "reServiceItems" + } + ] +}`)) +} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go new file mode 100644 index 00000000000..caf0349eb8a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetLocationByZipCityStateHandlerFunc turns a function with the right signature into a get location by zip city state handler +type GetLocationByZipCityStateHandlerFunc func(GetLocationByZipCityStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetLocationByZipCityStateHandlerFunc) Handle(params GetLocationByZipCityStateParams) middleware.Responder { + return fn(params) +} + +// GetLocationByZipCityStateHandler interface for that can handle valid get location by zip city state params +type GetLocationByZipCityStateHandler interface { + Handle(GetLocationByZipCityStateParams) middleware.Responder +} + +// NewGetLocationByZipCityState creates a new http.Handler for the get location by zip city state operation +func NewGetLocationByZipCityState(ctx *middleware.Context, handler GetLocationByZipCityStateHandler) *GetLocationByZipCityState { + return &GetLocationByZipCityState{Context: ctx, Handler: handler} +} + +/* + GetLocationByZipCityState swagger:route GET /addresses/zip-city-lookup/{search} addresses getLocationByZipCityState + +Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string + +Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code. +*/ +type GetLocationByZipCityState struct { + Context *middleware.Context + Handler GetLocationByZipCityStateHandler +} + +func (o *GetLocationByZipCityState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetLocationByZipCityStateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go new file mode 100644 index 00000000000..0e8106fb581 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetLocationByZipCityStateParams creates a new GetLocationByZipCityStateParams object +// +// There are no default values defined in the spec. +func NewGetLocationByZipCityStateParams() GetLocationByZipCityStateParams { + + return GetLocationByZipCityStateParams{} +} + +// GetLocationByZipCityStateParams contains all the bound params for the get location by zip city state operation +// typically these are obtained from a http.Request +// +// swagger:parameters getLocationByZipCityState +type GetLocationByZipCityStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetLocationByZipCityStateParams() beforehand. +func (o *GetLocationByZipCityStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rSearch, rhkSearch, _ := route.Params.GetOK("search") + if err := o.bindSearch(rSearch, rhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from path. +func (o *GetLocationByZipCityStateParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Search = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go new file mode 100644 index 00000000000..dea409e8867 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetLocationByZipCityStateOKCode is the HTTP code returned for type GetLocationByZipCityStateOK +const GetLocationByZipCityStateOKCode int = 200 + +/* +GetLocationByZipCityStateOK the requested list of city, state, county, and postal code matches + +swagger:response getLocationByZipCityStateOK +*/ +type GetLocationByZipCityStateOK struct { + + /* + In: Body + */ + Payload ghcmessages.VLocations `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateOK creates GetLocationByZipCityStateOK with default headers values +func NewGetLocationByZipCityStateOK() *GetLocationByZipCityStateOK { + + return &GetLocationByZipCityStateOK{} +} + +// WithPayload adds the payload to the get location by zip city state o k response +func (o *GetLocationByZipCityStateOK) WithPayload(payload ghcmessages.VLocations) *GetLocationByZipCityStateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state o k response +func (o *GetLocationByZipCityStateOK) SetPayload(payload ghcmessages.VLocations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.VLocations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetLocationByZipCityStateBadRequestCode is the HTTP code returned for type GetLocationByZipCityStateBadRequest +const GetLocationByZipCityStateBadRequestCode int = 400 + +/* +GetLocationByZipCityStateBadRequest The request payload is invalid + +swagger:response getLocationByZipCityStateBadRequest +*/ +type GetLocationByZipCityStateBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateBadRequest creates GetLocationByZipCityStateBadRequest with default headers values +func NewGetLocationByZipCityStateBadRequest() *GetLocationByZipCityStateBadRequest { + + return &GetLocationByZipCityStateBadRequest{} +} + +// WithPayload adds the payload to the get location by zip city state bad request response +func (o *GetLocationByZipCityStateBadRequest) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state bad request response +func (o *GetLocationByZipCityStateBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateForbiddenCode is the HTTP code returned for type GetLocationByZipCityStateForbidden +const GetLocationByZipCityStateForbiddenCode int = 403 + +/* +GetLocationByZipCityStateForbidden The request was denied + +swagger:response getLocationByZipCityStateForbidden +*/ +type GetLocationByZipCityStateForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateForbidden creates GetLocationByZipCityStateForbidden with default headers values +func NewGetLocationByZipCityStateForbidden() *GetLocationByZipCityStateForbidden { + + return &GetLocationByZipCityStateForbidden{} +} + +// WithPayload adds the payload to the get location by zip city state forbidden response +func (o *GetLocationByZipCityStateForbidden) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state forbidden response +func (o *GetLocationByZipCityStateForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateNotFoundCode is the HTTP code returned for type GetLocationByZipCityStateNotFound +const GetLocationByZipCityStateNotFoundCode int = 404 + +/* +GetLocationByZipCityStateNotFound The requested resource wasn't found + +swagger:response getLocationByZipCityStateNotFound +*/ +type GetLocationByZipCityStateNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateNotFound creates GetLocationByZipCityStateNotFound with default headers values +func NewGetLocationByZipCityStateNotFound() *GetLocationByZipCityStateNotFound { + + return &GetLocationByZipCityStateNotFound{} +} + +// WithPayload adds the payload to the get location by zip city state not found response +func (o *GetLocationByZipCityStateNotFound) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state not found response +func (o *GetLocationByZipCityStateNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateInternalServerErrorCode is the HTTP code returned for type GetLocationByZipCityStateInternalServerError +const GetLocationByZipCityStateInternalServerErrorCode int = 500 + +/* +GetLocationByZipCityStateInternalServerError A server error occurred + +swagger:response getLocationByZipCityStateInternalServerError +*/ +type GetLocationByZipCityStateInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateInternalServerError creates GetLocationByZipCityStateInternalServerError with default headers values +func NewGetLocationByZipCityStateInternalServerError() *GetLocationByZipCityStateInternalServerError { + + return &GetLocationByZipCityStateInternalServerError{} +} + +// WithPayload adds the payload to the get location by zip city state internal server error response +func (o *GetLocationByZipCityStateInternalServerError) WithPayload(payload *ghcmessages.Error) *GetLocationByZipCityStateInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state internal server error response +func (o *GetLocationByZipCityStateInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go new file mode 100644 index 00000000000..28a7061c39f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/addresses/get_location_by_zip_city_state_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetLocationByZipCityStateURL generates an URL for the get location by zip city state operation +type GetLocationByZipCityStateURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLocationByZipCityStateURL) WithBasePath(bp string) *GetLocationByZipCityStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLocationByZipCityStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetLocationByZipCityStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/addresses/zip-city-lookup/{search}" + + search := o.Search + if search != "" { + _path = strings.Replace(_path, "{search}", search, -1) + } else { + return nil, errors.New("search is required on GetLocationByZipCityStateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetLocationByZipCityStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetLocationByZipCityStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetLocationByZipCityStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetLocationByZipCityStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetLocationByZipCityStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetLocationByZipCityStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go new file mode 100644 index 00000000000..209ae670952 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetParamHandlerFunc turns a function with the right signature into a get param handler +type GetParamHandlerFunc func(GetParamParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetParamHandlerFunc) Handle(params GetParamParams) middleware.Responder { + return fn(params) +} + +// GetParamHandler interface for that can handle valid get param params +type GetParamHandler interface { + Handle(GetParamParams) middleware.Responder +} + +// NewGetParam creates a new http.Handler for the get param operation +func NewGetParam(ctx *middleware.Context, handler GetParamHandler) *GetParam { + return &GetParam{Context: ctx, Handler: handler} +} + +/* + GetParam swagger:route GET /application_parameters/{parameterName} application_parameters getParam + +# Searches for an application parameter by name, returns nil if not found + +Searches for an application parameter by name, returns nil if not found +*/ +type GetParam struct { + Context *middleware.Context + Handler GetParamHandler +} + +func (o *GetParam) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetParamParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go new file mode 100644 index 00000000000..8c05fe5ad84 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetParamParams creates a new GetParamParams object +// +// There are no default values defined in the spec. +func NewGetParamParams() GetParamParams { + + return GetParamParams{} +} + +// GetParamParams contains all the bound params for the get param operation +// typically these are obtained from a http.Request +// +// swagger:parameters getParam +type GetParamParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Parameter Name + Required: true + In: path + */ + ParameterName string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetParamParams() beforehand. +func (o *GetParamParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rParameterName, rhkParameterName, _ := route.Params.GetOK("parameterName") + if err := o.bindParameterName(rParameterName, rhkParameterName, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindParameterName binds and validates parameter ParameterName from path. +func (o *GetParamParams) bindParameterName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.ParameterName = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go new file mode 100644 index 00000000000..5baf105818f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_responses.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetParamOKCode is the HTTP code returned for type GetParamOK +const GetParamOKCode int = 200 + +/* +GetParamOK Application Parameters + +swagger:response getParamOK +*/ +type GetParamOK struct { + + /* + In: Body + */ + Payload *ghcmessages.ApplicationParameters `json:"body,omitempty"` +} + +// NewGetParamOK creates GetParamOK with default headers values +func NewGetParamOK() *GetParamOK { + + return &GetParamOK{} +} + +// WithPayload adds the payload to the get param o k response +func (o *GetParamOK) WithPayload(payload *ghcmessages.ApplicationParameters) *GetParamOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get param o k response +func (o *GetParamOK) SetPayload(payload *ghcmessages.ApplicationParameters) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetParamOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetParamBadRequestCode is the HTTP code returned for type GetParamBadRequest +const GetParamBadRequestCode int = 400 + +/* +GetParamBadRequest invalid request + +swagger:response getParamBadRequest +*/ +type GetParamBadRequest struct { +} + +// NewGetParamBadRequest creates GetParamBadRequest with default headers values +func NewGetParamBadRequest() *GetParamBadRequest { + + return &GetParamBadRequest{} +} + +// WriteResponse to the client +func (o *GetParamBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// GetParamUnauthorizedCode is the HTTP code returned for type GetParamUnauthorized +const GetParamUnauthorizedCode int = 401 + +/* +GetParamUnauthorized request requires user authentication + +swagger:response getParamUnauthorized +*/ +type GetParamUnauthorized struct { +} + +// NewGetParamUnauthorized creates GetParamUnauthorized with default headers values +func NewGetParamUnauthorized() *GetParamUnauthorized { + + return &GetParamUnauthorized{} +} + +// WriteResponse to the client +func (o *GetParamUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// GetParamInternalServerErrorCode is the HTTP code returned for type GetParamInternalServerError +const GetParamInternalServerErrorCode int = 500 + +/* +GetParamInternalServerError server error + +swagger:response getParamInternalServerError +*/ +type GetParamInternalServerError struct { +} + +// NewGetParamInternalServerError creates GetParamInternalServerError with default headers values +func NewGetParamInternalServerError() *GetParamInternalServerError { + + return &GetParamInternalServerError{} +} + +// WriteResponse to the client +func (o *GetParamInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go new file mode 100644 index 00000000000..0f41a2ec1f5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/application_parameters/get_param_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetParamURL generates an URL for the get param operation +type GetParamURL struct { + ParameterName string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetParamURL) WithBasePath(bp string) *GetParamURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetParamURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetParamURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/application_parameters/{parameterName}" + + parameterName := o.ParameterName + if parameterName != "" { + _path = strings.Replace(_path, "{parameterName}", parameterName, -1) + } else { + return nil, errors.New("parameterName is required on GetParamURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetParamURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetParamURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetParamURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetParamURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetParamURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetParamURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go new file mode 100644 index 00000000000..2391d9fec61 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IsDateWeekendHolidayHandlerFunc turns a function with the right signature into a is date weekend holiday handler +type IsDateWeekendHolidayHandlerFunc func(IsDateWeekendHolidayParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IsDateWeekendHolidayHandlerFunc) Handle(params IsDateWeekendHolidayParams) middleware.Responder { + return fn(params) +} + +// IsDateWeekendHolidayHandler interface for that can handle valid is date weekend holiday params +type IsDateWeekendHolidayHandler interface { + Handle(IsDateWeekendHolidayParams) middleware.Responder +} + +// NewIsDateWeekendHoliday creates a new http.Handler for the is date weekend holiday operation +func NewIsDateWeekendHoliday(ctx *middleware.Context, handler IsDateWeekendHolidayHandler) *IsDateWeekendHoliday { + return &IsDateWeekendHoliday{Context: ctx, Handler: handler} +} + +/* + IsDateWeekendHoliday swagger:route GET /calendar/{countryCode}/is-weekend-holiday/{date} calendar isDateWeekendHoliday + +# Validate move date selection + +Utility API to determine if input date falls on weekend and/or holiday. +*/ +type IsDateWeekendHoliday struct { + Context *middleware.Context + Handler IsDateWeekendHolidayHandler +} + +func (o *IsDateWeekendHoliday) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIsDateWeekendHolidayParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go new file mode 100644 index 00000000000..bb43341894d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_parameters.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewIsDateWeekendHolidayParams creates a new IsDateWeekendHolidayParams object +// +// There are no default values defined in the spec. +func NewIsDateWeekendHolidayParams() IsDateWeekendHolidayParams { + + return IsDateWeekendHolidayParams{} +} + +// IsDateWeekendHolidayParams contains all the bound params for the is date weekend holiday operation +// typically these are obtained from a http.Request +// +// swagger:parameters isDateWeekendHoliday +type IsDateWeekendHolidayParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*country code for context of date + Required: true + In: path + */ + CountryCode string + /*input date to determine if weekend/holiday for given country. + Required: true + In: path + */ + Date strfmt.Date +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIsDateWeekendHolidayParams() beforehand. +func (o *IsDateWeekendHolidayParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rCountryCode, rhkCountryCode, _ := route.Params.GetOK("countryCode") + if err := o.bindCountryCode(rCountryCode, rhkCountryCode, route.Formats); err != nil { + res = append(res, err) + } + + rDate, rhkDate, _ := route.Params.GetOK("date") + if err := o.bindDate(rDate, rhkDate, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindCountryCode binds and validates parameter CountryCode from path. +func (o *IsDateWeekendHolidayParams) bindCountryCode(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.CountryCode = raw + + if err := o.validateCountryCode(formats); err != nil { + return err + } + + return nil +} + +// validateCountryCode carries on validations for parameter CountryCode +func (o *IsDateWeekendHolidayParams) validateCountryCode(formats strfmt.Registry) error { + + if err := validate.EnumCase("countryCode", "path", o.CountryCode, []interface{}{"US"}, true); err != nil { + return err + } + + return nil +} + +// bindDate binds and validates parameter Date from path. +func (o *IsDateWeekendHolidayParams) bindDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: date + value, err := formats.Parse("date", raw) + if err != nil { + return errors.InvalidType("date", "path", "strfmt.Date", raw) + } + o.Date = *(value.(*strfmt.Date)) + + if err := o.validateDate(formats); err != nil { + return err + } + + return nil +} + +// validateDate carries on validations for parameter Date +func (o *IsDateWeekendHolidayParams) validateDate(formats strfmt.Registry) error { + + if err := validate.FormatOf("date", "path", "date", o.Date.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go new file mode 100644 index 00000000000..d23e89dea9c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// IsDateWeekendHolidayOKCode is the HTTP code returned for type IsDateWeekendHolidayOK +const IsDateWeekendHolidayOKCode int = 200 + +/* +IsDateWeekendHolidayOK Successfully determine if given date is weekend and/or holiday for given country. + +swagger:response isDateWeekendHolidayOK +*/ +type IsDateWeekendHolidayOK struct { + + /* + In: Body + */ + Payload *ghcmessages.IsDateWeekendHolidayInfo `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayOK creates IsDateWeekendHolidayOK with default headers values +func NewIsDateWeekendHolidayOK() *IsDateWeekendHolidayOK { + + return &IsDateWeekendHolidayOK{} +} + +// WithPayload adds the payload to the is date weekend holiday o k response +func (o *IsDateWeekendHolidayOK) WithPayload(payload *ghcmessages.IsDateWeekendHolidayInfo) *IsDateWeekendHolidayOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday o k response +func (o *IsDateWeekendHolidayOK) SetPayload(payload *ghcmessages.IsDateWeekendHolidayInfo) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayBadRequestCode is the HTTP code returned for type IsDateWeekendHolidayBadRequest +const IsDateWeekendHolidayBadRequestCode int = 400 + +/* +IsDateWeekendHolidayBadRequest The request payload is invalid + +swagger:response isDateWeekendHolidayBadRequest +*/ +type IsDateWeekendHolidayBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayBadRequest creates IsDateWeekendHolidayBadRequest with default headers values +func NewIsDateWeekendHolidayBadRequest() *IsDateWeekendHolidayBadRequest { + + return &IsDateWeekendHolidayBadRequest{} +} + +// WithPayload adds the payload to the is date weekend holiday bad request response +func (o *IsDateWeekendHolidayBadRequest) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday bad request response +func (o *IsDateWeekendHolidayBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayUnauthorizedCode is the HTTP code returned for type IsDateWeekendHolidayUnauthorized +const IsDateWeekendHolidayUnauthorizedCode int = 401 + +/* +IsDateWeekendHolidayUnauthorized The request was denied + +swagger:response isDateWeekendHolidayUnauthorized +*/ +type IsDateWeekendHolidayUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayUnauthorized creates IsDateWeekendHolidayUnauthorized with default headers values +func NewIsDateWeekendHolidayUnauthorized() *IsDateWeekendHolidayUnauthorized { + + return &IsDateWeekendHolidayUnauthorized{} +} + +// WithPayload adds the payload to the is date weekend holiday unauthorized response +func (o *IsDateWeekendHolidayUnauthorized) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday unauthorized response +func (o *IsDateWeekendHolidayUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayNotFoundCode is the HTTP code returned for type IsDateWeekendHolidayNotFound +const IsDateWeekendHolidayNotFoundCode int = 404 + +/* +IsDateWeekendHolidayNotFound The requested resource wasn't found + +swagger:response isDateWeekendHolidayNotFound +*/ +type IsDateWeekendHolidayNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayNotFound creates IsDateWeekendHolidayNotFound with default headers values +func NewIsDateWeekendHolidayNotFound() *IsDateWeekendHolidayNotFound { + + return &IsDateWeekendHolidayNotFound{} +} + +// WithPayload adds the payload to the is date weekend holiday not found response +func (o *IsDateWeekendHolidayNotFound) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday not found response +func (o *IsDateWeekendHolidayNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayInternalServerErrorCode is the HTTP code returned for type IsDateWeekendHolidayInternalServerError +const IsDateWeekendHolidayInternalServerErrorCode int = 500 + +/* +IsDateWeekendHolidayInternalServerError A server error occurred + +swagger:response isDateWeekendHolidayInternalServerError +*/ +type IsDateWeekendHolidayInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayInternalServerError creates IsDateWeekendHolidayInternalServerError with default headers values +func NewIsDateWeekendHolidayInternalServerError() *IsDateWeekendHolidayInternalServerError { + + return &IsDateWeekendHolidayInternalServerError{} +} + +// WithPayload adds the payload to the is date weekend holiday internal server error response +func (o *IsDateWeekendHolidayInternalServerError) WithPayload(payload *ghcmessages.Error) *IsDateWeekendHolidayInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday internal server error response +func (o *IsDateWeekendHolidayInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go new file mode 100644 index 00000000000..1b8e4b91497 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/calendar/is_date_weekend_holiday_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// IsDateWeekendHolidayURL generates an URL for the is date weekend holiday operation +type IsDateWeekendHolidayURL struct { + CountryCode string + Date strfmt.Date + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsDateWeekendHolidayURL) WithBasePath(bp string) *IsDateWeekendHolidayURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsDateWeekendHolidayURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IsDateWeekendHolidayURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/calendar/{countryCode}/is-weekend-holiday/{date}" + + countryCode := o.CountryCode + if countryCode != "" { + _path = strings.Replace(_path, "{countryCode}", countryCode, -1) + } else { + return nil, errors.New("countryCode is required on IsDateWeekendHolidayURL") + } + + date := o.Date.String() + if date != "" { + _path = strings.Replace(_path, "{date}", date, -1) + } else { + return nil, errors.New("date is required on IsDateWeekendHolidayURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IsDateWeekendHolidayURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IsDateWeekendHolidayURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IsDateWeekendHolidayURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IsDateWeekendHolidayURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IsDateWeekendHolidayURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IsDateWeekendHolidayURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go new file mode 100644 index 00000000000..38bcedb68f6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateCustomerWithOktaOptionHandlerFunc turns a function with the right signature into a create customer with okta option handler +type CreateCustomerWithOktaOptionHandlerFunc func(CreateCustomerWithOktaOptionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateCustomerWithOktaOptionHandlerFunc) Handle(params CreateCustomerWithOktaOptionParams) middleware.Responder { + return fn(params) +} + +// CreateCustomerWithOktaOptionHandler interface for that can handle valid create customer with okta option params +type CreateCustomerWithOktaOptionHandler interface { + Handle(CreateCustomerWithOktaOptionParams) middleware.Responder +} + +// NewCreateCustomerWithOktaOption creates a new http.Handler for the create customer with okta option operation +func NewCreateCustomerWithOktaOption(ctx *middleware.Context, handler CreateCustomerWithOktaOptionHandler) *CreateCustomerWithOktaOption { + return &CreateCustomerWithOktaOption{Context: ctx, Handler: handler} +} + +/* + CreateCustomerWithOktaOption swagger:route POST /customer customer createCustomerWithOktaOption + +# Creates a customer with Okta option + +Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting. +*/ +type CreateCustomerWithOktaOption struct { + Context *middleware.Context + Handler CreateCustomerWithOktaOptionHandler +} + +func (o *CreateCustomerWithOktaOption) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateCustomerWithOktaOptionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go new file mode 100644 index 00000000000..d05da4adc8b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateCustomerWithOktaOptionParams creates a new CreateCustomerWithOktaOptionParams object +// +// There are no default values defined in the spec. +func NewCreateCustomerWithOktaOptionParams() CreateCustomerWithOktaOptionParams { + + return CreateCustomerWithOktaOptionParams{} +} + +// CreateCustomerWithOktaOptionParams contains all the bound params for the create customer with okta option operation +// typically these are obtained from a http.Request +// +// swagger:parameters createCustomerWithOktaOption +type CreateCustomerWithOktaOptionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *ghcmessages.CreateCustomerPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateCustomerWithOktaOptionParams() beforehand. +func (o *CreateCustomerWithOktaOptionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateCustomerPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go new file mode 100644 index 00000000000..901f27c6143 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateCustomerWithOktaOptionOKCode is the HTTP code returned for type CreateCustomerWithOktaOptionOK +const CreateCustomerWithOktaOptionOKCode int = 200 + +/* +CreateCustomerWithOktaOptionOK successfully created the customer + +swagger:response createCustomerWithOktaOptionOK +*/ +type CreateCustomerWithOktaOptionOK struct { + + /* + In: Body + */ + Payload *ghcmessages.CreatedCustomer `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionOK creates CreateCustomerWithOktaOptionOK with default headers values +func NewCreateCustomerWithOktaOptionOK() *CreateCustomerWithOktaOptionOK { + + return &CreateCustomerWithOktaOptionOK{} +} + +// WithPayload adds the payload to the create customer with okta option o k response +func (o *CreateCustomerWithOktaOptionOK) WithPayload(payload *ghcmessages.CreatedCustomer) *CreateCustomerWithOktaOptionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option o k response +func (o *CreateCustomerWithOktaOptionOK) SetPayload(payload *ghcmessages.CreatedCustomer) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionBadRequestCode is the HTTP code returned for type CreateCustomerWithOktaOptionBadRequest +const CreateCustomerWithOktaOptionBadRequestCode int = 400 + +/* +CreateCustomerWithOktaOptionBadRequest The request payload is invalid + +swagger:response createCustomerWithOktaOptionBadRequest +*/ +type CreateCustomerWithOktaOptionBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionBadRequest creates CreateCustomerWithOktaOptionBadRequest with default headers values +func NewCreateCustomerWithOktaOptionBadRequest() *CreateCustomerWithOktaOptionBadRequest { + + return &CreateCustomerWithOktaOptionBadRequest{} +} + +// WithPayload adds the payload to the create customer with okta option bad request response +func (o *CreateCustomerWithOktaOptionBadRequest) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option bad request response +func (o *CreateCustomerWithOktaOptionBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionUnauthorizedCode is the HTTP code returned for type CreateCustomerWithOktaOptionUnauthorized +const CreateCustomerWithOktaOptionUnauthorizedCode int = 401 + +/* +CreateCustomerWithOktaOptionUnauthorized The request was denied + +swagger:response createCustomerWithOktaOptionUnauthorized +*/ +type CreateCustomerWithOktaOptionUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionUnauthorized creates CreateCustomerWithOktaOptionUnauthorized with default headers values +func NewCreateCustomerWithOktaOptionUnauthorized() *CreateCustomerWithOktaOptionUnauthorized { + + return &CreateCustomerWithOktaOptionUnauthorized{} +} + +// WithPayload adds the payload to the create customer with okta option unauthorized response +func (o *CreateCustomerWithOktaOptionUnauthorized) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option unauthorized response +func (o *CreateCustomerWithOktaOptionUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionForbiddenCode is the HTTP code returned for type CreateCustomerWithOktaOptionForbidden +const CreateCustomerWithOktaOptionForbiddenCode int = 403 + +/* +CreateCustomerWithOktaOptionForbidden The request was denied + +swagger:response createCustomerWithOktaOptionForbidden +*/ +type CreateCustomerWithOktaOptionForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionForbidden creates CreateCustomerWithOktaOptionForbidden with default headers values +func NewCreateCustomerWithOktaOptionForbidden() *CreateCustomerWithOktaOptionForbidden { + + return &CreateCustomerWithOktaOptionForbidden{} +} + +// WithPayload adds the payload to the create customer with okta option forbidden response +func (o *CreateCustomerWithOktaOptionForbidden) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option forbidden response +func (o *CreateCustomerWithOktaOptionForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionNotFoundCode is the HTTP code returned for type CreateCustomerWithOktaOptionNotFound +const CreateCustomerWithOktaOptionNotFoundCode int = 404 + +/* +CreateCustomerWithOktaOptionNotFound The requested resource wasn't found + +swagger:response createCustomerWithOktaOptionNotFound +*/ +type CreateCustomerWithOktaOptionNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionNotFound creates CreateCustomerWithOktaOptionNotFound with default headers values +func NewCreateCustomerWithOktaOptionNotFound() *CreateCustomerWithOktaOptionNotFound { + + return &CreateCustomerWithOktaOptionNotFound{} +} + +// WithPayload adds the payload to the create customer with okta option not found response +func (o *CreateCustomerWithOktaOptionNotFound) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option not found response +func (o *CreateCustomerWithOktaOptionNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionConflictCode is the HTTP code returned for type CreateCustomerWithOktaOptionConflict +const CreateCustomerWithOktaOptionConflictCode int = 409 + +/* +CreateCustomerWithOktaOptionConflict Conflict error + +swagger:response createCustomerWithOktaOptionConflict +*/ +type CreateCustomerWithOktaOptionConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionConflict creates CreateCustomerWithOktaOptionConflict with default headers values +func NewCreateCustomerWithOktaOptionConflict() *CreateCustomerWithOktaOptionConflict { + + return &CreateCustomerWithOktaOptionConflict{} +} + +// WithPayload adds the payload to the create customer with okta option conflict response +func (o *CreateCustomerWithOktaOptionConflict) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option conflict response +func (o *CreateCustomerWithOktaOptionConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionPreconditionFailedCode is the HTTP code returned for type CreateCustomerWithOktaOptionPreconditionFailed +const CreateCustomerWithOktaOptionPreconditionFailedCode int = 412 + +/* +CreateCustomerWithOktaOptionPreconditionFailed Precondition failed + +swagger:response createCustomerWithOktaOptionPreconditionFailed +*/ +type CreateCustomerWithOktaOptionPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionPreconditionFailed creates CreateCustomerWithOktaOptionPreconditionFailed with default headers values +func NewCreateCustomerWithOktaOptionPreconditionFailed() *CreateCustomerWithOktaOptionPreconditionFailed { + + return &CreateCustomerWithOktaOptionPreconditionFailed{} +} + +// WithPayload adds the payload to the create customer with okta option precondition failed response +func (o *CreateCustomerWithOktaOptionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option precondition failed response +func (o *CreateCustomerWithOktaOptionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionUnprocessableEntityCode is the HTTP code returned for type CreateCustomerWithOktaOptionUnprocessableEntity +const CreateCustomerWithOktaOptionUnprocessableEntityCode int = 422 + +/* +CreateCustomerWithOktaOptionUnprocessableEntity The payload was unprocessable. + +swagger:response createCustomerWithOktaOptionUnprocessableEntity +*/ +type CreateCustomerWithOktaOptionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionUnprocessableEntity creates CreateCustomerWithOktaOptionUnprocessableEntity with default headers values +func NewCreateCustomerWithOktaOptionUnprocessableEntity() *CreateCustomerWithOktaOptionUnprocessableEntity { + + return &CreateCustomerWithOktaOptionUnprocessableEntity{} +} + +// WithPayload adds the payload to the create customer with okta option unprocessable entity response +func (o *CreateCustomerWithOktaOptionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateCustomerWithOktaOptionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option unprocessable entity response +func (o *CreateCustomerWithOktaOptionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerWithOktaOptionInternalServerErrorCode is the HTTP code returned for type CreateCustomerWithOktaOptionInternalServerError +const CreateCustomerWithOktaOptionInternalServerErrorCode int = 500 + +/* +CreateCustomerWithOktaOptionInternalServerError A server error occurred + +swagger:response createCustomerWithOktaOptionInternalServerError +*/ +type CreateCustomerWithOktaOptionInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerWithOktaOptionInternalServerError creates CreateCustomerWithOktaOptionInternalServerError with default headers values +func NewCreateCustomerWithOktaOptionInternalServerError() *CreateCustomerWithOktaOptionInternalServerError { + + return &CreateCustomerWithOktaOptionInternalServerError{} +} + +// WithPayload adds the payload to the create customer with okta option internal server error response +func (o *CreateCustomerWithOktaOptionInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateCustomerWithOktaOptionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer with okta option internal server error response +func (o *CreateCustomerWithOktaOptionInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerWithOktaOptionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go new file mode 100644 index 00000000000..a7aba59aa7d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/create_customer_with_okta_option_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateCustomerWithOktaOptionURL generates an URL for the create customer with okta option operation +type CreateCustomerWithOktaOptionURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateCustomerWithOktaOptionURL) WithBasePath(bp string) *CreateCustomerWithOktaOptionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateCustomerWithOktaOptionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateCustomerWithOktaOptionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateCustomerWithOktaOptionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateCustomerWithOktaOptionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateCustomerWithOktaOptionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateCustomerWithOktaOptionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateCustomerWithOktaOptionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateCustomerWithOktaOptionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go new file mode 100644 index 00000000000..13cda3bc69d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/get_customer.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetCustomerHandlerFunc turns a function with the right signature into a get customer handler +type GetCustomerHandlerFunc func(GetCustomerParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetCustomerHandlerFunc) Handle(params GetCustomerParams) middleware.Responder { + return fn(params) +} + +// GetCustomerHandler interface for that can handle valid get customer params +type GetCustomerHandler interface { + Handle(GetCustomerParams) middleware.Responder +} + +// NewGetCustomer creates a new http.Handler for the get customer operation +func NewGetCustomer(ctx *middleware.Context, handler GetCustomerHandler) *GetCustomer { + return &GetCustomer{Context: ctx, Handler: handler} +} + +/* + GetCustomer swagger:route GET /customer/{customerID} customer getCustomer + +# Returns a given customer + +Returns a given customer +*/ +type GetCustomer struct { + Context *middleware.Context + Handler GetCustomerHandler +} + +func (o *GetCustomer) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetCustomerParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go new file mode 100644 index 00000000000..b52b48a7125 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetCustomerParams creates a new GetCustomerParams object +// +// There are no default values defined in the spec. +func NewGetCustomerParams() GetCustomerParams { + + return GetCustomerParams{} +} + +// GetCustomerParams contains all the bound params for the get customer operation +// typically these are obtained from a http.Request +// +// swagger:parameters getCustomer +type GetCustomerParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of customer to use + Required: true + In: path + */ + CustomerID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetCustomerParams() beforehand. +func (o *GetCustomerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rCustomerID, rhkCustomerID, _ := route.Params.GetOK("customerID") + if err := o.bindCustomerID(rCustomerID, rhkCustomerID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindCustomerID binds and validates parameter CustomerID from path. +func (o *GetCustomerParams) bindCustomerID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("customerID", "path", "strfmt.UUID", raw) + } + o.CustomerID = *(value.(*strfmt.UUID)) + + if err := o.validateCustomerID(formats); err != nil { + return err + } + + return nil +} + +// validateCustomerID carries on validations for parameter CustomerID +func (o *GetCustomerParams) validateCustomerID(formats strfmt.Registry) error { + + if err := validate.FormatOf("customerID", "path", "uuid", o.CustomerID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go new file mode 100644 index 00000000000..b691559f3c2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetCustomerOKCode is the HTTP code returned for type GetCustomerOK +const GetCustomerOKCode int = 200 + +/* +GetCustomerOK Successfully retrieved information on an individual customer + +swagger:response getCustomerOK +*/ +type GetCustomerOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Customer `json:"body,omitempty"` +} + +// NewGetCustomerOK creates GetCustomerOK with default headers values +func NewGetCustomerOK() *GetCustomerOK { + + return &GetCustomerOK{} +} + +// WithPayload adds the payload to the get customer o k response +func (o *GetCustomerOK) WithPayload(payload *ghcmessages.Customer) *GetCustomerOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer o k response +func (o *GetCustomerOK) SetPayload(payload *ghcmessages.Customer) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerBadRequestCode is the HTTP code returned for type GetCustomerBadRequest +const GetCustomerBadRequestCode int = 400 + +/* +GetCustomerBadRequest The request payload is invalid + +swagger:response getCustomerBadRequest +*/ +type GetCustomerBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerBadRequest creates GetCustomerBadRequest with default headers values +func NewGetCustomerBadRequest() *GetCustomerBadRequest { + + return &GetCustomerBadRequest{} +} + +// WithPayload adds the payload to the get customer bad request response +func (o *GetCustomerBadRequest) WithPayload(payload *ghcmessages.Error) *GetCustomerBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer bad request response +func (o *GetCustomerBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerUnauthorizedCode is the HTTP code returned for type GetCustomerUnauthorized +const GetCustomerUnauthorizedCode int = 401 + +/* +GetCustomerUnauthorized The request was denied + +swagger:response getCustomerUnauthorized +*/ +type GetCustomerUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerUnauthorized creates GetCustomerUnauthorized with default headers values +func NewGetCustomerUnauthorized() *GetCustomerUnauthorized { + + return &GetCustomerUnauthorized{} +} + +// WithPayload adds the payload to the get customer unauthorized response +func (o *GetCustomerUnauthorized) WithPayload(payload *ghcmessages.Error) *GetCustomerUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer unauthorized response +func (o *GetCustomerUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerForbiddenCode is the HTTP code returned for type GetCustomerForbidden +const GetCustomerForbiddenCode int = 403 + +/* +GetCustomerForbidden The request was denied + +swagger:response getCustomerForbidden +*/ +type GetCustomerForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerForbidden creates GetCustomerForbidden with default headers values +func NewGetCustomerForbidden() *GetCustomerForbidden { + + return &GetCustomerForbidden{} +} + +// WithPayload adds the payload to the get customer forbidden response +func (o *GetCustomerForbidden) WithPayload(payload *ghcmessages.Error) *GetCustomerForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer forbidden response +func (o *GetCustomerForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerNotFoundCode is the HTTP code returned for type GetCustomerNotFound +const GetCustomerNotFoundCode int = 404 + +/* +GetCustomerNotFound The requested resource wasn't found + +swagger:response getCustomerNotFound +*/ +type GetCustomerNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerNotFound creates GetCustomerNotFound with default headers values +func NewGetCustomerNotFound() *GetCustomerNotFound { + + return &GetCustomerNotFound{} +} + +// WithPayload adds the payload to the get customer not found response +func (o *GetCustomerNotFound) WithPayload(payload *ghcmessages.Error) *GetCustomerNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer not found response +func (o *GetCustomerNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerInternalServerErrorCode is the HTTP code returned for type GetCustomerInternalServerError +const GetCustomerInternalServerErrorCode int = 500 + +/* +GetCustomerInternalServerError A server error occurred + +swagger:response getCustomerInternalServerError +*/ +type GetCustomerInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerInternalServerError creates GetCustomerInternalServerError with default headers values +func NewGetCustomerInternalServerError() *GetCustomerInternalServerError { + + return &GetCustomerInternalServerError{} +} + +// WithPayload adds the payload to the get customer internal server error response +func (o *GetCustomerInternalServerError) WithPayload(payload *ghcmessages.Error) *GetCustomerInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer internal server error response +func (o *GetCustomerInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go new file mode 100644 index 00000000000..6a47ebf2086 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/get_customer_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetCustomerURL generates an URL for the get customer operation +type GetCustomerURL struct { + CustomerID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetCustomerURL) WithBasePath(bp string) *GetCustomerURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetCustomerURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetCustomerURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer/{customerID}" + + customerID := o.CustomerID.String() + if customerID != "" { + _path = strings.Replace(_path, "{customerID}", customerID, -1) + } else { + return nil, errors.New("customerId is required on GetCustomerURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetCustomerURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetCustomerURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetCustomerURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetCustomerURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetCustomerURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetCustomerURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go new file mode 100644 index 00000000000..02f2dc2ab3a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/search_customers.go @@ -0,0 +1,311 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SearchCustomersHandlerFunc turns a function with the right signature into a search customers handler +type SearchCustomersHandlerFunc func(SearchCustomersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SearchCustomersHandlerFunc) Handle(params SearchCustomersParams) middleware.Responder { + return fn(params) +} + +// SearchCustomersHandler interface for that can handle valid search customers params +type SearchCustomersHandler interface { + Handle(SearchCustomersParams) middleware.Responder +} + +// NewSearchCustomers creates a new http.Handler for the search customers operation +func NewSearchCustomers(ctx *middleware.Context, handler SearchCustomersHandler) *SearchCustomers { + return &SearchCustomers{Context: ctx, Handler: handler} +} + +/* + SearchCustomers swagger:route POST /customer/search customer searchCustomers + +# Search customers by DOD ID or customer name + +Search customers by DOD ID or customer name. Used by services counselors to locate profiles to update, find attached moves, and to create new moves. +*/ +type SearchCustomers struct { + Context *middleware.Context + Handler SearchCustomersHandler +} + +func (o *SearchCustomers) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSearchCustomersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// SearchCustomersBody search customers body +// +// swagger:model SearchCustomersBody +type SearchCustomersBody struct { + + // Branch + // Min Length: 1 + Branch string `json:"branch,omitempty"` + + // Customer Name + // Min Length: 1 + CustomerName *string `json:"customerName,omitempty"` + + // DOD ID + // Max Length: 10 + // Min Length: 10 + Edipi *string `json:"edipi,omitempty"` + + // EMPLID + // Max Length: 7 + // Min Length: 7 + Emplid *string `json:"emplid,omitempty"` + + // order + // Enum: [asc desc] + Order *string `json:"order,omitempty"` + + // requested page of results + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // sort + // Enum: [customerName edipi emplid branch personalEmail telephone] + Sort *string `json:"sort,omitempty"` +} + +// Validate validates this search customers body +func (o *SearchCustomersBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateBranch(formats); err != nil { + res = append(res, err) + } + + if err := o.validateCustomerName(formats); err != nil { + res = append(res, err) + } + + if err := o.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := o.validateEmplid(formats); err != nil { + res = append(res, err) + } + + if err := o.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := o.validateSort(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SearchCustomersBody) validateBranch(formats strfmt.Registry) error { + if swag.IsZero(o.Branch) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"branch", "body", o.Branch, 1); err != nil { + return err + } + + return nil +} + +func (o *SearchCustomersBody) validateCustomerName(formats strfmt.Registry) error { + if swag.IsZero(o.CustomerName) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"customerName", "body", *o.CustomerName, 1); err != nil { + return err + } + + return nil +} + +func (o *SearchCustomersBody) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(o.Edipi) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { + return err + } + + return nil +} + +func (o *SearchCustomersBody) validateEmplid(formats strfmt.Registry) error { + if swag.IsZero(o.Emplid) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { + return err + } + + if err := validate.MaxLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { + return err + } + + return nil +} + +var searchCustomersBodyTypeOrderPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["asc","desc"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + searchCustomersBodyTypeOrderPropEnum = append(searchCustomersBodyTypeOrderPropEnum, v) + } +} + +const ( + + // SearchCustomersBodyOrderAsc captures enum value "asc" + SearchCustomersBodyOrderAsc string = "asc" + + // SearchCustomersBodyOrderDesc captures enum value "desc" + SearchCustomersBodyOrderDesc string = "desc" +) + +// prop value enum +func (o *SearchCustomersBody) validateOrderEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, searchCustomersBodyTypeOrderPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *SearchCustomersBody) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(o.Order) { // not required + return nil + } + + // value enum + if err := o.validateOrderEnum("body"+"."+"order", "body", *o.Order); err != nil { + return err + } + + return nil +} + +var searchCustomersBodyTypeSortPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["customerName","edipi","emplid","branch","personalEmail","telephone"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + searchCustomersBodyTypeSortPropEnum = append(searchCustomersBodyTypeSortPropEnum, v) + } +} + +const ( + + // SearchCustomersBodySortCustomerName captures enum value "customerName" + SearchCustomersBodySortCustomerName string = "customerName" + + // SearchCustomersBodySortEdipi captures enum value "edipi" + SearchCustomersBodySortEdipi string = "edipi" + + // SearchCustomersBodySortEmplid captures enum value "emplid" + SearchCustomersBodySortEmplid string = "emplid" + + // SearchCustomersBodySortBranch captures enum value "branch" + SearchCustomersBodySortBranch string = "branch" + + // SearchCustomersBodySortPersonalEmail captures enum value "personalEmail" + SearchCustomersBodySortPersonalEmail string = "personalEmail" + + // SearchCustomersBodySortTelephone captures enum value "telephone" + SearchCustomersBodySortTelephone string = "telephone" +) + +// prop value enum +func (o *SearchCustomersBody) validateSortEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, searchCustomersBodyTypeSortPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *SearchCustomersBody) validateSort(formats strfmt.Registry) error { + if swag.IsZero(o.Sort) { // not required + return nil + } + + // value enum + if err := o.validateSortEnum("body"+"."+"sort", "body", *o.Sort); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this search customers body based on context it is used +func (o *SearchCustomersBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SearchCustomersBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SearchCustomersBody) UnmarshalBinary(b []byte) error { + var res SearchCustomersBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go new file mode 100644 index 00000000000..ca6d419ced9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_parameters.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" +) + +// NewSearchCustomersParams creates a new SearchCustomersParams object +// +// There are no default values defined in the spec. +func NewSearchCustomersParams() SearchCustomersParams { + + return SearchCustomersParams{} +} + +// SearchCustomersParams contains all the bound params for the search customers operation +// typically these are obtained from a http.Request +// +// swagger:parameters searchCustomers +type SearchCustomersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*field that results should be sorted by + In: body + */ + Body SearchCustomersBody +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSearchCustomersParams() beforehand. +func (o *SearchCustomersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body SearchCustomersBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go new file mode 100644 index 00000000000..952e4e60a89 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// SearchCustomersOKCode is the HTTP code returned for type SearchCustomersOK +const SearchCustomersOKCode int = 200 + +/* +SearchCustomersOK Successfully returned all customers matching the criteria + +swagger:response searchCustomersOK +*/ +type SearchCustomersOK struct { + + /* + In: Body + */ + Payload *ghcmessages.SearchCustomersResult `json:"body,omitempty"` +} + +// NewSearchCustomersOK creates SearchCustomersOK with default headers values +func NewSearchCustomersOK() *SearchCustomersOK { + + return &SearchCustomersOK{} +} + +// WithPayload adds the payload to the search customers o k response +func (o *SearchCustomersOK) WithPayload(payload *ghcmessages.SearchCustomersResult) *SearchCustomersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search customers o k response +func (o *SearchCustomersOK) SetPayload(payload *ghcmessages.SearchCustomersResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchCustomersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SearchCustomersForbiddenCode is the HTTP code returned for type SearchCustomersForbidden +const SearchCustomersForbiddenCode int = 403 + +/* +SearchCustomersForbidden The request was denied + +swagger:response searchCustomersForbidden +*/ +type SearchCustomersForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSearchCustomersForbidden creates SearchCustomersForbidden with default headers values +func NewSearchCustomersForbidden() *SearchCustomersForbidden { + + return &SearchCustomersForbidden{} +} + +// WithPayload adds the payload to the search customers forbidden response +func (o *SearchCustomersForbidden) WithPayload(payload *ghcmessages.Error) *SearchCustomersForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search customers forbidden response +func (o *SearchCustomersForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchCustomersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SearchCustomersInternalServerErrorCode is the HTTP code returned for type SearchCustomersInternalServerError +const SearchCustomersInternalServerErrorCode int = 500 + +/* +SearchCustomersInternalServerError A server error occurred + +swagger:response searchCustomersInternalServerError +*/ +type SearchCustomersInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSearchCustomersInternalServerError creates SearchCustomersInternalServerError with default headers values +func NewSearchCustomersInternalServerError() *SearchCustomersInternalServerError { + + return &SearchCustomersInternalServerError{} +} + +// WithPayload adds the payload to the search customers internal server error response +func (o *SearchCustomersInternalServerError) WithPayload(payload *ghcmessages.Error) *SearchCustomersInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search customers internal server error response +func (o *SearchCustomersInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchCustomersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go new file mode 100644 index 00000000000..06d228d61fd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/search_customers_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// SearchCustomersURL generates an URL for the search customers operation +type SearchCustomersURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchCustomersURL) WithBasePath(bp string) *SearchCustomersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchCustomersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SearchCustomersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer/search" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SearchCustomersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SearchCustomersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SearchCustomersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SearchCustomersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SearchCustomersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SearchCustomersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go new file mode 100644 index 00000000000..4a6bf76daa4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/update_customer.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateCustomerHandlerFunc turns a function with the right signature into a update customer handler +type UpdateCustomerHandlerFunc func(UpdateCustomerParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateCustomerHandlerFunc) Handle(params UpdateCustomerParams) middleware.Responder { + return fn(params) +} + +// UpdateCustomerHandler interface for that can handle valid update customer params +type UpdateCustomerHandler interface { + Handle(UpdateCustomerParams) middleware.Responder +} + +// NewUpdateCustomer creates a new http.Handler for the update customer operation +func NewUpdateCustomer(ctx *middleware.Context, handler UpdateCustomerHandler) *UpdateCustomer { + return &UpdateCustomer{Context: ctx, Handler: handler} +} + +/* + UpdateCustomer swagger:route PATCH /customer/{customerID} customer updateCustomer + +# Updates customer info + +Updates customer info by ID +*/ +type UpdateCustomer struct { + Context *middleware.Context + Handler UpdateCustomerHandler +} + +func (o *UpdateCustomer) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateCustomerParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go new file mode 100644 index 00000000000..18fb04926d8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateCustomerParams creates a new UpdateCustomerParams object +// +// There are no default values defined in the spec. +func NewUpdateCustomerParams() UpdateCustomerParams { + + return UpdateCustomerParams{} +} + +// UpdateCustomerParams contains all the bound params for the update customer operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateCustomer +type UpdateCustomerParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateCustomerPayload + /*ID of customer to use + Required: true + In: path + */ + CustomerID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateCustomerParams() beforehand. +func (o *UpdateCustomerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateCustomerPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rCustomerID, rhkCustomerID, _ := route.Params.GetOK("customerID") + if err := o.bindCustomerID(rCustomerID, rhkCustomerID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateCustomerParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindCustomerID binds and validates parameter CustomerID from path. +func (o *UpdateCustomerParams) bindCustomerID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("customerID", "path", "strfmt.UUID", raw) + } + o.CustomerID = *(value.(*strfmt.UUID)) + + if err := o.validateCustomerID(formats); err != nil { + return err + } + + return nil +} + +// validateCustomerID carries on validations for parameter CustomerID +func (o *UpdateCustomerParams) validateCustomerID(formats strfmt.Registry) error { + + if err := validate.FormatOf("customerID", "path", "uuid", o.CustomerID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go new file mode 100644 index 00000000000..b51b3d26bc5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateCustomerOKCode is the HTTP code returned for type UpdateCustomerOK +const UpdateCustomerOKCode int = 200 + +/* +UpdateCustomerOK updated instance of orders + +swagger:response updateCustomerOK +*/ +type UpdateCustomerOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Customer `json:"body,omitempty"` +} + +// NewUpdateCustomerOK creates UpdateCustomerOK with default headers values +func NewUpdateCustomerOK() *UpdateCustomerOK { + + return &UpdateCustomerOK{} +} + +// WithPayload adds the payload to the update customer o k response +func (o *UpdateCustomerOK) WithPayload(payload *ghcmessages.Customer) *UpdateCustomerOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer o k response +func (o *UpdateCustomerOK) SetPayload(payload *ghcmessages.Customer) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerBadRequestCode is the HTTP code returned for type UpdateCustomerBadRequest +const UpdateCustomerBadRequestCode int = 400 + +/* +UpdateCustomerBadRequest The request payload is invalid + +swagger:response updateCustomerBadRequest +*/ +type UpdateCustomerBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerBadRequest creates UpdateCustomerBadRequest with default headers values +func NewUpdateCustomerBadRequest() *UpdateCustomerBadRequest { + + return &UpdateCustomerBadRequest{} +} + +// WithPayload adds the payload to the update customer bad request response +func (o *UpdateCustomerBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCustomerBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer bad request response +func (o *UpdateCustomerBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerUnauthorizedCode is the HTTP code returned for type UpdateCustomerUnauthorized +const UpdateCustomerUnauthorizedCode int = 401 + +/* +UpdateCustomerUnauthorized The request was denied + +swagger:response updateCustomerUnauthorized +*/ +type UpdateCustomerUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerUnauthorized creates UpdateCustomerUnauthorized with default headers values +func NewUpdateCustomerUnauthorized() *UpdateCustomerUnauthorized { + + return &UpdateCustomerUnauthorized{} +} + +// WithPayload adds the payload to the update customer unauthorized response +func (o *UpdateCustomerUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateCustomerUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer unauthorized response +func (o *UpdateCustomerUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerForbiddenCode is the HTTP code returned for type UpdateCustomerForbidden +const UpdateCustomerForbiddenCode int = 403 + +/* +UpdateCustomerForbidden The request was denied + +swagger:response updateCustomerForbidden +*/ +type UpdateCustomerForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerForbidden creates UpdateCustomerForbidden with default headers values +func NewUpdateCustomerForbidden() *UpdateCustomerForbidden { + + return &UpdateCustomerForbidden{} +} + +// WithPayload adds the payload to the update customer forbidden response +func (o *UpdateCustomerForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCustomerForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer forbidden response +func (o *UpdateCustomerForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerNotFoundCode is the HTTP code returned for type UpdateCustomerNotFound +const UpdateCustomerNotFoundCode int = 404 + +/* +UpdateCustomerNotFound The requested resource wasn't found + +swagger:response updateCustomerNotFound +*/ +type UpdateCustomerNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerNotFound creates UpdateCustomerNotFound with default headers values +func NewUpdateCustomerNotFound() *UpdateCustomerNotFound { + + return &UpdateCustomerNotFound{} +} + +// WithPayload adds the payload to the update customer not found response +func (o *UpdateCustomerNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCustomerNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer not found response +func (o *UpdateCustomerNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerPreconditionFailedCode is the HTTP code returned for type UpdateCustomerPreconditionFailed +const UpdateCustomerPreconditionFailedCode int = 412 + +/* +UpdateCustomerPreconditionFailed Precondition failed + +swagger:response updateCustomerPreconditionFailed +*/ +type UpdateCustomerPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerPreconditionFailed creates UpdateCustomerPreconditionFailed with default headers values +func NewUpdateCustomerPreconditionFailed() *UpdateCustomerPreconditionFailed { + + return &UpdateCustomerPreconditionFailed{} +} + +// WithPayload adds the payload to the update customer precondition failed response +func (o *UpdateCustomerPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateCustomerPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer precondition failed response +func (o *UpdateCustomerPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerUnprocessableEntityCode is the HTTP code returned for type UpdateCustomerUnprocessableEntity +const UpdateCustomerUnprocessableEntityCode int = 422 + +/* +UpdateCustomerUnprocessableEntity The payload was unprocessable. + +swagger:response updateCustomerUnprocessableEntity +*/ +type UpdateCustomerUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateCustomerUnprocessableEntity creates UpdateCustomerUnprocessableEntity with default headers values +func NewUpdateCustomerUnprocessableEntity() *UpdateCustomerUnprocessableEntity { + + return &UpdateCustomerUnprocessableEntity{} +} + +// WithPayload adds the payload to the update customer unprocessable entity response +func (o *UpdateCustomerUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCustomerUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer unprocessable entity response +func (o *UpdateCustomerUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerInternalServerErrorCode is the HTTP code returned for type UpdateCustomerInternalServerError +const UpdateCustomerInternalServerErrorCode int = 500 + +/* +UpdateCustomerInternalServerError A server error occurred + +swagger:response updateCustomerInternalServerError +*/ +type UpdateCustomerInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerInternalServerError creates UpdateCustomerInternalServerError with default headers values +func NewUpdateCustomerInternalServerError() *UpdateCustomerInternalServerError { + + return &UpdateCustomerInternalServerError{} +} + +// WithPayload adds the payload to the update customer internal server error response +func (o *UpdateCustomerInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCustomerInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer internal server error response +func (o *UpdateCustomerInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go new file mode 100644 index 00000000000..7b2c291da15 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer/update_customer_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateCustomerURL generates an URL for the update customer operation +type UpdateCustomerURL struct { + CustomerID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCustomerURL) WithBasePath(bp string) *UpdateCustomerURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCustomerURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateCustomerURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer/{customerID}" + + customerID := o.CustomerID.String() + if customerID != "" { + _path = strings.Replace(_path, "{customerID}", customerID, -1) + } else { + return nil, errors.New("customerId is required on UpdateCustomerURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateCustomerURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateCustomerURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateCustomerURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateCustomerURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateCustomerURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateCustomerURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go new file mode 100644 index 00000000000..59cc9ed4fb8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateCustomerSupportRemarkForMoveHandlerFunc turns a function with the right signature into a create customer support remark for move handler +type CreateCustomerSupportRemarkForMoveHandlerFunc func(CreateCustomerSupportRemarkForMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateCustomerSupportRemarkForMoveHandlerFunc) Handle(params CreateCustomerSupportRemarkForMoveParams) middleware.Responder { + return fn(params) +} + +// CreateCustomerSupportRemarkForMoveHandler interface for that can handle valid create customer support remark for move params +type CreateCustomerSupportRemarkForMoveHandler interface { + Handle(CreateCustomerSupportRemarkForMoveParams) middleware.Responder +} + +// NewCreateCustomerSupportRemarkForMove creates a new http.Handler for the create customer support remark for move operation +func NewCreateCustomerSupportRemarkForMove(ctx *middleware.Context, handler CreateCustomerSupportRemarkForMoveHandler) *CreateCustomerSupportRemarkForMove { + return &CreateCustomerSupportRemarkForMove{Context: ctx, Handler: handler} +} + +/* + CreateCustomerSupportRemarkForMove swagger:route POST /moves/{locator}/customer-support-remarks customerSupportRemarks createCustomerSupportRemarkForMove + +# Creates a customer support remark for a move + +Creates a customer support remark for a move +*/ +type CreateCustomerSupportRemarkForMove struct { + Context *middleware.Context + Handler CreateCustomerSupportRemarkForMoveHandler +} + +func (o *CreateCustomerSupportRemarkForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateCustomerSupportRemarkForMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go new file mode 100644 index 00000000000..130357392b8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateCustomerSupportRemarkForMoveParams creates a new CreateCustomerSupportRemarkForMoveParams object +// +// There are no default values defined in the spec. +func NewCreateCustomerSupportRemarkForMoveParams() CreateCustomerSupportRemarkForMoveParams { + + return CreateCustomerSupportRemarkForMoveParams{} +} + +// CreateCustomerSupportRemarkForMoveParams contains all the bound params for the create customer support remark for move operation +// typically these are obtained from a http.Request +// +// swagger:parameters createCustomerSupportRemarkForMove +type CreateCustomerSupportRemarkForMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.CreateCustomerSupportRemark + /*move code to identify a move for customer support remarks + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateCustomerSupportRemarkForMoveParams() beforehand. +func (o *CreateCustomerSupportRemarkForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateCustomerSupportRemark + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *CreateCustomerSupportRemarkForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go new file mode 100644 index 00000000000..be2f4b1bde6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateCustomerSupportRemarkForMoveOKCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveOK +const CreateCustomerSupportRemarkForMoveOKCode int = 200 + +/* +CreateCustomerSupportRemarkForMoveOK Successfully created customer support remark + +swagger:response createCustomerSupportRemarkForMoveOK +*/ +type CreateCustomerSupportRemarkForMoveOK struct { + + /* + In: Body + */ + Payload *ghcmessages.CustomerSupportRemark `json:"body,omitempty"` +} + +// NewCreateCustomerSupportRemarkForMoveOK creates CreateCustomerSupportRemarkForMoveOK with default headers values +func NewCreateCustomerSupportRemarkForMoveOK() *CreateCustomerSupportRemarkForMoveOK { + + return &CreateCustomerSupportRemarkForMoveOK{} +} + +// WithPayload adds the payload to the create customer support remark for move o k response +func (o *CreateCustomerSupportRemarkForMoveOK) WithPayload(payload *ghcmessages.CustomerSupportRemark) *CreateCustomerSupportRemarkForMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer support remark for move o k response +func (o *CreateCustomerSupportRemarkForMoveOK) SetPayload(payload *ghcmessages.CustomerSupportRemark) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerSupportRemarkForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerSupportRemarkForMoveBadRequestCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveBadRequest +const CreateCustomerSupportRemarkForMoveBadRequestCode int = 400 + +/* +CreateCustomerSupportRemarkForMoveBadRequest The request payload is invalid + +swagger:response createCustomerSupportRemarkForMoveBadRequest +*/ +type CreateCustomerSupportRemarkForMoveBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerSupportRemarkForMoveBadRequest creates CreateCustomerSupportRemarkForMoveBadRequest with default headers values +func NewCreateCustomerSupportRemarkForMoveBadRequest() *CreateCustomerSupportRemarkForMoveBadRequest { + + return &CreateCustomerSupportRemarkForMoveBadRequest{} +} + +// WithPayload adds the payload to the create customer support remark for move bad request response +func (o *CreateCustomerSupportRemarkForMoveBadRequest) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer support remark for move bad request response +func (o *CreateCustomerSupportRemarkForMoveBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerSupportRemarkForMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerSupportRemarkForMoveNotFoundCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveNotFound +const CreateCustomerSupportRemarkForMoveNotFoundCode int = 404 + +/* +CreateCustomerSupportRemarkForMoveNotFound The requested resource wasn't found + +swagger:response createCustomerSupportRemarkForMoveNotFound +*/ +type CreateCustomerSupportRemarkForMoveNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerSupportRemarkForMoveNotFound creates CreateCustomerSupportRemarkForMoveNotFound with default headers values +func NewCreateCustomerSupportRemarkForMoveNotFound() *CreateCustomerSupportRemarkForMoveNotFound { + + return &CreateCustomerSupportRemarkForMoveNotFound{} +} + +// WithPayload adds the payload to the create customer support remark for move not found response +func (o *CreateCustomerSupportRemarkForMoveNotFound) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer support remark for move not found response +func (o *CreateCustomerSupportRemarkForMoveNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerSupportRemarkForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerSupportRemarkForMoveUnprocessableEntityCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveUnprocessableEntity +const CreateCustomerSupportRemarkForMoveUnprocessableEntityCode int = 422 + +/* +CreateCustomerSupportRemarkForMoveUnprocessableEntity The payload was unprocessable. + +swagger:response createCustomerSupportRemarkForMoveUnprocessableEntity +*/ +type CreateCustomerSupportRemarkForMoveUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateCustomerSupportRemarkForMoveUnprocessableEntity creates CreateCustomerSupportRemarkForMoveUnprocessableEntity with default headers values +func NewCreateCustomerSupportRemarkForMoveUnprocessableEntity() *CreateCustomerSupportRemarkForMoveUnprocessableEntity { + + return &CreateCustomerSupportRemarkForMoveUnprocessableEntity{} +} + +// WithPayload adds the payload to the create customer support remark for move unprocessable entity response +func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateCustomerSupportRemarkForMoveUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer support remark for move unprocessable entity response +func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerSupportRemarkForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateCustomerSupportRemarkForMoveInternalServerErrorCode is the HTTP code returned for type CreateCustomerSupportRemarkForMoveInternalServerError +const CreateCustomerSupportRemarkForMoveInternalServerErrorCode int = 500 + +/* +CreateCustomerSupportRemarkForMoveInternalServerError A server error occurred + +swagger:response createCustomerSupportRemarkForMoveInternalServerError +*/ +type CreateCustomerSupportRemarkForMoveInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateCustomerSupportRemarkForMoveInternalServerError creates CreateCustomerSupportRemarkForMoveInternalServerError with default headers values +func NewCreateCustomerSupportRemarkForMoveInternalServerError() *CreateCustomerSupportRemarkForMoveInternalServerError { + + return &CreateCustomerSupportRemarkForMoveInternalServerError{} +} + +// WithPayload adds the payload to the create customer support remark for move internal server error response +func (o *CreateCustomerSupportRemarkForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateCustomerSupportRemarkForMoveInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create customer support remark for move internal server error response +func (o *CreateCustomerSupportRemarkForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateCustomerSupportRemarkForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go new file mode 100644 index 00000000000..5d698538cc2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/create_customer_support_remark_for_move_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// CreateCustomerSupportRemarkForMoveURL generates an URL for the create customer support remark for move operation +type CreateCustomerSupportRemarkForMoveURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateCustomerSupportRemarkForMoveURL) WithBasePath(bp string) *CreateCustomerSupportRemarkForMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateCustomerSupportRemarkForMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateCustomerSupportRemarkForMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/customer-support-remarks" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on CreateCustomerSupportRemarkForMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateCustomerSupportRemarkForMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateCustomerSupportRemarkForMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateCustomerSupportRemarkForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateCustomerSupportRemarkForMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateCustomerSupportRemarkForMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateCustomerSupportRemarkForMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go new file mode 100644 index 00000000000..a297b3a6709 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteCustomerSupportRemarkHandlerFunc turns a function with the right signature into a delete customer support remark handler +type DeleteCustomerSupportRemarkHandlerFunc func(DeleteCustomerSupportRemarkParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteCustomerSupportRemarkHandlerFunc) Handle(params DeleteCustomerSupportRemarkParams) middleware.Responder { + return fn(params) +} + +// DeleteCustomerSupportRemarkHandler interface for that can handle valid delete customer support remark params +type DeleteCustomerSupportRemarkHandler interface { + Handle(DeleteCustomerSupportRemarkParams) middleware.Responder +} + +// NewDeleteCustomerSupportRemark creates a new http.Handler for the delete customer support remark operation +func NewDeleteCustomerSupportRemark(ctx *middleware.Context, handler DeleteCustomerSupportRemarkHandler) *DeleteCustomerSupportRemark { + return &DeleteCustomerSupportRemark{Context: ctx, Handler: handler} +} + +/* + DeleteCustomerSupportRemark swagger:route DELETE /customer-support-remarks/{customerSupportRemarkID} customerSupportRemarks deleteCustomerSupportRemark + +# Soft deletes a customer support remark by ID + +Soft deletes a customer support remark by ID +*/ +type DeleteCustomerSupportRemark struct { + Context *middleware.Context + Handler DeleteCustomerSupportRemarkHandler +} + +func (o *DeleteCustomerSupportRemark) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteCustomerSupportRemarkParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go new file mode 100644 index 00000000000..97d6230ff57 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteCustomerSupportRemarkParams creates a new DeleteCustomerSupportRemarkParams object +// +// There are no default values defined in the spec. +func NewDeleteCustomerSupportRemarkParams() DeleteCustomerSupportRemarkParams { + + return DeleteCustomerSupportRemarkParams{} +} + +// DeleteCustomerSupportRemarkParams contains all the bound params for the delete customer support remark operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteCustomerSupportRemark +type DeleteCustomerSupportRemarkParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the customer support remark ID to be modified + Required: true + In: path + */ + CustomerSupportRemarkID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteCustomerSupportRemarkParams() beforehand. +func (o *DeleteCustomerSupportRemarkParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, _ := route.Params.GetOK("customerSupportRemarkID") + if err := o.bindCustomerSupportRemarkID(rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindCustomerSupportRemarkID binds and validates parameter CustomerSupportRemarkID from path. +func (o *DeleteCustomerSupportRemarkParams) bindCustomerSupportRemarkID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("customerSupportRemarkID", "path", "strfmt.UUID", raw) + } + o.CustomerSupportRemarkID = *(value.(*strfmt.UUID)) + + if err := o.validateCustomerSupportRemarkID(formats); err != nil { + return err + } + + return nil +} + +// validateCustomerSupportRemarkID carries on validations for parameter CustomerSupportRemarkID +func (o *DeleteCustomerSupportRemarkParams) validateCustomerSupportRemarkID(formats strfmt.Registry) error { + + if err := validate.FormatOf("customerSupportRemarkID", "path", "uuid", o.CustomerSupportRemarkID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go new file mode 100644 index 00000000000..5152215d37b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DeleteCustomerSupportRemarkNoContentCode is the HTTP code returned for type DeleteCustomerSupportRemarkNoContent +const DeleteCustomerSupportRemarkNoContentCode int = 204 + +/* +DeleteCustomerSupportRemarkNoContent Successfully soft deleted the shipment + +swagger:response deleteCustomerSupportRemarkNoContent +*/ +type DeleteCustomerSupportRemarkNoContent struct { +} + +// NewDeleteCustomerSupportRemarkNoContent creates DeleteCustomerSupportRemarkNoContent with default headers values +func NewDeleteCustomerSupportRemarkNoContent() *DeleteCustomerSupportRemarkNoContent { + + return &DeleteCustomerSupportRemarkNoContent{} +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteCustomerSupportRemarkBadRequestCode is the HTTP code returned for type DeleteCustomerSupportRemarkBadRequest +const DeleteCustomerSupportRemarkBadRequestCode int = 400 + +/* +DeleteCustomerSupportRemarkBadRequest The request payload is invalid + +swagger:response deleteCustomerSupportRemarkBadRequest +*/ +type DeleteCustomerSupportRemarkBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkBadRequest creates DeleteCustomerSupportRemarkBadRequest with default headers values +func NewDeleteCustomerSupportRemarkBadRequest() *DeleteCustomerSupportRemarkBadRequest { + + return &DeleteCustomerSupportRemarkBadRequest{} +} + +// WithPayload adds the payload to the delete customer support remark bad request response +func (o *DeleteCustomerSupportRemarkBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark bad request response +func (o *DeleteCustomerSupportRemarkBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteCustomerSupportRemarkForbiddenCode is the HTTP code returned for type DeleteCustomerSupportRemarkForbidden +const DeleteCustomerSupportRemarkForbiddenCode int = 403 + +/* +DeleteCustomerSupportRemarkForbidden The request was denied + +swagger:response deleteCustomerSupportRemarkForbidden +*/ +type DeleteCustomerSupportRemarkForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkForbidden creates DeleteCustomerSupportRemarkForbidden with default headers values +func NewDeleteCustomerSupportRemarkForbidden() *DeleteCustomerSupportRemarkForbidden { + + return &DeleteCustomerSupportRemarkForbidden{} +} + +// WithPayload adds the payload to the delete customer support remark forbidden response +func (o *DeleteCustomerSupportRemarkForbidden) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark forbidden response +func (o *DeleteCustomerSupportRemarkForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteCustomerSupportRemarkNotFoundCode is the HTTP code returned for type DeleteCustomerSupportRemarkNotFound +const DeleteCustomerSupportRemarkNotFoundCode int = 404 + +/* +DeleteCustomerSupportRemarkNotFound The requested resource wasn't found + +swagger:response deleteCustomerSupportRemarkNotFound +*/ +type DeleteCustomerSupportRemarkNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkNotFound creates DeleteCustomerSupportRemarkNotFound with default headers values +func NewDeleteCustomerSupportRemarkNotFound() *DeleteCustomerSupportRemarkNotFound { + + return &DeleteCustomerSupportRemarkNotFound{} +} + +// WithPayload adds the payload to the delete customer support remark not found response +func (o *DeleteCustomerSupportRemarkNotFound) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark not found response +func (o *DeleteCustomerSupportRemarkNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteCustomerSupportRemarkConflictCode is the HTTP code returned for type DeleteCustomerSupportRemarkConflict +const DeleteCustomerSupportRemarkConflictCode int = 409 + +/* +DeleteCustomerSupportRemarkConflict Conflict error + +swagger:response deleteCustomerSupportRemarkConflict +*/ +type DeleteCustomerSupportRemarkConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkConflict creates DeleteCustomerSupportRemarkConflict with default headers values +func NewDeleteCustomerSupportRemarkConflict() *DeleteCustomerSupportRemarkConflict { + + return &DeleteCustomerSupportRemarkConflict{} +} + +// WithPayload adds the payload to the delete customer support remark conflict response +func (o *DeleteCustomerSupportRemarkConflict) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark conflict response +func (o *DeleteCustomerSupportRemarkConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteCustomerSupportRemarkUnprocessableEntityCode is the HTTP code returned for type DeleteCustomerSupportRemarkUnprocessableEntity +const DeleteCustomerSupportRemarkUnprocessableEntityCode int = 422 + +/* +DeleteCustomerSupportRemarkUnprocessableEntity The payload was unprocessable. + +swagger:response deleteCustomerSupportRemarkUnprocessableEntity +*/ +type DeleteCustomerSupportRemarkUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkUnprocessableEntity creates DeleteCustomerSupportRemarkUnprocessableEntity with default headers values +func NewDeleteCustomerSupportRemarkUnprocessableEntity() *DeleteCustomerSupportRemarkUnprocessableEntity { + + return &DeleteCustomerSupportRemarkUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete customer support remark unprocessable entity response +func (o *DeleteCustomerSupportRemarkUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteCustomerSupportRemarkUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark unprocessable entity response +func (o *DeleteCustomerSupportRemarkUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteCustomerSupportRemarkInternalServerErrorCode is the HTTP code returned for type DeleteCustomerSupportRemarkInternalServerError +const DeleteCustomerSupportRemarkInternalServerErrorCode int = 500 + +/* +DeleteCustomerSupportRemarkInternalServerError A server error occurred + +swagger:response deleteCustomerSupportRemarkInternalServerError +*/ +type DeleteCustomerSupportRemarkInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteCustomerSupportRemarkInternalServerError creates DeleteCustomerSupportRemarkInternalServerError with default headers values +func NewDeleteCustomerSupportRemarkInternalServerError() *DeleteCustomerSupportRemarkInternalServerError { + + return &DeleteCustomerSupportRemarkInternalServerError{} +} + +// WithPayload adds the payload to the delete customer support remark internal server error response +func (o *DeleteCustomerSupportRemarkInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteCustomerSupportRemarkInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete customer support remark internal server error response +func (o *DeleteCustomerSupportRemarkInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteCustomerSupportRemarkInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go new file mode 100644 index 00000000000..591af7abaa6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/delete_customer_support_remark_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteCustomerSupportRemarkURL generates an URL for the delete customer support remark operation +type DeleteCustomerSupportRemarkURL struct { + CustomerSupportRemarkID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteCustomerSupportRemarkURL) WithBasePath(bp string) *DeleteCustomerSupportRemarkURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteCustomerSupportRemarkURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteCustomerSupportRemarkURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer-support-remarks/{customerSupportRemarkID}" + + customerSupportRemarkID := o.CustomerSupportRemarkID.String() + if customerSupportRemarkID != "" { + _path = strings.Replace(_path, "{customerSupportRemarkID}", customerSupportRemarkID, -1) + } else { + return nil, errors.New("customerSupportRemarkId is required on DeleteCustomerSupportRemarkURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteCustomerSupportRemarkURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteCustomerSupportRemarkURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteCustomerSupportRemarkURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteCustomerSupportRemarkURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteCustomerSupportRemarkURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteCustomerSupportRemarkURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go new file mode 100644 index 00000000000..f0bd4560481 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetCustomerSupportRemarksForMoveHandlerFunc turns a function with the right signature into a get customer support remarks for move handler +type GetCustomerSupportRemarksForMoveHandlerFunc func(GetCustomerSupportRemarksForMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetCustomerSupportRemarksForMoveHandlerFunc) Handle(params GetCustomerSupportRemarksForMoveParams) middleware.Responder { + return fn(params) +} + +// GetCustomerSupportRemarksForMoveHandler interface for that can handle valid get customer support remarks for move params +type GetCustomerSupportRemarksForMoveHandler interface { + Handle(GetCustomerSupportRemarksForMoveParams) middleware.Responder +} + +// NewGetCustomerSupportRemarksForMove creates a new http.Handler for the get customer support remarks for move operation +func NewGetCustomerSupportRemarksForMove(ctx *middleware.Context, handler GetCustomerSupportRemarksForMoveHandler) *GetCustomerSupportRemarksForMove { + return &GetCustomerSupportRemarksForMove{Context: ctx, Handler: handler} +} + +/* + GetCustomerSupportRemarksForMove swagger:route GET /moves/{locator}/customer-support-remarks customerSupportRemarks getCustomerSupportRemarksForMove + +Fetches customer support remarks using the move code (locator). + +Fetches customer support remarks for a move +*/ +type GetCustomerSupportRemarksForMove struct { + Context *middleware.Context + Handler GetCustomerSupportRemarksForMoveHandler +} + +func (o *GetCustomerSupportRemarksForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetCustomerSupportRemarksForMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go new file mode 100644 index 00000000000..626a4fb8b99 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetCustomerSupportRemarksForMoveParams creates a new GetCustomerSupportRemarksForMoveParams object +// +// There are no default values defined in the spec. +func NewGetCustomerSupportRemarksForMoveParams() GetCustomerSupportRemarksForMoveParams { + + return GetCustomerSupportRemarksForMoveParams{} +} + +// GetCustomerSupportRemarksForMoveParams contains all the bound params for the get customer support remarks for move operation +// typically these are obtained from a http.Request +// +// swagger:parameters getCustomerSupportRemarksForMove +type GetCustomerSupportRemarksForMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*move code to identify a move for customer support remarks + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetCustomerSupportRemarksForMoveParams() beforehand. +func (o *GetCustomerSupportRemarksForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *GetCustomerSupportRemarksForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go new file mode 100644 index 00000000000..cf6db5b9820 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetCustomerSupportRemarksForMoveOKCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveOK +const GetCustomerSupportRemarksForMoveOKCode int = 200 + +/* +GetCustomerSupportRemarksForMoveOK Successfully retrieved all line items for a move task order + +swagger:response getCustomerSupportRemarksForMoveOK +*/ +type GetCustomerSupportRemarksForMoveOK struct { + + /* + In: Body + */ + Payload ghcmessages.CustomerSupportRemarks `json:"body,omitempty"` +} + +// NewGetCustomerSupportRemarksForMoveOK creates GetCustomerSupportRemarksForMoveOK with default headers values +func NewGetCustomerSupportRemarksForMoveOK() *GetCustomerSupportRemarksForMoveOK { + + return &GetCustomerSupportRemarksForMoveOK{} +} + +// WithPayload adds the payload to the get customer support remarks for move o k response +func (o *GetCustomerSupportRemarksForMoveOK) WithPayload(payload ghcmessages.CustomerSupportRemarks) *GetCustomerSupportRemarksForMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer support remarks for move o k response +func (o *GetCustomerSupportRemarksForMoveOK) SetPayload(payload ghcmessages.CustomerSupportRemarks) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerSupportRemarksForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.CustomerSupportRemarks{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetCustomerSupportRemarksForMoveForbiddenCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveForbidden +const GetCustomerSupportRemarksForMoveForbiddenCode int = 403 + +/* +GetCustomerSupportRemarksForMoveForbidden The request was denied + +swagger:response getCustomerSupportRemarksForMoveForbidden +*/ +type GetCustomerSupportRemarksForMoveForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerSupportRemarksForMoveForbidden creates GetCustomerSupportRemarksForMoveForbidden with default headers values +func NewGetCustomerSupportRemarksForMoveForbidden() *GetCustomerSupportRemarksForMoveForbidden { + + return &GetCustomerSupportRemarksForMoveForbidden{} +} + +// WithPayload adds the payload to the get customer support remarks for move forbidden response +func (o *GetCustomerSupportRemarksForMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer support remarks for move forbidden response +func (o *GetCustomerSupportRemarksForMoveForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerSupportRemarksForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerSupportRemarksForMoveNotFoundCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveNotFound +const GetCustomerSupportRemarksForMoveNotFoundCode int = 404 + +/* +GetCustomerSupportRemarksForMoveNotFound The requested resource wasn't found + +swagger:response getCustomerSupportRemarksForMoveNotFound +*/ +type GetCustomerSupportRemarksForMoveNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerSupportRemarksForMoveNotFound creates GetCustomerSupportRemarksForMoveNotFound with default headers values +func NewGetCustomerSupportRemarksForMoveNotFound() *GetCustomerSupportRemarksForMoveNotFound { + + return &GetCustomerSupportRemarksForMoveNotFound{} +} + +// WithPayload adds the payload to the get customer support remarks for move not found response +func (o *GetCustomerSupportRemarksForMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer support remarks for move not found response +func (o *GetCustomerSupportRemarksForMoveNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerSupportRemarksForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerSupportRemarksForMoveUnprocessableEntityCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveUnprocessableEntity +const GetCustomerSupportRemarksForMoveUnprocessableEntityCode int = 422 + +/* +GetCustomerSupportRemarksForMoveUnprocessableEntity The payload was unprocessable. + +swagger:response getCustomerSupportRemarksForMoveUnprocessableEntity +*/ +type GetCustomerSupportRemarksForMoveUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetCustomerSupportRemarksForMoveUnprocessableEntity creates GetCustomerSupportRemarksForMoveUnprocessableEntity with default headers values +func NewGetCustomerSupportRemarksForMoveUnprocessableEntity() *GetCustomerSupportRemarksForMoveUnprocessableEntity { + + return &GetCustomerSupportRemarksForMoveUnprocessableEntity{} +} + +// WithPayload adds the payload to the get customer support remarks for move unprocessable entity response +func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetCustomerSupportRemarksForMoveUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer support remarks for move unprocessable entity response +func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerSupportRemarksForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetCustomerSupportRemarksForMoveInternalServerErrorCode is the HTTP code returned for type GetCustomerSupportRemarksForMoveInternalServerError +const GetCustomerSupportRemarksForMoveInternalServerErrorCode int = 500 + +/* +GetCustomerSupportRemarksForMoveInternalServerError A server error occurred + +swagger:response getCustomerSupportRemarksForMoveInternalServerError +*/ +type GetCustomerSupportRemarksForMoveInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetCustomerSupportRemarksForMoveInternalServerError creates GetCustomerSupportRemarksForMoveInternalServerError with default headers values +func NewGetCustomerSupportRemarksForMoveInternalServerError() *GetCustomerSupportRemarksForMoveInternalServerError { + + return &GetCustomerSupportRemarksForMoveInternalServerError{} +} + +// WithPayload adds the payload to the get customer support remarks for move internal server error response +func (o *GetCustomerSupportRemarksForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetCustomerSupportRemarksForMoveInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get customer support remarks for move internal server error response +func (o *GetCustomerSupportRemarksForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetCustomerSupportRemarksForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go new file mode 100644 index 00000000000..b3b97239169 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/get_customer_support_remarks_for_move_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetCustomerSupportRemarksForMoveURL generates an URL for the get customer support remarks for move operation +type GetCustomerSupportRemarksForMoveURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetCustomerSupportRemarksForMoveURL) WithBasePath(bp string) *GetCustomerSupportRemarksForMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetCustomerSupportRemarksForMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetCustomerSupportRemarksForMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/customer-support-remarks" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on GetCustomerSupportRemarksForMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetCustomerSupportRemarksForMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetCustomerSupportRemarksForMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetCustomerSupportRemarksForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetCustomerSupportRemarksForMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetCustomerSupportRemarksForMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetCustomerSupportRemarksForMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go new file mode 100644 index 00000000000..00a99fa2d8a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateCustomerSupportRemarkForMoveHandlerFunc turns a function with the right signature into a update customer support remark for move handler +type UpdateCustomerSupportRemarkForMoveHandlerFunc func(UpdateCustomerSupportRemarkForMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateCustomerSupportRemarkForMoveHandlerFunc) Handle(params UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { + return fn(params) +} + +// UpdateCustomerSupportRemarkForMoveHandler interface for that can handle valid update customer support remark for move params +type UpdateCustomerSupportRemarkForMoveHandler interface { + Handle(UpdateCustomerSupportRemarkForMoveParams) middleware.Responder +} + +// NewUpdateCustomerSupportRemarkForMove creates a new http.Handler for the update customer support remark for move operation +func NewUpdateCustomerSupportRemarkForMove(ctx *middleware.Context, handler UpdateCustomerSupportRemarkForMoveHandler) *UpdateCustomerSupportRemarkForMove { + return &UpdateCustomerSupportRemarkForMove{Context: ctx, Handler: handler} +} + +/* + UpdateCustomerSupportRemarkForMove swagger:route PATCH /customer-support-remarks/{customerSupportRemarkID} customerSupportRemarks updateCustomerSupportRemarkForMove + +# Updates a customer support remark for a move + +Updates a customer support remark for a move +*/ +type UpdateCustomerSupportRemarkForMove struct { + Context *middleware.Context + Handler UpdateCustomerSupportRemarkForMoveHandler +} + +func (o *UpdateCustomerSupportRemarkForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateCustomerSupportRemarkForMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go new file mode 100644 index 00000000000..0b3c6e94676 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateCustomerSupportRemarkForMoveParams creates a new UpdateCustomerSupportRemarkForMoveParams object +// +// There are no default values defined in the spec. +func NewUpdateCustomerSupportRemarkForMoveParams() UpdateCustomerSupportRemarkForMoveParams { + + return UpdateCustomerSupportRemarkForMoveParams{} +} + +// UpdateCustomerSupportRemarkForMoveParams contains all the bound params for the update customer support remark for move operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateCustomerSupportRemarkForMove +type UpdateCustomerSupportRemarkForMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateCustomerSupportRemarkPayload + /*the customer support remark ID to be modified + Required: true + In: path + */ + CustomerSupportRemarkID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateCustomerSupportRemarkForMoveParams() beforehand. +func (o *UpdateCustomerSupportRemarkForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateCustomerSupportRemarkPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, _ := route.Params.GetOK("customerSupportRemarkID") + if err := o.bindCustomerSupportRemarkID(rCustomerSupportRemarkID, rhkCustomerSupportRemarkID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindCustomerSupportRemarkID binds and validates parameter CustomerSupportRemarkID from path. +func (o *UpdateCustomerSupportRemarkForMoveParams) bindCustomerSupportRemarkID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("customerSupportRemarkID", "path", "strfmt.UUID", raw) + } + o.CustomerSupportRemarkID = *(value.(*strfmt.UUID)) + + if err := o.validateCustomerSupportRemarkID(formats); err != nil { + return err + } + + return nil +} + +// validateCustomerSupportRemarkID carries on validations for parameter CustomerSupportRemarkID +func (o *UpdateCustomerSupportRemarkForMoveParams) validateCustomerSupportRemarkID(formats strfmt.Registry) error { + + if err := validate.FormatOf("customerSupportRemarkID", "path", "uuid", o.CustomerSupportRemarkID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go new file mode 100644 index 00000000000..c09f2f3d9f5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateCustomerSupportRemarkForMoveOKCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveOK +const UpdateCustomerSupportRemarkForMoveOKCode int = 200 + +/* +UpdateCustomerSupportRemarkForMoveOK Successfully updated customer support remark + +swagger:response updateCustomerSupportRemarkForMoveOK +*/ +type UpdateCustomerSupportRemarkForMoveOK struct { + + /* + In: Body + */ + Payload *ghcmessages.CustomerSupportRemark `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveOK creates UpdateCustomerSupportRemarkForMoveOK with default headers values +func NewUpdateCustomerSupportRemarkForMoveOK() *UpdateCustomerSupportRemarkForMoveOK { + + return &UpdateCustomerSupportRemarkForMoveOK{} +} + +// WithPayload adds the payload to the update customer support remark for move o k response +func (o *UpdateCustomerSupportRemarkForMoveOK) WithPayload(payload *ghcmessages.CustomerSupportRemark) *UpdateCustomerSupportRemarkForMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move o k response +func (o *UpdateCustomerSupportRemarkForMoveOK) SetPayload(payload *ghcmessages.CustomerSupportRemark) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerSupportRemarkForMoveBadRequestCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveBadRequest +const UpdateCustomerSupportRemarkForMoveBadRequestCode int = 400 + +/* +UpdateCustomerSupportRemarkForMoveBadRequest The request payload is invalid + +swagger:response updateCustomerSupportRemarkForMoveBadRequest +*/ +type UpdateCustomerSupportRemarkForMoveBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveBadRequest creates UpdateCustomerSupportRemarkForMoveBadRequest with default headers values +func NewUpdateCustomerSupportRemarkForMoveBadRequest() *UpdateCustomerSupportRemarkForMoveBadRequest { + + return &UpdateCustomerSupportRemarkForMoveBadRequest{} +} + +// WithPayload adds the payload to the update customer support remark for move bad request response +func (o *UpdateCustomerSupportRemarkForMoveBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move bad request response +func (o *UpdateCustomerSupportRemarkForMoveBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerSupportRemarkForMoveForbiddenCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveForbidden +const UpdateCustomerSupportRemarkForMoveForbiddenCode int = 403 + +/* +UpdateCustomerSupportRemarkForMoveForbidden The request was denied + +swagger:response updateCustomerSupportRemarkForMoveForbidden +*/ +type UpdateCustomerSupportRemarkForMoveForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveForbidden creates UpdateCustomerSupportRemarkForMoveForbidden with default headers values +func NewUpdateCustomerSupportRemarkForMoveForbidden() *UpdateCustomerSupportRemarkForMoveForbidden { + + return &UpdateCustomerSupportRemarkForMoveForbidden{} +} + +// WithPayload adds the payload to the update customer support remark for move forbidden response +func (o *UpdateCustomerSupportRemarkForMoveForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move forbidden response +func (o *UpdateCustomerSupportRemarkForMoveForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerSupportRemarkForMoveNotFoundCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveNotFound +const UpdateCustomerSupportRemarkForMoveNotFoundCode int = 404 + +/* +UpdateCustomerSupportRemarkForMoveNotFound The requested resource wasn't found + +swagger:response updateCustomerSupportRemarkForMoveNotFound +*/ +type UpdateCustomerSupportRemarkForMoveNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveNotFound creates UpdateCustomerSupportRemarkForMoveNotFound with default headers values +func NewUpdateCustomerSupportRemarkForMoveNotFound() *UpdateCustomerSupportRemarkForMoveNotFound { + + return &UpdateCustomerSupportRemarkForMoveNotFound{} +} + +// WithPayload adds the payload to the update customer support remark for move not found response +func (o *UpdateCustomerSupportRemarkForMoveNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move not found response +func (o *UpdateCustomerSupportRemarkForMoveNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerSupportRemarkForMoveUnprocessableEntityCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveUnprocessableEntity +const UpdateCustomerSupportRemarkForMoveUnprocessableEntityCode int = 422 + +/* +UpdateCustomerSupportRemarkForMoveUnprocessableEntity The payload was unprocessable. + +swagger:response updateCustomerSupportRemarkForMoveUnprocessableEntity +*/ +type UpdateCustomerSupportRemarkForMoveUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveUnprocessableEntity creates UpdateCustomerSupportRemarkForMoveUnprocessableEntity with default headers values +func NewUpdateCustomerSupportRemarkForMoveUnprocessableEntity() *UpdateCustomerSupportRemarkForMoveUnprocessableEntity { + + return &UpdateCustomerSupportRemarkForMoveUnprocessableEntity{} +} + +// WithPayload adds the payload to the update customer support remark for move unprocessable entity response +func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCustomerSupportRemarkForMoveUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move unprocessable entity response +func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCustomerSupportRemarkForMoveInternalServerErrorCode is the HTTP code returned for type UpdateCustomerSupportRemarkForMoveInternalServerError +const UpdateCustomerSupportRemarkForMoveInternalServerErrorCode int = 500 + +/* +UpdateCustomerSupportRemarkForMoveInternalServerError A server error occurred + +swagger:response updateCustomerSupportRemarkForMoveInternalServerError +*/ +type UpdateCustomerSupportRemarkForMoveInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCustomerSupportRemarkForMoveInternalServerError creates UpdateCustomerSupportRemarkForMoveInternalServerError with default headers values +func NewUpdateCustomerSupportRemarkForMoveInternalServerError() *UpdateCustomerSupportRemarkForMoveInternalServerError { + + return &UpdateCustomerSupportRemarkForMoveInternalServerError{} +} + +// WithPayload adds the payload to the update customer support remark for move internal server error response +func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCustomerSupportRemarkForMoveInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update customer support remark for move internal server error response +func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCustomerSupportRemarkForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go new file mode 100644 index 00000000000..ca740c07d6c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/customer_support_remarks/update_customer_support_remark_for_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package customer_support_remarks + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateCustomerSupportRemarkForMoveURL generates an URL for the update customer support remark for move operation +type UpdateCustomerSupportRemarkForMoveURL struct { + CustomerSupportRemarkID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCustomerSupportRemarkForMoveURL) WithBasePath(bp string) *UpdateCustomerSupportRemarkForMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCustomerSupportRemarkForMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateCustomerSupportRemarkForMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/customer-support-remarks/{customerSupportRemarkID}" + + customerSupportRemarkID := o.CustomerSupportRemarkID.String() + if customerSupportRemarkID != "" { + _path = strings.Replace(_path, "{customerSupportRemarkID}", customerSupportRemarkID, -1) + } else { + return nil, errors.New("customerSupportRemarkId is required on UpdateCustomerSupportRemarkForMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateCustomerSupportRemarkForMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateCustomerSupportRemarkForMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateCustomerSupportRemarkForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateCustomerSupportRemarkForMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateCustomerSupportRemarkForMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateCustomerSupportRemarkForMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go new file mode 100644 index 00000000000..1712102930a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// AddAppealToSeriousIncidentHandlerFunc turns a function with the right signature into a add appeal to serious incident handler +type AddAppealToSeriousIncidentHandlerFunc func(AddAppealToSeriousIncidentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn AddAppealToSeriousIncidentHandlerFunc) Handle(params AddAppealToSeriousIncidentParams) middleware.Responder { + return fn(params) +} + +// AddAppealToSeriousIncidentHandler interface for that can handle valid add appeal to serious incident params +type AddAppealToSeriousIncidentHandler interface { + Handle(AddAppealToSeriousIncidentParams) middleware.Responder +} + +// NewAddAppealToSeriousIncident creates a new http.Handler for the add appeal to serious incident operation +func NewAddAppealToSeriousIncident(ctx *middleware.Context, handler AddAppealToSeriousIncidentHandler) *AddAppealToSeriousIncident { + return &AddAppealToSeriousIncident{Context: ctx, Handler: handler} +} + +/* + AddAppealToSeriousIncident swagger:route POST /evaluation-reports/{reportID}/appeal/add evaluationReports addAppealToSeriousIncident + +# Adds an appeal to a serious incident on an evaluation report + +Adds an appeal to a serious incident on an evaluation report +*/ +type AddAppealToSeriousIncident struct { + Context *middleware.Context + Handler AddAppealToSeriousIncidentHandler +} + +func (o *AddAppealToSeriousIncident) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewAddAppealToSeriousIncidentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go new file mode 100644 index 00000000000..b06a2628861 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewAddAppealToSeriousIncidentParams creates a new AddAppealToSeriousIncidentParams object +// +// There are no default values defined in the spec. +func NewAddAppealToSeriousIncidentParams() AddAppealToSeriousIncidentParams { + + return AddAppealToSeriousIncidentParams{} +} + +// AddAppealToSeriousIncidentParams contains all the bound params for the add appeal to serious incident operation +// typically these are obtained from a http.Request +// +// swagger:parameters addAppealToSeriousIncident +type AddAppealToSeriousIncidentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.CreateAppeal + /*the evaluation report ID + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewAddAppealToSeriousIncidentParams() beforehand. +func (o *AddAppealToSeriousIncidentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateAppeal + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *AddAppealToSeriousIncidentParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *AddAppealToSeriousIncidentParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go new file mode 100644 index 00000000000..66f46f39b51 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_responses.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// AddAppealToSeriousIncidentNoContentCode is the HTTP code returned for type AddAppealToSeriousIncidentNoContent +const AddAppealToSeriousIncidentNoContentCode int = 204 + +/* +AddAppealToSeriousIncidentNoContent Successfully added an appeal to a serious incident + +swagger:response addAppealToSeriousIncidentNoContent +*/ +type AddAppealToSeriousIncidentNoContent struct { +} + +// NewAddAppealToSeriousIncidentNoContent creates AddAppealToSeriousIncidentNoContent with default headers values +func NewAddAppealToSeriousIncidentNoContent() *AddAppealToSeriousIncidentNoContent { + + return &AddAppealToSeriousIncidentNoContent{} +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// AddAppealToSeriousIncidentForbiddenCode is the HTTP code returned for type AddAppealToSeriousIncidentForbidden +const AddAppealToSeriousIncidentForbiddenCode int = 403 + +/* +AddAppealToSeriousIncidentForbidden The request was denied + +swagger:response addAppealToSeriousIncidentForbidden +*/ +type AddAppealToSeriousIncidentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToSeriousIncidentForbidden creates AddAppealToSeriousIncidentForbidden with default headers values +func NewAddAppealToSeriousIncidentForbidden() *AddAppealToSeriousIncidentForbidden { + + return &AddAppealToSeriousIncidentForbidden{} +} + +// WithPayload adds the payload to the add appeal to serious incident forbidden response +func (o *AddAppealToSeriousIncidentForbidden) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to serious incident forbidden response +func (o *AddAppealToSeriousIncidentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToSeriousIncidentNotFoundCode is the HTTP code returned for type AddAppealToSeriousIncidentNotFound +const AddAppealToSeriousIncidentNotFoundCode int = 404 + +/* +AddAppealToSeriousIncidentNotFound The requested resource wasn't found + +swagger:response addAppealToSeriousIncidentNotFound +*/ +type AddAppealToSeriousIncidentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToSeriousIncidentNotFound creates AddAppealToSeriousIncidentNotFound with default headers values +func NewAddAppealToSeriousIncidentNotFound() *AddAppealToSeriousIncidentNotFound { + + return &AddAppealToSeriousIncidentNotFound{} +} + +// WithPayload adds the payload to the add appeal to serious incident not found response +func (o *AddAppealToSeriousIncidentNotFound) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to serious incident not found response +func (o *AddAppealToSeriousIncidentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToSeriousIncidentPreconditionFailedCode is the HTTP code returned for type AddAppealToSeriousIncidentPreconditionFailed +const AddAppealToSeriousIncidentPreconditionFailedCode int = 412 + +/* +AddAppealToSeriousIncidentPreconditionFailed Precondition failed + +swagger:response addAppealToSeriousIncidentPreconditionFailed +*/ +type AddAppealToSeriousIncidentPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToSeriousIncidentPreconditionFailed creates AddAppealToSeriousIncidentPreconditionFailed with default headers values +func NewAddAppealToSeriousIncidentPreconditionFailed() *AddAppealToSeriousIncidentPreconditionFailed { + + return &AddAppealToSeriousIncidentPreconditionFailed{} +} + +// WithPayload adds the payload to the add appeal to serious incident precondition failed response +func (o *AddAppealToSeriousIncidentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to serious incident precondition failed response +func (o *AddAppealToSeriousIncidentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToSeriousIncidentUnprocessableEntityCode is the HTTP code returned for type AddAppealToSeriousIncidentUnprocessableEntity +const AddAppealToSeriousIncidentUnprocessableEntityCode int = 422 + +/* +AddAppealToSeriousIncidentUnprocessableEntity The payload was unprocessable. + +swagger:response addAppealToSeriousIncidentUnprocessableEntity +*/ +type AddAppealToSeriousIncidentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewAddAppealToSeriousIncidentUnprocessableEntity creates AddAppealToSeriousIncidentUnprocessableEntity with default headers values +func NewAddAppealToSeriousIncidentUnprocessableEntity() *AddAppealToSeriousIncidentUnprocessableEntity { + + return &AddAppealToSeriousIncidentUnprocessableEntity{} +} + +// WithPayload adds the payload to the add appeal to serious incident unprocessable entity response +func (o *AddAppealToSeriousIncidentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AddAppealToSeriousIncidentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to serious incident unprocessable entity response +func (o *AddAppealToSeriousIncidentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToSeriousIncidentInternalServerErrorCode is the HTTP code returned for type AddAppealToSeriousIncidentInternalServerError +const AddAppealToSeriousIncidentInternalServerErrorCode int = 500 + +/* +AddAppealToSeriousIncidentInternalServerError A server error occurred + +swagger:response addAppealToSeriousIncidentInternalServerError +*/ +type AddAppealToSeriousIncidentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToSeriousIncidentInternalServerError creates AddAppealToSeriousIncidentInternalServerError with default headers values +func NewAddAppealToSeriousIncidentInternalServerError() *AddAppealToSeriousIncidentInternalServerError { + + return &AddAppealToSeriousIncidentInternalServerError{} +} + +// WithPayload adds the payload to the add appeal to serious incident internal server error response +func (o *AddAppealToSeriousIncidentInternalServerError) WithPayload(payload *ghcmessages.Error) *AddAppealToSeriousIncidentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to serious incident internal server error response +func (o *AddAppealToSeriousIncidentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToSeriousIncidentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go new file mode 100644 index 00000000000..37603d65430 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_serious_incident_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// AddAppealToSeriousIncidentURL generates an URL for the add appeal to serious incident operation +type AddAppealToSeriousIncidentURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AddAppealToSeriousIncidentURL) WithBasePath(bp string) *AddAppealToSeriousIncidentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AddAppealToSeriousIncidentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *AddAppealToSeriousIncidentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}/appeal/add" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on AddAppealToSeriousIncidentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *AddAppealToSeriousIncidentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *AddAppealToSeriousIncidentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *AddAppealToSeriousIncidentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on AddAppealToSeriousIncidentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on AddAppealToSeriousIncidentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *AddAppealToSeriousIncidentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go new file mode 100644 index 00000000000..aab72a39edd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// AddAppealToViolationHandlerFunc turns a function with the right signature into a add appeal to violation handler +type AddAppealToViolationHandlerFunc func(AddAppealToViolationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn AddAppealToViolationHandlerFunc) Handle(params AddAppealToViolationParams) middleware.Responder { + return fn(params) +} + +// AddAppealToViolationHandler interface for that can handle valid add appeal to violation params +type AddAppealToViolationHandler interface { + Handle(AddAppealToViolationParams) middleware.Responder +} + +// NewAddAppealToViolation creates a new http.Handler for the add appeal to violation operation +func NewAddAppealToViolation(ctx *middleware.Context, handler AddAppealToViolationHandler) *AddAppealToViolation { + return &AddAppealToViolation{Context: ctx, Handler: handler} +} + +/* + AddAppealToViolation swagger:route POST /evaluation-reports/{reportID}/{reportViolationID}/appeal/add evaluationReports addAppealToViolation + +# Adds an appeal to a violation + +Adds an appeal to a violation +*/ +type AddAppealToViolation struct { + Context *middleware.Context + Handler AddAppealToViolationHandler +} + +func (o *AddAppealToViolation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewAddAppealToViolationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go new file mode 100644 index 00000000000..b05a333396d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_parameters.go @@ -0,0 +1,163 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewAddAppealToViolationParams creates a new AddAppealToViolationParams object +// +// There are no default values defined in the spec. +func NewAddAppealToViolationParams() AddAppealToViolationParams { + + return AddAppealToViolationParams{} +} + +// AddAppealToViolationParams contains all the bound params for the add appeal to violation operation +// typically these are obtained from a http.Request +// +// swagger:parameters addAppealToViolation +type AddAppealToViolationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.CreateAppeal + /*the evaluation report ID + Required: true + In: path + */ + ReportID strfmt.UUID + /*the report violation ID + Required: true + In: path + */ + ReportViolationID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewAddAppealToViolationParams() beforehand. +func (o *AddAppealToViolationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateAppeal + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + + rReportViolationID, rhkReportViolationID, _ := route.Params.GetOK("reportViolationID") + if err := o.bindReportViolationID(rReportViolationID, rhkReportViolationID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *AddAppealToViolationParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *AddAppealToViolationParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} + +// bindReportViolationID binds and validates parameter ReportViolationID from path. +func (o *AddAppealToViolationParams) bindReportViolationID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportViolationID", "path", "strfmt.UUID", raw) + } + o.ReportViolationID = *(value.(*strfmt.UUID)) + + if err := o.validateReportViolationID(formats); err != nil { + return err + } + + return nil +} + +// validateReportViolationID carries on validations for parameter ReportViolationID +func (o *AddAppealToViolationParams) validateReportViolationID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportViolationID", "path", "uuid", o.ReportViolationID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go new file mode 100644 index 00000000000..b140b2844cf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_responses.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// AddAppealToViolationNoContentCode is the HTTP code returned for type AddAppealToViolationNoContent +const AddAppealToViolationNoContentCode int = 204 + +/* +AddAppealToViolationNoContent Successfully added an appeal to a violation + +swagger:response addAppealToViolationNoContent +*/ +type AddAppealToViolationNoContent struct { +} + +// NewAddAppealToViolationNoContent creates AddAppealToViolationNoContent with default headers values +func NewAddAppealToViolationNoContent() *AddAppealToViolationNoContent { + + return &AddAppealToViolationNoContent{} +} + +// WriteResponse to the client +func (o *AddAppealToViolationNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// AddAppealToViolationForbiddenCode is the HTTP code returned for type AddAppealToViolationForbidden +const AddAppealToViolationForbiddenCode int = 403 + +/* +AddAppealToViolationForbidden The request was denied + +swagger:response addAppealToViolationForbidden +*/ +type AddAppealToViolationForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToViolationForbidden creates AddAppealToViolationForbidden with default headers values +func NewAddAppealToViolationForbidden() *AddAppealToViolationForbidden { + + return &AddAppealToViolationForbidden{} +} + +// WithPayload adds the payload to the add appeal to violation forbidden response +func (o *AddAppealToViolationForbidden) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to violation forbidden response +func (o *AddAppealToViolationForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToViolationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToViolationNotFoundCode is the HTTP code returned for type AddAppealToViolationNotFound +const AddAppealToViolationNotFoundCode int = 404 + +/* +AddAppealToViolationNotFound The requested resource wasn't found + +swagger:response addAppealToViolationNotFound +*/ +type AddAppealToViolationNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToViolationNotFound creates AddAppealToViolationNotFound with default headers values +func NewAddAppealToViolationNotFound() *AddAppealToViolationNotFound { + + return &AddAppealToViolationNotFound{} +} + +// WithPayload adds the payload to the add appeal to violation not found response +func (o *AddAppealToViolationNotFound) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to violation not found response +func (o *AddAppealToViolationNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToViolationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToViolationPreconditionFailedCode is the HTTP code returned for type AddAppealToViolationPreconditionFailed +const AddAppealToViolationPreconditionFailedCode int = 412 + +/* +AddAppealToViolationPreconditionFailed Precondition failed + +swagger:response addAppealToViolationPreconditionFailed +*/ +type AddAppealToViolationPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToViolationPreconditionFailed creates AddAppealToViolationPreconditionFailed with default headers values +func NewAddAppealToViolationPreconditionFailed() *AddAppealToViolationPreconditionFailed { + + return &AddAppealToViolationPreconditionFailed{} +} + +// WithPayload adds the payload to the add appeal to violation precondition failed response +func (o *AddAppealToViolationPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to violation precondition failed response +func (o *AddAppealToViolationPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToViolationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToViolationUnprocessableEntityCode is the HTTP code returned for type AddAppealToViolationUnprocessableEntity +const AddAppealToViolationUnprocessableEntityCode int = 422 + +/* +AddAppealToViolationUnprocessableEntity The payload was unprocessable. + +swagger:response addAppealToViolationUnprocessableEntity +*/ +type AddAppealToViolationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewAddAppealToViolationUnprocessableEntity creates AddAppealToViolationUnprocessableEntity with default headers values +func NewAddAppealToViolationUnprocessableEntity() *AddAppealToViolationUnprocessableEntity { + + return &AddAppealToViolationUnprocessableEntity{} +} + +// WithPayload adds the payload to the add appeal to violation unprocessable entity response +func (o *AddAppealToViolationUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AddAppealToViolationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to violation unprocessable entity response +func (o *AddAppealToViolationUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToViolationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AddAppealToViolationInternalServerErrorCode is the HTTP code returned for type AddAppealToViolationInternalServerError +const AddAppealToViolationInternalServerErrorCode int = 500 + +/* +AddAppealToViolationInternalServerError A server error occurred + +swagger:response addAppealToViolationInternalServerError +*/ +type AddAppealToViolationInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAddAppealToViolationInternalServerError creates AddAppealToViolationInternalServerError with default headers values +func NewAddAppealToViolationInternalServerError() *AddAppealToViolationInternalServerError { + + return &AddAppealToViolationInternalServerError{} +} + +// WithPayload adds the payload to the add appeal to violation internal server error response +func (o *AddAppealToViolationInternalServerError) WithPayload(payload *ghcmessages.Error) *AddAppealToViolationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the add appeal to violation internal server error response +func (o *AddAppealToViolationInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AddAppealToViolationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go new file mode 100644 index 00000000000..b273a73e8df --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/add_appeal_to_violation_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// AddAppealToViolationURL generates an URL for the add appeal to violation operation +type AddAppealToViolationURL struct { + ReportID strfmt.UUID + ReportViolationID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AddAppealToViolationURL) WithBasePath(bp string) *AddAppealToViolationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AddAppealToViolationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *AddAppealToViolationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on AddAppealToViolationURL") + } + + reportViolationID := o.ReportViolationID.String() + if reportViolationID != "" { + _path = strings.Replace(_path, "{reportViolationID}", reportViolationID, -1) + } else { + return nil, errors.New("reportViolationId is required on AddAppealToViolationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *AddAppealToViolationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *AddAppealToViolationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *AddAppealToViolationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on AddAppealToViolationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on AddAppealToViolationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *AddAppealToViolationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go new file mode 100644 index 00000000000..9a14099b789 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateEvaluationReportHandlerFunc turns a function with the right signature into a create evaluation report handler +type CreateEvaluationReportHandlerFunc func(CreateEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateEvaluationReportHandlerFunc) Handle(params CreateEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// CreateEvaluationReportHandler interface for that can handle valid create evaluation report params +type CreateEvaluationReportHandler interface { + Handle(CreateEvaluationReportParams) middleware.Responder +} + +// NewCreateEvaluationReport creates a new http.Handler for the create evaluation report operation +func NewCreateEvaluationReport(ctx *middleware.Context, handler CreateEvaluationReportHandler) *CreateEvaluationReport { + return &CreateEvaluationReport{Context: ctx, Handler: handler} +} + +/* + CreateEvaluationReport swagger:route POST /moves/{locator}/evaluation-reports evaluationReports createEvaluationReport + +# Creates an evaluation report + +Creates an evaluation report +*/ +type CreateEvaluationReport struct { + Context *middleware.Context + Handler CreateEvaluationReportHandler +} + +func (o *CreateEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go new file mode 100644 index 00000000000..dee804fe213 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateEvaluationReportParams creates a new CreateEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewCreateEvaluationReportParams() CreateEvaluationReportParams { + + return CreateEvaluationReportParams{} +} + +// CreateEvaluationReportParams contains all the bound params for the create evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters createEvaluationReport +type CreateEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.CreateEvaluationReport + /* + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateEvaluationReportParams() beforehand. +func (o *CreateEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateEvaluationReport + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *CreateEvaluationReportParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go new file mode 100644 index 00000000000..5c6ae5b87a0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateEvaluationReportOKCode is the HTTP code returned for type CreateEvaluationReportOK +const CreateEvaluationReportOKCode int = 200 + +/* +CreateEvaluationReportOK Successfully created evaluation report + +swagger:response createEvaluationReportOK +*/ +type CreateEvaluationReportOK struct { + + /* + In: Body + */ + Payload *ghcmessages.EvaluationReport `json:"body,omitempty"` +} + +// NewCreateEvaluationReportOK creates CreateEvaluationReportOK with default headers values +func NewCreateEvaluationReportOK() *CreateEvaluationReportOK { + + return &CreateEvaluationReportOK{} +} + +// WithPayload adds the payload to the create evaluation report o k response +func (o *CreateEvaluationReportOK) WithPayload(payload *ghcmessages.EvaluationReport) *CreateEvaluationReportOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create evaluation report o k response +func (o *CreateEvaluationReportOK) SetPayload(payload *ghcmessages.EvaluationReport) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateEvaluationReportBadRequestCode is the HTTP code returned for type CreateEvaluationReportBadRequest +const CreateEvaluationReportBadRequestCode int = 400 + +/* +CreateEvaluationReportBadRequest The request payload is invalid + +swagger:response createEvaluationReportBadRequest +*/ +type CreateEvaluationReportBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateEvaluationReportBadRequest creates CreateEvaluationReportBadRequest with default headers values +func NewCreateEvaluationReportBadRequest() *CreateEvaluationReportBadRequest { + + return &CreateEvaluationReportBadRequest{} +} + +// WithPayload adds the payload to the create evaluation report bad request response +func (o *CreateEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create evaluation report bad request response +func (o *CreateEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateEvaluationReportNotFoundCode is the HTTP code returned for type CreateEvaluationReportNotFound +const CreateEvaluationReportNotFoundCode int = 404 + +/* +CreateEvaluationReportNotFound The requested resource wasn't found + +swagger:response createEvaluationReportNotFound +*/ +type CreateEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateEvaluationReportNotFound creates CreateEvaluationReportNotFound with default headers values +func NewCreateEvaluationReportNotFound() *CreateEvaluationReportNotFound { + + return &CreateEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the create evaluation report not found response +func (o *CreateEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create evaluation report not found response +func (o *CreateEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateEvaluationReportUnprocessableEntityCode is the HTTP code returned for type CreateEvaluationReportUnprocessableEntity +const CreateEvaluationReportUnprocessableEntityCode int = 422 + +/* +CreateEvaluationReportUnprocessableEntity The payload was unprocessable. + +swagger:response createEvaluationReportUnprocessableEntity +*/ +type CreateEvaluationReportUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateEvaluationReportUnprocessableEntity creates CreateEvaluationReportUnprocessableEntity with default headers values +func NewCreateEvaluationReportUnprocessableEntity() *CreateEvaluationReportUnprocessableEntity { + + return &CreateEvaluationReportUnprocessableEntity{} +} + +// WithPayload adds the payload to the create evaluation report unprocessable entity response +func (o *CreateEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateEvaluationReportUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create evaluation report unprocessable entity response +func (o *CreateEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateEvaluationReportInternalServerErrorCode is the HTTP code returned for type CreateEvaluationReportInternalServerError +const CreateEvaluationReportInternalServerErrorCode int = 500 + +/* +CreateEvaluationReportInternalServerError A server error occurred + +swagger:response createEvaluationReportInternalServerError +*/ +type CreateEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateEvaluationReportInternalServerError creates CreateEvaluationReportInternalServerError with default headers values +func NewCreateEvaluationReportInternalServerError() *CreateEvaluationReportInternalServerError { + + return &CreateEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the create evaluation report internal server error response +func (o *CreateEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create evaluation report internal server error response +func (o *CreateEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..80fc8ee1af9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/create_evaluation_report_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// CreateEvaluationReportURL generates an URL for the create evaluation report operation +type CreateEvaluationReportURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateEvaluationReportURL) WithBasePath(bp string) *CreateEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/evaluation-reports" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on CreateEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go new file mode 100644 index 00000000000..57f634a8a9a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteEvaluationReportHandlerFunc turns a function with the right signature into a delete evaluation report handler +type DeleteEvaluationReportHandlerFunc func(DeleteEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteEvaluationReportHandlerFunc) Handle(params DeleteEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// DeleteEvaluationReportHandler interface for that can handle valid delete evaluation report params +type DeleteEvaluationReportHandler interface { + Handle(DeleteEvaluationReportParams) middleware.Responder +} + +// NewDeleteEvaluationReport creates a new http.Handler for the delete evaluation report operation +func NewDeleteEvaluationReport(ctx *middleware.Context, handler DeleteEvaluationReportHandler) *DeleteEvaluationReport { + return &DeleteEvaluationReport{Context: ctx, Handler: handler} +} + +/* + DeleteEvaluationReport swagger:route DELETE /evaluation-reports/{reportID} evaluationReports deleteEvaluationReport + +# Deletes an evaluation report by ID + +Deletes an evaluation report by ID +*/ +type DeleteEvaluationReport struct { + Context *middleware.Context + Handler DeleteEvaluationReportHandler +} + +func (o *DeleteEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go new file mode 100644 index 00000000000..58b9cfc12c5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteEvaluationReportParams creates a new DeleteEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewDeleteEvaluationReportParams() DeleteEvaluationReportParams { + + return DeleteEvaluationReportParams{} +} + +// DeleteEvaluationReportParams contains all the bound params for the delete evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteEvaluationReport +type DeleteEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the evaluation report ID to be modified + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteEvaluationReportParams() beforehand. +func (o *DeleteEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *DeleteEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *DeleteEvaluationReportParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go new file mode 100644 index 00000000000..9cbfc739d3c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DeleteEvaluationReportNoContentCode is the HTTP code returned for type DeleteEvaluationReportNoContent +const DeleteEvaluationReportNoContentCode int = 204 + +/* +DeleteEvaluationReportNoContent Successfully deleted the report + +swagger:response deleteEvaluationReportNoContent +*/ +type DeleteEvaluationReportNoContent struct { +} + +// NewDeleteEvaluationReportNoContent creates DeleteEvaluationReportNoContent with default headers values +func NewDeleteEvaluationReportNoContent() *DeleteEvaluationReportNoContent { + + return &DeleteEvaluationReportNoContent{} +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteEvaluationReportBadRequestCode is the HTTP code returned for type DeleteEvaluationReportBadRequest +const DeleteEvaluationReportBadRequestCode int = 400 + +/* +DeleteEvaluationReportBadRequest The request payload is invalid + +swagger:response deleteEvaluationReportBadRequest +*/ +type DeleteEvaluationReportBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportBadRequest creates DeleteEvaluationReportBadRequest with default headers values +func NewDeleteEvaluationReportBadRequest() *DeleteEvaluationReportBadRequest { + + return &DeleteEvaluationReportBadRequest{} +} + +// WithPayload adds the payload to the delete evaluation report bad request response +func (o *DeleteEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report bad request response +func (o *DeleteEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteEvaluationReportForbiddenCode is the HTTP code returned for type DeleteEvaluationReportForbidden +const DeleteEvaluationReportForbiddenCode int = 403 + +/* +DeleteEvaluationReportForbidden The request was denied + +swagger:response deleteEvaluationReportForbidden +*/ +type DeleteEvaluationReportForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportForbidden creates DeleteEvaluationReportForbidden with default headers values +func NewDeleteEvaluationReportForbidden() *DeleteEvaluationReportForbidden { + + return &DeleteEvaluationReportForbidden{} +} + +// WithPayload adds the payload to the delete evaluation report forbidden response +func (o *DeleteEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report forbidden response +func (o *DeleteEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteEvaluationReportNotFoundCode is the HTTP code returned for type DeleteEvaluationReportNotFound +const DeleteEvaluationReportNotFoundCode int = 404 + +/* +DeleteEvaluationReportNotFound The requested resource wasn't found + +swagger:response deleteEvaluationReportNotFound +*/ +type DeleteEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportNotFound creates DeleteEvaluationReportNotFound with default headers values +func NewDeleteEvaluationReportNotFound() *DeleteEvaluationReportNotFound { + + return &DeleteEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the delete evaluation report not found response +func (o *DeleteEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report not found response +func (o *DeleteEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteEvaluationReportConflictCode is the HTTP code returned for type DeleteEvaluationReportConflict +const DeleteEvaluationReportConflictCode int = 409 + +/* +DeleteEvaluationReportConflict Conflict error + +swagger:response deleteEvaluationReportConflict +*/ +type DeleteEvaluationReportConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportConflict creates DeleteEvaluationReportConflict with default headers values +func NewDeleteEvaluationReportConflict() *DeleteEvaluationReportConflict { + + return &DeleteEvaluationReportConflict{} +} + +// WithPayload adds the payload to the delete evaluation report conflict response +func (o *DeleteEvaluationReportConflict) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report conflict response +func (o *DeleteEvaluationReportConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteEvaluationReportUnprocessableEntityCode is the HTTP code returned for type DeleteEvaluationReportUnprocessableEntity +const DeleteEvaluationReportUnprocessableEntityCode int = 422 + +/* +DeleteEvaluationReportUnprocessableEntity The payload was unprocessable. + +swagger:response deleteEvaluationReportUnprocessableEntity +*/ +type DeleteEvaluationReportUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportUnprocessableEntity creates DeleteEvaluationReportUnprocessableEntity with default headers values +func NewDeleteEvaluationReportUnprocessableEntity() *DeleteEvaluationReportUnprocessableEntity { + + return &DeleteEvaluationReportUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete evaluation report unprocessable entity response +func (o *DeleteEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteEvaluationReportUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report unprocessable entity response +func (o *DeleteEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteEvaluationReportInternalServerErrorCode is the HTTP code returned for type DeleteEvaluationReportInternalServerError +const DeleteEvaluationReportInternalServerErrorCode int = 500 + +/* +DeleteEvaluationReportInternalServerError A server error occurred + +swagger:response deleteEvaluationReportInternalServerError +*/ +type DeleteEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteEvaluationReportInternalServerError creates DeleteEvaluationReportInternalServerError with default headers values +func NewDeleteEvaluationReportInternalServerError() *DeleteEvaluationReportInternalServerError { + + return &DeleteEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the delete evaluation report internal server error response +func (o *DeleteEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete evaluation report internal server error response +func (o *DeleteEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..ee442054a61 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/delete_evaluation_report_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteEvaluationReportURL generates an URL for the delete evaluation report operation +type DeleteEvaluationReportURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteEvaluationReportURL) WithBasePath(bp string) *DeleteEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on DeleteEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go new file mode 100644 index 00000000000..8fd37e22cea --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DownloadEvaluationReportHandlerFunc turns a function with the right signature into a download evaluation report handler +type DownloadEvaluationReportHandlerFunc func(DownloadEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DownloadEvaluationReportHandlerFunc) Handle(params DownloadEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// DownloadEvaluationReportHandler interface for that can handle valid download evaluation report params +type DownloadEvaluationReportHandler interface { + Handle(DownloadEvaluationReportParams) middleware.Responder +} + +// NewDownloadEvaluationReport creates a new http.Handler for the download evaluation report operation +func NewDownloadEvaluationReport(ctx *middleware.Context, handler DownloadEvaluationReportHandler) *DownloadEvaluationReport { + return &DownloadEvaluationReport{Context: ctx, Handler: handler} +} + +/* + DownloadEvaluationReport swagger:route GET /evaluation-reports/{reportID}/download evaluationReports downloadEvaluationReport + +# Downloads an evaluation report as a PDF + +Downloads an evaluation report as a PDF +*/ +type DownloadEvaluationReport struct { + Context *middleware.Context + Handler DownloadEvaluationReportHandler +} + +func (o *DownloadEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDownloadEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go new file mode 100644 index 00000000000..0a851e13843 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDownloadEvaluationReportParams creates a new DownloadEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewDownloadEvaluationReportParams() DownloadEvaluationReportParams { + + return DownloadEvaluationReportParams{} +} + +// DownloadEvaluationReportParams contains all the bound params for the download evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters downloadEvaluationReport +type DownloadEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the evaluation report ID to be downloaded + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDownloadEvaluationReportParams() beforehand. +func (o *DownloadEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *DownloadEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *DownloadEvaluationReportParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go new file mode 100644 index 00000000000..c498c89df4c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_responses.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DownloadEvaluationReportOKCode is the HTTP code returned for type DownloadEvaluationReportOK +const DownloadEvaluationReportOKCode int = 200 + +/* +DownloadEvaluationReportOK Evaluation report PDF + +swagger:response downloadEvaluationReportOK +*/ +type DownloadEvaluationReportOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewDownloadEvaluationReportOK creates DownloadEvaluationReportOK with default headers values +func NewDownloadEvaluationReportOK() *DownloadEvaluationReportOK { + + return &DownloadEvaluationReportOK{} +} + +// WithContentDisposition adds the contentDisposition to the download evaluation report o k response +func (o *DownloadEvaluationReportOK) WithContentDisposition(contentDisposition string) *DownloadEvaluationReportOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the download evaluation report o k response +func (o *DownloadEvaluationReportOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the download evaluation report o k response +func (o *DownloadEvaluationReportOK) WithPayload(payload io.ReadCloser) *DownloadEvaluationReportOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download evaluation report o k response +func (o *DownloadEvaluationReportOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// DownloadEvaluationReportForbiddenCode is the HTTP code returned for type DownloadEvaluationReportForbidden +const DownloadEvaluationReportForbiddenCode int = 403 + +/* +DownloadEvaluationReportForbidden The request was denied + +swagger:response downloadEvaluationReportForbidden +*/ +type DownloadEvaluationReportForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDownloadEvaluationReportForbidden creates DownloadEvaluationReportForbidden with default headers values +func NewDownloadEvaluationReportForbidden() *DownloadEvaluationReportForbidden { + + return &DownloadEvaluationReportForbidden{} +} + +// WithPayload adds the payload to the download evaluation report forbidden response +func (o *DownloadEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download evaluation report forbidden response +func (o *DownloadEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadEvaluationReportNotFoundCode is the HTTP code returned for type DownloadEvaluationReportNotFound +const DownloadEvaluationReportNotFoundCode int = 404 + +/* +DownloadEvaluationReportNotFound The requested resource wasn't found + +swagger:response downloadEvaluationReportNotFound +*/ +type DownloadEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDownloadEvaluationReportNotFound creates DownloadEvaluationReportNotFound with default headers values +func NewDownloadEvaluationReportNotFound() *DownloadEvaluationReportNotFound { + + return &DownloadEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the download evaluation report not found response +func (o *DownloadEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download evaluation report not found response +func (o *DownloadEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadEvaluationReportInternalServerErrorCode is the HTTP code returned for type DownloadEvaluationReportInternalServerError +const DownloadEvaluationReportInternalServerErrorCode int = 500 + +/* +DownloadEvaluationReportInternalServerError A server error occurred + +swagger:response downloadEvaluationReportInternalServerError +*/ +type DownloadEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDownloadEvaluationReportInternalServerError creates DownloadEvaluationReportInternalServerError with default headers values +func NewDownloadEvaluationReportInternalServerError() *DownloadEvaluationReportInternalServerError { + + return &DownloadEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the download evaluation report internal server error response +func (o *DownloadEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *DownloadEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download evaluation report internal server error response +func (o *DownloadEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..2526bc4fedf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/download_evaluation_report_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DownloadEvaluationReportURL generates an URL for the download evaluation report operation +type DownloadEvaluationReportURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DownloadEvaluationReportURL) WithBasePath(bp string) *DownloadEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DownloadEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DownloadEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}/download" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on DownloadEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DownloadEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DownloadEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DownloadEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DownloadEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DownloadEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DownloadEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go new file mode 100644 index 00000000000..6f752a077f6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetEvaluationReportHandlerFunc turns a function with the right signature into a get evaluation report handler +type GetEvaluationReportHandlerFunc func(GetEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetEvaluationReportHandlerFunc) Handle(params GetEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// GetEvaluationReportHandler interface for that can handle valid get evaluation report params +type GetEvaluationReportHandler interface { + Handle(GetEvaluationReportParams) middleware.Responder +} + +// NewGetEvaluationReport creates a new http.Handler for the get evaluation report operation +func NewGetEvaluationReport(ctx *middleware.Context, handler GetEvaluationReportHandler) *GetEvaluationReport { + return &GetEvaluationReport{Context: ctx, Handler: handler} +} + +/* + GetEvaluationReport swagger:route GET /evaluation-reports/{reportID} evaluationReports getEvaluationReport + +# Gets an evaluation report by ID + +Gets an evaluation report by ID +*/ +type GetEvaluationReport struct { + Context *middleware.Context + Handler GetEvaluationReportHandler +} + +func (o *GetEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go new file mode 100644 index 00000000000..e1a0cc13052 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetEvaluationReportParams creates a new GetEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewGetEvaluationReportParams() GetEvaluationReportParams { + + return GetEvaluationReportParams{} +} + +// GetEvaluationReportParams contains all the bound params for the get evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters getEvaluationReport +type GetEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the evaluation report ID to be modified + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetEvaluationReportParams() beforehand. +func (o *GetEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *GetEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *GetEvaluationReportParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go new file mode 100644 index 00000000000..b0816c82cbe --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetEvaluationReportOKCode is the HTTP code returned for type GetEvaluationReportOK +const GetEvaluationReportOKCode int = 200 + +/* +GetEvaluationReportOK Successfully got the report + +swagger:response getEvaluationReportOK +*/ +type GetEvaluationReportOK struct { + + /* + In: Body + */ + Payload *ghcmessages.EvaluationReport `json:"body,omitempty"` +} + +// NewGetEvaluationReportOK creates GetEvaluationReportOK with default headers values +func NewGetEvaluationReportOK() *GetEvaluationReportOK { + + return &GetEvaluationReportOK{} +} + +// WithPayload adds the payload to the get evaluation report o k response +func (o *GetEvaluationReportOK) WithPayload(payload *ghcmessages.EvaluationReport) *GetEvaluationReportOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get evaluation report o k response +func (o *GetEvaluationReportOK) SetPayload(payload *ghcmessages.EvaluationReport) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEvaluationReportOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEvaluationReportBadRequestCode is the HTTP code returned for type GetEvaluationReportBadRequest +const GetEvaluationReportBadRequestCode int = 400 + +/* +GetEvaluationReportBadRequest The request payload is invalid + +swagger:response getEvaluationReportBadRequest +*/ +type GetEvaluationReportBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEvaluationReportBadRequest creates GetEvaluationReportBadRequest with default headers values +func NewGetEvaluationReportBadRequest() *GetEvaluationReportBadRequest { + + return &GetEvaluationReportBadRequest{} +} + +// WithPayload adds the payload to the get evaluation report bad request response +func (o *GetEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get evaluation report bad request response +func (o *GetEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEvaluationReportForbiddenCode is the HTTP code returned for type GetEvaluationReportForbidden +const GetEvaluationReportForbiddenCode int = 403 + +/* +GetEvaluationReportForbidden The request was denied + +swagger:response getEvaluationReportForbidden +*/ +type GetEvaluationReportForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEvaluationReportForbidden creates GetEvaluationReportForbidden with default headers values +func NewGetEvaluationReportForbidden() *GetEvaluationReportForbidden { + + return &GetEvaluationReportForbidden{} +} + +// WithPayload adds the payload to the get evaluation report forbidden response +func (o *GetEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get evaluation report forbidden response +func (o *GetEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEvaluationReportNotFoundCode is the HTTP code returned for type GetEvaluationReportNotFound +const GetEvaluationReportNotFoundCode int = 404 + +/* +GetEvaluationReportNotFound The requested resource wasn't found + +swagger:response getEvaluationReportNotFound +*/ +type GetEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEvaluationReportNotFound creates GetEvaluationReportNotFound with default headers values +func NewGetEvaluationReportNotFound() *GetEvaluationReportNotFound { + + return &GetEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the get evaluation report not found response +func (o *GetEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get evaluation report not found response +func (o *GetEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEvaluationReportInternalServerErrorCode is the HTTP code returned for type GetEvaluationReportInternalServerError +const GetEvaluationReportInternalServerErrorCode int = 500 + +/* +GetEvaluationReportInternalServerError A server error occurred + +swagger:response getEvaluationReportInternalServerError +*/ +type GetEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEvaluationReportInternalServerError creates GetEvaluationReportInternalServerError with default headers values +func NewGetEvaluationReportInternalServerError() *GetEvaluationReportInternalServerError { + + return &GetEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the get evaluation report internal server error response +func (o *GetEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *GetEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get evaluation report internal server error response +func (o *GetEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..154a867f840 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/get_evaluation_report_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetEvaluationReportURL generates an URL for the get evaluation report operation +type GetEvaluationReportURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetEvaluationReportURL) WithBasePath(bp string) *GetEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on GetEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go new file mode 100644 index 00000000000..13876f710c8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SaveEvaluationReportHandlerFunc turns a function with the right signature into a save evaluation report handler +type SaveEvaluationReportHandlerFunc func(SaveEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SaveEvaluationReportHandlerFunc) Handle(params SaveEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// SaveEvaluationReportHandler interface for that can handle valid save evaluation report params +type SaveEvaluationReportHandler interface { + Handle(SaveEvaluationReportParams) middleware.Responder +} + +// NewSaveEvaluationReport creates a new http.Handler for the save evaluation report operation +func NewSaveEvaluationReport(ctx *middleware.Context, handler SaveEvaluationReportHandler) *SaveEvaluationReport { + return &SaveEvaluationReport{Context: ctx, Handler: handler} +} + +/* + SaveEvaluationReport swagger:route PUT /evaluation-reports/{reportID} evaluationReports saveEvaluationReport + +# Saves an evaluation report as a draft + +Saves an evaluation report as a draft +*/ +type SaveEvaluationReport struct { + Context *middleware.Context + Handler SaveEvaluationReportHandler +} + +func (o *SaveEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSaveEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go new file mode 100644 index 00000000000..2a93b71392b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewSaveEvaluationReportParams creates a new SaveEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewSaveEvaluationReportParams() SaveEvaluationReportParams { + + return SaveEvaluationReportParams{} +} + +// SaveEvaluationReportParams contains all the bound params for the save evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters saveEvaluationReport +type SaveEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + In: body + */ + Body *ghcmessages.EvaluationReport + /*the evaluation report ID to be modified + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSaveEvaluationReportParams() beforehand. +func (o *SaveEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.EvaluationReport + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *SaveEvaluationReportParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *SaveEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *SaveEvaluationReportParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go new file mode 100644 index 00000000000..1f251d8239f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_responses.go @@ -0,0 +1,354 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// SaveEvaluationReportNoContentCode is the HTTP code returned for type SaveEvaluationReportNoContent +const SaveEvaluationReportNoContentCode int = 204 + +/* +SaveEvaluationReportNoContent Successfully saved the report + +swagger:response saveEvaluationReportNoContent +*/ +type SaveEvaluationReportNoContent struct { +} + +// NewSaveEvaluationReportNoContent creates SaveEvaluationReportNoContent with default headers values +func NewSaveEvaluationReportNoContent() *SaveEvaluationReportNoContent { + + return &SaveEvaluationReportNoContent{} +} + +// WriteResponse to the client +func (o *SaveEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// SaveEvaluationReportBadRequestCode is the HTTP code returned for type SaveEvaluationReportBadRequest +const SaveEvaluationReportBadRequestCode int = 400 + +/* +SaveEvaluationReportBadRequest The request payload is invalid + +swagger:response saveEvaluationReportBadRequest +*/ +type SaveEvaluationReportBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportBadRequest creates SaveEvaluationReportBadRequest with default headers values +func NewSaveEvaluationReportBadRequest() *SaveEvaluationReportBadRequest { + + return &SaveEvaluationReportBadRequest{} +} + +// WithPayload adds the payload to the save evaluation report bad request response +func (o *SaveEvaluationReportBadRequest) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report bad request response +func (o *SaveEvaluationReportBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportForbiddenCode is the HTTP code returned for type SaveEvaluationReportForbidden +const SaveEvaluationReportForbiddenCode int = 403 + +/* +SaveEvaluationReportForbidden The request was denied + +swagger:response saveEvaluationReportForbidden +*/ +type SaveEvaluationReportForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportForbidden creates SaveEvaluationReportForbidden with default headers values +func NewSaveEvaluationReportForbidden() *SaveEvaluationReportForbidden { + + return &SaveEvaluationReportForbidden{} +} + +// WithPayload adds the payload to the save evaluation report forbidden response +func (o *SaveEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report forbidden response +func (o *SaveEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportNotFoundCode is the HTTP code returned for type SaveEvaluationReportNotFound +const SaveEvaluationReportNotFoundCode int = 404 + +/* +SaveEvaluationReportNotFound The requested resource wasn't found + +swagger:response saveEvaluationReportNotFound +*/ +type SaveEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportNotFound creates SaveEvaluationReportNotFound with default headers values +func NewSaveEvaluationReportNotFound() *SaveEvaluationReportNotFound { + + return &SaveEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the save evaluation report not found response +func (o *SaveEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report not found response +func (o *SaveEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportConflictCode is the HTTP code returned for type SaveEvaluationReportConflict +const SaveEvaluationReportConflictCode int = 409 + +/* +SaveEvaluationReportConflict Conflict error + +swagger:response saveEvaluationReportConflict +*/ +type SaveEvaluationReportConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportConflict creates SaveEvaluationReportConflict with default headers values +func NewSaveEvaluationReportConflict() *SaveEvaluationReportConflict { + + return &SaveEvaluationReportConflict{} +} + +// WithPayload adds the payload to the save evaluation report conflict response +func (o *SaveEvaluationReportConflict) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report conflict response +func (o *SaveEvaluationReportConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportPreconditionFailedCode is the HTTP code returned for type SaveEvaluationReportPreconditionFailed +const SaveEvaluationReportPreconditionFailedCode int = 412 + +/* +SaveEvaluationReportPreconditionFailed Precondition failed + +swagger:response saveEvaluationReportPreconditionFailed +*/ +type SaveEvaluationReportPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportPreconditionFailed creates SaveEvaluationReportPreconditionFailed with default headers values +func NewSaveEvaluationReportPreconditionFailed() *SaveEvaluationReportPreconditionFailed { + + return &SaveEvaluationReportPreconditionFailed{} +} + +// WithPayload adds the payload to the save evaluation report precondition failed response +func (o *SaveEvaluationReportPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report precondition failed response +func (o *SaveEvaluationReportPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportUnprocessableEntityCode is the HTTP code returned for type SaveEvaluationReportUnprocessableEntity +const SaveEvaluationReportUnprocessableEntityCode int = 422 + +/* +SaveEvaluationReportUnprocessableEntity The payload was unprocessable. + +swagger:response saveEvaluationReportUnprocessableEntity +*/ +type SaveEvaluationReportUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewSaveEvaluationReportUnprocessableEntity creates SaveEvaluationReportUnprocessableEntity with default headers values +func NewSaveEvaluationReportUnprocessableEntity() *SaveEvaluationReportUnprocessableEntity { + + return &SaveEvaluationReportUnprocessableEntity{} +} + +// WithPayload adds the payload to the save evaluation report unprocessable entity response +func (o *SaveEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SaveEvaluationReportUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report unprocessable entity response +func (o *SaveEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SaveEvaluationReportInternalServerErrorCode is the HTTP code returned for type SaveEvaluationReportInternalServerError +const SaveEvaluationReportInternalServerErrorCode int = 500 + +/* +SaveEvaluationReportInternalServerError A server error occurred + +swagger:response saveEvaluationReportInternalServerError +*/ +type SaveEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSaveEvaluationReportInternalServerError creates SaveEvaluationReportInternalServerError with default headers values +func NewSaveEvaluationReportInternalServerError() *SaveEvaluationReportInternalServerError { + + return &SaveEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the save evaluation report internal server error response +func (o *SaveEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *SaveEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the save evaluation report internal server error response +func (o *SaveEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SaveEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..c3bafb4b0f9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/save_evaluation_report_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SaveEvaluationReportURL generates an URL for the save evaluation report operation +type SaveEvaluationReportURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SaveEvaluationReportURL) WithBasePath(bp string) *SaveEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SaveEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SaveEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on SaveEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SaveEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SaveEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SaveEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SaveEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SaveEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SaveEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go new file mode 100644 index 00000000000..c09ee25d01d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SubmitEvaluationReportHandlerFunc turns a function with the right signature into a submit evaluation report handler +type SubmitEvaluationReportHandlerFunc func(SubmitEvaluationReportParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SubmitEvaluationReportHandlerFunc) Handle(params SubmitEvaluationReportParams) middleware.Responder { + return fn(params) +} + +// SubmitEvaluationReportHandler interface for that can handle valid submit evaluation report params +type SubmitEvaluationReportHandler interface { + Handle(SubmitEvaluationReportParams) middleware.Responder +} + +// NewSubmitEvaluationReport creates a new http.Handler for the submit evaluation report operation +func NewSubmitEvaluationReport(ctx *middleware.Context, handler SubmitEvaluationReportHandler) *SubmitEvaluationReport { + return &SubmitEvaluationReport{Context: ctx, Handler: handler} +} + +/* + SubmitEvaluationReport swagger:route POST /evaluation-reports/{reportID}/submit evaluationReports submitEvaluationReport + +# Submits an evaluation report + +Submits an evaluation report +*/ +type SubmitEvaluationReport struct { + Context *middleware.Context + Handler SubmitEvaluationReportHandler +} + +func (o *SubmitEvaluationReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSubmitEvaluationReportParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go new file mode 100644 index 00000000000..568345d7e2e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_parameters.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewSubmitEvaluationReportParams creates a new SubmitEvaluationReportParams object +// +// There are no default values defined in the spec. +func NewSubmitEvaluationReportParams() SubmitEvaluationReportParams { + + return SubmitEvaluationReportParams{} +} + +// SubmitEvaluationReportParams contains all the bound params for the submit evaluation report operation +// typically these are obtained from a http.Request +// +// swagger:parameters submitEvaluationReport +type SubmitEvaluationReportParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*the evaluation report ID to be modified + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSubmitEvaluationReportParams() beforehand. +func (o *SubmitEvaluationReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *SubmitEvaluationReportParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *SubmitEvaluationReportParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *SubmitEvaluationReportParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go new file mode 100644 index 00000000000..c9b099e84d7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_responses.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// SubmitEvaluationReportNoContentCode is the HTTP code returned for type SubmitEvaluationReportNoContent +const SubmitEvaluationReportNoContentCode int = 204 + +/* +SubmitEvaluationReportNoContent Successfully submitted an evaluation report with the provided ID + +swagger:response submitEvaluationReportNoContent +*/ +type SubmitEvaluationReportNoContent struct { +} + +// NewSubmitEvaluationReportNoContent creates SubmitEvaluationReportNoContent with default headers values +func NewSubmitEvaluationReportNoContent() *SubmitEvaluationReportNoContent { + + return &SubmitEvaluationReportNoContent{} +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// SubmitEvaluationReportForbiddenCode is the HTTP code returned for type SubmitEvaluationReportForbidden +const SubmitEvaluationReportForbiddenCode int = 403 + +/* +SubmitEvaluationReportForbidden The request was denied + +swagger:response submitEvaluationReportForbidden +*/ +type SubmitEvaluationReportForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSubmitEvaluationReportForbidden creates SubmitEvaluationReportForbidden with default headers values +func NewSubmitEvaluationReportForbidden() *SubmitEvaluationReportForbidden { + + return &SubmitEvaluationReportForbidden{} +} + +// WithPayload adds the payload to the submit evaluation report forbidden response +func (o *SubmitEvaluationReportForbidden) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit evaluation report forbidden response +func (o *SubmitEvaluationReportForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitEvaluationReportNotFoundCode is the HTTP code returned for type SubmitEvaluationReportNotFound +const SubmitEvaluationReportNotFoundCode int = 404 + +/* +SubmitEvaluationReportNotFound The requested resource wasn't found + +swagger:response submitEvaluationReportNotFound +*/ +type SubmitEvaluationReportNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSubmitEvaluationReportNotFound creates SubmitEvaluationReportNotFound with default headers values +func NewSubmitEvaluationReportNotFound() *SubmitEvaluationReportNotFound { + + return &SubmitEvaluationReportNotFound{} +} + +// WithPayload adds the payload to the submit evaluation report not found response +func (o *SubmitEvaluationReportNotFound) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit evaluation report not found response +func (o *SubmitEvaluationReportNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitEvaluationReportPreconditionFailedCode is the HTTP code returned for type SubmitEvaluationReportPreconditionFailed +const SubmitEvaluationReportPreconditionFailedCode int = 412 + +/* +SubmitEvaluationReportPreconditionFailed Precondition failed + +swagger:response submitEvaluationReportPreconditionFailed +*/ +type SubmitEvaluationReportPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSubmitEvaluationReportPreconditionFailed creates SubmitEvaluationReportPreconditionFailed with default headers values +func NewSubmitEvaluationReportPreconditionFailed() *SubmitEvaluationReportPreconditionFailed { + + return &SubmitEvaluationReportPreconditionFailed{} +} + +// WithPayload adds the payload to the submit evaluation report precondition failed response +func (o *SubmitEvaluationReportPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit evaluation report precondition failed response +func (o *SubmitEvaluationReportPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitEvaluationReportUnprocessableEntityCode is the HTTP code returned for type SubmitEvaluationReportUnprocessableEntity +const SubmitEvaluationReportUnprocessableEntityCode int = 422 + +/* +SubmitEvaluationReportUnprocessableEntity The payload was unprocessable. + +swagger:response submitEvaluationReportUnprocessableEntity +*/ +type SubmitEvaluationReportUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewSubmitEvaluationReportUnprocessableEntity creates SubmitEvaluationReportUnprocessableEntity with default headers values +func NewSubmitEvaluationReportUnprocessableEntity() *SubmitEvaluationReportUnprocessableEntity { + + return &SubmitEvaluationReportUnprocessableEntity{} +} + +// WithPayload adds the payload to the submit evaluation report unprocessable entity response +func (o *SubmitEvaluationReportUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SubmitEvaluationReportUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit evaluation report unprocessable entity response +func (o *SubmitEvaluationReportUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitEvaluationReportInternalServerErrorCode is the HTTP code returned for type SubmitEvaluationReportInternalServerError +const SubmitEvaluationReportInternalServerErrorCode int = 500 + +/* +SubmitEvaluationReportInternalServerError A server error occurred + +swagger:response submitEvaluationReportInternalServerError +*/ +type SubmitEvaluationReportInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSubmitEvaluationReportInternalServerError creates SubmitEvaluationReportInternalServerError with default headers values +func NewSubmitEvaluationReportInternalServerError() *SubmitEvaluationReportInternalServerError { + + return &SubmitEvaluationReportInternalServerError{} +} + +// WithPayload adds the payload to the submit evaluation report internal server error response +func (o *SubmitEvaluationReportInternalServerError) WithPayload(payload *ghcmessages.Error) *SubmitEvaluationReportInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit evaluation report internal server error response +func (o *SubmitEvaluationReportInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitEvaluationReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go new file mode 100644 index 00000000000..3eefcfe0060 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/evaluation_reports/submit_evaluation_report_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package evaluation_reports + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SubmitEvaluationReportURL generates an URL for the submit evaluation report operation +type SubmitEvaluationReportURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitEvaluationReportURL) WithBasePath(bp string) *SubmitEvaluationReportURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitEvaluationReportURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SubmitEvaluationReportURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/evaluation-reports/{reportID}/submit" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on SubmitEvaluationReportURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SubmitEvaluationReportURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SubmitEvaluationReportURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SubmitEvaluationReportURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SubmitEvaluationReportURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SubmitEvaluationReportURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SubmitEvaluationReportURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go new file mode 100644 index 00000000000..77cadd241ac --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateDocumentHandlerFunc turns a function with the right signature into a create document handler +type CreateDocumentHandlerFunc func(CreateDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateDocumentHandlerFunc) Handle(params CreateDocumentParams) middleware.Responder { + return fn(params) +} + +// CreateDocumentHandler interface for that can handle valid create document params +type CreateDocumentHandler interface { + Handle(CreateDocumentParams) middleware.Responder +} + +// NewCreateDocument creates a new http.Handler for the create document operation +func NewCreateDocument(ctx *middleware.Context, handler CreateDocumentHandler) *CreateDocument { + return &CreateDocument{Context: ctx, Handler: handler} +} + +/* + CreateDocument swagger:route POST /documents ghcDocuments createDocument + +# Create a new document + +Documents represent a physical artifact such as a scanned document or a PDF file +*/ +type CreateDocument struct { + Context *middleware.Context + Handler CreateDocumentHandler +} + +func (o *CreateDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go new file mode 100644 index 00000000000..b1fea83a00b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateDocumentParams creates a new CreateDocumentParams object +// +// There are no default values defined in the spec. +func NewCreateDocumentParams() CreateDocumentParams { + + return CreateDocumentParams{} +} + +// CreateDocumentParams contains all the bound params for the create document operation +// typically these are obtained from a http.Request +// +// swagger:parameters createDocument +type CreateDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + DocumentPayload *ghcmessages.PostDocumentPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateDocumentParams() beforehand. +func (o *CreateDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.PostDocumentPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("documentPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("documentPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.DocumentPayload = &body + } + } + } else { + res = append(res, errors.Required("documentPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go new file mode 100644 index 00000000000..ac24e277c6a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_responses.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateDocumentCreatedCode is the HTTP code returned for type CreateDocumentCreated +const CreateDocumentCreatedCode int = 201 + +/* +CreateDocumentCreated created document + +swagger:response createDocumentCreated +*/ +type CreateDocumentCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.Document `json:"body,omitempty"` +} + +// NewCreateDocumentCreated creates CreateDocumentCreated with default headers values +func NewCreateDocumentCreated() *CreateDocumentCreated { + + return &CreateDocumentCreated{} +} + +// WithPayload adds the payload to the create document created response +func (o *CreateDocumentCreated) WithPayload(payload *ghcmessages.Document) *CreateDocumentCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create document created response +func (o *CreateDocumentCreated) SetPayload(payload *ghcmessages.Document) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateDocumentCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateDocumentBadRequestCode is the HTTP code returned for type CreateDocumentBadRequest +const CreateDocumentBadRequestCode int = 400 + +/* +CreateDocumentBadRequest invalid request + +swagger:response createDocumentBadRequest +*/ +type CreateDocumentBadRequest struct { +} + +// NewCreateDocumentBadRequest creates CreateDocumentBadRequest with default headers values +func NewCreateDocumentBadRequest() *CreateDocumentBadRequest { + + return &CreateDocumentBadRequest{} +} + +// WriteResponse to the client +func (o *CreateDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateDocumentForbiddenCode is the HTTP code returned for type CreateDocumentForbidden +const CreateDocumentForbiddenCode int = 403 + +/* +CreateDocumentForbidden The request was denied + +swagger:response createDocumentForbidden +*/ +type CreateDocumentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateDocumentForbidden creates CreateDocumentForbidden with default headers values +func NewCreateDocumentForbidden() *CreateDocumentForbidden { + + return &CreateDocumentForbidden{} +} + +// WithPayload adds the payload to the create document forbidden response +func (o *CreateDocumentForbidden) WithPayload(payload *ghcmessages.Error) *CreateDocumentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create document forbidden response +func (o *CreateDocumentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateDocumentInternalServerErrorCode is the HTTP code returned for type CreateDocumentInternalServerError +const CreateDocumentInternalServerErrorCode int = 500 + +/* +CreateDocumentInternalServerError server error + +swagger:response createDocumentInternalServerError +*/ +type CreateDocumentInternalServerError struct { +} + +// NewCreateDocumentInternalServerError creates CreateDocumentInternalServerError with default headers values +func NewCreateDocumentInternalServerError() *CreateDocumentInternalServerError { + + return &CreateDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go new file mode 100644 index 00000000000..d8470b17761 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/create_document_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateDocumentURL generates an URL for the create document operation +type CreateDocumentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateDocumentURL) WithBasePath(bp string) *CreateDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/documents" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go new file mode 100644 index 00000000000..b17be0b43bc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetDocumentHandlerFunc turns a function with the right signature into a get document handler +type GetDocumentHandlerFunc func(GetDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetDocumentHandlerFunc) Handle(params GetDocumentParams) middleware.Responder { + return fn(params) +} + +// GetDocumentHandler interface for that can handle valid get document params +type GetDocumentHandler interface { + Handle(GetDocumentParams) middleware.Responder +} + +// NewGetDocument creates a new http.Handler for the get document operation +func NewGetDocument(ctx *middleware.Context, handler GetDocumentHandler) *GetDocument { + return &GetDocument{Context: ctx, Handler: handler} +} + +/* + GetDocument swagger:route GET /documents/{documentId} ghcDocuments getDocument + +# Returns a document + +Returns a document and its uploads +*/ +type GetDocument struct { + Context *middleware.Context + Handler GetDocumentHandler +} + +func (o *GetDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go new file mode 100644 index 00000000000..87835a385d2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetDocumentParams creates a new GetDocumentParams object +// +// There are no default values defined in the spec. +func NewGetDocumentParams() GetDocumentParams { + + return GetDocumentParams{} +} + +// GetDocumentParams contains all the bound params for the get document operation +// typically these are obtained from a http.Request +// +// swagger:parameters getDocument +type GetDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the document to return + Required: true + In: path + */ + DocumentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetDocumentParams() beforehand. +func (o *GetDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDocumentID, rhkDocumentID, _ := route.Params.GetOK("documentId") + if err := o.bindDocumentID(rDocumentID, rhkDocumentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDocumentID binds and validates parameter DocumentID from path. +func (o *GetDocumentParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("documentId", "path", "strfmt.UUID", raw) + } + o.DocumentID = *(value.(*strfmt.UUID)) + + if err := o.validateDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateDocumentID carries on validations for parameter DocumentID +func (o *GetDocumentParams) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("documentId", "path", "uuid", o.DocumentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go new file mode 100644 index 00000000000..6ca584c8cc7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetDocumentOKCode is the HTTP code returned for type GetDocumentOK +const GetDocumentOKCode int = 200 + +/* +GetDocumentOK the requested document + +swagger:response getDocumentOK +*/ +type GetDocumentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Document `json:"body,omitempty"` +} + +// NewGetDocumentOK creates GetDocumentOK with default headers values +func NewGetDocumentOK() *GetDocumentOK { + + return &GetDocumentOK{} +} + +// WithPayload adds the payload to the get document o k response +func (o *GetDocumentOK) WithPayload(payload *ghcmessages.Document) *GetDocumentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document o k response +func (o *GetDocumentOK) SetPayload(payload *ghcmessages.Document) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentBadRequestCode is the HTTP code returned for type GetDocumentBadRequest +const GetDocumentBadRequestCode int = 400 + +/* +GetDocumentBadRequest The request payload is invalid + +swagger:response getDocumentBadRequest +*/ +type GetDocumentBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentBadRequest creates GetDocumentBadRequest with default headers values +func NewGetDocumentBadRequest() *GetDocumentBadRequest { + + return &GetDocumentBadRequest{} +} + +// WithPayload adds the payload to the get document bad request response +func (o *GetDocumentBadRequest) WithPayload(payload *ghcmessages.Error) *GetDocumentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document bad request response +func (o *GetDocumentBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentUnauthorizedCode is the HTTP code returned for type GetDocumentUnauthorized +const GetDocumentUnauthorizedCode int = 401 + +/* +GetDocumentUnauthorized The request was denied + +swagger:response getDocumentUnauthorized +*/ +type GetDocumentUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentUnauthorized creates GetDocumentUnauthorized with default headers values +func NewGetDocumentUnauthorized() *GetDocumentUnauthorized { + + return &GetDocumentUnauthorized{} +} + +// WithPayload adds the payload to the get document unauthorized response +func (o *GetDocumentUnauthorized) WithPayload(payload *ghcmessages.Error) *GetDocumentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document unauthorized response +func (o *GetDocumentUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentForbiddenCode is the HTTP code returned for type GetDocumentForbidden +const GetDocumentForbiddenCode int = 403 + +/* +GetDocumentForbidden The request was denied + +swagger:response getDocumentForbidden +*/ +type GetDocumentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentForbidden creates GetDocumentForbidden with default headers values +func NewGetDocumentForbidden() *GetDocumentForbidden { + + return &GetDocumentForbidden{} +} + +// WithPayload adds the payload to the get document forbidden response +func (o *GetDocumentForbidden) WithPayload(payload *ghcmessages.Error) *GetDocumentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document forbidden response +func (o *GetDocumentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentNotFoundCode is the HTTP code returned for type GetDocumentNotFound +const GetDocumentNotFoundCode int = 404 + +/* +GetDocumentNotFound The requested resource wasn't found + +swagger:response getDocumentNotFound +*/ +type GetDocumentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentNotFound creates GetDocumentNotFound with default headers values +func NewGetDocumentNotFound() *GetDocumentNotFound { + + return &GetDocumentNotFound{} +} + +// WithPayload adds the payload to the get document not found response +func (o *GetDocumentNotFound) WithPayload(payload *ghcmessages.Error) *GetDocumentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document not found response +func (o *GetDocumentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentPreconditionFailedCode is the HTTP code returned for type GetDocumentPreconditionFailed +const GetDocumentPreconditionFailedCode int = 412 + +/* +GetDocumentPreconditionFailed Precondition failed + +swagger:response getDocumentPreconditionFailed +*/ +type GetDocumentPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentPreconditionFailed creates GetDocumentPreconditionFailed with default headers values +func NewGetDocumentPreconditionFailed() *GetDocumentPreconditionFailed { + + return &GetDocumentPreconditionFailed{} +} + +// WithPayload adds the payload to the get document precondition failed response +func (o *GetDocumentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *GetDocumentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document precondition failed response +func (o *GetDocumentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentUnprocessableEntityCode is the HTTP code returned for type GetDocumentUnprocessableEntity +const GetDocumentUnprocessableEntityCode int = 422 + +/* +GetDocumentUnprocessableEntity The payload was unprocessable. + +swagger:response getDocumentUnprocessableEntity +*/ +type GetDocumentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetDocumentUnprocessableEntity creates GetDocumentUnprocessableEntity with default headers values +func NewGetDocumentUnprocessableEntity() *GetDocumentUnprocessableEntity { + + return &GetDocumentUnprocessableEntity{} +} + +// WithPayload adds the payload to the get document unprocessable entity response +func (o *GetDocumentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetDocumentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document unprocessable entity response +func (o *GetDocumentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetDocumentInternalServerErrorCode is the HTTP code returned for type GetDocumentInternalServerError +const GetDocumentInternalServerErrorCode int = 500 + +/* +GetDocumentInternalServerError A server error occurred + +swagger:response getDocumentInternalServerError +*/ +type GetDocumentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetDocumentInternalServerError creates GetDocumentInternalServerError with default headers values +func NewGetDocumentInternalServerError() *GetDocumentInternalServerError { + + return &GetDocumentInternalServerError{} +} + +// WithPayload adds the payload to the get document internal server error response +func (o *GetDocumentInternalServerError) WithPayload(payload *ghcmessages.Error) *GetDocumentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get document internal server error response +func (o *GetDocumentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go new file mode 100644 index 00000000000..1dbc81b0334 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ghc_documents/get_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghc_documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetDocumentURL generates an URL for the get document operation +type GetDocumentURL struct { + DocumentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDocumentURL) WithBasePath(bp string) *GetDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/documents/{documentId}" + + documentID := o.DocumentID.String() + if documentID != "" { + _path = strings.Replace(_path, "{documentId}", documentID, -1) + } else { + return nil, errors.New("documentId is required on GetDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go new file mode 100644 index 00000000000..a08e6363355 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package lines_of_accounting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RequestLineOfAccountingHandlerFunc turns a function with the right signature into a request line of accounting handler +type RequestLineOfAccountingHandlerFunc func(RequestLineOfAccountingParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RequestLineOfAccountingHandlerFunc) Handle(params RequestLineOfAccountingParams) middleware.Responder { + return fn(params) +} + +// RequestLineOfAccountingHandler interface for that can handle valid request line of accounting params +type RequestLineOfAccountingHandler interface { + Handle(RequestLineOfAccountingParams) middleware.Responder +} + +// NewRequestLineOfAccounting creates a new http.Handler for the request line of accounting operation +func NewRequestLineOfAccounting(ctx *middleware.Context, handler RequestLineOfAccountingHandler) *RequestLineOfAccounting { + return &RequestLineOfAccounting{Context: ctx, Handler: handler} +} + +/* + RequestLineOfAccounting swagger:route POST /lines-of-accounting linesOfAccounting requestLineOfAccounting + +# Fetch line of accounting + +Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering through both TAC and LOAs based on the provided code and effective date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). Effective date is used to find "Active" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. +*/ +type RequestLineOfAccounting struct { + Context *middleware.Context + Handler RequestLineOfAccountingHandler +} + +func (o *RequestLineOfAccounting) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRequestLineOfAccountingParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go new file mode 100644 index 00000000000..a8dbe80b3a6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package lines_of_accounting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewRequestLineOfAccountingParams creates a new RequestLineOfAccountingParams object +// +// There are no default values defined in the spec. +func NewRequestLineOfAccountingParams() RequestLineOfAccountingParams { + + return RequestLineOfAccountingParams{} +} + +// RequestLineOfAccountingParams contains all the bound params for the request line of accounting operation +// typically these are obtained from a http.Request +// +// swagger:parameters requestLineOfAccounting +type RequestLineOfAccountingParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Service member affiliation, effective date, and TAC code. + Required: true + In: body + */ + Body *ghcmessages.FetchLineOfAccountingPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRequestLineOfAccountingParams() beforehand. +func (o *RequestLineOfAccountingParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.FetchLineOfAccountingPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go new file mode 100644 index 00000000000..d1d5f3281a6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package lines_of_accounting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// RequestLineOfAccountingOKCode is the HTTP code returned for type RequestLineOfAccountingOK +const RequestLineOfAccountingOKCode int = 200 + +/* +RequestLineOfAccountingOK Successfully retrieved line of accounting + +swagger:response requestLineOfAccountingOK +*/ +type RequestLineOfAccountingOK struct { + + /* + In: Body + */ + Payload *ghcmessages.LineOfAccounting `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingOK creates RequestLineOfAccountingOK with default headers values +func NewRequestLineOfAccountingOK() *RequestLineOfAccountingOK { + + return &RequestLineOfAccountingOK{} +} + +// WithPayload adds the payload to the request line of accounting o k response +func (o *RequestLineOfAccountingOK) WithPayload(payload *ghcmessages.LineOfAccounting) *RequestLineOfAccountingOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting o k response +func (o *RequestLineOfAccountingOK) SetPayload(payload *ghcmessages.LineOfAccounting) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingBadRequestCode is the HTTP code returned for type RequestLineOfAccountingBadRequest +const RequestLineOfAccountingBadRequestCode int = 400 + +/* +RequestLineOfAccountingBadRequest The request payload is invalid + +swagger:response requestLineOfAccountingBadRequest +*/ +type RequestLineOfAccountingBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingBadRequest creates RequestLineOfAccountingBadRequest with default headers values +func NewRequestLineOfAccountingBadRequest() *RequestLineOfAccountingBadRequest { + + return &RequestLineOfAccountingBadRequest{} +} + +// WithPayload adds the payload to the request line of accounting bad request response +func (o *RequestLineOfAccountingBadRequest) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting bad request response +func (o *RequestLineOfAccountingBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingUnauthorizedCode is the HTTP code returned for type RequestLineOfAccountingUnauthorized +const RequestLineOfAccountingUnauthorizedCode int = 401 + +/* +RequestLineOfAccountingUnauthorized The request was denied + +swagger:response requestLineOfAccountingUnauthorized +*/ +type RequestLineOfAccountingUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingUnauthorized creates RequestLineOfAccountingUnauthorized with default headers values +func NewRequestLineOfAccountingUnauthorized() *RequestLineOfAccountingUnauthorized { + + return &RequestLineOfAccountingUnauthorized{} +} + +// WithPayload adds the payload to the request line of accounting unauthorized response +func (o *RequestLineOfAccountingUnauthorized) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting unauthorized response +func (o *RequestLineOfAccountingUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingForbiddenCode is the HTTP code returned for type RequestLineOfAccountingForbidden +const RequestLineOfAccountingForbiddenCode int = 403 + +/* +RequestLineOfAccountingForbidden The request was denied + +swagger:response requestLineOfAccountingForbidden +*/ +type RequestLineOfAccountingForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingForbidden creates RequestLineOfAccountingForbidden with default headers values +func NewRequestLineOfAccountingForbidden() *RequestLineOfAccountingForbidden { + + return &RequestLineOfAccountingForbidden{} +} + +// WithPayload adds the payload to the request line of accounting forbidden response +func (o *RequestLineOfAccountingForbidden) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting forbidden response +func (o *RequestLineOfAccountingForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingNotFoundCode is the HTTP code returned for type RequestLineOfAccountingNotFound +const RequestLineOfAccountingNotFoundCode int = 404 + +/* +RequestLineOfAccountingNotFound The requested resource wasn't found + +swagger:response requestLineOfAccountingNotFound +*/ +type RequestLineOfAccountingNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingNotFound creates RequestLineOfAccountingNotFound with default headers values +func NewRequestLineOfAccountingNotFound() *RequestLineOfAccountingNotFound { + + return &RequestLineOfAccountingNotFound{} +} + +// WithPayload adds the payload to the request line of accounting not found response +func (o *RequestLineOfAccountingNotFound) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting not found response +func (o *RequestLineOfAccountingNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingUnprocessableEntityCode is the HTTP code returned for type RequestLineOfAccountingUnprocessableEntity +const RequestLineOfAccountingUnprocessableEntityCode int = 422 + +/* +RequestLineOfAccountingUnprocessableEntity The payload was unprocessable. + +swagger:response requestLineOfAccountingUnprocessableEntity +*/ +type RequestLineOfAccountingUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingUnprocessableEntity creates RequestLineOfAccountingUnprocessableEntity with default headers values +func NewRequestLineOfAccountingUnprocessableEntity() *RequestLineOfAccountingUnprocessableEntity { + + return &RequestLineOfAccountingUnprocessableEntity{} +} + +// WithPayload adds the payload to the request line of accounting unprocessable entity response +func (o *RequestLineOfAccountingUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestLineOfAccountingUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting unprocessable entity response +func (o *RequestLineOfAccountingUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestLineOfAccountingInternalServerErrorCode is the HTTP code returned for type RequestLineOfAccountingInternalServerError +const RequestLineOfAccountingInternalServerErrorCode int = 500 + +/* +RequestLineOfAccountingInternalServerError A server error occurred + +swagger:response requestLineOfAccountingInternalServerError +*/ +type RequestLineOfAccountingInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestLineOfAccountingInternalServerError creates RequestLineOfAccountingInternalServerError with default headers values +func NewRequestLineOfAccountingInternalServerError() *RequestLineOfAccountingInternalServerError { + + return &RequestLineOfAccountingInternalServerError{} +} + +// WithPayload adds the payload to the request line of accounting internal server error response +func (o *RequestLineOfAccountingInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestLineOfAccountingInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request line of accounting internal server error response +func (o *RequestLineOfAccountingInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestLineOfAccountingInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go new file mode 100644 index 00000000000..713e48a25e3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/lines_of_accounting/request_line_of_accounting_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package lines_of_accounting + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// RequestLineOfAccountingURL generates an URL for the request line of accounting operation +type RequestLineOfAccountingURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestLineOfAccountingURL) WithBasePath(bp string) *RequestLineOfAccountingURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestLineOfAccountingURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RequestLineOfAccountingURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/lines-of-accounting" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RequestLineOfAccountingURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RequestLineOfAccountingURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RequestLineOfAccountingURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RequestLineOfAccountingURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RequestLineOfAccountingURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RequestLineOfAccountingURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go new file mode 100644 index 00000000000..1d723e61825 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CheckForLockedMovesAndUnlockHandlerFunc turns a function with the right signature into a check for locked moves and unlock handler +type CheckForLockedMovesAndUnlockHandlerFunc func(CheckForLockedMovesAndUnlockParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CheckForLockedMovesAndUnlockHandlerFunc) Handle(params CheckForLockedMovesAndUnlockParams) middleware.Responder { + return fn(params) +} + +// CheckForLockedMovesAndUnlockHandler interface for that can handle valid check for locked moves and unlock params +type CheckForLockedMovesAndUnlockHandler interface { + Handle(CheckForLockedMovesAndUnlockParams) middleware.Responder +} + +// NewCheckForLockedMovesAndUnlock creates a new http.Handler for the check for locked moves and unlock operation +func NewCheckForLockedMovesAndUnlock(ctx *middleware.Context, handler CheckForLockedMovesAndUnlockHandler) *CheckForLockedMovesAndUnlock { + return &CheckForLockedMovesAndUnlock{Context: ctx, Handler: handler} +} + +/* + CheckForLockedMovesAndUnlock swagger:route PATCH /moves/{officeUserID}/CheckForLockedMovesAndUnlock move checkForLockedMovesAndUnlock + +Finds and unlocks any locked moves by an office user +*/ +type CheckForLockedMovesAndUnlock struct { + Context *middleware.Context + Handler CheckForLockedMovesAndUnlockHandler +} + +func (o *CheckForLockedMovesAndUnlock) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCheckForLockedMovesAndUnlockParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// CheckForLockedMovesAndUnlockOKBody check for locked moves and unlock o k body +// +// swagger:model CheckForLockedMovesAndUnlockOKBody +type CheckForLockedMovesAndUnlockOKBody struct { + + // success message + // Example: OK + SuccessMessage string `json:"successMessage,omitempty"` +} + +// Validate validates this check for locked moves and unlock o k body +func (o *CheckForLockedMovesAndUnlockOKBody) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this check for locked moves and unlock o k body based on context it is used +func (o *CheckForLockedMovesAndUnlockOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *CheckForLockedMovesAndUnlockOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *CheckForLockedMovesAndUnlockOKBody) UnmarshalBinary(b []byte) error { + var res CheckForLockedMovesAndUnlockOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go new file mode 100644 index 00000000000..46162a72b81 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewCheckForLockedMovesAndUnlockParams creates a new CheckForLockedMovesAndUnlockParams object +// +// There are no default values defined in the spec. +func NewCheckForLockedMovesAndUnlockParams() CheckForLockedMovesAndUnlockParams { + + return CheckForLockedMovesAndUnlockParams{} +} + +// CheckForLockedMovesAndUnlockParams contains all the bound params for the check for locked moves and unlock operation +// typically these are obtained from a http.Request +// +// swagger:parameters checkForLockedMovesAndUnlock +type CheckForLockedMovesAndUnlockParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the move's officer + Required: true + In: path + */ + OfficeUserID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCheckForLockedMovesAndUnlockParams() beforehand. +func (o *CheckForLockedMovesAndUnlockParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOfficeUserID, rhkOfficeUserID, _ := route.Params.GetOK("officeUserID") + if err := o.bindOfficeUserID(rOfficeUserID, rhkOfficeUserID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOfficeUserID binds and validates parameter OfficeUserID from path. +func (o *CheckForLockedMovesAndUnlockParams) bindOfficeUserID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("officeUserID", "path", "strfmt.UUID", raw) + } + o.OfficeUserID = *(value.(*strfmt.UUID)) + + if err := o.validateOfficeUserID(formats); err != nil { + return err + } + + return nil +} + +// validateOfficeUserID carries on validations for parameter OfficeUserID +func (o *CheckForLockedMovesAndUnlockParams) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.FormatOf("officeUserID", "path", "uuid", o.OfficeUserID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go new file mode 100644 index 00000000000..8b5abbefb35 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CheckForLockedMovesAndUnlockOKCode is the HTTP code returned for type CheckForLockedMovesAndUnlockOK +const CheckForLockedMovesAndUnlockOKCode int = 200 + +/* +CheckForLockedMovesAndUnlockOK Successfully unlocked officer's move(s). + +swagger:response checkForLockedMovesAndUnlockOK +*/ +type CheckForLockedMovesAndUnlockOK struct { + + /* + In: Body + */ + Payload *CheckForLockedMovesAndUnlockOKBody `json:"body,omitempty"` +} + +// NewCheckForLockedMovesAndUnlockOK creates CheckForLockedMovesAndUnlockOK with default headers values +func NewCheckForLockedMovesAndUnlockOK() *CheckForLockedMovesAndUnlockOK { + + return &CheckForLockedMovesAndUnlockOK{} +} + +// WithPayload adds the payload to the check for locked moves and unlock o k response +func (o *CheckForLockedMovesAndUnlockOK) WithPayload(payload *CheckForLockedMovesAndUnlockOKBody) *CheckForLockedMovesAndUnlockOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the check for locked moves and unlock o k response +func (o *CheckForLockedMovesAndUnlockOK) SetPayload(payload *CheckForLockedMovesAndUnlockOKBody) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CheckForLockedMovesAndUnlockOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CheckForLockedMovesAndUnlockInternalServerErrorCode is the HTTP code returned for type CheckForLockedMovesAndUnlockInternalServerError +const CheckForLockedMovesAndUnlockInternalServerErrorCode int = 500 + +/* +CheckForLockedMovesAndUnlockInternalServerError A server error occurred + +swagger:response checkForLockedMovesAndUnlockInternalServerError +*/ +type CheckForLockedMovesAndUnlockInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCheckForLockedMovesAndUnlockInternalServerError creates CheckForLockedMovesAndUnlockInternalServerError with default headers values +func NewCheckForLockedMovesAndUnlockInternalServerError() *CheckForLockedMovesAndUnlockInternalServerError { + + return &CheckForLockedMovesAndUnlockInternalServerError{} +} + +// WithPayload adds the payload to the check for locked moves and unlock internal server error response +func (o *CheckForLockedMovesAndUnlockInternalServerError) WithPayload(payload *ghcmessages.Error) *CheckForLockedMovesAndUnlockInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the check for locked moves and unlock internal server error response +func (o *CheckForLockedMovesAndUnlockInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CheckForLockedMovesAndUnlockInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go new file mode 100644 index 00000000000..e103de7869d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/check_for_locked_moves_and_unlock_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CheckForLockedMovesAndUnlockURL generates an URL for the check for locked moves and unlock operation +type CheckForLockedMovesAndUnlockURL struct { + OfficeUserID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CheckForLockedMovesAndUnlockURL) WithBasePath(bp string) *CheckForLockedMovesAndUnlockURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CheckForLockedMovesAndUnlockURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CheckForLockedMovesAndUnlockURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{officeUserID}/CheckForLockedMovesAndUnlock" + + officeUserID := o.OfficeUserID.String() + if officeUserID != "" { + _path = strings.Replace(_path, "{officeUserID}", officeUserID, -1) + } else { + return nil, errors.New("officeUserId is required on CheckForLockedMovesAndUnlockURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CheckForLockedMovesAndUnlockURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CheckForLockedMovesAndUnlockURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CheckForLockedMovesAndUnlockURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CheckForLockedMovesAndUnlockURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CheckForLockedMovesAndUnlockURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CheckForLockedMovesAndUnlockURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go new file mode 100644 index 00000000000..52752c84141 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DeleteAssignedOfficeUserHandlerFunc turns a function with the right signature into a delete assigned office user handler +type DeleteAssignedOfficeUserHandlerFunc func(DeleteAssignedOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteAssignedOfficeUserHandlerFunc) Handle(params DeleteAssignedOfficeUserParams) middleware.Responder { + return fn(params) +} + +// DeleteAssignedOfficeUserHandler interface for that can handle valid delete assigned office user params +type DeleteAssignedOfficeUserHandler interface { + Handle(DeleteAssignedOfficeUserParams) middleware.Responder +} + +// NewDeleteAssignedOfficeUser creates a new http.Handler for the delete assigned office user operation +func NewDeleteAssignedOfficeUser(ctx *middleware.Context, handler DeleteAssignedOfficeUserHandler) *DeleteAssignedOfficeUser { + return &DeleteAssignedOfficeUser{Context: ctx, Handler: handler} +} + +/* + DeleteAssignedOfficeUser swagger:route PATCH /moves/{moveID}/unassignOfficeUser move deleteAssignedOfficeUser + +unassigns either a services counselor, task ordering officer, or task invoicing officer from the move +*/ +type DeleteAssignedOfficeUser struct { + Context *middleware.Context + Handler DeleteAssignedOfficeUserHandler +} + +func (o *DeleteAssignedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteAssignedOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// DeleteAssignedOfficeUserBody delete assigned office user body +// +// swagger:model DeleteAssignedOfficeUserBody +type DeleteAssignedOfficeUserBody struct { + + // role type + // Required: true + RoleType *string `json:"roleType"` +} + +// Validate validates this delete assigned office user body +func (o *DeleteAssignedOfficeUserBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateRoleType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *DeleteAssignedOfficeUserBody) validateRoleType(formats strfmt.Registry) error { + + if err := validate.Required("body"+"."+"roleType", "body", o.RoleType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this delete assigned office user body based on context it is used +func (o *DeleteAssignedOfficeUserBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *DeleteAssignedOfficeUserBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *DeleteAssignedOfficeUserBody) UnmarshalBinary(b []byte) error { + var res DeleteAssignedOfficeUserBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go new file mode 100644 index 00000000000..2b2a9c43fd1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_parameters.go @@ -0,0 +1,118 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteAssignedOfficeUserParams creates a new DeleteAssignedOfficeUserParams object +// +// There are no default values defined in the spec. +func NewDeleteAssignedOfficeUserParams() DeleteAssignedOfficeUserParams { + + return DeleteAssignedOfficeUserParams{} +} + +// DeleteAssignedOfficeUserParams contains all the bound params for the delete assigned office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteAssignedOfficeUser +type DeleteAssignedOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body DeleteAssignedOfficeUserBody + /*ID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteAssignedOfficeUserParams() beforehand. +func (o *DeleteAssignedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body DeleteAssignedOfficeUserBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *DeleteAssignedOfficeUserParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *DeleteAssignedOfficeUserParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go new file mode 100644 index 00000000000..74eeb8a5c5e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_responses.go @@ -0,0 +1,104 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DeleteAssignedOfficeUserOKCode is the HTTP code returned for type DeleteAssignedOfficeUserOK +const DeleteAssignedOfficeUserOKCode int = 200 + +/* +DeleteAssignedOfficeUserOK Successfully unassigned office user from the move + +swagger:response deleteAssignedOfficeUserOK +*/ +type DeleteAssignedOfficeUserOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewDeleteAssignedOfficeUserOK creates DeleteAssignedOfficeUserOK with default headers values +func NewDeleteAssignedOfficeUserOK() *DeleteAssignedOfficeUserOK { + + return &DeleteAssignedOfficeUserOK{} +} + +// WithPayload adds the payload to the delete assigned office user o k response +func (o *DeleteAssignedOfficeUserOK) WithPayload(payload *ghcmessages.Move) *DeleteAssignedOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete assigned office user o k response +func (o *DeleteAssignedOfficeUserOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteAssignedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteAssignedOfficeUserInternalServerErrorCode is the HTTP code returned for type DeleteAssignedOfficeUserInternalServerError +const DeleteAssignedOfficeUserInternalServerErrorCode int = 500 + +/* +DeleteAssignedOfficeUserInternalServerError A server error occurred + +swagger:response deleteAssignedOfficeUserInternalServerError +*/ +type DeleteAssignedOfficeUserInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteAssignedOfficeUserInternalServerError creates DeleteAssignedOfficeUserInternalServerError with default headers values +func NewDeleteAssignedOfficeUserInternalServerError() *DeleteAssignedOfficeUserInternalServerError { + + return &DeleteAssignedOfficeUserInternalServerError{} +} + +// WithPayload adds the payload to the delete assigned office user internal server error response +func (o *DeleteAssignedOfficeUserInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteAssignedOfficeUserInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete assigned office user internal server error response +func (o *DeleteAssignedOfficeUserInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteAssignedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go new file mode 100644 index 00000000000..8f81bd03096 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/delete_assigned_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteAssignedOfficeUserURL generates an URL for the delete assigned office user operation +type DeleteAssignedOfficeUserURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteAssignedOfficeUserURL) WithBasePath(bp string) *DeleteAssignedOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteAssignedOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteAssignedOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/unassignOfficeUser" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on DeleteAssignedOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteAssignedOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteAssignedOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteAssignedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteAssignedOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteAssignedOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteAssignedOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move.go b/pkg/gen/ghcapi/ghcoperations/move/get_move.go new file mode 100644 index 00000000000..db9024a0c0c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveHandlerFunc turns a function with the right signature into a get move handler +type GetMoveHandlerFunc func(GetMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveHandlerFunc) Handle(params GetMoveParams) middleware.Responder { + return fn(params) +} + +// GetMoveHandler interface for that can handle valid get move params +type GetMoveHandler interface { + Handle(GetMoveParams) middleware.Responder +} + +// NewGetMove creates a new http.Handler for the get move operation +func NewGetMove(ctx *middleware.Context, handler GetMoveHandler) *GetMove { + return &GetMove{Context: ctx, Handler: handler} +} + +/* + GetMove swagger:route GET /move/{locator} move getMove + +# Returns a given move + +Returns a given move for a unique alphanumeric locator string +*/ +type GetMove struct { + Context *middleware.Context + Handler GetMoveHandler +} + +func (o *GetMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go new file mode 100644 index 00000000000..2989281f5af --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveCounselingEvaluationReportsListHandlerFunc turns a function with the right signature into a get move counseling evaluation reports list handler +type GetMoveCounselingEvaluationReportsListHandlerFunc func(GetMoveCounselingEvaluationReportsListParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveCounselingEvaluationReportsListHandlerFunc) Handle(params GetMoveCounselingEvaluationReportsListParams) middleware.Responder { + return fn(params) +} + +// GetMoveCounselingEvaluationReportsListHandler interface for that can handle valid get move counseling evaluation reports list params +type GetMoveCounselingEvaluationReportsListHandler interface { + Handle(GetMoveCounselingEvaluationReportsListParams) middleware.Responder +} + +// NewGetMoveCounselingEvaluationReportsList creates a new http.Handler for the get move counseling evaluation reports list operation +func NewGetMoveCounselingEvaluationReportsList(ctx *middleware.Context, handler GetMoveCounselingEvaluationReportsListHandler) *GetMoveCounselingEvaluationReportsList { + return &GetMoveCounselingEvaluationReportsList{Context: ctx, Handler: handler} +} + +/* + GetMoveCounselingEvaluationReportsList swagger:route GET /moves/{moveID}/counseling-evaluation-reports-list move getMoveCounselingEvaluationReportsList + +# Returns counseling evaluation reports for the specified move that are visible to the current office user + +Returns counseling evaluation reports for the specified move that are visible to the current office user +*/ +type GetMoveCounselingEvaluationReportsList struct { + Context *middleware.Context + Handler GetMoveCounselingEvaluationReportsListHandler +} + +func (o *GetMoveCounselingEvaluationReportsList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveCounselingEvaluationReportsListParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go new file mode 100644 index 00000000000..ef8796bb2d8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetMoveCounselingEvaluationReportsListParams creates a new GetMoveCounselingEvaluationReportsListParams object +// +// There are no default values defined in the spec. +func NewGetMoveCounselingEvaluationReportsListParams() GetMoveCounselingEvaluationReportsListParams { + + return GetMoveCounselingEvaluationReportsListParams{} +} + +// GetMoveCounselingEvaluationReportsListParams contains all the bound params for the get move counseling evaluation reports list operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveCounselingEvaluationReportsList +type GetMoveCounselingEvaluationReportsListParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Code used to identify a move in the system + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveCounselingEvaluationReportsListParams() beforehand. +func (o *GetMoveCounselingEvaluationReportsListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveCounselingEvaluationReportsListParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *GetMoveCounselingEvaluationReportsListParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go new file mode 100644 index 00000000000..4756560f448 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMoveCounselingEvaluationReportsListOKCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListOK +const GetMoveCounselingEvaluationReportsListOKCode int = 200 + +/* +GetMoveCounselingEvaluationReportsListOK Successfully retrieved the move's evaluation reports + +swagger:response getMoveCounselingEvaluationReportsListOK +*/ +type GetMoveCounselingEvaluationReportsListOK struct { + + /* + In: Body + */ + Payload ghcmessages.EvaluationReportList `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListOK creates GetMoveCounselingEvaluationReportsListOK with default headers values +func NewGetMoveCounselingEvaluationReportsListOK() *GetMoveCounselingEvaluationReportsListOK { + + return &GetMoveCounselingEvaluationReportsListOK{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list o k response +func (o *GetMoveCounselingEvaluationReportsListOK) WithPayload(payload ghcmessages.EvaluationReportList) *GetMoveCounselingEvaluationReportsListOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list o k response +func (o *GetMoveCounselingEvaluationReportsListOK) SetPayload(payload ghcmessages.EvaluationReportList) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.EvaluationReportList{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetMoveCounselingEvaluationReportsListBadRequestCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListBadRequest +const GetMoveCounselingEvaluationReportsListBadRequestCode int = 400 + +/* +GetMoveCounselingEvaluationReportsListBadRequest The request payload is invalid + +swagger:response getMoveCounselingEvaluationReportsListBadRequest +*/ +type GetMoveCounselingEvaluationReportsListBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListBadRequest creates GetMoveCounselingEvaluationReportsListBadRequest with default headers values +func NewGetMoveCounselingEvaluationReportsListBadRequest() *GetMoveCounselingEvaluationReportsListBadRequest { + + return &GetMoveCounselingEvaluationReportsListBadRequest{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list bad request response +func (o *GetMoveCounselingEvaluationReportsListBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list bad request response +func (o *GetMoveCounselingEvaluationReportsListBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveCounselingEvaluationReportsListUnauthorizedCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListUnauthorized +const GetMoveCounselingEvaluationReportsListUnauthorizedCode int = 401 + +/* +GetMoveCounselingEvaluationReportsListUnauthorized The request was denied + +swagger:response getMoveCounselingEvaluationReportsListUnauthorized +*/ +type GetMoveCounselingEvaluationReportsListUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListUnauthorized creates GetMoveCounselingEvaluationReportsListUnauthorized with default headers values +func NewGetMoveCounselingEvaluationReportsListUnauthorized() *GetMoveCounselingEvaluationReportsListUnauthorized { + + return &GetMoveCounselingEvaluationReportsListUnauthorized{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list unauthorized response +func (o *GetMoveCounselingEvaluationReportsListUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list unauthorized response +func (o *GetMoveCounselingEvaluationReportsListUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveCounselingEvaluationReportsListForbiddenCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListForbidden +const GetMoveCounselingEvaluationReportsListForbiddenCode int = 403 + +/* +GetMoveCounselingEvaluationReportsListForbidden The request was denied + +swagger:response getMoveCounselingEvaluationReportsListForbidden +*/ +type GetMoveCounselingEvaluationReportsListForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListForbidden creates GetMoveCounselingEvaluationReportsListForbidden with default headers values +func NewGetMoveCounselingEvaluationReportsListForbidden() *GetMoveCounselingEvaluationReportsListForbidden { + + return &GetMoveCounselingEvaluationReportsListForbidden{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list forbidden response +func (o *GetMoveCounselingEvaluationReportsListForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list forbidden response +func (o *GetMoveCounselingEvaluationReportsListForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveCounselingEvaluationReportsListNotFoundCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListNotFound +const GetMoveCounselingEvaluationReportsListNotFoundCode int = 404 + +/* +GetMoveCounselingEvaluationReportsListNotFound The requested resource wasn't found + +swagger:response getMoveCounselingEvaluationReportsListNotFound +*/ +type GetMoveCounselingEvaluationReportsListNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListNotFound creates GetMoveCounselingEvaluationReportsListNotFound with default headers values +func NewGetMoveCounselingEvaluationReportsListNotFound() *GetMoveCounselingEvaluationReportsListNotFound { + + return &GetMoveCounselingEvaluationReportsListNotFound{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list not found response +func (o *GetMoveCounselingEvaluationReportsListNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list not found response +func (o *GetMoveCounselingEvaluationReportsListNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveCounselingEvaluationReportsListInternalServerErrorCode is the HTTP code returned for type GetMoveCounselingEvaluationReportsListInternalServerError +const GetMoveCounselingEvaluationReportsListInternalServerErrorCode int = 500 + +/* +GetMoveCounselingEvaluationReportsListInternalServerError A server error occurred + +swagger:response getMoveCounselingEvaluationReportsListInternalServerError +*/ +type GetMoveCounselingEvaluationReportsListInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveCounselingEvaluationReportsListInternalServerError creates GetMoveCounselingEvaluationReportsListInternalServerError with default headers values +func NewGetMoveCounselingEvaluationReportsListInternalServerError() *GetMoveCounselingEvaluationReportsListInternalServerError { + + return &GetMoveCounselingEvaluationReportsListInternalServerError{} +} + +// WithPayload adds the payload to the get move counseling evaluation reports list internal server error response +func (o *GetMoveCounselingEvaluationReportsListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveCounselingEvaluationReportsListInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move counseling evaluation reports list internal server error response +func (o *GetMoveCounselingEvaluationReportsListInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveCounselingEvaluationReportsListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go new file mode 100644 index 00000000000..a3725b0aae3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_counseling_evaluation_reports_list_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetMoveCounselingEvaluationReportsListURL generates an URL for the get move counseling evaluation reports list operation +type GetMoveCounselingEvaluationReportsListURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveCounselingEvaluationReportsListURL) WithBasePath(bp string) *GetMoveCounselingEvaluationReportsListURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveCounselingEvaluationReportsListURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveCounselingEvaluationReportsListURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/counseling-evaluation-reports-list" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveCounselingEvaluationReportsListURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveCounselingEvaluationReportsListURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveCounselingEvaluationReportsListURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveCounselingEvaluationReportsListURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveCounselingEvaluationReportsListURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveCounselingEvaluationReportsListURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveCounselingEvaluationReportsListURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go new file mode 100644 index 00000000000..c544b6c9e47 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_history.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveHistoryHandlerFunc turns a function with the right signature into a get move history handler +type GetMoveHistoryHandlerFunc func(GetMoveHistoryParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveHistoryHandlerFunc) Handle(params GetMoveHistoryParams) middleware.Responder { + return fn(params) +} + +// GetMoveHistoryHandler interface for that can handle valid get move history params +type GetMoveHistoryHandler interface { + Handle(GetMoveHistoryParams) middleware.Responder +} + +// NewGetMoveHistory creates a new http.Handler for the get move history operation +func NewGetMoveHistory(ctx *middleware.Context, handler GetMoveHistoryHandler) *GetMoveHistory { + return &GetMoveHistory{Context: ctx, Handler: handler} +} + +/* + GetMoveHistory swagger:route GET /move/{locator}/history move getMoveHistory + +# Returns the history of an identified move + +Returns the history for a given move for a unique alphanumeric locator string +*/ +type GetMoveHistory struct { + Context *middleware.Context + Handler GetMoveHistoryHandler +} + +func (o *GetMoveHistory) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveHistoryParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go new file mode 100644 index 00000000000..8cef5040635 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetMoveHistoryParams creates a new GetMoveHistoryParams object +// +// There are no default values defined in the spec. +func NewGetMoveHistoryParams() GetMoveHistoryParams { + + return GetMoveHistoryParams{} +} + +// GetMoveHistoryParams contains all the bound params for the get move history operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveHistory +type GetMoveHistoryParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Code used to identify a move in the system + Required: true + In: path + */ + Locator string + /*requested page of results + In: query + */ + Page *int64 + /*results per page + In: query + */ + PerPage *int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveHistoryParams() beforehand. +func (o *GetMoveHistoryParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *GetMoveHistoryParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *GetMoveHistoryParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *GetMoveHistoryParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go new file mode 100644 index 00000000000..47d1f3e4090 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMoveHistoryOKCode is the HTTP code returned for type GetMoveHistoryOK +const GetMoveHistoryOKCode int = 200 + +/* +GetMoveHistoryOK Successfully retrieved the individual move history + +swagger:response getMoveHistoryOK +*/ +type GetMoveHistoryOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MoveHistoryResult `json:"body,omitempty"` +} + +// NewGetMoveHistoryOK creates GetMoveHistoryOK with default headers values +func NewGetMoveHistoryOK() *GetMoveHistoryOK { + + return &GetMoveHistoryOK{} +} + +// WithPayload adds the payload to the get move history o k response +func (o *GetMoveHistoryOK) WithPayload(payload *ghcmessages.MoveHistoryResult) *GetMoveHistoryOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history o k response +func (o *GetMoveHistoryOK) SetPayload(payload *ghcmessages.MoveHistoryResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveHistoryBadRequestCode is the HTTP code returned for type GetMoveHistoryBadRequest +const GetMoveHistoryBadRequestCode int = 400 + +/* +GetMoveHistoryBadRequest The request payload is invalid + +swagger:response getMoveHistoryBadRequest +*/ +type GetMoveHistoryBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveHistoryBadRequest creates GetMoveHistoryBadRequest with default headers values +func NewGetMoveHistoryBadRequest() *GetMoveHistoryBadRequest { + + return &GetMoveHistoryBadRequest{} +} + +// WithPayload adds the payload to the get move history bad request response +func (o *GetMoveHistoryBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history bad request response +func (o *GetMoveHistoryBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveHistoryUnauthorizedCode is the HTTP code returned for type GetMoveHistoryUnauthorized +const GetMoveHistoryUnauthorizedCode int = 401 + +/* +GetMoveHistoryUnauthorized The request was denied + +swagger:response getMoveHistoryUnauthorized +*/ +type GetMoveHistoryUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveHistoryUnauthorized creates GetMoveHistoryUnauthorized with default headers values +func NewGetMoveHistoryUnauthorized() *GetMoveHistoryUnauthorized { + + return &GetMoveHistoryUnauthorized{} +} + +// WithPayload adds the payload to the get move history unauthorized response +func (o *GetMoveHistoryUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history unauthorized response +func (o *GetMoveHistoryUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveHistoryForbiddenCode is the HTTP code returned for type GetMoveHistoryForbidden +const GetMoveHistoryForbiddenCode int = 403 + +/* +GetMoveHistoryForbidden The request was denied + +swagger:response getMoveHistoryForbidden +*/ +type GetMoveHistoryForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveHistoryForbidden creates GetMoveHistoryForbidden with default headers values +func NewGetMoveHistoryForbidden() *GetMoveHistoryForbidden { + + return &GetMoveHistoryForbidden{} +} + +// WithPayload adds the payload to the get move history forbidden response +func (o *GetMoveHistoryForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history forbidden response +func (o *GetMoveHistoryForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveHistoryNotFoundCode is the HTTP code returned for type GetMoveHistoryNotFound +const GetMoveHistoryNotFoundCode int = 404 + +/* +GetMoveHistoryNotFound The requested resource wasn't found + +swagger:response getMoveHistoryNotFound +*/ +type GetMoveHistoryNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveHistoryNotFound creates GetMoveHistoryNotFound with default headers values +func NewGetMoveHistoryNotFound() *GetMoveHistoryNotFound { + + return &GetMoveHistoryNotFound{} +} + +// WithPayload adds the payload to the get move history not found response +func (o *GetMoveHistoryNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history not found response +func (o *GetMoveHistoryNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveHistoryInternalServerErrorCode is the HTTP code returned for type GetMoveHistoryInternalServerError +const GetMoveHistoryInternalServerErrorCode int = 500 + +/* +GetMoveHistoryInternalServerError A server error occurred + +swagger:response getMoveHistoryInternalServerError +*/ +type GetMoveHistoryInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveHistoryInternalServerError creates GetMoveHistoryInternalServerError with default headers values +func NewGetMoveHistoryInternalServerError() *GetMoveHistoryInternalServerError { + + return &GetMoveHistoryInternalServerError{} +} + +// WithPayload adds the payload to the get move history internal server error response +func (o *GetMoveHistoryInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveHistoryInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move history internal server error response +func (o *GetMoveHistoryInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveHistoryInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go new file mode 100644 index 00000000000..8266cad9d57 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_history_urlbuilder.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/swag" +) + +// GetMoveHistoryURL generates an URL for the get move history operation +type GetMoveHistoryURL struct { + Locator string + + Page *int64 + PerPage *int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveHistoryURL) WithBasePath(bp string) *GetMoveHistoryURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveHistoryURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveHistoryURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move/{locator}/history" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on GetMoveHistoryURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveHistoryURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveHistoryURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveHistoryURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveHistoryURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveHistoryURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveHistoryURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go new file mode 100644 index 00000000000..33ca21cc208 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveParams creates a new GetMoveParams object +// +// There are no default values defined in the spec. +func NewGetMoveParams() GetMoveParams { + + return GetMoveParams{} +} + +// GetMoveParams contains all the bound params for the get move operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMove +type GetMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Code used to identify a move in the system + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveParams() beforehand. +func (o *GetMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *GetMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go new file mode 100644 index 00000000000..dd24b77d31e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMoveOKCode is the HTTP code returned for type GetMoveOK +const GetMoveOKCode int = 200 + +/* +GetMoveOK Successfully retrieved the individual move + +swagger:response getMoveOK +*/ +type GetMoveOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewGetMoveOK creates GetMoveOK with default headers values +func NewGetMoveOK() *GetMoveOK { + + return &GetMoveOK{} +} + +// WithPayload adds the payload to the get move o k response +func (o *GetMoveOK) WithPayload(payload *ghcmessages.Move) *GetMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move o k response +func (o *GetMoveOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveBadRequestCode is the HTTP code returned for type GetMoveBadRequest +const GetMoveBadRequestCode int = 400 + +/* +GetMoveBadRequest The request payload is invalid + +swagger:response getMoveBadRequest +*/ +type GetMoveBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveBadRequest creates GetMoveBadRequest with default headers values +func NewGetMoveBadRequest() *GetMoveBadRequest { + + return &GetMoveBadRequest{} +} + +// WithPayload adds the payload to the get move bad request response +func (o *GetMoveBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move bad request response +func (o *GetMoveBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveUnauthorizedCode is the HTTP code returned for type GetMoveUnauthorized +const GetMoveUnauthorizedCode int = 401 + +/* +GetMoveUnauthorized The request was denied + +swagger:response getMoveUnauthorized +*/ +type GetMoveUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveUnauthorized creates GetMoveUnauthorized with default headers values +func NewGetMoveUnauthorized() *GetMoveUnauthorized { + + return &GetMoveUnauthorized{} +} + +// WithPayload adds the payload to the get move unauthorized response +func (o *GetMoveUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move unauthorized response +func (o *GetMoveUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveForbiddenCode is the HTTP code returned for type GetMoveForbidden +const GetMoveForbiddenCode int = 403 + +/* +GetMoveForbidden The request was denied + +swagger:response getMoveForbidden +*/ +type GetMoveForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveForbidden creates GetMoveForbidden with default headers values +func NewGetMoveForbidden() *GetMoveForbidden { + + return &GetMoveForbidden{} +} + +// WithPayload adds the payload to the get move forbidden response +func (o *GetMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move forbidden response +func (o *GetMoveForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveNotFoundCode is the HTTP code returned for type GetMoveNotFound +const GetMoveNotFoundCode int = 404 + +/* +GetMoveNotFound The requested resource wasn't found + +swagger:response getMoveNotFound +*/ +type GetMoveNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveNotFound creates GetMoveNotFound with default headers values +func NewGetMoveNotFound() *GetMoveNotFound { + + return &GetMoveNotFound{} +} + +// WithPayload adds the payload to the get move not found response +func (o *GetMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move not found response +func (o *GetMoveNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveInternalServerErrorCode is the HTTP code returned for type GetMoveInternalServerError +const GetMoveInternalServerErrorCode int = 500 + +/* +GetMoveInternalServerError A server error occurred + +swagger:response getMoveInternalServerError +*/ +type GetMoveInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveInternalServerError creates GetMoveInternalServerError with default headers values +func NewGetMoveInternalServerError() *GetMoveInternalServerError { + + return &GetMoveInternalServerError{} +} + +// WithPayload adds the payload to the get move internal server error response +func (o *GetMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move internal server error response +func (o *GetMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go new file mode 100644 index 00000000000..d124b8d8f74 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveShipmentEvaluationReportsListHandlerFunc turns a function with the right signature into a get move shipment evaluation reports list handler +type GetMoveShipmentEvaluationReportsListHandlerFunc func(GetMoveShipmentEvaluationReportsListParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveShipmentEvaluationReportsListHandlerFunc) Handle(params GetMoveShipmentEvaluationReportsListParams) middleware.Responder { + return fn(params) +} + +// GetMoveShipmentEvaluationReportsListHandler interface for that can handle valid get move shipment evaluation reports list params +type GetMoveShipmentEvaluationReportsListHandler interface { + Handle(GetMoveShipmentEvaluationReportsListParams) middleware.Responder +} + +// NewGetMoveShipmentEvaluationReportsList creates a new http.Handler for the get move shipment evaluation reports list operation +func NewGetMoveShipmentEvaluationReportsList(ctx *middleware.Context, handler GetMoveShipmentEvaluationReportsListHandler) *GetMoveShipmentEvaluationReportsList { + return &GetMoveShipmentEvaluationReportsList{Context: ctx, Handler: handler} +} + +/* + GetMoveShipmentEvaluationReportsList swagger:route GET /moves/{moveID}/shipment-evaluation-reports-list move getMoveShipmentEvaluationReportsList + +# Returns shipment evaluation reports for the specified move that are visible to the current office user + +Returns shipment evaluation reports for the specified move that are visible to the current office user +*/ +type GetMoveShipmentEvaluationReportsList struct { + Context *middleware.Context + Handler GetMoveShipmentEvaluationReportsListHandler +} + +func (o *GetMoveShipmentEvaluationReportsList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveShipmentEvaluationReportsListParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go new file mode 100644 index 00000000000..1538328f9fd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetMoveShipmentEvaluationReportsListParams creates a new GetMoveShipmentEvaluationReportsListParams object +// +// There are no default values defined in the spec. +func NewGetMoveShipmentEvaluationReportsListParams() GetMoveShipmentEvaluationReportsListParams { + + return GetMoveShipmentEvaluationReportsListParams{} +} + +// GetMoveShipmentEvaluationReportsListParams contains all the bound params for the get move shipment evaluation reports list operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveShipmentEvaluationReportsList +type GetMoveShipmentEvaluationReportsListParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Code used to identify a move in the system + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveShipmentEvaluationReportsListParams() beforehand. +func (o *GetMoveShipmentEvaluationReportsListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveShipmentEvaluationReportsListParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *GetMoveShipmentEvaluationReportsListParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go new file mode 100644 index 00000000000..063c638d677 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMoveShipmentEvaluationReportsListOKCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListOK +const GetMoveShipmentEvaluationReportsListOKCode int = 200 + +/* +GetMoveShipmentEvaluationReportsListOK Successfully retrieved the move's evaluation reports + +swagger:response getMoveShipmentEvaluationReportsListOK +*/ +type GetMoveShipmentEvaluationReportsListOK struct { + + /* + In: Body + */ + Payload ghcmessages.EvaluationReportList `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListOK creates GetMoveShipmentEvaluationReportsListOK with default headers values +func NewGetMoveShipmentEvaluationReportsListOK() *GetMoveShipmentEvaluationReportsListOK { + + return &GetMoveShipmentEvaluationReportsListOK{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list o k response +func (o *GetMoveShipmentEvaluationReportsListOK) WithPayload(payload ghcmessages.EvaluationReportList) *GetMoveShipmentEvaluationReportsListOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list o k response +func (o *GetMoveShipmentEvaluationReportsListOK) SetPayload(payload ghcmessages.EvaluationReportList) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.EvaluationReportList{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetMoveShipmentEvaluationReportsListBadRequestCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListBadRequest +const GetMoveShipmentEvaluationReportsListBadRequestCode int = 400 + +/* +GetMoveShipmentEvaluationReportsListBadRequest The request payload is invalid + +swagger:response getMoveShipmentEvaluationReportsListBadRequest +*/ +type GetMoveShipmentEvaluationReportsListBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListBadRequest creates GetMoveShipmentEvaluationReportsListBadRequest with default headers values +func NewGetMoveShipmentEvaluationReportsListBadRequest() *GetMoveShipmentEvaluationReportsListBadRequest { + + return &GetMoveShipmentEvaluationReportsListBadRequest{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list bad request response +func (o *GetMoveShipmentEvaluationReportsListBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list bad request response +func (o *GetMoveShipmentEvaluationReportsListBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveShipmentEvaluationReportsListUnauthorizedCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListUnauthorized +const GetMoveShipmentEvaluationReportsListUnauthorizedCode int = 401 + +/* +GetMoveShipmentEvaluationReportsListUnauthorized The request was denied + +swagger:response getMoveShipmentEvaluationReportsListUnauthorized +*/ +type GetMoveShipmentEvaluationReportsListUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListUnauthorized creates GetMoveShipmentEvaluationReportsListUnauthorized with default headers values +func NewGetMoveShipmentEvaluationReportsListUnauthorized() *GetMoveShipmentEvaluationReportsListUnauthorized { + + return &GetMoveShipmentEvaluationReportsListUnauthorized{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list unauthorized response +func (o *GetMoveShipmentEvaluationReportsListUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list unauthorized response +func (o *GetMoveShipmentEvaluationReportsListUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveShipmentEvaluationReportsListForbiddenCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListForbidden +const GetMoveShipmentEvaluationReportsListForbiddenCode int = 403 + +/* +GetMoveShipmentEvaluationReportsListForbidden The request was denied + +swagger:response getMoveShipmentEvaluationReportsListForbidden +*/ +type GetMoveShipmentEvaluationReportsListForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListForbidden creates GetMoveShipmentEvaluationReportsListForbidden with default headers values +func NewGetMoveShipmentEvaluationReportsListForbidden() *GetMoveShipmentEvaluationReportsListForbidden { + + return &GetMoveShipmentEvaluationReportsListForbidden{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list forbidden response +func (o *GetMoveShipmentEvaluationReportsListForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list forbidden response +func (o *GetMoveShipmentEvaluationReportsListForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveShipmentEvaluationReportsListNotFoundCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListNotFound +const GetMoveShipmentEvaluationReportsListNotFoundCode int = 404 + +/* +GetMoveShipmentEvaluationReportsListNotFound The requested resource wasn't found + +swagger:response getMoveShipmentEvaluationReportsListNotFound +*/ +type GetMoveShipmentEvaluationReportsListNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListNotFound creates GetMoveShipmentEvaluationReportsListNotFound with default headers values +func NewGetMoveShipmentEvaluationReportsListNotFound() *GetMoveShipmentEvaluationReportsListNotFound { + + return &GetMoveShipmentEvaluationReportsListNotFound{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list not found response +func (o *GetMoveShipmentEvaluationReportsListNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list not found response +func (o *GetMoveShipmentEvaluationReportsListNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveShipmentEvaluationReportsListInternalServerErrorCode is the HTTP code returned for type GetMoveShipmentEvaluationReportsListInternalServerError +const GetMoveShipmentEvaluationReportsListInternalServerErrorCode int = 500 + +/* +GetMoveShipmentEvaluationReportsListInternalServerError A server error occurred + +swagger:response getMoveShipmentEvaluationReportsListInternalServerError +*/ +type GetMoveShipmentEvaluationReportsListInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveShipmentEvaluationReportsListInternalServerError creates GetMoveShipmentEvaluationReportsListInternalServerError with default headers values +func NewGetMoveShipmentEvaluationReportsListInternalServerError() *GetMoveShipmentEvaluationReportsListInternalServerError { + + return &GetMoveShipmentEvaluationReportsListInternalServerError{} +} + +// WithPayload adds the payload to the get move shipment evaluation reports list internal server error response +func (o *GetMoveShipmentEvaluationReportsListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveShipmentEvaluationReportsListInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move shipment evaluation reports list internal server error response +func (o *GetMoveShipmentEvaluationReportsListInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveShipmentEvaluationReportsListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go new file mode 100644 index 00000000000..3854b930ca0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_shipment_evaluation_reports_list_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetMoveShipmentEvaluationReportsListURL generates an URL for the get move shipment evaluation reports list operation +type GetMoveShipmentEvaluationReportsListURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveShipmentEvaluationReportsListURL) WithBasePath(bp string) *GetMoveShipmentEvaluationReportsListURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveShipmentEvaluationReportsListURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveShipmentEvaluationReportsListURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/shipment-evaluation-reports-list" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveShipmentEvaluationReportsListURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveShipmentEvaluationReportsListURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveShipmentEvaluationReportsListURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveShipmentEvaluationReportsListURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveShipmentEvaluationReportsListURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveShipmentEvaluationReportsListURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveShipmentEvaluationReportsListURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go new file mode 100644 index 00000000000..c4e0dc786aa --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/get_move_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveURL generates an URL for the get move operation +type GetMoveURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveURL) WithBasePath(bp string) *GetMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move/{locator}" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on GetMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go new file mode 100644 index 00000000000..5036a38e3a0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/move_canceler.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// MoveCancelerHandlerFunc turns a function with the right signature into a move canceler handler +type MoveCancelerHandlerFunc func(MoveCancelerParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn MoveCancelerHandlerFunc) Handle(params MoveCancelerParams) middleware.Responder { + return fn(params) +} + +// MoveCancelerHandler interface for that can handle valid move canceler params +type MoveCancelerHandler interface { + Handle(MoveCancelerParams) middleware.Responder +} + +// NewMoveCanceler creates a new http.Handler for the move canceler operation +func NewMoveCanceler(ctx *middleware.Context, handler MoveCancelerHandler) *MoveCanceler { + return &MoveCanceler{Context: ctx, Handler: handler} +} + +/* + MoveCanceler swagger:route POST /moves/{moveID}/cancel move moveCanceler + +# Cancels a move + +cancels a move +*/ +type MoveCanceler struct { + Context *middleware.Context + Handler MoveCancelerHandler +} + +func (o *MoveCanceler) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewMoveCancelerParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go new file mode 100644 index 00000000000..e997f36bc19 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewMoveCancelerParams creates a new MoveCancelerParams object +// +// There are no default values defined in the spec. +func NewMoveCancelerParams() MoveCancelerParams { + + return MoveCancelerParams{} +} + +// MoveCancelerParams contains all the bound params for the move canceler operation +// typically these are obtained from a http.Request +// +// swagger:parameters moveCanceler +type MoveCancelerParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewMoveCancelerParams() beforehand. +func (o *MoveCancelerParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *MoveCancelerParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *MoveCancelerParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go new file mode 100644 index 00000000000..d96b78fc5af --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// MoveCancelerOKCode is the HTTP code returned for type MoveCancelerOK +const MoveCancelerOKCode int = 200 + +/* +MoveCancelerOK Successfully canceled move + +swagger:response moveCancelerOK +*/ +type MoveCancelerOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewMoveCancelerOK creates MoveCancelerOK with default headers values +func NewMoveCancelerOK() *MoveCancelerOK { + + return &MoveCancelerOK{} +} + +// WithPayload adds the payload to the move canceler o k response +func (o *MoveCancelerOK) WithPayload(payload *ghcmessages.Move) *MoveCancelerOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler o k response +func (o *MoveCancelerOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerForbiddenCode is the HTTP code returned for type MoveCancelerForbidden +const MoveCancelerForbiddenCode int = 403 + +/* +MoveCancelerForbidden The request was denied + +swagger:response moveCancelerForbidden +*/ +type MoveCancelerForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewMoveCancelerForbidden creates MoveCancelerForbidden with default headers values +func NewMoveCancelerForbidden() *MoveCancelerForbidden { + + return &MoveCancelerForbidden{} +} + +// WithPayload adds the payload to the move canceler forbidden response +func (o *MoveCancelerForbidden) WithPayload(payload *ghcmessages.Error) *MoveCancelerForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler forbidden response +func (o *MoveCancelerForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerNotFoundCode is the HTTP code returned for type MoveCancelerNotFound +const MoveCancelerNotFoundCode int = 404 + +/* +MoveCancelerNotFound The requested resource wasn't found + +swagger:response moveCancelerNotFound +*/ +type MoveCancelerNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewMoveCancelerNotFound creates MoveCancelerNotFound with default headers values +func NewMoveCancelerNotFound() *MoveCancelerNotFound { + + return &MoveCancelerNotFound{} +} + +// WithPayload adds the payload to the move canceler not found response +func (o *MoveCancelerNotFound) WithPayload(payload *ghcmessages.Error) *MoveCancelerNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler not found response +func (o *MoveCancelerNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerConflictCode is the HTTP code returned for type MoveCancelerConflict +const MoveCancelerConflictCode int = 409 + +/* +MoveCancelerConflict Conflict error + +swagger:response moveCancelerConflict +*/ +type MoveCancelerConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewMoveCancelerConflict creates MoveCancelerConflict with default headers values +func NewMoveCancelerConflict() *MoveCancelerConflict { + + return &MoveCancelerConflict{} +} + +// WithPayload adds the payload to the move canceler conflict response +func (o *MoveCancelerConflict) WithPayload(payload *ghcmessages.Error) *MoveCancelerConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler conflict response +func (o *MoveCancelerConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerPreconditionFailedCode is the HTTP code returned for type MoveCancelerPreconditionFailed +const MoveCancelerPreconditionFailedCode int = 412 + +/* +MoveCancelerPreconditionFailed Precondition failed + +swagger:response moveCancelerPreconditionFailed +*/ +type MoveCancelerPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewMoveCancelerPreconditionFailed creates MoveCancelerPreconditionFailed with default headers values +func NewMoveCancelerPreconditionFailed() *MoveCancelerPreconditionFailed { + + return &MoveCancelerPreconditionFailed{} +} + +// WithPayload adds the payload to the move canceler precondition failed response +func (o *MoveCancelerPreconditionFailed) WithPayload(payload *ghcmessages.Error) *MoveCancelerPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler precondition failed response +func (o *MoveCancelerPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerUnprocessableEntityCode is the HTTP code returned for type MoveCancelerUnprocessableEntity +const MoveCancelerUnprocessableEntityCode int = 422 + +/* +MoveCancelerUnprocessableEntity The payload was unprocessable. + +swagger:response moveCancelerUnprocessableEntity +*/ +type MoveCancelerUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewMoveCancelerUnprocessableEntity creates MoveCancelerUnprocessableEntity with default headers values +func NewMoveCancelerUnprocessableEntity() *MoveCancelerUnprocessableEntity { + + return &MoveCancelerUnprocessableEntity{} +} + +// WithPayload adds the payload to the move canceler unprocessable entity response +func (o *MoveCancelerUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *MoveCancelerUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler unprocessable entity response +func (o *MoveCancelerUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MoveCancelerInternalServerErrorCode is the HTTP code returned for type MoveCancelerInternalServerError +const MoveCancelerInternalServerErrorCode int = 500 + +/* +MoveCancelerInternalServerError A server error occurred + +swagger:response moveCancelerInternalServerError +*/ +type MoveCancelerInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewMoveCancelerInternalServerError creates MoveCancelerInternalServerError with default headers values +func NewMoveCancelerInternalServerError() *MoveCancelerInternalServerError { + + return &MoveCancelerInternalServerError{} +} + +// WithPayload adds the payload to the move canceler internal server error response +func (o *MoveCancelerInternalServerError) WithPayload(payload *ghcmessages.Error) *MoveCancelerInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the move canceler internal server error response +func (o *MoveCancelerInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MoveCancelerInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go new file mode 100644 index 00000000000..f3f6ebb25eb --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/move_canceler_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// MoveCancelerURL generates an URL for the move canceler operation +type MoveCancelerURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *MoveCancelerURL) WithBasePath(bp string) *MoveCancelerURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *MoveCancelerURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *MoveCancelerURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/cancel" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on MoveCancelerURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *MoveCancelerURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *MoveCancelerURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *MoveCancelerURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on MoveCancelerURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on MoveCancelerURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *MoveCancelerURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go new file mode 100644 index 00000000000..d54a3739ead --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves.go @@ -0,0 +1,430 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "encoding/json" + "net/http" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SearchMovesHandlerFunc turns a function with the right signature into a search moves handler +type SearchMovesHandlerFunc func(SearchMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SearchMovesHandlerFunc) Handle(params SearchMovesParams) middleware.Responder { + return fn(params) +} + +// SearchMovesHandler interface for that can handle valid search moves params +type SearchMovesHandler interface { + Handle(SearchMovesParams) middleware.Responder +} + +// NewSearchMoves creates a new http.Handler for the search moves operation +func NewSearchMoves(ctx *middleware.Context, handler SearchMovesHandler) *SearchMoves { + return &SearchMoves{Context: ctx, Handler: handler} +} + +/* + SearchMoves swagger:route POST /moves/search move searchMoves + +# Search moves by locator, DOD ID, or customer name + +Search moves by locator, DOD ID, or customer name. Used by QAE and CSR users. +*/ +type SearchMoves struct { + Context *middleware.Context + Handler SearchMovesHandler +} + +func (o *SearchMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSearchMovesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// SearchMovesBody search moves body +// +// swagger:model SearchMovesBody +type SearchMovesBody struct { + + // branch + Branch *string `json:"branch,omitempty"` + + // Customer Name + // Min Length: 1 + CustomerName *string `json:"customerName,omitempty"` + + // delivery date + // Format: date-time + DeliveryDate *strfmt.DateTime `json:"deliveryDate,omitempty"` + + // destination postal code + DestinationPostalCode *string `json:"destinationPostalCode,omitempty"` + + // DOD ID + // Max Length: 10 + // Min Length: 10 + Edipi *string `json:"edipi,omitempty"` + + // EMPLID + // Max Length: 7 + // Min Length: 7 + Emplid *string `json:"emplid,omitempty"` + + // Move locator + // Max Length: 6 + // Min Length: 6 + Locator *string `json:"locator,omitempty"` + + // order + // Enum: [asc desc] + Order *string `json:"order,omitempty"` + + // origin postal code + OriginPostalCode *string `json:"originPostalCode,omitempty"` + + // requested page of results + Page int64 `json:"page,omitempty"` + + // payment request code + // Example: 9551-6199-2 + PaymentRequestCode *string `json:"paymentRequestCode,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // pickup date + // Format: date-time + PickupDate *strfmt.DateTime `json:"pickupDate,omitempty"` + + // shipments count + ShipmentsCount *int64 `json:"shipmentsCount,omitempty"` + + // sort + // Enum: [customerName edipi emplid branch locator status originPostalCode destinationPostalCode shipmentsCount] + Sort *string `json:"sort,omitempty"` + + // Filtering for the status. + // Unique: true + Status []string `json:"status"` +} + +// Validate validates this search moves body +func (o *SearchMovesBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCustomerName(formats); err != nil { + res = append(res, err) + } + + if err := o.validateDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := o.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := o.validateEmplid(formats); err != nil { + res = append(res, err) + } + + if err := o.validateLocator(formats); err != nil { + res = append(res, err) + } + + if err := o.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := o.validatePickupDate(formats); err != nil { + res = append(res, err) + } + + if err := o.validateSort(formats); err != nil { + res = append(res, err) + } + + if err := o.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SearchMovesBody) validateCustomerName(formats strfmt.Registry) error { + if swag.IsZero(o.CustomerName) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"customerName", "body", *o.CustomerName, 1); err != nil { + return err + } + + return nil +} + +func (o *SearchMovesBody) validateDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(o.DeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("body"+"."+"deliveryDate", "body", "date-time", o.DeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (o *SearchMovesBody) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(o.Edipi) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("body"+"."+"edipi", "body", *o.Edipi, 10); err != nil { + return err + } + + return nil +} + +func (o *SearchMovesBody) validateEmplid(formats strfmt.Registry) error { + if swag.IsZero(o.Emplid) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { + return err + } + + if err := validate.MaxLength("body"+"."+"emplid", "body", *o.Emplid, 7); err != nil { + return err + } + + return nil +} + +func (o *SearchMovesBody) validateLocator(formats strfmt.Registry) error { + if swag.IsZero(o.Locator) { // not required + return nil + } + + if err := validate.MinLength("body"+"."+"locator", "body", *o.Locator, 6); err != nil { + return err + } + + if err := validate.MaxLength("body"+"."+"locator", "body", *o.Locator, 6); err != nil { + return err + } + + return nil +} + +var searchMovesBodyTypeOrderPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["asc","desc"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + searchMovesBodyTypeOrderPropEnum = append(searchMovesBodyTypeOrderPropEnum, v) + } +} + +const ( + + // SearchMovesBodyOrderAsc captures enum value "asc" + SearchMovesBodyOrderAsc string = "asc" + + // SearchMovesBodyOrderDesc captures enum value "desc" + SearchMovesBodyOrderDesc string = "desc" +) + +// prop value enum +func (o *SearchMovesBody) validateOrderEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, searchMovesBodyTypeOrderPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *SearchMovesBody) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(o.Order) { // not required + return nil + } + + // value enum + if err := o.validateOrderEnum("body"+"."+"order", "body", *o.Order); err != nil { + return err + } + + return nil +} + +func (o *SearchMovesBody) validatePickupDate(formats strfmt.Registry) error { + if swag.IsZero(o.PickupDate) { // not required + return nil + } + + if err := validate.FormatOf("body"+"."+"pickupDate", "body", "date-time", o.PickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +var searchMovesBodyTypeSortPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["customerName","edipi","emplid","branch","locator","status","originPostalCode","destinationPostalCode","shipmentsCount"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + searchMovesBodyTypeSortPropEnum = append(searchMovesBodyTypeSortPropEnum, v) + } +} + +const ( + + // SearchMovesBodySortCustomerName captures enum value "customerName" + SearchMovesBodySortCustomerName string = "customerName" + + // SearchMovesBodySortEdipi captures enum value "edipi" + SearchMovesBodySortEdipi string = "edipi" + + // SearchMovesBodySortEmplid captures enum value "emplid" + SearchMovesBodySortEmplid string = "emplid" + + // SearchMovesBodySortBranch captures enum value "branch" + SearchMovesBodySortBranch string = "branch" + + // SearchMovesBodySortLocator captures enum value "locator" + SearchMovesBodySortLocator string = "locator" + + // SearchMovesBodySortStatus captures enum value "status" + SearchMovesBodySortStatus string = "status" + + // SearchMovesBodySortOriginPostalCode captures enum value "originPostalCode" + SearchMovesBodySortOriginPostalCode string = "originPostalCode" + + // SearchMovesBodySortDestinationPostalCode captures enum value "destinationPostalCode" + SearchMovesBodySortDestinationPostalCode string = "destinationPostalCode" + + // SearchMovesBodySortShipmentsCount captures enum value "shipmentsCount" + SearchMovesBodySortShipmentsCount string = "shipmentsCount" +) + +// prop value enum +func (o *SearchMovesBody) validateSortEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, searchMovesBodyTypeSortPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *SearchMovesBody) validateSort(formats strfmt.Registry) error { + if swag.IsZero(o.Sort) { // not required + return nil + } + + // value enum + if err := o.validateSortEnum("body"+"."+"sort", "body", *o.Sort); err != nil { + return err + } + + return nil +} + +var searchMovesBodyStatusItemsEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVALS REQUESTED","APPROVED","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + searchMovesBodyStatusItemsEnum = append(searchMovesBodyStatusItemsEnum, v) + } +} + +func (o *SearchMovesBody) validateStatusItemsEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, searchMovesBodyStatusItemsEnum, true); err != nil { + return err + } + return nil +} + +func (o *SearchMovesBody) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(o.Status) { // not required + return nil + } + + if err := validate.UniqueItems("body"+"."+"status", "body", o.Status); err != nil { + return err + } + + for i := 0; i < len(o.Status); i++ { + + // value enum + if err := o.validateStatusItemsEnum("body"+"."+"status"+"."+strconv.Itoa(i), "body", o.Status[i]); err != nil { + return err + } + + } + + return nil +} + +// ContextValidate validates this search moves body based on context it is used +func (o *SearchMovesBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SearchMovesBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SearchMovesBody) UnmarshalBinary(b []byte) error { + var res SearchMovesBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go new file mode 100644 index 00000000000..d35fba4a7a1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves_parameters.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" +) + +// NewSearchMovesParams creates a new SearchMovesParams object +// +// There are no default values defined in the spec. +func NewSearchMovesParams() SearchMovesParams { + + return SearchMovesParams{} +} + +// SearchMovesParams contains all the bound params for the search moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters searchMoves +type SearchMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*field that results should be sorted by + In: body + */ + Body SearchMovesBody +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSearchMovesParams() beforehand. +func (o *SearchMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body SearchMovesBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go new file mode 100644 index 00000000000..28872076183 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// SearchMovesOKCode is the HTTP code returned for type SearchMovesOK +const SearchMovesOKCode int = 200 + +/* +SearchMovesOK Successfully returned all moves matching the criteria + +swagger:response searchMovesOK +*/ +type SearchMovesOK struct { + + /* + In: Body + */ + Payload *ghcmessages.SearchMovesResult `json:"body,omitempty"` +} + +// NewSearchMovesOK creates SearchMovesOK with default headers values +func NewSearchMovesOK() *SearchMovesOK { + + return &SearchMovesOK{} +} + +// WithPayload adds the payload to the search moves o k response +func (o *SearchMovesOK) WithPayload(payload *ghcmessages.SearchMovesResult) *SearchMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search moves o k response +func (o *SearchMovesOK) SetPayload(payload *ghcmessages.SearchMovesResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SearchMovesForbiddenCode is the HTTP code returned for type SearchMovesForbidden +const SearchMovesForbiddenCode int = 403 + +/* +SearchMovesForbidden The request was denied + +swagger:response searchMovesForbidden +*/ +type SearchMovesForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSearchMovesForbidden creates SearchMovesForbidden with default headers values +func NewSearchMovesForbidden() *SearchMovesForbidden { + + return &SearchMovesForbidden{} +} + +// WithPayload adds the payload to the search moves forbidden response +func (o *SearchMovesForbidden) WithPayload(payload *ghcmessages.Error) *SearchMovesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search moves forbidden response +func (o *SearchMovesForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SearchMovesInternalServerErrorCode is the HTTP code returned for type SearchMovesInternalServerError +const SearchMovesInternalServerErrorCode int = 500 + +/* +SearchMovesInternalServerError A server error occurred + +swagger:response searchMovesInternalServerError +*/ +type SearchMovesInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSearchMovesInternalServerError creates SearchMovesInternalServerError with default headers values +func NewSearchMovesInternalServerError() *SearchMovesInternalServerError { + + return &SearchMovesInternalServerError{} +} + +// WithPayload adds the payload to the search moves internal server error response +func (o *SearchMovesInternalServerError) WithPayload(payload *ghcmessages.Error) *SearchMovesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search moves internal server error response +func (o *SearchMovesInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go new file mode 100644 index 00000000000..12f5b61885e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/search_moves_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// SearchMovesURL generates an URL for the search moves operation +type SearchMovesURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchMovesURL) WithBasePath(bp string) *SearchMovesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SearchMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/search" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SearchMovesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SearchMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SearchMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SearchMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SearchMovesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SearchMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go new file mode 100644 index 00000000000..439a4363a7f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SetFinancialReviewFlagHandlerFunc turns a function with the right signature into a set financial review flag handler +type SetFinancialReviewFlagHandlerFunc func(SetFinancialReviewFlagParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SetFinancialReviewFlagHandlerFunc) Handle(params SetFinancialReviewFlagParams) middleware.Responder { + return fn(params) +} + +// SetFinancialReviewFlagHandler interface for that can handle valid set financial review flag params +type SetFinancialReviewFlagHandler interface { + Handle(SetFinancialReviewFlagParams) middleware.Responder +} + +// NewSetFinancialReviewFlag creates a new http.Handler for the set financial review flag operation +func NewSetFinancialReviewFlag(ctx *middleware.Context, handler SetFinancialReviewFlagHandler) *SetFinancialReviewFlag { + return &SetFinancialReviewFlag{Context: ctx, Handler: handler} +} + +/* + SetFinancialReviewFlag swagger:route POST /moves/{moveID}/financial-review-flag move setFinancialReviewFlag + +# Flags a move for financial office review + +This sets a flag which indicates that the move should be reviewed by a fincancial office. For example, if the origin or delivery address of a shipment is far from the duty location and may incur excess costs to the customer. +*/ +type SetFinancialReviewFlag struct { + Context *middleware.Context + Handler SetFinancialReviewFlagHandler +} + +func (o *SetFinancialReviewFlag) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSetFinancialReviewFlagParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// SetFinancialReviewFlagBody set financial review flag body +// +// swagger:model SetFinancialReviewFlagBody +type SetFinancialReviewFlagBody struct { + + // boolean value representing whether we should flag a move for financial review + // Example: false + // Required: true + FlagForReview *bool `json:"flagForReview"` + + // explanation of why the move is being flagged for financial review + // Example: this address is way too far away + Remarks *string `json:"remarks,omitempty"` +} + +// Validate validates this set financial review flag body +func (o *SetFinancialReviewFlagBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateFlagForReview(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *SetFinancialReviewFlagBody) validateFlagForReview(formats strfmt.Registry) error { + + if err := validate.Required("body"+"."+"flagForReview", "body", o.FlagForReview); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this set financial review flag body based on context it is used +func (o *SetFinancialReviewFlagBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *SetFinancialReviewFlagBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *SetFinancialReviewFlagBody) UnmarshalBinary(b []byte) error { + var res SetFinancialReviewFlagBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go new file mode 100644 index 00000000000..a3670952284 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_parameters.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewSetFinancialReviewFlagParams creates a new SetFinancialReviewFlagParams object +// +// There are no default values defined in the spec. +func NewSetFinancialReviewFlagParams() SetFinancialReviewFlagParams { + + return SetFinancialReviewFlagParams{} +} + +// SetFinancialReviewFlagParams contains all the bound params for the set financial review flag operation +// typically these are obtained from a http.Request +// +// swagger:parameters setFinancialReviewFlag +type SetFinancialReviewFlagParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: header + */ + IfMatch *string + /* + In: body + */ + Body SetFinancialReviewFlagBody + /*ID of move to flag + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSetFinancialReviewFlagParams() beforehand. +func (o *SetFinancialReviewFlagParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body SetFinancialReviewFlagBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *SetFinancialReviewFlagParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.IfMatch = &raw + + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *SetFinancialReviewFlagParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *SetFinancialReviewFlagParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go new file mode 100644 index 00000000000..376131d716a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// SetFinancialReviewFlagOKCode is the HTTP code returned for type SetFinancialReviewFlagOK +const SetFinancialReviewFlagOKCode int = 200 + +/* +SetFinancialReviewFlagOK updated Move + +swagger:response setFinancialReviewFlagOK +*/ +type SetFinancialReviewFlagOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagOK creates SetFinancialReviewFlagOK with default headers values +func NewSetFinancialReviewFlagOK() *SetFinancialReviewFlagOK { + + return &SetFinancialReviewFlagOK{} +} + +// WithPayload adds the payload to the set financial review flag o k response +func (o *SetFinancialReviewFlagOK) WithPayload(payload *ghcmessages.Move) *SetFinancialReviewFlagOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag o k response +func (o *SetFinancialReviewFlagOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SetFinancialReviewFlagForbiddenCode is the HTTP code returned for type SetFinancialReviewFlagForbidden +const SetFinancialReviewFlagForbiddenCode int = 403 + +/* +SetFinancialReviewFlagForbidden The request was denied + +swagger:response setFinancialReviewFlagForbidden +*/ +type SetFinancialReviewFlagForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagForbidden creates SetFinancialReviewFlagForbidden with default headers values +func NewSetFinancialReviewFlagForbidden() *SetFinancialReviewFlagForbidden { + + return &SetFinancialReviewFlagForbidden{} +} + +// WithPayload adds the payload to the set financial review flag forbidden response +func (o *SetFinancialReviewFlagForbidden) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag forbidden response +func (o *SetFinancialReviewFlagForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SetFinancialReviewFlagNotFoundCode is the HTTP code returned for type SetFinancialReviewFlagNotFound +const SetFinancialReviewFlagNotFoundCode int = 404 + +/* +SetFinancialReviewFlagNotFound The requested resource wasn't found + +swagger:response setFinancialReviewFlagNotFound +*/ +type SetFinancialReviewFlagNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagNotFound creates SetFinancialReviewFlagNotFound with default headers values +func NewSetFinancialReviewFlagNotFound() *SetFinancialReviewFlagNotFound { + + return &SetFinancialReviewFlagNotFound{} +} + +// WithPayload adds the payload to the set financial review flag not found response +func (o *SetFinancialReviewFlagNotFound) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag not found response +func (o *SetFinancialReviewFlagNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SetFinancialReviewFlagPreconditionFailedCode is the HTTP code returned for type SetFinancialReviewFlagPreconditionFailed +const SetFinancialReviewFlagPreconditionFailedCode int = 412 + +/* +SetFinancialReviewFlagPreconditionFailed Precondition failed + +swagger:response setFinancialReviewFlagPreconditionFailed +*/ +type SetFinancialReviewFlagPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagPreconditionFailed creates SetFinancialReviewFlagPreconditionFailed with default headers values +func NewSetFinancialReviewFlagPreconditionFailed() *SetFinancialReviewFlagPreconditionFailed { + + return &SetFinancialReviewFlagPreconditionFailed{} +} + +// WithPayload adds the payload to the set financial review flag precondition failed response +func (o *SetFinancialReviewFlagPreconditionFailed) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag precondition failed response +func (o *SetFinancialReviewFlagPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SetFinancialReviewFlagUnprocessableEntityCode is the HTTP code returned for type SetFinancialReviewFlagUnprocessableEntity +const SetFinancialReviewFlagUnprocessableEntityCode int = 422 + +/* +SetFinancialReviewFlagUnprocessableEntity The payload was unprocessable. + +swagger:response setFinancialReviewFlagUnprocessableEntity +*/ +type SetFinancialReviewFlagUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagUnprocessableEntity creates SetFinancialReviewFlagUnprocessableEntity with default headers values +func NewSetFinancialReviewFlagUnprocessableEntity() *SetFinancialReviewFlagUnprocessableEntity { + + return &SetFinancialReviewFlagUnprocessableEntity{} +} + +// WithPayload adds the payload to the set financial review flag unprocessable entity response +func (o *SetFinancialReviewFlagUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *SetFinancialReviewFlagUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag unprocessable entity response +func (o *SetFinancialReviewFlagUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SetFinancialReviewFlagInternalServerErrorCode is the HTTP code returned for type SetFinancialReviewFlagInternalServerError +const SetFinancialReviewFlagInternalServerErrorCode int = 500 + +/* +SetFinancialReviewFlagInternalServerError A server error occurred + +swagger:response setFinancialReviewFlagInternalServerError +*/ +type SetFinancialReviewFlagInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewSetFinancialReviewFlagInternalServerError creates SetFinancialReviewFlagInternalServerError with default headers values +func NewSetFinancialReviewFlagInternalServerError() *SetFinancialReviewFlagInternalServerError { + + return &SetFinancialReviewFlagInternalServerError{} +} + +// WithPayload adds the payload to the set financial review flag internal server error response +func (o *SetFinancialReviewFlagInternalServerError) WithPayload(payload *ghcmessages.Error) *SetFinancialReviewFlagInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the set financial review flag internal server error response +func (o *SetFinancialReviewFlagInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SetFinancialReviewFlagInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go new file mode 100644 index 00000000000..059b54a60fb --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/set_financial_review_flag_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SetFinancialReviewFlagURL generates an URL for the set financial review flag operation +type SetFinancialReviewFlagURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SetFinancialReviewFlagURL) WithBasePath(bp string) *SetFinancialReviewFlagURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SetFinancialReviewFlagURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SetFinancialReviewFlagURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/financial-review-flag" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on SetFinancialReviewFlagURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SetFinancialReviewFlagURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SetFinancialReviewFlagURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SetFinancialReviewFlagURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SetFinancialReviewFlagURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SetFinancialReviewFlagURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SetFinancialReviewFlagURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go new file mode 100644 index 00000000000..3f827a7c2ec --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateAssignedOfficeUserHandlerFunc turns a function with the right signature into a update assigned office user handler +type UpdateAssignedOfficeUserHandlerFunc func(UpdateAssignedOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateAssignedOfficeUserHandlerFunc) Handle(params UpdateAssignedOfficeUserParams) middleware.Responder { + return fn(params) +} + +// UpdateAssignedOfficeUserHandler interface for that can handle valid update assigned office user params +type UpdateAssignedOfficeUserHandler interface { + Handle(UpdateAssignedOfficeUserParams) middleware.Responder +} + +// NewUpdateAssignedOfficeUser creates a new http.Handler for the update assigned office user operation +func NewUpdateAssignedOfficeUser(ctx *middleware.Context, handler UpdateAssignedOfficeUserHandler) *UpdateAssignedOfficeUser { + return &UpdateAssignedOfficeUser{Context: ctx, Handler: handler} +} + +/* + UpdateAssignedOfficeUser swagger:route PATCH /moves/{moveID}/assignOfficeUser move updateAssignedOfficeUser + +assigns either a services counselor, task ordering officer, or task invoicing officer to the move +*/ +type UpdateAssignedOfficeUser struct { + Context *middleware.Context + Handler UpdateAssignedOfficeUserHandler +} + +func (o *UpdateAssignedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateAssignedOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go new file mode 100644 index 00000000000..547d76b97ae --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateAssignedOfficeUserParams creates a new UpdateAssignedOfficeUserParams object +// +// There are no default values defined in the spec. +func NewUpdateAssignedOfficeUserParams() UpdateAssignedOfficeUserParams { + + return UpdateAssignedOfficeUserParams{} +} + +// UpdateAssignedOfficeUserParams contains all the bound params for the update assigned office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateAssignedOfficeUser +type UpdateAssignedOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *ghcmessages.AssignOfficeUserBody + /*ID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateAssignedOfficeUserParams() beforehand. +func (o *UpdateAssignedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.AssignOfficeUserBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *UpdateAssignedOfficeUserParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *UpdateAssignedOfficeUserParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go new file mode 100644 index 00000000000..d31443bdb2a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateAssignedOfficeUserOKCode is the HTTP code returned for type UpdateAssignedOfficeUserOK +const UpdateAssignedOfficeUserOKCode int = 200 + +/* +UpdateAssignedOfficeUserOK Successfully assigned office user to the move + +swagger:response updateAssignedOfficeUserOK +*/ +type UpdateAssignedOfficeUserOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateAssignedOfficeUserOK creates UpdateAssignedOfficeUserOK with default headers values +func NewUpdateAssignedOfficeUserOK() *UpdateAssignedOfficeUserOK { + + return &UpdateAssignedOfficeUserOK{} +} + +// WithPayload adds the payload to the update assigned office user o k response +func (o *UpdateAssignedOfficeUserOK) WithPayload(payload *ghcmessages.Move) *UpdateAssignedOfficeUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update assigned office user o k response +func (o *UpdateAssignedOfficeUserOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAssignedOfficeUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAssignedOfficeUserNotFoundCode is the HTTP code returned for type UpdateAssignedOfficeUserNotFound +const UpdateAssignedOfficeUserNotFoundCode int = 404 + +/* +UpdateAssignedOfficeUserNotFound The requested resource wasn't found + +swagger:response updateAssignedOfficeUserNotFound +*/ +type UpdateAssignedOfficeUserNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAssignedOfficeUserNotFound creates UpdateAssignedOfficeUserNotFound with default headers values +func NewUpdateAssignedOfficeUserNotFound() *UpdateAssignedOfficeUserNotFound { + + return &UpdateAssignedOfficeUserNotFound{} +} + +// WithPayload adds the payload to the update assigned office user not found response +func (o *UpdateAssignedOfficeUserNotFound) WithPayload(payload *ghcmessages.Error) *UpdateAssignedOfficeUserNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update assigned office user not found response +func (o *UpdateAssignedOfficeUserNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAssignedOfficeUserNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAssignedOfficeUserInternalServerErrorCode is the HTTP code returned for type UpdateAssignedOfficeUserInternalServerError +const UpdateAssignedOfficeUserInternalServerErrorCode int = 500 + +/* +UpdateAssignedOfficeUserInternalServerError A server error occurred + +swagger:response updateAssignedOfficeUserInternalServerError +*/ +type UpdateAssignedOfficeUserInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAssignedOfficeUserInternalServerError creates UpdateAssignedOfficeUserInternalServerError with default headers values +func NewUpdateAssignedOfficeUserInternalServerError() *UpdateAssignedOfficeUserInternalServerError { + + return &UpdateAssignedOfficeUserInternalServerError{} +} + +// WithPayload adds the payload to the update assigned office user internal server error response +func (o *UpdateAssignedOfficeUserInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateAssignedOfficeUserInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update assigned office user internal server error response +func (o *UpdateAssignedOfficeUserInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAssignedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go new file mode 100644 index 00000000000..d02a2ed7909 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_assigned_office_user_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateAssignedOfficeUserURL generates an URL for the update assigned office user operation +type UpdateAssignedOfficeUserURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAssignedOfficeUserURL) WithBasePath(bp string) *UpdateAssignedOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAssignedOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateAssignedOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/assignOfficeUser" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on UpdateAssignedOfficeUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateAssignedOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateAssignedOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateAssignedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateAssignedOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateAssignedOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateAssignedOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go new file mode 100644 index 00000000000..f1aaf468b38 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateCloseoutOfficeHandlerFunc turns a function with the right signature into a update closeout office handler +type UpdateCloseoutOfficeHandlerFunc func(UpdateCloseoutOfficeParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateCloseoutOfficeHandlerFunc) Handle(params UpdateCloseoutOfficeParams) middleware.Responder { + return fn(params) +} + +// UpdateCloseoutOfficeHandler interface for that can handle valid update closeout office params +type UpdateCloseoutOfficeHandler interface { + Handle(UpdateCloseoutOfficeParams) middleware.Responder +} + +// NewUpdateCloseoutOffice creates a new http.Handler for the update closeout office operation +func NewUpdateCloseoutOffice(ctx *middleware.Context, handler UpdateCloseoutOfficeHandler) *UpdateCloseoutOffice { + return &UpdateCloseoutOffice{Context: ctx, Handler: handler} +} + +/* + UpdateCloseoutOffice swagger:route PATCH /moves/{locator}/closeout-office move updateCloseoutOffice + +# Updates a Move's PPM closeout office for Army and Air Force customers + +Sets the transportation office closeout location for where the Move's PPM Shipment documentation will be reviewed by +*/ +type UpdateCloseoutOffice struct { + Context *middleware.Context + Handler UpdateCloseoutOfficeHandler +} + +func (o *UpdateCloseoutOffice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateCloseoutOfficeParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// UpdateCloseoutOfficeBody update closeout office body +// +// swagger:model UpdateCloseoutOfficeBody +type UpdateCloseoutOfficeBody struct { + + // closeout office Id + // Required: true + // Format: uuid + CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId"` +} + +// Validate validates this update closeout office body +func (o *UpdateCloseoutOfficeBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateCloseoutOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdateCloseoutOfficeBody) validateCloseoutOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("body"+"."+"closeoutOfficeId", "body", o.CloseoutOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("body"+"."+"closeoutOfficeId", "body", "uuid", o.CloseoutOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update closeout office body based on context it is used +func (o *UpdateCloseoutOfficeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateCloseoutOfficeBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateCloseoutOfficeBody) UnmarshalBinary(b []byte) error { + var res UpdateCloseoutOfficeBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go new file mode 100644 index 00000000000..59f62355a51 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateCloseoutOfficeParams creates a new UpdateCloseoutOfficeParams object +// +// There are no default values defined in the spec. +func NewUpdateCloseoutOfficeParams() UpdateCloseoutOfficeParams { + + return UpdateCloseoutOfficeParams{} +} + +// UpdateCloseoutOfficeParams contains all the bound params for the update closeout office operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateCloseoutOffice +type UpdateCloseoutOfficeParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + In: body + */ + Body UpdateCloseoutOfficeBody + /*move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateCloseoutOfficeParams() beforehand. +func (o *UpdateCloseoutOfficeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body UpdateCloseoutOfficeBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateCloseoutOfficeParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *UpdateCloseoutOfficeParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go new file mode 100644 index 00000000000..395068d5017 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateCloseoutOfficeOKCode is the HTTP code returned for type UpdateCloseoutOfficeOK +const UpdateCloseoutOfficeOKCode int = 200 + +/* +UpdateCloseoutOfficeOK Successfully set the closeout office for the move + +swagger:response updateCloseoutOfficeOK +*/ +type UpdateCloseoutOfficeOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeOK creates UpdateCloseoutOfficeOK with default headers values +func NewUpdateCloseoutOfficeOK() *UpdateCloseoutOfficeOK { + + return &UpdateCloseoutOfficeOK{} +} + +// WithPayload adds the payload to the update closeout office o k response +func (o *UpdateCloseoutOfficeOK) WithPayload(payload *ghcmessages.Move) *UpdateCloseoutOfficeOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office o k response +func (o *UpdateCloseoutOfficeOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeBadRequestCode is the HTTP code returned for type UpdateCloseoutOfficeBadRequest +const UpdateCloseoutOfficeBadRequestCode int = 400 + +/* +UpdateCloseoutOfficeBadRequest The request payload is invalid + +swagger:response updateCloseoutOfficeBadRequest +*/ +type UpdateCloseoutOfficeBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeBadRequest creates UpdateCloseoutOfficeBadRequest with default headers values +func NewUpdateCloseoutOfficeBadRequest() *UpdateCloseoutOfficeBadRequest { + + return &UpdateCloseoutOfficeBadRequest{} +} + +// WithPayload adds the payload to the update closeout office bad request response +func (o *UpdateCloseoutOfficeBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office bad request response +func (o *UpdateCloseoutOfficeBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeUnauthorizedCode is the HTTP code returned for type UpdateCloseoutOfficeUnauthorized +const UpdateCloseoutOfficeUnauthorizedCode int = 401 + +/* +UpdateCloseoutOfficeUnauthorized The request was denied + +swagger:response updateCloseoutOfficeUnauthorized +*/ +type UpdateCloseoutOfficeUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeUnauthorized creates UpdateCloseoutOfficeUnauthorized with default headers values +func NewUpdateCloseoutOfficeUnauthorized() *UpdateCloseoutOfficeUnauthorized { + + return &UpdateCloseoutOfficeUnauthorized{} +} + +// WithPayload adds the payload to the update closeout office unauthorized response +func (o *UpdateCloseoutOfficeUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office unauthorized response +func (o *UpdateCloseoutOfficeUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeForbiddenCode is the HTTP code returned for type UpdateCloseoutOfficeForbidden +const UpdateCloseoutOfficeForbiddenCode int = 403 + +/* +UpdateCloseoutOfficeForbidden The request was denied + +swagger:response updateCloseoutOfficeForbidden +*/ +type UpdateCloseoutOfficeForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeForbidden creates UpdateCloseoutOfficeForbidden with default headers values +func NewUpdateCloseoutOfficeForbidden() *UpdateCloseoutOfficeForbidden { + + return &UpdateCloseoutOfficeForbidden{} +} + +// WithPayload adds the payload to the update closeout office forbidden response +func (o *UpdateCloseoutOfficeForbidden) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office forbidden response +func (o *UpdateCloseoutOfficeForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeNotFoundCode is the HTTP code returned for type UpdateCloseoutOfficeNotFound +const UpdateCloseoutOfficeNotFoundCode int = 404 + +/* +UpdateCloseoutOfficeNotFound The requested resource wasn't found + +swagger:response updateCloseoutOfficeNotFound +*/ +type UpdateCloseoutOfficeNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeNotFound creates UpdateCloseoutOfficeNotFound with default headers values +func NewUpdateCloseoutOfficeNotFound() *UpdateCloseoutOfficeNotFound { + + return &UpdateCloseoutOfficeNotFound{} +} + +// WithPayload adds the payload to the update closeout office not found response +func (o *UpdateCloseoutOfficeNotFound) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office not found response +func (o *UpdateCloseoutOfficeNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficePreconditionFailedCode is the HTTP code returned for type UpdateCloseoutOfficePreconditionFailed +const UpdateCloseoutOfficePreconditionFailedCode int = 412 + +/* +UpdateCloseoutOfficePreconditionFailed Precondition failed + +swagger:response updateCloseoutOfficePreconditionFailed +*/ +type UpdateCloseoutOfficePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficePreconditionFailed creates UpdateCloseoutOfficePreconditionFailed with default headers values +func NewUpdateCloseoutOfficePreconditionFailed() *UpdateCloseoutOfficePreconditionFailed { + + return &UpdateCloseoutOfficePreconditionFailed{} +} + +// WithPayload adds the payload to the update closeout office precondition failed response +func (o *UpdateCloseoutOfficePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office precondition failed response +func (o *UpdateCloseoutOfficePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeUnprocessableEntityCode is the HTTP code returned for type UpdateCloseoutOfficeUnprocessableEntity +const UpdateCloseoutOfficeUnprocessableEntityCode int = 422 + +/* +UpdateCloseoutOfficeUnprocessableEntity The payload was unprocessable. + +swagger:response updateCloseoutOfficeUnprocessableEntity +*/ +type UpdateCloseoutOfficeUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeUnprocessableEntity creates UpdateCloseoutOfficeUnprocessableEntity with default headers values +func NewUpdateCloseoutOfficeUnprocessableEntity() *UpdateCloseoutOfficeUnprocessableEntity { + + return &UpdateCloseoutOfficeUnprocessableEntity{} +} + +// WithPayload adds the payload to the update closeout office unprocessable entity response +func (o *UpdateCloseoutOfficeUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateCloseoutOfficeUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office unprocessable entity response +func (o *UpdateCloseoutOfficeUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateCloseoutOfficeInternalServerErrorCode is the HTTP code returned for type UpdateCloseoutOfficeInternalServerError +const UpdateCloseoutOfficeInternalServerErrorCode int = 500 + +/* +UpdateCloseoutOfficeInternalServerError A server error occurred + +swagger:response updateCloseoutOfficeInternalServerError +*/ +type UpdateCloseoutOfficeInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateCloseoutOfficeInternalServerError creates UpdateCloseoutOfficeInternalServerError with default headers values +func NewUpdateCloseoutOfficeInternalServerError() *UpdateCloseoutOfficeInternalServerError { + + return &UpdateCloseoutOfficeInternalServerError{} +} + +// WithPayload adds the payload to the update closeout office internal server error response +func (o *UpdateCloseoutOfficeInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateCloseoutOfficeInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update closeout office internal server error response +func (o *UpdateCloseoutOfficeInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateCloseoutOfficeInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go new file mode 100644 index 00000000000..6eb86b3b52c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/update_closeout_office_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateCloseoutOfficeURL generates an URL for the update closeout office operation +type UpdateCloseoutOfficeURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCloseoutOfficeURL) WithBasePath(bp string) *UpdateCloseoutOfficeURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateCloseoutOfficeURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateCloseoutOfficeURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/closeout-office" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on UpdateCloseoutOfficeURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateCloseoutOfficeURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateCloseoutOfficeURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateCloseoutOfficeURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateCloseoutOfficeURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateCloseoutOfficeURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateCloseoutOfficeURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go new file mode 100644 index 00000000000..a7c0aa3fe88 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UploadAdditionalDocumentsHandlerFunc turns a function with the right signature into a upload additional documents handler +type UploadAdditionalDocumentsHandlerFunc func(UploadAdditionalDocumentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UploadAdditionalDocumentsHandlerFunc) Handle(params UploadAdditionalDocumentsParams) middleware.Responder { + return fn(params) +} + +// UploadAdditionalDocumentsHandler interface for that can handle valid upload additional documents params +type UploadAdditionalDocumentsHandler interface { + Handle(UploadAdditionalDocumentsParams) middleware.Responder +} + +// NewUploadAdditionalDocuments creates a new http.Handler for the upload additional documents operation +func NewUploadAdditionalDocuments(ctx *middleware.Context, handler UploadAdditionalDocumentsHandler) *UploadAdditionalDocuments { + return &UploadAdditionalDocuments{Context: ctx, Handler: handler} +} + +/* + UploadAdditionalDocuments swagger:route PATCH /moves/{moveID}/uploadAdditionalDocuments move uploadAdditionalDocuments + +# Patch the additional documents for a given move + +Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order. +*/ +type UploadAdditionalDocuments struct { + Context *middleware.Context + Handler UploadAdditionalDocumentsHandler +} + +func (o *UploadAdditionalDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUploadAdditionalDocumentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go new file mode 100644 index 00000000000..e8f75a2842f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UploadAdditionalDocumentsMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var UploadAdditionalDocumentsMaxParseMemory int64 = 32 << 20 + +// NewUploadAdditionalDocumentsParams creates a new UploadAdditionalDocumentsParams object +// +// There are no default values defined in the spec. +func NewUploadAdditionalDocumentsParams() UploadAdditionalDocumentsParams { + + return UploadAdditionalDocumentsParams{} +} + +// UploadAdditionalDocumentsParams contains all the bound params for the upload additional documents operation +// typically these are obtained from a http.Request +// +// swagger:parameters uploadAdditionalDocuments +type UploadAdditionalDocumentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the order + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUploadAdditionalDocumentsParams() beforehand. +func (o *UploadAdditionalDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(UploadAdditionalDocumentsMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *UploadAdditionalDocumentsParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *UploadAdditionalDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveID", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *UploadAdditionalDocumentsParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveID", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go new file mode 100644 index 00000000000..f2fb00f0516 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UploadAdditionalDocumentsCreatedCode is the HTTP code returned for type UploadAdditionalDocumentsCreated +const UploadAdditionalDocumentsCreatedCode int = 201 + +/* +UploadAdditionalDocumentsCreated created upload + +swagger:response uploadAdditionalDocumentsCreated +*/ +type UploadAdditionalDocumentsCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.Upload `json:"body,omitempty"` +} + +// NewUploadAdditionalDocumentsCreated creates UploadAdditionalDocumentsCreated with default headers values +func NewUploadAdditionalDocumentsCreated() *UploadAdditionalDocumentsCreated { + + return &UploadAdditionalDocumentsCreated{} +} + +// WithPayload adds the payload to the upload additional documents created response +func (o *UploadAdditionalDocumentsCreated) WithPayload(payload *ghcmessages.Upload) *UploadAdditionalDocumentsCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload additional documents created response +func (o *UploadAdditionalDocumentsCreated) SetPayload(payload *ghcmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAdditionalDocumentsBadRequestCode is the HTTP code returned for type UploadAdditionalDocumentsBadRequest +const UploadAdditionalDocumentsBadRequestCode int = 400 + +/* +UploadAdditionalDocumentsBadRequest invalid request + +swagger:response uploadAdditionalDocumentsBadRequest +*/ +type UploadAdditionalDocumentsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewUploadAdditionalDocumentsBadRequest creates UploadAdditionalDocumentsBadRequest with default headers values +func NewUploadAdditionalDocumentsBadRequest() *UploadAdditionalDocumentsBadRequest { + + return &UploadAdditionalDocumentsBadRequest{} +} + +// WithPayload adds the payload to the upload additional documents bad request response +func (o *UploadAdditionalDocumentsBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *UploadAdditionalDocumentsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload additional documents bad request response +func (o *UploadAdditionalDocumentsBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAdditionalDocumentsForbiddenCode is the HTTP code returned for type UploadAdditionalDocumentsForbidden +const UploadAdditionalDocumentsForbiddenCode int = 403 + +/* +UploadAdditionalDocumentsForbidden not authorized + +swagger:response uploadAdditionalDocumentsForbidden +*/ +type UploadAdditionalDocumentsForbidden struct { +} + +// NewUploadAdditionalDocumentsForbidden creates UploadAdditionalDocumentsForbidden with default headers values +func NewUploadAdditionalDocumentsForbidden() *UploadAdditionalDocumentsForbidden { + + return &UploadAdditionalDocumentsForbidden{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UploadAdditionalDocumentsNotFoundCode is the HTTP code returned for type UploadAdditionalDocumentsNotFound +const UploadAdditionalDocumentsNotFoundCode int = 404 + +/* +UploadAdditionalDocumentsNotFound not found + +swagger:response uploadAdditionalDocumentsNotFound +*/ +type UploadAdditionalDocumentsNotFound struct { +} + +// NewUploadAdditionalDocumentsNotFound creates UploadAdditionalDocumentsNotFound with default headers values +func NewUploadAdditionalDocumentsNotFound() *UploadAdditionalDocumentsNotFound { + + return &UploadAdditionalDocumentsNotFound{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UploadAdditionalDocumentsRequestEntityTooLargeCode is the HTTP code returned for type UploadAdditionalDocumentsRequestEntityTooLarge +const UploadAdditionalDocumentsRequestEntityTooLargeCode int = 413 + +/* +UploadAdditionalDocumentsRequestEntityTooLarge payload is too large + +swagger:response uploadAdditionalDocumentsRequestEntityTooLarge +*/ +type UploadAdditionalDocumentsRequestEntityTooLarge struct { +} + +// NewUploadAdditionalDocumentsRequestEntityTooLarge creates UploadAdditionalDocumentsRequestEntityTooLarge with default headers values +func NewUploadAdditionalDocumentsRequestEntityTooLarge() *UploadAdditionalDocumentsRequestEntityTooLarge { + + return &UploadAdditionalDocumentsRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// UploadAdditionalDocumentsInternalServerErrorCode is the HTTP code returned for type UploadAdditionalDocumentsInternalServerError +const UploadAdditionalDocumentsInternalServerErrorCode int = 500 + +/* +UploadAdditionalDocumentsInternalServerError server error + +swagger:response uploadAdditionalDocumentsInternalServerError +*/ +type UploadAdditionalDocumentsInternalServerError struct { +} + +// NewUploadAdditionalDocumentsInternalServerError creates UploadAdditionalDocumentsInternalServerError with default headers values +func NewUploadAdditionalDocumentsInternalServerError() *UploadAdditionalDocumentsInternalServerError { + + return &UploadAdditionalDocumentsInternalServerError{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go new file mode 100644 index 00000000000..9cc82a6b383 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move/upload_additional_documents_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UploadAdditionalDocumentsURL generates an URL for the upload additional documents operation +type UploadAdditionalDocumentsURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAdditionalDocumentsURL) WithBasePath(bp string) *UploadAdditionalDocumentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAdditionalDocumentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UploadAdditionalDocumentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveID}/uploadAdditionalDocuments" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on UploadAdditionalDocumentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UploadAdditionalDocumentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UploadAdditionalDocumentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UploadAdditionalDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UploadAdditionalDocumentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UploadAdditionalDocumentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UploadAdditionalDocumentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go new file mode 100644 index 00000000000..aaefe95f783 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetEntitlementsHandlerFunc turns a function with the right signature into a get entitlements handler +type GetEntitlementsHandlerFunc func(GetEntitlementsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetEntitlementsHandlerFunc) Handle(params GetEntitlementsParams) middleware.Responder { + return fn(params) +} + +// GetEntitlementsHandler interface for that can handle valid get entitlements params +type GetEntitlementsHandler interface { + Handle(GetEntitlementsParams) middleware.Responder +} + +// NewGetEntitlements creates a new http.Handler for the get entitlements operation +func NewGetEntitlements(ctx *middleware.Context, handler GetEntitlementsHandler) *GetEntitlements { + return &GetEntitlements{Context: ctx, Handler: handler} +} + +/* + GetEntitlements swagger:route GET /move-task-orders/{moveTaskOrderID}/entitlements moveTaskOrder getEntitlements + +# Gets entitlements for a move by ID + +Gets entitlements +*/ +type GetEntitlements struct { + Context *middleware.Context + Handler GetEntitlementsHandler +} + +func (o *GetEntitlements) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetEntitlementsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go new file mode 100644 index 00000000000..54b54a09fd4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetEntitlementsParams creates a new GetEntitlementsParams object +// +// There are no default values defined in the spec. +func NewGetEntitlementsParams() GetEntitlementsParams { + + return GetEntitlementsParams{} +} + +// GetEntitlementsParams contains all the bound params for the get entitlements operation +// typically these are obtained from a http.Request +// +// swagger:parameters getEntitlements +type GetEntitlementsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetEntitlementsParams() beforehand. +func (o *GetEntitlementsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *GetEntitlementsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go new file mode 100644 index 00000000000..42973fea3e1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetEntitlementsOKCode is the HTTP code returned for type GetEntitlementsOK +const GetEntitlementsOKCode int = 200 + +/* +GetEntitlementsOK Successfully retrieved entitlements + +swagger:response getEntitlementsOK +*/ +type GetEntitlementsOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Entitlements `json:"body,omitempty"` +} + +// NewGetEntitlementsOK creates GetEntitlementsOK with default headers values +func NewGetEntitlementsOK() *GetEntitlementsOK { + + return &GetEntitlementsOK{} +} + +// WithPayload adds the payload to the get entitlements o k response +func (o *GetEntitlementsOK) WithPayload(payload *ghcmessages.Entitlements) *GetEntitlementsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements o k response +func (o *GetEntitlementsOK) SetPayload(payload *ghcmessages.Entitlements) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEntitlementsBadRequestCode is the HTTP code returned for type GetEntitlementsBadRequest +const GetEntitlementsBadRequestCode int = 400 + +/* +GetEntitlementsBadRequest The request payload is invalid + +swagger:response getEntitlementsBadRequest +*/ +type GetEntitlementsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEntitlementsBadRequest creates GetEntitlementsBadRequest with default headers values +func NewGetEntitlementsBadRequest() *GetEntitlementsBadRequest { + + return &GetEntitlementsBadRequest{} +} + +// WithPayload adds the payload to the get entitlements bad request response +func (o *GetEntitlementsBadRequest) WithPayload(payload *ghcmessages.Error) *GetEntitlementsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements bad request response +func (o *GetEntitlementsBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEntitlementsUnauthorizedCode is the HTTP code returned for type GetEntitlementsUnauthorized +const GetEntitlementsUnauthorizedCode int = 401 + +/* +GetEntitlementsUnauthorized The request was denied + +swagger:response getEntitlementsUnauthorized +*/ +type GetEntitlementsUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEntitlementsUnauthorized creates GetEntitlementsUnauthorized with default headers values +func NewGetEntitlementsUnauthorized() *GetEntitlementsUnauthorized { + + return &GetEntitlementsUnauthorized{} +} + +// WithPayload adds the payload to the get entitlements unauthorized response +func (o *GetEntitlementsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetEntitlementsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements unauthorized response +func (o *GetEntitlementsUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEntitlementsForbiddenCode is the HTTP code returned for type GetEntitlementsForbidden +const GetEntitlementsForbiddenCode int = 403 + +/* +GetEntitlementsForbidden The request was denied + +swagger:response getEntitlementsForbidden +*/ +type GetEntitlementsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEntitlementsForbidden creates GetEntitlementsForbidden with default headers values +func NewGetEntitlementsForbidden() *GetEntitlementsForbidden { + + return &GetEntitlementsForbidden{} +} + +// WithPayload adds the payload to the get entitlements forbidden response +func (o *GetEntitlementsForbidden) WithPayload(payload *ghcmessages.Error) *GetEntitlementsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements forbidden response +func (o *GetEntitlementsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEntitlementsNotFoundCode is the HTTP code returned for type GetEntitlementsNotFound +const GetEntitlementsNotFoundCode int = 404 + +/* +GetEntitlementsNotFound The requested resource wasn't found + +swagger:response getEntitlementsNotFound +*/ +type GetEntitlementsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEntitlementsNotFound creates GetEntitlementsNotFound with default headers values +func NewGetEntitlementsNotFound() *GetEntitlementsNotFound { + + return &GetEntitlementsNotFound{} +} + +// WithPayload adds the payload to the get entitlements not found response +func (o *GetEntitlementsNotFound) WithPayload(payload *ghcmessages.Error) *GetEntitlementsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements not found response +func (o *GetEntitlementsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetEntitlementsInternalServerErrorCode is the HTTP code returned for type GetEntitlementsInternalServerError +const GetEntitlementsInternalServerErrorCode int = 500 + +/* +GetEntitlementsInternalServerError A server error occurred + +swagger:response getEntitlementsInternalServerError +*/ +type GetEntitlementsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetEntitlementsInternalServerError creates GetEntitlementsInternalServerError with default headers values +func NewGetEntitlementsInternalServerError() *GetEntitlementsInternalServerError { + + return &GetEntitlementsInternalServerError{} +} + +// WithPayload adds the payload to the get entitlements internal server error response +func (o *GetEntitlementsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetEntitlementsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get entitlements internal server error response +func (o *GetEntitlementsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetEntitlementsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go new file mode 100644 index 00000000000..7ec7e8326d4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_entitlements_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetEntitlementsURL generates an URL for the get entitlements operation +type GetEntitlementsURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetEntitlementsURL) WithBasePath(bp string) *GetEntitlementsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetEntitlementsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetEntitlementsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/entitlements" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on GetEntitlementsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetEntitlementsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetEntitlementsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetEntitlementsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetEntitlementsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetEntitlementsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetEntitlementsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go new file mode 100644 index 00000000000..fa196585950 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler +type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// GetMoveTaskOrderHandler interface for that can handle valid get move task order params +type GetMoveTaskOrderHandler interface { + Handle(GetMoveTaskOrderParams) middleware.Responder +} + +// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation +func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { + return &GetMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + GetMoveTaskOrder swagger:route GET /move-task-orders/{moveTaskOrderID} moveTaskOrder getMoveTaskOrder + +# Gets a move by ID + +Gets a move +*/ +type GetMoveTaskOrder struct { + Context *middleware.Context + Handler GetMoveTaskOrderHandler +} + +func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..a33864f5180 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { + + return GetMoveTaskOrderParams{} +} + +// GetMoveTaskOrderParams contains all the bound params for the get move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveTaskOrder +type GetMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. +func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *GetMoveTaskOrderParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..aa9cd10b67e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK +const GetMoveTaskOrderOKCode int = 200 + +/* +GetMoveTaskOrderOK Successfully retrieved move task order + +swagger:response getMoveTaskOrderOK +*/ +type GetMoveTaskOrderOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + + return &GetMoveTaskOrderOK{} +} + +// WithPayload adds the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) WithPayload(payload *ghcmessages.MoveTaskOrder) *GetMoveTaskOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) SetPayload(payload *ghcmessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderBadRequestCode is the HTTP code returned for type GetMoveTaskOrderBadRequest +const GetMoveTaskOrderBadRequestCode int = 400 + +/* +GetMoveTaskOrderBadRequest The request payload is invalid + +swagger:response getMoveTaskOrderBadRequest +*/ +type GetMoveTaskOrderBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderBadRequest creates GetMoveTaskOrderBadRequest with default headers values +func NewGetMoveTaskOrderBadRequest() *GetMoveTaskOrderBadRequest { + + return &GetMoveTaskOrderBadRequest{} +} + +// WithPayload adds the payload to the get move task order bad request response +func (o *GetMoveTaskOrderBadRequest) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order bad request response +func (o *GetMoveTaskOrderBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized +const GetMoveTaskOrderUnauthorizedCode int = 401 + +/* +GetMoveTaskOrderUnauthorized The request was denied + +swagger:response getMoveTaskOrderUnauthorized +*/ +type GetMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + + return &GetMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden +const GetMoveTaskOrderForbiddenCode int = 403 + +/* +GetMoveTaskOrderForbidden The request was denied + +swagger:response getMoveTaskOrderForbidden +*/ +type GetMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + + return &GetMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound +const GetMoveTaskOrderNotFoundCode int = 404 + +/* +GetMoveTaskOrderNotFound The requested resource wasn't found + +swagger:response getMoveTaskOrderNotFound +*/ +type GetMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + + return &GetMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError +const GetMoveTaskOrderInternalServerErrorCode int = 500 + +/* +GetMoveTaskOrderInternalServerError A server error occurred + +swagger:response getMoveTaskOrderInternalServerError +*/ +type GetMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + + return &GetMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..0eb44042657 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/get_move_task_order_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveTaskOrderURL generates an URL for the get move task order operation +type GetMoveTaskOrderURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on GetMoveTaskOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go new file mode 100644 index 00000000000..6af08f9317e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOReviewedBillableWeightsAtHandlerFunc turns a function with the right signature into a update m t o reviewed billable weights at handler +type UpdateMTOReviewedBillableWeightsAtHandlerFunc func(UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOReviewedBillableWeightsAtHandlerFunc) Handle(params UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOReviewedBillableWeightsAtHandler interface for that can handle valid update m t o reviewed billable weights at params +type UpdateMTOReviewedBillableWeightsAtHandler interface { + Handle(UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder +} + +// NewUpdateMTOReviewedBillableWeightsAt creates a new http.Handler for the update m t o reviewed billable weights at operation +func NewUpdateMTOReviewedBillableWeightsAt(ctx *middleware.Context, handler UpdateMTOReviewedBillableWeightsAtHandler) *UpdateMTOReviewedBillableWeightsAt { + return &UpdateMTOReviewedBillableWeightsAt{Context: ctx, Handler: handler} +} + +/* + UpdateMTOReviewedBillableWeightsAt swagger:route PATCH /move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at moveTaskOrder updateMTOReviewedBillableWeightsAt + +Changes move (move task order) billableWeightsReviewedAt field to a timestamp +*/ +type UpdateMTOReviewedBillableWeightsAt struct { + Context *middleware.Context + Handler UpdateMTOReviewedBillableWeightsAtHandler +} + +func (o *UpdateMTOReviewedBillableWeightsAt) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOReviewedBillableWeightsAtParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go new file mode 100644 index 00000000000..4dba27881da --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateMTOReviewedBillableWeightsAtParams creates a new UpdateMTOReviewedBillableWeightsAtParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOReviewedBillableWeightsAtParams() UpdateMTOReviewedBillableWeightsAtParams { + + return UpdateMTOReviewedBillableWeightsAtParams{} +} + +// UpdateMTOReviewedBillableWeightsAtParams contains all the bound params for the update m t o reviewed billable weights at operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOReviewedBillableWeightsAt +type UpdateMTOReviewedBillableWeightsAtParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOReviewedBillableWeightsAtParams() beforehand. +func (o *UpdateMTOReviewedBillableWeightsAtParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOReviewedBillableWeightsAtParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMTOReviewedBillableWeightsAtParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go new file mode 100644 index 00000000000..83e896b7250 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMTOReviewedBillableWeightsAtOKCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtOK +const UpdateMTOReviewedBillableWeightsAtOKCode int = 200 + +/* +UpdateMTOReviewedBillableWeightsAtOK Successfully updated move task order billableWeightsReviewedAt field + +swagger:response updateMTOReviewedBillableWeightsAtOK +*/ +type UpdateMTOReviewedBillableWeightsAtOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtOK creates UpdateMTOReviewedBillableWeightsAtOK with default headers values +func NewUpdateMTOReviewedBillableWeightsAtOK() *UpdateMTOReviewedBillableWeightsAtOK { + + return &UpdateMTOReviewedBillableWeightsAtOK{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at o k response +func (o *UpdateMTOReviewedBillableWeightsAtOK) WithPayload(payload *ghcmessages.Move) *UpdateMTOReviewedBillableWeightsAtOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at o k response +func (o *UpdateMTOReviewedBillableWeightsAtOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtBadRequestCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtBadRequest +const UpdateMTOReviewedBillableWeightsAtBadRequestCode int = 400 + +/* +UpdateMTOReviewedBillableWeightsAtBadRequest The request payload is invalid + +swagger:response updateMTOReviewedBillableWeightsAtBadRequest +*/ +type UpdateMTOReviewedBillableWeightsAtBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtBadRequest creates UpdateMTOReviewedBillableWeightsAtBadRequest with default headers values +func NewUpdateMTOReviewedBillableWeightsAtBadRequest() *UpdateMTOReviewedBillableWeightsAtBadRequest { + + return &UpdateMTOReviewedBillableWeightsAtBadRequest{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at bad request response +func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at bad request response +func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtUnauthorizedCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtUnauthorized +const UpdateMTOReviewedBillableWeightsAtUnauthorizedCode int = 401 + +/* +UpdateMTOReviewedBillableWeightsAtUnauthorized The request was denied + +swagger:response updateMTOReviewedBillableWeightsAtUnauthorized +*/ +type UpdateMTOReviewedBillableWeightsAtUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtUnauthorized creates UpdateMTOReviewedBillableWeightsAtUnauthorized with default headers values +func NewUpdateMTOReviewedBillableWeightsAtUnauthorized() *UpdateMTOReviewedBillableWeightsAtUnauthorized { + + return &UpdateMTOReviewedBillableWeightsAtUnauthorized{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at unauthorized response +func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at unauthorized response +func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtForbiddenCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtForbidden +const UpdateMTOReviewedBillableWeightsAtForbiddenCode int = 403 + +/* +UpdateMTOReviewedBillableWeightsAtForbidden The request was denied + +swagger:response updateMTOReviewedBillableWeightsAtForbidden +*/ +type UpdateMTOReviewedBillableWeightsAtForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtForbidden creates UpdateMTOReviewedBillableWeightsAtForbidden with default headers values +func NewUpdateMTOReviewedBillableWeightsAtForbidden() *UpdateMTOReviewedBillableWeightsAtForbidden { + + return &UpdateMTOReviewedBillableWeightsAtForbidden{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at forbidden response +func (o *UpdateMTOReviewedBillableWeightsAtForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at forbidden response +func (o *UpdateMTOReviewedBillableWeightsAtForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtNotFoundCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtNotFound +const UpdateMTOReviewedBillableWeightsAtNotFoundCode int = 404 + +/* +UpdateMTOReviewedBillableWeightsAtNotFound The requested resource wasn't found + +swagger:response updateMTOReviewedBillableWeightsAtNotFound +*/ +type UpdateMTOReviewedBillableWeightsAtNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtNotFound creates UpdateMTOReviewedBillableWeightsAtNotFound with default headers values +func NewUpdateMTOReviewedBillableWeightsAtNotFound() *UpdateMTOReviewedBillableWeightsAtNotFound { + + return &UpdateMTOReviewedBillableWeightsAtNotFound{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at not found response +func (o *UpdateMTOReviewedBillableWeightsAtNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at not found response +func (o *UpdateMTOReviewedBillableWeightsAtNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtConflictCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtConflict +const UpdateMTOReviewedBillableWeightsAtConflictCode int = 409 + +/* +UpdateMTOReviewedBillableWeightsAtConflict Conflict error + +swagger:response updateMTOReviewedBillableWeightsAtConflict +*/ +type UpdateMTOReviewedBillableWeightsAtConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtConflict creates UpdateMTOReviewedBillableWeightsAtConflict with default headers values +func NewUpdateMTOReviewedBillableWeightsAtConflict() *UpdateMTOReviewedBillableWeightsAtConflict { + + return &UpdateMTOReviewedBillableWeightsAtConflict{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at conflict response +func (o *UpdateMTOReviewedBillableWeightsAtConflict) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at conflict response +func (o *UpdateMTOReviewedBillableWeightsAtConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtPreconditionFailedCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtPreconditionFailed +const UpdateMTOReviewedBillableWeightsAtPreconditionFailedCode int = 412 + +/* +UpdateMTOReviewedBillableWeightsAtPreconditionFailed Precondition failed + +swagger:response updateMTOReviewedBillableWeightsAtPreconditionFailed +*/ +type UpdateMTOReviewedBillableWeightsAtPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtPreconditionFailed creates UpdateMTOReviewedBillableWeightsAtPreconditionFailed with default headers values +func NewUpdateMTOReviewedBillableWeightsAtPreconditionFailed() *UpdateMTOReviewedBillableWeightsAtPreconditionFailed { + + return &UpdateMTOReviewedBillableWeightsAtPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at precondition failed response +func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at precondition failed response +func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtUnprocessableEntityCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtUnprocessableEntity +const UpdateMTOReviewedBillableWeightsAtUnprocessableEntityCode int = 422 + +/* +UpdateMTOReviewedBillableWeightsAtUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOReviewedBillableWeightsAtUnprocessableEntity +*/ +type UpdateMTOReviewedBillableWeightsAtUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtUnprocessableEntity creates UpdateMTOReviewedBillableWeightsAtUnprocessableEntity with default headers values +func NewUpdateMTOReviewedBillableWeightsAtUnprocessableEntity() *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity { + + return &UpdateMTOReviewedBillableWeightsAtUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at unprocessable entity response +func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at unprocessable entity response +func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOReviewedBillableWeightsAtInternalServerErrorCode is the HTTP code returned for type UpdateMTOReviewedBillableWeightsAtInternalServerError +const UpdateMTOReviewedBillableWeightsAtInternalServerErrorCode int = 500 + +/* +UpdateMTOReviewedBillableWeightsAtInternalServerError A server error occurred + +swagger:response updateMTOReviewedBillableWeightsAtInternalServerError +*/ +type UpdateMTOReviewedBillableWeightsAtInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOReviewedBillableWeightsAtInternalServerError creates UpdateMTOReviewedBillableWeightsAtInternalServerError with default headers values +func NewUpdateMTOReviewedBillableWeightsAtInternalServerError() *UpdateMTOReviewedBillableWeightsAtInternalServerError { + + return &UpdateMTOReviewedBillableWeightsAtInternalServerError{} +} + +// WithPayload adds the payload to the update m t o reviewed billable weights at internal server error response +func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOReviewedBillableWeightsAtInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o reviewed billable weights at internal server error response +func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOReviewedBillableWeightsAtInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go new file mode 100644 index 00000000000..6b5d00f3ba5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_reviewed_billable_weights_at_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOReviewedBillableWeightsAtURL generates an URL for the update m t o reviewed billable weights at operation +type UpdateMTOReviewedBillableWeightsAtURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOReviewedBillableWeightsAtURL) WithBasePath(bp string) *UpdateMTOReviewedBillableWeightsAtURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOReviewedBillableWeightsAtURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOReviewedBillableWeightsAtURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMTOReviewedBillableWeightsAtURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOReviewedBillableWeightsAtURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOReviewedBillableWeightsAtURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOReviewedBillableWeightsAtURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOReviewedBillableWeightsAtURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOReviewedBillableWeightsAtURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOReviewedBillableWeightsAtURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go new file mode 100644 index 00000000000..3e328a2ee31 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOStatusServiceCounselingCompletedHandlerFunc turns a function with the right signature into a update m t o status service counseling completed handler +type UpdateMTOStatusServiceCounselingCompletedHandlerFunc func(UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOStatusServiceCounselingCompletedHandlerFunc) Handle(params UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOStatusServiceCounselingCompletedHandler interface for that can handle valid update m t o status service counseling completed params +type UpdateMTOStatusServiceCounselingCompletedHandler interface { + Handle(UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder +} + +// NewUpdateMTOStatusServiceCounselingCompleted creates a new http.Handler for the update m t o status service counseling completed operation +func NewUpdateMTOStatusServiceCounselingCompleted(ctx *middleware.Context, handler UpdateMTOStatusServiceCounselingCompletedHandler) *UpdateMTOStatusServiceCounselingCompleted { + return &UpdateMTOStatusServiceCounselingCompleted{Context: ctx, Handler: handler} +} + +/* + UpdateMTOStatusServiceCounselingCompleted swagger:route PATCH /move-task-orders/{moveTaskOrderID}/status/service-counseling-completed moveTaskOrder updateMTOStatusServiceCounselingCompleted + +# Changes move (move task order) status to service counseling completed + +Changes move (move task order) status to service counseling completed +*/ +type UpdateMTOStatusServiceCounselingCompleted struct { + Context *middleware.Context + Handler UpdateMTOStatusServiceCounselingCompletedHandler +} + +func (o *UpdateMTOStatusServiceCounselingCompleted) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOStatusServiceCounselingCompletedParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go new file mode 100644 index 00000000000..b1971590362 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateMTOStatusServiceCounselingCompletedParams creates a new UpdateMTOStatusServiceCounselingCompletedParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOStatusServiceCounselingCompletedParams() UpdateMTOStatusServiceCounselingCompletedParams { + + return UpdateMTOStatusServiceCounselingCompletedParams{} +} + +// UpdateMTOStatusServiceCounselingCompletedParams contains all the bound params for the update m t o status service counseling completed operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOStatusServiceCounselingCompleted +type UpdateMTOStatusServiceCounselingCompletedParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOStatusServiceCounselingCompletedParams() beforehand. +func (o *UpdateMTOStatusServiceCounselingCompletedParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOStatusServiceCounselingCompletedParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMTOStatusServiceCounselingCompletedParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go new file mode 100644 index 00000000000..0094a040e6e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMTOStatusServiceCounselingCompletedOKCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedOK +const UpdateMTOStatusServiceCounselingCompletedOKCode int = 200 + +/* +UpdateMTOStatusServiceCounselingCompletedOK Successfully updated move task order status + +swagger:response updateMTOStatusServiceCounselingCompletedOK +*/ +type UpdateMTOStatusServiceCounselingCompletedOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedOK creates UpdateMTOStatusServiceCounselingCompletedOK with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedOK() *UpdateMTOStatusServiceCounselingCompletedOK { + + return &UpdateMTOStatusServiceCounselingCompletedOK{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed o k response +func (o *UpdateMTOStatusServiceCounselingCompletedOK) WithPayload(payload *ghcmessages.Move) *UpdateMTOStatusServiceCounselingCompletedOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed o k response +func (o *UpdateMTOStatusServiceCounselingCompletedOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedBadRequestCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedBadRequest +const UpdateMTOStatusServiceCounselingCompletedBadRequestCode int = 400 + +/* +UpdateMTOStatusServiceCounselingCompletedBadRequest The request payload is invalid + +swagger:response updateMTOStatusServiceCounselingCompletedBadRequest +*/ +type UpdateMTOStatusServiceCounselingCompletedBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedBadRequest creates UpdateMTOStatusServiceCounselingCompletedBadRequest with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedBadRequest() *UpdateMTOStatusServiceCounselingCompletedBadRequest { + + return &UpdateMTOStatusServiceCounselingCompletedBadRequest{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed bad request response +func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed bad request response +func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedUnauthorizedCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedUnauthorized +const UpdateMTOStatusServiceCounselingCompletedUnauthorizedCode int = 401 + +/* +UpdateMTOStatusServiceCounselingCompletedUnauthorized The request was denied + +swagger:response updateMTOStatusServiceCounselingCompletedUnauthorized +*/ +type UpdateMTOStatusServiceCounselingCompletedUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedUnauthorized creates UpdateMTOStatusServiceCounselingCompletedUnauthorized with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedUnauthorized() *UpdateMTOStatusServiceCounselingCompletedUnauthorized { + + return &UpdateMTOStatusServiceCounselingCompletedUnauthorized{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed unauthorized response +func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed unauthorized response +func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedForbiddenCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedForbidden +const UpdateMTOStatusServiceCounselingCompletedForbiddenCode int = 403 + +/* +UpdateMTOStatusServiceCounselingCompletedForbidden The request was denied + +swagger:response updateMTOStatusServiceCounselingCompletedForbidden +*/ +type UpdateMTOStatusServiceCounselingCompletedForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedForbidden creates UpdateMTOStatusServiceCounselingCompletedForbidden with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedForbidden() *UpdateMTOStatusServiceCounselingCompletedForbidden { + + return &UpdateMTOStatusServiceCounselingCompletedForbidden{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed forbidden response +func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed forbidden response +func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedNotFoundCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedNotFound +const UpdateMTOStatusServiceCounselingCompletedNotFoundCode int = 404 + +/* +UpdateMTOStatusServiceCounselingCompletedNotFound The requested resource wasn't found + +swagger:response updateMTOStatusServiceCounselingCompletedNotFound +*/ +type UpdateMTOStatusServiceCounselingCompletedNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedNotFound creates UpdateMTOStatusServiceCounselingCompletedNotFound with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedNotFound() *UpdateMTOStatusServiceCounselingCompletedNotFound { + + return &UpdateMTOStatusServiceCounselingCompletedNotFound{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed not found response +func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed not found response +func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedConflictCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedConflict +const UpdateMTOStatusServiceCounselingCompletedConflictCode int = 409 + +/* +UpdateMTOStatusServiceCounselingCompletedConflict Conflict error + +swagger:response updateMTOStatusServiceCounselingCompletedConflict +*/ +type UpdateMTOStatusServiceCounselingCompletedConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedConflict creates UpdateMTOStatusServiceCounselingCompletedConflict with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedConflict() *UpdateMTOStatusServiceCounselingCompletedConflict { + + return &UpdateMTOStatusServiceCounselingCompletedConflict{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed conflict response +func (o *UpdateMTOStatusServiceCounselingCompletedConflict) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed conflict response +func (o *UpdateMTOStatusServiceCounselingCompletedConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedPreconditionFailedCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedPreconditionFailed +const UpdateMTOStatusServiceCounselingCompletedPreconditionFailedCode int = 412 + +/* +UpdateMTOStatusServiceCounselingCompletedPreconditionFailed Precondition failed + +swagger:response updateMTOStatusServiceCounselingCompletedPreconditionFailed +*/ +type UpdateMTOStatusServiceCounselingCompletedPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedPreconditionFailed creates UpdateMTOStatusServiceCounselingCompletedPreconditionFailed with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedPreconditionFailed() *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed { + + return &UpdateMTOStatusServiceCounselingCompletedPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed precondition failed response +func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed precondition failed response +func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedUnprocessableEntityCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity +const UpdateMTOStatusServiceCounselingCompletedUnprocessableEntityCode int = 422 + +/* +UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOStatusServiceCounselingCompletedUnprocessableEntity +*/ +type UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedUnprocessableEntity creates UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedUnprocessableEntity() *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity { + + return &UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed unprocessable entity response +func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed unprocessable entity response +func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOStatusServiceCounselingCompletedInternalServerErrorCode is the HTTP code returned for type UpdateMTOStatusServiceCounselingCompletedInternalServerError +const UpdateMTOStatusServiceCounselingCompletedInternalServerErrorCode int = 500 + +/* +UpdateMTOStatusServiceCounselingCompletedInternalServerError A server error occurred + +swagger:response updateMTOStatusServiceCounselingCompletedInternalServerError +*/ +type UpdateMTOStatusServiceCounselingCompletedInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOStatusServiceCounselingCompletedInternalServerError creates UpdateMTOStatusServiceCounselingCompletedInternalServerError with default headers values +func NewUpdateMTOStatusServiceCounselingCompletedInternalServerError() *UpdateMTOStatusServiceCounselingCompletedInternalServerError { + + return &UpdateMTOStatusServiceCounselingCompletedInternalServerError{} +} + +// WithPayload adds the payload to the update m t o status service counseling completed internal server error response +func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOStatusServiceCounselingCompletedInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o status service counseling completed internal server error response +func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOStatusServiceCounselingCompletedInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go new file mode 100644 index 00000000000..c8d2c8eca09 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_m_t_o_status_service_counseling_completed_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOStatusServiceCounselingCompletedURL generates an URL for the update m t o status service counseling completed operation +type UpdateMTOStatusServiceCounselingCompletedURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOStatusServiceCounselingCompletedURL) WithBasePath(bp string) *UpdateMTOStatusServiceCounselingCompletedURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOStatusServiceCounselingCompletedURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOStatusServiceCounselingCompletedURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMTOStatusServiceCounselingCompletedURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOStatusServiceCounselingCompletedURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOStatusServiceCounselingCompletedURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOStatusServiceCounselingCompletedURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOStatusServiceCounselingCompletedURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOStatusServiceCounselingCompletedURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOStatusServiceCounselingCompletedURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go new file mode 100644 index 00000000000..4a0234ddd41 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks.go @@ -0,0 +1,56 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMoveTIORemarksHandlerFunc turns a function with the right signature into a update move t i o remarks handler +type UpdateMoveTIORemarksHandlerFunc func(UpdateMoveTIORemarksParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMoveTIORemarksHandlerFunc) Handle(params UpdateMoveTIORemarksParams) middleware.Responder { + return fn(params) +} + +// UpdateMoveTIORemarksHandler interface for that can handle valid update move t i o remarks params +type UpdateMoveTIORemarksHandler interface { + Handle(UpdateMoveTIORemarksParams) middleware.Responder +} + +// NewUpdateMoveTIORemarks creates a new http.Handler for the update move t i o remarks operation +func NewUpdateMoveTIORemarks(ctx *middleware.Context, handler UpdateMoveTIORemarksHandler) *UpdateMoveTIORemarks { + return &UpdateMoveTIORemarks{Context: ctx, Handler: handler} +} + +/* + UpdateMoveTIORemarks swagger:route PATCH /move-task-orders/{moveTaskOrderID}/tio-remarks moveTaskOrder updateMoveTIORemarks + +Changes move (move task order) billableWeightsReviewedAt field to a timestamp +*/ +type UpdateMoveTIORemarks struct { + Context *middleware.Context + Handler UpdateMoveTIORemarksHandler +} + +func (o *UpdateMoveTIORemarks) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMoveTIORemarksParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go new file mode 100644 index 00000000000..3df5d6da86e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMoveTIORemarksParams creates a new UpdateMoveTIORemarksParams object +// +// There are no default values defined in the spec. +func NewUpdateMoveTIORemarksParams() UpdateMoveTIORemarksParams { + + return UpdateMoveTIORemarksParams{} +} + +// UpdateMoveTIORemarksParams contains all the bound params for the update move t i o remarks operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMoveTIORemarks +type UpdateMoveTIORemarksParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.Move + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMoveTIORemarksParams() beforehand. +func (o *UpdateMoveTIORemarksParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.Move + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMoveTIORemarksParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMoveTIORemarksParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go new file mode 100644 index 00000000000..0c4a63542e6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMoveTIORemarksOKCode is the HTTP code returned for type UpdateMoveTIORemarksOK +const UpdateMoveTIORemarksOKCode int = 200 + +/* +UpdateMoveTIORemarksOK Successfully updated move task order tioRemarks field + +swagger:response updateMoveTIORemarksOK +*/ +type UpdateMoveTIORemarksOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksOK creates UpdateMoveTIORemarksOK with default headers values +func NewUpdateMoveTIORemarksOK() *UpdateMoveTIORemarksOK { + + return &UpdateMoveTIORemarksOK{} +} + +// WithPayload adds the payload to the update move t i o remarks o k response +func (o *UpdateMoveTIORemarksOK) WithPayload(payload *ghcmessages.Move) *UpdateMoveTIORemarksOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks o k response +func (o *UpdateMoveTIORemarksOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksBadRequestCode is the HTTP code returned for type UpdateMoveTIORemarksBadRequest +const UpdateMoveTIORemarksBadRequestCode int = 400 + +/* +UpdateMoveTIORemarksBadRequest The request payload is invalid + +swagger:response updateMoveTIORemarksBadRequest +*/ +type UpdateMoveTIORemarksBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksBadRequest creates UpdateMoveTIORemarksBadRequest with default headers values +func NewUpdateMoveTIORemarksBadRequest() *UpdateMoveTIORemarksBadRequest { + + return &UpdateMoveTIORemarksBadRequest{} +} + +// WithPayload adds the payload to the update move t i o remarks bad request response +func (o *UpdateMoveTIORemarksBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks bad request response +func (o *UpdateMoveTIORemarksBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksUnauthorizedCode is the HTTP code returned for type UpdateMoveTIORemarksUnauthorized +const UpdateMoveTIORemarksUnauthorizedCode int = 401 + +/* +UpdateMoveTIORemarksUnauthorized The request was denied + +swagger:response updateMoveTIORemarksUnauthorized +*/ +type UpdateMoveTIORemarksUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksUnauthorized creates UpdateMoveTIORemarksUnauthorized with default headers values +func NewUpdateMoveTIORemarksUnauthorized() *UpdateMoveTIORemarksUnauthorized { + + return &UpdateMoveTIORemarksUnauthorized{} +} + +// WithPayload adds the payload to the update move t i o remarks unauthorized response +func (o *UpdateMoveTIORemarksUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks unauthorized response +func (o *UpdateMoveTIORemarksUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksForbiddenCode is the HTTP code returned for type UpdateMoveTIORemarksForbidden +const UpdateMoveTIORemarksForbiddenCode int = 403 + +/* +UpdateMoveTIORemarksForbidden The request was denied + +swagger:response updateMoveTIORemarksForbidden +*/ +type UpdateMoveTIORemarksForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksForbidden creates UpdateMoveTIORemarksForbidden with default headers values +func NewUpdateMoveTIORemarksForbidden() *UpdateMoveTIORemarksForbidden { + + return &UpdateMoveTIORemarksForbidden{} +} + +// WithPayload adds the payload to the update move t i o remarks forbidden response +func (o *UpdateMoveTIORemarksForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks forbidden response +func (o *UpdateMoveTIORemarksForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksNotFoundCode is the HTTP code returned for type UpdateMoveTIORemarksNotFound +const UpdateMoveTIORemarksNotFoundCode int = 404 + +/* +UpdateMoveTIORemarksNotFound The requested resource wasn't found + +swagger:response updateMoveTIORemarksNotFound +*/ +type UpdateMoveTIORemarksNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksNotFound creates UpdateMoveTIORemarksNotFound with default headers values +func NewUpdateMoveTIORemarksNotFound() *UpdateMoveTIORemarksNotFound { + + return &UpdateMoveTIORemarksNotFound{} +} + +// WithPayload adds the payload to the update move t i o remarks not found response +func (o *UpdateMoveTIORemarksNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks not found response +func (o *UpdateMoveTIORemarksNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksConflictCode is the HTTP code returned for type UpdateMoveTIORemarksConflict +const UpdateMoveTIORemarksConflictCode int = 409 + +/* +UpdateMoveTIORemarksConflict Conflict error + +swagger:response updateMoveTIORemarksConflict +*/ +type UpdateMoveTIORemarksConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksConflict creates UpdateMoveTIORemarksConflict with default headers values +func NewUpdateMoveTIORemarksConflict() *UpdateMoveTIORemarksConflict { + + return &UpdateMoveTIORemarksConflict{} +} + +// WithPayload adds the payload to the update move t i o remarks conflict response +func (o *UpdateMoveTIORemarksConflict) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks conflict response +func (o *UpdateMoveTIORemarksConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksPreconditionFailedCode is the HTTP code returned for type UpdateMoveTIORemarksPreconditionFailed +const UpdateMoveTIORemarksPreconditionFailedCode int = 412 + +/* +UpdateMoveTIORemarksPreconditionFailed Precondition failed + +swagger:response updateMoveTIORemarksPreconditionFailed +*/ +type UpdateMoveTIORemarksPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksPreconditionFailed creates UpdateMoveTIORemarksPreconditionFailed with default headers values +func NewUpdateMoveTIORemarksPreconditionFailed() *UpdateMoveTIORemarksPreconditionFailed { + + return &UpdateMoveTIORemarksPreconditionFailed{} +} + +// WithPayload adds the payload to the update move t i o remarks precondition failed response +func (o *UpdateMoveTIORemarksPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks precondition failed response +func (o *UpdateMoveTIORemarksPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksUnprocessableEntityCode is the HTTP code returned for type UpdateMoveTIORemarksUnprocessableEntity +const UpdateMoveTIORemarksUnprocessableEntityCode int = 422 + +/* +UpdateMoveTIORemarksUnprocessableEntity The payload was unprocessable. + +swagger:response updateMoveTIORemarksUnprocessableEntity +*/ +type UpdateMoveTIORemarksUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksUnprocessableEntity creates UpdateMoveTIORemarksUnprocessableEntity with default headers values +func NewUpdateMoveTIORemarksUnprocessableEntity() *UpdateMoveTIORemarksUnprocessableEntity { + + return &UpdateMoveTIORemarksUnprocessableEntity{} +} + +// WithPayload adds the payload to the update move t i o remarks unprocessable entity response +func (o *UpdateMoveTIORemarksUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMoveTIORemarksUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks unprocessable entity response +func (o *UpdateMoveTIORemarksUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTIORemarksInternalServerErrorCode is the HTTP code returned for type UpdateMoveTIORemarksInternalServerError +const UpdateMoveTIORemarksInternalServerErrorCode int = 500 + +/* +UpdateMoveTIORemarksInternalServerError A server error occurred + +swagger:response updateMoveTIORemarksInternalServerError +*/ +type UpdateMoveTIORemarksInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTIORemarksInternalServerError creates UpdateMoveTIORemarksInternalServerError with default headers values +func NewUpdateMoveTIORemarksInternalServerError() *UpdateMoveTIORemarksInternalServerError { + + return &UpdateMoveTIORemarksInternalServerError{} +} + +// WithPayload adds the payload to the update move t i o remarks internal server error response +func (o *UpdateMoveTIORemarksInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMoveTIORemarksInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move t i o remarks internal server error response +func (o *UpdateMoveTIORemarksInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTIORemarksInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go new file mode 100644 index 00000000000..116d0bfc1c2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_t_i_o_remarks_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMoveTIORemarksURL generates an URL for the update move t i o remarks operation +type UpdateMoveTIORemarksURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveTIORemarksURL) WithBasePath(bp string) *UpdateMoveTIORemarksURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveTIORemarksURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMoveTIORemarksURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/tio-remarks" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMoveTIORemarksURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMoveTIORemarksURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMoveTIORemarksURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMoveTIORemarksURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMoveTIORemarksURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMoveTIORemarksURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMoveTIORemarksURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go new file mode 100644 index 00000000000..ec8f17920aa --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMoveTaskOrderStatusHandlerFunc turns a function with the right signature into a update move task order status handler +type UpdateMoveTaskOrderStatusHandlerFunc func(UpdateMoveTaskOrderStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMoveTaskOrderStatusHandlerFunc) Handle(params UpdateMoveTaskOrderStatusParams) middleware.Responder { + return fn(params) +} + +// UpdateMoveTaskOrderStatusHandler interface for that can handle valid update move task order status params +type UpdateMoveTaskOrderStatusHandler interface { + Handle(UpdateMoveTaskOrderStatusParams) middleware.Responder +} + +// NewUpdateMoveTaskOrderStatus creates a new http.Handler for the update move task order status operation +func NewUpdateMoveTaskOrderStatus(ctx *middleware.Context, handler UpdateMoveTaskOrderStatusHandler) *UpdateMoveTaskOrderStatus { + return &UpdateMoveTaskOrderStatus{Context: ctx, Handler: handler} +} + +/* + UpdateMoveTaskOrderStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/status moveTaskOrder updateMoveTaskOrderStatus + +# Change the status of a move task order to make it available to prime + +Changes move task order status to make it available to prime +*/ +type UpdateMoveTaskOrderStatus struct { + Context *middleware.Context + Handler UpdateMoveTaskOrderStatusHandler +} + +func (o *UpdateMoveTaskOrderStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMoveTaskOrderStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go new file mode 100644 index 00000000000..bb1ffe4b294 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMoveTaskOrderStatusParams creates a new UpdateMoveTaskOrderStatusParams object +// +// There are no default values defined in the spec. +func NewUpdateMoveTaskOrderStatusParams() UpdateMoveTaskOrderStatusParams { + + return UpdateMoveTaskOrderStatusParams{} +} + +// UpdateMoveTaskOrderStatusParams contains all the bound params for the update move task order status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMoveTaskOrderStatus +type UpdateMoveTaskOrderStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string + /* + Required: true + In: body + */ + ServiceItemCodes *ghcmessages.MTOApprovalServiceItemCodes +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMoveTaskOrderStatusParams() beforehand. +func (o *UpdateMoveTaskOrderStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.MTOApprovalServiceItemCodes + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("serviceItemCodes", "body", "")) + } else { + res = append(res, errors.NewParseError("serviceItemCodes", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.ServiceItemCodes = &body + } + } + } else { + res = append(res, errors.Required("serviceItemCodes", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMoveTaskOrderStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMoveTaskOrderStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go new file mode 100644 index 00000000000..1787fd1ecbf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMoveTaskOrderStatusOKCode is the HTTP code returned for type UpdateMoveTaskOrderStatusOK +const UpdateMoveTaskOrderStatusOKCode int = 200 + +/* +UpdateMoveTaskOrderStatusOK Successfully updated move task order status + +swagger:response updateMoveTaskOrderStatusOK +*/ +type UpdateMoveTaskOrderStatusOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusOK creates UpdateMoveTaskOrderStatusOK with default headers values +func NewUpdateMoveTaskOrderStatusOK() *UpdateMoveTaskOrderStatusOK { + + return &UpdateMoveTaskOrderStatusOK{} +} + +// WithPayload adds the payload to the update move task order status o k response +func (o *UpdateMoveTaskOrderStatusOK) WithPayload(payload *ghcmessages.Move) *UpdateMoveTaskOrderStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status o k response +func (o *UpdateMoveTaskOrderStatusOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusBadRequestCode is the HTTP code returned for type UpdateMoveTaskOrderStatusBadRequest +const UpdateMoveTaskOrderStatusBadRequestCode int = 400 + +/* +UpdateMoveTaskOrderStatusBadRequest The request payload is invalid + +swagger:response updateMoveTaskOrderStatusBadRequest +*/ +type UpdateMoveTaskOrderStatusBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusBadRequest creates UpdateMoveTaskOrderStatusBadRequest with default headers values +func NewUpdateMoveTaskOrderStatusBadRequest() *UpdateMoveTaskOrderStatusBadRequest { + + return &UpdateMoveTaskOrderStatusBadRequest{} +} + +// WithPayload adds the payload to the update move task order status bad request response +func (o *UpdateMoveTaskOrderStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status bad request response +func (o *UpdateMoveTaskOrderStatusBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusUnauthorizedCode is the HTTP code returned for type UpdateMoveTaskOrderStatusUnauthorized +const UpdateMoveTaskOrderStatusUnauthorizedCode int = 401 + +/* +UpdateMoveTaskOrderStatusUnauthorized The request was denied + +swagger:response updateMoveTaskOrderStatusUnauthorized +*/ +type UpdateMoveTaskOrderStatusUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusUnauthorized creates UpdateMoveTaskOrderStatusUnauthorized with default headers values +func NewUpdateMoveTaskOrderStatusUnauthorized() *UpdateMoveTaskOrderStatusUnauthorized { + + return &UpdateMoveTaskOrderStatusUnauthorized{} +} + +// WithPayload adds the payload to the update move task order status unauthorized response +func (o *UpdateMoveTaskOrderStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status unauthorized response +func (o *UpdateMoveTaskOrderStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusForbiddenCode is the HTTP code returned for type UpdateMoveTaskOrderStatusForbidden +const UpdateMoveTaskOrderStatusForbiddenCode int = 403 + +/* +UpdateMoveTaskOrderStatusForbidden The request was denied + +swagger:response updateMoveTaskOrderStatusForbidden +*/ +type UpdateMoveTaskOrderStatusForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusForbidden creates UpdateMoveTaskOrderStatusForbidden with default headers values +func NewUpdateMoveTaskOrderStatusForbidden() *UpdateMoveTaskOrderStatusForbidden { + + return &UpdateMoveTaskOrderStatusForbidden{} +} + +// WithPayload adds the payload to the update move task order status forbidden response +func (o *UpdateMoveTaskOrderStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status forbidden response +func (o *UpdateMoveTaskOrderStatusForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusNotFoundCode is the HTTP code returned for type UpdateMoveTaskOrderStatusNotFound +const UpdateMoveTaskOrderStatusNotFoundCode int = 404 + +/* +UpdateMoveTaskOrderStatusNotFound The requested resource wasn't found + +swagger:response updateMoveTaskOrderStatusNotFound +*/ +type UpdateMoveTaskOrderStatusNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusNotFound creates UpdateMoveTaskOrderStatusNotFound with default headers values +func NewUpdateMoveTaskOrderStatusNotFound() *UpdateMoveTaskOrderStatusNotFound { + + return &UpdateMoveTaskOrderStatusNotFound{} +} + +// WithPayload adds the payload to the update move task order status not found response +func (o *UpdateMoveTaskOrderStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status not found response +func (o *UpdateMoveTaskOrderStatusNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusConflictCode is the HTTP code returned for type UpdateMoveTaskOrderStatusConflict +const UpdateMoveTaskOrderStatusConflictCode int = 409 + +/* +UpdateMoveTaskOrderStatusConflict Conflict error + +swagger:response updateMoveTaskOrderStatusConflict +*/ +type UpdateMoveTaskOrderStatusConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusConflict creates UpdateMoveTaskOrderStatusConflict with default headers values +func NewUpdateMoveTaskOrderStatusConflict() *UpdateMoveTaskOrderStatusConflict { + + return &UpdateMoveTaskOrderStatusConflict{} +} + +// WithPayload adds the payload to the update move task order status conflict response +func (o *UpdateMoveTaskOrderStatusConflict) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status conflict response +func (o *UpdateMoveTaskOrderStatusConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusPreconditionFailedCode is the HTTP code returned for type UpdateMoveTaskOrderStatusPreconditionFailed +const UpdateMoveTaskOrderStatusPreconditionFailedCode int = 412 + +/* +UpdateMoveTaskOrderStatusPreconditionFailed Precondition failed + +swagger:response updateMoveTaskOrderStatusPreconditionFailed +*/ +type UpdateMoveTaskOrderStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusPreconditionFailed creates UpdateMoveTaskOrderStatusPreconditionFailed with default headers values +func NewUpdateMoveTaskOrderStatusPreconditionFailed() *UpdateMoveTaskOrderStatusPreconditionFailed { + + return &UpdateMoveTaskOrderStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update move task order status precondition failed response +func (o *UpdateMoveTaskOrderStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status precondition failed response +func (o *UpdateMoveTaskOrderStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMoveTaskOrderStatusUnprocessableEntity +const UpdateMoveTaskOrderStatusUnprocessableEntityCode int = 422 + +/* +UpdateMoveTaskOrderStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updateMoveTaskOrderStatusUnprocessableEntity +*/ +type UpdateMoveTaskOrderStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusUnprocessableEntity creates UpdateMoveTaskOrderStatusUnprocessableEntity with default headers values +func NewUpdateMoveTaskOrderStatusUnprocessableEntity() *UpdateMoveTaskOrderStatusUnprocessableEntity { + + return &UpdateMoveTaskOrderStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update move task order status unprocessable entity response +func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMoveTaskOrderStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status unprocessable entity response +func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveTaskOrderStatusInternalServerErrorCode is the HTTP code returned for type UpdateMoveTaskOrderStatusInternalServerError +const UpdateMoveTaskOrderStatusInternalServerErrorCode int = 500 + +/* +UpdateMoveTaskOrderStatusInternalServerError A server error occurred + +swagger:response updateMoveTaskOrderStatusInternalServerError +*/ +type UpdateMoveTaskOrderStatusInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMoveTaskOrderStatusInternalServerError creates UpdateMoveTaskOrderStatusInternalServerError with default headers values +func NewUpdateMoveTaskOrderStatusInternalServerError() *UpdateMoveTaskOrderStatusInternalServerError { + + return &UpdateMoveTaskOrderStatusInternalServerError{} +} + +// WithPayload adds the payload to the update move task order status internal server error response +func (o *UpdateMoveTaskOrderStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMoveTaskOrderStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move task order status internal server error response +func (o *UpdateMoveTaskOrderStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveTaskOrderStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go new file mode 100644 index 00000000000..7c230437a31 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMoveTaskOrderStatusURL generates an URL for the update move task order status operation +type UpdateMoveTaskOrderStatusURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveTaskOrderStatusURL) WithBasePath(bp string) *UpdateMoveTaskOrderStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveTaskOrderStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMoveTaskOrderStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/status" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMoveTaskOrderStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMoveTaskOrderStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMoveTaskOrderStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMoveTaskOrderStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMoveTaskOrderStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMoveTaskOrderStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMoveTaskOrderStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go new file mode 100644 index 00000000000..9ea69f40903 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// FetchMTOAgentListHandlerFunc turns a function with the right signature into a fetch m t o agent list handler +type FetchMTOAgentListHandlerFunc func(FetchMTOAgentListParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn FetchMTOAgentListHandlerFunc) Handle(params FetchMTOAgentListParams) middleware.Responder { + return fn(params) +} + +// FetchMTOAgentListHandler interface for that can handle valid fetch m t o agent list params +type FetchMTOAgentListHandler interface { + Handle(FetchMTOAgentListParams) middleware.Responder +} + +// NewFetchMTOAgentList creates a new http.Handler for the fetch m t o agent list operation +func NewFetchMTOAgentList(ctx *middleware.Context, handler FetchMTOAgentListHandler) *FetchMTOAgentList { + return &FetchMTOAgentList{Context: ctx, Handler: handler} +} + +/* + FetchMTOAgentList swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents mtoAgent fetchMTOAgentList + +Fetch move task order agents. + +Fetches a list of agents associated with a move task order. +*/ +type FetchMTOAgentList struct { + Context *middleware.Context + Handler FetchMTOAgentListHandler +} + +func (o *FetchMTOAgentList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewFetchMTOAgentListParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go new file mode 100644 index 00000000000..2c213c4ce18 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewFetchMTOAgentListParams creates a new FetchMTOAgentListParams object +// +// There are no default values defined in the spec. +func NewFetchMTOAgentListParams() FetchMTOAgentListParams { + + return FetchMTOAgentListParams{} +} + +// FetchMTOAgentListParams contains all the bound params for the fetch m t o agent list operation +// typically these are obtained from a http.Request +// +// swagger:parameters fetchMTOAgentList +type FetchMTOAgentListParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move task order + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewFetchMTOAgentListParams() beforehand. +func (o *FetchMTOAgentListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *FetchMTOAgentListParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *FetchMTOAgentListParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *FetchMTOAgentListParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *FetchMTOAgentListParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go new file mode 100644 index 00000000000..4c6b5363d3b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_responses.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// FetchMTOAgentListOKCode is the HTTP code returned for type FetchMTOAgentListOK +const FetchMTOAgentListOKCode int = 200 + +/* +FetchMTOAgentListOK Successfully retrieved all agents for a move task order + +swagger:response fetchMTOAgentListOK +*/ +type FetchMTOAgentListOK struct { + + /* + In: Body + */ + Payload ghcmessages.MTOAgents `json:"body,omitempty"` +} + +// NewFetchMTOAgentListOK creates FetchMTOAgentListOK with default headers values +func NewFetchMTOAgentListOK() *FetchMTOAgentListOK { + + return &FetchMTOAgentListOK{} +} + +// WithPayload adds the payload to the fetch m t o agent list o k response +func (o *FetchMTOAgentListOK) WithPayload(payload ghcmessages.MTOAgents) *FetchMTOAgentListOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the fetch m t o agent list o k response +func (o *FetchMTOAgentListOK) SetPayload(payload ghcmessages.MTOAgents) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FetchMTOAgentListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.MTOAgents{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// FetchMTOAgentListNotFoundCode is the HTTP code returned for type FetchMTOAgentListNotFound +const FetchMTOAgentListNotFoundCode int = 404 + +/* +FetchMTOAgentListNotFound The requested resource wasn't found + +swagger:response fetchMTOAgentListNotFound +*/ +type FetchMTOAgentListNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFetchMTOAgentListNotFound creates FetchMTOAgentListNotFound with default headers values +func NewFetchMTOAgentListNotFound() *FetchMTOAgentListNotFound { + + return &FetchMTOAgentListNotFound{} +} + +// WithPayload adds the payload to the fetch m t o agent list not found response +func (o *FetchMTOAgentListNotFound) WithPayload(payload *ghcmessages.Error) *FetchMTOAgentListNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the fetch m t o agent list not found response +func (o *FetchMTOAgentListNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FetchMTOAgentListNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FetchMTOAgentListUnprocessableEntityCode is the HTTP code returned for type FetchMTOAgentListUnprocessableEntity +const FetchMTOAgentListUnprocessableEntityCode int = 422 + +/* +FetchMTOAgentListUnprocessableEntity The payload was unprocessable. + +swagger:response fetchMTOAgentListUnprocessableEntity +*/ +type FetchMTOAgentListUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewFetchMTOAgentListUnprocessableEntity creates FetchMTOAgentListUnprocessableEntity with default headers values +func NewFetchMTOAgentListUnprocessableEntity() *FetchMTOAgentListUnprocessableEntity { + + return &FetchMTOAgentListUnprocessableEntity{} +} + +// WithPayload adds the payload to the fetch m t o agent list unprocessable entity response +func (o *FetchMTOAgentListUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *FetchMTOAgentListUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the fetch m t o agent list unprocessable entity response +func (o *FetchMTOAgentListUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FetchMTOAgentListUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FetchMTOAgentListInternalServerErrorCode is the HTTP code returned for type FetchMTOAgentListInternalServerError +const FetchMTOAgentListInternalServerErrorCode int = 500 + +/* +FetchMTOAgentListInternalServerError A server error occurred + +swagger:response fetchMTOAgentListInternalServerError +*/ +type FetchMTOAgentListInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFetchMTOAgentListInternalServerError creates FetchMTOAgentListInternalServerError with default headers values +func NewFetchMTOAgentListInternalServerError() *FetchMTOAgentListInternalServerError { + + return &FetchMTOAgentListInternalServerError{} +} + +// WithPayload adds the payload to the fetch m t o agent list internal server error response +func (o *FetchMTOAgentListInternalServerError) WithPayload(payload *ghcmessages.Error) *FetchMTOAgentListInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the fetch m t o agent list internal server error response +func (o *FetchMTOAgentListInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FetchMTOAgentListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go new file mode 100644 index 00000000000..fd993b942e3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_agent/fetch_m_t_o_agent_list_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_agent + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// FetchMTOAgentListURL generates an URL for the fetch m t o agent list operation +type FetchMTOAgentListURL struct { + MoveTaskOrderID strfmt.UUID + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *FetchMTOAgentListURL) WithBasePath(bp string) *FetchMTOAgentListURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *FetchMTOAgentListURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *FetchMTOAgentListURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on FetchMTOAgentListURL") + } + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on FetchMTOAgentListURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *FetchMTOAgentListURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *FetchMTOAgentListURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *FetchMTOAgentListURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on FetchMTOAgentListURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on FetchMTOAgentListURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *FetchMTOAgentListURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go new file mode 100644 index 00000000000..fee98cfba38 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMTOServiceItemHandlerFunc turns a function with the right signature into a get m t o service item handler +type GetMTOServiceItemHandlerFunc func(GetMTOServiceItemParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMTOServiceItemHandlerFunc) Handle(params GetMTOServiceItemParams) middleware.Responder { + return fn(params) +} + +// GetMTOServiceItemHandler interface for that can handle valid get m t o service item params +type GetMTOServiceItemHandler interface { + Handle(GetMTOServiceItemParams) middleware.Responder +} + +// NewGetMTOServiceItem creates a new http.Handler for the get m t o service item operation +func NewGetMTOServiceItem(ctx *middleware.Context, handler GetMTOServiceItemHandler) *GetMTOServiceItem { + return &GetMTOServiceItem{Context: ctx, Handler: handler} +} + +/* + GetMTOServiceItem swagger:route GET /move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID} mtoServiceItem getMTOServiceItem + +# Gets a line item by ID for a move by ID + +Gets a line item by ID for a move by ID +*/ +type GetMTOServiceItem struct { + Context *middleware.Context + Handler GetMTOServiceItemHandler +} + +func (o *GetMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMTOServiceItemParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go new file mode 100644 index 00000000000..c0f1f26cee8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMTOServiceItemParams creates a new GetMTOServiceItemParams object +// +// There are no default values defined in the spec. +func NewGetMTOServiceItemParams() GetMTOServiceItemParams { + + return GetMTOServiceItemParams{} +} + +// GetMTOServiceItemParams contains all the bound params for the get m t o service item operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMTOServiceItem +type GetMTOServiceItemParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string + /*ID of line item to use + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMTOServiceItemParams() beforehand. +func (o *GetMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *GetMTOServiceItemParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *GetMTOServiceItemParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go new file mode 100644 index 00000000000..a8aa048dc48 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMTOServiceItemOKCode is the HTTP code returned for type GetMTOServiceItemOK +const GetMTOServiceItemOKCode int = 200 + +/* +GetMTOServiceItemOK Successfully retrieved a line item for a move task order by ID + +swagger:response getMTOServiceItemOK +*/ +type GetMTOServiceItemOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOServiceItemSingle `json:"body,omitempty"` +} + +// NewGetMTOServiceItemOK creates GetMTOServiceItemOK with default headers values +func NewGetMTOServiceItemOK() *GetMTOServiceItemOK { + + return &GetMTOServiceItemOK{} +} + +// WithPayload adds the payload to the get m t o service item o k response +func (o *GetMTOServiceItemOK) WithPayload(payload *ghcmessages.MTOServiceItemSingle) *GetMTOServiceItemOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item o k response +func (o *GetMTOServiceItemOK) SetPayload(payload *ghcmessages.MTOServiceItemSingle) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMTOServiceItemBadRequestCode is the HTTP code returned for type GetMTOServiceItemBadRequest +const GetMTOServiceItemBadRequestCode int = 400 + +/* +GetMTOServiceItemBadRequest The request payload is invalid + +swagger:response getMTOServiceItemBadRequest +*/ +type GetMTOServiceItemBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMTOServiceItemBadRequest creates GetMTOServiceItemBadRequest with default headers values +func NewGetMTOServiceItemBadRequest() *GetMTOServiceItemBadRequest { + + return &GetMTOServiceItemBadRequest{} +} + +// WithPayload adds the payload to the get m t o service item bad request response +func (o *GetMTOServiceItemBadRequest) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item bad request response +func (o *GetMTOServiceItemBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMTOServiceItemUnauthorizedCode is the HTTP code returned for type GetMTOServiceItemUnauthorized +const GetMTOServiceItemUnauthorizedCode int = 401 + +/* +GetMTOServiceItemUnauthorized The request was denied + +swagger:response getMTOServiceItemUnauthorized +*/ +type GetMTOServiceItemUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMTOServiceItemUnauthorized creates GetMTOServiceItemUnauthorized with default headers values +func NewGetMTOServiceItemUnauthorized() *GetMTOServiceItemUnauthorized { + + return &GetMTOServiceItemUnauthorized{} +} + +// WithPayload adds the payload to the get m t o service item unauthorized response +func (o *GetMTOServiceItemUnauthorized) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item unauthorized response +func (o *GetMTOServiceItemUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMTOServiceItemForbiddenCode is the HTTP code returned for type GetMTOServiceItemForbidden +const GetMTOServiceItemForbiddenCode int = 403 + +/* +GetMTOServiceItemForbidden The request was denied + +swagger:response getMTOServiceItemForbidden +*/ +type GetMTOServiceItemForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMTOServiceItemForbidden creates GetMTOServiceItemForbidden with default headers values +func NewGetMTOServiceItemForbidden() *GetMTOServiceItemForbidden { + + return &GetMTOServiceItemForbidden{} +} + +// WithPayload adds the payload to the get m t o service item forbidden response +func (o *GetMTOServiceItemForbidden) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item forbidden response +func (o *GetMTOServiceItemForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMTOServiceItemNotFoundCode is the HTTP code returned for type GetMTOServiceItemNotFound +const GetMTOServiceItemNotFoundCode int = 404 + +/* +GetMTOServiceItemNotFound The requested resource wasn't found + +swagger:response getMTOServiceItemNotFound +*/ +type GetMTOServiceItemNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMTOServiceItemNotFound creates GetMTOServiceItemNotFound with default headers values +func NewGetMTOServiceItemNotFound() *GetMTOServiceItemNotFound { + + return &GetMTOServiceItemNotFound{} +} + +// WithPayload adds the payload to the get m t o service item not found response +func (o *GetMTOServiceItemNotFound) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item not found response +func (o *GetMTOServiceItemNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMTOServiceItemInternalServerErrorCode is the HTTP code returned for type GetMTOServiceItemInternalServerError +const GetMTOServiceItemInternalServerErrorCode int = 500 + +/* +GetMTOServiceItemInternalServerError A server error occurred + +swagger:response getMTOServiceItemInternalServerError +*/ +type GetMTOServiceItemInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMTOServiceItemInternalServerError creates GetMTOServiceItemInternalServerError with default headers values +func NewGetMTOServiceItemInternalServerError() *GetMTOServiceItemInternalServerError { + + return &GetMTOServiceItemInternalServerError{} +} + +// WithPayload adds the payload to the get m t o service item internal server error response +func (o *GetMTOServiceItemInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMTOServiceItemInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get m t o service item internal server error response +func (o *GetMTOServiceItemInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go new file mode 100644 index 00000000000..99feb3d4f2b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/get_m_t_o_service_item_urlbuilder.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMTOServiceItemURL generates an URL for the get m t o service item operation +type GetMTOServiceItemURL struct { + MoveTaskOrderID string + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMTOServiceItemURL) WithBasePath(bp string) *GetMTOServiceItemURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMTOServiceItemURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMTOServiceItemURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on GetMTOServiceItemURL") + } + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on GetMTOServiceItemURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMTOServiceItemURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMTOServiceItemURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMTOServiceItemURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMTOServiceItemURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go new file mode 100644 index 00000000000..7b08257233a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMTOServiceItemsHandlerFunc turns a function with the right signature into a list m t o service items handler +type ListMTOServiceItemsHandlerFunc func(ListMTOServiceItemsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMTOServiceItemsHandlerFunc) Handle(params ListMTOServiceItemsParams) middleware.Responder { + return fn(params) +} + +// ListMTOServiceItemsHandler interface for that can handle valid list m t o service items params +type ListMTOServiceItemsHandler interface { + Handle(ListMTOServiceItemsParams) middleware.Responder +} + +// NewListMTOServiceItems creates a new http.Handler for the list m t o service items operation +func NewListMTOServiceItems(ctx *middleware.Context, handler ListMTOServiceItemsHandler) *ListMTOServiceItems { + return &ListMTOServiceItems{Context: ctx, Handler: handler} +} + +/* + ListMTOServiceItems swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_service_items mtoServiceItem listMTOServiceItems + +# Gets all line items for a move + +Gets all line items for a move +*/ +type ListMTOServiceItems struct { + Context *middleware.Context + Handler ListMTOServiceItemsHandler +} + +func (o *ListMTOServiceItems) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMTOServiceItemsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go new file mode 100644 index 00000000000..72dbb94fac3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewListMTOServiceItemsParams creates a new ListMTOServiceItemsParams object +// +// There are no default values defined in the spec. +func NewListMTOServiceItemsParams() ListMTOServiceItemsParams { + + return ListMTOServiceItemsParams{} +} + +// ListMTOServiceItemsParams contains all the bound params for the list m t o service items operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMTOServiceItems +type ListMTOServiceItemsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move for mto service item to use + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMTOServiceItemsParams() beforehand. +func (o *ListMTOServiceItemsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *ListMTOServiceItemsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *ListMTOServiceItemsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go new file mode 100644 index 00000000000..f70a9d5e887 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_responses.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ListMTOServiceItemsOKCode is the HTTP code returned for type ListMTOServiceItemsOK +const ListMTOServiceItemsOKCode int = 200 + +/* +ListMTOServiceItemsOK Successfully retrieved all line items for a move task order + +swagger:response listMTOServiceItemsOK +*/ +type ListMTOServiceItemsOK struct { + + /* + In: Body + */ + Payload ghcmessages.MTOServiceItems `json:"body,omitempty"` +} + +// NewListMTOServiceItemsOK creates ListMTOServiceItemsOK with default headers values +func NewListMTOServiceItemsOK() *ListMTOServiceItemsOK { + + return &ListMTOServiceItemsOK{} +} + +// WithPayload adds the payload to the list m t o service items o k response +func (o *ListMTOServiceItemsOK) WithPayload(payload ghcmessages.MTOServiceItems) *ListMTOServiceItemsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o service items o k response +func (o *ListMTOServiceItemsOK) SetPayload(payload ghcmessages.MTOServiceItems) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOServiceItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.MTOServiceItems{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMTOServiceItemsNotFoundCode is the HTTP code returned for type ListMTOServiceItemsNotFound +const ListMTOServiceItemsNotFoundCode int = 404 + +/* +ListMTOServiceItemsNotFound The requested resource wasn't found + +swagger:response listMTOServiceItemsNotFound +*/ +type ListMTOServiceItemsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListMTOServiceItemsNotFound creates ListMTOServiceItemsNotFound with default headers values +func NewListMTOServiceItemsNotFound() *ListMTOServiceItemsNotFound { + + return &ListMTOServiceItemsNotFound{} +} + +// WithPayload adds the payload to the list m t o service items not found response +func (o *ListMTOServiceItemsNotFound) WithPayload(payload *ghcmessages.Error) *ListMTOServiceItemsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o service items not found response +func (o *ListMTOServiceItemsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOServiceItemsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOServiceItemsUnprocessableEntityCode is the HTTP code returned for type ListMTOServiceItemsUnprocessableEntity +const ListMTOServiceItemsUnprocessableEntityCode int = 422 + +/* +ListMTOServiceItemsUnprocessableEntity The payload was unprocessable. + +swagger:response listMTOServiceItemsUnprocessableEntity +*/ +type ListMTOServiceItemsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewListMTOServiceItemsUnprocessableEntity creates ListMTOServiceItemsUnprocessableEntity with default headers values +func NewListMTOServiceItemsUnprocessableEntity() *ListMTOServiceItemsUnprocessableEntity { + + return &ListMTOServiceItemsUnprocessableEntity{} +} + +// WithPayload adds the payload to the list m t o service items unprocessable entity response +func (o *ListMTOServiceItemsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ListMTOServiceItemsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o service items unprocessable entity response +func (o *ListMTOServiceItemsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOServiceItemsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOServiceItemsInternalServerErrorCode is the HTTP code returned for type ListMTOServiceItemsInternalServerError +const ListMTOServiceItemsInternalServerErrorCode int = 500 + +/* +ListMTOServiceItemsInternalServerError A server error occurred + +swagger:response listMTOServiceItemsInternalServerError +*/ +type ListMTOServiceItemsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListMTOServiceItemsInternalServerError creates ListMTOServiceItemsInternalServerError with default headers values +func NewListMTOServiceItemsInternalServerError() *ListMTOServiceItemsInternalServerError { + + return &ListMTOServiceItemsInternalServerError{} +} + +// WithPayload adds the payload to the list m t o service items internal server error response +func (o *ListMTOServiceItemsInternalServerError) WithPayload(payload *ghcmessages.Error) *ListMTOServiceItemsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o service items internal server error response +func (o *ListMTOServiceItemsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOServiceItemsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go new file mode 100644 index 00000000000..42361b94613 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/list_m_t_o_service_items_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ListMTOServiceItemsURL generates an URL for the list m t o service items operation +type ListMTOServiceItemsURL struct { + MoveTaskOrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOServiceItemsURL) WithBasePath(bp string) *ListMTOServiceItemsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOServiceItemsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMTOServiceItemsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_task_orders/{moveTaskOrderID}/mto_service_items" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on ListMTOServiceItemsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMTOServiceItemsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMTOServiceItemsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMTOServiceItemsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMTOServiceItemsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMTOServiceItemsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMTOServiceItemsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go new file mode 100644 index 00000000000..fd15c76b0db --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOServiceItemStatusHandlerFunc turns a function with the right signature into a update m t o service item status handler +type UpdateMTOServiceItemStatusHandlerFunc func(UpdateMTOServiceItemStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOServiceItemStatusHandlerFunc) Handle(params UpdateMTOServiceItemStatusParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOServiceItemStatusHandler interface for that can handle valid update m t o service item status params +type UpdateMTOServiceItemStatusHandler interface { + Handle(UpdateMTOServiceItemStatusParams) middleware.Responder +} + +// NewUpdateMTOServiceItemStatus creates a new http.Handler for the update m t o service item status operation +func NewUpdateMTOServiceItemStatus(ctx *middleware.Context, handler UpdateMTOServiceItemStatusHandler) *UpdateMTOServiceItemStatus { + return &UpdateMTOServiceItemStatus{Context: ctx, Handler: handler} +} + +/* + UpdateMTOServiceItemStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status mtoServiceItem updateMTOServiceItemStatus + +# Change the status of a line item for a move by ID + +Changes the status of a line item for a move by ID +*/ +type UpdateMTOServiceItemStatus struct { + Context *middleware.Context + Handler UpdateMTOServiceItemStatusHandler +} + +func (o *UpdateMTOServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOServiceItemStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go new file mode 100644 index 00000000000..dad712808c0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOServiceItemStatusParams() UpdateMTOServiceItemStatusParams { + + return UpdateMTOServiceItemStatusParams{} +} + +// UpdateMTOServiceItemStatusParams contains all the bound params for the update m t o service item status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOServiceItemStatus +type UpdateMTOServiceItemStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.PatchMTOServiceItemStatusPayload + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string + /*ID of line item to use + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemStatusParams() beforehand. +func (o *UpdateMTOServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.PatchMTOServiceItemStatusPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMTOServiceItemStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *UpdateMTOServiceItemStatusParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go new file mode 100644 index 00000000000..1122fd66480 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMTOServiceItemStatusOKCode is the HTTP code returned for type UpdateMTOServiceItemStatusOK +const UpdateMTOServiceItemStatusOKCode int = 200 + +/* +UpdateMTOServiceItemStatusOK Successfully updated status for a line item for a move task order by ID + +swagger:response updateMTOServiceItemStatusOK +*/ +type UpdateMTOServiceItemStatusOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOServiceItem `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusOK creates UpdateMTOServiceItemStatusOK with default headers values +func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { + + return &UpdateMTOServiceItemStatusOK{} +} + +// WithPayload adds the payload to the update m t o service item status o k response +func (o *UpdateMTOServiceItemStatusOK) WithPayload(payload *ghcmessages.MTOServiceItem) *UpdateMTOServiceItemStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status o k response +func (o *UpdateMTOServiceItemStatusOK) SetPayload(payload *ghcmessages.MTOServiceItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemStatusBadRequest +const UpdateMTOServiceItemStatusBadRequestCode int = 400 + +/* +UpdateMTOServiceItemStatusBadRequest The request payload is invalid + +swagger:response updateMTOServiceItemStatusBadRequest +*/ +type UpdateMTOServiceItemStatusBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusBadRequest creates UpdateMTOServiceItemStatusBadRequest with default headers values +func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { + + return &UpdateMTOServiceItemStatusBadRequest{} +} + +// WithPayload adds the payload to the update m t o service item status bad request response +func (o *UpdateMTOServiceItemStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status bad request response +func (o *UpdateMTOServiceItemStatusBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnauthorized +const UpdateMTOServiceItemStatusUnauthorizedCode int = 401 + +/* +UpdateMTOServiceItemStatusUnauthorized The request was denied + +swagger:response updateMTOServiceItemStatusUnauthorized +*/ +type UpdateMTOServiceItemStatusUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusUnauthorized creates UpdateMTOServiceItemStatusUnauthorized with default headers values +func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { + + return &UpdateMTOServiceItemStatusUnauthorized{} +} + +// WithPayload adds the payload to the update m t o service item status unauthorized response +func (o *UpdateMTOServiceItemStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status unauthorized response +func (o *UpdateMTOServiceItemStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemStatusForbidden +const UpdateMTOServiceItemStatusForbiddenCode int = 403 + +/* +UpdateMTOServiceItemStatusForbidden The request was denied + +swagger:response updateMTOServiceItemStatusForbidden +*/ +type UpdateMTOServiceItemStatusForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusForbidden creates UpdateMTOServiceItemStatusForbidden with default headers values +func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { + + return &UpdateMTOServiceItemStatusForbidden{} +} + +// WithPayload adds the payload to the update m t o service item status forbidden response +func (o *UpdateMTOServiceItemStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status forbidden response +func (o *UpdateMTOServiceItemStatusForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemStatusNotFound +const UpdateMTOServiceItemStatusNotFoundCode int = 404 + +/* +UpdateMTOServiceItemStatusNotFound The requested resource wasn't found + +swagger:response updateMTOServiceItemStatusNotFound +*/ +type UpdateMTOServiceItemStatusNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusNotFound creates UpdateMTOServiceItemStatusNotFound with default headers values +func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { + + return &UpdateMTOServiceItemStatusNotFound{} +} + +// WithPayload adds the payload to the update m t o service item status not found response +func (o *UpdateMTOServiceItemStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status not found response +func (o *UpdateMTOServiceItemStatusNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemStatusPreconditionFailed +const UpdateMTOServiceItemStatusPreconditionFailedCode int = 412 + +/* +UpdateMTOServiceItemStatusPreconditionFailed Precondition failed + +swagger:response updateMTOServiceItemStatusPreconditionFailed +*/ +type UpdateMTOServiceItemStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusPreconditionFailed creates UpdateMTOServiceItemStatusPreconditionFailed with default headers values +func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { + + return &UpdateMTOServiceItemStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o service item status precondition failed response +func (o *UpdateMTOServiceItemStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status precondition failed response +func (o *UpdateMTOServiceItemStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnprocessableEntity +const UpdateMTOServiceItemStatusUnprocessableEntityCode int = 422 + +/* +UpdateMTOServiceItemStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOServiceItemStatusUnprocessableEntity +*/ +type UpdateMTOServiceItemStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusUnprocessableEntity creates UpdateMTOServiceItemStatusUnprocessableEntity with default headers values +func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { + + return &UpdateMTOServiceItemStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o service item status unprocessable entity response +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOServiceItemStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status unprocessable entity response +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemStatusInternalServerError +const UpdateMTOServiceItemStatusInternalServerErrorCode int = 500 + +/* +UpdateMTOServiceItemStatusInternalServerError A server error occurred + +swagger:response updateMTOServiceItemStatusInternalServerError +*/ +type UpdateMTOServiceItemStatusInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusInternalServerError creates UpdateMTOServiceItemStatusInternalServerError with default headers values +func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { + + return &UpdateMTOServiceItemStatusInternalServerError{} +} + +// WithPayload adds the payload to the update m t o service item status internal server error response +func (o *UpdateMTOServiceItemStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOServiceItemStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status internal server error response +func (o *UpdateMTOServiceItemStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go new file mode 100644 index 00000000000..76f339c1d6c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOServiceItemStatusURL generates an URL for the update m t o service item status operation +type UpdateMTOServiceItemStatusURL struct { + MoveTaskOrderID string + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemStatusURL) WithBasePath(bp string) *UpdateMTOServiceItemStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOServiceItemStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMTOServiceItemStatusURL") + } + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOServiceItemStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOServiceItemStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOServiceItemStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go new file mode 100644 index 00000000000..d352fc5934f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateServiceItemSitEntryDateHandlerFunc turns a function with the right signature into a update service item sit entry date handler +type UpdateServiceItemSitEntryDateHandlerFunc func(UpdateServiceItemSitEntryDateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateServiceItemSitEntryDateHandlerFunc) Handle(params UpdateServiceItemSitEntryDateParams) middleware.Responder { + return fn(params) +} + +// UpdateServiceItemSitEntryDateHandler interface for that can handle valid update service item sit entry date params +type UpdateServiceItemSitEntryDateHandler interface { + Handle(UpdateServiceItemSitEntryDateParams) middleware.Responder +} + +// NewUpdateServiceItemSitEntryDate creates a new http.Handler for the update service item sit entry date operation +func NewUpdateServiceItemSitEntryDate(ctx *middleware.Context, handler UpdateServiceItemSitEntryDateHandler) *UpdateServiceItemSitEntryDate { + return &UpdateServiceItemSitEntryDate{Context: ctx, Handler: handler} +} + +/* + UpdateServiceItemSitEntryDate swagger:route PATCH /service-item/{mtoServiceItemID}/entry-date-update mtoServiceItem updateServiceItemSitEntryDate + +# Updates a service item's SIT entry date by ID + +Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item +*/ +type UpdateServiceItemSitEntryDate struct { + Context *middleware.Context + Handler UpdateServiceItemSitEntryDateHandler +} + +func (o *UpdateServiceItemSitEntryDate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateServiceItemSitEntryDateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go new file mode 100644 index 00000000000..96638c0c8df --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_parameters.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateServiceItemSitEntryDateParams creates a new UpdateServiceItemSitEntryDateParams object +// +// There are no default values defined in the spec. +func NewUpdateServiceItemSitEntryDateParams() UpdateServiceItemSitEntryDateParams { + + return UpdateServiceItemSitEntryDateParams{} +} + +// UpdateServiceItemSitEntryDateParams contains all the bound params for the update service item sit entry date operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateServiceItemSitEntryDate +type UpdateServiceItemSitEntryDateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *ghcmessages.ServiceItemSitEntryDate + /*ID of the service item + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateServiceItemSitEntryDateParams() beforehand. +func (o *UpdateServiceItemSitEntryDateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.ServiceItemSitEntryDate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *UpdateServiceItemSitEntryDateParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go new file mode 100644 index 00000000000..5f4b6e2a765 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateServiceItemSitEntryDateOKCode is the HTTP code returned for type UpdateServiceItemSitEntryDateOK +const UpdateServiceItemSitEntryDateOKCode int = 200 + +/* +UpdateServiceItemSitEntryDateOK Successfully updated SIT entry date + +swagger:response updateServiceItemSitEntryDateOK +*/ +type UpdateServiceItemSitEntryDateOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOServiceItemSingle `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateOK creates UpdateServiceItemSitEntryDateOK with default headers values +func NewUpdateServiceItemSitEntryDateOK() *UpdateServiceItemSitEntryDateOK { + + return &UpdateServiceItemSitEntryDateOK{} +} + +// WithPayload adds the payload to the update service item sit entry date o k response +func (o *UpdateServiceItemSitEntryDateOK) WithPayload(payload *ghcmessages.MTOServiceItemSingle) *UpdateServiceItemSitEntryDateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date o k response +func (o *UpdateServiceItemSitEntryDateOK) SetPayload(payload *ghcmessages.MTOServiceItemSingle) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateBadRequestCode is the HTTP code returned for type UpdateServiceItemSitEntryDateBadRequest +const UpdateServiceItemSitEntryDateBadRequestCode int = 400 + +/* +UpdateServiceItemSitEntryDateBadRequest The request payload is invalid + +swagger:response updateServiceItemSitEntryDateBadRequest +*/ +type UpdateServiceItemSitEntryDateBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateBadRequest creates UpdateServiceItemSitEntryDateBadRequest with default headers values +func NewUpdateServiceItemSitEntryDateBadRequest() *UpdateServiceItemSitEntryDateBadRequest { + + return &UpdateServiceItemSitEntryDateBadRequest{} +} + +// WithPayload adds the payload to the update service item sit entry date bad request response +func (o *UpdateServiceItemSitEntryDateBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date bad request response +func (o *UpdateServiceItemSitEntryDateBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateUnauthorizedCode is the HTTP code returned for type UpdateServiceItemSitEntryDateUnauthorized +const UpdateServiceItemSitEntryDateUnauthorizedCode int = 401 + +/* +UpdateServiceItemSitEntryDateUnauthorized The request was denied + +swagger:response updateServiceItemSitEntryDateUnauthorized +*/ +type UpdateServiceItemSitEntryDateUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateUnauthorized creates UpdateServiceItemSitEntryDateUnauthorized with default headers values +func NewUpdateServiceItemSitEntryDateUnauthorized() *UpdateServiceItemSitEntryDateUnauthorized { + + return &UpdateServiceItemSitEntryDateUnauthorized{} +} + +// WithPayload adds the payload to the update service item sit entry date unauthorized response +func (o *UpdateServiceItemSitEntryDateUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date unauthorized response +func (o *UpdateServiceItemSitEntryDateUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateForbiddenCode is the HTTP code returned for type UpdateServiceItemSitEntryDateForbidden +const UpdateServiceItemSitEntryDateForbiddenCode int = 403 + +/* +UpdateServiceItemSitEntryDateForbidden The request was denied + +swagger:response updateServiceItemSitEntryDateForbidden +*/ +type UpdateServiceItemSitEntryDateForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateForbidden creates UpdateServiceItemSitEntryDateForbidden with default headers values +func NewUpdateServiceItemSitEntryDateForbidden() *UpdateServiceItemSitEntryDateForbidden { + + return &UpdateServiceItemSitEntryDateForbidden{} +} + +// WithPayload adds the payload to the update service item sit entry date forbidden response +func (o *UpdateServiceItemSitEntryDateForbidden) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date forbidden response +func (o *UpdateServiceItemSitEntryDateForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateNotFoundCode is the HTTP code returned for type UpdateServiceItemSitEntryDateNotFound +const UpdateServiceItemSitEntryDateNotFoundCode int = 404 + +/* +UpdateServiceItemSitEntryDateNotFound The requested resource wasn't found + +swagger:response updateServiceItemSitEntryDateNotFound +*/ +type UpdateServiceItemSitEntryDateNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateNotFound creates UpdateServiceItemSitEntryDateNotFound with default headers values +func NewUpdateServiceItemSitEntryDateNotFound() *UpdateServiceItemSitEntryDateNotFound { + + return &UpdateServiceItemSitEntryDateNotFound{} +} + +// WithPayload adds the payload to the update service item sit entry date not found response +func (o *UpdateServiceItemSitEntryDateNotFound) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date not found response +func (o *UpdateServiceItemSitEntryDateNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDatePreconditionFailedCode is the HTTP code returned for type UpdateServiceItemSitEntryDatePreconditionFailed +const UpdateServiceItemSitEntryDatePreconditionFailedCode int = 412 + +/* +UpdateServiceItemSitEntryDatePreconditionFailed Precondition failed + +swagger:response updateServiceItemSitEntryDatePreconditionFailed +*/ +type UpdateServiceItemSitEntryDatePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDatePreconditionFailed creates UpdateServiceItemSitEntryDatePreconditionFailed with default headers values +func NewUpdateServiceItemSitEntryDatePreconditionFailed() *UpdateServiceItemSitEntryDatePreconditionFailed { + + return &UpdateServiceItemSitEntryDatePreconditionFailed{} +} + +// WithPayload adds the payload to the update service item sit entry date precondition failed response +func (o *UpdateServiceItemSitEntryDatePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDatePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date precondition failed response +func (o *UpdateServiceItemSitEntryDatePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDatePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateUnprocessableEntityCode is the HTTP code returned for type UpdateServiceItemSitEntryDateUnprocessableEntity +const UpdateServiceItemSitEntryDateUnprocessableEntityCode int = 422 + +/* +UpdateServiceItemSitEntryDateUnprocessableEntity The payload was unprocessable. + +swagger:response updateServiceItemSitEntryDateUnprocessableEntity +*/ +type UpdateServiceItemSitEntryDateUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateUnprocessableEntity creates UpdateServiceItemSitEntryDateUnprocessableEntity with default headers values +func NewUpdateServiceItemSitEntryDateUnprocessableEntity() *UpdateServiceItemSitEntryDateUnprocessableEntity { + + return &UpdateServiceItemSitEntryDateUnprocessableEntity{} +} + +// WithPayload adds the payload to the update service item sit entry date unprocessable entity response +func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateServiceItemSitEntryDateUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date unprocessable entity response +func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceItemSitEntryDateInternalServerErrorCode is the HTTP code returned for type UpdateServiceItemSitEntryDateInternalServerError +const UpdateServiceItemSitEntryDateInternalServerErrorCode int = 500 + +/* +UpdateServiceItemSitEntryDateInternalServerError A server error occurred + +swagger:response updateServiceItemSitEntryDateInternalServerError +*/ +type UpdateServiceItemSitEntryDateInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateServiceItemSitEntryDateInternalServerError creates UpdateServiceItemSitEntryDateInternalServerError with default headers values +func NewUpdateServiceItemSitEntryDateInternalServerError() *UpdateServiceItemSitEntryDateInternalServerError { + + return &UpdateServiceItemSitEntryDateInternalServerError{} +} + +// WithPayload adds the payload to the update service item sit entry date internal server error response +func (o *UpdateServiceItemSitEntryDateInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateServiceItemSitEntryDateInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service item sit entry date internal server error response +func (o *UpdateServiceItemSitEntryDateInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceItemSitEntryDateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go new file mode 100644 index 00000000000..2a477f33ee4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_service_item/update_service_item_sit_entry_date_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateServiceItemSitEntryDateURL generates an URL for the update service item sit entry date operation +type UpdateServiceItemSitEntryDateURL struct { + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateServiceItemSitEntryDateURL) WithBasePath(bp string) *UpdateServiceItemSitEntryDateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateServiceItemSitEntryDateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateServiceItemSitEntryDateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service-item/{mtoServiceItemID}/entry-date-update" + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on UpdateServiceItemSitEntryDateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateServiceItemSitEntryDateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateServiceItemSitEntryDateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateServiceItemSitEntryDateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateServiceItemSitEntryDateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateServiceItemSitEntryDateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateServiceItemSitEntryDateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go new file mode 100644 index 00000000000..b701c9cbcb8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler +type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params +type CreateMTOShipmentHandler interface { + Handle(CreateMTOShipmentParams) middleware.Responder +} + +// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation +func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { + return &CreateMTOShipment{Context: ctx, Handler: handler} +} + +/* + CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment + +createMTOShipment + +Creates a MTO shipment for the specified Move Task Order. +Required fields include: +* Shipment Type +* Customer requested pick-up date +* Pick-up Address +* Delivery Address +* Releasing / Receiving agents +Optional fields include: +* Delivery Address Type +* Customer Remarks +* Releasing / Receiving agents +* An array of optional accessorial service item codes +*/ +type CreateMTOShipment struct { + Context *middleware.Context + Handler CreateMTOShipmentHandler +} + +func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..d3f2997df76 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOShipmentParams() CreateMTOShipmentParams { + + return CreateMTOShipmentParams{} +} + +// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOShipment +type CreateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.CreateMTOShipment +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. +func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateMTOShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..e09e9ec4c5d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK +const CreateMTOShipmentOKCode int = 200 + +/* +CreateMTOShipmentOK Successfully created a MTO shipment. + +swagger:response createMTOShipmentOK +*/ +type CreateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + + return &CreateMTOShipmentOK{} +} + +// WithPayload adds the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *CreateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest +const CreateMTOShipmentBadRequestCode int = 400 + +/* +CreateMTOShipmentBadRequest The request payload is invalid + +swagger:response createMTOShipmentBadRequest +*/ +type CreateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + + return &CreateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound +const CreateMTOShipmentNotFoundCode int = 404 + +/* +CreateMTOShipmentNotFound The requested resource wasn't found + +swagger:response createMTOShipmentNotFound +*/ +type CreateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + + return &CreateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity +const CreateMTOShipmentUnprocessableEntityCode int = 422 + +/* +CreateMTOShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response createMTOShipmentUnprocessableEntity +*/ +type CreateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + + return &CreateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError +const CreateMTOShipmentInternalServerErrorCode int = 500 + +/* +CreateMTOShipmentInternalServerError A server error occurred + +swagger:response createMTOShipmentInternalServerError +*/ +type CreateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + + return &CreateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..80a0cf279e6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOShipmentURL generates an URL for the create m t o shipment operation +type CreateMTOShipmentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go new file mode 100644 index 00000000000..eb07dd54847 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetShipmentHandlerFunc turns a function with the right signature into a get shipment handler +type GetShipmentHandlerFunc func(GetShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetShipmentHandlerFunc) Handle(params GetShipmentParams) middleware.Responder { + return fn(params) +} + +// GetShipmentHandler interface for that can handle valid get shipment params +type GetShipmentHandler interface { + Handle(GetShipmentParams) middleware.Responder +} + +// NewGetShipment creates a new http.Handler for the get shipment operation +func NewGetShipment(ctx *middleware.Context, handler GetShipmentHandler) *GetShipment { + return &GetShipment{Context: ctx, Handler: handler} +} + +/* + GetShipment swagger:route GET /shipments/{shipmentID} mtoShipment getShipment + +fetches a shipment by ID + +fetches a shipment by ID +*/ +type GetShipment struct { + Context *middleware.Context + Handler GetShipmentHandler +} + +func (o *GetShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go new file mode 100644 index 00000000000..39b7f921314 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetShipmentParams creates a new GetShipmentParams object +// +// There are no default values defined in the spec. +func NewGetShipmentParams() GetShipmentParams { + + return GetShipmentParams{} +} + +// GetShipmentParams contains all the bound params for the get shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters getShipment +type GetShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the shipment to be fetched + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetShipmentParams() beforehand. +func (o *GetShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *GetShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *GetShipmentParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go new file mode 100644 index 00000000000..3105d2a6409 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetShipmentOKCode is the HTTP code returned for type GetShipmentOK +const GetShipmentOKCode int = 200 + +/* +GetShipmentOK Successfully fetched the shipment + +swagger:response getShipmentOK +*/ +type GetShipmentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewGetShipmentOK creates GetShipmentOK with default headers values +func NewGetShipmentOK() *GetShipmentOK { + + return &GetShipmentOK{} +} + +// WithPayload adds the payload to the get shipment o k response +func (o *GetShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *GetShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment o k response +func (o *GetShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentBadRequestCode is the HTTP code returned for type GetShipmentBadRequest +const GetShipmentBadRequestCode int = 400 + +/* +GetShipmentBadRequest The request payload is invalid + +swagger:response getShipmentBadRequest +*/ +type GetShipmentBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentBadRequest creates GetShipmentBadRequest with default headers values +func NewGetShipmentBadRequest() *GetShipmentBadRequest { + + return &GetShipmentBadRequest{} +} + +// WithPayload adds the payload to the get shipment bad request response +func (o *GetShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *GetShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment bad request response +func (o *GetShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentForbiddenCode is the HTTP code returned for type GetShipmentForbidden +const GetShipmentForbiddenCode int = 403 + +/* +GetShipmentForbidden The request was denied + +swagger:response getShipmentForbidden +*/ +type GetShipmentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentForbidden creates GetShipmentForbidden with default headers values +func NewGetShipmentForbidden() *GetShipmentForbidden { + + return &GetShipmentForbidden{} +} + +// WithPayload adds the payload to the get shipment forbidden response +func (o *GetShipmentForbidden) WithPayload(payload *ghcmessages.Error) *GetShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment forbidden response +func (o *GetShipmentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentNotFoundCode is the HTTP code returned for type GetShipmentNotFound +const GetShipmentNotFoundCode int = 404 + +/* +GetShipmentNotFound The requested resource wasn't found + +swagger:response getShipmentNotFound +*/ +type GetShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentNotFound creates GetShipmentNotFound with default headers values +func NewGetShipmentNotFound() *GetShipmentNotFound { + + return &GetShipmentNotFound{} +} + +// WithPayload adds the payload to the get shipment not found response +func (o *GetShipmentNotFound) WithPayload(payload *ghcmessages.Error) *GetShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment not found response +func (o *GetShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentUnprocessableEntityCode is the HTTP code returned for type GetShipmentUnprocessableEntity +const GetShipmentUnprocessableEntityCode int = 422 + +/* +GetShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response getShipmentUnprocessableEntity +*/ +type GetShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetShipmentUnprocessableEntity creates GetShipmentUnprocessableEntity with default headers values +func NewGetShipmentUnprocessableEntity() *GetShipmentUnprocessableEntity { + + return &GetShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the get shipment unprocessable entity response +func (o *GetShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment unprocessable entity response +func (o *GetShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentInternalServerErrorCode is the HTTP code returned for type GetShipmentInternalServerError +const GetShipmentInternalServerErrorCode int = 500 + +/* +GetShipmentInternalServerError A server error occurred + +swagger:response getShipmentInternalServerError +*/ +type GetShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentInternalServerError creates GetShipmentInternalServerError with default headers values +func NewGetShipmentInternalServerError() *GetShipmentInternalServerError { + + return &GetShipmentInternalServerError{} +} + +// WithPayload adds the payload to the get shipment internal server error response +func (o *GetShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *GetShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipment internal server error response +func (o *GetShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go new file mode 100644 index 00000000000..5bcdd735d79 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/get_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetShipmentURL generates an URL for the get shipment operation +type GetShipmentURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetShipmentURL) WithBasePath(bp string) *GetShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on GetShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go new file mode 100644 index 00000000000..1d6949747b1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMTOShipmentsHandlerFunc turns a function with the right signature into a list m t o shipments handler +type ListMTOShipmentsHandlerFunc func(ListMTOShipmentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMTOShipmentsHandlerFunc) Handle(params ListMTOShipmentsParams) middleware.Responder { + return fn(params) +} + +// ListMTOShipmentsHandler interface for that can handle valid list m t o shipments params +type ListMTOShipmentsHandler interface { + Handle(ListMTOShipmentsParams) middleware.Responder +} + +// NewListMTOShipments creates a new http.Handler for the list m t o shipments operation +func NewListMTOShipments(ctx *middleware.Context, handler ListMTOShipmentsHandler) *ListMTOShipments { + return &ListMTOShipments{Context: ctx, Handler: handler} +} + +/* + ListMTOShipments swagger:route GET /move_task_orders/{moveTaskOrderID}/mto_shipments mtoShipment listMTOShipments + +# Gets all shipments for a move task order + +Gets all shipments for a move task order +*/ +type ListMTOShipments struct { + Context *middleware.Context + Handler ListMTOShipmentsHandler +} + +func (o *ListMTOShipments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMTOShipmentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go new file mode 100644 index 00000000000..e186e4a8796 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewListMTOShipmentsParams creates a new ListMTOShipmentsParams object +// +// There are no default values defined in the spec. +func NewListMTOShipmentsParams() ListMTOShipmentsParams { + + return ListMTOShipmentsParams{} +} + +// ListMTOShipmentsParams contains all the bound params for the list m t o shipments operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMTOShipments +type ListMTOShipmentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move task order for mto shipment to use + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMTOShipmentsParams() beforehand. +func (o *ListMTOShipmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *ListMTOShipmentsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *ListMTOShipmentsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go new file mode 100644 index 00000000000..7aaebb34d52 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ListMTOShipmentsOKCode is the HTTP code returned for type ListMTOShipmentsOK +const ListMTOShipmentsOKCode int = 200 + +/* +ListMTOShipmentsOK Successfully retrieved all mto shipments for a move task order + +swagger:response listMTOShipmentsOK +*/ +type ListMTOShipmentsOK struct { + + /* + In: Body + */ + Payload ghcmessages.MTOShipments `json:"body,omitempty"` +} + +// NewListMTOShipmentsOK creates ListMTOShipmentsOK with default headers values +func NewListMTOShipmentsOK() *ListMTOShipmentsOK { + + return &ListMTOShipmentsOK{} +} + +// WithPayload adds the payload to the list m t o shipments o k response +func (o *ListMTOShipmentsOK) WithPayload(payload ghcmessages.MTOShipments) *ListMTOShipmentsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments o k response +func (o *ListMTOShipmentsOK) SetPayload(payload ghcmessages.MTOShipments) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.MTOShipments{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMTOShipmentsForbiddenCode is the HTTP code returned for type ListMTOShipmentsForbidden +const ListMTOShipmentsForbiddenCode int = 403 + +/* +ListMTOShipmentsForbidden The request was denied + +swagger:response listMTOShipmentsForbidden +*/ +type ListMTOShipmentsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListMTOShipmentsForbidden creates ListMTOShipmentsForbidden with default headers values +func NewListMTOShipmentsForbidden() *ListMTOShipmentsForbidden { + + return &ListMTOShipmentsForbidden{} +} + +// WithPayload adds the payload to the list m t o shipments forbidden response +func (o *ListMTOShipmentsForbidden) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments forbidden response +func (o *ListMTOShipmentsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsNotFoundCode is the HTTP code returned for type ListMTOShipmentsNotFound +const ListMTOShipmentsNotFoundCode int = 404 + +/* +ListMTOShipmentsNotFound The requested resource wasn't found + +swagger:response listMTOShipmentsNotFound +*/ +type ListMTOShipmentsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListMTOShipmentsNotFound creates ListMTOShipmentsNotFound with default headers values +func NewListMTOShipmentsNotFound() *ListMTOShipmentsNotFound { + + return &ListMTOShipmentsNotFound{} +} + +// WithPayload adds the payload to the list m t o shipments not found response +func (o *ListMTOShipmentsNotFound) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments not found response +func (o *ListMTOShipmentsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsUnprocessableEntityCode is the HTTP code returned for type ListMTOShipmentsUnprocessableEntity +const ListMTOShipmentsUnprocessableEntityCode int = 422 + +/* +ListMTOShipmentsUnprocessableEntity The payload was unprocessable. + +swagger:response listMTOShipmentsUnprocessableEntity +*/ +type ListMTOShipmentsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewListMTOShipmentsUnprocessableEntity creates ListMTOShipmentsUnprocessableEntity with default headers values +func NewListMTOShipmentsUnprocessableEntity() *ListMTOShipmentsUnprocessableEntity { + + return &ListMTOShipmentsUnprocessableEntity{} +} + +// WithPayload adds the payload to the list m t o shipments unprocessable entity response +func (o *ListMTOShipmentsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ListMTOShipmentsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments unprocessable entity response +func (o *ListMTOShipmentsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsInternalServerErrorCode is the HTTP code returned for type ListMTOShipmentsInternalServerError +const ListMTOShipmentsInternalServerErrorCode int = 500 + +/* +ListMTOShipmentsInternalServerError A server error occurred + +swagger:response listMTOShipmentsInternalServerError +*/ +type ListMTOShipmentsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListMTOShipmentsInternalServerError creates ListMTOShipmentsInternalServerError with default headers values +func NewListMTOShipmentsInternalServerError() *ListMTOShipmentsInternalServerError { + + return &ListMTOShipmentsInternalServerError{} +} + +// WithPayload adds the payload to the list m t o shipments internal server error response +func (o *ListMTOShipmentsInternalServerError) WithPayload(payload *ghcmessages.Error) *ListMTOShipmentsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments internal server error response +func (o *ListMTOShipmentsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go new file mode 100644 index 00000000000..87184b95a9c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ListMTOShipmentsURL generates an URL for the list m t o shipments operation +type ListMTOShipmentsURL struct { + MoveTaskOrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOShipmentsURL) WithBasePath(bp string) *ListMTOShipmentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOShipmentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMTOShipmentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on ListMTOShipmentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMTOShipmentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMTOShipmentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMTOShipmentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMTOShipmentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMTOShipmentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMTOShipmentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go new file mode 100644 index 00000000000..eb0db5e29ab --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler +type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params +type UpdateMTOShipmentHandler interface { + Handle(UpdateMTOShipmentParams) middleware.Responder +} + +// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation +func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { + return &UpdateMTOShipment{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipment swagger:route PATCH /move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID} mtoShipment updateMTOShipment + +updateMTOShipment + +Updates a specified MTO shipment. +Required fields include: +* MTO Shipment ID required in path +* If-Match required in headers +* No fields required in body +Optional fields include: +* New shipment status type +* Shipment Type +* Customer requested pick-up date +* Pick-up Address +* Delivery Address +* Secondary Pick-up Address +* SecondaryDelivery Address +* Delivery Address Type +* Customer Remarks +* Counselor Remarks +* Releasing / Receiving agents +* Actual Pro Gear Weight +* Actual Spouse Pro Gear Weight +*/ +type UpdateMTOShipment struct { + Context *middleware.Context + Handler UpdateMTOShipmentHandler +} + +func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..221db2ce162 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { + + return UpdateMTOShipmentParams{} +} + +// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipment +type UpdateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + In: body + */ + Body *ghcmessages.UpdateShipment + /*ID of move task order for mto shipment to use + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID + /*UUID of the MTO Shipment to update + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. +func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMTOShipmentParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *UpdateMTOShipmentParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *UpdateMTOShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *UpdateMTOShipmentParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..6db7a6650b7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK +const UpdateMTOShipmentOKCode int = 200 + +/* +UpdateMTOShipmentOK Successfully updated the specified MTO shipment. + +swagger:response updateMTOShipmentOK +*/ +type UpdateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + + return &UpdateMTOShipmentOK{} +} + +// WithPayload adds the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *UpdateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest +const UpdateMTOShipmentBadRequestCode int = 400 + +/* +UpdateMTOShipmentBadRequest The request payload is invalid + +swagger:response updateMTOShipmentBadRequest +*/ +type UpdateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + + return &UpdateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized +const UpdateMTOShipmentUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentUnauthorized The request was denied + +swagger:response updateMTOShipmentUnauthorized +*/ +type UpdateMTOShipmentUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + + return &UpdateMTOShipmentUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden +const UpdateMTOShipmentForbiddenCode int = 403 + +/* +UpdateMTOShipmentForbidden The request was denied + +swagger:response updateMTOShipmentForbidden +*/ +type UpdateMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + + return &UpdateMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound +const UpdateMTOShipmentNotFoundCode int = 404 + +/* +UpdateMTOShipmentNotFound The requested resource wasn't found + +swagger:response updateMTOShipmentNotFound +*/ +type UpdateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + + return &UpdateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed +const UpdateMTOShipmentPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentPreconditionFailed Precondition failed + +swagger:response updateMTOShipmentPreconditionFailed +*/ +type UpdateMTOShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + + return &UpdateMTOShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity +const UpdateMTOShipmentUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOShipmentUnprocessableEntity +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + + return &UpdateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError +const UpdateMTOShipmentInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentInternalServerError A server error occurred + +swagger:response updateMTOShipmentInternalServerError +*/ +type UpdateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + + return &UpdateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..5b05a62e80a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation +type UpdateMTOShipmentURL struct { + MoveTaskOrderID strfmt.UUID + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMTOShipmentURL") + } + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on UpdateMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go new file mode 100644 index 00000000000..e64a6704256 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -0,0 +1,1622 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcoperations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/addresses" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/application_parameters" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/calendar" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/customer_support_remarks" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/evaluation_reports" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ghc_documents" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/lines_of_accounting" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_agent" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/office_users" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/order" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_requests" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/payment_service_item" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/ppm" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/pws_violations" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/queues" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/re_service_items" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/report_violations" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/shipment" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/tac" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/transportation_office" + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations/uploads" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + MultipartformConsumer: runtime.DiscardConsumer, + + BinProducer: runtime.ByteStreamProducer(), + JSONProducer: runtime.JSONProducer(), + + OrderAcknowledgeExcessWeightRiskHandler: order.AcknowledgeExcessWeightRiskHandlerFunc(func(params order.AcknowledgeExcessWeightRiskParams) middleware.Responder { + return middleware.NotImplemented("operation order.AcknowledgeExcessWeightRisk has not yet been implemented") + }), + EvaluationReportsAddAppealToSeriousIncidentHandler: evaluation_reports.AddAppealToSeriousIncidentHandlerFunc(func(params evaluation_reports.AddAppealToSeriousIncidentParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.AddAppealToSeriousIncident has not yet been implemented") + }), + EvaluationReportsAddAppealToViolationHandler: evaluation_reports.AddAppealToViolationHandlerFunc(func(params evaluation_reports.AddAppealToViolationParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.AddAppealToViolation has not yet been implemented") + }), + ShipmentApproveSITExtensionHandler: shipment.ApproveSITExtensionHandlerFunc(func(params shipment.ApproveSITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveSITExtension has not yet been implemented") + }), + ShipmentApproveShipmentHandler: shipment.ApproveShipmentHandlerFunc(func(params shipment.ApproveShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipment has not yet been implemented") + }), + ShipmentApproveShipmentDiversionHandler: shipment.ApproveShipmentDiversionHandlerFunc(func(params shipment.ApproveShipmentDiversionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") + }), + ReportViolationsAssociateReportViolationsHandler: report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { + return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") + }), + PaymentRequestsBulkDownloadHandler: payment_requests.BulkDownloadHandlerFunc(func(params payment_requests.BulkDownloadParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.BulkDownload has not yet been implemented") + }), + MoveCheckForLockedMovesAndUnlockHandler: move.CheckForLockedMovesAndUnlockHandlerFunc(func(params move.CheckForLockedMovesAndUnlockParams) middleware.Responder { + return middleware.NotImplemented("operation move.CheckForLockedMovesAndUnlock has not yet been implemented") + }), + OrderCounselingUpdateAllowanceHandler: order.CounselingUpdateAllowanceHandlerFunc(func(params order.CounselingUpdateAllowanceParams) middleware.Responder { + return middleware.NotImplemented("operation order.CounselingUpdateAllowance has not yet been implemented") + }), + OrderCounselingUpdateOrderHandler: order.CounselingUpdateOrderHandlerFunc(func(params order.CounselingUpdateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.CounselingUpdateOrder has not yet been implemented") + }), + ShipmentCreateApprovedSITDurationUpdateHandler: shipment.CreateApprovedSITDurationUpdateHandlerFunc(func(params shipment.CreateApprovedSITDurationUpdateParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.CreateApprovedSITDurationUpdate has not yet been implemented") + }), + CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler: customer_support_remarks.CreateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.CreateCustomerSupportRemarkForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.CreateCustomerSupportRemarkForMove has not yet been implemented") + }), + CustomerCreateCustomerWithOktaOptionHandler: customer.CreateCustomerWithOktaOptionHandlerFunc(func(params customer.CreateCustomerWithOktaOptionParams) middleware.Responder { + return middleware.NotImplemented("operation customer.CreateCustomerWithOktaOption has not yet been implemented") + }), + GhcDocumentsCreateDocumentHandler: ghc_documents.CreateDocumentHandlerFunc(func(params ghc_documents.CreateDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation ghc_documents.CreateDocument has not yet been implemented") + }), + EvaluationReportsCreateEvaluationReportHandler: evaluation_reports.CreateEvaluationReportHandlerFunc(func(params evaluation_reports.CreateEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.CreateEvaluationReport has not yet been implemented") + }), + MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }), + OrderCreateOrderHandler: order.CreateOrderHandlerFunc(func(params order.CreateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.CreateOrder has not yet been implemented") + }), + OfficeUsersCreateRequestedOfficeUserHandler: office_users.CreateRequestedOfficeUserHandlerFunc(func(params office_users.CreateRequestedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation office_users.CreateRequestedOfficeUser has not yet been implemented") + }), + UploadsCreateUploadHandler: uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") + }), + MoveDeleteAssignedOfficeUserHandler: move.DeleteAssignedOfficeUserHandlerFunc(func(params move.DeleteAssignedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation move.DeleteAssignedOfficeUser has not yet been implemented") + }), + CustomerSupportRemarksDeleteCustomerSupportRemarkHandler: customer_support_remarks.DeleteCustomerSupportRemarkHandlerFunc(func(params customer_support_remarks.DeleteCustomerSupportRemarkParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.DeleteCustomerSupportRemark has not yet been implemented") + }), + EvaluationReportsDeleteEvaluationReportHandler: evaluation_reports.DeleteEvaluationReportHandlerFunc(func(params evaluation_reports.DeleteEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.DeleteEvaluationReport has not yet been implemented") + }), + ShipmentDeleteShipmentHandler: shipment.DeleteShipmentHandlerFunc(func(params shipment.DeleteShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.DeleteShipment has not yet been implemented") + }), + UploadsDeleteUploadHandler: uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") + }), + ShipmentDenySITExtensionHandler: shipment.DenySITExtensionHandlerFunc(func(params shipment.DenySITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.DenySITExtension has not yet been implemented") + }), + EvaluationReportsDownloadEvaluationReportHandler: evaluation_reports.DownloadEvaluationReportHandlerFunc(func(params evaluation_reports.DownloadEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.DownloadEvaluationReport has not yet been implemented") + }), + MtoAgentFetchMTOAgentListHandler: mto_agent.FetchMTOAgentListHandlerFunc(func(params mto_agent.FetchMTOAgentListParams) middleware.Responder { + return middleware.NotImplemented("operation mto_agent.FetchMTOAgentList has not yet been implemented") + }), + PpmFinishDocumentReviewHandler: ppm.FinishDocumentReviewHandlerFunc(func(params ppm.FinishDocumentReviewParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.FinishDocumentReview has not yet been implemented") + }), + ReServiceItemsGetAllReServiceItemsHandler: re_service_items.GetAllReServiceItemsHandlerFunc(func(params re_service_items.GetAllReServiceItemsParams) middleware.Responder { + return middleware.NotImplemented("operation re_service_items.GetAllReServiceItems has not yet been implemented") + }), + QueuesGetBulkAssignmentDataHandler: queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") + }), + CustomerGetCustomerHandler: customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { + return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") + }), + CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler: customer_support_remarks.GetCustomerSupportRemarksForMoveHandlerFunc(func(params customer_support_remarks.GetCustomerSupportRemarksForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.GetCustomerSupportRemarksForMove has not yet been implemented") + }), + GhcDocumentsGetDocumentHandler: ghc_documents.GetDocumentHandlerFunc(func(params ghc_documents.GetDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation ghc_documents.GetDocument has not yet been implemented") + }), + MoveTaskOrderGetEntitlementsHandler: move_task_order.GetEntitlementsHandlerFunc(func(params move_task_order.GetEntitlementsParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetEntitlements has not yet been implemented") + }), + EvaluationReportsGetEvaluationReportHandler: evaluation_reports.GetEvaluationReportHandlerFunc(func(params evaluation_reports.GetEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.GetEvaluationReport has not yet been implemented") + }), + AddressesGetLocationByZipCityStateHandler: addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") + }), + MtoServiceItemGetMTOServiceItemHandler: mto_service_item.GetMTOServiceItemHandlerFunc(func(params mto_service_item.GetMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.GetMTOServiceItem has not yet been implemented") + }), + MoveGetMoveHandler: move.GetMoveHandlerFunc(func(params move.GetMoveParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMove has not yet been implemented") + }), + MoveGetMoveCounselingEvaluationReportsListHandler: move.GetMoveCounselingEvaluationReportsListHandlerFunc(func(params move.GetMoveCounselingEvaluationReportsListParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveCounselingEvaluationReportsList has not yet been implemented") + }), + MoveGetMoveHistoryHandler: move.GetMoveHistoryHandlerFunc(func(params move.GetMoveHistoryParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveHistory has not yet been implemented") + }), + MoveGetMoveShipmentEvaluationReportsListHandler: move.GetMoveShipmentEvaluationReportsListHandlerFunc(func(params move.GetMoveShipmentEvaluationReportsListParams) middleware.Responder { + return middleware.NotImplemented("operation move.GetMoveShipmentEvaluationReportsList has not yet been implemented") + }), + MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }), + QueuesGetMovesQueueHandler: queues.GetMovesQueueHandlerFunc(func(params queues.GetMovesQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetMovesQueue has not yet been implemented") + }), + OrderGetOrderHandler: order.GetOrderHandlerFunc(func(params order.GetOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.GetOrder has not yet been implemented") + }), + PpmGetPPMActualWeightHandler: ppm.GetPPMActualWeightHandlerFunc(func(params ppm.GetPPMActualWeightParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMActualWeight has not yet been implemented") + }), + PpmGetPPMCloseoutHandler: ppm.GetPPMCloseoutHandlerFunc(func(params ppm.GetPPMCloseoutParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMCloseout has not yet been implemented") + }), + PpmGetPPMDocumentsHandler: ppm.GetPPMDocumentsHandlerFunc(func(params ppm.GetPPMDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMDocuments has not yet been implemented") + }), + PpmGetPPMSITEstimatedCostHandler: ppm.GetPPMSITEstimatedCostHandlerFunc(func(params ppm.GetPPMSITEstimatedCostParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.GetPPMSITEstimatedCost has not yet been implemented") + }), + PwsViolationsGetPWSViolationsHandler: pws_violations.GetPWSViolationsHandlerFunc(func(params pws_violations.GetPWSViolationsParams) middleware.Responder { + return middleware.NotImplemented("operation pws_violations.GetPWSViolations has not yet been implemented") + }), + ApplicationParametersGetParamHandler: application_parameters.GetParamHandlerFunc(func(params application_parameters.GetParamParams) middleware.Responder { + return middleware.NotImplemented("operation application_parameters.GetParam has not yet been implemented") + }), + PaymentRequestsGetPaymentRequestHandler: payment_requests.GetPaymentRequestHandlerFunc(func(params payment_requests.GetPaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetPaymentRequest has not yet been implemented") + }), + PaymentRequestsGetPaymentRequestsForMoveHandler: payment_requests.GetPaymentRequestsForMoveHandlerFunc(func(params payment_requests.GetPaymentRequestsForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetPaymentRequestsForMove has not yet been implemented") + }), + QueuesGetPaymentRequestsQueueHandler: queues.GetPaymentRequestsQueueHandlerFunc(func(params queues.GetPaymentRequestsQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetPaymentRequestsQueue has not yet been implemented") + }), + ReportViolationsGetReportViolationsByReportIDHandler: report_violations.GetReportViolationsByReportIDHandlerFunc(func(params report_violations.GetReportViolationsByReportIDParams) middleware.Responder { + return middleware.NotImplemented("operation report_violations.GetReportViolationsByReportID has not yet been implemented") + }), + QueuesGetServicesCounselingOriginListHandler: queues.GetServicesCounselingOriginListHandlerFunc(func(params queues.GetServicesCounselingOriginListParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetServicesCounselingOriginList has not yet been implemented") + }), + QueuesGetServicesCounselingQueueHandler: queues.GetServicesCounselingQueueHandlerFunc(func(params queues.GetServicesCounselingQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.GetServicesCounselingQueue has not yet been implemented") + }), + MtoShipmentGetShipmentHandler: mto_shipment.GetShipmentHandlerFunc(func(params mto_shipment.GetShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.GetShipment has not yet been implemented") + }), + PaymentRequestsGetShipmentsPaymentSITBalanceHandler: payment_requests.GetShipmentsPaymentSITBalanceHandlerFunc(func(params payment_requests.GetShipmentsPaymentSITBalanceParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.GetShipmentsPaymentSITBalance has not yet been implemented") + }), + TransportationOfficeGetTransportationOfficesHandler: transportation_office.GetTransportationOfficesHandlerFunc(func(params transportation_office.GetTransportationOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOffices has not yet been implemented") + }), + TransportationOfficeGetTransportationOfficesGBLOCsHandler: transportation_office.GetTransportationOfficesGBLOCsHandlerFunc(func(params transportation_office.GetTransportationOfficesGBLOCsParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesGBLOCs has not yet been implemented") + }), + TransportationOfficeGetTransportationOfficesOpenHandler: transportation_office.GetTransportationOfficesOpenHandlerFunc(func(params transportation_office.GetTransportationOfficesOpenParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_office.GetTransportationOfficesOpen has not yet been implemented") + }), + UploadsGetUploadHandler: uploads.GetUploadHandlerFunc(func(params uploads.GetUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.GetUpload has not yet been implemented") + }), + CalendarIsDateWeekendHolidayHandler: calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") + }), + MtoServiceItemListMTOServiceItemsHandler: mto_service_item.ListMTOServiceItemsHandlerFunc(func(params mto_service_item.ListMTOServiceItemsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.ListMTOServiceItems has not yet been implemented") + }), + MtoShipmentListMTOShipmentsHandler: mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") + }), + QueuesListPrimeMovesHandler: queues.ListPrimeMovesHandlerFunc(func(params queues.ListPrimeMovesParams) middleware.Responder { + return middleware.NotImplemented("operation queues.ListPrimeMoves has not yet been implemented") + }), + MoveMoveCancelerHandler: move.MoveCancelerHandlerFunc(func(params move.MoveCancelerParams) middleware.Responder { + return middleware.NotImplemented("operation move.MoveCanceler has not yet been implemented") + }), + ShipmentRejectShipmentHandler: shipment.RejectShipmentHandlerFunc(func(params shipment.RejectShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RejectShipment has not yet been implemented") + }), + LinesOfAccountingRequestLineOfAccountingHandler: lines_of_accounting.RequestLineOfAccountingHandlerFunc(func(params lines_of_accounting.RequestLineOfAccountingParams) middleware.Responder { + return middleware.NotImplemented("operation lines_of_accounting.RequestLineOfAccounting has not yet been implemented") + }), + ShipmentRequestShipmentCancellationHandler: shipment.RequestShipmentCancellationHandlerFunc(func(params shipment.RequestShipmentCancellationParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentCancellation has not yet been implemented") + }), + ShipmentRequestShipmentDiversionHandler: shipment.RequestShipmentDiversionHandlerFunc(func(params shipment.RequestShipmentDiversionParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentDiversion has not yet been implemented") + }), + ShipmentRequestShipmentReweighHandler: shipment.RequestShipmentReweighHandlerFunc(func(params shipment.RequestShipmentReweighParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.RequestShipmentReweigh has not yet been implemented") + }), + ShipmentReviewShipmentAddressUpdateHandler: shipment.ReviewShipmentAddressUpdateHandlerFunc(func(params shipment.ReviewShipmentAddressUpdateParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ReviewShipmentAddressUpdate has not yet been implemented") + }), + EvaluationReportsSaveEvaluationReportHandler: evaluation_reports.SaveEvaluationReportHandlerFunc(func(params evaluation_reports.SaveEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.SaveEvaluationReport has not yet been implemented") + }), + CustomerSearchCustomersHandler: customer.SearchCustomersHandlerFunc(func(params customer.SearchCustomersParams) middleware.Responder { + return middleware.NotImplemented("operation customer.SearchCustomers has not yet been implemented") + }), + MoveSearchMovesHandler: move.SearchMovesHandlerFunc(func(params move.SearchMovesParams) middleware.Responder { + return middleware.NotImplemented("operation move.SearchMoves has not yet been implemented") + }), + MoveSetFinancialReviewFlagHandler: move.SetFinancialReviewFlagHandlerFunc(func(params move.SetFinancialReviewFlagParams) middleware.Responder { + return middleware.NotImplemented("operation move.SetFinancialReviewFlag has not yet been implemented") + }), + PpmShowAOAPacketHandler: ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") + }), + PpmShowPaymentPacketHandler: ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") + }), + EvaluationReportsSubmitEvaluationReportHandler: evaluation_reports.SubmitEvaluationReportHandlerFunc(func(params evaluation_reports.SubmitEvaluationReportParams) middleware.Responder { + return middleware.NotImplemented("operation evaluation_reports.SubmitEvaluationReport has not yet been implemented") + }), + TacTacValidationHandler: tac.TacValidationHandlerFunc(func(params tac.TacValidationParams) middleware.Responder { + return middleware.NotImplemented("operation tac.TacValidation has not yet been implemented") + }), + OrderUpdateAllowanceHandler: order.UpdateAllowanceHandlerFunc(func(params order.UpdateAllowanceParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateAllowance has not yet been implemented") + }), + MoveUpdateAssignedOfficeUserHandler: move.UpdateAssignedOfficeUserHandlerFunc(func(params move.UpdateAssignedOfficeUserParams) middleware.Responder { + return middleware.NotImplemented("operation move.UpdateAssignedOfficeUser has not yet been implemented") + }), + OrderUpdateBillableWeightHandler: order.UpdateBillableWeightHandlerFunc(func(params order.UpdateBillableWeightParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateBillableWeight has not yet been implemented") + }), + MoveUpdateCloseoutOfficeHandler: move.UpdateCloseoutOfficeHandlerFunc(func(params move.UpdateCloseoutOfficeParams) middleware.Responder { + return middleware.NotImplemented("operation move.UpdateCloseoutOffice has not yet been implemented") + }), + CustomerUpdateCustomerHandler: customer.UpdateCustomerHandlerFunc(func(params customer.UpdateCustomerParams) middleware.Responder { + return middleware.NotImplemented("operation customer.UpdateCustomer has not yet been implemented") + }), + CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler: customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandlerFunc(func(params customer_support_remarks.UpdateCustomerSupportRemarkForMoveParams) middleware.Responder { + return middleware.NotImplemented("operation customer_support_remarks.UpdateCustomerSupportRemarkForMove has not yet been implemented") + }), + MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler: move_task_order.UpdateMTOReviewedBillableWeightsAtHandlerFunc(func(params move_task_order.UpdateMTOReviewedBillableWeightsAtParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOReviewedBillableWeightsAt has not yet been implemented") + }), + MtoServiceItemUpdateMTOServiceItemStatusHandler: mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }), + MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler: move_task_order.UpdateMTOStatusServiceCounselingCompletedHandlerFunc(func(params move_task_order.UpdateMTOStatusServiceCounselingCompletedParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOStatusServiceCounselingCompleted has not yet been implemented") + }), + OrderUpdateMaxBillableWeightAsTIOHandler: order.UpdateMaxBillableWeightAsTIOHandlerFunc(func(params order.UpdateMaxBillableWeightAsTIOParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateMaxBillableWeightAsTIO has not yet been implemented") + }), + MoveTaskOrderUpdateMoveTIORemarksHandler: move_task_order.UpdateMoveTIORemarksHandlerFunc(func(params move_task_order.UpdateMoveTIORemarksParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMoveTIORemarks has not yet been implemented") + }), + MoveTaskOrderUpdateMoveTaskOrderStatusHandler: move_task_order.UpdateMoveTaskOrderStatusHandlerFunc(func(params move_task_order.UpdateMoveTaskOrderStatusParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMoveTaskOrderStatus has not yet been implemented") + }), + PpmUpdateMovingExpenseHandler: ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") + }), + OrderUpdateOrderHandler: order.UpdateOrderHandlerFunc(func(params order.UpdateOrderParams) middleware.Responder { + return middleware.NotImplemented("operation order.UpdateOrder has not yet been implemented") + }), + PpmUpdatePPMSITHandler: ppm.UpdatePPMSITHandlerFunc(func(params ppm.UpdatePPMSITParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdatePPMSIT has not yet been implemented") + }), + PaymentRequestsUpdatePaymentRequestStatusHandler: payment_requests.UpdatePaymentRequestStatusHandlerFunc(func(params payment_requests.UpdatePaymentRequestStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_requests.UpdatePaymentRequestStatus has not yet been implemented") + }), + PaymentServiceItemUpdatePaymentServiceItemStatusHandler: payment_service_item.UpdatePaymentServiceItemStatusHandlerFunc(func(params payment_service_item.UpdatePaymentServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_service_item.UpdatePaymentServiceItemStatus has not yet been implemented") + }), + PpmUpdateProGearWeightTicketHandler: ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") + }), + ShipmentUpdateSITServiceItemCustomerExpenseHandler: shipment.UpdateSITServiceItemCustomerExpenseHandlerFunc(func(params shipment.UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.UpdateSITServiceItemCustomerExpense has not yet been implemented") + }), + MtoServiceItemUpdateServiceItemSitEntryDateHandler: mto_service_item.UpdateServiceItemSitEntryDateHandlerFunc(func(params mto_service_item.UpdateServiceItemSitEntryDateParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateServiceItemSitEntryDate has not yet been implemented") + }), + UploadsUpdateUploadHandler: uploads.UpdateUploadHandlerFunc(func(params uploads.UpdateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.UpdateUpload has not yet been implemented") + }), + PpmUpdateWeightTicketHandler: ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") + }), + MoveUploadAdditionalDocumentsHandler: move.UploadAdditionalDocumentsHandlerFunc(func(params move.UploadAdditionalDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation move.UploadAdditionalDocuments has not yet been implemented") + }), + OrderUploadAmendedOrdersHandler: order.UploadAmendedOrdersHandlerFunc(func(params order.UploadAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation order.UploadAmendedOrders has not yet been implemented") + }), + } +} + +/* +MymoveAPI The GHC API is a RESTful API that enables the Office application for MilMove. + +All endpoints are located under `/ghc/v1`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + // MultipartformConsumer registers a consumer for the following mime types: + // - multipart/form-data + MultipartformConsumer runtime.Consumer + + // BinProducer registers a producer for the following mime types: + // - application/pdf + BinProducer runtime.Producer + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // OrderAcknowledgeExcessWeightRiskHandler sets the operation handler for the acknowledge excess weight risk operation + OrderAcknowledgeExcessWeightRiskHandler order.AcknowledgeExcessWeightRiskHandler + // EvaluationReportsAddAppealToSeriousIncidentHandler sets the operation handler for the add appeal to serious incident operation + EvaluationReportsAddAppealToSeriousIncidentHandler evaluation_reports.AddAppealToSeriousIncidentHandler + // EvaluationReportsAddAppealToViolationHandler sets the operation handler for the add appeal to violation operation + EvaluationReportsAddAppealToViolationHandler evaluation_reports.AddAppealToViolationHandler + // ShipmentApproveSITExtensionHandler sets the operation handler for the approve s i t extension operation + ShipmentApproveSITExtensionHandler shipment.ApproveSITExtensionHandler + // ShipmentApproveShipmentHandler sets the operation handler for the approve shipment operation + ShipmentApproveShipmentHandler shipment.ApproveShipmentHandler + // ShipmentApproveShipmentDiversionHandler sets the operation handler for the approve shipment diversion operation + ShipmentApproveShipmentDiversionHandler shipment.ApproveShipmentDiversionHandler + // ReportViolationsAssociateReportViolationsHandler sets the operation handler for the associate report violations operation + ReportViolationsAssociateReportViolationsHandler report_violations.AssociateReportViolationsHandler + // PaymentRequestsBulkDownloadHandler sets the operation handler for the bulk download operation + PaymentRequestsBulkDownloadHandler payment_requests.BulkDownloadHandler + // MoveCheckForLockedMovesAndUnlockHandler sets the operation handler for the check for locked moves and unlock operation + MoveCheckForLockedMovesAndUnlockHandler move.CheckForLockedMovesAndUnlockHandler + // OrderCounselingUpdateAllowanceHandler sets the operation handler for the counseling update allowance operation + OrderCounselingUpdateAllowanceHandler order.CounselingUpdateAllowanceHandler + // OrderCounselingUpdateOrderHandler sets the operation handler for the counseling update order operation + OrderCounselingUpdateOrderHandler order.CounselingUpdateOrderHandler + // ShipmentCreateApprovedSITDurationUpdateHandler sets the operation handler for the create approved s i t duration update operation + ShipmentCreateApprovedSITDurationUpdateHandler shipment.CreateApprovedSITDurationUpdateHandler + // CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler sets the operation handler for the create customer support remark for move operation + CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler customer_support_remarks.CreateCustomerSupportRemarkForMoveHandler + // CustomerCreateCustomerWithOktaOptionHandler sets the operation handler for the create customer with okta option operation + CustomerCreateCustomerWithOktaOptionHandler customer.CreateCustomerWithOktaOptionHandler + // GhcDocumentsCreateDocumentHandler sets the operation handler for the create document operation + GhcDocumentsCreateDocumentHandler ghc_documents.CreateDocumentHandler + // EvaluationReportsCreateEvaluationReportHandler sets the operation handler for the create evaluation report operation + EvaluationReportsCreateEvaluationReportHandler evaluation_reports.CreateEvaluationReportHandler + // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation + MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler + // OrderCreateOrderHandler sets the operation handler for the create order operation + OrderCreateOrderHandler order.CreateOrderHandler + // OfficeUsersCreateRequestedOfficeUserHandler sets the operation handler for the create requested office user operation + OfficeUsersCreateRequestedOfficeUserHandler office_users.CreateRequestedOfficeUserHandler + // UploadsCreateUploadHandler sets the operation handler for the create upload operation + UploadsCreateUploadHandler uploads.CreateUploadHandler + // MoveDeleteAssignedOfficeUserHandler sets the operation handler for the delete assigned office user operation + MoveDeleteAssignedOfficeUserHandler move.DeleteAssignedOfficeUserHandler + // CustomerSupportRemarksDeleteCustomerSupportRemarkHandler sets the operation handler for the delete customer support remark operation + CustomerSupportRemarksDeleteCustomerSupportRemarkHandler customer_support_remarks.DeleteCustomerSupportRemarkHandler + // EvaluationReportsDeleteEvaluationReportHandler sets the operation handler for the delete evaluation report operation + EvaluationReportsDeleteEvaluationReportHandler evaluation_reports.DeleteEvaluationReportHandler + // ShipmentDeleteShipmentHandler sets the operation handler for the delete shipment operation + ShipmentDeleteShipmentHandler shipment.DeleteShipmentHandler + // UploadsDeleteUploadHandler sets the operation handler for the delete upload operation + UploadsDeleteUploadHandler uploads.DeleteUploadHandler + // ShipmentDenySITExtensionHandler sets the operation handler for the deny s i t extension operation + ShipmentDenySITExtensionHandler shipment.DenySITExtensionHandler + // EvaluationReportsDownloadEvaluationReportHandler sets the operation handler for the download evaluation report operation + EvaluationReportsDownloadEvaluationReportHandler evaluation_reports.DownloadEvaluationReportHandler + // MtoAgentFetchMTOAgentListHandler sets the operation handler for the fetch m t o agent list operation + MtoAgentFetchMTOAgentListHandler mto_agent.FetchMTOAgentListHandler + // PpmFinishDocumentReviewHandler sets the operation handler for the finish document review operation + PpmFinishDocumentReviewHandler ppm.FinishDocumentReviewHandler + // ReServiceItemsGetAllReServiceItemsHandler sets the operation handler for the get all re service items operation + ReServiceItemsGetAllReServiceItemsHandler re_service_items.GetAllReServiceItemsHandler + // QueuesGetBulkAssignmentDataHandler sets the operation handler for the get bulk assignment data operation + QueuesGetBulkAssignmentDataHandler queues.GetBulkAssignmentDataHandler + // CustomerGetCustomerHandler sets the operation handler for the get customer operation + CustomerGetCustomerHandler customer.GetCustomerHandler + // CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler sets the operation handler for the get customer support remarks for move operation + CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler customer_support_remarks.GetCustomerSupportRemarksForMoveHandler + // GhcDocumentsGetDocumentHandler sets the operation handler for the get document operation + GhcDocumentsGetDocumentHandler ghc_documents.GetDocumentHandler + // MoveTaskOrderGetEntitlementsHandler sets the operation handler for the get entitlements operation + MoveTaskOrderGetEntitlementsHandler move_task_order.GetEntitlementsHandler + // EvaluationReportsGetEvaluationReportHandler sets the operation handler for the get evaluation report operation + EvaluationReportsGetEvaluationReportHandler evaluation_reports.GetEvaluationReportHandler + // AddressesGetLocationByZipCityStateHandler sets the operation handler for the get location by zip city state operation + AddressesGetLocationByZipCityStateHandler addresses.GetLocationByZipCityStateHandler + // MtoServiceItemGetMTOServiceItemHandler sets the operation handler for the get m t o service item operation + MtoServiceItemGetMTOServiceItemHandler mto_service_item.GetMTOServiceItemHandler + // MoveGetMoveHandler sets the operation handler for the get move operation + MoveGetMoveHandler move.GetMoveHandler + // MoveGetMoveCounselingEvaluationReportsListHandler sets the operation handler for the get move counseling evaluation reports list operation + MoveGetMoveCounselingEvaluationReportsListHandler move.GetMoveCounselingEvaluationReportsListHandler + // MoveGetMoveHistoryHandler sets the operation handler for the get move history operation + MoveGetMoveHistoryHandler move.GetMoveHistoryHandler + // MoveGetMoveShipmentEvaluationReportsListHandler sets the operation handler for the get move shipment evaluation reports list operation + MoveGetMoveShipmentEvaluationReportsListHandler move.GetMoveShipmentEvaluationReportsListHandler + // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation + MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler + // QueuesGetMovesQueueHandler sets the operation handler for the get moves queue operation + QueuesGetMovesQueueHandler queues.GetMovesQueueHandler + // OrderGetOrderHandler sets the operation handler for the get order operation + OrderGetOrderHandler order.GetOrderHandler + // PpmGetPPMActualWeightHandler sets the operation handler for the get p p m actual weight operation + PpmGetPPMActualWeightHandler ppm.GetPPMActualWeightHandler + // PpmGetPPMCloseoutHandler sets the operation handler for the get p p m closeout operation + PpmGetPPMCloseoutHandler ppm.GetPPMCloseoutHandler + // PpmGetPPMDocumentsHandler sets the operation handler for the get p p m documents operation + PpmGetPPMDocumentsHandler ppm.GetPPMDocumentsHandler + // PpmGetPPMSITEstimatedCostHandler sets the operation handler for the get p p m s i t estimated cost operation + PpmGetPPMSITEstimatedCostHandler ppm.GetPPMSITEstimatedCostHandler + // PwsViolationsGetPWSViolationsHandler sets the operation handler for the get p w s violations operation + PwsViolationsGetPWSViolationsHandler pws_violations.GetPWSViolationsHandler + // ApplicationParametersGetParamHandler sets the operation handler for the get param operation + ApplicationParametersGetParamHandler application_parameters.GetParamHandler + // PaymentRequestsGetPaymentRequestHandler sets the operation handler for the get payment request operation + PaymentRequestsGetPaymentRequestHandler payment_requests.GetPaymentRequestHandler + // PaymentRequestsGetPaymentRequestsForMoveHandler sets the operation handler for the get payment requests for move operation + PaymentRequestsGetPaymentRequestsForMoveHandler payment_requests.GetPaymentRequestsForMoveHandler + // QueuesGetPaymentRequestsQueueHandler sets the operation handler for the get payment requests queue operation + QueuesGetPaymentRequestsQueueHandler queues.GetPaymentRequestsQueueHandler + // ReportViolationsGetReportViolationsByReportIDHandler sets the operation handler for the get report violations by report ID operation + ReportViolationsGetReportViolationsByReportIDHandler report_violations.GetReportViolationsByReportIDHandler + // QueuesGetServicesCounselingOriginListHandler sets the operation handler for the get services counseling origin list operation + QueuesGetServicesCounselingOriginListHandler queues.GetServicesCounselingOriginListHandler + // QueuesGetServicesCounselingQueueHandler sets the operation handler for the get services counseling queue operation + QueuesGetServicesCounselingQueueHandler queues.GetServicesCounselingQueueHandler + // MtoShipmentGetShipmentHandler sets the operation handler for the get shipment operation + MtoShipmentGetShipmentHandler mto_shipment.GetShipmentHandler + // PaymentRequestsGetShipmentsPaymentSITBalanceHandler sets the operation handler for the get shipments payment s i t balance operation + PaymentRequestsGetShipmentsPaymentSITBalanceHandler payment_requests.GetShipmentsPaymentSITBalanceHandler + // TransportationOfficeGetTransportationOfficesHandler sets the operation handler for the get transportation offices operation + TransportationOfficeGetTransportationOfficesHandler transportation_office.GetTransportationOfficesHandler + // TransportationOfficeGetTransportationOfficesGBLOCsHandler sets the operation handler for the get transportation offices g b l o cs operation + TransportationOfficeGetTransportationOfficesGBLOCsHandler transportation_office.GetTransportationOfficesGBLOCsHandler + // TransportationOfficeGetTransportationOfficesOpenHandler sets the operation handler for the get transportation offices open operation + TransportationOfficeGetTransportationOfficesOpenHandler transportation_office.GetTransportationOfficesOpenHandler + // UploadsGetUploadHandler sets the operation handler for the get upload operation + UploadsGetUploadHandler uploads.GetUploadHandler + // CalendarIsDateWeekendHolidayHandler sets the operation handler for the is date weekend holiday operation + CalendarIsDateWeekendHolidayHandler calendar.IsDateWeekendHolidayHandler + // MtoServiceItemListMTOServiceItemsHandler sets the operation handler for the list m t o service items operation + MtoServiceItemListMTOServiceItemsHandler mto_service_item.ListMTOServiceItemsHandler + // MtoShipmentListMTOShipmentsHandler sets the operation handler for the list m t o shipments operation + MtoShipmentListMTOShipmentsHandler mto_shipment.ListMTOShipmentsHandler + // QueuesListPrimeMovesHandler sets the operation handler for the list prime moves operation + QueuesListPrimeMovesHandler queues.ListPrimeMovesHandler + // MoveMoveCancelerHandler sets the operation handler for the move canceler operation + MoveMoveCancelerHandler move.MoveCancelerHandler + // ShipmentRejectShipmentHandler sets the operation handler for the reject shipment operation + ShipmentRejectShipmentHandler shipment.RejectShipmentHandler + // LinesOfAccountingRequestLineOfAccountingHandler sets the operation handler for the request line of accounting operation + LinesOfAccountingRequestLineOfAccountingHandler lines_of_accounting.RequestLineOfAccountingHandler + // ShipmentRequestShipmentCancellationHandler sets the operation handler for the request shipment cancellation operation + ShipmentRequestShipmentCancellationHandler shipment.RequestShipmentCancellationHandler + // ShipmentRequestShipmentDiversionHandler sets the operation handler for the request shipment diversion operation + ShipmentRequestShipmentDiversionHandler shipment.RequestShipmentDiversionHandler + // ShipmentRequestShipmentReweighHandler sets the operation handler for the request shipment reweigh operation + ShipmentRequestShipmentReweighHandler shipment.RequestShipmentReweighHandler + // ShipmentReviewShipmentAddressUpdateHandler sets the operation handler for the review shipment address update operation + ShipmentReviewShipmentAddressUpdateHandler shipment.ReviewShipmentAddressUpdateHandler + // EvaluationReportsSaveEvaluationReportHandler sets the operation handler for the save evaluation report operation + EvaluationReportsSaveEvaluationReportHandler evaluation_reports.SaveEvaluationReportHandler + // CustomerSearchCustomersHandler sets the operation handler for the search customers operation + CustomerSearchCustomersHandler customer.SearchCustomersHandler + // MoveSearchMovesHandler sets the operation handler for the search moves operation + MoveSearchMovesHandler move.SearchMovesHandler + // MoveSetFinancialReviewFlagHandler sets the operation handler for the set financial review flag operation + MoveSetFinancialReviewFlagHandler move.SetFinancialReviewFlagHandler + // PpmShowAOAPacketHandler sets the operation handler for the show a o a packet operation + PpmShowAOAPacketHandler ppm.ShowAOAPacketHandler + // PpmShowPaymentPacketHandler sets the operation handler for the show payment packet operation + PpmShowPaymentPacketHandler ppm.ShowPaymentPacketHandler + // EvaluationReportsSubmitEvaluationReportHandler sets the operation handler for the submit evaluation report operation + EvaluationReportsSubmitEvaluationReportHandler evaluation_reports.SubmitEvaluationReportHandler + // TacTacValidationHandler sets the operation handler for the tac validation operation + TacTacValidationHandler tac.TacValidationHandler + // OrderUpdateAllowanceHandler sets the operation handler for the update allowance operation + OrderUpdateAllowanceHandler order.UpdateAllowanceHandler + // MoveUpdateAssignedOfficeUserHandler sets the operation handler for the update assigned office user operation + MoveUpdateAssignedOfficeUserHandler move.UpdateAssignedOfficeUserHandler + // OrderUpdateBillableWeightHandler sets the operation handler for the update billable weight operation + OrderUpdateBillableWeightHandler order.UpdateBillableWeightHandler + // MoveUpdateCloseoutOfficeHandler sets the operation handler for the update closeout office operation + MoveUpdateCloseoutOfficeHandler move.UpdateCloseoutOfficeHandler + // CustomerUpdateCustomerHandler sets the operation handler for the update customer operation + CustomerUpdateCustomerHandler customer.UpdateCustomerHandler + // CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler sets the operation handler for the update customer support remark for move operation + CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandler + // MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler sets the operation handler for the update m t o reviewed billable weights at operation + MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler move_task_order.UpdateMTOReviewedBillableWeightsAtHandler + // MtoServiceItemUpdateMTOServiceItemStatusHandler sets the operation handler for the update m t o service item status operation + MtoServiceItemUpdateMTOServiceItemStatusHandler mto_service_item.UpdateMTOServiceItemStatusHandler + // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation + MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler + // MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler sets the operation handler for the update m t o status service counseling completed operation + MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler move_task_order.UpdateMTOStatusServiceCounselingCompletedHandler + // OrderUpdateMaxBillableWeightAsTIOHandler sets the operation handler for the update max billable weight as t i o operation + OrderUpdateMaxBillableWeightAsTIOHandler order.UpdateMaxBillableWeightAsTIOHandler + // MoveTaskOrderUpdateMoveTIORemarksHandler sets the operation handler for the update move t i o remarks operation + MoveTaskOrderUpdateMoveTIORemarksHandler move_task_order.UpdateMoveTIORemarksHandler + // MoveTaskOrderUpdateMoveTaskOrderStatusHandler sets the operation handler for the update move task order status operation + MoveTaskOrderUpdateMoveTaskOrderStatusHandler move_task_order.UpdateMoveTaskOrderStatusHandler + // PpmUpdateMovingExpenseHandler sets the operation handler for the update moving expense operation + PpmUpdateMovingExpenseHandler ppm.UpdateMovingExpenseHandler + // OrderUpdateOrderHandler sets the operation handler for the update order operation + OrderUpdateOrderHandler order.UpdateOrderHandler + // PpmUpdatePPMSITHandler sets the operation handler for the update p p m s i t operation + PpmUpdatePPMSITHandler ppm.UpdatePPMSITHandler + // PaymentRequestsUpdatePaymentRequestStatusHandler sets the operation handler for the update payment request status operation + PaymentRequestsUpdatePaymentRequestStatusHandler payment_requests.UpdatePaymentRequestStatusHandler + // PaymentServiceItemUpdatePaymentServiceItemStatusHandler sets the operation handler for the update payment service item status operation + PaymentServiceItemUpdatePaymentServiceItemStatusHandler payment_service_item.UpdatePaymentServiceItemStatusHandler + // PpmUpdateProGearWeightTicketHandler sets the operation handler for the update pro gear weight ticket operation + PpmUpdateProGearWeightTicketHandler ppm.UpdateProGearWeightTicketHandler + // ShipmentUpdateSITServiceItemCustomerExpenseHandler sets the operation handler for the update s i t service item customer expense operation + ShipmentUpdateSITServiceItemCustomerExpenseHandler shipment.UpdateSITServiceItemCustomerExpenseHandler + // MtoServiceItemUpdateServiceItemSitEntryDateHandler sets the operation handler for the update service item sit entry date operation + MtoServiceItemUpdateServiceItemSitEntryDateHandler mto_service_item.UpdateServiceItemSitEntryDateHandler + // UploadsUpdateUploadHandler sets the operation handler for the update upload operation + UploadsUpdateUploadHandler uploads.UpdateUploadHandler + // PpmUpdateWeightTicketHandler sets the operation handler for the update weight ticket operation + PpmUpdateWeightTicketHandler ppm.UpdateWeightTicketHandler + // MoveUploadAdditionalDocumentsHandler sets the operation handler for the upload additional documents operation + MoveUploadAdditionalDocumentsHandler move.UploadAdditionalDocumentsHandler + // OrderUploadAmendedOrdersHandler sets the operation handler for the upload amended orders operation + OrderUploadAmendedOrdersHandler order.UploadAmendedOrdersHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + if o.MultipartformConsumer == nil { + unregistered = append(unregistered, "MultipartformConsumer") + } + + if o.BinProducer == nil { + unregistered = append(unregistered, "BinProducer") + } + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.OrderAcknowledgeExcessWeightRiskHandler == nil { + unregistered = append(unregistered, "order.AcknowledgeExcessWeightRiskHandler") + } + if o.EvaluationReportsAddAppealToSeriousIncidentHandler == nil { + unregistered = append(unregistered, "evaluation_reports.AddAppealToSeriousIncidentHandler") + } + if o.EvaluationReportsAddAppealToViolationHandler == nil { + unregistered = append(unregistered, "evaluation_reports.AddAppealToViolationHandler") + } + if o.ShipmentApproveSITExtensionHandler == nil { + unregistered = append(unregistered, "shipment.ApproveSITExtensionHandler") + } + if o.ShipmentApproveShipmentHandler == nil { + unregistered = append(unregistered, "shipment.ApproveShipmentHandler") + } + if o.ShipmentApproveShipmentDiversionHandler == nil { + unregistered = append(unregistered, "shipment.ApproveShipmentDiversionHandler") + } + if o.ReportViolationsAssociateReportViolationsHandler == nil { + unregistered = append(unregistered, "report_violations.AssociateReportViolationsHandler") + } + if o.PaymentRequestsBulkDownloadHandler == nil { + unregistered = append(unregistered, "payment_requests.BulkDownloadHandler") + } + if o.MoveCheckForLockedMovesAndUnlockHandler == nil { + unregistered = append(unregistered, "move.CheckForLockedMovesAndUnlockHandler") + } + if o.OrderCounselingUpdateAllowanceHandler == nil { + unregistered = append(unregistered, "order.CounselingUpdateAllowanceHandler") + } + if o.OrderCounselingUpdateOrderHandler == nil { + unregistered = append(unregistered, "order.CounselingUpdateOrderHandler") + } + if o.ShipmentCreateApprovedSITDurationUpdateHandler == nil { + unregistered = append(unregistered, "shipment.CreateApprovedSITDurationUpdateHandler") + } + if o.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler == nil { + unregistered = append(unregistered, "customer_support_remarks.CreateCustomerSupportRemarkForMoveHandler") + } + if o.CustomerCreateCustomerWithOktaOptionHandler == nil { + unregistered = append(unregistered, "customer.CreateCustomerWithOktaOptionHandler") + } + if o.GhcDocumentsCreateDocumentHandler == nil { + unregistered = append(unregistered, "ghc_documents.CreateDocumentHandler") + } + if o.EvaluationReportsCreateEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.CreateEvaluationReportHandler") + } + if o.MtoShipmentCreateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") + } + if o.OrderCreateOrderHandler == nil { + unregistered = append(unregistered, "order.CreateOrderHandler") + } + if o.OfficeUsersCreateRequestedOfficeUserHandler == nil { + unregistered = append(unregistered, "office_users.CreateRequestedOfficeUserHandler") + } + if o.UploadsCreateUploadHandler == nil { + unregistered = append(unregistered, "uploads.CreateUploadHandler") + } + if o.MoveDeleteAssignedOfficeUserHandler == nil { + unregistered = append(unregistered, "move.DeleteAssignedOfficeUserHandler") + } + if o.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler == nil { + unregistered = append(unregistered, "customer_support_remarks.DeleteCustomerSupportRemarkHandler") + } + if o.EvaluationReportsDeleteEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.DeleteEvaluationReportHandler") + } + if o.ShipmentDeleteShipmentHandler == nil { + unregistered = append(unregistered, "shipment.DeleteShipmentHandler") + } + if o.UploadsDeleteUploadHandler == nil { + unregistered = append(unregistered, "uploads.DeleteUploadHandler") + } + if o.ShipmentDenySITExtensionHandler == nil { + unregistered = append(unregistered, "shipment.DenySITExtensionHandler") + } + if o.EvaluationReportsDownloadEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.DownloadEvaluationReportHandler") + } + if o.MtoAgentFetchMTOAgentListHandler == nil { + unregistered = append(unregistered, "mto_agent.FetchMTOAgentListHandler") + } + if o.PpmFinishDocumentReviewHandler == nil { + unregistered = append(unregistered, "ppm.FinishDocumentReviewHandler") + } + if o.ReServiceItemsGetAllReServiceItemsHandler == nil { + unregistered = append(unregistered, "re_service_items.GetAllReServiceItemsHandler") + } + if o.QueuesGetBulkAssignmentDataHandler == nil { + unregistered = append(unregistered, "queues.GetBulkAssignmentDataHandler") + } + if o.CustomerGetCustomerHandler == nil { + unregistered = append(unregistered, "customer.GetCustomerHandler") + } + if o.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler == nil { + unregistered = append(unregistered, "customer_support_remarks.GetCustomerSupportRemarksForMoveHandler") + } + if o.GhcDocumentsGetDocumentHandler == nil { + unregistered = append(unregistered, "ghc_documents.GetDocumentHandler") + } + if o.MoveTaskOrderGetEntitlementsHandler == nil { + unregistered = append(unregistered, "move_task_order.GetEntitlementsHandler") + } + if o.EvaluationReportsGetEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.GetEvaluationReportHandler") + } + if o.AddressesGetLocationByZipCityStateHandler == nil { + unregistered = append(unregistered, "addresses.GetLocationByZipCityStateHandler") + } + if o.MtoServiceItemGetMTOServiceItemHandler == nil { + unregistered = append(unregistered, "mto_service_item.GetMTOServiceItemHandler") + } + if o.MoveGetMoveHandler == nil { + unregistered = append(unregistered, "move.GetMoveHandler") + } + if o.MoveGetMoveCounselingEvaluationReportsListHandler == nil { + unregistered = append(unregistered, "move.GetMoveCounselingEvaluationReportsListHandler") + } + if o.MoveGetMoveHistoryHandler == nil { + unregistered = append(unregistered, "move.GetMoveHistoryHandler") + } + if o.MoveGetMoveShipmentEvaluationReportsListHandler == nil { + unregistered = append(unregistered, "move.GetMoveShipmentEvaluationReportsListHandler") + } + if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") + } + if o.QueuesGetMovesQueueHandler == nil { + unregistered = append(unregistered, "queues.GetMovesQueueHandler") + } + if o.OrderGetOrderHandler == nil { + unregistered = append(unregistered, "order.GetOrderHandler") + } + if o.PpmGetPPMActualWeightHandler == nil { + unregistered = append(unregistered, "ppm.GetPPMActualWeightHandler") + } + if o.PpmGetPPMCloseoutHandler == nil { + unregistered = append(unregistered, "ppm.GetPPMCloseoutHandler") + } + if o.PpmGetPPMDocumentsHandler == nil { + unregistered = append(unregistered, "ppm.GetPPMDocumentsHandler") + } + if o.PpmGetPPMSITEstimatedCostHandler == nil { + unregistered = append(unregistered, "ppm.GetPPMSITEstimatedCostHandler") + } + if o.PwsViolationsGetPWSViolationsHandler == nil { + unregistered = append(unregistered, "pws_violations.GetPWSViolationsHandler") + } + if o.ApplicationParametersGetParamHandler == nil { + unregistered = append(unregistered, "application_parameters.GetParamHandler") + } + if o.PaymentRequestsGetPaymentRequestHandler == nil { + unregistered = append(unregistered, "payment_requests.GetPaymentRequestHandler") + } + if o.PaymentRequestsGetPaymentRequestsForMoveHandler == nil { + unregistered = append(unregistered, "payment_requests.GetPaymentRequestsForMoveHandler") + } + if o.QueuesGetPaymentRequestsQueueHandler == nil { + unregistered = append(unregistered, "queues.GetPaymentRequestsQueueHandler") + } + if o.ReportViolationsGetReportViolationsByReportIDHandler == nil { + unregistered = append(unregistered, "report_violations.GetReportViolationsByReportIDHandler") + } + if o.QueuesGetServicesCounselingOriginListHandler == nil { + unregistered = append(unregistered, "queues.GetServicesCounselingOriginListHandler") + } + if o.QueuesGetServicesCounselingQueueHandler == nil { + unregistered = append(unregistered, "queues.GetServicesCounselingQueueHandler") + } + if o.MtoShipmentGetShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.GetShipmentHandler") + } + if o.PaymentRequestsGetShipmentsPaymentSITBalanceHandler == nil { + unregistered = append(unregistered, "payment_requests.GetShipmentsPaymentSITBalanceHandler") + } + if o.TransportationOfficeGetTransportationOfficesHandler == nil { + unregistered = append(unregistered, "transportation_office.GetTransportationOfficesHandler") + } + if o.TransportationOfficeGetTransportationOfficesGBLOCsHandler == nil { + unregistered = append(unregistered, "transportation_office.GetTransportationOfficesGBLOCsHandler") + } + if o.TransportationOfficeGetTransportationOfficesOpenHandler == nil { + unregistered = append(unregistered, "transportation_office.GetTransportationOfficesOpenHandler") + } + if o.UploadsGetUploadHandler == nil { + unregistered = append(unregistered, "uploads.GetUploadHandler") + } + if o.CalendarIsDateWeekendHolidayHandler == nil { + unregistered = append(unregistered, "calendar.IsDateWeekendHolidayHandler") + } + if o.MtoServiceItemListMTOServiceItemsHandler == nil { + unregistered = append(unregistered, "mto_service_item.ListMTOServiceItemsHandler") + } + if o.MtoShipmentListMTOShipmentsHandler == nil { + unregistered = append(unregistered, "mto_shipment.ListMTOShipmentsHandler") + } + if o.QueuesListPrimeMovesHandler == nil { + unregistered = append(unregistered, "queues.ListPrimeMovesHandler") + } + if o.MoveMoveCancelerHandler == nil { + unregistered = append(unregistered, "move.MoveCancelerHandler") + } + if o.ShipmentRejectShipmentHandler == nil { + unregistered = append(unregistered, "shipment.RejectShipmentHandler") + } + if o.LinesOfAccountingRequestLineOfAccountingHandler == nil { + unregistered = append(unregistered, "lines_of_accounting.RequestLineOfAccountingHandler") + } + if o.ShipmentRequestShipmentCancellationHandler == nil { + unregistered = append(unregistered, "shipment.RequestShipmentCancellationHandler") + } + if o.ShipmentRequestShipmentDiversionHandler == nil { + unregistered = append(unregistered, "shipment.RequestShipmentDiversionHandler") + } + if o.ShipmentRequestShipmentReweighHandler == nil { + unregistered = append(unregistered, "shipment.RequestShipmentReweighHandler") + } + if o.ShipmentReviewShipmentAddressUpdateHandler == nil { + unregistered = append(unregistered, "shipment.ReviewShipmentAddressUpdateHandler") + } + if o.EvaluationReportsSaveEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.SaveEvaluationReportHandler") + } + if o.CustomerSearchCustomersHandler == nil { + unregistered = append(unregistered, "customer.SearchCustomersHandler") + } + if o.MoveSearchMovesHandler == nil { + unregistered = append(unregistered, "move.SearchMovesHandler") + } + if o.MoveSetFinancialReviewFlagHandler == nil { + unregistered = append(unregistered, "move.SetFinancialReviewFlagHandler") + } + if o.PpmShowAOAPacketHandler == nil { + unregistered = append(unregistered, "ppm.ShowAOAPacketHandler") + } + if o.PpmShowPaymentPacketHandler == nil { + unregistered = append(unregistered, "ppm.ShowPaymentPacketHandler") + } + if o.EvaluationReportsSubmitEvaluationReportHandler == nil { + unregistered = append(unregistered, "evaluation_reports.SubmitEvaluationReportHandler") + } + if o.TacTacValidationHandler == nil { + unregistered = append(unregistered, "tac.TacValidationHandler") + } + if o.OrderUpdateAllowanceHandler == nil { + unregistered = append(unregistered, "order.UpdateAllowanceHandler") + } + if o.MoveUpdateAssignedOfficeUserHandler == nil { + unregistered = append(unregistered, "move.UpdateAssignedOfficeUserHandler") + } + if o.OrderUpdateBillableWeightHandler == nil { + unregistered = append(unregistered, "order.UpdateBillableWeightHandler") + } + if o.MoveUpdateCloseoutOfficeHandler == nil { + unregistered = append(unregistered, "move.UpdateCloseoutOfficeHandler") + } + if o.CustomerUpdateCustomerHandler == nil { + unregistered = append(unregistered, "customer.UpdateCustomerHandler") + } + if o.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler == nil { + unregistered = append(unregistered, "customer_support_remarks.UpdateCustomerSupportRemarkForMoveHandler") + } + if o.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler == nil { + unregistered = append(unregistered, "move_task_order.UpdateMTOReviewedBillableWeightsAtHandler") + } + if o.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { + unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemStatusHandler") + } + if o.MtoShipmentUpdateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") + } + if o.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler == nil { + unregistered = append(unregistered, "move_task_order.UpdateMTOStatusServiceCounselingCompletedHandler") + } + if o.OrderUpdateMaxBillableWeightAsTIOHandler == nil { + unregistered = append(unregistered, "order.UpdateMaxBillableWeightAsTIOHandler") + } + if o.MoveTaskOrderUpdateMoveTIORemarksHandler == nil { + unregistered = append(unregistered, "move_task_order.UpdateMoveTIORemarksHandler") + } + if o.MoveTaskOrderUpdateMoveTaskOrderStatusHandler == nil { + unregistered = append(unregistered, "move_task_order.UpdateMoveTaskOrderStatusHandler") + } + if o.PpmUpdateMovingExpenseHandler == nil { + unregistered = append(unregistered, "ppm.UpdateMovingExpenseHandler") + } + if o.OrderUpdateOrderHandler == nil { + unregistered = append(unregistered, "order.UpdateOrderHandler") + } + if o.PpmUpdatePPMSITHandler == nil { + unregistered = append(unregistered, "ppm.UpdatePPMSITHandler") + } + if o.PaymentRequestsUpdatePaymentRequestStatusHandler == nil { + unregistered = append(unregistered, "payment_requests.UpdatePaymentRequestStatusHandler") + } + if o.PaymentServiceItemUpdatePaymentServiceItemStatusHandler == nil { + unregistered = append(unregistered, "payment_service_item.UpdatePaymentServiceItemStatusHandler") + } + if o.PpmUpdateProGearWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.UpdateProGearWeightTicketHandler") + } + if o.ShipmentUpdateSITServiceItemCustomerExpenseHandler == nil { + unregistered = append(unregistered, "shipment.UpdateSITServiceItemCustomerExpenseHandler") + } + if o.MtoServiceItemUpdateServiceItemSitEntryDateHandler == nil { + unregistered = append(unregistered, "mto_service_item.UpdateServiceItemSitEntryDateHandler") + } + if o.UploadsUpdateUploadHandler == nil { + unregistered = append(unregistered, "uploads.UpdateUploadHandler") + } + if o.PpmUpdateWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.UpdateWeightTicketHandler") + } + if o.MoveUploadAdditionalDocumentsHandler == nil { + unregistered = append(unregistered, "move.UploadAdditionalDocumentsHandler") + } + if o.OrderUploadAmendedOrdersHandler == nil { + unregistered = append(unregistered, "order.UploadAmendedOrdersHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + case "multipart/form-data": + result["multipart/form-data"] = o.MultipartformConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/pdf": + result["application/pdf"] = o.BinProducer + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/orders/{orderID}/acknowledge-excess-weight-risk"] = order.NewAcknowledgeExcessWeightRisk(o.context, o.OrderAcknowledgeExcessWeightRiskHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/evaluation-reports/{reportID}/appeal/add"] = evaluation_reports.NewAddAppealToSeriousIncident(o.context, o.EvaluationReportsAddAppealToSeriousIncidentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/evaluation-reports/{reportID}/{reportViolationID}/appeal/add"] = evaluation_reports.NewAddAppealToViolation(o.context, o.EvaluationReportsAddAppealToViolationHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve"] = shipment.NewApproveSITExtension(o.context, o.ShipmentApproveSITExtensionHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/approve"] = shipment.NewApproveShipment(o.context, o.ShipmentApproveShipmentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/approve-diversion"] = shipment.NewApproveShipmentDiversion(o.context, o.ShipmentApproveShipmentDiversionHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/report-violations/{reportID}"] = report_violations.NewAssociateReportViolations(o.context, o.ReportViolationsAssociateReportViolationsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-requests/{paymentRequestID}/bulkDownload"] = payment_requests.NewBulkDownload(o.context, o.PaymentRequestsBulkDownloadHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{officeUserID}/CheckForLockedMovesAndUnlock"] = move.NewCheckForLockedMovesAndUnlock(o.context, o.MoveCheckForLockedMovesAndUnlockHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/counseling/orders/{orderID}/allowances"] = order.NewCounselingUpdateAllowance(o.context, o.OrderCounselingUpdateAllowanceHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/counseling/orders/{orderID}"] = order.NewCounselingUpdateOrder(o.context, o.OrderCounselingUpdateOrderHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/sit-extensions"] = shipment.NewCreateApprovedSITDurationUpdate(o.context, o.ShipmentCreateApprovedSITDurationUpdateHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{locator}/customer-support-remarks"] = customer_support_remarks.NewCreateCustomerSupportRemarkForMove(o.context, o.CustomerSupportRemarksCreateCustomerSupportRemarkForMoveHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/customer"] = customer.NewCreateCustomerWithOktaOption(o.context, o.CustomerCreateCustomerWithOktaOptionHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/documents"] = ghc_documents.NewCreateDocument(o.context, o.GhcDocumentsCreateDocumentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{locator}/evaluation-reports"] = evaluation_reports.NewCreateEvaluationReport(o.context, o.EvaluationReportsCreateEvaluationReportHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/orders"] = order.NewCreateOrder(o.context, o.OrderCreateOrderHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/open/requested-office-users"] = office_users.NewCreateRequestedOfficeUser(o.context, o.OfficeUsersCreateRequestedOfficeUserHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/uploads"] = uploads.NewCreateUpload(o.context, o.UploadsCreateUploadHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveID}/unassignOfficeUser"] = move.NewDeleteAssignedOfficeUser(o.context, o.MoveDeleteAssignedOfficeUserHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/customer-support-remarks/{customerSupportRemarkID}"] = customer_support_remarks.NewDeleteCustomerSupportRemark(o.context, o.CustomerSupportRemarksDeleteCustomerSupportRemarkHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewDeleteEvaluationReport(o.context, o.EvaluationReportsDeleteEvaluationReportHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/shipments/{shipmentID}"] = shipment.NewDeleteShipment(o.context, o.ShipmentDeleteShipmentHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/uploads/{uploadID}"] = uploads.NewDeleteUpload(o.context, o.UploadsDeleteUploadHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny"] = shipment.NewDenySITExtension(o.context, o.ShipmentDenySITExtensionHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/evaluation-reports/{reportID}/download"] = evaluation_reports.NewDownloadEvaluationReport(o.context, o.EvaluationReportsDownloadEvaluationReportHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents"] = mto_agent.NewFetchMTOAgentList(o.context, o.MtoAgentFetchMTOAgentListHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/finish-document-review"] = ppm.NewFinishDocumentReview(o.context, o.PpmFinishDocumentReviewHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/re-service-items"] = re_service_items.NewGetAllReServiceItems(o.context, o.ReServiceItemsGetAllReServiceItemsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/bulk-assignment"] = queues.NewGetBulkAssignmentData(o.context, o.QueuesGetBulkAssignmentDataHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/customer/{customerID}"] = customer.NewGetCustomer(o.context, o.CustomerGetCustomerHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{locator}/customer-support-remarks"] = customer_support_remarks.NewGetCustomerSupportRemarksForMove(o.context, o.CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/documents/{documentId}"] = ghc_documents.NewGetDocument(o.context, o.GhcDocumentsGetDocumentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/entitlements"] = move_task_order.NewGetEntitlements(o.context, o.MoveTaskOrderGetEntitlementsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewGetEvaluationReport(o.context, o.EvaluationReportsGetEvaluationReportHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/addresses/zip-city-lookup/{search}"] = addresses.NewGetLocationByZipCityState(o.context, o.AddressesGetLocationByZipCityStateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}"] = mto_service_item.NewGetMTOServiceItem(o.context, o.MtoServiceItemGetMTOServiceItemHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move/{locator}"] = move.NewGetMove(o.context, o.MoveGetMoveHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveID}/counseling-evaluation-reports-list"] = move.NewGetMoveCounselingEvaluationReportsList(o.context, o.MoveGetMoveCounselingEvaluationReportsListHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move/{locator}/history"] = move.NewGetMoveHistory(o.context, o.MoveGetMoveHistoryHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveID}/shipment-evaluation-reports-list"] = move.NewGetMoveShipmentEvaluationReportsList(o.context, o.MoveGetMoveShipmentEvaluationReportsListHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/moves"] = queues.NewGetMovesQueue(o.context, o.QueuesGetMovesQueueHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/orders/{orderID}"] = order.NewGetOrder(o.context, o.OrderGetOrderHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/actual-weight"] = ppm.NewGetPPMActualWeight(o.context, o.PpmGetPPMActualWeightHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/closeout"] = ppm.NewGetPPMCloseout(o.context, o.PpmGetPPMCloseoutHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/shipments/{shipmentID}/ppm-documents"] = ppm.NewGetPPMDocuments(o.context, o.PpmGetPPMDocumentsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost"] = ppm.NewGetPPMSITEstimatedCost(o.context, o.PpmGetPPMSITEstimatedCostHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/pws-violations"] = pws_violations.NewGetPWSViolations(o.context, o.PwsViolationsGetPWSViolationsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/application_parameters/{parameterName}"] = application_parameters.NewGetParam(o.context, o.ApplicationParametersGetParamHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-requests/{paymentRequestID}"] = payment_requests.NewGetPaymentRequest(o.context, o.PaymentRequestsGetPaymentRequestHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{locator}/payment-requests"] = payment_requests.NewGetPaymentRequestsForMove(o.context, o.PaymentRequestsGetPaymentRequestsForMoveHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/payment-requests"] = queues.NewGetPaymentRequestsQueue(o.context, o.QueuesGetPaymentRequestsQueueHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/report-violations/{reportID}"] = report_violations.NewGetReportViolationsByReportID(o.context, o.ReportViolationsGetReportViolationsByReportIDHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/counseling/origin-list"] = queues.NewGetServicesCounselingOriginList(o.context, o.QueuesGetServicesCounselingOriginListHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/counseling"] = queues.NewGetServicesCounselingQueue(o.context, o.QueuesGetServicesCounselingQueueHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/shipments/{shipmentID}"] = mto_shipment.NewGetShipment(o.context, o.MtoShipmentGetShipmentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-requests/{paymentRequestID}/shipments-payment-sit-balance"] = payment_requests.NewGetShipmentsPaymentSITBalance(o.context, o.PaymentRequestsGetShipmentsPaymentSITBalanceHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/transportation-offices"] = transportation_office.NewGetTransportationOffices(o.context, o.TransportationOfficeGetTransportationOfficesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/transportation-offices/gblocs"] = transportation_office.NewGetTransportationOfficesGBLOCs(o.context, o.TransportationOfficeGetTransportationOfficesGBLOCsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/open/transportation-offices"] = transportation_office.NewGetTransportationOfficesOpen(o.context, o.TransportationOfficeGetTransportationOfficesOpenHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/uploads/get"] = uploads.NewGetUpload(o.context, o.UploadsGetUploadHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/calendar/{countryCode}/is-weekend-holiday/{date}"] = calendar.NewIsDateWeekendHoliday(o.context, o.CalendarIsDateWeekendHolidayHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_service_items"] = mto_service_item.NewListMTOServiceItems(o.context, o.MtoServiceItemListMTOServiceItemsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move_task_orders/{moveTaskOrderID}/mto_shipments"] = mto_shipment.NewListMTOShipments(o.context, o.MtoShipmentListMTOShipmentsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/prime-moves"] = queues.NewListPrimeMoves(o.context, o.QueuesListPrimeMovesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveID}/cancel"] = move.NewMoveCanceler(o.context, o.MoveMoveCancelerHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/reject"] = shipment.NewRejectShipment(o.context, o.ShipmentRejectShipmentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/lines-of-accounting"] = lines_of_accounting.NewRequestLineOfAccounting(o.context, o.LinesOfAccountingRequestLineOfAccountingHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/request-cancellation"] = shipment.NewRequestShipmentCancellation(o.context, o.ShipmentRequestShipmentCancellationHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/request-diversion"] = shipment.NewRequestShipmentDiversion(o.context, o.ShipmentRequestShipmentDiversionHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/shipments/{shipmentID}/request-reweigh"] = shipment.NewRequestShipmentReweigh(o.context, o.ShipmentRequestShipmentReweighHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/shipments/{shipmentID}/review-shipment-address-update"] = shipment.NewReviewShipmentAddressUpdate(o.context, o.ShipmentReviewShipmentAddressUpdateHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/evaluation-reports/{reportID}"] = evaluation_reports.NewSaveEvaluationReport(o.context, o.EvaluationReportsSaveEvaluationReportHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/customer/search"] = customer.NewSearchCustomers(o.context, o.CustomerSearchCustomersHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/search"] = move.NewSearchMoves(o.context, o.MoveSearchMovesHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveID}/financial-review-flag"] = move.NewSetFinancialReviewFlag(o.context, o.MoveSetFinancialReviewFlagHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/aoa-packet"] = ppm.NewShowAOAPacket(o.context, o.PpmShowAOAPacketHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/payment-packet"] = ppm.NewShowPaymentPacket(o.context, o.PpmShowPaymentPacketHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/evaluation-reports/{reportID}/submit"] = evaluation_reports.NewSubmitEvaluationReport(o.context, o.EvaluationReportsSubmitEvaluationReportHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/tac/valid"] = tac.NewTacValidation(o.context, o.TacTacValidationHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/orders/{orderID}/allowances"] = order.NewUpdateAllowance(o.context, o.OrderUpdateAllowanceHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveID}/assignOfficeUser"] = move.NewUpdateAssignedOfficeUser(o.context, o.MoveUpdateAssignedOfficeUserHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/orders/{orderID}/update-billable-weight"] = order.NewUpdateBillableWeight(o.context, o.OrderUpdateBillableWeightHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{locator}/closeout-office"] = move.NewUpdateCloseoutOffice(o.context, o.MoveUpdateCloseoutOfficeHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/customer/{customerID}"] = customer.NewUpdateCustomer(o.context, o.CustomerUpdateCustomerHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/customer-support-remarks/{customerSupportRemarkID}"] = customer_support_remarks.NewUpdateCustomerSupportRemarkForMove(o.context, o.CustomerSupportRemarksUpdateCustomerSupportRemarkForMoveHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at"] = move_task_order.NewUpdateMTOReviewedBillableWeightsAt(o.context, o.MoveTaskOrderUpdateMTOReviewedBillableWeightsAtHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status"] = mto_service_item.NewUpdateMTOServiceItemStatus(o.context, o.MtoServiceItemUpdateMTOServiceItemStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed"] = move_task_order.NewUpdateMTOStatusServiceCounselingCompleted(o.context, o.MoveTaskOrderUpdateMTOStatusServiceCounselingCompletedHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/orders/{orderID}/update-max-billable-weight/tio"] = order.NewUpdateMaxBillableWeightAsTIO(o.context, o.OrderUpdateMaxBillableWeightAsTIOHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/tio-remarks"] = move_task_order.NewUpdateMoveTIORemarks(o.context, o.MoveTaskOrderUpdateMoveTIORemarksHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/status"] = move_task_order.NewUpdateMoveTaskOrderStatus(o.context, o.MoveTaskOrderUpdateMoveTaskOrderStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewUpdateMovingExpense(o.context, o.PpmUpdateMovingExpenseHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/orders/{orderID}"] = order.NewUpdateOrder(o.context, o.OrderUpdateOrderHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/ppm-sit"] = ppm.NewUpdatePPMSIT(o.context, o.PpmUpdatePPMSITHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/payment-requests/{paymentRequestID}/status"] = payment_requests.NewUpdatePaymentRequestStatus(o.context, o.PaymentRequestsUpdatePaymentRequestStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status"] = payment_service_item.NewUpdatePaymentServiceItemStatus(o.context, o.PaymentServiceItemUpdatePaymentServiceItemStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewUpdateProGearWeightTicket(o.context, o.PpmUpdateProGearWeightTicketHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense"] = shipment.NewUpdateSITServiceItemCustomerExpense(o.context, o.ShipmentUpdateSITServiceItemCustomerExpenseHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/service-item/{mtoServiceItemID}/entry-date-update"] = mto_service_item.NewUpdateServiceItemSitEntryDate(o.context, o.MtoServiceItemUpdateServiceItemSitEntryDateHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/uploads/{uploadID}/update"] = uploads.NewUpdateUpload(o.context, o.UploadsUpdateUploadHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewUpdateWeightTicket(o.context, o.PpmUpdateWeightTicketHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveID}/uploadAdditionalDocuments"] = move.NewUploadAdditionalDocuments(o.context, o.MoveUploadAdditionalDocumentsHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/orders/{orderID}/upload_amended_orders"] = order.NewUploadAmendedOrders(o.context, o.OrderUploadAmendedOrdersHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go new file mode 100644 index 00000000000..fcbad1a89c6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateRequestedOfficeUserHandlerFunc turns a function with the right signature into a create requested office user handler +type CreateRequestedOfficeUserHandlerFunc func(CreateRequestedOfficeUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateRequestedOfficeUserHandlerFunc) Handle(params CreateRequestedOfficeUserParams) middleware.Responder { + return fn(params) +} + +// CreateRequestedOfficeUserHandler interface for that can handle valid create requested office user params +type CreateRequestedOfficeUserHandler interface { + Handle(CreateRequestedOfficeUserParams) middleware.Responder +} + +// NewCreateRequestedOfficeUser creates a new http.Handler for the create requested office user operation +func NewCreateRequestedOfficeUser(ctx *middleware.Context, handler CreateRequestedOfficeUserHandler) *CreateRequestedOfficeUser { + return &CreateRequestedOfficeUser{Context: ctx, Handler: handler} +} + +/* + CreateRequestedOfficeUser swagger:route POST /open/requested-office-users officeUsers createRequestedOfficeUser + +# Create an Office User + +This endpoint is publicly accessible as it is utilized for individuals who do not have an office account to request the creation of an office account. +Request the creation of an office user. An administrator will need to approve them after creation. Note on requirements: An identification method must be present. The following 2 fields have an "OR" requirement. - edipi - other_unique_id One of these two fields MUST be present to serve as identification for the office user being created. This logic is handled at the application level. +*/ +type CreateRequestedOfficeUser struct { + Context *middleware.Context + Handler CreateRequestedOfficeUserHandler +} + +func (o *CreateRequestedOfficeUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateRequestedOfficeUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go new file mode 100644 index 00000000000..1d85a3c948c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateRequestedOfficeUserParams creates a new CreateRequestedOfficeUserParams object +// +// There are no default values defined in the spec. +func NewCreateRequestedOfficeUserParams() CreateRequestedOfficeUserParams { + + return CreateRequestedOfficeUserParams{} +} + +// CreateRequestedOfficeUserParams contains all the bound params for the create requested office user operation +// typically these are obtained from a http.Request +// +// swagger:parameters createRequestedOfficeUser +type CreateRequestedOfficeUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Office User information + In: body + */ + OfficeUser *ghcmessages.OfficeUserCreate +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateRequestedOfficeUserParams() beforehand. +func (o *CreateRequestedOfficeUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.OfficeUserCreate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("officeUser", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.OfficeUser = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go new file mode 100644 index 00000000000..50780474c47 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_responses.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateRequestedOfficeUserCreatedCode is the HTTP code returned for type CreateRequestedOfficeUserCreated +const CreateRequestedOfficeUserCreatedCode int = 201 + +/* +CreateRequestedOfficeUserCreated successfully requested the creation of provided office user + +swagger:response createRequestedOfficeUserCreated +*/ +type CreateRequestedOfficeUserCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.OfficeUser `json:"body,omitempty"` +} + +// NewCreateRequestedOfficeUserCreated creates CreateRequestedOfficeUserCreated with default headers values +func NewCreateRequestedOfficeUserCreated() *CreateRequestedOfficeUserCreated { + + return &CreateRequestedOfficeUserCreated{} +} + +// WithPayload adds the payload to the create requested office user created response +func (o *CreateRequestedOfficeUserCreated) WithPayload(payload *ghcmessages.OfficeUser) *CreateRequestedOfficeUserCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create requested office user created response +func (o *CreateRequestedOfficeUserCreated) SetPayload(payload *ghcmessages.OfficeUser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateRequestedOfficeUserCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateRequestedOfficeUserUnprocessableEntityCode is the HTTP code returned for type CreateRequestedOfficeUserUnprocessableEntity +const CreateRequestedOfficeUserUnprocessableEntityCode int = 422 + +/* +CreateRequestedOfficeUserUnprocessableEntity validation error + +swagger:response createRequestedOfficeUserUnprocessableEntity +*/ +type CreateRequestedOfficeUserUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateRequestedOfficeUserUnprocessableEntity creates CreateRequestedOfficeUserUnprocessableEntity with default headers values +func NewCreateRequestedOfficeUserUnprocessableEntity() *CreateRequestedOfficeUserUnprocessableEntity { + + return &CreateRequestedOfficeUserUnprocessableEntity{} +} + +// WithPayload adds the payload to the create requested office user unprocessable entity response +func (o *CreateRequestedOfficeUserUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateRequestedOfficeUserUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create requested office user unprocessable entity response +func (o *CreateRequestedOfficeUserUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateRequestedOfficeUserUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateRequestedOfficeUserInternalServerErrorCode is the HTTP code returned for type CreateRequestedOfficeUserInternalServerError +const CreateRequestedOfficeUserInternalServerErrorCode int = 500 + +/* +CreateRequestedOfficeUserInternalServerError internal server error + +swagger:response createRequestedOfficeUserInternalServerError +*/ +type CreateRequestedOfficeUserInternalServerError struct { +} + +// NewCreateRequestedOfficeUserInternalServerError creates CreateRequestedOfficeUserInternalServerError with default headers values +func NewCreateRequestedOfficeUserInternalServerError() *CreateRequestedOfficeUserInternalServerError { + + return &CreateRequestedOfficeUserInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateRequestedOfficeUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go new file mode 100644 index 00000000000..41d03b87326 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/office_users/create_requested_office_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office_users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateRequestedOfficeUserURL generates an URL for the create requested office user operation +type CreateRequestedOfficeUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateRequestedOfficeUserURL) WithBasePath(bp string) *CreateRequestedOfficeUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateRequestedOfficeUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateRequestedOfficeUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/open/requested-office-users" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateRequestedOfficeUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateRequestedOfficeUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateRequestedOfficeUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateRequestedOfficeUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateRequestedOfficeUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateRequestedOfficeUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go new file mode 100644 index 00000000000..4a5775ae93b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// AcknowledgeExcessWeightRiskHandlerFunc turns a function with the right signature into a acknowledge excess weight risk handler +type AcknowledgeExcessWeightRiskHandlerFunc func(AcknowledgeExcessWeightRiskParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn AcknowledgeExcessWeightRiskHandlerFunc) Handle(params AcknowledgeExcessWeightRiskParams) middleware.Responder { + return fn(params) +} + +// AcknowledgeExcessWeightRiskHandler interface for that can handle valid acknowledge excess weight risk params +type AcknowledgeExcessWeightRiskHandler interface { + Handle(AcknowledgeExcessWeightRiskParams) middleware.Responder +} + +// NewAcknowledgeExcessWeightRisk creates a new http.Handler for the acknowledge excess weight risk operation +func NewAcknowledgeExcessWeightRisk(ctx *middleware.Context, handler AcknowledgeExcessWeightRiskHandler) *AcknowledgeExcessWeightRisk { + return &AcknowledgeExcessWeightRisk{Context: ctx, Handler: handler} +} + +/* + AcknowledgeExcessWeightRisk swagger:route POST /orders/{orderID}/acknowledge-excess-weight-risk order acknowledgeExcessWeightRisk + +# Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert + +Saves the date and time a TOO acknowledged the excess weight risk by dismissing the alert +*/ +type AcknowledgeExcessWeightRisk struct { + Context *middleware.Context + Handler AcknowledgeExcessWeightRiskHandler +} + +func (o *AcknowledgeExcessWeightRisk) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewAcknowledgeExcessWeightRiskParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go new file mode 100644 index 00000000000..b0347485f9c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewAcknowledgeExcessWeightRiskParams creates a new AcknowledgeExcessWeightRiskParams object +// +// There are no default values defined in the spec. +func NewAcknowledgeExcessWeightRiskParams() AcknowledgeExcessWeightRiskParams { + + return AcknowledgeExcessWeightRiskParams{} +} + +// AcknowledgeExcessWeightRiskParams contains all the bound params for the acknowledge excess weight risk operation +// typically these are obtained from a http.Request +// +// swagger:parameters acknowledgeExcessWeightRisk +type AcknowledgeExcessWeightRiskParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewAcknowledgeExcessWeightRiskParams() beforehand. +func (o *AcknowledgeExcessWeightRiskParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *AcknowledgeExcessWeightRiskParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *AcknowledgeExcessWeightRiskParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *AcknowledgeExcessWeightRiskParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go new file mode 100644 index 00000000000..9e787116db4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// AcknowledgeExcessWeightRiskOKCode is the HTTP code returned for type AcknowledgeExcessWeightRiskOK +const AcknowledgeExcessWeightRiskOKCode int = 200 + +/* +AcknowledgeExcessWeightRiskOK updated Move + +swagger:response acknowledgeExcessWeightRiskOK +*/ +type AcknowledgeExcessWeightRiskOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Move `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskOK creates AcknowledgeExcessWeightRiskOK with default headers values +func NewAcknowledgeExcessWeightRiskOK() *AcknowledgeExcessWeightRiskOK { + + return &AcknowledgeExcessWeightRiskOK{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk o k response +func (o *AcknowledgeExcessWeightRiskOK) WithPayload(payload *ghcmessages.Move) *AcknowledgeExcessWeightRiskOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk o k response +func (o *AcknowledgeExcessWeightRiskOK) SetPayload(payload *ghcmessages.Move) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AcknowledgeExcessWeightRiskForbiddenCode is the HTTP code returned for type AcknowledgeExcessWeightRiskForbidden +const AcknowledgeExcessWeightRiskForbiddenCode int = 403 + +/* +AcknowledgeExcessWeightRiskForbidden The request was denied + +swagger:response acknowledgeExcessWeightRiskForbidden +*/ +type AcknowledgeExcessWeightRiskForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskForbidden creates AcknowledgeExcessWeightRiskForbidden with default headers values +func NewAcknowledgeExcessWeightRiskForbidden() *AcknowledgeExcessWeightRiskForbidden { + + return &AcknowledgeExcessWeightRiskForbidden{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk forbidden response +func (o *AcknowledgeExcessWeightRiskForbidden) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk forbidden response +func (o *AcknowledgeExcessWeightRiskForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AcknowledgeExcessWeightRiskNotFoundCode is the HTTP code returned for type AcknowledgeExcessWeightRiskNotFound +const AcknowledgeExcessWeightRiskNotFoundCode int = 404 + +/* +AcknowledgeExcessWeightRiskNotFound The requested resource wasn't found + +swagger:response acknowledgeExcessWeightRiskNotFound +*/ +type AcknowledgeExcessWeightRiskNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskNotFound creates AcknowledgeExcessWeightRiskNotFound with default headers values +func NewAcknowledgeExcessWeightRiskNotFound() *AcknowledgeExcessWeightRiskNotFound { + + return &AcknowledgeExcessWeightRiskNotFound{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk not found response +func (o *AcknowledgeExcessWeightRiskNotFound) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk not found response +func (o *AcknowledgeExcessWeightRiskNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AcknowledgeExcessWeightRiskPreconditionFailedCode is the HTTP code returned for type AcknowledgeExcessWeightRiskPreconditionFailed +const AcknowledgeExcessWeightRiskPreconditionFailedCode int = 412 + +/* +AcknowledgeExcessWeightRiskPreconditionFailed Precondition failed + +swagger:response acknowledgeExcessWeightRiskPreconditionFailed +*/ +type AcknowledgeExcessWeightRiskPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskPreconditionFailed creates AcknowledgeExcessWeightRiskPreconditionFailed with default headers values +func NewAcknowledgeExcessWeightRiskPreconditionFailed() *AcknowledgeExcessWeightRiskPreconditionFailed { + + return &AcknowledgeExcessWeightRiskPreconditionFailed{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk precondition failed response +func (o *AcknowledgeExcessWeightRiskPreconditionFailed) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk precondition failed response +func (o *AcknowledgeExcessWeightRiskPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AcknowledgeExcessWeightRiskUnprocessableEntityCode is the HTTP code returned for type AcknowledgeExcessWeightRiskUnprocessableEntity +const AcknowledgeExcessWeightRiskUnprocessableEntityCode int = 422 + +/* +AcknowledgeExcessWeightRiskUnprocessableEntity The payload was unprocessable. + +swagger:response acknowledgeExcessWeightRiskUnprocessableEntity +*/ +type AcknowledgeExcessWeightRiskUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskUnprocessableEntity creates AcknowledgeExcessWeightRiskUnprocessableEntity with default headers values +func NewAcknowledgeExcessWeightRiskUnprocessableEntity() *AcknowledgeExcessWeightRiskUnprocessableEntity { + + return &AcknowledgeExcessWeightRiskUnprocessableEntity{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk unprocessable entity response +func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AcknowledgeExcessWeightRiskUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk unprocessable entity response +func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AcknowledgeExcessWeightRiskInternalServerErrorCode is the HTTP code returned for type AcknowledgeExcessWeightRiskInternalServerError +const AcknowledgeExcessWeightRiskInternalServerErrorCode int = 500 + +/* +AcknowledgeExcessWeightRiskInternalServerError A server error occurred + +swagger:response acknowledgeExcessWeightRiskInternalServerError +*/ +type AcknowledgeExcessWeightRiskInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAcknowledgeExcessWeightRiskInternalServerError creates AcknowledgeExcessWeightRiskInternalServerError with default headers values +func NewAcknowledgeExcessWeightRiskInternalServerError() *AcknowledgeExcessWeightRiskInternalServerError { + + return &AcknowledgeExcessWeightRiskInternalServerError{} +} + +// WithPayload adds the payload to the acknowledge excess weight risk internal server error response +func (o *AcknowledgeExcessWeightRiskInternalServerError) WithPayload(payload *ghcmessages.Error) *AcknowledgeExcessWeightRiskInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the acknowledge excess weight risk internal server error response +func (o *AcknowledgeExcessWeightRiskInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AcknowledgeExcessWeightRiskInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go new file mode 100644 index 00000000000..47c48a63470 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/acknowledge_excess_weight_risk_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// AcknowledgeExcessWeightRiskURL generates an URL for the acknowledge excess weight risk operation +type AcknowledgeExcessWeightRiskURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AcknowledgeExcessWeightRiskURL) WithBasePath(bp string) *AcknowledgeExcessWeightRiskURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AcknowledgeExcessWeightRiskURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *AcknowledgeExcessWeightRiskURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}/acknowledge-excess-weight-risk" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on AcknowledgeExcessWeightRiskURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *AcknowledgeExcessWeightRiskURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *AcknowledgeExcessWeightRiskURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *AcknowledgeExcessWeightRiskURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on AcknowledgeExcessWeightRiskURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on AcknowledgeExcessWeightRiskURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *AcknowledgeExcessWeightRiskURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go new file mode 100644 index 00000000000..3738597821c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CounselingUpdateAllowanceHandlerFunc turns a function with the right signature into a counseling update allowance handler +type CounselingUpdateAllowanceHandlerFunc func(CounselingUpdateAllowanceParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CounselingUpdateAllowanceHandlerFunc) Handle(params CounselingUpdateAllowanceParams) middleware.Responder { + return fn(params) +} + +// CounselingUpdateAllowanceHandler interface for that can handle valid counseling update allowance params +type CounselingUpdateAllowanceHandler interface { + Handle(CounselingUpdateAllowanceParams) middleware.Responder +} + +// NewCounselingUpdateAllowance creates a new http.Handler for the counseling update allowance operation +func NewCounselingUpdateAllowance(ctx *middleware.Context, handler CounselingUpdateAllowanceHandler) *CounselingUpdateAllowance { + return &CounselingUpdateAllowance{Context: ctx, Handler: handler} +} + +/* + CounselingUpdateAllowance swagger:route PATCH /counseling/orders/{orderID}/allowances order counselingUpdateAllowance + +Updates an allowance (Orders with Entitlements) + +All fields sent in this request will be set on the order referenced +*/ +type CounselingUpdateAllowance struct { + Context *middleware.Context + Handler CounselingUpdateAllowanceHandler +} + +func (o *CounselingUpdateAllowance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCounselingUpdateAllowanceParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go new file mode 100644 index 00000000000..da064dcb3cd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCounselingUpdateAllowanceParams creates a new CounselingUpdateAllowanceParams object +// +// There are no default values defined in the spec. +func NewCounselingUpdateAllowanceParams() CounselingUpdateAllowanceParams { + + return CounselingUpdateAllowanceParams{} +} + +// CounselingUpdateAllowanceParams contains all the bound params for the counseling update allowance operation +// typically these are obtained from a http.Request +// +// swagger:parameters counselingUpdateAllowance +type CounselingUpdateAllowanceParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.CounselingUpdateAllowancePayload + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCounselingUpdateAllowanceParams() beforehand. +func (o *CounselingUpdateAllowanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CounselingUpdateAllowancePayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *CounselingUpdateAllowanceParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *CounselingUpdateAllowanceParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *CounselingUpdateAllowanceParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go new file mode 100644 index 00000000000..3e81047d27f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CounselingUpdateAllowanceOKCode is the HTTP code returned for type CounselingUpdateAllowanceOK +const CounselingUpdateAllowanceOKCode int = 200 + +/* +CounselingUpdateAllowanceOK updated instance of allowance + +swagger:response counselingUpdateAllowanceOK +*/ +type CounselingUpdateAllowanceOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowanceOK creates CounselingUpdateAllowanceOK with default headers values +func NewCounselingUpdateAllowanceOK() *CounselingUpdateAllowanceOK { + + return &CounselingUpdateAllowanceOK{} +} + +// WithPayload adds the payload to the counseling update allowance o k response +func (o *CounselingUpdateAllowanceOK) WithPayload(payload *ghcmessages.Order) *CounselingUpdateAllowanceOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance o k response +func (o *CounselingUpdateAllowanceOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateAllowanceForbiddenCode is the HTTP code returned for type CounselingUpdateAllowanceForbidden +const CounselingUpdateAllowanceForbiddenCode int = 403 + +/* +CounselingUpdateAllowanceForbidden The request was denied + +swagger:response counselingUpdateAllowanceForbidden +*/ +type CounselingUpdateAllowanceForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowanceForbidden creates CounselingUpdateAllowanceForbidden with default headers values +func NewCounselingUpdateAllowanceForbidden() *CounselingUpdateAllowanceForbidden { + + return &CounselingUpdateAllowanceForbidden{} +} + +// WithPayload adds the payload to the counseling update allowance forbidden response +func (o *CounselingUpdateAllowanceForbidden) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance forbidden response +func (o *CounselingUpdateAllowanceForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateAllowanceNotFoundCode is the HTTP code returned for type CounselingUpdateAllowanceNotFound +const CounselingUpdateAllowanceNotFoundCode int = 404 + +/* +CounselingUpdateAllowanceNotFound The requested resource wasn't found + +swagger:response counselingUpdateAllowanceNotFound +*/ +type CounselingUpdateAllowanceNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowanceNotFound creates CounselingUpdateAllowanceNotFound with default headers values +func NewCounselingUpdateAllowanceNotFound() *CounselingUpdateAllowanceNotFound { + + return &CounselingUpdateAllowanceNotFound{} +} + +// WithPayload adds the payload to the counseling update allowance not found response +func (o *CounselingUpdateAllowanceNotFound) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance not found response +func (o *CounselingUpdateAllowanceNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateAllowancePreconditionFailedCode is the HTTP code returned for type CounselingUpdateAllowancePreconditionFailed +const CounselingUpdateAllowancePreconditionFailedCode int = 412 + +/* +CounselingUpdateAllowancePreconditionFailed Precondition failed + +swagger:response counselingUpdateAllowancePreconditionFailed +*/ +type CounselingUpdateAllowancePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowancePreconditionFailed creates CounselingUpdateAllowancePreconditionFailed with default headers values +func NewCounselingUpdateAllowancePreconditionFailed() *CounselingUpdateAllowancePreconditionFailed { + + return &CounselingUpdateAllowancePreconditionFailed{} +} + +// WithPayload adds the payload to the counseling update allowance precondition failed response +func (o *CounselingUpdateAllowancePreconditionFailed) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowancePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance precondition failed response +func (o *CounselingUpdateAllowancePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowancePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateAllowanceUnprocessableEntityCode is the HTTP code returned for type CounselingUpdateAllowanceUnprocessableEntity +const CounselingUpdateAllowanceUnprocessableEntityCode int = 422 + +/* +CounselingUpdateAllowanceUnprocessableEntity The payload was unprocessable. + +swagger:response counselingUpdateAllowanceUnprocessableEntity +*/ +type CounselingUpdateAllowanceUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowanceUnprocessableEntity creates CounselingUpdateAllowanceUnprocessableEntity with default headers values +func NewCounselingUpdateAllowanceUnprocessableEntity() *CounselingUpdateAllowanceUnprocessableEntity { + + return &CounselingUpdateAllowanceUnprocessableEntity{} +} + +// WithPayload adds the payload to the counseling update allowance unprocessable entity response +func (o *CounselingUpdateAllowanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CounselingUpdateAllowanceUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance unprocessable entity response +func (o *CounselingUpdateAllowanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateAllowanceInternalServerErrorCode is the HTTP code returned for type CounselingUpdateAllowanceInternalServerError +const CounselingUpdateAllowanceInternalServerErrorCode int = 500 + +/* +CounselingUpdateAllowanceInternalServerError A server error occurred + +swagger:response counselingUpdateAllowanceInternalServerError +*/ +type CounselingUpdateAllowanceInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateAllowanceInternalServerError creates CounselingUpdateAllowanceInternalServerError with default headers values +func NewCounselingUpdateAllowanceInternalServerError() *CounselingUpdateAllowanceInternalServerError { + + return &CounselingUpdateAllowanceInternalServerError{} +} + +// WithPayload adds the payload to the counseling update allowance internal server error response +func (o *CounselingUpdateAllowanceInternalServerError) WithPayload(payload *ghcmessages.Error) *CounselingUpdateAllowanceInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update allowance internal server error response +func (o *CounselingUpdateAllowanceInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateAllowanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go new file mode 100644 index 00000000000..ee72f481d97 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_allowance_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CounselingUpdateAllowanceURL generates an URL for the counseling update allowance operation +type CounselingUpdateAllowanceURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CounselingUpdateAllowanceURL) WithBasePath(bp string) *CounselingUpdateAllowanceURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CounselingUpdateAllowanceURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CounselingUpdateAllowanceURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/counseling/orders/{orderID}/allowances" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on CounselingUpdateAllowanceURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CounselingUpdateAllowanceURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CounselingUpdateAllowanceURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CounselingUpdateAllowanceURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CounselingUpdateAllowanceURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CounselingUpdateAllowanceURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CounselingUpdateAllowanceURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go new file mode 100644 index 00000000000..87f469da7e7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CounselingUpdateOrderHandlerFunc turns a function with the right signature into a counseling update order handler +type CounselingUpdateOrderHandlerFunc func(CounselingUpdateOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CounselingUpdateOrderHandlerFunc) Handle(params CounselingUpdateOrderParams) middleware.Responder { + return fn(params) +} + +// CounselingUpdateOrderHandler interface for that can handle valid counseling update order params +type CounselingUpdateOrderHandler interface { + Handle(CounselingUpdateOrderParams) middleware.Responder +} + +// NewCounselingUpdateOrder creates a new http.Handler for the counseling update order operation +func NewCounselingUpdateOrder(ctx *middleware.Context, handler CounselingUpdateOrderHandler) *CounselingUpdateOrder { + return &CounselingUpdateOrder{Context: ctx, Handler: handler} +} + +/* + CounselingUpdateOrder swagger:route PATCH /counseling/orders/{orderID} order counselingUpdateOrder + +Updates an order (performed by a services counselor) + +All fields sent in this request will be set on the order referenced +*/ +type CounselingUpdateOrder struct { + Context *middleware.Context + Handler CounselingUpdateOrderHandler +} + +func (o *CounselingUpdateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCounselingUpdateOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go new file mode 100644 index 00000000000..e713fd23542 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCounselingUpdateOrderParams creates a new CounselingUpdateOrderParams object +// +// There are no default values defined in the spec. +func NewCounselingUpdateOrderParams() CounselingUpdateOrderParams { + + return CounselingUpdateOrderParams{} +} + +// CounselingUpdateOrderParams contains all the bound params for the counseling update order operation +// typically these are obtained from a http.Request +// +// swagger:parameters counselingUpdateOrder +type CounselingUpdateOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.CounselingUpdateOrderPayload + /*ID of order to update + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCounselingUpdateOrderParams() beforehand. +func (o *CounselingUpdateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CounselingUpdateOrderPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *CounselingUpdateOrderParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *CounselingUpdateOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *CounselingUpdateOrderParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go new file mode 100644 index 00000000000..6eabb9a0581 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CounselingUpdateOrderOKCode is the HTTP code returned for type CounselingUpdateOrderOK +const CounselingUpdateOrderOKCode int = 200 + +/* +CounselingUpdateOrderOK updated instance of orders + +swagger:response counselingUpdateOrderOK +*/ +type CounselingUpdateOrderOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderOK creates CounselingUpdateOrderOK with default headers values +func NewCounselingUpdateOrderOK() *CounselingUpdateOrderOK { + + return &CounselingUpdateOrderOK{} +} + +// WithPayload adds the payload to the counseling update order o k response +func (o *CounselingUpdateOrderOK) WithPayload(payload *ghcmessages.Order) *CounselingUpdateOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order o k response +func (o *CounselingUpdateOrderOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateOrderForbiddenCode is the HTTP code returned for type CounselingUpdateOrderForbidden +const CounselingUpdateOrderForbiddenCode int = 403 + +/* +CounselingUpdateOrderForbidden The request was denied + +swagger:response counselingUpdateOrderForbidden +*/ +type CounselingUpdateOrderForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderForbidden creates CounselingUpdateOrderForbidden with default headers values +func NewCounselingUpdateOrderForbidden() *CounselingUpdateOrderForbidden { + + return &CounselingUpdateOrderForbidden{} +} + +// WithPayload adds the payload to the counseling update order forbidden response +func (o *CounselingUpdateOrderForbidden) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order forbidden response +func (o *CounselingUpdateOrderForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateOrderNotFoundCode is the HTTP code returned for type CounselingUpdateOrderNotFound +const CounselingUpdateOrderNotFoundCode int = 404 + +/* +CounselingUpdateOrderNotFound The requested resource wasn't found + +swagger:response counselingUpdateOrderNotFound +*/ +type CounselingUpdateOrderNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderNotFound creates CounselingUpdateOrderNotFound with default headers values +func NewCounselingUpdateOrderNotFound() *CounselingUpdateOrderNotFound { + + return &CounselingUpdateOrderNotFound{} +} + +// WithPayload adds the payload to the counseling update order not found response +func (o *CounselingUpdateOrderNotFound) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order not found response +func (o *CounselingUpdateOrderNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateOrderPreconditionFailedCode is the HTTP code returned for type CounselingUpdateOrderPreconditionFailed +const CounselingUpdateOrderPreconditionFailedCode int = 412 + +/* +CounselingUpdateOrderPreconditionFailed Precondition failed + +swagger:response counselingUpdateOrderPreconditionFailed +*/ +type CounselingUpdateOrderPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderPreconditionFailed creates CounselingUpdateOrderPreconditionFailed with default headers values +func NewCounselingUpdateOrderPreconditionFailed() *CounselingUpdateOrderPreconditionFailed { + + return &CounselingUpdateOrderPreconditionFailed{} +} + +// WithPayload adds the payload to the counseling update order precondition failed response +func (o *CounselingUpdateOrderPreconditionFailed) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order precondition failed response +func (o *CounselingUpdateOrderPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateOrderUnprocessableEntityCode is the HTTP code returned for type CounselingUpdateOrderUnprocessableEntity +const CounselingUpdateOrderUnprocessableEntityCode int = 422 + +/* +CounselingUpdateOrderUnprocessableEntity The payload was unprocessable. + +swagger:response counselingUpdateOrderUnprocessableEntity +*/ +type CounselingUpdateOrderUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderUnprocessableEntity creates CounselingUpdateOrderUnprocessableEntity with default headers values +func NewCounselingUpdateOrderUnprocessableEntity() *CounselingUpdateOrderUnprocessableEntity { + + return &CounselingUpdateOrderUnprocessableEntity{} +} + +// WithPayload adds the payload to the counseling update order unprocessable entity response +func (o *CounselingUpdateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CounselingUpdateOrderUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order unprocessable entity response +func (o *CounselingUpdateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CounselingUpdateOrderInternalServerErrorCode is the HTTP code returned for type CounselingUpdateOrderInternalServerError +const CounselingUpdateOrderInternalServerErrorCode int = 500 + +/* +CounselingUpdateOrderInternalServerError A server error occurred + +swagger:response counselingUpdateOrderInternalServerError +*/ +type CounselingUpdateOrderInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCounselingUpdateOrderInternalServerError creates CounselingUpdateOrderInternalServerError with default headers values +func NewCounselingUpdateOrderInternalServerError() *CounselingUpdateOrderInternalServerError { + + return &CounselingUpdateOrderInternalServerError{} +} + +// WithPayload adds the payload to the counseling update order internal server error response +func (o *CounselingUpdateOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *CounselingUpdateOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the counseling update order internal server error response +func (o *CounselingUpdateOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CounselingUpdateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go new file mode 100644 index 00000000000..5835a42eeaf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/counseling_update_order_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CounselingUpdateOrderURL generates an URL for the counseling update order operation +type CounselingUpdateOrderURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CounselingUpdateOrderURL) WithBasePath(bp string) *CounselingUpdateOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CounselingUpdateOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CounselingUpdateOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/counseling/orders/{orderID}" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on CounselingUpdateOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CounselingUpdateOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CounselingUpdateOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CounselingUpdateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CounselingUpdateOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CounselingUpdateOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CounselingUpdateOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order.go b/pkg/gen/ghcapi/ghcoperations/order/create_order.go new file mode 100644 index 00000000000..7dbf9d65331 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/create_order.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateOrderHandlerFunc turns a function with the right signature into a create order handler +type CreateOrderHandlerFunc func(CreateOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateOrderHandlerFunc) Handle(params CreateOrderParams) middleware.Responder { + return fn(params) +} + +// CreateOrderHandler interface for that can handle valid create order params +type CreateOrderHandler interface { + Handle(CreateOrderParams) middleware.Responder +} + +// NewCreateOrder creates a new http.Handler for the create order operation +func NewCreateOrder(ctx *middleware.Context, handler CreateOrderHandler) *CreateOrder { + return &CreateOrder{Context: ctx, Handler: handler} +} + +/* + CreateOrder swagger:route POST /orders order createOrder + +# Creates an orders model for a logged-in user + +Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move +*/ +type CreateOrder struct { + Context *middleware.Context + Handler CreateOrderHandler +} + +func (o *CreateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go new file mode 100644 index 00000000000..769a4dda61a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/create_order_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateOrderParams creates a new CreateOrderParams object +// +// There are no default values defined in the spec. +func NewCreateOrderParams() CreateOrderParams { + + return CreateOrderParams{} +} + +// CreateOrderParams contains all the bound params for the create order operation +// typically these are obtained from a http.Request +// +// swagger:parameters createOrder +type CreateOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + CreateOrders *ghcmessages.CreateOrders +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateOrderParams() beforehand. +func (o *CreateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateOrders + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("createOrders", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateOrders = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go new file mode 100644 index 00000000000..eeeab3fb41c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/create_order_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateOrderOKCode is the HTTP code returned for type CreateOrderOK +const CreateOrderOKCode int = 200 + +/* +CreateOrderOK created instance of orders + +swagger:response createOrderOK +*/ +type CreateOrderOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewCreateOrderOK creates CreateOrderOK with default headers values +func NewCreateOrderOK() *CreateOrderOK { + + return &CreateOrderOK{} +} + +// WithPayload adds the payload to the create order o k response +func (o *CreateOrderOK) WithPayload(payload *ghcmessages.Order) *CreateOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create order o k response +func (o *CreateOrderOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateOrderBadRequestCode is the HTTP code returned for type CreateOrderBadRequest +const CreateOrderBadRequestCode int = 400 + +/* +CreateOrderBadRequest invalid request + +swagger:response createOrderBadRequest +*/ +type CreateOrderBadRequest struct { +} + +// NewCreateOrderBadRequest creates CreateOrderBadRequest with default headers values +func NewCreateOrderBadRequest() *CreateOrderBadRequest { + + return &CreateOrderBadRequest{} +} + +// WriteResponse to the client +func (o *CreateOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateOrderUnauthorizedCode is the HTTP code returned for type CreateOrderUnauthorized +const CreateOrderUnauthorizedCode int = 401 + +/* +CreateOrderUnauthorized request requires user authentication + +swagger:response createOrderUnauthorized +*/ +type CreateOrderUnauthorized struct { +} + +// NewCreateOrderUnauthorized creates CreateOrderUnauthorized with default headers values +func NewCreateOrderUnauthorized() *CreateOrderUnauthorized { + + return &CreateOrderUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateOrderForbiddenCode is the HTTP code returned for type CreateOrderForbidden +const CreateOrderForbiddenCode int = 403 + +/* +CreateOrderForbidden user is not authorized + +swagger:response createOrderForbidden +*/ +type CreateOrderForbidden struct { +} + +// NewCreateOrderForbidden creates CreateOrderForbidden with default headers values +func NewCreateOrderForbidden() *CreateOrderForbidden { + + return &CreateOrderForbidden{} +} + +// WriteResponse to the client +func (o *CreateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateOrderUnprocessableEntityCode is the HTTP code returned for type CreateOrderUnprocessableEntity +const CreateOrderUnprocessableEntityCode int = 422 + +/* +CreateOrderUnprocessableEntity The payload was unprocessable. + +swagger:response createOrderUnprocessableEntity +*/ +type CreateOrderUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateOrderUnprocessableEntity creates CreateOrderUnprocessableEntity with default headers values +func NewCreateOrderUnprocessableEntity() *CreateOrderUnprocessableEntity { + + return &CreateOrderUnprocessableEntity{} +} + +// WithPayload adds the payload to the create order unprocessable entity response +func (o *CreateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateOrderUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create order unprocessable entity response +func (o *CreateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateOrderInternalServerErrorCode is the HTTP code returned for type CreateOrderInternalServerError +const CreateOrderInternalServerErrorCode int = 500 + +/* +CreateOrderInternalServerError internal server error + +swagger:response createOrderInternalServerError +*/ +type CreateOrderInternalServerError struct { +} + +// NewCreateOrderInternalServerError creates CreateOrderInternalServerError with default headers values +func NewCreateOrderInternalServerError() *CreateOrderInternalServerError { + + return &CreateOrderInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go new file mode 100644 index 00000000000..948a452892b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/create_order_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateOrderURL generates an URL for the create order operation +type CreateOrderURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOrderURL) WithBasePath(bp string) *CreateOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order.go b/pkg/gen/ghcapi/ghcoperations/order/get_order.go new file mode 100644 index 00000000000..4dc9b7361b7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/get_order.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetOrderHandlerFunc turns a function with the right signature into a get order handler +type GetOrderHandlerFunc func(GetOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetOrderHandlerFunc) Handle(params GetOrderParams) middleware.Responder { + return fn(params) +} + +// GetOrderHandler interface for that can handle valid get order params +type GetOrderHandler interface { + Handle(GetOrderParams) middleware.Responder +} + +// NewGetOrder creates a new http.Handler for the get order operation +func NewGetOrder(ctx *middleware.Context, handler GetOrderHandler) *GetOrder { + return &GetOrder{Context: ctx, Handler: handler} +} + +/* + GetOrder swagger:route GET /orders/{orderID} order getOrder + +# Gets an order by ID + +Gets an order +*/ +type GetOrder struct { + Context *middleware.Context + Handler GetOrderHandler +} + +func (o *GetOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go new file mode 100644 index 00000000000..a37d96bd6d5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/get_order_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetOrderParams creates a new GetOrderParams object +// +// There are no default values defined in the spec. +func NewGetOrderParams() GetOrderParams { + + return GetOrderParams{} +} + +// GetOrderParams contains all the bound params for the get order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getOrder +type GetOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetOrderParams() beforehand. +func (o *GetOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *GetOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *GetOrderParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go new file mode 100644 index 00000000000..4a4963f7d20 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/get_order_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetOrderOKCode is the HTTP code returned for type GetOrderOK +const GetOrderOKCode int = 200 + +/* +GetOrderOK Successfully retrieved order + +swagger:response getOrderOK +*/ +type GetOrderOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewGetOrderOK creates GetOrderOK with default headers values +func NewGetOrderOK() *GetOrderOK { + + return &GetOrderOK{} +} + +// WithPayload adds the payload to the get order o k response +func (o *GetOrderOK) WithPayload(payload *ghcmessages.Order) *GetOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order o k response +func (o *GetOrderOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOrderBadRequestCode is the HTTP code returned for type GetOrderBadRequest +const GetOrderBadRequestCode int = 400 + +/* +GetOrderBadRequest The request payload is invalid + +swagger:response getOrderBadRequest +*/ +type GetOrderBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetOrderBadRequest creates GetOrderBadRequest with default headers values +func NewGetOrderBadRequest() *GetOrderBadRequest { + + return &GetOrderBadRequest{} +} + +// WithPayload adds the payload to the get order bad request response +func (o *GetOrderBadRequest) WithPayload(payload *ghcmessages.Error) *GetOrderBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order bad request response +func (o *GetOrderBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOrderUnauthorizedCode is the HTTP code returned for type GetOrderUnauthorized +const GetOrderUnauthorizedCode int = 401 + +/* +GetOrderUnauthorized The request was denied + +swagger:response getOrderUnauthorized +*/ +type GetOrderUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetOrderUnauthorized creates GetOrderUnauthorized with default headers values +func NewGetOrderUnauthorized() *GetOrderUnauthorized { + + return &GetOrderUnauthorized{} +} + +// WithPayload adds the payload to the get order unauthorized response +func (o *GetOrderUnauthorized) WithPayload(payload *ghcmessages.Error) *GetOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order unauthorized response +func (o *GetOrderUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOrderForbiddenCode is the HTTP code returned for type GetOrderForbidden +const GetOrderForbiddenCode int = 403 + +/* +GetOrderForbidden The request was denied + +swagger:response getOrderForbidden +*/ +type GetOrderForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetOrderForbidden creates GetOrderForbidden with default headers values +func NewGetOrderForbidden() *GetOrderForbidden { + + return &GetOrderForbidden{} +} + +// WithPayload adds the payload to the get order forbidden response +func (o *GetOrderForbidden) WithPayload(payload *ghcmessages.Error) *GetOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order forbidden response +func (o *GetOrderForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOrderNotFoundCode is the HTTP code returned for type GetOrderNotFound +const GetOrderNotFoundCode int = 404 + +/* +GetOrderNotFound The requested resource wasn't found + +swagger:response getOrderNotFound +*/ +type GetOrderNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetOrderNotFound creates GetOrderNotFound with default headers values +func NewGetOrderNotFound() *GetOrderNotFound { + + return &GetOrderNotFound{} +} + +// WithPayload adds the payload to the get order not found response +func (o *GetOrderNotFound) WithPayload(payload *ghcmessages.Error) *GetOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order not found response +func (o *GetOrderNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetOrderInternalServerErrorCode is the HTTP code returned for type GetOrderInternalServerError +const GetOrderInternalServerErrorCode int = 500 + +/* +GetOrderInternalServerError A server error occurred + +swagger:response getOrderInternalServerError +*/ +type GetOrderInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetOrderInternalServerError creates GetOrderInternalServerError with default headers values +func NewGetOrderInternalServerError() *GetOrderInternalServerError { + + return &GetOrderInternalServerError{} +} + +// WithPayload adds the payload to the get order internal server error response +func (o *GetOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *GetOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get order internal server error response +func (o *GetOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go new file mode 100644 index 00000000000..177c957da31 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/get_order_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetOrderURL generates an URL for the get order operation +type GetOrderURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOrderURL) WithBasePath(bp string) *GetOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on GetOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go new file mode 100644 index 00000000000..cc058e011e2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_allowance.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateAllowanceHandlerFunc turns a function with the right signature into a update allowance handler +type UpdateAllowanceHandlerFunc func(UpdateAllowanceParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateAllowanceHandlerFunc) Handle(params UpdateAllowanceParams) middleware.Responder { + return fn(params) +} + +// UpdateAllowanceHandler interface for that can handle valid update allowance params +type UpdateAllowanceHandler interface { + Handle(UpdateAllowanceParams) middleware.Responder +} + +// NewUpdateAllowance creates a new http.Handler for the update allowance operation +func NewUpdateAllowance(ctx *middleware.Context, handler UpdateAllowanceHandler) *UpdateAllowance { + return &UpdateAllowance{Context: ctx, Handler: handler} +} + +/* + UpdateAllowance swagger:route PATCH /orders/{orderID}/allowances order updateAllowance + +Updates an allowance (Orders with Entitlements) + +All fields sent in this request will be set on the order referenced +*/ +type UpdateAllowance struct { + Context *middleware.Context + Handler UpdateAllowanceHandler +} + +func (o *UpdateAllowance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateAllowanceParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go new file mode 100644 index 00000000000..9d1a36f9195 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateAllowanceParams creates a new UpdateAllowanceParams object +// +// There are no default values defined in the spec. +func NewUpdateAllowanceParams() UpdateAllowanceParams { + + return UpdateAllowanceParams{} +} + +// UpdateAllowanceParams contains all the bound params for the update allowance operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateAllowance +type UpdateAllowanceParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateAllowancePayload + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateAllowanceParams() beforehand. +func (o *UpdateAllowanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateAllowancePayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateAllowanceParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *UpdateAllowanceParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *UpdateAllowanceParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go new file mode 100644 index 00000000000..119b8685e24 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateAllowanceOKCode is the HTTP code returned for type UpdateAllowanceOK +const UpdateAllowanceOKCode int = 200 + +/* +UpdateAllowanceOK updated instance of allowance + +swagger:response updateAllowanceOK +*/ +type UpdateAllowanceOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewUpdateAllowanceOK creates UpdateAllowanceOK with default headers values +func NewUpdateAllowanceOK() *UpdateAllowanceOK { + + return &UpdateAllowanceOK{} +} + +// WithPayload adds the payload to the update allowance o k response +func (o *UpdateAllowanceOK) WithPayload(payload *ghcmessages.Order) *UpdateAllowanceOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance o k response +func (o *UpdateAllowanceOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAllowanceForbiddenCode is the HTTP code returned for type UpdateAllowanceForbidden +const UpdateAllowanceForbiddenCode int = 403 + +/* +UpdateAllowanceForbidden The request was denied + +swagger:response updateAllowanceForbidden +*/ +type UpdateAllowanceForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAllowanceForbidden creates UpdateAllowanceForbidden with default headers values +func NewUpdateAllowanceForbidden() *UpdateAllowanceForbidden { + + return &UpdateAllowanceForbidden{} +} + +// WithPayload adds the payload to the update allowance forbidden response +func (o *UpdateAllowanceForbidden) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance forbidden response +func (o *UpdateAllowanceForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAllowanceNotFoundCode is the HTTP code returned for type UpdateAllowanceNotFound +const UpdateAllowanceNotFoundCode int = 404 + +/* +UpdateAllowanceNotFound The requested resource wasn't found + +swagger:response updateAllowanceNotFound +*/ +type UpdateAllowanceNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAllowanceNotFound creates UpdateAllowanceNotFound with default headers values +func NewUpdateAllowanceNotFound() *UpdateAllowanceNotFound { + + return &UpdateAllowanceNotFound{} +} + +// WithPayload adds the payload to the update allowance not found response +func (o *UpdateAllowanceNotFound) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance not found response +func (o *UpdateAllowanceNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAllowancePreconditionFailedCode is the HTTP code returned for type UpdateAllowancePreconditionFailed +const UpdateAllowancePreconditionFailedCode int = 412 + +/* +UpdateAllowancePreconditionFailed Precondition failed + +swagger:response updateAllowancePreconditionFailed +*/ +type UpdateAllowancePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAllowancePreconditionFailed creates UpdateAllowancePreconditionFailed with default headers values +func NewUpdateAllowancePreconditionFailed() *UpdateAllowancePreconditionFailed { + + return &UpdateAllowancePreconditionFailed{} +} + +// WithPayload adds the payload to the update allowance precondition failed response +func (o *UpdateAllowancePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateAllowancePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance precondition failed response +func (o *UpdateAllowancePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowancePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAllowanceUnprocessableEntityCode is the HTTP code returned for type UpdateAllowanceUnprocessableEntity +const UpdateAllowanceUnprocessableEntityCode int = 422 + +/* +UpdateAllowanceUnprocessableEntity The payload was unprocessable. + +swagger:response updateAllowanceUnprocessableEntity +*/ +type UpdateAllowanceUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateAllowanceUnprocessableEntity creates UpdateAllowanceUnprocessableEntity with default headers values +func NewUpdateAllowanceUnprocessableEntity() *UpdateAllowanceUnprocessableEntity { + + return &UpdateAllowanceUnprocessableEntity{} +} + +// WithPayload adds the payload to the update allowance unprocessable entity response +func (o *UpdateAllowanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateAllowanceUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance unprocessable entity response +func (o *UpdateAllowanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateAllowanceInternalServerErrorCode is the HTTP code returned for type UpdateAllowanceInternalServerError +const UpdateAllowanceInternalServerErrorCode int = 500 + +/* +UpdateAllowanceInternalServerError A server error occurred + +swagger:response updateAllowanceInternalServerError +*/ +type UpdateAllowanceInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateAllowanceInternalServerError creates UpdateAllowanceInternalServerError with default headers values +func NewUpdateAllowanceInternalServerError() *UpdateAllowanceInternalServerError { + + return &UpdateAllowanceInternalServerError{} +} + +// WithPayload adds the payload to the update allowance internal server error response +func (o *UpdateAllowanceInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateAllowanceInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update allowance internal server error response +func (o *UpdateAllowanceInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateAllowanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go new file mode 100644 index 00000000000..d1f41da8358 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_allowance_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateAllowanceURL generates an URL for the update allowance operation +type UpdateAllowanceURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAllowanceURL) WithBasePath(bp string) *UpdateAllowanceURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateAllowanceURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateAllowanceURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}/allowances" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on UpdateAllowanceURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateAllowanceURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateAllowanceURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateAllowanceURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateAllowanceURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateAllowanceURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateAllowanceURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go new file mode 100644 index 00000000000..4d09b1a2372 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateBillableWeightHandlerFunc turns a function with the right signature into a update billable weight handler +type UpdateBillableWeightHandlerFunc func(UpdateBillableWeightParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateBillableWeightHandlerFunc) Handle(params UpdateBillableWeightParams) middleware.Responder { + return fn(params) +} + +// UpdateBillableWeightHandler interface for that can handle valid update billable weight params +type UpdateBillableWeightHandler interface { + Handle(UpdateBillableWeightParams) middleware.Responder +} + +// NewUpdateBillableWeight creates a new http.Handler for the update billable weight operation +func NewUpdateBillableWeight(ctx *middleware.Context, handler UpdateBillableWeightHandler) *UpdateBillableWeight { + return &UpdateBillableWeight{Context: ctx, Handler: handler} +} + +/* + UpdateBillableWeight swagger:route PATCH /orders/{orderID}/update-billable-weight order updateBillableWeight + +# Updates the max billable weight + +Updates the DBAuthorizedWeight attribute for the Order Entitlements= +*/ +type UpdateBillableWeight struct { + Context *middleware.Context + Handler UpdateBillableWeightHandler +} + +func (o *UpdateBillableWeight) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateBillableWeightParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go new file mode 100644 index 00000000000..796a273c846 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateBillableWeightParams creates a new UpdateBillableWeightParams object +// +// There are no default values defined in the spec. +func NewUpdateBillableWeightParams() UpdateBillableWeightParams { + + return UpdateBillableWeightParams{} +} + +// UpdateBillableWeightParams contains all the bound params for the update billable weight operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateBillableWeight +type UpdateBillableWeightParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateBillableWeightPayload + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateBillableWeightParams() beforehand. +func (o *UpdateBillableWeightParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateBillableWeightPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateBillableWeightParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *UpdateBillableWeightParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *UpdateBillableWeightParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go new file mode 100644 index 00000000000..5725e416a42 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateBillableWeightOKCode is the HTTP code returned for type UpdateBillableWeightOK +const UpdateBillableWeightOKCode int = 200 + +/* +UpdateBillableWeightOK updated Order + +swagger:response updateBillableWeightOK +*/ +type UpdateBillableWeightOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewUpdateBillableWeightOK creates UpdateBillableWeightOK with default headers values +func NewUpdateBillableWeightOK() *UpdateBillableWeightOK { + + return &UpdateBillableWeightOK{} +} + +// WithPayload adds the payload to the update billable weight o k response +func (o *UpdateBillableWeightOK) WithPayload(payload *ghcmessages.Order) *UpdateBillableWeightOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight o k response +func (o *UpdateBillableWeightOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateBillableWeightForbiddenCode is the HTTP code returned for type UpdateBillableWeightForbidden +const UpdateBillableWeightForbiddenCode int = 403 + +/* +UpdateBillableWeightForbidden The request was denied + +swagger:response updateBillableWeightForbidden +*/ +type UpdateBillableWeightForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateBillableWeightForbidden creates UpdateBillableWeightForbidden with default headers values +func NewUpdateBillableWeightForbidden() *UpdateBillableWeightForbidden { + + return &UpdateBillableWeightForbidden{} +} + +// WithPayload adds the payload to the update billable weight forbidden response +func (o *UpdateBillableWeightForbidden) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight forbidden response +func (o *UpdateBillableWeightForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateBillableWeightNotFoundCode is the HTTP code returned for type UpdateBillableWeightNotFound +const UpdateBillableWeightNotFoundCode int = 404 + +/* +UpdateBillableWeightNotFound The requested resource wasn't found + +swagger:response updateBillableWeightNotFound +*/ +type UpdateBillableWeightNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateBillableWeightNotFound creates UpdateBillableWeightNotFound with default headers values +func NewUpdateBillableWeightNotFound() *UpdateBillableWeightNotFound { + + return &UpdateBillableWeightNotFound{} +} + +// WithPayload adds the payload to the update billable weight not found response +func (o *UpdateBillableWeightNotFound) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight not found response +func (o *UpdateBillableWeightNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateBillableWeightPreconditionFailedCode is the HTTP code returned for type UpdateBillableWeightPreconditionFailed +const UpdateBillableWeightPreconditionFailedCode int = 412 + +/* +UpdateBillableWeightPreconditionFailed Precondition failed + +swagger:response updateBillableWeightPreconditionFailed +*/ +type UpdateBillableWeightPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateBillableWeightPreconditionFailed creates UpdateBillableWeightPreconditionFailed with default headers values +func NewUpdateBillableWeightPreconditionFailed() *UpdateBillableWeightPreconditionFailed { + + return &UpdateBillableWeightPreconditionFailed{} +} + +// WithPayload adds the payload to the update billable weight precondition failed response +func (o *UpdateBillableWeightPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight precondition failed response +func (o *UpdateBillableWeightPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateBillableWeightUnprocessableEntityCode is the HTTP code returned for type UpdateBillableWeightUnprocessableEntity +const UpdateBillableWeightUnprocessableEntityCode int = 422 + +/* +UpdateBillableWeightUnprocessableEntity The payload was unprocessable. + +swagger:response updateBillableWeightUnprocessableEntity +*/ +type UpdateBillableWeightUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateBillableWeightUnprocessableEntity creates UpdateBillableWeightUnprocessableEntity with default headers values +func NewUpdateBillableWeightUnprocessableEntity() *UpdateBillableWeightUnprocessableEntity { + + return &UpdateBillableWeightUnprocessableEntity{} +} + +// WithPayload adds the payload to the update billable weight unprocessable entity response +func (o *UpdateBillableWeightUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateBillableWeightUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight unprocessable entity response +func (o *UpdateBillableWeightUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateBillableWeightInternalServerErrorCode is the HTTP code returned for type UpdateBillableWeightInternalServerError +const UpdateBillableWeightInternalServerErrorCode int = 500 + +/* +UpdateBillableWeightInternalServerError A server error occurred + +swagger:response updateBillableWeightInternalServerError +*/ +type UpdateBillableWeightInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateBillableWeightInternalServerError creates UpdateBillableWeightInternalServerError with default headers values +func NewUpdateBillableWeightInternalServerError() *UpdateBillableWeightInternalServerError { + + return &UpdateBillableWeightInternalServerError{} +} + +// WithPayload adds the payload to the update billable weight internal server error response +func (o *UpdateBillableWeightInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateBillableWeightInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update billable weight internal server error response +func (o *UpdateBillableWeightInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateBillableWeightInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go new file mode 100644 index 00000000000..b09e4526219 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_billable_weight_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateBillableWeightURL generates an URL for the update billable weight operation +type UpdateBillableWeightURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateBillableWeightURL) WithBasePath(bp string) *UpdateBillableWeightURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateBillableWeightURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateBillableWeightURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}/update-billable-weight" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on UpdateBillableWeightURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateBillableWeightURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateBillableWeightURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateBillableWeightURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateBillableWeightURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateBillableWeightURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateBillableWeightURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go new file mode 100644 index 00000000000..09c5ab4de0e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMaxBillableWeightAsTIOHandlerFunc turns a function with the right signature into a update max billable weight as t i o handler +type UpdateMaxBillableWeightAsTIOHandlerFunc func(UpdateMaxBillableWeightAsTIOParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMaxBillableWeightAsTIOHandlerFunc) Handle(params UpdateMaxBillableWeightAsTIOParams) middleware.Responder { + return fn(params) +} + +// UpdateMaxBillableWeightAsTIOHandler interface for that can handle valid update max billable weight as t i o params +type UpdateMaxBillableWeightAsTIOHandler interface { + Handle(UpdateMaxBillableWeightAsTIOParams) middleware.Responder +} + +// NewUpdateMaxBillableWeightAsTIO creates a new http.Handler for the update max billable weight as t i o operation +func NewUpdateMaxBillableWeightAsTIO(ctx *middleware.Context, handler UpdateMaxBillableWeightAsTIOHandler) *UpdateMaxBillableWeightAsTIO { + return &UpdateMaxBillableWeightAsTIO{Context: ctx, Handler: handler} +} + +/* + UpdateMaxBillableWeightAsTIO swagger:route PATCH /orders/{orderID}/update-max-billable-weight/tio order updateMaxBillableWeightAsTIO + +# Updates the max billable weight with TIO remarks + +Updates the DBAuthorizedWeight attribute for the Order Entitlements and move TIO remarks +*/ +type UpdateMaxBillableWeightAsTIO struct { + Context *middleware.Context + Handler UpdateMaxBillableWeightAsTIOHandler +} + +func (o *UpdateMaxBillableWeightAsTIO) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMaxBillableWeightAsTIOParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go new file mode 100644 index 00000000000..b9404407abe --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMaxBillableWeightAsTIOParams creates a new UpdateMaxBillableWeightAsTIOParams object +// +// There are no default values defined in the spec. +func NewUpdateMaxBillableWeightAsTIOParams() UpdateMaxBillableWeightAsTIOParams { + + return UpdateMaxBillableWeightAsTIOParams{} +} + +// UpdateMaxBillableWeightAsTIOParams contains all the bound params for the update max billable weight as t i o operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMaxBillableWeightAsTIO +type UpdateMaxBillableWeightAsTIOParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateMaxBillableWeightAsTIOPayload + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMaxBillableWeightAsTIOParams() beforehand. +func (o *UpdateMaxBillableWeightAsTIOParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateMaxBillableWeightAsTIOPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMaxBillableWeightAsTIOParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *UpdateMaxBillableWeightAsTIOParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *UpdateMaxBillableWeightAsTIOParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go new file mode 100644 index 00000000000..f0a5b9655f7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMaxBillableWeightAsTIOOKCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOOK +const UpdateMaxBillableWeightAsTIOOKCode int = 200 + +/* +UpdateMaxBillableWeightAsTIOOK updated Order + +swagger:response updateMaxBillableWeightAsTIOOK +*/ +type UpdateMaxBillableWeightAsTIOOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIOOK creates UpdateMaxBillableWeightAsTIOOK with default headers values +func NewUpdateMaxBillableWeightAsTIOOK() *UpdateMaxBillableWeightAsTIOOK { + + return &UpdateMaxBillableWeightAsTIOOK{} +} + +// WithPayload adds the payload to the update max billable weight as t i o o k response +func (o *UpdateMaxBillableWeightAsTIOOK) WithPayload(payload *ghcmessages.Order) *UpdateMaxBillableWeightAsTIOOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o o k response +func (o *UpdateMaxBillableWeightAsTIOOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIOOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMaxBillableWeightAsTIOForbiddenCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOForbidden +const UpdateMaxBillableWeightAsTIOForbiddenCode int = 403 + +/* +UpdateMaxBillableWeightAsTIOForbidden The request was denied + +swagger:response updateMaxBillableWeightAsTIOForbidden +*/ +type UpdateMaxBillableWeightAsTIOForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIOForbidden creates UpdateMaxBillableWeightAsTIOForbidden with default headers values +func NewUpdateMaxBillableWeightAsTIOForbidden() *UpdateMaxBillableWeightAsTIOForbidden { + + return &UpdateMaxBillableWeightAsTIOForbidden{} +} + +// WithPayload adds the payload to the update max billable weight as t i o forbidden response +func (o *UpdateMaxBillableWeightAsTIOForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o forbidden response +func (o *UpdateMaxBillableWeightAsTIOForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIOForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMaxBillableWeightAsTIONotFoundCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIONotFound +const UpdateMaxBillableWeightAsTIONotFoundCode int = 404 + +/* +UpdateMaxBillableWeightAsTIONotFound The requested resource wasn't found + +swagger:response updateMaxBillableWeightAsTIONotFound +*/ +type UpdateMaxBillableWeightAsTIONotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIONotFound creates UpdateMaxBillableWeightAsTIONotFound with default headers values +func NewUpdateMaxBillableWeightAsTIONotFound() *UpdateMaxBillableWeightAsTIONotFound { + + return &UpdateMaxBillableWeightAsTIONotFound{} +} + +// WithPayload adds the payload to the update max billable weight as t i o not found response +func (o *UpdateMaxBillableWeightAsTIONotFound) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIONotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o not found response +func (o *UpdateMaxBillableWeightAsTIONotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIONotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMaxBillableWeightAsTIOPreconditionFailedCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOPreconditionFailed +const UpdateMaxBillableWeightAsTIOPreconditionFailedCode int = 412 + +/* +UpdateMaxBillableWeightAsTIOPreconditionFailed Precondition failed + +swagger:response updateMaxBillableWeightAsTIOPreconditionFailed +*/ +type UpdateMaxBillableWeightAsTIOPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIOPreconditionFailed creates UpdateMaxBillableWeightAsTIOPreconditionFailed with default headers values +func NewUpdateMaxBillableWeightAsTIOPreconditionFailed() *UpdateMaxBillableWeightAsTIOPreconditionFailed { + + return &UpdateMaxBillableWeightAsTIOPreconditionFailed{} +} + +// WithPayload adds the payload to the update max billable weight as t i o precondition failed response +func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o precondition failed response +func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIOPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMaxBillableWeightAsTIOUnprocessableEntityCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOUnprocessableEntity +const UpdateMaxBillableWeightAsTIOUnprocessableEntityCode int = 422 + +/* +UpdateMaxBillableWeightAsTIOUnprocessableEntity The payload was unprocessable. + +swagger:response updateMaxBillableWeightAsTIOUnprocessableEntity +*/ +type UpdateMaxBillableWeightAsTIOUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIOUnprocessableEntity creates UpdateMaxBillableWeightAsTIOUnprocessableEntity with default headers values +func NewUpdateMaxBillableWeightAsTIOUnprocessableEntity() *UpdateMaxBillableWeightAsTIOUnprocessableEntity { + + return &UpdateMaxBillableWeightAsTIOUnprocessableEntity{} +} + +// WithPayload adds the payload to the update max billable weight as t i o unprocessable entity response +func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMaxBillableWeightAsTIOUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o unprocessable entity response +func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIOUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMaxBillableWeightAsTIOInternalServerErrorCode is the HTTP code returned for type UpdateMaxBillableWeightAsTIOInternalServerError +const UpdateMaxBillableWeightAsTIOInternalServerErrorCode int = 500 + +/* +UpdateMaxBillableWeightAsTIOInternalServerError A server error occurred + +swagger:response updateMaxBillableWeightAsTIOInternalServerError +*/ +type UpdateMaxBillableWeightAsTIOInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMaxBillableWeightAsTIOInternalServerError creates UpdateMaxBillableWeightAsTIOInternalServerError with default headers values +func NewUpdateMaxBillableWeightAsTIOInternalServerError() *UpdateMaxBillableWeightAsTIOInternalServerError { + + return &UpdateMaxBillableWeightAsTIOInternalServerError{} +} + +// WithPayload adds the payload to the update max billable weight as t i o internal server error response +func (o *UpdateMaxBillableWeightAsTIOInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMaxBillableWeightAsTIOInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update max billable weight as t i o internal server error response +func (o *UpdateMaxBillableWeightAsTIOInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMaxBillableWeightAsTIOInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go new file mode 100644 index 00000000000..3f310e176fb --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_max_billable_weight_as_t_i_o_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMaxBillableWeightAsTIOURL generates an URL for the update max billable weight as t i o operation +type UpdateMaxBillableWeightAsTIOURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMaxBillableWeightAsTIOURL) WithBasePath(bp string) *UpdateMaxBillableWeightAsTIOURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMaxBillableWeightAsTIOURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMaxBillableWeightAsTIOURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}/update-max-billable-weight/tio" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on UpdateMaxBillableWeightAsTIOURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMaxBillableWeightAsTIOURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMaxBillableWeightAsTIOURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMaxBillableWeightAsTIOURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMaxBillableWeightAsTIOURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMaxBillableWeightAsTIOURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMaxBillableWeightAsTIOURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order.go b/pkg/gen/ghcapi/ghcoperations/order/update_order.go new file mode 100644 index 00000000000..5f1b2051b2a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_order.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateOrderHandlerFunc turns a function with the right signature into a update order handler +type UpdateOrderHandlerFunc func(UpdateOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateOrderHandlerFunc) Handle(params UpdateOrderParams) middleware.Responder { + return fn(params) +} + +// UpdateOrderHandler interface for that can handle valid update order params +type UpdateOrderHandler interface { + Handle(UpdateOrderParams) middleware.Responder +} + +// NewUpdateOrder creates a new http.Handler for the update order operation +func NewUpdateOrder(ctx *middleware.Context, handler UpdateOrderHandler) *UpdateOrder { + return &UpdateOrder{Context: ctx, Handler: handler} +} + +/* + UpdateOrder swagger:route PATCH /orders/{orderID} order updateOrder + +# Updates an order + +All fields sent in this request will be set on the order referenced +*/ +type UpdateOrder struct { + Context *middleware.Context + Handler UpdateOrderHandler +} + +func (o *UpdateOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go new file mode 100644 index 00000000000..acec9c7fb56 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_order_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateOrderParams creates a new UpdateOrderParams object +// +// There are no default values defined in the spec. +func NewUpdateOrderParams() UpdateOrderParams { + + return UpdateOrderParams{} +} + +// UpdateOrderParams contains all the bound params for the update order operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateOrder +type UpdateOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateOrderPayload + /*ID of order to use + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateOrderParams() beforehand. +func (o *UpdateOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateOrderPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateOrderParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *UpdateOrderParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *UpdateOrderParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go new file mode 100644 index 00000000000..62a3e7c7441 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_order_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateOrderOKCode is the HTTP code returned for type UpdateOrderOK +const UpdateOrderOKCode int = 200 + +/* +UpdateOrderOK updated instance of orders + +swagger:response updateOrderOK +*/ +type UpdateOrderOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Order `json:"body,omitempty"` +} + +// NewUpdateOrderOK creates UpdateOrderOK with default headers values +func NewUpdateOrderOK() *UpdateOrderOK { + + return &UpdateOrderOK{} +} + +// WithPayload adds the payload to the update order o k response +func (o *UpdateOrderOK) WithPayload(payload *ghcmessages.Order) *UpdateOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order o k response +func (o *UpdateOrderOK) SetPayload(payload *ghcmessages.Order) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderBadRequestCode is the HTTP code returned for type UpdateOrderBadRequest +const UpdateOrderBadRequestCode int = 400 + +/* +UpdateOrderBadRequest The request payload is invalid + +swagger:response updateOrderBadRequest +*/ +type UpdateOrderBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderBadRequest creates UpdateOrderBadRequest with default headers values +func NewUpdateOrderBadRequest() *UpdateOrderBadRequest { + + return &UpdateOrderBadRequest{} +} + +// WithPayload adds the payload to the update order bad request response +func (o *UpdateOrderBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateOrderBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order bad request response +func (o *UpdateOrderBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderForbiddenCode is the HTTP code returned for type UpdateOrderForbidden +const UpdateOrderForbiddenCode int = 403 + +/* +UpdateOrderForbidden The request was denied + +swagger:response updateOrderForbidden +*/ +type UpdateOrderForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderForbidden creates UpdateOrderForbidden with default headers values +func NewUpdateOrderForbidden() *UpdateOrderForbidden { + + return &UpdateOrderForbidden{} +} + +// WithPayload adds the payload to the update order forbidden response +func (o *UpdateOrderForbidden) WithPayload(payload *ghcmessages.Error) *UpdateOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order forbidden response +func (o *UpdateOrderForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderNotFoundCode is the HTTP code returned for type UpdateOrderNotFound +const UpdateOrderNotFoundCode int = 404 + +/* +UpdateOrderNotFound The requested resource wasn't found + +swagger:response updateOrderNotFound +*/ +type UpdateOrderNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderNotFound creates UpdateOrderNotFound with default headers values +func NewUpdateOrderNotFound() *UpdateOrderNotFound { + + return &UpdateOrderNotFound{} +} + +// WithPayload adds the payload to the update order not found response +func (o *UpdateOrderNotFound) WithPayload(payload *ghcmessages.Error) *UpdateOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order not found response +func (o *UpdateOrderNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderConflictCode is the HTTP code returned for type UpdateOrderConflict +const UpdateOrderConflictCode int = 409 + +/* +UpdateOrderConflict Conflict error + +swagger:response updateOrderConflict +*/ +type UpdateOrderConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderConflict creates UpdateOrderConflict with default headers values +func NewUpdateOrderConflict() *UpdateOrderConflict { + + return &UpdateOrderConflict{} +} + +// WithPayload adds the payload to the update order conflict response +func (o *UpdateOrderConflict) WithPayload(payload *ghcmessages.Error) *UpdateOrderConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order conflict response +func (o *UpdateOrderConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderPreconditionFailedCode is the HTTP code returned for type UpdateOrderPreconditionFailed +const UpdateOrderPreconditionFailedCode int = 412 + +/* +UpdateOrderPreconditionFailed Precondition failed + +swagger:response updateOrderPreconditionFailed +*/ +type UpdateOrderPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderPreconditionFailed creates UpdateOrderPreconditionFailed with default headers values +func NewUpdateOrderPreconditionFailed() *UpdateOrderPreconditionFailed { + + return &UpdateOrderPreconditionFailed{} +} + +// WithPayload adds the payload to the update order precondition failed response +func (o *UpdateOrderPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateOrderPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order precondition failed response +func (o *UpdateOrderPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderUnprocessableEntityCode is the HTTP code returned for type UpdateOrderUnprocessableEntity +const UpdateOrderUnprocessableEntityCode int = 422 + +/* +UpdateOrderUnprocessableEntity The payload was unprocessable. + +swagger:response updateOrderUnprocessableEntity +*/ +type UpdateOrderUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateOrderUnprocessableEntity creates UpdateOrderUnprocessableEntity with default headers values +func NewUpdateOrderUnprocessableEntity() *UpdateOrderUnprocessableEntity { + + return &UpdateOrderUnprocessableEntity{} +} + +// WithPayload adds the payload to the update order unprocessable entity response +func (o *UpdateOrderUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateOrderUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order unprocessable entity response +func (o *UpdateOrderUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrderInternalServerErrorCode is the HTTP code returned for type UpdateOrderInternalServerError +const UpdateOrderInternalServerErrorCode int = 500 + +/* +UpdateOrderInternalServerError A server error occurred + +swagger:response updateOrderInternalServerError +*/ +type UpdateOrderInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateOrderInternalServerError creates UpdateOrderInternalServerError with default headers values +func NewUpdateOrderInternalServerError() *UpdateOrderInternalServerError { + + return &UpdateOrderInternalServerError{} +} + +// WithPayload adds the payload to the update order internal server error response +func (o *UpdateOrderInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update order internal server error response +func (o *UpdateOrderInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go new file mode 100644 index 00000000000..397d0bf98a8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/update_order_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateOrderURL generates an URL for the update order operation +type UpdateOrderURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOrderURL) WithBasePath(bp string) *UpdateOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on UpdateOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go new file mode 100644 index 00000000000..240571809c6 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UploadAmendedOrdersHandlerFunc turns a function with the right signature into a upload amended orders handler +type UploadAmendedOrdersHandlerFunc func(UploadAmendedOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UploadAmendedOrdersHandlerFunc) Handle(params UploadAmendedOrdersParams) middleware.Responder { + return fn(params) +} + +// UploadAmendedOrdersHandler interface for that can handle valid upload amended orders params +type UploadAmendedOrdersHandler interface { + Handle(UploadAmendedOrdersParams) middleware.Responder +} + +// NewUploadAmendedOrders creates a new http.Handler for the upload amended orders operation +func NewUploadAmendedOrders(ctx *middleware.Context, handler UploadAmendedOrdersHandler) *UploadAmendedOrders { + return &UploadAmendedOrders{Context: ctx, Handler: handler} +} + +/* + UploadAmendedOrders swagger:route POST /orders/{orderID}/upload_amended_orders order uploadAmendedOrders + +# Create an amended order for a given order + +Create an amended order for a given order +*/ +type UploadAmendedOrders struct { + Context *middleware.Context + Handler UploadAmendedOrdersHandler +} + +func (o *UploadAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUploadAmendedOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go new file mode 100644 index 00000000000..ba7dd983dc5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UploadAmendedOrdersMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var UploadAmendedOrdersMaxParseMemory int64 = 32 << 20 + +// NewUploadAmendedOrdersParams creates a new UploadAmendedOrdersParams object +// +// There are no default values defined in the spec. +func NewUploadAmendedOrdersParams() UploadAmendedOrdersParams { + + return UploadAmendedOrdersParams{} +} + +// UploadAmendedOrdersParams contains all the bound params for the upload amended orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters uploadAmendedOrders +type UploadAmendedOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the order + Required: true + In: path + */ + OrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUploadAmendedOrdersParams() beforehand. +func (o *UploadAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(UploadAmendedOrdersMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rOrderID, rhkOrderID, _ := route.Params.GetOK("orderID") + if err := o.bindOrderID(rOrderID, rhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *UploadAmendedOrdersParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindOrderID binds and validates parameter OrderID from path. +func (o *UploadAmendedOrdersParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "path", "strfmt.UUID", raw) + } + o.OrderID = *(value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *UploadAmendedOrdersParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "path", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go new file mode 100644 index 00000000000..8f5744ed778 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UploadAmendedOrdersCreatedCode is the HTTP code returned for type UploadAmendedOrdersCreated +const UploadAmendedOrdersCreatedCode int = 201 + +/* +UploadAmendedOrdersCreated created upload + +swagger:response uploadAmendedOrdersCreated +*/ +type UploadAmendedOrdersCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.Upload `json:"body,omitempty"` +} + +// NewUploadAmendedOrdersCreated creates UploadAmendedOrdersCreated with default headers values +func NewUploadAmendedOrdersCreated() *UploadAmendedOrdersCreated { + + return &UploadAmendedOrdersCreated{} +} + +// WithPayload adds the payload to the upload amended orders created response +func (o *UploadAmendedOrdersCreated) WithPayload(payload *ghcmessages.Upload) *UploadAmendedOrdersCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload amended orders created response +func (o *UploadAmendedOrdersCreated) SetPayload(payload *ghcmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAmendedOrdersBadRequestCode is the HTTP code returned for type UploadAmendedOrdersBadRequest +const UploadAmendedOrdersBadRequestCode int = 400 + +/* +UploadAmendedOrdersBadRequest invalid request + +swagger:response uploadAmendedOrdersBadRequest +*/ +type UploadAmendedOrdersBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewUploadAmendedOrdersBadRequest creates UploadAmendedOrdersBadRequest with default headers values +func NewUploadAmendedOrdersBadRequest() *UploadAmendedOrdersBadRequest { + + return &UploadAmendedOrdersBadRequest{} +} + +// WithPayload adds the payload to the upload amended orders bad request response +func (o *UploadAmendedOrdersBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *UploadAmendedOrdersBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload amended orders bad request response +func (o *UploadAmendedOrdersBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAmendedOrdersForbiddenCode is the HTTP code returned for type UploadAmendedOrdersForbidden +const UploadAmendedOrdersForbiddenCode int = 403 + +/* +UploadAmendedOrdersForbidden not authorized + +swagger:response uploadAmendedOrdersForbidden +*/ +type UploadAmendedOrdersForbidden struct { +} + +// NewUploadAmendedOrdersForbidden creates UploadAmendedOrdersForbidden with default headers values +func NewUploadAmendedOrdersForbidden() *UploadAmendedOrdersForbidden { + + return &UploadAmendedOrdersForbidden{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UploadAmendedOrdersNotFoundCode is the HTTP code returned for type UploadAmendedOrdersNotFound +const UploadAmendedOrdersNotFoundCode int = 404 + +/* +UploadAmendedOrdersNotFound not found + +swagger:response uploadAmendedOrdersNotFound +*/ +type UploadAmendedOrdersNotFound struct { +} + +// NewUploadAmendedOrdersNotFound creates UploadAmendedOrdersNotFound with default headers values +func NewUploadAmendedOrdersNotFound() *UploadAmendedOrdersNotFound { + + return &UploadAmendedOrdersNotFound{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UploadAmendedOrdersRequestEntityTooLargeCode is the HTTP code returned for type UploadAmendedOrdersRequestEntityTooLarge +const UploadAmendedOrdersRequestEntityTooLargeCode int = 413 + +/* +UploadAmendedOrdersRequestEntityTooLarge payload is too large + +swagger:response uploadAmendedOrdersRequestEntityTooLarge +*/ +type UploadAmendedOrdersRequestEntityTooLarge struct { +} + +// NewUploadAmendedOrdersRequestEntityTooLarge creates UploadAmendedOrdersRequestEntityTooLarge with default headers values +func NewUploadAmendedOrdersRequestEntityTooLarge() *UploadAmendedOrdersRequestEntityTooLarge { + + return &UploadAmendedOrdersRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// UploadAmendedOrdersInternalServerErrorCode is the HTTP code returned for type UploadAmendedOrdersInternalServerError +const UploadAmendedOrdersInternalServerErrorCode int = 500 + +/* +UploadAmendedOrdersInternalServerError server error + +swagger:response uploadAmendedOrdersInternalServerError +*/ +type UploadAmendedOrdersInternalServerError struct { +} + +// NewUploadAmendedOrdersInternalServerError creates UploadAmendedOrdersInternalServerError with default headers values +func NewUploadAmendedOrdersInternalServerError() *UploadAmendedOrdersInternalServerError { + + return &UploadAmendedOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go new file mode 100644 index 00000000000..b529396cb6d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/order/upload_amended_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UploadAmendedOrdersURL generates an URL for the upload amended orders operation +type UploadAmendedOrdersURL struct { + OrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAmendedOrdersURL) WithBasePath(bp string) *UploadAmendedOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAmendedOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UploadAmendedOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{orderID}/upload_amended_orders" + + orderID := o.OrderID.String() + if orderID != "" { + _path = strings.Replace(_path, "{orderID}", orderID, -1) + } else { + return nil, errors.New("orderId is required on UploadAmendedOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UploadAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UploadAmendedOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UploadAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UploadAmendedOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UploadAmendedOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UploadAmendedOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go new file mode 100644 index 00000000000..78f7901ab05 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// BulkDownloadHandlerFunc turns a function with the right signature into a bulk download handler +type BulkDownloadHandlerFunc func(BulkDownloadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn BulkDownloadHandlerFunc) Handle(params BulkDownloadParams) middleware.Responder { + return fn(params) +} + +// BulkDownloadHandler interface for that can handle valid bulk download params +type BulkDownloadHandler interface { + Handle(BulkDownloadParams) middleware.Responder +} + +// NewBulkDownload creates a new http.Handler for the bulk download operation +func NewBulkDownload(ctx *middleware.Context, handler BulkDownloadHandler) *BulkDownload { + return &BulkDownload{Context: ctx, Handler: handler} +} + +/* + BulkDownload swagger:route GET /payment-requests/{paymentRequestID}/bulkDownload paymentRequests bulkDownload + +# Downloads all Payment Request documents as a PDF + +This endpoint downloads all uploaded payment request documentation combined into a single PDF. +*/ +type BulkDownload struct { + Context *middleware.Context + Handler BulkDownloadHandler +} + +func (o *BulkDownload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewBulkDownloadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go new file mode 100644 index 00000000000..ff67f05c88a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewBulkDownloadParams creates a new BulkDownloadParams object +// +// There are no default values defined in the spec. +func NewBulkDownloadParams() BulkDownloadParams { + + return BulkDownloadParams{} +} + +// BulkDownloadParams contains all the bound params for the bulk download operation +// typically these are obtained from a http.Request +// +// swagger:parameters bulkDownload +type BulkDownloadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the id for the payment-request with files to be downloaded + Required: true + In: path + */ + PaymentRequestID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewBulkDownloadParams() beforehand. +func (o *BulkDownloadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *BulkDownloadParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PaymentRequestID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go new file mode 100644 index 00000000000..b00eca8e5c1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_responses.go @@ -0,0 +1,170 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// BulkDownloadOKCode is the HTTP code returned for type BulkDownloadOK +const BulkDownloadOKCode int = 200 + +/* +BulkDownloadOK Payment Request Files PDF + +swagger:response bulkDownloadOK +*/ +type BulkDownloadOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewBulkDownloadOK creates BulkDownloadOK with default headers values +func NewBulkDownloadOK() *BulkDownloadOK { + + return &BulkDownloadOK{} +} + +// WithContentDisposition adds the contentDisposition to the bulk download o k response +func (o *BulkDownloadOK) WithContentDisposition(contentDisposition string) *BulkDownloadOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the bulk download o k response +func (o *BulkDownloadOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the bulk download o k response +func (o *BulkDownloadOK) WithPayload(payload io.ReadCloser) *BulkDownloadOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the bulk download o k response +func (o *BulkDownloadOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *BulkDownloadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// BulkDownloadBadRequestCode is the HTTP code returned for type BulkDownloadBadRequest +const BulkDownloadBadRequestCode int = 400 + +/* +BulkDownloadBadRequest The request payload is invalid + +swagger:response bulkDownloadBadRequest +*/ +type BulkDownloadBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewBulkDownloadBadRequest creates BulkDownloadBadRequest with default headers values +func NewBulkDownloadBadRequest() *BulkDownloadBadRequest { + + return &BulkDownloadBadRequest{} +} + +// WithPayload adds the payload to the bulk download bad request response +func (o *BulkDownloadBadRequest) WithPayload(payload *ghcmessages.Error) *BulkDownloadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the bulk download bad request response +func (o *BulkDownloadBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *BulkDownloadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// BulkDownloadInternalServerErrorCode is the HTTP code returned for type BulkDownloadInternalServerError +const BulkDownloadInternalServerErrorCode int = 500 + +/* +BulkDownloadInternalServerError A server error occurred + +swagger:response bulkDownloadInternalServerError +*/ +type BulkDownloadInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewBulkDownloadInternalServerError creates BulkDownloadInternalServerError with default headers values +func NewBulkDownloadInternalServerError() *BulkDownloadInternalServerError { + + return &BulkDownloadInternalServerError{} +} + +// WithPayload adds the payload to the bulk download internal server error response +func (o *BulkDownloadInternalServerError) WithPayload(payload *ghcmessages.Error) *BulkDownloadInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the bulk download internal server error response +func (o *BulkDownloadInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *BulkDownloadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go new file mode 100644 index 00000000000..7f67d894191 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/bulk_download_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// BulkDownloadURL generates an URL for the bulk download operation +type BulkDownloadURL struct { + PaymentRequestID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *BulkDownloadURL) WithBasePath(bp string) *BulkDownloadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *BulkDownloadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *BulkDownloadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/bulkDownload" + + paymentRequestID := o.PaymentRequestID + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on BulkDownloadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *BulkDownloadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *BulkDownloadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *BulkDownloadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on BulkDownloadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on BulkDownloadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *BulkDownloadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go new file mode 100644 index 00000000000..13b2283d707 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPaymentRequestHandlerFunc turns a function with the right signature into a get payment request handler +type GetPaymentRequestHandlerFunc func(GetPaymentRequestParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPaymentRequestHandlerFunc) Handle(params GetPaymentRequestParams) middleware.Responder { + return fn(params) +} + +// GetPaymentRequestHandler interface for that can handle valid get payment request params +type GetPaymentRequestHandler interface { + Handle(GetPaymentRequestParams) middleware.Responder +} + +// NewGetPaymentRequest creates a new http.Handler for the get payment request operation +func NewGetPaymentRequest(ctx *middleware.Context, handler GetPaymentRequestHandler) *GetPaymentRequest { + return &GetPaymentRequest{Context: ctx, Handler: handler} +} + +/* + GetPaymentRequest swagger:route GET /payment-requests/{paymentRequestID} paymentRequests getPaymentRequest + +# Fetches a payment request by id + +Fetches an instance of a payment request by id +*/ +type GetPaymentRequest struct { + Context *middleware.Context + Handler GetPaymentRequestHandler +} + +func (o *GetPaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPaymentRequestParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go new file mode 100644 index 00000000000..e1cae65b0dd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetPaymentRequestParams creates a new GetPaymentRequestParams object +// +// There are no default values defined in the spec. +func NewGetPaymentRequestParams() GetPaymentRequestParams { + + return GetPaymentRequestParams{} +} + +// GetPaymentRequestParams contains all the bound params for the get payment request operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPaymentRequest +type GetPaymentRequestParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of payment request + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPaymentRequestParams() beforehand. +func (o *GetPaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *GetPaymentRequestParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *GetPaymentRequestParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go new file mode 100644 index 00000000000..d460661337f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPaymentRequestOKCode is the HTTP code returned for type GetPaymentRequestOK +const GetPaymentRequestOKCode int = 200 + +/* +GetPaymentRequestOK fetched instance of payment request + +swagger:response getPaymentRequestOK +*/ +type GetPaymentRequestOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PaymentRequest `json:"body,omitempty"` +} + +// NewGetPaymentRequestOK creates GetPaymentRequestOK with default headers values +func NewGetPaymentRequestOK() *GetPaymentRequestOK { + + return &GetPaymentRequestOK{} +} + +// WithPayload adds the payload to the get payment request o k response +func (o *GetPaymentRequestOK) WithPayload(payload *ghcmessages.PaymentRequest) *GetPaymentRequestOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request o k response +func (o *GetPaymentRequestOK) SetPayload(payload *ghcmessages.PaymentRequest) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestBadRequestCode is the HTTP code returned for type GetPaymentRequestBadRequest +const GetPaymentRequestBadRequestCode int = 400 + +/* +GetPaymentRequestBadRequest The request payload is invalid + +swagger:response getPaymentRequestBadRequest +*/ +type GetPaymentRequestBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestBadRequest creates GetPaymentRequestBadRequest with default headers values +func NewGetPaymentRequestBadRequest() *GetPaymentRequestBadRequest { + + return &GetPaymentRequestBadRequest{} +} + +// WithPayload adds the payload to the get payment request bad request response +func (o *GetPaymentRequestBadRequest) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request bad request response +func (o *GetPaymentRequestBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestUnauthorizedCode is the HTTP code returned for type GetPaymentRequestUnauthorized +const GetPaymentRequestUnauthorizedCode int = 401 + +/* +GetPaymentRequestUnauthorized The request was denied + +swagger:response getPaymentRequestUnauthorized +*/ +type GetPaymentRequestUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestUnauthorized creates GetPaymentRequestUnauthorized with default headers values +func NewGetPaymentRequestUnauthorized() *GetPaymentRequestUnauthorized { + + return &GetPaymentRequestUnauthorized{} +} + +// WithPayload adds the payload to the get payment request unauthorized response +func (o *GetPaymentRequestUnauthorized) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request unauthorized response +func (o *GetPaymentRequestUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestForbiddenCode is the HTTP code returned for type GetPaymentRequestForbidden +const GetPaymentRequestForbiddenCode int = 403 + +/* +GetPaymentRequestForbidden The request was denied + +swagger:response getPaymentRequestForbidden +*/ +type GetPaymentRequestForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestForbidden creates GetPaymentRequestForbidden with default headers values +func NewGetPaymentRequestForbidden() *GetPaymentRequestForbidden { + + return &GetPaymentRequestForbidden{} +} + +// WithPayload adds the payload to the get payment request forbidden response +func (o *GetPaymentRequestForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request forbidden response +func (o *GetPaymentRequestForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestNotFoundCode is the HTTP code returned for type GetPaymentRequestNotFound +const GetPaymentRequestNotFoundCode int = 404 + +/* +GetPaymentRequestNotFound The requested resource wasn't found + +swagger:response getPaymentRequestNotFound +*/ +type GetPaymentRequestNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestNotFound creates GetPaymentRequestNotFound with default headers values +func NewGetPaymentRequestNotFound() *GetPaymentRequestNotFound { + + return &GetPaymentRequestNotFound{} +} + +// WithPayload adds the payload to the get payment request not found response +func (o *GetPaymentRequestNotFound) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request not found response +func (o *GetPaymentRequestNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestInternalServerError +const GetPaymentRequestInternalServerErrorCode int = 500 + +/* +GetPaymentRequestInternalServerError A server error occurred + +swagger:response getPaymentRequestInternalServerError +*/ +type GetPaymentRequestInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestInternalServerError creates GetPaymentRequestInternalServerError with default headers values +func NewGetPaymentRequestInternalServerError() *GetPaymentRequestInternalServerError { + + return &GetPaymentRequestInternalServerError{} +} + +// WithPayload adds the payload to the get payment request internal server error response +func (o *GetPaymentRequestInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request internal server error response +func (o *GetPaymentRequestInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go new file mode 100644 index 00000000000..42f0aa1479b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_request_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetPaymentRequestURL generates an URL for the get payment request operation +type GetPaymentRequestURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestURL) WithBasePath(bp string) *GetPaymentRequestURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPaymentRequestURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on GetPaymentRequestURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPaymentRequestURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPaymentRequestURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPaymentRequestURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPaymentRequestURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPaymentRequestURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go new file mode 100644 index 00000000000..36c3861f70b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPaymentRequestsForMoveHandlerFunc turns a function with the right signature into a get payment requests for move handler +type GetPaymentRequestsForMoveHandlerFunc func(GetPaymentRequestsForMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPaymentRequestsForMoveHandlerFunc) Handle(params GetPaymentRequestsForMoveParams) middleware.Responder { + return fn(params) +} + +// GetPaymentRequestsForMoveHandler interface for that can handle valid get payment requests for move params +type GetPaymentRequestsForMoveHandler interface { + Handle(GetPaymentRequestsForMoveParams) middleware.Responder +} + +// NewGetPaymentRequestsForMove creates a new http.Handler for the get payment requests for move operation +func NewGetPaymentRequestsForMove(ctx *middleware.Context, handler GetPaymentRequestsForMoveHandler) *GetPaymentRequestsForMove { + return &GetPaymentRequestsForMove{Context: ctx, Handler: handler} +} + +/* + GetPaymentRequestsForMove swagger:route GET /moves/{locator}/payment-requests paymentRequests getPaymentRequestsForMove + +Fetches payment requests using the move code (locator). + +Fetches payment requests for a move +*/ +type GetPaymentRequestsForMove struct { + Context *middleware.Context + Handler GetPaymentRequestsForMoveHandler +} + +func (o *GetPaymentRequestsForMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPaymentRequestsForMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go new file mode 100644 index 00000000000..495ed0bf0ab --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetPaymentRequestsForMoveParams creates a new GetPaymentRequestsForMoveParams object +// +// There are no default values defined in the spec. +func NewGetPaymentRequestsForMoveParams() GetPaymentRequestsForMoveParams { + + return GetPaymentRequestsForMoveParams{} +} + +// GetPaymentRequestsForMoveParams contains all the bound params for the get payment requests for move operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPaymentRequestsForMove +type GetPaymentRequestsForMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*move code to identify a move for payment requests + Required: true + In: path + */ + Locator string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPaymentRequestsForMoveParams() beforehand. +func (o *GetPaymentRequestsForMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *GetPaymentRequestsForMoveParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go new file mode 100644 index 00000000000..c1eca8a56a1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPaymentRequestsForMoveOKCode is the HTTP code returned for type GetPaymentRequestsForMoveOK +const GetPaymentRequestsForMoveOKCode int = 200 + +/* +GetPaymentRequestsForMoveOK Successfully retrieved all line items for a move task order + +swagger:response getPaymentRequestsForMoveOK +*/ +type GetPaymentRequestsForMoveOK struct { + + /* + In: Body + */ + Payload ghcmessages.PaymentRequests `json:"body,omitempty"` +} + +// NewGetPaymentRequestsForMoveOK creates GetPaymentRequestsForMoveOK with default headers values +func NewGetPaymentRequestsForMoveOK() *GetPaymentRequestsForMoveOK { + + return &GetPaymentRequestsForMoveOK{} +} + +// WithPayload adds the payload to the get payment requests for move o k response +func (o *GetPaymentRequestsForMoveOK) WithPayload(payload ghcmessages.PaymentRequests) *GetPaymentRequestsForMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests for move o k response +func (o *GetPaymentRequestsForMoveOK) SetPayload(payload ghcmessages.PaymentRequests) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsForMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.PaymentRequests{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetPaymentRequestsForMoveForbiddenCode is the HTTP code returned for type GetPaymentRequestsForMoveForbidden +const GetPaymentRequestsForMoveForbiddenCode int = 403 + +/* +GetPaymentRequestsForMoveForbidden The request was denied + +swagger:response getPaymentRequestsForMoveForbidden +*/ +type GetPaymentRequestsForMoveForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestsForMoveForbidden creates GetPaymentRequestsForMoveForbidden with default headers values +func NewGetPaymentRequestsForMoveForbidden() *GetPaymentRequestsForMoveForbidden { + + return &GetPaymentRequestsForMoveForbidden{} +} + +// WithPayload adds the payload to the get payment requests for move forbidden response +func (o *GetPaymentRequestsForMoveForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests for move forbidden response +func (o *GetPaymentRequestsForMoveForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsForMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestsForMoveNotFoundCode is the HTTP code returned for type GetPaymentRequestsForMoveNotFound +const GetPaymentRequestsForMoveNotFoundCode int = 404 + +/* +GetPaymentRequestsForMoveNotFound The requested resource wasn't found + +swagger:response getPaymentRequestsForMoveNotFound +*/ +type GetPaymentRequestsForMoveNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestsForMoveNotFound creates GetPaymentRequestsForMoveNotFound with default headers values +func NewGetPaymentRequestsForMoveNotFound() *GetPaymentRequestsForMoveNotFound { + + return &GetPaymentRequestsForMoveNotFound{} +} + +// WithPayload adds the payload to the get payment requests for move not found response +func (o *GetPaymentRequestsForMoveNotFound) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests for move not found response +func (o *GetPaymentRequestsForMoveNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsForMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestsForMoveUnprocessableEntityCode is the HTTP code returned for type GetPaymentRequestsForMoveUnprocessableEntity +const GetPaymentRequestsForMoveUnprocessableEntityCode int = 422 + +/* +GetPaymentRequestsForMoveUnprocessableEntity The payload was unprocessable. + +swagger:response getPaymentRequestsForMoveUnprocessableEntity +*/ +type GetPaymentRequestsForMoveUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPaymentRequestsForMoveUnprocessableEntity creates GetPaymentRequestsForMoveUnprocessableEntity with default headers values +func NewGetPaymentRequestsForMoveUnprocessableEntity() *GetPaymentRequestsForMoveUnprocessableEntity { + + return &GetPaymentRequestsForMoveUnprocessableEntity{} +} + +// WithPayload adds the payload to the get payment requests for move unprocessable entity response +func (o *GetPaymentRequestsForMoveUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPaymentRequestsForMoveUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests for move unprocessable entity response +func (o *GetPaymentRequestsForMoveUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsForMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestsForMoveInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestsForMoveInternalServerError +const GetPaymentRequestsForMoveInternalServerErrorCode int = 500 + +/* +GetPaymentRequestsForMoveInternalServerError A server error occurred + +swagger:response getPaymentRequestsForMoveInternalServerError +*/ +type GetPaymentRequestsForMoveInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestsForMoveInternalServerError creates GetPaymentRequestsForMoveInternalServerError with default headers values +func NewGetPaymentRequestsForMoveInternalServerError() *GetPaymentRequestsForMoveInternalServerError { + + return &GetPaymentRequestsForMoveInternalServerError{} +} + +// WithPayload adds the payload to the get payment requests for move internal server error response +func (o *GetPaymentRequestsForMoveInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsForMoveInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests for move internal server error response +func (o *GetPaymentRequestsForMoveInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsForMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go new file mode 100644 index 00000000000..8c31a3d51c4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_payment_requests_for_move_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetPaymentRequestsForMoveURL generates an URL for the get payment requests for move operation +type GetPaymentRequestsForMoveURL struct { + Locator string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestsForMoveURL) WithBasePath(bp string) *GetPaymentRequestsForMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestsForMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPaymentRequestsForMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/payment-requests" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on GetPaymentRequestsForMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPaymentRequestsForMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPaymentRequestsForMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPaymentRequestsForMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPaymentRequestsForMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPaymentRequestsForMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPaymentRequestsForMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go new file mode 100644 index 00000000000..50ad871ad96 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetShipmentsPaymentSITBalanceHandlerFunc turns a function with the right signature into a get shipments payment s i t balance handler +type GetShipmentsPaymentSITBalanceHandlerFunc func(GetShipmentsPaymentSITBalanceParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetShipmentsPaymentSITBalanceHandlerFunc) Handle(params GetShipmentsPaymentSITBalanceParams) middleware.Responder { + return fn(params) +} + +// GetShipmentsPaymentSITBalanceHandler interface for that can handle valid get shipments payment s i t balance params +type GetShipmentsPaymentSITBalanceHandler interface { + Handle(GetShipmentsPaymentSITBalanceParams) middleware.Responder +} + +// NewGetShipmentsPaymentSITBalance creates a new http.Handler for the get shipments payment s i t balance operation +func NewGetShipmentsPaymentSITBalance(ctx *middleware.Context, handler GetShipmentsPaymentSITBalanceHandler) *GetShipmentsPaymentSITBalance { + return &GetShipmentsPaymentSITBalance{Context: ctx, Handler: handler} +} + +/* + GetShipmentsPaymentSITBalance swagger:route GET /payment-requests/{paymentRequestID}/shipments-payment-sit-balance paymentRequests getShipmentsPaymentSITBalance + +# Returns all shipment payment request SIT usage to support partial SIT invoicing + +Returns all shipment payment request SIT usage to support partial SIT invoicing +*/ +type GetShipmentsPaymentSITBalance struct { + Context *middleware.Context + Handler GetShipmentsPaymentSITBalanceHandler +} + +func (o *GetShipmentsPaymentSITBalance) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetShipmentsPaymentSITBalanceParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go new file mode 100644 index 00000000000..6d107c40c80 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetShipmentsPaymentSITBalanceParams creates a new GetShipmentsPaymentSITBalanceParams object +// +// There are no default values defined in the spec. +func NewGetShipmentsPaymentSITBalanceParams() GetShipmentsPaymentSITBalanceParams { + + return GetShipmentsPaymentSITBalanceParams{} +} + +// GetShipmentsPaymentSITBalanceParams contains all the bound params for the get shipments payment s i t balance operation +// typically these are obtained from a http.Request +// +// swagger:parameters getShipmentsPaymentSITBalance +type GetShipmentsPaymentSITBalanceParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*payment request ID of the payment request with SIT service items being reviewed + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetShipmentsPaymentSITBalanceParams() beforehand. +func (o *GetShipmentsPaymentSITBalanceParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *GetShipmentsPaymentSITBalanceParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *GetShipmentsPaymentSITBalanceParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go new file mode 100644 index 00000000000..635f95ed44f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetShipmentsPaymentSITBalanceOKCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceOK +const GetShipmentsPaymentSITBalanceOKCode int = 200 + +/* +GetShipmentsPaymentSITBalanceOK Successfully retrieved shipments and their SIT days balance from all payment requests on the move + +swagger:response getShipmentsPaymentSITBalanceOK +*/ +type GetShipmentsPaymentSITBalanceOK struct { + + /* + In: Body + */ + Payload ghcmessages.ShipmentsPaymentSITBalance `json:"body,omitempty"` +} + +// NewGetShipmentsPaymentSITBalanceOK creates GetShipmentsPaymentSITBalanceOK with default headers values +func NewGetShipmentsPaymentSITBalanceOK() *GetShipmentsPaymentSITBalanceOK { + + return &GetShipmentsPaymentSITBalanceOK{} +} + +// WithPayload adds the payload to the get shipments payment s i t balance o k response +func (o *GetShipmentsPaymentSITBalanceOK) WithPayload(payload ghcmessages.ShipmentsPaymentSITBalance) *GetShipmentsPaymentSITBalanceOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipments payment s i t balance o k response +func (o *GetShipmentsPaymentSITBalanceOK) SetPayload(payload ghcmessages.ShipmentsPaymentSITBalance) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentsPaymentSITBalanceOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.ShipmentsPaymentSITBalance{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetShipmentsPaymentSITBalanceForbiddenCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceForbidden +const GetShipmentsPaymentSITBalanceForbiddenCode int = 403 + +/* +GetShipmentsPaymentSITBalanceForbidden The request was denied + +swagger:response getShipmentsPaymentSITBalanceForbidden +*/ +type GetShipmentsPaymentSITBalanceForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentsPaymentSITBalanceForbidden creates GetShipmentsPaymentSITBalanceForbidden with default headers values +func NewGetShipmentsPaymentSITBalanceForbidden() *GetShipmentsPaymentSITBalanceForbidden { + + return &GetShipmentsPaymentSITBalanceForbidden{} +} + +// WithPayload adds the payload to the get shipments payment s i t balance forbidden response +func (o *GetShipmentsPaymentSITBalanceForbidden) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipments payment s i t balance forbidden response +func (o *GetShipmentsPaymentSITBalanceForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentsPaymentSITBalanceForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentsPaymentSITBalanceNotFoundCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceNotFound +const GetShipmentsPaymentSITBalanceNotFoundCode int = 404 + +/* +GetShipmentsPaymentSITBalanceNotFound The requested resource wasn't found + +swagger:response getShipmentsPaymentSITBalanceNotFound +*/ +type GetShipmentsPaymentSITBalanceNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentsPaymentSITBalanceNotFound creates GetShipmentsPaymentSITBalanceNotFound with default headers values +func NewGetShipmentsPaymentSITBalanceNotFound() *GetShipmentsPaymentSITBalanceNotFound { + + return &GetShipmentsPaymentSITBalanceNotFound{} +} + +// WithPayload adds the payload to the get shipments payment s i t balance not found response +func (o *GetShipmentsPaymentSITBalanceNotFound) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipments payment s i t balance not found response +func (o *GetShipmentsPaymentSITBalanceNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentsPaymentSITBalanceNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentsPaymentSITBalanceUnprocessableEntityCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceUnprocessableEntity +const GetShipmentsPaymentSITBalanceUnprocessableEntityCode int = 422 + +/* +GetShipmentsPaymentSITBalanceUnprocessableEntity The payload was unprocessable. + +swagger:response getShipmentsPaymentSITBalanceUnprocessableEntity +*/ +type GetShipmentsPaymentSITBalanceUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetShipmentsPaymentSITBalanceUnprocessableEntity creates GetShipmentsPaymentSITBalanceUnprocessableEntity with default headers values +func NewGetShipmentsPaymentSITBalanceUnprocessableEntity() *GetShipmentsPaymentSITBalanceUnprocessableEntity { + + return &GetShipmentsPaymentSITBalanceUnprocessableEntity{} +} + +// WithPayload adds the payload to the get shipments payment s i t balance unprocessable entity response +func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetShipmentsPaymentSITBalanceUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipments payment s i t balance unprocessable entity response +func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentsPaymentSITBalanceUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetShipmentsPaymentSITBalanceInternalServerErrorCode is the HTTP code returned for type GetShipmentsPaymentSITBalanceInternalServerError +const GetShipmentsPaymentSITBalanceInternalServerErrorCode int = 500 + +/* +GetShipmentsPaymentSITBalanceInternalServerError A server error occurred + +swagger:response getShipmentsPaymentSITBalanceInternalServerError +*/ +type GetShipmentsPaymentSITBalanceInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetShipmentsPaymentSITBalanceInternalServerError creates GetShipmentsPaymentSITBalanceInternalServerError with default headers values +func NewGetShipmentsPaymentSITBalanceInternalServerError() *GetShipmentsPaymentSITBalanceInternalServerError { + + return &GetShipmentsPaymentSITBalanceInternalServerError{} +} + +// WithPayload adds the payload to the get shipments payment s i t balance internal server error response +func (o *GetShipmentsPaymentSITBalanceInternalServerError) WithPayload(payload *ghcmessages.Error) *GetShipmentsPaymentSITBalanceInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get shipments payment s i t balance internal server error response +func (o *GetShipmentsPaymentSITBalanceInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetShipmentsPaymentSITBalanceInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go new file mode 100644 index 00000000000..6fd2e91f0bc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/get_shipments_payment_s_i_t_balance_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetShipmentsPaymentSITBalanceURL generates an URL for the get shipments payment s i t balance operation +type GetShipmentsPaymentSITBalanceURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetShipmentsPaymentSITBalanceURL) WithBasePath(bp string) *GetShipmentsPaymentSITBalanceURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetShipmentsPaymentSITBalanceURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetShipmentsPaymentSITBalanceURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on GetShipmentsPaymentSITBalanceURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetShipmentsPaymentSITBalanceURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetShipmentsPaymentSITBalanceURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetShipmentsPaymentSITBalanceURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetShipmentsPaymentSITBalanceURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetShipmentsPaymentSITBalanceURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetShipmentsPaymentSITBalanceURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go new file mode 100644 index 00000000000..7014bffd4e2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdatePaymentRequestStatusHandlerFunc turns a function with the right signature into a update payment request status handler +type UpdatePaymentRequestStatusHandlerFunc func(UpdatePaymentRequestStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdatePaymentRequestStatusHandlerFunc) Handle(params UpdatePaymentRequestStatusParams) middleware.Responder { + return fn(params) +} + +// UpdatePaymentRequestStatusHandler interface for that can handle valid update payment request status params +type UpdatePaymentRequestStatusHandler interface { + Handle(UpdatePaymentRequestStatusParams) middleware.Responder +} + +// NewUpdatePaymentRequestStatus creates a new http.Handler for the update payment request status operation +func NewUpdatePaymentRequestStatus(ctx *middleware.Context, handler UpdatePaymentRequestStatusHandler) *UpdatePaymentRequestStatus { + return &UpdatePaymentRequestStatus{Context: ctx, Handler: handler} +} + +/* + UpdatePaymentRequestStatus swagger:route PATCH /payment-requests/{paymentRequestID}/status paymentRequests updatePaymentRequestStatus + +# Updates status of a payment request by id + +Updates status of a payment request by id +*/ +type UpdatePaymentRequestStatus struct { + Context *middleware.Context + Handler UpdatePaymentRequestStatusHandler +} + +func (o *UpdatePaymentRequestStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdatePaymentRequestStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go new file mode 100644 index 00000000000..74a15d542ea --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object +// +// There are no default values defined in the spec. +func NewUpdatePaymentRequestStatusParams() UpdatePaymentRequestStatusParams { + + return UpdatePaymentRequestStatusParams{} +} + +// UpdatePaymentRequestStatusParams contains all the bound params for the update payment request status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updatePaymentRequestStatus +type UpdatePaymentRequestStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdatePaymentRequestStatusPayload + /*UUID of payment request + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdatePaymentRequestStatusParams() beforehand. +func (o *UpdatePaymentRequestStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdatePaymentRequestStatusPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdatePaymentRequestStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *UpdatePaymentRequestStatusParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *UpdatePaymentRequestStatusParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go new file mode 100644 index 00000000000..104e878e532 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdatePaymentRequestStatusOKCode is the HTTP code returned for type UpdatePaymentRequestStatusOK +const UpdatePaymentRequestStatusOKCode int = 200 + +/* +UpdatePaymentRequestStatusOK updated payment request + +swagger:response updatePaymentRequestStatusOK +*/ +type UpdatePaymentRequestStatusOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PaymentRequest `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusOK creates UpdatePaymentRequestStatusOK with default headers values +func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { + + return &UpdatePaymentRequestStatusOK{} +} + +// WithPayload adds the payload to the update payment request status o k response +func (o *UpdatePaymentRequestStatusOK) WithPayload(payload *ghcmessages.PaymentRequest) *UpdatePaymentRequestStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status o k response +func (o *UpdatePaymentRequestStatusOK) SetPayload(payload *ghcmessages.PaymentRequest) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusBadRequestCode is the HTTP code returned for type UpdatePaymentRequestStatusBadRequest +const UpdatePaymentRequestStatusBadRequestCode int = 400 + +/* +UpdatePaymentRequestStatusBadRequest The request payload is invalid + +swagger:response updatePaymentRequestStatusBadRequest +*/ +type UpdatePaymentRequestStatusBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusBadRequest creates UpdatePaymentRequestStatusBadRequest with default headers values +func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { + + return &UpdatePaymentRequestStatusBadRequest{} +} + +// WithPayload adds the payload to the update payment request status bad request response +func (o *UpdatePaymentRequestStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status bad request response +func (o *UpdatePaymentRequestStatusBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentRequestStatusUnauthorized +const UpdatePaymentRequestStatusUnauthorizedCode int = 401 + +/* +UpdatePaymentRequestStatusUnauthorized The request was denied + +swagger:response updatePaymentRequestStatusUnauthorized +*/ +type UpdatePaymentRequestStatusUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusUnauthorized creates UpdatePaymentRequestStatusUnauthorized with default headers values +func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { + + return &UpdatePaymentRequestStatusUnauthorized{} +} + +// WithPayload adds the payload to the update payment request status unauthorized response +func (o *UpdatePaymentRequestStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status unauthorized response +func (o *UpdatePaymentRequestStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusForbiddenCode is the HTTP code returned for type UpdatePaymentRequestStatusForbidden +const UpdatePaymentRequestStatusForbiddenCode int = 403 + +/* +UpdatePaymentRequestStatusForbidden The request was denied + +swagger:response updatePaymentRequestStatusForbidden +*/ +type UpdatePaymentRequestStatusForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusForbidden creates UpdatePaymentRequestStatusForbidden with default headers values +func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { + + return &UpdatePaymentRequestStatusForbidden{} +} + +// WithPayload adds the payload to the update payment request status forbidden response +func (o *UpdatePaymentRequestStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status forbidden response +func (o *UpdatePaymentRequestStatusForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusNotFoundCode is the HTTP code returned for type UpdatePaymentRequestStatusNotFound +const UpdatePaymentRequestStatusNotFoundCode int = 404 + +/* +UpdatePaymentRequestStatusNotFound The requested resource wasn't found + +swagger:response updatePaymentRequestStatusNotFound +*/ +type UpdatePaymentRequestStatusNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusNotFound creates UpdatePaymentRequestStatusNotFound with default headers values +func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { + + return &UpdatePaymentRequestStatusNotFound{} +} + +// WithPayload adds the payload to the update payment request status not found response +func (o *UpdatePaymentRequestStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status not found response +func (o *UpdatePaymentRequestStatusNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentRequestStatusPreconditionFailed +const UpdatePaymentRequestStatusPreconditionFailedCode int = 412 + +/* +UpdatePaymentRequestStatusPreconditionFailed Precondition failed + +swagger:response updatePaymentRequestStatusPreconditionFailed +*/ +type UpdatePaymentRequestStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusPreconditionFailed creates UpdatePaymentRequestStatusPreconditionFailed with default headers values +func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { + + return &UpdatePaymentRequestStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update payment request status precondition failed response +func (o *UpdatePaymentRequestStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status precondition failed response +func (o *UpdatePaymentRequestStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentRequestStatusUnprocessableEntity +const UpdatePaymentRequestStatusUnprocessableEntityCode int = 422 + +/* +UpdatePaymentRequestStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updatePaymentRequestStatusUnprocessableEntity +*/ +type UpdatePaymentRequestStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusUnprocessableEntity creates UpdatePaymentRequestStatusUnprocessableEntity with default headers values +func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { + + return &UpdatePaymentRequestStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update payment request status unprocessable entity response +func (o *UpdatePaymentRequestStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePaymentRequestStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status unprocessable entity response +func (o *UpdatePaymentRequestStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentRequestStatusInternalServerError +const UpdatePaymentRequestStatusInternalServerErrorCode int = 500 + +/* +UpdatePaymentRequestStatusInternalServerError A server error occurred + +swagger:response updatePaymentRequestStatusInternalServerError +*/ +type UpdatePaymentRequestStatusInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusInternalServerError creates UpdatePaymentRequestStatusInternalServerError with default headers values +func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { + + return &UpdatePaymentRequestStatusInternalServerError{} +} + +// WithPayload adds the payload to the update payment request status internal server error response +func (o *UpdatePaymentRequestStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePaymentRequestStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status internal server error response +func (o *UpdatePaymentRequestStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go new file mode 100644 index 00000000000..cfbb39e034c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_requests/update_payment_request_status_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_requests + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdatePaymentRequestStatusURL generates an URL for the update payment request status operation +type UpdatePaymentRequestStatusURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentRequestStatusURL) WithBasePath(bp string) *UpdatePaymentRequestStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentRequestStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdatePaymentRequestStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/status" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on UpdatePaymentRequestStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdatePaymentRequestStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdatePaymentRequestStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdatePaymentRequestStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdatePaymentRequestStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdatePaymentRequestStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdatePaymentRequestStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go new file mode 100644 index 00000000000..333dfdd7d76 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdatePaymentServiceItemStatusHandlerFunc turns a function with the right signature into a update payment service item status handler +type UpdatePaymentServiceItemStatusHandlerFunc func(UpdatePaymentServiceItemStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdatePaymentServiceItemStatusHandlerFunc) Handle(params UpdatePaymentServiceItemStatusParams) middleware.Responder { + return fn(params) +} + +// UpdatePaymentServiceItemStatusHandler interface for that can handle valid update payment service item status params +type UpdatePaymentServiceItemStatusHandler interface { + Handle(UpdatePaymentServiceItemStatusParams) middleware.Responder +} + +// NewUpdatePaymentServiceItemStatus creates a new http.Handler for the update payment service item status operation +func NewUpdatePaymentServiceItemStatus(ctx *middleware.Context, handler UpdatePaymentServiceItemStatusHandler) *UpdatePaymentServiceItemStatus { + return &UpdatePaymentServiceItemStatus{Context: ctx, Handler: handler} +} + +/* + UpdatePaymentServiceItemStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status paymentServiceItem updatePaymentServiceItemStatus + +# Change the status of a payment service item for a move by ID + +Changes the status of a line item for a move by ID +*/ +type UpdatePaymentServiceItemStatus struct { + Context *middleware.Context + Handler UpdatePaymentServiceItemStatusHandler +} + +func (o *UpdatePaymentServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdatePaymentServiceItemStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go new file mode 100644 index 00000000000..912945f23df --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_parameters.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdatePaymentServiceItemStatusParams creates a new UpdatePaymentServiceItemStatusParams object +// +// There are no default values defined in the spec. +func NewUpdatePaymentServiceItemStatusParams() UpdatePaymentServiceItemStatusParams { + + return UpdatePaymentServiceItemStatusParams{} +} + +// UpdatePaymentServiceItemStatusParams contains all the bound params for the update payment service item status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updatePaymentServiceItemStatus +type UpdatePaymentServiceItemStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.PaymentServiceItem + /*ID of move to use + Required: true + In: path + */ + MoveTaskOrderID string + /*ID of payment service item to use + Required: true + In: path + */ + PaymentServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdatePaymentServiceItemStatusParams() beforehand. +func (o *UpdatePaymentServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.PaymentServiceItem + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rPaymentServiceItemID, rhkPaymentServiceItemID, _ := route.Params.GetOK("paymentServiceItemID") + if err := o.bindPaymentServiceItemID(rPaymentServiceItemID, rhkPaymentServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdatePaymentServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdatePaymentServiceItemStatusParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} + +// bindPaymentServiceItemID binds and validates parameter PaymentServiceItemID from path. +func (o *UpdatePaymentServiceItemStatusParams) bindPaymentServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PaymentServiceItemID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go new file mode 100644 index 00000000000..d5297264596 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdatePaymentServiceItemStatusOKCode is the HTTP code returned for type UpdatePaymentServiceItemStatusOK +const UpdatePaymentServiceItemStatusOKCode int = 200 + +/* +UpdatePaymentServiceItemStatusOK Successfully updated status for a line item for a move task order by ID + +swagger:response updatePaymentServiceItemStatusOK +*/ +type UpdatePaymentServiceItemStatusOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PaymentServiceItem `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusOK creates UpdatePaymentServiceItemStatusOK with default headers values +func NewUpdatePaymentServiceItemStatusOK() *UpdatePaymentServiceItemStatusOK { + + return &UpdatePaymentServiceItemStatusOK{} +} + +// WithPayload adds the payload to the update payment service item status o k response +func (o *UpdatePaymentServiceItemStatusOK) WithPayload(payload *ghcmessages.PaymentServiceItem) *UpdatePaymentServiceItemStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status o k response +func (o *UpdatePaymentServiceItemStatusOK) SetPayload(payload *ghcmessages.PaymentServiceItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusBadRequestCode is the HTTP code returned for type UpdatePaymentServiceItemStatusBadRequest +const UpdatePaymentServiceItemStatusBadRequestCode int = 400 + +/* +UpdatePaymentServiceItemStatusBadRequest The request payload is invalid + +swagger:response updatePaymentServiceItemStatusBadRequest +*/ +type UpdatePaymentServiceItemStatusBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusBadRequest creates UpdatePaymentServiceItemStatusBadRequest with default headers values +func NewUpdatePaymentServiceItemStatusBadRequest() *UpdatePaymentServiceItemStatusBadRequest { + + return &UpdatePaymentServiceItemStatusBadRequest{} +} + +// WithPayload adds the payload to the update payment service item status bad request response +func (o *UpdatePaymentServiceItemStatusBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status bad request response +func (o *UpdatePaymentServiceItemStatusBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentServiceItemStatusUnauthorized +const UpdatePaymentServiceItemStatusUnauthorizedCode int = 401 + +/* +UpdatePaymentServiceItemStatusUnauthorized The request was denied + +swagger:response updatePaymentServiceItemStatusUnauthorized +*/ +type UpdatePaymentServiceItemStatusUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusUnauthorized creates UpdatePaymentServiceItemStatusUnauthorized with default headers values +func NewUpdatePaymentServiceItemStatusUnauthorized() *UpdatePaymentServiceItemStatusUnauthorized { + + return &UpdatePaymentServiceItemStatusUnauthorized{} +} + +// WithPayload adds the payload to the update payment service item status unauthorized response +func (o *UpdatePaymentServiceItemStatusUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status unauthorized response +func (o *UpdatePaymentServiceItemStatusUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusForbiddenCode is the HTTP code returned for type UpdatePaymentServiceItemStatusForbidden +const UpdatePaymentServiceItemStatusForbiddenCode int = 403 + +/* +UpdatePaymentServiceItemStatusForbidden The request was denied + +swagger:response updatePaymentServiceItemStatusForbidden +*/ +type UpdatePaymentServiceItemStatusForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusForbidden creates UpdatePaymentServiceItemStatusForbidden with default headers values +func NewUpdatePaymentServiceItemStatusForbidden() *UpdatePaymentServiceItemStatusForbidden { + + return &UpdatePaymentServiceItemStatusForbidden{} +} + +// WithPayload adds the payload to the update payment service item status forbidden response +func (o *UpdatePaymentServiceItemStatusForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status forbidden response +func (o *UpdatePaymentServiceItemStatusForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusNotFoundCode is the HTTP code returned for type UpdatePaymentServiceItemStatusNotFound +const UpdatePaymentServiceItemStatusNotFoundCode int = 404 + +/* +UpdatePaymentServiceItemStatusNotFound The requested resource wasn't found + +swagger:response updatePaymentServiceItemStatusNotFound +*/ +type UpdatePaymentServiceItemStatusNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusNotFound creates UpdatePaymentServiceItemStatusNotFound with default headers values +func NewUpdatePaymentServiceItemStatusNotFound() *UpdatePaymentServiceItemStatusNotFound { + + return &UpdatePaymentServiceItemStatusNotFound{} +} + +// WithPayload adds the payload to the update payment service item status not found response +func (o *UpdatePaymentServiceItemStatusNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status not found response +func (o *UpdatePaymentServiceItemStatusNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentServiceItemStatusPreconditionFailed +const UpdatePaymentServiceItemStatusPreconditionFailedCode int = 412 + +/* +UpdatePaymentServiceItemStatusPreconditionFailed Precondition failed + +swagger:response updatePaymentServiceItemStatusPreconditionFailed +*/ +type UpdatePaymentServiceItemStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusPreconditionFailed creates UpdatePaymentServiceItemStatusPreconditionFailed with default headers values +func NewUpdatePaymentServiceItemStatusPreconditionFailed() *UpdatePaymentServiceItemStatusPreconditionFailed { + + return &UpdatePaymentServiceItemStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update payment service item status precondition failed response +func (o *UpdatePaymentServiceItemStatusPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status precondition failed response +func (o *UpdatePaymentServiceItemStatusPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentServiceItemStatusUnprocessableEntity +const UpdatePaymentServiceItemStatusUnprocessableEntityCode int = 422 + +/* +UpdatePaymentServiceItemStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updatePaymentServiceItemStatusUnprocessableEntity +*/ +type UpdatePaymentServiceItemStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusUnprocessableEntity creates UpdatePaymentServiceItemStatusUnprocessableEntity with default headers values +func NewUpdatePaymentServiceItemStatusUnprocessableEntity() *UpdatePaymentServiceItemStatusUnprocessableEntity { + + return &UpdatePaymentServiceItemStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update payment service item status unprocessable entity response +func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePaymentServiceItemStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status unprocessable entity response +func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentServiceItemStatusInternalServerError +const UpdatePaymentServiceItemStatusInternalServerErrorCode int = 500 + +/* +UpdatePaymentServiceItemStatusInternalServerError A server error occurred + +swagger:response updatePaymentServiceItemStatusInternalServerError +*/ +type UpdatePaymentServiceItemStatusInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentServiceItemStatusInternalServerError creates UpdatePaymentServiceItemStatusInternalServerError with default headers values +func NewUpdatePaymentServiceItemStatusInternalServerError() *UpdatePaymentServiceItemStatusInternalServerError { + + return &UpdatePaymentServiceItemStatusInternalServerError{} +} + +// WithPayload adds the payload to the update payment service item status internal server error response +func (o *UpdatePaymentServiceItemStatusInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePaymentServiceItemStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment service item status internal server error response +func (o *UpdatePaymentServiceItemStatusInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go new file mode 100644 index 00000000000..267d249ec2b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/payment_service_item/update_payment_service_item_status_urlbuilder.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdatePaymentServiceItemStatusURL generates an URL for the update payment service item status operation +type UpdatePaymentServiceItemStatusURL struct { + MoveTaskOrderID string + PaymentServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentServiceItemStatusURL) WithBasePath(bp string) *UpdatePaymentServiceItemStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentServiceItemStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdatePaymentServiceItemStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdatePaymentServiceItemStatusURL") + } + + paymentServiceItemID := o.PaymentServiceItemID + if paymentServiceItemID != "" { + _path = strings.Replace(_path, "{paymentServiceItemID}", paymentServiceItemID, -1) + } else { + return nil, errors.New("paymentServiceItemId is required on UpdatePaymentServiceItemStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdatePaymentServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdatePaymentServiceItemStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdatePaymentServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdatePaymentServiceItemStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdatePaymentServiceItemStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdatePaymentServiceItemStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go new file mode 100644 index 00000000000..bdaf9872611 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// FinishDocumentReviewHandlerFunc turns a function with the right signature into a finish document review handler +type FinishDocumentReviewHandlerFunc func(FinishDocumentReviewParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn FinishDocumentReviewHandlerFunc) Handle(params FinishDocumentReviewParams) middleware.Responder { + return fn(params) +} + +// FinishDocumentReviewHandler interface for that can handle valid finish document review params +type FinishDocumentReviewHandler interface { + Handle(FinishDocumentReviewParams) middleware.Responder +} + +// NewFinishDocumentReview creates a new http.Handler for the finish document review operation +func NewFinishDocumentReview(ctx *middleware.Context, handler FinishDocumentReviewHandler) *FinishDocumentReview { + return &FinishDocumentReview{Context: ctx, Handler: handler} +} + +/* + FinishDocumentReview swagger:route PATCH /ppm-shipments/{ppmShipmentId}/finish-document-review ppm finishDocumentReview + +# Updates a PPM shipment's status after document review + +Updates a PPM shipment's status once documents have been reviewed. Status is updated depending on whether any documents have been rejected. +*/ +type FinishDocumentReview struct { + Context *middleware.Context + Handler FinishDocumentReviewHandler +} + +func (o *FinishDocumentReview) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewFinishDocumentReviewParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go new file mode 100644 index 00000000000..19ea254de60 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewFinishDocumentReviewParams creates a new FinishDocumentReviewParams object +// +// There are no default values defined in the spec. +func NewFinishDocumentReviewParams() FinishDocumentReviewParams { + + return FinishDocumentReviewParams{} +} + +// FinishDocumentReviewParams contains all the bound params for the finish document review operation +// typically these are obtained from a http.Request +// +// swagger:parameters finishDocumentReview +type FinishDocumentReviewParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewFinishDocumentReviewParams() beforehand. +func (o *FinishDocumentReviewParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *FinishDocumentReviewParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *FinishDocumentReviewParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *FinishDocumentReviewParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go new file mode 100644 index 00000000000..c2b6cb7dd9f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// FinishDocumentReviewOKCode is the HTTP code returned for type FinishDocumentReviewOK +const FinishDocumentReviewOKCode int = 200 + +/* +FinishDocumentReviewOK Successfully finished document review + +swagger:response finishDocumentReviewOK +*/ +type FinishDocumentReviewOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMShipment `json:"body,omitempty"` +} + +// NewFinishDocumentReviewOK creates FinishDocumentReviewOK with default headers values +func NewFinishDocumentReviewOK() *FinishDocumentReviewOK { + + return &FinishDocumentReviewOK{} +} + +// WithPayload adds the payload to the finish document review o k response +func (o *FinishDocumentReviewOK) WithPayload(payload *ghcmessages.PPMShipment) *FinishDocumentReviewOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review o k response +func (o *FinishDocumentReviewOK) SetPayload(payload *ghcmessages.PPMShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewBadRequestCode is the HTTP code returned for type FinishDocumentReviewBadRequest +const FinishDocumentReviewBadRequestCode int = 400 + +/* +FinishDocumentReviewBadRequest The request payload is invalid + +swagger:response finishDocumentReviewBadRequest +*/ +type FinishDocumentReviewBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewBadRequest creates FinishDocumentReviewBadRequest with default headers values +func NewFinishDocumentReviewBadRequest() *FinishDocumentReviewBadRequest { + + return &FinishDocumentReviewBadRequest{} +} + +// WithPayload adds the payload to the finish document review bad request response +func (o *FinishDocumentReviewBadRequest) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review bad request response +func (o *FinishDocumentReviewBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewUnauthorizedCode is the HTTP code returned for type FinishDocumentReviewUnauthorized +const FinishDocumentReviewUnauthorizedCode int = 401 + +/* +FinishDocumentReviewUnauthorized The request was denied + +swagger:response finishDocumentReviewUnauthorized +*/ +type FinishDocumentReviewUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewUnauthorized creates FinishDocumentReviewUnauthorized with default headers values +func NewFinishDocumentReviewUnauthorized() *FinishDocumentReviewUnauthorized { + + return &FinishDocumentReviewUnauthorized{} +} + +// WithPayload adds the payload to the finish document review unauthorized response +func (o *FinishDocumentReviewUnauthorized) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review unauthorized response +func (o *FinishDocumentReviewUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewForbiddenCode is the HTTP code returned for type FinishDocumentReviewForbidden +const FinishDocumentReviewForbiddenCode int = 403 + +/* +FinishDocumentReviewForbidden The request was denied + +swagger:response finishDocumentReviewForbidden +*/ +type FinishDocumentReviewForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewForbidden creates FinishDocumentReviewForbidden with default headers values +func NewFinishDocumentReviewForbidden() *FinishDocumentReviewForbidden { + + return &FinishDocumentReviewForbidden{} +} + +// WithPayload adds the payload to the finish document review forbidden response +func (o *FinishDocumentReviewForbidden) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review forbidden response +func (o *FinishDocumentReviewForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewNotFoundCode is the HTTP code returned for type FinishDocumentReviewNotFound +const FinishDocumentReviewNotFoundCode int = 404 + +/* +FinishDocumentReviewNotFound The requested resource wasn't found + +swagger:response finishDocumentReviewNotFound +*/ +type FinishDocumentReviewNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewNotFound creates FinishDocumentReviewNotFound with default headers values +func NewFinishDocumentReviewNotFound() *FinishDocumentReviewNotFound { + + return &FinishDocumentReviewNotFound{} +} + +// WithPayload adds the payload to the finish document review not found response +func (o *FinishDocumentReviewNotFound) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review not found response +func (o *FinishDocumentReviewNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewConflictCode is the HTTP code returned for type FinishDocumentReviewConflict +const FinishDocumentReviewConflictCode int = 409 + +/* +FinishDocumentReviewConflict Conflict error + +swagger:response finishDocumentReviewConflict +*/ +type FinishDocumentReviewConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewConflict creates FinishDocumentReviewConflict with default headers values +func NewFinishDocumentReviewConflict() *FinishDocumentReviewConflict { + + return &FinishDocumentReviewConflict{} +} + +// WithPayload adds the payload to the finish document review conflict response +func (o *FinishDocumentReviewConflict) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review conflict response +func (o *FinishDocumentReviewConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewPreconditionFailedCode is the HTTP code returned for type FinishDocumentReviewPreconditionFailed +const FinishDocumentReviewPreconditionFailedCode int = 412 + +/* +FinishDocumentReviewPreconditionFailed Precondition failed + +swagger:response finishDocumentReviewPreconditionFailed +*/ +type FinishDocumentReviewPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewPreconditionFailed creates FinishDocumentReviewPreconditionFailed with default headers values +func NewFinishDocumentReviewPreconditionFailed() *FinishDocumentReviewPreconditionFailed { + + return &FinishDocumentReviewPreconditionFailed{} +} + +// WithPayload adds the payload to the finish document review precondition failed response +func (o *FinishDocumentReviewPreconditionFailed) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review precondition failed response +func (o *FinishDocumentReviewPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewUnprocessableEntityCode is the HTTP code returned for type FinishDocumentReviewUnprocessableEntity +const FinishDocumentReviewUnprocessableEntityCode int = 422 + +/* +FinishDocumentReviewUnprocessableEntity The payload was unprocessable. + +swagger:response finishDocumentReviewUnprocessableEntity +*/ +type FinishDocumentReviewUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewFinishDocumentReviewUnprocessableEntity creates FinishDocumentReviewUnprocessableEntity with default headers values +func NewFinishDocumentReviewUnprocessableEntity() *FinishDocumentReviewUnprocessableEntity { + + return &FinishDocumentReviewUnprocessableEntity{} +} + +// WithPayload adds the payload to the finish document review unprocessable entity response +func (o *FinishDocumentReviewUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *FinishDocumentReviewUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review unprocessable entity response +func (o *FinishDocumentReviewUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// FinishDocumentReviewInternalServerErrorCode is the HTTP code returned for type FinishDocumentReviewInternalServerError +const FinishDocumentReviewInternalServerErrorCode int = 500 + +/* +FinishDocumentReviewInternalServerError A server error occurred + +swagger:response finishDocumentReviewInternalServerError +*/ +type FinishDocumentReviewInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewFinishDocumentReviewInternalServerError creates FinishDocumentReviewInternalServerError with default headers values +func NewFinishDocumentReviewInternalServerError() *FinishDocumentReviewInternalServerError { + + return &FinishDocumentReviewInternalServerError{} +} + +// WithPayload adds the payload to the finish document review internal server error response +func (o *FinishDocumentReviewInternalServerError) WithPayload(payload *ghcmessages.Error) *FinishDocumentReviewInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the finish document review internal server error response +func (o *FinishDocumentReviewInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *FinishDocumentReviewInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go new file mode 100644 index 00000000000..4d9e3e1251f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/finish_document_review_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// FinishDocumentReviewURL generates an URL for the finish document review operation +type FinishDocumentReviewURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *FinishDocumentReviewURL) WithBasePath(bp string) *FinishDocumentReviewURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *FinishDocumentReviewURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *FinishDocumentReviewURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/finish-document-review" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on FinishDocumentReviewURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *FinishDocumentReviewURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *FinishDocumentReviewURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *FinishDocumentReviewURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on FinishDocumentReviewURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on FinishDocumentReviewURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *FinishDocumentReviewURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go new file mode 100644 index 00000000000..533ae2ee80c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPPMActualWeightHandlerFunc turns a function with the right signature into a get p p m actual weight handler +type GetPPMActualWeightHandlerFunc func(GetPPMActualWeightParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPPMActualWeightHandlerFunc) Handle(params GetPPMActualWeightParams) middleware.Responder { + return fn(params) +} + +// GetPPMActualWeightHandler interface for that can handle valid get p p m actual weight params +type GetPPMActualWeightHandler interface { + Handle(GetPPMActualWeightParams) middleware.Responder +} + +// NewGetPPMActualWeight creates a new http.Handler for the get p p m actual weight operation +func NewGetPPMActualWeight(ctx *middleware.Context, handler GetPPMActualWeightHandler) *GetPPMActualWeight { + return &GetPPMActualWeight{Context: ctx, Handler: handler} +} + +/* + GetPPMActualWeight swagger:route GET /ppm-shipments/{ppmShipmentId}/actual-weight ppm getPPMActualWeight + +# Get the actual weight for a PPM shipment + +Retrieves the actual weight for the specified PPM shipment. +*/ +type GetPPMActualWeight struct { + Context *middleware.Context + Handler GetPPMActualWeightHandler +} + +func (o *GetPPMActualWeight) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPPMActualWeightParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go new file mode 100644 index 00000000000..a26648ef235 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetPPMActualWeightParams creates a new GetPPMActualWeightParams object +// +// There are no default values defined in the spec. +func NewGetPPMActualWeightParams() GetPPMActualWeightParams { + + return GetPPMActualWeightParams{} +} + +// GetPPMActualWeightParams contains all the bound params for the get p p m actual weight operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPPMActualWeight +type GetPPMActualWeightParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPPMActualWeightParams() beforehand. +func (o *GetPPMActualWeightParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *GetPPMActualWeightParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *GetPPMActualWeightParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go new file mode 100644 index 00000000000..dfec7304a52 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPPMActualWeightOKCode is the HTTP code returned for type GetPPMActualWeightOK +const GetPPMActualWeightOKCode int = 200 + +/* +GetPPMActualWeightOK Returns actual weight for the specified PPM shipment. + +swagger:response getPPMActualWeightOK +*/ +type GetPPMActualWeightOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMActualWeight `json:"body,omitempty"` +} + +// NewGetPPMActualWeightOK creates GetPPMActualWeightOK with default headers values +func NewGetPPMActualWeightOK() *GetPPMActualWeightOK { + + return &GetPPMActualWeightOK{} +} + +// WithPayload adds the payload to the get p p m actual weight o k response +func (o *GetPPMActualWeightOK) WithPayload(payload *ghcmessages.PPMActualWeight) *GetPPMActualWeightOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight o k response +func (o *GetPPMActualWeightOK) SetPayload(payload *ghcmessages.PPMActualWeight) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMActualWeightBadRequestCode is the HTTP code returned for type GetPPMActualWeightBadRequest +const GetPPMActualWeightBadRequestCode int = 400 + +/* +GetPPMActualWeightBadRequest The request payload is invalid + +swagger:response getPPMActualWeightBadRequest +*/ +type GetPPMActualWeightBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMActualWeightBadRequest creates GetPPMActualWeightBadRequest with default headers values +func NewGetPPMActualWeightBadRequest() *GetPPMActualWeightBadRequest { + + return &GetPPMActualWeightBadRequest{} +} + +// WithPayload adds the payload to the get p p m actual weight bad request response +func (o *GetPPMActualWeightBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight bad request response +func (o *GetPPMActualWeightBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMActualWeightForbiddenCode is the HTTP code returned for type GetPPMActualWeightForbidden +const GetPPMActualWeightForbiddenCode int = 403 + +/* +GetPPMActualWeightForbidden The request was denied + +swagger:response getPPMActualWeightForbidden +*/ +type GetPPMActualWeightForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMActualWeightForbidden creates GetPPMActualWeightForbidden with default headers values +func NewGetPPMActualWeightForbidden() *GetPPMActualWeightForbidden { + + return &GetPPMActualWeightForbidden{} +} + +// WithPayload adds the payload to the get p p m actual weight forbidden response +func (o *GetPPMActualWeightForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight forbidden response +func (o *GetPPMActualWeightForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMActualWeightNotFoundCode is the HTTP code returned for type GetPPMActualWeightNotFound +const GetPPMActualWeightNotFoundCode int = 404 + +/* +GetPPMActualWeightNotFound The requested resource wasn't found + +swagger:response getPPMActualWeightNotFound +*/ +type GetPPMActualWeightNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMActualWeightNotFound creates GetPPMActualWeightNotFound with default headers values +func NewGetPPMActualWeightNotFound() *GetPPMActualWeightNotFound { + + return &GetPPMActualWeightNotFound{} +} + +// WithPayload adds the payload to the get p p m actual weight not found response +func (o *GetPPMActualWeightNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight not found response +func (o *GetPPMActualWeightNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMActualWeightUnprocessableEntityCode is the HTTP code returned for type GetPPMActualWeightUnprocessableEntity +const GetPPMActualWeightUnprocessableEntityCode int = 422 + +/* +GetPPMActualWeightUnprocessableEntity The payload was unprocessable. + +swagger:response getPPMActualWeightUnprocessableEntity +*/ +type GetPPMActualWeightUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPPMActualWeightUnprocessableEntity creates GetPPMActualWeightUnprocessableEntity with default headers values +func NewGetPPMActualWeightUnprocessableEntity() *GetPPMActualWeightUnprocessableEntity { + + return &GetPPMActualWeightUnprocessableEntity{} +} + +// WithPayload adds the payload to the get p p m actual weight unprocessable entity response +func (o *GetPPMActualWeightUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMActualWeightUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight unprocessable entity response +func (o *GetPPMActualWeightUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMActualWeightInternalServerErrorCode is the HTTP code returned for type GetPPMActualWeightInternalServerError +const GetPPMActualWeightInternalServerErrorCode int = 500 + +/* +GetPPMActualWeightInternalServerError A server error occurred + +swagger:response getPPMActualWeightInternalServerError +*/ +type GetPPMActualWeightInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMActualWeightInternalServerError creates GetPPMActualWeightInternalServerError with default headers values +func NewGetPPMActualWeightInternalServerError() *GetPPMActualWeightInternalServerError { + + return &GetPPMActualWeightInternalServerError{} +} + +// WithPayload adds the payload to the get p p m actual weight internal server error response +func (o *GetPPMActualWeightInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMActualWeightInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m actual weight internal server error response +func (o *GetPPMActualWeightInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMActualWeightInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go new file mode 100644 index 00000000000..2439b3dbc05 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_actual_weight_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetPPMActualWeightURL generates an URL for the get p p m actual weight operation +type GetPPMActualWeightURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMActualWeightURL) WithBasePath(bp string) *GetPPMActualWeightURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMActualWeightURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPPMActualWeightURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/actual-weight" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on GetPPMActualWeightURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPPMActualWeightURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPPMActualWeightURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPPMActualWeightURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPPMActualWeightURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPPMActualWeightURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPPMActualWeightURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go new file mode 100644 index 00000000000..d2536b933db --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPPMCloseoutHandlerFunc turns a function with the right signature into a get p p m closeout handler +type GetPPMCloseoutHandlerFunc func(GetPPMCloseoutParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPPMCloseoutHandlerFunc) Handle(params GetPPMCloseoutParams) middleware.Responder { + return fn(params) +} + +// GetPPMCloseoutHandler interface for that can handle valid get p p m closeout params +type GetPPMCloseoutHandler interface { + Handle(GetPPMCloseoutParams) middleware.Responder +} + +// NewGetPPMCloseout creates a new http.Handler for the get p p m closeout operation +func NewGetPPMCloseout(ctx *middleware.Context, handler GetPPMCloseoutHandler) *GetPPMCloseout { + return &GetPPMCloseout{Context: ctx, Handler: handler} +} + +/* + GetPPMCloseout swagger:route GET /ppm-shipments/{ppmShipmentId}/closeout ppm getPPMCloseout + +# Get the closeout calcuations for the specified PPM shipment + +Retrieves the closeout calculations for the specified PPM shipment. +*/ +type GetPPMCloseout struct { + Context *middleware.Context + Handler GetPPMCloseoutHandler +} + +func (o *GetPPMCloseout) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPPMCloseoutParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go new file mode 100644 index 00000000000..0b766ba8fd9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetPPMCloseoutParams creates a new GetPPMCloseoutParams object +// +// There are no default values defined in the spec. +func NewGetPPMCloseoutParams() GetPPMCloseoutParams { + + return GetPPMCloseoutParams{} +} + +// GetPPMCloseoutParams contains all the bound params for the get p p m closeout operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPPMCloseout +type GetPPMCloseoutParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPPMCloseoutParams() beforehand. +func (o *GetPPMCloseoutParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *GetPPMCloseoutParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *GetPPMCloseoutParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go new file mode 100644 index 00000000000..38821f39514 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPPMCloseoutOKCode is the HTTP code returned for type GetPPMCloseoutOK +const GetPPMCloseoutOKCode int = 200 + +/* +GetPPMCloseoutOK Returns closeout for the specified PPM shipment. + +swagger:response getPPMCloseoutOK +*/ +type GetPPMCloseoutOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMCloseout `json:"body,omitempty"` +} + +// NewGetPPMCloseoutOK creates GetPPMCloseoutOK with default headers values +func NewGetPPMCloseoutOK() *GetPPMCloseoutOK { + + return &GetPPMCloseoutOK{} +} + +// WithPayload adds the payload to the get p p m closeout o k response +func (o *GetPPMCloseoutOK) WithPayload(payload *ghcmessages.PPMCloseout) *GetPPMCloseoutOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout o k response +func (o *GetPPMCloseoutOK) SetPayload(payload *ghcmessages.PPMCloseout) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMCloseoutBadRequestCode is the HTTP code returned for type GetPPMCloseoutBadRequest +const GetPPMCloseoutBadRequestCode int = 400 + +/* +GetPPMCloseoutBadRequest The request payload is invalid + +swagger:response getPPMCloseoutBadRequest +*/ +type GetPPMCloseoutBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMCloseoutBadRequest creates GetPPMCloseoutBadRequest with default headers values +func NewGetPPMCloseoutBadRequest() *GetPPMCloseoutBadRequest { + + return &GetPPMCloseoutBadRequest{} +} + +// WithPayload adds the payload to the get p p m closeout bad request response +func (o *GetPPMCloseoutBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout bad request response +func (o *GetPPMCloseoutBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMCloseoutForbiddenCode is the HTTP code returned for type GetPPMCloseoutForbidden +const GetPPMCloseoutForbiddenCode int = 403 + +/* +GetPPMCloseoutForbidden The request was denied + +swagger:response getPPMCloseoutForbidden +*/ +type GetPPMCloseoutForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMCloseoutForbidden creates GetPPMCloseoutForbidden with default headers values +func NewGetPPMCloseoutForbidden() *GetPPMCloseoutForbidden { + + return &GetPPMCloseoutForbidden{} +} + +// WithPayload adds the payload to the get p p m closeout forbidden response +func (o *GetPPMCloseoutForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout forbidden response +func (o *GetPPMCloseoutForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMCloseoutNotFoundCode is the HTTP code returned for type GetPPMCloseoutNotFound +const GetPPMCloseoutNotFoundCode int = 404 + +/* +GetPPMCloseoutNotFound The requested resource wasn't found + +swagger:response getPPMCloseoutNotFound +*/ +type GetPPMCloseoutNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMCloseoutNotFound creates GetPPMCloseoutNotFound with default headers values +func NewGetPPMCloseoutNotFound() *GetPPMCloseoutNotFound { + + return &GetPPMCloseoutNotFound{} +} + +// WithPayload adds the payload to the get p p m closeout not found response +func (o *GetPPMCloseoutNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout not found response +func (o *GetPPMCloseoutNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMCloseoutUnprocessableEntityCode is the HTTP code returned for type GetPPMCloseoutUnprocessableEntity +const GetPPMCloseoutUnprocessableEntityCode int = 422 + +/* +GetPPMCloseoutUnprocessableEntity The payload was unprocessable. + +swagger:response getPPMCloseoutUnprocessableEntity +*/ +type GetPPMCloseoutUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPPMCloseoutUnprocessableEntity creates GetPPMCloseoutUnprocessableEntity with default headers values +func NewGetPPMCloseoutUnprocessableEntity() *GetPPMCloseoutUnprocessableEntity { + + return &GetPPMCloseoutUnprocessableEntity{} +} + +// WithPayload adds the payload to the get p p m closeout unprocessable entity response +func (o *GetPPMCloseoutUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMCloseoutUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout unprocessable entity response +func (o *GetPPMCloseoutUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMCloseoutInternalServerErrorCode is the HTTP code returned for type GetPPMCloseoutInternalServerError +const GetPPMCloseoutInternalServerErrorCode int = 500 + +/* +GetPPMCloseoutInternalServerError A server error occurred + +swagger:response getPPMCloseoutInternalServerError +*/ +type GetPPMCloseoutInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMCloseoutInternalServerError creates GetPPMCloseoutInternalServerError with default headers values +func NewGetPPMCloseoutInternalServerError() *GetPPMCloseoutInternalServerError { + + return &GetPPMCloseoutInternalServerError{} +} + +// WithPayload adds the payload to the get p p m closeout internal server error response +func (o *GetPPMCloseoutInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMCloseoutInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m closeout internal server error response +func (o *GetPPMCloseoutInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMCloseoutInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go new file mode 100644 index 00000000000..44164af2f1a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_closeout_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetPPMCloseoutURL generates an URL for the get p p m closeout operation +type GetPPMCloseoutURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMCloseoutURL) WithBasePath(bp string) *GetPPMCloseoutURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMCloseoutURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPPMCloseoutURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/closeout" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on GetPPMCloseoutURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPPMCloseoutURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPPMCloseoutURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPPMCloseoutURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPPMCloseoutURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPPMCloseoutURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPPMCloseoutURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go new file mode 100644 index 00000000000..1e794c2ad41 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPPMDocumentsHandlerFunc turns a function with the right signature into a get p p m documents handler +type GetPPMDocumentsHandlerFunc func(GetPPMDocumentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPPMDocumentsHandlerFunc) Handle(params GetPPMDocumentsParams) middleware.Responder { + return fn(params) +} + +// GetPPMDocumentsHandler interface for that can handle valid get p p m documents params +type GetPPMDocumentsHandler interface { + Handle(GetPPMDocumentsParams) middleware.Responder +} + +// NewGetPPMDocuments creates a new http.Handler for the get p p m documents operation +func NewGetPPMDocuments(ctx *middleware.Context, handler GetPPMDocumentsHandler) *GetPPMDocuments { + return &GetPPMDocuments{Context: ctx, Handler: handler} +} + +/* + GetPPMDocuments swagger:route GET /shipments/{shipmentID}/ppm-documents ppm getPPMDocuments + +# Gets all the PPM documents for a PPM shipment + +Retrieves all of the documents and associated uploads for each ppm document type connected to a PPM shipment. This +excludes any deleted PPM documents. +*/ +type GetPPMDocuments struct { + Context *middleware.Context + Handler GetPPMDocumentsHandler +} + +func (o *GetPPMDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPPMDocumentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go new file mode 100644 index 00000000000..f42e2d87d85 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetPPMDocumentsParams creates a new GetPPMDocumentsParams object +// +// There are no default values defined in the spec. +func NewGetPPMDocumentsParams() GetPPMDocumentsParams { + + return GetPPMDocumentsParams{} +} + +// GetPPMDocumentsParams contains all the bound params for the get p p m documents operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPPMDocuments +type GetPPMDocumentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPPMDocumentsParams() beforehand. +func (o *GetPPMDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *GetPPMDocumentsParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *GetPPMDocumentsParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go new file mode 100644 index 00000000000..6a21b24f070 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPPMDocumentsOKCode is the HTTP code returned for type GetPPMDocumentsOK +const GetPPMDocumentsOKCode int = 200 + +/* +GetPPMDocumentsOK All PPM documents and associated uploads for the specified PPM shipment. + +swagger:response getPPMDocumentsOK +*/ +type GetPPMDocumentsOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMDocuments `json:"body,omitempty"` +} + +// NewGetPPMDocumentsOK creates GetPPMDocumentsOK with default headers values +func NewGetPPMDocumentsOK() *GetPPMDocumentsOK { + + return &GetPPMDocumentsOK{} +} + +// WithPayload adds the payload to the get p p m documents o k response +func (o *GetPPMDocumentsOK) WithPayload(payload *ghcmessages.PPMDocuments) *GetPPMDocumentsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m documents o k response +func (o *GetPPMDocumentsOK) SetPayload(payload *ghcmessages.PPMDocuments) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMDocumentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMDocumentsUnauthorizedCode is the HTTP code returned for type GetPPMDocumentsUnauthorized +const GetPPMDocumentsUnauthorizedCode int = 401 + +/* +GetPPMDocumentsUnauthorized The request was denied + +swagger:response getPPMDocumentsUnauthorized +*/ +type GetPPMDocumentsUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMDocumentsUnauthorized creates GetPPMDocumentsUnauthorized with default headers values +func NewGetPPMDocumentsUnauthorized() *GetPPMDocumentsUnauthorized { + + return &GetPPMDocumentsUnauthorized{} +} + +// WithPayload adds the payload to the get p p m documents unauthorized response +func (o *GetPPMDocumentsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m documents unauthorized response +func (o *GetPPMDocumentsUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMDocumentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMDocumentsForbiddenCode is the HTTP code returned for type GetPPMDocumentsForbidden +const GetPPMDocumentsForbiddenCode int = 403 + +/* +GetPPMDocumentsForbidden The request was denied + +swagger:response getPPMDocumentsForbidden +*/ +type GetPPMDocumentsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMDocumentsForbidden creates GetPPMDocumentsForbidden with default headers values +func NewGetPPMDocumentsForbidden() *GetPPMDocumentsForbidden { + + return &GetPPMDocumentsForbidden{} +} + +// WithPayload adds the payload to the get p p m documents forbidden response +func (o *GetPPMDocumentsForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m documents forbidden response +func (o *GetPPMDocumentsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMDocumentsUnprocessableEntityCode is the HTTP code returned for type GetPPMDocumentsUnprocessableEntity +const GetPPMDocumentsUnprocessableEntityCode int = 422 + +/* +GetPPMDocumentsUnprocessableEntity The payload was unprocessable. + +swagger:response getPPMDocumentsUnprocessableEntity +*/ +type GetPPMDocumentsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPPMDocumentsUnprocessableEntity creates GetPPMDocumentsUnprocessableEntity with default headers values +func NewGetPPMDocumentsUnprocessableEntity() *GetPPMDocumentsUnprocessableEntity { + + return &GetPPMDocumentsUnprocessableEntity{} +} + +// WithPayload adds the payload to the get p p m documents unprocessable entity response +func (o *GetPPMDocumentsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMDocumentsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m documents unprocessable entity response +func (o *GetPPMDocumentsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMDocumentsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMDocumentsInternalServerErrorCode is the HTTP code returned for type GetPPMDocumentsInternalServerError +const GetPPMDocumentsInternalServerErrorCode int = 500 + +/* +GetPPMDocumentsInternalServerError A server error occurred + +swagger:response getPPMDocumentsInternalServerError +*/ +type GetPPMDocumentsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMDocumentsInternalServerError creates GetPPMDocumentsInternalServerError with default headers values +func NewGetPPMDocumentsInternalServerError() *GetPPMDocumentsInternalServerError { + + return &GetPPMDocumentsInternalServerError{} +} + +// WithPayload adds the payload to the get p p m documents internal server error response +func (o *GetPPMDocumentsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMDocumentsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m documents internal server error response +func (o *GetPPMDocumentsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go new file mode 100644 index 00000000000..35d0ce45712 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_documents_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetPPMDocumentsURL generates an URL for the get p p m documents operation +type GetPPMDocumentsURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMDocumentsURL) WithBasePath(bp string) *GetPPMDocumentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMDocumentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPPMDocumentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/ppm-documents" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on GetPPMDocumentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPPMDocumentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPPMDocumentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPPMDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPPMDocumentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPPMDocumentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPPMDocumentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go new file mode 100644 index 00000000000..77275e1ca27 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPPMSITEstimatedCostHandlerFunc turns a function with the right signature into a get p p m s i t estimated cost handler +type GetPPMSITEstimatedCostHandlerFunc func(GetPPMSITEstimatedCostParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPPMSITEstimatedCostHandlerFunc) Handle(params GetPPMSITEstimatedCostParams) middleware.Responder { + return fn(params) +} + +// GetPPMSITEstimatedCostHandler interface for that can handle valid get p p m s i t estimated cost params +type GetPPMSITEstimatedCostHandler interface { + Handle(GetPPMSITEstimatedCostParams) middleware.Responder +} + +// NewGetPPMSITEstimatedCost creates a new http.Handler for the get p p m s i t estimated cost operation +func NewGetPPMSITEstimatedCost(ctx *middleware.Context, handler GetPPMSITEstimatedCostHandler) *GetPPMSITEstimatedCost { + return &GetPPMSITEstimatedCost{Context: ctx, Handler: handler} +} + +/* + GetPPMSITEstimatedCost swagger:route GET /ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost ppm getPPMSITEstimatedCost + +# Get the SIT estimated cost for a PPM shipment + +Calculates and returns the SIT estimated cost for the specified PPM shipment. +*/ +type GetPPMSITEstimatedCost struct { + Context *middleware.Context + Handler GetPPMSITEstimatedCostHandler +} + +func (o *GetPPMSITEstimatedCost) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPPMSITEstimatedCostParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go new file mode 100644 index 00000000000..1f48e73d2d4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_parameters.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewGetPPMSITEstimatedCostParams creates a new GetPPMSITEstimatedCostParams object +// +// There are no default values defined in the spec. +func NewGetPPMSITEstimatedCostParams() GetPPMSITEstimatedCostParams { + + return GetPPMSITEstimatedCostParams{} +} + +// GetPPMSITEstimatedCostParams contains all the bound params for the get p p m s i t estimated cost operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPPMSITEstimatedCost +type GetPPMSITEstimatedCostParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*Date departed SIT + Required: true + In: query + */ + SitDepartureDate strfmt.DateTime + /*Date entered into SIT + Required: true + In: query + */ + SitEntryDate strfmt.DateTime + /*location of sit + Required: true + In: path + */ + SitLocation string + /*Weight stored in SIT + Required: true + Minimum: 0 + In: query + */ + WeightStored int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPPMSITEstimatedCostParams() beforehand. +func (o *GetPPMSITEstimatedCostParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + qSitDepartureDate, qhkSitDepartureDate, _ := qs.GetOK("sitDepartureDate") + if err := o.bindSitDepartureDate(qSitDepartureDate, qhkSitDepartureDate, route.Formats); err != nil { + res = append(res, err) + } + + qSitEntryDate, qhkSitEntryDate, _ := qs.GetOK("sitEntryDate") + if err := o.bindSitEntryDate(qSitEntryDate, qhkSitEntryDate, route.Formats); err != nil { + res = append(res, err) + } + + rSitLocation, rhkSitLocation, _ := route.Params.GetOK("sitLocation") + if err := o.bindSitLocation(rSitLocation, rhkSitLocation, route.Formats); err != nil { + res = append(res, err) + } + + qWeightStored, qhkWeightStored, _ := qs.GetOK("weightStored") + if err := o.bindWeightStored(qWeightStored, qhkWeightStored, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *GetPPMSITEstimatedCostParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *GetPPMSITEstimatedCostParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindSitDepartureDate binds and validates parameter SitDepartureDate from query. +func (o *GetPPMSITEstimatedCostParams) bindSitDepartureDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("sitDepartureDate", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("sitDepartureDate", "query", raw); err != nil { + return err + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("sitDepartureDate", "query", "strfmt.DateTime", raw) + } + o.SitDepartureDate = *(value.(*strfmt.DateTime)) + + if err := o.validateSitDepartureDate(formats); err != nil { + return err + } + + return nil +} + +// validateSitDepartureDate carries on validations for parameter SitDepartureDate +func (o *GetPPMSITEstimatedCostParams) validateSitDepartureDate(formats strfmt.Registry) error { + + if err := validate.FormatOf("sitDepartureDate", "query", "date-time", o.SitDepartureDate.String(), formats); err != nil { + return err + } + return nil +} + +// bindSitEntryDate binds and validates parameter SitEntryDate from query. +func (o *GetPPMSITEstimatedCostParams) bindSitEntryDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("sitEntryDate", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("sitEntryDate", "query", raw); err != nil { + return err + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("sitEntryDate", "query", "strfmt.DateTime", raw) + } + o.SitEntryDate = *(value.(*strfmt.DateTime)) + + if err := o.validateSitEntryDate(formats); err != nil { + return err + } + + return nil +} + +// validateSitEntryDate carries on validations for parameter SitEntryDate +func (o *GetPPMSITEstimatedCostParams) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.FormatOf("sitEntryDate", "query", "date-time", o.SitEntryDate.String(), formats); err != nil { + return err + } + return nil +} + +// bindSitLocation binds and validates parameter SitLocation from path. +func (o *GetPPMSITEstimatedCostParams) bindSitLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.SitLocation = raw + + if err := o.validateSitLocation(formats); err != nil { + return err + } + + return nil +} + +// validateSitLocation carries on validations for parameter SitLocation +func (o *GetPPMSITEstimatedCostParams) validateSitLocation(formats strfmt.Registry) error { + + if err := validate.EnumCase("sitLocation", "path", o.SitLocation, []interface{}{"ORIGIN", "DESTINATION"}, true); err != nil { + return err + } + + return nil +} + +// bindWeightStored binds and validates parameter WeightStored from query. +func (o *GetPPMSITEstimatedCostParams) bindWeightStored(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("weightStored", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("weightStored", "query", raw); err != nil { + return err + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("weightStored", "query", "int64", raw) + } + o.WeightStored = value + + if err := o.validateWeightStored(formats); err != nil { + return err + } + + return nil +} + +// validateWeightStored carries on validations for parameter WeightStored +func (o *GetPPMSITEstimatedCostParams) validateWeightStored(formats strfmt.Registry) error { + + if err := validate.MinimumInt("weightStored", "query", o.WeightStored, 0, false); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go new file mode 100644 index 00000000000..0a0c4101f29 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPPMSITEstimatedCostOKCode is the HTTP code returned for type GetPPMSITEstimatedCostOK +const GetPPMSITEstimatedCostOKCode int = 200 + +/* +GetPPMSITEstimatedCostOK Calculates and returns the SIT estimated cost for the specified PPM shipment. + +swagger:response getPPMSITEstimatedCostOK +*/ +type GetPPMSITEstimatedCostOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMSITEstimatedCost `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostOK creates GetPPMSITEstimatedCostOK with default headers values +func NewGetPPMSITEstimatedCostOK() *GetPPMSITEstimatedCostOK { + + return &GetPPMSITEstimatedCostOK{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost o k response +func (o *GetPPMSITEstimatedCostOK) WithPayload(payload *ghcmessages.PPMSITEstimatedCost) *GetPPMSITEstimatedCostOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost o k response +func (o *GetPPMSITEstimatedCostOK) SetPayload(payload *ghcmessages.PPMSITEstimatedCost) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMSITEstimatedCostBadRequestCode is the HTTP code returned for type GetPPMSITEstimatedCostBadRequest +const GetPPMSITEstimatedCostBadRequestCode int = 400 + +/* +GetPPMSITEstimatedCostBadRequest The request payload is invalid + +swagger:response getPPMSITEstimatedCostBadRequest +*/ +type GetPPMSITEstimatedCostBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostBadRequest creates GetPPMSITEstimatedCostBadRequest with default headers values +func NewGetPPMSITEstimatedCostBadRequest() *GetPPMSITEstimatedCostBadRequest { + + return &GetPPMSITEstimatedCostBadRequest{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost bad request response +func (o *GetPPMSITEstimatedCostBadRequest) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost bad request response +func (o *GetPPMSITEstimatedCostBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMSITEstimatedCostForbiddenCode is the HTTP code returned for type GetPPMSITEstimatedCostForbidden +const GetPPMSITEstimatedCostForbiddenCode int = 403 + +/* +GetPPMSITEstimatedCostForbidden The request was denied + +swagger:response getPPMSITEstimatedCostForbidden +*/ +type GetPPMSITEstimatedCostForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostForbidden creates GetPPMSITEstimatedCostForbidden with default headers values +func NewGetPPMSITEstimatedCostForbidden() *GetPPMSITEstimatedCostForbidden { + + return &GetPPMSITEstimatedCostForbidden{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost forbidden response +func (o *GetPPMSITEstimatedCostForbidden) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost forbidden response +func (o *GetPPMSITEstimatedCostForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMSITEstimatedCostNotFoundCode is the HTTP code returned for type GetPPMSITEstimatedCostNotFound +const GetPPMSITEstimatedCostNotFoundCode int = 404 + +/* +GetPPMSITEstimatedCostNotFound The requested resource wasn't found + +swagger:response getPPMSITEstimatedCostNotFound +*/ +type GetPPMSITEstimatedCostNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostNotFound creates GetPPMSITEstimatedCostNotFound with default headers values +func NewGetPPMSITEstimatedCostNotFound() *GetPPMSITEstimatedCostNotFound { + + return &GetPPMSITEstimatedCostNotFound{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost not found response +func (o *GetPPMSITEstimatedCostNotFound) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost not found response +func (o *GetPPMSITEstimatedCostNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMSITEstimatedCostUnprocessableEntityCode is the HTTP code returned for type GetPPMSITEstimatedCostUnprocessableEntity +const GetPPMSITEstimatedCostUnprocessableEntityCode int = 422 + +/* +GetPPMSITEstimatedCostUnprocessableEntity The payload was unprocessable. + +swagger:response getPPMSITEstimatedCostUnprocessableEntity +*/ +type GetPPMSITEstimatedCostUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostUnprocessableEntity creates GetPPMSITEstimatedCostUnprocessableEntity with default headers values +func NewGetPPMSITEstimatedCostUnprocessableEntity() *GetPPMSITEstimatedCostUnprocessableEntity { + + return &GetPPMSITEstimatedCostUnprocessableEntity{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost unprocessable entity response +func (o *GetPPMSITEstimatedCostUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *GetPPMSITEstimatedCostUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost unprocessable entity response +func (o *GetPPMSITEstimatedCostUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPPMSITEstimatedCostInternalServerErrorCode is the HTTP code returned for type GetPPMSITEstimatedCostInternalServerError +const GetPPMSITEstimatedCostInternalServerErrorCode int = 500 + +/* +GetPPMSITEstimatedCostInternalServerError A server error occurred + +swagger:response getPPMSITEstimatedCostInternalServerError +*/ +type GetPPMSITEstimatedCostInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPPMSITEstimatedCostInternalServerError creates GetPPMSITEstimatedCostInternalServerError with default headers values +func NewGetPPMSITEstimatedCostInternalServerError() *GetPPMSITEstimatedCostInternalServerError { + + return &GetPPMSITEstimatedCostInternalServerError{} +} + +// WithPayload adds the payload to the get p p m s i t estimated cost internal server error response +func (o *GetPPMSITEstimatedCostInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPPMSITEstimatedCostInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p p m s i t estimated cost internal server error response +func (o *GetPPMSITEstimatedCostInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPPMSITEstimatedCostInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go new file mode 100644 index 00000000000..13c48d63d8b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/get_p_p_m_s_i_t_estimated_cost_urlbuilder.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetPPMSITEstimatedCostURL generates an URL for the get p p m s i t estimated cost operation +type GetPPMSITEstimatedCostURL struct { + PpmShipmentID strfmt.UUID + SitLocation string + + SitDepartureDate strfmt.DateTime + SitEntryDate strfmt.DateTime + WeightStored int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMSITEstimatedCostURL) WithBasePath(bp string) *GetPPMSITEstimatedCostURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPPMSITEstimatedCostURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPPMSITEstimatedCostURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on GetPPMSITEstimatedCostURL") + } + + sitLocation := o.SitLocation + if sitLocation != "" { + _path = strings.Replace(_path, "{sitLocation}", sitLocation, -1) + } else { + return nil, errors.New("sitLocation is required on GetPPMSITEstimatedCostURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + sitDepartureDateQ := o.SitDepartureDate.String() + if sitDepartureDateQ != "" { + qs.Set("sitDepartureDate", sitDepartureDateQ) + } + + sitEntryDateQ := o.SitEntryDate.String() + if sitEntryDateQ != "" { + qs.Set("sitEntryDate", sitEntryDateQ) + } + + weightStoredQ := swag.FormatInt64(o.WeightStored) + if weightStoredQ != "" { + qs.Set("weightStored", weightStoredQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPPMSITEstimatedCostURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPPMSITEstimatedCostURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPPMSITEstimatedCostURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPPMSITEstimatedCostURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPPMSITEstimatedCostURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPPMSITEstimatedCostURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go new file mode 100644 index 00000000000..2766f01b32c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowAOAPacketHandlerFunc turns a function with the right signature into a show a o a packet handler +type ShowAOAPacketHandlerFunc func(ShowAOAPacketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowAOAPacketHandlerFunc) Handle(params ShowAOAPacketParams) middleware.Responder { + return fn(params) +} + +// ShowAOAPacketHandler interface for that can handle valid show a o a packet params +type ShowAOAPacketHandler interface { + Handle(ShowAOAPacketParams) middleware.Responder +} + +// NewShowAOAPacket creates a new http.Handler for the show a o a packet operation +func NewShowAOAPacket(ctx *middleware.Context, handler ShowAOAPacketHandler) *ShowAOAPacket { + return &ShowAOAPacket{Context: ctx, Handler: handler} +} + +/* + ShowAOAPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/aoa-packet ppm showAOAPacket + +# Downloads AOA Packet form PPMShipment as a PDF + +### Functionality +This endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF. +### Errors +* The PPMShipment must have requested an AOA. +* The PPMShipment AOA Request must have been approved. +*/ +type ShowAOAPacket struct { + Context *middleware.Context + Handler ShowAOAPacketHandler +} + +func (o *ShowAOAPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowAOAPacketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go new file mode 100644 index 00000000000..046c0667969 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewShowAOAPacketParams creates a new ShowAOAPacketParams object +// +// There are no default values defined in the spec. +func NewShowAOAPacketParams() ShowAOAPacketParams { + + return ShowAOAPacketParams{} +} + +// ShowAOAPacketParams contains all the bound params for the show a o a packet operation +// typically these are obtained from a http.Request +// +// swagger:parameters showAOAPacket +type ShowAOAPacketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the id for the ppmshipment with aoa to be downloaded + Required: true + In: path + */ + PpmShipmentID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowAOAPacketParams() beforehand. +func (o *ShowAOAPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *ShowAOAPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PpmShipmentID = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go new file mode 100644 index 00000000000..f7f0bb5e2f9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_responses.go @@ -0,0 +1,305 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ShowAOAPacketOKCode is the HTTP code returned for type ShowAOAPacketOK +const ShowAOAPacketOKCode int = 200 + +/* +ShowAOAPacketOK AOA PDF + +swagger:response showAOAPacketOK +*/ +type ShowAOAPacketOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewShowAOAPacketOK creates ShowAOAPacketOK with default headers values +func NewShowAOAPacketOK() *ShowAOAPacketOK { + + return &ShowAOAPacketOK{} +} + +// WithContentDisposition adds the contentDisposition to the show a o a packet o k response +func (o *ShowAOAPacketOK) WithContentDisposition(contentDisposition string) *ShowAOAPacketOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the show a o a packet o k response +func (o *ShowAOAPacketOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the show a o a packet o k response +func (o *ShowAOAPacketOK) WithPayload(payload io.ReadCloser) *ShowAOAPacketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet o k response +func (o *ShowAOAPacketOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowAOAPacketBadRequestCode is the HTTP code returned for type ShowAOAPacketBadRequest +const ShowAOAPacketBadRequestCode int = 400 + +/* +ShowAOAPacketBadRequest The request payload is invalid + +swagger:response showAOAPacketBadRequest +*/ +type ShowAOAPacketBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowAOAPacketBadRequest creates ShowAOAPacketBadRequest with default headers values +func NewShowAOAPacketBadRequest() *ShowAOAPacketBadRequest { + + return &ShowAOAPacketBadRequest{} +} + +// WithPayload adds the payload to the show a o a packet bad request response +func (o *ShowAOAPacketBadRequest) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet bad request response +func (o *ShowAOAPacketBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketForbiddenCode is the HTTP code returned for type ShowAOAPacketForbidden +const ShowAOAPacketForbiddenCode int = 403 + +/* +ShowAOAPacketForbidden The request was denied + +swagger:response showAOAPacketForbidden +*/ +type ShowAOAPacketForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowAOAPacketForbidden creates ShowAOAPacketForbidden with default headers values +func NewShowAOAPacketForbidden() *ShowAOAPacketForbidden { + + return &ShowAOAPacketForbidden{} +} + +// WithPayload adds the payload to the show a o a packet forbidden response +func (o *ShowAOAPacketForbidden) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet forbidden response +func (o *ShowAOAPacketForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketNotFoundCode is the HTTP code returned for type ShowAOAPacketNotFound +const ShowAOAPacketNotFoundCode int = 404 + +/* +ShowAOAPacketNotFound The requested resource wasn't found + +swagger:response showAOAPacketNotFound +*/ +type ShowAOAPacketNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowAOAPacketNotFound creates ShowAOAPacketNotFound with default headers values +func NewShowAOAPacketNotFound() *ShowAOAPacketNotFound { + + return &ShowAOAPacketNotFound{} +} + +// WithPayload adds the payload to the show a o a packet not found response +func (o *ShowAOAPacketNotFound) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet not found response +func (o *ShowAOAPacketNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketUnprocessableEntityCode is the HTTP code returned for type ShowAOAPacketUnprocessableEntity +const ShowAOAPacketUnprocessableEntityCode int = 422 + +/* +ShowAOAPacketUnprocessableEntity The payload was unprocessable. + +swagger:response showAOAPacketUnprocessableEntity +*/ +type ShowAOAPacketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewShowAOAPacketUnprocessableEntity creates ShowAOAPacketUnprocessableEntity with default headers values +func NewShowAOAPacketUnprocessableEntity() *ShowAOAPacketUnprocessableEntity { + + return &ShowAOAPacketUnprocessableEntity{} +} + +// WithPayload adds the payload to the show a o a packet unprocessable entity response +func (o *ShowAOAPacketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ShowAOAPacketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet unprocessable entity response +func (o *ShowAOAPacketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketInternalServerErrorCode is the HTTP code returned for type ShowAOAPacketInternalServerError +const ShowAOAPacketInternalServerErrorCode int = 500 + +/* +ShowAOAPacketInternalServerError A server error occurred + +swagger:response showAOAPacketInternalServerError +*/ +type ShowAOAPacketInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowAOAPacketInternalServerError creates ShowAOAPacketInternalServerError with default headers values +func NewShowAOAPacketInternalServerError() *ShowAOAPacketInternalServerError { + + return &ShowAOAPacketInternalServerError{} +} + +// WithPayload adds the payload to the show a o a packet internal server error response +func (o *ShowAOAPacketInternalServerError) WithPayload(payload *ghcmessages.Error) *ShowAOAPacketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet internal server error response +func (o *ShowAOAPacketInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go new file mode 100644 index 00000000000..92f3764fe58 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_a_o_a_packet_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// ShowAOAPacketURL generates an URL for the show a o a packet operation +type ShowAOAPacketURL struct { + PpmShipmentID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAOAPacketURL) WithBasePath(bp string) *ShowAOAPacketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAOAPacketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowAOAPacketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/aoa-packet" + + ppmShipmentID := o.PpmShipmentID + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on ShowAOAPacketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowAOAPacketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowAOAPacketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowAOAPacketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowAOAPacketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowAOAPacketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowAOAPacketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go new file mode 100644 index 00000000000..8ba7d0c7e56 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowPaymentPacketHandlerFunc turns a function with the right signature into a show payment packet handler +type ShowPaymentPacketHandlerFunc func(ShowPaymentPacketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowPaymentPacketHandlerFunc) Handle(params ShowPaymentPacketParams) middleware.Responder { + return fn(params) +} + +// ShowPaymentPacketHandler interface for that can handle valid show payment packet params +type ShowPaymentPacketHandler interface { + Handle(ShowPaymentPacketParams) middleware.Responder +} + +// NewShowPaymentPacket creates a new http.Handler for the show payment packet operation +func NewShowPaymentPacket(ctx *middleware.Context, handler ShowPaymentPacketHandler) *ShowPaymentPacket { + return &ShowPaymentPacket{Context: ctx, Handler: handler} +} + +/* + ShowPaymentPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/payment-packet ppm showPaymentPacket + +# Returns PPM payment packet + +Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations. +*/ +type ShowPaymentPacket struct { + Context *middleware.Context + Handler ShowPaymentPacketHandler +} + +func (o *ShowPaymentPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowPaymentPacketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go new file mode 100644 index 00000000000..b3b4c85fadf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowPaymentPacketParams creates a new ShowPaymentPacketParams object +// +// There are no default values defined in the spec. +func NewShowPaymentPacketParams() ShowPaymentPacketParams { + + return ShowPaymentPacketParams{} +} + +// ShowPaymentPacketParams contains all the bound params for the show payment packet operation +// typically these are obtained from a http.Request +// +// swagger:parameters showPaymentPacket +type ShowPaymentPacketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the ppmShipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowPaymentPacketParams() beforehand. +func (o *ShowPaymentPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *ShowPaymentPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *ShowPaymentPacketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go new file mode 100644 index 00000000000..8537da157f4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_responses.go @@ -0,0 +1,203 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" +) + +// ShowPaymentPacketOKCode is the HTTP code returned for type ShowPaymentPacketOK +const ShowPaymentPacketOKCode int = 200 + +/* +ShowPaymentPacketOK PPM Payment Packet PDF + +swagger:response showPaymentPacketOK +*/ +type ShowPaymentPacketOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewShowPaymentPacketOK creates ShowPaymentPacketOK with default headers values +func NewShowPaymentPacketOK() *ShowPaymentPacketOK { + + return &ShowPaymentPacketOK{} +} + +// WithContentDisposition adds the contentDisposition to the show payment packet o k response +func (o *ShowPaymentPacketOK) WithContentDisposition(contentDisposition string) *ShowPaymentPacketOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the show payment packet o k response +func (o *ShowPaymentPacketOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the show payment packet o k response +func (o *ShowPaymentPacketOK) WithPayload(payload io.ReadCloser) *ShowPaymentPacketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show payment packet o k response +func (o *ShowPaymentPacketOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowPaymentPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowPaymentPacketBadRequestCode is the HTTP code returned for type ShowPaymentPacketBadRequest +const ShowPaymentPacketBadRequestCode int = 400 + +/* +ShowPaymentPacketBadRequest invalid request + +swagger:response showPaymentPacketBadRequest +*/ +type ShowPaymentPacketBadRequest struct { +} + +// NewShowPaymentPacketBadRequest creates ShowPaymentPacketBadRequest with default headers values +func NewShowPaymentPacketBadRequest() *ShowPaymentPacketBadRequest { + + return &ShowPaymentPacketBadRequest{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowPaymentPacketUnauthorizedCode is the HTTP code returned for type ShowPaymentPacketUnauthorized +const ShowPaymentPacketUnauthorizedCode int = 401 + +/* +ShowPaymentPacketUnauthorized request requires user authentication + +swagger:response showPaymentPacketUnauthorized +*/ +type ShowPaymentPacketUnauthorized struct { +} + +// NewShowPaymentPacketUnauthorized creates ShowPaymentPacketUnauthorized with default headers values +func NewShowPaymentPacketUnauthorized() *ShowPaymentPacketUnauthorized { + + return &ShowPaymentPacketUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowPaymentPacketForbiddenCode is the HTTP code returned for type ShowPaymentPacketForbidden +const ShowPaymentPacketForbiddenCode int = 403 + +/* +ShowPaymentPacketForbidden user is not authorized + +swagger:response showPaymentPacketForbidden +*/ +type ShowPaymentPacketForbidden struct { +} + +// NewShowPaymentPacketForbidden creates ShowPaymentPacketForbidden with default headers values +func NewShowPaymentPacketForbidden() *ShowPaymentPacketForbidden { + + return &ShowPaymentPacketForbidden{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowPaymentPacketNotFoundCode is the HTTP code returned for type ShowPaymentPacketNotFound +const ShowPaymentPacketNotFoundCode int = 404 + +/* +ShowPaymentPacketNotFound ppm not found + +swagger:response showPaymentPacketNotFound +*/ +type ShowPaymentPacketNotFound struct { +} + +// NewShowPaymentPacketNotFound creates ShowPaymentPacketNotFound with default headers values +func NewShowPaymentPacketNotFound() *ShowPaymentPacketNotFound { + + return &ShowPaymentPacketNotFound{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowPaymentPacketInternalServerErrorCode is the HTTP code returned for type ShowPaymentPacketInternalServerError +const ShowPaymentPacketInternalServerErrorCode int = 500 + +/* +ShowPaymentPacketInternalServerError internal server error + +swagger:response showPaymentPacketInternalServerError +*/ +type ShowPaymentPacketInternalServerError struct { +} + +// NewShowPaymentPacketInternalServerError creates ShowPaymentPacketInternalServerError with default headers values +func NewShowPaymentPacketInternalServerError() *ShowPaymentPacketInternalServerError { + + return &ShowPaymentPacketInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go new file mode 100644 index 00000000000..3ab88cafdd9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/show_payment_packet_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowPaymentPacketURL generates an URL for the show payment packet operation +type ShowPaymentPacketURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowPaymentPacketURL) WithBasePath(bp string) *ShowPaymentPacketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowPaymentPacketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowPaymentPacketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/payment-packet" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on ShowPaymentPacketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowPaymentPacketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowPaymentPacketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowPaymentPacketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowPaymentPacketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowPaymentPacketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowPaymentPacketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go new file mode 100644 index 00000000000..224c2b25336 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMovingExpenseHandlerFunc turns a function with the right signature into a update moving expense handler +type UpdateMovingExpenseHandlerFunc func(UpdateMovingExpenseParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMovingExpenseHandlerFunc) Handle(params UpdateMovingExpenseParams) middleware.Responder { + return fn(params) +} + +// UpdateMovingExpenseHandler interface for that can handle valid update moving expense params +type UpdateMovingExpenseHandler interface { + Handle(UpdateMovingExpenseParams) middleware.Responder +} + +// NewUpdateMovingExpense creates a new http.Handler for the update moving expense operation +func NewUpdateMovingExpense(ctx *middleware.Context, handler UpdateMovingExpenseHandler) *UpdateMovingExpense { + return &UpdateMovingExpense{Context: ctx, Handler: handler} +} + +/* + UpdateMovingExpense swagger:route PATCH /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm updateMovingExpense + +# Updates the moving expense + +Updates a PPM shipment's moving expense with new information. Only some of the moving expense's fields are +editable because some have to be set by the customer, e.g. the description and the moving expense type. +*/ +type UpdateMovingExpense struct { + Context *middleware.Context + Handler UpdateMovingExpenseHandler +} + +func (o *UpdateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMovingExpenseParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go new file mode 100644 index 00000000000..9eecabd5e21 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateMovingExpenseParams creates a new UpdateMovingExpenseParams object +// +// There are no default values defined in the spec. +func NewUpdateMovingExpenseParams() UpdateMovingExpenseParams { + + return UpdateMovingExpenseParams{} +} + +// UpdateMovingExpenseParams contains all the bound params for the update moving expense operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMovingExpense +type UpdateMovingExpenseParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the moving expense + Required: true + In: path + */ + MovingExpenseID strfmt.UUID + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + UpdateMovingExpense *ghcmessages.UpdateMovingExpense +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMovingExpenseParams() beforehand. +func (o *UpdateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") + if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateMovingExpense + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateMovingExpense", "body", "")) + } else { + res = append(res, errors.NewParseError("updateMovingExpense", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateMovingExpense = &body + } + } + } else { + res = append(res, errors.Required("updateMovingExpense", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMovingExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. +func (o *UpdateMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) + } + o.MovingExpenseID = *(value.(*strfmt.UUID)) + + if err := o.validateMovingExpenseID(formats); err != nil { + return err + } + + return nil +} + +// validateMovingExpenseID carries on validations for parameter MovingExpenseID +func (o *UpdateMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { + + if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { + return err + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go new file mode 100644 index 00000000000..d4be7d73b00 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateMovingExpenseOKCode is the HTTP code returned for type UpdateMovingExpenseOK +const UpdateMovingExpenseOKCode int = 200 + +/* +UpdateMovingExpenseOK returns an updated moving expense object + +swagger:response updateMovingExpenseOK +*/ +type UpdateMovingExpenseOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MovingExpense `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseOK creates UpdateMovingExpenseOK with default headers values +func NewUpdateMovingExpenseOK() *UpdateMovingExpenseOK { + + return &UpdateMovingExpenseOK{} +} + +// WithPayload adds the payload to the update moving expense o k response +func (o *UpdateMovingExpenseOK) WithPayload(payload *ghcmessages.MovingExpense) *UpdateMovingExpenseOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense o k response +func (o *UpdateMovingExpenseOK) SetPayload(payload *ghcmessages.MovingExpense) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseBadRequestCode is the HTTP code returned for type UpdateMovingExpenseBadRequest +const UpdateMovingExpenseBadRequestCode int = 400 + +/* +UpdateMovingExpenseBadRequest The request payload is invalid + +swagger:response updateMovingExpenseBadRequest +*/ +type UpdateMovingExpenseBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseBadRequest creates UpdateMovingExpenseBadRequest with default headers values +func NewUpdateMovingExpenseBadRequest() *UpdateMovingExpenseBadRequest { + + return &UpdateMovingExpenseBadRequest{} +} + +// WithPayload adds the payload to the update moving expense bad request response +func (o *UpdateMovingExpenseBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense bad request response +func (o *UpdateMovingExpenseBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseUnauthorizedCode is the HTTP code returned for type UpdateMovingExpenseUnauthorized +const UpdateMovingExpenseUnauthorizedCode int = 401 + +/* +UpdateMovingExpenseUnauthorized The request was denied + +swagger:response updateMovingExpenseUnauthorized +*/ +type UpdateMovingExpenseUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseUnauthorized creates UpdateMovingExpenseUnauthorized with default headers values +func NewUpdateMovingExpenseUnauthorized() *UpdateMovingExpenseUnauthorized { + + return &UpdateMovingExpenseUnauthorized{} +} + +// WithPayload adds the payload to the update moving expense unauthorized response +func (o *UpdateMovingExpenseUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense unauthorized response +func (o *UpdateMovingExpenseUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseForbiddenCode is the HTTP code returned for type UpdateMovingExpenseForbidden +const UpdateMovingExpenseForbiddenCode int = 403 + +/* +UpdateMovingExpenseForbidden The request was denied + +swagger:response updateMovingExpenseForbidden +*/ +type UpdateMovingExpenseForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseForbidden creates UpdateMovingExpenseForbidden with default headers values +func NewUpdateMovingExpenseForbidden() *UpdateMovingExpenseForbidden { + + return &UpdateMovingExpenseForbidden{} +} + +// WithPayload adds the payload to the update moving expense forbidden response +func (o *UpdateMovingExpenseForbidden) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense forbidden response +func (o *UpdateMovingExpenseForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseNotFoundCode is the HTTP code returned for type UpdateMovingExpenseNotFound +const UpdateMovingExpenseNotFoundCode int = 404 + +/* +UpdateMovingExpenseNotFound The requested resource wasn't found + +swagger:response updateMovingExpenseNotFound +*/ +type UpdateMovingExpenseNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseNotFound creates UpdateMovingExpenseNotFound with default headers values +func NewUpdateMovingExpenseNotFound() *UpdateMovingExpenseNotFound { + + return &UpdateMovingExpenseNotFound{} +} + +// WithPayload adds the payload to the update moving expense not found response +func (o *UpdateMovingExpenseNotFound) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense not found response +func (o *UpdateMovingExpenseNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpensePreconditionFailedCode is the HTTP code returned for type UpdateMovingExpensePreconditionFailed +const UpdateMovingExpensePreconditionFailedCode int = 412 + +/* +UpdateMovingExpensePreconditionFailed Precondition failed + +swagger:response updateMovingExpensePreconditionFailed +*/ +type UpdateMovingExpensePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpensePreconditionFailed creates UpdateMovingExpensePreconditionFailed with default headers values +func NewUpdateMovingExpensePreconditionFailed() *UpdateMovingExpensePreconditionFailed { + + return &UpdateMovingExpensePreconditionFailed{} +} + +// WithPayload adds the payload to the update moving expense precondition failed response +func (o *UpdateMovingExpensePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpensePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense precondition failed response +func (o *UpdateMovingExpensePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateMovingExpenseUnprocessableEntity +const UpdateMovingExpenseUnprocessableEntityCode int = 422 + +/* +UpdateMovingExpenseUnprocessableEntity The payload was unprocessable. + +swagger:response updateMovingExpenseUnprocessableEntity +*/ +type UpdateMovingExpenseUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseUnprocessableEntity creates UpdateMovingExpenseUnprocessableEntity with default headers values +func NewUpdateMovingExpenseUnprocessableEntity() *UpdateMovingExpenseUnprocessableEntity { + + return &UpdateMovingExpenseUnprocessableEntity{} +} + +// WithPayload adds the payload to the update moving expense unprocessable entity response +func (o *UpdateMovingExpenseUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateMovingExpenseUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense unprocessable entity response +func (o *UpdateMovingExpenseUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseInternalServerErrorCode is the HTTP code returned for type UpdateMovingExpenseInternalServerError +const UpdateMovingExpenseInternalServerErrorCode int = 500 + +/* +UpdateMovingExpenseInternalServerError A server error occurred + +swagger:response updateMovingExpenseInternalServerError +*/ +type UpdateMovingExpenseInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseInternalServerError creates UpdateMovingExpenseInternalServerError with default headers values +func NewUpdateMovingExpenseInternalServerError() *UpdateMovingExpenseInternalServerError { + + return &UpdateMovingExpenseInternalServerError{} +} + +// WithPayload adds the payload to the update moving expense internal server error response +func (o *UpdateMovingExpenseInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateMovingExpenseInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense internal server error response +func (o *UpdateMovingExpenseInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go new file mode 100644 index 00000000000..de39727106b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_moving_expense_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMovingExpenseURL generates an URL for the update moving expense operation +type UpdateMovingExpenseURL struct { + MovingExpenseID strfmt.UUID + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMovingExpenseURL) WithBasePath(bp string) *UpdateMovingExpenseURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMovingExpenseURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMovingExpenseURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" + + movingExpenseID := o.MovingExpenseID.String() + if movingExpenseID != "" { + _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) + } else { + return nil, errors.New("movingExpenseId is required on UpdateMovingExpenseURL") + } + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateMovingExpenseURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMovingExpenseURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMovingExpenseURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMovingExpenseURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMovingExpenseURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go new file mode 100644 index 00000000000..9151318adb2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdatePPMSITHandlerFunc turns a function with the right signature into a update p p m s i t handler +type UpdatePPMSITHandlerFunc func(UpdatePPMSITParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdatePPMSITHandlerFunc) Handle(params UpdatePPMSITParams) middleware.Responder { + return fn(params) +} + +// UpdatePPMSITHandler interface for that can handle valid update p p m s i t params +type UpdatePPMSITHandler interface { + Handle(UpdatePPMSITParams) middleware.Responder +} + +// NewUpdatePPMSIT creates a new http.Handler for the update p p m s i t operation +func NewUpdatePPMSIT(ctx *middleware.Context, handler UpdatePPMSITHandler) *UpdatePPMSIT { + return &UpdatePPMSIT{Context: ctx, Handler: handler} +} + +/* + UpdatePPMSIT swagger:route PATCH /ppm-shipments/{ppmShipmentId}/ppm-sit ppm updatePPMSIT + +# Updates a PPM shipment's SIT values + +Updates a PPM shipment's SIT values +*/ +type UpdatePPMSIT struct { + Context *middleware.Context + Handler UpdatePPMSITHandler +} + +func (o *UpdatePPMSIT) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdatePPMSITParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go new file mode 100644 index 00000000000..13b0433528a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_parameters.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdatePPMSITParams creates a new UpdatePPMSITParams object +// +// There are no default values defined in the spec. +func NewUpdatePPMSITParams() UpdatePPMSITParams { + + return UpdatePPMSITParams{} +} + +// UpdatePPMSITParams contains all the bound params for the update p p m s i t operation +// typically these are obtained from a http.Request +// +// swagger:parameters updatePPMSIT +type UpdatePPMSITParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + In: body + */ + Body *ghcmessages.PPMShipmentSIT + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdatePPMSITParams() beforehand. +func (o *UpdatePPMSITParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.PPMShipmentSIT + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdatePPMSITParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdatePPMSITParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdatePPMSITParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go new file mode 100644 index 00000000000..f2ed2f59b26 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdatePPMSITOKCode is the HTTP code returned for type UpdatePPMSITOK +const UpdatePPMSITOKCode int = 200 + +/* +UpdatePPMSITOK Successfully finished PPM SIT update + +swagger:response updatePPMSITOK +*/ +type UpdatePPMSITOK struct { + + /* + In: Body + */ + Payload *ghcmessages.PPMShipment `json:"body,omitempty"` +} + +// NewUpdatePPMSITOK creates UpdatePPMSITOK with default headers values +func NewUpdatePPMSITOK() *UpdatePPMSITOK { + + return &UpdatePPMSITOK{} +} + +// WithPayload adds the payload to the update p p m s i t o k response +func (o *UpdatePPMSITOK) WithPayload(payload *ghcmessages.PPMShipment) *UpdatePPMSITOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t o k response +func (o *UpdatePPMSITOK) SetPayload(payload *ghcmessages.PPMShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITBadRequestCode is the HTTP code returned for type UpdatePPMSITBadRequest +const UpdatePPMSITBadRequestCode int = 400 + +/* +UpdatePPMSITBadRequest The request payload is invalid + +swagger:response updatePPMSITBadRequest +*/ +type UpdatePPMSITBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePPMSITBadRequest creates UpdatePPMSITBadRequest with default headers values +func NewUpdatePPMSITBadRequest() *UpdatePPMSITBadRequest { + + return &UpdatePPMSITBadRequest{} +} + +// WithPayload adds the payload to the update p p m s i t bad request response +func (o *UpdatePPMSITBadRequest) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t bad request response +func (o *UpdatePPMSITBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITForbiddenCode is the HTTP code returned for type UpdatePPMSITForbidden +const UpdatePPMSITForbiddenCode int = 403 + +/* +UpdatePPMSITForbidden The request was denied + +swagger:response updatePPMSITForbidden +*/ +type UpdatePPMSITForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePPMSITForbidden creates UpdatePPMSITForbidden with default headers values +func NewUpdatePPMSITForbidden() *UpdatePPMSITForbidden { + + return &UpdatePPMSITForbidden{} +} + +// WithPayload adds the payload to the update p p m s i t forbidden response +func (o *UpdatePPMSITForbidden) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t forbidden response +func (o *UpdatePPMSITForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITNotFoundCode is the HTTP code returned for type UpdatePPMSITNotFound +const UpdatePPMSITNotFoundCode int = 404 + +/* +UpdatePPMSITNotFound The requested resource wasn't found + +swagger:response updatePPMSITNotFound +*/ +type UpdatePPMSITNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePPMSITNotFound creates UpdatePPMSITNotFound with default headers values +func NewUpdatePPMSITNotFound() *UpdatePPMSITNotFound { + + return &UpdatePPMSITNotFound{} +} + +// WithPayload adds the payload to the update p p m s i t not found response +func (o *UpdatePPMSITNotFound) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t not found response +func (o *UpdatePPMSITNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITPreconditionFailedCode is the HTTP code returned for type UpdatePPMSITPreconditionFailed +const UpdatePPMSITPreconditionFailedCode int = 412 + +/* +UpdatePPMSITPreconditionFailed Precondition failed + +swagger:response updatePPMSITPreconditionFailed +*/ +type UpdatePPMSITPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePPMSITPreconditionFailed creates UpdatePPMSITPreconditionFailed with default headers values +func NewUpdatePPMSITPreconditionFailed() *UpdatePPMSITPreconditionFailed { + + return &UpdatePPMSITPreconditionFailed{} +} + +// WithPayload adds the payload to the update p p m s i t precondition failed response +func (o *UpdatePPMSITPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t precondition failed response +func (o *UpdatePPMSITPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITUnprocessableEntityCode is the HTTP code returned for type UpdatePPMSITUnprocessableEntity +const UpdatePPMSITUnprocessableEntityCode int = 422 + +/* +UpdatePPMSITUnprocessableEntity The payload was unprocessable. + +swagger:response updatePPMSITUnprocessableEntity +*/ +type UpdatePPMSITUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdatePPMSITUnprocessableEntity creates UpdatePPMSITUnprocessableEntity with default headers values +func NewUpdatePPMSITUnprocessableEntity() *UpdatePPMSITUnprocessableEntity { + + return &UpdatePPMSITUnprocessableEntity{} +} + +// WithPayload adds the payload to the update p p m s i t unprocessable entity response +func (o *UpdatePPMSITUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdatePPMSITUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t unprocessable entity response +func (o *UpdatePPMSITUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePPMSITInternalServerErrorCode is the HTTP code returned for type UpdatePPMSITInternalServerError +const UpdatePPMSITInternalServerErrorCode int = 500 + +/* +UpdatePPMSITInternalServerError A server error occurred + +swagger:response updatePPMSITInternalServerError +*/ +type UpdatePPMSITInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePPMSITInternalServerError creates UpdatePPMSITInternalServerError with default headers values +func NewUpdatePPMSITInternalServerError() *UpdatePPMSITInternalServerError { + + return &UpdatePPMSITInternalServerError{} +} + +// WithPayload adds the payload to the update p p m s i t internal server error response +func (o *UpdatePPMSITInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdatePPMSITInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update p p m s i t internal server error response +func (o *UpdatePPMSITInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePPMSITInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go new file mode 100644 index 00000000000..569016d2412 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_p_p_m_s_i_t_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdatePPMSITURL generates an URL for the update p p m s i t operation +type UpdatePPMSITURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePPMSITURL) WithBasePath(bp string) *UpdatePPMSITURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePPMSITURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdatePPMSITURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/ppm-sit" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdatePPMSITURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdatePPMSITURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdatePPMSITURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdatePPMSITURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdatePPMSITURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdatePPMSITURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdatePPMSITURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..548bc7605a1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateProGearWeightTicketHandlerFunc turns a function with the right signature into a update pro gear weight ticket handler +type UpdateProGearWeightTicketHandlerFunc func(UpdateProGearWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateProGearWeightTicketHandlerFunc) Handle(params UpdateProGearWeightTicketParams) middleware.Responder { + return fn(params) +} + +// UpdateProGearWeightTicketHandler interface for that can handle valid update pro gear weight ticket params +type UpdateProGearWeightTicketHandler interface { + Handle(UpdateProGearWeightTicketParams) middleware.Responder +} + +// NewUpdateProGearWeightTicket creates a new http.Handler for the update pro gear weight ticket operation +func NewUpdateProGearWeightTicket(ctx *middleware.Context, handler UpdateProGearWeightTicketHandler) *UpdateProGearWeightTicket { + return &UpdateProGearWeightTicket{Context: ctx, Handler: handler} +} + +/* + UpdateProGearWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm updateProGearWeightTicket + +# Updates a pro-gear weight ticket + +Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable +because some have to be set by the customer, e.g. the description. +*/ +type UpdateProGearWeightTicket struct { + Context *middleware.Context + Handler UpdateProGearWeightTicketHandler +} + +func (o *UpdateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateProGearWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go new file mode 100644 index 00000000000..31aef97d6dc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateProGearWeightTicketParams creates a new UpdateProGearWeightTicketParams object +// +// There are no default values defined in the spec. +func NewUpdateProGearWeightTicketParams() UpdateProGearWeightTicketParams { + + return UpdateProGearWeightTicketParams{} +} + +// UpdateProGearWeightTicketParams contains all the bound params for the update pro gear weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateProGearWeightTicket +type UpdateProGearWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*UUID of the pro-gear weight ticket + Required: true + In: path + */ + ProGearWeightTicketID strfmt.UUID + /* + Required: true + In: body + */ + UpdateProGearWeightTicket *ghcmessages.UpdateProGearWeightTicket +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateProGearWeightTicketParams() beforehand. +func (o *UpdateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") + if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateProGearWeightTicket + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) + } else { + res = append(res, errors.NewParseError("updateProGearWeightTicket", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateProGearWeightTicket = &body + } + } + } else { + res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateProGearWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. +func (o *UpdateProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) + } + o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateProGearWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID +func (o *UpdateProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go new file mode 100644 index 00000000000..a36a4622ce2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateProGearWeightTicketOKCode is the HTTP code returned for type UpdateProGearWeightTicketOK +const UpdateProGearWeightTicketOKCode int = 200 + +/* +UpdateProGearWeightTicketOK returns an updated pro-gear weight ticket object + +swagger:response updateProGearWeightTicketOK +*/ +type UpdateProGearWeightTicketOK struct { + + /* + In: Body + */ + Payload *ghcmessages.ProGearWeightTicket `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketOK creates UpdateProGearWeightTicketOK with default headers values +func NewUpdateProGearWeightTicketOK() *UpdateProGearWeightTicketOK { + + return &UpdateProGearWeightTicketOK{} +} + +// WithPayload adds the payload to the update pro gear weight ticket o k response +func (o *UpdateProGearWeightTicketOK) WithPayload(payload *ghcmessages.ProGearWeightTicket) *UpdateProGearWeightTicketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket o k response +func (o *UpdateProGearWeightTicketOK) SetPayload(payload *ghcmessages.ProGearWeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketBadRequestCode is the HTTP code returned for type UpdateProGearWeightTicketBadRequest +const UpdateProGearWeightTicketBadRequestCode int = 400 + +/* +UpdateProGearWeightTicketBadRequest The request payload is invalid + +swagger:response updateProGearWeightTicketBadRequest +*/ +type UpdateProGearWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketBadRequest creates UpdateProGearWeightTicketBadRequest with default headers values +func NewUpdateProGearWeightTicketBadRequest() *UpdateProGearWeightTicketBadRequest { + + return &UpdateProGearWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the update pro gear weight ticket bad request response +func (o *UpdateProGearWeightTicketBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket bad request response +func (o *UpdateProGearWeightTicketBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateProGearWeightTicketUnauthorized +const UpdateProGearWeightTicketUnauthorizedCode int = 401 + +/* +UpdateProGearWeightTicketUnauthorized The request was denied + +swagger:response updateProGearWeightTicketUnauthorized +*/ +type UpdateProGearWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketUnauthorized creates UpdateProGearWeightTicketUnauthorized with default headers values +func NewUpdateProGearWeightTicketUnauthorized() *UpdateProGearWeightTicketUnauthorized { + + return &UpdateProGearWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the update pro gear weight ticket unauthorized response +func (o *UpdateProGearWeightTicketUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket unauthorized response +func (o *UpdateProGearWeightTicketUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketForbiddenCode is the HTTP code returned for type UpdateProGearWeightTicketForbidden +const UpdateProGearWeightTicketForbiddenCode int = 403 + +/* +UpdateProGearWeightTicketForbidden The request was denied + +swagger:response updateProGearWeightTicketForbidden +*/ +type UpdateProGearWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketForbidden creates UpdateProGearWeightTicketForbidden with default headers values +func NewUpdateProGearWeightTicketForbidden() *UpdateProGearWeightTicketForbidden { + + return &UpdateProGearWeightTicketForbidden{} +} + +// WithPayload adds the payload to the update pro gear weight ticket forbidden response +func (o *UpdateProGearWeightTicketForbidden) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket forbidden response +func (o *UpdateProGearWeightTicketForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketNotFoundCode is the HTTP code returned for type UpdateProGearWeightTicketNotFound +const UpdateProGearWeightTicketNotFoundCode int = 404 + +/* +UpdateProGearWeightTicketNotFound The requested resource wasn't found + +swagger:response updateProGearWeightTicketNotFound +*/ +type UpdateProGearWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketNotFound creates UpdateProGearWeightTicketNotFound with default headers values +func NewUpdateProGearWeightTicketNotFound() *UpdateProGearWeightTicketNotFound { + + return &UpdateProGearWeightTicketNotFound{} +} + +// WithPayload adds the payload to the update pro gear weight ticket not found response +func (o *UpdateProGearWeightTicketNotFound) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket not found response +func (o *UpdateProGearWeightTicketNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateProGearWeightTicketPreconditionFailed +const UpdateProGearWeightTicketPreconditionFailedCode int = 412 + +/* +UpdateProGearWeightTicketPreconditionFailed Precondition failed + +swagger:response updateProGearWeightTicketPreconditionFailed +*/ +type UpdateProGearWeightTicketPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketPreconditionFailed creates UpdateProGearWeightTicketPreconditionFailed with default headers values +func NewUpdateProGearWeightTicketPreconditionFailed() *UpdateProGearWeightTicketPreconditionFailed { + + return &UpdateProGearWeightTicketPreconditionFailed{} +} + +// WithPayload adds the payload to the update pro gear weight ticket precondition failed response +func (o *UpdateProGearWeightTicketPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket precondition failed response +func (o *UpdateProGearWeightTicketPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateProGearWeightTicketUnprocessableEntity +const UpdateProGearWeightTicketUnprocessableEntityCode int = 422 + +/* +UpdateProGearWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response updateProGearWeightTicketUnprocessableEntity +*/ +type UpdateProGearWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketUnprocessableEntity creates UpdateProGearWeightTicketUnprocessableEntity with default headers values +func NewUpdateProGearWeightTicketUnprocessableEntity() *UpdateProGearWeightTicketUnprocessableEntity { + + return &UpdateProGearWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the update pro gear weight ticket unprocessable entity response +func (o *UpdateProGearWeightTicketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateProGearWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket unprocessable entity response +func (o *UpdateProGearWeightTicketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateProGearWeightTicketInternalServerError +const UpdateProGearWeightTicketInternalServerErrorCode int = 500 + +/* +UpdateProGearWeightTicketInternalServerError A server error occurred + +swagger:response updateProGearWeightTicketInternalServerError +*/ +type UpdateProGearWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketInternalServerError creates UpdateProGearWeightTicketInternalServerError with default headers values +func NewUpdateProGearWeightTicketInternalServerError() *UpdateProGearWeightTicketInternalServerError { + + return &UpdateProGearWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the update pro gear weight ticket internal server error response +func (o *UpdateProGearWeightTicketInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateProGearWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket internal server error response +func (o *UpdateProGearWeightTicketInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..9cab7f6cd14 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateProGearWeightTicketURL generates an URL for the update pro gear weight ticket operation +type UpdateProGearWeightTicketURL struct { + PpmShipmentID strfmt.UUID + ProGearWeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateProGearWeightTicketURL) WithBasePath(bp string) *UpdateProGearWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateProGearWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateProGearWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateProGearWeightTicketURL") + } + + proGearWeightTicketID := o.ProGearWeightTicketID.String() + if proGearWeightTicketID != "" { + _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) + } else { + return nil, errors.New("proGearWeightTicketId is required on UpdateProGearWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateProGearWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateProGearWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateProGearWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateProGearWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go new file mode 100644 index 00000000000..63d222745ae --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateWeightTicketHandlerFunc turns a function with the right signature into a update weight ticket handler +type UpdateWeightTicketHandlerFunc func(UpdateWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateWeightTicketHandlerFunc) Handle(params UpdateWeightTicketParams) middleware.Responder { + return fn(params) +} + +// UpdateWeightTicketHandler interface for that can handle valid update weight ticket params +type UpdateWeightTicketHandler interface { + Handle(UpdateWeightTicketParams) middleware.Responder +} + +// NewUpdateWeightTicket creates a new http.Handler for the update weight ticket operation +func NewUpdateWeightTicket(ctx *middleware.Context, handler UpdateWeightTicketHandler) *UpdateWeightTicket { + return &UpdateWeightTicket{Context: ctx, Handler: handler} +} + +/* + UpdateWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm updateWeightTicket + +# Updates a weight ticket document + +Updates a PPM shipment's weight ticket document with new information. Only some of the weight ticket document's +fields are editable because some have to be set by the customer, e.g. vehicle description. +*/ +type UpdateWeightTicket struct { + Context *middleware.Context + Handler UpdateWeightTicketHandler +} + +func (o *UpdateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go new file mode 100644 index 00000000000..9eb43a27983 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateWeightTicketParams creates a new UpdateWeightTicketParams object +// +// There are no default values defined in the spec. +func NewUpdateWeightTicketParams() UpdateWeightTicketParams { + + return UpdateWeightTicketParams{} +} + +// UpdateWeightTicketParams contains all the bound params for the update weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateWeightTicket +type UpdateWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + UpdateWeightTicketPayload *ghcmessages.UpdateWeightTicket + /*UUID of the weight ticket + Required: true + In: path + */ + WeightTicketID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateWeightTicketParams() beforehand. +func (o *UpdateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateWeightTicket + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("updateWeightTicketPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateWeightTicketPayload = &body + } + } + } else { + res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) + } + + rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") + if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindWeightTicketID binds and validates parameter WeightTicketID from path. +func (o *UpdateWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) + } + o.WeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateWeightTicketID carries on validations for parameter WeightTicketID +func (o *UpdateWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go new file mode 100644 index 00000000000..fcce2648a02 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateWeightTicketOKCode is the HTTP code returned for type UpdateWeightTicketOK +const UpdateWeightTicketOKCode int = 200 + +/* +UpdateWeightTicketOK returns an updated weight ticket object + +swagger:response updateWeightTicketOK +*/ +type UpdateWeightTicketOK struct { + + /* + In: Body + */ + Payload *ghcmessages.WeightTicket `json:"body,omitempty"` +} + +// NewUpdateWeightTicketOK creates UpdateWeightTicketOK with default headers values +func NewUpdateWeightTicketOK() *UpdateWeightTicketOK { + + return &UpdateWeightTicketOK{} +} + +// WithPayload adds the payload to the update weight ticket o k response +func (o *UpdateWeightTicketOK) WithPayload(payload *ghcmessages.WeightTicket) *UpdateWeightTicketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket o k response +func (o *UpdateWeightTicketOK) SetPayload(payload *ghcmessages.WeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketBadRequestCode is the HTTP code returned for type UpdateWeightTicketBadRequest +const UpdateWeightTicketBadRequestCode int = 400 + +/* +UpdateWeightTicketBadRequest The request payload is invalid + +swagger:response updateWeightTicketBadRequest +*/ +type UpdateWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketBadRequest creates UpdateWeightTicketBadRequest with default headers values +func NewUpdateWeightTicketBadRequest() *UpdateWeightTicketBadRequest { + + return &UpdateWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the update weight ticket bad request response +func (o *UpdateWeightTicketBadRequest) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket bad request response +func (o *UpdateWeightTicketBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateWeightTicketUnauthorized +const UpdateWeightTicketUnauthorizedCode int = 401 + +/* +UpdateWeightTicketUnauthorized The request was denied + +swagger:response updateWeightTicketUnauthorized +*/ +type UpdateWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketUnauthorized creates UpdateWeightTicketUnauthorized with default headers values +func NewUpdateWeightTicketUnauthorized() *UpdateWeightTicketUnauthorized { + + return &UpdateWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the update weight ticket unauthorized response +func (o *UpdateWeightTicketUnauthorized) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket unauthorized response +func (o *UpdateWeightTicketUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketForbiddenCode is the HTTP code returned for type UpdateWeightTicketForbidden +const UpdateWeightTicketForbiddenCode int = 403 + +/* +UpdateWeightTicketForbidden The request was denied + +swagger:response updateWeightTicketForbidden +*/ +type UpdateWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketForbidden creates UpdateWeightTicketForbidden with default headers values +func NewUpdateWeightTicketForbidden() *UpdateWeightTicketForbidden { + + return &UpdateWeightTicketForbidden{} +} + +// WithPayload adds the payload to the update weight ticket forbidden response +func (o *UpdateWeightTicketForbidden) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket forbidden response +func (o *UpdateWeightTicketForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketNotFoundCode is the HTTP code returned for type UpdateWeightTicketNotFound +const UpdateWeightTicketNotFoundCode int = 404 + +/* +UpdateWeightTicketNotFound The requested resource wasn't found + +swagger:response updateWeightTicketNotFound +*/ +type UpdateWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketNotFound creates UpdateWeightTicketNotFound with default headers values +func NewUpdateWeightTicketNotFound() *UpdateWeightTicketNotFound { + + return &UpdateWeightTicketNotFound{} +} + +// WithPayload adds the payload to the update weight ticket not found response +func (o *UpdateWeightTicketNotFound) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket not found response +func (o *UpdateWeightTicketNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateWeightTicketPreconditionFailed +const UpdateWeightTicketPreconditionFailedCode int = 412 + +/* +UpdateWeightTicketPreconditionFailed Precondition failed + +swagger:response updateWeightTicketPreconditionFailed +*/ +type UpdateWeightTicketPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketPreconditionFailed creates UpdateWeightTicketPreconditionFailed with default headers values +func NewUpdateWeightTicketPreconditionFailed() *UpdateWeightTicketPreconditionFailed { + + return &UpdateWeightTicketPreconditionFailed{} +} + +// WithPayload adds the payload to the update weight ticket precondition failed response +func (o *UpdateWeightTicketPreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket precondition failed response +func (o *UpdateWeightTicketPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateWeightTicketUnprocessableEntity +const UpdateWeightTicketUnprocessableEntityCode int = 422 + +/* +UpdateWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response updateWeightTicketUnprocessableEntity +*/ +type UpdateWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketUnprocessableEntity creates UpdateWeightTicketUnprocessableEntity with default headers values +func NewUpdateWeightTicketUnprocessableEntity() *UpdateWeightTicketUnprocessableEntity { + + return &UpdateWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the update weight ticket unprocessable entity response +func (o *UpdateWeightTicketUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket unprocessable entity response +func (o *UpdateWeightTicketUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateWeightTicketInternalServerError +const UpdateWeightTicketInternalServerErrorCode int = 500 + +/* +UpdateWeightTicketInternalServerError A server error occurred + +swagger:response updateWeightTicketInternalServerError +*/ +type UpdateWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketInternalServerError creates UpdateWeightTicketInternalServerError with default headers values +func NewUpdateWeightTicketInternalServerError() *UpdateWeightTicketInternalServerError { + + return &UpdateWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the update weight ticket internal server error response +func (o *UpdateWeightTicketInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket internal server error response +func (o *UpdateWeightTicketInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..42504f88cd4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/ppm/update_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateWeightTicketURL generates an URL for the update weight ticket operation +type UpdateWeightTicketURL struct { + PpmShipmentID strfmt.UUID + WeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWeightTicketURL) WithBasePath(bp string) *UpdateWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateWeightTicketURL") + } + + weightTicketID := o.WeightTicketID.String() + if weightTicketID != "" { + _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) + } else { + return nil, errors.New("weightTicketId is required on UpdateWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go new file mode 100644 index 00000000000..583bacfda5f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pws_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPWSViolationsHandlerFunc turns a function with the right signature into a get p w s violations handler +type GetPWSViolationsHandlerFunc func(GetPWSViolationsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPWSViolationsHandlerFunc) Handle(params GetPWSViolationsParams) middleware.Responder { + return fn(params) +} + +// GetPWSViolationsHandler interface for that can handle valid get p w s violations params +type GetPWSViolationsHandler interface { + Handle(GetPWSViolationsParams) middleware.Responder +} + +// NewGetPWSViolations creates a new http.Handler for the get p w s violations operation +func NewGetPWSViolations(ctx *middleware.Context, handler GetPWSViolationsHandler) *GetPWSViolations { + return &GetPWSViolations{Context: ctx, Handler: handler} +} + +/* + GetPWSViolations swagger:route GET /pws-violations pwsViolations getPWSViolations + +# Fetch the possible PWS violations for an evaluation report + +Fetch the possible PWS violations for an evaluation report +*/ +type GetPWSViolations struct { + Context *middleware.Context + Handler GetPWSViolationsHandler +} + +func (o *GetPWSViolations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPWSViolationsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go new file mode 100644 index 00000000000..ac1a466992a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pws_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetPWSViolationsParams creates a new GetPWSViolationsParams object +// +// There are no default values defined in the spec. +func NewGetPWSViolationsParams() GetPWSViolationsParams { + + return GetPWSViolationsParams{} +} + +// GetPWSViolationsParams contains all the bound params for the get p w s violations operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPWSViolations +type GetPWSViolationsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPWSViolationsParams() beforehand. +func (o *GetPWSViolationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go new file mode 100644 index 00000000000..b18ab1cd2c2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pws_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPWSViolationsOKCode is the HTTP code returned for type GetPWSViolationsOK +const GetPWSViolationsOKCode int = 200 + +/* +GetPWSViolationsOK Successfully retrieved the PWS violations + +swagger:response getPWSViolationsOK +*/ +type GetPWSViolationsOK struct { + + /* + In: Body + */ + Payload ghcmessages.PWSViolations `json:"body,omitempty"` +} + +// NewGetPWSViolationsOK creates GetPWSViolationsOK with default headers values +func NewGetPWSViolationsOK() *GetPWSViolationsOK { + + return &GetPWSViolationsOK{} +} + +// WithPayload adds the payload to the get p w s violations o k response +func (o *GetPWSViolationsOK) WithPayload(payload ghcmessages.PWSViolations) *GetPWSViolationsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p w s violations o k response +func (o *GetPWSViolationsOK) SetPayload(payload ghcmessages.PWSViolations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPWSViolationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.PWSViolations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetPWSViolationsBadRequestCode is the HTTP code returned for type GetPWSViolationsBadRequest +const GetPWSViolationsBadRequestCode int = 400 + +/* +GetPWSViolationsBadRequest The request payload is invalid + +swagger:response getPWSViolationsBadRequest +*/ +type GetPWSViolationsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPWSViolationsBadRequest creates GetPWSViolationsBadRequest with default headers values +func NewGetPWSViolationsBadRequest() *GetPWSViolationsBadRequest { + + return &GetPWSViolationsBadRequest{} +} + +// WithPayload adds the payload to the get p w s violations bad request response +func (o *GetPWSViolationsBadRequest) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p w s violations bad request response +func (o *GetPWSViolationsBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPWSViolationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPWSViolationsForbiddenCode is the HTTP code returned for type GetPWSViolationsForbidden +const GetPWSViolationsForbiddenCode int = 403 + +/* +GetPWSViolationsForbidden The request was denied + +swagger:response getPWSViolationsForbidden +*/ +type GetPWSViolationsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPWSViolationsForbidden creates GetPWSViolationsForbidden with default headers values +func NewGetPWSViolationsForbidden() *GetPWSViolationsForbidden { + + return &GetPWSViolationsForbidden{} +} + +// WithPayload adds the payload to the get p w s violations forbidden response +func (o *GetPWSViolationsForbidden) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p w s violations forbidden response +func (o *GetPWSViolationsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPWSViolationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPWSViolationsNotFoundCode is the HTTP code returned for type GetPWSViolationsNotFound +const GetPWSViolationsNotFoundCode int = 404 + +/* +GetPWSViolationsNotFound The requested resource wasn't found + +swagger:response getPWSViolationsNotFound +*/ +type GetPWSViolationsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPWSViolationsNotFound creates GetPWSViolationsNotFound with default headers values +func NewGetPWSViolationsNotFound() *GetPWSViolationsNotFound { + + return &GetPWSViolationsNotFound{} +} + +// WithPayload adds the payload to the get p w s violations not found response +func (o *GetPWSViolationsNotFound) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p w s violations not found response +func (o *GetPWSViolationsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPWSViolationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPWSViolationsInternalServerErrorCode is the HTTP code returned for type GetPWSViolationsInternalServerError +const GetPWSViolationsInternalServerErrorCode int = 500 + +/* +GetPWSViolationsInternalServerError A server error occurred + +swagger:response getPWSViolationsInternalServerError +*/ +type GetPWSViolationsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPWSViolationsInternalServerError creates GetPWSViolationsInternalServerError with default headers values +func NewGetPWSViolationsInternalServerError() *GetPWSViolationsInternalServerError { + + return &GetPWSViolationsInternalServerError{} +} + +// WithPayload adds the payload to the get p w s violations internal server error response +func (o *GetPWSViolationsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPWSViolationsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get p w s violations internal server error response +func (o *GetPWSViolationsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPWSViolationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go new file mode 100644 index 00000000000..46e5b445ded --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/pws_violations/get_p_w_s_violations_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package pws_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetPWSViolationsURL generates an URL for the get p w s violations operation +type GetPWSViolationsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPWSViolationsURL) WithBasePath(bp string) *GetPWSViolationsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPWSViolationsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPWSViolationsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/pws-violations" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPWSViolationsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPWSViolationsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPWSViolationsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPWSViolationsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPWSViolationsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPWSViolationsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go new file mode 100644 index 00000000000..a48fbcedc45 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetBulkAssignmentDataHandlerFunc turns a function with the right signature into a get bulk assignment data handler +type GetBulkAssignmentDataHandlerFunc func(GetBulkAssignmentDataParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetBulkAssignmentDataHandlerFunc) Handle(params GetBulkAssignmentDataParams) middleware.Responder { + return fn(params) +} + +// GetBulkAssignmentDataHandler interface for that can handle valid get bulk assignment data params +type GetBulkAssignmentDataHandler interface { + Handle(GetBulkAssignmentDataParams) middleware.Responder +} + +// NewGetBulkAssignmentData creates a new http.Handler for the get bulk assignment data operation +func NewGetBulkAssignmentData(ctx *middleware.Context, handler GetBulkAssignmentDataHandler) *GetBulkAssignmentData { + return &GetBulkAssignmentData{Context: ctx, Handler: handler} +} + +/* + GetBulkAssignmentData swagger:route GET /queues/bulk-assignment queues getBulkAssignmentData + +# Gets data for bulk assignment modal + +Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned +*/ +type GetBulkAssignmentData struct { + Context *middleware.Context + Handler GetBulkAssignmentDataHandler +} + +func (o *GetBulkAssignmentData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetBulkAssignmentDataParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go new file mode 100644 index 00000000000..84675ac3ec4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetBulkAssignmentDataParams creates a new GetBulkAssignmentDataParams object +// +// There are no default values defined in the spec. +func NewGetBulkAssignmentDataParams() GetBulkAssignmentDataParams { + + return GetBulkAssignmentDataParams{} +} + +// GetBulkAssignmentDataParams contains all the bound params for the get bulk assignment data operation +// typically these are obtained from a http.Request +// +// swagger:parameters getBulkAssignmentData +type GetBulkAssignmentDataParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*A string corresponding to the queue type + In: query + */ + QueueType *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetBulkAssignmentDataParams() beforehand. +func (o *GetBulkAssignmentDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qQueueType, qhkQueueType, _ := qs.GetOK("queueType") + if err := o.bindQueueType(qQueueType, qhkQueueType, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindQueueType binds and validates parameter QueueType from query. +func (o *GetBulkAssignmentDataParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.QueueType = &raw + + if err := o.validateQueueType(formats); err != nil { + return err + } + + return nil +} + +// validateQueueType carries on validations for parameter QueueType +func (o *GetBulkAssignmentDataParams) validateQueueType(formats strfmt.Registry) error { + + if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER", "PAYMENT_REQUEST"}, true); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go new file mode 100644 index 00000000000..7aff474a411 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_responses.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetBulkAssignmentDataOKCode is the HTTP code returned for type GetBulkAssignmentDataOK +const GetBulkAssignmentDataOKCode int = 200 + +/* +GetBulkAssignmentDataOK Successfully returned bulk assignment data + +swagger:response getBulkAssignmentDataOK +*/ +type GetBulkAssignmentDataOK struct { + + /* + In: Body + */ + Payload *ghcmessages.BulkAssignmentData `json:"body,omitempty"` +} + +// NewGetBulkAssignmentDataOK creates GetBulkAssignmentDataOK with default headers values +func NewGetBulkAssignmentDataOK() *GetBulkAssignmentDataOK { + + return &GetBulkAssignmentDataOK{} +} + +// WithPayload adds the payload to the get bulk assignment data o k response +func (o *GetBulkAssignmentDataOK) WithPayload(payload *ghcmessages.BulkAssignmentData) *GetBulkAssignmentDataOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment data o k response +func (o *GetBulkAssignmentDataOK) SetPayload(payload *ghcmessages.BulkAssignmentData) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentDataUnauthorizedCode is the HTTP code returned for type GetBulkAssignmentDataUnauthorized +const GetBulkAssignmentDataUnauthorizedCode int = 401 + +/* +GetBulkAssignmentDataUnauthorized The request was denied + +swagger:response getBulkAssignmentDataUnauthorized +*/ +type GetBulkAssignmentDataUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentDataUnauthorized creates GetBulkAssignmentDataUnauthorized with default headers values +func NewGetBulkAssignmentDataUnauthorized() *GetBulkAssignmentDataUnauthorized { + + return &GetBulkAssignmentDataUnauthorized{} +} + +// WithPayload adds the payload to the get bulk assignment data unauthorized response +func (o *GetBulkAssignmentDataUnauthorized) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment data unauthorized response +func (o *GetBulkAssignmentDataUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentDataNotFoundCode is the HTTP code returned for type GetBulkAssignmentDataNotFound +const GetBulkAssignmentDataNotFoundCode int = 404 + +/* +GetBulkAssignmentDataNotFound The requested resource wasn't found + +swagger:response getBulkAssignmentDataNotFound +*/ +type GetBulkAssignmentDataNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentDataNotFound creates GetBulkAssignmentDataNotFound with default headers values +func NewGetBulkAssignmentDataNotFound() *GetBulkAssignmentDataNotFound { + + return &GetBulkAssignmentDataNotFound{} +} + +// WithPayload adds the payload to the get bulk assignment data not found response +func (o *GetBulkAssignmentDataNotFound) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment data not found response +func (o *GetBulkAssignmentDataNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentDataNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetBulkAssignmentDataInternalServerErrorCode is the HTTP code returned for type GetBulkAssignmentDataInternalServerError +const GetBulkAssignmentDataInternalServerErrorCode int = 500 + +/* +GetBulkAssignmentDataInternalServerError A server error occurred + +swagger:response getBulkAssignmentDataInternalServerError +*/ +type GetBulkAssignmentDataInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetBulkAssignmentDataInternalServerError creates GetBulkAssignmentDataInternalServerError with default headers values +func NewGetBulkAssignmentDataInternalServerError() *GetBulkAssignmentDataInternalServerError { + + return &GetBulkAssignmentDataInternalServerError{} +} + +// WithPayload adds the payload to the get bulk assignment data internal server error response +func (o *GetBulkAssignmentDataInternalServerError) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentDataInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get bulk assignment data internal server error response +func (o *GetBulkAssignmentDataInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetBulkAssignmentDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go new file mode 100644 index 00000000000..eda687319c9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_urlbuilder.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetBulkAssignmentDataURL generates an URL for the get bulk assignment data operation +type GetBulkAssignmentDataURL struct { + QueueType *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetBulkAssignmentDataURL) WithBasePath(bp string) *GetBulkAssignmentDataURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetBulkAssignmentDataURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetBulkAssignmentDataURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/bulk-assignment" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var queueTypeQ string + if o.QueueType != nil { + queueTypeQ = *o.QueueType + } + if queueTypeQ != "" { + qs.Set("queueType", queueTypeQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetBulkAssignmentDataURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetBulkAssignmentDataURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetBulkAssignmentDataURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetBulkAssignmentDataURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetBulkAssignmentDataURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetBulkAssignmentDataURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go new file mode 100644 index 00000000000..2683d984fed --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMovesQueueHandlerFunc turns a function with the right signature into a get moves queue handler +type GetMovesQueueHandlerFunc func(GetMovesQueueParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMovesQueueHandlerFunc) Handle(params GetMovesQueueParams) middleware.Responder { + return fn(params) +} + +// GetMovesQueueHandler interface for that can handle valid get moves queue params +type GetMovesQueueHandler interface { + Handle(GetMovesQueueParams) middleware.Responder +} + +// NewGetMovesQueue creates a new http.Handler for the get moves queue operation +func NewGetMovesQueue(ctx *middleware.Context, handler GetMovesQueueHandler) *GetMovesQueue { + return &GetMovesQueue{Context: ctx, Handler: handler} +} + +/* + GetMovesQueue swagger:route GET /queues/moves queues getMovesQueue + +# Gets queued list of all customer moves by GBLOC origin + +An office TOO user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the submitted status sent by the customer and have move task orders, shipments, and service items to approve. +*/ +type GetMovesQueue struct { + Context *middleware.Context + Handler GetMovesQueueHandler +} + +func (o *GetMovesQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMovesQueueParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go new file mode 100644 index 00000000000..f1cfe32cfae --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go @@ -0,0 +1,644 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewGetMovesQueueParams creates a new GetMovesQueueParams object +// +// There are no default values defined in the spec. +func NewGetMovesQueueParams() GetMovesQueueParams { + + return GetMovesQueueParams{} +} + +// GetMovesQueueParams contains all the bound params for the get moves queue operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMovesQueue +type GetMovesQueueParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + AppearedInTooAt *strfmt.DateTime + /*Used to illustrate which user is assigned to this move. + + In: query + */ + AssignedTo *string + /* + In: query + */ + Branch *string + /*filters using a counselingOffice name of the move + In: query + */ + CounselingOffice *string + /* + In: query + */ + CustomerName *string + /* + In: query + */ + DestinationDutyLocation *string + /* + In: query + */ + Edipi *string + /* + In: query + */ + Emplid *string + /* + In: query + */ + Locator *string + /*direction of sort order if applied + In: query + */ + Order *string + /*order type + In: query + */ + OrderType *string + /* + Unique: true + In: query + Collection Format: multi + */ + OriginDutyLocation []string + /*requested page of results + In: query + */ + Page *int64 + /*results per page + In: query + */ + PerPage *int64 + /*filters the requested pickup date of a shipment on the move + In: query + */ + RequestedMoveDate *string + /*field that results should be sorted by + In: query + */ + Sort *string + /*Filtering for the status. + Unique: true + In: query + */ + Status []string + /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + + In: query + */ + ViewAsGBLOC *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMovesQueueParams() beforehand. +func (o *GetMovesQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qAppearedInTooAt, qhkAppearedInTooAt, _ := qs.GetOK("appearedInTooAt") + if err := o.bindAppearedInTooAt(qAppearedInTooAt, qhkAppearedInTooAt, route.Formats); err != nil { + res = append(res, err) + } + + qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") + if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { + res = append(res, err) + } + + qBranch, qhkBranch, _ := qs.GetOK("branch") + if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { + res = append(res, err) + } + + qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") + if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { + res = append(res, err) + } + + qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") + if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { + res = append(res, err) + } + + qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") + if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qEdipi, qhkEdipi, _ := qs.GetOK("edipi") + if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { + res = append(res, err) + } + + qEmplid, qhkEmplid, _ := qs.GetOK("emplid") + if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { + res = append(res, err) + } + + qLocator, qhkLocator, _ := qs.GetOK("locator") + if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qOrderType, qhkOrderType, _ := qs.GetOK("orderType") + if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { + res = append(res, err) + } + + qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") + if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qRequestedMoveDate, qhkRequestedMoveDate, _ := qs.GetOK("requestedMoveDate") + if err := o.bindRequestedMoveDate(qRequestedMoveDate, qhkRequestedMoveDate, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + + qStatus, qhkStatus, _ := qs.GetOK("status") + if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { + res = append(res, err) + } + + qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") + if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAppearedInTooAt binds and validates parameter AppearedInTooAt from query. +func (o *GetMovesQueueParams) bindAppearedInTooAt(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("appearedInTooAt", "query", "strfmt.DateTime", raw) + } + o.AppearedInTooAt = (value.(*strfmt.DateTime)) + + if err := o.validateAppearedInTooAt(formats); err != nil { + return err + } + + return nil +} + +// validateAppearedInTooAt carries on validations for parameter AppearedInTooAt +func (o *GetMovesQueueParams) validateAppearedInTooAt(formats strfmt.Registry) error { + + if err := validate.FormatOf("appearedInTooAt", "query", "date-time", o.AppearedInTooAt.String(), formats); err != nil { + return err + } + return nil +} + +// bindAssignedTo binds and validates parameter AssignedTo from query. +func (o *GetMovesQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.AssignedTo = &raw + + return nil +} + +// bindBranch binds and validates parameter Branch from query. +func (o *GetMovesQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Branch = &raw + + return nil +} + +// bindCounselingOffice binds and validates parameter CounselingOffice from query. +func (o *GetMovesQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CounselingOffice = &raw + + return nil +} + +// bindCustomerName binds and validates parameter CustomerName from query. +func (o *GetMovesQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CustomerName = &raw + + return nil +} + +// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. +func (o *GetMovesQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.DestinationDutyLocation = &raw + + return nil +} + +// bindEdipi binds and validates parameter Edipi from query. +func (o *GetMovesQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Edipi = &raw + + return nil +} + +// bindEmplid binds and validates parameter Emplid from query. +func (o *GetMovesQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Emplid = &raw + + return nil +} + +// bindLocator binds and validates parameter Locator from query. +func (o *GetMovesQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Locator = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *GetMovesQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Order = &raw + + if err := o.validateOrder(formats); err != nil { + return err + } + + return nil +} + +// validateOrder carries on validations for parameter Order +func (o *GetMovesQueueParams) validateOrder(formats strfmt.Registry) error { + + if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { + return err + } + + return nil +} + +// bindOrderType binds and validates parameter OrderType from query. +func (o *GetMovesQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OrderType = &raw + + return nil +} + +// bindOriginDutyLocation binds and validates array parameter OriginDutyLocation from query. +// +// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). +func (o *GetMovesQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + // CollectionFormat: multi + originDutyLocationIC := rawData + if len(originDutyLocationIC) == 0 { + return nil + } + + var originDutyLocationIR []string + for _, originDutyLocationIV := range originDutyLocationIC { + originDutyLocationI := originDutyLocationIV + + originDutyLocationIR = append(originDutyLocationIR, originDutyLocationI) + } + + o.OriginDutyLocation = originDutyLocationIR + if err := o.validateOriginDutyLocation(formats); err != nil { + return err + } + + return nil +} + +// validateOriginDutyLocation carries on validations for parameter OriginDutyLocation +func (o *GetMovesQueueParams) validateOriginDutyLocation(formats strfmt.Registry) error { + + // uniqueItems: true + if err := validate.UniqueItems("originDutyLocation", "query", o.OriginDutyLocation); err != nil { + return err + } + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *GetMovesQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *GetMovesQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindRequestedMoveDate binds and validates parameter RequestedMoveDate from query. +func (o *GetMovesQueueParams) bindRequestedMoveDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.RequestedMoveDate = &raw + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *GetMovesQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + if err := o.validateSort(formats); err != nil { + return err + } + + return nil +} + +// validateSort carries on validations for parameter Sort +func (o *GetMovesQueueParams) validateSort(formats strfmt.Registry) error { + + if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "edipi", "emplid", "branch", "locator", "status", "originDutyLocation", "destinationDutyLocation", "requestedMoveDate", "appearedInTooAt", "assignedTo", "counselingOffice"}, true); err != nil { + return err + } + + return nil +} + +// bindStatus binds and validates array parameter Status from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *GetMovesQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvStatus string + if len(rawData) > 0 { + qvStatus = rawData[len(rawData)-1] + } + + // CollectionFormat: + statusIC := swag.SplitByFormat(qvStatus, "") + if len(statusIC) == 0 { + return nil + } + + var statusIR []string + for i, statusIV := range statusIC { + statusI := statusIV + + if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"SUBMITTED", "SERVICE COUNSELING COMPLETED", "APPROVALS REQUESTED"}, true); err != nil { + return err + } + + statusIR = append(statusIR, statusI) + } + + o.Status = statusIR + if err := o.validateStatus(formats); err != nil { + return err + } + + return nil +} + +// validateStatus carries on validations for parameter Status +func (o *GetMovesQueueParams) validateStatus(formats strfmt.Registry) error { + + // uniqueItems: true + if err := validate.UniqueItems("status", "query", o.Status); err != nil { + return err + } + return nil +} + +// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. +func (o *GetMovesQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ViewAsGBLOC = &raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go new file mode 100644 index 00000000000..e74af3bb51e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetMovesQueueOKCode is the HTTP code returned for type GetMovesQueueOK +const GetMovesQueueOKCode int = 200 + +/* +GetMovesQueueOK Successfully returned all moves matching the criteria + +swagger:response getMovesQueueOK +*/ +type GetMovesQueueOK struct { + + /* + In: Body + */ + Payload *ghcmessages.QueueMovesResult `json:"body,omitempty"` +} + +// NewGetMovesQueueOK creates GetMovesQueueOK with default headers values +func NewGetMovesQueueOK() *GetMovesQueueOK { + + return &GetMovesQueueOK{} +} + +// WithPayload adds the payload to the get moves queue o k response +func (o *GetMovesQueueOK) WithPayload(payload *ghcmessages.QueueMovesResult) *GetMovesQueueOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get moves queue o k response +func (o *GetMovesQueueOK) SetPayload(payload *ghcmessages.QueueMovesResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMovesQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMovesQueueForbiddenCode is the HTTP code returned for type GetMovesQueueForbidden +const GetMovesQueueForbiddenCode int = 403 + +/* +GetMovesQueueForbidden The request was denied + +swagger:response getMovesQueueForbidden +*/ +type GetMovesQueueForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMovesQueueForbidden creates GetMovesQueueForbidden with default headers values +func NewGetMovesQueueForbidden() *GetMovesQueueForbidden { + + return &GetMovesQueueForbidden{} +} + +// WithPayload adds the payload to the get moves queue forbidden response +func (o *GetMovesQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetMovesQueueForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get moves queue forbidden response +func (o *GetMovesQueueForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMovesQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMovesQueueInternalServerErrorCode is the HTTP code returned for type GetMovesQueueInternalServerError +const GetMovesQueueInternalServerErrorCode int = 500 + +/* +GetMovesQueueInternalServerError A server error occurred + +swagger:response getMovesQueueInternalServerError +*/ +type GetMovesQueueInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetMovesQueueInternalServerError creates GetMovesQueueInternalServerError with default headers values +func NewGetMovesQueueInternalServerError() *GetMovesQueueInternalServerError { + + return &GetMovesQueueInternalServerError{} +} + +// WithPayload adds the payload to the get moves queue internal server error response +func (o *GetMovesQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetMovesQueueInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get moves queue internal server error response +func (o *GetMovesQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMovesQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go new file mode 100644 index 00000000000..ec05a50a3eb --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetMovesQueueURL generates an URL for the get moves queue operation +type GetMovesQueueURL struct { + AppearedInTooAt *strfmt.DateTime + AssignedTo *string + Branch *string + CounselingOffice *string + CustomerName *string + DestinationDutyLocation *string + Edipi *string + Emplid *string + Locator *string + Order *string + OrderType *string + OriginDutyLocation []string + Page *int64 + PerPage *int64 + RequestedMoveDate *string + Sort *string + Status []string + ViewAsGBLOC *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMovesQueueURL) WithBasePath(bp string) *GetMovesQueueURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMovesQueueURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMovesQueueURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/moves" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var appearedInTooAtQ string + if o.AppearedInTooAt != nil { + appearedInTooAtQ = o.AppearedInTooAt.String() + } + if appearedInTooAtQ != "" { + qs.Set("appearedInTooAt", appearedInTooAtQ) + } + + var assignedToQ string + if o.AssignedTo != nil { + assignedToQ = *o.AssignedTo + } + if assignedToQ != "" { + qs.Set("assignedTo", assignedToQ) + } + + var branchQ string + if o.Branch != nil { + branchQ = *o.Branch + } + if branchQ != "" { + qs.Set("branch", branchQ) + } + + var counselingOfficeQ string + if o.CounselingOffice != nil { + counselingOfficeQ = *o.CounselingOffice + } + if counselingOfficeQ != "" { + qs.Set("counselingOffice", counselingOfficeQ) + } + + var customerNameQ string + if o.CustomerName != nil { + customerNameQ = *o.CustomerName + } + if customerNameQ != "" { + qs.Set("customerName", customerNameQ) + } + + var destinationDutyLocationQ string + if o.DestinationDutyLocation != nil { + destinationDutyLocationQ = *o.DestinationDutyLocation + } + if destinationDutyLocationQ != "" { + qs.Set("destinationDutyLocation", destinationDutyLocationQ) + } + + var edipiQ string + if o.Edipi != nil { + edipiQ = *o.Edipi + } + if edipiQ != "" { + qs.Set("edipi", edipiQ) + } + + var emplidQ string + if o.Emplid != nil { + emplidQ = *o.Emplid + } + if emplidQ != "" { + qs.Set("emplid", emplidQ) + } + + var locatorQ string + if o.Locator != nil { + locatorQ = *o.Locator + } + if locatorQ != "" { + qs.Set("locator", locatorQ) + } + + var orderQ string + if o.Order != nil { + orderQ = *o.Order + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var orderTypeQ string + if o.OrderType != nil { + orderTypeQ = *o.OrderType + } + if orderTypeQ != "" { + qs.Set("orderType", orderTypeQ) + } + + var originDutyLocationIR []string + for _, originDutyLocationI := range o.OriginDutyLocation { + originDutyLocationIS := originDutyLocationI + if originDutyLocationIS != "" { + originDutyLocationIR = append(originDutyLocationIR, originDutyLocationIS) + } + } + + originDutyLocation := swag.JoinByFormat(originDutyLocationIR, "multi") + + for _, qsv := range originDutyLocation { + qs.Add("originDutyLocation", qsv) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var requestedMoveDateQ string + if o.RequestedMoveDate != nil { + requestedMoveDateQ = *o.RequestedMoveDate + } + if requestedMoveDateQ != "" { + qs.Set("requestedMoveDate", requestedMoveDateQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + var statusIR []string + for _, statusI := range o.Status { + statusIS := statusI + if statusIS != "" { + statusIR = append(statusIR, statusIS) + } + } + + status := swag.JoinByFormat(statusIR, "") + + if len(status) > 0 { + qsv := status[0] + if qsv != "" { + qs.Set("status", qsv) + } + } + + var viewAsGBLOCQ string + if o.ViewAsGBLOC != nil { + viewAsGBLOCQ = *o.ViewAsGBLOC + } + if viewAsGBLOCQ != "" { + qs.Set("viewAsGBLOC", viewAsGBLOCQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMovesQueueURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMovesQueueURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMovesQueueURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMovesQueueURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMovesQueueURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMovesQueueURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go new file mode 100644 index 00000000000..9c6f9dac17c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPaymentRequestsQueueHandlerFunc turns a function with the right signature into a get payment requests queue handler +type GetPaymentRequestsQueueHandlerFunc func(GetPaymentRequestsQueueParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPaymentRequestsQueueHandlerFunc) Handle(params GetPaymentRequestsQueueParams) middleware.Responder { + return fn(params) +} + +// GetPaymentRequestsQueueHandler interface for that can handle valid get payment requests queue params +type GetPaymentRequestsQueueHandler interface { + Handle(GetPaymentRequestsQueueParams) middleware.Responder +} + +// NewGetPaymentRequestsQueue creates a new http.Handler for the get payment requests queue operation +func NewGetPaymentRequestsQueue(ctx *middleware.Context, handler GetPaymentRequestsQueueHandler) *GetPaymentRequestsQueue { + return &GetPaymentRequestsQueue{Context: ctx, Handler: handler} +} + +/* + GetPaymentRequestsQueue swagger:route GET /queues/payment-requests queues getPaymentRequestsQueue + +# Gets queued list of all payment requests by GBLOC origin + +An office TIO user will be assigned a transportation office that will determine which payment requests are displayed in their queue based on the origin duty location. +*/ +type GetPaymentRequestsQueue struct { + Context *middleware.Context + Handler GetPaymentRequestsQueueHandler +} + +func (o *GetPaymentRequestsQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPaymentRequestsQueueParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go new file mode 100644 index 00000000000..fe0d201031e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go @@ -0,0 +1,598 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewGetPaymentRequestsQueueParams creates a new GetPaymentRequestsQueueParams object +// +// There are no default values defined in the spec. +func NewGetPaymentRequestsQueueParams() GetPaymentRequestsQueueParams { + + return GetPaymentRequestsQueueParams{} +} + +// GetPaymentRequestsQueueParams contains all the bound params for the get payment requests queue operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPaymentRequestsQueue +type GetPaymentRequestsQueueParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Used to illustrate which user is assigned to this payment request. + + In: query + */ + AssignedTo *string + /* + In: query + */ + Branch *string + /*filters using a counselingOffice name of the move + In: query + */ + CounselingOffice *string + /* + In: query + */ + CustomerName *string + /* + In: query + */ + DestinationDutyLocation *string + /* + In: query + */ + Edipi *string + /* + In: query + */ + Emplid *string + /* + In: query + */ + Locator *string + /*direction of sort order if applied + In: query + */ + Order *string + /*order type + In: query + */ + OrderType *string + /* + In: query + */ + OriginDutyLocation *string + /*requested page of results + In: query + */ + Page *int64 + /*number of records to include per page + In: query + */ + PerPage *int64 + /*field that results should be sorted by + In: query + */ + Sort *string + /*Filtering for the status. + Unique: true + In: query + */ + Status []string + /*Start of the submitted at date in the user's local time zone converted to UTC + In: query + */ + SubmittedAt *strfmt.DateTime + /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + + In: query + */ + ViewAsGBLOC *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPaymentRequestsQueueParams() beforehand. +func (o *GetPaymentRequestsQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") + if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { + res = append(res, err) + } + + qBranch, qhkBranch, _ := qs.GetOK("branch") + if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { + res = append(res, err) + } + + qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") + if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { + res = append(res, err) + } + + qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") + if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { + res = append(res, err) + } + + qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") + if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qEdipi, qhkEdipi, _ := qs.GetOK("edipi") + if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { + res = append(res, err) + } + + qEmplid, qhkEmplid, _ := qs.GetOK("emplid") + if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { + res = append(res, err) + } + + qLocator, qhkLocator, _ := qs.GetOK("locator") + if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qOrderType, qhkOrderType, _ := qs.GetOK("orderType") + if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { + res = append(res, err) + } + + qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") + if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + + qStatus, qhkStatus, _ := qs.GetOK("status") + if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { + res = append(res, err) + } + + qSubmittedAt, qhkSubmittedAt, _ := qs.GetOK("submittedAt") + if err := o.bindSubmittedAt(qSubmittedAt, qhkSubmittedAt, route.Formats); err != nil { + res = append(res, err) + } + + qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") + if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAssignedTo binds and validates parameter AssignedTo from query. +func (o *GetPaymentRequestsQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.AssignedTo = &raw + + return nil +} + +// bindBranch binds and validates parameter Branch from query. +func (o *GetPaymentRequestsQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Branch = &raw + + return nil +} + +// bindCounselingOffice binds and validates parameter CounselingOffice from query. +func (o *GetPaymentRequestsQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CounselingOffice = &raw + + return nil +} + +// bindCustomerName binds and validates parameter CustomerName from query. +func (o *GetPaymentRequestsQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CustomerName = &raw + + return nil +} + +// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. +func (o *GetPaymentRequestsQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.DestinationDutyLocation = &raw + + return nil +} + +// bindEdipi binds and validates parameter Edipi from query. +func (o *GetPaymentRequestsQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Edipi = &raw + + return nil +} + +// bindEmplid binds and validates parameter Emplid from query. +func (o *GetPaymentRequestsQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Emplid = &raw + + return nil +} + +// bindLocator binds and validates parameter Locator from query. +func (o *GetPaymentRequestsQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Locator = &raw + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *GetPaymentRequestsQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Order = &raw + + if err := o.validateOrder(formats); err != nil { + return err + } + + return nil +} + +// validateOrder carries on validations for parameter Order +func (o *GetPaymentRequestsQueueParams) validateOrder(formats strfmt.Registry) error { + + if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { + return err + } + + return nil +} + +// bindOrderType binds and validates parameter OrderType from query. +func (o *GetPaymentRequestsQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OrderType = &raw + + return nil +} + +// bindOriginDutyLocation binds and validates parameter OriginDutyLocation from query. +func (o *GetPaymentRequestsQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OriginDutyLocation = &raw + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *GetPaymentRequestsQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *GetPaymentRequestsQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *GetPaymentRequestsQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + if err := o.validateSort(formats); err != nil { + return err + } + + return nil +} + +// validateSort carries on validations for parameter Sort +func (o *GetPaymentRequestsQueueParams) validateSort(formats strfmt.Registry) error { + + if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "locator", "submittedAt", "branch", "status", "edipi", "emplid", "age", "originDutyLocation", "assignedTo", "counselingOffice"}, true); err != nil { + return err + } + + return nil +} + +// bindStatus binds and validates array parameter Status from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *GetPaymentRequestsQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvStatus string + if len(rawData) > 0 { + qvStatus = rawData[len(rawData)-1] + } + + // CollectionFormat: + statusIC := swag.SplitByFormat(qvStatus, "") + if len(statusIC) == 0 { + return nil + } + + var statusIR []string + for i, statusIV := range statusIC { + statusI := statusIV + + if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"PENDING", "REVIEWED", "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", "PAID", "DEPRECATED", "EDI_ERROR"}, true); err != nil { + return err + } + + statusIR = append(statusIR, statusI) + } + + o.Status = statusIR + if err := o.validateStatus(formats); err != nil { + return err + } + + return nil +} + +// validateStatus carries on validations for parameter Status +func (o *GetPaymentRequestsQueueParams) validateStatus(formats strfmt.Registry) error { + + // uniqueItems: true + if err := validate.UniqueItems("status", "query", o.Status); err != nil { + return err + } + return nil +} + +// bindSubmittedAt binds and validates parameter SubmittedAt from query. +func (o *GetPaymentRequestsQueueParams) bindSubmittedAt(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("submittedAt", "query", "strfmt.DateTime", raw) + } + o.SubmittedAt = (value.(*strfmt.DateTime)) + + if err := o.validateSubmittedAt(formats); err != nil { + return err + } + + return nil +} + +// validateSubmittedAt carries on validations for parameter SubmittedAt +func (o *GetPaymentRequestsQueueParams) validateSubmittedAt(formats strfmt.Registry) error { + + if err := validate.FormatOf("submittedAt", "query", "date-time", o.SubmittedAt.String(), formats); err != nil { + return err + } + return nil +} + +// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. +func (o *GetPaymentRequestsQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ViewAsGBLOC = &raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go new file mode 100644 index 00000000000..791e2f29378 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetPaymentRequestsQueueOKCode is the HTTP code returned for type GetPaymentRequestsQueueOK +const GetPaymentRequestsQueueOKCode int = 200 + +/* +GetPaymentRequestsQueueOK Successfully returned all moves matching the criteria + +swagger:response getPaymentRequestsQueueOK +*/ +type GetPaymentRequestsQueueOK struct { + + /* + In: Body + */ + Payload *ghcmessages.QueuePaymentRequestsResult `json:"body,omitempty"` +} + +// NewGetPaymentRequestsQueueOK creates GetPaymentRequestsQueueOK with default headers values +func NewGetPaymentRequestsQueueOK() *GetPaymentRequestsQueueOK { + + return &GetPaymentRequestsQueueOK{} +} + +// WithPayload adds the payload to the get payment requests queue o k response +func (o *GetPaymentRequestsQueueOK) WithPayload(payload *ghcmessages.QueuePaymentRequestsResult) *GetPaymentRequestsQueueOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests queue o k response +func (o *GetPaymentRequestsQueueOK) SetPayload(payload *ghcmessages.QueuePaymentRequestsResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestsQueueForbiddenCode is the HTTP code returned for type GetPaymentRequestsQueueForbidden +const GetPaymentRequestsQueueForbiddenCode int = 403 + +/* +GetPaymentRequestsQueueForbidden The request was denied + +swagger:response getPaymentRequestsQueueForbidden +*/ +type GetPaymentRequestsQueueForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestsQueueForbidden creates GetPaymentRequestsQueueForbidden with default headers values +func NewGetPaymentRequestsQueueForbidden() *GetPaymentRequestsQueueForbidden { + + return &GetPaymentRequestsQueueForbidden{} +} + +// WithPayload adds the payload to the get payment requests queue forbidden response +func (o *GetPaymentRequestsQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsQueueForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests queue forbidden response +func (o *GetPaymentRequestsQueueForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestsQueueInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestsQueueInternalServerError +const GetPaymentRequestsQueueInternalServerErrorCode int = 500 + +/* +GetPaymentRequestsQueueInternalServerError A server error occurred + +swagger:response getPaymentRequestsQueueInternalServerError +*/ +type GetPaymentRequestsQueueInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestsQueueInternalServerError creates GetPaymentRequestsQueueInternalServerError with default headers values +func NewGetPaymentRequestsQueueInternalServerError() *GetPaymentRequestsQueueInternalServerError { + + return &GetPaymentRequestsQueueInternalServerError{} +} + +// WithPayload adds the payload to the get payment requests queue internal server error response +func (o *GetPaymentRequestsQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetPaymentRequestsQueueInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment requests queue internal server error response +func (o *GetPaymentRequestsQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestsQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go new file mode 100644 index 00000000000..1b5aa0e8b3b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go @@ -0,0 +1,259 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetPaymentRequestsQueueURL generates an URL for the get payment requests queue operation +type GetPaymentRequestsQueueURL struct { + AssignedTo *string + Branch *string + CounselingOffice *string + CustomerName *string + DestinationDutyLocation *string + Edipi *string + Emplid *string + Locator *string + Order *string + OrderType *string + OriginDutyLocation *string + Page *int64 + PerPage *int64 + Sort *string + Status []string + SubmittedAt *strfmt.DateTime + ViewAsGBLOC *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestsQueueURL) WithBasePath(bp string) *GetPaymentRequestsQueueURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestsQueueURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPaymentRequestsQueueURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/payment-requests" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var assignedToQ string + if o.AssignedTo != nil { + assignedToQ = *o.AssignedTo + } + if assignedToQ != "" { + qs.Set("assignedTo", assignedToQ) + } + + var branchQ string + if o.Branch != nil { + branchQ = *o.Branch + } + if branchQ != "" { + qs.Set("branch", branchQ) + } + + var counselingOfficeQ string + if o.CounselingOffice != nil { + counselingOfficeQ = *o.CounselingOffice + } + if counselingOfficeQ != "" { + qs.Set("counselingOffice", counselingOfficeQ) + } + + var customerNameQ string + if o.CustomerName != nil { + customerNameQ = *o.CustomerName + } + if customerNameQ != "" { + qs.Set("customerName", customerNameQ) + } + + var destinationDutyLocationQ string + if o.DestinationDutyLocation != nil { + destinationDutyLocationQ = *o.DestinationDutyLocation + } + if destinationDutyLocationQ != "" { + qs.Set("destinationDutyLocation", destinationDutyLocationQ) + } + + var edipiQ string + if o.Edipi != nil { + edipiQ = *o.Edipi + } + if edipiQ != "" { + qs.Set("edipi", edipiQ) + } + + var emplidQ string + if o.Emplid != nil { + emplidQ = *o.Emplid + } + if emplidQ != "" { + qs.Set("emplid", emplidQ) + } + + var locatorQ string + if o.Locator != nil { + locatorQ = *o.Locator + } + if locatorQ != "" { + qs.Set("locator", locatorQ) + } + + var orderQ string + if o.Order != nil { + orderQ = *o.Order + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var orderTypeQ string + if o.OrderType != nil { + orderTypeQ = *o.OrderType + } + if orderTypeQ != "" { + qs.Set("orderType", orderTypeQ) + } + + var originDutyLocationQ string + if o.OriginDutyLocation != nil { + originDutyLocationQ = *o.OriginDutyLocation + } + if originDutyLocationQ != "" { + qs.Set("originDutyLocation", originDutyLocationQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + var statusIR []string + for _, statusI := range o.Status { + statusIS := statusI + if statusIS != "" { + statusIR = append(statusIR, statusIS) + } + } + + status := swag.JoinByFormat(statusIR, "") + + if len(status) > 0 { + qsv := status[0] + if qsv != "" { + qs.Set("status", qsv) + } + } + + var submittedAtQ string + if o.SubmittedAt != nil { + submittedAtQ = o.SubmittedAt.String() + } + if submittedAtQ != "" { + qs.Set("submittedAt", submittedAtQ) + } + + var viewAsGBLOCQ string + if o.ViewAsGBLOC != nil { + viewAsGBLOCQ = *o.ViewAsGBLOC + } + if viewAsGBLOCQ != "" { + qs.Set("viewAsGBLOC", viewAsGBLOCQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPaymentRequestsQueueURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPaymentRequestsQueueURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPaymentRequestsQueueURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPaymentRequestsQueueURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPaymentRequestsQueueURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPaymentRequestsQueueURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go new file mode 100644 index 00000000000..7cdd86ead69 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetServicesCounselingOriginListHandlerFunc turns a function with the right signature into a get services counseling origin list handler +type GetServicesCounselingOriginListHandlerFunc func(GetServicesCounselingOriginListParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetServicesCounselingOriginListHandlerFunc) Handle(params GetServicesCounselingOriginListParams) middleware.Responder { + return fn(params) +} + +// GetServicesCounselingOriginListHandler interface for that can handle valid get services counseling origin list params +type GetServicesCounselingOriginListHandler interface { + Handle(GetServicesCounselingOriginListParams) middleware.Responder +} + +// NewGetServicesCounselingOriginList creates a new http.Handler for the get services counseling origin list operation +func NewGetServicesCounselingOriginList(ctx *middleware.Context, handler GetServicesCounselingOriginListHandler) *GetServicesCounselingOriginList { + return &GetServicesCounselingOriginList{Context: ctx, Handler: handler} +} + +/* + GetServicesCounselingOriginList swagger:route GET /queues/counseling/origin-list queues getServicesCounselingOriginList + +# Gets queued list of all moves origin locations in the counselors queue + +An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. This pulls the availalble origin duty locations. +*/ +type GetServicesCounselingOriginList struct { + Context *middleware.Context + Handler GetServicesCounselingOriginListHandler +} + +func (o *GetServicesCounselingOriginList) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetServicesCounselingOriginListParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go new file mode 100644 index 00000000000..df70ba4cbab --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_parameters.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewGetServicesCounselingOriginListParams creates a new GetServicesCounselingOriginListParams object +// +// There are no default values defined in the spec. +func NewGetServicesCounselingOriginListParams() GetServicesCounselingOriginListParams { + + return GetServicesCounselingOriginListParams{} +} + +// GetServicesCounselingOriginListParams contains all the bound params for the get services counseling origin list operation +// typically these are obtained from a http.Request +// +// swagger:parameters getServicesCounselingOriginList +type GetServicesCounselingOriginListParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Only used for Services Counseling queue. If true, show PPM moves origin locations that are ready for closeout. Otherwise, show all other moves origin locations. + In: query + */ + NeedsPPMCloseout *bool + /*Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + In: query + */ + ViewAsGBLOC *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetServicesCounselingOriginListParams() beforehand. +func (o *GetServicesCounselingOriginListParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qNeedsPPMCloseout, qhkNeedsPPMCloseout, _ := qs.GetOK("needsPPMCloseout") + if err := o.bindNeedsPPMCloseout(qNeedsPPMCloseout, qhkNeedsPPMCloseout, route.Formats); err != nil { + res = append(res, err) + } + + qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") + if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindNeedsPPMCloseout binds and validates parameter NeedsPPMCloseout from query. +func (o *GetServicesCounselingOriginListParams) bindNeedsPPMCloseout(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("needsPPMCloseout", "query", "bool", raw) + } + o.NeedsPPMCloseout = &value + + return nil +} + +// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. +func (o *GetServicesCounselingOriginListParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ViewAsGBLOC = &raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go new file mode 100644 index 00000000000..d4c1355b782 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_responses.go @@ -0,0 +1,152 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetServicesCounselingOriginListOKCode is the HTTP code returned for type GetServicesCounselingOriginListOK +const GetServicesCounselingOriginListOKCode int = 200 + +/* +GetServicesCounselingOriginListOK Successfully returned all moves matching the criteria + +swagger:response getServicesCounselingOriginListOK +*/ +type GetServicesCounselingOriginListOK struct { + + /* + In: Body + */ + Payload ghcmessages.Locations `json:"body,omitempty"` +} + +// NewGetServicesCounselingOriginListOK creates GetServicesCounselingOriginListOK with default headers values +func NewGetServicesCounselingOriginListOK() *GetServicesCounselingOriginListOK { + + return &GetServicesCounselingOriginListOK{} +} + +// WithPayload adds the payload to the get services counseling origin list o k response +func (o *GetServicesCounselingOriginListOK) WithPayload(payload ghcmessages.Locations) *GetServicesCounselingOriginListOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling origin list o k response +func (o *GetServicesCounselingOriginListOK) SetPayload(payload ghcmessages.Locations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingOriginListOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.Locations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetServicesCounselingOriginListForbiddenCode is the HTTP code returned for type GetServicesCounselingOriginListForbidden +const GetServicesCounselingOriginListForbiddenCode int = 403 + +/* +GetServicesCounselingOriginListForbidden The request was denied + +swagger:response getServicesCounselingOriginListForbidden +*/ +type GetServicesCounselingOriginListForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetServicesCounselingOriginListForbidden creates GetServicesCounselingOriginListForbidden with default headers values +func NewGetServicesCounselingOriginListForbidden() *GetServicesCounselingOriginListForbidden { + + return &GetServicesCounselingOriginListForbidden{} +} + +// WithPayload adds the payload to the get services counseling origin list forbidden response +func (o *GetServicesCounselingOriginListForbidden) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingOriginListForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling origin list forbidden response +func (o *GetServicesCounselingOriginListForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingOriginListForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetServicesCounselingOriginListInternalServerErrorCode is the HTTP code returned for type GetServicesCounselingOriginListInternalServerError +const GetServicesCounselingOriginListInternalServerErrorCode int = 500 + +/* +GetServicesCounselingOriginListInternalServerError A server error occurred + +swagger:response getServicesCounselingOriginListInternalServerError +*/ +type GetServicesCounselingOriginListInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetServicesCounselingOriginListInternalServerError creates GetServicesCounselingOriginListInternalServerError with default headers values +func NewGetServicesCounselingOriginListInternalServerError() *GetServicesCounselingOriginListInternalServerError { + + return &GetServicesCounselingOriginListInternalServerError{} +} + +// WithPayload adds the payload to the get services counseling origin list internal server error response +func (o *GetServicesCounselingOriginListInternalServerError) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingOriginListInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling origin list internal server error response +func (o *GetServicesCounselingOriginListInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingOriginListInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go new file mode 100644 index 00000000000..adc6d175249 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_origin_list_urlbuilder.go @@ -0,0 +1,114 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// GetServicesCounselingOriginListURL generates an URL for the get services counseling origin list operation +type GetServicesCounselingOriginListURL struct { + NeedsPPMCloseout *bool + ViewAsGBLOC *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetServicesCounselingOriginListURL) WithBasePath(bp string) *GetServicesCounselingOriginListURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetServicesCounselingOriginListURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetServicesCounselingOriginListURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/counseling/origin-list" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var needsPPMCloseoutQ string + if o.NeedsPPMCloseout != nil { + needsPPMCloseoutQ = swag.FormatBool(*o.NeedsPPMCloseout) + } + if needsPPMCloseoutQ != "" { + qs.Set("needsPPMCloseout", needsPPMCloseoutQ) + } + + var viewAsGBLOCQ string + if o.ViewAsGBLOC != nil { + viewAsGBLOCQ = *o.ViewAsGBLOC + } + if viewAsGBLOCQ != "" { + qs.Set("viewAsGBLOC", viewAsGBLOCQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetServicesCounselingOriginListURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetServicesCounselingOriginListURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetServicesCounselingOriginListURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetServicesCounselingOriginListURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetServicesCounselingOriginListURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetServicesCounselingOriginListURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go new file mode 100644 index 00000000000..ef38cfda721 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetServicesCounselingQueueHandlerFunc turns a function with the right signature into a get services counseling queue handler +type GetServicesCounselingQueueHandlerFunc func(GetServicesCounselingQueueParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetServicesCounselingQueueHandlerFunc) Handle(params GetServicesCounselingQueueParams) middleware.Responder { + return fn(params) +} + +// GetServicesCounselingQueueHandler interface for that can handle valid get services counseling queue params +type GetServicesCounselingQueueHandler interface { + Handle(GetServicesCounselingQueueParams) middleware.Responder +} + +// NewGetServicesCounselingQueue creates a new http.Handler for the get services counseling queue operation +func NewGetServicesCounselingQueue(ctx *middleware.Context, handler GetServicesCounselingQueueHandler) *GetServicesCounselingQueue { + return &GetServicesCounselingQueue{Context: ctx, Handler: handler} +} + +/* + GetServicesCounselingQueue swagger:route GET /queues/counseling queues getServicesCounselingQueue + +# Gets queued list of all customer moves needing services counseling by GBLOC origin + +An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf. +*/ +type GetServicesCounselingQueue struct { + Context *middleware.Context + Handler GetServicesCounselingQueueHandler +} + +func (o *GetServicesCounselingQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetServicesCounselingQueueParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go new file mode 100644 index 00000000000..2b03f53918f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go @@ -0,0 +1,858 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewGetServicesCounselingQueueParams creates a new GetServicesCounselingQueueParams object +// +// There are no default values defined in the spec. +func NewGetServicesCounselingQueueParams() GetServicesCounselingQueueParams { + + return GetServicesCounselingQueueParams{} +} + +// GetServicesCounselingQueueParams contains all the bound params for the get services counseling queue operation +// typically these are obtained from a http.Request +// +// swagger:parameters getServicesCounselingQueue +type GetServicesCounselingQueueParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Used to illustrate which user is assigned to this payment request. + + In: query + */ + AssignedTo *string + /*filters by the branch of the move's service member + In: query + */ + Branch *string + /*Latest date that closeout was initiated on a PPM on the move + In: query + */ + CloseoutInitiated *strfmt.DateTime + /*closeout location + In: query + */ + CloseoutLocation *string + /*filters using a counselingOffice name of the move + In: query + */ + CounselingOffice *string + /*filters using a prefix match on the service member's last name + In: query + */ + CustomerName *string + /*filters the name of the destination duty location on the orders + In: query + */ + DestinationDutyLocation *string + /*filters to match the unique service member's DoD ID + In: query + */ + Edipi *string + /*filters to match the unique service member's EMPLID + In: query + */ + Emplid *string + /*filters to match the unique move code locator + In: query + */ + Locator *string + /*Only used for Services Counseling queue. If true, show PPM moves that are ready for closeout. Otherwise, show all other moves. + In: query + */ + NeedsPPMCloseout *bool + /*direction of sort order if applied + In: query + */ + Order *string + /*order type + In: query + */ + OrderType *string + /*filters the name of the origin duty location on the orders + Unique: true + In: query + Collection Format: multi + */ + OriginDutyLocation []string + /*filters the GBLOC of the service member's origin duty location + In: query + */ + OriginGBLOC *string + /*requested page number of paginated move results + In: query + */ + Page *int64 + /*maximum number of moves to show on each page of paginated results + In: query + */ + PerPage *int64 + /*filters the status of the PPM shipment + In: query + */ + PpmStatus *string + /*filters PPM type + In: query + */ + PpmType *string + /*filters the requested pickup date of a shipment on the move + In: query + */ + RequestedMoveDate *string + /*field that results should be sorted by + In: query + */ + Sort *string + /*filters the status of the move + Unique: true + In: query + */ + Status []string + /*Start of the submitted at date in the user's local time zone converted to UTC + In: query + */ + SubmittedAt *strfmt.DateTime + /*Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + + In: query + */ + ViewAsGBLOC *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetServicesCounselingQueueParams() beforehand. +func (o *GetServicesCounselingQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") + if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { + res = append(res, err) + } + + qBranch, qhkBranch, _ := qs.GetOK("branch") + if err := o.bindBranch(qBranch, qhkBranch, route.Formats); err != nil { + res = append(res, err) + } + + qCloseoutInitiated, qhkCloseoutInitiated, _ := qs.GetOK("closeoutInitiated") + if err := o.bindCloseoutInitiated(qCloseoutInitiated, qhkCloseoutInitiated, route.Formats); err != nil { + res = append(res, err) + } + + qCloseoutLocation, qhkCloseoutLocation, _ := qs.GetOK("closeoutLocation") + if err := o.bindCloseoutLocation(qCloseoutLocation, qhkCloseoutLocation, route.Formats); err != nil { + res = append(res, err) + } + + qCounselingOffice, qhkCounselingOffice, _ := qs.GetOK("counselingOffice") + if err := o.bindCounselingOffice(qCounselingOffice, qhkCounselingOffice, route.Formats); err != nil { + res = append(res, err) + } + + qCustomerName, qhkCustomerName, _ := qs.GetOK("customerName") + if err := o.bindCustomerName(qCustomerName, qhkCustomerName, route.Formats); err != nil { + res = append(res, err) + } + + qDestinationDutyLocation, qhkDestinationDutyLocation, _ := qs.GetOK("destinationDutyLocation") + if err := o.bindDestinationDutyLocation(qDestinationDutyLocation, qhkDestinationDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qEdipi, qhkEdipi, _ := qs.GetOK("edipi") + if err := o.bindEdipi(qEdipi, qhkEdipi, route.Formats); err != nil { + res = append(res, err) + } + + qEmplid, qhkEmplid, _ := qs.GetOK("emplid") + if err := o.bindEmplid(qEmplid, qhkEmplid, route.Formats); err != nil { + res = append(res, err) + } + + qLocator, qhkLocator, _ := qs.GetOK("locator") + if err := o.bindLocator(qLocator, qhkLocator, route.Formats); err != nil { + res = append(res, err) + } + + qNeedsPPMCloseout, qhkNeedsPPMCloseout, _ := qs.GetOK("needsPPMCloseout") + if err := o.bindNeedsPPMCloseout(qNeedsPPMCloseout, qhkNeedsPPMCloseout, route.Formats); err != nil { + res = append(res, err) + } + + qOrder, qhkOrder, _ := qs.GetOK("order") + if err := o.bindOrder(qOrder, qhkOrder, route.Formats); err != nil { + res = append(res, err) + } + + qOrderType, qhkOrderType, _ := qs.GetOK("orderType") + if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { + res = append(res, err) + } + + qOriginDutyLocation, qhkOriginDutyLocation, _ := qs.GetOK("originDutyLocation") + if err := o.bindOriginDutyLocation(qOriginDutyLocation, qhkOriginDutyLocation, route.Formats); err != nil { + res = append(res, err) + } + + qOriginGBLOC, qhkOriginGBLOC, _ := qs.GetOK("originGBLOC") + if err := o.bindOriginGBLOC(qOriginGBLOC, qhkOriginGBLOC, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qPpmStatus, qhkPpmStatus, _ := qs.GetOK("ppmStatus") + if err := o.bindPpmStatus(qPpmStatus, qhkPpmStatus, route.Formats); err != nil { + res = append(res, err) + } + + qPpmType, qhkPpmType, _ := qs.GetOK("ppmType") + if err := o.bindPpmType(qPpmType, qhkPpmType, route.Formats); err != nil { + res = append(res, err) + } + + qRequestedMoveDate, qhkRequestedMoveDate, _ := qs.GetOK("requestedMoveDate") + if err := o.bindRequestedMoveDate(qRequestedMoveDate, qhkRequestedMoveDate, route.Formats); err != nil { + res = append(res, err) + } + + qSort, qhkSort, _ := qs.GetOK("sort") + if err := o.bindSort(qSort, qhkSort, route.Formats); err != nil { + res = append(res, err) + } + + qStatus, qhkStatus, _ := qs.GetOK("status") + if err := o.bindStatus(qStatus, qhkStatus, route.Formats); err != nil { + res = append(res, err) + } + + qSubmittedAt, qhkSubmittedAt, _ := qs.GetOK("submittedAt") + if err := o.bindSubmittedAt(qSubmittedAt, qhkSubmittedAt, route.Formats); err != nil { + res = append(res, err) + } + + qViewAsGBLOC, qhkViewAsGBLOC, _ := qs.GetOK("viewAsGBLOC") + if err := o.bindViewAsGBLOC(qViewAsGBLOC, qhkViewAsGBLOC, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAssignedTo binds and validates parameter AssignedTo from query. +func (o *GetServicesCounselingQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.AssignedTo = &raw + + return nil +} + +// bindBranch binds and validates parameter Branch from query. +func (o *GetServicesCounselingQueueParams) bindBranch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Branch = &raw + + return nil +} + +// bindCloseoutInitiated binds and validates parameter CloseoutInitiated from query. +func (o *GetServicesCounselingQueueParams) bindCloseoutInitiated(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("closeoutInitiated", "query", "strfmt.DateTime", raw) + } + o.CloseoutInitiated = (value.(*strfmt.DateTime)) + + if err := o.validateCloseoutInitiated(formats); err != nil { + return err + } + + return nil +} + +// validateCloseoutInitiated carries on validations for parameter CloseoutInitiated +func (o *GetServicesCounselingQueueParams) validateCloseoutInitiated(formats strfmt.Registry) error { + + if err := validate.FormatOf("closeoutInitiated", "query", "date-time", o.CloseoutInitiated.String(), formats); err != nil { + return err + } + return nil +} + +// bindCloseoutLocation binds and validates parameter CloseoutLocation from query. +func (o *GetServicesCounselingQueueParams) bindCloseoutLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CloseoutLocation = &raw + + return nil +} + +// bindCounselingOffice binds and validates parameter CounselingOffice from query. +func (o *GetServicesCounselingQueueParams) bindCounselingOffice(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CounselingOffice = &raw + + return nil +} + +// bindCustomerName binds and validates parameter CustomerName from query. +func (o *GetServicesCounselingQueueParams) bindCustomerName(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.CustomerName = &raw + + return nil +} + +// bindDestinationDutyLocation binds and validates parameter DestinationDutyLocation from query. +func (o *GetServicesCounselingQueueParams) bindDestinationDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.DestinationDutyLocation = &raw + + return nil +} + +// bindEdipi binds and validates parameter Edipi from query. +func (o *GetServicesCounselingQueueParams) bindEdipi(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Edipi = &raw + + return nil +} + +// bindEmplid binds and validates parameter Emplid from query. +func (o *GetServicesCounselingQueueParams) bindEmplid(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Emplid = &raw + + return nil +} + +// bindLocator binds and validates parameter Locator from query. +func (o *GetServicesCounselingQueueParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Locator = &raw + + return nil +} + +// bindNeedsPPMCloseout binds and validates parameter NeedsPPMCloseout from query. +func (o *GetServicesCounselingQueueParams) bindNeedsPPMCloseout(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("needsPPMCloseout", "query", "bool", raw) + } + o.NeedsPPMCloseout = &value + + return nil +} + +// bindOrder binds and validates parameter Order from query. +func (o *GetServicesCounselingQueueParams) bindOrder(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Order = &raw + + if err := o.validateOrder(formats); err != nil { + return err + } + + return nil +} + +// validateOrder carries on validations for parameter Order +func (o *GetServicesCounselingQueueParams) validateOrder(formats strfmt.Registry) error { + + if err := validate.EnumCase("order", "query", *o.Order, []interface{}{"asc", "desc"}, true); err != nil { + return err + } + + return nil +} + +// bindOrderType binds and validates parameter OrderType from query. +func (o *GetServicesCounselingQueueParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OrderType = &raw + + return nil +} + +// bindOriginDutyLocation binds and validates array parameter OriginDutyLocation from query. +// +// Arrays are parsed according to CollectionFormat: "multi" (defaults to "csv" when empty). +func (o *GetServicesCounselingQueueParams) bindOriginDutyLocation(rawData []string, hasKey bool, formats strfmt.Registry) error { + // CollectionFormat: multi + originDutyLocationIC := rawData + if len(originDutyLocationIC) == 0 { + return nil + } + + var originDutyLocationIR []string + for _, originDutyLocationIV := range originDutyLocationIC { + originDutyLocationI := originDutyLocationIV + + originDutyLocationIR = append(originDutyLocationIR, originDutyLocationI) + } + + o.OriginDutyLocation = originDutyLocationIR + if err := o.validateOriginDutyLocation(formats); err != nil { + return err + } + + return nil +} + +// validateOriginDutyLocation carries on validations for parameter OriginDutyLocation +func (o *GetServicesCounselingQueueParams) validateOriginDutyLocation(formats strfmt.Registry) error { + + // uniqueItems: true + if err := validate.UniqueItems("originDutyLocation", "query", o.OriginDutyLocation); err != nil { + return err + } + return nil +} + +// bindOriginGBLOC binds and validates parameter OriginGBLOC from query. +func (o *GetServicesCounselingQueueParams) bindOriginGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OriginGBLOC = &raw + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *GetServicesCounselingQueueParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *GetServicesCounselingQueueParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindPpmStatus binds and validates parameter PpmStatus from query. +func (o *GetServicesCounselingQueueParams) bindPpmStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.PpmStatus = &raw + + if err := o.validatePpmStatus(formats); err != nil { + return err + } + + return nil +} + +// validatePpmStatus carries on validations for parameter PpmStatus +func (o *GetServicesCounselingQueueParams) validatePpmStatus(formats strfmt.Registry) error { + + if err := validate.EnumCase("ppmStatus", "query", *o.PpmStatus, []interface{}{"WAITING_ON_CUSTOMER", "NEEDS_CLOSEOUT"}, true); err != nil { + return err + } + + return nil +} + +// bindPpmType binds and validates parameter PpmType from query. +func (o *GetServicesCounselingQueueParams) bindPpmType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.PpmType = &raw + + if err := o.validatePpmType(formats); err != nil { + return err + } + + return nil +} + +// validatePpmType carries on validations for parameter PpmType +func (o *GetServicesCounselingQueueParams) validatePpmType(formats strfmt.Registry) error { + + if err := validate.EnumCase("ppmType", "query", *o.PpmType, []interface{}{"FULL", "PARTIAL"}, true); err != nil { + return err + } + + return nil +} + +// bindRequestedMoveDate binds and validates parameter RequestedMoveDate from query. +func (o *GetServicesCounselingQueueParams) bindRequestedMoveDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.RequestedMoveDate = &raw + + return nil +} + +// bindSort binds and validates parameter Sort from query. +func (o *GetServicesCounselingQueueParams) bindSort(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.Sort = &raw + + if err := o.validateSort(formats); err != nil { + return err + } + + return nil +} + +// validateSort carries on validations for parameter Sort +func (o *GetServicesCounselingQueueParams) validateSort(formats strfmt.Registry) error { + + if err := validate.EnumCase("sort", "query", *o.Sort, []interface{}{"customerName", "edipi", "emplid", "branch", "locator", "status", "requestedMoveDate", "submittedAt", "originGBLOC", "originDutyLocation", "destinationDutyLocation", "ppmType", "closeoutInitiated", "closeoutLocation", "ppmStatus", "counselingOffice", "assignedTo"}, true); err != nil { + return err + } + + return nil +} + +// bindStatus binds and validates array parameter Status from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *GetServicesCounselingQueueParams) bindStatus(rawData []string, hasKey bool, formats strfmt.Registry) error { + var qvStatus string + if len(rawData) > 0 { + qvStatus = rawData[len(rawData)-1] + } + + // CollectionFormat: + statusIC := swag.SplitByFormat(qvStatus, "") + if len(statusIC) == 0 { + return nil + } + + var statusIR []string + for i, statusIV := range statusIC { + statusI := statusIV + + if err := validate.EnumCase(fmt.Sprintf("%s.%v", "status", i), "query", statusI, []interface{}{"NEEDS SERVICE COUNSELING", "SERVICE COUNSELING COMPLETED"}, true); err != nil { + return err + } + + statusIR = append(statusIR, statusI) + } + + o.Status = statusIR + if err := o.validateStatus(formats); err != nil { + return err + } + + return nil +} + +// validateStatus carries on validations for parameter Status +func (o *GetServicesCounselingQueueParams) validateStatus(formats strfmt.Registry) error { + + // uniqueItems: true + if err := validate.UniqueItems("status", "query", o.Status); err != nil { + return err + } + return nil +} + +// bindSubmittedAt binds and validates parameter SubmittedAt from query. +func (o *GetServicesCounselingQueueParams) bindSubmittedAt(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("submittedAt", "query", "strfmt.DateTime", raw) + } + o.SubmittedAt = (value.(*strfmt.DateTime)) + + if err := o.validateSubmittedAt(formats); err != nil { + return err + } + + return nil +} + +// validateSubmittedAt carries on validations for parameter SubmittedAt +func (o *GetServicesCounselingQueueParams) validateSubmittedAt(formats strfmt.Registry) error { + + if err := validate.FormatOf("submittedAt", "query", "date-time", o.SubmittedAt.String(), formats); err != nil { + return err + } + return nil +} + +// bindViewAsGBLOC binds and validates parameter ViewAsGBLOC from query. +func (o *GetServicesCounselingQueueParams) bindViewAsGBLOC(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ViewAsGBLOC = &raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go new file mode 100644 index 00000000000..f75f014d949 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetServicesCounselingQueueOKCode is the HTTP code returned for type GetServicesCounselingQueueOK +const GetServicesCounselingQueueOKCode int = 200 + +/* +GetServicesCounselingQueueOK Successfully returned all moves matching the criteria + +swagger:response getServicesCounselingQueueOK +*/ +type GetServicesCounselingQueueOK struct { + + /* + In: Body + */ + Payload *ghcmessages.QueueMovesResult `json:"body,omitempty"` +} + +// NewGetServicesCounselingQueueOK creates GetServicesCounselingQueueOK with default headers values +func NewGetServicesCounselingQueueOK() *GetServicesCounselingQueueOK { + + return &GetServicesCounselingQueueOK{} +} + +// WithPayload adds the payload to the get services counseling queue o k response +func (o *GetServicesCounselingQueueOK) WithPayload(payload *ghcmessages.QueueMovesResult) *GetServicesCounselingQueueOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling queue o k response +func (o *GetServicesCounselingQueueOK) SetPayload(payload *ghcmessages.QueueMovesResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetServicesCounselingQueueForbiddenCode is the HTTP code returned for type GetServicesCounselingQueueForbidden +const GetServicesCounselingQueueForbiddenCode int = 403 + +/* +GetServicesCounselingQueueForbidden The request was denied + +swagger:response getServicesCounselingQueueForbidden +*/ +type GetServicesCounselingQueueForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetServicesCounselingQueueForbidden creates GetServicesCounselingQueueForbidden with default headers values +func NewGetServicesCounselingQueueForbidden() *GetServicesCounselingQueueForbidden { + + return &GetServicesCounselingQueueForbidden{} +} + +// WithPayload adds the payload to the get services counseling queue forbidden response +func (o *GetServicesCounselingQueueForbidden) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingQueueForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling queue forbidden response +func (o *GetServicesCounselingQueueForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetServicesCounselingQueueInternalServerErrorCode is the HTTP code returned for type GetServicesCounselingQueueInternalServerError +const GetServicesCounselingQueueInternalServerErrorCode int = 500 + +/* +GetServicesCounselingQueueInternalServerError A server error occurred + +swagger:response getServicesCounselingQueueInternalServerError +*/ +type GetServicesCounselingQueueInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetServicesCounselingQueueInternalServerError creates GetServicesCounselingQueueInternalServerError with default headers values +func NewGetServicesCounselingQueueInternalServerError() *GetServicesCounselingQueueInternalServerError { + + return &GetServicesCounselingQueueInternalServerError{} +} + +// WithPayload adds the payload to the get services counseling queue internal server error response +func (o *GetServicesCounselingQueueInternalServerError) WithPayload(payload *ghcmessages.Error) *GetServicesCounselingQueueInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get services counseling queue internal server error response +func (o *GetServicesCounselingQueueInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetServicesCounselingQueueInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go new file mode 100644 index 00000000000..d7ad7668c07 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go @@ -0,0 +1,328 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GetServicesCounselingQueueURL generates an URL for the get services counseling queue operation +type GetServicesCounselingQueueURL struct { + AssignedTo *string + Branch *string + CloseoutInitiated *strfmt.DateTime + CloseoutLocation *string + CounselingOffice *string + CustomerName *string + DestinationDutyLocation *string + Edipi *string + Emplid *string + Locator *string + NeedsPPMCloseout *bool + Order *string + OrderType *string + OriginDutyLocation []string + OriginGBLOC *string + Page *int64 + PerPage *int64 + PpmStatus *string + PpmType *string + RequestedMoveDate *string + Sort *string + Status []string + SubmittedAt *strfmt.DateTime + ViewAsGBLOC *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetServicesCounselingQueueURL) WithBasePath(bp string) *GetServicesCounselingQueueURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetServicesCounselingQueueURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetServicesCounselingQueueURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/counseling" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var assignedToQ string + if o.AssignedTo != nil { + assignedToQ = *o.AssignedTo + } + if assignedToQ != "" { + qs.Set("assignedTo", assignedToQ) + } + + var branchQ string + if o.Branch != nil { + branchQ = *o.Branch + } + if branchQ != "" { + qs.Set("branch", branchQ) + } + + var closeoutInitiatedQ string + if o.CloseoutInitiated != nil { + closeoutInitiatedQ = o.CloseoutInitiated.String() + } + if closeoutInitiatedQ != "" { + qs.Set("closeoutInitiated", closeoutInitiatedQ) + } + + var closeoutLocationQ string + if o.CloseoutLocation != nil { + closeoutLocationQ = *o.CloseoutLocation + } + if closeoutLocationQ != "" { + qs.Set("closeoutLocation", closeoutLocationQ) + } + + var counselingOfficeQ string + if o.CounselingOffice != nil { + counselingOfficeQ = *o.CounselingOffice + } + if counselingOfficeQ != "" { + qs.Set("counselingOffice", counselingOfficeQ) + } + + var customerNameQ string + if o.CustomerName != nil { + customerNameQ = *o.CustomerName + } + if customerNameQ != "" { + qs.Set("customerName", customerNameQ) + } + + var destinationDutyLocationQ string + if o.DestinationDutyLocation != nil { + destinationDutyLocationQ = *o.DestinationDutyLocation + } + if destinationDutyLocationQ != "" { + qs.Set("destinationDutyLocation", destinationDutyLocationQ) + } + + var edipiQ string + if o.Edipi != nil { + edipiQ = *o.Edipi + } + if edipiQ != "" { + qs.Set("edipi", edipiQ) + } + + var emplidQ string + if o.Emplid != nil { + emplidQ = *o.Emplid + } + if emplidQ != "" { + qs.Set("emplid", emplidQ) + } + + var locatorQ string + if o.Locator != nil { + locatorQ = *o.Locator + } + if locatorQ != "" { + qs.Set("locator", locatorQ) + } + + var needsPPMCloseoutQ string + if o.NeedsPPMCloseout != nil { + needsPPMCloseoutQ = swag.FormatBool(*o.NeedsPPMCloseout) + } + if needsPPMCloseoutQ != "" { + qs.Set("needsPPMCloseout", needsPPMCloseoutQ) + } + + var orderQ string + if o.Order != nil { + orderQ = *o.Order + } + if orderQ != "" { + qs.Set("order", orderQ) + } + + var orderTypeQ string + if o.OrderType != nil { + orderTypeQ = *o.OrderType + } + if orderTypeQ != "" { + qs.Set("orderType", orderTypeQ) + } + + var originDutyLocationIR []string + for _, originDutyLocationI := range o.OriginDutyLocation { + originDutyLocationIS := originDutyLocationI + if originDutyLocationIS != "" { + originDutyLocationIR = append(originDutyLocationIR, originDutyLocationIS) + } + } + + originDutyLocation := swag.JoinByFormat(originDutyLocationIR, "multi") + + for _, qsv := range originDutyLocation { + qs.Add("originDutyLocation", qsv) + } + + var originGBLOCQ string + if o.OriginGBLOC != nil { + originGBLOCQ = *o.OriginGBLOC + } + if originGBLOCQ != "" { + qs.Set("originGBLOC", originGBLOCQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var ppmStatusQ string + if o.PpmStatus != nil { + ppmStatusQ = *o.PpmStatus + } + if ppmStatusQ != "" { + qs.Set("ppmStatus", ppmStatusQ) + } + + var ppmTypeQ string + if o.PpmType != nil { + ppmTypeQ = *o.PpmType + } + if ppmTypeQ != "" { + qs.Set("ppmType", ppmTypeQ) + } + + var requestedMoveDateQ string + if o.RequestedMoveDate != nil { + requestedMoveDateQ = *o.RequestedMoveDate + } + if requestedMoveDateQ != "" { + qs.Set("requestedMoveDate", requestedMoveDateQ) + } + + var sortQ string + if o.Sort != nil { + sortQ = *o.Sort + } + if sortQ != "" { + qs.Set("sort", sortQ) + } + + var statusIR []string + for _, statusI := range o.Status { + statusIS := statusI + if statusIS != "" { + statusIR = append(statusIR, statusIS) + } + } + + status := swag.JoinByFormat(statusIR, "") + + if len(status) > 0 { + qsv := status[0] + if qsv != "" { + qs.Set("status", qsv) + } + } + + var submittedAtQ string + if o.SubmittedAt != nil { + submittedAtQ = o.SubmittedAt.String() + } + if submittedAtQ != "" { + qs.Set("submittedAt", submittedAtQ) + } + + var viewAsGBLOCQ string + if o.ViewAsGBLOC != nil { + viewAsGBLOCQ = *o.ViewAsGBLOC + } + if viewAsGBLOCQ != "" { + qs.Set("viewAsGBLOC", viewAsGBLOCQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetServicesCounselingQueueURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetServicesCounselingQueueURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetServicesCounselingQueueURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetServicesCounselingQueueURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetServicesCounselingQueueURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetServicesCounselingQueueURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go new file mode 100644 index 00000000000..3923f7dfd8c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListPrimeMovesHandlerFunc turns a function with the right signature into a list prime moves handler +type ListPrimeMovesHandlerFunc func(ListPrimeMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListPrimeMovesHandlerFunc) Handle(params ListPrimeMovesParams) middleware.Responder { + return fn(params) +} + +// ListPrimeMovesHandler interface for that can handle valid list prime moves params +type ListPrimeMovesHandler interface { + Handle(ListPrimeMovesParams) middleware.Responder +} + +// NewListPrimeMoves creates a new http.Handler for the list prime moves operation +func NewListPrimeMoves(ctx *middleware.Context, handler ListPrimeMovesHandler) *ListPrimeMoves { + return &ListPrimeMoves{Context: ctx, Handler: handler} +} + +/* + ListPrimeMoves swagger:route GET /queues/prime-moves queues listPrimeMoves + +getPrimeMovesQueue + +Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this +list down to only the moves that have been updated since the provided timestamp. A move will be considered +updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment +requests, is later than the provided date and time. + +**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has +been set, that move will always appear in this list. +*/ +type ListPrimeMoves struct { + Context *middleware.Context + Handler ListPrimeMovesHandler +} + +func (o *ListPrimeMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListPrimeMovesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go new file mode 100644 index 00000000000..6562f690385 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_parameters.go @@ -0,0 +1,243 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewListPrimeMovesParams creates a new ListPrimeMovesParams object +// +// There are no default values defined in the spec. +func NewListPrimeMovesParams() ListPrimeMovesParams { + + return ListPrimeMovesParams{} +} + +// ListPrimeMovesParams contains all the bound params for the list prime moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters listPrimeMoves +type ListPrimeMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: query + */ + ID *string + /* + In: query + */ + MoveCode *string + /*order type + In: query + */ + OrderType *string + /*requested page of results + In: query + */ + Page *int64 + /*results per page + In: query + */ + PerPage *int64 + /*Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" + In: query + */ + Since *strfmt.DateTime +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListPrimeMovesParams() beforehand. +func (o *ListPrimeMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qID, qhkID, _ := qs.GetOK("id") + if err := o.bindID(qID, qhkID, route.Formats); err != nil { + res = append(res, err) + } + + qMoveCode, qhkMoveCode, _ := qs.GetOK("moveCode") + if err := o.bindMoveCode(qMoveCode, qhkMoveCode, route.Formats); err != nil { + res = append(res, err) + } + + qOrderType, qhkOrderType, _ := qs.GetOK("orderType") + if err := o.bindOrderType(qOrderType, qhkOrderType, route.Formats); err != nil { + res = append(res, err) + } + + qPage, qhkPage, _ := qs.GetOK("page") + if err := o.bindPage(qPage, qhkPage, route.Formats); err != nil { + res = append(res, err) + } + + qPerPage, qhkPerPage, _ := qs.GetOK("perPage") + if err := o.bindPerPage(qPerPage, qhkPerPage, route.Formats); err != nil { + res = append(res, err) + } + + qSince, qhkSince, _ := qs.GetOK("since") + if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindID binds and validates parameter ID from query. +func (o *ListPrimeMovesParams) bindID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ID = &raw + + return nil +} + +// bindMoveCode binds and validates parameter MoveCode from query. +func (o *ListPrimeMovesParams) bindMoveCode(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.MoveCode = &raw + + return nil +} + +// bindOrderType binds and validates parameter OrderType from query. +func (o *ListPrimeMovesParams) bindOrderType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.OrderType = &raw + + return nil +} + +// bindPage binds and validates parameter Page from query. +func (o *ListPrimeMovesParams) bindPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("page", "query", "int64", raw) + } + o.Page = &value + + return nil +} + +// bindPerPage binds and validates parameter PerPage from query. +func (o *ListPrimeMovesParams) bindPerPage(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("perPage", "query", "int64", raw) + } + o.PerPage = &value + + return nil +} + +// bindSince binds and validates parameter Since from query. +func (o *ListPrimeMovesParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("since", "query", "strfmt.DateTime", raw) + } + o.Since = (value.(*strfmt.DateTime)) + + if err := o.validateSince(formats); err != nil { + return err + } + + return nil +} + +// validateSince carries on validations for parameter Since +func (o *ListPrimeMovesParams) validateSince(formats strfmt.Registry) error { + + if err := validate.FormatOf("since", "query", "date-time", o.Since.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go new file mode 100644 index 00000000000..8bb53b97cbd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ListPrimeMovesOKCode is the HTTP code returned for type ListPrimeMovesOK +const ListPrimeMovesOKCode int = 200 + +/* +ListPrimeMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. + +swagger:response listPrimeMovesOK +*/ +type ListPrimeMovesOK struct { + + /* + In: Body + */ + Payload *ghcmessages.ListPrimeMovesResult `json:"body,omitempty"` +} + +// NewListPrimeMovesOK creates ListPrimeMovesOK with default headers values +func NewListPrimeMovesOK() *ListPrimeMovesOK { + + return &ListPrimeMovesOK{} +} + +// WithPayload adds the payload to the list prime moves o k response +func (o *ListPrimeMovesOK) WithPayload(payload *ghcmessages.ListPrimeMovesResult) *ListPrimeMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list prime moves o k response +func (o *ListPrimeMovesOK) SetPayload(payload *ghcmessages.ListPrimeMovesResult) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPrimeMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListPrimeMovesForbiddenCode is the HTTP code returned for type ListPrimeMovesForbidden +const ListPrimeMovesForbiddenCode int = 403 + +/* +ListPrimeMovesForbidden The request was denied + +swagger:response listPrimeMovesForbidden +*/ +type ListPrimeMovesForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListPrimeMovesForbidden creates ListPrimeMovesForbidden with default headers values +func NewListPrimeMovesForbidden() *ListPrimeMovesForbidden { + + return &ListPrimeMovesForbidden{} +} + +// WithPayload adds the payload to the list prime moves forbidden response +func (o *ListPrimeMovesForbidden) WithPayload(payload *ghcmessages.Error) *ListPrimeMovesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list prime moves forbidden response +func (o *ListPrimeMovesForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPrimeMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListPrimeMovesInternalServerErrorCode is the HTTP code returned for type ListPrimeMovesInternalServerError +const ListPrimeMovesInternalServerErrorCode int = 500 + +/* +ListPrimeMovesInternalServerError A server error occurred + +swagger:response listPrimeMovesInternalServerError +*/ +type ListPrimeMovesInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewListPrimeMovesInternalServerError creates ListPrimeMovesInternalServerError with default headers values +func NewListPrimeMovesInternalServerError() *ListPrimeMovesInternalServerError { + + return &ListPrimeMovesInternalServerError{} +} + +// WithPayload adds the payload to the list prime moves internal server error response +func (o *ListPrimeMovesInternalServerError) WithPayload(payload *ghcmessages.Error) *ListPrimeMovesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list prime moves internal server error response +func (o *ListPrimeMovesInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListPrimeMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go new file mode 100644 index 00000000000..b76bbe56629 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/queues/list_prime_moves_urlbuilder.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListPrimeMovesURL generates an URL for the list prime moves operation +type ListPrimeMovesURL struct { + ID *string + MoveCode *string + OrderType *string + Page *int64 + PerPage *int64 + Since *strfmt.DateTime + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListPrimeMovesURL) WithBasePath(bp string) *ListPrimeMovesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListPrimeMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListPrimeMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/prime-moves" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var idQ string + if o.ID != nil { + idQ = *o.ID + } + if idQ != "" { + qs.Set("id", idQ) + } + + var moveCodeQ string + if o.MoveCode != nil { + moveCodeQ = *o.MoveCode + } + if moveCodeQ != "" { + qs.Set("moveCode", moveCodeQ) + } + + var orderTypeQ string + if o.OrderType != nil { + orderTypeQ = *o.OrderType + } + if orderTypeQ != "" { + qs.Set("orderType", orderTypeQ) + } + + var pageQ string + if o.Page != nil { + pageQ = swag.FormatInt64(*o.Page) + } + if pageQ != "" { + qs.Set("page", pageQ) + } + + var perPageQ string + if o.PerPage != nil { + perPageQ = swag.FormatInt64(*o.PerPage) + } + if perPageQ != "" { + qs.Set("perPage", perPageQ) + } + + var sinceQ string + if o.Since != nil { + sinceQ = o.Since.String() + } + if sinceQ != "" { + qs.Set("since", sinceQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListPrimeMovesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListPrimeMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListPrimeMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListPrimeMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListPrimeMovesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListPrimeMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go new file mode 100644 index 00000000000..1dd08a72a7c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package re_service_items + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetAllReServiceItemsHandlerFunc turns a function with the right signature into a get all re service items handler +type GetAllReServiceItemsHandlerFunc func(GetAllReServiceItemsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetAllReServiceItemsHandlerFunc) Handle(params GetAllReServiceItemsParams) middleware.Responder { + return fn(params) +} + +// GetAllReServiceItemsHandler interface for that can handle valid get all re service items params +type GetAllReServiceItemsHandler interface { + Handle(GetAllReServiceItemsParams) middleware.Responder +} + +// NewGetAllReServiceItems creates a new http.Handler for the get all re service items operation +func NewGetAllReServiceItems(ctx *middleware.Context, handler GetAllReServiceItemsHandler) *GetAllReServiceItems { + return &GetAllReServiceItems{Context: ctx, Handler: handler} +} + +/* + GetAllReServiceItems swagger:route GET /re-service-items reServiceItems getAllReServiceItems + +Returns all ReServiceItems (Service Code, Service Name, Market, Shipment Type, Auto Approved) + +Get ReServiceItems +*/ +type GetAllReServiceItems struct { + Context *middleware.Context + Handler GetAllReServiceItemsHandler +} + +func (o *GetAllReServiceItems) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetAllReServiceItemsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go new file mode 100644 index 00000000000..3e66348bc46 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package re_service_items + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetAllReServiceItemsParams creates a new GetAllReServiceItemsParams object +// +// There are no default values defined in the spec. +func NewGetAllReServiceItemsParams() GetAllReServiceItemsParams { + + return GetAllReServiceItemsParams{} +} + +// GetAllReServiceItemsParams contains all the bound params for the get all re service items operation +// typically these are obtained from a http.Request +// +// swagger:parameters getAllReServiceItems +type GetAllReServiceItemsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetAllReServiceItemsParams() beforehand. +func (o *GetAllReServiceItemsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go new file mode 100644 index 00000000000..c5b7d2e48d3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package re_service_items + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetAllReServiceItemsOKCode is the HTTP code returned for type GetAllReServiceItemsOK +const GetAllReServiceItemsOKCode int = 200 + +/* +GetAllReServiceItemsOK Successfully retrieved all ReServiceItems. + +swagger:response getAllReServiceItemsOK +*/ +type GetAllReServiceItemsOK struct { + + /* + In: Body + */ + Payload ghcmessages.ReServiceItems `json:"body,omitempty"` +} + +// NewGetAllReServiceItemsOK creates GetAllReServiceItemsOK with default headers values +func NewGetAllReServiceItemsOK() *GetAllReServiceItemsOK { + + return &GetAllReServiceItemsOK{} +} + +// WithPayload adds the payload to the get all re service items o k response +func (o *GetAllReServiceItemsOK) WithPayload(payload ghcmessages.ReServiceItems) *GetAllReServiceItemsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all re service items o k response +func (o *GetAllReServiceItemsOK) SetPayload(payload ghcmessages.ReServiceItems) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllReServiceItemsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.ReServiceItems{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetAllReServiceItemsBadRequestCode is the HTTP code returned for type GetAllReServiceItemsBadRequest +const GetAllReServiceItemsBadRequestCode int = 400 + +/* +GetAllReServiceItemsBadRequest The request payload is invalid + +swagger:response getAllReServiceItemsBadRequest +*/ +type GetAllReServiceItemsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetAllReServiceItemsBadRequest creates GetAllReServiceItemsBadRequest with default headers values +func NewGetAllReServiceItemsBadRequest() *GetAllReServiceItemsBadRequest { + + return &GetAllReServiceItemsBadRequest{} +} + +// WithPayload adds the payload to the get all re service items bad request response +func (o *GetAllReServiceItemsBadRequest) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all re service items bad request response +func (o *GetAllReServiceItemsBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllReServiceItemsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllReServiceItemsUnauthorizedCode is the HTTP code returned for type GetAllReServiceItemsUnauthorized +const GetAllReServiceItemsUnauthorizedCode int = 401 + +/* +GetAllReServiceItemsUnauthorized The request was denied + +swagger:response getAllReServiceItemsUnauthorized +*/ +type GetAllReServiceItemsUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetAllReServiceItemsUnauthorized creates GetAllReServiceItemsUnauthorized with default headers values +func NewGetAllReServiceItemsUnauthorized() *GetAllReServiceItemsUnauthorized { + + return &GetAllReServiceItemsUnauthorized{} +} + +// WithPayload adds the payload to the get all re service items unauthorized response +func (o *GetAllReServiceItemsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all re service items unauthorized response +func (o *GetAllReServiceItemsUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllReServiceItemsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllReServiceItemsNotFoundCode is the HTTP code returned for type GetAllReServiceItemsNotFound +const GetAllReServiceItemsNotFoundCode int = 404 + +/* +GetAllReServiceItemsNotFound The requested resource wasn't found + +swagger:response getAllReServiceItemsNotFound +*/ +type GetAllReServiceItemsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetAllReServiceItemsNotFound creates GetAllReServiceItemsNotFound with default headers values +func NewGetAllReServiceItemsNotFound() *GetAllReServiceItemsNotFound { + + return &GetAllReServiceItemsNotFound{} +} + +// WithPayload adds the payload to the get all re service items not found response +func (o *GetAllReServiceItemsNotFound) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all re service items not found response +func (o *GetAllReServiceItemsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllReServiceItemsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllReServiceItemsInternalServerErrorCode is the HTTP code returned for type GetAllReServiceItemsInternalServerError +const GetAllReServiceItemsInternalServerErrorCode int = 500 + +/* +GetAllReServiceItemsInternalServerError A server error occurred + +swagger:response getAllReServiceItemsInternalServerError +*/ +type GetAllReServiceItemsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetAllReServiceItemsInternalServerError creates GetAllReServiceItemsInternalServerError with default headers values +func NewGetAllReServiceItemsInternalServerError() *GetAllReServiceItemsInternalServerError { + + return &GetAllReServiceItemsInternalServerError{} +} + +// WithPayload adds the payload to the get all re service items internal server error response +func (o *GetAllReServiceItemsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetAllReServiceItemsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all re service items internal server error response +func (o *GetAllReServiceItemsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllReServiceItemsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go new file mode 100644 index 00000000000..be1ff8cd69e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/re_service_items/get_all_re_service_items_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package re_service_items + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetAllReServiceItemsURL generates an URL for the get all re service items operation +type GetAllReServiceItemsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAllReServiceItemsURL) WithBasePath(bp string) *GetAllReServiceItemsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAllReServiceItemsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetAllReServiceItemsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/re-service-items" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetAllReServiceItemsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetAllReServiceItemsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetAllReServiceItemsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetAllReServiceItemsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetAllReServiceItemsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetAllReServiceItemsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go new file mode 100644 index 00000000000..7ed7d246832 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// AssociateReportViolationsHandlerFunc turns a function with the right signature into a associate report violations handler +type AssociateReportViolationsHandlerFunc func(AssociateReportViolationsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn AssociateReportViolationsHandlerFunc) Handle(params AssociateReportViolationsParams) middleware.Responder { + return fn(params) +} + +// AssociateReportViolationsHandler interface for that can handle valid associate report violations params +type AssociateReportViolationsHandler interface { + Handle(AssociateReportViolationsParams) middleware.Responder +} + +// NewAssociateReportViolations creates a new http.Handler for the associate report violations operation +func NewAssociateReportViolations(ctx *middleware.Context, handler AssociateReportViolationsHandler) *AssociateReportViolations { + return &AssociateReportViolations{Context: ctx, Handler: handler} +} + +/* + AssociateReportViolations swagger:route POST /report-violations/{reportID} reportViolations associateReportViolations + +# Associate violations with an evaluation report + +Associate violations with an evaluation report. This will overwrite any existing report-violations associations for the report and replace them with the newly provided ones. An empty array will remove all violation associations for a given report. +*/ +type AssociateReportViolations struct { + Context *middleware.Context + Handler AssociateReportViolationsHandler +} + +func (o *AssociateReportViolations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewAssociateReportViolationsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go new file mode 100644 index 00000000000..4eb082affb9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewAssociateReportViolationsParams creates a new AssociateReportViolationsParams object +// +// There are no default values defined in the spec. +func NewAssociateReportViolationsParams() AssociateReportViolationsParams { + + return AssociateReportViolationsParams{} +} + +// AssociateReportViolationsParams contains all the bound params for the associate report violations operation +// typically these are obtained from a http.Request +// +// swagger:parameters associateReportViolations +type AssociateReportViolationsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *ghcmessages.AssociateReportViolations + /*the evaluation report ID that has associated violations + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewAssociateReportViolationsParams() beforehand. +func (o *AssociateReportViolationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.AssociateReportViolations + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *AssociateReportViolationsParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *AssociateReportViolationsParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go new file mode 100644 index 00000000000..b28d30c65e7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// AssociateReportViolationsNoContentCode is the HTTP code returned for type AssociateReportViolationsNoContent +const AssociateReportViolationsNoContentCode int = 204 + +/* +AssociateReportViolationsNoContent Successfully saved the report violations + +swagger:response associateReportViolationsNoContent +*/ +type AssociateReportViolationsNoContent struct { +} + +// NewAssociateReportViolationsNoContent creates AssociateReportViolationsNoContent with default headers values +func NewAssociateReportViolationsNoContent() *AssociateReportViolationsNoContent { + + return &AssociateReportViolationsNoContent{} +} + +// WriteResponse to the client +func (o *AssociateReportViolationsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// AssociateReportViolationsBadRequestCode is the HTTP code returned for type AssociateReportViolationsBadRequest +const AssociateReportViolationsBadRequestCode int = 400 + +/* +AssociateReportViolationsBadRequest The request payload is invalid + +swagger:response associateReportViolationsBadRequest +*/ +type AssociateReportViolationsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAssociateReportViolationsBadRequest creates AssociateReportViolationsBadRequest with default headers values +func NewAssociateReportViolationsBadRequest() *AssociateReportViolationsBadRequest { + + return &AssociateReportViolationsBadRequest{} +} + +// WithPayload adds the payload to the associate report violations bad request response +func (o *AssociateReportViolationsBadRequest) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations bad request response +func (o *AssociateReportViolationsBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AssociateReportViolationsForbiddenCode is the HTTP code returned for type AssociateReportViolationsForbidden +const AssociateReportViolationsForbiddenCode int = 403 + +/* +AssociateReportViolationsForbidden The request was denied + +swagger:response associateReportViolationsForbidden +*/ +type AssociateReportViolationsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAssociateReportViolationsForbidden creates AssociateReportViolationsForbidden with default headers values +func NewAssociateReportViolationsForbidden() *AssociateReportViolationsForbidden { + + return &AssociateReportViolationsForbidden{} +} + +// WithPayload adds the payload to the associate report violations forbidden response +func (o *AssociateReportViolationsForbidden) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations forbidden response +func (o *AssociateReportViolationsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AssociateReportViolationsNotFoundCode is the HTTP code returned for type AssociateReportViolationsNotFound +const AssociateReportViolationsNotFoundCode int = 404 + +/* +AssociateReportViolationsNotFound The requested resource wasn't found + +swagger:response associateReportViolationsNotFound +*/ +type AssociateReportViolationsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAssociateReportViolationsNotFound creates AssociateReportViolationsNotFound with default headers values +func NewAssociateReportViolationsNotFound() *AssociateReportViolationsNotFound { + + return &AssociateReportViolationsNotFound{} +} + +// WithPayload adds the payload to the associate report violations not found response +func (o *AssociateReportViolationsNotFound) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations not found response +func (o *AssociateReportViolationsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AssociateReportViolationsConflictCode is the HTTP code returned for type AssociateReportViolationsConflict +const AssociateReportViolationsConflictCode int = 409 + +/* +AssociateReportViolationsConflict Conflict error + +swagger:response associateReportViolationsConflict +*/ +type AssociateReportViolationsConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAssociateReportViolationsConflict creates AssociateReportViolationsConflict with default headers values +func NewAssociateReportViolationsConflict() *AssociateReportViolationsConflict { + + return &AssociateReportViolationsConflict{} +} + +// WithPayload adds the payload to the associate report violations conflict response +func (o *AssociateReportViolationsConflict) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations conflict response +func (o *AssociateReportViolationsConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AssociateReportViolationsUnprocessableEntityCode is the HTTP code returned for type AssociateReportViolationsUnprocessableEntity +const AssociateReportViolationsUnprocessableEntityCode int = 422 + +/* +AssociateReportViolationsUnprocessableEntity The payload was unprocessable. + +swagger:response associateReportViolationsUnprocessableEntity +*/ +type AssociateReportViolationsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewAssociateReportViolationsUnprocessableEntity creates AssociateReportViolationsUnprocessableEntity with default headers values +func NewAssociateReportViolationsUnprocessableEntity() *AssociateReportViolationsUnprocessableEntity { + + return &AssociateReportViolationsUnprocessableEntity{} +} + +// WithPayload adds the payload to the associate report violations unprocessable entity response +func (o *AssociateReportViolationsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *AssociateReportViolationsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations unprocessable entity response +func (o *AssociateReportViolationsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// AssociateReportViolationsInternalServerErrorCode is the HTTP code returned for type AssociateReportViolationsInternalServerError +const AssociateReportViolationsInternalServerErrorCode int = 500 + +/* +AssociateReportViolationsInternalServerError A server error occurred + +swagger:response associateReportViolationsInternalServerError +*/ +type AssociateReportViolationsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewAssociateReportViolationsInternalServerError creates AssociateReportViolationsInternalServerError with default headers values +func NewAssociateReportViolationsInternalServerError() *AssociateReportViolationsInternalServerError { + + return &AssociateReportViolationsInternalServerError{} +} + +// WithPayload adds the payload to the associate report violations internal server error response +func (o *AssociateReportViolationsInternalServerError) WithPayload(payload *ghcmessages.Error) *AssociateReportViolationsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the associate report violations internal server error response +func (o *AssociateReportViolationsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *AssociateReportViolationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go new file mode 100644 index 00000000000..0c0af0e9f47 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/associate_report_violations_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// AssociateReportViolationsURL generates an URL for the associate report violations operation +type AssociateReportViolationsURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AssociateReportViolationsURL) WithBasePath(bp string) *AssociateReportViolationsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *AssociateReportViolationsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *AssociateReportViolationsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/report-violations/{reportID}" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on AssociateReportViolationsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *AssociateReportViolationsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *AssociateReportViolationsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *AssociateReportViolationsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on AssociateReportViolationsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on AssociateReportViolationsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *AssociateReportViolationsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go new file mode 100644 index 00000000000..36a811ffe6e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetReportViolationsByReportIDHandlerFunc turns a function with the right signature into a get report violations by report ID handler +type GetReportViolationsByReportIDHandlerFunc func(GetReportViolationsByReportIDParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetReportViolationsByReportIDHandlerFunc) Handle(params GetReportViolationsByReportIDParams) middleware.Responder { + return fn(params) +} + +// GetReportViolationsByReportIDHandler interface for that can handle valid get report violations by report ID params +type GetReportViolationsByReportIDHandler interface { + Handle(GetReportViolationsByReportIDParams) middleware.Responder +} + +// NewGetReportViolationsByReportID creates a new http.Handler for the get report violations by report ID operation +func NewGetReportViolationsByReportID(ctx *middleware.Context, handler GetReportViolationsByReportIDHandler) *GetReportViolationsByReportID { + return &GetReportViolationsByReportID{Context: ctx, Handler: handler} +} + +/* + GetReportViolationsByReportID swagger:route GET /report-violations/{reportID} reportViolations getReportViolationsByReportId + +# Fetch the report violations for an evaluation report + +Fetch the report violations for an evaluation report +*/ +type GetReportViolationsByReportID struct { + Context *middleware.Context + Handler GetReportViolationsByReportIDHandler +} + +func (o *GetReportViolationsByReportID) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetReportViolationsByReportIDParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go new file mode 100644 index 00000000000..9b4cbe0a168 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetReportViolationsByReportIDParams creates a new GetReportViolationsByReportIDParams object +// +// There are no default values defined in the spec. +func NewGetReportViolationsByReportIDParams() GetReportViolationsByReportIDParams { + + return GetReportViolationsByReportIDParams{} +} + +// GetReportViolationsByReportIDParams contains all the bound params for the get report violations by report ID operation +// typically these are obtained from a http.Request +// +// swagger:parameters getReportViolationsByReportID +type GetReportViolationsByReportIDParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the evaluation report ID that has associated violations + Required: true + In: path + */ + ReportID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetReportViolationsByReportIDParams() beforehand. +func (o *GetReportViolationsByReportIDParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rReportID, rhkReportID, _ := route.Params.GetOK("reportID") + if err := o.bindReportID(rReportID, rhkReportID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReportID binds and validates parameter ReportID from path. +func (o *GetReportViolationsByReportIDParams) bindReportID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reportID", "path", "strfmt.UUID", raw) + } + o.ReportID = *(value.(*strfmt.UUID)) + + if err := o.validateReportID(formats); err != nil { + return err + } + + return nil +} + +// validateReportID carries on validations for parameter ReportID +func (o *GetReportViolationsByReportIDParams) validateReportID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reportID", "path", "uuid", o.ReportID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go new file mode 100644 index 00000000000..4bbf9da8205 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetReportViolationsByReportIDOKCode is the HTTP code returned for type GetReportViolationsByReportIDOK +const GetReportViolationsByReportIDOKCode int = 200 + +/* +GetReportViolationsByReportIDOK Successfully retrieved the report violations + +swagger:response getReportViolationsByReportIdOK +*/ +type GetReportViolationsByReportIDOK struct { + + /* + In: Body + */ + Payload ghcmessages.ReportViolations `json:"body,omitempty"` +} + +// NewGetReportViolationsByReportIDOK creates GetReportViolationsByReportIDOK with default headers values +func NewGetReportViolationsByReportIDOK() *GetReportViolationsByReportIDOK { + + return &GetReportViolationsByReportIDOK{} +} + +// WithPayload adds the payload to the get report violations by report Id o k response +func (o *GetReportViolationsByReportIDOK) WithPayload(payload ghcmessages.ReportViolations) *GetReportViolationsByReportIDOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get report violations by report Id o k response +func (o *GetReportViolationsByReportIDOK) SetPayload(payload ghcmessages.ReportViolations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetReportViolationsByReportIDOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.ReportViolations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetReportViolationsByReportIDBadRequestCode is the HTTP code returned for type GetReportViolationsByReportIDBadRequest +const GetReportViolationsByReportIDBadRequestCode int = 400 + +/* +GetReportViolationsByReportIDBadRequest The request payload is invalid + +swagger:response getReportViolationsByReportIdBadRequest +*/ +type GetReportViolationsByReportIDBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetReportViolationsByReportIDBadRequest creates GetReportViolationsByReportIDBadRequest with default headers values +func NewGetReportViolationsByReportIDBadRequest() *GetReportViolationsByReportIDBadRequest { + + return &GetReportViolationsByReportIDBadRequest{} +} + +// WithPayload adds the payload to the get report violations by report Id bad request response +func (o *GetReportViolationsByReportIDBadRequest) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get report violations by report Id bad request response +func (o *GetReportViolationsByReportIDBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetReportViolationsByReportIDBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetReportViolationsByReportIDForbiddenCode is the HTTP code returned for type GetReportViolationsByReportIDForbidden +const GetReportViolationsByReportIDForbiddenCode int = 403 + +/* +GetReportViolationsByReportIDForbidden The request was denied + +swagger:response getReportViolationsByReportIdForbidden +*/ +type GetReportViolationsByReportIDForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetReportViolationsByReportIDForbidden creates GetReportViolationsByReportIDForbidden with default headers values +func NewGetReportViolationsByReportIDForbidden() *GetReportViolationsByReportIDForbidden { + + return &GetReportViolationsByReportIDForbidden{} +} + +// WithPayload adds the payload to the get report violations by report Id forbidden response +func (o *GetReportViolationsByReportIDForbidden) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get report violations by report Id forbidden response +func (o *GetReportViolationsByReportIDForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetReportViolationsByReportIDForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetReportViolationsByReportIDNotFoundCode is the HTTP code returned for type GetReportViolationsByReportIDNotFound +const GetReportViolationsByReportIDNotFoundCode int = 404 + +/* +GetReportViolationsByReportIDNotFound The requested resource wasn't found + +swagger:response getReportViolationsByReportIdNotFound +*/ +type GetReportViolationsByReportIDNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetReportViolationsByReportIDNotFound creates GetReportViolationsByReportIDNotFound with default headers values +func NewGetReportViolationsByReportIDNotFound() *GetReportViolationsByReportIDNotFound { + + return &GetReportViolationsByReportIDNotFound{} +} + +// WithPayload adds the payload to the get report violations by report Id not found response +func (o *GetReportViolationsByReportIDNotFound) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get report violations by report Id not found response +func (o *GetReportViolationsByReportIDNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetReportViolationsByReportIDNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetReportViolationsByReportIDInternalServerErrorCode is the HTTP code returned for type GetReportViolationsByReportIDInternalServerError +const GetReportViolationsByReportIDInternalServerErrorCode int = 500 + +/* +GetReportViolationsByReportIDInternalServerError A server error occurred + +swagger:response getReportViolationsByReportIdInternalServerError +*/ +type GetReportViolationsByReportIDInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetReportViolationsByReportIDInternalServerError creates GetReportViolationsByReportIDInternalServerError with default headers values +func NewGetReportViolationsByReportIDInternalServerError() *GetReportViolationsByReportIDInternalServerError { + + return &GetReportViolationsByReportIDInternalServerError{} +} + +// WithPayload adds the payload to the get report violations by report Id internal server error response +func (o *GetReportViolationsByReportIDInternalServerError) WithPayload(payload *ghcmessages.Error) *GetReportViolationsByReportIDInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get report violations by report Id internal server error response +func (o *GetReportViolationsByReportIDInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetReportViolationsByReportIDInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go new file mode 100644 index 00000000000..fd070cd59e5 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/report_violations/get_report_violations_by_report_id_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package report_violations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetReportViolationsByReportIDURL generates an URL for the get report violations by report ID operation +type GetReportViolationsByReportIDURL struct { + ReportID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetReportViolationsByReportIDURL) WithBasePath(bp string) *GetReportViolationsByReportIDURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetReportViolationsByReportIDURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetReportViolationsByReportIDURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/report-violations/{reportID}" + + reportID := o.ReportID.String() + if reportID != "" { + _path = strings.Replace(_path, "{reportID}", reportID, -1) + } else { + return nil, errors.New("reportId is required on GetReportViolationsByReportIDURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetReportViolationsByReportIDURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetReportViolationsByReportIDURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetReportViolationsByReportIDURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetReportViolationsByReportIDURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetReportViolationsByReportIDURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetReportViolationsByReportIDURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go new file mode 100644 index 00000000000..3f0e0dab040 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveSITExtensionHandlerFunc turns a function with the right signature into a approve s i t extension handler +type ApproveSITExtensionHandlerFunc func(ApproveSITExtensionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveSITExtensionHandlerFunc) Handle(params ApproveSITExtensionParams) middleware.Responder { + return fn(params) +} + +// ApproveSITExtensionHandler interface for that can handle valid approve s i t extension params +type ApproveSITExtensionHandler interface { + Handle(ApproveSITExtensionParams) middleware.Responder +} + +// NewApproveSITExtension creates a new http.Handler for the approve s i t extension operation +func NewApproveSITExtension(ctx *middleware.Context, handler ApproveSITExtensionHandler) *ApproveSITExtension { + return &ApproveSITExtension{Context: ctx, Handler: handler} +} + +/* + ApproveSITExtension swagger:route PATCH /shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve shipment sitExtension approveSITExtension + +# Approves a SIT extension + +Approves a SIT extension +*/ +type ApproveSITExtension struct { + Context *middleware.Context + Handler ApproveSITExtensionHandler +} + +func (o *ApproveSITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveSITExtensionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go new file mode 100644 index 00000000000..6b42177e17a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewApproveSITExtensionParams creates a new ApproveSITExtensionParams object +// +// There are no default values defined in the spec. +func NewApproveSITExtensionParams() ApproveSITExtensionParams { + + return ApproveSITExtensionParams{} +} + +// ApproveSITExtensionParams contains all the bound params for the approve s i t extension operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveSITExtension +type ApproveSITExtensionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.ApproveSITExtension + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID + /*ID of the SIT extension + Required: true + In: path + */ + SitExtensionID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveSITExtensionParams() beforehand. +func (o *ApproveSITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.ApproveSITExtension + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rSitExtensionID, rhkSitExtensionID, _ := route.Params.GetOK("sitExtensionID") + if err := o.bindSitExtensionID(rSitExtensionID, rhkSitExtensionID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *ApproveSITExtensionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *ApproveSITExtensionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *ApproveSITExtensionParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindSitExtensionID binds and validates parameter SitExtensionID from path. +func (o *ApproveSITExtensionParams) bindSitExtensionID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("sitExtensionID", "path", "strfmt.UUID", raw) + } + o.SitExtensionID = *(value.(*strfmt.UUID)) + + if err := o.validateSitExtensionID(formats); err != nil { + return err + } + + return nil +} + +// validateSitExtensionID carries on validations for parameter SitExtensionID +func (o *ApproveSITExtensionParams) validateSitExtensionID(formats strfmt.Registry) error { + + if err := validate.FormatOf("sitExtensionID", "path", "uuid", o.SitExtensionID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go new file mode 100644 index 00000000000..1f06dd73705 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ApproveSITExtensionOKCode is the HTTP code returned for type ApproveSITExtensionOK +const ApproveSITExtensionOKCode int = 200 + +/* +ApproveSITExtensionOK Successfully approved a SIT extension + +swagger:response approveSITExtensionOK +*/ +type ApproveSITExtensionOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewApproveSITExtensionOK creates ApproveSITExtensionOK with default headers values +func NewApproveSITExtensionOK() *ApproveSITExtensionOK { + + return &ApproveSITExtensionOK{} +} + +// WithPayload adds the payload to the approve s i t extension o k response +func (o *ApproveSITExtensionOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveSITExtensionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension o k response +func (o *ApproveSITExtensionOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionForbiddenCode is the HTTP code returned for type ApproveSITExtensionForbidden +const ApproveSITExtensionForbiddenCode int = 403 + +/* +ApproveSITExtensionForbidden The request was denied + +swagger:response approveSITExtensionForbidden +*/ +type ApproveSITExtensionForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveSITExtensionForbidden creates ApproveSITExtensionForbidden with default headers values +func NewApproveSITExtensionForbidden() *ApproveSITExtensionForbidden { + + return &ApproveSITExtensionForbidden{} +} + +// WithPayload adds the payload to the approve s i t extension forbidden response +func (o *ApproveSITExtensionForbidden) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension forbidden response +func (o *ApproveSITExtensionForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionNotFoundCode is the HTTP code returned for type ApproveSITExtensionNotFound +const ApproveSITExtensionNotFoundCode int = 404 + +/* +ApproveSITExtensionNotFound The requested resource wasn't found + +swagger:response approveSITExtensionNotFound +*/ +type ApproveSITExtensionNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveSITExtensionNotFound creates ApproveSITExtensionNotFound with default headers values +func NewApproveSITExtensionNotFound() *ApproveSITExtensionNotFound { + + return &ApproveSITExtensionNotFound{} +} + +// WithPayload adds the payload to the approve s i t extension not found response +func (o *ApproveSITExtensionNotFound) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension not found response +func (o *ApproveSITExtensionNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionConflictCode is the HTTP code returned for type ApproveSITExtensionConflict +const ApproveSITExtensionConflictCode int = 409 + +/* +ApproveSITExtensionConflict Conflict error + +swagger:response approveSITExtensionConflict +*/ +type ApproveSITExtensionConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveSITExtensionConflict creates ApproveSITExtensionConflict with default headers values +func NewApproveSITExtensionConflict() *ApproveSITExtensionConflict { + + return &ApproveSITExtensionConflict{} +} + +// WithPayload adds the payload to the approve s i t extension conflict response +func (o *ApproveSITExtensionConflict) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension conflict response +func (o *ApproveSITExtensionConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionPreconditionFailedCode is the HTTP code returned for type ApproveSITExtensionPreconditionFailed +const ApproveSITExtensionPreconditionFailedCode int = 412 + +/* +ApproveSITExtensionPreconditionFailed Precondition failed + +swagger:response approveSITExtensionPreconditionFailed +*/ +type ApproveSITExtensionPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveSITExtensionPreconditionFailed creates ApproveSITExtensionPreconditionFailed with default headers values +func NewApproveSITExtensionPreconditionFailed() *ApproveSITExtensionPreconditionFailed { + + return &ApproveSITExtensionPreconditionFailed{} +} + +// WithPayload adds the payload to the approve s i t extension precondition failed response +func (o *ApproveSITExtensionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension precondition failed response +func (o *ApproveSITExtensionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionUnprocessableEntityCode is the HTTP code returned for type ApproveSITExtensionUnprocessableEntity +const ApproveSITExtensionUnprocessableEntityCode int = 422 + +/* +ApproveSITExtensionUnprocessableEntity The payload was unprocessable. + +swagger:response approveSITExtensionUnprocessableEntity +*/ +type ApproveSITExtensionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewApproveSITExtensionUnprocessableEntity creates ApproveSITExtensionUnprocessableEntity with default headers values +func NewApproveSITExtensionUnprocessableEntity() *ApproveSITExtensionUnprocessableEntity { + + return &ApproveSITExtensionUnprocessableEntity{} +} + +// WithPayload adds the payload to the approve s i t extension unprocessable entity response +func (o *ApproveSITExtensionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveSITExtensionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension unprocessable entity response +func (o *ApproveSITExtensionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveSITExtensionInternalServerErrorCode is the HTTP code returned for type ApproveSITExtensionInternalServerError +const ApproveSITExtensionInternalServerErrorCode int = 500 + +/* +ApproveSITExtensionInternalServerError A server error occurred + +swagger:response approveSITExtensionInternalServerError +*/ +type ApproveSITExtensionInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveSITExtensionInternalServerError creates ApproveSITExtensionInternalServerError with default headers values +func NewApproveSITExtensionInternalServerError() *ApproveSITExtensionInternalServerError { + + return &ApproveSITExtensionInternalServerError{} +} + +// WithPayload adds the payload to the approve s i t extension internal server error response +func (o *ApproveSITExtensionInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveSITExtensionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve s i t extension internal server error response +func (o *ApproveSITExtensionInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveSITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go new file mode 100644 index 00000000000..b487d453b47 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_s_i_t_extension_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ApproveSITExtensionURL generates an URL for the approve s i t extension operation +type ApproveSITExtensionURL struct { + ShipmentID strfmt.UUID + SitExtensionID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveSITExtensionURL) WithBasePath(bp string) *ApproveSITExtensionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveSITExtensionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveSITExtensionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on ApproveSITExtensionURL") + } + + sitExtensionID := o.SitExtensionID.String() + if sitExtensionID != "" { + _path = strings.Replace(_path, "{sitExtensionID}", sitExtensionID, -1) + } else { + return nil, errors.New("sitExtensionId is required on ApproveSITExtensionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveSITExtensionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveSITExtensionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveSITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveSITExtensionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveSITExtensionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveSITExtensionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go new file mode 100644 index 00000000000..619bd007cd9 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveShipmentHandlerFunc turns a function with the right signature into a approve shipment handler +type ApproveShipmentHandlerFunc func(ApproveShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveShipmentHandlerFunc) Handle(params ApproveShipmentParams) middleware.Responder { + return fn(params) +} + +// ApproveShipmentHandler interface for that can handle valid approve shipment params +type ApproveShipmentHandler interface { + Handle(ApproveShipmentParams) middleware.Responder +} + +// NewApproveShipment creates a new http.Handler for the approve shipment operation +func NewApproveShipment(ctx *middleware.Context, handler ApproveShipmentHandler) *ApproveShipment { + return &ApproveShipment{Context: ctx, Handler: handler} +} + +/* + ApproveShipment swagger:route POST /shipments/{shipmentID}/approve shipment approveShipment + +# Approves a shipment + +Approves a shipment +*/ +type ApproveShipment struct { + Context *middleware.Context + Handler ApproveShipmentHandler +} + +func (o *ApproveShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go new file mode 100644 index 00000000000..63b48bd30dc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveShipmentDiversionHandlerFunc turns a function with the right signature into a approve shipment diversion handler +type ApproveShipmentDiversionHandlerFunc func(ApproveShipmentDiversionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveShipmentDiversionHandlerFunc) Handle(params ApproveShipmentDiversionParams) middleware.Responder { + return fn(params) +} + +// ApproveShipmentDiversionHandler interface for that can handle valid approve shipment diversion params +type ApproveShipmentDiversionHandler interface { + Handle(ApproveShipmentDiversionParams) middleware.Responder +} + +// NewApproveShipmentDiversion creates a new http.Handler for the approve shipment diversion operation +func NewApproveShipmentDiversion(ctx *middleware.Context, handler ApproveShipmentDiversionHandler) *ApproveShipmentDiversion { + return &ApproveShipmentDiversion{Context: ctx, Handler: handler} +} + +/* + ApproveShipmentDiversion swagger:route POST /shipments/{shipmentID}/approve-diversion shipment approveShipmentDiversion + +# Approves a shipment diversion + +Approves a shipment diversion +*/ +type ApproveShipmentDiversion struct { + Context *middleware.Context + Handler ApproveShipmentDiversionHandler +} + +func (o *ApproveShipmentDiversion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveShipmentDiversionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go new file mode 100644 index 00000000000..303b41dbcbe --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewApproveShipmentDiversionParams creates a new ApproveShipmentDiversionParams object +// +// There are no default values defined in the spec. +func NewApproveShipmentDiversionParams() ApproveShipmentDiversionParams { + + return ApproveShipmentDiversionParams{} +} + +// ApproveShipmentDiversionParams contains all the bound params for the approve shipment diversion operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveShipmentDiversion +type ApproveShipmentDiversionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveShipmentDiversionParams() beforehand. +func (o *ApproveShipmentDiversionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *ApproveShipmentDiversionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *ApproveShipmentDiversionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *ApproveShipmentDiversionParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go new file mode 100644 index 00000000000..b85cdd36c85 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ApproveShipmentDiversionOKCode is the HTTP code returned for type ApproveShipmentDiversionOK +const ApproveShipmentDiversionOKCode int = 200 + +/* +ApproveShipmentDiversionOK Successfully approved the shipment diversion + +swagger:response approveShipmentDiversionOK +*/ +type ApproveShipmentDiversionOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionOK creates ApproveShipmentDiversionOK with default headers values +func NewApproveShipmentDiversionOK() *ApproveShipmentDiversionOK { + + return &ApproveShipmentDiversionOK{} +} + +// WithPayload adds the payload to the approve shipment diversion o k response +func (o *ApproveShipmentDiversionOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveShipmentDiversionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion o k response +func (o *ApproveShipmentDiversionOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionForbiddenCode is the HTTP code returned for type ApproveShipmentDiversionForbidden +const ApproveShipmentDiversionForbiddenCode int = 403 + +/* +ApproveShipmentDiversionForbidden The request was denied + +swagger:response approveShipmentDiversionForbidden +*/ +type ApproveShipmentDiversionForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionForbidden creates ApproveShipmentDiversionForbidden with default headers values +func NewApproveShipmentDiversionForbidden() *ApproveShipmentDiversionForbidden { + + return &ApproveShipmentDiversionForbidden{} +} + +// WithPayload adds the payload to the approve shipment diversion forbidden response +func (o *ApproveShipmentDiversionForbidden) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion forbidden response +func (o *ApproveShipmentDiversionForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionNotFoundCode is the HTTP code returned for type ApproveShipmentDiversionNotFound +const ApproveShipmentDiversionNotFoundCode int = 404 + +/* +ApproveShipmentDiversionNotFound The requested resource wasn't found + +swagger:response approveShipmentDiversionNotFound +*/ +type ApproveShipmentDiversionNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionNotFound creates ApproveShipmentDiversionNotFound with default headers values +func NewApproveShipmentDiversionNotFound() *ApproveShipmentDiversionNotFound { + + return &ApproveShipmentDiversionNotFound{} +} + +// WithPayload adds the payload to the approve shipment diversion not found response +func (o *ApproveShipmentDiversionNotFound) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion not found response +func (o *ApproveShipmentDiversionNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionConflictCode is the HTTP code returned for type ApproveShipmentDiversionConflict +const ApproveShipmentDiversionConflictCode int = 409 + +/* +ApproveShipmentDiversionConflict Conflict error + +swagger:response approveShipmentDiversionConflict +*/ +type ApproveShipmentDiversionConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionConflict creates ApproveShipmentDiversionConflict with default headers values +func NewApproveShipmentDiversionConflict() *ApproveShipmentDiversionConflict { + + return &ApproveShipmentDiversionConflict{} +} + +// WithPayload adds the payload to the approve shipment diversion conflict response +func (o *ApproveShipmentDiversionConflict) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion conflict response +func (o *ApproveShipmentDiversionConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionPreconditionFailedCode is the HTTP code returned for type ApproveShipmentDiversionPreconditionFailed +const ApproveShipmentDiversionPreconditionFailedCode int = 412 + +/* +ApproveShipmentDiversionPreconditionFailed Precondition failed + +swagger:response approveShipmentDiversionPreconditionFailed +*/ +type ApproveShipmentDiversionPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionPreconditionFailed creates ApproveShipmentDiversionPreconditionFailed with default headers values +func NewApproveShipmentDiversionPreconditionFailed() *ApproveShipmentDiversionPreconditionFailed { + + return &ApproveShipmentDiversionPreconditionFailed{} +} + +// WithPayload adds the payload to the approve shipment diversion precondition failed response +func (o *ApproveShipmentDiversionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion precondition failed response +func (o *ApproveShipmentDiversionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionUnprocessableEntityCode is the HTTP code returned for type ApproveShipmentDiversionUnprocessableEntity +const ApproveShipmentDiversionUnprocessableEntityCode int = 422 + +/* +ApproveShipmentDiversionUnprocessableEntity The payload was unprocessable. + +swagger:response approveShipmentDiversionUnprocessableEntity +*/ +type ApproveShipmentDiversionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionUnprocessableEntity creates ApproveShipmentDiversionUnprocessableEntity with default headers values +func NewApproveShipmentDiversionUnprocessableEntity() *ApproveShipmentDiversionUnprocessableEntity { + + return &ApproveShipmentDiversionUnprocessableEntity{} +} + +// WithPayload adds the payload to the approve shipment diversion unprocessable entity response +func (o *ApproveShipmentDiversionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveShipmentDiversionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion unprocessable entity response +func (o *ApproveShipmentDiversionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentDiversionInternalServerErrorCode is the HTTP code returned for type ApproveShipmentDiversionInternalServerError +const ApproveShipmentDiversionInternalServerErrorCode int = 500 + +/* +ApproveShipmentDiversionInternalServerError A server error occurred + +swagger:response approveShipmentDiversionInternalServerError +*/ +type ApproveShipmentDiversionInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentDiversionInternalServerError creates ApproveShipmentDiversionInternalServerError with default headers values +func NewApproveShipmentDiversionInternalServerError() *ApproveShipmentDiversionInternalServerError { + + return &ApproveShipmentDiversionInternalServerError{} +} + +// WithPayload adds the payload to the approve shipment diversion internal server error response +func (o *ApproveShipmentDiversionInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveShipmentDiversionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment diversion internal server error response +func (o *ApproveShipmentDiversionInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentDiversionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go new file mode 100644 index 00000000000..6b65d5179ee --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_diversion_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ApproveShipmentDiversionURL generates an URL for the approve shipment diversion operation +type ApproveShipmentDiversionURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentDiversionURL) WithBasePath(bp string) *ApproveShipmentDiversionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentDiversionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveShipmentDiversionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/approve-diversion" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on ApproveShipmentDiversionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveShipmentDiversionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveShipmentDiversionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveShipmentDiversionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveShipmentDiversionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveShipmentDiversionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveShipmentDiversionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go new file mode 100644 index 00000000000..1d3ce107f57 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewApproveShipmentParams creates a new ApproveShipmentParams object +// +// There are no default values defined in the spec. +func NewApproveShipmentParams() ApproveShipmentParams { + + return ApproveShipmentParams{} +} + +// ApproveShipmentParams contains all the bound params for the approve shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveShipment +type ApproveShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveShipmentParams() beforehand. +func (o *ApproveShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *ApproveShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *ApproveShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *ApproveShipmentParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go new file mode 100644 index 00000000000..1e9cbc2b79a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ApproveShipmentOKCode is the HTTP code returned for type ApproveShipmentOK +const ApproveShipmentOKCode int = 200 + +/* +ApproveShipmentOK Successfully approved the shipment + +swagger:response approveShipmentOK +*/ +type ApproveShipmentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewApproveShipmentOK creates ApproveShipmentOK with default headers values +func NewApproveShipmentOK() *ApproveShipmentOK { + + return &ApproveShipmentOK{} +} + +// WithPayload adds the payload to the approve shipment o k response +func (o *ApproveShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *ApproveShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment o k response +func (o *ApproveShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentForbiddenCode is the HTTP code returned for type ApproveShipmentForbidden +const ApproveShipmentForbiddenCode int = 403 + +/* +ApproveShipmentForbidden The request was denied + +swagger:response approveShipmentForbidden +*/ +type ApproveShipmentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentForbidden creates ApproveShipmentForbidden with default headers values +func NewApproveShipmentForbidden() *ApproveShipmentForbidden { + + return &ApproveShipmentForbidden{} +} + +// WithPayload adds the payload to the approve shipment forbidden response +func (o *ApproveShipmentForbidden) WithPayload(payload *ghcmessages.Error) *ApproveShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment forbidden response +func (o *ApproveShipmentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentNotFoundCode is the HTTP code returned for type ApproveShipmentNotFound +const ApproveShipmentNotFoundCode int = 404 + +/* +ApproveShipmentNotFound The requested resource wasn't found + +swagger:response approveShipmentNotFound +*/ +type ApproveShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentNotFound creates ApproveShipmentNotFound with default headers values +func NewApproveShipmentNotFound() *ApproveShipmentNotFound { + + return &ApproveShipmentNotFound{} +} + +// WithPayload adds the payload to the approve shipment not found response +func (o *ApproveShipmentNotFound) WithPayload(payload *ghcmessages.Error) *ApproveShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment not found response +func (o *ApproveShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentConflictCode is the HTTP code returned for type ApproveShipmentConflict +const ApproveShipmentConflictCode int = 409 + +/* +ApproveShipmentConflict Conflict error + +swagger:response approveShipmentConflict +*/ +type ApproveShipmentConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentConflict creates ApproveShipmentConflict with default headers values +func NewApproveShipmentConflict() *ApproveShipmentConflict { + + return &ApproveShipmentConflict{} +} + +// WithPayload adds the payload to the approve shipment conflict response +func (o *ApproveShipmentConflict) WithPayload(payload *ghcmessages.Error) *ApproveShipmentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment conflict response +func (o *ApproveShipmentConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentPreconditionFailedCode is the HTTP code returned for type ApproveShipmentPreconditionFailed +const ApproveShipmentPreconditionFailedCode int = 412 + +/* +ApproveShipmentPreconditionFailed Precondition failed + +swagger:response approveShipmentPreconditionFailed +*/ +type ApproveShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentPreconditionFailed creates ApproveShipmentPreconditionFailed with default headers values +func NewApproveShipmentPreconditionFailed() *ApproveShipmentPreconditionFailed { + + return &ApproveShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the approve shipment precondition failed response +func (o *ApproveShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment precondition failed response +func (o *ApproveShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentUnprocessableEntityCode is the HTTP code returned for type ApproveShipmentUnprocessableEntity +const ApproveShipmentUnprocessableEntityCode int = 422 + +/* +ApproveShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response approveShipmentUnprocessableEntity +*/ +type ApproveShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewApproveShipmentUnprocessableEntity creates ApproveShipmentUnprocessableEntity with default headers values +func NewApproveShipmentUnprocessableEntity() *ApproveShipmentUnprocessableEntity { + + return &ApproveShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the approve shipment unprocessable entity response +func (o *ApproveShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment unprocessable entity response +func (o *ApproveShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentInternalServerErrorCode is the HTTP code returned for type ApproveShipmentInternalServerError +const ApproveShipmentInternalServerErrorCode int = 500 + +/* +ApproveShipmentInternalServerError A server error occurred + +swagger:response approveShipmentInternalServerError +*/ +type ApproveShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentInternalServerError creates ApproveShipmentInternalServerError with default headers values +func NewApproveShipmentInternalServerError() *ApproveShipmentInternalServerError { + + return &ApproveShipmentInternalServerError{} +} + +// WithPayload adds the payload to the approve shipment internal server error response +func (o *ApproveShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipment internal server error response +func (o *ApproveShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go new file mode 100644 index 00000000000..973399fecdc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ApproveShipmentURL generates an URL for the approve shipment operation +type ApproveShipmentURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentURL) WithBasePath(bp string) *ApproveShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/approve" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on ApproveShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go new file mode 100644 index 00000000000..7e69baf206f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateApprovedSITDurationUpdateHandlerFunc turns a function with the right signature into a create approved s i t duration update handler +type CreateApprovedSITDurationUpdateHandlerFunc func(CreateApprovedSITDurationUpdateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateApprovedSITDurationUpdateHandlerFunc) Handle(params CreateApprovedSITDurationUpdateParams) middleware.Responder { + return fn(params) +} + +// CreateApprovedSITDurationUpdateHandler interface for that can handle valid create approved s i t duration update params +type CreateApprovedSITDurationUpdateHandler interface { + Handle(CreateApprovedSITDurationUpdateParams) middleware.Responder +} + +// NewCreateApprovedSITDurationUpdate creates a new http.Handler for the create approved s i t duration update operation +func NewCreateApprovedSITDurationUpdate(ctx *middleware.Context, handler CreateApprovedSITDurationUpdateHandler) *CreateApprovedSITDurationUpdate { + return &CreateApprovedSITDurationUpdate{Context: ctx, Handler: handler} +} + +/* + CreateApprovedSITDurationUpdate swagger:route POST /shipments/{shipmentID}/sit-extensions shipment sitExtension createApprovedSITDurationUpdate + +# Create an approved SIT Duration Update + +TOO can creates an already-approved SIT Duration Update on behalf of a customer +*/ +type CreateApprovedSITDurationUpdate struct { + Context *middleware.Context + Handler CreateApprovedSITDurationUpdateHandler +} + +func (o *CreateApprovedSITDurationUpdate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateApprovedSITDurationUpdateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go new file mode 100644 index 00000000000..6c9cf6b1660 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewCreateApprovedSITDurationUpdateParams creates a new CreateApprovedSITDurationUpdateParams object +// +// There are no default values defined in the spec. +func NewCreateApprovedSITDurationUpdateParams() CreateApprovedSITDurationUpdateParams { + + return CreateApprovedSITDurationUpdateParams{} +} + +// CreateApprovedSITDurationUpdateParams contains all the bound params for the create approved s i t duration update operation +// typically these are obtained from a http.Request +// +// swagger:parameters createApprovedSITDurationUpdate +type CreateApprovedSITDurationUpdateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.CreateApprovedSITDurationUpdate + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateApprovedSITDurationUpdateParams() beforehand. +func (o *CreateApprovedSITDurationUpdateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.CreateApprovedSITDurationUpdate + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *CreateApprovedSITDurationUpdateParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *CreateApprovedSITDurationUpdateParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *CreateApprovedSITDurationUpdateParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go new file mode 100644 index 00000000000..8e3f3f6f2d7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateApprovedSITDurationUpdateOKCode is the HTTP code returned for type CreateApprovedSITDurationUpdateOK +const CreateApprovedSITDurationUpdateOKCode int = 200 + +/* +CreateApprovedSITDurationUpdateOK Successfully created a SIT Extension. + +swagger:response createApprovedSITDurationUpdateOK +*/ +type CreateApprovedSITDurationUpdateOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateOK creates CreateApprovedSITDurationUpdateOK with default headers values +func NewCreateApprovedSITDurationUpdateOK() *CreateApprovedSITDurationUpdateOK { + + return &CreateApprovedSITDurationUpdateOK{} +} + +// WithPayload adds the payload to the create approved s i t duration update o k response +func (o *CreateApprovedSITDurationUpdateOK) WithPayload(payload *ghcmessages.MTOShipment) *CreateApprovedSITDurationUpdateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update o k response +func (o *CreateApprovedSITDurationUpdateOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateApprovedSITDurationUpdateBadRequestCode is the HTTP code returned for type CreateApprovedSITDurationUpdateBadRequest +const CreateApprovedSITDurationUpdateBadRequestCode int = 400 + +/* +CreateApprovedSITDurationUpdateBadRequest The request payload is invalid + +swagger:response createApprovedSITDurationUpdateBadRequest +*/ +type CreateApprovedSITDurationUpdateBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateBadRequest creates CreateApprovedSITDurationUpdateBadRequest with default headers values +func NewCreateApprovedSITDurationUpdateBadRequest() *CreateApprovedSITDurationUpdateBadRequest { + + return &CreateApprovedSITDurationUpdateBadRequest{} +} + +// WithPayload adds the payload to the create approved s i t duration update bad request response +func (o *CreateApprovedSITDurationUpdateBadRequest) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update bad request response +func (o *CreateApprovedSITDurationUpdateBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateApprovedSITDurationUpdateForbiddenCode is the HTTP code returned for type CreateApprovedSITDurationUpdateForbidden +const CreateApprovedSITDurationUpdateForbiddenCode int = 403 + +/* +CreateApprovedSITDurationUpdateForbidden The request was denied + +swagger:response createApprovedSITDurationUpdateForbidden +*/ +type CreateApprovedSITDurationUpdateForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateForbidden creates CreateApprovedSITDurationUpdateForbidden with default headers values +func NewCreateApprovedSITDurationUpdateForbidden() *CreateApprovedSITDurationUpdateForbidden { + + return &CreateApprovedSITDurationUpdateForbidden{} +} + +// WithPayload adds the payload to the create approved s i t duration update forbidden response +func (o *CreateApprovedSITDurationUpdateForbidden) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update forbidden response +func (o *CreateApprovedSITDurationUpdateForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateApprovedSITDurationUpdateNotFoundCode is the HTTP code returned for type CreateApprovedSITDurationUpdateNotFound +const CreateApprovedSITDurationUpdateNotFoundCode int = 404 + +/* +CreateApprovedSITDurationUpdateNotFound The requested resource wasn't found + +swagger:response createApprovedSITDurationUpdateNotFound +*/ +type CreateApprovedSITDurationUpdateNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateNotFound creates CreateApprovedSITDurationUpdateNotFound with default headers values +func NewCreateApprovedSITDurationUpdateNotFound() *CreateApprovedSITDurationUpdateNotFound { + + return &CreateApprovedSITDurationUpdateNotFound{} +} + +// WithPayload adds the payload to the create approved s i t duration update not found response +func (o *CreateApprovedSITDurationUpdateNotFound) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update not found response +func (o *CreateApprovedSITDurationUpdateNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateApprovedSITDurationUpdateUnprocessableEntityCode is the HTTP code returned for type CreateApprovedSITDurationUpdateUnprocessableEntity +const CreateApprovedSITDurationUpdateUnprocessableEntityCode int = 422 + +/* +CreateApprovedSITDurationUpdateUnprocessableEntity The payload was unprocessable. + +swagger:response createApprovedSITDurationUpdateUnprocessableEntity +*/ +type CreateApprovedSITDurationUpdateUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateUnprocessableEntity creates CreateApprovedSITDurationUpdateUnprocessableEntity with default headers values +func NewCreateApprovedSITDurationUpdateUnprocessableEntity() *CreateApprovedSITDurationUpdateUnprocessableEntity { + + return &CreateApprovedSITDurationUpdateUnprocessableEntity{} +} + +// WithPayload adds the payload to the create approved s i t duration update unprocessable entity response +func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *CreateApprovedSITDurationUpdateUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update unprocessable entity response +func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateApprovedSITDurationUpdateInternalServerErrorCode is the HTTP code returned for type CreateApprovedSITDurationUpdateInternalServerError +const CreateApprovedSITDurationUpdateInternalServerErrorCode int = 500 + +/* +CreateApprovedSITDurationUpdateInternalServerError A server error occurred + +swagger:response createApprovedSITDurationUpdateInternalServerError +*/ +type CreateApprovedSITDurationUpdateInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewCreateApprovedSITDurationUpdateInternalServerError creates CreateApprovedSITDurationUpdateInternalServerError with default headers values +func NewCreateApprovedSITDurationUpdateInternalServerError() *CreateApprovedSITDurationUpdateInternalServerError { + + return &CreateApprovedSITDurationUpdateInternalServerError{} +} + +// WithPayload adds the payload to the create approved s i t duration update internal server error response +func (o *CreateApprovedSITDurationUpdateInternalServerError) WithPayload(payload *ghcmessages.Error) *CreateApprovedSITDurationUpdateInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create approved s i t duration update internal server error response +func (o *CreateApprovedSITDurationUpdateInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateApprovedSITDurationUpdateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go new file mode 100644 index 00000000000..4366475a2cc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/create_approved_s_i_t_duration_update_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateApprovedSITDurationUpdateURL generates an URL for the create approved s i t duration update operation +type CreateApprovedSITDurationUpdateURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateApprovedSITDurationUpdateURL) WithBasePath(bp string) *CreateApprovedSITDurationUpdateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateApprovedSITDurationUpdateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateApprovedSITDurationUpdateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/sit-extensions" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on CreateApprovedSITDurationUpdateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateApprovedSITDurationUpdateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateApprovedSITDurationUpdateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateApprovedSITDurationUpdateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateApprovedSITDurationUpdateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateApprovedSITDurationUpdateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateApprovedSITDurationUpdateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go new file mode 100644 index 00000000000..a030f176181 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteShipmentHandlerFunc turns a function with the right signature into a delete shipment handler +type DeleteShipmentHandlerFunc func(DeleteShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteShipmentHandlerFunc) Handle(params DeleteShipmentParams) middleware.Responder { + return fn(params) +} + +// DeleteShipmentHandler interface for that can handle valid delete shipment params +type DeleteShipmentHandler interface { + Handle(DeleteShipmentParams) middleware.Responder +} + +// NewDeleteShipment creates a new http.Handler for the delete shipment operation +func NewDeleteShipment(ctx *middleware.Context, handler DeleteShipmentHandler) *DeleteShipment { + return &DeleteShipment{Context: ctx, Handler: handler} +} + +/* + DeleteShipment swagger:route DELETE /shipments/{shipmentID} shipment deleteShipment + +# Soft deletes a shipment by ID + +Soft deletes a shipment by ID +*/ +type DeleteShipment struct { + Context *middleware.Context + Handler DeleteShipmentHandler +} + +func (o *DeleteShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go new file mode 100644 index 00000000000..08bc880b2c0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteShipmentParams creates a new DeleteShipmentParams object +// +// There are no default values defined in the spec. +func NewDeleteShipmentParams() DeleteShipmentParams { + + return DeleteShipmentParams{} +} + +// DeleteShipmentParams contains all the bound params for the delete shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteShipment +type DeleteShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the shipment to be deleted + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteShipmentParams() beforehand. +func (o *DeleteShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *DeleteShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *DeleteShipmentParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go new file mode 100644 index 00000000000..fe39e60931b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DeleteShipmentNoContentCode is the HTTP code returned for type DeleteShipmentNoContent +const DeleteShipmentNoContentCode int = 204 + +/* +DeleteShipmentNoContent Successfully soft deleted the shipment + +swagger:response deleteShipmentNoContent +*/ +type DeleteShipmentNoContent struct { +} + +// NewDeleteShipmentNoContent creates DeleteShipmentNoContent with default headers values +func NewDeleteShipmentNoContent() *DeleteShipmentNoContent { + + return &DeleteShipmentNoContent{} +} + +// WriteResponse to the client +func (o *DeleteShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteShipmentBadRequestCode is the HTTP code returned for type DeleteShipmentBadRequest +const DeleteShipmentBadRequestCode int = 400 + +/* +DeleteShipmentBadRequest The request payload is invalid + +swagger:response deleteShipmentBadRequest +*/ +type DeleteShipmentBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentBadRequest creates DeleteShipmentBadRequest with default headers values +func NewDeleteShipmentBadRequest() *DeleteShipmentBadRequest { + + return &DeleteShipmentBadRequest{} +} + +// WithPayload adds the payload to the delete shipment bad request response +func (o *DeleteShipmentBadRequest) WithPayload(payload *ghcmessages.Error) *DeleteShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment bad request response +func (o *DeleteShipmentBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentForbiddenCode is the HTTP code returned for type DeleteShipmentForbidden +const DeleteShipmentForbiddenCode int = 403 + +/* +DeleteShipmentForbidden The request was denied + +swagger:response deleteShipmentForbidden +*/ +type DeleteShipmentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentForbidden creates DeleteShipmentForbidden with default headers values +func NewDeleteShipmentForbidden() *DeleteShipmentForbidden { + + return &DeleteShipmentForbidden{} +} + +// WithPayload adds the payload to the delete shipment forbidden response +func (o *DeleteShipmentForbidden) WithPayload(payload *ghcmessages.Error) *DeleteShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment forbidden response +func (o *DeleteShipmentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentNotFoundCode is the HTTP code returned for type DeleteShipmentNotFound +const DeleteShipmentNotFoundCode int = 404 + +/* +DeleteShipmentNotFound The requested resource wasn't found + +swagger:response deleteShipmentNotFound +*/ +type DeleteShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentNotFound creates DeleteShipmentNotFound with default headers values +func NewDeleteShipmentNotFound() *DeleteShipmentNotFound { + + return &DeleteShipmentNotFound{} +} + +// WithPayload adds the payload to the delete shipment not found response +func (o *DeleteShipmentNotFound) WithPayload(payload *ghcmessages.Error) *DeleteShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment not found response +func (o *DeleteShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentConflictCode is the HTTP code returned for type DeleteShipmentConflict +const DeleteShipmentConflictCode int = 409 + +/* +DeleteShipmentConflict Conflict error + +swagger:response deleteShipmentConflict +*/ +type DeleteShipmentConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentConflict creates DeleteShipmentConflict with default headers values +func NewDeleteShipmentConflict() *DeleteShipmentConflict { + + return &DeleteShipmentConflict{} +} + +// WithPayload adds the payload to the delete shipment conflict response +func (o *DeleteShipmentConflict) WithPayload(payload *ghcmessages.Error) *DeleteShipmentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment conflict response +func (o *DeleteShipmentConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteShipmentUnprocessableEntity +const DeleteShipmentUnprocessableEntityCode int = 422 + +/* +DeleteShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response deleteShipmentUnprocessableEntity +*/ +type DeleteShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteShipmentUnprocessableEntity creates DeleteShipmentUnprocessableEntity with default headers values +func NewDeleteShipmentUnprocessableEntity() *DeleteShipmentUnprocessableEntity { + + return &DeleteShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete shipment unprocessable entity response +func (o *DeleteShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DeleteShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment unprocessable entity response +func (o *DeleteShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentInternalServerErrorCode is the HTTP code returned for type DeleteShipmentInternalServerError +const DeleteShipmentInternalServerErrorCode int = 500 + +/* +DeleteShipmentInternalServerError A server error occurred + +swagger:response deleteShipmentInternalServerError +*/ +type DeleteShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentInternalServerError creates DeleteShipmentInternalServerError with default headers values +func NewDeleteShipmentInternalServerError() *DeleteShipmentInternalServerError { + + return &DeleteShipmentInternalServerError{} +} + +// WithPayload adds the payload to the delete shipment internal server error response +func (o *DeleteShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *DeleteShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment internal server error response +func (o *DeleteShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go new file mode 100644 index 00000000000..6440e1fc6bc --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/delete_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteShipmentURL generates an URL for the delete shipment operation +type DeleteShipmentURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteShipmentURL) WithBasePath(bp string) *DeleteShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on DeleteShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go new file mode 100644 index 00000000000..84541c09914 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DenySITExtensionHandlerFunc turns a function with the right signature into a deny s i t extension handler +type DenySITExtensionHandlerFunc func(DenySITExtensionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DenySITExtensionHandlerFunc) Handle(params DenySITExtensionParams) middleware.Responder { + return fn(params) +} + +// DenySITExtensionHandler interface for that can handle valid deny s i t extension params +type DenySITExtensionHandler interface { + Handle(DenySITExtensionParams) middleware.Responder +} + +// NewDenySITExtension creates a new http.Handler for the deny s i t extension operation +func NewDenySITExtension(ctx *middleware.Context, handler DenySITExtensionHandler) *DenySITExtension { + return &DenySITExtension{Context: ctx, Handler: handler} +} + +/* + DenySITExtension swagger:route PATCH /shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny shipment sitExtension denySITExtension + +# Denies a SIT extension + +Denies a SIT extension +*/ +type DenySITExtension struct { + Context *middleware.Context + Handler DenySITExtensionHandler +} + +func (o *DenySITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDenySITExtensionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go new file mode 100644 index 00000000000..5a4faeea715 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_parameters.go @@ -0,0 +1,200 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewDenySITExtensionParams creates a new DenySITExtensionParams object +// +// There are no default values defined in the spec. +func NewDenySITExtensionParams() DenySITExtensionParams { + + return DenySITExtensionParams{} +} + +// DenySITExtensionParams contains all the bound params for the deny s i t extension operation +// typically these are obtained from a http.Request +// +// swagger:parameters denySITExtension +type DenySITExtensionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.DenySITExtension + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID + /*ID of the SIT extension + Required: true + In: path + */ + SitExtensionID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDenySITExtensionParams() beforehand. +func (o *DenySITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.DenySITExtension + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rSitExtensionID, rhkSitExtensionID, _ := route.Params.GetOK("sitExtensionID") + if err := o.bindSitExtensionID(rSitExtensionID, rhkSitExtensionID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *DenySITExtensionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *DenySITExtensionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *DenySITExtensionParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindSitExtensionID binds and validates parameter SitExtensionID from path. +func (o *DenySITExtensionParams) bindSitExtensionID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("sitExtensionID", "path", "strfmt.UUID", raw) + } + o.SitExtensionID = *(value.(*strfmt.UUID)) + + if err := o.validateSitExtensionID(formats); err != nil { + return err + } + + return nil +} + +// validateSitExtensionID carries on validations for parameter SitExtensionID +func (o *DenySITExtensionParams) validateSitExtensionID(formats strfmt.Registry) error { + + if err := validate.FormatOf("sitExtensionID", "path", "uuid", o.SitExtensionID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go new file mode 100644 index 00000000000..9a71d77ef32 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DenySITExtensionOKCode is the HTTP code returned for type DenySITExtensionOK +const DenySITExtensionOKCode int = 200 + +/* +DenySITExtensionOK Successfully denied a SIT extension + +swagger:response denySITExtensionOK +*/ +type DenySITExtensionOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewDenySITExtensionOK creates DenySITExtensionOK with default headers values +func NewDenySITExtensionOK() *DenySITExtensionOK { + + return &DenySITExtensionOK{} +} + +// WithPayload adds the payload to the deny s i t extension o k response +func (o *DenySITExtensionOK) WithPayload(payload *ghcmessages.MTOShipment) *DenySITExtensionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension o k response +func (o *DenySITExtensionOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionForbiddenCode is the HTTP code returned for type DenySITExtensionForbidden +const DenySITExtensionForbiddenCode int = 403 + +/* +DenySITExtensionForbidden The request was denied + +swagger:response denySITExtensionForbidden +*/ +type DenySITExtensionForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDenySITExtensionForbidden creates DenySITExtensionForbidden with default headers values +func NewDenySITExtensionForbidden() *DenySITExtensionForbidden { + + return &DenySITExtensionForbidden{} +} + +// WithPayload adds the payload to the deny s i t extension forbidden response +func (o *DenySITExtensionForbidden) WithPayload(payload *ghcmessages.Error) *DenySITExtensionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension forbidden response +func (o *DenySITExtensionForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionNotFoundCode is the HTTP code returned for type DenySITExtensionNotFound +const DenySITExtensionNotFoundCode int = 404 + +/* +DenySITExtensionNotFound The requested resource wasn't found + +swagger:response denySITExtensionNotFound +*/ +type DenySITExtensionNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDenySITExtensionNotFound creates DenySITExtensionNotFound with default headers values +func NewDenySITExtensionNotFound() *DenySITExtensionNotFound { + + return &DenySITExtensionNotFound{} +} + +// WithPayload adds the payload to the deny s i t extension not found response +func (o *DenySITExtensionNotFound) WithPayload(payload *ghcmessages.Error) *DenySITExtensionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension not found response +func (o *DenySITExtensionNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionConflictCode is the HTTP code returned for type DenySITExtensionConflict +const DenySITExtensionConflictCode int = 409 + +/* +DenySITExtensionConflict Conflict error + +swagger:response denySITExtensionConflict +*/ +type DenySITExtensionConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDenySITExtensionConflict creates DenySITExtensionConflict with default headers values +func NewDenySITExtensionConflict() *DenySITExtensionConflict { + + return &DenySITExtensionConflict{} +} + +// WithPayload adds the payload to the deny s i t extension conflict response +func (o *DenySITExtensionConflict) WithPayload(payload *ghcmessages.Error) *DenySITExtensionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension conflict response +func (o *DenySITExtensionConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionPreconditionFailedCode is the HTTP code returned for type DenySITExtensionPreconditionFailed +const DenySITExtensionPreconditionFailedCode int = 412 + +/* +DenySITExtensionPreconditionFailed Precondition failed + +swagger:response denySITExtensionPreconditionFailed +*/ +type DenySITExtensionPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDenySITExtensionPreconditionFailed creates DenySITExtensionPreconditionFailed with default headers values +func NewDenySITExtensionPreconditionFailed() *DenySITExtensionPreconditionFailed { + + return &DenySITExtensionPreconditionFailed{} +} + +// WithPayload adds the payload to the deny s i t extension precondition failed response +func (o *DenySITExtensionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *DenySITExtensionPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension precondition failed response +func (o *DenySITExtensionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionUnprocessableEntityCode is the HTTP code returned for type DenySITExtensionUnprocessableEntity +const DenySITExtensionUnprocessableEntityCode int = 422 + +/* +DenySITExtensionUnprocessableEntity The payload was unprocessable. + +swagger:response denySITExtensionUnprocessableEntity +*/ +type DenySITExtensionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewDenySITExtensionUnprocessableEntity creates DenySITExtensionUnprocessableEntity with default headers values +func NewDenySITExtensionUnprocessableEntity() *DenySITExtensionUnprocessableEntity { + + return &DenySITExtensionUnprocessableEntity{} +} + +// WithPayload adds the payload to the deny s i t extension unprocessable entity response +func (o *DenySITExtensionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *DenySITExtensionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension unprocessable entity response +func (o *DenySITExtensionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DenySITExtensionInternalServerErrorCode is the HTTP code returned for type DenySITExtensionInternalServerError +const DenySITExtensionInternalServerErrorCode int = 500 + +/* +DenySITExtensionInternalServerError A server error occurred + +swagger:response denySITExtensionInternalServerError +*/ +type DenySITExtensionInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewDenySITExtensionInternalServerError creates DenySITExtensionInternalServerError with default headers values +func NewDenySITExtensionInternalServerError() *DenySITExtensionInternalServerError { + + return &DenySITExtensionInternalServerError{} +} + +// WithPayload adds the payload to the deny s i t extension internal server error response +func (o *DenySITExtensionInternalServerError) WithPayload(payload *ghcmessages.Error) *DenySITExtensionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the deny s i t extension internal server error response +func (o *DenySITExtensionInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DenySITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go new file mode 100644 index 00000000000..d1c2628bad0 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/deny_s_i_t_extension_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DenySITExtensionURL generates an URL for the deny s i t extension operation +type DenySITExtensionURL struct { + ShipmentID strfmt.UUID + SitExtensionID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DenySITExtensionURL) WithBasePath(bp string) *DenySITExtensionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DenySITExtensionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DenySITExtensionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on DenySITExtensionURL") + } + + sitExtensionID := o.SitExtensionID.String() + if sitExtensionID != "" { + _path = strings.Replace(_path, "{sitExtensionID}", sitExtensionID, -1) + } else { + return nil, errors.New("sitExtensionId is required on DenySITExtensionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DenySITExtensionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DenySITExtensionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DenySITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DenySITExtensionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DenySITExtensionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DenySITExtensionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go new file mode 100644 index 00000000000..091eb60c5d8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RejectShipmentHandlerFunc turns a function with the right signature into a reject shipment handler +type RejectShipmentHandlerFunc func(RejectShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RejectShipmentHandlerFunc) Handle(params RejectShipmentParams) middleware.Responder { + return fn(params) +} + +// RejectShipmentHandler interface for that can handle valid reject shipment params +type RejectShipmentHandler interface { + Handle(RejectShipmentParams) middleware.Responder +} + +// NewRejectShipment creates a new http.Handler for the reject shipment operation +func NewRejectShipment(ctx *middleware.Context, handler RejectShipmentHandler) *RejectShipment { + return &RejectShipment{Context: ctx, Handler: handler} +} + +/* + RejectShipment swagger:route POST /shipments/{shipmentID}/reject shipment rejectShipment + +rejects a shipment + +rejects a shipment +*/ +type RejectShipment struct { + Context *middleware.Context + Handler RejectShipmentHandler +} + +func (o *RejectShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRejectShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go new file mode 100644 index 00000000000..a4ac8d82304 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewRejectShipmentParams creates a new RejectShipmentParams object +// +// There are no default values defined in the spec. +func NewRejectShipmentParams() RejectShipmentParams { + + return RejectShipmentParams{} +} + +// RejectShipmentParams contains all the bound params for the reject shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters rejectShipment +type RejectShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.RejectShipment + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRejectShipmentParams() beforehand. +func (o *RejectShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.RejectShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *RejectShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *RejectShipmentParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *RejectShipmentParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go new file mode 100644 index 00000000000..e28b2f38671 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// RejectShipmentOKCode is the HTTP code returned for type RejectShipmentOK +const RejectShipmentOKCode int = 200 + +/* +RejectShipmentOK Successfully rejected the shipment + +swagger:response rejectShipmentOK +*/ +type RejectShipmentOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewRejectShipmentOK creates RejectShipmentOK with default headers values +func NewRejectShipmentOK() *RejectShipmentOK { + + return &RejectShipmentOK{} +} + +// WithPayload adds the payload to the reject shipment o k response +func (o *RejectShipmentOK) WithPayload(payload *ghcmessages.MTOShipment) *RejectShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment o k response +func (o *RejectShipmentOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentForbiddenCode is the HTTP code returned for type RejectShipmentForbidden +const RejectShipmentForbiddenCode int = 403 + +/* +RejectShipmentForbidden The request was denied + +swagger:response rejectShipmentForbidden +*/ +type RejectShipmentForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRejectShipmentForbidden creates RejectShipmentForbidden with default headers values +func NewRejectShipmentForbidden() *RejectShipmentForbidden { + + return &RejectShipmentForbidden{} +} + +// WithPayload adds the payload to the reject shipment forbidden response +func (o *RejectShipmentForbidden) WithPayload(payload *ghcmessages.Error) *RejectShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment forbidden response +func (o *RejectShipmentForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentNotFoundCode is the HTTP code returned for type RejectShipmentNotFound +const RejectShipmentNotFoundCode int = 404 + +/* +RejectShipmentNotFound The requested resource wasn't found + +swagger:response rejectShipmentNotFound +*/ +type RejectShipmentNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRejectShipmentNotFound creates RejectShipmentNotFound with default headers values +func NewRejectShipmentNotFound() *RejectShipmentNotFound { + + return &RejectShipmentNotFound{} +} + +// WithPayload adds the payload to the reject shipment not found response +func (o *RejectShipmentNotFound) WithPayload(payload *ghcmessages.Error) *RejectShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment not found response +func (o *RejectShipmentNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentConflictCode is the HTTP code returned for type RejectShipmentConflict +const RejectShipmentConflictCode int = 409 + +/* +RejectShipmentConflict Conflict error + +swagger:response rejectShipmentConflict +*/ +type RejectShipmentConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRejectShipmentConflict creates RejectShipmentConflict with default headers values +func NewRejectShipmentConflict() *RejectShipmentConflict { + + return &RejectShipmentConflict{} +} + +// WithPayload adds the payload to the reject shipment conflict response +func (o *RejectShipmentConflict) WithPayload(payload *ghcmessages.Error) *RejectShipmentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment conflict response +func (o *RejectShipmentConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentPreconditionFailedCode is the HTTP code returned for type RejectShipmentPreconditionFailed +const RejectShipmentPreconditionFailedCode int = 412 + +/* +RejectShipmentPreconditionFailed Precondition failed + +swagger:response rejectShipmentPreconditionFailed +*/ +type RejectShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRejectShipmentPreconditionFailed creates RejectShipmentPreconditionFailed with default headers values +func NewRejectShipmentPreconditionFailed() *RejectShipmentPreconditionFailed { + + return &RejectShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the reject shipment precondition failed response +func (o *RejectShipmentPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RejectShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment precondition failed response +func (o *RejectShipmentPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentUnprocessableEntityCode is the HTTP code returned for type RejectShipmentUnprocessableEntity +const RejectShipmentUnprocessableEntityCode int = 422 + +/* +RejectShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response rejectShipmentUnprocessableEntity +*/ +type RejectShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewRejectShipmentUnprocessableEntity creates RejectShipmentUnprocessableEntity with default headers values +func NewRejectShipmentUnprocessableEntity() *RejectShipmentUnprocessableEntity { + + return &RejectShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the reject shipment unprocessable entity response +func (o *RejectShipmentUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RejectShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment unprocessable entity response +func (o *RejectShipmentUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RejectShipmentInternalServerErrorCode is the HTTP code returned for type RejectShipmentInternalServerError +const RejectShipmentInternalServerErrorCode int = 500 + +/* +RejectShipmentInternalServerError A server error occurred + +swagger:response rejectShipmentInternalServerError +*/ +type RejectShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRejectShipmentInternalServerError creates RejectShipmentInternalServerError with default headers values +func NewRejectShipmentInternalServerError() *RejectShipmentInternalServerError { + + return &RejectShipmentInternalServerError{} +} + +// WithPayload adds the payload to the reject shipment internal server error response +func (o *RejectShipmentInternalServerError) WithPayload(payload *ghcmessages.Error) *RejectShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the reject shipment internal server error response +func (o *RejectShipmentInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RejectShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go new file mode 100644 index 00000000000..31e58a094a2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/reject_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RejectShipmentURL generates an URL for the reject shipment operation +type RejectShipmentURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RejectShipmentURL) WithBasePath(bp string) *RejectShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RejectShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RejectShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/reject" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on RejectShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RejectShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RejectShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RejectShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RejectShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RejectShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RejectShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go new file mode 100644 index 00000000000..552850bb41f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RequestShipmentCancellationHandlerFunc turns a function with the right signature into a request shipment cancellation handler +type RequestShipmentCancellationHandlerFunc func(RequestShipmentCancellationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RequestShipmentCancellationHandlerFunc) Handle(params RequestShipmentCancellationParams) middleware.Responder { + return fn(params) +} + +// RequestShipmentCancellationHandler interface for that can handle valid request shipment cancellation params +type RequestShipmentCancellationHandler interface { + Handle(RequestShipmentCancellationParams) middleware.Responder +} + +// NewRequestShipmentCancellation creates a new http.Handler for the request shipment cancellation operation +func NewRequestShipmentCancellation(ctx *middleware.Context, handler RequestShipmentCancellationHandler) *RequestShipmentCancellation { + return &RequestShipmentCancellation{Context: ctx, Handler: handler} +} + +/* + RequestShipmentCancellation swagger:route POST /shipments/{shipmentID}/request-cancellation shipment requestShipmentCancellation + +# Requests a shipment cancellation + +Requests a shipment cancellation +*/ +type RequestShipmentCancellation struct { + Context *middleware.Context + Handler RequestShipmentCancellationHandler +} + +func (o *RequestShipmentCancellation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRequestShipmentCancellationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go new file mode 100644 index 00000000000..1a38c9bc5f2 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_parameters.go @@ -0,0 +1,120 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewRequestShipmentCancellationParams creates a new RequestShipmentCancellationParams object +// +// There are no default values defined in the spec. +func NewRequestShipmentCancellationParams() RequestShipmentCancellationParams { + + return RequestShipmentCancellationParams{} +} + +// RequestShipmentCancellationParams contains all the bound params for the request shipment cancellation operation +// typically these are obtained from a http.Request +// +// swagger:parameters requestShipmentCancellation +type RequestShipmentCancellationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRequestShipmentCancellationParams() beforehand. +func (o *RequestShipmentCancellationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *RequestShipmentCancellationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *RequestShipmentCancellationParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *RequestShipmentCancellationParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go new file mode 100644 index 00000000000..995adf82acb --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// RequestShipmentCancellationOKCode is the HTTP code returned for type RequestShipmentCancellationOK +const RequestShipmentCancellationOKCode int = 200 + +/* +RequestShipmentCancellationOK Successfully requested the shipment cancellation + +swagger:response requestShipmentCancellationOK +*/ +type RequestShipmentCancellationOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationOK creates RequestShipmentCancellationOK with default headers values +func NewRequestShipmentCancellationOK() *RequestShipmentCancellationOK { + + return &RequestShipmentCancellationOK{} +} + +// WithPayload adds the payload to the request shipment cancellation o k response +func (o *RequestShipmentCancellationOK) WithPayload(payload *ghcmessages.MTOShipment) *RequestShipmentCancellationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation o k response +func (o *RequestShipmentCancellationOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationForbiddenCode is the HTTP code returned for type RequestShipmentCancellationForbidden +const RequestShipmentCancellationForbiddenCode int = 403 + +/* +RequestShipmentCancellationForbidden The request was denied + +swagger:response requestShipmentCancellationForbidden +*/ +type RequestShipmentCancellationForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationForbidden creates RequestShipmentCancellationForbidden with default headers values +func NewRequestShipmentCancellationForbidden() *RequestShipmentCancellationForbidden { + + return &RequestShipmentCancellationForbidden{} +} + +// WithPayload adds the payload to the request shipment cancellation forbidden response +func (o *RequestShipmentCancellationForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation forbidden response +func (o *RequestShipmentCancellationForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationNotFoundCode is the HTTP code returned for type RequestShipmentCancellationNotFound +const RequestShipmentCancellationNotFoundCode int = 404 + +/* +RequestShipmentCancellationNotFound The requested resource wasn't found + +swagger:response requestShipmentCancellationNotFound +*/ +type RequestShipmentCancellationNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationNotFound creates RequestShipmentCancellationNotFound with default headers values +func NewRequestShipmentCancellationNotFound() *RequestShipmentCancellationNotFound { + + return &RequestShipmentCancellationNotFound{} +} + +// WithPayload adds the payload to the request shipment cancellation not found response +func (o *RequestShipmentCancellationNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation not found response +func (o *RequestShipmentCancellationNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationConflictCode is the HTTP code returned for type RequestShipmentCancellationConflict +const RequestShipmentCancellationConflictCode int = 409 + +/* +RequestShipmentCancellationConflict Conflict error + +swagger:response requestShipmentCancellationConflict +*/ +type RequestShipmentCancellationConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationConflict creates RequestShipmentCancellationConflict with default headers values +func NewRequestShipmentCancellationConflict() *RequestShipmentCancellationConflict { + + return &RequestShipmentCancellationConflict{} +} + +// WithPayload adds the payload to the request shipment cancellation conflict response +func (o *RequestShipmentCancellationConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation conflict response +func (o *RequestShipmentCancellationConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationPreconditionFailedCode is the HTTP code returned for type RequestShipmentCancellationPreconditionFailed +const RequestShipmentCancellationPreconditionFailedCode int = 412 + +/* +RequestShipmentCancellationPreconditionFailed Precondition failed + +swagger:response requestShipmentCancellationPreconditionFailed +*/ +type RequestShipmentCancellationPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationPreconditionFailed creates RequestShipmentCancellationPreconditionFailed with default headers values +func NewRequestShipmentCancellationPreconditionFailed() *RequestShipmentCancellationPreconditionFailed { + + return &RequestShipmentCancellationPreconditionFailed{} +} + +// WithPayload adds the payload to the request shipment cancellation precondition failed response +func (o *RequestShipmentCancellationPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation precondition failed response +func (o *RequestShipmentCancellationPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationUnprocessableEntityCode is the HTTP code returned for type RequestShipmentCancellationUnprocessableEntity +const RequestShipmentCancellationUnprocessableEntityCode int = 422 + +/* +RequestShipmentCancellationUnprocessableEntity The payload was unprocessable. + +swagger:response requestShipmentCancellationUnprocessableEntity +*/ +type RequestShipmentCancellationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationUnprocessableEntity creates RequestShipmentCancellationUnprocessableEntity with default headers values +func NewRequestShipmentCancellationUnprocessableEntity() *RequestShipmentCancellationUnprocessableEntity { + + return &RequestShipmentCancellationUnprocessableEntity{} +} + +// WithPayload adds the payload to the request shipment cancellation unprocessable entity response +func (o *RequestShipmentCancellationUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentCancellationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation unprocessable entity response +func (o *RequestShipmentCancellationUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentCancellationInternalServerErrorCode is the HTTP code returned for type RequestShipmentCancellationInternalServerError +const RequestShipmentCancellationInternalServerErrorCode int = 500 + +/* +RequestShipmentCancellationInternalServerError A server error occurred + +swagger:response requestShipmentCancellationInternalServerError +*/ +type RequestShipmentCancellationInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentCancellationInternalServerError creates RequestShipmentCancellationInternalServerError with default headers values +func NewRequestShipmentCancellationInternalServerError() *RequestShipmentCancellationInternalServerError { + + return &RequestShipmentCancellationInternalServerError{} +} + +// WithPayload adds the payload to the request shipment cancellation internal server error response +func (o *RequestShipmentCancellationInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentCancellationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment cancellation internal server error response +func (o *RequestShipmentCancellationInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentCancellationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go new file mode 100644 index 00000000000..2b947e2b49d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_cancellation_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RequestShipmentCancellationURL generates an URL for the request shipment cancellation operation +type RequestShipmentCancellationURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentCancellationURL) WithBasePath(bp string) *RequestShipmentCancellationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentCancellationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RequestShipmentCancellationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/request-cancellation" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on RequestShipmentCancellationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RequestShipmentCancellationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RequestShipmentCancellationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RequestShipmentCancellationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RequestShipmentCancellationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RequestShipmentCancellationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RequestShipmentCancellationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go new file mode 100644 index 00000000000..ec62c5ea289 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RequestShipmentDiversionHandlerFunc turns a function with the right signature into a request shipment diversion handler +type RequestShipmentDiversionHandlerFunc func(RequestShipmentDiversionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RequestShipmentDiversionHandlerFunc) Handle(params RequestShipmentDiversionParams) middleware.Responder { + return fn(params) +} + +// RequestShipmentDiversionHandler interface for that can handle valid request shipment diversion params +type RequestShipmentDiversionHandler interface { + Handle(RequestShipmentDiversionParams) middleware.Responder +} + +// NewRequestShipmentDiversion creates a new http.Handler for the request shipment diversion operation +func NewRequestShipmentDiversion(ctx *middleware.Context, handler RequestShipmentDiversionHandler) *RequestShipmentDiversion { + return &RequestShipmentDiversion{Context: ctx, Handler: handler} +} + +/* + RequestShipmentDiversion swagger:route POST /shipments/{shipmentID}/request-diversion shipment requestShipmentDiversion + +# Requests a shipment diversion + +Requests a shipment diversion +*/ +type RequestShipmentDiversion struct { + Context *middleware.Context + Handler RequestShipmentDiversionHandler +} + +func (o *RequestShipmentDiversion) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRequestShipmentDiversionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go new file mode 100644 index 00000000000..8bc676c850a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewRequestShipmentDiversionParams creates a new RequestShipmentDiversionParams object +// +// There are no default values defined in the spec. +func NewRequestShipmentDiversionParams() RequestShipmentDiversionParams { + + return RequestShipmentDiversionParams{} +} + +// RequestShipmentDiversionParams contains all the bound params for the request shipment diversion operation +// typically these are obtained from a http.Request +// +// swagger:parameters requestShipmentDiversion +type RequestShipmentDiversionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.RequestDiversion + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRequestShipmentDiversionParams() beforehand. +func (o *RequestShipmentDiversionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.RequestDiversion + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *RequestShipmentDiversionParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *RequestShipmentDiversionParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *RequestShipmentDiversionParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go new file mode 100644 index 00000000000..aa563d4d6aa --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// RequestShipmentDiversionOKCode is the HTTP code returned for type RequestShipmentDiversionOK +const RequestShipmentDiversionOKCode int = 200 + +/* +RequestShipmentDiversionOK Successfully requested the shipment diversion + +swagger:response requestShipmentDiversionOK +*/ +type RequestShipmentDiversionOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionOK creates RequestShipmentDiversionOK with default headers values +func NewRequestShipmentDiversionOK() *RequestShipmentDiversionOK { + + return &RequestShipmentDiversionOK{} +} + +// WithPayload adds the payload to the request shipment diversion o k response +func (o *RequestShipmentDiversionOK) WithPayload(payload *ghcmessages.MTOShipment) *RequestShipmentDiversionOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion o k response +func (o *RequestShipmentDiversionOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionForbiddenCode is the HTTP code returned for type RequestShipmentDiversionForbidden +const RequestShipmentDiversionForbiddenCode int = 403 + +/* +RequestShipmentDiversionForbidden The request was denied + +swagger:response requestShipmentDiversionForbidden +*/ +type RequestShipmentDiversionForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionForbidden creates RequestShipmentDiversionForbidden with default headers values +func NewRequestShipmentDiversionForbidden() *RequestShipmentDiversionForbidden { + + return &RequestShipmentDiversionForbidden{} +} + +// WithPayload adds the payload to the request shipment diversion forbidden response +func (o *RequestShipmentDiversionForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion forbidden response +func (o *RequestShipmentDiversionForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionNotFoundCode is the HTTP code returned for type RequestShipmentDiversionNotFound +const RequestShipmentDiversionNotFoundCode int = 404 + +/* +RequestShipmentDiversionNotFound The requested resource wasn't found + +swagger:response requestShipmentDiversionNotFound +*/ +type RequestShipmentDiversionNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionNotFound creates RequestShipmentDiversionNotFound with default headers values +func NewRequestShipmentDiversionNotFound() *RequestShipmentDiversionNotFound { + + return &RequestShipmentDiversionNotFound{} +} + +// WithPayload adds the payload to the request shipment diversion not found response +func (o *RequestShipmentDiversionNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion not found response +func (o *RequestShipmentDiversionNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionConflictCode is the HTTP code returned for type RequestShipmentDiversionConflict +const RequestShipmentDiversionConflictCode int = 409 + +/* +RequestShipmentDiversionConflict Conflict error + +swagger:response requestShipmentDiversionConflict +*/ +type RequestShipmentDiversionConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionConflict creates RequestShipmentDiversionConflict with default headers values +func NewRequestShipmentDiversionConflict() *RequestShipmentDiversionConflict { + + return &RequestShipmentDiversionConflict{} +} + +// WithPayload adds the payload to the request shipment diversion conflict response +func (o *RequestShipmentDiversionConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion conflict response +func (o *RequestShipmentDiversionConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionPreconditionFailedCode is the HTTP code returned for type RequestShipmentDiversionPreconditionFailed +const RequestShipmentDiversionPreconditionFailedCode int = 412 + +/* +RequestShipmentDiversionPreconditionFailed Precondition failed + +swagger:response requestShipmentDiversionPreconditionFailed +*/ +type RequestShipmentDiversionPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionPreconditionFailed creates RequestShipmentDiversionPreconditionFailed with default headers values +func NewRequestShipmentDiversionPreconditionFailed() *RequestShipmentDiversionPreconditionFailed { + + return &RequestShipmentDiversionPreconditionFailed{} +} + +// WithPayload adds the payload to the request shipment diversion precondition failed response +func (o *RequestShipmentDiversionPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion precondition failed response +func (o *RequestShipmentDiversionPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionUnprocessableEntityCode is the HTTP code returned for type RequestShipmentDiversionUnprocessableEntity +const RequestShipmentDiversionUnprocessableEntityCode int = 422 + +/* +RequestShipmentDiversionUnprocessableEntity The payload was unprocessable. + +swagger:response requestShipmentDiversionUnprocessableEntity +*/ +type RequestShipmentDiversionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionUnprocessableEntity creates RequestShipmentDiversionUnprocessableEntity with default headers values +func NewRequestShipmentDiversionUnprocessableEntity() *RequestShipmentDiversionUnprocessableEntity { + + return &RequestShipmentDiversionUnprocessableEntity{} +} + +// WithPayload adds the payload to the request shipment diversion unprocessable entity response +func (o *RequestShipmentDiversionUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentDiversionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion unprocessable entity response +func (o *RequestShipmentDiversionUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentDiversionInternalServerErrorCode is the HTTP code returned for type RequestShipmentDiversionInternalServerError +const RequestShipmentDiversionInternalServerErrorCode int = 500 + +/* +RequestShipmentDiversionInternalServerError A server error occurred + +swagger:response requestShipmentDiversionInternalServerError +*/ +type RequestShipmentDiversionInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentDiversionInternalServerError creates RequestShipmentDiversionInternalServerError with default headers values +func NewRequestShipmentDiversionInternalServerError() *RequestShipmentDiversionInternalServerError { + + return &RequestShipmentDiversionInternalServerError{} +} + +// WithPayload adds the payload to the request shipment diversion internal server error response +func (o *RequestShipmentDiversionInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentDiversionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment diversion internal server error response +func (o *RequestShipmentDiversionInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentDiversionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go new file mode 100644 index 00000000000..54e8bf53267 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_diversion_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RequestShipmentDiversionURL generates an URL for the request shipment diversion operation +type RequestShipmentDiversionURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentDiversionURL) WithBasePath(bp string) *RequestShipmentDiversionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentDiversionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RequestShipmentDiversionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/request-diversion" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on RequestShipmentDiversionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RequestShipmentDiversionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RequestShipmentDiversionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RequestShipmentDiversionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RequestShipmentDiversionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RequestShipmentDiversionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RequestShipmentDiversionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go new file mode 100644 index 00000000000..c09620f1caf --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RequestShipmentReweighHandlerFunc turns a function with the right signature into a request shipment reweigh handler +type RequestShipmentReweighHandlerFunc func(RequestShipmentReweighParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RequestShipmentReweighHandlerFunc) Handle(params RequestShipmentReweighParams) middleware.Responder { + return fn(params) +} + +// RequestShipmentReweighHandler interface for that can handle valid request shipment reweigh params +type RequestShipmentReweighHandler interface { + Handle(RequestShipmentReweighParams) middleware.Responder +} + +// NewRequestShipmentReweigh creates a new http.Handler for the request shipment reweigh operation +func NewRequestShipmentReweigh(ctx *middleware.Context, handler RequestShipmentReweighHandler) *RequestShipmentReweigh { + return &RequestShipmentReweigh{Context: ctx, Handler: handler} +} + +/* + RequestShipmentReweigh swagger:route POST /shipments/{shipmentID}/request-reweigh shipment reweigh requestShipmentReweigh + +# Requests a shipment reweigh + +Requests a shipment reweigh +*/ +type RequestShipmentReweigh struct { + Context *middleware.Context + Handler RequestShipmentReweighHandler +} + +func (o *RequestShipmentReweigh) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRequestShipmentReweighParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go new file mode 100644 index 00000000000..28f79ca9eaa --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewRequestShipmentReweighParams creates a new RequestShipmentReweighParams object +// +// There are no default values defined in the spec. +func NewRequestShipmentReweighParams() RequestShipmentReweighParams { + + return RequestShipmentReweighParams{} +} + +// RequestShipmentReweighParams contains all the bound params for the request shipment reweigh operation +// typically these are obtained from a http.Request +// +// swagger:parameters requestShipmentReweigh +type RequestShipmentReweighParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRequestShipmentReweighParams() beforehand. +func (o *RequestShipmentReweighParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *RequestShipmentReweighParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *RequestShipmentReweighParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go new file mode 100644 index 00000000000..21cddadc4c7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// RequestShipmentReweighOKCode is the HTTP code returned for type RequestShipmentReweighOK +const RequestShipmentReweighOKCode int = 200 + +/* +RequestShipmentReweighOK Successfully requested a reweigh of the shipment + +swagger:response requestShipmentReweighOK +*/ +type RequestShipmentReweighOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Reweigh `json:"body,omitempty"` +} + +// NewRequestShipmentReweighOK creates RequestShipmentReweighOK with default headers values +func NewRequestShipmentReweighOK() *RequestShipmentReweighOK { + + return &RequestShipmentReweighOK{} +} + +// WithPayload adds the payload to the request shipment reweigh o k response +func (o *RequestShipmentReweighOK) WithPayload(payload *ghcmessages.Reweigh) *RequestShipmentReweighOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh o k response +func (o *RequestShipmentReweighOK) SetPayload(payload *ghcmessages.Reweigh) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighForbiddenCode is the HTTP code returned for type RequestShipmentReweighForbidden +const RequestShipmentReweighForbiddenCode int = 403 + +/* +RequestShipmentReweighForbidden The request was denied + +swagger:response requestShipmentReweighForbidden +*/ +type RequestShipmentReweighForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentReweighForbidden creates RequestShipmentReweighForbidden with default headers values +func NewRequestShipmentReweighForbidden() *RequestShipmentReweighForbidden { + + return &RequestShipmentReweighForbidden{} +} + +// WithPayload adds the payload to the request shipment reweigh forbidden response +func (o *RequestShipmentReweighForbidden) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh forbidden response +func (o *RequestShipmentReweighForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighNotFoundCode is the HTTP code returned for type RequestShipmentReweighNotFound +const RequestShipmentReweighNotFoundCode int = 404 + +/* +RequestShipmentReweighNotFound The requested resource wasn't found + +swagger:response requestShipmentReweighNotFound +*/ +type RequestShipmentReweighNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentReweighNotFound creates RequestShipmentReweighNotFound with default headers values +func NewRequestShipmentReweighNotFound() *RequestShipmentReweighNotFound { + + return &RequestShipmentReweighNotFound{} +} + +// WithPayload adds the payload to the request shipment reweigh not found response +func (o *RequestShipmentReweighNotFound) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh not found response +func (o *RequestShipmentReweighNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighConflictCode is the HTTP code returned for type RequestShipmentReweighConflict +const RequestShipmentReweighConflictCode int = 409 + +/* +RequestShipmentReweighConflict Conflict error + +swagger:response requestShipmentReweighConflict +*/ +type RequestShipmentReweighConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentReweighConflict creates RequestShipmentReweighConflict with default headers values +func NewRequestShipmentReweighConflict() *RequestShipmentReweighConflict { + + return &RequestShipmentReweighConflict{} +} + +// WithPayload adds the payload to the request shipment reweigh conflict response +func (o *RequestShipmentReweighConflict) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh conflict response +func (o *RequestShipmentReweighConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighPreconditionFailedCode is the HTTP code returned for type RequestShipmentReweighPreconditionFailed +const RequestShipmentReweighPreconditionFailedCode int = 412 + +/* +RequestShipmentReweighPreconditionFailed Precondition failed + +swagger:response requestShipmentReweighPreconditionFailed +*/ +type RequestShipmentReweighPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentReweighPreconditionFailed creates RequestShipmentReweighPreconditionFailed with default headers values +func NewRequestShipmentReweighPreconditionFailed() *RequestShipmentReweighPreconditionFailed { + + return &RequestShipmentReweighPreconditionFailed{} +} + +// WithPayload adds the payload to the request shipment reweigh precondition failed response +func (o *RequestShipmentReweighPreconditionFailed) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh precondition failed response +func (o *RequestShipmentReweighPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighUnprocessableEntityCode is the HTTP code returned for type RequestShipmentReweighUnprocessableEntity +const RequestShipmentReweighUnprocessableEntityCode int = 422 + +/* +RequestShipmentReweighUnprocessableEntity The payload was unprocessable. + +swagger:response requestShipmentReweighUnprocessableEntity +*/ +type RequestShipmentReweighUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewRequestShipmentReweighUnprocessableEntity creates RequestShipmentReweighUnprocessableEntity with default headers values +func NewRequestShipmentReweighUnprocessableEntity() *RequestShipmentReweighUnprocessableEntity { + + return &RequestShipmentReweighUnprocessableEntity{} +} + +// WithPayload adds the payload to the request shipment reweigh unprocessable entity response +func (o *RequestShipmentReweighUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *RequestShipmentReweighUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh unprocessable entity response +func (o *RequestShipmentReweighUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RequestShipmentReweighInternalServerErrorCode is the HTTP code returned for type RequestShipmentReweighInternalServerError +const RequestShipmentReweighInternalServerErrorCode int = 500 + +/* +RequestShipmentReweighInternalServerError A server error occurred + +swagger:response requestShipmentReweighInternalServerError +*/ +type RequestShipmentReweighInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewRequestShipmentReweighInternalServerError creates RequestShipmentReweighInternalServerError with default headers values +func NewRequestShipmentReweighInternalServerError() *RequestShipmentReweighInternalServerError { + + return &RequestShipmentReweighInternalServerError{} +} + +// WithPayload adds the payload to the request shipment reweigh internal server error response +func (o *RequestShipmentReweighInternalServerError) WithPayload(payload *ghcmessages.Error) *RequestShipmentReweighInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the request shipment reweigh internal server error response +func (o *RequestShipmentReweighInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RequestShipmentReweighInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go new file mode 100644 index 00000000000..d1902ca4631 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/request_shipment_reweigh_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RequestShipmentReweighURL generates an URL for the request shipment reweigh operation +type RequestShipmentReweighURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentReweighURL) WithBasePath(bp string) *RequestShipmentReweighURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RequestShipmentReweighURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RequestShipmentReweighURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/request-reweigh" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on RequestShipmentReweighURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RequestShipmentReweighURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RequestShipmentReweighURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RequestShipmentReweighURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RequestShipmentReweighURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RequestShipmentReweighURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RequestShipmentReweighURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go new file mode 100644 index 00000000000..d4532a282ce --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "encoding/json" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReviewShipmentAddressUpdateHandlerFunc turns a function with the right signature into a review shipment address update handler +type ReviewShipmentAddressUpdateHandlerFunc func(ReviewShipmentAddressUpdateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ReviewShipmentAddressUpdateHandlerFunc) Handle(params ReviewShipmentAddressUpdateParams) middleware.Responder { + return fn(params) +} + +// ReviewShipmentAddressUpdateHandler interface for that can handle valid review shipment address update params +type ReviewShipmentAddressUpdateHandler interface { + Handle(ReviewShipmentAddressUpdateParams) middleware.Responder +} + +// NewReviewShipmentAddressUpdate creates a new http.Handler for the review shipment address update operation +func NewReviewShipmentAddressUpdate(ctx *middleware.Context, handler ReviewShipmentAddressUpdateHandler) *ReviewShipmentAddressUpdate { + return &ReviewShipmentAddressUpdate{Context: ctx, Handler: handler} +} + +/* + ReviewShipmentAddressUpdate swagger:route PATCH /shipments/{shipmentID}/review-shipment-address-update shipment reviewShipmentAddressUpdate + +# Allows TOO to review a shipment address update + +This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item +*/ +type ReviewShipmentAddressUpdate struct { + Context *middleware.Context + Handler ReviewShipmentAddressUpdateHandler +} + +func (o *ReviewShipmentAddressUpdate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewReviewShipmentAddressUpdateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// ReviewShipmentAddressUpdateBody review shipment address update body +// +// swagger:model ReviewShipmentAddressUpdateBody +type ReviewShipmentAddressUpdateBody struct { + + // office remarks + // Required: true + OfficeRemarks *string `json:"officeRemarks"` + + // status + // Required: true + // Enum: [REJECTED APPROVED] + Status *string `json:"status"` +} + +// Validate validates this review shipment address update body +func (o *ReviewShipmentAddressUpdateBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateOfficeRemarks(formats); err != nil { + res = append(res, err) + } + + if err := o.validateStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *ReviewShipmentAddressUpdateBody) validateOfficeRemarks(formats strfmt.Registry) error { + + if err := validate.Required("body"+"."+"officeRemarks", "body", o.OfficeRemarks); err != nil { + return err + } + + return nil +} + +var reviewShipmentAddressUpdateBodyTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reviewShipmentAddressUpdateBodyTypeStatusPropEnum = append(reviewShipmentAddressUpdateBodyTypeStatusPropEnum, v) + } +} + +const ( + + // ReviewShipmentAddressUpdateBodyStatusREJECTED captures enum value "REJECTED" + ReviewShipmentAddressUpdateBodyStatusREJECTED string = "REJECTED" + + // ReviewShipmentAddressUpdateBodyStatusAPPROVED captures enum value "APPROVED" + ReviewShipmentAddressUpdateBodyStatusAPPROVED string = "APPROVED" +) + +// prop value enum +func (o *ReviewShipmentAddressUpdateBody) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, reviewShipmentAddressUpdateBodyTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (o *ReviewShipmentAddressUpdateBody) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("body"+"."+"status", "body", o.Status); err != nil { + return err + } + + // value enum + if err := o.validateStatusEnum("body"+"."+"status", "body", *o.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this review shipment address update body based on context it is used +func (o *ReviewShipmentAddressUpdateBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *ReviewShipmentAddressUpdateBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *ReviewShipmentAddressUpdateBody) UnmarshalBinary(b []byte) error { + var res ReviewShipmentAddressUpdateBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go new file mode 100644 index 00000000000..d7d16648a8c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_parameters.go @@ -0,0 +1,155 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewReviewShipmentAddressUpdateParams creates a new ReviewShipmentAddressUpdateParams object +// +// There are no default values defined in the spec. +func NewReviewShipmentAddressUpdateParams() ReviewShipmentAddressUpdateParams { + + return ReviewShipmentAddressUpdateParams{} +} + +// ReviewShipmentAddressUpdateParams contains all the bound params for the review shipment address update operation +// typically these are obtained from a http.Request +// +// swagger:parameters reviewShipmentAddressUpdate +type ReviewShipmentAddressUpdateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body ReviewShipmentAddressUpdateBody + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewReviewShipmentAddressUpdateParams() beforehand. +func (o *ReviewShipmentAddressUpdateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ReviewShipmentAddressUpdateBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *ReviewShipmentAddressUpdateParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *ReviewShipmentAddressUpdateParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *ReviewShipmentAddressUpdateParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go new file mode 100644 index 00000000000..7ab8362c8d4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ReviewShipmentAddressUpdateOKCode is the HTTP code returned for type ReviewShipmentAddressUpdateOK +const ReviewShipmentAddressUpdateOKCode int = 200 + +/* +ReviewShipmentAddressUpdateOK Successfully requested a shipment address update + +swagger:response reviewShipmentAddressUpdateOK +*/ +type ReviewShipmentAddressUpdateOK struct { + + /* + In: Body + */ + Payload *ghcmessages.ShipmentAddressUpdate `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateOK creates ReviewShipmentAddressUpdateOK with default headers values +func NewReviewShipmentAddressUpdateOK() *ReviewShipmentAddressUpdateOK { + + return &ReviewShipmentAddressUpdateOK{} +} + +// WithPayload adds the payload to the review shipment address update o k response +func (o *ReviewShipmentAddressUpdateOK) WithPayload(payload *ghcmessages.ShipmentAddressUpdate) *ReviewShipmentAddressUpdateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update o k response +func (o *ReviewShipmentAddressUpdateOK) SetPayload(payload *ghcmessages.ShipmentAddressUpdate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdateForbiddenCode is the HTTP code returned for type ReviewShipmentAddressUpdateForbidden +const ReviewShipmentAddressUpdateForbiddenCode int = 403 + +/* +ReviewShipmentAddressUpdateForbidden The request was denied + +swagger:response reviewShipmentAddressUpdateForbidden +*/ +type ReviewShipmentAddressUpdateForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateForbidden creates ReviewShipmentAddressUpdateForbidden with default headers values +func NewReviewShipmentAddressUpdateForbidden() *ReviewShipmentAddressUpdateForbidden { + + return &ReviewShipmentAddressUpdateForbidden{} +} + +// WithPayload adds the payload to the review shipment address update forbidden response +func (o *ReviewShipmentAddressUpdateForbidden) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update forbidden response +func (o *ReviewShipmentAddressUpdateForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdateNotFoundCode is the HTTP code returned for type ReviewShipmentAddressUpdateNotFound +const ReviewShipmentAddressUpdateNotFoundCode int = 404 + +/* +ReviewShipmentAddressUpdateNotFound The requested resource wasn't found + +swagger:response reviewShipmentAddressUpdateNotFound +*/ +type ReviewShipmentAddressUpdateNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateNotFound creates ReviewShipmentAddressUpdateNotFound with default headers values +func NewReviewShipmentAddressUpdateNotFound() *ReviewShipmentAddressUpdateNotFound { + + return &ReviewShipmentAddressUpdateNotFound{} +} + +// WithPayload adds the payload to the review shipment address update not found response +func (o *ReviewShipmentAddressUpdateNotFound) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update not found response +func (o *ReviewShipmentAddressUpdateNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdateConflictCode is the HTTP code returned for type ReviewShipmentAddressUpdateConflict +const ReviewShipmentAddressUpdateConflictCode int = 409 + +/* +ReviewShipmentAddressUpdateConflict Conflict error + +swagger:response reviewShipmentAddressUpdateConflict +*/ +type ReviewShipmentAddressUpdateConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateConflict creates ReviewShipmentAddressUpdateConflict with default headers values +func NewReviewShipmentAddressUpdateConflict() *ReviewShipmentAddressUpdateConflict { + + return &ReviewShipmentAddressUpdateConflict{} +} + +// WithPayload adds the payload to the review shipment address update conflict response +func (o *ReviewShipmentAddressUpdateConflict) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update conflict response +func (o *ReviewShipmentAddressUpdateConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdatePreconditionFailedCode is the HTTP code returned for type ReviewShipmentAddressUpdatePreconditionFailed +const ReviewShipmentAddressUpdatePreconditionFailedCode int = 412 + +/* +ReviewShipmentAddressUpdatePreconditionFailed Precondition failed + +swagger:response reviewShipmentAddressUpdatePreconditionFailed +*/ +type ReviewShipmentAddressUpdatePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdatePreconditionFailed creates ReviewShipmentAddressUpdatePreconditionFailed with default headers values +func NewReviewShipmentAddressUpdatePreconditionFailed() *ReviewShipmentAddressUpdatePreconditionFailed { + + return &ReviewShipmentAddressUpdatePreconditionFailed{} +} + +// WithPayload adds the payload to the review shipment address update precondition failed response +func (o *ReviewShipmentAddressUpdatePreconditionFailed) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdatePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update precondition failed response +func (o *ReviewShipmentAddressUpdatePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdatePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdateUnprocessableEntityCode is the HTTP code returned for type ReviewShipmentAddressUpdateUnprocessableEntity +const ReviewShipmentAddressUpdateUnprocessableEntityCode int = 422 + +/* +ReviewShipmentAddressUpdateUnprocessableEntity The payload was unprocessable. + +swagger:response reviewShipmentAddressUpdateUnprocessableEntity +*/ +type ReviewShipmentAddressUpdateUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateUnprocessableEntity creates ReviewShipmentAddressUpdateUnprocessableEntity with default headers values +func NewReviewShipmentAddressUpdateUnprocessableEntity() *ReviewShipmentAddressUpdateUnprocessableEntity { + + return &ReviewShipmentAddressUpdateUnprocessableEntity{} +} + +// WithPayload adds the payload to the review shipment address update unprocessable entity response +func (o *ReviewShipmentAddressUpdateUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ReviewShipmentAddressUpdateUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update unprocessable entity response +func (o *ReviewShipmentAddressUpdateUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReviewShipmentAddressUpdateInternalServerErrorCode is the HTTP code returned for type ReviewShipmentAddressUpdateInternalServerError +const ReviewShipmentAddressUpdateInternalServerErrorCode int = 500 + +/* +ReviewShipmentAddressUpdateInternalServerError A server error occurred + +swagger:response reviewShipmentAddressUpdateInternalServerError +*/ +type ReviewShipmentAddressUpdateInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewReviewShipmentAddressUpdateInternalServerError creates ReviewShipmentAddressUpdateInternalServerError with default headers values +func NewReviewShipmentAddressUpdateInternalServerError() *ReviewShipmentAddressUpdateInternalServerError { + + return &ReviewShipmentAddressUpdateInternalServerError{} +} + +// WithPayload adds the payload to the review shipment address update internal server error response +func (o *ReviewShipmentAddressUpdateInternalServerError) WithPayload(payload *ghcmessages.Error) *ReviewShipmentAddressUpdateInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the review shipment address update internal server error response +func (o *ReviewShipmentAddressUpdateInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReviewShipmentAddressUpdateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go new file mode 100644 index 00000000000..8d469c47f27 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/review_shipment_address_update_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ReviewShipmentAddressUpdateURL generates an URL for the review shipment address update operation +type ReviewShipmentAddressUpdateURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ReviewShipmentAddressUpdateURL) WithBasePath(bp string) *ReviewShipmentAddressUpdateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ReviewShipmentAddressUpdateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ReviewShipmentAddressUpdateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/review-shipment-address-update" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on ReviewShipmentAddressUpdateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ReviewShipmentAddressUpdateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ReviewShipmentAddressUpdateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ReviewShipmentAddressUpdateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ReviewShipmentAddressUpdateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ReviewShipmentAddressUpdateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ReviewShipmentAddressUpdateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go new file mode 100644 index 00000000000..5b7290cafe7 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateSITServiceItemCustomerExpenseHandlerFunc turns a function with the right signature into a update s i t service item customer expense handler +type UpdateSITServiceItemCustomerExpenseHandlerFunc func(UpdateSITServiceItemCustomerExpenseParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateSITServiceItemCustomerExpenseHandlerFunc) Handle(params UpdateSITServiceItemCustomerExpenseParams) middleware.Responder { + return fn(params) +} + +// UpdateSITServiceItemCustomerExpenseHandler interface for that can handle valid update s i t service item customer expense params +type UpdateSITServiceItemCustomerExpenseHandler interface { + Handle(UpdateSITServiceItemCustomerExpenseParams) middleware.Responder +} + +// NewUpdateSITServiceItemCustomerExpense creates a new http.Handler for the update s i t service item customer expense operation +func NewUpdateSITServiceItemCustomerExpense(ctx *middleware.Context, handler UpdateSITServiceItemCustomerExpenseHandler) *UpdateSITServiceItemCustomerExpense { + return &UpdateSITServiceItemCustomerExpense{Context: ctx, Handler: handler} +} + +/* + UpdateSITServiceItemCustomerExpense swagger:route PATCH /shipments/{shipmentID}/sit-service-item/convert-to-customer-expense shipment mtoServiceItem updateSITServiceItemCustomerExpense + +# Converts a SIT to customer expense + +Converts a SIT to customer expense +*/ +type UpdateSITServiceItemCustomerExpense struct { + Context *middleware.Context + Handler UpdateSITServiceItemCustomerExpenseHandler +} + +func (o *UpdateSITServiceItemCustomerExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateSITServiceItemCustomerExpenseParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go new file mode 100644 index 00000000000..07c5ab5be2a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_parameters.go @@ -0,0 +1,157 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewUpdateSITServiceItemCustomerExpenseParams creates a new UpdateSITServiceItemCustomerExpenseParams object +// +// There are no default values defined in the spec. +func NewUpdateSITServiceItemCustomerExpenseParams() UpdateSITServiceItemCustomerExpenseParams { + + return UpdateSITServiceItemCustomerExpenseParams{} +} + +// UpdateSITServiceItemCustomerExpenseParams contains all the bound params for the update s i t service item customer expense operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateSITServiceItemCustomerExpense +type UpdateSITServiceItemCustomerExpenseParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *ghcmessages.UpdateSITServiceItemCustomerExpense + /*ID of the shipment + Required: true + In: path + */ + ShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateSITServiceItemCustomerExpenseParams() beforehand. +func (o *UpdateSITServiceItemCustomerExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.UpdateSITServiceItemCustomerExpense + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rShipmentID, rhkShipmentID, _ := route.Params.GetOK("shipmentID") + if err := o.bindShipmentID(rShipmentID, rhkShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateSITServiceItemCustomerExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindShipmentID binds and validates parameter ShipmentID from path. +func (o *UpdateSITServiceItemCustomerExpenseParams) bindShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("shipmentID", "path", "strfmt.UUID", raw) + } + o.ShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateShipmentID carries on validations for parameter ShipmentID +func (o *UpdateSITServiceItemCustomerExpenseParams) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("shipmentID", "path", "uuid", o.ShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go new file mode 100644 index 00000000000..318518fa67b --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateSITServiceItemCustomerExpenseOKCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseOK +const UpdateSITServiceItemCustomerExpenseOKCode int = 200 + +/* +UpdateSITServiceItemCustomerExpenseOK Successfully converted to customer expense + +swagger:response updateSITServiceItemCustomerExpenseOK +*/ +type UpdateSITServiceItemCustomerExpenseOK struct { + + /* + In: Body + */ + Payload *ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseOK creates UpdateSITServiceItemCustomerExpenseOK with default headers values +func NewUpdateSITServiceItemCustomerExpenseOK() *UpdateSITServiceItemCustomerExpenseOK { + + return &UpdateSITServiceItemCustomerExpenseOK{} +} + +// WithPayload adds the payload to the update s i t service item customer expense o k response +func (o *UpdateSITServiceItemCustomerExpenseOK) WithPayload(payload *ghcmessages.MTOShipment) *UpdateSITServiceItemCustomerExpenseOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense o k response +func (o *UpdateSITServiceItemCustomerExpenseOK) SetPayload(payload *ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpenseForbiddenCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseForbidden +const UpdateSITServiceItemCustomerExpenseForbiddenCode int = 403 + +/* +UpdateSITServiceItemCustomerExpenseForbidden The request was denied + +swagger:response updateSITServiceItemCustomerExpenseForbidden +*/ +type UpdateSITServiceItemCustomerExpenseForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseForbidden creates UpdateSITServiceItemCustomerExpenseForbidden with default headers values +func NewUpdateSITServiceItemCustomerExpenseForbidden() *UpdateSITServiceItemCustomerExpenseForbidden { + + return &UpdateSITServiceItemCustomerExpenseForbidden{} +} + +// WithPayload adds the payload to the update s i t service item customer expense forbidden response +func (o *UpdateSITServiceItemCustomerExpenseForbidden) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense forbidden response +func (o *UpdateSITServiceItemCustomerExpenseForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpenseNotFoundCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseNotFound +const UpdateSITServiceItemCustomerExpenseNotFoundCode int = 404 + +/* +UpdateSITServiceItemCustomerExpenseNotFound The requested resource wasn't found + +swagger:response updateSITServiceItemCustomerExpenseNotFound +*/ +type UpdateSITServiceItemCustomerExpenseNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseNotFound creates UpdateSITServiceItemCustomerExpenseNotFound with default headers values +func NewUpdateSITServiceItemCustomerExpenseNotFound() *UpdateSITServiceItemCustomerExpenseNotFound { + + return &UpdateSITServiceItemCustomerExpenseNotFound{} +} + +// WithPayload adds the payload to the update s i t service item customer expense not found response +func (o *UpdateSITServiceItemCustomerExpenseNotFound) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense not found response +func (o *UpdateSITServiceItemCustomerExpenseNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpenseConflictCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseConflict +const UpdateSITServiceItemCustomerExpenseConflictCode int = 409 + +/* +UpdateSITServiceItemCustomerExpenseConflict Conflict error + +swagger:response updateSITServiceItemCustomerExpenseConflict +*/ +type UpdateSITServiceItemCustomerExpenseConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseConflict creates UpdateSITServiceItemCustomerExpenseConflict with default headers values +func NewUpdateSITServiceItemCustomerExpenseConflict() *UpdateSITServiceItemCustomerExpenseConflict { + + return &UpdateSITServiceItemCustomerExpenseConflict{} +} + +// WithPayload adds the payload to the update s i t service item customer expense conflict response +func (o *UpdateSITServiceItemCustomerExpenseConflict) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense conflict response +func (o *UpdateSITServiceItemCustomerExpenseConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpensePreconditionFailedCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpensePreconditionFailed +const UpdateSITServiceItemCustomerExpensePreconditionFailedCode int = 412 + +/* +UpdateSITServiceItemCustomerExpensePreconditionFailed Precondition failed + +swagger:response updateSITServiceItemCustomerExpensePreconditionFailed +*/ +type UpdateSITServiceItemCustomerExpensePreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpensePreconditionFailed creates UpdateSITServiceItemCustomerExpensePreconditionFailed with default headers values +func NewUpdateSITServiceItemCustomerExpensePreconditionFailed() *UpdateSITServiceItemCustomerExpensePreconditionFailed { + + return &UpdateSITServiceItemCustomerExpensePreconditionFailed{} +} + +// WithPayload adds the payload to the update s i t service item customer expense precondition failed response +func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpensePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense precondition failed response +func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseUnprocessableEntity +const UpdateSITServiceItemCustomerExpenseUnprocessableEntityCode int = 422 + +/* +UpdateSITServiceItemCustomerExpenseUnprocessableEntity The payload was unprocessable. + +swagger:response updateSITServiceItemCustomerExpenseUnprocessableEntity +*/ +type UpdateSITServiceItemCustomerExpenseUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseUnprocessableEntity creates UpdateSITServiceItemCustomerExpenseUnprocessableEntity with default headers values +func NewUpdateSITServiceItemCustomerExpenseUnprocessableEntity() *UpdateSITServiceItemCustomerExpenseUnprocessableEntity { + + return &UpdateSITServiceItemCustomerExpenseUnprocessableEntity{} +} + +// WithPayload adds the payload to the update s i t service item customer expense unprocessable entity response +func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *UpdateSITServiceItemCustomerExpenseUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense unprocessable entity response +func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateSITServiceItemCustomerExpenseInternalServerErrorCode is the HTTP code returned for type UpdateSITServiceItemCustomerExpenseInternalServerError +const UpdateSITServiceItemCustomerExpenseInternalServerErrorCode int = 500 + +/* +UpdateSITServiceItemCustomerExpenseInternalServerError A server error occurred + +swagger:response updateSITServiceItemCustomerExpenseInternalServerError +*/ +type UpdateSITServiceItemCustomerExpenseInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewUpdateSITServiceItemCustomerExpenseInternalServerError creates UpdateSITServiceItemCustomerExpenseInternalServerError with default headers values +func NewUpdateSITServiceItemCustomerExpenseInternalServerError() *UpdateSITServiceItemCustomerExpenseInternalServerError { + + return &UpdateSITServiceItemCustomerExpenseInternalServerError{} +} + +// WithPayload adds the payload to the update s i t service item customer expense internal server error response +func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) WithPayload(payload *ghcmessages.Error) *UpdateSITServiceItemCustomerExpenseInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update s i t service item customer expense internal server error response +func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateSITServiceItemCustomerExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go new file mode 100644 index 00000000000..598c3b5e605 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/update_s_i_t_service_item_customer_expense_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateSITServiceItemCustomerExpenseURL generates an URL for the update s i t service item customer expense operation +type UpdateSITServiceItemCustomerExpenseURL struct { + ShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateSITServiceItemCustomerExpenseURL) WithBasePath(bp string) *UpdateSITServiceItemCustomerExpenseURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateSITServiceItemCustomerExpenseURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateSITServiceItemCustomerExpenseURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense" + + shipmentID := o.ShipmentID.String() + if shipmentID != "" { + _path = strings.Replace(_path, "{shipmentID}", shipmentID, -1) + } else { + return nil, errors.New("shipmentId is required on UpdateSITServiceItemCustomerExpenseURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateSITServiceItemCustomerExpenseURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateSITServiceItemCustomerExpenseURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateSITServiceItemCustomerExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateSITServiceItemCustomerExpenseURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateSITServiceItemCustomerExpenseURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateSITServiceItemCustomerExpenseURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go new file mode 100644 index 00000000000..0788a96be73 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tac + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// TacValidationHandlerFunc turns a function with the right signature into a tac validation handler +type TacValidationHandlerFunc func(TacValidationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn TacValidationHandlerFunc) Handle(params TacValidationParams) middleware.Responder { + return fn(params) +} + +// TacValidationHandler interface for that can handle valid tac validation params +type TacValidationHandler interface { + Handle(TacValidationParams) middleware.Responder +} + +// NewTacValidation creates a new http.Handler for the tac validation operation +func NewTacValidation(ctx *middleware.Context, handler TacValidationHandler) *TacValidation { + return &TacValidation{Context: ctx, Handler: handler} +} + +/* + TacValidation swagger:route GET /tac/valid tac order tacValidation + +# Validation of a TAC value + +Returns a boolean based on whether a tac value is valid or not +*/ +type TacValidation struct { + Context *middleware.Context + Handler TacValidationHandler +} + +func (o *TacValidation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewTacValidationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go new file mode 100644 index 00000000000..1d5c20d3673 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_parameters.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tac + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewTacValidationParams creates a new TacValidationParams object +// +// There are no default values defined in the spec. +func NewTacValidationParams() TacValidationParams { + + return TacValidationParams{} +} + +// TacValidationParams contains all the bound params for the tac validation operation +// typically these are obtained from a http.Request +// +// swagger:parameters tacValidation +type TacValidationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The tac value to validate + Required: true + In: query + */ + Tac string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewTacValidationParams() beforehand. +func (o *TacValidationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qTac, qhkTac, _ := qs.GetOK("tac") + if err := o.bindTac(qTac, qhkTac, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindTac binds and validates parameter Tac from query. +func (o *TacValidationParams) bindTac(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("tac", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("tac", "query", raw); err != nil { + return err + } + o.Tac = raw + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go new file mode 100644 index 00000000000..0c1c71ce662 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tac + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// TacValidationOKCode is the HTTP code returned for type TacValidationOK +const TacValidationOKCode int = 200 + +/* +TacValidationOK Successfully retrieved validation status + +swagger:response tacValidationOK +*/ +type TacValidationOK struct { + + /* + In: Body + */ + Payload *ghcmessages.TacValid `json:"body,omitempty"` +} + +// NewTacValidationOK creates TacValidationOK with default headers values +func NewTacValidationOK() *TacValidationOK { + + return &TacValidationOK{} +} + +// WithPayload adds the payload to the tac validation o k response +func (o *TacValidationOK) WithPayload(payload *ghcmessages.TacValid) *TacValidationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation o k response +func (o *TacValidationOK) SetPayload(payload *ghcmessages.TacValid) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// TacValidationBadRequestCode is the HTTP code returned for type TacValidationBadRequest +const TacValidationBadRequestCode int = 400 + +/* +TacValidationBadRequest The request payload is invalid + +swagger:response tacValidationBadRequest +*/ +type TacValidationBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewTacValidationBadRequest creates TacValidationBadRequest with default headers values +func NewTacValidationBadRequest() *TacValidationBadRequest { + + return &TacValidationBadRequest{} +} + +// WithPayload adds the payload to the tac validation bad request response +func (o *TacValidationBadRequest) WithPayload(payload *ghcmessages.Error) *TacValidationBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation bad request response +func (o *TacValidationBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// TacValidationUnauthorizedCode is the HTTP code returned for type TacValidationUnauthorized +const TacValidationUnauthorizedCode int = 401 + +/* +TacValidationUnauthorized The request was denied + +swagger:response tacValidationUnauthorized +*/ +type TacValidationUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewTacValidationUnauthorized creates TacValidationUnauthorized with default headers values +func NewTacValidationUnauthorized() *TacValidationUnauthorized { + + return &TacValidationUnauthorized{} +} + +// WithPayload adds the payload to the tac validation unauthorized response +func (o *TacValidationUnauthorized) WithPayload(payload *ghcmessages.Error) *TacValidationUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation unauthorized response +func (o *TacValidationUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// TacValidationForbiddenCode is the HTTP code returned for type TacValidationForbidden +const TacValidationForbiddenCode int = 403 + +/* +TacValidationForbidden The request was denied + +swagger:response tacValidationForbidden +*/ +type TacValidationForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewTacValidationForbidden creates TacValidationForbidden with default headers values +func NewTacValidationForbidden() *TacValidationForbidden { + + return &TacValidationForbidden{} +} + +// WithPayload adds the payload to the tac validation forbidden response +func (o *TacValidationForbidden) WithPayload(payload *ghcmessages.Error) *TacValidationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation forbidden response +func (o *TacValidationForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// TacValidationNotFoundCode is the HTTP code returned for type TacValidationNotFound +const TacValidationNotFoundCode int = 404 + +/* +TacValidationNotFound The requested resource wasn't found + +swagger:response tacValidationNotFound +*/ +type TacValidationNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewTacValidationNotFound creates TacValidationNotFound with default headers values +func NewTacValidationNotFound() *TacValidationNotFound { + + return &TacValidationNotFound{} +} + +// WithPayload adds the payload to the tac validation not found response +func (o *TacValidationNotFound) WithPayload(payload *ghcmessages.Error) *TacValidationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation not found response +func (o *TacValidationNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// TacValidationInternalServerErrorCode is the HTTP code returned for type TacValidationInternalServerError +const TacValidationInternalServerErrorCode int = 500 + +/* +TacValidationInternalServerError A server error occurred + +swagger:response tacValidationInternalServerError +*/ +type TacValidationInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewTacValidationInternalServerError creates TacValidationInternalServerError with default headers values +func NewTacValidationInternalServerError() *TacValidationInternalServerError { + + return &TacValidationInternalServerError{} +} + +// WithPayload adds the payload to the tac validation internal server error response +func (o *TacValidationInternalServerError) WithPayload(payload *ghcmessages.Error) *TacValidationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the tac validation internal server error response +func (o *TacValidationInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *TacValidationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go new file mode 100644 index 00000000000..4c5198ee269 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/tac/tac_validation_urlbuilder.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package tac + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// TacValidationURL generates an URL for the tac validation operation +type TacValidationURL struct { + Tac string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *TacValidationURL) WithBasePath(bp string) *TacValidationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *TacValidationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *TacValidationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/tac/valid" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + tacQ := o.Tac + if tacQ != "" { + qs.Set("tac", tacQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *TacValidationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *TacValidationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *TacValidationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on TacValidationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on TacValidationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *TacValidationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go new file mode 100644 index 00000000000..fd19356220f --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetTransportationOfficesHandlerFunc turns a function with the right signature into a get transportation offices handler +type GetTransportationOfficesHandlerFunc func(GetTransportationOfficesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetTransportationOfficesHandlerFunc) Handle(params GetTransportationOfficesParams) middleware.Responder { + return fn(params) +} + +// GetTransportationOfficesHandler interface for that can handle valid get transportation offices params +type GetTransportationOfficesHandler interface { + Handle(GetTransportationOfficesParams) middleware.Responder +} + +// NewGetTransportationOffices creates a new http.Handler for the get transportation offices operation +func NewGetTransportationOffices(ctx *middleware.Context, handler GetTransportationOfficesHandler) *GetTransportationOffices { + return &GetTransportationOffices{Context: ctx, Handler: handler} +} + +/* + GetTransportationOffices swagger:route GET /transportation-offices transportationOffice getTransportationOffices + +# Returns the transportation offices matching the search query that is enabled for PPM closeout + +Returns the transportation offices matching the search query that is enabled for PPM closeout +*/ +type GetTransportationOffices struct { + Context *middleware.Context + Handler GetTransportationOfficesHandler +} + +func (o *GetTransportationOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetTransportationOfficesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go new file mode 100644 index 00000000000..2963b3d8445 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetTransportationOfficesGBLOCsHandlerFunc turns a function with the right signature into a get transportation offices g b l o cs handler +type GetTransportationOfficesGBLOCsHandlerFunc func(GetTransportationOfficesGBLOCsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetTransportationOfficesGBLOCsHandlerFunc) Handle(params GetTransportationOfficesGBLOCsParams) middleware.Responder { + return fn(params) +} + +// GetTransportationOfficesGBLOCsHandler interface for that can handle valid get transportation offices g b l o cs params +type GetTransportationOfficesGBLOCsHandler interface { + Handle(GetTransportationOfficesGBLOCsParams) middleware.Responder +} + +// NewGetTransportationOfficesGBLOCs creates a new http.Handler for the get transportation offices g b l o cs operation +func NewGetTransportationOfficesGBLOCs(ctx *middleware.Context, handler GetTransportationOfficesGBLOCsHandler) *GetTransportationOfficesGBLOCs { + return &GetTransportationOfficesGBLOCs{Context: ctx, Handler: handler} +} + +/* + GetTransportationOfficesGBLOCs swagger:route GET /transportation-offices/gblocs transportationOffice getTransportationOfficesGBLOCs + +# Returns a list of distinct GBLOCs that exist in the transportation offices table + +Returns a list of distinct GBLOCs that exist in the transportation offices table +*/ +type GetTransportationOfficesGBLOCs struct { + Context *middleware.Context + Handler GetTransportationOfficesGBLOCsHandler +} + +func (o *GetTransportationOfficesGBLOCs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetTransportationOfficesGBLOCsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go new file mode 100644 index 00000000000..3e900e08a06 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetTransportationOfficesGBLOCsParams creates a new GetTransportationOfficesGBLOCsParams object +// +// There are no default values defined in the spec. +func NewGetTransportationOfficesGBLOCsParams() GetTransportationOfficesGBLOCsParams { + + return GetTransportationOfficesGBLOCsParams{} +} + +// GetTransportationOfficesGBLOCsParams contains all the bound params for the get transportation offices g b l o cs operation +// typically these are obtained from a http.Request +// +// swagger:parameters getTransportationOfficesGBLOCs +type GetTransportationOfficesGBLOCsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesGBLOCsParams() beforehand. +func (o *GetTransportationOfficesGBLOCsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go new file mode 100644 index 00000000000..309de84d0fa --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetTransportationOfficesGBLOCsOKCode is the HTTP code returned for type GetTransportationOfficesGBLOCsOK +const GetTransportationOfficesGBLOCsOKCode int = 200 + +/* +GetTransportationOfficesGBLOCsOK Successfully retrieved transportation offices + +swagger:response getTransportationOfficesGBLOCsOK +*/ +type GetTransportationOfficesGBLOCsOK struct { + + /* + In: Body + */ + Payload ghcmessages.GBLOCs `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsOK creates GetTransportationOfficesGBLOCsOK with default headers values +func NewGetTransportationOfficesGBLOCsOK() *GetTransportationOfficesGBLOCsOK { + + return &GetTransportationOfficesGBLOCsOK{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs o k response +func (o *GetTransportationOfficesGBLOCsOK) WithPayload(payload ghcmessages.GBLOCs) *GetTransportationOfficesGBLOCsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs o k response +func (o *GetTransportationOfficesGBLOCsOK) SetPayload(payload ghcmessages.GBLOCs) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.GBLOCs{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetTransportationOfficesGBLOCsBadRequestCode is the HTTP code returned for type GetTransportationOfficesGBLOCsBadRequest +const GetTransportationOfficesGBLOCsBadRequestCode int = 400 + +/* +GetTransportationOfficesGBLOCsBadRequest The request payload is invalid + +swagger:response getTransportationOfficesGBLOCsBadRequest +*/ +type GetTransportationOfficesGBLOCsBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsBadRequest creates GetTransportationOfficesGBLOCsBadRequest with default headers values +func NewGetTransportationOfficesGBLOCsBadRequest() *GetTransportationOfficesGBLOCsBadRequest { + + return &GetTransportationOfficesGBLOCsBadRequest{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs bad request response +func (o *GetTransportationOfficesGBLOCsBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs bad request response +func (o *GetTransportationOfficesGBLOCsBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesGBLOCsUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesGBLOCsUnauthorized +const GetTransportationOfficesGBLOCsUnauthorizedCode int = 401 + +/* +GetTransportationOfficesGBLOCsUnauthorized The request was denied + +swagger:response getTransportationOfficesGBLOCsUnauthorized +*/ +type GetTransportationOfficesGBLOCsUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsUnauthorized creates GetTransportationOfficesGBLOCsUnauthorized with default headers values +func NewGetTransportationOfficesGBLOCsUnauthorized() *GetTransportationOfficesGBLOCsUnauthorized { + + return &GetTransportationOfficesGBLOCsUnauthorized{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs unauthorized response +func (o *GetTransportationOfficesGBLOCsUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs unauthorized response +func (o *GetTransportationOfficesGBLOCsUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesGBLOCsForbiddenCode is the HTTP code returned for type GetTransportationOfficesGBLOCsForbidden +const GetTransportationOfficesGBLOCsForbiddenCode int = 403 + +/* +GetTransportationOfficesGBLOCsForbidden The request was denied + +swagger:response getTransportationOfficesGBLOCsForbidden +*/ +type GetTransportationOfficesGBLOCsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsForbidden creates GetTransportationOfficesGBLOCsForbidden with default headers values +func NewGetTransportationOfficesGBLOCsForbidden() *GetTransportationOfficesGBLOCsForbidden { + + return &GetTransportationOfficesGBLOCsForbidden{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs forbidden response +func (o *GetTransportationOfficesGBLOCsForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs forbidden response +func (o *GetTransportationOfficesGBLOCsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesGBLOCsNotFoundCode is the HTTP code returned for type GetTransportationOfficesGBLOCsNotFound +const GetTransportationOfficesGBLOCsNotFoundCode int = 404 + +/* +GetTransportationOfficesGBLOCsNotFound The requested resource wasn't found + +swagger:response getTransportationOfficesGBLOCsNotFound +*/ +type GetTransportationOfficesGBLOCsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsNotFound creates GetTransportationOfficesGBLOCsNotFound with default headers values +func NewGetTransportationOfficesGBLOCsNotFound() *GetTransportationOfficesGBLOCsNotFound { + + return &GetTransportationOfficesGBLOCsNotFound{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs not found response +func (o *GetTransportationOfficesGBLOCsNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs not found response +func (o *GetTransportationOfficesGBLOCsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesGBLOCsInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesGBLOCsInternalServerError +const GetTransportationOfficesGBLOCsInternalServerErrorCode int = 500 + +/* +GetTransportationOfficesGBLOCsInternalServerError A server error occurred + +swagger:response getTransportationOfficesGBLOCsInternalServerError +*/ +type GetTransportationOfficesGBLOCsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesGBLOCsInternalServerError creates GetTransportationOfficesGBLOCsInternalServerError with default headers values +func NewGetTransportationOfficesGBLOCsInternalServerError() *GetTransportationOfficesGBLOCsInternalServerError { + + return &GetTransportationOfficesGBLOCsInternalServerError{} +} + +// WithPayload adds the payload to the get transportation offices g b l o cs internal server error response +func (o *GetTransportationOfficesGBLOCsInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesGBLOCsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices g b l o cs internal server error response +func (o *GetTransportationOfficesGBLOCsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesGBLOCsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go new file mode 100644 index 00000000000..facd23c184d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_g_b_l_o_cs_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetTransportationOfficesGBLOCsURL generates an URL for the get transportation offices g b l o cs operation +type GetTransportationOfficesGBLOCsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesGBLOCsURL) WithBasePath(bp string) *GetTransportationOfficesGBLOCsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesGBLOCsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetTransportationOfficesGBLOCsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/transportation-offices/gblocs" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetTransportationOfficesGBLOCsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetTransportationOfficesGBLOCsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetTransportationOfficesGBLOCsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetTransportationOfficesGBLOCsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetTransportationOfficesGBLOCsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetTransportationOfficesGBLOCsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go new file mode 100644 index 00000000000..457347fb6dd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetTransportationOfficesOpenHandlerFunc turns a function with the right signature into a get transportation offices open handler +type GetTransportationOfficesOpenHandlerFunc func(GetTransportationOfficesOpenParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetTransportationOfficesOpenHandlerFunc) Handle(params GetTransportationOfficesOpenParams) middleware.Responder { + return fn(params) +} + +// GetTransportationOfficesOpenHandler interface for that can handle valid get transportation offices open params +type GetTransportationOfficesOpenHandler interface { + Handle(GetTransportationOfficesOpenParams) middleware.Responder +} + +// NewGetTransportationOfficesOpen creates a new http.Handler for the get transportation offices open operation +func NewGetTransportationOfficesOpen(ctx *middleware.Context, handler GetTransportationOfficesOpenHandler) *GetTransportationOfficesOpen { + return &GetTransportationOfficesOpen{Context: ctx, Handler: handler} +} + +/* + GetTransportationOfficesOpen swagger:route GET /open/transportation-offices transportationOffice getTransportationOfficesOpen + +# Returns the transportation offices matching the search query + +This endpoint is publicly accessible as it is utilized to access transportation office information without having an office account.Returns the transportation offices matching the search query. +*/ +type GetTransportationOfficesOpen struct { + Context *middleware.Context + Handler GetTransportationOfficesOpenHandler +} + +func (o *GetTransportationOfficesOpen) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetTransportationOfficesOpenParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go new file mode 100644 index 00000000000..87d8e07ea5d --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_parameters.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetTransportationOfficesOpenParams creates a new GetTransportationOfficesOpenParams object +// +// There are no default values defined in the spec. +func NewGetTransportationOfficesOpenParams() GetTransportationOfficesOpenParams { + + return GetTransportationOfficesOpenParams{} +} + +// GetTransportationOfficesOpenParams contains all the bound params for the get transportation offices open operation +// typically these are obtained from a http.Request +// +// swagger:parameters getTransportationOfficesOpen +type GetTransportationOfficesOpenParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Search string for transportation offices + Required: true + Min Length: 2 + In: query + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesOpenParams() beforehand. +func (o *GetTransportationOfficesOpenParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSearch, qhkSearch, _ := qs.GetOK("search") + if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from query. +func (o *GetTransportationOfficesOpenParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("search", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("search", "query", raw); err != nil { + return err + } + o.Search = raw + + if err := o.validateSearch(formats); err != nil { + return err + } + + return nil +} + +// validateSearch carries on validations for parameter Search +func (o *GetTransportationOfficesOpenParams) validateSearch(formats strfmt.Registry) error { + + if err := validate.MinLength("search", "query", o.Search, 2); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go new file mode 100644 index 00000000000..bb5a2aaae03 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetTransportationOfficesOpenOKCode is the HTTP code returned for type GetTransportationOfficesOpenOK +const GetTransportationOfficesOpenOKCode int = 200 + +/* +GetTransportationOfficesOpenOK Successfully retrieved transportation offices + +swagger:response getTransportationOfficesOpenOK +*/ +type GetTransportationOfficesOpenOK struct { + + /* + In: Body + */ + Payload ghcmessages.TransportationOffices `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenOK creates GetTransportationOfficesOpenOK with default headers values +func NewGetTransportationOfficesOpenOK() *GetTransportationOfficesOpenOK { + + return &GetTransportationOfficesOpenOK{} +} + +// WithPayload adds the payload to the get transportation offices open o k response +func (o *GetTransportationOfficesOpenOK) WithPayload(payload ghcmessages.TransportationOffices) *GetTransportationOfficesOpenOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open o k response +func (o *GetTransportationOfficesOpenOK) SetPayload(payload ghcmessages.TransportationOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.TransportationOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetTransportationOfficesOpenBadRequestCode is the HTTP code returned for type GetTransportationOfficesOpenBadRequest +const GetTransportationOfficesOpenBadRequestCode int = 400 + +/* +GetTransportationOfficesOpenBadRequest The request payload is invalid + +swagger:response getTransportationOfficesOpenBadRequest +*/ +type GetTransportationOfficesOpenBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenBadRequest creates GetTransportationOfficesOpenBadRequest with default headers values +func NewGetTransportationOfficesOpenBadRequest() *GetTransportationOfficesOpenBadRequest { + + return &GetTransportationOfficesOpenBadRequest{} +} + +// WithPayload adds the payload to the get transportation offices open bad request response +func (o *GetTransportationOfficesOpenBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open bad request response +func (o *GetTransportationOfficesOpenBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesOpenUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesOpenUnauthorized +const GetTransportationOfficesOpenUnauthorizedCode int = 401 + +/* +GetTransportationOfficesOpenUnauthorized The request was denied + +swagger:response getTransportationOfficesOpenUnauthorized +*/ +type GetTransportationOfficesOpenUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenUnauthorized creates GetTransportationOfficesOpenUnauthorized with default headers values +func NewGetTransportationOfficesOpenUnauthorized() *GetTransportationOfficesOpenUnauthorized { + + return &GetTransportationOfficesOpenUnauthorized{} +} + +// WithPayload adds the payload to the get transportation offices open unauthorized response +func (o *GetTransportationOfficesOpenUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open unauthorized response +func (o *GetTransportationOfficesOpenUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesOpenForbiddenCode is the HTTP code returned for type GetTransportationOfficesOpenForbidden +const GetTransportationOfficesOpenForbiddenCode int = 403 + +/* +GetTransportationOfficesOpenForbidden The request was denied + +swagger:response getTransportationOfficesOpenForbidden +*/ +type GetTransportationOfficesOpenForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenForbidden creates GetTransportationOfficesOpenForbidden with default headers values +func NewGetTransportationOfficesOpenForbidden() *GetTransportationOfficesOpenForbidden { + + return &GetTransportationOfficesOpenForbidden{} +} + +// WithPayload adds the payload to the get transportation offices open forbidden response +func (o *GetTransportationOfficesOpenForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open forbidden response +func (o *GetTransportationOfficesOpenForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesOpenNotFoundCode is the HTTP code returned for type GetTransportationOfficesOpenNotFound +const GetTransportationOfficesOpenNotFoundCode int = 404 + +/* +GetTransportationOfficesOpenNotFound The requested resource wasn't found + +swagger:response getTransportationOfficesOpenNotFound +*/ +type GetTransportationOfficesOpenNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenNotFound creates GetTransportationOfficesOpenNotFound with default headers values +func NewGetTransportationOfficesOpenNotFound() *GetTransportationOfficesOpenNotFound { + + return &GetTransportationOfficesOpenNotFound{} +} + +// WithPayload adds the payload to the get transportation offices open not found response +func (o *GetTransportationOfficesOpenNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open not found response +func (o *GetTransportationOfficesOpenNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesOpenInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesOpenInternalServerError +const GetTransportationOfficesOpenInternalServerErrorCode int = 500 + +/* +GetTransportationOfficesOpenInternalServerError A server error occurred + +swagger:response getTransportationOfficesOpenInternalServerError +*/ +type GetTransportationOfficesOpenInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOpenInternalServerError creates GetTransportationOfficesOpenInternalServerError with default headers values +func NewGetTransportationOfficesOpenInternalServerError() *GetTransportationOfficesOpenInternalServerError { + + return &GetTransportationOfficesOpenInternalServerError{} +} + +// WithPayload adds the payload to the get transportation offices open internal server error response +func (o *GetTransportationOfficesOpenInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesOpenInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices open internal server error response +func (o *GetTransportationOfficesOpenInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOpenInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go new file mode 100644 index 00000000000..d559a132ce4 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_open_urlbuilder.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetTransportationOfficesOpenURL generates an URL for the get transportation offices open operation +type GetTransportationOfficesOpenURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesOpenURL) WithBasePath(bp string) *GetTransportationOfficesOpenURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesOpenURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetTransportationOfficesOpenURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/open/transportation-offices" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + searchQ := o.Search + if searchQ != "" { + qs.Set("search", searchQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetTransportationOfficesOpenURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetTransportationOfficesOpenURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetTransportationOfficesOpenURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetTransportationOfficesOpenURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetTransportationOfficesOpenURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetTransportationOfficesOpenURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go new file mode 100644 index 00000000000..4ffe186391e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_parameters.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetTransportationOfficesParams creates a new GetTransportationOfficesParams object +// +// There are no default values defined in the spec. +func NewGetTransportationOfficesParams() GetTransportationOfficesParams { + + return GetTransportationOfficesParams{} +} + +// GetTransportationOfficesParams contains all the bound params for the get transportation offices operation +// typically these are obtained from a http.Request +// +// swagger:parameters getTransportationOffices +type GetTransportationOfficesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Search string for transportation offices + Required: true + Min Length: 2 + In: query + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesParams() beforehand. +func (o *GetTransportationOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSearch, qhkSearch, _ := qs.GetOK("search") + if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from query. +func (o *GetTransportationOfficesParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("search", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("search", "query", raw); err != nil { + return err + } + o.Search = raw + + if err := o.validateSearch(formats); err != nil { + return err + } + + return nil +} + +// validateSearch carries on validations for parameter Search +func (o *GetTransportationOfficesParams) validateSearch(formats strfmt.Registry) error { + + if err := validate.MinLength("search", "query", o.Search, 2); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go new file mode 100644 index 00000000000..8d85d775341 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetTransportationOfficesOKCode is the HTTP code returned for type GetTransportationOfficesOK +const GetTransportationOfficesOKCode int = 200 + +/* +GetTransportationOfficesOK Successfully retrieved transportation offices + +swagger:response getTransportationOfficesOK +*/ +type GetTransportationOfficesOK struct { + + /* + In: Body + */ + Payload ghcmessages.TransportationOffices `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOK creates GetTransportationOfficesOK with default headers values +func NewGetTransportationOfficesOK() *GetTransportationOfficesOK { + + return &GetTransportationOfficesOK{} +} + +// WithPayload adds the payload to the get transportation offices o k response +func (o *GetTransportationOfficesOK) WithPayload(payload ghcmessages.TransportationOffices) *GetTransportationOfficesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices o k response +func (o *GetTransportationOfficesOK) SetPayload(payload ghcmessages.TransportationOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = ghcmessages.TransportationOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetTransportationOfficesBadRequestCode is the HTTP code returned for type GetTransportationOfficesBadRequest +const GetTransportationOfficesBadRequestCode int = 400 + +/* +GetTransportationOfficesBadRequest The request payload is invalid + +swagger:response getTransportationOfficesBadRequest +*/ +type GetTransportationOfficesBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesBadRequest creates GetTransportationOfficesBadRequest with default headers values +func NewGetTransportationOfficesBadRequest() *GetTransportationOfficesBadRequest { + + return &GetTransportationOfficesBadRequest{} +} + +// WithPayload adds the payload to the get transportation offices bad request response +func (o *GetTransportationOfficesBadRequest) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices bad request response +func (o *GetTransportationOfficesBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesUnauthorized +const GetTransportationOfficesUnauthorizedCode int = 401 + +/* +GetTransportationOfficesUnauthorized The request was denied + +swagger:response getTransportationOfficesUnauthorized +*/ +type GetTransportationOfficesUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesUnauthorized creates GetTransportationOfficesUnauthorized with default headers values +func NewGetTransportationOfficesUnauthorized() *GetTransportationOfficesUnauthorized { + + return &GetTransportationOfficesUnauthorized{} +} + +// WithPayload adds the payload to the get transportation offices unauthorized response +func (o *GetTransportationOfficesUnauthorized) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices unauthorized response +func (o *GetTransportationOfficesUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesForbiddenCode is the HTTP code returned for type GetTransportationOfficesForbidden +const GetTransportationOfficesForbiddenCode int = 403 + +/* +GetTransportationOfficesForbidden The request was denied + +swagger:response getTransportationOfficesForbidden +*/ +type GetTransportationOfficesForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesForbidden creates GetTransportationOfficesForbidden with default headers values +func NewGetTransportationOfficesForbidden() *GetTransportationOfficesForbidden { + + return &GetTransportationOfficesForbidden{} +} + +// WithPayload adds the payload to the get transportation offices forbidden response +func (o *GetTransportationOfficesForbidden) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices forbidden response +func (o *GetTransportationOfficesForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesNotFoundCode is the HTTP code returned for type GetTransportationOfficesNotFound +const GetTransportationOfficesNotFoundCode int = 404 + +/* +GetTransportationOfficesNotFound The requested resource wasn't found + +swagger:response getTransportationOfficesNotFound +*/ +type GetTransportationOfficesNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesNotFound creates GetTransportationOfficesNotFound with default headers values +func NewGetTransportationOfficesNotFound() *GetTransportationOfficesNotFound { + + return &GetTransportationOfficesNotFound{} +} + +// WithPayload adds the payload to the get transportation offices not found response +func (o *GetTransportationOfficesNotFound) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices not found response +func (o *GetTransportationOfficesNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesInternalServerError +const GetTransportationOfficesInternalServerErrorCode int = 500 + +/* +GetTransportationOfficesInternalServerError A server error occurred + +swagger:response getTransportationOfficesInternalServerError +*/ +type GetTransportationOfficesInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesInternalServerError creates GetTransportationOfficesInternalServerError with default headers values +func NewGetTransportationOfficesInternalServerError() *GetTransportationOfficesInternalServerError { + + return &GetTransportationOfficesInternalServerError{} +} + +// WithPayload adds the payload to the get transportation offices internal server error response +func (o *GetTransportationOfficesInternalServerError) WithPayload(payload *ghcmessages.Error) *GetTransportationOfficesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices internal server error response +func (o *GetTransportationOfficesInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go new file mode 100644 index 00000000000..540f7a01edd --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/get_transportation_offices_urlbuilder.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetTransportationOfficesURL generates an URL for the get transportation offices operation +type GetTransportationOfficesURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesURL) WithBasePath(bp string) *GetTransportationOfficesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetTransportationOfficesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/transportation-offices" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + searchQ := o.Search + if searchQ != "" { + qs.Set("search", searchQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetTransportationOfficesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetTransportationOfficesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetTransportationOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetTransportationOfficesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetTransportationOfficesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetTransportationOfficesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go new file mode 100644 index 00000000000..91b006bd391 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler +type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { + return fn(params) +} + +// CreateUploadHandler interface for that can handle valid create upload params +type CreateUploadHandler interface { + Handle(CreateUploadParams) middleware.Responder +} + +// NewCreateUpload creates a new http.Handler for the create upload operation +func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { + return &CreateUpload{Context: ctx, Handler: handler} +} + +/* + CreateUpload swagger:route POST /uploads uploads createUpload + +# Create a new upload + +Uploads represent a single digital file, such as a JPEG or PDF. Currently, office application uploads are only for Services Counselors to upload files for orders, but this may be expanded in the future. +*/ +type CreateUpload struct { + Context *middleware.Context + Handler CreateUploadHandler +} + +func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go new file mode 100644 index 00000000000..c3c00400764 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CreateUploadMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreateUploadMaxParseMemory int64 = 32 << 20 + +// NewCreateUploadParams creates a new CreateUploadParams object +// +// There are no default values defined in the spec. +func NewCreateUploadParams() CreateUploadParams { + + return CreateUploadParams{} +} + +// CreateUploadParams contains all the bound params for the create upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters createUpload +type CreateUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the document to add an upload to + In: query + */ + DocumentID *strfmt.UUID + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. +func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") + if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { + res = append(res, err) + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDocumentID binds and validates parameter DocumentID from query. +func (o *CreateUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) + } + o.DocumentID = (value.(*strfmt.UUID)) + + if err := o.validateDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateDocumentID carries on validations for parameter DocumentID +func (o *CreateUploadParams) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go new file mode 100644 index 00000000000..f6f0c90faed --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated +const CreateUploadCreatedCode int = 201 + +/* +CreateUploadCreated created upload + +swagger:response createUploadCreated +*/ +type CreateUploadCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.Upload `json:"body,omitempty"` +} + +// NewCreateUploadCreated creates CreateUploadCreated with default headers values +func NewCreateUploadCreated() *CreateUploadCreated { + + return &CreateUploadCreated{} +} + +// WithPayload adds the payload to the create upload created response +func (o *CreateUploadCreated) WithPayload(payload *ghcmessages.Upload) *CreateUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload created response +func (o *CreateUploadCreated) SetPayload(payload *ghcmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest +const CreateUploadBadRequestCode int = 400 + +/* +CreateUploadBadRequest invalid request + +swagger:response createUploadBadRequest +*/ +type CreateUploadBadRequest struct { +} + +// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values +func NewCreateUploadBadRequest() *CreateUploadBadRequest { + + return &CreateUploadBadRequest{} +} + +// WriteResponse to the client +func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden +const CreateUploadForbiddenCode int = 403 + +/* +CreateUploadForbidden not authorized + +swagger:response createUploadForbidden +*/ +type CreateUploadForbidden struct { +} + +// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values +func NewCreateUploadForbidden() *CreateUploadForbidden { + + return &CreateUploadForbidden{} +} + +// WriteResponse to the client +func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound +const CreateUploadNotFoundCode int = 404 + +/* +CreateUploadNotFound not found + +swagger:response createUploadNotFound +*/ +type CreateUploadNotFound struct { +} + +// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values +func NewCreateUploadNotFound() *CreateUploadNotFound { + + return &CreateUploadNotFound{} +} + +// WriteResponse to the client +func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// CreateUploadRequestEntityTooLargeCode is the HTTP code returned for type CreateUploadRequestEntityTooLarge +const CreateUploadRequestEntityTooLargeCode int = 413 + +/* +CreateUploadRequestEntityTooLarge payload is too large + +swagger:response createUploadRequestEntityTooLarge +*/ +type CreateUploadRequestEntityTooLarge struct { +} + +// NewCreateUploadRequestEntityTooLarge creates CreateUploadRequestEntityTooLarge with default headers values +func NewCreateUploadRequestEntityTooLarge() *CreateUploadRequestEntityTooLarge { + + return &CreateUploadRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *CreateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError +const CreateUploadInternalServerErrorCode int = 500 + +/* +CreateUploadInternalServerError server error + +swagger:response createUploadInternalServerError +*/ +type CreateUploadInternalServerError struct { +} + +// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values +func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { + + return &CreateUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go new file mode 100644 index 00000000000..526f68188d1 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/create_upload_urlbuilder.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" +) + +// CreateUploadURL generates an URL for the create upload operation +type CreateUploadURL struct { + DocumentID *strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var documentIDQ string + if o.DocumentID != nil { + documentIDQ = o.DocumentID.String() + } + if documentIDQ != "" { + qs.Set("documentId", documentIDQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go new file mode 100644 index 00000000000..7b3c8a85298 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteUploadHandlerFunc turns a function with the right signature into a delete upload handler +type DeleteUploadHandlerFunc func(DeleteUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteUploadHandlerFunc) Handle(params DeleteUploadParams) middleware.Responder { + return fn(params) +} + +// DeleteUploadHandler interface for that can handle valid delete upload params +type DeleteUploadHandler interface { + Handle(DeleteUploadParams) middleware.Responder +} + +// NewDeleteUpload creates a new http.Handler for the delete upload operation +func NewDeleteUpload(ctx *middleware.Context, handler DeleteUploadHandler) *DeleteUpload { + return &DeleteUpload{Context: ctx, Handler: handler} +} + +/* + DeleteUpload swagger:route DELETE /uploads/{uploadID} uploads deleteUpload + +# Deletes an upload + +Uploads represent a single digital file, such as a JPEG or PDF. +*/ +type DeleteUpload struct { + Context *middleware.Context + Handler DeleteUploadHandler +} + +func (o *DeleteUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go new file mode 100644 index 00000000000..dbda2b48511 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_parameters.go @@ -0,0 +1,140 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteUploadParams creates a new DeleteUploadParams object +// +// There are no default values defined in the spec. +func NewDeleteUploadParams() DeleteUploadParams { + + return DeleteUploadParams{} +} + +// DeleteUploadParams contains all the bound params for the delete upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteUpload +type DeleteUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the order that the upload belongs to + In: query + */ + OrderID *strfmt.UUID + /*UUID of the upload to be deleted + Required: true + In: path + */ + UploadID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteUploadParams() beforehand. +func (o *DeleteUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qOrderID, qhkOrderID, _ := qs.GetOK("orderID") + if err := o.bindOrderID(qOrderID, qhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + + rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadID") + if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOrderID binds and validates parameter OrderID from query. +func (o *DeleteUploadParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderID", "query", "strfmt.UUID", raw) + } + o.OrderID = (value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *DeleteUploadParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderID", "query", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} + +// bindUploadID binds and validates parameter UploadID from path. +func (o *DeleteUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("uploadID", "path", "strfmt.UUID", raw) + } + o.UploadID = *(value.(*strfmt.UUID)) + + if err := o.validateUploadID(formats); err != nil { + return err + } + + return nil +} + +// validateUploadID carries on validations for parameter UploadID +func (o *DeleteUploadParams) validateUploadID(formats strfmt.Registry) error { + + if err := validate.FormatOf("uploadID", "path", "uuid", o.UploadID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go new file mode 100644 index 00000000000..27997373cea --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// DeleteUploadNoContentCode is the HTTP code returned for type DeleteUploadNoContent +const DeleteUploadNoContentCode int = 204 + +/* +DeleteUploadNoContent deleted + +swagger:response deleteUploadNoContent +*/ +type DeleteUploadNoContent struct { +} + +// NewDeleteUploadNoContent creates DeleteUploadNoContent with default headers values +func NewDeleteUploadNoContent() *DeleteUploadNoContent { + + return &DeleteUploadNoContent{} +} + +// WriteResponse to the client +func (o *DeleteUploadNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteUploadBadRequestCode is the HTTP code returned for type DeleteUploadBadRequest +const DeleteUploadBadRequestCode int = 400 + +/* +DeleteUploadBadRequest invalid request + +swagger:response deleteUploadBadRequest +*/ +type DeleteUploadBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewDeleteUploadBadRequest creates DeleteUploadBadRequest with default headers values +func NewDeleteUploadBadRequest() *DeleteUploadBadRequest { + + return &DeleteUploadBadRequest{} +} + +// WithPayload adds the payload to the delete upload bad request response +func (o *DeleteUploadBadRequest) WithPayload(payload *ghcmessages.InvalidRequestResponsePayload) *DeleteUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete upload bad request response +func (o *DeleteUploadBadRequest) SetPayload(payload *ghcmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteUploadForbiddenCode is the HTTP code returned for type DeleteUploadForbidden +const DeleteUploadForbiddenCode int = 403 + +/* +DeleteUploadForbidden not authorized + +swagger:response deleteUploadForbidden +*/ +type DeleteUploadForbidden struct { +} + +// NewDeleteUploadForbidden creates DeleteUploadForbidden with default headers values +func NewDeleteUploadForbidden() *DeleteUploadForbidden { + + return &DeleteUploadForbidden{} +} + +// WriteResponse to the client +func (o *DeleteUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// DeleteUploadNotFoundCode is the HTTP code returned for type DeleteUploadNotFound +const DeleteUploadNotFoundCode int = 404 + +/* +DeleteUploadNotFound not found + +swagger:response deleteUploadNotFound +*/ +type DeleteUploadNotFound struct { +} + +// NewDeleteUploadNotFound creates DeleteUploadNotFound with default headers values +func NewDeleteUploadNotFound() *DeleteUploadNotFound { + + return &DeleteUploadNotFound{} +} + +// WriteResponse to the client +func (o *DeleteUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DeleteUploadInternalServerErrorCode is the HTTP code returned for type DeleteUploadInternalServerError +const DeleteUploadInternalServerErrorCode int = 500 + +/* +DeleteUploadInternalServerError server error + +swagger:response deleteUploadInternalServerError +*/ +type DeleteUploadInternalServerError struct { +} + +// NewDeleteUploadInternalServerError creates DeleteUploadInternalServerError with default headers values +func NewDeleteUploadInternalServerError() *DeleteUploadInternalServerError { + + return &DeleteUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *DeleteUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go new file mode 100644 index 00000000000..64a468d4251 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/delete_upload_urlbuilder.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteUploadURL generates an URL for the delete upload operation +type DeleteUploadURL struct { + UploadID strfmt.UUID + + OrderID *strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadURL) WithBasePath(bp string) *DeleteUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads/{uploadID}" + + uploadID := o.UploadID.String() + if uploadID != "" { + _path = strings.Replace(_path, "{uploadID}", uploadID, -1) + } else { + return nil, errors.New("uploadId is required on DeleteUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var orderIDQ string + if o.OrderID != nil { + orderIDQ = o.OrderID.String() + } + if orderIDQ != "" { + qs.Set("orderID", orderIDQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go new file mode 100644 index 00000000000..df53caf0b06 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetUploadHandlerFunc turns a function with the right signature into a get upload handler +type GetUploadHandlerFunc func(GetUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetUploadHandlerFunc) Handle(params GetUploadParams) middleware.Responder { + return fn(params) +} + +// GetUploadHandler interface for that can handle valid get upload params +type GetUploadHandler interface { + Handle(GetUploadParams) middleware.Responder +} + +// NewGetUpload creates a new http.Handler for the get upload operation +func NewGetUpload(ctx *middleware.Context, handler GetUploadHandler) *GetUpload { + return &GetUpload{Context: ctx, Handler: handler} +} + +/* + GetUpload swagger:route GET /uploads/get/ uploads getUpload + +# Gets an upload by ID + +Gets an upload +*/ +type GetUpload struct { + Context *middleware.Context + Handler GetUploadHandler +} + +func (o *GetUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go new file mode 100644 index 00000000000..ecb5da8a69c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewGetUploadParams creates a new GetUploadParams object +// +// There are no default values defined in the spec. +func NewGetUploadParams() GetUploadParams { + + return GetUploadParams{} +} + +// GetUploadParams contains all the bound params for the get upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters getUpload +type GetUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetUploadParams() beforehand. +func (o *GetUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go new file mode 100644 index 00000000000..b4eba10ed6e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// GetUploadOKCode is the HTTP code returned for type GetUploadOK +const GetUploadOKCode int = 200 + +/* +GetUploadOK Successfully retrieved upload + +swagger:response getUploadOK +*/ +type GetUploadOK struct { + + /* + In: Body + */ + Payload *ghcmessages.Upload `json:"body,omitempty"` +} + +// NewGetUploadOK creates GetUploadOK with default headers values +func NewGetUploadOK() *GetUploadOK { + + return &GetUploadOK{} +} + +// WithPayload adds the payload to the get upload o k response +func (o *GetUploadOK) WithPayload(payload *ghcmessages.Upload) *GetUploadOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload o k response +func (o *GetUploadOK) SetPayload(payload *ghcmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadBadRequestCode is the HTTP code returned for type GetUploadBadRequest +const GetUploadBadRequestCode int = 400 + +/* +GetUploadBadRequest The request payload is invalid + +swagger:response getUploadBadRequest +*/ +type GetUploadBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetUploadBadRequest creates GetUploadBadRequest with default headers values +func NewGetUploadBadRequest() *GetUploadBadRequest { + + return &GetUploadBadRequest{} +} + +// WithPayload adds the payload to the get upload bad request response +func (o *GetUploadBadRequest) WithPayload(payload *ghcmessages.Error) *GetUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload bad request response +func (o *GetUploadBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadUnauthorizedCode is the HTTP code returned for type GetUploadUnauthorized +const GetUploadUnauthorizedCode int = 401 + +/* +GetUploadUnauthorized The request was denied + +swagger:response getUploadUnauthorized +*/ +type GetUploadUnauthorized struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetUploadUnauthorized creates GetUploadUnauthorized with default headers values +func NewGetUploadUnauthorized() *GetUploadUnauthorized { + + return &GetUploadUnauthorized{} +} + +// WithPayload adds the payload to the get upload unauthorized response +func (o *GetUploadUnauthorized) WithPayload(payload *ghcmessages.Error) *GetUploadUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload unauthorized response +func (o *GetUploadUnauthorized) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadForbiddenCode is the HTTP code returned for type GetUploadForbidden +const GetUploadForbiddenCode int = 403 + +/* +GetUploadForbidden The request was denied + +swagger:response getUploadForbidden +*/ +type GetUploadForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetUploadForbidden creates GetUploadForbidden with default headers values +func NewGetUploadForbidden() *GetUploadForbidden { + + return &GetUploadForbidden{} +} + +// WithPayload adds the payload to the get upload forbidden response +func (o *GetUploadForbidden) WithPayload(payload *ghcmessages.Error) *GetUploadForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload forbidden response +func (o *GetUploadForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadNotFoundCode is the HTTP code returned for type GetUploadNotFound +const GetUploadNotFoundCode int = 404 + +/* +GetUploadNotFound The requested resource wasn't found + +swagger:response getUploadNotFound +*/ +type GetUploadNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetUploadNotFound creates GetUploadNotFound with default headers values +func NewGetUploadNotFound() *GetUploadNotFound { + + return &GetUploadNotFound{} +} + +// WithPayload adds the payload to the get upload not found response +func (o *GetUploadNotFound) WithPayload(payload *ghcmessages.Error) *GetUploadNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload not found response +func (o *GetUploadNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetUploadInternalServerErrorCode is the HTTP code returned for type GetUploadInternalServerError +const GetUploadInternalServerErrorCode int = 500 + +/* +GetUploadInternalServerError A server error occurred + +swagger:response getUploadInternalServerError +*/ +type GetUploadInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewGetUploadInternalServerError creates GetUploadInternalServerError with default headers values +func NewGetUploadInternalServerError() *GetUploadInternalServerError { + + return &GetUploadInternalServerError{} +} + +// WithPayload adds the payload to the get upload internal server error response +func (o *GetUploadInternalServerError) WithPayload(payload *ghcmessages.Error) *GetUploadInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get upload internal server error response +func (o *GetUploadInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go new file mode 100644 index 00000000000..94ea195a90a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/get_upload_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetUploadURL generates an URL for the get upload operation +type GetUploadURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUploadURL) WithBasePath(bp string) *GetUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads/get/" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go new file mode 100644 index 00000000000..f861fa06ad8 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateUploadHandlerFunc turns a function with the right signature into a update upload handler +type UpdateUploadHandlerFunc func(UpdateUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateUploadHandlerFunc) Handle(params UpdateUploadParams) middleware.Responder { + return fn(params) +} + +// UpdateUploadHandler interface for that can handle valid update upload params +type UpdateUploadHandler interface { + Handle(UpdateUploadParams) middleware.Responder +} + +// NewUpdateUpload creates a new http.Handler for the update upload operation +func NewUpdateUpload(ctx *middleware.Context, handler UpdateUploadHandler) *UpdateUpload { + return &UpdateUpload{Context: ctx, Handler: handler} +} + +/* + UpdateUpload swagger:route PATCH /uploads/{uploadID}/update uploads updateUpload + +Update an existing upload. This is only needed currently for updating the image rotation. + +Uploads represent a single digital file, such as a JPEG or PDF. The rotation is relevant to how it is displayed on the page. +*/ +type UpdateUpload struct { + Context *middleware.Context + Handler UpdateUploadHandler +} + +func (o *UpdateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// UpdateUploadBody update upload body +// +// swagger:model UpdateUploadBody +type UpdateUploadBody struct { + + // The rotation of the image + // Maximum: 3 + // Minimum: 0 + Rotation *int64 `json:"rotation,omitempty"` +} + +// Validate validates this update upload body +func (o *UpdateUploadBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateRotation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *UpdateUploadBody) validateRotation(formats strfmt.Registry) error { + if swag.IsZero(o.Rotation) { // not required + return nil + } + + if err := validate.MinimumInt("body"+"."+"rotation", "body", *o.Rotation, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("body"+"."+"rotation", "body", *o.Rotation, 3, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update upload body based on context it is used +func (o *UpdateUploadBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *UpdateUploadBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *UpdateUploadBody) UnmarshalBinary(b []byte) error { + var res UpdateUploadBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go new file mode 100644 index 00000000000..d068e218990 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_parameters.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateUploadParams creates a new UpdateUploadParams object +// +// There are no default values defined in the spec. +func NewUpdateUploadParams() UpdateUploadParams { + + return UpdateUploadParams{} +} + +// UpdateUploadParams contains all the bound params for the update upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateUpload +type UpdateUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body UpdateUploadBody + /*UUID of the upload to be updated + Required: true + In: path + */ + UploadID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateUploadParams() beforehand. +func (o *UpdateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body UpdateUploadBody + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadID") + if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindUploadID binds and validates parameter UploadID from path. +func (o *UpdateUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("uploadID", "path", "strfmt.UUID", raw) + } + o.UploadID = *(value.(*strfmt.UUID)) + + if err := o.validateUploadID(formats); err != nil { + return err + } + + return nil +} + +// validateUploadID carries on validations for parameter UploadID +func (o *UpdateUploadParams) validateUploadID(formats strfmt.Registry) error { + + if err := validate.FormatOf("uploadID", "path", "uuid", o.UploadID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go new file mode 100644 index 00000000000..236a1d4ec73 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// UpdateUploadCreatedCode is the HTTP code returned for type UpdateUploadCreated +const UpdateUploadCreatedCode int = 201 + +/* +UpdateUploadCreated updated upload + +swagger:response updateUploadCreated +*/ +type UpdateUploadCreated struct { + + /* + In: Body + */ + Payload *ghcmessages.Upload `json:"body,omitempty"` +} + +// NewUpdateUploadCreated creates UpdateUploadCreated with default headers values +func NewUpdateUploadCreated() *UpdateUploadCreated { + + return &UpdateUploadCreated{} +} + +// WithPayload adds the payload to the update upload created response +func (o *UpdateUploadCreated) WithPayload(payload *ghcmessages.Upload) *UpdateUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update upload created response +func (o *UpdateUploadCreated) SetPayload(payload *ghcmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateUploadBadRequestCode is the HTTP code returned for type UpdateUploadBadRequest +const UpdateUploadBadRequestCode int = 400 + +/* +UpdateUploadBadRequest invalid request + +swagger:response updateUploadBadRequest +*/ +type UpdateUploadBadRequest struct { +} + +// NewUpdateUploadBadRequest creates UpdateUploadBadRequest with default headers values +func NewUpdateUploadBadRequest() *UpdateUploadBadRequest { + + return &UpdateUploadBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateUploadForbiddenCode is the HTTP code returned for type UpdateUploadForbidden +const UpdateUploadForbiddenCode int = 403 + +/* +UpdateUploadForbidden not authorized + +swagger:response updateUploadForbidden +*/ +type UpdateUploadForbidden struct { +} + +// NewUpdateUploadForbidden creates UpdateUploadForbidden with default headers values +func NewUpdateUploadForbidden() *UpdateUploadForbidden { + + return &UpdateUploadForbidden{} +} + +// WriteResponse to the client +func (o *UpdateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateUploadNotFoundCode is the HTTP code returned for type UpdateUploadNotFound +const UpdateUploadNotFoundCode int = 404 + +/* +UpdateUploadNotFound not found + +swagger:response updateUploadNotFound +*/ +type UpdateUploadNotFound struct { +} + +// NewUpdateUploadNotFound creates UpdateUploadNotFound with default headers values +func NewUpdateUploadNotFound() *UpdateUploadNotFound { + + return &UpdateUploadNotFound{} +} + +// WriteResponse to the client +func (o *UpdateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateUploadRequestEntityTooLargeCode is the HTTP code returned for type UpdateUploadRequestEntityTooLarge +const UpdateUploadRequestEntityTooLargeCode int = 413 + +/* +UpdateUploadRequestEntityTooLarge payload is too large + +swagger:response updateUploadRequestEntityTooLarge +*/ +type UpdateUploadRequestEntityTooLarge struct { +} + +// NewUpdateUploadRequestEntityTooLarge creates UpdateUploadRequestEntityTooLarge with default headers values +func NewUpdateUploadRequestEntityTooLarge() *UpdateUploadRequestEntityTooLarge { + + return &UpdateUploadRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *UpdateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// UpdateUploadInternalServerErrorCode is the HTTP code returned for type UpdateUploadInternalServerError +const UpdateUploadInternalServerErrorCode int = 500 + +/* +UpdateUploadInternalServerError server error + +swagger:response updateUploadInternalServerError +*/ +type UpdateUploadInternalServerError struct { +} + +// NewUpdateUploadInternalServerError creates UpdateUploadInternalServerError with default headers values +func NewUpdateUploadInternalServerError() *UpdateUploadInternalServerError { + + return &UpdateUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go new file mode 100644 index 00000000000..e7df609bf1e --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/uploads/update_upload_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateUploadURL generates an URL for the update upload operation +type UpdateUploadURL struct { + UploadID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateUploadURL) WithBasePath(bp string) *UpdateUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads/{uploadID}/update" + + uploadID := o.UploadID.String() + if uploadID != "" { + _path = strings.Replace(_path, "{uploadID}", uploadID, -1) + } else { + return nil, errors.New("uploadId is required on UpdateUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcapi/server.go b/pkg/gen/ghcapi/server.go new file mode 100644 index 00000000000..7ab2c3d1029 --- /dev/null +++ b/pkg/gen/ghcapi/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/ghcapi/ghcoperations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *ghcoperations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *ghcoperations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *ghcoperations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go b/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go new file mode 100644 index 00000000000..5b34ee2a4bc --- /dev/null +++ b/pkg/gen/ghcmessages/bulk_assignment_move_i_ds.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// BulkAssignmentMoveIDs bulk assignment move i ds +// +// swagger:model BulkAssignmentMoveIDs +type BulkAssignmentMoveIDs []BulkAssignmentMoveID + +// Validate validates this bulk assignment move i ds +func (m BulkAssignmentMoveIDs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this bulk assignment move i ds based on the context it is used +func (m BulkAssignmentMoveIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/bulk_assignment_move_id.go b/pkg/gen/ghcmessages/bulk_assignment_move_id.go new file mode 100644 index 00000000000..505c9541f63 --- /dev/null +++ b/pkg/gen/ghcmessages/bulk_assignment_move_id.go @@ -0,0 +1,39 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// BulkAssignmentMoveID bulk assignment move ID +// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 +// +// swagger:model BulkAssignmentMoveID +type BulkAssignmentMoveID strfmt.UUID + +// Validate validates this bulk assignment move ID +func (m BulkAssignmentMoveID) Validate(formats strfmt.Registry) error { + var res []error + + if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this bulk assignment move ID based on context it is used +func (m BulkAssignmentMoveID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/client_error.go b/pkg/gen/ghcmessages/client_error.go new file mode 100644 index 00000000000..d5b7a412b94 --- /dev/null +++ b/pkg/gen/ghcmessages/client_error.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ClientError client error +// +// swagger:model ClientError +type ClientError struct { + + // detail + // Required: true + Detail *string `json:"detail"` + + // instance + // Required: true + // Format: uuid + Instance *strfmt.UUID `json:"instance"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this client error +func (m *ClientError) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstance(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ClientError) validateDetail(formats strfmt.Registry) error { + + if err := validate.Required("detail", "body", m.Detail); err != nil { + return err + } + + return nil +} + +func (m *ClientError) validateInstance(formats strfmt.Registry) error { + + if err := validate.Required("instance", "body", m.Instance); err != nil { + return err + } + + if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ClientError) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this client error based on context it is used +func (m *ClientError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ClientError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ClientError) UnmarshalBinary(b []byte) error { + var res ClientError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/contractor.go b/pkg/gen/ghcmessages/contractor.go new file mode 100644 index 00000000000..71c37c4c052 --- /dev/null +++ b/pkg/gen/ghcmessages/contractor.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Contractor contractor +// +// swagger:model Contractor +type Contractor struct { + + // contract number + ContractNumber string `json:"contractNumber,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // name + Name string `json:"name,omitempty"` + + // type + Type string `json:"type,omitempty"` +} + +// Validate validates this contractor +func (m *Contractor) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Contractor) 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 +} + +// ContextValidate validates this contractor based on context it is used +func (m *Contractor) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Contractor) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Contractor) UnmarshalBinary(b []byte) error { + var res Contractor + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go new file mode 100644 index 00000000000..d6bed9fac0c --- /dev/null +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CounselingUpdateAllowancePayload counseling update allowance payload +// +// swagger:model CounselingUpdateAllowancePayload +type CounselingUpdateAllowancePayload struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + + // agency + Agency *Affiliation `json:"agency,omitempty"` + + // dependents authorized + DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + GunSafe *bool `json:"gunSafe,omitempty"` + + // only for Army + OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` + + // unit is in lbs + // Example: 2000 + // Maximum: 2000 + // Minimum: 0 + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // unit is in lbs + // Example: 2000 + // Maximum: 500 + // Minimum: 0 + ProGearWeightSpouse *int64 `json:"proGearWeightSpouse,omitempty"` + + // unit is in lbs + // Example: 2000 + // Minimum: 0 + RequiredMedicalEquipmentWeight *int64 `json:"requiredMedicalEquipmentWeight,omitempty"` + + // the number of storage in transit days that the customer is entitled to for a given shipment on their move + // Minimum: 0 + StorageInTransit *int64 `json:"storageInTransit,omitempty"` + + // ub allowance + // Example: 500 + UbAllowance *int64 `json:"ubAllowance,omitempty"` +} + +// Validate validates this counseling update allowance payload +func (m *CounselingUpdateAllowancePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgency(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightSpouse(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredMedicalEquipmentWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageInTransit(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateAgency(formats strfmt.Registry) error { + if swag.IsZero(m.Agency) { // not required + return nil + } + + if m.Agency != nil { + if err := m.Agency.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateProGearWeight(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeight) { // not required + return nil + } + + if err := validate.MinimumInt("proGearWeight", "body", *m.ProGearWeight, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("proGearWeight", "body", *m.ProGearWeight, 2000, false); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateProGearWeightSpouse(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeightSpouse) { // not required + return nil + } + + if err := validate.MinimumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 500, false); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateRequiredMedicalEquipmentWeight(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredMedicalEquipmentWeight) { // not required + return nil + } + + if err := validate.MinimumInt("requiredMedicalEquipmentWeight", "body", *m.RequiredMedicalEquipmentWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) validateStorageInTransit(formats strfmt.Registry) error { + if swag.IsZero(m.StorageInTransit) { // not required + return nil + } + + if err := validate.MinimumInt("storageInTransit", "body", *m.StorageInTransit, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this counseling update allowance payload based on the context it is used +func (m *CounselingUpdateAllowancePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CounselingUpdateAllowancePayload) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { + + if m.Agency != nil { + + if swag.IsZero(m.Agency) { // not required + return nil + } + + if err := m.Agency.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateAllowancePayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CounselingUpdateAllowancePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CounselingUpdateAllowancePayload) UnmarshalBinary(b []byte) error { + var res CounselingUpdateAllowancePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/counseling_update_order_payload.go b/pkg/gen/ghcmessages/counseling_update_order_payload.go new file mode 100644 index 00000000000..a03a99a22de --- /dev/null +++ b/pkg/gen/ghcmessages/counseling_update_order_payload.go @@ -0,0 +1,533 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + "github.com/transcom/mymove/pkg/swagger/nullable" +) + +// CounselingUpdateOrderPayload counseling update order payload +// +// swagger:model CounselingUpdateOrderPayload +type CounselingUpdateOrderPayload struct { + + // department indicator + DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // Orders date + // + // The date and time that these orders were cut. + // Example: 2018-04-26 + // Required: true + // Format: date + IssueDate *strfmt.Date `json:"issueDate"` + + // new duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` + + // NTS SAC + // Example: N002214CSW32Y9 + NtsSac nullable.String `json:"ntsSac,omitempty"` + + // NTS TAC + // Example: F8J1 + NtsTac nullable.String `json:"ntsTac,omitempty"` + + // Orders Number + // Example: 030-00362 + OrdersNumber *string `json:"ordersNumber,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"ordersType"` + + // orders type detail + OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` + + // origin duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + OriginDutyLocationID *strfmt.UUID `json:"originDutyLocationId"` + + // Report-by date + // + // Report By Date + // Example: 2018-04-26 + // Required: true + // Format: date + ReportByDate *strfmt.Date `json:"reportByDate"` + + // HHG SAC + // Example: N002214CSW32Y9 + Sac nullable.String `json:"sac,omitempty"` + + // HHG TAC + // Example: F8J1 + // Max Length: 4 + // Min Length: 4 + Tac *string `json:"tac,omitempty"` +} + +// Validate validates this counseling update order payload +func (m *CounselingUpdateOrderPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNtsSac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNtsTac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTac(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CounselingUpdateOrderPayload) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateIssueDate(formats strfmt.Registry) error { + + if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { + return err + } + + if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateNewDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateNtsSac(formats strfmt.Registry) error { + if swag.IsZero(m.NtsSac) { // not required + return nil + } + + if err := m.NtsSac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsSac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsSac") + } + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateNtsTac(formats strfmt.Registry) error { + if swag.IsZero(m.NtsTac) { // not required + return nil + } + + if err := m.NtsTac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsTac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsTac") + } + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateOrdersTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if m.OrdersTypeDetail != nil { + if err := m.OrdersTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateOriginDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("originDutyLocationId", "body", m.OriginDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateReportByDate(formats strfmt.Registry) error { + + if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { + return err + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateSac(formats strfmt.Registry) error { + if swag.IsZero(m.Sac) { // not required + return nil + } + + if err := m.Sac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sac") + } + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) validateTac(formats strfmt.Registry) error { + if swag.IsZero(m.Tac) { // not required + return nil + } + + if err := validate.MinLength("tac", "body", *m.Tac, 4); err != nil { + return err + } + + if err := validate.MaxLength("tac", "body", *m.Tac, 4); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this counseling update order payload based on the context it is used +func (m *CounselingUpdateOrderPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNtsSac(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNtsTac(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSac(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateNtsSac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.NtsSac) { // not required + return nil + } + + if err := m.NtsSac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsSac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsSac") + } + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateNtsTac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.NtsTac) { // not required + return nil + } + + if err := m.NtsTac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsTac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsTac") + } + return err + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersTypeDetail != nil { + + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +func (m *CounselingUpdateOrderPayload) contextValidateSac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Sac) { // not required + return nil + } + + if err := m.Sac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sac") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CounselingUpdateOrderPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CounselingUpdateOrderPayload) UnmarshalBinary(b []byte) error { + var res CounselingUpdateOrderPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_appeal.go b/pkg/gen/ghcmessages/create_appeal.go new file mode 100644 index 00000000000..7ac06af37b8 --- /dev/null +++ b/pkg/gen/ghcmessages/create_appeal.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateAppeal Appeal status and remarks left for a violation, created by a GSR user. +// +// swagger:model CreateAppeal +type CreateAppeal struct { + + // The status of the appeal set by the GSR user + // Example: These are my violation appeal remarks + // Enum: [sustained rejected] + AppealStatus string `json:"appealStatus,omitempty"` + + // Remarks left by the GSR user + // Example: These are my violation appeal remarks + Remarks string `json:"remarks,omitempty"` +} + +// Validate validates this create appeal +func (m *CreateAppeal) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppealStatus(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var createAppealTypeAppealStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["sustained","rejected"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createAppealTypeAppealStatusPropEnum = append(createAppealTypeAppealStatusPropEnum, v) + } +} + +const ( + + // CreateAppealAppealStatusSustained captures enum value "sustained" + CreateAppealAppealStatusSustained string = "sustained" + + // CreateAppealAppealStatusRejected captures enum value "rejected" + CreateAppealAppealStatusRejected string = "rejected" +) + +// prop value enum +func (m *CreateAppeal) validateAppealStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createAppealTypeAppealStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateAppeal) validateAppealStatus(formats strfmt.Registry) error { + if swag.IsZero(m.AppealStatus) { // not required + return nil + } + + // value enum + if err := m.validateAppealStatusEnum("appealStatus", "body", m.AppealStatus); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create appeal based on context it is used +func (m *CreateAppeal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateAppeal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateAppeal) UnmarshalBinary(b []byte) error { + var res CreateAppeal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go b/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go new file mode 100644 index 00000000000..c69f080a112 --- /dev/null +++ b/pkg/gen/ghcmessages/create_approved_s_i_t_duration_update.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateApprovedSITDurationUpdate create approved s i t duration update +// +// swagger:model CreateApprovedSITDurationUpdate +type CreateApprovedSITDurationUpdate struct { + + // Number of days approved for SIT extension. This will match requested days saved to the SIT extension model. + // Example: 21 + // Required: true + ApprovedDays *int64 `json:"approvedDays"` + + // Remarks from TOO about SIT Duration Update creation + // Example: Customer needs additional storage time as their new place of residence is not yet ready + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // Reason from service counselor-provided picklist for SIT Duration Update + // Example: AWAITING_COMPLETION_OF_RESIDENCE + // Required: true + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason *string `json:"requestReason"` +} + +// Validate validates this create approved s i t duration update +func (m *CreateApprovedSITDurationUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedDays(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateApprovedSITDurationUpdate) validateApprovedDays(formats strfmt.Registry) error { + + if err := validate.Required("approvedDays", "body", m.ApprovedDays); err != nil { + return err + } + + return nil +} + +var createApprovedSITDurationUpdateTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createApprovedSITDurationUpdateTypeRequestReasonPropEnum = append(createApprovedSITDurationUpdateTypeRequestReasonPropEnum, v) + } +} + +const ( + + // CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + CreateApprovedSITDurationUpdateRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // CreateApprovedSITDurationUpdateRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + CreateApprovedSITDurationUpdateRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // CreateApprovedSITDurationUpdateRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + CreateApprovedSITDurationUpdateRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // CreateApprovedSITDurationUpdateRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + CreateApprovedSITDurationUpdateRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // CreateApprovedSITDurationUpdateRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + CreateApprovedSITDurationUpdateRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // CreateApprovedSITDurationUpdateRequestReasonOTHER captures enum value "OTHER" + CreateApprovedSITDurationUpdateRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *CreateApprovedSITDurationUpdate) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createApprovedSITDurationUpdateTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateApprovedSITDurationUpdate) validateRequestReason(formats strfmt.Registry) error { + + if err := validate.Required("requestReason", "body", m.RequestReason); err != nil { + return err + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", *m.RequestReason); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create approved s i t duration update based on context it is used +func (m *CreateApprovedSITDurationUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateApprovedSITDurationUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateApprovedSITDurationUpdate) UnmarshalBinary(b []byte) error { + var res CreateApprovedSITDurationUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_boat_shipment.go b/pkg/gen/ghcmessages/create_boat_shipment.go new file mode 100644 index 00000000000..20a5708a369 --- /dev/null +++ b/pkg/gen/ghcmessages/create_boat_shipment.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateBoatShipment Boat shipment information for the move. +// +// swagger:model CreateBoatShipment +type CreateBoatShipment struct { + + // Does the boat have a trailer + // Required: true + HasTrailer *bool `json:"hasTrailer"` + + // Height of the Boat in inches + // Required: true + HeightInInches *int64 `json:"heightInInches"` + + // Is the trailer roadworthy + IsRoadworthy *bool `json:"isRoadworthy,omitempty"` + + // Length of the Boat in inches + // Required: true + LengthInInches *int64 `json:"lengthInInches"` + + // Make of the Boat + // Required: true + Make *string `json:"make"` + + // Model of the Boat + // Required: true + Model *string `json:"model"` + + // type + // Required: true + // Enum: [HAUL_AWAY TOW_AWAY] + Type *string `json:"type"` + + // Width of the Boat in inches + // Required: true + WidthInInches *int64 `json:"widthInInches"` + + // Year of the Boat + // Required: true + Year *int64 `json:"year"` +} + +// Validate validates this create boat shipment +func (m *CreateBoatShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHasTrailer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHeightInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLengthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMake(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateYear(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateBoatShipment) validateHasTrailer(formats strfmt.Registry) error { + + if err := validate.Required("hasTrailer", "body", m.HasTrailer); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateHeightInInches(formats strfmt.Registry) error { + + if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateLengthInInches(formats strfmt.Registry) error { + + if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateMake(formats strfmt.Registry) error { + + if err := validate.Required("make", "body", m.Make); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + return nil +} + +var createBoatShipmentTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + createBoatShipmentTypeTypePropEnum = append(createBoatShipmentTypeTypePropEnum, v) + } +} + +const ( + + // CreateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" + CreateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" + + // CreateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" + CreateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" +) + +// prop value enum +func (m *CreateBoatShipment) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, createBoatShipmentTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *CreateBoatShipment) validateType(formats strfmt.Registry) error { + + if err := validate.Required("type", "body", m.Type); err != nil { + return err + } + + // value enum + if err := m.validateTypeEnum("type", "body", *m.Type); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateWidthInInches(formats strfmt.Registry) error { + + if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateBoatShipment) validateYear(formats strfmt.Registry) error { + + if err := validate.Required("year", "body", m.Year); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create boat shipment based on context it is used +func (m *CreateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateBoatShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateBoatShipment) UnmarshalBinary(b []byte) error { + var res CreateBoatShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_customer_payload.go b/pkg/gen/ghcmessages/create_customer_payload.go new file mode 100644 index 00000000000..68ece54fb88 --- /dev/null +++ b/pkg/gen/ghcmessages/create_customer_payload.go @@ -0,0 +1,344 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateCustomerPayload create customer payload +// +// swagger:model CreateCustomerPayload +type CreateCustomerPayload struct { + + // affiliation + Affiliation *Affiliation `json:"affiliation,omitempty"` + + // backup contact + BackupContact *BackupContact `json:"backupContact,omitempty"` + + // backup mailing address + BackupMailingAddress struct { + Address + } `json:"backupMailingAddress,omitempty"` + + // cac user + CacUser bool `json:"cacUser,omitempty"` + + // create okta account + CreateOktaAccount bool `json:"createOktaAccount,omitempty"` + + // edipi + // Example: 1234567890 + // Max Length: 10 + Edipi string `json:"edipi,omitempty"` + + // email is preferred + EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` + + // emplid + // Example: 9485155 + // Max Length: 7 + Emplid *string `json:"emplid,omitempty"` + + // first name + // Example: John + FirstName string `json:"firstName,omitempty"` + + // last name + // Example: Doe + LastName string `json:"lastName,omitempty"` + + // middle name + // Example: David + MiddleName *string `json:"middleName,omitempty"` + + // personal email + // Example: personalEmail@email.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail string `json:"personalEmail,omitempty"` + + // phone is preferred + PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` + + // residential address + ResidentialAddress struct { + Address + } `json:"residentialAddress,omitempty"` + + // secondary telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` + + // suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` +} + +// Validate validates this create customer payload +func (m *CreateCustomerPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffiliation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupMailingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmplid(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResidentialAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCustomerPayload) validateAffiliation(formats strfmt.Registry) error { + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if m.Affiliation != nil { + if err := m.Affiliation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *CreateCustomerPayload) validateBackupContact(formats strfmt.Registry) error { + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if m.BackupContact != nil { + if err := m.BackupContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupContact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupContact") + } + return err + } + } + + return nil +} + +func (m *CreateCustomerPayload) validateBackupMailingAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateCustomerPayload) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.Edipi) { // not required + return nil + } + + if err := validate.MaxLength("edipi", "body", m.Edipi, 10); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomerPayload) validateEmplid(formats strfmt.Registry) error { + if swag.IsZero(m.Emplid) { // not required + return nil + } + + if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomerPayload) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personalEmail", "body", m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomerPayload) validateResidentialAddress(formats strfmt.Registry) error { + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateCustomerPayload) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomerPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create customer payload based on the context it is used +func (m *CreateCustomerPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAffiliation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCustomerPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { + + if m.Affiliation != nil { + + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *CreateCustomerPayload) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupContact != nil { + + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupContact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupContact") + } + return err + } + } + + return nil +} + +func (m *CreateCustomerPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateCustomerPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateCustomerPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateCustomerPayload) UnmarshalBinary(b []byte) error { + var res CreateCustomerPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_customer_support_remark.go b/pkg/gen/ghcmessages/create_customer_support_remark.go new file mode 100644 index 00000000000..59a5e99ac4b --- /dev/null +++ b/pkg/gen/ghcmessages/create_customer_support_remark.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateCustomerSupportRemark A text remark written by an customer support user that is associated with a specific move. +// +// swagger:model CreateCustomerSupportRemark +type CreateCustomerSupportRemark struct { + + // content + // Example: This is a remark about a move. + // Required: true + Content *string `json:"content"` + + // office user ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + OfficeUserID *strfmt.UUID `json:"officeUserID"` +} + +// Validate validates this create customer support remark +func (m *CreateCustomerSupportRemark) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateCustomerSupportRemark) validateContent(formats strfmt.Registry) error { + + if err := validate.Required("content", "body", m.Content); err != nil { + return err + } + + return nil +} + +func (m *CreateCustomerSupportRemark) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.Required("officeUserID", "body", m.OfficeUserID); err != nil { + return err + } + + if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create customer support remark based on context it is used +func (m *CreateCustomerSupportRemark) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateCustomerSupportRemark) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateCustomerSupportRemark) UnmarshalBinary(b []byte) error { + var res CreateCustomerSupportRemark + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_evaluation_report.go b/pkg/gen/ghcmessages/create_evaluation_report.go new file mode 100644 index 00000000000..20b8ad439ca --- /dev/null +++ b/pkg/gen/ghcmessages/create_evaluation_report.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateEvaluationReport Minimal set of info needed to create a shipment evaluation report, which is just a shipment ID. +// +// swagger:model CreateEvaluationReport +type CreateEvaluationReport struct { + + // The shipment ID of the shipment to be evaluated in the report + // Example: 01b9671e-b268-4906-967b-ba661a1d3933 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` +} + +// Validate validates this create evaluation report +func (m *CreateEvaluationReport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateEvaluationReport) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create evaluation report based on context it is used +func (m *CreateEvaluationReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateEvaluationReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateEvaluationReport) UnmarshalBinary(b []byte) error { + var res CreateEvaluationReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_m_t_o_shipment.go b/pkg/gen/ghcmessages/create_m_t_o_shipment.go new file mode 100644 index 00000000000..6a6a5924fc5 --- /dev/null +++ b/pkg/gen/ghcmessages/create_m_t_o_shipment.go @@ -0,0 +1,817 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateMTOShipment create m t o shipment +// +// swagger:model CreateMTOShipment +type CreateMTOShipment struct { + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // boat shipment + BoatShipment *CreateBoatShipment `json:"boatShipment,omitempty"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // The customer can use the customer remarks field to inform the services counselor and the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // Customer enters this information during onboarding. Optional field. + // + // Example: handle with care + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // Where the movers should deliver this shipment. + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // has secondary delivery address + HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary delivery address + HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // mobile home shipment + MobileHomeShipment *CreateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` + + // The ID of the move this new shipment is for. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + // mto service items + MtoServiceItems MTOServiceItems `json:"mtoServiceItems,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 2000 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The address where the movers should pick up this shipment. + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *CreatePPMShipment `json:"ppmShipment,omitempty"` + + // The customer's preferred delivery date. + // + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. + // + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // sac type + SacType *LOAType `json:"sacType,omitempty"` + + // Where the movers should deliver this shipment. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // The address where the movers should pick up this shipment. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // service order number + ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` + + // shipment type + // Required: true + ShipmentType *MTOShipmentType `json:"shipmentType"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // tac type + TacType *LOAType `json:"tacType,omitempty"` + + // Where the movers should deliver this shipment. + TertiaryDeliveryAddress struct { + Address + } `json:"tertiaryDeliveryAddress,omitempty"` + + // The address where the movers should pick up this shipment. + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` + + // uses external vendor + // Example: false + UsesExternalVendor *bool `json:"usesExternalVendor,omitempty"` +} + +// Validate validates this create m t o shipment +func (m *CreateMTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateMTOShipment) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *CreateMTOShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateMTOShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateMTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItems) { // not required + return nil + } + + if err := m.MtoServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems") + } + return err + } + + return nil +} + +func (m *CreateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateMTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateMTOShipment) validateSacType(formats strfmt.Registry) error { + if swag.IsZero(m.SacType) { // not required + return nil + } + + if m.SacType != nil { + if err := m.SacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateMTOShipment) validateShipmentType(formats strfmt.Registry) error { + + if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { + return err + } + + if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { + return err + } + + if m.ShipmentType != nil { + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateTacType(formats strfmt.Registry) error { + if swag.IsZero(m.TacType) { // not required + return nil + } + + if m.TacType != nil { + if err := m.TacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *CreateMTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +// ContextValidate validate this create m t o shipment based on the context it is used +func (m *CreateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateMTOShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems") + } + return err + } + + return nil +} + +func (m *CreateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { + + if m.SacType != nil { + + if swag.IsZero(m.SacType) { // not required + return nil + } + + if err := m.SacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if m.ShipmentType != nil { + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { + + if m.TacType != nil { + + if swag.IsZero(m.TacType) { // not required + return nil + } + + if err := m.TacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + } + + return nil +} + +func (m *CreateMTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreateMTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateMTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateMTOShipment) UnmarshalBinary(b []byte) error { + var res CreateMTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_mobile_home_shipment.go b/pkg/gen/ghcmessages/create_mobile_home_shipment.go new file mode 100644 index 00000000000..0f1ecd5a474 --- /dev/null +++ b/pkg/gen/ghcmessages/create_mobile_home_shipment.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateMobileHomeShipment A mobile home shipment that the prime moves for a service member. +// +// swagger:model CreateMobileHomeShipment +type CreateMobileHomeShipment struct { + + // Height of the Mobile Home in inches + // Required: true + HeightInInches *int64 `json:"heightInInches"` + + // Length of the Mobile Home in inches + // Required: true + LengthInInches *int64 `json:"lengthInInches"` + + // Make of the Mobile Home + // Required: true + Make *string `json:"make"` + + // Model of the Mobile Home + // Required: true + Model *string `json:"model"` + + // Width of the Mobile Home in inches + // Required: true + WidthInInches *int64 `json:"widthInInches"` + + // Year of the Mobile Home + // Required: true + Year *int64 `json:"year"` +} + +// Validate validates this create mobile home shipment +func (m *CreateMobileHomeShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeightInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLengthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMake(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateYear(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateMobileHomeShipment) validateHeightInInches(formats strfmt.Registry) error { + + if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateLengthInInches(formats strfmt.Registry) error { + + if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateMake(formats strfmt.Registry) error { + + if err := validate.Required("make", "body", m.Make); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateWidthInInches(formats strfmt.Registry) error { + + if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateYear(formats strfmt.Registry) error { + + if err := validate.Required("year", "body", m.Year); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create mobile home shipment based on context it is used +func (m *CreateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateMobileHomeShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateMobileHomeShipment) UnmarshalBinary(b []byte) error { + var res CreateMobileHomeShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_orders.go b/pkg/gen/ghcmessages/create_orders.go new file mode 100644 index 00000000000..25f77f42c15 --- /dev/null +++ b/pkg/gen/ghcmessages/create_orders.go @@ -0,0 +1,438 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateOrders create orders +// +// swagger:model CreateOrders +type CreateOrders struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // Are dependents included in your orders? + // Required: true + HasDependents *bool `json:"hasDependents"` + + // Orders date + // + // The date and time that these orders were cut. + // Required: true + // Format: date + IssueDate *strfmt.Date `json:"issueDate"` + + // new duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` + + // Orders Number + // Example: 030-00362 + OrdersNumber *string `json:"ordersNumber,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"ordersType"` + + // orders type detail + OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` + + // origin duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OriginDutyLocationID strfmt.UUID `json:"originDutyLocationId,omitempty"` + + // Report-by date + // + // Report By Date + // Required: true + // Format: date + ReportByDate *strfmt.Date `json:"reportByDate"` + + // SAC + // Example: N002214CSW32Y9 + Sac *string `json:"sac,omitempty"` + + // service member Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"serviceMemberId"` + + // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? + // Required: true + SpouseHasProGear *bool `json:"spouseHasProGear"` + + // TAC + // Example: F8J1 + Tac *string `json:"tac,omitempty"` +} + +// Validate validates this create orders +func (m *CreateOrders) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHasDependents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSpouseHasProGear(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateOrders) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) validateHasDependents(formats strfmt.Registry) error { + + if err := validate.Required("hasDependents", "body", m.HasDependents); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateIssueDate(formats strfmt.Registry) error { + + if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { + return err + } + + if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateNewDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) validateOrdersTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if m.OrdersTypeDetail != nil { + if err := m.OrdersTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) validateOriginDutyLocationID(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocationID) { // not required + return nil + } + + if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateReportByDate(formats strfmt.Registry) error { + + if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { + return err + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("serviceMemberId", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("serviceMemberId", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateOrders) validateSpouseHasProGear(formats strfmt.Registry) error { + + if err := validate.Required("spouseHasProGear", "body", m.SpouseHasProGear); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create orders based on the context it is used +func (m *CreateOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateOrders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *CreateOrders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersTypeDetail != nil { + + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateOrders) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateOrders) UnmarshalBinary(b []byte) error { + var res CreateOrders + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/create_p_p_m_shipment.go b/pkg/gen/ghcmessages/create_p_p_m_shipment.go new file mode 100644 index 00000000000..87746177f68 --- /dev/null +++ b/pkg/gen/ghcmessages/create_p_p_m_shipment.go @@ -0,0 +1,404 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePPMShipment A personally procured move is a type of shipment that a service members moves themselves. +// +// swagger:model CreatePPMShipment +type CreatePPMShipment struct { + + // destination address + // Required: true + DestinationAddress struct { + PPMDestinationAddress + } `json:"destinationAddress"` + + // estimated weight + // Example: 4200 + // Required: true + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to move. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // Indicates whether PPM shipment has pro gear. + // + // Required: true + HasProGear *bool `json:"hasProGear"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // pickup address + // Required: true + PickupAddress struct { + Address + } `json:"pickupAddress"` + + // pro gear weight + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // secondary destination address + SecondaryDestinationAddress struct { + Address + } `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // sit estimated departure date + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` + + // sit estimated entry date + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` + + // sit estimated weight + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` + + // sit expected + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // spouse pro gear weight + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` + + // tertiary destination address + TertiaryDestinationAddress struct { + Address + } `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this create p p m shipment +func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHasProGear(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) validateEstimatedWeight(formats strfmt.Registry) error { + + if err := validate.Required("estimatedWeight", "body", m.EstimatedWeight); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateHasProGear(formats strfmt.Registry) error { + + if err := validate.Required("hasProGear", "body", m.HasProGear); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *CreatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *CreatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +// ContextValidate validate this create p p m shipment based on the context it is used +func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *CreatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePPMShipment) UnmarshalBinary(b []byte) error { + var res CreatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/created_customer.go b/pkg/gen/ghcmessages/created_customer.go new file mode 100644 index 00000000000..ec1b6ae0754 --- /dev/null +++ b/pkg/gen/ghcmessages/created_customer.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatedCustomer created customer +// +// swagger:model CreatedCustomer +type CreatedCustomer struct { + + // Branch of service customer is affilated with + Affiliation string `json:"affiliation,omitempty"` + + // backup address + BackupAddress *Address `json:"backupAddress,omitempty"` + + // backup contact + BackupContact *BackupContact `json:"backupContact,omitempty"` + + // cac validated + CacValidated bool `json:"cacValidated,omitempty"` + + // edipi + Edipi *string `json:"edipi,omitempty"` + + // email is preferred + EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` + + // first name + // Example: John + FirstName string `json:"firstName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Doe + LastName string `json:"lastName,omitempty"` + + // middle name + // Example: David + MiddleName *string `json:"middleName,omitempty"` + + // okta email + OktaEmail string `json:"oktaEmail,omitempty"` + + // okta ID + OktaID string `json:"oktaID,omitempty"` + + // personal email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail string `json:"personalEmail,omitempty"` + + // phone is preferred + PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` + + // residential address + ResidentialAddress *Address `json:"residentialAddress,omitempty"` + + // secondary telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` + + // suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // user ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"userID,omitempty"` +} + +// Validate validates this created customer +func (m *CreatedCustomer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResidentialAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatedCustomer) validateBackupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupAddress) { // not required + return nil + } + + if m.BackupAddress != nil { + if err := m.BackupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatedCustomer) validateBackupContact(formats strfmt.Registry) error { + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if m.BackupContact != nil { + if err := m.BackupContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupContact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupContact") + } + return err + } + } + + return nil +} + +func (m *CreatedCustomer) 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 *CreatedCustomer) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personalEmail", "body", m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *CreatedCustomer) validateResidentialAddress(formats strfmt.Registry) error { + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if m.ResidentialAddress != nil { + if err := m.ResidentialAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residentialAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residentialAddress") + } + return err + } + } + + return nil +} + +func (m *CreatedCustomer) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *CreatedCustomer) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *CreatedCustomer) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this created customer based on the context it is used +func (m *CreatedCustomer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBackupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatedCustomer) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupAddress != nil { + + if swag.IsZero(m.BackupAddress) { // not required + return nil + } + + if err := m.BackupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatedCustomer) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupContact != nil { + + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupContact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupContact") + } + return err + } + } + + return nil +} + +func (m *CreatedCustomer) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ResidentialAddress != nil { + + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residentialAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residentialAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreatedCustomer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatedCustomer) UnmarshalBinary(b []byte) error { + var res CreatedCustomer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/customer.go b/pkg/gen/ghcmessages/customer.go new file mode 100644 index 00000000000..c4034e3cfe2 --- /dev/null +++ b/pkg/gen/ghcmessages/customer.go @@ -0,0 +1,351 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Customer customer +// +// swagger:model Customer +type Customer struct { + + // Agency customer is affilated with + Agency string `json:"agency,omitempty"` + + // backup address + BackupAddress *Address `json:"backupAddress,omitempty"` + + // backup contact + BackupContact *BackupContact `json:"backup_contact,omitempty"` + + // cac validated + CacValidated *bool `json:"cacValidated,omitempty"` + + // current address + CurrentAddress *Address `json:"current_address,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // edipi + Edipi string `json:"edipi,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // email is preferred + EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` + + // emplid + Emplid *string `json:"emplid,omitempty"` + + // first name + // Example: John + FirstName string `json:"first_name,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Doe + LastName string `json:"last_name,omitempty"` + + // middle name + // Example: David + MiddleName *string `json:"middle_name,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` + + // phone is preferred + PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` + + // secondary telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ + SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` + + // suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // user ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"userID,omitempty"` +} + +// Validate validates this customer +func (m *Customer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Customer) validateBackupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupAddress) { // not required + return nil + } + + if m.BackupAddress != nil { + if err := m.BackupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupAddress") + } + return err + } + } + + return nil +} + +func (m *Customer) validateBackupContact(formats strfmt.Registry) error { + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if m.BackupContact != nil { + if err := m.BackupContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contact") + } + return err + } + } + + return nil +} + +func (m *Customer) validateCurrentAddress(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentAddress) { // not required + return nil + } + + if m.CurrentAddress != nil { + if err := m.CurrentAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("current_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("current_address") + } + return err + } + } + + return nil +} + +func (m *Customer) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *Customer) 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 *Customer) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *Customer) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$|^$`); err != nil { + return err + } + + return nil +} + +func (m *Customer) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userID", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this customer based on the context it is used +func (m *Customer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBackupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Customer) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupAddress != nil { + + if swag.IsZero(m.BackupAddress) { // not required + return nil + } + + if err := m.BackupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backupAddress") + } + return err + } + } + + return nil +} + +func (m *Customer) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupContact != nil { + + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contact") + } + return err + } + } + + return nil +} + +func (m *Customer) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.CurrentAddress != nil { + + if swag.IsZero(m.CurrentAddress) { // not required + return nil + } + + if err := m.CurrentAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("current_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("current_address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Customer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Customer) UnmarshalBinary(b []byte) error { + var res Customer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/customer_contact_type.go b/pkg/gen/ghcmessages/customer_contact_type.go new file mode 100644 index 00000000000..61fc0f2c4d6 --- /dev/null +++ b/pkg/gen/ghcmessages/customer_contact_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CustomerContactType Describes a customer contact type for a MTOServiceItem of type domestic destination SIT. +// +// swagger:model CustomerContactType +type CustomerContactType string + +func NewCustomerContactType(value CustomerContactType) *CustomerContactType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated CustomerContactType. +func (m CustomerContactType) Pointer() *CustomerContactType { + return &m +} + +const ( + + // CustomerContactTypeFIRST captures enum value "FIRST" + CustomerContactTypeFIRST CustomerContactType = "FIRST" + + // CustomerContactTypeSECOND captures enum value "SECOND" + CustomerContactTypeSECOND CustomerContactType = "SECOND" +) + +// for schema +var customerContactTypeEnum []interface{} + +func init() { + var res []CustomerContactType + if err := json.Unmarshal([]byte(`["FIRST","SECOND"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + customerContactTypeEnum = append(customerContactTypeEnum, v) + } +} + +func (m CustomerContactType) validateCustomerContactTypeEnum(path, location string, value CustomerContactType) error { + if err := validate.EnumCase(path, location, value, customerContactTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this customer contact type +func (m CustomerContactType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateCustomerContactTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this customer contact type based on context it is used +func (m CustomerContactType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/customer_support_remark.go b/pkg/gen/ghcmessages/customer_support_remark.go new file mode 100644 index 00000000000..9c13dbc6ff8 --- /dev/null +++ b/pkg/gen/ghcmessages/customer_support_remark.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CustomerSupportRemark A text remark written by an office user that is associated with a specific move. +// +// swagger:model CustomerSupportRemark +type CustomerSupportRemark struct { + + // content + // Example: This is a remark about a move. + // Required: true + Content *string `json:"content"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // move ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveID *strfmt.UUID `json:"moveID"` + + // office user email + // Read Only: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + OfficeUserEmail string `json:"officeUserEmail,omitempty"` + + // office user first name + // Example: Grace + // Read Only: true + OfficeUserFirstName string `json:"officeUserFirstName,omitempty"` + + // office user ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + OfficeUserID *strfmt.UUID `json:"officeUserID"` + + // office user last name + // Example: Griffin + // Read Only: true + OfficeUserLastName string `json:"officeUserLastName,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this customer support remark +func (m *CustomerSupportRemark) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContent(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CustomerSupportRemark) validateContent(formats strfmt.Registry) error { + + if err := validate.Required("content", "body", m.Content); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("moveID", "body", m.MoveID); err != nil { + return err + } + + if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateOfficeUserEmail(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUserEmail) { // not required + return nil + } + + if err := validate.Pattern("officeUserEmail", "body", m.OfficeUserEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.Required("officeUserID", "body", m.OfficeUserID); err != nil { + return err + } + + if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this customer support remark based on the context it is used +func (m *CustomerSupportRemark) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUserEmail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUserFirstName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUserLastName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CustomerSupportRemark) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) contextValidateOfficeUserEmail(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "officeUserEmail", "body", string(m.OfficeUserEmail)); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) contextValidateOfficeUserFirstName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "officeUserFirstName", "body", string(m.OfficeUserFirstName)); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) contextValidateOfficeUserLastName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "officeUserLastName", "body", string(m.OfficeUserLastName)); err != nil { + return err + } + + return nil +} + +func (m *CustomerSupportRemark) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CustomerSupportRemark) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CustomerSupportRemark) UnmarshalBinary(b []byte) error { + var res CustomerSupportRemark + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/customer_support_remarks.go b/pkg/gen/ghcmessages/customer_support_remarks.go new file mode 100644 index 00000000000..f3668e48223 --- /dev/null +++ b/pkg/gen/ghcmessages/customer_support_remarks.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CustomerSupportRemarks customer support remarks +// +// swagger:model CustomerSupportRemarks +type CustomerSupportRemarks []*CustomerSupportRemark + +// Validate validates this customer support remarks +func (m CustomerSupportRemarks) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this customer support remarks based on the context it is used +func (m CustomerSupportRemarks) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/deny_s_i_t_extension.go b/pkg/gen/ghcmessages/deny_s_i_t_extension.go new file mode 100644 index 00000000000..5737bac551c --- /dev/null +++ b/pkg/gen/ghcmessages/deny_s_i_t_extension.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DenySITExtension deny s i t extension +// +// swagger:model DenySITExtension +type DenySITExtension struct { + + // Whether or not to convert to members expense once SIT extension is denied. + // Example: false + // Required: true + ConvertToCustomerExpense *bool `json:"convertToCustomerExpense"` + + // Remarks from TOO about SIT denial + // Example: Denied this extension as it does not match the criteria + // Required: true + OfficeRemarks *string `json:"officeRemarks"` +} + +// Validate validates this deny s i t extension +func (m *DenySITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConvertToCustomerExpense(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeRemarks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DenySITExtension) validateConvertToCustomerExpense(formats strfmt.Registry) error { + + if err := validate.Required("convertToCustomerExpense", "body", m.ConvertToCustomerExpense); err != nil { + return err + } + + return nil +} + +func (m *DenySITExtension) validateOfficeRemarks(formats strfmt.Registry) error { + + if err := validate.Required("officeRemarks", "body", m.OfficeRemarks); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this deny s i t extension based on context it is used +func (m *DenySITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *DenySITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DenySITExtension) UnmarshalBinary(b []byte) error { + var res DenySITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/department_indicator.go b/pkg/gen/ghcmessages/department_indicator.go new file mode 100644 index 00000000000..0c20239960c --- /dev/null +++ b/pkg/gen/ghcmessages/department_indicator.go @@ -0,0 +1,92 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DepartmentIndicator Department indicator +// +// # Military branch of service indicator for orders +// +// swagger:model DepartmentIndicator +type DepartmentIndicator string + +func NewDepartmentIndicator(value DepartmentIndicator) *DepartmentIndicator { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DepartmentIndicator. +func (m DepartmentIndicator) Pointer() *DepartmentIndicator { + return &m +} + +const ( + + // DepartmentIndicatorARMY captures enum value "ARMY" + DepartmentIndicatorARMY DepartmentIndicator = "ARMY" + + // DepartmentIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" + DepartmentIndicatorARMYCORPSOFENGINEERS DepartmentIndicator = "ARMY_CORPS_OF_ENGINEERS" + + // DepartmentIndicatorCOASTGUARD captures enum value "COAST_GUARD" + DepartmentIndicatorCOASTGUARD DepartmentIndicator = "COAST_GUARD" + + // DepartmentIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + DepartmentIndicatorNAVYANDMARINES DepartmentIndicator = "NAVY_AND_MARINES" + + // DepartmentIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + DepartmentIndicatorAIRANDSPACEFORCE DepartmentIndicator = "AIR_AND_SPACE_FORCE" + + // DepartmentIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" + DepartmentIndicatorOFFICEOFSECRETARYOFDEFENSE DepartmentIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" +) + +// for schema +var departmentIndicatorEnum []interface{} + +func init() { + var res []DepartmentIndicator + if err := json.Unmarshal([]byte(`["ARMY","ARMY_CORPS_OF_ENGINEERS","COAST_GUARD","NAVY_AND_MARINES","AIR_AND_SPACE_FORCE","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + departmentIndicatorEnum = append(departmentIndicatorEnum, v) + } +} + +func (m DepartmentIndicator) validateDepartmentIndicatorEnum(path, location string, value DepartmentIndicator) error { + if err := validate.EnumCase(path, location, value, departmentIndicatorEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this department indicator +func (m DepartmentIndicator) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDepartmentIndicatorEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this department indicator based on context it is used +func (m DepartmentIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/dept_indicator.go b/pkg/gen/ghcmessages/dept_indicator.go new file mode 100644 index 00000000000..25167bade51 --- /dev/null +++ b/pkg/gen/ghcmessages/dept_indicator.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DeptIndicator Dept. indicator +// +// swagger:model DeptIndicator +type DeptIndicator string + +func NewDeptIndicator(value DeptIndicator) *DeptIndicator { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DeptIndicator. +func (m DeptIndicator) Pointer() *DeptIndicator { + return &m +} + +const ( + + // DeptIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + DeptIndicatorNAVYANDMARINES DeptIndicator = "NAVY_AND_MARINES" + + // DeptIndicatorARMY captures enum value "ARMY" + DeptIndicatorARMY DeptIndicator = "ARMY" + + // DeptIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" + DeptIndicatorARMYCORPSOFENGINEERS DeptIndicator = "ARMY_CORPS_OF_ENGINEERS" + + // DeptIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + DeptIndicatorAIRANDSPACEFORCE DeptIndicator = "AIR_AND_SPACE_FORCE" + + // DeptIndicatorCOASTGUARD captures enum value "COAST_GUARD" + DeptIndicatorCOASTGUARD DeptIndicator = "COAST_GUARD" + + // DeptIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" + DeptIndicatorOFFICEOFSECRETARYOFDEFENSE DeptIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" +) + +// for schema +var deptIndicatorEnum []interface{} + +func init() { + var res []DeptIndicator + if err := json.Unmarshal([]byte(`["NAVY_AND_MARINES","ARMY","ARMY_CORPS_OF_ENGINEERS","AIR_AND_SPACE_FORCE","COAST_GUARD","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deptIndicatorEnum = append(deptIndicatorEnum, v) + } +} + +func (m DeptIndicator) validateDeptIndicatorEnum(path, location string, value DeptIndicator) error { + if err := validate.EnumCase(path, location, value, deptIndicatorEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this dept indicator +func (m DeptIndicator) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDeptIndicatorEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this dept indicator based on context it is used +func (m DeptIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/destination_type.go b/pkg/gen/ghcmessages/destination_type.go new file mode 100644 index 00000000000..b36b646a7c4 --- /dev/null +++ b/pkg/gen/ghcmessages/destination_type.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DestinationType Destination Type +// Example: OTHER_THAN_AUTHORIZED +// +// swagger:model DestinationType +type DestinationType string + +func NewDestinationType(value DestinationType) *DestinationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DestinationType. +func (m DestinationType) Pointer() *DestinationType { + return &m +} + +const ( + + // DestinationTypeHOMEOFRECORD captures enum value "HOME_OF_RECORD" + DestinationTypeHOMEOFRECORD DestinationType = "HOME_OF_RECORD" + + // DestinationTypeHOMEOFSELECTION captures enum value "HOME_OF_SELECTION" + DestinationTypeHOMEOFSELECTION DestinationType = "HOME_OF_SELECTION" + + // DestinationTypePLACEENTEREDACTIVEDUTY captures enum value "PLACE_ENTERED_ACTIVE_DUTY" + DestinationTypePLACEENTEREDACTIVEDUTY DestinationType = "PLACE_ENTERED_ACTIVE_DUTY" + + // DestinationTypeOTHERTHANAUTHORIZED captures enum value "OTHER_THAN_AUTHORIZED" + DestinationTypeOTHERTHANAUTHORIZED DestinationType = "OTHER_THAN_AUTHORIZED" +) + +// for schema +var destinationTypeEnum []interface{} + +func init() { + var res []DestinationType + if err := json.Unmarshal([]byte(`["HOME_OF_RECORD","HOME_OF_SELECTION","PLACE_ENTERED_ACTIVE_DUTY","OTHER_THAN_AUTHORIZED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + destinationTypeEnum = append(destinationTypeEnum, v) + } +} + +func (m DestinationType) validateDestinationTypeEnum(path, location string, value DestinationType) error { + if err := validate.EnumCase(path, location, value, destinationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this destination type +func (m DestinationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDestinationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this destination type based on context it is used +func (m DestinationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/dimension_type.go b/pkg/gen/ghcmessages/dimension_type.go new file mode 100644 index 00000000000..ebef7ab615c --- /dev/null +++ b/pkg/gen/ghcmessages/dimension_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DimensionType Describes a dimension type for a MTOServiceItemDimension. +// +// swagger:model DimensionType +type DimensionType string + +func NewDimensionType(value DimensionType) *DimensionType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DimensionType. +func (m DimensionType) Pointer() *DimensionType { + return &m +} + +const ( + + // DimensionTypeITEM captures enum value "ITEM" + DimensionTypeITEM DimensionType = "ITEM" + + // DimensionTypeCRATE captures enum value "CRATE" + DimensionTypeCRATE DimensionType = "CRATE" +) + +// for schema +var dimensionTypeEnum []interface{} + +func init() { + var res []DimensionType + if err := json.Unmarshal([]byte(`["ITEM","CRATE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + dimensionTypeEnum = append(dimensionTypeEnum, v) + } +} + +func (m DimensionType) validateDimensionTypeEnum(path, location string, value DimensionType) error { + if err := validate.EnumCase(path, location, value, dimensionTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this dimension type +func (m DimensionType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDimensionTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this dimension type based on context it is used +func (m DimensionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/document.go b/pkg/gen/ghcmessages/document.go new file mode 100644 index 00000000000..9b67058b6aa --- /dev/null +++ b/pkg/gen/ghcmessages/document.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Document document +// +// swagger:model Document +type Document struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // The service member this document belongs to + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"service_member_id"` + + // uploads + // Required: true + Uploads []*Upload `json:"uploads"` +} + +// Validate validates this document +func (m *Document) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Document) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Document) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Document) validateUploads(formats strfmt.Registry) error { + + if err := validate.Required("uploads", "body", m.Uploads); err != nil { + return err + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this document based on the context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Document) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Document) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Document) UnmarshalBinary(b []byte) error { + var res Document + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/duty_location.go b/pkg/gen/ghcmessages/duty_location.go new file mode 100644 index 00000000000..7eacde86380 --- /dev/null +++ b/pkg/gen/ghcmessages/duty_location.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DutyLocation duty location +// +// swagger:model DutyLocation +type DutyLocation struct { + + // address + Address *Address `json:"address,omitempty"` + + // address id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + AddressID strfmt.UUID `json:"address_id,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // name + // Example: Fort Bragg North Station + Name string `json:"name,omitempty"` +} + +// Validate validates this duty location +func (m *DutyLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAddressID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocation) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *DutyLocation) validateAddressID(formats strfmt.Registry) error { + if swag.IsZero(m.AddressID) { // not required + return nil + } + + if err := validate.FormatOf("address_id", "body", "uuid", m.AddressID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocation) 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 +} + +// ContextValidate validate this duty location based on the context it is used +func (m *DutyLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocation) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DutyLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DutyLocation) UnmarshalBinary(b []byte) error { + var res DutyLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go new file mode 100644 index 00000000000..2ee15f3d03a --- /dev/null +++ b/pkg/gen/ghcmessages/entitlements.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Entitlements entitlements +// +// swagger:model Entitlements +type Entitlements struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + + // authorized weight + // Example: 2000 + AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` + + // dependents authorized + // Example: true + DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // gun safe + // Example: false + GunSafe bool `json:"gunSafe,omitempty"` + + // id + // Example: 571008b1-b0de-454d-b843-d71be9f02c04 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // non temporary storage + // Example: false + NonTemporaryStorage *bool `json:"nonTemporaryStorage,omitempty"` + + // organizational clothing and individual equipment + // Example: true + OrganizationalClothingAndIndividualEquipment bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` + + // privately owned vehicle + // Example: false + PrivatelyOwnedVehicle *bool `json:"privatelyOwnedVehicle,omitempty"` + + // pro gear weight + // Example: 2000 + ProGearWeight int64 `json:"proGearWeight,omitempty"` + + // pro gear weight spouse + // Example: 500 + ProGearWeightSpouse int64 `json:"proGearWeightSpouse,omitempty"` + + // required medical equipment weight + // Example: 500 + RequiredMedicalEquipmentWeight int64 `json:"requiredMedicalEquipmentWeight,omitempty"` + + // storage in transit + // Example: 90 + StorageInTransit *int64 `json:"storageInTransit,omitempty"` + + // total dependents + // Example: 2 + TotalDependents int64 `json:"totalDependents,omitempty"` + + // total weight + // Example: 500 + TotalWeight int64 `json:"totalWeight,omitempty"` + + // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. + // Example: 3 + UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` +} + +// Validate validates this entitlements +func (m *Entitlements) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Entitlements) 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 +} + +// ContextValidate validates this entitlements based on context it is used +func (m *Entitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Entitlements) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Entitlements) UnmarshalBinary(b []byte) error { + var res Entitlements + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/error.go b/pkg/gen/ghcmessages/error.go new file mode 100644 index 00000000000..d28746cc200 --- /dev/null +++ b/pkg/gen/ghcmessages/error.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // message + // Required: true + Message *string `json:"message"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMessage(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateMessage(formats strfmt.Registry) error { + + if err := validate.Required("message", "body", m.Message); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report.go b/pkg/gen/ghcmessages/evaluation_report.go new file mode 100644 index 00000000000..89713d04013 --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report.go @@ -0,0 +1,794 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EvaluationReport An evaluation report +// +// swagger:model EvaluationReport +type EvaluationReport struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // eval end + // Example: 18:00 + // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ + EvalEnd *string `json:"evalEnd,omitempty"` + + // eval start + // Example: 15:00 + // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ + EvalStart *string `json:"evalStart,omitempty"` + + // gsr appeals + GsrAppeals GSRAppeals `json:"gsrAppeals,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // inspection date + // Format: date + InspectionDate *strfmt.Date `json:"inspectionDate,omitempty"` + + // inspection type + InspectionType *EvaluationReportInspectionType `json:"inspectionType,omitempty"` + + // location + Location *EvaluationReportLocation `json:"location,omitempty"` + + // location description + // Example: Route 66 at crash inspection site 3 + LocationDescription *string `json:"locationDescription,omitempty"` + + // move ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveID strfmt.UUID `json:"moveID,omitempty"` + + // move reference ID + // Read Only: true + MoveReferenceID *string `json:"moveReferenceID,omitempty"` + + // observed claims response date + // Format: date + ObservedClaimsResponseDate *strfmt.Date `json:"observedClaimsResponseDate,omitempty"` + + // observed delivery date + // Format: date + ObservedDeliveryDate *strfmt.Date `json:"observedDeliveryDate,omitempty"` + + // observed pickup date + // Format: date + ObservedPickupDate *strfmt.Date `json:"observedPickupDate,omitempty"` + + // observed pickup spread end date + // Format: date + ObservedPickupSpreadEndDate *strfmt.Date `json:"observedPickupSpreadEndDate,omitempty"` + + // observed pickup spread start date + // Format: date + ObservedPickupSpreadStartDate *strfmt.Date `json:"observedPickupSpreadStartDate,omitempty"` + + // observed shipment delivery date + // Format: date + ObservedShipmentDeliveryDate *strfmt.Date `json:"observedShipmentDeliveryDate,omitempty"` + + // observed shipment physical pickup date + // Format: date + ObservedShipmentPhysicalPickupDate *strfmt.Date `json:"observedShipmentPhysicalPickupDate,omitempty"` + + // office user + OfficeUser *EvaluationReportOfficeUser `json:"officeUser,omitempty"` + + // remarks + Remarks *string `json:"remarks,omitempty"` + + // report violations + ReportViolations ReportViolations `json:"reportViolations,omitempty"` + + // serious incident + SeriousIncident *bool `json:"seriousIncident,omitempty"` + + // serious incident desc + SeriousIncidentDesc *string `json:"seriousIncidentDesc,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ShipmentID *strfmt.UUID `json:"shipmentID,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` + + // time depart + // Example: 14:30 + // Pattern: ^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$ + TimeDepart *string `json:"timeDepart,omitempty"` + + // type + Type EvaluationReportType `json:"type,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // violations observed + ViolationsObserved *bool `json:"violationsObserved,omitempty"` +} + +// Validate validates this evaluation report +func (m *EvaluationReport) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEvalEnd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEvalStart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGsrAppeals(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInspectionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInspectionType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedClaimsResponseDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedPickupSpreadEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedPickupSpreadStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedShipmentDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObservedShipmentPhysicalPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportViolations(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeDepart(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EvaluationReport) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateEvalEnd(formats strfmt.Registry) error { + if swag.IsZero(m.EvalEnd) { // not required + return nil + } + + if err := validate.Pattern("evalEnd", "body", *m.EvalEnd, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateEvalStart(formats strfmt.Registry) error { + if swag.IsZero(m.EvalStart) { // not required + return nil + } + + if err := validate.Pattern("evalStart", "body", *m.EvalStart, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateGsrAppeals(formats strfmt.Registry) error { + if swag.IsZero(m.GsrAppeals) { // not required + return nil + } + + if err := m.GsrAppeals.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gsrAppeals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gsrAppeals") + } + return err + } + + return nil +} + +func (m *EvaluationReport) 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 *EvaluationReport) validateInspectionDate(formats strfmt.Registry) error { + if swag.IsZero(m.InspectionDate) { // not required + return nil + } + + if err := validate.FormatOf("inspectionDate", "body", "date", m.InspectionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateInspectionType(formats strfmt.Registry) error { + if swag.IsZero(m.InspectionType) { // not required + return nil + } + + if m.InspectionType != nil { + if err := m.InspectionType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("inspectionType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("inspectionType") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) validateLocation(formats strfmt.Registry) error { + if swag.IsZero(m.Location) { // not required + return nil + } + + if m.Location != nil { + if err := m.Location.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) validateMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveID) { // not required + return nil + } + + if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedClaimsResponseDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedClaimsResponseDate) { // not required + return nil + } + + if err := validate.FormatOf("observedClaimsResponseDate", "body", "date", m.ObservedClaimsResponseDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("observedDeliveryDate", "body", "date", m.ObservedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("observedPickupDate", "body", "date", m.ObservedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedPickupSpreadEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedPickupSpreadEndDate) { // not required + return nil + } + + if err := validate.FormatOf("observedPickupSpreadEndDate", "body", "date", m.ObservedPickupSpreadEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedPickupSpreadStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedPickupSpreadStartDate) { // not required + return nil + } + + if err := validate.FormatOf("observedPickupSpreadStartDate", "body", "date", m.ObservedPickupSpreadStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedShipmentDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedShipmentDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("observedShipmentDeliveryDate", "body", "date", m.ObservedShipmentDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateObservedShipmentPhysicalPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ObservedShipmentPhysicalPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("observedShipmentPhysicalPickupDate", "body", "date", m.ObservedShipmentPhysicalPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateOfficeUser(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if m.OfficeUser != nil { + if err := m.OfficeUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("officeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("officeUser") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) validateReportViolations(formats strfmt.Registry) error { + if swag.IsZero(m.ReportViolations) { // not required + return nil + } + + if err := m.ReportViolations.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reportViolations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reportViolations") + } + return err + } + + return nil +} + +func (m *EvaluationReport) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateTimeDepart(formats strfmt.Registry) error { + if swag.IsZero(m.TimeDepart) { // not required + return nil + } + + if err := validate.Pattern("timeDepart", "body", *m.TimeDepart, `^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$`); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +func (m *EvaluationReport) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this evaluation report based on the context it is used +func (m *EvaluationReport) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGsrAppeals(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateInspectionType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveReferenceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReportViolations(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EvaluationReport) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateGsrAppeals(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GsrAppeals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gsrAppeals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gsrAppeals") + } + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateInspectionType(ctx context.Context, formats strfmt.Registry) error { + + if m.InspectionType != nil { + + if swag.IsZero(m.InspectionType) { // not required + return nil + } + + if err := m.InspectionType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("inspectionType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("inspectionType") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) contextValidateLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.Location != nil { + + if swag.IsZero(m.Location) { // not required + return nil + } + + if err := m.Location.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("location") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveID", "body", strfmt.UUID(m.MoveID)); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateMoveReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveReferenceID", "body", m.MoveReferenceID); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { + + if m.OfficeUser != nil { + + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("officeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("officeUser") + } + return err + } + } + + return nil +} + +func (m *EvaluationReport) contextValidateReportViolations(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ReportViolations.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reportViolations") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reportViolations") + } + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", m.ShipmentID); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +func (m *EvaluationReport) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *EvaluationReport) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EvaluationReport) UnmarshalBinary(b []byte) error { + var res EvaluationReport + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report_inspection_type.go b/pkg/gen/ghcmessages/evaluation_report_inspection_type.go new file mode 100644 index 00000000000..d538d76c6eb --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report_inspection_type.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// EvaluationReportInspectionType evaluation report inspection type +// +// swagger:model EvaluationReportInspectionType +type EvaluationReportInspectionType string + +func NewEvaluationReportInspectionType(value EvaluationReportInspectionType) *EvaluationReportInspectionType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated EvaluationReportInspectionType. +func (m EvaluationReportInspectionType) Pointer() *EvaluationReportInspectionType { + return &m +} + +const ( + + // EvaluationReportInspectionTypeDATAREVIEW captures enum value "DATA_REVIEW" + EvaluationReportInspectionTypeDATAREVIEW EvaluationReportInspectionType = "DATA_REVIEW" + + // EvaluationReportInspectionTypePHYSICAL captures enum value "PHYSICAL" + EvaluationReportInspectionTypePHYSICAL EvaluationReportInspectionType = "PHYSICAL" + + // EvaluationReportInspectionTypeVIRTUAL captures enum value "VIRTUAL" + EvaluationReportInspectionTypeVIRTUAL EvaluationReportInspectionType = "VIRTUAL" +) + +// for schema +var evaluationReportInspectionTypeEnum []interface{} + +func init() { + var res []EvaluationReportInspectionType + if err := json.Unmarshal([]byte(`["DATA_REVIEW","PHYSICAL","VIRTUAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + evaluationReportInspectionTypeEnum = append(evaluationReportInspectionTypeEnum, v) + } +} + +func (m EvaluationReportInspectionType) validateEvaluationReportInspectionTypeEnum(path, location string, value EvaluationReportInspectionType) error { + if err := validate.EnumCase(path, location, value, evaluationReportInspectionTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this evaluation report inspection type +func (m EvaluationReportInspectionType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateEvaluationReportInspectionTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this evaluation report inspection type based on context it is used +func (m EvaluationReportInspectionType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report_list.go b/pkg/gen/ghcmessages/evaluation_report_list.go new file mode 100644 index 00000000000..92c522e2ae8 --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report_list.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// EvaluationReportList evaluation report list +// +// swagger:model EvaluationReportList +type EvaluationReportList []*EvaluationReport + +// Validate validates this evaluation report list +func (m EvaluationReportList) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this evaluation report list based on the context it is used +func (m EvaluationReportList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report_location.go b/pkg/gen/ghcmessages/evaluation_report_location.go new file mode 100644 index 00000000000..558b8762a33 --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report_location.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// EvaluationReportLocation evaluation report location +// +// swagger:model EvaluationReportLocation +type EvaluationReportLocation string + +func NewEvaluationReportLocation(value EvaluationReportLocation) *EvaluationReportLocation { + return &value +} + +// Pointer returns a pointer to a freshly-allocated EvaluationReportLocation. +func (m EvaluationReportLocation) Pointer() *EvaluationReportLocation { + return &m +} + +const ( + + // EvaluationReportLocationORIGIN captures enum value "ORIGIN" + EvaluationReportLocationORIGIN EvaluationReportLocation = "ORIGIN" + + // EvaluationReportLocationDESTINATION captures enum value "DESTINATION" + EvaluationReportLocationDESTINATION EvaluationReportLocation = "DESTINATION" + + // EvaluationReportLocationOTHER captures enum value "OTHER" + EvaluationReportLocationOTHER EvaluationReportLocation = "OTHER" +) + +// for schema +var evaluationReportLocationEnum []interface{} + +func init() { + var res []EvaluationReportLocation + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + evaluationReportLocationEnum = append(evaluationReportLocationEnum, v) + } +} + +func (m EvaluationReportLocation) validateEvaluationReportLocationEnum(path, location string, value EvaluationReportLocation) error { + if err := validate.EnumCase(path, location, value, evaluationReportLocationEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this evaluation report location +func (m EvaluationReportLocation) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateEvaluationReportLocationEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this evaluation report location based on context it is used +func (m EvaluationReportLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report_office_user.go b/pkg/gen/ghcmessages/evaluation_report_office_user.go new file mode 100644 index 00000000000..d492debd9cb --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report_office_user.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// EvaluationReportOfficeUser The authoring office user for an evaluation report +// +// swagger:model EvaluationReportOfficeUser +type EvaluationReportOfficeUser struct { + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email string `json:"email,omitempty"` + + // first name + FirstName string `json:"firstName,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone string `json:"phone,omitempty"` +} + +// Validate validates this evaluation report office user +func (m *EvaluationReportOfficeUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *EvaluationReportOfficeUser) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *EvaluationReportOfficeUser) 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 *EvaluationReportOfficeUser) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this evaluation report office user based on the context it is used +func (m *EvaluationReportOfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *EvaluationReportOfficeUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *EvaluationReportOfficeUser) UnmarshalBinary(b []byte) error { + var res EvaluationReportOfficeUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/evaluation_report_type.go b/pkg/gen/ghcmessages/evaluation_report_type.go new file mode 100644 index 00000000000..e899d3e45b4 --- /dev/null +++ b/pkg/gen/ghcmessages/evaluation_report_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// EvaluationReportType evaluation report type +// +// swagger:model EvaluationReportType +type EvaluationReportType string + +func NewEvaluationReportType(value EvaluationReportType) *EvaluationReportType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated EvaluationReportType. +func (m EvaluationReportType) Pointer() *EvaluationReportType { + return &m +} + +const ( + + // EvaluationReportTypeSHIPMENT captures enum value "SHIPMENT" + EvaluationReportTypeSHIPMENT EvaluationReportType = "SHIPMENT" + + // EvaluationReportTypeCOUNSELING captures enum value "COUNSELING" + EvaluationReportTypeCOUNSELING EvaluationReportType = "COUNSELING" +) + +// for schema +var evaluationReportTypeEnum []interface{} + +func init() { + var res []EvaluationReportType + if err := json.Unmarshal([]byte(`["SHIPMENT","COUNSELING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + evaluationReportTypeEnum = append(evaluationReportTypeEnum, v) + } +} + +func (m EvaluationReportType) validateEvaluationReportTypeEnum(path, location string, value EvaluationReportType) error { + if err := validate.EnumCase(path, location, value, evaluationReportTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this evaluation report type +func (m EvaluationReportType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateEvaluationReportTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this evaluation report type based on context it is used +func (m EvaluationReportType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go b/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go new file mode 100644 index 00000000000..bd5033bcd36 --- /dev/null +++ b/pkg/gen/ghcmessages/fetch_line_of_accounting_payload.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FetchLineOfAccountingPayload fetch line of accounting payload +// +// swagger:model FetchLineOfAccountingPayload +type FetchLineOfAccountingPayload struct { + + // department indicator + DepartmentIndicator *DepartmentIndicator `json:"departmentIndicator,omitempty"` + + // The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. Effective date is used to find "Active" TGET data by searching for the TACs and LOAs with begin and end dates containing this date. The 'Effective Date' is the date that can be either the orders issued date (For HHG shipments), MTO approval date (For NTS shipments), or even the current date for NTS shipments with no approval yet (Just providing a preview to the office users per customer request). + // + // Example: 2023-01-01 + // Format: date + EffectiveDate strfmt.Date `json:"effectiveDate,omitempty"` + + // tac code + // Example: F8J1 + // Max Length: 4 + // Min Length: 4 + TacCode string `json:"tacCode,omitempty"` +} + +// Validate validates this fetch line of accounting payload +func (m *FetchLineOfAccountingPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEffectiveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FetchLineOfAccountingPayload) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *FetchLineOfAccountingPayload) validateEffectiveDate(formats strfmt.Registry) error { + if swag.IsZero(m.EffectiveDate) { // not required + return nil + } + + if err := validate.FormatOf("effectiveDate", "body", "date", m.EffectiveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *FetchLineOfAccountingPayload) validateTacCode(formats strfmt.Registry) error { + if swag.IsZero(m.TacCode) { // not required + return nil + } + + if err := validate.MinLength("tacCode", "body", m.TacCode, 4); err != nil { + return err + } + + if err := validate.MaxLength("tacCode", "body", m.TacCode, 4); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this fetch line of accounting payload based on the context it is used +func (m *FetchLineOfAccountingPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FetchLineOfAccountingPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *FetchLineOfAccountingPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FetchLineOfAccountingPayload) UnmarshalBinary(b []byte) error { + var res FetchLineOfAccountingPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/g_b_l_o_c.go b/pkg/gen/ghcmessages/g_b_l_o_c.go new file mode 100644 index 00000000000..e256ccad14b --- /dev/null +++ b/pkg/gen/ghcmessages/g_b_l_o_c.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// GBLOC g b l o c +// +// swagger:model GBLOC +type GBLOC string + +func NewGBLOC(value GBLOC) *GBLOC { + return &value +} + +// Pointer returns a pointer to a freshly-allocated GBLOC. +func (m GBLOC) Pointer() *GBLOC { + return &m +} + +const ( + + // GBLOCAGFM captures enum value "AGFM" + GBLOCAGFM GBLOC = "AGFM" + + // GBLOCAPAT captures enum value "APAT" + GBLOCAPAT GBLOC = "APAT" + + // GBLOCBGAC captures enum value "BGAC" + GBLOCBGAC GBLOC = "BGAC" + + // GBLOCBGNC captures enum value "BGNC" + GBLOCBGNC GBLOC = "BGNC" + + // GBLOCBKAS captures enum value "BKAS" + GBLOCBKAS GBLOC = "BKAS" + + // GBLOCCFMQ captures enum value "CFMQ" + GBLOCCFMQ GBLOC = "CFMQ" + + // GBLOCCLPK captures enum value "CLPK" + GBLOCCLPK GBLOC = "CLPK" + + // GBLOCCNNQ captures enum value "CNNQ" + GBLOCCNNQ GBLOC = "CNNQ" + + // GBLOCDMAT captures enum value "DMAT" + GBLOCDMAT GBLOC = "DMAT" + + // GBLOCGSAT captures enum value "GSAT" + GBLOCGSAT GBLOC = "GSAT" + + // GBLOCHAFC captures enum value "HAFC" + GBLOCHAFC GBLOC = "HAFC" + + // GBLOCHBAT captures enum value "HBAT" + GBLOCHBAT GBLOC = "HBAT" + + // GBLOCJEAT captures enum value "JEAT" + GBLOCJEAT GBLOC = "JEAT" + + // GBLOCJENQ captures enum value "JENQ" + GBLOCJENQ GBLOC = "JENQ" + + // GBLOCKKFA captures enum value "KKFA" + GBLOCKKFA GBLOC = "KKFA" + + // GBLOCLHNQ captures enum value "LHNQ" + GBLOCLHNQ GBLOC = "LHNQ" + + // GBLOCLKNQ captures enum value "LKNQ" + GBLOCLKNQ GBLOC = "LKNQ" + + // GBLOCMAPK captures enum value "MAPK" + GBLOCMAPK GBLOC = "MAPK" + + // GBLOCMAPS captures enum value "MAPS" + GBLOCMAPS GBLOC = "MAPS" + + // GBLOCMBFL captures enum value "MBFL" + GBLOCMBFL GBLOC = "MBFL" + + // GBLOCMLNQ captures enum value "MLNQ" + GBLOCMLNQ GBLOC = "MLNQ" + + // GBLOCXXXX captures enum value "XXXX" + GBLOCXXXX GBLOC = "XXXX" +) + +// for schema +var gBLOCEnum []interface{} + +func init() { + var res []GBLOC + if err := json.Unmarshal([]byte(`["AGFM","APAT","BGAC","BGNC","BKAS","CFMQ","CLPK","CNNQ","DMAT","GSAT","HAFC","HBAT","JEAT","JENQ","KKFA","LHNQ","LKNQ","MAPK","MAPS","MBFL","MLNQ","XXXX"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + gBLOCEnum = append(gBLOCEnum, v) + } +} + +func (m GBLOC) validateGBLOCEnum(path, location string, value GBLOC) error { + if err := validate.EnumCase(path, location, value, gBLOCEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this g b l o c +func (m GBLOC) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateGBLOCEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this g b l o c based on context it is used +func (m GBLOC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/g_b_l_o_cs.go b/pkg/gen/ghcmessages/g_b_l_o_cs.go new file mode 100644 index 00000000000..55c15e4d533 --- /dev/null +++ b/pkg/gen/ghcmessages/g_b_l_o_cs.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// GBLOCs g b l o cs +// +// swagger:model GBLOCs +type GBLOCs []string + +// Validate validates this g b l o cs +func (m GBLOCs) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this g b l o cs based on context it is used +func (m GBLOCs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/g_s_r_appeal.go b/pkg/gen/ghcmessages/g_s_r_appeal.go new file mode 100644 index 00000000000..011ba6a0e2b --- /dev/null +++ b/pkg/gen/ghcmessages/g_s_r_appeal.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// GSRAppeal An object associating appeals on violations and serious incidents +// +// swagger:model GSRAppeal +type GSRAppeal struct { + + // appeal status + AppealStatus GSRAppealStatusType `json:"appealStatus,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is serious incident + // Example: false + IsSeriousIncident bool `json:"isSeriousIncident,omitempty"` + + // office user + OfficeUser *EvaluationReportOfficeUser `json:"officeUser,omitempty"` + + // office user ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + OfficeUserID strfmt.UUID `json:"officeUserID,omitempty"` + + // remarks + // Example: Office user remarks + Remarks string `json:"remarks,omitempty"` + + // report ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ReportID strfmt.UUID `json:"reportID,omitempty"` + + // violation ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ViolationID strfmt.UUID `json:"violationID,omitempty"` +} + +// Validate validates this g s r appeal +func (m *GSRAppeal) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppealStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateViolationID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GSRAppeal) validateAppealStatus(formats strfmt.Registry) error { + if swag.IsZero(m.AppealStatus) { // not required + return nil + } + + if err := m.AppealStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appealStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("appealStatus") + } + return err + } + + return nil +} + +func (m *GSRAppeal) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *GSRAppeal) 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 *GSRAppeal) validateOfficeUser(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if m.OfficeUser != nil { + if err := m.OfficeUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("officeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("officeUser") + } + return err + } + } + + return nil +} + +func (m *GSRAppeal) validateOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("officeUserID", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *GSRAppeal) validateReportID(formats strfmt.Registry) error { + if swag.IsZero(m.ReportID) { // not required + return nil + } + + if err := validate.FormatOf("reportID", "body", "uuid", m.ReportID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *GSRAppeal) validateViolationID(formats strfmt.Registry) error { + if swag.IsZero(m.ViolationID) { // not required + return nil + } + + if err := validate.FormatOf("violationID", "body", "uuid", m.ViolationID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this g s r appeal based on the context it is used +func (m *GSRAppeal) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAppealStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUser(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *GSRAppeal) contextValidateAppealStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.AppealStatus) { // not required + return nil + } + + if err := m.AppealStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("appealStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("appealStatus") + } + return err + } + + return nil +} + +func (m *GSRAppeal) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *GSRAppeal) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { + + if m.OfficeUser != nil { + + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("officeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("officeUser") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *GSRAppeal) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *GSRAppeal) UnmarshalBinary(b []byte) error { + var res GSRAppeal + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go b/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go new file mode 100644 index 00000000000..6008623fb2b --- /dev/null +++ b/pkg/gen/ghcmessages/g_s_r_appeal_status_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// GSRAppealStatusType g s r appeal status type +// +// swagger:model GSRAppealStatusType +type GSRAppealStatusType string + +func NewGSRAppealStatusType(value GSRAppealStatusType) *GSRAppealStatusType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated GSRAppealStatusType. +func (m GSRAppealStatusType) Pointer() *GSRAppealStatusType { + return &m +} + +const ( + + // GSRAppealStatusTypeSUSTAINED captures enum value "SUSTAINED" + GSRAppealStatusTypeSUSTAINED GSRAppealStatusType = "SUSTAINED" + + // GSRAppealStatusTypeREJECTED captures enum value "REJECTED" + GSRAppealStatusTypeREJECTED GSRAppealStatusType = "REJECTED" +) + +// for schema +var gSRAppealStatusTypeEnum []interface{} + +func init() { + var res []GSRAppealStatusType + if err := json.Unmarshal([]byte(`["SUSTAINED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + gSRAppealStatusTypeEnum = append(gSRAppealStatusTypeEnum, v) + } +} + +func (m GSRAppealStatusType) validateGSRAppealStatusTypeEnum(path, location string, value GSRAppealStatusType) error { + if err := validate.EnumCase(path, location, value, gSRAppealStatusTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this g s r appeal status type +func (m GSRAppealStatusType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateGSRAppealStatusTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this g s r appeal status type based on context it is used +func (m GSRAppealStatusType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/g_s_r_appeals.go b/pkg/gen/ghcmessages/g_s_r_appeals.go new file mode 100644 index 00000000000..d3bd71bf41e --- /dev/null +++ b/pkg/gen/ghcmessages/g_s_r_appeals.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// GSRAppeals g s r appeals +// +// swagger:model GSRAppeals +type GSRAppeals []*GSRAppeal + +// Validate validates this g s r appeals +func (m GSRAppeals) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this g s r appeals based on the context it is used +func (m GSRAppeals) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/grade.go b/pkg/gen/ghcmessages/grade.go new file mode 100644 index 00000000000..866e582be14 --- /dev/null +++ b/pkg/gen/ghcmessages/grade.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Grade grade +// +// swagger:model Grade +type Grade string + +func NewGrade(value Grade) *Grade { + return &value +} + +// Pointer returns a pointer to a freshly-allocated Grade. +func (m Grade) Pointer() *Grade { + return &m +} + +const ( + + // GradeE1 captures enum value "E_1" + GradeE1 Grade = "E_1" + + // GradeE2 captures enum value "E_2" + GradeE2 Grade = "E_2" + + // GradeE3 captures enum value "E_3" + GradeE3 Grade = "E_3" + + // GradeE4 captures enum value "E_4" + GradeE4 Grade = "E_4" + + // GradeE5 captures enum value "E_5" + GradeE5 Grade = "E_5" + + // GradeE6 captures enum value "E_6" + GradeE6 Grade = "E_6" + + // GradeE7 captures enum value "E_7" + GradeE7 Grade = "E_7" + + // GradeE8 captures enum value "E_8" + GradeE8 Grade = "E_8" + + // GradeE9 captures enum value "E_9" + GradeE9 Grade = "E_9" + + // GradeE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" + GradeE9SPECIALSENIORENLISTED Grade = "E_9_SPECIAL_SENIOR_ENLISTED" + + // GradeO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" + GradeO1ACADEMYGRADUATE Grade = "O_1_ACADEMY_GRADUATE" + + // GradeO2 captures enum value "O_2" + GradeO2 Grade = "O_2" + + // GradeO3 captures enum value "O_3" + GradeO3 Grade = "O_3" + + // GradeO4 captures enum value "O_4" + GradeO4 Grade = "O_4" + + // GradeO5 captures enum value "O_5" + GradeO5 Grade = "O_5" + + // GradeO6 captures enum value "O_6" + GradeO6 Grade = "O_6" + + // GradeO7 captures enum value "O_7" + GradeO7 Grade = "O_7" + + // GradeO8 captures enum value "O_8" + GradeO8 Grade = "O_8" + + // GradeO9 captures enum value "O_9" + GradeO9 Grade = "O_9" + + // GradeO10 captures enum value "O_10" + GradeO10 Grade = "O_10" + + // GradeW1 captures enum value "W_1" + GradeW1 Grade = "W_1" + + // GradeW2 captures enum value "W_2" + GradeW2 Grade = "W_2" + + // GradeW3 captures enum value "W_3" + GradeW3 Grade = "W_3" + + // GradeW4 captures enum value "W_4" + GradeW4 Grade = "W_4" + + // GradeW5 captures enum value "W_5" + GradeW5 Grade = "W_5" + + // GradeAVIATIONCADET captures enum value "AVIATION_CADET" + GradeAVIATIONCADET Grade = "AVIATION_CADET" + + // GradeCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" + GradeCIVILIANEMPLOYEE Grade = "CIVILIAN_EMPLOYEE" + + // GradeACADEMYCADET captures enum value "ACADEMY_CADET" + GradeACADEMYCADET Grade = "ACADEMY_CADET" + + // GradeMIDSHIPMAN captures enum value "MIDSHIPMAN" + GradeMIDSHIPMAN Grade = "MIDSHIPMAN" +) + +// for schema +var gradeEnum []interface{} + +func init() { + var res []Grade + if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + gradeEnum = append(gradeEnum, v) + } +} + +func (m Grade) validateGradeEnum(path, location string, value Grade) error { + if err := validate.EnumCase(path, location, value, gradeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this grade +func (m Grade) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateGradeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this grade based on context it is used +func (m Grade) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/invalid_request_response_payload.go b/pkg/gen/ghcmessages/invalid_request_response_payload.go new file mode 100644 index 00000000000..2c80bbabbf7 --- /dev/null +++ b/pkg/gen/ghcmessages/invalid_request_response_payload.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvalidRequestResponsePayload invalid request response payload +// +// swagger:model InvalidRequestResponsePayload +type InvalidRequestResponsePayload struct { + + // errors + Errors map[string]string `json:"errors,omitempty"` +} + +// Validate validates this invalid request response payload +func (m *InvalidRequestResponsePayload) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this invalid request response payload based on context it is used +func (m *InvalidRequestResponsePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvalidRequestResponsePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvalidRequestResponsePayload) UnmarshalBinary(b []byte) error { + var res InvalidRequestResponsePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go b/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go new file mode 100644 index 00000000000..46f40a747e0 --- /dev/null +++ b/pkg/gen/ghcmessages/is_date_weekend_holiday_info.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IsDateWeekendHolidayInfo is date weekend holiday info +// +// swagger:model IsDateWeekendHolidayInfo +type IsDateWeekendHolidayInfo struct { + + // country code + // Required: true + CountryCode *string `json:"country_code"` + + // country name + // Required: true + CountryName *string `json:"country_name"` + + // date + // Example: 2018-09-25 + // Required: true + // Format: date + Date *strfmt.Date `json:"date"` + + // details + Details string `json:"details,omitempty"` + + // is holiday + // Required: true + IsHoliday *bool `json:"is_holiday"` + + // is weekend + // Required: true + IsWeekend *bool `json:"is_weekend"` +} + +// Validate validates this is date weekend holiday info +func (m *IsDateWeekendHolidayInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCountryCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountryName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsHoliday(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsWeekend(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateCountryCode(formats strfmt.Registry) error { + + if err := validate.Required("country_code", "body", m.CountryCode); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateCountryName(formats strfmt.Registry) error { + + if err := validate.Required("country_name", "body", m.CountryName); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateIsHoliday(formats strfmt.Registry) error { + + if err := validate.Required("is_holiday", "body", m.IsHoliday); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateIsWeekend(formats strfmt.Registry) error { + + if err := validate.Required("is_weekend", "body", m.IsWeekend); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this is date weekend holiday info based on context it is used +func (m *IsDateWeekendHolidayInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IsDateWeekendHolidayInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IsDateWeekendHolidayInfo) UnmarshalBinary(b []byte) error { + var res IsDateWeekendHolidayInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/l_o_a_type.go b/pkg/gen/ghcmessages/l_o_a_type.go new file mode 100644 index 00000000000..f0e681ebe35 --- /dev/null +++ b/pkg/gen/ghcmessages/l_o_a_type.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// LOAType The Line of accounting (TAC/SAC) type that will be used for the shipment +// Example: HHG +// +// swagger:model LOAType +type LOAType string + +func NewLOAType(value LOAType) *LOAType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated LOAType. +func (m LOAType) Pointer() *LOAType { + return &m +} + +const ( + + // LOATypeHHG captures enum value "HHG" + LOATypeHHG LOAType = "HHG" + + // LOATypeNTS captures enum value "NTS" + LOATypeNTS LOAType = "NTS" +) + +// for schema +var lOATypeEnum []interface{} + +func init() { + var res []LOAType + if err := json.Unmarshal([]byte(`["HHG","NTS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + lOATypeEnum = append(lOATypeEnum, v) + } +} + +func (m LOAType) validateLOATypeEnum(path, location string, value LOAType) error { + if err := validate.EnumCase(path, location, value, lOATypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this l o a type +func (m LOAType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateLOATypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this l o a type based on context it is used +func (m LOAType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/line_of_accounting.go b/pkg/gen/ghcmessages/line_of_accounting.go new file mode 100644 index 00000000000..e2906cde749 --- /dev/null +++ b/pkg/gen/ghcmessages/line_of_accounting.go @@ -0,0 +1,1232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LineOfAccounting line of accounting +// +// swagger:model LineOfAccounting +type LineOfAccounting struct { + + // created at + // Example: 2023-08-03T19:17:10.050Z + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // id + // Example: 06254fc3-b763-484c-b555-42855d1ad5cd + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // loa actvty ID + // Max Length: 11 + LoaActvtyID *string `json:"loaActvtyID,omitempty"` + + // loa agnc acntng cd + // Max Length: 6 + LoaAgncAcntngCd *string `json:"loaAgncAcntngCd,omitempty"` + + // loa agnc dsbr cd + // Max Length: 6 + LoaAgncDsbrCd *string `json:"loaAgncDsbrCd,omitempty"` + + // loa allt sn ID + // Example: 123A + // Max Length: 5 + LoaAlltSnID *string `json:"loaAlltSnID,omitempty"` + + // loa baf ID + // Example: 1234 + // Max Length: 4 + LoaBafID *string `json:"loaBafID,omitempty"` + + // loa bdgt acnt cls nm + // Example: 000000 + // Max Length: 8 + LoaBdgtAcntClsNm *string `json:"loaBdgtAcntClsNm,omitempty"` + + // loa bet cd + // Max Length: 4 + LoaBetCd *string `json:"loaBetCd,omitempty"` + + // loa bg fy tx + // Example: 2006 + LoaBgFyTx *int64 `json:"loaBgFyTx,omitempty"` + + // loa bgn dt + // Example: 2005-10-01 + // Format: date + LoaBgnDt *strfmt.Date `json:"loaBgnDt,omitempty"` + + // loa bgt ln itm ID + // Max Length: 8 + LoaBgtLnItmID *string `json:"loaBgtLnItmID,omitempty"` + + // loa bgt rstr cd + // Max Length: 1 + LoaBgtRstrCd *string `json:"loaBgtRstrCd,omitempty"` + + // loa bgt sub act cd + // Max Length: 4 + LoaBgtSubActCd *string `json:"loaBgtSubActCd,omitempty"` + + // loa cls ref ID + // Max Length: 2 + LoaClsRefID *string `json:"loaClsRefID,omitempty"` + + // loa cst cd + // Max Length: 16 + LoaCstCd *string `json:"loaCstCd,omitempty"` + + // loa cst cntr ID + // Max Length: 16 + LoaCstCntrID *string `json:"loaCstCntrID,omitempty"` + + // loa cust nm + // Max Length: 6 + LoaCustNm *string `json:"loaCustNm,omitempty"` + + // loa df agncy alctn rcpnt ID + // Max Length: 4 + LoaDfAgncyAlctnRcpntID *string `json:"loaDfAgncyAlctnRcpntID,omitempty"` + + // loa doc ID + // Example: HHG12345678900 + // Max Length: 15 + LoaDocID *string `json:"loaDocID,omitempty"` + + // loa dpt ID + // Example: 1 + // Max Length: 2 + LoaDptID *string `json:"loaDptID,omitempty"` + + // loa dsc tx + // Example: PERSONAL PROPERTY - PARANORMAL ACTIVITY DIVISION (OTHER) + LoaDscTx *string `json:"loaDscTx,omitempty"` + + // loa dtl rmbsmt src ID + // Max Length: 3 + LoaDtlRmbsmtSrcID *string `json:"loaDtlRmbsmtSrcID,omitempty"` + + // loa end dt + // Example: 2015-10-01 + // Format: date + LoaEndDt *strfmt.Date `json:"loaEndDt,omitempty"` + + // loa end fy tx + // Example: 2016 + LoaEndFyTx *int64 `json:"loaEndFyTx,omitempty"` + + // loa fms trnsactn ID + // Max Length: 12 + LoaFmsTrnsactnID *string `json:"loaFmsTrnsactnID,omitempty"` + + // loa fncl ar ID + // Max Length: 6 + LoaFnclArID *string `json:"loaFnclArID,omitempty"` + + // loa fnct prs nm + // Max Length: 255 + LoaFnctPrsNm *string `json:"loaFnctPrsNm,omitempty"` + + // loa fnd cntr ID + // Max Length: 12 + LoaFndCntrID *string `json:"loaFndCntrID,omitempty"` + + // loa fnd ty fg cd + // Max Length: 1 + LoaFndTyFgCd *string `json:"loaFndTyFgCd,omitempty"` + + // loa hist stat cd + // Max Length: 1 + LoaHistStatCd *string `json:"loaHistStatCd,omitempty"` + + // loa hs gds cd + // Example: HT + // Max Length: 2 + LoaHsGdsCd *string `json:"loaHsGdsCd,omitempty"` + + // loa instl acntg act ID + // Example: 12345 + // Max Length: 6 + LoaInstlAcntgActID *string `json:"loaInstlAcntgActID,omitempty"` + + // loa jb ord nm + // Max Length: 10 + LoaJbOrdNm *string `json:"loaJbOrdNm,omitempty"` + + // loa lcl instl ID + // Max Length: 18 + LoaLclInstlID *string `json:"loaLclInstlID,omitempty"` + + // loa maj clm nm + // Max Length: 4 + LoaMajClmNm *string `json:"loaMajClmNm,omitempty"` + + // loa maj rmbsmt src ID + // Max Length: 1 + LoaMajRmbsmtSrcID *string `json:"loaMajRmbsmtSrcID,omitempty"` + + // loa obj cls ID + // Example: 22NL + // Max Length: 6 + LoaObjClsID *string `json:"loaObjClsID,omitempty"` + + // loa op agncy ID + // Example: 1A + // Max Length: 4 + LoaOpAgncyID *string `json:"loaOpAgncyID,omitempty"` + + // loa pgm elmnt ID + // Example: 00000000 + // Max Length: 12 + LoaPgmElmntID *string `json:"loaPgmElmntID,omitempty"` + + // loa prj ID + // Max Length: 12 + LoaPrjID *string `json:"loaPrjID,omitempty"` + + // loa sbaltmt rcpnt ID + // Max Length: 1 + LoaSbaltmtRcpntID *string `json:"loaSbaltmtRcpntID,omitempty"` + + // loa scrty coop cust cd + // Max Length: 2 + LoaScrtyCoopCustCd *string `json:"loaScrtyCoopCustCd,omitempty"` + + // loa scrty coop dsgntr cd + // Max Length: 4 + LoaScrtyCoopDsgntrCd *string `json:"loaScrtyCoopDsgntrCd,omitempty"` + + // loa scrty coop impl agnc cd + // Max Length: 1 + LoaScrtyCoopImplAgncCd *string `json:"loaScrtyCoopImplAgncCd,omitempty"` + + // loa scrty coop ln itm ID + // Max Length: 3 + LoaScrtyCoopLnItmID *string `json:"loaScrtyCoopLnItmID,omitempty"` + + // loa spcl intr ID + // Max Length: 2 + LoaSpclIntrID *string `json:"loaSpclIntrID,omitempty"` + + // loa srv src ID + // Max Length: 1 + LoaSrvSrcID *string `json:"loaSrvSrcID,omitempty"` + + // loa stat cd + // Example: U + // Max Length: 1 + LoaStatCd *string `json:"loaStatCd,omitempty"` + + // loa sub acnt ID + // Max Length: 3 + LoaSubAcntID *string `json:"loaSubAcntID,omitempty"` + + // loa sys Id + // Example: 10003 + // Max Length: 20 + LoaSysID *string `json:"loaSysId,omitempty"` + + // loa tnsfr dpt nm + // Max Length: 4 + LoaTnsfrDptNm *string `json:"loaTnsfrDptNm,omitempty"` + + // loa trnsn ID + // Example: B1 + // Max Length: 3 + LoaTrnsnID *string `json:"loaTrnsnID,omitempty"` + + // loa trsy sfx tx + // Example: 0000 + // Max Length: 4 + LoaTrsySfxTx *string `json:"loaTrsySfxTx,omitempty"` + + // loa tsk bdgt sbln tx + // Max Length: 8 + LoaTskBdgtSblnTx *string `json:"loaTskBdgtSblnTx,omitempty"` + + // loa uic + // Max Length: 6 + LoaUic *string `json:"loaUic,omitempty"` + + // loa wk cntr rcpnt nm + // Max Length: 6 + LoaWkCntrRcpntNm *string `json:"loaWkCntrRcpntNm,omitempty"` + + // loa wrk ord ID + // Max Length: 16 + LoaWrkOrdID *string `json:"loaWrkOrdID,omitempty"` + + // org grp dfas cd + // Example: ZZ + // Max Length: 2 + OrgGrpDfasCd *string `json:"orgGrpDfasCd,omitempty"` + + // updated at + // Example: 2023-08-03T19:17:38.776Z + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // valid hhg program code for loa + ValidHhgProgramCodeForLoa *bool `json:"validHhgProgramCodeForLoa,omitempty"` + + // valid loa for tac + ValidLoaForTac *bool `json:"validLoaForTac,omitempty"` +} + +// Validate validates this line of accounting +func (m *LineOfAccounting) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaActvtyID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaAgncAcntngCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaAgncDsbrCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaAlltSnID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBafID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBdgtAcntClsNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBetCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBgnDt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBgtLnItmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBgtRstrCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaBgtSubActCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaClsRefID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaCstCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaCstCntrID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaCustNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaDfAgncyAlctnRcpntID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaDocID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaDptID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaDtlRmbsmtSrcID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaEndDt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaFmsTrnsactnID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaFnclArID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaFnctPrsNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaFndCntrID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaFndTyFgCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaHistStatCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaHsGdsCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaInstlAcntgActID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaJbOrdNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaLclInstlID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaMajClmNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaMajRmbsmtSrcID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaObjClsID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaOpAgncyID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaPgmElmntID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaPrjID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaSbaltmtRcpntID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaScrtyCoopCustCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaScrtyCoopDsgntrCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaScrtyCoopImplAgncCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaScrtyCoopLnItmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaSpclIntrID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaSrvSrcID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaStatCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaSubAcntID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaSysID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaTnsfrDptNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaTrnsnID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaTrsySfxTx(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaTskBdgtSblnTx(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaUic(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaWkCntrRcpntNm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLoaWrkOrdID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrgGrpDfasCd(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LineOfAccounting) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) 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 *LineOfAccounting) validateLoaActvtyID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaActvtyID) { // not required + return nil + } + + if err := validate.MaxLength("loaActvtyID", "body", *m.LoaActvtyID, 11); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaAgncAcntngCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaAgncAcntngCd) { // not required + return nil + } + + if err := validate.MaxLength("loaAgncAcntngCd", "body", *m.LoaAgncAcntngCd, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaAgncDsbrCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaAgncDsbrCd) { // not required + return nil + } + + if err := validate.MaxLength("loaAgncDsbrCd", "body", *m.LoaAgncDsbrCd, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaAlltSnID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaAlltSnID) { // not required + return nil + } + + if err := validate.MaxLength("loaAlltSnID", "body", *m.LoaAlltSnID, 5); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBafID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBafID) { // not required + return nil + } + + if err := validate.MaxLength("loaBafID", "body", *m.LoaBafID, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBdgtAcntClsNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBdgtAcntClsNm) { // not required + return nil + } + + if err := validate.MaxLength("loaBdgtAcntClsNm", "body", *m.LoaBdgtAcntClsNm, 8); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBetCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBetCd) { // not required + return nil + } + + if err := validate.MaxLength("loaBetCd", "body", *m.LoaBetCd, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBgnDt(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBgnDt) { // not required + return nil + } + + if err := validate.FormatOf("loaBgnDt", "body", "date", m.LoaBgnDt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBgtLnItmID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBgtLnItmID) { // not required + return nil + } + + if err := validate.MaxLength("loaBgtLnItmID", "body", *m.LoaBgtLnItmID, 8); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBgtRstrCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBgtRstrCd) { // not required + return nil + } + + if err := validate.MaxLength("loaBgtRstrCd", "body", *m.LoaBgtRstrCd, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaBgtSubActCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaBgtSubActCd) { // not required + return nil + } + + if err := validate.MaxLength("loaBgtSubActCd", "body", *m.LoaBgtSubActCd, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaClsRefID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaClsRefID) { // not required + return nil + } + + if err := validate.MaxLength("loaClsRefID", "body", *m.LoaClsRefID, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaCstCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaCstCd) { // not required + return nil + } + + if err := validate.MaxLength("loaCstCd", "body", *m.LoaCstCd, 16); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaCstCntrID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaCstCntrID) { // not required + return nil + } + + if err := validate.MaxLength("loaCstCntrID", "body", *m.LoaCstCntrID, 16); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaCustNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaCustNm) { // not required + return nil + } + + if err := validate.MaxLength("loaCustNm", "body", *m.LoaCustNm, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaDfAgncyAlctnRcpntID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaDfAgncyAlctnRcpntID) { // not required + return nil + } + + if err := validate.MaxLength("loaDfAgncyAlctnRcpntID", "body", *m.LoaDfAgncyAlctnRcpntID, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaDocID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaDocID) { // not required + return nil + } + + if err := validate.MaxLength("loaDocID", "body", *m.LoaDocID, 15); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaDptID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaDptID) { // not required + return nil + } + + if err := validate.MaxLength("loaDptID", "body", *m.LoaDptID, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaDtlRmbsmtSrcID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaDtlRmbsmtSrcID) { // not required + return nil + } + + if err := validate.MaxLength("loaDtlRmbsmtSrcID", "body", *m.LoaDtlRmbsmtSrcID, 3); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaEndDt(formats strfmt.Registry) error { + if swag.IsZero(m.LoaEndDt) { // not required + return nil + } + + if err := validate.FormatOf("loaEndDt", "body", "date", m.LoaEndDt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaFmsTrnsactnID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaFmsTrnsactnID) { // not required + return nil + } + + if err := validate.MaxLength("loaFmsTrnsactnID", "body", *m.LoaFmsTrnsactnID, 12); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaFnclArID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaFnclArID) { // not required + return nil + } + + if err := validate.MaxLength("loaFnclArID", "body", *m.LoaFnclArID, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaFnctPrsNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaFnctPrsNm) { // not required + return nil + } + + if err := validate.MaxLength("loaFnctPrsNm", "body", *m.LoaFnctPrsNm, 255); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaFndCntrID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaFndCntrID) { // not required + return nil + } + + if err := validate.MaxLength("loaFndCntrID", "body", *m.LoaFndCntrID, 12); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaFndTyFgCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaFndTyFgCd) { // not required + return nil + } + + if err := validate.MaxLength("loaFndTyFgCd", "body", *m.LoaFndTyFgCd, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaHistStatCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaHistStatCd) { // not required + return nil + } + + if err := validate.MaxLength("loaHistStatCd", "body", *m.LoaHistStatCd, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaHsGdsCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaHsGdsCd) { // not required + return nil + } + + if err := validate.MaxLength("loaHsGdsCd", "body", *m.LoaHsGdsCd, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaInstlAcntgActID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaInstlAcntgActID) { // not required + return nil + } + + if err := validate.MaxLength("loaInstlAcntgActID", "body", *m.LoaInstlAcntgActID, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaJbOrdNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaJbOrdNm) { // not required + return nil + } + + if err := validate.MaxLength("loaJbOrdNm", "body", *m.LoaJbOrdNm, 10); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaLclInstlID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaLclInstlID) { // not required + return nil + } + + if err := validate.MaxLength("loaLclInstlID", "body", *m.LoaLclInstlID, 18); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaMajClmNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaMajClmNm) { // not required + return nil + } + + if err := validate.MaxLength("loaMajClmNm", "body", *m.LoaMajClmNm, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaMajRmbsmtSrcID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaMajRmbsmtSrcID) { // not required + return nil + } + + if err := validate.MaxLength("loaMajRmbsmtSrcID", "body", *m.LoaMajRmbsmtSrcID, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaObjClsID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaObjClsID) { // not required + return nil + } + + if err := validate.MaxLength("loaObjClsID", "body", *m.LoaObjClsID, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaOpAgncyID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaOpAgncyID) { // not required + return nil + } + + if err := validate.MaxLength("loaOpAgncyID", "body", *m.LoaOpAgncyID, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaPgmElmntID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaPgmElmntID) { // not required + return nil + } + + if err := validate.MaxLength("loaPgmElmntID", "body", *m.LoaPgmElmntID, 12); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaPrjID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaPrjID) { // not required + return nil + } + + if err := validate.MaxLength("loaPrjID", "body", *m.LoaPrjID, 12); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaSbaltmtRcpntID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaSbaltmtRcpntID) { // not required + return nil + } + + if err := validate.MaxLength("loaSbaltmtRcpntID", "body", *m.LoaSbaltmtRcpntID, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaScrtyCoopCustCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaScrtyCoopCustCd) { // not required + return nil + } + + if err := validate.MaxLength("loaScrtyCoopCustCd", "body", *m.LoaScrtyCoopCustCd, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaScrtyCoopDsgntrCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaScrtyCoopDsgntrCd) { // not required + return nil + } + + if err := validate.MaxLength("loaScrtyCoopDsgntrCd", "body", *m.LoaScrtyCoopDsgntrCd, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaScrtyCoopImplAgncCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaScrtyCoopImplAgncCd) { // not required + return nil + } + + if err := validate.MaxLength("loaScrtyCoopImplAgncCd", "body", *m.LoaScrtyCoopImplAgncCd, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaScrtyCoopLnItmID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaScrtyCoopLnItmID) { // not required + return nil + } + + if err := validate.MaxLength("loaScrtyCoopLnItmID", "body", *m.LoaScrtyCoopLnItmID, 3); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaSpclIntrID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaSpclIntrID) { // not required + return nil + } + + if err := validate.MaxLength("loaSpclIntrID", "body", *m.LoaSpclIntrID, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaSrvSrcID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaSrvSrcID) { // not required + return nil + } + + if err := validate.MaxLength("loaSrvSrcID", "body", *m.LoaSrvSrcID, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaStatCd(formats strfmt.Registry) error { + if swag.IsZero(m.LoaStatCd) { // not required + return nil + } + + if err := validate.MaxLength("loaStatCd", "body", *m.LoaStatCd, 1); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaSubAcntID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaSubAcntID) { // not required + return nil + } + + if err := validate.MaxLength("loaSubAcntID", "body", *m.LoaSubAcntID, 3); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaSysID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaSysID) { // not required + return nil + } + + if err := validate.MaxLength("loaSysId", "body", *m.LoaSysID, 20); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaTnsfrDptNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaTnsfrDptNm) { // not required + return nil + } + + if err := validate.MaxLength("loaTnsfrDptNm", "body", *m.LoaTnsfrDptNm, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaTrnsnID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaTrnsnID) { // not required + return nil + } + + if err := validate.MaxLength("loaTrnsnID", "body", *m.LoaTrnsnID, 3); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaTrsySfxTx(formats strfmt.Registry) error { + if swag.IsZero(m.LoaTrsySfxTx) { // not required + return nil + } + + if err := validate.MaxLength("loaTrsySfxTx", "body", *m.LoaTrsySfxTx, 4); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaTskBdgtSblnTx(formats strfmt.Registry) error { + if swag.IsZero(m.LoaTskBdgtSblnTx) { // not required + return nil + } + + if err := validate.MaxLength("loaTskBdgtSblnTx", "body", *m.LoaTskBdgtSblnTx, 8); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaUic(formats strfmt.Registry) error { + if swag.IsZero(m.LoaUic) { // not required + return nil + } + + if err := validate.MaxLength("loaUic", "body", *m.LoaUic, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaWkCntrRcpntNm(formats strfmt.Registry) error { + if swag.IsZero(m.LoaWkCntrRcpntNm) { // not required + return nil + } + + if err := validate.MaxLength("loaWkCntrRcpntNm", "body", *m.LoaWkCntrRcpntNm, 6); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateLoaWrkOrdID(formats strfmt.Registry) error { + if swag.IsZero(m.LoaWrkOrdID) { // not required + return nil + } + + if err := validate.MaxLength("loaWrkOrdID", "body", *m.LoaWrkOrdID, 16); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateOrgGrpDfasCd(formats strfmt.Registry) error { + if swag.IsZero(m.OrgGrpDfasCd) { // not required + return nil + } + + if err := validate.MaxLength("orgGrpDfasCd", "body", *m.OrgGrpDfasCd, 2); err != nil { + return err + } + + return nil +} + +func (m *LineOfAccounting) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this line of accounting based on context it is used +func (m *LineOfAccounting) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *LineOfAccounting) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LineOfAccounting) UnmarshalBinary(b []byte) error { + var res LineOfAccounting + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/list_prime_move.go b/pkg/gen/ghcmessages/list_prime_move.go new file mode 100644 index 00000000000..690f8097816 --- /dev/null +++ b/pkg/gen/ghcmessages/list_prime_move.go @@ -0,0 +1,338 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListPrimeMove An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently. +// +// swagger:model ListPrimeMove +type ListPrimeMove struct { + + // approved at + // Read Only: true + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination g b l o c + // Example: AGFM + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + // destination postal code + // Example: 90210 + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // order type + OrderType string `json:"orderType,omitempty"` + + // ppm type + // Enum: [FULL PARTIAL] + PpmType string `json:"ppmType,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this list prime move +func (m *ListPrimeMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListPrimeMove) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) 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 *ListPrimeMove) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +var listPrimeMoveTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listPrimeMoveTypePpmTypePropEnum = append(listPrimeMoveTypePpmTypePropEnum, v) + } +} + +const ( + + // ListPrimeMovePpmTypeFULL captures enum value "FULL" + ListPrimeMovePpmTypeFULL string = "FULL" + + // ListPrimeMovePpmTypePARTIAL captures enum value "PARTIAL" + ListPrimeMovePpmTypePARTIAL string = "PARTIAL" +) + +// prop value enum +func (m *ListPrimeMove) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listPrimeMoveTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ListPrimeMove) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this list prime move based on the context it is used +func (m *ListPrimeMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApprovedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListPrimeMove) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *ListPrimeMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListPrimeMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListPrimeMove) UnmarshalBinary(b []byte) error { + var res ListPrimeMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/list_prime_moves.go b/pkg/gen/ghcmessages/list_prime_moves.go new file mode 100644 index 00000000000..d0197077d8e --- /dev/null +++ b/pkg/gen/ghcmessages/list_prime_moves.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListPrimeMoves list prime moves +// +// swagger:model ListPrimeMoves +type ListPrimeMoves []*ListPrimeMove + +// Validate validates this list prime moves +func (m ListPrimeMoves) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this list prime moves based on the context it is used +func (m ListPrimeMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/list_prime_moves_result.go b/pkg/gen/ghcmessages/list_prime_moves_result.go new file mode 100644 index 00000000000..4c024dec513 --- /dev/null +++ b/pkg/gen/ghcmessages/list_prime_moves_result.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListPrimeMovesResult list prime moves result +// +// swagger:model ListPrimeMovesResult +type ListPrimeMovesResult struct { + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // queue moves + QueueMoves ListPrimeMoves `json:"queueMoves,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this list prime moves result +func (m *ListPrimeMovesResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQueueMoves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListPrimeMovesResult) validateQueueMoves(formats strfmt.Registry) error { + if swag.IsZero(m.QueueMoves) { // not required + return nil + } + + if err := m.QueueMoves.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queueMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queueMoves") + } + return err + } + + return nil +} + +// ContextValidate validate this list prime moves result based on the context it is used +func (m *ListPrimeMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateQueueMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListPrimeMovesResult) contextValidateQueueMoves(ctx context.Context, formats strfmt.Registry) error { + + if err := m.QueueMoves.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queueMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queueMoves") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListPrimeMovesResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListPrimeMovesResult) UnmarshalBinary(b []byte) error { + var res ListPrimeMovesResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/location.go b/pkg/gen/ghcmessages/location.go new file mode 100644 index 00000000000..cfe5a0e0f4e --- /dev/null +++ b/pkg/gen/ghcmessages/location.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Location location +// +// swagger:model Location +type Location struct { + + // label + // Example: Label for display + // Required: true + Label *string `json:"label"` + + // value + // Example: Value for location + // Required: true + Value *string `json:"value"` +} + +// Validate validates this location +func (m *Location) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateLabel(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 *Location) validateLabel(formats strfmt.Registry) error { + + if err := validate.Required("label", "body", m.Label); err != nil { + return err + } + + return nil +} + +func (m *Location) validateValue(formats strfmt.Registry) error { + + if err := validate.Required("value", "body", m.Value); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this location based on context it is used +func (m *Location) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Location) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Location) UnmarshalBinary(b []byte) error { + var res Location + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/locations.go b/pkg/gen/ghcmessages/locations.go new file mode 100644 index 00000000000..073139e4061 --- /dev/null +++ b/pkg/gen/ghcmessages/locations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Locations locations +// +// swagger:model Locations +type Locations []*Location + +// Validate validates this locations +func (m Locations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this locations based on the context it is used +func (m Locations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/locked_office_user.go b/pkg/gen/ghcmessages/locked_office_user.go new file mode 100644 index 00000000000..a6dedb2e3c3 --- /dev/null +++ b/pkg/gen/ghcmessages/locked_office_user.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LockedOfficeUser locked office user +// +// swagger:model LockedOfficeUser +type LockedOfficeUser struct { + + // first name + FirstName string `json:"firstName,omitempty"` + + // last name + LastName string `json:"lastName,omitempty"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` + + // transportation office Id + // Format: uuid + TransportationOfficeID strfmt.UUID `json:"transportationOfficeId,omitempty"` +} + +// Validate validates this locked office user +func (m *LockedOfficeUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LockedOfficeUser) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *LockedOfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this locked office user based on the context it is used +func (m *LockedOfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LockedOfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LockedOfficeUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LockedOfficeUser) UnmarshalBinary(b []byte) error { + var res LockedOfficeUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_agent.go b/pkg/gen/ghcmessages/m_t_o_agent.go new file mode 100644 index 00000000000..5115dd2848c --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_agent.go @@ -0,0 +1,236 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgent m t o agent +// +// swagger:model MTOAgent +type MTOAgent struct { + + // agent type + // Enum: [RELEASING_AGENT RECEIVING_AGENT] + AgentType string `json:"agentType,omitempty"` + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: (^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$) + Email *string `json:"email,omitempty"` + + // first name + FirstName *string `json:"firstName,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName *string `json:"lastName,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // phone + // Pattern: (^[2-9]\d{2}-\d{3}-\d{4}$)|(^$) + Phone *string `json:"phone,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o agent +func (m *MTOAgent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var mTOAgentTypeAgentTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentTypeAgentTypePropEnum = append(mTOAgentTypeAgentTypePropEnum, v) + } +} + +const ( + + // MTOAgentAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentAgentTypeRELEASINGAGENT string = "RELEASING_AGENT" + + // MTOAgentAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentAgentTypeRECEIVINGAGENT string = "RECEIVING_AGENT" +) + +// prop value enum +func (m *MTOAgent) validateAgentTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOAgentTypeAgentTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { + if swag.IsZero(m.AgentType) { // not required + return nil + } + + // value enum + if err := m.validateAgentTypeEnum("agentType", "body", m.AgentType); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$)`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `(^[2-9]\d{2}-\d{3}-\d{4}$)|(^$)`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this m t o agent based on context it is used +func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MTOAgent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOAgent) UnmarshalBinary(b []byte) error { + var res MTOAgent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_agents.go b/pkg/gen/ghcmessages/m_t_o_agents.go new file mode 100644 index 00000000000..a0f5cdea3c1 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_agents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOAgents m t o agents +// +// swagger:model MTOAgents +type MTOAgents []*MTOAgent + +// Validate validates this m t o agents +func (m MTOAgents) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents based on the context it is used +func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go b/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go new file mode 100644 index 00000000000..c39aa2484ae --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_approval_service_item_codes.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOApprovalServiceItemCodes MTO level service items to create when updating MTO status. +// +// swagger:model MTOApprovalServiceItemCodes +type MTOApprovalServiceItemCodes struct { + + // service code c s + // Example: true + ServiceCodeCS bool `json:"serviceCodeCS,omitempty"` + + // service code m s + // Example: true + ServiceCodeMS bool `json:"serviceCodeMS,omitempty"` +} + +// Validate validates this m t o approval service item codes +func (m *MTOApprovalServiceItemCodes) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this m t o approval service item codes based on context it is used +func (m *MTOApprovalServiceItemCodes) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MTOApprovalServiceItemCodes) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOApprovalServiceItemCodes) UnmarshalBinary(b []byte) error { + var res MTOApprovalServiceItemCodes + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item.go b/pkg/gen/ghcmessages/m_t_o_service_item.go new file mode 100644 index 00000000000..9f20d0d5a7b --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item.go @@ -0,0 +1,937 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItem m t o service item +// +// swagger:model MTOServiceItem +type MTOServiceItem struct { + + // s i t postal code + // Read Only: true + SITPostalCode *string `json:"SITPostalCode,omitempty"` + + // approved at + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // convert to customer expense + // Example: false + ConvertToCustomerExpense bool `json:"convertToCustomerExpense"` + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // customer contacts + CustomerContacts MTOServiceItemCustomerContacts `json:"customerContacts,omitempty"` + + // customer expense reason + CustomerExpenseReason *string `json:"customerExpenseReason,omitempty"` + + // deleted at + // Format: date + DeletedAt strfmt.Date `json:"deletedAt,omitempty"` + + // description + Description *string `json:"description,omitempty"` + + // dimensions + Dimensions MTOServiceItemDimensions `json:"dimensions,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // estimated price + EstimatedPrice *int64 `json:"estimatedPrice,omitempty"` + + // estimated weight of the shuttle service item provided by the prime + // Example: 2500 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // fee type + // Enum: [COUNSELING CRATING TRUCKING SHUTTLE] + FeeType string `json:"feeType,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // locked price cents + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market *string `json:"market,omitempty"` + + // move task order ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // pickup postal code + PickupPostalCode *string `json:"pickupPostalCode,omitempty"` + + // quantity + Quantity int64 `json:"quantity,omitempty"` + + // rate + Rate int64 `json:"rate,omitempty"` + + // re service code + // Required: true + ReServiceCode *string `json:"reServiceCode"` + + // re service ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + ReServiceID *strfmt.UUID `json:"reServiceID"` + + // re service name + // Required: true + ReServiceName *string `json:"reServiceName"` + + // reason + Reason *string `json:"reason,omitempty"` + + // rejected at + // Format: date-time + RejectedAt *strfmt.DateTime `json:"rejectedAt,omitempty"` + + // rejection reason + RejectionReason *string `json:"rejectionReason,omitempty"` + + // service request documents + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + // sit customer contacted + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // sit delivery miles + SitDeliveryMiles *int64 `json:"sitDeliveryMiles,omitempty"` + + // sit departure date + // Format: date-time + SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // sit destination original address + SitDestinationOriginalAddress *Address `json:"sitDestinationOriginalAddress,omitempty"` + + // sit entry date + // Format: date-time + SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` + + // sit origin h h g actual address + SitOriginHHGActualAddress *Address `json:"sitOriginHHGActualAddress,omitempty"` + + // sit origin h h g original address + SitOriginHHGOriginalAddress *Address `json:"sitOriginHHGOriginalAddress,omitempty"` + + // sit requested delivery + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + + // status + Status MTOServiceItemStatus `json:"status,omitempty"` + + // submitted at + // Format: date + SubmittedAt strfmt.Date `json:"submittedAt,omitempty"` + + // total + Total int64 `json:"total,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o service item +func (m *MTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerContacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDimensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFeeType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarket(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRejectedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginHHGActualAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginHHGOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItem) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateCustomerContacts(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerContacts) { // not required + return nil + } + + if err := m.CustomerContacts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customerContacts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customerContacts") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) validateDeletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.DeletedAt) { // not required + return nil + } + + if err := validate.FormatOf("deletedAt", "body", "date", m.DeletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateDimensions(formats strfmt.Registry) error { + if swag.IsZero(m.Dimensions) { // not required + return nil + } + + if err := m.Dimensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensions") + } + return err + } + + return nil +} + +var mTOServiceItemTypeFeeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["COUNSELING","CRATING","TRUCKING","SHUTTLE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemTypeFeeTypePropEnum = append(mTOServiceItemTypeFeeTypePropEnum, v) + } +} + +const ( + + // MTOServiceItemFeeTypeCOUNSELING captures enum value "COUNSELING" + MTOServiceItemFeeTypeCOUNSELING string = "COUNSELING" + + // MTOServiceItemFeeTypeCRATING captures enum value "CRATING" + MTOServiceItemFeeTypeCRATING string = "CRATING" + + // MTOServiceItemFeeTypeTRUCKING captures enum value "TRUCKING" + MTOServiceItemFeeTypeTRUCKING string = "TRUCKING" + + // MTOServiceItemFeeTypeSHUTTLE captures enum value "SHUTTLE" + MTOServiceItemFeeTypeSHUTTLE string = "SHUTTLE" +) + +// prop value enum +func (m *MTOServiceItem) validateFeeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemTypeFeeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItem) validateFeeType(formats strfmt.Registry) error { + if swag.IsZero(m.FeeType) { // not required + return nil + } + + // value enum + if err := m.validateFeeTypeEnum("feeType", "body", m.FeeType); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +var mTOServiceItemTypeMarketPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemTypeMarketPropEnum = append(mTOServiceItemTypeMarketPropEnum, v) + } +} + +const ( + + // MTOServiceItemMarketCONUS captures enum value "CONUS" + MTOServiceItemMarketCONUS string = "CONUS" + + // MTOServiceItemMarketOCONUS captures enum value "OCONUS" + MTOServiceItemMarketOCONUS string = "OCONUS" +) + +// prop value enum +func (m *MTOServiceItem) validateMarketEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemTypeMarketPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItem) validateMarket(formats strfmt.Registry) error { + if swag.IsZero(m.Market) { // not required + return nil + } + + // value enum + if err := m.validateMarketEnum("market", "body", *m.Market); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateReServiceID(formats strfmt.Registry) error { + + if err := validate.Required("reServiceID", "body", m.ReServiceID); err != nil { + return err + } + + if err := validate.FormatOf("reServiceID", "body", "uuid", m.ReServiceID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateReServiceName(formats strfmt.Registry) error { + + if err := validate.Required("reServiceName", "body", m.ReServiceName); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateRejectedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RejectedAt) { // not required + return nil + } + + if err := validate.FormatOf("rejectedAt", "body", "date-time", m.RejectedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceRequestDocuments) { // not required + return nil + } + + if err := m.ServiceRequestDocuments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) validateSitCustomerContacted(formats strfmt.Registry) error { + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateSitDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) validateSitDestinationOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitDestinationOriginalAddress) { // not required + return nil + } + + if m.SitDestinationOriginalAddress != nil { + if err := m.SitDestinationOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) validateSitEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateSitOriginHHGActualAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginHHGActualAddress) { // not required + return nil + } + + if m.SitOriginHHGActualAddress != nil { + if err := m.SitOriginHHGActualAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginHHGActualAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginHHGActualAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) validateSitOriginHHGOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginHHGOriginalAddress) { // not required + return nil + } + + if m.SitOriginHHGOriginalAddress != nil { + if err := m.SitOriginHHGOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginHHGOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginHHGOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) validateSitRequestedDelivery(formats strfmt.Registry) error { + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item based on the context it is used +func (m *MTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSITPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerContacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDimensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitDestinationOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginHHGActualAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginHHGOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItem) contextValidateSITPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "SITPostalCode", "body", m.SITPostalCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItem) contextValidateCustomerContacts(ctx context.Context, formats strfmt.Registry) error { + + if err := m.CustomerContacts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customerContacts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customerContacts") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) contextValidateDimensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Dimensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("dimensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("dimensions") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItem) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) contextValidateSitDestinationOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationOriginalAddress != nil { + + if swag.IsZero(m.SitDestinationOriginalAddress) { // not required + return nil + } + + if err := m.SitDestinationOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) contextValidateSitOriginHHGActualAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginHHGActualAddress != nil { + + if swag.IsZero(m.SitOriginHHGActualAddress) { // not required + return nil + } + + if err := m.SitOriginHHGActualAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginHHGActualAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginHHGActualAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) contextValidateSitOriginHHGOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginHHGOriginalAddress != nil { + + if swag.IsZero(m.SitOriginHHGOriginalAddress) { // not required + return nil + } + + if err := m.SitOriginHHGOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginHHGOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginHHGOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItem) UnmarshalBinary(b []byte) error { + var res MTOServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go new file mode 100644 index 00000000000..1731ce9d43c --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contact.go @@ -0,0 +1,171 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemCustomerContact Customer contact information for a destination SIT service item +// +// swagger:model MTOServiceItemCustomerContact +type MTOServiceItemCustomerContact struct { + + // Date of attempted contact by the prime. + // Format: date + DateOfContact strfmt.Date `json:"dateOfContact,omitempty"` + + // First available date that the Prime can deliver SIT service item. + // Example: 2020-12-31 + // Format: date + FirstAvailableDeliveryDate strfmt.Date `json:"firstAvailableDeliveryDate,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Time of attempted contact by the prime. + // Example: 0400Z + TimeMilitary string `json:"timeMilitary,omitempty"` + + // type + Type CustomerContactType `json:"type,omitempty"` +} + +// Validate validates this m t o service item customer contact +func (m *MTOServiceItemCustomerContact) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDateOfContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemCustomerContact) validateDateOfContact(formats strfmt.Registry) error { + if swag.IsZero(m.DateOfContact) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact", "body", "date", m.DateOfContact.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemCustomerContact) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemCustomerContact) 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 *MTOServiceItemCustomerContact) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this m t o service item customer contact based on the context it is used +func (m *MTOServiceItemCustomerContact) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemCustomerContact) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemCustomerContact) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemCustomerContact) UnmarshalBinary(b []byte) error { + var res MTOServiceItemCustomerContact + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go new file mode 100644 index 00000000000..0e8c1380700 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_customer_contacts.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOServiceItemCustomerContacts m t o service item customer contacts +// +// swagger:model MTOServiceItemCustomerContacts +type MTOServiceItemCustomerContacts []*MTOServiceItemCustomerContact + +// Validate validates this m t o service item customer contacts +func (m MTOServiceItemCustomerContacts) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item customer contacts based on the context it is used +func (m MTOServiceItemCustomerContacts) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go b/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go new file mode 100644 index 00000000000..2b2744c337a --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_dimension.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDimension Describes a dimension object for the MTOServiceItem. +// +// swagger:model MTOServiceItemDimension +type MTOServiceItemDimension struct { + + // Height in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + Height int32 `json:"height,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Length in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + Length int32 `json:"length,omitempty"` + + // type + Type DimensionType `json:"type,omitempty"` + + // Width in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + Width int32 `json:"width,omitempty"` +} + +// Validate validates this m t o service item dimension +func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this m t o service item dimension based on the context it is used +func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDimension) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDimension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go b/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go new file mode 100644 index 00000000000..f91bbd314f2 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_dimensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOServiceItemDimensions m t o service item dimensions +// +// swagger:model MTOServiceItemDimensions +type MTOServiceItemDimensions []*MTOServiceItemDimension + +// Validate validates this m t o service item dimensions +func (m MTOServiceItemDimensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item dimensions based on the context it is used +func (m MTOServiceItemDimensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_single.go b/pkg/gen/ghcmessages/m_t_o_service_item_single.go new file mode 100644 index 00000000000..c6623e63344 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_single.go @@ -0,0 +1,390 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemSingle m t o service item single +// +// swagger:model MTOServiceItemSingle +type MTOServiceItemSingle struct { + + // approved at + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // convert to customer expense + // Example: false + ConvertToCustomerExpense bool `json:"convertToCustomerExpense"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // customer expense reason + CustomerExpenseReason *string `json:"customerExpenseReason,omitempty"` + + // deleted at + // Format: date + DeletedAt strfmt.Date `json:"deletedAt,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move task order ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // pickup postal code + PickupPostalCode *string `json:"pickupPostalCode,omitempty"` + + // re service code + ReServiceCode string `json:"reServiceCode,omitempty"` + + // re service ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ReServiceID strfmt.UUID `json:"reServiceID,omitempty"` + + // re service name + ReServiceName string `json:"reServiceName,omitempty"` + + // rejected at + // Format: date-time + RejectedAt *strfmt.DateTime `json:"rejectedAt,omitempty"` + + // rejection reason + RejectionReason *string `json:"rejectionReason,omitempty"` + + // sit customer contacted + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // sit departure date + // Format: date-time + SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` + + // sit entry date + // Format: date-time + SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` + + // sit postal code + // Read Only: true + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // sit requested delivery + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // status + Status *string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o service item single +func (m *MTOServiceItemSingle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRejectedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemSingle) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateDeletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.DeletedAt) { // not required + return nil + } + + if err := validate.FormatOf("deletedAt", "body", "date", m.DeletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) 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 *MTOServiceItemSingle) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateReServiceID(formats strfmt.Registry) error { + if swag.IsZero(m.ReServiceID) { // not required + return nil + } + + if err := validate.FormatOf("reServiceID", "body", "uuid", m.ReServiceID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateRejectedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RejectedAt) { // not required + return nil + } + + if err := validate.FormatOf("rejectedAt", "body", "date-time", m.RejectedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateSitCustomerContacted(formats strfmt.Registry) error { + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateSitDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateSitEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateSitRequestedDelivery(formats strfmt.Registry) error { + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item single based on the context it is used +func (m *MTOServiceItemSingle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemSingle) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) contextValidateSitPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "sitPostalCode", "body", m.SitPostalCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemSingle) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemSingle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemSingle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemSingle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_item_status.go b/pkg/gen/ghcmessages/m_t_o_service_item_status.go new file mode 100644 index 00000000000..6e3de71c9c2 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_item_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemStatus Describes all statuses for a MTOServiceItem +// +// swagger:model MTOServiceItemStatus +type MTOServiceItemStatus string + +func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. +func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { + return &m +} + +const ( + + // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" + MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" + + // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" + MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" + + // MTOServiceItemStatusREJECTED captures enum value "REJECTED" + MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" +) + +// for schema +var mTOServiceItemStatusEnum []interface{} + +func init() { + var res []MTOServiceItemStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) + } +} + +func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item status +func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o service item status based on context it is used +func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_service_items.go b/pkg/gen/ghcmessages/m_t_o_service_items.go new file mode 100644 index 00000000000..4e2860a9a01 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOServiceItems A list of service items connected to this shipment. +// +// swagger:model MTOServiceItems +type MTOServiceItems []*MTOServiceItem + +// Validate validates this m t o service items +func (m MTOServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service items based on the context it is used +func (m MTOServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment.go b/pkg/gen/ghcmessages/m_t_o_shipment.go new file mode 100644 index 00000000000..78a6420cee4 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_shipment.go @@ -0,0 +1,1564 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipment m t o shipment +// +// swagger:model MTOShipment +type MTOShipment struct { + + // The actual date that the shipment was delivered to the delivery address by the Prime + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate,omitempty"` + + // actual pickup date + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate,omitempty"` + + // actual pro gear weight + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // actual spouse pro gear weight + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // approved date + // Format: date-time + ApprovedDate *strfmt.DateTime `json:"approvedDate,omitempty"` + + // TIO override billable weight to be used for calculations + // Example: 2500 + BillableWeightCap *int64 `json:"billableWeightCap,omitempty"` + + // billable weight justification + // Example: more weight than expected + BillableWeightJustification *string `json:"billableWeightJustification,omitempty"` + + // boat shipment + BoatShipment *BoatShipment `json:"boatShipment,omitempty"` + + // calculated billable weight + // Example: 2000 + // Read Only: true + CalculatedBillableWeight *int64 `json:"calculatedBillableWeight,omitempty"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // customer remarks + // Example: handle with care + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // deleted at + // Format: date-time + DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` + + // delivery address update + DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // destination sit auth end date + // Format: date-time + DestinationSitAuthEndDate strfmt.DateTime `json:"destinationSitAuthEndDate,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // distance + // Example: 500 + Distance *int64 `json:"distance,omitempty"` + + // diversion + // Example: true + Diversion bool `json:"diversion,omitempty"` + + // diversion reason + // Example: MTO Shipment needs rerouted + DiversionReason *string `json:"diversionReason,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // has secondary delivery address + HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary delivery address + HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Single-letter designator for domestic (d) or international (i) shipments + // Example: d + // Enum: [d i] + MarketCode string `json:"marketCode,omitempty"` + + // mobile home shipment + MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` + + // move task order ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // mto agents + MtoAgents MTOAgents `json:"mtoAgents,omitempty"` + + // mto service items + MtoServiceItems MTOServiceItems `json:"mtoServiceItems,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 2000 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // origin sit auth end date + // Format: date-time + OriginSitAuthEndDate strfmt.DateTime `json:"originSitAuthEndDate,omitempty"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` + + // prime actual weight + // Example: 2000 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // prime estimated weight + // Example: 2000 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // rejection reason + // Example: MTO Shipment not good enough + RejectionReason *string `json:"rejectionReason,omitempty"` + + // requested delivery date + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // required delivery date + // Format: date + RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate,omitempty"` + + // reweigh + Reweigh *Reweigh `json:"reweigh,omitempty"` + + // sac type + SacType *LOAType `json:"sacType,omitempty"` + + // scheduled delivery date + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate,omitempty"` + + // scheduled pickup date + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate,omitempty"` + + // secondary delivery address + SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // service order number + ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` + + // shipment locator + // Example: 1K43AR-01 + // Read Only: true + ShipmentLocator *string `json:"shipmentLocator,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // sit days allowance + SitDaysAllowance *int64 `json:"sitDaysAllowance,omitempty"` + + // sit extensions + SitExtensions SITExtensions `json:"sitExtensions,omitempty"` + + // sit status + SitStatus *SITStatus `json:"sitStatus,omitempty"` + + // status + Status MTOShipmentStatus `json:"status,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // tac type + TacType *LOAType `json:"tacType,omitempty"` + + // tertiary delivery address + TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // uses external vendor + // Example: false + UsesExternalVendor bool `json:"usesExternalVendor,omitempty"` +} + +// Validate validates this m t o shipment +func (m *MTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddressUpdate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReweigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExtensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("approvedDate", "body", "date-time", m.ApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateDeletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.DeletedAt) { // not required + return nil + } + + if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateDeliveryAddressUpdate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if m.DeliveryAddressUpdate != nil { + if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date-time", m.DestinationSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) 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 +} + +var mTOShipmentTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeMarketCodePropEnum = append(mTOShipmentTypeMarketCodePropEnum, v) + } +} + +const ( + + // MTOShipmentMarketCodeD captures enum value "d" + MTOShipmentMarketCodeD string = "d" + + // MTOShipmentMarketCodeI captures enum value "i" + MTOShipmentMarketCodeI string = "i" +) + +// prop value enum +func (m *MTOShipment) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipment) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateMtoAgents(formats strfmt.Registry) error { + if swag.IsZero(m.MtoAgents) { // not required + return nil + } + + if err := m.MtoAgents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoAgents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoAgents") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItems) { // not required + return nil + } + + if err := m.MtoServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateOriginSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.OriginSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("originSitAuthEndDate", "body", "date-time", m.OriginSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateRequiredDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateReweigh(formats strfmt.Registry) error { + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if m.Reweigh != nil { + if err := m.Reweigh.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateSacType(formats strfmt.Registry) error { + if swag.IsZero(m.SacType) { // not required + return nil + } + + if m.SacType != nil { + if err := m.SacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if m.SecondaryDeliveryAddress != nil { + if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateSitExtensions(formats strfmt.Registry) error { + if swag.IsZero(m.SitExtensions) { // not required + return nil + } + + if err := m.SitExtensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateSitStatus(formats strfmt.Registry) error { + if swag.IsZero(m.SitStatus) { // not required + return nil + } + + if m.SitStatus != nil { + if err := m.SitStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitStatus") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateTacType(formats strfmt.Registry) error { + if swag.IsZero(m.TacType) { // not required + return nil + } + + if m.TacType != nil { + if err := m.TacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if m.TertiaryDeliveryAddress != nil { + if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment based on the context it is used +func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCalculatedBillableWeight(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReweigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentLocator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitExtensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateCalculatedBillableWeight(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "calculatedBillableWeight", "body", m.CalculatedBillableWeight); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.DeliveryAddressUpdate != nil { + + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateMtoAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoAgents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoAgents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoAgents") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { + + if m.Reweigh != nil { + + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { + + if m.SacType != nil { + + if swag.IsZero(m.SacType) { // not required + return nil + } + + if err := m.SacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDeliveryAddress != nil { + + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateShipmentLocator(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentLocator", "body", m.ShipmentLocator); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateSitStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.SitStatus != nil { + + if swag.IsZero(m.SitStatus) { // not required + return nil + } + + if err := m.SitStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitStatus") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { + + if m.TacType != nil { + + if swag.IsZero(m.TacType) { // not required + return nil + } + + if err := m.TacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDeliveryAddress != nil { + + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipment) UnmarshalBinary(b []byte) error { + var res MTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment_status.go b/pkg/gen/ghcmessages/m_t_o_shipment_status.go new file mode 100644 index 00000000000..9c38080ae8a --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_shipment_status.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentStatus Shipment Status +// Example: SUBMITTED +// +// swagger:model MTOShipmentStatus +type MTOShipmentStatus string + +func NewMTOShipmentStatus(value MTOShipmentStatus) *MTOShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentStatus. +func (m MTOShipmentStatus) Pointer() *MTOShipmentStatus { + return &m +} + +const ( + + // MTOShipmentStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentStatusSUBMITTED MTOShipmentStatus = "SUBMITTED" + + // MTOShipmentStatusREJECTED captures enum value "REJECTED" + MTOShipmentStatusREJECTED MTOShipmentStatus = "REJECTED" + + // MTOShipmentStatusAPPROVED captures enum value "APPROVED" + MTOShipmentStatusAPPROVED MTOShipmentStatus = "APPROVED" + + // MTOShipmentStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + MTOShipmentStatusCANCELLATIONREQUESTED MTOShipmentStatus = "CANCELLATION_REQUESTED" + + // MTOShipmentStatusCANCELED captures enum value "CANCELED" + MTOShipmentStatusCANCELED MTOShipmentStatus = "CANCELED" + + // MTOShipmentStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + MTOShipmentStatusDIVERSIONREQUESTED MTOShipmentStatus = "DIVERSION_REQUESTED" +) + +// for schema +var mTOShipmentStatusEnum []interface{} + +func init() { + var res []MTOShipmentStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","REJECTED","APPROVED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentStatusEnum = append(mTOShipmentStatusEnum, v) + } +} + +func (m MTOShipmentStatus) validateMTOShipmentStatusEnum(path, location string, value MTOShipmentStatus) error { + if err := validate.EnumCase(path, location, value, mTOShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment status +func (m MTOShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment status based on context it is used +func (m MTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_shipment_type.go b/pkg/gen/ghcmessages/m_t_o_shipment_type.go new file mode 100644 index 00000000000..6e554e7d4d3 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_shipment_type.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType Shipment Type +// Example: HHG +// +// swagger:model MTOShipmentType +type MTOShipmentType string + +func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType. +func (m MTOShipmentType) Pointer() *MTOShipmentType { + return &m +} + +const ( + + // MTOShipmentTypeHHG captures enum value "HHG" + MTOShipmentTypeHHG MTOShipmentType = "HHG" + + // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" + + // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentTypePPM captures enum value "PPM" + MTOShipmentTypePPM MTOShipmentType = "PPM" + + // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" + + // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" + + // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" + + // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" +) + +// for schema +var mTOShipmentTypeEnum []interface{} + +func init() { + var res []MTOShipmentType + if err := json.Unmarshal([]byte(`["HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","PPM","BOAT_HAUL_AWAY","BOAT_TOW_AWAY","MOBILE_HOME","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) + } +} + +func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type +func (m MTOShipmentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type based on context it is used +func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/m_t_o_shipments.go b/pkg/gen/ghcmessages/m_t_o_shipments.go new file mode 100644 index 00000000000..9285acd4e21 --- /dev/null +++ b/pkg/gen/ghcmessages/m_t_o_shipments.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipments m t o shipments +// +// swagger:model MTOShipments +type MTOShipments []*MTOShipment + +// Validate validates this m t o shipments +func (m MTOShipments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments based on the context it is used +func (m MTOShipments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/mobile_home.go b/pkg/gen/ghcmessages/mobile_home.go new file mode 100644 index 00000000000..a54b9b8752a --- /dev/null +++ b/pkg/gen/ghcmessages/mobile_home.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. +// +// swagger:model MobileHome +type MobileHome struct { + + // Timestamp of when a property of this object was created (UTC) + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // height in inches + HeightInInches int64 `json:"heightInInches,omitempty"` + + // Primary auto-generated unique identifier of the Mobile Home object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // length in inches + LengthInInches int64 `json:"lengthInInches,omitempty"` + + // The make of the mobile home + Make string `json:"make,omitempty"` + + // The model of the mobile home. + Model string `json:"model,omitempty"` + + // The id of the parent MTOShipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // width in inches + WidthInInches int64 `json:"widthInInches,omitempty"` + + // The year the mobile home was made. + Year int64 `json:"year,omitempty"` +} + +// Validate validates this mobile home +func (m *MobileHome) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this mobile home based on the context it is used +func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MobileHome) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MobileHome) UnmarshalBinary(b []byte) error { + var res MobileHome + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move.go b/pkg/gen/ghcmessages/move.go new file mode 100644 index 00000000000..bb67e748b11 --- /dev/null +++ b/pkg/gen/ghcmessages/move.go @@ -0,0 +1,932 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Move move +// +// swagger:model Move +type Move struct { + + // s c assigned user + SCAssignedUser *AssignedOfficeUser `json:"SCAssignedUser,omitempty"` + + // t i o assigned user + TIOAssignedUser *AssignedOfficeUser `json:"TIOAssignedUser,omitempty"` + + // t o o assigned user + TOOAssignedUser *AssignedOfficeUser `json:"TOOAssignedUser,omitempty"` + + // additional documents + AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` + + // The time at which a move is sent back to the TOO becuase the prime added a new service item for approval + // Format: date-time + ApprovalsRequestedAt *strfmt.DateTime `json:"approvalsRequestedAt,omitempty"` + + // approved at + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // billable weights reviewed at + // Format: date-time + BillableWeightsReviewedAt *strfmt.DateTime `json:"billableWeightsReviewedAt,omitempty"` + + // closeout office + CloseoutOffice *TransportationOffice `json:"closeoutOffice,omitempty"` + + // The transportation office that will handle reviewing PPM Closeout documentation for Army and Air Force service members + // Format: uuid + CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId,omitempty"` + + // contractor + Contractor *Contractor `json:"contractor,omitempty"` + + // contractor Id + // Format: uuid + ContractorID *strfmt.UUID `json:"contractorId,omitempty"` + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // Timestamp of when the TOO acknowledged the excess weight risk by either dismissing the alert or updating the max billable weight + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excess_weight_acknowledged_at,omitempty"` + + // Timestamp of when the estimated shipment weights of the move reached 90% of the weight allowance + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excess_weight_qualified_at,omitempty"` + + // This flag is set by office users if a move should be reviewed by a Financial Office + // Example: false + // Read Only: true + FinancialReviewFlag bool `json:"financialReviewFlag,omitempty"` + + // financial review remarks + // Example: Delivery Address is too far from duty location + // Read Only: true + FinancialReviewRemarks *string `json:"financialReviewRemarks,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // locator + // Example: 1K43AR + Locator string `json:"locator,omitempty"` + + // lock expires at + // Format: date-time + LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` + + // locked by office user + LockedByOfficeUser *LockedOfficeUser `json:"lockedByOfficeUser,omitempty"` + + // locked by office user ID + // Format: uuid + LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` + + // orders + Orders *Order `json:"orders,omitempty"` + + // orders Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrdersID strfmt.UUID `json:"ordersId,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID *string `json:"referenceId,omitempty"` + + // service counseling completed at + // Format: date-time + ServiceCounselingCompletedAt *strfmt.DateTime `json:"serviceCounselingCompletedAt,omitempty"` + + // shipment g b l o c + ShipmentGBLOC GBLOC `json:"shipmentGBLOC,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` + + // tio remarks + // Example: approved additional weight + TioRemarks *string `json:"tioRemarks,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this move +func (m *Move) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSCAssignedUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTIOAssignedUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTOOAssignedUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAdditionalDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovalsRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBillableWeightsReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloseoutOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloseoutOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContractor(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContractorID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Move) validateSCAssignedUser(formats strfmt.Registry) error { + if swag.IsZero(m.SCAssignedUser) { // not required + return nil + } + + if m.SCAssignedUser != nil { + if err := m.SCAssignedUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SCAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("SCAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) validateTIOAssignedUser(formats strfmt.Registry) error { + if swag.IsZero(m.TIOAssignedUser) { // not required + return nil + } + + if m.TIOAssignedUser != nil { + if err := m.TIOAssignedUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TIOAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TIOAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) validateTOOAssignedUser(formats strfmt.Registry) error { + if swag.IsZero(m.TOOAssignedUser) { // not required + return nil + } + + if m.TOOAssignedUser != nil { + if err := m.TOOAssignedUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TOOAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TOOAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) validateAdditionalDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if m.AdditionalDocuments != nil { + if err := m.AdditionalDocuments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *Move) validateApprovalsRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovalsRequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvalsRequestedAt", "body", "date-time", m.ApprovalsRequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateBillableWeightsReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.BillableWeightsReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("billableWeightsReviewedAt", "body", "date-time", m.BillableWeightsReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateCloseoutOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if m.CloseoutOffice != nil { + if err := m.CloseoutOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeoutOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeoutOffice") + } + return err + } + } + + return nil +} + +func (m *Move) validateCloseoutOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("closeoutOfficeId", "body", "uuid", m.CloseoutOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateContractor(formats strfmt.Registry) error { + if swag.IsZero(m.Contractor) { // not required + return nil + } + + if m.Contractor != nil { + if err := m.Contractor.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contractor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contractor") + } + return err + } + } + + return nil +} + +func (m *Move) validateContractorID(formats strfmt.Registry) error { + if swag.IsZero(m.ContractorID) { // not required + return nil + } + + if err := validate.FormatOf("contractorId", "body", "uuid", m.ContractorID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("excess_weight_acknowledged_at", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excess_weight_qualified_at", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) 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 *Move) validateLockExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.LockExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateLockedByOfficeUser(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUser) { // not required + return nil + } + + if m.LockedByOfficeUser != nil { + if err := m.LockedByOfficeUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lockedByOfficeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lockedByOfficeUser") + } + return err + } + } + + return nil +} + +func (m *Move) validateLockedByOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateOrders(formats strfmt.Registry) error { + if swag.IsZero(m.Orders) { // not required + return nil + } + + if m.Orders != nil { + if err := m.Orders.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders") + } + return err + } + } + + return nil +} + +func (m *Move) validateOrdersID(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersID) { // not required + return nil + } + + if err := validate.FormatOf("ordersId", "body", "uuid", m.OrdersID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateServiceCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("serviceCounselingCompletedAt", "body", "date-time", m.ServiceCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateShipmentGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentGBLOC) { // not required + return nil + } + + if err := m.ShipmentGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentGBLOC") + } + return err + } + + return nil +} + +func (m *Move) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *Move) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Move) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move based on the context it is used +func (m *Move) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSCAssignedUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTIOAssignedUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTOOAssignedUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContractor(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFinancialReviewFlag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFinancialReviewRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLockedByOfficeUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Move) contextValidateSCAssignedUser(ctx context.Context, formats strfmt.Registry) error { + + if m.SCAssignedUser != nil { + + if swag.IsZero(m.SCAssignedUser) { // not required + return nil + } + + if err := m.SCAssignedUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("SCAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("SCAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateTIOAssignedUser(ctx context.Context, formats strfmt.Registry) error { + + if m.TIOAssignedUser != nil { + + if swag.IsZero(m.TIOAssignedUser) { // not required + return nil + } + + if err := m.TIOAssignedUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TIOAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TIOAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateTOOAssignedUser(ctx context.Context, formats strfmt.Registry) error { + + if m.TOOAssignedUser != nil { + + if swag.IsZero(m.TOOAssignedUser) { // not required + return nil + } + + if err := m.TOOAssignedUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("TOOAssignedUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("TOOAssignedUser") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { + + if m.AdditionalDocuments != nil { + + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CloseoutOffice != nil { + + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeoutOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeoutOffice") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateContractor(ctx context.Context, formats strfmt.Registry) error { + + if m.Contractor != nil { + + if swag.IsZero(m.Contractor) { // not required + return nil + } + + if err := m.Contractor.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("contractor") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("contractor") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateFinancialReviewFlag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "financialReviewFlag", "body", bool(m.FinancialReviewFlag)); err != nil { + return err + } + + return nil +} + +func (m *Move) contextValidateFinancialReviewRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "financialReviewRemarks", "body", m.FinancialReviewRemarks); err != nil { + return err + } + + return nil +} + +func (m *Move) contextValidateLockedByOfficeUser(ctx context.Context, formats strfmt.Registry) error { + + if m.LockedByOfficeUser != nil { + + if swag.IsZero(m.LockedByOfficeUser) { // not required + return nil + } + + if err := m.LockedByOfficeUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lockedByOfficeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lockedByOfficeUser") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateOrders(ctx context.Context, formats strfmt.Registry) error { + + if m.Orders != nil { + + if swag.IsZero(m.Orders) { // not required + return nil + } + + if err := m.Orders.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders") + } + return err + } + } + + return nil +} + +func (m *Move) contextValidateShipmentGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentGBLOC) { // not required + return nil + } + + if err := m.ShipmentGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentGBLOC") + } + return err + } + + return nil +} + +func (m *Move) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Move) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Move) UnmarshalBinary(b []byte) error { + var res Move + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_audit_histories.go b/pkg/gen/ghcmessages/move_audit_histories.go new file mode 100644 index 00000000000..2dcc1d5137b --- /dev/null +++ b/pkg/gen/ghcmessages/move_audit_histories.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveAuditHistories move audit histories +// +// swagger:model MoveAuditHistories +type MoveAuditHistories []*MoveAuditHistory + +// Validate validates this move audit histories +func (m MoveAuditHistories) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this move audit histories based on the context it is used +func (m MoveAuditHistories) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/move_audit_history.go b/pkg/gen/ghcmessages/move_audit_history.go new file mode 100644 index 00000000000..a92a81cabe6 --- /dev/null +++ b/pkg/gen/ghcmessages/move_audit_history.go @@ -0,0 +1,244 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveAuditHistory move audit history +// +// swagger:model MoveAuditHistory +type MoveAuditHistory struct { + + // Action type; I = insert, D = delete, U = update, T = truncate + Action string `json:"action,omitempty"` + + // Wall clock time at which audited event's trigger call occurred + // Format: date-time + ActionTstampClk strfmt.DateTime `json:"actionTstampClk,omitempty"` + + // Statement start timestamp for tx in which audited event occurred + // Format: date-time + ActionTstampStm strfmt.DateTime `json:"actionTstampStm,omitempty"` + + // Transaction start timestamp for tx in which audited event occurred + // Format: date-time + ActionTstampTx strfmt.DateTime `json:"actionTstampTx,omitempty"` + + // A list of (changed/updated) MoveAuditHistoryItem's for a record after the change. + ChangedValues interface{} `json:"changedValues,omitempty"` + + // context + Context []map[string]string `json:"context"` + + // id column for the context table the record belongs to + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + ContextID *string `json:"contextId,omitempty"` + + // API endpoint name that was called to make the change + EventName *string `json:"eventName,omitempty"` + + // id from audity_history table + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // id column for the tableName where the data was changed + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ObjectID *strfmt.UUID `json:"objectId,omitempty"` + + // A list of (old/previous) MoveAuditHistoryItem's for a record before the change. + OldValues interface{} `json:"oldValues,omitempty"` + + // relation OID. Table OID (object identifier). Changes with drop/create. + RelID int64 `json:"relId,omitempty"` + + // Database schema audited table for this event is in + SchemaName string `json:"schemaName,omitempty"` + + // session user email + // Example: foobar@example.com + SessionUserEmail *string `json:"sessionUserEmail,omitempty"` + + // session user first name + // Example: foo + SessionUserFirstName *string `json:"sessionUserFirstName,omitempty"` + + // session user Id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + SessionUserID *strfmt.UUID `json:"sessionUserId,omitempty"` + + // session user last name + // Example: bar + SessionUserLastName *string `json:"sessionUserLastName,omitempty"` + + // session user telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + SessionUserTelephone *string `json:"sessionUserTelephone,omitempty"` + + // true if audit event is from an FOR EACH STATEMENT trigger, false for FOR EACH ROW' + // Example: false + StatementOnly bool `json:"statementOnly,omitempty"` + + // name of database table that was changed + TableName string `json:"tableName,omitempty"` + + // Identifier of transaction that made the change. May wrap, but unique paired with action_tstamp_tx. + TransactionID *int64 `json:"transactionId,omitempty"` +} + +// Validate validates this move audit history +func (m *MoveAuditHistory) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActionTstampClk(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActionTstampStm(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActionTstampTx(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSessionUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSessionUserTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveAuditHistory) validateActionTstampClk(formats strfmt.Registry) error { + if swag.IsZero(m.ActionTstampClk) { // not required + return nil + } + + if err := validate.FormatOf("actionTstampClk", "body", "date-time", m.ActionTstampClk.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveAuditHistory) validateActionTstampStm(formats strfmt.Registry) error { + if swag.IsZero(m.ActionTstampStm) { // not required + return nil + } + + if err := validate.FormatOf("actionTstampStm", "body", "date-time", m.ActionTstampStm.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveAuditHistory) validateActionTstampTx(formats strfmt.Registry) error { + if swag.IsZero(m.ActionTstampTx) { // not required + return nil + } + + if err := validate.FormatOf("actionTstampTx", "body", "date-time", m.ActionTstampTx.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveAuditHistory) 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 *MoveAuditHistory) validateObjectID(formats strfmt.Registry) error { + if swag.IsZero(m.ObjectID) { // not required + return nil + } + + if err := validate.FormatOf("objectId", "body", "uuid", m.ObjectID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveAuditHistory) validateSessionUserID(formats strfmt.Registry) error { + if swag.IsZero(m.SessionUserID) { // not required + return nil + } + + if err := validate.FormatOf("sessionUserId", "body", "uuid", m.SessionUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveAuditHistory) validateSessionUserTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SessionUserTelephone) { // not required + return nil + } + + if err := validate.Pattern("sessionUserTelephone", "body", *m.SessionUserTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this move audit history based on context it is used +func (m *MoveAuditHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MoveAuditHistory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveAuditHistory) UnmarshalBinary(b []byte) error { + var res MoveAuditHistory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_audit_history_item.go b/pkg/gen/ghcmessages/move_audit_history_item.go new file mode 100644 index 00000000000..d8c47368d5d --- /dev/null +++ b/pkg/gen/ghcmessages/move_audit_history_item.go @@ -0,0 +1,53 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveAuditHistoryItem move audit history item +// +// swagger:model MoveAuditHistoryItem +type MoveAuditHistoryItem struct { + + // column name + ColumnName string `json:"columnName,omitempty"` + + // column value + ColumnValue string `json:"columnValue,omitempty"` +} + +// Validate validates this move audit history item +func (m *MoveAuditHistoryItem) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this move audit history item based on context it is used +func (m *MoveAuditHistoryItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MoveAuditHistoryItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveAuditHistoryItem) UnmarshalBinary(b []byte) error { + var res MoveAuditHistoryItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_audit_history_items.go b/pkg/gen/ghcmessages/move_audit_history_items.go new file mode 100644 index 00000000000..9b6d9577be1 --- /dev/null +++ b/pkg/gen/ghcmessages/move_audit_history_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveAuditHistoryItems move audit history items +// +// swagger:model MoveAuditHistoryItems +type MoveAuditHistoryItems []*MoveAuditHistoryItem + +// Validate validates this move audit history items +func (m MoveAuditHistoryItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this move audit history items based on the context it is used +func (m MoveAuditHistoryItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/move_history.go b/pkg/gen/ghcmessages/move_history.go new file mode 100644 index 00000000000..3c820dfc847 --- /dev/null +++ b/pkg/gen/ghcmessages/move_history.go @@ -0,0 +1,130 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveHistory move history +// +// swagger:model MoveHistory +type MoveHistory struct { + + // A list of MoveAuditHistory's connected to the move. + HistoryRecords MoveAuditHistories `json:"historyRecords,omitempty"` + + // move ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move locator + // Example: 1K43AR + Locator string `json:"locator,omitempty"` + + // move referenceID + // Example: 1001-3456 + ReferenceID *string `json:"referenceId,omitempty"` +} + +// Validate validates this move history +func (m *MoveHistory) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHistoryRecords(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveHistory) validateHistoryRecords(formats strfmt.Registry) error { + if swag.IsZero(m.HistoryRecords) { // not required + return nil + } + + if err := m.HistoryRecords.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("historyRecords") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("historyRecords") + } + return err + } + + return nil +} + +func (m *MoveHistory) 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 +} + +// ContextValidate validate this move history based on the context it is used +func (m *MoveHistory) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHistoryRecords(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveHistory) contextValidateHistoryRecords(ctx context.Context, formats strfmt.Registry) error { + + if err := m.HistoryRecords.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("historyRecords") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("historyRecords") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveHistory) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveHistory) UnmarshalBinary(b []byte) error { + var res MoveHistory + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_history_result.go b/pkg/gen/ghcmessages/move_history_result.go new file mode 100644 index 00000000000..5c07ab9c563 --- /dev/null +++ b/pkg/gen/ghcmessages/move_history_result.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveHistoryResult move history result +// +// swagger:model MoveHistoryResult +type MoveHistoryResult struct { + + // A list of MoveAuditHistory's connected to the move. + HistoryRecords MoveAuditHistories `json:"historyRecords,omitempty"` + + // move ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move locator + // Example: 1K43AR + Locator string `json:"locator,omitempty"` + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // move referenceID + // Example: 1001-3456 + ReferenceID *string `json:"referenceId,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this move history result +func (m *MoveHistoryResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHistoryRecords(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveHistoryResult) validateHistoryRecords(formats strfmt.Registry) error { + if swag.IsZero(m.HistoryRecords) { // not required + return nil + } + + if err := m.HistoryRecords.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("historyRecords") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("historyRecords") + } + return err + } + + return nil +} + +func (m *MoveHistoryResult) 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 +} + +// ContextValidate validate this move history result based on the context it is used +func (m *MoveHistoryResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateHistoryRecords(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveHistoryResult) contextValidateHistoryRecords(ctx context.Context, formats strfmt.Registry) error { + + if err := m.HistoryRecords.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("historyRecords") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("historyRecords") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveHistoryResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveHistoryResult) UnmarshalBinary(b []byte) error { + var res MoveHistoryResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_payload.go b/pkg/gen/ghcmessages/move_payload.go new file mode 100644 index 00000000000..16962a7a619 --- /dev/null +++ b/pkg/gen/ghcmessages/move_payload.go @@ -0,0 +1,467 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MovePayload move payload +// +// swagger:model MovePayload +type MovePayload struct { + + // additional documents + AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` + + // cancel reason + // Example: Change of orders + CancelReason *string `json:"cancel_reason,omitempty"` + + // closeout office + CloseoutOffice *TransportationOffice `json:"closeout_office,omitempty"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // e tag + // Required: true + ETag *string `json:"eTag"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // locator + // Example: 12432 + // Required: true + Locator *string `json:"locator"` + + // mto shipments + MtoShipments MTOShipments `json:"mto_shipments,omitempty"` + + // orders id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + OrdersID *strfmt.UUID `json:"orders_id"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // service member id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submitted_at,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this move payload +func (m *MovePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdditionalDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloseoutOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovePayload) validateAdditionalDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if m.AdditionalDocuments != nil { + if err := m.AdditionalDocuments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *MovePayload) validateCloseoutOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if m.CloseoutOffice != nil { + if err := m.CloseoutOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeout_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeout_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateETag(formats strfmt.Registry) error { + + if err := validate.Required("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateLocator(formats strfmt.Registry) error { + + if err := validate.Required("locator", "body", m.Locator); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateMtoShipments(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipments) { // not required + return nil + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mto_shipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mto_shipments") + } + return err + } + + return nil +} + +func (m *MovePayload) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.Required("orders_id", "body", m.OrdersID); err != nil { + return err + } + + if err := validate.FormatOf("orders_id", "body", "uuid", m.OrdersID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MovePayload) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submitted_at", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move payload based on the context it is used +func (m *MovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovePayload) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { + + if m.AdditionalDocuments != nil { + + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *MovePayload) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CloseoutOffice != nil { + + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeout_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeout_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mto_shipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mto_shipments") + } + return err + } + + return nil +} + +func (m *MovePayload) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovePayload) UnmarshalBinary(b []byte) error { + var res MovePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_status.go b/pkg/gen/ghcmessages/move_status.go new file mode 100644 index 00000000000..53b716bb3ed --- /dev/null +++ b/pkg/gen/ghcmessages/move_status.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MoveStatus move status +// +// swagger:model MoveStatus +type MoveStatus string + +func NewMoveStatus(value MoveStatus) *MoveStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MoveStatus. +func (m MoveStatus) Pointer() *MoveStatus { + return &m +} + +const ( + + // MoveStatusDRAFT captures enum value "DRAFT" + MoveStatusDRAFT MoveStatus = "DRAFT" + + // MoveStatusNEEDSSERVICECOUNSELING captures enum value "NEEDS SERVICE COUNSELING" + MoveStatusNEEDSSERVICECOUNSELING MoveStatus = "NEEDS SERVICE COUNSELING" + + // MoveStatusSERVICECOUNSELINGCOMPLETED captures enum value "SERVICE COUNSELING COMPLETED" + MoveStatusSERVICECOUNSELINGCOMPLETED MoveStatus = "SERVICE COUNSELING COMPLETED" + + // MoveStatusSUBMITTED captures enum value "SUBMITTED" + MoveStatusSUBMITTED MoveStatus = "SUBMITTED" + + // MoveStatusAPPROVALSREQUESTED captures enum value "APPROVALS REQUESTED" + MoveStatusAPPROVALSREQUESTED MoveStatus = "APPROVALS REQUESTED" + + // MoveStatusAPPROVED captures enum value "APPROVED" + MoveStatusAPPROVED MoveStatus = "APPROVED" + + // MoveStatusCANCELED captures enum value "CANCELED" + MoveStatusCANCELED MoveStatus = "CANCELED" +) + +// for schema +var moveStatusEnum []interface{} + +func init() { + var res []MoveStatus + if err := json.Unmarshal([]byte(`["DRAFT","NEEDS SERVICE COUNSELING","SERVICE COUNSELING COMPLETED","SUBMITTED","APPROVALS REQUESTED","APPROVED","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveStatusEnum = append(moveStatusEnum, v) + } +} + +func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { + if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this move status +func (m MoveStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMoveStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this move status based on context it is used +func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/move_task_order.go b/pkg/gen/ghcmessages/move_task_order.go new file mode 100644 index 00000000000..ea4cff97ef2 --- /dev/null +++ b/pkg/gen/ghcmessages/move_task_order.go @@ -0,0 +1,431 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveTaskOrder The Move (MoveTaskOrder) +// +// swagger:model MoveTaskOrder +type MoveTaskOrder struct { + + // approved at + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // destination duty location + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + DestinationDutyLocation strfmt.UUID `json:"destinationDutyLocation,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // entitlements + Entitlements *Entitlements `json:"entitlements,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // locator + // Example: 1K43AR + Locator string `json:"locator,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // origin duty location + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + OriginDutyLocation strfmt.UUID `json:"originDutyLocation,omitempty"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate strfmt.Date `json:"requestedPickupDate,omitempty"` + + // service counseling completed at + // Format: date-time + ServiceCounselingCompletedAt *strfmt.DateTime `json:"serviceCounselingCompletedAt,omitempty"` + + // tio remarks + // Example: approved additional weight + TioRemarks *string `json:"tioRemarks,omitempty"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this move task order +func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlements(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := validate.FormatOf("destinationDutyLocation", "body", "uuid", m.DestinationDutyLocation.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateEntitlements(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlements) { // not required + return nil + } + + if m.Entitlements != nil { + if err := m.Entitlements.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlements") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlements") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := validate.FormatOf("originDutyLocation", "body", "uuid", m.OriginDutyLocation.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateServiceCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("serviceCounselingCompletedAt", "body", "date-time", m.ServiceCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move task order based on the context it is used +func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlements(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateEntitlements(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlements != nil { + + if swag.IsZero(m.Entitlements) { // not required + return nil + } + + if err := m.Entitlements.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlements") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlements") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { + var res MoveTaskOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/move_task_orders.go b/pkg/gen/ghcmessages/move_task_orders.go new file mode 100644 index 00000000000..9bd21ca951e --- /dev/null +++ b/pkg/gen/ghcmessages/move_task_orders.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveTaskOrders move task orders +// +// swagger:model MoveTaskOrders +type MoveTaskOrders []*MoveTaskOrder + +// Validate validates this move task orders +func (m MoveTaskOrders) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this move task orders based on the context it is used +func (m MoveTaskOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/moving_expense.go b/pkg/gen/ghcmessages/moving_expense.go new file mode 100644 index 00000000000..2bf92cf68d7 --- /dev/null +++ b/pkg/gen/ghcmessages/moving_expense.go @@ -0,0 +1,674 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MovingExpense Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment. +// +// swagger:model MovingExpense +type MovingExpense struct { + + // The total amount of the expense as indicated on the receipt + Amount *int64 `json:"amount"` + + // Timestamp the moving expense object was initially created in the system (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A brief description of the expense + Description *string `json:"description"` + + // document + // Required: true + Document *Document `json:"document"` + + // The id of the Document that contains all file uploads for this expense + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + DocumentID strfmt.UUID `json:"documentId"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // Unique primary identifier of the Moving Expense object + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Indicates if the service member is missing the receipt with the proof of expense amount + MissingReceipt *bool `json:"missingReceipt"` + + // moving expense type + MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` + + // Indicates if the service member used their government issued card to pay for the expense + PaidWithGtcc *bool `json:"paidWithGtcc"` + + // The PPM Shipment id that this moving expense belongs to + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2018-05-26 + // Format: date + SitEndDate *strfmt.Date `json:"sitEndDate"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The amount of SIT that will be reimbursed + SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` + + // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2022-04-26 + // Format: date + SitStartDate *strfmt.Date `json:"sitStartDate"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Customer submitted total amount of the expense as indicated on the receipt + SubmittedAmount *int64 `json:"submittedAmount"` + + // Customer submitted description of the expense + SubmittedDescription *string `json:"submittedDescription"` + + // submitted moving expense type + SubmittedMovingExpenseType *SubmittedMovingExpenseType `json:"submittedMovingExpenseType"` + + // Customer submitted date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2018-05-26 + // Format: date + SubmittedSitEndDate *strfmt.Date `json:"submittedSitEndDate"` + + // Customer submitted date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2022-04-26 + // Format: date + SubmittedSitStartDate *strfmt.Date `json:"submittedSitStartDate"` + + // Timestamp when a property of this moving expense object was last modified (UTC) + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // The total weight stored in PPM SIT + WeightStored *int64 `json:"weightStored"` +} + +// Validate validates this moving expense +func (m *MovingExpense) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedSitStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovingExpense) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateDocument(formats strfmt.Registry) error { + + if err := validate.Required("document", "body", m.Document); err != nil { + return err + } + + if m.Document != nil { + if err := m.Document.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if m.MovingExpenseType != nil { + if err := m.MovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSubmittedMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedMovingExpenseType) { // not required + return nil + } + + if m.SubmittedMovingExpenseType != nil { + if err := m.SubmittedMovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submittedMovingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submittedMovingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSubmittedSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedSitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("submittedSitEndDate", "body", "date", m.SubmittedSitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateSubmittedSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedSitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("submittedSitStartDate", "body", "date", m.SubmittedSitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this moving expense based on the context it is used +func (m *MovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubmittedMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovingExpense) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.Document != nil { + + if err := m.Document.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.MovingExpenseType != nil { + + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateSubmittedMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.SubmittedMovingExpenseType != nil { + + if swag.IsZero(m.SubmittedMovingExpenseType) { // not required + return nil + } + + if err := m.SubmittedMovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submittedMovingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submittedMovingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovingExpense) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovingExpense) UnmarshalBinary(b []byte) error { + var res MovingExpense + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/moving_expenses.go b/pkg/gen/ghcmessages/moving_expenses.go new file mode 100644 index 00000000000..feffd16ef01 --- /dev/null +++ b/pkg/gen/ghcmessages/moving_expenses.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MovingExpenses All moving expenses associated with a PPM shipment. +// +// swagger:model MovingExpenses +type MovingExpenses []*MovingExpense + +// Validate validates this moving expenses +func (m MovingExpenses) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this moving expenses based on the context it is used +func (m MovingExpenses) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/office_user.go b/pkg/gen/ghcmessages/office_user.go new file mode 100644 index 00000000000..3614d465a18 --- /dev/null +++ b/pkg/gen/ghcmessages/office_user.go @@ -0,0 +1,593 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUser office user +// +// swagger:model OfficeUser +type OfficeUser struct { + + // active + // Required: true + Active *bool `json:"active"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // edipi + // Required: true + Edipi *string `json:"edipi"` + + // email + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email"` + + // first name + // Required: true + FirstName *string `json:"firstName"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // last name + // Required: true + LastName *string `json:"lastName"` + + // middle initials + // Required: true + MiddleInitials *string `json:"middleInitials"` + + // other unique Id + // Required: true + OtherUniqueID *string `json:"otherUniqueId"` + + // rejection reason + // Required: true + RejectionReason *string `json:"rejectionReason"` + + // roles + // Required: true + Roles []*Role `json:"roles"` + + // status + // Required: true + // Enum: [APPROVED REQUESTED REJECTED] + Status *string `json:"status"` + + // telephone + // Required: true + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` + + // transportation office assignments + TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportationOfficeAssignments"` + + // transportation office Id + // Required: true + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // user Id + // Format: uuid + UserID strfmt.UUID `json:"userId,omitempty"` +} + +// Validate validates this office user +func (m *OfficeUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActive(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMiddleInitials(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOtherUniqueID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRejectionReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeAssignments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) validateActive(formats strfmt.Registry) error { + + if err := validate.Required("active", "body", m.Active); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateEdipi(formats strfmt.Registry) error { + + if err := validate.Required("edipi", "body", m.Edipi); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateFirstName(formats strfmt.Registry) error { + + if err := validate.Required("firstName", "body", m.FirstName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateLastName(formats strfmt.Registry) error { + + if err := validate.Required("lastName", "body", m.LastName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateMiddleInitials(formats strfmt.Registry) error { + + if err := validate.Required("middleInitials", "body", m.MiddleInitials); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateOtherUniqueID(formats strfmt.Registry) error { + + if err := validate.Required("otherUniqueId", "body", m.OtherUniqueID); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateRejectionReason(formats strfmt.Registry) error { + + if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateRoles(formats strfmt.Registry) error { + + if err := validate.Required("roles", "body", m.Roles); err != nil { + return err + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +var officeUserTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["APPROVED","REQUESTED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + officeUserTypeStatusPropEnum = append(officeUserTypeStatusPropEnum, v) + } +} + +const ( + + // OfficeUserStatusAPPROVED captures enum value "APPROVED" + OfficeUserStatusAPPROVED string = "APPROVED" + + // OfficeUserStatusREQUESTED captures enum value "REQUESTED" + OfficeUserStatusREQUESTED string = "REQUESTED" + + // OfficeUserStatusREJECTED captures enum value "REJECTED" + OfficeUserStatusREJECTED string = "REJECTED" +) + +// prop value enum +func (m *OfficeUser) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, officeUserTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *OfficeUser) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + // value enum + if err := m.validateStatusEnum("status", "body", *m.Status); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateTelephone(formats strfmt.Registry) error { + + if err := validate.Required("telephone", "body", m.Telephone); err != nil { + return err + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeAssignments) { // not required + return nil + } + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + continue + } + + if m.TransportationOfficeAssignments[i] != nil { + if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) validateTransportationOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("userId", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this office user based on the context it is used +func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + + if m.TransportationOfficeAssignments[i] != nil { + + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + return nil + } + + if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOfficeAssignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUser) UnmarshalBinary(b []byte) error { + var res OfficeUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/office_user_create.go b/pkg/gen/ghcmessages/office_user_create.go new file mode 100644 index 00000000000..fbeab9bf83c --- /dev/null +++ b/pkg/gen/ghcmessages/office_user_create.go @@ -0,0 +1,250 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUserCreate office user create +// +// swagger:model OfficeUserCreate +type OfficeUserCreate struct { + + // EDIPI + // Example: 1234567890 + // Max Length: 10 + Edipi *string `json:"edipi,omitempty"` + + // Email + // Example: user@userdomain.com + // Required: true + Email string `json:"email"` + + // First Name + // Required: true + FirstName string `json:"firstName"` + + // Last Name + // Required: true + LastName string `json:"lastName"` + + // Middle Initials + // Example: L. + MiddleInitials *string `json:"middleInitials,omitempty"` + + // Office user identifier when EDIPI is not available + OtherUniqueID *string `json:"otherUniqueId,omitempty"` + + // roles + // Required: true + Roles []*OfficeUserRole `json:"roles"` + + // telephone + // Example: 212-555-5555 + // Required: true + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone string `json:"telephone"` + + // transportation office Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + TransportationOfficeID strfmt.UUID `json:"transportationOfficeId"` +} + +// Validate validates this office user create +func (m *OfficeUserCreate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserCreate) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.Edipi) { // not required + return nil + } + + if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateEmail(formats strfmt.Registry) error { + + if err := validate.RequiredString("email", "body", m.Email); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateFirstName(formats strfmt.Registry) error { + + if err := validate.RequiredString("firstName", "body", m.FirstName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateLastName(formats strfmt.Registry) error { + + if err := validate.RequiredString("lastName", "body", m.LastName); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateRoles(formats strfmt.Registry) error { + + if err := validate.Required("roles", "body", m.Roles); err != nil { + return err + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUserCreate) validateTelephone(formats strfmt.Registry) error { + + if err := validate.RequiredString("telephone", "body", m.Telephone); err != nil { + return err + } + + if err := validate.Pattern("telephone", "body", m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUserCreate) validateTransportationOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeId", "body", strfmt.UUID(m.TransportationOfficeID)); err != nil { + return err + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this office user create based on the context it is used +func (m *OfficeUserCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUserCreate) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserCreate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserCreate) UnmarshalBinary(b []byte) error { + var res OfficeUserCreate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/office_user_role.go b/pkg/gen/ghcmessages/office_user_role.go new file mode 100644 index 00000000000..391a0388275 --- /dev/null +++ b/pkg/gen/ghcmessages/office_user_role.go @@ -0,0 +1,55 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// OfficeUserRole office user role +// +// swagger:model OfficeUserRole +type OfficeUserRole struct { + + // name + // Example: Task Ordering Officer + Name *string `json:"name,omitempty"` + + // roleType + // Example: task_ordering_officer + RoleType *string `json:"roleType,omitempty"` +} + +// Validate validates this office user role +func (m *OfficeUserRole) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this office user role based on context it is used +func (m *OfficeUserRole) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUserRole) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUserRole) UnmarshalBinary(b []byte) error { + var res OfficeUserRole + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/omittable_moving_expense_type.go b/pkg/gen/ghcmessages/omittable_moving_expense_type.go new file mode 100644 index 00000000000..9ffc820dd57 --- /dev/null +++ b/pkg/gen/ghcmessages/omittable_moving_expense_type.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OmittableMovingExpenseType Moving Expense Type +// +// swagger:model OmittableMovingExpenseType +type OmittableMovingExpenseType string + +func NewOmittableMovingExpenseType(value OmittableMovingExpenseType) *OmittableMovingExpenseType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OmittableMovingExpenseType. +func (m OmittableMovingExpenseType) Pointer() *OmittableMovingExpenseType { + return &m +} + +const ( + + // OmittableMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" + OmittableMovingExpenseTypeCONTRACTEDEXPENSE OmittableMovingExpenseType = "CONTRACTED_EXPENSE" + + // OmittableMovingExpenseTypeGAS captures enum value "GAS" + OmittableMovingExpenseTypeGAS OmittableMovingExpenseType = "GAS" + + // OmittableMovingExpenseTypeOIL captures enum value "OIL" + OmittableMovingExpenseTypeOIL OmittableMovingExpenseType = "OIL" + + // OmittableMovingExpenseTypeOTHER captures enum value "OTHER" + OmittableMovingExpenseTypeOTHER OmittableMovingExpenseType = "OTHER" + + // OmittableMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" + OmittableMovingExpenseTypePACKINGMATERIALS OmittableMovingExpenseType = "PACKING_MATERIALS" + + // OmittableMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" + OmittableMovingExpenseTypeRENTALEQUIPMENT OmittableMovingExpenseType = "RENTAL_EQUIPMENT" + + // OmittableMovingExpenseTypeSTORAGE captures enum value "STORAGE" + OmittableMovingExpenseTypeSTORAGE OmittableMovingExpenseType = "STORAGE" + + // OmittableMovingExpenseTypeTOLLS captures enum value "TOLLS" + OmittableMovingExpenseTypeTOLLS OmittableMovingExpenseType = "TOLLS" + + // OmittableMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" + OmittableMovingExpenseTypeWEIGHINGFEE OmittableMovingExpenseType = "WEIGHING_FEE" +) + +// for schema +var omittableMovingExpenseTypeEnum []interface{} + +func init() { + var res []OmittableMovingExpenseType + if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + omittableMovingExpenseTypeEnum = append(omittableMovingExpenseTypeEnum, v) + } +} + +func (m OmittableMovingExpenseType) validateOmittableMovingExpenseTypeEnum(path, location string, value OmittableMovingExpenseType) error { + if err := validate.EnumCase(path, location, value, omittableMovingExpenseTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this omittable moving expense type +func (m OmittableMovingExpenseType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOmittableMovingExpenseTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this omittable moving expense type based on context it is used +func (m OmittableMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go b/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go new file mode 100644 index 00000000000..8fb701d3ad3 --- /dev/null +++ b/pkg/gen/ghcmessages/omittable_p_p_m_document_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OmittablePPMDocumentStatus Status of the PPM document. +// +// swagger:model OmittablePPMDocumentStatus +type OmittablePPMDocumentStatus string + +func NewOmittablePPMDocumentStatus(value OmittablePPMDocumentStatus) *OmittablePPMDocumentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OmittablePPMDocumentStatus. +func (m OmittablePPMDocumentStatus) Pointer() *OmittablePPMDocumentStatus { + return &m +} + +const ( + + // OmittablePPMDocumentStatusAPPROVED captures enum value "APPROVED" + OmittablePPMDocumentStatusAPPROVED OmittablePPMDocumentStatus = "APPROVED" + + // OmittablePPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" + OmittablePPMDocumentStatusEXCLUDED OmittablePPMDocumentStatus = "EXCLUDED" + + // OmittablePPMDocumentStatusREJECTED captures enum value "REJECTED" + OmittablePPMDocumentStatusREJECTED OmittablePPMDocumentStatus = "REJECTED" +) + +// for schema +var omittablePPMDocumentStatusEnum []interface{} + +func init() { + var res []OmittablePPMDocumentStatus + if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + omittablePPMDocumentStatusEnum = append(omittablePPMDocumentStatusEnum, v) + } +} + +func (m OmittablePPMDocumentStatus) validateOmittablePPMDocumentStatusEnum(path, location string, value OmittablePPMDocumentStatus) error { + if err := validate.EnumCase(path, location, value, omittablePPMDocumentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this omittable p p m document status +func (m OmittablePPMDocumentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOmittablePPMDocumentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this omittable p p m document status based on context it is used +func (m OmittablePPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/order.go b/pkg/gen/ghcmessages/order.go new file mode 100644 index 00000000000..aa655d0aac0 --- /dev/null +++ b/pkg/gen/ghcmessages/order.go @@ -0,0 +1,901 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // agency + Agency *Affiliation `json:"agency,omitempty"` + + // amended orders acknowledged at + // Format: date-time + AmendedOrdersAcknowledgedAt *strfmt.DateTime `json:"amendedOrdersAcknowledgedAt,omitempty"` + + // customer + Customer *Customer `json:"customer,omitempty"` + + // customer ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CustomerID strfmt.UUID `json:"customerID,omitempty"` + + // date issued + // Example: 2020-01-01 + // Format: date + DateIssued strfmt.Date `json:"date_issued,omitempty"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // destination duty location g b l o c + DestinationDutyLocationGBLOC GBLOC `json:"destinationDutyLocationGBLOC,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // entitlement + Entitlement *Entitlements `json:"entitlement,omitempty"` + + // first name + // Example: John + // Read Only: true + FirstName string `json:"first_name,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // Are dependents included in your orders? + // Example: false + HasDependents bool `json:"has_dependents,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Doe + // Read Only: true + LastName string `json:"last_name,omitempty"` + + // method of payment + MethodOfPayment string `json:"methodOfPayment,omitempty"` + + // move code + // Example: H2XFJF + MoveCode string `json:"moveCode,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // naics + Naics string `json:"naics,omitempty"` + + // NTS SAC + // Example: N002214CSW32Y9 + NtsSac *string `json:"ntsSac,omitempty"` + + // NTS TAC + // Example: F8J1 + NtsTac *string `json:"ntsTac,omitempty"` + + // order number + // Example: 030-00362 + OrderNumber *string `json:"order_number,omitempty"` + + // order type + OrderType OrdersType `json:"order_type,omitempty"` + + // order type detail + OrderTypeDetail *OrdersTypeDetail `json:"order_type_detail,omitempty"` + + // orders type + OrdersType OrdersType `json:"orders_type,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin duty location g b l o c + OriginDutyLocationGBLOC GBLOC `json:"originDutyLocationGBLOC,omitempty"` + + // packing and shipping instructions + PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` + + // report by date + // Example: 2020-01-01 + // Format: date + ReportByDate strfmt.Date `json:"report_by_date,omitempty"` + + // SAC + // Example: N002214CSW32Y9 + Sac *string `json:"sac,omitempty"` + + // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? + // Example: false + SpouseHasProGear bool `json:"spouse_has_pro_gear,omitempty"` + + // supply and services cost estimate + SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` + + // TAC + // Example: F8J1 + Tac *string `json:"tac,omitempty"` + + // uploaded amended order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UploadedAmendedOrderID *strfmt.UUID `json:"uploadedAmendedOrderID,omitempty"` + + // uploaded order id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UploadedOrderID strfmt.UUID `json:"uploaded_order_id,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgency(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAmendedOrdersAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateIssued(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocationGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadedAmendedOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadedOrderID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) validateAgency(formats strfmt.Registry) error { + if swag.IsZero(m.Agency) { // not required + return nil + } + + if m.Agency != nil { + if err := m.Agency.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *Order) validateAmendedOrdersAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.AmendedOrdersAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("amendedOrdersAcknowledgedAt", "body", "date-time", m.AmendedOrdersAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) validateCustomerID(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerID) { // not required + return nil + } + + if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDateIssued(formats strfmt.Registry) error { + if swag.IsZero(m.DateIssued) { // not required + return nil + } + + if err := validate.FormatOf("date_issued", "body", "date", m.DateIssued.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateDestinationDutyLocationGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocationGBLOC) { // not required + return nil + } + + if err := m.DestinationDutyLocationGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocationGBLOC") + } + return err + } + + return nil +} + +func (m *Order) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrderType(formats strfmt.Registry) error { + if swag.IsZero(m.OrderType) { // not required + return nil + } + + if err := m.OrderType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order_type") + } + return err + } + + return nil +} + +func (m *Order) validateOrderTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrderTypeDetail) { // not required + return nil + } + + if m.OrderTypeDetail != nil { + if err := m.OrderTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order_type_detail") + } + return err + } + } + + return nil +} + +func (m *Order) validateOrdersType(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + + return nil +} + +func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateOriginDutyLocationGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocationGBLOC) { // not required + return nil + } + + if err := m.OriginDutyLocationGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocationGBLOC") + } + return err + } + + return nil +} + +func (m *Order) validateReportByDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReportByDate) { // not required + return nil + } + + if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateUploadedAmendedOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.UploadedAmendedOrderID) { // not required + return nil + } + + if err := validate.FormatOf("uploadedAmendedOrderID", "body", "uuid", m.UploadedAmendedOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateUploadedOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.UploadedOrderID) { // not required + return nil + } + + if err := validate.FormatOf("uploaded_order_id", "body", "uuid", m.UploadedOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this order based on the context it is used +func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirstName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLastName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrderType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrderTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { + + if m.Agency != nil { + + if swag.IsZero(m.Agency) { // not required + return nil + } + + if err := m.Agency.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.DestinationDutyLocationGBLOC) { // not required + return nil + } + + if err := m.DestinationDutyLocationGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocationGBLOC") + } + return err + } + + return nil +} + +func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateFirstName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "first_name", "body", string(m.FirstName)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateLastName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "last_name", "body", string(m.LastName)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateOrderType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrderType) { // not required + return nil + } + + if err := m.OrderType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order_type") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOrderTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrderTypeDetail != nil { + + if swag.IsZero(m.OrderTypeDetail) { // not required + return nil + } + + if err := m.OrderTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order_type_detail") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OriginDutyLocationGBLOC) { // not required + return nil + } + + if err := m.OriginDutyLocationGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocationGBLOC") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/order_body.go b/pkg/gen/ghcmessages/order_body.go new file mode 100644 index 00000000000..5d972159d61 --- /dev/null +++ b/pkg/gen/ghcmessages/order_body.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OrderBody order body +// +// swagger:model OrderBody +type OrderBody struct { + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` +} + +// Validate validates this order body +func (m *OrderBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OrderBody) 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 +} + +// ContextValidate validates this order body based on context it is used +func (m *OrderBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OrderBody) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OrderBody) UnmarshalBinary(b []byte) error { + var res OrderBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/orders_type.go b/pkg/gen/ghcmessages/orders_type.go new file mode 100644 index 00000000000..13ed0b535c1 --- /dev/null +++ b/pkg/gen/ghcmessages/orders_type.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersType Orders type +// +// swagger:model OrdersType +type OrdersType string + +func NewOrdersType(value OrdersType) *OrdersType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersType. +func (m OrdersType) Pointer() *OrdersType { + return &m +} + +const ( + + // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" + OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" + + // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" + OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" + + // OrdersTypeRETIREMENT captures enum value "RETIREMENT" + OrdersTypeRETIREMENT OrdersType = "RETIREMENT" + + // OrdersTypeSEPARATION captures enum value "SEPARATION" + OrdersTypeSEPARATION OrdersType = "SEPARATION" + + // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" + OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" + + // OrdersTypeBLUEBARK captures enum value "BLUEBARK" + OrdersTypeBLUEBARK OrdersType = "BLUEBARK" + + // OrdersTypeSAFETY captures enum value "SAFETY" + OrdersTypeSAFETY OrdersType = "SAFETY" + + // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" + OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" + + // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" + OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" + + // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" + OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" +) + +// for schema +var ordersTypeEnum []interface{} + +func init() { + var res []OrdersType + if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeEnum = append(ordersTypeEnum, v) + } +} + +func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { + if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type +func (m OrdersType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type based on context it is used +func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/orders_type_detail.go b/pkg/gen/ghcmessages/orders_type_detail.go new file mode 100644 index 00000000000..985b73f0e61 --- /dev/null +++ b/pkg/gen/ghcmessages/orders_type_detail.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersTypeDetail Orders type detail +// +// swagger:model OrdersTypeDetail +type OrdersTypeDetail string + +func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. +func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { + return &m +} + +const ( + + // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" + OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" + + // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" + OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" + + // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" + OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" + + // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" + OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" + + // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" + OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" + + // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" + OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" + + // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" + OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" +) + +// for schema +var ordersTypeDetailEnum []interface{} + +func init() { + var res []OrdersTypeDetail + if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) + } +} + +func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { + if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type detail +func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type detail based on context it is used +func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_actual_weight.go b/pkg/gen/ghcmessages/p_p_m_actual_weight.go new file mode 100644 index 00000000000..3e3e871f897 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_actual_weight.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMActualWeight The actual net weight of a single PPM shipment. Used during document review for PPM closeout. +// +// swagger:model PPMActualWeight +type PPMActualWeight struct { + + // actual weight + // Example: 2000 + // Required: true + ActualWeight *int64 `json:"actualWeight"` +} + +// Validate validates this p p m actual weight +func (m *PPMActualWeight) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMActualWeight) validateActualWeight(formats strfmt.Registry) error { + + if err := validate.Required("actualWeight", "body", m.ActualWeight); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this p p m actual weight based on context it is used +func (m *PPMActualWeight) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PPMActualWeight) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMActualWeight) UnmarshalBinary(b []byte) error { + var res PPMActualWeight + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_advance_status.go b/pkg/gen/ghcmessages/p_p_m_advance_status.go new file mode 100644 index 00000000000..6cacf489a30 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_advance_status.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMAdvanceStatus PPM Advance Status +// +// # Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received +// +// swagger:model PPMAdvanceStatus +type PPMAdvanceStatus string + +func NewPPMAdvanceStatus(value PPMAdvanceStatus) *PPMAdvanceStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMAdvanceStatus. +func (m PPMAdvanceStatus) Pointer() *PPMAdvanceStatus { + return &m +} + +const ( + + // PPMAdvanceStatusAPPROVED captures enum value "APPROVED" + PPMAdvanceStatusAPPROVED PPMAdvanceStatus = "APPROVED" + + // PPMAdvanceStatusREJECTED captures enum value "REJECTED" + PPMAdvanceStatusREJECTED PPMAdvanceStatus = "REJECTED" + + // PPMAdvanceStatusEDITED captures enum value "EDITED" + PPMAdvanceStatusEDITED PPMAdvanceStatus = "EDITED" + + // PPMAdvanceStatusRECEIVED captures enum value "RECEIVED" + PPMAdvanceStatusRECEIVED PPMAdvanceStatus = "RECEIVED" + + // PPMAdvanceStatusNOTRECEIVED captures enum value "NOT_RECEIVED" + PPMAdvanceStatusNOTRECEIVED PPMAdvanceStatus = "NOT_RECEIVED" +) + +// for schema +var pPMAdvanceStatusEnum []interface{} + +func init() { + var res []PPMAdvanceStatus + if err := json.Unmarshal([]byte(`["APPROVED","REJECTED","EDITED","RECEIVED","NOT_RECEIVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMAdvanceStatusEnum = append(pPMAdvanceStatusEnum, v) + } +} + +func (m PPMAdvanceStatus) validatePPMAdvanceStatusEnum(path, location string, value PPMAdvanceStatus) error { + if err := validate.EnumCase(path, location, value, pPMAdvanceStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m advance status +func (m PPMAdvanceStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMAdvanceStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this p p m advance status based on context it is used +func (m PPMAdvanceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_closeout.go b/pkg/gen/ghcmessages/p_p_m_closeout.go new file mode 100644 index 00000000000..b0f423ba61a --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_closeout.go @@ -0,0 +1,225 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMCloseout The calculations needed in the "Review Documents" section of a PPM closeout. LIst of all expenses/reimbursements related toa PPM shipment. +// +// swagger:model PPMCloseout +type PPMCloseout struct { + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SITReimbursement *int64 `json:"SITReimbursement"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // actual weight + // Example: 2000 + ActualWeight *int64 `json:"actualWeight"` + + // Advance Operating Allowance (AOA). + Aoa *int64 `json:"aoa"` + + // The Domestic Destination Price (DDP). + Ddp *int64 `json:"ddp"` + + // The Domestic Origin Price (DOP). + Dop *int64 `json:"dop"` + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // GCC + // + // Government Constructive Cost (GCC) + Gcc *int64 `json:"gcc"` + + // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. + // + // Read Only: true + GrossIncentive *int64 `json:"grossIncentive"` + + // The linehaul/shorthaul Fuel Surcharge (FSC). + HaulFSC *int64 `json:"haulFSC"` + + // The price of the linehaul or shorthaul. + HaulPrice *int64 `json:"haulPrice"` + + // The type of haul calculation used for this shipment (shorthaul or linehaul). + HaulType *string `json:"haulType"` + + // Primary auto-generated unique identifier of the PPM shipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // The distance between the old address and the new address in miles. + // Example: 54 + // Minimum: 0 + Miles *int64 `json:"miles"` + + // The full price of all packing/unpacking services. + PackPrice *int64 `json:"packPrice"` + + // Date the customer expects to begin their move. + // + // Format: date + PlannedMoveDate *strfmt.Date `json:"plannedMoveDate"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeightCustomer *int64 `json:"proGearWeightCustomer"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + ProGearWeightSpouse *int64 `json:"proGearWeightSpouse"` + + // The remaining reimbursement amount that is still owed to the customer. + RemainingIncentive *int64 `json:"remainingIncentive"` + + // The full price of all packing/unpacking services. + UnpackPrice *int64 `json:"unpackPrice"` +} + +// Validate validates this p p m closeout +func (m *PPMCloseout) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMiles(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePlannedMoveDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMCloseout) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMCloseout) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMCloseout) validateMiles(formats strfmt.Registry) error { + if swag.IsZero(m.Miles) { // not required + return nil + } + + if err := validate.MinimumInt("miles", "body", *m.Miles, 0, false); err != nil { + return err + } + + return nil +} + +func (m *PPMCloseout) validatePlannedMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.PlannedMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("plannedMoveDate", "body", "date", m.PlannedMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m closeout based on the context it is used +func (m *PPMCloseout) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGrossIncentive(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMCloseout) contextValidateGrossIncentive(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "grossIncentive", "body", m.GrossIncentive); err != nil { + return err + } + + return nil +} + +func (m *PPMCloseout) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMCloseout) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMCloseout) UnmarshalBinary(b []byte) error { + var res PPMCloseout + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_destination_address.go b/pkg/gen/ghcmessages/p_p_m_destination_address.go new file mode 100644 index 00000000000..4a74a91bb81 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_destination_address.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMDestinationAddress A postal address +// +// swagger:model PPMDestinationAddress +type PPMDestinationAddress struct { + + // City + // Example: Anytown + // Required: true + City *string `json:"city"` + + // Country + // Example: USA + Country *string `json:"country,omitempty"` + + // County + // Example: LOS ANGELES + County *string `json:"county,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // ZIP + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + PostalCode *string `json:"postalCode"` + + // State + // Required: true + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State *string `json:"state"` + + // Street address 1 + // Example: 123 Main Ave + StreetAddress1 *string `json:"streetAddress1,omitempty"` + + // Street address 2 + // Example: Apartment 9000 + StreetAddress2 *string `json:"streetAddress2,omitempty"` + + // Address Line 3 + // Example: Montmârtre + StreetAddress3 *string `json:"streetAddress3,omitempty"` + + // us post region cities ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` +} + +// Validate validates this p p m destination address +func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsPostRegionCitiesID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { + + if err := validate.Required("city", "body", m.City); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { + + if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { + return err + } + + if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +var pPMDestinationAddressTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) + } +} + +const ( + + // PPMDestinationAddressStateAL captures enum value "AL" + PPMDestinationAddressStateAL string = "AL" + + // PPMDestinationAddressStateAK captures enum value "AK" + PPMDestinationAddressStateAK string = "AK" + + // PPMDestinationAddressStateAR captures enum value "AR" + PPMDestinationAddressStateAR string = "AR" + + // PPMDestinationAddressStateAZ captures enum value "AZ" + PPMDestinationAddressStateAZ string = "AZ" + + // PPMDestinationAddressStateCA captures enum value "CA" + PPMDestinationAddressStateCA string = "CA" + + // PPMDestinationAddressStateCO captures enum value "CO" + PPMDestinationAddressStateCO string = "CO" + + // PPMDestinationAddressStateCT captures enum value "CT" + PPMDestinationAddressStateCT string = "CT" + + // PPMDestinationAddressStateDC captures enum value "DC" + PPMDestinationAddressStateDC string = "DC" + + // PPMDestinationAddressStateDE captures enum value "DE" + PPMDestinationAddressStateDE string = "DE" + + // PPMDestinationAddressStateFL captures enum value "FL" + PPMDestinationAddressStateFL string = "FL" + + // PPMDestinationAddressStateGA captures enum value "GA" + PPMDestinationAddressStateGA string = "GA" + + // PPMDestinationAddressStateHI captures enum value "HI" + PPMDestinationAddressStateHI string = "HI" + + // PPMDestinationAddressStateIA captures enum value "IA" + PPMDestinationAddressStateIA string = "IA" + + // PPMDestinationAddressStateID captures enum value "ID" + PPMDestinationAddressStateID string = "ID" + + // PPMDestinationAddressStateIL captures enum value "IL" + PPMDestinationAddressStateIL string = "IL" + + // PPMDestinationAddressStateIN captures enum value "IN" + PPMDestinationAddressStateIN string = "IN" + + // PPMDestinationAddressStateKS captures enum value "KS" + PPMDestinationAddressStateKS string = "KS" + + // PPMDestinationAddressStateKY captures enum value "KY" + PPMDestinationAddressStateKY string = "KY" + + // PPMDestinationAddressStateLA captures enum value "LA" + PPMDestinationAddressStateLA string = "LA" + + // PPMDestinationAddressStateMA captures enum value "MA" + PPMDestinationAddressStateMA string = "MA" + + // PPMDestinationAddressStateMD captures enum value "MD" + PPMDestinationAddressStateMD string = "MD" + + // PPMDestinationAddressStateME captures enum value "ME" + PPMDestinationAddressStateME string = "ME" + + // PPMDestinationAddressStateMI captures enum value "MI" + PPMDestinationAddressStateMI string = "MI" + + // PPMDestinationAddressStateMN captures enum value "MN" + PPMDestinationAddressStateMN string = "MN" + + // PPMDestinationAddressStateMO captures enum value "MO" + PPMDestinationAddressStateMO string = "MO" + + // PPMDestinationAddressStateMS captures enum value "MS" + PPMDestinationAddressStateMS string = "MS" + + // PPMDestinationAddressStateMT captures enum value "MT" + PPMDestinationAddressStateMT string = "MT" + + // PPMDestinationAddressStateNC captures enum value "NC" + PPMDestinationAddressStateNC string = "NC" + + // PPMDestinationAddressStateND captures enum value "ND" + PPMDestinationAddressStateND string = "ND" + + // PPMDestinationAddressStateNE captures enum value "NE" + PPMDestinationAddressStateNE string = "NE" + + // PPMDestinationAddressStateNH captures enum value "NH" + PPMDestinationAddressStateNH string = "NH" + + // PPMDestinationAddressStateNJ captures enum value "NJ" + PPMDestinationAddressStateNJ string = "NJ" + + // PPMDestinationAddressStateNM captures enum value "NM" + PPMDestinationAddressStateNM string = "NM" + + // PPMDestinationAddressStateNV captures enum value "NV" + PPMDestinationAddressStateNV string = "NV" + + // PPMDestinationAddressStateNY captures enum value "NY" + PPMDestinationAddressStateNY string = "NY" + + // PPMDestinationAddressStateOH captures enum value "OH" + PPMDestinationAddressStateOH string = "OH" + + // PPMDestinationAddressStateOK captures enum value "OK" + PPMDestinationAddressStateOK string = "OK" + + // PPMDestinationAddressStateOR captures enum value "OR" + PPMDestinationAddressStateOR string = "OR" + + // PPMDestinationAddressStatePA captures enum value "PA" + PPMDestinationAddressStatePA string = "PA" + + // PPMDestinationAddressStateRI captures enum value "RI" + PPMDestinationAddressStateRI string = "RI" + + // PPMDestinationAddressStateSC captures enum value "SC" + PPMDestinationAddressStateSC string = "SC" + + // PPMDestinationAddressStateSD captures enum value "SD" + PPMDestinationAddressStateSD string = "SD" + + // PPMDestinationAddressStateTN captures enum value "TN" + PPMDestinationAddressStateTN string = "TN" + + // PPMDestinationAddressStateTX captures enum value "TX" + PPMDestinationAddressStateTX string = "TX" + + // PPMDestinationAddressStateUT captures enum value "UT" + PPMDestinationAddressStateUT string = "UT" + + // PPMDestinationAddressStateVA captures enum value "VA" + PPMDestinationAddressStateVA string = "VA" + + // PPMDestinationAddressStateVT captures enum value "VT" + PPMDestinationAddressStateVT string = "VT" + + // PPMDestinationAddressStateWA captures enum value "WA" + PPMDestinationAddressStateWA string = "WA" + + // PPMDestinationAddressStateWI captures enum value "WI" + PPMDestinationAddressStateWI string = "WI" + + // PPMDestinationAddressStateWV captures enum value "WV" + PPMDestinationAddressStateWV string = "WV" + + // PPMDestinationAddressStateWY captures enum value "WY" + PPMDestinationAddressStateWY string = "WY" +) + +// prop value enum +func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + // value enum + if err := m.validateStateEnum("state", "body", *m.State); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { + if swag.IsZero(m.UsPostRegionCitiesID) { // not required + return nil + } + + if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m destination address based on the context it is used +func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { + var res PPMDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_document_status.go b/pkg/gen/ghcmessages/p_p_m_document_status.go new file mode 100644 index 00000000000..66d4f937af8 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_document_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMDocumentStatus Status of the PPM document. +// +// swagger:model PPMDocumentStatus +type PPMDocumentStatus string + +func NewPPMDocumentStatus(value PPMDocumentStatus) *PPMDocumentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMDocumentStatus. +func (m PPMDocumentStatus) Pointer() *PPMDocumentStatus { + return &m +} + +const ( + + // PPMDocumentStatusAPPROVED captures enum value "APPROVED" + PPMDocumentStatusAPPROVED PPMDocumentStatus = "APPROVED" + + // PPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" + PPMDocumentStatusEXCLUDED PPMDocumentStatus = "EXCLUDED" + + // PPMDocumentStatusREJECTED captures enum value "REJECTED" + PPMDocumentStatusREJECTED PPMDocumentStatus = "REJECTED" +) + +// for schema +var pPMDocumentStatusEnum []interface{} + +func init() { + var res []PPMDocumentStatus + if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMDocumentStatusEnum = append(pPMDocumentStatusEnum, v) + } +} + +func (m PPMDocumentStatus) validatePPMDocumentStatusEnum(path, location string, value PPMDocumentStatus) error { + if err := validate.EnumCase(path, location, value, pPMDocumentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m document status +func (m PPMDocumentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMDocumentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this p p m document status based on context it is used +func (m PPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_document_status_reason.go b/pkg/gen/ghcmessages/p_p_m_document_status_reason.go new file mode 100644 index 00000000000..4ee8a9cb264 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_document_status_reason.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// PPMDocumentStatusReason The reason the services counselor has excluded or rejected the item. +// +// swagger:model PPMDocumentStatusReason +type PPMDocumentStatusReason string + +// Validate validates this p p m document status reason +func (m PPMDocumentStatusReason) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this p p m document status reason based on context it is used +func (m PPMDocumentStatusReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_documents.go b/pkg/gen/ghcmessages/p_p_m_documents.go new file mode 100644 index 00000000000..64e76938ca2 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_documents.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PPMDocuments All documents associated with a PPM shipment, including weight tickets, progear weight tickets, and moving expenses. +// +// swagger:model PPMDocuments +type PPMDocuments struct { + + // moving expenses + MovingExpenses MovingExpenses `json:"MovingExpenses"` + + // pro gear weight tickets + ProGearWeightTickets ProGearWeightTickets `json:"ProGearWeightTickets"` + + // weight tickets + WeightTickets WeightTickets `json:"WeightTickets"` +} + +// Validate validates this p p m documents +func (m *PPMDocuments) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMovingExpenses(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightTickets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTickets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDocuments) validateMovingExpenses(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenses) { // not required + return nil + } + + if err := m.MovingExpenses.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("MovingExpenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("MovingExpenses") + } + return err + } + + return nil +} + +func (m *PPMDocuments) validateProGearWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeightTickets) { // not required + return nil + } + + if err := m.ProGearWeightTickets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ProGearWeightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ProGearWeightTickets") + } + return err + } + + return nil +} + +func (m *PPMDocuments) validateWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTickets) { // not required + return nil + } + + if err := m.WeightTickets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("WeightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("WeightTickets") + } + return err + } + + return nil +} + +// ContextValidate validate this p p m documents based on the context it is used +func (m *PPMDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDocuments) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MovingExpenses.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("MovingExpenses") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("MovingExpenses") + } + return err + } + + return nil +} + +func (m *PPMDocuments) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProGearWeightTickets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ProGearWeightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ProGearWeightTickets") + } + return err + } + + return nil +} + +func (m *PPMDocuments) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("WeightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("WeightTickets") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMDocuments) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMDocuments) UnmarshalBinary(b []byte) error { + var res PPMDocuments + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go b/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go new file mode 100644 index 00000000000..6fe30dab21a --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_s_i_t_estimated_cost.go @@ -0,0 +1,335 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMSITEstimatedCost The estimated cost of SIT for a single PPM shipment. Used during document review for PPM. +// +// swagger:model PPMSITEstimatedCost +type PPMSITEstimatedCost struct { + + // params additional day s i t + ParamsAdditionalDaySIT *PPMSITEstimatedCostParamsAdditionalDaySIT `json:"paramsAdditionalDaySIT,omitempty"` + + // params first day s i t + ParamsFirstDaySIT *PPMSITEstimatedCostParamsFirstDaySIT `json:"paramsFirstDaySIT,omitempty"` + + // Price of an additional day in SIT + // Example: 2000 + // Required: true + PriceAdditionalDaySIT *int64 `json:"priceAdditionalDaySIT"` + + // Price of the first day in SIT + // Example: 2000 + // Required: true + PriceFirstDaySIT *int64 `json:"priceFirstDaySIT"` + + // sit cost + // Example: 2000 + // Required: true + SitCost *int64 `json:"sitCost"` +} + +// Validate validates this p p m s i t estimated cost +func (m *PPMSITEstimatedCost) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateParamsAdditionalDaySIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParamsFirstDaySIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriceAdditionalDaySIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePriceFirstDaySIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCost(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMSITEstimatedCost) validateParamsAdditionalDaySIT(formats strfmt.Registry) error { + if swag.IsZero(m.ParamsAdditionalDaySIT) { // not required + return nil + } + + if m.ParamsAdditionalDaySIT != nil { + if err := m.ParamsAdditionalDaySIT.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paramsAdditionalDaySIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paramsAdditionalDaySIT") + } + return err + } + } + + return nil +} + +func (m *PPMSITEstimatedCost) validateParamsFirstDaySIT(formats strfmt.Registry) error { + if swag.IsZero(m.ParamsFirstDaySIT) { // not required + return nil + } + + if m.ParamsFirstDaySIT != nil { + if err := m.ParamsFirstDaySIT.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paramsFirstDaySIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paramsFirstDaySIT") + } + return err + } + } + + return nil +} + +func (m *PPMSITEstimatedCost) validatePriceAdditionalDaySIT(formats strfmt.Registry) error { + + if err := validate.Required("priceAdditionalDaySIT", "body", m.PriceAdditionalDaySIT); err != nil { + return err + } + + return nil +} + +func (m *PPMSITEstimatedCost) validatePriceFirstDaySIT(formats strfmt.Registry) error { + + if err := validate.Required("priceFirstDaySIT", "body", m.PriceFirstDaySIT); err != nil { + return err + } + + return nil +} + +func (m *PPMSITEstimatedCost) validateSitCost(formats strfmt.Registry) error { + + if err := validate.Required("sitCost", "body", m.SitCost); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m s i t estimated cost based on the context it is used +func (m *PPMSITEstimatedCost) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateParamsAdditionalDaySIT(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParamsFirstDaySIT(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMSITEstimatedCost) contextValidateParamsAdditionalDaySIT(ctx context.Context, formats strfmt.Registry) error { + + if m.ParamsAdditionalDaySIT != nil { + + if swag.IsZero(m.ParamsAdditionalDaySIT) { // not required + return nil + } + + if err := m.ParamsAdditionalDaySIT.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paramsAdditionalDaySIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paramsAdditionalDaySIT") + } + return err + } + } + + return nil +} + +func (m *PPMSITEstimatedCost) contextValidateParamsFirstDaySIT(ctx context.Context, formats strfmt.Registry) error { + + if m.ParamsFirstDaySIT != nil { + + if swag.IsZero(m.ParamsFirstDaySIT) { // not required + return nil + } + + if err := m.ParamsFirstDaySIT.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paramsFirstDaySIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paramsFirstDaySIT") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMSITEstimatedCost) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMSITEstimatedCost) UnmarshalBinary(b []byte) error { + var res PPMSITEstimatedCost + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PPMSITEstimatedCostParamsAdditionalDaySIT p p m s i t estimated cost params additional day s i t +// +// swagger:model PPMSITEstimatedCostParamsAdditionalDaySIT +type PPMSITEstimatedCostParamsAdditionalDaySIT struct { + + // contract year name + // Example: Award Term 1 + ContractYearName string `json:"contractYearName,omitempty"` + + // escalation compounded + // Example: 1.01 + EscalationCompounded string `json:"escalationCompounded,omitempty"` + + // is peak + // Example: true + IsPeak string `json:"isPeak,omitempty"` + + // number days s i t + // Example: 30 + NumberDaysSIT *string `json:"numberDaysSIT,omitempty"` + + // price rate or factor + // Example: 0.53 + PriceRateOrFactor string `json:"priceRateOrFactor,omitempty"` + + // service area destination + // Example: 252 + ServiceAreaDestination *string `json:"serviceAreaDestination,omitempty"` + + // service area origin + // Example: 252 + ServiceAreaOrigin *string `json:"serviceAreaOrigin,omitempty"` +} + +// Validate validates this p p m s i t estimated cost params additional day s i t +func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this p p m s i t estimated cost params additional day s i t based on context it is used +func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMSITEstimatedCostParamsAdditionalDaySIT) UnmarshalBinary(b []byte) error { + var res PPMSITEstimatedCostParamsAdditionalDaySIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// PPMSITEstimatedCostParamsFirstDaySIT p p m s i t estimated cost params first day s i t +// +// swagger:model PPMSITEstimatedCostParamsFirstDaySIT +type PPMSITEstimatedCostParamsFirstDaySIT struct { + + // contract year name + // Example: Award Term 1 + ContractYearName string `json:"contractYearName,omitempty"` + + // escalation compounded + // Example: 1.01 + EscalationCompounded string `json:"escalationCompounded,omitempty"` + + // is peak + // Example: true + IsPeak string `json:"isPeak,omitempty"` + + // price rate or factor + // Example: 20.53 + PriceRateOrFactor string `json:"priceRateOrFactor,omitempty"` + + // service area destination + // Example: 252 + ServiceAreaDestination *string `json:"serviceAreaDestination,omitempty"` + + // service area origin + // Example: 252 + ServiceAreaOrigin *string `json:"serviceAreaOrigin,omitempty"` +} + +// Validate validates this p p m s i t estimated cost params first day s i t +func (m *PPMSITEstimatedCostParamsFirstDaySIT) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this p p m s i t estimated cost params first day s i t based on context it is used +func (m *PPMSITEstimatedCostParamsFirstDaySIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PPMSITEstimatedCostParamsFirstDaySIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMSITEstimatedCostParamsFirstDaySIT) UnmarshalBinary(b []byte) error { + var res PPMSITEstimatedCostParamsFirstDaySIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment.go b/pkg/gen/ghcmessages/p_p_m_shipment.go new file mode 100644 index 00000000000..3b563ef0515 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_shipment.go @@ -0,0 +1,1264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment +type PPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // advance status + AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` + + // The allowable weight of the PPM shipment goods being moved. + // Example: 4300 + // Minimum: 0 + AllowableWeight *int64 `json:"allowableWeight"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // Timestamp of when the PPM Shipment was initially created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin their move. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. + // + // Read Only: true + FinalIncentive *int64 `json:"finalIncentive"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Primary auto-generated unique identifier of the PPM shipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + MaxIncentive *int64 `json:"maxIncentive"` + + // All expense documentation receipt records of this PPM shipment. + MovingExpenses []*MovingExpense `json:"movingExpenses"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeight *int64 `json:"proGearWeight"` + + // All pro-gear weight ticket documentation records for this PPM shipment. + ProGearWeightTickets []*ProGearWeightTicket `json:"proGearWeightTickets"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // secondary destination address + SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // The id of the parent MTOShipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // signed certification + SignedCertification *SignedCertification `json:"signedCertification,omitempty"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // tertiary destination address + TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // w2 address + W2Address *Address `json:"w2Address,omitempty"` + + // weight tickets + WeightTickets WeightTickets `json:"weightTickets"` +} + +// Validate validates this p p m shipment +func (m *PPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAdvanceStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAllowableWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenses(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightTickets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignedCertification(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateW2Address(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTickets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if m.AdvanceStatus != nil { + if err := m.AdvanceStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateAllowableWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AllowableWeight) { // not required + return nil + } + + if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateMovingExpenses(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenses) { // not required + return nil + } + + for i := 0; i < len(m.MovingExpenses); i++ { + if swag.IsZero(m.MovingExpenses[i]) { // not required + continue + } + + if m.MovingExpenses[i] != nil { + if err := m.MovingExpenses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeightTickets) { // not required + return nil + } + + for i := 0; i < len(m.ProGearWeightTickets); i++ { + if swag.IsZero(m.ProGearWeightTickets[i]) { // not required + continue + } + + if m.ProGearWeightTickets[i] != nil { + if err := m.ProGearWeightTickets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if m.SecondaryDestinationAddress != nil { + if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSignedCertification(formats strfmt.Registry) error { + if swag.IsZero(m.SignedCertification) { // not required + return nil + } + + if m.SignedCertification != nil { + if err := m.SignedCertification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signedCertification") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signedCertification") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if m.TertiaryDestinationAddress != nil { + if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateW2Address(formats strfmt.Registry) error { + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if m.W2Address != nil { + if err := m.W2Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTickets) { // not required + return nil + } + + if err := m.WeightTickets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weightTickets") + } + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment based on the context it is used +func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSignedCertification(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateW2Address(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.AdvanceStatus != nil { + + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MovingExpenses); i++ { + + if m.MovingExpenses[i] != nil { + + if swag.IsZero(m.MovingExpenses[i]) { // not required + return nil + } + + if err := m.MovingExpenses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ProGearWeightTickets); i++ { + + if m.ProGearWeightTickets[i] != nil { + + if swag.IsZero(m.ProGearWeightTickets[i]) { // not required + return nil + } + + if err := m.ProGearWeightTickets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDestinationAddress != nil { + + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateSignedCertification(ctx context.Context, formats strfmt.Registry) error { + + if m.SignedCertification != nil { + + if swag.IsZero(m.SignedCertification) { // not required + return nil + } + + if err := m.SignedCertification.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signedCertification") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signedCertification") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDestinationAddress != nil { + + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { + + if m.W2Address != nil { + + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if err := m.W2Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weightTickets") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment) UnmarshalBinary(b []byte) error { + var res PPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go b/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go new file mode 100644 index 00000000000..27da00c881f --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_shipment_s_i_t.go @@ -0,0 +1,146 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipmentSIT SIT related items for a PPM shipment +// +// swagger:model PPMShipmentSIT +type PPMShipmentSIT struct { + + // sit location + // Required: true + SitLocation *SITLocationType `json:"sitLocation"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this p p m shipment s i t +func (m *PPMShipmentSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipmentSIT) validateSitLocation(formats strfmt.Registry) error { + + if err := validate.Required("sitLocation", "body", m.SitLocation); err != nil { + return err + } + + if err := validate.Required("sitLocation", "body", m.SitLocation); err != nil { + return err + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipmentSIT) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment s i t based on the context it is used +func (m *PPMShipmentSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipmentSIT) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipmentSIT) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipmentSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipmentSIT) UnmarshalBinary(b []byte) error { + var res PPMShipmentSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_shipment_status.go b/pkg/gen/ghcmessages/p_p_m_shipment_status.go new file mode 100644 index 00000000000..c0c00accade --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_shipment_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMShipmentStatus Status of the PPM Shipment: +// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. +// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. +// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. +// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. +// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. +// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. +// +// swagger:model PPMShipmentStatus +type PPMShipmentStatus string + +func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. +func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { + return &m +} + +const ( + + // PPMShipmentStatusDRAFT captures enum value "DRAFT" + PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" + + // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" + PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" + + // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" + + // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" + + // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" + + // PPMShipmentStatusCANCELED captures enum value "CANCELED" + PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" +) + +// for schema +var pPMShipmentStatusEnum []interface{} + +func init() { + var res []PPMShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) + } +} + +func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { + if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m shipment status +func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p p m shipment status based on the context it is used +func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/p_p_m_status.go b/pkg/gen/ghcmessages/p_p_m_status.go new file mode 100644 index 00000000000..720b370a8d3 --- /dev/null +++ b/pkg/gen/ghcmessages/p_p_m_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMStatus p p m status +// +// swagger:model PPMStatus +type PPMStatus string + +func NewPPMStatus(value PPMStatus) *PPMStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMStatus. +func (m PPMStatus) Pointer() *PPMStatus { + return &m +} + +const ( + + // PPMStatusCANCELED captures enum value "CANCELED" + PPMStatusCANCELED PPMStatus = "CANCELED" + + // PPMStatusDRAFT captures enum value "DRAFT" + PPMStatusDRAFT PPMStatus = "DRAFT" + + // PPMStatusSUBMITTED captures enum value "SUBMITTED" + PPMStatusSUBMITTED PPMStatus = "SUBMITTED" + + // PPMStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMStatusWAITINGONCUSTOMER PPMStatus = "WAITING_ON_CUSTOMER" + + // PPMStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMStatusNEEDSADVANCEAPPROVAL PPMStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMStatusNEEDSCLOSEOUT PPMStatus = "NEEDS_CLOSEOUT" + + // PPMStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMStatusCLOSEOUTCOMPLETE PPMStatus = "CLOSEOUT_COMPLETE" + + // PPMStatusCOMPLETED captures enum value "COMPLETED" + PPMStatusCOMPLETED PPMStatus = "COMPLETED" +) + +// for schema +var pPMStatusEnum []interface{} + +func init() { + var res []PPMStatus + if err := json.Unmarshal([]byte(`["CANCELED","DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","COMPLETED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMStatusEnum = append(pPMStatusEnum, v) + } +} + +func (m PPMStatus) validatePPMStatusEnum(path, location string, value PPMStatus) error { + if err := validate.EnumCase(path, location, value, pPMStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m status +func (m PPMStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this p p m status based on context it is used +func (m PPMStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/p_w_s_violation.go b/pkg/gen/ghcmessages/p_w_s_violation.go new file mode 100644 index 00000000000..321e02d0ea9 --- /dev/null +++ b/pkg/gen/ghcmessages/p_w_s_violation.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PWSViolation A PWS violation for an evaluation report +// +// swagger:model PWSViolation +type PWSViolation struct { + + // additional data elem + // Example: QAE Observed Delivery Date + AdditionalDataElem string `json:"additionalDataElem,omitempty"` + + // category + // Example: Pre-Move Services + Category string `json:"category,omitempty"` + + // display order + // Example: 3 + DisplayOrder int64 `json:"displayOrder,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is kpi + // Example: false + IsKpi bool `json:"isKpi,omitempty"` + + // paragraph number + // Example: 1.2.3.4.5 + ParagraphNumber string `json:"paragraphNumber,omitempty"` + + // requirement statement + // Example: The contractor shall prepare and load property going into NTS in containers at residence for shipment to NTS. + RequirementStatement string `json:"requirementStatement,omitempty"` + + // requirement summary + // Example: Provide a single point of contact (POC) + RequirementSummary string `json:"requirementSummary,omitempty"` + + // sub category + // Example: Weight Estimate + SubCategory string `json:"subCategory,omitempty"` + + // title + // Example: Customer Support + Title string `json:"title,omitempty"` +} + +// Validate validates this p w s violation +func (m *PWSViolation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PWSViolation) 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 +} + +// ContextValidate validate this p w s violation based on the context it is used +func (m *PWSViolation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *PWSViolation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PWSViolation) UnmarshalBinary(b []byte) error { + var res PWSViolation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/p_w_s_violations.go b/pkg/gen/ghcmessages/p_w_s_violations.go new file mode 100644 index 00000000000..e06fd5c227f --- /dev/null +++ b/pkg/gen/ghcmessages/p_w_s_violations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PWSViolations p w s violations +// +// swagger:model PWSViolations +type PWSViolations []*PWSViolation + +// Validate validates this p w s violations +func (m PWSViolations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p w s violations based on the context it is used +func (m PWSViolations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go b/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go new file mode 100644 index 00000000000..311df9797d8 --- /dev/null +++ b/pkg/gen/ghcmessages/patch_m_t_o_service_item_status_payload.go @@ -0,0 +1,112 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PatchMTOServiceItemStatusPayload patch m t o service item status payload +// +// swagger:model PatchMTOServiceItemStatusPayload +type PatchMTOServiceItemStatusPayload struct { + + // Reason the service item was rejected + // Example: Insufficent details provided + RejectionReason *string `json:"rejectionReason,omitempty"` + + // Describes all statuses for a MTOServiceItem + // Enum: [SUBMITTED APPROVED REJECTED] + Status string `json:"status,omitempty"` +} + +// Validate validates this patch m t o service item status payload +func (m *PatchMTOServiceItemStatusPayload) 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 +} + +var patchMTOServiceItemStatusPayloadTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + patchMTOServiceItemStatusPayloadTypeStatusPropEnum = append(patchMTOServiceItemStatusPayloadTypeStatusPropEnum, v) + } +} + +const ( + + // PatchMTOServiceItemStatusPayloadStatusSUBMITTED captures enum value "SUBMITTED" + PatchMTOServiceItemStatusPayloadStatusSUBMITTED string = "SUBMITTED" + + // PatchMTOServiceItemStatusPayloadStatusAPPROVED captures enum value "APPROVED" + PatchMTOServiceItemStatusPayloadStatusAPPROVED string = "APPROVED" + + // PatchMTOServiceItemStatusPayloadStatusREJECTED captures enum value "REJECTED" + PatchMTOServiceItemStatusPayloadStatusREJECTED string = "REJECTED" +) + +// prop value enum +func (m *PatchMTOServiceItemStatusPayload) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, patchMTOServiceItemStatusPayloadTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PatchMTOServiceItemStatusPayload) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this patch m t o service item status payload based on context it is used +func (m *PatchMTOServiceItemStatusPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PatchMTOServiceItemStatusPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchMTOServiceItemStatusPayload) UnmarshalBinary(b []byte) error { + var res PatchMTOServiceItemStatusPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/payment_request.go b/pkg/gen/ghcmessages/payment_request.go new file mode 100644 index 00000000000..6e4ba8100c6 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_request.go @@ -0,0 +1,471 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // Reported code from syncada for the EDI error encountered + EdiErrorCode *string `json:"ediErrorCode,omitempty"` + + // The reason the services counselor has excluded or rejected the item. + EdiErrorDescription *string `json:"ediErrorDescription,omitempty"` + + // Type of EDI reporting or causing the issue. Can be EDI 997, 824, and 858. + EdiErrorType *string `json:"ediErrorType,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order + MoveTaskOrder *Move `json:"moveTaskOrder,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // proof of service docs + ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // received by gex at + // Format: date-time + ReceivedByGexAt *strfmt.DateTime `json:"receivedByGexAt,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // reviewed at + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt,omitempty"` + + // sent to gex at + // Format: date-time + SentToGexAt *strfmt.DateTime `json:"sentToGexAt,omitempty"` + + // service items + ServiceItems PaymentServiceItems `json:"serviceItems,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` + + // Total amount that TPPS paid for all service items on the payment request in millicents + TppsInvoiceAmountPaidTotalMillicents *int64 `json:"tppsInvoiceAmountPaidTotalMillicents,omitempty"` + + // Date that TPPS paid HS for the payment request + // Format: date-time + TppsInvoiceSellerPaidDate *strfmt.DateTime `json:"tppsInvoiceSellerPaidDate,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfServiceDocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReceivedByGexAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSentToGexAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTppsInvoiceSellerPaidDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrder(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrder) { // not required + return nil + } + + if m.MoveTaskOrder != nil { + if err := m.MoveTaskOrder.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moveTaskOrder") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moveTaskOrder") + } + return err + } + } + + return nil +} + +func (m *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { + if swag.IsZero(m.ProofOfServiceDocs) { // not required + return nil + } + + if err := m.ProofOfServiceDocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateReceivedByGexAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReceivedByGexAt) { // not required + return nil + } + + if err := validate.FormatOf("receivedByGexAt", "body", "date-time", m.ReceivedByGexAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateSentToGexAt(formats strfmt.Registry) error { + if swag.IsZero(m.SentToGexAt) { // not required + return nil + } + + if err := validate.FormatOf("sentToGexAt", "body", "date-time", m.SentToGexAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceItems) { // not required + return nil + } + + if err := m.ServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateTppsInvoiceSellerPaidDate(formats strfmt.Registry) error { + if swag.IsZero(m.TppsInvoiceSellerPaidDate) { // not required + return nil + } + + if err := validate.FormatOf("tppsInvoiceSellerPaidDate", "body", "date-time", m.TppsInvoiceSellerPaidDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveTaskOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateMoveTaskOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.MoveTaskOrder != nil { + + if swag.IsZero(m.MoveTaskOrder) { // not required + return nil + } + + if err := m.MoveTaskOrder.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moveTaskOrder") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moveTaskOrder") + } + return err + } + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/payment_request_status.go b/pkg/gen/ghcmessages/payment_request_status.go new file mode 100644 index 00000000000..56359fa3219 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" + PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/payment_requests.go b/pkg/gen/ghcmessages/payment_requests.go new file mode 100644 index 00000000000..2cc938bac72 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/payment_service_item.go b/pkg/gen/ghcmessages/payment_service_item.go new file mode 100644 index 00000000000..8dce225f76c --- /dev/null +++ b/pkg/gen/ghcmessages/payment_service_item.go @@ -0,0 +1,350 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItem payment service item +// +// swagger:model PaymentServiceItem +type PaymentServiceItem struct { + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto service item code + // Example: DLH + MtoServiceItemCode string `json:"mtoServiceItemCode,omitempty"` + + // mto service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // mto service item name + // Example: Move management + MtoServiceItemName string `json:"mtoServiceItemName,omitempty"` + + // mto shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoShipmentID *strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // mto shipment type + MtoShipmentType MTOShipmentType `json:"mtoShipmentType,omitempty"` + + // payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // payment service item params + PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` + + // Price of the service item in cents + PriceCents *int64 `json:"priceCents,omitempty"` + + // reference ID + // Example: 1234-5678-c56a4180 + // Read Only: true + ReferenceID string `json:"referenceID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentServiceItemStatus `json:"status,omitempty"` + + // Amount that TPPS paid for the individual service item in millicents + TppsInvoiceAmountPaidPerServiceItemMillicents *int64 `json:"tppsInvoiceAmountPaidPerServiceItemMillicents,omitempty"` +} + +// Validate validates this payment service item +func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validateMtoShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentType) { // not required + return nil + } + + if err := m.MtoShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipmentType") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemParams) { // not required + return nil + } + + if err := m.PaymentServiceItemParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item based on the context it is used +func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferenceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateMtoShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentType) { // not required + return nil + } + + if err := m.MtoShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipmentType") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { + var res PaymentServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/payment_service_item_param.go b/pkg/gen/ghcmessages/payment_service_item_param.go new file mode 100644 index 00000000000..0743122c77b --- /dev/null +++ b/pkg/gen/ghcmessages/payment_service_item_param.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemParam payment service item param +// +// swagger:model PaymentServiceItemParam +type PaymentServiceItemParam struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // key + Key ServiceItemParamName `json:"key,omitempty"` + + // origin + Origin ServiceItemParamOrigin `json:"origin,omitempty"` + + // payment service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` + + // type + Type ServiceItemParamType `json:"type,omitempty"` + + // value + // Example: 3025 + Value string `json:"value,omitempty"` +} + +// Validate validates this payment service item param +func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item param based on the context it is used +func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKey(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { + var res PaymentServiceItemParam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/payment_service_item_params.go b/pkg/gen/ghcmessages/payment_service_item_params.go new file mode 100644 index 00000000000..5f09832fdd6 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_service_item_params.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItemParams payment service item params +// +// swagger:model PaymentServiceItemParams +type PaymentServiceItemParams []*PaymentServiceItemParam + +// Validate validates this payment service item params +func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service item params based on the context it is used +func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/payment_service_item_status.go b/pkg/gen/ghcmessages/payment_service_item_status.go new file mode 100644 index 00000000000..0e1f2354741 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemStatus Payment Service Item Status +// +// swagger:model PaymentServiceItemStatus +type PaymentServiceItemStatus string + +func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. +func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { + return &m +} + +const ( + + // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" + PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" + + // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" + PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" + + // PaymentServiceItemStatusDENIED captures enum value "DENIED" + PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" + + // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" + + // PaymentServiceItemStatusPAID captures enum value "PAID" + PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" + + // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" + PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" +) + +// for schema +var paymentServiceItemStatusEnum []interface{} + +func init() { + var res []PaymentServiceItemStatus + if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) + } +} + +func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment service item status +func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment service item status based on context it is used +func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/payment_service_items.go b/pkg/gen/ghcmessages/payment_service_items.go new file mode 100644 index 00000000000..fe8564195b2 --- /dev/null +++ b/pkg/gen/ghcmessages/payment_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItems payment service items +// +// swagger:model PaymentServiceItems +type PaymentServiceItems []*PaymentServiceItem + +// Validate validates this payment service items +func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service items based on the context it is used +func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/post_document_payload.go b/pkg/gen/ghcmessages/post_document_payload.go new file mode 100644 index 00000000000..72e059cdfc3 --- /dev/null +++ b/pkg/gen/ghcmessages/post_document_payload.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PostDocumentPayload post document payload +// +// swagger:model PostDocumentPayload +type PostDocumentPayload struct { + + // The service member this document belongs to + // Format: uuid + ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` +} + +// Validate validates this post document payload +func (m *PostDocumentPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostDocumentPayload) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this post document payload based on context it is used +func (m *PostDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PostDocumentPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PostDocumentPayload) UnmarshalBinary(b []byte) error { + var res PostDocumentPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/pro_gear_weight_ticket.go b/pkg/gen/ghcmessages/pro_gear_weight_ticket.go new file mode 100644 index 00000000000..1c7089a51b0 --- /dev/null +++ b/pkg/gen/ghcmessages/pro_gear_weight_ticket.go @@ -0,0 +1,463 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ProGearWeightTicket Pro-gear associated information and weight docs for a PPM shipment +// +// swagger:model ProGearWeightTicket +type ProGearWeightTicket struct { + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + BelongsToSelf *bool `json:"belongsToSelf"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // Describes the pro-gear that was moved. + Description *string `json:"description"` + + // document + // Required: true + Document *Document `json:"document"` + + // The ID of the document that is associated with the user uploads containing the pro-gear weight. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + DocumentID strfmt.UUID `json:"documentId"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + HasWeightTickets *bool `json:"hasWeightTickets"` + + // The ID of the pro-gear weight ticket. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // The ID of the PPM shipment that this pro-gear weight ticket is associated with. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + SubmittedBelongsToSelf *bool `json:"submittedBelongsToSelf"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + SubmittedHasWeightTickets *bool `json:"submittedHasWeightTickets"` + + // Customer submitted weight of the pro-gear. + // Minimum: 0 + SubmittedWeight *int64 `json:"submittedWeight"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // Weight of the pro-gear. + // Minimum: 0 + Weight *int64 `json:"weight"` +} + +// Validate validates this pro gear weight ticket +func (m *ProGearWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProGearWeightTicket) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateDocument(formats strfmt.Registry) error { + + if err := validate.Required("document", "body", m.Document); err != nil { + return err + } + + if m.Document != nil { + if err := m.Document.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) 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 *ProGearWeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateSubmittedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedWeight", "body", *m.SubmittedWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this pro gear weight ticket based on the context it is used +func (m *ProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProGearWeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.Document != nil { + + if err := m.Document.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProGearWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProGearWeightTicket) UnmarshalBinary(b []byte) error { + var res ProGearWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/pro_gear_weight_tickets.go b/pkg/gen/ghcmessages/pro_gear_weight_tickets.go new file mode 100644 index 00000000000..4e8f9876f27 --- /dev/null +++ b/pkg/gen/ghcmessages/pro_gear_weight_tickets.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProGearWeightTickets All progear weight tickets associated with a PPM shipment. +// +// swagger:model ProGearWeightTickets +type ProGearWeightTickets []*ProGearWeightTicket + +// Validate validates this pro gear weight tickets +func (m ProGearWeightTickets) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this pro gear weight tickets based on the context it is used +func (m ProGearWeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/proof_of_service_doc.go b/pkg/gen/ghcmessages/proof_of_service_doc.go new file mode 100644 index 00000000000..3a549c8868a --- /dev/null +++ b/pkg/gen/ghcmessages/proof_of_service_doc.go @@ -0,0 +1,124 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDoc proof of service doc +// +// swagger:model ProofOfServiceDoc +type ProofOfServiceDoc struct { + + // is weight ticket + IsWeightTicket bool `json:"isWeightTicket,omitempty"` + + // uploads + Uploads []*Upload `json:"uploads"` +} + +// Validate validates this proof of service doc +func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service doc based on the context it is used +func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { + var res ProofOfServiceDoc + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/proof_of_service_docs.go b/pkg/gen/ghcmessages/proof_of_service_docs.go new file mode 100644 index 00000000000..464781e3510 --- /dev/null +++ b/pkg/gen/ghcmessages/proof_of_service_docs.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDocs proof of service docs +// +// swagger:model ProofOfServiceDocs +type ProofOfServiceDocs []*ProofOfServiceDoc + +// Validate validates this proof of service docs +func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this proof of service docs based on the context it is used +func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/queue_move.go b/pkg/gen/ghcmessages/queue_move.go new file mode 100644 index 00000000000..cf370535fb8 --- /dev/null +++ b/pkg/gen/ghcmessages/queue_move.go @@ -0,0 +1,774 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// QueueMove queue move +// +// swagger:model QueueMove +type QueueMove struct { + + // appeared in too at + // Format: date-time + AppearedInTooAt *strfmt.DateTime `json:"appearedInTooAt,omitempty"` + + // assignable + Assignable bool `json:"assignable,omitempty"` + + // assigned to + AssignedTo *AssignedOfficeUser `json:"assignedTo,omitempty"` + + // available office users + AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` + + // closeout initiated + // Format: date-time + CloseoutInitiated *strfmt.DateTime `json:"closeoutInitiated,omitempty"` + + // closeout location + CloseoutLocation *string `json:"closeoutLocation,omitempty"` + + // counseling office + CounselingOffice *string `json:"counselingOffice,omitempty"` + + // counseling office ID + // Format: uuid + CounselingOfficeID *strfmt.UUID `json:"counselingOfficeID,omitempty"` + + // customer + Customer *Customer `json:"customer,omitempty"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // locator + Locator string `json:"locator,omitempty"` + + // lock expires at + // Format: date-time + LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` + + // locked by office user + LockedByOfficeUser *LockedOfficeUser `json:"lockedByOfficeUser,omitempty"` + + // locked by office user ID + // Format: uuid + LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` + + // order type + OrderType *string `json:"orderType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin g b l o c + OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` + + // ppm status + PpmStatus PPMStatus `json:"ppmStatus,omitempty"` + + // ppm type + // Enum: [FULL PARTIAL] + PpmType *string `json:"ppmType,omitempty"` + + // requested move date + // Format: date + RequestedMoveDate *strfmt.Date `json:"requestedMoveDate,omitempty"` + + // shipments count + ShipmentsCount int64 `json:"shipmentsCount,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` +} + +// Validate validates this queue move +func (m *QueueMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAppearedInTooAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAssignedTo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableOfficeUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloseoutInitiated(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCounselingOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueMove) validateAppearedInTooAt(formats strfmt.Registry) error { + if swag.IsZero(m.AppearedInTooAt) { // not required + return nil + } + + if err := validate.FormatOf("appearedInTooAt", "body", "date-time", m.AppearedInTooAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateAssignedTo(formats strfmt.Registry) error { + if swag.IsZero(m.AssignedTo) { // not required + return nil + } + + if m.AssignedTo != nil { + if err := m.AssignedTo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assignedTo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assignedTo") + } + return err + } + } + + return nil +} + +func (m *QueueMove) validateAvailableOfficeUsers(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableOfficeUsers) { // not required + return nil + } + + if err := m.AvailableOfficeUsers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *QueueMove) validateCloseoutInitiated(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutInitiated) { // not required + return nil + } + + if err := validate.FormatOf("closeoutInitiated", "body", "date-time", m.CloseoutInitiated.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateCounselingOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("counselingOfficeID", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *QueueMove) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *QueueMove) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueueMove) 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 *QueueMove) validateLockExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.LockExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateLockedByOfficeUser(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUser) { // not required + return nil + } + + if m.LockedByOfficeUser != nil { + if err := m.LockedByOfficeUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lockedByOfficeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lockedByOfficeUser") + } + return err + } + } + + return nil +} + +func (m *QueueMove) validateLockedByOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueueMove) validateOriginGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *QueueMove) validatePpmStatus(formats strfmt.Registry) error { + if swag.IsZero(m.PpmStatus) { // not required + return nil + } + + if err := m.PpmStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmStatus") + } + return err + } + + return nil +} + +var queueMoveTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + queueMoveTypePpmTypePropEnum = append(queueMoveTypePpmTypePropEnum, v) + } +} + +const ( + + // QueueMovePpmTypeFULL captures enum value "FULL" + QueueMovePpmTypeFULL string = "FULL" + + // QueueMovePpmTypePARTIAL captures enum value "PARTIAL" + QueueMovePpmTypePARTIAL string = "PARTIAL" +) + +// prop value enum +func (m *QueueMove) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, queueMoveTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *QueueMove) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", *m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) validateRequestedMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedMoveDate", "body", "date", m.RequestedMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueueMove) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *QueueMove) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this queue move based on the context it is used +func (m *QueueMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAssignedTo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateLockedByOfficeUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueMove) contextValidateAssignedTo(ctx context.Context, formats strfmt.Registry) error { + + if m.AssignedTo != nil { + + if swag.IsZero(m.AssignedTo) { // not required + return nil + } + + if err := m.AssignedTo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assignedTo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assignedTo") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *QueueMove) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateLockedByOfficeUser(ctx context.Context, formats strfmt.Registry) error { + + if m.LockedByOfficeUser != nil { + + if swag.IsZero(m.LockedByOfficeUser) { // not required + return nil + } + + if err := m.LockedByOfficeUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("lockedByOfficeUser") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("lockedByOfficeUser") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueueMove) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *QueueMove) contextValidatePpmStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.PpmStatus) { // not required + return nil + } + + if err := m.PpmStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmStatus") + } + return err + } + + return nil +} + +func (m *QueueMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueueMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueueMove) UnmarshalBinary(b []byte) error { + var res QueueMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/queue_moves.go b/pkg/gen/ghcmessages/queue_moves.go new file mode 100644 index 00000000000..1edf791be07 --- /dev/null +++ b/pkg/gen/ghcmessages/queue_moves.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueueMoves queue moves +// +// swagger:model QueueMoves +type QueueMoves []*QueueMove + +// Validate validates this queue moves +func (m QueueMoves) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this queue moves based on the context it is used +func (m QueueMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/queue_moves_result.go b/pkg/gen/ghcmessages/queue_moves_result.go new file mode 100644 index 00000000000..a0117f55989 --- /dev/null +++ b/pkg/gen/ghcmessages/queue_moves_result.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueueMovesResult queue moves result +// +// swagger:model QueueMovesResult +type QueueMovesResult struct { + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // queue moves + QueueMoves QueueMoves `json:"queueMoves,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this queue moves result +func (m *QueueMovesResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQueueMoves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueMovesResult) validateQueueMoves(formats strfmt.Registry) error { + if swag.IsZero(m.QueueMoves) { // not required + return nil + } + + if err := m.QueueMoves.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queueMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queueMoves") + } + return err + } + + return nil +} + +// ContextValidate validate this queue moves result based on the context it is used +func (m *QueueMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateQueueMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueueMovesResult) contextValidateQueueMoves(ctx context.Context, formats strfmt.Registry) error { + + if err := m.QueueMoves.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queueMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queueMoves") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueueMovesResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueueMovesResult) UnmarshalBinary(b []byte) error { + var res QueueMovesResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/queue_payment_request.go b/pkg/gen/ghcmessages/queue_payment_request.go new file mode 100644 index 00000000000..28a4edbb0f7 --- /dev/null +++ b/pkg/gen/ghcmessages/queue_payment_request.go @@ -0,0 +1,512 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// QueuePaymentRequest queue payment request +// +// swagger:model QueuePaymentRequest +type QueuePaymentRequest struct { + + // Days since the payment request has been requested. Decimal representation will allow more accurate sorting. + Age float64 `json:"age,omitempty"` + + // assignable + Assignable bool `json:"assignable,omitempty"` + + // assigned to + AssignedTo *AssignedOfficeUser `json:"assignedTo,omitempty"` + + // available office users + AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` + + // counseling office + CounselingOffice *string `json:"counselingOffice,omitempty"` + + // customer + Customer *Customer `json:"customer,omitempty"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // locator + Locator string `json:"locator,omitempty"` + + // lock expires at + // Format: date-time + LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` + + // locked by office user ID + // Format: uuid + LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` + + // move ID + // Format: uuid + MoveID strfmt.UUID `json:"moveID,omitempty"` + + // order type + OrderType *string `json:"orderType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin g b l o c + OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` + + // status + Status QueuePaymentRequestStatus `json:"status,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt strfmt.DateTime `json:"submittedAt,omitempty"` +} + +// Validate validates this queue payment request +func (m *QueuePaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAssignedTo(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableOfficeUsers(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueuePaymentRequest) validateAssignedTo(formats strfmt.Registry) error { + if swag.IsZero(m.AssignedTo) { // not required + return nil + } + + if m.AssignedTo != nil { + if err := m.AssignedTo.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assignedTo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assignedTo") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) validateAvailableOfficeUsers(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableOfficeUsers) { // not required + return nil + } + + if err := m.AvailableOfficeUsers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *QueuePaymentRequest) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) 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 *QueuePaymentRequest) validateLockExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.LockExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueuePaymentRequest) validateLockedByOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueuePaymentRequest) validateMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveID) { // not required + return nil + } + + if err := validate.FormatOf("moveID", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *QueuePaymentRequest) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) validateOriginGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *QueuePaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *QueuePaymentRequest) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this queue payment request based on the context it is used +func (m *QueuePaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAssignedTo(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueuePaymentRequest) contextValidateAssignedTo(ctx context.Context, formats strfmt.Registry) error { + + if m.AssignedTo != nil { + + if swag.IsZero(m.AssignedTo) { // not required + return nil + } + + if err := m.AssignedTo.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("assignedTo") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("assignedTo") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("availableOfficeUsers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("availableOfficeUsers") + } + return err + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *QueuePaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueuePaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueuePaymentRequest) UnmarshalBinary(b []byte) error { + var res QueuePaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/queue_payment_request_status.go b/pkg/gen/ghcmessages/queue_payment_request_status.go new file mode 100644 index 00000000000..b83982b696d --- /dev/null +++ b/pkg/gen/ghcmessages/queue_payment_request_status.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// QueuePaymentRequestStatus Queue Payment Request Status +// +// swagger:model QueuePaymentRequestStatus +type QueuePaymentRequestStatus string + +func NewQueuePaymentRequestStatus(value QueuePaymentRequestStatus) *QueuePaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated QueuePaymentRequestStatus. +func (m QueuePaymentRequestStatus) Pointer() *QueuePaymentRequestStatus { + return &m +} + +const ( + + // QueuePaymentRequestStatusPaymentRequested captures enum value "Payment requested" + QueuePaymentRequestStatusPaymentRequested QueuePaymentRequestStatus = "Payment requested" + + // QueuePaymentRequestStatusReviewed captures enum value "Reviewed" + QueuePaymentRequestStatusReviewed QueuePaymentRequestStatus = "Reviewed" + + // QueuePaymentRequestStatusRejected captures enum value "Rejected" + QueuePaymentRequestStatusRejected QueuePaymentRequestStatus = "Rejected" + + // QueuePaymentRequestStatusPaid captures enum value "Paid" + QueuePaymentRequestStatusPaid QueuePaymentRequestStatus = "Paid" +) + +// for schema +var queuePaymentRequestStatusEnum []interface{} + +func init() { + var res []QueuePaymentRequestStatus + if err := json.Unmarshal([]byte(`["Payment requested","Reviewed","Rejected","Paid"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + queuePaymentRequestStatusEnum = append(queuePaymentRequestStatusEnum, v) + } +} + +func (m QueuePaymentRequestStatus) validateQueuePaymentRequestStatusEnum(path, location string, value QueuePaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, queuePaymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this queue payment request status +func (m QueuePaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateQueuePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this queue payment request status based on context it is used +func (m QueuePaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/queue_payment_requests.go b/pkg/gen/ghcmessages/queue_payment_requests.go new file mode 100644 index 00000000000..1e1e9172a1e --- /dev/null +++ b/pkg/gen/ghcmessages/queue_payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueuePaymentRequests queue payment requests +// +// swagger:model QueuePaymentRequests +type QueuePaymentRequests []*QueuePaymentRequest + +// Validate validates this queue payment requests +func (m QueuePaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this queue payment requests based on the context it is used +func (m QueuePaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/queue_payment_requests_result.go b/pkg/gen/ghcmessages/queue_payment_requests_result.go new file mode 100644 index 00000000000..be3af16ade8 --- /dev/null +++ b/pkg/gen/ghcmessages/queue_payment_requests_result.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// QueuePaymentRequestsResult queue payment requests result +// +// swagger:model QueuePaymentRequestsResult +type QueuePaymentRequestsResult struct { + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // queue payment requests + QueuePaymentRequests QueuePaymentRequests `json:"queuePaymentRequests,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this queue payment requests result +func (m *QueuePaymentRequestsResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateQueuePaymentRequests(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueuePaymentRequestsResult) validateQueuePaymentRequests(formats strfmt.Registry) error { + if swag.IsZero(m.QueuePaymentRequests) { // not required + return nil + } + + if err := m.QueuePaymentRequests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queuePaymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queuePaymentRequests") + } + return err + } + + return nil +} + +// ContextValidate validate this queue payment requests result based on the context it is used +func (m *QueuePaymentRequestsResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateQueuePaymentRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *QueuePaymentRequestsResult) contextValidateQueuePaymentRequests(ctx context.Context, formats strfmt.Registry) error { + + if err := m.QueuePaymentRequests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("queuePaymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("queuePaymentRequests") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *QueuePaymentRequestsResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *QueuePaymentRequestsResult) UnmarshalBinary(b []byte) error { + var res QueuePaymentRequestsResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/re_service_item.go b/pkg/gen/ghcmessages/re_service_item.go new file mode 100644 index 00000000000..f90165b8924 --- /dev/null +++ b/pkg/gen/ghcmessages/re_service_item.go @@ -0,0 +1,378 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReServiceItem A Service Item which ties an ReService, Market, and Shipment Type together +// +// swagger:model ReServiceItem +type ReServiceItem struct { + + // is auto approved + // Example: true + IsAutoApproved bool `json:"isAutoApproved,omitempty"` + + // market code + // Example: i (International), d (Domestic) + // Enum: [i d] + MarketCode string `json:"marketCode,omitempty"` + + // service code + // Example: UBP + // Enum: [CS DBHF DBTF DCRT DCRTSA DDASIT DDDSIT DDFSIT DDP DDSFSC DDSHUT DLH DMHF DNPK DOASIT DOFSIT DOP DOPSIT DOSFSC DOSHUT DPK DSH DUCRT DUPK FSC IBHF IBTF ICRT ICRTSA IDASIT IDDSIT IDFSIT IDSFSC IDSHUT IHPK IHUPK INPK IOASIT IOFSIT IOPSIT IOSFSC IOSHUT ISLH IUBPK IUBUPK IUCRT MS PODFSC POEFSC UBP] + ServiceCode string `json:"serviceCode,omitempty"` + + // service name + // Example: International UB, International Shipping \u0026 Linehaul + ServiceName string `json:"serviceName,omitempty"` + + // shipment type + // Example: HHG, UNACCOMPANIED_BAGGAGE + // Enum: [BOAT_HAUL_AWAY BOAT_TOW_AWAY HHG HHG_INTO_NTS HHG_OUTOF_NTS_DOMESTIC MOBILE_HOME PPM UNACCOMPANIED_BAGGAGE] + ShipmentType string `json:"shipmentType,omitempty"` +} + +// Validate validates this re service item +func (m *ReServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var reServiceItemTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["i","d"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceItemTypeMarketCodePropEnum = append(reServiceItemTypeMarketCodePropEnum, v) + } +} + +const ( + + // ReServiceItemMarketCodeI captures enum value "i" + ReServiceItemMarketCodeI string = "i" + + // ReServiceItemMarketCodeD captures enum value "d" + ReServiceItemMarketCodeD string = "d" +) + +// prop value enum +func (m *ReServiceItem) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, reServiceItemTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ReServiceItem) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +var reServiceItemTypeServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DCRTSA","DDASIT","DDDSIT","DDFSIT","DDP","DDSFSC","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSFSC","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICRT","ICRTSA","IDASIT","IDDSIT","IDFSIT","IDSFSC","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOFSIT","IOPSIT","IOSFSC","IOSHUT","ISLH","IUBPK","IUBUPK","IUCRT","MS","PODFSC","POEFSC","UBP"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceItemTypeServiceCodePropEnum = append(reServiceItemTypeServiceCodePropEnum, v) + } +} + +const ( + + // ReServiceItemServiceCodeCS captures enum value "CS" + ReServiceItemServiceCodeCS string = "CS" + + // ReServiceItemServiceCodeDBHF captures enum value "DBHF" + ReServiceItemServiceCodeDBHF string = "DBHF" + + // ReServiceItemServiceCodeDBTF captures enum value "DBTF" + ReServiceItemServiceCodeDBTF string = "DBTF" + + // ReServiceItemServiceCodeDCRT captures enum value "DCRT" + ReServiceItemServiceCodeDCRT string = "DCRT" + + // ReServiceItemServiceCodeDCRTSA captures enum value "DCRTSA" + ReServiceItemServiceCodeDCRTSA string = "DCRTSA" + + // ReServiceItemServiceCodeDDASIT captures enum value "DDASIT" + ReServiceItemServiceCodeDDASIT string = "DDASIT" + + // ReServiceItemServiceCodeDDDSIT captures enum value "DDDSIT" + ReServiceItemServiceCodeDDDSIT string = "DDDSIT" + + // ReServiceItemServiceCodeDDFSIT captures enum value "DDFSIT" + ReServiceItemServiceCodeDDFSIT string = "DDFSIT" + + // ReServiceItemServiceCodeDDP captures enum value "DDP" + ReServiceItemServiceCodeDDP string = "DDP" + + // ReServiceItemServiceCodeDDSFSC captures enum value "DDSFSC" + ReServiceItemServiceCodeDDSFSC string = "DDSFSC" + + // ReServiceItemServiceCodeDDSHUT captures enum value "DDSHUT" + ReServiceItemServiceCodeDDSHUT string = "DDSHUT" + + // ReServiceItemServiceCodeDLH captures enum value "DLH" + ReServiceItemServiceCodeDLH string = "DLH" + + // ReServiceItemServiceCodeDMHF captures enum value "DMHF" + ReServiceItemServiceCodeDMHF string = "DMHF" + + // ReServiceItemServiceCodeDNPK captures enum value "DNPK" + ReServiceItemServiceCodeDNPK string = "DNPK" + + // ReServiceItemServiceCodeDOASIT captures enum value "DOASIT" + ReServiceItemServiceCodeDOASIT string = "DOASIT" + + // ReServiceItemServiceCodeDOFSIT captures enum value "DOFSIT" + ReServiceItemServiceCodeDOFSIT string = "DOFSIT" + + // ReServiceItemServiceCodeDOP captures enum value "DOP" + ReServiceItemServiceCodeDOP string = "DOP" + + // ReServiceItemServiceCodeDOPSIT captures enum value "DOPSIT" + ReServiceItemServiceCodeDOPSIT string = "DOPSIT" + + // ReServiceItemServiceCodeDOSFSC captures enum value "DOSFSC" + ReServiceItemServiceCodeDOSFSC string = "DOSFSC" + + // ReServiceItemServiceCodeDOSHUT captures enum value "DOSHUT" + ReServiceItemServiceCodeDOSHUT string = "DOSHUT" + + // ReServiceItemServiceCodeDPK captures enum value "DPK" + ReServiceItemServiceCodeDPK string = "DPK" + + // ReServiceItemServiceCodeDSH captures enum value "DSH" + ReServiceItemServiceCodeDSH string = "DSH" + + // ReServiceItemServiceCodeDUCRT captures enum value "DUCRT" + ReServiceItemServiceCodeDUCRT string = "DUCRT" + + // ReServiceItemServiceCodeDUPK captures enum value "DUPK" + ReServiceItemServiceCodeDUPK string = "DUPK" + + // ReServiceItemServiceCodeFSC captures enum value "FSC" + ReServiceItemServiceCodeFSC string = "FSC" + + // ReServiceItemServiceCodeIBHF captures enum value "IBHF" + ReServiceItemServiceCodeIBHF string = "IBHF" + + // ReServiceItemServiceCodeIBTF captures enum value "IBTF" + ReServiceItemServiceCodeIBTF string = "IBTF" + + // ReServiceItemServiceCodeICRT captures enum value "ICRT" + ReServiceItemServiceCodeICRT string = "ICRT" + + // ReServiceItemServiceCodeICRTSA captures enum value "ICRTSA" + ReServiceItemServiceCodeICRTSA string = "ICRTSA" + + // ReServiceItemServiceCodeIDASIT captures enum value "IDASIT" + ReServiceItemServiceCodeIDASIT string = "IDASIT" + + // ReServiceItemServiceCodeIDDSIT captures enum value "IDDSIT" + ReServiceItemServiceCodeIDDSIT string = "IDDSIT" + + // ReServiceItemServiceCodeIDFSIT captures enum value "IDFSIT" + ReServiceItemServiceCodeIDFSIT string = "IDFSIT" + + // ReServiceItemServiceCodeIDSFSC captures enum value "IDSFSC" + ReServiceItemServiceCodeIDSFSC string = "IDSFSC" + + // ReServiceItemServiceCodeIDSHUT captures enum value "IDSHUT" + ReServiceItemServiceCodeIDSHUT string = "IDSHUT" + + // ReServiceItemServiceCodeIHPK captures enum value "IHPK" + ReServiceItemServiceCodeIHPK string = "IHPK" + + // ReServiceItemServiceCodeIHUPK captures enum value "IHUPK" + ReServiceItemServiceCodeIHUPK string = "IHUPK" + + // ReServiceItemServiceCodeINPK captures enum value "INPK" + ReServiceItemServiceCodeINPK string = "INPK" + + // ReServiceItemServiceCodeIOASIT captures enum value "IOASIT" + ReServiceItemServiceCodeIOASIT string = "IOASIT" + + // ReServiceItemServiceCodeIOFSIT captures enum value "IOFSIT" + ReServiceItemServiceCodeIOFSIT string = "IOFSIT" + + // ReServiceItemServiceCodeIOPSIT captures enum value "IOPSIT" + ReServiceItemServiceCodeIOPSIT string = "IOPSIT" + + // ReServiceItemServiceCodeIOSFSC captures enum value "IOSFSC" + ReServiceItemServiceCodeIOSFSC string = "IOSFSC" + + // ReServiceItemServiceCodeIOSHUT captures enum value "IOSHUT" + ReServiceItemServiceCodeIOSHUT string = "IOSHUT" + + // ReServiceItemServiceCodeISLH captures enum value "ISLH" + ReServiceItemServiceCodeISLH string = "ISLH" + + // ReServiceItemServiceCodeIUBPK captures enum value "IUBPK" + ReServiceItemServiceCodeIUBPK string = "IUBPK" + + // ReServiceItemServiceCodeIUBUPK captures enum value "IUBUPK" + ReServiceItemServiceCodeIUBUPK string = "IUBUPK" + + // ReServiceItemServiceCodeIUCRT captures enum value "IUCRT" + ReServiceItemServiceCodeIUCRT string = "IUCRT" + + // ReServiceItemServiceCodeMS captures enum value "MS" + ReServiceItemServiceCodeMS string = "MS" + + // ReServiceItemServiceCodePODFSC captures enum value "PODFSC" + ReServiceItemServiceCodePODFSC string = "PODFSC" + + // ReServiceItemServiceCodePOEFSC captures enum value "POEFSC" + ReServiceItemServiceCodePOEFSC string = "POEFSC" + + // ReServiceItemServiceCodeUBP captures enum value "UBP" + ReServiceItemServiceCodeUBP string = "UBP" +) + +// prop value enum +func (m *ReServiceItem) validateServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, reServiceItemTypeServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ReServiceItem) validateServiceCode(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateServiceCodeEnum("serviceCode", "body", m.ServiceCode); err != nil { + return err + } + + return nil +} + +var reServiceItemTypeShipmentTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceItemTypeShipmentTypePropEnum = append(reServiceItemTypeShipmentTypePropEnum, v) + } +} + +const ( + + // ReServiceItemShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + ReServiceItemShipmentTypeBOATHAULAWAY string = "BOAT_HAUL_AWAY" + + // ReServiceItemShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + ReServiceItemShipmentTypeBOATTOWAWAY string = "BOAT_TOW_AWAY" + + // ReServiceItemShipmentTypeHHG captures enum value "HHG" + ReServiceItemShipmentTypeHHG string = "HHG" + + // ReServiceItemShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + ReServiceItemShipmentTypeHHGINTONTS string = "HHG_INTO_NTS" + + // ReServiceItemShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + ReServiceItemShipmentTypeHHGOUTOFNTSDOMESTIC string = "HHG_OUTOF_NTS_DOMESTIC" + + // ReServiceItemShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + ReServiceItemShipmentTypeMOBILEHOME string = "MOBILE_HOME" + + // ReServiceItemShipmentTypePPM captures enum value "PPM" + ReServiceItemShipmentTypePPM string = "PPM" + + // ReServiceItemShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + ReServiceItemShipmentTypeUNACCOMPANIEDBAGGAGE string = "UNACCOMPANIED_BAGGAGE" +) + +// prop value enum +func (m *ReServiceItem) validateShipmentTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, reServiceItemTypeShipmentTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ReServiceItem) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + // value enum + if err := m.validateShipmentTypeEnum("shipmentType", "body", m.ShipmentType); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this re service item based on context it is used +func (m *ReServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ReServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReServiceItem) UnmarshalBinary(b []byte) error { + var res ReServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/re_service_items.go b/pkg/gen/ghcmessages/re_service_items.go new file mode 100644 index 00000000000..b5c2f510811 --- /dev/null +++ b/pkg/gen/ghcmessages/re_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ReServiceItems re service items +// +// swagger:model ReServiceItems +type ReServiceItems []*ReServiceItem + +// Validate validates this re service items +func (m ReServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this re service items based on the context it is used +func (m ReServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/reject_shipment.go b/pkg/gen/ghcmessages/reject_shipment.go new file mode 100644 index 00000000000..e50cd51114c --- /dev/null +++ b/pkg/gen/ghcmessages/reject_shipment.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RejectShipment reject shipment +// +// swagger:model RejectShipment +type RejectShipment struct { + + // rejection reason + // Example: MTO Shipment not good enough + // Required: true + RejectionReason *string `json:"rejectionReason"` +} + +// Validate validates this reject shipment +func (m *RejectShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRejectionReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RejectShipment) validateRejectionReason(formats strfmt.Registry) error { + + if err := validate.Required("rejectionReason", "body", m.RejectionReason); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this reject shipment based on context it is used +func (m *RejectShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RejectShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RejectShipment) UnmarshalBinary(b []byte) error { + var res RejectShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/report_violation.go b/pkg/gen/ghcmessages/report_violation.go new file mode 100644 index 00000000000..b407165cba7 --- /dev/null +++ b/pkg/gen/ghcmessages/report_violation.go @@ -0,0 +1,215 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ReportViolation An object associating violations to evaluation reports +// +// swagger:model ReportViolation +type ReportViolation struct { + + // gsr appeals + GsrAppeals GSRAppeals `json:"gsrAppeals,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // report ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ReportID strfmt.UUID `json:"reportID,omitempty"` + + // violation + Violation *PWSViolation `json:"violation,omitempty"` + + // violation ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ViolationID strfmt.UUID `json:"violationID,omitempty"` +} + +// Validate validates this report violation +func (m *ReportViolation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateGsrAppeals(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateViolation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateViolationID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReportViolation) validateGsrAppeals(formats strfmt.Registry) error { + if swag.IsZero(m.GsrAppeals) { // not required + return nil + } + + if err := m.GsrAppeals.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gsrAppeals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gsrAppeals") + } + return err + } + + return nil +} + +func (m *ReportViolation) 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 *ReportViolation) validateReportID(formats strfmt.Registry) error { + if swag.IsZero(m.ReportID) { // not required + return nil + } + + if err := validate.FormatOf("reportID", "body", "uuid", m.ReportID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ReportViolation) validateViolation(formats strfmt.Registry) error { + if swag.IsZero(m.Violation) { // not required + return nil + } + + if m.Violation != nil { + if err := m.Violation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("violation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("violation") + } + return err + } + } + + return nil +} + +func (m *ReportViolation) validateViolationID(formats strfmt.Registry) error { + if swag.IsZero(m.ViolationID) { // not required + return nil + } + + if err := validate.FormatOf("violationID", "body", "uuid", m.ViolationID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this report violation based on the context it is used +func (m *ReportViolation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGsrAppeals(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateViolation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ReportViolation) contextValidateGsrAppeals(ctx context.Context, formats strfmt.Registry) error { + + if err := m.GsrAppeals.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("gsrAppeals") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("gsrAppeals") + } + return err + } + + return nil +} + +func (m *ReportViolation) contextValidateViolation(ctx context.Context, formats strfmt.Registry) error { + + if m.Violation != nil { + + if swag.IsZero(m.Violation) { // not required + return nil + } + + if err := m.Violation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("violation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("violation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ReportViolation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ReportViolation) UnmarshalBinary(b []byte) error { + var res ReportViolation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/report_violations.go b/pkg/gen/ghcmessages/report_violations.go new file mode 100644 index 00000000000..77be647c8c9 --- /dev/null +++ b/pkg/gen/ghcmessages/report_violations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ReportViolations report violations +// +// swagger:model ReportViolations +type ReportViolations []*ReportViolation + +// Validate validates this report violations +func (m ReportViolations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this report violations based on the context it is used +func (m ReportViolations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/request_diversion.go b/pkg/gen/ghcmessages/request_diversion.go new file mode 100644 index 00000000000..c5af02f8653 --- /dev/null +++ b/pkg/gen/ghcmessages/request_diversion.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RequestDiversion request diversion +// +// swagger:model RequestDiversion +type RequestDiversion struct { + + // diversion reason + // Example: Shipment route needs to change + // Required: true + DiversionReason *string `json:"diversionReason"` +} + +// Validate validates this request diversion +func (m *RequestDiversion) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDiversionReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RequestDiversion) validateDiversionReason(formats strfmt.Registry) error { + + if err := validate.Required("diversionReason", "body", m.DiversionReason); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this request diversion based on context it is used +func (m *RequestDiversion) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RequestDiversion) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RequestDiversion) UnmarshalBinary(b []byte) error { + var res RequestDiversion + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/reweigh.go b/pkg/gen/ghcmessages/reweigh.go new file mode 100644 index 00000000000..940b4f303d3 --- /dev/null +++ b/pkg/gen/ghcmessages/reweigh.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. +// +// swagger:model Reweigh +type Reweigh struct { + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // requested at + // Format: date-time + RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` + + // requested by + RequestedBy ReweighRequester `json:"requestedBy,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // verification provided at + // Format: date-time + VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` + + // verification reason + // Example: The reweigh was not performed due to some justification provided by the counselor + VerificationReason *string `json:"verificationReason"` + + // weight + // Example: 2000 + Weight *int64 `json:"weight"` +} + +// Validate validates this reweigh +func (m *Reweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVerificationProvidedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerificationProvidedAt) { // not required + return nil + } + + if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this reweigh based on the context it is used +func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reweigh) UnmarshalBinary(b []byte) error { + var res Reweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/reweigh_requester.go b/pkg/gen/ghcmessages/reweigh_requester.go new file mode 100644 index 00000000000..94768abe78e --- /dev/null +++ b/pkg/gen/ghcmessages/reweigh_requester.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReweighRequester reweigh requester +// +// swagger:model ReweighRequester +type ReweighRequester string + +func NewReweighRequester(value ReweighRequester) *ReweighRequester { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReweighRequester. +func (m ReweighRequester) Pointer() *ReweighRequester { + return &m +} + +const ( + + // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" + ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" + + // ReweighRequesterPRIME captures enum value "PRIME" + ReweighRequesterPRIME ReweighRequester = "PRIME" + + // ReweighRequesterSYSTEM captures enum value "SYSTEM" + ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" + + // ReweighRequesterTOO captures enum value "TOO" + ReweighRequesterTOO ReweighRequester = "TOO" +) + +// for schema +var reweighRequesterEnum []interface{} + +func init() { + var res []ReweighRequester + if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reweighRequesterEnum = append(reweighRequesterEnum, v) + } +} + +func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { + if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reweigh requester +func (m ReweighRequester) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReweighRequesterEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reweigh requester based on context it is used +func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/role.go b/pkg/gen/ghcmessages/role.go new file mode 100644 index 00000000000..91996e18d37 --- /dev/null +++ b/pkg/gen/ghcmessages/role.go @@ -0,0 +1,190 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Role role +// +// swagger:model Role +type Role struct { + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // role name + // Example: Task Ordering Officer + // Required: true + RoleName *string `json:"roleName"` + + // role type + // Example: customer + // Required: true + RoleType *string `json:"roleType"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateRoleName(formats strfmt.Registry) error { + + if err := validate.Required("roleName", "body", m.RoleName); err != nil { + return err + } + + return nil +} + +func (m *Role) validateRoleType(formats strfmt.Registry) error { + + if err := validate.Required("roleType", "body", m.RoleType); err != nil { + return err + } + + return nil +} + +func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this role based on the context it is used +func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Role) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_extension.go b/pkg/gen/ghcmessages/s_i_t_extension.go new file mode 100644 index 00000000000..db55243e80a --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_extension.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. +// +// swagger:model SITExtension +type SITExtension struct { + + // approved days + // Example: 30 + ApprovedDays *int64 `json:"approvedDays"` + + // contractor remarks + // Example: We need SIT additional days. The customer has not found a house yet. + ContractorRemarks *string `json:"contractorRemarks"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // decision date + // Format: date-time + DecisionDate *strfmt.DateTime `json:"decisionDate"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // office remarks + OfficeRemarks *string `json:"officeRemarks"` + + // request reason + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason string `json:"requestReason,omitempty"` + + // requested days + // Example: 30 + RequestedDays int64 `json:"requestedDays,omitempty"` + + // status + // Enum: [PENDING APPROVED DENIED] + Status interface{} `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this s i t extension +func (m *SITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { + if swag.IsZero(m.DecisionDate) { // not required + return nil + } + + if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +var sITExtensionTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) + } +} + +const ( + + // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // SITExtensionRequestReasonOTHER captures enum value "OTHER" + SITExtensionRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { + if swag.IsZero(m.RequestReason) { // not required + return nil + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t extension based on the context it is used +func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITExtension) UnmarshalBinary(b []byte) error { + var res SITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_extensions.go b/pkg/gen/ghcmessages/s_i_t_extensions.go new file mode 100644 index 00000000000..b9d5dd4a2b5 --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_extensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITExtensions s i t extensions +// +// swagger:model SITExtensions +type SITExtensions []*SITExtension + +// Validate validates this s i t extensions +func (m SITExtensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t extensions based on the context it is used +func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_location_type.go b/pkg/gen/ghcmessages/s_i_t_location_type.go new file mode 100644 index 00000000000..22d10341c44 --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_location_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SITLocationType The list of SIT location types. +// +// swagger:model SITLocationType +type SITLocationType string + +func NewSITLocationType(value SITLocationType) *SITLocationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SITLocationType. +func (m SITLocationType) Pointer() *SITLocationType { + return &m +} + +const ( + + // SITLocationTypeORIGIN captures enum value "ORIGIN" + SITLocationTypeORIGIN SITLocationType = "ORIGIN" + + // SITLocationTypeDESTINATION captures enum value "DESTINATION" + SITLocationTypeDESTINATION SITLocationType = "DESTINATION" +) + +// for schema +var sITLocationTypeEnum []interface{} + +func init() { + var res []SITLocationType + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITLocationTypeEnum = append(sITLocationTypeEnum, v) + } +} + +func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { + if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this s i t location type +func (m SITLocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this s i t location type based on context it is used +func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go b/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go new file mode 100644 index 00000000000..5c1b38a9910 --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_service_item_grouping.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITServiceItemGrouping s i t service item grouping +// +// swagger:model SITServiceItemGrouping +type SITServiceItemGrouping struct { + + // service items + ServiceItems MTOServiceItems `json:"serviceItems,omitempty"` + + // Holds the top level summary of a Service Item Grouping, detailing the ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date. + // This is provided at a top level because due to our service item architecture, SIT information is sometimes split across multiple service items, and this summary is a compilation of said information. This prevents the need to loop over many service items. + // + Summary *SITSummary `json:"summary,omitempty"` +} + +// Validate validates this s i t service item grouping +func (m *SITServiceItemGrouping) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSummary(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITServiceItemGrouping) validateServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceItems) { // not required + return nil + } + + if err := m.ServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceItems") + } + return err + } + + return nil +} + +func (m *SITServiceItemGrouping) validateSummary(formats strfmt.Registry) error { + if swag.IsZero(m.Summary) { // not required + return nil + } + + if m.Summary != nil { + if err := m.Summary.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("summary") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("summary") + } + return err + } + } + + return nil +} + +// ContextValidate validate this s i t service item grouping based on the context it is used +func (m *SITServiceItemGrouping) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSummary(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITServiceItemGrouping) contextValidateServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceItems") + } + return err + } + + return nil +} + +func (m *SITServiceItemGrouping) contextValidateSummary(ctx context.Context, formats strfmt.Registry) error { + + if m.Summary != nil { + + if swag.IsZero(m.Summary) { // not required + return nil + } + + if err := m.Summary.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("summary") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("summary") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITServiceItemGrouping) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITServiceItemGrouping) UnmarshalBinary(b []byte) error { + var res SITServiceItemGrouping + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go b/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go new file mode 100644 index 00000000000..4a52622083e --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_service_item_groupings.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITServiceItemGroupings Holds groupings of SIT service items and their summaries, detailing the summary ServiceItemID of the first day SIT service item (Eg, DOFSIT, DOASIT), the location (ORIGIN/DESTINATION), how many days the provided instance of SIT has been in storage, SIT entry date, departure date, authorized end date, customer contacted date, requested delivery date. +// +// swagger:model SITServiceItemGroupings +type SITServiceItemGroupings []*SITServiceItemGrouping + +// Validate validates this s i t service item groupings +func (m SITServiceItemGroupings) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t service item groupings based on the context it is used +func (m SITServiceItemGroupings) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_status.go b/pkg/gen/ghcmessages/s_i_t_status.go new file mode 100644 index 00000000000..00a405f8670 --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_status.go @@ -0,0 +1,397 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITStatus s i t status +// +// swagger:model SITStatus +type SITStatus struct { + + // calculated total days in s i t + // Minimum: 0 + CalculatedTotalDaysInSIT *int64 `json:"calculatedTotalDaysInSIT,omitempty"` + + // current s i t + CurrentSIT *SITStatusCurrentSIT `json:"currentSIT,omitempty"` + + // A list of past SIT service item groupings. These will contain the given SIT service items for an instance of SIT (Either Origin or Destination), grouped by the date they went into SIT and service items limited explicitly to SIT related Re Service Codes. + // + PastSITServiceItemGroupings SITServiceItemGroupings `json:"pastSITServiceItemGroupings,omitempty"` + + // total days remaining + // Minimum: 0 + TotalDaysRemaining *int64 `json:"totalDaysRemaining,omitempty"` + + // total s i t days used + // Minimum: 0 + TotalSITDaysUsed *int64 `json:"totalSITDaysUsed,omitempty"` +} + +// Validate validates this s i t status +func (m *SITStatus) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCalculatedTotalDaysInSIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentSIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePastSITServiceItemGroupings(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalDaysRemaining(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalSITDaysUsed(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITStatus) validateCalculatedTotalDaysInSIT(formats strfmt.Registry) error { + if swag.IsZero(m.CalculatedTotalDaysInSIT) { // not required + return nil + } + + if err := validate.MinimumInt("calculatedTotalDaysInSIT", "body", *m.CalculatedTotalDaysInSIT, 0, false); err != nil { + return err + } + + return nil +} + +func (m *SITStatus) validateCurrentSIT(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentSIT) { // not required + return nil + } + + if m.CurrentSIT != nil { + if err := m.CurrentSIT.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentSIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentSIT") + } + return err + } + } + + return nil +} + +func (m *SITStatus) validatePastSITServiceItemGroupings(formats strfmt.Registry) error { + if swag.IsZero(m.PastSITServiceItemGroupings) { // not required + return nil + } + + if err := m.PastSITServiceItemGroupings.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pastSITServiceItemGroupings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pastSITServiceItemGroupings") + } + return err + } + + return nil +} + +func (m *SITStatus) validateTotalDaysRemaining(formats strfmt.Registry) error { + if swag.IsZero(m.TotalDaysRemaining) { // not required + return nil + } + + if err := validate.MinimumInt("totalDaysRemaining", "body", *m.TotalDaysRemaining, 0, false); err != nil { + return err + } + + return nil +} + +func (m *SITStatus) validateTotalSITDaysUsed(formats strfmt.Registry) error { + if swag.IsZero(m.TotalSITDaysUsed) { // not required + return nil + } + + if err := validate.MinimumInt("totalSITDaysUsed", "body", *m.TotalSITDaysUsed, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t status based on the context it is used +func (m *SITStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrentSIT(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePastSITServiceItemGroupings(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITStatus) contextValidateCurrentSIT(ctx context.Context, formats strfmt.Registry) error { + + if m.CurrentSIT != nil { + + if swag.IsZero(m.CurrentSIT) { // not required + return nil + } + + if err := m.CurrentSIT.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentSIT") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentSIT") + } + return err + } + } + + return nil +} + +func (m *SITStatus) contextValidatePastSITServiceItemGroupings(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PastSITServiceItemGroupings.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pastSITServiceItemGroupings") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pastSITServiceItemGroupings") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITStatus) UnmarshalBinary(b []byte) error { + var res SITStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// SITStatusCurrentSIT s i t status current s i t +// +// swagger:model SITStatusCurrentSIT +type SITStatusCurrentSIT struct { + + // days in s i t + // Minimum: 0 + DaysInSIT *int64 `json:"daysInSIT,omitempty"` + + // location + // Enum: [ORIGIN DESTINATION] + Location interface{} `json:"location,omitempty"` + + // service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ServiceItemID strfmt.UUID `json:"serviceItemID,omitempty"` + + // sit authorized end date + // Format: date + SitAuthorizedEndDate *strfmt.Date `json:"sitAuthorizedEndDate,omitempty"` + + // sit customer contacted + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // sit departure date + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit entry date + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit requested delivery + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` +} + +// Validate validates this s i t status current s i t +func (m *SITStatusCurrentSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDaysInSIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitAuthorizedEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITStatusCurrentSIT) validateDaysInSIT(formats strfmt.Registry) error { + if swag.IsZero(m.DaysInSIT) { // not required + return nil + } + + if err := validate.MinimumInt("currentSIT"+"."+"daysInSIT", "body", *m.DaysInSIT, 0, false); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"serviceItemID", "body", "uuid", m.ServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateSitAuthorizedEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitAuthorizedEndDate) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"sitAuthorizedEndDate", "body", "date", m.SitAuthorizedEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateSitDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateSitEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITStatusCurrentSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("currentSIT"+"."+"sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this s i t status current s i t based on context it is used +func (m *SITStatusCurrentSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SITStatusCurrentSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITStatusCurrentSIT) UnmarshalBinary(b []byte) error { + var res SITStatusCurrentSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/s_i_t_summary.go b/pkg/gen/ghcmessages/s_i_t_summary.go new file mode 100644 index 00000000000..02e65e6428e --- /dev/null +++ b/pkg/gen/ghcmessages/s_i_t_summary.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITSummary s i t summary +// +// swagger:model SITSummary +type SITSummary struct { + + // days in s i t + // Minimum: 0 + DaysInSIT *int64 `json:"daysInSIT,omitempty"` + + // first day s i t service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + FirstDaySITServiceItemID strfmt.UUID `json:"firstDaySITServiceItemID,omitempty"` + + // location + // Enum: [ORIGIN DESTINATION] + Location interface{} `json:"location,omitempty"` + + // sit authorized end date + // Format: date-time + SitAuthorizedEndDate strfmt.DateTime `json:"sitAuthorizedEndDate,omitempty"` + + // sit customer contacted + // Format: date-time + SitCustomerContacted *strfmt.DateTime `json:"sitCustomerContacted,omitempty"` + + // sit departure date + // Format: date-time + SitDepartureDate *strfmt.DateTime `json:"sitDepartureDate,omitempty"` + + // sit entry date + // Format: date-time + SitEntryDate strfmt.DateTime `json:"sitEntryDate,omitempty"` + + // sit requested delivery + // Format: date-time + SitRequestedDelivery *strfmt.DateTime `json:"sitRequestedDelivery,omitempty"` +} + +// Validate validates this s i t summary +func (m *SITSummary) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDaysInSIT(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstDaySITServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitAuthorizedEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITSummary) validateDaysInSIT(formats strfmt.Registry) error { + if swag.IsZero(m.DaysInSIT) { // not required + return nil + } + + if err := validate.MinimumInt("daysInSIT", "body", *m.DaysInSIT, 0, false); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateFirstDaySITServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.FirstDaySITServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("firstDaySITServiceItemID", "body", "uuid", m.FirstDaySITServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateSitAuthorizedEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitAuthorizedEndDate) { // not required + return nil + } + + if err := validate.FormatOf("sitAuthorizedEndDate", "body", "date-time", m.SitAuthorizedEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateSitCustomerContacted(formats strfmt.Registry) error { + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date-time", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateSitDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date-time", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateSitEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITSummary) validateSitRequestedDelivery(formats strfmt.Registry) error { + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date-time", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this s i t summary based on context it is used +func (m *SITSummary) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SITSummary) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITSummary) UnmarshalBinary(b []byte) error { + var res SITSummary + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/search_customer.go b/pkg/gen/ghcmessages/search_customer.go new file mode 100644 index 00000000000..f35e52f734c --- /dev/null +++ b/pkg/gen/ghcmessages/search_customer.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SearchCustomer search customer +// +// swagger:model SearchCustomer +type SearchCustomer struct { + + // branch + Branch string `json:"branch,omitempty"` + + // edipi + Edipi *string `json:"edipi,omitempty"` + + // emplid + Emplid *string `json:"emplid,omitempty"` + + // first name + // Example: John + FirstName *string `json:"firstName,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Doe + LastName *string `json:"lastName,omitempty"` + + // personal email + // Example: personalEmail@email.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail *string `json:"personalEmail,omitempty"` + + // telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` +} + +// Validate validates this search customer +func (m *SearchCustomer) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchCustomer) 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 *SearchCustomer) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personalEmail", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *SearchCustomer) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this search customer based on context it is used +func (m *SearchCustomer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SearchCustomer) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SearchCustomer) UnmarshalBinary(b []byte) error { + var res SearchCustomer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/search_customers.go b/pkg/gen/ghcmessages/search_customers.go new file mode 100644 index 00000000000..5b090aea851 --- /dev/null +++ b/pkg/gen/ghcmessages/search_customers.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SearchCustomers search customers +// +// swagger:model SearchCustomers +type SearchCustomers []*SearchCustomer + +// Validate validates this search customers +func (m SearchCustomers) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this search customers based on the context it is used +func (m SearchCustomers) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/search_customers_result.go b/pkg/gen/ghcmessages/search_customers_result.go new file mode 100644 index 00000000000..5abcaf215ec --- /dev/null +++ b/pkg/gen/ghcmessages/search_customers_result.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SearchCustomersResult search customers result +// +// swagger:model SearchCustomersResult +type SearchCustomersResult struct { + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // search customers + SearchCustomers SearchCustomers `json:"searchCustomers,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this search customers result +func (m *SearchCustomersResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSearchCustomers(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchCustomersResult) validateSearchCustomers(formats strfmt.Registry) error { + if swag.IsZero(m.SearchCustomers) { // not required + return nil + } + + if err := m.SearchCustomers.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchCustomers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("searchCustomers") + } + return err + } + + return nil +} + +// ContextValidate validate this search customers result based on the context it is used +func (m *SearchCustomersResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSearchCustomers(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchCustomersResult) contextValidateSearchCustomers(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SearchCustomers.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchCustomers") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("searchCustomers") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SearchCustomersResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SearchCustomersResult) UnmarshalBinary(b []byte) error { + var res SearchCustomersResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/search_move.go b/pkg/gen/ghcmessages/search_move.go new file mode 100644 index 00000000000..f0f91015deb --- /dev/null +++ b/pkg/gen/ghcmessages/search_move.go @@ -0,0 +1,370 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SearchMove search move +// +// swagger:model SearchMove +type SearchMove struct { + + // branch + Branch string `json:"branch,omitempty"` + + // destination g b l o c + DestinationGBLOC GBLOC `json:"destinationGBLOC,omitempty"` + + // ZIP + // Example: 90210 + // Pattern: ^(\d{5})$ + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // edipi + // Example: 1234567890 + Edipi *string `json:"edipi,omitempty"` + + // emplid + Emplid *string `json:"emplid,omitempty"` + + // first name + // Example: John + FirstName *string `json:"firstName,omitempty"` + + // id + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + // Example: Doe + LastName *string `json:"lastName,omitempty"` + + // locator + Locator string `json:"locator,omitempty"` + + // lock expires at + // Format: date-time + LockExpiresAt *strfmt.DateTime `json:"lockExpiresAt,omitempty"` + + // locked by office user ID + // Format: uuid + LockedByOfficeUserID *strfmt.UUID `json:"lockedByOfficeUserID,omitempty"` + + // order type + OrderType string `json:"orderType,omitempty"` + + // ZIP + // Example: 90210 + // Pattern: ^(\d{5})$ + OriginDutyLocationPostalCode string `json:"originDutyLocationPostalCode,omitempty"` + + // origin g b l o c + OriginGBLOC GBLOC `json:"originGBLOC,omitempty"` + + // payment request code + // Example: 9551-6199-2 + PaymentRequestCode *string `json:"paymentRequestCode,omitempty"` + + // requested delivery date + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // shipments count + ShipmentsCount int64 `json:"shipmentsCount,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` +} + +// Validate validates this search move +func (m *SearchMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDestinationGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockExpiresAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLockedByOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginGBLOC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(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 *SearchMove) validateDestinationGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationGBLOC) { // not required + return nil + } + + if err := m.DestinationGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationGBLOC") + } + return err + } + + return nil +} + +func (m *SearchMove) validateDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("destinationPostalCode", "body", m.DestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) 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 *SearchMove) validateLockExpiresAt(formats strfmt.Registry) error { + if swag.IsZero(m.LockExpiresAt) { // not required + return nil + } + + if err := validate.FormatOf("lockExpiresAt", "body", "date-time", m.LockExpiresAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) validateLockedByOfficeUserID(formats strfmt.Registry) error { + if swag.IsZero(m.LockedByOfficeUserID) { // not required + return nil + } + + if err := validate.FormatOf("lockedByOfficeUserID", "body", "uuid", m.LockedByOfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) validateOriginDutyLocationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("originDutyLocationPostalCode", "body", m.OriginDutyLocationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) validateOriginGBLOC(formats strfmt.Registry) error { + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *SearchMove) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SearchMove) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this search move based on the context it is used +func (m *SearchMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchMove) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.DestinationGBLOC) { // not required + return nil + } + + if err := m.DestinationGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationGBLOC") + } + return err + } + + return nil +} + +func (m *SearchMove) contextValidateOriginGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OriginGBLOC) { // not required + return nil + } + + if err := m.OriginGBLOC.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originGBLOC") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originGBLOC") + } + return err + } + + return nil +} + +func (m *SearchMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SearchMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SearchMove) UnmarshalBinary(b []byte) error { + var res SearchMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/search_moves.go b/pkg/gen/ghcmessages/search_moves.go new file mode 100644 index 00000000000..0b85d95454d --- /dev/null +++ b/pkg/gen/ghcmessages/search_moves.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SearchMoves search moves +// +// swagger:model SearchMoves +type SearchMoves []*SearchMove + +// Validate validates this search moves +func (m SearchMoves) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this search moves based on the context it is used +func (m SearchMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/search_moves_result.go b/pkg/gen/ghcmessages/search_moves_result.go new file mode 100644 index 00000000000..18d050fdbe3 --- /dev/null +++ b/pkg/gen/ghcmessages/search_moves_result.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SearchMovesResult search moves result +// +// swagger:model SearchMovesResult +type SearchMovesResult struct { + + // page + Page int64 `json:"page,omitempty"` + + // per page + PerPage int64 `json:"perPage,omitempty"` + + // search moves + SearchMoves SearchMoves `json:"searchMoves,omitempty"` + + // total count + TotalCount int64 `json:"totalCount,omitempty"` +} + +// Validate validates this search moves result +func (m *SearchMovesResult) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateSearchMoves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchMovesResult) validateSearchMoves(formats strfmt.Registry) error { + if swag.IsZero(m.SearchMoves) { // not required + return nil + } + + if err := m.SearchMoves.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("searchMoves") + } + return err + } + + return nil +} + +// ContextValidate validate this search moves result based on the context it is used +func (m *SearchMovesResult) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSearchMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SearchMovesResult) contextValidateSearchMoves(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SearchMoves.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("searchMoves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("searchMoves") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SearchMovesResult) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SearchMovesResult) UnmarshalBinary(b []byte) error { + var res SearchMovesResult + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/service_item_param_name.go b/pkg/gen/ghcmessages/service_item_param_name.go new file mode 100644 index 00000000000..eff0f3d2734 --- /dev/null +++ b/pkg/gen/ghcmessages/service_item_param_name.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamName service item param name +// +// swagger:model ServiceItemParamName +type ServiceItemParamName string + +func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. +func (m ServiceItemParamName) Pointer() *ServiceItemParamName { + return &m +} + +const ( + + // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" + ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" + + // ServiceItemParamNameContractCode captures enum value "ContractCode" + ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" + + // ServiceItemParamNameContractYearName captures enum value "ContractYearName" + ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" + + // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" + ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" + + // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" + ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" + + // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" + ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" + + // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" + ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" + + // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" + ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" + + // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" + ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" + + // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" + ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" + + // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" + ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" + + // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" + ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" + + // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" + ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" + + // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" + ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" + + // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" + ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" + + // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" + ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" + + // ServiceItemParamNameIsPeak captures enum value "IsPeak" + ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" + + // ServiceItemParamNameMarketDest captures enum value "MarketDest" + ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" + + // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" + ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" + + // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" + ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" + + // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" + ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" + + // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" + ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" + + // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" + ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" + + // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" + ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" + + // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" + ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" + + // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" + ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" + + // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" + ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" + + // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" + ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" + + // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" + ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" + + // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" + ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" + + // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" + ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" + + // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" + ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" + + // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" + ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" + + // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" + ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" + + // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" + ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" + ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" + + // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" + ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" + + // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" + ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" + + // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" + + // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" + ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" + + // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" + ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" + + // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" + ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" + + // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" + ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" + + // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" + ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" + + // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" + ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" + + // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" + ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" + + // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" + ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" + + // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" + ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" + + // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" + ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" + + // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" + ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" + + // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" + ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" + + // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" + ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" + + // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" + ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" + + // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" + ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" + + // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" + ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" + + // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" + ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" + + // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" + ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" + + // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" + ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" + + // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" + ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" + + // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" + ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" + + // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" + ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" + + // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" + ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" + + // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" + ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" + + // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" + ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" + + // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" + ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" + + // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" + ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" + + // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" + ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" + + // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" + ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" +) + +// for schema +var serviceItemParamNameEnum []interface{} + +func init() { + var res []ServiceItemParamName + if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) + } +} + +func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { + if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param name +func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param name based on context it is used +func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/service_item_param_origin.go b/pkg/gen/ghcmessages/service_item_param_origin.go new file mode 100644 index 00000000000..b84eef2b788 --- /dev/null +++ b/pkg/gen/ghcmessages/service_item_param_origin.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamOrigin service item param origin +// +// swagger:model ServiceItemParamOrigin +type ServiceItemParamOrigin string + +func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. +func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { + return &m +} + +const ( + + // ServiceItemParamOriginPRIME captures enum value "PRIME" + ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" + + // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" + ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" + + // ServiceItemParamOriginPRICER captures enum value "PRICER" + ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" + + // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" + ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" +) + +// for schema +var serviceItemParamOriginEnum []interface{} + +func init() { + var res []ServiceItemParamOrigin + if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) + } +} + +func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { + if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param origin +func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param origin based on context it is used +func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/service_item_param_type.go b/pkg/gen/ghcmessages/service_item_param_type.go new file mode 100644 index 00000000000..dcd963f29ad --- /dev/null +++ b/pkg/gen/ghcmessages/service_item_param_type.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamType service item param type +// +// swagger:model ServiceItemParamType +type ServiceItemParamType string + +func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. +func (m ServiceItemParamType) Pointer() *ServiceItemParamType { + return &m +} + +const ( + + // ServiceItemParamTypeSTRING captures enum value "STRING" + ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" + + // ServiceItemParamTypeDATE captures enum value "DATE" + ServiceItemParamTypeDATE ServiceItemParamType = "DATE" + + // ServiceItemParamTypeINTEGER captures enum value "INTEGER" + ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" + + // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" + ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" + + // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" + ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" + + // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" + ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" + + // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" + ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" +) + +// for schema +var serviceItemParamTypeEnum []interface{} + +func init() { + var res []ServiceItemParamType + if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) + } +} + +func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { + if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param type +func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param type based on context it is used +func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/service_item_sit_entry_date.go b/pkg/gen/ghcmessages/service_item_sit_entry_date.go new file mode 100644 index 00000000000..3cc6ee77f05 --- /dev/null +++ b/pkg/gen/ghcmessages/service_item_sit_entry_date.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceItemSitEntryDate service item sit entry date +// +// swagger:model ServiceItemSitEntryDate +type ServiceItemSitEntryDate struct { + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // sit entry date + // Format: date-time + SitEntryDate *strfmt.DateTime `json:"sitEntryDate,omitempty"` +} + +// Validate validates this service item sit entry date +func (m *ServiceItemSitEntryDate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceItemSitEntryDate) 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 *ServiceItemSitEntryDate) validateSitEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date-time", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this service item sit entry date based on context it is used +func (m *ServiceItemSitEntryDate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceItemSitEntryDate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceItemSitEntryDate) UnmarshalBinary(b []byte) error { + var res ServiceItemSitEntryDate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/service_request_document.go b/pkg/gen/ghcmessages/service_request_document.go new file mode 100644 index 00000000000..a7a68cd5e0a --- /dev/null +++ b/pkg/gen/ghcmessages/service_request_document.go @@ -0,0 +1,142 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceRequestDocument service request document +// +// swagger:model ServiceRequestDocument +type ServiceRequestDocument struct { + + // mto service item ID + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // uploads + Uploads []*Upload `json:"uploads"` +} + +// Validate validates this service request document +func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request document based on the context it is used +func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { + var res ServiceRequestDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/service_request_documents.go b/pkg/gen/ghcmessages/service_request_documents.go new file mode 100644 index 00000000000..53fb4bfd026 --- /dev/null +++ b/pkg/gen/ghcmessages/service_request_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocuments documents uploaded by the Prime as proof of request for service items +// +// swagger:model ServiceRequestDocuments +type ServiceRequestDocuments []*ServiceRequestDocument + +// Validate validates this service request documents +func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this service request documents based on the context it is used +func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/shipment_address_update.go b/pkg/gen/ghcmessages/shipment_address_update.go new file mode 100644 index 00000000000..d609419c05d --- /dev/null +++ b/pkg/gen/ghcmessages/shipment_address_update.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. +// +// swagger:model ShipmentAddressUpdate +type ShipmentAddressUpdate struct { + + // Contractor Remarks + // + // The reason there is an address change. + // Example: This is a contractor remark + // Required: true + // Read Only: true + ContractorRemarks string `json:"contractorRemarks"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` + + // The distance between the original SIT address and requested new delivery address of shipment + // Example: 88 + // Minimum: 0 + NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` + + // Office Remarks + // + // The TOO comment on approval or rejection. + // Example: This is an office remark + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // The distance between the original SIT address and the previous/old delivery address of shipment + // Example: 50 + // Minimum: 0 + OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` + + // original address + // Required: true + OriginalAddress *Address `json:"originalAddress"` + + // shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID"` + + // sit original address + SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` + + // status + // Required: true + Status ShipmentAddressUpdateStatus `json:"status"` +} + +// Validate validates this shipment address update +func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOldSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.NewSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.OldSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { + + if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { + return err + } + + if m.OriginalAddress != nil { + if err := m.OriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if m.SitOriginalAddress != nil { + if err := m.SitOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this shipment address update based on the context it is used +func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginalAddress != nil { + + if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginalAddress != nil { + + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { + var res ShipmentAddressUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/shipment_address_update_status.go b/pkg/gen/ghcmessages/shipment_address_update_status.go new file mode 100644 index 00000000000..70bec375800 --- /dev/null +++ b/pkg/gen/ghcmessages/shipment_address_update_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdateStatus Status +// +// swagger:model ShipmentAddressUpdateStatus +type ShipmentAddressUpdateStatus string + +func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. +func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { + return &m +} + +const ( + + // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" + ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" + + // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" + ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" + + // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" + ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" +) + +// for schema +var shipmentAddressUpdateStatusEnum []interface{} + +func init() { + var res []ShipmentAddressUpdateStatus + if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) + } +} + +func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { + if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this shipment address update status +func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipment address update status based on the context it is used +func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go b/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go new file mode 100644 index 00000000000..c50869cd9ae --- /dev/null +++ b/pkg/gen/ghcmessages/shipment_payment_s_i_t_balance.go @@ -0,0 +1,186 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentPaymentSITBalance shipment payment s i t balance +// +// swagger:model ShipmentPaymentSITBalance +type ShipmentPaymentSITBalance struct { + + // pending billed end date + // Format: date + PendingBilledEndDate *strfmt.Date `json:"pendingBilledEndDate,omitempty"` + + // pending billed start date + // Format: date + PendingBilledStartDate *strfmt.Date `json:"pendingBilledStartDate,omitempty"` + + // pending s i t days invoiced + PendingSITDaysInvoiced int64 `json:"pendingSITDaysInvoiced,omitempty"` + + // previously billed days + PreviouslyBilledDays *int64 `json:"previouslyBilledDays,omitempty"` + + // previously billed end date + // Format: date + PreviouslyBilledEndDate *strfmt.Date `json:"previouslyBilledEndDate,omitempty"` + + // previously billed start date + // Format: date + PreviouslyBilledStartDate *strfmt.Date `json:"previouslyBilledStartDate,omitempty"` + + // shipment ID + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // total s i t days authorized + TotalSITDaysAuthorized int64 `json:"totalSITDaysAuthorized,omitempty"` + + // total s i t days remaining + TotalSITDaysRemaining int64 `json:"totalSITDaysRemaining,omitempty"` + + // total s i t end date + // Format: date + TotalSITEndDate *strfmt.Date `json:"totalSITEndDate,omitempty"` +} + +// Validate validates this shipment payment s i t balance +func (m *ShipmentPaymentSITBalance) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePendingBilledEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePendingBilledStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreviouslyBilledEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreviouslyBilledStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalSITEndDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentPaymentSITBalance) validatePendingBilledEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.PendingBilledEndDate) { // not required + return nil + } + + if err := validate.FormatOf("pendingBilledEndDate", "body", "date", m.PendingBilledEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentPaymentSITBalance) validatePendingBilledStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.PendingBilledStartDate) { // not required + return nil + } + + if err := validate.FormatOf("pendingBilledStartDate", "body", "date", m.PendingBilledStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentPaymentSITBalance) validatePreviouslyBilledEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.PreviouslyBilledEndDate) { // not required + return nil + } + + if err := validate.FormatOf("previouslyBilledEndDate", "body", "date", m.PreviouslyBilledEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentPaymentSITBalance) validatePreviouslyBilledStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.PreviouslyBilledStartDate) { // not required + return nil + } + + if err := validate.FormatOf("previouslyBilledStartDate", "body", "date", m.PreviouslyBilledStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentPaymentSITBalance) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentPaymentSITBalance) validateTotalSITEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.TotalSITEndDate) { // not required + return nil + } + + if err := validate.FormatOf("totalSITEndDate", "body", "date", m.TotalSITEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this shipment payment s i t balance based on context it is used +func (m *ShipmentPaymentSITBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ShipmentPaymentSITBalance) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentPaymentSITBalance) UnmarshalBinary(b []byte) error { + var res ShipmentPaymentSITBalance + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go b/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go new file mode 100644 index 00000000000..f672b5de6bd --- /dev/null +++ b/pkg/gen/ghcmessages/shipments_payment_s_i_t_balance.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ShipmentsPaymentSITBalance shipments payment s i t balance +// +// swagger:model ShipmentsPaymentSITBalance +type ShipmentsPaymentSITBalance []*ShipmentPaymentSITBalance + +// Validate validates this shipments payment s i t balance +func (m ShipmentsPaymentSITBalance) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipments payment s i t balance based on the context it is used +func (m ShipmentsPaymentSITBalance) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/signed_certification.go b/pkg/gen/ghcmessages/signed_certification.go new file mode 100644 index 00000000000..b6295516c80 --- /dev/null +++ b/pkg/gen/ghcmessages/signed_certification.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SignedCertification Signed certification +// +// swagger:model SignedCertification +type SignedCertification struct { + + // Full text that the customer agreed to and signed. + // Required: true + CertificationText *string `json:"certificationText"` + + // certification type + // Required: true + CertificationType SignedCertificationType `json:"certificationType"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // Date that the customer signed the certification. + // Required: true + // Format: date + Date *strfmt.Date `json:"date"` + + // A hash that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The ID of the signed certification. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // The ID of the move associated with this signed certification. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + MoveID strfmt.UUID `json:"moveId"` + + // The ID of the PPM shipment associated with this signed certification, if any. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + PpmID *strfmt.UUID `json:"ppmId"` + + // The signature that the customer provided. + // Required: true + Signature *string `json:"signature"` + + // The ID of the user that signed. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + SubmittingUserID strfmt.UUID `json:"submittingUserId"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this signed certification +func (m *SignedCertification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificationText(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittingUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertification) validateCertificationText(formats strfmt.Registry) error { + + if err := validate.Required("certificationText", "body", m.CertificationText); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateCertificationType(formats strfmt.Registry) error { + + if err := validate.Required("certificationType", "body", SignedCertificationType(m.CertificationType)); err != nil { + return err + } + + if err := m.CertificationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificationType") + } + return err + } + + return nil +} + +func (m *SignedCertification) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("moveId", "body", strfmt.UUID(m.MoveID)); err != nil { + return err + } + + if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validatePpmID(formats strfmt.Registry) error { + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if err := validate.FormatOf("ppmId", "body", "uuid", m.PpmID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateSignature(formats strfmt.Registry) error { + + if err := validate.Required("signature", "body", m.Signature); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateSubmittingUserID(formats strfmt.Registry) error { + + if err := validate.Required("submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { + return err + } + + if err := validate.FormatOf("submittingUserId", "body", "uuid", m.SubmittingUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this signed certification based on the context it is used +func (m *SignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubmittingUserID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertification) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificationType") + } + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveId", "body", strfmt.UUID(m.MoveID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmId", "body", m.PpmID); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateSubmittingUserID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SignedCertification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SignedCertification) UnmarshalBinary(b []byte) error { + var res SignedCertification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/signed_certification_type.go b/pkg/gen/ghcmessages/signed_certification_type.go new file mode 100644 index 00000000000..2b8c61cab50 --- /dev/null +++ b/pkg/gen/ghcmessages/signed_certification_type.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SignedCertificationType The type of signed certification: +// - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are +// ready to submit their documentation for review. When they submit, they will be asked to sign certifying the +// information is correct. +// - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users. +// - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to +// service-counseling-completed "Submit move details" by service counselor. +// - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue. +// +// swagger:model SignedCertificationType +type SignedCertificationType string + +func NewSignedCertificationType(value SignedCertificationType) *SignedCertificationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SignedCertificationType. +func (m SignedCertificationType) Pointer() *SignedCertificationType { + return &m +} + +const ( + + // SignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" + SignedCertificationTypePPMPAYMENT SignedCertificationType = "PPM_PAYMENT" + + // SignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" + SignedCertificationTypeSHIPMENT SignedCertificationType = "SHIPMENT" + + // SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + + // SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "CLOSEOUT_REVIEWED_PPM_PAYMENT" +) + +// for schema +var signedCertificationTypeEnum []interface{} + +func init() { + var res []SignedCertificationType + if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + signedCertificationTypeEnum = append(signedCertificationTypeEnum, v) + } +} + +func (m SignedCertificationType) validateSignedCertificationTypeEnum(path, location string, value SignedCertificationType) error { + if err := validate.EnumCase(path, location, value, signedCertificationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this signed certification type +func (m SignedCertificationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSignedCertificationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this signed certification type based on the context it is used +func (m SignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", SignedCertificationType(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/storage_facility.go b/pkg/gen/ghcmessages/storage_facility.go new file mode 100644 index 00000000000..e78dcede80e --- /dev/null +++ b/pkg/gen/ghcmessages/storage_facility.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageFacility The Storage Facility information for the shipment +// +// swagger:model StorageFacility +type StorageFacility struct { + + // address + Address *Address `json:"address,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // facility name + FacilityName string `json:"facilityName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lot number + LotNumber *string `json:"lotNumber,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` +} + +// Validate validates this storage facility +func (m *StorageFacility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this storage facility based on the context it is used +func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageFacility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageFacility) UnmarshalBinary(b []byte) error { + var res StorageFacility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/submitted_moving_expense_type.go b/pkg/gen/ghcmessages/submitted_moving_expense_type.go new file mode 100644 index 00000000000..4e4c6e5ebc7 --- /dev/null +++ b/pkg/gen/ghcmessages/submitted_moving_expense_type.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SubmittedMovingExpenseType Customer Submitted Moving Expense Type +// +// swagger:model SubmittedMovingExpenseType +type SubmittedMovingExpenseType string + +func NewSubmittedMovingExpenseType(value SubmittedMovingExpenseType) *SubmittedMovingExpenseType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SubmittedMovingExpenseType. +func (m SubmittedMovingExpenseType) Pointer() *SubmittedMovingExpenseType { + return &m +} + +const ( + + // SubmittedMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" + SubmittedMovingExpenseTypeCONTRACTEDEXPENSE SubmittedMovingExpenseType = "CONTRACTED_EXPENSE" + + // SubmittedMovingExpenseTypeGAS captures enum value "GAS" + SubmittedMovingExpenseTypeGAS SubmittedMovingExpenseType = "GAS" + + // SubmittedMovingExpenseTypeOIL captures enum value "OIL" + SubmittedMovingExpenseTypeOIL SubmittedMovingExpenseType = "OIL" + + // SubmittedMovingExpenseTypeOTHER captures enum value "OTHER" + SubmittedMovingExpenseTypeOTHER SubmittedMovingExpenseType = "OTHER" + + // SubmittedMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" + SubmittedMovingExpenseTypePACKINGMATERIALS SubmittedMovingExpenseType = "PACKING_MATERIALS" + + // SubmittedMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" + SubmittedMovingExpenseTypeRENTALEQUIPMENT SubmittedMovingExpenseType = "RENTAL_EQUIPMENT" + + // SubmittedMovingExpenseTypeSTORAGE captures enum value "STORAGE" + SubmittedMovingExpenseTypeSTORAGE SubmittedMovingExpenseType = "STORAGE" + + // SubmittedMovingExpenseTypeTOLLS captures enum value "TOLLS" + SubmittedMovingExpenseTypeTOLLS SubmittedMovingExpenseType = "TOLLS" + + // SubmittedMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" + SubmittedMovingExpenseTypeWEIGHINGFEE SubmittedMovingExpenseType = "WEIGHING_FEE" +) + +// for schema +var submittedMovingExpenseTypeEnum []interface{} + +func init() { + var res []SubmittedMovingExpenseType + if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + submittedMovingExpenseTypeEnum = append(submittedMovingExpenseTypeEnum, v) + } +} + +func (m SubmittedMovingExpenseType) validateSubmittedMovingExpenseTypeEnum(path, location string, value SubmittedMovingExpenseType) error { + if err := validate.EnumCase(path, location, value, submittedMovingExpenseTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this submitted moving expense type +func (m SubmittedMovingExpenseType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSubmittedMovingExpenseTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this submitted moving expense type based on context it is used +func (m SubmittedMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/ghcmessages/tac_valid.go b/pkg/gen/ghcmessages/tac_valid.go new file mode 100644 index 00000000000..2b5bef8f266 --- /dev/null +++ b/pkg/gen/ghcmessages/tac_valid.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TacValid tac valid +// +// swagger:model TacValid +type TacValid struct { + + // is valid + // Example: true + // Required: true + IsValid *bool `json:"isValid"` +} + +// Validate validates this tac valid +func (m *TacValid) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateIsValid(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TacValid) validateIsValid(formats strfmt.Registry) error { + + if err := validate.Required("isValid", "body", m.IsValid); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this tac valid based on context it is used +func (m *TacValid) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *TacValid) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TacValid) UnmarshalBinary(b []byte) error { + var res TacValid + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/transportation_office.go b/pkg/gen/ghcmessages/transportation_office.go new file mode 100644 index 00000000000..75b4fa95068 --- /dev/null +++ b/pkg/gen/ghcmessages/transportation_office.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOffice transportation office +// +// swagger:model TransportationOffice +type TransportationOffice struct { + + // address + // Required: true + Address *Address `json:"address"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // gbloc + // Example: JENQ + // Pattern: ^[A-Z]{4}$ + Gbloc string `json:"gbloc,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // latitude + // Example: 29.382973 + Latitude float32 `json:"latitude,omitempty"` + + // longitude + // Example: -98.62759 + Longitude float32 `json:"longitude,omitempty"` + + // name + // Example: Fort Bragg North Station + // Required: true + Name *string `json:"name"` + + // phone lines + PhoneLines []string `json:"phone_lines"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this transportation office +func (m *TransportationOffice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGbloc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhoneLines(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { + if swag.IsZero(m.Gbloc) { // not required + return nil + } + + if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { + if swag.IsZero(m.PhoneLines) { // not required + return nil + } + + for i := 0; i < len(m.PhoneLines); i++ { + + if err := validate.Pattern("phone_lines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + } + + return nil +} + +func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office based on the context it is used +func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOffice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOffice) UnmarshalBinary(b []byte) error { + var res TransportationOffice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/transportation_office_assignment.go b/pkg/gen/ghcmessages/transportation_office_assignment.go new file mode 100644 index 00000000000..c370c5902af --- /dev/null +++ b/pkg/gen/ghcmessages/transportation_office_assignment.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOfficeAssignment transportation office assignment +// +// swagger:model TransportationOfficeAssignment +type TransportationOfficeAssignment struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // office user Id + // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 + // Required: true + // Format: uuid + OfficeUserID *strfmt.UUID `json:"officeUserId"` + + // primary office + // Required: true + PrimaryOffice *bool `json:"primaryOffice"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` + + // transportation office Id + // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 + // Required: true + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this transportation office assignment +func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimaryOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.Required("officeUserId", "body", m.OfficeUserID); err != nil { + return err + } + + if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validatePrimaryOffice(formats strfmt.Registry) error { + + if err := validate.Required("primaryOffice", "body", m.PrimaryOffice); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office assignment based on the context it is used +func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { + var res TransportationOfficeAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/transportation_offices.go b/pkg/gen/ghcmessages/transportation_offices.go new file mode 100644 index 00000000000..d964c5c3733 --- /dev/null +++ b/pkg/gen/ghcmessages/transportation_offices.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransportationOffices transportation offices +// +// swagger:model TransportationOffices +type TransportationOffices []*TransportationOffice + +// Validate validates this transportation offices +func (m TransportationOffices) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this transportation offices based on the context it is used +func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go new file mode 100644 index 00000000000..ee0d677c0e7 --- /dev/null +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateAllowancePayload update allowance payload +// +// swagger:model UpdateAllowancePayload +type UpdateAllowancePayload struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + + // agency + Agency *Affiliation `json:"agency,omitempty"` + + // dependents authorized + DependentsAuthorized *bool `json:"dependentsAuthorized,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependentsTwelveAndOver,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependentsUnderTwelve,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. + GunSafe *bool `json:"gunSafe,omitempty"` + + // only for Army + OrganizationalClothingAndIndividualEquipment *bool `json:"organizationalClothingAndIndividualEquipment,omitempty"` + + // unit is in lbs + // Example: 2000 + // Maximum: 2000 + // Minimum: 0 + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // unit is in lbs + // Example: 500 + // Maximum: 500 + // Minimum: 0 + ProGearWeightSpouse *int64 `json:"proGearWeightSpouse,omitempty"` + + // unit is in lbs + // Example: 2000 + // Minimum: 0 + RequiredMedicalEquipmentWeight *int64 `json:"requiredMedicalEquipmentWeight,omitempty"` + + // the number of storage in transit days that the customer is entitled to for a given shipment on their move + // Minimum: 0 + StorageInTransit *int64 `json:"storageInTransit,omitempty"` + + // ub allowance + // Example: 500 + UbAllowance *int64 `json:"ubAllowance,omitempty"` +} + +// Validate validates this update allowance payload +func (m *UpdateAllowancePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgency(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightSpouse(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredMedicalEquipmentWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageInTransit(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAllowancePayload) validateAgency(formats strfmt.Registry) error { + if swag.IsZero(m.Agency) { // not required + return nil + } + + if m.Agency != nil { + if err := m.Agency.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *UpdateAllowancePayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *UpdateAllowancePayload) validateProGearWeight(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeight) { // not required + return nil + } + + if err := validate.MinimumInt("proGearWeight", "body", *m.ProGearWeight, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("proGearWeight", "body", *m.ProGearWeight, 2000, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateAllowancePayload) validateProGearWeightSpouse(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeightSpouse) { // not required + return nil + } + + if err := validate.MinimumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 0, false); err != nil { + return err + } + + if err := validate.MaximumInt("proGearWeightSpouse", "body", *m.ProGearWeightSpouse, 500, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateAllowancePayload) validateRequiredMedicalEquipmentWeight(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredMedicalEquipmentWeight) { // not required + return nil + } + + if err := validate.MinimumInt("requiredMedicalEquipmentWeight", "body", *m.RequiredMedicalEquipmentWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateAllowancePayload) validateStorageInTransit(formats strfmt.Registry) error { + if swag.IsZero(m.StorageInTransit) { // not required + return nil + } + + if err := validate.MinimumInt("storageInTransit", "body", *m.StorageInTransit, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update allowance payload based on the context it is used +func (m *UpdateAllowancePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgency(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateAllowancePayload) contextValidateAgency(ctx context.Context, formats strfmt.Registry) error { + + if m.Agency != nil { + + if swag.IsZero(m.Agency) { // not required + return nil + } + + if err := m.Agency.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agency") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agency") + } + return err + } + } + + return nil +} + +func (m *UpdateAllowancePayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateAllowancePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateAllowancePayload) UnmarshalBinary(b []byte) error { + var res UpdateAllowancePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_billable_weight_payload.go b/pkg/gen/ghcmessages/update_billable_weight_payload.go new file mode 100644 index 00000000000..63c423f2849 --- /dev/null +++ b/pkg/gen/ghcmessages/update_billable_weight_payload.go @@ -0,0 +1,75 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateBillableWeightPayload update billable weight payload +// +// swagger:model UpdateBillableWeightPayload +type UpdateBillableWeightPayload struct { + + // unit is in lbs + // Example: 2000 + // Minimum: 1 + AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` +} + +// Validate validates this update billable weight payload +func (m *UpdateBillableWeightPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthorizedWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateBillableWeightPayload) validateAuthorizedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AuthorizedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("authorizedWeight", "body", *m.AuthorizedWeight, 1, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update billable weight payload based on context it is used +func (m *UpdateBillableWeightPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateBillableWeightPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateBillableWeightPayload) UnmarshalBinary(b []byte) error { + var res UpdateBillableWeightPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_boat_shipment.go b/pkg/gen/ghcmessages/update_boat_shipment.go new file mode 100644 index 00000000000..bcc443a6e6c --- /dev/null +++ b/pkg/gen/ghcmessages/update_boat_shipment.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateBoatShipment update boat shipment +// +// swagger:model UpdateBoatShipment +type UpdateBoatShipment struct { + + // Does the boat have a trailer + HasTrailer *bool `json:"hasTrailer,omitempty"` + + // Height of the Boat in inches + HeightInInches *int64 `json:"heightInInches,omitempty"` + + // Is the trailer roadworthy + IsRoadworthy *bool `json:"isRoadworthy,omitempty"` + + // Length of the Boat in inches + LengthInInches *int64 `json:"lengthInInches,omitempty"` + + // Make of the Boat + Make *string `json:"make,omitempty"` + + // Model of the Boat + Model *string `json:"model,omitempty"` + + // type + // Enum: [HAUL_AWAY TOW_AWAY] + Type *string `json:"type,omitempty"` + + // Width of the Boat in inches + WidthInInches *int64 `json:"widthInInches,omitempty"` + + // Year of the Boat + Year *int64 `json:"year,omitempty"` +} + +// Validate validates this update boat shipment +func (m *UpdateBoatShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateBoatShipmentTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateBoatShipmentTypeTypePropEnum = append(updateBoatShipmentTypeTypePropEnum, v) + } +} + +const ( + + // UpdateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" + UpdateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" + + // UpdateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" + UpdateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" +) + +// prop value enum +func (m *UpdateBoatShipment) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateBoatShipmentTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateBoatShipment) 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 +} + +// ContextValidate validates this update boat shipment based on context it is used +func (m *UpdateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateBoatShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateBoatShipment) UnmarshalBinary(b []byte) error { + var res UpdateBoatShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_customer_payload.go b/pkg/gen/ghcmessages/update_customer_payload.go new file mode 100644 index 00000000000..d86dc5681a2 --- /dev/null +++ b/pkg/gen/ghcmessages/update_customer_payload.go @@ -0,0 +1,247 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateCustomerPayload update customer payload +// +// swagger:model UpdateCustomerPayload +type UpdateCustomerPayload struct { + + // backup address + BackupAddress struct { + Address + } `json:"backupAddress,omitempty"` + + // backup contact + BackupContact *BackupContact `json:"backup_contact,omitempty"` + + // cac validated + CacValidated bool `json:"cac_validated,omitempty"` + + // current address + CurrentAddress struct { + Address + } `json:"current_address,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // email is preferred + EmailIsPreferred bool `json:"emailIsPreferred,omitempty"` + + // first name + // Example: John + FirstName string `json:"first_name,omitempty"` + + // last name + // Example: Doe + LastName string `json:"last_name,omitempty"` + + // middle name + // Example: David + MiddleName *string `json:"middle_name,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` + + // phone is preferred + PhoneIsPreferred bool `json:"phoneIsPreferred,omitempty"` + + // secondary telephone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$|^$ + SecondaryTelephone *string `json:"secondaryTelephone,omitempty"` + + // suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` +} + +// Validate validates this update customer payload +func (m *UpdateCustomerPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBackupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupContact(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCustomerPayload) validateBackupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateCustomerPayload) validateBackupContact(formats strfmt.Registry) error { + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if m.BackupContact != nil { + if err := m.BackupContact.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contact") + } + return err + } + } + + return nil +} + +func (m *UpdateCustomerPayload) validateCurrentAddress(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateCustomerPayload) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateCustomerPayload) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateCustomerPayload) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondaryTelephone", "body", *m.SecondaryTelephone, `^[2-9]\d{2}-\d{3}-\d{4}$|^$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update customer payload based on the context it is used +func (m *UpdateCustomerPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBackupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupContact(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCurrentAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCustomerPayload) contextValidateBackupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateCustomerPayload) contextValidateBackupContact(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupContact != nil { + + if swag.IsZero(m.BackupContact) { // not required + return nil + } + + if err := m.BackupContact.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contact") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contact") + } + return err + } + } + + return nil +} + +func (m *UpdateCustomerPayload) contextValidateCurrentAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateCustomerPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateCustomerPayload) UnmarshalBinary(b []byte) error { + var res UpdateCustomerPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_customer_support_remark_payload.go b/pkg/gen/ghcmessages/update_customer_support_remark_payload.go new file mode 100644 index 00000000000..c57e0202950 --- /dev/null +++ b/pkg/gen/ghcmessages/update_customer_support_remark_payload.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateCustomerSupportRemarkPayload A text remark update to an existing remark created by the current active user (the CSR). +// +// swagger:model UpdateCustomerSupportRemarkPayload +type UpdateCustomerSupportRemarkPayload struct { + + // content + // Example: This is a remark about a move. + // Required: true + Content *string `json:"content"` +} + +// Validate validates this update customer support remark payload +func (m *UpdateCustomerSupportRemarkPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContent(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateCustomerSupportRemarkPayload) validateContent(formats strfmt.Registry) error { + + if err := validate.Required("content", "body", m.Content); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update customer support remark payload based on context it is used +func (m *UpdateCustomerSupportRemarkPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateCustomerSupportRemarkPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateCustomerSupportRemarkPayload) UnmarshalBinary(b []byte) error { + var res UpdateCustomerSupportRemarkPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go b/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go new file mode 100644 index 00000000000..bc473fd5a94 --- /dev/null +++ b/pkg/gen/ghcmessages/update_max_billable_weight_as_t_i_o_payload.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMaxBillableWeightAsTIOPayload update max billable weight as t i o payload +// +// swagger:model UpdateMaxBillableWeightAsTIOPayload +type UpdateMaxBillableWeightAsTIOPayload struct { + + // unit is in lbs + // Example: 2000 + // Required: true + // Minimum: 1 + AuthorizedWeight *int64 `json:"authorizedWeight"` + + // TIO remarks for updating the max billable weight + // Example: Increasing max billable weight + // Required: true + // Min Length: 1 + TioRemarks *string `json:"tioRemarks"` +} + +// Validate validates this update max billable weight as t i o payload +func (m *UpdateMaxBillableWeightAsTIOPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAuthorizedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTioRemarks(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMaxBillableWeightAsTIOPayload) validateAuthorizedWeight(formats strfmt.Registry) error { + + if err := validate.Required("authorizedWeight", "body", m.AuthorizedWeight); err != nil { + return err + } + + if err := validate.MinimumInt("authorizedWeight", "body", *m.AuthorizedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMaxBillableWeightAsTIOPayload) validateTioRemarks(formats strfmt.Registry) error { + + if err := validate.Required("tioRemarks", "body", m.TioRemarks); err != nil { + return err + } + + if err := validate.MinLength("tioRemarks", "body", *m.TioRemarks, 1); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update max billable weight as t i o payload based on context it is used +func (m *UpdateMaxBillableWeightAsTIOPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMaxBillableWeightAsTIOPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMaxBillableWeightAsTIOPayload) UnmarshalBinary(b []byte) error { + var res UpdateMaxBillableWeightAsTIOPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_mobile_home_shipment.go b/pkg/gen/ghcmessages/update_mobile_home_shipment.go new file mode 100644 index 00000000000..7a4df05aa5e --- /dev/null +++ b/pkg/gen/ghcmessages/update_mobile_home_shipment.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateMobileHomeShipment update mobile home shipment +// +// swagger:model UpdateMobileHomeShipment +type UpdateMobileHomeShipment struct { + + // Height of the Boat in inches + HeightInInches *int64 `json:"heightInInches,omitempty"` + + // Length of the Boat in inches + LengthInInches *int64 `json:"lengthInInches,omitempty"` + + // Make of the Boat + Make *string `json:"make,omitempty"` + + // Model of the Boat + Model *string `json:"model,omitempty"` + + // Width of the Boat in inches + WidthInInches *int64 `json:"widthInInches,omitempty"` + + // Year of the Boat + Year *int64 `json:"year,omitempty"` +} + +// Validate validates this update mobile home shipment +func (m *UpdateMobileHomeShipment) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update mobile home shipment based on context it is used +func (m *UpdateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMobileHomeShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMobileHomeShipment) UnmarshalBinary(b []byte) error { + var res UpdateMobileHomeShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_moving_expense.go b/pkg/gen/ghcmessages/update_moving_expense.go new file mode 100644 index 00000000000..c3534bedfa8 --- /dev/null +++ b/pkg/gen/ghcmessages/update_moving_expense.go @@ -0,0 +1,265 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMovingExpense update moving expense +// +// swagger:model UpdateMovingExpense +type UpdateMovingExpense struct { + + // The total amount of the expense as indicated on the receipt + Amount int64 `json:"amount,omitempty"` + + // A brief description of the expense. + Description *string `json:"description"` + + // moving expense type + MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` + + // The reason the services counselor has excluded or rejected the item. + Reason string `json:"reason,omitempty"` + + // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Format: date + SitEndDate strfmt.Date `json:"sitEndDate,omitempty"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The amount of SIT that will be reimbursed + SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` + + // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Format: date + SitStartDate strfmt.Date `json:"sitStartDate,omitempty"` + + // status + Status PPMDocumentStatus `json:"status,omitempty"` + + // The total weight stored in PPM SIT + WeightStored int64 `json:"weightStored,omitempty"` +} + +// Validate validates this update moving expense +func (m *UpdateMovingExpense) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitStartDate(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 *UpdateMovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if m.MovingExpenseType != nil { + if err := m.MovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this update moving expense based on the context it is used +func (m *UpdateMovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.MovingExpenseType != nil { + + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMovingExpense) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMovingExpense) UnmarshalBinary(b []byte) error { + var res UpdateMovingExpense + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_order_payload.go b/pkg/gen/ghcmessages/update_order_payload.go new file mode 100644 index 00000000000..f5a09ceb70d --- /dev/null +++ b/pkg/gen/ghcmessages/update_order_payload.go @@ -0,0 +1,536 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + "github.com/transcom/mymove/pkg/swagger/nullable" +) + +// UpdateOrderPayload update order payload +// +// swagger:model UpdateOrderPayload +type UpdateOrderPayload struct { + + // department indicator + DepartmentIndicator *DeptIndicator `json:"departmentIndicator,omitempty"` + + // grade + Grade *Grade `json:"grade,omitempty"` + + // Orders date + // + // The date and time that these orders were cut. + // Example: 2018-04-26 + // Required: true + // Format: date + IssueDate *strfmt.Date `json:"issueDate"` + + // new duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + NewDutyLocationID *strfmt.UUID `json:"newDutyLocationId"` + + // NTS SAC + // Example: N002214CSW32Y9 + NtsSac nullable.String `json:"ntsSac,omitempty"` + + // NTS TAC + // Example: F8J1 + NtsTac nullable.String `json:"ntsTac,omitempty"` + + // Confirmation that the new amended orders were reviewed after previously approving the original orders + OrdersAcknowledgement *bool `json:"ordersAcknowledgement,omitempty"` + + // Orders Number + // Example: 030-00362 + OrdersNumber *string `json:"ordersNumber,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"ordersType"` + + // orders type detail + OrdersTypeDetail *OrdersTypeDetail `json:"ordersTypeDetail,omitempty"` + + // origin duty location Id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + OriginDutyLocationID *strfmt.UUID `json:"originDutyLocationId"` + + // Report-by date + // + // Report By Date + // Example: 2018-04-26 + // Required: true + // Format: date + ReportByDate *strfmt.Date `json:"reportByDate"` + + // HHG SAC + // Example: N002214CSW32Y9 + Sac nullable.String `json:"sac,omitempty"` + + // HHG TAC + // Example: F8J1 + // Max Length: 4 + // Min Length: 4 + Tac *string `json:"tac,omitempty"` +} + +// Validate validates this update order payload +func (m *UpdateOrderPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNtsSac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNtsTac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSac(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTac(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateOrderPayload) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) validateIssueDate(formats strfmt.Registry) error { + + if err := validate.Required("issueDate", "body", m.IssueDate); err != nil { + return err + } + + if err := validate.FormatOf("issueDate", "body", "date", m.IssueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateNewDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("newDutyLocationId", "body", m.NewDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("newDutyLocationId", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateNtsSac(formats strfmt.Registry) error { + if swag.IsZero(m.NtsSac) { // not required + return nil + } + + if err := m.NtsSac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsSac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsSac") + } + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateNtsTac(formats strfmt.Registry) error { + if swag.IsZero(m.NtsTac) { // not required + return nil + } + + if err := m.NtsTac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsTac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsTac") + } + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("ordersType", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) validateOrdersTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if m.OrdersTypeDetail != nil { + if err := m.OrdersTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) validateOriginDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("originDutyLocationId", "body", m.OriginDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("originDutyLocationId", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateReportByDate(formats strfmt.Registry) error { + + if err := validate.Required("reportByDate", "body", m.ReportByDate); err != nil { + return err + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateSac(formats strfmt.Registry) error { + if swag.IsZero(m.Sac) { // not required + return nil + } + + if err := m.Sac.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sac") + } + return err + } + + return nil +} + +func (m *UpdateOrderPayload) validateTac(formats strfmt.Registry) error { + if swag.IsZero(m.Tac) { // not required + return nil + } + + if err := validate.MinLength("tac", "body", *m.Tac, 4); err != nil { + return err + } + + if err := validate.MaxLength("tac", "body", *m.Tac, 4); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update order payload based on the context it is used +func (m *UpdateOrderPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNtsSac(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNtsTac(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSac(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateOrderPayload) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("departmentIndicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("departmentIndicator") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateNtsSac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.NtsSac) { // not required + return nil + } + + if err := m.NtsSac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsSac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsSac") + } + return err + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateNtsTac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.NtsTac) { // not required + return nil + } + + if err := m.NtsTac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ntsTac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ntsTac") + } + return err + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersTypeDetail != nil { + + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersTypeDetail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersTypeDetail") + } + return err + } + } + + return nil +} + +func (m *UpdateOrderPayload) contextValidateSac(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Sac) { // not required + return nil + } + + if err := m.Sac.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sac") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sac") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateOrderPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateOrderPayload) UnmarshalBinary(b []byte) error { + var res UpdateOrderPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_p_p_m_shipment.go b/pkg/gen/ghcmessages/update_p_p_m_shipment.go new file mode 100644 index 00000000000..1684f99a4c9 --- /dev/null +++ b/pkg/gen/ghcmessages/update_p_p_m_shipment.go @@ -0,0 +1,571 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePPMShipment update p p m shipment +// +// swagger:model UpdatePPMShipment +type UpdatePPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode,omitempty"` + + // actual move date + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate,omitempty"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode,omitempty"` + + // The amount received for an advance, or null if no advance is received + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived,omitempty"` + + // The amount request for an advance, or null if no advance is requested + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested,omitempty"` + + // advance status + AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` + + // The allowable weight of the PPM shipment goods being moved. + // Example: 4300 + // Minimum: 0 + AllowableWeight *int64 `json:"allowableWeight,omitempty"` + + // destination address + DestinationAddress struct { + PPMDestinationAddress + } `json:"destinationAddress,omitempty"` + + // estimated weight + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // Date the customer expects to move. + // + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` + + // Indicates whether PPM shipment has pro gear. + // + HasProGear *bool `json:"hasProGear,omitempty"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance,omitempty"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance,omitempty"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // pickup address + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // pro gear weight + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // secondary destination address + SecondaryDestinationAddress struct { + Address + } `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // sit estimated departure date + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` + + // sit estimated entry date + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` + + // sit estimated weight + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` + + // sit expected + SitExpected *bool `json:"sitExpected,omitempty"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // spouse pro gear weight + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` + + // tertiary destination address + TertiaryDestinationAddress struct { + Address + } `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` + + // w2 address + W2Address *Address `json:"w2Address,omitempty"` +} + +// Validate validates this update p p m shipment +func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAdvanceStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAllowableWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateW2Address(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if m.AdvanceStatus != nil { + if err := m.AdvanceStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateAllowableWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AllowableWeight) { // not required + return nil + } + + if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.ExpectedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateW2Address(formats strfmt.Registry) error { + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if m.W2Address != nil { + if err := m.W2Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update p p m shipment based on the context it is used +func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateW2Address(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.AdvanceStatus != nil { + + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { + + if m.W2Address != nil { + + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if err := m.W2Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { + var res UpdatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_payment_request_status_payload.go b/pkg/gen/ghcmessages/update_payment_request_status_payload.go new file mode 100644 index 00000000000..b6e87663034 --- /dev/null +++ b/pkg/gen/ghcmessages/update_payment_request_status_payload.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdatePaymentRequestStatusPayload update payment request status payload +// +// swagger:model UpdatePaymentRequestStatusPayload +type UpdatePaymentRequestStatusPayload struct { + + // e tag + ETag string `json:"eTag,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this update payment request status payload +func (m *UpdatePaymentRequestStatusPayload) 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 *UpdatePaymentRequestStatusPayload) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this update payment request status payload based on the context it is used +func (m *UpdatePaymentRequestStatusPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePaymentRequestStatusPayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePaymentRequestStatusPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePaymentRequestStatusPayload) UnmarshalBinary(b []byte) error { + var res UpdatePaymentRequestStatusPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go b/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..7cf1e0290ff --- /dev/null +++ b/pkg/gen/ghcmessages/update_pro_gear_weight_ticket.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateProGearWeightTicket update pro gear weight ticket +// +// swagger:model UpdateProGearWeightTicket +type UpdateProGearWeightTicket struct { + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + BelongsToSelf bool `json:"belongsToSelf,omitempty"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + HasWeightTickets bool `json:"hasWeightTickets,omitempty"` + + // The reason the services counselor has excluded or rejected the item. + Reason string `json:"reason,omitempty"` + + // status + Status PPMDocumentStatus `json:"status,omitempty"` + + // Weight of the pro-gear contained in the shipment. + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this update pro gear weight ticket +func (m *UpdateProGearWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateProGearWeightTicket) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *UpdateProGearWeightTicket) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update pro gear weight ticket based on the context it is used +func (m *UpdateProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateProGearWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateProGearWeightTicket) UnmarshalBinary(b []byte) error { + var res UpdateProGearWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go b/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go new file mode 100644 index 00000000000..19cd36e9709 --- /dev/null +++ b/pkg/gen/ghcmessages/update_s_i_t_service_item_customer_expense.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateSITServiceItemCustomerExpense update s i t service item customer expense +// +// swagger:model UpdateSITServiceItemCustomerExpense +type UpdateSITServiceItemCustomerExpense struct { + + // convert to customer expense + // Example: true + // Required: true + ConvertToCustomerExpense *bool `json:"convertToCustomerExpense"` + + // Reason the service item was rejected + // Example: Insufficent details provided + // Required: true + CustomerExpenseReason *string `json:"customerExpenseReason"` +} + +// Validate validates this update s i t service item customer expense +func (m *UpdateSITServiceItemCustomerExpense) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateConvertToCustomerExpense(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerExpenseReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateSITServiceItemCustomerExpense) validateConvertToCustomerExpense(formats strfmt.Registry) error { + + if err := validate.Required("convertToCustomerExpense", "body", m.ConvertToCustomerExpense); err != nil { + return err + } + + return nil +} + +func (m *UpdateSITServiceItemCustomerExpense) validateCustomerExpenseReason(formats strfmt.Registry) error { + + if err := validate.Required("customerExpenseReason", "body", m.CustomerExpenseReason); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update s i t service item customer expense based on context it is used +func (m *UpdateSITServiceItemCustomerExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateSITServiceItemCustomerExpense) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateSITServiceItemCustomerExpense) UnmarshalBinary(b []byte) error { + var res UpdateSITServiceItemCustomerExpense + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_shipment.go b/pkg/gen/ghcmessages/update_shipment.go new file mode 100644 index 00000000000..ec51eca5b62 --- /dev/null +++ b/pkg/gen/ghcmessages/update_shipment.go @@ -0,0 +1,736 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" + "github.com/transcom/mymove/pkg/swagger/nullable" +) + +// UpdateShipment update shipment +// +// swagger:model UpdateShipment +type UpdateShipment struct { + + // actual pro gear weight + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // actual spouse pro gear weight + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // estimated weight of the shuttle service item provided by the prime + // Example: 2500 + BillableWeightCap *int64 `json:"billableWeightCap,omitempty"` + + // billable weight justification + // Example: more weight than expected + BillableWeightJustification *string `json:"billableWeightJustification,omitempty"` + + // boat shipment + BoatShipment *UpdateBoatShipment `json:"boatShipment,omitempty"` + + // counselor remarks + // Example: counselor approved + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // customer remarks + // Example: handle with care + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // destination address + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // has secondary delivery address + HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary delivery address + HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // mobile home shipment + MobileHomeShipment *UpdateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 2000 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // pickup address + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` + + // requested delivery date + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // sac type + SacType nullable.String `json:"sacType,omitempty"` + + // secondary delivery address + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // service order number + ServiceOrderNumber *string `json:"serviceOrderNumber,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // tac type + TacType nullable.String `json:"tacType,omitempty"` + + // tertiary delivery address + TertiaryDeliveryAddress struct { + Address + } `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` + + // uses external vendor + // Example: false + UsesExternalVendor *bool `json:"usesExternalVendor,omitempty"` +} + +// Validate validates this update shipment +func (m *UpdateShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTacType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipment) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipment) validateSacType(formats strfmt.Registry) error { + if swag.IsZero(m.SacType) { // not required + return nil + } + + if err := m.SacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateTacType(formats strfmt.Registry) error { + if swag.IsZero(m.TacType) { // not required + return nil + } + + if err := m.TacType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +// ContextValidate validate this update shipment based on the context it is used +func (m *UpdateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTacType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateSacType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.SacType) { // not required + return nil + } + + if err := m.SacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sacType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateTacType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.TacType) { // not required + return nil + } + + if err := m.TacType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tacType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tacType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateShipment) UnmarshalBinary(b []byte) error { + var res UpdateShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/update_weight_ticket.go b/pkg/gen/ghcmessages/update_weight_ticket.go new file mode 100644 index 00000000000..b1e861e0f11 --- /dev/null +++ b/pkg/gen/ghcmessages/update_weight_ticket.go @@ -0,0 +1,177 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateWeightTicket update weight ticket +// +// swagger:model UpdateWeightTicket +type UpdateWeightTicket struct { + + // Indicates the adjusted net weight of the vehicle + // Minimum: 0 + AdjustedNetWeight *int64 `json:"adjustedNetWeight,omitempty"` + + // Weight of the vehicle when empty. + // Minimum: 0 + EmptyWeight *int64 `json:"emptyWeight,omitempty"` + + // The weight of the vehicle when full. + // Minimum: 0 + FullWeight *int64 `json:"fullWeight,omitempty"` + + // Remarks explaining any edits made to the net weight + NetWeightRemarks string `json:"netWeightRemarks,omitempty"` + + // Indicates if the customer used a trailer they own for the move. + OwnsTrailer bool `json:"ownsTrailer,omitempty"` + + // The reason the services counselor has excluded or rejected the item. + Reason string `json:"reason,omitempty"` + + // status + Status PPMDocumentStatus `json:"status,omitempty"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + TrailerMeetsCriteria bool `json:"trailerMeetsCriteria,omitempty"` +} + +// Validate validates this update weight ticket +func (m *UpdateWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdjustedNetWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(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 *UpdateWeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AdjustedNetWeight) { // not required + return nil + } + + if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateWeightTicket) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateWeightTicket) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateWeightTicket) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this update weight ticket based on the context it is used +func (m *UpdateWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateWeightTicket) UnmarshalBinary(b []byte) error { + var res UpdateWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/upload.go b/pkg/gen/ghcmessages/upload.go new file mode 100644 index 00000000000..3ef93543a04 --- /dev/null +++ b/pkg/gen/ghcmessages/upload.go @@ -0,0 +1,477 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Upload An uploaded file. +// +// swagger:model Upload +type Upload struct { + + // bytes + // Required: true + // Read Only: true + Bytes int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + // Read Only: true + ContentType string `json:"contentType"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // deleted at + // Read Only: true + // Format: date-time + DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + // Read Only: true + Filename string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // is weight ticket + IsWeightTicket bool `json:"isWeightTicket,omitempty"` + + // rotation + // Example: 2 + Rotation int64 `json:"rotation,omitempty"` + + // status + // Read Only: true + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // upload type + // Example: OFFICE + // Read Only: true + // Enum: [USER PRIME OFFICE] + UploadType string `json:"uploadType,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url"` +} + +// Validate validates this upload +func (m *Upload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Upload) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", int64(m.Bytes)); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateContentType(formats strfmt.Registry) error { + + if err := validate.RequiredString("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateDeletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.DeletedAt) { // not required + return nil + } + + if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateFilename(formats strfmt.Registry) error { + + if err := validate.RequiredString("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +var uploadTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadTypeStatusPropEnum = append(uploadTypeStatusPropEnum, v) + } +} + +const ( + + // UploadStatusINFECTED captures enum value "INFECTED" + UploadStatusINFECTED string = "INFECTED" + + // UploadStatusCLEAN captures enum value "CLEAN" + UploadStatusCLEAN string = "CLEAN" + + // UploadStatusPROCESSING captures enum value "PROCESSING" + UploadStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *Upload) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Upload) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +var uploadTypeUploadTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["USER","PRIME","OFFICE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadTypeUploadTypePropEnum = append(uploadTypeUploadTypePropEnum, v) + } +} + +const ( + + // UploadUploadTypeUSER captures enum value "USER" + UploadUploadTypeUSER string = "USER" + + // UploadUploadTypePRIME captures enum value "PRIME" + UploadUploadTypePRIME string = "PRIME" + + // UploadUploadTypeOFFICE captures enum value "OFFICE" + UploadUploadTypeOFFICE string = "OFFICE" +) + +// prop value enum +func (m *Upload) validateUploadTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadTypeUploadTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Upload) validateUploadType(formats strfmt.Registry) error { + if swag.IsZero(m.UploadType) { // not required + return nil + } + + // value enum + if err := m.validateUploadTypeEnum("uploadType", "body", m.UploadType); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload based on the context it is used +func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFilename(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUploadType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Upload) contextValidateBytes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "bytes", "body", int64(m.Bytes)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateContentType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentType", "body", string(m.ContentType)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateDeletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "deletedAt", "body", m.DeletedAt); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateFilename(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "filename", "body", string(m.Filename)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateUploadType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "uploadType", "body", string(m.UploadType)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Upload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Upload) UnmarshalBinary(b []byte) error { + var res Upload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/v_location.go b/pkg/gen/ghcmessages/v_location.go new file mode 100644 index 00000000000..c9e1e2d6e5e --- /dev/null +++ b/pkg/gen/ghcmessages/v_location.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VLocation A postal code, city, and state lookup +// +// swagger:model VLocation +type VLocation struct { + + // City + // Example: Anytown + City string `json:"city,omitempty"` + + // County + // Example: LOS ANGELES + County *string `json:"county,omitempty"` + + // ZIP + // Example: 90210 + // Pattern: ^(\d{5}?)$ + PostalCode string `json:"postalCode,omitempty"` + + // State + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State string `json:"state,omitempty"` + + // us post region cities ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` +} + +// Validate validates this v location +func (m *VLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsPostRegionCitiesID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLocation) validatePostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.PostalCode) { // not required + return nil + } + + if err := validate.Pattern("postalCode", "body", m.PostalCode, `^(\d{5}?)$`); err != nil { + return err + } + + return nil +} + +var vLocationTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + vLocationTypeStatePropEnum = append(vLocationTypeStatePropEnum, v) + } +} + +const ( + + // VLocationStateAL captures enum value "AL" + VLocationStateAL string = "AL" + + // VLocationStateAK captures enum value "AK" + VLocationStateAK string = "AK" + + // VLocationStateAR captures enum value "AR" + VLocationStateAR string = "AR" + + // VLocationStateAZ captures enum value "AZ" + VLocationStateAZ string = "AZ" + + // VLocationStateCA captures enum value "CA" + VLocationStateCA string = "CA" + + // VLocationStateCO captures enum value "CO" + VLocationStateCO string = "CO" + + // VLocationStateCT captures enum value "CT" + VLocationStateCT string = "CT" + + // VLocationStateDC captures enum value "DC" + VLocationStateDC string = "DC" + + // VLocationStateDE captures enum value "DE" + VLocationStateDE string = "DE" + + // VLocationStateFL captures enum value "FL" + VLocationStateFL string = "FL" + + // VLocationStateGA captures enum value "GA" + VLocationStateGA string = "GA" + + // VLocationStateHI captures enum value "HI" + VLocationStateHI string = "HI" + + // VLocationStateIA captures enum value "IA" + VLocationStateIA string = "IA" + + // VLocationStateID captures enum value "ID" + VLocationStateID string = "ID" + + // VLocationStateIL captures enum value "IL" + VLocationStateIL string = "IL" + + // VLocationStateIN captures enum value "IN" + VLocationStateIN string = "IN" + + // VLocationStateKS captures enum value "KS" + VLocationStateKS string = "KS" + + // VLocationStateKY captures enum value "KY" + VLocationStateKY string = "KY" + + // VLocationStateLA captures enum value "LA" + VLocationStateLA string = "LA" + + // VLocationStateMA captures enum value "MA" + VLocationStateMA string = "MA" + + // VLocationStateMD captures enum value "MD" + VLocationStateMD string = "MD" + + // VLocationStateME captures enum value "ME" + VLocationStateME string = "ME" + + // VLocationStateMI captures enum value "MI" + VLocationStateMI string = "MI" + + // VLocationStateMN captures enum value "MN" + VLocationStateMN string = "MN" + + // VLocationStateMO captures enum value "MO" + VLocationStateMO string = "MO" + + // VLocationStateMS captures enum value "MS" + VLocationStateMS string = "MS" + + // VLocationStateMT captures enum value "MT" + VLocationStateMT string = "MT" + + // VLocationStateNC captures enum value "NC" + VLocationStateNC string = "NC" + + // VLocationStateND captures enum value "ND" + VLocationStateND string = "ND" + + // VLocationStateNE captures enum value "NE" + VLocationStateNE string = "NE" + + // VLocationStateNH captures enum value "NH" + VLocationStateNH string = "NH" + + // VLocationStateNJ captures enum value "NJ" + VLocationStateNJ string = "NJ" + + // VLocationStateNM captures enum value "NM" + VLocationStateNM string = "NM" + + // VLocationStateNV captures enum value "NV" + VLocationStateNV string = "NV" + + // VLocationStateNY captures enum value "NY" + VLocationStateNY string = "NY" + + // VLocationStateOH captures enum value "OH" + VLocationStateOH string = "OH" + + // VLocationStateOK captures enum value "OK" + VLocationStateOK string = "OK" + + // VLocationStateOR captures enum value "OR" + VLocationStateOR string = "OR" + + // VLocationStatePA captures enum value "PA" + VLocationStatePA string = "PA" + + // VLocationStateRI captures enum value "RI" + VLocationStateRI string = "RI" + + // VLocationStateSC captures enum value "SC" + VLocationStateSC string = "SC" + + // VLocationStateSD captures enum value "SD" + VLocationStateSD string = "SD" + + // VLocationStateTN captures enum value "TN" + VLocationStateTN string = "TN" + + // VLocationStateTX captures enum value "TX" + VLocationStateTX string = "TX" + + // VLocationStateUT captures enum value "UT" + VLocationStateUT string = "UT" + + // VLocationStateVA captures enum value "VA" + VLocationStateVA string = "VA" + + // VLocationStateVT captures enum value "VT" + VLocationStateVT string = "VT" + + // VLocationStateWA captures enum value "WA" + VLocationStateWA string = "WA" + + // VLocationStateWI captures enum value "WI" + VLocationStateWI string = "WI" + + // VLocationStateWV captures enum value "WV" + VLocationStateWV string = "WV" + + // VLocationStateWY captures enum value "WY" + VLocationStateWY string = "WY" +) + +// prop value enum +func (m *VLocation) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, vLocationTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *VLocation) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +func (m *VLocation) validateUsPostRegionCitiesID(formats strfmt.Registry) error { + if swag.IsZero(m.UsPostRegionCitiesID) { // not required + return nil + } + + if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this v location based on context it is used +func (m *VLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLocation) UnmarshalBinary(b []byte) error { + var res VLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/v_locations.go b/pkg/gen/ghcmessages/v_locations.go new file mode 100644 index 00000000000..82af765b9f3 --- /dev/null +++ b/pkg/gen/ghcmessages/v_locations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VLocations v locations +// +// swagger:model VLocations +type VLocations []*VLocation + +// Validate validates this v locations +func (m VLocations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this v locations based on the context it is used +func (m VLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcmessages/validation_error.go b/pkg/gen/ghcmessages/validation_error.go new file mode 100644 index 00000000000..7f2c695aa8f --- /dev/null +++ b/pkg/gen/ghcmessages/validation_error.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + ValidationErrorAllOf1 + + // invalid fields + // Required: true + InvalidFields map[string]string `json:"invalid_fields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var aO1 ValidationErrorAllOf1 + if err := swag.ReadJSON(raw, &aO1); err != nil { + return err + } + m.ValidationErrorAllOf1 = aO1 + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string]string `json:"invalid_fields"` + } + if err := swag.ReadJSON(raw, &propsValidationError); err != nil { + return err + } + m.InvalidFields = propsValidationError.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + + aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) + if err != nil { + return nil, err + } + _parts = append(_parts, aO1) + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string]string `json:"invalid_fields"` + } + propsValidationError.InvalidFields = m.InvalidFields + + jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) + if errValidationError != nil { + return nil, errValidationError + } + _parts = append(_parts, jsonDataPropsValidationError) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalid_fields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ValidationErrorAllOf1 validation error all of1 +// +// swagger:model ValidationErrorAllOf1 +type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/ghcmessages/weight_ticket.go b/pkg/gen/ghcmessages/weight_ticket.go new file mode 100644 index 00000000000..65435245820 --- /dev/null +++ b/pkg/gen/ghcmessages/weight_ticket.go @@ -0,0 +1,703 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WeightTicket Vehicle and optional trailer information and weight documents used to move this PPM shipment. +// +// swagger:model WeightTicket +type WeightTicket struct { + + // Indicates the adjusted net weight of the vehicle + // Minimum: 0 + AdjustedNetWeight *int64 `json:"adjustedNetWeight"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // empty document + // Required: true + EmptyDocument *Document `json:"emptyDocument"` + + // ID of the document that is associated with the user uploads containing the vehicle weight when empty. + // Required: true + // Read Only: true + // Format: uuid + EmptyDocumentID strfmt.UUID `json:"emptyDocumentId"` + + // Weight of the vehicle when empty. + // Minimum: 0 + EmptyWeight *int64 `json:"emptyWeight"` + + // full document + // Required: true + FullDocument *Document `json:"fullDocument"` + + // ID of the document that is associated with the user uploads containing the vehicle weight when full. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + FullDocumentID strfmt.UUID `json:"fullDocumentId"` + + // The weight of the vehicle when full. + // Minimum: 0 + FullWeight *int64 `json:"fullWeight"` + + // ID of this set of weight tickets. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. + MissingEmptyWeightTicket *bool `json:"missingEmptyWeightTicket"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when full. + MissingFullWeightTicket *bool `json:"missingFullWeightTicket"` + + // Remarks explaining any edits made to the net weight + NetWeightRemarks *string `json:"netWeightRemarks"` + + // Indicates if the customer used a trailer they own for the move. + OwnsTrailer *bool `json:"ownsTrailer"` + + // The ID of the PPM shipment that this set of weight tickets is for. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // proof of trailer ownership document + // Required: true + ProofOfTrailerOwnershipDocument *Document `json:"proofOfTrailerOwnershipDocument"` + + // ID of the document that is associated with the user uploads containing the proof of trailer ownership. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ProofOfTrailerOwnershipDocumentID strfmt.UUID `json:"proofOfTrailerOwnershipDocumentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Customer submitted weight of the vehicle when empty. + // Minimum: 0 + SubmittedEmptyWeight *int64 `json:"submittedEmptyWeight"` + + // Customer submitted weight of the vehicle when full. + // Minimum: 0 + SubmittedFullWeight *int64 `json:"submittedFullWeight"` + + // Indicates if the customer used a trailer they own for the move. + SubmittedOwnsTrailer *bool `json:"submittedOwnsTrailer"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + SubmittedTrailerMeetsCriteria *bool `json:"submittedTrailerMeetsCriteria"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + TrailerMeetsCriteria *bool `json:"trailerMeetsCriteria"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. + VehicleDescription *string `json:"vehicleDescription"` +} + +// Validate validates this weight ticket +func (m *WeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdjustedNetWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfTrailerOwnershipDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfTrailerOwnershipDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AdjustedNetWeight) { // not required + return nil + } + + if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateEmptyDocument(formats strfmt.Registry) error { + + if err := validate.Required("emptyDocument", "body", m.EmptyDocument); err != nil { + return err + } + + if m.EmptyDocument != nil { + if err := m.EmptyDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emptyDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emptyDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateEmptyDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("emptyDocumentId", "body", "uuid", m.EmptyDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateFullDocument(formats strfmt.Registry) error { + + if err := validate.Required("fullDocument", "body", m.FullDocument); err != nil { + return err + } + + if m.FullDocument != nil { + if err := m.FullDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fullDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fullDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateFullDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("fullDocumentId", "body", "uuid", m.FullDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) 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 *WeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateProofOfTrailerOwnershipDocument(formats strfmt.Registry) error { + + if err := validate.Required("proofOfTrailerOwnershipDocument", "body", m.ProofOfTrailerOwnershipDocument); err != nil { + return err + } + + if m.ProofOfTrailerOwnershipDocument != nil { + if err := m.ProofOfTrailerOwnershipDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfTrailerOwnershipDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfTrailerOwnershipDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateProofOfTrailerOwnershipDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("proofOfTrailerOwnershipDocumentId", "body", "uuid", m.ProofOfTrailerOwnershipDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateSubmittedEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedEmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedEmptyWeight", "body", *m.SubmittedEmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateSubmittedFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedFullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedFullWeight", "body", *m.SubmittedFullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this weight ticket based on the context it is used +func (m *WeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEmptyDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEmptyDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFullDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFullDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfTrailerOwnershipDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfTrailerOwnershipDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateEmptyDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.EmptyDocument != nil { + + if err := m.EmptyDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emptyDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emptyDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateEmptyDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateFullDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.FullDocument != nil { + + if err := m.FullDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fullDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fullDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateFullDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.ProofOfTrailerOwnershipDocument != nil { + + if err := m.ProofOfTrailerOwnershipDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfTrailerOwnershipDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfTrailerOwnershipDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WeightTicket) UnmarshalBinary(b []byte) error { + var res WeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/ghcmessages/weight_tickets.go b/pkg/gen/ghcmessages/weight_tickets.go new file mode 100644 index 00000000000..f13786a3ff1 --- /dev/null +++ b/pkg/gen/ghcmessages/weight_tickets.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WeightTickets All weight tickets associated with a PPM shipment. +// +// swagger:model WeightTickets +type WeightTickets []*WeightTicket + +// Validate validates this weight tickets +func (m WeightTickets) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this weight tickets based on the context it is used +func (m WeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/configure_mymove.go b/pkg/gen/internalapi/configure_mymove.go new file mode 100644 index 00000000000..3b277e0037c --- /dev/null +++ b/pkg/gen/internalapi/configure_mymove.go @@ -0,0 +1,453 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package internalapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/addresses" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/application_parameters" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/backup_contacts" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/calendar" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/certification" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/documents" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/duty_locations" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/entitlements" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/feature_flags" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/move_docs" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/moves" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/office" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/okta_profile" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/orders" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/postal_codes" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/ppm" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/queues" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/service_members" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/transportation_offices" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/uploads" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/users" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/internal.yaml --api-package internaloperations --model-package internalmessages --server-package internalapi --principal interface{} --exclude-main + +func configureFlags(api *internaloperations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *internaloperations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + api.MultipartformConsumer = runtime.DiscardConsumer + + api.BinProducer = runtime.ByteStreamProducer() + api.JSONProducer = runtime.JSONProducer() + + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // ppm.CreatePPMUploadMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // uploads.CreateUploadMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // moves.UploadAdditionalDocumentsMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // orders.UploadAmendedOrdersMaxParseMemory = 32 << 20 + + if api.OfficeApproveMoveHandler == nil { + api.OfficeApproveMoveHandler = office.ApproveMoveHandlerFunc(func(params office.ApproveMoveParams) middleware.Responder { + return middleware.NotImplemented("operation office.ApproveMove has not yet been implemented") + }) + } + if api.OfficeApproveReimbursementHandler == nil { + api.OfficeApproveReimbursementHandler = office.ApproveReimbursementHandlerFunc(func(params office.ApproveReimbursementParams) middleware.Responder { + return middleware.NotImplemented("operation office.ApproveReimbursement has not yet been implemented") + }) + } + if api.FeatureFlagsBooleanFeatureFlagForUserHandler == nil { + api.FeatureFlagsBooleanFeatureFlagForUserHandler = feature_flags.BooleanFeatureFlagForUserHandlerFunc(func(params feature_flags.BooleanFeatureFlagForUserParams) middleware.Responder { + return middleware.NotImplemented("operation feature_flags.BooleanFeatureFlagForUser has not yet been implemented") + }) + } + if api.OfficeCancelMoveHandler == nil { + api.OfficeCancelMoveHandler = office.CancelMoveHandlerFunc(func(params office.CancelMoveParams) middleware.Responder { + return middleware.NotImplemented("operation office.CancelMove has not yet been implemented") + }) + } + if api.DocumentsCreateDocumentHandler == nil { + api.DocumentsCreateDocumentHandler = documents.CreateDocumentHandlerFunc(func(params documents.CreateDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation documents.CreateDocument has not yet been implemented") + }) + } + if api.MoveDocsCreateGenericMoveDocumentHandler == nil { + api.MoveDocsCreateGenericMoveDocumentHandler = move_docs.CreateGenericMoveDocumentHandlerFunc(func(params move_docs.CreateGenericMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.CreateGenericMoveDocument has not yet been implemented") + }) + } + if api.MtoShipmentCreateMTOShipmentHandler == nil { + api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }) + } + if api.PpmCreateMovingExpenseHandler == nil { + api.PpmCreateMovingExpenseHandler = ppm.CreateMovingExpenseHandlerFunc(func(params ppm.CreateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateMovingExpense has not yet been implemented") + }) + } + if api.OrdersCreateOrdersHandler == nil { + api.OrdersCreateOrdersHandler = orders.CreateOrdersHandlerFunc(func(params orders.CreateOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.CreateOrders has not yet been implemented") + }) + } + if api.PpmCreatePPMUploadHandler == nil { + api.PpmCreatePPMUploadHandler = ppm.CreatePPMUploadHandlerFunc(func(params ppm.CreatePPMUploadParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreatePPMUpload has not yet been implemented") + }) + } + if api.PpmCreateProGearWeightTicketHandler == nil { + api.PpmCreateProGearWeightTicketHandler = ppm.CreateProGearWeightTicketHandlerFunc(func(params ppm.CreateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateProGearWeightTicket has not yet been implemented") + }) + } + if api.ServiceMembersCreateServiceMemberHandler == nil { + api.ServiceMembersCreateServiceMemberHandler = service_members.CreateServiceMemberHandlerFunc(func(params service_members.CreateServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.CreateServiceMember has not yet been implemented") + }) + } + if api.BackupContactsCreateServiceMemberBackupContactHandler == nil { + api.BackupContactsCreateServiceMemberBackupContactHandler = backup_contacts.CreateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.CreateServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.CreateServiceMemberBackupContact has not yet been implemented") + }) + } + if api.CertificationCreateSignedCertificationHandler == nil { + api.CertificationCreateSignedCertificationHandler = certification.CreateSignedCertificationHandlerFunc(func(params certification.CreateSignedCertificationParams) middleware.Responder { + return middleware.NotImplemented("operation certification.CreateSignedCertification has not yet been implemented") + }) + } + if api.UploadsCreateUploadHandler == nil { + api.UploadsCreateUploadHandler = uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") + }) + } + if api.PpmCreateWeightTicketHandler == nil { + api.PpmCreateWeightTicketHandler = ppm.CreateWeightTicketHandlerFunc(func(params ppm.CreateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateWeightTicket has not yet been implemented") + }) + } + if api.MoveDocsCreateWeightTicketDocumentHandler == nil { + api.MoveDocsCreateWeightTicketDocumentHandler = move_docs.CreateWeightTicketDocumentHandlerFunc(func(params move_docs.CreateWeightTicketDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.CreateWeightTicketDocument has not yet been implemented") + }) + } + if api.MoveDocsDeleteMoveDocumentHandler == nil { + api.MoveDocsDeleteMoveDocumentHandler = move_docs.DeleteMoveDocumentHandlerFunc(func(params move_docs.DeleteMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.DeleteMoveDocument has not yet been implemented") + }) + } + if api.PpmDeleteMovingExpenseHandler == nil { + api.PpmDeleteMovingExpenseHandler = ppm.DeleteMovingExpenseHandlerFunc(func(params ppm.DeleteMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteMovingExpense has not yet been implemented") + }) + } + if api.PpmDeleteProGearWeightTicketHandler == nil { + api.PpmDeleteProGearWeightTicketHandler = ppm.DeleteProGearWeightTicketHandlerFunc(func(params ppm.DeleteProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteProGearWeightTicket has not yet been implemented") + }) + } + if api.MtoShipmentDeleteShipmentHandler == nil { + api.MtoShipmentDeleteShipmentHandler = mto_shipment.DeleteShipmentHandlerFunc(func(params mto_shipment.DeleteShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.DeleteShipment has not yet been implemented") + }) + } + if api.UploadsDeleteUploadHandler == nil { + api.UploadsDeleteUploadHandler = uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") + }) + } + if api.UploadsDeleteUploadsHandler == nil { + api.UploadsDeleteUploadsHandler = uploads.DeleteUploadsHandlerFunc(func(params uploads.DeleteUploadsParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUploads has not yet been implemented") + }) + } + if api.PpmDeleteWeightTicketHandler == nil { + api.PpmDeleteWeightTicketHandler = ppm.DeleteWeightTicketHandlerFunc(func(params ppm.DeleteWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") + }) + } + if api.MovesGetAllMovesHandler == nil { + api.MovesGetAllMovesHandler = moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") + }) + } + if api.AddressesGetLocationByZipCityStateHandler == nil { + api.AddressesGetLocationByZipCityStateHandler = addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") + }) + } + if api.TransportationOfficesGetTransportationOfficesHandler == nil { + api.TransportationOfficesGetTransportationOfficesHandler = transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") + }) + } + if api.EntitlementsIndexEntitlementsHandler == nil { + api.EntitlementsIndexEntitlementsHandler = entitlements.IndexEntitlementsHandlerFunc(func(params entitlements.IndexEntitlementsParams) middleware.Responder { + return middleware.NotImplemented("operation entitlements.IndexEntitlements has not yet been implemented") + }) + } + if api.MoveDocsIndexMoveDocumentsHandler == nil { + api.MoveDocsIndexMoveDocumentsHandler = move_docs.IndexMoveDocumentsHandlerFunc(func(params move_docs.IndexMoveDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.IndexMoveDocuments has not yet been implemented") + }) + } + if api.BackupContactsIndexServiceMemberBackupContactsHandler == nil { + api.BackupContactsIndexServiceMemberBackupContactsHandler = backup_contacts.IndexServiceMemberBackupContactsHandlerFunc(func(params backup_contacts.IndexServiceMemberBackupContactsParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.IndexServiceMemberBackupContacts has not yet been implemented") + }) + } + if api.CertificationIndexSignedCertificationHandler == nil { + api.CertificationIndexSignedCertificationHandler = certification.IndexSignedCertificationHandlerFunc(func(params certification.IndexSignedCertificationParams) middleware.Responder { + return middleware.NotImplemented("operation certification.IndexSignedCertification has not yet been implemented") + }) + } + if api.CalendarIsDateWeekendHolidayHandler == nil { + api.CalendarIsDateWeekendHolidayHandler = calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") + }) + } + if api.UsersIsLoggedInUserHandler == nil { + api.UsersIsLoggedInUserHandler = users.IsLoggedInUserHandlerFunc(func(params users.IsLoggedInUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.IsLoggedInUser has not yet been implemented") + }) + } + if api.MtoShipmentListMTOShipmentsHandler == nil { + api.MtoShipmentListMTOShipmentsHandler = mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") + }) + } + if api.MovesPatchMoveHandler == nil { + api.MovesPatchMoveHandler = moves.PatchMoveHandlerFunc(func(params moves.PatchMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") + }) + } + if api.ServiceMembersPatchServiceMemberHandler == nil { + api.ServiceMembersPatchServiceMemberHandler = service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") + }) + } + if api.PpmResubmitPPMShipmentDocumentationHandler == nil { + api.PpmResubmitPPMShipmentDocumentationHandler = ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") + }) + } + if api.DutyLocationsSearchDutyLocationsHandler == nil { + api.DutyLocationsSearchDutyLocationsHandler = duty_locations.SearchDutyLocationsHandlerFunc(func(params duty_locations.SearchDutyLocationsParams) middleware.Responder { + return middleware.NotImplemented("operation duty_locations.SearchDutyLocations has not yet been implemented") + }) + } + if api.PpmShowAOAPacketHandler == nil { + api.PpmShowAOAPacketHandler = ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") + }) + } + if api.AddressesShowAddressHandler == nil { + api.AddressesShowAddressHandler = addresses.ShowAddressHandlerFunc(func(params addresses.ShowAddressParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.ShowAddress has not yet been implemented") + }) + } + if api.CalendarShowAvailableMoveDatesHandler == nil { + api.CalendarShowAvailableMoveDatesHandler = calendar.ShowAvailableMoveDatesHandlerFunc(func(params calendar.ShowAvailableMoveDatesParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.ShowAvailableMoveDates has not yet been implemented") + }) + } + if api.TransportationOfficesShowCounselingOfficesHandler == nil { + api.TransportationOfficesShowCounselingOfficesHandler = transportation_offices.ShowCounselingOfficesHandlerFunc(func(params transportation_offices.ShowCounselingOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.ShowCounselingOffices has not yet been implemented") + }) + } + if api.DocumentsShowDocumentHandler == nil { + api.DocumentsShowDocumentHandler = documents.ShowDocumentHandlerFunc(func(params documents.ShowDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation documents.ShowDocument has not yet been implemented") + }) + } + if api.TransportationOfficesShowDutyLocationTransportationOfficeHandler == nil { + api.TransportationOfficesShowDutyLocationTransportationOfficeHandler = transportation_offices.ShowDutyLocationTransportationOfficeHandlerFunc(func(params transportation_offices.ShowDutyLocationTransportationOfficeParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.ShowDutyLocationTransportationOffice has not yet been implemented") + }) + } + if api.UsersShowLoggedInUserHandler == nil { + api.UsersShowLoggedInUserHandler = users.ShowLoggedInUserHandlerFunc(func(params users.ShowLoggedInUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.ShowLoggedInUser has not yet been implemented") + }) + } + if api.MovesShowMoveHandler == nil { + api.MovesShowMoveHandler = moves.ShowMoveHandlerFunc(func(params moves.ShowMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.ShowMove has not yet been implemented") + }) + } + if api.OfficeShowOfficeOrdersHandler == nil { + api.OfficeShowOfficeOrdersHandler = office.ShowOfficeOrdersHandlerFunc(func(params office.ShowOfficeOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation office.ShowOfficeOrders has not yet been implemented") + }) + } + if api.OktaProfileShowOktaInfoHandler == nil { + api.OktaProfileShowOktaInfoHandler = okta_profile.ShowOktaInfoHandlerFunc(func(params okta_profile.ShowOktaInfoParams) middleware.Responder { + return middleware.NotImplemented("operation okta_profile.ShowOktaInfo has not yet been implemented") + }) + } + if api.OrdersShowOrdersHandler == nil { + api.OrdersShowOrdersHandler = orders.ShowOrdersHandlerFunc(func(params orders.ShowOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.ShowOrders has not yet been implemented") + }) + } + if api.PpmShowPaymentPacketHandler == nil { + api.PpmShowPaymentPacketHandler = ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") + }) + } + if api.QueuesShowQueueHandler == nil { + api.QueuesShowQueueHandler = queues.ShowQueueHandlerFunc(func(params queues.ShowQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.ShowQueue has not yet been implemented") + }) + } + if api.ServiceMembersShowServiceMemberHandler == nil { + api.ServiceMembersShowServiceMemberHandler = service_members.ShowServiceMemberHandlerFunc(func(params service_members.ShowServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.ShowServiceMember has not yet been implemented") + }) + } + if api.BackupContactsShowServiceMemberBackupContactHandler == nil { + api.BackupContactsShowServiceMemberBackupContactHandler = backup_contacts.ShowServiceMemberBackupContactHandlerFunc(func(params backup_contacts.ShowServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.ShowServiceMemberBackupContact has not yet been implemented") + }) + } + if api.ServiceMembersShowServiceMemberOrdersHandler == nil { + api.ServiceMembersShowServiceMemberOrdersHandler = service_members.ShowServiceMemberOrdersHandlerFunc(func(params service_members.ShowServiceMemberOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.ShowServiceMemberOrders has not yet been implemented") + }) + } + if api.MovesSubmitAmendedOrdersHandler == nil { + api.MovesSubmitAmendedOrdersHandler = moves.SubmitAmendedOrdersHandlerFunc(func(params moves.SubmitAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation moves.SubmitAmendedOrders has not yet been implemented") + }) + } + if api.MovesSubmitMoveForApprovalHandler == nil { + api.MovesSubmitMoveForApprovalHandler = moves.SubmitMoveForApprovalHandlerFunc(func(params moves.SubmitMoveForApprovalParams) middleware.Responder { + return middleware.NotImplemented("operation moves.SubmitMoveForApproval has not yet been implemented") + }) + } + if api.PpmSubmitPPMShipmentDocumentationHandler == nil { + api.PpmSubmitPPMShipmentDocumentationHandler = ppm.SubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.SubmitPPMShipmentDocumentationParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentHandler == nil { + api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }) + } + if api.MoveDocsUpdateMoveDocumentHandler == nil { + api.MoveDocsUpdateMoveDocumentHandler = move_docs.UpdateMoveDocumentHandlerFunc(func(params move_docs.UpdateMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.UpdateMoveDocument has not yet been implemented") + }) + } + if api.PpmUpdateMovingExpenseHandler == nil { + api.PpmUpdateMovingExpenseHandler = ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") + }) + } + if api.OktaProfileUpdateOktaInfoHandler == nil { + api.OktaProfileUpdateOktaInfoHandler = okta_profile.UpdateOktaInfoHandlerFunc(func(params okta_profile.UpdateOktaInfoParams) middleware.Responder { + return middleware.NotImplemented("operation okta_profile.UpdateOktaInfo has not yet been implemented") + }) + } + if api.OrdersUpdateOrdersHandler == nil { + api.OrdersUpdateOrdersHandler = orders.UpdateOrdersHandlerFunc(func(params orders.UpdateOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.UpdateOrders has not yet been implemented") + }) + } + if api.PpmUpdateProGearWeightTicketHandler == nil { + api.PpmUpdateProGearWeightTicketHandler = ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") + }) + } + if api.BackupContactsUpdateServiceMemberBackupContactHandler == nil { + api.BackupContactsUpdateServiceMemberBackupContactHandler = backup_contacts.UpdateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.UpdateServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.UpdateServiceMemberBackupContact has not yet been implemented") + }) + } + if api.PpmUpdateWeightTicketHandler == nil { + api.PpmUpdateWeightTicketHandler = ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") + }) + } + if api.MovesUploadAdditionalDocumentsHandler == nil { + api.MovesUploadAdditionalDocumentsHandler = moves.UploadAdditionalDocumentsHandlerFunc(func(params moves.UploadAdditionalDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation moves.UploadAdditionalDocuments has not yet been implemented") + }) + } + if api.OrdersUploadAmendedOrdersHandler == nil { + api.OrdersUploadAmendedOrdersHandler = orders.UploadAmendedOrdersHandlerFunc(func(params orders.UploadAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.UploadAmendedOrders has not yet been implemented") + }) + } + if api.ApplicationParametersValidateHandler == nil { + api.ApplicationParametersValidateHandler = application_parameters.ValidateHandlerFunc(func(params application_parameters.ValidateParams) middleware.Responder { + return middleware.NotImplemented("operation application_parameters.Validate has not yet been implemented") + }) + } + if api.PostalCodesValidatePostalCodeWithRateDataHandler == nil { + api.PostalCodesValidatePostalCodeWithRateDataHandler = postal_codes.ValidatePostalCodeWithRateDataHandlerFunc(func(params postal_codes.ValidatePostalCodeWithRateDataParams) middleware.Responder { + return middleware.NotImplemented("operation postal_codes.ValidatePostalCodeWithRateData has not yet been implemented") + }) + } + if api.FeatureFlagsVariantFeatureFlagForUserHandler == nil { + api.FeatureFlagsVariantFeatureFlagForUserHandler = feature_flags.VariantFeatureFlagForUserHandlerFunc(func(params feature_flags.VariantFeatureFlagForUserParams) middleware.Responder { + return middleware.NotImplemented("operation feature_flags.VariantFeatureFlagForUser has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/internalapi/doc.go b/pkg/gen/internalapi/doc.go new file mode 100644 index 00000000000..463e7be3e81 --- /dev/null +++ b/pkg/gen/internalapi/doc.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package internalapi MilMove Internal API +// +// The Internal API is a RESTful API that enables the Customer application for +// MilMove. +// +// All endpoints are located under `/internal`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /internal +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// - multipart/form-data +// +// Produces: +// - application/pdf +// - application/json +// +// swagger:meta +package internalapi diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go new file mode 100644 index 00000000000..0e198c6c4e6 --- /dev/null +++ b/pkg/gen/internalapi/embedded_spec.go @@ -0,0 +1,17822 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalapi + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "swagger": "2.0", + "info": { + "description": "The Internal API is a RESTful API that enables the Customer application for\nMilMove.\n\nAll endpoints are located under ` + "`" + `/internal` + "`" + `.\n", + "title": "MilMove Internal API", + "contact": { + "email": "ppp@truss.works" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/internal", + "paths": { + "/addresses/zip-city-lookup/{search}": { + "get": { + "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string", + "operationId": "getLocationByZipCityState", + "parameters": [ + { + "type": "string", + "name": "search", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested list of city, state, county, and postal code matches", + "schema": { + "$ref": "#/definitions/VLocations" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/addresses/{addressId}": { + "get": { + "description": "Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns an address", + "operationId": "showAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the address to return", + "name": "addressId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested address", + "schema": { + "$ref": "#/definitions/Address" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/allmoves/{serviceMemberId}": { + "get": { + "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moves" + ], + "summary": "Return the current and previous moves of a service member", + "operationId": "getAllMoves", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/MovesList" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/application_parameters": { + "post": { + "description": "Searches for an application parameter by name and value, returns nil if not found", + "tags": [ + "application_parameters" + ], + "summary": "Searches for an application parameter by name and value, returns nil if not found", + "operationId": "validate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + } + ], + "responses": { + "200": { + "description": "Application Parameters", + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + }, + "/backup_contacts/{backupContactId}": { + "get": { + "description": "Returns the given service member backup contact", + "tags": [ + "backup_contacts" + ], + "summary": "Returns the given service member backup contact", + "operationId": "showServiceMemberBackupContact", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member backup contact", + "name": "backupContactId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "backup contact not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "put": { + "description": "Any fields sent in this request will be set on the backup contact referenced", + "tags": [ + "backup_contacts" + ], + "summary": "Updates a service member backup contact", + "operationId": "updateServiceMemberBackupContact", + "parameters": [ + { + "name": "updateServiceMemberBackupContactPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateServiceMemberBackupContactPayload" + } + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member backup contact", + "name": "backupContactId", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "updated instance of backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "backup contact not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/calendar/available_move_dates": { + "get": { + "description": "Returns available dates for the move calendar", + "tags": [ + "calendar" + ], + "summary": "Returns available dates for the move calendar", + "operationId": "showAvailableMoveDates", + "parameters": [ + { + "type": "string", + "format": "date", + "description": "Look for future available dates starting from (and including) this date", + "name": "startDate", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "List of available dates", + "schema": { + "$ref": "#/definitions/AvailableMoveDates" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/calendar/{countryCode}/is-weekend-holiday/{date}": { + "get": { + "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", + "produces": [ + "application/json" + ], + "tags": [ + "calendar" + ], + "summary": "Validate move date selection", + "operationId": "isDateWeekendHoliday", + "parameters": [ + { + "enum": [ + "US" + ], + "type": "string", + "description": "country code for context of date", + "name": "countryCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date", + "description": "input date to determine if weekend/holiday for given country.", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully determine if given date is weekend and/or holiday for given country.", + "schema": { + "$ref": "#/definitions/IsDateWeekendHolidayInfo" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/documents": { + "post": { + "description": "Documents represent a physical artifact such as a scanned document or a PDF file", + "tags": [ + "documents" + ], + "summary": "Create a new document", + "operationId": "createDocument", + "parameters": [ + { + "name": "documentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostDocumentPayload" + } + } + ], + "responses": { + "201": { + "description": "created document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request" + }, + "500": { + "description": "server error" + } + } + } + }, + "/documents/{documentId}": { + "get": { + "description": "Returns a document and its uploads", + "tags": [ + "documents" + ], + "summary": "Returns a document", + "operationId": "showDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to return", + "name": "documentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/duty_locations": { + "get": { + "description": "Returns the duty locations matching the search query", + "tags": [ + "duty_locations" + ], + "summary": "Returns the duty locations matching the search query", + "operationId": "searchDutyLocations", + "parameters": [ + { + "type": "string", + "description": "Search string for duty locations", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the duty location", + "schema": { + "$ref": "#/definitions/DutyLocationsPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "matching duty location not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/duty_locations/{dutyLocationId}/transportation_office": { + "get": { + "description": "Returns the given duty location's transportation office", + "tags": [ + "transportation_offices" + ], + "summary": "Returns the transportation office for a given duty location", + "operationId": "showDutyLocationTransportationOffice", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the transportation office for a duty location", + "schema": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "transportation office not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/entitlements": { + "get": { + "description": "List weight weights allotted by entitlement", + "tags": [ + "entitlements" + ], + "summary": "List weight weights allotted by entitlement", + "operationId": "indexEntitlements", + "responses": { + "200": { + "description": "List of weights allotted entitlement", + "schema": { + "$ref": "#/definitions/IndexEntitlements" + } + } + } + } + }, + "/feature-flags/user-boolean/{key}": { + "post": { + "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "featureFlags" + ], + "summary": "Determines if a user has a feature flag enabled", + "operationId": "booleanFeatureFlagForUser", + "parameters": [ + { + "type": "string", + "description": "Feature Flag Key", + "name": "key", + "in": "path", + "required": true + }, + { + "description": "context for the feature flag request", + "name": "flagContext", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Boolean Feature Flag Status", + "schema": { + "$ref": "#/definitions/FeatureFlagBoolean" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/feature-flags/user-variant/{key}": { + "post": { + "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "featureFlags" + ], + "summary": "Determines if a user has a feature flag enabled", + "operationId": "variantFeatureFlagForUser", + "parameters": [ + { + "type": "string", + "description": "Feature Flag Key", + "name": "key", + "in": "path", + "required": true + }, + { + "description": "context for the feature flag request", + "name": "flagContext", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Variant Feature Flag Status", + "schema": { + "$ref": "#/definitions/FeatureFlagVariant" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/move_documents/{moveDocumentId}": { + "put": { + "description": "Update a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Updates a move document", + "operationId": "updateMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move document model", + "name": "moveDocumentId", + "in": "path", + "required": true + }, + { + "name": "updateMoveDocument", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of move document", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move document not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "delete": { + "description": "Deletes a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Deletes a move document", + "operationId": "deleteMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move document model", + "name": "moveDocumentId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}": { + "get": { + "description": "Returns the given move", + "tags": [ + "moves" + ], + "summary": "Returns the given move", + "operationId": "showMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the move", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move is not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the move referenced", + "tags": [ + "moves" + ], + "summary": "Patches the move", + "operationId": "patchMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "patchMovePayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchMovePayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of move", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move or closeout office is not found" + }, + "412": { + "description": "precondition failed" + }, + "422": { + "description": "unprocessable entity" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/approve": { + "post": { + "description": "Approves the basic details of a move. The status of the move will be updated to APPROVED", + "tags": [ + "office" + ], + "summary": "Approves a move to proceed", + "operationId": "approveMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (approved) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/cancel": { + "post": { + "description": "Cancels the basic details of a move. The status of the move will be updated to CANCELED", + "tags": [ + "office" + ], + "summary": "Cancels a move", + "operationId": "cancelMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (canceled) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to cancel this move" + }, + "409": { + "description": "the move is not in a state to be canceled", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/move_documents": { + "get": { + "description": "Returns a list of all Move Documents associated with this move", + "tags": [ + "move_docs" + ], + "summary": "Returns a list of all Move Documents associated with this move", + "operationId": "indexMoveDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns list of move douments", + "schema": { + "$ref": "#/definitions/MoveDocuments" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + } + } + }, + "post": { + "description": "Created a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Creates a move document", + "operationId": "createGenericMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createGenericMoveDocumentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateGenericMoveDocumentPayload" + } + } + ], + "responses": { + "200": { + "description": "returns new move document object", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to modify this move" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/orders": { + "get": { + "description": "Returns orders information for a move for office use", + "tags": [ + "office" + ], + "summary": "Returns orders information for a move for office use", + "operationId": "showOfficeOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the orders information for a move for office use", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/signed_certifications": { + "get": { + "description": "returns a list of all signed_certifications associated with the move ID", + "tags": [ + "certification" + ], + "summary": "gets the signed certifications for the given move ID", + "operationId": "indexSignedCertification", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns a list of signed certifications", + "schema": { + "$ref": "#/definitions/SignedCertifications" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Create an instance of signed_certification tied to the move ID", + "tags": [ + "certification" + ], + "summary": "Submits signed certification for the given move ID", + "operationId": "createSignedCertification", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move being signed for", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSignedCertificationPayload" + } + } + ], + "responses": { + "201": { + "description": "created instance of signed_certification", + "schema": { + "$ref": "#/definitions/SignedCertificationPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to sign for this move" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/submit": { + "post": { + "description": "Submits a move for approval by the office. The status of the move will be updated to SUBMITTED", + "tags": [ + "moves" + ], + "summary": "Submits a move for approval", + "operationId": "submitMoveForApproval", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "submitMoveForApprovalPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SubmitMoveForApprovalPayload" + } + } + ], + "responses": { + "200": { + "description": "returns updated (submitted) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/submit_amended_orders": { + "post": { + "description": "Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not.", + "tags": [ + "moves" + ], + "summary": "Submits amended orders for review", + "operationId": "submitAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (submitted) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/uploadAdditionalDocuments": { + "patch": { + "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "moves" + ], + "summary": "Patch the additional documents for a given move", + "operationId": "uploadAdditionalDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "moveId", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/weight_ticket": { + "post": { + "description": "Created a weight ticket document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Creates a weight ticket document", + "operationId": "createWeightTicketDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createWeightTicketDocument", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateWeightTicketDocumentsPayload" + } + } + ], + "responses": { + "200": { + "description": "returns new weight ticket document object", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to modify this move" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveTaskOrderID}/mto_shipments": { + "get": { + "description": "Gets all MTO shipments for the specified Move Task Order.\n", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Gets all shipments for a move task order", + "operationId": "listMTOShipments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all mto shipments for a move task order.", + "schema": { + "$ref": "#/definitions/MTOShipments" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentId}": { + "delete": { + "description": "Soft deletes a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Soft deletes a shipment by ID", + "operationId": "deleteShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be deleted", + "name": "mtoShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Updates a specified MTO shipment.\n\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* Shipment type is required in body\n\nOptional fields include:\n* New shipment status type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Customer Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the MTO Shipment to update", + "name": "mtoShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the specified MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto_shipments": { + "post": { + "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n\nOptional fields include:\n* Customer Remarks\n* Releasing / Receiving agents\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/okta-profile": { + "get": { + "description": "Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update.", + "produces": [ + "application/json" + ], + "tags": [ + "okta_profile" + ], + "summary": "Returns Okta profile values from Okta's Users API", + "operationId": "showOktaInfo", + "responses": { + "200": { + "description": "okta profile for user", + "schema": { + "$ref": "#/definitions/OktaUserProfileData" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "okta_profile" + ], + "summary": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", + "operationId": "updateOktaInfo", + "parameters": [ + { + "name": "updateOktaUserProfileData", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOktaUserProfileData" + } + } + ], + "responses": { + "200": { + "description": "okta profile for user", + "schema": { + "$ref": "#/definitions/OktaUserProfileData" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "description": "validation error", + "schema": { + "$ref": "#/responses/UnprocessableEntity" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member", + "tags": [ + "orders" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrders", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateUpdateOrders" + } + } + ], + "responses": { + "201": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{ordersId}": { + "get": { + "description": "Returns the given order", + "tags": [ + "orders" + ], + "summary": "Returns the given order", + "operationId": "showOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "ordersId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the order", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "order is not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "put": { + "description": "All fields sent in this request will be set on the orders referenced", + "tags": [ + "orders" + ], + "summary": "Updates orders", + "operationId": "updateOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the orders model", + "name": "ordersId", + "in": "path", + "required": true + }, + { + "name": "updateOrders", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateUpdateOrders" + } + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "orders not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{ordersId}/upload_amended_orders": { + "patch": { + "description": "Patch the amended orders for a given order", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "orders" + ], + "summary": "Patch the amended orders for a given order", + "operationId": "uploadAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "ordersId", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/aoa-packet": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Downloads AOA Packet form PPMShipment as a PDF", + "operationId": "showAOAPacket", + "responses": { + "200": { + "description": "AOA PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the ppmshipment with aoa to be downloaded", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses": { + "post": { + "description": "Creates a moving expense document for the PPM shipment", + "tags": [ + "ppm" + ], + "summary": "Creates moving expense document", + "operationId": "createMovingExpense", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ], + "responses": { + "201": { + "description": "returns new moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { + "delete": { + "description": "Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a moving expense by ID", + "operationId": "deleteMovingExpense", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the moving expense to be deleted", + "name": "movingExpenseId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the moving expense" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the moving expense referenced", + "tags": [ + "ppm" + ], + "summary": "Updates the moving expense", + "operationId": "updateMovingExpense", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/movingExpenseId" + }, + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "updateMovingExpense", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMovingExpense" + } + } + ], + "responses": { + "200": { + "description": "returns an updated moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/payment-packet": { + "get": { + "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Returns PPM payment packet", + "operationId": "showPaymentPacket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppmShipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "PPM Payment Packet PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "ppm not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets": { + "post": { + "description": "Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a\npro-gear weight ticket. Data should be filled in using the patch endpoint.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Creates a pro-gear weight ticket", + "operationId": "createProGearWeightTicket", + "responses": { + "201": { + "description": "returns a new pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { + "delete": { + "description": "Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a pro-gear weight line item by ID", + "operationId": "deleteProGearWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the pro-gear weight ticket to be deleted", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the pro-gear weight ticket" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a pro-gear weight ticket", + "operationId": "updateProGearWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/proGearWeightTicketId" + }, + { + "name": "updateProGearWeightTicket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateProGearWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}": { + "put": { + "description": "Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates signature and routes PPM shipment to service counselor", + "operationId": "resubmitPPMShipmentDocumentation", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the signed certification", + "name": "signedCertificationId", + "in": "path", + "required": true + }, + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "savePPMShipmentSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SavePPMShipmentSignedCertification" + } + } + ], + "responses": { + "200": { + "description": "Returns the updated PPM shipment", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation": { + "post": { + "description": "Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Saves signature and routes PPM shipment to service counselor", + "operationId": "submitPPMShipmentDocumentation", + "parameters": [ + { + "name": "savePPMShipmentSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SavePPMShipmentSignedCertification" + } + } + ], + "responses": { + "200": { + "description": "Returns the updated PPM shipment", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "ppm" + ], + "summary": "Create a new upload for a PPM weight ticket, pro-gear, or moving expense document", + "operationId": "createPPMUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppm shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "boolean", + "description": "If the upload is a Weight Receipt", + "name": "weightReceipt", + "in": "query", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "413": { + "description": "payload is too large" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket": { + "post": { + "description": "Created a weight ticket document with the given information", + "tags": [ + "ppm" + ], + "summary": "Creates a weight ticket document", + "operationId": "createWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + } + ], + "responses": { + "200": { + "description": "returns new weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { + "delete": { + "description": "Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database. This may change the PPM shipment's final\nincentive.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a weight ticket by ID", + "operationId": "deleteWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the weight ticket to be deleted", + "name": "weightTicketId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the weight ticket" + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "Updates a weight ticket document with the new information", + "tags": [ + "ppm" + ], + "summary": "Updates a weight ticket document", + "operationId": "updateWeightTicket", + "parameters": [ + { + "$ref": "#/parameters/ppmShipmentId" + }, + { + "$ref": "#/parameters/weightTicketId" + }, + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "updateWeightTicketPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/queues/{queueType}": { + "get": { + "description": "Show all moves in a queue", + "tags": [ + "queues" + ], + "summary": "Show all moves in a queue", + "operationId": "showQueue", + "parameters": [ + { + "enum": [ + "new", + "ppm_payment_requested", + "all", + "ppm_approved", + "ppm_completed" + ], + "type": "string", + "description": "Queue type to show", + "name": "queueType", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "list all moves in the specified queue", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveQueueItem" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to access this queue" + }, + "404": { + "description": "move queue item is not found" + } + } + } + }, + "/rate_engine_postal_codes/{postal_code}": { + "get": { + "description": "Verifies if a zipcode is valid for origin or destination location for a move.", + "tags": [ + "postal_codes" + ], + "summary": "Validate if a zipcode is valid for origin or destination location for a move.", + "operationId": "validatePostalCodeWithRateData", + "parameters": [ + { + "pattern": "^(\\d{5}?)$", + "type": "string", + "format": "zip", + "name": "postal_code", + "in": "path", + "required": true + }, + { + "enum": [ + "origin", + "destination" + ], + "type": "string", + "name": "postal_code_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "postal_code is valid or invalid", + "schema": { + "$ref": "#/definitions/RateEnginePostalCodePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "server error" + } + } + } + }, + "/reimbursement/{reimbursementId}/approve": { + "post": { + "description": "Sets the status of the reimbursement to APPROVED.", + "tags": [ + "office" + ], + "summary": "Approves the reimbursement", + "operationId": "approveReimbursement", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the reimbursement being approved", + "name": "reimbursementId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of reimbursement", + "schema": { + "$ref": "#/definitions/Reimbursement" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members": { + "post": { + "description": "Creates an instance of a service member tied to a user", + "tags": [ + "service_members" + ], + "summary": "Creates service member for a logged-in user", + "operationId": "createServiceMember", + "parameters": [ + { + "name": "createServiceMemberPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateServiceMemberPayload" + } + } + ], + "responses": { + "201": { + "description": "created instance of service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}": { + "get": { + "description": "Returns the given service member", + "tags": [ + "service_members" + ], + "summary": "Returns the given service member", + "operationId": "showServiceMember", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the service member referenced", + "tags": [ + "service_members" + ], + "summary": "Patches the service member", + "operationId": "patchServiceMember", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + }, + { + "name": "patchServiceMemberPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchServiceMemberPayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}/backup_contacts": { + "get": { + "description": "List all service member backup contacts", + "tags": [ + "backup_contacts" + ], + "summary": "List all service member backup contacts", + "operationId": "indexServiceMemberBackupContacts", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "list of service member backup contacts", + "schema": { + "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to see this backup contact" + }, + "404": { + "description": "contact not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Creates an instance of a backup contact tied to a service member user", + "tags": [ + "backup_contacts" + ], + "summary": "Submits backup contact for a logged-in user", + "operationId": "createServiceMemberBackupContact", + "parameters": [ + { + "name": "createBackupContactPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateServiceMemberBackupContactPayload" + } + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created instance of service member backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to create this backup contact" + }, + "404": { + "description": "contact not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}/current_orders": { + "get": { + "description": "Returns orders", + "tags": [ + "service_members" + ], + "summary": "Returns the latest orders for a given service member", + "operationId": "showServiceMemberOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/transportation-offices": { + "get": { + "description": "Returns the transportation offices matching the search query", + "produces": [ + "application/json" + ], + "tags": [ + "transportation_offices" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOffices", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/transportation_offices/{dutyLocationId}/counseling_offices": { + "get": { + "description": "Returns the counseling locations matching the GBLOC from the selected duty location", + "produces": [ + "application/json" + ], + "tags": [ + "transportation_offices" + ], + "summary": "Returns the counseling locations in the GBLOC matching the duty location", + "operationId": "showCounselingOffices", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the counseling office for a duty location", + "schema": { + "$ref": "#/definitions/CounselingOffices" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + }, + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes a collection of uploads", + "operationId": "deleteUploads", + "parameters": [ + { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Array of UUIDs to be deleted", + "name": "uploadIds", + "in": "query", + "required": true + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadId}": { + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes an upload", + "operationId": "deleteUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be deleted", + "name": "uploadId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the order that the upload belongs to", + "name": "orderId", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Optional ID of the move that the upload belongs to", + "name": "moveId", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Optional PPM shipment ID related to the upload", + "name": "ppmId", + "in": "query" + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/is_logged_in": { + "get": { + "description": "Returns boolean as to whether the user is logged in", + "tags": [ + "users" + ], + "summary": "Returns boolean as to whether the user is logged in", + "operationId": "isLoggedInUser", + "responses": { + "200": { + "description": "Currently logged in user", + "schema": { + "type": "object", + "required": [ + "isLoggedIn" + ], + "properties": { + "isLoggedIn": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "invalid request" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/logged_in": { + "get": { + "description": "Returns the user info for the currently logged in user", + "tags": [ + "users" + ], + "summary": "Returns the user info for the currently logged in user", + "operationId": "showLoggedInUser", + "responses": { + "200": { + "description": "Currently logged in user", + "schema": { + "$ref": "#/definitions/LoggedInUserPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Affiliation": { + "description": "Military branch of service", + "type": "string", + "title": "Branch of service", + "enum": [ + "ARMY", + "NAVY", + "MARINES", + "AIR_FORCE", + "COAST_GUARD", + "SPACE_FORCE", + "OTHER" + ], + "x-display-value": { + "AIR_FORCE": "Air Force", + "ARMY": "Army", + "COAST_GUARD": "Coast Guard", + "MARINES": "Marine Corps", + "NAVY": "Navy", + "OTHER": "OTHER", + "SPACE_FORCE": "Space Force" + }, + "x-nullable": true + }, + "ApplicationParameters": { + "type": "object", + "properties": { + "parameterName": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "parameterValue": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "validationCode": { + "type": "string", + "format": "string", + "x-nullable": true + } + } + }, + "AvailableMoveDates": { + "type": "object", + "required": [ + "start_date", + "available" + ], + "properties": { + "available": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } + }, + "start_date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } + } + }, + "BackupContactPermission": { + "type": "string", + "title": "Permissions", + "enum": [ + "NONE", + "VIEW", + "EDIT" + ], + "x-display-value": { + "EDIT": "View and edit all move details", + "NONE": "Contact Only", + "VIEW": "View all move details" + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "CancelMove": { + "type": "object", + "required": [ + "cancel_reason" + ], + "properties": { + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CounselingOffice": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "CounselingOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/CounselingOffice" + } + }, + "CreateBoatShipment": { + "description": "Boat shipment information for the move.", + "required": [ + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateGenericMoveDocumentPayload": { + "type": "object", + "required": [ + "upload_ids", + "title", + "move_document_type" + ], + "properties": { + "move_document_type": { + "$ref": "#/definitions/MoveDocumentType" + }, + "notes": { + "type": "string", + "title": "Notes", + "x-nullable": true, + "example": "This document is good to go!" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "title": { + "type": "string", + "example": "very_useful_document.pdf" + }, + "upload_ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + } + }, + "CreateMobileHomeShipment": { + "description": "A mobile home shipment that the prime moves for a service member.", + "required": [ + "make", + "model", + "year", + "lengthInInches", + "heightInInches", + "widthInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "A personally procured move is a type of shipment that a service members moves themselves.", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected" + ], + "properties": { + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date" + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Denotes if this PPM shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "sitExpected": { + "type": "boolean" + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "CreateServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "name", + "email", + "permission" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "title": "Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@exmaple.com" + }, + "name": { + "type": "string", + "title": "Name", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + } + } + }, + "CreateServiceMemberPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "current_location_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Phone", + "x-nullable": true + }, + "residential_address": { + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Alternate phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "CreateShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date" + }, + "requestedPickupDate": { + "type": "string", + "format": "date" + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "CreateSignedCertificationPayload": { + "type": "object", + "required": [ + "date", + "signature", + "certification_text" + ], + "properties": { + "certification_text": { + "type": "string" + }, + "certification_type": { + "$ref": "#/definitions/SignedCertificationTypeCreate" + }, + "date": { + "type": "string", + "format": "date-time", + "title": "Date" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "ppm_id": { + "$ref": "#/definitions/PpmID" + }, + "signature": { + "type": "string", + "title": "Signature" + } + } + }, + "CreateUpdateOrders": { + "type": "object", + "required": [ + "service_member_id", + "issue_date", + "report_by_date", + "orders_type", + "has_dependents", + "spouse_has_pro_gear", + "new_duty_location_id" + ], + "properties": { + "accompanied_tour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "counseling_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, + "department_indicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "dependents_twelve_and_over": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependents_under_twelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issue_date": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "move_id": { + "type": "string", + "format": "uuid", + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, + "new_duty_location_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders_number": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "orders_type_detail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "origin_duty_location_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "report_by_date": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreateWeightTicketDocumentsPayload": { + "type": "object", + "required": [ + "personally_procured_move_id", + "weight_ticket_set_type", + "full_weight_ticket_missing", + "empty_weight_ticket_missing", + "trailer_ownership_missing" + ], + "properties": { + "empty_weight": { + "type": "integer", + "title": "empty weight ticket recorded weight" + }, + "empty_weight_ticket_missing": { + "type": "boolean", + "title": "missing empty weight ticket" + }, + "full_weight": { + "type": "integer", + "title": "full weight ticket recorded weight" + }, + "full_weight_ticket_missing": { + "type": "boolean", + "title": "missing full weight ticket" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "trailer_ownership_missing": { + "type": "boolean", + "title": "missing trailer ownership documentation" + }, + "upload_ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + }, + "vehicle_make": { + "type": "string", + "title": "Vehicle make", + "x-nullable": true + }, + "vehicle_model": { + "type": "string", + "title": "Vehicle model", + "x-nullable": true + }, + "vehicle_nickname": { + "type": "string", + "title": "Vehicle nickname (ex. 'Large box truck')", + "x-nullable": true + }, + "weight_ticket_date": { + "type": "string", + "format": "date", + "title": "Full Weight Ticket Date", + "x-nullable": true, + "example": "2018-04-26" + }, + "weight_ticket_set_type": { + "$ref": "#/definitions/WeightTicketSetType" + } + } + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "Document": { + "type": "object", + "required": [ + "id", + "service_member_id", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "DutyLocationPayload": { + "type": "object", + "required": [ + "id", + "name", + "address_id", + "affiliation", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "address_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "provides_services_counseling": { + "type": "boolean", + "x-nullable": false + }, + "transportation_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportation_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "DutyLocationsPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/DutyLocationPayload" + } + }, + "Entitlement": { + "type": "object", + "properties": { + "accompanied_tour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "dependents_twelve_and_over": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependents_under_twelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "proGear": { + "description": "Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "proGearSpouse": { + "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", + "type": "integer", + "x-nullable": true, + "example": 500 + }, + "ub_allowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "FeatureFlagBoolean": { + "description": "A feature flag", + "type": "object", + "required": [ + "entity", + "key", + "match", + "namespace" + ], + "properties": { + "entity": { + "type": "string", + "example": "11111111-1111-1111-1111-111111111111" + }, + "key": { + "type": "string", + "example": "flag" + }, + "match": { + "type": "boolean", + "example": true + }, + "namespace": { + "type": "string", + "example": "test" + } + } + }, + "FeatureFlagVariant": { + "description": "A feature flag", + "type": "object", + "required": [ + "entity", + "key", + "match", + "variant", + "namespace" + ], + "properties": { + "entity": { + "type": "string", + "example": "11111111-1111-1111-1111-111111111111" + }, + "key": { + "type": "string", + "example": "flag" + }, + "match": { + "type": "boolean", + "example": true + }, + "namespace": { + "type": "string", + "example": "test" + }, + "variant": { + "type": "string", + "example": "myval" + } + } + }, + "IndexEntitlements": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/WeightAllotment" + } + }, + "IndexMovesPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/MovePayload" + } + }, + "IndexServiceMemberBackupContactsPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "InternalMove": { + "type": "object", + "properties": { + "closeoutOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "counselingOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders": { + "type": "object" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "status": { + "type": "string", + "readOnly": true + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "InvalidRequestResponsePayload": { + "type": "object", + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "IsDateWeekendHolidayInfo": { + "type": "object", + "required": [ + "country_code", + "country_name", + "date", + "is_weekend", + "is_holiday" + ], + "properties": { + "country_code": { + "type": "string" + }, + "country_name": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + }, + "details": { + "type": "string" + }, + "is_holiday": { + "type": "boolean" + }, + "is_weekend": { + "type": "boolean" + } + } + }, + "LoggedInUserPayload": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "readOnly": true, + "example": "john_bob@example.com" + }, + "first_name": { + "type": "string", + "readOnly": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "office_user": { + "$ref": "#/definitions/OfficeUser" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/Privilege" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + }, + "x-nullable": true + }, + "service_member": { + "$ref": "#/definitions/ServiceMemberPayload" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "type": "string", + "title": "MTO Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOShipment": { + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "enum": [ + "DRAFT", + "APPROVED", + "SUBMITTED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MethodOfReceipt": { + "type": "string", + "title": "Method of Receipt", + "enum": [ + "MIL_PAY", + "OTHER_DD", + "GTCC" + ], + "x-display-value": { + "GTCC": "GTCC", + "MIL_PAY": "MilPay", + "OTHER_DD": "Other account" + }, + "x-nullable": true + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "MoveDocumentPayload": { + "type": "object", + "required": [ + "id", + "move_id", + "document", + "title", + "move_document_type", + "status" + ], + "properties": { + "document": { + "$ref": "#/definitions/Document" + }, + "empty_weight": { + "type": "integer", + "title": "Empty weight", + "x-formatting": "weight", + "x-nullable": true + }, + "empty_weight_ticket_missing": { + "type": "boolean", + "title": "missing empty weight ticket", + "x-nullable": true + }, + "full_weight": { + "type": "integer", + "title": "Full weight", + "x-formatting": "weight", + "x-nullable": true + }, + "full_weight_ticket_missing": { + "type": "boolean", + "title": "missing full weight ticket", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "move_document_type": { + "$ref": "#/definitions/MoveDocumentType" + }, + "move_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moving_expense_type": { + "$ref": "#/definitions/MovingExpenseType" + }, + "notes": { + "type": "string", + "title": "Notes", + "x-nullable": true, + "example": "This document is good to go!" + }, + "payment_method": { + "type": "string", + "title": "Payment Method", + "enum": [ + "OTHER", + "GTCC" + ], + "x-display-value": { + "GTCC": "GTCC", + "OTHER": "Other account" + } + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "receipt_missing": { + "type": "boolean", + "title": "missing expense receipt", + "x-nullable": true + }, + "requested_amount_cents": { + "description": "unit is cents", + "type": "integer", + "format": "cents", + "title": "Requested Amount", + "minimum": 1 + }, + "status": { + "$ref": "#/definitions/MoveDocumentStatus" + }, + "storage_end_date": { + "type": "string", + "format": "date", + "title": "End date of storage for storage expenses", + "x-nullable": true, + "example": "2018-04-26" + }, + "storage_start_date": { + "type": "string", + "format": "date", + "title": "Start date of storage for storage expenses", + "x-nullable": true, + "example": "2018-04-26" + }, + "title": { + "type": "string", + "title": "Document title", + "example": "very_useful_document.pdf" + }, + "trailer_ownership_missing": { + "type": "boolean", + "title": "missing trailer ownership documentation", + "x-nullable": true + }, + "vehicle_make": { + "type": "string", + "title": "Vehicle make", + "x-nullable": true + }, + "vehicle_model": { + "type": "string", + "title": "Vehicle model", + "x-nullable": true + }, + "vehicle_nickname": { + "type": "string", + "title": "Nickname (ex. \"15-foot truck\")", + "x-nullable": true + }, + "weight_ticket_date": { + "type": "string", + "format": "date", + "title": "Weight ticket date", + "x-nullable": true, + "example": "2018-04-26" + }, + "weight_ticket_set_type": { + "$ref": "#/definitions/WeightTicketSetType" + } + } + }, + "MoveDocumentStatus": { + "type": "string", + "title": "Document status", + "enum": [ + "AWAITING_REVIEW", + "OK", + "HAS_ISSUE", + "EXCLUDE_FROM_CALCULATION" + ], + "x-display-value": { + "AWAITING_REVIEW": "Awaiting review", + "EXCLUDE_FROM_CALCULATION": "Exclude from calculation", + "HAS_ISSUE": "Has issue", + "OK": "OK" + } + }, + "MoveDocumentType": { + "type": "string", + "title": "Document type", + "enum": [ + "OTHER", + "WEIGHT_TICKET", + "STORAGE_EXPENSE", + "SHIPMENT_SUMMARY", + "EXPENSE", + "WEIGHT_TICKET_SET" + ], + "x-display-value": { + "EXPENSE": "Expense", + "OTHER": "Other document type", + "SHIPMENT_SUMMARY": "Shipment summary", + "STORAGE_EXPENSE": "Storage expense receipt", + "WEIGHT_TICKET": "Weight ticket", + "WEIGHT_TICKET_SET": "Weight ticket set" + }, + "example": "EXPENSE" + }, + "MoveDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "MovePayload": { + "type": "object", + "required": [ + "id", + "orders_id", + "locator", + "created_at", + "updated_at", + "eTag" + ], + "properties": { + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + }, + "closeout_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "counseling_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "mto_shipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveQueueItem": { + "type": "object", + "required": [ + "id", + "status", + "locator", + "customer_name", + "edipi", + "grade", + "orders_type", + "branch_of_service", + "last_modified_date", + "created_at" + ], + "properties": { + "actual_move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "branch_of_service": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "customer_name": { + "type": "string", + "title": "Customer Name", + "example": "Thedog, Nino" + }, + "delivered_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "destination_duty_location_name": { + "type": "string", + "title": "Destination", + "x-nullable": true, + "example": "Dover AFB" + }, + "destination_gbloc": { + "type": "string", + "title": "Destination GBLOC", + "x-nullable": true, + "example": "LKNQ" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID #", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "example": "5789345789" + }, + "gbl_number": { + "type": "string", + "title": "GBL Number", + "x-nullable": true, + "example": "LNK12345" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "hhg_status": { + "type": "string", + "x-nullable": true, + "example": "ACCEPTED" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "invoice_approved_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "last_modified_date": { + "type": "string", + "format": "date-time", + "example": "2017-07-21T17:32:28Z" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "origin_duty_location_name": { + "type": "string", + "title": "Origin", + "x-nullable": true, + "example": "Dover AFB" + }, + "origin_gbloc": { + "type": "string", + "title": "Origin GBLOC", + "x-nullable": true, + "example": "LKNQ" + }, + "original_move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "pm_survey_conducted_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "ppm_status": { + "type": "string", + "x-nullable": true, + "example": "PAYMENT_REQUESTED" + }, + "status": { + "type": "string", + "example": "APPROVED" + }, + "submitted_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2018-04-25" + }, + "weight_allotment": { + "$ref": "#/definitions/WeightAllotment" + } + } + }, + "MoveStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED", + "NEEDS SERVICE COUNSELING", + "APPROVALS REQUESTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MovesList": { + "type": "object", + "properties": { + "currentMove": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + }, + "previousMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + } + } + }, + "MovingExpense": { + "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", + "type": "object", + "required": [ + "id", + "createdAt", + "updatedAt", + "ppmShipmentId", + "documentId", + "document" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp the moving expense object was initially created in the system (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "A brief description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "The Document object that contains all file uploads for this expense" + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The id of the Document that contains all file uploads for this expense", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "Unique primary identifier of the Moving Expense object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingReceipt": { + "description": "Indicates if the service member is missing the receipt with the proof of expense amount", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "paidWithGtcc": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The PPM Shipment id that this moving expense belongs to", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedAmount": { + "description": "Customer submitted total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedDescription": { + "description": "Customer submitted description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "submittedMovingExpenseType": { + "$ref": "#/definitions/SubmittedMovingExpenseType" + }, + "submittedSitEndDate": { + "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "submittedSitStartDate": { + "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "updatedAt": { + "description": "Timestamp when a property of this moving expense object was last modified (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "MovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + } + }, + "NullableSignedCertificationType": { + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PPM", + "HHG" + ], + "x-nullable": true + }, + "OfficeUser": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "format": "x-email", + "title": "Personal Email Address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportation_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportation_office_assignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OktaUserProfileData": { + "type": "object", + "properties": { + "cac_edipi": { + "type": "string", + "maxLength": 10, + "x-nullable": true, + "example": "1234567890" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "user@email.com" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "login": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "user@email.com" + }, + "sub": { + "type": "string", + "format": "string", + "example": "1duekdue9ekrjghf" + } + } + }, + "OmittableMovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OmittablePPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OrderPayGrade": { + "type": "string", + "title": "Grade", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ], + "x-display-value": { + "ACADEMY_CADET": "Service Academy Cadet", + "AVIATION_CADET": "Aviation Cadet", + "CIVILIAN_EMPLOYEE": "Civilian Employee", + "E_1": "E-1", + "E_2": "E-2", + "E_3": "E-3", + "E_4": "E-4", + "E_5": "E-5", + "E_6": "E-6", + "E_7": "E-7", + "E_8": "E-8", + "E_9": "E-9", + "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", + "MIDSHIPMAN": "Midshipman", + "O_10": "O-10", + "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", + "O_2": "O-2", + "O_3": "O-3", + "O_4": "O-4", + "O_5": "O-5", + "O_6": "O-6", + "O_7": "O-7", + "O_8": "O-8", + "O_9": "O-9", + "W_1": "W-1", + "W_2": "W-2", + "W_3": "W-3", + "W_4": "W-4", + "W_5": "W-5" + }, + "x-nullable": true + }, + "Orders": { + "type": "object", + "required": [ + "id", + "service_member_id", + "issue_date", + "report_by_date", + "orders_type", + "has_dependents", + "spouse_has_pro_gear", + "new_duty_location", + "uploaded_orders", + "created_at", + "updated_at" + ], + "properties": { + "authorizedWeight": { + "type": "integer", + "x-nullable": true, + "example": 7000 + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "department_indicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "entitlement": { + "$ref": "#/definitions/Entitlement" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "issue_date": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Date issued", + "example": "2018-04-26" + }, + "moves": { + "$ref": "#/definitions/IndexMovesPayload" + }, + "new_duty_location": { + "$ref": "#/definitions/DutyLocationPayload" + }, + "orders_number": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "orders_type_detail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationGbloc": { + "type": "string", + "title": "From what GBLOC do your orders originate?", + "x-nullable": true + }, + "origin_duty_location": { + "x-nullable": true, + "$ref": "#/definitions/DutyLocationPayload" + }, + "providesServicesCounseling": { + "type": "boolean", + "x-omitempty": false + }, + "report_by_date": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report by", + "example": "2018-04-26" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "status": { + "$ref": "#/definitions/OrdersStatus" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "uploaded_amended_orders": { + "$ref": "#/definitions/Document" + }, + "uploaded_amended_orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploaded_orders": { + "$ref": "#/definitions/Document" + } + } + }, + "OrdersStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PPMAdvanceStatus": { + "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", + "type": "string", + "title": "PPM Advance Status", + "enum": [ + "APPROVED", + "REJECTED", + "EDITED", + "RECEIVED", + "NOT_RECEIVED" + ], + "x-nullable": true + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMDocumentStatusReason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "PPMEstimateRange": { + "type": "object", + "required": [ + "range_min", + "range_max" + ], + "properties": { + "range_max": { + "type": "integer", + "title": "High estimate" + }, + "range_min": { + "type": "integer", + "title": "Low estimate" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4300 + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PatchMovePayload": { + "type": "object", + "required": [ + "closeoutOfficeId" + ], + "properties": { + "closeoutOfficeId": { + "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", + "type": "string", + "format": "uuid" + } + } + }, + "PatchServiceMemberPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "current_location_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "emplid": { + "type": "string", + "title": "USCG EMPLID", + "maxLength": 7, + "minLength": 7, + "pattern": "^\\d{7}$", + "x-nullable": true, + "example": "5789345" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Phone", + "x-nullable": true + }, + "residential_address": { + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Alternate Phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best Contact Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PostDocumentPayload": { + "type": "object", + "properties": { + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + } + } + }, + "PpmID": { + "description": "The PPM Shipment ID to associate with the assigned certificate.\n", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "Privilege": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "privilegeName": { + "type": "string", + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "example": "supervisor" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ProGearWeightTicket": { + "description": "Pro-gear associated information and weight docs for a PPM shipment", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "documentId", + "document" + ], + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the pro-gear weight." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the pro-gear weight ticket.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedBelongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedHasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedWeight": { + "description": "Customer submitted weight of the pro-gear.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weight": { + "description": "Weight of the pro-gear.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "RateEnginePostalCodePayload": { + "type": "object", + "required": [ + "valid", + "postal_code", + "postal_code_type" + ], + "properties": { + "postal_code": { + "description": "zip code, international allowed", + "type": "string", + "format": "zip", + "title": "ZIP", + "example": "'90210' or 'N15 3NL'" + }, + "postal_code_type": { + "type": "string", + "enum": [ + "origin", + "destination" + ] + }, + "valid": { + "type": "boolean", + "example": false + } + } + }, + "Reimbursement": { + "type": "object", + "required": [ + "requested_amount", + "method_of_receipt" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "method_of_receipt": { + "$ref": "#/definitions/MethodOfReceipt" + }, + "requested_amount": { + "description": "unit is cents", + "type": "integer", + "format": "cents", + "title": "Requested Amount", + "minimum": 1 + }, + "requested_date": { + "type": "string", + "format": "date", + "title": "Requested Date", + "x-nullable": true, + "example": "2018-04-26" + }, + "status": { + "$ref": "#/definitions/ReimbursementStatus" + } + }, + "x-nullable": true + }, + "ReimbursementStatus": { + "type": "string", + "title": "Reimbursement", + "enum": [ + "DRAFT", + "REQUESTED", + "APPROVED", + "REJECTED", + "PAID" + ], + "x-nullable": true + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "SavePPMShipmentSignedCertification": { + "type": "object", + "required": [ + "certification_text", + "signature", + "date" + ], + "properties": { + "certification_text": { + "description": "Text that the customer is agreeing to and signing.", + "type": "string" + }, + "date": { + "description": "Date of signature", + "type": "string", + "format": "date" + }, + "signature": { + "description": "Customer signature", + "type": "string" + } + } + }, + "ServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "id", + "created_at", + "updated_at", + "name", + "email", + "permission" + ], + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "format": "x-email", + "title": "Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "title": "Name", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "ServiceMemberPayload": { + "type": "object", + "required": [ + "id", + "user_id", + "is_profile_complete", + "created_at", + "updated_at" + ], + "properties": { + "affiliation": { + "title": "Branch", + "$ref": "#/definitions/Affiliation" + }, + "backup_contacts": { + "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "cac_validated": { + "type": "boolean" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "emplid": { + "type": "string", + "title": "USCG EMPLID", + "maxLength": 7, + "minLength": 7, + "pattern": "^\\d{7}$", + "x-nullable": true, + "example": "5789345" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "grade": { + "title": "Grade", + "$ref": "#/definitions/OrderPayGrade" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "is_profile_complete": { + "type": "boolean" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "orders": { + "type": "array", + "items": { + "$ref": "#/definitions/Orders" + } + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal Email Address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Telephone", + "x-nullable": true + }, + "residential_address": { + "title": "Residential Address", + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Secondary Phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "weight_allotment": { + "$ref": "#/definitions/WeightAllotment" + } + } + }, + "SignedCertification": { + "description": "Signed certification", + "type": "object", + "required": [ + "id", + "submittingUserId", + "moveId", + "certificationType", + "certificationText", + "signature", + "date", + "createdAt", + "updatedAt", + "eTag" + ], + "properties": { + "certificationText": { + "description": "Full text that the customer agreed to and signed.", + "type": "string" + }, + "certificationType": { + "$ref": "#/definitions/SignedCertificationType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "date": { + "description": "Date that the customer signed the certification.", + "type": "string", + "format": "date" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveId": { + "description": "The ID of the move associated with this signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmId": { + "description": "The ID of the PPM shipment associated with this signed certification, if any.", + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "signature": { + "description": "The signature that the customer provided.", + "type": "string" + }, + "submittingUserId": { + "description": "The ID of the user that signed.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SignedCertificationPayload": { + "type": "object", + "required": [ + "id", + "move_id", + "created_at", + "updated_at", + "date", + "signature", + "certification_text" + ], + "properties": { + "certification_text": { + "type": "string" + }, + "certification_type": { + "$ref": "#/definitions/NullableSignedCertificationType" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date-time", + "title": "Date" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "move_id": { + "type": "string", + "format": "uuid" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "ppm_id": { + "$ref": "#/definitions/PpmID" + }, + "signature": { + "type": "string", + "title": "Signature" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "SignedCertificationType": { + "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "readOnly": true + }, + "SignedCertificationTypeCreate": { + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "x-nullable": true + }, + "SignedCertifications": { + "type": "array", + "items": { + "$ref": "#/definitions/SignedCertificationPayload" + } + }, + "SubmitMoveForApprovalPayload": { + "type": "object", + "properties": { + "certificate": { + "$ref": "#/definitions/CreateSignedCertificationPayload" + } + } + }, + "SubmittedMovingExpenseType": { + "description": "Customer Submitted Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phone_lines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "required": [ + "officeUserId", + "transportationOfficeId", + "primaryOffice" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "UpdateBoatShipment": { + "type": "object", + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean", + "x-nullable": true + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ], + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMobileHomeShipment": { + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string", + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMovingExpense": { + "type": "object", + "required": [ + "movingExpenseType", + "description", + "paidWithGTCC", + "amount", + "missingReceipt" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer" + }, + "description": { + "description": "A brief description of the expense", + "type": "string" + }, + "missingReceipt": { + "description": "Indicates if the customer is missing the receipt for their expense.", + "type": "boolean" + }, + "movingExpenseType": { + "$ref": "#/definitions/MovingExpenseType" + }, + "paidWithGTCC": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer" + } + } + }, + "UpdateOktaUserProfileData": { + "type": "object", + "properties": { + "profile": { + "$ref": "#/definitions/OktaUserProfileData" + } + } + }, + "UpdatePPMShipment": { + "type": "object", + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "actualMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceAmountRequested": { + "description": "The amount requested for an advance, or null if no advance is requested\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "estimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean", + "x-nullable": true + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "sitExpected": { + "type": "boolean", + "x-nullable": true + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + } + } + }, + "UpdateProGearWeightTicket": { + "type": "object", + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean" + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string" + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean" + }, + "weight": { + "description": "Weight of the vehicle not including the pro-gear.", + "type": "integer" + } + } + }, + "UpdateServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "name", + "email", + "permission" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "title": "email address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "name": { + "type": "string", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + } + } + }, + "UpdateShipment": { + "type": "object", + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/UpdateBoatShipment" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/UpdateMobileHomeShipment" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UpdateWeightTicket": { + "type": "object", + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer" + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer" + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean" + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean" + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string" + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean" + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean" + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string" + } + } + }, + "Upload": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "id", + "url", + "filename", + "contentType", + "bytes", + "createdAt", + "updatedAt" + ], + "properties": { + "bytes": { + "type": "integer", + "readOnly": true + }, + "contentType": { + "type": "string", + "format": "mime-type", + "readOnly": true, + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "filename": { + "type": "string", + "readOnly": true, + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isWeightTicket": { + "type": "boolean" + }, + "rotation": { + "type": "integer", + "example": 2 + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ], + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "uploadType": { + "type": "string", + "enum": [ + "USER", + "PRIME", + "OFFICE" + ], + "readOnly": true, + "example": "OFFICE" + }, + "url": { + "type": "string", + "format": "uri", + "readOnly": true, + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocation": { + "description": "A postal code, city, and state lookup", + "type": "object", + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocations": { + "type": "array", + "items": { + "$ref": "#/definitions/VLocation" + } + }, + "ValidationError": { + "required": [ + "invalidFields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object" + } + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "WeightAllotment": { + "type": "object", + "required": [ + "total_weight_self", + "total_weight_self_plus_dependents", + "pro_gear_weight", + "pro_gear_weight_spouse" + ], + "properties": { + "pro_gear_weight": { + "type": "integer", + "example": 2000 + }, + "pro_gear_weight_spouse": { + "type": "integer", + "example": 500 + }, + "total_weight_self": { + "type": "integer", + "example": 18000 + }, + "total_weight_self_plus_dependents": { + "type": "integer", + "example": 18000 + } + } + }, + "WeightTicket": { + "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "emptyDocumentId", + "emptyDocument", + "fullDocument", + "fullDocumentId", + "proofOfTrailerOwnershipDocument", + "proofOfTrailerOwnershipDocumentId" + ], + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "emptyDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when empty." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "emptyDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", + "type": "string", + "format": "uuid", + "readOnly": true + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "fullDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when full." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "fullDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "ID of this set of weight tickets.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this set of weight tickets is for.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "proofOfTrailerOwnershipDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the proof of trailer ownership." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "proofOfTrailerOwnershipDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedEmptyWeight": { + "description": "Customer submitted weight of the vehicle when empty.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedFullWeight": { + "description": "Customer submitted weight of the vehicle when full.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedOwnsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedTrailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "WeightTicketSetType": { + "type": "string", + "title": "Select weight ticket type", + "enum": [ + "CAR", + "CAR_TRAILER", + "BOX_TRUCK", + "PRO_GEAR" + ], + "x-display-value": { + "BOX_TRUCK": "Box truck", + "CAR": "Car", + "CAR_TRAILER": "Car + Trailer", + "PRO_GEAR": "Pro-gear" + }, + "x-nullable": true + }, + "WeightTickets": { + "description": "All weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/WeightTicket" + }, + "x-omitempty": false + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + "movingExpenseId": { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + }, + "ppmShipmentId": { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + "proGearWeightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + }, + "weightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "name": "responses" + }, + { + "name": "orders" + }, + { + "name": "certification" + }, + { + "name": "moves" + }, + { + "name": "office" + }, + { + "name": "documents" + }, + { + "name": "uploads" + }, + { + "name": "service_members" + }, + { + "name": "backup_contacts" + }, + { + "name": "duty_locations" + }, + { + "name": "transportation_offices" + }, + { + "name": "queues" + }, + { + "name": "entitlements" + }, + { + "name": "calendar" + }, + { + "name": "move_docs" + }, + { + "name": "ppm" + }, + { + "name": "postal_codes" + }, + { + "name": "addresses" + }, + { + "name": "mtoShipment" + }, + { + "name": "featureFlags" + }, + { + "name": "okta_profile" + }, + { + "name": "application_parameters" + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "swagger": "2.0", + "info": { + "description": "The Internal API is a RESTful API that enables the Customer application for\nMilMove.\n\nAll endpoints are located under ` + "`" + `/internal` + "`" + `.\n", + "title": "MilMove Internal API", + "contact": { + "email": "ppp@truss.works" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/internal", + "paths": { + "/addresses/zip-city-lookup/{search}": { + "get": { + "description": "Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string", + "operationId": "getLocationByZipCityState", + "parameters": [ + { + "type": "string", + "name": "search", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested list of city, state, county, and postal code matches", + "schema": { + "$ref": "#/definitions/VLocations" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/addresses/{addressId}": { + "get": { + "description": "Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code.", + "tags": [ + "addresses" + ], + "summary": "Returns an address", + "operationId": "showAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the address to return", + "name": "addressId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested address", + "schema": { + "$ref": "#/definitions/Address" + } + }, + "400": { + "description": "invalid request" + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/allmoves/{serviceMemberId}": { + "get": { + "description": "This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moves" + ], + "summary": "Return the current and previous moves of a service member", + "operationId": "getAllMoves", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/MovesList" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/application_parameters": { + "post": { + "description": "Searches for an application parameter by name and value, returns nil if not found", + "tags": [ + "application_parameters" + ], + "summary": "Searches for an application parameter by name and value, returns nil if not found", + "operationId": "validate", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + } + ], + "responses": { + "200": { + "description": "Application Parameters", + "schema": { + "$ref": "#/definitions/ApplicationParameters" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + }, + "/backup_contacts/{backupContactId}": { + "get": { + "description": "Returns the given service member backup contact", + "tags": [ + "backup_contacts" + ], + "summary": "Returns the given service member backup contact", + "operationId": "showServiceMemberBackupContact", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member backup contact", + "name": "backupContactId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "backup contact not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "put": { + "description": "Any fields sent in this request will be set on the backup contact referenced", + "tags": [ + "backup_contacts" + ], + "summary": "Updates a service member backup contact", + "operationId": "updateServiceMemberBackupContact", + "parameters": [ + { + "name": "updateServiceMemberBackupContactPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateServiceMemberBackupContactPayload" + } + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member backup contact", + "name": "backupContactId", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "updated instance of backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "backup contact not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/calendar/available_move_dates": { + "get": { + "description": "Returns available dates for the move calendar", + "tags": [ + "calendar" + ], + "summary": "Returns available dates for the move calendar", + "operationId": "showAvailableMoveDates", + "parameters": [ + { + "type": "string", + "format": "date", + "description": "Look for future available dates starting from (and including) this date", + "name": "startDate", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "List of available dates", + "schema": { + "$ref": "#/definitions/AvailableMoveDates" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/calendar/{countryCode}/is-weekend-holiday/{date}": { + "get": { + "description": "Utility API to determine if input date falls on weekend and/or holiday.\n", + "produces": [ + "application/json" + ], + "tags": [ + "calendar" + ], + "summary": "Validate move date selection", + "operationId": "isDateWeekendHoliday", + "parameters": [ + { + "enum": [ + "US" + ], + "type": "string", + "description": "country code for context of date", + "name": "countryCode", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "date", + "description": "input date to determine if weekend/holiday for given country.", + "name": "date", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully determine if given date is weekend and/or holiday for given country.", + "schema": { + "$ref": "#/definitions/IsDateWeekendHolidayInfo" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/documents": { + "post": { + "description": "Documents represent a physical artifact such as a scanned document or a PDF file", + "tags": [ + "documents" + ], + "summary": "Create a new document", + "operationId": "createDocument", + "parameters": [ + { + "name": "documentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PostDocumentPayload" + } + } + ], + "responses": { + "201": { + "description": "created document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request" + }, + "500": { + "description": "server error" + } + } + } + }, + "/documents/{documentId}": { + "get": { + "description": "Returns a document and its uploads", + "tags": [ + "documents" + ], + "summary": "Returns a document", + "operationId": "showDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to return", + "name": "documentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the requested document", + "schema": { + "$ref": "#/definitions/Document" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/duty_locations": { + "get": { + "description": "Returns the duty locations matching the search query", + "tags": [ + "duty_locations" + ], + "summary": "Returns the duty locations matching the search query", + "operationId": "searchDutyLocations", + "parameters": [ + { + "type": "string", + "description": "Search string for duty locations", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the duty location", + "schema": { + "$ref": "#/definitions/DutyLocationsPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "matching duty location not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/duty_locations/{dutyLocationId}/transportation_office": { + "get": { + "description": "Returns the given duty location's transportation office", + "tags": [ + "transportation_offices" + ], + "summary": "Returns the transportation office for a given duty location", + "operationId": "showDutyLocationTransportationOffice", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the transportation office for a duty location", + "schema": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "transportation office not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/entitlements": { + "get": { + "description": "List weight weights allotted by entitlement", + "tags": [ + "entitlements" + ], + "summary": "List weight weights allotted by entitlement", + "operationId": "indexEntitlements", + "responses": { + "200": { + "description": "List of weights allotted entitlement", + "schema": { + "$ref": "#/definitions/IndexEntitlements" + } + } + } + } + }, + "/feature-flags/user-boolean/{key}": { + "post": { + "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "featureFlags" + ], + "summary": "Determines if a user has a feature flag enabled", + "operationId": "booleanFeatureFlagForUser", + "parameters": [ + { + "type": "string", + "description": "Feature Flag Key", + "name": "key", + "in": "path", + "required": true + }, + { + "description": "context for the feature flag request", + "name": "flagContext", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Boolean Feature Flag Status", + "schema": { + "$ref": "#/definitions/FeatureFlagBoolean" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/feature-flags/user-variant/{key}": { + "post": { + "description": "Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "featureFlags" + ], + "summary": "Determines if a user has a feature flag enabled", + "operationId": "variantFeatureFlagForUser", + "parameters": [ + { + "type": "string", + "description": "Feature Flag Key", + "name": "key", + "in": "path", + "required": true + }, + { + "description": "context for the feature flag request", + "name": "flagContext", + "in": "body", + "required": true, + "schema": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + ], + "responses": { + "200": { + "description": "Variant Feature Flag Status", + "schema": { + "$ref": "#/definitions/FeatureFlagVariant" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/move_documents/{moveDocumentId}": { + "put": { + "description": "Update a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Updates a move document", + "operationId": "updateMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move document model", + "name": "moveDocumentId", + "in": "path", + "required": true + }, + { + "name": "updateMoveDocument", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of move document", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move document not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "delete": { + "description": "Deletes a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Deletes a move document", + "operationId": "deleteMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move document model", + "name": "moveDocumentId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}": { + "get": { + "description": "Returns the given move", + "tags": [ + "moves" + ], + "summary": "Returns the given move", + "operationId": "showMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the move", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move is not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the move referenced", + "tags": [ + "moves" + ], + "summary": "Patches the move", + "operationId": "patchMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "patchMovePayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchMovePayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of move", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move or closeout office is not found" + }, + "412": { + "description": "precondition failed" + }, + "422": { + "description": "unprocessable entity" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/approve": { + "post": { + "description": "Approves the basic details of a move. The status of the move will be updated to APPROVED", + "tags": [ + "office" + ], + "summary": "Approves a move to proceed", + "operationId": "approveMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (approved) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/cancel": { + "post": { + "description": "Cancels the basic details of a move. The status of the move will be updated to CANCELED", + "tags": [ + "office" + ], + "summary": "Cancels a move", + "operationId": "cancelMove", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (canceled) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to cancel this move" + }, + "409": { + "description": "the move is not in a state to be canceled", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/move_documents": { + "get": { + "description": "Returns a list of all Move Documents associated with this move", + "tags": [ + "move_docs" + ], + "summary": "Returns a list of all Move Documents associated with this move", + "operationId": "indexMoveDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns list of move douments", + "schema": { + "$ref": "#/definitions/MoveDocuments" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + } + } + }, + "post": { + "description": "Created a move document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Creates a move document", + "operationId": "createGenericMoveDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createGenericMoveDocumentPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateGenericMoveDocumentPayload" + } + } + ], + "responses": { + "200": { + "description": "returns new move document object", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to modify this move" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/orders": { + "get": { + "description": "Returns orders information for a move for office use", + "tags": [ + "office" + ], + "summary": "Returns orders information for a move for office use", + "operationId": "showOfficeOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the orders information for a move for office use", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/signed_certifications": { + "get": { + "description": "returns a list of all signed_certifications associated with the move ID", + "tags": [ + "certification" + ], + "summary": "gets the signed certifications for the given move ID", + "operationId": "indexSignedCertification", + "parameters": [ + { + "type": "string", + "format": "uuid", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns a list of signed certifications", + "schema": { + "$ref": "#/definitions/SignedCertifications" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Create an instance of signed_certification tied to the move ID", + "tags": [ + "certification" + ], + "summary": "Submits signed certification for the given move ID", + "operationId": "createSignedCertification", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move being signed for", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSignedCertificationPayload" + } + } + ], + "responses": { + "201": { + "description": "created instance of signed_certification", + "schema": { + "$ref": "#/definitions/SignedCertificationPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to sign for this move" + }, + "404": { + "description": "move not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/moves/{moveId}/submit": { + "post": { + "description": "Submits a move for approval by the office. The status of the move will be updated to SUBMITTED", + "tags": [ + "moves" + ], + "summary": "Submits a move for approval", + "operationId": "submitMoveForApproval", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "submitMoveForApprovalPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SubmitMoveForApprovalPayload" + } + } + ], + "responses": { + "200": { + "description": "returns updated (submitted) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/submit_amended_orders": { + "post": { + "description": "Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not.", + "tags": [ + "moves" + ], + "summary": "Submits amended orders for review", + "operationId": "submitAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns updated (submitted) move object", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to approve this move" + }, + "409": { + "description": "the move is not in a state to be approved", + "schema": { + "$ref": "#/definitions/MovePayload" + } + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/uploadAdditionalDocuments": { + "patch": { + "description": "Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "moves" + ], + "summary": "Patch the additional documents for a given move", + "operationId": "uploadAdditionalDocuments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "moveId", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveId}/weight_ticket": { + "post": { + "description": "Created a weight ticket document with the given information", + "tags": [ + "move_docs" + ], + "summary": "Creates a weight ticket document", + "operationId": "createWeightTicketDocument", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move", + "name": "moveId", + "in": "path", + "required": true + }, + { + "name": "createWeightTicketDocument", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateWeightTicketDocumentsPayload" + } + } + ], + "responses": { + "200": { + "description": "returns new weight ticket document object", + "schema": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "not authorized to modify this move" + }, + "500": { + "description": "server error" + } + } + } + }, + "/moves/{moveTaskOrderID}/mto_shipments": { + "get": { + "description": "Gets all MTO shipments for the specified Move Task Order.\n", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Gets all shipments for a move task order", + "operationId": "listMTOShipments", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of move task order for mto shipment to use", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all mto shipments for a move task order.", + "schema": { + "$ref": "#/definitions/MTOShipments" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentId}": { + "delete": { + "description": "Soft deletes a shipment by ID", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "Soft deletes a shipment by ID", + "operationId": "deleteShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "ID of the shipment to be deleted", + "name": "mtoShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the shipment" + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Updates a specified MTO shipment.\n\nRequired fields include:\n* MTO Shipment ID required in path\n* If-Match required in headers\n* Shipment type is required in body\n\nOptional fields include:\n* New shipment status type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n* Customer Remarks\n* Releasing / Receiving agents\n* Actual Pro Gear Weight\n* Actual Spouse Pro Gear Weight\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the MTO Shipment to update", + "name": "mtoShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/UpdateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the specified MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto_shipments": { + "post": { + "description": "Creates a MTO shipment for the specified Move Task Order.\nRequired fields include:\n* Shipment Type\n* Customer requested pick-up date\n* Pick-up Address\n* Delivery Address\n\nOptional fields include:\n* Customer Remarks\n* Releasing / Receiving agents\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/okta-profile": { + "get": { + "description": "Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update.", + "produces": [ + "application/json" + ], + "tags": [ + "okta_profile" + ], + "summary": "Returns Okta profile values from Okta's Users API", + "operationId": "showOktaInfo", + "responses": { + "200": { + "description": "okta profile for user", + "schema": { + "$ref": "#/definitions/OktaUserProfileData" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "okta_profile" + ], + "summary": "Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values.", + "operationId": "updateOktaInfo", + "parameters": [ + { + "name": "updateOktaUserProfileData", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateOktaUserProfileData" + } + } + ], + "responses": { + "200": { + "description": "okta profile for user", + "schema": { + "$ref": "#/definitions/OktaUserProfileData" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "422": { + "description": "validation error", + "schema": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders": { + "post": { + "description": "Creates an instance of orders tied to a service member", + "tags": [ + "orders" + ], + "summary": "Creates an orders model for a logged-in user", + "operationId": "createOrders", + "parameters": [ + { + "name": "createOrders", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateUpdateOrders" + } + } + ], + "responses": { + "201": { + "description": "created instance of orders", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{ordersId}": { + "get": { + "description": "Returns the given order", + "tags": [ + "orders" + ], + "summary": "Returns the given order", + "operationId": "showOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "ordersId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the order", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "order is not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "put": { + "description": "All fields sent in this request will be set on the orders referenced", + "tags": [ + "orders" + ], + "summary": "Updates orders", + "operationId": "updateOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the orders model", + "name": "ordersId", + "in": "path", + "required": true + }, + { + "name": "updateOrders", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateUpdateOrders" + } + } + ], + "responses": { + "200": { + "description": "updated instance of orders", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "orders not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/orders/{ordersId}/upload_amended_orders": { + "patch": { + "description": "Patch the amended orders for a given order", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "orders" + ], + "summary": "Patch the amended orders for a given order", + "operationId": "uploadAmendedOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the order", + "name": "ordersId", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/aoa-packet": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF.\n### Errors\n* The PPMShipment must have requested an AOA.\n* The PPMShipment AOA Request must have been approved.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Downloads AOA Packet form PPMShipment as a PDF", + "operationId": "showAOAPacket", + "responses": { + "200": { + "description": "AOA PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "the id for the ppmshipment with aoa to be downloaded", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses": { + "post": { + "description": "Creates a moving expense document for the PPM shipment", + "tags": [ + "ppm" + ], + "summary": "Creates moving expense document", + "operationId": "createMovingExpense", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "returns new moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}": { + "delete": { + "description": "Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a moving expense by ID", + "operationId": "deleteMovingExpense", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the moving expense to be deleted", + "name": "movingExpenseId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the moving expense" + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the moving expense referenced", + "tags": [ + "ppm" + ], + "summary": "Updates the moving expense", + "operationId": "updateMovingExpense", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "updateMovingExpense", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMovingExpense" + } + } + ], + "responses": { + "200": { + "description": "returns an updated moving expense object", + "schema": { + "$ref": "#/definitions/MovingExpense" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/payment-packet": { + "get": { + "description": "Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations.", + "produces": [ + "application/pdf" + ], + "tags": [ + "ppm" + ], + "summary": "Returns PPM payment packet", + "operationId": "showPaymentPacket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppmShipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "PPM Payment Packet PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "ppm not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets": { + "post": { + "description": "Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a\npro-gear weight ticket. Data should be filled in using the patch endpoint.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Creates a pro-gear weight ticket", + "operationId": "createProGearWeightTicket", + "responses": { + "201": { + "description": "returns a new pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}": { + "delete": { + "description": "Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a pro-gear weight line item by ID", + "operationId": "deleteProGearWeightTicket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the pro-gear weight ticket to be deleted", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the pro-gear weight ticket" + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable\nbecause some have to be set by the customer, e.g. the description.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates a pro-gear weight ticket", + "operationId": "updateProGearWeightTicket", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + }, + { + "name": "updateProGearWeightTicket", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateProGearWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated pro-gear weight ticket object", + "schema": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}": { + "put": { + "description": "Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Updates signature and routes PPM shipment to service counselor", + "operationId": "resubmitPPMShipmentDocumentation", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the signed certification", + "name": "signedCertificationId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "savePPMShipmentSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SavePPMShipmentSignedCertification" + } + } + ], + "responses": { + "200": { + "description": "Returns the updated PPM shipment", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation": { + "post": { + "description": "Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service\ncounselor queue for review.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Saves signature and routes PPM shipment to service counselor", + "operationId": "submitPPMShipmentDocumentation", + "parameters": [ + { + "name": "savePPMShipmentSignedCertificationPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/SavePPMShipmentSignedCertification" + } + } + ], + "responses": { + "200": { + "description": "Returns the updated PPM shipment", + "schema": { + "$ref": "#/definitions/PPMShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ] + }, + "/ppm-shipments/{ppmShipmentId}/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "ppm" + ], + "summary": "Create a new upload for a PPM weight ticket, pro-gear, or moving expense document", + "operationId": "createPPMUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the ppm shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "boolean", + "description": "If the upload is a Weight Receipt", + "name": "weightReceipt", + "in": "query", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "413": { + "description": "payload is too large" + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket": { + "post": { + "description": "Created a weight ticket document with the given information", + "tags": [ + "ppm" + ], + "summary": "Creates a weight ticket document", + "operationId": "createWeightTicket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "returns new weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}": { + "delete": { + "description": "Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted\nrecords are not visible in milmove, but are kept in the database. This may change the PPM shipment's final\nincentive.\n", + "produces": [ + "application/json" + ], + "tags": [ + "ppm" + ], + "summary": "Soft deletes a weight ticket by ID", + "operationId": "deleteWeightTicket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the weight ticket to be deleted", + "name": "weightTicketId", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully soft deleted the weight ticket" + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "Updates a weight ticket document with the new information", + "tags": [ + "ppm" + ], + "summary": "Updates a weight ticket document", + "operationId": "updateWeightTicket", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "updateWeightTicketPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateWeightTicket" + } + } + ], + "responses": { + "200": { + "description": "returns an updated weight ticket object", + "schema": { + "$ref": "#/definitions/WeightTicket" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/queues/{queueType}": { + "get": { + "description": "Show all moves in a queue", + "tags": [ + "queues" + ], + "summary": "Show all moves in a queue", + "operationId": "showQueue", + "parameters": [ + { + "enum": [ + "new", + "ppm_payment_requested", + "all", + "ppm_approved", + "ppm_completed" + ], + "type": "string", + "description": "Queue type to show", + "name": "queueType", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "list all moves in the specified queue", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveQueueItem" + } + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to access this queue" + }, + "404": { + "description": "move queue item is not found" + } + } + } + }, + "/rate_engine_postal_codes/{postal_code}": { + "get": { + "description": "Verifies if a zipcode is valid for origin or destination location for a move.", + "tags": [ + "postal_codes" + ], + "summary": "Validate if a zipcode is valid for origin or destination location for a move.", + "operationId": "validatePostalCodeWithRateData", + "parameters": [ + { + "pattern": "^(\\d{5}?)$", + "type": "string", + "format": "zip", + "name": "postal_code", + "in": "path", + "required": true + }, + { + "enum": [ + "origin", + "destination" + ], + "type": "string", + "name": "postal_code_type", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "postal_code is valid or invalid", + "schema": { + "$ref": "#/definitions/RateEnginePostalCodePayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "must be authenticated to use this endpoint" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "server error" + } + } + } + }, + "/reimbursement/{reimbursementId}/approve": { + "post": { + "description": "Sets the status of the reimbursement to APPROVED.", + "tags": [ + "office" + ], + "summary": "Approves the reimbursement", + "operationId": "approveReimbursement", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the reimbursement being approved", + "name": "reimbursementId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "updated instance of reimbursement", + "schema": { + "$ref": "#/definitions/Reimbursement" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members": { + "post": { + "description": "Creates an instance of a service member tied to a user", + "tags": [ + "service_members" + ], + "summary": "Creates service member for a logged-in user", + "operationId": "createServiceMember", + "parameters": [ + { + "name": "createServiceMemberPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateServiceMemberPayload" + } + } + ], + "responses": { + "201": { + "description": "created instance of service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}": { + "get": { + "description": "Returns the given service member", + "tags": [ + "service_members" + ], + "summary": "Returns the given service member", + "operationId": "showServiceMember", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "patch": { + "description": "Any fields sent in this request will be set on the service member referenced", + "tags": [ + "service_members" + ], + "summary": "Patches the service member", + "operationId": "patchServiceMember", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + }, + { + "name": "patchServiceMemberPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/PatchServiceMemberPayload" + } + } + ], + "responses": { + "200": { + "description": "updated instance of service member", + "schema": { + "$ref": "#/definitions/ServiceMemberPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}/backup_contacts": { + "get": { + "description": "List all service member backup contacts", + "tags": [ + "backup_contacts" + ], + "summary": "List all service member backup contacts", + "operationId": "indexServiceMemberBackupContacts", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "list of service member backup contacts", + "schema": { + "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to see this backup contact" + }, + "404": { + "description": "contact not found" + }, + "500": { + "description": "internal server error" + } + } + }, + "post": { + "description": "Creates an instance of a backup contact tied to a service member user", + "tags": [ + "backup_contacts" + ], + "summary": "Submits backup contact for a logged-in user", + "operationId": "createServiceMemberBackupContact", + "parameters": [ + { + "name": "createBackupContactPayload", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateServiceMemberBackupContactPayload" + } + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "201": { + "description": "created instance of service member backup contact", + "schema": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized to create this backup contact" + }, + "404": { + "description": "contact not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/service_members/{serviceMemberId}/current_orders": { + "get": { + "description": "Returns orders", + "tags": [ + "service_members" + ], + "summary": "Returns the latest orders for a given service member", + "operationId": "showServiceMemberOrders", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member", + "name": "serviceMemberId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the service member", + "schema": { + "$ref": "#/definitions/Orders" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "403": { + "description": "user is not authorized" + }, + "404": { + "description": "service member not found" + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/transportation-offices": { + "get": { + "description": "Returns the transportation offices matching the search query", + "produces": [ + "application/json" + ], + "tags": [ + "transportation_offices" + ], + "summary": "Returns the transportation offices matching the search query", + "operationId": "getTransportationOffices", + "parameters": [ + { + "minLength": 2, + "type": "string", + "description": "Search string for transportation offices", + "name": "search", + "in": "query", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved transportation offices", + "schema": { + "$ref": "#/definitions/TransportationOffices" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/transportation_offices/{dutyLocationId}/counseling_offices": { + "get": { + "description": "Returns the counseling locations matching the GBLOC from the selected duty location", + "produces": [ + "application/json" + ], + "tags": [ + "transportation_offices" + ], + "summary": "Returns the counseling locations in the GBLOC matching the duty location", + "operationId": "showCounselingOffices", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the duty location", + "name": "dutyLocationId", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "the instance of the counseling office for a duty location", + "schema": { + "$ref": "#/definitions/CounselingOffices" + } + }, + "500": { + "description": "internal server error" + } + } + } + }, + "/uploads": { + "post": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "consumes": [ + "multipart/form-data" + ], + "tags": [ + "uploads" + ], + "summary": "Create a new upload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the document to add an upload to", + "name": "documentId", + "in": "query" + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "created upload", + "schema": { + "$ref": "#/definitions/Upload" + } + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "413": { + "description": "payload is too large" + }, + "500": { + "description": "server error" + } + } + }, + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes a collection of uploads", + "operationId": "deleteUploads", + "parameters": [ + { + "type": "array", + "items": { + "type": "string", + "format": "uuid" + }, + "description": "Array of UUIDs to be deleted", + "name": "uploadIds", + "in": "query", + "required": true + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/uploads/{uploadId}": { + "delete": { + "description": "Uploads represent a single digital file, such as a JPEG or PDF.", + "tags": [ + "uploads" + ], + "summary": "Deletes an upload", + "operationId": "deleteUpload", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the upload to be deleted", + "name": "uploadId", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "ID of the order that the upload belongs to", + "name": "orderId", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Optional ID of the move that the upload belongs to", + "name": "moveId", + "in": "query" + }, + { + "type": "string", + "format": "uuid", + "description": "Optional PPM shipment ID related to the upload", + "name": "ppmId", + "in": "query" + } + ], + "responses": { + "204": { + "description": "deleted" + }, + "400": { + "description": "invalid request", + "schema": { + "$ref": "#/definitions/InvalidRequestResponsePayload" + } + }, + "403": { + "description": "not authorized" + }, + "404": { + "description": "not found" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/is_logged_in": { + "get": { + "description": "Returns boolean as to whether the user is logged in", + "tags": [ + "users" + ], + "summary": "Returns boolean as to whether the user is logged in", + "operationId": "isLoggedInUser", + "responses": { + "200": { + "description": "Currently logged in user", + "schema": { + "type": "object", + "required": [ + "isLoggedIn" + ], + "properties": { + "isLoggedIn": { + "type": "boolean" + } + } + } + }, + "400": { + "description": "invalid request" + }, + "500": { + "description": "server error" + } + } + } + }, + "/users/logged_in": { + "get": { + "description": "Returns the user info for the currently logged in user", + "tags": [ + "users" + ], + "summary": "Returns the user info for the currently logged in user", + "operationId": "showLoggedInUser", + "responses": { + "200": { + "description": "Currently logged in user", + "schema": { + "$ref": "#/definitions/LoggedInUserPayload" + } + }, + "400": { + "description": "invalid request" + }, + "401": { + "description": "request requires user authentication" + }, + "500": { + "description": "server error" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Affiliation": { + "description": "Military branch of service", + "type": "string", + "title": "Branch of service", + "enum": [ + "ARMY", + "NAVY", + "MARINES", + "AIR_FORCE", + "COAST_GUARD", + "SPACE_FORCE", + "OTHER" + ], + "x-display-value": { + "AIR_FORCE": "Air Force", + "ARMY": "Army", + "COAST_GUARD": "Coast Guard", + "MARINES": "Marine Corps", + "NAVY": "Navy", + "OTHER": "OTHER", + "SPACE_FORCE": "Space Force" + }, + "x-nullable": true + }, + "ApplicationParameters": { + "type": "object", + "properties": { + "parameterName": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "parameterValue": { + "type": "string", + "format": "string", + "x-nullable": true + }, + "validationCode": { + "type": "string", + "format": "string", + "x-nullable": true + } + } + }, + "AvailableMoveDates": { + "type": "object", + "required": [ + "start_date", + "available" + ], + "properties": { + "available": { + "type": "array", + "items": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } + }, + "start_date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + } + } + }, + "BackupContactPermission": { + "type": "string", + "title": "Permissions", + "enum": [ + "NONE", + "VIEW", + "EDIT" + ], + "x-display-value": { + "EDIT": "View and edit all move details", + "NONE": "Contact Only", + "VIEW": "View all move details" + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "CancelMove": { + "type": "object", + "required": [ + "cancel_reason" + ], + "properties": { + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CounselingOffice": { + "type": "object", + "required": [ + "id", + "name" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "CounselingOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/CounselingOffice" + } + }, + "CreateBoatShipment": { + "description": "Boat shipment information for the move.", + "required": [ + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateGenericMoveDocumentPayload": { + "type": "object", + "required": [ + "upload_ids", + "title", + "move_document_type" + ], + "properties": { + "move_document_type": { + "$ref": "#/definitions/MoveDocumentType" + }, + "notes": { + "type": "string", + "title": "Notes", + "x-nullable": true, + "example": "This document is good to go!" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "title": { + "type": "string", + "example": "very_useful_document.pdf" + }, + "upload_ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + } + }, + "CreateMobileHomeShipment": { + "description": "A mobile home shipment that the prime moves for a service member.", + "required": [ + "make", + "model", + "year", + "lengthInInches", + "heightInInches", + "widthInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "A personally procured move is a type of shipment that a service members moves themselves.", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected" + ], + "properties": { + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date" + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Denotes if this PPM shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "sitExpected": { + "type": "boolean" + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "CreateServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "name", + "email", + "permission" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "title": "Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@exmaple.com" + }, + "name": { + "type": "string", + "title": "Name", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + } + } + }, + "CreateServiceMemberPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "current_location_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Phone", + "x-nullable": true + }, + "residential_address": { + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Alternate phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "CreateShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date" + }, + "requestedPickupDate": { + "type": "string", + "format": "date" + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "CreateSignedCertificationPayload": { + "type": "object", + "required": [ + "date", + "signature", + "certification_text" + ], + "properties": { + "certification_text": { + "type": "string" + }, + "certification_type": { + "$ref": "#/definitions/SignedCertificationTypeCreate" + }, + "date": { + "type": "string", + "format": "date-time", + "title": "Date" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "ppm_id": { + "$ref": "#/definitions/PpmID" + }, + "signature": { + "type": "string", + "title": "Signature" + } + } + }, + "CreateUpdateOrders": { + "type": "object", + "required": [ + "service_member_id", + "issue_date", + "report_by_date", + "orders_type", + "has_dependents", + "spouse_has_pro_gear", + "new_duty_location_id" + ], + "properties": { + "accompanied_tour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "counseling_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, + "department_indicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "dependents_twelve_and_over": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependents_under_twelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "issue_date": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Orders date", + "example": "2018-04-26" + }, + "move_id": { + "type": "string", + "format": "uuid", + "example": "cf1addea-a4f9-4173-8506-2bb82a064cb7" + }, + "new_duty_location_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders_number": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "orders_type_detail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "origin_duty_location_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "report_by_date": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report-by date", + "example": "2018-04-26" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + } + } + }, + "CreateWeightTicketDocumentsPayload": { + "type": "object", + "required": [ + "personally_procured_move_id", + "weight_ticket_set_type", + "full_weight_ticket_missing", + "empty_weight_ticket_missing", + "trailer_ownership_missing" + ], + "properties": { + "empty_weight": { + "type": "integer", + "title": "empty weight ticket recorded weight", + "minimum": 0 + }, + "empty_weight_ticket_missing": { + "type": "boolean", + "title": "missing empty weight ticket" + }, + "full_weight": { + "type": "integer", + "title": "full weight ticket recorded weight", + "minimum": 0 + }, + "full_weight_ticket_missing": { + "type": "boolean", + "title": "missing full weight ticket" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "trailer_ownership_missing": { + "type": "boolean", + "title": "missing trailer ownership documentation" + }, + "upload_ids": { + "type": "array", + "items": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + }, + "vehicle_make": { + "type": "string", + "title": "Vehicle make", + "x-nullable": true + }, + "vehicle_model": { + "type": "string", + "title": "Vehicle model", + "x-nullable": true + }, + "vehicle_nickname": { + "type": "string", + "title": "Vehicle nickname (ex. 'Large box truck')", + "x-nullable": true + }, + "weight_ticket_date": { + "type": "string", + "format": "date", + "title": "Full Weight Ticket Date", + "x-nullable": true, + "example": "2018-04-26" + }, + "weight_ticket_set_type": { + "$ref": "#/definitions/WeightTicketSetType" + } + } + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "Document": { + "type": "object", + "required": [ + "id", + "service_member_id", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/Upload" + } + } + } + }, + "DutyLocationPayload": { + "type": "object", + "required": [ + "id", + "name", + "address_id", + "affiliation", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "address_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "provides_services_counseling": { + "type": "boolean", + "x-nullable": false + }, + "transportation_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportation_office_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "DutyLocationsPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/DutyLocationPayload" + } + }, + "Entitlement": { + "type": "object", + "properties": { + "accompanied_tour": { + "description": "Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves.", + "type": "boolean", + "x-nullable": true, + "example": true + }, + "dependents_twelve_and_over": { + "description": "Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 3 + }, + "dependents_under_twelve": { + "description": "Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves.", + "type": "integer", + "x-nullable": true, + "example": 5 + }, + "proGear": { + "description": "Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "proGearSpouse": { + "description": "Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade\n", + "type": "integer", + "x-nullable": true, + "example": 500 + }, + "ub_allowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "FeatureFlagBoolean": { + "description": "A feature flag", + "type": "object", + "required": [ + "entity", + "key", + "match", + "namespace" + ], + "properties": { + "entity": { + "type": "string", + "example": "11111111-1111-1111-1111-111111111111" + }, + "key": { + "type": "string", + "example": "flag" + }, + "match": { + "type": "boolean", + "example": true + }, + "namespace": { + "type": "string", + "example": "test" + } + } + }, + "FeatureFlagVariant": { + "description": "A feature flag", + "type": "object", + "required": [ + "entity", + "key", + "match", + "variant", + "namespace" + ], + "properties": { + "entity": { + "type": "string", + "example": "11111111-1111-1111-1111-111111111111" + }, + "key": { + "type": "string", + "example": "flag" + }, + "match": { + "type": "boolean", + "example": true + }, + "namespace": { + "type": "string", + "example": "test" + }, + "variant": { + "type": "string", + "example": "myval" + } + } + }, + "IndexEntitlements": { + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/WeightAllotment" + } + }, + "IndexMovesPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/MovePayload" + } + }, + "IndexServiceMemberBackupContactsPayload": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceMemberBackupContactPayload" + } + }, + "InternalMove": { + "type": "object", + "properties": { + "closeoutOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "counselingOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "orders": { + "type": "object" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "status": { + "type": "string", + "readOnly": true + }, + "submittedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "InvalidRequestResponsePayload": { + "type": "object", + "properties": { + "errors": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, + "IsDateWeekendHolidayInfo": { + "type": "object", + "required": [ + "country_code", + "country_name", + "date", + "is_weekend", + "is_holiday" + ], + "properties": { + "country_code": { + "type": "string" + }, + "country_name": { + "type": "string" + }, + "date": { + "type": "string", + "format": "date", + "example": "2018-09-25" + }, + "details": { + "type": "string" + }, + "is_holiday": { + "type": "boolean" + }, + "is_weekend": { + "type": "boolean" + } + } + }, + "LoggedInUserPayload": { + "type": "object", + "required": [ + "id" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "readOnly": true, + "example": "john_bob@example.com" + }, + "first_name": { + "type": "string", + "readOnly": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "office_user": { + "$ref": "#/definitions/OfficeUser" + }, + "permissions": { + "type": "array", + "items": { + "type": "string" + } + }, + "privileges": { + "type": "array", + "items": { + "$ref": "#/definitions/Privilege" + } + }, + "roles": { + "type": "array", + "items": { + "$ref": "#/definitions/Role" + }, + "x-nullable": true + }, + "service_member": { + "$ref": "#/definitions/ServiceMemberPayload" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$)|(^$)", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "(^[2-9]\\d{2}-\\d{3}-\\d{4}$)|(^$)", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "type": "string", + "title": "MTO Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOShipment": { + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true, + "readOnly": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentLocator": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "1K43AR-01" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentStatus": { + "type": "string", + "enum": [ + "DRAFT", + "APPROVED", + "SUBMITTED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MethodOfReceipt": { + "type": "string", + "title": "Method of Receipt", + "enum": [ + "MIL_PAY", + "OTHER_DD", + "GTCC" + ], + "x-display-value": { + "GTCC": "GTCC", + "MIL_PAY": "MilPay", + "OTHER_DD": "Other account" + }, + "x-nullable": true + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "MoveDocumentPayload": { + "type": "object", + "required": [ + "id", + "move_id", + "document", + "title", + "move_document_type", + "status" + ], + "properties": { + "document": { + "$ref": "#/definitions/Document" + }, + "empty_weight": { + "type": "integer", + "title": "Empty weight", + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true + }, + "empty_weight_ticket_missing": { + "type": "boolean", + "title": "missing empty weight ticket", + "x-nullable": true + }, + "full_weight": { + "type": "integer", + "title": "Full weight", + "minimum": 0, + "x-formatting": "weight", + "x-nullable": true + }, + "full_weight_ticket_missing": { + "type": "boolean", + "title": "missing full weight ticket", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "move_document_type": { + "$ref": "#/definitions/MoveDocumentType" + }, + "move_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moving_expense_type": { + "$ref": "#/definitions/MovingExpenseType" + }, + "notes": { + "type": "string", + "title": "Notes", + "x-nullable": true, + "example": "This document is good to go!" + }, + "payment_method": { + "type": "string", + "title": "Payment Method", + "enum": [ + "OTHER", + "GTCC" + ], + "x-display-value": { + "GTCC": "GTCC", + "OTHER": "Other account" + } + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "receipt_missing": { + "type": "boolean", + "title": "missing expense receipt", + "x-nullable": true + }, + "requested_amount_cents": { + "description": "unit is cents", + "type": "integer", + "format": "cents", + "title": "Requested Amount", + "minimum": 1 + }, + "status": { + "$ref": "#/definitions/MoveDocumentStatus" + }, + "storage_end_date": { + "type": "string", + "format": "date", + "title": "End date of storage for storage expenses", + "x-nullable": true, + "example": "2018-04-26" + }, + "storage_start_date": { + "type": "string", + "format": "date", + "title": "Start date of storage for storage expenses", + "x-nullable": true, + "example": "2018-04-26" + }, + "title": { + "type": "string", + "title": "Document title", + "example": "very_useful_document.pdf" + }, + "trailer_ownership_missing": { + "type": "boolean", + "title": "missing trailer ownership documentation", + "x-nullable": true + }, + "vehicle_make": { + "type": "string", + "title": "Vehicle make", + "x-nullable": true + }, + "vehicle_model": { + "type": "string", + "title": "Vehicle model", + "x-nullable": true + }, + "vehicle_nickname": { + "type": "string", + "title": "Nickname (ex. \"15-foot truck\")", + "x-nullable": true + }, + "weight_ticket_date": { + "type": "string", + "format": "date", + "title": "Weight ticket date", + "x-nullable": true, + "example": "2018-04-26" + }, + "weight_ticket_set_type": { + "$ref": "#/definitions/WeightTicketSetType" + } + } + }, + "MoveDocumentStatus": { + "type": "string", + "title": "Document status", + "enum": [ + "AWAITING_REVIEW", + "OK", + "HAS_ISSUE", + "EXCLUDE_FROM_CALCULATION" + ], + "x-display-value": { + "AWAITING_REVIEW": "Awaiting review", + "EXCLUDE_FROM_CALCULATION": "Exclude from calculation", + "HAS_ISSUE": "Has issue", + "OK": "OK" + } + }, + "MoveDocumentType": { + "type": "string", + "title": "Document type", + "enum": [ + "OTHER", + "WEIGHT_TICKET", + "STORAGE_EXPENSE", + "SHIPMENT_SUMMARY", + "EXPENSE", + "WEIGHT_TICKET_SET" + ], + "x-display-value": { + "EXPENSE": "Expense", + "OTHER": "Other document type", + "SHIPMENT_SUMMARY": "Shipment summary", + "STORAGE_EXPENSE": "Storage expense receipt", + "WEIGHT_TICKET": "Weight ticket", + "WEIGHT_TICKET_SET": "Weight ticket set" + }, + "example": "EXPENSE" + }, + "MoveDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveDocumentPayload" + } + }, + "MovePayload": { + "type": "object", + "required": [ + "id", + "orders_id", + "locator", + "created_at", + "updated_at", + "eTag" + ], + "properties": { + "additionalDocuments": { + "$ref": "#/definitions/Document" + }, + "cancel_reason": { + "type": "string", + "x-nullable": true, + "example": "Change of orders" + }, + "closeout_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "counseling_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "eTag": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "mto_shipments": { + "$ref": "#/definitions/MTOShipments" + }, + "orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "submitted_at": { + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "MoveQueueItem": { + "type": "object", + "required": [ + "id", + "status", + "locator", + "customer_name", + "edipi", + "grade", + "orders_type", + "branch_of_service", + "last_modified_date", + "created_at" + ], + "properties": { + "actual_move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "branch_of_service": { + "type": "string" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "customer_name": { + "type": "string", + "title": "Customer Name", + "example": "Thedog, Nino" + }, + "delivered_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "destination_duty_location_name": { + "type": "string", + "title": "Destination", + "x-nullable": true, + "example": "Dover AFB" + }, + "destination_gbloc": { + "type": "string", + "title": "Destination GBLOC", + "x-nullable": true, + "example": "LKNQ" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID #", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "example": "5789345789" + }, + "gbl_number": { + "type": "string", + "title": "GBL Number", + "x-nullable": true, + "example": "LNK12345" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "hhg_status": { + "type": "string", + "x-nullable": true, + "example": "ACCEPTED" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "invoice_approved_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "last_modified_date": { + "type": "string", + "format": "date-time", + "example": "2017-07-21T17:32:28Z" + }, + "locator": { + "type": "string", + "example": "12432" + }, + "move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "origin_duty_location_name": { + "type": "string", + "title": "Origin", + "x-nullable": true, + "example": "Dover AFB" + }, + "origin_gbloc": { + "type": "string", + "title": "Origin GBLOC", + "x-nullable": true, + "example": "LKNQ" + }, + "original_move_date": { + "type": "string", + "format": "date", + "x-nullable": true, + "example": "2018-04-25" + }, + "pm_survey_conducted_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2017-07-21T17:32:28Z" + }, + "ppm_status": { + "type": "string", + "x-nullable": true, + "example": "PAYMENT_REQUESTED" + }, + "status": { + "type": "string", + "example": "APPROVED" + }, + "submitted_date": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "example": "2018-04-25" + }, + "weight_allotment": { + "$ref": "#/definitions/WeightAllotment" + } + } + }, + "MoveStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED", + "NEEDS SERVICE COUNSELING", + "APPROVALS REQUESTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MovesList": { + "type": "object", + "properties": { + "currentMove": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + }, + "previousMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/InternalMove" + } + } + } + }, + "MovingExpense": { + "description": "Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment.", + "type": "object", + "required": [ + "id", + "createdAt", + "updatedAt", + "ppmShipmentId", + "documentId", + "document" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp the moving expense object was initially created in the system (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "A brief description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "The Document object that contains all file uploads for this expense" + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The id of the Document that contains all file uploads for this expense", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "Unique primary identifier of the Moving Expense object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingReceipt": { + "description": "Indicates if the service member is missing the receipt with the proof of expense amount", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenseType": { + "$ref": "#/definitions/OmittableMovingExpenseType" + }, + "paidWithGtcc": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The PPM Shipment id that this moving expense belongs to", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedAmount": { + "description": "Customer submitted total amount of the expense as indicated on the receipt", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "submittedDescription": { + "description": "Customer submitted description of the expense", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "submittedMovingExpenseType": { + "$ref": "#/definitions/SubmittedMovingExpenseType" + }, + "submittedSitEndDate": { + "description": "Customer submitted date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2018-05-26" + }, + "submittedSitStartDate": { + "description": "Customer submitted date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "example": "2022-04-26" + }, + "updatedAt": { + "description": "Timestamp when a property of this moving expense object was last modified (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "MovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + } + }, + "NullableSignedCertificationType": { + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PPM", + "HHG" + ], + "x-nullable": true + }, + "OfficeUser": { + "type": "object", + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "format": "x-email", + "title": "Personal Email Address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "transportation_office": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportation_office_assignments": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOfficeAssignment" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OktaUserProfileData": { + "type": "object", + "properties": { + "cac_edipi": { + "type": "string", + "maxLength": 10, + "x-nullable": true, + "example": "1234567890" + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "user@email.com" + }, + "firstName": { + "type": "string", + "example": "John" + }, + "lastName": { + "type": "string", + "example": "Doe" + }, + "login": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "user@email.com" + }, + "sub": { + "type": "string", + "format": "string", + "example": "1duekdue9ekrjghf" + } + } + }, + "OmittableMovingExpenseType": { + "description": "Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OmittablePPMDocumentStatus": { + "description": "Status of the PPM document.", + "type": "string", + "enum": [ + "APPROVED", + "EXCLUDED", + "REJECTED" + ], + "x-display-value": { + "APPROVED": "Approved", + "EXCLUDED": "Excluded", + "REJECTED": "Rejected" + }, + "x-nullable": true, + "x-omitempty": false + }, + "OrderPayGrade": { + "type": "string", + "title": "Grade", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ], + "x-display-value": { + "ACADEMY_CADET": "Service Academy Cadet", + "AVIATION_CADET": "Aviation Cadet", + "CIVILIAN_EMPLOYEE": "Civilian Employee", + "E_1": "E-1", + "E_2": "E-2", + "E_3": "E-3", + "E_4": "E-4", + "E_5": "E-5", + "E_6": "E-6", + "E_7": "E-7", + "E_8": "E-8", + "E_9": "E-9", + "E_9_SPECIAL_SENIOR_ENLISTED": "E-9 (Special Senior Enlisted)", + "MIDSHIPMAN": "Midshipman", + "O_10": "O-10", + "O_1_ACADEMY_GRADUATE": "O-1 or Service Academy Graduate", + "O_2": "O-2", + "O_3": "O-3", + "O_4": "O-4", + "O_5": "O-5", + "O_6": "O-6", + "O_7": "O-7", + "O_8": "O-8", + "O_9": "O-9", + "W_1": "W-1", + "W_2": "W-2", + "W_3": "W-3", + "W_4": "W-4", + "W_5": "W-5" + }, + "x-nullable": true + }, + "Orders": { + "type": "object", + "required": [ + "id", + "service_member_id", + "issue_date", + "report_by_date", + "orders_type", + "has_dependents", + "spouse_has_pro_gear", + "new_duty_location", + "uploaded_orders", + "created_at", + "updated_at" + ], + "properties": { + "authorizedWeight": { + "type": "integer", + "x-nullable": true, + "example": 7000 + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "department_indicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "entitlement": { + "$ref": "#/definitions/Entitlement" + }, + "grade": { + "$ref": "#/definitions/OrderPayGrade" + }, + "has_dependents": { + "type": "boolean", + "title": "Are dependents included in your orders?" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "issue_date": { + "description": "The date and time that these orders were cut.", + "type": "string", + "format": "date", + "title": "Date issued", + "example": "2018-04-26" + }, + "moves": { + "$ref": "#/definitions/IndexMovesPayload" + }, + "new_duty_location": { + "$ref": "#/definitions/DutyLocationPayload" + }, + "orders_number": { + "type": "string", + "title": "Orders Number", + "x-nullable": true, + "example": "030-00362" + }, + "orders_type": { + "$ref": "#/definitions/OrdersType" + }, + "orders_type_detail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocationGbloc": { + "type": "string", + "title": "From what GBLOC do your orders originate?", + "x-nullable": true + }, + "origin_duty_location": { + "x-nullable": true, + "$ref": "#/definitions/DutyLocationPayload" + }, + "providesServicesCounseling": { + "type": "boolean", + "x-omitempty": false + }, + "report_by_date": { + "description": "Report By Date", + "type": "string", + "format": "date", + "title": "Report by", + "example": "2018-04-26" + }, + "sac": { + "type": "string", + "title": "SAC", + "x-nullable": true, + "example": "N002214CSW32Y9" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "spouse_has_pro_gear": { + "type": "boolean", + "title": "Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)?" + }, + "status": { + "$ref": "#/definitions/OrdersStatus" + }, + "tac": { + "type": "string", + "title": "TAC", + "x-nullable": true, + "example": "F8J1" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "uploaded_amended_orders": { + "$ref": "#/definitions/Document" + }, + "uploaded_amended_orders_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploaded_orders": { + "$ref": "#/definitions/Document" + } + } + }, + "OrdersStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PPMAdvanceStatus": { + "description": "Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received", + "type": "string", + "title": "PPM Advance Status", + "enum": [ + "APPROVED", + "REJECTED", + "EDITED", + "RECEIVED", + "NOT_RECEIVED" + ], + "x-nullable": true + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMDocumentStatusReason": { + "description": "The reason the services counselor has excluded or rejected the item.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "PPMEstimateRange": { + "type": "object", + "required": [ + "range_min", + "range_max" + ], + "properties": { + "range_max": { + "type": "integer", + "title": "High estimate" + }, + "range_min": { + "type": "integer", + "title": "Low estimate" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceStatus": { + "$ref": "#/definitions/PPMAdvanceStatus" + }, + "allowableWeight": { + "description": "The allowable weight of the PPM shipment goods being moved.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false, + "example": 4300 + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "Timestamp of when the PPM Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin their move.\n", + "type": "string", + "format": "date" + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "Primary auto-generated unique identifier of the PPM shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "movingExpenses": { + "description": "All expense documentation receipt records of this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MovingExpense" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeightTickets": { + "description": "All pro-gear weight ticket documentation records for this PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/ProGearWeightTicket" + } + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "secondaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "signedCertification": { + "$ref": "#/definitions/SignedCertification" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "tertiaryPickupAddress": { + "allOf": [ + { + "$ref": "#/definitions/Address" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + }, + "weightTickets": { + "$ref": "#/definitions/WeightTickets" + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PatchMovePayload": { + "type": "object", + "required": [ + "closeoutOfficeId" + ], + "properties": { + "closeoutOfficeId": { + "description": "The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members", + "type": "string", + "format": "uuid" + } + } + }, + "PatchServiceMemberPayload": { + "type": "object", + "properties": { + "affiliation": { + "$ref": "#/definitions/Affiliation" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "current_location_id": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "emplid": { + "type": "string", + "title": "USCG EMPLID", + "maxLength": 7, + "minLength": 7, + "pattern": "^\\d{7}$", + "x-nullable": true, + "example": "5789345" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Phone", + "x-nullable": true + }, + "residential_address": { + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Alternate Phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best Contact Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PostDocumentPayload": { + "type": "object", + "properties": { + "service_member_id": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + } + } + }, + "PpmID": { + "description": "The PPM Shipment ID to associate with the assigned certificate.\n", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "Privilege": { + "type": "object", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "privilegeName": { + "type": "string", + "example": "Supervisor" + }, + "privilegeType": { + "type": "string", + "example": "supervisor" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ProGearWeightTicket": { + "description": "Pro-gear associated information and weight docs for a PPM shipment", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "documentId", + "document" + ], + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "document": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the pro-gear weight." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "documentId": { + "description": "The ID of the document that is associated with the user uploads containing the pro-gear weight.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the pro-gear weight ticket.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this pro-gear weight ticket is associated with.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedBelongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedHasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedWeight": { + "description": "Customer submitted weight of the pro-gear.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "weight": { + "description": "Weight of the pro-gear.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + } + } + }, + "RateEnginePostalCodePayload": { + "type": "object", + "required": [ + "valid", + "postal_code", + "postal_code_type" + ], + "properties": { + "postal_code": { + "description": "zip code, international allowed", + "type": "string", + "format": "zip", + "title": "ZIP", + "example": "'90210' or 'N15 3NL'" + }, + "postal_code_type": { + "type": "string", + "enum": [ + "origin", + "destination" + ] + }, + "valid": { + "type": "boolean", + "example": false + } + } + }, + "Reimbursement": { + "type": "object", + "required": [ + "requested_amount", + "method_of_receipt" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "method_of_receipt": { + "$ref": "#/definitions/MethodOfReceipt" + }, + "requested_amount": { + "description": "unit is cents", + "type": "integer", + "format": "cents", + "title": "Requested Amount", + "minimum": 1 + }, + "requested_date": { + "type": "string", + "format": "date", + "title": "Requested Date", + "x-nullable": true, + "example": "2018-04-26" + }, + "status": { + "$ref": "#/definitions/ReimbursementStatus" + } + }, + "x-nullable": true + }, + "ReimbursementStatus": { + "type": "string", + "title": "Reimbursement", + "enum": [ + "DRAFT", + "REQUESTED", + "APPROVED", + "REJECTED", + "PAID" + ], + "x-nullable": true + }, + "Role": { + "type": "object", + "required": [ + "id", + "roleType", + "createdAt", + "updatedAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "roleType": { + "type": "string", + "example": "customer" + }, + "updatedAt": { + "type": "string", + "format": "date-time" + } + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "SavePPMShipmentSignedCertification": { + "type": "object", + "required": [ + "certification_text", + "signature", + "date" + ], + "properties": { + "certification_text": { + "description": "Text that the customer is agreeing to and signing.", + "type": "string" + }, + "date": { + "description": "Date of signature", + "type": "string", + "format": "date" + }, + "signature": { + "description": "Customer signature", + "type": "string" + } + } + }, + "ServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "id", + "created_at", + "updated_at", + "name", + "email", + "permission" + ], + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "email": { + "type": "string", + "format": "x-email", + "title": "Email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "title": "Name", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "service_member_id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "ServiceMemberPayload": { + "type": "object", + "required": [ + "id", + "user_id", + "is_profile_complete", + "created_at", + "updated_at" + ], + "properties": { + "affiliation": { + "title": "Branch", + "$ref": "#/definitions/Affiliation" + }, + "backup_contacts": { + "$ref": "#/definitions/IndexServiceMemberBackupContactsPayload" + }, + "backup_mailing_address": { + "$ref": "#/definitions/Address" + }, + "cac_validated": { + "type": "boolean" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "edipi": { + "type": "string", + "format": "edipi", + "title": "DoD ID number", + "maxLength": 10, + "minLength": 10, + "pattern": "^\\d{10}$", + "x-nullable": true, + "example": "5789345789" + }, + "email_is_preferred": { + "type": "boolean", + "title": "Email", + "x-nullable": true + }, + "emplid": { + "type": "string", + "title": "USCG EMPLID", + "maxLength": 7, + "minLength": 7, + "pattern": "^\\d{7}$", + "x-nullable": true, + "example": "5789345" + }, + "first_name": { + "type": "string", + "title": "First name", + "x-nullable": true, + "example": "John" + }, + "grade": { + "title": "Grade", + "$ref": "#/definitions/OrderPayGrade" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "is_profile_complete": { + "type": "boolean" + }, + "last_name": { + "type": "string", + "title": "Last name", + "x-nullable": true, + "example": "Donut" + }, + "middle_name": { + "type": "string", + "title": "Middle name", + "x-nullable": true, + "example": "L." + }, + "orders": { + "type": "array", + "items": { + "$ref": "#/definitions/Orders" + } + }, + "personal_email": { + "type": "string", + "format": "x-email", + "title": "Personal Email Address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "phone_is_preferred": { + "type": "boolean", + "title": "Telephone", + "x-nullable": true + }, + "residential_address": { + "title": "Residential Address", + "$ref": "#/definitions/Address" + }, + "secondary_telephone": { + "type": "string", + "format": "telephone", + "title": "Secondary Phone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true, + "example": "212-555-5555" + }, + "suffix": { + "type": "string", + "title": "Suffix", + "x-nullable": true, + "example": "Jr." + }, + "telephone": { + "type": "string", + "format": "telephone", + "title": "Best contact phone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "user_id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "weight_allotment": { + "$ref": "#/definitions/WeightAllotment" + } + } + }, + "SignedCertification": { + "description": "Signed certification", + "type": "object", + "required": [ + "id", + "submittingUserId", + "moveId", + "certificationType", + "certificationText", + "signature", + "date", + "createdAt", + "updatedAt", + "eTag" + ], + "properties": { + "certificationText": { + "description": "Full text that the customer agreed to and signed.", + "type": "string" + }, + "certificationType": { + "$ref": "#/definitions/SignedCertificationType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "date": { + "description": "Date that the customer signed the certification.", + "type": "string", + "format": "date" + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveId": { + "description": "The ID of the move associated with this signed certification.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmId": { + "description": "The ID of the PPM shipment associated with this signed certification, if any.", + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "signature": { + "description": "The signature that the customer provided.", + "type": "string" + }, + "submittingUserId": { + "description": "The ID of the user that signed.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SignedCertificationPayload": { + "type": "object", + "required": [ + "id", + "move_id", + "created_at", + "updated_at", + "date", + "signature", + "certification_text" + ], + "properties": { + "certification_text": { + "type": "string" + }, + "certification_type": { + "$ref": "#/definitions/NullableSignedCertificationType" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "date": { + "type": "string", + "format": "date-time", + "title": "Date" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "move_id": { + "type": "string", + "format": "uuid" + }, + "personally_procured_move_id": { + "type": "string", + "format": "uuid", + "x-nullable": true + }, + "ppm_id": { + "$ref": "#/definitions/PpmID" + }, + "signature": { + "type": "string", + "title": "Signature" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "SignedCertificationType": { + "description": "The type of signed certification:\n - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are\n ready to submit their documentation for review. When they submit, they will be asked to sign certifying the\n information is correct.\n - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users.\n - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to\n service-counseling-completed \"Submit move details\" by service counselor.\n - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue.\n", + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "readOnly": true + }, + "SignedCertificationTypeCreate": { + "type": "string", + "enum": [ + "PPM_PAYMENT", + "SHIPMENT", + "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT", + "CLOSEOUT_REVIEWED_PPM_PAYMENT" + ], + "x-nullable": true + }, + "SignedCertifications": { + "type": "array", + "items": { + "$ref": "#/definitions/SignedCertificationPayload" + } + }, + "SubmitMoveForApprovalPayload": { + "type": "object", + "properties": { + "certificate": { + "$ref": "#/definitions/CreateSignedCertificationPayload" + } + } + }, + "SubmittedMovingExpenseType": { + "description": "Customer Submitted Moving Expense Type", + "type": "string", + "enum": [ + "CONTRACTED_EXPENSE", + "GAS", + "OIL", + "OTHER", + "PACKING_MATERIALS", + "RENTAL_EQUIPMENT", + "STORAGE", + "TOLLS", + "WEIGHING_FEE" + ], + "x-display-value": { + "CONTRACTED_EXPENSE": "Contracted expense", + "GAS": "Gas", + "OIL": "Oil", + "OTHER": "Other", + "PACKING_MATERIALS": "Packing materials", + "RENTAL_EQUIPMENT": "Rental equipment", + "STORAGE": "Storage", + "TOLLS": "Tolls", + "WEIGHING_FEE": "Weighing fee" + }, + "x-nullable": true, + "x-omitempty": false + }, + "TransportationOffice": { + "type": "object", + "required": [ + "id", + "name", + "address", + "created_at", + "updated_at" + ], + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "gbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "example": "JENQ" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "latitude": { + "type": "number", + "format": "float", + "example": 29.382973 + }, + "longitude": { + "type": "number", + "format": "float", + "example": -98.62759 + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + }, + "phone_lines": { + "type": "array", + "items": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "example": "212-555-5555" + } + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + } + }, + "TransportationOfficeAssignment": { + "type": "object", + "required": [ + "officeUserId", + "transportationOfficeId", + "primaryOffice" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "officeUserId": { + "type": "string", + "format": "uuid", + "example": "c56a4780-65aa-42ec-a945-5fd87dec0538" + }, + "primaryOffice": { + "type": "boolean", + "x-omitempty": false + }, + "transportationOffice": { + "$ref": "#/definitions/TransportationOffice" + }, + "transportationOfficeId": { + "type": "string", + "format": "uuid", + "example": "d67a4780-65aa-42ec-a945-5fd87dec0549" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "TransportationOffices": { + "type": "array", + "items": { + "$ref": "#/definitions/TransportationOffice" + } + }, + "UpdateBoatShipment": { + "type": "object", + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean", + "x-nullable": true + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Boat", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Boat", + "type": "string", + "x-nullable": true + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ], + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Boat", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMobileHomeShipment": { + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string", + "x-nullable": true + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string", + "x-nullable": true + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer", + "x-nullable": true + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateMovingExpense": { + "type": "object", + "required": [ + "movingExpenseType", + "description", + "paidWithGTCC", + "amount", + "missingReceipt" + ], + "properties": { + "amount": { + "description": "The total amount of the expense as indicated on the receipt", + "type": "integer" + }, + "description": { + "description": "A brief description of the expense", + "type": "string" + }, + "missingReceipt": { + "description": "Indicates if the customer is missing the receipt for their expense.", + "type": "boolean" + }, + "movingExpenseType": { + "$ref": "#/definitions/MovingExpenseType" + }, + "paidWithGTCC": { + "description": "Indicates if the service member used their government issued card to pay for the expense", + "type": "boolean" + }, + "sitEndDate": { + "description": "The date the shipment exited storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "sitReimburseableAmount": { + "description": "The amount of SIT that will be reimbursed", + "type": "integer", + "x-nullable": true + }, + "sitStartDate": { + "description": "The date the shipment entered storage, applicable for the ` + "`" + `STORAGE` + "`" + ` movingExpenseType only", + "type": "string", + "format": "date" + }, + "weightStored": { + "description": "The total weight stored in PPM SIT", + "type": "integer" + } + } + }, + "UpdateOktaUserProfileData": { + "type": "object", + "properties": { + "profile": { + "$ref": "#/definitions/OktaUserProfileData" + } + } + }, + "UpdatePPMShipment": { + "type": "object", + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "actualMoveDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "advanceAmountRequested": { + "description": "The amount requested for an advance, or null if no advance is requested\n", + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "estimatedWeight": { + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to move.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "finalIncentive": { + "description": "The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear.\n", + "type": "boolean", + "x-nullable": true + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "sitExpected": { + "type": "boolean", + "x-nullable": true + }, + "spouseProGearWeight": { + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "w2Address": { + "x-nullable": true, + "$ref": "#/definitions/Address" + } + } + }, + "UpdateProGearWeightTicket": { + "type": "object", + "properties": { + "belongsToSelf": { + "description": "Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's.", + "type": "boolean" + }, + "description": { + "description": "Describes the pro-gear that was moved.", + "type": "string" + }, + "hasWeightTickets": { + "description": "Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight.", + "type": "boolean" + }, + "weight": { + "description": "Weight of the vehicle not including the pro-gear.", + "type": "integer", + "minimum": 0 + } + } + }, + "UpdateServiceMemberBackupContactPayload": { + "type": "object", + "required": [ + "name", + "email", + "permission" + ], + "properties": { + "email": { + "type": "string", + "format": "x-email", + "title": "email address", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true, + "example": "john_bob@example.com" + }, + "name": { + "type": "string", + "x-nullable": true, + "example": "Susan Smith" + }, + "permission": { + "$ref": "#/definitions/BackupContactPermission" + }, + "telephone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true, + "example": "212-555-5555" + } + } + }, + "UpdateShipment": { + "type": "object", + "properties": { + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/UpdateBoatShipment" + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "hasSecondaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDeliveryAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "mobileHomeShipment": { + "$ref": "#/definitions/UpdateMobileHomeShipment" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "requestedDeliveryDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "$ref": "#/definitions/MTOShipmentStatus" + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UpdateWeightTicket": { + "type": "object", + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "minimum": 0 + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "minimum": 0 + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "minimum": 0 + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean" + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean" + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string" + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean" + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean" + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string" + } + } + }, + "Upload": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "id", + "url", + "filename", + "contentType", + "bytes", + "createdAt", + "updatedAt" + ], + "properties": { + "bytes": { + "type": "integer", + "readOnly": true + }, + "contentType": { + "type": "string", + "format": "mime-type", + "readOnly": true, + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "deletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "filename": { + "type": "string", + "readOnly": true, + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isWeightTicket": { + "type": "boolean" + }, + "rotation": { + "type": "integer", + "example": 2 + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ], + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "uploadType": { + "type": "string", + "enum": [ + "USER", + "PRIME", + "OFFICE" + ], + "readOnly": true, + "example": "OFFICE" + }, + "url": { + "type": "string", + "format": "uri", + "readOnly": true, + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocation": { + "description": "A postal code, city, and state lookup", + "type": "object", + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "VLocations": { + "type": "array", + "items": { + "$ref": "#/definitions/VLocation" + } + }, + "ValidationError": { + "required": [ + "invalidFields" + ], + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "$ref": "#/definitions/ValidationErrorAllOf1" + } + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + }, + "ValidationErrorAllOf1": { + "type": "object" + }, + "WeightAllotment": { + "type": "object", + "required": [ + "total_weight_self", + "total_weight_self_plus_dependents", + "pro_gear_weight", + "pro_gear_weight_spouse" + ], + "properties": { + "pro_gear_weight": { + "type": "integer", + "example": 2000 + }, + "pro_gear_weight_spouse": { + "type": "integer", + "example": 500 + }, + "total_weight_self": { + "type": "integer", + "example": 18000 + }, + "total_weight_self_plus_dependents": { + "type": "integer", + "example": 18000 + } + } + }, + "WeightTicket": { + "description": "Vehicle and optional trailer information and weight documents used to move this PPM shipment.", + "type": "object", + "required": [ + "ppmShipmentId", + "createdAt", + "updatedAt", + "emptyDocumentId", + "emptyDocument", + "fullDocument", + "fullDocumentId", + "proofOfTrailerOwnershipDocument", + "proofOfTrailerOwnershipDocumentId" + ], + "properties": { + "adjustedNetWeight": { + "description": "Indicates the adjusted net weight of the vehicle", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "emptyDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when empty." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "emptyDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when empty.", + "type": "string", + "format": "uuid", + "readOnly": true + }, + "emptyWeight": { + "description": "Weight of the vehicle when empty.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "fullDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the vehicle weight when full." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "fullDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the vehicle weight when full.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "fullWeight": { + "description": "The weight of the vehicle when full.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "ID of this set of weight tickets.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "missingEmptyWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when empty.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "missingFullWeightTicket": { + "description": "Indicates if the customer is missing a weight ticket for the vehicle weight when full.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "netWeightRemarks": { + "description": "Remarks explaining any edits made to the net weight", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "ownsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "ppmShipmentId": { + "description": "The ID of the PPM shipment that this set of weight tickets is for.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "proofOfTrailerOwnershipDocument": { + "allOf": [ + { + "description": "Document that is associated with the user uploads containing the proof of trailer ownership." + }, + { + "$ref": "#/definitions/Document" + } + ] + }, + "proofOfTrailerOwnershipDocumentId": { + "description": "ID of the document that is associated with the user uploads containing the proof of trailer ownership.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "reason": { + "$ref": "#/definitions/PPMDocumentStatusReason" + }, + "status": { + "$ref": "#/definitions/OmittablePPMDocumentStatus" + }, + "submittedEmptyWeight": { + "description": "Customer submitted weight of the vehicle when empty.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "submittedFullWeight": { + "description": "Customer submitted weight of the vehicle when full.", + "type": "integer", + "minimum": 0, + "x-nullable": true, + "x-omitempty": false + }, + "submittedOwnsTrailer": { + "description": "Indicates if the customer used a trailer they own for the move.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "submittedTrailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "trailerMeetsCriteria": { + "description": "Indicates if the trailer that the customer used meets all the criteria to be claimable.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "vehicleDescription": { + "description": "Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc.", + "type": "string", + "x-nullable": true, + "x-omitempty": false + } + } + }, + "WeightTicketSetType": { + "type": "string", + "title": "Select weight ticket type", + "enum": [ + "CAR", + "CAR_TRAILER", + "BOX_TRUCK", + "PRO_GEAR" + ], + "x-display-value": { + "BOX_TRUCK": "Box truck", + "CAR": "Car", + "CAR_TRAILER": "Car + Trailer", + "PRO_GEAR": "Pro-gear" + }, + "x-nullable": true + }, + "WeightTickets": { + "description": "All weight tickets associated with a PPM shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/WeightTicket" + }, + "x-omitempty": false + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + "movingExpenseId": { + "type": "string", + "format": "uuid", + "description": "UUID of the moving expense", + "name": "movingExpenseId", + "in": "path", + "required": true + }, + "ppmShipmentId": { + "type": "string", + "format": "uuid", + "description": "UUID of the PPM shipment", + "name": "ppmShipmentId", + "in": "path", + "required": true + }, + "proGearWeightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the pro-gear weight ticket", + "name": "proGearWeightTicketId", + "in": "path", + "required": true + }, + "weightTicketId": { + "type": "string", + "format": "uuid", + "description": "UUID of the weight ticket", + "name": "weightTicketId", + "in": "path", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "name": "responses" + }, + { + "name": "orders" + }, + { + "name": "certification" + }, + { + "name": "moves" + }, + { + "name": "office" + }, + { + "name": "documents" + }, + { + "name": "uploads" + }, + { + "name": "service_members" + }, + { + "name": "backup_contacts" + }, + { + "name": "duty_locations" + }, + { + "name": "transportation_offices" + }, + { + "name": "queues" + }, + { + "name": "entitlements" + }, + { + "name": "calendar" + }, + { + "name": "move_docs" + }, + { + "name": "ppm" + }, + { + "name": "postal_codes" + }, + { + "name": "addresses" + }, + { + "name": "mtoShipment" + }, + { + "name": "featureFlags" + }, + { + "name": "okta_profile" + }, + { + "name": "application_parameters" + } + ] +}`)) +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go new file mode 100644 index 00000000000..d202a9066f8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetLocationByZipCityStateHandlerFunc turns a function with the right signature into a get location by zip city state handler +type GetLocationByZipCityStateHandlerFunc func(GetLocationByZipCityStateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetLocationByZipCityStateHandlerFunc) Handle(params GetLocationByZipCityStateParams) middleware.Responder { + return fn(params) +} + +// GetLocationByZipCityStateHandler interface for that can handle valid get location by zip city state params +type GetLocationByZipCityStateHandler interface { + Handle(GetLocationByZipCityStateParams) middleware.Responder +} + +// NewGetLocationByZipCityState creates a new http.Handler for the get location by zip city state operation +func NewGetLocationByZipCityState(ctx *middleware.Context, handler GetLocationByZipCityStateHandler) *GetLocationByZipCityState { + return &GetLocationByZipCityState{Context: ctx, Handler: handler} +} + +/* + GetLocationByZipCityState swagger:route GET /addresses/zip-city-lookup/{search} addresses getLocationByZipCityState + +Returns city, state, postal code, and county associated with the specified full/partial postal code or city state string + +Find by API using full/partial postal code or city name that returns an us_post_region_cities json object containing city, state, county and postal code. +*/ +type GetLocationByZipCityState struct { + Context *middleware.Context + Handler GetLocationByZipCityStateHandler +} + +func (o *GetLocationByZipCityState) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetLocationByZipCityStateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go new file mode 100644 index 00000000000..0e8106fb581 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetLocationByZipCityStateParams creates a new GetLocationByZipCityStateParams object +// +// There are no default values defined in the spec. +func NewGetLocationByZipCityStateParams() GetLocationByZipCityStateParams { + + return GetLocationByZipCityStateParams{} +} + +// GetLocationByZipCityStateParams contains all the bound params for the get location by zip city state operation +// typically these are obtained from a http.Request +// +// swagger:parameters getLocationByZipCityState +type GetLocationByZipCityStateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetLocationByZipCityStateParams() beforehand. +func (o *GetLocationByZipCityStateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rSearch, rhkSearch, _ := route.Params.GetOK("search") + if err := o.bindSearch(rSearch, rhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from path. +func (o *GetLocationByZipCityStateParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Search = raw + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go new file mode 100644 index 00000000000..9a6446dae6a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// GetLocationByZipCityStateOKCode is the HTTP code returned for type GetLocationByZipCityStateOK +const GetLocationByZipCityStateOKCode int = 200 + +/* +GetLocationByZipCityStateOK the requested list of city, state, county, and postal code matches + +swagger:response getLocationByZipCityStateOK +*/ +type GetLocationByZipCityStateOK struct { + + /* + In: Body + */ + Payload internalmessages.VLocations `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateOK creates GetLocationByZipCityStateOK with default headers values +func NewGetLocationByZipCityStateOK() *GetLocationByZipCityStateOK { + + return &GetLocationByZipCityStateOK{} +} + +// WithPayload adds the payload to the get location by zip city state o k response +func (o *GetLocationByZipCityStateOK) WithPayload(payload internalmessages.VLocations) *GetLocationByZipCityStateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state o k response +func (o *GetLocationByZipCityStateOK) SetPayload(payload internalmessages.VLocations) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.VLocations{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetLocationByZipCityStateBadRequestCode is the HTTP code returned for type GetLocationByZipCityStateBadRequest +const GetLocationByZipCityStateBadRequestCode int = 400 + +/* +GetLocationByZipCityStateBadRequest The request payload is invalid. + +swagger:response getLocationByZipCityStateBadRequest +*/ +type GetLocationByZipCityStateBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateBadRequest creates GetLocationByZipCityStateBadRequest with default headers values +func NewGetLocationByZipCityStateBadRequest() *GetLocationByZipCityStateBadRequest { + + return &GetLocationByZipCityStateBadRequest{} +} + +// WithPayload adds the payload to the get location by zip city state bad request response +func (o *GetLocationByZipCityStateBadRequest) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state bad request response +func (o *GetLocationByZipCityStateBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateForbiddenCode is the HTTP code returned for type GetLocationByZipCityStateForbidden +const GetLocationByZipCityStateForbiddenCode int = 403 + +/* +GetLocationByZipCityStateForbidden The request was denied. + +swagger:response getLocationByZipCityStateForbidden +*/ +type GetLocationByZipCityStateForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateForbidden creates GetLocationByZipCityStateForbidden with default headers values +func NewGetLocationByZipCityStateForbidden() *GetLocationByZipCityStateForbidden { + + return &GetLocationByZipCityStateForbidden{} +} + +// WithPayload adds the payload to the get location by zip city state forbidden response +func (o *GetLocationByZipCityStateForbidden) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state forbidden response +func (o *GetLocationByZipCityStateForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateNotFoundCode is the HTTP code returned for type GetLocationByZipCityStateNotFound +const GetLocationByZipCityStateNotFoundCode int = 404 + +/* +GetLocationByZipCityStateNotFound The requested resource wasn't found. + +swagger:response getLocationByZipCityStateNotFound +*/ +type GetLocationByZipCityStateNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateNotFound creates GetLocationByZipCityStateNotFound with default headers values +func NewGetLocationByZipCityStateNotFound() *GetLocationByZipCityStateNotFound { + + return &GetLocationByZipCityStateNotFound{} +} + +// WithPayload adds the payload to the get location by zip city state not found response +func (o *GetLocationByZipCityStateNotFound) WithPayload(payload *internalmessages.ClientError) *GetLocationByZipCityStateNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state not found response +func (o *GetLocationByZipCityStateNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetLocationByZipCityStateInternalServerErrorCode is the HTTP code returned for type GetLocationByZipCityStateInternalServerError +const GetLocationByZipCityStateInternalServerErrorCode int = 500 + +/* +GetLocationByZipCityStateInternalServerError A server error occurred. + +swagger:response getLocationByZipCityStateInternalServerError +*/ +type GetLocationByZipCityStateInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewGetLocationByZipCityStateInternalServerError creates GetLocationByZipCityStateInternalServerError with default headers values +func NewGetLocationByZipCityStateInternalServerError() *GetLocationByZipCityStateInternalServerError { + + return &GetLocationByZipCityStateInternalServerError{} +} + +// WithPayload adds the payload to the get location by zip city state internal server error response +func (o *GetLocationByZipCityStateInternalServerError) WithPayload(payload *internalmessages.Error) *GetLocationByZipCityStateInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get location by zip city state internal server error response +func (o *GetLocationByZipCityStateInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetLocationByZipCityStateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go new file mode 100644 index 00000000000..11f70d8a670 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/get_location_by_zip_city_state_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetLocationByZipCityStateURL generates an URL for the get location by zip city state operation +type GetLocationByZipCityStateURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLocationByZipCityStateURL) WithBasePath(bp string) *GetLocationByZipCityStateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetLocationByZipCityStateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetLocationByZipCityStateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/addresses/zip-city-lookup/{search}" + + search := o.Search + if search != "" { + _path = strings.Replace(_path, "{search}", search, -1) + } else { + return nil, errors.New("search is required on GetLocationByZipCityStateURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetLocationByZipCityStateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetLocationByZipCityStateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetLocationByZipCityStateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetLocationByZipCityStateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetLocationByZipCityStateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetLocationByZipCityStateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address.go b/pkg/gen/internalapi/internaloperations/addresses/show_address.go new file mode 100644 index 00000000000..2c05e4e079d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/show_address.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowAddressHandlerFunc turns a function with the right signature into a show address handler +type ShowAddressHandlerFunc func(ShowAddressParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowAddressHandlerFunc) Handle(params ShowAddressParams) middleware.Responder { + return fn(params) +} + +// ShowAddressHandler interface for that can handle valid show address params +type ShowAddressHandler interface { + Handle(ShowAddressParams) middleware.Responder +} + +// NewShowAddress creates a new http.Handler for the show address operation +func NewShowAddress(ctx *middleware.Context, handler ShowAddressHandler) *ShowAddress { + return &ShowAddress{Context: ctx, Handler: handler} +} + +/* + ShowAddress swagger:route GET /addresses/{addressId} addresses showAddress + +# Returns an address + +Find by API using address ID that returns an address json object containing address 1, address 2, address 3, city and postal code. +*/ +type ShowAddress struct { + Context *middleware.Context + Handler ShowAddressHandler +} + +func (o *ShowAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowAddressParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go new file mode 100644 index 00000000000..5adf872ef43 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/show_address_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowAddressParams creates a new ShowAddressParams object +// +// There are no default values defined in the spec. +func NewShowAddressParams() ShowAddressParams { + + return ShowAddressParams{} +} + +// ShowAddressParams contains all the bound params for the show address operation +// typically these are obtained from a http.Request +// +// swagger:parameters showAddress +type ShowAddressParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the address to return + Required: true + In: path + */ + AddressID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowAddressParams() beforehand. +func (o *ShowAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rAddressID, rhkAddressID, _ := route.Params.GetOK("addressId") + if err := o.bindAddressID(rAddressID, rhkAddressID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindAddressID binds and validates parameter AddressID from path. +func (o *ShowAddressParams) bindAddressID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("addressId", "path", "strfmt.UUID", raw) + } + o.AddressID = *(value.(*strfmt.UUID)) + + if err := o.validateAddressID(formats); err != nil { + return err + } + + return nil +} + +// validateAddressID carries on validations for parameter AddressID +func (o *ShowAddressParams) validateAddressID(formats strfmt.Registry) error { + + if err := validate.FormatOf("addressId", "path", "uuid", o.AddressID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go new file mode 100644 index 00000000000..7e226b4b17f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/show_address_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowAddressOKCode is the HTTP code returned for type ShowAddressOK +const ShowAddressOKCode int = 200 + +/* +ShowAddressOK the requested address + +swagger:response showAddressOK +*/ +type ShowAddressOK struct { + + /* + In: Body + */ + Payload *internalmessages.Address `json:"body,omitempty"` +} + +// NewShowAddressOK creates ShowAddressOK with default headers values +func NewShowAddressOK() *ShowAddressOK { + + return &ShowAddressOK{} +} + +// WithPayload adds the payload to the show address o k response +func (o *ShowAddressOK) WithPayload(payload *internalmessages.Address) *ShowAddressOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show address o k response +func (o *ShowAddressOK) SetPayload(payload *internalmessages.Address) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAddressOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAddressBadRequestCode is the HTTP code returned for type ShowAddressBadRequest +const ShowAddressBadRequestCode int = 400 + +/* +ShowAddressBadRequest invalid request + +swagger:response showAddressBadRequest +*/ +type ShowAddressBadRequest struct { +} + +// NewShowAddressBadRequest creates ShowAddressBadRequest with default headers values +func NewShowAddressBadRequest() *ShowAddressBadRequest { + + return &ShowAddressBadRequest{} +} + +// WriteResponse to the client +func (o *ShowAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowAddressForbiddenCode is the HTTP code returned for type ShowAddressForbidden +const ShowAddressForbiddenCode int = 403 + +/* +ShowAddressForbidden not authorized + +swagger:response showAddressForbidden +*/ +type ShowAddressForbidden struct { +} + +// NewShowAddressForbidden creates ShowAddressForbidden with default headers values +func NewShowAddressForbidden() *ShowAddressForbidden { + + return &ShowAddressForbidden{} +} + +// WriteResponse to the client +func (o *ShowAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowAddressNotFoundCode is the HTTP code returned for type ShowAddressNotFound +const ShowAddressNotFoundCode int = 404 + +/* +ShowAddressNotFound not found + +swagger:response showAddressNotFound +*/ +type ShowAddressNotFound struct { +} + +// NewShowAddressNotFound creates ShowAddressNotFound with default headers values +func NewShowAddressNotFound() *ShowAddressNotFound { + + return &ShowAddressNotFound{} +} + +// WriteResponse to the client +func (o *ShowAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowAddressInternalServerErrorCode is the HTTP code returned for type ShowAddressInternalServerError +const ShowAddressInternalServerErrorCode int = 500 + +/* +ShowAddressInternalServerError server error + +swagger:response showAddressInternalServerError +*/ +type ShowAddressInternalServerError struct { +} + +// NewShowAddressInternalServerError creates ShowAddressInternalServerError with default headers values +func NewShowAddressInternalServerError() *ShowAddressInternalServerError { + + return &ShowAddressInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go b/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go new file mode 100644 index 00000000000..d9f5d169fb2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/addresses/show_address_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package addresses + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowAddressURL generates an URL for the show address operation +type ShowAddressURL struct { + AddressID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAddressURL) WithBasePath(bp string) *ShowAddressURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAddressURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowAddressURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/addresses/{addressId}" + + addressID := o.AddressID.String() + if addressID != "" { + _path = strings.Replace(_path, "{addressId}", addressID, -1) + } else { + return nil, errors.New("addressId is required on ShowAddressURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowAddressURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowAddressURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowAddressURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowAddressURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowAddressURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowAddressURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate.go new file mode 100644 index 00000000000..430af001127 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/application_parameters/validate.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ValidateHandlerFunc turns a function with the right signature into a validate handler +type ValidateHandlerFunc func(ValidateParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ValidateHandlerFunc) Handle(params ValidateParams) middleware.Responder { + return fn(params) +} + +// ValidateHandler interface for that can handle valid validate params +type ValidateHandler interface { + Handle(ValidateParams) middleware.Responder +} + +// NewValidate creates a new http.Handler for the validate operation +func NewValidate(ctx *middleware.Context, handler ValidateHandler) *Validate { + return &Validate{Context: ctx, Handler: handler} +} + +/* + Validate swagger:route POST /application_parameters application_parameters validate + +# Searches for an application parameter by name and value, returns nil if not found + +Searches for an application parameter by name and value, returns nil if not found +*/ +type Validate struct { + Context *middleware.Context + Handler ValidateHandler +} + +func (o *Validate) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewValidateParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go new file mode 100644 index 00000000000..e57d49cc800 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/application_parameters/validate_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewValidateParams creates a new ValidateParams object +// +// There are no default values defined in the spec. +func NewValidateParams() ValidateParams { + + return ValidateParams{} +} + +// ValidateParams contains all the bound params for the validate operation +// typically these are obtained from a http.Request +// +// swagger:parameters validate +type ValidateParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *internalmessages.ApplicationParameters +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewValidateParams() beforehand. +func (o *ValidateParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.ApplicationParameters + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go new file mode 100644 index 00000000000..c88c81f1a30 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/application_parameters/validate_responses.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ValidateOKCode is the HTTP code returned for type ValidateOK +const ValidateOKCode int = 200 + +/* +ValidateOK Application Parameters + +swagger:response validateOK +*/ +type ValidateOK struct { + + /* + In: Body + */ + Payload *internalmessages.ApplicationParameters `json:"body,omitempty"` +} + +// NewValidateOK creates ValidateOK with default headers values +func NewValidateOK() *ValidateOK { + + return &ValidateOK{} +} + +// WithPayload adds the payload to the validate o k response +func (o *ValidateOK) WithPayload(payload *internalmessages.ApplicationParameters) *ValidateOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the validate o k response +func (o *ValidateOK) SetPayload(payload *internalmessages.ApplicationParameters) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ValidateOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ValidateBadRequestCode is the HTTP code returned for type ValidateBadRequest +const ValidateBadRequestCode int = 400 + +/* +ValidateBadRequest invalid request + +swagger:response validateBadRequest +*/ +type ValidateBadRequest struct { +} + +// NewValidateBadRequest creates ValidateBadRequest with default headers values +func NewValidateBadRequest() *ValidateBadRequest { + + return &ValidateBadRequest{} +} + +// WriteResponse to the client +func (o *ValidateBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ValidateUnauthorizedCode is the HTTP code returned for type ValidateUnauthorized +const ValidateUnauthorizedCode int = 401 + +/* +ValidateUnauthorized request requires user authentication + +swagger:response validateUnauthorized +*/ +type ValidateUnauthorized struct { +} + +// NewValidateUnauthorized creates ValidateUnauthorized with default headers values +func NewValidateUnauthorized() *ValidateUnauthorized { + + return &ValidateUnauthorized{} +} + +// WriteResponse to the client +func (o *ValidateUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ValidateInternalServerErrorCode is the HTTP code returned for type ValidateInternalServerError +const ValidateInternalServerErrorCode int = 500 + +/* +ValidateInternalServerError server error + +swagger:response validateInternalServerError +*/ +type ValidateInternalServerError struct { +} + +// NewValidateInternalServerError creates ValidateInternalServerError with default headers values +func NewValidateInternalServerError() *ValidateInternalServerError { + + return &ValidateInternalServerError{} +} + +// WriteResponse to the client +func (o *ValidateInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go b/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go new file mode 100644 index 00000000000..a55b1d441b8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/application_parameters/validate_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package application_parameters + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ValidateURL generates an URL for the validate operation +type ValidateURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ValidateURL) WithBasePath(bp string) *ValidateURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ValidateURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ValidateURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/application_parameters" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ValidateURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ValidateURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ValidateURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ValidateURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ValidateURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ValidateURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go new file mode 100644 index 00000000000..dc003747f1a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateServiceMemberBackupContactHandlerFunc turns a function with the right signature into a create service member backup contact handler +type CreateServiceMemberBackupContactHandlerFunc func(CreateServiceMemberBackupContactParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateServiceMemberBackupContactHandlerFunc) Handle(params CreateServiceMemberBackupContactParams) middleware.Responder { + return fn(params) +} + +// CreateServiceMemberBackupContactHandler interface for that can handle valid create service member backup contact params +type CreateServiceMemberBackupContactHandler interface { + Handle(CreateServiceMemberBackupContactParams) middleware.Responder +} + +// NewCreateServiceMemberBackupContact creates a new http.Handler for the create service member backup contact operation +func NewCreateServiceMemberBackupContact(ctx *middleware.Context, handler CreateServiceMemberBackupContactHandler) *CreateServiceMemberBackupContact { + return &CreateServiceMemberBackupContact{Context: ctx, Handler: handler} +} + +/* + CreateServiceMemberBackupContact swagger:route POST /service_members/{serviceMemberId}/backup_contacts backup_contacts createServiceMemberBackupContact + +# Submits backup contact for a logged-in user + +Creates an instance of a backup contact tied to a service member user +*/ +type CreateServiceMemberBackupContact struct { + Context *middleware.Context + Handler CreateServiceMemberBackupContactHandler +} + +func (o *CreateServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateServiceMemberBackupContactParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go new file mode 100644 index 00000000000..b41e7a8764e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateServiceMemberBackupContactParams creates a new CreateServiceMemberBackupContactParams object +// +// There are no default values defined in the spec. +func NewCreateServiceMemberBackupContactParams() CreateServiceMemberBackupContactParams { + + return CreateServiceMemberBackupContactParams{} +} + +// CreateServiceMemberBackupContactParams contains all the bound params for the create service member backup contact operation +// typically these are obtained from a http.Request +// +// swagger:parameters createServiceMemberBackupContact +type CreateServiceMemberBackupContactParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateBackupContactPayload *internalmessages.CreateServiceMemberBackupContactPayload + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateServiceMemberBackupContactParams() beforehand. +func (o *CreateServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateServiceMemberBackupContactPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createBackupContactPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("createBackupContactPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateBackupContactPayload = &body + } + } + } else { + res = append(res, errors.Required("createBackupContactPayload", "body", "")) + } + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *CreateServiceMemberBackupContactParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *CreateServiceMemberBackupContactParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go new file mode 100644 index 00000000000..c21e915af12 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateServiceMemberBackupContactCreatedCode is the HTTP code returned for type CreateServiceMemberBackupContactCreated +const CreateServiceMemberBackupContactCreatedCode int = 201 + +/* +CreateServiceMemberBackupContactCreated created instance of service member backup contact + +swagger:response createServiceMemberBackupContactCreated +*/ +type CreateServiceMemberBackupContactCreated struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` +} + +// NewCreateServiceMemberBackupContactCreated creates CreateServiceMemberBackupContactCreated with default headers values +func NewCreateServiceMemberBackupContactCreated() *CreateServiceMemberBackupContactCreated { + + return &CreateServiceMemberBackupContactCreated{} +} + +// WithPayload adds the payload to the create service member backup contact created response +func (o *CreateServiceMemberBackupContactCreated) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *CreateServiceMemberBackupContactCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service member backup contact created response +func (o *CreateServiceMemberBackupContactCreated) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceMemberBackupContactBadRequestCode is the HTTP code returned for type CreateServiceMemberBackupContactBadRequest +const CreateServiceMemberBackupContactBadRequestCode int = 400 + +/* +CreateServiceMemberBackupContactBadRequest invalid request + +swagger:response createServiceMemberBackupContactBadRequest +*/ +type CreateServiceMemberBackupContactBadRequest struct { +} + +// NewCreateServiceMemberBackupContactBadRequest creates CreateServiceMemberBackupContactBadRequest with default headers values +func NewCreateServiceMemberBackupContactBadRequest() *CreateServiceMemberBackupContactBadRequest { + + return &CreateServiceMemberBackupContactBadRequest{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type CreateServiceMemberBackupContactUnauthorized +const CreateServiceMemberBackupContactUnauthorizedCode int = 401 + +/* +CreateServiceMemberBackupContactUnauthorized request requires user authentication + +swagger:response createServiceMemberBackupContactUnauthorized +*/ +type CreateServiceMemberBackupContactUnauthorized struct { +} + +// NewCreateServiceMemberBackupContactUnauthorized creates CreateServiceMemberBackupContactUnauthorized with default headers values +func NewCreateServiceMemberBackupContactUnauthorized() *CreateServiceMemberBackupContactUnauthorized { + + return &CreateServiceMemberBackupContactUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateServiceMemberBackupContactForbiddenCode is the HTTP code returned for type CreateServiceMemberBackupContactForbidden +const CreateServiceMemberBackupContactForbiddenCode int = 403 + +/* +CreateServiceMemberBackupContactForbidden user is not authorized to create this backup contact + +swagger:response createServiceMemberBackupContactForbidden +*/ +type CreateServiceMemberBackupContactForbidden struct { +} + +// NewCreateServiceMemberBackupContactForbidden creates CreateServiceMemberBackupContactForbidden with default headers values +func NewCreateServiceMemberBackupContactForbidden() *CreateServiceMemberBackupContactForbidden { + + return &CreateServiceMemberBackupContactForbidden{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateServiceMemberBackupContactNotFoundCode is the HTTP code returned for type CreateServiceMemberBackupContactNotFound +const CreateServiceMemberBackupContactNotFoundCode int = 404 + +/* +CreateServiceMemberBackupContactNotFound contact not found + +swagger:response createServiceMemberBackupContactNotFound +*/ +type CreateServiceMemberBackupContactNotFound struct { +} + +// NewCreateServiceMemberBackupContactNotFound creates CreateServiceMemberBackupContactNotFound with default headers values +func NewCreateServiceMemberBackupContactNotFound() *CreateServiceMemberBackupContactNotFound { + + return &CreateServiceMemberBackupContactNotFound{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// CreateServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type CreateServiceMemberBackupContactInternalServerError +const CreateServiceMemberBackupContactInternalServerErrorCode int = 500 + +/* +CreateServiceMemberBackupContactInternalServerError internal server error + +swagger:response createServiceMemberBackupContactInternalServerError +*/ +type CreateServiceMemberBackupContactInternalServerError struct { +} + +// NewCreateServiceMemberBackupContactInternalServerError creates CreateServiceMemberBackupContactInternalServerError with default headers values +func NewCreateServiceMemberBackupContactInternalServerError() *CreateServiceMemberBackupContactInternalServerError { + + return &CreateServiceMemberBackupContactInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go new file mode 100644 index 00000000000..088ce4e4f6c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/create_service_member_backup_contact_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateServiceMemberBackupContactURL generates an URL for the create service member backup contact operation +type CreateServiceMemberBackupContactURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceMemberBackupContactURL) WithBasePath(bp string) *CreateServiceMemberBackupContactURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceMemberBackupContactURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateServiceMemberBackupContactURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members/{serviceMemberId}/backup_contacts" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on CreateServiceMemberBackupContactURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateServiceMemberBackupContactURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateServiceMemberBackupContactURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateServiceMemberBackupContactURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateServiceMemberBackupContactURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go new file mode 100644 index 00000000000..281b230637c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexServiceMemberBackupContactsHandlerFunc turns a function with the right signature into a index service member backup contacts handler +type IndexServiceMemberBackupContactsHandlerFunc func(IndexServiceMemberBackupContactsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexServiceMemberBackupContactsHandlerFunc) Handle(params IndexServiceMemberBackupContactsParams) middleware.Responder { + return fn(params) +} + +// IndexServiceMemberBackupContactsHandler interface for that can handle valid index service member backup contacts params +type IndexServiceMemberBackupContactsHandler interface { + Handle(IndexServiceMemberBackupContactsParams) middleware.Responder +} + +// NewIndexServiceMemberBackupContacts creates a new http.Handler for the index service member backup contacts operation +func NewIndexServiceMemberBackupContacts(ctx *middleware.Context, handler IndexServiceMemberBackupContactsHandler) *IndexServiceMemberBackupContacts { + return &IndexServiceMemberBackupContacts{Context: ctx, Handler: handler} +} + +/* + IndexServiceMemberBackupContacts swagger:route GET /service_members/{serviceMemberId}/backup_contacts backup_contacts indexServiceMemberBackupContacts + +# List all service member backup contacts + +List all service member backup contacts +*/ +type IndexServiceMemberBackupContacts struct { + Context *middleware.Context + Handler IndexServiceMemberBackupContactsHandler +} + +func (o *IndexServiceMemberBackupContacts) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexServiceMemberBackupContactsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go new file mode 100644 index 00000000000..b3ff83c7055 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewIndexServiceMemberBackupContactsParams creates a new IndexServiceMemberBackupContactsParams object +// +// There are no default values defined in the spec. +func NewIndexServiceMemberBackupContactsParams() IndexServiceMemberBackupContactsParams { + + return IndexServiceMemberBackupContactsParams{} +} + +// IndexServiceMemberBackupContactsParams contains all the bound params for the index service member backup contacts operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexServiceMemberBackupContacts +type IndexServiceMemberBackupContactsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexServiceMemberBackupContactsParams() beforehand. +func (o *IndexServiceMemberBackupContactsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *IndexServiceMemberBackupContactsParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *IndexServiceMemberBackupContactsParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go new file mode 100644 index 00000000000..5d1a51be1dc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// IndexServiceMemberBackupContactsOKCode is the HTTP code returned for type IndexServiceMemberBackupContactsOK +const IndexServiceMemberBackupContactsOKCode int = 200 + +/* +IndexServiceMemberBackupContactsOK list of service member backup contacts + +swagger:response indexServiceMemberBackupContactsOK +*/ +type IndexServiceMemberBackupContactsOK struct { + + /* + In: Body + */ + Payload internalmessages.IndexServiceMemberBackupContactsPayload `json:"body,omitempty"` +} + +// NewIndexServiceMemberBackupContactsOK creates IndexServiceMemberBackupContactsOK with default headers values +func NewIndexServiceMemberBackupContactsOK() *IndexServiceMemberBackupContactsOK { + + return &IndexServiceMemberBackupContactsOK{} +} + +// WithPayload adds the payload to the index service member backup contacts o k response +func (o *IndexServiceMemberBackupContactsOK) WithPayload(payload internalmessages.IndexServiceMemberBackupContactsPayload) *IndexServiceMemberBackupContactsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index service member backup contacts o k response +func (o *IndexServiceMemberBackupContactsOK) SetPayload(payload internalmessages.IndexServiceMemberBackupContactsPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.IndexServiceMemberBackupContactsPayload{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexServiceMemberBackupContactsBadRequestCode is the HTTP code returned for type IndexServiceMemberBackupContactsBadRequest +const IndexServiceMemberBackupContactsBadRequestCode int = 400 + +/* +IndexServiceMemberBackupContactsBadRequest invalid request + +swagger:response indexServiceMemberBackupContactsBadRequest +*/ +type IndexServiceMemberBackupContactsBadRequest struct { +} + +// NewIndexServiceMemberBackupContactsBadRequest creates IndexServiceMemberBackupContactsBadRequest with default headers values +func NewIndexServiceMemberBackupContactsBadRequest() *IndexServiceMemberBackupContactsBadRequest { + + return &IndexServiceMemberBackupContactsBadRequest{} +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexServiceMemberBackupContactsUnauthorizedCode is the HTTP code returned for type IndexServiceMemberBackupContactsUnauthorized +const IndexServiceMemberBackupContactsUnauthorizedCode int = 401 + +/* +IndexServiceMemberBackupContactsUnauthorized request requires user authentication + +swagger:response indexServiceMemberBackupContactsUnauthorized +*/ +type IndexServiceMemberBackupContactsUnauthorized struct { +} + +// NewIndexServiceMemberBackupContactsUnauthorized creates IndexServiceMemberBackupContactsUnauthorized with default headers values +func NewIndexServiceMemberBackupContactsUnauthorized() *IndexServiceMemberBackupContactsUnauthorized { + + return &IndexServiceMemberBackupContactsUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexServiceMemberBackupContactsForbiddenCode is the HTTP code returned for type IndexServiceMemberBackupContactsForbidden +const IndexServiceMemberBackupContactsForbiddenCode int = 403 + +/* +IndexServiceMemberBackupContactsForbidden user is not authorized to see this backup contact + +swagger:response indexServiceMemberBackupContactsForbidden +*/ +type IndexServiceMemberBackupContactsForbidden struct { +} + +// NewIndexServiceMemberBackupContactsForbidden creates IndexServiceMemberBackupContactsForbidden with default headers values +func NewIndexServiceMemberBackupContactsForbidden() *IndexServiceMemberBackupContactsForbidden { + + return &IndexServiceMemberBackupContactsForbidden{} +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// IndexServiceMemberBackupContactsNotFoundCode is the HTTP code returned for type IndexServiceMemberBackupContactsNotFound +const IndexServiceMemberBackupContactsNotFoundCode int = 404 + +/* +IndexServiceMemberBackupContactsNotFound contact not found + +swagger:response indexServiceMemberBackupContactsNotFound +*/ +type IndexServiceMemberBackupContactsNotFound struct { +} + +// NewIndexServiceMemberBackupContactsNotFound creates IndexServiceMemberBackupContactsNotFound with default headers values +func NewIndexServiceMemberBackupContactsNotFound() *IndexServiceMemberBackupContactsNotFound { + + return &IndexServiceMemberBackupContactsNotFound{} +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexServiceMemberBackupContactsInternalServerErrorCode is the HTTP code returned for type IndexServiceMemberBackupContactsInternalServerError +const IndexServiceMemberBackupContactsInternalServerErrorCode int = 500 + +/* +IndexServiceMemberBackupContactsInternalServerError internal server error + +swagger:response indexServiceMemberBackupContactsInternalServerError +*/ +type IndexServiceMemberBackupContactsInternalServerError struct { +} + +// NewIndexServiceMemberBackupContactsInternalServerError creates IndexServiceMemberBackupContactsInternalServerError with default headers values +func NewIndexServiceMemberBackupContactsInternalServerError() *IndexServiceMemberBackupContactsInternalServerError { + + return &IndexServiceMemberBackupContactsInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexServiceMemberBackupContactsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go new file mode 100644 index 00000000000..ea6f9b96332 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/index_service_member_backup_contacts_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// IndexServiceMemberBackupContactsURL generates an URL for the index service member backup contacts operation +type IndexServiceMemberBackupContactsURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexServiceMemberBackupContactsURL) WithBasePath(bp string) *IndexServiceMemberBackupContactsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexServiceMemberBackupContactsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexServiceMemberBackupContactsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members/{serviceMemberId}/backup_contacts" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on IndexServiceMemberBackupContactsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexServiceMemberBackupContactsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexServiceMemberBackupContactsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexServiceMemberBackupContactsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexServiceMemberBackupContactsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexServiceMemberBackupContactsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexServiceMemberBackupContactsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go new file mode 100644 index 00000000000..e0d1fd877c8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowServiceMemberBackupContactHandlerFunc turns a function with the right signature into a show service member backup contact handler +type ShowServiceMemberBackupContactHandlerFunc func(ShowServiceMemberBackupContactParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowServiceMemberBackupContactHandlerFunc) Handle(params ShowServiceMemberBackupContactParams) middleware.Responder { + return fn(params) +} + +// ShowServiceMemberBackupContactHandler interface for that can handle valid show service member backup contact params +type ShowServiceMemberBackupContactHandler interface { + Handle(ShowServiceMemberBackupContactParams) middleware.Responder +} + +// NewShowServiceMemberBackupContact creates a new http.Handler for the show service member backup contact operation +func NewShowServiceMemberBackupContact(ctx *middleware.Context, handler ShowServiceMemberBackupContactHandler) *ShowServiceMemberBackupContact { + return &ShowServiceMemberBackupContact{Context: ctx, Handler: handler} +} + +/* + ShowServiceMemberBackupContact swagger:route GET /backup_contacts/{backupContactId} backup_contacts showServiceMemberBackupContact + +# Returns the given service member backup contact + +Returns the given service member backup contact +*/ +type ShowServiceMemberBackupContact struct { + Context *middleware.Context + Handler ShowServiceMemberBackupContactHandler +} + +func (o *ShowServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowServiceMemberBackupContactParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go new file mode 100644 index 00000000000..fbfd32adbb2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowServiceMemberBackupContactParams creates a new ShowServiceMemberBackupContactParams object +// +// There are no default values defined in the spec. +func NewShowServiceMemberBackupContactParams() ShowServiceMemberBackupContactParams { + + return ShowServiceMemberBackupContactParams{} +} + +// ShowServiceMemberBackupContactParams contains all the bound params for the show service member backup contact operation +// typically these are obtained from a http.Request +// +// swagger:parameters showServiceMemberBackupContact +type ShowServiceMemberBackupContactParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member backup contact + Required: true + In: path + */ + BackupContactID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowServiceMemberBackupContactParams() beforehand. +func (o *ShowServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rBackupContactID, rhkBackupContactID, _ := route.Params.GetOK("backupContactId") + if err := o.bindBackupContactID(rBackupContactID, rhkBackupContactID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindBackupContactID binds and validates parameter BackupContactID from path. +func (o *ShowServiceMemberBackupContactParams) bindBackupContactID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("backupContactId", "path", "strfmt.UUID", raw) + } + o.BackupContactID = *(value.(*strfmt.UUID)) + + if err := o.validateBackupContactID(formats); err != nil { + return err + } + + return nil +} + +// validateBackupContactID carries on validations for parameter BackupContactID +func (o *ShowServiceMemberBackupContactParams) validateBackupContactID(formats strfmt.Registry) error { + + if err := validate.FormatOf("backupContactId", "path", "uuid", o.BackupContactID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go new file mode 100644 index 00000000000..5ea47e13ef8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowServiceMemberBackupContactOKCode is the HTTP code returned for type ShowServiceMemberBackupContactOK +const ShowServiceMemberBackupContactOKCode int = 200 + +/* +ShowServiceMemberBackupContactOK the instance of the service member backup contact + +swagger:response showServiceMemberBackupContactOK +*/ +type ShowServiceMemberBackupContactOK struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` +} + +// NewShowServiceMemberBackupContactOK creates ShowServiceMemberBackupContactOK with default headers values +func NewShowServiceMemberBackupContactOK() *ShowServiceMemberBackupContactOK { + + return &ShowServiceMemberBackupContactOK{} +} + +// WithPayload adds the payload to the show service member backup contact o k response +func (o *ShowServiceMemberBackupContactOK) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *ShowServiceMemberBackupContactOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show service member backup contact o k response +func (o *ShowServiceMemberBackupContactOK) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowServiceMemberBackupContactBadRequestCode is the HTTP code returned for type ShowServiceMemberBackupContactBadRequest +const ShowServiceMemberBackupContactBadRequestCode int = 400 + +/* +ShowServiceMemberBackupContactBadRequest invalid request + +swagger:response showServiceMemberBackupContactBadRequest +*/ +type ShowServiceMemberBackupContactBadRequest struct { +} + +// NewShowServiceMemberBackupContactBadRequest creates ShowServiceMemberBackupContactBadRequest with default headers values +func NewShowServiceMemberBackupContactBadRequest() *ShowServiceMemberBackupContactBadRequest { + + return &ShowServiceMemberBackupContactBadRequest{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type ShowServiceMemberBackupContactUnauthorized +const ShowServiceMemberBackupContactUnauthorizedCode int = 401 + +/* +ShowServiceMemberBackupContactUnauthorized request requires user authentication + +swagger:response showServiceMemberBackupContactUnauthorized +*/ +type ShowServiceMemberBackupContactUnauthorized struct { +} + +// NewShowServiceMemberBackupContactUnauthorized creates ShowServiceMemberBackupContactUnauthorized with default headers values +func NewShowServiceMemberBackupContactUnauthorized() *ShowServiceMemberBackupContactUnauthorized { + + return &ShowServiceMemberBackupContactUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowServiceMemberBackupContactForbiddenCode is the HTTP code returned for type ShowServiceMemberBackupContactForbidden +const ShowServiceMemberBackupContactForbiddenCode int = 403 + +/* +ShowServiceMemberBackupContactForbidden user is not authorized + +swagger:response showServiceMemberBackupContactForbidden +*/ +type ShowServiceMemberBackupContactForbidden struct { +} + +// NewShowServiceMemberBackupContactForbidden creates ShowServiceMemberBackupContactForbidden with default headers values +func NewShowServiceMemberBackupContactForbidden() *ShowServiceMemberBackupContactForbidden { + + return &ShowServiceMemberBackupContactForbidden{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowServiceMemberBackupContactNotFoundCode is the HTTP code returned for type ShowServiceMemberBackupContactNotFound +const ShowServiceMemberBackupContactNotFoundCode int = 404 + +/* +ShowServiceMemberBackupContactNotFound backup contact not found + +swagger:response showServiceMemberBackupContactNotFound +*/ +type ShowServiceMemberBackupContactNotFound struct { +} + +// NewShowServiceMemberBackupContactNotFound creates ShowServiceMemberBackupContactNotFound with default headers values +func NewShowServiceMemberBackupContactNotFound() *ShowServiceMemberBackupContactNotFound { + + return &ShowServiceMemberBackupContactNotFound{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberBackupContactInternalServerError +const ShowServiceMemberBackupContactInternalServerErrorCode int = 500 + +/* +ShowServiceMemberBackupContactInternalServerError internal server error + +swagger:response showServiceMemberBackupContactInternalServerError +*/ +type ShowServiceMemberBackupContactInternalServerError struct { +} + +// NewShowServiceMemberBackupContactInternalServerError creates ShowServiceMemberBackupContactInternalServerError with default headers values +func NewShowServiceMemberBackupContactInternalServerError() *ShowServiceMemberBackupContactInternalServerError { + + return &ShowServiceMemberBackupContactInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go new file mode 100644 index 00000000000..4efa9c1cf62 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/show_service_member_backup_contact_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowServiceMemberBackupContactURL generates an URL for the show service member backup contact operation +type ShowServiceMemberBackupContactURL struct { + BackupContactID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberBackupContactURL) WithBasePath(bp string) *ShowServiceMemberBackupContactURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberBackupContactURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowServiceMemberBackupContactURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/backup_contacts/{backupContactId}" + + backupContactID := o.BackupContactID.String() + if backupContactID != "" { + _path = strings.Replace(_path, "{backupContactId}", backupContactID, -1) + } else { + return nil, errors.New("backupContactId is required on ShowServiceMemberBackupContactURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowServiceMemberBackupContactURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowServiceMemberBackupContactURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowServiceMemberBackupContactURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowServiceMemberBackupContactURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go new file mode 100644 index 00000000000..faea2478d65 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateServiceMemberBackupContactHandlerFunc turns a function with the right signature into a update service member backup contact handler +type UpdateServiceMemberBackupContactHandlerFunc func(UpdateServiceMemberBackupContactParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateServiceMemberBackupContactHandlerFunc) Handle(params UpdateServiceMemberBackupContactParams) middleware.Responder { + return fn(params) +} + +// UpdateServiceMemberBackupContactHandler interface for that can handle valid update service member backup contact params +type UpdateServiceMemberBackupContactHandler interface { + Handle(UpdateServiceMemberBackupContactParams) middleware.Responder +} + +// NewUpdateServiceMemberBackupContact creates a new http.Handler for the update service member backup contact operation +func NewUpdateServiceMemberBackupContact(ctx *middleware.Context, handler UpdateServiceMemberBackupContactHandler) *UpdateServiceMemberBackupContact { + return &UpdateServiceMemberBackupContact{Context: ctx, Handler: handler} +} + +/* + UpdateServiceMemberBackupContact swagger:route PUT /backup_contacts/{backupContactId} backup_contacts updateServiceMemberBackupContact + +# Updates a service member backup contact + +Any fields sent in this request will be set on the backup contact referenced +*/ +type UpdateServiceMemberBackupContact struct { + Context *middleware.Context + Handler UpdateServiceMemberBackupContactHandler +} + +func (o *UpdateServiceMemberBackupContact) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateServiceMemberBackupContactParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go new file mode 100644 index 00000000000..b6ec9e515b1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateServiceMemberBackupContactParams creates a new UpdateServiceMemberBackupContactParams object +// +// There are no default values defined in the spec. +func NewUpdateServiceMemberBackupContactParams() UpdateServiceMemberBackupContactParams { + + return UpdateServiceMemberBackupContactParams{} +} + +// UpdateServiceMemberBackupContactParams contains all the bound params for the update service member backup contact operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateServiceMemberBackupContact +type UpdateServiceMemberBackupContactParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member backup contact + Required: true + In: path + */ + BackupContactID strfmt.UUID + /* + Required: true + In: body + */ + UpdateServiceMemberBackupContactPayload *internalmessages.UpdateServiceMemberBackupContactPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateServiceMemberBackupContactParams() beforehand. +func (o *UpdateServiceMemberBackupContactParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rBackupContactID, rhkBackupContactID, _ := route.Params.GetOK("backupContactId") + if err := o.bindBackupContactID(rBackupContactID, rhkBackupContactID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateServiceMemberBackupContactPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateServiceMemberBackupContactPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("updateServiceMemberBackupContactPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateServiceMemberBackupContactPayload = &body + } + } + } else { + res = append(res, errors.Required("updateServiceMemberBackupContactPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindBackupContactID binds and validates parameter BackupContactID from path. +func (o *UpdateServiceMemberBackupContactParams) bindBackupContactID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("backupContactId", "path", "strfmt.UUID", raw) + } + o.BackupContactID = *(value.(*strfmt.UUID)) + + if err := o.validateBackupContactID(formats); err != nil { + return err + } + + return nil +} + +// validateBackupContactID carries on validations for parameter BackupContactID +func (o *UpdateServiceMemberBackupContactParams) validateBackupContactID(formats strfmt.Registry) error { + + if err := validate.FormatOf("backupContactId", "path", "uuid", o.BackupContactID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go new file mode 100644 index 00000000000..f52a1eb8f88 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateServiceMemberBackupContactCreatedCode is the HTTP code returned for type UpdateServiceMemberBackupContactCreated +const UpdateServiceMemberBackupContactCreatedCode int = 201 + +/* +UpdateServiceMemberBackupContactCreated updated instance of backup contact + +swagger:response updateServiceMemberBackupContactCreated +*/ +type UpdateServiceMemberBackupContactCreated struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberBackupContactPayload `json:"body,omitempty"` +} + +// NewUpdateServiceMemberBackupContactCreated creates UpdateServiceMemberBackupContactCreated with default headers values +func NewUpdateServiceMemberBackupContactCreated() *UpdateServiceMemberBackupContactCreated { + + return &UpdateServiceMemberBackupContactCreated{} +} + +// WithPayload adds the payload to the update service member backup contact created response +func (o *UpdateServiceMemberBackupContactCreated) WithPayload(payload *internalmessages.ServiceMemberBackupContactPayload) *UpdateServiceMemberBackupContactCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update service member backup contact created response +func (o *UpdateServiceMemberBackupContactCreated) SetPayload(payload *internalmessages.ServiceMemberBackupContactPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateServiceMemberBackupContactBadRequestCode is the HTTP code returned for type UpdateServiceMemberBackupContactBadRequest +const UpdateServiceMemberBackupContactBadRequestCode int = 400 + +/* +UpdateServiceMemberBackupContactBadRequest invalid request + +swagger:response updateServiceMemberBackupContactBadRequest +*/ +type UpdateServiceMemberBackupContactBadRequest struct { +} + +// NewUpdateServiceMemberBackupContactBadRequest creates UpdateServiceMemberBackupContactBadRequest with default headers values +func NewUpdateServiceMemberBackupContactBadRequest() *UpdateServiceMemberBackupContactBadRequest { + + return &UpdateServiceMemberBackupContactBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateServiceMemberBackupContactUnauthorizedCode is the HTTP code returned for type UpdateServiceMemberBackupContactUnauthorized +const UpdateServiceMemberBackupContactUnauthorizedCode int = 401 + +/* +UpdateServiceMemberBackupContactUnauthorized request requires user authentication + +swagger:response updateServiceMemberBackupContactUnauthorized +*/ +type UpdateServiceMemberBackupContactUnauthorized struct { +} + +// NewUpdateServiceMemberBackupContactUnauthorized creates UpdateServiceMemberBackupContactUnauthorized with default headers values +func NewUpdateServiceMemberBackupContactUnauthorized() *UpdateServiceMemberBackupContactUnauthorized { + + return &UpdateServiceMemberBackupContactUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateServiceMemberBackupContactForbiddenCode is the HTTP code returned for type UpdateServiceMemberBackupContactForbidden +const UpdateServiceMemberBackupContactForbiddenCode int = 403 + +/* +UpdateServiceMemberBackupContactForbidden user is not authorized + +swagger:response updateServiceMemberBackupContactForbidden +*/ +type UpdateServiceMemberBackupContactForbidden struct { +} + +// NewUpdateServiceMemberBackupContactForbidden creates UpdateServiceMemberBackupContactForbidden with default headers values +func NewUpdateServiceMemberBackupContactForbidden() *UpdateServiceMemberBackupContactForbidden { + + return &UpdateServiceMemberBackupContactForbidden{} +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateServiceMemberBackupContactNotFoundCode is the HTTP code returned for type UpdateServiceMemberBackupContactNotFound +const UpdateServiceMemberBackupContactNotFoundCode int = 404 + +/* +UpdateServiceMemberBackupContactNotFound backup contact not found + +swagger:response updateServiceMemberBackupContactNotFound +*/ +type UpdateServiceMemberBackupContactNotFound struct { +} + +// NewUpdateServiceMemberBackupContactNotFound creates UpdateServiceMemberBackupContactNotFound with default headers values +func NewUpdateServiceMemberBackupContactNotFound() *UpdateServiceMemberBackupContactNotFound { + + return &UpdateServiceMemberBackupContactNotFound{} +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateServiceMemberBackupContactInternalServerErrorCode is the HTTP code returned for type UpdateServiceMemberBackupContactInternalServerError +const UpdateServiceMemberBackupContactInternalServerErrorCode int = 500 + +/* +UpdateServiceMemberBackupContactInternalServerError internal server error + +swagger:response updateServiceMemberBackupContactInternalServerError +*/ +type UpdateServiceMemberBackupContactInternalServerError struct { +} + +// NewUpdateServiceMemberBackupContactInternalServerError creates UpdateServiceMemberBackupContactInternalServerError with default headers values +func NewUpdateServiceMemberBackupContactInternalServerError() *UpdateServiceMemberBackupContactInternalServerError { + + return &UpdateServiceMemberBackupContactInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateServiceMemberBackupContactInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go new file mode 100644 index 00000000000..c2ee00351ac --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/backup_contacts/update_service_member_backup_contact_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package backup_contacts + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateServiceMemberBackupContactURL generates an URL for the update service member backup contact operation +type UpdateServiceMemberBackupContactURL struct { + BackupContactID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateServiceMemberBackupContactURL) WithBasePath(bp string) *UpdateServiceMemberBackupContactURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateServiceMemberBackupContactURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateServiceMemberBackupContactURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/backup_contacts/{backupContactId}" + + backupContactID := o.BackupContactID.String() + if backupContactID != "" { + _path = strings.Replace(_path, "{backupContactId}", backupContactID, -1) + } else { + return nil, errors.New("backupContactId is required on UpdateServiceMemberBackupContactURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateServiceMemberBackupContactURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateServiceMemberBackupContactURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateServiceMemberBackupContactURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateServiceMemberBackupContactURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateServiceMemberBackupContactURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateServiceMemberBackupContactURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go new file mode 100644 index 00000000000..2391d9fec61 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IsDateWeekendHolidayHandlerFunc turns a function with the right signature into a is date weekend holiday handler +type IsDateWeekendHolidayHandlerFunc func(IsDateWeekendHolidayParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IsDateWeekendHolidayHandlerFunc) Handle(params IsDateWeekendHolidayParams) middleware.Responder { + return fn(params) +} + +// IsDateWeekendHolidayHandler interface for that can handle valid is date weekend holiday params +type IsDateWeekendHolidayHandler interface { + Handle(IsDateWeekendHolidayParams) middleware.Responder +} + +// NewIsDateWeekendHoliday creates a new http.Handler for the is date weekend holiday operation +func NewIsDateWeekendHoliday(ctx *middleware.Context, handler IsDateWeekendHolidayHandler) *IsDateWeekendHoliday { + return &IsDateWeekendHoliday{Context: ctx, Handler: handler} +} + +/* + IsDateWeekendHoliday swagger:route GET /calendar/{countryCode}/is-weekend-holiday/{date} calendar isDateWeekendHoliday + +# Validate move date selection + +Utility API to determine if input date falls on weekend and/or holiday. +*/ +type IsDateWeekendHoliday struct { + Context *middleware.Context + Handler IsDateWeekendHolidayHandler +} + +func (o *IsDateWeekendHoliday) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIsDateWeekendHolidayParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go new file mode 100644 index 00000000000..bb43341894d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_parameters.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewIsDateWeekendHolidayParams creates a new IsDateWeekendHolidayParams object +// +// There are no default values defined in the spec. +func NewIsDateWeekendHolidayParams() IsDateWeekendHolidayParams { + + return IsDateWeekendHolidayParams{} +} + +// IsDateWeekendHolidayParams contains all the bound params for the is date weekend holiday operation +// typically these are obtained from a http.Request +// +// swagger:parameters isDateWeekendHoliday +type IsDateWeekendHolidayParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*country code for context of date + Required: true + In: path + */ + CountryCode string + /*input date to determine if weekend/holiday for given country. + Required: true + In: path + */ + Date strfmt.Date +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIsDateWeekendHolidayParams() beforehand. +func (o *IsDateWeekendHolidayParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rCountryCode, rhkCountryCode, _ := route.Params.GetOK("countryCode") + if err := o.bindCountryCode(rCountryCode, rhkCountryCode, route.Formats); err != nil { + res = append(res, err) + } + + rDate, rhkDate, _ := route.Params.GetOK("date") + if err := o.bindDate(rDate, rhkDate, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindCountryCode binds and validates parameter CountryCode from path. +func (o *IsDateWeekendHolidayParams) bindCountryCode(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.CountryCode = raw + + if err := o.validateCountryCode(formats); err != nil { + return err + } + + return nil +} + +// validateCountryCode carries on validations for parameter CountryCode +func (o *IsDateWeekendHolidayParams) validateCountryCode(formats strfmt.Registry) error { + + if err := validate.EnumCase("countryCode", "path", o.CountryCode, []interface{}{"US"}, true); err != nil { + return err + } + + return nil +} + +// bindDate binds and validates parameter Date from path. +func (o *IsDateWeekendHolidayParams) bindDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: date + value, err := formats.Parse("date", raw) + if err != nil { + return errors.InvalidType("date", "path", "strfmt.Date", raw) + } + o.Date = *(value.(*strfmt.Date)) + + if err := o.validateDate(formats); err != nil { + return err + } + + return nil +} + +// validateDate carries on validations for parameter Date +func (o *IsDateWeekendHolidayParams) validateDate(formats strfmt.Registry) error { + + if err := validate.FormatOf("date", "path", "date", o.Date.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go new file mode 100644 index 00000000000..61070103010 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// IsDateWeekendHolidayOKCode is the HTTP code returned for type IsDateWeekendHolidayOK +const IsDateWeekendHolidayOKCode int = 200 + +/* +IsDateWeekendHolidayOK Successfully determine if given date is weekend and/or holiday for given country. + +swagger:response isDateWeekendHolidayOK +*/ +type IsDateWeekendHolidayOK struct { + + /* + In: Body + */ + Payload *internalmessages.IsDateWeekendHolidayInfo `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayOK creates IsDateWeekendHolidayOK with default headers values +func NewIsDateWeekendHolidayOK() *IsDateWeekendHolidayOK { + + return &IsDateWeekendHolidayOK{} +} + +// WithPayload adds the payload to the is date weekend holiday o k response +func (o *IsDateWeekendHolidayOK) WithPayload(payload *internalmessages.IsDateWeekendHolidayInfo) *IsDateWeekendHolidayOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday o k response +func (o *IsDateWeekendHolidayOK) SetPayload(payload *internalmessages.IsDateWeekendHolidayInfo) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayBadRequestCode is the HTTP code returned for type IsDateWeekendHolidayBadRequest +const IsDateWeekendHolidayBadRequestCode int = 400 + +/* +IsDateWeekendHolidayBadRequest The request payload is invalid. + +swagger:response isDateWeekendHolidayBadRequest +*/ +type IsDateWeekendHolidayBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayBadRequest creates IsDateWeekendHolidayBadRequest with default headers values +func NewIsDateWeekendHolidayBadRequest() *IsDateWeekendHolidayBadRequest { + + return &IsDateWeekendHolidayBadRequest{} +} + +// WithPayload adds the payload to the is date weekend holiday bad request response +func (o *IsDateWeekendHolidayBadRequest) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday bad request response +func (o *IsDateWeekendHolidayBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayUnauthorizedCode is the HTTP code returned for type IsDateWeekendHolidayUnauthorized +const IsDateWeekendHolidayUnauthorizedCode int = 401 + +/* +IsDateWeekendHolidayUnauthorized The request was denied. + +swagger:response isDateWeekendHolidayUnauthorized +*/ +type IsDateWeekendHolidayUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayUnauthorized creates IsDateWeekendHolidayUnauthorized with default headers values +func NewIsDateWeekendHolidayUnauthorized() *IsDateWeekendHolidayUnauthorized { + + return &IsDateWeekendHolidayUnauthorized{} +} + +// WithPayload adds the payload to the is date weekend holiday unauthorized response +func (o *IsDateWeekendHolidayUnauthorized) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday unauthorized response +func (o *IsDateWeekendHolidayUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayNotFoundCode is the HTTP code returned for type IsDateWeekendHolidayNotFound +const IsDateWeekendHolidayNotFoundCode int = 404 + +/* +IsDateWeekendHolidayNotFound The requested resource wasn't found. + +swagger:response isDateWeekendHolidayNotFound +*/ +type IsDateWeekendHolidayNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayNotFound creates IsDateWeekendHolidayNotFound with default headers values +func NewIsDateWeekendHolidayNotFound() *IsDateWeekendHolidayNotFound { + + return &IsDateWeekendHolidayNotFound{} +} + +// WithPayload adds the payload to the is date weekend holiday not found response +func (o *IsDateWeekendHolidayNotFound) WithPayload(payload *internalmessages.ClientError) *IsDateWeekendHolidayNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday not found response +func (o *IsDateWeekendHolidayNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsDateWeekendHolidayInternalServerErrorCode is the HTTP code returned for type IsDateWeekendHolidayInternalServerError +const IsDateWeekendHolidayInternalServerErrorCode int = 500 + +/* +IsDateWeekendHolidayInternalServerError A server error occurred. + +swagger:response isDateWeekendHolidayInternalServerError +*/ +type IsDateWeekendHolidayInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewIsDateWeekendHolidayInternalServerError creates IsDateWeekendHolidayInternalServerError with default headers values +func NewIsDateWeekendHolidayInternalServerError() *IsDateWeekendHolidayInternalServerError { + + return &IsDateWeekendHolidayInternalServerError{} +} + +// WithPayload adds the payload to the is date weekend holiday internal server error response +func (o *IsDateWeekendHolidayInternalServerError) WithPayload(payload *internalmessages.Error) *IsDateWeekendHolidayInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is date weekend holiday internal server error response +func (o *IsDateWeekendHolidayInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsDateWeekendHolidayInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go new file mode 100644 index 00000000000..6f9666b8702 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/is_date_weekend_holiday_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// IsDateWeekendHolidayURL generates an URL for the is date weekend holiday operation +type IsDateWeekendHolidayURL struct { + CountryCode string + Date strfmt.Date + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsDateWeekendHolidayURL) WithBasePath(bp string) *IsDateWeekendHolidayURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsDateWeekendHolidayURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IsDateWeekendHolidayURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/calendar/{countryCode}/is-weekend-holiday/{date}" + + countryCode := o.CountryCode + if countryCode != "" { + _path = strings.Replace(_path, "{countryCode}", countryCode, -1) + } else { + return nil, errors.New("countryCode is required on IsDateWeekendHolidayURL") + } + + date := o.Date.String() + if date != "" { + _path = strings.Replace(_path, "{date}", date, -1) + } else { + return nil, errors.New("date is required on IsDateWeekendHolidayURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IsDateWeekendHolidayURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IsDateWeekendHolidayURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IsDateWeekendHolidayURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IsDateWeekendHolidayURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IsDateWeekendHolidayURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IsDateWeekendHolidayURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go new file mode 100644 index 00000000000..f2bfe088744 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowAvailableMoveDatesHandlerFunc turns a function with the right signature into a show available move dates handler +type ShowAvailableMoveDatesHandlerFunc func(ShowAvailableMoveDatesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowAvailableMoveDatesHandlerFunc) Handle(params ShowAvailableMoveDatesParams) middleware.Responder { + return fn(params) +} + +// ShowAvailableMoveDatesHandler interface for that can handle valid show available move dates params +type ShowAvailableMoveDatesHandler interface { + Handle(ShowAvailableMoveDatesParams) middleware.Responder +} + +// NewShowAvailableMoveDates creates a new http.Handler for the show available move dates operation +func NewShowAvailableMoveDates(ctx *middleware.Context, handler ShowAvailableMoveDatesHandler) *ShowAvailableMoveDates { + return &ShowAvailableMoveDates{Context: ctx, Handler: handler} +} + +/* + ShowAvailableMoveDates swagger:route GET /calendar/available_move_dates calendar showAvailableMoveDates + +# Returns available dates for the move calendar + +Returns available dates for the move calendar +*/ +type ShowAvailableMoveDates struct { + Context *middleware.Context + Handler ShowAvailableMoveDatesHandler +} + +func (o *ShowAvailableMoveDates) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowAvailableMoveDatesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go new file mode 100644 index 00000000000..211c0a93cb2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowAvailableMoveDatesParams creates a new ShowAvailableMoveDatesParams object +// +// There are no default values defined in the spec. +func NewShowAvailableMoveDatesParams() ShowAvailableMoveDatesParams { + + return ShowAvailableMoveDatesParams{} +} + +// ShowAvailableMoveDatesParams contains all the bound params for the show available move dates operation +// typically these are obtained from a http.Request +// +// swagger:parameters showAvailableMoveDates +type ShowAvailableMoveDatesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Look for future available dates starting from (and including) this date + Required: true + In: query + */ + StartDate strfmt.Date +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowAvailableMoveDatesParams() beforehand. +func (o *ShowAvailableMoveDatesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qStartDate, qhkStartDate, _ := qs.GetOK("startDate") + if err := o.bindStartDate(qStartDate, qhkStartDate, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindStartDate binds and validates parameter StartDate from query. +func (o *ShowAvailableMoveDatesParams) bindStartDate(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("startDate", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("startDate", "query", raw); err != nil { + return err + } + + // Format: date + value, err := formats.Parse("date", raw) + if err != nil { + return errors.InvalidType("startDate", "query", "strfmt.Date", raw) + } + o.StartDate = *(value.(*strfmt.Date)) + + if err := o.validateStartDate(formats); err != nil { + return err + } + + return nil +} + +// validateStartDate carries on validations for parameter StartDate +func (o *ShowAvailableMoveDatesParams) validateStartDate(formats strfmt.Registry) error { + + if err := validate.FormatOf("startDate", "query", "date", o.StartDate.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go new file mode 100644 index 00000000000..779f5e52c86 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowAvailableMoveDatesOKCode is the HTTP code returned for type ShowAvailableMoveDatesOK +const ShowAvailableMoveDatesOKCode int = 200 + +/* +ShowAvailableMoveDatesOK List of available dates + +swagger:response showAvailableMoveDatesOK +*/ +type ShowAvailableMoveDatesOK struct { + + /* + In: Body + */ + Payload *internalmessages.AvailableMoveDates `json:"body,omitempty"` +} + +// NewShowAvailableMoveDatesOK creates ShowAvailableMoveDatesOK with default headers values +func NewShowAvailableMoveDatesOK() *ShowAvailableMoveDatesOK { + + return &ShowAvailableMoveDatesOK{} +} + +// WithPayload adds the payload to the show available move dates o k response +func (o *ShowAvailableMoveDatesOK) WithPayload(payload *internalmessages.AvailableMoveDates) *ShowAvailableMoveDatesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show available move dates o k response +func (o *ShowAvailableMoveDatesOK) SetPayload(payload *internalmessages.AvailableMoveDates) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAvailableMoveDatesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAvailableMoveDatesBadRequestCode is the HTTP code returned for type ShowAvailableMoveDatesBadRequest +const ShowAvailableMoveDatesBadRequestCode int = 400 + +/* +ShowAvailableMoveDatesBadRequest invalid request + +swagger:response showAvailableMoveDatesBadRequest +*/ +type ShowAvailableMoveDatesBadRequest struct { +} + +// NewShowAvailableMoveDatesBadRequest creates ShowAvailableMoveDatesBadRequest with default headers values +func NewShowAvailableMoveDatesBadRequest() *ShowAvailableMoveDatesBadRequest { + + return &ShowAvailableMoveDatesBadRequest{} +} + +// WriteResponse to the client +func (o *ShowAvailableMoveDatesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowAvailableMoveDatesUnauthorizedCode is the HTTP code returned for type ShowAvailableMoveDatesUnauthorized +const ShowAvailableMoveDatesUnauthorizedCode int = 401 + +/* +ShowAvailableMoveDatesUnauthorized request requires user authentication + +swagger:response showAvailableMoveDatesUnauthorized +*/ +type ShowAvailableMoveDatesUnauthorized struct { +} + +// NewShowAvailableMoveDatesUnauthorized creates ShowAvailableMoveDatesUnauthorized with default headers values +func NewShowAvailableMoveDatesUnauthorized() *ShowAvailableMoveDatesUnauthorized { + + return &ShowAvailableMoveDatesUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowAvailableMoveDatesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowAvailableMoveDatesForbiddenCode is the HTTP code returned for type ShowAvailableMoveDatesForbidden +const ShowAvailableMoveDatesForbiddenCode int = 403 + +/* +ShowAvailableMoveDatesForbidden user is not authorized + +swagger:response showAvailableMoveDatesForbidden +*/ +type ShowAvailableMoveDatesForbidden struct { +} + +// NewShowAvailableMoveDatesForbidden creates ShowAvailableMoveDatesForbidden with default headers values +func NewShowAvailableMoveDatesForbidden() *ShowAvailableMoveDatesForbidden { + + return &ShowAvailableMoveDatesForbidden{} +} + +// WriteResponse to the client +func (o *ShowAvailableMoveDatesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowAvailableMoveDatesInternalServerErrorCode is the HTTP code returned for type ShowAvailableMoveDatesInternalServerError +const ShowAvailableMoveDatesInternalServerErrorCode int = 500 + +/* +ShowAvailableMoveDatesInternalServerError internal server error + +swagger:response showAvailableMoveDatesInternalServerError +*/ +type ShowAvailableMoveDatesInternalServerError struct { +} + +// NewShowAvailableMoveDatesInternalServerError creates ShowAvailableMoveDatesInternalServerError with default headers values +func NewShowAvailableMoveDatesInternalServerError() *ShowAvailableMoveDatesInternalServerError { + + return &ShowAvailableMoveDatesInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowAvailableMoveDatesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go new file mode 100644 index 00000000000..662e4248c9b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/calendar/show_available_move_dates_urlbuilder.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package calendar + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" +) + +// ShowAvailableMoveDatesURL generates an URL for the show available move dates operation +type ShowAvailableMoveDatesURL struct { + StartDate strfmt.Date + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAvailableMoveDatesURL) WithBasePath(bp string) *ShowAvailableMoveDatesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAvailableMoveDatesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowAvailableMoveDatesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/calendar/available_move_dates" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + startDateQ := o.StartDate.String() + if startDateQ != "" { + qs.Set("startDate", startDateQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowAvailableMoveDatesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowAvailableMoveDatesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowAvailableMoveDatesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowAvailableMoveDatesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowAvailableMoveDatesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowAvailableMoveDatesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go new file mode 100644 index 00000000000..8ed4f999704 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateSignedCertificationHandlerFunc turns a function with the right signature into a create signed certification handler +type CreateSignedCertificationHandlerFunc func(CreateSignedCertificationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateSignedCertificationHandlerFunc) Handle(params CreateSignedCertificationParams) middleware.Responder { + return fn(params) +} + +// CreateSignedCertificationHandler interface for that can handle valid create signed certification params +type CreateSignedCertificationHandler interface { + Handle(CreateSignedCertificationParams) middleware.Responder +} + +// NewCreateSignedCertification creates a new http.Handler for the create signed certification operation +func NewCreateSignedCertification(ctx *middleware.Context, handler CreateSignedCertificationHandler) *CreateSignedCertification { + return &CreateSignedCertification{Context: ctx, Handler: handler} +} + +/* + CreateSignedCertification swagger:route POST /moves/{moveId}/signed_certifications certification createSignedCertification + +# Submits signed certification for the given move ID + +Create an instance of signed_certification tied to the move ID +*/ +type CreateSignedCertification struct { + Context *middleware.Context + Handler CreateSignedCertificationHandler +} + +func (o *CreateSignedCertification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateSignedCertificationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go new file mode 100644 index 00000000000..733bc6d3822 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateSignedCertificationParams creates a new CreateSignedCertificationParams object +// +// There are no default values defined in the spec. +func NewCreateSignedCertificationParams() CreateSignedCertificationParams { + + return CreateSignedCertificationParams{} +} + +// CreateSignedCertificationParams contains all the bound params for the create signed certification operation +// typically these are obtained from a http.Request +// +// swagger:parameters createSignedCertification +type CreateSignedCertificationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateSignedCertificationPayload *internalmessages.CreateSignedCertificationPayload + /*UUID of the move being signed for + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateSignedCertificationParams() beforehand. +func (o *CreateSignedCertificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateSignedCertificationPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createSignedCertificationPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("createSignedCertificationPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateSignedCertificationPayload = &body + } + } + } else { + res = append(res, errors.Required("createSignedCertificationPayload", "body", "")) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *CreateSignedCertificationParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *CreateSignedCertificationParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go new file mode 100644 index 00000000000..0d3bf6f8b7c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateSignedCertificationCreatedCode is the HTTP code returned for type CreateSignedCertificationCreated +const CreateSignedCertificationCreatedCode int = 201 + +/* +CreateSignedCertificationCreated created instance of signed_certification + +swagger:response createSignedCertificationCreated +*/ +type CreateSignedCertificationCreated struct { + + /* + In: Body + */ + Payload *internalmessages.SignedCertificationPayload `json:"body,omitempty"` +} + +// NewCreateSignedCertificationCreated creates CreateSignedCertificationCreated with default headers values +func NewCreateSignedCertificationCreated() *CreateSignedCertificationCreated { + + return &CreateSignedCertificationCreated{} +} + +// WithPayload adds the payload to the create signed certification created response +func (o *CreateSignedCertificationCreated) WithPayload(payload *internalmessages.SignedCertificationPayload) *CreateSignedCertificationCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create signed certification created response +func (o *CreateSignedCertificationCreated) SetPayload(payload *internalmessages.SignedCertificationPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSignedCertificationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSignedCertificationBadRequestCode is the HTTP code returned for type CreateSignedCertificationBadRequest +const CreateSignedCertificationBadRequestCode int = 400 + +/* +CreateSignedCertificationBadRequest invalid request + +swagger:response createSignedCertificationBadRequest +*/ +type CreateSignedCertificationBadRequest struct { +} + +// NewCreateSignedCertificationBadRequest creates CreateSignedCertificationBadRequest with default headers values +func NewCreateSignedCertificationBadRequest() *CreateSignedCertificationBadRequest { + + return &CreateSignedCertificationBadRequest{} +} + +// WriteResponse to the client +func (o *CreateSignedCertificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateSignedCertificationUnauthorizedCode is the HTTP code returned for type CreateSignedCertificationUnauthorized +const CreateSignedCertificationUnauthorizedCode int = 401 + +/* +CreateSignedCertificationUnauthorized request requires user authentication + +swagger:response createSignedCertificationUnauthorized +*/ +type CreateSignedCertificationUnauthorized struct { +} + +// NewCreateSignedCertificationUnauthorized creates CreateSignedCertificationUnauthorized with default headers values +func NewCreateSignedCertificationUnauthorized() *CreateSignedCertificationUnauthorized { + + return &CreateSignedCertificationUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateSignedCertificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateSignedCertificationForbiddenCode is the HTTP code returned for type CreateSignedCertificationForbidden +const CreateSignedCertificationForbiddenCode int = 403 + +/* +CreateSignedCertificationForbidden user is not authorized to sign for this move + +swagger:response createSignedCertificationForbidden +*/ +type CreateSignedCertificationForbidden struct { +} + +// NewCreateSignedCertificationForbidden creates CreateSignedCertificationForbidden with default headers values +func NewCreateSignedCertificationForbidden() *CreateSignedCertificationForbidden { + + return &CreateSignedCertificationForbidden{} +} + +// WriteResponse to the client +func (o *CreateSignedCertificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateSignedCertificationNotFoundCode is the HTTP code returned for type CreateSignedCertificationNotFound +const CreateSignedCertificationNotFoundCode int = 404 + +/* +CreateSignedCertificationNotFound move not found + +swagger:response createSignedCertificationNotFound +*/ +type CreateSignedCertificationNotFound struct { +} + +// NewCreateSignedCertificationNotFound creates CreateSignedCertificationNotFound with default headers values +func NewCreateSignedCertificationNotFound() *CreateSignedCertificationNotFound { + + return &CreateSignedCertificationNotFound{} +} + +// WriteResponse to the client +func (o *CreateSignedCertificationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// CreateSignedCertificationInternalServerErrorCode is the HTTP code returned for type CreateSignedCertificationInternalServerError +const CreateSignedCertificationInternalServerErrorCode int = 500 + +/* +CreateSignedCertificationInternalServerError internal server error + +swagger:response createSignedCertificationInternalServerError +*/ +type CreateSignedCertificationInternalServerError struct { +} + +// NewCreateSignedCertificationInternalServerError creates CreateSignedCertificationInternalServerError with default headers values +func NewCreateSignedCertificationInternalServerError() *CreateSignedCertificationInternalServerError { + + return &CreateSignedCertificationInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateSignedCertificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go new file mode 100644 index 00000000000..8cf71476144 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/create_signed_certification_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateSignedCertificationURL generates an URL for the create signed certification operation +type CreateSignedCertificationURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateSignedCertificationURL) WithBasePath(bp string) *CreateSignedCertificationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateSignedCertificationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateSignedCertificationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/signed_certifications" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on CreateSignedCertificationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateSignedCertificationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateSignedCertificationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateSignedCertificationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateSignedCertificationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateSignedCertificationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateSignedCertificationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go new file mode 100644 index 00000000000..7722cbc1338 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexSignedCertificationHandlerFunc turns a function with the right signature into a index signed certification handler +type IndexSignedCertificationHandlerFunc func(IndexSignedCertificationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexSignedCertificationHandlerFunc) Handle(params IndexSignedCertificationParams) middleware.Responder { + return fn(params) +} + +// IndexSignedCertificationHandler interface for that can handle valid index signed certification params +type IndexSignedCertificationHandler interface { + Handle(IndexSignedCertificationParams) middleware.Responder +} + +// NewIndexSignedCertification creates a new http.Handler for the index signed certification operation +func NewIndexSignedCertification(ctx *middleware.Context, handler IndexSignedCertificationHandler) *IndexSignedCertification { + return &IndexSignedCertification{Context: ctx, Handler: handler} +} + +/* + IndexSignedCertification swagger:route GET /moves/{moveId}/signed_certifications certification indexSignedCertification + +gets the signed certifications for the given move ID + +returns a list of all signed_certifications associated with the move ID +*/ +type IndexSignedCertification struct { + Context *middleware.Context + Handler IndexSignedCertificationHandler +} + +func (o *IndexSignedCertification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexSignedCertificationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go new file mode 100644 index 00000000000..055d4cb5751 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewIndexSignedCertificationParams creates a new IndexSignedCertificationParams object +// +// There are no default values defined in the spec. +func NewIndexSignedCertificationParams() IndexSignedCertificationParams { + + return IndexSignedCertificationParams{} +} + +// IndexSignedCertificationParams contains all the bound params for the index signed certification operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexSignedCertification +type IndexSignedCertificationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexSignedCertificationParams() beforehand. +func (o *IndexSignedCertificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *IndexSignedCertificationParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *IndexSignedCertificationParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go new file mode 100644 index 00000000000..e9511fdfd3a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// IndexSignedCertificationOKCode is the HTTP code returned for type IndexSignedCertificationOK +const IndexSignedCertificationOKCode int = 200 + +/* +IndexSignedCertificationOK returns a list of signed certifications + +swagger:response indexSignedCertificationOK +*/ +type IndexSignedCertificationOK struct { + + /* + In: Body + */ + Payload internalmessages.SignedCertifications `json:"body,omitempty"` +} + +// NewIndexSignedCertificationOK creates IndexSignedCertificationOK with default headers values +func NewIndexSignedCertificationOK() *IndexSignedCertificationOK { + + return &IndexSignedCertificationOK{} +} + +// WithPayload adds the payload to the index signed certification o k response +func (o *IndexSignedCertificationOK) WithPayload(payload internalmessages.SignedCertifications) *IndexSignedCertificationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index signed certification o k response +func (o *IndexSignedCertificationOK) SetPayload(payload internalmessages.SignedCertifications) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexSignedCertificationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.SignedCertifications{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexSignedCertificationBadRequestCode is the HTTP code returned for type IndexSignedCertificationBadRequest +const IndexSignedCertificationBadRequestCode int = 400 + +/* +IndexSignedCertificationBadRequest invalid request + +swagger:response indexSignedCertificationBadRequest +*/ +type IndexSignedCertificationBadRequest struct { +} + +// NewIndexSignedCertificationBadRequest creates IndexSignedCertificationBadRequest with default headers values +func NewIndexSignedCertificationBadRequest() *IndexSignedCertificationBadRequest { + + return &IndexSignedCertificationBadRequest{} +} + +// WriteResponse to the client +func (o *IndexSignedCertificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexSignedCertificationUnauthorizedCode is the HTTP code returned for type IndexSignedCertificationUnauthorized +const IndexSignedCertificationUnauthorizedCode int = 401 + +/* +IndexSignedCertificationUnauthorized request requires user authentication + +swagger:response indexSignedCertificationUnauthorized +*/ +type IndexSignedCertificationUnauthorized struct { +} + +// NewIndexSignedCertificationUnauthorized creates IndexSignedCertificationUnauthorized with default headers values +func NewIndexSignedCertificationUnauthorized() *IndexSignedCertificationUnauthorized { + + return &IndexSignedCertificationUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexSignedCertificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexSignedCertificationForbiddenCode is the HTTP code returned for type IndexSignedCertificationForbidden +const IndexSignedCertificationForbiddenCode int = 403 + +/* +IndexSignedCertificationForbidden user is not authorized + +swagger:response indexSignedCertificationForbidden +*/ +type IndexSignedCertificationForbidden struct { +} + +// NewIndexSignedCertificationForbidden creates IndexSignedCertificationForbidden with default headers values +func NewIndexSignedCertificationForbidden() *IndexSignedCertificationForbidden { + + return &IndexSignedCertificationForbidden{} +} + +// WriteResponse to the client +func (o *IndexSignedCertificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// IndexSignedCertificationNotFoundCode is the HTTP code returned for type IndexSignedCertificationNotFound +const IndexSignedCertificationNotFoundCode int = 404 + +/* +IndexSignedCertificationNotFound move not found + +swagger:response indexSignedCertificationNotFound +*/ +type IndexSignedCertificationNotFound struct { +} + +// NewIndexSignedCertificationNotFound creates IndexSignedCertificationNotFound with default headers values +func NewIndexSignedCertificationNotFound() *IndexSignedCertificationNotFound { + + return &IndexSignedCertificationNotFound{} +} + +// WriteResponse to the client +func (o *IndexSignedCertificationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// IndexSignedCertificationInternalServerErrorCode is the HTTP code returned for type IndexSignedCertificationInternalServerError +const IndexSignedCertificationInternalServerErrorCode int = 500 + +/* +IndexSignedCertificationInternalServerError internal server error + +swagger:response indexSignedCertificationInternalServerError +*/ +type IndexSignedCertificationInternalServerError struct { +} + +// NewIndexSignedCertificationInternalServerError creates IndexSignedCertificationInternalServerError with default headers values +func NewIndexSignedCertificationInternalServerError() *IndexSignedCertificationInternalServerError { + + return &IndexSignedCertificationInternalServerError{} +} + +// WriteResponse to the client +func (o *IndexSignedCertificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go new file mode 100644 index 00000000000..db48533f456 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/certification/index_signed_certification_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package certification + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// IndexSignedCertificationURL generates an URL for the index signed certification operation +type IndexSignedCertificationURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexSignedCertificationURL) WithBasePath(bp string) *IndexSignedCertificationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexSignedCertificationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexSignedCertificationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/signed_certifications" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on IndexSignedCertificationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexSignedCertificationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexSignedCertificationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexSignedCertificationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexSignedCertificationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexSignedCertificationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexSignedCertificationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document.go b/pkg/gen/internalapi/internaloperations/documents/create_document.go new file mode 100644 index 00000000000..33d1c2e87c0 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/create_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateDocumentHandlerFunc turns a function with the right signature into a create document handler +type CreateDocumentHandlerFunc func(CreateDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateDocumentHandlerFunc) Handle(params CreateDocumentParams) middleware.Responder { + return fn(params) +} + +// CreateDocumentHandler interface for that can handle valid create document params +type CreateDocumentHandler interface { + Handle(CreateDocumentParams) middleware.Responder +} + +// NewCreateDocument creates a new http.Handler for the create document operation +func NewCreateDocument(ctx *middleware.Context, handler CreateDocumentHandler) *CreateDocument { + return &CreateDocument{Context: ctx, Handler: handler} +} + +/* + CreateDocument swagger:route POST /documents documents createDocument + +# Create a new document + +Documents represent a physical artifact such as a scanned document or a PDF file +*/ +type CreateDocument struct { + Context *middleware.Context + Handler CreateDocumentHandler +} + +func (o *CreateDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go b/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go new file mode 100644 index 00000000000..fa817c6784e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/create_document_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateDocumentParams creates a new CreateDocumentParams object +// +// There are no default values defined in the spec. +func NewCreateDocumentParams() CreateDocumentParams { + + return CreateDocumentParams{} +} + +// CreateDocumentParams contains all the bound params for the create document operation +// typically these are obtained from a http.Request +// +// swagger:parameters createDocument +type CreateDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + DocumentPayload *internalmessages.PostDocumentPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateDocumentParams() beforehand. +func (o *CreateDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.PostDocumentPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("documentPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("documentPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.DocumentPayload = &body + } + } + } else { + res = append(res, errors.Required("documentPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go b/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go new file mode 100644 index 00000000000..23f03d12d16 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/create_document_responses.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateDocumentCreatedCode is the HTTP code returned for type CreateDocumentCreated +const CreateDocumentCreatedCode int = 201 + +/* +CreateDocumentCreated created document + +swagger:response createDocumentCreated +*/ +type CreateDocumentCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Document `json:"body,omitempty"` +} + +// NewCreateDocumentCreated creates CreateDocumentCreated with default headers values +func NewCreateDocumentCreated() *CreateDocumentCreated { + + return &CreateDocumentCreated{} +} + +// WithPayload adds the payload to the create document created response +func (o *CreateDocumentCreated) WithPayload(payload *internalmessages.Document) *CreateDocumentCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create document created response +func (o *CreateDocumentCreated) SetPayload(payload *internalmessages.Document) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateDocumentCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateDocumentBadRequestCode is the HTTP code returned for type CreateDocumentBadRequest +const CreateDocumentBadRequestCode int = 400 + +/* +CreateDocumentBadRequest invalid request + +swagger:response createDocumentBadRequest +*/ +type CreateDocumentBadRequest struct { +} + +// NewCreateDocumentBadRequest creates CreateDocumentBadRequest with default headers values +func NewCreateDocumentBadRequest() *CreateDocumentBadRequest { + + return &CreateDocumentBadRequest{} +} + +// WriteResponse to the client +func (o *CreateDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateDocumentInternalServerErrorCode is the HTTP code returned for type CreateDocumentInternalServerError +const CreateDocumentInternalServerErrorCode int = 500 + +/* +CreateDocumentInternalServerError server error + +swagger:response createDocumentInternalServerError +*/ +type CreateDocumentInternalServerError struct { +} + +// NewCreateDocumentInternalServerError creates CreateDocumentInternalServerError with default headers values +func NewCreateDocumentInternalServerError() *CreateDocumentInternalServerError { + + return &CreateDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go new file mode 100644 index 00000000000..7492b3b027f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/create_document_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateDocumentURL generates an URL for the create document operation +type CreateDocumentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateDocumentURL) WithBasePath(bp string) *CreateDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/documents" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document.go b/pkg/gen/internalapi/internaloperations/documents/show_document.go new file mode 100644 index 00000000000..1837f7f6bef --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/show_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowDocumentHandlerFunc turns a function with the right signature into a show document handler +type ShowDocumentHandlerFunc func(ShowDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowDocumentHandlerFunc) Handle(params ShowDocumentParams) middleware.Responder { + return fn(params) +} + +// ShowDocumentHandler interface for that can handle valid show document params +type ShowDocumentHandler interface { + Handle(ShowDocumentParams) middleware.Responder +} + +// NewShowDocument creates a new http.Handler for the show document operation +func NewShowDocument(ctx *middleware.Context, handler ShowDocumentHandler) *ShowDocument { + return &ShowDocument{Context: ctx, Handler: handler} +} + +/* + ShowDocument swagger:route GET /documents/{documentId} documents showDocument + +# Returns a document + +Returns a document and its uploads +*/ +type ShowDocument struct { + Context *middleware.Context + Handler ShowDocumentHandler +} + +func (o *ShowDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go b/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go new file mode 100644 index 00000000000..fbc4162da4e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/show_document_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowDocumentParams creates a new ShowDocumentParams object +// +// There are no default values defined in the spec. +func NewShowDocumentParams() ShowDocumentParams { + + return ShowDocumentParams{} +} + +// ShowDocumentParams contains all the bound params for the show document operation +// typically these are obtained from a http.Request +// +// swagger:parameters showDocument +type ShowDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the document to return + Required: true + In: path + */ + DocumentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowDocumentParams() beforehand. +func (o *ShowDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDocumentID, rhkDocumentID, _ := route.Params.GetOK("documentId") + if err := o.bindDocumentID(rDocumentID, rhkDocumentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDocumentID binds and validates parameter DocumentID from path. +func (o *ShowDocumentParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("documentId", "path", "strfmt.UUID", raw) + } + o.DocumentID = *(value.(*strfmt.UUID)) + + if err := o.validateDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateDocumentID carries on validations for parameter DocumentID +func (o *ShowDocumentParams) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("documentId", "path", "uuid", o.DocumentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go b/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go new file mode 100644 index 00000000000..9871aaab702 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/show_document_responses.go @@ -0,0 +1,179 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowDocumentOKCode is the HTTP code returned for type ShowDocumentOK +const ShowDocumentOKCode int = 200 + +/* +ShowDocumentOK the requested document + +swagger:response showDocumentOK +*/ +type ShowDocumentOK struct { + + /* + In: Body + */ + Payload *internalmessages.Document `json:"body,omitempty"` +} + +// NewShowDocumentOK creates ShowDocumentOK with default headers values +func NewShowDocumentOK() *ShowDocumentOK { + + return &ShowDocumentOK{} +} + +// WithPayload adds the payload to the show document o k response +func (o *ShowDocumentOK) WithPayload(payload *internalmessages.Document) *ShowDocumentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show document o k response +func (o *ShowDocumentOK) SetPayload(payload *internalmessages.Document) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowDocumentBadRequestCode is the HTTP code returned for type ShowDocumentBadRequest +const ShowDocumentBadRequestCode int = 400 + +/* +ShowDocumentBadRequest invalid request + +swagger:response showDocumentBadRequest +*/ +type ShowDocumentBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewShowDocumentBadRequest creates ShowDocumentBadRequest with default headers values +func NewShowDocumentBadRequest() *ShowDocumentBadRequest { + + return &ShowDocumentBadRequest{} +} + +// WithPayload adds the payload to the show document bad request response +func (o *ShowDocumentBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *ShowDocumentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show document bad request response +func (o *ShowDocumentBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowDocumentForbiddenCode is the HTTP code returned for type ShowDocumentForbidden +const ShowDocumentForbiddenCode int = 403 + +/* +ShowDocumentForbidden not authorized + +swagger:response showDocumentForbidden +*/ +type ShowDocumentForbidden struct { +} + +// NewShowDocumentForbidden creates ShowDocumentForbidden with default headers values +func NewShowDocumentForbidden() *ShowDocumentForbidden { + + return &ShowDocumentForbidden{} +} + +// WriteResponse to the client +func (o *ShowDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowDocumentNotFoundCode is the HTTP code returned for type ShowDocumentNotFound +const ShowDocumentNotFoundCode int = 404 + +/* +ShowDocumentNotFound not found + +swagger:response showDocumentNotFound +*/ +type ShowDocumentNotFound struct { +} + +// NewShowDocumentNotFound creates ShowDocumentNotFound with default headers values +func NewShowDocumentNotFound() *ShowDocumentNotFound { + + return &ShowDocumentNotFound{} +} + +// WriteResponse to the client +func (o *ShowDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowDocumentInternalServerErrorCode is the HTTP code returned for type ShowDocumentInternalServerError +const ShowDocumentInternalServerErrorCode int = 500 + +/* +ShowDocumentInternalServerError server error + +swagger:response showDocumentInternalServerError +*/ +type ShowDocumentInternalServerError struct { +} + +// NewShowDocumentInternalServerError creates ShowDocumentInternalServerError with default headers values +func NewShowDocumentInternalServerError() *ShowDocumentInternalServerError { + + return &ShowDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go new file mode 100644 index 00000000000..2ac84a0412c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/documents/show_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package documents + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowDocumentURL generates an URL for the show document operation +type ShowDocumentURL struct { + DocumentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowDocumentURL) WithBasePath(bp string) *ShowDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/documents/{documentId}" + + documentID := o.DocumentID.String() + if documentID != "" { + _path = strings.Replace(_path, "{documentId}", documentID, -1) + } else { + return nil, errors.New("documentId is required on ShowDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go new file mode 100644 index 00000000000..3cacc580d22 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package duty_locations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SearchDutyLocationsHandlerFunc turns a function with the right signature into a search duty locations handler +type SearchDutyLocationsHandlerFunc func(SearchDutyLocationsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SearchDutyLocationsHandlerFunc) Handle(params SearchDutyLocationsParams) middleware.Responder { + return fn(params) +} + +// SearchDutyLocationsHandler interface for that can handle valid search duty locations params +type SearchDutyLocationsHandler interface { + Handle(SearchDutyLocationsParams) middleware.Responder +} + +// NewSearchDutyLocations creates a new http.Handler for the search duty locations operation +func NewSearchDutyLocations(ctx *middleware.Context, handler SearchDutyLocationsHandler) *SearchDutyLocations { + return &SearchDutyLocations{Context: ctx, Handler: handler} +} + +/* + SearchDutyLocations swagger:route GET /duty_locations duty_locations searchDutyLocations + +# Returns the duty locations matching the search query + +Returns the duty locations matching the search query +*/ +type SearchDutyLocations struct { + Context *middleware.Context + Handler SearchDutyLocationsHandler +} + +func (o *SearchDutyLocations) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSearchDutyLocationsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go new file mode 100644 index 00000000000..253cdadaf04 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_parameters.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package duty_locations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewSearchDutyLocationsParams creates a new SearchDutyLocationsParams object +// +// There are no default values defined in the spec. +func NewSearchDutyLocationsParams() SearchDutyLocationsParams { + + return SearchDutyLocationsParams{} +} + +// SearchDutyLocationsParams contains all the bound params for the search duty locations operation +// typically these are obtained from a http.Request +// +// swagger:parameters searchDutyLocations +type SearchDutyLocationsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Search string for duty locations + Required: true + In: query + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSearchDutyLocationsParams() beforehand. +func (o *SearchDutyLocationsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSearch, qhkSearch, _ := qs.GetOK("search") + if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from query. +func (o *SearchDutyLocationsParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("search", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("search", "query", raw); err != nil { + return err + } + o.Search = raw + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go new file mode 100644 index 00000000000..2cf5b63dd2e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_responses.go @@ -0,0 +1,187 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package duty_locations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// SearchDutyLocationsOKCode is the HTTP code returned for type SearchDutyLocationsOK +const SearchDutyLocationsOKCode int = 200 + +/* +SearchDutyLocationsOK the instance of the duty location + +swagger:response searchDutyLocationsOK +*/ +type SearchDutyLocationsOK struct { + + /* + In: Body + */ + Payload internalmessages.DutyLocationsPayload `json:"body,omitempty"` +} + +// NewSearchDutyLocationsOK creates SearchDutyLocationsOK with default headers values +func NewSearchDutyLocationsOK() *SearchDutyLocationsOK { + + return &SearchDutyLocationsOK{} +} + +// WithPayload adds the payload to the search duty locations o k response +func (o *SearchDutyLocationsOK) WithPayload(payload internalmessages.DutyLocationsPayload) *SearchDutyLocationsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the search duty locations o k response +func (o *SearchDutyLocationsOK) SetPayload(payload internalmessages.DutyLocationsPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SearchDutyLocationsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.DutyLocationsPayload{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// SearchDutyLocationsBadRequestCode is the HTTP code returned for type SearchDutyLocationsBadRequest +const SearchDutyLocationsBadRequestCode int = 400 + +/* +SearchDutyLocationsBadRequest invalid request + +swagger:response searchDutyLocationsBadRequest +*/ +type SearchDutyLocationsBadRequest struct { +} + +// NewSearchDutyLocationsBadRequest creates SearchDutyLocationsBadRequest with default headers values +func NewSearchDutyLocationsBadRequest() *SearchDutyLocationsBadRequest { + + return &SearchDutyLocationsBadRequest{} +} + +// WriteResponse to the client +func (o *SearchDutyLocationsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// SearchDutyLocationsUnauthorizedCode is the HTTP code returned for type SearchDutyLocationsUnauthorized +const SearchDutyLocationsUnauthorizedCode int = 401 + +/* +SearchDutyLocationsUnauthorized request requires user authentication + +swagger:response searchDutyLocationsUnauthorized +*/ +type SearchDutyLocationsUnauthorized struct { +} + +// NewSearchDutyLocationsUnauthorized creates SearchDutyLocationsUnauthorized with default headers values +func NewSearchDutyLocationsUnauthorized() *SearchDutyLocationsUnauthorized { + + return &SearchDutyLocationsUnauthorized{} +} + +// WriteResponse to the client +func (o *SearchDutyLocationsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// SearchDutyLocationsForbiddenCode is the HTTP code returned for type SearchDutyLocationsForbidden +const SearchDutyLocationsForbiddenCode int = 403 + +/* +SearchDutyLocationsForbidden user is not authorized + +swagger:response searchDutyLocationsForbidden +*/ +type SearchDutyLocationsForbidden struct { +} + +// NewSearchDutyLocationsForbidden creates SearchDutyLocationsForbidden with default headers values +func NewSearchDutyLocationsForbidden() *SearchDutyLocationsForbidden { + + return &SearchDutyLocationsForbidden{} +} + +// WriteResponse to the client +func (o *SearchDutyLocationsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// SearchDutyLocationsNotFoundCode is the HTTP code returned for type SearchDutyLocationsNotFound +const SearchDutyLocationsNotFoundCode int = 404 + +/* +SearchDutyLocationsNotFound matching duty location not found + +swagger:response searchDutyLocationsNotFound +*/ +type SearchDutyLocationsNotFound struct { +} + +// NewSearchDutyLocationsNotFound creates SearchDutyLocationsNotFound with default headers values +func NewSearchDutyLocationsNotFound() *SearchDutyLocationsNotFound { + + return &SearchDutyLocationsNotFound{} +} + +// WriteResponse to the client +func (o *SearchDutyLocationsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// SearchDutyLocationsInternalServerErrorCode is the HTTP code returned for type SearchDutyLocationsInternalServerError +const SearchDutyLocationsInternalServerErrorCode int = 500 + +/* +SearchDutyLocationsInternalServerError internal server error + +swagger:response searchDutyLocationsInternalServerError +*/ +type SearchDutyLocationsInternalServerError struct { +} + +// NewSearchDutyLocationsInternalServerError creates SearchDutyLocationsInternalServerError with default headers values +func NewSearchDutyLocationsInternalServerError() *SearchDutyLocationsInternalServerError { + + return &SearchDutyLocationsInternalServerError{} +} + +// WriteResponse to the client +func (o *SearchDutyLocationsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go new file mode 100644 index 00000000000..698420efdc3 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/duty_locations/search_duty_locations_urlbuilder.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package duty_locations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// SearchDutyLocationsURL generates an URL for the search duty locations operation +type SearchDutyLocationsURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchDutyLocationsURL) WithBasePath(bp string) *SearchDutyLocationsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SearchDutyLocationsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SearchDutyLocationsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/duty_locations" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + searchQ := o.Search + if searchQ != "" { + qs.Set("search", searchQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SearchDutyLocationsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SearchDutyLocationsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SearchDutyLocationsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SearchDutyLocationsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SearchDutyLocationsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SearchDutyLocationsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go new file mode 100644 index 00000000000..23e1bb6fd74 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package entitlements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexEntitlementsHandlerFunc turns a function with the right signature into a index entitlements handler +type IndexEntitlementsHandlerFunc func(IndexEntitlementsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexEntitlementsHandlerFunc) Handle(params IndexEntitlementsParams) middleware.Responder { + return fn(params) +} + +// IndexEntitlementsHandler interface for that can handle valid index entitlements params +type IndexEntitlementsHandler interface { + Handle(IndexEntitlementsParams) middleware.Responder +} + +// NewIndexEntitlements creates a new http.Handler for the index entitlements operation +func NewIndexEntitlements(ctx *middleware.Context, handler IndexEntitlementsHandler) *IndexEntitlements { + return &IndexEntitlements{Context: ctx, Handler: handler} +} + +/* + IndexEntitlements swagger:route GET /entitlements entitlements indexEntitlements + +# List weight weights allotted by entitlement + +List weight weights allotted by entitlement +*/ +type IndexEntitlements struct { + Context *middleware.Context + Handler IndexEntitlementsHandler +} + +func (o *IndexEntitlements) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexEntitlementsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go new file mode 100644 index 00000000000..2964294104b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package entitlements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewIndexEntitlementsParams creates a new IndexEntitlementsParams object +// +// There are no default values defined in the spec. +func NewIndexEntitlementsParams() IndexEntitlementsParams { + + return IndexEntitlementsParams{} +} + +// IndexEntitlementsParams contains all the bound params for the index entitlements operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexEntitlements +type IndexEntitlementsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexEntitlementsParams() beforehand. +func (o *IndexEntitlementsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go new file mode 100644 index 00000000000..972c901ef1d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_responses.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package entitlements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// IndexEntitlementsOKCode is the HTTP code returned for type IndexEntitlementsOK +const IndexEntitlementsOKCode int = 200 + +/* +IndexEntitlementsOK List of weights allotted entitlement + +swagger:response indexEntitlementsOK +*/ +type IndexEntitlementsOK struct { + + /* + In: Body + */ + Payload internalmessages.IndexEntitlements `json:"body,omitempty"` +} + +// NewIndexEntitlementsOK creates IndexEntitlementsOK with default headers values +func NewIndexEntitlementsOK() *IndexEntitlementsOK { + + return &IndexEntitlementsOK{} +} + +// WithPayload adds the payload to the index entitlements o k response +func (o *IndexEntitlementsOK) WithPayload(payload internalmessages.IndexEntitlements) *IndexEntitlementsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index entitlements o k response +func (o *IndexEntitlementsOK) SetPayload(payload internalmessages.IndexEntitlements) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexEntitlementsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty map + payload = internalmessages.IndexEntitlements{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} diff --git a/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go new file mode 100644 index 00000000000..f02378c9ccc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/entitlements/index_entitlements_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package entitlements + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// IndexEntitlementsURL generates an URL for the index entitlements operation +type IndexEntitlementsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexEntitlementsURL) WithBasePath(bp string) *IndexEntitlementsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexEntitlementsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexEntitlementsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/entitlements" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexEntitlementsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexEntitlementsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexEntitlementsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexEntitlementsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexEntitlementsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexEntitlementsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go new file mode 100644 index 00000000000..eaf409f2661 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// BooleanFeatureFlagForUserHandlerFunc turns a function with the right signature into a boolean feature flag for user handler +type BooleanFeatureFlagForUserHandlerFunc func(BooleanFeatureFlagForUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn BooleanFeatureFlagForUserHandlerFunc) Handle(params BooleanFeatureFlagForUserParams) middleware.Responder { + return fn(params) +} + +// BooleanFeatureFlagForUserHandler interface for that can handle valid boolean feature flag for user params +type BooleanFeatureFlagForUserHandler interface { + Handle(BooleanFeatureFlagForUserParams) middleware.Responder +} + +// NewBooleanFeatureFlagForUser creates a new http.Handler for the boolean feature flag for user operation +func NewBooleanFeatureFlagForUser(ctx *middleware.Context, handler BooleanFeatureFlagForUserHandler) *BooleanFeatureFlagForUser { + return &BooleanFeatureFlagForUser{Context: ctx, Handler: handler} +} + +/* + BooleanFeatureFlagForUser swagger:route POST /feature-flags/user-boolean/{key} featureFlags booleanFeatureFlagForUser + +# Determines if a user has a feature flag enabled + +Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user. +*/ +type BooleanFeatureFlagForUser struct { + Context *middleware.Context + Handler BooleanFeatureFlagForUserHandler +} + +func (o *BooleanFeatureFlagForUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewBooleanFeatureFlagForUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go new file mode 100644 index 00000000000..c01b6613631 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewBooleanFeatureFlagForUserParams creates a new BooleanFeatureFlagForUserParams object +// +// There are no default values defined in the spec. +func NewBooleanFeatureFlagForUserParams() BooleanFeatureFlagForUserParams { + + return BooleanFeatureFlagForUserParams{} +} + +// BooleanFeatureFlagForUserParams contains all the bound params for the boolean feature flag for user operation +// typically these are obtained from a http.Request +// +// swagger:parameters booleanFeatureFlagForUser +type BooleanFeatureFlagForUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*context for the feature flag request + Required: true + In: body + */ + FlagContext map[string]string + /*Feature Flag Key + Required: true + In: path + */ + Key string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewBooleanFeatureFlagForUserParams() beforehand. +func (o *BooleanFeatureFlagForUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body map[string]string + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("flagContext", "body", "")) + } else { + res = append(res, errors.NewParseError("flagContext", "body", "", err)) + } + } else { + // no validation required on inline body + o.FlagContext = body + } + } else { + res = append(res, errors.Required("flagContext", "body", "")) + } + + rKey, rhkKey, _ := route.Params.GetOK("key") + if err := o.bindKey(rKey, rhkKey, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindKey binds and validates parameter Key from path. +func (o *BooleanFeatureFlagForUserParams) bindKey(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Key = raw + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go new file mode 100644 index 00000000000..aaf26f9634f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_responses.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// BooleanFeatureFlagForUserOKCode is the HTTP code returned for type BooleanFeatureFlagForUserOK +const BooleanFeatureFlagForUserOKCode int = 200 + +/* +BooleanFeatureFlagForUserOK Boolean Feature Flag Status + +swagger:response booleanFeatureFlagForUserOK +*/ +type BooleanFeatureFlagForUserOK struct { + + /* + In: Body + */ + Payload *internalmessages.FeatureFlagBoolean `json:"body,omitempty"` +} + +// NewBooleanFeatureFlagForUserOK creates BooleanFeatureFlagForUserOK with default headers values +func NewBooleanFeatureFlagForUserOK() *BooleanFeatureFlagForUserOK { + + return &BooleanFeatureFlagForUserOK{} +} + +// WithPayload adds the payload to the boolean feature flag for user o k response +func (o *BooleanFeatureFlagForUserOK) WithPayload(payload *internalmessages.FeatureFlagBoolean) *BooleanFeatureFlagForUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the boolean feature flag for user o k response +func (o *BooleanFeatureFlagForUserOK) SetPayload(payload *internalmessages.FeatureFlagBoolean) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *BooleanFeatureFlagForUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// BooleanFeatureFlagForUserBadRequestCode is the HTTP code returned for type BooleanFeatureFlagForUserBadRequest +const BooleanFeatureFlagForUserBadRequestCode int = 400 + +/* +BooleanFeatureFlagForUserBadRequest invalid request + +swagger:response booleanFeatureFlagForUserBadRequest +*/ +type BooleanFeatureFlagForUserBadRequest struct { +} + +// NewBooleanFeatureFlagForUserBadRequest creates BooleanFeatureFlagForUserBadRequest with default headers values +func NewBooleanFeatureFlagForUserBadRequest() *BooleanFeatureFlagForUserBadRequest { + + return &BooleanFeatureFlagForUserBadRequest{} +} + +// WriteResponse to the client +func (o *BooleanFeatureFlagForUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// BooleanFeatureFlagForUserUnauthorizedCode is the HTTP code returned for type BooleanFeatureFlagForUserUnauthorized +const BooleanFeatureFlagForUserUnauthorizedCode int = 401 + +/* +BooleanFeatureFlagForUserUnauthorized request requires user authentication + +swagger:response booleanFeatureFlagForUserUnauthorized +*/ +type BooleanFeatureFlagForUserUnauthorized struct { +} + +// NewBooleanFeatureFlagForUserUnauthorized creates BooleanFeatureFlagForUserUnauthorized with default headers values +func NewBooleanFeatureFlagForUserUnauthorized() *BooleanFeatureFlagForUserUnauthorized { + + return &BooleanFeatureFlagForUserUnauthorized{} +} + +// WriteResponse to the client +func (o *BooleanFeatureFlagForUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// BooleanFeatureFlagForUserInternalServerErrorCode is the HTTP code returned for type BooleanFeatureFlagForUserInternalServerError +const BooleanFeatureFlagForUserInternalServerErrorCode int = 500 + +/* +BooleanFeatureFlagForUserInternalServerError internal server error + +swagger:response booleanFeatureFlagForUserInternalServerError +*/ +type BooleanFeatureFlagForUserInternalServerError struct { +} + +// NewBooleanFeatureFlagForUserInternalServerError creates BooleanFeatureFlagForUserInternalServerError with default headers values +func NewBooleanFeatureFlagForUserInternalServerError() *BooleanFeatureFlagForUserInternalServerError { + + return &BooleanFeatureFlagForUserInternalServerError{} +} + +// WriteResponse to the client +func (o *BooleanFeatureFlagForUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go new file mode 100644 index 00000000000..b74e915b15c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/boolean_feature_flag_for_user_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// BooleanFeatureFlagForUserURL generates an URL for the boolean feature flag for user operation +type BooleanFeatureFlagForUserURL struct { + Key string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *BooleanFeatureFlagForUserURL) WithBasePath(bp string) *BooleanFeatureFlagForUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *BooleanFeatureFlagForUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *BooleanFeatureFlagForUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/feature-flags/user-boolean/{key}" + + key := o.Key + if key != "" { + _path = strings.Replace(_path, "{key}", key, -1) + } else { + return nil, errors.New("key is required on BooleanFeatureFlagForUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *BooleanFeatureFlagForUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *BooleanFeatureFlagForUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *BooleanFeatureFlagForUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on BooleanFeatureFlagForUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on BooleanFeatureFlagForUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *BooleanFeatureFlagForUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go new file mode 100644 index 00000000000..da1d45eeec4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// VariantFeatureFlagForUserHandlerFunc turns a function with the right signature into a variant feature flag for user handler +type VariantFeatureFlagForUserHandlerFunc func(VariantFeatureFlagForUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn VariantFeatureFlagForUserHandlerFunc) Handle(params VariantFeatureFlagForUserParams) middleware.Responder { + return fn(params) +} + +// VariantFeatureFlagForUserHandler interface for that can handle valid variant feature flag for user params +type VariantFeatureFlagForUserHandler interface { + Handle(VariantFeatureFlagForUserParams) middleware.Responder +} + +// NewVariantFeatureFlagForUser creates a new http.Handler for the variant feature flag for user operation +func NewVariantFeatureFlagForUser(ctx *middleware.Context, handler VariantFeatureFlagForUserHandler) *VariantFeatureFlagForUser { + return &VariantFeatureFlagForUser{Context: ctx, Handler: handler} +} + +/* + VariantFeatureFlagForUser swagger:route POST /feature-flags/user-variant/{key} featureFlags variantFeatureFlagForUser + +# Determines if a user has a feature flag enabled + +Determines if a user has a feature flag enabled. The flagContext contains context used to determine if this flag applies to the logged in user. +*/ +type VariantFeatureFlagForUser struct { + Context *middleware.Context + Handler VariantFeatureFlagForUserHandler +} + +func (o *VariantFeatureFlagForUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewVariantFeatureFlagForUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go new file mode 100644 index 00000000000..f42868195e9 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_parameters.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewVariantFeatureFlagForUserParams creates a new VariantFeatureFlagForUserParams object +// +// There are no default values defined in the spec. +func NewVariantFeatureFlagForUserParams() VariantFeatureFlagForUserParams { + + return VariantFeatureFlagForUserParams{} +} + +// VariantFeatureFlagForUserParams contains all the bound params for the variant feature flag for user operation +// typically these are obtained from a http.Request +// +// swagger:parameters variantFeatureFlagForUser +type VariantFeatureFlagForUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*context for the feature flag request + Required: true + In: body + */ + FlagContext map[string]string + /*Feature Flag Key + Required: true + In: path + */ + Key string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewVariantFeatureFlagForUserParams() beforehand. +func (o *VariantFeatureFlagForUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body map[string]string + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("flagContext", "body", "")) + } else { + res = append(res, errors.NewParseError("flagContext", "body", "", err)) + } + } else { + // no validation required on inline body + o.FlagContext = body + } + } else { + res = append(res, errors.Required("flagContext", "body", "")) + } + + rKey, rhkKey, _ := route.Params.GetOK("key") + if err := o.bindKey(rKey, rhkKey, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindKey binds and validates parameter Key from path. +func (o *VariantFeatureFlagForUserParams) bindKey(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Key = raw + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go new file mode 100644 index 00000000000..e1a82ace3d2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_responses.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// VariantFeatureFlagForUserOKCode is the HTTP code returned for type VariantFeatureFlagForUserOK +const VariantFeatureFlagForUserOKCode int = 200 + +/* +VariantFeatureFlagForUserOK Variant Feature Flag Status + +swagger:response variantFeatureFlagForUserOK +*/ +type VariantFeatureFlagForUserOK struct { + + /* + In: Body + */ + Payload *internalmessages.FeatureFlagVariant `json:"body,omitempty"` +} + +// NewVariantFeatureFlagForUserOK creates VariantFeatureFlagForUserOK with default headers values +func NewVariantFeatureFlagForUserOK() *VariantFeatureFlagForUserOK { + + return &VariantFeatureFlagForUserOK{} +} + +// WithPayload adds the payload to the variant feature flag for user o k response +func (o *VariantFeatureFlagForUserOK) WithPayload(payload *internalmessages.FeatureFlagVariant) *VariantFeatureFlagForUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the variant feature flag for user o k response +func (o *VariantFeatureFlagForUserOK) SetPayload(payload *internalmessages.FeatureFlagVariant) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *VariantFeatureFlagForUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// VariantFeatureFlagForUserBadRequestCode is the HTTP code returned for type VariantFeatureFlagForUserBadRequest +const VariantFeatureFlagForUserBadRequestCode int = 400 + +/* +VariantFeatureFlagForUserBadRequest invalid request + +swagger:response variantFeatureFlagForUserBadRequest +*/ +type VariantFeatureFlagForUserBadRequest struct { +} + +// NewVariantFeatureFlagForUserBadRequest creates VariantFeatureFlagForUserBadRequest with default headers values +func NewVariantFeatureFlagForUserBadRequest() *VariantFeatureFlagForUserBadRequest { + + return &VariantFeatureFlagForUserBadRequest{} +} + +// WriteResponse to the client +func (o *VariantFeatureFlagForUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// VariantFeatureFlagForUserUnauthorizedCode is the HTTP code returned for type VariantFeatureFlagForUserUnauthorized +const VariantFeatureFlagForUserUnauthorizedCode int = 401 + +/* +VariantFeatureFlagForUserUnauthorized request requires user authentication + +swagger:response variantFeatureFlagForUserUnauthorized +*/ +type VariantFeatureFlagForUserUnauthorized struct { +} + +// NewVariantFeatureFlagForUserUnauthorized creates VariantFeatureFlagForUserUnauthorized with default headers values +func NewVariantFeatureFlagForUserUnauthorized() *VariantFeatureFlagForUserUnauthorized { + + return &VariantFeatureFlagForUserUnauthorized{} +} + +// WriteResponse to the client +func (o *VariantFeatureFlagForUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// VariantFeatureFlagForUserInternalServerErrorCode is the HTTP code returned for type VariantFeatureFlagForUserInternalServerError +const VariantFeatureFlagForUserInternalServerErrorCode int = 500 + +/* +VariantFeatureFlagForUserInternalServerError internal server error + +swagger:response variantFeatureFlagForUserInternalServerError +*/ +type VariantFeatureFlagForUserInternalServerError struct { +} + +// NewVariantFeatureFlagForUserInternalServerError creates VariantFeatureFlagForUserInternalServerError with default headers values +func NewVariantFeatureFlagForUserInternalServerError() *VariantFeatureFlagForUserInternalServerError { + + return &VariantFeatureFlagForUserInternalServerError{} +} + +// WriteResponse to the client +func (o *VariantFeatureFlagForUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go new file mode 100644 index 00000000000..3bd6e2f0091 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/feature_flags/variant_feature_flag_for_user_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package feature_flags + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// VariantFeatureFlagForUserURL generates an URL for the variant feature flag for user operation +type VariantFeatureFlagForUserURL struct { + Key string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *VariantFeatureFlagForUserURL) WithBasePath(bp string) *VariantFeatureFlagForUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *VariantFeatureFlagForUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *VariantFeatureFlagForUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/feature-flags/user-variant/{key}" + + key := o.Key + if key != "" { + _path = strings.Replace(_path, "{key}", key, -1) + } else { + return nil, errors.New("key is required on VariantFeatureFlagForUserURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *VariantFeatureFlagForUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *VariantFeatureFlagForUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *VariantFeatureFlagForUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on VariantFeatureFlagForUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on VariantFeatureFlagForUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *VariantFeatureFlagForUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go new file mode 100644 index 00000000000..291dd9f6bca --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateGenericMoveDocumentHandlerFunc turns a function with the right signature into a create generic move document handler +type CreateGenericMoveDocumentHandlerFunc func(CreateGenericMoveDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateGenericMoveDocumentHandlerFunc) Handle(params CreateGenericMoveDocumentParams) middleware.Responder { + return fn(params) +} + +// CreateGenericMoveDocumentHandler interface for that can handle valid create generic move document params +type CreateGenericMoveDocumentHandler interface { + Handle(CreateGenericMoveDocumentParams) middleware.Responder +} + +// NewCreateGenericMoveDocument creates a new http.Handler for the create generic move document operation +func NewCreateGenericMoveDocument(ctx *middleware.Context, handler CreateGenericMoveDocumentHandler) *CreateGenericMoveDocument { + return &CreateGenericMoveDocument{Context: ctx, Handler: handler} +} + +/* + CreateGenericMoveDocument swagger:route POST /moves/{moveId}/move_documents move_docs createGenericMoveDocument + +# Creates a move document + +Created a move document with the given information +*/ +type CreateGenericMoveDocument struct { + Context *middleware.Context + Handler CreateGenericMoveDocumentHandler +} + +func (o *CreateGenericMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateGenericMoveDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go new file mode 100644 index 00000000000..4a4d8f96f41 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateGenericMoveDocumentParams creates a new CreateGenericMoveDocumentParams object +// +// There are no default values defined in the spec. +func NewCreateGenericMoveDocumentParams() CreateGenericMoveDocumentParams { + + return CreateGenericMoveDocumentParams{} +} + +// CreateGenericMoveDocumentParams contains all the bound params for the create generic move document operation +// typically these are obtained from a http.Request +// +// swagger:parameters createGenericMoveDocument +type CreateGenericMoveDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateGenericMoveDocumentPayload *internalmessages.CreateGenericMoveDocumentPayload + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateGenericMoveDocumentParams() beforehand. +func (o *CreateGenericMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateGenericMoveDocumentPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createGenericMoveDocumentPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("createGenericMoveDocumentPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateGenericMoveDocumentPayload = &body + } + } + } else { + res = append(res, errors.Required("createGenericMoveDocumentPayload", "body", "")) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *CreateGenericMoveDocumentParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *CreateGenericMoveDocumentParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go new file mode 100644 index 00000000000..5262c989a59 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateGenericMoveDocumentOKCode is the HTTP code returned for type CreateGenericMoveDocumentOK +const CreateGenericMoveDocumentOKCode int = 200 + +/* +CreateGenericMoveDocumentOK returns new move document object + +swagger:response createGenericMoveDocumentOK +*/ +type CreateGenericMoveDocumentOK struct { + + /* + In: Body + */ + Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` +} + +// NewCreateGenericMoveDocumentOK creates CreateGenericMoveDocumentOK with default headers values +func NewCreateGenericMoveDocumentOK() *CreateGenericMoveDocumentOK { + + return &CreateGenericMoveDocumentOK{} +} + +// WithPayload adds the payload to the create generic move document o k response +func (o *CreateGenericMoveDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *CreateGenericMoveDocumentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create generic move document o k response +func (o *CreateGenericMoveDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateGenericMoveDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateGenericMoveDocumentBadRequestCode is the HTTP code returned for type CreateGenericMoveDocumentBadRequest +const CreateGenericMoveDocumentBadRequestCode int = 400 + +/* +CreateGenericMoveDocumentBadRequest invalid request + +swagger:response createGenericMoveDocumentBadRequest +*/ +type CreateGenericMoveDocumentBadRequest struct { +} + +// NewCreateGenericMoveDocumentBadRequest creates CreateGenericMoveDocumentBadRequest with default headers values +func NewCreateGenericMoveDocumentBadRequest() *CreateGenericMoveDocumentBadRequest { + + return &CreateGenericMoveDocumentBadRequest{} +} + +// WriteResponse to the client +func (o *CreateGenericMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateGenericMoveDocumentUnauthorizedCode is the HTTP code returned for type CreateGenericMoveDocumentUnauthorized +const CreateGenericMoveDocumentUnauthorizedCode int = 401 + +/* +CreateGenericMoveDocumentUnauthorized must be authenticated to use this endpoint + +swagger:response createGenericMoveDocumentUnauthorized +*/ +type CreateGenericMoveDocumentUnauthorized struct { +} + +// NewCreateGenericMoveDocumentUnauthorized creates CreateGenericMoveDocumentUnauthorized with default headers values +func NewCreateGenericMoveDocumentUnauthorized() *CreateGenericMoveDocumentUnauthorized { + + return &CreateGenericMoveDocumentUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateGenericMoveDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateGenericMoveDocumentForbiddenCode is the HTTP code returned for type CreateGenericMoveDocumentForbidden +const CreateGenericMoveDocumentForbiddenCode int = 403 + +/* +CreateGenericMoveDocumentForbidden not authorized to modify this move + +swagger:response createGenericMoveDocumentForbidden +*/ +type CreateGenericMoveDocumentForbidden struct { +} + +// NewCreateGenericMoveDocumentForbidden creates CreateGenericMoveDocumentForbidden with default headers values +func NewCreateGenericMoveDocumentForbidden() *CreateGenericMoveDocumentForbidden { + + return &CreateGenericMoveDocumentForbidden{} +} + +// WriteResponse to the client +func (o *CreateGenericMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateGenericMoveDocumentInternalServerErrorCode is the HTTP code returned for type CreateGenericMoveDocumentInternalServerError +const CreateGenericMoveDocumentInternalServerErrorCode int = 500 + +/* +CreateGenericMoveDocumentInternalServerError server error + +swagger:response createGenericMoveDocumentInternalServerError +*/ +type CreateGenericMoveDocumentInternalServerError struct { +} + +// NewCreateGenericMoveDocumentInternalServerError creates CreateGenericMoveDocumentInternalServerError with default headers values +func NewCreateGenericMoveDocumentInternalServerError() *CreateGenericMoveDocumentInternalServerError { + + return &CreateGenericMoveDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateGenericMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go new file mode 100644 index 00000000000..348086ac660 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_generic_move_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateGenericMoveDocumentURL generates an URL for the create generic move document operation +type CreateGenericMoveDocumentURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateGenericMoveDocumentURL) WithBasePath(bp string) *CreateGenericMoveDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateGenericMoveDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateGenericMoveDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/move_documents" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on CreateGenericMoveDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateGenericMoveDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateGenericMoveDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateGenericMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateGenericMoveDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateGenericMoveDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateGenericMoveDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go new file mode 100644 index 00000000000..f0bf44d24a0 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateWeightTicketDocumentHandlerFunc turns a function with the right signature into a create weight ticket document handler +type CreateWeightTicketDocumentHandlerFunc func(CreateWeightTicketDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateWeightTicketDocumentHandlerFunc) Handle(params CreateWeightTicketDocumentParams) middleware.Responder { + return fn(params) +} + +// CreateWeightTicketDocumentHandler interface for that can handle valid create weight ticket document params +type CreateWeightTicketDocumentHandler interface { + Handle(CreateWeightTicketDocumentParams) middleware.Responder +} + +// NewCreateWeightTicketDocument creates a new http.Handler for the create weight ticket document operation +func NewCreateWeightTicketDocument(ctx *middleware.Context, handler CreateWeightTicketDocumentHandler) *CreateWeightTicketDocument { + return &CreateWeightTicketDocument{Context: ctx, Handler: handler} +} + +/* + CreateWeightTicketDocument swagger:route POST /moves/{moveId}/weight_ticket move_docs createWeightTicketDocument + +# Creates a weight ticket document + +Created a weight ticket document with the given information +*/ +type CreateWeightTicketDocument struct { + Context *middleware.Context + Handler CreateWeightTicketDocumentHandler +} + +func (o *CreateWeightTicketDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateWeightTicketDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go new file mode 100644 index 00000000000..3d35b7be77d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateWeightTicketDocumentParams creates a new CreateWeightTicketDocumentParams object +// +// There are no default values defined in the spec. +func NewCreateWeightTicketDocumentParams() CreateWeightTicketDocumentParams { + + return CreateWeightTicketDocumentParams{} +} + +// CreateWeightTicketDocumentParams contains all the bound params for the create weight ticket document operation +// typically these are obtained from a http.Request +// +// swagger:parameters createWeightTicketDocument +type CreateWeightTicketDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateWeightTicketDocument *internalmessages.CreateWeightTicketDocumentsPayload + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateWeightTicketDocumentParams() beforehand. +func (o *CreateWeightTicketDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateWeightTicketDocumentsPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createWeightTicketDocument", "body", "")) + } else { + res = append(res, errors.NewParseError("createWeightTicketDocument", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateWeightTicketDocument = &body + } + } + } else { + res = append(res, errors.Required("createWeightTicketDocument", "body", "")) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *CreateWeightTicketDocumentParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *CreateWeightTicketDocumentParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go new file mode 100644 index 00000000000..21bbf9c2f9f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateWeightTicketDocumentOKCode is the HTTP code returned for type CreateWeightTicketDocumentOK +const CreateWeightTicketDocumentOKCode int = 200 + +/* +CreateWeightTicketDocumentOK returns new weight ticket document object + +swagger:response createWeightTicketDocumentOK +*/ +type CreateWeightTicketDocumentOK struct { + + /* + In: Body + */ + Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` +} + +// NewCreateWeightTicketDocumentOK creates CreateWeightTicketDocumentOK with default headers values +func NewCreateWeightTicketDocumentOK() *CreateWeightTicketDocumentOK { + + return &CreateWeightTicketDocumentOK{} +} + +// WithPayload adds the payload to the create weight ticket document o k response +func (o *CreateWeightTicketDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *CreateWeightTicketDocumentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket document o k response +func (o *CreateWeightTicketDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketDocumentBadRequestCode is the HTTP code returned for type CreateWeightTicketDocumentBadRequest +const CreateWeightTicketDocumentBadRequestCode int = 400 + +/* +CreateWeightTicketDocumentBadRequest invalid request + +swagger:response createWeightTicketDocumentBadRequest +*/ +type CreateWeightTicketDocumentBadRequest struct { +} + +// NewCreateWeightTicketDocumentBadRequest creates CreateWeightTicketDocumentBadRequest with default headers values +func NewCreateWeightTicketDocumentBadRequest() *CreateWeightTicketDocumentBadRequest { + + return &CreateWeightTicketDocumentBadRequest{} +} + +// WriteResponse to the client +func (o *CreateWeightTicketDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateWeightTicketDocumentUnauthorizedCode is the HTTP code returned for type CreateWeightTicketDocumentUnauthorized +const CreateWeightTicketDocumentUnauthorizedCode int = 401 + +/* +CreateWeightTicketDocumentUnauthorized must be authenticated to use this endpoint + +swagger:response createWeightTicketDocumentUnauthorized +*/ +type CreateWeightTicketDocumentUnauthorized struct { +} + +// NewCreateWeightTicketDocumentUnauthorized creates CreateWeightTicketDocumentUnauthorized with default headers values +func NewCreateWeightTicketDocumentUnauthorized() *CreateWeightTicketDocumentUnauthorized { + + return &CreateWeightTicketDocumentUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateWeightTicketDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateWeightTicketDocumentForbiddenCode is the HTTP code returned for type CreateWeightTicketDocumentForbidden +const CreateWeightTicketDocumentForbiddenCode int = 403 + +/* +CreateWeightTicketDocumentForbidden not authorized to modify this move + +swagger:response createWeightTicketDocumentForbidden +*/ +type CreateWeightTicketDocumentForbidden struct { +} + +// NewCreateWeightTicketDocumentForbidden creates CreateWeightTicketDocumentForbidden with default headers values +func NewCreateWeightTicketDocumentForbidden() *CreateWeightTicketDocumentForbidden { + + return &CreateWeightTicketDocumentForbidden{} +} + +// WriteResponse to the client +func (o *CreateWeightTicketDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateWeightTicketDocumentInternalServerErrorCode is the HTTP code returned for type CreateWeightTicketDocumentInternalServerError +const CreateWeightTicketDocumentInternalServerErrorCode int = 500 + +/* +CreateWeightTicketDocumentInternalServerError server error + +swagger:response createWeightTicketDocumentInternalServerError +*/ +type CreateWeightTicketDocumentInternalServerError struct { +} + +// NewCreateWeightTicketDocumentInternalServerError creates CreateWeightTicketDocumentInternalServerError with default headers values +func NewCreateWeightTicketDocumentInternalServerError() *CreateWeightTicketDocumentInternalServerError { + + return &CreateWeightTicketDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateWeightTicketDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go new file mode 100644 index 00000000000..c6f07e80653 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/create_weight_ticket_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateWeightTicketDocumentURL generates an URL for the create weight ticket document operation +type CreateWeightTicketDocumentURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWeightTicketDocumentURL) WithBasePath(bp string) *CreateWeightTicketDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWeightTicketDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateWeightTicketDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/weight_ticket" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on CreateWeightTicketDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateWeightTicketDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateWeightTicketDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateWeightTicketDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateWeightTicketDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateWeightTicketDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateWeightTicketDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go new file mode 100644 index 00000000000..526ee9631da --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteMoveDocumentHandlerFunc turns a function with the right signature into a delete move document handler +type DeleteMoveDocumentHandlerFunc func(DeleteMoveDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteMoveDocumentHandlerFunc) Handle(params DeleteMoveDocumentParams) middleware.Responder { + return fn(params) +} + +// DeleteMoveDocumentHandler interface for that can handle valid delete move document params +type DeleteMoveDocumentHandler interface { + Handle(DeleteMoveDocumentParams) middleware.Responder +} + +// NewDeleteMoveDocument creates a new http.Handler for the delete move document operation +func NewDeleteMoveDocument(ctx *middleware.Context, handler DeleteMoveDocumentHandler) *DeleteMoveDocument { + return &DeleteMoveDocument{Context: ctx, Handler: handler} +} + +/* + DeleteMoveDocument swagger:route DELETE /move_documents/{moveDocumentId} move_docs deleteMoveDocument + +# Deletes a move document + +Deletes a move document with the given information +*/ +type DeleteMoveDocument struct { + Context *middleware.Context + Handler DeleteMoveDocumentHandler +} + +func (o *DeleteMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteMoveDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go new file mode 100644 index 00000000000..94f1840ea72 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteMoveDocumentParams creates a new DeleteMoveDocumentParams object +// +// There are no default values defined in the spec. +func NewDeleteMoveDocumentParams() DeleteMoveDocumentParams { + + return DeleteMoveDocumentParams{} +} + +// DeleteMoveDocumentParams contains all the bound params for the delete move document operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteMoveDocument +type DeleteMoveDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move document model + Required: true + In: path + */ + MoveDocumentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteMoveDocumentParams() beforehand. +func (o *DeleteMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveDocumentID, rhkMoveDocumentID, _ := route.Params.GetOK("moveDocumentId") + if err := o.bindMoveDocumentID(rMoveDocumentID, rhkMoveDocumentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveDocumentID binds and validates parameter MoveDocumentID from path. +func (o *DeleteMoveDocumentParams) bindMoveDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveDocumentId", "path", "strfmt.UUID", raw) + } + o.MoveDocumentID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveDocumentID carries on validations for parameter MoveDocumentID +func (o *DeleteMoveDocumentParams) validateMoveDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveDocumentId", "path", "uuid", o.MoveDocumentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go new file mode 100644 index 00000000000..1ef2bb42157 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteMoveDocumentNoContentCode is the HTTP code returned for type DeleteMoveDocumentNoContent +const DeleteMoveDocumentNoContentCode int = 204 + +/* +DeleteMoveDocumentNoContent deleted + +swagger:response deleteMoveDocumentNoContent +*/ +type DeleteMoveDocumentNoContent struct { +} + +// NewDeleteMoveDocumentNoContent creates DeleteMoveDocumentNoContent with default headers values +func NewDeleteMoveDocumentNoContent() *DeleteMoveDocumentNoContent { + + return &DeleteMoveDocumentNoContent{} +} + +// WriteResponse to the client +func (o *DeleteMoveDocumentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteMoveDocumentBadRequestCode is the HTTP code returned for type DeleteMoveDocumentBadRequest +const DeleteMoveDocumentBadRequestCode int = 400 + +/* +DeleteMoveDocumentBadRequest invalid request + +swagger:response deleteMoveDocumentBadRequest +*/ +type DeleteMoveDocumentBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewDeleteMoveDocumentBadRequest creates DeleteMoveDocumentBadRequest with default headers values +func NewDeleteMoveDocumentBadRequest() *DeleteMoveDocumentBadRequest { + + return &DeleteMoveDocumentBadRequest{} +} + +// WithPayload adds the payload to the delete move document bad request response +func (o *DeleteMoveDocumentBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteMoveDocumentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete move document bad request response +func (o *DeleteMoveDocumentBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMoveDocumentForbiddenCode is the HTTP code returned for type DeleteMoveDocumentForbidden +const DeleteMoveDocumentForbiddenCode int = 403 + +/* +DeleteMoveDocumentForbidden not authorized + +swagger:response deleteMoveDocumentForbidden +*/ +type DeleteMoveDocumentForbidden struct { +} + +// NewDeleteMoveDocumentForbidden creates DeleteMoveDocumentForbidden with default headers values +func NewDeleteMoveDocumentForbidden() *DeleteMoveDocumentForbidden { + + return &DeleteMoveDocumentForbidden{} +} + +// WriteResponse to the client +func (o *DeleteMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// DeleteMoveDocumentNotFoundCode is the HTTP code returned for type DeleteMoveDocumentNotFound +const DeleteMoveDocumentNotFoundCode int = 404 + +/* +DeleteMoveDocumentNotFound not found + +swagger:response deleteMoveDocumentNotFound +*/ +type DeleteMoveDocumentNotFound struct { +} + +// NewDeleteMoveDocumentNotFound creates DeleteMoveDocumentNotFound with default headers values +func NewDeleteMoveDocumentNotFound() *DeleteMoveDocumentNotFound { + + return &DeleteMoveDocumentNotFound{} +} + +// WriteResponse to the client +func (o *DeleteMoveDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DeleteMoveDocumentInternalServerErrorCode is the HTTP code returned for type DeleteMoveDocumentInternalServerError +const DeleteMoveDocumentInternalServerErrorCode int = 500 + +/* +DeleteMoveDocumentInternalServerError server error + +swagger:response deleteMoveDocumentInternalServerError +*/ +type DeleteMoveDocumentInternalServerError struct { +} + +// NewDeleteMoveDocumentInternalServerError creates DeleteMoveDocumentInternalServerError with default headers values +func NewDeleteMoveDocumentInternalServerError() *DeleteMoveDocumentInternalServerError { + + return &DeleteMoveDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *DeleteMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go new file mode 100644 index 00000000000..b567974a3b7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/delete_move_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteMoveDocumentURL generates an URL for the delete move document operation +type DeleteMoveDocumentURL struct { + MoveDocumentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMoveDocumentURL) WithBasePath(bp string) *DeleteMoveDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMoveDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteMoveDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_documents/{moveDocumentId}" + + moveDocumentID := o.MoveDocumentID.String() + if moveDocumentID != "" { + _path = strings.Replace(_path, "{moveDocumentId}", moveDocumentID, -1) + } else { + return nil, errors.New("moveDocumentId is required on DeleteMoveDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteMoveDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteMoveDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteMoveDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteMoveDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteMoveDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go new file mode 100644 index 00000000000..35fe97d34bd --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// IndexMoveDocumentsHandlerFunc turns a function with the right signature into a index move documents handler +type IndexMoveDocumentsHandlerFunc func(IndexMoveDocumentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IndexMoveDocumentsHandlerFunc) Handle(params IndexMoveDocumentsParams) middleware.Responder { + return fn(params) +} + +// IndexMoveDocumentsHandler interface for that can handle valid index move documents params +type IndexMoveDocumentsHandler interface { + Handle(IndexMoveDocumentsParams) middleware.Responder +} + +// NewIndexMoveDocuments creates a new http.Handler for the index move documents operation +func NewIndexMoveDocuments(ctx *middleware.Context, handler IndexMoveDocumentsHandler) *IndexMoveDocuments { + return &IndexMoveDocuments{Context: ctx, Handler: handler} +} + +/* + IndexMoveDocuments swagger:route GET /moves/{moveId}/move_documents move_docs indexMoveDocuments + +# Returns a list of all Move Documents associated with this move + +Returns a list of all Move Documents associated with this move +*/ +type IndexMoveDocuments struct { + Context *middleware.Context + Handler IndexMoveDocumentsHandler +} + +func (o *IndexMoveDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIndexMoveDocumentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go new file mode 100644 index 00000000000..e7df261218e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewIndexMoveDocumentsParams creates a new IndexMoveDocumentsParams object +// +// There are no default values defined in the spec. +func NewIndexMoveDocumentsParams() IndexMoveDocumentsParams { + + return IndexMoveDocumentsParams{} +} + +// IndexMoveDocumentsParams contains all the bound params for the index move documents operation +// typically these are obtained from a http.Request +// +// swagger:parameters indexMoveDocuments +type IndexMoveDocumentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIndexMoveDocumentsParams() beforehand. +func (o *IndexMoveDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *IndexMoveDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *IndexMoveDocumentsParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go new file mode 100644 index 00000000000..4fce27ccd9b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_responses.go @@ -0,0 +1,137 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// IndexMoveDocumentsOKCode is the HTTP code returned for type IndexMoveDocumentsOK +const IndexMoveDocumentsOKCode int = 200 + +/* +IndexMoveDocumentsOK returns list of move douments + +swagger:response indexMoveDocumentsOK +*/ +type IndexMoveDocumentsOK struct { + + /* + In: Body + */ + Payload internalmessages.MoveDocuments `json:"body,omitempty"` +} + +// NewIndexMoveDocumentsOK creates IndexMoveDocumentsOK with default headers values +func NewIndexMoveDocumentsOK() *IndexMoveDocumentsOK { + + return &IndexMoveDocumentsOK{} +} + +// WithPayload adds the payload to the index move documents o k response +func (o *IndexMoveDocumentsOK) WithPayload(payload internalmessages.MoveDocuments) *IndexMoveDocumentsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the index move documents o k response +func (o *IndexMoveDocumentsOK) SetPayload(payload internalmessages.MoveDocuments) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IndexMoveDocumentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.MoveDocuments{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// IndexMoveDocumentsBadRequestCode is the HTTP code returned for type IndexMoveDocumentsBadRequest +const IndexMoveDocumentsBadRequestCode int = 400 + +/* +IndexMoveDocumentsBadRequest invalid request + +swagger:response indexMoveDocumentsBadRequest +*/ +type IndexMoveDocumentsBadRequest struct { +} + +// NewIndexMoveDocumentsBadRequest creates IndexMoveDocumentsBadRequest with default headers values +func NewIndexMoveDocumentsBadRequest() *IndexMoveDocumentsBadRequest { + + return &IndexMoveDocumentsBadRequest{} +} + +// WriteResponse to the client +func (o *IndexMoveDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IndexMoveDocumentsUnauthorizedCode is the HTTP code returned for type IndexMoveDocumentsUnauthorized +const IndexMoveDocumentsUnauthorizedCode int = 401 + +/* +IndexMoveDocumentsUnauthorized request requires user authentication + +swagger:response indexMoveDocumentsUnauthorized +*/ +type IndexMoveDocumentsUnauthorized struct { +} + +// NewIndexMoveDocumentsUnauthorized creates IndexMoveDocumentsUnauthorized with default headers values +func NewIndexMoveDocumentsUnauthorized() *IndexMoveDocumentsUnauthorized { + + return &IndexMoveDocumentsUnauthorized{} +} + +// WriteResponse to the client +func (o *IndexMoveDocumentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// IndexMoveDocumentsForbiddenCode is the HTTP code returned for type IndexMoveDocumentsForbidden +const IndexMoveDocumentsForbiddenCode int = 403 + +/* +IndexMoveDocumentsForbidden user is not authorized + +swagger:response indexMoveDocumentsForbidden +*/ +type IndexMoveDocumentsForbidden struct { +} + +// NewIndexMoveDocumentsForbidden creates IndexMoveDocumentsForbidden with default headers values +func NewIndexMoveDocumentsForbidden() *IndexMoveDocumentsForbidden { + + return &IndexMoveDocumentsForbidden{} +} + +// WriteResponse to the client +func (o *IndexMoveDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go new file mode 100644 index 00000000000..216880123b3 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/index_move_documents_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// IndexMoveDocumentsURL generates an URL for the index move documents operation +type IndexMoveDocumentsURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexMoveDocumentsURL) WithBasePath(bp string) *IndexMoveDocumentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IndexMoveDocumentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IndexMoveDocumentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/move_documents" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on IndexMoveDocumentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IndexMoveDocumentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IndexMoveDocumentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IndexMoveDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IndexMoveDocumentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IndexMoveDocumentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IndexMoveDocumentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go new file mode 100644 index 00000000000..77eaf792b1d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMoveDocumentHandlerFunc turns a function with the right signature into a update move document handler +type UpdateMoveDocumentHandlerFunc func(UpdateMoveDocumentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMoveDocumentHandlerFunc) Handle(params UpdateMoveDocumentParams) middleware.Responder { + return fn(params) +} + +// UpdateMoveDocumentHandler interface for that can handle valid update move document params +type UpdateMoveDocumentHandler interface { + Handle(UpdateMoveDocumentParams) middleware.Responder +} + +// NewUpdateMoveDocument creates a new http.Handler for the update move document operation +func NewUpdateMoveDocument(ctx *middleware.Context, handler UpdateMoveDocumentHandler) *UpdateMoveDocument { + return &UpdateMoveDocument{Context: ctx, Handler: handler} +} + +/* + UpdateMoveDocument swagger:route PUT /move_documents/{moveDocumentId} move_docs updateMoveDocument + +# Updates a move document + +Update a move document with the given information +*/ +type UpdateMoveDocument struct { + Context *middleware.Context + Handler UpdateMoveDocumentHandler +} + +func (o *UpdateMoveDocument) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMoveDocumentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go new file mode 100644 index 00000000000..bdf908e7ea5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateMoveDocumentParams creates a new UpdateMoveDocumentParams object +// +// There are no default values defined in the spec. +func NewUpdateMoveDocumentParams() UpdateMoveDocumentParams { + + return UpdateMoveDocumentParams{} +} + +// UpdateMoveDocumentParams contains all the bound params for the update move document operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMoveDocument +type UpdateMoveDocumentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move document model + Required: true + In: path + */ + MoveDocumentID strfmt.UUID + /* + Required: true + In: body + */ + UpdateMoveDocument *internalmessages.MoveDocumentPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMoveDocumentParams() beforehand. +func (o *UpdateMoveDocumentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveDocumentID, rhkMoveDocumentID, _ := route.Params.GetOK("moveDocumentId") + if err := o.bindMoveDocumentID(rMoveDocumentID, rhkMoveDocumentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.MoveDocumentPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateMoveDocument", "body", "")) + } else { + res = append(res, errors.NewParseError("updateMoveDocument", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateMoveDocument = &body + } + } + } else { + res = append(res, errors.Required("updateMoveDocument", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveDocumentID binds and validates parameter MoveDocumentID from path. +func (o *UpdateMoveDocumentParams) bindMoveDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveDocumentId", "path", "strfmt.UUID", raw) + } + o.MoveDocumentID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveDocumentID carries on validations for parameter MoveDocumentID +func (o *UpdateMoveDocumentParams) validateMoveDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveDocumentId", "path", "uuid", o.MoveDocumentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go new file mode 100644 index 00000000000..ce4832dbb5b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateMoveDocumentOKCode is the HTTP code returned for type UpdateMoveDocumentOK +const UpdateMoveDocumentOKCode int = 200 + +/* +UpdateMoveDocumentOK updated instance of move document + +swagger:response updateMoveDocumentOK +*/ +type UpdateMoveDocumentOK struct { + + /* + In: Body + */ + Payload *internalmessages.MoveDocumentPayload `json:"body,omitempty"` +} + +// NewUpdateMoveDocumentOK creates UpdateMoveDocumentOK with default headers values +func NewUpdateMoveDocumentOK() *UpdateMoveDocumentOK { + + return &UpdateMoveDocumentOK{} +} + +// WithPayload adds the payload to the update move document o k response +func (o *UpdateMoveDocumentOK) WithPayload(payload *internalmessages.MoveDocumentPayload) *UpdateMoveDocumentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update move document o k response +func (o *UpdateMoveDocumentOK) SetPayload(payload *internalmessages.MoveDocumentPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMoveDocumentBadRequestCode is the HTTP code returned for type UpdateMoveDocumentBadRequest +const UpdateMoveDocumentBadRequestCode int = 400 + +/* +UpdateMoveDocumentBadRequest invalid request + +swagger:response updateMoveDocumentBadRequest +*/ +type UpdateMoveDocumentBadRequest struct { +} + +// NewUpdateMoveDocumentBadRequest creates UpdateMoveDocumentBadRequest with default headers values +func NewUpdateMoveDocumentBadRequest() *UpdateMoveDocumentBadRequest { + + return &UpdateMoveDocumentBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateMoveDocumentUnauthorizedCode is the HTTP code returned for type UpdateMoveDocumentUnauthorized +const UpdateMoveDocumentUnauthorizedCode int = 401 + +/* +UpdateMoveDocumentUnauthorized request requires user authentication + +swagger:response updateMoveDocumentUnauthorized +*/ +type UpdateMoveDocumentUnauthorized struct { +} + +// NewUpdateMoveDocumentUnauthorized creates UpdateMoveDocumentUnauthorized with default headers values +func NewUpdateMoveDocumentUnauthorized() *UpdateMoveDocumentUnauthorized { + + return &UpdateMoveDocumentUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateMoveDocumentForbiddenCode is the HTTP code returned for type UpdateMoveDocumentForbidden +const UpdateMoveDocumentForbiddenCode int = 403 + +/* +UpdateMoveDocumentForbidden user is not authorized + +swagger:response updateMoveDocumentForbidden +*/ +type UpdateMoveDocumentForbidden struct { +} + +// NewUpdateMoveDocumentForbidden creates UpdateMoveDocumentForbidden with default headers values +func NewUpdateMoveDocumentForbidden() *UpdateMoveDocumentForbidden { + + return &UpdateMoveDocumentForbidden{} +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateMoveDocumentNotFoundCode is the HTTP code returned for type UpdateMoveDocumentNotFound +const UpdateMoveDocumentNotFoundCode int = 404 + +/* +UpdateMoveDocumentNotFound move document not found + +swagger:response updateMoveDocumentNotFound +*/ +type UpdateMoveDocumentNotFound struct { +} + +// NewUpdateMoveDocumentNotFound creates UpdateMoveDocumentNotFound with default headers values +func NewUpdateMoveDocumentNotFound() *UpdateMoveDocumentNotFound { + + return &UpdateMoveDocumentNotFound{} +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateMoveDocumentInternalServerErrorCode is the HTTP code returned for type UpdateMoveDocumentInternalServerError +const UpdateMoveDocumentInternalServerErrorCode int = 500 + +/* +UpdateMoveDocumentInternalServerError internal server error + +swagger:response updateMoveDocumentInternalServerError +*/ +type UpdateMoveDocumentInternalServerError struct { +} + +// NewUpdateMoveDocumentInternalServerError creates UpdateMoveDocumentInternalServerError with default headers values +func NewUpdateMoveDocumentInternalServerError() *UpdateMoveDocumentInternalServerError { + + return &UpdateMoveDocumentInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateMoveDocumentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go new file mode 100644 index 00000000000..ae05835d421 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/move_docs/update_move_document_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_docs + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMoveDocumentURL generates an URL for the update move document operation +type UpdateMoveDocumentURL struct { + MoveDocumentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveDocumentURL) WithBasePath(bp string) *UpdateMoveDocumentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMoveDocumentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMoveDocumentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move_documents/{moveDocumentId}" + + moveDocumentID := o.MoveDocumentID.String() + if moveDocumentID != "" { + _path = strings.Replace(_path, "{moveDocumentId}", moveDocumentID, -1) + } else { + return nil, errors.New("moveDocumentId is required on UpdateMoveDocumentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMoveDocumentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMoveDocumentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMoveDocumentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMoveDocumentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMoveDocumentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMoveDocumentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go new file mode 100644 index 00000000000..709a9bb4dee --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetAllMovesHandlerFunc turns a function with the right signature into a get all moves handler +type GetAllMovesHandlerFunc func(GetAllMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetAllMovesHandlerFunc) Handle(params GetAllMovesParams) middleware.Responder { + return fn(params) +} + +// GetAllMovesHandler interface for that can handle valid get all moves params +type GetAllMovesHandler interface { + Handle(GetAllMovesParams) middleware.Responder +} + +// NewGetAllMoves creates a new http.Handler for the get all moves operation +func NewGetAllMoves(ctx *middleware.Context, handler GetAllMovesHandler) *GetAllMoves { + return &GetAllMoves{Context: ctx, Handler: handler} +} + +/* + GetAllMoves swagger:route GET /allmoves/{serviceMemberId} moves getAllMoves + +# Return the current and previous moves of a service member + +This endpoint gets all moves that belongs to the serviceMember by using the service members id. In a previous moves array and the current move in the current move array. The current move is the move with the latest CreatedAt date. All other moves will go into the previous move array. +*/ +type GetAllMoves struct { + Context *middleware.Context + Handler GetAllMovesHandler +} + +func (o *GetAllMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetAllMovesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go new file mode 100644 index 00000000000..dc7953b2274 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetAllMovesParams creates a new GetAllMovesParams object +// +// There are no default values defined in the spec. +func NewGetAllMovesParams() GetAllMovesParams { + + return GetAllMovesParams{} +} + +// GetAllMovesParams contains all the bound params for the get all moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters getAllMoves +type GetAllMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetAllMovesParams() beforehand. +func (o *GetAllMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *GetAllMovesParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *GetAllMovesParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go new file mode 100644 index 00000000000..f6f638eee3f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_responses.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// GetAllMovesOKCode is the HTTP code returned for type GetAllMovesOK +const GetAllMovesOKCode int = 200 + +/* +GetAllMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. + +swagger:response getAllMovesOK +*/ +type GetAllMovesOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovesList `json:"body,omitempty"` +} + +// NewGetAllMovesOK creates GetAllMovesOK with default headers values +func NewGetAllMovesOK() *GetAllMovesOK { + + return &GetAllMovesOK{} +} + +// WithPayload adds the payload to the get all moves o k response +func (o *GetAllMovesOK) WithPayload(payload *internalmessages.MovesList) *GetAllMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves o k response +func (o *GetAllMovesOK) SetPayload(payload *internalmessages.MovesList) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllMovesUnauthorizedCode is the HTTP code returned for type GetAllMovesUnauthorized +const GetAllMovesUnauthorizedCode int = 401 + +/* +GetAllMovesUnauthorized The request was denied. + +swagger:response getAllMovesUnauthorized +*/ +type GetAllMovesUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetAllMovesUnauthorized creates GetAllMovesUnauthorized with default headers values +func NewGetAllMovesUnauthorized() *GetAllMovesUnauthorized { + + return &GetAllMovesUnauthorized{} +} + +// WithPayload adds the payload to the get all moves unauthorized response +func (o *GetAllMovesUnauthorized) WithPayload(payload *internalmessages.ClientError) *GetAllMovesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves unauthorized response +func (o *GetAllMovesUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllMovesForbiddenCode is the HTTP code returned for type GetAllMovesForbidden +const GetAllMovesForbiddenCode int = 403 + +/* +GetAllMovesForbidden The request was denied. + +swagger:response getAllMovesForbidden +*/ +type GetAllMovesForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetAllMovesForbidden creates GetAllMovesForbidden with default headers values +func NewGetAllMovesForbidden() *GetAllMovesForbidden { + + return &GetAllMovesForbidden{} +} + +// WithPayload adds the payload to the get all moves forbidden response +func (o *GetAllMovesForbidden) WithPayload(payload *internalmessages.ClientError) *GetAllMovesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves forbidden response +func (o *GetAllMovesForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetAllMovesInternalServerErrorCode is the HTTP code returned for type GetAllMovesInternalServerError +const GetAllMovesInternalServerErrorCode int = 500 + +/* +GetAllMovesInternalServerError A server error occurred. + +swagger:response getAllMovesInternalServerError +*/ +type GetAllMovesInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewGetAllMovesInternalServerError creates GetAllMovesInternalServerError with default headers values +func NewGetAllMovesInternalServerError() *GetAllMovesInternalServerError { + + return &GetAllMovesInternalServerError{} +} + +// WithPayload adds the payload to the get all moves internal server error response +func (o *GetAllMovesInternalServerError) WithPayload(payload *internalmessages.Error) *GetAllMovesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get all moves internal server error response +func (o *GetAllMovesInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetAllMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go new file mode 100644 index 00000000000..ae245e18449 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/get_all_moves_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetAllMovesURL generates an URL for the get all moves operation +type GetAllMovesURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAllMovesURL) WithBasePath(bp string) *GetAllMovesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetAllMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetAllMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/allmoves/{serviceMemberId}" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on GetAllMovesURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetAllMovesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetAllMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetAllMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetAllMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetAllMovesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetAllMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move.go b/pkg/gen/internalapi/internaloperations/moves/patch_move.go new file mode 100644 index 00000000000..89524a5f89d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/patch_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PatchMoveHandlerFunc turns a function with the right signature into a patch move handler +type PatchMoveHandlerFunc func(PatchMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PatchMoveHandlerFunc) Handle(params PatchMoveParams) middleware.Responder { + return fn(params) +} + +// PatchMoveHandler interface for that can handle valid patch move params +type PatchMoveHandler interface { + Handle(PatchMoveParams) middleware.Responder +} + +// NewPatchMove creates a new http.Handler for the patch move operation +func NewPatchMove(ctx *middleware.Context, handler PatchMoveHandler) *PatchMove { + return &PatchMove{Context: ctx, Handler: handler} +} + +/* + PatchMove swagger:route PATCH /moves/{moveId} moves patchMove + +# Patches the move + +Any fields sent in this request will be set on the move referenced +*/ +type PatchMove struct { + Context *middleware.Context + Handler PatchMoveHandler +} + +func (o *PatchMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewPatchMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go new file mode 100644 index 00000000000..b839533060f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/patch_move_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewPatchMoveParams creates a new PatchMoveParams object +// +// There are no default values defined in the spec. +func NewPatchMoveParams() PatchMoveParams { + + return PatchMoveParams{} +} + +// PatchMoveParams contains all the bound params for the patch move operation +// typically these are obtained from a http.Request +// +// swagger:parameters patchMove +type PatchMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID + /* + Required: true + In: body + */ + PatchMovePayload *internalmessages.PatchMovePayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPatchMoveParams() beforehand. +func (o *PatchMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.PatchMovePayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("patchMovePayload", "body", "")) + } else { + res = append(res, errors.NewParseError("patchMovePayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.PatchMovePayload = &body + } + } + } else { + res = append(res, errors.Required("patchMovePayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *PatchMoveParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *PatchMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *PatchMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go new file mode 100644 index 00000000000..6106ac7e633 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/patch_move_responses.go @@ -0,0 +1,234 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// PatchMoveOKCode is the HTTP code returned for type PatchMoveOK +const PatchMoveOKCode int = 200 + +/* +PatchMoveOK updated instance of move + +swagger:response patchMoveOK +*/ +type PatchMoveOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewPatchMoveOK creates PatchMoveOK with default headers values +func NewPatchMoveOK() *PatchMoveOK { + + return &PatchMoveOK{} +} + +// WithPayload adds the payload to the patch move o k response +func (o *PatchMoveOK) WithPayload(payload *internalmessages.MovePayload) *PatchMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the patch move o k response +func (o *PatchMoveOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *PatchMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// PatchMoveBadRequestCode is the HTTP code returned for type PatchMoveBadRequest +const PatchMoveBadRequestCode int = 400 + +/* +PatchMoveBadRequest invalid request + +swagger:response patchMoveBadRequest +*/ +type PatchMoveBadRequest struct { +} + +// NewPatchMoveBadRequest creates PatchMoveBadRequest with default headers values +func NewPatchMoveBadRequest() *PatchMoveBadRequest { + + return &PatchMoveBadRequest{} +} + +// WriteResponse to the client +func (o *PatchMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PatchMoveUnauthorizedCode is the HTTP code returned for type PatchMoveUnauthorized +const PatchMoveUnauthorizedCode int = 401 + +/* +PatchMoveUnauthorized request requires user authentication + +swagger:response patchMoveUnauthorized +*/ +type PatchMoveUnauthorized struct { +} + +// NewPatchMoveUnauthorized creates PatchMoveUnauthorized with default headers values +func NewPatchMoveUnauthorized() *PatchMoveUnauthorized { + + return &PatchMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *PatchMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// PatchMoveForbiddenCode is the HTTP code returned for type PatchMoveForbidden +const PatchMoveForbiddenCode int = 403 + +/* +PatchMoveForbidden user is not authorized + +swagger:response patchMoveForbidden +*/ +type PatchMoveForbidden struct { +} + +// NewPatchMoveForbidden creates PatchMoveForbidden with default headers values +func NewPatchMoveForbidden() *PatchMoveForbidden { + + return &PatchMoveForbidden{} +} + +// WriteResponse to the client +func (o *PatchMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// PatchMoveNotFoundCode is the HTTP code returned for type PatchMoveNotFound +const PatchMoveNotFoundCode int = 404 + +/* +PatchMoveNotFound move or closeout office is not found + +swagger:response patchMoveNotFound +*/ +type PatchMoveNotFound struct { +} + +// NewPatchMoveNotFound creates PatchMoveNotFound with default headers values +func NewPatchMoveNotFound() *PatchMoveNotFound { + + return &PatchMoveNotFound{} +} + +// WriteResponse to the client +func (o *PatchMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// PatchMovePreconditionFailedCode is the HTTP code returned for type PatchMovePreconditionFailed +const PatchMovePreconditionFailedCode int = 412 + +/* +PatchMovePreconditionFailed precondition failed + +swagger:response patchMovePreconditionFailed +*/ +type PatchMovePreconditionFailed struct { +} + +// NewPatchMovePreconditionFailed creates PatchMovePreconditionFailed with default headers values +func NewPatchMovePreconditionFailed() *PatchMovePreconditionFailed { + + return &PatchMovePreconditionFailed{} +} + +// WriteResponse to the client +func (o *PatchMovePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(412) +} + +// PatchMoveUnprocessableEntityCode is the HTTP code returned for type PatchMoveUnprocessableEntity +const PatchMoveUnprocessableEntityCode int = 422 + +/* +PatchMoveUnprocessableEntity unprocessable entity + +swagger:response patchMoveUnprocessableEntity +*/ +type PatchMoveUnprocessableEntity struct { +} + +// NewPatchMoveUnprocessableEntity creates PatchMoveUnprocessableEntity with default headers values +func NewPatchMoveUnprocessableEntity() *PatchMoveUnprocessableEntity { + + return &PatchMoveUnprocessableEntity{} +} + +// WriteResponse to the client +func (o *PatchMoveUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(422) +} + +// PatchMoveInternalServerErrorCode is the HTTP code returned for type PatchMoveInternalServerError +const PatchMoveInternalServerErrorCode int = 500 + +/* +PatchMoveInternalServerError internal server error + +swagger:response patchMoveInternalServerError +*/ +type PatchMoveInternalServerError struct { +} + +// NewPatchMoveInternalServerError creates PatchMoveInternalServerError with default headers values +func NewPatchMoveInternalServerError() *PatchMoveInternalServerError { + + return &PatchMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *PatchMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go new file mode 100644 index 00000000000..6c6e9733eb5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/patch_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// PatchMoveURL generates an URL for the patch move operation +type PatchMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PatchMoveURL) WithBasePath(bp string) *PatchMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PatchMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PatchMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on PatchMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PatchMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PatchMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PatchMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PatchMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PatchMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PatchMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move.go b/pkg/gen/internalapi/internaloperations/moves/show_move.go new file mode 100644 index 00000000000..ff8783ab91e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/show_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowMoveHandlerFunc turns a function with the right signature into a show move handler +type ShowMoveHandlerFunc func(ShowMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowMoveHandlerFunc) Handle(params ShowMoveParams) middleware.Responder { + return fn(params) +} + +// ShowMoveHandler interface for that can handle valid show move params +type ShowMoveHandler interface { + Handle(ShowMoveParams) middleware.Responder +} + +// NewShowMove creates a new http.Handler for the show move operation +func NewShowMove(ctx *middleware.Context, handler ShowMoveHandler) *ShowMove { + return &ShowMove{Context: ctx, Handler: handler} +} + +/* + ShowMove swagger:route GET /moves/{moveId} moves showMove + +# Returns the given move + +Returns the given move +*/ +type ShowMove struct { + Context *middleware.Context + Handler ShowMoveHandler +} + +func (o *ShowMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go b/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go new file mode 100644 index 00000000000..6cbdda9ec18 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/show_move_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowMoveParams creates a new ShowMoveParams object +// +// There are no default values defined in the spec. +func NewShowMoveParams() ShowMoveParams { + + return ShowMoveParams{} +} + +// ShowMoveParams contains all the bound params for the show move operation +// typically these are obtained from a http.Request +// +// swagger:parameters showMove +type ShowMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowMoveParams() beforehand. +func (o *ShowMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *ShowMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *ShowMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go b/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go new file mode 100644 index 00000000000..402f7b03f76 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/show_move_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowMoveOKCode is the HTTP code returned for type ShowMoveOK +const ShowMoveOKCode int = 200 + +/* +ShowMoveOK the instance of the move + +swagger:response showMoveOK +*/ +type ShowMoveOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewShowMoveOK creates ShowMoveOK with default headers values +func NewShowMoveOK() *ShowMoveOK { + + return &ShowMoveOK{} +} + +// WithPayload adds the payload to the show move o k response +func (o *ShowMoveOK) WithPayload(payload *internalmessages.MovePayload) *ShowMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show move o k response +func (o *ShowMoveOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowMoveBadRequestCode is the HTTP code returned for type ShowMoveBadRequest +const ShowMoveBadRequestCode int = 400 + +/* +ShowMoveBadRequest invalid request + +swagger:response showMoveBadRequest +*/ +type ShowMoveBadRequest struct { +} + +// NewShowMoveBadRequest creates ShowMoveBadRequest with default headers values +func NewShowMoveBadRequest() *ShowMoveBadRequest { + + return &ShowMoveBadRequest{} +} + +// WriteResponse to the client +func (o *ShowMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowMoveUnauthorizedCode is the HTTP code returned for type ShowMoveUnauthorized +const ShowMoveUnauthorizedCode int = 401 + +/* +ShowMoveUnauthorized request requires user authentication + +swagger:response showMoveUnauthorized +*/ +type ShowMoveUnauthorized struct { +} + +// NewShowMoveUnauthorized creates ShowMoveUnauthorized with default headers values +func NewShowMoveUnauthorized() *ShowMoveUnauthorized { + + return &ShowMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowMoveForbiddenCode is the HTTP code returned for type ShowMoveForbidden +const ShowMoveForbiddenCode int = 403 + +/* +ShowMoveForbidden user is not authorized + +swagger:response showMoveForbidden +*/ +type ShowMoveForbidden struct { +} + +// NewShowMoveForbidden creates ShowMoveForbidden with default headers values +func NewShowMoveForbidden() *ShowMoveForbidden { + + return &ShowMoveForbidden{} +} + +// WriteResponse to the client +func (o *ShowMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowMoveNotFoundCode is the HTTP code returned for type ShowMoveNotFound +const ShowMoveNotFoundCode int = 404 + +/* +ShowMoveNotFound move is not found + +swagger:response showMoveNotFound +*/ +type ShowMoveNotFound struct { +} + +// NewShowMoveNotFound creates ShowMoveNotFound with default headers values +func NewShowMoveNotFound() *ShowMoveNotFound { + + return &ShowMoveNotFound{} +} + +// WriteResponse to the client +func (o *ShowMoveNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowMoveInternalServerErrorCode is the HTTP code returned for type ShowMoveInternalServerError +const ShowMoveInternalServerErrorCode int = 500 + +/* +ShowMoveInternalServerError internal server error + +swagger:response showMoveInternalServerError +*/ +type ShowMoveInternalServerError struct { +} + +// NewShowMoveInternalServerError creates ShowMoveInternalServerError with default headers values +func NewShowMoveInternalServerError() *ShowMoveInternalServerError { + + return &ShowMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go new file mode 100644 index 00000000000..556f9706c59 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/show_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowMoveURL generates an URL for the show move operation +type ShowMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowMoveURL) WithBasePath(bp string) *ShowMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on ShowMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go new file mode 100644 index 00000000000..83a087601e2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SubmitAmendedOrdersHandlerFunc turns a function with the right signature into a submit amended orders handler +type SubmitAmendedOrdersHandlerFunc func(SubmitAmendedOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SubmitAmendedOrdersHandlerFunc) Handle(params SubmitAmendedOrdersParams) middleware.Responder { + return fn(params) +} + +// SubmitAmendedOrdersHandler interface for that can handle valid submit amended orders params +type SubmitAmendedOrdersHandler interface { + Handle(SubmitAmendedOrdersParams) middleware.Responder +} + +// NewSubmitAmendedOrders creates a new http.Handler for the submit amended orders operation +func NewSubmitAmendedOrders(ctx *middleware.Context, handler SubmitAmendedOrdersHandler) *SubmitAmendedOrders { + return &SubmitAmendedOrders{Context: ctx, Handler: handler} +} + +/* + SubmitAmendedOrders swagger:route POST /moves/{moveId}/submit_amended_orders moves submitAmendedOrders + +# Submits amended orders for review + +Submits amended orders for review by the office. The status of the move will be updated to an appropriate status depending on whether it needs services counseling or not. +*/ +type SubmitAmendedOrders struct { + Context *middleware.Context + Handler SubmitAmendedOrdersHandler +} + +func (o *SubmitAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSubmitAmendedOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go new file mode 100644 index 00000000000..6af6b5021f8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewSubmitAmendedOrdersParams creates a new SubmitAmendedOrdersParams object +// +// There are no default values defined in the spec. +func NewSubmitAmendedOrdersParams() SubmitAmendedOrdersParams { + + return SubmitAmendedOrdersParams{} +} + +// SubmitAmendedOrdersParams contains all the bound params for the submit amended orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters submitAmendedOrders +type SubmitAmendedOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSubmitAmendedOrdersParams() beforehand. +func (o *SubmitAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *SubmitAmendedOrdersParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *SubmitAmendedOrdersParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go new file mode 100644 index 00000000000..1718447db19 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// SubmitAmendedOrdersOKCode is the HTTP code returned for type SubmitAmendedOrdersOK +const SubmitAmendedOrdersOKCode int = 200 + +/* +SubmitAmendedOrdersOK returns updated (submitted) move object + +swagger:response submitAmendedOrdersOK +*/ +type SubmitAmendedOrdersOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewSubmitAmendedOrdersOK creates SubmitAmendedOrdersOK with default headers values +func NewSubmitAmendedOrdersOK() *SubmitAmendedOrdersOK { + + return &SubmitAmendedOrdersOK{} +} + +// WithPayload adds the payload to the submit amended orders o k response +func (o *SubmitAmendedOrdersOK) WithPayload(payload *internalmessages.MovePayload) *SubmitAmendedOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit amended orders o k response +func (o *SubmitAmendedOrdersOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitAmendedOrdersBadRequestCode is the HTTP code returned for type SubmitAmendedOrdersBadRequest +const SubmitAmendedOrdersBadRequestCode int = 400 + +/* +SubmitAmendedOrdersBadRequest invalid request + +swagger:response submitAmendedOrdersBadRequest +*/ +type SubmitAmendedOrdersBadRequest struct { +} + +// NewSubmitAmendedOrdersBadRequest creates SubmitAmendedOrdersBadRequest with default headers values +func NewSubmitAmendedOrdersBadRequest() *SubmitAmendedOrdersBadRequest { + + return &SubmitAmendedOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// SubmitAmendedOrdersUnauthorizedCode is the HTTP code returned for type SubmitAmendedOrdersUnauthorized +const SubmitAmendedOrdersUnauthorizedCode int = 401 + +/* +SubmitAmendedOrdersUnauthorized must be authenticated to use this endpoint + +swagger:response submitAmendedOrdersUnauthorized +*/ +type SubmitAmendedOrdersUnauthorized struct { +} + +// NewSubmitAmendedOrdersUnauthorized creates SubmitAmendedOrdersUnauthorized with default headers values +func NewSubmitAmendedOrdersUnauthorized() *SubmitAmendedOrdersUnauthorized { + + return &SubmitAmendedOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// SubmitAmendedOrdersForbiddenCode is the HTTP code returned for type SubmitAmendedOrdersForbidden +const SubmitAmendedOrdersForbiddenCode int = 403 + +/* +SubmitAmendedOrdersForbidden not authorized to approve this move + +swagger:response submitAmendedOrdersForbidden +*/ +type SubmitAmendedOrdersForbidden struct { +} + +// NewSubmitAmendedOrdersForbidden creates SubmitAmendedOrdersForbidden with default headers values +func NewSubmitAmendedOrdersForbidden() *SubmitAmendedOrdersForbidden { + + return &SubmitAmendedOrdersForbidden{} +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// SubmitAmendedOrdersConflictCode is the HTTP code returned for type SubmitAmendedOrdersConflict +const SubmitAmendedOrdersConflictCode int = 409 + +/* +SubmitAmendedOrdersConflict the move is not in a state to be approved + +swagger:response submitAmendedOrdersConflict +*/ +type SubmitAmendedOrdersConflict struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewSubmitAmendedOrdersConflict creates SubmitAmendedOrdersConflict with default headers values +func NewSubmitAmendedOrdersConflict() *SubmitAmendedOrdersConflict { + + return &SubmitAmendedOrdersConflict{} +} + +// WithPayload adds the payload to the submit amended orders conflict response +func (o *SubmitAmendedOrdersConflict) WithPayload(payload *internalmessages.MovePayload) *SubmitAmendedOrdersConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit amended orders conflict response +func (o *SubmitAmendedOrdersConflict) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitAmendedOrdersInternalServerErrorCode is the HTTP code returned for type SubmitAmendedOrdersInternalServerError +const SubmitAmendedOrdersInternalServerErrorCode int = 500 + +/* +SubmitAmendedOrdersInternalServerError server error + +swagger:response submitAmendedOrdersInternalServerError +*/ +type SubmitAmendedOrdersInternalServerError struct { +} + +// NewSubmitAmendedOrdersInternalServerError creates SubmitAmendedOrdersInternalServerError with default headers values +func NewSubmitAmendedOrdersInternalServerError() *SubmitAmendedOrdersInternalServerError { + + return &SubmitAmendedOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *SubmitAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go new file mode 100644 index 00000000000..5b2a3aa8747 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_amended_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SubmitAmendedOrdersURL generates an URL for the submit amended orders operation +type SubmitAmendedOrdersURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitAmendedOrdersURL) WithBasePath(bp string) *SubmitAmendedOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitAmendedOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SubmitAmendedOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/submit_amended_orders" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on SubmitAmendedOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SubmitAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SubmitAmendedOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SubmitAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SubmitAmendedOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SubmitAmendedOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SubmitAmendedOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go new file mode 100644 index 00000000000..73f4579395b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SubmitMoveForApprovalHandlerFunc turns a function with the right signature into a submit move for approval handler +type SubmitMoveForApprovalHandlerFunc func(SubmitMoveForApprovalParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SubmitMoveForApprovalHandlerFunc) Handle(params SubmitMoveForApprovalParams) middleware.Responder { + return fn(params) +} + +// SubmitMoveForApprovalHandler interface for that can handle valid submit move for approval params +type SubmitMoveForApprovalHandler interface { + Handle(SubmitMoveForApprovalParams) middleware.Responder +} + +// NewSubmitMoveForApproval creates a new http.Handler for the submit move for approval operation +func NewSubmitMoveForApproval(ctx *middleware.Context, handler SubmitMoveForApprovalHandler) *SubmitMoveForApproval { + return &SubmitMoveForApproval{Context: ctx, Handler: handler} +} + +/* + SubmitMoveForApproval swagger:route POST /moves/{moveId}/submit moves submitMoveForApproval + +# Submits a move for approval + +Submits a move for approval by the office. The status of the move will be updated to SUBMITTED +*/ +type SubmitMoveForApproval struct { + Context *middleware.Context + Handler SubmitMoveForApprovalHandler +} + +func (o *SubmitMoveForApproval) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSubmitMoveForApprovalParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go new file mode 100644 index 00000000000..7fdccbfdc37 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewSubmitMoveForApprovalParams creates a new SubmitMoveForApprovalParams object +// +// There are no default values defined in the spec. +func NewSubmitMoveForApprovalParams() SubmitMoveForApprovalParams { + + return SubmitMoveForApprovalParams{} +} + +// SubmitMoveForApprovalParams contains all the bound params for the submit move for approval operation +// typically these are obtained from a http.Request +// +// swagger:parameters submitMoveForApproval +type SubmitMoveForApprovalParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID + /* + Required: true + In: body + */ + SubmitMoveForApprovalPayload *internalmessages.SubmitMoveForApprovalPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSubmitMoveForApprovalParams() beforehand. +func (o *SubmitMoveForApprovalParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.SubmitMoveForApprovalPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("submitMoveForApprovalPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("submitMoveForApprovalPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.SubmitMoveForApprovalPayload = &body + } + } + } else { + res = append(res, errors.Required("submitMoveForApprovalPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *SubmitMoveForApprovalParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *SubmitMoveForApprovalParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go new file mode 100644 index 00000000000..d19d2065bfa --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// SubmitMoveForApprovalOKCode is the HTTP code returned for type SubmitMoveForApprovalOK +const SubmitMoveForApprovalOKCode int = 200 + +/* +SubmitMoveForApprovalOK returns updated (submitted) move object + +swagger:response submitMoveForApprovalOK +*/ +type SubmitMoveForApprovalOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewSubmitMoveForApprovalOK creates SubmitMoveForApprovalOK with default headers values +func NewSubmitMoveForApprovalOK() *SubmitMoveForApprovalOK { + + return &SubmitMoveForApprovalOK{} +} + +// WithPayload adds the payload to the submit move for approval o k response +func (o *SubmitMoveForApprovalOK) WithPayload(payload *internalmessages.MovePayload) *SubmitMoveForApprovalOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit move for approval o k response +func (o *SubmitMoveForApprovalOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitMoveForApprovalBadRequestCode is the HTTP code returned for type SubmitMoveForApprovalBadRequest +const SubmitMoveForApprovalBadRequestCode int = 400 + +/* +SubmitMoveForApprovalBadRequest invalid request + +swagger:response submitMoveForApprovalBadRequest +*/ +type SubmitMoveForApprovalBadRequest struct { +} + +// NewSubmitMoveForApprovalBadRequest creates SubmitMoveForApprovalBadRequest with default headers values +func NewSubmitMoveForApprovalBadRequest() *SubmitMoveForApprovalBadRequest { + + return &SubmitMoveForApprovalBadRequest{} +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// SubmitMoveForApprovalUnauthorizedCode is the HTTP code returned for type SubmitMoveForApprovalUnauthorized +const SubmitMoveForApprovalUnauthorizedCode int = 401 + +/* +SubmitMoveForApprovalUnauthorized must be authenticated to use this endpoint + +swagger:response submitMoveForApprovalUnauthorized +*/ +type SubmitMoveForApprovalUnauthorized struct { +} + +// NewSubmitMoveForApprovalUnauthorized creates SubmitMoveForApprovalUnauthorized with default headers values +func NewSubmitMoveForApprovalUnauthorized() *SubmitMoveForApprovalUnauthorized { + + return &SubmitMoveForApprovalUnauthorized{} +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// SubmitMoveForApprovalForbiddenCode is the HTTP code returned for type SubmitMoveForApprovalForbidden +const SubmitMoveForApprovalForbiddenCode int = 403 + +/* +SubmitMoveForApprovalForbidden not authorized to approve this move + +swagger:response submitMoveForApprovalForbidden +*/ +type SubmitMoveForApprovalForbidden struct { +} + +// NewSubmitMoveForApprovalForbidden creates SubmitMoveForApprovalForbidden with default headers values +func NewSubmitMoveForApprovalForbidden() *SubmitMoveForApprovalForbidden { + + return &SubmitMoveForApprovalForbidden{} +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// SubmitMoveForApprovalConflictCode is the HTTP code returned for type SubmitMoveForApprovalConflict +const SubmitMoveForApprovalConflictCode int = 409 + +/* +SubmitMoveForApprovalConflict the move is not in a state to be approved + +swagger:response submitMoveForApprovalConflict +*/ +type SubmitMoveForApprovalConflict struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewSubmitMoveForApprovalConflict creates SubmitMoveForApprovalConflict with default headers values +func NewSubmitMoveForApprovalConflict() *SubmitMoveForApprovalConflict { + + return &SubmitMoveForApprovalConflict{} +} + +// WithPayload adds the payload to the submit move for approval conflict response +func (o *SubmitMoveForApprovalConflict) WithPayload(payload *internalmessages.MovePayload) *SubmitMoveForApprovalConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit move for approval conflict response +func (o *SubmitMoveForApprovalConflict) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitMoveForApprovalInternalServerErrorCode is the HTTP code returned for type SubmitMoveForApprovalInternalServerError +const SubmitMoveForApprovalInternalServerErrorCode int = 500 + +/* +SubmitMoveForApprovalInternalServerError server error + +swagger:response submitMoveForApprovalInternalServerError +*/ +type SubmitMoveForApprovalInternalServerError struct { +} + +// NewSubmitMoveForApprovalInternalServerError creates SubmitMoveForApprovalInternalServerError with default headers values +func NewSubmitMoveForApprovalInternalServerError() *SubmitMoveForApprovalInternalServerError { + + return &SubmitMoveForApprovalInternalServerError{} +} + +// WriteResponse to the client +func (o *SubmitMoveForApprovalInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go new file mode 100644 index 00000000000..980ab955ed7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/submit_move_for_approval_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SubmitMoveForApprovalURL generates an URL for the submit move for approval operation +type SubmitMoveForApprovalURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitMoveForApprovalURL) WithBasePath(bp string) *SubmitMoveForApprovalURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitMoveForApprovalURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SubmitMoveForApprovalURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/submit" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on SubmitMoveForApprovalURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SubmitMoveForApprovalURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SubmitMoveForApprovalURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SubmitMoveForApprovalURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SubmitMoveForApprovalURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SubmitMoveForApprovalURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SubmitMoveForApprovalURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go new file mode 100644 index 00000000000..ca7373bd49c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UploadAdditionalDocumentsHandlerFunc turns a function with the right signature into a upload additional documents handler +type UploadAdditionalDocumentsHandlerFunc func(UploadAdditionalDocumentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UploadAdditionalDocumentsHandlerFunc) Handle(params UploadAdditionalDocumentsParams) middleware.Responder { + return fn(params) +} + +// UploadAdditionalDocumentsHandler interface for that can handle valid upload additional documents params +type UploadAdditionalDocumentsHandler interface { + Handle(UploadAdditionalDocumentsParams) middleware.Responder +} + +// NewUploadAdditionalDocuments creates a new http.Handler for the upload additional documents operation +func NewUploadAdditionalDocuments(ctx *middleware.Context, handler UploadAdditionalDocumentsHandler) *UploadAdditionalDocuments { + return &UploadAdditionalDocuments{Context: ctx, Handler: handler} +} + +/* + UploadAdditionalDocuments swagger:route PATCH /moves/{moveId}/uploadAdditionalDocuments moves uploadAdditionalDocuments + +# Patch the additional documents for a given move + +Customers will on occaision need the ability to upload additional supporting documents, for a variety of reasons. This does not include amended order. +*/ +type UploadAdditionalDocuments struct { + Context *middleware.Context + Handler UploadAdditionalDocumentsHandler +} + +func (o *UploadAdditionalDocuments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUploadAdditionalDocumentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go new file mode 100644 index 00000000000..baf9cfbacc1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UploadAdditionalDocumentsMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var UploadAdditionalDocumentsMaxParseMemory int64 = 32 << 20 + +// NewUploadAdditionalDocumentsParams creates a new UploadAdditionalDocumentsParams object +// +// There are no default values defined in the spec. +func NewUploadAdditionalDocumentsParams() UploadAdditionalDocumentsParams { + + return UploadAdditionalDocumentsParams{} +} + +// UploadAdditionalDocumentsParams contains all the bound params for the upload additional documents operation +// typically these are obtained from a http.Request +// +// swagger:parameters uploadAdditionalDocuments +type UploadAdditionalDocumentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the order + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUploadAdditionalDocumentsParams() beforehand. +func (o *UploadAdditionalDocumentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(UploadAdditionalDocumentsMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *UploadAdditionalDocumentsParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *UploadAdditionalDocumentsParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *UploadAdditionalDocumentsParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go new file mode 100644 index 00000000000..368ed1ebcfb --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UploadAdditionalDocumentsCreatedCode is the HTTP code returned for type UploadAdditionalDocumentsCreated +const UploadAdditionalDocumentsCreatedCode int = 201 + +/* +UploadAdditionalDocumentsCreated created upload + +swagger:response uploadAdditionalDocumentsCreated +*/ +type UploadAdditionalDocumentsCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Upload `json:"body,omitempty"` +} + +// NewUploadAdditionalDocumentsCreated creates UploadAdditionalDocumentsCreated with default headers values +func NewUploadAdditionalDocumentsCreated() *UploadAdditionalDocumentsCreated { + + return &UploadAdditionalDocumentsCreated{} +} + +// WithPayload adds the payload to the upload additional documents created response +func (o *UploadAdditionalDocumentsCreated) WithPayload(payload *internalmessages.Upload) *UploadAdditionalDocumentsCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload additional documents created response +func (o *UploadAdditionalDocumentsCreated) SetPayload(payload *internalmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAdditionalDocumentsBadRequestCode is the HTTP code returned for type UploadAdditionalDocumentsBadRequest +const UploadAdditionalDocumentsBadRequestCode int = 400 + +/* +UploadAdditionalDocumentsBadRequest invalid request + +swagger:response uploadAdditionalDocumentsBadRequest +*/ +type UploadAdditionalDocumentsBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewUploadAdditionalDocumentsBadRequest creates UploadAdditionalDocumentsBadRequest with default headers values +func NewUploadAdditionalDocumentsBadRequest() *UploadAdditionalDocumentsBadRequest { + + return &UploadAdditionalDocumentsBadRequest{} +} + +// WithPayload adds the payload to the upload additional documents bad request response +func (o *UploadAdditionalDocumentsBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *UploadAdditionalDocumentsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload additional documents bad request response +func (o *UploadAdditionalDocumentsBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAdditionalDocumentsForbiddenCode is the HTTP code returned for type UploadAdditionalDocumentsForbidden +const UploadAdditionalDocumentsForbiddenCode int = 403 + +/* +UploadAdditionalDocumentsForbidden not authorized + +swagger:response uploadAdditionalDocumentsForbidden +*/ +type UploadAdditionalDocumentsForbidden struct { +} + +// NewUploadAdditionalDocumentsForbidden creates UploadAdditionalDocumentsForbidden with default headers values +func NewUploadAdditionalDocumentsForbidden() *UploadAdditionalDocumentsForbidden { + + return &UploadAdditionalDocumentsForbidden{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UploadAdditionalDocumentsNotFoundCode is the HTTP code returned for type UploadAdditionalDocumentsNotFound +const UploadAdditionalDocumentsNotFoundCode int = 404 + +/* +UploadAdditionalDocumentsNotFound not found + +swagger:response uploadAdditionalDocumentsNotFound +*/ +type UploadAdditionalDocumentsNotFound struct { +} + +// NewUploadAdditionalDocumentsNotFound creates UploadAdditionalDocumentsNotFound with default headers values +func NewUploadAdditionalDocumentsNotFound() *UploadAdditionalDocumentsNotFound { + + return &UploadAdditionalDocumentsNotFound{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UploadAdditionalDocumentsRequestEntityTooLargeCode is the HTTP code returned for type UploadAdditionalDocumentsRequestEntityTooLarge +const UploadAdditionalDocumentsRequestEntityTooLargeCode int = 413 + +/* +UploadAdditionalDocumentsRequestEntityTooLarge payload is too large + +swagger:response uploadAdditionalDocumentsRequestEntityTooLarge +*/ +type UploadAdditionalDocumentsRequestEntityTooLarge struct { +} + +// NewUploadAdditionalDocumentsRequestEntityTooLarge creates UploadAdditionalDocumentsRequestEntityTooLarge with default headers values +func NewUploadAdditionalDocumentsRequestEntityTooLarge() *UploadAdditionalDocumentsRequestEntityTooLarge { + + return &UploadAdditionalDocumentsRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// UploadAdditionalDocumentsInternalServerErrorCode is the HTTP code returned for type UploadAdditionalDocumentsInternalServerError +const UploadAdditionalDocumentsInternalServerErrorCode int = 500 + +/* +UploadAdditionalDocumentsInternalServerError server error + +swagger:response uploadAdditionalDocumentsInternalServerError +*/ +type UploadAdditionalDocumentsInternalServerError struct { +} + +// NewUploadAdditionalDocumentsInternalServerError creates UploadAdditionalDocumentsInternalServerError with default headers values +func NewUploadAdditionalDocumentsInternalServerError() *UploadAdditionalDocumentsInternalServerError { + + return &UploadAdditionalDocumentsInternalServerError{} +} + +// WriteResponse to the client +func (o *UploadAdditionalDocumentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go new file mode 100644 index 00000000000..2eebbbffd3d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/moves/upload_additional_documents_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package moves + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UploadAdditionalDocumentsURL generates an URL for the upload additional documents operation +type UploadAdditionalDocumentsURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAdditionalDocumentsURL) WithBasePath(bp string) *UploadAdditionalDocumentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAdditionalDocumentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UploadAdditionalDocumentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/uploadAdditionalDocuments" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on UploadAdditionalDocumentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UploadAdditionalDocumentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UploadAdditionalDocumentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UploadAdditionalDocumentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UploadAdditionalDocumentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UploadAdditionalDocumentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UploadAdditionalDocumentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go new file mode 100644 index 00000000000..addb9cd5958 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler +type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params +type CreateMTOShipmentHandler interface { + Handle(CreateMTOShipmentParams) middleware.Responder +} + +// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation +func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { + return &CreateMTOShipment{Context: ctx, Handler: handler} +} + +/* + CreateMTOShipment swagger:route POST /mto_shipments mtoShipment createMTOShipment + +createMTOShipment + +Creates a MTO shipment for the specified Move Task Order. +Required fields include: +* Shipment Type +* Customer requested pick-up date +* Pick-up Address +* Delivery Address + +Optional fields include: +* Customer Remarks +* Releasing / Receiving agents +*/ +type CreateMTOShipment struct { + Context *middleware.Context + Handler CreateMTOShipmentHandler +} + +func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..4eec95360b9 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOShipmentParams() CreateMTOShipmentParams { + + return CreateMTOShipmentParams{} +} + +// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOShipment +type CreateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *internalmessages.CreateShipment +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. +func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..c53ec978d52 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK +const CreateMTOShipmentOKCode int = 200 + +/* +CreateMTOShipmentOK Successfully created a MTO shipment. + +swagger:response createMTOShipmentOK +*/ +type CreateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *internalmessages.MTOShipment `json:"body,omitempty"` +} + +// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + + return &CreateMTOShipmentOK{} +} + +// WithPayload adds the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) WithPayload(payload *internalmessages.MTOShipment) *CreateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) SetPayload(payload *internalmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest +const CreateMTOShipmentBadRequestCode int = 400 + +/* +CreateMTOShipmentBadRequest The request payload is invalid. + +swagger:response createMTOShipmentBadRequest +*/ +type CreateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + + return &CreateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentUnauthorizedCode is the HTTP code returned for type CreateMTOShipmentUnauthorized +const CreateMTOShipmentUnauthorizedCode int = 401 + +/* +CreateMTOShipmentUnauthorized The request was denied. + +swagger:response createMTOShipmentUnauthorized +*/ +type CreateMTOShipmentUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentUnauthorized creates CreateMTOShipmentUnauthorized with default headers values +func NewCreateMTOShipmentUnauthorized() *CreateMTOShipmentUnauthorized { + + return &CreateMTOShipmentUnauthorized{} +} + +// WithPayload adds the payload to the create m t o shipment unauthorized response +func (o *CreateMTOShipmentUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment unauthorized response +func (o *CreateMTOShipmentUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentForbiddenCode is the HTTP code returned for type CreateMTOShipmentForbidden +const CreateMTOShipmentForbiddenCode int = 403 + +/* +CreateMTOShipmentForbidden The request was denied. + +swagger:response createMTOShipmentForbidden +*/ +type CreateMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentForbidden creates CreateMTOShipmentForbidden with default headers values +func NewCreateMTOShipmentForbidden() *CreateMTOShipmentForbidden { + + return &CreateMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the create m t o shipment forbidden response +func (o *CreateMTOShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment forbidden response +func (o *CreateMTOShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound +const CreateMTOShipmentNotFoundCode int = 404 + +/* +CreateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response createMTOShipmentNotFound +*/ +type CreateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + + return &CreateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *CreateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity +const CreateMTOShipmentUnprocessableEntityCode int = 422 + +/* +CreateMTOShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response createMTOShipmentUnprocessableEntity +*/ +type CreateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + + return &CreateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError +const CreateMTOShipmentInternalServerErrorCode int = 500 + +/* +CreateMTOShipmentInternalServerError A server error occurred. + +swagger:response createMTOShipmentInternalServerError +*/ +type CreateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + + return &CreateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *CreateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..fbeb57347b1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOShipmentURL generates an URL for the create m t o shipment operation +type CreateMTOShipmentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto_shipments" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go new file mode 100644 index 00000000000..e5b29ca477e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteShipmentHandlerFunc turns a function with the right signature into a delete shipment handler +type DeleteShipmentHandlerFunc func(DeleteShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteShipmentHandlerFunc) Handle(params DeleteShipmentParams) middleware.Responder { + return fn(params) +} + +// DeleteShipmentHandler interface for that can handle valid delete shipment params +type DeleteShipmentHandler interface { + Handle(DeleteShipmentParams) middleware.Responder +} + +// NewDeleteShipment creates a new http.Handler for the delete shipment operation +func NewDeleteShipment(ctx *middleware.Context, handler DeleteShipmentHandler) *DeleteShipment { + return &DeleteShipment{Context: ctx, Handler: handler} +} + +/* + DeleteShipment swagger:route DELETE /mto-shipments/{mtoShipmentId} mtoShipment deleteShipment + +# Soft deletes a shipment by ID + +Soft deletes a shipment by ID +*/ +type DeleteShipment struct { + Context *middleware.Context + Handler DeleteShipmentHandler +} + +func (o *DeleteShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go new file mode 100644 index 00000000000..04cb9f081ab --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteShipmentParams creates a new DeleteShipmentParams object +// +// There are no default values defined in the spec. +func NewDeleteShipmentParams() DeleteShipmentParams { + + return DeleteShipmentParams{} +} + +// DeleteShipmentParams contains all the bound params for the delete shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteShipment +type DeleteShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the shipment to be deleted + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteShipmentParams() beforehand. +func (o *DeleteShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentId") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *DeleteShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentId", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *DeleteShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentId", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go new file mode 100644 index 00000000000..e380c6e7735 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteShipmentNoContentCode is the HTTP code returned for type DeleteShipmentNoContent +const DeleteShipmentNoContentCode int = 204 + +/* +DeleteShipmentNoContent Successfully soft deleted the shipment + +swagger:response deleteShipmentNoContent +*/ +type DeleteShipmentNoContent struct { +} + +// NewDeleteShipmentNoContent creates DeleteShipmentNoContent with default headers values +func NewDeleteShipmentNoContent() *DeleteShipmentNoContent { + + return &DeleteShipmentNoContent{} +} + +// WriteResponse to the client +func (o *DeleteShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteShipmentBadRequestCode is the HTTP code returned for type DeleteShipmentBadRequest +const DeleteShipmentBadRequestCode int = 400 + +/* +DeleteShipmentBadRequest The request payload is invalid. + +swagger:response deleteShipmentBadRequest +*/ +type DeleteShipmentBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteShipmentBadRequest creates DeleteShipmentBadRequest with default headers values +func NewDeleteShipmentBadRequest() *DeleteShipmentBadRequest { + + return &DeleteShipmentBadRequest{} +} + +// WithPayload adds the payload to the delete shipment bad request response +func (o *DeleteShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment bad request response +func (o *DeleteShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentForbiddenCode is the HTTP code returned for type DeleteShipmentForbidden +const DeleteShipmentForbiddenCode int = 403 + +/* +DeleteShipmentForbidden The request was denied. + +swagger:response deleteShipmentForbidden +*/ +type DeleteShipmentForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteShipmentForbidden creates DeleteShipmentForbidden with default headers values +func NewDeleteShipmentForbidden() *DeleteShipmentForbidden { + + return &DeleteShipmentForbidden{} +} + +// WithPayload adds the payload to the delete shipment forbidden response +func (o *DeleteShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment forbidden response +func (o *DeleteShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentNotFoundCode is the HTTP code returned for type DeleteShipmentNotFound +const DeleteShipmentNotFoundCode int = 404 + +/* +DeleteShipmentNotFound The requested resource wasn't found. + +swagger:response deleteShipmentNotFound +*/ +type DeleteShipmentNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteShipmentNotFound creates DeleteShipmentNotFound with default headers values +func NewDeleteShipmentNotFound() *DeleteShipmentNotFound { + + return &DeleteShipmentNotFound{} +} + +// WithPayload adds the payload to the delete shipment not found response +func (o *DeleteShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment not found response +func (o *DeleteShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentConflictCode is the HTTP code returned for type DeleteShipmentConflict +const DeleteShipmentConflictCode int = 409 + +/* +DeleteShipmentConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response deleteShipmentConflict +*/ +type DeleteShipmentConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteShipmentConflict creates DeleteShipmentConflict with default headers values +func NewDeleteShipmentConflict() *DeleteShipmentConflict { + + return &DeleteShipmentConflict{} +} + +// WithPayload adds the payload to the delete shipment conflict response +func (o *DeleteShipmentConflict) WithPayload(payload *internalmessages.ClientError) *DeleteShipmentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment conflict response +func (o *DeleteShipmentConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteShipmentUnprocessableEntity +const DeleteShipmentUnprocessableEntityCode int = 422 + +/* +DeleteShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response deleteShipmentUnprocessableEntity +*/ +type DeleteShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteShipmentUnprocessableEntity creates DeleteShipmentUnprocessableEntity with default headers values +func NewDeleteShipmentUnprocessableEntity() *DeleteShipmentUnprocessableEntity { + + return &DeleteShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete shipment unprocessable entity response +func (o *DeleteShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment unprocessable entity response +func (o *DeleteShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteShipmentInternalServerErrorCode is the HTTP code returned for type DeleteShipmentInternalServerError +const DeleteShipmentInternalServerErrorCode int = 500 + +/* +DeleteShipmentInternalServerError A server error occurred. + +swagger:response deleteShipmentInternalServerError +*/ +type DeleteShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewDeleteShipmentInternalServerError creates DeleteShipmentInternalServerError with default headers values +func NewDeleteShipmentInternalServerError() *DeleteShipmentInternalServerError { + + return &DeleteShipmentInternalServerError{} +} + +// WithPayload adds the payload to the delete shipment internal server error response +func (o *DeleteShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete shipment internal server error response +func (o *DeleteShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go new file mode 100644 index 00000000000..c03c6cfdd26 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/delete_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteShipmentURL generates an URL for the delete shipment operation +type DeleteShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteShipmentURL) WithBasePath(bp string) *DeleteShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentId}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentId}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on DeleteShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go new file mode 100644 index 00000000000..9a0d749c7a6 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMTOShipmentsHandlerFunc turns a function with the right signature into a list m t o shipments handler +type ListMTOShipmentsHandlerFunc func(ListMTOShipmentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMTOShipmentsHandlerFunc) Handle(params ListMTOShipmentsParams) middleware.Responder { + return fn(params) +} + +// ListMTOShipmentsHandler interface for that can handle valid list m t o shipments params +type ListMTOShipmentsHandler interface { + Handle(ListMTOShipmentsParams) middleware.Responder +} + +// NewListMTOShipments creates a new http.Handler for the list m t o shipments operation +func NewListMTOShipments(ctx *middleware.Context, handler ListMTOShipmentsHandler) *ListMTOShipments { + return &ListMTOShipments{Context: ctx, Handler: handler} +} + +/* + ListMTOShipments swagger:route GET /moves/{moveTaskOrderID}/mto_shipments mtoShipment listMTOShipments + +# Gets all shipments for a move task order + +Gets all MTO shipments for the specified Move Task Order. +*/ +type ListMTOShipments struct { + Context *middleware.Context + Handler ListMTOShipmentsHandler +} + +func (o *ListMTOShipments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMTOShipmentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go new file mode 100644 index 00000000000..e186e4a8796 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewListMTOShipmentsParams creates a new ListMTOShipmentsParams object +// +// There are no default values defined in the spec. +func NewListMTOShipmentsParams() ListMTOShipmentsParams { + + return ListMTOShipmentsParams{} +} + +// ListMTOShipmentsParams contains all the bound params for the list m t o shipments operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMTOShipments +type ListMTOShipmentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of move task order for mto shipment to use + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMTOShipmentsParams() beforehand. +func (o *ListMTOShipmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *ListMTOShipmentsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *ListMTOShipmentsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go new file mode 100644 index 00000000000..5065a4f9e4f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_responses.go @@ -0,0 +1,242 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ListMTOShipmentsOKCode is the HTTP code returned for type ListMTOShipmentsOK +const ListMTOShipmentsOKCode int = 200 + +/* +ListMTOShipmentsOK Successfully retrieved all mto shipments for a move task order. + +swagger:response listMTOShipmentsOK +*/ +type ListMTOShipmentsOK struct { + + /* + In: Body + */ + Payload internalmessages.MTOShipments `json:"body,omitempty"` +} + +// NewListMTOShipmentsOK creates ListMTOShipmentsOK with default headers values +func NewListMTOShipmentsOK() *ListMTOShipmentsOK { + + return &ListMTOShipmentsOK{} +} + +// WithPayload adds the payload to the list m t o shipments o k response +func (o *ListMTOShipmentsOK) WithPayload(payload internalmessages.MTOShipments) *ListMTOShipmentsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments o k response +func (o *ListMTOShipmentsOK) SetPayload(payload internalmessages.MTOShipments) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.MTOShipments{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMTOShipmentsBadRequestCode is the HTTP code returned for type ListMTOShipmentsBadRequest +const ListMTOShipmentsBadRequestCode int = 400 + +/* +ListMTOShipmentsBadRequest The request payload is invalid. + +swagger:response listMTOShipmentsBadRequest +*/ +type ListMTOShipmentsBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOShipmentsBadRequest creates ListMTOShipmentsBadRequest with default headers values +func NewListMTOShipmentsBadRequest() *ListMTOShipmentsBadRequest { + + return &ListMTOShipmentsBadRequest{} +} + +// WithPayload adds the payload to the list m t o shipments bad request response +func (o *ListMTOShipmentsBadRequest) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments bad request response +func (o *ListMTOShipmentsBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsUnauthorizedCode is the HTTP code returned for type ListMTOShipmentsUnauthorized +const ListMTOShipmentsUnauthorizedCode int = 401 + +/* +ListMTOShipmentsUnauthorized The request was denied. + +swagger:response listMTOShipmentsUnauthorized +*/ +type ListMTOShipmentsUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOShipmentsUnauthorized creates ListMTOShipmentsUnauthorized with default headers values +func NewListMTOShipmentsUnauthorized() *ListMTOShipmentsUnauthorized { + + return &ListMTOShipmentsUnauthorized{} +} + +// WithPayload adds the payload to the list m t o shipments unauthorized response +func (o *ListMTOShipmentsUnauthorized) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments unauthorized response +func (o *ListMTOShipmentsUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsNotFoundCode is the HTTP code returned for type ListMTOShipmentsNotFound +const ListMTOShipmentsNotFoundCode int = 404 + +/* +ListMTOShipmentsNotFound The requested resource wasn't found. + +swagger:response listMTOShipmentsNotFound +*/ +type ListMTOShipmentsNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOShipmentsNotFound creates ListMTOShipmentsNotFound with default headers values +func NewListMTOShipmentsNotFound() *ListMTOShipmentsNotFound { + + return &ListMTOShipmentsNotFound{} +} + +// WithPayload adds the payload to the list m t o shipments not found response +func (o *ListMTOShipmentsNotFound) WithPayload(payload *internalmessages.ClientError) *ListMTOShipmentsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments not found response +func (o *ListMTOShipmentsNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOShipmentsInternalServerErrorCode is the HTTP code returned for type ListMTOShipmentsInternalServerError +const ListMTOShipmentsInternalServerErrorCode int = 500 + +/* +ListMTOShipmentsInternalServerError A server error occurred. + +swagger:response listMTOShipmentsInternalServerError +*/ +type ListMTOShipmentsInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewListMTOShipmentsInternalServerError creates ListMTOShipmentsInternalServerError with default headers values +func NewListMTOShipmentsInternalServerError() *ListMTOShipmentsInternalServerError { + + return &ListMTOShipmentsInternalServerError{} +} + +// WithPayload adds the payload to the list m t o shipments internal server error response +func (o *ListMTOShipmentsInternalServerError) WithPayload(payload *internalmessages.Error) *ListMTOShipmentsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o shipments internal server error response +func (o *ListMTOShipmentsInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOShipmentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go new file mode 100644 index 00000000000..677f0a0a528 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/list_m_t_o_shipments_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ListMTOShipmentsURL generates an URL for the list m t o shipments operation +type ListMTOShipmentsURL struct { + MoveTaskOrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOShipmentsURL) WithBasePath(bp string) *ListMTOShipmentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOShipmentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMTOShipmentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveTaskOrderID}/mto_shipments" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on ListMTOShipmentsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMTOShipmentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMTOShipmentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMTOShipmentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMTOShipmentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMTOShipmentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMTOShipmentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go new file mode 100644 index 00000000000..5d423b0185f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler +type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params +type UpdateMTOShipmentHandler interface { + Handle(UpdateMTOShipmentParams) middleware.Responder +} + +// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation +func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { + return &UpdateMTOShipment{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentId} mtoShipment updateMTOShipment + +updateMTOShipment + +Updates a specified MTO shipment. + +Required fields include: +* MTO Shipment ID required in path +* If-Match required in headers +* Shipment type is required in body + +Optional fields include: +* New shipment status type +* Customer requested pick-up date +* Pick-up Address +* Delivery Address +* Customer Remarks +* Releasing / Receiving agents +* Actual Pro Gear Weight +* Actual Spouse Pro Gear Weight +*/ +type UpdateMTOShipment struct { + Context *middleware.Context + Handler UpdateMTOShipmentHandler +} + +func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..aae8f82a7db --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { + + return UpdateMTOShipmentParams{} +} + +// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipment +type UpdateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + In: body + */ + Body *internalmessages.UpdateShipment + /*UUID of the MTO Shipment to update + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. +func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentId") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentId", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentId", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..1b60695cb68 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK +const UpdateMTOShipmentOKCode int = 200 + +/* +UpdateMTOShipmentOK Successfully updated the specified MTO shipment. + +swagger:response updateMTOShipmentOK +*/ +type UpdateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *internalmessages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + + return &UpdateMTOShipmentOK{} +} + +// WithPayload adds the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) WithPayload(payload *internalmessages.MTOShipment) *UpdateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) SetPayload(payload *internalmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest +const UpdateMTOShipmentBadRequestCode int = 400 + +/* +UpdateMTOShipmentBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentBadRequest +*/ +type UpdateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + + return &UpdateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized +const UpdateMTOShipmentUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentUnauthorized The request was denied. + +swagger:response updateMTOShipmentUnauthorized +*/ +type UpdateMTOShipmentUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + + return &UpdateMTOShipmentUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden +const UpdateMTOShipmentForbiddenCode int = 403 + +/* +UpdateMTOShipmentForbidden The request was denied. + +swagger:response updateMTOShipmentForbidden +*/ +type UpdateMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + + return &UpdateMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound +const UpdateMTOShipmentNotFoundCode int = 404 + +/* +UpdateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentNotFound +*/ +type UpdateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + + return &UpdateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed +const UpdateMTOShipmentPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentPreconditionFailed +*/ +type UpdateMTOShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + + return &UpdateMTOShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateMTOShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity +const UpdateMTOShipmentUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOShipmentUnprocessableEntity +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + + return &UpdateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError +const UpdateMTOShipmentInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentInternalServerError A server error occurred. + +swagger:response updateMTOShipmentInternalServerError +*/ +type UpdateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + + return &UpdateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..ff57050f147 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation +type UpdateMTOShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentId}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentId}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/mymove_api.go b/pkg/gen/internalapi/internaloperations/mymove_api.go new file mode 100644 index 00000000000..b1ba4e1ac47 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/mymove_api.go @@ -0,0 +1,1175 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internaloperations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/addresses" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/application_parameters" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/backup_contacts" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/calendar" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/certification" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/documents" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/duty_locations" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/entitlements" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/feature_flags" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/move_docs" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/moves" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/office" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/okta_profile" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/orders" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/postal_codes" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/ppm" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/queues" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/service_members" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/transportation_offices" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/uploads" + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations/users" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + MultipartformConsumer: runtime.DiscardConsumer, + + BinProducer: runtime.ByteStreamProducer(), + JSONProducer: runtime.JSONProducer(), + + OfficeApproveMoveHandler: office.ApproveMoveHandlerFunc(func(params office.ApproveMoveParams) middleware.Responder { + return middleware.NotImplemented("operation office.ApproveMove has not yet been implemented") + }), + OfficeApproveReimbursementHandler: office.ApproveReimbursementHandlerFunc(func(params office.ApproveReimbursementParams) middleware.Responder { + return middleware.NotImplemented("operation office.ApproveReimbursement has not yet been implemented") + }), + FeatureFlagsBooleanFeatureFlagForUserHandler: feature_flags.BooleanFeatureFlagForUserHandlerFunc(func(params feature_flags.BooleanFeatureFlagForUserParams) middleware.Responder { + return middleware.NotImplemented("operation feature_flags.BooleanFeatureFlagForUser has not yet been implemented") + }), + OfficeCancelMoveHandler: office.CancelMoveHandlerFunc(func(params office.CancelMoveParams) middleware.Responder { + return middleware.NotImplemented("operation office.CancelMove has not yet been implemented") + }), + DocumentsCreateDocumentHandler: documents.CreateDocumentHandlerFunc(func(params documents.CreateDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation documents.CreateDocument has not yet been implemented") + }), + MoveDocsCreateGenericMoveDocumentHandler: move_docs.CreateGenericMoveDocumentHandlerFunc(func(params move_docs.CreateGenericMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.CreateGenericMoveDocument has not yet been implemented") + }), + MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }), + PpmCreateMovingExpenseHandler: ppm.CreateMovingExpenseHandlerFunc(func(params ppm.CreateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateMovingExpense has not yet been implemented") + }), + OrdersCreateOrdersHandler: orders.CreateOrdersHandlerFunc(func(params orders.CreateOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.CreateOrders has not yet been implemented") + }), + PpmCreatePPMUploadHandler: ppm.CreatePPMUploadHandlerFunc(func(params ppm.CreatePPMUploadParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreatePPMUpload has not yet been implemented") + }), + PpmCreateProGearWeightTicketHandler: ppm.CreateProGearWeightTicketHandlerFunc(func(params ppm.CreateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateProGearWeightTicket has not yet been implemented") + }), + ServiceMembersCreateServiceMemberHandler: service_members.CreateServiceMemberHandlerFunc(func(params service_members.CreateServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.CreateServiceMember has not yet been implemented") + }), + BackupContactsCreateServiceMemberBackupContactHandler: backup_contacts.CreateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.CreateServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.CreateServiceMemberBackupContact has not yet been implemented") + }), + CertificationCreateSignedCertificationHandler: certification.CreateSignedCertificationHandlerFunc(func(params certification.CreateSignedCertificationParams) middleware.Responder { + return middleware.NotImplemented("operation certification.CreateSignedCertification has not yet been implemented") + }), + UploadsCreateUploadHandler: uploads.CreateUploadHandlerFunc(func(params uploads.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.CreateUpload has not yet been implemented") + }), + PpmCreateWeightTicketHandler: ppm.CreateWeightTicketHandlerFunc(func(params ppm.CreateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.CreateWeightTicket has not yet been implemented") + }), + MoveDocsCreateWeightTicketDocumentHandler: move_docs.CreateWeightTicketDocumentHandlerFunc(func(params move_docs.CreateWeightTicketDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.CreateWeightTicketDocument has not yet been implemented") + }), + MoveDocsDeleteMoveDocumentHandler: move_docs.DeleteMoveDocumentHandlerFunc(func(params move_docs.DeleteMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.DeleteMoveDocument has not yet been implemented") + }), + PpmDeleteMovingExpenseHandler: ppm.DeleteMovingExpenseHandlerFunc(func(params ppm.DeleteMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteMovingExpense has not yet been implemented") + }), + PpmDeleteProGearWeightTicketHandler: ppm.DeleteProGearWeightTicketHandlerFunc(func(params ppm.DeleteProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteProGearWeightTicket has not yet been implemented") + }), + MtoShipmentDeleteShipmentHandler: mto_shipment.DeleteShipmentHandlerFunc(func(params mto_shipment.DeleteShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.DeleteShipment has not yet been implemented") + }), + UploadsDeleteUploadHandler: uploads.DeleteUploadHandlerFunc(func(params uploads.DeleteUploadParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUpload has not yet been implemented") + }), + UploadsDeleteUploadsHandler: uploads.DeleteUploadsHandlerFunc(func(params uploads.DeleteUploadsParams) middleware.Responder { + return middleware.NotImplemented("operation uploads.DeleteUploads has not yet been implemented") + }), + PpmDeleteWeightTicketHandler: ppm.DeleteWeightTicketHandlerFunc(func(params ppm.DeleteWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.DeleteWeightTicket has not yet been implemented") + }), + MovesGetAllMovesHandler: moves.GetAllMovesHandlerFunc(func(params moves.GetAllMovesParams) middleware.Responder { + return middleware.NotImplemented("operation moves.GetAllMoves has not yet been implemented") + }), + AddressesGetLocationByZipCityStateHandler: addresses.GetLocationByZipCityStateHandlerFunc(func(params addresses.GetLocationByZipCityStateParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.GetLocationByZipCityState has not yet been implemented") + }), + TransportationOfficesGetTransportationOfficesHandler: transportation_offices.GetTransportationOfficesHandlerFunc(func(params transportation_offices.GetTransportationOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.GetTransportationOffices has not yet been implemented") + }), + EntitlementsIndexEntitlementsHandler: entitlements.IndexEntitlementsHandlerFunc(func(params entitlements.IndexEntitlementsParams) middleware.Responder { + return middleware.NotImplemented("operation entitlements.IndexEntitlements has not yet been implemented") + }), + MoveDocsIndexMoveDocumentsHandler: move_docs.IndexMoveDocumentsHandlerFunc(func(params move_docs.IndexMoveDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.IndexMoveDocuments has not yet been implemented") + }), + BackupContactsIndexServiceMemberBackupContactsHandler: backup_contacts.IndexServiceMemberBackupContactsHandlerFunc(func(params backup_contacts.IndexServiceMemberBackupContactsParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.IndexServiceMemberBackupContacts has not yet been implemented") + }), + CertificationIndexSignedCertificationHandler: certification.IndexSignedCertificationHandlerFunc(func(params certification.IndexSignedCertificationParams) middleware.Responder { + return middleware.NotImplemented("operation certification.IndexSignedCertification has not yet been implemented") + }), + CalendarIsDateWeekendHolidayHandler: calendar.IsDateWeekendHolidayHandlerFunc(func(params calendar.IsDateWeekendHolidayParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.IsDateWeekendHoliday has not yet been implemented") + }), + UsersIsLoggedInUserHandler: users.IsLoggedInUserHandlerFunc(func(params users.IsLoggedInUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.IsLoggedInUser has not yet been implemented") + }), + MtoShipmentListMTOShipmentsHandler: mto_shipment.ListMTOShipmentsHandlerFunc(func(params mto_shipment.ListMTOShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.ListMTOShipments has not yet been implemented") + }), + MovesPatchMoveHandler: moves.PatchMoveHandlerFunc(func(params moves.PatchMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.PatchMove has not yet been implemented") + }), + ServiceMembersPatchServiceMemberHandler: service_members.PatchServiceMemberHandlerFunc(func(params service_members.PatchServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.PatchServiceMember has not yet been implemented") + }), + PpmResubmitPPMShipmentDocumentationHandler: ppm.ResubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.ResubmitPPMShipmentDocumentationParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ResubmitPPMShipmentDocumentation has not yet been implemented") + }), + DutyLocationsSearchDutyLocationsHandler: duty_locations.SearchDutyLocationsHandlerFunc(func(params duty_locations.SearchDutyLocationsParams) middleware.Responder { + return middleware.NotImplemented("operation duty_locations.SearchDutyLocations has not yet been implemented") + }), + PpmShowAOAPacketHandler: ppm.ShowAOAPacketHandlerFunc(func(params ppm.ShowAOAPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowAOAPacket has not yet been implemented") + }), + AddressesShowAddressHandler: addresses.ShowAddressHandlerFunc(func(params addresses.ShowAddressParams) middleware.Responder { + return middleware.NotImplemented("operation addresses.ShowAddress has not yet been implemented") + }), + CalendarShowAvailableMoveDatesHandler: calendar.ShowAvailableMoveDatesHandlerFunc(func(params calendar.ShowAvailableMoveDatesParams) middleware.Responder { + return middleware.NotImplemented("operation calendar.ShowAvailableMoveDates has not yet been implemented") + }), + TransportationOfficesShowCounselingOfficesHandler: transportation_offices.ShowCounselingOfficesHandlerFunc(func(params transportation_offices.ShowCounselingOfficesParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.ShowCounselingOffices has not yet been implemented") + }), + DocumentsShowDocumentHandler: documents.ShowDocumentHandlerFunc(func(params documents.ShowDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation documents.ShowDocument has not yet been implemented") + }), + TransportationOfficesShowDutyLocationTransportationOfficeHandler: transportation_offices.ShowDutyLocationTransportationOfficeHandlerFunc(func(params transportation_offices.ShowDutyLocationTransportationOfficeParams) middleware.Responder { + return middleware.NotImplemented("operation transportation_offices.ShowDutyLocationTransportationOffice has not yet been implemented") + }), + UsersShowLoggedInUserHandler: users.ShowLoggedInUserHandlerFunc(func(params users.ShowLoggedInUserParams) middleware.Responder { + return middleware.NotImplemented("operation users.ShowLoggedInUser has not yet been implemented") + }), + MovesShowMoveHandler: moves.ShowMoveHandlerFunc(func(params moves.ShowMoveParams) middleware.Responder { + return middleware.NotImplemented("operation moves.ShowMove has not yet been implemented") + }), + OfficeShowOfficeOrdersHandler: office.ShowOfficeOrdersHandlerFunc(func(params office.ShowOfficeOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation office.ShowOfficeOrders has not yet been implemented") + }), + OktaProfileShowOktaInfoHandler: okta_profile.ShowOktaInfoHandlerFunc(func(params okta_profile.ShowOktaInfoParams) middleware.Responder { + return middleware.NotImplemented("operation okta_profile.ShowOktaInfo has not yet been implemented") + }), + OrdersShowOrdersHandler: orders.ShowOrdersHandlerFunc(func(params orders.ShowOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.ShowOrders has not yet been implemented") + }), + PpmShowPaymentPacketHandler: ppm.ShowPaymentPacketHandlerFunc(func(params ppm.ShowPaymentPacketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.ShowPaymentPacket has not yet been implemented") + }), + QueuesShowQueueHandler: queues.ShowQueueHandlerFunc(func(params queues.ShowQueueParams) middleware.Responder { + return middleware.NotImplemented("operation queues.ShowQueue has not yet been implemented") + }), + ServiceMembersShowServiceMemberHandler: service_members.ShowServiceMemberHandlerFunc(func(params service_members.ShowServiceMemberParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.ShowServiceMember has not yet been implemented") + }), + BackupContactsShowServiceMemberBackupContactHandler: backup_contacts.ShowServiceMemberBackupContactHandlerFunc(func(params backup_contacts.ShowServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.ShowServiceMemberBackupContact has not yet been implemented") + }), + ServiceMembersShowServiceMemberOrdersHandler: service_members.ShowServiceMemberOrdersHandlerFunc(func(params service_members.ShowServiceMemberOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation service_members.ShowServiceMemberOrders has not yet been implemented") + }), + MovesSubmitAmendedOrdersHandler: moves.SubmitAmendedOrdersHandlerFunc(func(params moves.SubmitAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation moves.SubmitAmendedOrders has not yet been implemented") + }), + MovesSubmitMoveForApprovalHandler: moves.SubmitMoveForApprovalHandlerFunc(func(params moves.SubmitMoveForApprovalParams) middleware.Responder { + return middleware.NotImplemented("operation moves.SubmitMoveForApproval has not yet been implemented") + }), + PpmSubmitPPMShipmentDocumentationHandler: ppm.SubmitPPMShipmentDocumentationHandlerFunc(func(params ppm.SubmitPPMShipmentDocumentationParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.SubmitPPMShipmentDocumentation has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }), + MoveDocsUpdateMoveDocumentHandler: move_docs.UpdateMoveDocumentHandlerFunc(func(params move_docs.UpdateMoveDocumentParams) middleware.Responder { + return middleware.NotImplemented("operation move_docs.UpdateMoveDocument has not yet been implemented") + }), + PpmUpdateMovingExpenseHandler: ppm.UpdateMovingExpenseHandlerFunc(func(params ppm.UpdateMovingExpenseParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateMovingExpense has not yet been implemented") + }), + OktaProfileUpdateOktaInfoHandler: okta_profile.UpdateOktaInfoHandlerFunc(func(params okta_profile.UpdateOktaInfoParams) middleware.Responder { + return middleware.NotImplemented("operation okta_profile.UpdateOktaInfo has not yet been implemented") + }), + OrdersUpdateOrdersHandler: orders.UpdateOrdersHandlerFunc(func(params orders.UpdateOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.UpdateOrders has not yet been implemented") + }), + PpmUpdateProGearWeightTicketHandler: ppm.UpdateProGearWeightTicketHandlerFunc(func(params ppm.UpdateProGearWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateProGearWeightTicket has not yet been implemented") + }), + BackupContactsUpdateServiceMemberBackupContactHandler: backup_contacts.UpdateServiceMemberBackupContactHandlerFunc(func(params backup_contacts.UpdateServiceMemberBackupContactParams) middleware.Responder { + return middleware.NotImplemented("operation backup_contacts.UpdateServiceMemberBackupContact has not yet been implemented") + }), + PpmUpdateWeightTicketHandler: ppm.UpdateWeightTicketHandlerFunc(func(params ppm.UpdateWeightTicketParams) middleware.Responder { + return middleware.NotImplemented("operation ppm.UpdateWeightTicket has not yet been implemented") + }), + MovesUploadAdditionalDocumentsHandler: moves.UploadAdditionalDocumentsHandlerFunc(func(params moves.UploadAdditionalDocumentsParams) middleware.Responder { + return middleware.NotImplemented("operation moves.UploadAdditionalDocuments has not yet been implemented") + }), + OrdersUploadAmendedOrdersHandler: orders.UploadAmendedOrdersHandlerFunc(func(params orders.UploadAmendedOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation orders.UploadAmendedOrders has not yet been implemented") + }), + ApplicationParametersValidateHandler: application_parameters.ValidateHandlerFunc(func(params application_parameters.ValidateParams) middleware.Responder { + return middleware.NotImplemented("operation application_parameters.Validate has not yet been implemented") + }), + PostalCodesValidatePostalCodeWithRateDataHandler: postal_codes.ValidatePostalCodeWithRateDataHandlerFunc(func(params postal_codes.ValidatePostalCodeWithRateDataParams) middleware.Responder { + return middleware.NotImplemented("operation postal_codes.ValidatePostalCodeWithRateData has not yet been implemented") + }), + FeatureFlagsVariantFeatureFlagForUserHandler: feature_flags.VariantFeatureFlagForUserHandlerFunc(func(params feature_flags.VariantFeatureFlagForUserParams) middleware.Responder { + return middleware.NotImplemented("operation feature_flags.VariantFeatureFlagForUser has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Internal API is a RESTful API that enables the Customer application for +MilMove. + +All endpoints are located under `/internal`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + // MultipartformConsumer registers a consumer for the following mime types: + // - multipart/form-data + MultipartformConsumer runtime.Consumer + + // BinProducer registers a producer for the following mime types: + // - application/pdf + BinProducer runtime.Producer + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // OfficeApproveMoveHandler sets the operation handler for the approve move operation + OfficeApproveMoveHandler office.ApproveMoveHandler + // OfficeApproveReimbursementHandler sets the operation handler for the approve reimbursement operation + OfficeApproveReimbursementHandler office.ApproveReimbursementHandler + // FeatureFlagsBooleanFeatureFlagForUserHandler sets the operation handler for the boolean feature flag for user operation + FeatureFlagsBooleanFeatureFlagForUserHandler feature_flags.BooleanFeatureFlagForUserHandler + // OfficeCancelMoveHandler sets the operation handler for the cancel move operation + OfficeCancelMoveHandler office.CancelMoveHandler + // DocumentsCreateDocumentHandler sets the operation handler for the create document operation + DocumentsCreateDocumentHandler documents.CreateDocumentHandler + // MoveDocsCreateGenericMoveDocumentHandler sets the operation handler for the create generic move document operation + MoveDocsCreateGenericMoveDocumentHandler move_docs.CreateGenericMoveDocumentHandler + // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation + MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler + // PpmCreateMovingExpenseHandler sets the operation handler for the create moving expense operation + PpmCreateMovingExpenseHandler ppm.CreateMovingExpenseHandler + // OrdersCreateOrdersHandler sets the operation handler for the create orders operation + OrdersCreateOrdersHandler orders.CreateOrdersHandler + // PpmCreatePPMUploadHandler sets the operation handler for the create p p m upload operation + PpmCreatePPMUploadHandler ppm.CreatePPMUploadHandler + // PpmCreateProGearWeightTicketHandler sets the operation handler for the create pro gear weight ticket operation + PpmCreateProGearWeightTicketHandler ppm.CreateProGearWeightTicketHandler + // ServiceMembersCreateServiceMemberHandler sets the operation handler for the create service member operation + ServiceMembersCreateServiceMemberHandler service_members.CreateServiceMemberHandler + // BackupContactsCreateServiceMemberBackupContactHandler sets the operation handler for the create service member backup contact operation + BackupContactsCreateServiceMemberBackupContactHandler backup_contacts.CreateServiceMemberBackupContactHandler + // CertificationCreateSignedCertificationHandler sets the operation handler for the create signed certification operation + CertificationCreateSignedCertificationHandler certification.CreateSignedCertificationHandler + // UploadsCreateUploadHandler sets the operation handler for the create upload operation + UploadsCreateUploadHandler uploads.CreateUploadHandler + // PpmCreateWeightTicketHandler sets the operation handler for the create weight ticket operation + PpmCreateWeightTicketHandler ppm.CreateWeightTicketHandler + // MoveDocsCreateWeightTicketDocumentHandler sets the operation handler for the create weight ticket document operation + MoveDocsCreateWeightTicketDocumentHandler move_docs.CreateWeightTicketDocumentHandler + // MoveDocsDeleteMoveDocumentHandler sets the operation handler for the delete move document operation + MoveDocsDeleteMoveDocumentHandler move_docs.DeleteMoveDocumentHandler + // PpmDeleteMovingExpenseHandler sets the operation handler for the delete moving expense operation + PpmDeleteMovingExpenseHandler ppm.DeleteMovingExpenseHandler + // PpmDeleteProGearWeightTicketHandler sets the operation handler for the delete pro gear weight ticket operation + PpmDeleteProGearWeightTicketHandler ppm.DeleteProGearWeightTicketHandler + // MtoShipmentDeleteShipmentHandler sets the operation handler for the delete shipment operation + MtoShipmentDeleteShipmentHandler mto_shipment.DeleteShipmentHandler + // UploadsDeleteUploadHandler sets the operation handler for the delete upload operation + UploadsDeleteUploadHandler uploads.DeleteUploadHandler + // UploadsDeleteUploadsHandler sets the operation handler for the delete uploads operation + UploadsDeleteUploadsHandler uploads.DeleteUploadsHandler + // PpmDeleteWeightTicketHandler sets the operation handler for the delete weight ticket operation + PpmDeleteWeightTicketHandler ppm.DeleteWeightTicketHandler + // MovesGetAllMovesHandler sets the operation handler for the get all moves operation + MovesGetAllMovesHandler moves.GetAllMovesHandler + // AddressesGetLocationByZipCityStateHandler sets the operation handler for the get location by zip city state operation + AddressesGetLocationByZipCityStateHandler addresses.GetLocationByZipCityStateHandler + // TransportationOfficesGetTransportationOfficesHandler sets the operation handler for the get transportation offices operation + TransportationOfficesGetTransportationOfficesHandler transportation_offices.GetTransportationOfficesHandler + // EntitlementsIndexEntitlementsHandler sets the operation handler for the index entitlements operation + EntitlementsIndexEntitlementsHandler entitlements.IndexEntitlementsHandler + // MoveDocsIndexMoveDocumentsHandler sets the operation handler for the index move documents operation + MoveDocsIndexMoveDocumentsHandler move_docs.IndexMoveDocumentsHandler + // BackupContactsIndexServiceMemberBackupContactsHandler sets the operation handler for the index service member backup contacts operation + BackupContactsIndexServiceMemberBackupContactsHandler backup_contacts.IndexServiceMemberBackupContactsHandler + // CertificationIndexSignedCertificationHandler sets the operation handler for the index signed certification operation + CertificationIndexSignedCertificationHandler certification.IndexSignedCertificationHandler + // CalendarIsDateWeekendHolidayHandler sets the operation handler for the is date weekend holiday operation + CalendarIsDateWeekendHolidayHandler calendar.IsDateWeekendHolidayHandler + // UsersIsLoggedInUserHandler sets the operation handler for the is logged in user operation + UsersIsLoggedInUserHandler users.IsLoggedInUserHandler + // MtoShipmentListMTOShipmentsHandler sets the operation handler for the list m t o shipments operation + MtoShipmentListMTOShipmentsHandler mto_shipment.ListMTOShipmentsHandler + // MovesPatchMoveHandler sets the operation handler for the patch move operation + MovesPatchMoveHandler moves.PatchMoveHandler + // ServiceMembersPatchServiceMemberHandler sets the operation handler for the patch service member operation + ServiceMembersPatchServiceMemberHandler service_members.PatchServiceMemberHandler + // PpmResubmitPPMShipmentDocumentationHandler sets the operation handler for the resubmit p p m shipment documentation operation + PpmResubmitPPMShipmentDocumentationHandler ppm.ResubmitPPMShipmentDocumentationHandler + // DutyLocationsSearchDutyLocationsHandler sets the operation handler for the search duty locations operation + DutyLocationsSearchDutyLocationsHandler duty_locations.SearchDutyLocationsHandler + // PpmShowAOAPacketHandler sets the operation handler for the show a o a packet operation + PpmShowAOAPacketHandler ppm.ShowAOAPacketHandler + // AddressesShowAddressHandler sets the operation handler for the show address operation + AddressesShowAddressHandler addresses.ShowAddressHandler + // CalendarShowAvailableMoveDatesHandler sets the operation handler for the show available move dates operation + CalendarShowAvailableMoveDatesHandler calendar.ShowAvailableMoveDatesHandler + // TransportationOfficesShowCounselingOfficesHandler sets the operation handler for the show counseling offices operation + TransportationOfficesShowCounselingOfficesHandler transportation_offices.ShowCounselingOfficesHandler + // DocumentsShowDocumentHandler sets the operation handler for the show document operation + DocumentsShowDocumentHandler documents.ShowDocumentHandler + // TransportationOfficesShowDutyLocationTransportationOfficeHandler sets the operation handler for the show duty location transportation office operation + TransportationOfficesShowDutyLocationTransportationOfficeHandler transportation_offices.ShowDutyLocationTransportationOfficeHandler + // UsersShowLoggedInUserHandler sets the operation handler for the show logged in user operation + UsersShowLoggedInUserHandler users.ShowLoggedInUserHandler + // MovesShowMoveHandler sets the operation handler for the show move operation + MovesShowMoveHandler moves.ShowMoveHandler + // OfficeShowOfficeOrdersHandler sets the operation handler for the show office orders operation + OfficeShowOfficeOrdersHandler office.ShowOfficeOrdersHandler + // OktaProfileShowOktaInfoHandler sets the operation handler for the show okta info operation + OktaProfileShowOktaInfoHandler okta_profile.ShowOktaInfoHandler + // OrdersShowOrdersHandler sets the operation handler for the show orders operation + OrdersShowOrdersHandler orders.ShowOrdersHandler + // PpmShowPaymentPacketHandler sets the operation handler for the show payment packet operation + PpmShowPaymentPacketHandler ppm.ShowPaymentPacketHandler + // QueuesShowQueueHandler sets the operation handler for the show queue operation + QueuesShowQueueHandler queues.ShowQueueHandler + // ServiceMembersShowServiceMemberHandler sets the operation handler for the show service member operation + ServiceMembersShowServiceMemberHandler service_members.ShowServiceMemberHandler + // BackupContactsShowServiceMemberBackupContactHandler sets the operation handler for the show service member backup contact operation + BackupContactsShowServiceMemberBackupContactHandler backup_contacts.ShowServiceMemberBackupContactHandler + // ServiceMembersShowServiceMemberOrdersHandler sets the operation handler for the show service member orders operation + ServiceMembersShowServiceMemberOrdersHandler service_members.ShowServiceMemberOrdersHandler + // MovesSubmitAmendedOrdersHandler sets the operation handler for the submit amended orders operation + MovesSubmitAmendedOrdersHandler moves.SubmitAmendedOrdersHandler + // MovesSubmitMoveForApprovalHandler sets the operation handler for the submit move for approval operation + MovesSubmitMoveForApprovalHandler moves.SubmitMoveForApprovalHandler + // PpmSubmitPPMShipmentDocumentationHandler sets the operation handler for the submit p p m shipment documentation operation + PpmSubmitPPMShipmentDocumentationHandler ppm.SubmitPPMShipmentDocumentationHandler + // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation + MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler + // MoveDocsUpdateMoveDocumentHandler sets the operation handler for the update move document operation + MoveDocsUpdateMoveDocumentHandler move_docs.UpdateMoveDocumentHandler + // PpmUpdateMovingExpenseHandler sets the operation handler for the update moving expense operation + PpmUpdateMovingExpenseHandler ppm.UpdateMovingExpenseHandler + // OktaProfileUpdateOktaInfoHandler sets the operation handler for the update okta info operation + OktaProfileUpdateOktaInfoHandler okta_profile.UpdateOktaInfoHandler + // OrdersUpdateOrdersHandler sets the operation handler for the update orders operation + OrdersUpdateOrdersHandler orders.UpdateOrdersHandler + // PpmUpdateProGearWeightTicketHandler sets the operation handler for the update pro gear weight ticket operation + PpmUpdateProGearWeightTicketHandler ppm.UpdateProGearWeightTicketHandler + // BackupContactsUpdateServiceMemberBackupContactHandler sets the operation handler for the update service member backup contact operation + BackupContactsUpdateServiceMemberBackupContactHandler backup_contacts.UpdateServiceMemberBackupContactHandler + // PpmUpdateWeightTicketHandler sets the operation handler for the update weight ticket operation + PpmUpdateWeightTicketHandler ppm.UpdateWeightTicketHandler + // MovesUploadAdditionalDocumentsHandler sets the operation handler for the upload additional documents operation + MovesUploadAdditionalDocumentsHandler moves.UploadAdditionalDocumentsHandler + // OrdersUploadAmendedOrdersHandler sets the operation handler for the upload amended orders operation + OrdersUploadAmendedOrdersHandler orders.UploadAmendedOrdersHandler + // ApplicationParametersValidateHandler sets the operation handler for the validate operation + ApplicationParametersValidateHandler application_parameters.ValidateHandler + // PostalCodesValidatePostalCodeWithRateDataHandler sets the operation handler for the validate postal code with rate data operation + PostalCodesValidatePostalCodeWithRateDataHandler postal_codes.ValidatePostalCodeWithRateDataHandler + // FeatureFlagsVariantFeatureFlagForUserHandler sets the operation handler for the variant feature flag for user operation + FeatureFlagsVariantFeatureFlagForUserHandler feature_flags.VariantFeatureFlagForUserHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + if o.MultipartformConsumer == nil { + unregistered = append(unregistered, "MultipartformConsumer") + } + + if o.BinProducer == nil { + unregistered = append(unregistered, "BinProducer") + } + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.OfficeApproveMoveHandler == nil { + unregistered = append(unregistered, "office.ApproveMoveHandler") + } + if o.OfficeApproveReimbursementHandler == nil { + unregistered = append(unregistered, "office.ApproveReimbursementHandler") + } + if o.FeatureFlagsBooleanFeatureFlagForUserHandler == nil { + unregistered = append(unregistered, "feature_flags.BooleanFeatureFlagForUserHandler") + } + if o.OfficeCancelMoveHandler == nil { + unregistered = append(unregistered, "office.CancelMoveHandler") + } + if o.DocumentsCreateDocumentHandler == nil { + unregistered = append(unregistered, "documents.CreateDocumentHandler") + } + if o.MoveDocsCreateGenericMoveDocumentHandler == nil { + unregistered = append(unregistered, "move_docs.CreateGenericMoveDocumentHandler") + } + if o.MtoShipmentCreateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") + } + if o.PpmCreateMovingExpenseHandler == nil { + unregistered = append(unregistered, "ppm.CreateMovingExpenseHandler") + } + if o.OrdersCreateOrdersHandler == nil { + unregistered = append(unregistered, "orders.CreateOrdersHandler") + } + if o.PpmCreatePPMUploadHandler == nil { + unregistered = append(unregistered, "ppm.CreatePPMUploadHandler") + } + if o.PpmCreateProGearWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.CreateProGearWeightTicketHandler") + } + if o.ServiceMembersCreateServiceMemberHandler == nil { + unregistered = append(unregistered, "service_members.CreateServiceMemberHandler") + } + if o.BackupContactsCreateServiceMemberBackupContactHandler == nil { + unregistered = append(unregistered, "backup_contacts.CreateServiceMemberBackupContactHandler") + } + if o.CertificationCreateSignedCertificationHandler == nil { + unregistered = append(unregistered, "certification.CreateSignedCertificationHandler") + } + if o.UploadsCreateUploadHandler == nil { + unregistered = append(unregistered, "uploads.CreateUploadHandler") + } + if o.PpmCreateWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.CreateWeightTicketHandler") + } + if o.MoveDocsCreateWeightTicketDocumentHandler == nil { + unregistered = append(unregistered, "move_docs.CreateWeightTicketDocumentHandler") + } + if o.MoveDocsDeleteMoveDocumentHandler == nil { + unregistered = append(unregistered, "move_docs.DeleteMoveDocumentHandler") + } + if o.PpmDeleteMovingExpenseHandler == nil { + unregistered = append(unregistered, "ppm.DeleteMovingExpenseHandler") + } + if o.PpmDeleteProGearWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.DeleteProGearWeightTicketHandler") + } + if o.MtoShipmentDeleteShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.DeleteShipmentHandler") + } + if o.UploadsDeleteUploadHandler == nil { + unregistered = append(unregistered, "uploads.DeleteUploadHandler") + } + if o.UploadsDeleteUploadsHandler == nil { + unregistered = append(unregistered, "uploads.DeleteUploadsHandler") + } + if o.PpmDeleteWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.DeleteWeightTicketHandler") + } + if o.MovesGetAllMovesHandler == nil { + unregistered = append(unregistered, "moves.GetAllMovesHandler") + } + if o.AddressesGetLocationByZipCityStateHandler == nil { + unregistered = append(unregistered, "addresses.GetLocationByZipCityStateHandler") + } + if o.TransportationOfficesGetTransportationOfficesHandler == nil { + unregistered = append(unregistered, "transportation_offices.GetTransportationOfficesHandler") + } + if o.EntitlementsIndexEntitlementsHandler == nil { + unregistered = append(unregistered, "entitlements.IndexEntitlementsHandler") + } + if o.MoveDocsIndexMoveDocumentsHandler == nil { + unregistered = append(unregistered, "move_docs.IndexMoveDocumentsHandler") + } + if o.BackupContactsIndexServiceMemberBackupContactsHandler == nil { + unregistered = append(unregistered, "backup_contacts.IndexServiceMemberBackupContactsHandler") + } + if o.CertificationIndexSignedCertificationHandler == nil { + unregistered = append(unregistered, "certification.IndexSignedCertificationHandler") + } + if o.CalendarIsDateWeekendHolidayHandler == nil { + unregistered = append(unregistered, "calendar.IsDateWeekendHolidayHandler") + } + if o.UsersIsLoggedInUserHandler == nil { + unregistered = append(unregistered, "users.IsLoggedInUserHandler") + } + if o.MtoShipmentListMTOShipmentsHandler == nil { + unregistered = append(unregistered, "mto_shipment.ListMTOShipmentsHandler") + } + if o.MovesPatchMoveHandler == nil { + unregistered = append(unregistered, "moves.PatchMoveHandler") + } + if o.ServiceMembersPatchServiceMemberHandler == nil { + unregistered = append(unregistered, "service_members.PatchServiceMemberHandler") + } + if o.PpmResubmitPPMShipmentDocumentationHandler == nil { + unregistered = append(unregistered, "ppm.ResubmitPPMShipmentDocumentationHandler") + } + if o.DutyLocationsSearchDutyLocationsHandler == nil { + unregistered = append(unregistered, "duty_locations.SearchDutyLocationsHandler") + } + if o.PpmShowAOAPacketHandler == nil { + unregistered = append(unregistered, "ppm.ShowAOAPacketHandler") + } + if o.AddressesShowAddressHandler == nil { + unregistered = append(unregistered, "addresses.ShowAddressHandler") + } + if o.CalendarShowAvailableMoveDatesHandler == nil { + unregistered = append(unregistered, "calendar.ShowAvailableMoveDatesHandler") + } + if o.TransportationOfficesShowCounselingOfficesHandler == nil { + unregistered = append(unregistered, "transportation_offices.ShowCounselingOfficesHandler") + } + if o.DocumentsShowDocumentHandler == nil { + unregistered = append(unregistered, "documents.ShowDocumentHandler") + } + if o.TransportationOfficesShowDutyLocationTransportationOfficeHandler == nil { + unregistered = append(unregistered, "transportation_offices.ShowDutyLocationTransportationOfficeHandler") + } + if o.UsersShowLoggedInUserHandler == nil { + unregistered = append(unregistered, "users.ShowLoggedInUserHandler") + } + if o.MovesShowMoveHandler == nil { + unregistered = append(unregistered, "moves.ShowMoveHandler") + } + if o.OfficeShowOfficeOrdersHandler == nil { + unregistered = append(unregistered, "office.ShowOfficeOrdersHandler") + } + if o.OktaProfileShowOktaInfoHandler == nil { + unregistered = append(unregistered, "okta_profile.ShowOktaInfoHandler") + } + if o.OrdersShowOrdersHandler == nil { + unregistered = append(unregistered, "orders.ShowOrdersHandler") + } + if o.PpmShowPaymentPacketHandler == nil { + unregistered = append(unregistered, "ppm.ShowPaymentPacketHandler") + } + if o.QueuesShowQueueHandler == nil { + unregistered = append(unregistered, "queues.ShowQueueHandler") + } + if o.ServiceMembersShowServiceMemberHandler == nil { + unregistered = append(unregistered, "service_members.ShowServiceMemberHandler") + } + if o.BackupContactsShowServiceMemberBackupContactHandler == nil { + unregistered = append(unregistered, "backup_contacts.ShowServiceMemberBackupContactHandler") + } + if o.ServiceMembersShowServiceMemberOrdersHandler == nil { + unregistered = append(unregistered, "service_members.ShowServiceMemberOrdersHandler") + } + if o.MovesSubmitAmendedOrdersHandler == nil { + unregistered = append(unregistered, "moves.SubmitAmendedOrdersHandler") + } + if o.MovesSubmitMoveForApprovalHandler == nil { + unregistered = append(unregistered, "moves.SubmitMoveForApprovalHandler") + } + if o.PpmSubmitPPMShipmentDocumentationHandler == nil { + unregistered = append(unregistered, "ppm.SubmitPPMShipmentDocumentationHandler") + } + if o.MtoShipmentUpdateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") + } + if o.MoveDocsUpdateMoveDocumentHandler == nil { + unregistered = append(unregistered, "move_docs.UpdateMoveDocumentHandler") + } + if o.PpmUpdateMovingExpenseHandler == nil { + unregistered = append(unregistered, "ppm.UpdateMovingExpenseHandler") + } + if o.OktaProfileUpdateOktaInfoHandler == nil { + unregistered = append(unregistered, "okta_profile.UpdateOktaInfoHandler") + } + if o.OrdersUpdateOrdersHandler == nil { + unregistered = append(unregistered, "orders.UpdateOrdersHandler") + } + if o.PpmUpdateProGearWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.UpdateProGearWeightTicketHandler") + } + if o.BackupContactsUpdateServiceMemberBackupContactHandler == nil { + unregistered = append(unregistered, "backup_contacts.UpdateServiceMemberBackupContactHandler") + } + if o.PpmUpdateWeightTicketHandler == nil { + unregistered = append(unregistered, "ppm.UpdateWeightTicketHandler") + } + if o.MovesUploadAdditionalDocumentsHandler == nil { + unregistered = append(unregistered, "moves.UploadAdditionalDocumentsHandler") + } + if o.OrdersUploadAmendedOrdersHandler == nil { + unregistered = append(unregistered, "orders.UploadAmendedOrdersHandler") + } + if o.ApplicationParametersValidateHandler == nil { + unregistered = append(unregistered, "application_parameters.ValidateHandler") + } + if o.PostalCodesValidatePostalCodeWithRateDataHandler == nil { + unregistered = append(unregistered, "postal_codes.ValidatePostalCodeWithRateDataHandler") + } + if o.FeatureFlagsVariantFeatureFlagForUserHandler == nil { + unregistered = append(unregistered, "feature_flags.VariantFeatureFlagForUserHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + case "multipart/form-data": + result["multipart/form-data"] = o.MultipartformConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/pdf": + result["application/pdf"] = o.BinProducer + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/approve"] = office.NewApproveMove(o.context, o.OfficeApproveMoveHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/reimbursement/{reimbursementId}/approve"] = office.NewApproveReimbursement(o.context, o.OfficeApproveReimbursementHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/feature-flags/user-boolean/{key}"] = feature_flags.NewBooleanFeatureFlagForUser(o.context, o.FeatureFlagsBooleanFeatureFlagForUserHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/cancel"] = office.NewCancelMove(o.context, o.OfficeCancelMoveHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/documents"] = documents.NewCreateDocument(o.context, o.DocumentsCreateDocumentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/move_documents"] = move_docs.NewCreateGenericMoveDocument(o.context, o.MoveDocsCreateGenericMoveDocumentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto_shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/moving-expenses"] = ppm.NewCreateMovingExpense(o.context, o.PpmCreateMovingExpenseHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/orders"] = orders.NewCreateOrders(o.context, o.OrdersCreateOrdersHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/uploads"] = ppm.NewCreatePPMUpload(o.context, o.PpmCreatePPMUploadHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets"] = ppm.NewCreateProGearWeightTicket(o.context, o.PpmCreateProGearWeightTicketHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/service_members"] = service_members.NewCreateServiceMember(o.context, o.ServiceMembersCreateServiceMemberHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/service_members/{serviceMemberId}/backup_contacts"] = backup_contacts.NewCreateServiceMemberBackupContact(o.context, o.BackupContactsCreateServiceMemberBackupContactHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/signed_certifications"] = certification.NewCreateSignedCertification(o.context, o.CertificationCreateSignedCertificationHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/uploads"] = uploads.NewCreateUpload(o.context, o.UploadsCreateUploadHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/weight-ticket"] = ppm.NewCreateWeightTicket(o.context, o.PpmCreateWeightTicketHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/weight_ticket"] = move_docs.NewCreateWeightTicketDocument(o.context, o.MoveDocsCreateWeightTicketDocumentHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/move_documents/{moveDocumentId}"] = move_docs.NewDeleteMoveDocument(o.context, o.MoveDocsDeleteMoveDocumentHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewDeleteMovingExpense(o.context, o.PpmDeleteMovingExpenseHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewDeleteProGearWeightTicket(o.context, o.PpmDeleteProGearWeightTicketHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/mto-shipments/{mtoShipmentId}"] = mto_shipment.NewDeleteShipment(o.context, o.MtoShipmentDeleteShipmentHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/uploads/{uploadId}"] = uploads.NewDeleteUpload(o.context, o.UploadsDeleteUploadHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/uploads"] = uploads.NewDeleteUploads(o.context, o.UploadsDeleteUploadsHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewDeleteWeightTicket(o.context, o.PpmDeleteWeightTicketHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/allmoves/{serviceMemberId}"] = moves.NewGetAllMoves(o.context, o.MovesGetAllMovesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/addresses/zip-city-lookup/{search}"] = addresses.NewGetLocationByZipCityState(o.context, o.AddressesGetLocationByZipCityStateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/transportation-offices"] = transportation_offices.NewGetTransportationOffices(o.context, o.TransportationOfficesGetTransportationOfficesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/entitlements"] = entitlements.NewIndexEntitlements(o.context, o.EntitlementsIndexEntitlementsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveId}/move_documents"] = move_docs.NewIndexMoveDocuments(o.context, o.MoveDocsIndexMoveDocumentsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/service_members/{serviceMemberId}/backup_contacts"] = backup_contacts.NewIndexServiceMemberBackupContacts(o.context, o.BackupContactsIndexServiceMemberBackupContactsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveId}/signed_certifications"] = certification.NewIndexSignedCertification(o.context, o.CertificationIndexSignedCertificationHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/calendar/{countryCode}/is-weekend-holiday/{date}"] = calendar.NewIsDateWeekendHoliday(o.context, o.CalendarIsDateWeekendHolidayHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/users/is_logged_in"] = users.NewIsLoggedInUser(o.context, o.UsersIsLoggedInUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveTaskOrderID}/mto_shipments"] = mto_shipment.NewListMTOShipments(o.context, o.MtoShipmentListMTOShipmentsHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveId}"] = moves.NewPatchMove(o.context, o.MovesPatchMoveHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/service_members/{serviceMemberId}"] = service_members.NewPatchServiceMember(o.context, o.ServiceMembersPatchServiceMemberHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}"] = ppm.NewResubmitPPMShipmentDocumentation(o.context, o.PpmResubmitPPMShipmentDocumentationHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/duty_locations"] = duty_locations.NewSearchDutyLocations(o.context, o.DutyLocationsSearchDutyLocationsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/aoa-packet"] = ppm.NewShowAOAPacket(o.context, o.PpmShowAOAPacketHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/addresses/{addressId}"] = addresses.NewShowAddress(o.context, o.AddressesShowAddressHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/calendar/available_move_dates"] = calendar.NewShowAvailableMoveDates(o.context, o.CalendarShowAvailableMoveDatesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/transportation_offices/{dutyLocationId}/counseling_offices"] = transportation_offices.NewShowCounselingOffices(o.context, o.TransportationOfficesShowCounselingOfficesHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/documents/{documentId}"] = documents.NewShowDocument(o.context, o.DocumentsShowDocumentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/duty_locations/{dutyLocationId}/transportation_office"] = transportation_offices.NewShowDutyLocationTransportationOffice(o.context, o.TransportationOfficesShowDutyLocationTransportationOfficeHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/users/logged_in"] = users.NewShowLoggedInUser(o.context, o.UsersShowLoggedInUserHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveId}"] = moves.NewShowMove(o.context, o.MovesShowMoveHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{moveId}/orders"] = office.NewShowOfficeOrders(o.context, o.OfficeShowOfficeOrdersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/okta-profile"] = okta_profile.NewShowOktaInfo(o.context, o.OktaProfileShowOktaInfoHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/orders/{ordersId}"] = orders.NewShowOrders(o.context, o.OrdersShowOrdersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/ppm-shipments/{ppmShipmentId}/payment-packet"] = ppm.NewShowPaymentPacket(o.context, o.PpmShowPaymentPacketHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/queues/{queueType}"] = queues.NewShowQueue(o.context, o.QueuesShowQueueHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/service_members/{serviceMemberId}"] = service_members.NewShowServiceMember(o.context, o.ServiceMembersShowServiceMemberHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/backup_contacts/{backupContactId}"] = backup_contacts.NewShowServiceMemberBackupContact(o.context, o.BackupContactsShowServiceMemberBackupContactHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/service_members/{serviceMemberId}/current_orders"] = service_members.NewShowServiceMemberOrders(o.context, o.ServiceMembersShowServiceMemberOrdersHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/submit_amended_orders"] = moves.NewSubmitAmendedOrders(o.context, o.MovesSubmitAmendedOrdersHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/moves/{moveId}/submit"] = moves.NewSubmitMoveForApproval(o.context, o.MovesSubmitMoveForApprovalHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation"] = ppm.NewSubmitPPMShipmentDocumentation(o.context, o.PpmSubmitPPMShipmentDocumentationHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentId}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/move_documents/{moveDocumentId}"] = move_docs.NewUpdateMoveDocument(o.context, o.MoveDocsUpdateMoveDocumentHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}"] = ppm.NewUpdateMovingExpense(o.context, o.PpmUpdateMovingExpenseHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/okta-profile"] = okta_profile.NewUpdateOktaInfo(o.context, o.OktaProfileUpdateOktaInfoHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/orders/{ordersId}"] = orders.NewUpdateOrders(o.context, o.OrdersUpdateOrdersHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}"] = ppm.NewUpdateProGearWeightTicket(o.context, o.PpmUpdateProGearWeightTicketHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/backup_contacts/{backupContactId}"] = backup_contacts.NewUpdateServiceMemberBackupContact(o.context, o.BackupContactsUpdateServiceMemberBackupContactHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}"] = ppm.NewUpdateWeightTicket(o.context, o.PpmUpdateWeightTicketHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/moves/{moveId}/uploadAdditionalDocuments"] = moves.NewUploadAdditionalDocuments(o.context, o.MovesUploadAdditionalDocumentsHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/orders/{ordersId}/upload_amended_orders"] = orders.NewUploadAmendedOrders(o.context, o.OrdersUploadAmendedOrdersHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/application_parameters"] = application_parameters.NewValidate(o.context, o.ApplicationParametersValidateHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/rate_engine_postal_codes/{postal_code}"] = postal_codes.NewValidatePostalCodeWithRateData(o.context, o.PostalCodesValidatePostalCodeWithRateDataHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/feature-flags/user-variant/{key}"] = feature_flags.NewVariantFeatureFlagForUser(o.context, o.FeatureFlagsVariantFeatureFlagForUserHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move.go b/pkg/gen/internalapi/internaloperations/office/approve_move.go new file mode 100644 index 00000000000..eaa496d39ac --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveMoveHandlerFunc turns a function with the right signature into a approve move handler +type ApproveMoveHandlerFunc func(ApproveMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveMoveHandlerFunc) Handle(params ApproveMoveParams) middleware.Responder { + return fn(params) +} + +// ApproveMoveHandler interface for that can handle valid approve move params +type ApproveMoveHandler interface { + Handle(ApproveMoveParams) middleware.Responder +} + +// NewApproveMove creates a new http.Handler for the approve move operation +func NewApproveMove(ctx *middleware.Context, handler ApproveMoveHandler) *ApproveMove { + return &ApproveMove{Context: ctx, Handler: handler} +} + +/* + ApproveMove swagger:route POST /moves/{moveId}/approve office approveMove + +# Approves a move to proceed + +Approves the basic details of a move. The status of the move will be updated to APPROVED +*/ +type ApproveMove struct { + Context *middleware.Context + Handler ApproveMoveHandler +} + +func (o *ApproveMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go b/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go new file mode 100644 index 00000000000..f7f342996c8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_move_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewApproveMoveParams creates a new ApproveMoveParams object +// +// There are no default values defined in the spec. +func NewApproveMoveParams() ApproveMoveParams { + + return ApproveMoveParams{} +} + +// ApproveMoveParams contains all the bound params for the approve move operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveMove +type ApproveMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveMoveParams() beforehand. +func (o *ApproveMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *ApproveMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *ApproveMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go b/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go new file mode 100644 index 00000000000..085324662e5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_move_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ApproveMoveOKCode is the HTTP code returned for type ApproveMoveOK +const ApproveMoveOKCode int = 200 + +/* +ApproveMoveOK returns updated (approved) move object + +swagger:response approveMoveOK +*/ +type ApproveMoveOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewApproveMoveOK creates ApproveMoveOK with default headers values +func NewApproveMoveOK() *ApproveMoveOK { + + return &ApproveMoveOK{} +} + +// WithPayload adds the payload to the approve move o k response +func (o *ApproveMoveOK) WithPayload(payload *internalmessages.MovePayload) *ApproveMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve move o k response +func (o *ApproveMoveOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveMoveBadRequestCode is the HTTP code returned for type ApproveMoveBadRequest +const ApproveMoveBadRequestCode int = 400 + +/* +ApproveMoveBadRequest invalid request + +swagger:response approveMoveBadRequest +*/ +type ApproveMoveBadRequest struct { +} + +// NewApproveMoveBadRequest creates ApproveMoveBadRequest with default headers values +func NewApproveMoveBadRequest() *ApproveMoveBadRequest { + + return &ApproveMoveBadRequest{} +} + +// WriteResponse to the client +func (o *ApproveMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ApproveMoveUnauthorizedCode is the HTTP code returned for type ApproveMoveUnauthorized +const ApproveMoveUnauthorizedCode int = 401 + +/* +ApproveMoveUnauthorized must be authenticated to use this endpoint + +swagger:response approveMoveUnauthorized +*/ +type ApproveMoveUnauthorized struct { +} + +// NewApproveMoveUnauthorized creates ApproveMoveUnauthorized with default headers values +func NewApproveMoveUnauthorized() *ApproveMoveUnauthorized { + + return &ApproveMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *ApproveMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ApproveMoveForbiddenCode is the HTTP code returned for type ApproveMoveForbidden +const ApproveMoveForbiddenCode int = 403 + +/* +ApproveMoveForbidden not authorized to approve this move + +swagger:response approveMoveForbidden +*/ +type ApproveMoveForbidden struct { +} + +// NewApproveMoveForbidden creates ApproveMoveForbidden with default headers values +func NewApproveMoveForbidden() *ApproveMoveForbidden { + + return &ApproveMoveForbidden{} +} + +// WriteResponse to the client +func (o *ApproveMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ApproveMoveConflictCode is the HTTP code returned for type ApproveMoveConflict +const ApproveMoveConflictCode int = 409 + +/* +ApproveMoveConflict the move is not in a state to be approved + +swagger:response approveMoveConflict +*/ +type ApproveMoveConflict struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewApproveMoveConflict creates ApproveMoveConflict with default headers values +func NewApproveMoveConflict() *ApproveMoveConflict { + + return &ApproveMoveConflict{} +} + +// WithPayload adds the payload to the approve move conflict response +func (o *ApproveMoveConflict) WithPayload(payload *internalmessages.MovePayload) *ApproveMoveConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve move conflict response +func (o *ApproveMoveConflict) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveMoveConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveMoveInternalServerErrorCode is the HTTP code returned for type ApproveMoveInternalServerError +const ApproveMoveInternalServerErrorCode int = 500 + +/* +ApproveMoveInternalServerError server error + +swagger:response approveMoveInternalServerError +*/ +type ApproveMoveInternalServerError struct { +} + +// NewApproveMoveInternalServerError creates ApproveMoveInternalServerError with default headers values +func NewApproveMoveInternalServerError() *ApproveMoveInternalServerError { + + return &ApproveMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *ApproveMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go new file mode 100644 index 00000000000..eefffa6147b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ApproveMoveURL generates an URL for the approve move operation +type ApproveMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveMoveURL) WithBasePath(bp string) *ApproveMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/approve" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on ApproveMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go new file mode 100644 index 00000000000..db2dafc26e4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveReimbursementHandlerFunc turns a function with the right signature into a approve reimbursement handler +type ApproveReimbursementHandlerFunc func(ApproveReimbursementParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveReimbursementHandlerFunc) Handle(params ApproveReimbursementParams) middleware.Responder { + return fn(params) +} + +// ApproveReimbursementHandler interface for that can handle valid approve reimbursement params +type ApproveReimbursementHandler interface { + Handle(ApproveReimbursementParams) middleware.Responder +} + +// NewApproveReimbursement creates a new http.Handler for the approve reimbursement operation +func NewApproveReimbursement(ctx *middleware.Context, handler ApproveReimbursementHandler) *ApproveReimbursement { + return &ApproveReimbursement{Context: ctx, Handler: handler} +} + +/* + ApproveReimbursement swagger:route POST /reimbursement/{reimbursementId}/approve office approveReimbursement + +# Approves the reimbursement + +Sets the status of the reimbursement to APPROVED. +*/ +type ApproveReimbursement struct { + Context *middleware.Context + Handler ApproveReimbursementHandler +} + +func (o *ApproveReimbursement) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveReimbursementParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go new file mode 100644 index 00000000000..fc11f2ca9a7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewApproveReimbursementParams creates a new ApproveReimbursementParams object +// +// There are no default values defined in the spec. +func NewApproveReimbursementParams() ApproveReimbursementParams { + + return ApproveReimbursementParams{} +} + +// ApproveReimbursementParams contains all the bound params for the approve reimbursement operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveReimbursement +type ApproveReimbursementParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the reimbursement being approved + Required: true + In: path + */ + ReimbursementID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveReimbursementParams() beforehand. +func (o *ApproveReimbursementParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rReimbursementID, rhkReimbursementID, _ := route.Params.GetOK("reimbursementId") + if err := o.bindReimbursementID(rReimbursementID, rhkReimbursementID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindReimbursementID binds and validates parameter ReimbursementID from path. +func (o *ApproveReimbursementParams) bindReimbursementID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reimbursementId", "path", "strfmt.UUID", raw) + } + o.ReimbursementID = *(value.(*strfmt.UUID)) + + if err := o.validateReimbursementID(formats); err != nil { + return err + } + + return nil +} + +// validateReimbursementID carries on validations for parameter ReimbursementID +func (o *ApproveReimbursementParams) validateReimbursementID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reimbursementId", "path", "uuid", o.ReimbursementID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go new file mode 100644 index 00000000000..0a53b994f0a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ApproveReimbursementOKCode is the HTTP code returned for type ApproveReimbursementOK +const ApproveReimbursementOKCode int = 200 + +/* +ApproveReimbursementOK updated instance of reimbursement + +swagger:response approveReimbursementOK +*/ +type ApproveReimbursementOK struct { + + /* + In: Body + */ + Payload *internalmessages.Reimbursement `json:"body,omitempty"` +} + +// NewApproveReimbursementOK creates ApproveReimbursementOK with default headers values +func NewApproveReimbursementOK() *ApproveReimbursementOK { + + return &ApproveReimbursementOK{} +} + +// WithPayload adds the payload to the approve reimbursement o k response +func (o *ApproveReimbursementOK) WithPayload(payload *internalmessages.Reimbursement) *ApproveReimbursementOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve reimbursement o k response +func (o *ApproveReimbursementOK) SetPayload(payload *internalmessages.Reimbursement) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveReimbursementOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveReimbursementBadRequestCode is the HTTP code returned for type ApproveReimbursementBadRequest +const ApproveReimbursementBadRequestCode int = 400 + +/* +ApproveReimbursementBadRequest invalid request + +swagger:response approveReimbursementBadRequest +*/ +type ApproveReimbursementBadRequest struct { +} + +// NewApproveReimbursementBadRequest creates ApproveReimbursementBadRequest with default headers values +func NewApproveReimbursementBadRequest() *ApproveReimbursementBadRequest { + + return &ApproveReimbursementBadRequest{} +} + +// WriteResponse to the client +func (o *ApproveReimbursementBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ApproveReimbursementUnauthorizedCode is the HTTP code returned for type ApproveReimbursementUnauthorized +const ApproveReimbursementUnauthorizedCode int = 401 + +/* +ApproveReimbursementUnauthorized request requires user authentication + +swagger:response approveReimbursementUnauthorized +*/ +type ApproveReimbursementUnauthorized struct { +} + +// NewApproveReimbursementUnauthorized creates ApproveReimbursementUnauthorized with default headers values +func NewApproveReimbursementUnauthorized() *ApproveReimbursementUnauthorized { + + return &ApproveReimbursementUnauthorized{} +} + +// WriteResponse to the client +func (o *ApproveReimbursementUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ApproveReimbursementForbiddenCode is the HTTP code returned for type ApproveReimbursementForbidden +const ApproveReimbursementForbiddenCode int = 403 + +/* +ApproveReimbursementForbidden user is not authorized + +swagger:response approveReimbursementForbidden +*/ +type ApproveReimbursementForbidden struct { +} + +// NewApproveReimbursementForbidden creates ApproveReimbursementForbidden with default headers values +func NewApproveReimbursementForbidden() *ApproveReimbursementForbidden { + + return &ApproveReimbursementForbidden{} +} + +// WriteResponse to the client +func (o *ApproveReimbursementForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ApproveReimbursementInternalServerErrorCode is the HTTP code returned for type ApproveReimbursementInternalServerError +const ApproveReimbursementInternalServerErrorCode int = 500 + +/* +ApproveReimbursementInternalServerError internal server error + +swagger:response approveReimbursementInternalServerError +*/ +type ApproveReimbursementInternalServerError struct { +} + +// NewApproveReimbursementInternalServerError creates ApproveReimbursementInternalServerError with default headers values +func NewApproveReimbursementInternalServerError() *ApproveReimbursementInternalServerError { + + return &ApproveReimbursementInternalServerError{} +} + +// WriteResponse to the client +func (o *ApproveReimbursementInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go new file mode 100644 index 00000000000..98bea13d9cc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/approve_reimbursement_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ApproveReimbursementURL generates an URL for the approve reimbursement operation +type ApproveReimbursementURL struct { + ReimbursementID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveReimbursementURL) WithBasePath(bp string) *ApproveReimbursementURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveReimbursementURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveReimbursementURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/reimbursement/{reimbursementId}/approve" + + reimbursementID := o.ReimbursementID.String() + if reimbursementID != "" { + _path = strings.Replace(_path, "{reimbursementId}", reimbursementID, -1) + } else { + return nil, errors.New("reimbursementId is required on ApproveReimbursementURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveReimbursementURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveReimbursementURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveReimbursementURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveReimbursementURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveReimbursementURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveReimbursementURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move.go b/pkg/gen/internalapi/internaloperations/office/cancel_move.go new file mode 100644 index 00000000000..003825037f1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/cancel_move.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CancelMoveHandlerFunc turns a function with the right signature into a cancel move handler +type CancelMoveHandlerFunc func(CancelMoveParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CancelMoveHandlerFunc) Handle(params CancelMoveParams) middleware.Responder { + return fn(params) +} + +// CancelMoveHandler interface for that can handle valid cancel move params +type CancelMoveHandler interface { + Handle(CancelMoveParams) middleware.Responder +} + +// NewCancelMove creates a new http.Handler for the cancel move operation +func NewCancelMove(ctx *middleware.Context, handler CancelMoveHandler) *CancelMove { + return &CancelMove{Context: ctx, Handler: handler} +} + +/* + CancelMove swagger:route POST /moves/{moveId}/cancel office cancelMove + +# Cancels a move + +Cancels the basic details of a move. The status of the move will be updated to CANCELED +*/ +type CancelMove struct { + Context *middleware.Context + Handler CancelMoveHandler +} + +func (o *CancelMove) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCancelMoveParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go new file mode 100644 index 00000000000..614af937735 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/cancel_move_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewCancelMoveParams creates a new CancelMoveParams object +// +// There are no default values defined in the spec. +func NewCancelMoveParams() CancelMoveParams { + + return CancelMoveParams{} +} + +// CancelMoveParams contains all the bound params for the cancel move operation +// typically these are obtained from a http.Request +// +// swagger:parameters cancelMove +type CancelMoveParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCancelMoveParams() beforehand. +func (o *CancelMoveParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *CancelMoveParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *CancelMoveParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go new file mode 100644 index 00000000000..5e5d9ac11c4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/cancel_move_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CancelMoveOKCode is the HTTP code returned for type CancelMoveOK +const CancelMoveOKCode int = 200 + +/* +CancelMoveOK returns updated (canceled) move object + +swagger:response cancelMoveOK +*/ +type CancelMoveOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewCancelMoveOK creates CancelMoveOK with default headers values +func NewCancelMoveOK() *CancelMoveOK { + + return &CancelMoveOK{} +} + +// WithPayload adds the payload to the cancel move o k response +func (o *CancelMoveOK) WithPayload(payload *internalmessages.MovePayload) *CancelMoveOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the cancel move o k response +func (o *CancelMoveOK) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CancelMoveOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CancelMoveBadRequestCode is the HTTP code returned for type CancelMoveBadRequest +const CancelMoveBadRequestCode int = 400 + +/* +CancelMoveBadRequest invalid request + +swagger:response cancelMoveBadRequest +*/ +type CancelMoveBadRequest struct { +} + +// NewCancelMoveBadRequest creates CancelMoveBadRequest with default headers values +func NewCancelMoveBadRequest() *CancelMoveBadRequest { + + return &CancelMoveBadRequest{} +} + +// WriteResponse to the client +func (o *CancelMoveBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CancelMoveUnauthorizedCode is the HTTP code returned for type CancelMoveUnauthorized +const CancelMoveUnauthorizedCode int = 401 + +/* +CancelMoveUnauthorized must be authenticated to use this endpoint + +swagger:response cancelMoveUnauthorized +*/ +type CancelMoveUnauthorized struct { +} + +// NewCancelMoveUnauthorized creates CancelMoveUnauthorized with default headers values +func NewCancelMoveUnauthorized() *CancelMoveUnauthorized { + + return &CancelMoveUnauthorized{} +} + +// WriteResponse to the client +func (o *CancelMoveUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CancelMoveForbiddenCode is the HTTP code returned for type CancelMoveForbidden +const CancelMoveForbiddenCode int = 403 + +/* +CancelMoveForbidden not authorized to cancel this move + +swagger:response cancelMoveForbidden +*/ +type CancelMoveForbidden struct { +} + +// NewCancelMoveForbidden creates CancelMoveForbidden with default headers values +func NewCancelMoveForbidden() *CancelMoveForbidden { + + return &CancelMoveForbidden{} +} + +// WriteResponse to the client +func (o *CancelMoveForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CancelMoveConflictCode is the HTTP code returned for type CancelMoveConflict +const CancelMoveConflictCode int = 409 + +/* +CancelMoveConflict the move is not in a state to be canceled + +swagger:response cancelMoveConflict +*/ +type CancelMoveConflict struct { + + /* + In: Body + */ + Payload *internalmessages.MovePayload `json:"body,omitempty"` +} + +// NewCancelMoveConflict creates CancelMoveConflict with default headers values +func NewCancelMoveConflict() *CancelMoveConflict { + + return &CancelMoveConflict{} +} + +// WithPayload adds the payload to the cancel move conflict response +func (o *CancelMoveConflict) WithPayload(payload *internalmessages.MovePayload) *CancelMoveConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the cancel move conflict response +func (o *CancelMoveConflict) SetPayload(payload *internalmessages.MovePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CancelMoveConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CancelMoveInternalServerErrorCode is the HTTP code returned for type CancelMoveInternalServerError +const CancelMoveInternalServerErrorCode int = 500 + +/* +CancelMoveInternalServerError server error + +swagger:response cancelMoveInternalServerError +*/ +type CancelMoveInternalServerError struct { +} + +// NewCancelMoveInternalServerError creates CancelMoveInternalServerError with default headers values +func NewCancelMoveInternalServerError() *CancelMoveInternalServerError { + + return &CancelMoveInternalServerError{} +} + +// WriteResponse to the client +func (o *CancelMoveInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go new file mode 100644 index 00000000000..2c2faf91575 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/cancel_move_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CancelMoveURL generates an URL for the cancel move operation +type CancelMoveURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CancelMoveURL) WithBasePath(bp string) *CancelMoveURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CancelMoveURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CancelMoveURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/cancel" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on CancelMoveURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CancelMoveURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CancelMoveURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CancelMoveURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CancelMoveURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CancelMoveURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CancelMoveURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders.go new file mode 100644 index 00000000000..2c98b9d710c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/show_office_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowOfficeOrdersHandlerFunc turns a function with the right signature into a show office orders handler +type ShowOfficeOrdersHandlerFunc func(ShowOfficeOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowOfficeOrdersHandlerFunc) Handle(params ShowOfficeOrdersParams) middleware.Responder { + return fn(params) +} + +// ShowOfficeOrdersHandler interface for that can handle valid show office orders params +type ShowOfficeOrdersHandler interface { + Handle(ShowOfficeOrdersParams) middleware.Responder +} + +// NewShowOfficeOrders creates a new http.Handler for the show office orders operation +func NewShowOfficeOrders(ctx *middleware.Context, handler ShowOfficeOrdersHandler) *ShowOfficeOrders { + return &ShowOfficeOrders{Context: ctx, Handler: handler} +} + +/* + ShowOfficeOrders swagger:route GET /moves/{moveId}/orders office showOfficeOrders + +# Returns orders information for a move for office use + +Returns orders information for a move for office use +*/ +type ShowOfficeOrders struct { + Context *middleware.Context + Handler ShowOfficeOrdersHandler +} + +func (o *ShowOfficeOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowOfficeOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go new file mode 100644 index 00000000000..8b315ee768f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/show_office_orders_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowOfficeOrdersParams creates a new ShowOfficeOrdersParams object +// +// There are no default values defined in the spec. +func NewShowOfficeOrdersParams() ShowOfficeOrdersParams { + + return ShowOfficeOrdersParams{} +} + +// ShowOfficeOrdersParams contains all the bound params for the show office orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters showOfficeOrders +type ShowOfficeOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the move + Required: true + In: path + */ + MoveID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowOfficeOrdersParams() beforehand. +func (o *ShowOfficeOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveId") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *ShowOfficeOrdersParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "path", "strfmt.UUID", raw) + } + o.MoveID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *ShowOfficeOrdersParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "path", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go new file mode 100644 index 00000000000..f76b5be2ef7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/show_office_orders_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowOfficeOrdersOKCode is the HTTP code returned for type ShowOfficeOrdersOK +const ShowOfficeOrdersOKCode int = 200 + +/* +ShowOfficeOrdersOK the orders information for a move for office use + +swagger:response showOfficeOrdersOK +*/ +type ShowOfficeOrdersOK struct { + + /* + In: Body + */ + Payload *internalmessages.Orders `json:"body,omitempty"` +} + +// NewShowOfficeOrdersOK creates ShowOfficeOrdersOK with default headers values +func NewShowOfficeOrdersOK() *ShowOfficeOrdersOK { + + return &ShowOfficeOrdersOK{} +} + +// WithPayload adds the payload to the show office orders o k response +func (o *ShowOfficeOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowOfficeOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show office orders o k response +func (o *ShowOfficeOrdersOK) SetPayload(payload *internalmessages.Orders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowOfficeOrdersBadRequestCode is the HTTP code returned for type ShowOfficeOrdersBadRequest +const ShowOfficeOrdersBadRequestCode int = 400 + +/* +ShowOfficeOrdersBadRequest invalid request + +swagger:response showOfficeOrdersBadRequest +*/ +type ShowOfficeOrdersBadRequest struct { +} + +// NewShowOfficeOrdersBadRequest creates ShowOfficeOrdersBadRequest with default headers values +func NewShowOfficeOrdersBadRequest() *ShowOfficeOrdersBadRequest { + + return &ShowOfficeOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowOfficeOrdersUnauthorizedCode is the HTTP code returned for type ShowOfficeOrdersUnauthorized +const ShowOfficeOrdersUnauthorizedCode int = 401 + +/* +ShowOfficeOrdersUnauthorized request requires user authentication + +swagger:response showOfficeOrdersUnauthorized +*/ +type ShowOfficeOrdersUnauthorized struct { +} + +// NewShowOfficeOrdersUnauthorized creates ShowOfficeOrdersUnauthorized with default headers values +func NewShowOfficeOrdersUnauthorized() *ShowOfficeOrdersUnauthorized { + + return &ShowOfficeOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowOfficeOrdersForbiddenCode is the HTTP code returned for type ShowOfficeOrdersForbidden +const ShowOfficeOrdersForbiddenCode int = 403 + +/* +ShowOfficeOrdersForbidden user is not authorized + +swagger:response showOfficeOrdersForbidden +*/ +type ShowOfficeOrdersForbidden struct { +} + +// NewShowOfficeOrdersForbidden creates ShowOfficeOrdersForbidden with default headers values +func NewShowOfficeOrdersForbidden() *ShowOfficeOrdersForbidden { + + return &ShowOfficeOrdersForbidden{} +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowOfficeOrdersNotFoundCode is the HTTP code returned for type ShowOfficeOrdersNotFound +const ShowOfficeOrdersNotFoundCode int = 404 + +/* +ShowOfficeOrdersNotFound move not found + +swagger:response showOfficeOrdersNotFound +*/ +type ShowOfficeOrdersNotFound struct { +} + +// NewShowOfficeOrdersNotFound creates ShowOfficeOrdersNotFound with default headers values +func NewShowOfficeOrdersNotFound() *ShowOfficeOrdersNotFound { + + return &ShowOfficeOrdersNotFound{} +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowOfficeOrdersInternalServerErrorCode is the HTTP code returned for type ShowOfficeOrdersInternalServerError +const ShowOfficeOrdersInternalServerErrorCode int = 500 + +/* +ShowOfficeOrdersInternalServerError internal server error + +swagger:response showOfficeOrdersInternalServerError +*/ +type ShowOfficeOrdersInternalServerError struct { +} + +// NewShowOfficeOrdersInternalServerError creates ShowOfficeOrdersInternalServerError with default headers values +func NewShowOfficeOrdersInternalServerError() *ShowOfficeOrdersInternalServerError { + + return &ShowOfficeOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowOfficeOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go new file mode 100644 index 00000000000..4067e731324 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/office/show_office_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package office + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowOfficeOrdersURL generates an URL for the show office orders operation +type ShowOfficeOrdersURL struct { + MoveID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOfficeOrdersURL) WithBasePath(bp string) *ShowOfficeOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOfficeOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowOfficeOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{moveId}/orders" + + moveID := o.MoveID.String() + if moveID != "" { + _path = strings.Replace(_path, "{moveId}", moveID, -1) + } else { + return nil, errors.New("moveId is required on ShowOfficeOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowOfficeOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowOfficeOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowOfficeOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowOfficeOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowOfficeOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowOfficeOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go new file mode 100644 index 00000000000..37e9536ba1f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowOktaInfoHandlerFunc turns a function with the right signature into a show okta info handler +type ShowOktaInfoHandlerFunc func(ShowOktaInfoParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowOktaInfoHandlerFunc) Handle(params ShowOktaInfoParams) middleware.Responder { + return fn(params) +} + +// ShowOktaInfoHandler interface for that can handle valid show okta info params +type ShowOktaInfoHandler interface { + Handle(ShowOktaInfoParams) middleware.Responder +} + +// NewShowOktaInfo creates a new http.Handler for the show okta info operation +func NewShowOktaInfo(ctx *middleware.Context, handler ShowOktaInfoHandler) *ShowOktaInfo { + return &ShowOktaInfo{Context: ctx, Handler: handler} +} + +/* + ShowOktaInfo swagger:route GET /okta-profile okta_profile showOktaInfo + +# Returns Okta profile values from Okta's Users API + +Calls a GET request to Okta's Users API and returns profile values that includes Okta data that the user provided upon registration or most recent profile update. +*/ +type ShowOktaInfo struct { + Context *middleware.Context + Handler ShowOktaInfoHandler +} + +func (o *ShowOktaInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowOktaInfoParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go new file mode 100644 index 00000000000..4a2cfcfd092 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewShowOktaInfoParams creates a new ShowOktaInfoParams object +// +// There are no default values defined in the spec. +func NewShowOktaInfoParams() ShowOktaInfoParams { + + return ShowOktaInfoParams{} +} + +// ShowOktaInfoParams contains all the bound params for the show okta info operation +// typically these are obtained from a http.Request +// +// swagger:parameters showOktaInfo +type ShowOktaInfoParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowOktaInfoParams() beforehand. +func (o *ShowOktaInfoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go new file mode 100644 index 00000000000..107788c2f9a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowOktaInfoOKCode is the HTTP code returned for type ShowOktaInfoOK +const ShowOktaInfoOKCode int = 200 + +/* +ShowOktaInfoOK okta profile for user + +swagger:response showOktaInfoOK +*/ +type ShowOktaInfoOK struct { + + /* + In: Body + */ + Payload *internalmessages.OktaUserProfileData `json:"body,omitempty"` +} + +// NewShowOktaInfoOK creates ShowOktaInfoOK with default headers values +func NewShowOktaInfoOK() *ShowOktaInfoOK { + + return &ShowOktaInfoOK{} +} + +// WithPayload adds the payload to the show okta info o k response +func (o *ShowOktaInfoOK) WithPayload(payload *internalmessages.OktaUserProfileData) *ShowOktaInfoOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show okta info o k response +func (o *ShowOktaInfoOK) SetPayload(payload *internalmessages.OktaUserProfileData) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowOktaInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowOktaInfoBadRequestCode is the HTTP code returned for type ShowOktaInfoBadRequest +const ShowOktaInfoBadRequestCode int = 400 + +/* +ShowOktaInfoBadRequest invalid request + +swagger:response showOktaInfoBadRequest +*/ +type ShowOktaInfoBadRequest struct { +} + +// NewShowOktaInfoBadRequest creates ShowOktaInfoBadRequest with default headers values +func NewShowOktaInfoBadRequest() *ShowOktaInfoBadRequest { + + return &ShowOktaInfoBadRequest{} +} + +// WriteResponse to the client +func (o *ShowOktaInfoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowOktaInfoUnauthorizedCode is the HTTP code returned for type ShowOktaInfoUnauthorized +const ShowOktaInfoUnauthorizedCode int = 401 + +/* +ShowOktaInfoUnauthorized request requires user authentication + +swagger:response showOktaInfoUnauthorized +*/ +type ShowOktaInfoUnauthorized struct { +} + +// NewShowOktaInfoUnauthorized creates ShowOktaInfoUnauthorized with default headers values +func NewShowOktaInfoUnauthorized() *ShowOktaInfoUnauthorized { + + return &ShowOktaInfoUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowOktaInfoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowOktaInfoForbiddenCode is the HTTP code returned for type ShowOktaInfoForbidden +const ShowOktaInfoForbiddenCode int = 403 + +/* +ShowOktaInfoForbidden user is not authorized + +swagger:response showOktaInfoForbidden +*/ +type ShowOktaInfoForbidden struct { +} + +// NewShowOktaInfoForbidden creates ShowOktaInfoForbidden with default headers values +func NewShowOktaInfoForbidden() *ShowOktaInfoForbidden { + + return &ShowOktaInfoForbidden{} +} + +// WriteResponse to the client +func (o *ShowOktaInfoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowOktaInfoNotFoundCode is the HTTP code returned for type ShowOktaInfoNotFound +const ShowOktaInfoNotFoundCode int = 404 + +/* +ShowOktaInfoNotFound service member not found + +swagger:response showOktaInfoNotFound +*/ +type ShowOktaInfoNotFound struct { +} + +// NewShowOktaInfoNotFound creates ShowOktaInfoNotFound with default headers values +func NewShowOktaInfoNotFound() *ShowOktaInfoNotFound { + + return &ShowOktaInfoNotFound{} +} + +// WriteResponse to the client +func (o *ShowOktaInfoNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowOktaInfoInternalServerErrorCode is the HTTP code returned for type ShowOktaInfoInternalServerError +const ShowOktaInfoInternalServerErrorCode int = 500 + +/* +ShowOktaInfoInternalServerError internal server error + +swagger:response showOktaInfoInternalServerError +*/ +type ShowOktaInfoInternalServerError struct { +} + +// NewShowOktaInfoInternalServerError creates ShowOktaInfoInternalServerError with default headers values +func NewShowOktaInfoInternalServerError() *ShowOktaInfoInternalServerError { + + return &ShowOktaInfoInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowOktaInfoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go new file mode 100644 index 00000000000..d603ba975e4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/show_okta_info_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ShowOktaInfoURL generates an URL for the show okta info operation +type ShowOktaInfoURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOktaInfoURL) WithBasePath(bp string) *ShowOktaInfoURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOktaInfoURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowOktaInfoURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/okta-profile" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowOktaInfoURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowOktaInfoURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowOktaInfoURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowOktaInfoURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowOktaInfoURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowOktaInfoURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go new file mode 100644 index 00000000000..69a96f56f24 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateOktaInfoHandlerFunc turns a function with the right signature into a update okta info handler +type UpdateOktaInfoHandlerFunc func(UpdateOktaInfoParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateOktaInfoHandlerFunc) Handle(params UpdateOktaInfoParams) middleware.Responder { + return fn(params) +} + +// UpdateOktaInfoHandler interface for that can handle valid update okta info params +type UpdateOktaInfoHandler interface { + Handle(UpdateOktaInfoParams) middleware.Responder +} + +// NewUpdateOktaInfo creates a new http.Handler for the update okta info operation +func NewUpdateOktaInfo(ctx *middleware.Context, handler UpdateOktaInfoHandler) *UpdateOktaInfo { + return &UpdateOktaInfo{Context: ctx, Handler: handler} +} + +/* + UpdateOktaInfo swagger:route POST /okta-profile okta_profile updateOktaInfo + +Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values. + +Update the user's okta profile with primary data, returns Okta profile values from the Okta's Users API reflecting updated values. +*/ +type UpdateOktaInfo struct { + Context *middleware.Context + Handler UpdateOktaInfoHandler +} + +func (o *UpdateOktaInfo) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateOktaInfoParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go new file mode 100644 index 00000000000..ab513fa53a5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateOktaInfoParams creates a new UpdateOktaInfoParams object +// +// There are no default values defined in the spec. +func NewUpdateOktaInfoParams() UpdateOktaInfoParams { + + return UpdateOktaInfoParams{} +} + +// UpdateOktaInfoParams contains all the bound params for the update okta info operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateOktaInfo +type UpdateOktaInfoParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + UpdateOktaUserProfileData *internalmessages.UpdateOktaUserProfileData +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateOktaInfoParams() beforehand. +func (o *UpdateOktaInfoParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateOktaUserProfileData + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateOktaUserProfileData", "body", "")) + } else { + res = append(res, errors.NewParseError("updateOktaUserProfileData", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateOktaUserProfileData = &body + } + } + } else { + res = append(res, errors.Required("updateOktaUserProfileData", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go new file mode 100644 index 00000000000..717ea5a09eb --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_responses.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateOktaInfoOKCode is the HTTP code returned for type UpdateOktaInfoOK +const UpdateOktaInfoOKCode int = 200 + +/* +UpdateOktaInfoOK okta profile for user + +swagger:response updateOktaInfoOK +*/ +type UpdateOktaInfoOK struct { + + /* + In: Body + */ + Payload *internalmessages.OktaUserProfileData `json:"body,omitempty"` +} + +// NewUpdateOktaInfoOK creates UpdateOktaInfoOK with default headers values +func NewUpdateOktaInfoOK() *UpdateOktaInfoOK { + + return &UpdateOktaInfoOK{} +} + +// WithPayload adds the payload to the update okta info o k response +func (o *UpdateOktaInfoOK) WithPayload(payload *internalmessages.OktaUserProfileData) *UpdateOktaInfoOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update okta info o k response +func (o *UpdateOktaInfoOK) SetPayload(payload *internalmessages.OktaUserProfileData) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOktaInfoOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOktaInfoBadRequestCode is the HTTP code returned for type UpdateOktaInfoBadRequest +const UpdateOktaInfoBadRequestCode int = 400 + +/* +UpdateOktaInfoBadRequest invalid request + +swagger:response updateOktaInfoBadRequest +*/ +type UpdateOktaInfoBadRequest struct { +} + +// NewUpdateOktaInfoBadRequest creates UpdateOktaInfoBadRequest with default headers values +func NewUpdateOktaInfoBadRequest() *UpdateOktaInfoBadRequest { + + return &UpdateOktaInfoBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateOktaInfoBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateOktaInfoUnauthorizedCode is the HTTP code returned for type UpdateOktaInfoUnauthorized +const UpdateOktaInfoUnauthorizedCode int = 401 + +/* +UpdateOktaInfoUnauthorized request requires user authentication + +swagger:response updateOktaInfoUnauthorized +*/ +type UpdateOktaInfoUnauthorized struct { +} + +// NewUpdateOktaInfoUnauthorized creates UpdateOktaInfoUnauthorized with default headers values +func NewUpdateOktaInfoUnauthorized() *UpdateOktaInfoUnauthorized { + + return &UpdateOktaInfoUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateOktaInfoUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateOktaInfoForbiddenCode is the HTTP code returned for type UpdateOktaInfoForbidden +const UpdateOktaInfoForbiddenCode int = 403 + +/* +UpdateOktaInfoForbidden user is not authorized + +swagger:response updateOktaInfoForbidden +*/ +type UpdateOktaInfoForbidden struct { +} + +// NewUpdateOktaInfoForbidden creates UpdateOktaInfoForbidden with default headers values +func NewUpdateOktaInfoForbidden() *UpdateOktaInfoForbidden { + + return &UpdateOktaInfoForbidden{} +} + +// WriteResponse to the client +func (o *UpdateOktaInfoForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateOktaInfoUnprocessableEntityCode is the HTTP code returned for type UpdateOktaInfoUnprocessableEntity +const UpdateOktaInfoUnprocessableEntityCode int = 422 + +/* +UpdateOktaInfoUnprocessableEntity validation error + +swagger:response updateOktaInfoUnprocessableEntity +*/ +type UpdateOktaInfoUnprocessableEntity struct { + + /* + In: Body + */ + Payload interface{} `json:"body,omitempty"` +} + +// NewUpdateOktaInfoUnprocessableEntity creates UpdateOktaInfoUnprocessableEntity with default headers values +func NewUpdateOktaInfoUnprocessableEntity() *UpdateOktaInfoUnprocessableEntity { + + return &UpdateOktaInfoUnprocessableEntity{} +} + +// WithPayload adds the payload to the update okta info unprocessable entity response +func (o *UpdateOktaInfoUnprocessableEntity) WithPayload(payload interface{}) *UpdateOktaInfoUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update okta info unprocessable entity response +func (o *UpdateOktaInfoUnprocessableEntity) SetPayload(payload interface{}) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOktaInfoUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// UpdateOktaInfoInternalServerErrorCode is the HTTP code returned for type UpdateOktaInfoInternalServerError +const UpdateOktaInfoInternalServerErrorCode int = 500 + +/* +UpdateOktaInfoInternalServerError internal server error + +swagger:response updateOktaInfoInternalServerError +*/ +type UpdateOktaInfoInternalServerError struct { +} + +// NewUpdateOktaInfoInternalServerError creates UpdateOktaInfoInternalServerError with default headers values +func NewUpdateOktaInfoInternalServerError() *UpdateOktaInfoInternalServerError { + + return &UpdateOktaInfoInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateOktaInfoInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go new file mode 100644 index 00000000000..ad661f25a4e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/okta_profile/update_okta_info_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package okta_profile + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// UpdateOktaInfoURL generates an URL for the update okta info operation +type UpdateOktaInfoURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOktaInfoURL) WithBasePath(bp string) *UpdateOktaInfoURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOktaInfoURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateOktaInfoURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/okta-profile" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateOktaInfoURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateOktaInfoURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateOktaInfoURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateOktaInfoURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateOktaInfoURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateOktaInfoURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders.go b/pkg/gen/internalapi/internaloperations/orders/create_orders.go new file mode 100644 index 00000000000..49509ae1973 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/create_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateOrdersHandlerFunc turns a function with the right signature into a create orders handler +type CreateOrdersHandlerFunc func(CreateOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateOrdersHandlerFunc) Handle(params CreateOrdersParams) middleware.Responder { + return fn(params) +} + +// CreateOrdersHandler interface for that can handle valid create orders params +type CreateOrdersHandler interface { + Handle(CreateOrdersParams) middleware.Responder +} + +// NewCreateOrders creates a new http.Handler for the create orders operation +func NewCreateOrders(ctx *middleware.Context, handler CreateOrdersHandler) *CreateOrders { + return &CreateOrders{Context: ctx, Handler: handler} +} + +/* + CreateOrders swagger:route POST /orders orders createOrders + +# Creates an orders model for a logged-in user + +Creates an instance of orders tied to a service member +*/ +type CreateOrders struct { + Context *middleware.Context + Handler CreateOrdersHandler +} + +func (o *CreateOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go new file mode 100644 index 00000000000..f910ce190ef --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/create_orders_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateOrdersParams creates a new CreateOrdersParams object +// +// There are no default values defined in the spec. +func NewCreateOrdersParams() CreateOrdersParams { + + return CreateOrdersParams{} +} + +// CreateOrdersParams contains all the bound params for the create orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters createOrders +type CreateOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateOrders *internalmessages.CreateUpdateOrders +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateOrdersParams() beforehand. +func (o *CreateOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateUpdateOrders + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createOrders", "body", "")) + } else { + res = append(res, errors.NewParseError("createOrders", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateOrders = &body + } + } + } else { + res = append(res, errors.Required("createOrders", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go new file mode 100644 index 00000000000..5ef4c198e25 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/create_orders_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateOrdersCreatedCode is the HTTP code returned for type CreateOrdersCreated +const CreateOrdersCreatedCode int = 201 + +/* +CreateOrdersCreated created instance of orders + +swagger:response createOrdersCreated +*/ +type CreateOrdersCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Orders `json:"body,omitempty"` +} + +// NewCreateOrdersCreated creates CreateOrdersCreated with default headers values +func NewCreateOrdersCreated() *CreateOrdersCreated { + + return &CreateOrdersCreated{} +} + +// WithPayload adds the payload to the create orders created response +func (o *CreateOrdersCreated) WithPayload(payload *internalmessages.Orders) *CreateOrdersCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create orders created response +func (o *CreateOrdersCreated) SetPayload(payload *internalmessages.Orders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateOrdersBadRequestCode is the HTTP code returned for type CreateOrdersBadRequest +const CreateOrdersBadRequestCode int = 400 + +/* +CreateOrdersBadRequest invalid request + +swagger:response createOrdersBadRequest +*/ +type CreateOrdersBadRequest struct { +} + +// NewCreateOrdersBadRequest creates CreateOrdersBadRequest with default headers values +func NewCreateOrdersBadRequest() *CreateOrdersBadRequest { + + return &CreateOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *CreateOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateOrdersUnauthorizedCode is the HTTP code returned for type CreateOrdersUnauthorized +const CreateOrdersUnauthorizedCode int = 401 + +/* +CreateOrdersUnauthorized request requires user authentication + +swagger:response createOrdersUnauthorized +*/ +type CreateOrdersUnauthorized struct { +} + +// NewCreateOrdersUnauthorized creates CreateOrdersUnauthorized with default headers values +func NewCreateOrdersUnauthorized() *CreateOrdersUnauthorized { + + return &CreateOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateOrdersForbiddenCode is the HTTP code returned for type CreateOrdersForbidden +const CreateOrdersForbiddenCode int = 403 + +/* +CreateOrdersForbidden user is not authorized + +swagger:response createOrdersForbidden +*/ +type CreateOrdersForbidden struct { +} + +// NewCreateOrdersForbidden creates CreateOrdersForbidden with default headers values +func NewCreateOrdersForbidden() *CreateOrdersForbidden { + + return &CreateOrdersForbidden{} +} + +// WriteResponse to the client +func (o *CreateOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateOrdersInternalServerErrorCode is the HTTP code returned for type CreateOrdersInternalServerError +const CreateOrdersInternalServerErrorCode int = 500 + +/* +CreateOrdersInternalServerError internal server error + +swagger:response createOrdersInternalServerError +*/ +type CreateOrdersInternalServerError struct { +} + +// NewCreateOrdersInternalServerError creates CreateOrdersInternalServerError with default headers values +func NewCreateOrdersInternalServerError() *CreateOrdersInternalServerError { + + return &CreateOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go new file mode 100644 index 00000000000..4384d1df729 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/create_orders_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateOrdersURL generates an URL for the create orders operation +type CreateOrdersURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOrdersURL) WithBasePath(bp string) *CreateOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders.go b/pkg/gen/internalapi/internaloperations/orders/show_orders.go new file mode 100644 index 00000000000..6461f46c98a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/show_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowOrdersHandlerFunc turns a function with the right signature into a show orders handler +type ShowOrdersHandlerFunc func(ShowOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowOrdersHandlerFunc) Handle(params ShowOrdersParams) middleware.Responder { + return fn(params) +} + +// ShowOrdersHandler interface for that can handle valid show orders params +type ShowOrdersHandler interface { + Handle(ShowOrdersParams) middleware.Responder +} + +// NewShowOrders creates a new http.Handler for the show orders operation +func NewShowOrders(ctx *middleware.Context, handler ShowOrdersHandler) *ShowOrders { + return &ShowOrders{Context: ctx, Handler: handler} +} + +/* + ShowOrders swagger:route GET /orders/{ordersId} orders showOrders + +# Returns the given order + +Returns the given order +*/ +type ShowOrders struct { + Context *middleware.Context + Handler ShowOrdersHandler +} + +func (o *ShowOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go new file mode 100644 index 00000000000..85519703bd1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/show_orders_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowOrdersParams creates a new ShowOrdersParams object +// +// There are no default values defined in the spec. +func NewShowOrdersParams() ShowOrdersParams { + + return ShowOrdersParams{} +} + +// ShowOrdersParams contains all the bound params for the show orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters showOrders +type ShowOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the order + Required: true + In: path + */ + OrdersID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowOrdersParams() beforehand. +func (o *ShowOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") + if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOrdersID binds and validates parameter OrdersID from path. +func (o *ShowOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) + } + o.OrdersID = *(value.(*strfmt.UUID)) + + if err := o.validateOrdersID(formats); err != nil { + return err + } + + return nil +} + +// validateOrdersID carries on validations for parameter OrdersID +func (o *ShowOrdersParams) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go new file mode 100644 index 00000000000..43fda213f90 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/show_orders_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowOrdersOKCode is the HTTP code returned for type ShowOrdersOK +const ShowOrdersOKCode int = 200 + +/* +ShowOrdersOK the instance of the order + +swagger:response showOrdersOK +*/ +type ShowOrdersOK struct { + + /* + In: Body + */ + Payload *internalmessages.Orders `json:"body,omitempty"` +} + +// NewShowOrdersOK creates ShowOrdersOK with default headers values +func NewShowOrdersOK() *ShowOrdersOK { + + return &ShowOrdersOK{} +} + +// WithPayload adds the payload to the show orders o k response +func (o *ShowOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show orders o k response +func (o *ShowOrdersOK) SetPayload(payload *internalmessages.Orders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowOrdersBadRequestCode is the HTTP code returned for type ShowOrdersBadRequest +const ShowOrdersBadRequestCode int = 400 + +/* +ShowOrdersBadRequest invalid request + +swagger:response showOrdersBadRequest +*/ +type ShowOrdersBadRequest struct { +} + +// NewShowOrdersBadRequest creates ShowOrdersBadRequest with default headers values +func NewShowOrdersBadRequest() *ShowOrdersBadRequest { + + return &ShowOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *ShowOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowOrdersUnauthorizedCode is the HTTP code returned for type ShowOrdersUnauthorized +const ShowOrdersUnauthorizedCode int = 401 + +/* +ShowOrdersUnauthorized request requires user authentication + +swagger:response showOrdersUnauthorized +*/ +type ShowOrdersUnauthorized struct { +} + +// NewShowOrdersUnauthorized creates ShowOrdersUnauthorized with default headers values +func NewShowOrdersUnauthorized() *ShowOrdersUnauthorized { + + return &ShowOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowOrdersForbiddenCode is the HTTP code returned for type ShowOrdersForbidden +const ShowOrdersForbiddenCode int = 403 + +/* +ShowOrdersForbidden user is not authorized + +swagger:response showOrdersForbidden +*/ +type ShowOrdersForbidden struct { +} + +// NewShowOrdersForbidden creates ShowOrdersForbidden with default headers values +func NewShowOrdersForbidden() *ShowOrdersForbidden { + + return &ShowOrdersForbidden{} +} + +// WriteResponse to the client +func (o *ShowOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowOrdersNotFoundCode is the HTTP code returned for type ShowOrdersNotFound +const ShowOrdersNotFoundCode int = 404 + +/* +ShowOrdersNotFound order is not found + +swagger:response showOrdersNotFound +*/ +type ShowOrdersNotFound struct { +} + +// NewShowOrdersNotFound creates ShowOrdersNotFound with default headers values +func NewShowOrdersNotFound() *ShowOrdersNotFound { + + return &ShowOrdersNotFound{} +} + +// WriteResponse to the client +func (o *ShowOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowOrdersInternalServerErrorCode is the HTTP code returned for type ShowOrdersInternalServerError +const ShowOrdersInternalServerErrorCode int = 500 + +/* +ShowOrdersInternalServerError internal server error + +swagger:response showOrdersInternalServerError +*/ +type ShowOrdersInternalServerError struct { +} + +// NewShowOrdersInternalServerError creates ShowOrdersInternalServerError with default headers values +func NewShowOrdersInternalServerError() *ShowOrdersInternalServerError { + + return &ShowOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go new file mode 100644 index 00000000000..7b94442fd82 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/show_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowOrdersURL generates an URL for the show orders operation +type ShowOrdersURL struct { + OrdersID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOrdersURL) WithBasePath(bp string) *ShowOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{ordersId}" + + ordersID := o.OrdersID.String() + if ordersID != "" { + _path = strings.Replace(_path, "{ordersId}", ordersID, -1) + } else { + return nil, errors.New("ordersId is required on ShowOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders.go b/pkg/gen/internalapi/internaloperations/orders/update_orders.go new file mode 100644 index 00000000000..f64cb7850e3 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/update_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateOrdersHandlerFunc turns a function with the right signature into a update orders handler +type UpdateOrdersHandlerFunc func(UpdateOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateOrdersHandlerFunc) Handle(params UpdateOrdersParams) middleware.Responder { + return fn(params) +} + +// UpdateOrdersHandler interface for that can handle valid update orders params +type UpdateOrdersHandler interface { + Handle(UpdateOrdersParams) middleware.Responder +} + +// NewUpdateOrders creates a new http.Handler for the update orders operation +func NewUpdateOrders(ctx *middleware.Context, handler UpdateOrdersHandler) *UpdateOrders { + return &UpdateOrders{Context: ctx, Handler: handler} +} + +/* + UpdateOrders swagger:route PUT /orders/{ordersId} orders updateOrders + +# Updates orders + +All fields sent in this request will be set on the orders referenced +*/ +type UpdateOrders struct { + Context *middleware.Context + Handler UpdateOrdersHandler +} + +func (o *UpdateOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go new file mode 100644 index 00000000000..ac1937c4bf7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/update_orders_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateOrdersParams creates a new UpdateOrdersParams object +// +// There are no default values defined in the spec. +func NewUpdateOrdersParams() UpdateOrdersParams { + + return UpdateOrdersParams{} +} + +// UpdateOrdersParams contains all the bound params for the update orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateOrders +type UpdateOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the orders model + Required: true + In: path + */ + OrdersID strfmt.UUID + /* + Required: true + In: body + */ + UpdateOrders *internalmessages.CreateUpdateOrders +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateOrdersParams() beforehand. +func (o *UpdateOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") + if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateUpdateOrders + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateOrders", "body", "")) + } else { + res = append(res, errors.NewParseError("updateOrders", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateOrders = &body + } + } + } else { + res = append(res, errors.Required("updateOrders", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindOrdersID binds and validates parameter OrdersID from path. +func (o *UpdateOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) + } + o.OrdersID = *(value.(*strfmt.UUID)) + + if err := o.validateOrdersID(formats); err != nil { + return err + } + + return nil +} + +// validateOrdersID carries on validations for parameter OrdersID +func (o *UpdateOrdersParams) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go new file mode 100644 index 00000000000..a84f6eea343 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/update_orders_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateOrdersOKCode is the HTTP code returned for type UpdateOrdersOK +const UpdateOrdersOKCode int = 200 + +/* +UpdateOrdersOK updated instance of orders + +swagger:response updateOrdersOK +*/ +type UpdateOrdersOK struct { + + /* + In: Body + */ + Payload *internalmessages.Orders `json:"body,omitempty"` +} + +// NewUpdateOrdersOK creates UpdateOrdersOK with default headers values +func NewUpdateOrdersOK() *UpdateOrdersOK { + + return &UpdateOrdersOK{} +} + +// WithPayload adds the payload to the update orders o k response +func (o *UpdateOrdersOK) WithPayload(payload *internalmessages.Orders) *UpdateOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update orders o k response +func (o *UpdateOrdersOK) SetPayload(payload *internalmessages.Orders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateOrdersBadRequestCode is the HTTP code returned for type UpdateOrdersBadRequest +const UpdateOrdersBadRequestCode int = 400 + +/* +UpdateOrdersBadRequest invalid request + +swagger:response updateOrdersBadRequest +*/ +type UpdateOrdersBadRequest struct { +} + +// NewUpdateOrdersBadRequest creates UpdateOrdersBadRequest with default headers values +func NewUpdateOrdersBadRequest() *UpdateOrdersBadRequest { + + return &UpdateOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *UpdateOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// UpdateOrdersUnauthorizedCode is the HTTP code returned for type UpdateOrdersUnauthorized +const UpdateOrdersUnauthorizedCode int = 401 + +/* +UpdateOrdersUnauthorized request requires user authentication + +swagger:response updateOrdersUnauthorized +*/ +type UpdateOrdersUnauthorized struct { +} + +// NewUpdateOrdersUnauthorized creates UpdateOrdersUnauthorized with default headers values +func NewUpdateOrdersUnauthorized() *UpdateOrdersUnauthorized { + + return &UpdateOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *UpdateOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// UpdateOrdersForbiddenCode is the HTTP code returned for type UpdateOrdersForbidden +const UpdateOrdersForbiddenCode int = 403 + +/* +UpdateOrdersForbidden user is not authorized + +swagger:response updateOrdersForbidden +*/ +type UpdateOrdersForbidden struct { +} + +// NewUpdateOrdersForbidden creates UpdateOrdersForbidden with default headers values +func NewUpdateOrdersForbidden() *UpdateOrdersForbidden { + + return &UpdateOrdersForbidden{} +} + +// WriteResponse to the client +func (o *UpdateOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UpdateOrdersNotFoundCode is the HTTP code returned for type UpdateOrdersNotFound +const UpdateOrdersNotFoundCode int = 404 + +/* +UpdateOrdersNotFound orders not found + +swagger:response updateOrdersNotFound +*/ +type UpdateOrdersNotFound struct { +} + +// NewUpdateOrdersNotFound creates UpdateOrdersNotFound with default headers values +func NewUpdateOrdersNotFound() *UpdateOrdersNotFound { + + return &UpdateOrdersNotFound{} +} + +// WriteResponse to the client +func (o *UpdateOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UpdateOrdersInternalServerErrorCode is the HTTP code returned for type UpdateOrdersInternalServerError +const UpdateOrdersInternalServerErrorCode int = 500 + +/* +UpdateOrdersInternalServerError internal server error + +swagger:response updateOrdersInternalServerError +*/ +type UpdateOrdersInternalServerError struct { +} + +// NewUpdateOrdersInternalServerError creates UpdateOrdersInternalServerError with default headers values +func NewUpdateOrdersInternalServerError() *UpdateOrdersInternalServerError { + + return &UpdateOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *UpdateOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go new file mode 100644 index 00000000000..65946f57543 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/update_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateOrdersURL generates an URL for the update orders operation +type UpdateOrdersURL struct { + OrdersID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOrdersURL) WithBasePath(bp string) *UpdateOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{ordersId}" + + ordersID := o.OrdersID.String() + if ordersID != "" { + _path = strings.Replace(_path, "{ordersId}", ordersID, -1) + } else { + return nil, errors.New("ordersId is required on UpdateOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go new file mode 100644 index 00000000000..23bbb2feb03 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UploadAmendedOrdersHandlerFunc turns a function with the right signature into a upload amended orders handler +type UploadAmendedOrdersHandlerFunc func(UploadAmendedOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UploadAmendedOrdersHandlerFunc) Handle(params UploadAmendedOrdersParams) middleware.Responder { + return fn(params) +} + +// UploadAmendedOrdersHandler interface for that can handle valid upload amended orders params +type UploadAmendedOrdersHandler interface { + Handle(UploadAmendedOrdersParams) middleware.Responder +} + +// NewUploadAmendedOrders creates a new http.Handler for the upload amended orders operation +func NewUploadAmendedOrders(ctx *middleware.Context, handler UploadAmendedOrdersHandler) *UploadAmendedOrders { + return &UploadAmendedOrders{Context: ctx, Handler: handler} +} + +/* + UploadAmendedOrders swagger:route PATCH /orders/{ordersId}/upload_amended_orders orders uploadAmendedOrders + +# Patch the amended orders for a given order + +Patch the amended orders for a given order +*/ +type UploadAmendedOrders struct { + Context *middleware.Context + Handler UploadAmendedOrdersHandler +} + +func (o *UploadAmendedOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUploadAmendedOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go new file mode 100644 index 00000000000..ce13c404857 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UploadAmendedOrdersMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var UploadAmendedOrdersMaxParseMemory int64 = 32 << 20 + +// NewUploadAmendedOrdersParams creates a new UploadAmendedOrdersParams object +// +// There are no default values defined in the spec. +func NewUploadAmendedOrdersParams() UploadAmendedOrdersParams { + + return UploadAmendedOrdersParams{} +} + +// UploadAmendedOrdersParams contains all the bound params for the upload amended orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters uploadAmendedOrders +type UploadAmendedOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the order + Required: true + In: path + */ + OrdersID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUploadAmendedOrdersParams() beforehand. +func (o *UploadAmendedOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(UploadAmendedOrdersMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rOrdersID, rhkOrdersID, _ := route.Params.GetOK("ordersId") + if err := o.bindOrdersID(rOrdersID, rhkOrdersID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *UploadAmendedOrdersParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindOrdersID binds and validates parameter OrdersID from path. +func (o *UploadAmendedOrdersParams) bindOrdersID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ordersId", "path", "strfmt.UUID", raw) + } + o.OrdersID = *(value.(*strfmt.UUID)) + + if err := o.validateOrdersID(formats); err != nil { + return err + } + + return nil +} + +// validateOrdersID carries on validations for parameter OrdersID +func (o *UploadAmendedOrdersParams) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ordersId", "path", "uuid", o.OrdersID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go new file mode 100644 index 00000000000..599e3f7db3c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UploadAmendedOrdersCreatedCode is the HTTP code returned for type UploadAmendedOrdersCreated +const UploadAmendedOrdersCreatedCode int = 201 + +/* +UploadAmendedOrdersCreated created upload + +swagger:response uploadAmendedOrdersCreated +*/ +type UploadAmendedOrdersCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Upload `json:"body,omitempty"` +} + +// NewUploadAmendedOrdersCreated creates UploadAmendedOrdersCreated with default headers values +func NewUploadAmendedOrdersCreated() *UploadAmendedOrdersCreated { + + return &UploadAmendedOrdersCreated{} +} + +// WithPayload adds the payload to the upload amended orders created response +func (o *UploadAmendedOrdersCreated) WithPayload(payload *internalmessages.Upload) *UploadAmendedOrdersCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload amended orders created response +func (o *UploadAmendedOrdersCreated) SetPayload(payload *internalmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAmendedOrdersBadRequestCode is the HTTP code returned for type UploadAmendedOrdersBadRequest +const UploadAmendedOrdersBadRequestCode int = 400 + +/* +UploadAmendedOrdersBadRequest invalid request + +swagger:response uploadAmendedOrdersBadRequest +*/ +type UploadAmendedOrdersBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewUploadAmendedOrdersBadRequest creates UploadAmendedOrdersBadRequest with default headers values +func NewUploadAmendedOrdersBadRequest() *UploadAmendedOrdersBadRequest { + + return &UploadAmendedOrdersBadRequest{} +} + +// WithPayload adds the payload to the upload amended orders bad request response +func (o *UploadAmendedOrdersBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *UploadAmendedOrdersBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the upload amended orders bad request response +func (o *UploadAmendedOrdersBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UploadAmendedOrdersForbiddenCode is the HTTP code returned for type UploadAmendedOrdersForbidden +const UploadAmendedOrdersForbiddenCode int = 403 + +/* +UploadAmendedOrdersForbidden not authorized + +swagger:response uploadAmendedOrdersForbidden +*/ +type UploadAmendedOrdersForbidden struct { +} + +// NewUploadAmendedOrdersForbidden creates UploadAmendedOrdersForbidden with default headers values +func NewUploadAmendedOrdersForbidden() *UploadAmendedOrdersForbidden { + + return &UploadAmendedOrdersForbidden{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// UploadAmendedOrdersNotFoundCode is the HTTP code returned for type UploadAmendedOrdersNotFound +const UploadAmendedOrdersNotFoundCode int = 404 + +/* +UploadAmendedOrdersNotFound not found + +swagger:response uploadAmendedOrdersNotFound +*/ +type UploadAmendedOrdersNotFound struct { +} + +// NewUploadAmendedOrdersNotFound creates UploadAmendedOrdersNotFound with default headers values +func NewUploadAmendedOrdersNotFound() *UploadAmendedOrdersNotFound { + + return &UploadAmendedOrdersNotFound{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// UploadAmendedOrdersRequestEntityTooLargeCode is the HTTP code returned for type UploadAmendedOrdersRequestEntityTooLarge +const UploadAmendedOrdersRequestEntityTooLargeCode int = 413 + +/* +UploadAmendedOrdersRequestEntityTooLarge payload is too large + +swagger:response uploadAmendedOrdersRequestEntityTooLarge +*/ +type UploadAmendedOrdersRequestEntityTooLarge struct { +} + +// NewUploadAmendedOrdersRequestEntityTooLarge creates UploadAmendedOrdersRequestEntityTooLarge with default headers values +func NewUploadAmendedOrdersRequestEntityTooLarge() *UploadAmendedOrdersRequestEntityTooLarge { + + return &UploadAmendedOrdersRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// UploadAmendedOrdersInternalServerErrorCode is the HTTP code returned for type UploadAmendedOrdersInternalServerError +const UploadAmendedOrdersInternalServerErrorCode int = 500 + +/* +UploadAmendedOrdersInternalServerError server error + +swagger:response uploadAmendedOrdersInternalServerError +*/ +type UploadAmendedOrdersInternalServerError struct { +} + +// NewUploadAmendedOrdersInternalServerError creates UploadAmendedOrdersInternalServerError with default headers values +func NewUploadAmendedOrdersInternalServerError() *UploadAmendedOrdersInternalServerError { + + return &UploadAmendedOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *UploadAmendedOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go new file mode 100644 index 00000000000..2e163f6cd12 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/orders/upload_amended_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package orders + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UploadAmendedOrdersURL generates an URL for the upload amended orders operation +type UploadAmendedOrdersURL struct { + OrdersID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAmendedOrdersURL) WithBasePath(bp string) *UploadAmendedOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UploadAmendedOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UploadAmendedOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/orders/{ordersId}/upload_amended_orders" + + ordersID := o.OrdersID.String() + if ordersID != "" { + _path = strings.Replace(_path, "{ordersId}", ordersID, -1) + } else { + return nil, errors.New("ordersId is required on UploadAmendedOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UploadAmendedOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UploadAmendedOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UploadAmendedOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UploadAmendedOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UploadAmendedOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UploadAmendedOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go new file mode 100644 index 00000000000..944fd99cdb0 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package postal_codes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ValidatePostalCodeWithRateDataHandlerFunc turns a function with the right signature into a validate postal code with rate data handler +type ValidatePostalCodeWithRateDataHandlerFunc func(ValidatePostalCodeWithRateDataParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ValidatePostalCodeWithRateDataHandlerFunc) Handle(params ValidatePostalCodeWithRateDataParams) middleware.Responder { + return fn(params) +} + +// ValidatePostalCodeWithRateDataHandler interface for that can handle valid validate postal code with rate data params +type ValidatePostalCodeWithRateDataHandler interface { + Handle(ValidatePostalCodeWithRateDataParams) middleware.Responder +} + +// NewValidatePostalCodeWithRateData creates a new http.Handler for the validate postal code with rate data operation +func NewValidatePostalCodeWithRateData(ctx *middleware.Context, handler ValidatePostalCodeWithRateDataHandler) *ValidatePostalCodeWithRateData { + return &ValidatePostalCodeWithRateData{Context: ctx, Handler: handler} +} + +/* + ValidatePostalCodeWithRateData swagger:route GET /rate_engine_postal_codes/{postal_code} postal_codes validatePostalCodeWithRateData + +Validate if a zipcode is valid for origin or destination location for a move. + +Verifies if a zipcode is valid for origin or destination location for a move. +*/ +type ValidatePostalCodeWithRateData struct { + Context *middleware.Context + Handler ValidatePostalCodeWithRateDataHandler +} + +func (o *ValidatePostalCodeWithRateData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewValidatePostalCodeWithRateDataParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go new file mode 100644 index 00000000000..a3b511796f4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_parameters.go @@ -0,0 +1,135 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package postal_codes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewValidatePostalCodeWithRateDataParams creates a new ValidatePostalCodeWithRateDataParams object +// +// There are no default values defined in the spec. +func NewValidatePostalCodeWithRateDataParams() ValidatePostalCodeWithRateDataParams { + + return ValidatePostalCodeWithRateDataParams{} +} + +// ValidatePostalCodeWithRateDataParams contains all the bound params for the validate postal code with rate data operation +// typically these are obtained from a http.Request +// +// swagger:parameters validatePostalCodeWithRateData +type ValidatePostalCodeWithRateDataParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + Pattern: ^(\d{5}?)$ + In: path + */ + PostalCode string + /* + Required: true + In: query + */ + PostalCodeType string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewValidatePostalCodeWithRateDataParams() beforehand. +func (o *ValidatePostalCodeWithRateDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rPostalCode, rhkPostalCode, _ := route.Params.GetOK("postal_code") + if err := o.bindPostalCode(rPostalCode, rhkPostalCode, route.Formats); err != nil { + res = append(res, err) + } + + qPostalCodeType, qhkPostalCodeType, _ := qs.GetOK("postal_code_type") + if err := o.bindPostalCodeType(qPostalCodeType, qhkPostalCodeType, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPostalCode binds and validates parameter PostalCode from path. +func (o *ValidatePostalCodeWithRateDataParams) bindPostalCode(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PostalCode = raw + + if err := o.validatePostalCode(formats); err != nil { + return err + } + + return nil +} + +// validatePostalCode carries on validations for parameter PostalCode +func (o *ValidatePostalCodeWithRateDataParams) validatePostalCode(formats strfmt.Registry) error { + + if err := validate.Pattern("postal_code", "path", o.PostalCode, `^(\d{5}?)$`); err != nil { + return err + } + + return nil +} + +// bindPostalCodeType binds and validates parameter PostalCodeType from query. +func (o *ValidatePostalCodeWithRateDataParams) bindPostalCodeType(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("postal_code_type", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("postal_code_type", "query", raw); err != nil { + return err + } + o.PostalCodeType = raw + + if err := o.validatePostalCodeType(formats); err != nil { + return err + } + + return nil +} + +// validatePostalCodeType carries on validations for parameter PostalCodeType +func (o *ValidatePostalCodeWithRateDataParams) validatePostalCodeType(formats strfmt.Registry) error { + + if err := validate.EnumCase("postal_code_type", "query", o.PostalCodeType, []interface{}{"origin", "destination"}, true); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go new file mode 100644 index 00000000000..776307effee --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package postal_codes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ValidatePostalCodeWithRateDataOKCode is the HTTP code returned for type ValidatePostalCodeWithRateDataOK +const ValidatePostalCodeWithRateDataOKCode int = 200 + +/* +ValidatePostalCodeWithRateDataOK postal_code is valid or invalid + +swagger:response validatePostalCodeWithRateDataOK +*/ +type ValidatePostalCodeWithRateDataOK struct { + + /* + In: Body + */ + Payload *internalmessages.RateEnginePostalCodePayload `json:"body,omitempty"` +} + +// NewValidatePostalCodeWithRateDataOK creates ValidatePostalCodeWithRateDataOK with default headers values +func NewValidatePostalCodeWithRateDataOK() *ValidatePostalCodeWithRateDataOK { + + return &ValidatePostalCodeWithRateDataOK{} +} + +// WithPayload adds the payload to the validate postal code with rate data o k response +func (o *ValidatePostalCodeWithRateDataOK) WithPayload(payload *internalmessages.RateEnginePostalCodePayload) *ValidatePostalCodeWithRateDataOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the validate postal code with rate data o k response +func (o *ValidatePostalCodeWithRateDataOK) SetPayload(payload *internalmessages.RateEnginePostalCodePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ValidatePostalCodeWithRateDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ValidatePostalCodeWithRateDataBadRequestCode is the HTTP code returned for type ValidatePostalCodeWithRateDataBadRequest +const ValidatePostalCodeWithRateDataBadRequestCode int = 400 + +/* +ValidatePostalCodeWithRateDataBadRequest invalid request + +swagger:response validatePostalCodeWithRateDataBadRequest +*/ +type ValidatePostalCodeWithRateDataBadRequest struct { +} + +// NewValidatePostalCodeWithRateDataBadRequest creates ValidatePostalCodeWithRateDataBadRequest with default headers values +func NewValidatePostalCodeWithRateDataBadRequest() *ValidatePostalCodeWithRateDataBadRequest { + + return &ValidatePostalCodeWithRateDataBadRequest{} +} + +// WriteResponse to the client +func (o *ValidatePostalCodeWithRateDataBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ValidatePostalCodeWithRateDataUnauthorizedCode is the HTTP code returned for type ValidatePostalCodeWithRateDataUnauthorized +const ValidatePostalCodeWithRateDataUnauthorizedCode int = 401 + +/* +ValidatePostalCodeWithRateDataUnauthorized must be authenticated to use this endpoint + +swagger:response validatePostalCodeWithRateDataUnauthorized +*/ +type ValidatePostalCodeWithRateDataUnauthorized struct { +} + +// NewValidatePostalCodeWithRateDataUnauthorized creates ValidatePostalCodeWithRateDataUnauthorized with default headers values +func NewValidatePostalCodeWithRateDataUnauthorized() *ValidatePostalCodeWithRateDataUnauthorized { + + return &ValidatePostalCodeWithRateDataUnauthorized{} +} + +// WriteResponse to the client +func (o *ValidatePostalCodeWithRateDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ValidatePostalCodeWithRateDataForbiddenCode is the HTTP code returned for type ValidatePostalCodeWithRateDataForbidden +const ValidatePostalCodeWithRateDataForbiddenCode int = 403 + +/* +ValidatePostalCodeWithRateDataForbidden user is not authorized + +swagger:response validatePostalCodeWithRateDataForbidden +*/ +type ValidatePostalCodeWithRateDataForbidden struct { +} + +// NewValidatePostalCodeWithRateDataForbidden creates ValidatePostalCodeWithRateDataForbidden with default headers values +func NewValidatePostalCodeWithRateDataForbidden() *ValidatePostalCodeWithRateDataForbidden { + + return &ValidatePostalCodeWithRateDataForbidden{} +} + +// WriteResponse to the client +func (o *ValidatePostalCodeWithRateDataForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ValidatePostalCodeWithRateDataInternalServerErrorCode is the HTTP code returned for type ValidatePostalCodeWithRateDataInternalServerError +const ValidatePostalCodeWithRateDataInternalServerErrorCode int = 500 + +/* +ValidatePostalCodeWithRateDataInternalServerError server error + +swagger:response validatePostalCodeWithRateDataInternalServerError +*/ +type ValidatePostalCodeWithRateDataInternalServerError struct { +} + +// NewValidatePostalCodeWithRateDataInternalServerError creates ValidatePostalCodeWithRateDataInternalServerError with default headers values +func NewValidatePostalCodeWithRateDataInternalServerError() *ValidatePostalCodeWithRateDataInternalServerError { + + return &ValidatePostalCodeWithRateDataInternalServerError{} +} + +// WriteResponse to the client +func (o *ValidatePostalCodeWithRateDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go new file mode 100644 index 00000000000..951fdd8a211 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/postal_codes/validate_postal_code_with_rate_data_urlbuilder.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package postal_codes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// ValidatePostalCodeWithRateDataURL generates an URL for the validate postal code with rate data operation +type ValidatePostalCodeWithRateDataURL struct { + PostalCode string + + PostalCodeType string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ValidatePostalCodeWithRateDataURL) WithBasePath(bp string) *ValidatePostalCodeWithRateDataURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ValidatePostalCodeWithRateDataURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ValidatePostalCodeWithRateDataURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/rate_engine_postal_codes/{postal_code}" + + postalCode := o.PostalCode + if postalCode != "" { + _path = strings.Replace(_path, "{postal_code}", postalCode, -1) + } else { + return nil, errors.New("postalCode is required on ValidatePostalCodeWithRateDataURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + postalCodeTypeQ := o.PostalCodeType + if postalCodeTypeQ != "" { + qs.Set("postal_code_type", postalCodeTypeQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ValidatePostalCodeWithRateDataURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ValidatePostalCodeWithRateDataURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ValidatePostalCodeWithRateDataURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ValidatePostalCodeWithRateDataURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ValidatePostalCodeWithRateDataURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ValidatePostalCodeWithRateDataURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go new file mode 100644 index 00000000000..11221b7fe09 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMovingExpenseHandlerFunc turns a function with the right signature into a create moving expense handler +type CreateMovingExpenseHandlerFunc func(CreateMovingExpenseParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMovingExpenseHandlerFunc) Handle(params CreateMovingExpenseParams) middleware.Responder { + return fn(params) +} + +// CreateMovingExpenseHandler interface for that can handle valid create moving expense params +type CreateMovingExpenseHandler interface { + Handle(CreateMovingExpenseParams) middleware.Responder +} + +// NewCreateMovingExpense creates a new http.Handler for the create moving expense operation +func NewCreateMovingExpense(ctx *middleware.Context, handler CreateMovingExpenseHandler) *CreateMovingExpense { + return &CreateMovingExpense{Context: ctx, Handler: handler} +} + +/* + CreateMovingExpense swagger:route POST /ppm-shipments/{ppmShipmentId}/moving-expenses ppm createMovingExpense + +# Creates moving expense document + +Creates a moving expense document for the PPM shipment +*/ +type CreateMovingExpense struct { + Context *middleware.Context + Handler CreateMovingExpenseHandler +} + +func (o *CreateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMovingExpenseParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go new file mode 100644 index 00000000000..7b28dadfd9d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewCreateMovingExpenseParams creates a new CreateMovingExpenseParams object +// +// There are no default values defined in the spec. +func NewCreateMovingExpenseParams() CreateMovingExpenseParams { + + return CreateMovingExpenseParams{} +} + +// CreateMovingExpenseParams contains all the bound params for the create moving expense operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMovingExpense +type CreateMovingExpenseParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMovingExpenseParams() beforehand. +func (o *CreateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *CreateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *CreateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go new file mode 100644 index 00000000000..0c88a116cb8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateMovingExpenseCreatedCode is the HTTP code returned for type CreateMovingExpenseCreated +const CreateMovingExpenseCreatedCode int = 201 + +/* +CreateMovingExpenseCreated returns new moving expense object + +swagger:response createMovingExpenseCreated +*/ +type CreateMovingExpenseCreated struct { + + /* + In: Body + */ + Payload *internalmessages.MovingExpense `json:"body,omitempty"` +} + +// NewCreateMovingExpenseCreated creates CreateMovingExpenseCreated with default headers values +func NewCreateMovingExpenseCreated() *CreateMovingExpenseCreated { + + return &CreateMovingExpenseCreated{} +} + +// WithPayload adds the payload to the create moving expense created response +func (o *CreateMovingExpenseCreated) WithPayload(payload *internalmessages.MovingExpense) *CreateMovingExpenseCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense created response +func (o *CreateMovingExpenseCreated) SetPayload(payload *internalmessages.MovingExpense) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseBadRequestCode is the HTTP code returned for type CreateMovingExpenseBadRequest +const CreateMovingExpenseBadRequestCode int = 400 + +/* +CreateMovingExpenseBadRequest The request payload is invalid. + +swagger:response createMovingExpenseBadRequest +*/ +type CreateMovingExpenseBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMovingExpenseBadRequest creates CreateMovingExpenseBadRequest with default headers values +func NewCreateMovingExpenseBadRequest() *CreateMovingExpenseBadRequest { + + return &CreateMovingExpenseBadRequest{} +} + +// WithPayload adds the payload to the create moving expense bad request response +func (o *CreateMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense bad request response +func (o *CreateMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseUnauthorizedCode is the HTTP code returned for type CreateMovingExpenseUnauthorized +const CreateMovingExpenseUnauthorizedCode int = 401 + +/* +CreateMovingExpenseUnauthorized The request was denied. + +swagger:response createMovingExpenseUnauthorized +*/ +type CreateMovingExpenseUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMovingExpenseUnauthorized creates CreateMovingExpenseUnauthorized with default headers values +func NewCreateMovingExpenseUnauthorized() *CreateMovingExpenseUnauthorized { + + return &CreateMovingExpenseUnauthorized{} +} + +// WithPayload adds the payload to the create moving expense unauthorized response +func (o *CreateMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense unauthorized response +func (o *CreateMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseForbiddenCode is the HTTP code returned for type CreateMovingExpenseForbidden +const CreateMovingExpenseForbiddenCode int = 403 + +/* +CreateMovingExpenseForbidden The request was denied. + +swagger:response createMovingExpenseForbidden +*/ +type CreateMovingExpenseForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMovingExpenseForbidden creates CreateMovingExpenseForbidden with default headers values +func NewCreateMovingExpenseForbidden() *CreateMovingExpenseForbidden { + + return &CreateMovingExpenseForbidden{} +} + +// WithPayload adds the payload to the create moving expense forbidden response +func (o *CreateMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense forbidden response +func (o *CreateMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseNotFoundCode is the HTTP code returned for type CreateMovingExpenseNotFound +const CreateMovingExpenseNotFoundCode int = 404 + +/* +CreateMovingExpenseNotFound The requested resource wasn't found. + +swagger:response createMovingExpenseNotFound +*/ +type CreateMovingExpenseNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMovingExpenseNotFound creates CreateMovingExpenseNotFound with default headers values +func NewCreateMovingExpenseNotFound() *CreateMovingExpenseNotFound { + + return &CreateMovingExpenseNotFound{} +} + +// WithPayload adds the payload to the create moving expense not found response +func (o *CreateMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *CreateMovingExpenseNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense not found response +func (o *CreateMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type CreateMovingExpenseUnprocessableEntity +const CreateMovingExpenseUnprocessableEntityCode int = 422 + +/* +CreateMovingExpenseUnprocessableEntity The payload was unprocessable. + +swagger:response createMovingExpenseUnprocessableEntity +*/ +type CreateMovingExpenseUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMovingExpenseUnprocessableEntity creates CreateMovingExpenseUnprocessableEntity with default headers values +func NewCreateMovingExpenseUnprocessableEntity() *CreateMovingExpenseUnprocessableEntity { + + return &CreateMovingExpenseUnprocessableEntity{} +} + +// WithPayload adds the payload to the create moving expense unprocessable entity response +func (o *CreateMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateMovingExpenseUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense unprocessable entity response +func (o *CreateMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMovingExpenseInternalServerErrorCode is the HTTP code returned for type CreateMovingExpenseInternalServerError +const CreateMovingExpenseInternalServerErrorCode int = 500 + +/* +CreateMovingExpenseInternalServerError A server error occurred. + +swagger:response createMovingExpenseInternalServerError +*/ +type CreateMovingExpenseInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewCreateMovingExpenseInternalServerError creates CreateMovingExpenseInternalServerError with default headers values +func NewCreateMovingExpenseInternalServerError() *CreateMovingExpenseInternalServerError { + + return &CreateMovingExpenseInternalServerError{} +} + +// WithPayload adds the payload to the create moving expense internal server error response +func (o *CreateMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *CreateMovingExpenseInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create moving expense internal server error response +func (o *CreateMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go new file mode 100644 index 00000000000..e3682712581 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_moving_expense_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateMovingExpenseURL generates an URL for the create moving expense operation +type CreateMovingExpenseURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMovingExpenseURL) WithBasePath(bp string) *CreateMovingExpenseURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMovingExpenseURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMovingExpenseURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on CreateMovingExpenseURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMovingExpenseURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMovingExpenseURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMovingExpenseURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMovingExpenseURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go new file mode 100644 index 00000000000..853dd0bbab2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreatePPMUploadHandlerFunc turns a function with the right signature into a create p p m upload handler +type CreatePPMUploadHandlerFunc func(CreatePPMUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreatePPMUploadHandlerFunc) Handle(params CreatePPMUploadParams) middleware.Responder { + return fn(params) +} + +// CreatePPMUploadHandler interface for that can handle valid create p p m upload params +type CreatePPMUploadHandler interface { + Handle(CreatePPMUploadParams) middleware.Responder +} + +// NewCreatePPMUpload creates a new http.Handler for the create p p m upload operation +func NewCreatePPMUpload(ctx *middleware.Context, handler CreatePPMUploadHandler) *CreatePPMUpload { + return &CreatePPMUpload{Context: ctx, Handler: handler} +} + +/* + CreatePPMUpload swagger:route POST /ppm-shipments/{ppmShipmentId}/uploads ppm createPPMUpload + +# Create a new upload for a PPM weight ticket, pro-gear, or moving expense document + +Uploads represent a single digital file, such as a PNG, JPEG, PDF, or spreadsheet. +*/ +type CreatePPMUpload struct { + Context *middleware.Context + Handler CreatePPMUploadHandler +} + +func (o *CreatePPMUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreatePPMUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go new file mode 100644 index 00000000000..4da92b41966 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_parameters.go @@ -0,0 +1,220 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePPMUploadMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreatePPMUploadMaxParseMemory int64 = 32 << 20 + +// NewCreatePPMUploadParams creates a new CreatePPMUploadParams object +// +// There are no default values defined in the spec. +func NewCreatePPMUploadParams() CreatePPMUploadParams { + + return CreatePPMUploadParams{} +} + +// CreatePPMUploadParams contains all the bound params for the create p p m upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters createPPMUpload +type CreatePPMUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the document to add an upload to + Required: true + In: query + */ + DocumentID strfmt.UUID + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the ppm shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*If the upload is a Weight Receipt + Required: true + In: query + */ + WeightReceipt bool +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreatePPMUploadParams() beforehand. +func (o *CreatePPMUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + if err := r.ParseMultipartForm(CreatePPMUploadMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") + if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { + res = append(res, err) + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + qWeightReceipt, qhkWeightReceipt, _ := qs.GetOK("weightReceipt") + if err := o.bindWeightReceipt(qWeightReceipt, qhkWeightReceipt, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDocumentID binds and validates parameter DocumentID from query. +func (o *CreatePPMUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("documentId", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("documentId", "query", raw); err != nil { + return err + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) + } + o.DocumentID = *(value.(*strfmt.UUID)) + + if err := o.validateDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateDocumentID carries on validations for parameter DocumentID +func (o *CreatePPMUploadParams) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreatePPMUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *CreatePPMUploadParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *CreatePPMUploadParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindWeightReceipt binds and validates parameter WeightReceipt from query. +func (o *CreatePPMUploadParams) bindWeightReceipt(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("weightReceipt", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("weightReceipt", "query", raw); err != nil { + return err + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("weightReceipt", "query", "bool", raw) + } + o.WeightReceipt = value + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go new file mode 100644 index 00000000000..d560f1319b2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreatePPMUploadCreatedCode is the HTTP code returned for type CreatePPMUploadCreated +const CreatePPMUploadCreatedCode int = 201 + +/* +CreatePPMUploadCreated created upload + +swagger:response createPPMUploadCreated +*/ +type CreatePPMUploadCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Upload `json:"body,omitempty"` +} + +// NewCreatePPMUploadCreated creates CreatePPMUploadCreated with default headers values +func NewCreatePPMUploadCreated() *CreatePPMUploadCreated { + + return &CreatePPMUploadCreated{} +} + +// WithPayload adds the payload to the create p p m upload created response +func (o *CreatePPMUploadCreated) WithPayload(payload *internalmessages.Upload) *CreatePPMUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload created response +func (o *CreatePPMUploadCreated) SetPayload(payload *internalmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePPMUploadBadRequestCode is the HTTP code returned for type CreatePPMUploadBadRequest +const CreatePPMUploadBadRequestCode int = 400 + +/* +CreatePPMUploadBadRequest invalid request + +swagger:response createPPMUploadBadRequest +*/ +type CreatePPMUploadBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewCreatePPMUploadBadRequest creates CreatePPMUploadBadRequest with default headers values +func NewCreatePPMUploadBadRequest() *CreatePPMUploadBadRequest { + + return &CreatePPMUploadBadRequest{} +} + +// WithPayload adds the payload to the create p p m upload bad request response +func (o *CreatePPMUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *CreatePPMUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload bad request response +func (o *CreatePPMUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePPMUploadForbiddenCode is the HTTP code returned for type CreatePPMUploadForbidden +const CreatePPMUploadForbiddenCode int = 403 + +/* +CreatePPMUploadForbidden The request was denied. + +swagger:response createPPMUploadForbidden +*/ +type CreatePPMUploadForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePPMUploadForbidden creates CreatePPMUploadForbidden with default headers values +func NewCreatePPMUploadForbidden() *CreatePPMUploadForbidden { + + return &CreatePPMUploadForbidden{} +} + +// WithPayload adds the payload to the create p p m upload forbidden response +func (o *CreatePPMUploadForbidden) WithPayload(payload *internalmessages.ClientError) *CreatePPMUploadForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload forbidden response +func (o *CreatePPMUploadForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePPMUploadNotFoundCode is the HTTP code returned for type CreatePPMUploadNotFound +const CreatePPMUploadNotFoundCode int = 404 + +/* +CreatePPMUploadNotFound The requested resource wasn't found. + +swagger:response createPPMUploadNotFound +*/ +type CreatePPMUploadNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePPMUploadNotFound creates CreatePPMUploadNotFound with default headers values +func NewCreatePPMUploadNotFound() *CreatePPMUploadNotFound { + + return &CreatePPMUploadNotFound{} +} + +// WithPayload adds the payload to the create p p m upload not found response +func (o *CreatePPMUploadNotFound) WithPayload(payload *internalmessages.ClientError) *CreatePPMUploadNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload not found response +func (o *CreatePPMUploadNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePPMUploadRequestEntityTooLargeCode is the HTTP code returned for type CreatePPMUploadRequestEntityTooLarge +const CreatePPMUploadRequestEntityTooLargeCode int = 413 + +/* +CreatePPMUploadRequestEntityTooLarge payload is too large + +swagger:response createPPMUploadRequestEntityTooLarge +*/ +type CreatePPMUploadRequestEntityTooLarge struct { +} + +// NewCreatePPMUploadRequestEntityTooLarge creates CreatePPMUploadRequestEntityTooLarge with default headers values +func NewCreatePPMUploadRequestEntityTooLarge() *CreatePPMUploadRequestEntityTooLarge { + + return &CreatePPMUploadRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *CreatePPMUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// CreatePPMUploadUnprocessableEntityCode is the HTTP code returned for type CreatePPMUploadUnprocessableEntity +const CreatePPMUploadUnprocessableEntityCode int = 422 + +/* +CreatePPMUploadUnprocessableEntity The payload was unprocessable. + +swagger:response createPPMUploadUnprocessableEntity +*/ +type CreatePPMUploadUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreatePPMUploadUnprocessableEntity creates CreatePPMUploadUnprocessableEntity with default headers values +func NewCreatePPMUploadUnprocessableEntity() *CreatePPMUploadUnprocessableEntity { + + return &CreatePPMUploadUnprocessableEntity{} +} + +// WithPayload adds the payload to the create p p m upload unprocessable entity response +func (o *CreatePPMUploadUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreatePPMUploadUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload unprocessable entity response +func (o *CreatePPMUploadUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePPMUploadInternalServerErrorCode is the HTTP code returned for type CreatePPMUploadInternalServerError +const CreatePPMUploadInternalServerErrorCode int = 500 + +/* +CreatePPMUploadInternalServerError A server error occurred. + +swagger:response createPPMUploadInternalServerError +*/ +type CreatePPMUploadInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewCreatePPMUploadInternalServerError creates CreatePPMUploadInternalServerError with default headers values +func NewCreatePPMUploadInternalServerError() *CreatePPMUploadInternalServerError { + + return &CreatePPMUploadInternalServerError{} +} + +// WithPayload adds the payload to the create p p m upload internal server error response +func (o *CreatePPMUploadInternalServerError) WithPayload(payload *internalmessages.Error) *CreatePPMUploadInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create p p m upload internal server error response +func (o *CreatePPMUploadInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePPMUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go new file mode 100644 index 00000000000..893b8b6f374 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_p_p_m_upload_urlbuilder.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreatePPMUploadURL generates an URL for the create p p m upload operation +type CreatePPMUploadURL struct { + PpmShipmentID strfmt.UUID + + DocumentID strfmt.UUID + WeightReceipt bool + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreatePPMUploadURL) WithBasePath(bp string) *CreatePPMUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreatePPMUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreatePPMUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/uploads" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on CreatePPMUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + documentIDQ := o.DocumentID.String() + if documentIDQ != "" { + qs.Set("documentId", documentIDQ) + } + + weightReceiptQ := swag.FormatBool(o.WeightReceipt) + if weightReceiptQ != "" { + qs.Set("weightReceipt", weightReceiptQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreatePPMUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreatePPMUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreatePPMUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreatePPMUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreatePPMUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreatePPMUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..9a2b3e5b8bd --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateProGearWeightTicketHandlerFunc turns a function with the right signature into a create pro gear weight ticket handler +type CreateProGearWeightTicketHandlerFunc func(CreateProGearWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateProGearWeightTicketHandlerFunc) Handle(params CreateProGearWeightTicketParams) middleware.Responder { + return fn(params) +} + +// CreateProGearWeightTicketHandler interface for that can handle valid create pro gear weight ticket params +type CreateProGearWeightTicketHandler interface { + Handle(CreateProGearWeightTicketParams) middleware.Responder +} + +// NewCreateProGearWeightTicket creates a new http.Handler for the create pro gear weight ticket operation +func NewCreateProGearWeightTicket(ctx *middleware.Context, handler CreateProGearWeightTicketHandler) *CreateProGearWeightTicket { + return &CreateProGearWeightTicket{Context: ctx, Handler: handler} +} + +/* + CreateProGearWeightTicket swagger:route POST /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets ppm createProGearWeightTicket + +# Creates a pro-gear weight ticket + +Creates a PPM shipment's pro-gear weight ticket. This will only contain the minimum necessary fields for a +pro-gear weight ticket. Data should be filled in using the patch endpoint. +*/ +type CreateProGearWeightTicket struct { + Context *middleware.Context + Handler CreateProGearWeightTicketHandler +} + +func (o *CreateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateProGearWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go new file mode 100644 index 00000000000..25cba58f560 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewCreateProGearWeightTicketParams creates a new CreateProGearWeightTicketParams object +// +// There are no default values defined in the spec. +func NewCreateProGearWeightTicketParams() CreateProGearWeightTicketParams { + + return CreateProGearWeightTicketParams{} +} + +// CreateProGearWeightTicketParams contains all the bound params for the create pro gear weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters createProGearWeightTicket +type CreateProGearWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateProGearWeightTicketParams() beforehand. +func (o *CreateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *CreateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *CreateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go new file mode 100644 index 00000000000..7a22c60d4a0 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateProGearWeightTicketCreatedCode is the HTTP code returned for type CreateProGearWeightTicketCreated +const CreateProGearWeightTicketCreatedCode int = 201 + +/* +CreateProGearWeightTicketCreated returns a new pro-gear weight ticket object + +swagger:response createProGearWeightTicketCreated +*/ +type CreateProGearWeightTicketCreated struct { + + /* + In: Body + */ + Payload *internalmessages.ProGearWeightTicket `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketCreated creates CreateProGearWeightTicketCreated with default headers values +func NewCreateProGearWeightTicketCreated() *CreateProGearWeightTicketCreated { + + return &CreateProGearWeightTicketCreated{} +} + +// WithPayload adds the payload to the create pro gear weight ticket created response +func (o *CreateProGearWeightTicketCreated) WithPayload(payload *internalmessages.ProGearWeightTicket) *CreateProGearWeightTicketCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket created response +func (o *CreateProGearWeightTicketCreated) SetPayload(payload *internalmessages.ProGearWeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketBadRequestCode is the HTTP code returned for type CreateProGearWeightTicketBadRequest +const CreateProGearWeightTicketBadRequestCode int = 400 + +/* +CreateProGearWeightTicketBadRequest The request payload is invalid. + +swagger:response createProGearWeightTicketBadRequest +*/ +type CreateProGearWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketBadRequest creates CreateProGearWeightTicketBadRequest with default headers values +func NewCreateProGearWeightTicketBadRequest() *CreateProGearWeightTicketBadRequest { + + return &CreateProGearWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the create pro gear weight ticket bad request response +func (o *CreateProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket bad request response +func (o *CreateProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type CreateProGearWeightTicketUnauthorized +const CreateProGearWeightTicketUnauthorizedCode int = 401 + +/* +CreateProGearWeightTicketUnauthorized The request was denied. + +swagger:response createProGearWeightTicketUnauthorized +*/ +type CreateProGearWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketUnauthorized creates CreateProGearWeightTicketUnauthorized with default headers values +func NewCreateProGearWeightTicketUnauthorized() *CreateProGearWeightTicketUnauthorized { + + return &CreateProGearWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the create pro gear weight ticket unauthorized response +func (o *CreateProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket unauthorized response +func (o *CreateProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketForbiddenCode is the HTTP code returned for type CreateProGearWeightTicketForbidden +const CreateProGearWeightTicketForbiddenCode int = 403 + +/* +CreateProGearWeightTicketForbidden The request was denied. + +swagger:response createProGearWeightTicketForbidden +*/ +type CreateProGearWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketForbidden creates CreateProGearWeightTicketForbidden with default headers values +func NewCreateProGearWeightTicketForbidden() *CreateProGearWeightTicketForbidden { + + return &CreateProGearWeightTicketForbidden{} +} + +// WithPayload adds the payload to the create pro gear weight ticket forbidden response +func (o *CreateProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket forbidden response +func (o *CreateProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketNotFoundCode is the HTTP code returned for type CreateProGearWeightTicketNotFound +const CreateProGearWeightTicketNotFoundCode int = 404 + +/* +CreateProGearWeightTicketNotFound The requested resource wasn't found. + +swagger:response createProGearWeightTicketNotFound +*/ +type CreateProGearWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketNotFound creates CreateProGearWeightTicketNotFound with default headers values +func NewCreateProGearWeightTicketNotFound() *CreateProGearWeightTicketNotFound { + + return &CreateProGearWeightTicketNotFound{} +} + +// WithPayload adds the payload to the create pro gear weight ticket not found response +func (o *CreateProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket not found response +func (o *CreateProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type CreateProGearWeightTicketPreconditionFailed +const CreateProGearWeightTicketPreconditionFailedCode int = 412 + +/* +CreateProGearWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response createProGearWeightTicketPreconditionFailed +*/ +type CreateProGearWeightTicketPreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketPreconditionFailed creates CreateProGearWeightTicketPreconditionFailed with default headers values +func NewCreateProGearWeightTicketPreconditionFailed() *CreateProGearWeightTicketPreconditionFailed { + + return &CreateProGearWeightTicketPreconditionFailed{} +} + +// WithPayload adds the payload to the create pro gear weight ticket precondition failed response +func (o *CreateProGearWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *CreateProGearWeightTicketPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket precondition failed response +func (o *CreateProGearWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type CreateProGearWeightTicketUnprocessableEntity +const CreateProGearWeightTicketUnprocessableEntityCode int = 422 + +/* +CreateProGearWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response createProGearWeightTicketUnprocessableEntity +*/ +type CreateProGearWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketUnprocessableEntity creates CreateProGearWeightTicketUnprocessableEntity with default headers values +func NewCreateProGearWeightTicketUnprocessableEntity() *CreateProGearWeightTicketUnprocessableEntity { + + return &CreateProGearWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the create pro gear weight ticket unprocessable entity response +func (o *CreateProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateProGearWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket unprocessable entity response +func (o *CreateProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type CreateProGearWeightTicketInternalServerError +const CreateProGearWeightTicketInternalServerErrorCode int = 500 + +/* +CreateProGearWeightTicketInternalServerError A server error occurred. + +swagger:response createProGearWeightTicketInternalServerError +*/ +type CreateProGearWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewCreateProGearWeightTicketInternalServerError creates CreateProGearWeightTicketInternalServerError with default headers values +func NewCreateProGearWeightTicketInternalServerError() *CreateProGearWeightTicketInternalServerError { + + return &CreateProGearWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the create pro gear weight ticket internal server error response +func (o *CreateProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *CreateProGearWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create pro gear weight ticket internal server error response +func (o *CreateProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..664e288fab6 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_pro_gear_weight_ticket_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateProGearWeightTicketURL generates an URL for the create pro gear weight ticket operation +type CreateProGearWeightTicketURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateProGearWeightTicketURL) WithBasePath(bp string) *CreateProGearWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateProGearWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateProGearWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on CreateProGearWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateProGearWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateProGearWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateProGearWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateProGearWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go new file mode 100644 index 00000000000..4df622a2c8a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateWeightTicketHandlerFunc turns a function with the right signature into a create weight ticket handler +type CreateWeightTicketHandlerFunc func(CreateWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateWeightTicketHandlerFunc) Handle(params CreateWeightTicketParams) middleware.Responder { + return fn(params) +} + +// CreateWeightTicketHandler interface for that can handle valid create weight ticket params +type CreateWeightTicketHandler interface { + Handle(CreateWeightTicketParams) middleware.Responder +} + +// NewCreateWeightTicket creates a new http.Handler for the create weight ticket operation +func NewCreateWeightTicket(ctx *middleware.Context, handler CreateWeightTicketHandler) *CreateWeightTicket { + return &CreateWeightTicket{Context: ctx, Handler: handler} +} + +/* + CreateWeightTicket swagger:route POST /ppm-shipments/{ppmShipmentId}/weight-ticket ppm createWeightTicket + +# Creates a weight ticket document + +Created a weight ticket document with the given information +*/ +type CreateWeightTicket struct { + Context *middleware.Context + Handler CreateWeightTicketHandler +} + +func (o *CreateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go new file mode 100644 index 00000000000..a690dcfc861 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewCreateWeightTicketParams creates a new CreateWeightTicketParams object +// +// There are no default values defined in the spec. +func NewCreateWeightTicketParams() CreateWeightTicketParams { + + return CreateWeightTicketParams{} +} + +// CreateWeightTicketParams contains all the bound params for the create weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters createWeightTicket +type CreateWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateWeightTicketParams() beforehand. +func (o *CreateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *CreateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *CreateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go new file mode 100644 index 00000000000..b8b14e02217 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateWeightTicketOKCode is the HTTP code returned for type CreateWeightTicketOK +const CreateWeightTicketOKCode int = 200 + +/* +CreateWeightTicketOK returns new weight ticket object + +swagger:response createWeightTicketOK +*/ +type CreateWeightTicketOK struct { + + /* + In: Body + */ + Payload *internalmessages.WeightTicket `json:"body,omitempty"` +} + +// NewCreateWeightTicketOK creates CreateWeightTicketOK with default headers values +func NewCreateWeightTicketOK() *CreateWeightTicketOK { + + return &CreateWeightTicketOK{} +} + +// WithPayload adds the payload to the create weight ticket o k response +func (o *CreateWeightTicketOK) WithPayload(payload *internalmessages.WeightTicket) *CreateWeightTicketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket o k response +func (o *CreateWeightTicketOK) SetPayload(payload *internalmessages.WeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketBadRequestCode is the HTTP code returned for type CreateWeightTicketBadRequest +const CreateWeightTicketBadRequestCode int = 400 + +/* +CreateWeightTicketBadRequest The request payload is invalid. + +swagger:response createWeightTicketBadRequest +*/ +type CreateWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateWeightTicketBadRequest creates CreateWeightTicketBadRequest with default headers values +func NewCreateWeightTicketBadRequest() *CreateWeightTicketBadRequest { + + return &CreateWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the create weight ticket bad request response +func (o *CreateWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket bad request response +func (o *CreateWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketUnauthorizedCode is the HTTP code returned for type CreateWeightTicketUnauthorized +const CreateWeightTicketUnauthorizedCode int = 401 + +/* +CreateWeightTicketUnauthorized The request was denied. + +swagger:response createWeightTicketUnauthorized +*/ +type CreateWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateWeightTicketUnauthorized creates CreateWeightTicketUnauthorized with default headers values +func NewCreateWeightTicketUnauthorized() *CreateWeightTicketUnauthorized { + + return &CreateWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the create weight ticket unauthorized response +func (o *CreateWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket unauthorized response +func (o *CreateWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketForbiddenCode is the HTTP code returned for type CreateWeightTicketForbidden +const CreateWeightTicketForbiddenCode int = 403 + +/* +CreateWeightTicketForbidden The request was denied. + +swagger:response createWeightTicketForbidden +*/ +type CreateWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateWeightTicketForbidden creates CreateWeightTicketForbidden with default headers values +func NewCreateWeightTicketForbidden() *CreateWeightTicketForbidden { + + return &CreateWeightTicketForbidden{} +} + +// WithPayload adds the payload to the create weight ticket forbidden response +func (o *CreateWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket forbidden response +func (o *CreateWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketNotFoundCode is the HTTP code returned for type CreateWeightTicketNotFound +const CreateWeightTicketNotFoundCode int = 404 + +/* +CreateWeightTicketNotFound The requested resource wasn't found. + +swagger:response createWeightTicketNotFound +*/ +type CreateWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateWeightTicketNotFound creates CreateWeightTicketNotFound with default headers values +func NewCreateWeightTicketNotFound() *CreateWeightTicketNotFound { + + return &CreateWeightTicketNotFound{} +} + +// WithPayload adds the payload to the create weight ticket not found response +func (o *CreateWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *CreateWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket not found response +func (o *CreateWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketUnprocessableEntityCode is the HTTP code returned for type CreateWeightTicketUnprocessableEntity +const CreateWeightTicketUnprocessableEntityCode int = 422 + +/* +CreateWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response createWeightTicketUnprocessableEntity +*/ +type CreateWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateWeightTicketUnprocessableEntity creates CreateWeightTicketUnprocessableEntity with default headers values +func NewCreateWeightTicketUnprocessableEntity() *CreateWeightTicketUnprocessableEntity { + + return &CreateWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the create weight ticket unprocessable entity response +func (o *CreateWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *CreateWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket unprocessable entity response +func (o *CreateWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWeightTicketInternalServerErrorCode is the HTTP code returned for type CreateWeightTicketInternalServerError +const CreateWeightTicketInternalServerErrorCode int = 500 + +/* +CreateWeightTicketInternalServerError A server error occurred. + +swagger:response createWeightTicketInternalServerError +*/ +type CreateWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewCreateWeightTicketInternalServerError creates CreateWeightTicketInternalServerError with default headers values +func NewCreateWeightTicketInternalServerError() *CreateWeightTicketInternalServerError { + + return &CreateWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the create weight ticket internal server error response +func (o *CreateWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *CreateWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create weight ticket internal server error response +func (o *CreateWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..08da13bfffc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/create_weight_ticket_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateWeightTicketURL generates an URL for the create weight ticket operation +type CreateWeightTicketURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWeightTicketURL) WithBasePath(bp string) *CreateWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on CreateWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go new file mode 100644 index 00000000000..48a94fe80e0 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteMovingExpenseHandlerFunc turns a function with the right signature into a delete moving expense handler +type DeleteMovingExpenseHandlerFunc func(DeleteMovingExpenseParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteMovingExpenseHandlerFunc) Handle(params DeleteMovingExpenseParams) middleware.Responder { + return fn(params) +} + +// DeleteMovingExpenseHandler interface for that can handle valid delete moving expense params +type DeleteMovingExpenseHandler interface { + Handle(DeleteMovingExpenseParams) middleware.Responder +} + +// NewDeleteMovingExpense creates a new http.Handler for the delete moving expense operation +func NewDeleteMovingExpense(ctx *middleware.Context, handler DeleteMovingExpenseHandler) *DeleteMovingExpense { + return &DeleteMovingExpense{Context: ctx, Handler: handler} +} + +/* + DeleteMovingExpense swagger:route DELETE /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm deleteMovingExpense + +# Soft deletes a moving expense by ID + +Removes a single moving expense receipt from the closeout line items for a PPM shipment. Soft deleted +records are not visible in milmove, but are kept in the database. +*/ +type DeleteMovingExpense struct { + Context *middleware.Context + Handler DeleteMovingExpenseHandler +} + +func (o *DeleteMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteMovingExpenseParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go new file mode 100644 index 00000000000..dacc76abee6 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteMovingExpenseParams creates a new DeleteMovingExpenseParams object +// +// There are no default values defined in the spec. +func NewDeleteMovingExpenseParams() DeleteMovingExpenseParams { + + return DeleteMovingExpenseParams{} +} + +// DeleteMovingExpenseParams contains all the bound params for the delete moving expense operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteMovingExpense +type DeleteMovingExpenseParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*ID of the moving expense to be deleted + Required: true + In: path + */ + MovingExpenseID strfmt.UUID + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteMovingExpenseParams() beforehand. +func (o *DeleteMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") + if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. +func (o *DeleteMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) + } + o.MovingExpenseID = *(value.(*strfmt.UUID)) + + if err := o.validateMovingExpenseID(formats); err != nil { + return err + } + + return nil +} + +// validateMovingExpenseID carries on validations for parameter MovingExpenseID +func (o *DeleteMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { + + if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { + return err + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *DeleteMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *DeleteMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go new file mode 100644 index 00000000000..a79baa37534 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_responses.go @@ -0,0 +1,354 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteMovingExpenseNoContentCode is the HTTP code returned for type DeleteMovingExpenseNoContent +const DeleteMovingExpenseNoContentCode int = 204 + +/* +DeleteMovingExpenseNoContent Successfully soft deleted the moving expense + +swagger:response deleteMovingExpenseNoContent +*/ +type DeleteMovingExpenseNoContent struct { +} + +// NewDeleteMovingExpenseNoContent creates DeleteMovingExpenseNoContent with default headers values +func NewDeleteMovingExpenseNoContent() *DeleteMovingExpenseNoContent { + + return &DeleteMovingExpenseNoContent{} +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteMovingExpenseBadRequestCode is the HTTP code returned for type DeleteMovingExpenseBadRequest +const DeleteMovingExpenseBadRequestCode int = 400 + +/* +DeleteMovingExpenseBadRequest The request payload is invalid. + +swagger:response deleteMovingExpenseBadRequest +*/ +type DeleteMovingExpenseBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseBadRequest creates DeleteMovingExpenseBadRequest with default headers values +func NewDeleteMovingExpenseBadRequest() *DeleteMovingExpenseBadRequest { + + return &DeleteMovingExpenseBadRequest{} +} + +// WithPayload adds the payload to the delete moving expense bad request response +func (o *DeleteMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense bad request response +func (o *DeleteMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseUnauthorizedCode is the HTTP code returned for type DeleteMovingExpenseUnauthorized +const DeleteMovingExpenseUnauthorizedCode int = 401 + +/* +DeleteMovingExpenseUnauthorized The request was denied. + +swagger:response deleteMovingExpenseUnauthorized +*/ +type DeleteMovingExpenseUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseUnauthorized creates DeleteMovingExpenseUnauthorized with default headers values +func NewDeleteMovingExpenseUnauthorized() *DeleteMovingExpenseUnauthorized { + + return &DeleteMovingExpenseUnauthorized{} +} + +// WithPayload adds the payload to the delete moving expense unauthorized response +func (o *DeleteMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense unauthorized response +func (o *DeleteMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseForbiddenCode is the HTTP code returned for type DeleteMovingExpenseForbidden +const DeleteMovingExpenseForbiddenCode int = 403 + +/* +DeleteMovingExpenseForbidden The request was denied. + +swagger:response deleteMovingExpenseForbidden +*/ +type DeleteMovingExpenseForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseForbidden creates DeleteMovingExpenseForbidden with default headers values +func NewDeleteMovingExpenseForbidden() *DeleteMovingExpenseForbidden { + + return &DeleteMovingExpenseForbidden{} +} + +// WithPayload adds the payload to the delete moving expense forbidden response +func (o *DeleteMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense forbidden response +func (o *DeleteMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseNotFoundCode is the HTTP code returned for type DeleteMovingExpenseNotFound +const DeleteMovingExpenseNotFoundCode int = 404 + +/* +DeleteMovingExpenseNotFound The requested resource wasn't found. + +swagger:response deleteMovingExpenseNotFound +*/ +type DeleteMovingExpenseNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseNotFound creates DeleteMovingExpenseNotFound with default headers values +func NewDeleteMovingExpenseNotFound() *DeleteMovingExpenseNotFound { + + return &DeleteMovingExpenseNotFound{} +} + +// WithPayload adds the payload to the delete moving expense not found response +func (o *DeleteMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense not found response +func (o *DeleteMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseConflictCode is the HTTP code returned for type DeleteMovingExpenseConflict +const DeleteMovingExpenseConflictCode int = 409 + +/* +DeleteMovingExpenseConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response deleteMovingExpenseConflict +*/ +type DeleteMovingExpenseConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseConflict creates DeleteMovingExpenseConflict with default headers values +func NewDeleteMovingExpenseConflict() *DeleteMovingExpenseConflict { + + return &DeleteMovingExpenseConflict{} +} + +// WithPayload adds the payload to the delete moving expense conflict response +func (o *DeleteMovingExpenseConflict) WithPayload(payload *internalmessages.ClientError) *DeleteMovingExpenseConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense conflict response +func (o *DeleteMovingExpenseConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseUnprocessableEntityCode is the HTTP code returned for type DeleteMovingExpenseUnprocessableEntity +const DeleteMovingExpenseUnprocessableEntityCode int = 422 + +/* +DeleteMovingExpenseUnprocessableEntity The payload was unprocessable. + +swagger:response deleteMovingExpenseUnprocessableEntity +*/ +type DeleteMovingExpenseUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseUnprocessableEntity creates DeleteMovingExpenseUnprocessableEntity with default headers values +func NewDeleteMovingExpenseUnprocessableEntity() *DeleteMovingExpenseUnprocessableEntity { + + return &DeleteMovingExpenseUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete moving expense unprocessable entity response +func (o *DeleteMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteMovingExpenseUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense unprocessable entity response +func (o *DeleteMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMovingExpenseInternalServerErrorCode is the HTTP code returned for type DeleteMovingExpenseInternalServerError +const DeleteMovingExpenseInternalServerErrorCode int = 500 + +/* +DeleteMovingExpenseInternalServerError A server error occurred. + +swagger:response deleteMovingExpenseInternalServerError +*/ +type DeleteMovingExpenseInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewDeleteMovingExpenseInternalServerError creates DeleteMovingExpenseInternalServerError with default headers values +func NewDeleteMovingExpenseInternalServerError() *DeleteMovingExpenseInternalServerError { + + return &DeleteMovingExpenseInternalServerError{} +} + +// WithPayload adds the payload to the delete moving expense internal server error response +func (o *DeleteMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteMovingExpenseInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete moving expense internal server error response +func (o *DeleteMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go new file mode 100644 index 00000000000..fc0e9760296 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_moving_expense_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteMovingExpenseURL generates an URL for the delete moving expense operation +type DeleteMovingExpenseURL struct { + MovingExpenseID strfmt.UUID + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMovingExpenseURL) WithBasePath(bp string) *DeleteMovingExpenseURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMovingExpenseURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteMovingExpenseURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" + + movingExpenseID := o.MovingExpenseID.String() + if movingExpenseID != "" { + _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) + } else { + return nil, errors.New("movingExpenseId is required on DeleteMovingExpenseURL") + } + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on DeleteMovingExpenseURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteMovingExpenseURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteMovingExpenseURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteMovingExpenseURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteMovingExpenseURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteMovingExpenseURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..5fa38fa663e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteProGearWeightTicketHandlerFunc turns a function with the right signature into a delete pro gear weight ticket handler +type DeleteProGearWeightTicketHandlerFunc func(DeleteProGearWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteProGearWeightTicketHandlerFunc) Handle(params DeleteProGearWeightTicketParams) middleware.Responder { + return fn(params) +} + +// DeleteProGearWeightTicketHandler interface for that can handle valid delete pro gear weight ticket params +type DeleteProGearWeightTicketHandler interface { + Handle(DeleteProGearWeightTicketParams) middleware.Responder +} + +// NewDeleteProGearWeightTicket creates a new http.Handler for the delete pro gear weight ticket operation +func NewDeleteProGearWeightTicket(ctx *middleware.Context, handler DeleteProGearWeightTicketHandler) *DeleteProGearWeightTicket { + return &DeleteProGearWeightTicket{Context: ctx, Handler: handler} +} + +/* + DeleteProGearWeightTicket swagger:route DELETE /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm deleteProGearWeightTicket + +# Soft deletes a pro-gear weight line item by ID + +Removes a single pro-gear weight ticket set from the closeout line items for a PPM shipment. Soft deleted +records are not visible in milmove, but are kept in the database. +*/ +type DeleteProGearWeightTicket struct { + Context *middleware.Context + Handler DeleteProGearWeightTicketHandler +} + +func (o *DeleteProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteProGearWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go new file mode 100644 index 00000000000..8c23d1c7b27 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteProGearWeightTicketParams creates a new DeleteProGearWeightTicketParams object +// +// There are no default values defined in the spec. +func NewDeleteProGearWeightTicketParams() DeleteProGearWeightTicketParams { + + return DeleteProGearWeightTicketParams{} +} + +// DeleteProGearWeightTicketParams contains all the bound params for the delete pro gear weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteProGearWeightTicket +type DeleteProGearWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*ID of the pro-gear weight ticket to be deleted + Required: true + In: path + */ + ProGearWeightTicketID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteProGearWeightTicketParams() beforehand. +func (o *DeleteProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") + if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *DeleteProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *DeleteProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. +func (o *DeleteProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) + } + o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateProGearWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID +func (o *DeleteProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go new file mode 100644 index 00000000000..04c1f2c4baf --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_responses.go @@ -0,0 +1,354 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteProGearWeightTicketNoContentCode is the HTTP code returned for type DeleteProGearWeightTicketNoContent +const DeleteProGearWeightTicketNoContentCode int = 204 + +/* +DeleteProGearWeightTicketNoContent Successfully soft deleted the pro-gear weight ticket + +swagger:response deleteProGearWeightTicketNoContent +*/ +type DeleteProGearWeightTicketNoContent struct { +} + +// NewDeleteProGearWeightTicketNoContent creates DeleteProGearWeightTicketNoContent with default headers values +func NewDeleteProGearWeightTicketNoContent() *DeleteProGearWeightTicketNoContent { + + return &DeleteProGearWeightTicketNoContent{} +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteProGearWeightTicketBadRequestCode is the HTTP code returned for type DeleteProGearWeightTicketBadRequest +const DeleteProGearWeightTicketBadRequestCode int = 400 + +/* +DeleteProGearWeightTicketBadRequest The request payload is invalid. + +swagger:response deleteProGearWeightTicketBadRequest +*/ +type DeleteProGearWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketBadRequest creates DeleteProGearWeightTicketBadRequest with default headers values +func NewDeleteProGearWeightTicketBadRequest() *DeleteProGearWeightTicketBadRequest { + + return &DeleteProGearWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket bad request response +func (o *DeleteProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket bad request response +func (o *DeleteProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketUnauthorizedCode is the HTTP code returned for type DeleteProGearWeightTicketUnauthorized +const DeleteProGearWeightTicketUnauthorizedCode int = 401 + +/* +DeleteProGearWeightTicketUnauthorized The request was denied. + +swagger:response deleteProGearWeightTicketUnauthorized +*/ +type DeleteProGearWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketUnauthorized creates DeleteProGearWeightTicketUnauthorized with default headers values +func NewDeleteProGearWeightTicketUnauthorized() *DeleteProGearWeightTicketUnauthorized { + + return &DeleteProGearWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket unauthorized response +func (o *DeleteProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket unauthorized response +func (o *DeleteProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketForbiddenCode is the HTTP code returned for type DeleteProGearWeightTicketForbidden +const DeleteProGearWeightTicketForbiddenCode int = 403 + +/* +DeleteProGearWeightTicketForbidden The request was denied. + +swagger:response deleteProGearWeightTicketForbidden +*/ +type DeleteProGearWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketForbidden creates DeleteProGearWeightTicketForbidden with default headers values +func NewDeleteProGearWeightTicketForbidden() *DeleteProGearWeightTicketForbidden { + + return &DeleteProGearWeightTicketForbidden{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket forbidden response +func (o *DeleteProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket forbidden response +func (o *DeleteProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketNotFoundCode is the HTTP code returned for type DeleteProGearWeightTicketNotFound +const DeleteProGearWeightTicketNotFoundCode int = 404 + +/* +DeleteProGearWeightTicketNotFound The requested resource wasn't found. + +swagger:response deleteProGearWeightTicketNotFound +*/ +type DeleteProGearWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketNotFound creates DeleteProGearWeightTicketNotFound with default headers values +func NewDeleteProGearWeightTicketNotFound() *DeleteProGearWeightTicketNotFound { + + return &DeleteProGearWeightTicketNotFound{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket not found response +func (o *DeleteProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket not found response +func (o *DeleteProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketConflictCode is the HTTP code returned for type DeleteProGearWeightTicketConflict +const DeleteProGearWeightTicketConflictCode int = 409 + +/* +DeleteProGearWeightTicketConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response deleteProGearWeightTicketConflict +*/ +type DeleteProGearWeightTicketConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketConflict creates DeleteProGearWeightTicketConflict with default headers values +func NewDeleteProGearWeightTicketConflict() *DeleteProGearWeightTicketConflict { + + return &DeleteProGearWeightTicketConflict{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket conflict response +func (o *DeleteProGearWeightTicketConflict) WithPayload(payload *internalmessages.ClientError) *DeleteProGearWeightTicketConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket conflict response +func (o *DeleteProGearWeightTicketConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type DeleteProGearWeightTicketUnprocessableEntity +const DeleteProGearWeightTicketUnprocessableEntityCode int = 422 + +/* +DeleteProGearWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response deleteProGearWeightTicketUnprocessableEntity +*/ +type DeleteProGearWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketUnprocessableEntity creates DeleteProGearWeightTicketUnprocessableEntity with default headers values +func NewDeleteProGearWeightTicketUnprocessableEntity() *DeleteProGearWeightTicketUnprocessableEntity { + + return &DeleteProGearWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket unprocessable entity response +func (o *DeleteProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteProGearWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket unprocessable entity response +func (o *DeleteProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type DeleteProGearWeightTicketInternalServerError +const DeleteProGearWeightTicketInternalServerErrorCode int = 500 + +/* +DeleteProGearWeightTicketInternalServerError A server error occurred. + +swagger:response deleteProGearWeightTicketInternalServerError +*/ +type DeleteProGearWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewDeleteProGearWeightTicketInternalServerError creates DeleteProGearWeightTicketInternalServerError with default headers values +func NewDeleteProGearWeightTicketInternalServerError() *DeleteProGearWeightTicketInternalServerError { + + return &DeleteProGearWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the delete pro gear weight ticket internal server error response +func (o *DeleteProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteProGearWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete pro gear weight ticket internal server error response +func (o *DeleteProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..1aa99fa9807 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_pro_gear_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteProGearWeightTicketURL generates an URL for the delete pro gear weight ticket operation +type DeleteProGearWeightTicketURL struct { + PpmShipmentID strfmt.UUID + ProGearWeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteProGearWeightTicketURL) WithBasePath(bp string) *DeleteProGearWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteProGearWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteProGearWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on DeleteProGearWeightTicketURL") + } + + proGearWeightTicketID := o.ProGearWeightTicketID.String() + if proGearWeightTicketID != "" { + _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) + } else { + return nil, errors.New("proGearWeightTicketId is required on DeleteProGearWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteProGearWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteProGearWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteProGearWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteProGearWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go new file mode 100644 index 00000000000..3a9f3ca633c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteWeightTicketHandlerFunc turns a function with the right signature into a delete weight ticket handler +type DeleteWeightTicketHandlerFunc func(DeleteWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteWeightTicketHandlerFunc) Handle(params DeleteWeightTicketParams) middleware.Responder { + return fn(params) +} + +// DeleteWeightTicketHandler interface for that can handle valid delete weight ticket params +type DeleteWeightTicketHandler interface { + Handle(DeleteWeightTicketParams) middleware.Responder +} + +// NewDeleteWeightTicket creates a new http.Handler for the delete weight ticket operation +func NewDeleteWeightTicket(ctx *middleware.Context, handler DeleteWeightTicketHandler) *DeleteWeightTicket { + return &DeleteWeightTicket{Context: ctx, Handler: handler} +} + +/* + DeleteWeightTicket swagger:route DELETE /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm deleteWeightTicket + +# Soft deletes a weight ticket by ID + +Removes a single weight ticket from the closeout line items for a PPM shipment. Soft deleted +records are not visible in milmove, but are kept in the database. This may change the PPM shipment's final +incentive. +*/ +type DeleteWeightTicket struct { + Context *middleware.Context + Handler DeleteWeightTicketHandler +} + +func (o *DeleteWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go new file mode 100644 index 00000000000..fd2b7c11f07 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_parameters.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteWeightTicketParams creates a new DeleteWeightTicketParams object +// +// There are no default values defined in the spec. +func NewDeleteWeightTicketParams() DeleteWeightTicketParams { + + return DeleteWeightTicketParams{} +} + +// DeleteWeightTicketParams contains all the bound params for the delete weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteWeightTicket +type DeleteWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*ID of the weight ticket to be deleted + Required: true + In: path + */ + WeightTicketID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteWeightTicketParams() beforehand. +func (o *DeleteWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") + if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *DeleteWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *DeleteWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindWeightTicketID binds and validates parameter WeightTicketID from path. +func (o *DeleteWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) + } + o.WeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateWeightTicketID carries on validations for parameter WeightTicketID +func (o *DeleteWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go new file mode 100644 index 00000000000..8dd6fc85960 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_responses.go @@ -0,0 +1,354 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteWeightTicketNoContentCode is the HTTP code returned for type DeleteWeightTicketNoContent +const DeleteWeightTicketNoContentCode int = 204 + +/* +DeleteWeightTicketNoContent Successfully soft deleted the weight ticket + +swagger:response deleteWeightTicketNoContent +*/ +type DeleteWeightTicketNoContent struct { +} + +// NewDeleteWeightTicketNoContent creates DeleteWeightTicketNoContent with default headers values +func NewDeleteWeightTicketNoContent() *DeleteWeightTicketNoContent { + + return &DeleteWeightTicketNoContent{} +} + +// WriteResponse to the client +func (o *DeleteWeightTicketNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteWeightTicketBadRequestCode is the HTTP code returned for type DeleteWeightTicketBadRequest +const DeleteWeightTicketBadRequestCode int = 400 + +/* +DeleteWeightTicketBadRequest The request payload is invalid. + +swagger:response deleteWeightTicketBadRequest +*/ +type DeleteWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketBadRequest creates DeleteWeightTicketBadRequest with default headers values +func NewDeleteWeightTicketBadRequest() *DeleteWeightTicketBadRequest { + + return &DeleteWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the delete weight ticket bad request response +func (o *DeleteWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket bad request response +func (o *DeleteWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketUnauthorizedCode is the HTTP code returned for type DeleteWeightTicketUnauthorized +const DeleteWeightTicketUnauthorizedCode int = 401 + +/* +DeleteWeightTicketUnauthorized The request was denied. + +swagger:response deleteWeightTicketUnauthorized +*/ +type DeleteWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketUnauthorized creates DeleteWeightTicketUnauthorized with default headers values +func NewDeleteWeightTicketUnauthorized() *DeleteWeightTicketUnauthorized { + + return &DeleteWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the delete weight ticket unauthorized response +func (o *DeleteWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket unauthorized response +func (o *DeleteWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketForbiddenCode is the HTTP code returned for type DeleteWeightTicketForbidden +const DeleteWeightTicketForbiddenCode int = 403 + +/* +DeleteWeightTicketForbidden The request was denied. + +swagger:response deleteWeightTicketForbidden +*/ +type DeleteWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketForbidden creates DeleteWeightTicketForbidden with default headers values +func NewDeleteWeightTicketForbidden() *DeleteWeightTicketForbidden { + + return &DeleteWeightTicketForbidden{} +} + +// WithPayload adds the payload to the delete weight ticket forbidden response +func (o *DeleteWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket forbidden response +func (o *DeleteWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketNotFoundCode is the HTTP code returned for type DeleteWeightTicketNotFound +const DeleteWeightTicketNotFoundCode int = 404 + +/* +DeleteWeightTicketNotFound The requested resource wasn't found. + +swagger:response deleteWeightTicketNotFound +*/ +type DeleteWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketNotFound creates DeleteWeightTicketNotFound with default headers values +func NewDeleteWeightTicketNotFound() *DeleteWeightTicketNotFound { + + return &DeleteWeightTicketNotFound{} +} + +// WithPayload adds the payload to the delete weight ticket not found response +func (o *DeleteWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket not found response +func (o *DeleteWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketConflictCode is the HTTP code returned for type DeleteWeightTicketConflict +const DeleteWeightTicketConflictCode int = 409 + +/* +DeleteWeightTicketConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response deleteWeightTicketConflict +*/ +type DeleteWeightTicketConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketConflict creates DeleteWeightTicketConflict with default headers values +func NewDeleteWeightTicketConflict() *DeleteWeightTicketConflict { + + return &DeleteWeightTicketConflict{} +} + +// WithPayload adds the payload to the delete weight ticket conflict response +func (o *DeleteWeightTicketConflict) WithPayload(payload *internalmessages.ClientError) *DeleteWeightTicketConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket conflict response +func (o *DeleteWeightTicketConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketUnprocessableEntityCode is the HTTP code returned for type DeleteWeightTicketUnprocessableEntity +const DeleteWeightTicketUnprocessableEntityCode int = 422 + +/* +DeleteWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response deleteWeightTicketUnprocessableEntity +*/ +type DeleteWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteWeightTicketUnprocessableEntity creates DeleteWeightTicketUnprocessableEntity with default headers values +func NewDeleteWeightTicketUnprocessableEntity() *DeleteWeightTicketUnprocessableEntity { + + return &DeleteWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete weight ticket unprocessable entity response +func (o *DeleteWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *DeleteWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket unprocessable entity response +func (o *DeleteWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteWeightTicketInternalServerErrorCode is the HTTP code returned for type DeleteWeightTicketInternalServerError +const DeleteWeightTicketInternalServerErrorCode int = 500 + +/* +DeleteWeightTicketInternalServerError A server error occurred. + +swagger:response deleteWeightTicketInternalServerError +*/ +type DeleteWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewDeleteWeightTicketInternalServerError creates DeleteWeightTicketInternalServerError with default headers values +func NewDeleteWeightTicketInternalServerError() *DeleteWeightTicketInternalServerError { + + return &DeleteWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the delete weight ticket internal server error response +func (o *DeleteWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *DeleteWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete weight ticket internal server error response +func (o *DeleteWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..b6ce03b31a7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/delete_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteWeightTicketURL generates an URL for the delete weight ticket operation +type DeleteWeightTicketURL struct { + PpmShipmentID strfmt.UUID + WeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteWeightTicketURL) WithBasePath(bp string) *DeleteWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on DeleteWeightTicketURL") + } + + weightTicketID := o.WeightTicketID.String() + if weightTicketID != "" { + _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) + } else { + return nil, errors.New("weightTicketId is required on DeleteWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go new file mode 100644 index 00000000000..87a1ffc86dc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ResubmitPPMShipmentDocumentationHandlerFunc turns a function with the right signature into a resubmit p p m shipment documentation handler +type ResubmitPPMShipmentDocumentationHandlerFunc func(ResubmitPPMShipmentDocumentationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ResubmitPPMShipmentDocumentationHandlerFunc) Handle(params ResubmitPPMShipmentDocumentationParams) middleware.Responder { + return fn(params) +} + +// ResubmitPPMShipmentDocumentationHandler interface for that can handle valid resubmit p p m shipment documentation params +type ResubmitPPMShipmentDocumentationHandler interface { + Handle(ResubmitPPMShipmentDocumentationParams) middleware.Responder +} + +// NewResubmitPPMShipmentDocumentation creates a new http.Handler for the resubmit p p m shipment documentation operation +func NewResubmitPPMShipmentDocumentation(ctx *middleware.Context, handler ResubmitPPMShipmentDocumentationHandler) *ResubmitPPMShipmentDocumentation { + return &ResubmitPPMShipmentDocumentation{Context: ctx, Handler: handler} +} + +/* + ResubmitPPMShipmentDocumentation swagger:route PUT /ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId} ppm resubmitPPMShipmentDocumentation + +# Updates signature and routes PPM shipment to service counselor + +Updates customer signature along with the text they agreed to, and then routes the PPM shipment to the service +counselor queue for review. +*/ +type ResubmitPPMShipmentDocumentation struct { + Context *middleware.Context + Handler ResubmitPPMShipmentDocumentationHandler +} + +func (o *ResubmitPPMShipmentDocumentation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewResubmitPPMShipmentDocumentationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go new file mode 100644 index 00000000000..ac6defe137d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewResubmitPPMShipmentDocumentationParams creates a new ResubmitPPMShipmentDocumentationParams object +// +// There are no default values defined in the spec. +func NewResubmitPPMShipmentDocumentationParams() ResubmitPPMShipmentDocumentationParams { + + return ResubmitPPMShipmentDocumentationParams{} +} + +// ResubmitPPMShipmentDocumentationParams contains all the bound params for the resubmit p p m shipment documentation operation +// typically these are obtained from a http.Request +// +// swagger:parameters resubmitPPMShipmentDocumentation +type ResubmitPPMShipmentDocumentationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + SavePPMShipmentSignedCertificationPayload *internalmessages.SavePPMShipmentSignedCertification + /*UUID of the signed certification + Required: true + In: path + */ + SignedCertificationID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewResubmitPPMShipmentDocumentationParams() beforehand. +func (o *ResubmitPPMShipmentDocumentationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.SavePPMShipmentSignedCertification + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("savePPMShipmentSignedCertificationPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.SavePPMShipmentSignedCertificationPayload = &body + } + } + } else { + res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) + } + + rSignedCertificationID, rhkSignedCertificationID, _ := route.Params.GetOK("signedCertificationId") + if err := o.bindSignedCertificationID(rSignedCertificationID, rhkSignedCertificationID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *ResubmitPPMShipmentDocumentationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *ResubmitPPMShipmentDocumentationParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *ResubmitPPMShipmentDocumentationParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindSignedCertificationID binds and validates parameter SignedCertificationID from path. +func (o *ResubmitPPMShipmentDocumentationParams) bindSignedCertificationID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("signedCertificationId", "path", "strfmt.UUID", raw) + } + o.SignedCertificationID = *(value.(*strfmt.UUID)) + + if err := o.validateSignedCertificationID(formats); err != nil { + return err + } + + return nil +} + +// validateSignedCertificationID carries on validations for parameter SignedCertificationID +func (o *ResubmitPPMShipmentDocumentationParams) validateSignedCertificationID(formats strfmt.Registry) error { + + if err := validate.FormatOf("signedCertificationId", "path", "uuid", o.SignedCertificationID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go new file mode 100644 index 00000000000..296f33c1599 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ResubmitPPMShipmentDocumentationOKCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationOK +const ResubmitPPMShipmentDocumentationOKCode int = 200 + +/* +ResubmitPPMShipmentDocumentationOK Returns the updated PPM shipment + +swagger:response resubmitPPMShipmentDocumentationOK +*/ +type ResubmitPPMShipmentDocumentationOK struct { + + /* + In: Body + */ + Payload *internalmessages.PPMShipment `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationOK creates ResubmitPPMShipmentDocumentationOK with default headers values +func NewResubmitPPMShipmentDocumentationOK() *ResubmitPPMShipmentDocumentationOK { + + return &ResubmitPPMShipmentDocumentationOK{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation o k response +func (o *ResubmitPPMShipmentDocumentationOK) WithPayload(payload *internalmessages.PPMShipment) *ResubmitPPMShipmentDocumentationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation o k response +func (o *ResubmitPPMShipmentDocumentationOK) SetPayload(payload *internalmessages.PPMShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationBadRequestCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationBadRequest +const ResubmitPPMShipmentDocumentationBadRequestCode int = 400 + +/* +ResubmitPPMShipmentDocumentationBadRequest The request payload is invalid. + +swagger:response resubmitPPMShipmentDocumentationBadRequest +*/ +type ResubmitPPMShipmentDocumentationBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationBadRequest creates ResubmitPPMShipmentDocumentationBadRequest with default headers values +func NewResubmitPPMShipmentDocumentationBadRequest() *ResubmitPPMShipmentDocumentationBadRequest { + + return &ResubmitPPMShipmentDocumentationBadRequest{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation bad request response +func (o *ResubmitPPMShipmentDocumentationBadRequest) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation bad request response +func (o *ResubmitPPMShipmentDocumentationBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationUnauthorizedCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationUnauthorized +const ResubmitPPMShipmentDocumentationUnauthorizedCode int = 401 + +/* +ResubmitPPMShipmentDocumentationUnauthorized The request was denied. + +swagger:response resubmitPPMShipmentDocumentationUnauthorized +*/ +type ResubmitPPMShipmentDocumentationUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationUnauthorized creates ResubmitPPMShipmentDocumentationUnauthorized with default headers values +func NewResubmitPPMShipmentDocumentationUnauthorized() *ResubmitPPMShipmentDocumentationUnauthorized { + + return &ResubmitPPMShipmentDocumentationUnauthorized{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation unauthorized response +func (o *ResubmitPPMShipmentDocumentationUnauthorized) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation unauthorized response +func (o *ResubmitPPMShipmentDocumentationUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationForbiddenCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationForbidden +const ResubmitPPMShipmentDocumentationForbiddenCode int = 403 + +/* +ResubmitPPMShipmentDocumentationForbidden The request was denied. + +swagger:response resubmitPPMShipmentDocumentationForbidden +*/ +type ResubmitPPMShipmentDocumentationForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationForbidden creates ResubmitPPMShipmentDocumentationForbidden with default headers values +func NewResubmitPPMShipmentDocumentationForbidden() *ResubmitPPMShipmentDocumentationForbidden { + + return &ResubmitPPMShipmentDocumentationForbidden{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation forbidden response +func (o *ResubmitPPMShipmentDocumentationForbidden) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation forbidden response +func (o *ResubmitPPMShipmentDocumentationForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationNotFoundCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationNotFound +const ResubmitPPMShipmentDocumentationNotFoundCode int = 404 + +/* +ResubmitPPMShipmentDocumentationNotFound The requested resource wasn't found. + +swagger:response resubmitPPMShipmentDocumentationNotFound +*/ +type ResubmitPPMShipmentDocumentationNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationNotFound creates ResubmitPPMShipmentDocumentationNotFound with default headers values +func NewResubmitPPMShipmentDocumentationNotFound() *ResubmitPPMShipmentDocumentationNotFound { + + return &ResubmitPPMShipmentDocumentationNotFound{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation not found response +func (o *ResubmitPPMShipmentDocumentationNotFound) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation not found response +func (o *ResubmitPPMShipmentDocumentationNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationConflictCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationConflict +const ResubmitPPMShipmentDocumentationConflictCode int = 409 + +/* +ResubmitPPMShipmentDocumentationConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response resubmitPPMShipmentDocumentationConflict +*/ +type ResubmitPPMShipmentDocumentationConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationConflict creates ResubmitPPMShipmentDocumentationConflict with default headers values +func NewResubmitPPMShipmentDocumentationConflict() *ResubmitPPMShipmentDocumentationConflict { + + return &ResubmitPPMShipmentDocumentationConflict{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation conflict response +func (o *ResubmitPPMShipmentDocumentationConflict) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation conflict response +func (o *ResubmitPPMShipmentDocumentationConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationPreconditionFailedCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationPreconditionFailed +const ResubmitPPMShipmentDocumentationPreconditionFailedCode int = 412 + +/* +ResubmitPPMShipmentDocumentationPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response resubmitPPMShipmentDocumentationPreconditionFailed +*/ +type ResubmitPPMShipmentDocumentationPreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationPreconditionFailed creates ResubmitPPMShipmentDocumentationPreconditionFailed with default headers values +func NewResubmitPPMShipmentDocumentationPreconditionFailed() *ResubmitPPMShipmentDocumentationPreconditionFailed { + + return &ResubmitPPMShipmentDocumentationPreconditionFailed{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation precondition failed response +func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *ResubmitPPMShipmentDocumentationPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation precondition failed response +func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationUnprocessableEntityCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationUnprocessableEntity +const ResubmitPPMShipmentDocumentationUnprocessableEntityCode int = 422 + +/* +ResubmitPPMShipmentDocumentationUnprocessableEntity The payload was unprocessable. + +swagger:response resubmitPPMShipmentDocumentationUnprocessableEntity +*/ +type ResubmitPPMShipmentDocumentationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationUnprocessableEntity creates ResubmitPPMShipmentDocumentationUnprocessableEntity with default headers values +func NewResubmitPPMShipmentDocumentationUnprocessableEntity() *ResubmitPPMShipmentDocumentationUnprocessableEntity { + + return &ResubmitPPMShipmentDocumentationUnprocessableEntity{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation unprocessable entity response +func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *ResubmitPPMShipmentDocumentationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation unprocessable entity response +func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ResubmitPPMShipmentDocumentationInternalServerErrorCode is the HTTP code returned for type ResubmitPPMShipmentDocumentationInternalServerError +const ResubmitPPMShipmentDocumentationInternalServerErrorCode int = 500 + +/* +ResubmitPPMShipmentDocumentationInternalServerError A server error occurred. + +swagger:response resubmitPPMShipmentDocumentationInternalServerError +*/ +type ResubmitPPMShipmentDocumentationInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewResubmitPPMShipmentDocumentationInternalServerError creates ResubmitPPMShipmentDocumentationInternalServerError with default headers values +func NewResubmitPPMShipmentDocumentationInternalServerError() *ResubmitPPMShipmentDocumentationInternalServerError { + + return &ResubmitPPMShipmentDocumentationInternalServerError{} +} + +// WithPayload adds the payload to the resubmit p p m shipment documentation internal server error response +func (o *ResubmitPPMShipmentDocumentationInternalServerError) WithPayload(payload *internalmessages.Error) *ResubmitPPMShipmentDocumentationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the resubmit p p m shipment documentation internal server error response +func (o *ResubmitPPMShipmentDocumentationInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ResubmitPPMShipmentDocumentationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go new file mode 100644 index 00000000000..efd59b4dd02 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/resubmit_p_p_m_shipment_documentation_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ResubmitPPMShipmentDocumentationURL generates an URL for the resubmit p p m shipment documentation operation +type ResubmitPPMShipmentDocumentationURL struct { + PpmShipmentID strfmt.UUID + SignedCertificationID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ResubmitPPMShipmentDocumentationURL) WithBasePath(bp string) *ResubmitPPMShipmentDocumentationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ResubmitPPMShipmentDocumentationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ResubmitPPMShipmentDocumentationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/resubmit-ppm-shipment-documentation/{signedCertificationId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on ResubmitPPMShipmentDocumentationURL") + } + + signedCertificationID := o.SignedCertificationID.String() + if signedCertificationID != "" { + _path = strings.Replace(_path, "{signedCertificationId}", signedCertificationID, -1) + } else { + return nil, errors.New("signedCertificationId is required on ResubmitPPMShipmentDocumentationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ResubmitPPMShipmentDocumentationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ResubmitPPMShipmentDocumentationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ResubmitPPMShipmentDocumentationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ResubmitPPMShipmentDocumentationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ResubmitPPMShipmentDocumentationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ResubmitPPMShipmentDocumentationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go new file mode 100644 index 00000000000..2766f01b32c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowAOAPacketHandlerFunc turns a function with the right signature into a show a o a packet handler +type ShowAOAPacketHandlerFunc func(ShowAOAPacketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowAOAPacketHandlerFunc) Handle(params ShowAOAPacketParams) middleware.Responder { + return fn(params) +} + +// ShowAOAPacketHandler interface for that can handle valid show a o a packet params +type ShowAOAPacketHandler interface { + Handle(ShowAOAPacketParams) middleware.Responder +} + +// NewShowAOAPacket creates a new http.Handler for the show a o a packet operation +func NewShowAOAPacket(ctx *middleware.Context, handler ShowAOAPacketHandler) *ShowAOAPacket { + return &ShowAOAPacket{Context: ctx, Handler: handler} +} + +/* + ShowAOAPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/aoa-packet ppm showAOAPacket + +# Downloads AOA Packet form PPMShipment as a PDF + +### Functionality +This endpoint downloads all uploaded move order documentation combined with the Shipment Summary Worksheet into a single PDF. +### Errors +* The PPMShipment must have requested an AOA. +* The PPMShipment AOA Request must have been approved. +*/ +type ShowAOAPacket struct { + Context *middleware.Context + Handler ShowAOAPacketHandler +} + +func (o *ShowAOAPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowAOAPacketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go new file mode 100644 index 00000000000..046c0667969 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewShowAOAPacketParams creates a new ShowAOAPacketParams object +// +// There are no default values defined in the spec. +func NewShowAOAPacketParams() ShowAOAPacketParams { + + return ShowAOAPacketParams{} +} + +// ShowAOAPacketParams contains all the bound params for the show a o a packet operation +// typically these are obtained from a http.Request +// +// swagger:parameters showAOAPacket +type ShowAOAPacketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the id for the ppmshipment with aoa to be downloaded + Required: true + In: path + */ + PpmShipmentID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowAOAPacketParams() beforehand. +func (o *ShowAOAPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *ShowAOAPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PpmShipmentID = raw + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go new file mode 100644 index 00000000000..e391bc128eb --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_responses.go @@ -0,0 +1,305 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowAOAPacketOKCode is the HTTP code returned for type ShowAOAPacketOK +const ShowAOAPacketOKCode int = 200 + +/* +ShowAOAPacketOK AOA PDF + +swagger:response showAOAPacketOK +*/ +type ShowAOAPacketOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewShowAOAPacketOK creates ShowAOAPacketOK with default headers values +func NewShowAOAPacketOK() *ShowAOAPacketOK { + + return &ShowAOAPacketOK{} +} + +// WithContentDisposition adds the contentDisposition to the show a o a packet o k response +func (o *ShowAOAPacketOK) WithContentDisposition(contentDisposition string) *ShowAOAPacketOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the show a o a packet o k response +func (o *ShowAOAPacketOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the show a o a packet o k response +func (o *ShowAOAPacketOK) WithPayload(payload io.ReadCloser) *ShowAOAPacketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet o k response +func (o *ShowAOAPacketOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowAOAPacketBadRequestCode is the HTTP code returned for type ShowAOAPacketBadRequest +const ShowAOAPacketBadRequestCode int = 400 + +/* +ShowAOAPacketBadRequest The request payload is invalid. + +swagger:response showAOAPacketBadRequest +*/ +type ShowAOAPacketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewShowAOAPacketBadRequest creates ShowAOAPacketBadRequest with default headers values +func NewShowAOAPacketBadRequest() *ShowAOAPacketBadRequest { + + return &ShowAOAPacketBadRequest{} +} + +// WithPayload adds the payload to the show a o a packet bad request response +func (o *ShowAOAPacketBadRequest) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet bad request response +func (o *ShowAOAPacketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketForbiddenCode is the HTTP code returned for type ShowAOAPacketForbidden +const ShowAOAPacketForbiddenCode int = 403 + +/* +ShowAOAPacketForbidden The request was denied. + +swagger:response showAOAPacketForbidden +*/ +type ShowAOAPacketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewShowAOAPacketForbidden creates ShowAOAPacketForbidden with default headers values +func NewShowAOAPacketForbidden() *ShowAOAPacketForbidden { + + return &ShowAOAPacketForbidden{} +} + +// WithPayload adds the payload to the show a o a packet forbidden response +func (o *ShowAOAPacketForbidden) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet forbidden response +func (o *ShowAOAPacketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketNotFoundCode is the HTTP code returned for type ShowAOAPacketNotFound +const ShowAOAPacketNotFoundCode int = 404 + +/* +ShowAOAPacketNotFound The requested resource wasn't found. + +swagger:response showAOAPacketNotFound +*/ +type ShowAOAPacketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewShowAOAPacketNotFound creates ShowAOAPacketNotFound with default headers values +func NewShowAOAPacketNotFound() *ShowAOAPacketNotFound { + + return &ShowAOAPacketNotFound{} +} + +// WithPayload adds the payload to the show a o a packet not found response +func (o *ShowAOAPacketNotFound) WithPayload(payload *internalmessages.ClientError) *ShowAOAPacketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet not found response +func (o *ShowAOAPacketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketUnprocessableEntityCode is the HTTP code returned for type ShowAOAPacketUnprocessableEntity +const ShowAOAPacketUnprocessableEntityCode int = 422 + +/* +ShowAOAPacketUnprocessableEntity The payload was unprocessable. + +swagger:response showAOAPacketUnprocessableEntity +*/ +type ShowAOAPacketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewShowAOAPacketUnprocessableEntity creates ShowAOAPacketUnprocessableEntity with default headers values +func NewShowAOAPacketUnprocessableEntity() *ShowAOAPacketUnprocessableEntity { + + return &ShowAOAPacketUnprocessableEntity{} +} + +// WithPayload adds the payload to the show a o a packet unprocessable entity response +func (o *ShowAOAPacketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *ShowAOAPacketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet unprocessable entity response +func (o *ShowAOAPacketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowAOAPacketInternalServerErrorCode is the HTTP code returned for type ShowAOAPacketInternalServerError +const ShowAOAPacketInternalServerErrorCode int = 500 + +/* +ShowAOAPacketInternalServerError A server error occurred. + +swagger:response showAOAPacketInternalServerError +*/ +type ShowAOAPacketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewShowAOAPacketInternalServerError creates ShowAOAPacketInternalServerError with default headers values +func NewShowAOAPacketInternalServerError() *ShowAOAPacketInternalServerError { + + return &ShowAOAPacketInternalServerError{} +} + +// WithPayload adds the payload to the show a o a packet internal server error response +func (o *ShowAOAPacketInternalServerError) WithPayload(payload *internalmessages.Error) *ShowAOAPacketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show a o a packet internal server error response +func (o *ShowAOAPacketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowAOAPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go new file mode 100644 index 00000000000..560a206f633 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_a_o_a_packet_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// ShowAOAPacketURL generates an URL for the show a o a packet operation +type ShowAOAPacketURL struct { + PpmShipmentID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAOAPacketURL) WithBasePath(bp string) *ShowAOAPacketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowAOAPacketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowAOAPacketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/aoa-packet" + + ppmShipmentID := o.PpmShipmentID + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on ShowAOAPacketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowAOAPacketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowAOAPacketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowAOAPacketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowAOAPacketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowAOAPacketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowAOAPacketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go new file mode 100644 index 00000000000..8ba7d0c7e56 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowPaymentPacketHandlerFunc turns a function with the right signature into a show payment packet handler +type ShowPaymentPacketHandlerFunc func(ShowPaymentPacketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowPaymentPacketHandlerFunc) Handle(params ShowPaymentPacketParams) middleware.Responder { + return fn(params) +} + +// ShowPaymentPacketHandler interface for that can handle valid show payment packet params +type ShowPaymentPacketHandler interface { + Handle(ShowPaymentPacketParams) middleware.Responder +} + +// NewShowPaymentPacket creates a new http.Handler for the show payment packet operation +func NewShowPaymentPacket(ctx *middleware.Context, handler ShowPaymentPacketHandler) *ShowPaymentPacket { + return &ShowPaymentPacket{Context: ctx, Handler: handler} +} + +/* + ShowPaymentPacket swagger:route GET /ppm-shipments/{ppmShipmentId}/payment-packet ppm showPaymentPacket + +# Returns PPM payment packet + +Generates a PDF containing all user uploaded documentations for PPM. Contains SSW form, orders, weight and expense documentations. +*/ +type ShowPaymentPacket struct { + Context *middleware.Context + Handler ShowPaymentPacketHandler +} + +func (o *ShowPaymentPacket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowPaymentPacketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go new file mode 100644 index 00000000000..b3b4c85fadf --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowPaymentPacketParams creates a new ShowPaymentPacketParams object +// +// There are no default values defined in the spec. +func NewShowPaymentPacketParams() ShowPaymentPacketParams { + + return ShowPaymentPacketParams{} +} + +// ShowPaymentPacketParams contains all the bound params for the show payment packet operation +// typically these are obtained from a http.Request +// +// swagger:parameters showPaymentPacket +type ShowPaymentPacketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the ppmShipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowPaymentPacketParams() beforehand. +func (o *ShowPaymentPacketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *ShowPaymentPacketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *ShowPaymentPacketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go new file mode 100644 index 00000000000..8537da157f4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_responses.go @@ -0,0 +1,203 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" +) + +// ShowPaymentPacketOKCode is the HTTP code returned for type ShowPaymentPacketOK +const ShowPaymentPacketOKCode int = 200 + +/* +ShowPaymentPacketOK PPM Payment Packet PDF + +swagger:response showPaymentPacketOK +*/ +type ShowPaymentPacketOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewShowPaymentPacketOK creates ShowPaymentPacketOK with default headers values +func NewShowPaymentPacketOK() *ShowPaymentPacketOK { + + return &ShowPaymentPacketOK{} +} + +// WithContentDisposition adds the contentDisposition to the show payment packet o k response +func (o *ShowPaymentPacketOK) WithContentDisposition(contentDisposition string) *ShowPaymentPacketOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the show payment packet o k response +func (o *ShowPaymentPacketOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the show payment packet o k response +func (o *ShowPaymentPacketOK) WithPayload(payload io.ReadCloser) *ShowPaymentPacketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show payment packet o k response +func (o *ShowPaymentPacketOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowPaymentPacketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowPaymentPacketBadRequestCode is the HTTP code returned for type ShowPaymentPacketBadRequest +const ShowPaymentPacketBadRequestCode int = 400 + +/* +ShowPaymentPacketBadRequest invalid request + +swagger:response showPaymentPacketBadRequest +*/ +type ShowPaymentPacketBadRequest struct { +} + +// NewShowPaymentPacketBadRequest creates ShowPaymentPacketBadRequest with default headers values +func NewShowPaymentPacketBadRequest() *ShowPaymentPacketBadRequest { + + return &ShowPaymentPacketBadRequest{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowPaymentPacketUnauthorizedCode is the HTTP code returned for type ShowPaymentPacketUnauthorized +const ShowPaymentPacketUnauthorizedCode int = 401 + +/* +ShowPaymentPacketUnauthorized request requires user authentication + +swagger:response showPaymentPacketUnauthorized +*/ +type ShowPaymentPacketUnauthorized struct { +} + +// NewShowPaymentPacketUnauthorized creates ShowPaymentPacketUnauthorized with default headers values +func NewShowPaymentPacketUnauthorized() *ShowPaymentPacketUnauthorized { + + return &ShowPaymentPacketUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowPaymentPacketForbiddenCode is the HTTP code returned for type ShowPaymentPacketForbidden +const ShowPaymentPacketForbiddenCode int = 403 + +/* +ShowPaymentPacketForbidden user is not authorized + +swagger:response showPaymentPacketForbidden +*/ +type ShowPaymentPacketForbidden struct { +} + +// NewShowPaymentPacketForbidden creates ShowPaymentPacketForbidden with default headers values +func NewShowPaymentPacketForbidden() *ShowPaymentPacketForbidden { + + return &ShowPaymentPacketForbidden{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowPaymentPacketNotFoundCode is the HTTP code returned for type ShowPaymentPacketNotFound +const ShowPaymentPacketNotFoundCode int = 404 + +/* +ShowPaymentPacketNotFound ppm not found + +swagger:response showPaymentPacketNotFound +*/ +type ShowPaymentPacketNotFound struct { +} + +// NewShowPaymentPacketNotFound creates ShowPaymentPacketNotFound with default headers values +func NewShowPaymentPacketNotFound() *ShowPaymentPacketNotFound { + + return &ShowPaymentPacketNotFound{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowPaymentPacketInternalServerErrorCode is the HTTP code returned for type ShowPaymentPacketInternalServerError +const ShowPaymentPacketInternalServerErrorCode int = 500 + +/* +ShowPaymentPacketInternalServerError internal server error + +swagger:response showPaymentPacketInternalServerError +*/ +type ShowPaymentPacketInternalServerError struct { +} + +// NewShowPaymentPacketInternalServerError creates ShowPaymentPacketInternalServerError with default headers values +func NewShowPaymentPacketInternalServerError() *ShowPaymentPacketInternalServerError { + + return &ShowPaymentPacketInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowPaymentPacketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go new file mode 100644 index 00000000000..7cf1ed7163f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/show_payment_packet_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowPaymentPacketURL generates an URL for the show payment packet operation +type ShowPaymentPacketURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowPaymentPacketURL) WithBasePath(bp string) *ShowPaymentPacketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowPaymentPacketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowPaymentPacketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/payment-packet" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on ShowPaymentPacketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowPaymentPacketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowPaymentPacketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowPaymentPacketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowPaymentPacketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowPaymentPacketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowPaymentPacketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go new file mode 100644 index 00000000000..435a73316be --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// SubmitPPMShipmentDocumentationHandlerFunc turns a function with the right signature into a submit p p m shipment documentation handler +type SubmitPPMShipmentDocumentationHandlerFunc func(SubmitPPMShipmentDocumentationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn SubmitPPMShipmentDocumentationHandlerFunc) Handle(params SubmitPPMShipmentDocumentationParams) middleware.Responder { + return fn(params) +} + +// SubmitPPMShipmentDocumentationHandler interface for that can handle valid submit p p m shipment documentation params +type SubmitPPMShipmentDocumentationHandler interface { + Handle(SubmitPPMShipmentDocumentationParams) middleware.Responder +} + +// NewSubmitPPMShipmentDocumentation creates a new http.Handler for the submit p p m shipment documentation operation +func NewSubmitPPMShipmentDocumentation(ctx *middleware.Context, handler SubmitPPMShipmentDocumentationHandler) *SubmitPPMShipmentDocumentation { + return &SubmitPPMShipmentDocumentation{Context: ctx, Handler: handler} +} + +/* + SubmitPPMShipmentDocumentation swagger:route POST /ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation ppm submitPPMShipmentDocumentation + +# Saves signature and routes PPM shipment to service counselor + +Saves customer signature along with the text they agreed to, and then routes the PPM shipment to the service +counselor queue for review. +*/ +type SubmitPPMShipmentDocumentation struct { + Context *middleware.Context + Handler SubmitPPMShipmentDocumentationHandler +} + +func (o *SubmitPPMShipmentDocumentation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewSubmitPPMShipmentDocumentationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go new file mode 100644 index 00000000000..2664c450f8c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewSubmitPPMShipmentDocumentationParams creates a new SubmitPPMShipmentDocumentationParams object +// +// There are no default values defined in the spec. +func NewSubmitPPMShipmentDocumentationParams() SubmitPPMShipmentDocumentationParams { + + return SubmitPPMShipmentDocumentationParams{} +} + +// SubmitPPMShipmentDocumentationParams contains all the bound params for the submit p p m shipment documentation operation +// typically these are obtained from a http.Request +// +// swagger:parameters submitPPMShipmentDocumentation +type SubmitPPMShipmentDocumentationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + SavePPMShipmentSignedCertificationPayload *internalmessages.SavePPMShipmentSignedCertification +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewSubmitPPMShipmentDocumentationParams() beforehand. +func (o *SubmitPPMShipmentDocumentationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.SavePPMShipmentSignedCertification + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("savePPMShipmentSignedCertificationPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.SavePPMShipmentSignedCertificationPayload = &body + } + } + } else { + res = append(res, errors.Required("savePPMShipmentSignedCertificationPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *SubmitPPMShipmentDocumentationParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *SubmitPPMShipmentDocumentationParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go new file mode 100644 index 00000000000..136a5f31fe1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// SubmitPPMShipmentDocumentationOKCode is the HTTP code returned for type SubmitPPMShipmentDocumentationOK +const SubmitPPMShipmentDocumentationOKCode int = 200 + +/* +SubmitPPMShipmentDocumentationOK Returns the updated PPM shipment + +swagger:response submitPPMShipmentDocumentationOK +*/ +type SubmitPPMShipmentDocumentationOK struct { + + /* + In: Body + */ + Payload *internalmessages.PPMShipment `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationOK creates SubmitPPMShipmentDocumentationOK with default headers values +func NewSubmitPPMShipmentDocumentationOK() *SubmitPPMShipmentDocumentationOK { + + return &SubmitPPMShipmentDocumentationOK{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation o k response +func (o *SubmitPPMShipmentDocumentationOK) WithPayload(payload *internalmessages.PPMShipment) *SubmitPPMShipmentDocumentationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation o k response +func (o *SubmitPPMShipmentDocumentationOK) SetPayload(payload *internalmessages.PPMShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationBadRequestCode is the HTTP code returned for type SubmitPPMShipmentDocumentationBadRequest +const SubmitPPMShipmentDocumentationBadRequestCode int = 400 + +/* +SubmitPPMShipmentDocumentationBadRequest The request payload is invalid. + +swagger:response submitPPMShipmentDocumentationBadRequest +*/ +type SubmitPPMShipmentDocumentationBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationBadRequest creates SubmitPPMShipmentDocumentationBadRequest with default headers values +func NewSubmitPPMShipmentDocumentationBadRequest() *SubmitPPMShipmentDocumentationBadRequest { + + return &SubmitPPMShipmentDocumentationBadRequest{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation bad request response +func (o *SubmitPPMShipmentDocumentationBadRequest) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation bad request response +func (o *SubmitPPMShipmentDocumentationBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationUnauthorizedCode is the HTTP code returned for type SubmitPPMShipmentDocumentationUnauthorized +const SubmitPPMShipmentDocumentationUnauthorizedCode int = 401 + +/* +SubmitPPMShipmentDocumentationUnauthorized The request was denied. + +swagger:response submitPPMShipmentDocumentationUnauthorized +*/ +type SubmitPPMShipmentDocumentationUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationUnauthorized creates SubmitPPMShipmentDocumentationUnauthorized with default headers values +func NewSubmitPPMShipmentDocumentationUnauthorized() *SubmitPPMShipmentDocumentationUnauthorized { + + return &SubmitPPMShipmentDocumentationUnauthorized{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation unauthorized response +func (o *SubmitPPMShipmentDocumentationUnauthorized) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation unauthorized response +func (o *SubmitPPMShipmentDocumentationUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationForbiddenCode is the HTTP code returned for type SubmitPPMShipmentDocumentationForbidden +const SubmitPPMShipmentDocumentationForbiddenCode int = 403 + +/* +SubmitPPMShipmentDocumentationForbidden The request was denied. + +swagger:response submitPPMShipmentDocumentationForbidden +*/ +type SubmitPPMShipmentDocumentationForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationForbidden creates SubmitPPMShipmentDocumentationForbidden with default headers values +func NewSubmitPPMShipmentDocumentationForbidden() *SubmitPPMShipmentDocumentationForbidden { + + return &SubmitPPMShipmentDocumentationForbidden{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation forbidden response +func (o *SubmitPPMShipmentDocumentationForbidden) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation forbidden response +func (o *SubmitPPMShipmentDocumentationForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationNotFoundCode is the HTTP code returned for type SubmitPPMShipmentDocumentationNotFound +const SubmitPPMShipmentDocumentationNotFoundCode int = 404 + +/* +SubmitPPMShipmentDocumentationNotFound The requested resource wasn't found. + +swagger:response submitPPMShipmentDocumentationNotFound +*/ +type SubmitPPMShipmentDocumentationNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationNotFound creates SubmitPPMShipmentDocumentationNotFound with default headers values +func NewSubmitPPMShipmentDocumentationNotFound() *SubmitPPMShipmentDocumentationNotFound { + + return &SubmitPPMShipmentDocumentationNotFound{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation not found response +func (o *SubmitPPMShipmentDocumentationNotFound) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation not found response +func (o *SubmitPPMShipmentDocumentationNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationConflictCode is the HTTP code returned for type SubmitPPMShipmentDocumentationConflict +const SubmitPPMShipmentDocumentationConflictCode int = 409 + +/* +SubmitPPMShipmentDocumentationConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response submitPPMShipmentDocumentationConflict +*/ +type SubmitPPMShipmentDocumentationConflict struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationConflict creates SubmitPPMShipmentDocumentationConflict with default headers values +func NewSubmitPPMShipmentDocumentationConflict() *SubmitPPMShipmentDocumentationConflict { + + return &SubmitPPMShipmentDocumentationConflict{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation conflict response +func (o *SubmitPPMShipmentDocumentationConflict) WithPayload(payload *internalmessages.ClientError) *SubmitPPMShipmentDocumentationConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation conflict response +func (o *SubmitPPMShipmentDocumentationConflict) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationUnprocessableEntityCode is the HTTP code returned for type SubmitPPMShipmentDocumentationUnprocessableEntity +const SubmitPPMShipmentDocumentationUnprocessableEntityCode int = 422 + +/* +SubmitPPMShipmentDocumentationUnprocessableEntity The payload was unprocessable. + +swagger:response submitPPMShipmentDocumentationUnprocessableEntity +*/ +type SubmitPPMShipmentDocumentationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationUnprocessableEntity creates SubmitPPMShipmentDocumentationUnprocessableEntity with default headers values +func NewSubmitPPMShipmentDocumentationUnprocessableEntity() *SubmitPPMShipmentDocumentationUnprocessableEntity { + + return &SubmitPPMShipmentDocumentationUnprocessableEntity{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation unprocessable entity response +func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *SubmitPPMShipmentDocumentationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation unprocessable entity response +func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// SubmitPPMShipmentDocumentationInternalServerErrorCode is the HTTP code returned for type SubmitPPMShipmentDocumentationInternalServerError +const SubmitPPMShipmentDocumentationInternalServerErrorCode int = 500 + +/* +SubmitPPMShipmentDocumentationInternalServerError A server error occurred. + +swagger:response submitPPMShipmentDocumentationInternalServerError +*/ +type SubmitPPMShipmentDocumentationInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewSubmitPPMShipmentDocumentationInternalServerError creates SubmitPPMShipmentDocumentationInternalServerError with default headers values +func NewSubmitPPMShipmentDocumentationInternalServerError() *SubmitPPMShipmentDocumentationInternalServerError { + + return &SubmitPPMShipmentDocumentationInternalServerError{} +} + +// WithPayload adds the payload to the submit p p m shipment documentation internal server error response +func (o *SubmitPPMShipmentDocumentationInternalServerError) WithPayload(payload *internalmessages.Error) *SubmitPPMShipmentDocumentationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the submit p p m shipment documentation internal server error response +func (o *SubmitPPMShipmentDocumentationInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *SubmitPPMShipmentDocumentationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go new file mode 100644 index 00000000000..2444faa865e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/submit_p_p_m_shipment_documentation_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// SubmitPPMShipmentDocumentationURL generates an URL for the submit p p m shipment documentation operation +type SubmitPPMShipmentDocumentationURL struct { + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitPPMShipmentDocumentationURL) WithBasePath(bp string) *SubmitPPMShipmentDocumentationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *SubmitPPMShipmentDocumentationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *SubmitPPMShipmentDocumentationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/submit-ppm-shipment-documentation" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on SubmitPPMShipmentDocumentationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *SubmitPPMShipmentDocumentationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *SubmitPPMShipmentDocumentationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *SubmitPPMShipmentDocumentationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on SubmitPPMShipmentDocumentationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on SubmitPPMShipmentDocumentationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *SubmitPPMShipmentDocumentationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go new file mode 100644 index 00000000000..bea95125fd1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMovingExpenseHandlerFunc turns a function with the right signature into a update moving expense handler +type UpdateMovingExpenseHandlerFunc func(UpdateMovingExpenseParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMovingExpenseHandlerFunc) Handle(params UpdateMovingExpenseParams) middleware.Responder { + return fn(params) +} + +// UpdateMovingExpenseHandler interface for that can handle valid update moving expense params +type UpdateMovingExpenseHandler interface { + Handle(UpdateMovingExpenseParams) middleware.Responder +} + +// NewUpdateMovingExpense creates a new http.Handler for the update moving expense operation +func NewUpdateMovingExpense(ctx *middleware.Context, handler UpdateMovingExpenseHandler) *UpdateMovingExpense { + return &UpdateMovingExpense{Context: ctx, Handler: handler} +} + +/* + UpdateMovingExpense swagger:route PATCH /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId} ppm updateMovingExpense + +# Updates the moving expense + +Any fields sent in this request will be set on the moving expense referenced +*/ +type UpdateMovingExpense struct { + Context *middleware.Context + Handler UpdateMovingExpenseHandler +} + +func (o *UpdateMovingExpense) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMovingExpenseParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go new file mode 100644 index 00000000000..0b1a0b78714 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateMovingExpenseParams creates a new UpdateMovingExpenseParams object +// +// There are no default values defined in the spec. +func NewUpdateMovingExpenseParams() UpdateMovingExpenseParams { + + return UpdateMovingExpenseParams{} +} + +// UpdateMovingExpenseParams contains all the bound params for the update moving expense operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMovingExpense +type UpdateMovingExpenseParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the moving expense + Required: true + In: path + */ + MovingExpenseID strfmt.UUID + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + UpdateMovingExpense *internalmessages.UpdateMovingExpense +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMovingExpenseParams() beforehand. +func (o *UpdateMovingExpenseParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMovingExpenseID, rhkMovingExpenseID, _ := route.Params.GetOK("movingExpenseId") + if err := o.bindMovingExpenseID(rMovingExpenseID, rhkMovingExpenseID, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateMovingExpense + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateMovingExpense", "body", "")) + } else { + res = append(res, errors.NewParseError("updateMovingExpense", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateMovingExpense = &body + } + } + } else { + res = append(res, errors.Required("updateMovingExpense", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMovingExpenseParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMovingExpenseID binds and validates parameter MovingExpenseID from path. +func (o *UpdateMovingExpenseParams) bindMovingExpenseID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("movingExpenseId", "path", "strfmt.UUID", raw) + } + o.MovingExpenseID = *(value.(*strfmt.UUID)) + + if err := o.validateMovingExpenseID(formats); err != nil { + return err + } + + return nil +} + +// validateMovingExpenseID carries on validations for parameter MovingExpenseID +func (o *UpdateMovingExpenseParams) validateMovingExpenseID(formats strfmt.Registry) error { + + if err := validate.FormatOf("movingExpenseId", "path", "uuid", o.MovingExpenseID.String(), formats); err != nil { + return err + } + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateMovingExpenseParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateMovingExpenseParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go new file mode 100644 index 00000000000..ce0d0c445c6 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateMovingExpenseOKCode is the HTTP code returned for type UpdateMovingExpenseOK +const UpdateMovingExpenseOKCode int = 200 + +/* +UpdateMovingExpenseOK returns an updated moving expense object + +swagger:response updateMovingExpenseOK +*/ +type UpdateMovingExpenseOK struct { + + /* + In: Body + */ + Payload *internalmessages.MovingExpense `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseOK creates UpdateMovingExpenseOK with default headers values +func NewUpdateMovingExpenseOK() *UpdateMovingExpenseOK { + + return &UpdateMovingExpenseOK{} +} + +// WithPayload adds the payload to the update moving expense o k response +func (o *UpdateMovingExpenseOK) WithPayload(payload *internalmessages.MovingExpense) *UpdateMovingExpenseOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense o k response +func (o *UpdateMovingExpenseOK) SetPayload(payload *internalmessages.MovingExpense) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseBadRequestCode is the HTTP code returned for type UpdateMovingExpenseBadRequest +const UpdateMovingExpenseBadRequestCode int = 400 + +/* +UpdateMovingExpenseBadRequest The request payload is invalid. + +swagger:response updateMovingExpenseBadRequest +*/ +type UpdateMovingExpenseBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseBadRequest creates UpdateMovingExpenseBadRequest with default headers values +func NewUpdateMovingExpenseBadRequest() *UpdateMovingExpenseBadRequest { + + return &UpdateMovingExpenseBadRequest{} +} + +// WithPayload adds the payload to the update moving expense bad request response +func (o *UpdateMovingExpenseBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense bad request response +func (o *UpdateMovingExpenseBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseUnauthorizedCode is the HTTP code returned for type UpdateMovingExpenseUnauthorized +const UpdateMovingExpenseUnauthorizedCode int = 401 + +/* +UpdateMovingExpenseUnauthorized The request was denied. + +swagger:response updateMovingExpenseUnauthorized +*/ +type UpdateMovingExpenseUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseUnauthorized creates UpdateMovingExpenseUnauthorized with default headers values +func NewUpdateMovingExpenseUnauthorized() *UpdateMovingExpenseUnauthorized { + + return &UpdateMovingExpenseUnauthorized{} +} + +// WithPayload adds the payload to the update moving expense unauthorized response +func (o *UpdateMovingExpenseUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense unauthorized response +func (o *UpdateMovingExpenseUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseForbiddenCode is the HTTP code returned for type UpdateMovingExpenseForbidden +const UpdateMovingExpenseForbiddenCode int = 403 + +/* +UpdateMovingExpenseForbidden The request was denied. + +swagger:response updateMovingExpenseForbidden +*/ +type UpdateMovingExpenseForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseForbidden creates UpdateMovingExpenseForbidden with default headers values +func NewUpdateMovingExpenseForbidden() *UpdateMovingExpenseForbidden { + + return &UpdateMovingExpenseForbidden{} +} + +// WithPayload adds the payload to the update moving expense forbidden response +func (o *UpdateMovingExpenseForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense forbidden response +func (o *UpdateMovingExpenseForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseNotFoundCode is the HTTP code returned for type UpdateMovingExpenseNotFound +const UpdateMovingExpenseNotFoundCode int = 404 + +/* +UpdateMovingExpenseNotFound The requested resource wasn't found. + +swagger:response updateMovingExpenseNotFound +*/ +type UpdateMovingExpenseNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseNotFound creates UpdateMovingExpenseNotFound with default headers values +func NewUpdateMovingExpenseNotFound() *UpdateMovingExpenseNotFound { + + return &UpdateMovingExpenseNotFound{} +} + +// WithPayload adds the payload to the update moving expense not found response +func (o *UpdateMovingExpenseNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpenseNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense not found response +func (o *UpdateMovingExpenseNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpensePreconditionFailedCode is the HTTP code returned for type UpdateMovingExpensePreconditionFailed +const UpdateMovingExpensePreconditionFailedCode int = 412 + +/* +UpdateMovingExpensePreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMovingExpensePreconditionFailed +*/ +type UpdateMovingExpensePreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMovingExpensePreconditionFailed creates UpdateMovingExpensePreconditionFailed with default headers values +func NewUpdateMovingExpensePreconditionFailed() *UpdateMovingExpensePreconditionFailed { + + return &UpdateMovingExpensePreconditionFailed{} +} + +// WithPayload adds the payload to the update moving expense precondition failed response +func (o *UpdateMovingExpensePreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateMovingExpensePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense precondition failed response +func (o *UpdateMovingExpensePreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpensePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseUnprocessableEntityCode is the HTTP code returned for type UpdateMovingExpenseUnprocessableEntity +const UpdateMovingExpenseUnprocessableEntityCode int = 422 + +/* +UpdateMovingExpenseUnprocessableEntity The payload was unprocessable. + +swagger:response updateMovingExpenseUnprocessableEntity +*/ +type UpdateMovingExpenseUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseUnprocessableEntity creates UpdateMovingExpenseUnprocessableEntity with default headers values +func NewUpdateMovingExpenseUnprocessableEntity() *UpdateMovingExpenseUnprocessableEntity { + + return &UpdateMovingExpenseUnprocessableEntity{} +} + +// WithPayload adds the payload to the update moving expense unprocessable entity response +func (o *UpdateMovingExpenseUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateMovingExpenseUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense unprocessable entity response +func (o *UpdateMovingExpenseUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMovingExpenseInternalServerErrorCode is the HTTP code returned for type UpdateMovingExpenseInternalServerError +const UpdateMovingExpenseInternalServerErrorCode int = 500 + +/* +UpdateMovingExpenseInternalServerError A server error occurred. + +swagger:response updateMovingExpenseInternalServerError +*/ +type UpdateMovingExpenseInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMovingExpenseInternalServerError creates UpdateMovingExpenseInternalServerError with default headers values +func NewUpdateMovingExpenseInternalServerError() *UpdateMovingExpenseInternalServerError { + + return &UpdateMovingExpenseInternalServerError{} +} + +// WithPayload adds the payload to the update moving expense internal server error response +func (o *UpdateMovingExpenseInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateMovingExpenseInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update moving expense internal server error response +func (o *UpdateMovingExpenseInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMovingExpenseInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go new file mode 100644 index 00000000000..b204b455e5f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_moving_expense_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMovingExpenseURL generates an URL for the update moving expense operation +type UpdateMovingExpenseURL struct { + MovingExpenseID strfmt.UUID + PpmShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMovingExpenseURL) WithBasePath(bp string) *UpdateMovingExpenseURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMovingExpenseURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMovingExpenseURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}" + + movingExpenseID := o.MovingExpenseID.String() + if movingExpenseID != "" { + _path = strings.Replace(_path, "{movingExpenseId}", movingExpenseID, -1) + } else { + return nil, errors.New("movingExpenseId is required on UpdateMovingExpenseURL") + } + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateMovingExpenseURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMovingExpenseURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMovingExpenseURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMovingExpenseURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMovingExpenseURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMovingExpenseURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMovingExpenseURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..548bc7605a1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateProGearWeightTicketHandlerFunc turns a function with the right signature into a update pro gear weight ticket handler +type UpdateProGearWeightTicketHandlerFunc func(UpdateProGearWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateProGearWeightTicketHandlerFunc) Handle(params UpdateProGearWeightTicketParams) middleware.Responder { + return fn(params) +} + +// UpdateProGearWeightTicketHandler interface for that can handle valid update pro gear weight ticket params +type UpdateProGearWeightTicketHandler interface { + Handle(UpdateProGearWeightTicketParams) middleware.Responder +} + +// NewUpdateProGearWeightTicket creates a new http.Handler for the update pro gear weight ticket operation +func NewUpdateProGearWeightTicket(ctx *middleware.Context, handler UpdateProGearWeightTicketHandler) *UpdateProGearWeightTicket { + return &UpdateProGearWeightTicket{Context: ctx, Handler: handler} +} + +/* + UpdateProGearWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} ppm updateProGearWeightTicket + +# Updates a pro-gear weight ticket + +Updates a PPM shipment's pro-gear weight ticket with new information. Only some of the fields are editable +because some have to be set by the customer, e.g. the description. +*/ +type UpdateProGearWeightTicket struct { + Context *middleware.Context + Handler UpdateProGearWeightTicketHandler +} + +func (o *UpdateProGearWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateProGearWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go new file mode 100644 index 00000000000..f5927cf3783 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateProGearWeightTicketParams creates a new UpdateProGearWeightTicketParams object +// +// There are no default values defined in the spec. +func NewUpdateProGearWeightTicketParams() UpdateProGearWeightTicketParams { + + return UpdateProGearWeightTicketParams{} +} + +// UpdateProGearWeightTicketParams contains all the bound params for the update pro gear weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateProGearWeightTicket +type UpdateProGearWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /*UUID of the pro-gear weight ticket + Required: true + In: path + */ + ProGearWeightTicketID strfmt.UUID + /* + Required: true + In: body + */ + UpdateProGearWeightTicket *internalmessages.UpdateProGearWeightTicket +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateProGearWeightTicketParams() beforehand. +func (o *UpdateProGearWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rProGearWeightTicketID, rhkProGearWeightTicketID, _ := route.Params.GetOK("proGearWeightTicketId") + if err := o.bindProGearWeightTicketID(rProGearWeightTicketID, rhkProGearWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateProGearWeightTicket + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) + } else { + res = append(res, errors.NewParseError("updateProGearWeightTicket", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateProGearWeightTicket = &body + } + } + } else { + res = append(res, errors.Required("updateProGearWeightTicket", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateProGearWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateProGearWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateProGearWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindProGearWeightTicketID binds and validates parameter ProGearWeightTicketID from path. +func (o *UpdateProGearWeightTicketParams) bindProGearWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("proGearWeightTicketId", "path", "strfmt.UUID", raw) + } + o.ProGearWeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateProGearWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateProGearWeightTicketID carries on validations for parameter ProGearWeightTicketID +func (o *UpdateProGearWeightTicketParams) validateProGearWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("proGearWeightTicketId", "path", "uuid", o.ProGearWeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go new file mode 100644 index 00000000000..6c3fe4ddbe8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateProGearWeightTicketOKCode is the HTTP code returned for type UpdateProGearWeightTicketOK +const UpdateProGearWeightTicketOKCode int = 200 + +/* +UpdateProGearWeightTicketOK returns an updated pro-gear weight ticket object + +swagger:response updateProGearWeightTicketOK +*/ +type UpdateProGearWeightTicketOK struct { + + /* + In: Body + */ + Payload *internalmessages.ProGearWeightTicket `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketOK creates UpdateProGearWeightTicketOK with default headers values +func NewUpdateProGearWeightTicketOK() *UpdateProGearWeightTicketOK { + + return &UpdateProGearWeightTicketOK{} +} + +// WithPayload adds the payload to the update pro gear weight ticket o k response +func (o *UpdateProGearWeightTicketOK) WithPayload(payload *internalmessages.ProGearWeightTicket) *UpdateProGearWeightTicketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket o k response +func (o *UpdateProGearWeightTicketOK) SetPayload(payload *internalmessages.ProGearWeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketBadRequestCode is the HTTP code returned for type UpdateProGearWeightTicketBadRequest +const UpdateProGearWeightTicketBadRequestCode int = 400 + +/* +UpdateProGearWeightTicketBadRequest The request payload is invalid. + +swagger:response updateProGearWeightTicketBadRequest +*/ +type UpdateProGearWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketBadRequest creates UpdateProGearWeightTicketBadRequest with default headers values +func NewUpdateProGearWeightTicketBadRequest() *UpdateProGearWeightTicketBadRequest { + + return &UpdateProGearWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the update pro gear weight ticket bad request response +func (o *UpdateProGearWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket bad request response +func (o *UpdateProGearWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateProGearWeightTicketUnauthorized +const UpdateProGearWeightTicketUnauthorizedCode int = 401 + +/* +UpdateProGearWeightTicketUnauthorized The request was denied. + +swagger:response updateProGearWeightTicketUnauthorized +*/ +type UpdateProGearWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketUnauthorized creates UpdateProGearWeightTicketUnauthorized with default headers values +func NewUpdateProGearWeightTicketUnauthorized() *UpdateProGearWeightTicketUnauthorized { + + return &UpdateProGearWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the update pro gear weight ticket unauthorized response +func (o *UpdateProGearWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket unauthorized response +func (o *UpdateProGearWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketForbiddenCode is the HTTP code returned for type UpdateProGearWeightTicketForbidden +const UpdateProGearWeightTicketForbiddenCode int = 403 + +/* +UpdateProGearWeightTicketForbidden The request was denied. + +swagger:response updateProGearWeightTicketForbidden +*/ +type UpdateProGearWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketForbidden creates UpdateProGearWeightTicketForbidden with default headers values +func NewUpdateProGearWeightTicketForbidden() *UpdateProGearWeightTicketForbidden { + + return &UpdateProGearWeightTicketForbidden{} +} + +// WithPayload adds the payload to the update pro gear weight ticket forbidden response +func (o *UpdateProGearWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket forbidden response +func (o *UpdateProGearWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketNotFoundCode is the HTTP code returned for type UpdateProGearWeightTicketNotFound +const UpdateProGearWeightTicketNotFoundCode int = 404 + +/* +UpdateProGearWeightTicketNotFound The requested resource wasn't found. + +swagger:response updateProGearWeightTicketNotFound +*/ +type UpdateProGearWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketNotFound creates UpdateProGearWeightTicketNotFound with default headers values +func NewUpdateProGearWeightTicketNotFound() *UpdateProGearWeightTicketNotFound { + + return &UpdateProGearWeightTicketNotFound{} +} + +// WithPayload adds the payload to the update pro gear weight ticket not found response +func (o *UpdateProGearWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket not found response +func (o *UpdateProGearWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateProGearWeightTicketPreconditionFailed +const UpdateProGearWeightTicketPreconditionFailedCode int = 412 + +/* +UpdateProGearWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateProGearWeightTicketPreconditionFailed +*/ +type UpdateProGearWeightTicketPreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketPreconditionFailed creates UpdateProGearWeightTicketPreconditionFailed with default headers values +func NewUpdateProGearWeightTicketPreconditionFailed() *UpdateProGearWeightTicketPreconditionFailed { + + return &UpdateProGearWeightTicketPreconditionFailed{} +} + +// WithPayload adds the payload to the update pro gear weight ticket precondition failed response +func (o *UpdateProGearWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateProGearWeightTicketPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket precondition failed response +func (o *UpdateProGearWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateProGearWeightTicketUnprocessableEntity +const UpdateProGearWeightTicketUnprocessableEntityCode int = 422 + +/* +UpdateProGearWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response updateProGearWeightTicketUnprocessableEntity +*/ +type UpdateProGearWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketUnprocessableEntity creates UpdateProGearWeightTicketUnprocessableEntity with default headers values +func NewUpdateProGearWeightTicketUnprocessableEntity() *UpdateProGearWeightTicketUnprocessableEntity { + + return &UpdateProGearWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the update pro gear weight ticket unprocessable entity response +func (o *UpdateProGearWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateProGearWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket unprocessable entity response +func (o *UpdateProGearWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateProGearWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateProGearWeightTicketInternalServerError +const UpdateProGearWeightTicketInternalServerErrorCode int = 500 + +/* +UpdateProGearWeightTicketInternalServerError A server error occurred. + +swagger:response updateProGearWeightTicketInternalServerError +*/ +type UpdateProGearWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewUpdateProGearWeightTicketInternalServerError creates UpdateProGearWeightTicketInternalServerError with default headers values +func NewUpdateProGearWeightTicketInternalServerError() *UpdateProGearWeightTicketInternalServerError { + + return &UpdateProGearWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the update pro gear weight ticket internal server error response +func (o *UpdateProGearWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateProGearWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update pro gear weight ticket internal server error response +func (o *UpdateProGearWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateProGearWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..d11310fb2c5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_pro_gear_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateProGearWeightTicketURL generates an URL for the update pro gear weight ticket operation +type UpdateProGearWeightTicketURL struct { + PpmShipmentID strfmt.UUID + ProGearWeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateProGearWeightTicketURL) WithBasePath(bp string) *UpdateProGearWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateProGearWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateProGearWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateProGearWeightTicketURL") + } + + proGearWeightTicketID := o.ProGearWeightTicketID.String() + if proGearWeightTicketID != "" { + _path = strings.Replace(_path, "{proGearWeightTicketId}", proGearWeightTicketID, -1) + } else { + return nil, errors.New("proGearWeightTicketId is required on UpdateProGearWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateProGearWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateProGearWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateProGearWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateProGearWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateProGearWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateProGearWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go new file mode 100644 index 00000000000..f7cd3b3d30b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateWeightTicketHandlerFunc turns a function with the right signature into a update weight ticket handler +type UpdateWeightTicketHandlerFunc func(UpdateWeightTicketParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateWeightTicketHandlerFunc) Handle(params UpdateWeightTicketParams) middleware.Responder { + return fn(params) +} + +// UpdateWeightTicketHandler interface for that can handle valid update weight ticket params +type UpdateWeightTicketHandler interface { + Handle(UpdateWeightTicketParams) middleware.Responder +} + +// NewUpdateWeightTicket creates a new http.Handler for the update weight ticket operation +func NewUpdateWeightTicket(ctx *middleware.Context, handler UpdateWeightTicketHandler) *UpdateWeightTicket { + return &UpdateWeightTicket{Context: ctx, Handler: handler} +} + +/* + UpdateWeightTicket swagger:route PATCH /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId} ppm updateWeightTicket + +# Updates a weight ticket document + +Updates a weight ticket document with the new information +*/ +type UpdateWeightTicket struct { + Context *middleware.Context + Handler UpdateWeightTicketHandler +} + +func (o *UpdateWeightTicket) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateWeightTicketParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go new file mode 100644 index 00000000000..7600fb72fd4 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewUpdateWeightTicketParams creates a new UpdateWeightTicketParams object +// +// There are no default values defined in the spec. +func NewUpdateWeightTicketParams() UpdateWeightTicketParams { + + return UpdateWeightTicketParams{} +} + +// UpdateWeightTicketParams contains all the bound params for the update weight ticket operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateWeightTicket +type UpdateWeightTicketParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the PPM shipment + Required: true + In: path + */ + PpmShipmentID strfmt.UUID + /* + Required: true + In: body + */ + UpdateWeightTicketPayload *internalmessages.UpdateWeightTicket + /*UUID of the weight ticket + Required: true + In: path + */ + WeightTicketID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateWeightTicketParams() beforehand. +func (o *UpdateWeightTicketParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rPpmShipmentID, rhkPpmShipmentID, _ := route.Params.GetOK("ppmShipmentId") + if err := o.bindPpmShipmentID(rPpmShipmentID, rhkPpmShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.UpdateWeightTicket + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("updateWeightTicketPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.UpdateWeightTicketPayload = &body + } + } + } else { + res = append(res, errors.Required("updateWeightTicketPayload", "body", "")) + } + + rWeightTicketID, rhkWeightTicketID, _ := route.Params.GetOK("weightTicketId") + if err := o.bindWeightTicketID(rWeightTicketID, rhkWeightTicketID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateWeightTicketParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPpmShipmentID binds and validates parameter PpmShipmentID from path. +func (o *UpdateWeightTicketParams) bindPpmShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmShipmentId", "path", "strfmt.UUID", raw) + } + o.PpmShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validatePpmShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmShipmentID carries on validations for parameter PpmShipmentID +func (o *UpdateWeightTicketParams) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmShipmentId", "path", "uuid", o.PpmShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindWeightTicketID binds and validates parameter WeightTicketID from path. +func (o *UpdateWeightTicketParams) bindWeightTicketID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("weightTicketId", "path", "strfmt.UUID", raw) + } + o.WeightTicketID = *(value.(*strfmt.UUID)) + + if err := o.validateWeightTicketID(formats); err != nil { + return err + } + + return nil +} + +// validateWeightTicketID carries on validations for parameter WeightTicketID +func (o *UpdateWeightTicketParams) validateWeightTicketID(formats strfmt.Registry) error { + + if err := validate.FormatOf("weightTicketId", "path", "uuid", o.WeightTicketID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go new file mode 100644 index 00000000000..f4f8e859fae --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// UpdateWeightTicketOKCode is the HTTP code returned for type UpdateWeightTicketOK +const UpdateWeightTicketOKCode int = 200 + +/* +UpdateWeightTicketOK returns an updated weight ticket object + +swagger:response updateWeightTicketOK +*/ +type UpdateWeightTicketOK struct { + + /* + In: Body + */ + Payload *internalmessages.WeightTicket `json:"body,omitempty"` +} + +// NewUpdateWeightTicketOK creates UpdateWeightTicketOK with default headers values +func NewUpdateWeightTicketOK() *UpdateWeightTicketOK { + + return &UpdateWeightTicketOK{} +} + +// WithPayload adds the payload to the update weight ticket o k response +func (o *UpdateWeightTicketOK) WithPayload(payload *internalmessages.WeightTicket) *UpdateWeightTicketOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket o k response +func (o *UpdateWeightTicketOK) SetPayload(payload *internalmessages.WeightTicket) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketBadRequestCode is the HTTP code returned for type UpdateWeightTicketBadRequest +const UpdateWeightTicketBadRequestCode int = 400 + +/* +UpdateWeightTicketBadRequest The request payload is invalid. + +swagger:response updateWeightTicketBadRequest +*/ +type UpdateWeightTicketBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketBadRequest creates UpdateWeightTicketBadRequest with default headers values +func NewUpdateWeightTicketBadRequest() *UpdateWeightTicketBadRequest { + + return &UpdateWeightTicketBadRequest{} +} + +// WithPayload adds the payload to the update weight ticket bad request response +func (o *UpdateWeightTicketBadRequest) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket bad request response +func (o *UpdateWeightTicketBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketUnauthorizedCode is the HTTP code returned for type UpdateWeightTicketUnauthorized +const UpdateWeightTicketUnauthorizedCode int = 401 + +/* +UpdateWeightTicketUnauthorized The request was denied. + +swagger:response updateWeightTicketUnauthorized +*/ +type UpdateWeightTicketUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketUnauthorized creates UpdateWeightTicketUnauthorized with default headers values +func NewUpdateWeightTicketUnauthorized() *UpdateWeightTicketUnauthorized { + + return &UpdateWeightTicketUnauthorized{} +} + +// WithPayload adds the payload to the update weight ticket unauthorized response +func (o *UpdateWeightTicketUnauthorized) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket unauthorized response +func (o *UpdateWeightTicketUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketForbiddenCode is the HTTP code returned for type UpdateWeightTicketForbidden +const UpdateWeightTicketForbiddenCode int = 403 + +/* +UpdateWeightTicketForbidden The request was denied. + +swagger:response updateWeightTicketForbidden +*/ +type UpdateWeightTicketForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketForbidden creates UpdateWeightTicketForbidden with default headers values +func NewUpdateWeightTicketForbidden() *UpdateWeightTicketForbidden { + + return &UpdateWeightTicketForbidden{} +} + +// WithPayload adds the payload to the update weight ticket forbidden response +func (o *UpdateWeightTicketForbidden) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket forbidden response +func (o *UpdateWeightTicketForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketNotFoundCode is the HTTP code returned for type UpdateWeightTicketNotFound +const UpdateWeightTicketNotFoundCode int = 404 + +/* +UpdateWeightTicketNotFound The requested resource wasn't found. + +swagger:response updateWeightTicketNotFound +*/ +type UpdateWeightTicketNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketNotFound creates UpdateWeightTicketNotFound with default headers values +func NewUpdateWeightTicketNotFound() *UpdateWeightTicketNotFound { + + return &UpdateWeightTicketNotFound{} +} + +// WithPayload adds the payload to the update weight ticket not found response +func (o *UpdateWeightTicketNotFound) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket not found response +func (o *UpdateWeightTicketNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketPreconditionFailedCode is the HTTP code returned for type UpdateWeightTicketPreconditionFailed +const UpdateWeightTicketPreconditionFailedCode int = 412 + +/* +UpdateWeightTicketPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateWeightTicketPreconditionFailed +*/ +type UpdateWeightTicketPreconditionFailed struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketPreconditionFailed creates UpdateWeightTicketPreconditionFailed with default headers values +func NewUpdateWeightTicketPreconditionFailed() *UpdateWeightTicketPreconditionFailed { + + return &UpdateWeightTicketPreconditionFailed{} +} + +// WithPayload adds the payload to the update weight ticket precondition failed response +func (o *UpdateWeightTicketPreconditionFailed) WithPayload(payload *internalmessages.ClientError) *UpdateWeightTicketPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket precondition failed response +func (o *UpdateWeightTicketPreconditionFailed) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketUnprocessableEntityCode is the HTTP code returned for type UpdateWeightTicketUnprocessableEntity +const UpdateWeightTicketUnprocessableEntityCode int = 422 + +/* +UpdateWeightTicketUnprocessableEntity The payload was unprocessable. + +swagger:response updateWeightTicketUnprocessableEntity +*/ +type UpdateWeightTicketUnprocessableEntity struct { + + /* + In: Body + */ + Payload *internalmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateWeightTicketUnprocessableEntity creates UpdateWeightTicketUnprocessableEntity with default headers values +func NewUpdateWeightTicketUnprocessableEntity() *UpdateWeightTicketUnprocessableEntity { + + return &UpdateWeightTicketUnprocessableEntity{} +} + +// WithPayload adds the payload to the update weight ticket unprocessable entity response +func (o *UpdateWeightTicketUnprocessableEntity) WithPayload(payload *internalmessages.ValidationError) *UpdateWeightTicketUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket unprocessable entity response +func (o *UpdateWeightTicketUnprocessableEntity) SetPayload(payload *internalmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateWeightTicketInternalServerErrorCode is the HTTP code returned for type UpdateWeightTicketInternalServerError +const UpdateWeightTicketInternalServerErrorCode int = 500 + +/* +UpdateWeightTicketInternalServerError A server error occurred. + +swagger:response updateWeightTicketInternalServerError +*/ +type UpdateWeightTicketInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewUpdateWeightTicketInternalServerError creates UpdateWeightTicketInternalServerError with default headers values +func NewUpdateWeightTicketInternalServerError() *UpdateWeightTicketInternalServerError { + + return &UpdateWeightTicketInternalServerError{} +} + +// WithPayload adds the payload to the update weight ticket internal server error response +func (o *UpdateWeightTicketInternalServerError) WithPayload(payload *internalmessages.Error) *UpdateWeightTicketInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update weight ticket internal server error response +func (o *UpdateWeightTicketInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateWeightTicketInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go new file mode 100644 index 00000000000..c7798fe5936 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/ppm/update_weight_ticket_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ppm + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateWeightTicketURL generates an URL for the update weight ticket operation +type UpdateWeightTicketURL struct { + PpmShipmentID strfmt.UUID + WeightTicketID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWeightTicketURL) WithBasePath(bp string) *UpdateWeightTicketURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateWeightTicketURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateWeightTicketURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}" + + ppmShipmentID := o.PpmShipmentID.String() + if ppmShipmentID != "" { + _path = strings.Replace(_path, "{ppmShipmentId}", ppmShipmentID, -1) + } else { + return nil, errors.New("ppmShipmentId is required on UpdateWeightTicketURL") + } + + weightTicketID := o.WeightTicketID.String() + if weightTicketID != "" { + _path = strings.Replace(_path, "{weightTicketId}", weightTicketID, -1) + } else { + return nil, errors.New("weightTicketId is required on UpdateWeightTicketURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateWeightTicketURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateWeightTicketURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateWeightTicketURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateWeightTicketURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateWeightTicketURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateWeightTicketURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue.go b/pkg/gen/internalapi/internaloperations/queues/show_queue.go new file mode 100644 index 00000000000..6ab35bab19e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/queues/show_queue.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowQueueHandlerFunc turns a function with the right signature into a show queue handler +type ShowQueueHandlerFunc func(ShowQueueParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowQueueHandlerFunc) Handle(params ShowQueueParams) middleware.Responder { + return fn(params) +} + +// ShowQueueHandler interface for that can handle valid show queue params +type ShowQueueHandler interface { + Handle(ShowQueueParams) middleware.Responder +} + +// NewShowQueue creates a new http.Handler for the show queue operation +func NewShowQueue(ctx *middleware.Context, handler ShowQueueHandler) *ShowQueue { + return &ShowQueue{Context: ctx, Handler: handler} +} + +/* + ShowQueue swagger:route GET /queues/{queueType} queues showQueue + +# Show all moves in a queue + +Show all moves in a queue +*/ +type ShowQueue struct { + Context *middleware.Context + Handler ShowQueueHandler +} + +func (o *ShowQueue) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowQueueParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go new file mode 100644 index 00000000000..7c572657f80 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/queues/show_queue_parameters.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowQueueParams creates a new ShowQueueParams object +// +// There are no default values defined in the spec. +func NewShowQueueParams() ShowQueueParams { + + return ShowQueueParams{} +} + +// ShowQueueParams contains all the bound params for the show queue operation +// typically these are obtained from a http.Request +// +// swagger:parameters showQueue +type ShowQueueParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Queue type to show + Required: true + In: path + */ + QueueType string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowQueueParams() beforehand. +func (o *ShowQueueParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rQueueType, rhkQueueType, _ := route.Params.GetOK("queueType") + if err := o.bindQueueType(rQueueType, rhkQueueType, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindQueueType binds and validates parameter QueueType from path. +func (o *ShowQueueParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.QueueType = raw + + if err := o.validateQueueType(formats); err != nil { + return err + } + + return nil +} + +// validateQueueType carries on validations for parameter QueueType +func (o *ShowQueueParams) validateQueueType(formats strfmt.Registry) error { + + if err := validate.EnumCase("queueType", "path", o.QueueType, []interface{}{"new", "ppm_payment_requested", "all", "ppm_approved", "ppm_completed"}, true); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go new file mode 100644 index 00000000000..6c2c16aefa1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/queues/show_queue_responses.go @@ -0,0 +1,162 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowQueueOKCode is the HTTP code returned for type ShowQueueOK +const ShowQueueOKCode int = 200 + +/* +ShowQueueOK list all moves in the specified queue + +swagger:response showQueueOK +*/ +type ShowQueueOK struct { + + /* + In: Body + */ + Payload []*internalmessages.MoveQueueItem `json:"body,omitempty"` +} + +// NewShowQueueOK creates ShowQueueOK with default headers values +func NewShowQueueOK() *ShowQueueOK { + + return &ShowQueueOK{} +} + +// WithPayload adds the payload to the show queue o k response +func (o *ShowQueueOK) WithPayload(payload []*internalmessages.MoveQueueItem) *ShowQueueOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show queue o k response +func (o *ShowQueueOK) SetPayload(payload []*internalmessages.MoveQueueItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowQueueOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = make([]*internalmessages.MoveQueueItem, 0, 50) + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowQueueBadRequestCode is the HTTP code returned for type ShowQueueBadRequest +const ShowQueueBadRequestCode int = 400 + +/* +ShowQueueBadRequest invalid request + +swagger:response showQueueBadRequest +*/ +type ShowQueueBadRequest struct { +} + +// NewShowQueueBadRequest creates ShowQueueBadRequest with default headers values +func NewShowQueueBadRequest() *ShowQueueBadRequest { + + return &ShowQueueBadRequest{} +} + +// WriteResponse to the client +func (o *ShowQueueBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowQueueUnauthorizedCode is the HTTP code returned for type ShowQueueUnauthorized +const ShowQueueUnauthorizedCode int = 401 + +/* +ShowQueueUnauthorized request requires user authentication + +swagger:response showQueueUnauthorized +*/ +type ShowQueueUnauthorized struct { +} + +// NewShowQueueUnauthorized creates ShowQueueUnauthorized with default headers values +func NewShowQueueUnauthorized() *ShowQueueUnauthorized { + + return &ShowQueueUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowQueueUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowQueueForbiddenCode is the HTTP code returned for type ShowQueueForbidden +const ShowQueueForbiddenCode int = 403 + +/* +ShowQueueForbidden user is not authorized to access this queue + +swagger:response showQueueForbidden +*/ +type ShowQueueForbidden struct { +} + +// NewShowQueueForbidden creates ShowQueueForbidden with default headers values +func NewShowQueueForbidden() *ShowQueueForbidden { + + return &ShowQueueForbidden{} +} + +// WriteResponse to the client +func (o *ShowQueueForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowQueueNotFoundCode is the HTTP code returned for type ShowQueueNotFound +const ShowQueueNotFoundCode int = 404 + +/* +ShowQueueNotFound move queue item is not found + +swagger:response showQueueNotFound +*/ +type ShowQueueNotFound struct { +} + +// NewShowQueueNotFound creates ShowQueueNotFound with default headers values +func NewShowQueueNotFound() *ShowQueueNotFound { + + return &ShowQueueNotFound{} +} + +// WriteResponse to the client +func (o *ShowQueueNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} diff --git a/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go b/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go new file mode 100644 index 00000000000..b54100fe254 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/queues/show_queue_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package queues + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// ShowQueueURL generates an URL for the show queue operation +type ShowQueueURL struct { + QueueType string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowQueueURL) WithBasePath(bp string) *ShowQueueURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowQueueURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowQueueURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/queues/{queueType}" + + queueType := o.QueueType + if queueType != "" { + _path = strings.Replace(_path, "{queueType}", queueType, -1) + } else { + return nil, errors.New("queueType is required on ShowQueueURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowQueueURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowQueueURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowQueueURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowQueueURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowQueueURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowQueueURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go new file mode 100644 index 00000000000..f6647f71943 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/create_service_member.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateServiceMemberHandlerFunc turns a function with the right signature into a create service member handler +type CreateServiceMemberHandlerFunc func(CreateServiceMemberParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateServiceMemberHandlerFunc) Handle(params CreateServiceMemberParams) middleware.Responder { + return fn(params) +} + +// CreateServiceMemberHandler interface for that can handle valid create service member params +type CreateServiceMemberHandler interface { + Handle(CreateServiceMemberParams) middleware.Responder +} + +// NewCreateServiceMember creates a new http.Handler for the create service member operation +func NewCreateServiceMember(ctx *middleware.Context, handler CreateServiceMemberHandler) *CreateServiceMember { + return &CreateServiceMember{Context: ctx, Handler: handler} +} + +/* + CreateServiceMember swagger:route POST /service_members service_members createServiceMember + +# Creates service member for a logged-in user + +Creates an instance of a service member tied to a user +*/ +type CreateServiceMember struct { + Context *middleware.Context + Handler CreateServiceMemberHandler +} + +func (o *CreateServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateServiceMemberParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go new file mode 100644 index 00000000000..7c4e2d774cf --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewCreateServiceMemberParams creates a new CreateServiceMemberParams object +// +// There are no default values defined in the spec. +func NewCreateServiceMemberParams() CreateServiceMemberParams { + + return CreateServiceMemberParams{} +} + +// CreateServiceMemberParams contains all the bound params for the create service member operation +// typically these are obtained from a http.Request +// +// swagger:parameters createServiceMember +type CreateServiceMemberParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + CreateServiceMemberPayload *internalmessages.CreateServiceMemberPayload +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateServiceMemberParams() beforehand. +func (o *CreateServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.CreateServiceMemberPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("createServiceMemberPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("createServiceMemberPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.CreateServiceMemberPayload = &body + } + } + } else { + res = append(res, errors.Required("createServiceMemberPayload", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go new file mode 100644 index 00000000000..da5e7cadda2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateServiceMemberCreatedCode is the HTTP code returned for type CreateServiceMemberCreated +const CreateServiceMemberCreatedCode int = 201 + +/* +CreateServiceMemberCreated created instance of service member + +swagger:response createServiceMemberCreated +*/ +type CreateServiceMemberCreated struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` +} + +// NewCreateServiceMemberCreated creates CreateServiceMemberCreated with default headers values +func NewCreateServiceMemberCreated() *CreateServiceMemberCreated { + + return &CreateServiceMemberCreated{} +} + +// WithPayload adds the payload to the create service member created response +func (o *CreateServiceMemberCreated) WithPayload(payload *internalmessages.ServiceMemberPayload) *CreateServiceMemberCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service member created response +func (o *CreateServiceMemberCreated) SetPayload(payload *internalmessages.ServiceMemberPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceMemberCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceMemberBadRequestCode is the HTTP code returned for type CreateServiceMemberBadRequest +const CreateServiceMemberBadRequestCode int = 400 + +/* +CreateServiceMemberBadRequest invalid request + +swagger:response createServiceMemberBadRequest +*/ +type CreateServiceMemberBadRequest struct { +} + +// NewCreateServiceMemberBadRequest creates CreateServiceMemberBadRequest with default headers values +func NewCreateServiceMemberBadRequest() *CreateServiceMemberBadRequest { + + return &CreateServiceMemberBadRequest{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// CreateServiceMemberUnauthorizedCode is the HTTP code returned for type CreateServiceMemberUnauthorized +const CreateServiceMemberUnauthorizedCode int = 401 + +/* +CreateServiceMemberUnauthorized request requires user authentication + +swagger:response createServiceMemberUnauthorized +*/ +type CreateServiceMemberUnauthorized struct { +} + +// NewCreateServiceMemberUnauthorized creates CreateServiceMemberUnauthorized with default headers values +func NewCreateServiceMemberUnauthorized() *CreateServiceMemberUnauthorized { + + return &CreateServiceMemberUnauthorized{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// CreateServiceMemberForbiddenCode is the HTTP code returned for type CreateServiceMemberForbidden +const CreateServiceMemberForbiddenCode int = 403 + +/* +CreateServiceMemberForbidden user is not authorized + +swagger:response createServiceMemberForbidden +*/ +type CreateServiceMemberForbidden struct { +} + +// NewCreateServiceMemberForbidden creates CreateServiceMemberForbidden with default headers values +func NewCreateServiceMemberForbidden() *CreateServiceMemberForbidden { + + return &CreateServiceMemberForbidden{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateServiceMemberNotFoundCode is the HTTP code returned for type CreateServiceMemberNotFound +const CreateServiceMemberNotFoundCode int = 404 + +/* +CreateServiceMemberNotFound service member not found + +swagger:response createServiceMemberNotFound +*/ +type CreateServiceMemberNotFound struct { +} + +// NewCreateServiceMemberNotFound creates CreateServiceMemberNotFound with default headers values +func NewCreateServiceMemberNotFound() *CreateServiceMemberNotFound { + + return &CreateServiceMemberNotFound{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// CreateServiceMemberInternalServerErrorCode is the HTTP code returned for type CreateServiceMemberInternalServerError +const CreateServiceMemberInternalServerErrorCode int = 500 + +/* +CreateServiceMemberInternalServerError internal server error + +swagger:response createServiceMemberInternalServerError +*/ +type CreateServiceMemberInternalServerError struct { +} + +// NewCreateServiceMemberInternalServerError creates CreateServiceMemberInternalServerError with default headers values +func NewCreateServiceMemberInternalServerError() *CreateServiceMemberInternalServerError { + + return &CreateServiceMemberInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go new file mode 100644 index 00000000000..f30b19fa2e8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/create_service_member_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateServiceMemberURL generates an URL for the create service member operation +type CreateServiceMemberURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceMemberURL) WithBasePath(bp string) *CreateServiceMemberURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceMemberURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateServiceMemberURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateServiceMemberURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateServiceMemberURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateServiceMemberURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateServiceMemberURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateServiceMemberURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go new file mode 100644 index 00000000000..d773795c107 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// PatchServiceMemberHandlerFunc turns a function with the right signature into a patch service member handler +type PatchServiceMemberHandlerFunc func(PatchServiceMemberParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn PatchServiceMemberHandlerFunc) Handle(params PatchServiceMemberParams) middleware.Responder { + return fn(params) +} + +// PatchServiceMemberHandler interface for that can handle valid patch service member params +type PatchServiceMemberHandler interface { + Handle(PatchServiceMemberParams) middleware.Responder +} + +// NewPatchServiceMember creates a new http.Handler for the patch service member operation +func NewPatchServiceMember(ctx *middleware.Context, handler PatchServiceMemberHandler) *PatchServiceMember { + return &PatchServiceMember{Context: ctx, Handler: handler} +} + +/* + PatchServiceMember swagger:route PATCH /service_members/{serviceMemberId} service_members patchServiceMember + +# Patches the service member + +Any fields sent in this request will be set on the service member referenced +*/ +type PatchServiceMember struct { + Context *middleware.Context + Handler PatchServiceMemberHandler +} + +func (o *PatchServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewPatchServiceMemberParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go new file mode 100644 index 00000000000..2a86ba3ea99 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// NewPatchServiceMemberParams creates a new PatchServiceMemberParams object +// +// There are no default values defined in the spec. +func NewPatchServiceMemberParams() PatchServiceMemberParams { + + return PatchServiceMemberParams{} +} + +// PatchServiceMemberParams contains all the bound params for the patch service member operation +// typically these are obtained from a http.Request +// +// swagger:parameters patchServiceMember +type PatchServiceMemberParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + PatchServiceMemberPayload *internalmessages.PatchServiceMemberPayload + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewPatchServiceMemberParams() beforehand. +func (o *PatchServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body internalmessages.PatchServiceMemberPayload + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("patchServiceMemberPayload", "body", "")) + } else { + res = append(res, errors.NewParseError("patchServiceMemberPayload", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.PatchServiceMemberPayload = &body + } + } + } else { + res = append(res, errors.Required("patchServiceMemberPayload", "body", "")) + } + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *PatchServiceMemberParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *PatchServiceMemberParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go new file mode 100644 index 00000000000..7465d40bb07 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// PatchServiceMemberOKCode is the HTTP code returned for type PatchServiceMemberOK +const PatchServiceMemberOKCode int = 200 + +/* +PatchServiceMemberOK updated instance of service member + +swagger:response patchServiceMemberOK +*/ +type PatchServiceMemberOK struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` +} + +// NewPatchServiceMemberOK creates PatchServiceMemberOK with default headers values +func NewPatchServiceMemberOK() *PatchServiceMemberOK { + + return &PatchServiceMemberOK{} +} + +// WithPayload adds the payload to the patch service member o k response +func (o *PatchServiceMemberOK) WithPayload(payload *internalmessages.ServiceMemberPayload) *PatchServiceMemberOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the patch service member o k response +func (o *PatchServiceMemberOK) SetPayload(payload *internalmessages.ServiceMemberPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *PatchServiceMemberOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// PatchServiceMemberBadRequestCode is the HTTP code returned for type PatchServiceMemberBadRequest +const PatchServiceMemberBadRequestCode int = 400 + +/* +PatchServiceMemberBadRequest invalid request + +swagger:response patchServiceMemberBadRequest +*/ +type PatchServiceMemberBadRequest struct { +} + +// NewPatchServiceMemberBadRequest creates PatchServiceMemberBadRequest with default headers values +func NewPatchServiceMemberBadRequest() *PatchServiceMemberBadRequest { + + return &PatchServiceMemberBadRequest{} +} + +// WriteResponse to the client +func (o *PatchServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// PatchServiceMemberUnauthorizedCode is the HTTP code returned for type PatchServiceMemberUnauthorized +const PatchServiceMemberUnauthorizedCode int = 401 + +/* +PatchServiceMemberUnauthorized request requires user authentication + +swagger:response patchServiceMemberUnauthorized +*/ +type PatchServiceMemberUnauthorized struct { +} + +// NewPatchServiceMemberUnauthorized creates PatchServiceMemberUnauthorized with default headers values +func NewPatchServiceMemberUnauthorized() *PatchServiceMemberUnauthorized { + + return &PatchServiceMemberUnauthorized{} +} + +// WriteResponse to the client +func (o *PatchServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// PatchServiceMemberForbiddenCode is the HTTP code returned for type PatchServiceMemberForbidden +const PatchServiceMemberForbiddenCode int = 403 + +/* +PatchServiceMemberForbidden user is not authorized + +swagger:response patchServiceMemberForbidden +*/ +type PatchServiceMemberForbidden struct { +} + +// NewPatchServiceMemberForbidden creates PatchServiceMemberForbidden with default headers values +func NewPatchServiceMemberForbidden() *PatchServiceMemberForbidden { + + return &PatchServiceMemberForbidden{} +} + +// WriteResponse to the client +func (o *PatchServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// PatchServiceMemberNotFoundCode is the HTTP code returned for type PatchServiceMemberNotFound +const PatchServiceMemberNotFoundCode int = 404 + +/* +PatchServiceMemberNotFound service member not found + +swagger:response patchServiceMemberNotFound +*/ +type PatchServiceMemberNotFound struct { +} + +// NewPatchServiceMemberNotFound creates PatchServiceMemberNotFound with default headers values +func NewPatchServiceMemberNotFound() *PatchServiceMemberNotFound { + + return &PatchServiceMemberNotFound{} +} + +// WriteResponse to the client +func (o *PatchServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// PatchServiceMemberInternalServerErrorCode is the HTTP code returned for type PatchServiceMemberInternalServerError +const PatchServiceMemberInternalServerErrorCode int = 500 + +/* +PatchServiceMemberInternalServerError internal server error + +swagger:response patchServiceMemberInternalServerError +*/ +type PatchServiceMemberInternalServerError struct { +} + +// NewPatchServiceMemberInternalServerError creates PatchServiceMemberInternalServerError with default headers values +func NewPatchServiceMemberInternalServerError() *PatchServiceMemberInternalServerError { + + return &PatchServiceMemberInternalServerError{} +} + +// WriteResponse to the client +func (o *PatchServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go new file mode 100644 index 00000000000..d94335f8755 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/patch_service_member_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// PatchServiceMemberURL generates an URL for the patch service member operation +type PatchServiceMemberURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PatchServiceMemberURL) WithBasePath(bp string) *PatchServiceMemberURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *PatchServiceMemberURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *PatchServiceMemberURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members/{serviceMemberId}" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on PatchServiceMemberURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *PatchServiceMemberURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *PatchServiceMemberURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *PatchServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on PatchServiceMemberURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on PatchServiceMemberURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *PatchServiceMemberURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go new file mode 100644 index 00000000000..ce5a9aaaea5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowServiceMemberHandlerFunc turns a function with the right signature into a show service member handler +type ShowServiceMemberHandlerFunc func(ShowServiceMemberParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowServiceMemberHandlerFunc) Handle(params ShowServiceMemberParams) middleware.Responder { + return fn(params) +} + +// ShowServiceMemberHandler interface for that can handle valid show service member params +type ShowServiceMemberHandler interface { + Handle(ShowServiceMemberParams) middleware.Responder +} + +// NewShowServiceMember creates a new http.Handler for the show service member operation +func NewShowServiceMember(ctx *middleware.Context, handler ShowServiceMemberHandler) *ShowServiceMember { + return &ShowServiceMember{Context: ctx, Handler: handler} +} + +/* + ShowServiceMember swagger:route GET /service_members/{serviceMemberId} service_members showServiceMember + +# Returns the given service member + +Returns the given service member +*/ +type ShowServiceMember struct { + Context *middleware.Context + Handler ShowServiceMemberHandler +} + +func (o *ShowServiceMember) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowServiceMemberParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go new file mode 100644 index 00000000000..ee602075921 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowServiceMemberOrdersHandlerFunc turns a function with the right signature into a show service member orders handler +type ShowServiceMemberOrdersHandlerFunc func(ShowServiceMemberOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowServiceMemberOrdersHandlerFunc) Handle(params ShowServiceMemberOrdersParams) middleware.Responder { + return fn(params) +} + +// ShowServiceMemberOrdersHandler interface for that can handle valid show service member orders params +type ShowServiceMemberOrdersHandler interface { + Handle(ShowServiceMemberOrdersParams) middleware.Responder +} + +// NewShowServiceMemberOrders creates a new http.Handler for the show service member orders operation +func NewShowServiceMemberOrders(ctx *middleware.Context, handler ShowServiceMemberOrdersHandler) *ShowServiceMemberOrders { + return &ShowServiceMemberOrders{Context: ctx, Handler: handler} +} + +/* + ShowServiceMemberOrders swagger:route GET /service_members/{serviceMemberId}/current_orders service_members showServiceMemberOrders + +# Returns the latest orders for a given service member + +Returns orders +*/ +type ShowServiceMemberOrders struct { + Context *middleware.Context + Handler ShowServiceMemberOrdersHandler +} + +func (o *ShowServiceMemberOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowServiceMemberOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go new file mode 100644 index 00000000000..327d67bdde7 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowServiceMemberOrdersParams creates a new ShowServiceMemberOrdersParams object +// +// There are no default values defined in the spec. +func NewShowServiceMemberOrdersParams() ShowServiceMemberOrdersParams { + + return ShowServiceMemberOrdersParams{} +} + +// ShowServiceMemberOrdersParams contains all the bound params for the show service member orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters showServiceMemberOrders +type ShowServiceMemberOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowServiceMemberOrdersParams() beforehand. +func (o *ShowServiceMemberOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *ShowServiceMemberOrdersParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *ShowServiceMemberOrdersParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go new file mode 100644 index 00000000000..5d8c5fd5f6d --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowServiceMemberOrdersOKCode is the HTTP code returned for type ShowServiceMemberOrdersOK +const ShowServiceMemberOrdersOKCode int = 200 + +/* +ShowServiceMemberOrdersOK the instance of the service member + +swagger:response showServiceMemberOrdersOK +*/ +type ShowServiceMemberOrdersOK struct { + + /* + In: Body + */ + Payload *internalmessages.Orders `json:"body,omitempty"` +} + +// NewShowServiceMemberOrdersOK creates ShowServiceMemberOrdersOK with default headers values +func NewShowServiceMemberOrdersOK() *ShowServiceMemberOrdersOK { + + return &ShowServiceMemberOrdersOK{} +} + +// WithPayload adds the payload to the show service member orders o k response +func (o *ShowServiceMemberOrdersOK) WithPayload(payload *internalmessages.Orders) *ShowServiceMemberOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show service member orders o k response +func (o *ShowServiceMemberOrdersOK) SetPayload(payload *internalmessages.Orders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowServiceMemberOrdersBadRequestCode is the HTTP code returned for type ShowServiceMemberOrdersBadRequest +const ShowServiceMemberOrdersBadRequestCode int = 400 + +/* +ShowServiceMemberOrdersBadRequest invalid request + +swagger:response showServiceMemberOrdersBadRequest +*/ +type ShowServiceMemberOrdersBadRequest struct { +} + +// NewShowServiceMemberOrdersBadRequest creates ShowServiceMemberOrdersBadRequest with default headers values +func NewShowServiceMemberOrdersBadRequest() *ShowServiceMemberOrdersBadRequest { + + return &ShowServiceMemberOrdersBadRequest{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowServiceMemberOrdersUnauthorizedCode is the HTTP code returned for type ShowServiceMemberOrdersUnauthorized +const ShowServiceMemberOrdersUnauthorizedCode int = 401 + +/* +ShowServiceMemberOrdersUnauthorized request requires user authentication + +swagger:response showServiceMemberOrdersUnauthorized +*/ +type ShowServiceMemberOrdersUnauthorized struct { +} + +// NewShowServiceMemberOrdersUnauthorized creates ShowServiceMemberOrdersUnauthorized with default headers values +func NewShowServiceMemberOrdersUnauthorized() *ShowServiceMemberOrdersUnauthorized { + + return &ShowServiceMemberOrdersUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowServiceMemberOrdersForbiddenCode is the HTTP code returned for type ShowServiceMemberOrdersForbidden +const ShowServiceMemberOrdersForbiddenCode int = 403 + +/* +ShowServiceMemberOrdersForbidden user is not authorized + +swagger:response showServiceMemberOrdersForbidden +*/ +type ShowServiceMemberOrdersForbidden struct { +} + +// NewShowServiceMemberOrdersForbidden creates ShowServiceMemberOrdersForbidden with default headers values +func NewShowServiceMemberOrdersForbidden() *ShowServiceMemberOrdersForbidden { + + return &ShowServiceMemberOrdersForbidden{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowServiceMemberOrdersNotFoundCode is the HTTP code returned for type ShowServiceMemberOrdersNotFound +const ShowServiceMemberOrdersNotFoundCode int = 404 + +/* +ShowServiceMemberOrdersNotFound service member not found + +swagger:response showServiceMemberOrdersNotFound +*/ +type ShowServiceMemberOrdersNotFound struct { +} + +// NewShowServiceMemberOrdersNotFound creates ShowServiceMemberOrdersNotFound with default headers values +func NewShowServiceMemberOrdersNotFound() *ShowServiceMemberOrdersNotFound { + + return &ShowServiceMemberOrdersNotFound{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowServiceMemberOrdersInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberOrdersInternalServerError +const ShowServiceMemberOrdersInternalServerErrorCode int = 500 + +/* +ShowServiceMemberOrdersInternalServerError internal server error + +swagger:response showServiceMemberOrdersInternalServerError +*/ +type ShowServiceMemberOrdersInternalServerError struct { +} + +// NewShowServiceMemberOrdersInternalServerError creates ShowServiceMemberOrdersInternalServerError with default headers values +func NewShowServiceMemberOrdersInternalServerError() *ShowServiceMemberOrdersInternalServerError { + + return &ShowServiceMemberOrdersInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go new file mode 100644 index 00000000000..18cb771b23e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_orders_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowServiceMemberOrdersURL generates an URL for the show service member orders operation +type ShowServiceMemberOrdersURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberOrdersURL) WithBasePath(bp string) *ShowServiceMemberOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowServiceMemberOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members/{serviceMemberId}/current_orders" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on ShowServiceMemberOrdersURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowServiceMemberOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowServiceMemberOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowServiceMemberOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowServiceMemberOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowServiceMemberOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowServiceMemberOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go new file mode 100644 index 00000000000..40f5010e96f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowServiceMemberParams creates a new ShowServiceMemberParams object +// +// There are no default values defined in the spec. +func NewShowServiceMemberParams() ShowServiceMemberParams { + + return ShowServiceMemberParams{} +} + +// ShowServiceMemberParams contains all the bound params for the show service member operation +// typically these are obtained from a http.Request +// +// swagger:parameters showServiceMember +type ShowServiceMemberParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the service member + Required: true + In: path + */ + ServiceMemberID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowServiceMemberParams() beforehand. +func (o *ShowServiceMemberParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *ShowServiceMemberParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *ShowServiceMemberParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go new file mode 100644 index 00000000000..1ce0447b363 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowServiceMemberOKCode is the HTTP code returned for type ShowServiceMemberOK +const ShowServiceMemberOKCode int = 200 + +/* +ShowServiceMemberOK the instance of the service member + +swagger:response showServiceMemberOK +*/ +type ShowServiceMemberOK struct { + + /* + In: Body + */ + Payload *internalmessages.ServiceMemberPayload `json:"body,omitempty"` +} + +// NewShowServiceMemberOK creates ShowServiceMemberOK with default headers values +func NewShowServiceMemberOK() *ShowServiceMemberOK { + + return &ShowServiceMemberOK{} +} + +// WithPayload adds the payload to the show service member o k response +func (o *ShowServiceMemberOK) WithPayload(payload *internalmessages.ServiceMemberPayload) *ShowServiceMemberOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show service member o k response +func (o *ShowServiceMemberOK) SetPayload(payload *internalmessages.ServiceMemberPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowServiceMemberOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowServiceMemberBadRequestCode is the HTTP code returned for type ShowServiceMemberBadRequest +const ShowServiceMemberBadRequestCode int = 400 + +/* +ShowServiceMemberBadRequest invalid request + +swagger:response showServiceMemberBadRequest +*/ +type ShowServiceMemberBadRequest struct { +} + +// NewShowServiceMemberBadRequest creates ShowServiceMemberBadRequest with default headers values +func NewShowServiceMemberBadRequest() *ShowServiceMemberBadRequest { + + return &ShowServiceMemberBadRequest{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowServiceMemberUnauthorizedCode is the HTTP code returned for type ShowServiceMemberUnauthorized +const ShowServiceMemberUnauthorizedCode int = 401 + +/* +ShowServiceMemberUnauthorized request requires user authentication + +swagger:response showServiceMemberUnauthorized +*/ +type ShowServiceMemberUnauthorized struct { +} + +// NewShowServiceMemberUnauthorized creates ShowServiceMemberUnauthorized with default headers values +func NewShowServiceMemberUnauthorized() *ShowServiceMemberUnauthorized { + + return &ShowServiceMemberUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowServiceMemberForbiddenCode is the HTTP code returned for type ShowServiceMemberForbidden +const ShowServiceMemberForbiddenCode int = 403 + +/* +ShowServiceMemberForbidden user is not authorized + +swagger:response showServiceMemberForbidden +*/ +type ShowServiceMemberForbidden struct { +} + +// NewShowServiceMemberForbidden creates ShowServiceMemberForbidden with default headers values +func NewShowServiceMemberForbidden() *ShowServiceMemberForbidden { + + return &ShowServiceMemberForbidden{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowServiceMemberNotFoundCode is the HTTP code returned for type ShowServiceMemberNotFound +const ShowServiceMemberNotFoundCode int = 404 + +/* +ShowServiceMemberNotFound service member not found + +swagger:response showServiceMemberNotFound +*/ +type ShowServiceMemberNotFound struct { +} + +// NewShowServiceMemberNotFound creates ShowServiceMemberNotFound with default headers values +func NewShowServiceMemberNotFound() *ShowServiceMemberNotFound { + + return &ShowServiceMemberNotFound{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowServiceMemberInternalServerErrorCode is the HTTP code returned for type ShowServiceMemberInternalServerError +const ShowServiceMemberInternalServerErrorCode int = 500 + +/* +ShowServiceMemberInternalServerError internal server error + +swagger:response showServiceMemberInternalServerError +*/ +type ShowServiceMemberInternalServerError struct { +} + +// NewShowServiceMemberInternalServerError creates ShowServiceMemberInternalServerError with default headers values +func NewShowServiceMemberInternalServerError() *ShowServiceMemberInternalServerError { + + return &ShowServiceMemberInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowServiceMemberInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go new file mode 100644 index 00000000000..f3c4497009b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/service_members/show_service_member_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package service_members + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowServiceMemberURL generates an URL for the show service member operation +type ShowServiceMemberURL struct { + ServiceMemberID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberURL) WithBasePath(bp string) *ShowServiceMemberURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowServiceMemberURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowServiceMemberURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/service_members/{serviceMemberId}" + + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on ShowServiceMemberURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowServiceMemberURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowServiceMemberURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowServiceMemberURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowServiceMemberURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowServiceMemberURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowServiceMemberURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go new file mode 100644 index 00000000000..9be75cd30e8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetTransportationOfficesHandlerFunc turns a function with the right signature into a get transportation offices handler +type GetTransportationOfficesHandlerFunc func(GetTransportationOfficesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetTransportationOfficesHandlerFunc) Handle(params GetTransportationOfficesParams) middleware.Responder { + return fn(params) +} + +// GetTransportationOfficesHandler interface for that can handle valid get transportation offices params +type GetTransportationOfficesHandler interface { + Handle(GetTransportationOfficesParams) middleware.Responder +} + +// NewGetTransportationOffices creates a new http.Handler for the get transportation offices operation +func NewGetTransportationOffices(ctx *middleware.Context, handler GetTransportationOfficesHandler) *GetTransportationOffices { + return &GetTransportationOffices{Context: ctx, Handler: handler} +} + +/* + GetTransportationOffices swagger:route GET /transportation-offices transportation_offices getTransportationOffices + +# Returns the transportation offices matching the search query + +Returns the transportation offices matching the search query +*/ +type GetTransportationOffices struct { + Context *middleware.Context + Handler GetTransportationOfficesHandler +} + +func (o *GetTransportationOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetTransportationOfficesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go new file mode 100644 index 00000000000..8aa41957284 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_parameters.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetTransportationOfficesParams creates a new GetTransportationOfficesParams object +// +// There are no default values defined in the spec. +func NewGetTransportationOfficesParams() GetTransportationOfficesParams { + + return GetTransportationOfficesParams{} +} + +// GetTransportationOfficesParams contains all the bound params for the get transportation offices operation +// typically these are obtained from a http.Request +// +// swagger:parameters getTransportationOffices +type GetTransportationOfficesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Search string for transportation offices + Required: true + Min Length: 2 + In: query + */ + Search string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetTransportationOfficesParams() beforehand. +func (o *GetTransportationOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSearch, qhkSearch, _ := qs.GetOK("search") + if err := o.bindSearch(qSearch, qhkSearch, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSearch binds and validates parameter Search from query. +func (o *GetTransportationOfficesParams) bindSearch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("search", "query", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // AllowEmptyValue: false + + if err := validate.RequiredString("search", "query", raw); err != nil { + return err + } + o.Search = raw + + if err := o.validateSearch(formats); err != nil { + return err + } + + return nil +} + +// validateSearch carries on validations for parameter Search +func (o *GetTransportationOfficesParams) validateSearch(formats strfmt.Registry) error { + + if err := validate.MinLength("search", "query", o.Search, 2); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go new file mode 100644 index 00000000000..63c2e5975ca --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// GetTransportationOfficesOKCode is the HTTP code returned for type GetTransportationOfficesOK +const GetTransportationOfficesOKCode int = 200 + +/* +GetTransportationOfficesOK Successfully retrieved transportation offices + +swagger:response getTransportationOfficesOK +*/ +type GetTransportationOfficesOK struct { + + /* + In: Body + */ + Payload internalmessages.TransportationOffices `json:"body,omitempty"` +} + +// NewGetTransportationOfficesOK creates GetTransportationOfficesOK with default headers values +func NewGetTransportationOfficesOK() *GetTransportationOfficesOK { + + return &GetTransportationOfficesOK{} +} + +// WithPayload adds the payload to the get transportation offices o k response +func (o *GetTransportationOfficesOK) WithPayload(payload internalmessages.TransportationOffices) *GetTransportationOfficesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices o k response +func (o *GetTransportationOfficesOK) SetPayload(payload internalmessages.TransportationOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.TransportationOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// GetTransportationOfficesBadRequestCode is the HTTP code returned for type GetTransportationOfficesBadRequest +const GetTransportationOfficesBadRequestCode int = 400 + +/* +GetTransportationOfficesBadRequest The request payload is invalid. + +swagger:response getTransportationOfficesBadRequest +*/ +type GetTransportationOfficesBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetTransportationOfficesBadRequest creates GetTransportationOfficesBadRequest with default headers values +func NewGetTransportationOfficesBadRequest() *GetTransportationOfficesBadRequest { + + return &GetTransportationOfficesBadRequest{} +} + +// WithPayload adds the payload to the get transportation offices bad request response +func (o *GetTransportationOfficesBadRequest) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices bad request response +func (o *GetTransportationOfficesBadRequest) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesUnauthorizedCode is the HTTP code returned for type GetTransportationOfficesUnauthorized +const GetTransportationOfficesUnauthorizedCode int = 401 + +/* +GetTransportationOfficesUnauthorized The request was denied. + +swagger:response getTransportationOfficesUnauthorized +*/ +type GetTransportationOfficesUnauthorized struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetTransportationOfficesUnauthorized creates GetTransportationOfficesUnauthorized with default headers values +func NewGetTransportationOfficesUnauthorized() *GetTransportationOfficesUnauthorized { + + return &GetTransportationOfficesUnauthorized{} +} + +// WithPayload adds the payload to the get transportation offices unauthorized response +func (o *GetTransportationOfficesUnauthorized) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices unauthorized response +func (o *GetTransportationOfficesUnauthorized) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesForbiddenCode is the HTTP code returned for type GetTransportationOfficesForbidden +const GetTransportationOfficesForbiddenCode int = 403 + +/* +GetTransportationOfficesForbidden The request was denied. + +swagger:response getTransportationOfficesForbidden +*/ +type GetTransportationOfficesForbidden struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetTransportationOfficesForbidden creates GetTransportationOfficesForbidden with default headers values +func NewGetTransportationOfficesForbidden() *GetTransportationOfficesForbidden { + + return &GetTransportationOfficesForbidden{} +} + +// WithPayload adds the payload to the get transportation offices forbidden response +func (o *GetTransportationOfficesForbidden) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices forbidden response +func (o *GetTransportationOfficesForbidden) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesNotFoundCode is the HTTP code returned for type GetTransportationOfficesNotFound +const GetTransportationOfficesNotFoundCode int = 404 + +/* +GetTransportationOfficesNotFound The requested resource wasn't found. + +swagger:response getTransportationOfficesNotFound +*/ +type GetTransportationOfficesNotFound struct { + + /* + In: Body + */ + Payload *internalmessages.ClientError `json:"body,omitempty"` +} + +// NewGetTransportationOfficesNotFound creates GetTransportationOfficesNotFound with default headers values +func NewGetTransportationOfficesNotFound() *GetTransportationOfficesNotFound { + + return &GetTransportationOfficesNotFound{} +} + +// WithPayload adds the payload to the get transportation offices not found response +func (o *GetTransportationOfficesNotFound) WithPayload(payload *internalmessages.ClientError) *GetTransportationOfficesNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices not found response +func (o *GetTransportationOfficesNotFound) SetPayload(payload *internalmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetTransportationOfficesInternalServerErrorCode is the HTTP code returned for type GetTransportationOfficesInternalServerError +const GetTransportationOfficesInternalServerErrorCode int = 500 + +/* +GetTransportationOfficesInternalServerError A server error occurred. + +swagger:response getTransportationOfficesInternalServerError +*/ +type GetTransportationOfficesInternalServerError struct { + + /* + In: Body + */ + Payload *internalmessages.Error `json:"body,omitempty"` +} + +// NewGetTransportationOfficesInternalServerError creates GetTransportationOfficesInternalServerError with default headers values +func NewGetTransportationOfficesInternalServerError() *GetTransportationOfficesInternalServerError { + + return &GetTransportationOfficesInternalServerError{} +} + +// WithPayload adds the payload to the get transportation offices internal server error response +func (o *GetTransportationOfficesInternalServerError) WithPayload(payload *internalmessages.Error) *GetTransportationOfficesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get transportation offices internal server error response +func (o *GetTransportationOfficesInternalServerError) SetPayload(payload *internalmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetTransportationOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go new file mode 100644 index 00000000000..5a8df3af992 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/get_transportation_offices_urlbuilder.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// GetTransportationOfficesURL generates an URL for the get transportation offices operation +type GetTransportationOfficesURL struct { + Search string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesURL) WithBasePath(bp string) *GetTransportationOfficesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetTransportationOfficesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetTransportationOfficesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/transportation-offices" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + searchQ := o.Search + if searchQ != "" { + qs.Set("search", searchQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetTransportationOfficesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetTransportationOfficesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetTransportationOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetTransportationOfficesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetTransportationOfficesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetTransportationOfficesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go new file mode 100644 index 00000000000..c82df5e3af2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowCounselingOfficesHandlerFunc turns a function with the right signature into a show counseling offices handler +type ShowCounselingOfficesHandlerFunc func(ShowCounselingOfficesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowCounselingOfficesHandlerFunc) Handle(params ShowCounselingOfficesParams) middleware.Responder { + return fn(params) +} + +// ShowCounselingOfficesHandler interface for that can handle valid show counseling offices params +type ShowCounselingOfficesHandler interface { + Handle(ShowCounselingOfficesParams) middleware.Responder +} + +// NewShowCounselingOffices creates a new http.Handler for the show counseling offices operation +func NewShowCounselingOffices(ctx *middleware.Context, handler ShowCounselingOfficesHandler) *ShowCounselingOffices { + return &ShowCounselingOffices{Context: ctx, Handler: handler} +} + +/* + ShowCounselingOffices swagger:route GET /transportation_offices/{dutyLocationId}/counseling_offices transportation_offices showCounselingOffices + +# Returns the counseling locations in the GBLOC matching the duty location + +Returns the counseling locations matching the GBLOC from the selected duty location +*/ +type ShowCounselingOffices struct { + Context *middleware.Context + Handler ShowCounselingOfficesHandler +} + +func (o *ShowCounselingOffices) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowCounselingOfficesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go new file mode 100644 index 00000000000..18917f8c812 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowCounselingOfficesParams creates a new ShowCounselingOfficesParams object +// +// There are no default values defined in the spec. +func NewShowCounselingOfficesParams() ShowCounselingOfficesParams { + + return ShowCounselingOfficesParams{} +} + +// ShowCounselingOfficesParams contains all the bound params for the show counseling offices operation +// typically these are obtained from a http.Request +// +// swagger:parameters showCounselingOffices +type ShowCounselingOfficesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the duty location + Required: true + In: path + */ + DutyLocationID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowCounselingOfficesParams() beforehand. +func (o *ShowCounselingOfficesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDutyLocationID, rhkDutyLocationID, _ := route.Params.GetOK("dutyLocationId") + if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDutyLocationID binds and validates parameter DutyLocationID from path. +func (o *ShowCounselingOfficesParams) bindDutyLocationID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("dutyLocationId", "path", "strfmt.UUID", raw) + } + o.DutyLocationID = *(value.(*strfmt.UUID)) + + if err := o.validateDutyLocationID(formats); err != nil { + return err + } + + return nil +} + +// validateDutyLocationID carries on validations for parameter DutyLocationID +func (o *ShowCounselingOfficesParams) validateDutyLocationID(formats strfmt.Registry) error { + + if err := validate.FormatOf("dutyLocationId", "path", "uuid", o.DutyLocationID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go new file mode 100644 index 00000000000..dd5b23288dc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_responses.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowCounselingOfficesOKCode is the HTTP code returned for type ShowCounselingOfficesOK +const ShowCounselingOfficesOKCode int = 200 + +/* +ShowCounselingOfficesOK the instance of the counseling office for a duty location + +swagger:response showCounselingOfficesOK +*/ +type ShowCounselingOfficesOK struct { + + /* + In: Body + */ + Payload internalmessages.CounselingOffices `json:"body,omitempty"` +} + +// NewShowCounselingOfficesOK creates ShowCounselingOfficesOK with default headers values +func NewShowCounselingOfficesOK() *ShowCounselingOfficesOK { + + return &ShowCounselingOfficesOK{} +} + +// WithPayload adds the payload to the show counseling offices o k response +func (o *ShowCounselingOfficesOK) WithPayload(payload internalmessages.CounselingOffices) *ShowCounselingOfficesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show counseling offices o k response +func (o *ShowCounselingOfficesOK) SetPayload(payload internalmessages.CounselingOffices) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = internalmessages.CounselingOffices{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ShowCounselingOfficesInternalServerErrorCode is the HTTP code returned for type ShowCounselingOfficesInternalServerError +const ShowCounselingOfficesInternalServerErrorCode int = 500 + +/* +ShowCounselingOfficesInternalServerError internal server error + +swagger:response showCounselingOfficesInternalServerError +*/ +type ShowCounselingOfficesInternalServerError struct { +} + +// NewShowCounselingOfficesInternalServerError creates ShowCounselingOfficesInternalServerError with default headers values +func NewShowCounselingOfficesInternalServerError() *ShowCounselingOfficesInternalServerError { + + return &ShowCounselingOfficesInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go new file mode 100644 index 00000000000..21122fe0b53 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_counseling_offices_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowCounselingOfficesURL generates an URL for the show counseling offices operation +type ShowCounselingOfficesURL struct { + DutyLocationID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowCounselingOfficesURL) WithBasePath(bp string) *ShowCounselingOfficesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowCounselingOfficesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowCounselingOfficesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/transportation_offices/{dutyLocationId}/counseling_offices" + + dutyLocationID := o.DutyLocationID.String() + if dutyLocationID != "" { + _path = strings.Replace(_path, "{dutyLocationId}", dutyLocationID, -1) + } else { + return nil, errors.New("dutyLocationId is required on ShowCounselingOfficesURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowCounselingOfficesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowCounselingOfficesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowCounselingOfficesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowCounselingOfficesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowCounselingOfficesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowCounselingOfficesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go new file mode 100644 index 00000000000..c2195cbbe69 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowDutyLocationTransportationOfficeHandlerFunc turns a function with the right signature into a show duty location transportation office handler +type ShowDutyLocationTransportationOfficeHandlerFunc func(ShowDutyLocationTransportationOfficeParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowDutyLocationTransportationOfficeHandlerFunc) Handle(params ShowDutyLocationTransportationOfficeParams) middleware.Responder { + return fn(params) +} + +// ShowDutyLocationTransportationOfficeHandler interface for that can handle valid show duty location transportation office params +type ShowDutyLocationTransportationOfficeHandler interface { + Handle(ShowDutyLocationTransportationOfficeParams) middleware.Responder +} + +// NewShowDutyLocationTransportationOffice creates a new http.Handler for the show duty location transportation office operation +func NewShowDutyLocationTransportationOffice(ctx *middleware.Context, handler ShowDutyLocationTransportationOfficeHandler) *ShowDutyLocationTransportationOffice { + return &ShowDutyLocationTransportationOffice{Context: ctx, Handler: handler} +} + +/* + ShowDutyLocationTransportationOffice swagger:route GET /duty_locations/{dutyLocationId}/transportation_office transportation_offices showDutyLocationTransportationOffice + +# Returns the transportation office for a given duty location + +Returns the given duty location's transportation office +*/ +type ShowDutyLocationTransportationOffice struct { + Context *middleware.Context + Handler ShowDutyLocationTransportationOfficeHandler +} + +func (o *ShowDutyLocationTransportationOffice) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowDutyLocationTransportationOfficeParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go new file mode 100644 index 00000000000..cebbc8f51b1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewShowDutyLocationTransportationOfficeParams creates a new ShowDutyLocationTransportationOfficeParams object +// +// There are no default values defined in the spec. +func NewShowDutyLocationTransportationOfficeParams() ShowDutyLocationTransportationOfficeParams { + + return ShowDutyLocationTransportationOfficeParams{} +} + +// ShowDutyLocationTransportationOfficeParams contains all the bound params for the show duty location transportation office operation +// typically these are obtained from a http.Request +// +// swagger:parameters showDutyLocationTransportationOffice +type ShowDutyLocationTransportationOfficeParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the duty location + Required: true + In: path + */ + DutyLocationID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowDutyLocationTransportationOfficeParams() beforehand. +func (o *ShowDutyLocationTransportationOfficeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rDutyLocationID, rhkDutyLocationID, _ := route.Params.GetOK("dutyLocationId") + if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDutyLocationID binds and validates parameter DutyLocationID from path. +func (o *ShowDutyLocationTransportationOfficeParams) bindDutyLocationID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("dutyLocationId", "path", "strfmt.UUID", raw) + } + o.DutyLocationID = *(value.(*strfmt.UUID)) + + if err := o.validateDutyLocationID(formats); err != nil { + return err + } + + return nil +} + +// validateDutyLocationID carries on validations for parameter DutyLocationID +func (o *ShowDutyLocationTransportationOfficeParams) validateDutyLocationID(formats strfmt.Registry) error { + + if err := validate.FormatOf("dutyLocationId", "path", "uuid", o.DutyLocationID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go new file mode 100644 index 00000000000..eac97450bc5 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_responses.go @@ -0,0 +1,184 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowDutyLocationTransportationOfficeOKCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeOK +const ShowDutyLocationTransportationOfficeOKCode int = 200 + +/* +ShowDutyLocationTransportationOfficeOK the instance of the transportation office for a duty location + +swagger:response showDutyLocationTransportationOfficeOK +*/ +type ShowDutyLocationTransportationOfficeOK struct { + + /* + In: Body + */ + Payload *internalmessages.TransportationOffice `json:"body,omitempty"` +} + +// NewShowDutyLocationTransportationOfficeOK creates ShowDutyLocationTransportationOfficeOK with default headers values +func NewShowDutyLocationTransportationOfficeOK() *ShowDutyLocationTransportationOfficeOK { + + return &ShowDutyLocationTransportationOfficeOK{} +} + +// WithPayload adds the payload to the show duty location transportation office o k response +func (o *ShowDutyLocationTransportationOfficeOK) WithPayload(payload *internalmessages.TransportationOffice) *ShowDutyLocationTransportationOfficeOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show duty location transportation office o k response +func (o *ShowDutyLocationTransportationOfficeOK) SetPayload(payload *internalmessages.TransportationOffice) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowDutyLocationTransportationOfficeBadRequestCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeBadRequest +const ShowDutyLocationTransportationOfficeBadRequestCode int = 400 + +/* +ShowDutyLocationTransportationOfficeBadRequest invalid request + +swagger:response showDutyLocationTransportationOfficeBadRequest +*/ +type ShowDutyLocationTransportationOfficeBadRequest struct { +} + +// NewShowDutyLocationTransportationOfficeBadRequest creates ShowDutyLocationTransportationOfficeBadRequest with default headers values +func NewShowDutyLocationTransportationOfficeBadRequest() *ShowDutyLocationTransportationOfficeBadRequest { + + return &ShowDutyLocationTransportationOfficeBadRequest{} +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowDutyLocationTransportationOfficeUnauthorizedCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeUnauthorized +const ShowDutyLocationTransportationOfficeUnauthorizedCode int = 401 + +/* +ShowDutyLocationTransportationOfficeUnauthorized request requires user authentication + +swagger:response showDutyLocationTransportationOfficeUnauthorized +*/ +type ShowDutyLocationTransportationOfficeUnauthorized struct { +} + +// NewShowDutyLocationTransportationOfficeUnauthorized creates ShowDutyLocationTransportationOfficeUnauthorized with default headers values +func NewShowDutyLocationTransportationOfficeUnauthorized() *ShowDutyLocationTransportationOfficeUnauthorized { + + return &ShowDutyLocationTransportationOfficeUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowDutyLocationTransportationOfficeForbiddenCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeForbidden +const ShowDutyLocationTransportationOfficeForbiddenCode int = 403 + +/* +ShowDutyLocationTransportationOfficeForbidden user is not authorized + +swagger:response showDutyLocationTransportationOfficeForbidden +*/ +type ShowDutyLocationTransportationOfficeForbidden struct { +} + +// NewShowDutyLocationTransportationOfficeForbidden creates ShowDutyLocationTransportationOfficeForbidden with default headers values +func NewShowDutyLocationTransportationOfficeForbidden() *ShowDutyLocationTransportationOfficeForbidden { + + return &ShowDutyLocationTransportationOfficeForbidden{} +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// ShowDutyLocationTransportationOfficeNotFoundCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeNotFound +const ShowDutyLocationTransportationOfficeNotFoundCode int = 404 + +/* +ShowDutyLocationTransportationOfficeNotFound transportation office not found + +swagger:response showDutyLocationTransportationOfficeNotFound +*/ +type ShowDutyLocationTransportationOfficeNotFound struct { +} + +// NewShowDutyLocationTransportationOfficeNotFound creates ShowDutyLocationTransportationOfficeNotFound with default headers values +func NewShowDutyLocationTransportationOfficeNotFound() *ShowDutyLocationTransportationOfficeNotFound { + + return &ShowDutyLocationTransportationOfficeNotFound{} +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// ShowDutyLocationTransportationOfficeInternalServerErrorCode is the HTTP code returned for type ShowDutyLocationTransportationOfficeInternalServerError +const ShowDutyLocationTransportationOfficeInternalServerErrorCode int = 500 + +/* +ShowDutyLocationTransportationOfficeInternalServerError internal server error + +swagger:response showDutyLocationTransportationOfficeInternalServerError +*/ +type ShowDutyLocationTransportationOfficeInternalServerError struct { +} + +// NewShowDutyLocationTransportationOfficeInternalServerError creates ShowDutyLocationTransportationOfficeInternalServerError with default headers values +func NewShowDutyLocationTransportationOfficeInternalServerError() *ShowDutyLocationTransportationOfficeInternalServerError { + + return &ShowDutyLocationTransportationOfficeInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowDutyLocationTransportationOfficeInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go new file mode 100644 index 00000000000..c18ea950d74 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/transportation_offices/show_duty_location_transportation_office_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package transportation_offices + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ShowDutyLocationTransportationOfficeURL generates an URL for the show duty location transportation office operation +type ShowDutyLocationTransportationOfficeURL struct { + DutyLocationID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowDutyLocationTransportationOfficeURL) WithBasePath(bp string) *ShowDutyLocationTransportationOfficeURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowDutyLocationTransportationOfficeURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowDutyLocationTransportationOfficeURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/duty_locations/{dutyLocationId}/transportation_office" + + dutyLocationID := o.DutyLocationID.String() + if dutyLocationID != "" { + _path = strings.Replace(_path, "{dutyLocationId}", dutyLocationID, -1) + } else { + return nil, errors.New("dutyLocationId is required on ShowDutyLocationTransportationOfficeURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowDutyLocationTransportationOfficeURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowDutyLocationTransportationOfficeURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowDutyLocationTransportationOfficeURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowDutyLocationTransportationOfficeURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowDutyLocationTransportationOfficeURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowDutyLocationTransportationOfficeURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload.go new file mode 100644 index 00000000000..90b5451b23a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/create_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler +type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { + return fn(params) +} + +// CreateUploadHandler interface for that can handle valid create upload params +type CreateUploadHandler interface { + Handle(CreateUploadParams) middleware.Responder +} + +// NewCreateUpload creates a new http.Handler for the create upload operation +func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { + return &CreateUpload{Context: ctx, Handler: handler} +} + +/* + CreateUpload swagger:route POST /uploads uploads createUpload + +# Create a new upload + +Uploads represent a single digital file, such as a JPEG or PDF. +*/ +type CreateUpload struct { + Context *middleware.Context + Handler CreateUploadHandler +} + +func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go new file mode 100644 index 00000000000..c3c00400764 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/create_upload_parameters.go @@ -0,0 +1,136 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CreateUploadMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreateUploadMaxParseMemory int64 = 32 << 20 + +// NewCreateUploadParams creates a new CreateUploadParams object +// +// There are no default values defined in the spec. +func NewCreateUploadParams() CreateUploadParams { + + return CreateUploadParams{} +} + +// CreateUploadParams contains all the bound params for the create upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters createUpload +type CreateUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the document to add an upload to + In: query + */ + DocumentID *strfmt.UUID + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. +func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + qDocumentID, qhkDocumentID, _ := qs.GetOK("documentId") + if err := o.bindDocumentID(qDocumentID, qhkDocumentID, route.Formats); err != nil { + res = append(res, err) + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindDocumentID binds and validates parameter DocumentID from query. +func (o *CreateUploadParams) bindDocumentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("documentId", "query", "strfmt.UUID", raw) + } + o.DocumentID = (value.(*strfmt.UUID)) + + if err := o.validateDocumentID(formats); err != nil { + return err + } + + return nil +} + +// validateDocumentID carries on validations for parameter DocumentID +func (o *CreateUploadParams) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("documentId", "query", "uuid", o.DocumentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go new file mode 100644 index 00000000000..5e7cd623942 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/create_upload_responses.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated +const CreateUploadCreatedCode int = 201 + +/* +CreateUploadCreated created upload + +swagger:response createUploadCreated +*/ +type CreateUploadCreated struct { + + /* + In: Body + */ + Payload *internalmessages.Upload `json:"body,omitempty"` +} + +// NewCreateUploadCreated creates CreateUploadCreated with default headers values +func NewCreateUploadCreated() *CreateUploadCreated { + + return &CreateUploadCreated{} +} + +// WithPayload adds the payload to the create upload created response +func (o *CreateUploadCreated) WithPayload(payload *internalmessages.Upload) *CreateUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload created response +func (o *CreateUploadCreated) SetPayload(payload *internalmessages.Upload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest +const CreateUploadBadRequestCode int = 400 + +/* +CreateUploadBadRequest invalid request + +swagger:response createUploadBadRequest +*/ +type CreateUploadBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values +func NewCreateUploadBadRequest() *CreateUploadBadRequest { + + return &CreateUploadBadRequest{} +} + +// WithPayload adds the payload to the create upload bad request response +func (o *CreateUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *CreateUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload bad request response +func (o *CreateUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden +const CreateUploadForbiddenCode int = 403 + +/* +CreateUploadForbidden not authorized + +swagger:response createUploadForbidden +*/ +type CreateUploadForbidden struct { +} + +// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values +func NewCreateUploadForbidden() *CreateUploadForbidden { + + return &CreateUploadForbidden{} +} + +// WriteResponse to the client +func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound +const CreateUploadNotFoundCode int = 404 + +/* +CreateUploadNotFound not found + +swagger:response createUploadNotFound +*/ +type CreateUploadNotFound struct { +} + +// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values +func NewCreateUploadNotFound() *CreateUploadNotFound { + + return &CreateUploadNotFound{} +} + +// WriteResponse to the client +func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// CreateUploadRequestEntityTooLargeCode is the HTTP code returned for type CreateUploadRequestEntityTooLarge +const CreateUploadRequestEntityTooLargeCode int = 413 + +/* +CreateUploadRequestEntityTooLarge payload is too large + +swagger:response createUploadRequestEntityTooLarge +*/ +type CreateUploadRequestEntityTooLarge struct { +} + +// NewCreateUploadRequestEntityTooLarge creates CreateUploadRequestEntityTooLarge with default headers values +func NewCreateUploadRequestEntityTooLarge() *CreateUploadRequestEntityTooLarge { + + return &CreateUploadRequestEntityTooLarge{} +} + +// WriteResponse to the client +func (o *CreateUploadRequestEntityTooLarge) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(413) +} + +// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError +const CreateUploadInternalServerErrorCode int = 500 + +/* +CreateUploadInternalServerError server error + +swagger:response createUploadInternalServerError +*/ +type CreateUploadInternalServerError struct { +} + +// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values +func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { + + return &CreateUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go new file mode 100644 index 00000000000..7d6fdb24b15 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/create_upload_urlbuilder.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" +) + +// CreateUploadURL generates an URL for the create upload operation +type CreateUploadURL struct { + DocumentID *strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var documentIDQ string + if o.DocumentID != nil { + documentIDQ = o.DocumentID.String() + } + if documentIDQ != "" { + qs.Set("documentId", documentIDQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go new file mode 100644 index 00000000000..d2f39201c5c --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_upload.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteUploadHandlerFunc turns a function with the right signature into a delete upload handler +type DeleteUploadHandlerFunc func(DeleteUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteUploadHandlerFunc) Handle(params DeleteUploadParams) middleware.Responder { + return fn(params) +} + +// DeleteUploadHandler interface for that can handle valid delete upload params +type DeleteUploadHandler interface { + Handle(DeleteUploadParams) middleware.Responder +} + +// NewDeleteUpload creates a new http.Handler for the delete upload operation +func NewDeleteUpload(ctx *middleware.Context, handler DeleteUploadHandler) *DeleteUpload { + return &DeleteUpload{Context: ctx, Handler: handler} +} + +/* + DeleteUpload swagger:route DELETE /uploads/{uploadId} uploads deleteUpload + +# Deletes an upload + +Uploads represent a single digital file, such as a JPEG or PDF. +*/ +type DeleteUpload struct { + Context *middleware.Context + Handler DeleteUploadHandler +} + +func (o *DeleteUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go new file mode 100644 index 00000000000..4733744103b --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_parameters.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteUploadParams creates a new DeleteUploadParams object +// +// There are no default values defined in the spec. +func NewDeleteUploadParams() DeleteUploadParams { + + return DeleteUploadParams{} +} + +// DeleteUploadParams contains all the bound params for the delete upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteUpload +type DeleteUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optional ID of the move that the upload belongs to + In: query + */ + MoveID *strfmt.UUID + /*ID of the order that the upload belongs to + In: query + */ + OrderID *strfmt.UUID + /*Optional PPM shipment ID related to the upload + In: query + */ + PpmID *strfmt.UUID + /*UUID of the upload to be deleted + Required: true + In: path + */ + UploadID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteUploadParams() beforehand. +func (o *DeleteUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qMoveID, qhkMoveID, _ := qs.GetOK("moveId") + if err := o.bindMoveID(qMoveID, qhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + + qOrderID, qhkOrderID, _ := qs.GetOK("orderId") + if err := o.bindOrderID(qOrderID, qhkOrderID, route.Formats); err != nil { + res = append(res, err) + } + + qPpmID, qhkPpmID, _ := qs.GetOK("ppmId") + if err := o.bindPpmID(qPpmID, qhkPpmID, route.Formats); err != nil { + res = append(res, err) + } + + rUploadID, rhkUploadID, _ := route.Params.GetOK("uploadId") + if err := o.bindUploadID(rUploadID, rhkUploadID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from query. +func (o *DeleteUploadParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveId", "query", "strfmt.UUID", raw) + } + o.MoveID = (value.(*strfmt.UUID)) + + if err := o.validateMoveID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveID carries on validations for parameter MoveID +func (o *DeleteUploadParams) validateMoveID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveId", "query", "uuid", o.MoveID.String(), formats); err != nil { + return err + } + return nil +} + +// bindOrderID binds and validates parameter OrderID from query. +func (o *DeleteUploadParams) bindOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("orderId", "query", "strfmt.UUID", raw) + } + o.OrderID = (value.(*strfmt.UUID)) + + if err := o.validateOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateOrderID carries on validations for parameter OrderID +func (o *DeleteUploadParams) validateOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("orderId", "query", "uuid", o.OrderID.String(), formats); err != nil { + return err + } + return nil +} + +// bindPpmID binds and validates parameter PpmID from query. +func (o *DeleteUploadParams) bindPpmID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("ppmId", "query", "strfmt.UUID", raw) + } + o.PpmID = (value.(*strfmt.UUID)) + + if err := o.validatePpmID(formats); err != nil { + return err + } + + return nil +} + +// validatePpmID carries on validations for parameter PpmID +func (o *DeleteUploadParams) validatePpmID(formats strfmt.Registry) error { + + if err := validate.FormatOf("ppmId", "query", "uuid", o.PpmID.String(), formats); err != nil { + return err + } + return nil +} + +// bindUploadID binds and validates parameter UploadID from path. +func (o *DeleteUploadParams) bindUploadID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("uploadId", "path", "strfmt.UUID", raw) + } + o.UploadID = *(value.(*strfmt.UUID)) + + if err := o.validateUploadID(formats); err != nil { + return err + } + + return nil +} + +// validateUploadID carries on validations for parameter UploadID +func (o *DeleteUploadParams) validateUploadID(formats strfmt.Registry) error { + + if err := validate.FormatOf("uploadId", "path", "uuid", o.UploadID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go new file mode 100644 index 00000000000..c92db66e7b2 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteUploadNoContentCode is the HTTP code returned for type DeleteUploadNoContent +const DeleteUploadNoContentCode int = 204 + +/* +DeleteUploadNoContent deleted + +swagger:response deleteUploadNoContent +*/ +type DeleteUploadNoContent struct { +} + +// NewDeleteUploadNoContent creates DeleteUploadNoContent with default headers values +func NewDeleteUploadNoContent() *DeleteUploadNoContent { + + return &DeleteUploadNoContent{} +} + +// WriteResponse to the client +func (o *DeleteUploadNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteUploadBadRequestCode is the HTTP code returned for type DeleteUploadBadRequest +const DeleteUploadBadRequestCode int = 400 + +/* +DeleteUploadBadRequest invalid request + +swagger:response deleteUploadBadRequest +*/ +type DeleteUploadBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewDeleteUploadBadRequest creates DeleteUploadBadRequest with default headers values +func NewDeleteUploadBadRequest() *DeleteUploadBadRequest { + + return &DeleteUploadBadRequest{} +} + +// WithPayload adds the payload to the delete upload bad request response +func (o *DeleteUploadBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete upload bad request response +func (o *DeleteUploadBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteUploadForbiddenCode is the HTTP code returned for type DeleteUploadForbidden +const DeleteUploadForbiddenCode int = 403 + +/* +DeleteUploadForbidden not authorized + +swagger:response deleteUploadForbidden +*/ +type DeleteUploadForbidden struct { +} + +// NewDeleteUploadForbidden creates DeleteUploadForbidden with default headers values +func NewDeleteUploadForbidden() *DeleteUploadForbidden { + + return &DeleteUploadForbidden{} +} + +// WriteResponse to the client +func (o *DeleteUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// DeleteUploadNotFoundCode is the HTTP code returned for type DeleteUploadNotFound +const DeleteUploadNotFoundCode int = 404 + +/* +DeleteUploadNotFound not found + +swagger:response deleteUploadNotFound +*/ +type DeleteUploadNotFound struct { +} + +// NewDeleteUploadNotFound creates DeleteUploadNotFound with default headers values +func NewDeleteUploadNotFound() *DeleteUploadNotFound { + + return &DeleteUploadNotFound{} +} + +// WriteResponse to the client +func (o *DeleteUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DeleteUploadInternalServerErrorCode is the HTTP code returned for type DeleteUploadInternalServerError +const DeleteUploadInternalServerErrorCode int = 500 + +/* +DeleteUploadInternalServerError server error + +swagger:response deleteUploadInternalServerError +*/ +type DeleteUploadInternalServerError struct { +} + +// NewDeleteUploadInternalServerError creates DeleteUploadInternalServerError with default headers values +func NewDeleteUploadInternalServerError() *DeleteUploadInternalServerError { + + return &DeleteUploadInternalServerError{} +} + +// WriteResponse to the client +func (o *DeleteUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go new file mode 100644 index 00000000000..c5fdb9ecd28 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_upload_urlbuilder.go @@ -0,0 +1,133 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteUploadURL generates an URL for the delete upload operation +type DeleteUploadURL struct { + UploadID strfmt.UUID + + MoveID *strfmt.UUID + OrderID *strfmt.UUID + PpmID *strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadURL) WithBasePath(bp string) *DeleteUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads/{uploadId}" + + uploadID := o.UploadID.String() + if uploadID != "" { + _path = strings.Replace(_path, "{uploadId}", uploadID, -1) + } else { + return nil, errors.New("uploadId is required on DeleteUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var moveIDQ string + if o.MoveID != nil { + moveIDQ = o.MoveID.String() + } + if moveIDQ != "" { + qs.Set("moveId", moveIDQ) + } + + var orderIDQ string + if o.OrderID != nil { + orderIDQ = o.OrderID.String() + } + if orderIDQ != "" { + qs.Set("orderId", orderIDQ) + } + + var ppmIDQ string + if o.PpmID != nil { + ppmIDQ = o.PpmID.String() + } + if ppmIDQ != "" { + qs.Set("ppmId", ppmIDQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go new file mode 100644 index 00000000000..fd61077fa4f --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteUploadsHandlerFunc turns a function with the right signature into a delete uploads handler +type DeleteUploadsHandlerFunc func(DeleteUploadsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteUploadsHandlerFunc) Handle(params DeleteUploadsParams) middleware.Responder { + return fn(params) +} + +// DeleteUploadsHandler interface for that can handle valid delete uploads params +type DeleteUploadsHandler interface { + Handle(DeleteUploadsParams) middleware.Responder +} + +// NewDeleteUploads creates a new http.Handler for the delete uploads operation +func NewDeleteUploads(ctx *middleware.Context, handler DeleteUploadsHandler) *DeleteUploads { + return &DeleteUploads{Context: ctx, Handler: handler} +} + +/* + DeleteUploads swagger:route DELETE /uploads uploads deleteUploads + +# Deletes a collection of uploads + +Uploads represent a single digital file, such as a JPEG or PDF. +*/ +type DeleteUploads struct { + Context *middleware.Context + Handler DeleteUploadsHandler +} + +func (o *DeleteUploads) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteUploadsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go new file mode 100644 index 00000000000..15b8c60bbdc --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_parameters.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// NewDeleteUploadsParams creates a new DeleteUploadsParams object +// +// There are no default values defined in the spec. +func NewDeleteUploadsParams() DeleteUploadsParams { + + return DeleteUploadsParams{} +} + +// DeleteUploadsParams contains all the bound params for the delete uploads operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteUploads +type DeleteUploadsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Array of UUIDs to be deleted + Required: true + In: query + */ + UploadIds []strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteUploadsParams() beforehand. +func (o *DeleteUploadsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qUploadIds, qhkUploadIds, _ := qs.GetOK("uploadIds") + if err := o.bindUploadIds(qUploadIds, qhkUploadIds, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindUploadIds binds and validates array parameter UploadIds from query. +// +// Arrays are parsed according to CollectionFormat: "" (defaults to "csv" when empty). +func (o *DeleteUploadsParams) bindUploadIds(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("uploadIds", "query", rawData) + } + var qvUploadIds string + if len(rawData) > 0 { + qvUploadIds = rawData[len(rawData)-1] + } + + // CollectionFormat: + uploadIdsIC := swag.SplitByFormat(qvUploadIds, "") + if len(uploadIdsIC) == 0 { + return errors.Required("uploadIds", "query", uploadIdsIC) + } + + var uploadIdsIR []strfmt.UUID + for i, uploadIdsIV := range uploadIdsIC { + // items.Format: "uuid" + value, err := formats.Parse("uuid", uploadIdsIV) + if err != nil { + return errors.InvalidType(fmt.Sprintf("%s.%v", "uploadIds", i), "query", "strfmt.UUID", value) + } + uploadIdsI := *(value.(*strfmt.UUID)) + + if err := validate.FormatOf(fmt.Sprintf("%s.%v", "uploadIds", i), "query", "uuid", uploadIdsI.String(), formats); err != nil { + return err + } + uploadIdsIR = append(uploadIdsIR, uploadIdsI) + } + + o.UploadIds = uploadIdsIR + + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go new file mode 100644 index 00000000000..eeaf4055004 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_responses.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// DeleteUploadsNoContentCode is the HTTP code returned for type DeleteUploadsNoContent +const DeleteUploadsNoContentCode int = 204 + +/* +DeleteUploadsNoContent deleted + +swagger:response deleteUploadsNoContent +*/ +type DeleteUploadsNoContent struct { +} + +// NewDeleteUploadsNoContent creates DeleteUploadsNoContent with default headers values +func NewDeleteUploadsNoContent() *DeleteUploadsNoContent { + + return &DeleteUploadsNoContent{} +} + +// WriteResponse to the client +func (o *DeleteUploadsNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteUploadsBadRequestCode is the HTTP code returned for type DeleteUploadsBadRequest +const DeleteUploadsBadRequestCode int = 400 + +/* +DeleteUploadsBadRequest invalid request + +swagger:response deleteUploadsBadRequest +*/ +type DeleteUploadsBadRequest struct { + + /* + In: Body + */ + Payload *internalmessages.InvalidRequestResponsePayload `json:"body,omitempty"` +} + +// NewDeleteUploadsBadRequest creates DeleteUploadsBadRequest with default headers values +func NewDeleteUploadsBadRequest() *DeleteUploadsBadRequest { + + return &DeleteUploadsBadRequest{} +} + +// WithPayload adds the payload to the delete uploads bad request response +func (o *DeleteUploadsBadRequest) WithPayload(payload *internalmessages.InvalidRequestResponsePayload) *DeleteUploadsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete uploads bad request response +func (o *DeleteUploadsBadRequest) SetPayload(payload *internalmessages.InvalidRequestResponsePayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteUploadsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteUploadsForbiddenCode is the HTTP code returned for type DeleteUploadsForbidden +const DeleteUploadsForbiddenCode int = 403 + +/* +DeleteUploadsForbidden not authorized + +swagger:response deleteUploadsForbidden +*/ +type DeleteUploadsForbidden struct { +} + +// NewDeleteUploadsForbidden creates DeleteUploadsForbidden with default headers values +func NewDeleteUploadsForbidden() *DeleteUploadsForbidden { + + return &DeleteUploadsForbidden{} +} + +// WriteResponse to the client +func (o *DeleteUploadsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(403) +} + +// DeleteUploadsNotFoundCode is the HTTP code returned for type DeleteUploadsNotFound +const DeleteUploadsNotFoundCode int = 404 + +/* +DeleteUploadsNotFound not found + +swagger:response deleteUploadsNotFound +*/ +type DeleteUploadsNotFound struct { +} + +// NewDeleteUploadsNotFound creates DeleteUploadsNotFound with default headers values +func NewDeleteUploadsNotFound() *DeleteUploadsNotFound { + + return &DeleteUploadsNotFound{} +} + +// WriteResponse to the client +func (o *DeleteUploadsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(404) +} + +// DeleteUploadsInternalServerErrorCode is the HTTP code returned for type DeleteUploadsInternalServerError +const DeleteUploadsInternalServerErrorCode int = 500 + +/* +DeleteUploadsInternalServerError server error + +swagger:response deleteUploadsInternalServerError +*/ +type DeleteUploadsInternalServerError struct { +} + +// NewDeleteUploadsInternalServerError creates DeleteUploadsInternalServerError with default headers values +func NewDeleteUploadsInternalServerError() *DeleteUploadsInternalServerError { + + return &DeleteUploadsInternalServerError{} +} + +// WriteResponse to the client +func (o *DeleteUploadsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go new file mode 100644 index 00000000000..392b6fe290a --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/uploads/delete_uploads_urlbuilder.go @@ -0,0 +1,115 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package uploads + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DeleteUploadsURL generates an URL for the delete uploads operation +type DeleteUploadsURL struct { + UploadIds []strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadsURL) WithBasePath(bp string) *DeleteUploadsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteUploadsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteUploadsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/uploads" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var uploadIdsIR []string + for _, uploadIdsI := range o.UploadIds { + uploadIdsIS := uploadIdsI.String() + if uploadIdsIS != "" { + uploadIdsIR = append(uploadIdsIR, uploadIdsIS) + } + } + + uploadIds := swag.JoinByFormat(uploadIdsIR, "") + + if len(uploadIds) > 0 { + qsv := uploadIds[0] + if qsv != "" { + qs.Set("uploadIds", qsv) + } + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteUploadsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteUploadsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteUploadsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteUploadsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteUploadsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteUploadsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go new file mode 100644 index 00000000000..a8b5e891f45 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user.go @@ -0,0 +1,119 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "context" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IsLoggedInUserHandlerFunc turns a function with the right signature into a is logged in user handler +type IsLoggedInUserHandlerFunc func(IsLoggedInUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn IsLoggedInUserHandlerFunc) Handle(params IsLoggedInUserParams) middleware.Responder { + return fn(params) +} + +// IsLoggedInUserHandler interface for that can handle valid is logged in user params +type IsLoggedInUserHandler interface { + Handle(IsLoggedInUserParams) middleware.Responder +} + +// NewIsLoggedInUser creates a new http.Handler for the is logged in user operation +func NewIsLoggedInUser(ctx *middleware.Context, handler IsLoggedInUserHandler) *IsLoggedInUser { + return &IsLoggedInUser{Context: ctx, Handler: handler} +} + +/* + IsLoggedInUser swagger:route GET /users/is_logged_in users isLoggedInUser + +# Returns boolean as to whether the user is logged in + +Returns boolean as to whether the user is logged in +*/ +type IsLoggedInUser struct { + Context *middleware.Context + Handler IsLoggedInUserHandler +} + +func (o *IsLoggedInUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewIsLoggedInUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} + +// IsLoggedInUserOKBody is logged in user o k body +// +// swagger:model IsLoggedInUserOKBody +type IsLoggedInUserOKBody struct { + + // is logged in + // Required: true + IsLoggedIn *bool `json:"isLoggedIn"` +} + +// Validate validates this is logged in user o k body +func (o *IsLoggedInUserOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateIsLoggedIn(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *IsLoggedInUserOKBody) validateIsLoggedIn(formats strfmt.Registry) error { + + if err := validate.Required("isLoggedInUserOK"+"."+"isLoggedIn", "body", o.IsLoggedIn); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this is logged in user o k body based on context it is used +func (o *IsLoggedInUserOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *IsLoggedInUserOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *IsLoggedInUserOKBody) UnmarshalBinary(b []byte) error { + var res IsLoggedInUserOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go new file mode 100644 index 00000000000..d5bd1b076b1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewIsLoggedInUserParams creates a new IsLoggedInUserParams object +// +// There are no default values defined in the spec. +func NewIsLoggedInUserParams() IsLoggedInUserParams { + + return IsLoggedInUserParams{} +} + +// IsLoggedInUserParams contains all the bound params for the is logged in user operation +// typically these are obtained from a http.Request +// +// swagger:parameters isLoggedInUser +type IsLoggedInUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewIsLoggedInUserParams() beforehand. +func (o *IsLoggedInUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go new file mode 100644 index 00000000000..5b5613270b1 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_responses.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// IsLoggedInUserOKCode is the HTTP code returned for type IsLoggedInUserOK +const IsLoggedInUserOKCode int = 200 + +/* +IsLoggedInUserOK Currently logged in user + +swagger:response isLoggedInUserOK +*/ +type IsLoggedInUserOK struct { + + /* + In: Body + */ + Payload *IsLoggedInUserOKBody `json:"body,omitempty"` +} + +// NewIsLoggedInUserOK creates IsLoggedInUserOK with default headers values +func NewIsLoggedInUserOK() *IsLoggedInUserOK { + + return &IsLoggedInUserOK{} +} + +// WithPayload adds the payload to the is logged in user o k response +func (o *IsLoggedInUserOK) WithPayload(payload *IsLoggedInUserOKBody) *IsLoggedInUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the is logged in user o k response +func (o *IsLoggedInUserOK) SetPayload(payload *IsLoggedInUserOKBody) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *IsLoggedInUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// IsLoggedInUserBadRequestCode is the HTTP code returned for type IsLoggedInUserBadRequest +const IsLoggedInUserBadRequestCode int = 400 + +/* +IsLoggedInUserBadRequest invalid request + +swagger:response isLoggedInUserBadRequest +*/ +type IsLoggedInUserBadRequest struct { +} + +// NewIsLoggedInUserBadRequest creates IsLoggedInUserBadRequest with default headers values +func NewIsLoggedInUserBadRequest() *IsLoggedInUserBadRequest { + + return &IsLoggedInUserBadRequest{} +} + +// WriteResponse to the client +func (o *IsLoggedInUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// IsLoggedInUserInternalServerErrorCode is the HTTP code returned for type IsLoggedInUserInternalServerError +const IsLoggedInUserInternalServerErrorCode int = 500 + +/* +IsLoggedInUserInternalServerError server error + +swagger:response isLoggedInUserInternalServerError +*/ +type IsLoggedInUserInternalServerError struct { +} + +// NewIsLoggedInUserInternalServerError creates IsLoggedInUserInternalServerError with default headers values +func NewIsLoggedInUserInternalServerError() *IsLoggedInUserInternalServerError { + + return &IsLoggedInUserInternalServerError{} +} + +// WriteResponse to the client +func (o *IsLoggedInUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go new file mode 100644 index 00000000000..0957510d8e9 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/is_logged_in_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// IsLoggedInUserURL generates an URL for the is logged in user operation +type IsLoggedInUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsLoggedInUserURL) WithBasePath(bp string) *IsLoggedInUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *IsLoggedInUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *IsLoggedInUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/users/is_logged_in" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *IsLoggedInUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *IsLoggedInUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *IsLoggedInUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on IsLoggedInUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on IsLoggedInUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *IsLoggedInUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go new file mode 100644 index 00000000000..e661ccc30d3 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ShowLoggedInUserHandlerFunc turns a function with the right signature into a show logged in user handler +type ShowLoggedInUserHandlerFunc func(ShowLoggedInUserParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ShowLoggedInUserHandlerFunc) Handle(params ShowLoggedInUserParams) middleware.Responder { + return fn(params) +} + +// ShowLoggedInUserHandler interface for that can handle valid show logged in user params +type ShowLoggedInUserHandler interface { + Handle(ShowLoggedInUserParams) middleware.Responder +} + +// NewShowLoggedInUser creates a new http.Handler for the show logged in user operation +func NewShowLoggedInUser(ctx *middleware.Context, handler ShowLoggedInUserHandler) *ShowLoggedInUser { + return &ShowLoggedInUser{Context: ctx, Handler: handler} +} + +/* + ShowLoggedInUser swagger:route GET /users/logged_in users showLoggedInUser + +# Returns the user info for the currently logged in user + +Returns the user info for the currently logged in user +*/ +type ShowLoggedInUser struct { + Context *middleware.Context + Handler ShowLoggedInUserHandler +} + +func (o *ShowLoggedInUser) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewShowLoggedInUserParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go new file mode 100644 index 00000000000..d1cdcb6a449 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewShowLoggedInUserParams creates a new ShowLoggedInUserParams object +// +// There are no default values defined in the spec. +func NewShowLoggedInUserParams() ShowLoggedInUserParams { + + return ShowLoggedInUserParams{} +} + +// ShowLoggedInUserParams contains all the bound params for the show logged in user operation +// typically these are obtained from a http.Request +// +// swagger:parameters showLoggedInUser +type ShowLoggedInUserParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewShowLoggedInUserParams() beforehand. +func (o *ShowLoggedInUserParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go new file mode 100644 index 00000000000..bd218fd450e --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_responses.go @@ -0,0 +1,134 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/internalmessages" +) + +// ShowLoggedInUserOKCode is the HTTP code returned for type ShowLoggedInUserOK +const ShowLoggedInUserOKCode int = 200 + +/* +ShowLoggedInUserOK Currently logged in user + +swagger:response showLoggedInUserOK +*/ +type ShowLoggedInUserOK struct { + + /* + In: Body + */ + Payload *internalmessages.LoggedInUserPayload `json:"body,omitempty"` +} + +// NewShowLoggedInUserOK creates ShowLoggedInUserOK with default headers values +func NewShowLoggedInUserOK() *ShowLoggedInUserOK { + + return &ShowLoggedInUserOK{} +} + +// WithPayload adds the payload to the show logged in user o k response +func (o *ShowLoggedInUserOK) WithPayload(payload *internalmessages.LoggedInUserPayload) *ShowLoggedInUserOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show logged in user o k response +func (o *ShowLoggedInUserOK) SetPayload(payload *internalmessages.LoggedInUserPayload) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowLoggedInUserOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowLoggedInUserBadRequestCode is the HTTP code returned for type ShowLoggedInUserBadRequest +const ShowLoggedInUserBadRequestCode int = 400 + +/* +ShowLoggedInUserBadRequest invalid request + +swagger:response showLoggedInUserBadRequest +*/ +type ShowLoggedInUserBadRequest struct { +} + +// NewShowLoggedInUserBadRequest creates ShowLoggedInUserBadRequest with default headers values +func NewShowLoggedInUserBadRequest() *ShowLoggedInUserBadRequest { + + return &ShowLoggedInUserBadRequest{} +} + +// WriteResponse to the client +func (o *ShowLoggedInUserBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(400) +} + +// ShowLoggedInUserUnauthorizedCode is the HTTP code returned for type ShowLoggedInUserUnauthorized +const ShowLoggedInUserUnauthorizedCode int = 401 + +/* +ShowLoggedInUserUnauthorized request requires user authentication + +swagger:response showLoggedInUserUnauthorized +*/ +type ShowLoggedInUserUnauthorized struct { +} + +// NewShowLoggedInUserUnauthorized creates ShowLoggedInUserUnauthorized with default headers values +func NewShowLoggedInUserUnauthorized() *ShowLoggedInUserUnauthorized { + + return &ShowLoggedInUserUnauthorized{} +} + +// WriteResponse to the client +func (o *ShowLoggedInUserUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(401) +} + +// ShowLoggedInUserInternalServerErrorCode is the HTTP code returned for type ShowLoggedInUserInternalServerError +const ShowLoggedInUserInternalServerErrorCode int = 500 + +/* +ShowLoggedInUserInternalServerError server error + +swagger:response showLoggedInUserInternalServerError +*/ +type ShowLoggedInUserInternalServerError struct { +} + +// NewShowLoggedInUserInternalServerError creates ShowLoggedInUserInternalServerError with default headers values +func NewShowLoggedInUserInternalServerError() *ShowLoggedInUserInternalServerError { + + return &ShowLoggedInUserInternalServerError{} +} + +// WriteResponse to the client +func (o *ShowLoggedInUserInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(500) +} diff --git a/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go new file mode 100644 index 00000000000..dcf0616dcf8 --- /dev/null +++ b/pkg/gen/internalapi/internaloperations/users/show_logged_in_user_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package users + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ShowLoggedInUserURL generates an URL for the show logged in user operation +type ShowLoggedInUserURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowLoggedInUserURL) WithBasePath(bp string) *ShowLoggedInUserURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ShowLoggedInUserURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ShowLoggedInUserURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/users/logged_in" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/internal" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ShowLoggedInUserURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ShowLoggedInUserURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ShowLoggedInUserURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ShowLoggedInUserURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ShowLoggedInUserURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ShowLoggedInUserURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/internalapi/server.go b/pkg/gen/internalapi/server.go new file mode 100644 index 00000000000..afa8c2a8581 --- /dev/null +++ b/pkg/gen/internalapi/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/internalapi/internaloperations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *internaloperations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *internaloperations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *internaloperations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/internalmessages/create_mobile_home_shipment.go b/pkg/gen/internalmessages/create_mobile_home_shipment.go new file mode 100644 index 00000000000..378f28bbdac --- /dev/null +++ b/pkg/gen/internalmessages/create_mobile_home_shipment.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateMobileHomeShipment A mobile home shipment that the prime moves for a service member. +// +// swagger:model CreateMobileHomeShipment +type CreateMobileHomeShipment struct { + + // Height of the Mobile Home in inches + // Required: true + HeightInInches *int64 `json:"heightInInches"` + + // Length of the Mobile Home in inches + // Required: true + LengthInInches *int64 `json:"lengthInInches"` + + // Make of the Mobile Home + // Required: true + Make *string `json:"make"` + + // Model of the Mobile Home + // Required: true + Model *string `json:"model"` + + // Width of the Mobile Home in inches + // Required: true + WidthInInches *int64 `json:"widthInInches"` + + // Year of the Mobile Home + // Required: true + Year *int64 `json:"year"` +} + +// Validate validates this create mobile home shipment +func (m *CreateMobileHomeShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeightInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLengthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMake(formats); err != nil { + res = append(res, err) + } + + if err := m.validateModel(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidthInInches(formats); err != nil { + res = append(res, err) + } + + if err := m.validateYear(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateMobileHomeShipment) validateHeightInInches(formats strfmt.Registry) error { + + if err := validate.Required("heightInInches", "body", m.HeightInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateLengthInInches(formats strfmt.Registry) error { + + if err := validate.Required("lengthInInches", "body", m.LengthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateMake(formats strfmt.Registry) error { + + if err := validate.Required("make", "body", m.Make); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateModel(formats strfmt.Registry) error { + + if err := validate.Required("model", "body", m.Model); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateWidthInInches(formats strfmt.Registry) error { + + if err := validate.Required("widthInInches", "body", m.WidthInInches); err != nil { + return err + } + + return nil +} + +func (m *CreateMobileHomeShipment) validateYear(formats strfmt.Registry) error { + + if err := validate.Required("year", "body", m.Year); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this create mobile home shipment based on context it is used +func (m *CreateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *CreateMobileHomeShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateMobileHomeShipment) UnmarshalBinary(b []byte) error { + var res CreateMobileHomeShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_p_p_m_shipment.go b/pkg/gen/internalmessages/create_p_p_m_shipment.go new file mode 100644 index 00000000000..98c9983390d --- /dev/null +++ b/pkg/gen/internalmessages/create_p_p_m_shipment.go @@ -0,0 +1,411 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreatePPMShipment A personally procured move is a type of shipment that a service members moves themselves. +// +// swagger:model CreatePPMShipment +type CreatePPMShipment struct { + + // destination address + // Required: true + DestinationAddress *PPMDestinationAddress `json:"destinationAddress"` + + // Date the customer expects to move. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Denotes if this PPM shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // pickup address + // Required: true + PickupAddress *Address `json:"pickupAddress"` + + // secondary destination address + SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // sit expected + // Required: true + SitExpected *bool `json:"sitExpected"` + + // tertiary destination address + TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this create p p m shipment +func (m *CreatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + + if err := validate.Required("destinationAddress", "body", m.DestinationAddress); err != nil { + return err + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + + if err := validate.Required("pickupAddress", "body", m.PickupAddress); err != nil { + return err + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if m.SecondaryDestinationAddress != nil { + if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *CreatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if m.TertiaryDestinationAddress != nil { + if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create p p m shipment based on the context it is used +func (m *CreatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDestinationAddress != nil { + + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDestinationAddress != nil { + + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreatePPMShipment) UnmarshalBinary(b []byte) error { + var res CreatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go b/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go new file mode 100644 index 00000000000..dd4f284258f --- /dev/null +++ b/pkg/gen/internalmessages/create_service_member_backup_contact_payload.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateServiceMemberBackupContactPayload create service member backup contact payload +// +// swagger:model CreateServiceMemberBackupContactPayload +type CreateServiceMemberBackupContactPayload struct { + + // Email + // Example: john_bob@exmaple.com + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email"` + + // Name + // Example: Susan Smith + // Required: true + Name *string `json:"name"` + + // permission + // Required: true + Permission *BackupContactPermission `json:"permission"` + + // Phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` +} + +// Validate validates this create service member backup contact payload +func (m *CreateServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePermission(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if m.Permission != nil { + if err := m.Permission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create service member backup contact payload based on the context it is used +func (m *CreateServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePermission(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { + + if m.Permission != nil { + + if err := m.Permission.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { + var res CreateServiceMemberBackupContactPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_service_member_payload.go b/pkg/gen/internalmessages/create_service_member_payload.go new file mode 100644 index 00000000000..737d5a0a897 --- /dev/null +++ b/pkg/gen/internalmessages/create_service_member_payload.go @@ -0,0 +1,421 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateServiceMemberPayload create service member payload +// +// swagger:model CreateServiceMemberPayload +type CreateServiceMemberPayload struct { + + // affiliation + Affiliation *Affiliation `json:"affiliation,omitempty"` + + // backup mailing address + BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` + + // current location id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CurrentLocationID *strfmt.UUID `json:"current_location_id,omitempty"` + + // DoD ID number + // Example: 5789345789 + // Max Length: 10 + // Min Length: 10 + // Pattern: ^\d{10}$ + Edipi *string `json:"edipi,omitempty"` + + // Email + EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` + + // First name + // Example: John + FirstName *string `json:"first_name,omitempty"` + + // grade + Grade *OrderPayGrade `json:"grade,omitempty"` + + // Last name + // Example: Donut + LastName *string `json:"last_name,omitempty"` + + // Middle name + // Example: L. + MiddleName *string `json:"middle_name,omitempty"` + + // Personal email + // Example: john_bob@example.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail *string `json:"personal_email,omitempty"` + + // Phone + PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` + + // residential address + ResidentialAddress *Address `json:"residential_address,omitempty"` + + // Alternate phone + // Example: 212-555-5555 + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + SecondaryTelephone *string `json:"secondary_telephone,omitempty"` + + // Suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // Best contact phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // user id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"user_id,omitempty"` +} + +// Validate validates this create service member payload +func (m *CreateServiceMemberPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffiliation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupMailingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResidentialAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if m.Affiliation != nil { + if err := m.Affiliation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if m.BackupMailingAddress != nil { + if err := m.BackupMailingAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateCurrentLocationID(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentLocationID) { // not required + return nil + } + + if err := validate.FormatOf("current_location_id", "body", "uuid", m.CurrentLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.Edipi) { // not required + return nil + } + + if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if m.ResidentialAddress != nil { + if err := m.ResidentialAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *CreateServiceMemberPayload) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create service member payload based on the context it is used +func (m *CreateServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAffiliation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { + + if m.Affiliation != nil { + + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupMailingAddress != nil { + + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ResidentialAddress != nil { + + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateServiceMemberPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateServiceMemberPayload) UnmarshalBinary(b []byte) error { + var res CreateServiceMemberPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_shipment.go b/pkg/gen/internalmessages/create_shipment.go new file mode 100644 index 00000000000..284a4c755e0 --- /dev/null +++ b/pkg/gen/internalmessages/create_shipment.go @@ -0,0 +1,680 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateShipment create shipment +// +// swagger:model CreateShipment +type CreateShipment struct { + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // boat shipment + BoatShipment *CreateBoatShipment `json:"boatShipment,omitempty"` + + // customer remarks + // Example: handle with care + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // mobile home shipment + MobileHomeShipment *CreateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` + + // move task order ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *CreatePPMShipment `json:"ppmShipment,omitempty"` + + // requested delivery date + // Format: date + RequestedDeliveryDate strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate strfmt.Date `json:"requestedPickupDate,omitempty"` + + // secondary delivery address + SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // shipment type + // Required: true + ShipmentType *MTOShipmentType `json:"shipmentType"` + + // tertiary delivery address + TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this create shipment +func (m *CreateShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateShipment) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *CreateShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if m.SecondaryDeliveryAddress != nil { + if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateShipmentType(formats strfmt.Registry) error { + + if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { + return err + } + + if err := validate.Required("shipmentType", "body", m.ShipmentType); err != nil { + return err + } + + if m.ShipmentType != nil { + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if m.TertiaryDeliveryAddress != nil { + if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create shipment based on the context it is used +func (m *CreateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *CreateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDeliveryAddress != nil { + + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if m.ShipmentType != nil { + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDeliveryAddress != nil { + + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *CreateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateShipment) UnmarshalBinary(b []byte) error { + var res CreateShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_signed_certification_payload.go b/pkg/gen/internalmessages/create_signed_certification_payload.go new file mode 100644 index 00000000000..b22c458c6b8 --- /dev/null +++ b/pkg/gen/internalmessages/create_signed_certification_payload.go @@ -0,0 +1,238 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateSignedCertificationPayload create signed certification payload +// +// swagger:model CreateSignedCertificationPayload +type CreateSignedCertificationPayload struct { + + // certification text + // Required: true + CertificationText *string `json:"certification_text"` + + // certification type + CertificationType *SignedCertificationTypeCreate `json:"certification_type,omitempty"` + + // Date + // Required: true + // Format: date-time + Date *strfmt.DateTime `json:"date"` + + // personally procured move id + // Format: uuid + PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` + + // ppm id + // Format: uuid + PpmID *PpmID `json:"ppm_id,omitempty"` + + // Signature + // Required: true + Signature *string `json:"signature"` +} + +// Validate validates this create signed certification payload +func (m *CreateSignedCertificationPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificationText(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonallyProcuredMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignedCertificationPayload) validateCertificationText(formats strfmt.Registry) error { + + if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { + return err + } + + return nil +} + +func (m *CreateSignedCertificationPayload) validateCertificationType(formats strfmt.Registry) error { + if swag.IsZero(m.CertificationType) { // not required + return nil + } + + if m.CertificationType != nil { + if err := m.CertificationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certification_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certification_type") + } + return err + } + } + + return nil +} + +func (m *CreateSignedCertificationPayload) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateSignedCertificationPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.PersonallyProcuredMoveID) { // not required + return nil + } + + if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateSignedCertificationPayload) validatePpmID(formats strfmt.Registry) error { + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if m.PpmID != nil { + if err := m.PpmID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppm_id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppm_id") + } + return err + } + } + + return nil +} + +func (m *CreateSignedCertificationPayload) validateSignature(formats strfmt.Registry) error { + + if err := validate.Required("signature", "body", m.Signature); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create signed certification payload based on the context it is used +func (m *CreateSignedCertificationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateSignedCertificationPayload) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { + + if m.CertificationType != nil { + + if swag.IsZero(m.CertificationType) { // not required + return nil + } + + if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certification_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certification_type") + } + return err + } + } + + return nil +} + +func (m *CreateSignedCertificationPayload) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmID != nil { + + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if err := m.PpmID.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppm_id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppm_id") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateSignedCertificationPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateSignedCertificationPayload) UnmarshalBinary(b []byte) error { + var res CreateSignedCertificationPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_update_orders.go b/pkg/gen/internalmessages/create_update_orders.go new file mode 100644 index 00000000000..7ccd66e1beb --- /dev/null +++ b/pkg/gen/internalmessages/create_update_orders.go @@ -0,0 +1,482 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateUpdateOrders create update orders +// +// swagger:model CreateUpdateOrders +type CreateUpdateOrders struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompanied_tour,omitempty"` + + // counseling office id + // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 + // Format: uuid + CounselingOfficeID *strfmt.UUID `json:"counseling_office_id,omitempty"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependents_twelve_and_over,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependents_under_twelve,omitempty"` + + // grade + Grade *OrderPayGrade `json:"grade,omitempty"` + + // Are dependents included in your orders? + // Required: true + HasDependents *bool `json:"has_dependents"` + + // Orders date + // + // The date and time that these orders were cut. + // Example: 2018-04-26 + // Required: true + // Format: date + IssueDate *strfmt.Date `json:"issue_date"` + + // move id + // Example: cf1addea-a4f9-4173-8506-2bb82a064cb7 + // Format: uuid + MoveID strfmt.UUID `json:"move_id,omitempty"` + + // new duty location id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + NewDutyLocationID *strfmt.UUID `json:"new_duty_location_id"` + + // Orders Number + // Example: 030-00362 + OrdersNumber *string `json:"orders_number,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"orders_type"` + + // orders type detail + OrdersTypeDetail *OrdersTypeDetail `json:"orders_type_detail,omitempty"` + + // origin duty location id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OriginDutyLocationID strfmt.UUID `json:"origin_duty_location_id,omitempty"` + + // Report-by date + // + // Report By Date + // Example: 2018-04-26 + // Required: true + // Format: date + ReportByDate *strfmt.Date `json:"report_by_date"` + + // SAC + // Example: N002214CSW32Y9 + Sac *string `json:"sac,omitempty"` + + // service member id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"service_member_id"` + + // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? + // Required: true + SpouseHasProGear *bool `json:"spouse_has_pro_gear"` + + // TAC + // Example: F8J1 + Tac *string `json:"tac,omitempty"` +} + +// Validate validates this create update orders +func (m *CreateUpdateOrders) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCounselingOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHasDependents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSpouseHasProGear(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateUpdateOrders) validateCounselingOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("counseling_office_id", "body", "uuid", m.CounselingOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) validateHasDependents(formats strfmt.Registry) error { + + if err := validate.Required("has_dependents", "body", m.HasDependents); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateIssueDate(formats strfmt.Registry) error { + + if err := validate.Required("issue_date", "body", m.IssueDate); err != nil { + return err + } + + if err := validate.FormatOf("issue_date", "body", "date", m.IssueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveID) { // not required + return nil + } + + if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateNewDutyLocationID(formats strfmt.Registry) error { + + if err := validate.Required("new_duty_location_id", "body", m.NewDutyLocationID); err != nil { + return err + } + + if err := validate.FormatOf("new_duty_location_id", "body", "uuid", m.NewDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) validateOrdersTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if m.OrdersTypeDetail != nil { + if err := m.OrdersTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type_detail") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) validateOriginDutyLocationID(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocationID) { // not required + return nil + } + + if err := validate.FormatOf("origin_duty_location_id", "body", "uuid", m.OriginDutyLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateReportByDate(formats strfmt.Registry) error { + + if err := validate.Required("report_by_date", "body", m.ReportByDate); err != nil { + return err + } + + if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateUpdateOrders) validateSpouseHasProGear(formats strfmt.Registry) error { + + if err := validate.Required("spouse_has_pro_gear", "body", m.SpouseHasProGear); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this create update orders based on the context it is used +func (m *CreateUpdateOrders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateUpdateOrders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *CreateUpdateOrders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersTypeDetail != nil { + + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type_detail") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateUpdateOrders) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateUpdateOrders) UnmarshalBinary(b []byte) error { + var res CreateUpdateOrders + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go b/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go new file mode 100644 index 00000000000..171c18d429d --- /dev/null +++ b/pkg/gen/internalmessages/create_weight_ticket_documents_payload.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// CreateWeightTicketDocumentsPayload create weight ticket documents payload +// +// swagger:model CreateWeightTicketDocumentsPayload +type CreateWeightTicketDocumentsPayload struct { + + // empty weight ticket recorded weight + // Minimum: 0 + EmptyWeight *int64 `json:"empty_weight,omitempty"` + + // missing empty weight ticket + // Required: true + EmptyWeightTicketMissing *bool `json:"empty_weight_ticket_missing"` + + // full weight ticket recorded weight + // Minimum: 0 + FullWeight *int64 `json:"full_weight,omitempty"` + + // missing full weight ticket + // Required: true + FullWeightTicketMissing *bool `json:"full_weight_ticket_missing"` + + // personally procured move id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id"` + + // missing trailer ownership documentation + // Required: true + TrailerOwnershipMissing *bool `json:"trailer_ownership_missing"` + + // upload ids + UploadIds []strfmt.UUID `json:"upload_ids"` + + // Vehicle make + VehicleMake *string `json:"vehicle_make,omitempty"` + + // Vehicle model + VehicleModel *string `json:"vehicle_model,omitempty"` + + // Vehicle nickname (ex. 'Large box truck') + VehicleNickname *string `json:"vehicle_nickname,omitempty"` + + // Full Weight Ticket Date + // Example: 2018-04-26 + // Format: date + WeightTicketDate *strfmt.Date `json:"weight_ticket_date,omitempty"` + + // weight ticket set type + // Required: true + WeightTicketSetType *WeightTicketSetType `json:"weight_ticket_set_type"` +} + +// Validate validates this create weight ticket documents payload +func (m *CreateWeightTicketDocumentsPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeightTicketMissing(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeightTicketMissing(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonallyProcuredMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTrailerOwnershipMissing(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadIds(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTicketDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTicketSetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("empty_weight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateEmptyWeightTicketMissing(formats strfmt.Registry) error { + + if err := validate.Required("empty_weight_ticket_missing", "body", m.EmptyWeightTicketMissing); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("full_weight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateFullWeightTicketMissing(formats strfmt.Registry) error { + + if err := validate.Required("full_weight_ticket_missing", "body", m.FullWeightTicketMissing); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { + + if err := validate.Required("personally_procured_move_id", "body", m.PersonallyProcuredMoveID); err != nil { + return err + } + + if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateTrailerOwnershipMissing(formats strfmt.Registry) error { + + if err := validate.Required("trailer_ownership_missing", "body", m.TrailerOwnershipMissing); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateUploadIds(formats strfmt.Registry) error { + if swag.IsZero(m.UploadIds) { // not required + return nil + } + + for i := 0; i < len(m.UploadIds); i++ { + + if err := validate.FormatOf("upload_ids"+"."+strconv.Itoa(i), "body", "uuid", m.UploadIds[i].String(), formats); err != nil { + return err + } + + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateWeightTicketDate(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTicketDate) { // not required + return nil + } + + if err := validate.FormatOf("weight_ticket_date", "body", "date", m.WeightTicketDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) validateWeightTicketSetType(formats strfmt.Registry) error { + + if err := validate.Required("weight_ticket_set_type", "body", m.WeightTicketSetType); err != nil { + return err + } + + if err := validate.Required("weight_ticket_set_type", "body", m.WeightTicketSetType); err != nil { + return err + } + + if m.WeightTicketSetType != nil { + if err := m.WeightTicketSetType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_ticket_set_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_ticket_set_type") + } + return err + } + } + + return nil +} + +// ContextValidate validate this create weight ticket documents payload based on the context it is used +func (m *CreateWeightTicketDocumentsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateWeightTicketSetType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *CreateWeightTicketDocumentsPayload) contextValidateWeightTicketSetType(ctx context.Context, formats strfmt.Registry) error { + + if m.WeightTicketSetType != nil { + + if err := m.WeightTicketSetType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_ticket_set_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_ticket_set_type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *CreateWeightTicketDocumentsPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *CreateWeightTicketDocumentsPayload) UnmarshalBinary(b []byte) error { + var res CreateWeightTicketDocumentsPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/dept_indicator.go b/pkg/gen/internalmessages/dept_indicator.go new file mode 100644 index 00000000000..9fbe14d6834 --- /dev/null +++ b/pkg/gen/internalmessages/dept_indicator.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// DeptIndicator Dept. indicator +// +// swagger:model DeptIndicator +type DeptIndicator string + +func NewDeptIndicator(value DeptIndicator) *DeptIndicator { + return &value +} + +// Pointer returns a pointer to a freshly-allocated DeptIndicator. +func (m DeptIndicator) Pointer() *DeptIndicator { + return &m +} + +const ( + + // DeptIndicatorNAVYANDMARINES captures enum value "NAVY_AND_MARINES" + DeptIndicatorNAVYANDMARINES DeptIndicator = "NAVY_AND_MARINES" + + // DeptIndicatorARMY captures enum value "ARMY" + DeptIndicatorARMY DeptIndicator = "ARMY" + + // DeptIndicatorARMYCORPSOFENGINEERS captures enum value "ARMY_CORPS_OF_ENGINEERS" + DeptIndicatorARMYCORPSOFENGINEERS DeptIndicator = "ARMY_CORPS_OF_ENGINEERS" + + // DeptIndicatorAIRANDSPACEFORCE captures enum value "AIR_AND_SPACE_FORCE" + DeptIndicatorAIRANDSPACEFORCE DeptIndicator = "AIR_AND_SPACE_FORCE" + + // DeptIndicatorCOASTGUARD captures enum value "COAST_GUARD" + DeptIndicatorCOASTGUARD DeptIndicator = "COAST_GUARD" + + // DeptIndicatorOFFICEOFSECRETARYOFDEFENSE captures enum value "OFFICE_OF_SECRETARY_OF_DEFENSE" + DeptIndicatorOFFICEOFSECRETARYOFDEFENSE DeptIndicator = "OFFICE_OF_SECRETARY_OF_DEFENSE" +) + +// for schema +var deptIndicatorEnum []interface{} + +func init() { + var res []DeptIndicator + if err := json.Unmarshal([]byte(`["NAVY_AND_MARINES","ARMY","ARMY_CORPS_OF_ENGINEERS","AIR_AND_SPACE_FORCE","COAST_GUARD","OFFICE_OF_SECRETARY_OF_DEFENSE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + deptIndicatorEnum = append(deptIndicatorEnum, v) + } +} + +func (m DeptIndicator) validateDeptIndicatorEnum(path, location string, value DeptIndicator) error { + if err := validate.EnumCase(path, location, value, deptIndicatorEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this dept indicator +func (m DeptIndicator) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateDeptIndicatorEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this dept indicator based on context it is used +func (m DeptIndicator) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/document.go b/pkg/gen/internalmessages/document.go new file mode 100644 index 00000000000..20005ca96d6 --- /dev/null +++ b/pkg/gen/internalmessages/document.go @@ -0,0 +1,169 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Document document +// +// swagger:model Document +type Document struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // The service member this document belongs to + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"service_member_id"` + + // uploads + // Required: true + Uploads []*Upload `json:"uploads"` +} + +// Validate validates this document +func (m *Document) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Document) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Document) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Document) validateUploads(formats strfmt.Registry) error { + + if err := validate.Required("uploads", "body", m.Uploads); err != nil { + return err + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this document based on the context it is used +func (m *Document) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Document) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Document) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Document) UnmarshalBinary(b []byte) error { + var res Document + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/duty_location_payload.go b/pkg/gen/internalmessages/duty_location_payload.go new file mode 100644 index 00000000000..fbc69c41949 --- /dev/null +++ b/pkg/gen/internalmessages/duty_location_payload.go @@ -0,0 +1,346 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// DutyLocationPayload duty location payload +// +// swagger:model DutyLocationPayload +type DutyLocationPayload struct { + + // address + Address *Address `json:"address,omitempty"` + + // address id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + AddressID *strfmt.UUID `json:"address_id"` + + // affiliation + // Required: true + Affiliation *Affiliation `json:"affiliation"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // name + // Example: Fort Bragg North Station + // Required: true + Name *string `json:"name"` + + // provides services counseling + ProvidesServicesCounseling bool `json:"provides_services_counseling,omitempty"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportation_office,omitempty"` + + // transportation office id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportation_office_id,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this duty location payload +func (m *DutyLocationPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAddressID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAffiliation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocationPayload) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *DutyLocationPayload) validateAddressID(formats strfmt.Registry) error { + + if err := validate.Required("address_id", "body", m.AddressID); err != nil { + return err + } + + if err := validate.FormatOf("address_id", "body", "uuid", m.AddressID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocationPayload) validateAffiliation(formats strfmt.Registry) error { + + if err := validate.Required("affiliation", "body", m.Affiliation); err != nil { + return err + } + + if err := validate.Required("affiliation", "body", m.Affiliation); err != nil { + return err + } + + if m.Affiliation != nil { + if err := m.Affiliation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *DutyLocationPayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocationPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocationPayload) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *DutyLocationPayload) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office") + } + return err + } + } + + return nil +} + +func (m *DutyLocationPayload) validateTransportationOfficeID(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeID) { // not required + return nil + } + + if err := validate.FormatOf("transportation_office_id", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *DutyLocationPayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this duty location payload based on the context it is used +func (m *DutyLocationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAffiliation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *DutyLocationPayload) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *DutyLocationPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { + + if m.Affiliation != nil { + + if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *DutyLocationPayload) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *DutyLocationPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *DutyLocationPayload) UnmarshalBinary(b []byte) error { + var res DutyLocationPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/duty_locations_payload.go b/pkg/gen/internalmessages/duty_locations_payload.go new file mode 100644 index 00000000000..d8419ed65ce --- /dev/null +++ b/pkg/gen/internalmessages/duty_locations_payload.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// DutyLocationsPayload duty locations payload +// +// swagger:model DutyLocationsPayload +type DutyLocationsPayload []*DutyLocationPayload + +// Validate validates this duty locations payload +func (m DutyLocationsPayload) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this duty locations payload based on the context it is used +func (m DutyLocationsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/entitlement.go b/pkg/gen/internalmessages/entitlement.go new file mode 100644 index 00000000000..703b403758f --- /dev/null +++ b/pkg/gen/internalmessages/entitlement.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// Entitlement entitlement +// +// swagger:model Entitlement +type Entitlement struct { + + // Indicates if the move entitlement allows dependents to travel to the new Permanent Duty Station (PDS). This is only present on OCONUS moves. + // Example: true + AccompaniedTour *bool `json:"accompanied_tour,omitempty"` + + // Indicates the number of dependents of the age twelve or older for a move. This is only present on OCONUS moves. + // Example: 3 + DependentsTwelveAndOver *int64 `json:"dependents_twelve_and_over,omitempty"` + + // Indicates the number of dependents under the age of twelve for a move. This is only present on OCONUS moves. + // Example: 5 + DependentsUnderTwelve *int64 `json:"dependents_under_twelve,omitempty"` + + // Pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade + // + // Example: 2000 + ProGear *int64 `json:"proGear,omitempty"` + + // Spouse's pro-gear weight limit as set by an Office user, distinct from the service member's default weight allotment determined by pay grade + // + // Example: 500 + ProGearSpouse *int64 `json:"proGearSpouse,omitempty"` + + // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. + // Example: 3 + UbAllowance *int64 `json:"ub_allowance,omitempty"` +} + +// Validate validates this entitlement +func (m *Entitlement) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this entitlement based on context it is used +func (m *Entitlement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Entitlement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Entitlement) UnmarshalBinary(b []byte) error { + var res Entitlement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/error.go b/pkg/gen/internalmessages/error.go new file mode 100644 index 00000000000..3d1ef7509ac --- /dev/null +++ b/pkg/gen/internalmessages/error.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // detail + // Required: true + Detail *string `json:"detail"` + + // instance + // Format: uuid + Instance strfmt.UUID `json:"instance,omitempty"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstance(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateDetail(formats strfmt.Registry) error { + + if err := validate.Required("detail", "body", m.Detail); err != nil { + return err + } + + return nil +} + +func (m *Error) validateInstance(formats strfmt.Registry) error { + if swag.IsZero(m.Instance) { // not required + return nil + } + + if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Error) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/feature_flag_boolean.go b/pkg/gen/internalmessages/feature_flag_boolean.go new file mode 100644 index 00000000000..13b43ec4738 --- /dev/null +++ b/pkg/gen/internalmessages/feature_flag_boolean.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FeatureFlagBoolean A feature flag +// +// swagger:model FeatureFlagBoolean +type FeatureFlagBoolean struct { + + // entity + // Example: 11111111-1111-1111-1111-111111111111 + // Required: true + Entity *string `json:"entity"` + + // key + // Example: flag + // Required: true + Key *string `json:"key"` + + // match + // Example: true + // Required: true + Match *bool `json:"match"` + + // namespace + // Example: test + // Required: true + Namespace *string `json:"namespace"` +} + +// Validate validates this feature flag boolean +func (m *FeatureFlagBoolean) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEntity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMatch(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FeatureFlagBoolean) validateEntity(formats strfmt.Registry) error { + + if err := validate.Required("entity", "body", m.Entity); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagBoolean) validateKey(formats strfmt.Registry) error { + + if err := validate.Required("key", "body", m.Key); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagBoolean) validateMatch(formats strfmt.Registry) error { + + if err := validate.Required("match", "body", m.Match); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagBoolean) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this feature flag boolean based on context it is used +func (m *FeatureFlagBoolean) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FeatureFlagBoolean) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FeatureFlagBoolean) UnmarshalBinary(b []byte) error { + var res FeatureFlagBoolean + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/feature_flag_variant.go b/pkg/gen/internalmessages/feature_flag_variant.go new file mode 100644 index 00000000000..e0be90acfd3 --- /dev/null +++ b/pkg/gen/internalmessages/feature_flag_variant.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// FeatureFlagVariant A feature flag +// +// swagger:model FeatureFlagVariant +type FeatureFlagVariant struct { + + // entity + // Example: 11111111-1111-1111-1111-111111111111 + // Required: true + Entity *string `json:"entity"` + + // key + // Example: flag + // Required: true + Key *string `json:"key"` + + // match + // Example: true + // Required: true + Match *bool `json:"match"` + + // namespace + // Example: test + // Required: true + Namespace *string `json:"namespace"` + + // variant + // Example: myval + // Required: true + Variant *string `json:"variant"` +} + +// Validate validates this feature flag variant +func (m *FeatureFlagVariant) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEntity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMatch(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNamespace(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVariant(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *FeatureFlagVariant) validateEntity(formats strfmt.Registry) error { + + if err := validate.Required("entity", "body", m.Entity); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagVariant) validateKey(formats strfmt.Registry) error { + + if err := validate.Required("key", "body", m.Key); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagVariant) validateMatch(formats strfmt.Registry) error { + + if err := validate.Required("match", "body", m.Match); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagVariant) validateNamespace(formats strfmt.Registry) error { + + if err := validate.Required("namespace", "body", m.Namespace); err != nil { + return err + } + + return nil +} + +func (m *FeatureFlagVariant) validateVariant(formats strfmt.Registry) error { + + if err := validate.Required("variant", "body", m.Variant); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this feature flag variant based on context it is used +func (m *FeatureFlagVariant) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *FeatureFlagVariant) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *FeatureFlagVariant) UnmarshalBinary(b []byte) error { + var res FeatureFlagVariant + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/index_entitlements.go b/pkg/gen/internalmessages/index_entitlements.go new file mode 100644 index 00000000000..c20f2fd5056 --- /dev/null +++ b/pkg/gen/internalmessages/index_entitlements.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// IndexEntitlements index entitlements +// +// swagger:model IndexEntitlements +type IndexEntitlements map[string]WeightAllotment + +// Validate validates this index entitlements +func (m IndexEntitlements) Validate(formats strfmt.Registry) error { + var res []error + + for k := range m { + + if err := validate.Required(k, "body", m[k]); err != nil { + return err + } + if val, ok := m[k]; ok { + if err := val.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(k) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(k) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this index entitlements based on the context it is used +func (m IndexEntitlements) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for k := range m { + + if val, ok := m[k]; ok { + if err := val.ContextValidate(ctx, formats); err != nil { + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/index_moves_payload.go b/pkg/gen/internalmessages/index_moves_payload.go new file mode 100644 index 00000000000..38f88edb504 --- /dev/null +++ b/pkg/gen/internalmessages/index_moves_payload.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IndexMovesPayload index moves payload +// +// swagger:model IndexMovesPayload +type IndexMovesPayload []*MovePayload + +// Validate validates this index moves payload +func (m IndexMovesPayload) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this index moves payload based on the context it is used +func (m IndexMovesPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go b/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go new file mode 100644 index 00000000000..ea51e10a475 --- /dev/null +++ b/pkg/gen/internalmessages/index_service_member_backup_contacts_payload.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// IndexServiceMemberBackupContactsPayload index service member backup contacts payload +// +// swagger:model IndexServiceMemberBackupContactsPayload +type IndexServiceMemberBackupContactsPayload []*ServiceMemberBackupContactPayload + +// Validate validates this index service member backup contacts payload +func (m IndexServiceMemberBackupContactsPayload) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this index service member backup contacts payload based on the context it is used +func (m IndexServiceMemberBackupContactsPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/internal_move.go b/pkg/gen/internalmessages/internal_move.go new file mode 100644 index 00000000000..3a2bc0e44f0 --- /dev/null +++ b/pkg/gen/internalmessages/internal_move.go @@ -0,0 +1,436 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// InternalMove internal move +// +// swagger:model InternalMove +type InternalMove struct { + + // closeout office + CloseoutOffice *TransportationOffice `json:"closeoutOffice,omitempty"` + + // counseling office + CounselingOffice *TransportationOffice `json:"counselingOffice,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + // mto shipments + MtoShipments MTOShipments `json:"mtoShipments,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // orders + Orders interface{} `json:"orders,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // status + // Read Only: true + Status string `json:"status,omitempty"` + + // submitted at + // Read Only: true + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this internal move +func (m *InternalMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloseoutOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCounselingOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalMove) validateCloseoutOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if m.CloseoutOffice != nil { + if err := m.CloseoutOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeoutOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeoutOffice") + } + return err + } + } + + return nil +} + +func (m *InternalMove) validateCounselingOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if m.CounselingOffice != nil { + if err := m.CounselingOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counselingOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counselingOffice") + } + return err + } + } + + return nil +} + +func (m *InternalMove) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) 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 *InternalMove) validateMtoShipments(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipments) { // not required + return nil + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *InternalMove) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this internal move based on the context it is used +func (m *InternalMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselingOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubmittedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *InternalMove) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CloseoutOffice != nil { + + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeoutOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeoutOffice") + } + return err + } + } + + return nil +} + +func (m *InternalMove) contextValidateCounselingOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CounselingOffice != nil { + + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if err := m.CounselingOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counselingOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counselingOffice") + } + return err + } + } + + return nil +} + +func (m *InternalMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *InternalMove) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateSubmittedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "submittedAt", "body", m.SubmittedAt); err != nil { + return err + } + + return nil +} + +func (m *InternalMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *InternalMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InternalMove) UnmarshalBinary(b []byte) error { + var res InternalMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/invalid_request_response_payload.go b/pkg/gen/internalmessages/invalid_request_response_payload.go new file mode 100644 index 00000000000..724f9f641e3 --- /dev/null +++ b/pkg/gen/internalmessages/invalid_request_response_payload.go @@ -0,0 +1,50 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// InvalidRequestResponsePayload invalid request response payload +// +// swagger:model InvalidRequestResponsePayload +type InvalidRequestResponsePayload struct { + + // errors + Errors map[string]string `json:"errors,omitempty"` +} + +// Validate validates this invalid request response payload +func (m *InvalidRequestResponsePayload) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this invalid request response payload based on context it is used +func (m *InvalidRequestResponsePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *InvalidRequestResponsePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *InvalidRequestResponsePayload) UnmarshalBinary(b []byte) error { + var res InvalidRequestResponsePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/is_date_weekend_holiday_info.go b/pkg/gen/internalmessages/is_date_weekend_holiday_info.go new file mode 100644 index 00000000000..fac465ba617 --- /dev/null +++ b/pkg/gen/internalmessages/is_date_weekend_holiday_info.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// IsDateWeekendHolidayInfo is date weekend holiday info +// +// swagger:model IsDateWeekendHolidayInfo +type IsDateWeekendHolidayInfo struct { + + // country code + // Required: true + CountryCode *string `json:"country_code"` + + // country name + // Required: true + CountryName *string `json:"country_name"` + + // date + // Example: 2018-09-25 + // Required: true + // Format: date + Date *strfmt.Date `json:"date"` + + // details + Details string `json:"details,omitempty"` + + // is holiday + // Required: true + IsHoliday *bool `json:"is_holiday"` + + // is weekend + // Required: true + IsWeekend *bool `json:"is_weekend"` +} + +// Validate validates this is date weekend holiday info +func (m *IsDateWeekendHolidayInfo) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCountryCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCountryName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsHoliday(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsWeekend(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateCountryCode(formats strfmt.Registry) error { + + if err := validate.Required("country_code", "body", m.CountryCode); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateCountryName(formats strfmt.Registry) error { + + if err := validate.Required("country_name", "body", m.CountryName); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateIsHoliday(formats strfmt.Registry) error { + + if err := validate.Required("is_holiday", "body", m.IsHoliday); err != nil { + return err + } + + return nil +} + +func (m *IsDateWeekendHolidayInfo) validateIsWeekend(formats strfmt.Registry) error { + + if err := validate.Required("is_weekend", "body", m.IsWeekend); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this is date weekend holiday info based on context it is used +func (m *IsDateWeekendHolidayInfo) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *IsDateWeekendHolidayInfo) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *IsDateWeekendHolidayInfo) UnmarshalBinary(b []byte) error { + var res IsDateWeekendHolidayInfo + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/logged_in_user_payload.go b/pkg/gen/internalmessages/logged_in_user_payload.go new file mode 100644 index 00000000000..95dc5a0fb49 --- /dev/null +++ b/pkg/gen/internalmessages/logged_in_user_payload.go @@ -0,0 +1,365 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// LoggedInUserPayload logged in user payload +// +// swagger:model LoggedInUserPayload +type LoggedInUserPayload struct { + + // email + // Example: john_bob@example.com + // Read Only: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email string `json:"email,omitempty"` + + // first name + // Example: John + // Read Only: true + FirstName string `json:"first_name,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // office user + OfficeUser *OfficeUser `json:"office_user,omitempty"` + + // permissions + Permissions []string `json:"permissions"` + + // privileges + Privileges []*Privilege `json:"privileges"` + + // roles + Roles []*Role `json:"roles"` + + // service member + ServiceMember *ServiceMemberPayload `json:"service_member,omitempty"` +} + +// Validate validates this logged in user payload +func (m *LoggedInUserPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUser(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrivileges(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoles(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMember(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoggedInUserPayload) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *LoggedInUserPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *LoggedInUserPayload) validateOfficeUser(formats strfmt.Registry) error { + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if m.OfficeUser != nil { + if err := m.OfficeUser.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("office_user") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("office_user") + } + return err + } + } + + return nil +} + +func (m *LoggedInUserPayload) validatePrivileges(formats strfmt.Registry) error { + if swag.IsZero(m.Privileges) { // not required + return nil + } + + for i := 0; i < len(m.Privileges); i++ { + if swag.IsZero(m.Privileges[i]) { // not required + continue + } + + if m.Privileges[i] != nil { + if err := m.Privileges[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoggedInUserPayload) validateRoles(formats strfmt.Registry) error { + if swag.IsZero(m.Roles) { // not required + return nil + } + + for i := 0; i < len(m.Roles); i++ { + if swag.IsZero(m.Roles[i]) { // not required + continue + } + + if m.Roles[i] != nil { + if err := m.Roles[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoggedInUserPayload) validateServiceMember(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMember) { // not required + return nil + } + + if m.ServiceMember != nil { + if err := m.ServiceMember.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_member") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_member") + } + return err + } + } + + return nil +} + +// ContextValidate validate this logged in user payload based on the context it is used +func (m *LoggedInUserPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEmail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirstName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOfficeUser(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrivileges(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRoles(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceMember(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *LoggedInUserPayload) contextValidateEmail(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "email", "body", string(m.Email)); err != nil { + return err + } + + return nil +} + +func (m *LoggedInUserPayload) contextValidateFirstName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "first_name", "body", string(m.FirstName)); err != nil { + return err + } + + return nil +} + +func (m *LoggedInUserPayload) contextValidateOfficeUser(ctx context.Context, formats strfmt.Registry) error { + + if m.OfficeUser != nil { + + if swag.IsZero(m.OfficeUser) { // not required + return nil + } + + if err := m.OfficeUser.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("office_user") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("office_user") + } + return err + } + } + + return nil +} + +func (m *LoggedInUserPayload) contextValidatePrivileges(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Privileges); i++ { + + if m.Privileges[i] != nil { + + if swag.IsZero(m.Privileges[i]) { // not required + return nil + } + + if err := m.Privileges[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("privileges" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("privileges" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoggedInUserPayload) contextValidateRoles(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Roles); i++ { + + if m.Roles[i] != nil { + + if swag.IsZero(m.Roles[i]) { // not required + return nil + } + + if err := m.Roles[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("roles" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("roles" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *LoggedInUserPayload) contextValidateServiceMember(ctx context.Context, formats strfmt.Registry) error { + + if m.ServiceMember != nil { + + if swag.IsZero(m.ServiceMember) { // not required + return nil + } + + if err := m.ServiceMember.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("service_member") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("service_member") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *LoggedInUserPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *LoggedInUserPayload) UnmarshalBinary(b []byte) error { + var res LoggedInUserPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agent.go b/pkg/gen/internalmessages/m_t_o_agent.go new file mode 100644 index 00000000000..1f6da8f4e7d --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agent.go @@ -0,0 +1,275 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgent m t o agent +// +// swagger:model MTOAgent +type MTOAgent struct { + + // agent type + AgentType MTOAgentType `json:"agentType,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // email + // Pattern: (^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$) + Email *string `json:"email,omitempty"` + + // first name + FirstName *string `json:"firstName,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName *string `json:"lastName,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // phone + // Pattern: (^[2-9]\d{2}-\d{3}-\d{4}$)|(^$) + Phone *string `json:"phone,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o agent +func (m *MTOAgent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `(^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$)|(^$)`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `(^[2-9]\d{2}-\d{3}-\d{4}$)|(^$)`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o agent based on the context it is used +func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOAgent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOAgent) UnmarshalBinary(b []byte) error { + var res MTOAgent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agent_type.go b/pkg/gen/internalmessages/m_t_o_agent_type.go new file mode 100644 index 00000000000..12c0138a1c7 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agent_type.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOAgentType MTO Agent Type +// Example: RELEASING_AGENT +// +// swagger:model MTOAgentType +type MTOAgentType string + +func NewMTOAgentType(value MTOAgentType) *MTOAgentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOAgentType. +func (m MTOAgentType) Pointer() *MTOAgentType { + return &m +} + +const ( + + // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" + + // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" +) + +// for schema +var mTOAgentTypeEnum []interface{} + +func init() { + var res []MTOAgentType + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) + } +} + +func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { + if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o agent type +func (m MTOAgentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o agent type based on context it is used +func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_agents.go b/pkg/gen/internalmessages/m_t_o_agents.go new file mode 100644 index 00000000000..00b0256a6c7 --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_agents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOAgents m t o agents +// +// swagger:model MTOAgents +type MTOAgents []*MTOAgent + +// Validate validates this m t o agents +func (m MTOAgents) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents based on the context it is used +func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipment.go b/pkg/gen/internalmessages/m_t_o_shipment.go new file mode 100644 index 00000000000..8e4499f969d --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipment.go @@ -0,0 +1,967 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipment m t o shipment +// +// swagger:model MTOShipment +type MTOShipment struct { + + // actual pro gear weight + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // actual spouse pro gear weight + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // boat shipment + BoatShipment *BoatShipment `json:"boatShipment,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // customer remarks + // Example: handle with care + // Read Only: true + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // e tag + ETag string `json:"eTag,omitempty"` + + // has secondary delivery address + HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary delivery address + HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Single-letter designator for domestic (d) or international (i) shipments + // Example: d + // Enum: [d i] + MarketCode string `json:"marketCode,omitempty"` + + // mobile home shipment + MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` + + // move task order ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` + + // requested delivery date + // Read Only: true + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Read Only: true + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // secondary delivery address + SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // shipment locator + // Example: 1K43AR-01 + // Read Only: true + ShipmentLocator *string `json:"shipmentLocator,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // status + Status MTOShipmentStatus `json:"status,omitempty"` + + // tertiary delivery address + TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o shipment +func (m *MTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) 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 +} + +var mTOShipmentTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeMarketCodePropEnum = append(mTOShipmentTypeMarketCodePropEnum, v) + } +} + +const ( + + // MTOShipmentMarketCodeD captures enum value "d" + MTOShipmentMarketCodeD string = "d" + + // MTOShipmentMarketCodeI captures enum value "i" + MTOShipmentMarketCodeI string = "i" +) + +// prop value enum +func (m *MTOShipment) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipment) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if m.SecondaryDeliveryAddress != nil { + if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipment) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if m.TertiaryDeliveryAddress != nil { + if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment based on the context it is used +func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentLocator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDeliveryAddress != nil { + + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateShipmentLocator(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentLocator", "body", m.ShipmentLocator); err != nil { + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDeliveryAddress != nil { + + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipment) UnmarshalBinary(b []byte) error { + var res MTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_status.go b/pkg/gen/internalmessages/m_t_o_shipment_status.go new file mode 100644 index 00000000000..94ccb7997bd --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipment_status.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentStatus m t o shipment status +// +// swagger:model MTOShipmentStatus +type MTOShipmentStatus string + +func NewMTOShipmentStatus(value MTOShipmentStatus) *MTOShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentStatus. +func (m MTOShipmentStatus) Pointer() *MTOShipmentStatus { + return &m +} + +const ( + + // MTOShipmentStatusDRAFT captures enum value "DRAFT" + MTOShipmentStatusDRAFT MTOShipmentStatus = "DRAFT" + + // MTOShipmentStatusAPPROVED captures enum value "APPROVED" + MTOShipmentStatusAPPROVED MTOShipmentStatus = "APPROVED" + + // MTOShipmentStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentStatusSUBMITTED MTOShipmentStatus = "SUBMITTED" + + // MTOShipmentStatusREJECTED captures enum value "REJECTED" + MTOShipmentStatusREJECTED MTOShipmentStatus = "REJECTED" +) + +// for schema +var mTOShipmentStatusEnum []interface{} + +func init() { + var res []MTOShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","APPROVED","SUBMITTED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentStatusEnum = append(mTOShipmentStatusEnum, v) + } +} + +func (m MTOShipmentStatus) validateMTOShipmentStatusEnum(path, location string, value MTOShipmentStatus) error { + if err := validate.EnumCase(path, location, value, mTOShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment status +func (m MTOShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipment status based on the context it is used +func (m MTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", MTOShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipment_type.go b/pkg/gen/internalmessages/m_t_o_shipment_type.go new file mode 100644 index 00000000000..a3853e1f64c --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipment_type.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType Shipment Type +// Example: HHG +// +// swagger:model MTOShipmentType +type MTOShipmentType string + +func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType. +func (m MTOShipmentType) Pointer() *MTOShipmentType { + return &m +} + +const ( + + // MTOShipmentTypeHHG captures enum value "HHG" + MTOShipmentTypeHHG MTOShipmentType = "HHG" + + // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" + + // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentTypePPM captures enum value "PPM" + MTOShipmentTypePPM MTOShipmentType = "PPM" + + // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" + + // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" + + // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" + + // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" +) + +// for schema +var mTOShipmentTypeEnum []interface{} + +func init() { + var res []MTOShipmentType + if err := json.Unmarshal([]byte(`["HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","PPM","BOAT_HAUL_AWAY","BOAT_TOW_AWAY","MOBILE_HOME","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) + } +} + +func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type +func (m MTOShipmentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type based on context it is used +func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/m_t_o_shipments.go b/pkg/gen/internalmessages/m_t_o_shipments.go new file mode 100644 index 00000000000..415b37f9cdc --- /dev/null +++ b/pkg/gen/internalmessages/m_t_o_shipments.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipments m t o shipments +// +// swagger:model MTOShipments +type MTOShipments []*MTOShipment + +// Validate validates this m t o shipments +func (m MTOShipments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments based on the context it is used +func (m MTOShipments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/method_of_receipt.go b/pkg/gen/internalmessages/method_of_receipt.go new file mode 100644 index 00000000000..5cb2900fec3 --- /dev/null +++ b/pkg/gen/internalmessages/method_of_receipt.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MethodOfReceipt Method of Receipt +// +// swagger:model MethodOfReceipt +type MethodOfReceipt string + +func NewMethodOfReceipt(value MethodOfReceipt) *MethodOfReceipt { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MethodOfReceipt. +func (m MethodOfReceipt) Pointer() *MethodOfReceipt { + return &m +} + +const ( + + // MethodOfReceiptMILPAY captures enum value "MIL_PAY" + MethodOfReceiptMILPAY MethodOfReceipt = "MIL_PAY" + + // MethodOfReceiptOTHERDD captures enum value "OTHER_DD" + MethodOfReceiptOTHERDD MethodOfReceipt = "OTHER_DD" + + // MethodOfReceiptGTCC captures enum value "GTCC" + MethodOfReceiptGTCC MethodOfReceipt = "GTCC" +) + +// for schema +var methodOfReceiptEnum []interface{} + +func init() { + var res []MethodOfReceipt + if err := json.Unmarshal([]byte(`["MIL_PAY","OTHER_DD","GTCC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + methodOfReceiptEnum = append(methodOfReceiptEnum, v) + } +} + +func (m MethodOfReceipt) validateMethodOfReceiptEnum(path, location string, value MethodOfReceipt) error { + if err := validate.EnumCase(path, location, value, methodOfReceiptEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this method of receipt +func (m MethodOfReceipt) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMethodOfReceiptEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this method of receipt based on context it is used +func (m MethodOfReceipt) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/mobile_home.go b/pkg/gen/internalmessages/mobile_home.go new file mode 100644 index 00000000000..f2a2f7b66cf --- /dev/null +++ b/pkg/gen/internalmessages/mobile_home.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. +// +// swagger:model MobileHome +type MobileHome struct { + + // Timestamp of when a property of this object was created (UTC) + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // height in inches + HeightInInches int64 `json:"heightInInches,omitempty"` + + // Primary auto-generated unique identifier of the Mobile Home object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // length in inches + LengthInInches int64 `json:"lengthInInches,omitempty"` + + // The make of the mobile home + Make string `json:"make,omitempty"` + + // The model of the mobile home. + Model string `json:"model,omitempty"` + + // The id of the parent MTOShipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // width in inches + WidthInInches int64 `json:"widthInInches,omitempty"` + + // The year the mobile home was made. + Year int64 `json:"year,omitempty"` +} + +// Validate validates this mobile home +func (m *MobileHome) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this mobile home based on the context it is used +func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MobileHome) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MobileHome) UnmarshalBinary(b []byte) error { + var res MobileHome + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/move_document_payload.go b/pkg/gen/internalmessages/move_document_payload.go new file mode 100644 index 00000000000..0b8153c0219 --- /dev/null +++ b/pkg/gen/internalmessages/move_document_payload.go @@ -0,0 +1,597 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveDocumentPayload move document payload +// +// swagger:model MoveDocumentPayload +type MoveDocumentPayload struct { + + // document + // Required: true + Document *Document `json:"document"` + + // Empty weight + // Minimum: 0 + EmptyWeight *int64 `json:"empty_weight,omitempty"` + + // missing empty weight ticket + EmptyWeightTicketMissing *bool `json:"empty_weight_ticket_missing,omitempty"` + + // Full weight + // Minimum: 0 + FullWeight *int64 `json:"full_weight,omitempty"` + + // missing full weight ticket + FullWeightTicketMissing *bool `json:"full_weight_ticket_missing,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // move document type + // Required: true + MoveDocumentType *MoveDocumentType `json:"move_document_type"` + + // move id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + MoveID *strfmt.UUID `json:"move_id"` + + // moving expense type + MovingExpenseType MovingExpenseType `json:"moving_expense_type,omitempty"` + + // Notes + // Example: This document is good to go! + Notes *string `json:"notes,omitempty"` + + // Payment Method + // Enum: [OTHER GTCC] + PaymentMethod string `json:"payment_method,omitempty"` + + // personally procured move id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` + + // missing expense receipt + ReceiptMissing *bool `json:"receipt_missing,omitempty"` + + // Requested Amount + // + // unit is cents + // Minimum: 1 + RequestedAmountCents int64 `json:"requested_amount_cents,omitempty"` + + // status + // Required: true + Status *MoveDocumentStatus `json:"status"` + + // End date of storage for storage expenses + // Example: 2018-04-26 + // Format: date + StorageEndDate *strfmt.Date `json:"storage_end_date,omitempty"` + + // Start date of storage for storage expenses + // Example: 2018-04-26 + // Format: date + StorageStartDate *strfmt.Date `json:"storage_start_date,omitempty"` + + // Document title + // Example: very_useful_document.pdf + // Required: true + Title *string `json:"title"` + + // missing trailer ownership documentation + TrailerOwnershipMissing *bool `json:"trailer_ownership_missing,omitempty"` + + // Vehicle make + VehicleMake *string `json:"vehicle_make,omitempty"` + + // Vehicle model + VehicleModel *string `json:"vehicle_model,omitempty"` + + // Nickname (ex. "15-foot truck") + VehicleNickname *string `json:"vehicle_nickname,omitempty"` + + // Weight ticket date + // Example: 2018-04-26 + // Format: date + WeightTicketDate *strfmt.Date `json:"weight_ticket_date,omitempty"` + + // weight ticket set type + WeightTicketSetType *WeightTicketSetType `json:"weight_ticket_set_type,omitempty"` +} + +// Validate validates this move document payload +func (m *MoveDocumentPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveDocumentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentMethod(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonallyProcuredMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAmountCents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTicketDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTicketSetType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveDocumentPayload) validateDocument(formats strfmt.Registry) error { + + if err := validate.Required("document", "body", m.Document); err != nil { + return err + } + + if m.Document != nil { + if err := m.Document.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("empty_weight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("full_weight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateMoveDocumentType(formats strfmt.Registry) error { + + if err := validate.Required("move_document_type", "body", m.MoveDocumentType); err != nil { + return err + } + + if err := validate.Required("move_document_type", "body", m.MoveDocumentType); err != nil { + return err + } + + if m.MoveDocumentType != nil { + if err := m.MoveDocumentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("move_document_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("move_document_type") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("move_id", "body", m.MoveID); err != nil { + return err + } + + if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if err := m.MovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moving_expense_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moving_expense_type") + } + return err + } + + return nil +} + +var moveDocumentPayloadTypePaymentMethodPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["OTHER","GTCC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveDocumentPayloadTypePaymentMethodPropEnum = append(moveDocumentPayloadTypePaymentMethodPropEnum, v) + } +} + +const ( + + // MoveDocumentPayloadPaymentMethodOTHER captures enum value "OTHER" + MoveDocumentPayloadPaymentMethodOTHER string = "OTHER" + + // MoveDocumentPayloadPaymentMethodGTCC captures enum value "GTCC" + MoveDocumentPayloadPaymentMethodGTCC string = "GTCC" +) + +// prop value enum +func (m *MoveDocumentPayload) validatePaymentMethodEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, moveDocumentPayloadTypePaymentMethodPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MoveDocumentPayload) validatePaymentMethod(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentMethod) { // not required + return nil + } + + // value enum + if err := m.validatePaymentMethodEnum("payment_method", "body", m.PaymentMethod); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.PersonallyProcuredMoveID) { // not required + return nil + } + + if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateRequestedAmountCents(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAmountCents) { // not required + return nil + } + + if err := validate.MinimumInt("requested_amount_cents", "body", m.RequestedAmountCents, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) validateStorageEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.StorageEndDate) { // not required + return nil + } + + if err := validate.FormatOf("storage_end_date", "body", "date", m.StorageEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateStorageStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.StorageStartDate) { // not required + return nil + } + + if err := validate.FormatOf("storage_start_date", "body", "date", m.StorageStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateWeightTicketDate(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTicketDate) { // not required + return nil + } + + if err := validate.FormatOf("weight_ticket_date", "body", "date", m.WeightTicketDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveDocumentPayload) validateWeightTicketSetType(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTicketSetType) { // not required + return nil + } + + if m.WeightTicketSetType != nil { + if err := m.WeightTicketSetType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_ticket_set_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_ticket_set_type") + } + return err + } + } + + return nil +} + +// ContextValidate validate this move document payload based on the context it is used +func (m *MoveDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveDocumentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightTicketSetType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveDocumentPayload) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.Document != nil { + + if err := m.Document.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) contextValidateMoveDocumentType(ctx context.Context, formats strfmt.Registry) error { + + if m.MoveDocumentType != nil { + + if err := m.MoveDocumentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("move_document_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("move_document_type") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moving_expense_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moving_expense_type") + } + return err + } + + return nil +} + +func (m *MoveDocumentPayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MoveDocumentPayload) contextValidateWeightTicketSetType(ctx context.Context, formats strfmt.Registry) error { + + if m.WeightTicketSetType != nil { + + if swag.IsZero(m.WeightTicketSetType) { // not required + return nil + } + + if err := m.WeightTicketSetType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_ticket_set_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_ticket_set_type") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveDocumentPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveDocumentPayload) UnmarshalBinary(b []byte) error { + var res MoveDocumentPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/move_document_status.go b/pkg/gen/internalmessages/move_document_status.go new file mode 100644 index 00000000000..0d2c73d0707 --- /dev/null +++ b/pkg/gen/internalmessages/move_document_status.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MoveDocumentStatus Document status +// +// swagger:model MoveDocumentStatus +type MoveDocumentStatus string + +func NewMoveDocumentStatus(value MoveDocumentStatus) *MoveDocumentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MoveDocumentStatus. +func (m MoveDocumentStatus) Pointer() *MoveDocumentStatus { + return &m +} + +const ( + + // MoveDocumentStatusAWAITINGREVIEW captures enum value "AWAITING_REVIEW" + MoveDocumentStatusAWAITINGREVIEW MoveDocumentStatus = "AWAITING_REVIEW" + + // MoveDocumentStatusOK captures enum value "OK" + MoveDocumentStatusOK MoveDocumentStatus = "OK" + + // MoveDocumentStatusHASISSUE captures enum value "HAS_ISSUE" + MoveDocumentStatusHASISSUE MoveDocumentStatus = "HAS_ISSUE" + + // MoveDocumentStatusEXCLUDEFROMCALCULATION captures enum value "EXCLUDE_FROM_CALCULATION" + MoveDocumentStatusEXCLUDEFROMCALCULATION MoveDocumentStatus = "EXCLUDE_FROM_CALCULATION" +) + +// for schema +var moveDocumentStatusEnum []interface{} + +func init() { + var res []MoveDocumentStatus + if err := json.Unmarshal([]byte(`["AWAITING_REVIEW","OK","HAS_ISSUE","EXCLUDE_FROM_CALCULATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveDocumentStatusEnum = append(moveDocumentStatusEnum, v) + } +} + +func (m MoveDocumentStatus) validateMoveDocumentStatusEnum(path, location string, value MoveDocumentStatus) error { + if err := validate.EnumCase(path, location, value, moveDocumentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this move document status +func (m MoveDocumentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMoveDocumentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this move document status based on context it is used +func (m MoveDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/move_document_type.go b/pkg/gen/internalmessages/move_document_type.go new file mode 100644 index 00000000000..89d91a5c85b --- /dev/null +++ b/pkg/gen/internalmessages/move_document_type.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MoveDocumentType Document type +// Example: EXPENSE +// +// swagger:model MoveDocumentType +type MoveDocumentType string + +func NewMoveDocumentType(value MoveDocumentType) *MoveDocumentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MoveDocumentType. +func (m MoveDocumentType) Pointer() *MoveDocumentType { + return &m +} + +const ( + + // MoveDocumentTypeOTHER captures enum value "OTHER" + MoveDocumentTypeOTHER MoveDocumentType = "OTHER" + + // MoveDocumentTypeWEIGHTTICKET captures enum value "WEIGHT_TICKET" + MoveDocumentTypeWEIGHTTICKET MoveDocumentType = "WEIGHT_TICKET" + + // MoveDocumentTypeSTORAGEEXPENSE captures enum value "STORAGE_EXPENSE" + MoveDocumentTypeSTORAGEEXPENSE MoveDocumentType = "STORAGE_EXPENSE" + + // MoveDocumentTypeSHIPMENTSUMMARY captures enum value "SHIPMENT_SUMMARY" + MoveDocumentTypeSHIPMENTSUMMARY MoveDocumentType = "SHIPMENT_SUMMARY" + + // MoveDocumentTypeEXPENSE captures enum value "EXPENSE" + MoveDocumentTypeEXPENSE MoveDocumentType = "EXPENSE" + + // MoveDocumentTypeWEIGHTTICKETSET captures enum value "WEIGHT_TICKET_SET" + MoveDocumentTypeWEIGHTTICKETSET MoveDocumentType = "WEIGHT_TICKET_SET" +) + +// for schema +var moveDocumentTypeEnum []interface{} + +func init() { + var res []MoveDocumentType + if err := json.Unmarshal([]byte(`["OTHER","WEIGHT_TICKET","STORAGE_EXPENSE","SHIPMENT_SUMMARY","EXPENSE","WEIGHT_TICKET_SET"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveDocumentTypeEnum = append(moveDocumentTypeEnum, v) + } +} + +func (m MoveDocumentType) validateMoveDocumentTypeEnum(path, location string, value MoveDocumentType) error { + if err := validate.EnumCase(path, location, value, moveDocumentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this move document type +func (m MoveDocumentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMoveDocumentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this move document type based on context it is used +func (m MoveDocumentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/move_documents.go b/pkg/gen/internalmessages/move_documents.go new file mode 100644 index 00000000000..c7da2170f5a --- /dev/null +++ b/pkg/gen/internalmessages/move_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MoveDocuments move documents +// +// swagger:model MoveDocuments +type MoveDocuments []*MoveDocumentPayload + +// Validate validates this move documents +func (m MoveDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this move documents based on the context it is used +func (m MoveDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/move_payload.go b/pkg/gen/internalmessages/move_payload.go new file mode 100644 index 00000000000..464d094fca0 --- /dev/null +++ b/pkg/gen/internalmessages/move_payload.go @@ -0,0 +1,518 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MovePayload move payload +// +// swagger:model MovePayload +type MovePayload struct { + + // additional documents + AdditionalDocuments *Document `json:"additionalDocuments,omitempty"` + + // cancel reason + // Example: Change of orders + CancelReason *string `json:"cancel_reason,omitempty"` + + // closeout office + CloseoutOffice *TransportationOffice `json:"closeout_office,omitempty"` + + // counseling office + CounselingOffice *TransportationOffice `json:"counseling_office,omitempty"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // e tag + // Required: true + ETag *string `json:"eTag"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // locator + // Example: 12432 + // Required: true + Locator *string `json:"locator"` + + // mto shipments + MtoShipments MTOShipments `json:"mto_shipments,omitempty"` + + // orders id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + OrdersID *strfmt.UUID `json:"orders_id"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // service member id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` + + // status + Status MoveStatus `json:"status,omitempty"` + + // submitted at + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submitted_at,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this move payload +func (m *MovePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdditionalDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCloseoutOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCounselingOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovePayload) validateAdditionalDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if m.AdditionalDocuments != nil { + if err := m.AdditionalDocuments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *MovePayload) validateCloseoutOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if m.CloseoutOffice != nil { + if err := m.CloseoutOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeout_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeout_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) validateCounselingOffice(formats strfmt.Registry) error { + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if m.CounselingOffice != nil { + if err := m.CounselingOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counseling_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counseling_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateETag(formats strfmt.Registry) error { + + if err := validate.Required("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateLocator(formats strfmt.Registry) error { + + if err := validate.Required("locator", "body", m.Locator); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateMtoShipments(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipments) { // not required + return nil + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mto_shipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mto_shipments") + } + return err + } + + return nil +} + +func (m *MovePayload) validateOrdersID(formats strfmt.Registry) error { + + if err := validate.Required("orders_id", "body", m.OrdersID); err != nil { + return err + } + + if err := validate.FormatOf("orders_id", "body", "uuid", m.OrdersID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MovePayload) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submitted_at", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move payload based on the context it is used +func (m *MovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdditionalDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCloseoutOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselingOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovePayload) contextValidateAdditionalDocuments(ctx context.Context, formats strfmt.Registry) error { + + if m.AdditionalDocuments != nil { + + if swag.IsZero(m.AdditionalDocuments) { // not required + return nil + } + + if err := m.AdditionalDocuments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("additionalDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("additionalDocuments") + } + return err + } + } + + return nil +} + +func (m *MovePayload) contextValidateCloseoutOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CloseoutOffice != nil { + + if swag.IsZero(m.CloseoutOffice) { // not required + return nil + } + + if err := m.CloseoutOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("closeout_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("closeout_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) contextValidateCounselingOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.CounselingOffice != nil { + + if swag.IsZero(m.CounselingOffice) { // not required + return nil + } + + if err := m.CounselingOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("counseling_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("counseling_office") + } + return err + } + } + + return nil +} + +func (m *MovePayload) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mto_shipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mto_shipments") + } + return err + } + + return nil +} + +func (m *MovePayload) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", strfmt.DateTime(m.PrimeCounselingCompletedAt)); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { + return err + } + + return nil +} + +func (m *MovePayload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovePayload) UnmarshalBinary(b []byte) error { + var res MovePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/move_queue_item.go b/pkg/gen/internalmessages/move_queue_item.go new file mode 100644 index 00000000000..b274073ea6e --- /dev/null +++ b/pkg/gen/internalmessages/move_queue_item.go @@ -0,0 +1,563 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveQueueItem move queue item +// +// swagger:model MoveQueueItem +type MoveQueueItem struct { + + // actual move date + // Example: 2018-04-25 + // Format: date + ActualMoveDate *strfmt.Date `json:"actual_move_date,omitempty"` + + // branch of service + // Required: true + BranchOfService *string `json:"branch_of_service"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // Customer Name + // Example: Thedog, Nino + // Required: true + CustomerName *string `json:"customer_name"` + + // delivered date + // Example: 2017-07-21T17:32:28Z + // Format: date-time + DeliveredDate *strfmt.DateTime `json:"delivered_date,omitempty"` + + // Destination + // Example: Dover AFB + DestinationDutyLocationName *string `json:"destination_duty_location_name,omitempty"` + + // Destination GBLOC + // Example: LKNQ + DestinationGbloc *string `json:"destination_gbloc,omitempty"` + + // DoD ID # + // Example: 5789345789 + // Required: true + // Max Length: 10 + // Min Length: 10 + // Pattern: ^\d{10}$ + Edipi *string `json:"edipi"` + + // GBL Number + // Example: LNK12345 + GblNumber *string `json:"gbl_number,omitempty"` + + // grade + // Required: true + Grade *OrderPayGrade `json:"grade"` + + // hhg status + // Example: ACCEPTED + HhgStatus *string `json:"hhg_status,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // invoice approved date + // Example: 2017-07-21T17:32:28Z + // Format: date-time + InvoiceApprovedDate *strfmt.DateTime `json:"invoice_approved_date,omitempty"` + + // last modified date + // Example: 2017-07-21T17:32:28Z + // Required: true + // Format: date-time + LastModifiedDate *strfmt.DateTime `json:"last_modified_date"` + + // locator + // Example: 12432 + // Required: true + Locator *string `json:"locator"` + + // move date + // Example: 2018-04-25 + // Format: date + MoveDate *strfmt.Date `json:"move_date,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"orders_type"` + + // Origin + // Example: Dover AFB + OriginDutyLocationName *string `json:"origin_duty_location_name,omitempty"` + + // Origin GBLOC + // Example: LKNQ + OriginGbloc *string `json:"origin_gbloc,omitempty"` + + // original move date + // Example: 2018-04-25 + // Format: date + OriginalMoveDate *strfmt.Date `json:"original_move_date,omitempty"` + + // pm survey conducted date + // Example: 2017-07-21T17:32:28Z + // Format: date-time + PmSurveyConductedDate *strfmt.DateTime `json:"pm_survey_conducted_date,omitempty"` + + // ppm status + // Example: PAYMENT_REQUESTED + PpmStatus *string `json:"ppm_status,omitempty"` + + // status + // Example: APPROVED + // Required: true + Status *string `json:"status"` + + // submitted date + // Example: 2018-04-25 + // Format: date-time + SubmittedDate *strfmt.DateTime `json:"submitted_date,omitempty"` + + // weight allotment + WeightAllotment *WeightAllotment `json:"weight_allotment,omitempty"` +} + +// Validate validates this move queue item +func (m *MoveQueueItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBranchOfService(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerName(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveredDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInvoiceApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLastModifiedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLocator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePmSurveyConductedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightAllotment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveQueueItem) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actual_move_date", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateBranchOfService(formats strfmt.Registry) error { + + if err := validate.Required("branch_of_service", "body", m.BranchOfService); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateCustomerName(formats strfmt.Registry) error { + + if err := validate.Required("customer_name", "body", m.CustomerName); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateDeliveredDate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveredDate) { // not required + return nil + } + + if err := validate.FormatOf("delivered_date", "body", "date-time", m.DeliveredDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateEdipi(formats strfmt.Registry) error { + + if err := validate.Required("edipi", "body", m.Edipi); err != nil { + return err + } + + if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateGrade(formats strfmt.Registry) error { + + if err := validate.Required("grade", "body", m.Grade); err != nil { + return err + } + + if err := validate.Required("grade", "body", m.Grade); err != nil { + return err + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *MoveQueueItem) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateInvoiceApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.InvoiceApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("invoice_approved_date", "body", "date-time", m.InvoiceApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateLastModifiedDate(formats strfmt.Registry) error { + + if err := validate.Required("last_modified_date", "body", m.LastModifiedDate); err != nil { + return err + } + + if err := validate.FormatOf("last_modified_date", "body", "date-time", m.LastModifiedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateLocator(formats strfmt.Registry) error { + + if err := validate.Required("locator", "body", m.Locator); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.MoveDate) { // not required + return nil + } + + if err := validate.FormatOf("move_date", "body", "date", m.MoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *MoveQueueItem) validateOriginalMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.OriginalMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("original_move_date", "body", "date", m.OriginalMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validatePmSurveyConductedDate(formats strfmt.Registry) error { + if swag.IsZero(m.PmSurveyConductedDate) { // not required + return nil + } + + if err := validate.FormatOf("pm_survey_conducted_date", "body", "date-time", m.PmSurveyConductedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateSubmittedDate(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedDate) { // not required + return nil + } + + if err := validate.FormatOf("submitted_date", "body", "date-time", m.SubmittedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveQueueItem) validateWeightAllotment(formats strfmt.Registry) error { + if swag.IsZero(m.WeightAllotment) { // not required + return nil + } + + if m.WeightAllotment != nil { + if err := m.WeightAllotment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_allotment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_allotment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this move queue item based on the context it is used +func (m *MoveQueueItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightAllotment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveQueueItem) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *MoveQueueItem) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *MoveQueueItem) contextValidateWeightAllotment(ctx context.Context, formats strfmt.Registry) error { + + if m.WeightAllotment != nil { + + if swag.IsZero(m.WeightAllotment) { // not required + return nil + } + + if err := m.WeightAllotment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_allotment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_allotment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveQueueItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveQueueItem) UnmarshalBinary(b []byte) error { + var res MoveQueueItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/move_status.go b/pkg/gen/internalmessages/move_status.go new file mode 100644 index 00000000000..d75050f1e06 --- /dev/null +++ b/pkg/gen/internalmessages/move_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MoveStatus Move status +// +// swagger:model MoveStatus +type MoveStatus string + +func NewMoveStatus(value MoveStatus) *MoveStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MoveStatus. +func (m MoveStatus) Pointer() *MoveStatus { + return &m +} + +const ( + + // MoveStatusDRAFT captures enum value "DRAFT" + MoveStatusDRAFT MoveStatus = "DRAFT" + + // MoveStatusSUBMITTED captures enum value "SUBMITTED" + MoveStatusSUBMITTED MoveStatus = "SUBMITTED" + + // MoveStatusAPPROVED captures enum value "APPROVED" + MoveStatusAPPROVED MoveStatus = "APPROVED" + + // MoveStatusCANCELED captures enum value "CANCELED" + MoveStatusCANCELED MoveStatus = "CANCELED" + + // MoveStatusNEEDSSERVICECOUNSELING captures enum value "NEEDS SERVICE COUNSELING" + MoveStatusNEEDSSERVICECOUNSELING MoveStatus = "NEEDS SERVICE COUNSELING" + + // MoveStatusAPPROVALSREQUESTED captures enum value "APPROVALS REQUESTED" + MoveStatusAPPROVALSREQUESTED MoveStatus = "APPROVALS REQUESTED" +) + +// for schema +var moveStatusEnum []interface{} + +func init() { + var res []MoveStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED","NEEDS SERVICE COUNSELING","APPROVALS REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveStatusEnum = append(moveStatusEnum, v) + } +} + +func (m MoveStatus) validateMoveStatusEnum(path, location string, value MoveStatus) error { + if err := validate.EnumCase(path, location, value, moveStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this move status +func (m MoveStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMoveStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this move status based on context it is used +func (m MoveStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/moves_list.go b/pkg/gen/internalmessages/moves_list.go new file mode 100644 index 00000000000..61450be60be --- /dev/null +++ b/pkg/gen/internalmessages/moves_list.go @@ -0,0 +1,183 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MovesList moves list +// +// swagger:model MovesList +type MovesList struct { + + // current move + CurrentMove []*InternalMove `json:"currentMove"` + + // previous moves + PreviousMoves []*InternalMove `json:"previousMoves"` +} + +// Validate validates this moves list +func (m *MovesList) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCurrentMove(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePreviousMoves(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovesList) validateCurrentMove(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentMove) { // not required + return nil + } + + for i := 0; i < len(m.CurrentMove); i++ { + if swag.IsZero(m.CurrentMove[i]) { // not required + continue + } + + if m.CurrentMove[i] != nil { + if err := m.CurrentMove[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MovesList) validatePreviousMoves(formats strfmt.Registry) error { + if swag.IsZero(m.PreviousMoves) { // not required + return nil + } + + for i := 0; i < len(m.PreviousMoves); i++ { + if swag.IsZero(m.PreviousMoves[i]) { // not required + continue + } + + if m.PreviousMoves[i] != nil { + if err := m.PreviousMoves[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this moves list based on the context it is used +func (m *MovesList) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCurrentMove(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePreviousMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovesList) contextValidateCurrentMove(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.CurrentMove); i++ { + + if m.CurrentMove[i] != nil { + + if swag.IsZero(m.CurrentMove[i]) { // not required + return nil + } + + if err := m.CurrentMove[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("currentMove" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *MovesList) contextValidatePreviousMoves(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.PreviousMoves); i++ { + + if m.PreviousMoves[i] != nil { + + if swag.IsZero(m.PreviousMoves[i]) { // not required + return nil + } + + if err := m.PreviousMoves[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("previousMoves" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovesList) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovesList) UnmarshalBinary(b []byte) error { + var res MovesList + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/moving_expense.go b/pkg/gen/internalmessages/moving_expense.go new file mode 100644 index 00000000000..ef98d414455 --- /dev/null +++ b/pkg/gen/internalmessages/moving_expense.go @@ -0,0 +1,674 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MovingExpense Expense information and receipts of costs incurred that can be reimbursed while moving a PPM shipment. +// +// swagger:model MovingExpense +type MovingExpense struct { + + // The total amount of the expense as indicated on the receipt + Amount *int64 `json:"amount"` + + // Timestamp the moving expense object was initially created in the system (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A brief description of the expense + Description *string `json:"description"` + + // document + // Required: true + Document *Document `json:"document"` + + // The id of the Document that contains all file uploads for this expense + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + DocumentID strfmt.UUID `json:"documentId"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // Unique primary identifier of the Moving Expense object + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Indicates if the service member is missing the receipt with the proof of expense amount + MissingReceipt *bool `json:"missingReceipt"` + + // moving expense type + MovingExpenseType *OmittableMovingExpenseType `json:"movingExpenseType"` + + // Indicates if the service member used their government issued card to pay for the expense + PaidWithGtcc *bool `json:"paidWithGtcc"` + + // The PPM Shipment id that this moving expense belongs to + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2018-05-26 + // Format: date + SitEndDate *strfmt.Date `json:"sitEndDate"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The amount of SIT that will be reimbursed + SitReimburseableAmount *int64 `json:"sitReimburseableAmount"` + + // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2022-04-26 + // Format: date + SitStartDate *strfmt.Date `json:"sitStartDate"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Customer submitted total amount of the expense as indicated on the receipt + SubmittedAmount *int64 `json:"submittedAmount"` + + // Customer submitted description of the expense + SubmittedDescription *string `json:"submittedDescription"` + + // submitted moving expense type + SubmittedMovingExpenseType *SubmittedMovingExpenseType `json:"submittedMovingExpenseType"` + + // Customer submitted date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2018-05-26 + // Format: date + SubmittedSitEndDate *strfmt.Date `json:"submittedSitEndDate"` + + // Customer submitted date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Example: 2022-04-26 + // Format: date + SubmittedSitStartDate *strfmt.Date `json:"submittedSitStartDate"` + + // Timestamp when a property of this moving expense object was last modified (UTC) + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // The total weight stored in PPM SIT + WeightStored *int64 `json:"weightStored"` +} + +// Validate validates this moving expense +func (m *MovingExpense) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedSitStartDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovingExpense) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateDocument(formats strfmt.Registry) error { + + if err := validate.Required("document", "body", m.Document); err != nil { + return err + } + + if m.Document != nil { + if err := m.Document.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if m.MovingExpenseType != nil { + if err := m.MovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSubmittedMovingExpenseType(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedMovingExpenseType) { // not required + return nil + } + + if m.SubmittedMovingExpenseType != nil { + if err := m.SubmittedMovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submittedMovingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submittedMovingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) validateSubmittedSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedSitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("submittedSitEndDate", "body", "date", m.SubmittedSitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateSubmittedSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedSitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("submittedSitStartDate", "body", "date", m.SubmittedSitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this moving expense based on the context it is used +func (m *MovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubmittedMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MovingExpense) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.Document != nil { + + if err := m.Document.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.MovingExpenseType != nil { + + if swag.IsZero(m.MovingExpenseType) { // not required + return nil + } + + if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MovingExpense) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateSubmittedMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.SubmittedMovingExpenseType != nil { + + if swag.IsZero(m.SubmittedMovingExpenseType) { // not required + return nil + } + + if err := m.SubmittedMovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("submittedMovingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("submittedMovingExpenseType") + } + return err + } + } + + return nil +} + +func (m *MovingExpense) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MovingExpense) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MovingExpense) UnmarshalBinary(b []byte) error { + var res MovingExpense + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/moving_expense_type.go b/pkg/gen/internalmessages/moving_expense_type.go new file mode 100644 index 00000000000..f94e9aae7b5 --- /dev/null +++ b/pkg/gen/internalmessages/moving_expense_type.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MovingExpenseType Moving Expense Type +// +// swagger:model MovingExpenseType +type MovingExpenseType string + +func NewMovingExpenseType(value MovingExpenseType) *MovingExpenseType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MovingExpenseType. +func (m MovingExpenseType) Pointer() *MovingExpenseType { + return &m +} + +const ( + + // MovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" + MovingExpenseTypeCONTRACTEDEXPENSE MovingExpenseType = "CONTRACTED_EXPENSE" + + // MovingExpenseTypeGAS captures enum value "GAS" + MovingExpenseTypeGAS MovingExpenseType = "GAS" + + // MovingExpenseTypeOIL captures enum value "OIL" + MovingExpenseTypeOIL MovingExpenseType = "OIL" + + // MovingExpenseTypeOTHER captures enum value "OTHER" + MovingExpenseTypeOTHER MovingExpenseType = "OTHER" + + // MovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" + MovingExpenseTypePACKINGMATERIALS MovingExpenseType = "PACKING_MATERIALS" + + // MovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" + MovingExpenseTypeRENTALEQUIPMENT MovingExpenseType = "RENTAL_EQUIPMENT" + + // MovingExpenseTypeSTORAGE captures enum value "STORAGE" + MovingExpenseTypeSTORAGE MovingExpenseType = "STORAGE" + + // MovingExpenseTypeTOLLS captures enum value "TOLLS" + MovingExpenseTypeTOLLS MovingExpenseType = "TOLLS" + + // MovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" + MovingExpenseTypeWEIGHINGFEE MovingExpenseType = "WEIGHING_FEE" +) + +// for schema +var movingExpenseTypeEnum []interface{} + +func init() { + var res []MovingExpenseType + if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + movingExpenseTypeEnum = append(movingExpenseTypeEnum, v) + } +} + +func (m MovingExpenseType) validateMovingExpenseTypeEnum(path, location string, value MovingExpenseType) error { + if err := validate.EnumCase(path, location, value, movingExpenseTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this moving expense type +func (m MovingExpenseType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMovingExpenseTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this moving expense type based on context it is used +func (m MovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/nullable_signed_certification_type.go b/pkg/gen/internalmessages/nullable_signed_certification_type.go new file mode 100644 index 00000000000..fa2b4bf5e8d --- /dev/null +++ b/pkg/gen/internalmessages/nullable_signed_certification_type.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NullableSignedCertificationType nullable signed certification type +// +// swagger:model NullableSignedCertificationType +type NullableSignedCertificationType string + +func NewNullableSignedCertificationType(value NullableSignedCertificationType) *NullableSignedCertificationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated NullableSignedCertificationType. +func (m NullableSignedCertificationType) Pointer() *NullableSignedCertificationType { + return &m +} + +const ( + + // NullableSignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" + NullableSignedCertificationTypePPMPAYMENT NullableSignedCertificationType = "PPM_PAYMENT" + + // NullableSignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" + NullableSignedCertificationTypeSHIPMENT NullableSignedCertificationType = "SHIPMENT" + + // NullableSignedCertificationTypePPM captures enum value "PPM" + NullableSignedCertificationTypePPM NullableSignedCertificationType = "PPM" + + // NullableSignedCertificationTypeHHG captures enum value "HHG" + NullableSignedCertificationTypeHHG NullableSignedCertificationType = "HHG" +) + +// for schema +var nullableSignedCertificationTypeEnum []interface{} + +func init() { + var res []NullableSignedCertificationType + if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PPM","HHG"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + nullableSignedCertificationTypeEnum = append(nullableSignedCertificationTypeEnum, v) + } +} + +func (m NullableSignedCertificationType) validateNullableSignedCertificationTypeEnum(path, location string, value NullableSignedCertificationType) error { + if err := validate.EnumCase(path, location, value, nullableSignedCertificationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this nullable signed certification type +func (m NullableSignedCertificationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateNullableSignedCertificationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this nullable signed certification type based on context it is used +func (m NullableSignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/office_user.go b/pkg/gen/internalmessages/office_user.go new file mode 100644 index 00000000000..e548e7ec788 --- /dev/null +++ b/pkg/gen/internalmessages/office_user.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OfficeUser office user +// +// swagger:model OfficeUser +type OfficeUser struct { + + // created at + // Format: date-time + CreatedAt strfmt.DateTime `json:"created_at,omitempty"` + + // Personal Email Address + // Example: john_bob@example.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // First name + // Example: John + FirstName *string `json:"first_name,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Last name + // Example: Donut + LastName *string `json:"last_name,omitempty"` + + // Middle name + // Example: L. + MiddleName *string `json:"middle_name,omitempty"` + + // Best contact phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportation_office,omitempty"` + + // transportation office assignments + TransportationOfficeAssignments []*TransportationOfficeAssignment `json:"transportation_office_assignments"` + + // updated at + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updated_at,omitempty"` + + // user id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"user_id,omitempty"` +} + +// Validate validates this office user +func (m *OfficeUser) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeAssignments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) 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 *OfficeUser) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office") + } + return err + } + } + + return nil +} + +func (m *OfficeUser) validateTransportationOfficeAssignments(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOfficeAssignments) { // not required + return nil + } + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + continue + } + + if m.TransportationOfficeAssignments[i] != nil { + if err := m.TransportationOfficeAssignments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *OfficeUser) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *OfficeUser) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this office user based on the context it is used +func (m *OfficeUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOfficeAssignments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OfficeUser) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office") + } + return err + } + } + + return nil +} + +func (m *OfficeUser) contextValidateTransportationOfficeAssignments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.TransportationOfficeAssignments); i++ { + + if m.TransportationOfficeAssignments[i] != nil { + + if swag.IsZero(m.TransportationOfficeAssignments[i]) { // not required + return nil + } + + if err := m.TransportationOfficeAssignments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportation_office_assignments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *OfficeUser) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OfficeUser) UnmarshalBinary(b []byte) error { + var res OfficeUser + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/okta_user_profile_data.go b/pkg/gen/internalmessages/okta_user_profile_data.go new file mode 100644 index 00000000000..532dd658754 --- /dev/null +++ b/pkg/gen/internalmessages/okta_user_profile_data.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// OktaUserProfileData okta user profile data +// +// swagger:model OktaUserProfileData +type OktaUserProfileData struct { + + // cac edipi + // Example: 1234567890 + // Max Length: 10 + CacEdipi *string `json:"cac_edipi,omitempty"` + + // email + // Example: user@email.com + // Pattern: ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email string `json:"email,omitempty"` + + // first name + // Example: John + FirstName string `json:"firstName,omitempty"` + + // last name + // Example: Doe + LastName string `json:"lastName,omitempty"` + + // login + // Example: user@email.com + // Pattern: ^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Login string `json:"login,omitempty"` + + // sub + // Example: 1duekdue9ekrjghf + Sub string `json:"sub,omitempty"` +} + +// Validate validates this okta user profile data +func (m *OktaUserProfileData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCacEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLogin(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *OktaUserProfileData) validateCacEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.CacEdipi) { // not required + return nil + } + + if err := validate.MaxLength("cac_edipi", "body", *m.CacEdipi, 10); err != nil { + return err + } + + return nil +} + +func (m *OktaUserProfileData) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", m.Email, `^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *OktaUserProfileData) validateLogin(formats strfmt.Registry) error { + if swag.IsZero(m.Login) { // not required + return nil + } + + if err := validate.Pattern("login", "body", m.Login, `^[a-zA-Z0-9.%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this okta user profile data based on context it is used +func (m *OktaUserProfileData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *OktaUserProfileData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *OktaUserProfileData) UnmarshalBinary(b []byte) error { + var res OktaUserProfileData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/omittable_moving_expense_type.go b/pkg/gen/internalmessages/omittable_moving_expense_type.go new file mode 100644 index 00000000000..6020730fc7f --- /dev/null +++ b/pkg/gen/internalmessages/omittable_moving_expense_type.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OmittableMovingExpenseType Moving Expense Type +// +// swagger:model OmittableMovingExpenseType +type OmittableMovingExpenseType string + +func NewOmittableMovingExpenseType(value OmittableMovingExpenseType) *OmittableMovingExpenseType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OmittableMovingExpenseType. +func (m OmittableMovingExpenseType) Pointer() *OmittableMovingExpenseType { + return &m +} + +const ( + + // OmittableMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" + OmittableMovingExpenseTypeCONTRACTEDEXPENSE OmittableMovingExpenseType = "CONTRACTED_EXPENSE" + + // OmittableMovingExpenseTypeGAS captures enum value "GAS" + OmittableMovingExpenseTypeGAS OmittableMovingExpenseType = "GAS" + + // OmittableMovingExpenseTypeOIL captures enum value "OIL" + OmittableMovingExpenseTypeOIL OmittableMovingExpenseType = "OIL" + + // OmittableMovingExpenseTypeOTHER captures enum value "OTHER" + OmittableMovingExpenseTypeOTHER OmittableMovingExpenseType = "OTHER" + + // OmittableMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" + OmittableMovingExpenseTypePACKINGMATERIALS OmittableMovingExpenseType = "PACKING_MATERIALS" + + // OmittableMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" + OmittableMovingExpenseTypeRENTALEQUIPMENT OmittableMovingExpenseType = "RENTAL_EQUIPMENT" + + // OmittableMovingExpenseTypeSTORAGE captures enum value "STORAGE" + OmittableMovingExpenseTypeSTORAGE OmittableMovingExpenseType = "STORAGE" + + // OmittableMovingExpenseTypeTOLLS captures enum value "TOLLS" + OmittableMovingExpenseTypeTOLLS OmittableMovingExpenseType = "TOLLS" + + // OmittableMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" + OmittableMovingExpenseTypeWEIGHINGFEE OmittableMovingExpenseType = "WEIGHING_FEE" +) + +// for schema +var omittableMovingExpenseTypeEnum []interface{} + +func init() { + var res []OmittableMovingExpenseType + if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + omittableMovingExpenseTypeEnum = append(omittableMovingExpenseTypeEnum, v) + } +} + +func (m OmittableMovingExpenseType) validateOmittableMovingExpenseTypeEnum(path, location string, value OmittableMovingExpenseType) error { + if err := validate.EnumCase(path, location, value, omittableMovingExpenseTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this omittable moving expense type +func (m OmittableMovingExpenseType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOmittableMovingExpenseTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this omittable moving expense type based on context it is used +func (m OmittableMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/omittable_p_p_m_document_status.go b/pkg/gen/internalmessages/omittable_p_p_m_document_status.go new file mode 100644 index 00000000000..338f459b1cd --- /dev/null +++ b/pkg/gen/internalmessages/omittable_p_p_m_document_status.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OmittablePPMDocumentStatus Status of the PPM document. +// +// swagger:model OmittablePPMDocumentStatus +type OmittablePPMDocumentStatus string + +func NewOmittablePPMDocumentStatus(value OmittablePPMDocumentStatus) *OmittablePPMDocumentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OmittablePPMDocumentStatus. +func (m OmittablePPMDocumentStatus) Pointer() *OmittablePPMDocumentStatus { + return &m +} + +const ( + + // OmittablePPMDocumentStatusAPPROVED captures enum value "APPROVED" + OmittablePPMDocumentStatusAPPROVED OmittablePPMDocumentStatus = "APPROVED" + + // OmittablePPMDocumentStatusEXCLUDED captures enum value "EXCLUDED" + OmittablePPMDocumentStatusEXCLUDED OmittablePPMDocumentStatus = "EXCLUDED" + + // OmittablePPMDocumentStatusREJECTED captures enum value "REJECTED" + OmittablePPMDocumentStatusREJECTED OmittablePPMDocumentStatus = "REJECTED" +) + +// for schema +var omittablePPMDocumentStatusEnum []interface{} + +func init() { + var res []OmittablePPMDocumentStatus + if err := json.Unmarshal([]byte(`["APPROVED","EXCLUDED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + omittablePPMDocumentStatusEnum = append(omittablePPMDocumentStatusEnum, v) + } +} + +func (m OmittablePPMDocumentStatus) validateOmittablePPMDocumentStatusEnum(path, location string, value OmittablePPMDocumentStatus) error { + if err := validate.EnumCase(path, location, value, omittablePPMDocumentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this omittable p p m document status +func (m OmittablePPMDocumentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOmittablePPMDocumentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this omittable p p m document status based on context it is used +func (m OmittablePPMDocumentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/order_pay_grade.go b/pkg/gen/internalmessages/order_pay_grade.go new file mode 100644 index 00000000000..84059d29e25 --- /dev/null +++ b/pkg/gen/internalmessages/order_pay_grade.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrderPayGrade Grade +// +// swagger:model OrderPayGrade +type OrderPayGrade string + +func NewOrderPayGrade(value OrderPayGrade) *OrderPayGrade { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrderPayGrade. +func (m OrderPayGrade) Pointer() *OrderPayGrade { + return &m +} + +const ( + + // OrderPayGradeE1 captures enum value "E_1" + OrderPayGradeE1 OrderPayGrade = "E_1" + + // OrderPayGradeE2 captures enum value "E_2" + OrderPayGradeE2 OrderPayGrade = "E_2" + + // OrderPayGradeE3 captures enum value "E_3" + OrderPayGradeE3 OrderPayGrade = "E_3" + + // OrderPayGradeE4 captures enum value "E_4" + OrderPayGradeE4 OrderPayGrade = "E_4" + + // OrderPayGradeE5 captures enum value "E_5" + OrderPayGradeE5 OrderPayGrade = "E_5" + + // OrderPayGradeE6 captures enum value "E_6" + OrderPayGradeE6 OrderPayGrade = "E_6" + + // OrderPayGradeE7 captures enum value "E_7" + OrderPayGradeE7 OrderPayGrade = "E_7" + + // OrderPayGradeE8 captures enum value "E_8" + OrderPayGradeE8 OrderPayGrade = "E_8" + + // OrderPayGradeE9 captures enum value "E_9" + OrderPayGradeE9 OrderPayGrade = "E_9" + + // OrderPayGradeE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" + OrderPayGradeE9SPECIALSENIORENLISTED OrderPayGrade = "E_9_SPECIAL_SENIOR_ENLISTED" + + // OrderPayGradeO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" + OrderPayGradeO1ACADEMYGRADUATE OrderPayGrade = "O_1_ACADEMY_GRADUATE" + + // OrderPayGradeO2 captures enum value "O_2" + OrderPayGradeO2 OrderPayGrade = "O_2" + + // OrderPayGradeO3 captures enum value "O_3" + OrderPayGradeO3 OrderPayGrade = "O_3" + + // OrderPayGradeO4 captures enum value "O_4" + OrderPayGradeO4 OrderPayGrade = "O_4" + + // OrderPayGradeO5 captures enum value "O_5" + OrderPayGradeO5 OrderPayGrade = "O_5" + + // OrderPayGradeO6 captures enum value "O_6" + OrderPayGradeO6 OrderPayGrade = "O_6" + + // OrderPayGradeO7 captures enum value "O_7" + OrderPayGradeO7 OrderPayGrade = "O_7" + + // OrderPayGradeO8 captures enum value "O_8" + OrderPayGradeO8 OrderPayGrade = "O_8" + + // OrderPayGradeO9 captures enum value "O_9" + OrderPayGradeO9 OrderPayGrade = "O_9" + + // OrderPayGradeO10 captures enum value "O_10" + OrderPayGradeO10 OrderPayGrade = "O_10" + + // OrderPayGradeW1 captures enum value "W_1" + OrderPayGradeW1 OrderPayGrade = "W_1" + + // OrderPayGradeW2 captures enum value "W_2" + OrderPayGradeW2 OrderPayGrade = "W_2" + + // OrderPayGradeW3 captures enum value "W_3" + OrderPayGradeW3 OrderPayGrade = "W_3" + + // OrderPayGradeW4 captures enum value "W_4" + OrderPayGradeW4 OrderPayGrade = "W_4" + + // OrderPayGradeW5 captures enum value "W_5" + OrderPayGradeW5 OrderPayGrade = "W_5" + + // OrderPayGradeAVIATIONCADET captures enum value "AVIATION_CADET" + OrderPayGradeAVIATIONCADET OrderPayGrade = "AVIATION_CADET" + + // OrderPayGradeCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" + OrderPayGradeCIVILIANEMPLOYEE OrderPayGrade = "CIVILIAN_EMPLOYEE" + + // OrderPayGradeACADEMYCADET captures enum value "ACADEMY_CADET" + OrderPayGradeACADEMYCADET OrderPayGrade = "ACADEMY_CADET" + + // OrderPayGradeMIDSHIPMAN captures enum value "MIDSHIPMAN" + OrderPayGradeMIDSHIPMAN OrderPayGrade = "MIDSHIPMAN" +) + +// for schema +var orderPayGradeEnum []interface{} + +func init() { + var res []OrderPayGrade + if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + orderPayGradeEnum = append(orderPayGradeEnum, v) + } +} + +func (m OrderPayGrade) validateOrderPayGradeEnum(path, location string, value OrderPayGrade) error { + if err := validate.EnumCase(path, location, value, orderPayGradeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this order pay grade +func (m OrderPayGrade) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrderPayGradeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this order pay grade based on context it is used +func (m OrderPayGrade) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/orders.go b/pkg/gen/internalmessages/orders.go new file mode 100644 index 00000000000..6a789163d32 --- /dev/null +++ b/pkg/gen/internalmessages/orders.go @@ -0,0 +1,821 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Orders orders +// +// swagger:model Orders +type Orders struct { + + // authorized weight + // Example: 7000 + AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // department indicator + DepartmentIndicator *DeptIndicator `json:"department_indicator,omitempty"` + + // entitlement + Entitlement *Entitlement `json:"entitlement,omitempty"` + + // grade + Grade *OrderPayGrade `json:"grade,omitempty"` + + // Are dependents included in your orders? + // Required: true + HasDependents *bool `json:"has_dependents"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // Date issued + // + // The date and time that these orders were cut. + // Example: 2018-04-26 + // Required: true + // Format: date + IssueDate *strfmt.Date `json:"issue_date"` + + // moves + Moves IndexMovesPayload `json:"moves,omitempty"` + + // new duty location + // Required: true + NewDutyLocation *DutyLocationPayload `json:"new_duty_location"` + + // Orders Number + // Example: 030-00362 + OrdersNumber *string `json:"orders_number,omitempty"` + + // orders type + // Required: true + OrdersType *OrdersType `json:"orders_type"` + + // orders type detail + OrdersTypeDetail *OrdersTypeDetail `json:"orders_type_detail,omitempty"` + + // From what GBLOC do your orders originate? + OriginDutyLocationGbloc *string `json:"originDutyLocationGbloc,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocationPayload `json:"origin_duty_location,omitempty"` + + // provides services counseling + ProvidesServicesCounseling bool `json:"providesServicesCounseling"` + + // Report by + // + // Report By Date + // Example: 2018-04-26 + // Required: true + // Format: date + ReportByDate *strfmt.Date `json:"report_by_date"` + + // SAC + // Example: N002214CSW32Y9 + Sac *string `json:"sac,omitempty"` + + // service member id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ServiceMemberID *strfmt.UUID `json:"service_member_id"` + + // Do you have a spouse who will need to move items related to their occupation (also known as spouse pro-gear)? + // Required: true + SpouseHasProGear *bool `json:"spouse_has_pro_gear"` + + // status + Status OrdersStatus `json:"status,omitempty"` + + // TAC + // Example: F8J1 + Tac *string `json:"tac,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` + + // uploaded amended orders + UploadedAmendedOrders *Document `json:"uploaded_amended_orders,omitempty"` + + // uploaded amended orders id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UploadedAmendedOrdersID strfmt.UUID `json:"uploaded_amended_orders_id,omitempty"` + + // uploaded orders + // Required: true + UploadedOrders *Document `json:"uploaded_orders"` +} + +// Validate validates this orders +func (m *Orders) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDepartmentIndicator(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateHasDependents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIssueDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoves(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersTypeDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSpouseHasProGear(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadedAmendedOrders(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadedAmendedOrdersID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadedOrders(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Orders) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateDepartmentIndicator(formats strfmt.Registry) error { + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if m.DepartmentIndicator != nil { + if err := m.DepartmentIndicator.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *Orders) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Orders) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *Orders) validateHasDependents(formats strfmt.Registry) error { + + if err := validate.Required("has_dependents", "body", m.HasDependents); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateIssueDate(formats strfmt.Registry) error { + + if err := validate.Required("issue_date", "body", m.IssueDate); err != nil { + return err + } + + if err := validate.FormatOf("issue_date", "body", "date", m.IssueDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateMoves(formats strfmt.Registry) error { + if swag.IsZero(m.Moves) { // not required + return nil + } + + if err := m.Moves.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moves") + } + return err + } + + return nil +} + +func (m *Orders) validateNewDutyLocation(formats strfmt.Registry) error { + + if err := validate.Required("new_duty_location", "body", m.NewDutyLocation); err != nil { + return err + } + + if m.NewDutyLocation != nil { + if err := m.NewDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("new_duty_location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("new_duty_location") + } + return err + } + } + + return nil +} + +func (m *Orders) validateOrdersType(formats strfmt.Registry) error { + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if err := validate.Required("orders_type", "body", m.OrdersType); err != nil { + return err + } + + if m.OrdersType != nil { + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *Orders) validateOrdersTypeDetail(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if m.OrdersTypeDetail != nil { + if err := m.OrdersTypeDetail.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type_detail") + } + return err + } + } + + return nil +} + +func (m *Orders) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin_duty_location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin_duty_location") + } + return err + } + } + + return nil +} + +func (m *Orders) validateReportByDate(formats strfmt.Registry) error { + + if err := validate.Required("report_by_date", "body", m.ReportByDate); err != nil { + return err + } + + if err := validate.FormatOf("report_by_date", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.Required("service_member_id", "body", m.ServiceMemberID); err != nil { + return err + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateSpouseHasProGear(formats strfmt.Registry) error { + + if err := validate.Required("spouse_has_pro_gear", "body", m.SpouseHasProGear); err != nil { + return err + } + + return nil +} + +func (m *Orders) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *Orders) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateUploadedAmendedOrders(formats strfmt.Registry) error { + if swag.IsZero(m.UploadedAmendedOrders) { // not required + return nil + } + + if m.UploadedAmendedOrders != nil { + if err := m.UploadedAmendedOrders.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploaded_amended_orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploaded_amended_orders") + } + return err + } + } + + return nil +} + +func (m *Orders) validateUploadedAmendedOrdersID(formats strfmt.Registry) error { + if swag.IsZero(m.UploadedAmendedOrdersID) { // not required + return nil + } + + if err := validate.FormatOf("uploaded_amended_orders_id", "body", "uuid", m.UploadedAmendedOrdersID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Orders) validateUploadedOrders(formats strfmt.Registry) error { + + if err := validate.Required("uploaded_orders", "body", m.UploadedOrders); err != nil { + return err + } + + if m.UploadedOrders != nil { + if err := m.UploadedOrders.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploaded_orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploaded_orders") + } + return err + } + } + + return nil +} + +// ContextValidate validate this orders based on the context it is used +func (m *Orders) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDepartmentIndicator(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoves(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersTypeDetail(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUploadedAmendedOrders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUploadedOrders(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Orders) contextValidateDepartmentIndicator(ctx context.Context, formats strfmt.Registry) error { + + if m.DepartmentIndicator != nil { + + if swag.IsZero(m.DepartmentIndicator) { // not required + return nil + } + + if err := m.DepartmentIndicator.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("department_indicator") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("department_indicator") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateMoves(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Moves.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("moves") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("moves") + } + return err + } + + return nil +} + +func (m *Orders) contextValidateNewDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.NewDutyLocation != nil { + + if err := m.NewDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("new_duty_location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("new_duty_location") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersType != nil { + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateOrdersTypeDetail(ctx context.Context, formats strfmt.Registry) error { + + if m.OrdersTypeDetail != nil { + + if swag.IsZero(m.OrdersTypeDetail) { // not required + return nil + } + + if err := m.OrdersTypeDetail.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders_type_detail") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders_type_detail") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin_duty_location") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin_duty_location") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *Orders) contextValidateUploadedAmendedOrders(ctx context.Context, formats strfmt.Registry) error { + + if m.UploadedAmendedOrders != nil { + + if swag.IsZero(m.UploadedAmendedOrders) { // not required + return nil + } + + if err := m.UploadedAmendedOrders.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploaded_amended_orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploaded_amended_orders") + } + return err + } + } + + return nil +} + +func (m *Orders) contextValidateUploadedOrders(ctx context.Context, formats strfmt.Registry) error { + + if m.UploadedOrders != nil { + + if err := m.UploadedOrders.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploaded_orders") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploaded_orders") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Orders) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Orders) UnmarshalBinary(b []byte) error { + var res Orders + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/orders_status.go b/pkg/gen/internalmessages/orders_status.go new file mode 100644 index 00000000000..f8e61108195 --- /dev/null +++ b/pkg/gen/internalmessages/orders_status.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersStatus Move status +// +// swagger:model OrdersStatus +type OrdersStatus string + +func NewOrdersStatus(value OrdersStatus) *OrdersStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersStatus. +func (m OrdersStatus) Pointer() *OrdersStatus { + return &m +} + +const ( + + // OrdersStatusDRAFT captures enum value "DRAFT" + OrdersStatusDRAFT OrdersStatus = "DRAFT" + + // OrdersStatusSUBMITTED captures enum value "SUBMITTED" + OrdersStatusSUBMITTED OrdersStatus = "SUBMITTED" + + // OrdersStatusAPPROVED captures enum value "APPROVED" + OrdersStatusAPPROVED OrdersStatus = "APPROVED" + + // OrdersStatusCANCELED captures enum value "CANCELED" + OrdersStatusCANCELED OrdersStatus = "CANCELED" +) + +// for schema +var ordersStatusEnum []interface{} + +func init() { + var res []OrdersStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","APPROVED","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersStatusEnum = append(ordersStatusEnum, v) + } +} + +func (m OrdersStatus) validateOrdersStatusEnum(path, location string, value OrdersStatus) error { + if err := validate.EnumCase(path, location, value, ordersStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders status +func (m OrdersStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders status based on context it is used +func (m OrdersStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/orders_type.go b/pkg/gen/internalmessages/orders_type.go new file mode 100644 index 00000000000..059e20ff623 --- /dev/null +++ b/pkg/gen/internalmessages/orders_type.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersType Orders type +// +// swagger:model OrdersType +type OrdersType string + +func NewOrdersType(value OrdersType) *OrdersType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersType. +func (m OrdersType) Pointer() *OrdersType { + return &m +} + +const ( + + // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" + OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" + + // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" + OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" + + // OrdersTypeRETIREMENT captures enum value "RETIREMENT" + OrdersTypeRETIREMENT OrdersType = "RETIREMENT" + + // OrdersTypeSEPARATION captures enum value "SEPARATION" + OrdersTypeSEPARATION OrdersType = "SEPARATION" + + // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" + OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" + + // OrdersTypeBLUEBARK captures enum value "BLUEBARK" + OrdersTypeBLUEBARK OrdersType = "BLUEBARK" + + // OrdersTypeSAFETY captures enum value "SAFETY" + OrdersTypeSAFETY OrdersType = "SAFETY" + + // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" + OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" + + // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" + OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" + + // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" + OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" +) + +// for schema +var ordersTypeEnum []interface{} + +func init() { + var res []OrdersType + if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeEnum = append(ordersTypeEnum, v) + } +} + +func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { + if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type +func (m OrdersType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type based on context it is used +func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/orders_type_detail.go b/pkg/gen/internalmessages/orders_type_detail.go new file mode 100644 index 00000000000..0cac696d939 --- /dev/null +++ b/pkg/gen/internalmessages/orders_type_detail.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersTypeDetail Orders type detail +// +// swagger:model OrdersTypeDetail +type OrdersTypeDetail string + +func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. +func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { + return &m +} + +const ( + + // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" + OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" + + // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" + OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" + + // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" + OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" + + // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" + OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" + + // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" + OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" + + // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" + OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" + + // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" + OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" +) + +// for schema +var ordersTypeDetailEnum []interface{} + +func init() { + var res []OrdersTypeDetail + if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) + } +} + +func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { + if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type detail +func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type detail based on context it is used +func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_advance_status.go b/pkg/gen/internalmessages/p_p_m_advance_status.go new file mode 100644 index 00000000000..47aad6d9e02 --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_advance_status.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMAdvanceStatus PPM Advance Status +// +// # Indicates whether an advance status has been accepted, rejected, or edited, or a prime counseled PPM has been received or not received +// +// swagger:model PPMAdvanceStatus +type PPMAdvanceStatus string + +func NewPPMAdvanceStatus(value PPMAdvanceStatus) *PPMAdvanceStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMAdvanceStatus. +func (m PPMAdvanceStatus) Pointer() *PPMAdvanceStatus { + return &m +} + +const ( + + // PPMAdvanceStatusAPPROVED captures enum value "APPROVED" + PPMAdvanceStatusAPPROVED PPMAdvanceStatus = "APPROVED" + + // PPMAdvanceStatusREJECTED captures enum value "REJECTED" + PPMAdvanceStatusREJECTED PPMAdvanceStatus = "REJECTED" + + // PPMAdvanceStatusEDITED captures enum value "EDITED" + PPMAdvanceStatusEDITED PPMAdvanceStatus = "EDITED" + + // PPMAdvanceStatusRECEIVED captures enum value "RECEIVED" + PPMAdvanceStatusRECEIVED PPMAdvanceStatus = "RECEIVED" + + // PPMAdvanceStatusNOTRECEIVED captures enum value "NOT_RECEIVED" + PPMAdvanceStatusNOTRECEIVED PPMAdvanceStatus = "NOT_RECEIVED" +) + +// for schema +var pPMAdvanceStatusEnum []interface{} + +func init() { + var res []PPMAdvanceStatus + if err := json.Unmarshal([]byte(`["APPROVED","REJECTED","EDITED","RECEIVED","NOT_RECEIVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMAdvanceStatusEnum = append(pPMAdvanceStatusEnum, v) + } +} + +func (m PPMAdvanceStatus) validatePPMAdvanceStatusEnum(path, location string, value PPMAdvanceStatus) error { + if err := validate.EnumCase(path, location, value, pPMAdvanceStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m advance status +func (m PPMAdvanceStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMAdvanceStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this p p m advance status based on context it is used +func (m PPMAdvanceStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_destination_address.go b/pkg/gen/internalmessages/p_p_m_destination_address.go new file mode 100644 index 00000000000..c0ca4668595 --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_destination_address.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMDestinationAddress A postal address +// +// swagger:model PPMDestinationAddress +type PPMDestinationAddress struct { + + // City + // Example: Anytown + // Required: true + City *string `json:"city"` + + // Country + // Example: USA + Country *string `json:"country,omitempty"` + + // County + // Example: LOS ANGELES + County *string `json:"county,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // ZIP + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + PostalCode *string `json:"postalCode"` + + // State + // Required: true + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State *string `json:"state"` + + // Street address 1 + // Example: 123 Main Ave + StreetAddress1 *string `json:"streetAddress1,omitempty"` + + // Street address 2 + // Example: Apartment 9000 + StreetAddress2 *string `json:"streetAddress2,omitempty"` + + // Address Line 3 + // Example: Montmârtre + StreetAddress3 *string `json:"streetAddress3,omitempty"` + + // us post region cities ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` +} + +// Validate validates this p p m destination address +func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsPostRegionCitiesID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { + + if err := validate.Required("city", "body", m.City); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { + + if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { + return err + } + + if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +var pPMDestinationAddressTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) + } +} + +const ( + + // PPMDestinationAddressStateAL captures enum value "AL" + PPMDestinationAddressStateAL string = "AL" + + // PPMDestinationAddressStateAK captures enum value "AK" + PPMDestinationAddressStateAK string = "AK" + + // PPMDestinationAddressStateAR captures enum value "AR" + PPMDestinationAddressStateAR string = "AR" + + // PPMDestinationAddressStateAZ captures enum value "AZ" + PPMDestinationAddressStateAZ string = "AZ" + + // PPMDestinationAddressStateCA captures enum value "CA" + PPMDestinationAddressStateCA string = "CA" + + // PPMDestinationAddressStateCO captures enum value "CO" + PPMDestinationAddressStateCO string = "CO" + + // PPMDestinationAddressStateCT captures enum value "CT" + PPMDestinationAddressStateCT string = "CT" + + // PPMDestinationAddressStateDC captures enum value "DC" + PPMDestinationAddressStateDC string = "DC" + + // PPMDestinationAddressStateDE captures enum value "DE" + PPMDestinationAddressStateDE string = "DE" + + // PPMDestinationAddressStateFL captures enum value "FL" + PPMDestinationAddressStateFL string = "FL" + + // PPMDestinationAddressStateGA captures enum value "GA" + PPMDestinationAddressStateGA string = "GA" + + // PPMDestinationAddressStateHI captures enum value "HI" + PPMDestinationAddressStateHI string = "HI" + + // PPMDestinationAddressStateIA captures enum value "IA" + PPMDestinationAddressStateIA string = "IA" + + // PPMDestinationAddressStateID captures enum value "ID" + PPMDestinationAddressStateID string = "ID" + + // PPMDestinationAddressStateIL captures enum value "IL" + PPMDestinationAddressStateIL string = "IL" + + // PPMDestinationAddressStateIN captures enum value "IN" + PPMDestinationAddressStateIN string = "IN" + + // PPMDestinationAddressStateKS captures enum value "KS" + PPMDestinationAddressStateKS string = "KS" + + // PPMDestinationAddressStateKY captures enum value "KY" + PPMDestinationAddressStateKY string = "KY" + + // PPMDestinationAddressStateLA captures enum value "LA" + PPMDestinationAddressStateLA string = "LA" + + // PPMDestinationAddressStateMA captures enum value "MA" + PPMDestinationAddressStateMA string = "MA" + + // PPMDestinationAddressStateMD captures enum value "MD" + PPMDestinationAddressStateMD string = "MD" + + // PPMDestinationAddressStateME captures enum value "ME" + PPMDestinationAddressStateME string = "ME" + + // PPMDestinationAddressStateMI captures enum value "MI" + PPMDestinationAddressStateMI string = "MI" + + // PPMDestinationAddressStateMN captures enum value "MN" + PPMDestinationAddressStateMN string = "MN" + + // PPMDestinationAddressStateMO captures enum value "MO" + PPMDestinationAddressStateMO string = "MO" + + // PPMDestinationAddressStateMS captures enum value "MS" + PPMDestinationAddressStateMS string = "MS" + + // PPMDestinationAddressStateMT captures enum value "MT" + PPMDestinationAddressStateMT string = "MT" + + // PPMDestinationAddressStateNC captures enum value "NC" + PPMDestinationAddressStateNC string = "NC" + + // PPMDestinationAddressStateND captures enum value "ND" + PPMDestinationAddressStateND string = "ND" + + // PPMDestinationAddressStateNE captures enum value "NE" + PPMDestinationAddressStateNE string = "NE" + + // PPMDestinationAddressStateNH captures enum value "NH" + PPMDestinationAddressStateNH string = "NH" + + // PPMDestinationAddressStateNJ captures enum value "NJ" + PPMDestinationAddressStateNJ string = "NJ" + + // PPMDestinationAddressStateNM captures enum value "NM" + PPMDestinationAddressStateNM string = "NM" + + // PPMDestinationAddressStateNV captures enum value "NV" + PPMDestinationAddressStateNV string = "NV" + + // PPMDestinationAddressStateNY captures enum value "NY" + PPMDestinationAddressStateNY string = "NY" + + // PPMDestinationAddressStateOH captures enum value "OH" + PPMDestinationAddressStateOH string = "OH" + + // PPMDestinationAddressStateOK captures enum value "OK" + PPMDestinationAddressStateOK string = "OK" + + // PPMDestinationAddressStateOR captures enum value "OR" + PPMDestinationAddressStateOR string = "OR" + + // PPMDestinationAddressStatePA captures enum value "PA" + PPMDestinationAddressStatePA string = "PA" + + // PPMDestinationAddressStateRI captures enum value "RI" + PPMDestinationAddressStateRI string = "RI" + + // PPMDestinationAddressStateSC captures enum value "SC" + PPMDestinationAddressStateSC string = "SC" + + // PPMDestinationAddressStateSD captures enum value "SD" + PPMDestinationAddressStateSD string = "SD" + + // PPMDestinationAddressStateTN captures enum value "TN" + PPMDestinationAddressStateTN string = "TN" + + // PPMDestinationAddressStateTX captures enum value "TX" + PPMDestinationAddressStateTX string = "TX" + + // PPMDestinationAddressStateUT captures enum value "UT" + PPMDestinationAddressStateUT string = "UT" + + // PPMDestinationAddressStateVA captures enum value "VA" + PPMDestinationAddressStateVA string = "VA" + + // PPMDestinationAddressStateVT captures enum value "VT" + PPMDestinationAddressStateVT string = "VT" + + // PPMDestinationAddressStateWA captures enum value "WA" + PPMDestinationAddressStateWA string = "WA" + + // PPMDestinationAddressStateWI captures enum value "WI" + PPMDestinationAddressStateWI string = "WI" + + // PPMDestinationAddressStateWV captures enum value "WV" + PPMDestinationAddressStateWV string = "WV" + + // PPMDestinationAddressStateWY captures enum value "WY" + PPMDestinationAddressStateWY string = "WY" +) + +// prop value enum +func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + // value enum + if err := m.validateStateEnum("state", "body", *m.State); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { + if swag.IsZero(m.UsPostRegionCitiesID) { // not required + return nil + } + + if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m destination address based on the context it is used +func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { + var res PPMDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_document_status_reason.go b/pkg/gen/internalmessages/p_p_m_document_status_reason.go new file mode 100644 index 00000000000..1a2894065ed --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_document_status_reason.go @@ -0,0 +1,27 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" +) + +// PPMDocumentStatusReason The reason the services counselor has excluded or rejected the item. +// +// swagger:model PPMDocumentStatusReason +type PPMDocumentStatusReason string + +// Validate validates this p p m document status reason +func (m PPMDocumentStatusReason) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this p p m document status reason based on context it is used +func (m PPMDocumentStatusReason) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_estimate_range.go b/pkg/gen/internalmessages/p_p_m_estimate_range.go new file mode 100644 index 00000000000..430862df4a3 --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_estimate_range.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMEstimateRange p p m estimate range +// +// swagger:model PPMEstimateRange +type PPMEstimateRange struct { + + // High estimate + // Required: true + RangeMax *int64 `json:"range_max"` + + // Low estimate + // Required: true + RangeMin *int64 `json:"range_min"` +} + +// Validate validates this p p m estimate range +func (m *PPMEstimateRange) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateRangeMax(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRangeMin(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMEstimateRange) validateRangeMax(formats strfmt.Registry) error { + + if err := validate.Required("range_max", "body", m.RangeMax); err != nil { + return err + } + + return nil +} + +func (m *PPMEstimateRange) validateRangeMin(formats strfmt.Registry) error { + + if err := validate.Required("range_min", "body", m.RangeMin); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this p p m estimate range based on context it is used +func (m *PPMEstimateRange) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PPMEstimateRange) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMEstimateRange) UnmarshalBinary(b []byte) error { + var res PPMEstimateRange + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_shipment.go b/pkg/gen/internalmessages/p_p_m_shipment.go new file mode 100644 index 00000000000..43181ef2904 --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_shipment.go @@ -0,0 +1,1264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment +type PPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // advance status + AdvanceStatus *PPMAdvanceStatus `json:"advanceStatus,omitempty"` + + // The allowable weight of the PPM shipment goods being moved. + // Example: 4300 + // Minimum: 0 + AllowableWeight *int64 `json:"allowableWeight"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // Timestamp of when the PPM Shipment was initially created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin their move. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. + // + // Read Only: true + FinalIncentive *int64 `json:"finalIncentive"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Primary auto-generated unique identifier of the PPM shipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + MaxIncentive *int64 `json:"maxIncentive"` + + // All expense documentation receipt records of this PPM shipment. + MovingExpenses []*MovingExpense `json:"movingExpenses"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeight *int64 `json:"proGearWeight"` + + // All pro-gear weight ticket documentation records for this PPM shipment. + ProGearWeightTickets []*ProGearWeightTicket `json:"proGearWeightTickets"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // secondary destination address + SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // The id of the parent MTOShipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // signed certification + SignedCertification *SignedCertification `json:"signedCertification,omitempty"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // tertiary destination address + TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // w2 address + W2Address *Address `json:"w2Address,omitempty"` + + // weight tickets + WeightTickets WeightTickets `json:"weightTickets"` +} + +// Validate validates this p p m shipment +func (m *PPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAdvanceStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAllowableWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenses(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightTickets(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignedCertification(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateW2Address(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightTickets(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateAdvanceStatus(formats strfmt.Registry) error { + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if m.AdvanceStatus != nil { + if err := m.AdvanceStatus.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateAllowableWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AllowableWeight) { // not required + return nil + } + + if err := validate.MinimumInt("allowableWeight", "body", *m.AllowableWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateMovingExpenses(formats strfmt.Registry) error { + if swag.IsZero(m.MovingExpenses) { // not required + return nil + } + + for i := 0; i < len(m.MovingExpenses); i++ { + if swag.IsZero(m.MovingExpenses[i]) { // not required + continue + } + + if m.MovingExpenses[i] != nil { + if err := m.MovingExpenses[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateProGearWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.ProGearWeightTickets) { // not required + return nil + } + + for i := 0; i < len(m.ProGearWeightTickets); i++ { + if swag.IsZero(m.ProGearWeightTickets[i]) { // not required + continue + } + + if m.ProGearWeightTickets[i] != nil { + if err := m.ProGearWeightTickets[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if m.SecondaryDestinationAddress != nil { + if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSignedCertification(formats strfmt.Registry) error { + if swag.IsZero(m.SignedCertification) { // not required + return nil + } + + if m.SignedCertification != nil { + if err := m.SignedCertification.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signedCertification") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signedCertification") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if m.TertiaryDestinationAddress != nil { + if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateW2Address(formats strfmt.Registry) error { + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if m.W2Address != nil { + if err := m.W2Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateWeightTickets(formats strfmt.Registry) error { + if swag.IsZero(m.WeightTickets) { // not required + return nil + } + + if err := m.WeightTickets.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weightTickets") + } + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment based on the context it is used +func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAdvanceStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMovingExpenses(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProGearWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSignedCertification(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateW2Address(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightTickets(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) contextValidateAdvanceStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.AdvanceStatus != nil { + + if swag.IsZero(m.AdvanceStatus) { // not required + return nil + } + + if err := m.AdvanceStatus.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("advanceStatus") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("advanceStatus") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateMovingExpenses(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MovingExpenses); i++ { + + if m.MovingExpenses[i] != nil { + + if swag.IsZero(m.MovingExpenses[i]) { // not required + return nil + } + + if err := m.MovingExpenses[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenses" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateProGearWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ProGearWeightTickets); i++ { + + if m.ProGearWeightTickets[i] != nil { + + if swag.IsZero(m.ProGearWeightTickets[i]) { // not required + return nil + } + + if err := m.ProGearWeightTickets[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proGearWeightTickets" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDestinationAddress != nil { + + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateSignedCertification(ctx context.Context, formats strfmt.Registry) error { + + if m.SignedCertification != nil { + + if swag.IsZero(m.SignedCertification) { // not required + return nil + } + + if err := m.SignedCertification.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("signedCertification") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("signedCertification") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDestinationAddress != nil { + + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { + + if m.W2Address != nil { + + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if err := m.W2Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateWeightTickets(ctx context.Context, formats strfmt.Registry) error { + + if err := m.WeightTickets.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weightTickets") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weightTickets") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment) UnmarshalBinary(b []byte) error { + var res PPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/p_p_m_shipment_status.go b/pkg/gen/internalmessages/p_p_m_shipment_status.go new file mode 100644 index 00000000000..eade223927b --- /dev/null +++ b/pkg/gen/internalmessages/p_p_m_shipment_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMShipmentStatus Status of the PPM Shipment: +// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. +// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. +// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. +// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. +// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. +// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. +// +// swagger:model PPMShipmentStatus +type PPMShipmentStatus string + +func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. +func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { + return &m +} + +const ( + + // PPMShipmentStatusDRAFT captures enum value "DRAFT" + PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" + + // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" + PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" + + // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" + + // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" + + // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" + + // PPMShipmentStatusCANCELED captures enum value "CANCELED" + PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" +) + +// for schema +var pPMShipmentStatusEnum []interface{} + +func init() { + var res []PPMShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) + } +} + +func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { + if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m shipment status +func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p p m shipment status based on the context it is used +func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/patch_move_payload.go b/pkg/gen/internalmessages/patch_move_payload.go new file mode 100644 index 00000000000..588b051ced0 --- /dev/null +++ b/pkg/gen/internalmessages/patch_move_payload.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PatchMovePayload patch move payload +// +// swagger:model PatchMovePayload +type PatchMovePayload struct { + + // The transportation office that will handle the PPM shipment's closeout approvals for Army and Air Force service members + // Required: true + // Format: uuid + CloseoutOfficeID *strfmt.UUID `json:"closeoutOfficeId"` +} + +// Validate validates this patch move payload +func (m *PatchMovePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCloseoutOfficeID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchMovePayload) validateCloseoutOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("closeoutOfficeId", "body", m.CloseoutOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("closeoutOfficeId", "body", "uuid", m.CloseoutOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this patch move payload based on context it is used +func (m *PatchMovePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PatchMovePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchMovePayload) UnmarshalBinary(b []byte) error { + var res PatchMovePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/patch_service_member_payload.go b/pkg/gen/internalmessages/patch_service_member_payload.go new file mode 100644 index 00000000000..a85374ad1eb --- /dev/null +++ b/pkg/gen/internalmessages/patch_service_member_payload.go @@ -0,0 +1,401 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PatchServiceMemberPayload patch service member payload +// +// swagger:model PatchServiceMemberPayload +type PatchServiceMemberPayload struct { + + // affiliation + Affiliation *Affiliation `json:"affiliation,omitempty"` + + // backup mailing address + BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` + + // current location id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CurrentLocationID *strfmt.UUID `json:"current_location_id,omitempty"` + + // DoD ID number + // Example: 5789345789 + // Max Length: 10 + // Min Length: 10 + // Pattern: ^\d{10}$ + Edipi *string `json:"edipi,omitempty"` + + // Email + EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` + + // USCG EMPLID + // Example: 5789345 + // Max Length: 7 + // Min Length: 7 + // Pattern: ^\d{7}$ + Emplid *string `json:"emplid,omitempty"` + + // First name + // Example: John + FirstName *string `json:"first_name,omitempty"` + + // Last name + // Example: Donut + LastName *string `json:"last_name,omitempty"` + + // Middle name + // Example: L. + MiddleName *string `json:"middle_name,omitempty"` + + // Personal Email + // Example: john_bob@example.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail *string `json:"personal_email,omitempty"` + + // Phone + PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` + + // residential address + ResidentialAddress *Address `json:"residential_address,omitempty"` + + // Alternate Phone + // Example: 212-555-5555 + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + SecondaryTelephone *string `json:"secondary_telephone,omitempty"` + + // Suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // Best Contact Phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // user id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UserID strfmt.UUID `json:"user_id,omitempty"` +} + +// Validate validates this patch service member payload +func (m *PatchServiceMemberPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffiliation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupMailingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCurrentLocationID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmplid(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResidentialAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if m.Affiliation != nil { + if err := m.Affiliation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if m.BackupMailingAddress != nil { + if err := m.BackupMailingAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateCurrentLocationID(formats strfmt.Registry) error { + if swag.IsZero(m.CurrentLocationID) { // not required + return nil + } + + if err := validate.FormatOf("current_location_id", "body", "uuid", m.CurrentLocationID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.Edipi) { // not required + return nil + } + + if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateEmplid(formats strfmt.Registry) error { + if swag.IsZero(m.Emplid) { // not required + return nil + } + + if err := validate.MinLength("emplid", "body", *m.Emplid, 7); err != nil { + return err + } + + if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { + return err + } + + if err := validate.Pattern("emplid", "body", *m.Emplid, `^\d{7}$`); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if m.ResidentialAddress != nil { + if err := m.ResidentialAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *PatchServiceMemberPayload) validateUserID(formats strfmt.Registry) error { + if swag.IsZero(m.UserID) { // not required + return nil + } + + if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this patch service member payload based on the context it is used +func (m *PatchServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAffiliation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PatchServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { + + if m.Affiliation != nil { + + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *PatchServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupMailingAddress != nil { + + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *PatchServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ResidentialAddress != nil { + + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PatchServiceMemberPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PatchServiceMemberPayload) UnmarshalBinary(b []byte) error { + var res PatchServiceMemberPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/post_document_payload.go b/pkg/gen/internalmessages/post_document_payload.go new file mode 100644 index 00000000000..54e2803c022 --- /dev/null +++ b/pkg/gen/internalmessages/post_document_payload.go @@ -0,0 +1,74 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PostDocumentPayload post document payload +// +// swagger:model PostDocumentPayload +type PostDocumentPayload struct { + + // The service member this document belongs to + // Format: uuid + ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` +} + +// Validate validates this post document payload +func (m *PostDocumentPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PostDocumentPayload) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this post document payload based on context it is used +func (m *PostDocumentPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *PostDocumentPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PostDocumentPayload) UnmarshalBinary(b []byte) error { + var res PostDocumentPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/ppm_id.go b/pkg/gen/internalmessages/ppm_id.go new file mode 100644 index 00000000000..94bd6d4fbda --- /dev/null +++ b/pkg/gen/internalmessages/ppm_id.go @@ -0,0 +1,40 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PpmID The PPM Shipment ID to associate with the assigned certificate. +// +// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 +// +// swagger:model PpmID +type PpmID strfmt.UUID + +// Validate validates this ppm ID +func (m PpmID) Validate(formats strfmt.Registry) error { + var res []error + + if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this ppm ID based on context it is used +func (m PpmID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/privilege.go b/pkg/gen/internalmessages/privilege.go new file mode 100644 index 00000000000..0e095e75b9a --- /dev/null +++ b/pkg/gen/internalmessages/privilege.go @@ -0,0 +1,156 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Privilege privilege +// +// swagger:model Privilege +type Privilege struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // id + // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // privilege name + // Example: Supervisor + PrivilegeName string `json:"privilegeName,omitempty"` + + // privilege type + // Example: supervisor + PrivilegeType string `json:"privilegeType,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this privilege +func (m *Privilege) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Privilege) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Privilege) 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 *Privilege) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this privilege based on the context it is used +func (m *Privilege) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Privilege) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Privilege) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Privilege) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Privilege) UnmarshalBinary(b []byte) error { + var res Privilege + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/pro_gear_weight_ticket.go b/pkg/gen/internalmessages/pro_gear_weight_ticket.go new file mode 100644 index 00000000000..0de694bb219 --- /dev/null +++ b/pkg/gen/internalmessages/pro_gear_weight_ticket.go @@ -0,0 +1,463 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ProGearWeightTicket Pro-gear associated information and weight docs for a PPM shipment +// +// swagger:model ProGearWeightTicket +type ProGearWeightTicket struct { + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + BelongsToSelf *bool `json:"belongsToSelf"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // Describes the pro-gear that was moved. + Description *string `json:"description"` + + // document + // Required: true + Document *Document `json:"document"` + + // The ID of the document that is associated with the user uploads containing the pro-gear weight. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + DocumentID strfmt.UUID `json:"documentId"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + HasWeightTickets *bool `json:"hasWeightTickets"` + + // The ID of the pro-gear weight ticket. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // The ID of the PPM shipment that this pro-gear weight ticket is associated with. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + SubmittedBelongsToSelf *bool `json:"submittedBelongsToSelf"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + SubmittedHasWeightTickets *bool `json:"submittedHasWeightTickets"` + + // Customer submitted weight of the pro-gear. + // Minimum: 0 + SubmittedWeight *int64 `json:"submittedWeight"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // Weight of the pro-gear. + // Minimum: 0 + Weight *int64 `json:"weight"` +} + +// Validate validates this pro gear weight ticket +func (m *ProGearWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProGearWeightTicket) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateDocument(formats strfmt.Registry) error { + + if err := validate.Required("document", "body", m.Document); err != nil { + return err + } + + if m.Document != nil { + if err := m.Document.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("documentId", "body", "uuid", m.DocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) 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 *ProGearWeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) validateSubmittedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedWeight", "body", *m.SubmittedWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this pro gear weight ticket based on the context it is used +func (m *ProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProGearWeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.Document != nil { + + if err := m.Document.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("document") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("document") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "documentId", "body", strfmt.UUID(m.DocumentID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *ProGearWeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProGearWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProGearWeightTicket) UnmarshalBinary(b []byte) error { + var res ProGearWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/rate_engine_postal_code_payload.go b/pkg/gen/internalmessages/rate_engine_postal_code_payload.go new file mode 100644 index 00000000000..ae8d4800198 --- /dev/null +++ b/pkg/gen/internalmessages/rate_engine_postal_code_payload.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RateEnginePostalCodePayload rate engine postal code payload +// +// swagger:model RateEnginePostalCodePayload +type RateEnginePostalCodePayload struct { + + // ZIP + // + // zip code, international allowed + // Example: '90210' or 'N15 3NL' + // Required: true + PostalCode *string `json:"postal_code"` + + // postal code type + // Required: true + // Enum: [origin destination] + PostalCodeType *string `json:"postal_code_type"` + + // valid + // Example: false + // Required: true + Valid *bool `json:"valid"` +} + +// Validate validates this rate engine postal code payload +func (m *RateEnginePostalCodePayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePostalCodeType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateValid(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RateEnginePostalCodePayload) validatePostalCode(formats strfmt.Registry) error { + + if err := validate.Required("postal_code", "body", m.PostalCode); err != nil { + return err + } + + return nil +} + +var rateEnginePostalCodePayloadTypePostalCodeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["origin","destination"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + rateEnginePostalCodePayloadTypePostalCodeTypePropEnum = append(rateEnginePostalCodePayloadTypePostalCodeTypePropEnum, v) + } +} + +const ( + + // RateEnginePostalCodePayloadPostalCodeTypeOrigin captures enum value "origin" + RateEnginePostalCodePayloadPostalCodeTypeOrigin string = "origin" + + // RateEnginePostalCodePayloadPostalCodeTypeDestination captures enum value "destination" + RateEnginePostalCodePayloadPostalCodeTypeDestination string = "destination" +) + +// prop value enum +func (m *RateEnginePostalCodePayload) validatePostalCodeTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, rateEnginePostalCodePayloadTypePostalCodeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *RateEnginePostalCodePayload) validatePostalCodeType(formats strfmt.Registry) error { + + if err := validate.Required("postal_code_type", "body", m.PostalCodeType); err != nil { + return err + } + + // value enum + if err := m.validatePostalCodeTypeEnum("postal_code_type", "body", *m.PostalCodeType); err != nil { + return err + } + + return nil +} + +func (m *RateEnginePostalCodePayload) validateValid(formats strfmt.Registry) error { + + if err := validate.Required("valid", "body", m.Valid); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this rate engine postal code payload based on context it is used +func (m *RateEnginePostalCodePayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RateEnginePostalCodePayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RateEnginePostalCodePayload) UnmarshalBinary(b []byte) error { + var res RateEnginePostalCodePayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/reimbursement.go b/pkg/gen/internalmessages/reimbursement.go new file mode 100644 index 00000000000..1d36c7a15ca --- /dev/null +++ b/pkg/gen/internalmessages/reimbursement.go @@ -0,0 +1,229 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reimbursement reimbursement +// +// swagger:model Reimbursement +type Reimbursement struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // method of receipt + // Required: true + MethodOfReceipt *MethodOfReceipt `json:"method_of_receipt"` + + // Requested Amount + // + // unit is cents + // Required: true + // Minimum: 1 + RequestedAmount *int64 `json:"requested_amount"` + + // Requested Date + // Example: 2018-04-26 + // Format: date + RequestedDate *strfmt.Date `json:"requested_date,omitempty"` + + // status + Status *ReimbursementStatus `json:"status,omitempty"` +} + +// Validate validates this reimbursement +func (m *Reimbursement) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMethodOfReceipt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAmount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDate(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 *Reimbursement) 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 *Reimbursement) validateMethodOfReceipt(formats strfmt.Registry) error { + + if err := validate.Required("method_of_receipt", "body", m.MethodOfReceipt); err != nil { + return err + } + + if err := validate.Required("method_of_receipt", "body", m.MethodOfReceipt); err != nil { + return err + } + + if m.MethodOfReceipt != nil { + if err := m.MethodOfReceipt.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method_of_receipt") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("method_of_receipt") + } + return err + } + } + + return nil +} + +func (m *Reimbursement) validateRequestedAmount(formats strfmt.Registry) error { + + if err := validate.Required("requested_amount", "body", m.RequestedAmount); err != nil { + return err + } + + if err := validate.MinimumInt("requested_amount", "body", *m.RequestedAmount, 1, false); err != nil { + return err + } + + return nil +} + +func (m *Reimbursement) validateRequestedDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDate) { // not required + return nil + } + + if err := validate.FormatOf("requested_date", "body", "date", m.RequestedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reimbursement) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// ContextValidate validate this reimbursement based on the context it is used +func (m *Reimbursement) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMethodOfReceipt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reimbursement) contextValidateMethodOfReceipt(ctx context.Context, formats strfmt.Registry) error { + + if m.MethodOfReceipt != nil { + + if err := m.MethodOfReceipt.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("method_of_receipt") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("method_of_receipt") + } + return err + } + } + + return nil +} + +func (m *Reimbursement) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reimbursement) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reimbursement) UnmarshalBinary(b []byte) error { + var res Reimbursement + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/reimbursement_status.go b/pkg/gen/internalmessages/reimbursement_status.go new file mode 100644 index 00000000000..277cbd374e5 --- /dev/null +++ b/pkg/gen/internalmessages/reimbursement_status.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReimbursementStatus Reimbursement +// +// swagger:model ReimbursementStatus +type ReimbursementStatus string + +func NewReimbursementStatus(value ReimbursementStatus) *ReimbursementStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReimbursementStatus. +func (m ReimbursementStatus) Pointer() *ReimbursementStatus { + return &m +} + +const ( + + // ReimbursementStatusDRAFT captures enum value "DRAFT" + ReimbursementStatusDRAFT ReimbursementStatus = "DRAFT" + + // ReimbursementStatusREQUESTED captures enum value "REQUESTED" + ReimbursementStatusREQUESTED ReimbursementStatus = "REQUESTED" + + // ReimbursementStatusAPPROVED captures enum value "APPROVED" + ReimbursementStatusAPPROVED ReimbursementStatus = "APPROVED" + + // ReimbursementStatusREJECTED captures enum value "REJECTED" + ReimbursementStatusREJECTED ReimbursementStatus = "REJECTED" + + // ReimbursementStatusPAID captures enum value "PAID" + ReimbursementStatusPAID ReimbursementStatus = "PAID" +) + +// for schema +var reimbursementStatusEnum []interface{} + +func init() { + var res []ReimbursementStatus + if err := json.Unmarshal([]byte(`["DRAFT","REQUESTED","APPROVED","REJECTED","PAID"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reimbursementStatusEnum = append(reimbursementStatusEnum, v) + } +} + +func (m ReimbursementStatus) validateReimbursementStatusEnum(path, location string, value ReimbursementStatus) error { + if err := validate.EnumCase(path, location, value, reimbursementStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reimbursement status +func (m ReimbursementStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReimbursementStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reimbursement status based on context it is used +func (m ReimbursementStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/role.go b/pkg/gen/internalmessages/role.go new file mode 100644 index 00000000000..ca1681fc08b --- /dev/null +++ b/pkg/gen/internalmessages/role.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Role role +// +// swagger:model Role +type Role struct { + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"createdAt"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // role type + // Example: customer + // Required: true + RoleType *string `json:"roleType"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this role +func (m *Role) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRoleType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Role) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Role) validateRoleType(formats strfmt.Registry) error { + + if err := validate.Required("roleType", "body", m.RoleType); err != nil { + return err + } + + return nil +} + +func (m *Role) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this role based on context it is used +func (m *Role) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Role) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Role) UnmarshalBinary(b []byte) error { + var res Role + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/s_i_t_location_type.go b/pkg/gen/internalmessages/s_i_t_location_type.go new file mode 100644 index 00000000000..3f5aa07f951 --- /dev/null +++ b/pkg/gen/internalmessages/s_i_t_location_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SITLocationType The list of SIT location types. +// +// swagger:model SITLocationType +type SITLocationType string + +func NewSITLocationType(value SITLocationType) *SITLocationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SITLocationType. +func (m SITLocationType) Pointer() *SITLocationType { + return &m +} + +const ( + + // SITLocationTypeORIGIN captures enum value "ORIGIN" + SITLocationTypeORIGIN SITLocationType = "ORIGIN" + + // SITLocationTypeDESTINATION captures enum value "DESTINATION" + SITLocationTypeDESTINATION SITLocationType = "DESTINATION" +) + +// for schema +var sITLocationTypeEnum []interface{} + +func init() { + var res []SITLocationType + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITLocationTypeEnum = append(sITLocationTypeEnum, v) + } +} + +func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { + if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this s i t location type +func (m SITLocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this s i t location type based on context it is used +func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go b/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go new file mode 100644 index 00000000000..edeb668347c --- /dev/null +++ b/pkg/gen/internalmessages/save_p_p_m_shipment_signed_certification.go @@ -0,0 +1,110 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SavePPMShipmentSignedCertification save p p m shipment signed certification +// +// swagger:model SavePPMShipmentSignedCertification +type SavePPMShipmentSignedCertification struct { + + // Text that the customer is agreeing to and signing. + // Required: true + CertificationText *string `json:"certification_text"` + + // Date of signature + // Required: true + // Format: date + Date *strfmt.Date `json:"date"` + + // Customer signature + // Required: true + Signature *string `json:"signature"` +} + +// Validate validates this save p p m shipment signed certification +func (m *SavePPMShipmentSignedCertification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificationText(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SavePPMShipmentSignedCertification) validateCertificationText(formats strfmt.Registry) error { + + if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { + return err + } + + return nil +} + +func (m *SavePPMShipmentSignedCertification) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SavePPMShipmentSignedCertification) validateSignature(formats strfmt.Registry) error { + + if err := validate.Required("signature", "body", m.Signature); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this save p p m shipment signed certification based on context it is used +func (m *SavePPMShipmentSignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *SavePPMShipmentSignedCertification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SavePPMShipmentSignedCertification) UnmarshalBinary(b []byte) error { + var res SavePPMShipmentSignedCertification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/service_member_backup_contact_payload.go b/pkg/gen/internalmessages/service_member_backup_contact_payload.go new file mode 100644 index 00000000000..113c2055656 --- /dev/null +++ b/pkg/gen/internalmessages/service_member_backup_contact_payload.go @@ -0,0 +1,276 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceMemberBackupContactPayload service member backup contact payload +// +// swagger:model ServiceMemberBackupContactPayload +type ServiceMemberBackupContactPayload struct { + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // Email + // Example: john_bob@example.com + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // Name + // Example: Susan Smith + // Required: true + Name *string `json:"name"` + + // permission + // Required: true + Permission *BackupContactPermission `json:"permission"` + + // service member id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ServiceMemberID strfmt.UUID `json:"service_member_id,omitempty"` + + // Phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this service member backup contact payload +func (m *ServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePermission(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceMemberID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if m.Permission != nil { + if err := m.Permission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateServiceMemberID(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceMemberID) { // not required + return nil + } + + if err := validate.FormatOf("service_member_id", "body", "uuid", m.ServiceMemberID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this service member backup contact payload based on the context it is used +func (m *ServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePermission(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceMemberID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { + + if m.Permission != nil { + + if err := m.Permission.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberBackupContactPayload) contextValidateServiceMemberID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "service_member_id", "body", strfmt.UUID(m.ServiceMemberID)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { + var res ServiceMemberBackupContactPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/service_member_payload.go b/pkg/gen/internalmessages/service_member_payload.go new file mode 100644 index 00000000000..a288cfba291 --- /dev/null +++ b/pkg/gen/internalmessages/service_member_payload.go @@ -0,0 +1,676 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceMemberPayload service member payload +// +// swagger:model ServiceMemberPayload +type ServiceMemberPayload struct { + + // Branch + Affiliation *Affiliation `json:"affiliation,omitempty"` + + // backup contacts + BackupContacts IndexServiceMemberBackupContactsPayload `json:"backup_contacts,omitempty"` + + // backup mailing address + BackupMailingAddress *Address `json:"backup_mailing_address,omitempty"` + + // cac validated + CacValidated bool `json:"cac_validated,omitempty"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // DoD ID number + // Example: 5789345789 + // Max Length: 10 + // Min Length: 10 + // Pattern: ^\d{10}$ + Edipi *string `json:"edipi,omitempty"` + + // Email + EmailIsPreferred *bool `json:"email_is_preferred,omitempty"` + + // USCG EMPLID + // Example: 5789345 + // Max Length: 7 + // Min Length: 7 + // Pattern: ^\d{7}$ + Emplid *string `json:"emplid,omitempty"` + + // First name + // Example: John + FirstName *string `json:"first_name,omitempty"` + + // Grade + Grade *OrderPayGrade `json:"grade,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // is profile complete + // Required: true + IsProfileComplete *bool `json:"is_profile_complete"` + + // Last name + // Example: Donut + LastName *string `json:"last_name,omitempty"` + + // Middle name + // Example: L. + MiddleName *string `json:"middle_name,omitempty"` + + // orders + Orders []*Orders `json:"orders"` + + // Personal Email Address + // Example: john_bob@example.com + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + PersonalEmail *string `json:"personal_email,omitempty"` + + // Telephone + PhoneIsPreferred *bool `json:"phone_is_preferred,omitempty"` + + // Residential Address + ResidentialAddress *Address `json:"residential_address,omitempty"` + + // Secondary Phone + // Example: 212-555-5555 + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + SecondaryTelephone *string `json:"secondary_telephone,omitempty"` + + // Suffix + // Example: Jr. + Suffix *string `json:"suffix,omitempty"` + + // Best contact phone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` + + // user id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + UserID *strfmt.UUID `json:"user_id"` + + // weight allotment + WeightAllotment *WeightAllotment `json:"weight_allotment,omitempty"` +} + +// Validate validates this service member payload +func (m *ServiceMemberPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAffiliation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupContacts(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBackupMailingAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEdipi(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmplid(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGrade(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateIsProfileComplete(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrders(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonalEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateResidentialAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWeightAllotment(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMemberPayload) validateAffiliation(formats strfmt.Registry) error { + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if m.Affiliation != nil { + if err := m.Affiliation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) validateBackupContacts(formats strfmt.Registry) error { + if swag.IsZero(m.BackupContacts) { // not required + return nil + } + + if err := m.BackupContacts.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contacts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contacts") + } + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateBackupMailingAddress(formats strfmt.Registry) error { + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if m.BackupMailingAddress != nil { + if err := m.BackupMailingAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateEdipi(formats strfmt.Registry) error { + if swag.IsZero(m.Edipi) { // not required + return nil + } + + if err := validate.MinLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.MaxLength("edipi", "body", *m.Edipi, 10); err != nil { + return err + } + + if err := validate.Pattern("edipi", "body", *m.Edipi, `^\d{10}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateEmplid(formats strfmt.Registry) error { + if swag.IsZero(m.Emplid) { // not required + return nil + } + + if err := validate.MinLength("emplid", "body", *m.Emplid, 7); err != nil { + return err + } + + if err := validate.MaxLength("emplid", "body", *m.Emplid, 7); err != nil { + return err + } + + if err := validate.Pattern("emplid", "body", *m.Emplid, `^\d{7}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateGrade(formats strfmt.Registry) error { + if swag.IsZero(m.Grade) { // not required + return nil + } + + if m.Grade != nil { + if err := m.Grade.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateIsProfileComplete(formats strfmt.Registry) error { + + if err := validate.Required("is_profile_complete", "body", m.IsProfileComplete); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateOrders(formats strfmt.Registry) error { + if swag.IsZero(m.Orders) { // not required + return nil + } + + for i := 0; i < len(m.Orders); i++ { + if swag.IsZero(m.Orders[i]) { // not required + continue + } + + if m.Orders[i] != nil { + if err := m.Orders[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ServiceMemberPayload) validatePersonalEmail(formats strfmt.Registry) error { + if swag.IsZero(m.PersonalEmail) { // not required + return nil + } + + if err := validate.Pattern("personal_email", "body", *m.PersonalEmail, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateResidentialAddress(formats strfmt.Registry) error { + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if m.ResidentialAddress != nil { + if err := m.ResidentialAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) validateSecondaryTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryTelephone) { // not required + return nil + } + + if err := validate.Pattern("secondary_telephone", "body", *m.SecondaryTelephone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateUserID(formats strfmt.Registry) error { + + if err := validate.Required("user_id", "body", m.UserID); err != nil { + return err + } + + if err := validate.FormatOf("user_id", "body", "uuid", m.UserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ServiceMemberPayload) validateWeightAllotment(formats strfmt.Registry) error { + if swag.IsZero(m.WeightAllotment) { // not required + return nil + } + + if m.WeightAllotment != nil { + if err := m.WeightAllotment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_allotment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_allotment") + } + return err + } + } + + return nil +} + +// ContextValidate validate this service member payload based on the context it is used +func (m *ServiceMemberPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAffiliation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupContacts(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBackupMailingAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateGrade(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrders(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateResidentialAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateWeightAllotment(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceMemberPayload) contextValidateAffiliation(ctx context.Context, formats strfmt.Registry) error { + + if m.Affiliation != nil { + + if swag.IsZero(m.Affiliation) { // not required + return nil + } + + if err := m.Affiliation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("affiliation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("affiliation") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateBackupContacts(ctx context.Context, formats strfmt.Registry) error { + + if err := m.BackupContacts.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_contacts") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_contacts") + } + return err + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateBackupMailingAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.BackupMailingAddress != nil { + + if swag.IsZero(m.BackupMailingAddress) { // not required + return nil + } + + if err := m.BackupMailingAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("backup_mailing_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("backup_mailing_address") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateGrade(ctx context.Context, formats strfmt.Registry) error { + + if m.Grade != nil { + + if swag.IsZero(m.Grade) { // not required + return nil + } + + if err := m.Grade.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("grade") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("grade") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateOrders(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Orders); i++ { + + if m.Orders[i] != nil { + + if swag.IsZero(m.Orders[i]) { // not required + return nil + } + + if err := m.Orders[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("orders" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("orders" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateResidentialAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.ResidentialAddress != nil { + + if swag.IsZero(m.ResidentialAddress) { // not required + return nil + } + + if err := m.ResidentialAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("residential_address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("residential_address") + } + return err + } + } + + return nil +} + +func (m *ServiceMemberPayload) contextValidateWeightAllotment(ctx context.Context, formats strfmt.Registry) error { + + if m.WeightAllotment != nil { + + if swag.IsZero(m.WeightAllotment) { // not required + return nil + } + + if err := m.WeightAllotment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("weight_allotment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("weight_allotment") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceMemberPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceMemberPayload) UnmarshalBinary(b []byte) error { + var res ServiceMemberPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/signed_certification.go b/pkg/gen/internalmessages/signed_certification.go new file mode 100644 index 00000000000..e4329672377 --- /dev/null +++ b/pkg/gen/internalmessages/signed_certification.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SignedCertification Signed certification +// +// swagger:model SignedCertification +type SignedCertification struct { + + // Full text that the customer agreed to and signed. + // Required: true + CertificationText *string `json:"certificationText"` + + // certification type + // Required: true + CertificationType SignedCertificationType `json:"certificationType"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // Date that the customer signed the certification. + // Required: true + // Format: date + Date *strfmt.Date `json:"date"` + + // A hash that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The ID of the signed certification. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // The ID of the move associated with this signed certification. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + MoveID strfmt.UUID `json:"moveId"` + + // The ID of the PPM shipment associated with this signed certification, if any. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + PpmID *strfmt.UUID `json:"ppmId"` + + // The signature that the customer provided. + // Required: true + Signature *string `json:"signature"` + + // The ID of the user that signed. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + SubmittingUserID strfmt.UUID `json:"submittingUserId"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` +} + +// Validate validates this signed certification +func (m *SignedCertification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificationText(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittingUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertification) validateCertificationText(formats strfmt.Registry) error { + + if err := validate.Required("certificationText", "body", m.CertificationText); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateCertificationType(formats strfmt.Registry) error { + + if err := validate.Required("certificationType", "body", SignedCertificationType(m.CertificationType)); err != nil { + return err + } + + if err := m.CertificationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificationType") + } + return err + } + + return nil +} + +func (m *SignedCertification) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("moveId", "body", strfmt.UUID(m.MoveID)); err != nil { + return err + } + + if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validatePpmID(formats strfmt.Registry) error { + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if err := validate.FormatOf("ppmId", "body", "uuid", m.PpmID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateSignature(formats strfmt.Registry) error { + + if err := validate.Required("signature", "body", m.Signature); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateSubmittingUserID(formats strfmt.Registry) error { + + if err := validate.Required("submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { + return err + } + + if err := validate.FormatOf("submittingUserId", "body", "uuid", m.SubmittingUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this signed certification based on the context it is used +func (m *SignedCertification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSubmittingUserID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertification) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificationType") + } + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateMoveID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveId", "body", strfmt.UUID(m.MoveID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmId", "body", m.PpmID); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateSubmittingUserID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "submittingUserId", "body", strfmt.UUID(m.SubmittingUserID)); err != nil { + return err + } + + return nil +} + +func (m *SignedCertification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SignedCertification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SignedCertification) UnmarshalBinary(b []byte) error { + var res SignedCertification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/signed_certification_payload.go b/pkg/gen/internalmessages/signed_certification_payload.go new file mode 100644 index 00000000000..271f6e0cd0c --- /dev/null +++ b/pkg/gen/internalmessages/signed_certification_payload.go @@ -0,0 +1,327 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SignedCertificationPayload signed certification payload +// +// swagger:model SignedCertificationPayload +type SignedCertificationPayload struct { + + // certification text + // Required: true + CertificationText *string `json:"certification_text"` + + // certification type + CertificationType *NullableSignedCertificationType `json:"certification_type,omitempty"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // Date + // Required: true + // Format: date-time + Date *strfmt.DateTime `json:"date"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // move id + // Required: true + // Format: uuid + MoveID *strfmt.UUID `json:"move_id"` + + // personally procured move id + // Format: uuid + PersonallyProcuredMoveID *strfmt.UUID `json:"personally_procured_move_id,omitempty"` + + // ppm id + // Format: uuid + PpmID *PpmID `json:"ppm_id,omitempty"` + + // Signature + // Required: true + Signature *string `json:"signature"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this signed certification payload +func (m *SignedCertificationPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificationText(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCertificationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePersonallyProcuredMoveID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSignature(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertificationPayload) validateCertificationText(formats strfmt.Registry) error { + + if err := validate.Required("certification_text", "body", m.CertificationText); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validateCertificationType(formats strfmt.Registry) error { + if swag.IsZero(m.CertificationType) { // not required + return nil + } + + if m.CertificationType != nil { + if err := m.CertificationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certification_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certification_type") + } + return err + } + } + + return nil +} + +func (m *SignedCertificationPayload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validateDate(formats strfmt.Registry) error { + + if err := validate.Required("date", "body", m.Date); err != nil { + return err + } + + if err := validate.FormatOf("date", "body", "date-time", m.Date.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("move_id", "body", m.MoveID); err != nil { + return err + } + + if err := validate.FormatOf("move_id", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validatePersonallyProcuredMoveID(formats strfmt.Registry) error { + if swag.IsZero(m.PersonallyProcuredMoveID) { // not required + return nil + } + + if err := validate.FormatOf("personally_procured_move_id", "body", "uuid", m.PersonallyProcuredMoveID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validatePpmID(formats strfmt.Registry) error { + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if m.PpmID != nil { + if err := m.PpmID.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppm_id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppm_id") + } + return err + } + } + + return nil +} + +func (m *SignedCertificationPayload) validateSignature(formats strfmt.Registry) error { + + if err := validate.Required("signature", "body", m.Signature); err != nil { + return err + } + + return nil +} + +func (m *SignedCertificationPayload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this signed certification payload based on the context it is used +func (m *SignedCertificationPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SignedCertificationPayload) contextValidateCertificationType(ctx context.Context, formats strfmt.Registry) error { + + if m.CertificationType != nil { + + if swag.IsZero(m.CertificationType) { // not required + return nil + } + + if err := m.CertificationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certification_type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certification_type") + } + return err + } + } + + return nil +} + +func (m *SignedCertificationPayload) contextValidatePpmID(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmID != nil { + + if swag.IsZero(m.PpmID) { // not required + return nil + } + + if err := m.PpmID.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppm_id") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppm_id") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SignedCertificationPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SignedCertificationPayload) UnmarshalBinary(b []byte) error { + var res SignedCertificationPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/signed_certification_type.go b/pkg/gen/internalmessages/signed_certification_type.go new file mode 100644 index 00000000000..cf79774d80d --- /dev/null +++ b/pkg/gen/internalmessages/signed_certification_type.go @@ -0,0 +1,100 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SignedCertificationType The type of signed certification: +// - PPM_PAYMENT: This is used when the customer has a PPM shipment that they have uploaded their documents for and are +// ready to submit their documentation for review. When they submit, they will be asked to sign certifying the +// information is correct. +// - SHIPMENT: This is used when a customer submits their move with their shipments to be reviewed by office users. +// - PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a move has a PPM shipment and is set to +// service-counseling-completed "Submit move details" by service counselor. +// - CLOSEOUT_REVIEWED_PPM_PAYMENT: This is used when a PPM shipment is reviewed by counselor in close out queue. +// +// swagger:model SignedCertificationType +type SignedCertificationType string + +func NewSignedCertificationType(value SignedCertificationType) *SignedCertificationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SignedCertificationType. +func (m SignedCertificationType) Pointer() *SignedCertificationType { + return &m +} + +const ( + + // SignedCertificationTypePPMPAYMENT captures enum value "PPM_PAYMENT" + SignedCertificationTypePPMPAYMENT SignedCertificationType = "PPM_PAYMENT" + + // SignedCertificationTypeSHIPMENT captures enum value "SHIPMENT" + SignedCertificationTypeSHIPMENT SignedCertificationType = "SHIPMENT" + + // SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + + // SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypeCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationType = "CLOSEOUT_REVIEWED_PPM_PAYMENT" +) + +// for schema +var signedCertificationTypeEnum []interface{} + +func init() { + var res []SignedCertificationType + if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + signedCertificationTypeEnum = append(signedCertificationTypeEnum, v) + } +} + +func (m SignedCertificationType) validateSignedCertificationTypeEnum(path, location string, value SignedCertificationType) error { + if err := validate.EnumCase(path, location, value, signedCertificationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this signed certification type +func (m SignedCertificationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSignedCertificationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this signed certification type based on the context it is used +func (m SignedCertificationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", SignedCertificationType(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/signed_certification_type_create.go b/pkg/gen/internalmessages/signed_certification_type_create.go new file mode 100644 index 00000000000..080f0cde1d6 --- /dev/null +++ b/pkg/gen/internalmessages/signed_certification_type_create.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SignedCertificationTypeCreate signed certification type create +// +// swagger:model SignedCertificationTypeCreate +type SignedCertificationTypeCreate string + +func NewSignedCertificationTypeCreate(value SignedCertificationTypeCreate) *SignedCertificationTypeCreate { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SignedCertificationTypeCreate. +func (m SignedCertificationTypeCreate) Pointer() *SignedCertificationTypeCreate { + return &m +} + +const ( + + // SignedCertificationTypeCreatePPMPAYMENT captures enum value "PPM_PAYMENT" + SignedCertificationTypeCreatePPMPAYMENT SignedCertificationTypeCreate = "PPM_PAYMENT" + + // SignedCertificationTypeCreateSHIPMENT captures enum value "SHIPMENT" + SignedCertificationTypeCreateSHIPMENT SignedCertificationTypeCreate = "SHIPMENT" + + // SignedCertificationTypeCreatePRECLOSEOUTREVIEWEDPPMPAYMENT captures enum value "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypeCreatePRECLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationTypeCreate = "PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT" + + // SignedCertificationTypeCreateCLOSEOUTREVIEWEDPPMPAYMENT captures enum value "CLOSEOUT_REVIEWED_PPM_PAYMENT" + SignedCertificationTypeCreateCLOSEOUTREVIEWEDPPMPAYMENT SignedCertificationTypeCreate = "CLOSEOUT_REVIEWED_PPM_PAYMENT" +) + +// for schema +var signedCertificationTypeCreateEnum []interface{} + +func init() { + var res []SignedCertificationTypeCreate + if err := json.Unmarshal([]byte(`["PPM_PAYMENT","SHIPMENT","PRE_CLOSEOUT_REVIEWED_PPM_PAYMENT","CLOSEOUT_REVIEWED_PPM_PAYMENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + signedCertificationTypeCreateEnum = append(signedCertificationTypeCreateEnum, v) + } +} + +func (m SignedCertificationTypeCreate) validateSignedCertificationTypeCreateEnum(path, location string, value SignedCertificationTypeCreate) error { + if err := validate.EnumCase(path, location, value, signedCertificationTypeCreateEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this signed certification type create +func (m SignedCertificationTypeCreate) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSignedCertificationTypeCreateEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this signed certification type create based on context it is used +func (m SignedCertificationTypeCreate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/signed_certifications.go b/pkg/gen/internalmessages/signed_certifications.go new file mode 100644 index 00000000000..e88b115a86b --- /dev/null +++ b/pkg/gen/internalmessages/signed_certifications.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SignedCertifications signed certifications +// +// swagger:model SignedCertifications +type SignedCertifications []*SignedCertificationPayload + +// Validate validates this signed certifications +func (m SignedCertifications) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this signed certifications based on the context it is used +func (m SignedCertifications) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/submit_move_for_approval_payload.go b/pkg/gen/internalmessages/submit_move_for_approval_payload.go new file mode 100644 index 00000000000..12a5909e29a --- /dev/null +++ b/pkg/gen/internalmessages/submit_move_for_approval_payload.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SubmitMoveForApprovalPayload submit move for approval payload +// +// swagger:model SubmitMoveForApprovalPayload +type SubmitMoveForApprovalPayload struct { + + // certificate + Certificate *CreateSignedCertificationPayload `json:"certificate,omitempty"` +} + +// Validate validates this submit move for approval payload +func (m *SubmitMoveForApprovalPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCertificate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SubmitMoveForApprovalPayload) validateCertificate(formats strfmt.Registry) error { + if swag.IsZero(m.Certificate) { // not required + return nil + } + + if m.Certificate != nil { + if err := m.Certificate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificate") + } + return err + } + } + + return nil +} + +// ContextValidate validate this submit move for approval payload based on the context it is used +func (m *SubmitMoveForApprovalPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCertificate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SubmitMoveForApprovalPayload) contextValidateCertificate(ctx context.Context, formats strfmt.Registry) error { + + if m.Certificate != nil { + + if swag.IsZero(m.Certificate) { // not required + return nil + } + + if err := m.Certificate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("certificate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("certificate") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SubmitMoveForApprovalPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SubmitMoveForApprovalPayload) UnmarshalBinary(b []byte) error { + var res SubmitMoveForApprovalPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/submitted_moving_expense_type.go b/pkg/gen/internalmessages/submitted_moving_expense_type.go new file mode 100644 index 00000000000..6213390bb21 --- /dev/null +++ b/pkg/gen/internalmessages/submitted_moving_expense_type.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SubmittedMovingExpenseType Customer Submitted Moving Expense Type +// +// swagger:model SubmittedMovingExpenseType +type SubmittedMovingExpenseType string + +func NewSubmittedMovingExpenseType(value SubmittedMovingExpenseType) *SubmittedMovingExpenseType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SubmittedMovingExpenseType. +func (m SubmittedMovingExpenseType) Pointer() *SubmittedMovingExpenseType { + return &m +} + +const ( + + // SubmittedMovingExpenseTypeCONTRACTEDEXPENSE captures enum value "CONTRACTED_EXPENSE" + SubmittedMovingExpenseTypeCONTRACTEDEXPENSE SubmittedMovingExpenseType = "CONTRACTED_EXPENSE" + + // SubmittedMovingExpenseTypeGAS captures enum value "GAS" + SubmittedMovingExpenseTypeGAS SubmittedMovingExpenseType = "GAS" + + // SubmittedMovingExpenseTypeOIL captures enum value "OIL" + SubmittedMovingExpenseTypeOIL SubmittedMovingExpenseType = "OIL" + + // SubmittedMovingExpenseTypeOTHER captures enum value "OTHER" + SubmittedMovingExpenseTypeOTHER SubmittedMovingExpenseType = "OTHER" + + // SubmittedMovingExpenseTypePACKINGMATERIALS captures enum value "PACKING_MATERIALS" + SubmittedMovingExpenseTypePACKINGMATERIALS SubmittedMovingExpenseType = "PACKING_MATERIALS" + + // SubmittedMovingExpenseTypeRENTALEQUIPMENT captures enum value "RENTAL_EQUIPMENT" + SubmittedMovingExpenseTypeRENTALEQUIPMENT SubmittedMovingExpenseType = "RENTAL_EQUIPMENT" + + // SubmittedMovingExpenseTypeSTORAGE captures enum value "STORAGE" + SubmittedMovingExpenseTypeSTORAGE SubmittedMovingExpenseType = "STORAGE" + + // SubmittedMovingExpenseTypeTOLLS captures enum value "TOLLS" + SubmittedMovingExpenseTypeTOLLS SubmittedMovingExpenseType = "TOLLS" + + // SubmittedMovingExpenseTypeWEIGHINGFEE captures enum value "WEIGHING_FEE" + SubmittedMovingExpenseTypeWEIGHINGFEE SubmittedMovingExpenseType = "WEIGHING_FEE" +) + +// for schema +var submittedMovingExpenseTypeEnum []interface{} + +func init() { + var res []SubmittedMovingExpenseType + if err := json.Unmarshal([]byte(`["CONTRACTED_EXPENSE","GAS","OIL","OTHER","PACKING_MATERIALS","RENTAL_EQUIPMENT","STORAGE","TOLLS","WEIGHING_FEE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + submittedMovingExpenseTypeEnum = append(submittedMovingExpenseTypeEnum, v) + } +} + +func (m SubmittedMovingExpenseType) validateSubmittedMovingExpenseTypeEnum(path, location string, value SubmittedMovingExpenseType) error { + if err := validate.EnumCase(path, location, value, submittedMovingExpenseTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this submitted moving expense type +func (m SubmittedMovingExpenseType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSubmittedMovingExpenseTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this submitted moving expense type based on context it is used +func (m SubmittedMovingExpenseType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/transportation_office.go b/pkg/gen/internalmessages/transportation_office.go new file mode 100644 index 00000000000..c49e4bd4a90 --- /dev/null +++ b/pkg/gen/internalmessages/transportation_office.go @@ -0,0 +1,246 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOffice transportation office +// +// swagger:model TransportationOffice +type TransportationOffice struct { + + // address + // Required: true + Address *Address `json:"address"` + + // created at + // Required: true + // Format: date-time + CreatedAt *strfmt.DateTime `json:"created_at"` + + // gbloc + // Example: JENQ + // Pattern: ^[A-Z]{4}$ + Gbloc string `json:"gbloc,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // latitude + // Example: 29.382973 + Latitude float32 `json:"latitude,omitempty"` + + // longitude + // Example: -98.62759 + Longitude float32 `json:"longitude,omitempty"` + + // name + // Example: Fort Bragg North Station + // Required: true + Name *string `json:"name"` + + // phone lines + PhoneLines []string `json:"phone_lines"` + + // updated at + // Required: true + // Format: date-time + UpdatedAt *strfmt.DateTime `json:"updated_at"` +} + +// Validate validates this transportation office +func (m *TransportationOffice) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateGbloc(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhoneLines(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) validateAddress(formats strfmt.Registry) error { + + if err := validate.Required("address", "body", m.Address); err != nil { + return err + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *TransportationOffice) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("created_at", "body", m.CreatedAt); err != nil { + return err + } + + if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateGbloc(formats strfmt.Registry) error { + if swag.IsZero(m.Gbloc) { // not required + return nil + } + + if err := validate.Pattern("gbloc", "body", m.Gbloc, `^[A-Z]{4}$`); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *TransportationOffice) validatePhoneLines(formats strfmt.Registry) error { + if swag.IsZero(m.PhoneLines) { // not required + return nil + } + + for i := 0; i < len(m.PhoneLines); i++ { + + if err := validate.Pattern("phone_lines"+"."+strconv.Itoa(i), "body", m.PhoneLines[i], `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + } + + return nil +} + +func (m *TransportationOffice) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updated_at", "body", m.UpdatedAt); err != nil { + return err + } + + if err := validate.FormatOf("updated_at", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office based on the context it is used +func (m *TransportationOffice) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOffice) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOffice) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOffice) UnmarshalBinary(b []byte) error { + var res TransportationOffice + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/transportation_office_assignment.go b/pkg/gen/internalmessages/transportation_office_assignment.go new file mode 100644 index 00000000000..133dca464db --- /dev/null +++ b/pkg/gen/internalmessages/transportation_office_assignment.go @@ -0,0 +1,241 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// TransportationOfficeAssignment transportation office assignment +// +// swagger:model TransportationOfficeAssignment +type TransportationOfficeAssignment struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // office user Id + // Example: c56a4780-65aa-42ec-a945-5fd87dec0538 + // Required: true + // Format: uuid + OfficeUserID *strfmt.UUID `json:"officeUserId"` + + // primary office + // Required: true + PrimaryOffice *bool `json:"primaryOffice"` + + // transportation office + TransportationOffice *TransportationOffice `json:"transportationOffice,omitempty"` + + // transportation office Id + // Example: d67a4780-65aa-42ec-a945-5fd87dec0549 + // Required: true + // Format: uuid + TransportationOfficeID *strfmt.UUID `json:"transportationOfficeId"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this transportation office assignment +func (m *TransportationOfficeAssignment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOfficeUserID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimaryOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOffice(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTransportationOfficeID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateOfficeUserID(formats strfmt.Registry) error { + + if err := validate.Required("officeUserId", "body", m.OfficeUserID); err != nil { + return err + } + + if err := validate.FormatOf("officeUserId", "body", "uuid", m.OfficeUserID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validatePrimaryOffice(formats strfmt.Registry) error { + + if err := validate.Required("primaryOffice", "body", m.PrimaryOffice); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOffice(formats strfmt.Registry) error { + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if m.TransportationOffice != nil { + if err := m.TransportationOffice.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateTransportationOfficeID(formats strfmt.Registry) error { + + if err := validate.Required("transportationOfficeId", "body", m.TransportationOfficeID); err != nil { + return err + } + + if err := validate.FormatOf("transportationOfficeId", "body", "uuid", m.TransportationOfficeID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this transportation office assignment based on the context it is used +func (m *TransportationOfficeAssignment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTransportationOffice(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateTransportationOffice(ctx context.Context, formats strfmt.Registry) error { + + if m.TransportationOffice != nil { + + if swag.IsZero(m.TransportationOffice) { // not required + return nil + } + + if err := m.TransportationOffice.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("transportationOffice") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("transportationOffice") + } + return err + } + } + + return nil +} + +func (m *TransportationOfficeAssignment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *TransportationOfficeAssignment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *TransportationOfficeAssignment) UnmarshalBinary(b []byte) error { + var res TransportationOfficeAssignment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/transportation_offices.go b/pkg/gen/internalmessages/transportation_offices.go new file mode 100644 index 00000000000..1068fa9565e --- /dev/null +++ b/pkg/gen/internalmessages/transportation_offices.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// TransportationOffices transportation offices +// +// swagger:model TransportationOffices +type TransportationOffices []*TransportationOffice + +// Validate validates this transportation offices +func (m TransportationOffices) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this transportation offices based on the context it is used +func (m TransportationOffices) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/update_boat_shipment.go b/pkg/gen/internalmessages/update_boat_shipment.go new file mode 100644 index 00000000000..c75a83db0ea --- /dev/null +++ b/pkg/gen/internalmessages/update_boat_shipment.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateBoatShipment update boat shipment +// +// swagger:model UpdateBoatShipment +type UpdateBoatShipment struct { + + // Does the boat have a trailer + HasTrailer *bool `json:"hasTrailer,omitempty"` + + // Height of the Boat in inches + HeightInInches *int64 `json:"heightInInches,omitempty"` + + // Is the trailer roadworthy + IsRoadworthy *bool `json:"isRoadworthy,omitempty"` + + // Length of the Boat in inches + LengthInInches *int64 `json:"lengthInInches,omitempty"` + + // Make of the Boat + Make *string `json:"make,omitempty"` + + // Model of the Boat + Model *string `json:"model,omitempty"` + + // type + // Enum: [HAUL_AWAY TOW_AWAY] + Type *string `json:"type,omitempty"` + + // Width of the Boat in inches + WidthInInches *int64 `json:"widthInInches,omitempty"` + + // Year of the Boat + Year *int64 `json:"year,omitempty"` +} + +// Validate validates this update boat shipment +func (m *UpdateBoatShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +var updateBoatShipmentTypeTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["HAUL_AWAY","TOW_AWAY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateBoatShipmentTypeTypePropEnum = append(updateBoatShipmentTypeTypePropEnum, v) + } +} + +const ( + + // UpdateBoatShipmentTypeHAULAWAY captures enum value "HAUL_AWAY" + UpdateBoatShipmentTypeHAULAWAY string = "HAUL_AWAY" + + // UpdateBoatShipmentTypeTOWAWAY captures enum value "TOW_AWAY" + UpdateBoatShipmentTypeTOWAWAY string = "TOW_AWAY" +) + +// prop value enum +func (m *UpdateBoatShipment) validateTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateBoatShipmentTypeTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateBoatShipment) 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 +} + +// ContextValidate validates this update boat shipment based on context it is used +func (m *UpdateBoatShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateBoatShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateBoatShipment) UnmarshalBinary(b []byte) error { + var res UpdateBoatShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_mobile_home_shipment.go b/pkg/gen/internalmessages/update_mobile_home_shipment.go new file mode 100644 index 00000000000..a611331a77a --- /dev/null +++ b/pkg/gen/internalmessages/update_mobile_home_shipment.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateMobileHomeShipment update mobile home shipment +// +// swagger:model UpdateMobileHomeShipment +type UpdateMobileHomeShipment struct { + + // Height of the Mobile Home in inches + HeightInInches *int64 `json:"heightInInches,omitempty"` + + // Length of the Mobile Home in inches + LengthInInches *int64 `json:"lengthInInches,omitempty"` + + // Make of the Mobile Home + Make *string `json:"make,omitempty"` + + // Model of the Mobile Home + Model *string `json:"model,omitempty"` + + // Width of the Mobile Home in inches + WidthInInches *int64 `json:"widthInInches,omitempty"` + + // Year of the Mobile Home + Year *int64 `json:"year,omitempty"` +} + +// Validate validates this update mobile home shipment +func (m *UpdateMobileHomeShipment) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this update mobile home shipment based on context it is used +func (m *UpdateMobileHomeShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMobileHomeShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMobileHomeShipment) UnmarshalBinary(b []byte) error { + var res UpdateMobileHomeShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_moving_expense.go b/pkg/gen/internalmessages/update_moving_expense.go new file mode 100644 index 00000000000..a757111380f --- /dev/null +++ b/pkg/gen/internalmessages/update_moving_expense.go @@ -0,0 +1,277 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMovingExpense update moving expense +// +// swagger:model UpdateMovingExpense +type UpdateMovingExpense struct { + + // The total amount of the expense as indicated on the receipt + // Required: true + Amount *int64 `json:"amount"` + + // A brief description of the expense + // Required: true + Description *string `json:"description"` + + // Indicates if the customer is missing the receipt for their expense. + // Required: true + MissingReceipt *bool `json:"missingReceipt"` + + // moving expense type + // Required: true + MovingExpenseType *MovingExpenseType `json:"movingExpenseType"` + + // Indicates if the service member used their government issued card to pay for the expense + // Required: true + PaidWithGTCC *bool `json:"paidWithGTCC"` + + // The date the shipment exited storage, applicable for the `STORAGE` movingExpenseType only + // Format: date + SitEndDate strfmt.Date `json:"sitEndDate,omitempty"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The amount of SIT that will be reimbursed + SitReimburseableAmount *int64 `json:"sitReimburseableAmount,omitempty"` + + // The date the shipment entered storage, applicable for the `STORAGE` movingExpenseType only + // Format: date + SitStartDate strfmt.Date `json:"sitStartDate,omitempty"` + + // The total weight stored in PPM SIT + WeightStored int64 `json:"weightStored,omitempty"` +} + +// Validate validates this update moving expense +func (m *UpdateMovingExpense) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAmount(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMissingReceipt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMovingExpenseType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaidWithGTCC(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitStartDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMovingExpense) validateAmount(formats strfmt.Registry) error { + + if err := validate.Required("amount", "body", m.Amount); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateMissingReceipt(formats strfmt.Registry) error { + + if err := validate.Required("missingReceipt", "body", m.MissingReceipt); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateMovingExpenseType(formats strfmt.Registry) error { + + if err := validate.Required("movingExpenseType", "body", m.MovingExpenseType); err != nil { + return err + } + + if err := validate.Required("movingExpenseType", "body", m.MovingExpenseType); err != nil { + return err + } + + if m.MovingExpenseType != nil { + if err := m.MovingExpenseType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) validatePaidWithGTCC(formats strfmt.Registry) error { + + if err := validate.Required("paidWithGTCC", "body", m.PaidWithGTCC); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEndDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEndDate", "body", "date", m.SitEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) validateSitStartDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitStartDate) { // not required + return nil + } + + if err := validate.FormatOf("sitStartDate", "body", "date", m.SitStartDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update moving expense based on the context it is used +func (m *UpdateMovingExpense) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateMovingExpenseType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMovingExpense) contextValidateMovingExpenseType(ctx context.Context, formats strfmt.Registry) error { + + if m.MovingExpenseType != nil { + + if err := m.MovingExpenseType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("movingExpenseType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("movingExpenseType") + } + return err + } + } + + return nil +} + +func (m *UpdateMovingExpense) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMovingExpense) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMovingExpense) UnmarshalBinary(b []byte) error { + var res UpdateMovingExpense + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_okta_user_profile_data.go b/pkg/gen/internalmessages/update_okta_user_profile_data.go new file mode 100644 index 00000000000..04f8aff0d1f --- /dev/null +++ b/pkg/gen/internalmessages/update_okta_user_profile_data.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateOktaUserProfileData update okta user profile data +// +// swagger:model UpdateOktaUserProfileData +type UpdateOktaUserProfileData struct { + + // profile + Profile *OktaUserProfileData `json:"profile,omitempty"` +} + +// Validate validates this update okta user profile data +func (m *UpdateOktaUserProfileData) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProfile(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateOktaUserProfileData) validateProfile(formats strfmt.Registry) error { + if swag.IsZero(m.Profile) { // not required + return nil + } + + if m.Profile != nil { + if err := m.Profile.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("profile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("profile") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update okta user profile data based on the context it is used +func (m *UpdateOktaUserProfileData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateProfile(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateOktaUserProfileData) contextValidateProfile(ctx context.Context, formats strfmt.Registry) error { + + if m.Profile != nil { + + if swag.IsZero(m.Profile) { // not required + return nil + } + + if err := m.Profile.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("profile") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("profile") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateOktaUserProfileData) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateOktaUserProfileData) UnmarshalBinary(b []byte) error { + var res UpdateOktaUserProfileData + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_p_p_m_shipment.go b/pkg/gen/internalmessages/update_p_p_m_shipment.go new file mode 100644 index 00000000000..2e1be3bd9cb --- /dev/null +++ b/pkg/gen/internalmessages/update_p_p_m_shipment.go @@ -0,0 +1,572 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePPMShipment update p p m shipment +// +// swagger:model UpdatePPMShipment +type UpdatePPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode,omitempty"` + + // actual move date + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate,omitempty"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode,omitempty"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived,omitempty"` + + // The amount requested for an advance, or null if no advance is requested + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested,omitempty"` + + // destination address + DestinationAddress *PPMDestinationAddress `json:"destinationAddress,omitempty"` + + // estimated weight + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // Date the customer expects to move. + // + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` + + // The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. + // + // Read Only: true + FinalIncentive *int64 `json:"finalIncentive"` + + // Indicates whether PPM shipment has pro gear. + // + HasProGear *bool `json:"hasProGear,omitempty"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance,omitempty"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance,omitempty"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // pro gear weight + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // secondary destination address + SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // sit expected + SitExpected *bool `json:"sitExpected,omitempty"` + + // spouse pro gear weight + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` + + // tertiary destination address + TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // w2 address + W2Address *Address `json:"w2Address,omitempty"` +} + +// Validate validates this update p p m shipment +func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateW2Address(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.ExpectedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if m.SecondaryDestinationAddress != nil { + if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if m.TertiaryDestinationAddress != nil { + if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateW2Address(formats strfmt.Registry) error { + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if m.W2Address != nil { + if err := m.W2Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update p p m shipment based on the context it is used +func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFinalIncentive(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateW2Address(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateFinalIncentive(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "finalIncentive", "body", m.FinalIncentive); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDestinationAddress != nil { + + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDestinationAddress != nil { + + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateW2Address(ctx context.Context, formats strfmt.Registry) error { + + if m.W2Address != nil { + + if swag.IsZero(m.W2Address) { // not required + return nil + } + + if err := m.W2Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("w2Address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("w2Address") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { + var res UpdatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go b/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go new file mode 100644 index 00000000000..13fd10c4cd0 --- /dev/null +++ b/pkg/gen/internalmessages/update_pro_gear_weight_ticket.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateProGearWeightTicket update pro gear weight ticket +// +// swagger:model UpdateProGearWeightTicket +type UpdateProGearWeightTicket struct { + + // Indicates if this information is for the customer's own pro-gear, otherwise, it's the spouse's. + BelongsToSelf bool `json:"belongsToSelf,omitempty"` + + // Describes the pro-gear that was moved. + Description string `json:"description,omitempty"` + + // Indicates if the user has a weight ticket for their pro-gear, otherwise they have a constructed weight. + HasWeightTickets bool `json:"hasWeightTickets,omitempty"` + + // Weight of the vehicle not including the pro-gear. + // Minimum: 0 + Weight *int64 `json:"weight,omitempty"` +} + +// Validate validates this update pro gear weight ticket +func (m *UpdateProGearWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateProGearWeightTicket) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update pro gear weight ticket based on context it is used +func (m *UpdateProGearWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateProGearWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateProGearWeightTicket) UnmarshalBinary(b []byte) error { + var res UpdateProGearWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go b/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go new file mode 100644 index 00000000000..3d2356f550b --- /dev/null +++ b/pkg/gen/internalmessages/update_service_member_backup_contact_payload.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateServiceMemberBackupContactPayload update service member backup contact payload +// +// swagger:model UpdateServiceMemberBackupContactPayload +type UpdateServiceMemberBackupContactPayload struct { + + // email address + // Example: john_bob@example.com + // Required: true + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email"` + + // name + // Example: Susan Smith + // Required: true + Name *string `json:"name"` + + // permission + // Required: true + Permission *BackupContactPermission `json:"permission"` + + // telephone + // Example: 212-555-5555 + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Telephone *string `json:"telephone,omitempty"` +} + +// Validate validates this update service member backup contact payload +func (m *UpdateServiceMemberBackupContactPayload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateName(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePermission(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTelephone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceMemberBackupContactPayload) validateEmail(formats strfmt.Registry) error { + + if err := validate.Required("email", "body", m.Email); err != nil { + return err + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateServiceMemberBackupContactPayload) validateName(formats strfmt.Registry) error { + + if err := validate.Required("name", "body", m.Name); err != nil { + return err + } + + return nil +} + +func (m *UpdateServiceMemberBackupContactPayload) validatePermission(formats strfmt.Registry) error { + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if err := validate.Required("permission", "body", m.Permission); err != nil { + return err + } + + if m.Permission != nil { + if err := m.Permission.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +func (m *UpdateServiceMemberBackupContactPayload) validateTelephone(formats strfmt.Registry) error { + if swag.IsZero(m.Telephone) { // not required + return nil + } + + if err := validate.Pattern("telephone", "body", *m.Telephone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update service member backup contact payload based on the context it is used +func (m *UpdateServiceMemberBackupContactPayload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidatePermission(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateServiceMemberBackupContactPayload) contextValidatePermission(ctx context.Context, formats strfmt.Registry) error { + + if m.Permission != nil { + + if err := m.Permission.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("permission") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("permission") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateServiceMemberBackupContactPayload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateServiceMemberBackupContactPayload) UnmarshalBinary(b []byte) error { + var res UpdateServiceMemberBackupContactPayload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_shipment.go b/pkg/gen/internalmessages/update_shipment.go new file mode 100644 index 00000000000..9add7ba28be --- /dev/null +++ b/pkg/gen/internalmessages/update_shipment.go @@ -0,0 +1,714 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateShipment update shipment +// +// swagger:model UpdateShipment +type UpdateShipment struct { + + // actual pro gear weight + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // actual spouse pro gear weight + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // boat shipment + BoatShipment *UpdateBoatShipment `json:"boatShipment,omitempty"` + + // customer remarks + // Example: handle with care + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // destination address + DestinationAddress *Address `json:"destinationAddress,omitempty"` + + // has secondary delivery address + HasSecondaryDeliveryAddress *bool `json:"hasSecondaryDeliveryAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary delivery address + HasTertiaryDeliveryAddress *bool `json:"hasTertiaryDeliveryAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // mobile home shipment + MobileHomeShipment *UpdateMobileHomeShipment `json:"mobileHomeShipment,omitempty"` + + // pickup address + PickupAddress *Address `json:"pickupAddress,omitempty"` + + // ppm shipment + PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` + + // requested delivery date + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate,omitempty"` + + // requested pickup date + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate,omitempty"` + + // secondary delivery address + SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // status + Status MTOShipmentStatus `json:"status,omitempty"` + + // tertiary delivery address + TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this update shipment +func (m *UpdateShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipment) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipment) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if m.SecondaryDeliveryAddress != nil { + if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *UpdateShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if m.TertiaryDeliveryAddress != nil { + if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update shipment based on the context it is used +func (m *UpdateShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipment) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDeliveryAddress != nil { + + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *UpdateShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDeliveryAddress != nil { + + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateShipment) UnmarshalBinary(b []byte) error { + var res UpdateShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/update_weight_ticket.go b/pkg/gen/internalmessages/update_weight_ticket.go new file mode 100644 index 00000000000..8b513988e59 --- /dev/null +++ b/pkg/gen/internalmessages/update_weight_ticket.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateWeightTicket update weight ticket +// +// swagger:model UpdateWeightTicket +type UpdateWeightTicket struct { + + // Indicates the adjusted net weight of the vehicle + // Minimum: 0 + AdjustedNetWeight *int64 `json:"adjustedNetWeight,omitempty"` + + // Weight of the vehicle when empty. + // Minimum: 0 + EmptyWeight *int64 `json:"emptyWeight,omitempty"` + + // The weight of the vehicle when full. + // Minimum: 0 + FullWeight *int64 `json:"fullWeight,omitempty"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. + MissingEmptyWeightTicket bool `json:"missingEmptyWeightTicket,omitempty"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when full. + MissingFullWeightTicket bool `json:"missingFullWeightTicket,omitempty"` + + // Remarks explaining any edits made to the net weight + NetWeightRemarks string `json:"netWeightRemarks,omitempty"` + + // Indicates if the customer used a trailer they own for the move. + OwnsTrailer bool `json:"ownsTrailer,omitempty"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + TrailerMeetsCriteria bool `json:"trailerMeetsCriteria,omitempty"` + + // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. + VehicleDescription string `json:"vehicleDescription,omitempty"` +} + +// Validate validates this update weight ticket +func (m *UpdateWeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdjustedNetWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateWeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AdjustedNetWeight) { // not required + return nil + } + + if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateWeightTicket) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateWeightTicket) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update weight ticket based on context it is used +func (m *UpdateWeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateWeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateWeightTicket) UnmarshalBinary(b []byte) error { + var res UpdateWeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/upload.go b/pkg/gen/internalmessages/upload.go new file mode 100644 index 00000000000..d3dd402a82d --- /dev/null +++ b/pkg/gen/internalmessages/upload.go @@ -0,0 +1,477 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Upload An uploaded file. +// +// swagger:model Upload +type Upload struct { + + // bytes + // Required: true + // Read Only: true + Bytes int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + // Read Only: true + ContentType string `json:"contentType"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // deleted at + // Read Only: true + // Format: date-time + DeletedAt *strfmt.DateTime `json:"deletedAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + // Read Only: true + Filename string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // is weight ticket + IsWeightTicket bool `json:"isWeightTicket,omitempty"` + + // rotation + // Example: 2 + Rotation int64 `json:"rotation,omitempty"` + + // status + // Read Only: true + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // upload type + // Example: OFFICE + // Read Only: true + // Enum: [USER PRIME OFFICE] + UploadType string `json:"uploadType,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uri + URL strfmt.URI `json:"url"` +} + +// Validate validates this upload +func (m *Upload) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploadType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Upload) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", int64(m.Bytes)); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateContentType(formats strfmt.Registry) error { + + if err := validate.RequiredString("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateDeletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.DeletedAt) { // not required + return nil + } + + if err := validate.FormatOf("deletedAt", "body", "date-time", m.DeletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateFilename(formats strfmt.Registry) error { + + if err := validate.RequiredString("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +var uploadTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadTypeStatusPropEnum = append(uploadTypeStatusPropEnum, v) + } +} + +const ( + + // UploadStatusINFECTED captures enum value "INFECTED" + UploadStatusINFECTED string = "INFECTED" + + // UploadStatusCLEAN captures enum value "CLEAN" + UploadStatusCLEAN string = "CLEAN" + + // UploadStatusPROCESSING captures enum value "PROCESSING" + UploadStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *Upload) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Upload) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +var uploadTypeUploadTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["USER","PRIME","OFFICE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadTypeUploadTypePropEnum = append(uploadTypeUploadTypePropEnum, v) + } +} + +const ( + + // UploadUploadTypeUSER captures enum value "USER" + UploadUploadTypeUSER string = "USER" + + // UploadUploadTypePRIME captures enum value "PRIME" + UploadUploadTypePRIME string = "PRIME" + + // UploadUploadTypeOFFICE captures enum value "OFFICE" + UploadUploadTypeOFFICE string = "OFFICE" +) + +// prop value enum +func (m *Upload) validateUploadTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadTypeUploadTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Upload) validateUploadType(formats strfmt.Registry) error { + if swag.IsZero(m.UploadType) { // not required + return nil + } + + // value enum + if err := m.validateUploadTypeEnum("uploadType", "body", m.UploadType); err != nil { + return err + } + + return nil +} + +func (m *Upload) validateURL(formats strfmt.Registry) error { + + if err := validate.Required("url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload based on the context it is used +func (m *Upload) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateBytes(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFilename(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUploadType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateURL(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Upload) contextValidateBytes(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "bytes", "body", int64(m.Bytes)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateContentType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contentType", "body", string(m.ContentType)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateDeletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "deletedAt", "body", m.DeletedAt); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateFilename(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "filename", "body", string(m.Filename)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateUploadType(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "uploadType", "body", string(m.UploadType)); err != nil { + return err + } + + return nil +} + +func (m *Upload) contextValidateURL(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "url", "body", strfmt.URI(m.URL)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Upload) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Upload) UnmarshalBinary(b []byte) error { + var res Upload + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/v_location.go b/pkg/gen/internalmessages/v_location.go new file mode 100644 index 00000000000..ee91f43216f --- /dev/null +++ b/pkg/gen/internalmessages/v_location.go @@ -0,0 +1,302 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// VLocation A postal code, city, and state lookup +// +// swagger:model VLocation +type VLocation struct { + + // City + // Example: Anytown + City string `json:"city,omitempty"` + + // County + // Example: LOS ANGELES + County *string `json:"county,omitempty"` + + // ZIP + // Example: 90210 + // Pattern: ^(\d{5}?)$ + PostalCode string `json:"postalCode,omitempty"` + + // State + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State string `json:"state,omitempty"` + + // us post region cities ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` +} + +// Validate validates this v location +func (m *VLocation) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsPostRegionCitiesID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *VLocation) validatePostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.PostalCode) { // not required + return nil + } + + if err := validate.Pattern("postalCode", "body", m.PostalCode, `^(\d{5}?)$`); err != nil { + return err + } + + return nil +} + +var vLocationTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + vLocationTypeStatePropEnum = append(vLocationTypeStatePropEnum, v) + } +} + +const ( + + // VLocationStateAL captures enum value "AL" + VLocationStateAL string = "AL" + + // VLocationStateAK captures enum value "AK" + VLocationStateAK string = "AK" + + // VLocationStateAR captures enum value "AR" + VLocationStateAR string = "AR" + + // VLocationStateAZ captures enum value "AZ" + VLocationStateAZ string = "AZ" + + // VLocationStateCA captures enum value "CA" + VLocationStateCA string = "CA" + + // VLocationStateCO captures enum value "CO" + VLocationStateCO string = "CO" + + // VLocationStateCT captures enum value "CT" + VLocationStateCT string = "CT" + + // VLocationStateDC captures enum value "DC" + VLocationStateDC string = "DC" + + // VLocationStateDE captures enum value "DE" + VLocationStateDE string = "DE" + + // VLocationStateFL captures enum value "FL" + VLocationStateFL string = "FL" + + // VLocationStateGA captures enum value "GA" + VLocationStateGA string = "GA" + + // VLocationStateHI captures enum value "HI" + VLocationStateHI string = "HI" + + // VLocationStateIA captures enum value "IA" + VLocationStateIA string = "IA" + + // VLocationStateID captures enum value "ID" + VLocationStateID string = "ID" + + // VLocationStateIL captures enum value "IL" + VLocationStateIL string = "IL" + + // VLocationStateIN captures enum value "IN" + VLocationStateIN string = "IN" + + // VLocationStateKS captures enum value "KS" + VLocationStateKS string = "KS" + + // VLocationStateKY captures enum value "KY" + VLocationStateKY string = "KY" + + // VLocationStateLA captures enum value "LA" + VLocationStateLA string = "LA" + + // VLocationStateMA captures enum value "MA" + VLocationStateMA string = "MA" + + // VLocationStateMD captures enum value "MD" + VLocationStateMD string = "MD" + + // VLocationStateME captures enum value "ME" + VLocationStateME string = "ME" + + // VLocationStateMI captures enum value "MI" + VLocationStateMI string = "MI" + + // VLocationStateMN captures enum value "MN" + VLocationStateMN string = "MN" + + // VLocationStateMO captures enum value "MO" + VLocationStateMO string = "MO" + + // VLocationStateMS captures enum value "MS" + VLocationStateMS string = "MS" + + // VLocationStateMT captures enum value "MT" + VLocationStateMT string = "MT" + + // VLocationStateNC captures enum value "NC" + VLocationStateNC string = "NC" + + // VLocationStateND captures enum value "ND" + VLocationStateND string = "ND" + + // VLocationStateNE captures enum value "NE" + VLocationStateNE string = "NE" + + // VLocationStateNH captures enum value "NH" + VLocationStateNH string = "NH" + + // VLocationStateNJ captures enum value "NJ" + VLocationStateNJ string = "NJ" + + // VLocationStateNM captures enum value "NM" + VLocationStateNM string = "NM" + + // VLocationStateNV captures enum value "NV" + VLocationStateNV string = "NV" + + // VLocationStateNY captures enum value "NY" + VLocationStateNY string = "NY" + + // VLocationStateOH captures enum value "OH" + VLocationStateOH string = "OH" + + // VLocationStateOK captures enum value "OK" + VLocationStateOK string = "OK" + + // VLocationStateOR captures enum value "OR" + VLocationStateOR string = "OR" + + // VLocationStatePA captures enum value "PA" + VLocationStatePA string = "PA" + + // VLocationStateRI captures enum value "RI" + VLocationStateRI string = "RI" + + // VLocationStateSC captures enum value "SC" + VLocationStateSC string = "SC" + + // VLocationStateSD captures enum value "SD" + VLocationStateSD string = "SD" + + // VLocationStateTN captures enum value "TN" + VLocationStateTN string = "TN" + + // VLocationStateTX captures enum value "TX" + VLocationStateTX string = "TX" + + // VLocationStateUT captures enum value "UT" + VLocationStateUT string = "UT" + + // VLocationStateVA captures enum value "VA" + VLocationStateVA string = "VA" + + // VLocationStateVT captures enum value "VT" + VLocationStateVT string = "VT" + + // VLocationStateWA captures enum value "WA" + VLocationStateWA string = "WA" + + // VLocationStateWI captures enum value "WI" + VLocationStateWI string = "WI" + + // VLocationStateWV captures enum value "WV" + VLocationStateWV string = "WV" + + // VLocationStateWY captures enum value "WY" + VLocationStateWY string = "WY" +) + +// prop value enum +func (m *VLocation) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, vLocationTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *VLocation) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +func (m *VLocation) validateUsPostRegionCitiesID(formats strfmt.Registry) error { + if swag.IsZero(m.UsPostRegionCitiesID) { // not required + return nil + } + + if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this v location based on context it is used +func (m *VLocation) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *VLocation) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *VLocation) UnmarshalBinary(b []byte) error { + var res VLocation + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/v_locations.go b/pkg/gen/internalmessages/v_locations.go new file mode 100644 index 00000000000..4a2e1f0b605 --- /dev/null +++ b/pkg/gen/internalmessages/v_locations.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// VLocations v locations +// +// swagger:model VLocations +type VLocations []*VLocation + +// Validate validates this v locations +func (m VLocations) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this v locations based on the context it is used +func (m VLocations) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/internalmessages/validation_error.go b/pkg/gen/internalmessages/validation_error.go new file mode 100644 index 00000000000..736216e86c4 --- /dev/null +++ b/pkg/gen/internalmessages/validation_error.go @@ -0,0 +1,154 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + ValidationErrorAllOf1 + + // invalid fields + // Required: true + InvalidFields map[string][]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var aO1 ValidationErrorAllOf1 + if err := swag.ReadJSON(raw, &aO1); err != nil { + return err + } + m.ValidationErrorAllOf1 = aO1 + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &propsValidationError); err != nil { + return err + } + m.InvalidFields = propsValidationError.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + + aO1, err := swag.WriteJSON(m.ValidationErrorAllOf1) + if err != nil { + return nil, err + } + _parts = append(_parts, aO1) + + // now for regular properties + var propsValidationError struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + propsValidationError.InvalidFields = m.InvalidFields + + jsonDataPropsValidationError, errValidationError := swag.WriteJSON(propsValidationError) + if errValidationError != nil { + return nil, errValidationError + } + _parts = append(_parts, jsonDataPropsValidationError) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + // validation for a type composition with ValidationErrorAllOf1 + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ValidationErrorAllOf1 validation error all of1 +// +// swagger:model ValidationErrorAllOf1 +type ValidationErrorAllOf1 interface{} diff --git a/pkg/gen/internalmessages/weight_allotment.go b/pkg/gen/internalmessages/weight_allotment.go new file mode 100644 index 00000000000..0ff747d9f00 --- /dev/null +++ b/pkg/gen/internalmessages/weight_allotment.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WeightAllotment weight allotment +// +// swagger:model WeightAllotment +type WeightAllotment struct { + + // pro gear weight + // Example: 2000 + // Required: true + ProGearWeight *int64 `json:"pro_gear_weight"` + + // pro gear weight spouse + // Example: 500 + // Required: true + ProGearWeightSpouse *int64 `json:"pro_gear_weight_spouse"` + + // total weight self + // Example: 18000 + // Required: true + TotalWeightSelf *int64 `json:"total_weight_self"` + + // total weight self plus dependents + // Example: 18000 + // Required: true + TotalWeightSelfPlusDependents *int64 `json:"total_weight_self_plus_dependents"` +} + +// Validate validates this weight allotment +func (m *WeightAllotment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateProGearWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProGearWeightSpouse(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalWeightSelf(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTotalWeightSelfPlusDependents(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WeightAllotment) validateProGearWeight(formats strfmt.Registry) error { + + if err := validate.Required("pro_gear_weight", "body", m.ProGearWeight); err != nil { + return err + } + + return nil +} + +func (m *WeightAllotment) validateProGearWeightSpouse(formats strfmt.Registry) error { + + if err := validate.Required("pro_gear_weight_spouse", "body", m.ProGearWeightSpouse); err != nil { + return err + } + + return nil +} + +func (m *WeightAllotment) validateTotalWeightSelf(formats strfmt.Registry) error { + + if err := validate.Required("total_weight_self", "body", m.TotalWeightSelf); err != nil { + return err + } + + return nil +} + +func (m *WeightAllotment) validateTotalWeightSelfPlusDependents(formats strfmt.Registry) error { + + if err := validate.Required("total_weight_self_plus_dependents", "body", m.TotalWeightSelfPlusDependents); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this weight allotment based on context it is used +func (m *WeightAllotment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *WeightAllotment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WeightAllotment) UnmarshalBinary(b []byte) error { + var res WeightAllotment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/weight_ticket.go b/pkg/gen/internalmessages/weight_ticket.go new file mode 100644 index 00000000000..0a3c5f9afdc --- /dev/null +++ b/pkg/gen/internalmessages/weight_ticket.go @@ -0,0 +1,703 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WeightTicket Vehicle and optional trailer information and weight documents used to move this PPM shipment. +// +// swagger:model WeightTicket +type WeightTicket struct { + + // Indicates the adjusted net weight of the vehicle + // Minimum: 0 + AdjustedNetWeight *int64 `json:"adjustedNetWeight"` + + // created at + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A hash that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // empty document + // Required: true + EmptyDocument *Document `json:"emptyDocument"` + + // ID of the document that is associated with the user uploads containing the vehicle weight when empty. + // Required: true + // Read Only: true + // Format: uuid + EmptyDocumentID strfmt.UUID `json:"emptyDocumentId"` + + // Weight of the vehicle when empty. + // Minimum: 0 + EmptyWeight *int64 `json:"emptyWeight"` + + // full document + // Required: true + FullDocument *Document `json:"fullDocument"` + + // ID of the document that is associated with the user uploads containing the vehicle weight when full. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + FullDocumentID strfmt.UUID `json:"fullDocumentId"` + + // The weight of the vehicle when full. + // Minimum: 0 + FullWeight *int64 `json:"fullWeight"` + + // ID of this set of weight tickets. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when empty. + MissingEmptyWeightTicket *bool `json:"missingEmptyWeightTicket"` + + // Indicates if the customer is missing a weight ticket for the vehicle weight when full. + MissingFullWeightTicket *bool `json:"missingFullWeightTicket"` + + // Remarks explaining any edits made to the net weight + NetWeightRemarks *string `json:"netWeightRemarks"` + + // Indicates if the customer used a trailer they own for the move. + OwnsTrailer *bool `json:"ownsTrailer"` + + // The ID of the PPM shipment that this set of weight tickets is for. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + PpmShipmentID strfmt.UUID `json:"ppmShipmentId"` + + // proof of trailer ownership document + // Required: true + ProofOfTrailerOwnershipDocument *Document `json:"proofOfTrailerOwnershipDocument"` + + // ID of the document that is associated with the user uploads containing the proof of trailer ownership. + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ProofOfTrailerOwnershipDocumentID strfmt.UUID `json:"proofOfTrailerOwnershipDocumentId"` + + // reason + Reason *PPMDocumentStatusReason `json:"reason"` + + // status + Status *OmittablePPMDocumentStatus `json:"status"` + + // Customer submitted weight of the vehicle when empty. + // Minimum: 0 + SubmittedEmptyWeight *int64 `json:"submittedEmptyWeight"` + + // Customer submitted weight of the vehicle when full. + // Minimum: 0 + SubmittedFullWeight *int64 `json:"submittedFullWeight"` + + // Indicates if the customer used a trailer they own for the move. + SubmittedOwnsTrailer *bool `json:"submittedOwnsTrailer"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + SubmittedTrailerMeetsCriteria *bool `json:"submittedTrailerMeetsCriteria"` + + // Indicates if the trailer that the customer used meets all the criteria to be claimable. + TrailerMeetsCriteria *bool `json:"trailerMeetsCriteria"` + + // updated at + // Required: true + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt"` + + // Description of the vehicle used for the trip. E.g. make/model, type of truck/van, etc. + VehicleDescription *string `json:"vehicleDescription"` +} + +// Validate validates this weight ticket +func (m *WeightTicket) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAdjustedNetWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfTrailerOwnershipDocument(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfTrailerOwnershipDocumentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedEmptyWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedFullWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WeightTicket) validateAdjustedNetWeight(formats strfmt.Registry) error { + if swag.IsZero(m.AdjustedNetWeight) { // not required + return nil + } + + if err := validate.MinimumInt("adjustedNetWeight", "body", *m.AdjustedNetWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateEmptyDocument(formats strfmt.Registry) error { + + if err := validate.Required("emptyDocument", "body", m.EmptyDocument); err != nil { + return err + } + + if m.EmptyDocument != nil { + if err := m.EmptyDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emptyDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emptyDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateEmptyDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("emptyDocumentId", "body", "uuid", m.EmptyDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.EmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("emptyWeight", "body", *m.EmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateFullDocument(formats strfmt.Registry) error { + + if err := validate.Required("fullDocument", "body", m.FullDocument); err != nil { + return err + } + + if m.FullDocument != nil { + if err := m.FullDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fullDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fullDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateFullDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("fullDocumentId", "body", "uuid", m.FullDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.FullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("fullWeight", "body", *m.FullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) 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 *WeightTicket) validatePpmShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("ppmShipmentId", "body", "uuid", m.PpmShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateProofOfTrailerOwnershipDocument(formats strfmt.Registry) error { + + if err := validate.Required("proofOfTrailerOwnershipDocument", "body", m.ProofOfTrailerOwnershipDocument); err != nil { + return err + } + + if m.ProofOfTrailerOwnershipDocument != nil { + if err := m.ProofOfTrailerOwnershipDocument.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfTrailerOwnershipDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfTrailerOwnershipDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateProofOfTrailerOwnershipDocumentID(formats strfmt.Registry) error { + + if err := validate.Required("proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { + return err + } + + if err := validate.FormatOf("proofOfTrailerOwnershipDocumentId", "body", "uuid", m.ProofOfTrailerOwnershipDocumentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateReason(formats strfmt.Registry) error { + if swag.IsZero(m.Reason) { // not required + return nil + } + + if m.Reason != nil { + if err := m.Reason.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + if m.Status != nil { + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) validateSubmittedEmptyWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedEmptyWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedEmptyWeight", "body", *m.SubmittedEmptyWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateSubmittedFullWeight(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedFullWeight) { // not required + return nil + } + + if err := validate.MinimumInt("submittedFullWeight", "body", *m.SubmittedFullWeight, 0, false); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) validateUpdatedAt(formats strfmt.Registry) error { + + if err := validate.Required("updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this weight ticket based on the context it is used +func (m *WeightTicket) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEmptyDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEmptyDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFullDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFullDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfTrailerOwnershipDocument(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfTrailerOwnershipDocumentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WeightTicket) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateEmptyDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.EmptyDocument != nil { + + if err := m.EmptyDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("emptyDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("emptyDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateEmptyDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "emptyDocumentId", "body", strfmt.UUID(m.EmptyDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateFullDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.FullDocument != nil { + + if err := m.FullDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("fullDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("fullDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateFullDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "fullDocumentId", "body", strfmt.UUID(m.FullDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidatePpmShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "ppmShipmentId", "body", strfmt.UUID(m.PpmShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocument(ctx context.Context, formats strfmt.Registry) error { + + if m.ProofOfTrailerOwnershipDocument != nil { + + if err := m.ProofOfTrailerOwnershipDocument.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfTrailerOwnershipDocument") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfTrailerOwnershipDocument") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateProofOfTrailerOwnershipDocumentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "proofOfTrailerOwnershipDocumentId", "body", strfmt.UUID(m.ProofOfTrailerOwnershipDocumentID)); err != nil { + return err + } + + return nil +} + +func (m *WeightTicket) contextValidateReason(ctx context.Context, formats strfmt.Registry) error { + + if m.Reason != nil { + + if swag.IsZero(m.Reason) { // not required + return nil + } + + if err := m.Reason.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reason") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reason") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if m.Status != nil { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + } + + return nil +} + +func (m *WeightTicket) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WeightTicket) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WeightTicket) UnmarshalBinary(b []byte) error { + var res WeightTicket + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/internalmessages/weight_ticket_set_type.go b/pkg/gen/internalmessages/weight_ticket_set_type.go new file mode 100644 index 00000000000..ad72c048640 --- /dev/null +++ b/pkg/gen/internalmessages/weight_ticket_set_type.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// WeightTicketSetType Select weight ticket type +// +// swagger:model WeightTicketSetType +type WeightTicketSetType string + +func NewWeightTicketSetType(value WeightTicketSetType) *WeightTicketSetType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated WeightTicketSetType. +func (m WeightTicketSetType) Pointer() *WeightTicketSetType { + return &m +} + +const ( + + // WeightTicketSetTypeCAR captures enum value "CAR" + WeightTicketSetTypeCAR WeightTicketSetType = "CAR" + + // WeightTicketSetTypeCARTRAILER captures enum value "CAR_TRAILER" + WeightTicketSetTypeCARTRAILER WeightTicketSetType = "CAR_TRAILER" + + // WeightTicketSetTypeBOXTRUCK captures enum value "BOX_TRUCK" + WeightTicketSetTypeBOXTRUCK WeightTicketSetType = "BOX_TRUCK" + + // WeightTicketSetTypePROGEAR captures enum value "PRO_GEAR" + WeightTicketSetTypePROGEAR WeightTicketSetType = "PRO_GEAR" +) + +// for schema +var weightTicketSetTypeEnum []interface{} + +func init() { + var res []WeightTicketSetType + if err := json.Unmarshal([]byte(`["CAR","CAR_TRAILER","BOX_TRUCK","PRO_GEAR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + weightTicketSetTypeEnum = append(weightTicketSetTypeEnum, v) + } +} + +func (m WeightTicketSetType) validateWeightTicketSetTypeEnum(path, location string, value WeightTicketSetType) error { + if err := validate.EnumCase(path, location, value, weightTicketSetTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this weight ticket set type +func (m WeightTicketSetType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateWeightTicketSetTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this weight ticket set type based on context it is used +func (m WeightTicketSetType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/internalmessages/weight_tickets.go b/pkg/gen/internalmessages/weight_tickets.go new file mode 100644 index 00000000000..a25a4755ecc --- /dev/null +++ b/pkg/gen/internalmessages/weight_tickets.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package internalmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// WeightTickets All weight tickets associated with a PPM shipment. +// +// swagger:model WeightTickets +type WeightTickets []*WeightTicket + +// Validate validates this weight tickets +func (m WeightTickets) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this weight tickets based on the context it is used +func (m WeightTickets) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeapi/configure_mymove.go b/pkg/gen/primeapi/configure_mymove.go new file mode 100644 index 00000000000..c538a478d02 --- /dev/null +++ b/pkg/gen/primeapi/configure_mymove.go @@ -0,0 +1,183 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package primeapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/payment_request" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime.yaml --api-package primeoperations --model-package primemessages --server-package primeapi --principal interface{} --exclude-main + +func configureFlags(api *primeoperations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *primeoperations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + api.MultipartformConsumer = runtime.DiscardConsumer + + api.BinProducer = runtime.ByteStreamProducer() + api.JSONProducer = runtime.JSONProducer() + + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // move_task_order.CreateExcessWeightRecordMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // mto_service_item.CreateServiceRequestDocumentUploadMaxParseMemory = 32 << 20 + // You may change here the memory limit for this multipart form parser. Below is the default (32 MB). + // payment_request.CreateUploadMaxParseMemory = 32 << 20 + + if api.MoveTaskOrderCreateExcessWeightRecordHandler == nil { + api.MoveTaskOrderCreateExcessWeightRecordHandler = move_task_order.CreateExcessWeightRecordHandlerFunc(func(params move_task_order.CreateExcessWeightRecordParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.CreateExcessWeightRecord has not yet been implemented") + }) + } + if api.MtoShipmentCreateMTOAgentHandler == nil { + api.MtoShipmentCreateMTOAgentHandler = mto_shipment.CreateMTOAgentHandlerFunc(func(params mto_shipment.CreateMTOAgentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOAgent has not yet been implemented") + }) + } + if api.MtoServiceItemCreateMTOServiceItemHandler == nil { + api.MtoServiceItemCreateMTOServiceItemHandler = mto_service_item.CreateMTOServiceItemHandlerFunc(func(params mto_service_item.CreateMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.CreateMTOServiceItem has not yet been implemented") + }) + } + if api.MtoShipmentCreateMTOShipmentHandler == nil { + api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }) + } + if api.PaymentRequestCreatePaymentRequestHandler == nil { + api.PaymentRequestCreatePaymentRequestHandler = payment_request.CreatePaymentRequestHandlerFunc(func(params payment_request.CreatePaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.CreatePaymentRequest has not yet been implemented") + }) + } + if api.MtoShipmentCreateSITExtensionHandler == nil { + api.MtoShipmentCreateSITExtensionHandler = mto_shipment.CreateSITExtensionHandlerFunc(func(params mto_shipment.CreateSITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateSITExtension has not yet been implemented") + }) + } + if api.MtoServiceItemCreateServiceRequestDocumentUploadHandler == nil { + api.MtoServiceItemCreateServiceRequestDocumentUploadHandler = mto_service_item.CreateServiceRequestDocumentUploadHandlerFunc(func(params mto_service_item.CreateServiceRequestDocumentUploadParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.CreateServiceRequestDocumentUpload has not yet been implemented") + }) + } + if api.PaymentRequestCreateUploadHandler == nil { + api.PaymentRequestCreateUploadHandler = payment_request.CreateUploadHandlerFunc(func(params payment_request.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.CreateUpload has not yet been implemented") + }) + } + if api.MtoShipmentDeleteMTOShipmentHandler == nil { + api.MtoShipmentDeleteMTOShipmentHandler = mto_shipment.DeleteMTOShipmentHandlerFunc(func(params mto_shipment.DeleteMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.DeleteMTOShipment has not yet been implemented") + }) + } + if api.MoveTaskOrderDownloadMoveOrderHandler == nil { + api.MoveTaskOrderDownloadMoveOrderHandler = move_task_order.DownloadMoveOrderHandlerFunc(func(params move_task_order.DownloadMoveOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.DownloadMoveOrder has not yet been implemented") + }) + } + if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { + api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }) + } + if api.MoveTaskOrderListMovesHandler == nil { + api.MoveTaskOrderListMovesHandler = move_task_order.ListMovesHandlerFunc(func(params move_task_order.ListMovesParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.ListMoves has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOAgentHandler == nil { + api.MtoShipmentUpdateMTOAgentHandler = mto_shipment.UpdateMTOAgentHandlerFunc(func(params mto_shipment.UpdateMTOAgentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOAgent has not yet been implemented") + }) + } + if api.MoveTaskOrderUpdateMTOPostCounselingInformationHandler == nil { + api.MoveTaskOrderUpdateMTOPostCounselingInformationHandler = move_task_order.UpdateMTOPostCounselingInformationHandlerFunc(func(params move_task_order.UpdateMTOPostCounselingInformationParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOPostCounselingInformation has not yet been implemented") + }) + } + if api.MtoServiceItemUpdateMTOServiceItemHandler == nil { + api.MtoServiceItemUpdateMTOServiceItemHandler = mto_service_item.UpdateMTOServiceItemHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItem has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentHandler == nil { + api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentAddressHandler == nil { + api.MtoShipmentUpdateMTOShipmentAddressHandler = mto_shipment.UpdateMTOShipmentAddressHandlerFunc(func(params mto_shipment.UpdateMTOShipmentAddressParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentAddress has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentStatusHandler == nil { + api.MtoShipmentUpdateMTOShipmentStatusHandler = mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") + }) + } + if api.MtoShipmentUpdateReweighHandler == nil { + api.MtoShipmentUpdateReweighHandler = mto_shipment.UpdateReweighHandlerFunc(func(params mto_shipment.UpdateReweighParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateReweigh has not yet been implemented") + }) + } + if api.MtoShipmentUpdateShipmentDestinationAddressHandler == nil { + api.MtoShipmentUpdateShipmentDestinationAddressHandler = mto_shipment.UpdateShipmentDestinationAddressHandlerFunc(func(params mto_shipment.UpdateShipmentDestinationAddressParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateShipmentDestinationAddress has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/primeapi/doc.go b/pkg/gen/primeapi/doc.go new file mode 100644 index 00000000000..3ad89caf91a --- /dev/null +++ b/pkg/gen/primeapi/doc.go @@ -0,0 +1,28 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package primeapi MilMove Prime API +// +// The Prime API is a RESTful API that enables the Prime contractor to request +// information about upcoming moves, update the details and status of those moves, +// and make payment requests. It uses Mutual TLS for authentication procedures. +// +// All endpoints are located at `/prime/v1/`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /prime/v1 +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// - multipart/form-data +// +// Produces: +// - application/pdf +// - application/json +// +// swagger:meta +package primeapi diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go new file mode 100644 index 00000000000..5ce22a16bfb --- /dev/null +++ b/pkg/gen/primeapi/embedded_spec.go @@ -0,0 +1,9491 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primeapi + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v1/` + "`" + `.\n", + "title": "MilMove Prime API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v1", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use.", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/excess-weight-record": { + "post": { + "description": "Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "createExcessWeightRecord", + "operationId": "createExcessWeightRecord", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move being updated.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully uploaded the excess weight record file.", + "schema": { + "$ref": "#/definitions/ExcessWeightRecord" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/post-counseling-info": { + "patch": { + "description": "### Functionality\nThis endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling.\nThis update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update.\nNo body object is expected for this request.\n\n**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs.\n\n**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "updateMTOPostCounselingInformation", + "operationId": "updateMTOPostCounselingInformation", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order with post counseling information.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move task order to use.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/moves": { + "get": { + "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "listMoves", + "operationId": "listMoves", + "parameters": [ + { + "type": "string", + "format": "date-time", + "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/ListMoves" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/moves/{locator}/documents": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentations into one download file by locator.\n\n### Errors\n* The move must be in need counseling state.\n* The move client's origin duty location must not currently have gov counseling.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Downloads move order as a PDF", + "operationId": "downloadMoveOrder", + "parameters": [ + { + "type": "string", + "description": "the locator code for move order to be downloaded", + "name": "locator", + "in": "path", + "required": true + }, + { + "enum": [ + "ALL", + "ORDERS", + "AMENDMENTS" + ], + "type": "string", + "default": "ALL", + "description": "upload type", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Move Order PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-service-items": { + "post": { + "description": "Creates one or more MTOServiceItems. Not all service items may be created, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to create and the documentation will update with the new definition.\n\nUpon creation these items are associated with a Move Task Order and an MTO Shipment.\nThe request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require\nadditional service items to be autogenerated when added - all created service items, autogenerated included,\nwill be returned in the response.\n\nTo update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint.\n\n---\n\n**` + "`" + `MTOServiceItemOriginSIT` + "`" + `**\n\nMTOServiceItemOriginSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic origin SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DOFSIT**\n\n**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items:\n * DOFSIT - Domestic origin 1st day SIT\n * DOASIT - Domestic origin Additional day SIT\n * DOPSIT - Domestic origin SIT pickup\n * DOSFSC - Domestic origin SIT fuel surcharge\n\n**DOASIT**\n\n**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item.\nAdditional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**.\n\n---\n\n**` + "`" + `MTOServiceItemDestSIT` + "`" + `**\n\nMTOServiceItemDestSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic destination SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DDFSIT**\n\n**1st day destination SIT service item**.\n\nThese additional fields are optional for creating a DDFSIT:\n * ` + "`" + `firstAvailableDeliveryDate1` + "`" + `\n * string \u003cdate\u003e\n * First available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together\n * ` + "`" + `dateOfContact1` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `\n * dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `timeMilitary1` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.\n * timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `firstAvailableDeliveryDate2` + "`" + `\n * string \u003cdate\u003e\n * Second available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together\n * ` + "`" + `dateOfContact2` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact delivery by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `\n * dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together\n * ` + "`" + `timeMilitary2` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.\n * timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together\n\nWhen a DDFSIT is requested, the API will auto-create the following group of service items:\n * DDFSIT - Domestic destination 1st day SIT\n * DDASIT - Domestic destination Additional day SIT\n * DDDSIT - Domestic destination SIT delivery\n * DDSFSC - Domestic destination SIT fuel surcharge\n\n**NOTE** When providing the ` + "`" + `sitEntryDate` + "`" + ` value in the payload, please ensure that the date is not BEFORE\n` + "`" + `firstAvailableDeliveryDate1` + "`" + ` or ` + "`" + `firstAvailableDeliveryDate2` + "`" + `. If it is, you will receive an error response.\n\n**DDASIT**\n\n**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item.\nAdditional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "createMTOServiceItem", + "operationId": "createMTOServiceItem", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + } + ], + "responses": { + "200": { + "description": "Successfully created an MTO service item.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}": { + "patch": { + "description": "Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to update and the documentation will update with the new definition.\n\n* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address.\nFor approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress).\nFor shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress).\n\n* SIT Service Items: Take note that when updating ` + "`" + `sitCustomerContacted` + "`" + `, ` + "`" + `sitDepartureDate` + "`" + `, or ` + "`" + `sitRequestedDelivery` + "`" + `, we want\nthose to be updated on ` + "`" + `DOASIT` + "`" + ` (for origin SIT) and ` + "`" + `DDASIT` + "`" + ` (for destination SIT). If updating those values in other service\nitems, the office users will not have as much attention to those values.\n\nTo create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint.\n\n* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from\nREJECTED to SUBMITTED. Please provide the ` + "`" + `requestedApprovalsRequestedStatus: true` + "`" + ` when resubmitting as this will give attention to the TOO to\nreview the resubmitted SIT service item. Another note, ` + "`" + `updateReason` + "`" + ` must have a different value than the current ` + "`" + `reason` + "`" + ` value on the service item.\nIf this value is not updated, then an error will be sent back.\n\nThe following SIT service items can be resubmitted following a rejection:\n- DDASIT\n- DDDSIT\n- DDFSIT\n- DOASIT\n- DOPSIT\n- DOFSIT\n- DDSFSC\n- DOSFSC\n\nAt a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"reServiceCode\": \"DDFSIT\",\n \"updateReason\": \"A reason that differs from the previous reason\",\n \"modelType\": \"UpdateMTOServiceItemSIT\",\n \"requestApprovalsRequestedStatus\": true\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nThe following service items allow you to update the Port that the shipment will use:\n- PODFSC (Port of Debarkation can be updated)\n- POEFSC (Port of Embarkation can be updated)\n\nAt a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item.\nPlease see the example payload below:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"id\": \"1ed224b6-c65e-4616-b88e-8304d26c9562\",\n \"modelType\": \"UpdateMTOServiceItemInternationalPortFSC\",\n \"portCode\": \"SEA\",\n \"reServiceCode\": \"POEFSC\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "updateMTOServiceItem", + "operationId": "updateMTOServiceItem", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOServiceItem" + } + }, + { + "type": "string", + "description": "UUID of service item to update.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO service item.", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}/uploads": { + "post": { + "description": "### Functionality\n\nThis endpoint **uploads** a Service Request document for a\nServiceItem.\n\nThe ServiceItem should already exist.\n\nServiceItems are created with the\n[createMTOServiceItem](#operation/createMTOServiceItem)\nendpoint.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "createServiceRequestDocumentUpload", + "operationId": "createServiceRequestDocumentUpload", + "parameters": [ + { + "type": "string", + "description": "UUID of the service item to use.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully created upload of digital file.", + "schema": { + "$ref": "#/definitions/UploadWithOmissions" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead.\n", + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "deprecated": true, + "responses": { + "410": { + "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead." + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "delete": { + "description": "### Functionality\nThis endpoint deletes an individual shipment by ID.\n\n### Errors\n* The mtoShipment should be associated with an MTO that is available to prime.\n* The mtoShipment must be a PPM shipment.\n* Counseling should not have already been completed for the associated MTO.\n", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "deleteMTOShipment", + "operationId": "deleteMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment to be deleted", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully deleted the MTO shipment." + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "patch": { + "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead.\n", + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "410": { + "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead." + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/addresses/{addressID}": { + "put": { + "description": "### Functionality\nThis endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID.\nTherefore a complete address should be sent in the request.\nWhen a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match.\n\nThis endpoint **cannot create** an address.\nTo create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address.\n\n### Errors\nThe address must be associated with the mtoShipment passed in the url.\nIn other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided.\nIf it is not, caller will receive a **Conflict** Error.\n\nThe mtoShipment should be associated with an MTO that is available to prime.\nIf the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentAddress", + "operationId": "updateMTOShipmentAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the address", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the address being updated", + "name": "addressID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Address" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the address.", + "schema": { + "$ref": "#/definitions/Address" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/agents": { + "post": { + "description": "### Functionality\nThis endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Pime.\nIf the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOAgent", + "operationId": "createMTOAgent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOAgent" + } + } + ], + "responses": { + "200": { + "description": "Successfully added the agent.", + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/agents/{agentID}": { + "put": { + "description": "### Functionality\nThis endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors:\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Prime.\nIf the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOAgent", + "operationId": "updateMTOAgent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the agent being updated", + "name": "agentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the agent.", + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}": { + "patch": { + "description": "### Functionality\nThis endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur.\nOnly one of weight or verificationReason should be sent in the request body.\n\nA reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment.\nA reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed,\nso not all shipments will have a reweigh weight.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateReweigh", + "operationId": "updateReweigh", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the reweigh", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the reweigh being updated", + "name": "reweighID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateReweigh" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the reweigh.", + "schema": { + "$ref": "#/definitions/Reweigh" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/shipment-address-updates": { + "post": { + "description": "### Functionality\nThis endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment,\nafter the delivery address has already been approved.\n\nThis endpoint and operation only supports the following shipment types:\n- HHG\n- NTSR\n\nFor HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved.\n\nAddress updates will be automatically approved unless they change:\n - The service area\n - Mileage bracket for direct delivery\n - the address and the distance between the old and new address is \u003e 50\n - Domestic Short Haul to Domestic Line Haul or vice versa\n - Shipments that start and end in one ZIP3 use Short Haul pricing\n - Shipments that start and end in different ZIP3s use Line Haul pricing\n\nFor those, changes will require TOO approval.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateShipmentDestinationAddress", + "operationId": "updateShipmentDestinationAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the address", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateShipmentDestinationAddress" + } + }, + { + "type": "string", + "description": "Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully created the address update request.", + "schema": { + "$ref": "#/definitions/ShipmentAddressUpdate" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/sit-extensions": { + "post": { + "description": "### Functionality\nThis endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an\nincrease in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance\nincludes time spent in both origin and destination SIT.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createSITExtension", + "operationId": "createSITExtension", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSITExtension" + } + } + ], + "responses": { + "201": { + "description": "Successfully created the sit extension request.", + "schema": { + "$ref": "#/definitions/SITExtension" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/status": { + "patch": { + "description": "### Functionality\nThis endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment\nstatus to be changed to \"CANCELED.\" Currently, the Prime cannot update the shipment to any other status.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentStatus", + "operationId": "updateMTOShipmentStatus", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipmentStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the shipment's status.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/payment-requests": { + "post": { + "description": "Creates a new instance of a paymentRequest and is assigned the status ` + "`" + `PENDING` + "`" + `.\nA move task order can have multiple payment requests, and\na final payment request can be marked using boolean ` + "`" + `isFinal` + "`" + `.\n\nIf a ` + "`" + `PENDING` + "`" + ` payment request is recalculated,\na new payment request is created and the original request is\nmarked with the status ` + "`" + `DEPRECATED` + "`" + `.\n\n**NOTE**: In order to create a payment request for most service items, the shipment *must*\nbe updated with the ` + "`" + `PrimeActualWeight` + "`" + ` value via [updateMTOShipment](#operation/updateMTOShipment).\n\nIf ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n\n**NOTE**: Diversions have a unique calcuation for payment requests without a ` + "`" + `WeightBilled` + "`" + ` parameter.\n\nIf you created a payment request for a diversion and ` + "`" + `WeightBilled` + "`" + ` is not provided, then the following will be used in the calculation:\n- The lowest shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) found in the diverted shipment chain.\n- The lowest reweigh weight found in the diverted shipment chain.\n\nThe diverted shipment chain is created by referencing the ` + "`" + `diversion` + "`" + ` boolean, ` + "`" + `divertedFromShipmentId` + "`" + ` UUID, and matching destination to pickup addresses.\nIf the chain cannot be established it will fall back to the ` + "`" + `PrimeActualWeight` + "`" + ` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations.\nThe lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found.\n\nA service item can be on several payment requests in the case of partial payment requests and payments.\n\nIn the request, if no params are necessary, then just the ` + "`" + `serviceItem` + "`" + ` ` + "`" + `id` + "`" + ` is required. For example:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"isFinal\": false,\n \"moveTaskOrderID\": \"uuid\",\n \"serviceItems\": [\n {\n \"id\": \"uuid\",\n },\n {\n \"id\": \"uuid\",\n \"params\": [\n {\n \"key\": \"Service Item Parameter Name\",\n \"value\": \"Service Item Parameter Value\"\n }\n ]\n }\n ],\n \"pointOfContact\": \"string\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DLH - Domestic Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DSH - Domestic Shorthaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**FSC - Fuel Surcharge**\n**NOTE**: FSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DUPK - Domestic Unpacking**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DNPK - Domestic NTS Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOP - Domestic Origin Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDP - Domestic Destination Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic SIT Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DOFSIT - Domestic origin 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOPSIT - Domestic origin SIT pickup**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOSHUT - Domestic origin shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDFSIT - Domestic destination 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDDSIT - Domestic destination SIT delivery**\n*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDSHUT - Domestic destination shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n\nInternational Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\nJust like domestic shipments \u0026 service items, if ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n**NOTE**: ` + "`" + `POEFSC` + "`" + ` \u0026 ` + "`" + `PODFSC` + "`" + ` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint.\n\n**ISLH - International Shipping \u0026 Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHPK - International HHG Pack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHUPK - International HHG Unpack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**POEFSC - International Port of Embarkation Fuel Surcharge**\n **NOTE**: POEFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `POELocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**PODFSC - International Port of Debarkation Fuel Surcharge**\n**NOTE**: PODFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `PODLocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "createPaymentRequest", + "operationId": "createPaymentRequest", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreatePaymentRequest" + } + } + ], + "responses": { + "201": { + "description": "Successfully created a paymentRequest object.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "Request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/payment-requests/{paymentRequestID}/uploads": { + "post": { + "description": "### Functionality\nThis endpoint **uploads** a Proof of Service document for a PaymentRequest.\n\nThe PaymentRequest should already exist.\n\nOptional key of **isWeightTicket** indicates if the document is a weight ticket or not.\nThis will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents.\nIf left empty, it will assume it is NOT a weight ticket.\n\nThe formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": true\n }\n ` + "`" + `` + "`" + `` + "`" + `\n If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": false\n }\n ` + "`" + `` + "`" + `` + "`" + `\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n }\n ` + "`" + `` + "`" + `` + "`" + `\n\nPaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "createUpload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "description": "UUID of payment request to use.", + "name": "paymentRequestID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "boolean", + "description": "Indicates whether the file is a weight ticket.", + "name": "isWeightTicket", + "in": "formData" + } + ], + "responses": { + "201": { + "description": "Successfully created upload of digital file.", + "schema": { + "$ref": "#/definitions/UploadWithOmissions" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Amendments": { + "description": "Metadata outlining number of amendments for given order.\n", + "type": "object", + "required": [ + "total", + "availableSince" + ], + "properties": { + "availableSince": { + "description": "The total count of amendments available since specified time.", + "type": "integer" + }, + "total": { + "description": "The total count of amendments.", + "type": "integer" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + } + } + }, + "CreatePaymentRequest": { + "type": "object", + "required": [ + "moveTaskOrderID", + "serviceItems" + ], + "properties": { + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "pointOfContact": { + "description": "Email or id of a contact person for this update.", + "type": "string" + }, + "serviceItems": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/ServiceItem" + } + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "ExcessWeightRecord": { + "description": "A document uploaded by the movers proving that the customer has been counseled about excess weight.", + "allOf": [ + { + "$ref": "#/definitions/UploadWithOmissions" + }, + { + "type": "object", + "required": [ + "moveId" + ], + "properties": { + "moveExcessWeightAcknowledgedAt": { + "description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "moveExcessWeightQualifiedAt": { + "description": "The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "moveId": { + "description": "The UUID of the move this excess weight record belongs to.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + } + ] + }, + "ListMove": { + "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", + "type": "object", + "properties": { + "amendments": { + "$ref": "#/definitions/Amendments" + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "JFK" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ListMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/ListMove" + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalFuelSurcharge": { + "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "properties": { + "portCode": { + "description": "A unique code for a Port", + "type": "string" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).", + "type": "string", + "enum": [ + "PODFSC", + "POEFSC" + ] + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "params": { + "description": "This should be populated for the following service items:\n * DOASIT(Domestic origin Additional day SIT)\n * DDASIT(Domestic destination Additional day SIT)\n\nBoth take in the following param keys:\n * ` + "`" + `SITPaymentRequestStart` + "`" + `\n * ` + "`" + `SITPaymentRequestEnd` + "`" + `\n\nThe value of each is a date string in the format \"YYYY-MM-DD\" (e.g. \"2023-01-15\")\n", + "type": "array", + "items": { + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "Service Item Parameter Name" + }, + "value": { + "type": "string", + "example": "Service Item Parameter Value" + } + } + } + } + } + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemInternationalPortFSC": { + "description": "Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "portCode": { + "description": "Port used for the shipment. Relevant for moving (PODFSC \u0026 POEFSC) service items.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "PDX" + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "PODFSC", + "POEFSC" + ] + } + } + } + ] + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DDFSIT - UpdateMTOServiceItemSIT\n * DDASIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DOSFSC - UpdateMTOServiceItemSIT\n * DDSFSC - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n * PODFSC - UpdateMTOServiceItemInternationalPortFSC\n * POEFSC - UpdateMTOServiceItemInternationalPortFSC\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle", + "UpdateMTOServiceItemInternationalPortFSC" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DDASIT", + "DDFSIT", + "DDSFSC", + "DOPSIT", + "DOASIT", + "DOFSIT", + "DOSFSC" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotImplemented": { + "description": "The requested feature is still in development.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + }, + { + "description": "A service item is a service that the contractor can bill for. For example, if the movers pack and/or unpack a\ncustomer's belongings, those are billable services (packing and unpacking). All **mtoServiceItems** must be\napproved by the TOO before payment can be requested.\n\nThere are three types of service items: accessorial, MTO-level, and standard.\n\n**WIP:** Add an external link to an article that explains the different types of service items in more detail.\n", + "name": "mtoServiceItem" + }, + { + "description": "The contractor submits a **paymentRequest** to the TIO for approval in order to be reimbursed for 1 or more\n**mtoServiceItems** on a **moveTaskOrder**. A service item can be on multiple payment requests if necessary.\n\nProof of service documentation may be uploaded for each **mtoServiceItem** in a **paymentRequest** after the payment\nrequest is created via the endpoint [createUpload](#operation/createUpload).\n\nAll weight entered should be in *pounds* and no other unit of measurement.\n", + "name": "paymentRequest" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment", + "mtoServiceItem", + "paymentRequest" + ] + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v1/` + "`" + `.\n", + "title": "MilMove Prime API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v1", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use.", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/excess-weight-record": { + "post": { + "description": "Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "createExcessWeightRecord", + "operationId": "createExcessWeightRecord", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the move being updated.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully uploaded the excess weight record file.", + "schema": { + "$ref": "#/definitions/ExcessWeightRecord" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}/post-counseling-info": { + "patch": { + "description": "### Functionality\nThis endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling.\nThis update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update.\nNo body object is expected for this request.\n\n**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs.\n\n**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "updateMTOPostCounselingInformation", + "operationId": "updateMTOPostCounselingInformation", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated move task order with post counseling information.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "ID of move task order to use.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/moves": { + "get": { + "description": "Gets all moves that have been reviewed and approved by the TOO. The ` + "`" + `since` + "`" + ` parameter can be used to filter this\nlist down to only the moves that have been updated since the provided timestamp. A move will be considered\nupdated if the ` + "`" + `updatedAt` + "`" + ` timestamp on the move or on its orders, shipments, service items, or payment\nrequests, is later than the provided date and time.\n\n**WIP**: Include what causes moves to leave this list. Currently, once the ` + "`" + `availableToPrimeAt` + "`" + ` timestamp has\nbeen set, that move will always appear in this list.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "listMoves", + "operationId": "listMoves", + "parameters": [ + { + "type": "string", + "format": "date-time", + "description": "Only return moves updated since this time. Formatted like \"2021-07-23T18:30:47.116Z\"", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved moves. A successful fetch might still return zero moves.", + "schema": { + "$ref": "#/definitions/ListMoves" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/moves/{locator}/documents": { + "get": { + "description": "### Functionality\nThis endpoint downloads all uploaded move order documentations into one download file by locator.\n\n### Errors\n* The move must be in need counseling state.\n* The move client's origin duty location must not currently have gov counseling.\n", + "produces": [ + "application/pdf" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "Downloads move order as a PDF", + "operationId": "downloadMoveOrder", + "parameters": [ + { + "type": "string", + "description": "the locator code for move order to be downloaded", + "name": "locator", + "in": "path", + "required": true + }, + { + "enum": [ + "ALL", + "ORDERS", + "AMENDMENTS" + ], + "type": "string", + "default": "ALL", + "description": "upload type", + "name": "type", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Move Order PDF", + "schema": { + "type": "file", + "format": "binary" + }, + "headers": { + "Content-Disposition": { + "type": "string", + "description": "File name to download" + } + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-service-items": { + "post": { + "description": "Creates one or more MTOServiceItems. Not all service items may be created, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to create and the documentation will update with the new definition.\n\nUpon creation these items are associated with a Move Task Order and an MTO Shipment.\nThe request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require\nadditional service items to be autogenerated when added - all created service items, autogenerated included,\nwill be returned in the response.\n\nTo update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint.\n\n---\n\n**` + "`" + `MTOServiceItemOriginSIT` + "`" + `**\n\nMTOServiceItemOriginSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic origin SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DOFSIT**\n\n**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items:\n * DOFSIT - Domestic origin 1st day SIT\n * DOASIT - Domestic origin Additional day SIT\n * DOPSIT - Domestic origin SIT pickup\n * DOSFSC - Domestic origin SIT fuel surcharge\n\n**DOASIT**\n\n**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item.\nAdditional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**.\n\n---\n\n**` + "`" + `MTOServiceItemDestSIT` + "`" + `**\n\nMTOServiceItemDestSIT is a subtype of MTOServiceItem.\n\nThis model type describes a domestic destination SIT service item. Items can be created using this\nmodel type with the following codes:\n\n**DDFSIT**\n\n**1st day destination SIT service item**.\n\nThese additional fields are optional for creating a DDFSIT:\n * ` + "`" + `firstAvailableDeliveryDate1` + "`" + `\n * string \u003cdate\u003e\n * First available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together\n * ` + "`" + `dateOfContact1` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `\n * dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `timeMilitary1` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.\n * timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together\n * ` + "`" + `firstAvailableDeliveryDate2` + "`" + `\n * string \u003cdate\u003e\n * Second available date that Prime can deliver SIT service item.\n * firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together\n * ` + "`" + `dateOfContact2` + "`" + `\n * string \u003cdate\u003e\n * Date of attempted contact delivery by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `\n * dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together\n * ` + "`" + `timeMilitary2` + "`" + `\n * string\\d{4}Z\n * Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.\n * timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together\n\nWhen a DDFSIT is requested, the API will auto-create the following group of service items:\n * DDFSIT - Domestic destination 1st day SIT\n * DDASIT - Domestic destination Additional day SIT\n * DDDSIT - Domestic destination SIT delivery\n * DDSFSC - Domestic destination SIT fuel surcharge\n\n**NOTE** When providing the ` + "`" + `sitEntryDate` + "`" + ` value in the payload, please ensure that the date is not BEFORE\n` + "`" + `firstAvailableDeliveryDate1` + "`" + ` or ` + "`" + `firstAvailableDeliveryDate2` + "`" + `. If it is, you will receive an error response.\n\n**DDASIT**\n\n**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item.\nAdditional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "createMTOServiceItem", + "operationId": "createMTOServiceItem", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + } + ], + "responses": { + "200": { + "description": "Successfully created an MTO service item.", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}": { + "patch": { + "description": "Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below.\n\nThis endpoint supports different body definitions. In the modelType field below, select the modelType corresponding\n to the service item you wish to update and the documentation will update with the new definition.\n\n* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address.\nFor approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress).\nFor shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress).\n\n* SIT Service Items: Take note that when updating ` + "`" + `sitCustomerContacted` + "`" + `, ` + "`" + `sitDepartureDate` + "`" + `, or ` + "`" + `sitRequestedDelivery` + "`" + `, we want\nthose to be updated on ` + "`" + `DOASIT` + "`" + ` (for origin SIT) and ` + "`" + `DDASIT` + "`" + ` (for destination SIT). If updating those values in other service\nitems, the office users will not have as much attention to those values.\n\nTo create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint.\n\n* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from\nREJECTED to SUBMITTED. Please provide the ` + "`" + `requestedApprovalsRequestedStatus: true` + "`" + ` when resubmitting as this will give attention to the TOO to\nreview the resubmitted SIT service item. Another note, ` + "`" + `updateReason` + "`" + ` must have a different value than the current ` + "`" + `reason` + "`" + ` value on the service item.\nIf this value is not updated, then an error will be sent back.\n\nThe following SIT service items can be resubmitted following a rejection:\n- DDASIT\n- DDDSIT\n- DDFSIT\n- DOASIT\n- DOPSIT\n- DOFSIT\n- DDSFSC\n- DOSFSC\n\nAt a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"reServiceCode\": \"DDFSIT\",\n \"updateReason\": \"A reason that differs from the previous reason\",\n \"modelType\": \"UpdateMTOServiceItemSIT\",\n \"requestApprovalsRequestedStatus\": true\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nThe following service items allow you to update the Port that the shipment will use:\n- PODFSC (Port of Debarkation can be updated)\n- POEFSC (Port of Embarkation can be updated)\n\nAt a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item.\nPlease see the example payload below:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"id\": \"1ed224b6-c65e-4616-b88e-8304d26c9562\",\n \"modelType\": \"UpdateMTOServiceItemInternationalPortFSC\",\n \"portCode\": \"SEA\",\n \"reServiceCode\": \"POEFSC\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "updateMTOServiceItem", + "operationId": "updateMTOServiceItem", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOServiceItem" + } + }, + { + "type": "string", + "description": "UUID of service item to update.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO service item.", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}/uploads": { + "post": { + "description": "### Functionality\n\nThis endpoint **uploads** a Service Request document for a\nServiceItem.\n\nThe ServiceItem should already exist.\n\nServiceItems are created with the\n[createMTOServiceItem](#operation/createMTOServiceItem)\nendpoint.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "createServiceRequestDocumentUpload", + "operationId": "createServiceRequestDocumentUpload", + "parameters": [ + { + "type": "string", + "description": "UUID of the service item to use.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully created upload of digital file.", + "schema": { + "$ref": "#/definitions/UploadWithOmissions" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead.\n", + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "deprecated": true, + "responses": { + "410": { + "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/createMTOShipment` + "`" + ` instead." + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "delete": { + "description": "### Functionality\nThis endpoint deletes an individual shipment by ID.\n\n### Errors\n* The mtoShipment should be associated with an MTO that is available to prime.\n* The mtoShipment must be a PPM shipment.\n* Counseling should not have already been completed for the associated MTO.\n", + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "deleteMTOShipment", + "operationId": "deleteMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment to be deleted", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "204": { + "description": "Successfully deleted the MTO shipment." + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "patch": { + "description": "_[Deprecated: this endpoint was deprecated on August 5th, 2024]_\nPlease use the new endpoint at ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead.\n", + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "deprecated": true, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ], + "responses": { + "410": { + "description": "This endpoint is deprecated. Please use ` + "`" + `/prime/v3/updateMTOShipment` + "`" + ` instead." + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/addresses/{addressID}": { + "put": { + "description": "### Functionality\nThis endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID.\nTherefore a complete address should be sent in the request.\nWhen a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match.\n\nThis endpoint **cannot create** an address.\nTo create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address.\n\n### Errors\nThe address must be associated with the mtoShipment passed in the url.\nIn other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided.\nIf it is not, caller will receive a **Conflict** Error.\n\nThe mtoShipment should be associated with an MTO that is available to prime.\nIf the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentAddress", + "operationId": "updateMTOShipmentAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the address", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the address being updated", + "name": "addressID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/Address" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the address.", + "schema": { + "$ref": "#/definitions/Address" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/agents": { + "post": { + "description": "### Functionality\nThis endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Pime.\nIf the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOAgent", + "operationId": "createMTOAgent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOAgent" + } + } + ], + "responses": { + "200": { + "description": "Successfully added the agent.", + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/agents/{agentID}": { + "put": { + "description": "### Functionality\nThis endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body.\n\n### Errors:\nThe agent must always have a name and at least one method of contact (either ` + "`" + `email` + "`" + ` or ` + "`" + `phone` + "`" + `).\n\nThe agent must be associated with the MTO shipment passed in the url.\n\nThe shipment should be associated with an MTO that is available to the Prime.\nIf the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOAgent", + "operationId": "updateMTOAgent", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the agent being updated", + "name": "agentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the agent.", + "schema": { + "$ref": "#/definitions/MTOAgent" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}": { + "patch": { + "description": "### Functionality\nThis endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur.\nOnly one of weight or verificationReason should be sent in the request body.\n\nA reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment.\nA reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed,\nso not all shipments will have a reweigh weight.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateReweigh", + "operationId": "updateReweigh", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the reweigh", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the reweigh being updated", + "name": "reweighID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateReweigh" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the reweigh.", + "schema": { + "$ref": "#/definitions/Reweigh" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/shipment-address-updates": { + "post": { + "description": "### Functionality\nThis endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment,\nafter the delivery address has already been approved.\n\nThis endpoint and operation only supports the following shipment types:\n- HHG\n- NTSR\n\nFor HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved.\n\nAddress updates will be automatically approved unless they change:\n - The service area\n - Mileage bracket for direct delivery\n - the address and the distance between the old and new address is \u003e 50\n - Domestic Short Haul to Domestic Line Haul or vice versa\n - Shipments that start and end in one ZIP3 use Short Haul pricing\n - Shipments that start and end in different ZIP3s use Line Haul pricing\n\nFor those, changes will require TOO approval.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateShipmentDestinationAddress", + "operationId": "updateShipmentDestinationAddress", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the address", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateShipmentDestinationAddress" + } + }, + { + "type": "string", + "description": "Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "201": { + "description": "Successfully created the address update request.", + "schema": { + "$ref": "#/definitions/ShipmentAddressUpdate" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/sit-extensions": { + "post": { + "description": "### Functionality\nThis endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an\nincrease in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance\nincludes time spent in both origin and destination SIT.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createSITExtension", + "operationId": "createSITExtension", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/CreateSITExtension" + } + } + ], + "responses": { + "201": { + "description": "Successfully created the sit extension request.", + "schema": { + "$ref": "#/definitions/SITExtension" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}/status": { + "patch": { + "description": "### Functionality\nThis endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment\nstatus to be changed to \"CANCELED.\" Currently, the Prime cannot update the shipment to any other status.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentStatus", + "operationId": "updateMTOShipmentStatus", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment associated with the agent", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipmentStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the shipment's status.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/payment-requests": { + "post": { + "description": "Creates a new instance of a paymentRequest and is assigned the status ` + "`" + `PENDING` + "`" + `.\nA move task order can have multiple payment requests, and\na final payment request can be marked using boolean ` + "`" + `isFinal` + "`" + `.\n\nIf a ` + "`" + `PENDING` + "`" + ` payment request is recalculated,\na new payment request is created and the original request is\nmarked with the status ` + "`" + `DEPRECATED` + "`" + `.\n\n**NOTE**: In order to create a payment request for most service items, the shipment *must*\nbe updated with the ` + "`" + `PrimeActualWeight` + "`" + ` value via [updateMTOShipment](#operation/updateMTOShipment).\n\nIf ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n\n**NOTE**: Diversions have a unique calcuation for payment requests without a ` + "`" + `WeightBilled` + "`" + ` parameter.\n\nIf you created a payment request for a diversion and ` + "`" + `WeightBilled` + "`" + ` is not provided, then the following will be used in the calculation:\n- The lowest shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) found in the diverted shipment chain.\n- The lowest reweigh weight found in the diverted shipment chain.\n\nThe diverted shipment chain is created by referencing the ` + "`" + `diversion` + "`" + ` boolean, ` + "`" + `divertedFromShipmentId` + "`" + ` UUID, and matching destination to pickup addresses.\nIf the chain cannot be established it will fall back to the ` + "`" + `PrimeActualWeight` + "`" + ` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations.\nThe lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found.\n\nA service item can be on several payment requests in the case of partial payment requests and payments.\n\nIn the request, if no params are necessary, then just the ` + "`" + `serviceItem` + "`" + ` ` + "`" + `id` + "`" + ` is required. For example:\n` + "`" + `` + "`" + `` + "`" + `json\n{\n \"isFinal\": false,\n \"moveTaskOrderID\": \"uuid\",\n \"serviceItems\": [\n {\n \"id\": \"uuid\",\n },\n {\n \"id\": \"uuid\",\n \"params\": [\n {\n \"key\": \"Service Item Parameter Name\",\n \"value\": \"Service Item Parameter Value\"\n }\n ]\n }\n ],\n \"pointOfContact\": \"string\"\n}\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DLH - Domestic Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DSH - Domestic Shorthaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**FSC - Fuel Surcharge**\n**NOTE**: FSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DUPK - Domestic Unpacking**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DNPK - Domestic NTS Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DPK - Domestic Packing**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOP - Domestic Origin Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDP - Domestic Destination Price**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\nDomestic SIT Service Items \u0026 Accepted Payment Request Parameters:\n---\n\n**DOFSIT - Domestic origin 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOPSIT - Domestic origin SIT pickup**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DOSHUT - Domestic origin shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDFSIT - Domestic destination 1st day SIT**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart \u0026 SITPaymentRequestEnd are **REQUIRED**)*\n*To create a paymentRequest for this service item, the ` + "`" + `SITPaymentRequestStart` + "`" + ` and ` + "`" + `SITPaymentRequestEnd` + "`" + ` dates must not overlap previously requested SIT dates.*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n },\n {\n \"key\": \"SITPaymentRequestStart\",\n \"value\": \"date\"\n },\n {\n \"key\": \"SITPaymentRequestEnd\",\n \"value\": \"date\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDDSIT - Domestic destination SIT delivery**\n*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).*\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**DDSHUT - Domestic destination shuttle service**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n\nInternational Basic Service Items \u0026 Accepted Payment Request Parameters:\n---\nJust like domestic shipments \u0026 service items, if ` + "`" + `WeightBilled` + "`" + ` is not provided then the full shipment weight (` + "`" + `PrimeActualWeight` + "`" + `) will be considered in the calculation.\n**NOTE**: ` + "`" + `POEFSC` + "`" + ` \u0026 ` + "`" + `PODFSC` + "`" + ` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint.\n\n**ISLH - International Shipping \u0026 Linehaul**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHPK - International HHG Pack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**IHUPK - International HHG Unpack**\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**POEFSC - International Port of Embarkation Fuel Surcharge**\n **NOTE**: POEFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `POELocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n\n**PODFSC - International Port of Debarkation Fuel Surcharge**\n**NOTE**: PODFSC requires ` + "`" + `ActualPickupDate` + "`" + ` to be updated on the shipment \u0026 ` + "`" + `PODLocation` + "`" + ` on the service item.\n` + "`" + `` + "`" + `` + "`" + `json\n \"params\": [\n {\n \"key\": \"WeightBilled\",\n \"value\": \"integer\"\n }\n ]\n` + "`" + `` + "`" + `` + "`" + `\n---\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "createPaymentRequest", + "operationId": "createPaymentRequest", + "parameters": [ + { + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreatePaymentRequest" + } + } + ], + "responses": { + "201": { + "description": "Successfully created a paymentRequest object.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "Request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/payment-requests/{paymentRequestID}/uploads": { + "post": { + "description": "### Functionality\nThis endpoint **uploads** a Proof of Service document for a PaymentRequest.\n\nThe PaymentRequest should already exist.\n\nOptional key of **isWeightTicket** indicates if the document is a weight ticket or not.\nThis will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents.\nIf left empty, it will assume it is NOT a weight ticket.\n\nThe formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": true\n }\n ` + "`" + `` + "`" + `` + "`" + `\n If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty:\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n \"isWeightTicket\": false\n }\n ` + "`" + `` + "`" + `` + "`" + `\n ` + "`" + `` + "`" + `` + "`" + `json\n {\n \"file\": \"filePath\",\n }\n ` + "`" + `` + "`" + `` + "`" + `\n\nPaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint.\n", + "consumes": [ + "multipart/form-data" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "createUpload", + "operationId": "createUpload", + "parameters": [ + { + "type": "string", + "description": "UUID of payment request to use.", + "name": "paymentRequestID", + "in": "path", + "required": true + }, + { + "type": "file", + "description": "The file to upload.", + "name": "file", + "in": "formData", + "required": true + }, + { + "type": "boolean", + "description": "Indicates whether the file is a weight ticket.", + "name": "isWeightTicket", + "in": "formData" + } + ], + "responses": { + "201": { + "description": "Successfully created upload of digital file.", + "schema": { + "$ref": "#/definitions/UploadWithOmissions" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "Amendments": { + "description": "Metadata outlining number of amendments for given order.\n", + "type": "object", + "required": [ + "total", + "availableSince" + ], + "properties": { + "availableSince": { + "description": "The total count of amendments available since specified time.", + "type": "integer" + }, + "total": { + "description": "The total count of amendments.", + "type": "integer" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + } + } + }, + "CreatePaymentRequest": { + "type": "object", + "required": [ + "moveTaskOrderID", + "serviceItems" + ], + "properties": { + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "pointOfContact": { + "description": "Email or id of a contact person for this update.", + "type": "string" + }, + "serviceItems": { + "type": "array", + "minItems": 1, + "items": { + "$ref": "#/definitions/ServiceItem" + } + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "ExcessWeightRecord": { + "description": "A document uploaded by the movers proving that the customer has been counseled about excess weight.", + "allOf": [ + { + "$ref": "#/definitions/UploadWithOmissions" + }, + { + "type": "object", + "required": [ + "moveId" + ], + "properties": { + "moveExcessWeightAcknowledgedAt": { + "description": "The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded.\n", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "moveExcessWeightQualifiedAt": { + "description": "The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically.\n", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "moveId": { + "description": "The UUID of the move this excess weight record belongs to.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + } + ] + }, + "ListMove": { + "description": "An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently.\n", + "type": "object", + "properties": { + "amendments": { + "$ref": "#/definitions/Amendments" + }, + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "JFK" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "ppmType": { + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "ListMoves": { + "type": "array", + "items": { + "$ref": "#/definitions/ListMove" + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalFuelSurcharge": { + "description": "Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "properties": { + "portCode": { + "description": "A unique code for a Port", + "type": "string" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC).", + "type": "string", + "enum": [ + "PODFSC", + "POEFSC" + ] + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "params": { + "description": "This should be populated for the following service items:\n * DOASIT(Domestic origin Additional day SIT)\n * DDASIT(Domestic destination Additional day SIT)\n\nBoth take in the following param keys:\n * ` + "`" + `SITPaymentRequestStart` + "`" + `\n * ` + "`" + `SITPaymentRequestEnd` + "`" + `\n\nThe value of each is a date string in the format \"YYYY-MM-DD\" (e.g. \"2023-01-15\")\n", + "type": "array", + "items": { + "$ref": "#/definitions/ServiceItemParamsItems0" + } + } + } + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceItemParamsItems0": { + "type": "object", + "properties": { + "key": { + "type": "string", + "example": "Service Item Parameter Name" + }, + "value": { + "type": "string", + "example": "Service Item Parameter Value" + } + } + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemInternationalPortFSC": { + "description": "Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "portCode": { + "description": "Port used for the shipment. Relevant for moving (PODFSC \u0026 POEFSC) service items.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "PDX" + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "PODFSC", + "POEFSC" + ] + } + } + } + ] + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DDFSIT - UpdateMTOServiceItemSIT\n * DDASIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DOSFSC - UpdateMTOServiceItemSIT\n * DDSFSC - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n * PODFSC - UpdateMTOServiceItemInternationalPortFSC\n * POEFSC - UpdateMTOServiceItemInternationalPortFSC\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle", + "UpdateMTOServiceItemInternationalPortFSC" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DDASIT", + "DDFSIT", + "DDSFSC", + "DOPSIT", + "DOASIT", + "DOFSIT", + "DOSFSC" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "The request could not be processed because of conflict in the current state of the resource.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotImplemented": { + "description": "The requested feature is still in development.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + }, + { + "description": "A service item is a service that the contractor can bill for. For example, if the movers pack and/or unpack a\ncustomer's belongings, those are billable services (packing and unpacking). All **mtoServiceItems** must be\napproved by the TOO before payment can be requested.\n\nThere are three types of service items: accessorial, MTO-level, and standard.\n\n**WIP:** Add an external link to an article that explains the different types of service items in more detail.\n", + "name": "mtoServiceItem" + }, + { + "description": "The contractor submits a **paymentRequest** to the TIO for approval in order to be reimbursed for 1 or more\n**mtoServiceItems** on a **moveTaskOrder**. A service item can be on multiple payment requests if necessary.\n\nProof of service documentation may be uploaded for each **mtoServiceItem** in a **paymentRequest** after the payment\nrequest is created via the endpoint [createUpload](#operation/createUpload).\n\nAll weight entered should be in *pounds* and no other unit of measurement.\n", + "name": "paymentRequest" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment", + "mtoServiceItem", + "paymentRequest" + ] + } + ] +}`)) +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go new file mode 100644 index 00000000000..4a89c84cc04 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateExcessWeightRecordHandlerFunc turns a function with the right signature into a create excess weight record handler +type CreateExcessWeightRecordHandlerFunc func(CreateExcessWeightRecordParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateExcessWeightRecordHandlerFunc) Handle(params CreateExcessWeightRecordParams) middleware.Responder { + return fn(params) +} + +// CreateExcessWeightRecordHandler interface for that can handle valid create excess weight record params +type CreateExcessWeightRecordHandler interface { + Handle(CreateExcessWeightRecordParams) middleware.Responder +} + +// NewCreateExcessWeightRecord creates a new http.Handler for the create excess weight record operation +func NewCreateExcessWeightRecord(ctx *middleware.Context, handler CreateExcessWeightRecordHandler) *CreateExcessWeightRecord { + return &CreateExcessWeightRecord{Context: ctx, Handler: handler} +} + +/* + CreateExcessWeightRecord swagger:route POST /move-task-orders/{moveTaskOrderID}/excess-weight-record moveTaskOrder createExcessWeightRecord + +createExcessWeightRecord + +Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold. +*/ +type CreateExcessWeightRecord struct { + Context *middleware.Context + Handler CreateExcessWeightRecordHandler +} + +func (o *CreateExcessWeightRecord) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateExcessWeightRecordParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go new file mode 100644 index 00000000000..8fcd601f0b2 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_parameters.go @@ -0,0 +1,131 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// CreateExcessWeightRecordMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreateExcessWeightRecordMaxParseMemory int64 = 32 << 20 + +// NewCreateExcessWeightRecordParams creates a new CreateExcessWeightRecordParams object +// +// There are no default values defined in the spec. +func NewCreateExcessWeightRecordParams() CreateExcessWeightRecordParams { + + return CreateExcessWeightRecordParams{} +} + +// CreateExcessWeightRecordParams contains all the bound params for the create excess weight record operation +// typically these are obtained from a http.Request +// +// swagger:parameters createExcessWeightRecord +type CreateExcessWeightRecordParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the move being updated. + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateExcessWeightRecordParams() beforehand. +func (o *CreateExcessWeightRecordParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(CreateExcessWeightRecordMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreateExcessWeightRecordParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *CreateExcessWeightRecordParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *CreateExcessWeightRecordParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go new file mode 100644 index 00000000000..04fafdfb0ed --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_responses.go @@ -0,0 +1,284 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateExcessWeightRecordCreatedCode is the HTTP code returned for type CreateExcessWeightRecordCreated +const CreateExcessWeightRecordCreatedCode int = 201 + +/* +CreateExcessWeightRecordCreated Successfully uploaded the excess weight record file. + +swagger:response createExcessWeightRecordCreated +*/ +type CreateExcessWeightRecordCreated struct { + + /* + In: Body + */ + Payload *primemessages.ExcessWeightRecord `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordCreated creates CreateExcessWeightRecordCreated with default headers values +func NewCreateExcessWeightRecordCreated() *CreateExcessWeightRecordCreated { + + return &CreateExcessWeightRecordCreated{} +} + +// WithPayload adds the payload to the create excess weight record created response +func (o *CreateExcessWeightRecordCreated) WithPayload(payload *primemessages.ExcessWeightRecord) *CreateExcessWeightRecordCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record created response +func (o *CreateExcessWeightRecordCreated) SetPayload(payload *primemessages.ExcessWeightRecord) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateExcessWeightRecordUnauthorizedCode is the HTTP code returned for type CreateExcessWeightRecordUnauthorized +const CreateExcessWeightRecordUnauthorizedCode int = 401 + +/* +CreateExcessWeightRecordUnauthorized The request was denied. + +swagger:response createExcessWeightRecordUnauthorized +*/ +type CreateExcessWeightRecordUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordUnauthorized creates CreateExcessWeightRecordUnauthorized with default headers values +func NewCreateExcessWeightRecordUnauthorized() *CreateExcessWeightRecordUnauthorized { + + return &CreateExcessWeightRecordUnauthorized{} +} + +// WithPayload adds the payload to the create excess weight record unauthorized response +func (o *CreateExcessWeightRecordUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record unauthorized response +func (o *CreateExcessWeightRecordUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateExcessWeightRecordForbiddenCode is the HTTP code returned for type CreateExcessWeightRecordForbidden +const CreateExcessWeightRecordForbiddenCode int = 403 + +/* +CreateExcessWeightRecordForbidden The request was denied. + +swagger:response createExcessWeightRecordForbidden +*/ +type CreateExcessWeightRecordForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordForbidden creates CreateExcessWeightRecordForbidden with default headers values +func NewCreateExcessWeightRecordForbidden() *CreateExcessWeightRecordForbidden { + + return &CreateExcessWeightRecordForbidden{} +} + +// WithPayload adds the payload to the create excess weight record forbidden response +func (o *CreateExcessWeightRecordForbidden) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record forbidden response +func (o *CreateExcessWeightRecordForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateExcessWeightRecordNotFoundCode is the HTTP code returned for type CreateExcessWeightRecordNotFound +const CreateExcessWeightRecordNotFoundCode int = 404 + +/* +CreateExcessWeightRecordNotFound The requested resource wasn't found. + +swagger:response createExcessWeightRecordNotFound +*/ +type CreateExcessWeightRecordNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordNotFound creates CreateExcessWeightRecordNotFound with default headers values +func NewCreateExcessWeightRecordNotFound() *CreateExcessWeightRecordNotFound { + + return &CreateExcessWeightRecordNotFound{} +} + +// WithPayload adds the payload to the create excess weight record not found response +func (o *CreateExcessWeightRecordNotFound) WithPayload(payload *primemessages.ClientError) *CreateExcessWeightRecordNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record not found response +func (o *CreateExcessWeightRecordNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateExcessWeightRecordUnprocessableEntityCode is the HTTP code returned for type CreateExcessWeightRecordUnprocessableEntity +const CreateExcessWeightRecordUnprocessableEntityCode int = 422 + +/* +CreateExcessWeightRecordUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createExcessWeightRecordUnprocessableEntity +*/ +type CreateExcessWeightRecordUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordUnprocessableEntity creates CreateExcessWeightRecordUnprocessableEntity with default headers values +func NewCreateExcessWeightRecordUnprocessableEntity() *CreateExcessWeightRecordUnprocessableEntity { + + return &CreateExcessWeightRecordUnprocessableEntity{} +} + +// WithPayload adds the payload to the create excess weight record unprocessable entity response +func (o *CreateExcessWeightRecordUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateExcessWeightRecordUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record unprocessable entity response +func (o *CreateExcessWeightRecordUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateExcessWeightRecordInternalServerErrorCode is the HTTP code returned for type CreateExcessWeightRecordInternalServerError +const CreateExcessWeightRecordInternalServerErrorCode int = 500 + +/* +CreateExcessWeightRecordInternalServerError A server error occurred. + +swagger:response createExcessWeightRecordInternalServerError +*/ +type CreateExcessWeightRecordInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateExcessWeightRecordInternalServerError creates CreateExcessWeightRecordInternalServerError with default headers values +func NewCreateExcessWeightRecordInternalServerError() *CreateExcessWeightRecordInternalServerError { + + return &CreateExcessWeightRecordInternalServerError{} +} + +// WithPayload adds the payload to the create excess weight record internal server error response +func (o *CreateExcessWeightRecordInternalServerError) WithPayload(payload *primemessages.Error) *CreateExcessWeightRecordInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create excess weight record internal server error response +func (o *CreateExcessWeightRecordInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateExcessWeightRecordInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go new file mode 100644 index 00000000000..3c2094a09b1 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/create_excess_weight_record_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateExcessWeightRecordURL generates an URL for the create excess weight record operation +type CreateExcessWeightRecordURL struct { + MoveTaskOrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateExcessWeightRecordURL) WithBasePath(bp string) *CreateExcessWeightRecordURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateExcessWeightRecordURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateExcessWeightRecordURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/excess-weight-record" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on CreateExcessWeightRecordURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateExcessWeightRecordURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateExcessWeightRecordURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateExcessWeightRecordURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateExcessWeightRecordURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateExcessWeightRecordURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateExcessWeightRecordURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go new file mode 100644 index 00000000000..ce28eeae6e8 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DownloadMoveOrderHandlerFunc turns a function with the right signature into a download move order handler +type DownloadMoveOrderHandlerFunc func(DownloadMoveOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DownloadMoveOrderHandlerFunc) Handle(params DownloadMoveOrderParams) middleware.Responder { + return fn(params) +} + +// DownloadMoveOrderHandler interface for that can handle valid download move order params +type DownloadMoveOrderHandler interface { + Handle(DownloadMoveOrderParams) middleware.Responder +} + +// NewDownloadMoveOrder creates a new http.Handler for the download move order operation +func NewDownloadMoveOrder(ctx *middleware.Context, handler DownloadMoveOrderHandler) *DownloadMoveOrder { + return &DownloadMoveOrder{Context: ctx, Handler: handler} +} + +/* + DownloadMoveOrder swagger:route GET /moves/{locator}/documents moveTaskOrder downloadMoveOrder + +# Downloads move order as a PDF + +### Functionality +This endpoint downloads all uploaded move order documentations into one download file by locator. + +### Errors +* The move must be in need counseling state. +* The move client's origin duty location must not currently have gov counseling. +*/ +type DownloadMoveOrder struct { + Context *middleware.Context + Handler DownloadMoveOrderHandler +} + +func (o *DownloadMoveOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDownloadMoveOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go new file mode 100644 index 00000000000..a28a34d1121 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_parameters.go @@ -0,0 +1,125 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDownloadMoveOrderParams creates a new DownloadMoveOrderParams object +// with the default values initialized. +func NewDownloadMoveOrderParams() DownloadMoveOrderParams { + + var ( + // initialize parameters with default values + + typeVarDefault = string("ALL") + ) + + return DownloadMoveOrderParams{ + Type: &typeVarDefault, + } +} + +// DownloadMoveOrderParams contains all the bound params for the download move order operation +// typically these are obtained from a http.Request +// +// swagger:parameters downloadMoveOrder +type DownloadMoveOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*the locator code for move order to be downloaded + Required: true + In: path + */ + Locator string + /*upload type + In: query + Default: "ALL" + */ + Type *string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDownloadMoveOrderParams() beforehand. +func (o *DownloadMoveOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + rLocator, rhkLocator, _ := route.Params.GetOK("locator") + if err := o.bindLocator(rLocator, rhkLocator, route.Formats); err != nil { + res = append(res, err) + } + + qType, qhkType, _ := qs.GetOK("type") + if err := o.bindType(qType, qhkType, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindLocator binds and validates parameter Locator from path. +func (o *DownloadMoveOrderParams) bindLocator(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.Locator = raw + + return nil +} + +// bindType binds and validates parameter Type from query. +func (o *DownloadMoveOrderParams) bindType(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + // Default values have been previously initialized by NewDownloadMoveOrderParams() + return nil + } + o.Type = &raw + + if err := o.validateType(formats); err != nil { + return err + } + + return nil +} + +// validateType carries on validations for parameter Type +func (o *DownloadMoveOrderParams) validateType(formats strfmt.Registry) error { + + if err := validate.EnumCase("type", "query", *o.Type, []interface{}{"ALL", "ORDERS", "AMENDMENTS"}, true); err != nil { + return err + } + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go new file mode 100644 index 00000000000..626e6479342 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_responses.go @@ -0,0 +1,305 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// DownloadMoveOrderOKCode is the HTTP code returned for type DownloadMoveOrderOK +const DownloadMoveOrderOKCode int = 200 + +/* +DownloadMoveOrderOK Move Order PDF + +swagger:response downloadMoveOrderOK +*/ +type DownloadMoveOrderOK struct { + /*File name to download + + */ + ContentDisposition string `json:"Content-Disposition"` + + /* + In: Body + */ + Payload io.ReadCloser `json:"body,omitempty"` +} + +// NewDownloadMoveOrderOK creates DownloadMoveOrderOK with default headers values +func NewDownloadMoveOrderOK() *DownloadMoveOrderOK { + + return &DownloadMoveOrderOK{} +} + +// WithContentDisposition adds the contentDisposition to the download move order o k response +func (o *DownloadMoveOrderOK) WithContentDisposition(contentDisposition string) *DownloadMoveOrderOK { + o.ContentDisposition = contentDisposition + return o +} + +// SetContentDisposition sets the contentDisposition to the download move order o k response +func (o *DownloadMoveOrderOK) SetContentDisposition(contentDisposition string) { + o.ContentDisposition = contentDisposition +} + +// WithPayload adds the payload to the download move order o k response +func (o *DownloadMoveOrderOK) WithPayload(payload io.ReadCloser) *DownloadMoveOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order o k response +func (o *DownloadMoveOrderOK) SetPayload(payload io.ReadCloser) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + // response header Content-Disposition + + contentDisposition := o.ContentDisposition + if contentDisposition != "" { + rw.Header().Set("Content-Disposition", contentDisposition) + } + + rw.WriteHeader(200) + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// DownloadMoveOrderBadRequestCode is the HTTP code returned for type DownloadMoveOrderBadRequest +const DownloadMoveOrderBadRequestCode int = 400 + +/* +DownloadMoveOrderBadRequest The request payload is invalid. + +swagger:response downloadMoveOrderBadRequest +*/ +type DownloadMoveOrderBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDownloadMoveOrderBadRequest creates DownloadMoveOrderBadRequest with default headers values +func NewDownloadMoveOrderBadRequest() *DownloadMoveOrderBadRequest { + + return &DownloadMoveOrderBadRequest{} +} + +// WithPayload adds the payload to the download move order bad request response +func (o *DownloadMoveOrderBadRequest) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order bad request response +func (o *DownloadMoveOrderBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadMoveOrderForbiddenCode is the HTTP code returned for type DownloadMoveOrderForbidden +const DownloadMoveOrderForbiddenCode int = 403 + +/* +DownloadMoveOrderForbidden The request was denied. + +swagger:response downloadMoveOrderForbidden +*/ +type DownloadMoveOrderForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDownloadMoveOrderForbidden creates DownloadMoveOrderForbidden with default headers values +func NewDownloadMoveOrderForbidden() *DownloadMoveOrderForbidden { + + return &DownloadMoveOrderForbidden{} +} + +// WithPayload adds the payload to the download move order forbidden response +func (o *DownloadMoveOrderForbidden) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order forbidden response +func (o *DownloadMoveOrderForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadMoveOrderNotFoundCode is the HTTP code returned for type DownloadMoveOrderNotFound +const DownloadMoveOrderNotFoundCode int = 404 + +/* +DownloadMoveOrderNotFound The requested resource wasn't found. + +swagger:response downloadMoveOrderNotFound +*/ +type DownloadMoveOrderNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDownloadMoveOrderNotFound creates DownloadMoveOrderNotFound with default headers values +func NewDownloadMoveOrderNotFound() *DownloadMoveOrderNotFound { + + return &DownloadMoveOrderNotFound{} +} + +// WithPayload adds the payload to the download move order not found response +func (o *DownloadMoveOrderNotFound) WithPayload(payload *primemessages.ClientError) *DownloadMoveOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order not found response +func (o *DownloadMoveOrderNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadMoveOrderUnprocessableEntityCode is the HTTP code returned for type DownloadMoveOrderUnprocessableEntity +const DownloadMoveOrderUnprocessableEntityCode int = 422 + +/* +DownloadMoveOrderUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response downloadMoveOrderUnprocessableEntity +*/ +type DownloadMoveOrderUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewDownloadMoveOrderUnprocessableEntity creates DownloadMoveOrderUnprocessableEntity with default headers values +func NewDownloadMoveOrderUnprocessableEntity() *DownloadMoveOrderUnprocessableEntity { + + return &DownloadMoveOrderUnprocessableEntity{} +} + +// WithPayload adds the payload to the download move order unprocessable entity response +func (o *DownloadMoveOrderUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *DownloadMoveOrderUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order unprocessable entity response +func (o *DownloadMoveOrderUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DownloadMoveOrderInternalServerErrorCode is the HTTP code returned for type DownloadMoveOrderInternalServerError +const DownloadMoveOrderInternalServerErrorCode int = 500 + +/* +DownloadMoveOrderInternalServerError A server error occurred. + +swagger:response downloadMoveOrderInternalServerError +*/ +type DownloadMoveOrderInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewDownloadMoveOrderInternalServerError creates DownloadMoveOrderInternalServerError with default headers values +func NewDownloadMoveOrderInternalServerError() *DownloadMoveOrderInternalServerError { + + return &DownloadMoveOrderInternalServerError{} +} + +// WithPayload adds the payload to the download move order internal server error response +func (o *DownloadMoveOrderInternalServerError) WithPayload(payload *primemessages.Error) *DownloadMoveOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the download move order internal server error response +func (o *DownloadMoveOrderInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DownloadMoveOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go new file mode 100644 index 00000000000..96e86c4936e --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/download_move_order_urlbuilder.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// DownloadMoveOrderURL generates an URL for the download move order operation +type DownloadMoveOrderURL struct { + Locator string + + Type *string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DownloadMoveOrderURL) WithBasePath(bp string) *DownloadMoveOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DownloadMoveOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DownloadMoveOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves/{locator}/documents" + + locator := o.Locator + if locator != "" { + _path = strings.Replace(_path, "{locator}", locator, -1) + } else { + return nil, errors.New("locator is required on DownloadMoveOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var typeVarQ string + if o.Type != nil { + typeVarQ = *o.Type + } + if typeVarQ != "" { + qs.Set("type", typeVarQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DownloadMoveOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DownloadMoveOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DownloadMoveOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DownloadMoveOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DownloadMoveOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DownloadMoveOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go new file mode 100644 index 00000000000..d02fb4d0c9d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler +type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// GetMoveTaskOrderHandler interface for that can handle valid get move task order params +type GetMoveTaskOrderHandler interface { + Handle(GetMoveTaskOrderParams) middleware.Responder +} + +// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation +func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { + return &GetMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder + +getMoveTaskOrder + +### Functionality +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +type GetMoveTaskOrder struct { + Context *middleware.Context + Handler GetMoveTaskOrderHandler +} + +func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..fc2c39ef759 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { + + return GetMoveTaskOrderParams{} +} + +// GetMoveTaskOrderParams contains all the bound params for the get move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveTaskOrder +type GetMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID or MoveCode of move task order to use. + Required: true + In: path + */ + MoveID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. +func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveID = raw + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..571bde81ff9 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK +const GetMoveTaskOrderOKCode int = 200 + +/* +GetMoveTaskOrderOK Successfully retrieve an individual move task order. + +swagger:response getMoveTaskOrderOK +*/ +type GetMoveTaskOrderOK struct { + + /* + In: Body + */ + Payload *primemessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + + return &GetMoveTaskOrderOK{} +} + +// WithPayload adds the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) WithPayload(payload *primemessages.MoveTaskOrder) *GetMoveTaskOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) SetPayload(payload *primemessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized +const GetMoveTaskOrderUnauthorizedCode int = 401 + +/* +GetMoveTaskOrderUnauthorized The request was denied. + +swagger:response getMoveTaskOrderUnauthorized +*/ +type GetMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + + return &GetMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden +const GetMoveTaskOrderForbiddenCode int = 403 + +/* +GetMoveTaskOrderForbidden The request was denied. + +swagger:response getMoveTaskOrderForbidden +*/ +type GetMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + + return &GetMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound +const GetMoveTaskOrderNotFoundCode int = 404 + +/* +GetMoveTaskOrderNotFound The requested resource wasn't found. + +swagger:response getMoveTaskOrderNotFound +*/ +type GetMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + + return &GetMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primemessages.ClientError) *GetMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError +const GetMoveTaskOrderInternalServerErrorCode int = 500 + +/* +GetMoveTaskOrderInternalServerError A server error occurred. + +swagger:response getMoveTaskOrderInternalServerError +*/ +type GetMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + + return &GetMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primemessages.Error) *GetMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..6455770de3b --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/get_move_task_order_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveTaskOrderURL generates an URL for the get move task order operation +type GetMoveTaskOrderURL struct { + MoveID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveID}" + + moveID := o.MoveID + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveTaskOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go new file mode 100644 index 00000000000..8b4e83794b5 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMovesHandlerFunc turns a function with the right signature into a list moves handler +type ListMovesHandlerFunc func(ListMovesParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMovesHandlerFunc) Handle(params ListMovesParams) middleware.Responder { + return fn(params) +} + +// ListMovesHandler interface for that can handle valid list moves params +type ListMovesHandler interface { + Handle(ListMovesParams) middleware.Responder +} + +// NewListMoves creates a new http.Handler for the list moves operation +func NewListMoves(ctx *middleware.Context, handler ListMovesHandler) *ListMoves { + return &ListMoves{Context: ctx, Handler: handler} +} + +/* + ListMoves swagger:route GET /moves moveTaskOrder listMoves + +listMoves + +Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this +list down to only the moves that have been updated since the provided timestamp. A move will be considered +updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment +requests, is later than the provided date and time. + +**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has +been set, that move will always appear in this list. +*/ +type ListMoves struct { + Context *middleware.Context + Handler ListMovesHandler +} + +func (o *ListMoves) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMovesParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go new file mode 100644 index 00000000000..e7e72187174 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_parameters.go @@ -0,0 +1,97 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewListMovesParams creates a new ListMovesParams object +// +// There are no default values defined in the spec. +func NewListMovesParams() ListMovesParams { + + return ListMovesParams{} +} + +// ListMovesParams contains all the bound params for the list moves operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMoves +type ListMovesParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" + In: query + */ + Since *strfmt.DateTime +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMovesParams() beforehand. +func (o *ListMovesParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSince, qhkSince, _ := qs.GetOK("since") + if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSince binds and validates parameter Since from query. +func (o *ListMovesParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + // Format: date-time + value, err := formats.Parse("date-time", raw) + if err != nil { + return errors.InvalidType("since", "query", "strfmt.DateTime", raw) + } + o.Since = (value.(*strfmt.DateTime)) + + if err := o.validateSince(formats); err != nil { + return err + } + + return nil +} + +// validateSince carries on validations for parameter Since +func (o *ListMovesParams) validateSince(formats strfmt.Registry) error { + + if err := validate.FormatOf("since", "query", "date-time", o.Since.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go new file mode 100644 index 00000000000..d68ab7f3cb4 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_responses.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// ListMovesOKCode is the HTTP code returned for type ListMovesOK +const ListMovesOKCode int = 200 + +/* +ListMovesOK Successfully retrieved moves. A successful fetch might still return zero moves. + +swagger:response listMovesOK +*/ +type ListMovesOK struct { + + /* + In: Body + */ + Payload primemessages.ListMoves `json:"body,omitempty"` +} + +// NewListMovesOK creates ListMovesOK with default headers values +func NewListMovesOK() *ListMovesOK { + + return &ListMovesOK{} +} + +// WithPayload adds the payload to the list moves o k response +func (o *ListMovesOK) WithPayload(payload primemessages.ListMoves) *ListMovesOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list moves o k response +func (o *ListMovesOK) SetPayload(payload primemessages.ListMoves) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMovesOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = primemessages.ListMoves{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMovesUnauthorizedCode is the HTTP code returned for type ListMovesUnauthorized +const ListMovesUnauthorizedCode int = 401 + +/* +ListMovesUnauthorized The request was denied. + +swagger:response listMovesUnauthorized +*/ +type ListMovesUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewListMovesUnauthorized creates ListMovesUnauthorized with default headers values +func NewListMovesUnauthorized() *ListMovesUnauthorized { + + return &ListMovesUnauthorized{} +} + +// WithPayload adds the payload to the list moves unauthorized response +func (o *ListMovesUnauthorized) WithPayload(payload *primemessages.ClientError) *ListMovesUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list moves unauthorized response +func (o *ListMovesUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMovesUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMovesForbiddenCode is the HTTP code returned for type ListMovesForbidden +const ListMovesForbiddenCode int = 403 + +/* +ListMovesForbidden The request was denied. + +swagger:response listMovesForbidden +*/ +type ListMovesForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewListMovesForbidden creates ListMovesForbidden with default headers values +func NewListMovesForbidden() *ListMovesForbidden { + + return &ListMovesForbidden{} +} + +// WithPayload adds the payload to the list moves forbidden response +func (o *ListMovesForbidden) WithPayload(payload *primemessages.ClientError) *ListMovesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list moves forbidden response +func (o *ListMovesForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMovesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMovesInternalServerErrorCode is the HTTP code returned for type ListMovesInternalServerError +const ListMovesInternalServerErrorCode int = 500 + +/* +ListMovesInternalServerError A server error occurred. + +swagger:response listMovesInternalServerError +*/ +type ListMovesInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewListMovesInternalServerError creates ListMovesInternalServerError with default headers values +func NewListMovesInternalServerError() *ListMovesInternalServerError { + + return &ListMovesInternalServerError{} +} + +// WithPayload adds the payload to the list moves internal server error response +func (o *ListMovesInternalServerError) WithPayload(payload *primemessages.Error) *ListMovesInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list moves internal server error response +func (o *ListMovesInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMovesInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go new file mode 100644 index 00000000000..ac31049929d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/list_moves_urlbuilder.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/strfmt" +) + +// ListMovesURL generates an URL for the list moves operation +type ListMovesURL struct { + Since *strfmt.DateTime + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMovesURL) WithBasePath(bp string) *ListMovesURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMovesURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMovesURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/moves" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var sinceQ string + if o.Since != nil { + sinceQ = o.Since.String() + } + if sinceQ != "" { + qs.Set("since", sinceQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMovesURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMovesURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMovesURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMovesURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMovesURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMovesURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go new file mode 100644 index 00000000000..626b4778d88 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOPostCounselingInformationHandlerFunc turns a function with the right signature into a update m t o post counseling information handler +type UpdateMTOPostCounselingInformationHandlerFunc func(UpdateMTOPostCounselingInformationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOPostCounselingInformationHandlerFunc) Handle(params UpdateMTOPostCounselingInformationParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOPostCounselingInformationHandler interface for that can handle valid update m t o post counseling information params +type UpdateMTOPostCounselingInformationHandler interface { + Handle(UpdateMTOPostCounselingInformationParams) middleware.Responder +} + +// NewUpdateMTOPostCounselingInformation creates a new http.Handler for the update m t o post counseling information operation +func NewUpdateMTOPostCounselingInformation(ctx *middleware.Context, handler UpdateMTOPostCounselingInformationHandler) *UpdateMTOPostCounselingInformation { + return &UpdateMTOPostCounselingInformation{Context: ctx, Handler: handler} +} + +/* + UpdateMTOPostCounselingInformation swagger:route PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info moveTaskOrder updateMTOPostCounselingInformation + +updateMTOPostCounselingInformation + +### Functionality +This endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling. +This update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update. +No body object is expected for this request. + +**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs. + +**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer. +*/ +type UpdateMTOPostCounselingInformation struct { + Context *middleware.Context + Handler UpdateMTOPostCounselingInformationHandler +} + +func (o *UpdateMTOPostCounselingInformation) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOPostCounselingInformationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go new file mode 100644 index 00000000000..60041283063 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_parameters.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateMTOPostCounselingInformationParams creates a new UpdateMTOPostCounselingInformationParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOPostCounselingInformationParams() UpdateMTOPostCounselingInformationParams { + + return UpdateMTOPostCounselingInformationParams{} +} + +// UpdateMTOPostCounselingInformationParams contains all the bound params for the update m t o post counseling information operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOPostCounselingInformation +type UpdateMTOPostCounselingInformationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*ID of move task order to use. + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOPostCounselingInformationParams() beforehand. +func (o *UpdateMTOPostCounselingInformationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOPostCounselingInformationParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *UpdateMTOPostCounselingInformationParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go new file mode 100644 index 00000000000..2e223de9e89 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOPostCounselingInformationOKCode is the HTTP code returned for type UpdateMTOPostCounselingInformationOK +const UpdateMTOPostCounselingInformationOKCode int = 200 + +/* +UpdateMTOPostCounselingInformationOK Successfully updated move task order with post counseling information. + +swagger:response updateMTOPostCounselingInformationOK +*/ +type UpdateMTOPostCounselingInformationOK struct { + + /* + In: Body + */ + Payload *primemessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationOK creates UpdateMTOPostCounselingInformationOK with default headers values +func NewUpdateMTOPostCounselingInformationOK() *UpdateMTOPostCounselingInformationOK { + + return &UpdateMTOPostCounselingInformationOK{} +} + +// WithPayload adds the payload to the update m t o post counseling information o k response +func (o *UpdateMTOPostCounselingInformationOK) WithPayload(payload *primemessages.MoveTaskOrder) *UpdateMTOPostCounselingInformationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information o k response +func (o *UpdateMTOPostCounselingInformationOK) SetPayload(payload *primemessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationUnauthorizedCode is the HTTP code returned for type UpdateMTOPostCounselingInformationUnauthorized +const UpdateMTOPostCounselingInformationUnauthorizedCode int = 401 + +/* +UpdateMTOPostCounselingInformationUnauthorized The request was denied. + +swagger:response updateMTOPostCounselingInformationUnauthorized +*/ +type UpdateMTOPostCounselingInformationUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationUnauthorized creates UpdateMTOPostCounselingInformationUnauthorized with default headers values +func NewUpdateMTOPostCounselingInformationUnauthorized() *UpdateMTOPostCounselingInformationUnauthorized { + + return &UpdateMTOPostCounselingInformationUnauthorized{} +} + +// WithPayload adds the payload to the update m t o post counseling information unauthorized response +func (o *UpdateMTOPostCounselingInformationUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information unauthorized response +func (o *UpdateMTOPostCounselingInformationUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationForbiddenCode is the HTTP code returned for type UpdateMTOPostCounselingInformationForbidden +const UpdateMTOPostCounselingInformationForbiddenCode int = 403 + +/* +UpdateMTOPostCounselingInformationForbidden The request was denied. + +swagger:response updateMTOPostCounselingInformationForbidden +*/ +type UpdateMTOPostCounselingInformationForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationForbidden creates UpdateMTOPostCounselingInformationForbidden with default headers values +func NewUpdateMTOPostCounselingInformationForbidden() *UpdateMTOPostCounselingInformationForbidden { + + return &UpdateMTOPostCounselingInformationForbidden{} +} + +// WithPayload adds the payload to the update m t o post counseling information forbidden response +func (o *UpdateMTOPostCounselingInformationForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information forbidden response +func (o *UpdateMTOPostCounselingInformationForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationNotFoundCode is the HTTP code returned for type UpdateMTOPostCounselingInformationNotFound +const UpdateMTOPostCounselingInformationNotFoundCode int = 404 + +/* +UpdateMTOPostCounselingInformationNotFound The requested resource wasn't found. + +swagger:response updateMTOPostCounselingInformationNotFound +*/ +type UpdateMTOPostCounselingInformationNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationNotFound creates UpdateMTOPostCounselingInformationNotFound with default headers values +func NewUpdateMTOPostCounselingInformationNotFound() *UpdateMTOPostCounselingInformationNotFound { + + return &UpdateMTOPostCounselingInformationNotFound{} +} + +// WithPayload adds the payload to the update m t o post counseling information not found response +func (o *UpdateMTOPostCounselingInformationNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information not found response +func (o *UpdateMTOPostCounselingInformationNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationConflictCode is the HTTP code returned for type UpdateMTOPostCounselingInformationConflict +const UpdateMTOPostCounselingInformationConflictCode int = 409 + +/* +UpdateMTOPostCounselingInformationConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateMTOPostCounselingInformationConflict +*/ +type UpdateMTOPostCounselingInformationConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationConflict creates UpdateMTOPostCounselingInformationConflict with default headers values +func NewUpdateMTOPostCounselingInformationConflict() *UpdateMTOPostCounselingInformationConflict { + + return &UpdateMTOPostCounselingInformationConflict{} +} + +// WithPayload adds the payload to the update m t o post counseling information conflict response +func (o *UpdateMTOPostCounselingInformationConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information conflict response +func (o *UpdateMTOPostCounselingInformationConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationPreconditionFailedCode is the HTTP code returned for type UpdateMTOPostCounselingInformationPreconditionFailed +const UpdateMTOPostCounselingInformationPreconditionFailedCode int = 412 + +/* +UpdateMTOPostCounselingInformationPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOPostCounselingInformationPreconditionFailed +*/ +type UpdateMTOPostCounselingInformationPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationPreconditionFailed creates UpdateMTOPostCounselingInformationPreconditionFailed with default headers values +func NewUpdateMTOPostCounselingInformationPreconditionFailed() *UpdateMTOPostCounselingInformationPreconditionFailed { + + return &UpdateMTOPostCounselingInformationPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o post counseling information precondition failed response +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOPostCounselingInformationPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information precondition failed response +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationUnprocessableEntityCode is the HTTP code returned for type UpdateMTOPostCounselingInformationUnprocessableEntity +const UpdateMTOPostCounselingInformationUnprocessableEntityCode int = 422 + +/* +UpdateMTOPostCounselingInformationUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOPostCounselingInformationUnprocessableEntity +*/ +type UpdateMTOPostCounselingInformationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationUnprocessableEntity creates UpdateMTOPostCounselingInformationUnprocessableEntity with default headers values +func NewUpdateMTOPostCounselingInformationUnprocessableEntity() *UpdateMTOPostCounselingInformationUnprocessableEntity { + + return &UpdateMTOPostCounselingInformationUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o post counseling information unprocessable entity response +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOPostCounselingInformationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information unprocessable entity response +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOPostCounselingInformationInternalServerErrorCode is the HTTP code returned for type UpdateMTOPostCounselingInformationInternalServerError +const UpdateMTOPostCounselingInformationInternalServerErrorCode int = 500 + +/* +UpdateMTOPostCounselingInformationInternalServerError A server error occurred. + +swagger:response updateMTOPostCounselingInformationInternalServerError +*/ +type UpdateMTOPostCounselingInformationInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOPostCounselingInformationInternalServerError creates UpdateMTOPostCounselingInformationInternalServerError with default headers values +func NewUpdateMTOPostCounselingInformationInternalServerError() *UpdateMTOPostCounselingInformationInternalServerError { + + return &UpdateMTOPostCounselingInformationInternalServerError{} +} + +// WithPayload adds the payload to the update m t o post counseling information internal server error response +func (o *UpdateMTOPostCounselingInformationInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOPostCounselingInformationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o post counseling information internal server error response +func (o *UpdateMTOPostCounselingInformationInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOPostCounselingInformationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go new file mode 100644 index 00000000000..8afed9e8f90 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/move_task_order/update_m_t_o_post_counseling_information_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOPostCounselingInformationURL generates an URL for the update m t o post counseling information operation +type UpdateMTOPostCounselingInformationURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOPostCounselingInformationURL) WithBasePath(bp string) *UpdateMTOPostCounselingInformationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOPostCounselingInformationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOPostCounselingInformationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/post-counseling-info" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on UpdateMTOPostCounselingInformationURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOPostCounselingInformationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOPostCounselingInformationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOPostCounselingInformationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOPostCounselingInformationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOPostCounselingInformationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOPostCounselingInformationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go new file mode 100644 index 00000000000..85456161f0c --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOServiceItemHandlerFunc turns a function with the right signature into a create m t o service item handler +type CreateMTOServiceItemHandlerFunc func(CreateMTOServiceItemParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOServiceItemHandlerFunc) Handle(params CreateMTOServiceItemParams) middleware.Responder { + return fn(params) +} + +// CreateMTOServiceItemHandler interface for that can handle valid create m t o service item params +type CreateMTOServiceItemHandler interface { + Handle(CreateMTOServiceItemParams) middleware.Responder +} + +// NewCreateMTOServiceItem creates a new http.Handler for the create m t o service item operation +func NewCreateMTOServiceItem(ctx *middleware.Context, handler CreateMTOServiceItemHandler) *CreateMTOServiceItem { + return &CreateMTOServiceItem{Context: ctx, Handler: handler} +} + +/* + CreateMTOServiceItem swagger:route POST /mto-service-items mtoServiceItem createMTOServiceItem + +createMTOServiceItem + +Creates one or more MTOServiceItems. Not all service items may be created, please see details below. + +This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding + + to the service item you wish to create and the documentation will update with the new definition. + +Upon creation these items are associated with a Move Task Order and an MTO Shipment. +The request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require +additional service items to be autogenerated when added - all created service items, autogenerated included, +will be returned in the response. + +To update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint. + +--- + +**`MTOServiceItemOriginSIT`** + +MTOServiceItemOriginSIT is a subtype of MTOServiceItem. + +This model type describes a domestic origin SIT service item. Items can be created using this +model type with the following codes: + +**DOFSIT** + +**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items: + - DOFSIT - Domestic origin 1st day SIT + - DOASIT - Domestic origin Additional day SIT + - DOPSIT - Domestic origin SIT pickup + - DOSFSC - Domestic origin SIT fuel surcharge + +**DOASIT** + +**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item. +Additional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**. + +--- + +**`MTOServiceItemDestSIT`** + +MTOServiceItemDestSIT is a subtype of MTOServiceItem. + +This model type describes a domestic destination SIT service item. Items can be created using this +model type with the following codes: + +**DDFSIT** + +**1st day destination SIT service item**. + +These additional fields are optional for creating a DDFSIT: + - `firstAvailableDeliveryDate1` + - string + - First available date that Prime can deliver SIT service item. + - firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together + - `dateOfContact1` + - string + - Date of attempted contact by the prime corresponding to `timeMilitary1` + - dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together + - `timeMilitary1` + - string\d{4}Z + - Time of attempted contact corresponding to `dateOfContact1`, in military format. + - timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together + - `firstAvailableDeliveryDate2` + - string + - Second available date that Prime can deliver SIT service item. + - firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together + - `dateOfContact2` + - string + - Date of attempted contact delivery by the prime corresponding to `timeMilitary2` + - dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together + - `timeMilitary2` + - string\d{4}Z + - Time of attempted contact corresponding to `dateOfContact2`, in military format. + - timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together + +When a DDFSIT is requested, the API will auto-create the following group of service items: + - DDFSIT - Domestic destination 1st day SIT + - DDASIT - Domestic destination Additional day SIT + - DDDSIT - Domestic destination SIT delivery + - DDSFSC - Domestic destination SIT fuel surcharge + +**NOTE** When providing the `sitEntryDate` value in the payload, please ensure that the date is not BEFORE +`firstAvailableDeliveryDate1` or `firstAvailableDeliveryDate2`. If it is, you will receive an error response. + +**DDASIT** + +**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item. +Additional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**. +*/ +type CreateMTOServiceItem struct { + Context *middleware.Context + Handler CreateMTOServiceItemHandler +} + +func (o *CreateMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOServiceItemParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go new file mode 100644 index 00000000000..594e1108b21 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateMTOServiceItemParams creates a new CreateMTOServiceItemParams object +// +// There are no default values defined in the spec. +func NewCreateMTOServiceItemParams() CreateMTOServiceItemParams { + + return CreateMTOServiceItemParams{} +} + +// CreateMTOServiceItemParams contains all the bound params for the create m t o service item operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOServiceItem +type CreateMTOServiceItemParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body primemessages.MTOServiceItem +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOServiceItemParams() beforehand. +func (o *CreateMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + body, err := primemessages.UnmarshalMTOServiceItem(r.Body, route.Consumer) + if err != nil { + res = append(res, err) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go new file mode 100644 index 00000000000..89109acacbc --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_responses.go @@ -0,0 +1,377 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateMTOServiceItemOKCode is the HTTP code returned for type CreateMTOServiceItemOK +const CreateMTOServiceItemOKCode int = 200 + +/* +CreateMTOServiceItemOK Successfully created an MTO service item. + +swagger:response createMTOServiceItemOK +*/ +type CreateMTOServiceItemOK struct { + + /* + In: Body + */ + Payload []primemessages.MTOServiceItem `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemOK creates CreateMTOServiceItemOK with default headers values +func NewCreateMTOServiceItemOK() *CreateMTOServiceItemOK { + + return &CreateMTOServiceItemOK{} +} + +// WithPayload adds the payload to the create m t o service item o k response +func (o *CreateMTOServiceItemOK) WithPayload(payload []primemessages.MTOServiceItem) *CreateMTOServiceItemOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item o k response +func (o *CreateMTOServiceItemOK) SetPayload(payload []primemessages.MTOServiceItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = make([]primemessages.MTOServiceItem, 0, 50) + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// CreateMTOServiceItemBadRequestCode is the HTTP code returned for type CreateMTOServiceItemBadRequest +const CreateMTOServiceItemBadRequestCode int = 400 + +/* +CreateMTOServiceItemBadRequest The request payload is invalid. + +swagger:response createMTOServiceItemBadRequest +*/ +type CreateMTOServiceItemBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemBadRequest creates CreateMTOServiceItemBadRequest with default headers values +func NewCreateMTOServiceItemBadRequest() *CreateMTOServiceItemBadRequest { + + return &CreateMTOServiceItemBadRequest{} +} + +// WithPayload adds the payload to the create m t o service item bad request response +func (o *CreateMTOServiceItemBadRequest) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item bad request response +func (o *CreateMTOServiceItemBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemUnauthorizedCode is the HTTP code returned for type CreateMTOServiceItemUnauthorized +const CreateMTOServiceItemUnauthorizedCode int = 401 + +/* +CreateMTOServiceItemUnauthorized The request was denied. + +swagger:response createMTOServiceItemUnauthorized +*/ +type CreateMTOServiceItemUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemUnauthorized creates CreateMTOServiceItemUnauthorized with default headers values +func NewCreateMTOServiceItemUnauthorized() *CreateMTOServiceItemUnauthorized { + + return &CreateMTOServiceItemUnauthorized{} +} + +// WithPayload adds the payload to the create m t o service item unauthorized response +func (o *CreateMTOServiceItemUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item unauthorized response +func (o *CreateMTOServiceItemUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemForbiddenCode is the HTTP code returned for type CreateMTOServiceItemForbidden +const CreateMTOServiceItemForbiddenCode int = 403 + +/* +CreateMTOServiceItemForbidden The request was denied. + +swagger:response createMTOServiceItemForbidden +*/ +type CreateMTOServiceItemForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemForbidden creates CreateMTOServiceItemForbidden with default headers values +func NewCreateMTOServiceItemForbidden() *CreateMTOServiceItemForbidden { + + return &CreateMTOServiceItemForbidden{} +} + +// WithPayload adds the payload to the create m t o service item forbidden response +func (o *CreateMTOServiceItemForbidden) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item forbidden response +func (o *CreateMTOServiceItemForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemNotFoundCode is the HTTP code returned for type CreateMTOServiceItemNotFound +const CreateMTOServiceItemNotFoundCode int = 404 + +/* +CreateMTOServiceItemNotFound The requested resource wasn't found. + +swagger:response createMTOServiceItemNotFound +*/ +type CreateMTOServiceItemNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemNotFound creates CreateMTOServiceItemNotFound with default headers values +func NewCreateMTOServiceItemNotFound() *CreateMTOServiceItemNotFound { + + return &CreateMTOServiceItemNotFound{} +} + +// WithPayload adds the payload to the create m t o service item not found response +func (o *CreateMTOServiceItemNotFound) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item not found response +func (o *CreateMTOServiceItemNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemConflictCode is the HTTP code returned for type CreateMTOServiceItemConflict +const CreateMTOServiceItemConflictCode int = 409 + +/* +CreateMTOServiceItemConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response createMTOServiceItemConflict +*/ +type CreateMTOServiceItemConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemConflict creates CreateMTOServiceItemConflict with default headers values +func NewCreateMTOServiceItemConflict() *CreateMTOServiceItemConflict { + + return &CreateMTOServiceItemConflict{} +} + +// WithPayload adds the payload to the create m t o service item conflict response +func (o *CreateMTOServiceItemConflict) WithPayload(payload *primemessages.ClientError) *CreateMTOServiceItemConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item conflict response +func (o *CreateMTOServiceItemConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemUnprocessableEntityCode is the HTTP code returned for type CreateMTOServiceItemUnprocessableEntity +const CreateMTOServiceItemUnprocessableEntityCode int = 422 + +/* +CreateMTOServiceItemUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createMTOServiceItemUnprocessableEntity +*/ +type CreateMTOServiceItemUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemUnprocessableEntity creates CreateMTOServiceItemUnprocessableEntity with default headers values +func NewCreateMTOServiceItemUnprocessableEntity() *CreateMTOServiceItemUnprocessableEntity { + + return &CreateMTOServiceItemUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o service item unprocessable entity response +func (o *CreateMTOServiceItemUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateMTOServiceItemUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item unprocessable entity response +func (o *CreateMTOServiceItemUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOServiceItemInternalServerErrorCode is the HTTP code returned for type CreateMTOServiceItemInternalServerError +const CreateMTOServiceItemInternalServerErrorCode int = 500 + +/* +CreateMTOServiceItemInternalServerError A server error occurred. + +swagger:response createMTOServiceItemInternalServerError +*/ +type CreateMTOServiceItemInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOServiceItemInternalServerError creates CreateMTOServiceItemInternalServerError with default headers values +func NewCreateMTOServiceItemInternalServerError() *CreateMTOServiceItemInternalServerError { + + return &CreateMTOServiceItemInternalServerError{} +} + +// WithPayload adds the payload to the create m t o service item internal server error response +func (o *CreateMTOServiceItemInternalServerError) WithPayload(payload *primemessages.Error) *CreateMTOServiceItemInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o service item internal server error response +func (o *CreateMTOServiceItemInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go new file mode 100644 index 00000000000..3646b39de80 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_m_t_o_service_item_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOServiceItemURL generates an URL for the create m t o service item operation +type CreateMTOServiceItemURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOServiceItemURL) WithBasePath(bp string) *CreateMTOServiceItemURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOServiceItemURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOServiceItemURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-service-items" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOServiceItemURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOServiceItemURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOServiceItemURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOServiceItemURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go new file mode 100644 index 00000000000..c31e66f050d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateServiceRequestDocumentUploadHandlerFunc turns a function with the right signature into a create service request document upload handler +type CreateServiceRequestDocumentUploadHandlerFunc func(CreateServiceRequestDocumentUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateServiceRequestDocumentUploadHandlerFunc) Handle(params CreateServiceRequestDocumentUploadParams) middleware.Responder { + return fn(params) +} + +// CreateServiceRequestDocumentUploadHandler interface for that can handle valid create service request document upload params +type CreateServiceRequestDocumentUploadHandler interface { + Handle(CreateServiceRequestDocumentUploadParams) middleware.Responder +} + +// NewCreateServiceRequestDocumentUpload creates a new http.Handler for the create service request document upload operation +func NewCreateServiceRequestDocumentUpload(ctx *middleware.Context, handler CreateServiceRequestDocumentUploadHandler) *CreateServiceRequestDocumentUpload { + return &CreateServiceRequestDocumentUpload{Context: ctx, Handler: handler} +} + +/* + CreateServiceRequestDocumentUpload swagger:route POST /mto-service-items/{mtoServiceItemID}/uploads mtoServiceItem createServiceRequestDocumentUpload + +createServiceRequestDocumentUpload + +### Functionality + +This endpoint **uploads** a Service Request document for a +ServiceItem. + +The ServiceItem should already exist. + +ServiceItems are created with the +[createMTOServiceItem](#operation/createMTOServiceItem) +endpoint. +*/ +type CreateServiceRequestDocumentUpload struct { + Context *middleware.Context + Handler CreateServiceRequestDocumentUploadHandler +} + +func (o *CreateServiceRequestDocumentUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateServiceRequestDocumentUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go new file mode 100644 index 00000000000..8dad929e210 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_parameters.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// CreateServiceRequestDocumentUploadMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreateServiceRequestDocumentUploadMaxParseMemory int64 = 32 << 20 + +// NewCreateServiceRequestDocumentUploadParams creates a new CreateServiceRequestDocumentUploadParams object +// +// There are no default values defined in the spec. +func NewCreateServiceRequestDocumentUploadParams() CreateServiceRequestDocumentUploadParams { + + return CreateServiceRequestDocumentUploadParams{} +} + +// CreateServiceRequestDocumentUploadParams contains all the bound params for the create service request document upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters createServiceRequestDocumentUpload +type CreateServiceRequestDocumentUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*UUID of the service item to use. + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateServiceRequestDocumentUploadParams() beforehand. +func (o *CreateServiceRequestDocumentUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(CreateServiceRequestDocumentUploadMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreateServiceRequestDocumentUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *CreateServiceRequestDocumentUploadParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go new file mode 100644 index 00000000000..4ea1740617a --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateServiceRequestDocumentUploadCreatedCode is the HTTP code returned for type CreateServiceRequestDocumentUploadCreated +const CreateServiceRequestDocumentUploadCreatedCode int = 201 + +/* +CreateServiceRequestDocumentUploadCreated Successfully created upload of digital file. + +swagger:response createServiceRequestDocumentUploadCreated +*/ +type CreateServiceRequestDocumentUploadCreated struct { + + /* + In: Body + */ + Payload *primemessages.UploadWithOmissions `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadCreated creates CreateServiceRequestDocumentUploadCreated with default headers values +func NewCreateServiceRequestDocumentUploadCreated() *CreateServiceRequestDocumentUploadCreated { + + return &CreateServiceRequestDocumentUploadCreated{} +} + +// WithPayload adds the payload to the create service request document upload created response +func (o *CreateServiceRequestDocumentUploadCreated) WithPayload(payload *primemessages.UploadWithOmissions) *CreateServiceRequestDocumentUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload created response +func (o *CreateServiceRequestDocumentUploadCreated) SetPayload(payload *primemessages.UploadWithOmissions) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadBadRequestCode is the HTTP code returned for type CreateServiceRequestDocumentUploadBadRequest +const CreateServiceRequestDocumentUploadBadRequestCode int = 400 + +/* +CreateServiceRequestDocumentUploadBadRequest The request payload is invalid. + +swagger:response createServiceRequestDocumentUploadBadRequest +*/ +type CreateServiceRequestDocumentUploadBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadBadRequest creates CreateServiceRequestDocumentUploadBadRequest with default headers values +func NewCreateServiceRequestDocumentUploadBadRequest() *CreateServiceRequestDocumentUploadBadRequest { + + return &CreateServiceRequestDocumentUploadBadRequest{} +} + +// WithPayload adds the payload to the create service request document upload bad request response +func (o *CreateServiceRequestDocumentUploadBadRequest) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload bad request response +func (o *CreateServiceRequestDocumentUploadBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadUnauthorizedCode is the HTTP code returned for type CreateServiceRequestDocumentUploadUnauthorized +const CreateServiceRequestDocumentUploadUnauthorizedCode int = 401 + +/* +CreateServiceRequestDocumentUploadUnauthorized The request was denied. + +swagger:response createServiceRequestDocumentUploadUnauthorized +*/ +type CreateServiceRequestDocumentUploadUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadUnauthorized creates CreateServiceRequestDocumentUploadUnauthorized with default headers values +func NewCreateServiceRequestDocumentUploadUnauthorized() *CreateServiceRequestDocumentUploadUnauthorized { + + return &CreateServiceRequestDocumentUploadUnauthorized{} +} + +// WithPayload adds the payload to the create service request document upload unauthorized response +func (o *CreateServiceRequestDocumentUploadUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload unauthorized response +func (o *CreateServiceRequestDocumentUploadUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadForbiddenCode is the HTTP code returned for type CreateServiceRequestDocumentUploadForbidden +const CreateServiceRequestDocumentUploadForbiddenCode int = 403 + +/* +CreateServiceRequestDocumentUploadForbidden The request was denied. + +swagger:response createServiceRequestDocumentUploadForbidden +*/ +type CreateServiceRequestDocumentUploadForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadForbidden creates CreateServiceRequestDocumentUploadForbidden with default headers values +func NewCreateServiceRequestDocumentUploadForbidden() *CreateServiceRequestDocumentUploadForbidden { + + return &CreateServiceRequestDocumentUploadForbidden{} +} + +// WithPayload adds the payload to the create service request document upload forbidden response +func (o *CreateServiceRequestDocumentUploadForbidden) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload forbidden response +func (o *CreateServiceRequestDocumentUploadForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadNotFoundCode is the HTTP code returned for type CreateServiceRequestDocumentUploadNotFound +const CreateServiceRequestDocumentUploadNotFoundCode int = 404 + +/* +CreateServiceRequestDocumentUploadNotFound The requested resource wasn't found. + +swagger:response createServiceRequestDocumentUploadNotFound +*/ +type CreateServiceRequestDocumentUploadNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadNotFound creates CreateServiceRequestDocumentUploadNotFound with default headers values +func NewCreateServiceRequestDocumentUploadNotFound() *CreateServiceRequestDocumentUploadNotFound { + + return &CreateServiceRequestDocumentUploadNotFound{} +} + +// WithPayload adds the payload to the create service request document upload not found response +func (o *CreateServiceRequestDocumentUploadNotFound) WithPayload(payload *primemessages.ClientError) *CreateServiceRequestDocumentUploadNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload not found response +func (o *CreateServiceRequestDocumentUploadNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadUnprocessableEntityCode is the HTTP code returned for type CreateServiceRequestDocumentUploadUnprocessableEntity +const CreateServiceRequestDocumentUploadUnprocessableEntityCode int = 422 + +/* +CreateServiceRequestDocumentUploadUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createServiceRequestDocumentUploadUnprocessableEntity +*/ +type CreateServiceRequestDocumentUploadUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadUnprocessableEntity creates CreateServiceRequestDocumentUploadUnprocessableEntity with default headers values +func NewCreateServiceRequestDocumentUploadUnprocessableEntity() *CreateServiceRequestDocumentUploadUnprocessableEntity { + + return &CreateServiceRequestDocumentUploadUnprocessableEntity{} +} + +// WithPayload adds the payload to the create service request document upload unprocessable entity response +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateServiceRequestDocumentUploadUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload unprocessable entity response +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateServiceRequestDocumentUploadInternalServerErrorCode is the HTTP code returned for type CreateServiceRequestDocumentUploadInternalServerError +const CreateServiceRequestDocumentUploadInternalServerErrorCode int = 500 + +/* +CreateServiceRequestDocumentUploadInternalServerError A server error occurred. + +swagger:response createServiceRequestDocumentUploadInternalServerError +*/ +type CreateServiceRequestDocumentUploadInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateServiceRequestDocumentUploadInternalServerError creates CreateServiceRequestDocumentUploadInternalServerError with default headers values +func NewCreateServiceRequestDocumentUploadInternalServerError() *CreateServiceRequestDocumentUploadInternalServerError { + + return &CreateServiceRequestDocumentUploadInternalServerError{} +} + +// WithPayload adds the payload to the create service request document upload internal server error response +func (o *CreateServiceRequestDocumentUploadInternalServerError) WithPayload(payload *primemessages.Error) *CreateServiceRequestDocumentUploadInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create service request document upload internal server error response +func (o *CreateServiceRequestDocumentUploadInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateServiceRequestDocumentUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go new file mode 100644 index 00000000000..ff4ca67d805 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/create_service_request_document_upload_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// CreateServiceRequestDocumentUploadURL generates an URL for the create service request document upload operation +type CreateServiceRequestDocumentUploadURL struct { + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceRequestDocumentUploadURL) WithBasePath(bp string) *CreateServiceRequestDocumentUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateServiceRequestDocumentUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateServiceRequestDocumentUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-service-items/{mtoServiceItemID}/uploads" + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on CreateServiceRequestDocumentUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateServiceRequestDocumentUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateServiceRequestDocumentUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateServiceRequestDocumentUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateServiceRequestDocumentUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateServiceRequestDocumentUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateServiceRequestDocumentUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go new file mode 100644 index 00000000000..d5ba2aa78de --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item.go @@ -0,0 +1,116 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOServiceItemHandlerFunc turns a function with the right signature into a update m t o service item handler +type UpdateMTOServiceItemHandlerFunc func(UpdateMTOServiceItemParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOServiceItemHandlerFunc) Handle(params UpdateMTOServiceItemParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOServiceItemHandler interface for that can handle valid update m t o service item params +type UpdateMTOServiceItemHandler interface { + Handle(UpdateMTOServiceItemParams) middleware.Responder +} + +// NewUpdateMTOServiceItem creates a new http.Handler for the update m t o service item operation +func NewUpdateMTOServiceItem(ctx *middleware.Context, handler UpdateMTOServiceItemHandler) *UpdateMTOServiceItem { + return &UpdateMTOServiceItem{Context: ctx, Handler: handler} +} + +/* + UpdateMTOServiceItem swagger:route PATCH /mto-service-items/{mtoServiceItemID} mtoServiceItem updateMTOServiceItem + +updateMTOServiceItem + +Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below. + +This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding + + to the service item you wish to update and the documentation will update with the new definition. + +* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address. +For approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress). +For shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress). + +* SIT Service Items: Take note that when updating `sitCustomerContacted`, `sitDepartureDate`, or `sitRequestedDelivery`, we want +those to be updated on `DOASIT` (for origin SIT) and `DDASIT` (for destination SIT). If updating those values in other service +items, the office users will not have as much attention to those values. + +To create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint. + +* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from +REJECTED to SUBMITTED. Please provide the `requestedApprovalsRequestedStatus: true` when resubmitting as this will give attention to the TOO to +review the resubmitted SIT service item. Another note, `updateReason` must have a different value than the current `reason` value on the service item. +If this value is not updated, then an error will be sent back. + +The following SIT service items can be resubmitted following a rejection: +- DDASIT +- DDDSIT +- DDFSIT +- DOASIT +- DOPSIT +- DOFSIT +- DDSFSC +- DOSFSC + +At a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this: +```json + + { + "reServiceCode": "DDFSIT", + "updateReason": "A reason that differs from the previous reason", + "modelType": "UpdateMTOServiceItemSIT", + "requestApprovalsRequestedStatus": true + } + +``` + +The following service items allow you to update the Port that the shipment will use: +- PODFSC (Port of Debarkation can be updated) +- POEFSC (Port of Embarkation can be updated) + +At a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item. +Please see the example payload below: +```json + + { + "id": "1ed224b6-c65e-4616-b88e-8304d26c9562", + "modelType": "UpdateMTOServiceItemInternationalPortFSC", + "portCode": "SEA", + "reServiceCode": "POEFSC" + } + +``` +*/ +type UpdateMTOServiceItem struct { + Context *middleware.Context + Handler UpdateMTOServiceItemHandler +} + +func (o *UpdateMTOServiceItem) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOServiceItemParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go new file mode 100644 index 00000000000..70c96a425e3 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_parameters.go @@ -0,0 +1,138 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOServiceItemParams creates a new UpdateMTOServiceItemParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOServiceItemParams() UpdateMTOServiceItemParams { + + return UpdateMTOServiceItemParams{} +} + +// UpdateMTOServiceItemParams contains all the bound params for the update m t o service item operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOServiceItem +type UpdateMTOServiceItemParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body primemessages.UpdateMTOServiceItem + /*UUID of service item to update. + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemParams() beforehand. +func (o *UpdateMTOServiceItemParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + body, err := primemessages.UnmarshalUpdateMTOServiceItem(r.Body, route.Consumer) + if err != nil { + if err == io.EOF { + err = errors.Required("body", "body", "") + } + res = append(res, err) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOServiceItemParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *UpdateMTOServiceItemParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go new file mode 100644 index 00000000000..bb39b1a813f --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOServiceItemOKCode is the HTTP code returned for type UpdateMTOServiceItemOK +const UpdateMTOServiceItemOKCode int = 200 + +/* +UpdateMTOServiceItemOK Successfully updated the MTO service item. + +swagger:response updateMTOServiceItemOK +*/ +type UpdateMTOServiceItemOK struct { + + /* + In: Body + */ + Payload primemessages.MTOServiceItem `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemOK creates UpdateMTOServiceItemOK with default headers values +func NewUpdateMTOServiceItemOK() *UpdateMTOServiceItemOK { + + return &UpdateMTOServiceItemOK{} +} + +// WithPayload adds the payload to the update m t o service item o k response +func (o *UpdateMTOServiceItemOK) WithPayload(payload primemessages.MTOServiceItem) *UpdateMTOServiceItemOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item o k response +func (o *UpdateMTOServiceItemOK) SetPayload(payload primemessages.MTOServiceItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemBadRequest +const UpdateMTOServiceItemBadRequestCode int = 400 + +/* +UpdateMTOServiceItemBadRequest The request payload is invalid. + +swagger:response updateMTOServiceItemBadRequest +*/ +type UpdateMTOServiceItemBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemBadRequest creates UpdateMTOServiceItemBadRequest with default headers values +func NewUpdateMTOServiceItemBadRequest() *UpdateMTOServiceItemBadRequest { + + return &UpdateMTOServiceItemBadRequest{} +} + +// WithPayload adds the payload to the update m t o service item bad request response +func (o *UpdateMTOServiceItemBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item bad request response +func (o *UpdateMTOServiceItemBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemUnauthorized +const UpdateMTOServiceItemUnauthorizedCode int = 401 + +/* +UpdateMTOServiceItemUnauthorized The request was denied. + +swagger:response updateMTOServiceItemUnauthorized +*/ +type UpdateMTOServiceItemUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemUnauthorized creates UpdateMTOServiceItemUnauthorized with default headers values +func NewUpdateMTOServiceItemUnauthorized() *UpdateMTOServiceItemUnauthorized { + + return &UpdateMTOServiceItemUnauthorized{} +} + +// WithPayload adds the payload to the update m t o service item unauthorized response +func (o *UpdateMTOServiceItemUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item unauthorized response +func (o *UpdateMTOServiceItemUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemForbidden +const UpdateMTOServiceItemForbiddenCode int = 403 + +/* +UpdateMTOServiceItemForbidden The request was denied. + +swagger:response updateMTOServiceItemForbidden +*/ +type UpdateMTOServiceItemForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemForbidden creates UpdateMTOServiceItemForbidden with default headers values +func NewUpdateMTOServiceItemForbidden() *UpdateMTOServiceItemForbidden { + + return &UpdateMTOServiceItemForbidden{} +} + +// WithPayload adds the payload to the update m t o service item forbidden response +func (o *UpdateMTOServiceItemForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item forbidden response +func (o *UpdateMTOServiceItemForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemNotFound +const UpdateMTOServiceItemNotFoundCode int = 404 + +/* +UpdateMTOServiceItemNotFound The requested resource wasn't found. + +swagger:response updateMTOServiceItemNotFound +*/ +type UpdateMTOServiceItemNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemNotFound creates UpdateMTOServiceItemNotFound with default headers values +func NewUpdateMTOServiceItemNotFound() *UpdateMTOServiceItemNotFound { + + return &UpdateMTOServiceItemNotFound{} +} + +// WithPayload adds the payload to the update m t o service item not found response +func (o *UpdateMTOServiceItemNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item not found response +func (o *UpdateMTOServiceItemNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemConflictCode is the HTTP code returned for type UpdateMTOServiceItemConflict +const UpdateMTOServiceItemConflictCode int = 409 + +/* +UpdateMTOServiceItemConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateMTOServiceItemConflict +*/ +type UpdateMTOServiceItemConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemConflict creates UpdateMTOServiceItemConflict with default headers values +func NewUpdateMTOServiceItemConflict() *UpdateMTOServiceItemConflict { + + return &UpdateMTOServiceItemConflict{} +} + +// WithPayload adds the payload to the update m t o service item conflict response +func (o *UpdateMTOServiceItemConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item conflict response +func (o *UpdateMTOServiceItemConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemPreconditionFailed +const UpdateMTOServiceItemPreconditionFailedCode int = 412 + +/* +UpdateMTOServiceItemPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOServiceItemPreconditionFailed +*/ +type UpdateMTOServiceItemPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemPreconditionFailed creates UpdateMTOServiceItemPreconditionFailed with default headers values +func NewUpdateMTOServiceItemPreconditionFailed() *UpdateMTOServiceItemPreconditionFailed { + + return &UpdateMTOServiceItemPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o service item precondition failed response +func (o *UpdateMTOServiceItemPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOServiceItemPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item precondition failed response +func (o *UpdateMTOServiceItemPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemUnprocessableEntity +const UpdateMTOServiceItemUnprocessableEntityCode int = 422 + +/* +UpdateMTOServiceItemUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOServiceItemUnprocessableEntity +*/ +type UpdateMTOServiceItemUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemUnprocessableEntity creates UpdateMTOServiceItemUnprocessableEntity with default headers values +func NewUpdateMTOServiceItemUnprocessableEntity() *UpdateMTOServiceItemUnprocessableEntity { + + return &UpdateMTOServiceItemUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o service item unprocessable entity response +func (o *UpdateMTOServiceItemUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOServiceItemUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item unprocessable entity response +func (o *UpdateMTOServiceItemUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemInternalServerError +const UpdateMTOServiceItemInternalServerErrorCode int = 500 + +/* +UpdateMTOServiceItemInternalServerError A server error occurred. + +swagger:response updateMTOServiceItemInternalServerError +*/ +type UpdateMTOServiceItemInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemInternalServerError creates UpdateMTOServiceItemInternalServerError with default headers values +func NewUpdateMTOServiceItemInternalServerError() *UpdateMTOServiceItemInternalServerError { + + return &UpdateMTOServiceItemInternalServerError{} +} + +// WithPayload adds the payload to the update m t o service item internal server error response +func (o *UpdateMTOServiceItemInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOServiceItemInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item internal server error response +func (o *UpdateMTOServiceItemInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go new file mode 100644 index 00000000000..049813f133d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_service_item/update_m_t_o_service_item_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOServiceItemURL generates an URL for the update m t o service item operation +type UpdateMTOServiceItemURL struct { + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemURL) WithBasePath(bp string) *UpdateMTOServiceItemURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOServiceItemURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-service-items/{mtoServiceItemID}" + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOServiceItemURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOServiceItemURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOServiceItemURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOServiceItemURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOServiceItemURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go new file mode 100644 index 00000000000..0170d8c146d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOAgentHandlerFunc turns a function with the right signature into a create m t o agent handler +type CreateMTOAgentHandlerFunc func(CreateMTOAgentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOAgentHandlerFunc) Handle(params CreateMTOAgentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOAgentHandler interface for that can handle valid create m t o agent params +type CreateMTOAgentHandler interface { + Handle(CreateMTOAgentParams) middleware.Responder +} + +// NewCreateMTOAgent creates a new http.Handler for the create m t o agent operation +func NewCreateMTOAgent(ctx *middleware.Context, handler CreateMTOAgentHandler) *CreateMTOAgent { + return &CreateMTOAgent{Context: ctx, Handler: handler} +} + +/* + CreateMTOAgent swagger:route POST /mto-shipments/{mtoShipmentID}/agents mtoShipment createMTOAgent + +createMTOAgent + +### Functionality +This endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body. + +### Errors +The agent must always have a name and at least one method of contact (either `email` or `phone`). + +The agent must be associated with the MTO shipment passed in the url. + +The shipment should be associated with an MTO that is available to the Pime. +If the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. +*/ +type CreateMTOAgent struct { + Context *middleware.Context + Handler CreateMTOAgentHandler +} + +func (o *CreateMTOAgent) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOAgentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go new file mode 100644 index 00000000000..f009dad1ae5 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateMTOAgentParams creates a new CreateMTOAgentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOAgentParams() CreateMTOAgentParams { + + return CreateMTOAgentParams{} +} + +// CreateMTOAgentParams contains all the bound params for the create m t o agent operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOAgent +type CreateMTOAgentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *primemessages.MTOAgent + /*UUID of the shipment associated with the agent + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOAgentParams() beforehand. +func (o *CreateMTOAgentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.MTOAgent + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *CreateMTOAgentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *CreateMTOAgentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go new file mode 100644 index 00000000000..e1fc472b094 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateMTOAgentOKCode is the HTTP code returned for type CreateMTOAgentOK +const CreateMTOAgentOKCode int = 200 + +/* +CreateMTOAgentOK Successfully added the agent. + +swagger:response createMTOAgentOK +*/ +type CreateMTOAgentOK struct { + + /* + In: Body + */ + Payload *primemessages.MTOAgent `json:"body,omitempty"` +} + +// NewCreateMTOAgentOK creates CreateMTOAgentOK with default headers values +func NewCreateMTOAgentOK() *CreateMTOAgentOK { + + return &CreateMTOAgentOK{} +} + +// WithPayload adds the payload to the create m t o agent o k response +func (o *CreateMTOAgentOK) WithPayload(payload *primemessages.MTOAgent) *CreateMTOAgentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent o k response +func (o *CreateMTOAgentOK) SetPayload(payload *primemessages.MTOAgent) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentBadRequestCode is the HTTP code returned for type CreateMTOAgentBadRequest +const CreateMTOAgentBadRequestCode int = 400 + +/* +CreateMTOAgentBadRequest The request payload is invalid. + +swagger:response createMTOAgentBadRequest +*/ +type CreateMTOAgentBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOAgentBadRequest creates CreateMTOAgentBadRequest with default headers values +func NewCreateMTOAgentBadRequest() *CreateMTOAgentBadRequest { + + return &CreateMTOAgentBadRequest{} +} + +// WithPayload adds the payload to the create m t o agent bad request response +func (o *CreateMTOAgentBadRequest) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent bad request response +func (o *CreateMTOAgentBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentUnauthorizedCode is the HTTP code returned for type CreateMTOAgentUnauthorized +const CreateMTOAgentUnauthorizedCode int = 401 + +/* +CreateMTOAgentUnauthorized The request was denied. + +swagger:response createMTOAgentUnauthorized +*/ +type CreateMTOAgentUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOAgentUnauthorized creates CreateMTOAgentUnauthorized with default headers values +func NewCreateMTOAgentUnauthorized() *CreateMTOAgentUnauthorized { + + return &CreateMTOAgentUnauthorized{} +} + +// WithPayload adds the payload to the create m t o agent unauthorized response +func (o *CreateMTOAgentUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent unauthorized response +func (o *CreateMTOAgentUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentForbiddenCode is the HTTP code returned for type CreateMTOAgentForbidden +const CreateMTOAgentForbiddenCode int = 403 + +/* +CreateMTOAgentForbidden The request was denied. + +swagger:response createMTOAgentForbidden +*/ +type CreateMTOAgentForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOAgentForbidden creates CreateMTOAgentForbidden with default headers values +func NewCreateMTOAgentForbidden() *CreateMTOAgentForbidden { + + return &CreateMTOAgentForbidden{} +} + +// WithPayload adds the payload to the create m t o agent forbidden response +func (o *CreateMTOAgentForbidden) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent forbidden response +func (o *CreateMTOAgentForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentNotFoundCode is the HTTP code returned for type CreateMTOAgentNotFound +const CreateMTOAgentNotFoundCode int = 404 + +/* +CreateMTOAgentNotFound The requested resource wasn't found. + +swagger:response createMTOAgentNotFound +*/ +type CreateMTOAgentNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOAgentNotFound creates CreateMTOAgentNotFound with default headers values +func NewCreateMTOAgentNotFound() *CreateMTOAgentNotFound { + + return &CreateMTOAgentNotFound{} +} + +// WithPayload adds the payload to the create m t o agent not found response +func (o *CreateMTOAgentNotFound) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent not found response +func (o *CreateMTOAgentNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentConflictCode is the HTTP code returned for type CreateMTOAgentConflict +const CreateMTOAgentConflictCode int = 409 + +/* +CreateMTOAgentConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response createMTOAgentConflict +*/ +type CreateMTOAgentConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOAgentConflict creates CreateMTOAgentConflict with default headers values +func NewCreateMTOAgentConflict() *CreateMTOAgentConflict { + + return &CreateMTOAgentConflict{} +} + +// WithPayload adds the payload to the create m t o agent conflict response +func (o *CreateMTOAgentConflict) WithPayload(payload *primemessages.ClientError) *CreateMTOAgentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent conflict response +func (o *CreateMTOAgentConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentUnprocessableEntityCode is the HTTP code returned for type CreateMTOAgentUnprocessableEntity +const CreateMTOAgentUnprocessableEntityCode int = 422 + +/* +CreateMTOAgentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createMTOAgentUnprocessableEntity +*/ +type CreateMTOAgentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOAgentUnprocessableEntity creates CreateMTOAgentUnprocessableEntity with default headers values +func NewCreateMTOAgentUnprocessableEntity() *CreateMTOAgentUnprocessableEntity { + + return &CreateMTOAgentUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o agent unprocessable entity response +func (o *CreateMTOAgentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateMTOAgentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent unprocessable entity response +func (o *CreateMTOAgentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOAgentInternalServerErrorCode is the HTTP code returned for type CreateMTOAgentInternalServerError +const CreateMTOAgentInternalServerErrorCode int = 500 + +/* +CreateMTOAgentInternalServerError A server error occurred. + +swagger:response createMTOAgentInternalServerError +*/ +type CreateMTOAgentInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateMTOAgentInternalServerError creates CreateMTOAgentInternalServerError with default headers values +func NewCreateMTOAgentInternalServerError() *CreateMTOAgentInternalServerError { + + return &CreateMTOAgentInternalServerError{} +} + +// WithPayload adds the payload to the create m t o agent internal server error response +func (o *CreateMTOAgentInternalServerError) WithPayload(payload *primemessages.Error) *CreateMTOAgentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o agent internal server error response +func (o *CreateMTOAgentInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOAgentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go new file mode 100644 index 00000000000..3388e32e0f9 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_agent_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateMTOAgentURL generates an URL for the create m t o agent operation +type CreateMTOAgentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOAgentURL) WithBasePath(bp string) *CreateMTOAgentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOAgentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOAgentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/agents" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on CreateMTOAgentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOAgentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOAgentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOAgentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOAgentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOAgentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOAgentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go new file mode 100644 index 00000000000..f7051d2b705 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler +type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params +type CreateMTOShipmentHandler interface { + Handle(CreateMTOShipmentParams) middleware.Responder +} + +// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation +func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { + return &CreateMTOShipment{Context: ctx, Handler: handler} +} + +/* + CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment + +createMTOShipment + +_[Deprecated: this endpoint was deprecated on August 5th, 2024]_ +Please use the new endpoint at `/prime/v3/createMTOShipment` instead. +*/ +type CreateMTOShipment struct { + Context *middleware.Context + Handler CreateMTOShipmentHandler +} + +func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..5d39b1ed3e7 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOShipmentParams() CreateMTOShipmentParams { + + return CreateMTOShipmentParams{} +} + +// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOShipment +type CreateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. +func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..e663c5ed29a --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,37 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// CreateMTOShipmentGoneCode is the HTTP code returned for type CreateMTOShipmentGone +const CreateMTOShipmentGoneCode int = 410 + +/* +CreateMTOShipmentGone This endpoint is deprecated. Please use `/prime/v3/createMTOShipment` instead. + +swagger:response createMTOShipmentGone +*/ +type CreateMTOShipmentGone struct { +} + +// NewCreateMTOShipmentGone creates CreateMTOShipmentGone with default headers values +func NewCreateMTOShipmentGone() *CreateMTOShipmentGone { + + return &CreateMTOShipmentGone{} +} + +// WriteResponse to the client +func (o *CreateMTOShipmentGone) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(410) +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..cb59a0fdacf --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOShipmentURL generates an URL for the create m t o shipment operation +type CreateMTOShipmentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go new file mode 100644 index 00000000000..cebd6a4fd39 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateSITExtensionHandlerFunc turns a function with the right signature into a create s i t extension handler +type CreateSITExtensionHandlerFunc func(CreateSITExtensionParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateSITExtensionHandlerFunc) Handle(params CreateSITExtensionParams) middleware.Responder { + return fn(params) +} + +// CreateSITExtensionHandler interface for that can handle valid create s i t extension params +type CreateSITExtensionHandler interface { + Handle(CreateSITExtensionParams) middleware.Responder +} + +// NewCreateSITExtension creates a new http.Handler for the create s i t extension operation +func NewCreateSITExtension(ctx *middleware.Context, handler CreateSITExtensionHandler) *CreateSITExtension { + return &CreateSITExtension{Context: ctx, Handler: handler} +} + +/* + CreateSITExtension swagger:route POST /mto-shipments/{mtoShipmentID}/sit-extensions mtoShipment createSITExtension + +createSITExtension + +### Functionality +This endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an +increase in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance +includes time spent in both origin and destination SIT. +*/ +type CreateSITExtension struct { + Context *middleware.Context + Handler CreateSITExtensionHandler +} + +func (o *CreateSITExtension) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateSITExtensionParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go new file mode 100644 index 00000000000..80aaffb9c8d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateSITExtensionParams creates a new CreateSITExtensionParams object +// +// There are no default values defined in the spec. +func NewCreateSITExtensionParams() CreateSITExtensionParams { + + return CreateSITExtensionParams{} +} + +// CreateSITExtensionParams contains all the bound params for the create s i t extension operation +// typically these are obtained from a http.Request +// +// swagger:parameters createSITExtension +type CreateSITExtensionParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *primemessages.CreateSITExtension + /*UUID of the shipment associated with the agent + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateSITExtensionParams() beforehand. +func (o *CreateSITExtensionParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.CreateSITExtension + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *CreateSITExtensionParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *CreateSITExtensionParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go new file mode 100644 index 00000000000..6a1afb99bb1 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateSITExtensionCreatedCode is the HTTP code returned for type CreateSITExtensionCreated +const CreateSITExtensionCreatedCode int = 201 + +/* +CreateSITExtensionCreated Successfully created the sit extension request. + +swagger:response createSITExtensionCreated +*/ +type CreateSITExtensionCreated struct { + + /* + In: Body + */ + Payload *primemessages.SITExtension `json:"body,omitempty"` +} + +// NewCreateSITExtensionCreated creates CreateSITExtensionCreated with default headers values +func NewCreateSITExtensionCreated() *CreateSITExtensionCreated { + + return &CreateSITExtensionCreated{} +} + +// WithPayload adds the payload to the create s i t extension created response +func (o *CreateSITExtensionCreated) WithPayload(payload *primemessages.SITExtension) *CreateSITExtensionCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension created response +func (o *CreateSITExtensionCreated) SetPayload(payload *primemessages.SITExtension) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionBadRequestCode is the HTTP code returned for type CreateSITExtensionBadRequest +const CreateSITExtensionBadRequestCode int = 400 + +/* +CreateSITExtensionBadRequest The request payload is invalid. + +swagger:response createSITExtensionBadRequest +*/ +type CreateSITExtensionBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateSITExtensionBadRequest creates CreateSITExtensionBadRequest with default headers values +func NewCreateSITExtensionBadRequest() *CreateSITExtensionBadRequest { + + return &CreateSITExtensionBadRequest{} +} + +// WithPayload adds the payload to the create s i t extension bad request response +func (o *CreateSITExtensionBadRequest) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension bad request response +func (o *CreateSITExtensionBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionUnauthorizedCode is the HTTP code returned for type CreateSITExtensionUnauthorized +const CreateSITExtensionUnauthorizedCode int = 401 + +/* +CreateSITExtensionUnauthorized The request was denied. + +swagger:response createSITExtensionUnauthorized +*/ +type CreateSITExtensionUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateSITExtensionUnauthorized creates CreateSITExtensionUnauthorized with default headers values +func NewCreateSITExtensionUnauthorized() *CreateSITExtensionUnauthorized { + + return &CreateSITExtensionUnauthorized{} +} + +// WithPayload adds the payload to the create s i t extension unauthorized response +func (o *CreateSITExtensionUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension unauthorized response +func (o *CreateSITExtensionUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionForbiddenCode is the HTTP code returned for type CreateSITExtensionForbidden +const CreateSITExtensionForbiddenCode int = 403 + +/* +CreateSITExtensionForbidden The request was denied. + +swagger:response createSITExtensionForbidden +*/ +type CreateSITExtensionForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateSITExtensionForbidden creates CreateSITExtensionForbidden with default headers values +func NewCreateSITExtensionForbidden() *CreateSITExtensionForbidden { + + return &CreateSITExtensionForbidden{} +} + +// WithPayload adds the payload to the create s i t extension forbidden response +func (o *CreateSITExtensionForbidden) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension forbidden response +func (o *CreateSITExtensionForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionNotFoundCode is the HTTP code returned for type CreateSITExtensionNotFound +const CreateSITExtensionNotFoundCode int = 404 + +/* +CreateSITExtensionNotFound The requested resource wasn't found. + +swagger:response createSITExtensionNotFound +*/ +type CreateSITExtensionNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateSITExtensionNotFound creates CreateSITExtensionNotFound with default headers values +func NewCreateSITExtensionNotFound() *CreateSITExtensionNotFound { + + return &CreateSITExtensionNotFound{} +} + +// WithPayload adds the payload to the create s i t extension not found response +func (o *CreateSITExtensionNotFound) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension not found response +func (o *CreateSITExtensionNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionConflictCode is the HTTP code returned for type CreateSITExtensionConflict +const CreateSITExtensionConflictCode int = 409 + +/* +CreateSITExtensionConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response createSITExtensionConflict +*/ +type CreateSITExtensionConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateSITExtensionConflict creates CreateSITExtensionConflict with default headers values +func NewCreateSITExtensionConflict() *CreateSITExtensionConflict { + + return &CreateSITExtensionConflict{} +} + +// WithPayload adds the payload to the create s i t extension conflict response +func (o *CreateSITExtensionConflict) WithPayload(payload *primemessages.ClientError) *CreateSITExtensionConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension conflict response +func (o *CreateSITExtensionConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionUnprocessableEntityCode is the HTTP code returned for type CreateSITExtensionUnprocessableEntity +const CreateSITExtensionUnprocessableEntityCode int = 422 + +/* +CreateSITExtensionUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createSITExtensionUnprocessableEntity +*/ +type CreateSITExtensionUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateSITExtensionUnprocessableEntity creates CreateSITExtensionUnprocessableEntity with default headers values +func NewCreateSITExtensionUnprocessableEntity() *CreateSITExtensionUnprocessableEntity { + + return &CreateSITExtensionUnprocessableEntity{} +} + +// WithPayload adds the payload to the create s i t extension unprocessable entity response +func (o *CreateSITExtensionUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateSITExtensionUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension unprocessable entity response +func (o *CreateSITExtensionUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateSITExtensionInternalServerErrorCode is the HTTP code returned for type CreateSITExtensionInternalServerError +const CreateSITExtensionInternalServerErrorCode int = 500 + +/* +CreateSITExtensionInternalServerError A server error occurred. + +swagger:response createSITExtensionInternalServerError +*/ +type CreateSITExtensionInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateSITExtensionInternalServerError creates CreateSITExtensionInternalServerError with default headers values +func NewCreateSITExtensionInternalServerError() *CreateSITExtensionInternalServerError { + + return &CreateSITExtensionInternalServerError{} +} + +// WithPayload adds the payload to the create s i t extension internal server error response +func (o *CreateSITExtensionInternalServerError) WithPayload(payload *primemessages.Error) *CreateSITExtensionInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create s i t extension internal server error response +func (o *CreateSITExtensionInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateSITExtensionInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go new file mode 100644 index 00000000000..d3322175d47 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/create_s_i_t_extension_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// CreateSITExtensionURL generates an URL for the create s i t extension operation +type CreateSITExtensionURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateSITExtensionURL) WithBasePath(bp string) *CreateSITExtensionURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateSITExtensionURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateSITExtensionURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/sit-extensions" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on CreateSITExtensionURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateSITExtensionURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateSITExtensionURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateSITExtensionURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateSITExtensionURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateSITExtensionURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateSITExtensionURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go new file mode 100644 index 00000000000..72e5243a185 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// DeleteMTOShipmentHandlerFunc turns a function with the right signature into a delete m t o shipment handler +type DeleteMTOShipmentHandlerFunc func(DeleteMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn DeleteMTOShipmentHandlerFunc) Handle(params DeleteMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// DeleteMTOShipmentHandler interface for that can handle valid delete m t o shipment params +type DeleteMTOShipmentHandler interface { + Handle(DeleteMTOShipmentParams) middleware.Responder +} + +// NewDeleteMTOShipment creates a new http.Handler for the delete m t o shipment operation +func NewDeleteMTOShipment(ctx *middleware.Context, handler DeleteMTOShipmentHandler) *DeleteMTOShipment { + return &DeleteMTOShipment{Context: ctx, Handler: handler} +} + +/* + DeleteMTOShipment swagger:route DELETE /mto-shipments/{mtoShipmentID} mtoShipment deleteMTOShipment + +deleteMTOShipment + +### Functionality +This endpoint deletes an individual shipment by ID. + +### Errors +* The mtoShipment should be associated with an MTO that is available to prime. +* The mtoShipment must be a PPM shipment. +* Counseling should not have already been completed for the associated MTO. +*/ +type DeleteMTOShipment struct { + Context *middleware.Context + Handler DeleteMTOShipmentHandler +} + +func (o *DeleteMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewDeleteMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..b1942efcb15 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewDeleteMTOShipmentParams creates a new DeleteMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewDeleteMTOShipmentParams() DeleteMTOShipmentParams { + + return DeleteMTOShipmentParams{} +} + +// DeleteMTOShipmentParams contains all the bound params for the delete m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters deleteMTOShipment +type DeleteMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the shipment to be deleted + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewDeleteMTOShipmentParams() beforehand. +func (o *DeleteMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *DeleteMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *DeleteMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..1dda539192f --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_responses.go @@ -0,0 +1,309 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// DeleteMTOShipmentNoContentCode is the HTTP code returned for type DeleteMTOShipmentNoContent +const DeleteMTOShipmentNoContentCode int = 204 + +/* +DeleteMTOShipmentNoContent Successfully deleted the MTO shipment. + +swagger:response deleteMTOShipmentNoContent +*/ +type DeleteMTOShipmentNoContent struct { +} + +// NewDeleteMTOShipmentNoContent creates DeleteMTOShipmentNoContent with default headers values +func NewDeleteMTOShipmentNoContent() *DeleteMTOShipmentNoContent { + + return &DeleteMTOShipmentNoContent{} +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentNoContent) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(204) +} + +// DeleteMTOShipmentBadRequestCode is the HTTP code returned for type DeleteMTOShipmentBadRequest +const DeleteMTOShipmentBadRequestCode int = 400 + +/* +DeleteMTOShipmentBadRequest The request payload is invalid. + +swagger:response deleteMTOShipmentBadRequest +*/ +type DeleteMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentBadRequest creates DeleteMTOShipmentBadRequest with default headers values +func NewDeleteMTOShipmentBadRequest() *DeleteMTOShipmentBadRequest { + + return &DeleteMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the delete m t o shipment bad request response +func (o *DeleteMTOShipmentBadRequest) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment bad request response +func (o *DeleteMTOShipmentBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMTOShipmentForbiddenCode is the HTTP code returned for type DeleteMTOShipmentForbidden +const DeleteMTOShipmentForbiddenCode int = 403 + +/* +DeleteMTOShipmentForbidden The request was denied. + +swagger:response deleteMTOShipmentForbidden +*/ +type DeleteMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentForbidden creates DeleteMTOShipmentForbidden with default headers values +func NewDeleteMTOShipmentForbidden() *DeleteMTOShipmentForbidden { + + return &DeleteMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the delete m t o shipment forbidden response +func (o *DeleteMTOShipmentForbidden) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment forbidden response +func (o *DeleteMTOShipmentForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMTOShipmentNotFoundCode is the HTTP code returned for type DeleteMTOShipmentNotFound +const DeleteMTOShipmentNotFoundCode int = 404 + +/* +DeleteMTOShipmentNotFound The requested resource wasn't found. + +swagger:response deleteMTOShipmentNotFound +*/ +type DeleteMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentNotFound creates DeleteMTOShipmentNotFound with default headers values +func NewDeleteMTOShipmentNotFound() *DeleteMTOShipmentNotFound { + + return &DeleteMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the delete m t o shipment not found response +func (o *DeleteMTOShipmentNotFound) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment not found response +func (o *DeleteMTOShipmentNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMTOShipmentConflictCode is the HTTP code returned for type DeleteMTOShipmentConflict +const DeleteMTOShipmentConflictCode int = 409 + +/* +DeleteMTOShipmentConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response deleteMTOShipmentConflict +*/ +type DeleteMTOShipmentConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentConflict creates DeleteMTOShipmentConflict with default headers values +func NewDeleteMTOShipmentConflict() *DeleteMTOShipmentConflict { + + return &DeleteMTOShipmentConflict{} +} + +// WithPayload adds the payload to the delete m t o shipment conflict response +func (o *DeleteMTOShipmentConflict) WithPayload(payload *primemessages.ClientError) *DeleteMTOShipmentConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment conflict response +func (o *DeleteMTOShipmentConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMTOShipmentUnprocessableEntityCode is the HTTP code returned for type DeleteMTOShipmentUnprocessableEntity +const DeleteMTOShipmentUnprocessableEntityCode int = 422 + +/* +DeleteMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response deleteMTOShipmentUnprocessableEntity +*/ +type DeleteMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentUnprocessableEntity creates DeleteMTOShipmentUnprocessableEntity with default headers values +func NewDeleteMTOShipmentUnprocessableEntity() *DeleteMTOShipmentUnprocessableEntity { + + return &DeleteMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the delete m t o shipment unprocessable entity response +func (o *DeleteMTOShipmentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *DeleteMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment unprocessable entity response +func (o *DeleteMTOShipmentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// DeleteMTOShipmentInternalServerErrorCode is the HTTP code returned for type DeleteMTOShipmentInternalServerError +const DeleteMTOShipmentInternalServerErrorCode int = 500 + +/* +DeleteMTOShipmentInternalServerError A server error occurred. + +swagger:response deleteMTOShipmentInternalServerError +*/ +type DeleteMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewDeleteMTOShipmentInternalServerError creates DeleteMTOShipmentInternalServerError with default headers values +func NewDeleteMTOShipmentInternalServerError() *DeleteMTOShipmentInternalServerError { + + return &DeleteMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the delete m t o shipment internal server error response +func (o *DeleteMTOShipmentInternalServerError) WithPayload(payload *primemessages.Error) *DeleteMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the delete m t o shipment internal server error response +func (o *DeleteMTOShipmentInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *DeleteMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..bc4a74a9c67 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/delete_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// DeleteMTOShipmentURL generates an URL for the delete m t o shipment operation +type DeleteMTOShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMTOShipmentURL) WithBasePath(bp string) *DeleteMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *DeleteMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *DeleteMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on DeleteMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *DeleteMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *DeleteMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *DeleteMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on DeleteMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on DeleteMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *DeleteMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go new file mode 100644 index 00000000000..c82cd695e18 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent.go @@ -0,0 +1,67 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOAgentHandlerFunc turns a function with the right signature into a update m t o agent handler +type UpdateMTOAgentHandlerFunc func(UpdateMTOAgentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOAgentHandlerFunc) Handle(params UpdateMTOAgentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOAgentHandler interface for that can handle valid update m t o agent params +type UpdateMTOAgentHandler interface { + Handle(UpdateMTOAgentParams) middleware.Responder +} + +// NewUpdateMTOAgent creates a new http.Handler for the update m t o agent operation +func NewUpdateMTOAgent(ctx *middleware.Context, handler UpdateMTOAgentHandler) *UpdateMTOAgent { + return &UpdateMTOAgent{Context: ctx, Handler: handler} +} + +/* + UpdateMTOAgent swagger:route PUT /mto-shipments/{mtoShipmentID}/agents/{agentID} mtoShipment updateMTOAgent + +updateMTOAgent + +### Functionality +This endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body. + +### Errors: +The agent must always have a name and at least one method of contact (either `email` or `phone`). + +The agent must be associated with the MTO shipment passed in the url. + +The shipment should be associated with an MTO that is available to the Prime. +If the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. +*/ +type UpdateMTOAgent struct { + Context *middleware.Context + Handler UpdateMTOAgentHandler +} + +func (o *UpdateMTOAgent) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOAgentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go new file mode 100644 index 00000000000..dd9b1781b68 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOAgentParams creates a new UpdateMTOAgentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOAgentParams() UpdateMTOAgentParams { + + return UpdateMTOAgentParams{} +} + +// UpdateMTOAgentParams contains all the bound params for the update m t o agent operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOAgent +type UpdateMTOAgentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the agent being updated + Required: true + In: path + */ + AgentID strfmt.UUID + /* + Required: true + In: body + */ + Body *primemessages.MTOAgent + /*UUID of the shipment associated with the agent + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOAgentParams() beforehand. +func (o *UpdateMTOAgentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rAgentID, rhkAgentID, _ := route.Params.GetOK("agentID") + if err := o.bindAgentID(rAgentID, rhkAgentID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.MTOAgent + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOAgentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindAgentID binds and validates parameter AgentID from path. +func (o *UpdateMTOAgentParams) bindAgentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("agentID", "path", "strfmt.UUID", raw) + } + o.AgentID = *(value.(*strfmt.UUID)) + + if err := o.validateAgentID(formats); err != nil { + return err + } + + return nil +} + +// validateAgentID carries on validations for parameter AgentID +func (o *UpdateMTOAgentParams) validateAgentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("agentID", "path", "uuid", o.AgentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOAgentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOAgentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go new file mode 100644 index 00000000000..ec36801533c --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOAgentOKCode is the HTTP code returned for type UpdateMTOAgentOK +const UpdateMTOAgentOKCode int = 200 + +/* +UpdateMTOAgentOK Successfully updated the agent. + +swagger:response updateMTOAgentOK +*/ +type UpdateMTOAgentOK struct { + + /* + In: Body + */ + Payload *primemessages.MTOAgent `json:"body,omitempty"` +} + +// NewUpdateMTOAgentOK creates UpdateMTOAgentOK with default headers values +func NewUpdateMTOAgentOK() *UpdateMTOAgentOK { + + return &UpdateMTOAgentOK{} +} + +// WithPayload adds the payload to the update m t o agent o k response +func (o *UpdateMTOAgentOK) WithPayload(payload *primemessages.MTOAgent) *UpdateMTOAgentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent o k response +func (o *UpdateMTOAgentOK) SetPayload(payload *primemessages.MTOAgent) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentBadRequestCode is the HTTP code returned for type UpdateMTOAgentBadRequest +const UpdateMTOAgentBadRequestCode int = 400 + +/* +UpdateMTOAgentBadRequest The request payload is invalid. + +swagger:response updateMTOAgentBadRequest +*/ +type UpdateMTOAgentBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentBadRequest creates UpdateMTOAgentBadRequest with default headers values +func NewUpdateMTOAgentBadRequest() *UpdateMTOAgentBadRequest { + + return &UpdateMTOAgentBadRequest{} +} + +// WithPayload adds the payload to the update m t o agent bad request response +func (o *UpdateMTOAgentBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent bad request response +func (o *UpdateMTOAgentBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentUnauthorizedCode is the HTTP code returned for type UpdateMTOAgentUnauthorized +const UpdateMTOAgentUnauthorizedCode int = 401 + +/* +UpdateMTOAgentUnauthorized The request was denied. + +swagger:response updateMTOAgentUnauthorized +*/ +type UpdateMTOAgentUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentUnauthorized creates UpdateMTOAgentUnauthorized with default headers values +func NewUpdateMTOAgentUnauthorized() *UpdateMTOAgentUnauthorized { + + return &UpdateMTOAgentUnauthorized{} +} + +// WithPayload adds the payload to the update m t o agent unauthorized response +func (o *UpdateMTOAgentUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent unauthorized response +func (o *UpdateMTOAgentUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentForbiddenCode is the HTTP code returned for type UpdateMTOAgentForbidden +const UpdateMTOAgentForbiddenCode int = 403 + +/* +UpdateMTOAgentForbidden The request was denied. + +swagger:response updateMTOAgentForbidden +*/ +type UpdateMTOAgentForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentForbidden creates UpdateMTOAgentForbidden with default headers values +func NewUpdateMTOAgentForbidden() *UpdateMTOAgentForbidden { + + return &UpdateMTOAgentForbidden{} +} + +// WithPayload adds the payload to the update m t o agent forbidden response +func (o *UpdateMTOAgentForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent forbidden response +func (o *UpdateMTOAgentForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentNotFoundCode is the HTTP code returned for type UpdateMTOAgentNotFound +const UpdateMTOAgentNotFoundCode int = 404 + +/* +UpdateMTOAgentNotFound The requested resource wasn't found. + +swagger:response updateMTOAgentNotFound +*/ +type UpdateMTOAgentNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentNotFound creates UpdateMTOAgentNotFound with default headers values +func NewUpdateMTOAgentNotFound() *UpdateMTOAgentNotFound { + + return &UpdateMTOAgentNotFound{} +} + +// WithPayload adds the payload to the update m t o agent not found response +func (o *UpdateMTOAgentNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent not found response +func (o *UpdateMTOAgentNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentPreconditionFailedCode is the HTTP code returned for type UpdateMTOAgentPreconditionFailed +const UpdateMTOAgentPreconditionFailedCode int = 412 + +/* +UpdateMTOAgentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOAgentPreconditionFailed +*/ +type UpdateMTOAgentPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentPreconditionFailed creates UpdateMTOAgentPreconditionFailed with default headers values +func NewUpdateMTOAgentPreconditionFailed() *UpdateMTOAgentPreconditionFailed { + + return &UpdateMTOAgentPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o agent precondition failed response +func (o *UpdateMTOAgentPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOAgentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent precondition failed response +func (o *UpdateMTOAgentPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOAgentUnprocessableEntity +const UpdateMTOAgentUnprocessableEntityCode int = 422 + +/* +UpdateMTOAgentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOAgentUnprocessableEntity +*/ +type UpdateMTOAgentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOAgentUnprocessableEntity creates UpdateMTOAgentUnprocessableEntity with default headers values +func NewUpdateMTOAgentUnprocessableEntity() *UpdateMTOAgentUnprocessableEntity { + + return &UpdateMTOAgentUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o agent unprocessable entity response +func (o *UpdateMTOAgentUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOAgentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent unprocessable entity response +func (o *UpdateMTOAgentUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOAgentInternalServerErrorCode is the HTTP code returned for type UpdateMTOAgentInternalServerError +const UpdateMTOAgentInternalServerErrorCode int = 500 + +/* +UpdateMTOAgentInternalServerError A server error occurred. + +swagger:response updateMTOAgentInternalServerError +*/ +type UpdateMTOAgentInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOAgentInternalServerError creates UpdateMTOAgentInternalServerError with default headers values +func NewUpdateMTOAgentInternalServerError() *UpdateMTOAgentInternalServerError { + + return &UpdateMTOAgentInternalServerError{} +} + +// WithPayload adds the payload to the update m t o agent internal server error response +func (o *UpdateMTOAgentInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOAgentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o agent internal server error response +func (o *UpdateMTOAgentInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOAgentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go new file mode 100644 index 00000000000..4f9c1234a13 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_agent_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOAgentURL generates an URL for the update m t o agent operation +type UpdateMTOAgentURL struct { + AgentID strfmt.UUID + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOAgentURL) WithBasePath(bp string) *UpdateMTOAgentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOAgentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOAgentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/agents/{agentID}" + + agentID := o.AgentID.String() + if agentID != "" { + _path = strings.Replace(_path, "{agentID}", agentID, -1) + } else { + return nil, errors.New("agentId is required on UpdateMTOAgentURL") + } + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOAgentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOAgentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOAgentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOAgentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOAgentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOAgentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOAgentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go new file mode 100644 index 00000000000..588bc361b08 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment.go @@ -0,0 +1,59 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler +type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params +type UpdateMTOShipmentHandler interface { + Handle(UpdateMTOShipmentParams) middleware.Responder +} + +// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation +func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { + return &UpdateMTOShipment{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment + +updateMTOShipment + +_[Deprecated: this endpoint was deprecated on August 5th, 2024]_ +Please use the new endpoint at `/prime/v3/updateMTOShipment` instead. +*/ +type UpdateMTOShipment struct { + Context *middleware.Context + Handler UpdateMTOShipmentHandler +} + +func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go new file mode 100644 index 00000000000..b5d1e738c34 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentAddressHandlerFunc turns a function with the right signature into a update m t o shipment address handler +type UpdateMTOShipmentAddressHandlerFunc func(UpdateMTOShipmentAddressParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentAddressHandlerFunc) Handle(params UpdateMTOShipmentAddressParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentAddressHandler interface for that can handle valid update m t o shipment address params +type UpdateMTOShipmentAddressHandler interface { + Handle(UpdateMTOShipmentAddressParams) middleware.Responder +} + +// NewUpdateMTOShipmentAddress creates a new http.Handler for the update m t o shipment address operation +func NewUpdateMTOShipmentAddress(ctx *middleware.Context, handler UpdateMTOShipmentAddressHandler) *UpdateMTOShipmentAddress { + return &UpdateMTOShipmentAddress{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipmentAddress swagger:route PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID} mtoShipment updateMTOShipmentAddress + +updateMTOShipmentAddress + +### Functionality +This endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID. +Therefore a complete address should be sent in the request. +When a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match. + +This endpoint **cannot create** an address. +To create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address. + +### Errors +The address must be associated with the mtoShipment passed in the url. +In other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided. +If it is not, caller will receive a **Conflict** Error. + +The mtoShipment should be associated with an MTO that is available to prime. +If the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error. +*/ +type UpdateMTOShipmentAddress struct { + Context *middleware.Context + Handler UpdateMTOShipmentAddressHandler +} + +func (o *UpdateMTOShipmentAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentAddressParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go new file mode 100644 index 00000000000..523f692c9b8 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOShipmentAddressParams creates a new UpdateMTOShipmentAddressParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentAddressParams() UpdateMTOShipmentAddressParams { + + return UpdateMTOShipmentAddressParams{} +} + +// UpdateMTOShipmentAddressParams contains all the bound params for the update m t o shipment address operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipmentAddress +type UpdateMTOShipmentAddressParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of the address being updated + Required: true + In: path + */ + AddressID strfmt.UUID + /* + Required: true + In: body + */ + Body *primemessages.Address + /*UUID of the shipment associated with the address + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentAddressParams() beforehand. +func (o *UpdateMTOShipmentAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rAddressID, rhkAddressID, _ := route.Params.GetOK("addressID") + if err := o.bindAddressID(rAddressID, rhkAddressID, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.Address + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentAddressParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindAddressID binds and validates parameter AddressID from path. +func (o *UpdateMTOShipmentAddressParams) bindAddressID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("addressID", "path", "strfmt.UUID", raw) + } + o.AddressID = *(value.(*strfmt.UUID)) + + if err := o.validateAddressID(formats); err != nil { + return err + } + + return nil +} + +// validateAddressID carries on validations for parameter AddressID +func (o *UpdateMTOShipmentAddressParams) validateAddressID(formats strfmt.Registry) error { + + if err := validate.FormatOf("addressID", "path", "uuid", o.AddressID.String(), formats); err != nil { + return err + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentAddressParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentAddressParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go new file mode 100644 index 00000000000..a4141c254d3 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOShipmentAddressOKCode is the HTTP code returned for type UpdateMTOShipmentAddressOK +const UpdateMTOShipmentAddressOKCode int = 200 + +/* +UpdateMTOShipmentAddressOK Successfully updated the address. + +swagger:response updateMTOShipmentAddressOK +*/ +type UpdateMTOShipmentAddressOK struct { + + /* + In: Body + */ + Payload *primemessages.Address `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressOK creates UpdateMTOShipmentAddressOK with default headers values +func NewUpdateMTOShipmentAddressOK() *UpdateMTOShipmentAddressOK { + + return &UpdateMTOShipmentAddressOK{} +} + +// WithPayload adds the payload to the update m t o shipment address o k response +func (o *UpdateMTOShipmentAddressOK) WithPayload(payload *primemessages.Address) *UpdateMTOShipmentAddressOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address o k response +func (o *UpdateMTOShipmentAddressOK) SetPayload(payload *primemessages.Address) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressBadRequestCode is the HTTP code returned for type UpdateMTOShipmentAddressBadRequest +const UpdateMTOShipmentAddressBadRequestCode int = 400 + +/* +UpdateMTOShipmentAddressBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentAddressBadRequest +*/ +type UpdateMTOShipmentAddressBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressBadRequest creates UpdateMTOShipmentAddressBadRequest with default headers values +func NewUpdateMTOShipmentAddressBadRequest() *UpdateMTOShipmentAddressBadRequest { + + return &UpdateMTOShipmentAddressBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment address bad request response +func (o *UpdateMTOShipmentAddressBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address bad request response +func (o *UpdateMTOShipmentAddressBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentAddressUnauthorized +const UpdateMTOShipmentAddressUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentAddressUnauthorized The request was denied. + +swagger:response updateMTOShipmentAddressUnauthorized +*/ +type UpdateMTOShipmentAddressUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressUnauthorized creates UpdateMTOShipmentAddressUnauthorized with default headers values +func NewUpdateMTOShipmentAddressUnauthorized() *UpdateMTOShipmentAddressUnauthorized { + + return &UpdateMTOShipmentAddressUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment address unauthorized response +func (o *UpdateMTOShipmentAddressUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address unauthorized response +func (o *UpdateMTOShipmentAddressUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressForbiddenCode is the HTTP code returned for type UpdateMTOShipmentAddressForbidden +const UpdateMTOShipmentAddressForbiddenCode int = 403 + +/* +UpdateMTOShipmentAddressForbidden The request was denied. + +swagger:response updateMTOShipmentAddressForbidden +*/ +type UpdateMTOShipmentAddressForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressForbidden creates UpdateMTOShipmentAddressForbidden with default headers values +func NewUpdateMTOShipmentAddressForbidden() *UpdateMTOShipmentAddressForbidden { + + return &UpdateMTOShipmentAddressForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment address forbidden response +func (o *UpdateMTOShipmentAddressForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address forbidden response +func (o *UpdateMTOShipmentAddressForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressNotFoundCode is the HTTP code returned for type UpdateMTOShipmentAddressNotFound +const UpdateMTOShipmentAddressNotFoundCode int = 404 + +/* +UpdateMTOShipmentAddressNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentAddressNotFound +*/ +type UpdateMTOShipmentAddressNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressNotFound creates UpdateMTOShipmentAddressNotFound with default headers values +func NewUpdateMTOShipmentAddressNotFound() *UpdateMTOShipmentAddressNotFound { + + return &UpdateMTOShipmentAddressNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment address not found response +func (o *UpdateMTOShipmentAddressNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address not found response +func (o *UpdateMTOShipmentAddressNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressConflictCode is the HTTP code returned for type UpdateMTOShipmentAddressConflict +const UpdateMTOShipmentAddressConflictCode int = 409 + +/* +UpdateMTOShipmentAddressConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateMTOShipmentAddressConflict +*/ +type UpdateMTOShipmentAddressConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressConflict creates UpdateMTOShipmentAddressConflict with default headers values +func NewUpdateMTOShipmentAddressConflict() *UpdateMTOShipmentAddressConflict { + + return &UpdateMTOShipmentAddressConflict{} +} + +// WithPayload adds the payload to the update m t o shipment address conflict response +func (o *UpdateMTOShipmentAddressConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address conflict response +func (o *UpdateMTOShipmentAddressConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentAddressPreconditionFailed +const UpdateMTOShipmentAddressPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentAddressPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentAddressPreconditionFailed +*/ +type UpdateMTOShipmentAddressPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressPreconditionFailed creates UpdateMTOShipmentAddressPreconditionFailed with default headers values +func NewUpdateMTOShipmentAddressPreconditionFailed() *UpdateMTOShipmentAddressPreconditionFailed { + + return &UpdateMTOShipmentAddressPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment address precondition failed response +func (o *UpdateMTOShipmentAddressPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentAddressPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address precondition failed response +func (o *UpdateMTOShipmentAddressPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentAddressUnprocessableEntity +const UpdateMTOShipmentAddressUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentAddressUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOShipmentAddressUnprocessableEntity +*/ +type UpdateMTOShipmentAddressUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressUnprocessableEntity creates UpdateMTOShipmentAddressUnprocessableEntity with default headers values +func NewUpdateMTOShipmentAddressUnprocessableEntity() *UpdateMTOShipmentAddressUnprocessableEntity { + + return &UpdateMTOShipmentAddressUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment address unprocessable entity response +func (o *UpdateMTOShipmentAddressUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOShipmentAddressUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address unprocessable entity response +func (o *UpdateMTOShipmentAddressUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentAddressInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentAddressInternalServerError +const UpdateMTOShipmentAddressInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentAddressInternalServerError A server error occurred. + +swagger:response updateMTOShipmentAddressInternalServerError +*/ +type UpdateMTOShipmentAddressInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentAddressInternalServerError creates UpdateMTOShipmentAddressInternalServerError with default headers values +func NewUpdateMTOShipmentAddressInternalServerError() *UpdateMTOShipmentAddressInternalServerError { + + return &UpdateMTOShipmentAddressInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment address internal server error response +func (o *UpdateMTOShipmentAddressInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOShipmentAddressInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment address internal server error response +func (o *UpdateMTOShipmentAddressInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go new file mode 100644 index 00000000000..f6f4c63bb6f --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_address_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentAddressURL generates an URL for the update m t o shipment address operation +type UpdateMTOShipmentAddressURL struct { + AddressID strfmt.UUID + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentAddressURL) WithBasePath(bp string) *UpdateMTOShipmentAddressURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentAddressURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentAddressURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/addresses/{addressID}" + + addressID := o.AddressID.String() + if addressID != "" { + _path = strings.Replace(_path, "{addressID}", addressID, -1) + } else { + return nil, errors.New("addressId is required on UpdateMTOShipmentAddressURL") + } + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentAddressURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentAddressURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentAddressURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentAddressURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentAddressURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentAddressURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentAddressURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..92beebf098c --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { + + return UpdateMTOShipmentParams{} +} + +// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipment +type UpdateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the shipment being updated. + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. +func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..9c59dbe036f --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,37 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" +) + +// UpdateMTOShipmentGoneCode is the HTTP code returned for type UpdateMTOShipmentGone +const UpdateMTOShipmentGoneCode int = 410 + +/* +UpdateMTOShipmentGone This endpoint is deprecated. Please use `/prime/v3/updateMTOShipment` instead. + +swagger:response updateMTOShipmentGone +*/ +type UpdateMTOShipmentGone struct { +} + +// NewUpdateMTOShipmentGone creates UpdateMTOShipmentGone with default headers values +func NewUpdateMTOShipmentGone() *UpdateMTOShipmentGone { + + return &UpdateMTOShipmentGone{} +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentGone) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses + + rw.WriteHeader(410) +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..2dd72d33fed --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentStatusHandlerFunc turns a function with the right signature into a update m t o shipment status handler +type UpdateMTOShipmentStatusHandlerFunc func(UpdateMTOShipmentStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentStatusHandlerFunc) Handle(params UpdateMTOShipmentStatusParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentStatusHandler interface for that can handle valid update m t o shipment status params +type UpdateMTOShipmentStatusHandler interface { + Handle(UpdateMTOShipmentStatusParams) middleware.Responder +} + +// NewUpdateMTOShipmentStatus creates a new http.Handler for the update m t o shipment status operation +func NewUpdateMTOShipmentStatus(ctx *middleware.Context, handler UpdateMTOShipmentStatusHandler) *UpdateMTOShipmentStatus { + return &UpdateMTOShipmentStatus{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipmentStatus swagger:route PATCH /mto-shipments/{mtoShipmentID}/status mtoShipment updateMTOShipmentStatus + +updateMTOShipmentStatus + +### Functionality +This endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment +status to be changed to "CANCELED." Currently, the Prime cannot update the shipment to any other status. +*/ +type UpdateMTOShipmentStatus struct { + Context *middleware.Context + Handler UpdateMTOShipmentStatusHandler +} + +func (o *UpdateMTOShipmentStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go new file mode 100644 index 00000000000..2fb252a4602 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentStatusParams() UpdateMTOShipmentStatusParams { + + return UpdateMTOShipmentStatusParams{} +} + +// UpdateMTOShipmentStatusParams contains all the bound params for the update m t o shipment status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipmentStatus +type UpdateMTOShipmentStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *primemessages.UpdateMTOShipmentStatus + /*UUID of the shipment associated with the agent + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentStatusParams() beforehand. +func (o *UpdateMTOShipmentStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.UpdateMTOShipmentStatus + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentStatusParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentStatusParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go new file mode 100644 index 00000000000..c6f6c5b9794 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOShipmentStatusOKCode is the HTTP code returned for type UpdateMTOShipmentStatusOK +const UpdateMTOShipmentStatusOKCode int = 200 + +/* +UpdateMTOShipmentStatusOK Successfully updated the shipment's status. + +swagger:response updateMTOShipmentStatusOK +*/ +type UpdateMTOShipmentStatusOK struct { + + /* + In: Body + */ + Payload *primemessages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusOK creates UpdateMTOShipmentStatusOK with default headers values +func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { + + return &UpdateMTOShipmentStatusOK{} +} + +// WithPayload adds the payload to the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) WithPayload(payload *primemessages.MTOShipment) *UpdateMTOShipmentStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) SetPayload(payload *primemessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusBadRequestCode is the HTTP code returned for type UpdateMTOShipmentStatusBadRequest +const UpdateMTOShipmentStatusBadRequestCode int = 400 + +/* +UpdateMTOShipmentStatusBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentStatusBadRequest +*/ +type UpdateMTOShipmentStatusBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusBadRequest creates UpdateMTOShipmentStatusBadRequest with default headers values +func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { + + return &UpdateMTOShipmentStatusBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentStatusUnauthorized +const UpdateMTOShipmentStatusUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentStatusUnauthorized The request was denied. + +swagger:response updateMTOShipmentStatusUnauthorized +*/ +type UpdateMTOShipmentStatusUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusUnauthorized creates UpdateMTOShipmentStatusUnauthorized with default headers values +func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { + + return &UpdateMTOShipmentStatusUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusForbiddenCode is the HTTP code returned for type UpdateMTOShipmentStatusForbidden +const UpdateMTOShipmentStatusForbiddenCode int = 403 + +/* +UpdateMTOShipmentStatusForbidden The request was denied. + +swagger:response updateMTOShipmentStatusForbidden +*/ +type UpdateMTOShipmentStatusForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusForbidden creates UpdateMTOShipmentStatusForbidden with default headers values +func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { + + return &UpdateMTOShipmentStatusForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusNotFoundCode is the HTTP code returned for type UpdateMTOShipmentStatusNotFound +const UpdateMTOShipmentStatusNotFoundCode int = 404 + +/* +UpdateMTOShipmentStatusNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentStatusNotFound +*/ +type UpdateMTOShipmentStatusNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusNotFound creates UpdateMTOShipmentStatusNotFound with default headers values +func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { + + return &UpdateMTOShipmentStatusNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusConflictCode is the HTTP code returned for type UpdateMTOShipmentStatusConflict +const UpdateMTOShipmentStatusConflictCode int = 409 + +/* +UpdateMTOShipmentStatusConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateMTOShipmentStatusConflict +*/ +type UpdateMTOShipmentStatusConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusConflict creates UpdateMTOShipmentStatusConflict with default headers values +func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { + + return &UpdateMTOShipmentStatusConflict{} +} + +// WithPayload adds the payload to the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentStatusPreconditionFailed +const UpdateMTOShipmentStatusPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentStatusPreconditionFailed +*/ +type UpdateMTOShipmentStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusPreconditionFailed creates UpdateMTOShipmentStatusPreconditionFailed with default headers values +func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { + + return &UpdateMTOShipmentStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateMTOShipmentStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentStatusUnprocessableEntity +const UpdateMTOShipmentStatusUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentStatusUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOShipmentStatusUnprocessableEntity +*/ +type UpdateMTOShipmentStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusUnprocessableEntity creates UpdateMTOShipmentStatusUnprocessableEntity with default headers values +func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { + + return &UpdateMTOShipmentStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateMTOShipmentStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentStatusInternalServerError +const UpdateMTOShipmentStatusInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentStatusInternalServerError A server error occurred. + +swagger:response updateMTOShipmentStatusInternalServerError +*/ +type UpdateMTOShipmentStatusInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusInternalServerError creates UpdateMTOShipmentStatusInternalServerError with default headers values +func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { + + return &UpdateMTOShipmentStatusInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) WithPayload(payload *primemessages.Error) *UpdateMTOShipmentStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go new file mode 100644 index 00000000000..cb67f2877e5 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentStatusURL generates an URL for the update m t o shipment status operation +type UpdateMTOShipmentStatusURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentStatusURL) WithBasePath(bp string) *UpdateMTOShipmentStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/status" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..8de892a250c --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation +type UpdateMTOShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go new file mode 100644 index 00000000000..9b4b09909ad --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh.go @@ -0,0 +1,64 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateReweighHandlerFunc turns a function with the right signature into a update reweigh handler +type UpdateReweighHandlerFunc func(UpdateReweighParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateReweighHandlerFunc) Handle(params UpdateReweighParams) middleware.Responder { + return fn(params) +} + +// UpdateReweighHandler interface for that can handle valid update reweigh params +type UpdateReweighHandler interface { + Handle(UpdateReweighParams) middleware.Responder +} + +// NewUpdateReweigh creates a new http.Handler for the update reweigh operation +func NewUpdateReweigh(ctx *middleware.Context, handler UpdateReweighHandler) *UpdateReweigh { + return &UpdateReweigh{Context: ctx, Handler: handler} +} + +/* + UpdateReweigh swagger:route PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID} mtoShipment updateReweigh + +updateReweigh + +### Functionality +This endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur. +Only one of weight or verificationReason should be sent in the request body. + +A reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment. +A reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed, +so not all shipments will have a reweigh weight. +*/ +type UpdateReweigh struct { + Context *middleware.Context + Handler UpdateReweighHandler +} + +func (o *UpdateReweigh) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateReweighParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go new file mode 100644 index 00000000000..6cc7a0ba346 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_parameters.go @@ -0,0 +1,201 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateReweighParams creates a new UpdateReweighParams object +// +// There are no default values defined in the spec. +func NewUpdateReweighParams() UpdateReweighParams { + + return UpdateReweighParams{} +} + +// UpdateReweighParams contains all the bound params for the update reweigh operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateReweigh +type UpdateReweighParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *primemessages.UpdateReweigh + /*UUID of the shipment associated with the reweigh + Required: true + In: path + */ + MtoShipmentID strfmt.UUID + /*UUID of the reweigh being updated + Required: true + In: path + */ + ReweighID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateReweighParams() beforehand. +func (o *UpdateReweighParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.UpdateReweigh + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + + rReweighID, rhkReweighID, _ := route.Params.GetOK("reweighID") + if err := o.bindReweighID(rReweighID, rhkReweighID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateReweighParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateReweighParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateReweighParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} + +// bindReweighID binds and validates parameter ReweighID from path. +func (o *UpdateReweighParams) bindReweighID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("reweighID", "path", "strfmt.UUID", raw) + } + o.ReweighID = *(value.(*strfmt.UUID)) + + if err := o.validateReweighID(formats); err != nil { + return err + } + + return nil +} + +// validateReweighID carries on validations for parameter ReweighID +func (o *UpdateReweighParams) validateReweighID(formats strfmt.Registry) error { + + if err := validate.FormatOf("reweighID", "path", "uuid", o.ReweighID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go new file mode 100644 index 00000000000..1c9d57bb6e7 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateReweighOKCode is the HTTP code returned for type UpdateReweighOK +const UpdateReweighOKCode int = 200 + +/* +UpdateReweighOK Successfully updated the reweigh. + +swagger:response updateReweighOK +*/ +type UpdateReweighOK struct { + + /* + In: Body + */ + Payload *primemessages.Reweigh `json:"body,omitempty"` +} + +// NewUpdateReweighOK creates UpdateReweighOK with default headers values +func NewUpdateReweighOK() *UpdateReweighOK { + + return &UpdateReweighOK{} +} + +// WithPayload adds the payload to the update reweigh o k response +func (o *UpdateReweighOK) WithPayload(payload *primemessages.Reweigh) *UpdateReweighOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh o k response +func (o *UpdateReweighOK) SetPayload(payload *primemessages.Reweigh) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighBadRequestCode is the HTTP code returned for type UpdateReweighBadRequest +const UpdateReweighBadRequestCode int = 400 + +/* +UpdateReweighBadRequest The request payload is invalid. + +swagger:response updateReweighBadRequest +*/ +type UpdateReweighBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighBadRequest creates UpdateReweighBadRequest with default headers values +func NewUpdateReweighBadRequest() *UpdateReweighBadRequest { + + return &UpdateReweighBadRequest{} +} + +// WithPayload adds the payload to the update reweigh bad request response +func (o *UpdateReweighBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateReweighBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh bad request response +func (o *UpdateReweighBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighUnauthorizedCode is the HTTP code returned for type UpdateReweighUnauthorized +const UpdateReweighUnauthorizedCode int = 401 + +/* +UpdateReweighUnauthorized The request was denied. + +swagger:response updateReweighUnauthorized +*/ +type UpdateReweighUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighUnauthorized creates UpdateReweighUnauthorized with default headers values +func NewUpdateReweighUnauthorized() *UpdateReweighUnauthorized { + + return &UpdateReweighUnauthorized{} +} + +// WithPayload adds the payload to the update reweigh unauthorized response +func (o *UpdateReweighUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateReweighUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh unauthorized response +func (o *UpdateReweighUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighForbiddenCode is the HTTP code returned for type UpdateReweighForbidden +const UpdateReweighForbiddenCode int = 403 + +/* +UpdateReweighForbidden The request was denied. + +swagger:response updateReweighForbidden +*/ +type UpdateReweighForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighForbidden creates UpdateReweighForbidden with default headers values +func NewUpdateReweighForbidden() *UpdateReweighForbidden { + + return &UpdateReweighForbidden{} +} + +// WithPayload adds the payload to the update reweigh forbidden response +func (o *UpdateReweighForbidden) WithPayload(payload *primemessages.ClientError) *UpdateReweighForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh forbidden response +func (o *UpdateReweighForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighNotFoundCode is the HTTP code returned for type UpdateReweighNotFound +const UpdateReweighNotFoundCode int = 404 + +/* +UpdateReweighNotFound The requested resource wasn't found. + +swagger:response updateReweighNotFound +*/ +type UpdateReweighNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighNotFound creates UpdateReweighNotFound with default headers values +func NewUpdateReweighNotFound() *UpdateReweighNotFound { + + return &UpdateReweighNotFound{} +} + +// WithPayload adds the payload to the update reweigh not found response +func (o *UpdateReweighNotFound) WithPayload(payload *primemessages.ClientError) *UpdateReweighNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh not found response +func (o *UpdateReweighNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighConflictCode is the HTTP code returned for type UpdateReweighConflict +const UpdateReweighConflictCode int = 409 + +/* +UpdateReweighConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateReweighConflict +*/ +type UpdateReweighConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighConflict creates UpdateReweighConflict with default headers values +func NewUpdateReweighConflict() *UpdateReweighConflict { + + return &UpdateReweighConflict{} +} + +// WithPayload adds the payload to the update reweigh conflict response +func (o *UpdateReweighConflict) WithPayload(payload *primemessages.ClientError) *UpdateReweighConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh conflict response +func (o *UpdateReweighConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighPreconditionFailedCode is the HTTP code returned for type UpdateReweighPreconditionFailed +const UpdateReweighPreconditionFailedCode int = 412 + +/* +UpdateReweighPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateReweighPreconditionFailed +*/ +type UpdateReweighPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateReweighPreconditionFailed creates UpdateReweighPreconditionFailed with default headers values +func NewUpdateReweighPreconditionFailed() *UpdateReweighPreconditionFailed { + + return &UpdateReweighPreconditionFailed{} +} + +// WithPayload adds the payload to the update reweigh precondition failed response +func (o *UpdateReweighPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateReweighPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh precondition failed response +func (o *UpdateReweighPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighUnprocessableEntityCode is the HTTP code returned for type UpdateReweighUnprocessableEntity +const UpdateReweighUnprocessableEntityCode int = 422 + +/* +UpdateReweighUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateReweighUnprocessableEntity +*/ +type UpdateReweighUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateReweighUnprocessableEntity creates UpdateReweighUnprocessableEntity with default headers values +func NewUpdateReweighUnprocessableEntity() *UpdateReweighUnprocessableEntity { + + return &UpdateReweighUnprocessableEntity{} +} + +// WithPayload adds the payload to the update reweigh unprocessable entity response +func (o *UpdateReweighUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateReweighUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh unprocessable entity response +func (o *UpdateReweighUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateReweighInternalServerErrorCode is the HTTP code returned for type UpdateReweighInternalServerError +const UpdateReweighInternalServerErrorCode int = 500 + +/* +UpdateReweighInternalServerError A server error occurred. + +swagger:response updateReweighInternalServerError +*/ +type UpdateReweighInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateReweighInternalServerError creates UpdateReweighInternalServerError with default headers values +func NewUpdateReweighInternalServerError() *UpdateReweighInternalServerError { + + return &UpdateReweighInternalServerError{} +} + +// WithPayload adds the payload to the update reweigh internal server error response +func (o *UpdateReweighInternalServerError) WithPayload(payload *primemessages.Error) *UpdateReweighInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update reweigh internal server error response +func (o *UpdateReweighInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateReweighInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go new file mode 100644 index 00000000000..c93040e0506 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_reweigh_urlbuilder.go @@ -0,0 +1,109 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateReweighURL generates an URL for the update reweigh operation +type UpdateReweighURL struct { + MtoShipmentID strfmt.UUID + ReweighID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateReweighURL) WithBasePath(bp string) *UpdateReweighURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateReweighURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateReweighURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateReweighURL") + } + + reweighID := o.ReweighID.String() + if reweighID != "" { + _path = strings.Replace(_path, "{reweighID}", reweighID, -1) + } else { + return nil, errors.New("reweighId is required on UpdateReweighURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateReweighURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateReweighURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateReweighURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateReweighURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateReweighURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateReweighURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go new file mode 100644 index 00000000000..05d4da3e964 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateShipmentDestinationAddressHandlerFunc turns a function with the right signature into a update shipment destination address handler +type UpdateShipmentDestinationAddressHandlerFunc func(UpdateShipmentDestinationAddressParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateShipmentDestinationAddressHandlerFunc) Handle(params UpdateShipmentDestinationAddressParams) middleware.Responder { + return fn(params) +} + +// UpdateShipmentDestinationAddressHandler interface for that can handle valid update shipment destination address params +type UpdateShipmentDestinationAddressHandler interface { + Handle(UpdateShipmentDestinationAddressParams) middleware.Responder +} + +// NewUpdateShipmentDestinationAddress creates a new http.Handler for the update shipment destination address operation +func NewUpdateShipmentDestinationAddress(ctx *middleware.Context, handler UpdateShipmentDestinationAddressHandler) *UpdateShipmentDestinationAddress { + return &UpdateShipmentDestinationAddress{Context: ctx, Handler: handler} +} + +/* + UpdateShipmentDestinationAddress swagger:route POST /mto-shipments/{mtoShipmentID}/shipment-address-updates mtoShipment updateShipmentDestinationAddress + +updateShipmentDestinationAddress + +### Functionality +This endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment, +after the delivery address has already been approved. + +This endpoint and operation only supports the following shipment types: +- HHG +- NTSR + +For HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved. + +Address updates will be automatically approved unless they change: + - The service area + - Mileage bracket for direct delivery + - the address and the distance between the old and new address is > 50 + - Domestic Short Haul to Domestic Line Haul or vice versa + - Shipments that start and end in one ZIP3 use Short Haul pricing + - Shipments that start and end in different ZIP3s use Line Haul pricing + +For those, changes will require TOO approval. +*/ +type UpdateShipmentDestinationAddress struct { + Context *middleware.Context + Handler UpdateShipmentDestinationAddressHandler +} + +func (o *UpdateShipmentDestinationAddress) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateShipmentDestinationAddressParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go new file mode 100644 index 00000000000..5017b9a9912 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateShipmentDestinationAddressParams creates a new UpdateShipmentDestinationAddressParams object +// +// There are no default values defined in the spec. +func NewUpdateShipmentDestinationAddressParams() UpdateShipmentDestinationAddressParams { + + return UpdateShipmentDestinationAddressParams{} +} + +// UpdateShipmentDestinationAddressParams contains all the bound params for the update shipment destination address operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateShipmentDestinationAddress +type UpdateShipmentDestinationAddressParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *primemessages.UpdateShipmentDestinationAddress + /*UUID of the shipment associated with the address + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateShipmentDestinationAddressParams() beforehand. +func (o *UpdateShipmentDestinationAddressParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.UpdateShipmentDestinationAddress + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateShipmentDestinationAddressParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateShipmentDestinationAddressParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateShipmentDestinationAddressParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go new file mode 100644 index 00000000000..409fd04c241 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateShipmentDestinationAddressCreatedCode is the HTTP code returned for type UpdateShipmentDestinationAddressCreated +const UpdateShipmentDestinationAddressCreatedCode int = 201 + +/* +UpdateShipmentDestinationAddressCreated Successfully created the address update request. + +swagger:response updateShipmentDestinationAddressCreated +*/ +type UpdateShipmentDestinationAddressCreated struct { + + /* + In: Body + */ + Payload *primemessages.ShipmentAddressUpdate `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressCreated creates UpdateShipmentDestinationAddressCreated with default headers values +func NewUpdateShipmentDestinationAddressCreated() *UpdateShipmentDestinationAddressCreated { + + return &UpdateShipmentDestinationAddressCreated{} +} + +// WithPayload adds the payload to the update shipment destination address created response +func (o *UpdateShipmentDestinationAddressCreated) WithPayload(payload *primemessages.ShipmentAddressUpdate) *UpdateShipmentDestinationAddressCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address created response +func (o *UpdateShipmentDestinationAddressCreated) SetPayload(payload *primemessages.ShipmentAddressUpdate) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressBadRequestCode is the HTTP code returned for type UpdateShipmentDestinationAddressBadRequest +const UpdateShipmentDestinationAddressBadRequestCode int = 400 + +/* +UpdateShipmentDestinationAddressBadRequest The request payload is invalid. + +swagger:response updateShipmentDestinationAddressBadRequest +*/ +type UpdateShipmentDestinationAddressBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressBadRequest creates UpdateShipmentDestinationAddressBadRequest with default headers values +func NewUpdateShipmentDestinationAddressBadRequest() *UpdateShipmentDestinationAddressBadRequest { + + return &UpdateShipmentDestinationAddressBadRequest{} +} + +// WithPayload adds the payload to the update shipment destination address bad request response +func (o *UpdateShipmentDestinationAddressBadRequest) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address bad request response +func (o *UpdateShipmentDestinationAddressBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressUnauthorizedCode is the HTTP code returned for type UpdateShipmentDestinationAddressUnauthorized +const UpdateShipmentDestinationAddressUnauthorizedCode int = 401 + +/* +UpdateShipmentDestinationAddressUnauthorized The request was denied. + +swagger:response updateShipmentDestinationAddressUnauthorized +*/ +type UpdateShipmentDestinationAddressUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressUnauthorized creates UpdateShipmentDestinationAddressUnauthorized with default headers values +func NewUpdateShipmentDestinationAddressUnauthorized() *UpdateShipmentDestinationAddressUnauthorized { + + return &UpdateShipmentDestinationAddressUnauthorized{} +} + +// WithPayload adds the payload to the update shipment destination address unauthorized response +func (o *UpdateShipmentDestinationAddressUnauthorized) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address unauthorized response +func (o *UpdateShipmentDestinationAddressUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressForbiddenCode is the HTTP code returned for type UpdateShipmentDestinationAddressForbidden +const UpdateShipmentDestinationAddressForbiddenCode int = 403 + +/* +UpdateShipmentDestinationAddressForbidden The request was denied. + +swagger:response updateShipmentDestinationAddressForbidden +*/ +type UpdateShipmentDestinationAddressForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressForbidden creates UpdateShipmentDestinationAddressForbidden with default headers values +func NewUpdateShipmentDestinationAddressForbidden() *UpdateShipmentDestinationAddressForbidden { + + return &UpdateShipmentDestinationAddressForbidden{} +} + +// WithPayload adds the payload to the update shipment destination address forbidden response +func (o *UpdateShipmentDestinationAddressForbidden) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address forbidden response +func (o *UpdateShipmentDestinationAddressForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressNotFoundCode is the HTTP code returned for type UpdateShipmentDestinationAddressNotFound +const UpdateShipmentDestinationAddressNotFoundCode int = 404 + +/* +UpdateShipmentDestinationAddressNotFound The requested resource wasn't found. + +swagger:response updateShipmentDestinationAddressNotFound +*/ +type UpdateShipmentDestinationAddressNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressNotFound creates UpdateShipmentDestinationAddressNotFound with default headers values +func NewUpdateShipmentDestinationAddressNotFound() *UpdateShipmentDestinationAddressNotFound { + + return &UpdateShipmentDestinationAddressNotFound{} +} + +// WithPayload adds the payload to the update shipment destination address not found response +func (o *UpdateShipmentDestinationAddressNotFound) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address not found response +func (o *UpdateShipmentDestinationAddressNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressConflictCode is the HTTP code returned for type UpdateShipmentDestinationAddressConflict +const UpdateShipmentDestinationAddressConflictCode int = 409 + +/* +UpdateShipmentDestinationAddressConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response updateShipmentDestinationAddressConflict +*/ +type UpdateShipmentDestinationAddressConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressConflict creates UpdateShipmentDestinationAddressConflict with default headers values +func NewUpdateShipmentDestinationAddressConflict() *UpdateShipmentDestinationAddressConflict { + + return &UpdateShipmentDestinationAddressConflict{} +} + +// WithPayload adds the payload to the update shipment destination address conflict response +func (o *UpdateShipmentDestinationAddressConflict) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address conflict response +func (o *UpdateShipmentDestinationAddressConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressPreconditionFailedCode is the HTTP code returned for type UpdateShipmentDestinationAddressPreconditionFailed +const UpdateShipmentDestinationAddressPreconditionFailedCode int = 412 + +/* +UpdateShipmentDestinationAddressPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateShipmentDestinationAddressPreconditionFailed +*/ +type UpdateShipmentDestinationAddressPreconditionFailed struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressPreconditionFailed creates UpdateShipmentDestinationAddressPreconditionFailed with default headers values +func NewUpdateShipmentDestinationAddressPreconditionFailed() *UpdateShipmentDestinationAddressPreconditionFailed { + + return &UpdateShipmentDestinationAddressPreconditionFailed{} +} + +// WithPayload adds the payload to the update shipment destination address precondition failed response +func (o *UpdateShipmentDestinationAddressPreconditionFailed) WithPayload(payload *primemessages.ClientError) *UpdateShipmentDestinationAddressPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address precondition failed response +func (o *UpdateShipmentDestinationAddressPreconditionFailed) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressUnprocessableEntityCode is the HTTP code returned for type UpdateShipmentDestinationAddressUnprocessableEntity +const UpdateShipmentDestinationAddressUnprocessableEntityCode int = 422 + +/* +UpdateShipmentDestinationAddressUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateShipmentDestinationAddressUnprocessableEntity +*/ +type UpdateShipmentDestinationAddressUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressUnprocessableEntity creates UpdateShipmentDestinationAddressUnprocessableEntity with default headers values +func NewUpdateShipmentDestinationAddressUnprocessableEntity() *UpdateShipmentDestinationAddressUnprocessableEntity { + + return &UpdateShipmentDestinationAddressUnprocessableEntity{} +} + +// WithPayload adds the payload to the update shipment destination address unprocessable entity response +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *UpdateShipmentDestinationAddressUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address unprocessable entity response +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateShipmentDestinationAddressInternalServerErrorCode is the HTTP code returned for type UpdateShipmentDestinationAddressInternalServerError +const UpdateShipmentDestinationAddressInternalServerErrorCode int = 500 + +/* +UpdateShipmentDestinationAddressInternalServerError A server error occurred. + +swagger:response updateShipmentDestinationAddressInternalServerError +*/ +type UpdateShipmentDestinationAddressInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewUpdateShipmentDestinationAddressInternalServerError creates UpdateShipmentDestinationAddressInternalServerError with default headers values +func NewUpdateShipmentDestinationAddressInternalServerError() *UpdateShipmentDestinationAddressInternalServerError { + + return &UpdateShipmentDestinationAddressInternalServerError{} +} + +// WithPayload adds the payload to the update shipment destination address internal server error response +func (o *UpdateShipmentDestinationAddressInternalServerError) WithPayload(payload *primemessages.Error) *UpdateShipmentDestinationAddressInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update shipment destination address internal server error response +func (o *UpdateShipmentDestinationAddressInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateShipmentDestinationAddressInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go new file mode 100644 index 00000000000..302bec38b03 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mto_shipment/update_shipment_destination_address_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateShipmentDestinationAddressURL generates an URL for the update shipment destination address operation +type UpdateShipmentDestinationAddressURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateShipmentDestinationAddressURL) WithBasePath(bp string) *UpdateShipmentDestinationAddressURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateShipmentDestinationAddressURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateShipmentDestinationAddressURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/shipment-address-updates" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateShipmentDestinationAddressURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateShipmentDestinationAddressURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateShipmentDestinationAddressURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateShipmentDestinationAddressURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateShipmentDestinationAddressURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateShipmentDestinationAddressURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateShipmentDestinationAddressURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/mymove_api.go b/pkg/gen/primeapi/primeoperations/mymove_api.go new file mode 100644 index 00000000000..b9e44b2190c --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/mymove_api.go @@ -0,0 +1,558 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primeoperations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations/payment_request" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + MultipartformConsumer: runtime.DiscardConsumer, + + BinProducer: runtime.ByteStreamProducer(), + JSONProducer: runtime.JSONProducer(), + + MoveTaskOrderCreateExcessWeightRecordHandler: move_task_order.CreateExcessWeightRecordHandlerFunc(func(params move_task_order.CreateExcessWeightRecordParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.CreateExcessWeightRecord has not yet been implemented") + }), + MtoShipmentCreateMTOAgentHandler: mto_shipment.CreateMTOAgentHandlerFunc(func(params mto_shipment.CreateMTOAgentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOAgent has not yet been implemented") + }), + MtoServiceItemCreateMTOServiceItemHandler: mto_service_item.CreateMTOServiceItemHandlerFunc(func(params mto_service_item.CreateMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.CreateMTOServiceItem has not yet been implemented") + }), + MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }), + PaymentRequestCreatePaymentRequestHandler: payment_request.CreatePaymentRequestHandlerFunc(func(params payment_request.CreatePaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.CreatePaymentRequest has not yet been implemented") + }), + MtoShipmentCreateSITExtensionHandler: mto_shipment.CreateSITExtensionHandlerFunc(func(params mto_shipment.CreateSITExtensionParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateSITExtension has not yet been implemented") + }), + MtoServiceItemCreateServiceRequestDocumentUploadHandler: mto_service_item.CreateServiceRequestDocumentUploadHandlerFunc(func(params mto_service_item.CreateServiceRequestDocumentUploadParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.CreateServiceRequestDocumentUpload has not yet been implemented") + }), + PaymentRequestCreateUploadHandler: payment_request.CreateUploadHandlerFunc(func(params payment_request.CreateUploadParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.CreateUpload has not yet been implemented") + }), + MtoShipmentDeleteMTOShipmentHandler: mto_shipment.DeleteMTOShipmentHandlerFunc(func(params mto_shipment.DeleteMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.DeleteMTOShipment has not yet been implemented") + }), + MoveTaskOrderDownloadMoveOrderHandler: move_task_order.DownloadMoveOrderHandlerFunc(func(params move_task_order.DownloadMoveOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.DownloadMoveOrder has not yet been implemented") + }), + MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }), + MoveTaskOrderListMovesHandler: move_task_order.ListMovesHandlerFunc(func(params move_task_order.ListMovesParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.ListMoves has not yet been implemented") + }), + MtoShipmentUpdateMTOAgentHandler: mto_shipment.UpdateMTOAgentHandlerFunc(func(params mto_shipment.UpdateMTOAgentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOAgent has not yet been implemented") + }), + MoveTaskOrderUpdateMTOPostCounselingInformationHandler: move_task_order.UpdateMTOPostCounselingInformationHandlerFunc(func(params move_task_order.UpdateMTOPostCounselingInformationParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.UpdateMTOPostCounselingInformation has not yet been implemented") + }), + MtoServiceItemUpdateMTOServiceItemHandler: mto_service_item.UpdateMTOServiceItemHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItem has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentAddressHandler: mto_shipment.UpdateMTOShipmentAddressHandlerFunc(func(params mto_shipment.UpdateMTOShipmentAddressParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentAddress has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentStatusHandler: mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") + }), + MtoShipmentUpdateReweighHandler: mto_shipment.UpdateReweighHandlerFunc(func(params mto_shipment.UpdateReweighParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateReweigh has not yet been implemented") + }), + MtoShipmentUpdateShipmentDestinationAddressHandler: mto_shipment.UpdateShipmentDestinationAddressHandlerFunc(func(params mto_shipment.UpdateShipmentDestinationAddressParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateShipmentDestinationAddress has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Prime API is a RESTful API that enables the Prime contractor to request +information about upcoming moves, update the details and status of those moves, +and make payment requests. It uses Mutual TLS for authentication procedures. + +All endpoints are located at `/prime/v1/`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + // MultipartformConsumer registers a consumer for the following mime types: + // - multipart/form-data + MultipartformConsumer runtime.Consumer + + // BinProducer registers a producer for the following mime types: + // - application/pdf + BinProducer runtime.Producer + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // MoveTaskOrderCreateExcessWeightRecordHandler sets the operation handler for the create excess weight record operation + MoveTaskOrderCreateExcessWeightRecordHandler move_task_order.CreateExcessWeightRecordHandler + // MtoShipmentCreateMTOAgentHandler sets the operation handler for the create m t o agent operation + MtoShipmentCreateMTOAgentHandler mto_shipment.CreateMTOAgentHandler + // MtoServiceItemCreateMTOServiceItemHandler sets the operation handler for the create m t o service item operation + MtoServiceItemCreateMTOServiceItemHandler mto_service_item.CreateMTOServiceItemHandler + // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation + MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler + // PaymentRequestCreatePaymentRequestHandler sets the operation handler for the create payment request operation + PaymentRequestCreatePaymentRequestHandler payment_request.CreatePaymentRequestHandler + // MtoShipmentCreateSITExtensionHandler sets the operation handler for the create s i t extension operation + MtoShipmentCreateSITExtensionHandler mto_shipment.CreateSITExtensionHandler + // MtoServiceItemCreateServiceRequestDocumentUploadHandler sets the operation handler for the create service request document upload operation + MtoServiceItemCreateServiceRequestDocumentUploadHandler mto_service_item.CreateServiceRequestDocumentUploadHandler + // PaymentRequestCreateUploadHandler sets the operation handler for the create upload operation + PaymentRequestCreateUploadHandler payment_request.CreateUploadHandler + // MtoShipmentDeleteMTOShipmentHandler sets the operation handler for the delete m t o shipment operation + MtoShipmentDeleteMTOShipmentHandler mto_shipment.DeleteMTOShipmentHandler + // MoveTaskOrderDownloadMoveOrderHandler sets the operation handler for the download move order operation + MoveTaskOrderDownloadMoveOrderHandler move_task_order.DownloadMoveOrderHandler + // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation + MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler + // MoveTaskOrderListMovesHandler sets the operation handler for the list moves operation + MoveTaskOrderListMovesHandler move_task_order.ListMovesHandler + // MtoShipmentUpdateMTOAgentHandler sets the operation handler for the update m t o agent operation + MtoShipmentUpdateMTOAgentHandler mto_shipment.UpdateMTOAgentHandler + // MoveTaskOrderUpdateMTOPostCounselingInformationHandler sets the operation handler for the update m t o post counseling information operation + MoveTaskOrderUpdateMTOPostCounselingInformationHandler move_task_order.UpdateMTOPostCounselingInformationHandler + // MtoServiceItemUpdateMTOServiceItemHandler sets the operation handler for the update m t o service item operation + MtoServiceItemUpdateMTOServiceItemHandler mto_service_item.UpdateMTOServiceItemHandler + // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation + MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler + // MtoShipmentUpdateMTOShipmentAddressHandler sets the operation handler for the update m t o shipment address operation + MtoShipmentUpdateMTOShipmentAddressHandler mto_shipment.UpdateMTOShipmentAddressHandler + // MtoShipmentUpdateMTOShipmentStatusHandler sets the operation handler for the update m t o shipment status operation + MtoShipmentUpdateMTOShipmentStatusHandler mto_shipment.UpdateMTOShipmentStatusHandler + // MtoShipmentUpdateReweighHandler sets the operation handler for the update reweigh operation + MtoShipmentUpdateReweighHandler mto_shipment.UpdateReweighHandler + // MtoShipmentUpdateShipmentDestinationAddressHandler sets the operation handler for the update shipment destination address operation + MtoShipmentUpdateShipmentDestinationAddressHandler mto_shipment.UpdateShipmentDestinationAddressHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + if o.MultipartformConsumer == nil { + unregistered = append(unregistered, "MultipartformConsumer") + } + + if o.BinProducer == nil { + unregistered = append(unregistered, "BinProducer") + } + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.MoveTaskOrderCreateExcessWeightRecordHandler == nil { + unregistered = append(unregistered, "move_task_order.CreateExcessWeightRecordHandler") + } + if o.MtoShipmentCreateMTOAgentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOAgentHandler") + } + if o.MtoServiceItemCreateMTOServiceItemHandler == nil { + unregistered = append(unregistered, "mto_service_item.CreateMTOServiceItemHandler") + } + if o.MtoShipmentCreateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") + } + if o.PaymentRequestCreatePaymentRequestHandler == nil { + unregistered = append(unregistered, "payment_request.CreatePaymentRequestHandler") + } + if o.MtoShipmentCreateSITExtensionHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateSITExtensionHandler") + } + if o.MtoServiceItemCreateServiceRequestDocumentUploadHandler == nil { + unregistered = append(unregistered, "mto_service_item.CreateServiceRequestDocumentUploadHandler") + } + if o.PaymentRequestCreateUploadHandler == nil { + unregistered = append(unregistered, "payment_request.CreateUploadHandler") + } + if o.MtoShipmentDeleteMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.DeleteMTOShipmentHandler") + } + if o.MoveTaskOrderDownloadMoveOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.DownloadMoveOrderHandler") + } + if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") + } + if o.MoveTaskOrderListMovesHandler == nil { + unregistered = append(unregistered, "move_task_order.ListMovesHandler") + } + if o.MtoShipmentUpdateMTOAgentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOAgentHandler") + } + if o.MoveTaskOrderUpdateMTOPostCounselingInformationHandler == nil { + unregistered = append(unregistered, "move_task_order.UpdateMTOPostCounselingInformationHandler") + } + if o.MtoServiceItemUpdateMTOServiceItemHandler == nil { + unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemHandler") + } + if o.MtoShipmentUpdateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") + } + if o.MtoShipmentUpdateMTOShipmentAddressHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentAddressHandler") + } + if o.MtoShipmentUpdateMTOShipmentStatusHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentStatusHandler") + } + if o.MtoShipmentUpdateReweighHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateReweighHandler") + } + if o.MtoShipmentUpdateShipmentDestinationAddressHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateShipmentDestinationAddressHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + case "multipart/form-data": + result["multipart/form-data"] = o.MultipartformConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/pdf": + result["application/pdf"] = o.BinProducer + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/move-task-orders/{moveTaskOrderID}/excess-weight-record"] = move_task_order.NewCreateExcessWeightRecord(o.context, o.MoveTaskOrderCreateExcessWeightRecordHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/agents"] = mto_shipment.NewCreateMTOAgent(o.context, o.MtoShipmentCreateMTOAgentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-service-items"] = mto_service_item.NewCreateMTOServiceItem(o.context, o.MtoServiceItemCreateMTOServiceItemHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/payment-requests"] = payment_request.NewCreatePaymentRequest(o.context, o.PaymentRequestCreatePaymentRequestHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/sit-extensions"] = mto_shipment.NewCreateSITExtension(o.context, o.MtoShipmentCreateSITExtensionHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-service-items/{mtoServiceItemID}/uploads"] = mto_service_item.NewCreateServiceRequestDocumentUpload(o.context, o.MtoServiceItemCreateServiceRequestDocumentUploadHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/payment-requests/{paymentRequestID}/uploads"] = payment_request.NewCreateUpload(o.context, o.PaymentRequestCreateUploadHandler) + if o.handlers["DELETE"] == nil { + o.handlers["DELETE"] = make(map[string]http.Handler) + } + o.handlers["DELETE"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewDeleteMTOShipment(o.context, o.MtoShipmentDeleteMTOShipmentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves/{locator}/documents"] = move_task_order.NewDownloadMoveOrder(o.context, o.MoveTaskOrderDownloadMoveOrderHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/moves"] = move_task_order.NewListMoves(o.context, o.MoveTaskOrderListMovesHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/mto-shipments/{mtoShipmentID}/agents/{agentID}"] = mto_shipment.NewUpdateMTOAgent(o.context, o.MtoShipmentUpdateMTOAgentHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/post-counseling-info"] = move_task_order.NewUpdateMTOPostCounselingInformation(o.context, o.MoveTaskOrderUpdateMTOPostCounselingInformationHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-service-items/{mtoServiceItemID}"] = mto_service_item.NewUpdateMTOServiceItem(o.context, o.MtoServiceItemUpdateMTOServiceItemHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) + if o.handlers["PUT"] == nil { + o.handlers["PUT"] = make(map[string]http.Handler) + } + o.handlers["PUT"]["/mto-shipments/{mtoShipmentID}/addresses/{addressID}"] = mto_shipment.NewUpdateMTOShipmentAddress(o.context, o.MtoShipmentUpdateMTOShipmentAddressHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/status"] = mto_shipment.NewUpdateMTOShipmentStatus(o.context, o.MtoShipmentUpdateMTOShipmentStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}"] = mto_shipment.NewUpdateReweigh(o.context, o.MtoShipmentUpdateReweighHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments/{mtoShipmentID}/shipment-address-updates"] = mto_shipment.NewUpdateShipmentDestinationAddress(o.context, o.MtoShipmentUpdateShipmentDestinationAddressHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go new file mode 100644 index 00000000000..d1ca6a38ab8 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request.go @@ -0,0 +1,407 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreatePaymentRequestHandlerFunc turns a function with the right signature into a create payment request handler +type CreatePaymentRequestHandlerFunc func(CreatePaymentRequestParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreatePaymentRequestHandlerFunc) Handle(params CreatePaymentRequestParams) middleware.Responder { + return fn(params) +} + +// CreatePaymentRequestHandler interface for that can handle valid create payment request params +type CreatePaymentRequestHandler interface { + Handle(CreatePaymentRequestParams) middleware.Responder +} + +// NewCreatePaymentRequest creates a new http.Handler for the create payment request operation +func NewCreatePaymentRequest(ctx *middleware.Context, handler CreatePaymentRequestHandler) *CreatePaymentRequest { + return &CreatePaymentRequest{Context: ctx, Handler: handler} +} + +/* + CreatePaymentRequest swagger:route POST /payment-requests paymentRequest createPaymentRequest + +createPaymentRequest + +Creates a new instance of a paymentRequest and is assigned the status `PENDING`. +A move task order can have multiple payment requests, and +a final payment request can be marked using boolean `isFinal`. + +If a `PENDING` payment request is recalculated, +a new payment request is created and the original request is +marked with the status `DEPRECATED`. + +**NOTE**: In order to create a payment request for most service items, the shipment *must* +be updated with the `PrimeActualWeight` value via [updateMTOShipment](#operation/updateMTOShipment). + +If `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. + +**NOTE**: Diversions have a unique calcuation for payment requests without a `WeightBilled` parameter. + +If you created a payment request for a diversion and `WeightBilled` is not provided, then the following will be used in the calculation: +- The lowest shipment weight (`PrimeActualWeight`) found in the diverted shipment chain. +- The lowest reweigh weight found in the diverted shipment chain. + +The diverted shipment chain is created by referencing the `diversion` boolean, `divertedFromShipmentId` UUID, and matching destination to pickup addresses. +If the chain cannot be established it will fall back to the `PrimeActualWeight` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations. +The lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found. + +A service item can be on several payment requests in the case of partial payment requests and payments. + +In the request, if no params are necessary, then just the `serviceItem` `id` is required. For example: +```json + + { + "isFinal": false, + "moveTaskOrderID": "uuid", + "serviceItems": [ + { + "id": "uuid", + }, + { + "id": "uuid", + "params": [ + { + "key": "Service Item Parameter Name", + "value": "Service Item Parameter Value" + } + ] + } + ], + "pointOfContact": "string" + } + +``` + +Domestic Basic Service Items & Accepted Payment Request Parameters: +--- + +**DLH - Domestic Linehaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DSH - Domestic Shorthaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**FSC - Fuel Surcharge** +**NOTE**: FSC requires `ActualPickupDate` to be updated on the shipment. +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DUPK - Domestic Unpacking** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DPK - Domestic Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DNPK - Domestic NTS Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DPK - Domestic Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOP - Domestic Origin Price** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDP - Domestic Destination Price** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +Domestic SIT Service Items & Accepted Payment Request Parameters: +--- + +**DOFSIT - Domestic origin 1st day SIT** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* +*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + }, + { + "key": "SITPaymentRequestStart", + "value": "date" + }, + { + "key": "SITPaymentRequestEnd", + "value": "date" + } + ] + +``` + +**DOPSIT - Domestic origin SIT pickup** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOSHUT - Domestic origin shuttle service** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDFSIT - Domestic destination 1st day SIT** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* +*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + }, + { + "key": "SITPaymentRequestStart", + "value": "date" + }, + { + "key": "SITPaymentRequestEnd", + "value": "date" + } + ] + +``` + +**DDDSIT - Domestic destination SIT delivery** +*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDSHUT - Domestic destination shuttle service** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` +--- + +International Basic Service Items & Accepted Payment Request Parameters: +--- +Just like domestic shipments & service items, if `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. +**NOTE**: `POEFSC` & `PODFSC` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint. + +**ISLH - International Shipping & Linehaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**IHPK - International HHG Pack** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**IHUPK - International HHG Unpack** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**POEFSC - International Port of Embarkation Fuel Surcharge** + + **NOTE**: POEFSC requires `ActualPickupDate` to be updated on the shipment & `POELocation` on the service item. + +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**PODFSC - International Port of Debarkation Fuel Surcharge** +**NOTE**: PODFSC requires `ActualPickupDate` to be updated on the shipment & `PODLocation` on the service item. +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` +--- +*/ +type CreatePaymentRequest struct { + Context *middleware.Context + Handler CreatePaymentRequestHandler +} + +func (o *CreatePaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreatePaymentRequestParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go new file mode 100644 index 00000000000..a6f23bc54a9 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreatePaymentRequestParams creates a new CreatePaymentRequestParams object +// +// There are no default values defined in the spec. +func NewCreatePaymentRequestParams() CreatePaymentRequestParams { + + return CreatePaymentRequestParams{} +} + +// CreatePaymentRequestParams contains all the bound params for the create payment request operation +// typically these are obtained from a http.Request +// +// swagger:parameters createPaymentRequest +type CreatePaymentRequestParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *primemessages.CreatePaymentRequest +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreatePaymentRequestParams() beforehand. +func (o *CreatePaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primemessages.CreatePaymentRequest + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go new file mode 100644 index 00000000000..f0ceacac59b --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreatePaymentRequestCreatedCode is the HTTP code returned for type CreatePaymentRequestCreated +const CreatePaymentRequestCreatedCode int = 201 + +/* +CreatePaymentRequestCreated Successfully created a paymentRequest object. + +swagger:response createPaymentRequestCreated +*/ +type CreatePaymentRequestCreated struct { + + /* + In: Body + */ + Payload *primemessages.PaymentRequest `json:"body,omitempty"` +} + +// NewCreatePaymentRequestCreated creates CreatePaymentRequestCreated with default headers values +func NewCreatePaymentRequestCreated() *CreatePaymentRequestCreated { + + return &CreatePaymentRequestCreated{} +} + +// WithPayload adds the payload to the create payment request created response +func (o *CreatePaymentRequestCreated) WithPayload(payload *primemessages.PaymentRequest) *CreatePaymentRequestCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request created response +func (o *CreatePaymentRequestCreated) SetPayload(payload *primemessages.PaymentRequest) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestBadRequestCode is the HTTP code returned for type CreatePaymentRequestBadRequest +const CreatePaymentRequestBadRequestCode int = 400 + +/* +CreatePaymentRequestBadRequest Request payload is invalid. + +swagger:response createPaymentRequestBadRequest +*/ +type CreatePaymentRequestBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestBadRequest creates CreatePaymentRequestBadRequest with default headers values +func NewCreatePaymentRequestBadRequest() *CreatePaymentRequestBadRequest { + + return &CreatePaymentRequestBadRequest{} +} + +// WithPayload adds the payload to the create payment request bad request response +func (o *CreatePaymentRequestBadRequest) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request bad request response +func (o *CreatePaymentRequestBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestUnauthorizedCode is the HTTP code returned for type CreatePaymentRequestUnauthorized +const CreatePaymentRequestUnauthorizedCode int = 401 + +/* +CreatePaymentRequestUnauthorized The request was denied. + +swagger:response createPaymentRequestUnauthorized +*/ +type CreatePaymentRequestUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestUnauthorized creates CreatePaymentRequestUnauthorized with default headers values +func NewCreatePaymentRequestUnauthorized() *CreatePaymentRequestUnauthorized { + + return &CreatePaymentRequestUnauthorized{} +} + +// WithPayload adds the payload to the create payment request unauthorized response +func (o *CreatePaymentRequestUnauthorized) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request unauthorized response +func (o *CreatePaymentRequestUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestForbiddenCode is the HTTP code returned for type CreatePaymentRequestForbidden +const CreatePaymentRequestForbiddenCode int = 403 + +/* +CreatePaymentRequestForbidden The request was denied. + +swagger:response createPaymentRequestForbidden +*/ +type CreatePaymentRequestForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestForbidden creates CreatePaymentRequestForbidden with default headers values +func NewCreatePaymentRequestForbidden() *CreatePaymentRequestForbidden { + + return &CreatePaymentRequestForbidden{} +} + +// WithPayload adds the payload to the create payment request forbidden response +func (o *CreatePaymentRequestForbidden) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request forbidden response +func (o *CreatePaymentRequestForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestNotFoundCode is the HTTP code returned for type CreatePaymentRequestNotFound +const CreatePaymentRequestNotFoundCode int = 404 + +/* +CreatePaymentRequestNotFound The requested resource wasn't found. + +swagger:response createPaymentRequestNotFound +*/ +type CreatePaymentRequestNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestNotFound creates CreatePaymentRequestNotFound with default headers values +func NewCreatePaymentRequestNotFound() *CreatePaymentRequestNotFound { + + return &CreatePaymentRequestNotFound{} +} + +// WithPayload adds the payload to the create payment request not found response +func (o *CreatePaymentRequestNotFound) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request not found response +func (o *CreatePaymentRequestNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestConflictCode is the HTTP code returned for type CreatePaymentRequestConflict +const CreatePaymentRequestConflictCode int = 409 + +/* +CreatePaymentRequestConflict The request could not be processed because of conflict in the current state of the resource. + +swagger:response createPaymentRequestConflict +*/ +type CreatePaymentRequestConflict struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestConflict creates CreatePaymentRequestConflict with default headers values +func NewCreatePaymentRequestConflict() *CreatePaymentRequestConflict { + + return &CreatePaymentRequestConflict{} +} + +// WithPayload adds the payload to the create payment request conflict response +func (o *CreatePaymentRequestConflict) WithPayload(payload *primemessages.ClientError) *CreatePaymentRequestConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request conflict response +func (o *CreatePaymentRequestConflict) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestUnprocessableEntityCode is the HTTP code returned for type CreatePaymentRequestUnprocessableEntity +const CreatePaymentRequestUnprocessableEntityCode int = 422 + +/* +CreatePaymentRequestUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createPaymentRequestUnprocessableEntity +*/ +type CreatePaymentRequestUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreatePaymentRequestUnprocessableEntity creates CreatePaymentRequestUnprocessableEntity with default headers values +func NewCreatePaymentRequestUnprocessableEntity() *CreatePaymentRequestUnprocessableEntity { + + return &CreatePaymentRequestUnprocessableEntity{} +} + +// WithPayload adds the payload to the create payment request unprocessable entity response +func (o *CreatePaymentRequestUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreatePaymentRequestUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request unprocessable entity response +func (o *CreatePaymentRequestUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreatePaymentRequestInternalServerErrorCode is the HTTP code returned for type CreatePaymentRequestInternalServerError +const CreatePaymentRequestInternalServerErrorCode int = 500 + +/* +CreatePaymentRequestInternalServerError A server error occurred. + +swagger:response createPaymentRequestInternalServerError +*/ +type CreatePaymentRequestInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreatePaymentRequestInternalServerError creates CreatePaymentRequestInternalServerError with default headers values +func NewCreatePaymentRequestInternalServerError() *CreatePaymentRequestInternalServerError { + + return &CreatePaymentRequestInternalServerError{} +} + +// WithPayload adds the payload to the create payment request internal server error response +func (o *CreatePaymentRequestInternalServerError) WithPayload(payload *primemessages.Error) *CreatePaymentRequestInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create payment request internal server error response +func (o *CreatePaymentRequestInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreatePaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go new file mode 100644 index 00000000000..44a4e7cd0e6 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_payment_request_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreatePaymentRequestURL generates an URL for the create payment request operation +type CreatePaymentRequestURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreatePaymentRequestURL) WithBasePath(bp string) *CreatePaymentRequestURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreatePaymentRequestURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreatePaymentRequestURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreatePaymentRequestURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreatePaymentRequestURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreatePaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreatePaymentRequestURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreatePaymentRequestURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreatePaymentRequestURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go new file mode 100644 index 00000000000..d12433e4846 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_upload.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateUploadHandlerFunc turns a function with the right signature into a create upload handler +type CreateUploadHandlerFunc func(CreateUploadParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateUploadHandlerFunc) Handle(params CreateUploadParams) middleware.Responder { + return fn(params) +} + +// CreateUploadHandler interface for that can handle valid create upload params +type CreateUploadHandler interface { + Handle(CreateUploadParams) middleware.Responder +} + +// NewCreateUpload creates a new http.Handler for the create upload operation +func NewCreateUpload(ctx *middleware.Context, handler CreateUploadHandler) *CreateUpload { + return &CreateUpload{Context: ctx, Handler: handler} +} + +/* + CreateUpload swagger:route POST /payment-requests/{paymentRequestID}/uploads paymentRequest createUpload + +createUpload + +### Functionality +This endpoint **uploads** a Proof of Service document for a PaymentRequest. + +The PaymentRequest should already exist. + +Optional key of **isWeightTicket** indicates if the document is a weight ticket or not. +This will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents. +If left empty, it will assume it is NOT a weight ticket. + +The formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request: + + ```json + { + "file": "filePath", + "isWeightTicket": true + } + ``` + If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty: + ```json + { + "file": "filePath", + "isWeightTicket": false + } + ``` + ```json + { + "file": "filePath", + } + ``` + +PaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint. +*/ +type CreateUpload struct { + Context *middleware.Context + Handler CreateUploadHandler +} + +func (o *CreateUpload) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateUploadParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go new file mode 100644 index 00000000000..427d10fdd72 --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "mime/multipart" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// CreateUploadMaxParseMemory sets the maximum size in bytes for +// the multipart form parser for this operation. +// +// The default value is 32 MB. +// The multipart parser stores up to this + 10MB. +var CreateUploadMaxParseMemory int64 = 32 << 20 + +// NewCreateUploadParams creates a new CreateUploadParams object +// +// There are no default values defined in the spec. +func NewCreateUploadParams() CreateUploadParams { + + return CreateUploadParams{} +} + +// CreateUploadParams contains all the bound params for the create upload operation +// typically these are obtained from a http.Request +// +// swagger:parameters createUpload +type CreateUploadParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The file to upload. + Required: true + In: formData + */ + File io.ReadCloser + /*Indicates whether the file is a weight ticket. + In: formData + */ + IsWeightTicket *bool + /*UUID of payment request to use. + Required: true + In: path + */ + PaymentRequestID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateUploadParams() beforehand. +func (o *CreateUploadParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := r.ParseMultipartForm(CreateUploadMaxParseMemory); err != nil { + if err != http.ErrNotMultipart { + return errors.New(400, "%v", err) + } else if err := r.ParseForm(); err != nil { + return errors.New(400, "%v", err) + } + } + fds := runtime.Values(r.Form) + + file, fileHeader, err := r.FormFile("file") + if err != nil { + res = append(res, errors.New(400, "reading file %q failed: %v", "file", err)) + } else if err := o.bindFile(file, fileHeader); err != nil { + // Required: true + res = append(res, err) + } else { + o.File = &runtime.File{Data: file, Header: fileHeader} + } + + fdIsWeightTicket, fdhkIsWeightTicket, _ := fds.GetOK("isWeightTicket") + if err := o.bindIsWeightTicket(fdIsWeightTicket, fdhkIsWeightTicket, route.Formats); err != nil { + res = append(res, err) + } + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindFile binds file parameter File. +// +// The only supported validations on files are MinLength and MaxLength +func (o *CreateUploadParams) bindFile(file multipart.File, header *multipart.FileHeader) error { + return nil +} + +// bindIsWeightTicket binds and validates parameter IsWeightTicket from formData. +func (o *CreateUploadParams) bindIsWeightTicket(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertBool(raw) + if err != nil { + return errors.InvalidType("isWeightTicket", "formData", "bool", raw) + } + o.IsWeightTicket = &value + + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *CreateUploadParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.PaymentRequestID = raw + + return nil +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go new file mode 100644 index 00000000000..77840f7e5de --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateUploadCreatedCode is the HTTP code returned for type CreateUploadCreated +const CreateUploadCreatedCode int = 201 + +/* +CreateUploadCreated Successfully created upload of digital file. + +swagger:response createUploadCreated +*/ +type CreateUploadCreated struct { + + /* + In: Body + */ + Payload *primemessages.UploadWithOmissions `json:"body,omitempty"` +} + +// NewCreateUploadCreated creates CreateUploadCreated with default headers values +func NewCreateUploadCreated() *CreateUploadCreated { + + return &CreateUploadCreated{} +} + +// WithPayload adds the payload to the create upload created response +func (o *CreateUploadCreated) WithPayload(payload *primemessages.UploadWithOmissions) *CreateUploadCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload created response +func (o *CreateUploadCreated) SetPayload(payload *primemessages.UploadWithOmissions) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadBadRequestCode is the HTTP code returned for type CreateUploadBadRequest +const CreateUploadBadRequestCode int = 400 + +/* +CreateUploadBadRequest The request payload is invalid. + +swagger:response createUploadBadRequest +*/ +type CreateUploadBadRequest struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateUploadBadRequest creates CreateUploadBadRequest with default headers values +func NewCreateUploadBadRequest() *CreateUploadBadRequest { + + return &CreateUploadBadRequest{} +} + +// WithPayload adds the payload to the create upload bad request response +func (o *CreateUploadBadRequest) WithPayload(payload *primemessages.ClientError) *CreateUploadBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload bad request response +func (o *CreateUploadBadRequest) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadUnauthorizedCode is the HTTP code returned for type CreateUploadUnauthorized +const CreateUploadUnauthorizedCode int = 401 + +/* +CreateUploadUnauthorized The request was denied. + +swagger:response createUploadUnauthorized +*/ +type CreateUploadUnauthorized struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateUploadUnauthorized creates CreateUploadUnauthorized with default headers values +func NewCreateUploadUnauthorized() *CreateUploadUnauthorized { + + return &CreateUploadUnauthorized{} +} + +// WithPayload adds the payload to the create upload unauthorized response +func (o *CreateUploadUnauthorized) WithPayload(payload *primemessages.ClientError) *CreateUploadUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload unauthorized response +func (o *CreateUploadUnauthorized) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadForbiddenCode is the HTTP code returned for type CreateUploadForbidden +const CreateUploadForbiddenCode int = 403 + +/* +CreateUploadForbidden The request was denied. + +swagger:response createUploadForbidden +*/ +type CreateUploadForbidden struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateUploadForbidden creates CreateUploadForbidden with default headers values +func NewCreateUploadForbidden() *CreateUploadForbidden { + + return &CreateUploadForbidden{} +} + +// WithPayload adds the payload to the create upload forbidden response +func (o *CreateUploadForbidden) WithPayload(payload *primemessages.ClientError) *CreateUploadForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload forbidden response +func (o *CreateUploadForbidden) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadNotFoundCode is the HTTP code returned for type CreateUploadNotFound +const CreateUploadNotFoundCode int = 404 + +/* +CreateUploadNotFound The requested resource wasn't found. + +swagger:response createUploadNotFound +*/ +type CreateUploadNotFound struct { + + /* + In: Body + */ + Payload *primemessages.ClientError `json:"body,omitempty"` +} + +// NewCreateUploadNotFound creates CreateUploadNotFound with default headers values +func NewCreateUploadNotFound() *CreateUploadNotFound { + + return &CreateUploadNotFound{} +} + +// WithPayload adds the payload to the create upload not found response +func (o *CreateUploadNotFound) WithPayload(payload *primemessages.ClientError) *CreateUploadNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload not found response +func (o *CreateUploadNotFound) SetPayload(payload *primemessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadUnprocessableEntityCode is the HTTP code returned for type CreateUploadUnprocessableEntity +const CreateUploadUnprocessableEntityCode int = 422 + +/* +CreateUploadUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createUploadUnprocessableEntity +*/ +type CreateUploadUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primemessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateUploadUnprocessableEntity creates CreateUploadUnprocessableEntity with default headers values +func NewCreateUploadUnprocessableEntity() *CreateUploadUnprocessableEntity { + + return &CreateUploadUnprocessableEntity{} +} + +// WithPayload adds the payload to the create upload unprocessable entity response +func (o *CreateUploadUnprocessableEntity) WithPayload(payload *primemessages.ValidationError) *CreateUploadUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload unprocessable entity response +func (o *CreateUploadUnprocessableEntity) SetPayload(payload *primemessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateUploadInternalServerErrorCode is the HTTP code returned for type CreateUploadInternalServerError +const CreateUploadInternalServerErrorCode int = 500 + +/* +CreateUploadInternalServerError A server error occurred. + +swagger:response createUploadInternalServerError +*/ +type CreateUploadInternalServerError struct { + + /* + In: Body + */ + Payload *primemessages.Error `json:"body,omitempty"` +} + +// NewCreateUploadInternalServerError creates CreateUploadInternalServerError with default headers values +func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { + + return &CreateUploadInternalServerError{} +} + +// WithPayload adds the payload to the create upload internal server error response +func (o *CreateUploadInternalServerError) WithPayload(payload *primemessages.Error) *CreateUploadInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create upload internal server error response +func (o *CreateUploadInternalServerError) SetPayload(payload *primemessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateUploadInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go new file mode 100644 index 00000000000..183790a648d --- /dev/null +++ b/pkg/gen/primeapi/primeoperations/payment_request/create_upload_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// CreateUploadURL generates an URL for the create upload operation +type CreateUploadURL struct { + PaymentRequestID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) WithBasePath(bp string) *CreateUploadURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateUploadURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateUploadURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/uploads" + + paymentRequestID := o.PaymentRequestID + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on CreateUploadURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateUploadURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateUploadURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateUploadURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateUploadURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateUploadURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateUploadURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primeapi/server.go b/pkg/gen/primeapi/server.go new file mode 100644 index 00000000000..a03d46dfb32 --- /dev/null +++ b/pkg/gen/primeapi/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primeapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/primeapi/primeoperations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *primeoperations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *primeoperations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *primeoperations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go new file mode 100644 index 00000000000..f43b2ab2556 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateExcessWeightRecordParams creates a new CreateExcessWeightRecordParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateExcessWeightRecordParams() *CreateExcessWeightRecordParams { + return &CreateExcessWeightRecordParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateExcessWeightRecordParamsWithTimeout creates a new CreateExcessWeightRecordParams object +// with the ability to set a timeout on a request. +func NewCreateExcessWeightRecordParamsWithTimeout(timeout time.Duration) *CreateExcessWeightRecordParams { + return &CreateExcessWeightRecordParams{ + timeout: timeout, + } +} + +// NewCreateExcessWeightRecordParamsWithContext creates a new CreateExcessWeightRecordParams object +// with the ability to set a context for a request. +func NewCreateExcessWeightRecordParamsWithContext(ctx context.Context) *CreateExcessWeightRecordParams { + return &CreateExcessWeightRecordParams{ + Context: ctx, + } +} + +// NewCreateExcessWeightRecordParamsWithHTTPClient creates a new CreateExcessWeightRecordParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateExcessWeightRecordParamsWithHTTPClient(client *http.Client) *CreateExcessWeightRecordParams { + return &CreateExcessWeightRecordParams{ + HTTPClient: client, + } +} + +/* +CreateExcessWeightRecordParams contains all the parameters to send to the API endpoint + + for the create excess weight record operation. + + Typically these are written to a http.Request. +*/ +type CreateExcessWeightRecordParams struct { + + /* File. + + The file to upload. + */ + File runtime.NamedReadCloser + + /* MoveTaskOrderID. + + UUID of the move being updated. + + Format: uuid + */ + MoveTaskOrderID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create excess weight record params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateExcessWeightRecordParams) WithDefaults() *CreateExcessWeightRecordParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create excess weight record params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateExcessWeightRecordParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create excess weight record params +func (o *CreateExcessWeightRecordParams) WithTimeout(timeout time.Duration) *CreateExcessWeightRecordParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create excess weight record params +func (o *CreateExcessWeightRecordParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create excess weight record params +func (o *CreateExcessWeightRecordParams) WithContext(ctx context.Context) *CreateExcessWeightRecordParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create excess weight record params +func (o *CreateExcessWeightRecordParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create excess weight record params +func (o *CreateExcessWeightRecordParams) WithHTTPClient(client *http.Client) *CreateExcessWeightRecordParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create excess weight record params +func (o *CreateExcessWeightRecordParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFile adds the file to the create excess weight record params +func (o *CreateExcessWeightRecordParams) WithFile(file runtime.NamedReadCloser) *CreateExcessWeightRecordParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the create excess weight record params +func (o *CreateExcessWeightRecordParams) SetFile(file runtime.NamedReadCloser) { + o.File = file +} + +// WithMoveTaskOrderID adds the moveTaskOrderID to the create excess weight record params +func (o *CreateExcessWeightRecordParams) WithMoveTaskOrderID(moveTaskOrderID strfmt.UUID) *CreateExcessWeightRecordParams { + o.SetMoveTaskOrderID(moveTaskOrderID) + return o +} + +// SetMoveTaskOrderID adds the moveTaskOrderId to the create excess weight record params +func (o *CreateExcessWeightRecordParams) SetMoveTaskOrderID(moveTaskOrderID strfmt.UUID) { + o.MoveTaskOrderID = moveTaskOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateExcessWeightRecordParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + // form file param file + if err := r.SetFileParam("file", o.File); err != nil { + return err + } + + // path param moveTaskOrderID + if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go new file mode 100644 index 00000000000..6a258392730 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/create_excess_weight_record_responses.go @@ -0,0 +1,473 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateExcessWeightRecordReader is a Reader for the CreateExcessWeightRecord structure. +type CreateExcessWeightRecordReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateExcessWeightRecordReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateExcessWeightRecordCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewCreateExcessWeightRecordUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateExcessWeightRecordForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateExcessWeightRecordNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateExcessWeightRecordUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateExcessWeightRecordInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record] createExcessWeightRecord", response, response.Code()) + } +} + +// NewCreateExcessWeightRecordCreated creates a CreateExcessWeightRecordCreated with default headers values +func NewCreateExcessWeightRecordCreated() *CreateExcessWeightRecordCreated { + return &CreateExcessWeightRecordCreated{} +} + +/* +CreateExcessWeightRecordCreated describes a response with status code 201, with default header values. + +Successfully uploaded the excess weight record file. +*/ +type CreateExcessWeightRecordCreated struct { + Payload *primemessages.ExcessWeightRecord +} + +// IsSuccess returns true when this create excess weight record created response has a 2xx status code +func (o *CreateExcessWeightRecordCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create excess weight record created response has a 3xx status code +func (o *CreateExcessWeightRecordCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record created response has a 4xx status code +func (o *CreateExcessWeightRecordCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create excess weight record created response has a 5xx status code +func (o *CreateExcessWeightRecordCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create excess weight record created response a status code equal to that given +func (o *CreateExcessWeightRecordCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create excess weight record created response +func (o *CreateExcessWeightRecordCreated) Code() int { + return 201 +} + +func (o *CreateExcessWeightRecordCreated) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordCreated %+v", 201, o.Payload) +} + +func (o *CreateExcessWeightRecordCreated) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordCreated %+v", 201, o.Payload) +} + +func (o *CreateExcessWeightRecordCreated) GetPayload() *primemessages.ExcessWeightRecord { + return o.Payload +} + +func (o *CreateExcessWeightRecordCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ExcessWeightRecord) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateExcessWeightRecordUnauthorized creates a CreateExcessWeightRecordUnauthorized with default headers values +func NewCreateExcessWeightRecordUnauthorized() *CreateExcessWeightRecordUnauthorized { + return &CreateExcessWeightRecordUnauthorized{} +} + +/* +CreateExcessWeightRecordUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateExcessWeightRecordUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create excess weight record unauthorized response has a 2xx status code +func (o *CreateExcessWeightRecordUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create excess weight record unauthorized response has a 3xx status code +func (o *CreateExcessWeightRecordUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record unauthorized response has a 4xx status code +func (o *CreateExcessWeightRecordUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create excess weight record unauthorized response has a 5xx status code +func (o *CreateExcessWeightRecordUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create excess weight record unauthorized response a status code equal to that given +func (o *CreateExcessWeightRecordUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create excess weight record unauthorized response +func (o *CreateExcessWeightRecordUnauthorized) Code() int { + return 401 +} + +func (o *CreateExcessWeightRecordUnauthorized) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateExcessWeightRecordUnauthorized) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateExcessWeightRecordUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateExcessWeightRecordUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateExcessWeightRecordForbidden creates a CreateExcessWeightRecordForbidden with default headers values +func NewCreateExcessWeightRecordForbidden() *CreateExcessWeightRecordForbidden { + return &CreateExcessWeightRecordForbidden{} +} + +/* +CreateExcessWeightRecordForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateExcessWeightRecordForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create excess weight record forbidden response has a 2xx status code +func (o *CreateExcessWeightRecordForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create excess weight record forbidden response has a 3xx status code +func (o *CreateExcessWeightRecordForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record forbidden response has a 4xx status code +func (o *CreateExcessWeightRecordForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create excess weight record forbidden response has a 5xx status code +func (o *CreateExcessWeightRecordForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create excess weight record forbidden response a status code equal to that given +func (o *CreateExcessWeightRecordForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create excess weight record forbidden response +func (o *CreateExcessWeightRecordForbidden) Code() int { + return 403 +} + +func (o *CreateExcessWeightRecordForbidden) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordForbidden %+v", 403, o.Payload) +} + +func (o *CreateExcessWeightRecordForbidden) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordForbidden %+v", 403, o.Payload) +} + +func (o *CreateExcessWeightRecordForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateExcessWeightRecordForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateExcessWeightRecordNotFound creates a CreateExcessWeightRecordNotFound with default headers values +func NewCreateExcessWeightRecordNotFound() *CreateExcessWeightRecordNotFound { + return &CreateExcessWeightRecordNotFound{} +} + +/* +CreateExcessWeightRecordNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateExcessWeightRecordNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create excess weight record not found response has a 2xx status code +func (o *CreateExcessWeightRecordNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create excess weight record not found response has a 3xx status code +func (o *CreateExcessWeightRecordNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record not found response has a 4xx status code +func (o *CreateExcessWeightRecordNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create excess weight record not found response has a 5xx status code +func (o *CreateExcessWeightRecordNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create excess weight record not found response a status code equal to that given +func (o *CreateExcessWeightRecordNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create excess weight record not found response +func (o *CreateExcessWeightRecordNotFound) Code() int { + return 404 +} + +func (o *CreateExcessWeightRecordNotFound) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordNotFound %+v", 404, o.Payload) +} + +func (o *CreateExcessWeightRecordNotFound) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordNotFound %+v", 404, o.Payload) +} + +func (o *CreateExcessWeightRecordNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateExcessWeightRecordNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateExcessWeightRecordUnprocessableEntity creates a CreateExcessWeightRecordUnprocessableEntity with default headers values +func NewCreateExcessWeightRecordUnprocessableEntity() *CreateExcessWeightRecordUnprocessableEntity { + return &CreateExcessWeightRecordUnprocessableEntity{} +} + +/* +CreateExcessWeightRecordUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateExcessWeightRecordUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create excess weight record unprocessable entity response has a 2xx status code +func (o *CreateExcessWeightRecordUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create excess weight record unprocessable entity response has a 3xx status code +func (o *CreateExcessWeightRecordUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record unprocessable entity response has a 4xx status code +func (o *CreateExcessWeightRecordUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create excess weight record unprocessable entity response has a 5xx status code +func (o *CreateExcessWeightRecordUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create excess weight record unprocessable entity response a status code equal to that given +func (o *CreateExcessWeightRecordUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create excess weight record unprocessable entity response +func (o *CreateExcessWeightRecordUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateExcessWeightRecordUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateExcessWeightRecordUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateExcessWeightRecordUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateExcessWeightRecordUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateExcessWeightRecordInternalServerError creates a CreateExcessWeightRecordInternalServerError with default headers values +func NewCreateExcessWeightRecordInternalServerError() *CreateExcessWeightRecordInternalServerError { + return &CreateExcessWeightRecordInternalServerError{} +} + +/* +CreateExcessWeightRecordInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateExcessWeightRecordInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create excess weight record internal server error response has a 2xx status code +func (o *CreateExcessWeightRecordInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create excess weight record internal server error response has a 3xx status code +func (o *CreateExcessWeightRecordInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create excess weight record internal server error response has a 4xx status code +func (o *CreateExcessWeightRecordInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create excess weight record internal server error response has a 5xx status code +func (o *CreateExcessWeightRecordInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create excess weight record internal server error response a status code equal to that given +func (o *CreateExcessWeightRecordInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create excess weight record internal server error response +func (o *CreateExcessWeightRecordInternalServerError) Code() int { + return 500 +} + +func (o *CreateExcessWeightRecordInternalServerError) Error() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateExcessWeightRecordInternalServerError) String() string { + return fmt.Sprintf("[POST /move-task-orders/{moveTaskOrderID}/excess-weight-record][%d] createExcessWeightRecordInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateExcessWeightRecordInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateExcessWeightRecordInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go b/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go new file mode 100644 index 00000000000..842c81f7830 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/download_move_order_parameters.go @@ -0,0 +1,198 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDownloadMoveOrderParams creates a new DownloadMoveOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDownloadMoveOrderParams() *DownloadMoveOrderParams { + return &DownloadMoveOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDownloadMoveOrderParamsWithTimeout creates a new DownloadMoveOrderParams object +// with the ability to set a timeout on a request. +func NewDownloadMoveOrderParamsWithTimeout(timeout time.Duration) *DownloadMoveOrderParams { + return &DownloadMoveOrderParams{ + timeout: timeout, + } +} + +// NewDownloadMoveOrderParamsWithContext creates a new DownloadMoveOrderParams object +// with the ability to set a context for a request. +func NewDownloadMoveOrderParamsWithContext(ctx context.Context) *DownloadMoveOrderParams { + return &DownloadMoveOrderParams{ + Context: ctx, + } +} + +// NewDownloadMoveOrderParamsWithHTTPClient creates a new DownloadMoveOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewDownloadMoveOrderParamsWithHTTPClient(client *http.Client) *DownloadMoveOrderParams { + return &DownloadMoveOrderParams{ + HTTPClient: client, + } +} + +/* +DownloadMoveOrderParams contains all the parameters to send to the API endpoint + + for the download move order operation. + + Typically these are written to a http.Request. +*/ +type DownloadMoveOrderParams struct { + + /* Locator. + + the locator code for move order to be downloaded + */ + Locator string + + /* Type. + + upload type + + Default: "ALL" + */ + Type *string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the download move order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadMoveOrderParams) WithDefaults() *DownloadMoveOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the download move order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DownloadMoveOrderParams) SetDefaults() { + var ( + typeVarDefault = string("ALL") + ) + + val := DownloadMoveOrderParams{ + Type: &typeVarDefault, + } + + val.timeout = o.timeout + val.Context = o.Context + val.HTTPClient = o.HTTPClient + *o = val +} + +// WithTimeout adds the timeout to the download move order params +func (o *DownloadMoveOrderParams) WithTimeout(timeout time.Duration) *DownloadMoveOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the download move order params +func (o *DownloadMoveOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the download move order params +func (o *DownloadMoveOrderParams) WithContext(ctx context.Context) *DownloadMoveOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the download move order params +func (o *DownloadMoveOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the download move order params +func (o *DownloadMoveOrderParams) WithHTTPClient(client *http.Client) *DownloadMoveOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the download move order params +func (o *DownloadMoveOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithLocator adds the locator to the download move order params +func (o *DownloadMoveOrderParams) WithLocator(locator string) *DownloadMoveOrderParams { + o.SetLocator(locator) + return o +} + +// SetLocator adds the locator to the download move order params +func (o *DownloadMoveOrderParams) SetLocator(locator string) { + o.Locator = locator +} + +// WithType adds the typeVar to the download move order params +func (o *DownloadMoveOrderParams) WithType(typeVar *string) *DownloadMoveOrderParams { + o.SetType(typeVar) + return o +} + +// SetType adds the type to the download move order params +func (o *DownloadMoveOrderParams) SetType(typeVar *string) { + o.Type = typeVar +} + +// WriteToRequest writes these params to a swagger request +func (o *DownloadMoveOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param locator + if err := r.SetPathParam("locator", o.Locator); err != nil { + return err + } + + if o.Type != nil { + + // query param type + var qrType string + + if o.Type != nil { + qrType = *o.Type + } + qType := qrType + if qType != "" { + + if err := r.SetQueryParam("type", qType); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/download_move_order_responses.go b/pkg/gen/primeclient/move_task_order/download_move_order_responses.go new file mode 100644 index 00000000000..d1e099f4715 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/download_move_order_responses.go @@ -0,0 +1,487 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// DownloadMoveOrderReader is a Reader for the DownloadMoveOrder structure. +type DownloadMoveOrderReader struct { + formats strfmt.Registry + writer io.Writer +} + +// ReadResponse reads a server response into the received o. +func (o *DownloadMoveOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewDownloadMoveOrderOK(o.writer) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDownloadMoveOrderBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDownloadMoveOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDownloadMoveOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDownloadMoveOrderUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDownloadMoveOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /moves/{locator}/documents] downloadMoveOrder", response, response.Code()) + } +} + +// NewDownloadMoveOrderOK creates a DownloadMoveOrderOK with default headers values +func NewDownloadMoveOrderOK(writer io.Writer) *DownloadMoveOrderOK { + return &DownloadMoveOrderOK{ + + Payload: writer, + } +} + +/* +DownloadMoveOrderOK describes a response with status code 200, with default header values. + +Move Order PDF +*/ +type DownloadMoveOrderOK struct { + + /* File name to download + */ + ContentDisposition string + + Payload io.Writer +} + +// IsSuccess returns true when this download move order o k response has a 2xx status code +func (o *DownloadMoveOrderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this download move order o k response has a 3xx status code +func (o *DownloadMoveOrderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order o k response has a 4xx status code +func (o *DownloadMoveOrderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this download move order o k response has a 5xx status code +func (o *DownloadMoveOrderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this download move order o k response a status code equal to that given +func (o *DownloadMoveOrderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the download move order o k response +func (o *DownloadMoveOrderOK) Code() int { + return 200 +} + +func (o *DownloadMoveOrderOK) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderOK %+v", 200, o.Payload) +} + +func (o *DownloadMoveOrderOK) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderOK %+v", 200, o.Payload) +} + +func (o *DownloadMoveOrderOK) GetPayload() io.Writer { + return o.Payload +} + +func (o *DownloadMoveOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // hydrates response header Content-Disposition + hdrContentDisposition := response.GetHeader("Content-Disposition") + + if hdrContentDisposition != "" { + o.ContentDisposition = hdrContentDisposition + } + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadMoveOrderBadRequest creates a DownloadMoveOrderBadRequest with default headers values +func NewDownloadMoveOrderBadRequest() *DownloadMoveOrderBadRequest { + return &DownloadMoveOrderBadRequest{} +} + +/* +DownloadMoveOrderBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type DownloadMoveOrderBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this download move order bad request response has a 2xx status code +func (o *DownloadMoveOrderBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download move order bad request response has a 3xx status code +func (o *DownloadMoveOrderBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order bad request response has a 4xx status code +func (o *DownloadMoveOrderBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this download move order bad request response has a 5xx status code +func (o *DownloadMoveOrderBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this download move order bad request response a status code equal to that given +func (o *DownloadMoveOrderBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the download move order bad request response +func (o *DownloadMoveOrderBadRequest) Code() int { + return 400 +} + +func (o *DownloadMoveOrderBadRequest) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderBadRequest %+v", 400, o.Payload) +} + +func (o *DownloadMoveOrderBadRequest) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderBadRequest %+v", 400, o.Payload) +} + +func (o *DownloadMoveOrderBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DownloadMoveOrderBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadMoveOrderForbidden creates a DownloadMoveOrderForbidden with default headers values +func NewDownloadMoveOrderForbidden() *DownloadMoveOrderForbidden { + return &DownloadMoveOrderForbidden{} +} + +/* +DownloadMoveOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type DownloadMoveOrderForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this download move order forbidden response has a 2xx status code +func (o *DownloadMoveOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download move order forbidden response has a 3xx status code +func (o *DownloadMoveOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order forbidden response has a 4xx status code +func (o *DownloadMoveOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this download move order forbidden response has a 5xx status code +func (o *DownloadMoveOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this download move order forbidden response a status code equal to that given +func (o *DownloadMoveOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the download move order forbidden response +func (o *DownloadMoveOrderForbidden) Code() int { + return 403 +} + +func (o *DownloadMoveOrderForbidden) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderForbidden %+v", 403, o.Payload) +} + +func (o *DownloadMoveOrderForbidden) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderForbidden %+v", 403, o.Payload) +} + +func (o *DownloadMoveOrderForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DownloadMoveOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadMoveOrderNotFound creates a DownloadMoveOrderNotFound with default headers values +func NewDownloadMoveOrderNotFound() *DownloadMoveOrderNotFound { + return &DownloadMoveOrderNotFound{} +} + +/* +DownloadMoveOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type DownloadMoveOrderNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this download move order not found response has a 2xx status code +func (o *DownloadMoveOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download move order not found response has a 3xx status code +func (o *DownloadMoveOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order not found response has a 4xx status code +func (o *DownloadMoveOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this download move order not found response has a 5xx status code +func (o *DownloadMoveOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this download move order not found response a status code equal to that given +func (o *DownloadMoveOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the download move order not found response +func (o *DownloadMoveOrderNotFound) Code() int { + return 404 +} + +func (o *DownloadMoveOrderNotFound) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderNotFound %+v", 404, o.Payload) +} + +func (o *DownloadMoveOrderNotFound) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderNotFound %+v", 404, o.Payload) +} + +func (o *DownloadMoveOrderNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DownloadMoveOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadMoveOrderUnprocessableEntity creates a DownloadMoveOrderUnprocessableEntity with default headers values +func NewDownloadMoveOrderUnprocessableEntity() *DownloadMoveOrderUnprocessableEntity { + return &DownloadMoveOrderUnprocessableEntity{} +} + +/* +DownloadMoveOrderUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type DownloadMoveOrderUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this download move order unprocessable entity response has a 2xx status code +func (o *DownloadMoveOrderUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download move order unprocessable entity response has a 3xx status code +func (o *DownloadMoveOrderUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order unprocessable entity response has a 4xx status code +func (o *DownloadMoveOrderUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this download move order unprocessable entity response has a 5xx status code +func (o *DownloadMoveOrderUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this download move order unprocessable entity response a status code equal to that given +func (o *DownloadMoveOrderUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the download move order unprocessable entity response +func (o *DownloadMoveOrderUnprocessableEntity) Code() int { + return 422 +} + +func (o *DownloadMoveOrderUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DownloadMoveOrderUnprocessableEntity) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DownloadMoveOrderUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *DownloadMoveOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDownloadMoveOrderInternalServerError creates a DownloadMoveOrderInternalServerError with default headers values +func NewDownloadMoveOrderInternalServerError() *DownloadMoveOrderInternalServerError { + return &DownloadMoveOrderInternalServerError{} +} + +/* +DownloadMoveOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type DownloadMoveOrderInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this download move order internal server error response has a 2xx status code +func (o *DownloadMoveOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this download move order internal server error response has a 3xx status code +func (o *DownloadMoveOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this download move order internal server error response has a 4xx status code +func (o *DownloadMoveOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this download move order internal server error response has a 5xx status code +func (o *DownloadMoveOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this download move order internal server error response a status code equal to that given +func (o *DownloadMoveOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the download move order internal server error response +func (o *DownloadMoveOrderInternalServerError) Code() int { + return 500 +} + +func (o *DownloadMoveOrderInternalServerError) Error() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *DownloadMoveOrderInternalServerError) String() string { + return fmt.Sprintf("[GET /moves/{locator}/documents][%d] downloadMoveOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *DownloadMoveOrderInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *DownloadMoveOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..e6dea099e1e --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object +// with the ability to set a timeout on a request. +func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: timeout, + } +} + +// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object +// with the ability to set a context for a request. +func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + Context: ctx, + } +} + +// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + HTTPClient: client, + } +} + +/* +GetMoveTaskOrderParams contains all the parameters to send to the API endpoint + + for the get move task order operation. + + Typically these are written to a http.Request. +*/ +type GetMoveTaskOrderParams struct { + + /* MoveID. + + UUID or MoveCode of move task order to use. + */ + MoveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMoveID adds the moveID to the get move task order params +func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { + o.SetMoveID(moveID) + return o +} + +// SetMoveID adds the moveId to the get move task order params +func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { + o.MoveID = moveID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param moveID + if err := r.SetPathParam("moveID", o.MoveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go b/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..9c305610df2 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. +type GetMoveTaskOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMoveTaskOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMoveTaskOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMoveTaskOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMoveTaskOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMoveTaskOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) + } +} + +// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + return &GetMoveTaskOrderOK{} +} + +/* +GetMoveTaskOrderOK describes a response with status code 200, with default header values. + +Successfully retrieve an individual move task order. +*/ +type GetMoveTaskOrderOK struct { + Payload *primemessages.MoveTaskOrder +} + +// IsSuccess returns true when this get move task order o k response has a 2xx status code +func (o *GetMoveTaskOrderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get move task order o k response has a 3xx status code +func (o *GetMoveTaskOrderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order o k response has a 4xx status code +func (o *GetMoveTaskOrderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order o k response has a 5xx status code +func (o *GetMoveTaskOrderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order o k response a status code equal to that given +func (o *GetMoveTaskOrderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get move task order o k response +func (o *GetMoveTaskOrderOK) Code() int { + return 200 +} + +func (o *GetMoveTaskOrderOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) GetPayload() *primemessages.MoveTaskOrder { + return o.Payload +} + +func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + return &GetMoveTaskOrderUnauthorized{} +} + +/* +GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code +func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code +func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order unauthorized response has a 4xx status code +func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order unauthorized response has a 5xx status code +func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order unauthorized response a status code equal to that given +func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) Code() int { + return 401 +} + +func (o *GetMoveTaskOrderUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + return &GetMoveTaskOrderForbidden{} +} + +/* +GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this get move task order forbidden response has a 2xx status code +func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order forbidden response has a 3xx status code +func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order forbidden response has a 4xx status code +func (o *GetMoveTaskOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order forbidden response has a 5xx status code +func (o *GetMoveTaskOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order forbidden response a status code equal to that given +func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) Code() int { + return 403 +} + +func (o *GetMoveTaskOrderForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + return &GetMoveTaskOrderNotFound{} +} + +/* +GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type GetMoveTaskOrderNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this get move task order not found response has a 2xx status code +func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order not found response has a 3xx status code +func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order not found response has a 4xx status code +func (o *GetMoveTaskOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order not found response has a 5xx status code +func (o *GetMoveTaskOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order not found response a status code equal to that given +func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get move task order not found response +func (o *GetMoveTaskOrderNotFound) Code() int { + return 404 +} + +func (o *GetMoveTaskOrderNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + return &GetMoveTaskOrderInternalServerError{} +} + +/* +GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type GetMoveTaskOrderInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this get move task order internal server error response has a 2xx status code +func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order internal server error response has a 3xx status code +func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order internal server error response has a 4xx status code +func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order internal server error response has a 5xx status code +func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get move task order internal server error response a status code equal to that given +func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) Code() int { + return 500 +} + +func (o *GetMoveTaskOrderInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/list_moves_parameters.go b/pkg/gen/primeclient/move_task_order/list_moves_parameters.go new file mode 100644 index 00000000000..3a2cad3aaec --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/list_moves_parameters.go @@ -0,0 +1,165 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListMovesParams creates a new ListMovesParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListMovesParams() *ListMovesParams { + return &ListMovesParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListMovesParamsWithTimeout creates a new ListMovesParams object +// with the ability to set a timeout on a request. +func NewListMovesParamsWithTimeout(timeout time.Duration) *ListMovesParams { + return &ListMovesParams{ + timeout: timeout, + } +} + +// NewListMovesParamsWithContext creates a new ListMovesParams object +// with the ability to set a context for a request. +func NewListMovesParamsWithContext(ctx context.Context) *ListMovesParams { + return &ListMovesParams{ + Context: ctx, + } +} + +// NewListMovesParamsWithHTTPClient creates a new ListMovesParams object +// with the ability to set a custom HTTPClient for a request. +func NewListMovesParamsWithHTTPClient(client *http.Client) *ListMovesParams { + return &ListMovesParams{ + HTTPClient: client, + } +} + +/* +ListMovesParams contains all the parameters to send to the API endpoint + + for the list moves operation. + + Typically these are written to a http.Request. +*/ +type ListMovesParams struct { + + /* Since. + + Only return moves updated since this time. Formatted like "2021-07-23T18:30:47.116Z" + + Format: date-time + */ + Since *strfmt.DateTime + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list moves params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMovesParams) WithDefaults() *ListMovesParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list moves params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMovesParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list moves params +func (o *ListMovesParams) WithTimeout(timeout time.Duration) *ListMovesParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list moves params +func (o *ListMovesParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list moves params +func (o *ListMovesParams) WithContext(ctx context.Context) *ListMovesParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list moves params +func (o *ListMovesParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list moves params +func (o *ListMovesParams) WithHTTPClient(client *http.Client) *ListMovesParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list moves params +func (o *ListMovesParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSince adds the since to the list moves params +func (o *ListMovesParams) WithSince(since *strfmt.DateTime) *ListMovesParams { + o.SetSince(since) + return o +} + +// SetSince adds the since to the list moves params +func (o *ListMovesParams) SetSince(since *strfmt.DateTime) { + o.Since = since +} + +// WriteToRequest writes these params to a swagger request +func (o *ListMovesParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Since != nil { + + // query param since + var qrSince strfmt.DateTime + + if o.Since != nil { + qrSince = *o.Since + } + qSince := qrSince.String() + if qSince != "" { + + if err := r.SetQueryParam("since", qSince); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/list_moves_responses.go b/pkg/gen/primeclient/move_task_order/list_moves_responses.go new file mode 100644 index 00000000000..3169c90996a --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/list_moves_responses.go @@ -0,0 +1,323 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// ListMovesReader is a Reader for the ListMoves structure. +type ListMovesReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListMovesReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListMovesOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewListMovesUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewListMovesForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewListMovesInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /moves] listMoves", response, response.Code()) + } +} + +// NewListMovesOK creates a ListMovesOK with default headers values +func NewListMovesOK() *ListMovesOK { + return &ListMovesOK{} +} + +/* +ListMovesOK describes a response with status code 200, with default header values. + +Successfully retrieved moves. A successful fetch might still return zero moves. +*/ +type ListMovesOK struct { + Payload primemessages.ListMoves +} + +// IsSuccess returns true when this list moves o k response has a 2xx status code +func (o *ListMovesOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list moves o k response has a 3xx status code +func (o *ListMovesOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list moves o k response has a 4xx status code +func (o *ListMovesOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list moves o k response has a 5xx status code +func (o *ListMovesOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list moves o k response a status code equal to that given +func (o *ListMovesOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list moves o k response +func (o *ListMovesOK) Code() int { + return 200 +} + +func (o *ListMovesOK) Error() string { + return fmt.Sprintf("[GET /moves][%d] listMovesOK %+v", 200, o.Payload) +} + +func (o *ListMovesOK) String() string { + return fmt.Sprintf("[GET /moves][%d] listMovesOK %+v", 200, o.Payload) +} + +func (o *ListMovesOK) GetPayload() primemessages.ListMoves { + return o.Payload +} + +func (o *ListMovesOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMovesUnauthorized creates a ListMovesUnauthorized with default headers values +func NewListMovesUnauthorized() *ListMovesUnauthorized { + return &ListMovesUnauthorized{} +} + +/* +ListMovesUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type ListMovesUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this list moves unauthorized response has a 2xx status code +func (o *ListMovesUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list moves unauthorized response has a 3xx status code +func (o *ListMovesUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list moves unauthorized response has a 4xx status code +func (o *ListMovesUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this list moves unauthorized response has a 5xx status code +func (o *ListMovesUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this list moves unauthorized response a status code equal to that given +func (o *ListMovesUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the list moves unauthorized response +func (o *ListMovesUnauthorized) Code() int { + return 401 +} + +func (o *ListMovesUnauthorized) Error() string { + return fmt.Sprintf("[GET /moves][%d] listMovesUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMovesUnauthorized) String() string { + return fmt.Sprintf("[GET /moves][%d] listMovesUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMovesUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *ListMovesUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMovesForbidden creates a ListMovesForbidden with default headers values +func NewListMovesForbidden() *ListMovesForbidden { + return &ListMovesForbidden{} +} + +/* +ListMovesForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type ListMovesForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this list moves forbidden response has a 2xx status code +func (o *ListMovesForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list moves forbidden response has a 3xx status code +func (o *ListMovesForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list moves forbidden response has a 4xx status code +func (o *ListMovesForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this list moves forbidden response has a 5xx status code +func (o *ListMovesForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this list moves forbidden response a status code equal to that given +func (o *ListMovesForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the list moves forbidden response +func (o *ListMovesForbidden) Code() int { + return 403 +} + +func (o *ListMovesForbidden) Error() string { + return fmt.Sprintf("[GET /moves][%d] listMovesForbidden %+v", 403, o.Payload) +} + +func (o *ListMovesForbidden) String() string { + return fmt.Sprintf("[GET /moves][%d] listMovesForbidden %+v", 403, o.Payload) +} + +func (o *ListMovesForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *ListMovesForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMovesInternalServerError creates a ListMovesInternalServerError with default headers values +func NewListMovesInternalServerError() *ListMovesInternalServerError { + return &ListMovesInternalServerError{} +} + +/* +ListMovesInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type ListMovesInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this list moves internal server error response has a 2xx status code +func (o *ListMovesInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list moves internal server error response has a 3xx status code +func (o *ListMovesInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list moves internal server error response has a 4xx status code +func (o *ListMovesInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list moves internal server error response has a 5xx status code +func (o *ListMovesInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list moves internal server error response a status code equal to that given +func (o *ListMovesInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list moves internal server error response +func (o *ListMovesInternalServerError) Code() int { + return 500 +} + +func (o *ListMovesInternalServerError) Error() string { + return fmt.Sprintf("[GET /moves][%d] listMovesInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMovesInternalServerError) String() string { + return fmt.Sprintf("[GET /moves][%d] listMovesInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMovesInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *ListMovesInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/move_task_order_client.go b/pkg/gen/primeclient/move_task_order/move_task_order_client.go new file mode 100644 index 00000000000..b1d0d6c8a1b --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/move_task_order_client.go @@ -0,0 +1,275 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" +) + +// New creates a new move task order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for move task order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateExcessWeightRecord(params *CreateExcessWeightRecordParams, opts ...ClientOption) (*CreateExcessWeightRecordCreated, error) + + DownloadMoveOrder(params *DownloadMoveOrderParams, writer io.Writer, opts ...ClientOption) (*DownloadMoveOrderOK, error) + + GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) + + ListMoves(params *ListMovesParams, opts ...ClientOption) (*ListMovesOK, error) + + UpdateMTOPostCounselingInformation(params *UpdateMTOPostCounselingInformationParams, opts ...ClientOption) (*UpdateMTOPostCounselingInformationOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CreateExcessWeightRecord creates excess weight record + +Uploads an excess weight record, which is a document that proves that the movers or contractors have counseled the customer about their excess weight. Excess weight counseling should occur after the sum of the shipments for the customer's move crosses the excess weight alert threshold. +*/ +func (a *Client) CreateExcessWeightRecord(params *CreateExcessWeightRecordParams, opts ...ClientOption) (*CreateExcessWeightRecordCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateExcessWeightRecordParams() + } + op := &runtime.ClientOperation{ + ID: "createExcessWeightRecord", + Method: "POST", + PathPattern: "/move-task-orders/{moveTaskOrderID}/excess-weight-record", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateExcessWeightRecordReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateExcessWeightRecordCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createExcessWeightRecord: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DownloadMoveOrder downloads move order as a p d f + + ### Functionality + +This endpoint downloads all uploaded move order documentations into one download file by locator. + +### Errors +* The move must be in need counseling state. +* The move client's origin duty location must not currently have gov counseling. +*/ +func (a *Client) DownloadMoveOrder(params *DownloadMoveOrderParams, writer io.Writer, opts ...ClientOption) (*DownloadMoveOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDownloadMoveOrderParams() + } + op := &runtime.ClientOperation{ + ID: "downloadMoveOrder", + Method: "GET", + PathPattern: "/moves/{locator}/documents", + ProducesMediaTypes: []string{"application/pdf"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DownloadMoveOrderReader{formats: a.formats, writer: writer}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DownloadMoveOrderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for downloadMoveOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetMoveTaskOrder gets move task order + + ### Functionality + +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMoveTaskOrderParams() + } + op := &runtime.ClientOperation{ + ID: "getMoveTaskOrder", + Method: "GET", + PathPattern: "/move-task-orders/{moveID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMoveTaskOrderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetMoveTaskOrderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListMoves lists moves + + Gets all moves that have been reviewed and approved by the TOO. The `since` parameter can be used to filter this + +list down to only the moves that have been updated since the provided timestamp. A move will be considered +updated if the `updatedAt` timestamp on the move or on its orders, shipments, service items, or payment +requests, is later than the provided date and time. + +**WIP**: Include what causes moves to leave this list. Currently, once the `availableToPrimeAt` timestamp has +been set, that move will always appear in this list. +*/ +func (a *Client) ListMoves(params *ListMovesParams, opts ...ClientOption) (*ListMovesOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListMovesParams() + } + op := &runtime.ClientOperation{ + ID: "listMoves", + Method: "GET", + PathPattern: "/moves", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListMovesReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListMovesOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listMoves: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOPostCounselingInformation updates m t o post counseling information + + ### Functionality + +This endpoint **updates** the MoveTaskOrder to indicate that the Prime has completed Counseling. +This update uses the moveTaskOrderID provided in the path, updates the move status and marks child elements of the move to indicate the update. +No body object is expected for this request. + +**For Full/Partial PPMs**: This action is required so that the customer can start uploading their proof of service docs. + +**For other move types**: This action is required for auditing reasons so that we have a record of when the Prime counseled the customer. +*/ +func (a *Client) UpdateMTOPostCounselingInformation(params *UpdateMTOPostCounselingInformationParams, opts ...ClientOption) (*UpdateMTOPostCounselingInformationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOPostCounselingInformationParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOPostCounselingInformation", + Method: "PATCH", + PathPattern: "/move-task-orders/{moveTaskOrderID}/post-counseling-info", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOPostCounselingInformationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOPostCounselingInformationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOPostCounselingInformation: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go new file mode 100644 index 00000000000..4f3b94a8bf4 --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateMTOPostCounselingInformationParams creates a new UpdateMTOPostCounselingInformationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOPostCounselingInformationParams() *UpdateMTOPostCounselingInformationParams { + return &UpdateMTOPostCounselingInformationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOPostCounselingInformationParamsWithTimeout creates a new UpdateMTOPostCounselingInformationParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOPostCounselingInformationParamsWithTimeout(timeout time.Duration) *UpdateMTOPostCounselingInformationParams { + return &UpdateMTOPostCounselingInformationParams{ + timeout: timeout, + } +} + +// NewUpdateMTOPostCounselingInformationParamsWithContext creates a new UpdateMTOPostCounselingInformationParams object +// with the ability to set a context for a request. +func NewUpdateMTOPostCounselingInformationParamsWithContext(ctx context.Context) *UpdateMTOPostCounselingInformationParams { + return &UpdateMTOPostCounselingInformationParams{ + Context: ctx, + } +} + +// NewUpdateMTOPostCounselingInformationParamsWithHTTPClient creates a new UpdateMTOPostCounselingInformationParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOPostCounselingInformationParamsWithHTTPClient(client *http.Client) *UpdateMTOPostCounselingInformationParams { + return &UpdateMTOPostCounselingInformationParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOPostCounselingInformationParams contains all the parameters to send to the API endpoint + + for the update m t o post counseling information operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOPostCounselingInformationParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + /* MoveTaskOrderID. + + ID of move task order to use. + */ + MoveTaskOrderID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o post counseling information params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOPostCounselingInformationParams) WithDefaults() *UpdateMTOPostCounselingInformationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o post counseling information params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOPostCounselingInformationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) WithTimeout(timeout time.Duration) *UpdateMTOPostCounselingInformationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) WithContext(ctx context.Context) *UpdateMTOPostCounselingInformationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) WithHTTPClient(client *http.Client) *UpdateMTOPostCounselingInformationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) WithIfMatch(ifMatch string) *UpdateMTOPostCounselingInformationParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithMoveTaskOrderID adds the moveTaskOrderID to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) WithMoveTaskOrderID(moveTaskOrderID string) *UpdateMTOPostCounselingInformationParams { + o.SetMoveTaskOrderID(moveTaskOrderID) + return o +} + +// SetMoveTaskOrderID adds the moveTaskOrderId to the update m t o post counseling information params +func (o *UpdateMTOPostCounselingInformationParams) SetMoveTaskOrderID(moveTaskOrderID string) { + o.MoveTaskOrderID = moveTaskOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOPostCounselingInformationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + + // path param moveTaskOrderID + if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go new file mode 100644 index 00000000000..400317d24eb --- /dev/null +++ b/pkg/gen/primeclient/move_task_order/update_m_t_o_post_counseling_information_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOPostCounselingInformationReader is a Reader for the UpdateMTOPostCounselingInformation structure. +type UpdateMTOPostCounselingInformationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOPostCounselingInformationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOPostCounselingInformationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewUpdateMTOPostCounselingInformationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOPostCounselingInformationForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOPostCounselingInformationNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOPostCounselingInformationConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOPostCounselingInformationPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOPostCounselingInformationUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOPostCounselingInformationInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info] updateMTOPostCounselingInformation", response, response.Code()) + } +} + +// NewUpdateMTOPostCounselingInformationOK creates a UpdateMTOPostCounselingInformationOK with default headers values +func NewUpdateMTOPostCounselingInformationOK() *UpdateMTOPostCounselingInformationOK { + return &UpdateMTOPostCounselingInformationOK{} +} + +/* +UpdateMTOPostCounselingInformationOK describes a response with status code 200, with default header values. + +Successfully updated move task order with post counseling information. +*/ +type UpdateMTOPostCounselingInformationOK struct { + Payload *primemessages.MoveTaskOrder +} + +// IsSuccess returns true when this update m t o post counseling information o k response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o post counseling information o k response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information o k response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o post counseling information o k response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information o k response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o post counseling information o k response +func (o *UpdateMTOPostCounselingInformationOK) Code() int { + return 200 +} + +func (o *UpdateMTOPostCounselingInformationOK) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationOK) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationOK) GetPayload() *primemessages.MoveTaskOrder { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationUnauthorized creates a UpdateMTOPostCounselingInformationUnauthorized with default headers values +func NewUpdateMTOPostCounselingInformationUnauthorized() *UpdateMTOPostCounselingInformationUnauthorized { + return &UpdateMTOPostCounselingInformationUnauthorized{} +} + +/* +UpdateMTOPostCounselingInformationUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOPostCounselingInformationUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o post counseling information unauthorized response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information unauthorized response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information unauthorized response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information unauthorized response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information unauthorized response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o post counseling information unauthorized response +func (o *UpdateMTOPostCounselingInformationUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOPostCounselingInformationUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationUnauthorized) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationForbidden creates a UpdateMTOPostCounselingInformationForbidden with default headers values +func NewUpdateMTOPostCounselingInformationForbidden() *UpdateMTOPostCounselingInformationForbidden { + return &UpdateMTOPostCounselingInformationForbidden{} +} + +/* +UpdateMTOPostCounselingInformationForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOPostCounselingInformationForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o post counseling information forbidden response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information forbidden response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information forbidden response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information forbidden response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information forbidden response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o post counseling information forbidden response +func (o *UpdateMTOPostCounselingInformationForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOPostCounselingInformationForbidden) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationForbidden) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationNotFound creates a UpdateMTOPostCounselingInformationNotFound with default headers values +func NewUpdateMTOPostCounselingInformationNotFound() *UpdateMTOPostCounselingInformationNotFound { + return &UpdateMTOPostCounselingInformationNotFound{} +} + +/* +UpdateMTOPostCounselingInformationNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOPostCounselingInformationNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o post counseling information not found response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information not found response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information not found response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information not found response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information not found response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o post counseling information not found response +func (o *UpdateMTOPostCounselingInformationNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOPostCounselingInformationNotFound) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationNotFound) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationConflict creates a UpdateMTOPostCounselingInformationConflict with default headers values +func NewUpdateMTOPostCounselingInformationConflict() *UpdateMTOPostCounselingInformationConflict { + return &UpdateMTOPostCounselingInformationConflict{} +} + +/* +UpdateMTOPostCounselingInformationConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateMTOPostCounselingInformationConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o post counseling information conflict response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information conflict response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information conflict response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information conflict response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information conflict response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o post counseling information conflict response +func (o *UpdateMTOPostCounselingInformationConflict) Code() int { + return 409 +} + +func (o *UpdateMTOPostCounselingInformationConflict) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationConflict) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationPreconditionFailed creates a UpdateMTOPostCounselingInformationPreconditionFailed with default headers values +func NewUpdateMTOPostCounselingInformationPreconditionFailed() *UpdateMTOPostCounselingInformationPreconditionFailed { + return &UpdateMTOPostCounselingInformationPreconditionFailed{} +} + +/* +UpdateMTOPostCounselingInformationPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOPostCounselingInformationPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o post counseling information precondition failed response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information precondition failed response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information precondition failed response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information precondition failed response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information precondition failed response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o post counseling information precondition failed response +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationUnprocessableEntity creates a UpdateMTOPostCounselingInformationUnprocessableEntity with default headers values +func NewUpdateMTOPostCounselingInformationUnprocessableEntity() *UpdateMTOPostCounselingInformationUnprocessableEntity { + return &UpdateMTOPostCounselingInformationUnprocessableEntity{} +} + +/* +UpdateMTOPostCounselingInformationUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOPostCounselingInformationUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update m t o post counseling information unprocessable entity response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information unprocessable entity response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information unprocessable entity response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o post counseling information unprocessable entity response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o post counseling information unprocessable entity response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o post counseling information unprocessable entity response +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOPostCounselingInformationInternalServerError creates a UpdateMTOPostCounselingInformationInternalServerError with default headers values +func NewUpdateMTOPostCounselingInformationInternalServerError() *UpdateMTOPostCounselingInformationInternalServerError { + return &UpdateMTOPostCounselingInformationInternalServerError{} +} + +/* +UpdateMTOPostCounselingInformationInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOPostCounselingInformationInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update m t o post counseling information internal server error response has a 2xx status code +func (o *UpdateMTOPostCounselingInformationInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o post counseling information internal server error response has a 3xx status code +func (o *UpdateMTOPostCounselingInformationInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o post counseling information internal server error response has a 4xx status code +func (o *UpdateMTOPostCounselingInformationInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o post counseling information internal server error response has a 5xx status code +func (o *UpdateMTOPostCounselingInformationInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o post counseling information internal server error response a status code equal to that given +func (o *UpdateMTOPostCounselingInformationInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o post counseling information internal server error response +func (o *UpdateMTOPostCounselingInformationInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOPostCounselingInformationInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationInternalServerError) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/post-counseling-info][%d] updateMTOPostCounselingInformationInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOPostCounselingInformationInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateMTOPostCounselingInformationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go new file mode 100644 index 00000000000..506f1266c00 --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_parameters.go @@ -0,0 +1,148 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateMTOServiceItemParams creates a new CreateMTOServiceItemParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMTOServiceItemParams() *CreateMTOServiceItemParams { + return &CreateMTOServiceItemParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMTOServiceItemParamsWithTimeout creates a new CreateMTOServiceItemParams object +// with the ability to set a timeout on a request. +func NewCreateMTOServiceItemParamsWithTimeout(timeout time.Duration) *CreateMTOServiceItemParams { + return &CreateMTOServiceItemParams{ + timeout: timeout, + } +} + +// NewCreateMTOServiceItemParamsWithContext creates a new CreateMTOServiceItemParams object +// with the ability to set a context for a request. +func NewCreateMTOServiceItemParamsWithContext(ctx context.Context) *CreateMTOServiceItemParams { + return &CreateMTOServiceItemParams{ + Context: ctx, + } +} + +// NewCreateMTOServiceItemParamsWithHTTPClient creates a new CreateMTOServiceItemParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMTOServiceItemParamsWithHTTPClient(client *http.Client) *CreateMTOServiceItemParams { + return &CreateMTOServiceItemParams{ + HTTPClient: client, + } +} + +/* +CreateMTOServiceItemParams contains all the parameters to send to the API endpoint + + for the create m t o service item operation. + + Typically these are written to a http.Request. +*/ +type CreateMTOServiceItemParams struct { + + // Body. + Body primemessages.MTOServiceItem + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create m t o service item params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOServiceItemParams) WithDefaults() *CreateMTOServiceItemParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create m t o service item params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOServiceItemParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create m t o service item params +func (o *CreateMTOServiceItemParams) WithTimeout(timeout time.Duration) *CreateMTOServiceItemParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create m t o service item params +func (o *CreateMTOServiceItemParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create m t o service item params +func (o *CreateMTOServiceItemParams) WithContext(ctx context.Context) *CreateMTOServiceItemParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create m t o service item params +func (o *CreateMTOServiceItemParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create m t o service item params +func (o *CreateMTOServiceItemParams) WithHTTPClient(client *http.Client) *CreateMTOServiceItemParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create m t o service item params +func (o *CreateMTOServiceItemParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create m t o service item params +func (o *CreateMTOServiceItemParams) WithBody(body primemessages.MTOServiceItem) *CreateMTOServiceItemParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create m t o service item params +func (o *CreateMTOServiceItemParams) SetBody(body primemessages.MTOServiceItem) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMTOServiceItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go new file mode 100644 index 00000000000..e8752fe9b90 --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/create_m_t_o_service_item_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateMTOServiceItemReader is a Reader for the CreateMTOServiceItem structure. +type CreateMTOServiceItemReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMTOServiceItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateMTOServiceItemOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateMTOServiceItemBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateMTOServiceItemUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateMTOServiceItemForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateMTOServiceItemNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateMTOServiceItemConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateMTOServiceItemUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateMTOServiceItemInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-service-items] createMTOServiceItem", response, response.Code()) + } +} + +// NewCreateMTOServiceItemOK creates a CreateMTOServiceItemOK with default headers values +func NewCreateMTOServiceItemOK() *CreateMTOServiceItemOK { + return &CreateMTOServiceItemOK{} +} + +/* +CreateMTOServiceItemOK describes a response with status code 200, with default header values. + +Successfully created an MTO service item. +*/ +type CreateMTOServiceItemOK struct { + Payload []primemessages.MTOServiceItem +} + +// IsSuccess returns true when this create m t o service item o k response has a 2xx status code +func (o *CreateMTOServiceItemOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create m t o service item o k response has a 3xx status code +func (o *CreateMTOServiceItemOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item o k response has a 4xx status code +func (o *CreateMTOServiceItemOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o service item o k response has a 5xx status code +func (o *CreateMTOServiceItemOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item o k response a status code equal to that given +func (o *CreateMTOServiceItemOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create m t o service item o k response +func (o *CreateMTOServiceItemOK) Code() int { + return 200 +} + +func (o *CreateMTOServiceItemOK) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemOK %+v", 200, o.Payload) +} + +func (o *CreateMTOServiceItemOK) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemOK %+v", 200, o.Payload) +} + +func (o *CreateMTOServiceItemOK) GetPayload() []primemessages.MTOServiceItem { + return o.Payload +} + +func (o *CreateMTOServiceItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload as interface type + payload, err := primemessages.UnmarshalMTOServiceItemSlice(response.Body(), consumer) + if err != nil { + return err + } + o.Payload = payload + + return nil +} + +// NewCreateMTOServiceItemBadRequest creates a CreateMTOServiceItemBadRequest with default headers values +func NewCreateMTOServiceItemBadRequest() *CreateMTOServiceItemBadRequest { + return &CreateMTOServiceItemBadRequest{} +} + +/* +CreateMTOServiceItemBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateMTOServiceItemBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o service item bad request response has a 2xx status code +func (o *CreateMTOServiceItemBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item bad request response has a 3xx status code +func (o *CreateMTOServiceItemBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item bad request response has a 4xx status code +func (o *CreateMTOServiceItemBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item bad request response has a 5xx status code +func (o *CreateMTOServiceItemBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item bad request response a status code equal to that given +func (o *CreateMTOServiceItemBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create m t o service item bad request response +func (o *CreateMTOServiceItemBadRequest) Code() int { + return 400 +} + +func (o *CreateMTOServiceItemBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOServiceItemBadRequest) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOServiceItemBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOServiceItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemUnauthorized creates a CreateMTOServiceItemUnauthorized with default headers values +func NewCreateMTOServiceItemUnauthorized() *CreateMTOServiceItemUnauthorized { + return &CreateMTOServiceItemUnauthorized{} +} + +/* +CreateMTOServiceItemUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateMTOServiceItemUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o service item unauthorized response has a 2xx status code +func (o *CreateMTOServiceItemUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item unauthorized response has a 3xx status code +func (o *CreateMTOServiceItemUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item unauthorized response has a 4xx status code +func (o *CreateMTOServiceItemUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item unauthorized response has a 5xx status code +func (o *CreateMTOServiceItemUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item unauthorized response a status code equal to that given +func (o *CreateMTOServiceItemUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create m t o service item unauthorized response +func (o *CreateMTOServiceItemUnauthorized) Code() int { + return 401 +} + +func (o *CreateMTOServiceItemUnauthorized) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMTOServiceItemUnauthorized) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMTOServiceItemUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOServiceItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemForbidden creates a CreateMTOServiceItemForbidden with default headers values +func NewCreateMTOServiceItemForbidden() *CreateMTOServiceItemForbidden { + return &CreateMTOServiceItemForbidden{} +} + +/* +CreateMTOServiceItemForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateMTOServiceItemForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o service item forbidden response has a 2xx status code +func (o *CreateMTOServiceItemForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item forbidden response has a 3xx status code +func (o *CreateMTOServiceItemForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item forbidden response has a 4xx status code +func (o *CreateMTOServiceItemForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item forbidden response has a 5xx status code +func (o *CreateMTOServiceItemForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item forbidden response a status code equal to that given +func (o *CreateMTOServiceItemForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create m t o service item forbidden response +func (o *CreateMTOServiceItemForbidden) Code() int { + return 403 +} + +func (o *CreateMTOServiceItemForbidden) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemForbidden %+v", 403, o.Payload) +} + +func (o *CreateMTOServiceItemForbidden) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemForbidden %+v", 403, o.Payload) +} + +func (o *CreateMTOServiceItemForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOServiceItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemNotFound creates a CreateMTOServiceItemNotFound with default headers values +func NewCreateMTOServiceItemNotFound() *CreateMTOServiceItemNotFound { + return &CreateMTOServiceItemNotFound{} +} + +/* +CreateMTOServiceItemNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateMTOServiceItemNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o service item not found response has a 2xx status code +func (o *CreateMTOServiceItemNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item not found response has a 3xx status code +func (o *CreateMTOServiceItemNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item not found response has a 4xx status code +func (o *CreateMTOServiceItemNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item not found response has a 5xx status code +func (o *CreateMTOServiceItemNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item not found response a status code equal to that given +func (o *CreateMTOServiceItemNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create m t o service item not found response +func (o *CreateMTOServiceItemNotFound) Code() int { + return 404 +} + +func (o *CreateMTOServiceItemNotFound) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOServiceItemNotFound) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOServiceItemNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOServiceItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemConflict creates a CreateMTOServiceItemConflict with default headers values +func NewCreateMTOServiceItemConflict() *CreateMTOServiceItemConflict { + return &CreateMTOServiceItemConflict{} +} + +/* +CreateMTOServiceItemConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type CreateMTOServiceItemConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o service item conflict response has a 2xx status code +func (o *CreateMTOServiceItemConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item conflict response has a 3xx status code +func (o *CreateMTOServiceItemConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item conflict response has a 4xx status code +func (o *CreateMTOServiceItemConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item conflict response has a 5xx status code +func (o *CreateMTOServiceItemConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item conflict response a status code equal to that given +func (o *CreateMTOServiceItemConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create m t o service item conflict response +func (o *CreateMTOServiceItemConflict) Code() int { + return 409 +} + +func (o *CreateMTOServiceItemConflict) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemConflict %+v", 409, o.Payload) +} + +func (o *CreateMTOServiceItemConflict) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemConflict %+v", 409, o.Payload) +} + +func (o *CreateMTOServiceItemConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOServiceItemConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemUnprocessableEntity creates a CreateMTOServiceItemUnprocessableEntity with default headers values +func NewCreateMTOServiceItemUnprocessableEntity() *CreateMTOServiceItemUnprocessableEntity { + return &CreateMTOServiceItemUnprocessableEntity{} +} + +/* +CreateMTOServiceItemUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateMTOServiceItemUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create m t o service item unprocessable entity response has a 2xx status code +func (o *CreateMTOServiceItemUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item unprocessable entity response has a 3xx status code +func (o *CreateMTOServiceItemUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item unprocessable entity response has a 4xx status code +func (o *CreateMTOServiceItemUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o service item unprocessable entity response has a 5xx status code +func (o *CreateMTOServiceItemUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o service item unprocessable entity response a status code equal to that given +func (o *CreateMTOServiceItemUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create m t o service item unprocessable entity response +func (o *CreateMTOServiceItemUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateMTOServiceItemUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOServiceItemUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOServiceItemUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateMTOServiceItemUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOServiceItemInternalServerError creates a CreateMTOServiceItemInternalServerError with default headers values +func NewCreateMTOServiceItemInternalServerError() *CreateMTOServiceItemInternalServerError { + return &CreateMTOServiceItemInternalServerError{} +} + +/* +CreateMTOServiceItemInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateMTOServiceItemInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create m t o service item internal server error response has a 2xx status code +func (o *CreateMTOServiceItemInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o service item internal server error response has a 3xx status code +func (o *CreateMTOServiceItemInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o service item internal server error response has a 4xx status code +func (o *CreateMTOServiceItemInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o service item internal server error response has a 5xx status code +func (o *CreateMTOServiceItemInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create m t o service item internal server error response a status code equal to that given +func (o *CreateMTOServiceItemInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create m t o service item internal server error response +func (o *CreateMTOServiceItemInternalServerError) Code() int { + return 500 +} + +func (o *CreateMTOServiceItemInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOServiceItemInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-service-items][%d] createMTOServiceItemInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOServiceItemInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateMTOServiceItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go new file mode 100644 index 00000000000..28def5694bf --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_parameters.go @@ -0,0 +1,172 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateServiceRequestDocumentUploadParams creates a new CreateServiceRequestDocumentUploadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateServiceRequestDocumentUploadParams() *CreateServiceRequestDocumentUploadParams { + return &CreateServiceRequestDocumentUploadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateServiceRequestDocumentUploadParamsWithTimeout creates a new CreateServiceRequestDocumentUploadParams object +// with the ability to set a timeout on a request. +func NewCreateServiceRequestDocumentUploadParamsWithTimeout(timeout time.Duration) *CreateServiceRequestDocumentUploadParams { + return &CreateServiceRequestDocumentUploadParams{ + timeout: timeout, + } +} + +// NewCreateServiceRequestDocumentUploadParamsWithContext creates a new CreateServiceRequestDocumentUploadParams object +// with the ability to set a context for a request. +func NewCreateServiceRequestDocumentUploadParamsWithContext(ctx context.Context) *CreateServiceRequestDocumentUploadParams { + return &CreateServiceRequestDocumentUploadParams{ + Context: ctx, + } +} + +// NewCreateServiceRequestDocumentUploadParamsWithHTTPClient creates a new CreateServiceRequestDocumentUploadParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateServiceRequestDocumentUploadParamsWithHTTPClient(client *http.Client) *CreateServiceRequestDocumentUploadParams { + return &CreateServiceRequestDocumentUploadParams{ + HTTPClient: client, + } +} + +/* +CreateServiceRequestDocumentUploadParams contains all the parameters to send to the API endpoint + + for the create service request document upload operation. + + Typically these are written to a http.Request. +*/ +type CreateServiceRequestDocumentUploadParams struct { + + /* File. + + The file to upload. + */ + File runtime.NamedReadCloser + + /* MtoServiceItemID. + + UUID of the service item to use. + */ + MtoServiceItemID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create service request document upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceRequestDocumentUploadParams) WithDefaults() *CreateServiceRequestDocumentUploadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create service request document upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateServiceRequestDocumentUploadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) WithTimeout(timeout time.Duration) *CreateServiceRequestDocumentUploadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) WithContext(ctx context.Context) *CreateServiceRequestDocumentUploadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) WithHTTPClient(client *http.Client) *CreateServiceRequestDocumentUploadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFile adds the file to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) WithFile(file runtime.NamedReadCloser) *CreateServiceRequestDocumentUploadParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) SetFile(file runtime.NamedReadCloser) { + o.File = file +} + +// WithMtoServiceItemID adds the mtoServiceItemID to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) WithMtoServiceItemID(mtoServiceItemID string) *CreateServiceRequestDocumentUploadParams { + o.SetMtoServiceItemID(mtoServiceItemID) + return o +} + +// SetMtoServiceItemID adds the mtoServiceItemId to the create service request document upload params +func (o *CreateServiceRequestDocumentUploadParams) SetMtoServiceItemID(mtoServiceItemID string) { + o.MtoServiceItemID = mtoServiceItemID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateServiceRequestDocumentUploadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + // form file param file + if err := r.SetFileParam("file", o.File); err != nil { + return err + } + + // path param mtoServiceItemID + if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go new file mode 100644 index 00000000000..01110093943 --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/create_service_request_document_upload_responses.go @@ -0,0 +1,547 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateServiceRequestDocumentUploadReader is a Reader for the CreateServiceRequestDocumentUpload structure. +type CreateServiceRequestDocumentUploadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateServiceRequestDocumentUploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateServiceRequestDocumentUploadCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateServiceRequestDocumentUploadBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateServiceRequestDocumentUploadUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateServiceRequestDocumentUploadForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateServiceRequestDocumentUploadNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateServiceRequestDocumentUploadUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateServiceRequestDocumentUploadInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-service-items/{mtoServiceItemID}/uploads] createServiceRequestDocumentUpload", response, response.Code()) + } +} + +// NewCreateServiceRequestDocumentUploadCreated creates a CreateServiceRequestDocumentUploadCreated with default headers values +func NewCreateServiceRequestDocumentUploadCreated() *CreateServiceRequestDocumentUploadCreated { + return &CreateServiceRequestDocumentUploadCreated{} +} + +/* +CreateServiceRequestDocumentUploadCreated describes a response with status code 201, with default header values. + +Successfully created upload of digital file. +*/ +type CreateServiceRequestDocumentUploadCreated struct { + Payload *primemessages.UploadWithOmissions +} + +// IsSuccess returns true when this create service request document upload created response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create service request document upload created response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload created response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service request document upload created response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload created response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create service request document upload created response +func (o *CreateServiceRequestDocumentUploadCreated) Code() int { + return 201 +} + +func (o *CreateServiceRequestDocumentUploadCreated) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadCreated) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadCreated %+v", 201, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadCreated) GetPayload() *primemessages.UploadWithOmissions { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.UploadWithOmissions) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadBadRequest creates a CreateServiceRequestDocumentUploadBadRequest with default headers values +func NewCreateServiceRequestDocumentUploadBadRequest() *CreateServiceRequestDocumentUploadBadRequest { + return &CreateServiceRequestDocumentUploadBadRequest{} +} + +/* +CreateServiceRequestDocumentUploadBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateServiceRequestDocumentUploadBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create service request document upload bad request response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload bad request response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload bad request response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service request document upload bad request response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload bad request response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create service request document upload bad request response +func (o *CreateServiceRequestDocumentUploadBadRequest) Code() int { + return 400 +} + +func (o *CreateServiceRequestDocumentUploadBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadBadRequest %+v", 400, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadBadRequest) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadBadRequest %+v", 400, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadUnauthorized creates a CreateServiceRequestDocumentUploadUnauthorized with default headers values +func NewCreateServiceRequestDocumentUploadUnauthorized() *CreateServiceRequestDocumentUploadUnauthorized { + return &CreateServiceRequestDocumentUploadUnauthorized{} +} + +/* +CreateServiceRequestDocumentUploadUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateServiceRequestDocumentUploadUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create service request document upload unauthorized response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload unauthorized response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload unauthorized response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service request document upload unauthorized response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload unauthorized response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create service request document upload unauthorized response +func (o *CreateServiceRequestDocumentUploadUnauthorized) Code() int { + return 401 +} + +func (o *CreateServiceRequestDocumentUploadUnauthorized) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadUnauthorized) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadForbidden creates a CreateServiceRequestDocumentUploadForbidden with default headers values +func NewCreateServiceRequestDocumentUploadForbidden() *CreateServiceRequestDocumentUploadForbidden { + return &CreateServiceRequestDocumentUploadForbidden{} +} + +/* +CreateServiceRequestDocumentUploadForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateServiceRequestDocumentUploadForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create service request document upload forbidden response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload forbidden response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload forbidden response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service request document upload forbidden response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload forbidden response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create service request document upload forbidden response +func (o *CreateServiceRequestDocumentUploadForbidden) Code() int { + return 403 +} + +func (o *CreateServiceRequestDocumentUploadForbidden) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadForbidden %+v", 403, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadForbidden) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadForbidden %+v", 403, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadNotFound creates a CreateServiceRequestDocumentUploadNotFound with default headers values +func NewCreateServiceRequestDocumentUploadNotFound() *CreateServiceRequestDocumentUploadNotFound { + return &CreateServiceRequestDocumentUploadNotFound{} +} + +/* +CreateServiceRequestDocumentUploadNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateServiceRequestDocumentUploadNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create service request document upload not found response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload not found response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload not found response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service request document upload not found response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload not found response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create service request document upload not found response +func (o *CreateServiceRequestDocumentUploadNotFound) Code() int { + return 404 +} + +func (o *CreateServiceRequestDocumentUploadNotFound) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadNotFound %+v", 404, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadNotFound) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadNotFound %+v", 404, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadUnprocessableEntity creates a CreateServiceRequestDocumentUploadUnprocessableEntity with default headers values +func NewCreateServiceRequestDocumentUploadUnprocessableEntity() *CreateServiceRequestDocumentUploadUnprocessableEntity { + return &CreateServiceRequestDocumentUploadUnprocessableEntity{} +} + +/* +CreateServiceRequestDocumentUploadUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateServiceRequestDocumentUploadUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create service request document upload unprocessable entity response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload unprocessable entity response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload unprocessable entity response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create service request document upload unprocessable entity response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create service request document upload unprocessable entity response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create service request document upload unprocessable entity response +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateServiceRequestDocumentUploadInternalServerError creates a CreateServiceRequestDocumentUploadInternalServerError with default headers values +func NewCreateServiceRequestDocumentUploadInternalServerError() *CreateServiceRequestDocumentUploadInternalServerError { + return &CreateServiceRequestDocumentUploadInternalServerError{} +} + +/* +CreateServiceRequestDocumentUploadInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateServiceRequestDocumentUploadInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create service request document upload internal server error response has a 2xx status code +func (o *CreateServiceRequestDocumentUploadInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create service request document upload internal server error response has a 3xx status code +func (o *CreateServiceRequestDocumentUploadInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create service request document upload internal server error response has a 4xx status code +func (o *CreateServiceRequestDocumentUploadInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create service request document upload internal server error response has a 5xx status code +func (o *CreateServiceRequestDocumentUploadInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create service request document upload internal server error response a status code equal to that given +func (o *CreateServiceRequestDocumentUploadInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create service request document upload internal server error response +func (o *CreateServiceRequestDocumentUploadInternalServerError) Code() int { + return 500 +} + +func (o *CreateServiceRequestDocumentUploadInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-service-items/{mtoServiceItemID}/uploads][%d] createServiceRequestDocumentUploadInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateServiceRequestDocumentUploadInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateServiceRequestDocumentUploadInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go b/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go new file mode 100644 index 00000000000..1f1299ebd67 --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/mto_service_item_client.go @@ -0,0 +1,318 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto service item API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto service item API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateMTOServiceItem(params *CreateMTOServiceItemParams, opts ...ClientOption) (*CreateMTOServiceItemOK, error) + + CreateServiceRequestDocumentUpload(params *CreateServiceRequestDocumentUploadParams, opts ...ClientOption) (*CreateServiceRequestDocumentUploadCreated, error) + + UpdateMTOServiceItem(params *UpdateMTOServiceItemParams, opts ...ClientOption) (*UpdateMTOServiceItemOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateMTOServiceItem creates m t o service item + + Creates one or more MTOServiceItems. Not all service items may be created, please see details below. + +This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding + + to the service item you wish to create and the documentation will update with the new definition. + +Upon creation these items are associated with a Move Task Order and an MTO Shipment. +The request must include UUIDs for the MTO and MTO Shipment connected to this service item. Some service item types require +additional service items to be autogenerated when added - all created service items, autogenerated included, +will be returned in the response. + +To update a service item, please use [updateMTOServiceItem](#operation/updateMTOServiceItem) endpoint. + +--- + +**`MTOServiceItemOriginSIT`** + +MTOServiceItemOriginSIT is a subtype of MTOServiceItem. + +This model type describes a domestic origin SIT service item. Items can be created using this +model type with the following codes: + +**DOFSIT** + +**1st day origin SIT service item**. When a DOFSIT is requested, the API will auto-create the following group of service items: + - DOFSIT - Domestic origin 1st day SIT + - DOASIT - Domestic origin Additional day SIT + - DOPSIT - Domestic origin SIT pickup + - DOSFSC - Domestic origin SIT fuel surcharge + +**DOASIT** + +**Addt'l days origin SIT service item**. This represents an additional day of storage for the same item. +Additional DOASIT service items can be created and added to an existing shipment that **includes a DOFSIT service item**. + +--- + +**`MTOServiceItemDestSIT`** + +MTOServiceItemDestSIT is a subtype of MTOServiceItem. + +This model type describes a domestic destination SIT service item. Items can be created using this +model type with the following codes: + +**DDFSIT** + +**1st day destination SIT service item**. + +These additional fields are optional for creating a DDFSIT: + - `firstAvailableDeliveryDate1` + - string + - First available date that Prime can deliver SIT service item. + - firstAvailableDeliveryDate1, dateOfContact1, and timeMilitary1 are required together + - `dateOfContact1` + - string + - Date of attempted contact by the prime corresponding to `timeMilitary1` + - dateOfContact1, timeMilitary1, and firstAvailableDeliveryDate1 are required together + - `timeMilitary1` + - string\d{4}Z + - Time of attempted contact corresponding to `dateOfContact1`, in military format. + - timeMilitary1, dateOfContact1, and firstAvailableDeliveryDate1 are required together + - `firstAvailableDeliveryDate2` + - string + - Second available date that Prime can deliver SIT service item. + - firstAvailableDeliveryDate2, dateOfContact2, and timeMilitary2 are required together + - `dateOfContact2` + - string + - Date of attempted contact delivery by the prime corresponding to `timeMilitary2` + - dateOfContact2, timeMilitary2, and firstAvailableDeliveryDate2 are required together + - `timeMilitary2` + - string\d{4}Z + - Time of attempted contact corresponding to `dateOfContact2`, in military format. + - timeMilitary2, dateOfContact2, and firstAvailableDeliveryDate2 are required together + +When a DDFSIT is requested, the API will auto-create the following group of service items: + - DDFSIT - Domestic destination 1st day SIT + - DDASIT - Domestic destination Additional day SIT + - DDDSIT - Domestic destination SIT delivery + - DDSFSC - Domestic destination SIT fuel surcharge + +**NOTE** When providing the `sitEntryDate` value in the payload, please ensure that the date is not BEFORE +`firstAvailableDeliveryDate1` or `firstAvailableDeliveryDate2`. If it is, you will receive an error response. + +**DDASIT** + +**Addt'l days destination SIT service item**. This represents an additional day of storage for the same item. +Additional DDASIT service items can be created and added to an existing shipment that **includes a DDFSIT service item**. +*/ +func (a *Client) CreateMTOServiceItem(params *CreateMTOServiceItemParams, opts ...ClientOption) (*CreateMTOServiceItemOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMTOServiceItemParams() + } + op := &runtime.ClientOperation{ + ID: "createMTOServiceItem", + Method: "POST", + PathPattern: "/mto-service-items", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMTOServiceItemReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateMTOServiceItemOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createMTOServiceItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CreateServiceRequestDocumentUpload creates service request document upload + + ### Functionality + +This endpoint **uploads** a Service Request document for a +ServiceItem. + +The ServiceItem should already exist. + +ServiceItems are created with the +[createMTOServiceItem](#operation/createMTOServiceItem) +endpoint. +*/ +func (a *Client) CreateServiceRequestDocumentUpload(params *CreateServiceRequestDocumentUploadParams, opts ...ClientOption) (*CreateServiceRequestDocumentUploadCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateServiceRequestDocumentUploadParams() + } + op := &runtime.ClientOperation{ + ID: "createServiceRequestDocumentUpload", + Method: "POST", + PathPattern: "/mto-service-items/{mtoServiceItemID}/uploads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateServiceRequestDocumentUploadReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateServiceRequestDocumentUploadCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createServiceRequestDocumentUpload: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOServiceItem updates m t o service item + + Updates MTOServiceItems after creation. Not all service items or fields may be updated, please see details below. + +This endpoint supports different body definitions. In the modelType field below, select the modelType corresponding + + to the service item you wish to update and the documentation will update with the new definition. + +* Addresses: To update a destination service item's SIT destination final address, update the shipment delivery address. +For approved shipments, please use [updateShipmentDestinationAddress](#mtoShipment/updateShipmentDestinationAddress). +For shipments not yet approved, please use [updateMTOShipmentAddress](#mtoShipment/updateMTOShipmentAddress). + +* SIT Service Items: Take note that when updating `sitCustomerContacted`, `sitDepartureDate`, or `sitRequestedDelivery`, we want +those to be updated on `DOASIT` (for origin SIT) and `DDASIT` (for destination SIT). If updating those values in other service +items, the office users will not have as much attention to those values. + +To create a service item, please use [createMTOServiceItem](#mtoServiceItem/createMTOServiceItem)) endpoint. + +* Resubmitting rejected SIT service items: This endpoint will handle the logic of changing the status of rejected SIT service items from +REJECTED to SUBMITTED. Please provide the `requestedApprovalsRequestedStatus: true` when resubmitting as this will give attention to the TOO to +review the resubmitted SIT service item. Another note, `updateReason` must have a different value than the current `reason` value on the service item. +If this value is not updated, then an error will be sent back. + +The following SIT service items can be resubmitted following a rejection: +- DDASIT +- DDDSIT +- DDFSIT +- DOASIT +- DOPSIT +- DOFSIT +- DDSFSC +- DOSFSC + +At a MINIMUM, the payload for resubmitting a rejected SIT service item must look like this: +```json + + { + "reServiceCode": "DDFSIT", + "updateReason": "A reason that differs from the previous reason", + "modelType": "UpdateMTOServiceItemSIT", + "requestApprovalsRequestedStatus": true + } + +``` + +The following service items allow you to update the Port that the shipment will use: +- PODFSC (Port of Debarkation can be updated) +- POEFSC (Port of Embarkation can be updated) + +At a MINIMUM, the payload for updating the port should contain the reServiceCode (PODFSC or POEFSC), modelType (UpdateMTOServiceItemInternationalPortFSC), portCode, and id for the service item. +Please see the example payload below: +```json + + { + "id": "1ed224b6-c65e-4616-b88e-8304d26c9562", + "modelType": "UpdateMTOServiceItemInternationalPortFSC", + "portCode": "SEA", + "reServiceCode": "POEFSC" + } + +``` +*/ +func (a *Client) UpdateMTOServiceItem(params *UpdateMTOServiceItemParams, opts ...ClientOption) (*UpdateMTOServiceItemOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOServiceItemParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOServiceItem", + Method: "PATCH", + PathPattern: "/mto-service-items/{mtoServiceItemID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOServiceItemReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOServiceItemOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOServiceItem: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go new file mode 100644 index 00000000000..4e9019c7cf1 --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_parameters.go @@ -0,0 +1,193 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOServiceItemParams creates a new UpdateMTOServiceItemParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOServiceItemParams() *UpdateMTOServiceItemParams { + return &UpdateMTOServiceItemParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOServiceItemParamsWithTimeout creates a new UpdateMTOServiceItemParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOServiceItemParamsWithTimeout(timeout time.Duration) *UpdateMTOServiceItemParams { + return &UpdateMTOServiceItemParams{ + timeout: timeout, + } +} + +// NewUpdateMTOServiceItemParamsWithContext creates a new UpdateMTOServiceItemParams object +// with the ability to set a context for a request. +func NewUpdateMTOServiceItemParamsWithContext(ctx context.Context) *UpdateMTOServiceItemParams { + return &UpdateMTOServiceItemParams{ + Context: ctx, + } +} + +// NewUpdateMTOServiceItemParamsWithHTTPClient creates a new UpdateMTOServiceItemParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOServiceItemParamsWithHTTPClient(client *http.Client) *UpdateMTOServiceItemParams { + return &UpdateMTOServiceItemParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOServiceItemParams contains all the parameters to send to the API endpoint + + for the update m t o service item operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOServiceItemParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body primemessages.UpdateMTOServiceItem + + /* MtoServiceItemID. + + UUID of service item to update. + */ + MtoServiceItemID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o service item params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOServiceItemParams) WithDefaults() *UpdateMTOServiceItemParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o service item params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOServiceItemParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithTimeout(timeout time.Duration) *UpdateMTOServiceItemParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithContext(ctx context.Context) *UpdateMTOServiceItemParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithHTTPClient(client *http.Client) *UpdateMTOServiceItemParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithIfMatch(ifMatch string) *UpdateMTOServiceItemParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithBody(body primemessages.UpdateMTOServiceItem) *UpdateMTOServiceItemParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetBody(body primemessages.UpdateMTOServiceItem) { + o.Body = body +} + +// WithMtoServiceItemID adds the mtoServiceItemID to the update m t o service item params +func (o *UpdateMTOServiceItemParams) WithMtoServiceItemID(mtoServiceItemID string) *UpdateMTOServiceItemParams { + o.SetMtoServiceItemID(mtoServiceItemID) + return o +} + +// SetMtoServiceItemID adds the mtoServiceItemId to the update m t o service item params +func (o *UpdateMTOServiceItemParams) SetMtoServiceItemID(mtoServiceItemID string) { + o.MtoServiceItemID = mtoServiceItemID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOServiceItemParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + // path param mtoServiceItemID + if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go new file mode 100644 index 00000000000..6e828df911d --- /dev/null +++ b/pkg/gen/primeclient/mto_service_item/update_m_t_o_service_item_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOServiceItemReader is a Reader for the UpdateMTOServiceItem structure. +type UpdateMTOServiceItemReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOServiceItemReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOServiceItemOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOServiceItemBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOServiceItemUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOServiceItemForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOServiceItemNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOServiceItemConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOServiceItemPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOServiceItemUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOServiceItemInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-service-items/{mtoServiceItemID}] updateMTOServiceItem", response, response.Code()) + } +} + +// NewUpdateMTOServiceItemOK creates a UpdateMTOServiceItemOK with default headers values +func NewUpdateMTOServiceItemOK() *UpdateMTOServiceItemOK { + return &UpdateMTOServiceItemOK{} +} + +/* +UpdateMTOServiceItemOK describes a response with status code 200, with default header values. + +Successfully updated the MTO service item. +*/ +type UpdateMTOServiceItemOK struct { + Payload primemessages.MTOServiceItem +} + +// IsSuccess returns true when this update m t o service item o k response has a 2xx status code +func (o *UpdateMTOServiceItemOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o service item o k response has a 3xx status code +func (o *UpdateMTOServiceItemOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item o k response has a 4xx status code +func (o *UpdateMTOServiceItemOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o service item o k response has a 5xx status code +func (o *UpdateMTOServiceItemOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item o k response a status code equal to that given +func (o *UpdateMTOServiceItemOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o service item o k response +func (o *UpdateMTOServiceItemOK) Code() int { + return 200 +} + +func (o *UpdateMTOServiceItemOK) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOServiceItemOK) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOServiceItemOK) GetPayload() primemessages.MTOServiceItem { + return o.Payload +} + +func (o *UpdateMTOServiceItemOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload as interface type + payload, err := primemessages.UnmarshalMTOServiceItem(response.Body(), consumer) + if err != nil { + return err + } + o.Payload = payload + + return nil +} + +// NewUpdateMTOServiceItemBadRequest creates a UpdateMTOServiceItemBadRequest with default headers values +func NewUpdateMTOServiceItemBadRequest() *UpdateMTOServiceItemBadRequest { + return &UpdateMTOServiceItemBadRequest{} +} + +/* +UpdateMTOServiceItemBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOServiceItemBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item bad request response has a 2xx status code +func (o *UpdateMTOServiceItemBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item bad request response has a 3xx status code +func (o *UpdateMTOServiceItemBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item bad request response has a 4xx status code +func (o *UpdateMTOServiceItemBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item bad request response has a 5xx status code +func (o *UpdateMTOServiceItemBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item bad request response a status code equal to that given +func (o *UpdateMTOServiceItemBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o service item bad request response +func (o *UpdateMTOServiceItemBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOServiceItemBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOServiceItemBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOServiceItemBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemUnauthorized creates a UpdateMTOServiceItemUnauthorized with default headers values +func NewUpdateMTOServiceItemUnauthorized() *UpdateMTOServiceItemUnauthorized { + return &UpdateMTOServiceItemUnauthorized{} +} + +/* +UpdateMTOServiceItemUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOServiceItemUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item unauthorized response has a 2xx status code +func (o *UpdateMTOServiceItemUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item unauthorized response has a 3xx status code +func (o *UpdateMTOServiceItemUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item unauthorized response has a 4xx status code +func (o *UpdateMTOServiceItemUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item unauthorized response has a 5xx status code +func (o *UpdateMTOServiceItemUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item unauthorized response a status code equal to that given +func (o *UpdateMTOServiceItemUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o service item unauthorized response +func (o *UpdateMTOServiceItemUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOServiceItemUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOServiceItemUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOServiceItemUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemForbidden creates a UpdateMTOServiceItemForbidden with default headers values +func NewUpdateMTOServiceItemForbidden() *UpdateMTOServiceItemForbidden { + return &UpdateMTOServiceItemForbidden{} +} + +/* +UpdateMTOServiceItemForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOServiceItemForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item forbidden response has a 2xx status code +func (o *UpdateMTOServiceItemForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item forbidden response has a 3xx status code +func (o *UpdateMTOServiceItemForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item forbidden response has a 4xx status code +func (o *UpdateMTOServiceItemForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item forbidden response has a 5xx status code +func (o *UpdateMTOServiceItemForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item forbidden response a status code equal to that given +func (o *UpdateMTOServiceItemForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o service item forbidden response +func (o *UpdateMTOServiceItemForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOServiceItemForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOServiceItemForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOServiceItemForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemNotFound creates a UpdateMTOServiceItemNotFound with default headers values +func NewUpdateMTOServiceItemNotFound() *UpdateMTOServiceItemNotFound { + return &UpdateMTOServiceItemNotFound{} +} + +/* +UpdateMTOServiceItemNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOServiceItemNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item not found response has a 2xx status code +func (o *UpdateMTOServiceItemNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item not found response has a 3xx status code +func (o *UpdateMTOServiceItemNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item not found response has a 4xx status code +func (o *UpdateMTOServiceItemNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item not found response has a 5xx status code +func (o *UpdateMTOServiceItemNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item not found response a status code equal to that given +func (o *UpdateMTOServiceItemNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o service item not found response +func (o *UpdateMTOServiceItemNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOServiceItemNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOServiceItemNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOServiceItemNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemConflict creates a UpdateMTOServiceItemConflict with default headers values +func NewUpdateMTOServiceItemConflict() *UpdateMTOServiceItemConflict { + return &UpdateMTOServiceItemConflict{} +} + +/* +UpdateMTOServiceItemConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateMTOServiceItemConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item conflict response has a 2xx status code +func (o *UpdateMTOServiceItemConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item conflict response has a 3xx status code +func (o *UpdateMTOServiceItemConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item conflict response has a 4xx status code +func (o *UpdateMTOServiceItemConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item conflict response has a 5xx status code +func (o *UpdateMTOServiceItemConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item conflict response a status code equal to that given +func (o *UpdateMTOServiceItemConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o service item conflict response +func (o *UpdateMTOServiceItemConflict) Code() int { + return 409 +} + +func (o *UpdateMTOServiceItemConflict) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOServiceItemConflict) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOServiceItemConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemPreconditionFailed creates a UpdateMTOServiceItemPreconditionFailed with default headers values +func NewUpdateMTOServiceItemPreconditionFailed() *UpdateMTOServiceItemPreconditionFailed { + return &UpdateMTOServiceItemPreconditionFailed{} +} + +/* +UpdateMTOServiceItemPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOServiceItemPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o service item precondition failed response has a 2xx status code +func (o *UpdateMTOServiceItemPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item precondition failed response has a 3xx status code +func (o *UpdateMTOServiceItemPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item precondition failed response has a 4xx status code +func (o *UpdateMTOServiceItemPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item precondition failed response has a 5xx status code +func (o *UpdateMTOServiceItemPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item precondition failed response a status code equal to that given +func (o *UpdateMTOServiceItemPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o service item precondition failed response +func (o *UpdateMTOServiceItemPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOServiceItemPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOServiceItemPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOServiceItemPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemUnprocessableEntity creates a UpdateMTOServiceItemUnprocessableEntity with default headers values +func NewUpdateMTOServiceItemUnprocessableEntity() *UpdateMTOServiceItemUnprocessableEntity { + return &UpdateMTOServiceItemUnprocessableEntity{} +} + +/* +UpdateMTOServiceItemUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOServiceItemUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update m t o service item unprocessable entity response has a 2xx status code +func (o *UpdateMTOServiceItemUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item unprocessable entity response has a 3xx status code +func (o *UpdateMTOServiceItemUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item unprocessable entity response has a 4xx status code +func (o *UpdateMTOServiceItemUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item unprocessable entity response has a 5xx status code +func (o *UpdateMTOServiceItemUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item unprocessable entity response a status code equal to that given +func (o *UpdateMTOServiceItemUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o service item unprocessable entity response +func (o *UpdateMTOServiceItemUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOServiceItemUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOServiceItemUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOServiceItemUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOServiceItemUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemInternalServerError creates a UpdateMTOServiceItemInternalServerError with default headers values +func NewUpdateMTOServiceItemInternalServerError() *UpdateMTOServiceItemInternalServerError { + return &UpdateMTOServiceItemInternalServerError{} +} + +/* +UpdateMTOServiceItemInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOServiceItemInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update m t o service item internal server error response has a 2xx status code +func (o *UpdateMTOServiceItemInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item internal server error response has a 3xx status code +func (o *UpdateMTOServiceItemInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item internal server error response has a 4xx status code +func (o *UpdateMTOServiceItemInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o service item internal server error response has a 5xx status code +func (o *UpdateMTOServiceItemInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o service item internal server error response a status code equal to that given +func (o *UpdateMTOServiceItemInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o service item internal server error response +func (o *UpdateMTOServiceItemInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOServiceItemInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOServiceItemInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}][%d] updateMTOServiceItemInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOServiceItemInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateMTOServiceItemInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go new file mode 100644 index 00000000000..384fe947303 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateMTOAgentParams creates a new CreateMTOAgentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMTOAgentParams() *CreateMTOAgentParams { + return &CreateMTOAgentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMTOAgentParamsWithTimeout creates a new CreateMTOAgentParams object +// with the ability to set a timeout on a request. +func NewCreateMTOAgentParamsWithTimeout(timeout time.Duration) *CreateMTOAgentParams { + return &CreateMTOAgentParams{ + timeout: timeout, + } +} + +// NewCreateMTOAgentParamsWithContext creates a new CreateMTOAgentParams object +// with the ability to set a context for a request. +func NewCreateMTOAgentParamsWithContext(ctx context.Context) *CreateMTOAgentParams { + return &CreateMTOAgentParams{ + Context: ctx, + } +} + +// NewCreateMTOAgentParamsWithHTTPClient creates a new CreateMTOAgentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMTOAgentParamsWithHTTPClient(client *http.Client) *CreateMTOAgentParams { + return &CreateMTOAgentParams{ + HTTPClient: client, + } +} + +/* +CreateMTOAgentParams contains all the parameters to send to the API endpoint + + for the create m t o agent operation. + + Typically these are written to a http.Request. +*/ +type CreateMTOAgentParams struct { + + // Body. + Body *primemessages.MTOAgent + + /* MtoShipmentID. + + UUID of the shipment associated with the agent + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create m t o agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOAgentParams) WithDefaults() *CreateMTOAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create m t o agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOAgentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create m t o agent params +func (o *CreateMTOAgentParams) WithTimeout(timeout time.Duration) *CreateMTOAgentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create m t o agent params +func (o *CreateMTOAgentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create m t o agent params +func (o *CreateMTOAgentParams) WithContext(ctx context.Context) *CreateMTOAgentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create m t o agent params +func (o *CreateMTOAgentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create m t o agent params +func (o *CreateMTOAgentParams) WithHTTPClient(client *http.Client) *CreateMTOAgentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create m t o agent params +func (o *CreateMTOAgentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create m t o agent params +func (o *CreateMTOAgentParams) WithBody(body *primemessages.MTOAgent) *CreateMTOAgentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create m t o agent params +func (o *CreateMTOAgentParams) SetBody(body *primemessages.MTOAgent) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the create m t o agent params +func (o *CreateMTOAgentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *CreateMTOAgentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the create m t o agent params +func (o *CreateMTOAgentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMTOAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go new file mode 100644 index 00000000000..9ea9f7a24a6 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_m_t_o_agent_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateMTOAgentReader is a Reader for the CreateMTOAgent structure. +type CreateMTOAgentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMTOAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateMTOAgentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateMTOAgentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateMTOAgentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateMTOAgentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateMTOAgentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateMTOAgentConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateMTOAgentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateMTOAgentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/agents] createMTOAgent", response, response.Code()) + } +} + +// NewCreateMTOAgentOK creates a CreateMTOAgentOK with default headers values +func NewCreateMTOAgentOK() *CreateMTOAgentOK { + return &CreateMTOAgentOK{} +} + +/* +CreateMTOAgentOK describes a response with status code 200, with default header values. + +Successfully added the agent. +*/ +type CreateMTOAgentOK struct { + Payload *primemessages.MTOAgent +} + +// IsSuccess returns true when this create m t o agent o k response has a 2xx status code +func (o *CreateMTOAgentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create m t o agent o k response has a 3xx status code +func (o *CreateMTOAgentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent o k response has a 4xx status code +func (o *CreateMTOAgentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o agent o k response has a 5xx status code +func (o *CreateMTOAgentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent o k response a status code equal to that given +func (o *CreateMTOAgentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create m t o agent o k response +func (o *CreateMTOAgentOK) Code() int { + return 200 +} + +func (o *CreateMTOAgentOK) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOAgentOK) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOAgentOK) GetPayload() *primemessages.MTOAgent { + return o.Payload +} + +func (o *CreateMTOAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.MTOAgent) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentBadRequest creates a CreateMTOAgentBadRequest with default headers values +func NewCreateMTOAgentBadRequest() *CreateMTOAgentBadRequest { + return &CreateMTOAgentBadRequest{} +} + +/* +CreateMTOAgentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateMTOAgentBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o agent bad request response has a 2xx status code +func (o *CreateMTOAgentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent bad request response has a 3xx status code +func (o *CreateMTOAgentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent bad request response has a 4xx status code +func (o *CreateMTOAgentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent bad request response has a 5xx status code +func (o *CreateMTOAgentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent bad request response a status code equal to that given +func (o *CreateMTOAgentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create m t o agent bad request response +func (o *CreateMTOAgentBadRequest) Code() int { + return 400 +} + +func (o *CreateMTOAgentBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOAgentBadRequest) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOAgentBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOAgentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentUnauthorized creates a CreateMTOAgentUnauthorized with default headers values +func NewCreateMTOAgentUnauthorized() *CreateMTOAgentUnauthorized { + return &CreateMTOAgentUnauthorized{} +} + +/* +CreateMTOAgentUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateMTOAgentUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o agent unauthorized response has a 2xx status code +func (o *CreateMTOAgentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent unauthorized response has a 3xx status code +func (o *CreateMTOAgentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent unauthorized response has a 4xx status code +func (o *CreateMTOAgentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent unauthorized response has a 5xx status code +func (o *CreateMTOAgentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent unauthorized response a status code equal to that given +func (o *CreateMTOAgentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create m t o agent unauthorized response +func (o *CreateMTOAgentUnauthorized) Code() int { + return 401 +} + +func (o *CreateMTOAgentUnauthorized) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMTOAgentUnauthorized) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMTOAgentUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOAgentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentForbidden creates a CreateMTOAgentForbidden with default headers values +func NewCreateMTOAgentForbidden() *CreateMTOAgentForbidden { + return &CreateMTOAgentForbidden{} +} + +/* +CreateMTOAgentForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateMTOAgentForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o agent forbidden response has a 2xx status code +func (o *CreateMTOAgentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent forbidden response has a 3xx status code +func (o *CreateMTOAgentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent forbidden response has a 4xx status code +func (o *CreateMTOAgentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent forbidden response has a 5xx status code +func (o *CreateMTOAgentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent forbidden response a status code equal to that given +func (o *CreateMTOAgentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create m t o agent forbidden response +func (o *CreateMTOAgentForbidden) Code() int { + return 403 +} + +func (o *CreateMTOAgentForbidden) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentForbidden %+v", 403, o.Payload) +} + +func (o *CreateMTOAgentForbidden) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentForbidden %+v", 403, o.Payload) +} + +func (o *CreateMTOAgentForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentNotFound creates a CreateMTOAgentNotFound with default headers values +func NewCreateMTOAgentNotFound() *CreateMTOAgentNotFound { + return &CreateMTOAgentNotFound{} +} + +/* +CreateMTOAgentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateMTOAgentNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o agent not found response has a 2xx status code +func (o *CreateMTOAgentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent not found response has a 3xx status code +func (o *CreateMTOAgentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent not found response has a 4xx status code +func (o *CreateMTOAgentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent not found response has a 5xx status code +func (o *CreateMTOAgentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent not found response a status code equal to that given +func (o *CreateMTOAgentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create m t o agent not found response +func (o *CreateMTOAgentNotFound) Code() int { + return 404 +} + +func (o *CreateMTOAgentNotFound) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOAgentNotFound) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOAgentNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentConflict creates a CreateMTOAgentConflict with default headers values +func NewCreateMTOAgentConflict() *CreateMTOAgentConflict { + return &CreateMTOAgentConflict{} +} + +/* +CreateMTOAgentConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type CreateMTOAgentConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create m t o agent conflict response has a 2xx status code +func (o *CreateMTOAgentConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent conflict response has a 3xx status code +func (o *CreateMTOAgentConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent conflict response has a 4xx status code +func (o *CreateMTOAgentConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent conflict response has a 5xx status code +func (o *CreateMTOAgentConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent conflict response a status code equal to that given +func (o *CreateMTOAgentConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create m t o agent conflict response +func (o *CreateMTOAgentConflict) Code() int { + return 409 +} + +func (o *CreateMTOAgentConflict) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentConflict %+v", 409, o.Payload) +} + +func (o *CreateMTOAgentConflict) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentConflict %+v", 409, o.Payload) +} + +func (o *CreateMTOAgentConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateMTOAgentConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentUnprocessableEntity creates a CreateMTOAgentUnprocessableEntity with default headers values +func NewCreateMTOAgentUnprocessableEntity() *CreateMTOAgentUnprocessableEntity { + return &CreateMTOAgentUnprocessableEntity{} +} + +/* +CreateMTOAgentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateMTOAgentUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create m t o agent unprocessable entity response has a 2xx status code +func (o *CreateMTOAgentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent unprocessable entity response has a 3xx status code +func (o *CreateMTOAgentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent unprocessable entity response has a 4xx status code +func (o *CreateMTOAgentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o agent unprocessable entity response has a 5xx status code +func (o *CreateMTOAgentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o agent unprocessable entity response a status code equal to that given +func (o *CreateMTOAgentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create m t o agent unprocessable entity response +func (o *CreateMTOAgentUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateMTOAgentUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOAgentUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOAgentUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateMTOAgentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOAgentInternalServerError creates a CreateMTOAgentInternalServerError with default headers values +func NewCreateMTOAgentInternalServerError() *CreateMTOAgentInternalServerError { + return &CreateMTOAgentInternalServerError{} +} + +/* +CreateMTOAgentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateMTOAgentInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create m t o agent internal server error response has a 2xx status code +func (o *CreateMTOAgentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o agent internal server error response has a 3xx status code +func (o *CreateMTOAgentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o agent internal server error response has a 4xx status code +func (o *CreateMTOAgentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o agent internal server error response has a 5xx status code +func (o *CreateMTOAgentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create m t o agent internal server error response a status code equal to that given +func (o *CreateMTOAgentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create m t o agent internal server error response +func (o *CreateMTOAgentInternalServerError) Code() int { + return 500 +} + +func (o *CreateMTOAgentInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOAgentInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/agents][%d] createMTOAgentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOAgentInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateMTOAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..1cf6aa6d3a2 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object +// with the ability to set a context for a request. +func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + Context: ctx, + } +} + +// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +CreateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the create m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type CreateMTOShipmentParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..be658169f6d --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. +type CreateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 410: + result := NewCreateMTOShipmentGone() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) + } +} + +// NewCreateMTOShipmentGone creates a CreateMTOShipmentGone with default headers values +func NewCreateMTOShipmentGone() *CreateMTOShipmentGone { + return &CreateMTOShipmentGone{} +} + +/* +CreateMTOShipmentGone describes a response with status code 410, with default header values. + +This endpoint is deprecated. Please use `/prime/v3/createMTOShipment` instead. +*/ +type CreateMTOShipmentGone struct { +} + +// IsSuccess returns true when this create m t o shipment gone response has a 2xx status code +func (o *CreateMTOShipmentGone) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment gone response has a 3xx status code +func (o *CreateMTOShipmentGone) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment gone response has a 4xx status code +func (o *CreateMTOShipmentGone) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment gone response has a 5xx status code +func (o *CreateMTOShipmentGone) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment gone response a status code equal to that given +func (o *CreateMTOShipmentGone) IsCode(code int) bool { + return code == 410 +} + +// Code gets the status code for the create m t o shipment gone response +func (o *CreateMTOShipmentGone) Code() int { + return 410 +} + +func (o *CreateMTOShipmentGone) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentGone ", 410) +} + +func (o *CreateMTOShipmentGone) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentGone ", 410) +} + +func (o *CreateMTOShipmentGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go new file mode 100644 index 00000000000..27c02b10986 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreateSITExtensionParams creates a new CreateSITExtensionParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateSITExtensionParams() *CreateSITExtensionParams { + return &CreateSITExtensionParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateSITExtensionParamsWithTimeout creates a new CreateSITExtensionParams object +// with the ability to set a timeout on a request. +func NewCreateSITExtensionParamsWithTimeout(timeout time.Duration) *CreateSITExtensionParams { + return &CreateSITExtensionParams{ + timeout: timeout, + } +} + +// NewCreateSITExtensionParamsWithContext creates a new CreateSITExtensionParams object +// with the ability to set a context for a request. +func NewCreateSITExtensionParamsWithContext(ctx context.Context) *CreateSITExtensionParams { + return &CreateSITExtensionParams{ + Context: ctx, + } +} + +// NewCreateSITExtensionParamsWithHTTPClient creates a new CreateSITExtensionParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateSITExtensionParamsWithHTTPClient(client *http.Client) *CreateSITExtensionParams { + return &CreateSITExtensionParams{ + HTTPClient: client, + } +} + +/* +CreateSITExtensionParams contains all the parameters to send to the API endpoint + + for the create s i t extension operation. + + Typically these are written to a http.Request. +*/ +type CreateSITExtensionParams struct { + + // Body. + Body *primemessages.CreateSITExtension + + /* MtoShipmentID. + + UUID of the shipment associated with the agent + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create s i t extension params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSITExtensionParams) WithDefaults() *CreateSITExtensionParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create s i t extension params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateSITExtensionParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create s i t extension params +func (o *CreateSITExtensionParams) WithTimeout(timeout time.Duration) *CreateSITExtensionParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create s i t extension params +func (o *CreateSITExtensionParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create s i t extension params +func (o *CreateSITExtensionParams) WithContext(ctx context.Context) *CreateSITExtensionParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create s i t extension params +func (o *CreateSITExtensionParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create s i t extension params +func (o *CreateSITExtensionParams) WithHTTPClient(client *http.Client) *CreateSITExtensionParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create s i t extension params +func (o *CreateSITExtensionParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create s i t extension params +func (o *CreateSITExtensionParams) WithBody(body *primemessages.CreateSITExtension) *CreateSITExtensionParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create s i t extension params +func (o *CreateSITExtensionParams) SetBody(body *primemessages.CreateSITExtension) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the create s i t extension params +func (o *CreateSITExtensionParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *CreateSITExtensionParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the create s i t extension params +func (o *CreateSITExtensionParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateSITExtensionParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go new file mode 100644 index 00000000000..7f1e398fbfa --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/create_s_i_t_extension_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateSITExtensionReader is a Reader for the CreateSITExtension structure. +type CreateSITExtensionReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateSITExtensionReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateSITExtensionCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateSITExtensionBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateSITExtensionUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateSITExtensionForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateSITExtensionNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreateSITExtensionConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateSITExtensionUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateSITExtensionInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/sit-extensions] createSITExtension", response, response.Code()) + } +} + +// NewCreateSITExtensionCreated creates a CreateSITExtensionCreated with default headers values +func NewCreateSITExtensionCreated() *CreateSITExtensionCreated { + return &CreateSITExtensionCreated{} +} + +/* +CreateSITExtensionCreated describes a response with status code 201, with default header values. + +Successfully created the sit extension request. +*/ +type CreateSITExtensionCreated struct { + Payload *primemessages.SITExtension +} + +// IsSuccess returns true when this create s i t extension created response has a 2xx status code +func (o *CreateSITExtensionCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create s i t extension created response has a 3xx status code +func (o *CreateSITExtensionCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension created response has a 4xx status code +func (o *CreateSITExtensionCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create s i t extension created response has a 5xx status code +func (o *CreateSITExtensionCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension created response a status code equal to that given +func (o *CreateSITExtensionCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create s i t extension created response +func (o *CreateSITExtensionCreated) Code() int { + return 201 +} + +func (o *CreateSITExtensionCreated) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionCreated %+v", 201, o.Payload) +} + +func (o *CreateSITExtensionCreated) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionCreated %+v", 201, o.Payload) +} + +func (o *CreateSITExtensionCreated) GetPayload() *primemessages.SITExtension { + return o.Payload +} + +func (o *CreateSITExtensionCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.SITExtension) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionBadRequest creates a CreateSITExtensionBadRequest with default headers values +func NewCreateSITExtensionBadRequest() *CreateSITExtensionBadRequest { + return &CreateSITExtensionBadRequest{} +} + +/* +CreateSITExtensionBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateSITExtensionBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create s i t extension bad request response has a 2xx status code +func (o *CreateSITExtensionBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension bad request response has a 3xx status code +func (o *CreateSITExtensionBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension bad request response has a 4xx status code +func (o *CreateSITExtensionBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension bad request response has a 5xx status code +func (o *CreateSITExtensionBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension bad request response a status code equal to that given +func (o *CreateSITExtensionBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create s i t extension bad request response +func (o *CreateSITExtensionBadRequest) Code() int { + return 400 +} + +func (o *CreateSITExtensionBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionBadRequest %+v", 400, o.Payload) +} + +func (o *CreateSITExtensionBadRequest) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionBadRequest %+v", 400, o.Payload) +} + +func (o *CreateSITExtensionBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateSITExtensionBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionUnauthorized creates a CreateSITExtensionUnauthorized with default headers values +func NewCreateSITExtensionUnauthorized() *CreateSITExtensionUnauthorized { + return &CreateSITExtensionUnauthorized{} +} + +/* +CreateSITExtensionUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateSITExtensionUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create s i t extension unauthorized response has a 2xx status code +func (o *CreateSITExtensionUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension unauthorized response has a 3xx status code +func (o *CreateSITExtensionUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension unauthorized response has a 4xx status code +func (o *CreateSITExtensionUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension unauthorized response has a 5xx status code +func (o *CreateSITExtensionUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension unauthorized response a status code equal to that given +func (o *CreateSITExtensionUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create s i t extension unauthorized response +func (o *CreateSITExtensionUnauthorized) Code() int { + return 401 +} + +func (o *CreateSITExtensionUnauthorized) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateSITExtensionUnauthorized) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateSITExtensionUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateSITExtensionUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionForbidden creates a CreateSITExtensionForbidden with default headers values +func NewCreateSITExtensionForbidden() *CreateSITExtensionForbidden { + return &CreateSITExtensionForbidden{} +} + +/* +CreateSITExtensionForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateSITExtensionForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create s i t extension forbidden response has a 2xx status code +func (o *CreateSITExtensionForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension forbidden response has a 3xx status code +func (o *CreateSITExtensionForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension forbidden response has a 4xx status code +func (o *CreateSITExtensionForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension forbidden response has a 5xx status code +func (o *CreateSITExtensionForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension forbidden response a status code equal to that given +func (o *CreateSITExtensionForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create s i t extension forbidden response +func (o *CreateSITExtensionForbidden) Code() int { + return 403 +} + +func (o *CreateSITExtensionForbidden) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionForbidden %+v", 403, o.Payload) +} + +func (o *CreateSITExtensionForbidden) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionForbidden %+v", 403, o.Payload) +} + +func (o *CreateSITExtensionForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateSITExtensionForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionNotFound creates a CreateSITExtensionNotFound with default headers values +func NewCreateSITExtensionNotFound() *CreateSITExtensionNotFound { + return &CreateSITExtensionNotFound{} +} + +/* +CreateSITExtensionNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateSITExtensionNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create s i t extension not found response has a 2xx status code +func (o *CreateSITExtensionNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension not found response has a 3xx status code +func (o *CreateSITExtensionNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension not found response has a 4xx status code +func (o *CreateSITExtensionNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension not found response has a 5xx status code +func (o *CreateSITExtensionNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension not found response a status code equal to that given +func (o *CreateSITExtensionNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create s i t extension not found response +func (o *CreateSITExtensionNotFound) Code() int { + return 404 +} + +func (o *CreateSITExtensionNotFound) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionNotFound %+v", 404, o.Payload) +} + +func (o *CreateSITExtensionNotFound) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionNotFound %+v", 404, o.Payload) +} + +func (o *CreateSITExtensionNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateSITExtensionNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionConflict creates a CreateSITExtensionConflict with default headers values +func NewCreateSITExtensionConflict() *CreateSITExtensionConflict { + return &CreateSITExtensionConflict{} +} + +/* +CreateSITExtensionConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type CreateSITExtensionConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create s i t extension conflict response has a 2xx status code +func (o *CreateSITExtensionConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension conflict response has a 3xx status code +func (o *CreateSITExtensionConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension conflict response has a 4xx status code +func (o *CreateSITExtensionConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension conflict response has a 5xx status code +func (o *CreateSITExtensionConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension conflict response a status code equal to that given +func (o *CreateSITExtensionConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create s i t extension conflict response +func (o *CreateSITExtensionConflict) Code() int { + return 409 +} + +func (o *CreateSITExtensionConflict) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionConflict %+v", 409, o.Payload) +} + +func (o *CreateSITExtensionConflict) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionConflict %+v", 409, o.Payload) +} + +func (o *CreateSITExtensionConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateSITExtensionConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionUnprocessableEntity creates a CreateSITExtensionUnprocessableEntity with default headers values +func NewCreateSITExtensionUnprocessableEntity() *CreateSITExtensionUnprocessableEntity { + return &CreateSITExtensionUnprocessableEntity{} +} + +/* +CreateSITExtensionUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateSITExtensionUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create s i t extension unprocessable entity response has a 2xx status code +func (o *CreateSITExtensionUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension unprocessable entity response has a 3xx status code +func (o *CreateSITExtensionUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension unprocessable entity response has a 4xx status code +func (o *CreateSITExtensionUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create s i t extension unprocessable entity response has a 5xx status code +func (o *CreateSITExtensionUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create s i t extension unprocessable entity response a status code equal to that given +func (o *CreateSITExtensionUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create s i t extension unprocessable entity response +func (o *CreateSITExtensionUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateSITExtensionUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateSITExtensionUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateSITExtensionUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateSITExtensionUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateSITExtensionInternalServerError creates a CreateSITExtensionInternalServerError with default headers values +func NewCreateSITExtensionInternalServerError() *CreateSITExtensionInternalServerError { + return &CreateSITExtensionInternalServerError{} +} + +/* +CreateSITExtensionInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateSITExtensionInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create s i t extension internal server error response has a 2xx status code +func (o *CreateSITExtensionInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create s i t extension internal server error response has a 3xx status code +func (o *CreateSITExtensionInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create s i t extension internal server error response has a 4xx status code +func (o *CreateSITExtensionInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create s i t extension internal server error response has a 5xx status code +func (o *CreateSITExtensionInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create s i t extension internal server error response a status code equal to that given +func (o *CreateSITExtensionInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create s i t extension internal server error response +func (o *CreateSITExtensionInternalServerError) Code() int { + return 500 +} + +func (o *CreateSITExtensionInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSITExtensionInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/sit-extensions][%d] createSITExtensionInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateSITExtensionInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateSITExtensionInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..a26a7fd7312 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewDeleteMTOShipmentParams creates a new DeleteMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewDeleteMTOShipmentParams() *DeleteMTOShipmentParams { + return &DeleteMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewDeleteMTOShipmentParamsWithTimeout creates a new DeleteMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewDeleteMTOShipmentParamsWithTimeout(timeout time.Duration) *DeleteMTOShipmentParams { + return &DeleteMTOShipmentParams{ + timeout: timeout, + } +} + +// NewDeleteMTOShipmentParamsWithContext creates a new DeleteMTOShipmentParams object +// with the ability to set a context for a request. +func NewDeleteMTOShipmentParamsWithContext(ctx context.Context) *DeleteMTOShipmentParams { + return &DeleteMTOShipmentParams{ + Context: ctx, + } +} + +// NewDeleteMTOShipmentParamsWithHTTPClient creates a new DeleteMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewDeleteMTOShipmentParamsWithHTTPClient(client *http.Client) *DeleteMTOShipmentParams { + return &DeleteMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +DeleteMTOShipmentParams contains all the parameters to send to the API endpoint + + for the delete m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type DeleteMTOShipmentParams struct { + + /* MtoShipmentID. + + UUID of the shipment to be deleted + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the delete m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMTOShipmentParams) WithDefaults() *DeleteMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the delete m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *DeleteMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) WithTimeout(timeout time.Duration) *DeleteMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) WithContext(ctx context.Context) *DeleteMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) WithHTTPClient(client *http.Client) *DeleteMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMtoShipmentID adds the mtoShipmentID to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *DeleteMTOShipmentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the delete m t o shipment params +func (o *DeleteMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *DeleteMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..2baf1703b9b --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/delete_m_t_o_shipment_responses.go @@ -0,0 +1,535 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// DeleteMTOShipmentReader is a Reader for the DeleteMTOShipment structure. +type DeleteMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *DeleteMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 204: + result := NewDeleteMTOShipmentNoContent() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewDeleteMTOShipmentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewDeleteMTOShipmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewDeleteMTOShipmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewDeleteMTOShipmentConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewDeleteMTOShipmentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewDeleteMTOShipmentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[DELETE /mto-shipments/{mtoShipmentID}] deleteMTOShipment", response, response.Code()) + } +} + +// NewDeleteMTOShipmentNoContent creates a DeleteMTOShipmentNoContent with default headers values +func NewDeleteMTOShipmentNoContent() *DeleteMTOShipmentNoContent { + return &DeleteMTOShipmentNoContent{} +} + +/* +DeleteMTOShipmentNoContent describes a response with status code 204, with default header values. + +Successfully deleted the MTO shipment. +*/ +type DeleteMTOShipmentNoContent struct { +} + +// IsSuccess returns true when this delete m t o shipment no content response has a 2xx status code +func (o *DeleteMTOShipmentNoContent) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this delete m t o shipment no content response has a 3xx status code +func (o *DeleteMTOShipmentNoContent) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment no content response has a 4xx status code +func (o *DeleteMTOShipmentNoContent) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete m t o shipment no content response has a 5xx status code +func (o *DeleteMTOShipmentNoContent) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment no content response a status code equal to that given +func (o *DeleteMTOShipmentNoContent) IsCode(code int) bool { + return code == 204 +} + +// Code gets the status code for the delete m t o shipment no content response +func (o *DeleteMTOShipmentNoContent) Code() int { + return 204 +} + +func (o *DeleteMTOShipmentNoContent) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNoContent ", 204) +} + +func (o *DeleteMTOShipmentNoContent) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNoContent ", 204) +} + +func (o *DeleteMTOShipmentNoContent) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} + +// NewDeleteMTOShipmentBadRequest creates a DeleteMTOShipmentBadRequest with default headers values +func NewDeleteMTOShipmentBadRequest() *DeleteMTOShipmentBadRequest { + return &DeleteMTOShipmentBadRequest{} +} + +/* +DeleteMTOShipmentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type DeleteMTOShipmentBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this delete m t o shipment bad request response has a 2xx status code +func (o *DeleteMTOShipmentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment bad request response has a 3xx status code +func (o *DeleteMTOShipmentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment bad request response has a 4xx status code +func (o *DeleteMTOShipmentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete m t o shipment bad request response has a 5xx status code +func (o *DeleteMTOShipmentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment bad request response a status code equal to that given +func (o *DeleteMTOShipmentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the delete m t o shipment bad request response +func (o *DeleteMTOShipmentBadRequest) Code() int { + return 400 +} + +func (o *DeleteMTOShipmentBadRequest) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteMTOShipmentBadRequest) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *DeleteMTOShipmentBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DeleteMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteMTOShipmentForbidden creates a DeleteMTOShipmentForbidden with default headers values +func NewDeleteMTOShipmentForbidden() *DeleteMTOShipmentForbidden { + return &DeleteMTOShipmentForbidden{} +} + +/* +DeleteMTOShipmentForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type DeleteMTOShipmentForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this delete m t o shipment forbidden response has a 2xx status code +func (o *DeleteMTOShipmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment forbidden response has a 3xx status code +func (o *DeleteMTOShipmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment forbidden response has a 4xx status code +func (o *DeleteMTOShipmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete m t o shipment forbidden response has a 5xx status code +func (o *DeleteMTOShipmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment forbidden response a status code equal to that given +func (o *DeleteMTOShipmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the delete m t o shipment forbidden response +func (o *DeleteMTOShipmentForbidden) Code() int { + return 403 +} + +func (o *DeleteMTOShipmentForbidden) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *DeleteMTOShipmentForbidden) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *DeleteMTOShipmentForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DeleteMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteMTOShipmentNotFound creates a DeleteMTOShipmentNotFound with default headers values +func NewDeleteMTOShipmentNotFound() *DeleteMTOShipmentNotFound { + return &DeleteMTOShipmentNotFound{} +} + +/* +DeleteMTOShipmentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type DeleteMTOShipmentNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this delete m t o shipment not found response has a 2xx status code +func (o *DeleteMTOShipmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment not found response has a 3xx status code +func (o *DeleteMTOShipmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment not found response has a 4xx status code +func (o *DeleteMTOShipmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete m t o shipment not found response has a 5xx status code +func (o *DeleteMTOShipmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment not found response a status code equal to that given +func (o *DeleteMTOShipmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the delete m t o shipment not found response +func (o *DeleteMTOShipmentNotFound) Code() int { + return 404 +} + +func (o *DeleteMTOShipmentNotFound) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *DeleteMTOShipmentNotFound) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *DeleteMTOShipmentNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DeleteMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteMTOShipmentConflict creates a DeleteMTOShipmentConflict with default headers values +func NewDeleteMTOShipmentConflict() *DeleteMTOShipmentConflict { + return &DeleteMTOShipmentConflict{} +} + +/* +DeleteMTOShipmentConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type DeleteMTOShipmentConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this delete m t o shipment conflict response has a 2xx status code +func (o *DeleteMTOShipmentConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment conflict response has a 3xx status code +func (o *DeleteMTOShipmentConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment conflict response has a 4xx status code +func (o *DeleteMTOShipmentConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete m t o shipment conflict response has a 5xx status code +func (o *DeleteMTOShipmentConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment conflict response a status code equal to that given +func (o *DeleteMTOShipmentConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the delete m t o shipment conflict response +func (o *DeleteMTOShipmentConflict) Code() int { + return 409 +} + +func (o *DeleteMTOShipmentConflict) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentConflict %+v", 409, o.Payload) +} + +func (o *DeleteMTOShipmentConflict) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentConflict %+v", 409, o.Payload) +} + +func (o *DeleteMTOShipmentConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *DeleteMTOShipmentConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteMTOShipmentUnprocessableEntity creates a DeleteMTOShipmentUnprocessableEntity with default headers values +func NewDeleteMTOShipmentUnprocessableEntity() *DeleteMTOShipmentUnprocessableEntity { + return &DeleteMTOShipmentUnprocessableEntity{} +} + +/* +DeleteMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type DeleteMTOShipmentUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this delete m t o shipment unprocessable entity response has a 2xx status code +func (o *DeleteMTOShipmentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment unprocessable entity response has a 3xx status code +func (o *DeleteMTOShipmentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment unprocessable entity response has a 4xx status code +func (o *DeleteMTOShipmentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this delete m t o shipment unprocessable entity response has a 5xx status code +func (o *DeleteMTOShipmentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this delete m t o shipment unprocessable entity response a status code equal to that given +func (o *DeleteMTOShipmentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the delete m t o shipment unprocessable entity response +func (o *DeleteMTOShipmentUnprocessableEntity) Code() int { + return 422 +} + +func (o *DeleteMTOShipmentUnprocessableEntity) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteMTOShipmentUnprocessableEntity) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *DeleteMTOShipmentUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *DeleteMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewDeleteMTOShipmentInternalServerError creates a DeleteMTOShipmentInternalServerError with default headers values +func NewDeleteMTOShipmentInternalServerError() *DeleteMTOShipmentInternalServerError { + return &DeleteMTOShipmentInternalServerError{} +} + +/* +DeleteMTOShipmentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type DeleteMTOShipmentInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this delete m t o shipment internal server error response has a 2xx status code +func (o *DeleteMTOShipmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this delete m t o shipment internal server error response has a 3xx status code +func (o *DeleteMTOShipmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this delete m t o shipment internal server error response has a 4xx status code +func (o *DeleteMTOShipmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this delete m t o shipment internal server error response has a 5xx status code +func (o *DeleteMTOShipmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this delete m t o shipment internal server error response a status code equal to that given +func (o *DeleteMTOShipmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the delete m t o shipment internal server error response +func (o *DeleteMTOShipmentInternalServerError) Code() int { + return 500 +} + +func (o *DeleteMTOShipmentInternalServerError) Error() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteMTOShipmentInternalServerError) String() string { + return fmt.Sprintf("[DELETE /mto-shipments/{mtoShipmentID}][%d] deleteMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *DeleteMTOShipmentInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *DeleteMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go b/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go new file mode 100644 index 00000000000..2051172f1d1 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/mto_shipment_client.go @@ -0,0 +1,524 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto shipment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto shipment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateMTOAgent(params *CreateMTOAgentParams, opts ...ClientOption) (*CreateMTOAgentOK, error) + + CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) error + + CreateSITExtension(params *CreateSITExtensionParams, opts ...ClientOption) (*CreateSITExtensionCreated, error) + + DeleteMTOShipment(params *DeleteMTOShipmentParams, opts ...ClientOption) (*DeleteMTOShipmentNoContent, error) + + UpdateMTOAgent(params *UpdateMTOAgentParams, opts ...ClientOption) (*UpdateMTOAgentOK, error) + + UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) error + + UpdateMTOShipmentAddress(params *UpdateMTOShipmentAddressParams, opts ...ClientOption) (*UpdateMTOShipmentAddressOK, error) + + UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) + + UpdateReweigh(params *UpdateReweighParams, opts ...ClientOption) (*UpdateReweighOK, error) + + UpdateShipmentDestinationAddress(params *UpdateShipmentDestinationAddressParams, opts ...ClientOption) (*UpdateShipmentDestinationAddressCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateMTOAgent creates m t o agent + + ### Functionality + +This endpoint is used to **create** and add agents for an existing MTO Shipment. Only the fields being modified need to be sent in the request body. + +### Errors +The agent must always have a name and at least one method of contact (either `email` or `phone`). + +The agent must be associated with the MTO shipment passed in the url. + +The shipment should be associated with an MTO that is available to the Pime. +If the caller requests a new agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. +*/ +func (a *Client) CreateMTOAgent(params *CreateMTOAgentParams, opts ...ClientOption) (*CreateMTOAgentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMTOAgentParams() + } + op := &runtime.ClientOperation{ + ID: "createMTOAgent", + Method: "POST", + PathPattern: "/mto-shipments/{mtoShipmentID}/agents", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMTOAgentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateMTOAgentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createMTOAgent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CreateMTOShipment creates m t o shipment + + _[Deprecated: this endpoint was deprecated on August 5th, 2024]_ + +Please use the new endpoint at `/prime/v3/createMTOShipment` instead. +*/ +func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "createMTOShipment", + Method: "POST", + PathPattern: "/mto-shipments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* + CreateSITExtension creates s i t extension + + ### Functionality + +This endpoint creates a storage in transit (SIT) extension request for a shipment. A SIT extension request is a request an +increase in the shipment day allowance for the number of days a shipment is allowed to be in SIT. The total SIT day allowance +includes time spent in both origin and destination SIT. +*/ +func (a *Client) CreateSITExtension(params *CreateSITExtensionParams, opts ...ClientOption) (*CreateSITExtensionCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateSITExtensionParams() + } + op := &runtime.ClientOperation{ + ID: "createSITExtension", + Method: "POST", + PathPattern: "/mto-shipments/{mtoShipmentID}/sit-extensions", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateSITExtensionReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateSITExtensionCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createSITExtension: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + DeleteMTOShipment deletes m t o shipment + + ### Functionality + +This endpoint deletes an individual shipment by ID. + +### Errors +* The mtoShipment should be associated with an MTO that is available to prime. +* The mtoShipment must be a PPM shipment. +* Counseling should not have already been completed for the associated MTO. +*/ +func (a *Client) DeleteMTOShipment(params *DeleteMTOShipmentParams, opts ...ClientOption) (*DeleteMTOShipmentNoContent, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewDeleteMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "deleteMTOShipment", + Method: "DELETE", + PathPattern: "/mto-shipments/{mtoShipmentID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &DeleteMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*DeleteMTOShipmentNoContent) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for deleteMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOAgent updates m t o agent + + ### Functionality + +This endpoint is used to **update** the agents for an MTO Shipment. Only the fields being modified need to be sent in the request body. + +### Errors: +The agent must always have a name and at least one method of contact (either `email` or `phone`). + +The agent must be associated with the MTO shipment passed in the url. + +The shipment should be associated with an MTO that is available to the Prime. +If the caller requests an update to an agent, and the shipment is not on an available MTO, the caller will receive a **NotFound** response. +*/ +func (a *Client) UpdateMTOAgent(params *UpdateMTOAgentParams, opts ...ClientOption) (*UpdateMTOAgentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOAgentParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOAgent", + Method: "PUT", + PathPattern: "/mto-shipments/{mtoShipmentID}/agents/{agentID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOAgentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOAgentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOAgent: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOShipment updates m t o shipment + + _[Deprecated: this endpoint was deprecated on August 5th, 2024]_ + +Please use the new endpoint at `/prime/v3/updateMTOShipment` instead. +*/ +func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) error { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipment", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + _, err := a.transport.Submit(op) + if err != nil { + return err + } + return nil +} + +/* + UpdateMTOShipmentAddress updates m t o shipment address + + ### Functionality + +This endpoint is used to **update** the pickup, secondary, and delivery addresses on an MTO Shipment. mto-shipments/{mtoShipmentID}/shipment-address-updates is for updating a delivery address. The address details completely replace the original, except for the UUID. +Therefore a complete address should be sent in the request. +When a delivery address on a shipment is updated, the destination SIT service items address ID will also be updated so that shipment and service item final destinations match. + +This endpoint **cannot create** an address. +To create an address on an MTO shipment, the caller must use [updateMTOShipment](#operation/updateMTOShipment) as the parent shipment has to be updated with the appropriate link to the address. + +### Errors +The address must be associated with the mtoShipment passed in the url. +In other words, it should be listed as pickupAddress, destinationAddress, secondaryPickupAddress or secondaryDeliveryAddress on the mtoShipment provided. +If it is not, caller will receive a **Conflict** Error. + +The mtoShipment should be associated with an MTO that is available to prime. +If the caller requests an update to an address, and the shipment is not on an available MTO, the caller will receive a **NotFound** Error. +*/ +func (a *Client) UpdateMTOShipmentAddress(params *UpdateMTOShipmentAddressParams, opts ...ClientOption) (*UpdateMTOShipmentAddressOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentAddressParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipmentAddress", + Method: "PUT", + PathPattern: "/mto-shipments/{mtoShipmentID}/addresses/{addressID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOShipmentAddressOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOShipmentAddress: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOShipmentStatus updates m t o shipment status + + ### Functionality + +This endpoint should be used by the Prime to confirm the cancellation of a shipment. It allows the shipment +status to be changed to "CANCELED." Currently, the Prime cannot update the shipment to any other status. +*/ +func (a *Client) UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentStatusParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipmentStatus", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOShipmentStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOShipmentStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateReweigh updates reweigh + + ### Functionality + +This endpoint can be used to update a reweigh with a new weight or to provide the reason why a reweigh did not occur. +Only one of weight or verificationReason should be sent in the request body. + +A reweigh is the second recorded weight for a shipment, as validated by certified weight tickets. Applies to one shipment. +A reweigh can be triggered automatically, or requested by the customer or transportation office. Not all shipments are reweighed, +so not all shipments will have a reweigh weight. +*/ +func (a *Client) UpdateReweigh(params *UpdateReweighParams, opts ...ClientOption) (*UpdateReweighOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateReweighParams() + } + op := &runtime.ClientOperation{ + ID: "updateReweigh", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}/reweighs/{reweighID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateReweighReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateReweighOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateReweigh: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateShipmentDestinationAddress updates shipment destination address + + ### Functionality + +This endpoint is used so the Prime can request an **update** for the delivery address on an MTO Shipment, +after the delivery address has already been approved. + +This endpoint and operation only supports the following shipment types: +- HHG +- NTSR + +For HHG shipments, if automatically approved or TOO approves, this will update the final delivery address values for destination SIT service items to be the same as the changed delivery address that was approved. + +Address updates will be automatically approved unless they change: + - The service area + - Mileage bracket for direct delivery + - the address and the distance between the old and new address is > 50 + - Domestic Short Haul to Domestic Line Haul or vice versa + - Shipments that start and end in one ZIP3 use Short Haul pricing + - Shipments that start and end in different ZIP3s use Line Haul pricing + +For those, changes will require TOO approval. +*/ +func (a *Client) UpdateShipmentDestinationAddress(params *UpdateShipmentDestinationAddressParams, opts ...ClientOption) (*UpdateShipmentDestinationAddressCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateShipmentDestinationAddressParams() + } + op := &runtime.ClientOperation{ + ID: "updateShipmentDestinationAddress", + Method: "POST", + PathPattern: "/mto-shipments/{mtoShipmentID}/shipment-address-updates", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateShipmentDestinationAddressReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateShipmentDestinationAddressCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateShipmentDestinationAddress: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go new file mode 100644 index 00000000000..611cd7b791b --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOAgentParams creates a new UpdateMTOAgentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOAgentParams() *UpdateMTOAgentParams { + return &UpdateMTOAgentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOAgentParamsWithTimeout creates a new UpdateMTOAgentParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOAgentParamsWithTimeout(timeout time.Duration) *UpdateMTOAgentParams { + return &UpdateMTOAgentParams{ + timeout: timeout, + } +} + +// NewUpdateMTOAgentParamsWithContext creates a new UpdateMTOAgentParams object +// with the ability to set a context for a request. +func NewUpdateMTOAgentParamsWithContext(ctx context.Context) *UpdateMTOAgentParams { + return &UpdateMTOAgentParams{ + Context: ctx, + } +} + +// NewUpdateMTOAgentParamsWithHTTPClient creates a new UpdateMTOAgentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOAgentParamsWithHTTPClient(client *http.Client) *UpdateMTOAgentParams { + return &UpdateMTOAgentParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOAgentParams contains all the parameters to send to the API endpoint + + for the update m t o agent operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOAgentParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + /* AgentID. + + UUID of the agent being updated + + Format: uuid + */ + AgentID strfmt.UUID + + // Body. + Body *primemessages.MTOAgent + + /* MtoShipmentID. + + UUID of the shipment associated with the agent + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOAgentParams) WithDefaults() *UpdateMTOAgentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o agent params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOAgentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o agent params +func (o *UpdateMTOAgentParams) WithTimeout(timeout time.Duration) *UpdateMTOAgentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o agent params +func (o *UpdateMTOAgentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o agent params +func (o *UpdateMTOAgentParams) WithContext(ctx context.Context) *UpdateMTOAgentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o agent params +func (o *UpdateMTOAgentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o agent params +func (o *UpdateMTOAgentParams) WithHTTPClient(client *http.Client) *UpdateMTOAgentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o agent params +func (o *UpdateMTOAgentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o agent params +func (o *UpdateMTOAgentParams) WithIfMatch(ifMatch string) *UpdateMTOAgentParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o agent params +func (o *UpdateMTOAgentParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithAgentID adds the agentID to the update m t o agent params +func (o *UpdateMTOAgentParams) WithAgentID(agentID strfmt.UUID) *UpdateMTOAgentParams { + o.SetAgentID(agentID) + return o +} + +// SetAgentID adds the agentId to the update m t o agent params +func (o *UpdateMTOAgentParams) SetAgentID(agentID strfmt.UUID) { + o.AgentID = agentID +} + +// WithBody adds the body to the update m t o agent params +func (o *UpdateMTOAgentParams) WithBody(body *primemessages.MTOAgent) *UpdateMTOAgentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o agent params +func (o *UpdateMTOAgentParams) SetBody(body *primemessages.MTOAgent) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o agent params +func (o *UpdateMTOAgentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOAgentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o agent params +func (o *UpdateMTOAgentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOAgentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + + // path param agentID + if err := r.SetPathParam("agentID", o.AgentID.String()); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go new file mode 100644 index 00000000000..fddd31990bc --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_agent_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOAgentReader is a Reader for the UpdateMTOAgent structure. +type UpdateMTOAgentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOAgentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOAgentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOAgentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOAgentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOAgentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOAgentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOAgentPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOAgentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOAgentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}] updateMTOAgent", response, response.Code()) + } +} + +// NewUpdateMTOAgentOK creates a UpdateMTOAgentOK with default headers values +func NewUpdateMTOAgentOK() *UpdateMTOAgentOK { + return &UpdateMTOAgentOK{} +} + +/* +UpdateMTOAgentOK describes a response with status code 200, with default header values. + +Successfully updated the agent. +*/ +type UpdateMTOAgentOK struct { + Payload *primemessages.MTOAgent +} + +// IsSuccess returns true when this update m t o agent o k response has a 2xx status code +func (o *UpdateMTOAgentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o agent o k response has a 3xx status code +func (o *UpdateMTOAgentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent o k response has a 4xx status code +func (o *UpdateMTOAgentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o agent o k response has a 5xx status code +func (o *UpdateMTOAgentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent o k response a status code equal to that given +func (o *UpdateMTOAgentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o agent o k response +func (o *UpdateMTOAgentOK) Code() int { + return 200 +} + +func (o *UpdateMTOAgentOK) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOAgentOK) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOAgentOK) GetPayload() *primemessages.MTOAgent { + return o.Payload +} + +func (o *UpdateMTOAgentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.MTOAgent) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentBadRequest creates a UpdateMTOAgentBadRequest with default headers values +func NewUpdateMTOAgentBadRequest() *UpdateMTOAgentBadRequest { + return &UpdateMTOAgentBadRequest{} +} + +/* +UpdateMTOAgentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOAgentBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o agent bad request response has a 2xx status code +func (o *UpdateMTOAgentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent bad request response has a 3xx status code +func (o *UpdateMTOAgentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent bad request response has a 4xx status code +func (o *UpdateMTOAgentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent bad request response has a 5xx status code +func (o *UpdateMTOAgentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent bad request response a status code equal to that given +func (o *UpdateMTOAgentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o agent bad request response +func (o *UpdateMTOAgentBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOAgentBadRequest) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOAgentBadRequest) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOAgentBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOAgentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentUnauthorized creates a UpdateMTOAgentUnauthorized with default headers values +func NewUpdateMTOAgentUnauthorized() *UpdateMTOAgentUnauthorized { + return &UpdateMTOAgentUnauthorized{} +} + +/* +UpdateMTOAgentUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOAgentUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o agent unauthorized response has a 2xx status code +func (o *UpdateMTOAgentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent unauthorized response has a 3xx status code +func (o *UpdateMTOAgentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent unauthorized response has a 4xx status code +func (o *UpdateMTOAgentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent unauthorized response has a 5xx status code +func (o *UpdateMTOAgentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent unauthorized response a status code equal to that given +func (o *UpdateMTOAgentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o agent unauthorized response +func (o *UpdateMTOAgentUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOAgentUnauthorized) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOAgentUnauthorized) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOAgentUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOAgentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentForbidden creates a UpdateMTOAgentForbidden with default headers values +func NewUpdateMTOAgentForbidden() *UpdateMTOAgentForbidden { + return &UpdateMTOAgentForbidden{} +} + +/* +UpdateMTOAgentForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOAgentForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o agent forbidden response has a 2xx status code +func (o *UpdateMTOAgentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent forbidden response has a 3xx status code +func (o *UpdateMTOAgentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent forbidden response has a 4xx status code +func (o *UpdateMTOAgentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent forbidden response has a 5xx status code +func (o *UpdateMTOAgentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent forbidden response a status code equal to that given +func (o *UpdateMTOAgentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o agent forbidden response +func (o *UpdateMTOAgentForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOAgentForbidden) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOAgentForbidden) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOAgentForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOAgentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentNotFound creates a UpdateMTOAgentNotFound with default headers values +func NewUpdateMTOAgentNotFound() *UpdateMTOAgentNotFound { + return &UpdateMTOAgentNotFound{} +} + +/* +UpdateMTOAgentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOAgentNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o agent not found response has a 2xx status code +func (o *UpdateMTOAgentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent not found response has a 3xx status code +func (o *UpdateMTOAgentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent not found response has a 4xx status code +func (o *UpdateMTOAgentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent not found response has a 5xx status code +func (o *UpdateMTOAgentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent not found response a status code equal to that given +func (o *UpdateMTOAgentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o agent not found response +func (o *UpdateMTOAgentNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOAgentNotFound) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOAgentNotFound) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOAgentNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOAgentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentPreconditionFailed creates a UpdateMTOAgentPreconditionFailed with default headers values +func NewUpdateMTOAgentPreconditionFailed() *UpdateMTOAgentPreconditionFailed { + return &UpdateMTOAgentPreconditionFailed{} +} + +/* +UpdateMTOAgentPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOAgentPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o agent precondition failed response has a 2xx status code +func (o *UpdateMTOAgentPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent precondition failed response has a 3xx status code +func (o *UpdateMTOAgentPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent precondition failed response has a 4xx status code +func (o *UpdateMTOAgentPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent precondition failed response has a 5xx status code +func (o *UpdateMTOAgentPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent precondition failed response a status code equal to that given +func (o *UpdateMTOAgentPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o agent precondition failed response +func (o *UpdateMTOAgentPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOAgentPreconditionFailed) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOAgentPreconditionFailed) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOAgentPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOAgentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentUnprocessableEntity creates a UpdateMTOAgentUnprocessableEntity with default headers values +func NewUpdateMTOAgentUnprocessableEntity() *UpdateMTOAgentUnprocessableEntity { + return &UpdateMTOAgentUnprocessableEntity{} +} + +/* +UpdateMTOAgentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOAgentUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update m t o agent unprocessable entity response has a 2xx status code +func (o *UpdateMTOAgentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent unprocessable entity response has a 3xx status code +func (o *UpdateMTOAgentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent unprocessable entity response has a 4xx status code +func (o *UpdateMTOAgentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o agent unprocessable entity response has a 5xx status code +func (o *UpdateMTOAgentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o agent unprocessable entity response a status code equal to that given +func (o *UpdateMTOAgentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o agent unprocessable entity response +func (o *UpdateMTOAgentUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOAgentUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOAgentUnprocessableEntity) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOAgentUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOAgentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOAgentInternalServerError creates a UpdateMTOAgentInternalServerError with default headers values +func NewUpdateMTOAgentInternalServerError() *UpdateMTOAgentInternalServerError { + return &UpdateMTOAgentInternalServerError{} +} + +/* +UpdateMTOAgentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOAgentInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update m t o agent internal server error response has a 2xx status code +func (o *UpdateMTOAgentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o agent internal server error response has a 3xx status code +func (o *UpdateMTOAgentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o agent internal server error response has a 4xx status code +func (o *UpdateMTOAgentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o agent internal server error response has a 5xx status code +func (o *UpdateMTOAgentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o agent internal server error response a status code equal to that given +func (o *UpdateMTOAgentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o agent internal server error response +func (o *UpdateMTOAgentInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOAgentInternalServerError) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOAgentInternalServerError) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/agents/{agentID}][%d] updateMTOAgentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOAgentInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateMTOAgentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go new file mode 100644 index 00000000000..332c013d92c --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOShipmentAddressParams creates a new UpdateMTOShipmentAddressParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentAddressParams() *UpdateMTOShipmentAddressParams { + return &UpdateMTOShipmentAddressParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentAddressParamsWithTimeout creates a new UpdateMTOShipmentAddressParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentAddressParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentAddressParams { + return &UpdateMTOShipmentAddressParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentAddressParamsWithContext creates a new UpdateMTOShipmentAddressParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentAddressParamsWithContext(ctx context.Context) *UpdateMTOShipmentAddressParams { + return &UpdateMTOShipmentAddressParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentAddressParamsWithHTTPClient creates a new UpdateMTOShipmentAddressParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentAddressParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentAddressParams { + return &UpdateMTOShipmentAddressParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentAddressParams contains all the parameters to send to the API endpoint + + for the update m t o shipment address operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentAddressParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + /* AddressID. + + UUID of the address being updated + + Format: uuid + */ + AddressID strfmt.UUID + + // Body. + Body *primemessages.Address + + /* MtoShipmentID. + + UUID of the shipment associated with the address + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment address params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentAddressParams) WithDefaults() *UpdateMTOShipmentAddressParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment address params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentAddressParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithContext(ctx context.Context) *UpdateMTOShipmentAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentAddressParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithAddressID adds the addressID to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithAddressID(addressID strfmt.UUID) *UpdateMTOShipmentAddressParams { + o.SetAddressID(addressID) + return o +} + +// SetAddressID adds the addressId to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetAddressID(addressID strfmt.UUID) { + o.AddressID = addressID +} + +// WithBody adds the body to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithBody(body *primemessages.Address) *UpdateMTOShipmentAddressParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetBody(body *primemessages.Address) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentAddressParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment address params +func (o *UpdateMTOShipmentAddressParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + + // path param addressID + if err := r.SetPathParam("addressID", o.AddressID.String()); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go new file mode 100644 index 00000000000..cd19899d62b --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_address_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOShipmentAddressReader is a Reader for the UpdateMTOShipmentAddress structure. +type UpdateMTOShipmentAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOShipmentAddressOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOShipmentAddressBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOShipmentAddressUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOShipmentAddressForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOShipmentAddressNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOShipmentAddressConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOShipmentAddressPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOShipmentAddressUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOShipmentAddressInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}] updateMTOShipmentAddress", response, response.Code()) + } +} + +// NewUpdateMTOShipmentAddressOK creates a UpdateMTOShipmentAddressOK with default headers values +func NewUpdateMTOShipmentAddressOK() *UpdateMTOShipmentAddressOK { + return &UpdateMTOShipmentAddressOK{} +} + +/* +UpdateMTOShipmentAddressOK describes a response with status code 200, with default header values. + +Successfully updated the address. +*/ +type UpdateMTOShipmentAddressOK struct { + Payload *primemessages.Address +} + +// IsSuccess returns true when this update m t o shipment address o k response has a 2xx status code +func (o *UpdateMTOShipmentAddressOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o shipment address o k response has a 3xx status code +func (o *UpdateMTOShipmentAddressOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address o k response has a 4xx status code +func (o *UpdateMTOShipmentAddressOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment address o k response has a 5xx status code +func (o *UpdateMTOShipmentAddressOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address o k response a status code equal to that given +func (o *UpdateMTOShipmentAddressOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o shipment address o k response +func (o *UpdateMTOShipmentAddressOK) Code() int { + return 200 +} + +func (o *UpdateMTOShipmentAddressOK) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentAddressOK) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentAddressOK) GetPayload() *primemessages.Address { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Address) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressBadRequest creates a UpdateMTOShipmentAddressBadRequest with default headers values +func NewUpdateMTOShipmentAddressBadRequest() *UpdateMTOShipmentAddressBadRequest { + return &UpdateMTOShipmentAddressBadRequest{} +} + +/* +UpdateMTOShipmentAddressBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOShipmentAddressBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address bad request response has a 2xx status code +func (o *UpdateMTOShipmentAddressBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address bad request response has a 3xx status code +func (o *UpdateMTOShipmentAddressBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address bad request response has a 4xx status code +func (o *UpdateMTOShipmentAddressBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address bad request response has a 5xx status code +func (o *UpdateMTOShipmentAddressBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address bad request response a status code equal to that given +func (o *UpdateMTOShipmentAddressBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o shipment address bad request response +func (o *UpdateMTOShipmentAddressBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOShipmentAddressBadRequest) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentAddressBadRequest) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentAddressBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressUnauthorized creates a UpdateMTOShipmentAddressUnauthorized with default headers values +func NewUpdateMTOShipmentAddressUnauthorized() *UpdateMTOShipmentAddressUnauthorized { + return &UpdateMTOShipmentAddressUnauthorized{} +} + +/* +UpdateMTOShipmentAddressUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentAddressUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address unauthorized response has a 2xx status code +func (o *UpdateMTOShipmentAddressUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address unauthorized response has a 3xx status code +func (o *UpdateMTOShipmentAddressUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address unauthorized response has a 4xx status code +func (o *UpdateMTOShipmentAddressUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address unauthorized response has a 5xx status code +func (o *UpdateMTOShipmentAddressUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address unauthorized response a status code equal to that given +func (o *UpdateMTOShipmentAddressUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o shipment address unauthorized response +func (o *UpdateMTOShipmentAddressUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOShipmentAddressUnauthorized) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentAddressUnauthorized) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentAddressUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressForbidden creates a UpdateMTOShipmentAddressForbidden with default headers values +func NewUpdateMTOShipmentAddressForbidden() *UpdateMTOShipmentAddressForbidden { + return &UpdateMTOShipmentAddressForbidden{} +} + +/* +UpdateMTOShipmentAddressForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentAddressForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address forbidden response has a 2xx status code +func (o *UpdateMTOShipmentAddressForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address forbidden response has a 3xx status code +func (o *UpdateMTOShipmentAddressForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address forbidden response has a 4xx status code +func (o *UpdateMTOShipmentAddressForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address forbidden response has a 5xx status code +func (o *UpdateMTOShipmentAddressForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address forbidden response a status code equal to that given +func (o *UpdateMTOShipmentAddressForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o shipment address forbidden response +func (o *UpdateMTOShipmentAddressForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOShipmentAddressForbidden) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentAddressForbidden) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentAddressForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressNotFound creates a UpdateMTOShipmentAddressNotFound with default headers values +func NewUpdateMTOShipmentAddressNotFound() *UpdateMTOShipmentAddressNotFound { + return &UpdateMTOShipmentAddressNotFound{} +} + +/* +UpdateMTOShipmentAddressNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOShipmentAddressNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address not found response has a 2xx status code +func (o *UpdateMTOShipmentAddressNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address not found response has a 3xx status code +func (o *UpdateMTOShipmentAddressNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address not found response has a 4xx status code +func (o *UpdateMTOShipmentAddressNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address not found response has a 5xx status code +func (o *UpdateMTOShipmentAddressNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address not found response a status code equal to that given +func (o *UpdateMTOShipmentAddressNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o shipment address not found response +func (o *UpdateMTOShipmentAddressNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOShipmentAddressNotFound) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentAddressNotFound) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentAddressNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressConflict creates a UpdateMTOShipmentAddressConflict with default headers values +func NewUpdateMTOShipmentAddressConflict() *UpdateMTOShipmentAddressConflict { + return &UpdateMTOShipmentAddressConflict{} +} + +/* +UpdateMTOShipmentAddressConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateMTOShipmentAddressConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address conflict response has a 2xx status code +func (o *UpdateMTOShipmentAddressConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address conflict response has a 3xx status code +func (o *UpdateMTOShipmentAddressConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address conflict response has a 4xx status code +func (o *UpdateMTOShipmentAddressConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address conflict response has a 5xx status code +func (o *UpdateMTOShipmentAddressConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address conflict response a status code equal to that given +func (o *UpdateMTOShipmentAddressConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o shipment address conflict response +func (o *UpdateMTOShipmentAddressConflict) Code() int { + return 409 +} + +func (o *UpdateMTOShipmentAddressConflict) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentAddressConflict) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentAddressConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressPreconditionFailed creates a UpdateMTOShipmentAddressPreconditionFailed with default headers values +func NewUpdateMTOShipmentAddressPreconditionFailed() *UpdateMTOShipmentAddressPreconditionFailed { + return &UpdateMTOShipmentAddressPreconditionFailed{} +} + +/* +UpdateMTOShipmentAddressPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOShipmentAddressPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment address precondition failed response has a 2xx status code +func (o *UpdateMTOShipmentAddressPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address precondition failed response has a 3xx status code +func (o *UpdateMTOShipmentAddressPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address precondition failed response has a 4xx status code +func (o *UpdateMTOShipmentAddressPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address precondition failed response has a 5xx status code +func (o *UpdateMTOShipmentAddressPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address precondition failed response a status code equal to that given +func (o *UpdateMTOShipmentAddressPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o shipment address precondition failed response +func (o *UpdateMTOShipmentAddressPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOShipmentAddressPreconditionFailed) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentAddressPreconditionFailed) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentAddressPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressUnprocessableEntity creates a UpdateMTOShipmentAddressUnprocessableEntity with default headers values +func NewUpdateMTOShipmentAddressUnprocessableEntity() *UpdateMTOShipmentAddressUnprocessableEntity { + return &UpdateMTOShipmentAddressUnprocessableEntity{} +} + +/* +UpdateMTOShipmentAddressUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOShipmentAddressUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update m t o shipment address unprocessable entity response has a 2xx status code +func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address unprocessable entity response has a 3xx status code +func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address unprocessable entity response has a 4xx status code +func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment address unprocessable entity response has a 5xx status code +func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment address unprocessable entity response a status code equal to that given +func (o *UpdateMTOShipmentAddressUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o shipment address unprocessable entity response +func (o *UpdateMTOShipmentAddressUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOShipmentAddressUnprocessableEntity) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentAddressUnprocessableEntity) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentAddressUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentAddressInternalServerError creates a UpdateMTOShipmentAddressInternalServerError with default headers values +func NewUpdateMTOShipmentAddressInternalServerError() *UpdateMTOShipmentAddressInternalServerError { + return &UpdateMTOShipmentAddressInternalServerError{} +} + +/* +UpdateMTOShipmentAddressInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOShipmentAddressInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update m t o shipment address internal server error response has a 2xx status code +func (o *UpdateMTOShipmentAddressInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment address internal server error response has a 3xx status code +func (o *UpdateMTOShipmentAddressInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment address internal server error response has a 4xx status code +func (o *UpdateMTOShipmentAddressInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment address internal server error response has a 5xx status code +func (o *UpdateMTOShipmentAddressInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o shipment address internal server error response a status code equal to that given +func (o *UpdateMTOShipmentAddressInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o shipment address internal server error response +func (o *UpdateMTOShipmentAddressInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOShipmentAddressInternalServerError) Error() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentAddressInternalServerError) String() string { + return fmt.Sprintf("[PUT /mto-shipments/{mtoShipmentID}/addresses/{addressID}][%d] updateMTOShipmentAddressInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentAddressInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateMTOShipmentAddressInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..f31813c4262 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the update m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentParams struct { + + /* MtoShipmentID. + + UUID of the shipment being updated. + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..5782f7b66ac --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,88 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. +type UpdateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 410: + result := NewUpdateMTOShipmentGone() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) + } +} + +// NewUpdateMTOShipmentGone creates a UpdateMTOShipmentGone with default headers values +func NewUpdateMTOShipmentGone() *UpdateMTOShipmentGone { + return &UpdateMTOShipmentGone{} +} + +/* +UpdateMTOShipmentGone describes a response with status code 410, with default header values. + +This endpoint is deprecated. Please use `/prime/v3/updateMTOShipment` instead. +*/ +type UpdateMTOShipmentGone struct { +} + +// IsSuccess returns true when this update m t o shipment gone response has a 2xx status code +func (o *UpdateMTOShipmentGone) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment gone response has a 3xx status code +func (o *UpdateMTOShipmentGone) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment gone response has a 4xx status code +func (o *UpdateMTOShipmentGone) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment gone response has a 5xx status code +func (o *UpdateMTOShipmentGone) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment gone response a status code equal to that given +func (o *UpdateMTOShipmentGone) IsCode(code int) bool { + return code == 410 +} + +// Code gets the status code for the update m t o shipment gone response +func (o *UpdateMTOShipmentGone) Code() int { + return 410 +} + +func (o *UpdateMTOShipmentGone) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentGone ", 410) +} + +func (o *UpdateMTOShipmentGone) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentGone ", 410) +} + +func (o *UpdateMTOShipmentGone) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go new file mode 100644 index 00000000000..9d2b81b6c2e --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentStatusParams() *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentStatusParamsWithTimeout creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentStatusParamsWithContext creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentStatusParamsWithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentStatusParamsWithHTTPClient creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentStatusParams contains all the parameters to send to the API endpoint + + for the update m t o shipment status operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentStatusParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *primemessages.UpdateMTOShipmentStatus + + /* MtoShipmentID. + + UUID of the shipment associated with the agent + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentStatusParams) WithDefaults() *UpdateMTOShipmentStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentStatusParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithBody(body *primemessages.UpdateMTOShipmentStatus) *UpdateMTOShipmentStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetBody(body *primemessages.UpdateMTOShipmentStatus) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentStatusParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go new file mode 100644 index 00000000000..45dd6401c29 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_m_t_o_shipment_status_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateMTOShipmentStatusReader is a Reader for the UpdateMTOShipmentStatus structure. +type UpdateMTOShipmentStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOShipmentStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOShipmentStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOShipmentStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOShipmentStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOShipmentStatusNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOShipmentStatusConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOShipmentStatusPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOShipmentStatusUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOShipmentStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/status] updateMTOShipmentStatus", response, response.Code()) + } +} + +// NewUpdateMTOShipmentStatusOK creates a UpdateMTOShipmentStatusOK with default headers values +func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { + return &UpdateMTOShipmentStatusOK{} +} + +/* +UpdateMTOShipmentStatusOK describes a response with status code 200, with default header values. + +Successfully updated the shipment's status. +*/ +type UpdateMTOShipmentStatusOK struct { + Payload *primemessages.MTOShipment +} + +// IsSuccess returns true when this update m t o shipment status o k response has a 2xx status code +func (o *UpdateMTOShipmentStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o shipment status o k response has a 3xx status code +func (o *UpdateMTOShipmentStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status o k response has a 4xx status code +func (o *UpdateMTOShipmentStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment status o k response has a 5xx status code +func (o *UpdateMTOShipmentStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status o k response a status code equal to that given +func (o *UpdateMTOShipmentStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) Code() int { + return 200 +} + +func (o *UpdateMTOShipmentStatusOK) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentStatusOK) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentStatusOK) GetPayload() *primemessages.MTOShipment { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusBadRequest creates a UpdateMTOShipmentStatusBadRequest with default headers values +func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { + return &UpdateMTOShipmentStatusBadRequest{} +} + +/* +UpdateMTOShipmentStatusBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOShipmentStatusBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status bad request response has a 2xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status bad request response has a 3xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status bad request response has a 4xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status bad request response has a 5xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status bad request response a status code equal to that given +func (o *UpdateMTOShipmentStatusBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOShipmentStatusBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentStatusBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentStatusBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusUnauthorized creates a UpdateMTOShipmentStatusUnauthorized with default headers values +func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { + return &UpdateMTOShipmentStatusUnauthorized{} +} + +/* +UpdateMTOShipmentStatusUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentStatusUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status unauthorized response has a 2xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status unauthorized response has a 3xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status unauthorized response has a 4xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status unauthorized response has a 5xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status unauthorized response a status code equal to that given +func (o *UpdateMTOShipmentStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOShipmentStatusUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusForbidden creates a UpdateMTOShipmentStatusForbidden with default headers values +func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { + return &UpdateMTOShipmentStatusForbidden{} +} + +/* +UpdateMTOShipmentStatusForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentStatusForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status forbidden response has a 2xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status forbidden response has a 3xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status forbidden response has a 4xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status forbidden response has a 5xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status forbidden response a status code equal to that given +func (o *UpdateMTOShipmentStatusForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOShipmentStatusForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentStatusForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentStatusForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusNotFound creates a UpdateMTOShipmentStatusNotFound with default headers values +func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { + return &UpdateMTOShipmentStatusNotFound{} +} + +/* +UpdateMTOShipmentStatusNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOShipmentStatusNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status not found response has a 2xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status not found response has a 3xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status not found response has a 4xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status not found response has a 5xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status not found response a status code equal to that given +func (o *UpdateMTOShipmentStatusNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOShipmentStatusNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentStatusNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentStatusNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusConflict creates a UpdateMTOShipmentStatusConflict with default headers values +func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { + return &UpdateMTOShipmentStatusConflict{} +} + +/* +UpdateMTOShipmentStatusConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateMTOShipmentStatusConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status conflict response has a 2xx status code +func (o *UpdateMTOShipmentStatusConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status conflict response has a 3xx status code +func (o *UpdateMTOShipmentStatusConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status conflict response has a 4xx status code +func (o *UpdateMTOShipmentStatusConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status conflict response has a 5xx status code +func (o *UpdateMTOShipmentStatusConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status conflict response a status code equal to that given +func (o *UpdateMTOShipmentStatusConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) Code() int { + return 409 +} + +func (o *UpdateMTOShipmentStatusConflict) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentStatusConflict) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentStatusConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusPreconditionFailed creates a UpdateMTOShipmentStatusPreconditionFailed with default headers values +func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { + return &UpdateMTOShipmentStatusPreconditionFailed{} +} + +/* +UpdateMTOShipmentStatusPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOShipmentStatusPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status precondition failed response has a 2xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status precondition failed response has a 3xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status precondition failed response has a 4xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status precondition failed response has a 5xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status precondition failed response a status code equal to that given +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusUnprocessableEntity creates a UpdateMTOShipmentStatusUnprocessableEntity with default headers values +func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { + return &UpdateMTOShipmentStatusUnprocessableEntity{} +} + +/* +UpdateMTOShipmentStatusUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOShipmentStatusUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update m t o shipment status unprocessable entity response has a 2xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status unprocessable entity response has a 3xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status unprocessable entity response has a 4xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status unprocessable entity response has a 5xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status unprocessable entity response a status code equal to that given +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusInternalServerError creates a UpdateMTOShipmentStatusInternalServerError with default headers values +func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { + return &UpdateMTOShipmentStatusInternalServerError{} +} + +/* +UpdateMTOShipmentStatusInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOShipmentStatusInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update m t o shipment status internal server error response has a 2xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status internal server error response has a 3xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status internal server error response has a 4xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment status internal server error response has a 5xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o shipment status internal server error response a status code equal to that given +func (o *UpdateMTOShipmentStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOShipmentStatusInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentStatusInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentStatusInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go b/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go new file mode 100644 index 00000000000..79abdbab5dd --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_reweigh_parameters.go @@ -0,0 +1,221 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateReweighParams creates a new UpdateReweighParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateReweighParams() *UpdateReweighParams { + return &UpdateReweighParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateReweighParamsWithTimeout creates a new UpdateReweighParams object +// with the ability to set a timeout on a request. +func NewUpdateReweighParamsWithTimeout(timeout time.Duration) *UpdateReweighParams { + return &UpdateReweighParams{ + timeout: timeout, + } +} + +// NewUpdateReweighParamsWithContext creates a new UpdateReweighParams object +// with the ability to set a context for a request. +func NewUpdateReweighParamsWithContext(ctx context.Context) *UpdateReweighParams { + return &UpdateReweighParams{ + Context: ctx, + } +} + +// NewUpdateReweighParamsWithHTTPClient creates a new UpdateReweighParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateReweighParamsWithHTTPClient(client *http.Client) *UpdateReweighParams { + return &UpdateReweighParams{ + HTTPClient: client, + } +} + +/* +UpdateReweighParams contains all the parameters to send to the API endpoint + + for the update reweigh operation. + + Typically these are written to a http.Request. +*/ +type UpdateReweighParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *primemessages.UpdateReweigh + + /* MtoShipmentID. + + UUID of the shipment associated with the reweigh + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + /* ReweighID. + + UUID of the reweigh being updated + + Format: uuid + */ + ReweighID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update reweigh params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateReweighParams) WithDefaults() *UpdateReweighParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update reweigh params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateReweighParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update reweigh params +func (o *UpdateReweighParams) WithTimeout(timeout time.Duration) *UpdateReweighParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update reweigh params +func (o *UpdateReweighParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update reweigh params +func (o *UpdateReweighParams) WithContext(ctx context.Context) *UpdateReweighParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update reweigh params +func (o *UpdateReweighParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update reweigh params +func (o *UpdateReweighParams) WithHTTPClient(client *http.Client) *UpdateReweighParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update reweigh params +func (o *UpdateReweighParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update reweigh params +func (o *UpdateReweighParams) WithIfMatch(ifMatch string) *UpdateReweighParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update reweigh params +func (o *UpdateReweighParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update reweigh params +func (o *UpdateReweighParams) WithBody(body *primemessages.UpdateReweigh) *UpdateReweighParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update reweigh params +func (o *UpdateReweighParams) SetBody(body *primemessages.UpdateReweigh) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update reweigh params +func (o *UpdateReweighParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateReweighParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update reweigh params +func (o *UpdateReweighParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WithReweighID adds the reweighID to the update reweigh params +func (o *UpdateReweighParams) WithReweighID(reweighID strfmt.UUID) *UpdateReweighParams { + o.SetReweighID(reweighID) + return o +} + +// SetReweighID adds the reweighId to the update reweigh params +func (o *UpdateReweighParams) SetReweighID(reweighID strfmt.UUID) { + o.ReweighID = reweighID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateReweighParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + // path param reweighID + if err := r.SetPathParam("reweighID", o.ReweighID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go b/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go new file mode 100644 index 00000000000..40887991a4c --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_reweigh_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateReweighReader is a Reader for the UpdateReweigh structure. +type UpdateReweighReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateReweighReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateReweighOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateReweighBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateReweighUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateReweighForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateReweighNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateReweighConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateReweighPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateReweighUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateReweighInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}] updateReweigh", response, response.Code()) + } +} + +// NewUpdateReweighOK creates a UpdateReweighOK with default headers values +func NewUpdateReweighOK() *UpdateReweighOK { + return &UpdateReweighOK{} +} + +/* +UpdateReweighOK describes a response with status code 200, with default header values. + +Successfully updated the reweigh. +*/ +type UpdateReweighOK struct { + Payload *primemessages.Reweigh +} + +// IsSuccess returns true when this update reweigh o k response has a 2xx status code +func (o *UpdateReweighOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update reweigh o k response has a 3xx status code +func (o *UpdateReweighOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh o k response has a 4xx status code +func (o *UpdateReweighOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update reweigh o k response has a 5xx status code +func (o *UpdateReweighOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh o k response a status code equal to that given +func (o *UpdateReweighOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update reweigh o k response +func (o *UpdateReweighOK) Code() int { + return 200 +} + +func (o *UpdateReweighOK) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighOK %+v", 200, o.Payload) +} + +func (o *UpdateReweighOK) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighOK %+v", 200, o.Payload) +} + +func (o *UpdateReweighOK) GetPayload() *primemessages.Reweigh { + return o.Payload +} + +func (o *UpdateReweighOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Reweigh) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighBadRequest creates a UpdateReweighBadRequest with default headers values +func NewUpdateReweighBadRequest() *UpdateReweighBadRequest { + return &UpdateReweighBadRequest{} +} + +/* +UpdateReweighBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateReweighBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh bad request response has a 2xx status code +func (o *UpdateReweighBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh bad request response has a 3xx status code +func (o *UpdateReweighBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh bad request response has a 4xx status code +func (o *UpdateReweighBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh bad request response has a 5xx status code +func (o *UpdateReweighBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh bad request response a status code equal to that given +func (o *UpdateReweighBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update reweigh bad request response +func (o *UpdateReweighBadRequest) Code() int { + return 400 +} + +func (o *UpdateReweighBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateReweighBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateReweighBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighUnauthorized creates a UpdateReweighUnauthorized with default headers values +func NewUpdateReweighUnauthorized() *UpdateReweighUnauthorized { + return &UpdateReweighUnauthorized{} +} + +/* +UpdateReweighUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateReweighUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh unauthorized response has a 2xx status code +func (o *UpdateReweighUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh unauthorized response has a 3xx status code +func (o *UpdateReweighUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh unauthorized response has a 4xx status code +func (o *UpdateReweighUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh unauthorized response has a 5xx status code +func (o *UpdateReweighUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh unauthorized response a status code equal to that given +func (o *UpdateReweighUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update reweigh unauthorized response +func (o *UpdateReweighUnauthorized) Code() int { + return 401 +} + +func (o *UpdateReweighUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateReweighUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateReweighUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighForbidden creates a UpdateReweighForbidden with default headers values +func NewUpdateReweighForbidden() *UpdateReweighForbidden { + return &UpdateReweighForbidden{} +} + +/* +UpdateReweighForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateReweighForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh forbidden response has a 2xx status code +func (o *UpdateReweighForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh forbidden response has a 3xx status code +func (o *UpdateReweighForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh forbidden response has a 4xx status code +func (o *UpdateReweighForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh forbidden response has a 5xx status code +func (o *UpdateReweighForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh forbidden response a status code equal to that given +func (o *UpdateReweighForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update reweigh forbidden response +func (o *UpdateReweighForbidden) Code() int { + return 403 +} + +func (o *UpdateReweighForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighForbidden %+v", 403, o.Payload) +} + +func (o *UpdateReweighForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighForbidden %+v", 403, o.Payload) +} + +func (o *UpdateReweighForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighNotFound creates a UpdateReweighNotFound with default headers values +func NewUpdateReweighNotFound() *UpdateReweighNotFound { + return &UpdateReweighNotFound{} +} + +/* +UpdateReweighNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateReweighNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh not found response has a 2xx status code +func (o *UpdateReweighNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh not found response has a 3xx status code +func (o *UpdateReweighNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh not found response has a 4xx status code +func (o *UpdateReweighNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh not found response has a 5xx status code +func (o *UpdateReweighNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh not found response a status code equal to that given +func (o *UpdateReweighNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update reweigh not found response +func (o *UpdateReweighNotFound) Code() int { + return 404 +} + +func (o *UpdateReweighNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighNotFound %+v", 404, o.Payload) +} + +func (o *UpdateReweighNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighNotFound %+v", 404, o.Payload) +} + +func (o *UpdateReweighNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighConflict creates a UpdateReweighConflict with default headers values +func NewUpdateReweighConflict() *UpdateReweighConflict { + return &UpdateReweighConflict{} +} + +/* +UpdateReweighConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateReweighConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh conflict response has a 2xx status code +func (o *UpdateReweighConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh conflict response has a 3xx status code +func (o *UpdateReweighConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh conflict response has a 4xx status code +func (o *UpdateReweighConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh conflict response has a 5xx status code +func (o *UpdateReweighConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh conflict response a status code equal to that given +func (o *UpdateReweighConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update reweigh conflict response +func (o *UpdateReweighConflict) Code() int { + return 409 +} + +func (o *UpdateReweighConflict) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighConflict %+v", 409, o.Payload) +} + +func (o *UpdateReweighConflict) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighConflict %+v", 409, o.Payload) +} + +func (o *UpdateReweighConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighPreconditionFailed creates a UpdateReweighPreconditionFailed with default headers values +func NewUpdateReweighPreconditionFailed() *UpdateReweighPreconditionFailed { + return &UpdateReweighPreconditionFailed{} +} + +/* +UpdateReweighPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateReweighPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update reweigh precondition failed response has a 2xx status code +func (o *UpdateReweighPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh precondition failed response has a 3xx status code +func (o *UpdateReweighPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh precondition failed response has a 4xx status code +func (o *UpdateReweighPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh precondition failed response has a 5xx status code +func (o *UpdateReweighPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh precondition failed response a status code equal to that given +func (o *UpdateReweighPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update reweigh precondition failed response +func (o *UpdateReweighPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateReweighPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateReweighPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateReweighPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateReweighPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighUnprocessableEntity creates a UpdateReweighUnprocessableEntity with default headers values +func NewUpdateReweighUnprocessableEntity() *UpdateReweighUnprocessableEntity { + return &UpdateReweighUnprocessableEntity{} +} + +/* +UpdateReweighUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateReweighUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update reweigh unprocessable entity response has a 2xx status code +func (o *UpdateReweighUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh unprocessable entity response has a 3xx status code +func (o *UpdateReweighUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh unprocessable entity response has a 4xx status code +func (o *UpdateReweighUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update reweigh unprocessable entity response has a 5xx status code +func (o *UpdateReweighUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update reweigh unprocessable entity response a status code equal to that given +func (o *UpdateReweighUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update reweigh unprocessable entity response +func (o *UpdateReweighUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateReweighUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateReweighUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateReweighUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateReweighUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateReweighInternalServerError creates a UpdateReweighInternalServerError with default headers values +func NewUpdateReweighInternalServerError() *UpdateReweighInternalServerError { + return &UpdateReweighInternalServerError{} +} + +/* +UpdateReweighInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateReweighInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update reweigh internal server error response has a 2xx status code +func (o *UpdateReweighInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update reweigh internal server error response has a 3xx status code +func (o *UpdateReweighInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update reweigh internal server error response has a 4xx status code +func (o *UpdateReweighInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update reweigh internal server error response has a 5xx status code +func (o *UpdateReweighInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update reweigh internal server error response a status code equal to that given +func (o *UpdateReweighInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update reweigh internal server error response +func (o *UpdateReweighInternalServerError) Code() int { + return 500 +} + +func (o *UpdateReweighInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateReweighInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/reweighs/{reweighID}][%d] updateReweighInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateReweighInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateReweighInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go new file mode 100644 index 00000000000..ae9cea49739 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewUpdateShipmentDestinationAddressParams creates a new UpdateShipmentDestinationAddressParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateShipmentDestinationAddressParams() *UpdateShipmentDestinationAddressParams { + return &UpdateShipmentDestinationAddressParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateShipmentDestinationAddressParamsWithTimeout creates a new UpdateShipmentDestinationAddressParams object +// with the ability to set a timeout on a request. +func NewUpdateShipmentDestinationAddressParamsWithTimeout(timeout time.Duration) *UpdateShipmentDestinationAddressParams { + return &UpdateShipmentDestinationAddressParams{ + timeout: timeout, + } +} + +// NewUpdateShipmentDestinationAddressParamsWithContext creates a new UpdateShipmentDestinationAddressParams object +// with the ability to set a context for a request. +func NewUpdateShipmentDestinationAddressParamsWithContext(ctx context.Context) *UpdateShipmentDestinationAddressParams { + return &UpdateShipmentDestinationAddressParams{ + Context: ctx, + } +} + +// NewUpdateShipmentDestinationAddressParamsWithHTTPClient creates a new UpdateShipmentDestinationAddressParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateShipmentDestinationAddressParamsWithHTTPClient(client *http.Client) *UpdateShipmentDestinationAddressParams { + return &UpdateShipmentDestinationAddressParams{ + HTTPClient: client, + } +} + +/* +UpdateShipmentDestinationAddressParams contains all the parameters to send to the API endpoint + + for the update shipment destination address operation. + + Typically these are written to a http.Request. +*/ +type UpdateShipmentDestinationAddressParams struct { + + /* IfMatch. + + Needs to be the eTag of the mtoShipment. Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *primemessages.UpdateShipmentDestinationAddress + + /* MtoShipmentID. + + UUID of the shipment associated with the address + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update shipment destination address params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateShipmentDestinationAddressParams) WithDefaults() *UpdateShipmentDestinationAddressParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update shipment destination address params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateShipmentDestinationAddressParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithTimeout(timeout time.Duration) *UpdateShipmentDestinationAddressParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithContext(ctx context.Context) *UpdateShipmentDestinationAddressParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithHTTPClient(client *http.Client) *UpdateShipmentDestinationAddressParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithIfMatch(ifMatch string) *UpdateShipmentDestinationAddressParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithBody(body *primemessages.UpdateShipmentDestinationAddress) *UpdateShipmentDestinationAddressParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetBody(body *primemessages.UpdateShipmentDestinationAddress) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateShipmentDestinationAddressParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update shipment destination address params +func (o *UpdateShipmentDestinationAddressParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateShipmentDestinationAddressParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go new file mode 100644 index 00000000000..6d3cb835a36 --- /dev/null +++ b/pkg/gen/primeclient/mto_shipment/update_shipment_destination_address_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// UpdateShipmentDestinationAddressReader is a Reader for the UpdateShipmentDestinationAddress structure. +type UpdateShipmentDestinationAddressReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateShipmentDestinationAddressReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewUpdateShipmentDestinationAddressCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateShipmentDestinationAddressBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateShipmentDestinationAddressUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateShipmentDestinationAddressForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateShipmentDestinationAddressNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateShipmentDestinationAddressConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateShipmentDestinationAddressPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateShipmentDestinationAddressUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateShipmentDestinationAddressInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates] updateShipmentDestinationAddress", response, response.Code()) + } +} + +// NewUpdateShipmentDestinationAddressCreated creates a UpdateShipmentDestinationAddressCreated with default headers values +func NewUpdateShipmentDestinationAddressCreated() *UpdateShipmentDestinationAddressCreated { + return &UpdateShipmentDestinationAddressCreated{} +} + +/* +UpdateShipmentDestinationAddressCreated describes a response with status code 201, with default header values. + +Successfully created the address update request. +*/ +type UpdateShipmentDestinationAddressCreated struct { + Payload *primemessages.ShipmentAddressUpdate +} + +// IsSuccess returns true when this update shipment destination address created response has a 2xx status code +func (o *UpdateShipmentDestinationAddressCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update shipment destination address created response has a 3xx status code +func (o *UpdateShipmentDestinationAddressCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address created response has a 4xx status code +func (o *UpdateShipmentDestinationAddressCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this update shipment destination address created response has a 5xx status code +func (o *UpdateShipmentDestinationAddressCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address created response a status code equal to that given +func (o *UpdateShipmentDestinationAddressCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the update shipment destination address created response +func (o *UpdateShipmentDestinationAddressCreated) Code() int { + return 201 +} + +func (o *UpdateShipmentDestinationAddressCreated) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressCreated %+v", 201, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressCreated) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressCreated %+v", 201, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressCreated) GetPayload() *primemessages.ShipmentAddressUpdate { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ShipmentAddressUpdate) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressBadRequest creates a UpdateShipmentDestinationAddressBadRequest with default headers values +func NewUpdateShipmentDestinationAddressBadRequest() *UpdateShipmentDestinationAddressBadRequest { + return &UpdateShipmentDestinationAddressBadRequest{} +} + +/* +UpdateShipmentDestinationAddressBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateShipmentDestinationAddressBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address bad request response has a 2xx status code +func (o *UpdateShipmentDestinationAddressBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address bad request response has a 3xx status code +func (o *UpdateShipmentDestinationAddressBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address bad request response has a 4xx status code +func (o *UpdateShipmentDestinationAddressBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address bad request response has a 5xx status code +func (o *UpdateShipmentDestinationAddressBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address bad request response a status code equal to that given +func (o *UpdateShipmentDestinationAddressBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update shipment destination address bad request response +func (o *UpdateShipmentDestinationAddressBadRequest) Code() int { + return 400 +} + +func (o *UpdateShipmentDestinationAddressBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressBadRequest) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressUnauthorized creates a UpdateShipmentDestinationAddressUnauthorized with default headers values +func NewUpdateShipmentDestinationAddressUnauthorized() *UpdateShipmentDestinationAddressUnauthorized { + return &UpdateShipmentDestinationAddressUnauthorized{} +} + +/* +UpdateShipmentDestinationAddressUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateShipmentDestinationAddressUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address unauthorized response has a 2xx status code +func (o *UpdateShipmentDestinationAddressUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address unauthorized response has a 3xx status code +func (o *UpdateShipmentDestinationAddressUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address unauthorized response has a 4xx status code +func (o *UpdateShipmentDestinationAddressUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address unauthorized response has a 5xx status code +func (o *UpdateShipmentDestinationAddressUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address unauthorized response a status code equal to that given +func (o *UpdateShipmentDestinationAddressUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update shipment destination address unauthorized response +func (o *UpdateShipmentDestinationAddressUnauthorized) Code() int { + return 401 +} + +func (o *UpdateShipmentDestinationAddressUnauthorized) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressUnauthorized) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressForbidden creates a UpdateShipmentDestinationAddressForbidden with default headers values +func NewUpdateShipmentDestinationAddressForbidden() *UpdateShipmentDestinationAddressForbidden { + return &UpdateShipmentDestinationAddressForbidden{} +} + +/* +UpdateShipmentDestinationAddressForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateShipmentDestinationAddressForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address forbidden response has a 2xx status code +func (o *UpdateShipmentDestinationAddressForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address forbidden response has a 3xx status code +func (o *UpdateShipmentDestinationAddressForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address forbidden response has a 4xx status code +func (o *UpdateShipmentDestinationAddressForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address forbidden response has a 5xx status code +func (o *UpdateShipmentDestinationAddressForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address forbidden response a status code equal to that given +func (o *UpdateShipmentDestinationAddressForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update shipment destination address forbidden response +func (o *UpdateShipmentDestinationAddressForbidden) Code() int { + return 403 +} + +func (o *UpdateShipmentDestinationAddressForbidden) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressForbidden %+v", 403, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressForbidden) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressForbidden %+v", 403, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressNotFound creates a UpdateShipmentDestinationAddressNotFound with default headers values +func NewUpdateShipmentDestinationAddressNotFound() *UpdateShipmentDestinationAddressNotFound { + return &UpdateShipmentDestinationAddressNotFound{} +} + +/* +UpdateShipmentDestinationAddressNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateShipmentDestinationAddressNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address not found response has a 2xx status code +func (o *UpdateShipmentDestinationAddressNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address not found response has a 3xx status code +func (o *UpdateShipmentDestinationAddressNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address not found response has a 4xx status code +func (o *UpdateShipmentDestinationAddressNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address not found response has a 5xx status code +func (o *UpdateShipmentDestinationAddressNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address not found response a status code equal to that given +func (o *UpdateShipmentDestinationAddressNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update shipment destination address not found response +func (o *UpdateShipmentDestinationAddressNotFound) Code() int { + return 404 +} + +func (o *UpdateShipmentDestinationAddressNotFound) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressNotFound %+v", 404, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressNotFound) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressNotFound %+v", 404, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressConflict creates a UpdateShipmentDestinationAddressConflict with default headers values +func NewUpdateShipmentDestinationAddressConflict() *UpdateShipmentDestinationAddressConflict { + return &UpdateShipmentDestinationAddressConflict{} +} + +/* +UpdateShipmentDestinationAddressConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type UpdateShipmentDestinationAddressConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address conflict response has a 2xx status code +func (o *UpdateShipmentDestinationAddressConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address conflict response has a 3xx status code +func (o *UpdateShipmentDestinationAddressConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address conflict response has a 4xx status code +func (o *UpdateShipmentDestinationAddressConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address conflict response has a 5xx status code +func (o *UpdateShipmentDestinationAddressConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address conflict response a status code equal to that given +func (o *UpdateShipmentDestinationAddressConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update shipment destination address conflict response +func (o *UpdateShipmentDestinationAddressConflict) Code() int { + return 409 +} + +func (o *UpdateShipmentDestinationAddressConflict) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressConflict %+v", 409, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressConflict) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressConflict %+v", 409, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressPreconditionFailed creates a UpdateShipmentDestinationAddressPreconditionFailed with default headers values +func NewUpdateShipmentDestinationAddressPreconditionFailed() *UpdateShipmentDestinationAddressPreconditionFailed { + return &UpdateShipmentDestinationAddressPreconditionFailed{} +} + +/* +UpdateShipmentDestinationAddressPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateShipmentDestinationAddressPreconditionFailed struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this update shipment destination address precondition failed response has a 2xx status code +func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address precondition failed response has a 3xx status code +func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address precondition failed response has a 4xx status code +func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address precondition failed response has a 5xx status code +func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address precondition failed response a status code equal to that given +func (o *UpdateShipmentDestinationAddressPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update shipment destination address precondition failed response +func (o *UpdateShipmentDestinationAddressPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateShipmentDestinationAddressPreconditionFailed) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressPreconditionFailed) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressPreconditionFailed) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressUnprocessableEntity creates a UpdateShipmentDestinationAddressUnprocessableEntity with default headers values +func NewUpdateShipmentDestinationAddressUnprocessableEntity() *UpdateShipmentDestinationAddressUnprocessableEntity { + return &UpdateShipmentDestinationAddressUnprocessableEntity{} +} + +/* +UpdateShipmentDestinationAddressUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateShipmentDestinationAddressUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this update shipment destination address unprocessable entity response has a 2xx status code +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address unprocessable entity response has a 3xx status code +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address unprocessable entity response has a 4xx status code +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update shipment destination address unprocessable entity response has a 5xx status code +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update shipment destination address unprocessable entity response a status code equal to that given +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update shipment destination address unprocessable entity response +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateShipmentDestinationAddressInternalServerError creates a UpdateShipmentDestinationAddressInternalServerError with default headers values +func NewUpdateShipmentDestinationAddressInternalServerError() *UpdateShipmentDestinationAddressInternalServerError { + return &UpdateShipmentDestinationAddressInternalServerError{} +} + +/* +UpdateShipmentDestinationAddressInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateShipmentDestinationAddressInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this update shipment destination address internal server error response has a 2xx status code +func (o *UpdateShipmentDestinationAddressInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update shipment destination address internal server error response has a 3xx status code +func (o *UpdateShipmentDestinationAddressInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update shipment destination address internal server error response has a 4xx status code +func (o *UpdateShipmentDestinationAddressInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update shipment destination address internal server error response has a 5xx status code +func (o *UpdateShipmentDestinationAddressInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update shipment destination address internal server error response a status code equal to that given +func (o *UpdateShipmentDestinationAddressInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update shipment destination address internal server error response +func (o *UpdateShipmentDestinationAddressInternalServerError) Code() int { + return 500 +} + +func (o *UpdateShipmentDestinationAddressInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-shipments/{mtoShipmentID}/shipment-address-updates][%d] updateShipmentDestinationAddressInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateShipmentDestinationAddressInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *UpdateShipmentDestinationAddressInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/mymove_client.go b/pkg/gen/primeclient/mymove_client.go new file mode 100644 index 00000000000..5a6cf119393 --- /dev/null +++ b/pkg/gen/primeclient/mymove_client.go @@ -0,0 +1,127 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primeclient + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primeclient/move_task_order" + "github.com/transcom/mymove/pkg/gen/primeclient/mto_service_item" + "github.com/transcom/mymove/pkg/gen/primeclient/mto_shipment" + "github.com/transcom/mymove/pkg/gen/primeclient/payment_request" +) + +// Default mymove HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/prime/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new mymove HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Mymove { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new mymove HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new mymove client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Mymove) + cli.Transport = transport + cli.MoveTaskOrder = move_task_order.New(transport, formats) + cli.MtoServiceItem = mto_service_item.New(transport, formats) + cli.MtoShipment = mto_shipment.New(transport, formats) + cli.PaymentRequest = payment_request.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Mymove is a client for mymove +type Mymove struct { + MoveTaskOrder move_task_order.ClientService + + MtoServiceItem mto_service_item.ClientService + + MtoShipment mto_shipment.ClientService + + PaymentRequest payment_request.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Mymove) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.MoveTaskOrder.SetTransport(transport) + c.MtoServiceItem.SetTransport(transport) + c.MtoShipment.SetTransport(transport) + c.PaymentRequest.SetTransport(transport) +} diff --git a/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go b/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go new file mode 100644 index 00000000000..8a233b2ef07 --- /dev/null +++ b/pkg/gen/primeclient/payment_request/create_payment_request_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// NewCreatePaymentRequestParams creates a new CreatePaymentRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreatePaymentRequestParams() *CreatePaymentRequestParams { + return &CreatePaymentRequestParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreatePaymentRequestParamsWithTimeout creates a new CreatePaymentRequestParams object +// with the ability to set a timeout on a request. +func NewCreatePaymentRequestParamsWithTimeout(timeout time.Duration) *CreatePaymentRequestParams { + return &CreatePaymentRequestParams{ + timeout: timeout, + } +} + +// NewCreatePaymentRequestParamsWithContext creates a new CreatePaymentRequestParams object +// with the ability to set a context for a request. +func NewCreatePaymentRequestParamsWithContext(ctx context.Context) *CreatePaymentRequestParams { + return &CreatePaymentRequestParams{ + Context: ctx, + } +} + +// NewCreatePaymentRequestParamsWithHTTPClient creates a new CreatePaymentRequestParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreatePaymentRequestParamsWithHTTPClient(client *http.Client) *CreatePaymentRequestParams { + return &CreatePaymentRequestParams{ + HTTPClient: client, + } +} + +/* +CreatePaymentRequestParams contains all the parameters to send to the API endpoint + + for the create payment request operation. + + Typically these are written to a http.Request. +*/ +type CreatePaymentRequestParams struct { + + // Body. + Body *primemessages.CreatePaymentRequest + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create payment request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePaymentRequestParams) WithDefaults() *CreatePaymentRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create payment request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreatePaymentRequestParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create payment request params +func (o *CreatePaymentRequestParams) WithTimeout(timeout time.Duration) *CreatePaymentRequestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create payment request params +func (o *CreatePaymentRequestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create payment request params +func (o *CreatePaymentRequestParams) WithContext(ctx context.Context) *CreatePaymentRequestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create payment request params +func (o *CreatePaymentRequestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create payment request params +func (o *CreatePaymentRequestParams) WithHTTPClient(client *http.Client) *CreatePaymentRequestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create payment request params +func (o *CreatePaymentRequestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create payment request params +func (o *CreatePaymentRequestParams) WithBody(body *primemessages.CreatePaymentRequest) *CreatePaymentRequestParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create payment request params +func (o *CreatePaymentRequestParams) SetBody(body *primemessages.CreatePaymentRequest) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreatePaymentRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/payment_request/create_payment_request_responses.go b/pkg/gen/primeclient/payment_request/create_payment_request_responses.go new file mode 100644 index 00000000000..9a28017a121 --- /dev/null +++ b/pkg/gen/primeclient/payment_request/create_payment_request_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreatePaymentRequestReader is a Reader for the CreatePaymentRequest structure. +type CreatePaymentRequestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreatePaymentRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreatePaymentRequestCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreatePaymentRequestBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreatePaymentRequestUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreatePaymentRequestForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreatePaymentRequestNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewCreatePaymentRequestConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreatePaymentRequestUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreatePaymentRequestInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /payment-requests] createPaymentRequest", response, response.Code()) + } +} + +// NewCreatePaymentRequestCreated creates a CreatePaymentRequestCreated with default headers values +func NewCreatePaymentRequestCreated() *CreatePaymentRequestCreated { + return &CreatePaymentRequestCreated{} +} + +/* +CreatePaymentRequestCreated describes a response with status code 201, with default header values. + +Successfully created a paymentRequest object. +*/ +type CreatePaymentRequestCreated struct { + Payload *primemessages.PaymentRequest +} + +// IsSuccess returns true when this create payment request created response has a 2xx status code +func (o *CreatePaymentRequestCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create payment request created response has a 3xx status code +func (o *CreatePaymentRequestCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request created response has a 4xx status code +func (o *CreatePaymentRequestCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create payment request created response has a 5xx status code +func (o *CreatePaymentRequestCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request created response a status code equal to that given +func (o *CreatePaymentRequestCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create payment request created response +func (o *CreatePaymentRequestCreated) Code() int { + return 201 +} + +func (o *CreatePaymentRequestCreated) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestCreated %+v", 201, o.Payload) +} + +func (o *CreatePaymentRequestCreated) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestCreated %+v", 201, o.Payload) +} + +func (o *CreatePaymentRequestCreated) GetPayload() *primemessages.PaymentRequest { + return o.Payload +} + +func (o *CreatePaymentRequestCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.PaymentRequest) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestBadRequest creates a CreatePaymentRequestBadRequest with default headers values +func NewCreatePaymentRequestBadRequest() *CreatePaymentRequestBadRequest { + return &CreatePaymentRequestBadRequest{} +} + +/* +CreatePaymentRequestBadRequest describes a response with status code 400, with default header values. + +Request payload is invalid. +*/ +type CreatePaymentRequestBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create payment request bad request response has a 2xx status code +func (o *CreatePaymentRequestBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request bad request response has a 3xx status code +func (o *CreatePaymentRequestBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request bad request response has a 4xx status code +func (o *CreatePaymentRequestBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request bad request response has a 5xx status code +func (o *CreatePaymentRequestBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request bad request response a status code equal to that given +func (o *CreatePaymentRequestBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create payment request bad request response +func (o *CreatePaymentRequestBadRequest) Code() int { + return 400 +} + +func (o *CreatePaymentRequestBadRequest) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestBadRequest %+v", 400, o.Payload) +} + +func (o *CreatePaymentRequestBadRequest) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestBadRequest %+v", 400, o.Payload) +} + +func (o *CreatePaymentRequestBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreatePaymentRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestUnauthorized creates a CreatePaymentRequestUnauthorized with default headers values +func NewCreatePaymentRequestUnauthorized() *CreatePaymentRequestUnauthorized { + return &CreatePaymentRequestUnauthorized{} +} + +/* +CreatePaymentRequestUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreatePaymentRequestUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create payment request unauthorized response has a 2xx status code +func (o *CreatePaymentRequestUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request unauthorized response has a 3xx status code +func (o *CreatePaymentRequestUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request unauthorized response has a 4xx status code +func (o *CreatePaymentRequestUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request unauthorized response has a 5xx status code +func (o *CreatePaymentRequestUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request unauthorized response a status code equal to that given +func (o *CreatePaymentRequestUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create payment request unauthorized response +func (o *CreatePaymentRequestUnauthorized) Code() int { + return 401 +} + +func (o *CreatePaymentRequestUnauthorized) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnauthorized %+v", 401, o.Payload) +} + +func (o *CreatePaymentRequestUnauthorized) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnauthorized %+v", 401, o.Payload) +} + +func (o *CreatePaymentRequestUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreatePaymentRequestUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestForbidden creates a CreatePaymentRequestForbidden with default headers values +func NewCreatePaymentRequestForbidden() *CreatePaymentRequestForbidden { + return &CreatePaymentRequestForbidden{} +} + +/* +CreatePaymentRequestForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreatePaymentRequestForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create payment request forbidden response has a 2xx status code +func (o *CreatePaymentRequestForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request forbidden response has a 3xx status code +func (o *CreatePaymentRequestForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request forbidden response has a 4xx status code +func (o *CreatePaymentRequestForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request forbidden response has a 5xx status code +func (o *CreatePaymentRequestForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request forbidden response a status code equal to that given +func (o *CreatePaymentRequestForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create payment request forbidden response +func (o *CreatePaymentRequestForbidden) Code() int { + return 403 +} + +func (o *CreatePaymentRequestForbidden) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestForbidden %+v", 403, o.Payload) +} + +func (o *CreatePaymentRequestForbidden) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestForbidden %+v", 403, o.Payload) +} + +func (o *CreatePaymentRequestForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreatePaymentRequestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestNotFound creates a CreatePaymentRequestNotFound with default headers values +func NewCreatePaymentRequestNotFound() *CreatePaymentRequestNotFound { + return &CreatePaymentRequestNotFound{} +} + +/* +CreatePaymentRequestNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreatePaymentRequestNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create payment request not found response has a 2xx status code +func (o *CreatePaymentRequestNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request not found response has a 3xx status code +func (o *CreatePaymentRequestNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request not found response has a 4xx status code +func (o *CreatePaymentRequestNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request not found response has a 5xx status code +func (o *CreatePaymentRequestNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request not found response a status code equal to that given +func (o *CreatePaymentRequestNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create payment request not found response +func (o *CreatePaymentRequestNotFound) Code() int { + return 404 +} + +func (o *CreatePaymentRequestNotFound) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestNotFound %+v", 404, o.Payload) +} + +func (o *CreatePaymentRequestNotFound) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestNotFound %+v", 404, o.Payload) +} + +func (o *CreatePaymentRequestNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreatePaymentRequestNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestConflict creates a CreatePaymentRequestConflict with default headers values +func NewCreatePaymentRequestConflict() *CreatePaymentRequestConflict { + return &CreatePaymentRequestConflict{} +} + +/* +CreatePaymentRequestConflict describes a response with status code 409, with default header values. + +The request could not be processed because of conflict in the current state of the resource. +*/ +type CreatePaymentRequestConflict struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create payment request conflict response has a 2xx status code +func (o *CreatePaymentRequestConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request conflict response has a 3xx status code +func (o *CreatePaymentRequestConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request conflict response has a 4xx status code +func (o *CreatePaymentRequestConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request conflict response has a 5xx status code +func (o *CreatePaymentRequestConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request conflict response a status code equal to that given +func (o *CreatePaymentRequestConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the create payment request conflict response +func (o *CreatePaymentRequestConflict) Code() int { + return 409 +} + +func (o *CreatePaymentRequestConflict) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestConflict %+v", 409, o.Payload) +} + +func (o *CreatePaymentRequestConflict) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestConflict %+v", 409, o.Payload) +} + +func (o *CreatePaymentRequestConflict) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreatePaymentRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestUnprocessableEntity creates a CreatePaymentRequestUnprocessableEntity with default headers values +func NewCreatePaymentRequestUnprocessableEntity() *CreatePaymentRequestUnprocessableEntity { + return &CreatePaymentRequestUnprocessableEntity{} +} + +/* +CreatePaymentRequestUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreatePaymentRequestUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create payment request unprocessable entity response has a 2xx status code +func (o *CreatePaymentRequestUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request unprocessable entity response has a 3xx status code +func (o *CreatePaymentRequestUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request unprocessable entity response has a 4xx status code +func (o *CreatePaymentRequestUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create payment request unprocessable entity response has a 5xx status code +func (o *CreatePaymentRequestUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create payment request unprocessable entity response a status code equal to that given +func (o *CreatePaymentRequestUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create payment request unprocessable entity response +func (o *CreatePaymentRequestUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreatePaymentRequestUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreatePaymentRequestUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreatePaymentRequestUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreatePaymentRequestUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreatePaymentRequestInternalServerError creates a CreatePaymentRequestInternalServerError with default headers values +func NewCreatePaymentRequestInternalServerError() *CreatePaymentRequestInternalServerError { + return &CreatePaymentRequestInternalServerError{} +} + +/* +CreatePaymentRequestInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreatePaymentRequestInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create payment request internal server error response has a 2xx status code +func (o *CreatePaymentRequestInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create payment request internal server error response has a 3xx status code +func (o *CreatePaymentRequestInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create payment request internal server error response has a 4xx status code +func (o *CreatePaymentRequestInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create payment request internal server error response has a 5xx status code +func (o *CreatePaymentRequestInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create payment request internal server error response a status code equal to that given +func (o *CreatePaymentRequestInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create payment request internal server error response +func (o *CreatePaymentRequestInternalServerError) Code() int { + return 500 +} + +func (o *CreatePaymentRequestInternalServerError) Error() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestInternalServerError %+v", 500, o.Payload) +} + +func (o *CreatePaymentRequestInternalServerError) String() string { + return fmt.Sprintf("[POST /payment-requests][%d] createPaymentRequestInternalServerError %+v", 500, o.Payload) +} + +func (o *CreatePaymentRequestInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreatePaymentRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/payment_request/create_upload_parameters.go b/pkg/gen/primeclient/payment_request/create_upload_parameters.go new file mode 100644 index 00000000000..6c89d2949ae --- /dev/null +++ b/pkg/gen/primeclient/payment_request/create_upload_parameters.go @@ -0,0 +1,205 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewCreateUploadParams creates a new CreateUploadParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateUploadParams() *CreateUploadParams { + return &CreateUploadParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateUploadParamsWithTimeout creates a new CreateUploadParams object +// with the ability to set a timeout on a request. +func NewCreateUploadParamsWithTimeout(timeout time.Duration) *CreateUploadParams { + return &CreateUploadParams{ + timeout: timeout, + } +} + +// NewCreateUploadParamsWithContext creates a new CreateUploadParams object +// with the ability to set a context for a request. +func NewCreateUploadParamsWithContext(ctx context.Context) *CreateUploadParams { + return &CreateUploadParams{ + Context: ctx, + } +} + +// NewCreateUploadParamsWithHTTPClient creates a new CreateUploadParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateUploadParamsWithHTTPClient(client *http.Client) *CreateUploadParams { + return &CreateUploadParams{ + HTTPClient: client, + } +} + +/* +CreateUploadParams contains all the parameters to send to the API endpoint + + for the create upload operation. + + Typically these are written to a http.Request. +*/ +type CreateUploadParams struct { + + /* File. + + The file to upload. + */ + File runtime.NamedReadCloser + + /* IsWeightTicket. + + Indicates whether the file is a weight ticket. + */ + IsWeightTicket *bool + + /* PaymentRequestID. + + UUID of payment request to use. + */ + PaymentRequestID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateUploadParams) WithDefaults() *CreateUploadParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create upload params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateUploadParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create upload params +func (o *CreateUploadParams) WithTimeout(timeout time.Duration) *CreateUploadParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create upload params +func (o *CreateUploadParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create upload params +func (o *CreateUploadParams) WithContext(ctx context.Context) *CreateUploadParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create upload params +func (o *CreateUploadParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create upload params +func (o *CreateUploadParams) WithHTTPClient(client *http.Client) *CreateUploadParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create upload params +func (o *CreateUploadParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithFile adds the file to the create upload params +func (o *CreateUploadParams) WithFile(file runtime.NamedReadCloser) *CreateUploadParams { + o.SetFile(file) + return o +} + +// SetFile adds the file to the create upload params +func (o *CreateUploadParams) SetFile(file runtime.NamedReadCloser) { + o.File = file +} + +// WithIsWeightTicket adds the isWeightTicket to the create upload params +func (o *CreateUploadParams) WithIsWeightTicket(isWeightTicket *bool) *CreateUploadParams { + o.SetIsWeightTicket(isWeightTicket) + return o +} + +// SetIsWeightTicket adds the isWeightTicket to the create upload params +func (o *CreateUploadParams) SetIsWeightTicket(isWeightTicket *bool) { + o.IsWeightTicket = isWeightTicket +} + +// WithPaymentRequestID adds the paymentRequestID to the create upload params +func (o *CreateUploadParams) WithPaymentRequestID(paymentRequestID string) *CreateUploadParams { + o.SetPaymentRequestID(paymentRequestID) + return o +} + +// SetPaymentRequestID adds the paymentRequestId to the create upload params +func (o *CreateUploadParams) SetPaymentRequestID(paymentRequestID string) { + o.PaymentRequestID = paymentRequestID +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateUploadParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + // form file param file + if err := r.SetFileParam("file", o.File); err != nil { + return err + } + + if o.IsWeightTicket != nil { + + // form param isWeightTicket + var frIsWeightTicket bool + if o.IsWeightTicket != nil { + frIsWeightTicket = *o.IsWeightTicket + } + fIsWeightTicket := swag.FormatBool(frIsWeightTicket) + if fIsWeightTicket != "" { + if err := r.SetFormParam("isWeightTicket", fIsWeightTicket); err != nil { + return err + } + } + } + + // path param paymentRequestID + if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primeclient/payment_request/create_upload_responses.go b/pkg/gen/primeclient/payment_request/create_upload_responses.go new file mode 100644 index 00000000000..3236c327ad1 --- /dev/null +++ b/pkg/gen/primeclient/payment_request/create_upload_responses.go @@ -0,0 +1,547 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primemessages" +) + +// CreateUploadReader is a Reader for the CreateUpload structure. +type CreateUploadReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateUploadReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateUploadCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateUploadBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateUploadUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateUploadForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateUploadNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateUploadUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateUploadInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /payment-requests/{paymentRequestID}/uploads] createUpload", response, response.Code()) + } +} + +// NewCreateUploadCreated creates a CreateUploadCreated with default headers values +func NewCreateUploadCreated() *CreateUploadCreated { + return &CreateUploadCreated{} +} + +/* +CreateUploadCreated describes a response with status code 201, with default header values. + +Successfully created upload of digital file. +*/ +type CreateUploadCreated struct { + Payload *primemessages.UploadWithOmissions +} + +// IsSuccess returns true when this create upload created response has a 2xx status code +func (o *CreateUploadCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create upload created response has a 3xx status code +func (o *CreateUploadCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload created response has a 4xx status code +func (o *CreateUploadCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create upload created response has a 5xx status code +func (o *CreateUploadCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload created response a status code equal to that given +func (o *CreateUploadCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create upload created response +func (o *CreateUploadCreated) Code() int { + return 201 +} + +func (o *CreateUploadCreated) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadCreated %+v", 201, o.Payload) +} + +func (o *CreateUploadCreated) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadCreated %+v", 201, o.Payload) +} + +func (o *CreateUploadCreated) GetPayload() *primemessages.UploadWithOmissions { + return o.Payload +} + +func (o *CreateUploadCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.UploadWithOmissions) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadBadRequest creates a CreateUploadBadRequest with default headers values +func NewCreateUploadBadRequest() *CreateUploadBadRequest { + return &CreateUploadBadRequest{} +} + +/* +CreateUploadBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateUploadBadRequest struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create upload bad request response has a 2xx status code +func (o *CreateUploadBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload bad request response has a 3xx status code +func (o *CreateUploadBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload bad request response has a 4xx status code +func (o *CreateUploadBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create upload bad request response has a 5xx status code +func (o *CreateUploadBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload bad request response a status code equal to that given +func (o *CreateUploadBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create upload bad request response +func (o *CreateUploadBadRequest) Code() int { + return 400 +} + +func (o *CreateUploadBadRequest) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadBadRequest %+v", 400, o.Payload) +} + +func (o *CreateUploadBadRequest) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadBadRequest %+v", 400, o.Payload) +} + +func (o *CreateUploadBadRequest) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateUploadBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadUnauthorized creates a CreateUploadUnauthorized with default headers values +func NewCreateUploadUnauthorized() *CreateUploadUnauthorized { + return &CreateUploadUnauthorized{} +} + +/* +CreateUploadUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateUploadUnauthorized struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create upload unauthorized response has a 2xx status code +func (o *CreateUploadUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload unauthorized response has a 3xx status code +func (o *CreateUploadUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload unauthorized response has a 4xx status code +func (o *CreateUploadUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create upload unauthorized response has a 5xx status code +func (o *CreateUploadUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload unauthorized response a status code equal to that given +func (o *CreateUploadUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create upload unauthorized response +func (o *CreateUploadUnauthorized) Code() int { + return 401 +} + +func (o *CreateUploadUnauthorized) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateUploadUnauthorized) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateUploadUnauthorized) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateUploadUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadForbidden creates a CreateUploadForbidden with default headers values +func NewCreateUploadForbidden() *CreateUploadForbidden { + return &CreateUploadForbidden{} +} + +/* +CreateUploadForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateUploadForbidden struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create upload forbidden response has a 2xx status code +func (o *CreateUploadForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload forbidden response has a 3xx status code +func (o *CreateUploadForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload forbidden response has a 4xx status code +func (o *CreateUploadForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create upload forbidden response has a 5xx status code +func (o *CreateUploadForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload forbidden response a status code equal to that given +func (o *CreateUploadForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create upload forbidden response +func (o *CreateUploadForbidden) Code() int { + return 403 +} + +func (o *CreateUploadForbidden) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadForbidden %+v", 403, o.Payload) +} + +func (o *CreateUploadForbidden) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadForbidden %+v", 403, o.Payload) +} + +func (o *CreateUploadForbidden) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateUploadForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadNotFound creates a CreateUploadNotFound with default headers values +func NewCreateUploadNotFound() *CreateUploadNotFound { + return &CreateUploadNotFound{} +} + +/* +CreateUploadNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateUploadNotFound struct { + Payload *primemessages.ClientError +} + +// IsSuccess returns true when this create upload not found response has a 2xx status code +func (o *CreateUploadNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload not found response has a 3xx status code +func (o *CreateUploadNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload not found response has a 4xx status code +func (o *CreateUploadNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create upload not found response has a 5xx status code +func (o *CreateUploadNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload not found response a status code equal to that given +func (o *CreateUploadNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create upload not found response +func (o *CreateUploadNotFound) Code() int { + return 404 +} + +func (o *CreateUploadNotFound) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadNotFound %+v", 404, o.Payload) +} + +func (o *CreateUploadNotFound) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadNotFound %+v", 404, o.Payload) +} + +func (o *CreateUploadNotFound) GetPayload() *primemessages.ClientError { + return o.Payload +} + +func (o *CreateUploadNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadUnprocessableEntity creates a CreateUploadUnprocessableEntity with default headers values +func NewCreateUploadUnprocessableEntity() *CreateUploadUnprocessableEntity { + return &CreateUploadUnprocessableEntity{} +} + +/* +CreateUploadUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateUploadUnprocessableEntity struct { + Payload *primemessages.ValidationError +} + +// IsSuccess returns true when this create upload unprocessable entity response has a 2xx status code +func (o *CreateUploadUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload unprocessable entity response has a 3xx status code +func (o *CreateUploadUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload unprocessable entity response has a 4xx status code +func (o *CreateUploadUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create upload unprocessable entity response has a 5xx status code +func (o *CreateUploadUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create upload unprocessable entity response a status code equal to that given +func (o *CreateUploadUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create upload unprocessable entity response +func (o *CreateUploadUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateUploadUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateUploadUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateUploadUnprocessableEntity) GetPayload() *primemessages.ValidationError { + return o.Payload +} + +func (o *CreateUploadUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateUploadInternalServerError creates a CreateUploadInternalServerError with default headers values +func NewCreateUploadInternalServerError() *CreateUploadInternalServerError { + return &CreateUploadInternalServerError{} +} + +/* +CreateUploadInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateUploadInternalServerError struct { + Payload *primemessages.Error +} + +// IsSuccess returns true when this create upload internal server error response has a 2xx status code +func (o *CreateUploadInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create upload internal server error response has a 3xx status code +func (o *CreateUploadInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create upload internal server error response has a 4xx status code +func (o *CreateUploadInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create upload internal server error response has a 5xx status code +func (o *CreateUploadInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create upload internal server error response a status code equal to that given +func (o *CreateUploadInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create upload internal server error response +func (o *CreateUploadInternalServerError) Code() int { + return 500 +} + +func (o *CreateUploadInternalServerError) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateUploadInternalServerError) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/uploads][%d] createUploadInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateUploadInternalServerError) GetPayload() *primemessages.Error { + return o.Payload +} + +func (o *CreateUploadInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primemessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primeclient/payment_request/payment_request_client.go b/pkg/gen/primeclient/payment_request/payment_request_client.go new file mode 100644 index 00000000000..b10b46d87cf --- /dev/null +++ b/pkg/gen/primeclient/payment_request/payment_request_client.go @@ -0,0 +1,504 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new payment request API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for payment request API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreatePaymentRequest(params *CreatePaymentRequestParams, opts ...ClientOption) (*CreatePaymentRequestCreated, error) + + CreateUpload(params *CreateUploadParams, opts ...ClientOption) (*CreateUploadCreated, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreatePaymentRequest creates payment request + + Creates a new instance of a paymentRequest and is assigned the status `PENDING`. + +A move task order can have multiple payment requests, and +a final payment request can be marked using boolean `isFinal`. + +If a `PENDING` payment request is recalculated, +a new payment request is created and the original request is +marked with the status `DEPRECATED`. + +**NOTE**: In order to create a payment request for most service items, the shipment *must* +be updated with the `PrimeActualWeight` value via [updateMTOShipment](#operation/updateMTOShipment). + +If `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. + +**NOTE**: Diversions have a unique calcuation for payment requests without a `WeightBilled` parameter. + +If you created a payment request for a diversion and `WeightBilled` is not provided, then the following will be used in the calculation: +- The lowest shipment weight (`PrimeActualWeight`) found in the diverted shipment chain. +- The lowest reweigh weight found in the diverted shipment chain. + +The diverted shipment chain is created by referencing the `diversion` boolean, `divertedFromShipmentId` UUID, and matching destination to pickup addresses. +If the chain cannot be established it will fall back to the `PrimeActualWeight` of the current shipment. This is utilized because diverted shipments are all one single shipment, but going to different locations. +The lowest weight found is the true shipment weight, and thus we search the chain of shipments for the lowest weight found. + +A service item can be on several payment requests in the case of partial payment requests and payments. + +In the request, if no params are necessary, then just the `serviceItem` `id` is required. For example: +```json + + { + "isFinal": false, + "moveTaskOrderID": "uuid", + "serviceItems": [ + { + "id": "uuid", + }, + { + "id": "uuid", + "params": [ + { + "key": "Service Item Parameter Name", + "value": "Service Item Parameter Value" + } + ] + } + ], + "pointOfContact": "string" + } + +``` + +Domestic Basic Service Items & Accepted Payment Request Parameters: +--- + +**DLH - Domestic Linehaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DSH - Domestic Shorthaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**FSC - Fuel Surcharge** +**NOTE**: FSC requires `ActualPickupDate` to be updated on the shipment. +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DUPK - Domestic Unpacking** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DPK - Domestic Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DNPK - Domestic NTS Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DPK - Domestic Packing** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOP - Domestic Origin Price** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDP - Domestic Destination Price** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +Domestic SIT Service Items & Accepted Payment Request Parameters: +--- + +**DOFSIT - Domestic origin 1st day SIT** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOASIT - Domestic origin add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* +*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + }, + { + "key": "SITPaymentRequestStart", + "value": "date" + }, + { + "key": "SITPaymentRequestEnd", + "value": "date" + } + ] + +``` + +**DOPSIT - Domestic origin SIT pickup** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DOSHUT - Domestic origin shuttle service** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDFSIT - Domestic destination 1st day SIT** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDASIT - Domestic destination add'l SIT** *(SITPaymentRequestStart & SITPaymentRequestEnd are **REQUIRED**)* +*To create a paymentRequest for this service item, the `SITPaymentRequestStart` and `SITPaymentRequestEnd` dates must not overlap previously requested SIT dates.* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + }, + { + "key": "SITPaymentRequestStart", + "value": "date" + }, + { + "key": "SITPaymentRequestEnd", + "value": "date" + } + ] + +``` + +**DDDSIT - Domestic destination SIT delivery** +*To create a paymentRequest for this service item, it must first have a final address set via [updateMTOServiceItem](#operation/updateMTOServiceItem).* +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**DDSHUT - Domestic destination shuttle service** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` +--- + +International Basic Service Items & Accepted Payment Request Parameters: +--- +Just like domestic shipments & service items, if `WeightBilled` is not provided then the full shipment weight (`PrimeActualWeight`) will be considered in the calculation. +**NOTE**: `POEFSC` & `PODFSC` service items must have a port associated on the service item in order to successfully add it to a payment request. To update the port of a service item, you must use the (#operation/updateMTOServiceItem) endpoint. + +**ISLH - International Shipping & Linehaul** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**IHPK - International HHG Pack** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**IHUPK - International HHG Unpack** +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**POEFSC - International Port of Embarkation Fuel Surcharge** + + **NOTE**: POEFSC requires `ActualPickupDate` to be updated on the shipment & `POELocation` on the service item. + +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` + +**PODFSC - International Port of Debarkation Fuel Surcharge** +**NOTE**: PODFSC requires `ActualPickupDate` to be updated on the shipment & `PODLocation` on the service item. +```json + + "params": [ + { + "key": "WeightBilled", + "value": "integer" + } + ] + +``` +--- +*/ +func (a *Client) CreatePaymentRequest(params *CreatePaymentRequestParams, opts ...ClientOption) (*CreatePaymentRequestCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreatePaymentRequestParams() + } + op := &runtime.ClientOperation{ + ID: "createPaymentRequest", + Method: "POST", + PathPattern: "/payment-requests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreatePaymentRequestReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreatePaymentRequestCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createPaymentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + CreateUpload creates upload + + ### Functionality + +This endpoint **uploads** a Proof of Service document for a PaymentRequest. + +The PaymentRequest should already exist. + +Optional key of **isWeightTicket** indicates if the document is a weight ticket or not. +This will be used for partial and full deliveries and makes it easier for the Task Invoicing Officers to locate and review service item documents. +If left empty, it will assume it is NOT a weight ticket. + +The formdata in the body of the POST request that is sent should look like this if it IS a weight ticket being attached to an existing payment request: + + ```json + { + "file": "filePath", + "isWeightTicket": true + } + ``` + If the proof of service doc is NOT a weight ticket, it will look like this - or you can leave it empty: + ```json + { + "file": "filePath", + "isWeightTicket": false + } + ``` + ```json + { + "file": "filePath", + } + ``` + +PaymentRequests are created with the [createPaymentRequest](#operation/createPaymentRequest) endpoint. +*/ +func (a *Client) CreateUpload(params *CreateUploadParams, opts ...ClientOption) (*CreateUploadCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateUploadParams() + } + op := &runtime.ClientOperation{ + ID: "createUpload", + Method: "POST", + PathPattern: "/payment-requests/{paymentRequestID}/uploads", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"multipart/form-data"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateUploadReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateUploadCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createUpload: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primemessages/excess_weight_record.go b/pkg/gen/primemessages/excess_weight_record.go new file mode 100644 index 00000000000..03c572134ba --- /dev/null +++ b/pkg/gen/primemessages/excess_weight_record.go @@ -0,0 +1,226 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ExcessWeightRecord A document uploaded by the movers proving that the customer has been counseled about excess weight. +// +// swagger:model ExcessWeightRecord +type ExcessWeightRecord struct { + UploadWithOmissions + + // The date and time when the TOO acknowledged the excess weight alert, either by dismissing the risk or updating the max billable weight. This will occur after the excess weight record has been uploaded. + // + // Read Only: true + // Format: date-time + MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` + + // The date and time when the sum of all the move's shipments met the excess weight qualification threshold. The system monitors these weights and will update this field automatically. + // + // Read Only: true + // Format: date-time + MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` + + // The UUID of the move this excess weight record belongs to. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveID *strfmt.UUID `json:"moveId"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ExcessWeightRecord) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 UploadWithOmissions + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.UploadWithOmissions = aO0 + + // AO1 + var dataAO1 struct { + MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` + + MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` + + MoveID *strfmt.UUID `json:"moveId"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.MoveExcessWeightAcknowledgedAt = dataAO1.MoveExcessWeightAcknowledgedAt + + m.MoveExcessWeightQualifiedAt = dataAO1.MoveExcessWeightQualifiedAt + + m.MoveID = dataAO1.MoveID + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ExcessWeightRecord) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.UploadWithOmissions) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + MoveExcessWeightAcknowledgedAt *strfmt.DateTime `json:"moveExcessWeightAcknowledgedAt"` + + MoveExcessWeightQualifiedAt *strfmt.DateTime `json:"moveExcessWeightQualifiedAt"` + + MoveID *strfmt.UUID `json:"moveId"` + } + + dataAO1.MoveExcessWeightAcknowledgedAt = m.MoveExcessWeightAcknowledgedAt + + dataAO1.MoveExcessWeightQualifiedAt = m.MoveExcessWeightQualifiedAt + + dataAO1.MoveID = m.MoveID + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this excess weight record +func (m *ExcessWeightRecord) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with UploadWithOmissions + if err := m.UploadWithOmissions.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExcessWeightRecord) validateMoveExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.MoveExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("moveExcessWeightAcknowledgedAt", "body", "date-time", m.MoveExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ExcessWeightRecord) validateMoveExcessWeightQualifiedAt(formats strfmt.Registry) error { + + if swag.IsZero(m.MoveExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("moveExcessWeightQualifiedAt", "body", "date-time", m.MoveExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ExcessWeightRecord) validateMoveID(formats strfmt.Registry) error { + + if err := validate.Required("moveId", "body", m.MoveID); err != nil { + return err + } + + if err := validate.FormatOf("moveId", "body", "uuid", m.MoveID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this excess weight record based on the context it is used +func (m *ExcessWeightRecord) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with UploadWithOmissions + if err := m.UploadWithOmissions.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ExcessWeightRecord) contextValidateMoveExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveExcessWeightAcknowledgedAt", "body", m.MoveExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *ExcessWeightRecord) contextValidateMoveExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveExcessWeightQualifiedAt", "body", m.MoveExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ExcessWeightRecord) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ExcessWeightRecord) UnmarshalBinary(b []byte) error { + var res ExcessWeightRecord + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/list_move.go b/pkg/gen/primemessages/list_move.go new file mode 100644 index 00000000000..27440ca263b --- /dev/null +++ b/pkg/gen/primemessages/list_move.go @@ -0,0 +1,414 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ListMove An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to fetch a list of moves more efficiently. +// +// swagger:model ListMove +type ListMove struct { + + // amendments + Amendments *Amendments `json:"amendments,omitempty"` + + // approved at + // Read Only: true + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination g b l o c + // Example: JFK + // Read Only: true + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + // destination postal code + // Example: 90210 + // Read Only: true + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // ppm type + // Enum: [FULL PARTIAL] + PpmType string `json:"ppmType,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this list move +func (m *ListMove) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAmendments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListMove) validateAmendments(formats strfmt.Registry) error { + if swag.IsZero(m.Amendments) { // not required + return nil + } + + if m.Amendments != nil { + if err := m.Amendments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("amendments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("amendments") + } + return err + } + } + + return nil +} + +func (m *ListMove) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListMove) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListMove) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ListMove) 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 *ListMove) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +var listMoveTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["FULL","PARTIAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + listMoveTypePpmTypePropEnum = append(listMoveTypePpmTypePropEnum, v) + } +} + +const ( + + // ListMovePpmTypeFULL captures enum value "FULL" + ListMovePpmTypeFULL string = "FULL" + + // ListMovePpmTypePARTIAL captures enum value "PARTIAL" + ListMovePpmTypePARTIAL string = "PARTIAL" +) + +// prop value enum +func (m *ListMove) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, listMoveTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *ListMove) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *ListMove) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this list move based on the context it is used +func (m *ListMove) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAmendments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateApprovedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ListMove) contextValidateAmendments(ctx context.Context, formats strfmt.Registry) error { + + if m.Amendments != nil { + + if swag.IsZero(m.Amendments) { // not required + return nil + } + + if err := m.Amendments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("amendments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("amendments") + } + return err + } + } + + return nil +} + +func (m *ListMove) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *ListMove) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ListMove) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ListMove) UnmarshalBinary(b []byte) error { + var res ListMove + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/list_moves.go b/pkg/gen/primemessages/list_moves.go new file mode 100644 index 00000000000..87569e32a25 --- /dev/null +++ b/pkg/gen/primemessages/list_moves.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ListMoves list moves +// +// swagger:model ListMoves +type ListMoves []*ListMove + +// Validate validates this list moves +func (m ListMoves) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this list moves based on the context it is used +func (m ListMoves) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_agent.go b/pkg/gen/primemessages/m_t_o_agent.go new file mode 100644 index 00000000000..8aaa1b947f2 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_agent.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgent m t o agent +// +// swagger:model MTOAgent +type MTOAgent struct { + + // agent type + AgentType MTOAgentType `json:"agentType,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ + Email *string `json:"email,omitempty"` + + // first name + FirstName *string `json:"firstName,omitempty"` + + // The ID of the agent. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName *string `json:"lastName,omitempty"` + + // The ID of the shipment this agent is permitted to release/receive. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // phone + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + Phone *string `json:"phone,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o agent +func (m *MTOAgent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o agent based on the context it is used +func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOAgent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOAgent) UnmarshalBinary(b []byte) error { + var res MTOAgent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_agent_type.go b/pkg/gen/primemessages/m_t_o_agent_type.go new file mode 100644 index 00000000000..b17beab73d9 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_agent_type.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOAgentType Agent Type +// +// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. +// +// Example: RELEASING_AGENT +// +// swagger:model MTOAgentType +type MTOAgentType string + +func NewMTOAgentType(value MTOAgentType) *MTOAgentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOAgentType. +func (m MTOAgentType) Pointer() *MTOAgentType { + return &m +} + +const ( + + // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" + + // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" +) + +// for schema +var mTOAgentTypeEnum []interface{} + +func init() { + var res []MTOAgentType + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) + } +} + +func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { + if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o agent type +func (m MTOAgentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o agent type based on context it is used +func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_agents.go b/pkg/gen/primemessages/m_t_o_agents.go new file mode 100644 index 00000000000..581e925c72e --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_agents.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. +// +// swagger:model MTOAgents +type MTOAgents []*MTOAgent + +// Validate validates this m t o agents +func (m MTOAgents) Validate(formats strfmt.Registry) error { + var res []error + + iMTOAgentsSize := int64(len(m)) + + if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { + return err + } + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents based on the context it is used +func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item.go b/pkg/gen/primemessages/m_t_o_service_item.go new file mode 100644 index 00000000000..1db2b84d144 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item.go @@ -0,0 +1,523 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. +// +// swagger:discriminator MTOServiceItem modelType +type MTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // A hash unique to this service item that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag() string + SetETag(string) + + // The ID of the service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // locked price cents + LockedPriceCents() *int64 + SetLockedPriceCents(*int64) + + // model type + // Required: true + ModelType() MTOServiceItemModelType + SetModelType(MTOServiceItemModelType) + + // The ID of the move for this service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID() *strfmt.UUID + SetMoveTaskOrderID(*strfmt.UUID) + + // The ID of the shipment this service is for, if any. Optional. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID() strfmt.UUID + SetMtoShipmentID(strfmt.UUID) + + // The full descriptive name of the service. + // Read Only: true + ReServiceName() string + SetReServiceName(string) + + // The reason why this service item was rejected by the TOO. + // Example: item was too heavy + // Read Only: true + RejectionReason() *string + SetRejectionReason(*string) + + // service request documents + ServiceRequestDocuments() ServiceRequestDocuments + SetServiceRequestDocuments(ServiceRequestDocuments) + + // status + Status() MTOServiceItemStatus + SetStatus(MTOServiceItemStatus) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type mTOServiceItem struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + modelTypeField MTOServiceItemModelType + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus +} + +// ETag gets the e tag of this polymorphic type +func (m *mTOServiceItem) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this polymorphic type +func (m *mTOServiceItem) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this polymorphic type +func (m *mTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *mTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this polymorphic type +func (m *mTOServiceItem) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this polymorphic type +func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { + return "MTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this polymorphic type +func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this polymorphic type +func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this polymorphic type +func (m *mTOServiceItem) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this polymorphic type +func (m *mTOServiceItem) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this polymorphic type +func (m *mTOServiceItem) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this polymorphic type +func (m *mTOServiceItem) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this polymorphic type +func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this polymorphic type +func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this polymorphic type +func (m *mTOServiceItem) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this polymorphic type +func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem +func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []MTOServiceItem + for _, element := range elements { + obj, err := unmarshalMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem +func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalMTOServiceItem(data, consumer) +} + +func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "MTOServiceItem": + var result mTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemBasic": + var result MTOServiceItemBasic + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDestSIT": + var result MTOServiceItemDestSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDomesticCrating": + var result MTOServiceItemDomesticCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemInternationalCrating": + var result MTOServiceItemInternationalCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemInternationalFuelSurcharge": + var result MTOServiceItemInternationalFuelSurcharge + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemOriginSIT": + var result MTOServiceItemOriginSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemShuttle": + var result MTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this m t o service item +func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this m t o service item based on the context it is used +func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_basic.go b/pkg/gen/primemessages/m_t_o_service_item_basic.go new file mode 100644 index 00000000000..f3f54f1006d --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_basic.go @@ -0,0 +1,574 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemBasic +type MTOServiceItemBasic struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemBasic) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemBasic) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemBasic) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { + return "MTOServiceItemBasic" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemBasic) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemBasic) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemBasic) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { + var data struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemBasic + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + }{ + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item basic +func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if m.ReServiceCode != nil { + if err := m.ReServiceCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// ContextValidate validate this m t o service item basic based on the context it is used +func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceCode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { + + if m.ReServiceCode != nil { + + if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { + var res MTOServiceItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go new file mode 100644 index 00000000000..5d59ad3dfd3 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_dest_s_i_t.go @@ -0,0 +1,987 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDestSIT +type MTOServiceItemDestSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDestSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDestSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDestSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDestSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDestSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item dest s i t +func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item dest s i t based on the context it is used +func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDestSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_dimension.go b/pkg/gen/primemessages/m_t_o_service_item_dimension.go new file mode 100644 index 00000000000..f421da2f819 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_dimension.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. +// +// swagger:model MTOServiceItemDimension +type MTOServiceItemDimension struct { + + // Height in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Height *int32 `json:"height"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Length in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Length *int32 `json:"length"` + + // Width in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Width *int32 `json:"width"` +} + +// Validate validates this m t o service item dimension +func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLength(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { + + if err := validate.Required("height", "body", m.Height); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { + + if err := validate.Required("length", "body", m.Length); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { + + if err := validate.Required("width", "body", m.Width); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this m t o service item dimension based on context it is used +func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDimension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go new file mode 100644 index 00000000000..edbed95f813 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_domestic_crating.go @@ -0,0 +1,705 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDomesticCrating +type MTOServiceItemDomesticCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.Item = data.Item + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + Item: m.Item, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic crating +func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic crating based on the context it is used +func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_international_crating.go b/pkg/gen/primemessages/m_t_o_service_item_international_crating.go new file mode 100644 index 00000000000..eaac651416d --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_international_crating.go @@ -0,0 +1,773 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemInternationalCrating +type MTOServiceItemInternationalCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemInternationalCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemInternationalCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.ExternalCrate = data.ExternalCrate + result.Item = data.Item + result.Market = data.Market + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + ExternalCrate: m.ExternalCrate, + + Item: m.Item, + + Market: m.Market, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item international crating +func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarket(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { + + if swag.IsZero(m.Market) { // not required + return nil + } + + // value enum + if err := m.validateMarketEnum("market", "body", m.Market); err != nil { + return err + } + + return nil +} + +var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item international crating based on the context it is used +func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemInternationalCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go b/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go new file mode 100644 index 00000000000..97290b6cc40 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_international_fuel_surcharge.go @@ -0,0 +1,575 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemInternationalFuelSurcharge Describes a international Port of Embarkation/Debarkation fuel surcharge service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemInternationalFuelSurcharge +type MTOServiceItemInternationalFuelSurcharge struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A unique code for a Port + PortCode string `json:"portCode,omitempty"` + + // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) ModelType() MTOServiceItemModelType { + return "MTOServiceItemInternationalFuelSurcharge" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemInternationalFuelSurcharge) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalJSON(raw []byte) error { + var data struct { + + // A unique code for a Port + PortCode string `json:"portCode,omitempty"` + + // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemInternationalFuelSurcharge + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.PortCode = data.PortCode + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemInternationalFuelSurcharge) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A unique code for a Port + PortCode string `json:"portCode,omitempty"` + + // A unique code for the service item. Indicates if the service is for Port of Embarkation (POEFSC) or Port of Debarkation (PODFSC). + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + }{ + + PortCode: m.PortCode, + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item international fuel surcharge +func (m *MTOServiceItemInternationalFuelSurcharge) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) 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 *MTOServiceItemInternationalFuelSurcharge) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PODFSC","POEFSC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum = append(mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalFuelSurchargeTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item international fuel surcharge based on the context it is used +func (m *MTOServiceItemInternationalFuelSurcharge) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalFuelSurcharge) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemInternationalFuelSurcharge) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemInternationalFuelSurcharge) UnmarshalBinary(b []byte) error { + var res MTOServiceItemInternationalFuelSurcharge + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_model_type.go b/pkg/gen/primemessages/m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..ffdea3d8c15 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_model_type.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. +// +// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DOFSIT, DOASIT - MTOServiceItemOriginSIT +// - DDFSIT, DDASIT - MTOServiceItemDestSIT +// - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DCRT, DUCRT - MTOServiceItemDomesticCrating +// - ICRT, IUCRT - MTOServiceItemInternationalCrating +// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge +// +// The documentation will then update with the supported fields. +// +// swagger:model MTOServiceItemModelType +type MTOServiceItemModelType string + +func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. +func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { + return &m +} + +const ( + + // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" + MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" + + // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" + MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" + + // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" + MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" + + // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" + MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + + // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" + MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" + + // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" + MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" + + // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" + MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" +) + +// for schema +var mTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []MTOServiceItemModelType + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) + } +} + +func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item model type +func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o service item model type based on context it is used +func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go new file mode 100644 index 00000000000..fc2af97e4e5 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_origin_s_i_t.go @@ -0,0 +1,900 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemOriginSIT +type MTOServiceItemOriginSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemOriginSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemOriginSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitEntryDate = data.SitEntryDate + result.SitHHGActualOrigin = data.SitHHGActualOrigin + result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + }{ + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitEntryDate: m.SitEntryDate, + + SitHHGActualOrigin: m.SitHHGActualOrigin, + + SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item origin s i t +func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGActualOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGOriginalOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if m.SitHHGActualOrigin != nil { + if err := m.SitHHGActualOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if m.SitHHGOriginalOrigin != nil { + if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { + return err + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item origin s i t based on the context it is used +func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGActualOrigin != nil { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGOriginalOrigin != nil { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemOriginSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_shuttle.go b/pkg/gen/primemessages/m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..b479f43283c --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemShuttle Describes a shuttle service item. +// +// swagger:model MTOServiceItemShuttle +type MTOServiceItemShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item shuttle +func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item shuttle based on the context it is used +func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_status.go b/pkg/gen/primemessages/m_t_o_service_item_status.go new file mode 100644 index 00000000000..2670354b836 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. +// +// swagger:model MTOServiceItemStatus +type MTOServiceItemStatus string + +func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. +func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { + return &m +} + +const ( + + // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" + MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" + + // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" + MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" + + // MTOServiceItemStatusREJECTED captures enum value "REJECTED" + MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" +) + +// for schema +var mTOServiceItemStatusEnum []interface{} + +func init() { + var res []MTOServiceItemStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) + } +} + +func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item status +func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item status based on the context it is used +func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_shipment.go b/pkg/gen/primemessages/m_t_o_shipment.go new file mode 100644 index 00000000000..a5ca83244c0 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_shipment.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipment m t o shipment +// +// swagger:model MTOShipment +type MTOShipment struct { + MTOShipmentWithoutServiceItems + + mtoServiceItemsField []MTOServiceItem +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOShipment) UnmarshalJSON(raw []byte) error { + var data struct { + MTOShipmentWithoutServiceItems + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var propMtoServiceItems []MTOServiceItem + if string(data.MtoServiceItems) != "null" { + mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + propMtoServiceItems = mtoServiceItems + } + + var result MTOShipment + + result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOShipment) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + MTOShipmentWithoutServiceItems + }{ + + MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o shipment +func (m *MTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItems()) { // not required + return nil + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// ContextValidate validate this m t o shipment based on the context it is used +func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipment) UnmarshalBinary(b []byte) error { + var res MTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_shipment_type.go b/pkg/gen/primemessages/m_t_o_shipment_type.go new file mode 100644 index 00000000000..45ce8a14201 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_shipment_type.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType Shipment Type +// +// The type of shipment. +// - `HHG` = Household goods move +// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) +// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) +// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) +// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination +// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer +// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. +// +// Example: HHG +// +// swagger:model MTOShipmentType +type MTOShipmentType string + +func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType. +func (m MTOShipmentType) Pointer() *MTOShipmentType { + return &m +} + +const ( + + // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" + + // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" + + // MTOShipmentTypeHHG captures enum value "HHG" + MTOShipmentTypeHHG MTOShipmentType = "HHG" + + // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" + + // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" + + // MTOShipmentTypePPM captures enum value "PPM" + MTOShipmentTypePPM MTOShipmentType = "PPM" + + // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" +) + +// for schema +var mTOShipmentTypeEnum []interface{} + +func init() { + var res []MTOShipmentType + if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) + } +} + +func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type +func (m MTOShipmentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type based on context it is used +func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go b/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go new file mode 100644 index 00000000000..f3cbfc05c16 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_shipment_without_service_items.go @@ -0,0 +1,1282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipmentWithoutServiceItems m t o shipment without service items +// +// swagger:model MTOShipmentWithoutServiceItems +type MTOShipmentWithoutServiceItems struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // The actual weight of any pro gear being shipped. + // + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // The actual weight of any spouse pro gear being shipped. + // + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // The date when the Task Ordering Officer first approved this shipment for the move. + // Read Only: true + // Format: date + ApprovedDate *strfmt.Date `json:"approvedDate"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + // Read Only: true + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // The customer can use the customer remarks field to inform the services counselor and the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Customer enters this information during onboarding. Optional field. + // + // Example: handle with care + // Read Only: true + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // delivery address update + DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // The SIT authorized end date for destination SIT. + // Format: date + DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The reason the TOO provided when requesting a diversion for this shipment. + // + // Read Only: true + DiversionReason *string `json:"diversionReason,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The ID of the shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Single-letter designator for domestic (d) or international (i) shipments + // Example: d + // Enum: [d i] + MarketCode string `json:"marketCode,omitempty"` + + // The ID of the move for this shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The SIT authorized end date for origin SIT. + // Format: date + OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date when the Prime contractor recorded the shipment's estimated weight. + // Read Only: true + // Format: date + PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` + + // The customer's preferred delivery date. + // Read Only: true + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` + + // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. + // + // Read Only: true + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` + + // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. + // + // Read Only: true + // Format: date + RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` + + // reweigh + Reweigh *Reweigh `json:"reweigh,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // sit extensions + SitExtensions SITExtensions `json:"sitExtensions,omitempty"` + + // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. + // + // Read Only: true + // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] + Status string `json:"status,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o shipment without service items +func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddressUpdate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReweigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExtensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if m.DeliveryAddressUpdate != nil { + if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) 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 +} + +var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" + MTOShipmentWithoutServiceItemsMarketCodeD string = "d" + + // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" + MTOShipmentWithoutServiceItemsMarketCodeI string = "i" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.OriginSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required + return nil + } + + if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if m.Reweigh != nil { + if err := m.Reweigh.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { + if swag.IsZero(m.SitExtensions) { // not required + return nil + } + + if err := m.SitExtensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" + + // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" + MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" + + // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" + MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" + MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" + + // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment without service items based on the context it is used +func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateApprovedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDiversionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReweigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitExtensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.DeliveryAddressUpdate != nil { + + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { + + if m.Reweigh != nil { + + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { + var res MTOShipmentWithoutServiceItems + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go new file mode 100644 index 00000000000..bfdddceba39 --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_shipments_without_service_objects.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. +// +// swagger:model MTOShipmentsWithoutServiceObjects +type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems + +// Validate validates this m t o shipments without service objects +func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments without service objects based on the context it is used +func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/move_task_order.go b/pkg/gen/primemessages/move_task_order.go new file mode 100644 index 00000000000..befdf8fe3d0 --- /dev/null +++ b/pkg/gen/primemessages/move_task_order.go @@ -0,0 +1,939 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveTaskOrder move task order +// +// swagger:model MoveTaskOrder +type MoveTaskOrder struct { + + // approved at + // Read Only: true + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination g b l o c + // Example: KKFA + // Read Only: true + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + // destination postal code + // Example: 90210 + // Read Only: true + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // excess weight acknowledged at + // Read Only: true + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + // excess weight qualified at + // Read Only: true + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + // excess weight upload Id + // Read Only: true + // Format: uuid + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + mtoServiceItemsField []MTOServiceItem + + // mto shipments + // Required: true + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + // order + Order *Order `json:"order,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // payment requests + // Required: true + PaymentRequests PaymentRequests `json:"paymentRequests"` + + // ppm estimated weight + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + // ppm type + // Enum: [PARTIAL FULL] + PpmType string `json:"ppmType,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { + var data struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + + var result MoveTaskOrder + + // approvedAt + result.ApprovedAt = data.ApprovedAt + + // availableToPrimeAt + result.AvailableToPrimeAt = data.AvailableToPrimeAt + + // createdAt + result.CreatedAt = data.CreatedAt + + // destinationGBLOC + result.DestinationGBLOC = data.DestinationGBLOC + + // destinationPostalCode + result.DestinationPostalCode = data.DestinationPostalCode + + // eTag + result.ETag = data.ETag + + // excessWeightAcknowledgedAt + result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt + + // excessWeightQualifiedAt + result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt + + // excessWeightUploadId + result.ExcessWeightUploadID = data.ExcessWeightUploadID + + // id + result.ID = data.ID + + // moveCode + result.MoveCode = data.MoveCode + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + // mtoShipments + result.MtoShipments = data.MtoShipments + + // order + result.Order = data.Order + + // orderID + result.OrderID = data.OrderID + + // paymentRequests + result.PaymentRequests = data.PaymentRequests + + // ppmEstimatedWeight + result.PpmEstimatedWeight = data.PpmEstimatedWeight + + // ppmType + result.PpmType = data.PpmType + + // primeCounselingCompletedAt + result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt + + // referenceId + result.ReferenceID = data.ReferenceID + + // updatedAt + result.UpdatedAt = data.UpdatedAt + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + }{ + + ApprovedAt: m.ApprovedAt, + + AvailableToPrimeAt: m.AvailableToPrimeAt, + + CreatedAt: m.CreatedAt, + + DestinationGBLOC: m.DestinationGBLOC, + + DestinationPostalCode: m.DestinationPostalCode, + + ETag: m.ETag, + + ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, + + ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, + + ExcessWeightUploadID: m.ExcessWeightUploadID, + + ID: m.ID, + + MoveCode: m.MoveCode, + + MtoShipments: m.MtoShipments, + + Order: m.Order, + + OrderID: m.OrderID, + + PaymentRequests: m.PaymentRequests, + + PpmEstimatedWeight: m.PpmEstimatedWeight, + + PpmType: m.PpmType, + + PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, + + ReferenceID: m.ReferenceID, + + UpdatedAt: m.UpdatedAt, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this move task order +func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightUploadID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequests(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightUploadID) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { + + if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { + + if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { + return err + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(m.Order) { // not required + return nil + } + + if m.Order != nil { + if err := m.Order.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { + + if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { + return err + } + + if err := m.PaymentRequests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +var moveTaskOrderTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) + } +} + +const ( + + // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" + MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" + + // MoveTaskOrderPpmTypeFULL captures enum value "FULL" + MoveTaskOrderPpmTypeFULL string = "FULL" +) + +// prop value enum +func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move task order based on the context it is used +func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApprovedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.Order != nil { + + if swag.IsZero(m.Order) { // not required + return nil + } + + if err := m.Order.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { + var res MoveTaskOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/order.go b/pkg/gen/primemessages/order.go new file mode 100644 index 00000000000..d19b30056eb --- /dev/null +++ b/pkg/gen/primemessages/order.go @@ -0,0 +1,448 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // customer + Customer *Customer `json:"customer,omitempty"` + + // customer ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CustomerID strfmt.UUID `json:"customerID,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // destination duty location g b l o c + // Example: KKFA + DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // entitlement + Entitlement *Entitlements `json:"entitlement,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lines of accounting + // Required: true + LinesOfAccounting *string `json:"linesOfAccounting"` + + // order number + // Required: true + OrderNumber *string `json:"orderNumber"` + + // orders type + OrdersType OrdersType `json:"ordersType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin duty location g b l o c + // Example: KKFA + OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` + + // rank + // Example: E_5 + // Required: true + Rank *string `json:"rank"` + + // report by date + // Format: date + ReportByDate strfmt.Date `json:"reportByDate,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinesOfAccounting(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRank(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) validateCustomerID(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerID) { // not required + return nil + } + + if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { + + if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrderNumber(formats strfmt.Registry) error { + + if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrdersType(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateRank(formats strfmt.Registry) error { + + if err := validate.Required("rank", "body", m.Rank); err != nil { + return err + } + + return nil +} + +func (m *Order) validateReportByDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReportByDate) { // not required + return nil + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this order based on the context it is used +func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/orders_type.go b/pkg/gen/primemessages/orders_type.go new file mode 100644 index 00000000000..84f9bf262bc --- /dev/null +++ b/pkg/gen/primemessages/orders_type.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersType Orders type +// +// swagger:model OrdersType +type OrdersType string + +func NewOrdersType(value OrdersType) *OrdersType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersType. +func (m OrdersType) Pointer() *OrdersType { + return &m +} + +const ( + + // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" + OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" + + // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" + OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" + + // OrdersTypeRETIREMENT captures enum value "RETIREMENT" + OrdersTypeRETIREMENT OrdersType = "RETIREMENT" + + // OrdersTypeSEPARATION captures enum value "SEPARATION" + OrdersTypeSEPARATION OrdersType = "SEPARATION" + + // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" + OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" + + // OrdersTypeBLUEBARK captures enum value "BLUEBARK" + OrdersTypeBLUEBARK OrdersType = "BLUEBARK" + + // OrdersTypeSAFETY captures enum value "SAFETY" + OrdersTypeSAFETY OrdersType = "SAFETY" + + // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" + OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" + + // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" + OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" + + // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" + OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" +) + +// for schema +var ordersTypeEnum []interface{} + +func init() { + var res []OrdersType + if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeEnum = append(ordersTypeEnum, v) + } +} + +func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { + if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type +func (m OrdersType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type based on context it is used +func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/p_p_m_shipment.go b/pkg/gen/primemessages/p_p_m_shipment.go new file mode 100644 index 00000000000..245ad0bbdf8 --- /dev/null +++ b/pkg/gen/primemessages/p_p_m_shipment.go @@ -0,0 +1,587 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment +type PPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // The timestamp of when the PPM shipment was created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved in pounds. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin moving from their origin. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // The primary unique identifier of this PPM shipment + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + MaxIncentive *int64 `json:"maxIncentive"` + + // The estimated weight of the pro-gear being moved belonging to the service member in pounds. + ProGearWeight *int64 `json:"proGearWeight"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // The id of the parent MTOShipment record + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage in pounds. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // The timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this p p m shipment +func (m *PPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment based on the context it is used +func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment) UnmarshalBinary(b []byte) error { + var res PPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/p_p_m_shipment_status.go b/pkg/gen/primemessages/p_p_m_shipment_status.go new file mode 100644 index 00000000000..8c3914c3f73 --- /dev/null +++ b/pkg/gen/primemessages/p_p_m_shipment_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMShipmentStatus Status of the PPM Shipment: +// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. +// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. +// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. +// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. +// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. +// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. +// +// swagger:model PPMShipmentStatus +type PPMShipmentStatus string + +func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. +func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { + return &m +} + +const ( + + // PPMShipmentStatusDRAFT captures enum value "DRAFT" + PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" + + // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" + PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" + + // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" + + // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" + + // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" + + // PPMShipmentStatusCANCELED captures enum value "CANCELED" + PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" +) + +// for schema +var pPMShipmentStatusEnum []interface{} + +func init() { + var res []PPMShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) + } +} + +func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { + if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m shipment status +func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p p m shipment status based on the context it is used +func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/payment_request.go b/pkg/gen/primemessages/payment_request.go new file mode 100644 index 00000000000..48ab8978bdf --- /dev/null +++ b/pkg/gen/primemessages/payment_request.go @@ -0,0 +1,322 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // payment service items + PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` + + // proof of service docs + ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfServiceDocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItems) { // not required + return nil + } + + if err := m.PaymentServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { + if swag.IsZero(m.ProofOfServiceDocs) { // not required + return nil + } + + if err := m.ProofOfServiceDocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/payment_request_status.go b/pkg/gen/primemessages/payment_request_status.go new file mode 100644 index 00000000000..20f20f17521 --- /dev/null +++ b/pkg/gen/primemessages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" + PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/payment_requests.go b/pkg/gen/primemessages/payment_requests.go new file mode 100644 index 00000000000..0c9e1a8df23 --- /dev/null +++ b/pkg/gen/primemessages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/payment_service_item.go b/pkg/gen/primemessages/payment_service_item.go new file mode 100644 index 00000000000..71949ff2851 --- /dev/null +++ b/pkg/gen/primemessages/payment_service_item.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItem payment service item +// +// swagger:model PaymentServiceItem +type PaymentServiceItem struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // payment service item params + PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` + + // Price of the service item in cents + PriceCents *int64 `json:"priceCents,omitempty"` + + // reference ID + // Example: 1234-5678-c56a4180 + // Read Only: true + ReferenceID string `json:"referenceID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentServiceItemStatus `json:"status,omitempty"` +} + +// Validate validates this payment service item +func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemParams) { // not required + return nil + } + + if err := m.PaymentServiceItemParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item based on the context it is used +func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferenceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { + var res PaymentServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/payment_service_item_param.go b/pkg/gen/primemessages/payment_service_item_param.go new file mode 100644 index 00000000000..e21fefaa831 --- /dev/null +++ b/pkg/gen/primemessages/payment_service_item_param.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemParam payment service item param +// +// swagger:model PaymentServiceItemParam +type PaymentServiceItemParam struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // key + Key ServiceItemParamName `json:"key,omitempty"` + + // origin + Origin ServiceItemParamOrigin `json:"origin,omitempty"` + + // payment service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` + + // type + Type ServiceItemParamType `json:"type,omitempty"` + + // value + // Example: 3025 + Value string `json:"value,omitempty"` +} + +// Validate validates this payment service item param +func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item param based on the context it is used +func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKey(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { + var res PaymentServiceItemParam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/payment_service_item_params.go b/pkg/gen/primemessages/payment_service_item_params.go new file mode 100644 index 00000000000..39fa10e8c35 --- /dev/null +++ b/pkg/gen/primemessages/payment_service_item_params.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItemParams payment service item params +// +// swagger:model PaymentServiceItemParams +type PaymentServiceItemParams []*PaymentServiceItemParam + +// Validate validates this payment service item params +func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service item params based on the context it is used +func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/payment_service_item_status.go b/pkg/gen/primemessages/payment_service_item_status.go new file mode 100644 index 00000000000..a15c35ec7e6 --- /dev/null +++ b/pkg/gen/primemessages/payment_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemStatus Payment Service Item Status +// +// swagger:model PaymentServiceItemStatus +type PaymentServiceItemStatus string + +func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. +func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { + return &m +} + +const ( + + // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" + PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" + + // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" + PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" + + // PaymentServiceItemStatusDENIED captures enum value "DENIED" + PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" + + // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" + + // PaymentServiceItemStatusPAID captures enum value "PAID" + PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" + + // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" + PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" +) + +// for schema +var paymentServiceItemStatusEnum []interface{} + +func init() { + var res []PaymentServiceItemStatus + if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) + } +} + +func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment service item status +func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment service item status based on context it is used +func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/payment_service_items.go b/pkg/gen/primemessages/payment_service_items.go new file mode 100644 index 00000000000..be1287570cb --- /dev/null +++ b/pkg/gen/primemessages/payment_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItems payment service items +// +// swagger:model PaymentServiceItems +type PaymentServiceItems []*PaymentServiceItem + +// Validate validates this payment service items +func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service items based on the context it is used +func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/proof_of_service_doc.go b/pkg/gen/primemessages/proof_of_service_doc.go new file mode 100644 index 00000000000..3833a3354f9 --- /dev/null +++ b/pkg/gen/primemessages/proof_of_service_doc.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDoc proof of service doc +// +// swagger:model ProofOfServiceDoc +type ProofOfServiceDoc struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this proof of service doc +func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service doc based on the context it is used +func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { + var res ProofOfServiceDoc + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/proof_of_service_docs.go b/pkg/gen/primemessages/proof_of_service_docs.go new file mode 100644 index 00000000000..94eb375c5ed --- /dev/null +++ b/pkg/gen/primemessages/proof_of_service_docs.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDocs proof of service docs +// +// swagger:model ProofOfServiceDocs +type ProofOfServiceDocs []*ProofOfServiceDoc + +// Validate validates this proof of service docs +func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this proof of service docs based on the context it is used +func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/re_service_code.go b/pkg/gen/primemessages/re_service_code.go new file mode 100644 index 00000000000..33db5909d41 --- /dev/null +++ b/pkg/gen/primemessages/re_service_code.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items +// may be requested by the Prime, but may be returned in a response. +// +// Documentation of all the service items will be provided. +// +// swagger:model ReServiceCode +type ReServiceCode string + +func NewReServiceCode(value ReServiceCode) *ReServiceCode { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReServiceCode. +func (m ReServiceCode) Pointer() *ReServiceCode { + return &m +} + +const ( + + // ReServiceCodeCS captures enum value "CS" + ReServiceCodeCS ReServiceCode = "CS" + + // ReServiceCodeDBHF captures enum value "DBHF" + ReServiceCodeDBHF ReServiceCode = "DBHF" + + // ReServiceCodeDBTF captures enum value "DBTF" + ReServiceCodeDBTF ReServiceCode = "DBTF" + + // ReServiceCodeDCRT captures enum value "DCRT" + ReServiceCodeDCRT ReServiceCode = "DCRT" + + // ReServiceCodeDDASIT captures enum value "DDASIT" + ReServiceCodeDDASIT ReServiceCode = "DDASIT" + + // ReServiceCodeDDDSIT captures enum value "DDDSIT" + ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" + + // ReServiceCodeDDFSIT captures enum value "DDFSIT" + ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" + + // ReServiceCodeDDP captures enum value "DDP" + ReServiceCodeDDP ReServiceCode = "DDP" + + // ReServiceCodeDDSHUT captures enum value "DDSHUT" + ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" + + // ReServiceCodeDLH captures enum value "DLH" + ReServiceCodeDLH ReServiceCode = "DLH" + + // ReServiceCodeDMHF captures enum value "DMHF" + ReServiceCodeDMHF ReServiceCode = "DMHF" + + // ReServiceCodeDNPK captures enum value "DNPK" + ReServiceCodeDNPK ReServiceCode = "DNPK" + + // ReServiceCodeDOASIT captures enum value "DOASIT" + ReServiceCodeDOASIT ReServiceCode = "DOASIT" + + // ReServiceCodeDOFSIT captures enum value "DOFSIT" + ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" + + // ReServiceCodeDOP captures enum value "DOP" + ReServiceCodeDOP ReServiceCode = "DOP" + + // ReServiceCodeDOPSIT captures enum value "DOPSIT" + ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" + + // ReServiceCodeDOSHUT captures enum value "DOSHUT" + ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" + + // ReServiceCodeDPK captures enum value "DPK" + ReServiceCodeDPK ReServiceCode = "DPK" + + // ReServiceCodeDSH captures enum value "DSH" + ReServiceCodeDSH ReServiceCode = "DSH" + + // ReServiceCodeDUCRT captures enum value "DUCRT" + ReServiceCodeDUCRT ReServiceCode = "DUCRT" + + // ReServiceCodeDUPK captures enum value "DUPK" + ReServiceCodeDUPK ReServiceCode = "DUPK" + + // ReServiceCodeFSC captures enum value "FSC" + ReServiceCodeFSC ReServiceCode = "FSC" + + // ReServiceCodeIBHF captures enum value "IBHF" + ReServiceCodeIBHF ReServiceCode = "IBHF" + + // ReServiceCodeIBTF captures enum value "IBTF" + ReServiceCodeIBTF ReServiceCode = "IBTF" + + // ReServiceCodeICOLH captures enum value "ICOLH" + ReServiceCodeICOLH ReServiceCode = "ICOLH" + + // ReServiceCodeICOUB captures enum value "ICOUB" + ReServiceCodeICOUB ReServiceCode = "ICOUB" + + // ReServiceCodeICRT captures enum value "ICRT" + ReServiceCodeICRT ReServiceCode = "ICRT" + + // ReServiceCodeIDASIT captures enum value "IDASIT" + ReServiceCodeIDASIT ReServiceCode = "IDASIT" + + // ReServiceCodeIDDSIT captures enum value "IDDSIT" + ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" + + // ReServiceCodeIDFSIT captures enum value "IDFSIT" + ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" + + // ReServiceCodeIDSHUT captures enum value "IDSHUT" + ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" + + // ReServiceCodeIHPK captures enum value "IHPK" + ReServiceCodeIHPK ReServiceCode = "IHPK" + + // ReServiceCodeIHUPK captures enum value "IHUPK" + ReServiceCodeIHUPK ReServiceCode = "IHUPK" + + // ReServiceCodeINPK captures enum value "INPK" + ReServiceCodeINPK ReServiceCode = "INPK" + + // ReServiceCodeIOASIT captures enum value "IOASIT" + ReServiceCodeIOASIT ReServiceCode = "IOASIT" + + // ReServiceCodeIOCLH captures enum value "IOCLH" + ReServiceCodeIOCLH ReServiceCode = "IOCLH" + + // ReServiceCodeIOCUB captures enum value "IOCUB" + ReServiceCodeIOCUB ReServiceCode = "IOCUB" + + // ReServiceCodeIOFSIT captures enum value "IOFSIT" + ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" + + // ReServiceCodeIOOLH captures enum value "IOOLH" + ReServiceCodeIOOLH ReServiceCode = "IOOLH" + + // ReServiceCodeIOOUB captures enum value "IOOUB" + ReServiceCodeIOOUB ReServiceCode = "IOOUB" + + // ReServiceCodeIOPSIT captures enum value "IOPSIT" + ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" + + // ReServiceCodeIOSHUT captures enum value "IOSHUT" + ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" + + // ReServiceCodeIUBPK captures enum value "IUBPK" + ReServiceCodeIUBPK ReServiceCode = "IUBPK" + + // ReServiceCodeIUBUPK captures enum value "IUBUPK" + ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" + + // ReServiceCodeIUCRT captures enum value "IUCRT" + ReServiceCodeIUCRT ReServiceCode = "IUCRT" + + // ReServiceCodeMS captures enum value "MS" + ReServiceCodeMS ReServiceCode = "MS" + + // ReServiceCodeNSTH captures enum value "NSTH" + ReServiceCodeNSTH ReServiceCode = "NSTH" + + // ReServiceCodeNSTUB captures enum value "NSTUB" + ReServiceCodeNSTUB ReServiceCode = "NSTUB" +) + +// for schema +var reServiceCodeEnum []interface{} + +func init() { + var res []ReServiceCode + if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceCodeEnum = append(reServiceCodeEnum, v) + } +} + +func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { + if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this re service code +func (m ReServiceCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReServiceCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this re service code based on context it is used +func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/reweigh.go b/pkg/gen/primemessages/reweigh.go new file mode 100644 index 00000000000..45bfe416ce5 --- /dev/null +++ b/pkg/gen/primemessages/reweigh.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. +// +// swagger:model Reweigh +type Reweigh struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // requested at + // Format: date-time + RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` + + // requested by + RequestedBy ReweighRequester `json:"requestedBy,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // verification provided at + // Format: date-time + VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` + + // verification reason + // Example: The reweigh was not performed due to some justification provided by the Prime + VerificationReason *string `json:"verificationReason"` + + // weight + // Example: 2000 + Weight *int64 `json:"weight"` +} + +// Validate validates this reweigh +func (m *Reweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVerificationProvidedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerificationProvidedAt) { // not required + return nil + } + + if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this reweigh based on the context it is used +func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reweigh) UnmarshalBinary(b []byte) error { + var res Reweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/reweigh_requester.go b/pkg/gen/primemessages/reweigh_requester.go new file mode 100644 index 00000000000..52c3cbd7f1c --- /dev/null +++ b/pkg/gen/primemessages/reweigh_requester.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReweighRequester reweigh requester +// +// swagger:model ReweighRequester +type ReweighRequester string + +func NewReweighRequester(value ReweighRequester) *ReweighRequester { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReweighRequester. +func (m ReweighRequester) Pointer() *ReweighRequester { + return &m +} + +const ( + + // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" + ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" + + // ReweighRequesterPRIME captures enum value "PRIME" + ReweighRequesterPRIME ReweighRequester = "PRIME" + + // ReweighRequesterSYSTEM captures enum value "SYSTEM" + ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" + + // ReweighRequesterTOO captures enum value "TOO" + ReweighRequesterTOO ReweighRequester = "TOO" +) + +// for schema +var reweighRequesterEnum []interface{} + +func init() { + var res []ReweighRequester + if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reweighRequesterEnum = append(reweighRequesterEnum, v) + } +} + +func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { + if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reweigh requester +func (m ReweighRequester) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReweighRequesterEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reweigh requester based on context it is used +func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/s_i_t_extension.go b/pkg/gen/primemessages/s_i_t_extension.go new file mode 100644 index 00000000000..d285ce4b0ab --- /dev/null +++ b/pkg/gen/primemessages/s_i_t_extension.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. +// +// swagger:model SITExtension +type SITExtension struct { + + // approved days + // Example: 30 + ApprovedDays *int64 `json:"approvedDays"` + + // contractor remarks + // Example: We need SIT additional days. The customer has not found a house yet. + ContractorRemarks *string `json:"contractorRemarks"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // decision date + // Format: date-time + DecisionDate *strfmt.DateTime `json:"decisionDate"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // office remarks + OfficeRemarks *string `json:"officeRemarks"` + + // request reason + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason string `json:"requestReason,omitempty"` + + // requested days + // Example: 30 + RequestedDays int64 `json:"requestedDays,omitempty"` + + // status + // Enum: [PENDING APPROVED DENIED] + Status interface{} `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this s i t extension +func (m *SITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { + if swag.IsZero(m.DecisionDate) { // not required + return nil + } + + if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +var sITExtensionTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) + } +} + +const ( + + // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // SITExtensionRequestReasonOTHER captures enum value "OTHER" + SITExtensionRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { + if swag.IsZero(m.RequestReason) { // not required + return nil + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t extension based on the context it is used +func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITExtension) UnmarshalBinary(b []byte) error { + var res SITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/s_i_t_extensions.go b/pkg/gen/primemessages/s_i_t_extensions.go new file mode 100644 index 00000000000..58246c7360c --- /dev/null +++ b/pkg/gen/primemessages/s_i_t_extensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITExtensions s i t extensions +// +// swagger:model SITExtensions +type SITExtensions []*SITExtension + +// Validate validates this s i t extensions +func (m SITExtensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t extensions based on the context it is used +func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/s_i_t_location_type.go b/pkg/gen/primemessages/s_i_t_location_type.go new file mode 100644 index 00000000000..dd5f183aa24 --- /dev/null +++ b/pkg/gen/primemessages/s_i_t_location_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SITLocationType The list of SIT location types. +// +// swagger:model SITLocationType +type SITLocationType string + +func NewSITLocationType(value SITLocationType) *SITLocationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SITLocationType. +func (m SITLocationType) Pointer() *SITLocationType { + return &m +} + +const ( + + // SITLocationTypeORIGIN captures enum value "ORIGIN" + SITLocationTypeORIGIN SITLocationType = "ORIGIN" + + // SITLocationTypeDESTINATION captures enum value "DESTINATION" + SITLocationTypeDESTINATION SITLocationType = "DESTINATION" +) + +// for schema +var sITLocationTypeEnum []interface{} + +func init() { + var res []SITLocationType + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITLocationTypeEnum = append(sITLocationTypeEnum, v) + } +} + +func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { + if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this s i t location type +func (m SITLocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this s i t location type based on context it is used +func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/service_item.go b/pkg/gen/primemessages/service_item.go new file mode 100644 index 00000000000..9f41d0b13e2 --- /dev/null +++ b/pkg/gen/primemessages/service_item.go @@ -0,0 +1,211 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ServiceItem service item +// +// swagger:model ServiceItem +type ServiceItem struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // This should be populated for the following service items: + // * DOASIT(Domestic origin Additional day SIT) + // * DDASIT(Domestic destination Additional day SIT) + // + // Both take in the following param keys: + // * `SITPaymentRequestStart` + // * `SITPaymentRequestEnd` + // + // The value of each is a date string in the format "YYYY-MM-DD" (e.g. "2023-01-15") + // + Params []*ServiceItemParamsItems0 `json:"params"` +} + +// Validate validates this service item +func (m *ServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateParams(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceItem) 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 *ServiceItem) validateParams(formats strfmt.Registry) error { + if swag.IsZero(m.Params) { // not required + return nil + } + + for i := 0; i < len(m.Params); i++ { + if swag.IsZero(m.Params[i]) { // not required + continue + } + + if m.Params[i] != nil { + if err := m.Params[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service item based on the context it is used +func (m *ServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateParams(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *ServiceItem) contextValidateParams(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Params); i++ { + + if m.Params[i] != nil { + + if swag.IsZero(m.Params[i]) { // not required + return nil + } + + if err := m.Params[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("params" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("params" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceItem) UnmarshalBinary(b []byte) error { + var res ServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ServiceItemParamsItems0 service item params items0 +// +// swagger:model ServiceItemParamsItems0 +type ServiceItemParamsItems0 struct { + + // key + // Example: Service Item Parameter Name + Key string `json:"key,omitempty"` + + // value + // Example: Service Item Parameter Value + Value string `json:"value,omitempty"` +} + +// Validate validates this service item params items0 +func (m *ServiceItemParamsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this service item params items0 based on context it is used +func (m *ServiceItemParamsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceItemParamsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceItemParamsItems0) UnmarshalBinary(b []byte) error { + var res ServiceItemParamsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/service_item_param_name.go b/pkg/gen/primemessages/service_item_param_name.go new file mode 100644 index 00000000000..d43a63a69f7 --- /dev/null +++ b/pkg/gen/primemessages/service_item_param_name.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamName service item param name +// +// swagger:model ServiceItemParamName +type ServiceItemParamName string + +func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. +func (m ServiceItemParamName) Pointer() *ServiceItemParamName { + return &m +} + +const ( + + // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" + ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" + + // ServiceItemParamNameContractCode captures enum value "ContractCode" + ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" + + // ServiceItemParamNameContractYearName captures enum value "ContractYearName" + ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" + + // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" + ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" + + // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" + ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" + + // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" + ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" + + // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" + ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" + + // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" + ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" + + // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" + ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" + + // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" + ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" + + // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" + ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" + + // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" + ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" + + // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" + ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" + + // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" + ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" + + // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" + ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" + + // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" + ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" + + // ServiceItemParamNameIsPeak captures enum value "IsPeak" + ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" + + // ServiceItemParamNameMarketDest captures enum value "MarketDest" + ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" + + // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" + ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" + + // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" + ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" + + // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" + ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" + + // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" + ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" + + // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" + ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" + + // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" + ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" + + // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" + ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" + + // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" + ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" + + // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" + ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" + + // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" + ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" + + // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" + ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" + + // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" + ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" + + // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" + ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" + + // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" + ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" + + // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" + ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" + + // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" + ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" + + // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" + ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" + ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" + + // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" + ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" + + // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" + ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" + + // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" + + // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" + ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" + + // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" + ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" + + // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" + ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" + + // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" + ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" + + // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" + ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" + + // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" + ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" + + // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" + ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" + + // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" + ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" + + // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" + ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" + + // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" + ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" + + // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" + ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" + + // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" + ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" + + // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" + ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" + + // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" + ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" + + // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" + ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" + + // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" + ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" + + // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" + ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" + + // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" + ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" + + // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" + ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" + + // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" + ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" + + // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" + ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" + + // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" + ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" + + // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" + ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" + + // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" + ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" + + // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" + ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" + + // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" + ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" + + // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" + ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" + + // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" + ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" + + // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" + ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" +) + +// for schema +var serviceItemParamNameEnum []interface{} + +func init() { + var res []ServiceItemParamName + if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) + } +} + +func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { + if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param name +func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param name based on context it is used +func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/service_item_param_origin.go b/pkg/gen/primemessages/service_item_param_origin.go new file mode 100644 index 00000000000..9e65ab4adb7 --- /dev/null +++ b/pkg/gen/primemessages/service_item_param_origin.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamOrigin service item param origin +// +// swagger:model ServiceItemParamOrigin +type ServiceItemParamOrigin string + +func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. +func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { + return &m +} + +const ( + + // ServiceItemParamOriginPRIME captures enum value "PRIME" + ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" + + // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" + ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" + + // ServiceItemParamOriginPRICER captures enum value "PRICER" + ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" + + // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" + ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" +) + +// for schema +var serviceItemParamOriginEnum []interface{} + +func init() { + var res []ServiceItemParamOrigin + if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) + } +} + +func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { + if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param origin +func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param origin based on context it is used +func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/service_item_param_type.go b/pkg/gen/primemessages/service_item_param_type.go new file mode 100644 index 00000000000..d0ca0c2a63c --- /dev/null +++ b/pkg/gen/primemessages/service_item_param_type.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamType service item param type +// +// swagger:model ServiceItemParamType +type ServiceItemParamType string + +func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. +func (m ServiceItemParamType) Pointer() *ServiceItemParamType { + return &m +} + +const ( + + // ServiceItemParamTypeSTRING captures enum value "STRING" + ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" + + // ServiceItemParamTypeDATE captures enum value "DATE" + ServiceItemParamTypeDATE ServiceItemParamType = "DATE" + + // ServiceItemParamTypeINTEGER captures enum value "INTEGER" + ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" + + // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" + ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" + + // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" + ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" + + // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" + ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" + + // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" + ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" +) + +// for schema +var serviceItemParamTypeEnum []interface{} + +func init() { + var res []ServiceItemParamType + if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) + } +} + +func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { + if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param type +func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param type based on context it is used +func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/service_request_document.go b/pkg/gen/primemessages/service_request_document.go new file mode 100644 index 00000000000..e979808d909 --- /dev/null +++ b/pkg/gen/primemessages/service_request_document.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocument service request document +// +// swagger:model ServiceRequestDocument +type ServiceRequestDocument struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this service request document +func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request document based on the context it is used +func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { + var res ServiceRequestDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/service_request_documents.go b/pkg/gen/primemessages/service_request_documents.go new file mode 100644 index 00000000000..0f308719a75 --- /dev/null +++ b/pkg/gen/primemessages/service_request_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocuments service request documents +// +// swagger:model ServiceRequestDocuments +type ServiceRequestDocuments []*ServiceRequestDocument + +// Validate validates this service request documents +func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this service request documents based on the context it is used +func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/shipment_address_update.go b/pkg/gen/primemessages/shipment_address_update.go new file mode 100644 index 00000000000..0e5b4258565 --- /dev/null +++ b/pkg/gen/primemessages/shipment_address_update.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. +// +// swagger:model ShipmentAddressUpdate +type ShipmentAddressUpdate struct { + + // Contractor Remarks + // + // The reason there is an address change. + // Example: This is a contractor remark + // Required: true + // Read Only: true + ContractorRemarks string `json:"contractorRemarks"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` + + // The distance between the original SIT address and requested new delivery address of shipment + // Example: 88 + // Minimum: 0 + NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` + + // Office Remarks + // + // The TOO comment on approval or rejection. + // Example: This is an office remark + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // The distance between the original SIT address and the previous/old delivery address of shipment + // Example: 50 + // Minimum: 0 + OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` + + // original address + // Required: true + OriginalAddress *Address `json:"originalAddress"` + + // shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID"` + + // sit original address + SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` + + // status + // Required: true + Status ShipmentAddressUpdateStatus `json:"status"` +} + +// Validate validates this shipment address update +func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOldSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.NewSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.OldSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { + + if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { + return err + } + + if m.OriginalAddress != nil { + if err := m.OriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if m.SitOriginalAddress != nil { + if err := m.SitOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this shipment address update based on the context it is used +func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginalAddress != nil { + + if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginalAddress != nil { + + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { + var res ShipmentAddressUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/shipment_address_update_status.go b/pkg/gen/primemessages/shipment_address_update_status.go new file mode 100644 index 00000000000..9eb92bd7d2d --- /dev/null +++ b/pkg/gen/primemessages/shipment_address_update_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdateStatus Status +// +// swagger:model ShipmentAddressUpdateStatus +type ShipmentAddressUpdateStatus string + +func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. +func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { + return &m +} + +const ( + + // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" + ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" + + // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" + ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" + + // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" + ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" +) + +// for schema +var shipmentAddressUpdateStatusEnum []interface{} + +func init() { + var res []ShipmentAddressUpdateStatus + if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) + } +} + +func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { + if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this shipment address update status +func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipment address update status based on the context it is used +func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primemessages/storage_facility.go b/pkg/gen/primemessages/storage_facility.go new file mode 100644 index 00000000000..02296c4b90d --- /dev/null +++ b/pkg/gen/primemessages/storage_facility.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageFacility The Storage Facility information for the shipment +// +// swagger:model StorageFacility +type StorageFacility struct { + + // address + Address *Address `json:"address,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // facility name + FacilityName string `json:"facilityName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lot number + LotNumber *string `json:"lotNumber,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` +} + +// Validate validates this storage facility +func (m *StorageFacility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this storage facility based on the context it is used +func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageFacility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageFacility) UnmarshalBinary(b []byte) error { + var res StorageFacility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item.go b/pkg/gen/primemessages/update_m_t_o_service_item.go new file mode 100644 index 00000000000..3afb12a256e --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_service_item.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. +// +// swagger:discriminator UpdateMTOServiceItem modelType +type UpdateMTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // ID of the service item. Must match path. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // model type + // Required: true + ModelType() UpdateMTOServiceItemModelType + SetModelType(UpdateMTOServiceItemModelType) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type updateMTOServiceItem struct { + idField strfmt.UUID + + modelTypeField UpdateMTOServiceItemModelType +} + +// ID gets the id of this polymorphic type +func (m *updateMTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []UpdateMTOServiceItem + for _, element := range elements { + obj, err := unmarshalUpdateMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalUpdateMTOServiceItem(data, consumer) +} + +func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "UpdateMTOServiceItem": + var result updateMTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemInternationalPortFSC": + var result UpdateMTOServiceItemInternationalPortFSC + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemSIT": + var result UpdateMTOServiceItemSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemShuttle": + var result UpdateMTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this update m t o service item +func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) 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 +} + +// ContextValidate validate this update m t o service item based on the context it is used +func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go b/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go new file mode 100644 index 00000000000..93dfacaf425 --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_service_item_international_port_f_s_c.go @@ -0,0 +1,249 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemInternationalPortFSC Subtype used to provide the port for fuel surcharge. This is not creating a new service item but rather updating an existing service item. +// +// swagger:model UpdateMTOServiceItemInternationalPortFSC +type UpdateMTOServiceItemInternationalPortFSC struct { + idField strfmt.UUID + + // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. + // Example: PDX + PortCode *string `json:"portCode"` + + // Service code allowed for this model type. + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemInternationalPortFSC) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemInternationalPortFSC) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemInternationalPortFSC) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemInternationalPortFSC" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemInternationalPortFSC) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemInternationalPortFSC) UnmarshalJSON(raw []byte) error { + var data struct { + + // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. + // Example: PDX + PortCode *string `json:"portCode"` + + // Service code allowed for this model type. + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemInternationalPortFSC + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.PortCode = data.PortCode + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemInternationalPortFSC) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Port used for the shipment. Relevant for moving (PODFSC & POEFSC) service items. + // Example: PDX + PortCode *string `json:"portCode"` + + // Service code allowed for this model type. + // Enum: [PODFSC POEFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + }{ + + PortCode: m.PortCode, + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item international port f s c +func (m *UpdateMTOServiceItemInternationalPortFSC) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemInternationalPortFSC) 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 +} + +var updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PODFSC","POEFSC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum = append(updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemInternationalPortFSC) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemInternationalPortFSCTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemInternationalPortFSC) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item international port f s c based on the context it is used +func (m *UpdateMTOServiceItemInternationalPortFSC) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemInternationalPortFSC) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemInternationalPortFSC) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemInternationalPortFSC) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemInternationalPortFSC + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go b/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..40e86f82729 --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_service_item_model_type.go @@ -0,0 +1,95 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DDDSIT - UpdateMTOServiceItemSIT +// - DDFSIT - UpdateMTOServiceItemSIT +// - DDASIT - UpdateMTOServiceItemSIT +// - DOPSIT - UpdateMTOServiceItemSIT +// - DOASIT - UpdateMTOServiceItemSIT +// - DOFSIT - UpdateMTOServiceItemSIT +// - DOSFSC - UpdateMTOServiceItemSIT +// - DDSFSC - UpdateMTOServiceItemSIT +// - DDSHUT - UpdateMTOServiceItemShuttle +// - DOSHUT - UpdateMTOServiceItemShuttle +// - PODFSC - UpdateMTOServiceItemInternationalPortFSC +// - POEFSC - UpdateMTOServiceItemInternationalPortFSC +// +// The documentation will then update with the supported fields. +// +// swagger:model UpdateMTOServiceItemModelType +type UpdateMTOServiceItemModelType string + +func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. +func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { + return &m +} + +const ( + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemInternationalPortFSC captures enum value "UpdateMTOServiceItemInternationalPortFSC" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemInternationalPortFSC UpdateMTOServiceItemModelType = "UpdateMTOServiceItemInternationalPortFSC" +) + +// for schema +var updateMTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []UpdateMTOServiceItemModelType + if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle","UpdateMTOServiceItemInternationalPortFSC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) + } +} + +func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this update m t o service item model type +func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this update m t o service item model type based on context it is used +func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go new file mode 100644 index 00000000000..34fed36c1aa --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_service_item_s_i_t.go @@ -0,0 +1,680 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating an existing service item. +// +// swagger:model UpdateMTOServiceItemSIT +type UpdateMTOServiceItemSIT struct { + idField strfmt.UUID + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemSIT" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemSIT + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + result.UpdateReason = data.UpdateReason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DDASIT DDFSIT DDSFSC DOPSIT DOASIT DOFSIT DOSFSC] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + + UpdateReason: m.UpdateReason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item s i t +func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDDSIT","DDASIT","DDFSIT","DDSFSC","DOPSIT","DOASIT","DOFSIT","DOSFSC"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if swag.IsZero(m.SitPostalCode) { // not required + return nil + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item s i t based on the context it is used +func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..f8c82a1a9e7 --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_service_item_shuttle.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. +// +// swagger:model UpdateMTOServiceItemShuttle +type UpdateMTOServiceItemShuttle struct { + idField strfmt.UUID + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemShuttle + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item shuttle +func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) 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 +} + +var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item shuttle based on the context it is used +func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_shipment.go b/pkg/gen/primemessages/update_m_t_o_shipment.go new file mode 100644 index 00000000000..074e9772850 --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_shipment.go @@ -0,0 +1,570 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipment update m t o shipment +// +// swagger:model UpdateMTOShipment +type UpdateMTOShipment struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // The actual weight of any pro gear shipped during a move. + // Example: 4500 + // Minimum: 1 + ActualProGearWeight *int64 `json:"actualProGearWeight,omitempty"` + + // The actual weight of any pro gear shipped during a move. + // Example: 4500 + // Minimum: 1 + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight,omitempty"` + + // counselor remarks + // Example: counselor approved + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // ppm shipment + PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` +} + +// Validate validates this update m t o shipment +func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualProGearWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualSpouseProGearWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateActualProGearWeight(formats strfmt.Registry) error { + if swag.IsZero(m.ActualProGearWeight) { // not required + return nil + } + + if err := validate.MinimumInt("actualProGearWeight", "body", *m.ActualProGearWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateActualSpouseProGearWeight(formats strfmt.Registry) error { + if swag.IsZero(m.ActualSpouseProGearWeight) { // not required + return nil + } + + if err := validate.MinimumInt("actualSpouseProGearWeight", "body", *m.ActualSpouseProGearWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update m t o shipment based on the context it is used +func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_m_t_o_shipment_status.go b/pkg/gen/primemessages/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..d983851f06a --- /dev/null +++ b/pkg/gen/primemessages/update_m_t_o_shipment_status.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. +// +// swagger:model UpdateMTOShipmentStatus +type UpdateMTOShipmentStatus struct { + + // status + // Enum: [CANCELED] + Status string `json:"status,omitempty"` +} + +// Validate validates this update m t o shipment status +func (m *UpdateMTOShipmentStatus) 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 +} + +var updateMTOShipmentStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) + } +} + +const ( + + // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" + UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" +) + +// prop value enum +func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update m t o shipment status based on context it is used +func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipmentStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_p_p_m_shipment.go b/pkg/gen/primemessages/update_p_p_m_shipment.go new file mode 100644 index 00000000000..c0601dd92a1 --- /dev/null +++ b/pkg/gen/primemessages/update_p_p_m_shipment.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePPMShipment The PPM specific fields of the shipment with values being changed +// +// swagger:model UpdatePPMShipment +type UpdatePPMShipment struct { + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // Date the customer expects to begin moving from their origin. + // + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear,omitempty"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` + + // The estimated weight of the goods being put into storage. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + SitExpected *bool `json:"sitExpected,omitempty"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` +} + +// Validate validates this update p p m shipment +func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.ExpectedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update p p m shipment based on the context it is used +func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { + var res UpdatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_reweigh.go b/pkg/gen/primemessages/update_reweigh.go new file mode 100644 index 00000000000..0f97c6ae50b --- /dev/null +++ b/pkg/gen/primemessages/update_reweigh.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. +// +// swagger:model UpdateReweigh +type UpdateReweigh struct { + + // In lieu of a document being uploaded indicating why a reweigh did not occur. + // Example: The reweigh was not performed because the shipment was already delivered + VerificationReason *string `json:"verificationReason"` + + // The total reweighed weight for the shipment in pounds. + // Example: 2000 + // Minimum: 1 + Weight *int64 `json:"weight"` +} + +// Validate validates this update reweigh +func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update reweigh based on context it is used +func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { + var res UpdateReweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/update_shipment_destination_address.go b/pkg/gen/primemessages/update_shipment_destination_address.go new file mode 100644 index 00000000000..6089fccc289 --- /dev/null +++ b/pkg/gen/primemessages/update_shipment_destination_address.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. +// +// swagger:model UpdateShipmentDestinationAddress +type UpdateShipmentDestinationAddress struct { + + // This is the remark the Prime has entered, which would be the reason there is an address change. + // Example: Customer reached out to me this week and let me know they want to move somewhere else. + // Required: true + ContractorRemarks *string `json:"contractorRemarks"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` +} + +// Validate validates this update shipment destination address +func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update shipment destination address based on the context it is used +func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { + var res UpdateShipmentDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/upload_with_omissions.go b/pkg/gen/primemessages/upload_with_omissions.go new file mode 100644 index 00000000000..38d228e510a --- /dev/null +++ b/pkg/gen/primemessages/upload_with_omissions.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadWithOmissions An uploaded file. +// +// swagger:model UploadWithOmissions +type UploadWithOmissions struct { + + // bytes + // Required: true + Bytes *int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + ContentType *string `json:"contentType"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + Filename *string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // rotation + Rotation int64 `json:"rotation,omitempty"` + + // status + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this upload with omissions +func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", m.Bytes); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { + + if err := validate.Required("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) 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 +} + +var uploadWithOmissionsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) + } +} + +const ( + + // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" + UploadWithOmissionsStatusINFECTED string = "INFECTED" + + // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" + UploadWithOmissionsStatusCLEAN string = "CLEAN" + + // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" + UploadWithOmissionsStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload with omissions based on the context it is used +func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { + var res UploadWithOmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/validation_error.go b/pkg/gen/primemessages/validation_error.go new file mode 100644 index 00000000000..53e9aecf86a --- /dev/null +++ b/pkg/gen/primemessages/validation_error.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + // invalid fields + // Required: true + InvalidFields map[string][]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.InvalidFields = dataAO1.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + + dataAO1.InvalidFields = m.InvalidFields + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2api/configure_mymove.go b/pkg/gen/primev2api/configure_mymove.go new file mode 100644 index 00000000000..9110ba549e9 --- /dev/null +++ b/pkg/gen/primev2api/configure_mymove.go @@ -0,0 +1,87 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package primev2api + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations" + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/mto_shipment" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime_v2.yaml --api-package primev2operations --model-package primev2messages --server-package primev2api --principal interface{} --exclude-main + +func configureFlags(api *primev2operations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *primev2operations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + if api.MtoShipmentCreateMTOShipmentHandler == nil { + api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }) + } + if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { + api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentHandler == nil { + api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/primev2api/doc.go b/pkg/gen/primev2api/doc.go new file mode 100644 index 00000000000..752c26133aa --- /dev/null +++ b/pkg/gen/primev2api/doc.go @@ -0,0 +1,26 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package primev2api MilMove Prime V2 API +// +// The Prime V2 API is a RESTful API that enables the Prime contractor to request +// information about upcoming moves, update the details and status of those moves, +// and make payment requests. It uses Mutual TLS for authentication procedures. +// +// All endpoints are located at `/prime/v2/`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /prime/v2 +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// swagger:meta +package primev2api diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go new file mode 100644 index 00000000000..f907813b53b --- /dev/null +++ b/pkg/gen/primev2api/embedded_spec.go @@ -0,0 +1,7217 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2api + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime V2 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v2/` + "`" + `.\n", + "title": "MilMove Prime V2 API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v2", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\n**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use.", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "x-examples": { + "application/json": { + "boat": { + "summary": "Boat Shipment", + "value": { + "boatShipment": { + "hasTrailer": true, + "heightFeet": 2, + "heightInches": 2, + "isRoadworthy": false, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "counselorRemarks": "test", + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "HAUL_AWAY" + } + }, + "hhg": { + "summary": "HHG", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG" + } + }, + "mobileHome": { + "summary": "Mobile Home Shipment", + "value": { + "counselorRemarks": "test", + "mobileHomeShipment": { + "heightFeet": 2, + "heightInches": 2, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "MOBILE_HOME" + } + }, + "nts": { + "summary": "NTS", + "value": { + "agents": [ + { + "agentType": "RELEASING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG_INTO_NTS" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "agents": [ + { + "agentType": "RECEIVING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "estimatedWeight": 4999, + "expectedDepartureDate": "2022-10-01", + "hasProGear": false, + "sitExpected": false + }, + "shipmentType": "PPM" + } + } + } + }, + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "patch": { + "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "x-examples": { + "application/json": { + "hhg": { + "summary": "HHG", + "value": { + "actualPickupDate": "2022-12-29", + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "destinationAddress": { + "city": "Great Bend", + "postalCode": "13643", + "state": "NY", + "streetAddress1": "6622 Airport Way S", + "streetAddress2": "#1430" + }, + "firstAvailableDeliveryDate": "2023-01-04", + "pointOfContact": "peyton.wing@example.com", + "primeActualWeight": 4500, + "primeEstimatedWeight": 4250, + "scheduledPickupDate": "2022-12-30" + } + }, + "nts": { + "summary": "NTS", + "value": { + "actualPickupDate": "2022-12-29", + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "actualWeight": 4500, + "counselorRemarks": "Beware of dogs on property", + "estimatedWeight": 4250, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "scheduledPickupDate": "2022-12-30" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "destinationAddress": { + "city": "San Antonio", + "postalCode": "78245", + "state": "TX", + "streetAddress1": "812 S 129th Street" + }, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ntsRecordedWeight": 4500 + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "hasProGear": true, + "proGearWeight": 830, + "sitEstimatedDepartureDate": "2022-10-13", + "sitEstimatedEntryDate": "2022-10-06", + "sitEstimatedWeight": 1760, + "sitExpected": true, + "sitLocation": "DESTINATION", + "spouseProGearWeight": 366 + } + } + } + } + }, + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipment" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateBoatShipment": { + "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", + "type": "boolean" + }, + "divertedFromShipmentId": { + "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + } + } + }, + "CreateMobileHomeShipment": { + "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "contractNumber": { + "type": "string", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "methodOfPayment": { + "type": "string", + "readOnly": true + }, + "naics": { + "type": "string", + "readOnly": true + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "packingAndShippingInstructions": { + "type": "string", + "readOnly": true + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + }, + "supplyAndServicesCostEstimate": { + "type": "string", + "readOnly": true + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DOPSIT", + "DOASIT", + "DOFSIT" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment" + ] + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime V2 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v2/` + "`" + `.\n", + "title": "MilMove Prime V2 API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v2", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\n**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use.", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "x-examples": { + "application/json": { + "boat": { + "summary": "Boat Shipment", + "value": { + "boatShipment": { + "hasTrailer": true, + "heightFeet": 2, + "heightInches": 2, + "isRoadworthy": false, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "counselorRemarks": "test", + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "HAUL_AWAY" + } + }, + "hhg": { + "summary": "HHG", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG" + } + }, + "mobileHome": { + "summary": "Mobile Home Shipment", + "value": { + "counselorRemarks": "test", + "mobileHomeShipment": { + "heightFeet": 2, + "heightInches": 2, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "MOBILE_HOME" + } + }, + "nts": { + "summary": "NTS", + "value": { + "agents": [ + { + "agentType": "RELEASING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG_INTO_NTS" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "agents": [ + { + "agentType": "RECEIVING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "estimatedWeight": 4999, + "expectedDepartureDate": "2022-10-01", + "hasProGear": false, + "sitExpected": false + }, + "shipmentType": "PPM" + } + } + } + }, + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "patch": { + "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n\n**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress\nsecondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode,\ndestinationPostalCode and secondaryDestinationPostalCode].\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "x-examples": { + "application/json": { + "hhg": { + "summary": "HHG", + "value": { + "actualPickupDate": "2022-12-29", + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "destinationAddress": { + "city": "Great Bend", + "postalCode": "13643", + "state": "NY", + "streetAddress1": "6622 Airport Way S", + "streetAddress2": "#1430" + }, + "firstAvailableDeliveryDate": "2023-01-04", + "pointOfContact": "peyton.wing@example.com", + "primeActualWeight": 4500, + "primeEstimatedWeight": 4250, + "scheduledPickupDate": "2022-12-30" + } + }, + "nts": { + "summary": "NTS", + "value": { + "actualPickupDate": "2022-12-29", + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "actualWeight": 4500, + "counselorRemarks": "Beware of dogs on property", + "estimatedWeight": 4250, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "scheduledPickupDate": "2022-12-30" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "actualProGearWeight": 1053, + "actualSpouseProGearWeight": 253, + "destinationAddress": { + "city": "San Antonio", + "postalCode": "78245", + "state": "TX", + "streetAddress1": "812 S 129th Street" + }, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ntsRecordedWeight": 4500 + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "hasProGear": true, + "proGearWeight": 830, + "sitEstimatedDepartureDate": "2022-10-13", + "sitEstimatedEntryDate": "2022-10-06", + "sitEstimatedWeight": 1760, + "sitExpected": true, + "sitLocation": "DESTINATION", + "spouseProGearWeight": 366 + } + } + } + } + }, + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipment" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateBoatShipment": { + "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", + "type": "boolean" + }, + "divertedFromShipmentId": { + "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + } + } + }, + "CreateMobileHomeShipment": { + "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "contractNumber": { + "type": "string", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "methodOfPayment": { + "type": "string", + "readOnly": true + }, + "naics": { + "type": "string", + "readOnly": true + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "packingAndShippingInstructions": { + "type": "string", + "readOnly": true + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + }, + "supplyAndServicesCostEstimate": { + "type": "string", + "readOnly": true + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DOPSIT", + "DOASIT", + "DOFSIT" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment" + ] + } + ] +}`)) +} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go new file mode 100644 index 00000000000..be121807bb6 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order.go @@ -0,0 +1,65 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler +type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// GetMoveTaskOrderHandler interface for that can handle valid get move task order params +type GetMoveTaskOrderHandler interface { + Handle(GetMoveTaskOrderParams) middleware.Responder +} + +// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation +func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { + return &GetMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder + +getMoveTaskOrder + +### Functionality +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. + +**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. +*/ +type GetMoveTaskOrder struct { + Context *middleware.Context + Handler GetMoveTaskOrderHandler +} + +func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..fc2c39ef759 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { + + return GetMoveTaskOrderParams{} +} + +// GetMoveTaskOrderParams contains all the bound params for the get move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveTaskOrder +type GetMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID or MoveCode of move task order to use. + Required: true + In: path + */ + MoveID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. +func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveID = raw + + return nil +} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..282a88ce3b0 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK +const GetMoveTaskOrderOKCode int = 200 + +/* +GetMoveTaskOrderOK Successfully retrieve an individual move task order. + +swagger:response getMoveTaskOrderOK +*/ +type GetMoveTaskOrderOK struct { + + /* + In: Body + */ + Payload *primev2messages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + + return &GetMoveTaskOrderOK{} +} + +// WithPayload adds the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) WithPayload(payload *primev2messages.MoveTaskOrder) *GetMoveTaskOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) SetPayload(payload *primev2messages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized +const GetMoveTaskOrderUnauthorizedCode int = 401 + +/* +GetMoveTaskOrderUnauthorized The request was denied. + +swagger:response getMoveTaskOrderUnauthorized +*/ +type GetMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + + return &GetMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden +const GetMoveTaskOrderForbiddenCode int = 403 + +/* +GetMoveTaskOrderForbidden The request was denied. + +swagger:response getMoveTaskOrderForbidden +*/ +type GetMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + + return &GetMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound +const GetMoveTaskOrderNotFoundCode int = 404 + +/* +GetMoveTaskOrderNotFound The requested resource wasn't found. + +swagger:response getMoveTaskOrderNotFound +*/ +type GetMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + + return &GetMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primev2messages.ClientError) *GetMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError +const GetMoveTaskOrderInternalServerErrorCode int = 500 + +/* +GetMoveTaskOrderInternalServerError A server error occurred. + +swagger:response getMoveTaskOrderInternalServerError +*/ +type GetMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *primev2messages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + + return &GetMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primev2messages.Error) *GetMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primev2messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..403220622c7 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/move_task_order/get_move_task_order_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveTaskOrderURL generates an URL for the get move task order operation +type GetMoveTaskOrderURL struct { + MoveID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveID}" + + moveID := o.MoveID + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveTaskOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v2" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go new file mode 100644 index 00000000000..e1bcda5afd9 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment.go @@ -0,0 +1,73 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler +type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params +type CreateMTOShipmentHandler interface { + Handle(CreateMTOShipmentParams) middleware.Responder +} + +// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation +func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { + return &CreateMTOShipment{Context: ctx, Handler: handler} +} + +/* + CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment + +createMTOShipment + +Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a +need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must +approve it before the contractor can proceed with billing. + +**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. +If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically +inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize +the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. + +**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. + +**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to +one of their moves. Otherwise, the Prime can fetch the related move using the +[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. +*/ +type CreateMTOShipment struct { + Context *middleware.Context + Handler CreateMTOShipmentHandler +} + +func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..4e2cb59c04b --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOShipmentParams() CreateMTOShipmentParams { + + return CreateMTOShipmentParams{} +} + +// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOShipment +type CreateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *primev2messages.CreateMTOShipment +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. +func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primev2messages.CreateMTOShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..57816d6eac0 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK +const CreateMTOShipmentOKCode int = 200 + +/* +CreateMTOShipmentOK Successfully created a MTO shipment. + +swagger:response createMTOShipmentOK +*/ +type CreateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *primev2messages.MTOShipment `json:"body,omitempty"` +} + +// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + + return &CreateMTOShipmentOK{} +} + +// WithPayload adds the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) WithPayload(payload *primev2messages.MTOShipment) *CreateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) SetPayload(payload *primev2messages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest +const CreateMTOShipmentBadRequestCode int = 400 + +/* +CreateMTOShipmentBadRequest The request payload is invalid. + +swagger:response createMTOShipmentBadRequest +*/ +type CreateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + + return &CreateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) WithPayload(payload *primev2messages.ClientError) *CreateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound +const CreateMTOShipmentNotFoundCode int = 404 + +/* +CreateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response createMTOShipmentNotFound +*/ +type CreateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + + return &CreateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) WithPayload(payload *primev2messages.ClientError) *CreateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity +const CreateMTOShipmentUnprocessableEntityCode int = 422 + +/* +CreateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createMTOShipmentUnprocessableEntity +*/ +type CreateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primev2messages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + + return &CreateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *primev2messages.ValidationError) *CreateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *primev2messages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError +const CreateMTOShipmentInternalServerErrorCode int = 500 + +/* +CreateMTOShipmentInternalServerError A server error occurred. + +swagger:response createMTOShipmentInternalServerError +*/ +type CreateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *primev2messages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + + return &CreateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *primev2messages.Error) *CreateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *primev2messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..f64c5e4ffcd --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOShipmentURL generates an URL for the create m t o shipment operation +type CreateMTOShipmentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v2" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go new file mode 100644 index 00000000000..c4d6e9d31ba --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment.go @@ -0,0 +1,72 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler +type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params +type UpdateMTOShipmentHandler interface { + Handle(UpdateMTOShipmentParams) middleware.Responder +} + +// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation +func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { + return &UpdateMTOShipment{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment + +updateMTOShipment + +Updates an existing shipment for a move. + +Note that there are some restrictions on nested objects: + +* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. +* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. +* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. + +These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. + +Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. + +**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. +*/ +type UpdateMTOShipment struct { + Context *middleware.Context + Handler UpdateMTOShipmentHandler +} + +func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..3a431676a7e --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { + + return UpdateMTOShipmentParams{} +} + +// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipment +type UpdateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *primev2messages.UpdateMTOShipment + /*UUID of the shipment being updated. + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. +func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primev2messages.UpdateMTOShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..18034975fa5 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK +const UpdateMTOShipmentOKCode int = 200 + +/* +UpdateMTOShipmentOK Successfully updated the MTO shipment. + +swagger:response updateMTOShipmentOK +*/ +type UpdateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *primev2messages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + + return &UpdateMTOShipmentOK{} +} + +// WithPayload adds the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) WithPayload(payload *primev2messages.MTOShipment) *UpdateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) SetPayload(payload *primev2messages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest +const UpdateMTOShipmentBadRequestCode int = 400 + +/* +UpdateMTOShipmentBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentBadRequest +*/ +type UpdateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + + return &UpdateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized +const UpdateMTOShipmentUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentUnauthorized The request was denied. + +swagger:response updateMTOShipmentUnauthorized +*/ +type UpdateMTOShipmentUnauthorized struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + + return &UpdateMTOShipmentUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden +const UpdateMTOShipmentForbiddenCode int = 403 + +/* +UpdateMTOShipmentForbidden The request was denied. + +swagger:response updateMTOShipmentForbidden +*/ +type UpdateMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + + return &UpdateMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound +const UpdateMTOShipmentNotFoundCode int = 404 + +/* +UpdateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentNotFound +*/ +type UpdateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + + return &UpdateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed +const UpdateMTOShipmentPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentPreconditionFailed +*/ +type UpdateMTOShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *primev2messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + + return &UpdateMTOShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *primev2messages.ClientError) *UpdateMTOShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *primev2messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity +const UpdateMTOShipmentUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOShipmentUnprocessableEntity +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primev2messages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + + return &UpdateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *primev2messages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *primev2messages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError +const UpdateMTOShipmentInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentInternalServerError A server error occurred. + +swagger:response updateMTOShipmentInternalServerError +*/ +type UpdateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *primev2messages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + + return &UpdateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *primev2messages.Error) *UpdateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *primev2messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..563ca5598fa --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation +type UpdateMTOShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v2" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev2api/primev2operations/mymove_api.go b/pkg/gen/primev2api/primev2operations/mymove_api.go new file mode 100644 index 00000000000..b2e00bf7989 --- /dev/null +++ b/pkg/gen/primev2api/primev2operations/mymove_api.go @@ -0,0 +1,334 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations/mto_shipment" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }), + MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Prime V2 API is a RESTful API that enables the Prime contractor to request +information about upcoming moves, update the details and status of those moves, +and make payment requests. It uses Mutual TLS for authentication procedures. + +All endpoints are located at `/prime/v2/`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation + MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler + // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation + MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler + // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation + MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.MtoShipmentCreateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") + } + if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") + } + if o.MtoShipmentUpdateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/primev2api/server.go b/pkg/gen/primev2api/server.go new file mode 100644 index 00000000000..582e2d7a63d --- /dev/null +++ b/pkg/gen/primev2api/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2api + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/primev2api/primev2operations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *primev2operations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *primev2operations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *primev2operations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..e6dea099e1e --- /dev/null +++ b/pkg/gen/primev2client/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object +// with the ability to set a timeout on a request. +func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: timeout, + } +} + +// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object +// with the ability to set a context for a request. +func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + Context: ctx, + } +} + +// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + HTTPClient: client, + } +} + +/* +GetMoveTaskOrderParams contains all the parameters to send to the API endpoint + + for the get move task order operation. + + Typically these are written to a http.Request. +*/ +type GetMoveTaskOrderParams struct { + + /* MoveID. + + UUID or MoveCode of move task order to use. + */ + MoveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMoveID adds the moveID to the get move task order params +func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { + o.SetMoveID(moveID) + return o +} + +// SetMoveID adds the moveId to the get move task order params +func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { + o.MoveID = moveID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param moveID + if err := r.SetPathParam("moveID", o.MoveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..c6d8c68794a --- /dev/null +++ b/pkg/gen/primev2client/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. +type GetMoveTaskOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMoveTaskOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMoveTaskOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMoveTaskOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMoveTaskOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMoveTaskOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) + } +} + +// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + return &GetMoveTaskOrderOK{} +} + +/* +GetMoveTaskOrderOK describes a response with status code 200, with default header values. + +Successfully retrieve an individual move task order. +*/ +type GetMoveTaskOrderOK struct { + Payload *primev2messages.MoveTaskOrder +} + +// IsSuccess returns true when this get move task order o k response has a 2xx status code +func (o *GetMoveTaskOrderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get move task order o k response has a 3xx status code +func (o *GetMoveTaskOrderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order o k response has a 4xx status code +func (o *GetMoveTaskOrderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order o k response has a 5xx status code +func (o *GetMoveTaskOrderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order o k response a status code equal to that given +func (o *GetMoveTaskOrderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get move task order o k response +func (o *GetMoveTaskOrderOK) Code() int { + return 200 +} + +func (o *GetMoveTaskOrderOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) GetPayload() *primev2messages.MoveTaskOrder { + return o.Payload +} + +func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + return &GetMoveTaskOrderUnauthorized{} +} + +/* +GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderUnauthorized struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code +func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code +func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order unauthorized response has a 4xx status code +func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order unauthorized response has a 5xx status code +func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order unauthorized response a status code equal to that given +func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) Code() int { + return 401 +} + +func (o *GetMoveTaskOrderUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + return &GetMoveTaskOrderForbidden{} +} + +/* +GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderForbidden struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this get move task order forbidden response has a 2xx status code +func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order forbidden response has a 3xx status code +func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order forbidden response has a 4xx status code +func (o *GetMoveTaskOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order forbidden response has a 5xx status code +func (o *GetMoveTaskOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order forbidden response a status code equal to that given +func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) Code() int { + return 403 +} + +func (o *GetMoveTaskOrderForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + return &GetMoveTaskOrderNotFound{} +} + +/* +GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type GetMoveTaskOrderNotFound struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this get move task order not found response has a 2xx status code +func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order not found response has a 3xx status code +func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order not found response has a 4xx status code +func (o *GetMoveTaskOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order not found response has a 5xx status code +func (o *GetMoveTaskOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order not found response a status code equal to that given +func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get move task order not found response +func (o *GetMoveTaskOrderNotFound) Code() int { + return 404 +} + +func (o *GetMoveTaskOrderNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + return &GetMoveTaskOrderInternalServerError{} +} + +/* +GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type GetMoveTaskOrderInternalServerError struct { + Payload *primev2messages.Error +} + +// IsSuccess returns true when this get move task order internal server error response has a 2xx status code +func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order internal server error response has a 3xx status code +func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order internal server error response has a 4xx status code +func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order internal server error response has a 5xx status code +func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get move task order internal server error response a status code equal to that given +func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) Code() int { + return 500 +} + +func (o *GetMoveTaskOrderInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primev2messages.Error { + return o.Payload +} + +func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev2client/move_task_order/move_task_order_client.go b/pkg/gen/primev2client/move_task_order/move_task_order_client.go new file mode 100644 index 00000000000..ee466fccf62 --- /dev/null +++ b/pkg/gen/primev2client/move_task_order/move_task_order_client.go @@ -0,0 +1,89 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new move task order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for move task order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMoveTaskOrder gets move task order + + ### Functionality + +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. + +**NOTE**: New version in v3. Version will return PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. +*/ +func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMoveTaskOrderParams() + } + op := &runtime.ClientOperation{ + ID: "getMoveTaskOrder", + Method: "GET", + PathPattern: "/move-task-orders/{moveID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMoveTaskOrderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetMoveTaskOrderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..2eb88a610d5 --- /dev/null +++ b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object +// with the ability to set a context for a request. +func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + Context: ctx, + } +} + +// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +CreateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the create m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type CreateMTOShipmentParams struct { + + // Body. + Body *primev2messages.CreateMTOShipment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithBody(body *primev2messages.CreateMTOShipment) *CreateMTOShipmentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetBody(body *primev2messages.CreateMTOShipment) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..c0f5592b984 --- /dev/null +++ b/pkg/gen/primev2client/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. +type CreateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateMTOShipmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateMTOShipmentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateMTOShipmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateMTOShipmentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateMTOShipmentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) + } +} + +// NewCreateMTOShipmentOK creates a CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + return &CreateMTOShipmentOK{} +} + +/* +CreateMTOShipmentOK describes a response with status code 200, with default header values. + +Successfully created a MTO shipment. +*/ +type CreateMTOShipmentOK struct { + Payload *primev2messages.MTOShipment +} + +// IsSuccess returns true when this create m t o shipment o k response has a 2xx status code +func (o *CreateMTOShipmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create m t o shipment o k response has a 3xx status code +func (o *CreateMTOShipmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment o k response has a 4xx status code +func (o *CreateMTOShipmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o shipment o k response has a 5xx status code +func (o *CreateMTOShipmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment o k response a status code equal to that given +func (o *CreateMTOShipmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create m t o shipment o k response +func (o *CreateMTOShipmentOK) Code() int { + return 200 +} + +func (o *CreateMTOShipmentOK) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOShipmentOK) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOShipmentOK) GetPayload() *primev2messages.MTOShipment { + return o.Payload +} + +func (o *CreateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentBadRequest creates a CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + return &CreateMTOShipmentBadRequest{} +} + +/* +CreateMTOShipmentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateMTOShipmentBadRequest struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this create m t o shipment bad request response has a 2xx status code +func (o *CreateMTOShipmentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment bad request response has a 3xx status code +func (o *CreateMTOShipmentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment bad request response has a 4xx status code +func (o *CreateMTOShipmentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment bad request response has a 5xx status code +func (o *CreateMTOShipmentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment bad request response a status code equal to that given +func (o *CreateMTOShipmentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) Code() int { + return 400 +} + +func (o *CreateMTOShipmentBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOShipmentBadRequest) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOShipmentBadRequest) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *CreateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentNotFound creates a CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + return &CreateMTOShipmentNotFound{} +} + +/* +CreateMTOShipmentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateMTOShipmentNotFound struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this create m t o shipment not found response has a 2xx status code +func (o *CreateMTOShipmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment not found response has a 3xx status code +func (o *CreateMTOShipmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment not found response has a 4xx status code +func (o *CreateMTOShipmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment not found response has a 5xx status code +func (o *CreateMTOShipmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment not found response a status code equal to that given +func (o *CreateMTOShipmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) Code() int { + return 404 +} + +func (o *CreateMTOShipmentNotFound) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOShipmentNotFound) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOShipmentNotFound) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *CreateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentUnprocessableEntity creates a CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + return &CreateMTOShipmentUnprocessableEntity{} +} + +/* +CreateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateMTOShipmentUnprocessableEntity struct { + Payload *primev2messages.ValidationError +} + +// IsSuccess returns true when this create m t o shipment unprocessable entity response has a 2xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment unprocessable entity response has a 3xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment unprocessable entity response has a 4xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment unprocessable entity response has a 5xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment unprocessable entity response a status code equal to that given +func (o *CreateMTOShipmentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateMTOShipmentUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOShipmentUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOShipmentUnprocessableEntity) GetPayload() *primev2messages.ValidationError { + return o.Payload +} + +func (o *CreateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentInternalServerError creates a CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + return &CreateMTOShipmentInternalServerError{} +} + +/* +CreateMTOShipmentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateMTOShipmentInternalServerError struct { + Payload *primev2messages.Error +} + +// IsSuccess returns true when this create m t o shipment internal server error response has a 2xx status code +func (o *CreateMTOShipmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment internal server error response has a 3xx status code +func (o *CreateMTOShipmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment internal server error response has a 4xx status code +func (o *CreateMTOShipmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o shipment internal server error response has a 5xx status code +func (o *CreateMTOShipmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create m t o shipment internal server error response a status code equal to that given +func (o *CreateMTOShipmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) Code() int { + return 500 +} + +func (o *CreateMTOShipmentInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOShipmentInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOShipmentInternalServerError) GetPayload() *primev2messages.Error { + return o.Payload +} + +func (o *CreateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go b/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go new file mode 100644 index 00000000000..e71acd78773 --- /dev/null +++ b/pkg/gen/primev2client/mto_shipment/mto_shipment_client.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto shipment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto shipment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) + + UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateMTOShipment creates m t o shipment + + Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a + +need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must +approve it before the contractor can proceed with billing. + +**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. +If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically +inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize +the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. + +**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. + +**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to +one of their moves. Otherwise, the Prime can fetch the related move using the +[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. +*/ +func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "createMTOShipment", + Method: "POST", + PathPattern: "/mto-shipments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateMTOShipmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOShipment updates m t o shipment + + Updates an existing shipment for a move. + +Note that there are some restrictions on nested objects: + +* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. +* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. +* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. + +These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. + +Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. + +**NOTE**: New version in v3. Version will accept PPM addresses[pickupAddress, destinationAddress, secondaryPickupAddress +secondaryDestinationAddress]. PPM postalCodes will be phased out[pickupPostalCode, secondaryPickupPostalCode, +destinationPostalCode and secondaryDestinationPostalCode]. +*/ +func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipment", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOShipmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..0d4dfd95650 --- /dev/null +++ b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the update m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *primev2messages.UpdateMTOShipment + + /* MtoShipmentID. + + UUID of the shipment being updated. + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithBody(body *primev2messages.UpdateMTOShipment) *UpdateMTOShipmentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetBody(body *primev2messages.UpdateMTOShipment) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..3d3c9f9e198 --- /dev/null +++ b/pkg/gen/primev2client/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2messages" +) + +// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. +type UpdateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOShipmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOShipmentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOShipmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOShipmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOShipmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOShipmentPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOShipmentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOShipmentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) + } +} + +// NewUpdateMTOShipmentOK creates a UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + return &UpdateMTOShipmentOK{} +} + +/* +UpdateMTOShipmentOK describes a response with status code 200, with default header values. + +Successfully updated the MTO shipment. +*/ +type UpdateMTOShipmentOK struct { + Payload *primev2messages.MTOShipment +} + +// IsSuccess returns true when this update m t o shipment o k response has a 2xx status code +func (o *UpdateMTOShipmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o shipment o k response has a 3xx status code +func (o *UpdateMTOShipmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment o k response has a 4xx status code +func (o *UpdateMTOShipmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment o k response has a 5xx status code +func (o *UpdateMTOShipmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment o k response a status code equal to that given +func (o *UpdateMTOShipmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) Code() int { + return 200 +} + +func (o *UpdateMTOShipmentOK) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentOK) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentOK) GetPayload() *primev2messages.MTOShipment { + return o.Payload +} + +func (o *UpdateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentBadRequest creates a UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + return &UpdateMTOShipmentBadRequest{} +} + +/* +UpdateMTOShipmentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOShipmentBadRequest struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment bad request response has a 2xx status code +func (o *UpdateMTOShipmentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment bad request response has a 3xx status code +func (o *UpdateMTOShipmentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment bad request response has a 4xx status code +func (o *UpdateMTOShipmentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment bad request response has a 5xx status code +func (o *UpdateMTOShipmentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment bad request response a status code equal to that given +func (o *UpdateMTOShipmentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOShipmentBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentBadRequest) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentUnauthorized creates a UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + return &UpdateMTOShipmentUnauthorized{} +} + +/* +UpdateMTOShipmentUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentUnauthorized struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment unauthorized response has a 2xx status code +func (o *UpdateMTOShipmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment unauthorized response has a 3xx status code +func (o *UpdateMTOShipmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment unauthorized response has a 4xx status code +func (o *UpdateMTOShipmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment unauthorized response has a 5xx status code +func (o *UpdateMTOShipmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment unauthorized response a status code equal to that given +func (o *UpdateMTOShipmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOShipmentUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentUnauthorized) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentForbidden creates a UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + return &UpdateMTOShipmentForbidden{} +} + +/* +UpdateMTOShipmentForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentForbidden struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment forbidden response has a 2xx status code +func (o *UpdateMTOShipmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment forbidden response has a 3xx status code +func (o *UpdateMTOShipmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment forbidden response has a 4xx status code +func (o *UpdateMTOShipmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment forbidden response has a 5xx status code +func (o *UpdateMTOShipmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment forbidden response a status code equal to that given +func (o *UpdateMTOShipmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOShipmentForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentForbidden) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentNotFound creates a UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + return &UpdateMTOShipmentNotFound{} +} + +/* +UpdateMTOShipmentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOShipmentNotFound struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment not found response has a 2xx status code +func (o *UpdateMTOShipmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment not found response has a 3xx status code +func (o *UpdateMTOShipmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment not found response has a 4xx status code +func (o *UpdateMTOShipmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment not found response has a 5xx status code +func (o *UpdateMTOShipmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment not found response a status code equal to that given +func (o *UpdateMTOShipmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOShipmentNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentNotFound) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentPreconditionFailed creates a UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + return &UpdateMTOShipmentPreconditionFailed{} +} + +/* +UpdateMTOShipmentPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOShipmentPreconditionFailed struct { + Payload *primev2messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment precondition failed response has a 2xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment precondition failed response has a 3xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment precondition failed response has a 4xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment precondition failed response has a 5xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment precondition failed response a status code equal to that given +func (o *UpdateMTOShipmentPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOShipmentPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentPreconditionFailed) GetPayload() *primev2messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentUnprocessableEntity creates a UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + return &UpdateMTOShipmentUnprocessableEntity{} +} + +/* +UpdateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + Payload *primev2messages.ValidationError +} + +// IsSuccess returns true when this update m t o shipment unprocessable entity response has a 2xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment unprocessable entity response has a 3xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment unprocessable entity response has a 4xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment unprocessable entity response has a 5xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment unprocessable entity response a status code equal to that given +func (o *UpdateMTOShipmentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOShipmentUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentUnprocessableEntity) GetPayload() *primev2messages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentInternalServerError creates a UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + return &UpdateMTOShipmentInternalServerError{} +} + +/* +UpdateMTOShipmentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOShipmentInternalServerError struct { + Payload *primev2messages.Error +} + +// IsSuccess returns true when this update m t o shipment internal server error response has a 2xx status code +func (o *UpdateMTOShipmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment internal server error response has a 3xx status code +func (o *UpdateMTOShipmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment internal server error response has a 4xx status code +func (o *UpdateMTOShipmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment internal server error response has a 5xx status code +func (o *UpdateMTOShipmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o shipment internal server error response a status code equal to that given +func (o *UpdateMTOShipmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOShipmentInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentInternalServerError) GetPayload() *primev2messages.Error { + return o.Payload +} + +func (o *UpdateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev2messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev2client/mymove_client.go b/pkg/gen/primev2client/mymove_client.go new file mode 100644 index 00000000000..c13a00c5d64 --- /dev/null +++ b/pkg/gen/primev2client/mymove_client.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev2client/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev2client/mto_shipment" +) + +// Default mymove HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/prime/v2" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new mymove HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Mymove { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new mymove HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new mymove client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Mymove) + cli.Transport = transport + cli.MoveTaskOrder = move_task_order.New(transport, formats) + cli.MtoShipment = mto_shipment.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Mymove is a client for mymove +type Mymove struct { + MoveTaskOrder move_task_order.ClientService + + MtoShipment mto_shipment.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Mymove) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.MoveTaskOrder.SetTransport(transport) + c.MtoShipment.SetTransport(transport) +} diff --git a/pkg/gen/primev2messages/m_t_o_agent_type.go b/pkg/gen/primev2messages/m_t_o_agent_type.go new file mode 100644 index 00000000000..4264c873af1 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_agent_type.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOAgentType Agent Type +// +// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. +// +// Example: RELEASING_AGENT +// +// swagger:model MTOAgentType +type MTOAgentType string + +func NewMTOAgentType(value MTOAgentType) *MTOAgentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOAgentType. +func (m MTOAgentType) Pointer() *MTOAgentType { + return &m +} + +const ( + + // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" + + // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" +) + +// for schema +var mTOAgentTypeEnum []interface{} + +func init() { + var res []MTOAgentType + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) + } +} + +func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { + if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o agent type +func (m MTOAgentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o agent type based on context it is used +func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_agents.go b/pkg/gen/primev2messages/m_t_o_agents.go new file mode 100644 index 00000000000..a7bacab891b --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_agents.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. +// +// swagger:model MTOAgents +type MTOAgents []*MTOAgent + +// Validate validates this m t o agents +func (m MTOAgents) Validate(formats strfmt.Registry) error { + var res []error + + iMTOAgentsSize := int64(len(m)) + + if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { + return err + } + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents based on the context it is used +func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item.go b/pkg/gen/primev2messages/m_t_o_service_item.go new file mode 100644 index 00000000000..58ae8130bb3 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item.go @@ -0,0 +1,517 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. +// +// swagger:discriminator MTOServiceItem modelType +type MTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // A hash unique to this service item that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag() string + SetETag(string) + + // The ID of the service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // locked price cents + LockedPriceCents() *int64 + SetLockedPriceCents(*int64) + + // model type + // Required: true + ModelType() MTOServiceItemModelType + SetModelType(MTOServiceItemModelType) + + // The ID of the move for this service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID() *strfmt.UUID + SetMoveTaskOrderID(*strfmt.UUID) + + // The ID of the shipment this service is for, if any. Optional. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID() strfmt.UUID + SetMtoShipmentID(strfmt.UUID) + + // The full descriptive name of the service. + // Read Only: true + ReServiceName() string + SetReServiceName(string) + + // The reason why this service item was rejected by the TOO. + // Example: item was too heavy + // Read Only: true + RejectionReason() *string + SetRejectionReason(*string) + + // service request documents + ServiceRequestDocuments() ServiceRequestDocuments + SetServiceRequestDocuments(ServiceRequestDocuments) + + // status + Status() MTOServiceItemStatus + SetStatus(MTOServiceItemStatus) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type mTOServiceItem struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + modelTypeField MTOServiceItemModelType + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus +} + +// ETag gets the e tag of this polymorphic type +func (m *mTOServiceItem) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this polymorphic type +func (m *mTOServiceItem) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this polymorphic type +func (m *mTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *mTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this polymorphic type +func (m *mTOServiceItem) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this polymorphic type +func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { + return "MTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this polymorphic type +func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this polymorphic type +func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this polymorphic type +func (m *mTOServiceItem) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this polymorphic type +func (m *mTOServiceItem) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this polymorphic type +func (m *mTOServiceItem) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this polymorphic type +func (m *mTOServiceItem) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this polymorphic type +func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this polymorphic type +func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this polymorphic type +func (m *mTOServiceItem) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this polymorphic type +func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem +func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []MTOServiceItem + for _, element := range elements { + obj, err := unmarshalMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem +func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalMTOServiceItem(data, consumer) +} + +func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "MTOServiceItem": + var result mTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemBasic": + var result MTOServiceItemBasic + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDestSIT": + var result MTOServiceItemDestSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDomesticCrating": + var result MTOServiceItemDomesticCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemInternationalCrating": + var result MTOServiceItemInternationalCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemOriginSIT": + var result MTOServiceItemOriginSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemShuttle": + var result MTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this m t o service item +func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this m t o service item based on the context it is used +func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_basic.go b/pkg/gen/primev2messages/m_t_o_service_item_basic.go new file mode 100644 index 00000000000..3feb6f088c5 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_basic.go @@ -0,0 +1,574 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemBasic +type MTOServiceItemBasic struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemBasic) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemBasic) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemBasic) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { + return "MTOServiceItemBasic" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemBasic) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemBasic) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemBasic) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { + var data struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemBasic + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + }{ + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item basic +func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if m.ReServiceCode != nil { + if err := m.ReServiceCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// ContextValidate validate this m t o service item basic based on the context it is used +func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceCode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { + + if m.ReServiceCode != nil { + + if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { + var res MTOServiceItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go new file mode 100644 index 00000000000..86e2a49a773 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_dest_s_i_t.go @@ -0,0 +1,987 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDestSIT +type MTOServiceItemDestSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDestSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDestSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDestSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDestSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDestSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item dest s i t +func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item dest s i t based on the context it is used +func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDestSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_dimension.go b/pkg/gen/primev2messages/m_t_o_service_item_dimension.go new file mode 100644 index 00000000000..cb94e39e084 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_dimension.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. +// +// swagger:model MTOServiceItemDimension +type MTOServiceItemDimension struct { + + // Height in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Height *int32 `json:"height"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Length in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Length *int32 `json:"length"` + + // Width in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Width *int32 `json:"width"` +} + +// Validate validates this m t o service item dimension +func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLength(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { + + if err := validate.Required("height", "body", m.Height); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { + + if err := validate.Required("length", "body", m.Length); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { + + if err := validate.Required("width", "body", m.Width); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this m t o service item dimension based on context it is used +func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDimension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go new file mode 100644 index 00000000000..6d1a0a90ae2 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_domestic_crating.go @@ -0,0 +1,705 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDomesticCrating +type MTOServiceItemDomesticCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.Item = data.Item + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + Item: m.Item, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic crating +func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic crating based on the context it is used +func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go b/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go new file mode 100644 index 00000000000..f644a7a869f --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_international_crating.go @@ -0,0 +1,773 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemInternationalCrating +type MTOServiceItemInternationalCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemInternationalCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemInternationalCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.ExternalCrate = data.ExternalCrate + result.Item = data.Item + result.Market = data.Market + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + ExternalCrate: m.ExternalCrate, + + Item: m.Item, + + Market: m.Market, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item international crating +func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarket(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { + + if swag.IsZero(m.Market) { // not required + return nil + } + + // value enum + if err := m.validateMarketEnum("market", "body", m.Market); err != nil { + return err + } + + return nil +} + +var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item international crating based on the context it is used +func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemInternationalCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_model_type.go b/pkg/gen/primev2messages/m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..58755658344 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_model_type.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. +// +// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DOFSIT, DOASIT - MTOServiceItemOriginSIT +// - DDFSIT, DDASIT - MTOServiceItemDestSIT +// - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DCRT, DUCRT - MTOServiceItemDomesticCrating +// - ICRT, IUCRT - MTOServiceItemInternationalCrating +// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge +// +// The documentation will then update with the supported fields. +// +// swagger:model MTOServiceItemModelType +type MTOServiceItemModelType string + +func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. +func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { + return &m +} + +const ( + + // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" + MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" + + // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" + MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" + + // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" + MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" + + // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" + MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + + // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" + MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" + + // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" + MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" + + // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" + MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" +) + +// for schema +var mTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []MTOServiceItemModelType + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) + } +} + +func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item model type +func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o service item model type based on context it is used +func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go new file mode 100644 index 00000000000..9e80dd21eb8 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_origin_s_i_t.go @@ -0,0 +1,900 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemOriginSIT +type MTOServiceItemOriginSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemOriginSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemOriginSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitEntryDate = data.SitEntryDate + result.SitHHGActualOrigin = data.SitHHGActualOrigin + result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + }{ + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitEntryDate: m.SitEntryDate, + + SitHHGActualOrigin: m.SitHHGActualOrigin, + + SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item origin s i t +func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGActualOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGOriginalOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if m.SitHHGActualOrigin != nil { + if err := m.SitHHGActualOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if m.SitHHGOriginalOrigin != nil { + if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { + return err + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item origin s i t based on the context it is used +func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGActualOrigin != nil { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGOriginalOrigin != nil { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemOriginSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go b/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..0d244875c9a --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemShuttle Describes a shuttle service item. +// +// swagger:model MTOServiceItemShuttle +type MTOServiceItemShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item shuttle +func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item shuttle based on the context it is used +func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_status.go b/pkg/gen/primev2messages/m_t_o_service_item_status.go new file mode 100644 index 00000000000..4d0ca21e62d --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. +// +// swagger:model MTOServiceItemStatus +type MTOServiceItemStatus string + +func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. +func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { + return &m +} + +const ( + + // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" + MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" + + // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" + MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" + + // MTOServiceItemStatusREJECTED captures enum value "REJECTED" + MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" +) + +// for schema +var mTOServiceItemStatusEnum []interface{} + +func init() { + var res []MTOServiceItemStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) + } +} + +func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item status +func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item status based on the context it is used +func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_shipment.go b/pkg/gen/primev2messages/m_t_o_shipment.go new file mode 100644 index 00000000000..c22be98ca9f --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_shipment.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipment m t o shipment +// +// swagger:model MTOShipment +type MTOShipment struct { + MTOShipmentWithoutServiceItems + + mtoServiceItemsField []MTOServiceItem +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOShipment) UnmarshalJSON(raw []byte) error { + var data struct { + MTOShipmentWithoutServiceItems + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var propMtoServiceItems []MTOServiceItem + if string(data.MtoServiceItems) != "null" { + mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + propMtoServiceItems = mtoServiceItems + } + + var result MTOShipment + + result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOShipment) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + MTOShipmentWithoutServiceItems + }{ + + MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o shipment +func (m *MTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItems()) { // not required + return nil + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// ContextValidate validate this m t o shipment based on the context it is used +func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipment) UnmarshalBinary(b []byte) error { + var res MTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_shipment_type.go b/pkg/gen/primev2messages/m_t_o_shipment_type.go new file mode 100644 index 00000000000..79fe1f1ef90 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_shipment_type.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType Shipment Type +// +// The type of shipment. +// - `HHG` = Household goods move +// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) +// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) +// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) +// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination +// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer +// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. +// +// Example: HHG +// +// swagger:model MTOShipmentType +type MTOShipmentType string + +func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType. +func (m MTOShipmentType) Pointer() *MTOShipmentType { + return &m +} + +const ( + + // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" + + // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" + + // MTOShipmentTypeHHG captures enum value "HHG" + MTOShipmentTypeHHG MTOShipmentType = "HHG" + + // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" + + // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" + + // MTOShipmentTypePPM captures enum value "PPM" + MTOShipmentTypePPM MTOShipmentType = "PPM" + + // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" +) + +// for schema +var mTOShipmentTypeEnum []interface{} + +func init() { + var res []MTOShipmentType + if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) + } +} + +func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type +func (m MTOShipmentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type based on context it is used +func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go b/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go new file mode 100644 index 00000000000..61ca96b1fe5 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_shipment_without_service_items.go @@ -0,0 +1,1282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipmentWithoutServiceItems m t o shipment without service items +// +// swagger:model MTOShipmentWithoutServiceItems +type MTOShipmentWithoutServiceItems struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // The actual weight of any pro gear being shipped. + // + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // The actual weight of any spouse pro gear being shipped. + // + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // The date when the Task Ordering Officer first approved this shipment for the move. + // Read Only: true + // Format: date + ApprovedDate *strfmt.Date `json:"approvedDate"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + // Read Only: true + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // The customer can use the customer remarks field to inform the services counselor and the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Customer enters this information during onboarding. Optional field. + // + // Example: handle with care + // Read Only: true + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // delivery address update + DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // The SIT authorized end date for destination SIT. + // Format: date + DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The reason the TOO provided when requesting a diversion for this shipment. + // + // Read Only: true + DiversionReason *string `json:"diversionReason,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The ID of the shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Single-letter designator for domestic (d) or international (i) shipments + // Example: d + // Enum: [d i] + MarketCode string `json:"marketCode,omitempty"` + + // The ID of the move for this shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The SIT authorized end date for origin SIT. + // Format: date + OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date when the Prime contractor recorded the shipment's estimated weight. + // Read Only: true + // Format: date + PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` + + // The customer's preferred delivery date. + // Read Only: true + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` + + // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. + // + // Read Only: true + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` + + // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. + // + // Read Only: true + // Format: date + RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` + + // reweigh + Reweigh *Reweigh `json:"reweigh,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // sit extensions + SitExtensions SITExtensions `json:"sitExtensions,omitempty"` + + // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. + // + // Read Only: true + // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] + Status string `json:"status,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o shipment without service items +func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddressUpdate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReweigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExtensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if m.DeliveryAddressUpdate != nil { + if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) 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 +} + +var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" + MTOShipmentWithoutServiceItemsMarketCodeD string = "d" + + // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" + MTOShipmentWithoutServiceItemsMarketCodeI string = "i" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.OriginSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required + return nil + } + + if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if m.Reweigh != nil { + if err := m.Reweigh.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { + if swag.IsZero(m.SitExtensions) { // not required + return nil + } + + if err := m.SitExtensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" + + // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" + MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" + + // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" + MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" + MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" + + // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment without service items based on the context it is used +func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateApprovedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDiversionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReweigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitExtensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.DeliveryAddressUpdate != nil { + + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { + + if m.Reweigh != nil { + + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { + var res MTOShipmentWithoutServiceItems + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go new file mode 100644 index 00000000000..a3a91cb9226 --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_shipments_without_service_objects.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. +// +// swagger:model MTOShipmentsWithoutServiceObjects +type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems + +// Validate validates this m t o shipments without service objects +func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments without service objects based on the context it is used +func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/move_task_order.go b/pkg/gen/primev2messages/move_task_order.go new file mode 100644 index 00000000000..c5e6cf21146 --- /dev/null +++ b/pkg/gen/primev2messages/move_task_order.go @@ -0,0 +1,965 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveTaskOrder move task order +// +// swagger:model MoveTaskOrder +type MoveTaskOrder struct { + + // approved at + // Read Only: true + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // contract number + // Read Only: true + ContractNumber string `json:"contractNumber,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination g b l o c + // Example: KKFA + // Read Only: true + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + // destination postal code + // Example: 90210 + // Read Only: true + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // excess weight acknowledged at + // Read Only: true + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + // excess weight qualified at + // Read Only: true + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + // excess weight upload Id + // Read Only: true + // Format: uuid + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + mtoServiceItemsField []MTOServiceItem + + // mto shipments + // Required: true + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + // order + Order *Order `json:"order,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // payment requests + // Required: true + PaymentRequests PaymentRequests `json:"paymentRequests"` + + // ppm estimated weight + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + // ppm type + // Enum: [PARTIAL FULL] + PpmType string `json:"ppmType,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { + var data struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + ContractNumber string `json:"contractNumber,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + + var result MoveTaskOrder + + // approvedAt + result.ApprovedAt = data.ApprovedAt + + // availableToPrimeAt + result.AvailableToPrimeAt = data.AvailableToPrimeAt + + // contractNumber + result.ContractNumber = data.ContractNumber + + // createdAt + result.CreatedAt = data.CreatedAt + + // destinationGBLOC + result.DestinationGBLOC = data.DestinationGBLOC + + // destinationPostalCode + result.DestinationPostalCode = data.DestinationPostalCode + + // eTag + result.ETag = data.ETag + + // excessWeightAcknowledgedAt + result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt + + // excessWeightQualifiedAt + result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt + + // excessWeightUploadId + result.ExcessWeightUploadID = data.ExcessWeightUploadID + + // id + result.ID = data.ID + + // moveCode + result.MoveCode = data.MoveCode + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + // mtoShipments + result.MtoShipments = data.MtoShipments + + // order + result.Order = data.Order + + // orderID + result.OrderID = data.OrderID + + // paymentRequests + result.PaymentRequests = data.PaymentRequests + + // ppmEstimatedWeight + result.PpmEstimatedWeight = data.PpmEstimatedWeight + + // ppmType + result.PpmType = data.PpmType + + // primeCounselingCompletedAt + result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt + + // referenceId + result.ReferenceID = data.ReferenceID + + // updatedAt + result.UpdatedAt = data.UpdatedAt + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + ContractNumber string `json:"contractNumber,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + }{ + + ApprovedAt: m.ApprovedAt, + + AvailableToPrimeAt: m.AvailableToPrimeAt, + + ContractNumber: m.ContractNumber, + + CreatedAt: m.CreatedAt, + + DestinationGBLOC: m.DestinationGBLOC, + + DestinationPostalCode: m.DestinationPostalCode, + + ETag: m.ETag, + + ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, + + ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, + + ExcessWeightUploadID: m.ExcessWeightUploadID, + + ID: m.ID, + + MoveCode: m.MoveCode, + + MtoShipments: m.MtoShipments, + + Order: m.Order, + + OrderID: m.OrderID, + + PaymentRequests: m.PaymentRequests, + + PpmEstimatedWeight: m.PpmEstimatedWeight, + + PpmType: m.PpmType, + + PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, + + ReferenceID: m.ReferenceID, + + UpdatedAt: m.UpdatedAt, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this move task order +func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightUploadID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequests(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightUploadID) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { + + if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { + + if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { + return err + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(m.Order) { // not required + return nil + } + + if m.Order != nil { + if err := m.Order.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { + + if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { + return err + } + + if err := m.PaymentRequests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +var moveTaskOrderTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) + } +} + +const ( + + // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" + MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" + + // MoveTaskOrderPpmTypeFULL captures enum value "FULL" + MoveTaskOrderPpmTypeFULL string = "FULL" +) + +// prop value enum +func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move task order based on the context it is used +func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApprovedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContractNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateContractNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractNumber", "body", string(m.ContractNumber)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.Order != nil { + + if swag.IsZero(m.Order) { // not required + return nil + } + + if err := m.Order.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { + var res MoveTaskOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/order.go b/pkg/gen/primev2messages/order.go new file mode 100644 index 00000000000..e5ca0e8bc21 --- /dev/null +++ b/pkg/gen/primev2messages/order.go @@ -0,0 +1,516 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // customer + Customer *Customer `json:"customer,omitempty"` + + // customer ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CustomerID strfmt.UUID `json:"customerID,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // destination duty location g b l o c + // Example: KKFA + DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // entitlement + Entitlement *Entitlements `json:"entitlement,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lines of accounting + // Required: true + LinesOfAccounting *string `json:"linesOfAccounting"` + + // method of payment + // Read Only: true + MethodOfPayment string `json:"methodOfPayment,omitempty"` + + // naics + // Read Only: true + Naics string `json:"naics,omitempty"` + + // order number + // Required: true + OrderNumber *string `json:"orderNumber"` + + // orders type + OrdersType OrdersType `json:"ordersType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin duty location g b l o c + // Example: KKFA + OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` + + // packing and shipping instructions + // Read Only: true + PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` + + // rank + // Example: E_5 + // Required: true + Rank *string `json:"rank"` + + // report by date + // Format: date + ReportByDate strfmt.Date `json:"reportByDate,omitempty"` + + // supply and services cost estimate + // Read Only: true + SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinesOfAccounting(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRank(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) validateCustomerID(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerID) { // not required + return nil + } + + if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { + + if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrderNumber(formats strfmt.Registry) error { + + if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrdersType(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateRank(formats strfmt.Registry) error { + + if err := validate.Required("rank", "body", m.Rank); err != nil { + return err + } + + return nil +} + +func (m *Order) validateReportByDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReportByDate) { // not required + return nil + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this order based on the context it is used +func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMethodOfPayment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNaics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePackingAndShippingInstructions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupplyAndServicesCostEstimate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateMethodOfPayment(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "methodOfPayment", "body", string(m.MethodOfPayment)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateNaics(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "naics", "body", string(m.Naics)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidatePackingAndShippingInstructions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "packingAndShippingInstructions", "body", string(m.PackingAndShippingInstructions)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateSupplyAndServicesCostEstimate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "supplyAndServicesCostEstimate", "body", string(m.SupplyAndServicesCostEstimate)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/orders_type.go b/pkg/gen/primev2messages/orders_type.go new file mode 100644 index 00000000000..a5f02303750 --- /dev/null +++ b/pkg/gen/primev2messages/orders_type.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersType Orders type +// +// swagger:model OrdersType +type OrdersType string + +func NewOrdersType(value OrdersType) *OrdersType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersType. +func (m OrdersType) Pointer() *OrdersType { + return &m +} + +const ( + + // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" + OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" + + // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" + OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" + + // OrdersTypeRETIREMENT captures enum value "RETIREMENT" + OrdersTypeRETIREMENT OrdersType = "RETIREMENT" + + // OrdersTypeSEPARATION captures enum value "SEPARATION" + OrdersTypeSEPARATION OrdersType = "SEPARATION" + + // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" + OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" + + // OrdersTypeBLUEBARK captures enum value "BLUEBARK" + OrdersTypeBLUEBARK OrdersType = "BLUEBARK" + + // OrdersTypeSAFETY captures enum value "SAFETY" + OrdersTypeSAFETY OrdersType = "SAFETY" + + // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" + OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" + + // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" + OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" + + // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" + OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" +) + +// for schema +var ordersTypeEnum []interface{} + +func init() { + var res []OrdersType + if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeEnum = append(ordersTypeEnum, v) + } +} + +func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { + if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type +func (m OrdersType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type based on context it is used +func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/p_p_m_shipment.go b/pkg/gen/primev2messages/p_p_m_shipment.go new file mode 100644 index 00000000000..7cb11f73406 --- /dev/null +++ b/pkg/gen/primev2messages/p_p_m_shipment.go @@ -0,0 +1,587 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment +type PPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // The timestamp of when the PPM shipment was created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved in pounds. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin moving from their origin. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // The primary unique identifier of this PPM shipment + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + MaxIncentive *int64 `json:"maxIncentive"` + + // The estimated weight of the pro-gear being moved belonging to the service member in pounds. + ProGearWeight *int64 `json:"proGearWeight"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // The id of the parent MTOShipment record + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage in pounds. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // The timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this p p m shipment +func (m *PPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment based on the context it is used +func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment) UnmarshalBinary(b []byte) error { + var res PPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/p_p_m_shipment_status.go b/pkg/gen/primev2messages/p_p_m_shipment_status.go new file mode 100644 index 00000000000..ccbf00e05d1 --- /dev/null +++ b/pkg/gen/primev2messages/p_p_m_shipment_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMShipmentStatus Status of the PPM Shipment: +// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. +// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. +// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. +// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. +// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. +// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. +// +// swagger:model PPMShipmentStatus +type PPMShipmentStatus string + +func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. +func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { + return &m +} + +const ( + + // PPMShipmentStatusDRAFT captures enum value "DRAFT" + PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" + + // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" + PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" + + // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" + + // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" + + // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" + + // PPMShipmentStatusCANCELED captures enum value "CANCELED" + PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" +) + +// for schema +var pPMShipmentStatusEnum []interface{} + +func init() { + var res []PPMShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) + } +} + +func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { + if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m shipment status +func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p p m shipment status based on the context it is used +func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/payment_request.go b/pkg/gen/primev2messages/payment_request.go new file mode 100644 index 00000000000..76c4688a11b --- /dev/null +++ b/pkg/gen/primev2messages/payment_request.go @@ -0,0 +1,322 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // payment service items + PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` + + // proof of service docs + ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfServiceDocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItems) { // not required + return nil + } + + if err := m.PaymentServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { + if swag.IsZero(m.ProofOfServiceDocs) { // not required + return nil + } + + if err := m.ProofOfServiceDocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/payment_request_status.go b/pkg/gen/primev2messages/payment_request_status.go new file mode 100644 index 00000000000..ba2eb3a5788 --- /dev/null +++ b/pkg/gen/primev2messages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" + PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/payment_requests.go b/pkg/gen/primev2messages/payment_requests.go new file mode 100644 index 00000000000..0599f81434f --- /dev/null +++ b/pkg/gen/primev2messages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/payment_service_item.go b/pkg/gen/primev2messages/payment_service_item.go new file mode 100644 index 00000000000..bf995a97438 --- /dev/null +++ b/pkg/gen/primev2messages/payment_service_item.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItem payment service item +// +// swagger:model PaymentServiceItem +type PaymentServiceItem struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // payment service item params + PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` + + // Price of the service item in cents + PriceCents *int64 `json:"priceCents,omitempty"` + + // reference ID + // Example: 1234-5678-c56a4180 + // Read Only: true + ReferenceID string `json:"referenceID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentServiceItemStatus `json:"status,omitempty"` +} + +// Validate validates this payment service item +func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemParams) { // not required + return nil + } + + if err := m.PaymentServiceItemParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item based on the context it is used +func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferenceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { + var res PaymentServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/payment_service_item_param.go b/pkg/gen/primev2messages/payment_service_item_param.go new file mode 100644 index 00000000000..5f1c86b59b1 --- /dev/null +++ b/pkg/gen/primev2messages/payment_service_item_param.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemParam payment service item param +// +// swagger:model PaymentServiceItemParam +type PaymentServiceItemParam struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // key + Key ServiceItemParamName `json:"key,omitempty"` + + // origin + Origin ServiceItemParamOrigin `json:"origin,omitempty"` + + // payment service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` + + // type + Type ServiceItemParamType `json:"type,omitempty"` + + // value + // Example: 3025 + Value string `json:"value,omitempty"` +} + +// Validate validates this payment service item param +func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item param based on the context it is used +func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKey(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { + var res PaymentServiceItemParam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/payment_service_item_params.go b/pkg/gen/primev2messages/payment_service_item_params.go new file mode 100644 index 00000000000..e9153604876 --- /dev/null +++ b/pkg/gen/primev2messages/payment_service_item_params.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItemParams payment service item params +// +// swagger:model PaymentServiceItemParams +type PaymentServiceItemParams []*PaymentServiceItemParam + +// Validate validates this payment service item params +func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service item params based on the context it is used +func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/payment_service_item_status.go b/pkg/gen/primev2messages/payment_service_item_status.go new file mode 100644 index 00000000000..950b07812d7 --- /dev/null +++ b/pkg/gen/primev2messages/payment_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemStatus Payment Service Item Status +// +// swagger:model PaymentServiceItemStatus +type PaymentServiceItemStatus string + +func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. +func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { + return &m +} + +const ( + + // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" + PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" + + // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" + PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" + + // PaymentServiceItemStatusDENIED captures enum value "DENIED" + PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" + + // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" + + // PaymentServiceItemStatusPAID captures enum value "PAID" + PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" + + // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" + PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" +) + +// for schema +var paymentServiceItemStatusEnum []interface{} + +func init() { + var res []PaymentServiceItemStatus + if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) + } +} + +func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment service item status +func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment service item status based on context it is used +func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/payment_service_items.go b/pkg/gen/primev2messages/payment_service_items.go new file mode 100644 index 00000000000..bc947193108 --- /dev/null +++ b/pkg/gen/primev2messages/payment_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItems payment service items +// +// swagger:model PaymentServiceItems +type PaymentServiceItems []*PaymentServiceItem + +// Validate validates this payment service items +func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service items based on the context it is used +func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/proof_of_service_doc.go b/pkg/gen/primev2messages/proof_of_service_doc.go new file mode 100644 index 00000000000..3ee86851448 --- /dev/null +++ b/pkg/gen/primev2messages/proof_of_service_doc.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDoc proof of service doc +// +// swagger:model ProofOfServiceDoc +type ProofOfServiceDoc struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this proof of service doc +func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service doc based on the context it is used +func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { + var res ProofOfServiceDoc + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/proof_of_service_docs.go b/pkg/gen/primev2messages/proof_of_service_docs.go new file mode 100644 index 00000000000..18000e74808 --- /dev/null +++ b/pkg/gen/primev2messages/proof_of_service_docs.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDocs proof of service docs +// +// swagger:model ProofOfServiceDocs +type ProofOfServiceDocs []*ProofOfServiceDoc + +// Validate validates this proof of service docs +func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this proof of service docs based on the context it is used +func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/re_service_code.go b/pkg/gen/primev2messages/re_service_code.go new file mode 100644 index 00000000000..e173f0bc308 --- /dev/null +++ b/pkg/gen/primev2messages/re_service_code.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items +// may be requested by the Prime, but may be returned in a response. +// +// Documentation of all the service items will be provided. +// +// swagger:model ReServiceCode +type ReServiceCode string + +func NewReServiceCode(value ReServiceCode) *ReServiceCode { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReServiceCode. +func (m ReServiceCode) Pointer() *ReServiceCode { + return &m +} + +const ( + + // ReServiceCodeCS captures enum value "CS" + ReServiceCodeCS ReServiceCode = "CS" + + // ReServiceCodeDBHF captures enum value "DBHF" + ReServiceCodeDBHF ReServiceCode = "DBHF" + + // ReServiceCodeDBTF captures enum value "DBTF" + ReServiceCodeDBTF ReServiceCode = "DBTF" + + // ReServiceCodeDCRT captures enum value "DCRT" + ReServiceCodeDCRT ReServiceCode = "DCRT" + + // ReServiceCodeDDASIT captures enum value "DDASIT" + ReServiceCodeDDASIT ReServiceCode = "DDASIT" + + // ReServiceCodeDDDSIT captures enum value "DDDSIT" + ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" + + // ReServiceCodeDDFSIT captures enum value "DDFSIT" + ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" + + // ReServiceCodeDDP captures enum value "DDP" + ReServiceCodeDDP ReServiceCode = "DDP" + + // ReServiceCodeDDSHUT captures enum value "DDSHUT" + ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" + + // ReServiceCodeDLH captures enum value "DLH" + ReServiceCodeDLH ReServiceCode = "DLH" + + // ReServiceCodeDMHF captures enum value "DMHF" + ReServiceCodeDMHF ReServiceCode = "DMHF" + + // ReServiceCodeDNPK captures enum value "DNPK" + ReServiceCodeDNPK ReServiceCode = "DNPK" + + // ReServiceCodeDOASIT captures enum value "DOASIT" + ReServiceCodeDOASIT ReServiceCode = "DOASIT" + + // ReServiceCodeDOFSIT captures enum value "DOFSIT" + ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" + + // ReServiceCodeDOP captures enum value "DOP" + ReServiceCodeDOP ReServiceCode = "DOP" + + // ReServiceCodeDOPSIT captures enum value "DOPSIT" + ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" + + // ReServiceCodeDOSHUT captures enum value "DOSHUT" + ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" + + // ReServiceCodeDPK captures enum value "DPK" + ReServiceCodeDPK ReServiceCode = "DPK" + + // ReServiceCodeDSH captures enum value "DSH" + ReServiceCodeDSH ReServiceCode = "DSH" + + // ReServiceCodeDUCRT captures enum value "DUCRT" + ReServiceCodeDUCRT ReServiceCode = "DUCRT" + + // ReServiceCodeDUPK captures enum value "DUPK" + ReServiceCodeDUPK ReServiceCode = "DUPK" + + // ReServiceCodeFSC captures enum value "FSC" + ReServiceCodeFSC ReServiceCode = "FSC" + + // ReServiceCodeIBHF captures enum value "IBHF" + ReServiceCodeIBHF ReServiceCode = "IBHF" + + // ReServiceCodeIBTF captures enum value "IBTF" + ReServiceCodeIBTF ReServiceCode = "IBTF" + + // ReServiceCodeICOLH captures enum value "ICOLH" + ReServiceCodeICOLH ReServiceCode = "ICOLH" + + // ReServiceCodeICOUB captures enum value "ICOUB" + ReServiceCodeICOUB ReServiceCode = "ICOUB" + + // ReServiceCodeICRT captures enum value "ICRT" + ReServiceCodeICRT ReServiceCode = "ICRT" + + // ReServiceCodeIDASIT captures enum value "IDASIT" + ReServiceCodeIDASIT ReServiceCode = "IDASIT" + + // ReServiceCodeIDDSIT captures enum value "IDDSIT" + ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" + + // ReServiceCodeIDFSIT captures enum value "IDFSIT" + ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" + + // ReServiceCodeIDSHUT captures enum value "IDSHUT" + ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" + + // ReServiceCodeIHPK captures enum value "IHPK" + ReServiceCodeIHPK ReServiceCode = "IHPK" + + // ReServiceCodeIHUPK captures enum value "IHUPK" + ReServiceCodeIHUPK ReServiceCode = "IHUPK" + + // ReServiceCodeINPK captures enum value "INPK" + ReServiceCodeINPK ReServiceCode = "INPK" + + // ReServiceCodeIOASIT captures enum value "IOASIT" + ReServiceCodeIOASIT ReServiceCode = "IOASIT" + + // ReServiceCodeIOCLH captures enum value "IOCLH" + ReServiceCodeIOCLH ReServiceCode = "IOCLH" + + // ReServiceCodeIOCUB captures enum value "IOCUB" + ReServiceCodeIOCUB ReServiceCode = "IOCUB" + + // ReServiceCodeIOFSIT captures enum value "IOFSIT" + ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" + + // ReServiceCodeIOOLH captures enum value "IOOLH" + ReServiceCodeIOOLH ReServiceCode = "IOOLH" + + // ReServiceCodeIOOUB captures enum value "IOOUB" + ReServiceCodeIOOUB ReServiceCode = "IOOUB" + + // ReServiceCodeIOPSIT captures enum value "IOPSIT" + ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" + + // ReServiceCodeIOSHUT captures enum value "IOSHUT" + ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" + + // ReServiceCodeIUBPK captures enum value "IUBPK" + ReServiceCodeIUBPK ReServiceCode = "IUBPK" + + // ReServiceCodeIUBUPK captures enum value "IUBUPK" + ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" + + // ReServiceCodeIUCRT captures enum value "IUCRT" + ReServiceCodeIUCRT ReServiceCode = "IUCRT" + + // ReServiceCodeMS captures enum value "MS" + ReServiceCodeMS ReServiceCode = "MS" + + // ReServiceCodeNSTH captures enum value "NSTH" + ReServiceCodeNSTH ReServiceCode = "NSTH" + + // ReServiceCodeNSTUB captures enum value "NSTUB" + ReServiceCodeNSTUB ReServiceCode = "NSTUB" +) + +// for schema +var reServiceCodeEnum []interface{} + +func init() { + var res []ReServiceCode + if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceCodeEnum = append(reServiceCodeEnum, v) + } +} + +func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { + if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this re service code +func (m ReServiceCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReServiceCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this re service code based on context it is used +func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/reweigh.go b/pkg/gen/primev2messages/reweigh.go new file mode 100644 index 00000000000..8b4b29c7982 --- /dev/null +++ b/pkg/gen/primev2messages/reweigh.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. +// +// swagger:model Reweigh +type Reweigh struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // requested at + // Format: date-time + RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` + + // requested by + RequestedBy ReweighRequester `json:"requestedBy,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // verification provided at + // Format: date-time + VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` + + // verification reason + // Example: The reweigh was not performed due to some justification provided by the Prime + VerificationReason *string `json:"verificationReason"` + + // weight + // Example: 2000 + Weight *int64 `json:"weight"` +} + +// Validate validates this reweigh +func (m *Reweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVerificationProvidedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerificationProvidedAt) { // not required + return nil + } + + if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this reweigh based on the context it is used +func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reweigh) UnmarshalBinary(b []byte) error { + var res Reweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/reweigh_requester.go b/pkg/gen/primev2messages/reweigh_requester.go new file mode 100644 index 00000000000..dc743e74868 --- /dev/null +++ b/pkg/gen/primev2messages/reweigh_requester.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReweighRequester reweigh requester +// +// swagger:model ReweighRequester +type ReweighRequester string + +func NewReweighRequester(value ReweighRequester) *ReweighRequester { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReweighRequester. +func (m ReweighRequester) Pointer() *ReweighRequester { + return &m +} + +const ( + + // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" + ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" + + // ReweighRequesterPRIME captures enum value "PRIME" + ReweighRequesterPRIME ReweighRequester = "PRIME" + + // ReweighRequesterSYSTEM captures enum value "SYSTEM" + ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" + + // ReweighRequesterTOO captures enum value "TOO" + ReweighRequesterTOO ReweighRequester = "TOO" +) + +// for schema +var reweighRequesterEnum []interface{} + +func init() { + var res []ReweighRequester + if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reweighRequesterEnum = append(reweighRequesterEnum, v) + } +} + +func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { + if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reweigh requester +func (m ReweighRequester) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReweighRequesterEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reweigh requester based on context it is used +func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/s_i_t_extension.go b/pkg/gen/primev2messages/s_i_t_extension.go new file mode 100644 index 00000000000..96f6f518790 --- /dev/null +++ b/pkg/gen/primev2messages/s_i_t_extension.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. +// +// swagger:model SITExtension +type SITExtension struct { + + // approved days + // Example: 30 + ApprovedDays *int64 `json:"approvedDays"` + + // contractor remarks + // Example: We need SIT additional days. The customer has not found a house yet. + ContractorRemarks *string `json:"contractorRemarks"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // decision date + // Format: date-time + DecisionDate *strfmt.DateTime `json:"decisionDate"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // office remarks + OfficeRemarks *string `json:"officeRemarks"` + + // request reason + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason string `json:"requestReason,omitempty"` + + // requested days + // Example: 30 + RequestedDays int64 `json:"requestedDays,omitempty"` + + // status + // Enum: [PENDING APPROVED DENIED] + Status interface{} `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this s i t extension +func (m *SITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { + if swag.IsZero(m.DecisionDate) { // not required + return nil + } + + if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +var sITExtensionTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) + } +} + +const ( + + // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // SITExtensionRequestReasonOTHER captures enum value "OTHER" + SITExtensionRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { + if swag.IsZero(m.RequestReason) { // not required + return nil + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t extension based on the context it is used +func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITExtension) UnmarshalBinary(b []byte) error { + var res SITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/s_i_t_extensions.go b/pkg/gen/primev2messages/s_i_t_extensions.go new file mode 100644 index 00000000000..f796a4525ed --- /dev/null +++ b/pkg/gen/primev2messages/s_i_t_extensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITExtensions s i t extensions +// +// swagger:model SITExtensions +type SITExtensions []*SITExtension + +// Validate validates this s i t extensions +func (m SITExtensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t extensions based on the context it is used +func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/s_i_t_location_type.go b/pkg/gen/primev2messages/s_i_t_location_type.go new file mode 100644 index 00000000000..0f7c75fce4a --- /dev/null +++ b/pkg/gen/primev2messages/s_i_t_location_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SITLocationType The list of SIT location types. +// +// swagger:model SITLocationType +type SITLocationType string + +func NewSITLocationType(value SITLocationType) *SITLocationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SITLocationType. +func (m SITLocationType) Pointer() *SITLocationType { + return &m +} + +const ( + + // SITLocationTypeORIGIN captures enum value "ORIGIN" + SITLocationTypeORIGIN SITLocationType = "ORIGIN" + + // SITLocationTypeDESTINATION captures enum value "DESTINATION" + SITLocationTypeDESTINATION SITLocationType = "DESTINATION" +) + +// for schema +var sITLocationTypeEnum []interface{} + +func init() { + var res []SITLocationType + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITLocationTypeEnum = append(sITLocationTypeEnum, v) + } +} + +func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { + if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this s i t location type +func (m SITLocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this s i t location type based on context it is used +func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/service_item_param_name.go b/pkg/gen/primev2messages/service_item_param_name.go new file mode 100644 index 00000000000..fb2d4097030 --- /dev/null +++ b/pkg/gen/primev2messages/service_item_param_name.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamName service item param name +// +// swagger:model ServiceItemParamName +type ServiceItemParamName string + +func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. +func (m ServiceItemParamName) Pointer() *ServiceItemParamName { + return &m +} + +const ( + + // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" + ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" + + // ServiceItemParamNameContractCode captures enum value "ContractCode" + ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" + + // ServiceItemParamNameContractYearName captures enum value "ContractYearName" + ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" + + // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" + ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" + + // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" + ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" + + // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" + ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" + + // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" + ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" + + // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" + ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" + + // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" + ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" + + // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" + ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" + + // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" + ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" + + // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" + ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" + + // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" + ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" + + // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" + ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" + + // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" + ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" + + // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" + ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" + + // ServiceItemParamNameIsPeak captures enum value "IsPeak" + ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" + + // ServiceItemParamNameMarketDest captures enum value "MarketDest" + ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" + + // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" + ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" + + // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" + ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" + + // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" + ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" + + // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" + ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" + + // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" + ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" + + // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" + ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" + + // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" + ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" + + // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" + ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" + + // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" + ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" + + // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" + ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" + + // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" + ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" + + // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" + ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" + + // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" + ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" + + // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" + ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" + + // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" + ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" + + // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" + ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" + + // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" + ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" + ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" + + // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" + ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" + + // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" + ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" + + // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" + + // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" + ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" + + // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" + ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" + + // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" + ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" + + // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" + ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" + + // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" + ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" + + // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" + ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" + + // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" + ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" + + // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" + ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" + + // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" + ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" + + // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" + ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" + + // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" + ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" + + // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" + ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" + + // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" + ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" + + // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" + ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" + + // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" + ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" + + // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" + ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" + + // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" + ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" + + // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" + ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" + + // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" + ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" + + // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" + ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" + + // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" + ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" + + // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" + ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" + + // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" + ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" + + // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" + ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" + + // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" + ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" + + // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" + ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" + + // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" + ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" + + // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" + ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" + + // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" + ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" +) + +// for schema +var serviceItemParamNameEnum []interface{} + +func init() { + var res []ServiceItemParamName + if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) + } +} + +func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { + if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param name +func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param name based on context it is used +func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/service_item_param_origin.go b/pkg/gen/primev2messages/service_item_param_origin.go new file mode 100644 index 00000000000..f538d3d3e0a --- /dev/null +++ b/pkg/gen/primev2messages/service_item_param_origin.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamOrigin service item param origin +// +// swagger:model ServiceItemParamOrigin +type ServiceItemParamOrigin string + +func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. +func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { + return &m +} + +const ( + + // ServiceItemParamOriginPRIME captures enum value "PRIME" + ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" + + // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" + ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" + + // ServiceItemParamOriginPRICER captures enum value "PRICER" + ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" + + // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" + ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" +) + +// for schema +var serviceItemParamOriginEnum []interface{} + +func init() { + var res []ServiceItemParamOrigin + if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) + } +} + +func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { + if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param origin +func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param origin based on context it is used +func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/service_item_param_type.go b/pkg/gen/primev2messages/service_item_param_type.go new file mode 100644 index 00000000000..5b54bf45395 --- /dev/null +++ b/pkg/gen/primev2messages/service_item_param_type.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamType service item param type +// +// swagger:model ServiceItemParamType +type ServiceItemParamType string + +func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. +func (m ServiceItemParamType) Pointer() *ServiceItemParamType { + return &m +} + +const ( + + // ServiceItemParamTypeSTRING captures enum value "STRING" + ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" + + // ServiceItemParamTypeDATE captures enum value "DATE" + ServiceItemParamTypeDATE ServiceItemParamType = "DATE" + + // ServiceItemParamTypeINTEGER captures enum value "INTEGER" + ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" + + // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" + ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" + + // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" + ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" + + // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" + ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" + + // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" + ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" +) + +// for schema +var serviceItemParamTypeEnum []interface{} + +func init() { + var res []ServiceItemParamType + if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) + } +} + +func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { + if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param type +func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param type based on context it is used +func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/service_request_document.go b/pkg/gen/primev2messages/service_request_document.go new file mode 100644 index 00000000000..403b8ec71d8 --- /dev/null +++ b/pkg/gen/primev2messages/service_request_document.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocument service request document +// +// swagger:model ServiceRequestDocument +type ServiceRequestDocument struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this service request document +func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request document based on the context it is used +func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { + var res ServiceRequestDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/service_request_documents.go b/pkg/gen/primev2messages/service_request_documents.go new file mode 100644 index 00000000000..5f2981f337c --- /dev/null +++ b/pkg/gen/primev2messages/service_request_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocuments service request documents +// +// swagger:model ServiceRequestDocuments +type ServiceRequestDocuments []*ServiceRequestDocument + +// Validate validates this service request documents +func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this service request documents based on the context it is used +func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/shipment_address_update.go b/pkg/gen/primev2messages/shipment_address_update.go new file mode 100644 index 00000000000..af7df83363b --- /dev/null +++ b/pkg/gen/primev2messages/shipment_address_update.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. +// +// swagger:model ShipmentAddressUpdate +type ShipmentAddressUpdate struct { + + // Contractor Remarks + // + // The reason there is an address change. + // Example: This is a contractor remark + // Required: true + // Read Only: true + ContractorRemarks string `json:"contractorRemarks"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` + + // The distance between the original SIT address and requested new delivery address of shipment + // Example: 88 + // Minimum: 0 + NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` + + // Office Remarks + // + // The TOO comment on approval or rejection. + // Example: This is an office remark + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // The distance between the original SIT address and the previous/old delivery address of shipment + // Example: 50 + // Minimum: 0 + OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` + + // original address + // Required: true + OriginalAddress *Address `json:"originalAddress"` + + // shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID"` + + // sit original address + SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` + + // status + // Required: true + Status ShipmentAddressUpdateStatus `json:"status"` +} + +// Validate validates this shipment address update +func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOldSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.NewSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.OldSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { + + if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { + return err + } + + if m.OriginalAddress != nil { + if err := m.OriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if m.SitOriginalAddress != nil { + if err := m.SitOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this shipment address update based on the context it is used +func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginalAddress != nil { + + if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginalAddress != nil { + + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { + var res ShipmentAddressUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/shipment_address_update_status.go b/pkg/gen/primev2messages/shipment_address_update_status.go new file mode 100644 index 00000000000..fe9f0082eb6 --- /dev/null +++ b/pkg/gen/primev2messages/shipment_address_update_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdateStatus Status +// +// swagger:model ShipmentAddressUpdateStatus +type ShipmentAddressUpdateStatus string + +func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. +func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { + return &m +} + +const ( + + // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" + ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" + + // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" + ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" + + // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" + ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" +) + +// for schema +var shipmentAddressUpdateStatusEnum []interface{} + +func init() { + var res []ShipmentAddressUpdateStatus + if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) + } +} + +func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { + if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this shipment address update status +func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipment address update status based on the context it is used +func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev2messages/storage_facility.go b/pkg/gen/primev2messages/storage_facility.go new file mode 100644 index 00000000000..347c8629822 --- /dev/null +++ b/pkg/gen/primev2messages/storage_facility.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageFacility The Storage Facility information for the shipment +// +// swagger:model StorageFacility +type StorageFacility struct { + + // address + Address *Address `json:"address,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // facility name + FacilityName string `json:"facilityName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lot number + LotNumber *string `json:"lotNumber,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` +} + +// Validate validates this storage facility +func (m *StorageFacility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this storage facility based on the context it is used +func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageFacility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageFacility) UnmarshalBinary(b []byte) error { + var res StorageFacility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item.go b/pkg/gen/primev2messages/update_m_t_o_service_item.go new file mode 100644 index 00000000000..659a4a1904a --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_service_item.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. +// +// swagger:discriminator UpdateMTOServiceItem modelType +type UpdateMTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // ID of the service item. Must match path. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // model type + // Required: true + ModelType() UpdateMTOServiceItemModelType + SetModelType(UpdateMTOServiceItemModelType) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type updateMTOServiceItem struct { + idField strfmt.UUID + + modelTypeField UpdateMTOServiceItemModelType +} + +// ID gets the id of this polymorphic type +func (m *updateMTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []UpdateMTOServiceItem + for _, element := range elements { + obj, err := unmarshalUpdateMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalUpdateMTOServiceItem(data, consumer) +} + +func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "UpdateMTOServiceItem": + var result updateMTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemSIT": + var result UpdateMTOServiceItemSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemShuttle": + var result UpdateMTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this update m t o service item +func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) 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 +} + +// ContextValidate validate this update m t o service item based on the context it is used +func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go b/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..6d9ea3d53ee --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_service_item_model_type.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DDDSIT - UpdateMTOServiceItemSIT +// - DOPSIT - UpdateMTOServiceItemSIT +// - DOASIT - UpdateMTOServiceItemSIT +// - DOFSIT - UpdateMTOServiceItemSIT +// - DDSHUT - UpdateMTOServiceItemShuttle +// - DOSHUT - UpdateMTOServiceItemShuttle +// +// The documentation will then update with the supported fields. +// +// swagger:model UpdateMTOServiceItemModelType +type UpdateMTOServiceItemModelType string + +func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. +func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { + return &m +} + +const ( + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" +) + +// for schema +var updateMTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []UpdateMTOServiceItemModelType + if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) + } +} + +func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this update m t o service item model type +func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this update m t o service item model type based on context it is used +func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go new file mode 100644 index 00000000000..558e84ba19c --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_service_item_s_i_t.go @@ -0,0 +1,680 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item. +// +// swagger:model UpdateMTOServiceItemSIT +type UpdateMTOServiceItemSIT struct { + idField strfmt.UUID + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemSIT" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemSIT + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + result.UpdateReason = data.UpdateReason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + + UpdateReason: m.UpdateReason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item s i t +func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDDSIT","DOPSIT","DOASIT","DOFSIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if swag.IsZero(m.SitPostalCode) { // not required + return nil + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item s i t based on the context it is used +func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..cafb9b20492 --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_service_item_shuttle.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. +// +// swagger:model UpdateMTOServiceItemShuttle +type UpdateMTOServiceItemShuttle struct { + idField strfmt.UUID + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemShuttle + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item shuttle +func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) 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 +} + +var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item shuttle based on the context it is used +func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_shipment.go b/pkg/gen/primev2messages/update_m_t_o_shipment.go new file mode 100644 index 00000000000..6ac1dc7ebd6 --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_shipment.go @@ -0,0 +1,534 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipment update m t o shipment +// +// swagger:model UpdateMTOShipment +type UpdateMTOShipment struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // actual pro gear weight + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // actual spouse pro gear weight + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // counselor remarks + // Example: counselor approved + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // ppm shipment + PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` +} + +// Validate validates this update m t o shipment +func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update m t o shipment based on the context it is used +func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_m_t_o_shipment_status.go b/pkg/gen/primev2messages/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..e5804c0173c --- /dev/null +++ b/pkg/gen/primev2messages/update_m_t_o_shipment_status.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. +// +// swagger:model UpdateMTOShipmentStatus +type UpdateMTOShipmentStatus struct { + + // status + // Enum: [CANCELED] + Status string `json:"status,omitempty"` +} + +// Validate validates this update m t o shipment status +func (m *UpdateMTOShipmentStatus) 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 +} + +var updateMTOShipmentStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) + } +} + +const ( + + // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" + UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" +) + +// prop value enum +func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update m t o shipment status based on context it is used +func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipmentStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_p_p_m_shipment.go b/pkg/gen/primev2messages/update_p_p_m_shipment.go new file mode 100644 index 00000000000..b0310f92f8b --- /dev/null +++ b/pkg/gen/primev2messages/update_p_p_m_shipment.go @@ -0,0 +1,199 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePPMShipment The PPM specific fields of the shipment with values being changed +// +// swagger:model UpdatePPMShipment +type UpdatePPMShipment struct { + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // Date the customer expects to begin moving from their origin. + // + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear,omitempty"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` + + // The estimated weight of the goods being put into storage. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + SitExpected *bool `json:"sitExpected,omitempty"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` +} + +// Validate validates this update p p m shipment +func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.ExpectedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update p p m shipment based on the context it is used +func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { + var res UpdatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_reweigh.go b/pkg/gen/primev2messages/update_reweigh.go new file mode 100644 index 00000000000..3d2c861ac7c --- /dev/null +++ b/pkg/gen/primev2messages/update_reweigh.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. +// +// swagger:model UpdateReweigh +type UpdateReweigh struct { + + // In lieu of a document being uploaded indicating why a reweigh did not occur. + // Example: The reweigh was not performed because the shipment was already delivered + VerificationReason *string `json:"verificationReason"` + + // The total reweighed weight for the shipment in pounds. + // Example: 2000 + // Minimum: 1 + Weight *int64 `json:"weight"` +} + +// Validate validates this update reweigh +func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update reweigh based on context it is used +func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { + var res UpdateReweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/update_shipment_destination_address.go b/pkg/gen/primev2messages/update_shipment_destination_address.go new file mode 100644 index 00000000000..aa41a7747d8 --- /dev/null +++ b/pkg/gen/primev2messages/update_shipment_destination_address.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. +// +// swagger:model UpdateShipmentDestinationAddress +type UpdateShipmentDestinationAddress struct { + + // This is the remark the Prime has entered, which would be the reason there is an address change. + // Example: Customer reached out to me this week and let me know they want to move somewhere else. + // Required: true + ContractorRemarks *string `json:"contractorRemarks"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` +} + +// Validate validates this update shipment destination address +func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update shipment destination address based on the context it is used +func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { + var res UpdateShipmentDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/upload_with_omissions.go b/pkg/gen/primev2messages/upload_with_omissions.go new file mode 100644 index 00000000000..b57f9bc715e --- /dev/null +++ b/pkg/gen/primev2messages/upload_with_omissions.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadWithOmissions An uploaded file. +// +// swagger:model UploadWithOmissions +type UploadWithOmissions struct { + + // bytes + // Required: true + Bytes *int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + ContentType *string `json:"contentType"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + Filename *string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // rotation + Rotation int64 `json:"rotation,omitempty"` + + // status + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this upload with omissions +func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", m.Bytes); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { + + if err := validate.Required("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) 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 +} + +var uploadWithOmissionsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) + } +} + +const ( + + // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" + UploadWithOmissionsStatusINFECTED string = "INFECTED" + + // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" + UploadWithOmissionsStatusCLEAN string = "CLEAN" + + // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" + UploadWithOmissionsStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload with omissions based on the context it is used +func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { + var res UploadWithOmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/validation_error.go b/pkg/gen/primev2messages/validation_error.go new file mode 100644 index 00000000000..78fe0f38f69 --- /dev/null +++ b/pkg/gen/primev2messages/validation_error.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + // invalid fields + // Required: true + InvalidFields map[string][]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.InvalidFields = dataAO1.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + + dataAO1.InvalidFields = m.InvalidFields + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3api/configure_mymove.go b/pkg/gen/primev3api/configure_mymove.go new file mode 100644 index 00000000000..9ed63a0cd02 --- /dev/null +++ b/pkg/gen/primev3api/configure_mymove.go @@ -0,0 +1,87 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package primev3api + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations" + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/mto_shipment" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/prime_v3.yaml --api-package primev3operations --model-package primev3messages --server-package primev3api --principal interface{} --exclude-main + +func configureFlags(api *primev3operations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *primev3operations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + if api.MtoShipmentCreateMTOShipmentHandler == nil { + api.MtoShipmentCreateMTOShipmentHandler = mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }) + } + if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { + api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentHandler == nil { + api.MtoShipmentUpdateMTOShipmentHandler = mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/primev3api/doc.go b/pkg/gen/primev3api/doc.go new file mode 100644 index 00000000000..f2f42eb107e --- /dev/null +++ b/pkg/gen/primev3api/doc.go @@ -0,0 +1,26 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package primev3api MilMove Prime V3 API +// +// The Prime V3 API is a RESTful API that enables the Prime contractor to request +// information about upcoming moves, update the details and status of those moves, +// and make payment requests. It uses Mutual TLS for authentication procedures. +// +// All endpoints are located at `/prime/v3/`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /prime/v3 +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// swagger:meta +package primev3api diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go new file mode 100644 index 00000000000..df6a51d3016 --- /dev/null +++ b/pkg/gen/primev3api/embedded_spec.go @@ -0,0 +1,8587 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3api + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime V3 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v3/` + "`" + `.\n", + "title": "MilMove Prime V3 API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v3", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use........", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "x-examples": { + "application/json": { + "boat": { + "summary": "Boat Shipment", + "value": { + "boatShipment": { + "hasTrailer": true, + "heightFeet": 2, + "heightInches": 2, + "isRoadworthy": false, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "counselorRemarks": "test", + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "HAUL_AWAY" + } + }, + "hhg": { + "summary": "HHG", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG" + } + }, + "mobileHome": { + "summary": "Mobile Home Shipment", + "value": { + "counselorRemarks": "test", + "mobileHomeShipment": { + "heightFeet": 2, + "heightInches": 2, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "MOBILE_HOME" + } + }, + "nts": { + "summary": "NTS", + "value": { + "agents": [ + { + "agentType": "RELEASING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG_INTO_NTS" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "agents": [ + { + "agentType": "RECEIVING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "destinationAddress": { + "city": "NY", + "postalCode": "10001", + "state": "NY", + "streetAddress1": "123 Street" + }, + "estimatedWeight": 4999, + "expectedDepartureDate": "2022-10-01", + "hasProGear": false, + "pickupAddress": { + "city": "Beverly Hills", + "postalCode": "90210", + "state": "CA", + "streetAddress1": "204 South Prospect Lane" + }, + "sitExpected": false + }, + "shipmentType": "PPM" + } + } + } + }, + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "patch": { + "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "x-examples": { + "application/json": { + "hhg": { + "summary": "HHG", + "value": { + "actualPickupDate": "2022-12-29", + "destinationAddress": { + "city": "Great Bend", + "postalCode": "13643", + "state": "NY", + "streetAddress1": "6622 Airport Way S", + "streetAddress2": "#1430" + }, + "firstAvailableDeliveryDate": "2023-01-04", + "pointOfContact": "peyton.wing@example.com", + "primeActualWeight": 4500, + "primeEstimatedWeight": 4250, + "scheduledPickupDate": "2022-12-30" + } + }, + "nts": { + "summary": "NTS", + "value": { + "actualPickupDate": "2022-12-29", + "actualWeight": 4500, + "counselorRemarks": "Beware of dogs on property", + "estimatedWeight": 4250, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "scheduledPickupDate": "2022-12-30" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "destinationAddress": { + "city": "San Antonio", + "postalCode": "78245", + "state": "TX", + "streetAddress1": "812 S 129th Street" + }, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ntsRecordedWeight": 4500 + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "hasProGear": true, + "proGearWeight": 830, + "sitEstimatedDepartureDate": "2022-10-13", + "sitEstimatedEntryDate": "2022-10-06", + "sitEstimatedWeight": 1760, + "sitExpected": true, + "sitLocation": "DESTINATION", + "spouseProGearWeight": 366 + } + } + } + } + }, + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipment" + } + }, + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateBoatShipment": { + "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "primary location the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", + "type": "boolean" + }, + "divertedFromShipmentId": { + "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The primary address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "second location where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "The second address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "tertiaryDestinationAddress": { + "description": "third location where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "The third address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreateMobileHomeShipment": { + "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "An optional secondary address near the destination where goods will be dropped off.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "An optional secondary Pickup Address address near the origin where additional goods exist.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "description": "An optional tertiary address near the destination where goods will be dropped off.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "An optional tertiary Pickup Address address near the origin where additional goods exist.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationRateArea": { + "$ref": "#/definitions/RateArea" + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originRateArea": { + "$ref": "#/definitions/RateArea" + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "portOfDebarkation": { + "$ref": "#/definitions/Port" + }, + "portOfEmbarkation": { + "$ref": "#/definitions/Port" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "contractNumber": { + "type": "string", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "methodOfPayment": { + "type": "string", + "readOnly": true + }, + "naics": { + "type": "string", + "readOnly": true + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "packingAndShippingInstructions": { + "type": "string", + "readOnly": true + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + }, + "supplyAndServicesCostEstimate": { + "type": "string", + "readOnly": true + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "destinationRateArea": { + "$ref": "#/definitions/RateArea" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "originRateArea": { + "$ref": "#/definitions/RateArea" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "Port": { + "description": "A port that is used to move an international shipment.", + "type": "object", + "properties": { + "city": { + "type": "string", + "example": "PORTLAND" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "pattern": "^[A-Z]{2}$", + "example": "US" + }, + "county": { + "type": "string", + "example": "MULTNOMAH" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "portCode": { + "description": "3 or 4 digit port code", + "type": "string", + "example": "0431" + }, + "portName": { + "description": "Name of the port", + "type": "string", + "example": "PORTLAND INTL" + }, + "portType": { + "description": "Port type A (Air), B (Border Crossing), S (Sea)", + "type": "string", + "enum": [ + "A", + "B", + "S" + ] + }, + "state": { + "description": "US state", + "type": "string", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "example": "OR" + }, + "zip": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "99501" + } + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "RateArea": { + "description": "Rate area info for OCONUS postal code", + "type": "object", + "required": [ + "id", + "rateAreaId", + "rateAreaName" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "rateAreaId": { + "description": "Rate area code", + "type": "string", + "example": "US8101000" + }, + "rateAreaName": { + "description": "Rate area name", + "type": "string", + "example": "Alaska (Zone) I" + } + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DOPSIT", + "DOASIT", + "DOFSIT" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "x-nullable": true, + "example": 4500 + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "x-nullable": true, + "example": 4500 + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "portOfDebarkation": { + "$ref": "#/definitions/Port" + }, + "portOfEmbarkation": { + "$ref": "#/definitions/Port" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "tertiaryDeliveryAddress": { + "description": "A third delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "A third pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.\n", + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "An optional secondary address near the destination where goods will be dropped off.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "An optional secondary Pickup Address near the origin where additional goods exist.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "description": "An optional third address near the destination where goods will be dropped off.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "An optional third Pickup Address near the origin where additional goods exist.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment" + ] + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Prime V3 API is a RESTful API that enables the Prime contractor to request\ninformation about upcoming moves, update the details and status of those moves,\nand make payment requests. It uses Mutual TLS for authentication procedures.\n\nAll endpoints are located at ` + "`" + `/prime/v3/` + "`" + `.\n", + "title": "MilMove Prime V3 API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/prime/v3", + "paths": { + "/move-task-orders/{moveID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "parameters": [ + { + "type": "string", + "description": "UUID or MoveCode of move task order to use........", + "name": "moveID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments": { + "post": { + "description": "Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a\nneed for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must\napprove it before the contractor can proceed with billing.\n\n**NOTE**: When creating a child shipment diversion, you can no longer specify the ` + "`" + `primeActualWeight` + "`" + `.\nIf you create a new diverted shipment with the ` + "`" + `diversion` + "`" + ` and ` + "`" + `divertedFromShipmentId` + "`" + ` parameter, it will automatically\ninherit the primeActualWeight of its ` + "`" + `divertedFromShipmentId` + "`" + ` parent. Payment requests created on a diverted shipment \"chain\" will utilize\nthe lowest weight possible in the chain to prevent overcharging as they are still separate shipments.\n\n**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to\none of their moves. Otherwise, the Prime can fetch the related move using the\n[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status ` + "`" + `\"APPROVED\"` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "createMTOShipment", + "operationId": "createMTOShipment", + "parameters": [ + { + "x-examples": { + "application/json": { + "boat": { + "summary": "Boat Shipment", + "value": { + "boatShipment": { + "hasTrailer": true, + "heightFeet": 2, + "heightInches": 2, + "isRoadworthy": false, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "counselorRemarks": "test", + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "HAUL_AWAY" + } + }, + "hhg": { + "summary": "HHG", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG" + } + }, + "mobileHome": { + "summary": "Mobile Home Shipment", + "value": { + "counselorRemarks": "test", + "mobileHomeShipment": { + "heightFeet": 2, + "heightInches": 2, + "lengthFeet": 2, + "lengthInches": 0, + "make": "make", + "model": "model", + "widthFeet": 2, + "widthInches": 2, + "year": 1999 + }, + "moveTaskOrderID": "d4d95b22-2d9d-428b-9a11-284455aa87ba", + "shipmentType": "MOBILE_HOME" + } + }, + "nts": { + "summary": "NTS", + "value": { + "agents": [ + { + "agentType": "RELEASING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "pickupAddress": { + "city": "Muldraugh", + "postalCode": "40155", + "state": "KY", + "streetAddress1": "204 South Prospect Lane" + }, + "requestedPickupDate": "2022-12-31", + "shipmentType": "HHG_INTO_NTS" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "agents": [ + { + "agentType": "RECEIVING_AGENT", + "email": "edgar.taylor@example.com", + "firstName": "Edgar", + "lastName": "Taylor", + "phone": "555-555-5555" + } + ], + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "shipmentType": "HHG_OUTOF_NTS_DOMESTIC" + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "destinationAddress": { + "city": "NY", + "postalCode": "10001", + "state": "NY", + "streetAddress1": "123 Street" + }, + "estimatedWeight": 4999, + "expectedDepartureDate": "2022-10-01", + "hasProGear": false, + "pickupAddress": { + "city": "Beverly Hills", + "postalCode": "90210", + "state": "CA", + "streetAddress1": "204 South Prospect Lane" + }, + "sitExpected": false + }, + "shipmentType": "PPM" + } + } + } + }, + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/CreateMTOShipment" + } + } + ], + "responses": { + "200": { + "description": "Successfully created a MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-shipments/{mtoShipmentID}": { + "patch": { + "description": "Updates an existing shipment for a move.\n\nNote that there are some restrictions on nested objects:\n\n* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead.\n* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead.\n* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead.\n\nThese restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism.\n\nNote that some fields cannot be manually changed but will still be updated automatically, such as ` + "`" + `primeEstimatedWeightRecordedDate` + "`" + ` and ` + "`" + `requiredDeliveryDate` + "`" + `.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipment", + "operationId": "updateMTOShipment", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + }, + { + "x-examples": { + "application/json": { + "hhg": { + "summary": "HHG", + "value": { + "actualPickupDate": "2022-12-29", + "destinationAddress": { + "city": "Great Bend", + "postalCode": "13643", + "state": "NY", + "streetAddress1": "6622 Airport Way S", + "streetAddress2": "#1430" + }, + "firstAvailableDeliveryDate": "2023-01-04", + "pointOfContact": "peyton.wing@example.com", + "primeActualWeight": 4500, + "primeEstimatedWeight": 4250, + "scheduledPickupDate": "2022-12-30" + } + }, + "nts": { + "summary": "NTS", + "value": { + "actualPickupDate": "2022-12-29", + "actualWeight": 4500, + "counselorRemarks": "Beware of dogs on property", + "estimatedWeight": 4250, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "scheduledPickupDate": "2022-12-30" + } + }, + "nts-r": { + "summary": "NTS Release", + "value": { + "destinationAddress": { + "city": "San Antonio", + "postalCode": "78245", + "state": "TX", + "streetAddress1": "812 S 129th Street" + }, + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ntsRecordedWeight": 4500 + } + }, + "ppm": { + "summary": "PPM", + "value": { + "moveTaskOrderId": "5691c951-c35c-49a8-a1d5-a4b7ea7b7ad8", + "ppmShipment": { + "hasProGear": true, + "proGearWeight": 830, + "sitEstimatedDepartureDate": "2022-10-13", + "sitEstimatedEntryDate": "2022-10-06", + "sitEstimatedWeight": 1760, + "sitExpected": true, + "sitLocation": "DESTINATION", + "spouseProGearWeight": 366 + } + } + } + } + }, + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipment" + } + }, + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully updated the MTO shipment.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "Address": { + "description": "A postal address", + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "destinationGbloc": { + "type": "string", + "pattern": "^[A-Z]{4}$", + "x-nullable": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "BoatShipment": { + "required": [ + "id", + "shipmentId", + "createdAt", + "type", + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer", + "eTag" + ], + "properties": { + "createdAt": { + "description": "Timestamp of when the Boat Shipment was initially created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Boat shipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "type": { + "type": "string", + "enum": [ + "HAUL_AWAY", + "TOW_AWAY" + ] + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + }, + "x-nullable": true + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "CreateBoatShipment": { + "description": "Creation object containing the ` + "`" + `Boat` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches", + "hasTrailer" + ], + "properties": { + "hasTrailer": { + "description": "Does the boat have a trailer", + "type": "boolean" + }, + "heightInInches": { + "description": "Height of the Boat in inches", + "type": "integer" + }, + "isRoadworthy": { + "description": "Is the trailer roadworthy", + "type": "boolean", + "x-nullable": true + }, + "lengthInInches": { + "description": "Length of the Boat in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Boat", + "type": "string" + }, + "model": { + "description": "Model of the Boat", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Boat in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Boat", + "type": "integer" + } + } + }, + "CreateMTOShipment": { + "type": "object", + "required": [ + "moveTaskOrderID", + "shipmentType" + ], + "properties": { + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "boatShipment": { + "$ref": "#/definitions/CreateBoatShipment" + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "example": "handle with care" + }, + "destinationAddress": { + "description": "primary location the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. When this boolean is true, you must link it to a parent shipment with the divertedFromShipmentId parameter.\n", + "type": "boolean" + }, + "divertedFromShipmentId": { + "description": "The ID of the shipment this is a diversion from. Aka the \"Parent\" shipment. The diversion boolean must be true if this parameter is supplied in the request. If provided, and if the diverted from shipment is also a diversion, the previous should must then also have a parent ID.\n", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/CreateMobileHomeShipment" + }, + "moveTaskOrderID": { + "description": "The ID of the move this new shipment is for.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "description": "The primary address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "ppmShipment": { + "$ref": "#/definitions/CreatePPMShipment" + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contractor will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "requestedPickupDate": { + "description": "The customer's preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "second location where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "The second address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "tertiaryDestinationAddress": { + "description": "third location where the movers should deliver this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "The third address where the movers should pick up this shipment.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreateMobileHomeShipment": { + "description": "Creation object containing the ` + "`" + `MobileHome` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "year", + "make", + "model", + "lengthInInches", + "widthInInches", + "heightInInches" + ], + "properties": { + "heightInInches": { + "description": "Height of the Mobile Home in inches", + "type": "integer" + }, + "lengthInInches": { + "description": "Length of the Mobile Home in inches", + "type": "integer" + }, + "make": { + "description": "Make of the Mobile Home", + "type": "string" + }, + "model": { + "description": "Model of the Mobile Home", + "type": "string" + }, + "widthInInches": { + "description": "Width of the Mobile Home in inches", + "type": "integer" + }, + "year": { + "description": "Year of the Mobile Home", + "type": "integer" + } + } + }, + "CreatePPMShipment": { + "description": "Creation object containing the ` + "`" + `PPM` + "`" + ` shipmentType specific data, not used for other shipment types.", + "type": "object", + "required": [ + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "estimatedWeight", + "hasProGear" + ], + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.", + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "An optional secondary address near the destination where goods will be dropped off.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "An optional secondary Pickup Address address near the origin where additional goods exist.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "description": "An optional tertiary address near the destination where goods will be dropped off.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "An optional tertiary Pickup Address address near the origin where additional goods exist.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "CreateSITExtension": { + "description": "CreateSITExtension contains the fields required for the prime to create a SIT Extension request.", + "type": "object", + "required": [ + "requestReason", + "contractorRemarks", + "requestedDays" + ], + "properties": { + "contractorRemarks": { + "type": "string", + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "minimum": 1, + "example": 30 + } + } + }, + "Customer": { + "type": "object", + "properties": { + "branch": { + "type": "string", + "example": "COAST_GUARD" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "example": "fake@example.com" + }, + "emplid": { + "type": "string" + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DestinationType": { + "type": "string", + "title": "Destination Type", + "enum": [ + "HOME_OF_RECORD", + "HOME_OF_SELECTION", + "PLACE_ENTERED_ACTIVE_DUTY", + "OTHER_THAN_AUTHORIZED" + ], + "x-nullable": true, + "example": "OTHER_THAN_AUTHORIZED" + }, + "DutyLocation": { + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "addressID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlements": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "description": "The ID of the agent.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "description": "The ID of the shipment this agent is permitted to release/receive.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "description": "The type for this agent. ` + "`" + `RELEASING` + "`" + ` means they have authority on pickup, ` + "`" + `RECEIVING` + "`" + ` means they can receive the shipment on delivery.\n", + "type": "string", + "title": "Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "description": "A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment.\n", + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "A hash unique to this service item that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "id": { + "description": "The ID of the service item.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lockedPriceCents": { + "type": "integer", + "format": "cents", + "x-nullable": true + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this service item.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "The ID of the shipment this service is for, if any. Optional.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "The full descriptive name of the service.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "The reason why this service item was rejected by the TOO.", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "item was too heavy" + }, + "serviceRequestDocuments": { + "$ref": "#/definitions/ServiceRequestDocuments" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "sitEntryDate", + "reason" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary1` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to ` + "`" + `timeMilitary2` + "`" + `.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "reason": { + "description": "The reason item has been placed in SIT.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "The dimensions for either the item or the crate associated with a crating service item.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT).", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemInternationalCrating": { + "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "description": "The dimensions for the crate the item will be shipped in.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "description": { + "description": "A description of the item being crated.", + "type": "string", + "example": "Decorated horse head to be crated." + }, + "externalCrate": { + "type": "boolean", + "x-nullable": true + }, + "item": { + "description": "The dimensions of the item being crated.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItemDimension" + } + ] + }, + "market": { + "description": "To identify whether the service was provided within (CONUS) or (OCONUS)", + "type": "string", + "enum": [ + "CONUS", + "OCONUS" + ], + "example": "CONUS" + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT).", + "type": "string", + "enum": [ + "ICRT", + "IUCRT" + ] + }, + "reason": { + "description": "The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "Storage items need to be picked up" + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating", + "MTOSerivceItemInternationalFuelSurcharge" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "requestApprovalsRequestedStatus": { + "type": "boolean" + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitHHGActualOrigin": { + "$ref": "#/definitions/Address" + }, + "sitHHGOriginalOrigin": { + "$ref": "#/definitions/Address" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "The status of a service item, indicating where it is in the TOO's approval process.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ], + "readOnly": true + }, + "MTOShipment": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + ], + "properties": { + "mtoServiceItems": { + "description": "A list of service items connected to this shipment.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + }, + "readOnly": true + } + } + }, + "MTOShipmentType": { + "description": "The type of shipment.\n * ` + "`" + `HHG` + "`" + ` = Household goods move\n * ` + "`" + `HHG_INTO_NTS` + "`" + ` = HHG into Non-temporary storage (NTS)\n * ` + "`" + `HHG_OUTOF_NTS_DOMESTIC` + "`" + ` = HHG out of Non-temporary storage (NTS Release)\n * ` + "`" + `PPM` + "`" + ` = Personally Procured Move also known as Do It Yourself (DITY)\n * ` + "`" + `BOAT_HAUL_AWAY` + "`" + ` = Boat shipment that requires additional equipment to haul it to it's destination\n * ` + "`" + `BOAT_TOW_AWAY` + "`" + ` = Boat shipment that has a road-worthy trailer\n * ` + "`" + `MOBILE_HOME` + "`" + ` = Mobile Home shipment that a customer may move.\n", + "type": "string", + "title": "Shipment Type", + "enum": [ + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "MOBILE_HOME", + "PPM", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat shipment that requires additional equipment to haul it to it's destination", + "BOAT_TOW_AWAY": "Boat shipment that has a road-worthy trailer", + "HHG": "Household goods move (HHG)", + "HHG_INTO_NTS": "HHG into Non-temporary storage (NTS)", + "HHG_OUTOF_NTS_DOMESTIC": "HHG out of Non-temporary storage (NTS Release)", + "PPM": "Personally Procured Move also known as Do It Yourself (DITY)", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipmentWithoutServiceItems": { + "type": "object", + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any spouse pro gear being shipped.\n", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "The date when the Task Ordering Officer first approved this shipment for the move.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "boatShipment": { + "$ref": "#/definitions/BoatShipment" + }, + "counselorRemarks": { + "description": "The counselor can use the counselor remarks field to inform the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCounselors enters this information when creating or editing an MTO Shipment. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "description": "The customer can use the customer remarks field to inform the services counselor and the movers about any\nspecial circumstances for this shipment. Typical examples:\n * bulky or fragile items,\n * weapons,\n * access info for their address.\n\nCustomer enters this information during onboarding. Optional field.\n", + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "deliveryAddressUpdate": { + "$ref": "#/definitions/ShipmentAddressUpdate" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationRateArea": { + "$ref": "#/definitions/RateArea" + }, + "destinationSitAuthEndDate": { + "description": "The SIT authorized end date for destination SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "diversionReason": { + "description": "The reason the TOO provided when requesting a diversion for this shipment.\n", + "type": "string", + "x-nullable": true, + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The ID of the shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "mobileHomeShipment": { + "$ref": "#/definitions/MobileHome" + }, + "moveTaskOrderID": { + "description": "The ID of the move for this shipment.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "originRateArea": { + "$ref": "#/definitions/RateArea" + }, + "originSitAuthEndDate": { + "description": "The SIT authorized end date for origin SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "portOfDebarkation": { + "$ref": "#/definitions/Port" + }, + "portOfEmbarkation": { + "$ref": "#/definitions/Port" + }, + "ppmShipment": { + "$ref": "#/definitions/PPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "description": "The date when the Prime contractor recorded the shipment's estimated weight.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedDeliveryDate": { + "description": "The customer's preferred delivery date.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requestedPickupDate": { + "description": "The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "requiredDeliveryDate": { + "description": "The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "reweigh": { + "$ref": "#/definitions/Reweigh" + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "sitExtensions": { + "$ref": "#/definitions/SITExtensions" + }, + "status": { + "description": "The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances.\n", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentsWithoutServiceObjects": { + "description": "A list of shipments without their associated service items.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipmentWithoutServiceItems" + } + }, + "MobileHome": { + "description": "A mobile home is a type of shipment that a service member moves a mobile home.", + "properties": { + "createdAt": { + "description": "Timestamp of when a property of this object was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "heightInInches": { + "type": "integer" + }, + "id": { + "description": "Primary auto-generated unique identifier of the Mobile Home object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lengthInInches": { + "type": "integer" + }, + "make": { + "description": "The make of the mobile home", + "type": "string" + }, + "model": { + "description": "The model of the mobile home.", + "type": "string" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment object", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "description": "Timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "widthInInches": { + "type": "integer" + }, + "year": { + "description": "The year the mobile home was made.", + "type": "integer" + } + }, + "x-nullable": true + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "mtoShipments", + "mtoServiceItems", + "paymentRequests" + ], + "properties": { + "approvedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "availableToPrimeAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "contractNumber": { + "type": "string", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationGBLOC": { + "type": "string", + "readOnly": true, + "example": "KKFA" + }, + "destinationPostalCode": { + "type": "string", + "readOnly": true, + "example": "90210" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "excessWeightAcknowledgedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightQualifiedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "excessWeightUploadId": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "x-omitempty": false, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "a502b4f1-b9c4-4faf-8bdd-68292501bf26" + }, + "moveCode": { + "type": "string", + "readOnly": true, + "example": "HYXFJF" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipmentsWithoutServiceObjects" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "type": "integer" + }, + "ppmType": { + "type": "string", + "enum": [ + "PARTIAL", + "FULL" + ] + }, + "primeCounselingCompletedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "referenceId": { + "type": "string", + "example": "1001-3456" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "rank", + "linesOfAccounting" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlements" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "linesOfAccounting": { + "type": "string" + }, + "methodOfPayment": { + "type": "string", + "readOnly": true + }, + "naics": { + "type": "string", + "readOnly": true + }, + "orderNumber": { + "type": "string" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationGBLOC": { + "type": "string", + "example": "KKFA" + }, + "packingAndShippingInstructions": { + "type": "string", + "readOnly": true + }, + "rank": { + "type": "string", + "example": "E_5" + }, + "reportByDate": { + "type": "string", + "format": "date" + }, + "supplyAndServicesCostEstimate": { + "type": "string", + "readOnly": true + } + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "WOUNDED_WARRIOR", + "BLUEBARK", + "SAFETY", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "LOCAL_MOVE": "Local Move", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station", + "RETIREMENT": "Retirement", + "SAFETY": "Safety", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "PPMDestinationAddress": { + "description": "A postal address", + "type": "object", + "required": [ + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "type": "string", + "title": "Country", + "default": "USA", + "x-nullable": true, + "example": "USA" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "x-nullable": true, + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + }, + "usPostRegionCitiesID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PPMShipment": { + "description": "A personally procured move is a type of shipment that a service member moves themselves.", + "required": [ + "id", + "shipmentId", + "createdAt", + "status", + "expectedDepartureDate", + "pickupAddress", + "destinationAddress", + "sitExpected", + "eTag" + ], + "properties": { + "actualDestinationPostalCode": { + "description": "The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "actualMoveDate": { + "description": "The actual start date of when the PPM shipment left the origin.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupPostalCode": { + "description": "The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment.\n", + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5})$", + "x-nullable": true, + "x-omitempty": false, + "example": "90210" + }, + "advanceAmountReceived": { + "description": "The amount received for an advance, or null if no advance is received.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "advanceAmountRequested": { + "description": "The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive.\n", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "approvedAt": { + "description": "The timestamp of when the shipment was approved and the service member can begin their move.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "createdAt": { + "description": "The timestamp of when the PPM shipment was created (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "destinationAddress": { + "$ref": "#/definitions/PPMDestinationAddress" + }, + "destinationRateArea": { + "$ref": "#/definitions/RateArea" + }, + "eTag": { + "description": "A hash unique to this shipment that should be used as the \"If-Match\" header for any updates.", + "type": "string", + "readOnly": true + }, + "estimatedIncentive": { + "description": "The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date" + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasReceivedAdvance": { + "description": "Indicates whether an advance was received for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasRequestedAdvance": { + "description": "Indicates whether an advance has been requested for the PPM shipment.\n", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "id": { + "description": "The primary unique identifier of this PPM shipment", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "maxIncentive": { + "description": "The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "originRateArea": { + "$ref": "#/definitions/RateArea" + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "reviewedAt": { + "description": "The timestamp of when the Service Counselor has reviewed all of the closeout documents.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentId": { + "description": "The id of the parent MTOShipment record", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "sitEstimatedCost": { + "description": "The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive.", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean" + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + }, + { + "x-omitempty": false + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse in pounds.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false + }, + "status": { + "$ref": "#/definitions/PPMShipmentStatus" + }, + "submittedAt": { + "description": "The timestamp of when the customer submitted their PPM documentation to the counselor for review.", + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "tertiaryDestinationAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "description": "The timestamp of when a property of this object was last updated (UTC)", + "type": "string", + "format": "date-time", + "readOnly": true + } + }, + "x-nullable": true + }, + "PPMShipmentStatus": { + "description": "Status of the PPM Shipment:\n * **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling.\n * **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move.\n * **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid.\n * **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government.\n * **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject.\n * **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet.\n", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "WAITING_ON_CUSTOMER", + "NEEDS_ADVANCE_APPROVAL", + "NEEDS_CLOSEOUT", + "CLOSEOUT_COMPLETE", + "CANCELED" + ], + "readOnly": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "paymentServiceItems": { + "$ref": "#/definitions/PaymentServiceItems" + }, + "proofOfServiceDocs": { + "$ref": "#/definitions/ProofOfServiceDocs" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "PaymentServiceItem": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "mtoServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentServiceItemParams": { + "$ref": "#/definitions/PaymentServiceItemParams" + }, + "priceCents": { + "type": "integer", + "format": "cents", + "title": "Price of the service item in cents", + "x-nullable": true + }, + "referenceID": { + "format": "string", + "readOnly": true, + "example": "1234-5678-c56a4180" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentServiceItemStatus" + } + } + }, + "PaymentServiceItemParam": { + "type": "object", + "properties": { + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "key": { + "$ref": "#/definitions/ServiceItemParamName" + }, + "origin": { + "$ref": "#/definitions/ServiceItemParamOrigin" + }, + "paymentServiceItemID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "type": { + "$ref": "#/definitions/ServiceItemParamType" + }, + "value": { + "type": "string", + "example": "3025" + } + } + }, + "PaymentServiceItemParams": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItemParam" + } + }, + "PaymentServiceItemStatus": { + "type": "string", + "title": "Payment Service Item Status", + "enum": [ + "REQUESTED", + "APPROVED", + "DENIED", + "SENT_TO_GEX", + "PAID", + "EDI_ERROR" + ] + }, + "PaymentServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentServiceItem" + } + }, + "Port": { + "description": "A port that is used to move an international shipment.", + "type": "object", + "properties": { + "city": { + "type": "string", + "example": "PORTLAND" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "pattern": "^[A-Z]{2}$", + "example": "US" + }, + "county": { + "type": "string", + "example": "MULTNOMAH" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "portCode": { + "description": "3 or 4 digit port code", + "type": "string", + "example": "0431" + }, + "portName": { + "description": "Name of the port", + "type": "string", + "example": "PORTLAND INTL" + }, + "portType": { + "description": "Port type A (Air), B (Border Crossing), S (Sea)", + "type": "string", + "enum": [ + "A", + "B", + "S" + ] + }, + "state": { + "description": "US state", + "type": "string", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "example": "OR" + }, + "zip": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "99501" + } + } + }, + "ProofOfServiceDoc": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ProofOfServiceDocs": { + "type": "array", + "items": { + "$ref": "#/definitions/ProofOfServiceDoc" + } + }, + "RateArea": { + "description": "Rate area info for OCONUS postal code", + "type": "object", + "required": [ + "id", + "rateAreaId", + "rateAreaName" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "rateAreaId": { + "description": "Rate area code", + "type": "string", + "example": "US8101000" + }, + "rateAreaName": { + "description": "Rate area name", + "type": "string", + "example": "Alaska (Zone) I" + } + } + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "Reweigh": { + "description": "A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO.", + "properties": { + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "requestedAt": { + "type": "string", + "format": "date-time" + }, + "requestedBy": { + "$ref": "#/definitions/ReweighRequester" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "verificationProvidedAt": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "verificationReason": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed due to some justification provided by the Prime" + }, + "weight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "ReweighRequester": { + "type": "string", + "enum": [ + "CUSTOMER", + "PRIME", + "SYSTEM", + "TOO" + ] + }, + "SITExtension": { + "description": "A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT.", + "type": "object", + "properties": { + "approvedDays": { + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 30 + }, + "contractorRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "We need SIT additional days. The customer has not found a house yet." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "decisionDate": { + "type": "string", + "format": "date-time", + "x-nullable": true, + "x-omitempty": false + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "officeRemarks": { + "type": "string", + "x-nullable": true, + "x-omitempty": false + }, + "requestReason": { + "type": "string", + "enum": [ + "SERIOUS_ILLNESS_MEMBER", + "SERIOUS_ILLNESS_DEPENDENT", + "IMPENDING_ASSIGNEMENT", + "DIRECTED_TEMPORARY_DUTY", + "NONAVAILABILITY_OF_CIVILIAN_HOUSING", + "AWAITING_COMPLETION_OF_RESIDENCE", + "OTHER" + ] + }, + "requestedDays": { + "type": "integer", + "example": 30 + }, + "status": { + "enum": [ + "PENDING", + "APPROVED", + "DENIED" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "SITExtensions": { + "type": "array", + "items": { + "$ref": "#/definitions/SITExtension" + } + }, + "SITLocationType": { + "description": "The list of SIT location types.", + "type": "string", + "enum": [ + "ORIGIN", + "DESTINATION" + ] + }, + "ServiceItemParamName": { + "type": "string", + "enum": [ + "ActualPickupDate", + "ContractCode", + "ContractYearName", + "CubicFeetBilled", + "CubicFeetCrating", + "DimensionHeight", + "DimensionLength", + "DimensionWidth", + "DistanceZip", + "DistanceZipSITDest", + "DistanceZipSITOrigin", + "EIAFuelPrice", + "EscalationCompounded", + "FSCMultiplier", + "FSCPriceDifferenceInCents", + "FSCWeightBasedDistanceMultiplier", + "IsPeak", + "MarketDest", + "MarketOrigin", + "MTOAvailableToPrimeAt", + "NTSPackingFactor", + "NumberDaysSIT", + "PriceAreaDest", + "PriceAreaIntlDest", + "PriceAreaIntlOrigin", + "PriceAreaOrigin", + "PriceRateOrFactor", + "PSI_LinehaulDom", + "PSI_LinehaulDomPrice", + "PSI_LinehaulShort", + "PSI_LinehaulShortPrice", + "PSI_PriceDomDest", + "PSI_PriceDomDestPrice", + "PSI_PriceDomOrigin", + "PSI_PriceDomOriginPrice", + "PSI_ShippingLinehaulIntlCO", + "PSI_ShippingLinehaulIntlCOPrice", + "PSI_ShippingLinehaulIntlOC", + "PSI_ShippingLinehaulIntlOCPrice", + "PSI_ShippingLinehaulIntlOO", + "PSI_ShippingLinehaulIntlOOPrice", + "RateAreaNonStdDest", + "RateAreaNonStdOrigin", + "ReferenceDate", + "RequestedPickupDate", + "ServiceAreaDest", + "ServiceAreaOrigin", + "ServicesScheduleDest", + "ServicesScheduleOrigin", + "SITPaymentRequestEnd", + "SITPaymentRequestStart", + "SITScheduleDest", + "SITScheduleOrigin", + "SITServiceAreaDest", + "SITServiceAreaOrigin", + "WeightAdjusted", + "WeightBilled", + "WeightEstimated", + "WeightOriginal", + "WeightReweigh", + "ZipDestAddress", + "ZipPickupAddress", + "ZipSITDestHHGFinalAddress", + "ZipSITDestHHGOriginalAddress", + "ZipSITOriginHHGActualAddress", + "ZipSITOriginHHGOriginalAddress", + "StandaloneCrate", + "StandaloneCrateCap", + "UncappedRequestTotal", + "LockedPriceCents" + ] + }, + "ServiceItemParamOrigin": { + "type": "string", + "enum": [ + "PRIME", + "SYSTEM", + "PRICER", + "PAYMENT_REQUEST" + ] + }, + "ServiceItemParamType": { + "type": "string", + "enum": [ + "STRING", + "DATE", + "INTEGER", + "DECIMAL", + "TIMESTAMP", + "PaymentServiceItemUUID", + "BOOLEAN" + ] + }, + "ServiceRequestDocument": { + "type": "object", + "properties": { + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "ServiceRequestDocuments": { + "type": "array", + "items": { + "$ref": "#/definitions/ServiceRequestDocument" + } + }, + "ShipmentAddressUpdate": { + "description": "This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO.\n", + "type": "object", + "required": [ + "id", + "status", + "shipmentID", + "originalAddress", + "newAddress", + "contractorRemarks" + ], + "properties": { + "contractorRemarks": { + "description": "The reason there is an address change.", + "type": "string", + "title": "Contractor Remarks", + "readOnly": true, + "example": "This is a contractor remark" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "newAddress": { + "$ref": "#/definitions/Address" + }, + "newSitDistanceBetween": { + "description": "The distance between the original SIT address and requested new delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 88 + }, + "officeRemarks": { + "description": "The TOO comment on approval or rejection.", + "type": "string", + "title": "Office Remarks", + "x-nullable": true, + "example": "This is an office remark" + }, + "oldSitDistanceBetween": { + "description": "The distance between the original SIT address and the previous/old delivery address of shipment", + "type": "integer", + "minimum": 0, + "example": 50 + }, + "originalAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "sitOriginalAddress": { + "$ref": "#/definitions/Address" + }, + "status": { + "$ref": "#/definitions/ShipmentAddressUpdateStatus" + } + } + }, + "ShipmentAddressUpdateStatus": { + "type": "string", + "title": "Status", + "enum": [ + "REQUESTED", + "REJECTED", + "APPROVED" + ], + "x-display-value": { + "APPROVED": "APPROVED", + "REJECTED": "REJECTED", + "REQUESTED": "REQUESTED" + }, + "readOnly": true + }, + "StorageFacility": { + "description": "The Storage Facility information for the shipment", + "type": "object", + "properties": { + "address": { + "$ref": "#/definitions/Address" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "facilityName": { + "type": "string" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lotNumber": { + "type": "string", + "x-nullable": true + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + } + } + }, + "UpdateMTOServiceItem": { + "description": "UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType" + ], + "properties": { + "id": { + "description": "ID of the service item. Must match path.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/UpdateMTOServiceItemModelType" + } + }, + "discriminator": "modelType" + }, + "UpdateMTOServiceItemModelType": { + "description": "Using this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DDDSIT - UpdateMTOServiceItemSIT\n * DOPSIT - UpdateMTOServiceItemSIT\n * DOASIT - UpdateMTOServiceItemSIT\n * DOFSIT - UpdateMTOServiceItemSIT\n * DDSHUT - UpdateMTOServiceItemShuttle\n * DOSHUT - UpdateMTOServiceItemShuttle\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "UpdateMTOServiceItemSIT", + "UpdateMTOServiceItemShuttle" + ] + }, + "UpdateMTOServiceItemSIT": { + "description": "Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDDSIT", + "DOPSIT", + "DOASIT", + "DOFSIT" + ] + }, + "requestApprovalsRequestedStatus": { + "description": "Indicates if \"Approvals Requested\" status is being requested.", + "type": "boolean", + "x-nullable": true + }, + "sitCustomerContacted": { + "description": "Date when the customer contacted the prime for a delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination.", + "type": "string", + "format": "date" + }, + "sitDestinationFinalAddress": { + "$ref": "#/definitions/Address" + }, + "sitEntryDate": { + "description": "Entry date for the SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "x-nullable": true, + "example": "90210" + }, + "sitRequestedDelivery": { + "description": "Date when the customer has requested delivery out of SIT.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "timeMilitary1": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "x-nullable": true, + "example": "1400Z" + }, + "updateReason": { + "description": "Reason for updating service item.", + "type": "string", + "x-nullable": true + } + } + } + ] + }, + "UpdateMTOServiceItemShuttle": { + "description": "Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item.\n", + "allOf": [ + { + "$ref": "#/definitions/UpdateMTOServiceItem" + }, + { + "type": "object", + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDSHUT", + "DOSHUT" + ] + } + } + } + ] + }, + "UpdateMTOShipment": { + "properties": { + "actualDeliveryDate": { + "description": "The date when the Prime contractor actually delivered the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualPickupDate": { + "description": "The date when the Prime contractor actually picked up the shipment. Updated after-the-fact.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "actualProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "x-nullable": true, + "example": 4500 + }, + "actualSpouseProGearWeight": { + "description": "The actual weight of any pro gear shipped during a move.", + "type": "integer", + "x-nullable": true, + "example": 4500 + }, + "counselorRemarks": { + "type": "string", + "x-nullable": true, + "example": "counselor approved" + }, + "destinationAddress": { + "description": "Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details\nduring onboarding, if they know their new address already.\n\nMay be blank when entered by the customer, required when entered by the Prime. May not represent the true\nfinal destination due to the shipment being diverted or placed in SIT.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "destinationType": { + "$ref": "#/definitions/DestinationType" + }, + "diversion": { + "description": "This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion.\n", + "type": "boolean" + }, + "firstAvailableDeliveryDate": { + "description": "The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly.\n", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "ntsRecordedWeight": { + "description": "The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was.", + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 4500 + }, + "pickupAddress": { + "description": "The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "pointOfContact": { + "description": "Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor.\n", + "type": "string" + }, + "portOfDebarkation": { + "$ref": "#/definitions/Port" + }, + "portOfEmbarkation": { + "$ref": "#/definitions/Port" + }, + "ppmShipment": { + "$ref": "#/definitions/UpdatePPMShipment" + }, + "primeActualWeight": { + "description": "The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment.", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "primeEstimatedWeight": { + "description": "The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it.\n", + "type": "integer", + "minimum": 1, + "x-nullable": true, + "example": 4500 + }, + "scheduledDeliveryDate": { + "description": "The date the Prime contractor scheduled to deliver this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "scheduledPickupDate": { + "description": "The date the Prime contractor scheduled to pick up this shipment after consultation with the customer.", + "type": "string", + "format": "date", + "x-nullable": true, + "x-omitempty": false + }, + "secondaryDeliveryAddress": { + "description": "A second delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "A second pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "storageFacility": { + "allOf": [ + { + "x-nullable": true + }, + { + "$ref": "#/definitions/StorageFacility" + } + ] + }, + "tertiaryDeliveryAddress": { + "description": "A third delivery address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "A third pickup address for this shipment, if the customer entered one. An optional field.", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "UpdateMTOShipmentStatus": { + "description": "Contains the statuses available to the Prime when updating the state of a shipment.", + "type": "object", + "properties": { + "status": { + "type": "string", + "enum": [ + "CANCELED" + ] + } + } + }, + "UpdatePPMShipment": { + "description": "The PPM specific fields of the shipment with values being changed", + "type": "object", + "properties": { + "destinationAddress": { + "description": "The address of the destination location where goods are being delivered to.\n", + "allOf": [ + { + "$ref": "#/definitions/PPMDestinationAddress" + } + ] + }, + "estimatedWeight": { + "description": "The estimated weight of the PPM shipment goods being moved.", + "type": "integer", + "x-nullable": true, + "example": 4200 + }, + "expectedDepartureDate": { + "description": "Date the customer expects to begin moving from their origin.\n", + "type": "string", + "format": "date", + "x-nullable": true + }, + "hasProGear": { + "description": "Indicates whether PPM shipment has pro gear for themselves or their spouse.\n", + "type": "boolean", + "x-nullable": true + }, + "hasSecondaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasSecondaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryDestinationAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "hasTertiaryPickupAddress": { + "type": "boolean", + "x-nullable": true, + "x-omitempty": false + }, + "isActualExpenseReimbursement": { + "description": "Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method.", + "type": "boolean", + "x-nullable": true, + "x-omitempty": false, + "example": false + }, + "pickupAddress": { + "description": "The address of the origin location where goods are being moved from.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "proGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to the service member.", + "type": "integer", + "x-nullable": true + }, + "secondaryDestinationAddress": { + "description": "An optional secondary address near the destination where goods will be dropped off.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "secondaryPickupAddress": { + "description": "An optional secondary Pickup Address near the origin where additional goods exist.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "sitEstimatedDepartureDate": { + "description": "The date that goods will exit the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedEntryDate": { + "description": "The date that goods will first enter the storage location.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEstimatedWeight": { + "description": "The estimated weight of the goods being put into storage.", + "type": "integer", + "x-nullable": true, + "example": 2000 + }, + "sitExpected": { + "description": "Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination.\n\nMust be set to ` + "`" + `true` + "`" + ` when providing ` + "`" + `sitLocation` + "`" + `, ` + "`" + `sitEstimatedWeight` + "`" + `, ` + "`" + `sitEstimatedEntryDate` + "`" + `, and ` + "`" + `sitEstimatedDepartureDate` + "`" + ` values to calculate the ` + "`" + `sitEstimatedCost` + "`" + `.\n", + "type": "boolean", + "x-nullable": true + }, + "sitLocation": { + "allOf": [ + { + "$ref": "#/definitions/SITLocationType" + }, + { + "x-nullable": true + } + ] + }, + "spouseProGearWeight": { + "description": "The estimated weight of the pro-gear being moved belonging to a spouse.", + "type": "integer", + "x-nullable": true + }, + "tertiaryDestinationAddress": { + "description": "An optional third address near the destination where goods will be dropped off.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + }, + "tertiaryPickupAddress": { + "description": "An optional third Pickup Address near the origin where additional goods exist.\n", + "allOf": [ + { + "$ref": "#/definitions/Address" + } + ] + } + } + }, + "UpdateReweigh": { + "description": "Contains the fields available to the Prime when updating a reweigh record.", + "type": "object", + "properties": { + "verificationReason": { + "description": "In lieu of a document being uploaded indicating why a reweigh did not occur.", + "type": "string", + "x-nullable": true, + "x-omitempty": false, + "example": "The reweigh was not performed because the shipment was already delivered" + }, + "weight": { + "description": "The total reweighed weight for the shipment in pounds.", + "type": "integer", + "minimum": 1, + "x-formatting": "weight", + "x-nullable": true, + "x-omitempty": false, + "example": 2000 + } + } + }, + "UpdateShipmentDestinationAddress": { + "description": "UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment.", + "type": "object", + "required": [ + "contractorRemarks", + "newAddress" + ], + "properties": { + "contractorRemarks": { + "description": "This is the remark the Prime has entered, which would be the reason there is an address change.", + "type": "string", + "example": "Customer reached out to me this week and let me know they want to move somewhere else." + }, + "newAddress": { + "$ref": "#/definitions/Address" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The request was unprocessable, likely due to bad input from the requester.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "description": "A shipment is some (or all) of a customer's belongings picked up in one location and delivered to another location.\nAll of the items in a shipment are weighed and transported as a discrete unit. One move may include multiple shipments.\nAn **mtoShipment**, in particular, is a shipment that belongs to a [moveTaskOrder](#tag/moveTaskOrder).\n\nThe weights for all of the shipments in a move are combined and compared to the customer's weight allowance.\nIf the sum of the shipments is greater, the customer is liable for paying excess weight cost. Both the customer and\nthe contractor should keep this potential cost in mind when planning a move and the shipments within it.\n", + "name": "mtoShipment" + } + ], + "x-tagGroups": [ + { + "name": "Endpoints", + "tags": [ + "moveTaskOrder", + "mtoShipment" + ] + } + ] +}`)) +} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go new file mode 100644 index 00000000000..d02fb4d0c9d --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler +type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// GetMoveTaskOrderHandler interface for that can handle valid get move task order params +type GetMoveTaskOrderHandler interface { + Handle(GetMoveTaskOrderParams) middleware.Responder +} + +// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation +func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { + return &GetMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + GetMoveTaskOrder swagger:route GET /move-task-orders/{moveID} moveTaskOrder getMoveTaskOrder + +getMoveTaskOrder + +### Functionality +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +type GetMoveTaskOrder struct { + Context *middleware.Context + Handler GetMoveTaskOrderHandler +} + +func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..a7c4913dc67 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { + + return GetMoveTaskOrderParams{} +} + +// GetMoveTaskOrderParams contains all the bound params for the get move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveTaskOrder +type GetMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID or MoveCode of move task order to use........ + Required: true + In: path + */ + MoveID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. +func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveID, rhkMoveID, _ := route.Params.GetOK("moveID") + if err := o.bindMoveID(rMoveID, rhkMoveID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveID binds and validates parameter MoveID from path. +func (o *GetMoveTaskOrderParams) bindMoveID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveID = raw + + return nil +} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..9ec16dc1e22 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK +const GetMoveTaskOrderOKCode int = 200 + +/* +GetMoveTaskOrderOK Successfully retrieve an individual move task order. + +swagger:response getMoveTaskOrderOK +*/ +type GetMoveTaskOrderOK struct { + + /* + In: Body + */ + Payload *primev3messages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + + return &GetMoveTaskOrderOK{} +} + +// WithPayload adds the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) WithPayload(payload *primev3messages.MoveTaskOrder) *GetMoveTaskOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) SetPayload(payload *primev3messages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized +const GetMoveTaskOrderUnauthorizedCode int = 401 + +/* +GetMoveTaskOrderUnauthorized The request was denied. + +swagger:response getMoveTaskOrderUnauthorized +*/ +type GetMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + + return &GetMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden +const GetMoveTaskOrderForbiddenCode int = 403 + +/* +GetMoveTaskOrderForbidden The request was denied. + +swagger:response getMoveTaskOrderForbidden +*/ +type GetMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + + return &GetMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound +const GetMoveTaskOrderNotFoundCode int = 404 + +/* +GetMoveTaskOrderNotFound The requested resource wasn't found. + +swagger:response getMoveTaskOrderNotFound +*/ +type GetMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + + return &GetMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) WithPayload(payload *primev3messages.ClientError) *GetMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError +const GetMoveTaskOrderInternalServerErrorCode int = 500 + +/* +GetMoveTaskOrderInternalServerError A server error occurred. + +swagger:response getMoveTaskOrderInternalServerError +*/ +type GetMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *primev3messages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + + return &GetMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *primev3messages.Error) *GetMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *primev3messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..45f557a2dd7 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/move_task_order/get_move_task_order_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveTaskOrderURL generates an URL for the get move task order operation +type GetMoveTaskOrderURL struct { + MoveID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveID}" + + moveID := o.MoveID + if moveID != "" { + _path = strings.Replace(_path, "{moveID}", moveID, -1) + } else { + return nil, errors.New("moveId is required on GetMoveTaskOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v3" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go new file mode 100644 index 00000000000..54ce5c4cc60 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment.go @@ -0,0 +1,69 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMTOShipmentHandlerFunc turns a function with the right signature into a create m t o shipment handler +type CreateMTOShipmentHandlerFunc func(CreateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMTOShipmentHandlerFunc) Handle(params CreateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// CreateMTOShipmentHandler interface for that can handle valid create m t o shipment params +type CreateMTOShipmentHandler interface { + Handle(CreateMTOShipmentParams) middleware.Responder +} + +// NewCreateMTOShipment creates a new http.Handler for the create m t o shipment operation +func NewCreateMTOShipment(ctx *middleware.Context, handler CreateMTOShipmentHandler) *CreateMTOShipment { + return &CreateMTOShipment{Context: ctx, Handler: handler} +} + +/* + CreateMTOShipment swagger:route POST /mto-shipments mtoShipment createMTOShipment + +createMTOShipment + +Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a +need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must +approve it before the contractor can proceed with billing. + +**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. +If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically +inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize +the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. + +**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to +one of their moves. Otherwise, the Prime can fetch the related move using the +[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. +*/ +type CreateMTOShipment struct { + Context *middleware.Context + Handler CreateMTOShipmentHandler +} + +func (o *CreateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..010bf69a479 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewCreateMTOShipmentParams() CreateMTOShipmentParams { + + return CreateMTOShipmentParams{} +} + +// CreateMTOShipmentParams contains all the bound params for the create m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMTOShipment +type CreateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + In: body + */ + Body *primev3messages.CreateMTOShipment +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMTOShipmentParams() beforehand. +func (o *CreateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primev3messages.CreateMTOShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..89ae328d45d --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// CreateMTOShipmentOKCode is the HTTP code returned for type CreateMTOShipmentOK +const CreateMTOShipmentOKCode int = 200 + +/* +CreateMTOShipmentOK Successfully created a MTO shipment. + +swagger:response createMTOShipmentOK +*/ +type CreateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *primev3messages.MTOShipment `json:"body,omitempty"` +} + +// NewCreateMTOShipmentOK creates CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + + return &CreateMTOShipmentOK{} +} + +// WithPayload adds the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) WithPayload(payload *primev3messages.MTOShipment) *CreateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment o k response +func (o *CreateMTOShipmentOK) SetPayload(payload *primev3messages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentBadRequestCode is the HTTP code returned for type CreateMTOShipmentBadRequest +const CreateMTOShipmentBadRequestCode int = 400 + +/* +CreateMTOShipmentBadRequest The request payload is invalid. + +swagger:response createMTOShipmentBadRequest +*/ +type CreateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentBadRequest creates CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + + return &CreateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) WithPayload(payload *primev3messages.ClientError) *CreateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentNotFoundCode is the HTTP code returned for type CreateMTOShipmentNotFound +const CreateMTOShipmentNotFoundCode int = 404 + +/* +CreateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response createMTOShipmentNotFound +*/ +type CreateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentNotFound creates CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + + return &CreateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) WithPayload(payload *primev3messages.ClientError) *CreateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type CreateMTOShipmentUnprocessableEntity +const CreateMTOShipmentUnprocessableEntityCode int = 422 + +/* +CreateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response createMTOShipmentUnprocessableEntity +*/ +type CreateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primev3messages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMTOShipmentUnprocessableEntity creates CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + + return &CreateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) WithPayload(payload *primev3messages.ValidationError) *CreateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) SetPayload(payload *primev3messages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMTOShipmentInternalServerErrorCode is the HTTP code returned for type CreateMTOShipmentInternalServerError +const CreateMTOShipmentInternalServerErrorCode int = 500 + +/* +CreateMTOShipmentInternalServerError A server error occurred. + +swagger:response createMTOShipmentInternalServerError +*/ +type CreateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *primev3messages.Error `json:"body,omitempty"` +} + +// NewCreateMTOShipmentInternalServerError creates CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + + return &CreateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) WithPayload(payload *primev3messages.Error) *CreateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) SetPayload(payload *primev3messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..08004139c96 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/create_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMTOShipmentURL generates an URL for the create m t o shipment operation +type CreateMTOShipmentURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) WithBasePath(bp string) *CreateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v3" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go new file mode 100644 index 00000000000..f1effe18a55 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment.go @@ -0,0 +1,68 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentHandlerFunc turns a function with the right signature into a update m t o shipment handler +type UpdateMTOShipmentHandlerFunc func(UpdateMTOShipmentParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentHandlerFunc) Handle(params UpdateMTOShipmentParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentHandler interface for that can handle valid update m t o shipment params +type UpdateMTOShipmentHandler interface { + Handle(UpdateMTOShipmentParams) middleware.Responder +} + +// NewUpdateMTOShipment creates a new http.Handler for the update m t o shipment operation +func NewUpdateMTOShipment(ctx *middleware.Context, handler UpdateMTOShipmentHandler) *UpdateMTOShipment { + return &UpdateMTOShipment{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipment swagger:route PATCH /mto-shipments/{mtoShipmentID} mtoShipment updateMTOShipment + +updateMTOShipment + +Updates an existing shipment for a move. + +Note that there are some restrictions on nested objects: + +* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. +* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. +* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. + +These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. + +Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. +*/ +type UpdateMTOShipment struct { + Context *middleware.Context + Handler UpdateMTOShipmentHandler +} + +func (o *UpdateMTOShipment) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..ac437fff00f --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentParams() UpdateMTOShipmentParams { + + return UpdateMTOShipmentParams{} +} + +// UpdateMTOShipmentParams contains all the bound params for the update m t o shipment operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipment +type UpdateMTOShipmentParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *primev3messages.UpdateMTOShipment + /*UUID of the shipment being updated. + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentParams() beforehand. +func (o *UpdateMTOShipmentParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body primev3messages.UpdateMTOShipment + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..9f2a9bd8fe7 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// UpdateMTOShipmentOKCode is the HTTP code returned for type UpdateMTOShipmentOK +const UpdateMTOShipmentOKCode int = 200 + +/* +UpdateMTOShipmentOK Successfully updated the MTO shipment. + +swagger:response updateMTOShipmentOK +*/ +type UpdateMTOShipmentOK struct { + + /* + In: Body + */ + Payload *primev3messages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentOK creates UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + + return &UpdateMTOShipmentOK{} +} + +// WithPayload adds the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) WithPayload(payload *primev3messages.MTOShipment) *UpdateMTOShipmentOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) SetPayload(payload *primev3messages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentBadRequestCode is the HTTP code returned for type UpdateMTOShipmentBadRequest +const UpdateMTOShipmentBadRequestCode int = 400 + +/* +UpdateMTOShipmentBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentBadRequest +*/ +type UpdateMTOShipmentBadRequest struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentBadRequest creates UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + + return &UpdateMTOShipmentBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentUnauthorized +const UpdateMTOShipmentUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentUnauthorized The request was denied. + +swagger:response updateMTOShipmentUnauthorized +*/ +type UpdateMTOShipmentUnauthorized struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnauthorized creates UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + + return &UpdateMTOShipmentUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentForbiddenCode is the HTTP code returned for type UpdateMTOShipmentForbidden +const UpdateMTOShipmentForbiddenCode int = 403 + +/* +UpdateMTOShipmentForbidden The request was denied. + +swagger:response updateMTOShipmentForbidden +*/ +type UpdateMTOShipmentForbidden struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentForbidden creates UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + + return &UpdateMTOShipmentForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentNotFoundCode is the HTTP code returned for type UpdateMTOShipmentNotFound +const UpdateMTOShipmentNotFoundCode int = 404 + +/* +UpdateMTOShipmentNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentNotFound +*/ +type UpdateMTOShipmentNotFound struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentNotFound creates UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + + return &UpdateMTOShipmentNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentPreconditionFailed +const UpdateMTOShipmentPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentPreconditionFailed +*/ +type UpdateMTOShipmentPreconditionFailed struct { + + /* + In: Body + */ + Payload *primev3messages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentPreconditionFailed creates UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + + return &UpdateMTOShipmentPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) WithPayload(payload *primev3messages.ClientError) *UpdateMTOShipmentPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) SetPayload(payload *primev3messages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentUnprocessableEntity +const UpdateMTOShipmentUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentUnprocessableEntity The request was unprocessable, likely due to bad input from the requester. + +swagger:response updateMTOShipmentUnprocessableEntity +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + + /* + In: Body + */ + Payload *primev3messages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentUnprocessableEntity creates UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + + return &UpdateMTOShipmentUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) WithPayload(payload *primev3messages.ValidationError) *UpdateMTOShipmentUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) SetPayload(payload *primev3messages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentInternalServerError +const UpdateMTOShipmentInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentInternalServerError A server error occurred. + +swagger:response updateMTOShipmentInternalServerError +*/ +type UpdateMTOShipmentInternalServerError struct { + + /* + In: Body + */ + Payload *primev3messages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentInternalServerError creates UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + + return &UpdateMTOShipmentInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) WithPayload(payload *primev3messages.Error) *UpdateMTOShipmentInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) SetPayload(payload *primev3messages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go new file mode 100644 index 00000000000..de594468f26 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mto_shipment/update_m_t_o_shipment_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentURL generates an URL for the update m t o shipment operation +type UpdateMTOShipmentURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) WithBasePath(bp string) *UpdateMTOShipmentURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/prime/v3" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/primev3api/primev3operations/mymove_api.go b/pkg/gen/primev3api/primev3operations/mymove_api.go new file mode 100644 index 00000000000..260daf28f29 --- /dev/null +++ b/pkg/gen/primev3api/primev3operations/mymove_api.go @@ -0,0 +1,334 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3operations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations/mto_shipment" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + MtoShipmentCreateMTOShipmentHandler: mto_shipment.CreateMTOShipmentHandlerFunc(func(params mto_shipment.CreateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.CreateMTOShipment has not yet been implemented") + }), + MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentHandler: mto_shipment.UpdateMTOShipmentHandlerFunc(func(params mto_shipment.UpdateMTOShipmentParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipment has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Prime V3 API is a RESTful API that enables the Prime contractor to request +information about upcoming moves, update the details and status of those moves, +and make payment requests. It uses Mutual TLS for authentication procedures. + +All endpoints are located at `/prime/v3/`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // MtoShipmentCreateMTOShipmentHandler sets the operation handler for the create m t o shipment operation + MtoShipmentCreateMTOShipmentHandler mto_shipment.CreateMTOShipmentHandler + // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation + MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler + // MtoShipmentUpdateMTOShipmentHandler sets the operation handler for the update m t o shipment operation + MtoShipmentUpdateMTOShipmentHandler mto_shipment.UpdateMTOShipmentHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.MtoShipmentCreateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.CreateMTOShipmentHandler") + } + if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") + } + if o.MtoShipmentUpdateMTOShipmentHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/mto-shipments"] = mto_shipment.NewCreateMTOShipment(o.context, o.MtoShipmentCreateMTOShipmentHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}"] = mto_shipment.NewUpdateMTOShipment(o.context, o.MtoShipmentUpdateMTOShipmentHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/primev3api/server.go b/pkg/gen/primev3api/server.go new file mode 100644 index 00000000000..50e357fff55 --- /dev/null +++ b/pkg/gen/primev3api/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3api + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/primev3api/primev3operations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *primev3operations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *primev3operations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *primev3operations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go b/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..6a12e040300 --- /dev/null +++ b/pkg/gen/primev3client/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object +// with the ability to set a timeout on a request. +func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: timeout, + } +} + +// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object +// with the ability to set a context for a request. +func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + Context: ctx, + } +} + +// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + HTTPClient: client, + } +} + +/* +GetMoveTaskOrderParams contains all the parameters to send to the API endpoint + + for the get move task order operation. + + Typically these are written to a http.Request. +*/ +type GetMoveTaskOrderParams struct { + + /* MoveID. + + UUID or MoveCode of move task order to use........ + */ + MoveID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMoveID adds the moveID to the get move task order params +func (o *GetMoveTaskOrderParams) WithMoveID(moveID string) *GetMoveTaskOrderParams { + o.SetMoveID(moveID) + return o +} + +// SetMoveID adds the moveId to the get move task order params +func (o *GetMoveTaskOrderParams) SetMoveID(moveID string) { + o.MoveID = moveID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param moveID + if err := r.SetPathParam("moveID", o.MoveID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go b/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..c41562fe0dd --- /dev/null +++ b/pkg/gen/primev3client/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. +type GetMoveTaskOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMoveTaskOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMoveTaskOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMoveTaskOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMoveTaskOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMoveTaskOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders/{moveID}] getMoveTaskOrder", response, response.Code()) + } +} + +// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + return &GetMoveTaskOrderOK{} +} + +/* +GetMoveTaskOrderOK describes a response with status code 200, with default header values. + +Successfully retrieve an individual move task order. +*/ +type GetMoveTaskOrderOK struct { + Payload *primev3messages.MoveTaskOrder +} + +// IsSuccess returns true when this get move task order o k response has a 2xx status code +func (o *GetMoveTaskOrderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get move task order o k response has a 3xx status code +func (o *GetMoveTaskOrderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order o k response has a 4xx status code +func (o *GetMoveTaskOrderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order o k response has a 5xx status code +func (o *GetMoveTaskOrderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order o k response a status code equal to that given +func (o *GetMoveTaskOrderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get move task order o k response +func (o *GetMoveTaskOrderOK) Code() int { + return 200 +} + +func (o *GetMoveTaskOrderOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) GetPayload() *primev3messages.MoveTaskOrder { + return o.Payload +} + +func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + return &GetMoveTaskOrderUnauthorized{} +} + +/* +GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderUnauthorized struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code +func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code +func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order unauthorized response has a 4xx status code +func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order unauthorized response has a 5xx status code +func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order unauthorized response a status code equal to that given +func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) Code() int { + return 401 +} + +func (o *GetMoveTaskOrderUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + return &GetMoveTaskOrderForbidden{} +} + +/* +GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderForbidden struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this get move task order forbidden response has a 2xx status code +func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order forbidden response has a 3xx status code +func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order forbidden response has a 4xx status code +func (o *GetMoveTaskOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order forbidden response has a 5xx status code +func (o *GetMoveTaskOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order forbidden response a status code equal to that given +func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) Code() int { + return 403 +} + +func (o *GetMoveTaskOrderForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + return &GetMoveTaskOrderNotFound{} +} + +/* +GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type GetMoveTaskOrderNotFound struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this get move task order not found response has a 2xx status code +func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order not found response has a 3xx status code +func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order not found response has a 4xx status code +func (o *GetMoveTaskOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order not found response has a 5xx status code +func (o *GetMoveTaskOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order not found response a status code equal to that given +func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get move task order not found response +func (o *GetMoveTaskOrderNotFound) Code() int { + return 404 +} + +func (o *GetMoveTaskOrderNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + return &GetMoveTaskOrderInternalServerError{} +} + +/* +GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type GetMoveTaskOrderInternalServerError struct { + Payload *primev3messages.Error +} + +// IsSuccess returns true when this get move task order internal server error response has a 2xx status code +func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order internal server error response has a 3xx status code +func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order internal server error response has a 4xx status code +func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order internal server error response has a 5xx status code +func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get move task order internal server error response a status code equal to that given +func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) Code() int { + return 500 +} + +func (o *GetMoveTaskOrderInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) GetPayload() *primev3messages.Error { + return o.Payload +} + +func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev3client/move_task_order/move_task_order_client.go b/pkg/gen/primev3client/move_task_order/move_task_order_client.go new file mode 100644 index 00000000000..d579dc49d44 --- /dev/null +++ b/pkg/gen/primev3client/move_task_order/move_task_order_client.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new move task order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for move task order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetMoveTaskOrder gets move task order + + ### Functionality + +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMoveTaskOrderParams() + } + op := &runtime.ClientOperation{ + ID: "getMoveTaskOrder", + Method: "GET", + PathPattern: "/move-task-orders/{moveID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMoveTaskOrderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetMoveTaskOrderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..9f53b548412 --- /dev/null +++ b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// NewCreateMTOShipmentParams creates a new CreateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMTOShipmentParams() *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMTOShipmentParamsWithTimeout creates a new CreateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewCreateMTOShipmentParamsWithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewCreateMTOShipmentParamsWithContext creates a new CreateMTOShipmentParams object +// with the ability to set a context for a request. +func NewCreateMTOShipmentParamsWithContext(ctx context.Context) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + Context: ctx, + } +} + +// NewCreateMTOShipmentParamsWithHTTPClient creates a new CreateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMTOShipmentParamsWithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + return &CreateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +CreateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the create m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type CreateMTOShipmentParams struct { + + // Body. + Body *primev3messages.CreateMTOShipment + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) WithDefaults() *CreateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithTimeout(timeout time.Duration) *CreateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithContext(ctx context.Context) *CreateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithHTTPClient(client *http.Client) *CreateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create m t o shipment params +func (o *CreateMTOShipmentParams) WithBody(body *primev3messages.CreateMTOShipment) *CreateMTOShipmentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create m t o shipment params +func (o *CreateMTOShipmentParams) SetBody(body *primev3messages.CreateMTOShipment) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..7aeaf510b18 --- /dev/null +++ b/pkg/gen/primev3client/mto_shipment/create_m_t_o_shipment_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// CreateMTOShipmentReader is a Reader for the CreateMTOShipment structure. +type CreateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewCreateMTOShipmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateMTOShipmentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateMTOShipmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateMTOShipmentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateMTOShipmentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /mto-shipments] createMTOShipment", response, response.Code()) + } +} + +// NewCreateMTOShipmentOK creates a CreateMTOShipmentOK with default headers values +func NewCreateMTOShipmentOK() *CreateMTOShipmentOK { + return &CreateMTOShipmentOK{} +} + +/* +CreateMTOShipmentOK describes a response with status code 200, with default header values. + +Successfully created a MTO shipment. +*/ +type CreateMTOShipmentOK struct { + Payload *primev3messages.MTOShipment +} + +// IsSuccess returns true when this create m t o shipment o k response has a 2xx status code +func (o *CreateMTOShipmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create m t o shipment o k response has a 3xx status code +func (o *CreateMTOShipmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment o k response has a 4xx status code +func (o *CreateMTOShipmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o shipment o k response has a 5xx status code +func (o *CreateMTOShipmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment o k response a status code equal to that given +func (o *CreateMTOShipmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the create m t o shipment o k response +func (o *CreateMTOShipmentOK) Code() int { + return 200 +} + +func (o *CreateMTOShipmentOK) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOShipmentOK) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *CreateMTOShipmentOK) GetPayload() *primev3messages.MTOShipment { + return o.Payload +} + +func (o *CreateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentBadRequest creates a CreateMTOShipmentBadRequest with default headers values +func NewCreateMTOShipmentBadRequest() *CreateMTOShipmentBadRequest { + return &CreateMTOShipmentBadRequest{} +} + +/* +CreateMTOShipmentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateMTOShipmentBadRequest struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this create m t o shipment bad request response has a 2xx status code +func (o *CreateMTOShipmentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment bad request response has a 3xx status code +func (o *CreateMTOShipmentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment bad request response has a 4xx status code +func (o *CreateMTOShipmentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment bad request response has a 5xx status code +func (o *CreateMTOShipmentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment bad request response a status code equal to that given +func (o *CreateMTOShipmentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create m t o shipment bad request response +func (o *CreateMTOShipmentBadRequest) Code() int { + return 400 +} + +func (o *CreateMTOShipmentBadRequest) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOShipmentBadRequest) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMTOShipmentBadRequest) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *CreateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentNotFound creates a CreateMTOShipmentNotFound with default headers values +func NewCreateMTOShipmentNotFound() *CreateMTOShipmentNotFound { + return &CreateMTOShipmentNotFound{} +} + +/* +CreateMTOShipmentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateMTOShipmentNotFound struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this create m t o shipment not found response has a 2xx status code +func (o *CreateMTOShipmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment not found response has a 3xx status code +func (o *CreateMTOShipmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment not found response has a 4xx status code +func (o *CreateMTOShipmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment not found response has a 5xx status code +func (o *CreateMTOShipmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment not found response a status code equal to that given +func (o *CreateMTOShipmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create m t o shipment not found response +func (o *CreateMTOShipmentNotFound) Code() int { + return 404 +} + +func (o *CreateMTOShipmentNotFound) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOShipmentNotFound) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *CreateMTOShipmentNotFound) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *CreateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentUnprocessableEntity creates a CreateMTOShipmentUnprocessableEntity with default headers values +func NewCreateMTOShipmentUnprocessableEntity() *CreateMTOShipmentUnprocessableEntity { + return &CreateMTOShipmentUnprocessableEntity{} +} + +/* +CreateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type CreateMTOShipmentUnprocessableEntity struct { + Payload *primev3messages.ValidationError +} + +// IsSuccess returns true when this create m t o shipment unprocessable entity response has a 2xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment unprocessable entity response has a 3xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment unprocessable entity response has a 4xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create m t o shipment unprocessable entity response has a 5xx status code +func (o *CreateMTOShipmentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create m t o shipment unprocessable entity response a status code equal to that given +func (o *CreateMTOShipmentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create m t o shipment unprocessable entity response +func (o *CreateMTOShipmentUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateMTOShipmentUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOShipmentUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMTOShipmentUnprocessableEntity) GetPayload() *primev3messages.ValidationError { + return o.Payload +} + +func (o *CreateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMTOShipmentInternalServerError creates a CreateMTOShipmentInternalServerError with default headers values +func NewCreateMTOShipmentInternalServerError() *CreateMTOShipmentInternalServerError { + return &CreateMTOShipmentInternalServerError{} +} + +/* +CreateMTOShipmentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateMTOShipmentInternalServerError struct { + Payload *primev3messages.Error +} + +// IsSuccess returns true when this create m t o shipment internal server error response has a 2xx status code +func (o *CreateMTOShipmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create m t o shipment internal server error response has a 3xx status code +func (o *CreateMTOShipmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create m t o shipment internal server error response has a 4xx status code +func (o *CreateMTOShipmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create m t o shipment internal server error response has a 5xx status code +func (o *CreateMTOShipmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create m t o shipment internal server error response a status code equal to that given +func (o *CreateMTOShipmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create m t o shipment internal server error response +func (o *CreateMTOShipmentInternalServerError) Code() int { + return 500 +} + +func (o *CreateMTOShipmentInternalServerError) Error() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOShipmentInternalServerError) String() string { + return fmt.Sprintf("[POST /mto-shipments][%d] createMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMTOShipmentInternalServerError) GetPayload() *primev3messages.Error { + return o.Payload +} + +func (o *CreateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go b/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go new file mode 100644 index 00000000000..57a78b05570 --- /dev/null +++ b/pkg/gen/primev3client/mto_shipment/mto_shipment_client.go @@ -0,0 +1,145 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto shipment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto shipment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) + + UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateMTOShipment creates m t o shipment + + Creates a new shipment within the specified move. This endpoint should be used whenever the movers identify a + +need for an additional shipment. The new shipment will be submitted to the TOO for review, and the TOO must +approve it before the contractor can proceed with billing. + +**NOTE**: When creating a child shipment diversion, you can no longer specify the `primeActualWeight`. +If you create a new diverted shipment with the `diversion` and `divertedFromShipmentId` parameter, it will automatically +inherit the primeActualWeight of its `divertedFromShipmentId` parent. Payment requests created on a diverted shipment "chain" will utilize +the lowest weight possible in the chain to prevent overcharging as they are still separate shipments. + +**WIP**: The Prime should be notified by a push notification whenever the TOO approves a shipment connected to +one of their moves. Otherwise, the Prime can fetch the related move using the +[getMoveTaskOrder](#operation/getMoveTaskOrder) endpoint and see if this shipment has the status `"APPROVED"`. +*/ +func (a *Client) CreateMTOShipment(params *CreateMTOShipmentParams, opts ...ClientOption) (*CreateMTOShipmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "createMTOShipment", + Method: "POST", + PathPattern: "/mto-shipments", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateMTOShipmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdateMTOShipment updates m t o shipment + + Updates an existing shipment for a move. + +Note that there are some restrictions on nested objects: + +* Service items: You cannot add or update service items using this endpoint. Please use [createMTOServiceItem](#operation/createMTOServiceItem) and [updateMTOServiceItem](#operation/updateMTOServiceItem) instead. +* Agents: You cannot add or update agents using this endpoint. Please use [createMTOAgent](#operation/createMTOAgent) and [updateMTOAgent](#operation/updateMTOAgent) instead. +* Addresses: You can add new addresses using this endpoint (and must use this endpoint to do so), but you cannot update existing ones. Please use [updateMTOShipmentAddress](#operation/updateMTOShipmentAddress) instead. + +These restrictions are due to our [optimistic locking/concurrency control](https://transcom.github.io/mymove-docs/docs/dev/contributing/backend/use-optimistic-locking) mechanism. + +Note that some fields cannot be manually changed but will still be updated automatically, such as `primeEstimatedWeightRecordedDate` and `requiredDeliveryDate`. +*/ +func (a *Client) UpdateMTOShipment(params *UpdateMTOShipmentParams, opts ...ClientOption) (*UpdateMTOShipmentOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipment", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOShipmentOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOShipment: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go new file mode 100644 index 00000000000..2ea2f86e0ab --- /dev/null +++ b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// NewUpdateMTOShipmentParams creates a new UpdateMTOShipmentParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentParams() *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentParamsWithTimeout creates a new UpdateMTOShipmentParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentParamsWithContext creates a new UpdateMTOShipmentParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentParamsWithContext(ctx context.Context) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentParamsWithHTTPClient creates a new UpdateMTOShipmentParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + return &UpdateMTOShipmentParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentParams contains all the parameters to send to the API endpoint + + for the update m t o shipment operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *primev3messages.UpdateMTOShipment + + /* MtoShipmentID. + + UUID of the shipment being updated. + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) WithDefaults() *UpdateMTOShipmentParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithContext(ctx context.Context) *UpdateMTOShipmentParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithBody(body *primev3messages.UpdateMTOShipment) *UpdateMTOShipmentParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetBody(body *primev3messages.UpdateMTOShipment) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment params +func (o *UpdateMTOShipmentParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment params +func (o *UpdateMTOShipmentParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go new file mode 100644 index 00000000000..f798331bd50 --- /dev/null +++ b/pkg/gen/primev3client/mto_shipment/update_m_t_o_shipment_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3messages" +) + +// UpdateMTOShipmentReader is a Reader for the UpdateMTOShipment structure. +type UpdateMTOShipmentReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOShipmentOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOShipmentBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOShipmentUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOShipmentForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOShipmentNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOShipmentPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOShipmentUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOShipmentInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}] updateMTOShipment", response, response.Code()) + } +} + +// NewUpdateMTOShipmentOK creates a UpdateMTOShipmentOK with default headers values +func NewUpdateMTOShipmentOK() *UpdateMTOShipmentOK { + return &UpdateMTOShipmentOK{} +} + +/* +UpdateMTOShipmentOK describes a response with status code 200, with default header values. + +Successfully updated the MTO shipment. +*/ +type UpdateMTOShipmentOK struct { + Payload *primev3messages.MTOShipment +} + +// IsSuccess returns true when this update m t o shipment o k response has a 2xx status code +func (o *UpdateMTOShipmentOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o shipment o k response has a 3xx status code +func (o *UpdateMTOShipmentOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment o k response has a 4xx status code +func (o *UpdateMTOShipmentOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment o k response has a 5xx status code +func (o *UpdateMTOShipmentOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment o k response a status code equal to that given +func (o *UpdateMTOShipmentOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o shipment o k response +func (o *UpdateMTOShipmentOK) Code() int { + return 200 +} + +func (o *UpdateMTOShipmentOK) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentOK) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentOK) GetPayload() *primev3messages.MTOShipment { + return o.Payload +} + +func (o *UpdateMTOShipmentOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentBadRequest creates a UpdateMTOShipmentBadRequest with default headers values +func NewUpdateMTOShipmentBadRequest() *UpdateMTOShipmentBadRequest { + return &UpdateMTOShipmentBadRequest{} +} + +/* +UpdateMTOShipmentBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOShipmentBadRequest struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment bad request response has a 2xx status code +func (o *UpdateMTOShipmentBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment bad request response has a 3xx status code +func (o *UpdateMTOShipmentBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment bad request response has a 4xx status code +func (o *UpdateMTOShipmentBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment bad request response has a 5xx status code +func (o *UpdateMTOShipmentBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment bad request response a status code equal to that given +func (o *UpdateMTOShipmentBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o shipment bad request response +func (o *UpdateMTOShipmentBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOShipmentBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentBadRequest) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentUnauthorized creates a UpdateMTOShipmentUnauthorized with default headers values +func NewUpdateMTOShipmentUnauthorized() *UpdateMTOShipmentUnauthorized { + return &UpdateMTOShipmentUnauthorized{} +} + +/* +UpdateMTOShipmentUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentUnauthorized struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment unauthorized response has a 2xx status code +func (o *UpdateMTOShipmentUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment unauthorized response has a 3xx status code +func (o *UpdateMTOShipmentUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment unauthorized response has a 4xx status code +func (o *UpdateMTOShipmentUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment unauthorized response has a 5xx status code +func (o *UpdateMTOShipmentUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment unauthorized response a status code equal to that given +func (o *UpdateMTOShipmentUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o shipment unauthorized response +func (o *UpdateMTOShipmentUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOShipmentUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentUnauthorized) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentForbidden creates a UpdateMTOShipmentForbidden with default headers values +func NewUpdateMTOShipmentForbidden() *UpdateMTOShipmentForbidden { + return &UpdateMTOShipmentForbidden{} +} + +/* +UpdateMTOShipmentForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentForbidden struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment forbidden response has a 2xx status code +func (o *UpdateMTOShipmentForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment forbidden response has a 3xx status code +func (o *UpdateMTOShipmentForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment forbidden response has a 4xx status code +func (o *UpdateMTOShipmentForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment forbidden response has a 5xx status code +func (o *UpdateMTOShipmentForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment forbidden response a status code equal to that given +func (o *UpdateMTOShipmentForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o shipment forbidden response +func (o *UpdateMTOShipmentForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOShipmentForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentForbidden) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentNotFound creates a UpdateMTOShipmentNotFound with default headers values +func NewUpdateMTOShipmentNotFound() *UpdateMTOShipmentNotFound { + return &UpdateMTOShipmentNotFound{} +} + +/* +UpdateMTOShipmentNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOShipmentNotFound struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment not found response has a 2xx status code +func (o *UpdateMTOShipmentNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment not found response has a 3xx status code +func (o *UpdateMTOShipmentNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment not found response has a 4xx status code +func (o *UpdateMTOShipmentNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment not found response has a 5xx status code +func (o *UpdateMTOShipmentNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment not found response a status code equal to that given +func (o *UpdateMTOShipmentNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o shipment not found response +func (o *UpdateMTOShipmentNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOShipmentNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentNotFound) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentPreconditionFailed creates a UpdateMTOShipmentPreconditionFailed with default headers values +func NewUpdateMTOShipmentPreconditionFailed() *UpdateMTOShipmentPreconditionFailed { + return &UpdateMTOShipmentPreconditionFailed{} +} + +/* +UpdateMTOShipmentPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOShipmentPreconditionFailed struct { + Payload *primev3messages.ClientError +} + +// IsSuccess returns true when this update m t o shipment precondition failed response has a 2xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment precondition failed response has a 3xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment precondition failed response has a 4xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment precondition failed response has a 5xx status code +func (o *UpdateMTOShipmentPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment precondition failed response a status code equal to that given +func (o *UpdateMTOShipmentPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o shipment precondition failed response +func (o *UpdateMTOShipmentPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOShipmentPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentPreconditionFailed) GetPayload() *primev3messages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentUnprocessableEntity creates a UpdateMTOShipmentUnprocessableEntity with default headers values +func NewUpdateMTOShipmentUnprocessableEntity() *UpdateMTOShipmentUnprocessableEntity { + return &UpdateMTOShipmentUnprocessableEntity{} +} + +/* +UpdateMTOShipmentUnprocessableEntity describes a response with status code 422, with default header values. + +The request was unprocessable, likely due to bad input from the requester. +*/ +type UpdateMTOShipmentUnprocessableEntity struct { + Payload *primev3messages.ValidationError +} + +// IsSuccess returns true when this update m t o shipment unprocessable entity response has a 2xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment unprocessable entity response has a 3xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment unprocessable entity response has a 4xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment unprocessable entity response has a 5xx status code +func (o *UpdateMTOShipmentUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment unprocessable entity response a status code equal to that given +func (o *UpdateMTOShipmentUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o shipment unprocessable entity response +func (o *UpdateMTOShipmentUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOShipmentUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentUnprocessableEntity) GetPayload() *primev3messages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOShipmentUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentInternalServerError creates a UpdateMTOShipmentInternalServerError with default headers values +func NewUpdateMTOShipmentInternalServerError() *UpdateMTOShipmentInternalServerError { + return &UpdateMTOShipmentInternalServerError{} +} + +/* +UpdateMTOShipmentInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOShipmentInternalServerError struct { + Payload *primev3messages.Error +} + +// IsSuccess returns true when this update m t o shipment internal server error response has a 2xx status code +func (o *UpdateMTOShipmentInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment internal server error response has a 3xx status code +func (o *UpdateMTOShipmentInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment internal server error response has a 4xx status code +func (o *UpdateMTOShipmentInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment internal server error response has a 5xx status code +func (o *UpdateMTOShipmentInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o shipment internal server error response a status code equal to that given +func (o *UpdateMTOShipmentInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o shipment internal server error response +func (o *UpdateMTOShipmentInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOShipmentInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}][%d] updateMTOShipmentInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentInternalServerError) GetPayload() *primev3messages.Error { + return o.Payload +} + +func (o *UpdateMTOShipmentInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(primev3messages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/primev3client/mymove_client.go b/pkg/gen/primev3client/mymove_client.go new file mode 100644 index 00000000000..e3e47c26d04 --- /dev/null +++ b/pkg/gen/primev3client/mymove_client.go @@ -0,0 +1,117 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3client + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/primev3client/move_task_order" + "github.com/transcom/mymove/pkg/gen/primev3client/mto_shipment" +) + +// Default mymove HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/prime/v3" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new mymove HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Mymove { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new mymove HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new mymove client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Mymove) + cli.Transport = transport + cli.MoveTaskOrder = move_task_order.New(transport, formats) + cli.MtoShipment = mto_shipment.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Mymove is a client for mymove +type Mymove struct { + MoveTaskOrder move_task_order.ClientService + + MtoShipment mto_shipment.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Mymove) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.MoveTaskOrder.SetTransport(transport) + c.MtoShipment.SetTransport(transport) +} diff --git a/pkg/gen/primev3messages/error.go b/pkg/gen/primev3messages/error.go new file mode 100644 index 00000000000..a96ae76f88f --- /dev/null +++ b/pkg/gen/primev3messages/error.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Error error +// +// swagger:model Error +type Error struct { + + // detail + // Required: true + Detail *string `json:"detail"` + + // instance + // Format: uuid + Instance strfmt.UUID `json:"instance,omitempty"` + + // title + // Required: true + Title *string `json:"title"` +} + +// Validate validates this error +func (m *Error) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDetail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInstance(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTitle(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Error) validateDetail(formats strfmt.Registry) error { + + if err := validate.Required("detail", "body", m.Detail); err != nil { + return err + } + + return nil +} + +func (m *Error) validateInstance(formats strfmt.Registry) error { + if swag.IsZero(m.Instance) { // not required + return nil + } + + if err := validate.FormatOf("instance", "body", "uuid", m.Instance.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Error) validateTitle(formats strfmt.Registry) error { + + if err := validate.Required("title", "body", m.Title); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this error based on context it is used +func (m *Error) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Error) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Error) UnmarshalBinary(b []byte) error { + var res Error + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_agent.go b/pkg/gen/primev3messages/m_t_o_agent.go new file mode 100644 index 00000000000..440417f3452 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_agent.go @@ -0,0 +1,306 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgent m t o agent +// +// swagger:model MTOAgent +type MTOAgent struct { + + // agent type + AgentType MTOAgentType `json:"agentType,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$ + Email *string `json:"email,omitempty"` + + // first name + FirstName *string `json:"firstName,omitempty"` + + // The ID of the agent. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // last name + LastName *string `json:"lastName,omitempty"` + + // The ID of the shipment this agent is permitted to release/receive. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // phone + // Pattern: ^([2-9]\d{2}-\d{3}-\d{4})?$ + Phone *string `json:"phone,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o agent +func (m *MTOAgent) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAgentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) validateAgentType(formats strfmt.Registry) error { + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) 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 *MTOAgent) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^([2-9]\d{2}-\d{3}-\d{4})?$`); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o agent based on the context it is used +func (m *MTOAgent) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOAgent) contextValidateAgentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.AgentType) { // not required + return nil + } + + if err := m.AgentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agentType") + } + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateMtoShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoShipmentID", "body", strfmt.UUID(m.MtoShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MTOAgent) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOAgent) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOAgent) UnmarshalBinary(b []byte) error { + var res MTOAgent + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_agent_type.go b/pkg/gen/primev3messages/m_t_o_agent_type.go new file mode 100644 index 00000000000..08217d25ddd --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_agent_type.go @@ -0,0 +1,82 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOAgentType Agent Type +// +// The type for this agent. `RELEASING` means they have authority on pickup, `RECEIVING` means they can receive the shipment on delivery. +// +// Example: RELEASING_AGENT +// +// swagger:model MTOAgentType +type MTOAgentType string + +func NewMTOAgentType(value MTOAgentType) *MTOAgentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOAgentType. +func (m MTOAgentType) Pointer() *MTOAgentType { + return &m +} + +const ( + + // MTOAgentTypeRELEASINGAGENT captures enum value "RELEASING_AGENT" + MTOAgentTypeRELEASINGAGENT MTOAgentType = "RELEASING_AGENT" + + // MTOAgentTypeRECEIVINGAGENT captures enum value "RECEIVING_AGENT" + MTOAgentTypeRECEIVINGAGENT MTOAgentType = "RECEIVING_AGENT" +) + +// for schema +var mTOAgentTypeEnum []interface{} + +func init() { + var res []MTOAgentType + if err := json.Unmarshal([]byte(`["RELEASING_AGENT","RECEIVING_AGENT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOAgentTypeEnum = append(mTOAgentTypeEnum, v) + } +} + +func (m MTOAgentType) validateMTOAgentTypeEnum(path, location string, value MTOAgentType) error { + if err := validate.EnumCase(path, location, value, mTOAgentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o agent type +func (m MTOAgentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOAgentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o agent type based on context it is used +func (m MTOAgentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_agents.go b/pkg/gen/primev3messages/m_t_o_agents.go new file mode 100644 index 00000000000..d1bb76d9f57 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_agents.go @@ -0,0 +1,85 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOAgents A list of the agents for a shipment. Agents are the people who the Prime contractor recognize as permitted to release (in the case of pickup) or receive (on delivery) a shipment. +// +// swagger:model MTOAgents +type MTOAgents []*MTOAgent + +// Validate validates this m t o agents +func (m MTOAgents) Validate(formats strfmt.Registry) error { + var res []error + + iMTOAgentsSize := int64(len(m)) + + if err := validate.MaxItems("", "body", iMTOAgentsSize, 2); err != nil { + return err + } + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o agents based on the context it is used +func (m MTOAgents) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item.go b/pkg/gen/primev3messages/m_t_o_service_item.go new file mode 100644 index 00000000000..9559114c004 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item.go @@ -0,0 +1,517 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItem MTOServiceItem describes a base type of a service item. Polymorphic type. +// +// swagger:discriminator MTOServiceItem modelType +type MTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // A hash unique to this service item that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag() string + SetETag(string) + + // The ID of the service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // locked price cents + LockedPriceCents() *int64 + SetLockedPriceCents(*int64) + + // model type + // Required: true + ModelType() MTOServiceItemModelType + SetModelType(MTOServiceItemModelType) + + // The ID of the move for this service item. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + MoveTaskOrderID() *strfmt.UUID + SetMoveTaskOrderID(*strfmt.UUID) + + // The ID of the shipment this service is for, if any. Optional. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID() strfmt.UUID + SetMtoShipmentID(strfmt.UUID) + + // The full descriptive name of the service. + // Read Only: true + ReServiceName() string + SetReServiceName(string) + + // The reason why this service item was rejected by the TOO. + // Example: item was too heavy + // Read Only: true + RejectionReason() *string + SetRejectionReason(*string) + + // service request documents + ServiceRequestDocuments() ServiceRequestDocuments + SetServiceRequestDocuments(ServiceRequestDocuments) + + // status + Status() MTOServiceItemStatus + SetStatus(MTOServiceItemStatus) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type mTOServiceItem struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + modelTypeField MTOServiceItemModelType + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus +} + +// ETag gets the e tag of this polymorphic type +func (m *mTOServiceItem) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this polymorphic type +func (m *mTOServiceItem) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this polymorphic type +func (m *mTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *mTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this polymorphic type +func (m *mTOServiceItem) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this polymorphic type +func (m *mTOServiceItem) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *mTOServiceItem) ModelType() MTOServiceItemModelType { + return "MTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *mTOServiceItem) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this polymorphic type +func (m *mTOServiceItem) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this polymorphic type +func (m *mTOServiceItem) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this polymorphic type +func (m *mTOServiceItem) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this polymorphic type +func (m *mTOServiceItem) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this polymorphic type +func (m *mTOServiceItem) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this polymorphic type +func (m *mTOServiceItem) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this polymorphic type +func (m *mTOServiceItem) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this polymorphic type +func (m *mTOServiceItem) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this polymorphic type +func (m *mTOServiceItem) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this polymorphic type +func (m *mTOServiceItem) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this polymorphic type +func (m *mTOServiceItem) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalMTOServiceItemSlice unmarshals polymorphic slices of MTOServiceItem +func UnmarshalMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]MTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []MTOServiceItem + for _, element := range elements { + obj, err := unmarshalMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalMTOServiceItem unmarshals polymorphic MTOServiceItem +func UnmarshalMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (MTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalMTOServiceItem(data, consumer) +} + +func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "MTOServiceItem": + var result mTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemBasic": + var result MTOServiceItemBasic + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDestSIT": + var result MTOServiceItemDestSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemDomesticCrating": + var result MTOServiceItemDomesticCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemInternationalCrating": + var result MTOServiceItemInternationalCrating + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemOriginSIT": + var result MTOServiceItemOriginSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "MTOServiceItemShuttle": + var result MTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this m t o service item +func (m *mTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(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 *mTOServiceItem) 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 *mTOServiceItem) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) validateServiceRequestDocuments(formats strfmt.Registry) error { + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this m t o service item based on the context it is used +func (m *mTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *mTOServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *mTOServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_basic.go b/pkg/gen/primev3messages/m_t_o_service_item_basic.go new file mode 100644 index 00000000000..57e85ed0f7d --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_basic.go @@ -0,0 +1,574 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemBasic Describes a basic service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemBasic +type MTOServiceItemBasic struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemBasic) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemBasic) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemBasic) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemBasic) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemBasic) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemBasic) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemBasic) ModelType() MTOServiceItemModelType { + return "MTOServiceItemBasic" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemBasic) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemBasic) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemBasic) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemBasic) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemBasic) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemBasic) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemBasic) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemBasic) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemBasic) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemBasic) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemBasic) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemBasic) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemBasic) UnmarshalJSON(raw []byte) error { + var data struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemBasic + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemBasic) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // re service code + // Required: true + ReServiceCode *ReServiceCode `json:"reServiceCode"` + }{ + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item basic +func (m *MTOServiceItemBasic) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) 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 *MTOServiceItemBasic) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + if m.ReServiceCode != nil { + if err := m.ReServiceCode.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// ContextValidate validate this m t o service item basic based on the context it is used +func (m *MTOServiceItemBasic) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceCode(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemBasic) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemBasic) contextValidateReServiceCode(ctx context.Context, formats strfmt.Registry) error { + + if m.ReServiceCode != nil { + + if err := m.ReServiceCode.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reServiceCode") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reServiceCode") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemBasic) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemBasic) UnmarshalBinary(b []byte) error { + var res MTOServiceItemBasic + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go b/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go new file mode 100644 index 00000000000..7e6333c32c3 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_dest_s_i_t.go @@ -0,0 +1,987 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDestSIT Describes a domestic destination SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDestSIT +type MTOServiceItemDestSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDestSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDestSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDestSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDestSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDestSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDestSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDestSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDestSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDestSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDestSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDestSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDestSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDestSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDestSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDestSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDestSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDestSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDestSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDestSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to `timeMilitary1`. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to `timeMilitary2`. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Required: true + // Enum: [DDFSIT DDASIT] + ReServiceCode *string `json:"reServiceCode"` + + // The reason item has been placed in SIT. + // + // Required: true + Reason *string `json:"reason"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact1`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact corresponding to `dateOfContact2`, in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item dest s i t +func (m *MTOServiceItemDestSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) 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 *MTOServiceItemDestSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var mTOServiceItemDestSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDFSIT","DDASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDestSITTypeReServiceCodePropEnum = append(mTOServiceItemDestSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDestSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDestSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDestSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item dest s i t based on the context it is used +func (m *MTOServiceItemDestSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDestSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDestSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDestSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_dimension.go b/pkg/gen/primev3messages/m_t_o_service_item_dimension.go new file mode 100644 index 00000000000..f3a3d8ed23f --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_dimension.go @@ -0,0 +1,129 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDimension The dimensions for either the item or the crate associated with a crating service item. +// +// swagger:model MTOServiceItemDimension +type MTOServiceItemDimension struct { + + // Height in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Height *int32 `json:"height"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Length in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Length *int32 `json:"length"` + + // Width in thousandth inches. 1000 thou = 1 inch. + // Example: 1000 + // Required: true + Width *int32 `json:"width"` +} + +// Validate validates this m t o service item dimension +func (m *MTOServiceItemDimension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateHeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLength(formats); err != nil { + res = append(res, err) + } + + if err := m.validateWidth(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDimension) validateHeight(formats strfmt.Registry) error { + + if err := validate.Required("height", "body", m.Height); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) 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 *MTOServiceItemDimension) validateLength(formats strfmt.Registry) error { + + if err := validate.Required("length", "body", m.Length); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDimension) validateWidth(formats strfmt.Registry) error { + + if err := validate.Required("width", "body", m.Width); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this m t o service item dimension based on context it is used +func (m *MTOServiceItemDimension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDimension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDimension) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDimension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go b/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go new file mode 100644 index 00000000000..83e39efa302 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_domestic_crating.go @@ -0,0 +1,705 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticCrating Describes a domestic crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemDomesticCrating +type MTOServiceItemDomesticCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.Item = data.Item + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // A unique code for the service item. Indicates if the service is for crating (DCRT) or uncrating (DUCRT). + // Required: true + // Enum: [DCRT DUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + Item: m.Item, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic crating +func (m *MTOServiceItemDomesticCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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 *MTOServiceItemDomesticCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemDomesticCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DCRT","DUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticCratingTypeReServiceCodePropEnum = append(mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic crating based on the context it is used +func (m *MTOServiceItemDomesticCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemDomesticCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go b/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go new file mode 100644 index 00000000000..55a759a0682 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_international_crating.go @@ -0,0 +1,773 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemInternationalCrating Describes a international crating/uncrating service item subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemInternationalCrating +type MTOServiceItemInternationalCrating struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemInternationalCrating) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemInternationalCrating) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemInternationalCrating) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemInternationalCrating) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) ModelType() MTOServiceItemModelType { + return "MTOServiceItemInternationalCrating" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemInternationalCrating) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemInternationalCrating) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemInternationalCrating) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemInternationalCrating) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemInternationalCrating) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemInternationalCrating) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemInternationalCrating) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemInternationalCrating) UnmarshalJSON(raw []byte) error { + var data struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemInternationalCrating + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.Crate = data.Crate + result.Description = data.Description + result.ExternalCrate = data.ExternalCrate + result.Item = data.Item + result.Market = data.Market + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.StandaloneCrate = data.StandaloneCrate + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemInternationalCrating) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // The dimensions for the crate the item will be shipped in. + // Required: true + Crate struct { + MTOServiceItemDimension + } `json:"crate"` + + // A description of the item being crated. + // Example: Decorated horse head to be crated. + // Required: true + Description *string `json:"description"` + + // external crate + ExternalCrate *bool `json:"externalCrate,omitempty"` + + // The dimensions of the item being crated. + // Required: true + Item struct { + MTOServiceItemDimension + } `json:"item"` + + // To identify whether the service was provided within (CONUS) or (OCONUS) + // Example: CONUS + // Enum: [CONUS OCONUS] + Market string `json:"market,omitempty"` + + // A unique code for the service item. Indicates if the service is for crating (ICRT) or uncrating (IUCRT). + // Required: true + // Enum: [ICRT IUCRT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why an item needed to be crated or uncrated. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up + Reason *string `json:"reason"` + + // standalone crate + StandaloneCrate *bool `json:"standaloneCrate,omitempty"` + }{ + + Crate: m.Crate, + + Description: m.Description, + + ExternalCrate: m.ExternalCrate, + + Item: m.Item, + + Market: m.Market, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + StandaloneCrate: m.StandaloneCrate, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item international crating +func (m *MTOServiceItemInternationalCrating) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCrate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDescription(formats); err != nil { + res = append(res, err) + } + + if err := m.validateItem(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarket(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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 *MTOServiceItemInternationalCrating) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateCrate(formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateDescription(formats strfmt.Registry) error { + + if err := validate.Required("description", "body", m.Description); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateItem(formats strfmt.Registry) error { + + return nil +} + +var mTOServiceItemInternationalCratingTypeMarketPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CONUS","OCONUS"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeMarketPropEnum = append(mTOServiceItemInternationalCratingTypeMarketPropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateMarketEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeMarketPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateMarket(formats strfmt.Registry) error { + + if swag.IsZero(m.Market) { // not required + return nil + } + + // value enum + if err := m.validateMarketEnum("market", "body", m.Market); err != nil { + return err + } + + return nil +} + +var mTOServiceItemInternationalCratingTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["ICRT","IUCRT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemInternationalCratingTypeReServiceCodePropEnum = append(mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemInternationalCrating) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemInternationalCratingTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item international crating based on the context it is used +func (m *MTOServiceItemInternationalCrating) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCrate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateItem(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateCrate(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOServiceItemInternationalCrating) contextValidateItem(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemInternationalCrating) UnmarshalBinary(b []byte) error { + var res MTOServiceItemInternationalCrating + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_model_type.go b/pkg/gen/primev3messages/m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..50a9d22e418 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_model_type.go @@ -0,0 +1,103 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemModelType Describes all model sub-types for a MTOServiceItem model. +// +// Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DOFSIT, DOASIT - MTOServiceItemOriginSIT +// - DDFSIT, DDASIT - MTOServiceItemDestSIT +// - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DCRT, DUCRT - MTOServiceItemDomesticCrating +// - ICRT, IUCRT - MTOServiceItemInternationalCrating +// - PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge +// +// The documentation will then update with the supported fields. +// +// swagger:model MTOServiceItemModelType +type MTOServiceItemModelType string + +func NewMTOServiceItemModelType(value MTOServiceItemModelType) *MTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemModelType. +func (m MTOServiceItemModelType) Pointer() *MTOServiceItemModelType { + return &m +} + +const ( + + // MTOServiceItemModelTypeMTOServiceItemBasic captures enum value "MTOServiceItemBasic" + MTOServiceItemModelTypeMTOServiceItemBasic MTOServiceItemModelType = "MTOServiceItemBasic" + + // MTOServiceItemModelTypeMTOServiceItemOriginSIT captures enum value "MTOServiceItemOriginSIT" + MTOServiceItemModelTypeMTOServiceItemOriginSIT MTOServiceItemModelType = "MTOServiceItemOriginSIT" + + // MTOServiceItemModelTypeMTOServiceItemDestSIT captures enum value "MTOServiceItemDestSIT" + MTOServiceItemModelTypeMTOServiceItemDestSIT MTOServiceItemModelType = "MTOServiceItemDestSIT" + + // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" + MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + + // MTOServiceItemModelTypeMTOServiceItemDomesticCrating captures enum value "MTOServiceItemDomesticCrating" + MTOServiceItemModelTypeMTOServiceItemDomesticCrating MTOServiceItemModelType = "MTOServiceItemDomesticCrating" + + // MTOServiceItemModelTypeMTOServiceItemInternationalCrating captures enum value "MTOServiceItemInternationalCrating" + MTOServiceItemModelTypeMTOServiceItemInternationalCrating MTOServiceItemModelType = "MTOServiceItemInternationalCrating" + + // MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge captures enum value "MTOSerivceItemInternationalFuelSurcharge" + MTOServiceItemModelTypeMTOSerivceItemInternationalFuelSurcharge MTOServiceItemModelType = "MTOSerivceItemInternationalFuelSurcharge" +) + +// for schema +var mTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []MTOServiceItemModelType + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemModelTypeEnum = append(mTOServiceItemModelTypeEnum, v) + } +} + +func (m MTOServiceItemModelType) validateMTOServiceItemModelTypeEnum(path, location string, value MTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item model type +func (m MTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o service item model type based on context it is used +func (m MTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go b/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go new file mode 100644 index 00000000000..1ca4558a59c --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_origin_s_i_t.go @@ -0,0 +1,900 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemOriginSIT Describes a domestic origin SIT service item. Subtype of a MTOServiceItem. +// +// swagger:model MTOServiceItemOriginSIT +type MTOServiceItemOriginSIT struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemOriginSIT) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemOriginSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemOriginSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemOriginSIT) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemOriginSIT) ModelType() MTOServiceItemModelType { + return "MTOServiceItemOriginSIT" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemOriginSIT) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemOriginSIT) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemOriginSIT) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemOriginSIT) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemOriginSIT) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemOriginSIT) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemOriginSIT) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemOriginSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemOriginSIT + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitEntryDate = data.SitEntryDate + result.SitHHGActualOrigin = data.SitHHGActualOrigin + result.SitHHGOriginalOrigin = data.SitHHGOriginalOrigin + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemOriginSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Service code allowed for this model type. + // Required: true + // Enum: [DOFSIT DOASIT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why Prime is picking up SIT item. + // Example: Storage items need to be picked up + // Required: true + Reason *string `json:"reason"` + + // request approvals requested status + RequestApprovalsRequestedStatus bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date. + // Format: date + SitDepartureDate *strfmt.Date `json:"sitDepartureDate,omitempty"` + + // Entry date for the SIT + // Required: true + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate"` + + // sit h h g actual origin + SitHHGActualOrigin *Address `json:"sitHHGActualOrigin,omitempty"` + + // sit h h g original origin + SitHHGOriginalOrigin *Address `json:"sitHHGOriginalOrigin,omitempty"` + + // sit postal code + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + }{ + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitEntryDate: m.SitEntryDate, + + SitHHGActualOrigin: m.SitHHGActualOrigin, + + SitHHGOriginalOrigin: m.SitHHGOriginalOrigin, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item origin s i t +func (m *MTOServiceItemOriginSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGActualOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitHHGOriginalOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) 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 *MTOServiceItemOriginSIT) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemOriginSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOFSIT","DOASIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemOriginSITTypeReServiceCodePropEnum = append(mTOServiceItemOriginSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemOriginSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemOriginSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if err := validate.Required("sitEntryDate", "body", m.SitEntryDate); err != nil { + return err + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGActualOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if m.SitHHGActualOrigin != nil { + if err := m.SitHHGActualOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitHHGOriginalOrigin(formats strfmt.Registry) error { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if m.SitHHGOriginalOrigin != nil { + if err := m.SitHHGOriginalOrigin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if err := validate.Required("sitPostalCode", "body", m.SitPostalCode); err != nil { + return err + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item origin s i t based on the context it is used +func (m *MTOServiceItemOriginSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGActualOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitHHGOriginalOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGActualOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGActualOrigin != nil { + + if swag.IsZero(m.SitHHGActualOrigin) { // not required + return nil + } + + if err := m.SitHHGActualOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGActualOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGActualOrigin") + } + return err + } + } + + return nil +} + +func (m *MTOServiceItemOriginSIT) contextValidateSitHHGOriginalOrigin(ctx context.Context, formats strfmt.Registry) error { + + if m.SitHHGOriginalOrigin != nil { + + if swag.IsZero(m.SitHHGOriginalOrigin) { // not required + return nil + } + + if err := m.SitHHGOriginalOrigin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitHHGOriginalOrigin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitHHGOriginalOrigin") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemOriginSIT) UnmarshalBinary(b []byte) error { + var res MTOServiceItemOriginSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go b/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..a89fa1024b7 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemShuttle Describes a shuttle service item. +// +// swagger:model MTOServiceItemShuttle +type MTOServiceItemShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item shuttle +func (m *MTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) 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 *MTOServiceItemShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemShuttleTypeReServiceCodePropEnum = append(mTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item shuttle based on the context it is used +func (m *MTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_status.go b/pkg/gen/primev3messages/m_t_o_service_item_status.go new file mode 100644 index 00000000000..7f21cbf7c27 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOServiceItemStatus The status of a service item, indicating where it is in the TOO's approval process. +// +// swagger:model MTOServiceItemStatus +type MTOServiceItemStatus string + +func NewMTOServiceItemStatus(value MTOServiceItemStatus) *MTOServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOServiceItemStatus. +func (m MTOServiceItemStatus) Pointer() *MTOServiceItemStatus { + return &m +} + +const ( + + // MTOServiceItemStatusSUBMITTED captures enum value "SUBMITTED" + MTOServiceItemStatusSUBMITTED MTOServiceItemStatus = "SUBMITTED" + + // MTOServiceItemStatusAPPROVED captures enum value "APPROVED" + MTOServiceItemStatusAPPROVED MTOServiceItemStatus = "APPROVED" + + // MTOServiceItemStatusREJECTED captures enum value "REJECTED" + MTOServiceItemStatusREJECTED MTOServiceItemStatus = "REJECTED" +) + +// for schema +var mTOServiceItemStatusEnum []interface{} + +func init() { + var res []MTOServiceItemStatus + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemStatusEnum = append(mTOServiceItemStatusEnum, v) + } +} + +func (m MTOServiceItemStatus) validateMTOServiceItemStatusEnum(path, location string, value MTOServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o service item status +func (m MTOServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o service item status based on the context it is used +func (m MTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", MTOServiceItemStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_shipment.go b/pkg/gen/primev3messages/m_t_o_shipment.go new file mode 100644 index 00000000000..725608c2257 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_shipment.go @@ -0,0 +1,204 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipment m t o shipment +// +// swagger:model MTOShipment +type MTOShipment struct { + MTOShipmentWithoutServiceItems + + mtoServiceItemsField []MTOServiceItem +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MTOShipment) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MTOShipment) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOShipment) UnmarshalJSON(raw []byte) error { + var data struct { + MTOShipmentWithoutServiceItems + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var propMtoServiceItems []MTOServiceItem + if string(data.MtoServiceItems) != "null" { + mtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + propMtoServiceItems = mtoServiceItems + } + + var result MTOShipment + + result.MTOShipmentWithoutServiceItems = data.MTOShipmentWithoutServiceItems + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOShipment) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + MTOShipmentWithoutServiceItems + }{ + + MTOShipmentWithoutServiceItems: m.MTOShipmentWithoutServiceItems, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o shipment +func (m *MTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) validateMtoServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItems()) { // not required + return nil + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// ContextValidate validate this m t o shipment based on the context it is used +func (m *MTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with MTOShipmentWithoutServiceItems + if err := m.MTOShipmentWithoutServiceItems.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipment) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "mtoServiceItems", "body", []MTOServiceItem(m.MtoServiceItems())); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipment) UnmarshalBinary(b []byte) error { + var res MTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_shipment_type.go b/pkg/gen/primev3messages/m_t_o_shipment_type.go new file mode 100644 index 00000000000..cbcda952606 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_shipment_type.go @@ -0,0 +1,107 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// MTOShipmentType Shipment Type +// +// The type of shipment. +// - `HHG` = Household goods move +// - `HHG_INTO_NTS` = HHG into Non-temporary storage (NTS) +// - `HHG_OUTOF_NTS_DOMESTIC` = HHG out of Non-temporary storage (NTS Release) +// - `PPM` = Personally Procured Move also known as Do It Yourself (DITY) +// - `BOAT_HAUL_AWAY` = Boat shipment that requires additional equipment to haul it to it's destination +// - `BOAT_TOW_AWAY` = Boat shipment that has a road-worthy trailer +// - `MOBILE_HOME` = Mobile Home shipment that a customer may move. +// +// Example: HHG +// +// swagger:model MTOShipmentType +type MTOShipmentType string + +func NewMTOShipmentType(value MTOShipmentType) *MTOShipmentType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated MTOShipmentType. +func (m MTOShipmentType) Pointer() *MTOShipmentType { + return &m +} + +const ( + + // MTOShipmentTypeBOATHAULAWAY captures enum value "BOAT_HAUL_AWAY" + MTOShipmentTypeBOATHAULAWAY MTOShipmentType = "BOAT_HAUL_AWAY" + + // MTOShipmentTypeBOATTOWAWAY captures enum value "BOAT_TOW_AWAY" + MTOShipmentTypeBOATTOWAWAY MTOShipmentType = "BOAT_TOW_AWAY" + + // MTOShipmentTypeHHG captures enum value "HHG" + MTOShipmentTypeHHG MTOShipmentType = "HHG" + + // MTOShipmentTypeHHGINTONTS captures enum value "HHG_INTO_NTS" + MTOShipmentTypeHHGINTONTS MTOShipmentType = "HHG_INTO_NTS" + + // MTOShipmentTypeHHGOUTOFNTSDOMESTIC captures enum value "HHG_OUTOF_NTS_DOMESTIC" + MTOShipmentTypeHHGOUTOFNTSDOMESTIC MTOShipmentType = "HHG_OUTOF_NTS_DOMESTIC" + + // MTOShipmentTypeMOBILEHOME captures enum value "MOBILE_HOME" + MTOShipmentTypeMOBILEHOME MTOShipmentType = "MOBILE_HOME" + + // MTOShipmentTypePPM captures enum value "PPM" + MTOShipmentTypePPM MTOShipmentType = "PPM" + + // MTOShipmentTypeUNACCOMPANIEDBAGGAGE captures enum value "UNACCOMPANIED_BAGGAGE" + MTOShipmentTypeUNACCOMPANIEDBAGGAGE MTOShipmentType = "UNACCOMPANIED_BAGGAGE" +) + +// for schema +var mTOShipmentTypeEnum []interface{} + +func init() { + var res []MTOShipmentType + if err := json.Unmarshal([]byte(`["BOAT_HAUL_AWAY","BOAT_TOW_AWAY","HHG","HHG_INTO_NTS","HHG_OUTOF_NTS_DOMESTIC","MOBILE_HOME","PPM","UNACCOMPANIED_BAGGAGE"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentTypeEnum = append(mTOShipmentTypeEnum, v) + } +} + +func (m MTOShipmentType) validateMTOShipmentTypeEnum(path, location string, value MTOShipmentType) error { + if err := validate.EnumCase(path, location, value, mTOShipmentTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this m t o shipment type +func (m MTOShipmentType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateMTOShipmentTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this m t o shipment type based on context it is used +func (m MTOShipmentType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go b/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go new file mode 100644 index 00000000000..6fff06e8de3 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_shipment_without_service_items.go @@ -0,0 +1,1740 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOShipmentWithoutServiceItems m t o shipment without service items +// +// swagger:model MTOShipmentWithoutServiceItems +type MTOShipmentWithoutServiceItems struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // The actual weight of any pro gear being shipped. + // + ActualProGearWeight *int64 `json:"actualProGearWeight"` + + // The actual weight of any spouse pro gear being shipped. + // + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight"` + + // agents + Agents MTOAgents `json:"agents,omitempty"` + + // The date when the Task Ordering Officer first approved this shipment for the move. + // Read Only: true + // Format: date + ApprovedDate *strfmt.Date `json:"approvedDate"` + + // boat shipment + BoatShipment *BoatShipment `json:"boatShipment,omitempty"` + + // The counselor can use the counselor remarks field to inform the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Counselors enters this information when creating or editing an MTO Shipment. Optional field. + // + // Example: handle with care + // Read Only: true + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // The customer can use the customer remarks field to inform the services counselor and the movers about any + // special circumstances for this shipment. Typical examples: + // * bulky or fragile items, + // * weapons, + // * access info for their address. + // + // Customer enters this information during onboarding. Optional field. + // + // Example: handle with care + // Read Only: true + CustomerRemarks *string `json:"customerRemarks,omitempty"` + + // delivery address update + DeliveryAddressUpdate *ShipmentAddressUpdate `json:"deliveryAddressUpdate,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination rate area + DestinationRateArea *RateArea `json:"destinationRateArea,omitempty"` + + // The SIT authorized end date for destination SIT. + // Format: date + DestinationSitAuthEndDate *strfmt.Date `json:"destinationSitAuthEndDate,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The reason the TOO provided when requesting a diversion for this shipment. + // + // Read Only: true + DiversionReason *string `json:"diversionReason,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The ID of the shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // Single-letter designator for domestic (d) or international (i) shipments + // Example: d + // Enum: [d i] + MarketCode string `json:"marketCode,omitempty"` + + // mobile home shipment + MobileHomeShipment *MobileHome `json:"mobileHomeShipment,omitempty"` + + // The ID of the move for this shipment. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // origin rate area + OriginRateArea *RateArea `json:"originRateArea,omitempty"` + + // The SIT authorized end date for origin SIT. + // Format: date + OriginSitAuthEndDate *strfmt.Date `json:"originSitAuthEndDate,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // port of debarkation + PortOfDebarkation *Port `json:"portOfDebarkation,omitempty"` + + // port of embarkation + PortOfEmbarkation *Port `json:"portOfEmbarkation,omitempty"` + + // ppm shipment + PpmShipment *PPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date when the Prime contractor recorded the shipment's estimated weight. + // Read Only: true + // Format: date + PrimeEstimatedWeightRecordedDate *strfmt.Date `json:"primeEstimatedWeightRecordedDate"` + + // The customer's preferred delivery date. + // Read Only: true + // Format: date + RequestedDeliveryDate *strfmt.Date `json:"requestedDeliveryDate"` + + // The date the customer selects during onboarding as their preferred pickup date. Other dates, such as required delivery date and (outside MilMove) the pack date, are derived from this date. + // + // Read Only: true + // Format: date + RequestedPickupDate *strfmt.Date `json:"requestedPickupDate"` + + // The latest date by which the Prime can deliver a customer's shipment without violating the contract. This is calculated based on weight, distance, and the scheduled pickup date. It cannot be modified. + // + // Read Only: true + // Format: date + RequiredDeliveryDate *strfmt.Date `json:"requiredDeliveryDate"` + + // reweigh + Reweigh *Reweigh `json:"reweigh,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // secondary delivery address + SecondaryDeliveryAddress *Address `json:"secondaryDeliveryAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // sit extensions + SitExtensions SITExtensions `json:"sitExtensions,omitempty"` + + // The status of a shipment, indicating where it is in the TOO's approval process. Can only be updated by the contractor in special circumstances. + // + // Read Only: true + // Enum: [SUBMITTED APPROVED REJECTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] + Status string `json:"status,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // tertiary delivery address + TertiaryDeliveryAddress *Address `json:"tertiaryDeliveryAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this m t o shipment without service items +func (m *MTOShipmentWithoutServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAgents(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateBoatShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDeliveryAddressUpdate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationRateArea(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMarketCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMobileHomeShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginRateArea(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginSitAuthEndDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortOfDebarkation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortOfEmbarkation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeightRecordedDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequiredDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReweigh(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExtensions(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateAgents(formats strfmt.Registry) error { + if swag.IsZero(m.Agents) { // not required + return nil + } + + if err := m.Agents.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateApprovedDate(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedDate) { // not required + return nil + } + + if err := validate.FormatOf("approvedDate", "body", "date", m.ApprovedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateBoatShipment(formats strfmt.Registry) error { + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if m.BoatShipment != nil { + if err := m.BoatShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDeliveryAddressUpdate(formats strfmt.Registry) error { + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if m.DeliveryAddressUpdate != nil { + if err := m.DeliveryAddressUpdate.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationRateArea(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationRateArea) { // not required + return nil + } + + if m.DestinationRateArea != nil { + if err := m.DestinationRateArea.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationRateArea") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("destinationSitAuthEndDate", "body", "date", m.DestinationSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) 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 +} + +var mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["d","i"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum = append(mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsMarketCodeD captures enum value "d" + MTOShipmentWithoutServiceItemsMarketCodeD string = "d" + + // MTOShipmentWithoutServiceItemsMarketCodeI captures enum value "i" + MTOShipmentWithoutServiceItemsMarketCodeI string = "i" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateMarketCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeMarketCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMarketCode(formats strfmt.Registry) error { + if swag.IsZero(m.MarketCode) { // not required + return nil + } + + // value enum + if err := m.validateMarketCodeEnum("marketCode", "body", m.MarketCode); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMobileHomeShipment(formats strfmt.Registry) error { + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if m.MobileHomeShipment != nil { + if err := m.MobileHomeShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateOriginRateArea(formats strfmt.Registry) error { + if swag.IsZero(m.OriginRateArea) { // not required + return nil + } + + if m.OriginRateArea != nil { + if err := m.OriginRateArea.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originRateArea") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateOriginSitAuthEndDate(formats strfmt.Registry) error { + if swag.IsZero(m.OriginSitAuthEndDate) { // not required + return nil + } + + if err := validate.FormatOf("originSitAuthEndDate", "body", "date", m.OriginSitAuthEndDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePortOfDebarkation(formats strfmt.Registry) error { + if swag.IsZero(m.PortOfDebarkation) { // not required + return nil + } + + if m.PortOfDebarkation != nil { + if err := m.PortOfDebarkation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfDebarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfDebarkation") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePortOfEmbarkation(formats strfmt.Registry) error { + if swag.IsZero(m.PortOfEmbarkation) { // not required + return nil + } + + if m.PortOfEmbarkation != nil { + if err := m.PortOfEmbarkation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfEmbarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfEmbarkation") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validatePrimeEstimatedWeightRecordedDate(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeightRecordedDate) { // not required + return nil + } + + if err := validate.FormatOf("primeEstimatedWeightRecordedDate", "body", "date", m.PrimeEstimatedWeightRecordedDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedDeliveryDate", "body", "date", m.RequestedDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequestedPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("requestedPickupDate", "body", "date", m.RequestedPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateRequiredDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.RequiredDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("requiredDeliveryDate", "body", "date", m.RequiredDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateReweigh(formats strfmt.Registry) error { + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if m.Reweigh != nil { + if err := m.Reweigh.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if m.SecondaryDeliveryAddress != nil { + if err := m.SecondaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateSitExtensions(formats strfmt.Registry) error { + if swag.IsZero(m.SitExtensions) { // not required + return nil + } + + if err := m.SitExtensions.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +var mTOShipmentWithoutServiceItemsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SUBMITTED","APPROVED","REJECTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOShipmentWithoutServiceItemsTypeStatusPropEnum = append(mTOShipmentWithoutServiceItemsTypeStatusPropEnum, v) + } +} + +const ( + + // MTOShipmentWithoutServiceItemsStatusSUBMITTED captures enum value "SUBMITTED" + MTOShipmentWithoutServiceItemsStatusSUBMITTED string = "SUBMITTED" + + // MTOShipmentWithoutServiceItemsStatusAPPROVED captures enum value "APPROVED" + MTOShipmentWithoutServiceItemsStatusAPPROVED string = "APPROVED" + + // MTOShipmentWithoutServiceItemsStatusREJECTED captures enum value "REJECTED" + MTOShipmentWithoutServiceItemsStatusREJECTED string = "REJECTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" + + // MTOShipmentWithoutServiceItemsStatusCANCELED captures enum value "CANCELED" + MTOShipmentWithoutServiceItemsStatusCANCELED string = "CANCELED" + + // MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + MTOShipmentWithoutServiceItemsStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" +) + +// prop value enum +func (m *MTOShipmentWithoutServiceItems) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOShipmentWithoutServiceItemsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if m.TertiaryDeliveryAddress != nil { + if err := m.TertiaryDeliveryAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o shipment without service items based on the context it is used +func (m *MTOShipmentWithoutServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAgents(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateApprovedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateBoatShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCounselorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCustomerRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDeliveryAddressUpdate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationRateArea(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDiversionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMobileHomeShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveTaskOrderID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginRateArea(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePortOfDebarkation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePortOfEmbarkation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeEstimatedWeightRecordedDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedPickupDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequiredDeliveryDate(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReweigh(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitExtensions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateAgents(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Agents.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("agents") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("agents") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateApprovedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedDate", "body", m.ApprovedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateBoatShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.BoatShipment != nil { + + if swag.IsZero(m.BoatShipment) { // not required + return nil + } + + if err := m.BoatShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("boatShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("boatShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCounselorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "counselorRemarks", "body", m.CounselorRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateCustomerRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "customerRemarks", "body", m.CustomerRemarks); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDeliveryAddressUpdate(ctx context.Context, formats strfmt.Registry) error { + + if m.DeliveryAddressUpdate != nil { + + if swag.IsZero(m.DeliveryAddressUpdate) { // not required + return nil + } + + if err := m.DeliveryAddressUpdate.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("deliveryAddressUpdate") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("deliveryAddressUpdate") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationRateArea(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationRateArea != nil { + + if swag.IsZero(m.DestinationRateArea) { // not required + return nil + } + + if err := m.DestinationRateArea.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationRateArea") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateDiversionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "diversionReason", "body", m.DiversionReason); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateMobileHomeShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.MobileHomeShipment != nil { + + if swag.IsZero(m.MobileHomeShipment) { // not required + return nil + } + + if err := m.MobileHomeShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mobileHomeShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mobileHomeShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateMoveTaskOrderID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveTaskOrderID", "body", strfmt.UUID(m.MoveTaskOrderID)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateOriginRateArea(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginRateArea != nil { + + if swag.IsZero(m.OriginRateArea) { // not required + return nil + } + + if err := m.OriginRateArea.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originRateArea") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePortOfDebarkation(ctx context.Context, formats strfmt.Registry) error { + + if m.PortOfDebarkation != nil { + + if swag.IsZero(m.PortOfDebarkation) { // not required + return nil + } + + if err := m.PortOfDebarkation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfDebarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfDebarkation") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePortOfEmbarkation(ctx context.Context, formats strfmt.Registry) error { + + if m.PortOfEmbarkation != nil { + + if swag.IsZero(m.PortOfEmbarkation) { // not required + return nil + } + + if err := m.PortOfEmbarkation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfEmbarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfEmbarkation") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidatePrimeEstimatedWeightRecordedDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeEstimatedWeightRecordedDate", "body", m.PrimeEstimatedWeightRecordedDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedDeliveryDate", "body", m.RequestedDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequestedPickupDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requestedPickupDate", "body", m.RequestedPickupDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateRequiredDeliveryDate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "requiredDeliveryDate", "body", m.RequiredDeliveryDate); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateReweigh(ctx context.Context, formats strfmt.Registry) error { + + if m.Reweigh != nil { + + if swag.IsZero(m.Reweigh) { // not required + return nil + } + + if err := m.Reweigh.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("reweigh") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("reweigh") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDeliveryAddress != nil { + + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + if err := m.SecondaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateSitExtensions(ctx context.Context, formats strfmt.Registry) error { + + if err := m.SitExtensions.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitExtensions") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitExtensions") + } + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "status", "body", string(m.Status)); err != nil { + return err + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDeliveryAddress != nil { + + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + if err := m.TertiaryDeliveryAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDeliveryAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDeliveryAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *MTOShipmentWithoutServiceItems) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOShipmentWithoutServiceItems) UnmarshalBinary(b []byte) error { + var res MTOShipmentWithoutServiceItems + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go b/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go new file mode 100644 index 00000000000..71ebac8e852 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_shipments_without_service_objects.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// MTOShipmentsWithoutServiceObjects A list of shipments without their associated service items. +// +// swagger:model MTOShipmentsWithoutServiceObjects +type MTOShipmentsWithoutServiceObjects []*MTOShipmentWithoutServiceItems + +// Validate validates this m t o shipments without service objects +func (m MTOShipmentsWithoutServiceObjects) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this m t o shipments without service objects based on the context it is used +func (m MTOShipmentsWithoutServiceObjects) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/mobile_home.go b/pkg/gen/primev3messages/mobile_home.go new file mode 100644 index 00000000000..7358b0a8421 --- /dev/null +++ b/pkg/gen/primev3messages/mobile_home.go @@ -0,0 +1,232 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MobileHome A mobile home is a type of shipment that a service member moves a mobile home. +// +// swagger:model MobileHome +type MobileHome struct { + + // Timestamp of when a property of this object was created (UTC) + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // height in inches + HeightInInches int64 `json:"heightInInches,omitempty"` + + // Primary auto-generated unique identifier of the Mobile Home object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // length in inches + LengthInInches int64 `json:"lengthInInches,omitempty"` + + // The make of the mobile home + Make string `json:"make,omitempty"` + + // The model of the mobile home. + Model string `json:"model,omitempty"` + + // The id of the parent MTOShipment object + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId,omitempty"` + + // Timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // width in inches + WidthInInches int64 `json:"widthInInches,omitempty"` + + // The year the mobile home was made. + Year int64 `json:"year,omitempty"` +} + +// Validate validates this mobile home +func (m *MobileHome) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) 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 *MobileHome) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this mobile home based on the context it is used +func (m *MobileHome) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MobileHome) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *MobileHome) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MobileHome) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MobileHome) UnmarshalBinary(b []byte) error { + var res MobileHome + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/move_task_order.go b/pkg/gen/primev3messages/move_task_order.go new file mode 100644 index 00000000000..02b991a0a16 --- /dev/null +++ b/pkg/gen/primev3messages/move_task_order.go @@ -0,0 +1,965 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MoveTaskOrder move task order +// +// swagger:model MoveTaskOrder +type MoveTaskOrder struct { + + // approved at + // Read Only: true + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + // available to prime at + // Read Only: true + // Format: date-time + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + // contract number + // Read Only: true + ContractNumber string `json:"contractNumber,omitempty"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // destination g b l o c + // Example: KKFA + // Read Only: true + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + // destination postal code + // Example: 90210 + // Read Only: true + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // excess weight acknowledged at + // Read Only: true + // Format: date-time + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + // excess weight qualified at + // Read Only: true + // Format: date-time + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + // excess weight upload Id + // Read Only: true + // Format: uuid + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + // id + // Example: a502b4f1-b9c4-4faf-8bdd-68292501bf26 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move code + // Example: HYXFJF + // Read Only: true + MoveCode string `json:"moveCode,omitempty"` + + mtoServiceItemsField []MTOServiceItem + + // mto shipments + // Required: true + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + // order + Order *Order `json:"order,omitempty"` + + // order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + OrderID strfmt.UUID `json:"orderID,omitempty"` + + // payment requests + // Required: true + PaymentRequests PaymentRequests `json:"paymentRequests"` + + // ppm estimated weight + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + // ppm type + // Enum: [PARTIAL FULL] + PpmType string `json:"ppmType,omitempty"` + + // prime counseling completed at + // Read Only: true + // Format: date-time + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + // reference Id + // Example: 1001-3456 + ReferenceID string `json:"referenceId,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// MtoServiceItems gets the mto service items of this base type +func (m *MoveTaskOrder) MtoServiceItems() []MTOServiceItem { + return m.mtoServiceItemsField +} + +// SetMtoServiceItems sets the mto service items of this base type +func (m *MoveTaskOrder) SetMtoServiceItems(val []MTOServiceItem) { + m.mtoServiceItemsField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MoveTaskOrder) UnmarshalJSON(raw []byte) error { + var data struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + ContractNumber string `json:"contractNumber,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoServiceItems json.RawMessage `json:"mtoServiceItems"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + propMtoServiceItems, err := UnmarshalMTOServiceItemSlice(bytes.NewBuffer(data.MtoServiceItems), runtime.JSONConsumer()) + if err != nil && err != io.EOF { + return err + } + + var result MoveTaskOrder + + // approvedAt + result.ApprovedAt = data.ApprovedAt + + // availableToPrimeAt + result.AvailableToPrimeAt = data.AvailableToPrimeAt + + // contractNumber + result.ContractNumber = data.ContractNumber + + // createdAt + result.CreatedAt = data.CreatedAt + + // destinationGBLOC + result.DestinationGBLOC = data.DestinationGBLOC + + // destinationPostalCode + result.DestinationPostalCode = data.DestinationPostalCode + + // eTag + result.ETag = data.ETag + + // excessWeightAcknowledgedAt + result.ExcessWeightAcknowledgedAt = data.ExcessWeightAcknowledgedAt + + // excessWeightQualifiedAt + result.ExcessWeightQualifiedAt = data.ExcessWeightQualifiedAt + + // excessWeightUploadId + result.ExcessWeightUploadID = data.ExcessWeightUploadID + + // id + result.ID = data.ID + + // moveCode + result.MoveCode = data.MoveCode + + // mtoServiceItems + result.mtoServiceItemsField = propMtoServiceItems + + // mtoShipments + result.MtoShipments = data.MtoShipments + + // order + result.Order = data.Order + + // orderID + result.OrderID = data.OrderID + + // paymentRequests + result.PaymentRequests = data.PaymentRequests + + // ppmEstimatedWeight + result.PpmEstimatedWeight = data.PpmEstimatedWeight + + // ppmType + result.PpmType = data.PpmType + + // primeCounselingCompletedAt + result.PrimeCounselingCompletedAt = data.PrimeCounselingCompletedAt + + // referenceId + result.ReferenceID = data.ReferenceID + + // updatedAt + result.UpdatedAt = data.UpdatedAt + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MoveTaskOrder) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + ApprovedAt *strfmt.DateTime `json:"approvedAt,omitempty"` + + AvailableToPrimeAt *strfmt.DateTime `json:"availableToPrimeAt,omitempty"` + + ContractNumber string `json:"contractNumber,omitempty"` + + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + DestinationGBLOC string `json:"destinationGBLOC,omitempty"` + + DestinationPostalCode string `json:"destinationPostalCode,omitempty"` + + ETag string `json:"eTag,omitempty"` + + ExcessWeightAcknowledgedAt *strfmt.DateTime `json:"excessWeightAcknowledgedAt"` + + ExcessWeightQualifiedAt *strfmt.DateTime `json:"excessWeightQualifiedAt"` + + ExcessWeightUploadID *strfmt.UUID `json:"excessWeightUploadId"` + + ID strfmt.UUID `json:"id,omitempty"` + + MoveCode string `json:"moveCode,omitempty"` + + MtoShipments MTOShipmentsWithoutServiceObjects `json:"mtoShipments"` + + Order *Order `json:"order,omitempty"` + + OrderID strfmt.UUID `json:"orderID,omitempty"` + + PaymentRequests PaymentRequests `json:"paymentRequests"` + + PpmEstimatedWeight int64 `json:"ppmEstimatedWeight,omitempty"` + + PpmType string `json:"ppmType,omitempty"` + + PrimeCounselingCompletedAt *strfmt.DateTime `json:"primeCounselingCompletedAt,omitempty"` + + ReferenceID string `json:"referenceId,omitempty"` + + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + }{ + + ApprovedAt: m.ApprovedAt, + + AvailableToPrimeAt: m.AvailableToPrimeAt, + + ContractNumber: m.ContractNumber, + + CreatedAt: m.CreatedAt, + + DestinationGBLOC: m.DestinationGBLOC, + + DestinationPostalCode: m.DestinationPostalCode, + + ETag: m.ETag, + + ExcessWeightAcknowledgedAt: m.ExcessWeightAcknowledgedAt, + + ExcessWeightQualifiedAt: m.ExcessWeightQualifiedAt, + + ExcessWeightUploadID: m.ExcessWeightUploadID, + + ID: m.ID, + + MoveCode: m.MoveCode, + + MtoShipments: m.MtoShipments, + + Order: m.Order, + + OrderID: m.OrderID, + + PaymentRequests: m.PaymentRequests, + + PpmEstimatedWeight: m.PpmEstimatedWeight, + + PpmType: m.PpmType, + + PrimeCounselingCompletedAt: m.PrimeCounselingCompletedAt, + + ReferenceID: m.ReferenceID, + + UpdatedAt: m.UpdatedAt, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + MtoServiceItems []MTOServiceItem `json:"mtoServiceItems"` + }{ + + MtoServiceItems: m.mtoServiceItemsField, + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this move task order +func (m *MoveTaskOrder) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateAvailableToPrimeAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightAcknowledgedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightQualifiedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExcessWeightUploadID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrder(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequests(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmType(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeCounselingCompletedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateAvailableToPrimeAt(formats strfmt.Registry) error { + if swag.IsZero(m.AvailableToPrimeAt) { // not required + return nil + } + + if err := validate.FormatOf("availableToPrimeAt", "body", "date-time", m.AvailableToPrimeAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightAcknowledgedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightAcknowledgedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightAcknowledgedAt", "body", "date-time", m.ExcessWeightAcknowledgedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightQualifiedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightQualifiedAt) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightQualifiedAt", "body", "date-time", m.ExcessWeightQualifiedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateExcessWeightUploadID(formats strfmt.Registry) error { + if swag.IsZero(m.ExcessWeightUploadID) { // not required + return nil + } + + if err := validate.FormatOf("excessWeightUploadId", "body", "uuid", m.ExcessWeightUploadID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) 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 *MoveTaskOrder) validateMtoServiceItems(formats strfmt.Registry) error { + + if err := validate.Required("mtoServiceItems", "body", m.MtoServiceItems()); err != nil { + return err + } + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if err := m.mtoServiceItemsField[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) validateMtoShipments(formats strfmt.Registry) error { + + if err := validate.Required("mtoShipments", "body", m.MtoShipments); err != nil { + return err + } + + if err := m.MtoShipments.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateOrder(formats strfmt.Registry) error { + if swag.IsZero(m.Order) { // not required + return nil + } + + if m.Order != nil { + if err := m.Order.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) validateOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.OrderID) { // not required + return nil + } + + if err := validate.FormatOf("orderID", "body", "uuid", m.OrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePaymentRequests(formats strfmt.Registry) error { + + if err := validate.Required("paymentRequests", "body", m.PaymentRequests); err != nil { + return err + } + + if err := m.PaymentRequests.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +var moveTaskOrderTypePpmTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["PARTIAL","FULL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + moveTaskOrderTypePpmTypePropEnum = append(moveTaskOrderTypePpmTypePropEnum, v) + } +} + +const ( + + // MoveTaskOrderPpmTypePARTIAL captures enum value "PARTIAL" + MoveTaskOrderPpmTypePARTIAL string = "PARTIAL" + + // MoveTaskOrderPpmTypeFULL captures enum value "FULL" + MoveTaskOrderPpmTypeFULL string = "FULL" +) + +// prop value enum +func (m *MoveTaskOrder) validatePpmTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, moveTaskOrderTypePpmTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MoveTaskOrder) validatePpmType(formats strfmt.Registry) error { + if swag.IsZero(m.PpmType) { // not required + return nil + } + + // value enum + if err := m.validatePpmTypeEnum("ppmType", "body", m.PpmType); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validatePrimeCounselingCompletedAt(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeCounselingCompletedAt) { // not required + return nil + } + + if err := validate.FormatOf("primeCounselingCompletedAt", "body", "date-time", m.PrimeCounselingCompletedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this move task order based on the context it is used +func (m *MoveTaskOrder) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApprovedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateAvailableToPrimeAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateContractNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationGBLOC(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationPostalCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightAcknowledgedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightQualifiedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateExcessWeightUploadID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMoveCode(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMtoShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrder(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequests(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePrimeCounselingCompletedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MoveTaskOrder) contextValidateApprovedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "approvedAt", "body", m.ApprovedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateAvailableToPrimeAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "availableToPrimeAt", "body", m.AvailableToPrimeAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateContractNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractNumber", "body", string(m.ContractNumber)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationGBLOC(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationGBLOC", "body", string(m.DestinationGBLOC)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateDestinationPostalCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "destinationPostalCode", "body", string(m.DestinationPostalCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightAcknowledgedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightAcknowledgedAt", "body", m.ExcessWeightAcknowledgedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightQualifiedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightQualifiedAt", "body", m.ExcessWeightQualifiedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateExcessWeightUploadID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "excessWeightUploadId", "body", m.ExcessWeightUploadID); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMoveCode(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "moveCode", "body", string(m.MoveCode)); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoServiceItems(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.MtoServiceItems()); i++ { + + if swag.IsZero(m.mtoServiceItemsField[i]) { // not required + return nil + } + + if err := m.mtoServiceItemsField[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoServiceItems" + "." + strconv.Itoa(i)) + } + return err + } + + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateMtoShipments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.MtoShipments.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("mtoShipments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("mtoShipments") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateOrder(ctx context.Context, formats strfmt.Registry) error { + + if m.Order != nil { + + if swag.IsZero(m.Order) { // not required + return nil + } + + if err := m.Order.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("order") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("order") + } + return err + } + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePaymentRequests(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentRequests.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentRequests") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentRequests") + } + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidatePrimeCounselingCompletedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "primeCounselingCompletedAt", "body", m.PrimeCounselingCompletedAt); err != nil { + return err + } + + return nil +} + +func (m *MoveTaskOrder) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MoveTaskOrder) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MoveTaskOrder) UnmarshalBinary(b []byte) error { + var res MoveTaskOrder + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/order.go b/pkg/gen/primev3messages/order.go new file mode 100644 index 00000000000..e4b6fafdfb5 --- /dev/null +++ b/pkg/gen/primev3messages/order.go @@ -0,0 +1,516 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Order order +// +// swagger:model Order +type Order struct { + + // customer + Customer *Customer `json:"customer,omitempty"` + + // customer ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + CustomerID strfmt.UUID `json:"customerID,omitempty"` + + // destination duty location + DestinationDutyLocation *DutyLocation `json:"destinationDutyLocation,omitempty"` + + // destination duty location g b l o c + // Example: KKFA + DestinationDutyLocationGBLOC string `json:"destinationDutyLocationGBLOC,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // entitlement + Entitlement *Entitlements `json:"entitlement,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lines of accounting + // Required: true + LinesOfAccounting *string `json:"linesOfAccounting"` + + // method of payment + // Read Only: true + MethodOfPayment string `json:"methodOfPayment,omitempty"` + + // naics + // Read Only: true + Naics string `json:"naics,omitempty"` + + // order number + // Required: true + OrderNumber *string `json:"orderNumber"` + + // orders type + OrdersType OrdersType `json:"ordersType,omitempty"` + + // origin duty location + OriginDutyLocation *DutyLocation `json:"originDutyLocation,omitempty"` + + // origin duty location g b l o c + // Example: KKFA + OriginDutyLocationGBLOC string `json:"originDutyLocationGBLOC,omitempty"` + + // packing and shipping instructions + // Read Only: true + PackingAndShippingInstructions string `json:"packingAndShippingInstructions,omitempty"` + + // rank + // Example: E_5 + // Required: true + Rank *string `json:"rank"` + + // report by date + // Format: date + ReportByDate strfmt.Date `json:"reportByDate,omitempty"` + + // supply and services cost estimate + // Read Only: true + SupplyAndServicesCostEstimate string `json:"supplyAndServicesCostEstimate,omitempty"` +} + +// Validate validates this order +func (m *Order) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCustomer(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCustomerID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEntitlement(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateLinesOfAccounting(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrderNumber(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrdersType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginDutyLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRank(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReportByDate(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) validateCustomer(formats strfmt.Registry) error { + if swag.IsZero(m.Customer) { // not required + return nil + } + + if m.Customer != nil { + if err := m.Customer.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) validateCustomerID(formats strfmt.Registry) error { + if swag.IsZero(m.CustomerID) { // not required + return nil + } + + if err := validate.FormatOf("customerID", "body", "uuid", m.CustomerID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Order) validateDestinationDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if m.DestinationDutyLocation != nil { + if err := m.DestinationDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateEntitlement(formats strfmt.Registry) error { + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if m.Entitlement != nil { + if err := m.Entitlement.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) 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 *Order) validateLinesOfAccounting(formats strfmt.Registry) error { + + if err := validate.Required("linesOfAccounting", "body", m.LinesOfAccounting); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrderNumber(formats strfmt.Registry) error { + + if err := validate.Required("orderNumber", "body", m.OrderNumber); err != nil { + return err + } + + return nil +} + +func (m *Order) validateOrdersType(formats strfmt.Registry) error { + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) validateOriginDutyLocation(formats strfmt.Registry) error { + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if m.OriginDutyLocation != nil { + if err := m.OriginDutyLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) validateRank(formats strfmt.Registry) error { + + if err := validate.Required("rank", "body", m.Rank); err != nil { + return err + } + + return nil +} + +func (m *Order) validateReportByDate(formats strfmt.Registry) error { + if swag.IsZero(m.ReportByDate) { // not required + return nil + } + + if err := validate.FormatOf("reportByDate", "body", "date", m.ReportByDate.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this order based on the context it is used +func (m *Order) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCustomer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateEntitlement(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateMethodOfPayment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNaics(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrdersType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginDutyLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePackingAndShippingInstructions(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSupplyAndServicesCostEstimate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Order) contextValidateCustomer(ctx context.Context, formats strfmt.Registry) error { + + if m.Customer != nil { + + if swag.IsZero(m.Customer) { // not required + return nil + } + + if err := m.Customer.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("customer") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("customer") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateDestinationDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationDutyLocation != nil { + + if swag.IsZero(m.DestinationDutyLocation) { // not required + return nil + } + + if err := m.DestinationDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateEntitlement(ctx context.Context, formats strfmt.Registry) error { + + if m.Entitlement != nil { + + if swag.IsZero(m.Entitlement) { // not required + return nil + } + + if err := m.Entitlement.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("entitlement") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("entitlement") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidateMethodOfPayment(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "methodOfPayment", "body", string(m.MethodOfPayment)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateNaics(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "naics", "body", string(m.Naics)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateOrdersType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.OrdersType) { // not required + return nil + } + + if err := m.OrdersType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ordersType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ordersType") + } + return err + } + + return nil +} + +func (m *Order) contextValidateOriginDutyLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginDutyLocation != nil { + + if swag.IsZero(m.OriginDutyLocation) { // not required + return nil + } + + if err := m.OriginDutyLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originDutyLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originDutyLocation") + } + return err + } + } + + return nil +} + +func (m *Order) contextValidatePackingAndShippingInstructions(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "packingAndShippingInstructions", "body", string(m.PackingAndShippingInstructions)); err != nil { + return err + } + + return nil +} + +func (m *Order) contextValidateSupplyAndServicesCostEstimate(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "supplyAndServicesCostEstimate", "body", string(m.SupplyAndServicesCostEstimate)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Order) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Order) UnmarshalBinary(b []byte) error { + var res Order + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/orders_type.go b/pkg/gen/primev3messages/orders_type.go new file mode 100644 index 00000000000..ee3a1d78344 --- /dev/null +++ b/pkg/gen/primev3messages/orders_type.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersType Orders type +// +// swagger:model OrdersType +type OrdersType string + +func NewOrdersType(value OrdersType) *OrdersType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersType. +func (m OrdersType) Pointer() *OrdersType { + return &m +} + +const ( + + // OrdersTypePERMANENTCHANGEOFSTATION captures enum value "PERMANENT_CHANGE_OF_STATION" + OrdersTypePERMANENTCHANGEOFSTATION OrdersType = "PERMANENT_CHANGE_OF_STATION" + + // OrdersTypeLOCALMOVE captures enum value "LOCAL_MOVE" + OrdersTypeLOCALMOVE OrdersType = "LOCAL_MOVE" + + // OrdersTypeRETIREMENT captures enum value "RETIREMENT" + OrdersTypeRETIREMENT OrdersType = "RETIREMENT" + + // OrdersTypeSEPARATION captures enum value "SEPARATION" + OrdersTypeSEPARATION OrdersType = "SEPARATION" + + // OrdersTypeWOUNDEDWARRIOR captures enum value "WOUNDED_WARRIOR" + OrdersTypeWOUNDEDWARRIOR OrdersType = "WOUNDED_WARRIOR" + + // OrdersTypeBLUEBARK captures enum value "BLUEBARK" + OrdersTypeBLUEBARK OrdersType = "BLUEBARK" + + // OrdersTypeSAFETY captures enum value "SAFETY" + OrdersTypeSAFETY OrdersType = "SAFETY" + + // OrdersTypeTEMPORARYDUTY captures enum value "TEMPORARY_DUTY" + OrdersTypeTEMPORARYDUTY OrdersType = "TEMPORARY_DUTY" + + // OrdersTypeEARLYRETURNOFDEPENDENTS captures enum value "EARLY_RETURN_OF_DEPENDENTS" + OrdersTypeEARLYRETURNOFDEPENDENTS OrdersType = "EARLY_RETURN_OF_DEPENDENTS" + + // OrdersTypeSTUDENTTRAVEL captures enum value "STUDENT_TRAVEL" + OrdersTypeSTUDENTTRAVEL OrdersType = "STUDENT_TRAVEL" +) + +// for schema +var ordersTypeEnum []interface{} + +func init() { + var res []OrdersType + if err := json.Unmarshal([]byte(`["PERMANENT_CHANGE_OF_STATION","LOCAL_MOVE","RETIREMENT","SEPARATION","WOUNDED_WARRIOR","BLUEBARK","SAFETY","TEMPORARY_DUTY","EARLY_RETURN_OF_DEPENDENTS","STUDENT_TRAVEL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeEnum = append(ordersTypeEnum, v) + } +} + +func (m OrdersType) validateOrdersTypeEnum(path, location string, value OrdersType) error { + if err := validate.EnumCase(path, location, value, ordersTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type +func (m OrdersType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type based on context it is used +func (m OrdersType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/p_p_m_destination_address.go b/pkg/gen/primev3messages/p_p_m_destination_address.go new file mode 100644 index 00000000000..8d5640f1047 --- /dev/null +++ b/pkg/gen/primev3messages/p_p_m_destination_address.go @@ -0,0 +1,379 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMDestinationAddress A postal address +// +// swagger:model PPMDestinationAddress +type PPMDestinationAddress struct { + + // City + // Example: Anytown + // Required: true + City *string `json:"city"` + + // Country + // Example: USA + Country *string `json:"country,omitempty"` + + // County + // Example: LOS ANGELES + County *string `json:"county,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // ZIP + // Example: 90210 + // Required: true + // Pattern: ^(\d{5}([\-]\d{4})?)$ + PostalCode *string `json:"postalCode"` + + // State + // Required: true + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State *string `json:"state"` + + // Street address 1 + // Example: 123 Main Ave + StreetAddress1 *string `json:"streetAddress1,omitempty"` + + // Street address 2 + // Example: Apartment 9000 + StreetAddress2 *string `json:"streetAddress2,omitempty"` + + // Address Line 3 + // Example: Montmârtre + StreetAddress3 *string `json:"streetAddress3,omitempty"` + + // us post region cities ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + UsPostRegionCitiesID strfmt.UUID `json:"usPostRegionCitiesID,omitempty"` +} + +// Validate validates this p p m destination address +func (m *PPMDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCity(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUsPostRegionCitiesID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) validateCity(formats strfmt.Registry) error { + + if err := validate.Required("city", "body", m.City); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) 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 *PPMDestinationAddress) validatePostalCode(formats strfmt.Registry) error { + + if err := validate.Required("postalCode", "body", m.PostalCode); err != nil { + return err + } + + if err := validate.Pattern("postalCode", "body", *m.PostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +var pPMDestinationAddressTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMDestinationAddressTypeStatePropEnum = append(pPMDestinationAddressTypeStatePropEnum, v) + } +} + +const ( + + // PPMDestinationAddressStateAL captures enum value "AL" + PPMDestinationAddressStateAL string = "AL" + + // PPMDestinationAddressStateAK captures enum value "AK" + PPMDestinationAddressStateAK string = "AK" + + // PPMDestinationAddressStateAR captures enum value "AR" + PPMDestinationAddressStateAR string = "AR" + + // PPMDestinationAddressStateAZ captures enum value "AZ" + PPMDestinationAddressStateAZ string = "AZ" + + // PPMDestinationAddressStateCA captures enum value "CA" + PPMDestinationAddressStateCA string = "CA" + + // PPMDestinationAddressStateCO captures enum value "CO" + PPMDestinationAddressStateCO string = "CO" + + // PPMDestinationAddressStateCT captures enum value "CT" + PPMDestinationAddressStateCT string = "CT" + + // PPMDestinationAddressStateDC captures enum value "DC" + PPMDestinationAddressStateDC string = "DC" + + // PPMDestinationAddressStateDE captures enum value "DE" + PPMDestinationAddressStateDE string = "DE" + + // PPMDestinationAddressStateFL captures enum value "FL" + PPMDestinationAddressStateFL string = "FL" + + // PPMDestinationAddressStateGA captures enum value "GA" + PPMDestinationAddressStateGA string = "GA" + + // PPMDestinationAddressStateHI captures enum value "HI" + PPMDestinationAddressStateHI string = "HI" + + // PPMDestinationAddressStateIA captures enum value "IA" + PPMDestinationAddressStateIA string = "IA" + + // PPMDestinationAddressStateID captures enum value "ID" + PPMDestinationAddressStateID string = "ID" + + // PPMDestinationAddressStateIL captures enum value "IL" + PPMDestinationAddressStateIL string = "IL" + + // PPMDestinationAddressStateIN captures enum value "IN" + PPMDestinationAddressStateIN string = "IN" + + // PPMDestinationAddressStateKS captures enum value "KS" + PPMDestinationAddressStateKS string = "KS" + + // PPMDestinationAddressStateKY captures enum value "KY" + PPMDestinationAddressStateKY string = "KY" + + // PPMDestinationAddressStateLA captures enum value "LA" + PPMDestinationAddressStateLA string = "LA" + + // PPMDestinationAddressStateMA captures enum value "MA" + PPMDestinationAddressStateMA string = "MA" + + // PPMDestinationAddressStateMD captures enum value "MD" + PPMDestinationAddressStateMD string = "MD" + + // PPMDestinationAddressStateME captures enum value "ME" + PPMDestinationAddressStateME string = "ME" + + // PPMDestinationAddressStateMI captures enum value "MI" + PPMDestinationAddressStateMI string = "MI" + + // PPMDestinationAddressStateMN captures enum value "MN" + PPMDestinationAddressStateMN string = "MN" + + // PPMDestinationAddressStateMO captures enum value "MO" + PPMDestinationAddressStateMO string = "MO" + + // PPMDestinationAddressStateMS captures enum value "MS" + PPMDestinationAddressStateMS string = "MS" + + // PPMDestinationAddressStateMT captures enum value "MT" + PPMDestinationAddressStateMT string = "MT" + + // PPMDestinationAddressStateNC captures enum value "NC" + PPMDestinationAddressStateNC string = "NC" + + // PPMDestinationAddressStateND captures enum value "ND" + PPMDestinationAddressStateND string = "ND" + + // PPMDestinationAddressStateNE captures enum value "NE" + PPMDestinationAddressStateNE string = "NE" + + // PPMDestinationAddressStateNH captures enum value "NH" + PPMDestinationAddressStateNH string = "NH" + + // PPMDestinationAddressStateNJ captures enum value "NJ" + PPMDestinationAddressStateNJ string = "NJ" + + // PPMDestinationAddressStateNM captures enum value "NM" + PPMDestinationAddressStateNM string = "NM" + + // PPMDestinationAddressStateNV captures enum value "NV" + PPMDestinationAddressStateNV string = "NV" + + // PPMDestinationAddressStateNY captures enum value "NY" + PPMDestinationAddressStateNY string = "NY" + + // PPMDestinationAddressStateOH captures enum value "OH" + PPMDestinationAddressStateOH string = "OH" + + // PPMDestinationAddressStateOK captures enum value "OK" + PPMDestinationAddressStateOK string = "OK" + + // PPMDestinationAddressStateOR captures enum value "OR" + PPMDestinationAddressStateOR string = "OR" + + // PPMDestinationAddressStatePA captures enum value "PA" + PPMDestinationAddressStatePA string = "PA" + + // PPMDestinationAddressStateRI captures enum value "RI" + PPMDestinationAddressStateRI string = "RI" + + // PPMDestinationAddressStateSC captures enum value "SC" + PPMDestinationAddressStateSC string = "SC" + + // PPMDestinationAddressStateSD captures enum value "SD" + PPMDestinationAddressStateSD string = "SD" + + // PPMDestinationAddressStateTN captures enum value "TN" + PPMDestinationAddressStateTN string = "TN" + + // PPMDestinationAddressStateTX captures enum value "TX" + PPMDestinationAddressStateTX string = "TX" + + // PPMDestinationAddressStateUT captures enum value "UT" + PPMDestinationAddressStateUT string = "UT" + + // PPMDestinationAddressStateVA captures enum value "VA" + PPMDestinationAddressStateVA string = "VA" + + // PPMDestinationAddressStateVT captures enum value "VT" + PPMDestinationAddressStateVT string = "VT" + + // PPMDestinationAddressStateWA captures enum value "WA" + PPMDestinationAddressStateWA string = "WA" + + // PPMDestinationAddressStateWI captures enum value "WI" + PPMDestinationAddressStateWI string = "WI" + + // PPMDestinationAddressStateWV captures enum value "WV" + PPMDestinationAddressStateWV string = "WV" + + // PPMDestinationAddressStateWY captures enum value "WY" + PPMDestinationAddressStateWY string = "WY" +) + +// prop value enum +func (m *PPMDestinationAddress) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, pPMDestinationAddressTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *PPMDestinationAddress) validateState(formats strfmt.Registry) error { + + if err := validate.Required("state", "body", m.State); err != nil { + return err + } + + // value enum + if err := m.validateStateEnum("state", "body", *m.State); err != nil { + return err + } + + return nil +} + +func (m *PPMDestinationAddress) validateUsPostRegionCitiesID(formats strfmt.Registry) error { + if swag.IsZero(m.UsPostRegionCitiesID) { // not required + return nil + } + + if err := validate.FormatOf("usPostRegionCitiesID", "body", "uuid", m.UsPostRegionCitiesID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m destination address based on the context it is used +func (m *PPMDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMDestinationAddress) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMDestinationAddress) UnmarshalBinary(b []byte) error { + var res PPMDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/p_p_m_shipment.go b/pkg/gen/primev3messages/p_p_m_shipment.go new file mode 100644 index 00000000000..a765ef630c1 --- /dev/null +++ b/pkg/gen/primev3messages/p_p_m_shipment.go @@ -0,0 +1,1003 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PPMShipment A personally procured move is a type of shipment that a service member moves themselves. +// +// swagger:model PPMShipment +type PPMShipment struct { + + // ZIP + // + // The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualDestinationPostalCode *string `json:"actualDestinationPostalCode"` + + // The actual start date of when the PPM shipment left the origin. + // Format: date + ActualMoveDate *strfmt.Date `json:"actualMoveDate"` + + // ZIP + // + // The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. + // + // Example: 90210 + // Pattern: ^(\d{5})$ + ActualPickupPostalCode *string `json:"actualPickupPostalCode"` + + // The amount received for an advance, or null if no advance is received. + // + AdvanceAmountReceived *int64 `json:"advanceAmountReceived"` + + // The amount requested as an advance by the service member, up to a maximum percentage of the estimated incentive. + // + AdvanceAmountRequested *int64 `json:"advanceAmountRequested"` + + // The timestamp of when the shipment was approved and the service member can begin their move. + // Format: date-time + ApprovedAt *strfmt.DateTime `json:"approvedAt"` + + // The timestamp of when the PPM shipment was created (UTC) + // Required: true + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt"` + + // destination address + // Required: true + DestinationAddress *PPMDestinationAddress `json:"destinationAddress"` + + // destination rate area + DestinationRateArea *RateArea `json:"destinationRateArea,omitempty"` + + // A hash unique to this shipment that should be used as the "If-Match" header for any updates. + // Required: true + // Read Only: true + ETag string `json:"eTag"` + + // The estimated amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + EstimatedIncentive *int64 `json:"estimatedIncentive"` + + // The estimated weight of the PPM shipment goods being moved in pounds. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Date the customer expects to begin moving from their origin. + // + // Required: true + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear"` + + // Indicates whether an advance was received for the PPM shipment. + // + HasReceivedAdvance *bool `json:"hasReceivedAdvance"` + + // Indicates whether an advance has been requested for the PPM shipment. + // + HasRequestedAdvance *bool `json:"hasRequestedAdvance"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // The primary unique identifier of this PPM shipment + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The max amount the government will pay the service member to move their belongings based on the moving date, locations, and shipment weight. + MaxIncentive *int64 `json:"maxIncentive"` + + // origin rate area + OriginRateArea *RateArea `json:"originRateArea,omitempty"` + + // pickup address + // Required: true + PickupAddress *Address `json:"pickupAddress"` + + // The estimated weight of the pro-gear being moved belonging to the service member in pounds. + ProGearWeight *int64 `json:"proGearWeight"` + + // The timestamp of when the Service Counselor has reviewed all of the closeout documents. + // Format: date-time + ReviewedAt *strfmt.DateTime `json:"reviewedAt"` + + // secondary destination address + SecondaryDestinationAddress *Address `json:"secondaryDestinationAddress,omitempty"` + + // secondary pickup address + SecondaryPickupAddress *Address `json:"secondaryPickupAddress,omitempty"` + + // The id of the parent MTOShipment record + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentId"` + + // The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. + SitEstimatedCost *int64 `json:"sitEstimatedCost"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate"` + + // The estimated weight of the goods being put into storage in pounds. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + // Required: true + SitExpected *bool `json:"sitExpected"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse in pounds. + SpouseProGearWeight *int64 `json:"spouseProGearWeight"` + + // status + // Required: true + Status PPMShipmentStatus `json:"status"` + + // The timestamp of when the customer submitted their PPM documentation to the counselor for review. + // Format: date-time + SubmittedAt *strfmt.DateTime `json:"submittedAt"` + + // tertiary destination address + TertiaryDestinationAddress *Address `json:"tertiaryDestinationAddress,omitempty"` + + // tertiary pickup address + TertiaryPickupAddress *Address `json:"tertiaryPickupAddress,omitempty"` + + // The timestamp of when a property of this object was last updated (UTC) + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this p p m shipment +func (m *PPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDestinationPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualMoveDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateApprovedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationRateArea(formats); err != nil { + res = append(res, err) + } + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginRateArea(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReviewedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitExpected(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSubmittedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) validateActualDestinationPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDestinationPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualDestinationPostalCode", "body", *m.ActualDestinationPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualMoveDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualMoveDate) { // not required + return nil + } + + if err := validate.FormatOf("actualMoveDate", "body", "date", m.ActualMoveDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateActualPickupPostalCode(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupPostalCode) { // not required + return nil + } + + if err := validate.Pattern("actualPickupPostalCode", "body", *m.ActualPickupPostalCode, `^(\d{5})$`); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateApprovedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ApprovedAt) { // not required + return nil + } + + if err := validate.FormatOf("approvedAt", "body", "date-time", m.ApprovedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateCreatedAt(formats strfmt.Registry) error { + + if err := validate.Required("createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + + if err := validate.Required("destinationAddress", "body", m.DestinationAddress); err != nil { + return err + } + + if m.DestinationAddress != nil { + if err := m.DestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateDestinationRateArea(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationRateArea) { // not required + return nil + } + + if m.DestinationRateArea != nil { + if err := m.DestinationRateArea.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationRateArea") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateETag(formats strfmt.Registry) error { + + if err := validate.RequiredString("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + + if err := validate.Required("expectedDepartureDate", "body", m.ExpectedDepartureDate); err != nil { + return err + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateOriginRateArea(formats strfmt.Registry) error { + if swag.IsZero(m.OriginRateArea) { // not required + return nil + } + + if m.OriginRateArea != nil { + if err := m.OriginRateArea.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originRateArea") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validatePickupAddress(formats strfmt.Registry) error { + + if err := validate.Required("pickupAddress", "body", m.PickupAddress); err != nil { + return err + } + + if m.PickupAddress != nil { + if err := m.PickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateReviewedAt(formats strfmt.Registry) error { + if swag.IsZero(m.ReviewedAt) { // not required + return nil + } + + if err := validate.FormatOf("reviewedAt", "body", "date-time", m.ReviewedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if m.SecondaryDestinationAddress != nil { + if err := m.SecondaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if m.SecondaryPickupAddress != nil { + if err := m.SecondaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentId", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitExpected(formats strfmt.Registry) error { + + if err := validate.Required("sitExpected", "body", m.SitExpected); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", PPMShipmentStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) validateSubmittedAt(formats strfmt.Registry) error { + if swag.IsZero(m.SubmittedAt) { // not required + return nil + } + + if err := validate.FormatOf("submittedAt", "body", "date-time", m.SubmittedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if m.TertiaryDestinationAddress != nil { + if err := m.TertiaryDestinationAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if m.TertiaryPickupAddress != nil { + if err := m.TertiaryPickupAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this p p m shipment based on the context it is used +func (m *PPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationRateArea(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginRateArea(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PPMShipment) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationAddress != nil { + + if err := m.DestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateDestinationRateArea(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationRateArea != nil { + + if swag.IsZero(m.DestinationRateArea) { // not required + return nil + } + + if err := m.DestinationRateArea.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationRateArea") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateOriginRateArea(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginRateArea != nil { + + if swag.IsZero(m.OriginRateArea) { // not required + return nil + } + + if err := m.OriginRateArea.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originRateArea") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originRateArea") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.PickupAddress != nil { + + if err := m.PickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("pickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("pickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryDestinationAddress != nil { + + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + if err := m.SecondaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SecondaryPickupAddress != nil { + + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + if err := m.SecondaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("secondaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("secondaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentId", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryDestinationAddress != nil { + + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + if err := m.TertiaryDestinationAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryDestinationAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryDestinationAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.TertiaryPickupAddress != nil { + + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + if err := m.TertiaryPickupAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("tertiaryPickupAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("tertiaryPickupAddress") + } + return err + } + } + + return nil +} + +func (m *PPMShipment) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PPMShipment) UnmarshalBinary(b []byte) error { + var res PPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/p_p_m_shipment_status.go b/pkg/gen/primev3messages/p_p_m_shipment_status.go new file mode 100644 index 00000000000..a2f5bd086cd --- /dev/null +++ b/pkg/gen/primev3messages/p_p_m_shipment_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PPMShipmentStatus Status of the PPM Shipment: +// - **DRAFT**: The customer has created the PPM shipment but has not yet submitted their move for counseling. +// - **SUBMITTED**: The shipment belongs to a move that has been submitted by the customer or has been created by a Service Counselor or Prime Contractor for a submitted move. +// - **WAITING_ON_CUSTOMER**: The PPM shipment has been approved and the customer may now provide their actual move closeout information and documentation required to get paid. +// - **NEEDS_ADVANCE_APPROVAL**: The shipment was counseled by the Prime Contractor and approved but an advance was requested so will need further financial approval from the government. +// - **NEEDS_CLOSEOUT**: The customer has provided their closeout weight tickets, receipts, and expenses and certified it for the Service Counselor to approve, exclude or reject. +// - **CLOSEOUT_COMPLETE**: The Service Counselor has reviewed all of the customer's PPM closeout documentation and authorizes the customer can download and submit their finalized SSW packet. +// +// swagger:model PPMShipmentStatus +type PPMShipmentStatus string + +func NewPPMShipmentStatus(value PPMShipmentStatus) *PPMShipmentStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PPMShipmentStatus. +func (m PPMShipmentStatus) Pointer() *PPMShipmentStatus { + return &m +} + +const ( + + // PPMShipmentStatusDRAFT captures enum value "DRAFT" + PPMShipmentStatusDRAFT PPMShipmentStatus = "DRAFT" + + // PPMShipmentStatusSUBMITTED captures enum value "SUBMITTED" + PPMShipmentStatusSUBMITTED PPMShipmentStatus = "SUBMITTED" + + // PPMShipmentStatusWAITINGONCUSTOMER captures enum value "WAITING_ON_CUSTOMER" + PPMShipmentStatusWAITINGONCUSTOMER PPMShipmentStatus = "WAITING_ON_CUSTOMER" + + // PPMShipmentStatusNEEDSADVANCEAPPROVAL captures enum value "NEEDS_ADVANCE_APPROVAL" + PPMShipmentStatusNEEDSADVANCEAPPROVAL PPMShipmentStatus = "NEEDS_ADVANCE_APPROVAL" + + // PPMShipmentStatusNEEDSCLOSEOUT captures enum value "NEEDS_CLOSEOUT" + PPMShipmentStatusNEEDSCLOSEOUT PPMShipmentStatus = "NEEDS_CLOSEOUT" + + // PPMShipmentStatusCLOSEOUTCOMPLETE captures enum value "CLOSEOUT_COMPLETE" + PPMShipmentStatusCLOSEOUTCOMPLETE PPMShipmentStatus = "CLOSEOUT_COMPLETE" + + // PPMShipmentStatusCANCELED captures enum value "CANCELED" + PPMShipmentStatusCANCELED PPMShipmentStatus = "CANCELED" +) + +// for schema +var pPMShipmentStatusEnum []interface{} + +func init() { + var res []PPMShipmentStatus + if err := json.Unmarshal([]byte(`["DRAFT","SUBMITTED","WAITING_ON_CUSTOMER","NEEDS_ADVANCE_APPROVAL","NEEDS_CLOSEOUT","CLOSEOUT_COMPLETE","CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + pPMShipmentStatusEnum = append(pPMShipmentStatusEnum, v) + } +} + +func (m PPMShipmentStatus) validatePPMShipmentStatusEnum(path, location string, value PPMShipmentStatus) error { + if err := validate.EnumCase(path, location, value, pPMShipmentStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this p p m shipment status +func (m PPMShipmentStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePPMShipmentStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this p p m shipment status based on the context it is used +func (m PPMShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", PPMShipmentStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/payment_request.go b/pkg/gen/primev3messages/payment_request.go new file mode 100644 index 00000000000..e40d082f0c1 --- /dev/null +++ b/pkg/gen/primev3messages/payment_request.go @@ -0,0 +1,322 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // payment service items + PaymentServiceItems PaymentServiceItems `json:"paymentServiceItems,omitempty"` + + // proof of service docs + ProofOfServiceDocs ProofOfServiceDocs `json:"proofOfServiceDocs,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItems(formats); err != nil { + res = append(res, err) + } + + if err := m.validateProofOfServiceDocs(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validatePaymentServiceItems(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItems) { // not required + return nil + } + + if err := m.PaymentServiceItems.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateProofOfServiceDocs(formats strfmt.Registry) error { + if swag.IsZero(m.ProofOfServiceDocs) { // not required + return nil + } + + if err := m.ProofOfServiceDocs.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItems(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateProofOfServiceDocs(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentServiceItems(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItems.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItems") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItems") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateProofOfServiceDocs(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ProofOfServiceDocs.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("proofOfServiceDocs") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("proofOfServiceDocs") + } + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/payment_request_status.go b/pkg/gen/primev3messages/payment_request_status.go new file mode 100644 index 00000000000..9299eb2f459 --- /dev/null +++ b/pkg/gen/primev3messages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" + PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/payment_requests.go b/pkg/gen/primev3messages/payment_requests.go new file mode 100644 index 00000000000..b538872d415 --- /dev/null +++ b/pkg/gen/primev3messages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/payment_service_item.go b/pkg/gen/primev3messages/payment_service_item.go new file mode 100644 index 00000000000..28d555821a5 --- /dev/null +++ b/pkg/gen/primev3messages/payment_service_item.go @@ -0,0 +1,266 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItem payment service item +// +// swagger:model PaymentServiceItem +type PaymentServiceItem struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MtoServiceItemID strfmt.UUID `json:"mtoServiceItemID,omitempty"` + + // payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // payment service item params + PaymentServiceItemParams PaymentServiceItemParams `json:"paymentServiceItemParams,omitempty"` + + // Price of the service item in cents + PriceCents *int64 `json:"priceCents,omitempty"` + + // reference ID + // Example: 1234-5678-c56a4180 + // Read Only: true + ReferenceID string `json:"referenceID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentServiceItemStatus `json:"status,omitempty"` +} + +// Validate validates this payment service item +func (m *PaymentServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemParams(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 *PaymentServiceItem) 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 *PaymentServiceItem) validateMtoServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("mtoServiceItemID", "body", "uuid", m.MtoServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) validatePaymentServiceItemParams(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemParams) { // not required + return nil + } + + if err := m.PaymentServiceItemParams.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item based on the context it is used +func (m *PaymentServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentServiceItemParams(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReferenceID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItem) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidatePaymentServiceItemParams(ctx context.Context, formats strfmt.Registry) error { + + if err := m.PaymentServiceItemParams.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("paymentServiceItemParams") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("paymentServiceItemParams") + } + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateReferenceID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "referenceID", "body", string(m.ReferenceID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItem) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItem) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItem) UnmarshalBinary(b []byte) error { + var res PaymentServiceItem + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/payment_service_item_param.go b/pkg/gen/primev3messages/payment_service_item_param.go new file mode 100644 index 00000000000..7ae30092a6a --- /dev/null +++ b/pkg/gen/primev3messages/payment_service_item_param.go @@ -0,0 +1,274 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemParam payment service item param +// +// swagger:model PaymentServiceItemParam +type PaymentServiceItemParam struct { + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // key + Key ServiceItemParamName `json:"key,omitempty"` + + // origin + Origin ServiceItemParamOrigin `json:"origin,omitempty"` + + // payment service item ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + PaymentServiceItemID strfmt.UUID `json:"paymentServiceItemID,omitempty"` + + // type + Type ServiceItemParamType `json:"type,omitempty"` + + // value + // Example: 3025 + Value string `json:"value,omitempty"` +} + +// Validate validates this payment service item param +func (m *PaymentServiceItemParam) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateKey(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOrigin(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentServiceItemID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateType(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) 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 *PaymentServiceItemParam) validateKey(formats strfmt.Registry) error { + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateOrigin(formats strfmt.Registry) error { + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validatePaymentServiceItemID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentServiceItemID) { // not required + return nil + } + + if err := validate.FormatOf("paymentServiceItemID", "body", "uuid", m.PaymentServiceItemID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) validateType(formats strfmt.Registry) error { + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// ContextValidate validate this payment service item param based on the context it is used +func (m *PaymentServiceItemParam) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateKey(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOrigin(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentServiceItemParam) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateKey(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Key) { // not required + return nil + } + + if err := m.Key.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("key") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("key") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateOrigin(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Origin) { // not required + return nil + } + + if err := m.Origin.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("origin") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("origin") + } + return err + } + + return nil +} + +func (m *PaymentServiceItemParam) contextValidateType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Type) { // not required + return nil + } + + if err := m.Type.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("type") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("type") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentServiceItemParam) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentServiceItemParam) UnmarshalBinary(b []byte) error { + var res PaymentServiceItemParam + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/payment_service_item_params.go b/pkg/gen/primev3messages/payment_service_item_params.go new file mode 100644 index 00000000000..1d7582daf0b --- /dev/null +++ b/pkg/gen/primev3messages/payment_service_item_params.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItemParams payment service item params +// +// swagger:model PaymentServiceItemParams +type PaymentServiceItemParams []*PaymentServiceItemParam + +// Validate validates this payment service item params +func (m PaymentServiceItemParams) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service item params based on the context it is used +func (m PaymentServiceItemParams) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/payment_service_item_status.go b/pkg/gen/primev3messages/payment_service_item_status.go new file mode 100644 index 00000000000..ba7c8ae4688 --- /dev/null +++ b/pkg/gen/primev3messages/payment_service_item_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentServiceItemStatus Payment Service Item Status +// +// swagger:model PaymentServiceItemStatus +type PaymentServiceItemStatus string + +func NewPaymentServiceItemStatus(value PaymentServiceItemStatus) *PaymentServiceItemStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentServiceItemStatus. +func (m PaymentServiceItemStatus) Pointer() *PaymentServiceItemStatus { + return &m +} + +const ( + + // PaymentServiceItemStatusREQUESTED captures enum value "REQUESTED" + PaymentServiceItemStatusREQUESTED PaymentServiceItemStatus = "REQUESTED" + + // PaymentServiceItemStatusAPPROVED captures enum value "APPROVED" + PaymentServiceItemStatusAPPROVED PaymentServiceItemStatus = "APPROVED" + + // PaymentServiceItemStatusDENIED captures enum value "DENIED" + PaymentServiceItemStatusDENIED PaymentServiceItemStatus = "DENIED" + + // PaymentServiceItemStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentServiceItemStatusSENTTOGEX PaymentServiceItemStatus = "SENT_TO_GEX" + + // PaymentServiceItemStatusPAID captures enum value "PAID" + PaymentServiceItemStatusPAID PaymentServiceItemStatus = "PAID" + + // PaymentServiceItemStatusEDIERROR captures enum value "EDI_ERROR" + PaymentServiceItemStatusEDIERROR PaymentServiceItemStatus = "EDI_ERROR" +) + +// for schema +var paymentServiceItemStatusEnum []interface{} + +func init() { + var res []PaymentServiceItemStatus + if err := json.Unmarshal([]byte(`["REQUESTED","APPROVED","DENIED","SENT_TO_GEX","PAID","EDI_ERROR"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentServiceItemStatusEnum = append(paymentServiceItemStatusEnum, v) + } +} + +func (m PaymentServiceItemStatus) validatePaymentServiceItemStatusEnum(path, location string, value PaymentServiceItemStatus) error { + if err := validate.EnumCase(path, location, value, paymentServiceItemStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment service item status +func (m PaymentServiceItemStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentServiceItemStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment service item status based on context it is used +func (m PaymentServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/payment_service_items.go b/pkg/gen/primev3messages/payment_service_items.go new file mode 100644 index 00000000000..cd984ba3eb9 --- /dev/null +++ b/pkg/gen/primev3messages/payment_service_items.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentServiceItems payment service items +// +// swagger:model PaymentServiceItems +type PaymentServiceItems []*PaymentServiceItem + +// Validate validates this payment service items +func (m PaymentServiceItems) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment service items based on the context it is used +func (m PaymentServiceItems) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/port.go b/pkg/gen/primev3messages/port.go new file mode 100644 index 00000000000..f511e6b8198 --- /dev/null +++ b/pkg/gen/primev3messages/port.go @@ -0,0 +1,385 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Port A port that is used to move an international shipment. +// +// swagger:model Port +type Port struct { + + // city + // Example: PORTLAND + City string `json:"city,omitempty"` + + // Two-letter country code + // Example: US + // Pattern: ^[A-Z]{2}$ + Country string `json:"country,omitempty"` + + // county + // Example: MULTNOMAH + County string `json:"county,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // 3 or 4 digit port code + // Example: 0431 + PortCode string `json:"portCode,omitempty"` + + // Name of the port + // Example: PORTLAND INTL + PortName string `json:"portName,omitempty"` + + // Port type A (Air), B (Border Crossing), S (Sea) + // Enum: [A B S] + PortType string `json:"portType,omitempty"` + + // US state + // Example: OR + // Enum: [AL AK AR AZ CA CO CT DC DE FL GA HI IA ID IL IN KS KY LA MA MD ME MI MN MO MS MT NC ND NE NH NJ NM NV NY OH OK OR PA RI SC SD TN TX UT VA VT WA WI WV WY] + State string `json:"state,omitempty"` + + // ZIP + // Example: 99501 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + Zip string `json:"zip,omitempty"` +} + +// Validate validates this port +func (m *Port) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCountry(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateState(formats); err != nil { + res = append(res, err) + } + + if err := m.validateZip(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Port) validateCountry(formats strfmt.Registry) error { + if swag.IsZero(m.Country) { // not required + return nil + } + + if err := validate.Pattern("country", "body", m.Country, `^[A-Z]{2}$`); err != nil { + return err + } + + return nil +} + +func (m *Port) 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 +} + +var portTypePortTypePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["A","B","S"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + portTypePortTypePropEnum = append(portTypePortTypePropEnum, v) + } +} + +const ( + + // PortPortTypeA captures enum value "A" + PortPortTypeA string = "A" + + // PortPortTypeB captures enum value "B" + PortPortTypeB string = "B" + + // PortPortTypeS captures enum value "S" + PortPortTypeS string = "S" +) + +// prop value enum +func (m *Port) validatePortTypeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, portTypePortTypePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Port) validatePortType(formats strfmt.Registry) error { + if swag.IsZero(m.PortType) { // not required + return nil + } + + // value enum + if err := m.validatePortTypeEnum("portType", "body", m.PortType); err != nil { + return err + } + + return nil +} + +var portTypeStatePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["AL","AK","AR","AZ","CA","CO","CT","DC","DE","FL","GA","HI","IA","ID","IL","IN","KS","KY","LA","MA","MD","ME","MI","MN","MO","MS","MT","NC","ND","NE","NH","NJ","NM","NV","NY","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VA","VT","WA","WI","WV","WY"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + portTypeStatePropEnum = append(portTypeStatePropEnum, v) + } +} + +const ( + + // PortStateAL captures enum value "AL" + PortStateAL string = "AL" + + // PortStateAK captures enum value "AK" + PortStateAK string = "AK" + + // PortStateAR captures enum value "AR" + PortStateAR string = "AR" + + // PortStateAZ captures enum value "AZ" + PortStateAZ string = "AZ" + + // PortStateCA captures enum value "CA" + PortStateCA string = "CA" + + // PortStateCO captures enum value "CO" + PortStateCO string = "CO" + + // PortStateCT captures enum value "CT" + PortStateCT string = "CT" + + // PortStateDC captures enum value "DC" + PortStateDC string = "DC" + + // PortStateDE captures enum value "DE" + PortStateDE string = "DE" + + // PortStateFL captures enum value "FL" + PortStateFL string = "FL" + + // PortStateGA captures enum value "GA" + PortStateGA string = "GA" + + // PortStateHI captures enum value "HI" + PortStateHI string = "HI" + + // PortStateIA captures enum value "IA" + PortStateIA string = "IA" + + // PortStateID captures enum value "ID" + PortStateID string = "ID" + + // PortStateIL captures enum value "IL" + PortStateIL string = "IL" + + // PortStateIN captures enum value "IN" + PortStateIN string = "IN" + + // PortStateKS captures enum value "KS" + PortStateKS string = "KS" + + // PortStateKY captures enum value "KY" + PortStateKY string = "KY" + + // PortStateLA captures enum value "LA" + PortStateLA string = "LA" + + // PortStateMA captures enum value "MA" + PortStateMA string = "MA" + + // PortStateMD captures enum value "MD" + PortStateMD string = "MD" + + // PortStateME captures enum value "ME" + PortStateME string = "ME" + + // PortStateMI captures enum value "MI" + PortStateMI string = "MI" + + // PortStateMN captures enum value "MN" + PortStateMN string = "MN" + + // PortStateMO captures enum value "MO" + PortStateMO string = "MO" + + // PortStateMS captures enum value "MS" + PortStateMS string = "MS" + + // PortStateMT captures enum value "MT" + PortStateMT string = "MT" + + // PortStateNC captures enum value "NC" + PortStateNC string = "NC" + + // PortStateND captures enum value "ND" + PortStateND string = "ND" + + // PortStateNE captures enum value "NE" + PortStateNE string = "NE" + + // PortStateNH captures enum value "NH" + PortStateNH string = "NH" + + // PortStateNJ captures enum value "NJ" + PortStateNJ string = "NJ" + + // PortStateNM captures enum value "NM" + PortStateNM string = "NM" + + // PortStateNV captures enum value "NV" + PortStateNV string = "NV" + + // PortStateNY captures enum value "NY" + PortStateNY string = "NY" + + // PortStateOH captures enum value "OH" + PortStateOH string = "OH" + + // PortStateOK captures enum value "OK" + PortStateOK string = "OK" + + // PortStateOR captures enum value "OR" + PortStateOR string = "OR" + + // PortStatePA captures enum value "PA" + PortStatePA string = "PA" + + // PortStateRI captures enum value "RI" + PortStateRI string = "RI" + + // PortStateSC captures enum value "SC" + PortStateSC string = "SC" + + // PortStateSD captures enum value "SD" + PortStateSD string = "SD" + + // PortStateTN captures enum value "TN" + PortStateTN string = "TN" + + // PortStateTX captures enum value "TX" + PortStateTX string = "TX" + + // PortStateUT captures enum value "UT" + PortStateUT string = "UT" + + // PortStateVA captures enum value "VA" + PortStateVA string = "VA" + + // PortStateVT captures enum value "VT" + PortStateVT string = "VT" + + // PortStateWA captures enum value "WA" + PortStateWA string = "WA" + + // PortStateWI captures enum value "WI" + PortStateWI string = "WI" + + // PortStateWV captures enum value "WV" + PortStateWV string = "WV" + + // PortStateWY captures enum value "WY" + PortStateWY string = "WY" +) + +// prop value enum +func (m *Port) validateStateEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, portTypeStatePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *Port) validateState(formats strfmt.Registry) error { + if swag.IsZero(m.State) { // not required + return nil + } + + // value enum + if err := m.validateStateEnum("state", "body", m.State); err != nil { + return err + } + + return nil +} + +func (m *Port) validateZip(formats strfmt.Registry) error { + if swag.IsZero(m.Zip) { // not required + return nil + } + + if err := validate.Pattern("zip", "body", m.Zip, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this port based on context it is used +func (m *Port) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *Port) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Port) UnmarshalBinary(b []byte) error { + var res Port + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/proof_of_service_doc.go b/pkg/gen/primev3messages/proof_of_service_doc.go new file mode 100644 index 00000000000..41e1eb3b878 --- /dev/null +++ b/pkg/gen/primev3messages/proof_of_service_doc.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDoc proof of service doc +// +// swagger:model ProofOfServiceDoc +type ProofOfServiceDoc struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this proof of service doc +func (m *ProofOfServiceDoc) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service doc based on the context it is used +func (m *ProofOfServiceDoc) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServiceDoc) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServiceDoc) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServiceDoc) UnmarshalBinary(b []byte) error { + var res ProofOfServiceDoc + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/proof_of_service_docs.go b/pkg/gen/primev3messages/proof_of_service_docs.go new file mode 100644 index 00000000000..352538736d6 --- /dev/null +++ b/pkg/gen/primev3messages/proof_of_service_docs.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ProofOfServiceDocs proof of service docs +// +// swagger:model ProofOfServiceDocs +type ProofOfServiceDocs []*ProofOfServiceDoc + +// Validate validates this proof of service docs +func (m ProofOfServiceDocs) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this proof of service docs based on the context it is used +func (m ProofOfServiceDocs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/rate_area.go b/pkg/gen/primev3messages/rate_area.go new file mode 100644 index 00000000000..2d98c400ebb --- /dev/null +++ b/pkg/gen/primev3messages/rate_area.go @@ -0,0 +1,113 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// RateArea Rate area info for OCONUS postal code +// +// swagger:model RateArea +type RateArea struct { + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Required: true + // Format: uuid + ID *strfmt.UUID `json:"id"` + + // Rate area code + // Example: US8101000 + // Required: true + RateAreaID *string `json:"rateAreaId"` + + // Rate area name + // Example: Alaska (Zone) I + // Required: true + RateAreaName *string `json:"rateAreaName"` +} + +// Validate validates this rate area +func (m *RateArea) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRateAreaID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRateAreaName(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *RateArea) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", m.ID); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *RateArea) validateRateAreaID(formats strfmt.Registry) error { + + if err := validate.Required("rateAreaId", "body", m.RateAreaID); err != nil { + return err + } + + return nil +} + +func (m *RateArea) validateRateAreaName(formats strfmt.Registry) error { + + if err := validate.Required("rateAreaName", "body", m.RateAreaName); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this rate area based on context it is used +func (m *RateArea) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *RateArea) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *RateArea) UnmarshalBinary(b []byte) error { + var res RateArea + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/re_service_code.go b/pkg/gen/primev3messages/re_service_code.go new file mode 100644 index 00000000000..2028866f693 --- /dev/null +++ b/pkg/gen/primev3messages/re_service_code.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items +// may be requested by the Prime, but may be returned in a response. +// +// Documentation of all the service items will be provided. +// +// swagger:model ReServiceCode +type ReServiceCode string + +func NewReServiceCode(value ReServiceCode) *ReServiceCode { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReServiceCode. +func (m ReServiceCode) Pointer() *ReServiceCode { + return &m +} + +const ( + + // ReServiceCodeCS captures enum value "CS" + ReServiceCodeCS ReServiceCode = "CS" + + // ReServiceCodeDBHF captures enum value "DBHF" + ReServiceCodeDBHF ReServiceCode = "DBHF" + + // ReServiceCodeDBTF captures enum value "DBTF" + ReServiceCodeDBTF ReServiceCode = "DBTF" + + // ReServiceCodeDCRT captures enum value "DCRT" + ReServiceCodeDCRT ReServiceCode = "DCRT" + + // ReServiceCodeDDASIT captures enum value "DDASIT" + ReServiceCodeDDASIT ReServiceCode = "DDASIT" + + // ReServiceCodeDDDSIT captures enum value "DDDSIT" + ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" + + // ReServiceCodeDDFSIT captures enum value "DDFSIT" + ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" + + // ReServiceCodeDDP captures enum value "DDP" + ReServiceCodeDDP ReServiceCode = "DDP" + + // ReServiceCodeDDSHUT captures enum value "DDSHUT" + ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" + + // ReServiceCodeDLH captures enum value "DLH" + ReServiceCodeDLH ReServiceCode = "DLH" + + // ReServiceCodeDMHF captures enum value "DMHF" + ReServiceCodeDMHF ReServiceCode = "DMHF" + + // ReServiceCodeDNPK captures enum value "DNPK" + ReServiceCodeDNPK ReServiceCode = "DNPK" + + // ReServiceCodeDOASIT captures enum value "DOASIT" + ReServiceCodeDOASIT ReServiceCode = "DOASIT" + + // ReServiceCodeDOFSIT captures enum value "DOFSIT" + ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" + + // ReServiceCodeDOP captures enum value "DOP" + ReServiceCodeDOP ReServiceCode = "DOP" + + // ReServiceCodeDOPSIT captures enum value "DOPSIT" + ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" + + // ReServiceCodeDOSHUT captures enum value "DOSHUT" + ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" + + // ReServiceCodeDPK captures enum value "DPK" + ReServiceCodeDPK ReServiceCode = "DPK" + + // ReServiceCodeDSH captures enum value "DSH" + ReServiceCodeDSH ReServiceCode = "DSH" + + // ReServiceCodeDUCRT captures enum value "DUCRT" + ReServiceCodeDUCRT ReServiceCode = "DUCRT" + + // ReServiceCodeDUPK captures enum value "DUPK" + ReServiceCodeDUPK ReServiceCode = "DUPK" + + // ReServiceCodeFSC captures enum value "FSC" + ReServiceCodeFSC ReServiceCode = "FSC" + + // ReServiceCodeIBHF captures enum value "IBHF" + ReServiceCodeIBHF ReServiceCode = "IBHF" + + // ReServiceCodeIBTF captures enum value "IBTF" + ReServiceCodeIBTF ReServiceCode = "IBTF" + + // ReServiceCodeICOLH captures enum value "ICOLH" + ReServiceCodeICOLH ReServiceCode = "ICOLH" + + // ReServiceCodeICOUB captures enum value "ICOUB" + ReServiceCodeICOUB ReServiceCode = "ICOUB" + + // ReServiceCodeICRT captures enum value "ICRT" + ReServiceCodeICRT ReServiceCode = "ICRT" + + // ReServiceCodeIDASIT captures enum value "IDASIT" + ReServiceCodeIDASIT ReServiceCode = "IDASIT" + + // ReServiceCodeIDDSIT captures enum value "IDDSIT" + ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" + + // ReServiceCodeIDFSIT captures enum value "IDFSIT" + ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" + + // ReServiceCodeIDSHUT captures enum value "IDSHUT" + ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" + + // ReServiceCodeIHPK captures enum value "IHPK" + ReServiceCodeIHPK ReServiceCode = "IHPK" + + // ReServiceCodeIHUPK captures enum value "IHUPK" + ReServiceCodeIHUPK ReServiceCode = "IHUPK" + + // ReServiceCodeINPK captures enum value "INPK" + ReServiceCodeINPK ReServiceCode = "INPK" + + // ReServiceCodeIOASIT captures enum value "IOASIT" + ReServiceCodeIOASIT ReServiceCode = "IOASIT" + + // ReServiceCodeIOCLH captures enum value "IOCLH" + ReServiceCodeIOCLH ReServiceCode = "IOCLH" + + // ReServiceCodeIOCUB captures enum value "IOCUB" + ReServiceCodeIOCUB ReServiceCode = "IOCUB" + + // ReServiceCodeIOFSIT captures enum value "IOFSIT" + ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" + + // ReServiceCodeIOOLH captures enum value "IOOLH" + ReServiceCodeIOOLH ReServiceCode = "IOOLH" + + // ReServiceCodeIOOUB captures enum value "IOOUB" + ReServiceCodeIOOUB ReServiceCode = "IOOUB" + + // ReServiceCodeIOPSIT captures enum value "IOPSIT" + ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" + + // ReServiceCodeIOSHUT captures enum value "IOSHUT" + ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" + + // ReServiceCodeIUBPK captures enum value "IUBPK" + ReServiceCodeIUBPK ReServiceCode = "IUBPK" + + // ReServiceCodeIUBUPK captures enum value "IUBUPK" + ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" + + // ReServiceCodeIUCRT captures enum value "IUCRT" + ReServiceCodeIUCRT ReServiceCode = "IUCRT" + + // ReServiceCodeMS captures enum value "MS" + ReServiceCodeMS ReServiceCode = "MS" + + // ReServiceCodeNSTH captures enum value "NSTH" + ReServiceCodeNSTH ReServiceCode = "NSTH" + + // ReServiceCodeNSTUB captures enum value "NSTUB" + ReServiceCodeNSTUB ReServiceCode = "NSTUB" +) + +// for schema +var reServiceCodeEnum []interface{} + +func init() { + var res []ReServiceCode + if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceCodeEnum = append(reServiceCodeEnum, v) + } +} + +func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { + if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this re service code +func (m ReServiceCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReServiceCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this re service code based on context it is used +func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/reweigh.go b/pkg/gen/primev3messages/reweigh.go new file mode 100644 index 00000000000..8e89006727c --- /dev/null +++ b/pkg/gen/primev3messages/reweigh.go @@ -0,0 +1,280 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// Reweigh A reweigh is when a shipment is weighed for a second time due to the request of a customer, the contractor, system or TOO. +// +// swagger:model Reweigh +type Reweigh struct { + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // requested at + // Format: date-time + RequestedAt strfmt.DateTime `json:"requestedAt,omitempty"` + + // requested by + RequestedBy ReweighRequester `json:"requestedBy,omitempty"` + + // shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // verification provided at + // Format: date-time + VerificationProvidedAt *strfmt.DateTime `json:"verificationProvidedAt"` + + // verification reason + // Example: The reweigh was not performed due to some justification provided by the Prime + VerificationReason *string `json:"verificationReason"` + + // weight + // Example: 2000 + Weight *int64 `json:"weight"` +} + +// Validate validates this reweigh +func (m *Reweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestedBy(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateVerificationProvidedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) 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 *Reweigh) validateRequestedAt(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedAt) { // not required + return nil + } + + if err := validate.FormatOf("requestedAt", "body", "date-time", m.RequestedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateRequestedBy(formats strfmt.Registry) error { + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) validateShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) validateVerificationProvidedAt(formats strfmt.Registry) error { + if swag.IsZero(m.VerificationProvidedAt) { // not required + return nil + } + + if err := validate.FormatOf("verificationProvidedAt", "body", "date-time", m.VerificationProvidedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this reweigh based on the context it is used +func (m *Reweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRequestedBy(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *Reweigh) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *Reweigh) contextValidateRequestedBy(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.RequestedBy) { // not required + return nil + } + + if err := m.RequestedBy.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("requestedBy") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("requestedBy") + } + return err + } + + return nil +} + +func (m *Reweigh) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *Reweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *Reweigh) UnmarshalBinary(b []byte) error { + var res Reweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/reweigh_requester.go b/pkg/gen/primev3messages/reweigh_requester.go new file mode 100644 index 00000000000..80d6638790e --- /dev/null +++ b/pkg/gen/primev3messages/reweigh_requester.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReweighRequester reweigh requester +// +// swagger:model ReweighRequester +type ReweighRequester string + +func NewReweighRequester(value ReweighRequester) *ReweighRequester { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReweighRequester. +func (m ReweighRequester) Pointer() *ReweighRequester { + return &m +} + +const ( + + // ReweighRequesterCUSTOMER captures enum value "CUSTOMER" + ReweighRequesterCUSTOMER ReweighRequester = "CUSTOMER" + + // ReweighRequesterPRIME captures enum value "PRIME" + ReweighRequesterPRIME ReweighRequester = "PRIME" + + // ReweighRequesterSYSTEM captures enum value "SYSTEM" + ReweighRequesterSYSTEM ReweighRequester = "SYSTEM" + + // ReweighRequesterTOO captures enum value "TOO" + ReweighRequesterTOO ReweighRequester = "TOO" +) + +// for schema +var reweighRequesterEnum []interface{} + +func init() { + var res []ReweighRequester + if err := json.Unmarshal([]byte(`["CUSTOMER","PRIME","SYSTEM","TOO"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reweighRequesterEnum = append(reweighRequesterEnum, v) + } +} + +func (m ReweighRequester) validateReweighRequesterEnum(path, location string, value ReweighRequester) error { + if err := validate.EnumCase(path, location, value, reweighRequesterEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this reweigh requester +func (m ReweighRequester) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReweighRequesterEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this reweigh requester based on context it is used +func (m ReweighRequester) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/s_i_t_extension.go b/pkg/gen/primev3messages/s_i_t_extension.go new file mode 100644 index 00000000000..e311a2ec746 --- /dev/null +++ b/pkg/gen/primev3messages/s_i_t_extension.go @@ -0,0 +1,291 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// SITExtension A storage in transit (SIT) Extension is a request for an increase in the billable number of days a shipment is allowed to be in SIT. +// +// swagger:model SITExtension +type SITExtension struct { + + // approved days + // Example: 30 + ApprovedDays *int64 `json:"approvedDays"` + + // contractor remarks + // Example: We need SIT additional days. The customer has not found a house yet. + ContractorRemarks *string `json:"contractorRemarks"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // decision date + // Format: date-time + DecisionDate *strfmt.DateTime `json:"decisionDate"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // mto shipment ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + // office remarks + OfficeRemarks *string `json:"officeRemarks"` + + // request reason + // Enum: [SERIOUS_ILLNESS_MEMBER SERIOUS_ILLNESS_DEPENDENT IMPENDING_ASSIGNEMENT DIRECTED_TEMPORARY_DUTY NONAVAILABILITY_OF_CIVILIAN_HOUSING AWAITING_COMPLETION_OF_RESIDENCE OTHER] + RequestReason string `json:"requestReason,omitempty"` + + // requested days + // Example: 30 + RequestedDays int64 `json:"requestedDays,omitempty"` + + // status + // Enum: [PENDING APPROVED DENIED] + Status interface{} `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this s i t extension +func (m *SITExtension) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDecisionDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRequestReason(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateDecisionDate(formats strfmt.Registry) error { + if swag.IsZero(m.DecisionDate) { // not required + return nil + } + + if err := validate.FormatOf("decisionDate", "body", "date-time", m.DecisionDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) 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 *SITExtension) validateMtoShipmentID(formats strfmt.Registry) error { + if swag.IsZero(m.MtoShipmentID) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +var sITExtensionTypeRequestReasonPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["SERIOUS_ILLNESS_MEMBER","SERIOUS_ILLNESS_DEPENDENT","IMPENDING_ASSIGNEMENT","DIRECTED_TEMPORARY_DUTY","NONAVAILABILITY_OF_CIVILIAN_HOUSING","AWAITING_COMPLETION_OF_RESIDENCE","OTHER"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITExtensionTypeRequestReasonPropEnum = append(sITExtensionTypeRequestReasonPropEnum, v) + } +} + +const ( + + // SITExtensionRequestReasonSERIOUSILLNESSMEMBER captures enum value "SERIOUS_ILLNESS_MEMBER" + SITExtensionRequestReasonSERIOUSILLNESSMEMBER string = "SERIOUS_ILLNESS_MEMBER" + + // SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT captures enum value "SERIOUS_ILLNESS_DEPENDENT" + SITExtensionRequestReasonSERIOUSILLNESSDEPENDENT string = "SERIOUS_ILLNESS_DEPENDENT" + + // SITExtensionRequestReasonIMPENDINGASSIGNEMENT captures enum value "IMPENDING_ASSIGNEMENT" + SITExtensionRequestReasonIMPENDINGASSIGNEMENT string = "IMPENDING_ASSIGNEMENT" + + // SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY captures enum value "DIRECTED_TEMPORARY_DUTY" + SITExtensionRequestReasonDIRECTEDTEMPORARYDUTY string = "DIRECTED_TEMPORARY_DUTY" + + // SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING captures enum value "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + SITExtensionRequestReasonNONAVAILABILITYOFCIVILIANHOUSING string = "NONAVAILABILITY_OF_CIVILIAN_HOUSING" + + // SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE captures enum value "AWAITING_COMPLETION_OF_RESIDENCE" + SITExtensionRequestReasonAWAITINGCOMPLETIONOFRESIDENCE string = "AWAITING_COMPLETION_OF_RESIDENCE" + + // SITExtensionRequestReasonOTHER captures enum value "OTHER" + SITExtensionRequestReasonOTHER string = "OTHER" +) + +// prop value enum +func (m *SITExtension) validateRequestReasonEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, sITExtensionTypeRequestReasonPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *SITExtension) validateRequestReason(formats strfmt.Registry) error { + if swag.IsZero(m.RequestReason) { // not required + return nil + } + + // value enum + if err := m.validateRequestReasonEnum("requestReason", "body", m.RequestReason); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this s i t extension based on the context it is used +func (m *SITExtension) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *SITExtension) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *SITExtension) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *SITExtension) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *SITExtension) UnmarshalBinary(b []byte) error { + var res SITExtension + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/s_i_t_extensions.go b/pkg/gen/primev3messages/s_i_t_extensions.go new file mode 100644 index 00000000000..bb884e12a92 --- /dev/null +++ b/pkg/gen/primev3messages/s_i_t_extensions.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// SITExtensions s i t extensions +// +// swagger:model SITExtensions +type SITExtensions []*SITExtension + +// Validate validates this s i t extensions +func (m SITExtensions) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this s i t extensions based on the context it is used +func (m SITExtensions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/s_i_t_location_type.go b/pkg/gen/primev3messages/s_i_t_location_type.go new file mode 100644 index 00000000000..c4b856e95b2 --- /dev/null +++ b/pkg/gen/primev3messages/s_i_t_location_type.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// SITLocationType The list of SIT location types. +// +// swagger:model SITLocationType +type SITLocationType string + +func NewSITLocationType(value SITLocationType) *SITLocationType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated SITLocationType. +func (m SITLocationType) Pointer() *SITLocationType { + return &m +} + +const ( + + // SITLocationTypeORIGIN captures enum value "ORIGIN" + SITLocationTypeORIGIN SITLocationType = "ORIGIN" + + // SITLocationTypeDESTINATION captures enum value "DESTINATION" + SITLocationTypeDESTINATION SITLocationType = "DESTINATION" +) + +// for schema +var sITLocationTypeEnum []interface{} + +func init() { + var res []SITLocationType + if err := json.Unmarshal([]byte(`["ORIGIN","DESTINATION"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + sITLocationTypeEnum = append(sITLocationTypeEnum, v) + } +} + +func (m SITLocationType) validateSITLocationTypeEnum(path, location string, value SITLocationType) error { + if err := validate.EnumCase(path, location, value, sITLocationTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this s i t location type +func (m SITLocationType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateSITLocationTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this s i t location type based on context it is used +func (m SITLocationType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/service_item_param_name.go b/pkg/gen/primev3messages/service_item_param_name.go new file mode 100644 index 00000000000..a7e2fdf7ea3 --- /dev/null +++ b/pkg/gen/primev3messages/service_item_param_name.go @@ -0,0 +1,282 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamName service item param name +// +// swagger:model ServiceItemParamName +type ServiceItemParamName string + +func NewServiceItemParamName(value ServiceItemParamName) *ServiceItemParamName { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamName. +func (m ServiceItemParamName) Pointer() *ServiceItemParamName { + return &m +} + +const ( + + // ServiceItemParamNameActualPickupDate captures enum value "ActualPickupDate" + ServiceItemParamNameActualPickupDate ServiceItemParamName = "ActualPickupDate" + + // ServiceItemParamNameContractCode captures enum value "ContractCode" + ServiceItemParamNameContractCode ServiceItemParamName = "ContractCode" + + // ServiceItemParamNameContractYearName captures enum value "ContractYearName" + ServiceItemParamNameContractYearName ServiceItemParamName = "ContractYearName" + + // ServiceItemParamNameCubicFeetBilled captures enum value "CubicFeetBilled" + ServiceItemParamNameCubicFeetBilled ServiceItemParamName = "CubicFeetBilled" + + // ServiceItemParamNameCubicFeetCrating captures enum value "CubicFeetCrating" + ServiceItemParamNameCubicFeetCrating ServiceItemParamName = "CubicFeetCrating" + + // ServiceItemParamNameDimensionHeight captures enum value "DimensionHeight" + ServiceItemParamNameDimensionHeight ServiceItemParamName = "DimensionHeight" + + // ServiceItemParamNameDimensionLength captures enum value "DimensionLength" + ServiceItemParamNameDimensionLength ServiceItemParamName = "DimensionLength" + + // ServiceItemParamNameDimensionWidth captures enum value "DimensionWidth" + ServiceItemParamNameDimensionWidth ServiceItemParamName = "DimensionWidth" + + // ServiceItemParamNameDistanceZip captures enum value "DistanceZip" + ServiceItemParamNameDistanceZip ServiceItemParamName = "DistanceZip" + + // ServiceItemParamNameDistanceZipSITDest captures enum value "DistanceZipSITDest" + ServiceItemParamNameDistanceZipSITDest ServiceItemParamName = "DistanceZipSITDest" + + // ServiceItemParamNameDistanceZipSITOrigin captures enum value "DistanceZipSITOrigin" + ServiceItemParamNameDistanceZipSITOrigin ServiceItemParamName = "DistanceZipSITOrigin" + + // ServiceItemParamNameEIAFuelPrice captures enum value "EIAFuelPrice" + ServiceItemParamNameEIAFuelPrice ServiceItemParamName = "EIAFuelPrice" + + // ServiceItemParamNameEscalationCompounded captures enum value "EscalationCompounded" + ServiceItemParamNameEscalationCompounded ServiceItemParamName = "EscalationCompounded" + + // ServiceItemParamNameFSCMultiplier captures enum value "FSCMultiplier" + ServiceItemParamNameFSCMultiplier ServiceItemParamName = "FSCMultiplier" + + // ServiceItemParamNameFSCPriceDifferenceInCents captures enum value "FSCPriceDifferenceInCents" + ServiceItemParamNameFSCPriceDifferenceInCents ServiceItemParamName = "FSCPriceDifferenceInCents" + + // ServiceItemParamNameFSCWeightBasedDistanceMultiplier captures enum value "FSCWeightBasedDistanceMultiplier" + ServiceItemParamNameFSCWeightBasedDistanceMultiplier ServiceItemParamName = "FSCWeightBasedDistanceMultiplier" + + // ServiceItemParamNameIsPeak captures enum value "IsPeak" + ServiceItemParamNameIsPeak ServiceItemParamName = "IsPeak" + + // ServiceItemParamNameMarketDest captures enum value "MarketDest" + ServiceItemParamNameMarketDest ServiceItemParamName = "MarketDest" + + // ServiceItemParamNameMarketOrigin captures enum value "MarketOrigin" + ServiceItemParamNameMarketOrigin ServiceItemParamName = "MarketOrigin" + + // ServiceItemParamNameMTOAvailableToPrimeAt captures enum value "MTOAvailableToPrimeAt" + ServiceItemParamNameMTOAvailableToPrimeAt ServiceItemParamName = "MTOAvailableToPrimeAt" + + // ServiceItemParamNameNTSPackingFactor captures enum value "NTSPackingFactor" + ServiceItemParamNameNTSPackingFactor ServiceItemParamName = "NTSPackingFactor" + + // ServiceItemParamNameNumberDaysSIT captures enum value "NumberDaysSIT" + ServiceItemParamNameNumberDaysSIT ServiceItemParamName = "NumberDaysSIT" + + // ServiceItemParamNamePriceAreaDest captures enum value "PriceAreaDest" + ServiceItemParamNamePriceAreaDest ServiceItemParamName = "PriceAreaDest" + + // ServiceItemParamNamePriceAreaIntlDest captures enum value "PriceAreaIntlDest" + ServiceItemParamNamePriceAreaIntlDest ServiceItemParamName = "PriceAreaIntlDest" + + // ServiceItemParamNamePriceAreaIntlOrigin captures enum value "PriceAreaIntlOrigin" + ServiceItemParamNamePriceAreaIntlOrigin ServiceItemParamName = "PriceAreaIntlOrigin" + + // ServiceItemParamNamePriceAreaOrigin captures enum value "PriceAreaOrigin" + ServiceItemParamNamePriceAreaOrigin ServiceItemParamName = "PriceAreaOrigin" + + // ServiceItemParamNamePriceRateOrFactor captures enum value "PriceRateOrFactor" + ServiceItemParamNamePriceRateOrFactor ServiceItemParamName = "PriceRateOrFactor" + + // ServiceItemParamNamePSILinehaulDom captures enum value "PSI_LinehaulDom" + ServiceItemParamNamePSILinehaulDom ServiceItemParamName = "PSI_LinehaulDom" + + // ServiceItemParamNamePSILinehaulDomPrice captures enum value "PSI_LinehaulDomPrice" + ServiceItemParamNamePSILinehaulDomPrice ServiceItemParamName = "PSI_LinehaulDomPrice" + + // ServiceItemParamNamePSILinehaulShort captures enum value "PSI_LinehaulShort" + ServiceItemParamNamePSILinehaulShort ServiceItemParamName = "PSI_LinehaulShort" + + // ServiceItemParamNamePSILinehaulShortPrice captures enum value "PSI_LinehaulShortPrice" + ServiceItemParamNamePSILinehaulShortPrice ServiceItemParamName = "PSI_LinehaulShortPrice" + + // ServiceItemParamNamePSIPriceDomDest captures enum value "PSI_PriceDomDest" + ServiceItemParamNamePSIPriceDomDest ServiceItemParamName = "PSI_PriceDomDest" + + // ServiceItemParamNamePSIPriceDomDestPrice captures enum value "PSI_PriceDomDestPrice" + ServiceItemParamNamePSIPriceDomDestPrice ServiceItemParamName = "PSI_PriceDomDestPrice" + + // ServiceItemParamNamePSIPriceDomOrigin captures enum value "PSI_PriceDomOrigin" + ServiceItemParamNamePSIPriceDomOrigin ServiceItemParamName = "PSI_PriceDomOrigin" + + // ServiceItemParamNamePSIPriceDomOriginPrice captures enum value "PSI_PriceDomOriginPrice" + ServiceItemParamNamePSIPriceDomOriginPrice ServiceItemParamName = "PSI_PriceDomOriginPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlCO captures enum value "PSI_ShippingLinehaulIntlCO" + ServiceItemParamNamePSIShippingLinehaulIntlCO ServiceItemParamName = "PSI_ShippingLinehaulIntlCO" + + // ServiceItemParamNamePSIShippingLinehaulIntlCOPrice captures enum value "PSI_ShippingLinehaulIntlCOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlCOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlCOPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOC captures enum value "PSI_ShippingLinehaulIntlOC" + ServiceItemParamNamePSIShippingLinehaulIntlOC ServiceItemParamName = "PSI_ShippingLinehaulIntlOC" + + // ServiceItemParamNamePSIShippingLinehaulIntlOCPrice captures enum value "PSI_ShippingLinehaulIntlOCPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOCPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOCPrice" + + // ServiceItemParamNamePSIShippingLinehaulIntlOO captures enum value "PSI_ShippingLinehaulIntlOO" + ServiceItemParamNamePSIShippingLinehaulIntlOO ServiceItemParamName = "PSI_ShippingLinehaulIntlOO" + + // ServiceItemParamNamePSIShippingLinehaulIntlOOPrice captures enum value "PSI_ShippingLinehaulIntlOOPrice" + ServiceItemParamNamePSIShippingLinehaulIntlOOPrice ServiceItemParamName = "PSI_ShippingLinehaulIntlOOPrice" + + // ServiceItemParamNameRateAreaNonStdDest captures enum value "RateAreaNonStdDest" + ServiceItemParamNameRateAreaNonStdDest ServiceItemParamName = "RateAreaNonStdDest" + + // ServiceItemParamNameRateAreaNonStdOrigin captures enum value "RateAreaNonStdOrigin" + ServiceItemParamNameRateAreaNonStdOrigin ServiceItemParamName = "RateAreaNonStdOrigin" + + // ServiceItemParamNameReferenceDate captures enum value "ReferenceDate" + ServiceItemParamNameReferenceDate ServiceItemParamName = "ReferenceDate" + + // ServiceItemParamNameRequestedPickupDate captures enum value "RequestedPickupDate" + ServiceItemParamNameRequestedPickupDate ServiceItemParamName = "RequestedPickupDate" + + // ServiceItemParamNameServiceAreaDest captures enum value "ServiceAreaDest" + ServiceItemParamNameServiceAreaDest ServiceItemParamName = "ServiceAreaDest" + + // ServiceItemParamNameServiceAreaOrigin captures enum value "ServiceAreaOrigin" + ServiceItemParamNameServiceAreaOrigin ServiceItemParamName = "ServiceAreaOrigin" + + // ServiceItemParamNameServicesScheduleDest captures enum value "ServicesScheduleDest" + ServiceItemParamNameServicesScheduleDest ServiceItemParamName = "ServicesScheduleDest" + + // ServiceItemParamNameServicesScheduleOrigin captures enum value "ServicesScheduleOrigin" + ServiceItemParamNameServicesScheduleOrigin ServiceItemParamName = "ServicesScheduleOrigin" + + // ServiceItemParamNameSITPaymentRequestEnd captures enum value "SITPaymentRequestEnd" + ServiceItemParamNameSITPaymentRequestEnd ServiceItemParamName = "SITPaymentRequestEnd" + + // ServiceItemParamNameSITPaymentRequestStart captures enum value "SITPaymentRequestStart" + ServiceItemParamNameSITPaymentRequestStart ServiceItemParamName = "SITPaymentRequestStart" + + // ServiceItemParamNameSITScheduleDest captures enum value "SITScheduleDest" + ServiceItemParamNameSITScheduleDest ServiceItemParamName = "SITScheduleDest" + + // ServiceItemParamNameSITScheduleOrigin captures enum value "SITScheduleOrigin" + ServiceItemParamNameSITScheduleOrigin ServiceItemParamName = "SITScheduleOrigin" + + // ServiceItemParamNameSITServiceAreaDest captures enum value "SITServiceAreaDest" + ServiceItemParamNameSITServiceAreaDest ServiceItemParamName = "SITServiceAreaDest" + + // ServiceItemParamNameSITServiceAreaOrigin captures enum value "SITServiceAreaOrigin" + ServiceItemParamNameSITServiceAreaOrigin ServiceItemParamName = "SITServiceAreaOrigin" + + // ServiceItemParamNameWeightAdjusted captures enum value "WeightAdjusted" + ServiceItemParamNameWeightAdjusted ServiceItemParamName = "WeightAdjusted" + + // ServiceItemParamNameWeightBilled captures enum value "WeightBilled" + ServiceItemParamNameWeightBilled ServiceItemParamName = "WeightBilled" + + // ServiceItemParamNameWeightEstimated captures enum value "WeightEstimated" + ServiceItemParamNameWeightEstimated ServiceItemParamName = "WeightEstimated" + + // ServiceItemParamNameWeightOriginal captures enum value "WeightOriginal" + ServiceItemParamNameWeightOriginal ServiceItemParamName = "WeightOriginal" + + // ServiceItemParamNameWeightReweigh captures enum value "WeightReweigh" + ServiceItemParamNameWeightReweigh ServiceItemParamName = "WeightReweigh" + + // ServiceItemParamNameZipDestAddress captures enum value "ZipDestAddress" + ServiceItemParamNameZipDestAddress ServiceItemParamName = "ZipDestAddress" + + // ServiceItemParamNameZipPickupAddress captures enum value "ZipPickupAddress" + ServiceItemParamNameZipPickupAddress ServiceItemParamName = "ZipPickupAddress" + + // ServiceItemParamNameZipSITDestHHGFinalAddress captures enum value "ZipSITDestHHGFinalAddress" + ServiceItemParamNameZipSITDestHHGFinalAddress ServiceItemParamName = "ZipSITDestHHGFinalAddress" + + // ServiceItemParamNameZipSITDestHHGOriginalAddress captures enum value "ZipSITDestHHGOriginalAddress" + ServiceItemParamNameZipSITDestHHGOriginalAddress ServiceItemParamName = "ZipSITDestHHGOriginalAddress" + + // ServiceItemParamNameZipSITOriginHHGActualAddress captures enum value "ZipSITOriginHHGActualAddress" + ServiceItemParamNameZipSITOriginHHGActualAddress ServiceItemParamName = "ZipSITOriginHHGActualAddress" + + // ServiceItemParamNameZipSITOriginHHGOriginalAddress captures enum value "ZipSITOriginHHGOriginalAddress" + ServiceItemParamNameZipSITOriginHHGOriginalAddress ServiceItemParamName = "ZipSITOriginHHGOriginalAddress" + + // ServiceItemParamNameStandaloneCrate captures enum value "StandaloneCrate" + ServiceItemParamNameStandaloneCrate ServiceItemParamName = "StandaloneCrate" + + // ServiceItemParamNameStandaloneCrateCap captures enum value "StandaloneCrateCap" + ServiceItemParamNameStandaloneCrateCap ServiceItemParamName = "StandaloneCrateCap" + + // ServiceItemParamNameUncappedRequestTotal captures enum value "UncappedRequestTotal" + ServiceItemParamNameUncappedRequestTotal ServiceItemParamName = "UncappedRequestTotal" + + // ServiceItemParamNameLockedPriceCents captures enum value "LockedPriceCents" + ServiceItemParamNameLockedPriceCents ServiceItemParamName = "LockedPriceCents" +) + +// for schema +var serviceItemParamNameEnum []interface{} + +func init() { + var res []ServiceItemParamName + if err := json.Unmarshal([]byte(`["ActualPickupDate","ContractCode","ContractYearName","CubicFeetBilled","CubicFeetCrating","DimensionHeight","DimensionLength","DimensionWidth","DistanceZip","DistanceZipSITDest","DistanceZipSITOrigin","EIAFuelPrice","EscalationCompounded","FSCMultiplier","FSCPriceDifferenceInCents","FSCWeightBasedDistanceMultiplier","IsPeak","MarketDest","MarketOrigin","MTOAvailableToPrimeAt","NTSPackingFactor","NumberDaysSIT","PriceAreaDest","PriceAreaIntlDest","PriceAreaIntlOrigin","PriceAreaOrigin","PriceRateOrFactor","PSI_LinehaulDom","PSI_LinehaulDomPrice","PSI_LinehaulShort","PSI_LinehaulShortPrice","PSI_PriceDomDest","PSI_PriceDomDestPrice","PSI_PriceDomOrigin","PSI_PriceDomOriginPrice","PSI_ShippingLinehaulIntlCO","PSI_ShippingLinehaulIntlCOPrice","PSI_ShippingLinehaulIntlOC","PSI_ShippingLinehaulIntlOCPrice","PSI_ShippingLinehaulIntlOO","PSI_ShippingLinehaulIntlOOPrice","RateAreaNonStdDest","RateAreaNonStdOrigin","ReferenceDate","RequestedPickupDate","ServiceAreaDest","ServiceAreaOrigin","ServicesScheduleDest","ServicesScheduleOrigin","SITPaymentRequestEnd","SITPaymentRequestStart","SITScheduleDest","SITScheduleOrigin","SITServiceAreaDest","SITServiceAreaOrigin","WeightAdjusted","WeightBilled","WeightEstimated","WeightOriginal","WeightReweigh","ZipDestAddress","ZipPickupAddress","ZipSITDestHHGFinalAddress","ZipSITDestHHGOriginalAddress","ZipSITOriginHHGActualAddress","ZipSITOriginHHGOriginalAddress","StandaloneCrate","StandaloneCrateCap","UncappedRequestTotal","LockedPriceCents"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamNameEnum = append(serviceItemParamNameEnum, v) + } +} + +func (m ServiceItemParamName) validateServiceItemParamNameEnum(path, location string, value ServiceItemParamName) error { + if err := validate.EnumCase(path, location, value, serviceItemParamNameEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param name +func (m ServiceItemParamName) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamNameEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param name based on context it is used +func (m ServiceItemParamName) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/service_item_param_origin.go b/pkg/gen/primev3messages/service_item_param_origin.go new file mode 100644 index 00000000000..da97243453f --- /dev/null +++ b/pkg/gen/primev3messages/service_item_param_origin.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamOrigin service item param origin +// +// swagger:model ServiceItemParamOrigin +type ServiceItemParamOrigin string + +func NewServiceItemParamOrigin(value ServiceItemParamOrigin) *ServiceItemParamOrigin { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamOrigin. +func (m ServiceItemParamOrigin) Pointer() *ServiceItemParamOrigin { + return &m +} + +const ( + + // ServiceItemParamOriginPRIME captures enum value "PRIME" + ServiceItemParamOriginPRIME ServiceItemParamOrigin = "PRIME" + + // ServiceItemParamOriginSYSTEM captures enum value "SYSTEM" + ServiceItemParamOriginSYSTEM ServiceItemParamOrigin = "SYSTEM" + + // ServiceItemParamOriginPRICER captures enum value "PRICER" + ServiceItemParamOriginPRICER ServiceItemParamOrigin = "PRICER" + + // ServiceItemParamOriginPAYMENTREQUEST captures enum value "PAYMENT_REQUEST" + ServiceItemParamOriginPAYMENTREQUEST ServiceItemParamOrigin = "PAYMENT_REQUEST" +) + +// for schema +var serviceItemParamOriginEnum []interface{} + +func init() { + var res []ServiceItemParamOrigin + if err := json.Unmarshal([]byte(`["PRIME","SYSTEM","PRICER","PAYMENT_REQUEST"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamOriginEnum = append(serviceItemParamOriginEnum, v) + } +} + +func (m ServiceItemParamOrigin) validateServiceItemParamOriginEnum(path, location string, value ServiceItemParamOrigin) error { + if err := validate.EnumCase(path, location, value, serviceItemParamOriginEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param origin +func (m ServiceItemParamOrigin) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamOriginEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param origin based on context it is used +func (m ServiceItemParamOrigin) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/service_item_param_type.go b/pkg/gen/primev3messages/service_item_param_type.go new file mode 100644 index 00000000000..487524f3bf4 --- /dev/null +++ b/pkg/gen/primev3messages/service_item_param_type.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ServiceItemParamType service item param type +// +// swagger:model ServiceItemParamType +type ServiceItemParamType string + +func NewServiceItemParamType(value ServiceItemParamType) *ServiceItemParamType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ServiceItemParamType. +func (m ServiceItemParamType) Pointer() *ServiceItemParamType { + return &m +} + +const ( + + // ServiceItemParamTypeSTRING captures enum value "STRING" + ServiceItemParamTypeSTRING ServiceItemParamType = "STRING" + + // ServiceItemParamTypeDATE captures enum value "DATE" + ServiceItemParamTypeDATE ServiceItemParamType = "DATE" + + // ServiceItemParamTypeINTEGER captures enum value "INTEGER" + ServiceItemParamTypeINTEGER ServiceItemParamType = "INTEGER" + + // ServiceItemParamTypeDECIMAL captures enum value "DECIMAL" + ServiceItemParamTypeDECIMAL ServiceItemParamType = "DECIMAL" + + // ServiceItemParamTypeTIMESTAMP captures enum value "TIMESTAMP" + ServiceItemParamTypeTIMESTAMP ServiceItemParamType = "TIMESTAMP" + + // ServiceItemParamTypePaymentServiceItemUUID captures enum value "PaymentServiceItemUUID" + ServiceItemParamTypePaymentServiceItemUUID ServiceItemParamType = "PaymentServiceItemUUID" + + // ServiceItemParamTypeBOOLEAN captures enum value "BOOLEAN" + ServiceItemParamTypeBOOLEAN ServiceItemParamType = "BOOLEAN" +) + +// for schema +var serviceItemParamTypeEnum []interface{} + +func init() { + var res []ServiceItemParamType + if err := json.Unmarshal([]byte(`["STRING","DATE","INTEGER","DECIMAL","TIMESTAMP","PaymentServiceItemUUID","BOOLEAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + serviceItemParamTypeEnum = append(serviceItemParamTypeEnum, v) + } +} + +func (m ServiceItemParamType) validateServiceItemParamTypeEnum(path, location string, value ServiceItemParamType) error { + if err := validate.EnumCase(path, location, value, serviceItemParamTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this service item param type +func (m ServiceItemParamType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateServiceItemParamTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this service item param type based on context it is used +func (m ServiceItemParamType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/service_request_document.go b/pkg/gen/primev3messages/service_request_document.go new file mode 100644 index 00000000000..33f7037ba64 --- /dev/null +++ b/pkg/gen/primev3messages/service_request_document.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocument service request document +// +// swagger:model ServiceRequestDocument +type ServiceRequestDocument struct { + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this service request document +func (m *ServiceRequestDocument) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this service request document based on the context it is used +func (m *ServiceRequestDocument) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ServiceRequestDocument) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ServiceRequestDocument) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ServiceRequestDocument) UnmarshalBinary(b []byte) error { + var res ServiceRequestDocument + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/service_request_documents.go b/pkg/gen/primev3messages/service_request_documents.go new file mode 100644 index 00000000000..26f5acb9a4c --- /dev/null +++ b/pkg/gen/primev3messages/service_request_documents.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// ServiceRequestDocuments service request documents +// +// swagger:model ServiceRequestDocuments +type ServiceRequestDocuments []*ServiceRequestDocument + +// Validate validates this service request documents +func (m ServiceRequestDocuments) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this service request documents based on the context it is used +func (m ServiceRequestDocuments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/shipment_address_update.go b/pkg/gen/primev3messages/shipment_address_update.go new file mode 100644 index 00000000000..f18dd49e3ee --- /dev/null +++ b/pkg/gen/primev3messages/shipment_address_update.go @@ -0,0 +1,408 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdate This represents a delivery address change request made by the Prime that is either auto-approved or requires review if the pricing criteria has changed. If criteria has changed, then it must be approved or rejected by a TOO. +// +// swagger:model ShipmentAddressUpdate +type ShipmentAddressUpdate struct { + + // Contractor Remarks + // + // The reason there is an address change. + // Example: This is a contractor remark + // Required: true + // Read Only: true + ContractorRemarks string `json:"contractorRemarks"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` + + // The distance between the original SIT address and requested new delivery address of shipment + // Example: 88 + // Minimum: 0 + NewSitDistanceBetween *int64 `json:"newSitDistanceBetween,omitempty"` + + // Office Remarks + // + // The TOO comment on approval or rejection. + // Example: This is an office remark + OfficeRemarks *string `json:"officeRemarks,omitempty"` + + // The distance between the original SIT address and the previous/old delivery address of shipment + // Example: 50 + // Minimum: 0 + OldSitDistanceBetween *int64 `json:"oldSitDistanceBetween,omitempty"` + + // original address + // Required: true + OriginalAddress *Address `json:"originalAddress"` + + // shipment ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Required: true + // Read Only: true + // Format: uuid + ShipmentID strfmt.UUID `json:"shipmentID"` + + // sit original address + SitOriginalAddress *Address `json:"sitOriginalAddress,omitempty"` + + // status + // Required: true + Status ShipmentAddressUpdateStatus `json:"status"` +} + +// Validate validates this shipment address update +func (m *ShipmentAddressUpdate) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOldSitDistanceBetween(formats); err != nil { + res = append(res, err) + } + + if err := m.validateOriginalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitOriginalAddress(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 *ShipmentAddressUpdate) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.RequiredString("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateID(formats strfmt.Registry) error { + + if err := validate.Required("id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + if err := validate.FormatOf("id", "body", "uuid", m.ID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateNewSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.NewSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("newSitDistanceBetween", "body", *m.NewSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOldSitDistanceBetween(formats strfmt.Registry) error { + if swag.IsZero(m.OldSitDistanceBetween) { // not required + return nil + } + + if err := validate.MinimumInt("oldSitDistanceBetween", "body", *m.OldSitDistanceBetween, 0, false); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateOriginalAddress(formats strfmt.Registry) error { + + if err := validate.Required("originalAddress", "body", m.OriginalAddress); err != nil { + return err + } + + if m.OriginalAddress != nil { + if err := m.OriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateSitOriginalAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if m.SitOriginalAddress != nil { + if err := m.SitOriginalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) validateStatus(formats strfmt.Registry) error { + + if err := validate.Required("status", "body", ShipmentAddressUpdateStatus(m.Status)); err != nil { + return err + } + + if err := m.Status.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this shipment address update based on the context it is used +func (m *ShipmentAddressUpdate) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateContractorRemarks(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitOriginalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateContractorRemarks(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "contractorRemarks", "body", string(m.ContractorRemarks)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.OriginalAddress != nil { + + if err := m.OriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("originalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("originalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateShipmentID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "shipmentID", "body", strfmt.UUID(m.ShipmentID)); err != nil { + return err + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateSitOriginalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitOriginalAddress != nil { + + if swag.IsZero(m.SitOriginalAddress) { // not required + return nil + } + + if err := m.SitOriginalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitOriginalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitOriginalAddress") + } + return err + } + } + + return nil +} + +func (m *ShipmentAddressUpdate) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ShipmentAddressUpdate) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ShipmentAddressUpdate) UnmarshalBinary(b []byte) error { + var res ShipmentAddressUpdate + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/shipment_address_update_status.go b/pkg/gen/primev3messages/shipment_address_update_status.go new file mode 100644 index 00000000000..f6c854c1095 --- /dev/null +++ b/pkg/gen/primev3messages/shipment_address_update_status.go @@ -0,0 +1,90 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ShipmentAddressUpdateStatus Status +// +// swagger:model ShipmentAddressUpdateStatus +type ShipmentAddressUpdateStatus string + +func NewShipmentAddressUpdateStatus(value ShipmentAddressUpdateStatus) *ShipmentAddressUpdateStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ShipmentAddressUpdateStatus. +func (m ShipmentAddressUpdateStatus) Pointer() *ShipmentAddressUpdateStatus { + return &m +} + +const ( + + // ShipmentAddressUpdateStatusREQUESTED captures enum value "REQUESTED" + ShipmentAddressUpdateStatusREQUESTED ShipmentAddressUpdateStatus = "REQUESTED" + + // ShipmentAddressUpdateStatusREJECTED captures enum value "REJECTED" + ShipmentAddressUpdateStatusREJECTED ShipmentAddressUpdateStatus = "REJECTED" + + // ShipmentAddressUpdateStatusAPPROVED captures enum value "APPROVED" + ShipmentAddressUpdateStatusAPPROVED ShipmentAddressUpdateStatus = "APPROVED" +) + +// for schema +var shipmentAddressUpdateStatusEnum []interface{} + +func init() { + var res []ShipmentAddressUpdateStatus + if err := json.Unmarshal([]byte(`["REQUESTED","REJECTED","APPROVED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + shipmentAddressUpdateStatusEnum = append(shipmentAddressUpdateStatusEnum, v) + } +} + +func (m ShipmentAddressUpdateStatus) validateShipmentAddressUpdateStatusEnum(path, location string, value ShipmentAddressUpdateStatus) error { + if err := validate.EnumCase(path, location, value, shipmentAddressUpdateStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this shipment address update status +func (m ShipmentAddressUpdateStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateShipmentAddressUpdateStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this shipment address update status based on the context it is used +func (m ShipmentAddressUpdateStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := validate.ReadOnly(ctx, "", "body", ShipmentAddressUpdateStatus(m)); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/primev3messages/storage_facility.go b/pkg/gen/primev3messages/storage_facility.go new file mode 100644 index 00000000000..ca0fb229cd4 --- /dev/null +++ b/pkg/gen/primev3messages/storage_facility.go @@ -0,0 +1,194 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// StorageFacility The Storage Facility information for the shipment +// +// swagger:model StorageFacility +type StorageFacility struct { + + // address + Address *Address `json:"address,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // email + // Pattern: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Email *string `json:"email,omitempty"` + + // facility name + FacilityName string `json:"facilityName,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // lot number + LotNumber *string `json:"lotNumber,omitempty"` + + // phone + // Pattern: ^[2-9]\d{2}-\d{3}-\d{4}$ + Phone *string `json:"phone,omitempty"` +} + +// Validate validates this storage facility +func (m *StorageFacility) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateEmail(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePhone(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) validateAddress(formats strfmt.Registry) error { + if swag.IsZero(m.Address) { // not required + return nil + } + + if m.Address != nil { + if err := m.Address.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) validateEmail(formats strfmt.Registry) error { + if swag.IsZero(m.Email) { // not required + return nil + } + + if err := validate.Pattern("email", "body", *m.Email, `^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$`); err != nil { + return err + } + + return nil +} + +func (m *StorageFacility) 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 *StorageFacility) validatePhone(formats strfmt.Registry) error { + if swag.IsZero(m.Phone) { // not required + return nil + } + + if err := validate.Pattern("phone", "body", *m.Phone, `^[2-9]\d{2}-\d{3}-\d{4}$`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this storage facility based on the context it is used +func (m *StorageFacility) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *StorageFacility) contextValidateAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.Address != nil { + + if swag.IsZero(m.Address) { // not required + return nil + } + + if err := m.Address.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("address") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("address") + } + return err + } + } + + return nil +} + +func (m *StorageFacility) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *StorageFacility) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *StorageFacility) UnmarshalBinary(b []byte) error { + var res StorageFacility + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item.go b/pkg/gen/primev3messages/update_m_t_o_service_item.go new file mode 100644 index 00000000000..458956f1f1d --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_service_item.go @@ -0,0 +1,188 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + "io" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItem UpdateMTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items. +// +// swagger:discriminator UpdateMTOServiceItem modelType +type UpdateMTOServiceItem interface { + runtime.Validatable + runtime.ContextValidatable + + // ID of the service item. Must match path. + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + ID() strfmt.UUID + SetID(strfmt.UUID) + + // model type + // Required: true + ModelType() UpdateMTOServiceItemModelType + SetModelType(UpdateMTOServiceItemModelType) + + // AdditionalProperties in base type shoud be handled just like regular properties + // At this moment, the base type property is pushed down to the subtype +} + +type updateMTOServiceItem struct { + idField strfmt.UUID + + modelTypeField UpdateMTOServiceItemModelType +} + +// ID gets the id of this polymorphic type +func (m *updateMTOServiceItem) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this polymorphic type +func (m *updateMTOServiceItem) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this polymorphic type +func (m *updateMTOServiceItem) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItem" +} + +// SetModelType sets the model type of this polymorphic type +func (m *updateMTOServiceItem) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalUpdateMTOServiceItemSlice unmarshals polymorphic slices of UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItemSlice(reader io.Reader, consumer runtime.Consumer) ([]UpdateMTOServiceItem, error) { + var elements []json.RawMessage + if err := consumer.Consume(reader, &elements); err != nil { + return nil, err + } + + var result []UpdateMTOServiceItem + for _, element := range elements { + obj, err := unmarshalUpdateMTOServiceItem(element, consumer) + if err != nil { + return nil, err + } + result = append(result, obj) + } + return result, nil +} + +// UnmarshalUpdateMTOServiceItem unmarshals polymorphic UpdateMTOServiceItem +func UnmarshalUpdateMTOServiceItem(reader io.Reader, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + // we need to read this twice, so first into a buffer + data, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + return unmarshalUpdateMTOServiceItem(data, consumer) +} + +func unmarshalUpdateMTOServiceItem(data []byte, consumer runtime.Consumer) (UpdateMTOServiceItem, error) { + buf := bytes.NewBuffer(data) + buf2 := bytes.NewBuffer(data) + + // the first time this is read is to fetch the value of the modelType property. + var getType struct { + ModelType string `json:"modelType"` + } + if err := consumer.Consume(buf, &getType); err != nil { + return nil, err + } + + if err := validate.RequiredString("modelType", "body", getType.ModelType); err != nil { + return nil, err + } + + // The value of modelType is used to determine which type to create and unmarshal the data into + switch getType.ModelType { + case "UpdateMTOServiceItem": + var result updateMTOServiceItem + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemSIT": + var result UpdateMTOServiceItemSIT + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + case "UpdateMTOServiceItemShuttle": + var result UpdateMTOServiceItemShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil + } + return nil, errors.New(422, "invalid modelType value: %q", getType.ModelType) +} + +// Validate validates this update m t o service item +func (m *updateMTOServiceItem) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) 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 +} + +// ContextValidate validate this update m t o service item based on the context it is used +func (m *updateMTOServiceItem) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateModelType(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *updateMTOServiceItem) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go b/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go new file mode 100644 index 00000000000..a1d95c43bb3 --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_service_item_model_type.go @@ -0,0 +1,86 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemModelType Using this list, choose the correct modelType in the dropdown, corresponding to the service item type. +// - DDDSIT - UpdateMTOServiceItemSIT +// - DOPSIT - UpdateMTOServiceItemSIT +// - DOASIT - UpdateMTOServiceItemSIT +// - DOFSIT - UpdateMTOServiceItemSIT +// - DDSHUT - UpdateMTOServiceItemShuttle +// - DOSHUT - UpdateMTOServiceItemShuttle +// +// The documentation will then update with the supported fields. +// +// swagger:model UpdateMTOServiceItemModelType +type UpdateMTOServiceItemModelType string + +func NewUpdateMTOServiceItemModelType(value UpdateMTOServiceItemModelType) *UpdateMTOServiceItemModelType { + return &value +} + +// Pointer returns a pointer to a freshly-allocated UpdateMTOServiceItemModelType. +func (m UpdateMTOServiceItemModelType) Pointer() *UpdateMTOServiceItemModelType { + return &m +} + +const ( + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT captures enum value "UpdateMTOServiceItemSIT" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemSIT UpdateMTOServiceItemModelType = "UpdateMTOServiceItemSIT" + + // UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle captures enum value "UpdateMTOServiceItemShuttle" + UpdateMTOServiceItemModelTypeUpdateMTOServiceItemShuttle UpdateMTOServiceItemModelType = "UpdateMTOServiceItemShuttle" +) + +// for schema +var updateMTOServiceItemModelTypeEnum []interface{} + +func init() { + var res []UpdateMTOServiceItemModelType + if err := json.Unmarshal([]byte(`["UpdateMTOServiceItemSIT","UpdateMTOServiceItemShuttle"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemModelTypeEnum = append(updateMTOServiceItemModelTypeEnum, v) + } +} + +func (m UpdateMTOServiceItemModelType) validateUpdateMTOServiceItemModelTypeEnum(path, location string, value UpdateMTOServiceItemModelType) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemModelTypeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this update m t o service item model type +func (m UpdateMTOServiceItemModelType) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateUpdateMTOServiceItemModelTypeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this update m t o service item model type based on context it is used +func (m UpdateMTOServiceItemModelType) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go b/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go new file mode 100644 index 00000000000..7012106e91e --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_service_item_s_i_t.go @@ -0,0 +1,680 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemSIT Subtype used to provide the departure date for origin or destination SIT. This is not creating a new service item but rather updating and existing service item. +// +// swagger:model UpdateMTOServiceItemSIT +type UpdateMTOServiceItemSIT struct { + idField strfmt.UUID + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemSIT) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemSIT) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemSIT" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemSIT) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemSIT) UnmarshalJSON(raw []byte) error { + var data struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemSIT + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.DateOfContact1 = data.DateOfContact1 + result.DateOfContact2 = data.DateOfContact2 + result.FirstAvailableDeliveryDate1 = data.FirstAvailableDeliveryDate1 + result.FirstAvailableDeliveryDate2 = data.FirstAvailableDeliveryDate2 + result.ReServiceCode = data.ReServiceCode + result.RequestApprovalsRequestedStatus = data.RequestApprovalsRequestedStatus + result.SitCustomerContacted = data.SitCustomerContacted + result.SitDepartureDate = data.SitDepartureDate + result.SitDestinationFinalAddress = data.SitDestinationFinalAddress + result.SitEntryDate = data.SitEntryDate + result.SitPostalCode = data.SitPostalCode + result.SitRequestedDelivery = data.SitRequestedDelivery + result.TimeMilitary1 = data.TimeMilitary1 + result.TimeMilitary2 = data.TimeMilitary2 + result.UpdateReason = data.UpdateReason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemSIT) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Date of attempted contact by the prime corresponding to 'timeMilitary1'. + // Format: date + DateOfContact1 *strfmt.Date `json:"dateOfContact1,omitempty"` + + // Date of attempted contact by the prime corresponding to 'timeMilitary2'. + // Format: date + DateOfContact2 *strfmt.Date `json:"dateOfContact2,omitempty"` + + // First available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate1 *strfmt.Date `json:"firstAvailableDeliveryDate1,omitempty"` + + // Second available date that Prime can deliver SIT service item. + // Format: date + FirstAvailableDeliveryDate2 *strfmt.Date `json:"firstAvailableDeliveryDate2,omitempty"` + + // Service code allowed for this model type. + // Enum: [DDDSIT DOPSIT DOASIT DOFSIT] + ReServiceCode string `json:"reServiceCode,omitempty"` + + // Indicates if "Approvals Requested" status is being requested. + RequestApprovalsRequestedStatus *bool `json:"requestApprovalsRequestedStatus,omitempty"` + + // Date when the customer contacted the prime for a delivery out of SIT. + // Format: date + SitCustomerContacted *strfmt.Date `json:"sitCustomerContacted,omitempty"` + + // Departure date for SIT. This is the end date of the SIT at either origin or destination. + // Format: date + SitDepartureDate strfmt.Date `json:"sitDepartureDate,omitempty"` + + // sit destination final address + SitDestinationFinalAddress *Address `json:"sitDestinationFinalAddress,omitempty"` + + // Entry date for the SIT. + // Format: date + SitEntryDate *strfmt.Date `json:"sitEntryDate,omitempty"` + + // sit postal code + // Example: 90210 + // Pattern: ^(\d{5}([\-]\d{4})?)$ + SitPostalCode *string `json:"sitPostalCode,omitempty"` + + // Date when the customer has requested delivery out of SIT. + // Format: date + SitRequestedDelivery *strfmt.Date `json:"sitRequestedDelivery,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact1', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary1 *string `json:"timeMilitary1,omitempty"` + + // Time of attempted contact by the prime corresponding to 'dateOfContact2', in military format. + // Example: 1400Z + // Pattern: \d{4}Z + TimeMilitary2 *string `json:"timeMilitary2,omitempty"` + + // Reason for updating service item. + UpdateReason *string `json:"updateReason,omitempty"` + }{ + + DateOfContact1: m.DateOfContact1, + + DateOfContact2: m.DateOfContact2, + + FirstAvailableDeliveryDate1: m.FirstAvailableDeliveryDate1, + + FirstAvailableDeliveryDate2: m.FirstAvailableDeliveryDate2, + + ReServiceCode: m.ReServiceCode, + + RequestApprovalsRequestedStatus: m.RequestApprovalsRequestedStatus, + + SitCustomerContacted: m.SitCustomerContacted, + + SitDepartureDate: m.SitDepartureDate, + + SitDestinationFinalAddress: m.SitDestinationFinalAddress, + + SitEntryDate: m.SitEntryDate, + + SitPostalCode: m.SitPostalCode, + + SitRequestedDelivery: m.SitRequestedDelivery, + + TimeMilitary1: m.TimeMilitary1, + + TimeMilitary2: m.TimeMilitary2, + + UpdateReason: m.UpdateReason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item s i t +func (m *UpdateMTOServiceItemSIT) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDateOfContact2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate2(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitCustomerContacted(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitDestinationFinalAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitPostalCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitRequestedDelivery(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary1(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTimeMilitary2(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) 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 *UpdateMTOServiceItemSIT) validateDateOfContact1(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact1) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact1", "body", "date", m.DateOfContact1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateDateOfContact2(formats strfmt.Registry) error { + + if swag.IsZero(m.DateOfContact2) { // not required + return nil + } + + if err := validate.FormatOf("dateOfContact2", "body", "date", m.DateOfContact2.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate1(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate1) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate1", "body", "date", m.FirstAvailableDeliveryDate1.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateFirstAvailableDeliveryDate2(formats strfmt.Registry) error { + + if swag.IsZero(m.FirstAvailableDeliveryDate2) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate2", "body", "date", m.FirstAvailableDeliveryDate2.String(), formats); err != nil { + return err + } + + return nil +} + +var updateMTOServiceItemSITTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDDSIT","DOPSIT","DOASIT","DOFSIT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemSITTypeReServiceCodePropEnum = append(updateMTOServiceItemSITTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemSIT) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemSITTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitCustomerContacted(formats strfmt.Registry) error { + + if swag.IsZero(m.SitCustomerContacted) { // not required + return nil + } + + if err := validate.FormatOf("sitCustomerContacted", "body", "date", m.SitCustomerContacted.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDepartureDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitDepartureDate", "body", "date", m.SitDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitDestinationFinalAddress(formats strfmt.Registry) error { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if m.SitDestinationFinalAddress != nil { + if err := m.SitDestinationFinalAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitEntryDate(formats strfmt.Registry) error { + + if swag.IsZero(m.SitEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEntryDate", "body", "date", m.SitEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitPostalCode(formats strfmt.Registry) error { + + if swag.IsZero(m.SitPostalCode) { // not required + return nil + } + + if err := validate.Pattern("sitPostalCode", "body", *m.SitPostalCode, `^(\d{5}([\-]\d{4})?)$`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateSitRequestedDelivery(formats strfmt.Registry) error { + + if swag.IsZero(m.SitRequestedDelivery) { // not required + return nil + } + + if err := validate.FormatOf("sitRequestedDelivery", "body", "date", m.SitRequestedDelivery.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary1(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary1) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary1", "body", *m.TimeMilitary1, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) validateTimeMilitary2(formats strfmt.Registry) error { + + if swag.IsZero(m.TimeMilitary2) { // not required + return nil + } + + if err := validate.Pattern("timeMilitary2", "body", *m.TimeMilitary2, `\d{4}Z`); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item s i t based on the context it is used +func (m *UpdateMTOServiceItemSIT) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateSitDestinationFinalAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *UpdateMTOServiceItemSIT) contextValidateSitDestinationFinalAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.SitDestinationFinalAddress != nil { + + if swag.IsZero(m.SitDestinationFinalAddress) { // not required + return nil + } + + if err := m.SitDestinationFinalAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitDestinationFinalAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitDestinationFinalAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemSIT) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemSIT + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go b/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go new file mode 100644 index 00000000000..b362432b80e --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_service_item_shuttle.go @@ -0,0 +1,264 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOServiceItemShuttle Subtype used to provide the estimated weight and actual weight for shuttle. This is not creating a new service item but rather updating an existing service item. +// +// swagger:model UpdateMTOServiceItemShuttle +type UpdateMTOServiceItemShuttle struct { + idField strfmt.UUID + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` +} + +// ID gets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *UpdateMTOServiceItemShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) ModelType() UpdateMTOServiceItemModelType { + return "UpdateMTOServiceItemShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *UpdateMTOServiceItemShuttle) SetModelType(val UpdateMTOServiceItemModelType) { +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *UpdateMTOServiceItemShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result UpdateMTOServiceItemShuttle + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m UpdateMTOServiceItemShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service code allowed for this model type. + // Enum: [DDSHUT DOSHUT] + ReServiceCode string `json:"reServiceCode,omitempty"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ID strfmt.UUID `json:"id,omitempty"` + + ModelType UpdateMTOServiceItemModelType `json:"modelType"` + }{ + + ID: m.ID(), + + ModelType: m.ModelType(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this update m t o service item shuttle +func (m *UpdateMTOServiceItemShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) 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 +} + +var updateMTOServiceItemShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DDSHUT","DOSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOServiceItemShuttleTypeReServiceCodePropEnum = append(updateMTOServiceItemShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *UpdateMTOServiceItemShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOServiceItemShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if swag.IsZero(m.ReServiceCode) { // not required + return nil + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item shuttle based on the context it is used +func (m *UpdateMTOServiceItemShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemShuttle) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_shipment.go b/pkg/gen/primev3messages/update_m_t_o_shipment.go new file mode 100644 index 00000000000..f59cf73c256 --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_shipment.go @@ -0,0 +1,690 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipment update m t o shipment +// +// swagger:model UpdateMTOShipment +type UpdateMTOShipment struct { + + // The date when the Prime contractor actually delivered the shipment. Updated after-the-fact. + // Format: date + ActualDeliveryDate *strfmt.Date `json:"actualDeliveryDate"` + + // The date when the Prime contractor actually picked up the shipment. Updated after-the-fact. + // Format: date + ActualPickupDate *strfmt.Date `json:"actualPickupDate"` + + // The actual weight of any pro gear shipped during a move. + // Example: 4500 + ActualProGearWeight *int64 `json:"actualProGearWeight,omitempty"` + + // The actual weight of any pro gear shipped during a move. + // Example: 4500 + ActualSpouseProGearWeight *int64 `json:"actualSpouseProGearWeight,omitempty"` + + // counselor remarks + // Example: counselor approved + CounselorRemarks *string `json:"counselorRemarks,omitempty"` + + // Where the movers should deliver this shipment. Often provided by the customer when they enter shipment details + // during onboarding, if they know their new address already. + // + // May be blank when entered by the customer, required when entered by the Prime. May not represent the true + // final destination due to the shipment being diverted or placed in SIT. + // + DestinationAddress struct { + Address + } `json:"destinationAddress,omitempty"` + + // destination type + DestinationType *DestinationType `json:"destinationType,omitempty"` + + // This value indicates whether or not this shipment is part of a diversion. If yes, the shipment can be either the starting or ending segment of the diversion. + // + Diversion bool `json:"diversion,omitempty"` + + // The date the Prime provides to the customer as the first possible delivery date so that they can plan their travel accordingly. + // + // Format: date + FirstAvailableDeliveryDate *strfmt.Date `json:"firstAvailableDeliveryDate"` + + // The previously recorded weight for the NTS Shipment. Used for NTS Release to know what the previous primeActualWeight or billable weight was. + // Example: 4500 + NtsRecordedWeight *int64 `json:"ntsRecordedWeight,omitempty"` + + // The address where the movers should pick up this shipment, entered by the customer during onboarding when they enter shipment details. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // Email or ID of the person who will be contacted in the event of questions or concerns about this update. May be the person performing the update, or someone else working with the Prime contractor. + // + PointOfContact string `json:"pointOfContact,omitempty"` + + // port of debarkation + PortOfDebarkation *Port `json:"portOfDebarkation,omitempty"` + + // port of embarkation + PortOfEmbarkation *Port `json:"portOfEmbarkation,omitempty"` + + // ppm shipment + PpmShipment *UpdatePPMShipment `json:"ppmShipment,omitempty"` + + // The actual weight of the shipment, provided after the Prime packs, picks up, and weighs a customer's shipment. + // Example: 4500 + // Minimum: 1 + PrimeActualWeight *int64 `json:"primeActualWeight,omitempty"` + + // The estimated weight of this shipment, determined by the movers during the pre-move survey. This value **can only be updated once.** If there was an issue with estimating the weight and a mistake was made, the Prime contracter will need to contact the TOO to change it. + // + // Example: 4500 + // Minimum: 1 + PrimeEstimatedWeight *int64 `json:"primeEstimatedWeight,omitempty"` + + // The date the Prime contractor scheduled to deliver this shipment after consultation with the customer. + // Format: date + ScheduledDeliveryDate *strfmt.Date `json:"scheduledDeliveryDate"` + + // The date the Prime contractor scheduled to pick up this shipment after consultation with the customer. + // Format: date + ScheduledPickupDate *strfmt.Date `json:"scheduledPickupDate"` + + // A second delivery address for this shipment, if the customer entered one. An optional field. + SecondaryDeliveryAddress struct { + Address + } `json:"secondaryDeliveryAddress,omitempty"` + + // A second pickup address for this shipment, if the customer entered one. An optional field. + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // shipment type + ShipmentType MTOShipmentType `json:"shipmentType,omitempty"` + + // storage facility + StorageFacility *StorageFacility `json:"storageFacility,omitempty"` + + // A third delivery address for this shipment, if the customer entered one. An optional field. + TertiaryDeliveryAddress struct { + Address + } `json:"tertiaryDeliveryAddress,omitempty"` + + // A third pickup address for this shipment, if the customer entered one. An optional field. + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this update m t o shipment +func (m *UpdateMTOShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateActualDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateActualPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateDestinationType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAvailableDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortOfDebarkation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePortOfEmbarkation(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePpmShipment(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeActualWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePrimeEstimatedWeight(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledDeliveryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateScheduledPickupDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStorageFacility(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDeliveryAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) validateActualDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("actualDeliveryDate", "body", "date", m.ActualDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateActualPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ActualPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("actualPickupDate", "body", "date", m.ActualPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateDestinationType(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if m.DestinationType != nil { + if err := m.DestinationType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validateFirstAvailableDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAvailableDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("firstAvailableDeliveryDate", "body", "date", m.FirstAvailableDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validatePortOfDebarkation(formats strfmt.Registry) error { + if swag.IsZero(m.PortOfDebarkation) { // not required + return nil + } + + if m.PortOfDebarkation != nil { + if err := m.PortOfDebarkation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfDebarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfDebarkation") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validatePortOfEmbarkation(formats strfmt.Registry) error { + if swag.IsZero(m.PortOfEmbarkation) { // not required + return nil + } + + if m.PortOfEmbarkation != nil { + if err := m.PortOfEmbarkation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfEmbarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfEmbarkation") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validatePpmShipment(formats strfmt.Registry) error { + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if m.PpmShipment != nil { + if err := m.PpmShipment.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeActualWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeActualWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeActualWeight", "body", *m.PrimeActualWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validatePrimeEstimatedWeight(formats strfmt.Registry) error { + if swag.IsZero(m.PrimeEstimatedWeight) { // not required + return nil + } + + if err := validate.MinimumInt("primeEstimatedWeight", "body", *m.PrimeEstimatedWeight, 1, false); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledDeliveryDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledDeliveryDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledDeliveryDate", "body", "date", m.ScheduledDeliveryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateScheduledPickupDate(formats strfmt.Registry) error { + if swag.IsZero(m.ScheduledPickupDate) { // not required + return nil + } + + if err := validate.FormatOf("scheduledPickupDate", "body", "date", m.ScheduledPickupDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateShipmentType(formats strfmt.Registry) error { + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) validateStorageFacility(formats strfmt.Registry) error { + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if m.StorageFacility != nil { + if err := m.StorageFacility.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) validateTertiaryDeliveryAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDeliveryAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdateMTOShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +// ContextValidate validate this update m t o shipment based on the context it is used +func (m *UpdateMTOShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateDestinationType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePortOfDebarkation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePortOfEmbarkation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePpmShipment(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateShipmentType(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStorageFacility(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDeliveryAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateDestinationType(ctx context.Context, formats strfmt.Registry) error { + + if m.DestinationType != nil { + + if swag.IsZero(m.DestinationType) { // not required + return nil + } + + if err := m.DestinationType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("destinationType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("destinationType") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePortOfDebarkation(ctx context.Context, formats strfmt.Registry) error { + + if m.PortOfDebarkation != nil { + + if swag.IsZero(m.PortOfDebarkation) { // not required + return nil + } + + if err := m.PortOfDebarkation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfDebarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfDebarkation") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePortOfEmbarkation(ctx context.Context, formats strfmt.Registry) error { + + if m.PortOfEmbarkation != nil { + + if swag.IsZero(m.PortOfEmbarkation) { // not required + return nil + } + + if err := m.PortOfEmbarkation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("portOfEmbarkation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("portOfEmbarkation") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidatePpmShipment(ctx context.Context, formats strfmt.Registry) error { + + if m.PpmShipment != nil { + + if swag.IsZero(m.PpmShipment) { // not required + return nil + } + + if err := m.PpmShipment.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("ppmShipment") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("ppmShipment") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateShipmentType(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.ShipmentType) { // not required + return nil + } + + if err := m.ShipmentType.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("shipmentType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("shipmentType") + } + return err + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateStorageFacility(ctx context.Context, formats strfmt.Registry) error { + + if m.StorageFacility != nil { + + if swag.IsZero(m.StorageFacility) { // not required + return nil + } + + if err := m.StorageFacility.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("storageFacility") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("storageFacility") + } + return err + } + } + + return nil +} + +func (m *UpdateMTOShipment) contextValidateTertiaryDeliveryAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdateMTOShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipment) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_m_t_o_shipment_status.go b/pkg/gen/primev3messages/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..d1831f0f42b --- /dev/null +++ b/pkg/gen/primev3messages/update_m_t_o_shipment_status.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipmentStatus Contains the statuses available to the Prime when updating the state of a shipment. +// +// swagger:model UpdateMTOShipmentStatus +type UpdateMTOShipmentStatus struct { + + // status + // Enum: [CANCELED] + Status string `json:"status,omitempty"` +} + +// Validate validates this update m t o shipment status +func (m *UpdateMTOShipmentStatus) 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 +} + +var updateMTOShipmentStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["CANCELED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) + } +} + +const ( + + // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" + UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" +) + +// prop value enum +func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update m t o shipment status based on context it is used +func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipmentStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_p_p_m_shipment.go b/pkg/gen/primev3messages/update_p_p_m_shipment.go new file mode 100644 index 00000000000..097575b0240 --- /dev/null +++ b/pkg/gen/primev3messages/update_p_p_m_shipment.go @@ -0,0 +1,373 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePPMShipment The PPM specific fields of the shipment with values being changed +// +// swagger:model UpdatePPMShipment +type UpdatePPMShipment struct { + + // The address of the destination location where goods are being delivered to. + // + DestinationAddress struct { + PPMDestinationAddress + } `json:"destinationAddress,omitempty"` + + // The estimated weight of the PPM shipment goods being moved. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight,omitempty"` + + // Date the customer expects to begin moving from their origin. + // + // Format: date + ExpectedDepartureDate *strfmt.Date `json:"expectedDepartureDate,omitempty"` + + // Indicates whether PPM shipment has pro gear for themselves or their spouse. + // + HasProGear *bool `json:"hasProGear,omitempty"` + + // has secondary destination address + HasSecondaryDestinationAddress *bool `json:"hasSecondaryDestinationAddress"` + + // has secondary pickup address + HasSecondaryPickupAddress *bool `json:"hasSecondaryPickupAddress"` + + // has tertiary destination address + HasTertiaryDestinationAddress *bool `json:"hasTertiaryDestinationAddress"` + + // has tertiary pickup address + HasTertiaryPickupAddress *bool `json:"hasTertiaryPickupAddress"` + + // Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. + // Example: false + IsActualExpenseReimbursement *bool `json:"isActualExpenseReimbursement"` + + // The address of the origin location where goods are being moved from. + // + PickupAddress struct { + Address + } `json:"pickupAddress,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to the service member. + ProGearWeight *int64 `json:"proGearWeight,omitempty"` + + // An optional secondary address near the destination where goods will be dropped off. + // + SecondaryDestinationAddress struct { + Address + } `json:"secondaryDestinationAddress,omitempty"` + + // An optional secondary Pickup Address near the origin where additional goods exist. + // + SecondaryPickupAddress struct { + Address + } `json:"secondaryPickupAddress,omitempty"` + + // The date that goods will exit the storage location. + // Format: date + SitEstimatedDepartureDate *strfmt.Date `json:"sitEstimatedDepartureDate,omitempty"` + + // The date that goods will first enter the storage location. + // Format: date + SitEstimatedEntryDate *strfmt.Date `json:"sitEstimatedEntryDate,omitempty"` + + // The estimated weight of the goods being put into storage. + // Example: 2000 + SitEstimatedWeight *int64 `json:"sitEstimatedWeight,omitempty"` + + // Captures whether some or all of the PPM shipment will require temporary storage at the origin or destination. + // + // Must be set to `true` when providing `sitLocation`, `sitEstimatedWeight`, `sitEstimatedEntryDate`, and `sitEstimatedDepartureDate` values to calculate the `sitEstimatedCost`. + // + SitExpected *bool `json:"sitExpected,omitempty"` + + // sit location + SitLocation *SITLocationType `json:"sitLocation,omitempty"` + + // The estimated weight of the pro-gear being moved belonging to a spouse. + SpouseProGearWeight *int64 `json:"spouseProGearWeight,omitempty"` + + // An optional third address near the destination where goods will be dropped off. + // + TertiaryDestinationAddress struct { + Address + } `json:"tertiaryDestinationAddress,omitempty"` + + // An optional third Pickup Address near the origin where additional goods exist. + // + TertiaryPickupAddress struct { + Address + } `json:"tertiaryPickupAddress,omitempty"` +} + +// Validate validates this update p p m shipment +func (m *UpdatePPMShipment) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateExpectedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSecondaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedDepartureDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitEstimatedEntryDate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSitLocation(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryDestinationAddress(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTertiaryPickupAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) validateDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.DestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateExpectedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.ExpectedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("expectedDepartureDate", "body", "date", m.ExpectedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validatePickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.PickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSecondaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.SecondaryPickupAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedDepartureDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedDepartureDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedDepartureDate", "body", "date", m.SitEstimatedDepartureDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitEstimatedEntryDate(formats strfmt.Registry) error { + if swag.IsZero(m.SitEstimatedEntryDate) { // not required + return nil + } + + if err := validate.FormatOf("sitEstimatedEntryDate", "body", "date", m.SitEstimatedEntryDate.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UpdatePPMShipment) validateSitLocation(formats strfmt.Registry) error { + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if m.SitLocation != nil { + if err := m.SitLocation.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryDestinationAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryDestinationAddress) { // not required + return nil + } + + return nil +} + +func (m *UpdatePPMShipment) validateTertiaryPickupAddress(formats strfmt.Registry) error { + if swag.IsZero(m.TertiaryPickupAddress) { // not required + return nil + } + + return nil +} + +// ContextValidate validate this update p p m shipment based on the context it is used +func (m *UpdatePPMShipment) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSecondaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateSitLocation(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryDestinationAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateTertiaryPickupAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePPMShipment) contextValidateDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidatePickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSecondaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateSitLocation(ctx context.Context, formats strfmt.Registry) error { + + if m.SitLocation != nil { + + if swag.IsZero(m.SitLocation) { // not required + return nil + } + + if err := m.SitLocation.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("sitLocation") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("sitLocation") + } + return err + } + } + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryDestinationAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +func (m *UpdatePPMShipment) contextValidateTertiaryPickupAddress(ctx context.Context, formats strfmt.Registry) error { + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePPMShipment) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePPMShipment) UnmarshalBinary(b []byte) error { + var res UpdatePPMShipment + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_reweigh.go b/pkg/gen/primev3messages/update_reweigh.go new file mode 100644 index 00000000000..f33b8152c13 --- /dev/null +++ b/pkg/gen/primev3messages/update_reweigh.go @@ -0,0 +1,79 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateReweigh Contains the fields available to the Prime when updating a reweigh record. +// +// swagger:model UpdateReweigh +type UpdateReweigh struct { + + // In lieu of a document being uploaded indicating why a reweigh did not occur. + // Example: The reweigh was not performed because the shipment was already delivered + VerificationReason *string `json:"verificationReason"` + + // The total reweighed weight for the shipment in pounds. + // Example: 2000 + // Minimum: 1 + Weight *int64 `json:"weight"` +} + +// Validate validates this update reweigh +func (m *UpdateReweigh) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateWeight(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateReweigh) validateWeight(formats strfmt.Registry) error { + if swag.IsZero(m.Weight) { // not required + return nil + } + + if err := validate.MinimumInt("weight", "body", *m.Weight, 1, false); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update reweigh based on context it is used +func (m *UpdateReweigh) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateReweigh) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateReweigh) UnmarshalBinary(b []byte) error { + var res UpdateReweigh + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/update_shipment_destination_address.go b/pkg/gen/primev3messages/update_shipment_destination_address.go new file mode 100644 index 00000000000..c4d7dd58866 --- /dev/null +++ b/pkg/gen/primev3messages/update_shipment_destination_address.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateShipmentDestinationAddress UpdateShipmentDestinationAddress contains the fields required for the prime to request an update for the delivery address on an MTO Shipment. +// +// swagger:model UpdateShipmentDestinationAddress +type UpdateShipmentDestinationAddress struct { + + // This is the remark the Prime has entered, which would be the reason there is an address change. + // Example: Customer reached out to me this week and let me know they want to move somewhere else. + // Required: true + ContractorRemarks *string `json:"contractorRemarks"` + + // new address + // Required: true + NewAddress *Address `json:"newAddress"` +} + +// Validate validates this update shipment destination address +func (m *UpdateShipmentDestinationAddress) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateContractorRemarks(formats); err != nil { + res = append(res, err) + } + + if err := m.validateNewAddress(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateContractorRemarks(formats strfmt.Registry) error { + + if err := validate.Required("contractorRemarks", "body", m.ContractorRemarks); err != nil { + return err + } + + return nil +} + +func (m *UpdateShipmentDestinationAddress) validateNewAddress(formats strfmt.Registry) error { + + if err := validate.Required("newAddress", "body", m.NewAddress); err != nil { + return err + } + + if m.NewAddress != nil { + if err := m.NewAddress.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// ContextValidate validate this update shipment destination address based on the context it is used +func (m *UpdateShipmentDestinationAddress) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateNewAddress(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateShipmentDestinationAddress) contextValidateNewAddress(ctx context.Context, formats strfmt.Registry) error { + + if m.NewAddress != nil { + + if err := m.NewAddress.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("newAddress") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("newAddress") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateShipmentDestinationAddress) UnmarshalBinary(b []byte) error { + var res UpdateShipmentDestinationAddress + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/upload_with_omissions.go b/pkg/gen/primev3messages/upload_with_omissions.go new file mode 100644 index 00000000000..5f1f05294c0 --- /dev/null +++ b/pkg/gen/primev3messages/upload_with_omissions.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadWithOmissions An uploaded file. +// +// swagger:model UploadWithOmissions +type UploadWithOmissions struct { + + // bytes + // Required: true + Bytes *int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + ContentType *string `json:"contentType"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + Filename *string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // rotation + Rotation int64 `json:"rotation,omitempty"` + + // status + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this upload with omissions +func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", m.Bytes); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { + + if err := validate.Required("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) 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 +} + +var uploadWithOmissionsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) + } +} + +const ( + + // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" + UploadWithOmissionsStatusINFECTED string = "INFECTED" + + // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" + UploadWithOmissionsStatusCLEAN string = "CLEAN" + + // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" + UploadWithOmissionsStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload with omissions based on the context it is used +func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { + var res UploadWithOmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/validation_error.go b/pkg/gen/primev3messages/validation_error.go new file mode 100644 index 00000000000..7494eb49eb9 --- /dev/null +++ b/pkg/gen/primev3messages/validation_error.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + // invalid fields + // Required: true + InvalidFields map[string][]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.InvalidFields = dataAO1.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + + dataAO1.InvalidFields = m.InvalidFields + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportapi/configure_mymove.go b/pkg/gen/supportapi/configure_mymove.go new file mode 100644 index 00000000000..ff1c6783df9 --- /dev/null +++ b/pkg/gen/supportapi/configure_mymove.go @@ -0,0 +1,145 @@ +// This file is safe to edit. Once it exists it will not be overwritten + +package supportapi + +import ( + "crypto/tls" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/payment_request" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/webhook" +) + +//go:generate swagger generate server --target ../../gen --name Mymove --spec ../../../swagger/support.yaml --api-package supportoperations --model-package supportmessages --server-package supportapi --principal interface{} --exclude-main + +func configureFlags(api *supportoperations.MymoveAPI) { + // api.CommandLineOptionsGroups = []swag.CommandLineOptionsGroup{ ... } +} + +func configureAPI(api *supportoperations.MymoveAPI) http.Handler { + // configure the api here + api.ServeError = errors.ServeError + + // Set your custom logger if needed. Default one is log.Printf + // Expected interface func(string, ...interface{}) + // + // Example: + // api.Logger = log.Printf + + api.UseSwaggerUI() + // To continue using redoc as your UI, uncomment the following line + // api.UseRedoc() + + api.JSONConsumer = runtime.JSONConsumer() + + api.JSONProducer = runtime.JSONProducer() + + if api.MoveTaskOrderCreateMoveTaskOrderHandler == nil { + api.MoveTaskOrderCreateMoveTaskOrderHandler = move_task_order.CreateMoveTaskOrderHandlerFunc(func(params move_task_order.CreateMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.CreateMoveTaskOrder has not yet been implemented") + }) + } + if api.WebhookCreateWebhookNotificationHandler == nil { + api.WebhookCreateWebhookNotificationHandler = webhook.CreateWebhookNotificationHandlerFunc(func(params webhook.CreateWebhookNotificationParams) middleware.Responder { + return middleware.NotImplemented("operation webhook.CreateWebhookNotification has not yet been implemented") + }) + } + if api.MoveTaskOrderGetMoveTaskOrderHandler == nil { + api.MoveTaskOrderGetMoveTaskOrderHandler = move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }) + } + if api.PaymentRequestGetPaymentRequestEDIHandler == nil { + api.PaymentRequestGetPaymentRequestEDIHandler = payment_request.GetPaymentRequestEDIHandlerFunc(func(params payment_request.GetPaymentRequestEDIParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.GetPaymentRequestEDI has not yet been implemented") + }) + } + if api.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler == nil { + api.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler = move_task_order.HideNonFakeMoveTaskOrdersHandlerFunc(func(params move_task_order.HideNonFakeMoveTaskOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.HideNonFakeMoveTaskOrders has not yet been implemented") + }) + } + if api.PaymentRequestListMTOPaymentRequestsHandler == nil { + api.PaymentRequestListMTOPaymentRequestsHandler = payment_request.ListMTOPaymentRequestsHandlerFunc(func(params payment_request.ListMTOPaymentRequestsParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.ListMTOPaymentRequests has not yet been implemented") + }) + } + if api.MoveTaskOrderListMTOsHandler == nil { + api.MoveTaskOrderListMTOsHandler = move_task_order.ListMTOsHandlerFunc(func(params move_task_order.ListMTOsParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.ListMTOs has not yet been implemented") + }) + } + if api.MoveTaskOrderMakeMoveTaskOrderAvailableHandler == nil { + api.MoveTaskOrderMakeMoveTaskOrderAvailableHandler = move_task_order.MakeMoveTaskOrderAvailableHandlerFunc(func(params move_task_order.MakeMoveTaskOrderAvailableParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.MakeMoveTaskOrderAvailable has not yet been implemented") + }) + } + if api.PaymentRequestProcessReviewedPaymentRequestsHandler == nil { + api.PaymentRequestProcessReviewedPaymentRequestsHandler = payment_request.ProcessReviewedPaymentRequestsHandlerFunc(func(params payment_request.ProcessReviewedPaymentRequestsParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.ProcessReviewedPaymentRequests has not yet been implemented") + }) + } + if api.PaymentRequestRecalculatePaymentRequestHandler == nil { + api.PaymentRequestRecalculatePaymentRequestHandler = payment_request.RecalculatePaymentRequestHandlerFunc(func(params payment_request.RecalculatePaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.RecalculatePaymentRequest has not yet been implemented") + }) + } + if api.WebhookReceiveWebhookNotificationHandler == nil { + api.WebhookReceiveWebhookNotificationHandler = webhook.ReceiveWebhookNotificationHandlerFunc(func(params webhook.ReceiveWebhookNotificationParams) middleware.Responder { + return middleware.NotImplemented("operation webhook.ReceiveWebhookNotification has not yet been implemented") + }) + } + if api.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { + api.MtoServiceItemUpdateMTOServiceItemStatusHandler = mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") + }) + } + if api.MtoShipmentUpdateMTOShipmentStatusHandler == nil { + api.MtoShipmentUpdateMTOShipmentStatusHandler = mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") + }) + } + if api.PaymentRequestUpdatePaymentRequestStatusHandler == nil { + api.PaymentRequestUpdatePaymentRequestStatusHandler = payment_request.UpdatePaymentRequestStatusHandlerFunc(func(params payment_request.UpdatePaymentRequestStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.UpdatePaymentRequestStatus has not yet been implemented") + }) + } + + api.PreServerShutdown = func() {} + + api.ServerShutdown = func() {} + + return setupGlobalMiddleware(api.Serve(setupMiddlewares)) +} + +// The TLS configuration before HTTPS server starts. +func configureTLS(tlsConfig *tls.Config) { + // Make all necessary changes to the TLS configuration here. +} + +// As soon as server is initialized but not run yet, this function will be called. +// If you need to modify a config, store server instance to stop it individually later, this is the place. +// This function can be called multiple times, depending on the number of serving schemes. +// scheme value will be set accordingly: "http", "https" or "unix". +func configureServer(s *http.Server, scheme, addr string) { +} + +// The middleware configuration is for the handler executors. These do not apply to the swagger.json document. +// The middleware executes after routing but before authentication, binding and validation. +func setupMiddlewares(handler http.Handler) http.Handler { + return handler +} + +// The middleware configuration happens before anything, this middleware also applies to serving the swagger.json document. +// So this is a good place to plug in a panic handling middleware, logging and metrics. +func setupGlobalMiddleware(handler http.Handler) http.Handler { + return handler +} diff --git a/pkg/gen/supportapi/doc.go b/pkg/gen/supportapi/doc.go new file mode 100644 index 00000000000..b7c7b94796e --- /dev/null +++ b/pkg/gen/supportapi/doc.go @@ -0,0 +1,26 @@ +// Code generated by go-swagger; DO NOT EDIT. + +// Package supportapi MilMove Support API +// +// The Support API gives you programmatic access to support functionality useful +// for testing and debugging. **This API is not available in the Production +// environment**. +// +// All endpoints are located at `/support/v1/`. +// +// Schemes: +// http +// Host: localhost +// BasePath: /support/v1 +// Version: 0.0.1 +// License: MIT https://opensource.org/licenses/MIT +// Contact: +// +// Consumes: +// - application/json +// +// Produces: +// - application/json +// +// swagger:meta +package supportapi diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go new file mode 100644 index 00000000000..65ee2ddea96 --- /dev/null +++ b/pkg/gen/supportapi/embedded_spec.go @@ -0,0 +1,5480 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportapi + +// 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" +) + +var ( + // SwaggerJSON embedded version of the swagger document used at generation time + SwaggerJSON json.RawMessage + // FlatSwaggerJSON embedded flattened version of the swagger document used at generation time + FlatSwaggerJSON json.RawMessage +) + +func init() { + SwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Support API gives you programmatic access to support functionality useful\nfor testing and debugging. **This API is not available in the Production\nenvironment**.\n\nAll endpoints are located at ` + "`" + `/support/v1/` + "`" + `.\n", + "title": "MilMove Support API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/support/v1", + "paths": { + "/move-task-orders": { + "get": { + "description": "### Functionality\nThis endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "listMTOs", + "operationId": "listMTOs", + "parameters": [ + { + "type": "integer", + "format": "timestamp", + "description": "Only return move task orders updated since this time.", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all move task orders.", + "schema": { + "$ref": "#/definitions/MoveTaskOrders" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "post": { + "description": "Creates an instance of moveTaskOrder.\nCurrently this will also create a number of nested objects but not all.\nIt will currently create\n* MoveTaskOrder\n* Order\n* Customer\n* User\n* Entitlement\n\nIt will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID,\norigin duty station ID, and an uploaded orders ID to be passed into the request.\n\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "createMoveTaskOrder", + "operationId": "createMoveTaskOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + } + ], + "responses": { + "201": { + "description": "Successfully created MoveTaskOrder object.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/hide": { + "patch": { + "description": "Updates move task order without fake user data ` + "`" + `show` + "`" + ` to false. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "hideNonFakeMoveTaskOrders", + "operationId": "hideNonFakeMoveTaskOrders", + "responses": { + "200": { + "description": "Successfully hid MTOs.", + "schema": { + "$ref": "#/definitions/MTOHideMovesResponse" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\nThis is a support endpoint and is not available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of move task order to use.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/available-to-prime": { + "patch": { + "description": "Updates move task order ` + "`" + `availableToPrimeAt` + "`" + ` to make it available to prime. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "makeMoveTaskOrderAvailable", + "operationId": "makeMoveTaskOrderAvailable", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + } + ], + "responses": { + "200": { + "description": "Successfully made MTO available to Prime.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of move task order.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/payment-requests": { + "get": { + "description": "### Functionality\n\nThis endpoint lists all PaymentRequests associated with a given MoveTaskOrder.\n\nThis is a support endpoint and is not available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "listMTOPaymentRequests", + "operationId": "listMTOPaymentRequests", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Only return move task orders updated since this time.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved payment requests associated with a given move task order", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}/status": { + "patch": { + "description": "Updates the status of a service item for a move to APPROVED or REJECTED. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "updateMTOServiceItemStatus", + "operationId": "updateMTOServiceItemStatus", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOServiceItemStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated service item status for a move task order.", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of mto service item to use.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/mto-shipments/{mtoShipmentID}/status": { + "patch": { + "description": "Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, ` + "`" + `rejectionReason` + "`" + ` should be blank and any value passed through the body will be ignored. If REJECTED, a value in ` + "`" + `rejectionReason` + "`" + ` is required. \u003cbr /\u003e \u003cbr /\u003e This is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentStatus", + "operationId": "updateMTOShipmentStatus", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipmentStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the shipment's status.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/process-reviewed": { + "patch": { + "description": "Updates the status of reviewed payment requests and sends PRs to Syncada if\nthe SendToSyncada flag is set\n\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "processReviewedPaymentRequests", + "operationId": "processReviewedPaymentRequests", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ProcessReviewedPaymentRequests" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated status of reviewed payment request and sent to Syncada if that flag is set", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/payment-requests/{paymentRequestID}/edi": { + "get": { + "description": "Returns the EDI (Electronic Data Interchange) message for the payment request identified\nby the given payment request ID. Note that the EDI returned in the JSON payload will have where there\nwould normally be line breaks (due to JSON not allowing line breaks in a string).\n\nThis is a support endpoint and will not be available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "getPaymentRequestEDI", + "operationId": "getPaymentRequestEDI", + "responses": { + "200": { + "description": "Successfully retrieved payment requests associated with a given move task order", + "schema": { + "$ref": "#/definitions/PaymentRequestEDI" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the payment request for which EDI should be generated.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/recalculate": { + "post": { + "description": "Recalculates an existing pending payment request by creating a new payment request for the same service\nitems but is priced based on the current inputs (weights, dates, etc.). The previously existing payment\nrequest is then deprecated. A link is made between the new and existing payment requests.\n\nThis is a support endpoint and will not be available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "recalculatePaymentRequest", + "operationId": "recalculatePaymentRequest", + "responses": { + "201": { + "description": "The new payment request with recalculated pricing.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the payment request to recalculate.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/status": { + "patch": { + "description": "Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED.\n\nA status of REVIEWED can optionally have a ` + "`" + `rejectionReason` + "`" + `.\n\nThis is a support endpoint and is not available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "updatePaymentRequestStatus", + "operationId": "updatePaymentRequestStatus", + "parameters": [ + { + "$ref": "#/parameters/ifMatch" + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePaymentRequestStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated payment request status.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/webhook-notifications": { + "post": { + "description": "This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhook" + ], + "summary": "Test endpoint for creating webhook notifications", + "operationId": "createWebhookNotification", + "parameters": [ + { + "description": "The notification sent by webhook-client.", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + } + ], + "responses": { + "201": { + "description": "Successful creation", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + }, + "/webhook-notify": { + "post": { + "description": "This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The ` + "`" + `webhook-client` + "`" + ` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhook" + ], + "summary": "Test endpoint for receiving messages from our own webhook-client", + "operationId": "receiveWebhookNotification", + "parameters": [ + { + "description": "The webhook notification being sent", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + } + ], + "responses": { + "200": { + "description": "Received notification", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "401": { + "$ref": "#/responses/PermissionDenied" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "500": { + "$ref": "#/responses/ServerError" + } + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "Customer": { + "type": "object", + "required": [ + "firstName", + "lastName", + "dodID", + "rank", + "agency" + ], + "properties": { + "agency": { + "type": "string", + "title": "Agency customer is affilated with" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "rank": { + "$ref": "#/definitions/Rank" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "Document": { + "type": "object", + "required": [ + "id", + "serviceMemberID", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMemberID": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "DutyLocation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlement": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "readOnly": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "readOnly": true, + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "type": "string", + "title": "MTO Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOHideMove": { + "description": "describes the MTO ID and a description reason why the move was hidden.", + "type": "object", + "properties": { + "hideReason": { + "description": "Reason the move was selected to be hidden", + "type": "string", + "x-nullable": true, + "example": "invalid name" + }, + "moveTaskOrderID": { + "description": "ID of the associated moveTaskOrder", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "MTOHideMovesResponse": { + "description": "describes the moves that were hidden that contained non-approved fake data to use in the MilMove system.", + "type": "object", + "properties": { + "moves": { + "description": "Array of moves that were hidden.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOHideMove" + } + }, + "numberMovesHidden": { + "description": "Number of moves that were hidden", + "type": "integer" + } + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "ETag identifier required to update this object", + "type": "string", + "readOnly": true + }, + "id": { + "description": "ID of the service item", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "ID of the associated moveTaskOrder", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "ID of the associated mtoShipment", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "Full descriptive name of the service", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "Reason the service item was rejected by the TOO", + "type": "string", + "x-nullable": true, + "example": "item was too heavy" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "dateOfContact1", + "timeMilitary1", + "firstAvailableDeliveryDate1", + "dateOfContact2", + "timeMilitary2", + "firstAvailableDeliveryDate2", + "sitEntryDate" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date" + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date" + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "Describes a dimension object for the MTOServiceItem.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "$ref": "#/definitions/MTOServiceItemDimension" + }, + "description": { + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "$ref": "#/definitions/MTOServiceItemDimension" + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode", + "description" + ], + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "Explanation of why a shuttle service is required.", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "Describes all statuses for a MTOServiceItem.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + }, + "MTOShipment": { + "properties": { + "actualPickupDate": { + "type": "string", + "format": "date" + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "date when the shipment was given the status \"APPROVED\"", + "type": "string", + "format": "date", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "diversion": { + "type": "boolean" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "pointOfContact": { + "description": "Email or id of a contact person for this update.", + "type": "string" + }, + "primeActualWeight": { + "type": "integer", + "example": 4500 + }, + "primeEstimatedWeight": { + "type": "integer", + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "MTO Shipment not good enough" + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "requiredDeliveryDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "scheduledPickupDate": { + "type": "string", + "format": "date" + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "SUBMITTED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MoveStatus": { + "description": "Current status of this MoveTaskOrder", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "order", + "contractorID" + ], + "properties": { + "approvedAt": { + "description": "Indicates this MoveTaskOrder has been approved by an office user such as the Task Ordering Officer (TOO).\n", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "description": "Indicates this MoveTaskOrder is available for Prime API handling.\n\nIn production, only MoveTaskOrders for which this is set will be available to the API.\n", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "contractorID": { + "description": "ID associated with the contractor, in this case Prime\n", + "type": "string", + "format": "uuid", + "example": "5db13bb4-6d29-4bdb-bc81-262f4513ecf6" + }, + "createdAt": { + "description": "Date the MoveTaskOrder was created on.", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "Uniquely identifies the state of the MoveTaskOrder object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this MoveTaskOrder will require that this eTag be passed in with the If-Match header.\n", + "type": "string", + "readOnly": true + }, + "id": { + "description": "ID of the MoveTaskOrder object.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "description": "Unique 6-character code the customer can use to refer to their move", + "type": "string", + "readOnly": true, + "example": "ABC123" + }, + "mtoServiceItems": { + "description": "Array of MTOServiceItems associated with this MoveTaskOrder.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "description": "ID of the Order object", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "description": "If the move is a PPM, this is the estimated weight in lbs.", + "type": "integer" + }, + "ppmType": { + "description": "If the move is a PPM, indicates whether it is full or partial.", + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "description": "Unique ID associated with this Order.\n\nNo two MoveTaskOrders may have the same ID.\nAttempting to create a MoveTaskOrder may fail if this referenceId has been used already.\n", + "type": "string", + "readOnly": true, + "example": "1001-3456" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "updatedAt": { + "description": "Date on which this MoveTaskOrder was last updated.", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MoveTaskOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "ordersType", + "ordersTypeDetail", + "rank", + "reportByDate", + "issueDate", + "status", + "uploadedOrdersID", + "tac", + "originDutyLocationID", + "destinationDutyLocationID", + "departmentIndicator" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "description": "ID of the Customer this Order belongs to.\n\nIf creating a MoveTaskOrder. either an existing customerID should be provided or the nested customer object should be populated for creation.\n", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationID": { + "description": "ID of the destination duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "Uniquely identifies the state of the Order object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this Order will require that this eTag be passed in with the If-Match header.\n", + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlement" + }, + "id": { + "description": "ID of the Order object.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "issueDate": { + "description": "The date the orders were issued.", + "type": "string", + "format": "date" + }, + "orderNumber": { + "description": "ID of the military orders associated with this move.", + "type": "string", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationID": { + "description": "ID of the origin duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rank": { + "$ref": "#/definitions/Rank" + }, + "reportByDate": { + "description": "Date that the service member must report to the new DutyLocation by.", + "type": "string", + "format": "date" + }, + "status": { + "$ref": "#/definitions/OrdersStatus" + }, + "tac": { + "type": "string", + "title": "TAC", + "example": "F8J1" + }, + "uploadedOrders": { + "$ref": "#/definitions/Document" + }, + "uploadedOrdersID": { + "description": "ID of the uploaded document.", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OrdersStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "GHC", + "NTS", + "WOUNDED_WARRIOR", + "BLUEBARK", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "GHC": "GHC", + "LOCAL_MOVE": "Local Move", + "NTS": "NTS", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", + "RETIREMENT": "Retirement", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "documentPackage": { + "$ref": "#/definitions/ProofOfServicePackage" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestEDI": { + "type": "object", + "properties": { + "edi": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "ProcessReviewedPaymentRequests": { + "type": "object", + "required": [ + "sendToSyncada", + "readFromSyncada", + "deleteFromSyncada" + ], + "properties": { + "deleteFromSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "readFromSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "sendToSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "ProofOfServicePackage": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "Rank": { + "description": "Rank of the service member, must match specific list of available ranks.", + "type": "string", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ] + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "UpdateMTOServiceItemStatus": { + "properties": { + "rejectionReason": { + "description": "Reason the service item was rejected by the TOO\"\"", + "type": "string", + "x-nullable": true, + "example": "item was too heavy" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + } + }, + "UpdateMTOShipmentStatus": { + "properties": { + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment not good enough" + }, + "status": { + "type": "string", + "enum": [ + "REJECTED", + "APPROVED", + "SUBMITTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ] + } + } + }, + "UpdatePaymentRequestStatus": { + "type": "object", + "properties": { + "eTag": { + "description": "Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for ` + "`" + `If-Match` + "`" + `. Required when sending PUT or PATCH requests to prevent updating stale data.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "A written reason to provide context for the status.", + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "WebhookNotification": { + "type": "object", + "properties": { + "createdAt": { + "description": "Time representing when the event was triggered", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eventKey": { + "description": "Name of event triggered", + "type": "string", + "example": "PaymentRequest.Update" + }, + "firstAttemptedAt": { + "description": "Time representing when the system firstAttempted to send this notification", + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "object": { + "type": "string", + "format": "JSON", + "x-nullable": true + }, + "objectID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/WebhookNotificationStatus" + }, + "traceID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "description": "Time representing when the notification was last updated", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WebhookNotificationStatus": { + "description": "Statuses available for a Webhook Notification", + "type": "string", + "enum": [ + "PENDING", + "SENT", + "SKIPPED", + "FAILING", + "FAILED" + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "name": "paymentRequest" + }, + { + "name": "mtoServiceItem" + }, + { + "name": "mtoShipment" + }, + { + "name": "webhook" + } + ] +}`)) + FlatSwaggerJSON = json.RawMessage([]byte(`{ + "schemes": [ + "http" + ], + "swagger": "2.0", + "info": { + "description": "The Support API gives you programmatic access to support functionality useful\nfor testing and debugging. **This API is not available in the Production\nenvironment**.\n\nAll endpoints are located at ` + "`" + `/support/v1/` + "`" + `.\n", + "title": "MilMove Support API", + "contact": { + "email": "milmove-developers@caci.com" + }, + "license": { + "name": "MIT", + "url": "https://opensource.org/licenses/MIT" + }, + "version": "0.0.1" + }, + "basePath": "/support/v1", + "paths": { + "/move-task-orders": { + "get": { + "description": "### Functionality\nThis endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "listMTOs", + "operationId": "listMTOs", + "parameters": [ + { + "type": "integer", + "format": "timestamp", + "description": "Only return move task orders updated since this time.", + "name": "since", + "in": "query" + } + ], + "responses": { + "200": { + "description": "Successfully retrieved all move task orders.", + "schema": { + "$ref": "#/definitions/MoveTaskOrders" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "post": { + "description": "Creates an instance of moveTaskOrder.\nCurrently this will also create a number of nested objects but not all.\nIt will currently create\n* MoveTaskOrder\n* Order\n* Customer\n* User\n* Entitlement\n\nIt will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID,\norigin duty station ID, and an uploaded orders ID to be passed into the request.\n\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "createMoveTaskOrder", + "operationId": "createMoveTaskOrder", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + } + ], + "responses": { + "201": { + "description": "Successfully created MoveTaskOrder object.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/hide": { + "patch": { + "description": "Updates move task order without fake user data ` + "`" + `show` + "`" + ` to false. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "hideNonFakeMoveTaskOrders", + "operationId": "hideNonFakeMoveTaskOrders", + "responses": { + "200": { + "description": "Successfully hid MTOs.", + "schema": { + "$ref": "#/definitions/MTOHideMovesResponse" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/move-task-orders/{moveTaskOrderID}": { + "get": { + "description": "### Functionality\nThis endpoint gets an individual MoveTaskOrder by ID.\n\nIt will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests.\n\nThis is a support endpoint and is not available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "getMoveTaskOrder", + "operationId": "getMoveTaskOrder", + "responses": { + "200": { + "description": "Successfully retrieve an individual move task order.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of move task order to use.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/available-to-prime": { + "patch": { + "description": "Updates move task order ` + "`" + `availableToPrimeAt` + "`" + ` to make it available to prime. No request body required. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "moveTaskOrder" + ], + "summary": "makeMoveTaskOrderAvailable", + "operationId": "makeMoveTaskOrderAvailable", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully made MTO available to Prime.", + "schema": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of move task order.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ] + }, + "/move-task-orders/{moveTaskOrderID}/payment-requests": { + "get": { + "description": "### Functionality\n\nThis endpoint lists all PaymentRequests associated with a given MoveTaskOrder.\n\nThis is a support endpoint and is not available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "listMTOPaymentRequests", + "operationId": "listMTOPaymentRequests", + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "Only return move task orders updated since this time.", + "name": "moveTaskOrderID", + "in": "path", + "required": true + } + ], + "responses": { + "200": { + "description": "Successfully retrieved payment requests associated with a given move task order", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/mto-service-items/{mtoServiceItemID}/status": { + "patch": { + "description": "Updates the status of a service item for a move to APPROVED or REJECTED. \u003cbr /\u003e\n\u003cbr /\u003e\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoServiceItem" + ], + "summary": "updateMTOServiceItemStatus", + "operationId": "updateMTOServiceItemStatus", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOServiceItemStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated service item status for a move task order.", + "schema": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "description": "UUID of mto service item to use.", + "name": "mtoServiceItemID", + "in": "path", + "required": true + } + ] + }, + "/mto-shipments/{mtoShipmentID}/status": { + "patch": { + "description": "Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, ` + "`" + `rejectionReason` + "`" + ` should be blank and any value passed through the body will be ignored. If REJECTED, a value in ` + "`" + `rejectionReason` + "`" + ` is required. \u003cbr /\u003e \u003cbr /\u003e This is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "mtoShipment" + ], + "summary": "updateMTOShipmentStatus", + "operationId": "updateMTOShipmentStatus", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdateMTOShipmentStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated the shipment's status.", + "schema": { + "$ref": "#/definitions/MTOShipment" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the shipment being updated.", + "name": "mtoShipmentID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/process-reviewed": { + "patch": { + "description": "Updates the status of reviewed payment requests and sends PRs to Syncada if\nthe SendToSyncada flag is set\n\nThis is a support endpoint and will not be available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "processReviewedPaymentRequests", + "operationId": "processReviewedPaymentRequests", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ProcessReviewedPaymentRequests" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated status of reviewed payment request and sent to Syncada if that flag is set", + "schema": { + "$ref": "#/definitions/PaymentRequests" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/payment-requests/{paymentRequestID}/edi": { + "get": { + "description": "Returns the EDI (Electronic Data Interchange) message for the payment request identified\nby the given payment request ID. Note that the EDI returned in the JSON payload will have where there\nwould normally be line breaks (due to JSON not allowing line breaks in a string).\n\nThis is a support endpoint and will not be available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "getPaymentRequestEDI", + "operationId": "getPaymentRequestEDI", + "responses": { + "200": { + "description": "Successfully retrieved payment requests associated with a given move task order", + "schema": { + "$ref": "#/definitions/PaymentRequestEDI" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the payment request for which EDI should be generated.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/recalculate": { + "post": { + "description": "Recalculates an existing pending payment request by creating a new payment request for the same service\nitems but is priced based on the current inputs (weights, dates, etc.). The previously existing payment\nrequest is then deprecated. A link is made between the new and existing payment requests.\n\nThis is a support endpoint and will not be available in production.\n", + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "recalculatePaymentRequest", + "operationId": "recalculatePaymentRequest", + "responses": { + "201": { + "description": "The new payment request with recalculated pricing.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of the payment request to recalculate.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/payment-requests/{paymentRequestID}/status": { + "patch": { + "description": "Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED.\n\nA status of REVIEWED can optionally have a ` + "`" + `rejectionReason` + "`" + `.\n\nThis is a support endpoint and is not available in production.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "paymentRequest" + ], + "summary": "updatePaymentRequestStatus", + "operationId": "updatePaymentRequestStatus", + "parameters": [ + { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + }, + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/UpdatePaymentRequestStatus" + } + } + ], + "responses": { + "200": { + "description": "Successfully updated payment request status.", + "schema": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "404": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "409": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "412": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + }, + "parameters": [ + { + "type": "string", + "format": "uuid", + "description": "UUID of payment request.", + "name": "paymentRequestID", + "in": "path", + "required": true + } + ] + }, + "/webhook-notifications": { + "post": { + "description": "This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhook" + ], + "summary": "Test endpoint for creating webhook notifications", + "operationId": "createWebhookNotification", + "parameters": [ + { + "description": "The notification sent by webhook-client.", + "name": "body", + "in": "body", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + } + ], + "responses": { + "201": { + "description": "Successful creation", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + }, + "/webhook-notify": { + "post": { + "description": "This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The ` + "`" + `webhook-client` + "`" + ` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection.\n", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "webhook" + ], + "summary": "Test endpoint for receiving messages from our own webhook-client", + "operationId": "receiveWebhookNotification", + "parameters": [ + { + "description": "The webhook notification being sent", + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + } + ], + "responses": { + "200": { + "description": "Received notification", + "schema": { + "$ref": "#/definitions/WebhookNotification" + } + }, + "400": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "401": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "403": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "500": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + } + } + } + } + }, + "definitions": { + "Address": { + "type": "object", + "required": [ + "streetAddress1", + "city", + "state", + "postalCode" + ], + "properties": { + "city": { + "type": "string", + "title": "City", + "example": "Anytown" + }, + "country": { + "description": "Two-letter country code", + "type": "string", + "title": "Country", + "default": "US", + "pattern": "^[A-Z]{2}$", + "x-nullable": true, + "example": "US" + }, + "county": { + "type": "string", + "title": "County", + "x-nullable": true, + "example": "LOS ANGELES" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isOconus": { + "type": "boolean", + "title": "isOconus", + "x-nullable": true, + "example": false + }, + "postalCode": { + "type": "string", + "format": "zip", + "title": "ZIP", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + }, + "state": { + "type": "string", + "title": "State", + "enum": [ + "AL", + "AK", + "AR", + "AZ", + "CA", + "CO", + "CT", + "DC", + "DE", + "FL", + "GA", + "HI", + "IA", + "ID", + "IL", + "IN", + "KS", + "KY", + "LA", + "MA", + "MD", + "ME", + "MI", + "MN", + "MO", + "MS", + "MT", + "NC", + "ND", + "NE", + "NH", + "NJ", + "NM", + "NV", + "NY", + "OH", + "OK", + "OR", + "PA", + "RI", + "SC", + "SD", + "TN", + "TX", + "UT", + "VA", + "VT", + "WA", + "WI", + "WV", + "WY" + ], + "x-display-value": { + "AK": "AK", + "AL": "AL", + "AR": "AR", + "AZ": "AZ", + "CA": "CA", + "CO": "CO", + "CT": "CT", + "DC": "DC", + "DE": "DE", + "FL": "FL", + "GA": "GA", + "HI": "HI", + "IA": "IA", + "ID": "ID", + "IL": "IL", + "IN": "IN", + "KS": "KS", + "KY": "KY", + "LA": "LA", + "MA": "MA", + "MD": "MD", + "ME": "ME", + "MI": "MI", + "MN": "MN", + "MO": "MO", + "MS": "MS", + "MT": "MT", + "NC": "NC", + "ND": "ND", + "NE": "NE", + "NH": "NH", + "NJ": "NJ", + "NM": "NM", + "NV": "NV", + "NY": "NY", + "OH": "OH", + "OK": "OK", + "OR": "OR", + "PA": "PA", + "RI": "RI", + "SC": "SC", + "SD": "SD", + "TN": "TN", + "TX": "TX", + "UT": "UT", + "VA": "VA", + "VT": "VT", + "WA": "WA", + "WI": "WI", + "WV": "WV", + "WY": "WY" + } + }, + "streetAddress1": { + "type": "string", + "title": "Street address 1", + "example": "123 Main Ave" + }, + "streetAddress2": { + "type": "string", + "title": "Street address 2", + "x-nullable": true, + "example": "Apartment 9000" + }, + "streetAddress3": { + "type": "string", + "title": "Address Line 3", + "x-nullable": true, + "example": "Montmârtre" + } + } + }, + "ClientError": { + "type": "object", + "required": [ + "title", + "detail", + "instance" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "Customer": { + "type": "object", + "required": [ + "firstName", + "lastName", + "dodID", + "rank", + "agency" + ], + "properties": { + "agency": { + "type": "string", + "title": "Agency customer is affilated with" + }, + "currentAddress": { + "$ref": "#/definitions/Address" + }, + "dodID": { + "type": "string" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "example": "Vanya" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "lastName": { + "type": "string", + "example": "Petrovna" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^[2-9]\\d{2}-\\d{3}-\\d{4}$", + "x-nullable": true + }, + "rank": { + "$ref": "#/definitions/Rank" + }, + "userID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "DeptIndicator": { + "type": "string", + "title": "Dept. indicator", + "enum": [ + "NAVY_AND_MARINES", + "ARMY", + "ARMY_CORPS_OF_ENGINEERS", + "AIR_AND_SPACE_FORCE", + "COAST_GUARD", + "OFFICE_OF_SECRETARY_OF_DEFENSE" + ], + "x-display-value": { + "AIR_AND_SPACE_FORCE": "57 Air Force and Space Force", + "ARMY": "21 Army", + "ARMY_CORPS_OF_ENGINEERS": "96 Army Corps of Engineers", + "COAST_GUARD": "70 Coast Guard", + "NAVY_AND_MARINES": "17 Navy and Marine Corps", + "OFFICE_OF_SECRETARY_OF_DEFENSE": "97 Office of the Secretary of Defense" + }, + "x-nullable": true + }, + "Document": { + "type": "object", + "required": [ + "id", + "serviceMemberID", + "uploads" + ], + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "serviceMemberID": { + "type": "string", + "format": "uuid", + "title": "The service member this document belongs to" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "DutyLocation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "name": { + "type": "string", + "example": "Fort Bragg North Station" + } + } + }, + "Entitlement": { + "type": "object", + "properties": { + "authorizedWeight": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 2000 + }, + "dependentsAuthorized": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "gunSafe": { + "type": "boolean", + "example": false + }, + "id": { + "type": "string", + "format": "uuid", + "example": "571008b1-b0de-454d-b843-d71be9f02c04" + }, + "nonTemporaryStorage": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "organizationalClothingAndIndividualEquipment": { + "type": "boolean", + "example": false + }, + "privatelyOwnedVehicle": { + "type": "boolean", + "x-nullable": true, + "example": false + }, + "proGearWeight": { + "type": "integer", + "x-formatting": "weight", + "readOnly": true, + "example": 2000 + }, + "proGearWeightSpouse": { + "type": "integer", + "x-formatting": "weight", + "readOnly": true, + "example": 500 + }, + "requiredMedicalEquipmentWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "storageInTransit": { + "type": "integer", + "example": 90 + }, + "totalDependents": { + "type": "integer", + "example": 2 + }, + "totalWeight": { + "type": "integer", + "x-formatting": "weight", + "example": 500 + }, + "unaccompaniedBaggageAllowance": { + "description": "The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage.", + "type": "integer", + "x-nullable": true, + "example": 3 + } + } + }, + "Error": { + "type": "object", + "required": [ + "title", + "detail" + ], + "properties": { + "detail": { + "type": "string" + }, + "instance": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + } + } + }, + "MTOAgent": { + "type": "object", + "properties": { + "agentType": { + "$ref": "#/definitions/MTOAgentType" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "email": { + "type": "string", + "format": "x-email", + "pattern": "^([a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,})?$", + "x-nullable": true + }, + "firstName": { + "type": "string", + "x-nullable": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "lastName": { + "type": "string", + "x-nullable": true + }, + "mtoShipmentID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "phone": { + "type": "string", + "format": "telephone", + "pattern": "^([2-9]\\d{2}-\\d{3}-\\d{4})?$", + "x-nullable": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOAgentType": { + "type": "string", + "title": "MTO Agent Type", + "enum": [ + "RELEASING_AGENT", + "RECEIVING_AGENT" + ], + "example": "RELEASING_AGENT" + }, + "MTOAgents": { + "type": "array", + "maxItems": 2, + "items": { + "$ref": "#/definitions/MTOAgent" + } + }, + "MTOHideMove": { + "description": "describes the MTO ID and a description reason why the move was hidden.", + "type": "object", + "properties": { + "hideReason": { + "description": "Reason the move was selected to be hidden", + "type": "string", + "x-nullable": true, + "example": "invalid name" + }, + "moveTaskOrderID": { + "description": "ID of the associated moveTaskOrder", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + } + } + }, + "MTOHideMovesResponse": { + "description": "describes the moves that were hidden that contained non-approved fake data to use in the MilMove system.", + "type": "object", + "properties": { + "moves": { + "description": "Array of moves that were hidden.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOHideMove" + } + }, + "numberMovesHidden": { + "description": "Number of moves that were hidden", + "type": "integer" + } + } + }, + "MTOServiceItem": { + "description": "MTOServiceItem describes a base type of a service item. Polymorphic type. Both Move Task Orders and MTO Shipments will have MTO Service Items.", + "type": "object", + "required": [ + "modelType", + "moveTaskOrderID" + ], + "properties": { + "eTag": { + "description": "ETag identifier required to update this object", + "type": "string", + "readOnly": true + }, + "id": { + "description": "ID of the service item", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "modelType": { + "$ref": "#/definitions/MTOServiceItemModelType" + }, + "moveTaskOrderID": { + "description": "ID of the associated moveTaskOrder", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoShipmentID": { + "description": "ID of the associated mtoShipment", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "reServiceName": { + "description": "Full descriptive name of the service", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "Reason the service item was rejected by the TOO", + "type": "string", + "x-nullable": true, + "example": "item was too heavy" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + }, + "discriminator": "modelType" + }, + "MTOServiceItemBasic": { + "description": "Describes a basic service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode" + ], + "properties": { + "reServiceCode": { + "$ref": "#/definitions/ReServiceCode" + } + } + } + ] + }, + "MTOServiceItemDestSIT": { + "description": "Describes a domestic destination SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "dateOfContact1", + "timeMilitary1", + "firstAvailableDeliveryDate1", + "dateOfContact2", + "timeMilitary2", + "firstAvailableDeliveryDate2", + "sitEntryDate" + ], + "properties": { + "dateOfContact1": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary1'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "dateOfContact2": { + "description": "Date of attempted contact by the prime corresponding to 'timeMilitary2'.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "firstAvailableDeliveryDate1": { + "description": "First available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date" + }, + "firstAvailableDeliveryDate2": { + "description": "Second available date that Prime can deliver SIT service item.", + "type": "string", + "format": "date" + }, + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DDFSIT", + "DDASIT" + ] + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "timeMilitary1": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact1` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "example": "1400Z" + }, + "timeMilitary2": { + "description": "Time of attempted contact corresponding to ` + "`" + `dateOfContact2` + "`" + `, in military format.", + "type": "string", + "pattern": "\\d{4}Z", + "example": "1400Z" + } + } + } + ] + }, + "MTOServiceItemDimension": { + "description": "Describes a dimension object for the MTOServiceItem.", + "type": "object", + "required": [ + "length", + "width", + "height" + ], + "properties": { + "height": { + "description": "Height in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "id": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "length": { + "description": "Length in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + }, + "width": { + "description": "Width in thousandth inches. 1000 thou = 1 inch.", + "type": "integer", + "format": "int32", + "example": 1000 + } + } + }, + "MTOServiceItemDomesticCrating": { + "description": "Describes a domestic crating/uncrating service item subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "item", + "crate", + "description" + ], + "properties": { + "crate": { + "$ref": "#/definitions/MTOServiceItemDimension" + }, + "description": { + "type": "string", + "example": "Decorated horse head to be crated." + }, + "item": { + "$ref": "#/definitions/MTOServiceItemDimension" + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DCRT", + "DUCRT" + ] + }, + "standaloneCrate": { + "type": "boolean", + "x-nullable": true + } + } + } + ] + }, + "MTOServiceItemModelType": { + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "type": "string", + "enum": [ + "MTOServiceItemBasic", + "MTOServiceItemOriginSIT", + "MTOServiceItemDestSIT", + "MTOServiceItemShuttle", + "MTOServiceItemDomesticCrating", + "MTOServiceItemInternationalCrating" + ] + }, + "MTOServiceItemOriginSIT": { + "description": "Describes a domestic origin SIT service item. Subtype of a MTOServiceItem.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reServiceCode", + "reason", + "sitPostalCode", + "sitEntryDate" + ], + "properties": { + "reServiceCode": { + "description": "Service code allowed for this model type.", + "type": "string", + "enum": [ + "DOFSIT", + "DOASIT" + ] + }, + "reason": { + "description": "Explanation of why Prime is picking up SIT item.", + "type": "string", + "example": "Storage items need to be picked up" + }, + "sitDepartureDate": { + "description": "Departure date for SIT. This is the end date of the SIT at either origin or destination. This is optional as it can be updated using the UpdateMTOServiceItemSIT modelType at a later date.", + "type": "string", + "format": "date", + "x-nullable": true + }, + "sitEntryDate": { + "description": "Entry date for the SIT", + "type": "string", + "format": "date" + }, + "sitPostalCode": { + "type": "string", + "format": "zip", + "pattern": "^(\\d{5}([\\-]\\d{4})?)$", + "example": "90210" + } + } + } + ] + }, + "MTOServiceItemShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode", + "description" + ], + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "Explanation of why a shuttle service is required.", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, + "MTOServiceItemStatus": { + "description": "Describes all statuses for a MTOServiceItem.", + "type": "string", + "enum": [ + "SUBMITTED", + "APPROVED", + "REJECTED" + ] + }, + "MTOShipment": { + "properties": { + "actualPickupDate": { + "type": "string", + "format": "date" + }, + "agents": { + "$ref": "#/definitions/MTOAgents" + }, + "approvedDate": { + "description": "date when the shipment was given the status \"APPROVED\"", + "type": "string", + "format": "date", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "customerRemarks": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "handle with care" + }, + "destinationAddress": { + "$ref": "#/definitions/Address" + }, + "diversion": { + "type": "boolean" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "firstAvailableDeliveryDate": { + "type": "string", + "format": "date" + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "marketCode": { + "description": "Single-letter designator for domestic (d) or international (i) shipments", + "type": "string", + "enum": [ + "d", + "i" + ], + "example": "d" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "mtoServiceItems": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "pickupAddress": { + "$ref": "#/definitions/Address" + }, + "pointOfContact": { + "description": "Email or id of a contact person for this update.", + "type": "string" + }, + "primeActualWeight": { + "type": "integer", + "example": 4500 + }, + "primeEstimatedWeight": { + "type": "integer", + "example": 4500 + }, + "primeEstimatedWeightRecordedDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "readOnly": true, + "example": "MTO Shipment not good enough" + }, + "requestedPickupDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "requiredDeliveryDate": { + "type": "string", + "format": "date", + "readOnly": true + }, + "scheduledPickupDate": { + "type": "string", + "format": "date" + }, + "secondaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "secondaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "shipmentType": { + "$ref": "#/definitions/MTOShipmentType" + }, + "status": { + "type": "string", + "enum": [ + "APPROVED", + "SUBMITTED", + "REJECTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ], + "readOnly": true + }, + "tertiaryDeliveryAddress": { + "$ref": "#/definitions/Address" + }, + "tertiaryPickupAddress": { + "$ref": "#/definitions/Address" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MTOShipmentType": { + "type": "string", + "title": "Shipment Type", + "enum": [ + "HHG", + "HHG_INTO_NTS", + "HHG_OUTOF_NTS_DOMESTIC", + "PPM", + "BOAT_HAUL_AWAY", + "BOAT_TOW_AWAY", + "MOBILE_HOME", + "UNACCOMPANIED_BAGGAGE" + ], + "x-display-value": { + "BOAT_HAUL_AWAY": "Boat Haul-Away", + "BOAT_TOW_AWAY": "Boat Tow-Away", + "HHG": "HHG", + "HHG_INTO_NTS": "NTS", + "HHG_OUTOF_NTS_DOMESTIC": "NTS Release", + "MOBILE_HOME": "Mobile Home", + "PPM": "PPM", + "UNACCOMPANIED_BAGGAGE": "Unaccompanied Baggage" + }, + "example": "HHG" + }, + "MTOShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + }, + "MoveStatus": { + "description": "Current status of this MoveTaskOrder", + "type": "string", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "MoveTaskOrder": { + "type": "object", + "required": [ + "order", + "contractorID" + ], + "properties": { + "approvedAt": { + "description": "Indicates this MoveTaskOrder has been approved by an office user such as the Task Ordering Officer (TOO).\n", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "availableToPrimeAt": { + "description": "Indicates this MoveTaskOrder is available for Prime API handling.\n\nIn production, only MoveTaskOrders for which this is set will be available to the API.\n", + "type": "string", + "format": "date-time", + "x-nullable": true + }, + "contractorID": { + "description": "ID associated with the contractor, in this case Prime\n", + "type": "string", + "format": "uuid", + "example": "5db13bb4-6d29-4bdb-bc81-262f4513ecf6" + }, + "createdAt": { + "description": "Date the MoveTaskOrder was created on.", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eTag": { + "description": "Uniquely identifies the state of the MoveTaskOrder object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this MoveTaskOrder will require that this eTag be passed in with the If-Match header.\n", + "type": "string", + "readOnly": true + }, + "id": { + "description": "ID of the MoveTaskOrder object.", + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "moveCode": { + "description": "Unique 6-character code the customer can use to refer to their move", + "type": "string", + "readOnly": true, + "example": "ABC123" + }, + "mtoServiceItems": { + "description": "Array of MTOServiceItems associated with this MoveTaskOrder.", + "type": "array", + "items": { + "$ref": "#/definitions/MTOServiceItem" + } + }, + "mtoShipments": { + "$ref": "#/definitions/MTOShipments" + }, + "order": { + "$ref": "#/definitions/Order" + }, + "orderID": { + "description": "ID of the Order object", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequests": { + "$ref": "#/definitions/PaymentRequests" + }, + "ppmEstimatedWeight": { + "description": "If the move is a PPM, this is the estimated weight in lbs.", + "type": "integer" + }, + "ppmType": { + "description": "If the move is a PPM, indicates whether it is full or partial.", + "type": "string", + "enum": [ + "FULL", + "PARTIAL" + ] + }, + "referenceId": { + "description": "Unique ID associated with this Order.\n\nNo two MoveTaskOrders may have the same ID.\nAttempting to create a MoveTaskOrder may fail if this referenceId has been used already.\n", + "type": "string", + "readOnly": true, + "example": "1001-3456" + }, + "status": { + "$ref": "#/definitions/MoveStatus" + }, + "updatedAt": { + "description": "Date on which this MoveTaskOrder was last updated.", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "MoveTaskOrders": { + "type": "array", + "items": { + "$ref": "#/definitions/MoveTaskOrder" + } + }, + "Order": { + "type": "object", + "required": [ + "orderNumber", + "ordersType", + "ordersTypeDetail", + "rank", + "reportByDate", + "issueDate", + "status", + "uploadedOrdersID", + "tac", + "originDutyLocationID", + "destinationDutyLocationID", + "departmentIndicator" + ], + "properties": { + "customer": { + "$ref": "#/definitions/Customer" + }, + "customerID": { + "description": "ID of the Customer this Order belongs to.\n\nIf creating a MoveTaskOrder. either an existing customerID should be provided or the nested customer object should be populated for creation.\n", + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "departmentIndicator": { + "$ref": "#/definitions/DeptIndicator" + }, + "destinationDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "destinationDutyLocationID": { + "description": "ID of the destination duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "eTag": { + "description": "Uniquely identifies the state of the Order object (but not the nested objects)\n\nIt will change everytime the object is updated. Client should store the value.\nUpdates to this Order will require that this eTag be passed in with the If-Match header.\n", + "type": "string", + "readOnly": true + }, + "entitlement": { + "$ref": "#/definitions/Entitlement" + }, + "id": { + "description": "ID of the Order object.", + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "issueDate": { + "description": "The date the orders were issued.", + "type": "string", + "format": "date" + }, + "orderNumber": { + "description": "ID of the military orders associated with this move.", + "type": "string", + "x-nullable": true, + "example": "030-00362" + }, + "ordersType": { + "$ref": "#/definitions/OrdersType" + }, + "ordersTypeDetail": { + "$ref": "#/definitions/OrdersTypeDetail" + }, + "originDutyLocation": { + "$ref": "#/definitions/DutyLocation" + }, + "originDutyLocationID": { + "description": "ID of the origin duty station.\n\nIf creating a MoveTaskOrder, this should match an existing duty station.\n", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rank": { + "$ref": "#/definitions/Rank" + }, + "reportByDate": { + "description": "Date that the service member must report to the new DutyLocation by.", + "type": "string", + "format": "date" + }, + "status": { + "$ref": "#/definitions/OrdersStatus" + }, + "tac": { + "type": "string", + "title": "TAC", + "example": "F8J1" + }, + "uploadedOrders": { + "$ref": "#/definitions/Document" + }, + "uploadedOrdersID": { + "description": "ID of the uploaded document.", + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "OrdersStatus": { + "type": "string", + "title": "Move status", + "enum": [ + "DRAFT", + "SUBMITTED", + "APPROVED", + "CANCELED" + ], + "x-display-value": { + "APPROVED": "Approved", + "CANCELED": "Canceled", + "DRAFT": "Draft", + "SUBMITTED": "Submitted" + } + }, + "OrdersType": { + "type": "string", + "title": "Orders type", + "enum": [ + "PERMANENT_CHANGE_OF_STATION", + "LOCAL_MOVE", + "RETIREMENT", + "SEPARATION", + "GHC", + "NTS", + "WOUNDED_WARRIOR", + "BLUEBARK", + "TEMPORARY_DUTY", + "EARLY_RETURN_OF_DEPENDENTS", + "STUDENT_TRAVEL" + ], + "x-display-value": { + "BLUEBARK": "BLUEBARK", + "EARLY_RETURN_OF_DEPENDENTS": "Early Return of Dependents", + "GHC": "GHC", + "LOCAL_MOVE": "Local Move", + "NTS": "NTS", + "PERMANENT_CHANGE_OF_STATION": "Permanent Change Of Station (PCS)", + "RETIREMENT": "Retirement", + "SEPARATION": "Separation", + "STUDENT_TRAVEL": "Student Travel", + "TEMPORARY_DUTY": "Temporary Duty (TDY)", + "WOUNDED_WARRIOR": "Wounded Warrior" + } + }, + "OrdersTypeDetail": { + "type": "string", + "title": "Orders type detail", + "enum": [ + "HHG_PERMITTED", + "PCS_TDY", + "HHG_RESTRICTED_PROHIBITED", + "HHG_RESTRICTED_AREA", + "INSTRUCTION_20_WEEKS", + "HHG_PROHIBITED_20_WEEKS", + "DELAYED_APPROVAL" + ], + "x-display-value": { + "DELAYED_APPROVAL": "Delayed Approval 20 Weeks or More", + "HHG_PERMITTED": "Shipment of HHG Permitted", + "HHG_PROHIBITED_20_WEEKS": "Shipment of HHG Prohibited but Authorized within 20 weeks", + "HHG_RESTRICTED_AREA": "HHG Restricted Area-HHG Prohibited", + "HHG_RESTRICTED_PROHIBITED": "Shipment of HHG Restricted or Prohibited", + "INSTRUCTION_20_WEEKS": "Course of Instruction 20 Weeks or More", + "PCS_TDY": "PCS with TDY Enroute" + }, + "x-nullable": true + }, + "PaymentRequest": { + "type": "object", + "properties": { + "documentPackage": { + "$ref": "#/definitions/ProofOfServicePackage" + }, + "eTag": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "isFinal": { + "type": "boolean", + "default": false + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "paymentRequestNumber": { + "type": "string", + "readOnly": true, + "example": "1234-5678-1" + }, + "recalculationOfPaymentRequestID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "PaymentRequestEDI": { + "type": "object", + "properties": { + "edi": { + "type": "string", + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "PaymentRequestStatus": { + "type": "string", + "title": "Payment Request Status", + "enum": [ + "PENDING", + "REVIEWED", + "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED", + "SENT_TO_GEX", + "TPPS_RECEIVED", + "PAID", + "EDI_ERROR", + "DEPRECATED" + ] + }, + "PaymentRequests": { + "type": "array", + "items": { + "$ref": "#/definitions/PaymentRequest" + } + }, + "ProcessReviewedPaymentRequests": { + "type": "object", + "required": [ + "sendToSyncada", + "readFromSyncada", + "deleteFromSyncada" + ], + "properties": { + "deleteFromSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "paymentRequestID": { + "type": "string", + "format": "uuid", + "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" + }, + "readFromSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "sendToSyncada": { + "type": "boolean", + "x-nullable": true, + "example": true + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "ProofOfServicePackage": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "uploads": { + "type": "array", + "items": { + "$ref": "#/definitions/UploadWithOmissions" + } + } + } + }, + "Rank": { + "description": "Rank of the service member, must match specific list of available ranks.", + "type": "string", + "enum": [ + "E_1", + "E_2", + "E_3", + "E_4", + "E_5", + "E_6", + "E_7", + "E_8", + "E_9", + "E_9_SPECIAL_SENIOR_ENLISTED", + "O_1_ACADEMY_GRADUATE", + "O_2", + "O_3", + "O_4", + "O_5", + "O_6", + "O_7", + "O_8", + "O_9", + "O_10", + "W_1", + "W_2", + "W_3", + "W_4", + "W_5", + "AVIATION_CADET", + "CIVILIAN_EMPLOYEE", + "ACADEMY_CADET", + "MIDSHIPMAN" + ] + }, + "ReServiceCode": { + "description": "This is the full list of service items that can be found on a shipment. Not all service items\nmay be requested by the Prime, but may be returned in a response.\n\nDocumentation of all the service items will be provided.\n", + "type": "string", + "enum": [ + "CS", + "DBHF", + "DBTF", + "DCRT", + "DDASIT", + "DDDSIT", + "DDFSIT", + "DDP", + "DDSHUT", + "DLH", + "DMHF", + "DNPK", + "DOASIT", + "DOFSIT", + "DOP", + "DOPSIT", + "DOSHUT", + "DPK", + "DSH", + "DUCRT", + "DUPK", + "FSC", + "IBHF", + "IBTF", + "ICOLH", + "ICOUB", + "ICRT", + "IDASIT", + "IDDSIT", + "IDFSIT", + "IDSHUT", + "IHPK", + "IHUPK", + "INPK", + "IOASIT", + "IOCLH", + "IOCUB", + "IOFSIT", + "IOOLH", + "IOOUB", + "IOPSIT", + "IOSHUT", + "IUBPK", + "IUBUPK", + "IUCRT", + "MS", + "NSTH", + "NSTUB" + ] + }, + "UpdateMTOServiceItemStatus": { + "properties": { + "rejectionReason": { + "description": "Reason the service item was rejected by the TOO\"\"", + "type": "string", + "x-nullable": true, + "example": "item was too heavy" + }, + "status": { + "$ref": "#/definitions/MTOServiceItemStatus" + } + } + }, + "UpdateMTOShipmentStatus": { + "properties": { + "rejectionReason": { + "type": "string", + "x-nullable": true, + "example": "MTO Shipment not good enough" + }, + "status": { + "type": "string", + "enum": [ + "REJECTED", + "APPROVED", + "SUBMITTED", + "CANCELLATION_REQUESTED", + "CANCELED", + "DIVERSION_REQUESTED" + ] + } + } + }, + "UpdatePaymentRequestStatus": { + "type": "object", + "properties": { + "eTag": { + "description": "Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for ` + "`" + `If-Match` + "`" + `. Required when sending PUT or PATCH requests to prevent updating stale data.", + "type": "string", + "readOnly": true + }, + "rejectionReason": { + "description": "A written reason to provide context for the status.", + "type": "string", + "x-nullable": true, + "example": "documentation was incomplete" + }, + "status": { + "$ref": "#/definitions/PaymentRequestStatus" + } + } + }, + "UploadWithOmissions": { + "description": "An uploaded file.", + "type": "object", + "required": [ + "filename", + "contentType", + "bytes" + ], + "properties": { + "bytes": { + "type": "integer" + }, + "contentType": { + "type": "string", + "format": "mime-type", + "example": "application/pdf" + }, + "createdAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "filename": { + "type": "string", + "example": "filename.pdf" + }, + "id": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "rotation": { + "type": "integer" + }, + "status": { + "type": "string", + "enum": [ + "INFECTED", + "CLEAN", + "PROCESSING" + ] + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538" + } + } + }, + "ValidationError": { + "allOf": [ + { + "$ref": "#/definitions/ClientError" + }, + { + "type": "object", + "required": [ + "invalidFields" + ], + "properties": { + "invalidFields": { + "type": "object", + "additionalProperties": { + "description": "List of errors for the field", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ] + }, + "WebhookNotification": { + "type": "object", + "properties": { + "createdAt": { + "description": "Time representing when the event was triggered", + "type": "string", + "format": "date-time", + "readOnly": true + }, + "eventKey": { + "description": "Name of event triggered", + "type": "string", + "example": "PaymentRequest.Update" + }, + "firstAttemptedAt": { + "description": "Time representing when the system firstAttempted to send this notification", + "type": "string", + "format": "date-time", + "x-nullable": true, + "readOnly": true + }, + "id": { + "type": "string", + "format": "uuid", + "readOnly": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "moveTaskOrderID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "object": { + "type": "string", + "format": "JSON", + "x-nullable": true + }, + "objectID": { + "type": "string", + "format": "uuid", + "x-nullable": true, + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "status": { + "$ref": "#/definitions/WebhookNotificationStatus" + }, + "traceID": { + "type": "string", + "format": "uuid", + "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" + }, + "updatedAt": { + "description": "Time representing when the notification was last updated", + "type": "string", + "format": "date-time", + "readOnly": true + } + } + }, + "WebhookNotificationStatus": { + "description": "Statuses available for a Webhook Notification", + "type": "string", + "enum": [ + "PENDING", + "SENT", + "SKIPPED", + "FAILING", + "FAILED" + ] + } + }, + "parameters": { + "ifMatch": { + "type": "string", + "description": "Optimistic locking is implemented via the ` + "`" + `If-Match` + "`" + ` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a ` + "`" + `412 Precondition Failed` + "`" + ` error.\n", + "name": "If-Match", + "in": "header", + "required": true + } + }, + "responses": { + "Conflict": { + "description": "There was a conflict with the request.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "InvalidRequest": { + "description": "The request payload is invalid.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "NotFound": { + "description": "The requested resource wasn't found.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PermissionDenied": { + "description": "The request was denied.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "PreconditionFailed": { + "description": "Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value.", + "schema": { + "$ref": "#/definitions/ClientError" + } + }, + "ServerError": { + "description": "A server error occurred.", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "UnprocessableEntity": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + } + }, + "tags": [ + { + "description": "The **moveTaskOrder** represents a military move that has been sent to a contractor. It contains all the information about shipments, including service items, estimated weights, actual weights, requested and scheduled move dates, etc.\n", + "name": "moveTaskOrder" + }, + { + "name": "paymentRequest" + }, + { + "name": "mtoServiceItem" + }, + { + "name": "mtoShipment" + }, + { + "name": "webhook" + } + ] +}`)) +} diff --git a/pkg/gen/supportapi/server.go b/pkg/gen/supportapi/server.go new file mode 100644 index 00000000000..bfa7a7c2ea0 --- /dev/null +++ b/pkg/gen/supportapi/server.go @@ -0,0 +1,507 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportapi + +import ( + "context" + "crypto/tls" + "crypto/x509" + "errors" + "fmt" + "log" + "net" + "net/http" + "os" + "os/signal" + "strconv" + "sync" + "sync/atomic" + "syscall" + "time" + + "github.com/go-openapi/runtime/flagext" + "github.com/go-openapi/swag" + flags "github.com/jessevdk/go-flags" + "golang.org/x/net/netutil" + + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations" +) + +const ( + schemeHTTP = "http" + schemeHTTPS = "https" + schemeUnix = "unix" +) + +var defaultSchemes []string + +func init() { + defaultSchemes = []string{ + schemeHTTP, + } +} + +// NewServer creates a new api mymove server but does not configure it +func NewServer(api *supportoperations.MymoveAPI) *Server { + s := new(Server) + + s.shutdown = make(chan struct{}) + s.api = api + s.interrupt = make(chan os.Signal, 1) + return s +} + +// ConfigureAPI configures the API and handlers. +func (s *Server) ConfigureAPI() { + if s.api != nil { + s.handler = configureAPI(s.api) + } +} + +// ConfigureFlags configures the additional flags defined by the handlers. Needs to be called before the parser.Parse +func (s *Server) ConfigureFlags() { + if s.api != nil { + configureFlags(s.api) + } +} + +// Server for the mymove API +type Server struct { + EnabledListeners []string `long:"scheme" description:"the listeners to enable, this can be repeated and defaults to the schemes in the swagger spec"` + CleanupTimeout time.Duration `long:"cleanup-timeout" description:"grace period for which to wait before killing idle connections" default:"10s"` + GracefulTimeout time.Duration `long:"graceful-timeout" description:"grace period for which to wait before shutting down the server" default:"15s"` + MaxHeaderSize flagext.ByteSize `long:"max-header-size" description:"controls the maximum number of bytes the server will read parsing the request header's keys and values, including the request line. It does not limit the size of the request body." default:"1MiB"` + + SocketPath flags.Filename `long:"socket-path" description:"the unix socket to listen on" default:"/var/run/mymove.sock"` + domainSocketL net.Listener + + Host string `long:"host" description:"the IP to listen on" default:"localhost" env:"HOST"` + Port int `long:"port" description:"the port to listen on for insecure connections, defaults to a random value" env:"PORT"` + ListenLimit int `long:"listen-limit" description:"limit the number of outstanding requests"` + KeepAlive time.Duration `long:"keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)" default:"3m"` + ReadTimeout time.Duration `long:"read-timeout" description:"maximum duration before timing out read of the request" default:"30s"` + WriteTimeout time.Duration `long:"write-timeout" description:"maximum duration before timing out write of the response" default:"60s"` + httpServerL net.Listener + + TLSHost string `long:"tls-host" description:"the IP to listen on for tls, when not specified it's the same as --host" env:"TLS_HOST"` + TLSPort int `long:"tls-port" description:"the port to listen on for secure connections, defaults to a random value" env:"TLS_PORT"` + TLSCertificate flags.Filename `long:"tls-certificate" description:"the certificate to use for secure connections" env:"TLS_CERTIFICATE"` + TLSCertificateKey flags.Filename `long:"tls-key" description:"the private key to use for secure connections" env:"TLS_PRIVATE_KEY"` + TLSCACertificate flags.Filename `long:"tls-ca" description:"the certificate authority file to be used with mutual tls auth" env:"TLS_CA_CERTIFICATE"` + TLSListenLimit int `long:"tls-listen-limit" description:"limit the number of outstanding requests"` + TLSKeepAlive time.Duration `long:"tls-keep-alive" description:"sets the TCP keep-alive timeouts on accepted connections. It prunes dead TCP connections ( e.g. closing laptop mid-download)"` + TLSReadTimeout time.Duration `long:"tls-read-timeout" description:"maximum duration before timing out read of the request"` + TLSWriteTimeout time.Duration `long:"tls-write-timeout" description:"maximum duration before timing out write of the response"` + httpsServerL net.Listener + + api *supportoperations.MymoveAPI + handler http.Handler + hasListeners bool + shutdown chan struct{} + shuttingDown int32 + interrupted bool + interrupt chan os.Signal +} + +// Logf logs message either via defined user logger or via system one if no user logger is defined. +func (s *Server) Logf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + } else { + log.Printf(f, args...) + } +} + +// Fatalf logs message either via defined user logger or via system one if no user logger is defined. +// Exits with non-zero status after printing +func (s *Server) Fatalf(f string, args ...interface{}) { + if s.api != nil && s.api.Logger != nil { + s.api.Logger(f, args...) + os.Exit(1) + } else { + log.Fatalf(f, args...) + } +} + +// SetAPI configures the server with the specified API. Needs to be called before Serve +func (s *Server) SetAPI(api *supportoperations.MymoveAPI) { + if api == nil { + s.api = nil + s.handler = nil + return + } + + s.api = api + s.handler = configureAPI(api) +} + +func (s *Server) hasScheme(scheme string) bool { + schemes := s.EnabledListeners + if len(schemes) == 0 { + schemes = defaultSchemes + } + + for _, v := range schemes { + if v == scheme { + return true + } + } + return false +} + +// Serve the api +func (s *Server) Serve() (err error) { + if !s.hasListeners { + if err = s.Listen(); err != nil { + return err + } + } + + // set default handler, if none is set + if s.handler == nil { + if s.api == nil { + return errors.New("can't create the default handler, as no api is set") + } + + s.SetHandler(s.api.Serve(nil)) + } + + wg := new(sync.WaitGroup) + once := new(sync.Once) + signalNotify(s.interrupt) + go handleInterrupt(once, s) + + servers := []*http.Server{} + + if s.hasScheme(schemeUnix) { + domainSocket := new(http.Server) + domainSocket.MaxHeaderBytes = int(s.MaxHeaderSize) + domainSocket.Handler = s.handler + if int64(s.CleanupTimeout) > 0 { + domainSocket.IdleTimeout = s.CleanupTimeout + } + + configureServer(domainSocket, "unix", string(s.SocketPath)) + + servers = append(servers, domainSocket) + wg.Add(1) + s.Logf("Serving mymove at unix://%s", s.SocketPath) + go func(l net.Listener) { + defer wg.Done() + if err := domainSocket.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at unix://%s", s.SocketPath) + }(s.domainSocketL) + } + + if s.hasScheme(schemeHTTP) { + httpServer := new(http.Server) + httpServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpServer.ReadTimeout = s.ReadTimeout + httpServer.WriteTimeout = s.WriteTimeout + httpServer.SetKeepAlivesEnabled(int64(s.KeepAlive) > 0) + if s.ListenLimit > 0 { + s.httpServerL = netutil.LimitListener(s.httpServerL, s.ListenLimit) + } + + if int64(s.CleanupTimeout) > 0 { + httpServer.IdleTimeout = s.CleanupTimeout + } + + httpServer.Handler = s.handler + + configureServer(httpServer, "http", s.httpServerL.Addr().String()) + + servers = append(servers, httpServer) + wg.Add(1) + s.Logf("Serving mymove at http://%s", s.httpServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at http://%s", l.Addr()) + }(s.httpServerL) + } + + if s.hasScheme(schemeHTTPS) { + httpsServer := new(http.Server) + httpsServer.MaxHeaderBytes = int(s.MaxHeaderSize) + httpsServer.ReadTimeout = s.TLSReadTimeout + httpsServer.WriteTimeout = s.TLSWriteTimeout + httpsServer.SetKeepAlivesEnabled(int64(s.TLSKeepAlive) > 0) + if s.TLSListenLimit > 0 { + s.httpsServerL = netutil.LimitListener(s.httpsServerL, s.TLSListenLimit) + } + if int64(s.CleanupTimeout) > 0 { + httpsServer.IdleTimeout = s.CleanupTimeout + } + httpsServer.Handler = s.handler + + // Inspired by https://blog.bracebin.com/achieving-perfect-ssl-labs-score-with-go + httpsServer.TLSConfig = &tls.Config{ + // Causes servers to use Go's default ciphersuite preferences, + // which are tuned to avoid attacks. Does nothing on clients. + PreferServerCipherSuites: true, + // Only use curves which have assembly implementations + // https://github.com/golang/go/tree/master/src/crypto/elliptic + CurvePreferences: []tls.CurveID{tls.CurveP256}, + // Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility + NextProtos: []string{"h2", "http/1.1"}, + // https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols + MinVersion: tls.VersionTLS12, + // These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy + CipherSuites: []uint16{ + tls.TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305, + tls.TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305, + }, + } + + // build standard config from server options + if s.TLSCertificate != "" && s.TLSCertificateKey != "" { + httpsServer.TLSConfig.Certificates = make([]tls.Certificate, 1) + httpsServer.TLSConfig.Certificates[0], err = tls.LoadX509KeyPair(string(s.TLSCertificate), string(s.TLSCertificateKey)) + if err != nil { + return err + } + } + + if s.TLSCACertificate != "" { + // include specified CA certificate + caCert, caCertErr := os.ReadFile(string(s.TLSCACertificate)) + if caCertErr != nil { + return caCertErr + } + caCertPool := x509.NewCertPool() + ok := caCertPool.AppendCertsFromPEM(caCert) + if !ok { + return fmt.Errorf("cannot parse CA certificate") + } + httpsServer.TLSConfig.ClientCAs = caCertPool + httpsServer.TLSConfig.ClientAuth = tls.RequireAndVerifyClientCert + } + + // call custom TLS configurator + configureTLS(httpsServer.TLSConfig) + + if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil { + // after standard and custom config are passed, this ends up with no certificate + if s.TLSCertificate == "" { + if s.TLSCertificateKey == "" { + s.Fatalf("the required flags `--tls-certificate` and `--tls-key` were not specified") + } + s.Fatalf("the required flag `--tls-certificate` was not specified") + } + if s.TLSCertificateKey == "" { + s.Fatalf("the required flag `--tls-key` was not specified") + } + // this happens with a wrong custom TLS configurator + s.Fatalf("no certificate was configured for TLS") + } + + configureServer(httpsServer, "https", s.httpsServerL.Addr().String()) + + servers = append(servers, httpsServer) + wg.Add(1) + s.Logf("Serving mymove at https://%s", s.httpsServerL.Addr()) + go func(l net.Listener) { + defer wg.Done() + if err := httpsServer.Serve(l); err != nil && err != http.ErrServerClosed { + s.Fatalf("%v", err) + } + s.Logf("Stopped serving mymove at https://%s", l.Addr()) + }(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig)) + } + + wg.Add(1) + go s.handleShutdown(wg, &servers) + + wg.Wait() + return nil +} + +// Listen creates the listeners for the server +func (s *Server) Listen() error { + if s.hasListeners { // already done this + return nil + } + + if s.hasScheme(schemeHTTPS) { + // Use http host if https host wasn't defined + if s.TLSHost == "" { + s.TLSHost = s.Host + } + // Use http listen limit if https listen limit wasn't defined + if s.TLSListenLimit == 0 { + s.TLSListenLimit = s.ListenLimit + } + // Use http tcp keep alive if https tcp keep alive wasn't defined + if int64(s.TLSKeepAlive) == 0 { + s.TLSKeepAlive = s.KeepAlive + } + // Use http read timeout if https read timeout wasn't defined + if int64(s.TLSReadTimeout) == 0 { + s.TLSReadTimeout = s.ReadTimeout + } + // Use http write timeout if https write timeout wasn't defined + if int64(s.TLSWriteTimeout) == 0 { + s.TLSWriteTimeout = s.WriteTimeout + } + } + + if s.hasScheme(schemeUnix) { + domSockListener, err := net.Listen("unix", string(s.SocketPath)) + if err != nil { + return err + } + s.domainSocketL = domSockListener + } + + if s.hasScheme(schemeHTTP) { + listener, err := net.Listen("tcp", net.JoinHostPort(s.Host, strconv.Itoa(s.Port))) + if err != nil { + return err + } + + h, p, err := swag.SplitHostPort(listener.Addr().String()) + if err != nil { + return err + } + s.Host = h + s.Port = p + s.httpServerL = listener + } + + if s.hasScheme(schemeHTTPS) { + tlsListener, err := net.Listen("tcp", net.JoinHostPort(s.TLSHost, strconv.Itoa(s.TLSPort))) + if err != nil { + return err + } + + sh, sp, err := swag.SplitHostPort(tlsListener.Addr().String()) + if err != nil { + return err + } + s.TLSHost = sh + s.TLSPort = sp + s.httpsServerL = tlsListener + } + + s.hasListeners = true + return nil +} + +// Shutdown server and clean up resources +func (s *Server) Shutdown() error { + if atomic.CompareAndSwapInt32(&s.shuttingDown, 0, 1) { + close(s.shutdown) + } + return nil +} + +func (s *Server) handleShutdown(wg *sync.WaitGroup, serversPtr *[]*http.Server) { + // wg.Done must occur last, after s.api.ServerShutdown() + // (to preserve old behaviour) + defer wg.Done() + + <-s.shutdown + + servers := *serversPtr + + ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout) + defer cancel() + + // first execute the pre-shutdown hook + s.api.PreServerShutdown() + + shutdownChan := make(chan bool) + for i := range servers { + server := servers[i] + go func() { + var success bool + defer func() { + shutdownChan <- success + }() + if err := server.Shutdown(ctx); err != nil { + // Error from closing listeners, or context timeout: + s.Logf("HTTP server Shutdown: %v", err) + } else { + success = true + } + }() + } + + // Wait until all listeners have successfully shut down before calling ServerShutdown + success := true + for range servers { + success = success && <-shutdownChan + } + if success { + s.api.ServerShutdown() + } +} + +// GetHandler returns a handler useful for testing +func (s *Server) GetHandler() http.Handler { + return s.handler +} + +// SetHandler allows for setting a http handler on this server +func (s *Server) SetHandler(handler http.Handler) { + s.handler = handler +} + +// UnixListener returns the domain socket listener +func (s *Server) UnixListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.domainSocketL, nil +} + +// HTTPListener returns the http listener +func (s *Server) HTTPListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpServerL, nil +} + +// TLSListener returns the https listener +func (s *Server) TLSListener() (net.Listener, error) { + if !s.hasListeners { + if err := s.Listen(); err != nil { + return nil, err + } + } + return s.httpsServerL, nil +} + +func handleInterrupt(once *sync.Once, s *Server) { + once.Do(func() { + for range s.interrupt { + if s.interrupted { + s.Logf("Server already shutting down") + continue + } + s.interrupted = true + s.Logf("Shutting down... ") + if err := s.Shutdown(); err != nil { + s.Logf("HTTP server Shutdown: %v", err) + } + } + }) +} + +func signalNotify(interrupt chan<- os.Signal) { + signal.Notify(interrupt, syscall.SIGINT, syscall.SIGTERM) +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go new file mode 100644 index 00000000000..e2b0a3a966b --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order.go @@ -0,0 +1,70 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateMoveTaskOrderHandlerFunc turns a function with the right signature into a create move task order handler +type CreateMoveTaskOrderHandlerFunc func(CreateMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateMoveTaskOrderHandlerFunc) Handle(params CreateMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// CreateMoveTaskOrderHandler interface for that can handle valid create move task order params +type CreateMoveTaskOrderHandler interface { + Handle(CreateMoveTaskOrderParams) middleware.Responder +} + +// NewCreateMoveTaskOrder creates a new http.Handler for the create move task order operation +func NewCreateMoveTaskOrder(ctx *middleware.Context, handler CreateMoveTaskOrderHandler) *CreateMoveTaskOrder { + return &CreateMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + CreateMoveTaskOrder swagger:route POST /move-task-orders moveTaskOrder createMoveTaskOrder + +createMoveTaskOrder + +Creates an instance of moveTaskOrder. +Currently this will also create a number of nested objects but not all. +It will currently create +* MoveTaskOrder +* Order +* Customer +* User +* Entitlement + +It will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID, +origin duty station ID, and an uploaded orders ID to be passed into the request. + +This is a support endpoint and will not be available in production. +*/ +type CreateMoveTaskOrder struct { + Context *middleware.Context + Handler CreateMoveTaskOrderHandler +} + +func (o *CreateMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go new file mode 100644 index 00000000000..fd9e4a1971c --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewCreateMoveTaskOrderParams creates a new CreateMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewCreateMoveTaskOrderParams() CreateMoveTaskOrderParams { + + return CreateMoveTaskOrderParams{} +} + +// CreateMoveTaskOrderParams contains all the bound params for the create move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters createMoveTaskOrder +type CreateMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *supportmessages.MoveTaskOrder +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateMoveTaskOrderParams() beforehand. +func (o *CreateMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.MoveTaskOrder + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go new file mode 100644 index 00000000000..77d995a68be --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_responses.go @@ -0,0 +1,329 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// CreateMoveTaskOrderCreatedCode is the HTTP code returned for type CreateMoveTaskOrderCreated +const CreateMoveTaskOrderCreatedCode int = 201 + +/* +CreateMoveTaskOrderCreated Successfully created MoveTaskOrder object. + +swagger:response createMoveTaskOrderCreated +*/ +type CreateMoveTaskOrderCreated struct { + + /* + In: Body + */ + Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderCreated creates CreateMoveTaskOrderCreated with default headers values +func NewCreateMoveTaskOrderCreated() *CreateMoveTaskOrderCreated { + + return &CreateMoveTaskOrderCreated{} +} + +// WithPayload adds the payload to the create move task order created response +func (o *CreateMoveTaskOrderCreated) WithPayload(payload *supportmessages.MoveTaskOrder) *CreateMoveTaskOrderCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order created response +func (o *CreateMoveTaskOrderCreated) SetPayload(payload *supportmessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderBadRequestCode is the HTTP code returned for type CreateMoveTaskOrderBadRequest +const CreateMoveTaskOrderBadRequestCode int = 400 + +/* +CreateMoveTaskOrderBadRequest The request payload is invalid. + +swagger:response createMoveTaskOrderBadRequest +*/ +type CreateMoveTaskOrderBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderBadRequest creates CreateMoveTaskOrderBadRequest with default headers values +func NewCreateMoveTaskOrderBadRequest() *CreateMoveTaskOrderBadRequest { + + return &CreateMoveTaskOrderBadRequest{} +} + +// WithPayload adds the payload to the create move task order bad request response +func (o *CreateMoveTaskOrderBadRequest) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order bad request response +func (o *CreateMoveTaskOrderBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderUnauthorizedCode is the HTTP code returned for type CreateMoveTaskOrderUnauthorized +const CreateMoveTaskOrderUnauthorizedCode int = 401 + +/* +CreateMoveTaskOrderUnauthorized The request was denied. + +swagger:response createMoveTaskOrderUnauthorized +*/ +type CreateMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderUnauthorized creates CreateMoveTaskOrderUnauthorized with default headers values +func NewCreateMoveTaskOrderUnauthorized() *CreateMoveTaskOrderUnauthorized { + + return &CreateMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the create move task order unauthorized response +func (o *CreateMoveTaskOrderUnauthorized) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order unauthorized response +func (o *CreateMoveTaskOrderUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderForbiddenCode is the HTTP code returned for type CreateMoveTaskOrderForbidden +const CreateMoveTaskOrderForbiddenCode int = 403 + +/* +CreateMoveTaskOrderForbidden The request was denied. + +swagger:response createMoveTaskOrderForbidden +*/ +type CreateMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderForbidden creates CreateMoveTaskOrderForbidden with default headers values +func NewCreateMoveTaskOrderForbidden() *CreateMoveTaskOrderForbidden { + + return &CreateMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the create move task order forbidden response +func (o *CreateMoveTaskOrderForbidden) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order forbidden response +func (o *CreateMoveTaskOrderForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderNotFoundCode is the HTTP code returned for type CreateMoveTaskOrderNotFound +const CreateMoveTaskOrderNotFoundCode int = 404 + +/* +CreateMoveTaskOrderNotFound The requested resource wasn't found. + +swagger:response createMoveTaskOrderNotFound +*/ +type CreateMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderNotFound creates CreateMoveTaskOrderNotFound with default headers values +func NewCreateMoveTaskOrderNotFound() *CreateMoveTaskOrderNotFound { + + return &CreateMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the create move task order not found response +func (o *CreateMoveTaskOrderNotFound) WithPayload(payload *supportmessages.ClientError) *CreateMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order not found response +func (o *CreateMoveTaskOrderNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderUnprocessableEntityCode is the HTTP code returned for type CreateMoveTaskOrderUnprocessableEntity +const CreateMoveTaskOrderUnprocessableEntityCode int = 422 + +/* +CreateMoveTaskOrderUnprocessableEntity The payload was unprocessable. + +swagger:response createMoveTaskOrderUnprocessableEntity +*/ +type CreateMoveTaskOrderUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderUnprocessableEntity creates CreateMoveTaskOrderUnprocessableEntity with default headers values +func NewCreateMoveTaskOrderUnprocessableEntity() *CreateMoveTaskOrderUnprocessableEntity { + + return &CreateMoveTaskOrderUnprocessableEntity{} +} + +// WithPayload adds the payload to the create move task order unprocessable entity response +func (o *CreateMoveTaskOrderUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *CreateMoveTaskOrderUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order unprocessable entity response +func (o *CreateMoveTaskOrderUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type CreateMoveTaskOrderInternalServerError +const CreateMoveTaskOrderInternalServerErrorCode int = 500 + +/* +CreateMoveTaskOrderInternalServerError A server error occurred. + +swagger:response createMoveTaskOrderInternalServerError +*/ +type CreateMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewCreateMoveTaskOrderInternalServerError creates CreateMoveTaskOrderInternalServerError with default headers values +func NewCreateMoveTaskOrderInternalServerError() *CreateMoveTaskOrderInternalServerError { + + return &CreateMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the create move task order internal server error response +func (o *CreateMoveTaskOrderInternalServerError) WithPayload(payload *supportmessages.Error) *CreateMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create move task order internal server error response +func (o *CreateMoveTaskOrderInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..02b026b8c23 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/create_move_task_order_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateMoveTaskOrderURL generates an URL for the create move task order operation +type CreateMoveTaskOrderURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMoveTaskOrderURL) WithBasePath(bp string) *CreateMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go new file mode 100644 index 00000000000..06ac6848cb3 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order.go @@ -0,0 +1,63 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetMoveTaskOrderHandlerFunc turns a function with the right signature into a get move task order handler +type GetMoveTaskOrderHandlerFunc func(GetMoveTaskOrderParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetMoveTaskOrderHandlerFunc) Handle(params GetMoveTaskOrderParams) middleware.Responder { + return fn(params) +} + +// GetMoveTaskOrderHandler interface for that can handle valid get move task order params +type GetMoveTaskOrderHandler interface { + Handle(GetMoveTaskOrderParams) middleware.Responder +} + +// NewGetMoveTaskOrder creates a new http.Handler for the get move task order operation +func NewGetMoveTaskOrder(ctx *middleware.Context, handler GetMoveTaskOrderHandler) *GetMoveTaskOrder { + return &GetMoveTaskOrder{Context: ctx, Handler: handler} +} + +/* + GetMoveTaskOrder swagger:route GET /move-task-orders/{moveTaskOrderID} moveTaskOrder getMoveTaskOrder + +getMoveTaskOrder + +### Functionality +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. + +This is a support endpoint and is not available in production. +*/ +type GetMoveTaskOrder struct { + Context *middleware.Context + Handler GetMoveTaskOrderHandler +} + +func (o *GetMoveTaskOrder) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetMoveTaskOrderParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..0e5f3196d46 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,71 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object +// +// There are no default values defined in the spec. +func NewGetMoveTaskOrderParams() GetMoveTaskOrderParams { + + return GetMoveTaskOrderParams{} +} + +// GetMoveTaskOrderParams contains all the bound params for the get move task order operation +// typically these are obtained from a http.Request +// +// swagger:parameters getMoveTaskOrder +type GetMoveTaskOrderParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of move task order to use. + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetMoveTaskOrderParams() beforehand. +func (o *GetMoveTaskOrderParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *GetMoveTaskOrderParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..6b7a03369f0 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// GetMoveTaskOrderOKCode is the HTTP code returned for type GetMoveTaskOrderOK +const GetMoveTaskOrderOKCode int = 200 + +/* +GetMoveTaskOrderOK Successfully retrieve an individual move task order. + +swagger:response getMoveTaskOrderOK +*/ +type GetMoveTaskOrderOK struct { + + /* + In: Body + */ + Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderOK creates GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + + return &GetMoveTaskOrderOK{} +} + +// WithPayload adds the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) WithPayload(payload *supportmessages.MoveTaskOrder) *GetMoveTaskOrderOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order o k response +func (o *GetMoveTaskOrderOK) SetPayload(payload *supportmessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderUnauthorizedCode is the HTTP code returned for type GetMoveTaskOrderUnauthorized +const GetMoveTaskOrderUnauthorizedCode int = 401 + +/* +GetMoveTaskOrderUnauthorized The request was denied. + +swagger:response getMoveTaskOrderUnauthorized +*/ +type GetMoveTaskOrderUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderUnauthorized creates GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + + return &GetMoveTaskOrderUnauthorized{} +} + +// WithPayload adds the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderForbiddenCode is the HTTP code returned for type GetMoveTaskOrderForbidden +const GetMoveTaskOrderForbiddenCode int = 403 + +/* +GetMoveTaskOrderForbidden The request was denied. + +swagger:response getMoveTaskOrderForbidden +*/ +type GetMoveTaskOrderForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderForbidden creates GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + + return &GetMoveTaskOrderForbidden{} +} + +// WithPayload adds the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderNotFoundCode is the HTTP code returned for type GetMoveTaskOrderNotFound +const GetMoveTaskOrderNotFoundCode int = 404 + +/* +GetMoveTaskOrderNotFound The requested resource wasn't found. + +swagger:response getMoveTaskOrderNotFound +*/ +type GetMoveTaskOrderNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderNotFound creates GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + + return &GetMoveTaskOrderNotFound{} +} + +// WithPayload adds the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) WithPayload(payload *supportmessages.ClientError) *GetMoveTaskOrderNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order not found response +func (o *GetMoveTaskOrderNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetMoveTaskOrderInternalServerErrorCode is the HTTP code returned for type GetMoveTaskOrderInternalServerError +const GetMoveTaskOrderInternalServerErrorCode int = 500 + +/* +GetMoveTaskOrderInternalServerError A server error occurred. + +swagger:response getMoveTaskOrderInternalServerError +*/ +type GetMoveTaskOrderInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewGetMoveTaskOrderInternalServerError creates GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + + return &GetMoveTaskOrderInternalServerError{} +} + +// WithPayload adds the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) WithPayload(payload *supportmessages.Error) *GetMoveTaskOrderInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetMoveTaskOrderInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go new file mode 100644 index 00000000000..e242bf4cb95 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/get_move_task_order_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// GetMoveTaskOrderURL generates an URL for the get move task order operation +type GetMoveTaskOrderURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) WithBasePath(bp string) *GetMoveTaskOrderURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetMoveTaskOrderURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetMoveTaskOrderURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on GetMoveTaskOrderURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetMoveTaskOrderURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetMoveTaskOrderURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetMoveTaskOrderURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetMoveTaskOrderURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetMoveTaskOrderURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetMoveTaskOrderURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go new file mode 100644 index 00000000000..ae4ef40e9a1 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// HideNonFakeMoveTaskOrdersHandlerFunc turns a function with the right signature into a hide non fake move task orders handler +type HideNonFakeMoveTaskOrdersHandlerFunc func(HideNonFakeMoveTaskOrdersParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn HideNonFakeMoveTaskOrdersHandlerFunc) Handle(params HideNonFakeMoveTaskOrdersParams) middleware.Responder { + return fn(params) +} + +// HideNonFakeMoveTaskOrdersHandler interface for that can handle valid hide non fake move task orders params +type HideNonFakeMoveTaskOrdersHandler interface { + Handle(HideNonFakeMoveTaskOrdersParams) middleware.Responder +} + +// NewHideNonFakeMoveTaskOrders creates a new http.Handler for the hide non fake move task orders operation +func NewHideNonFakeMoveTaskOrders(ctx *middleware.Context, handler HideNonFakeMoveTaskOrdersHandler) *HideNonFakeMoveTaskOrders { + return &HideNonFakeMoveTaskOrders{Context: ctx, Handler: handler} +} + +/* + HideNonFakeMoveTaskOrders swagger:route PATCH /move-task-orders/hide moveTaskOrder hideNonFakeMoveTaskOrders + +hideNonFakeMoveTaskOrders + +Updates move task order without fake user data `show` to false. No request body required.
+
+This is a support endpoint and will not be available in production. +*/ +type HideNonFakeMoveTaskOrders struct { + Context *middleware.Context + Handler HideNonFakeMoveTaskOrdersHandler +} + +func (o *HideNonFakeMoveTaskOrders) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewHideNonFakeMoveTaskOrdersParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go new file mode 100644 index 00000000000..b28c903b281 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_parameters.go @@ -0,0 +1,46 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" +) + +// NewHideNonFakeMoveTaskOrdersParams creates a new HideNonFakeMoveTaskOrdersParams object +// +// There are no default values defined in the spec. +func NewHideNonFakeMoveTaskOrdersParams() HideNonFakeMoveTaskOrdersParams { + + return HideNonFakeMoveTaskOrdersParams{} +} + +// HideNonFakeMoveTaskOrdersParams contains all the bound params for the hide non fake move task orders operation +// typically these are obtained from a http.Request +// +// swagger:parameters hideNonFakeMoveTaskOrders +type HideNonFakeMoveTaskOrdersParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewHideNonFakeMoveTaskOrdersParams() beforehand. +func (o *HideNonFakeMoveTaskOrdersParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go new file mode 100644 index 00000000000..3b8610b7ad1 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// HideNonFakeMoveTaskOrdersOKCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersOK +const HideNonFakeMoveTaskOrdersOKCode int = 200 + +/* +HideNonFakeMoveTaskOrdersOK Successfully hid MTOs. + +swagger:response hideNonFakeMoveTaskOrdersOK +*/ +type HideNonFakeMoveTaskOrdersOK struct { + + /* + In: Body + */ + Payload *supportmessages.MTOHideMovesResponse `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersOK creates HideNonFakeMoveTaskOrdersOK with default headers values +func NewHideNonFakeMoveTaskOrdersOK() *HideNonFakeMoveTaskOrdersOK { + + return &HideNonFakeMoveTaskOrdersOK{} +} + +// WithPayload adds the payload to the hide non fake move task orders o k response +func (o *HideNonFakeMoveTaskOrdersOK) WithPayload(payload *supportmessages.MTOHideMovesResponse) *HideNonFakeMoveTaskOrdersOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders o k response +func (o *HideNonFakeMoveTaskOrdersOK) SetPayload(payload *supportmessages.MTOHideMovesResponse) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersBadRequestCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersBadRequest +const HideNonFakeMoveTaskOrdersBadRequestCode int = 400 + +/* +HideNonFakeMoveTaskOrdersBadRequest The request payload is invalid. + +swagger:response hideNonFakeMoveTaskOrdersBadRequest +*/ +type HideNonFakeMoveTaskOrdersBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersBadRequest creates HideNonFakeMoveTaskOrdersBadRequest with default headers values +func NewHideNonFakeMoveTaskOrdersBadRequest() *HideNonFakeMoveTaskOrdersBadRequest { + + return &HideNonFakeMoveTaskOrdersBadRequest{} +} + +// WithPayload adds the payload to the hide non fake move task orders bad request response +func (o *HideNonFakeMoveTaskOrdersBadRequest) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders bad request response +func (o *HideNonFakeMoveTaskOrdersBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersUnauthorizedCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersUnauthorized +const HideNonFakeMoveTaskOrdersUnauthorizedCode int = 401 + +/* +HideNonFakeMoveTaskOrdersUnauthorized The request was denied. + +swagger:response hideNonFakeMoveTaskOrdersUnauthorized +*/ +type HideNonFakeMoveTaskOrdersUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersUnauthorized creates HideNonFakeMoveTaskOrdersUnauthorized with default headers values +func NewHideNonFakeMoveTaskOrdersUnauthorized() *HideNonFakeMoveTaskOrdersUnauthorized { + + return &HideNonFakeMoveTaskOrdersUnauthorized{} +} + +// WithPayload adds the payload to the hide non fake move task orders unauthorized response +func (o *HideNonFakeMoveTaskOrdersUnauthorized) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders unauthorized response +func (o *HideNonFakeMoveTaskOrdersUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersForbiddenCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersForbidden +const HideNonFakeMoveTaskOrdersForbiddenCode int = 403 + +/* +HideNonFakeMoveTaskOrdersForbidden The request was denied. + +swagger:response hideNonFakeMoveTaskOrdersForbidden +*/ +type HideNonFakeMoveTaskOrdersForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersForbidden creates HideNonFakeMoveTaskOrdersForbidden with default headers values +func NewHideNonFakeMoveTaskOrdersForbidden() *HideNonFakeMoveTaskOrdersForbidden { + + return &HideNonFakeMoveTaskOrdersForbidden{} +} + +// WithPayload adds the payload to the hide non fake move task orders forbidden response +func (o *HideNonFakeMoveTaskOrdersForbidden) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders forbidden response +func (o *HideNonFakeMoveTaskOrdersForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersNotFoundCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersNotFound +const HideNonFakeMoveTaskOrdersNotFoundCode int = 404 + +/* +HideNonFakeMoveTaskOrdersNotFound The requested resource wasn't found. + +swagger:response hideNonFakeMoveTaskOrdersNotFound +*/ +type HideNonFakeMoveTaskOrdersNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersNotFound creates HideNonFakeMoveTaskOrdersNotFound with default headers values +func NewHideNonFakeMoveTaskOrdersNotFound() *HideNonFakeMoveTaskOrdersNotFound { + + return &HideNonFakeMoveTaskOrdersNotFound{} +} + +// WithPayload adds the payload to the hide non fake move task orders not found response +func (o *HideNonFakeMoveTaskOrdersNotFound) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders not found response +func (o *HideNonFakeMoveTaskOrdersNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersConflictCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersConflict +const HideNonFakeMoveTaskOrdersConflictCode int = 409 + +/* +HideNonFakeMoveTaskOrdersConflict There was a conflict with the request. + +swagger:response hideNonFakeMoveTaskOrdersConflict +*/ +type HideNonFakeMoveTaskOrdersConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersConflict creates HideNonFakeMoveTaskOrdersConflict with default headers values +func NewHideNonFakeMoveTaskOrdersConflict() *HideNonFakeMoveTaskOrdersConflict { + + return &HideNonFakeMoveTaskOrdersConflict{} +} + +// WithPayload adds the payload to the hide non fake move task orders conflict response +func (o *HideNonFakeMoveTaskOrdersConflict) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders conflict response +func (o *HideNonFakeMoveTaskOrdersConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersPreconditionFailedCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersPreconditionFailed +const HideNonFakeMoveTaskOrdersPreconditionFailedCode int = 412 + +/* +HideNonFakeMoveTaskOrdersPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response hideNonFakeMoveTaskOrdersPreconditionFailed +*/ +type HideNonFakeMoveTaskOrdersPreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersPreconditionFailed creates HideNonFakeMoveTaskOrdersPreconditionFailed with default headers values +func NewHideNonFakeMoveTaskOrdersPreconditionFailed() *HideNonFakeMoveTaskOrdersPreconditionFailed { + + return &HideNonFakeMoveTaskOrdersPreconditionFailed{} +} + +// WithPayload adds the payload to the hide non fake move task orders precondition failed response +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *HideNonFakeMoveTaskOrdersPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders precondition failed response +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersUnprocessableEntityCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersUnprocessableEntity +const HideNonFakeMoveTaskOrdersUnprocessableEntityCode int = 422 + +/* +HideNonFakeMoveTaskOrdersUnprocessableEntity The payload was unprocessable. + +swagger:response hideNonFakeMoveTaskOrdersUnprocessableEntity +*/ +type HideNonFakeMoveTaskOrdersUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersUnprocessableEntity creates HideNonFakeMoveTaskOrdersUnprocessableEntity with default headers values +func NewHideNonFakeMoveTaskOrdersUnprocessableEntity() *HideNonFakeMoveTaskOrdersUnprocessableEntity { + + return &HideNonFakeMoveTaskOrdersUnprocessableEntity{} +} + +// WithPayload adds the payload to the hide non fake move task orders unprocessable entity response +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *HideNonFakeMoveTaskOrdersUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders unprocessable entity response +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// HideNonFakeMoveTaskOrdersInternalServerErrorCode is the HTTP code returned for type HideNonFakeMoveTaskOrdersInternalServerError +const HideNonFakeMoveTaskOrdersInternalServerErrorCode int = 500 + +/* +HideNonFakeMoveTaskOrdersInternalServerError A server error occurred. + +swagger:response hideNonFakeMoveTaskOrdersInternalServerError +*/ +type HideNonFakeMoveTaskOrdersInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewHideNonFakeMoveTaskOrdersInternalServerError creates HideNonFakeMoveTaskOrdersInternalServerError with default headers values +func NewHideNonFakeMoveTaskOrdersInternalServerError() *HideNonFakeMoveTaskOrdersInternalServerError { + + return &HideNonFakeMoveTaskOrdersInternalServerError{} +} + +// WithPayload adds the payload to the hide non fake move task orders internal server error response +func (o *HideNonFakeMoveTaskOrdersInternalServerError) WithPayload(payload *supportmessages.Error) *HideNonFakeMoveTaskOrdersInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the hide non fake move task orders internal server error response +func (o *HideNonFakeMoveTaskOrdersInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *HideNonFakeMoveTaskOrdersInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go new file mode 100644 index 00000000000..ba5762da8b9 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/hide_non_fake_move_task_orders_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// HideNonFakeMoveTaskOrdersURL generates an URL for the hide non fake move task orders operation +type HideNonFakeMoveTaskOrdersURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *HideNonFakeMoveTaskOrdersURL) WithBasePath(bp string) *HideNonFakeMoveTaskOrdersURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *HideNonFakeMoveTaskOrdersURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *HideNonFakeMoveTaskOrdersURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/hide" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *HideNonFakeMoveTaskOrdersURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *HideNonFakeMoveTaskOrdersURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *HideNonFakeMoveTaskOrdersURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on HideNonFakeMoveTaskOrdersURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on HideNonFakeMoveTaskOrdersURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *HideNonFakeMoveTaskOrdersURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go new file mode 100644 index 00000000000..bdbbabe2ec8 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMTOsHandlerFunc turns a function with the right signature into a list m t os handler +type ListMTOsHandlerFunc func(ListMTOsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMTOsHandlerFunc) Handle(params ListMTOsParams) middleware.Responder { + return fn(params) +} + +// ListMTOsHandler interface for that can handle valid list m t os params +type ListMTOsHandler interface { + Handle(ListMTOsParams) middleware.Responder +} + +// NewListMTOs creates a new http.Handler for the list m t os operation +func NewListMTOs(ctx *middleware.Context, handler ListMTOsHandler) *ListMTOs { + return &ListMTOs{Context: ctx, Handler: handler} +} + +/* + ListMTOs swagger:route GET /move-task-orders moveTaskOrder listMTOs + +listMTOs + +### Functionality +This endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime. + +It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +type ListMTOs struct { + Context *middleware.Context + Handler ListMTOsHandler +} + +func (o *ListMTOs) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMTOsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go new file mode 100644 index 00000000000..754c2290e71 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_parameters.go @@ -0,0 +1,83 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListMTOsParams creates a new ListMTOsParams object +// +// There are no default values defined in the spec. +func NewListMTOsParams() ListMTOsParams { + + return ListMTOsParams{} +} + +// ListMTOsParams contains all the bound params for the list m t os operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMTOs +type ListMTOsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Only return move task orders updated since this time. + In: query + */ + Since *int64 +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMTOsParams() beforehand. +func (o *ListMTOsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + qs := runtime.Values(r.URL.Query()) + + qSince, qhkSince, _ := qs.GetOK("since") + if err := o.bindSince(qSince, qhkSince, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindSince binds and validates parameter Since from query. +func (o *ListMTOsParams) bindSince(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + + value, err := swag.ConvertInt64(raw) + if err != nil { + return errors.InvalidType("since", "query", "int64", raw) + } + o.Since = &value + + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go new file mode 100644 index 00000000000..be3f9c979c0 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ListMTOsOKCode is the HTTP code returned for type ListMTOsOK +const ListMTOsOKCode int = 200 + +/* +ListMTOsOK Successfully retrieved all move task orders. + +swagger:response listMTOsOK +*/ +type ListMTOsOK struct { + + /* + In: Body + */ + Payload supportmessages.MoveTaskOrders `json:"body,omitempty"` +} + +// NewListMTOsOK creates ListMTOsOK with default headers values +func NewListMTOsOK() *ListMTOsOK { + + return &ListMTOsOK{} +} + +// WithPayload adds the payload to the list m t os o k response +func (o *ListMTOsOK) WithPayload(payload supportmessages.MoveTaskOrders) *ListMTOsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os o k response +func (o *ListMTOsOK) SetPayload(payload supportmessages.MoveTaskOrders) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = supportmessages.MoveTaskOrders{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMTOsBadRequestCode is the HTTP code returned for type ListMTOsBadRequest +const ListMTOsBadRequestCode int = 400 + +/* +ListMTOsBadRequest The request payload is invalid. + +swagger:response listMTOsBadRequest +*/ +type ListMTOsBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOsBadRequest creates ListMTOsBadRequest with default headers values +func NewListMTOsBadRequest() *ListMTOsBadRequest { + + return &ListMTOsBadRequest{} +} + +// WithPayload adds the payload to the list m t os bad request response +func (o *ListMTOsBadRequest) WithPayload(payload *supportmessages.ClientError) *ListMTOsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os bad request response +func (o *ListMTOsBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOsUnauthorizedCode is the HTTP code returned for type ListMTOsUnauthorized +const ListMTOsUnauthorizedCode int = 401 + +/* +ListMTOsUnauthorized The request was denied. + +swagger:response listMTOsUnauthorized +*/ +type ListMTOsUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOsUnauthorized creates ListMTOsUnauthorized with default headers values +func NewListMTOsUnauthorized() *ListMTOsUnauthorized { + + return &ListMTOsUnauthorized{} +} + +// WithPayload adds the payload to the list m t os unauthorized response +func (o *ListMTOsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ListMTOsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os unauthorized response +func (o *ListMTOsUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOsForbiddenCode is the HTTP code returned for type ListMTOsForbidden +const ListMTOsForbiddenCode int = 403 + +/* +ListMTOsForbidden The request was denied. + +swagger:response listMTOsForbidden +*/ +type ListMTOsForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOsForbidden creates ListMTOsForbidden with default headers values +func NewListMTOsForbidden() *ListMTOsForbidden { + + return &ListMTOsForbidden{} +} + +// WithPayload adds the payload to the list m t os forbidden response +func (o *ListMTOsForbidden) WithPayload(payload *supportmessages.ClientError) *ListMTOsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os forbidden response +func (o *ListMTOsForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOsNotFoundCode is the HTTP code returned for type ListMTOsNotFound +const ListMTOsNotFoundCode int = 404 + +/* +ListMTOsNotFound The requested resource wasn't found. + +swagger:response listMTOsNotFound +*/ +type ListMTOsNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOsNotFound creates ListMTOsNotFound with default headers values +func NewListMTOsNotFound() *ListMTOsNotFound { + + return &ListMTOsNotFound{} +} + +// WithPayload adds the payload to the list m t os not found response +func (o *ListMTOsNotFound) WithPayload(payload *supportmessages.ClientError) *ListMTOsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os not found response +func (o *ListMTOsNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOsInternalServerErrorCode is the HTTP code returned for type ListMTOsInternalServerError +const ListMTOsInternalServerErrorCode int = 500 + +/* +ListMTOsInternalServerError A server error occurred. + +swagger:response listMTOsInternalServerError +*/ +type ListMTOsInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewListMTOsInternalServerError creates ListMTOsInternalServerError with default headers values +func NewListMTOsInternalServerError() *ListMTOsInternalServerError { + + return &ListMTOsInternalServerError{} +} + +// WithPayload adds the payload to the list m t os internal server error response +func (o *ListMTOsInternalServerError) WithPayload(payload *supportmessages.Error) *ListMTOsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t os internal server error response +func (o *ListMTOsInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go new file mode 100644 index 00000000000..b78ce93d9e8 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/list_m_t_os_urlbuilder.go @@ -0,0 +1,105 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + + "github.com/go-openapi/swag" +) + +// ListMTOsURL generates an URL for the list m t os operation +type ListMTOsURL struct { + Since *int64 + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOsURL) WithBasePath(bp string) *ListMTOsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMTOsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + qs := make(url.Values) + + var sinceQ string + if o.Since != nil { + sinceQ = swag.FormatInt64(*o.Since) + } + if sinceQ != "" { + qs.Set("since", sinceQ) + } + + _result.RawQuery = qs.Encode() + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMTOsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMTOsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMTOsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMTOsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMTOsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMTOsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go new file mode 100644 index 00000000000..203b0a2c1a2 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// MakeMoveTaskOrderAvailableHandlerFunc turns a function with the right signature into a make move task order available handler +type MakeMoveTaskOrderAvailableHandlerFunc func(MakeMoveTaskOrderAvailableParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn MakeMoveTaskOrderAvailableHandlerFunc) Handle(params MakeMoveTaskOrderAvailableParams) middleware.Responder { + return fn(params) +} + +// MakeMoveTaskOrderAvailableHandler interface for that can handle valid make move task order available params +type MakeMoveTaskOrderAvailableHandler interface { + Handle(MakeMoveTaskOrderAvailableParams) middleware.Responder +} + +// NewMakeMoveTaskOrderAvailable creates a new http.Handler for the make move task order available operation +func NewMakeMoveTaskOrderAvailable(ctx *middleware.Context, handler MakeMoveTaskOrderAvailableHandler) *MakeMoveTaskOrderAvailable { + return &MakeMoveTaskOrderAvailable{Context: ctx, Handler: handler} +} + +/* + MakeMoveTaskOrderAvailable swagger:route PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime moveTaskOrder makeMoveTaskOrderAvailable + +makeMoveTaskOrderAvailable + +Updates move task order `availableToPrimeAt` to make it available to prime. No request body required.
+
+This is a support endpoint and will not be available in production. +*/ +type MakeMoveTaskOrderAvailable struct { + Context *middleware.Context + Handler MakeMoveTaskOrderAvailableHandler +} + +func (o *MakeMoveTaskOrderAvailable) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewMakeMoveTaskOrderAvailableParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go new file mode 100644 index 00000000000..f4b48155900 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_parameters.go @@ -0,0 +1,102 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewMakeMoveTaskOrderAvailableParams creates a new MakeMoveTaskOrderAvailableParams object +// +// There are no default values defined in the spec. +func NewMakeMoveTaskOrderAvailableParams() MakeMoveTaskOrderAvailableParams { + + return MakeMoveTaskOrderAvailableParams{} +} + +// MakeMoveTaskOrderAvailableParams contains all the bound params for the make move task order available operation +// typically these are obtained from a http.Request +// +// swagger:parameters makeMoveTaskOrderAvailable +type MakeMoveTaskOrderAvailableParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /*UUID of move task order. + Required: true + In: path + */ + MoveTaskOrderID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewMakeMoveTaskOrderAvailableParams() beforehand. +func (o *MakeMoveTaskOrderAvailableParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *MakeMoveTaskOrderAvailableParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *MakeMoveTaskOrderAvailableParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MoveTaskOrderID = raw + + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go new file mode 100644 index 00000000000..9db559ee96c --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// MakeMoveTaskOrderAvailableOKCode is the HTTP code returned for type MakeMoveTaskOrderAvailableOK +const MakeMoveTaskOrderAvailableOKCode int = 200 + +/* +MakeMoveTaskOrderAvailableOK Successfully made MTO available to Prime. + +swagger:response makeMoveTaskOrderAvailableOK +*/ +type MakeMoveTaskOrderAvailableOK struct { + + /* + In: Body + */ + Payload *supportmessages.MoveTaskOrder `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableOK creates MakeMoveTaskOrderAvailableOK with default headers values +func NewMakeMoveTaskOrderAvailableOK() *MakeMoveTaskOrderAvailableOK { + + return &MakeMoveTaskOrderAvailableOK{} +} + +// WithPayload adds the payload to the make move task order available o k response +func (o *MakeMoveTaskOrderAvailableOK) WithPayload(payload *supportmessages.MoveTaskOrder) *MakeMoveTaskOrderAvailableOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available o k response +func (o *MakeMoveTaskOrderAvailableOK) SetPayload(payload *supportmessages.MoveTaskOrder) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableBadRequestCode is the HTTP code returned for type MakeMoveTaskOrderAvailableBadRequest +const MakeMoveTaskOrderAvailableBadRequestCode int = 400 + +/* +MakeMoveTaskOrderAvailableBadRequest The request payload is invalid. + +swagger:response makeMoveTaskOrderAvailableBadRequest +*/ +type MakeMoveTaskOrderAvailableBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableBadRequest creates MakeMoveTaskOrderAvailableBadRequest with default headers values +func NewMakeMoveTaskOrderAvailableBadRequest() *MakeMoveTaskOrderAvailableBadRequest { + + return &MakeMoveTaskOrderAvailableBadRequest{} +} + +// WithPayload adds the payload to the make move task order available bad request response +func (o *MakeMoveTaskOrderAvailableBadRequest) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available bad request response +func (o *MakeMoveTaskOrderAvailableBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableUnauthorizedCode is the HTTP code returned for type MakeMoveTaskOrderAvailableUnauthorized +const MakeMoveTaskOrderAvailableUnauthorizedCode int = 401 + +/* +MakeMoveTaskOrderAvailableUnauthorized The request was denied. + +swagger:response makeMoveTaskOrderAvailableUnauthorized +*/ +type MakeMoveTaskOrderAvailableUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableUnauthorized creates MakeMoveTaskOrderAvailableUnauthorized with default headers values +func NewMakeMoveTaskOrderAvailableUnauthorized() *MakeMoveTaskOrderAvailableUnauthorized { + + return &MakeMoveTaskOrderAvailableUnauthorized{} +} + +// WithPayload adds the payload to the make move task order available unauthorized response +func (o *MakeMoveTaskOrderAvailableUnauthorized) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available unauthorized response +func (o *MakeMoveTaskOrderAvailableUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableForbiddenCode is the HTTP code returned for type MakeMoveTaskOrderAvailableForbidden +const MakeMoveTaskOrderAvailableForbiddenCode int = 403 + +/* +MakeMoveTaskOrderAvailableForbidden The request was denied. + +swagger:response makeMoveTaskOrderAvailableForbidden +*/ +type MakeMoveTaskOrderAvailableForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableForbidden creates MakeMoveTaskOrderAvailableForbidden with default headers values +func NewMakeMoveTaskOrderAvailableForbidden() *MakeMoveTaskOrderAvailableForbidden { + + return &MakeMoveTaskOrderAvailableForbidden{} +} + +// WithPayload adds the payload to the make move task order available forbidden response +func (o *MakeMoveTaskOrderAvailableForbidden) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available forbidden response +func (o *MakeMoveTaskOrderAvailableForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableNotFoundCode is the HTTP code returned for type MakeMoveTaskOrderAvailableNotFound +const MakeMoveTaskOrderAvailableNotFoundCode int = 404 + +/* +MakeMoveTaskOrderAvailableNotFound The requested resource wasn't found. + +swagger:response makeMoveTaskOrderAvailableNotFound +*/ +type MakeMoveTaskOrderAvailableNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableNotFound creates MakeMoveTaskOrderAvailableNotFound with default headers values +func NewMakeMoveTaskOrderAvailableNotFound() *MakeMoveTaskOrderAvailableNotFound { + + return &MakeMoveTaskOrderAvailableNotFound{} +} + +// WithPayload adds the payload to the make move task order available not found response +func (o *MakeMoveTaskOrderAvailableNotFound) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailableNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available not found response +func (o *MakeMoveTaskOrderAvailableNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailablePreconditionFailedCode is the HTTP code returned for type MakeMoveTaskOrderAvailablePreconditionFailed +const MakeMoveTaskOrderAvailablePreconditionFailedCode int = 412 + +/* +MakeMoveTaskOrderAvailablePreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response makeMoveTaskOrderAvailablePreconditionFailed +*/ +type MakeMoveTaskOrderAvailablePreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailablePreconditionFailed creates MakeMoveTaskOrderAvailablePreconditionFailed with default headers values +func NewMakeMoveTaskOrderAvailablePreconditionFailed() *MakeMoveTaskOrderAvailablePreconditionFailed { + + return &MakeMoveTaskOrderAvailablePreconditionFailed{} +} + +// WithPayload adds the payload to the make move task order available precondition failed response +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) WithPayload(payload *supportmessages.ClientError) *MakeMoveTaskOrderAvailablePreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available precondition failed response +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableUnprocessableEntityCode is the HTTP code returned for type MakeMoveTaskOrderAvailableUnprocessableEntity +const MakeMoveTaskOrderAvailableUnprocessableEntityCode int = 422 + +/* +MakeMoveTaskOrderAvailableUnprocessableEntity The payload was unprocessable. + +swagger:response makeMoveTaskOrderAvailableUnprocessableEntity +*/ +type MakeMoveTaskOrderAvailableUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableUnprocessableEntity creates MakeMoveTaskOrderAvailableUnprocessableEntity with default headers values +func NewMakeMoveTaskOrderAvailableUnprocessableEntity() *MakeMoveTaskOrderAvailableUnprocessableEntity { + + return &MakeMoveTaskOrderAvailableUnprocessableEntity{} +} + +// WithPayload adds the payload to the make move task order available unprocessable entity response +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *MakeMoveTaskOrderAvailableUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available unprocessable entity response +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// MakeMoveTaskOrderAvailableInternalServerErrorCode is the HTTP code returned for type MakeMoveTaskOrderAvailableInternalServerError +const MakeMoveTaskOrderAvailableInternalServerErrorCode int = 500 + +/* +MakeMoveTaskOrderAvailableInternalServerError A server error occurred. + +swagger:response makeMoveTaskOrderAvailableInternalServerError +*/ +type MakeMoveTaskOrderAvailableInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewMakeMoveTaskOrderAvailableInternalServerError creates MakeMoveTaskOrderAvailableInternalServerError with default headers values +func NewMakeMoveTaskOrderAvailableInternalServerError() *MakeMoveTaskOrderAvailableInternalServerError { + + return &MakeMoveTaskOrderAvailableInternalServerError{} +} + +// WithPayload adds the payload to the make move task order available internal server error response +func (o *MakeMoveTaskOrderAvailableInternalServerError) WithPayload(payload *supportmessages.Error) *MakeMoveTaskOrderAvailableInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the make move task order available internal server error response +func (o *MakeMoveTaskOrderAvailableInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *MakeMoveTaskOrderAvailableInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go new file mode 100644 index 00000000000..876b193942f --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/move_task_order/make_move_task_order_available_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// MakeMoveTaskOrderAvailableURL generates an URL for the make move task order available operation +type MakeMoveTaskOrderAvailableURL struct { + MoveTaskOrderID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *MakeMoveTaskOrderAvailableURL) WithBasePath(bp string) *MakeMoveTaskOrderAvailableURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *MakeMoveTaskOrderAvailableURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *MakeMoveTaskOrderAvailableURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/available-to-prime" + + moveTaskOrderID := o.MoveTaskOrderID + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on MakeMoveTaskOrderAvailableURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *MakeMoveTaskOrderAvailableURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *MakeMoveTaskOrderAvailableURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *MakeMoveTaskOrderAvailableURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on MakeMoveTaskOrderAvailableURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on MakeMoveTaskOrderAvailableURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *MakeMoveTaskOrderAvailableURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go new file mode 100644 index 00000000000..795ce4b9285 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status.go @@ -0,0 +1,60 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOServiceItemStatusHandlerFunc turns a function with the right signature into a update m t o service item status handler +type UpdateMTOServiceItemStatusHandlerFunc func(UpdateMTOServiceItemStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOServiceItemStatusHandlerFunc) Handle(params UpdateMTOServiceItemStatusParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOServiceItemStatusHandler interface for that can handle valid update m t o service item status params +type UpdateMTOServiceItemStatusHandler interface { + Handle(UpdateMTOServiceItemStatusParams) middleware.Responder +} + +// NewUpdateMTOServiceItemStatus creates a new http.Handler for the update m t o service item status operation +func NewUpdateMTOServiceItemStatus(ctx *middleware.Context, handler UpdateMTOServiceItemStatusHandler) *UpdateMTOServiceItemStatus { + return &UpdateMTOServiceItemStatus{Context: ctx, Handler: handler} +} + +/* + UpdateMTOServiceItemStatus swagger:route PATCH /mto-service-items/{mtoServiceItemID}/status mtoServiceItem updateMTOServiceItemStatus + +updateMTOServiceItemStatus + +Updates the status of a service item for a move to APPROVED or REJECTED.
+
+This is a support endpoint and will not be available in production. +*/ +type UpdateMTOServiceItemStatus struct { + Context *middleware.Context + Handler UpdateMTOServiceItemStatusHandler +} + +func (o *UpdateMTOServiceItemStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOServiceItemStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go new file mode 100644 index 00000000000..84aff8969a1 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_parameters.go @@ -0,0 +1,139 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOServiceItemStatusParams() UpdateMTOServiceItemStatusParams { + + return UpdateMTOServiceItemStatusParams{} +} + +// UpdateMTOServiceItemStatusParams contains all the bound params for the update m t o service item status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOServiceItemStatus +type UpdateMTOServiceItemStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *supportmessages.UpdateMTOServiceItemStatus + /*UUID of mto service item to use. + Required: true + In: path + */ + MtoServiceItemID string +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOServiceItemStatusParams() beforehand. +func (o *UpdateMTOServiceItemStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.UpdateMTOServiceItemStatus + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoServiceItemID, rhkMtoServiceItemID, _ := route.Params.GetOK("mtoServiceItemID") + if err := o.bindMtoServiceItemID(rMtoServiceItemID, rhkMtoServiceItemID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOServiceItemStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoServiceItemID binds and validates parameter MtoServiceItemID from path. +func (o *UpdateMTOServiceItemStatusParams) bindMtoServiceItemID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + o.MtoServiceItemID = raw + + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go new file mode 100644 index 00000000000..8ef6bd9a8d4 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdateMTOServiceItemStatusOKCode is the HTTP code returned for type UpdateMTOServiceItemStatusOK +const UpdateMTOServiceItemStatusOKCode int = 200 + +/* +UpdateMTOServiceItemStatusOK Successfully updated service item status for a move task order. + +swagger:response updateMTOServiceItemStatusOK +*/ +type UpdateMTOServiceItemStatusOK struct { + + /* + In: Body + */ + Payload supportmessages.MTOServiceItem `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusOK creates UpdateMTOServiceItemStatusOK with default headers values +func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { + + return &UpdateMTOServiceItemStatusOK{} +} + +// WithPayload adds the payload to the update m t o service item status o k response +func (o *UpdateMTOServiceItemStatusOK) WithPayload(payload supportmessages.MTOServiceItem) *UpdateMTOServiceItemStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status o k response +func (o *UpdateMTOServiceItemStatusOK) SetPayload(payload supportmessages.MTOServiceItem) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusBadRequestCode is the HTTP code returned for type UpdateMTOServiceItemStatusBadRequest +const UpdateMTOServiceItemStatusBadRequestCode int = 400 + +/* +UpdateMTOServiceItemStatusBadRequest The request payload is invalid. + +swagger:response updateMTOServiceItemStatusBadRequest +*/ +type UpdateMTOServiceItemStatusBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusBadRequest creates UpdateMTOServiceItemStatusBadRequest with default headers values +func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { + + return &UpdateMTOServiceItemStatusBadRequest{} +} + +// WithPayload adds the payload to the update m t o service item status bad request response +func (o *UpdateMTOServiceItemStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status bad request response +func (o *UpdateMTOServiceItemStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnauthorized +const UpdateMTOServiceItemStatusUnauthorizedCode int = 401 + +/* +UpdateMTOServiceItemStatusUnauthorized The request was denied. + +swagger:response updateMTOServiceItemStatusUnauthorized +*/ +type UpdateMTOServiceItemStatusUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusUnauthorized creates UpdateMTOServiceItemStatusUnauthorized with default headers values +func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { + + return &UpdateMTOServiceItemStatusUnauthorized{} +} + +// WithPayload adds the payload to the update m t o service item status unauthorized response +func (o *UpdateMTOServiceItemStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status unauthorized response +func (o *UpdateMTOServiceItemStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusForbiddenCode is the HTTP code returned for type UpdateMTOServiceItemStatusForbidden +const UpdateMTOServiceItemStatusForbiddenCode int = 403 + +/* +UpdateMTOServiceItemStatusForbidden The request was denied. + +swagger:response updateMTOServiceItemStatusForbidden +*/ +type UpdateMTOServiceItemStatusForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusForbidden creates UpdateMTOServiceItemStatusForbidden with default headers values +func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { + + return &UpdateMTOServiceItemStatusForbidden{} +} + +// WithPayload adds the payload to the update m t o service item status forbidden response +func (o *UpdateMTOServiceItemStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status forbidden response +func (o *UpdateMTOServiceItemStatusForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusNotFoundCode is the HTTP code returned for type UpdateMTOServiceItemStatusNotFound +const UpdateMTOServiceItemStatusNotFoundCode int = 404 + +/* +UpdateMTOServiceItemStatusNotFound The requested resource wasn't found. + +swagger:response updateMTOServiceItemStatusNotFound +*/ +type UpdateMTOServiceItemStatusNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusNotFound creates UpdateMTOServiceItemStatusNotFound with default headers values +func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { + + return &UpdateMTOServiceItemStatusNotFound{} +} + +// WithPayload adds the payload to the update m t o service item status not found response +func (o *UpdateMTOServiceItemStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status not found response +func (o *UpdateMTOServiceItemStatusNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusConflictCode is the HTTP code returned for type UpdateMTOServiceItemStatusConflict +const UpdateMTOServiceItemStatusConflictCode int = 409 + +/* +UpdateMTOServiceItemStatusConflict There was a conflict with the request. + +swagger:response updateMTOServiceItemStatusConflict +*/ +type UpdateMTOServiceItemStatusConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusConflict creates UpdateMTOServiceItemStatusConflict with default headers values +func NewUpdateMTOServiceItemStatusConflict() *UpdateMTOServiceItemStatusConflict { + + return &UpdateMTOServiceItemStatusConflict{} +} + +// WithPayload adds the payload to the update m t o service item status conflict response +func (o *UpdateMTOServiceItemStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status conflict response +func (o *UpdateMTOServiceItemStatusConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOServiceItemStatusPreconditionFailed +const UpdateMTOServiceItemStatusPreconditionFailedCode int = 412 + +/* +UpdateMTOServiceItemStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOServiceItemStatusPreconditionFailed +*/ +type UpdateMTOServiceItemStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusPreconditionFailed creates UpdateMTOServiceItemStatusPreconditionFailed with default headers values +func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { + + return &UpdateMTOServiceItemStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o service item status precondition failed response +func (o *UpdateMTOServiceItemStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdateMTOServiceItemStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status precondition failed response +func (o *UpdateMTOServiceItemStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOServiceItemStatusUnprocessableEntity +const UpdateMTOServiceItemStatusUnprocessableEntityCode int = 422 + +/* +UpdateMTOServiceItemStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOServiceItemStatusUnprocessableEntity +*/ +type UpdateMTOServiceItemStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusUnprocessableEntity creates UpdateMTOServiceItemStatusUnprocessableEntity with default headers values +func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { + + return &UpdateMTOServiceItemStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o service item status unprocessable entity response +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdateMTOServiceItemStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status unprocessable entity response +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOServiceItemStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOServiceItemStatusInternalServerError +const UpdateMTOServiceItemStatusInternalServerErrorCode int = 500 + +/* +UpdateMTOServiceItemStatusInternalServerError A server error occurred. + +swagger:response updateMTOServiceItemStatusInternalServerError +*/ +type UpdateMTOServiceItemStatusInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOServiceItemStatusInternalServerError creates UpdateMTOServiceItemStatusInternalServerError with default headers values +func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { + + return &UpdateMTOServiceItemStatusInternalServerError{} +} + +// WithPayload adds the payload to the update m t o service item status internal server error response +func (o *UpdateMTOServiceItemStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdateMTOServiceItemStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o service item status internal server error response +func (o *UpdateMTOServiceItemStatusInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOServiceItemStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go new file mode 100644 index 00000000000..c9255587b06 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_service_item/update_m_t_o_service_item_status_urlbuilder.go @@ -0,0 +1,99 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" +) + +// UpdateMTOServiceItemStatusURL generates an URL for the update m t o service item status operation +type UpdateMTOServiceItemStatusURL struct { + MtoServiceItemID string + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemStatusURL) WithBasePath(bp string) *UpdateMTOServiceItemStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOServiceItemStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOServiceItemStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-service-items/{mtoServiceItemID}/status" + + mtoServiceItemID := o.MtoServiceItemID + if mtoServiceItemID != "" { + _path = strings.Replace(_path, "{mtoServiceItemID}", mtoServiceItemID, -1) + } else { + return nil, errors.New("mtoServiceItemId is required on UpdateMTOServiceItemStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOServiceItemStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOServiceItemStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOServiceItemStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOServiceItemStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOServiceItemStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOServiceItemStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..b99cc684796 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdateMTOShipmentStatusHandlerFunc turns a function with the right signature into a update m t o shipment status handler +type UpdateMTOShipmentStatusHandlerFunc func(UpdateMTOShipmentStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdateMTOShipmentStatusHandlerFunc) Handle(params UpdateMTOShipmentStatusParams) middleware.Responder { + return fn(params) +} + +// UpdateMTOShipmentStatusHandler interface for that can handle valid update m t o shipment status params +type UpdateMTOShipmentStatusHandler interface { + Handle(UpdateMTOShipmentStatusParams) middleware.Responder +} + +// NewUpdateMTOShipmentStatus creates a new http.Handler for the update m t o shipment status operation +func NewUpdateMTOShipmentStatus(ctx *middleware.Context, handler UpdateMTOShipmentStatusHandler) *UpdateMTOShipmentStatus { + return &UpdateMTOShipmentStatus{Context: ctx, Handler: handler} +} + +/* + UpdateMTOShipmentStatus swagger:route PATCH /mto-shipments/{mtoShipmentID}/status mtoShipment updateMTOShipmentStatus + +updateMTOShipmentStatus + +Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, `rejectionReason` should be blank and any value passed through the body will be ignored. If REJECTED, a value in `rejectionReason` is required.

This is a support endpoint and will not be available in production. +*/ +type UpdateMTOShipmentStatus struct { + Context *middleware.Context + Handler UpdateMTOShipmentStatusHandler +} + +func (o *UpdateMTOShipmentStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdateMTOShipmentStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go new file mode 100644 index 00000000000..730d906a24d --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object +// +// There are no default values defined in the spec. +func NewUpdateMTOShipmentStatusParams() UpdateMTOShipmentStatusParams { + + return UpdateMTOShipmentStatusParams{} +} + +// UpdateMTOShipmentStatusParams contains all the bound params for the update m t o shipment status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updateMTOShipmentStatus +type UpdateMTOShipmentStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *supportmessages.UpdateMTOShipmentStatus + /*UUID of the shipment being updated. + Required: true + In: path + */ + MtoShipmentID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdateMTOShipmentStatusParams() beforehand. +func (o *UpdateMTOShipmentStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.UpdateMTOShipmentStatus + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rMtoShipmentID, rhkMtoShipmentID, _ := route.Params.GetOK("mtoShipmentID") + if err := o.bindMtoShipmentID(rMtoShipmentID, rhkMtoShipmentID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdateMTOShipmentStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindMtoShipmentID binds and validates parameter MtoShipmentID from path. +func (o *UpdateMTOShipmentStatusParams) bindMtoShipmentID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("mtoShipmentID", "path", "strfmt.UUID", raw) + } + o.MtoShipmentID = *(value.(*strfmt.UUID)) + + if err := o.validateMtoShipmentID(formats); err != nil { + return err + } + + return nil +} + +// validateMtoShipmentID carries on validations for parameter MtoShipmentID +func (o *UpdateMTOShipmentStatusParams) validateMtoShipmentID(formats strfmt.Registry) error { + + if err := validate.FormatOf("mtoShipmentID", "path", "uuid", o.MtoShipmentID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go new file mode 100644 index 00000000000..8fb69fb0fdd --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdateMTOShipmentStatusOKCode is the HTTP code returned for type UpdateMTOShipmentStatusOK +const UpdateMTOShipmentStatusOKCode int = 200 + +/* +UpdateMTOShipmentStatusOK Successfully updated the shipment's status. + +swagger:response updateMTOShipmentStatusOK +*/ +type UpdateMTOShipmentStatusOK struct { + + /* + In: Body + */ + Payload *supportmessages.MTOShipment `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusOK creates UpdateMTOShipmentStatusOK with default headers values +func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { + + return &UpdateMTOShipmentStatusOK{} +} + +// WithPayload adds the payload to the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) WithPayload(payload *supportmessages.MTOShipment) *UpdateMTOShipmentStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) SetPayload(payload *supportmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusBadRequestCode is the HTTP code returned for type UpdateMTOShipmentStatusBadRequest +const UpdateMTOShipmentStatusBadRequestCode int = 400 + +/* +UpdateMTOShipmentStatusBadRequest The request payload is invalid. + +swagger:response updateMTOShipmentStatusBadRequest +*/ +type UpdateMTOShipmentStatusBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusBadRequest creates UpdateMTOShipmentStatusBadRequest with default headers values +func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { + + return &UpdateMTOShipmentStatusBadRequest{} +} + +// WithPayload adds the payload to the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusUnauthorizedCode is the HTTP code returned for type UpdateMTOShipmentStatusUnauthorized +const UpdateMTOShipmentStatusUnauthorizedCode int = 401 + +/* +UpdateMTOShipmentStatusUnauthorized The request was denied. + +swagger:response updateMTOShipmentStatusUnauthorized +*/ +type UpdateMTOShipmentStatusUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusUnauthorized creates UpdateMTOShipmentStatusUnauthorized with default headers values +func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { + + return &UpdateMTOShipmentStatusUnauthorized{} +} + +// WithPayload adds the payload to the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusForbiddenCode is the HTTP code returned for type UpdateMTOShipmentStatusForbidden +const UpdateMTOShipmentStatusForbiddenCode int = 403 + +/* +UpdateMTOShipmentStatusForbidden The request was denied. + +swagger:response updateMTOShipmentStatusForbidden +*/ +type UpdateMTOShipmentStatusForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusForbidden creates UpdateMTOShipmentStatusForbidden with default headers values +func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { + + return &UpdateMTOShipmentStatusForbidden{} +} + +// WithPayload adds the payload to the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusNotFoundCode is the HTTP code returned for type UpdateMTOShipmentStatusNotFound +const UpdateMTOShipmentStatusNotFoundCode int = 404 + +/* +UpdateMTOShipmentStatusNotFound The requested resource wasn't found. + +swagger:response updateMTOShipmentStatusNotFound +*/ +type UpdateMTOShipmentStatusNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusNotFound creates UpdateMTOShipmentStatusNotFound with default headers values +func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { + + return &UpdateMTOShipmentStatusNotFound{} +} + +// WithPayload adds the payload to the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusConflictCode is the HTTP code returned for type UpdateMTOShipmentStatusConflict +const UpdateMTOShipmentStatusConflictCode int = 409 + +/* +UpdateMTOShipmentStatusConflict There was a conflict with the request. + +swagger:response updateMTOShipmentStatusConflict +*/ +type UpdateMTOShipmentStatusConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusConflict creates UpdateMTOShipmentStatusConflict with default headers values +func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { + + return &UpdateMTOShipmentStatusConflict{} +} + +// WithPayload adds the payload to the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusPreconditionFailedCode is the HTTP code returned for type UpdateMTOShipmentStatusPreconditionFailed +const UpdateMTOShipmentStatusPreconditionFailedCode int = 412 + +/* +UpdateMTOShipmentStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updateMTOShipmentStatusPreconditionFailed +*/ +type UpdateMTOShipmentStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusPreconditionFailed creates UpdateMTOShipmentStatusPreconditionFailed with default headers values +func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { + + return &UpdateMTOShipmentStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdateMTOShipmentStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusUnprocessableEntityCode is the HTTP code returned for type UpdateMTOShipmentStatusUnprocessableEntity +const UpdateMTOShipmentStatusUnprocessableEntityCode int = 422 + +/* +UpdateMTOShipmentStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updateMTOShipmentStatusUnprocessableEntity +*/ +type UpdateMTOShipmentStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusUnprocessableEntity creates UpdateMTOShipmentStatusUnprocessableEntity with default headers values +func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { + + return &UpdateMTOShipmentStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdateMTOShipmentStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdateMTOShipmentStatusInternalServerErrorCode is the HTTP code returned for type UpdateMTOShipmentStatusInternalServerError +const UpdateMTOShipmentStatusInternalServerErrorCode int = 500 + +/* +UpdateMTOShipmentStatusInternalServerError A server error occurred. + +swagger:response updateMTOShipmentStatusInternalServerError +*/ +type UpdateMTOShipmentStatusInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewUpdateMTOShipmentStatusInternalServerError creates UpdateMTOShipmentStatusInternalServerError with default headers values +func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { + + return &UpdateMTOShipmentStatusInternalServerError{} +} + +// WithPayload adds the payload to the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdateMTOShipmentStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdateMTOShipmentStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go new file mode 100644 index 00000000000..6637961762f --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mto_shipment/update_m_t_o_shipment_status_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdateMTOShipmentStatusURL generates an URL for the update m t o shipment status operation +type UpdateMTOShipmentStatusURL struct { + MtoShipmentID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentStatusURL) WithBasePath(bp string) *UpdateMTOShipmentStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdateMTOShipmentStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdateMTOShipmentStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/mto-shipments/{mtoShipmentID}/status" + + mtoShipmentID := o.MtoShipmentID.String() + if mtoShipmentID != "" { + _path = strings.Replace(_path, "{mtoShipmentID}", mtoShipmentID, -1) + } else { + return nil, errors.New("mtoShipmentId is required on UpdateMTOShipmentStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdateMTOShipmentStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdateMTOShipmentStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdateMTOShipmentStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdateMTOShipmentStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdateMTOShipmentStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdateMTOShipmentStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/mymove_api.go b/pkg/gen/supportapi/supportoperations/mymove_api.go new file mode 100644 index 00000000000..7a9a7b04e5b --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/mymove_api.go @@ -0,0 +1,469 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportoperations + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + "net/http" + "strings" + + "github.com/go-openapi/errors" + "github.com/go-openapi/loads" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/runtime/security" + "github.com/go-openapi/spec" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/move_task_order" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_service_item" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/mto_shipment" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/payment_request" + "github.com/transcom/mymove/pkg/gen/supportapi/supportoperations/webhook" +) + +// NewMymoveAPI creates a new Mymove instance +func NewMymoveAPI(spec *loads.Document) *MymoveAPI { + return &MymoveAPI{ + handlers: make(map[string]map[string]http.Handler), + formats: strfmt.Default, + defaultConsumes: "application/json", + defaultProduces: "application/json", + customConsumers: make(map[string]runtime.Consumer), + customProducers: make(map[string]runtime.Producer), + PreServerShutdown: func() {}, + ServerShutdown: func() {}, + spec: spec, + useSwaggerUI: false, + ServeError: errors.ServeError, + BasicAuthenticator: security.BasicAuth, + APIKeyAuthenticator: security.APIKeyAuth, + BearerAuthenticator: security.BearerAuth, + + JSONConsumer: runtime.JSONConsumer(), + + JSONProducer: runtime.JSONProducer(), + + MoveTaskOrderCreateMoveTaskOrderHandler: move_task_order.CreateMoveTaskOrderHandlerFunc(func(params move_task_order.CreateMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.CreateMoveTaskOrder has not yet been implemented") + }), + WebhookCreateWebhookNotificationHandler: webhook.CreateWebhookNotificationHandlerFunc(func(params webhook.CreateWebhookNotificationParams) middleware.Responder { + return middleware.NotImplemented("operation webhook.CreateWebhookNotification has not yet been implemented") + }), + MoveTaskOrderGetMoveTaskOrderHandler: move_task_order.GetMoveTaskOrderHandlerFunc(func(params move_task_order.GetMoveTaskOrderParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.GetMoveTaskOrder has not yet been implemented") + }), + PaymentRequestGetPaymentRequestEDIHandler: payment_request.GetPaymentRequestEDIHandlerFunc(func(params payment_request.GetPaymentRequestEDIParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.GetPaymentRequestEDI has not yet been implemented") + }), + MoveTaskOrderHideNonFakeMoveTaskOrdersHandler: move_task_order.HideNonFakeMoveTaskOrdersHandlerFunc(func(params move_task_order.HideNonFakeMoveTaskOrdersParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.HideNonFakeMoveTaskOrders has not yet been implemented") + }), + PaymentRequestListMTOPaymentRequestsHandler: payment_request.ListMTOPaymentRequestsHandlerFunc(func(params payment_request.ListMTOPaymentRequestsParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.ListMTOPaymentRequests has not yet been implemented") + }), + MoveTaskOrderListMTOsHandler: move_task_order.ListMTOsHandlerFunc(func(params move_task_order.ListMTOsParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.ListMTOs has not yet been implemented") + }), + MoveTaskOrderMakeMoveTaskOrderAvailableHandler: move_task_order.MakeMoveTaskOrderAvailableHandlerFunc(func(params move_task_order.MakeMoveTaskOrderAvailableParams) middleware.Responder { + return middleware.NotImplemented("operation move_task_order.MakeMoveTaskOrderAvailable has not yet been implemented") + }), + PaymentRequestProcessReviewedPaymentRequestsHandler: payment_request.ProcessReviewedPaymentRequestsHandlerFunc(func(params payment_request.ProcessReviewedPaymentRequestsParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.ProcessReviewedPaymentRequests has not yet been implemented") + }), + PaymentRequestRecalculatePaymentRequestHandler: payment_request.RecalculatePaymentRequestHandlerFunc(func(params payment_request.RecalculatePaymentRequestParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.RecalculatePaymentRequest has not yet been implemented") + }), + WebhookReceiveWebhookNotificationHandler: webhook.ReceiveWebhookNotificationHandlerFunc(func(params webhook.ReceiveWebhookNotificationParams) middleware.Responder { + return middleware.NotImplemented("operation webhook.ReceiveWebhookNotification has not yet been implemented") + }), + MtoServiceItemUpdateMTOServiceItemStatusHandler: mto_service_item.UpdateMTOServiceItemStatusHandlerFunc(func(params mto_service_item.UpdateMTOServiceItemStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_service_item.UpdateMTOServiceItemStatus has not yet been implemented") + }), + MtoShipmentUpdateMTOShipmentStatusHandler: mto_shipment.UpdateMTOShipmentStatusHandlerFunc(func(params mto_shipment.UpdateMTOShipmentStatusParams) middleware.Responder { + return middleware.NotImplemented("operation mto_shipment.UpdateMTOShipmentStatus has not yet been implemented") + }), + PaymentRequestUpdatePaymentRequestStatusHandler: payment_request.UpdatePaymentRequestStatusHandlerFunc(func(params payment_request.UpdatePaymentRequestStatusParams) middleware.Responder { + return middleware.NotImplemented("operation payment_request.UpdatePaymentRequestStatus has not yet been implemented") + }), + } +} + +/* +MymoveAPI The Support API gives you programmatic access to support functionality useful +for testing and debugging. **This API is not available in the Production +environment**. + +All endpoints are located at `/support/v1/`. +*/ +type MymoveAPI struct { + spec *loads.Document + context *middleware.Context + handlers map[string]map[string]http.Handler + formats strfmt.Registry + customConsumers map[string]runtime.Consumer + customProducers map[string]runtime.Producer + defaultConsumes string + defaultProduces string + Middleware func(middleware.Builder) http.Handler + useSwaggerUI bool + + // BasicAuthenticator generates a runtime.Authenticator from the supplied basic auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BasicAuthenticator func(security.UserPassAuthentication) runtime.Authenticator + + // APIKeyAuthenticator generates a runtime.Authenticator from the supplied token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + APIKeyAuthenticator func(string, string, security.TokenAuthentication) runtime.Authenticator + + // BearerAuthenticator generates a runtime.Authenticator from the supplied bearer token auth function. + // It has a default implementation in the security package, however you can replace it for your particular usage. + BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator + + // JSONConsumer registers a consumer for the following mime types: + // - application/json + JSONConsumer runtime.Consumer + + // JSONProducer registers a producer for the following mime types: + // - application/json + JSONProducer runtime.Producer + + // MoveTaskOrderCreateMoveTaskOrderHandler sets the operation handler for the create move task order operation + MoveTaskOrderCreateMoveTaskOrderHandler move_task_order.CreateMoveTaskOrderHandler + // WebhookCreateWebhookNotificationHandler sets the operation handler for the create webhook notification operation + WebhookCreateWebhookNotificationHandler webhook.CreateWebhookNotificationHandler + // MoveTaskOrderGetMoveTaskOrderHandler sets the operation handler for the get move task order operation + MoveTaskOrderGetMoveTaskOrderHandler move_task_order.GetMoveTaskOrderHandler + // PaymentRequestGetPaymentRequestEDIHandler sets the operation handler for the get payment request e d i operation + PaymentRequestGetPaymentRequestEDIHandler payment_request.GetPaymentRequestEDIHandler + // MoveTaskOrderHideNonFakeMoveTaskOrdersHandler sets the operation handler for the hide non fake move task orders operation + MoveTaskOrderHideNonFakeMoveTaskOrdersHandler move_task_order.HideNonFakeMoveTaskOrdersHandler + // PaymentRequestListMTOPaymentRequestsHandler sets the operation handler for the list m t o payment requests operation + PaymentRequestListMTOPaymentRequestsHandler payment_request.ListMTOPaymentRequestsHandler + // MoveTaskOrderListMTOsHandler sets the operation handler for the list m t os operation + MoveTaskOrderListMTOsHandler move_task_order.ListMTOsHandler + // MoveTaskOrderMakeMoveTaskOrderAvailableHandler sets the operation handler for the make move task order available operation + MoveTaskOrderMakeMoveTaskOrderAvailableHandler move_task_order.MakeMoveTaskOrderAvailableHandler + // PaymentRequestProcessReviewedPaymentRequestsHandler sets the operation handler for the process reviewed payment requests operation + PaymentRequestProcessReviewedPaymentRequestsHandler payment_request.ProcessReviewedPaymentRequestsHandler + // PaymentRequestRecalculatePaymentRequestHandler sets the operation handler for the recalculate payment request operation + PaymentRequestRecalculatePaymentRequestHandler payment_request.RecalculatePaymentRequestHandler + // WebhookReceiveWebhookNotificationHandler sets the operation handler for the receive webhook notification operation + WebhookReceiveWebhookNotificationHandler webhook.ReceiveWebhookNotificationHandler + // MtoServiceItemUpdateMTOServiceItemStatusHandler sets the operation handler for the update m t o service item status operation + MtoServiceItemUpdateMTOServiceItemStatusHandler mto_service_item.UpdateMTOServiceItemStatusHandler + // MtoShipmentUpdateMTOShipmentStatusHandler sets the operation handler for the update m t o shipment status operation + MtoShipmentUpdateMTOShipmentStatusHandler mto_shipment.UpdateMTOShipmentStatusHandler + // PaymentRequestUpdatePaymentRequestStatusHandler sets the operation handler for the update payment request status operation + PaymentRequestUpdatePaymentRequestStatusHandler payment_request.UpdatePaymentRequestStatusHandler + + // ServeError is called when an error is received, there is a default handler + // but you can set your own with this + ServeError func(http.ResponseWriter, *http.Request, error) + + // PreServerShutdown is called before the HTTP(S) server is shutdown + // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic + PreServerShutdown func() + + // ServerShutdown is called when the HTTP(S) server is shut down and done + // handling all active connections and does not accept connections any more + ServerShutdown func() + + // Custom command line argument groups with their descriptions + CommandLineOptionsGroups []swag.CommandLineOptionsGroup + + // User defined logger function. + Logger func(string, ...interface{}) +} + +// UseRedoc for documentation at /docs +func (o *MymoveAPI) UseRedoc() { + o.useSwaggerUI = false +} + +// UseSwaggerUI for documentation at /docs +func (o *MymoveAPI) UseSwaggerUI() { + o.useSwaggerUI = true +} + +// SetDefaultProduces sets the default produces media type +func (o *MymoveAPI) SetDefaultProduces(mediaType string) { + o.defaultProduces = mediaType +} + +// SetDefaultConsumes returns the default consumes media type +func (o *MymoveAPI) SetDefaultConsumes(mediaType string) { + o.defaultConsumes = mediaType +} + +// SetSpec sets a spec that will be served for the clients. +func (o *MymoveAPI) SetSpec(spec *loads.Document) { + o.spec = spec +} + +// DefaultProduces returns the default produces media type +func (o *MymoveAPI) DefaultProduces() string { + return o.defaultProduces +} + +// DefaultConsumes returns the default consumes media type +func (o *MymoveAPI) DefaultConsumes() string { + return o.defaultConsumes +} + +// Formats returns the registered string formats +func (o *MymoveAPI) Formats() strfmt.Registry { + return o.formats +} + +// RegisterFormat registers a custom format validator +func (o *MymoveAPI) RegisterFormat(name string, format strfmt.Format, validator strfmt.Validator) { + o.formats.Add(name, format, validator) +} + +// Validate validates the registrations in the MymoveAPI +func (o *MymoveAPI) Validate() error { + var unregistered []string + + if o.JSONConsumer == nil { + unregistered = append(unregistered, "JSONConsumer") + } + + if o.JSONProducer == nil { + unregistered = append(unregistered, "JSONProducer") + } + + if o.MoveTaskOrderCreateMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.CreateMoveTaskOrderHandler") + } + if o.WebhookCreateWebhookNotificationHandler == nil { + unregistered = append(unregistered, "webhook.CreateWebhookNotificationHandler") + } + if o.MoveTaskOrderGetMoveTaskOrderHandler == nil { + unregistered = append(unregistered, "move_task_order.GetMoveTaskOrderHandler") + } + if o.PaymentRequestGetPaymentRequestEDIHandler == nil { + unregistered = append(unregistered, "payment_request.GetPaymentRequestEDIHandler") + } + if o.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler == nil { + unregistered = append(unregistered, "move_task_order.HideNonFakeMoveTaskOrdersHandler") + } + if o.PaymentRequestListMTOPaymentRequestsHandler == nil { + unregistered = append(unregistered, "payment_request.ListMTOPaymentRequestsHandler") + } + if o.MoveTaskOrderListMTOsHandler == nil { + unregistered = append(unregistered, "move_task_order.ListMTOsHandler") + } + if o.MoveTaskOrderMakeMoveTaskOrderAvailableHandler == nil { + unregistered = append(unregistered, "move_task_order.MakeMoveTaskOrderAvailableHandler") + } + if o.PaymentRequestProcessReviewedPaymentRequestsHandler == nil { + unregistered = append(unregistered, "payment_request.ProcessReviewedPaymentRequestsHandler") + } + if o.PaymentRequestRecalculatePaymentRequestHandler == nil { + unregistered = append(unregistered, "payment_request.RecalculatePaymentRequestHandler") + } + if o.WebhookReceiveWebhookNotificationHandler == nil { + unregistered = append(unregistered, "webhook.ReceiveWebhookNotificationHandler") + } + if o.MtoServiceItemUpdateMTOServiceItemStatusHandler == nil { + unregistered = append(unregistered, "mto_service_item.UpdateMTOServiceItemStatusHandler") + } + if o.MtoShipmentUpdateMTOShipmentStatusHandler == nil { + unregistered = append(unregistered, "mto_shipment.UpdateMTOShipmentStatusHandler") + } + if o.PaymentRequestUpdatePaymentRequestStatusHandler == nil { + unregistered = append(unregistered, "payment_request.UpdatePaymentRequestStatusHandler") + } + + if len(unregistered) > 0 { + return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", ")) + } + + return nil +} + +// ServeErrorFor gets a error handler for a given operation id +func (o *MymoveAPI) ServeErrorFor(operationID string) func(http.ResponseWriter, *http.Request, error) { + return o.ServeError +} + +// AuthenticatorsFor gets the authenticators for the specified security schemes +func (o *MymoveAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator { + return nil +} + +// Authorizer returns the registered authorizer +func (o *MymoveAPI) Authorizer() runtime.Authorizer { + return nil +} + +// ConsumersFor gets the consumers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer { + result := make(map[string]runtime.Consumer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONConsumer + } + + if c, ok := o.customConsumers[mt]; ok { + result[mt] = c + } + } + return result +} + +// ProducersFor gets the producers for the specified media types. +// MIME type parameters are ignored here. +func (o *MymoveAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer { + result := make(map[string]runtime.Producer, len(mediaTypes)) + for _, mt := range mediaTypes { + switch mt { + case "application/json": + result["application/json"] = o.JSONProducer + } + + if p, ok := o.customProducers[mt]; ok { + result[mt] = p + } + } + return result +} + +// HandlerFor gets a http.Handler for the provided operation method and path +func (o *MymoveAPI) HandlerFor(method, path string) (http.Handler, bool) { + if o.handlers == nil { + return nil, false + } + um := strings.ToUpper(method) + if _, ok := o.handlers[um]; !ok { + return nil, false + } + if path == "/" { + path = "" + } + h, ok := o.handlers[um][path] + return h, ok +} + +// Context returns the middleware context for the mymove API +func (o *MymoveAPI) Context() *middleware.Context { + if o.context == nil { + o.context = middleware.NewRoutableContext(o.spec, o, nil) + } + + return o.context +} + +func (o *MymoveAPI) initHandlerCache() { + o.Context() // don't care about the result, just that the initialization happened + if o.handlers == nil { + o.handlers = make(map[string]map[string]http.Handler) + } + + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/move-task-orders"] = move_task_order.NewCreateMoveTaskOrder(o.context, o.MoveTaskOrderCreateMoveTaskOrderHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/webhook-notifications"] = webhook.NewCreateWebhookNotification(o.context, o.WebhookCreateWebhookNotificationHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}"] = move_task_order.NewGetMoveTaskOrder(o.context, o.MoveTaskOrderGetMoveTaskOrderHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/payment-requests/{paymentRequestID}/edi"] = payment_request.NewGetPaymentRequestEDI(o.context, o.PaymentRequestGetPaymentRequestEDIHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/hide"] = move_task_order.NewHideNonFakeMoveTaskOrders(o.context, o.MoveTaskOrderHideNonFakeMoveTaskOrdersHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders/{moveTaskOrderID}/payment-requests"] = payment_request.NewListMTOPaymentRequests(o.context, o.PaymentRequestListMTOPaymentRequestsHandler) + if o.handlers["GET"] == nil { + o.handlers["GET"] = make(map[string]http.Handler) + } + o.handlers["GET"]["/move-task-orders"] = move_task_order.NewListMTOs(o.context, o.MoveTaskOrderListMTOsHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/move-task-orders/{moveTaskOrderID}/available-to-prime"] = move_task_order.NewMakeMoveTaskOrderAvailable(o.context, o.MoveTaskOrderMakeMoveTaskOrderAvailableHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/payment-requests/process-reviewed"] = payment_request.NewProcessReviewedPaymentRequests(o.context, o.PaymentRequestProcessReviewedPaymentRequestsHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/payment-requests/{paymentRequestID}/recalculate"] = payment_request.NewRecalculatePaymentRequest(o.context, o.PaymentRequestRecalculatePaymentRequestHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } + o.handlers["POST"]["/webhook-notify"] = webhook.NewReceiveWebhookNotification(o.context, o.WebhookReceiveWebhookNotificationHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-service-items/{mtoServiceItemID}/status"] = mto_service_item.NewUpdateMTOServiceItemStatus(o.context, o.MtoServiceItemUpdateMTOServiceItemStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/mto-shipments/{mtoShipmentID}/status"] = mto_shipment.NewUpdateMTOShipmentStatus(o.context, o.MtoShipmentUpdateMTOShipmentStatusHandler) + if o.handlers["PATCH"] == nil { + o.handlers["PATCH"] = make(map[string]http.Handler) + } + o.handlers["PATCH"]["/payment-requests/{paymentRequestID}/status"] = payment_request.NewUpdatePaymentRequestStatus(o.context, o.PaymentRequestUpdatePaymentRequestStatusHandler) +} + +// Serve creates a http handler to serve the API over HTTP +// can be used directly in http.ListenAndServe(":8000", api.Serve(nil)) +func (o *MymoveAPI) Serve(builder middleware.Builder) http.Handler { + o.Init() + + if o.Middleware != nil { + return o.Middleware(builder) + } + if o.useSwaggerUI { + return o.context.APIHandlerSwaggerUI(builder) + } + return o.context.APIHandler(builder) +} + +// Init allows you to just initialize the handler cache, you can then recompose the middleware as you see fit +func (o *MymoveAPI) Init() { + if len(o.handlers) == 0 { + o.initHandlerCache() + } +} + +// RegisterConsumer allows you to add (or override) a consumer for a media type. +func (o *MymoveAPI) RegisterConsumer(mediaType string, consumer runtime.Consumer) { + o.customConsumers[mediaType] = consumer +} + +// RegisterProducer allows you to add (or override) a producer for a media type. +func (o *MymoveAPI) RegisterProducer(mediaType string, producer runtime.Producer) { + o.customProducers[mediaType] = producer +} + +// AddMiddlewareFor adds a http middleware to existing handler +func (o *MymoveAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) { + um := strings.ToUpper(method) + if path == "/" { + path = "" + } + o.Init() + if h, ok := o.handlers[um][path]; ok { + o.handlers[um][path] = builder(h) + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go new file mode 100644 index 00000000000..8e6f851556e --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// GetPaymentRequestEDIHandlerFunc turns a function with the right signature into a get payment request e d i handler +type GetPaymentRequestEDIHandlerFunc func(GetPaymentRequestEDIParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn GetPaymentRequestEDIHandlerFunc) Handle(params GetPaymentRequestEDIParams) middleware.Responder { + return fn(params) +} + +// GetPaymentRequestEDIHandler interface for that can handle valid get payment request e d i params +type GetPaymentRequestEDIHandler interface { + Handle(GetPaymentRequestEDIParams) middleware.Responder +} + +// NewGetPaymentRequestEDI creates a new http.Handler for the get payment request e d i operation +func NewGetPaymentRequestEDI(ctx *middleware.Context, handler GetPaymentRequestEDIHandler) *GetPaymentRequestEDI { + return &GetPaymentRequestEDI{Context: ctx, Handler: handler} +} + +/* + GetPaymentRequestEDI swagger:route GET /payment-requests/{paymentRequestID}/edi paymentRequest getPaymentRequestEDI + +getPaymentRequestEDI + +Returns the EDI (Electronic Data Interchange) message for the payment request identified +by the given payment request ID. Note that the EDI returned in the JSON payload will have where there +would normally be line breaks (due to JSON not allowing line breaks in a string). + +This is a support endpoint and will not be available in production. +*/ +type GetPaymentRequestEDI struct { + Context *middleware.Context + Handler GetPaymentRequestEDIHandler +} + +func (o *GetPaymentRequestEDI) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewGetPaymentRequestEDIParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go new file mode 100644 index 00000000000..ee326f2cdea --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewGetPaymentRequestEDIParams creates a new GetPaymentRequestEDIParams object +// +// There are no default values defined in the spec. +func NewGetPaymentRequestEDIParams() GetPaymentRequestEDIParams { + + return GetPaymentRequestEDIParams{} +} + +// GetPaymentRequestEDIParams contains all the bound params for the get payment request e d i operation +// typically these are obtained from a http.Request +// +// swagger:parameters getPaymentRequestEDI +type GetPaymentRequestEDIParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the payment request for which EDI should be generated. + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewGetPaymentRequestEDIParams() beforehand. +func (o *GetPaymentRequestEDIParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *GetPaymentRequestEDIParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *GetPaymentRequestEDIParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go new file mode 100644 index 00000000000..28033983281 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_responses.go @@ -0,0 +1,374 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// GetPaymentRequestEDIOKCode is the HTTP code returned for type GetPaymentRequestEDIOK +const GetPaymentRequestEDIOKCode int = 200 + +/* +GetPaymentRequestEDIOK Successfully retrieved payment requests associated with a given move task order + +swagger:response getPaymentRequestEDIOK +*/ +type GetPaymentRequestEDIOK struct { + + /* + In: Body + */ + Payload *supportmessages.PaymentRequestEDI `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIOK creates GetPaymentRequestEDIOK with default headers values +func NewGetPaymentRequestEDIOK() *GetPaymentRequestEDIOK { + + return &GetPaymentRequestEDIOK{} +} + +// WithPayload adds the payload to the get payment request e d i o k response +func (o *GetPaymentRequestEDIOK) WithPayload(payload *supportmessages.PaymentRequestEDI) *GetPaymentRequestEDIOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i o k response +func (o *GetPaymentRequestEDIOK) SetPayload(payload *supportmessages.PaymentRequestEDI) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIBadRequestCode is the HTTP code returned for type GetPaymentRequestEDIBadRequest +const GetPaymentRequestEDIBadRequestCode int = 400 + +/* +GetPaymentRequestEDIBadRequest The request payload is invalid. + +swagger:response getPaymentRequestEDIBadRequest +*/ +type GetPaymentRequestEDIBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIBadRequest creates GetPaymentRequestEDIBadRequest with default headers values +func NewGetPaymentRequestEDIBadRequest() *GetPaymentRequestEDIBadRequest { + + return &GetPaymentRequestEDIBadRequest{} +} + +// WithPayload adds the payload to the get payment request e d i bad request response +func (o *GetPaymentRequestEDIBadRequest) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i bad request response +func (o *GetPaymentRequestEDIBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIUnauthorizedCode is the HTTP code returned for type GetPaymentRequestEDIUnauthorized +const GetPaymentRequestEDIUnauthorizedCode int = 401 + +/* +GetPaymentRequestEDIUnauthorized The request was denied. + +swagger:response getPaymentRequestEDIUnauthorized +*/ +type GetPaymentRequestEDIUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIUnauthorized creates GetPaymentRequestEDIUnauthorized with default headers values +func NewGetPaymentRequestEDIUnauthorized() *GetPaymentRequestEDIUnauthorized { + + return &GetPaymentRequestEDIUnauthorized{} +} + +// WithPayload adds the payload to the get payment request e d i unauthorized response +func (o *GetPaymentRequestEDIUnauthorized) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i unauthorized response +func (o *GetPaymentRequestEDIUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIForbiddenCode is the HTTP code returned for type GetPaymentRequestEDIForbidden +const GetPaymentRequestEDIForbiddenCode int = 403 + +/* +GetPaymentRequestEDIForbidden The request was denied. + +swagger:response getPaymentRequestEDIForbidden +*/ +type GetPaymentRequestEDIForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIForbidden creates GetPaymentRequestEDIForbidden with default headers values +func NewGetPaymentRequestEDIForbidden() *GetPaymentRequestEDIForbidden { + + return &GetPaymentRequestEDIForbidden{} +} + +// WithPayload adds the payload to the get payment request e d i forbidden response +func (o *GetPaymentRequestEDIForbidden) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i forbidden response +func (o *GetPaymentRequestEDIForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDINotFoundCode is the HTTP code returned for type GetPaymentRequestEDINotFound +const GetPaymentRequestEDINotFoundCode int = 404 + +/* +GetPaymentRequestEDINotFound The requested resource wasn't found. + +swagger:response getPaymentRequestEDINotFound +*/ +type GetPaymentRequestEDINotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDINotFound creates GetPaymentRequestEDINotFound with default headers values +func NewGetPaymentRequestEDINotFound() *GetPaymentRequestEDINotFound { + + return &GetPaymentRequestEDINotFound{} +} + +// WithPayload adds the payload to the get payment request e d i not found response +func (o *GetPaymentRequestEDINotFound) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDINotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i not found response +func (o *GetPaymentRequestEDINotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDINotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIConflictCode is the HTTP code returned for type GetPaymentRequestEDIConflict +const GetPaymentRequestEDIConflictCode int = 409 + +/* +GetPaymentRequestEDIConflict There was a conflict with the request. + +swagger:response getPaymentRequestEDIConflict +*/ +type GetPaymentRequestEDIConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIConflict creates GetPaymentRequestEDIConflict with default headers values +func NewGetPaymentRequestEDIConflict() *GetPaymentRequestEDIConflict { + + return &GetPaymentRequestEDIConflict{} +} + +// WithPayload adds the payload to the get payment request e d i conflict response +func (o *GetPaymentRequestEDIConflict) WithPayload(payload *supportmessages.ClientError) *GetPaymentRequestEDIConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i conflict response +func (o *GetPaymentRequestEDIConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIUnprocessableEntityCode is the HTTP code returned for type GetPaymentRequestEDIUnprocessableEntity +const GetPaymentRequestEDIUnprocessableEntityCode int = 422 + +/* +GetPaymentRequestEDIUnprocessableEntity The payload was unprocessable. + +swagger:response getPaymentRequestEDIUnprocessableEntity +*/ +type GetPaymentRequestEDIUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIUnprocessableEntity creates GetPaymentRequestEDIUnprocessableEntity with default headers values +func NewGetPaymentRequestEDIUnprocessableEntity() *GetPaymentRequestEDIUnprocessableEntity { + + return &GetPaymentRequestEDIUnprocessableEntity{} +} + +// WithPayload adds the payload to the get payment request e d i unprocessable entity response +func (o *GetPaymentRequestEDIUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *GetPaymentRequestEDIUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i unprocessable entity response +func (o *GetPaymentRequestEDIUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// GetPaymentRequestEDIInternalServerErrorCode is the HTTP code returned for type GetPaymentRequestEDIInternalServerError +const GetPaymentRequestEDIInternalServerErrorCode int = 500 + +/* +GetPaymentRequestEDIInternalServerError A server error occurred. + +swagger:response getPaymentRequestEDIInternalServerError +*/ +type GetPaymentRequestEDIInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewGetPaymentRequestEDIInternalServerError creates GetPaymentRequestEDIInternalServerError with default headers values +func NewGetPaymentRequestEDIInternalServerError() *GetPaymentRequestEDIInternalServerError { + + return &GetPaymentRequestEDIInternalServerError{} +} + +// WithPayload adds the payload to the get payment request e d i internal server error response +func (o *GetPaymentRequestEDIInternalServerError) WithPayload(payload *supportmessages.Error) *GetPaymentRequestEDIInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the get payment request e d i internal server error response +func (o *GetPaymentRequestEDIInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *GetPaymentRequestEDIInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go new file mode 100644 index 00000000000..e5c52694d20 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/get_payment_request_e_d_i_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// GetPaymentRequestEDIURL generates an URL for the get payment request e d i operation +type GetPaymentRequestEDIURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestEDIURL) WithBasePath(bp string) *GetPaymentRequestEDIURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *GetPaymentRequestEDIURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *GetPaymentRequestEDIURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/edi" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on GetPaymentRequestEDIURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *GetPaymentRequestEDIURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *GetPaymentRequestEDIURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *GetPaymentRequestEDIURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on GetPaymentRequestEDIURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on GetPaymentRequestEDIURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *GetPaymentRequestEDIURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go new file mode 100644 index 00000000000..8f2990500fb --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ListMTOPaymentRequestsHandlerFunc turns a function with the right signature into a list m t o payment requests handler +type ListMTOPaymentRequestsHandlerFunc func(ListMTOPaymentRequestsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ListMTOPaymentRequestsHandlerFunc) Handle(params ListMTOPaymentRequestsParams) middleware.Responder { + return fn(params) +} + +// ListMTOPaymentRequestsHandler interface for that can handle valid list m t o payment requests params +type ListMTOPaymentRequestsHandler interface { + Handle(ListMTOPaymentRequestsParams) middleware.Responder +} + +// NewListMTOPaymentRequests creates a new http.Handler for the list m t o payment requests operation +func NewListMTOPaymentRequests(ctx *middleware.Context, handler ListMTOPaymentRequestsHandler) *ListMTOPaymentRequests { + return &ListMTOPaymentRequests{Context: ctx, Handler: handler} +} + +/* + ListMTOPaymentRequests swagger:route GET /move-task-orders/{moveTaskOrderID}/payment-requests paymentRequest listMTOPaymentRequests + +listMTOPaymentRequests + +### Functionality + +This endpoint lists all PaymentRequests associated with a given MoveTaskOrder. + +This is a support endpoint and is not available in production. +*/ +type ListMTOPaymentRequests struct { + Context *middleware.Context + Handler ListMTOPaymentRequestsHandler +} + +func (o *ListMTOPaymentRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewListMTOPaymentRequestsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go new file mode 100644 index 00000000000..87340033535 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewListMTOPaymentRequestsParams creates a new ListMTOPaymentRequestsParams object +// +// There are no default values defined in the spec. +func NewListMTOPaymentRequestsParams() ListMTOPaymentRequestsParams { + + return ListMTOPaymentRequestsParams{} +} + +// ListMTOPaymentRequestsParams contains all the bound params for the list m t o payment requests operation +// typically these are obtained from a http.Request +// +// swagger:parameters listMTOPaymentRequests +type ListMTOPaymentRequestsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Only return move task orders updated since this time. + Required: true + In: path + */ + MoveTaskOrderID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewListMTOPaymentRequestsParams() beforehand. +func (o *ListMTOPaymentRequestsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rMoveTaskOrderID, rhkMoveTaskOrderID, _ := route.Params.GetOK("moveTaskOrderID") + if err := o.bindMoveTaskOrderID(rMoveTaskOrderID, rhkMoveTaskOrderID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindMoveTaskOrderID binds and validates parameter MoveTaskOrderID from path. +func (o *ListMTOPaymentRequestsParams) bindMoveTaskOrderID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("moveTaskOrderID", "path", "strfmt.UUID", raw) + } + o.MoveTaskOrderID = *(value.(*strfmt.UUID)) + + if err := o.validateMoveTaskOrderID(formats); err != nil { + return err + } + + return nil +} + +// validateMoveTaskOrderID carries on validations for parameter MoveTaskOrderID +func (o *ListMTOPaymentRequestsParams) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.FormatOf("moveTaskOrderID", "path", "uuid", o.MoveTaskOrderID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go new file mode 100644 index 00000000000..78390d49ed1 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_responses.go @@ -0,0 +1,287 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ListMTOPaymentRequestsOKCode is the HTTP code returned for type ListMTOPaymentRequestsOK +const ListMTOPaymentRequestsOKCode int = 200 + +/* +ListMTOPaymentRequestsOK Successfully retrieved payment requests associated with a given move task order + +swagger:response listMTOPaymentRequestsOK +*/ +type ListMTOPaymentRequestsOK struct { + + /* + In: Body + */ + Payload supportmessages.PaymentRequests `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsOK creates ListMTOPaymentRequestsOK with default headers values +func NewListMTOPaymentRequestsOK() *ListMTOPaymentRequestsOK { + + return &ListMTOPaymentRequestsOK{} +} + +// WithPayload adds the payload to the list m t o payment requests o k response +func (o *ListMTOPaymentRequestsOK) WithPayload(payload supportmessages.PaymentRequests) *ListMTOPaymentRequestsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests o k response +func (o *ListMTOPaymentRequestsOK) SetPayload(payload supportmessages.PaymentRequests) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = supportmessages.PaymentRequests{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ListMTOPaymentRequestsBadRequestCode is the HTTP code returned for type ListMTOPaymentRequestsBadRequest +const ListMTOPaymentRequestsBadRequestCode int = 400 + +/* +ListMTOPaymentRequestsBadRequest The request payload is invalid. + +swagger:response listMTOPaymentRequestsBadRequest +*/ +type ListMTOPaymentRequestsBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsBadRequest creates ListMTOPaymentRequestsBadRequest with default headers values +func NewListMTOPaymentRequestsBadRequest() *ListMTOPaymentRequestsBadRequest { + + return &ListMTOPaymentRequestsBadRequest{} +} + +// WithPayload adds the payload to the list m t o payment requests bad request response +func (o *ListMTOPaymentRequestsBadRequest) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests bad request response +func (o *ListMTOPaymentRequestsBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOPaymentRequestsUnauthorizedCode is the HTTP code returned for type ListMTOPaymentRequestsUnauthorized +const ListMTOPaymentRequestsUnauthorizedCode int = 401 + +/* +ListMTOPaymentRequestsUnauthorized The request was denied. + +swagger:response listMTOPaymentRequestsUnauthorized +*/ +type ListMTOPaymentRequestsUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsUnauthorized creates ListMTOPaymentRequestsUnauthorized with default headers values +func NewListMTOPaymentRequestsUnauthorized() *ListMTOPaymentRequestsUnauthorized { + + return &ListMTOPaymentRequestsUnauthorized{} +} + +// WithPayload adds the payload to the list m t o payment requests unauthorized response +func (o *ListMTOPaymentRequestsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests unauthorized response +func (o *ListMTOPaymentRequestsUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOPaymentRequestsForbiddenCode is the HTTP code returned for type ListMTOPaymentRequestsForbidden +const ListMTOPaymentRequestsForbiddenCode int = 403 + +/* +ListMTOPaymentRequestsForbidden The request was denied. + +swagger:response listMTOPaymentRequestsForbidden +*/ +type ListMTOPaymentRequestsForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsForbidden creates ListMTOPaymentRequestsForbidden with default headers values +func NewListMTOPaymentRequestsForbidden() *ListMTOPaymentRequestsForbidden { + + return &ListMTOPaymentRequestsForbidden{} +} + +// WithPayload adds the payload to the list m t o payment requests forbidden response +func (o *ListMTOPaymentRequestsForbidden) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests forbidden response +func (o *ListMTOPaymentRequestsForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOPaymentRequestsNotFoundCode is the HTTP code returned for type ListMTOPaymentRequestsNotFound +const ListMTOPaymentRequestsNotFoundCode int = 404 + +/* +ListMTOPaymentRequestsNotFound The requested resource wasn't found. + +swagger:response listMTOPaymentRequestsNotFound +*/ +type ListMTOPaymentRequestsNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsNotFound creates ListMTOPaymentRequestsNotFound with default headers values +func NewListMTOPaymentRequestsNotFound() *ListMTOPaymentRequestsNotFound { + + return &ListMTOPaymentRequestsNotFound{} +} + +// WithPayload adds the payload to the list m t o payment requests not found response +func (o *ListMTOPaymentRequestsNotFound) WithPayload(payload *supportmessages.ClientError) *ListMTOPaymentRequestsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests not found response +func (o *ListMTOPaymentRequestsNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ListMTOPaymentRequestsInternalServerErrorCode is the HTTP code returned for type ListMTOPaymentRequestsInternalServerError +const ListMTOPaymentRequestsInternalServerErrorCode int = 500 + +/* +ListMTOPaymentRequestsInternalServerError A server error occurred. + +swagger:response listMTOPaymentRequestsInternalServerError +*/ +type ListMTOPaymentRequestsInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewListMTOPaymentRequestsInternalServerError creates ListMTOPaymentRequestsInternalServerError with default headers values +func NewListMTOPaymentRequestsInternalServerError() *ListMTOPaymentRequestsInternalServerError { + + return &ListMTOPaymentRequestsInternalServerError{} +} + +// WithPayload adds the payload to the list m t o payment requests internal server error response +func (o *ListMTOPaymentRequestsInternalServerError) WithPayload(payload *supportmessages.Error) *ListMTOPaymentRequestsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the list m t o payment requests internal server error response +func (o *ListMTOPaymentRequestsInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ListMTOPaymentRequestsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go new file mode 100644 index 00000000000..f55d63b7339 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/list_m_t_o_payment_requests_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// ListMTOPaymentRequestsURL generates an URL for the list m t o payment requests operation +type ListMTOPaymentRequestsURL struct { + MoveTaskOrderID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOPaymentRequestsURL) WithBasePath(bp string) *ListMTOPaymentRequestsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ListMTOPaymentRequestsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ListMTOPaymentRequestsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/move-task-orders/{moveTaskOrderID}/payment-requests" + + moveTaskOrderID := o.MoveTaskOrderID.String() + if moveTaskOrderID != "" { + _path = strings.Replace(_path, "{moveTaskOrderID}", moveTaskOrderID, -1) + } else { + return nil, errors.New("moveTaskOrderId is required on ListMTOPaymentRequestsURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ListMTOPaymentRequestsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ListMTOPaymentRequestsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ListMTOPaymentRequestsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ListMTOPaymentRequestsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ListMTOPaymentRequestsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ListMTOPaymentRequestsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go new file mode 100644 index 00000000000..efefe2dd1b7 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests.go @@ -0,0 +1,61 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ProcessReviewedPaymentRequestsHandlerFunc turns a function with the right signature into a process reviewed payment requests handler +type ProcessReviewedPaymentRequestsHandlerFunc func(ProcessReviewedPaymentRequestsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ProcessReviewedPaymentRequestsHandlerFunc) Handle(params ProcessReviewedPaymentRequestsParams) middleware.Responder { + return fn(params) +} + +// ProcessReviewedPaymentRequestsHandler interface for that can handle valid process reviewed payment requests params +type ProcessReviewedPaymentRequestsHandler interface { + Handle(ProcessReviewedPaymentRequestsParams) middleware.Responder +} + +// NewProcessReviewedPaymentRequests creates a new http.Handler for the process reviewed payment requests operation +func NewProcessReviewedPaymentRequests(ctx *middleware.Context, handler ProcessReviewedPaymentRequestsHandler) *ProcessReviewedPaymentRequests { + return &ProcessReviewedPaymentRequests{Context: ctx, Handler: handler} +} + +/* + ProcessReviewedPaymentRequests swagger:route PATCH /payment-requests/process-reviewed paymentRequest processReviewedPaymentRequests + +processReviewedPaymentRequests + +Updates the status of reviewed payment requests and sends PRs to Syncada if +the SendToSyncada flag is set + +This is a support endpoint and will not be available in production. +*/ +type ProcessReviewedPaymentRequests struct { + Context *middleware.Context + Handler ProcessReviewedPaymentRequestsHandler +} + +func (o *ProcessReviewedPaymentRequests) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewProcessReviewedPaymentRequestsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go new file mode 100644 index 00000000000..644c93041ee --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewProcessReviewedPaymentRequestsParams creates a new ProcessReviewedPaymentRequestsParams object +// +// There are no default values defined in the spec. +func NewProcessReviewedPaymentRequestsParams() ProcessReviewedPaymentRequestsParams { + + return ProcessReviewedPaymentRequestsParams{} +} + +// ProcessReviewedPaymentRequestsParams contains all the bound params for the process reviewed payment requests operation +// typically these are obtained from a http.Request +// +// swagger:parameters processReviewedPaymentRequests +type ProcessReviewedPaymentRequestsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *supportmessages.ProcessReviewedPaymentRequests +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewProcessReviewedPaymentRequestsParams() beforehand. +func (o *ProcessReviewedPaymentRequestsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.ProcessReviewedPaymentRequests + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go new file mode 100644 index 00000000000..56b1631599a --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_responses.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ProcessReviewedPaymentRequestsOKCode is the HTTP code returned for type ProcessReviewedPaymentRequestsOK +const ProcessReviewedPaymentRequestsOKCode int = 200 + +/* +ProcessReviewedPaymentRequestsOK Successfully updated status of reviewed payment request and sent to Syncada if that flag is set + +swagger:response processReviewedPaymentRequestsOK +*/ +type ProcessReviewedPaymentRequestsOK struct { + + /* + In: Body + */ + Payload supportmessages.PaymentRequests `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsOK creates ProcessReviewedPaymentRequestsOK with default headers values +func NewProcessReviewedPaymentRequestsOK() *ProcessReviewedPaymentRequestsOK { + + return &ProcessReviewedPaymentRequestsOK{} +} + +// WithPayload adds the payload to the process reviewed payment requests o k response +func (o *ProcessReviewedPaymentRequestsOK) WithPayload(payload supportmessages.PaymentRequests) *ProcessReviewedPaymentRequestsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests o k response +func (o *ProcessReviewedPaymentRequestsOK) SetPayload(payload supportmessages.PaymentRequests) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = supportmessages.PaymentRequests{} + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ProcessReviewedPaymentRequestsBadRequestCode is the HTTP code returned for type ProcessReviewedPaymentRequestsBadRequest +const ProcessReviewedPaymentRequestsBadRequestCode int = 400 + +/* +ProcessReviewedPaymentRequestsBadRequest The request payload is invalid. + +swagger:response processReviewedPaymentRequestsBadRequest +*/ +type ProcessReviewedPaymentRequestsBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsBadRequest creates ProcessReviewedPaymentRequestsBadRequest with default headers values +func NewProcessReviewedPaymentRequestsBadRequest() *ProcessReviewedPaymentRequestsBadRequest { + + return &ProcessReviewedPaymentRequestsBadRequest{} +} + +// WithPayload adds the payload to the process reviewed payment requests bad request response +func (o *ProcessReviewedPaymentRequestsBadRequest) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests bad request response +func (o *ProcessReviewedPaymentRequestsBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ProcessReviewedPaymentRequestsUnauthorizedCode is the HTTP code returned for type ProcessReviewedPaymentRequestsUnauthorized +const ProcessReviewedPaymentRequestsUnauthorizedCode int = 401 + +/* +ProcessReviewedPaymentRequestsUnauthorized The request was denied. + +swagger:response processReviewedPaymentRequestsUnauthorized +*/ +type ProcessReviewedPaymentRequestsUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsUnauthorized creates ProcessReviewedPaymentRequestsUnauthorized with default headers values +func NewProcessReviewedPaymentRequestsUnauthorized() *ProcessReviewedPaymentRequestsUnauthorized { + + return &ProcessReviewedPaymentRequestsUnauthorized{} +} + +// WithPayload adds the payload to the process reviewed payment requests unauthorized response +func (o *ProcessReviewedPaymentRequestsUnauthorized) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests unauthorized response +func (o *ProcessReviewedPaymentRequestsUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ProcessReviewedPaymentRequestsForbiddenCode is the HTTP code returned for type ProcessReviewedPaymentRequestsForbidden +const ProcessReviewedPaymentRequestsForbiddenCode int = 403 + +/* +ProcessReviewedPaymentRequestsForbidden The request was denied. + +swagger:response processReviewedPaymentRequestsForbidden +*/ +type ProcessReviewedPaymentRequestsForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsForbidden creates ProcessReviewedPaymentRequestsForbidden with default headers values +func NewProcessReviewedPaymentRequestsForbidden() *ProcessReviewedPaymentRequestsForbidden { + + return &ProcessReviewedPaymentRequestsForbidden{} +} + +// WithPayload adds the payload to the process reviewed payment requests forbidden response +func (o *ProcessReviewedPaymentRequestsForbidden) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests forbidden response +func (o *ProcessReviewedPaymentRequestsForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ProcessReviewedPaymentRequestsNotFoundCode is the HTTP code returned for type ProcessReviewedPaymentRequestsNotFound +const ProcessReviewedPaymentRequestsNotFoundCode int = 404 + +/* +ProcessReviewedPaymentRequestsNotFound The requested resource wasn't found. + +swagger:response processReviewedPaymentRequestsNotFound +*/ +type ProcessReviewedPaymentRequestsNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsNotFound creates ProcessReviewedPaymentRequestsNotFound with default headers values +func NewProcessReviewedPaymentRequestsNotFound() *ProcessReviewedPaymentRequestsNotFound { + + return &ProcessReviewedPaymentRequestsNotFound{} +} + +// WithPayload adds the payload to the process reviewed payment requests not found response +func (o *ProcessReviewedPaymentRequestsNotFound) WithPayload(payload *supportmessages.ClientError) *ProcessReviewedPaymentRequestsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests not found response +func (o *ProcessReviewedPaymentRequestsNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ProcessReviewedPaymentRequestsUnprocessableEntityCode is the HTTP code returned for type ProcessReviewedPaymentRequestsUnprocessableEntity +const ProcessReviewedPaymentRequestsUnprocessableEntityCode int = 422 + +/* +ProcessReviewedPaymentRequestsUnprocessableEntity The payload was unprocessable. + +swagger:response processReviewedPaymentRequestsUnprocessableEntity +*/ +type ProcessReviewedPaymentRequestsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsUnprocessableEntity creates ProcessReviewedPaymentRequestsUnprocessableEntity with default headers values +func NewProcessReviewedPaymentRequestsUnprocessableEntity() *ProcessReviewedPaymentRequestsUnprocessableEntity { + + return &ProcessReviewedPaymentRequestsUnprocessableEntity{} +} + +// WithPayload adds the payload to the process reviewed payment requests unprocessable entity response +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *ProcessReviewedPaymentRequestsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests unprocessable entity response +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ProcessReviewedPaymentRequestsInternalServerErrorCode is the HTTP code returned for type ProcessReviewedPaymentRequestsInternalServerError +const ProcessReviewedPaymentRequestsInternalServerErrorCode int = 500 + +/* +ProcessReviewedPaymentRequestsInternalServerError A server error occurred. + +swagger:response processReviewedPaymentRequestsInternalServerError +*/ +type ProcessReviewedPaymentRequestsInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewProcessReviewedPaymentRequestsInternalServerError creates ProcessReviewedPaymentRequestsInternalServerError with default headers values +func NewProcessReviewedPaymentRequestsInternalServerError() *ProcessReviewedPaymentRequestsInternalServerError { + + return &ProcessReviewedPaymentRequestsInternalServerError{} +} + +// WithPayload adds the payload to the process reviewed payment requests internal server error response +func (o *ProcessReviewedPaymentRequestsInternalServerError) WithPayload(payload *supportmessages.Error) *ProcessReviewedPaymentRequestsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the process reviewed payment requests internal server error response +func (o *ProcessReviewedPaymentRequestsInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ProcessReviewedPaymentRequestsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go new file mode 100644 index 00000000000..dfabf79ef51 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/process_reviewed_payment_requests_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ProcessReviewedPaymentRequestsURL generates an URL for the process reviewed payment requests operation +type ProcessReviewedPaymentRequestsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ProcessReviewedPaymentRequestsURL) WithBasePath(bp string) *ProcessReviewedPaymentRequestsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ProcessReviewedPaymentRequestsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ProcessReviewedPaymentRequestsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/process-reviewed" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ProcessReviewedPaymentRequestsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ProcessReviewedPaymentRequestsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ProcessReviewedPaymentRequestsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ProcessReviewedPaymentRequestsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ProcessReviewedPaymentRequestsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ProcessReviewedPaymentRequestsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go new file mode 100644 index 00000000000..fb6b1a7f92a --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// RecalculatePaymentRequestHandlerFunc turns a function with the right signature into a recalculate payment request handler +type RecalculatePaymentRequestHandlerFunc func(RecalculatePaymentRequestParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn RecalculatePaymentRequestHandlerFunc) Handle(params RecalculatePaymentRequestParams) middleware.Responder { + return fn(params) +} + +// RecalculatePaymentRequestHandler interface for that can handle valid recalculate payment request params +type RecalculatePaymentRequestHandler interface { + Handle(RecalculatePaymentRequestParams) middleware.Responder +} + +// NewRecalculatePaymentRequest creates a new http.Handler for the recalculate payment request operation +func NewRecalculatePaymentRequest(ctx *middleware.Context, handler RecalculatePaymentRequestHandler) *RecalculatePaymentRequest { + return &RecalculatePaymentRequest{Context: ctx, Handler: handler} +} + +/* + RecalculatePaymentRequest swagger:route POST /payment-requests/{paymentRequestID}/recalculate paymentRequest recalculatePaymentRequest + +recalculatePaymentRequest + +Recalculates an existing pending payment request by creating a new payment request for the same service +items but is priced based on the current inputs (weights, dates, etc.). The previously existing payment +request is then deprecated. A link is made between the new and existing payment requests. + +This is a support endpoint and will not be available in production. +*/ +type RecalculatePaymentRequest struct { + Context *middleware.Context + Handler RecalculatePaymentRequestHandler +} + +func (o *RecalculatePaymentRequest) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewRecalculatePaymentRequestParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go new file mode 100644 index 00000000000..d747015620e --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_parameters.go @@ -0,0 +1,91 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// NewRecalculatePaymentRequestParams creates a new RecalculatePaymentRequestParams object +// +// There are no default values defined in the spec. +func NewRecalculatePaymentRequestParams() RecalculatePaymentRequestParams { + + return RecalculatePaymentRequestParams{} +} + +// RecalculatePaymentRequestParams contains all the bound params for the recalculate payment request operation +// typically these are obtained from a http.Request +// +// swagger:parameters recalculatePaymentRequest +type RecalculatePaymentRequestParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*UUID of the payment request to recalculate. + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewRecalculatePaymentRequestParams() beforehand. +func (o *RecalculatePaymentRequestParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *RecalculatePaymentRequestParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *RecalculatePaymentRequestParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go new file mode 100644 index 00000000000..68d893ca414 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// RecalculatePaymentRequestCreatedCode is the HTTP code returned for type RecalculatePaymentRequestCreated +const RecalculatePaymentRequestCreatedCode int = 201 + +/* +RecalculatePaymentRequestCreated The new payment request with recalculated pricing. + +swagger:response recalculatePaymentRequestCreated +*/ +type RecalculatePaymentRequestCreated struct { + + /* + In: Body + */ + Payload *supportmessages.PaymentRequest `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestCreated creates RecalculatePaymentRequestCreated with default headers values +func NewRecalculatePaymentRequestCreated() *RecalculatePaymentRequestCreated { + + return &RecalculatePaymentRequestCreated{} +} + +// WithPayload adds the payload to the recalculate payment request created response +func (o *RecalculatePaymentRequestCreated) WithPayload(payload *supportmessages.PaymentRequest) *RecalculatePaymentRequestCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request created response +func (o *RecalculatePaymentRequestCreated) SetPayload(payload *supportmessages.PaymentRequest) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestBadRequestCode is the HTTP code returned for type RecalculatePaymentRequestBadRequest +const RecalculatePaymentRequestBadRequestCode int = 400 + +/* +RecalculatePaymentRequestBadRequest The request payload is invalid. + +swagger:response recalculatePaymentRequestBadRequest +*/ +type RecalculatePaymentRequestBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestBadRequest creates RecalculatePaymentRequestBadRequest with default headers values +func NewRecalculatePaymentRequestBadRequest() *RecalculatePaymentRequestBadRequest { + + return &RecalculatePaymentRequestBadRequest{} +} + +// WithPayload adds the payload to the recalculate payment request bad request response +func (o *RecalculatePaymentRequestBadRequest) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request bad request response +func (o *RecalculatePaymentRequestBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestUnauthorizedCode is the HTTP code returned for type RecalculatePaymentRequestUnauthorized +const RecalculatePaymentRequestUnauthorizedCode int = 401 + +/* +RecalculatePaymentRequestUnauthorized The request was denied. + +swagger:response recalculatePaymentRequestUnauthorized +*/ +type RecalculatePaymentRequestUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestUnauthorized creates RecalculatePaymentRequestUnauthorized with default headers values +func NewRecalculatePaymentRequestUnauthorized() *RecalculatePaymentRequestUnauthorized { + + return &RecalculatePaymentRequestUnauthorized{} +} + +// WithPayload adds the payload to the recalculate payment request unauthorized response +func (o *RecalculatePaymentRequestUnauthorized) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request unauthorized response +func (o *RecalculatePaymentRequestUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestForbiddenCode is the HTTP code returned for type RecalculatePaymentRequestForbidden +const RecalculatePaymentRequestForbiddenCode int = 403 + +/* +RecalculatePaymentRequestForbidden The request was denied. + +swagger:response recalculatePaymentRequestForbidden +*/ +type RecalculatePaymentRequestForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestForbidden creates RecalculatePaymentRequestForbidden with default headers values +func NewRecalculatePaymentRequestForbidden() *RecalculatePaymentRequestForbidden { + + return &RecalculatePaymentRequestForbidden{} +} + +// WithPayload adds the payload to the recalculate payment request forbidden response +func (o *RecalculatePaymentRequestForbidden) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request forbidden response +func (o *RecalculatePaymentRequestForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestNotFoundCode is the HTTP code returned for type RecalculatePaymentRequestNotFound +const RecalculatePaymentRequestNotFoundCode int = 404 + +/* +RecalculatePaymentRequestNotFound The requested resource wasn't found. + +swagger:response recalculatePaymentRequestNotFound +*/ +type RecalculatePaymentRequestNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestNotFound creates RecalculatePaymentRequestNotFound with default headers values +func NewRecalculatePaymentRequestNotFound() *RecalculatePaymentRequestNotFound { + + return &RecalculatePaymentRequestNotFound{} +} + +// WithPayload adds the payload to the recalculate payment request not found response +func (o *RecalculatePaymentRequestNotFound) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request not found response +func (o *RecalculatePaymentRequestNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestConflictCode is the HTTP code returned for type RecalculatePaymentRequestConflict +const RecalculatePaymentRequestConflictCode int = 409 + +/* +RecalculatePaymentRequestConflict There was a conflict with the request. + +swagger:response recalculatePaymentRequestConflict +*/ +type RecalculatePaymentRequestConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestConflict creates RecalculatePaymentRequestConflict with default headers values +func NewRecalculatePaymentRequestConflict() *RecalculatePaymentRequestConflict { + + return &RecalculatePaymentRequestConflict{} +} + +// WithPayload adds the payload to the recalculate payment request conflict response +func (o *RecalculatePaymentRequestConflict) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request conflict response +func (o *RecalculatePaymentRequestConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestPreconditionFailedCode is the HTTP code returned for type RecalculatePaymentRequestPreconditionFailed +const RecalculatePaymentRequestPreconditionFailedCode int = 412 + +/* +RecalculatePaymentRequestPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response recalculatePaymentRequestPreconditionFailed +*/ +type RecalculatePaymentRequestPreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestPreconditionFailed creates RecalculatePaymentRequestPreconditionFailed with default headers values +func NewRecalculatePaymentRequestPreconditionFailed() *RecalculatePaymentRequestPreconditionFailed { + + return &RecalculatePaymentRequestPreconditionFailed{} +} + +// WithPayload adds the payload to the recalculate payment request precondition failed response +func (o *RecalculatePaymentRequestPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *RecalculatePaymentRequestPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request precondition failed response +func (o *RecalculatePaymentRequestPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestUnprocessableEntityCode is the HTTP code returned for type RecalculatePaymentRequestUnprocessableEntity +const RecalculatePaymentRequestUnprocessableEntityCode int = 422 + +/* +RecalculatePaymentRequestUnprocessableEntity The payload was unprocessable. + +swagger:response recalculatePaymentRequestUnprocessableEntity +*/ +type RecalculatePaymentRequestUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestUnprocessableEntity creates RecalculatePaymentRequestUnprocessableEntity with default headers values +func NewRecalculatePaymentRequestUnprocessableEntity() *RecalculatePaymentRequestUnprocessableEntity { + + return &RecalculatePaymentRequestUnprocessableEntity{} +} + +// WithPayload adds the payload to the recalculate payment request unprocessable entity response +func (o *RecalculatePaymentRequestUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *RecalculatePaymentRequestUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request unprocessable entity response +func (o *RecalculatePaymentRequestUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// RecalculatePaymentRequestInternalServerErrorCode is the HTTP code returned for type RecalculatePaymentRequestInternalServerError +const RecalculatePaymentRequestInternalServerErrorCode int = 500 + +/* +RecalculatePaymentRequestInternalServerError A server error occurred. + +swagger:response recalculatePaymentRequestInternalServerError +*/ +type RecalculatePaymentRequestInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewRecalculatePaymentRequestInternalServerError creates RecalculatePaymentRequestInternalServerError with default headers values +func NewRecalculatePaymentRequestInternalServerError() *RecalculatePaymentRequestInternalServerError { + + return &RecalculatePaymentRequestInternalServerError{} +} + +// WithPayload adds the payload to the recalculate payment request internal server error response +func (o *RecalculatePaymentRequestInternalServerError) WithPayload(payload *supportmessages.Error) *RecalculatePaymentRequestInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the recalculate payment request internal server error response +func (o *RecalculatePaymentRequestInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *RecalculatePaymentRequestInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go new file mode 100644 index 00000000000..61c73beca5e --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/recalculate_payment_request_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// RecalculatePaymentRequestURL generates an URL for the recalculate payment request operation +type RecalculatePaymentRequestURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RecalculatePaymentRequestURL) WithBasePath(bp string) *RecalculatePaymentRequestURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *RecalculatePaymentRequestURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *RecalculatePaymentRequestURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/recalculate" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on RecalculatePaymentRequestURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *RecalculatePaymentRequestURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *RecalculatePaymentRequestURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *RecalculatePaymentRequestURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on RecalculatePaymentRequestURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on RecalculatePaymentRequestURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *RecalculatePaymentRequestURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go new file mode 100644 index 00000000000..2d608c5d45b --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status.go @@ -0,0 +1,62 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// UpdatePaymentRequestStatusHandlerFunc turns a function with the right signature into a update payment request status handler +type UpdatePaymentRequestStatusHandlerFunc func(UpdatePaymentRequestStatusParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn UpdatePaymentRequestStatusHandlerFunc) Handle(params UpdatePaymentRequestStatusParams) middleware.Responder { + return fn(params) +} + +// UpdatePaymentRequestStatusHandler interface for that can handle valid update payment request status params +type UpdatePaymentRequestStatusHandler interface { + Handle(UpdatePaymentRequestStatusParams) middleware.Responder +} + +// NewUpdatePaymentRequestStatus creates a new http.Handler for the update payment request status operation +func NewUpdatePaymentRequestStatus(ctx *middleware.Context, handler UpdatePaymentRequestStatusHandler) *UpdatePaymentRequestStatus { + return &UpdatePaymentRequestStatus{Context: ctx, Handler: handler} +} + +/* + UpdatePaymentRequestStatus swagger:route PATCH /payment-requests/{paymentRequestID}/status paymentRequest updatePaymentRequestStatus + +updatePaymentRequestStatus + +Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED. + +A status of REVIEWED can optionally have a `rejectionReason`. + +This is a support endpoint and is not available in production. +*/ +type UpdatePaymentRequestStatus struct { + Context *middleware.Context + Handler UpdatePaymentRequestStatusHandler +} + +func (o *UpdatePaymentRequestStatus) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewUpdatePaymentRequestStatusParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go new file mode 100644 index 00000000000..c2d24299565 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_parameters.go @@ -0,0 +1,158 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object +// +// There are no default values defined in the spec. +func NewUpdatePaymentRequestStatusParams() UpdatePaymentRequestStatusParams { + + return UpdatePaymentRequestStatusParams{} +} + +// UpdatePaymentRequestStatusParams contains all the bound params for the update payment request status operation +// typically these are obtained from a http.Request +// +// swagger:parameters updatePaymentRequestStatus +type UpdatePaymentRequestStatusParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + Required: true + In: header + */ + IfMatch string + /* + Required: true + In: body + */ + Body *supportmessages.UpdatePaymentRequestStatus + /*UUID of payment request. + Required: true + In: path + */ + PaymentRequestID strfmt.UUID +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewUpdatePaymentRequestStatusParams() beforehand. +func (o *UpdatePaymentRequestStatusParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if err := o.bindIfMatch(r.Header[http.CanonicalHeaderKey("If-Match")], true, route.Formats); err != nil { + res = append(res, err) + } + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.UpdatePaymentRequestStatus + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + + rPaymentRequestID, rhkPaymentRequestID, _ := route.Params.GetOK("paymentRequestID") + if err := o.bindPaymentRequestID(rPaymentRequestID, rhkPaymentRequestID, route.Formats); err != nil { + res = append(res, err) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// bindIfMatch binds and validates parameter IfMatch from header. +func (o *UpdatePaymentRequestStatusParams) bindIfMatch(rawData []string, hasKey bool, formats strfmt.Registry) error { + if !hasKey { + return errors.Required("If-Match", "header", rawData) + } + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + + if err := validate.RequiredString("If-Match", "header", raw); err != nil { + return err + } + o.IfMatch = raw + + return nil +} + +// bindPaymentRequestID binds and validates parameter PaymentRequestID from path. +func (o *UpdatePaymentRequestStatusParams) bindPaymentRequestID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("paymentRequestID", "path", "strfmt.UUID", raw) + } + o.PaymentRequestID = *(value.(*strfmt.UUID)) + + if err := o.validatePaymentRequestID(formats); err != nil { + return err + } + + return nil +} + +// validatePaymentRequestID carries on validations for parameter PaymentRequestID +func (o *UpdatePaymentRequestStatusParams) validatePaymentRequestID(formats strfmt.Registry) error { + + if err := validate.FormatOf("paymentRequestID", "path", "uuid", o.PaymentRequestID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go new file mode 100644 index 00000000000..2fbd739f80d --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_responses.go @@ -0,0 +1,419 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdatePaymentRequestStatusOKCode is the HTTP code returned for type UpdatePaymentRequestStatusOK +const UpdatePaymentRequestStatusOKCode int = 200 + +/* +UpdatePaymentRequestStatusOK Successfully updated payment request status. + +swagger:response updatePaymentRequestStatusOK +*/ +type UpdatePaymentRequestStatusOK struct { + + /* + In: Body + */ + Payload *supportmessages.PaymentRequest `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusOK creates UpdatePaymentRequestStatusOK with default headers values +func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { + + return &UpdatePaymentRequestStatusOK{} +} + +// WithPayload adds the payload to the update payment request status o k response +func (o *UpdatePaymentRequestStatusOK) WithPayload(payload *supportmessages.PaymentRequest) *UpdatePaymentRequestStatusOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status o k response +func (o *UpdatePaymentRequestStatusOK) SetPayload(payload *supportmessages.PaymentRequest) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusBadRequestCode is the HTTP code returned for type UpdatePaymentRequestStatusBadRequest +const UpdatePaymentRequestStatusBadRequestCode int = 400 + +/* +UpdatePaymentRequestStatusBadRequest The request payload is invalid. + +swagger:response updatePaymentRequestStatusBadRequest +*/ +type UpdatePaymentRequestStatusBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusBadRequest creates UpdatePaymentRequestStatusBadRequest with default headers values +func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { + + return &UpdatePaymentRequestStatusBadRequest{} +} + +// WithPayload adds the payload to the update payment request status bad request response +func (o *UpdatePaymentRequestStatusBadRequest) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status bad request response +func (o *UpdatePaymentRequestStatusBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusUnauthorizedCode is the HTTP code returned for type UpdatePaymentRequestStatusUnauthorized +const UpdatePaymentRequestStatusUnauthorizedCode int = 401 + +/* +UpdatePaymentRequestStatusUnauthorized The request was denied. + +swagger:response updatePaymentRequestStatusUnauthorized +*/ +type UpdatePaymentRequestStatusUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusUnauthorized creates UpdatePaymentRequestStatusUnauthorized with default headers values +func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { + + return &UpdatePaymentRequestStatusUnauthorized{} +} + +// WithPayload adds the payload to the update payment request status unauthorized response +func (o *UpdatePaymentRequestStatusUnauthorized) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status unauthorized response +func (o *UpdatePaymentRequestStatusUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusForbiddenCode is the HTTP code returned for type UpdatePaymentRequestStatusForbidden +const UpdatePaymentRequestStatusForbiddenCode int = 403 + +/* +UpdatePaymentRequestStatusForbidden The request was denied. + +swagger:response updatePaymentRequestStatusForbidden +*/ +type UpdatePaymentRequestStatusForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusForbidden creates UpdatePaymentRequestStatusForbidden with default headers values +func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { + + return &UpdatePaymentRequestStatusForbidden{} +} + +// WithPayload adds the payload to the update payment request status forbidden response +func (o *UpdatePaymentRequestStatusForbidden) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status forbidden response +func (o *UpdatePaymentRequestStatusForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusNotFoundCode is the HTTP code returned for type UpdatePaymentRequestStatusNotFound +const UpdatePaymentRequestStatusNotFoundCode int = 404 + +/* +UpdatePaymentRequestStatusNotFound The requested resource wasn't found. + +swagger:response updatePaymentRequestStatusNotFound +*/ +type UpdatePaymentRequestStatusNotFound struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusNotFound creates UpdatePaymentRequestStatusNotFound with default headers values +func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { + + return &UpdatePaymentRequestStatusNotFound{} +} + +// WithPayload adds the payload to the update payment request status not found response +func (o *UpdatePaymentRequestStatusNotFound) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status not found response +func (o *UpdatePaymentRequestStatusNotFound) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusConflictCode is the HTTP code returned for type UpdatePaymentRequestStatusConflict +const UpdatePaymentRequestStatusConflictCode int = 409 + +/* +UpdatePaymentRequestStatusConflict There was a conflict with the request. + +swagger:response updatePaymentRequestStatusConflict +*/ +type UpdatePaymentRequestStatusConflict struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusConflict creates UpdatePaymentRequestStatusConflict with default headers values +func NewUpdatePaymentRequestStatusConflict() *UpdatePaymentRequestStatusConflict { + + return &UpdatePaymentRequestStatusConflict{} +} + +// WithPayload adds the payload to the update payment request status conflict response +func (o *UpdatePaymentRequestStatusConflict) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status conflict response +func (o *UpdatePaymentRequestStatusConflict) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusPreconditionFailedCode is the HTTP code returned for type UpdatePaymentRequestStatusPreconditionFailed +const UpdatePaymentRequestStatusPreconditionFailedCode int = 412 + +/* +UpdatePaymentRequestStatusPreconditionFailed Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. + +swagger:response updatePaymentRequestStatusPreconditionFailed +*/ +type UpdatePaymentRequestStatusPreconditionFailed struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusPreconditionFailed creates UpdatePaymentRequestStatusPreconditionFailed with default headers values +func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { + + return &UpdatePaymentRequestStatusPreconditionFailed{} +} + +// WithPayload adds the payload to the update payment request status precondition failed response +func (o *UpdatePaymentRequestStatusPreconditionFailed) WithPayload(payload *supportmessages.ClientError) *UpdatePaymentRequestStatusPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status precondition failed response +func (o *UpdatePaymentRequestStatusPreconditionFailed) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusUnprocessableEntityCode is the HTTP code returned for type UpdatePaymentRequestStatusUnprocessableEntity +const UpdatePaymentRequestStatusUnprocessableEntityCode int = 422 + +/* +UpdatePaymentRequestStatusUnprocessableEntity The payload was unprocessable. + +swagger:response updatePaymentRequestStatusUnprocessableEntity +*/ +type UpdatePaymentRequestStatusUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusUnprocessableEntity creates UpdatePaymentRequestStatusUnprocessableEntity with default headers values +func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { + + return &UpdatePaymentRequestStatusUnprocessableEntity{} +} + +// WithPayload adds the payload to the update payment request status unprocessable entity response +func (o *UpdatePaymentRequestStatusUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *UpdatePaymentRequestStatusUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status unprocessable entity response +func (o *UpdatePaymentRequestStatusUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// UpdatePaymentRequestStatusInternalServerErrorCode is the HTTP code returned for type UpdatePaymentRequestStatusInternalServerError +const UpdatePaymentRequestStatusInternalServerErrorCode int = 500 + +/* +UpdatePaymentRequestStatusInternalServerError A server error occurred. + +swagger:response updatePaymentRequestStatusInternalServerError +*/ +type UpdatePaymentRequestStatusInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewUpdatePaymentRequestStatusInternalServerError creates UpdatePaymentRequestStatusInternalServerError with default headers values +func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { + + return &UpdatePaymentRequestStatusInternalServerError{} +} + +// WithPayload adds the payload to the update payment request status internal server error response +func (o *UpdatePaymentRequestStatusInternalServerError) WithPayload(payload *supportmessages.Error) *UpdatePaymentRequestStatusInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the update payment request status internal server error response +func (o *UpdatePaymentRequestStatusInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *UpdatePaymentRequestStatusInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go new file mode 100644 index 00000000000..8d337b7e665 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/payment_request/update_payment_request_status_urlbuilder.go @@ -0,0 +1,101 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" + "strings" + + "github.com/go-openapi/strfmt" +) + +// UpdatePaymentRequestStatusURL generates an URL for the update payment request status operation +type UpdatePaymentRequestStatusURL struct { + PaymentRequestID strfmt.UUID + + _basePath string + // avoid unkeyed usage + _ struct{} +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentRequestStatusURL) WithBasePath(bp string) *UpdatePaymentRequestStatusURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *UpdatePaymentRequestStatusURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *UpdatePaymentRequestStatusURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/payment-requests/{paymentRequestID}/status" + + paymentRequestID := o.PaymentRequestID.String() + if paymentRequestID != "" { + _path = strings.Replace(_path, "{paymentRequestID}", paymentRequestID, -1) + } else { + return nil, errors.New("paymentRequestId is required on UpdatePaymentRequestStatusURL") + } + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *UpdatePaymentRequestStatusURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *UpdatePaymentRequestStatusURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *UpdatePaymentRequestStatusURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on UpdatePaymentRequestStatusURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on UpdatePaymentRequestStatusURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *UpdatePaymentRequestStatusURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go new file mode 100644 index 00000000000..15b207c8460 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// CreateWebhookNotificationHandlerFunc turns a function with the right signature into a create webhook notification handler +type CreateWebhookNotificationHandlerFunc func(CreateWebhookNotificationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn CreateWebhookNotificationHandlerFunc) Handle(params CreateWebhookNotificationParams) middleware.Responder { + return fn(params) +} + +// CreateWebhookNotificationHandler interface for that can handle valid create webhook notification params +type CreateWebhookNotificationHandler interface { + Handle(CreateWebhookNotificationParams) middleware.Responder +} + +// NewCreateWebhookNotification creates a new http.Handler for the create webhook notification operation +func NewCreateWebhookNotification(ctx *middleware.Context, handler CreateWebhookNotificationHandler) *CreateWebhookNotification { + return &CreateWebhookNotification{Context: ctx, Handler: handler} +} + +/* + CreateWebhookNotification swagger:route POST /webhook-notifications webhook createWebhookNotification + +# Test endpoint for creating webhook notifications + +This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation. +*/ +type CreateWebhookNotification struct { + Context *middleware.Context + Handler CreateWebhookNotificationHandler +} + +func (o *CreateWebhookNotification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewCreateWebhookNotificationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go new file mode 100644 index 00000000000..aeeedc93343 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_parameters.go @@ -0,0 +1,76 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewCreateWebhookNotificationParams creates a new CreateWebhookNotificationParams object +// +// There are no default values defined in the spec. +func NewCreateWebhookNotificationParams() CreateWebhookNotificationParams { + + return CreateWebhookNotificationParams{} +} + +// CreateWebhookNotificationParams contains all the bound params for the create webhook notification operation +// typically these are obtained from a http.Request +// +// swagger:parameters createWebhookNotification +type CreateWebhookNotificationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The notification sent by webhook-client. + In: body + */ + Body *supportmessages.WebhookNotification +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewCreateWebhookNotificationParams() beforehand. +func (o *CreateWebhookNotificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.WebhookNotification + if err := route.Consumer.Consume(r.Body, &body); err != nil { + res = append(res, errors.NewParseError("body", "body", "", err)) + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go new file mode 100644 index 00000000000..f697cc5bf92 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_responses.go @@ -0,0 +1,149 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// CreateWebhookNotificationCreatedCode is the HTTP code returned for type CreateWebhookNotificationCreated +const CreateWebhookNotificationCreatedCode int = 201 + +/* +CreateWebhookNotificationCreated Successful creation + +swagger:response createWebhookNotificationCreated +*/ +type CreateWebhookNotificationCreated struct { + + /* + In: Body + */ + Payload *supportmessages.WebhookNotification `json:"body,omitempty"` +} + +// NewCreateWebhookNotificationCreated creates CreateWebhookNotificationCreated with default headers values +func NewCreateWebhookNotificationCreated() *CreateWebhookNotificationCreated { + + return &CreateWebhookNotificationCreated{} +} + +// WithPayload adds the payload to the create webhook notification created response +func (o *CreateWebhookNotificationCreated) WithPayload(payload *supportmessages.WebhookNotification) *CreateWebhookNotificationCreated { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create webhook notification created response +func (o *CreateWebhookNotificationCreated) SetPayload(payload *supportmessages.WebhookNotification) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWebhookNotificationCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(201) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWebhookNotificationUnprocessableEntityCode is the HTTP code returned for type CreateWebhookNotificationUnprocessableEntity +const CreateWebhookNotificationUnprocessableEntityCode int = 422 + +/* +CreateWebhookNotificationUnprocessableEntity The payload was unprocessable. + +swagger:response createWebhookNotificationUnprocessableEntity +*/ +type CreateWebhookNotificationUnprocessableEntity struct { + + /* + In: Body + */ + Payload *supportmessages.ValidationError `json:"body,omitempty"` +} + +// NewCreateWebhookNotificationUnprocessableEntity creates CreateWebhookNotificationUnprocessableEntity with default headers values +func NewCreateWebhookNotificationUnprocessableEntity() *CreateWebhookNotificationUnprocessableEntity { + + return &CreateWebhookNotificationUnprocessableEntity{} +} + +// WithPayload adds the payload to the create webhook notification unprocessable entity response +func (o *CreateWebhookNotificationUnprocessableEntity) WithPayload(payload *supportmessages.ValidationError) *CreateWebhookNotificationUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create webhook notification unprocessable entity response +func (o *CreateWebhookNotificationUnprocessableEntity) SetPayload(payload *supportmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWebhookNotificationUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// CreateWebhookNotificationInternalServerErrorCode is the HTTP code returned for type CreateWebhookNotificationInternalServerError +const CreateWebhookNotificationInternalServerErrorCode int = 500 + +/* +CreateWebhookNotificationInternalServerError A server error occurred. + +swagger:response createWebhookNotificationInternalServerError +*/ +type CreateWebhookNotificationInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewCreateWebhookNotificationInternalServerError creates CreateWebhookNotificationInternalServerError with default headers values +func NewCreateWebhookNotificationInternalServerError() *CreateWebhookNotificationInternalServerError { + + return &CreateWebhookNotificationInternalServerError{} +} + +// WithPayload adds the payload to the create webhook notification internal server error response +func (o *CreateWebhookNotificationInternalServerError) WithPayload(payload *supportmessages.Error) *CreateWebhookNotificationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the create webhook notification internal server error response +func (o *CreateWebhookNotificationInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *CreateWebhookNotificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go new file mode 100644 index 00000000000..ac3646fd8a0 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/create_webhook_notification_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// CreateWebhookNotificationURL generates an URL for the create webhook notification operation +type CreateWebhookNotificationURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWebhookNotificationURL) WithBasePath(bp string) *CreateWebhookNotificationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *CreateWebhookNotificationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *CreateWebhookNotificationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-notifications" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *CreateWebhookNotificationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *CreateWebhookNotificationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *CreateWebhookNotificationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on CreateWebhookNotificationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on CreateWebhookNotificationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *CreateWebhookNotificationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go new file mode 100644 index 00000000000..900907c8d0d --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ReceiveWebhookNotificationHandlerFunc turns a function with the right signature into a receive webhook notification handler +type ReceiveWebhookNotificationHandlerFunc func(ReceiveWebhookNotificationParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ReceiveWebhookNotificationHandlerFunc) Handle(params ReceiveWebhookNotificationParams) middleware.Responder { + return fn(params) +} + +// ReceiveWebhookNotificationHandler interface for that can handle valid receive webhook notification params +type ReceiveWebhookNotificationHandler interface { + Handle(ReceiveWebhookNotificationParams) middleware.Responder +} + +// NewReceiveWebhookNotification creates a new http.Handler for the receive webhook notification operation +func NewReceiveWebhookNotification(ctx *middleware.Context, handler ReceiveWebhookNotificationHandler) *ReceiveWebhookNotification { + return &ReceiveWebhookNotification{Context: ctx, Handler: handler} +} + +/* + ReceiveWebhookNotification swagger:route POST /webhook-notify webhook receiveWebhookNotification + +# Test endpoint for receiving messages from our own webhook-client + +This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The `webhook-client` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection. +*/ +type ReceiveWebhookNotification struct { + Context *middleware.Context + Handler ReceiveWebhookNotificationHandler +} + +func (o *ReceiveWebhookNotification) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewReceiveWebhookNotificationParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go new file mode 100644 index 00000000000..633b176db6a --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewReceiveWebhookNotificationParams creates a new ReceiveWebhookNotificationParams object +// +// There are no default values defined in the spec. +func NewReceiveWebhookNotificationParams() ReceiveWebhookNotificationParams { + + return ReceiveWebhookNotificationParams{} +} + +// ReceiveWebhookNotificationParams contains all the bound params for the receive webhook notification operation +// typically these are obtained from a http.Request +// +// swagger:parameters receiveWebhookNotification +type ReceiveWebhookNotificationParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /*The webhook notification being sent + Required: true + In: body + */ + Body *supportmessages.WebhookNotification +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewReceiveWebhookNotificationParams() beforehand. +func (o *ReceiveWebhookNotificationParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body supportmessages.WebhookNotification + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go new file mode 100644 index 00000000000..4bc18b5f51f --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_responses.go @@ -0,0 +1,239 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ReceiveWebhookNotificationOKCode is the HTTP code returned for type ReceiveWebhookNotificationOK +const ReceiveWebhookNotificationOKCode int = 200 + +/* +ReceiveWebhookNotificationOK Received notification + +swagger:response receiveWebhookNotificationOK +*/ +type ReceiveWebhookNotificationOK struct { + + /* + In: Body + */ + Payload *supportmessages.WebhookNotification `json:"body,omitempty"` +} + +// NewReceiveWebhookNotificationOK creates ReceiveWebhookNotificationOK with default headers values +func NewReceiveWebhookNotificationOK() *ReceiveWebhookNotificationOK { + + return &ReceiveWebhookNotificationOK{} +} + +// WithPayload adds the payload to the receive webhook notification o k response +func (o *ReceiveWebhookNotificationOK) WithPayload(payload *supportmessages.WebhookNotification) *ReceiveWebhookNotificationOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the receive webhook notification o k response +func (o *ReceiveWebhookNotificationOK) SetPayload(payload *supportmessages.WebhookNotification) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReceiveWebhookNotificationOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReceiveWebhookNotificationBadRequestCode is the HTTP code returned for type ReceiveWebhookNotificationBadRequest +const ReceiveWebhookNotificationBadRequestCode int = 400 + +/* +ReceiveWebhookNotificationBadRequest The request payload is invalid. + +swagger:response receiveWebhookNotificationBadRequest +*/ +type ReceiveWebhookNotificationBadRequest struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewReceiveWebhookNotificationBadRequest creates ReceiveWebhookNotificationBadRequest with default headers values +func NewReceiveWebhookNotificationBadRequest() *ReceiveWebhookNotificationBadRequest { + + return &ReceiveWebhookNotificationBadRequest{} +} + +// WithPayload adds the payload to the receive webhook notification bad request response +func (o *ReceiveWebhookNotificationBadRequest) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the receive webhook notification bad request response +func (o *ReceiveWebhookNotificationBadRequest) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReceiveWebhookNotificationBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReceiveWebhookNotificationUnauthorizedCode is the HTTP code returned for type ReceiveWebhookNotificationUnauthorized +const ReceiveWebhookNotificationUnauthorizedCode int = 401 + +/* +ReceiveWebhookNotificationUnauthorized The request was denied. + +swagger:response receiveWebhookNotificationUnauthorized +*/ +type ReceiveWebhookNotificationUnauthorized struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewReceiveWebhookNotificationUnauthorized creates ReceiveWebhookNotificationUnauthorized with default headers values +func NewReceiveWebhookNotificationUnauthorized() *ReceiveWebhookNotificationUnauthorized { + + return &ReceiveWebhookNotificationUnauthorized{} +} + +// WithPayload adds the payload to the receive webhook notification unauthorized response +func (o *ReceiveWebhookNotificationUnauthorized) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationUnauthorized { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the receive webhook notification unauthorized response +func (o *ReceiveWebhookNotificationUnauthorized) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReceiveWebhookNotificationUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(401) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReceiveWebhookNotificationForbiddenCode is the HTTP code returned for type ReceiveWebhookNotificationForbidden +const ReceiveWebhookNotificationForbiddenCode int = 403 + +/* +ReceiveWebhookNotificationForbidden The request was denied. + +swagger:response receiveWebhookNotificationForbidden +*/ +type ReceiveWebhookNotificationForbidden struct { + + /* + In: Body + */ + Payload *supportmessages.ClientError `json:"body,omitempty"` +} + +// NewReceiveWebhookNotificationForbidden creates ReceiveWebhookNotificationForbidden with default headers values +func NewReceiveWebhookNotificationForbidden() *ReceiveWebhookNotificationForbidden { + + return &ReceiveWebhookNotificationForbidden{} +} + +// WithPayload adds the payload to the receive webhook notification forbidden response +func (o *ReceiveWebhookNotificationForbidden) WithPayload(payload *supportmessages.ClientError) *ReceiveWebhookNotificationForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the receive webhook notification forbidden response +func (o *ReceiveWebhookNotificationForbidden) SetPayload(payload *supportmessages.ClientError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReceiveWebhookNotificationForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ReceiveWebhookNotificationInternalServerErrorCode is the HTTP code returned for type ReceiveWebhookNotificationInternalServerError +const ReceiveWebhookNotificationInternalServerErrorCode int = 500 + +/* +ReceiveWebhookNotificationInternalServerError A server error occurred. + +swagger:response receiveWebhookNotificationInternalServerError +*/ +type ReceiveWebhookNotificationInternalServerError struct { + + /* + In: Body + */ + Payload *supportmessages.Error `json:"body,omitempty"` +} + +// NewReceiveWebhookNotificationInternalServerError creates ReceiveWebhookNotificationInternalServerError with default headers values +func NewReceiveWebhookNotificationInternalServerError() *ReceiveWebhookNotificationInternalServerError { + + return &ReceiveWebhookNotificationInternalServerError{} +} + +// WithPayload adds the payload to the receive webhook notification internal server error response +func (o *ReceiveWebhookNotificationInternalServerError) WithPayload(payload *supportmessages.Error) *ReceiveWebhookNotificationInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the receive webhook notification internal server error response +func (o *ReceiveWebhookNotificationInternalServerError) SetPayload(payload *supportmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ReceiveWebhookNotificationInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go new file mode 100644 index 00000000000..37421521ef9 --- /dev/null +++ b/pkg/gen/supportapi/supportoperations/webhook/receive_webhook_notification_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ReceiveWebhookNotificationURL generates an URL for the receive webhook notification operation +type ReceiveWebhookNotificationURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ReceiveWebhookNotificationURL) WithBasePath(bp string) *ReceiveWebhookNotificationURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ReceiveWebhookNotificationURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ReceiveWebhookNotificationURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/webhook-notify" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/support/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ReceiveWebhookNotificationURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ReceiveWebhookNotificationURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ReceiveWebhookNotificationURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ReceiveWebhookNotificationURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ReceiveWebhookNotificationURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ReceiveWebhookNotificationURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go b/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go new file mode 100644 index 00000000000..7e35818353c --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/create_move_task_order_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewCreateMoveTaskOrderParams creates a new CreateMoveTaskOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateMoveTaskOrderParams() *CreateMoveTaskOrderParams { + return &CreateMoveTaskOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateMoveTaskOrderParamsWithTimeout creates a new CreateMoveTaskOrderParams object +// with the ability to set a timeout on a request. +func NewCreateMoveTaskOrderParamsWithTimeout(timeout time.Duration) *CreateMoveTaskOrderParams { + return &CreateMoveTaskOrderParams{ + timeout: timeout, + } +} + +// NewCreateMoveTaskOrderParamsWithContext creates a new CreateMoveTaskOrderParams object +// with the ability to set a context for a request. +func NewCreateMoveTaskOrderParamsWithContext(ctx context.Context) *CreateMoveTaskOrderParams { + return &CreateMoveTaskOrderParams{ + Context: ctx, + } +} + +// NewCreateMoveTaskOrderParamsWithHTTPClient creates a new CreateMoveTaskOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateMoveTaskOrderParamsWithHTTPClient(client *http.Client) *CreateMoveTaskOrderParams { + return &CreateMoveTaskOrderParams{ + HTTPClient: client, + } +} + +/* +CreateMoveTaskOrderParams contains all the parameters to send to the API endpoint + + for the create move task order operation. + + Typically these are written to a http.Request. +*/ +type CreateMoveTaskOrderParams struct { + + // Body. + Body *supportmessages.MoveTaskOrder + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMoveTaskOrderParams) WithDefaults() *CreateMoveTaskOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateMoveTaskOrderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create move task order params +func (o *CreateMoveTaskOrderParams) WithTimeout(timeout time.Duration) *CreateMoveTaskOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create move task order params +func (o *CreateMoveTaskOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create move task order params +func (o *CreateMoveTaskOrderParams) WithContext(ctx context.Context) *CreateMoveTaskOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create move task order params +func (o *CreateMoveTaskOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create move task order params +func (o *CreateMoveTaskOrderParams) WithHTTPClient(client *http.Client) *CreateMoveTaskOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create move task order params +func (o *CreateMoveTaskOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create move task order params +func (o *CreateMoveTaskOrderParams) WithBody(body *supportmessages.MoveTaskOrder) *CreateMoveTaskOrderParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create move task order params +func (o *CreateMoveTaskOrderParams) SetBody(body *supportmessages.MoveTaskOrder) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go b/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go new file mode 100644 index 00000000000..3a902aaa15e --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/create_move_task_order_responses.go @@ -0,0 +1,547 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// CreateMoveTaskOrderReader is a Reader for the CreateMoveTaskOrder structure. +type CreateMoveTaskOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateMoveTaskOrderCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewCreateMoveTaskOrderBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewCreateMoveTaskOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewCreateMoveTaskOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewCreateMoveTaskOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewCreateMoveTaskOrderUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateMoveTaskOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /move-task-orders] createMoveTaskOrder", response, response.Code()) + } +} + +// NewCreateMoveTaskOrderCreated creates a CreateMoveTaskOrderCreated with default headers values +func NewCreateMoveTaskOrderCreated() *CreateMoveTaskOrderCreated { + return &CreateMoveTaskOrderCreated{} +} + +/* +CreateMoveTaskOrderCreated describes a response with status code 201, with default header values. + +Successfully created MoveTaskOrder object. +*/ +type CreateMoveTaskOrderCreated struct { + Payload *supportmessages.MoveTaskOrder +} + +// IsSuccess returns true when this create move task order created response has a 2xx status code +func (o *CreateMoveTaskOrderCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create move task order created response has a 3xx status code +func (o *CreateMoveTaskOrderCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order created response has a 4xx status code +func (o *CreateMoveTaskOrderCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create move task order created response has a 5xx status code +func (o *CreateMoveTaskOrderCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order created response a status code equal to that given +func (o *CreateMoveTaskOrderCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create move task order created response +func (o *CreateMoveTaskOrderCreated) Code() int { + return 201 +} + +func (o *CreateMoveTaskOrderCreated) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderCreated %+v", 201, o.Payload) +} + +func (o *CreateMoveTaskOrderCreated) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderCreated %+v", 201, o.Payload) +} + +func (o *CreateMoveTaskOrderCreated) GetPayload() *supportmessages.MoveTaskOrder { + return o.Payload +} + +func (o *CreateMoveTaskOrderCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderBadRequest creates a CreateMoveTaskOrderBadRequest with default headers values +func NewCreateMoveTaskOrderBadRequest() *CreateMoveTaskOrderBadRequest { + return &CreateMoveTaskOrderBadRequest{} +} + +/* +CreateMoveTaskOrderBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type CreateMoveTaskOrderBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this create move task order bad request response has a 2xx status code +func (o *CreateMoveTaskOrderBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order bad request response has a 3xx status code +func (o *CreateMoveTaskOrderBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order bad request response has a 4xx status code +func (o *CreateMoveTaskOrderBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this create move task order bad request response has a 5xx status code +func (o *CreateMoveTaskOrderBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order bad request response a status code equal to that given +func (o *CreateMoveTaskOrderBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the create move task order bad request response +func (o *CreateMoveTaskOrderBadRequest) Code() int { + return 400 +} + +func (o *CreateMoveTaskOrderBadRequest) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMoveTaskOrderBadRequest) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderBadRequest %+v", 400, o.Payload) +} + +func (o *CreateMoveTaskOrderBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *CreateMoveTaskOrderBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderUnauthorized creates a CreateMoveTaskOrderUnauthorized with default headers values +func NewCreateMoveTaskOrderUnauthorized() *CreateMoveTaskOrderUnauthorized { + return &CreateMoveTaskOrderUnauthorized{} +} + +/* +CreateMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type CreateMoveTaskOrderUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this create move task order unauthorized response has a 2xx status code +func (o *CreateMoveTaskOrderUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order unauthorized response has a 3xx status code +func (o *CreateMoveTaskOrderUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order unauthorized response has a 4xx status code +func (o *CreateMoveTaskOrderUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this create move task order unauthorized response has a 5xx status code +func (o *CreateMoveTaskOrderUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order unauthorized response a status code equal to that given +func (o *CreateMoveTaskOrderUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the create move task order unauthorized response +func (o *CreateMoveTaskOrderUnauthorized) Code() int { + return 401 +} + +func (o *CreateMoveTaskOrderUnauthorized) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMoveTaskOrderUnauthorized) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *CreateMoveTaskOrderUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *CreateMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderForbidden creates a CreateMoveTaskOrderForbidden with default headers values +func NewCreateMoveTaskOrderForbidden() *CreateMoveTaskOrderForbidden { + return &CreateMoveTaskOrderForbidden{} +} + +/* +CreateMoveTaskOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type CreateMoveTaskOrderForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this create move task order forbidden response has a 2xx status code +func (o *CreateMoveTaskOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order forbidden response has a 3xx status code +func (o *CreateMoveTaskOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order forbidden response has a 4xx status code +func (o *CreateMoveTaskOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this create move task order forbidden response has a 5xx status code +func (o *CreateMoveTaskOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order forbidden response a status code equal to that given +func (o *CreateMoveTaskOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the create move task order forbidden response +func (o *CreateMoveTaskOrderForbidden) Code() int { + return 403 +} + +func (o *CreateMoveTaskOrderForbidden) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *CreateMoveTaskOrderForbidden) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *CreateMoveTaskOrderForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *CreateMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderNotFound creates a CreateMoveTaskOrderNotFound with default headers values +func NewCreateMoveTaskOrderNotFound() *CreateMoveTaskOrderNotFound { + return &CreateMoveTaskOrderNotFound{} +} + +/* +CreateMoveTaskOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type CreateMoveTaskOrderNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this create move task order not found response has a 2xx status code +func (o *CreateMoveTaskOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order not found response has a 3xx status code +func (o *CreateMoveTaskOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order not found response has a 4xx status code +func (o *CreateMoveTaskOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this create move task order not found response has a 5xx status code +func (o *CreateMoveTaskOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order not found response a status code equal to that given +func (o *CreateMoveTaskOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the create move task order not found response +func (o *CreateMoveTaskOrderNotFound) Code() int { + return 404 +} + +func (o *CreateMoveTaskOrderNotFound) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *CreateMoveTaskOrderNotFound) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *CreateMoveTaskOrderNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *CreateMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderUnprocessableEntity creates a CreateMoveTaskOrderUnprocessableEntity with default headers values +func NewCreateMoveTaskOrderUnprocessableEntity() *CreateMoveTaskOrderUnprocessableEntity { + return &CreateMoveTaskOrderUnprocessableEntity{} +} + +/* +CreateMoveTaskOrderUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type CreateMoveTaskOrderUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this create move task order unprocessable entity response has a 2xx status code +func (o *CreateMoveTaskOrderUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order unprocessable entity response has a 3xx status code +func (o *CreateMoveTaskOrderUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order unprocessable entity response has a 4xx status code +func (o *CreateMoveTaskOrderUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create move task order unprocessable entity response has a 5xx status code +func (o *CreateMoveTaskOrderUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create move task order unprocessable entity response a status code equal to that given +func (o *CreateMoveTaskOrderUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create move task order unprocessable entity response +func (o *CreateMoveTaskOrderUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateMoveTaskOrderUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMoveTaskOrderUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateMoveTaskOrderUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *CreateMoveTaskOrderUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateMoveTaskOrderInternalServerError creates a CreateMoveTaskOrderInternalServerError with default headers values +func NewCreateMoveTaskOrderInternalServerError() *CreateMoveTaskOrderInternalServerError { + return &CreateMoveTaskOrderInternalServerError{} +} + +/* +CreateMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateMoveTaskOrderInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this create move task order internal server error response has a 2xx status code +func (o *CreateMoveTaskOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create move task order internal server error response has a 3xx status code +func (o *CreateMoveTaskOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create move task order internal server error response has a 4xx status code +func (o *CreateMoveTaskOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create move task order internal server error response has a 5xx status code +func (o *CreateMoveTaskOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create move task order internal server error response a status code equal to that given +func (o *CreateMoveTaskOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create move task order internal server error response +func (o *CreateMoveTaskOrderInternalServerError) Code() int { + return 500 +} + +func (o *CreateMoveTaskOrderInternalServerError) Error() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMoveTaskOrderInternalServerError) String() string { + return fmt.Sprintf("[POST /move-task-orders][%d] createMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateMoveTaskOrderInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *CreateMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go b/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go new file mode 100644 index 00000000000..e7b0c9c9eed --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/get_move_task_order_parameters.go @@ -0,0 +1,151 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetMoveTaskOrderParams creates a new GetMoveTaskOrderParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetMoveTaskOrderParams() *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetMoveTaskOrderParamsWithTimeout creates a new GetMoveTaskOrderParams object +// with the ability to set a timeout on a request. +func NewGetMoveTaskOrderParamsWithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + timeout: timeout, + } +} + +// NewGetMoveTaskOrderParamsWithContext creates a new GetMoveTaskOrderParams object +// with the ability to set a context for a request. +func NewGetMoveTaskOrderParamsWithContext(ctx context.Context) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + Context: ctx, + } +} + +// NewGetMoveTaskOrderParamsWithHTTPClient creates a new GetMoveTaskOrderParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetMoveTaskOrderParamsWithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + return &GetMoveTaskOrderParams{ + HTTPClient: client, + } +} + +/* +GetMoveTaskOrderParams contains all the parameters to send to the API endpoint + + for the get move task order operation. + + Typically these are written to a http.Request. +*/ +type GetMoveTaskOrderParams struct { + + /* MoveTaskOrderID. + + UUID of move task order to use. + */ + MoveTaskOrderID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) WithDefaults() *GetMoveTaskOrderParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get move task order params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetMoveTaskOrderParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) WithTimeout(timeout time.Duration) *GetMoveTaskOrderParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get move task order params +func (o *GetMoveTaskOrderParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) WithContext(ctx context.Context) *GetMoveTaskOrderParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get move task order params +func (o *GetMoveTaskOrderParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) WithHTTPClient(client *http.Client) *GetMoveTaskOrderParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get move task order params +func (o *GetMoveTaskOrderParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMoveTaskOrderID adds the moveTaskOrderID to the get move task order params +func (o *GetMoveTaskOrderParams) WithMoveTaskOrderID(moveTaskOrderID string) *GetMoveTaskOrderParams { + o.SetMoveTaskOrderID(moveTaskOrderID) + return o +} + +// SetMoveTaskOrderID adds the moveTaskOrderId to the get move task order params +func (o *GetMoveTaskOrderParams) SetMoveTaskOrderID(moveTaskOrderID string) { + o.MoveTaskOrderID = moveTaskOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetMoveTaskOrderParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param moveTaskOrderID + if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go b/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go new file mode 100644 index 00000000000..09f4fc6e91c --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/get_move_task_order_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// GetMoveTaskOrderReader is a Reader for the GetMoveTaskOrder structure. +type GetMoveTaskOrderReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetMoveTaskOrderReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetMoveTaskOrderOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 401: + result := NewGetMoveTaskOrderUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetMoveTaskOrderForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetMoveTaskOrderNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetMoveTaskOrderInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders/{moveTaskOrderID}] getMoveTaskOrder", response, response.Code()) + } +} + +// NewGetMoveTaskOrderOK creates a GetMoveTaskOrderOK with default headers values +func NewGetMoveTaskOrderOK() *GetMoveTaskOrderOK { + return &GetMoveTaskOrderOK{} +} + +/* +GetMoveTaskOrderOK describes a response with status code 200, with default header values. + +Successfully retrieve an individual move task order. +*/ +type GetMoveTaskOrderOK struct { + Payload *supportmessages.MoveTaskOrder +} + +// IsSuccess returns true when this get move task order o k response has a 2xx status code +func (o *GetMoveTaskOrderOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get move task order o k response has a 3xx status code +func (o *GetMoveTaskOrderOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order o k response has a 4xx status code +func (o *GetMoveTaskOrderOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order o k response has a 5xx status code +func (o *GetMoveTaskOrderOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order o k response a status code equal to that given +func (o *GetMoveTaskOrderOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get move task order o k response +func (o *GetMoveTaskOrderOK) Code() int { + return 200 +} + +func (o *GetMoveTaskOrderOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderOK %+v", 200, o.Payload) +} + +func (o *GetMoveTaskOrderOK) GetPayload() *supportmessages.MoveTaskOrder { + return o.Payload +} + +func (o *GetMoveTaskOrderOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderUnauthorized creates a GetMoveTaskOrderUnauthorized with default headers values +func NewGetMoveTaskOrderUnauthorized() *GetMoveTaskOrderUnauthorized { + return &GetMoveTaskOrderUnauthorized{} +} + +/* +GetMoveTaskOrderUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get move task order unauthorized response has a 2xx status code +func (o *GetMoveTaskOrderUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order unauthorized response has a 3xx status code +func (o *GetMoveTaskOrderUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order unauthorized response has a 4xx status code +func (o *GetMoveTaskOrderUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order unauthorized response has a 5xx status code +func (o *GetMoveTaskOrderUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order unauthorized response a status code equal to that given +func (o *GetMoveTaskOrderUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get move task order unauthorized response +func (o *GetMoveTaskOrderUnauthorized) Code() int { + return 401 +} + +func (o *GetMoveTaskOrderUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderUnauthorized %+v", 401, o.Payload) +} + +func (o *GetMoveTaskOrderUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderForbidden creates a GetMoveTaskOrderForbidden with default headers values +func NewGetMoveTaskOrderForbidden() *GetMoveTaskOrderForbidden { + return &GetMoveTaskOrderForbidden{} +} + +/* +GetMoveTaskOrderForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type GetMoveTaskOrderForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get move task order forbidden response has a 2xx status code +func (o *GetMoveTaskOrderForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order forbidden response has a 3xx status code +func (o *GetMoveTaskOrderForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order forbidden response has a 4xx status code +func (o *GetMoveTaskOrderForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order forbidden response has a 5xx status code +func (o *GetMoveTaskOrderForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order forbidden response a status code equal to that given +func (o *GetMoveTaskOrderForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get move task order forbidden response +func (o *GetMoveTaskOrderForbidden) Code() int { + return 403 +} + +func (o *GetMoveTaskOrderForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderForbidden %+v", 403, o.Payload) +} + +func (o *GetMoveTaskOrderForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderNotFound creates a GetMoveTaskOrderNotFound with default headers values +func NewGetMoveTaskOrderNotFound() *GetMoveTaskOrderNotFound { + return &GetMoveTaskOrderNotFound{} +} + +/* +GetMoveTaskOrderNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type GetMoveTaskOrderNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get move task order not found response has a 2xx status code +func (o *GetMoveTaskOrderNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order not found response has a 3xx status code +func (o *GetMoveTaskOrderNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order not found response has a 4xx status code +func (o *GetMoveTaskOrderNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get move task order not found response has a 5xx status code +func (o *GetMoveTaskOrderNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get move task order not found response a status code equal to that given +func (o *GetMoveTaskOrderNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get move task order not found response +func (o *GetMoveTaskOrderNotFound) Code() int { + return 404 +} + +func (o *GetMoveTaskOrderNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderNotFound %+v", 404, o.Payload) +} + +func (o *GetMoveTaskOrderNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetMoveTaskOrderNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetMoveTaskOrderInternalServerError creates a GetMoveTaskOrderInternalServerError with default headers values +func NewGetMoveTaskOrderInternalServerError() *GetMoveTaskOrderInternalServerError { + return &GetMoveTaskOrderInternalServerError{} +} + +/* +GetMoveTaskOrderInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type GetMoveTaskOrderInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this get move task order internal server error response has a 2xx status code +func (o *GetMoveTaskOrderInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get move task order internal server error response has a 3xx status code +func (o *GetMoveTaskOrderInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get move task order internal server error response has a 4xx status code +func (o *GetMoveTaskOrderInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get move task order internal server error response has a 5xx status code +func (o *GetMoveTaskOrderInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get move task order internal server error response a status code equal to that given +func (o *GetMoveTaskOrderInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get move task order internal server error response +func (o *GetMoveTaskOrderInternalServerError) Code() int { + return 500 +} + +func (o *GetMoveTaskOrderInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}][%d] getMoveTaskOrderInternalServerError %+v", 500, o.Payload) +} + +func (o *GetMoveTaskOrderInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *GetMoveTaskOrderInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go new file mode 100644 index 00000000000..a88f31ff1a6 --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_parameters.go @@ -0,0 +1,128 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewHideNonFakeMoveTaskOrdersParams creates a new HideNonFakeMoveTaskOrdersParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewHideNonFakeMoveTaskOrdersParams() *HideNonFakeMoveTaskOrdersParams { + return &HideNonFakeMoveTaskOrdersParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewHideNonFakeMoveTaskOrdersParamsWithTimeout creates a new HideNonFakeMoveTaskOrdersParams object +// with the ability to set a timeout on a request. +func NewHideNonFakeMoveTaskOrdersParamsWithTimeout(timeout time.Duration) *HideNonFakeMoveTaskOrdersParams { + return &HideNonFakeMoveTaskOrdersParams{ + timeout: timeout, + } +} + +// NewHideNonFakeMoveTaskOrdersParamsWithContext creates a new HideNonFakeMoveTaskOrdersParams object +// with the ability to set a context for a request. +func NewHideNonFakeMoveTaskOrdersParamsWithContext(ctx context.Context) *HideNonFakeMoveTaskOrdersParams { + return &HideNonFakeMoveTaskOrdersParams{ + Context: ctx, + } +} + +// NewHideNonFakeMoveTaskOrdersParamsWithHTTPClient creates a new HideNonFakeMoveTaskOrdersParams object +// with the ability to set a custom HTTPClient for a request. +func NewHideNonFakeMoveTaskOrdersParamsWithHTTPClient(client *http.Client) *HideNonFakeMoveTaskOrdersParams { + return &HideNonFakeMoveTaskOrdersParams{ + HTTPClient: client, + } +} + +/* +HideNonFakeMoveTaskOrdersParams contains all the parameters to send to the API endpoint + + for the hide non fake move task orders operation. + + Typically these are written to a http.Request. +*/ +type HideNonFakeMoveTaskOrdersParams struct { + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the hide non fake move task orders params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *HideNonFakeMoveTaskOrdersParams) WithDefaults() *HideNonFakeMoveTaskOrdersParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the hide non fake move task orders params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *HideNonFakeMoveTaskOrdersParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) WithTimeout(timeout time.Duration) *HideNonFakeMoveTaskOrdersParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) WithContext(ctx context.Context) *HideNonFakeMoveTaskOrdersParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) WithHTTPClient(client *http.Client) *HideNonFakeMoveTaskOrdersParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the hide non fake move task orders params +func (o *HideNonFakeMoveTaskOrdersParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WriteToRequest writes these params to a swagger request +func (o *HideNonFakeMoveTaskOrdersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go new file mode 100644 index 00000000000..8b3cf4daada --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/hide_non_fake_move_task_orders_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// HideNonFakeMoveTaskOrdersReader is a Reader for the HideNonFakeMoveTaskOrders structure. +type HideNonFakeMoveTaskOrdersReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *HideNonFakeMoveTaskOrdersReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewHideNonFakeMoveTaskOrdersOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewHideNonFakeMoveTaskOrdersBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewHideNonFakeMoveTaskOrdersUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewHideNonFakeMoveTaskOrdersForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewHideNonFakeMoveTaskOrdersNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewHideNonFakeMoveTaskOrdersConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewHideNonFakeMoveTaskOrdersPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewHideNonFakeMoveTaskOrdersUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewHideNonFakeMoveTaskOrdersInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /move-task-orders/hide] hideNonFakeMoveTaskOrders", response, response.Code()) + } +} + +// NewHideNonFakeMoveTaskOrdersOK creates a HideNonFakeMoveTaskOrdersOK with default headers values +func NewHideNonFakeMoveTaskOrdersOK() *HideNonFakeMoveTaskOrdersOK { + return &HideNonFakeMoveTaskOrdersOK{} +} + +/* +HideNonFakeMoveTaskOrdersOK describes a response with status code 200, with default header values. + +Successfully hid MTOs. +*/ +type HideNonFakeMoveTaskOrdersOK struct { + Payload *supportmessages.MTOHideMovesResponse +} + +// IsSuccess returns true when this hide non fake move task orders o k response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this hide non fake move task orders o k response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders o k response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this hide non fake move task orders o k response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersOK) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders o k response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the hide non fake move task orders o k response +func (o *HideNonFakeMoveTaskOrdersOK) Code() int { + return 200 +} + +func (o *HideNonFakeMoveTaskOrdersOK) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersOK %+v", 200, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersOK) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersOK %+v", 200, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersOK) GetPayload() *supportmessages.MTOHideMovesResponse { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.MTOHideMovesResponse) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersBadRequest creates a HideNonFakeMoveTaskOrdersBadRequest with default headers values +func NewHideNonFakeMoveTaskOrdersBadRequest() *HideNonFakeMoveTaskOrdersBadRequest { + return &HideNonFakeMoveTaskOrdersBadRequest{} +} + +/* +HideNonFakeMoveTaskOrdersBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type HideNonFakeMoveTaskOrdersBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders bad request response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders bad request response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders bad request response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders bad request response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders bad request response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the hide non fake move task orders bad request response +func (o *HideNonFakeMoveTaskOrdersBadRequest) Code() int { + return 400 +} + +func (o *HideNonFakeMoveTaskOrdersBadRequest) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersBadRequest %+v", 400, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersBadRequest) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersBadRequest %+v", 400, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersUnauthorized creates a HideNonFakeMoveTaskOrdersUnauthorized with default headers values +func NewHideNonFakeMoveTaskOrdersUnauthorized() *HideNonFakeMoveTaskOrdersUnauthorized { + return &HideNonFakeMoveTaskOrdersUnauthorized{} +} + +/* +HideNonFakeMoveTaskOrdersUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type HideNonFakeMoveTaskOrdersUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders unauthorized response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders unauthorized response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders unauthorized response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders unauthorized response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders unauthorized response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the hide non fake move task orders unauthorized response +func (o *HideNonFakeMoveTaskOrdersUnauthorized) Code() int { + return 401 +} + +func (o *HideNonFakeMoveTaskOrdersUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersUnauthorized) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnauthorized %+v", 401, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersForbidden creates a HideNonFakeMoveTaskOrdersForbidden with default headers values +func NewHideNonFakeMoveTaskOrdersForbidden() *HideNonFakeMoveTaskOrdersForbidden { + return &HideNonFakeMoveTaskOrdersForbidden{} +} + +/* +HideNonFakeMoveTaskOrdersForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type HideNonFakeMoveTaskOrdersForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders forbidden response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders forbidden response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders forbidden response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders forbidden response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders forbidden response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the hide non fake move task orders forbidden response +func (o *HideNonFakeMoveTaskOrdersForbidden) Code() int { + return 403 +} + +func (o *HideNonFakeMoveTaskOrdersForbidden) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersForbidden %+v", 403, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersForbidden) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersForbidden %+v", 403, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersNotFound creates a HideNonFakeMoveTaskOrdersNotFound with default headers values +func NewHideNonFakeMoveTaskOrdersNotFound() *HideNonFakeMoveTaskOrdersNotFound { + return &HideNonFakeMoveTaskOrdersNotFound{} +} + +/* +HideNonFakeMoveTaskOrdersNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type HideNonFakeMoveTaskOrdersNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders not found response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders not found response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders not found response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders not found response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders not found response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the hide non fake move task orders not found response +func (o *HideNonFakeMoveTaskOrdersNotFound) Code() int { + return 404 +} + +func (o *HideNonFakeMoveTaskOrdersNotFound) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersNotFound %+v", 404, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersNotFound) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersNotFound %+v", 404, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersConflict creates a HideNonFakeMoveTaskOrdersConflict with default headers values +func NewHideNonFakeMoveTaskOrdersConflict() *HideNonFakeMoveTaskOrdersConflict { + return &HideNonFakeMoveTaskOrdersConflict{} +} + +/* +HideNonFakeMoveTaskOrdersConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type HideNonFakeMoveTaskOrdersConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders conflict response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders conflict response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders conflict response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders conflict response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders conflict response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the hide non fake move task orders conflict response +func (o *HideNonFakeMoveTaskOrdersConflict) Code() int { + return 409 +} + +func (o *HideNonFakeMoveTaskOrdersConflict) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersConflict %+v", 409, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersConflict) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersConflict %+v", 409, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersPreconditionFailed creates a HideNonFakeMoveTaskOrdersPreconditionFailed with default headers values +func NewHideNonFakeMoveTaskOrdersPreconditionFailed() *HideNonFakeMoveTaskOrdersPreconditionFailed { + return &HideNonFakeMoveTaskOrdersPreconditionFailed{} +} + +/* +HideNonFakeMoveTaskOrdersPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type HideNonFakeMoveTaskOrdersPreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this hide non fake move task orders precondition failed response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders precondition failed response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders precondition failed response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders precondition failed response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders precondition failed response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the hide non fake move task orders precondition failed response +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) Code() int { + return 412 +} + +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersPreconditionFailed %+v", 412, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersPreconditionFailed %+v", 412, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersUnprocessableEntity creates a HideNonFakeMoveTaskOrdersUnprocessableEntity with default headers values +func NewHideNonFakeMoveTaskOrdersUnprocessableEntity() *HideNonFakeMoveTaskOrdersUnprocessableEntity { + return &HideNonFakeMoveTaskOrdersUnprocessableEntity{} +} + +/* +HideNonFakeMoveTaskOrdersUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type HideNonFakeMoveTaskOrdersUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this hide non fake move task orders unprocessable entity response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders unprocessable entity response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders unprocessable entity response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this hide non fake move task orders unprocessable entity response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this hide non fake move task orders unprocessable entity response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the hide non fake move task orders unprocessable entity response +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) Code() int { + return 422 +} + +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewHideNonFakeMoveTaskOrdersInternalServerError creates a HideNonFakeMoveTaskOrdersInternalServerError with default headers values +func NewHideNonFakeMoveTaskOrdersInternalServerError() *HideNonFakeMoveTaskOrdersInternalServerError { + return &HideNonFakeMoveTaskOrdersInternalServerError{} +} + +/* +HideNonFakeMoveTaskOrdersInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type HideNonFakeMoveTaskOrdersInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this hide non fake move task orders internal server error response has a 2xx status code +func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this hide non fake move task orders internal server error response has a 3xx status code +func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this hide non fake move task orders internal server error response has a 4xx status code +func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this hide non fake move task orders internal server error response has a 5xx status code +func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this hide non fake move task orders internal server error response a status code equal to that given +func (o *HideNonFakeMoveTaskOrdersInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the hide non fake move task orders internal server error response +func (o *HideNonFakeMoveTaskOrdersInternalServerError) Code() int { + return 500 +} + +func (o *HideNonFakeMoveTaskOrdersInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersInternalServerError) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/hide][%d] hideNonFakeMoveTaskOrdersInternalServerError %+v", 500, o.Payload) +} + +func (o *HideNonFakeMoveTaskOrdersInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *HideNonFakeMoveTaskOrdersInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go b/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go new file mode 100644 index 00000000000..152e1d4d21f --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/list_m_t_os_parameters.go @@ -0,0 +1,166 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// NewListMTOsParams creates a new ListMTOsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListMTOsParams() *ListMTOsParams { + return &ListMTOsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListMTOsParamsWithTimeout creates a new ListMTOsParams object +// with the ability to set a timeout on a request. +func NewListMTOsParamsWithTimeout(timeout time.Duration) *ListMTOsParams { + return &ListMTOsParams{ + timeout: timeout, + } +} + +// NewListMTOsParamsWithContext creates a new ListMTOsParams object +// with the ability to set a context for a request. +func NewListMTOsParamsWithContext(ctx context.Context) *ListMTOsParams { + return &ListMTOsParams{ + Context: ctx, + } +} + +// NewListMTOsParamsWithHTTPClient creates a new ListMTOsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListMTOsParamsWithHTTPClient(client *http.Client) *ListMTOsParams { + return &ListMTOsParams{ + HTTPClient: client, + } +} + +/* +ListMTOsParams contains all the parameters to send to the API endpoint + + for the list m t os operation. + + Typically these are written to a http.Request. +*/ +type ListMTOsParams struct { + + /* Since. + + Only return move task orders updated since this time. + + Format: timestamp + */ + Since *int64 + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list m t os params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMTOsParams) WithDefaults() *ListMTOsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list m t os params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMTOsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list m t os params +func (o *ListMTOsParams) WithTimeout(timeout time.Duration) *ListMTOsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list m t os params +func (o *ListMTOsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list m t os params +func (o *ListMTOsParams) WithContext(ctx context.Context) *ListMTOsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list m t os params +func (o *ListMTOsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list m t os params +func (o *ListMTOsParams) WithHTTPClient(client *http.Client) *ListMTOsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list m t os params +func (o *ListMTOsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithSince adds the since to the list m t os params +func (o *ListMTOsParams) WithSince(since *int64) *ListMTOsParams { + o.SetSince(since) + return o +} + +// SetSince adds the since to the list m t os params +func (o *ListMTOsParams) SetSince(since *int64) { + o.Since = since +} + +// WriteToRequest writes these params to a swagger request +func (o *ListMTOsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + if o.Since != nil { + + // query param since + var qrSince int64 + + if o.Since != nil { + qrSince = *o.Since + } + qSince := swag.FormatInt64(qrSince) + if qSince != "" { + + if err := r.SetQueryParam("since", qSince); err != nil { + return err + } + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go b/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go new file mode 100644 index 00000000000..8f622a31f3d --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/list_m_t_os_responses.go @@ -0,0 +1,471 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ListMTOsReader is a Reader for the ListMTOs structure. +type ListMTOsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListMTOsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListMTOsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewListMTOsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewListMTOsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewListMTOsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewListMTOsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewListMTOsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders] listMTOs", response, response.Code()) + } +} + +// NewListMTOsOK creates a ListMTOsOK with default headers values +func NewListMTOsOK() *ListMTOsOK { + return &ListMTOsOK{} +} + +/* +ListMTOsOK describes a response with status code 200, with default header values. + +Successfully retrieved all move task orders. +*/ +type ListMTOsOK struct { + Payload supportmessages.MoveTaskOrders +} + +// IsSuccess returns true when this list m t os o k response has a 2xx status code +func (o *ListMTOsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list m t os o k response has a 3xx status code +func (o *ListMTOsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os o k response has a 4xx status code +func (o *ListMTOsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list m t os o k response has a 5xx status code +func (o *ListMTOsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t os o k response a status code equal to that given +func (o *ListMTOsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list m t os o k response +func (o *ListMTOsOK) Code() int { + return 200 +} + +func (o *ListMTOsOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsOK %+v", 200, o.Payload) +} + +func (o *ListMTOsOK) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsOK %+v", 200, o.Payload) +} + +func (o *ListMTOsOK) GetPayload() supportmessages.MoveTaskOrders { + return o.Payload +} + +func (o *ListMTOsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOsBadRequest creates a ListMTOsBadRequest with default headers values +func NewListMTOsBadRequest() *ListMTOsBadRequest { + return &ListMTOsBadRequest{} +} + +/* +ListMTOsBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type ListMTOsBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t os bad request response has a 2xx status code +func (o *ListMTOsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t os bad request response has a 3xx status code +func (o *ListMTOsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os bad request response has a 4xx status code +func (o *ListMTOsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t os bad request response has a 5xx status code +func (o *ListMTOsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t os bad request response a status code equal to that given +func (o *ListMTOsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the list m t os bad request response +func (o *ListMTOsBadRequest) Code() int { + return 400 +} + +func (o *ListMTOsBadRequest) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsBadRequest %+v", 400, o.Payload) +} + +func (o *ListMTOsBadRequest) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsBadRequest %+v", 400, o.Payload) +} + +func (o *ListMTOsBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOsUnauthorized creates a ListMTOsUnauthorized with default headers values +func NewListMTOsUnauthorized() *ListMTOsUnauthorized { + return &ListMTOsUnauthorized{} +} + +/* +ListMTOsUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type ListMTOsUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t os unauthorized response has a 2xx status code +func (o *ListMTOsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t os unauthorized response has a 3xx status code +func (o *ListMTOsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os unauthorized response has a 4xx status code +func (o *ListMTOsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t os unauthorized response has a 5xx status code +func (o *ListMTOsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t os unauthorized response a status code equal to that given +func (o *ListMTOsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the list m t os unauthorized response +func (o *ListMTOsUnauthorized) Code() int { + return 401 +} + +func (o *ListMTOsUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMTOsUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMTOsUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOsForbidden creates a ListMTOsForbidden with default headers values +func NewListMTOsForbidden() *ListMTOsForbidden { + return &ListMTOsForbidden{} +} + +/* +ListMTOsForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type ListMTOsForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t os forbidden response has a 2xx status code +func (o *ListMTOsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t os forbidden response has a 3xx status code +func (o *ListMTOsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os forbidden response has a 4xx status code +func (o *ListMTOsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t os forbidden response has a 5xx status code +func (o *ListMTOsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t os forbidden response a status code equal to that given +func (o *ListMTOsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the list m t os forbidden response +func (o *ListMTOsForbidden) Code() int { + return 403 +} + +func (o *ListMTOsForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsForbidden %+v", 403, o.Payload) +} + +func (o *ListMTOsForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsForbidden %+v", 403, o.Payload) +} + +func (o *ListMTOsForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOsNotFound creates a ListMTOsNotFound with default headers values +func NewListMTOsNotFound() *ListMTOsNotFound { + return &ListMTOsNotFound{} +} + +/* +ListMTOsNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type ListMTOsNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t os not found response has a 2xx status code +func (o *ListMTOsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t os not found response has a 3xx status code +func (o *ListMTOsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os not found response has a 4xx status code +func (o *ListMTOsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t os not found response has a 5xx status code +func (o *ListMTOsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t os not found response a status code equal to that given +func (o *ListMTOsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the list m t os not found response +func (o *ListMTOsNotFound) Code() int { + return 404 +} + +func (o *ListMTOsNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsNotFound %+v", 404, o.Payload) +} + +func (o *ListMTOsNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsNotFound %+v", 404, o.Payload) +} + +func (o *ListMTOsNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOsInternalServerError creates a ListMTOsInternalServerError with default headers values +func NewListMTOsInternalServerError() *ListMTOsInternalServerError { + return &ListMTOsInternalServerError{} +} + +/* +ListMTOsInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type ListMTOsInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this list m t os internal server error response has a 2xx status code +func (o *ListMTOsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t os internal server error response has a 3xx status code +func (o *ListMTOsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t os internal server error response has a 4xx status code +func (o *ListMTOsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list m t os internal server error response has a 5xx status code +func (o *ListMTOsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list m t os internal server error response a status code equal to that given +func (o *ListMTOsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list m t os internal server error response +func (o *ListMTOsInternalServerError) Code() int { + return 500 +} + +func (o *ListMTOsInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMTOsInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders][%d] listMTOsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMTOsInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *ListMTOsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go new file mode 100644 index 00000000000..765ce898477 --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_parameters.go @@ -0,0 +1,174 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewMakeMoveTaskOrderAvailableParams creates a new MakeMoveTaskOrderAvailableParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewMakeMoveTaskOrderAvailableParams() *MakeMoveTaskOrderAvailableParams { + return &MakeMoveTaskOrderAvailableParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewMakeMoveTaskOrderAvailableParamsWithTimeout creates a new MakeMoveTaskOrderAvailableParams object +// with the ability to set a timeout on a request. +func NewMakeMoveTaskOrderAvailableParamsWithTimeout(timeout time.Duration) *MakeMoveTaskOrderAvailableParams { + return &MakeMoveTaskOrderAvailableParams{ + timeout: timeout, + } +} + +// NewMakeMoveTaskOrderAvailableParamsWithContext creates a new MakeMoveTaskOrderAvailableParams object +// with the ability to set a context for a request. +func NewMakeMoveTaskOrderAvailableParamsWithContext(ctx context.Context) *MakeMoveTaskOrderAvailableParams { + return &MakeMoveTaskOrderAvailableParams{ + Context: ctx, + } +} + +// NewMakeMoveTaskOrderAvailableParamsWithHTTPClient creates a new MakeMoveTaskOrderAvailableParams object +// with the ability to set a custom HTTPClient for a request. +func NewMakeMoveTaskOrderAvailableParamsWithHTTPClient(client *http.Client) *MakeMoveTaskOrderAvailableParams { + return &MakeMoveTaskOrderAvailableParams{ + HTTPClient: client, + } +} + +/* +MakeMoveTaskOrderAvailableParams contains all the parameters to send to the API endpoint + + for the make move task order available operation. + + Typically these are written to a http.Request. +*/ +type MakeMoveTaskOrderAvailableParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + /* MoveTaskOrderID. + + UUID of move task order. + */ + MoveTaskOrderID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the make move task order available params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MakeMoveTaskOrderAvailableParams) WithDefaults() *MakeMoveTaskOrderAvailableParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the make move task order available params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *MakeMoveTaskOrderAvailableParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) WithTimeout(timeout time.Duration) *MakeMoveTaskOrderAvailableParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) WithContext(ctx context.Context) *MakeMoveTaskOrderAvailableParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) WithHTTPClient(client *http.Client) *MakeMoveTaskOrderAvailableParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) WithIfMatch(ifMatch string) *MakeMoveTaskOrderAvailableParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithMoveTaskOrderID adds the moveTaskOrderID to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) WithMoveTaskOrderID(moveTaskOrderID string) *MakeMoveTaskOrderAvailableParams { + o.SetMoveTaskOrderID(moveTaskOrderID) + return o +} + +// SetMoveTaskOrderID adds the moveTaskOrderId to the make move task order available params +func (o *MakeMoveTaskOrderAvailableParams) SetMoveTaskOrderID(moveTaskOrderID string) { + o.MoveTaskOrderID = moveTaskOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *MakeMoveTaskOrderAvailableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + + // path param moveTaskOrderID + if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go new file mode 100644 index 00000000000..8e488681cef --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/make_move_task_order_available_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// MakeMoveTaskOrderAvailableReader is a Reader for the MakeMoveTaskOrderAvailable structure. +type MakeMoveTaskOrderAvailableReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *MakeMoveTaskOrderAvailableReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewMakeMoveTaskOrderAvailableOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewMakeMoveTaskOrderAvailableBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewMakeMoveTaskOrderAvailableUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewMakeMoveTaskOrderAvailableForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewMakeMoveTaskOrderAvailableNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewMakeMoveTaskOrderAvailablePreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewMakeMoveTaskOrderAvailableUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewMakeMoveTaskOrderAvailableInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime] makeMoveTaskOrderAvailable", response, response.Code()) + } +} + +// NewMakeMoveTaskOrderAvailableOK creates a MakeMoveTaskOrderAvailableOK with default headers values +func NewMakeMoveTaskOrderAvailableOK() *MakeMoveTaskOrderAvailableOK { + return &MakeMoveTaskOrderAvailableOK{} +} + +/* +MakeMoveTaskOrderAvailableOK describes a response with status code 200, with default header values. + +Successfully made MTO available to Prime. +*/ +type MakeMoveTaskOrderAvailableOK struct { + Payload *supportmessages.MoveTaskOrder +} + +// IsSuccess returns true when this make move task order available o k response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this make move task order available o k response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available o k response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this make move task order available o k response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableOK) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available o k response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the make move task order available o k response +func (o *MakeMoveTaskOrderAvailableOK) Code() int { + return 200 +} + +func (o *MakeMoveTaskOrderAvailableOK) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableOK %+v", 200, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableOK) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableOK %+v", 200, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableOK) GetPayload() *supportmessages.MoveTaskOrder { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.MoveTaskOrder) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableBadRequest creates a MakeMoveTaskOrderAvailableBadRequest with default headers values +func NewMakeMoveTaskOrderAvailableBadRequest() *MakeMoveTaskOrderAvailableBadRequest { + return &MakeMoveTaskOrderAvailableBadRequest{} +} + +/* +MakeMoveTaskOrderAvailableBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type MakeMoveTaskOrderAvailableBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this make move task order available bad request response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available bad request response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available bad request response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available bad request response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available bad request response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the make move task order available bad request response +func (o *MakeMoveTaskOrderAvailableBadRequest) Code() int { + return 400 +} + +func (o *MakeMoveTaskOrderAvailableBadRequest) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableBadRequest %+v", 400, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableBadRequest) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableBadRequest %+v", 400, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableUnauthorized creates a MakeMoveTaskOrderAvailableUnauthorized with default headers values +func NewMakeMoveTaskOrderAvailableUnauthorized() *MakeMoveTaskOrderAvailableUnauthorized { + return &MakeMoveTaskOrderAvailableUnauthorized{} +} + +/* +MakeMoveTaskOrderAvailableUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type MakeMoveTaskOrderAvailableUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this make move task order available unauthorized response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available unauthorized response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available unauthorized response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available unauthorized response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available unauthorized response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the make move task order available unauthorized response +func (o *MakeMoveTaskOrderAvailableUnauthorized) Code() int { + return 401 +} + +func (o *MakeMoveTaskOrderAvailableUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnauthorized %+v", 401, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableUnauthorized) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnauthorized %+v", 401, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableForbidden creates a MakeMoveTaskOrderAvailableForbidden with default headers values +func NewMakeMoveTaskOrderAvailableForbidden() *MakeMoveTaskOrderAvailableForbidden { + return &MakeMoveTaskOrderAvailableForbidden{} +} + +/* +MakeMoveTaskOrderAvailableForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type MakeMoveTaskOrderAvailableForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this make move task order available forbidden response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available forbidden response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available forbidden response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available forbidden response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available forbidden response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the make move task order available forbidden response +func (o *MakeMoveTaskOrderAvailableForbidden) Code() int { + return 403 +} + +func (o *MakeMoveTaskOrderAvailableForbidden) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableForbidden %+v", 403, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableForbidden) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableForbidden %+v", 403, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableNotFound creates a MakeMoveTaskOrderAvailableNotFound with default headers values +func NewMakeMoveTaskOrderAvailableNotFound() *MakeMoveTaskOrderAvailableNotFound { + return &MakeMoveTaskOrderAvailableNotFound{} +} + +/* +MakeMoveTaskOrderAvailableNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type MakeMoveTaskOrderAvailableNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this make move task order available not found response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available not found response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available not found response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available not found response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available not found response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the make move task order available not found response +func (o *MakeMoveTaskOrderAvailableNotFound) Code() int { + return 404 +} + +func (o *MakeMoveTaskOrderAvailableNotFound) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableNotFound %+v", 404, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableNotFound) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableNotFound %+v", 404, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailablePreconditionFailed creates a MakeMoveTaskOrderAvailablePreconditionFailed with default headers values +func NewMakeMoveTaskOrderAvailablePreconditionFailed() *MakeMoveTaskOrderAvailablePreconditionFailed { + return &MakeMoveTaskOrderAvailablePreconditionFailed{} +} + +/* +MakeMoveTaskOrderAvailablePreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type MakeMoveTaskOrderAvailablePreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this make move task order available precondition failed response has a 2xx status code +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available precondition failed response has a 3xx status code +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available precondition failed response has a 4xx status code +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available precondition failed response has a 5xx status code +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available precondition failed response a status code equal to that given +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the make move task order available precondition failed response +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) Code() int { + return 412 +} + +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailablePreconditionFailed %+v", 412, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailablePreconditionFailed %+v", 412, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailablePreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableUnprocessableEntity creates a MakeMoveTaskOrderAvailableUnprocessableEntity with default headers values +func NewMakeMoveTaskOrderAvailableUnprocessableEntity() *MakeMoveTaskOrderAvailableUnprocessableEntity { + return &MakeMoveTaskOrderAvailableUnprocessableEntity{} +} + +/* +MakeMoveTaskOrderAvailableUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type MakeMoveTaskOrderAvailableUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this make move task order available unprocessable entity response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available unprocessable entity response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available unprocessable entity response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this make move task order available unprocessable entity response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this make move task order available unprocessable entity response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the make move task order available unprocessable entity response +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) Code() int { + return 422 +} + +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewMakeMoveTaskOrderAvailableInternalServerError creates a MakeMoveTaskOrderAvailableInternalServerError with default headers values +func NewMakeMoveTaskOrderAvailableInternalServerError() *MakeMoveTaskOrderAvailableInternalServerError { + return &MakeMoveTaskOrderAvailableInternalServerError{} +} + +/* +MakeMoveTaskOrderAvailableInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type MakeMoveTaskOrderAvailableInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this make move task order available internal server error response has a 2xx status code +func (o *MakeMoveTaskOrderAvailableInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this make move task order available internal server error response has a 3xx status code +func (o *MakeMoveTaskOrderAvailableInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this make move task order available internal server error response has a 4xx status code +func (o *MakeMoveTaskOrderAvailableInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this make move task order available internal server error response has a 5xx status code +func (o *MakeMoveTaskOrderAvailableInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this make move task order available internal server error response a status code equal to that given +func (o *MakeMoveTaskOrderAvailableInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the make move task order available internal server error response +func (o *MakeMoveTaskOrderAvailableInternalServerError) Code() int { + return 500 +} + +func (o *MakeMoveTaskOrderAvailableInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableInternalServerError %+v", 500, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableInternalServerError) String() string { + return fmt.Sprintf("[PATCH /move-task-orders/{moveTaskOrderID}/available-to-prime][%d] makeMoveTaskOrderAvailableInternalServerError %+v", 500, o.Payload) +} + +func (o *MakeMoveTaskOrderAvailableInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *MakeMoveTaskOrderAvailableInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/move_task_order/move_task_order_client.go b/pkg/gen/supportclient/move_task_order/move_task_order_client.go new file mode 100644 index 00000000000..fb46a6a86ba --- /dev/null +++ b/pkg/gen/supportclient/move_task_order/move_task_order_client.go @@ -0,0 +1,278 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package move_task_order + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new move task order API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for move task order API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateMoveTaskOrder(params *CreateMoveTaskOrderParams, opts ...ClientOption) (*CreateMoveTaskOrderCreated, error) + + GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) + + HideNonFakeMoveTaskOrders(params *HideNonFakeMoveTaskOrdersParams, opts ...ClientOption) (*HideNonFakeMoveTaskOrdersOK, error) + + ListMTOs(params *ListMTOsParams, opts ...ClientOption) (*ListMTOsOK, error) + + MakeMoveTaskOrderAvailable(params *MakeMoveTaskOrderAvailableParams, opts ...ClientOption) (*MakeMoveTaskOrderAvailableOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + CreateMoveTaskOrder creates move task order + + Creates an instance of moveTaskOrder. + +Currently this will also create a number of nested objects but not all. +It will currently create +* MoveTaskOrder +* Order +* Customer +* User +* Entitlement + +It will not create addresses, duty stations, shipments, payment requests or service items. It requires an existing contractor ID, destination duty station ID, +origin duty station ID, and an uploaded orders ID to be passed into the request. + +This is a support endpoint and will not be available in production. +*/ +func (a *Client) CreateMoveTaskOrder(params *CreateMoveTaskOrderParams, opts ...ClientOption) (*CreateMoveTaskOrderCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateMoveTaskOrderParams() + } + op := &runtime.ClientOperation{ + ID: "createMoveTaskOrder", + Method: "POST", + PathPattern: "/move-task-orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateMoveTaskOrderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateMoveTaskOrderCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + GetMoveTaskOrder gets move task order + + ### Functionality + +This endpoint gets an individual MoveTaskOrder by ID. + +It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. + +This is a support endpoint and is not available in production. +*/ +func (a *Client) GetMoveTaskOrder(params *GetMoveTaskOrderParams, opts ...ClientOption) (*GetMoveTaskOrderOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetMoveTaskOrderParams() + } + op := &runtime.ClientOperation{ + ID: "getMoveTaskOrder", + Method: "GET", + PathPattern: "/move-task-orders/{moveTaskOrderID}", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetMoveTaskOrderReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetMoveTaskOrderOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getMoveTaskOrder: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + HideNonFakeMoveTaskOrders hides non fake move task orders + + Updates move task order without fake user data `show` to false. No request body required.
+ +
+This is a support endpoint and will not be available in production. +*/ +func (a *Client) HideNonFakeMoveTaskOrders(params *HideNonFakeMoveTaskOrdersParams, opts ...ClientOption) (*HideNonFakeMoveTaskOrdersOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewHideNonFakeMoveTaskOrdersParams() + } + op := &runtime.ClientOperation{ + ID: "hideNonFakeMoveTaskOrders", + Method: "PATCH", + PathPattern: "/move-task-orders/hide", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &HideNonFakeMoveTaskOrdersReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*HideNonFakeMoveTaskOrdersOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for hideNonFakeMoveTaskOrders: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListMTOs lists m t os + + ### Functionality + +This endpoint lists all MoveTaskOrders regardless of whether or not they have been made available to Prime. + +It will provide nested information about the Customer and any associated MTOShipments, MTOServiceItems and PaymentRequests. +*/ +func (a *Client) ListMTOs(params *ListMTOsParams, opts ...ClientOption) (*ListMTOsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListMTOsParams() + } + op := &runtime.ClientOperation{ + ID: "listMTOs", + Method: "GET", + PathPattern: "/move-task-orders", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListMTOsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListMTOsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listMTOs: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + MakeMoveTaskOrderAvailable makes move task order available + + Updates move task order `availableToPrimeAt` to make it available to prime. No request body required.
+ +
+This is a support endpoint and will not be available in production. +*/ +func (a *Client) MakeMoveTaskOrderAvailable(params *MakeMoveTaskOrderAvailableParams, opts ...ClientOption) (*MakeMoveTaskOrderAvailableOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewMakeMoveTaskOrderAvailableParams() + } + op := &runtime.ClientOperation{ + ID: "makeMoveTaskOrderAvailable", + Method: "PATCH", + PathPattern: "/move-task-orders/{moveTaskOrderID}/available-to-prime", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &MakeMoveTaskOrderAvailableReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*MakeMoveTaskOrderAvailableOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for makeMoveTaskOrderAvailable: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go b/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go new file mode 100644 index 00000000000..43ba2309d44 --- /dev/null +++ b/pkg/gen/supportclient/mto_service_item/mto_service_item_client.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto service item API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto service item API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + UpdateMTOServiceItemStatus(params *UpdateMTOServiceItemStatusParams, opts ...ClientOption) (*UpdateMTOServiceItemStatusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + UpdateMTOServiceItemStatus updates m t o service item status + + Updates the status of a service item for a move to APPROVED or REJECTED.
+ +
+This is a support endpoint and will not be available in production. +*/ +func (a *Client) UpdateMTOServiceItemStatus(params *UpdateMTOServiceItemStatusParams, opts ...ClientOption) (*UpdateMTOServiceItemStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOServiceItemStatusParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOServiceItemStatus", + Method: "PATCH", + PathPattern: "/mto-service-items/{mtoServiceItemID}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOServiceItemStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOServiceItemStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOServiceItemStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go new file mode 100644 index 00000000000..b8fd5908aaf --- /dev/null +++ b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_parameters.go @@ -0,0 +1,195 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdateMTOServiceItemStatusParams creates a new UpdateMTOServiceItemStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOServiceItemStatusParams() *UpdateMTOServiceItemStatusParams { + return &UpdateMTOServiceItemStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOServiceItemStatusParamsWithTimeout creates a new UpdateMTOServiceItemStatusParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOServiceItemStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOServiceItemStatusParams { + return &UpdateMTOServiceItemStatusParams{ + timeout: timeout, + } +} + +// NewUpdateMTOServiceItemStatusParamsWithContext creates a new UpdateMTOServiceItemStatusParams object +// with the ability to set a context for a request. +func NewUpdateMTOServiceItemStatusParamsWithContext(ctx context.Context) *UpdateMTOServiceItemStatusParams { + return &UpdateMTOServiceItemStatusParams{ + Context: ctx, + } +} + +// NewUpdateMTOServiceItemStatusParamsWithHTTPClient creates a new UpdateMTOServiceItemStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOServiceItemStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOServiceItemStatusParams { + return &UpdateMTOServiceItemStatusParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOServiceItemStatusParams contains all the parameters to send to the API endpoint + + for the update m t o service item status operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOServiceItemStatusParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *supportmessages.UpdateMTOServiceItemStatus + + /* MtoServiceItemID. + + UUID of mto service item to use. + */ + MtoServiceItemID string + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o service item status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOServiceItemStatusParams) WithDefaults() *UpdateMTOServiceItemStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o service item status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOServiceItemStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOServiceItemStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithContext(ctx context.Context) *UpdateMTOServiceItemStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOServiceItemStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithIfMatch(ifMatch string) *UpdateMTOServiceItemStatusParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithBody(body *supportmessages.UpdateMTOServiceItemStatus) *UpdateMTOServiceItemStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetBody(body *supportmessages.UpdateMTOServiceItemStatus) { + o.Body = body +} + +// WithMtoServiceItemID adds the mtoServiceItemID to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) WithMtoServiceItemID(mtoServiceItemID string) *UpdateMTOServiceItemStatusParams { + o.SetMtoServiceItemID(mtoServiceItemID) + return o +} + +// SetMtoServiceItemID adds the mtoServiceItemId to the update m t o service item status params +func (o *UpdateMTOServiceItemStatusParams) SetMtoServiceItemID(mtoServiceItemID string) { + o.MtoServiceItemID = mtoServiceItemID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOServiceItemStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoServiceItemID + if err := r.SetPathParam("mtoServiceItemID", o.MtoServiceItemID); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go new file mode 100644 index 00000000000..cd3f6ec6339 --- /dev/null +++ b/pkg/gen/supportclient/mto_service_item/update_m_t_o_service_item_status_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_service_item + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdateMTOServiceItemStatusReader is a Reader for the UpdateMTOServiceItemStatus structure. +type UpdateMTOServiceItemStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOServiceItemStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOServiceItemStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOServiceItemStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOServiceItemStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOServiceItemStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOServiceItemStatusNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOServiceItemStatusConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOServiceItemStatusPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOServiceItemStatusUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOServiceItemStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-service-items/{mtoServiceItemID}/status] updateMTOServiceItemStatus", response, response.Code()) + } +} + +// NewUpdateMTOServiceItemStatusOK creates a UpdateMTOServiceItemStatusOK with default headers values +func NewUpdateMTOServiceItemStatusOK() *UpdateMTOServiceItemStatusOK { + return &UpdateMTOServiceItemStatusOK{} +} + +/* +UpdateMTOServiceItemStatusOK describes a response with status code 200, with default header values. + +Successfully updated service item status for a move task order. +*/ +type UpdateMTOServiceItemStatusOK struct { + Payload supportmessages.MTOServiceItem +} + +// IsSuccess returns true when this update m t o service item status o k response has a 2xx status code +func (o *UpdateMTOServiceItemStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o service item status o k response has a 3xx status code +func (o *UpdateMTOServiceItemStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status o k response has a 4xx status code +func (o *UpdateMTOServiceItemStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o service item status o k response has a 5xx status code +func (o *UpdateMTOServiceItemStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status o k response a status code equal to that given +func (o *UpdateMTOServiceItemStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o service item status o k response +func (o *UpdateMTOServiceItemStatusOK) Code() int { + return 200 +} + +func (o *UpdateMTOServiceItemStatusOK) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusOK) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusOK) GetPayload() supportmessages.MTOServiceItem { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload as interface type + payload, err := supportmessages.UnmarshalMTOServiceItem(response.Body(), consumer) + if err != nil { + return err + } + o.Payload = payload + + return nil +} + +// NewUpdateMTOServiceItemStatusBadRequest creates a UpdateMTOServiceItemStatusBadRequest with default headers values +func NewUpdateMTOServiceItemStatusBadRequest() *UpdateMTOServiceItemStatusBadRequest { + return &UpdateMTOServiceItemStatusBadRequest{} +} + +/* +UpdateMTOServiceItemStatusBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOServiceItemStatusBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status bad request response has a 2xx status code +func (o *UpdateMTOServiceItemStatusBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status bad request response has a 3xx status code +func (o *UpdateMTOServiceItemStatusBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status bad request response has a 4xx status code +func (o *UpdateMTOServiceItemStatusBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status bad request response has a 5xx status code +func (o *UpdateMTOServiceItemStatusBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status bad request response a status code equal to that given +func (o *UpdateMTOServiceItemStatusBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o service item status bad request response +func (o *UpdateMTOServiceItemStatusBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOServiceItemStatusBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusUnauthorized creates a UpdateMTOServiceItemStatusUnauthorized with default headers values +func NewUpdateMTOServiceItemStatusUnauthorized() *UpdateMTOServiceItemStatusUnauthorized { + return &UpdateMTOServiceItemStatusUnauthorized{} +} + +/* +UpdateMTOServiceItemStatusUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOServiceItemStatusUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status unauthorized response has a 2xx status code +func (o *UpdateMTOServiceItemStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status unauthorized response has a 3xx status code +func (o *UpdateMTOServiceItemStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status unauthorized response has a 4xx status code +func (o *UpdateMTOServiceItemStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status unauthorized response has a 5xx status code +func (o *UpdateMTOServiceItemStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status unauthorized response a status code equal to that given +func (o *UpdateMTOServiceItemStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o service item status unauthorized response +func (o *UpdateMTOServiceItemStatusUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOServiceItemStatusUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusForbidden creates a UpdateMTOServiceItemStatusForbidden with default headers values +func NewUpdateMTOServiceItemStatusForbidden() *UpdateMTOServiceItemStatusForbidden { + return &UpdateMTOServiceItemStatusForbidden{} +} + +/* +UpdateMTOServiceItemStatusForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOServiceItemStatusForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status forbidden response has a 2xx status code +func (o *UpdateMTOServiceItemStatusForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status forbidden response has a 3xx status code +func (o *UpdateMTOServiceItemStatusForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status forbidden response has a 4xx status code +func (o *UpdateMTOServiceItemStatusForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status forbidden response has a 5xx status code +func (o *UpdateMTOServiceItemStatusForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status forbidden response a status code equal to that given +func (o *UpdateMTOServiceItemStatusForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o service item status forbidden response +func (o *UpdateMTOServiceItemStatusForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOServiceItemStatusForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusNotFound creates a UpdateMTOServiceItemStatusNotFound with default headers values +func NewUpdateMTOServiceItemStatusNotFound() *UpdateMTOServiceItemStatusNotFound { + return &UpdateMTOServiceItemStatusNotFound{} +} + +/* +UpdateMTOServiceItemStatusNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOServiceItemStatusNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status not found response has a 2xx status code +func (o *UpdateMTOServiceItemStatusNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status not found response has a 3xx status code +func (o *UpdateMTOServiceItemStatusNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status not found response has a 4xx status code +func (o *UpdateMTOServiceItemStatusNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status not found response has a 5xx status code +func (o *UpdateMTOServiceItemStatusNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status not found response a status code equal to that given +func (o *UpdateMTOServiceItemStatusNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o service item status not found response +func (o *UpdateMTOServiceItemStatusNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOServiceItemStatusNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusConflict creates a UpdateMTOServiceItemStatusConflict with default headers values +func NewUpdateMTOServiceItemStatusConflict() *UpdateMTOServiceItemStatusConflict { + return &UpdateMTOServiceItemStatusConflict{} +} + +/* +UpdateMTOServiceItemStatusConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type UpdateMTOServiceItemStatusConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status conflict response has a 2xx status code +func (o *UpdateMTOServiceItemStatusConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status conflict response has a 3xx status code +func (o *UpdateMTOServiceItemStatusConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status conflict response has a 4xx status code +func (o *UpdateMTOServiceItemStatusConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status conflict response has a 5xx status code +func (o *UpdateMTOServiceItemStatusConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status conflict response a status code equal to that given +func (o *UpdateMTOServiceItemStatusConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o service item status conflict response +func (o *UpdateMTOServiceItemStatusConflict) Code() int { + return 409 +} + +func (o *UpdateMTOServiceItemStatusConflict) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusConflict) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusPreconditionFailed creates a UpdateMTOServiceItemStatusPreconditionFailed with default headers values +func NewUpdateMTOServiceItemStatusPreconditionFailed() *UpdateMTOServiceItemStatusPreconditionFailed { + return &UpdateMTOServiceItemStatusPreconditionFailed{} +} + +/* +UpdateMTOServiceItemStatusPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOServiceItemStatusPreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o service item status precondition failed response has a 2xx status code +func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status precondition failed response has a 3xx status code +func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status precondition failed response has a 4xx status code +func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status precondition failed response has a 5xx status code +func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status precondition failed response a status code equal to that given +func (o *UpdateMTOServiceItemStatusPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o service item status precondition failed response +func (o *UpdateMTOServiceItemStatusPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOServiceItemStatusPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusUnprocessableEntity creates a UpdateMTOServiceItemStatusUnprocessableEntity with default headers values +func NewUpdateMTOServiceItemStatusUnprocessableEntity() *UpdateMTOServiceItemStatusUnprocessableEntity { + return &UpdateMTOServiceItemStatusUnprocessableEntity{} +} + +/* +UpdateMTOServiceItemStatusUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type UpdateMTOServiceItemStatusUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this update m t o service item status unprocessable entity response has a 2xx status code +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status unprocessable entity response has a 3xx status code +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status unprocessable entity response has a 4xx status code +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o service item status unprocessable entity response has a 5xx status code +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o service item status unprocessable entity response a status code equal to that given +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o service item status unprocessable entity response +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOServiceItemStatusInternalServerError creates a UpdateMTOServiceItemStatusInternalServerError with default headers values +func NewUpdateMTOServiceItemStatusInternalServerError() *UpdateMTOServiceItemStatusInternalServerError { + return &UpdateMTOServiceItemStatusInternalServerError{} +} + +/* +UpdateMTOServiceItemStatusInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOServiceItemStatusInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this update m t o service item status internal server error response has a 2xx status code +func (o *UpdateMTOServiceItemStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o service item status internal server error response has a 3xx status code +func (o *UpdateMTOServiceItemStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o service item status internal server error response has a 4xx status code +func (o *UpdateMTOServiceItemStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o service item status internal server error response has a 5xx status code +func (o *UpdateMTOServiceItemStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o service item status internal server error response a status code equal to that given +func (o *UpdateMTOServiceItemStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o service item status internal server error response +func (o *UpdateMTOServiceItemStatusInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOServiceItemStatusInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-service-items/{mtoServiceItemID}/status][%d] updateMTOServiceItemStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOServiceItemStatusInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *UpdateMTOServiceItemStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go b/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go new file mode 100644 index 00000000000..b61940f4c96 --- /dev/null +++ b/pkg/gen/supportclient/mto_shipment/mto_shipment_client.go @@ -0,0 +1,81 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new mto shipment API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for mto shipment API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +UpdateMTOShipmentStatus updates m t o shipment status + +Updates a shipment's status to APPROVED or REJECTED for the purpose of testing the Prime API. If APPROVED, `rejectionReason` should be blank and any value passed through the body will be ignored. If REJECTED, a value in `rejectionReason` is required.

This is a support endpoint and will not be available in production. +*/ +func (a *Client) UpdateMTOShipmentStatus(params *UpdateMTOShipmentStatusParams, opts ...ClientOption) (*UpdateMTOShipmentStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdateMTOShipmentStatusParams() + } + op := &runtime.ClientOperation{ + ID: "updateMTOShipmentStatus", + Method: "PATCH", + PathPattern: "/mto-shipments/{mtoShipmentID}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdateMTOShipmentStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdateMTOShipmentStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updateMTOShipmentStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go new file mode 100644 index 00000000000..5b7ddf4db0c --- /dev/null +++ b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdateMTOShipmentStatusParams creates a new UpdateMTOShipmentStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdateMTOShipmentStatusParams() *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdateMTOShipmentStatusParamsWithTimeout creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a timeout on a request. +func NewUpdateMTOShipmentStatusParamsWithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + timeout: timeout, + } +} + +// NewUpdateMTOShipmentStatusParamsWithContext creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a context for a request. +func NewUpdateMTOShipmentStatusParamsWithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + Context: ctx, + } +} + +// NewUpdateMTOShipmentStatusParamsWithHTTPClient creates a new UpdateMTOShipmentStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdateMTOShipmentStatusParamsWithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { + return &UpdateMTOShipmentStatusParams{ + HTTPClient: client, + } +} + +/* +UpdateMTOShipmentStatusParams contains all the parameters to send to the API endpoint + + for the update m t o shipment status operation. + + Typically these are written to a http.Request. +*/ +type UpdateMTOShipmentStatusParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *supportmessages.UpdateMTOShipmentStatus + + /* MtoShipmentID. + + UUID of the shipment being updated. + + Format: uuid + */ + MtoShipmentID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update m t o shipment status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentStatusParams) WithDefaults() *UpdateMTOShipmentStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update m t o shipment status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdateMTOShipmentStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithTimeout(timeout time.Duration) *UpdateMTOShipmentStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithContext(ctx context.Context) *UpdateMTOShipmentStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithHTTPClient(client *http.Client) *UpdateMTOShipmentStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithIfMatch(ifMatch string) *UpdateMTOShipmentStatusParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithBody(body *supportmessages.UpdateMTOShipmentStatus) *UpdateMTOShipmentStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetBody(body *supportmessages.UpdateMTOShipmentStatus) { + o.Body = body +} + +// WithMtoShipmentID adds the mtoShipmentID to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) WithMtoShipmentID(mtoShipmentID strfmt.UUID) *UpdateMTOShipmentStatusParams { + o.SetMtoShipmentID(mtoShipmentID) + return o +} + +// SetMtoShipmentID adds the mtoShipmentId to the update m t o shipment status params +func (o *UpdateMTOShipmentStatusParams) SetMtoShipmentID(mtoShipmentID strfmt.UUID) { + o.MtoShipmentID = mtoShipmentID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdateMTOShipmentStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param mtoShipmentID + if err := r.SetPathParam("mtoShipmentID", o.MtoShipmentID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go new file mode 100644 index 00000000000..943de2db2d9 --- /dev/null +++ b/pkg/gen/supportclient/mto_shipment/update_m_t_o_shipment_status_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package mto_shipment + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdateMTOShipmentStatusReader is a Reader for the UpdateMTOShipmentStatus structure. +type UpdateMTOShipmentStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdateMTOShipmentStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdateMTOShipmentStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdateMTOShipmentStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdateMTOShipmentStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdateMTOShipmentStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdateMTOShipmentStatusNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdateMTOShipmentStatusConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdateMTOShipmentStatusPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdateMTOShipmentStatusUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdateMTOShipmentStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /mto-shipments/{mtoShipmentID}/status] updateMTOShipmentStatus", response, response.Code()) + } +} + +// NewUpdateMTOShipmentStatusOK creates a UpdateMTOShipmentStatusOK with default headers values +func NewUpdateMTOShipmentStatusOK() *UpdateMTOShipmentStatusOK { + return &UpdateMTOShipmentStatusOK{} +} + +/* +UpdateMTOShipmentStatusOK describes a response with status code 200, with default header values. + +Successfully updated the shipment's status. +*/ +type UpdateMTOShipmentStatusOK struct { + Payload *supportmessages.MTOShipment +} + +// IsSuccess returns true when this update m t o shipment status o k response has a 2xx status code +func (o *UpdateMTOShipmentStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update m t o shipment status o k response has a 3xx status code +func (o *UpdateMTOShipmentStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status o k response has a 4xx status code +func (o *UpdateMTOShipmentStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment status o k response has a 5xx status code +func (o *UpdateMTOShipmentStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status o k response a status code equal to that given +func (o *UpdateMTOShipmentStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update m t o shipment status o k response +func (o *UpdateMTOShipmentStatusOK) Code() int { + return 200 +} + +func (o *UpdateMTOShipmentStatusOK) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentStatusOK) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusOK %+v", 200, o.Payload) +} + +func (o *UpdateMTOShipmentStatusOK) GetPayload() *supportmessages.MTOShipment { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.MTOShipment) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusBadRequest creates a UpdateMTOShipmentStatusBadRequest with default headers values +func NewUpdateMTOShipmentStatusBadRequest() *UpdateMTOShipmentStatusBadRequest { + return &UpdateMTOShipmentStatusBadRequest{} +} + +/* +UpdateMTOShipmentStatusBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdateMTOShipmentStatusBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status bad request response has a 2xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status bad request response has a 3xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status bad request response has a 4xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status bad request response has a 5xx status code +func (o *UpdateMTOShipmentStatusBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status bad request response a status code equal to that given +func (o *UpdateMTOShipmentStatusBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update m t o shipment status bad request response +func (o *UpdateMTOShipmentStatusBadRequest) Code() int { + return 400 +} + +func (o *UpdateMTOShipmentStatusBadRequest) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentStatusBadRequest) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdateMTOShipmentStatusBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusUnauthorized creates a UpdateMTOShipmentStatusUnauthorized with default headers values +func NewUpdateMTOShipmentStatusUnauthorized() *UpdateMTOShipmentStatusUnauthorized { + return &UpdateMTOShipmentStatusUnauthorized{} +} + +/* +UpdateMTOShipmentStatusUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentStatusUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status unauthorized response has a 2xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status unauthorized response has a 3xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status unauthorized response has a 4xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status unauthorized response has a 5xx status code +func (o *UpdateMTOShipmentStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status unauthorized response a status code equal to that given +func (o *UpdateMTOShipmentStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update m t o shipment status unauthorized response +func (o *UpdateMTOShipmentStatusUnauthorized) Code() int { + return 401 +} + +func (o *UpdateMTOShipmentStatusUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnauthorized) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusForbidden creates a UpdateMTOShipmentStatusForbidden with default headers values +func NewUpdateMTOShipmentStatusForbidden() *UpdateMTOShipmentStatusForbidden { + return &UpdateMTOShipmentStatusForbidden{} +} + +/* +UpdateMTOShipmentStatusForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdateMTOShipmentStatusForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status forbidden response has a 2xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status forbidden response has a 3xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status forbidden response has a 4xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status forbidden response has a 5xx status code +func (o *UpdateMTOShipmentStatusForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status forbidden response a status code equal to that given +func (o *UpdateMTOShipmentStatusForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update m t o shipment status forbidden response +func (o *UpdateMTOShipmentStatusForbidden) Code() int { + return 403 +} + +func (o *UpdateMTOShipmentStatusForbidden) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentStatusForbidden) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdateMTOShipmentStatusForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusNotFound creates a UpdateMTOShipmentStatusNotFound with default headers values +func NewUpdateMTOShipmentStatusNotFound() *UpdateMTOShipmentStatusNotFound { + return &UpdateMTOShipmentStatusNotFound{} +} + +/* +UpdateMTOShipmentStatusNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdateMTOShipmentStatusNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status not found response has a 2xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status not found response has a 3xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status not found response has a 4xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status not found response has a 5xx status code +func (o *UpdateMTOShipmentStatusNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status not found response a status code equal to that given +func (o *UpdateMTOShipmentStatusNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update m t o shipment status not found response +func (o *UpdateMTOShipmentStatusNotFound) Code() int { + return 404 +} + +func (o *UpdateMTOShipmentStatusNotFound) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentStatusNotFound) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdateMTOShipmentStatusNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusConflict creates a UpdateMTOShipmentStatusConflict with default headers values +func NewUpdateMTOShipmentStatusConflict() *UpdateMTOShipmentStatusConflict { + return &UpdateMTOShipmentStatusConflict{} +} + +/* +UpdateMTOShipmentStatusConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type UpdateMTOShipmentStatusConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status conflict response has a 2xx status code +func (o *UpdateMTOShipmentStatusConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status conflict response has a 3xx status code +func (o *UpdateMTOShipmentStatusConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status conflict response has a 4xx status code +func (o *UpdateMTOShipmentStatusConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status conflict response has a 5xx status code +func (o *UpdateMTOShipmentStatusConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status conflict response a status code equal to that given +func (o *UpdateMTOShipmentStatusConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update m t o shipment status conflict response +func (o *UpdateMTOShipmentStatusConflict) Code() int { + return 409 +} + +func (o *UpdateMTOShipmentStatusConflict) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentStatusConflict) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdateMTOShipmentStatusConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusPreconditionFailed creates a UpdateMTOShipmentStatusPreconditionFailed with default headers values +func NewUpdateMTOShipmentStatusPreconditionFailed() *UpdateMTOShipmentStatusPreconditionFailed { + return &UpdateMTOShipmentStatusPreconditionFailed{} +} + +/* +UpdateMTOShipmentStatusPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdateMTOShipmentStatusPreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update m t o shipment status precondition failed response has a 2xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status precondition failed response has a 3xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status precondition failed response has a 4xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status precondition failed response has a 5xx status code +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status precondition failed response a status code equal to that given +func (o *UpdateMTOShipmentStatusPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update m t o shipment status precondition failed response +func (o *UpdateMTOShipmentStatusPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusUnprocessableEntity creates a UpdateMTOShipmentStatusUnprocessableEntity with default headers values +func NewUpdateMTOShipmentStatusUnprocessableEntity() *UpdateMTOShipmentStatusUnprocessableEntity { + return &UpdateMTOShipmentStatusUnprocessableEntity{} +} + +/* +UpdateMTOShipmentStatusUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type UpdateMTOShipmentStatusUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this update m t o shipment status unprocessable entity response has a 2xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status unprocessable entity response has a 3xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status unprocessable entity response has a 4xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update m t o shipment status unprocessable entity response has a 5xx status code +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update m t o shipment status unprocessable entity response a status code equal to that given +func (o *UpdateMTOShipmentStatusUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update m t o shipment status unprocessable entity response +func (o *UpdateMTOShipmentStatusUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdateMTOShipmentStatusInternalServerError creates a UpdateMTOShipmentStatusInternalServerError with default headers values +func NewUpdateMTOShipmentStatusInternalServerError() *UpdateMTOShipmentStatusInternalServerError { + return &UpdateMTOShipmentStatusInternalServerError{} +} + +/* +UpdateMTOShipmentStatusInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdateMTOShipmentStatusInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this update m t o shipment status internal server error response has a 2xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update m t o shipment status internal server error response has a 3xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update m t o shipment status internal server error response has a 4xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update m t o shipment status internal server error response has a 5xx status code +func (o *UpdateMTOShipmentStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update m t o shipment status internal server error response a status code equal to that given +func (o *UpdateMTOShipmentStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update m t o shipment status internal server error response +func (o *UpdateMTOShipmentStatusInternalServerError) Code() int { + return 500 +} + +func (o *UpdateMTOShipmentStatusInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentStatusInternalServerError) String() string { + return fmt.Sprintf("[PATCH /mto-shipments/{mtoShipmentID}/status][%d] updateMTOShipmentStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdateMTOShipmentStatusInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *UpdateMTOShipmentStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/mymove_client.go b/pkg/gen/supportclient/mymove_client.go new file mode 100644 index 00000000000..4df4df28067 --- /dev/null +++ b/pkg/gen/supportclient/mymove_client.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportclient + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "github.com/go-openapi/runtime" + httptransport "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportclient/move_task_order" + "github.com/transcom/mymove/pkg/gen/supportclient/mto_service_item" + "github.com/transcom/mymove/pkg/gen/supportclient/mto_shipment" + "github.com/transcom/mymove/pkg/gen/supportclient/payment_request" + "github.com/transcom/mymove/pkg/gen/supportclient/webhook" +) + +// Default mymove HTTP client. +var Default = NewHTTPClient(nil) + +const ( + // DefaultHost is the default Host + // found in Meta (info) section of spec file + DefaultHost string = "localhost" + // DefaultBasePath is the default BasePath + // found in Meta (info) section of spec file + DefaultBasePath string = "/support/v1" +) + +// DefaultSchemes are the default schemes found in Meta (info) section of spec file +var DefaultSchemes = []string{"http"} + +// NewHTTPClient creates a new mymove HTTP client. +func NewHTTPClient(formats strfmt.Registry) *Mymove { + return NewHTTPClientWithConfig(formats, nil) +} + +// NewHTTPClientWithConfig creates a new mymove HTTP client, +// using a customizable transport config. +func NewHTTPClientWithConfig(formats strfmt.Registry, cfg *TransportConfig) *Mymove { + // ensure nullable parameters have default + if cfg == nil { + cfg = DefaultTransportConfig() + } + + // create transport and client + transport := httptransport.New(cfg.Host, cfg.BasePath, cfg.Schemes) + return New(transport, formats) +} + +// New creates a new mymove client +func New(transport runtime.ClientTransport, formats strfmt.Registry) *Mymove { + // ensure nullable parameters have default + if formats == nil { + formats = strfmt.Default + } + + cli := new(Mymove) + cli.Transport = transport + cli.MoveTaskOrder = move_task_order.New(transport, formats) + cli.MtoServiceItem = mto_service_item.New(transport, formats) + cli.MtoShipment = mto_shipment.New(transport, formats) + cli.PaymentRequest = payment_request.New(transport, formats) + cli.Webhook = webhook.New(transport, formats) + return cli +} + +// DefaultTransportConfig creates a TransportConfig with the +// default settings taken from the meta section of the spec file. +func DefaultTransportConfig() *TransportConfig { + return &TransportConfig{ + Host: DefaultHost, + BasePath: DefaultBasePath, + Schemes: DefaultSchemes, + } +} + +// TransportConfig contains the transport related info, +// found in the meta section of the spec file. +type TransportConfig struct { + Host string + BasePath string + Schemes []string +} + +// WithHost overrides the default host, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithHost(host string) *TransportConfig { + cfg.Host = host + return cfg +} + +// WithBasePath overrides the default basePath, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithBasePath(basePath string) *TransportConfig { + cfg.BasePath = basePath + return cfg +} + +// WithSchemes overrides the default schemes, +// provided by the meta section of the spec file. +func (cfg *TransportConfig) WithSchemes(schemes []string) *TransportConfig { + cfg.Schemes = schemes + return cfg +} + +// Mymove is a client for mymove +type Mymove struct { + MoveTaskOrder move_task_order.ClientService + + MtoServiceItem mto_service_item.ClientService + + MtoShipment mto_shipment.ClientService + + PaymentRequest payment_request.ClientService + + Webhook webhook.ClientService + + Transport runtime.ClientTransport +} + +// SetTransport changes the transport on the client and all its subresources +func (c *Mymove) SetTransport(transport runtime.ClientTransport) { + c.Transport = transport + c.MoveTaskOrder.SetTransport(transport) + c.MtoServiceItem.SetTransport(transport) + c.MtoShipment.SetTransport(transport) + c.PaymentRequest.SetTransport(transport) + c.Webhook.SetTransport(transport) +} diff --git a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go new file mode 100644 index 00000000000..d4632c91481 --- /dev/null +++ b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewGetPaymentRequestEDIParams creates a new GetPaymentRequestEDIParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewGetPaymentRequestEDIParams() *GetPaymentRequestEDIParams { + return &GetPaymentRequestEDIParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewGetPaymentRequestEDIParamsWithTimeout creates a new GetPaymentRequestEDIParams object +// with the ability to set a timeout on a request. +func NewGetPaymentRequestEDIParamsWithTimeout(timeout time.Duration) *GetPaymentRequestEDIParams { + return &GetPaymentRequestEDIParams{ + timeout: timeout, + } +} + +// NewGetPaymentRequestEDIParamsWithContext creates a new GetPaymentRequestEDIParams object +// with the ability to set a context for a request. +func NewGetPaymentRequestEDIParamsWithContext(ctx context.Context) *GetPaymentRequestEDIParams { + return &GetPaymentRequestEDIParams{ + Context: ctx, + } +} + +// NewGetPaymentRequestEDIParamsWithHTTPClient creates a new GetPaymentRequestEDIParams object +// with the ability to set a custom HTTPClient for a request. +func NewGetPaymentRequestEDIParamsWithHTTPClient(client *http.Client) *GetPaymentRequestEDIParams { + return &GetPaymentRequestEDIParams{ + HTTPClient: client, + } +} + +/* +GetPaymentRequestEDIParams contains all the parameters to send to the API endpoint + + for the get payment request e d i operation. + + Typically these are written to a http.Request. +*/ +type GetPaymentRequestEDIParams struct { + + /* PaymentRequestID. + + UUID of the payment request for which EDI should be generated. + + Format: uuid + */ + PaymentRequestID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the get payment request e d i params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPaymentRequestEDIParams) WithDefaults() *GetPaymentRequestEDIParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the get payment request e d i params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *GetPaymentRequestEDIParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) WithTimeout(timeout time.Duration) *GetPaymentRequestEDIParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) WithContext(ctx context.Context) *GetPaymentRequestEDIParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) WithHTTPClient(client *http.Client) *GetPaymentRequestEDIParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaymentRequestID adds the paymentRequestID to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *GetPaymentRequestEDIParams { + o.SetPaymentRequestID(paymentRequestID) + return o +} + +// SetPaymentRequestID adds the paymentRequestId to the get payment request e d i params +func (o *GetPaymentRequestEDIParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { + o.PaymentRequestID = paymentRequestID +} + +// WriteToRequest writes these params to a swagger request +func (o *GetPaymentRequestEDIParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param paymentRequestID + if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go new file mode 100644 index 00000000000..cec8b4f5b7e --- /dev/null +++ b/pkg/gen/supportclient/payment_request/get_payment_request_e_d_i_responses.go @@ -0,0 +1,621 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// GetPaymentRequestEDIReader is a Reader for the GetPaymentRequestEDI structure. +type GetPaymentRequestEDIReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *GetPaymentRequestEDIReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewGetPaymentRequestEDIOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewGetPaymentRequestEDIBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewGetPaymentRequestEDIUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewGetPaymentRequestEDIForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewGetPaymentRequestEDINotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewGetPaymentRequestEDIConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewGetPaymentRequestEDIUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewGetPaymentRequestEDIInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /payment-requests/{paymentRequestID}/edi] getPaymentRequestEDI", response, response.Code()) + } +} + +// NewGetPaymentRequestEDIOK creates a GetPaymentRequestEDIOK with default headers values +func NewGetPaymentRequestEDIOK() *GetPaymentRequestEDIOK { + return &GetPaymentRequestEDIOK{} +} + +/* +GetPaymentRequestEDIOK describes a response with status code 200, with default header values. + +Successfully retrieved payment requests associated with a given move task order +*/ +type GetPaymentRequestEDIOK struct { + Payload *supportmessages.PaymentRequestEDI +} + +// IsSuccess returns true when this get payment request e d i o k response has a 2xx status code +func (o *GetPaymentRequestEDIOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this get payment request e d i o k response has a 3xx status code +func (o *GetPaymentRequestEDIOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i o k response has a 4xx status code +func (o *GetPaymentRequestEDIOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this get payment request e d i o k response has a 5xx status code +func (o *GetPaymentRequestEDIOK) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i o k response a status code equal to that given +func (o *GetPaymentRequestEDIOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the get payment request e d i o k response +func (o *GetPaymentRequestEDIOK) Code() int { + return 200 +} + +func (o *GetPaymentRequestEDIOK) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIOK %+v", 200, o.Payload) +} + +func (o *GetPaymentRequestEDIOK) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIOK %+v", 200, o.Payload) +} + +func (o *GetPaymentRequestEDIOK) GetPayload() *supportmessages.PaymentRequestEDI { + return o.Payload +} + +func (o *GetPaymentRequestEDIOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.PaymentRequestEDI) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIBadRequest creates a GetPaymentRequestEDIBadRequest with default headers values +func NewGetPaymentRequestEDIBadRequest() *GetPaymentRequestEDIBadRequest { + return &GetPaymentRequestEDIBadRequest{} +} + +/* +GetPaymentRequestEDIBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type GetPaymentRequestEDIBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get payment request e d i bad request response has a 2xx status code +func (o *GetPaymentRequestEDIBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i bad request response has a 3xx status code +func (o *GetPaymentRequestEDIBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i bad request response has a 4xx status code +func (o *GetPaymentRequestEDIBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i bad request response has a 5xx status code +func (o *GetPaymentRequestEDIBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i bad request response a status code equal to that given +func (o *GetPaymentRequestEDIBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the get payment request e d i bad request response +func (o *GetPaymentRequestEDIBadRequest) Code() int { + return 400 +} + +func (o *GetPaymentRequestEDIBadRequest) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIBadRequest %+v", 400, o.Payload) +} + +func (o *GetPaymentRequestEDIBadRequest) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIBadRequest %+v", 400, o.Payload) +} + +func (o *GetPaymentRequestEDIBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetPaymentRequestEDIBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIUnauthorized creates a GetPaymentRequestEDIUnauthorized with default headers values +func NewGetPaymentRequestEDIUnauthorized() *GetPaymentRequestEDIUnauthorized { + return &GetPaymentRequestEDIUnauthorized{} +} + +/* +GetPaymentRequestEDIUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type GetPaymentRequestEDIUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get payment request e d i unauthorized response has a 2xx status code +func (o *GetPaymentRequestEDIUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i unauthorized response has a 3xx status code +func (o *GetPaymentRequestEDIUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i unauthorized response has a 4xx status code +func (o *GetPaymentRequestEDIUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i unauthorized response has a 5xx status code +func (o *GetPaymentRequestEDIUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i unauthorized response a status code equal to that given +func (o *GetPaymentRequestEDIUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the get payment request e d i unauthorized response +func (o *GetPaymentRequestEDIUnauthorized) Code() int { + return 401 +} + +func (o *GetPaymentRequestEDIUnauthorized) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPaymentRequestEDIUnauthorized) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnauthorized %+v", 401, o.Payload) +} + +func (o *GetPaymentRequestEDIUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetPaymentRequestEDIUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIForbidden creates a GetPaymentRequestEDIForbidden with default headers values +func NewGetPaymentRequestEDIForbidden() *GetPaymentRequestEDIForbidden { + return &GetPaymentRequestEDIForbidden{} +} + +/* +GetPaymentRequestEDIForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type GetPaymentRequestEDIForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get payment request e d i forbidden response has a 2xx status code +func (o *GetPaymentRequestEDIForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i forbidden response has a 3xx status code +func (o *GetPaymentRequestEDIForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i forbidden response has a 4xx status code +func (o *GetPaymentRequestEDIForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i forbidden response has a 5xx status code +func (o *GetPaymentRequestEDIForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i forbidden response a status code equal to that given +func (o *GetPaymentRequestEDIForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the get payment request e d i forbidden response +func (o *GetPaymentRequestEDIForbidden) Code() int { + return 403 +} + +func (o *GetPaymentRequestEDIForbidden) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIForbidden %+v", 403, o.Payload) +} + +func (o *GetPaymentRequestEDIForbidden) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIForbidden %+v", 403, o.Payload) +} + +func (o *GetPaymentRequestEDIForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetPaymentRequestEDIForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDINotFound creates a GetPaymentRequestEDINotFound with default headers values +func NewGetPaymentRequestEDINotFound() *GetPaymentRequestEDINotFound { + return &GetPaymentRequestEDINotFound{} +} + +/* +GetPaymentRequestEDINotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type GetPaymentRequestEDINotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get payment request e d i not found response has a 2xx status code +func (o *GetPaymentRequestEDINotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i not found response has a 3xx status code +func (o *GetPaymentRequestEDINotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i not found response has a 4xx status code +func (o *GetPaymentRequestEDINotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i not found response has a 5xx status code +func (o *GetPaymentRequestEDINotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i not found response a status code equal to that given +func (o *GetPaymentRequestEDINotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the get payment request e d i not found response +func (o *GetPaymentRequestEDINotFound) Code() int { + return 404 +} + +func (o *GetPaymentRequestEDINotFound) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDINotFound %+v", 404, o.Payload) +} + +func (o *GetPaymentRequestEDINotFound) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDINotFound %+v", 404, o.Payload) +} + +func (o *GetPaymentRequestEDINotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetPaymentRequestEDINotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIConflict creates a GetPaymentRequestEDIConflict with default headers values +func NewGetPaymentRequestEDIConflict() *GetPaymentRequestEDIConflict { + return &GetPaymentRequestEDIConflict{} +} + +/* +GetPaymentRequestEDIConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type GetPaymentRequestEDIConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this get payment request e d i conflict response has a 2xx status code +func (o *GetPaymentRequestEDIConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i conflict response has a 3xx status code +func (o *GetPaymentRequestEDIConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i conflict response has a 4xx status code +func (o *GetPaymentRequestEDIConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i conflict response has a 5xx status code +func (o *GetPaymentRequestEDIConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i conflict response a status code equal to that given +func (o *GetPaymentRequestEDIConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the get payment request e d i conflict response +func (o *GetPaymentRequestEDIConflict) Code() int { + return 409 +} + +func (o *GetPaymentRequestEDIConflict) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIConflict %+v", 409, o.Payload) +} + +func (o *GetPaymentRequestEDIConflict) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIConflict %+v", 409, o.Payload) +} + +func (o *GetPaymentRequestEDIConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *GetPaymentRequestEDIConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIUnprocessableEntity creates a GetPaymentRequestEDIUnprocessableEntity with default headers values +func NewGetPaymentRequestEDIUnprocessableEntity() *GetPaymentRequestEDIUnprocessableEntity { + return &GetPaymentRequestEDIUnprocessableEntity{} +} + +/* +GetPaymentRequestEDIUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type GetPaymentRequestEDIUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this get payment request e d i unprocessable entity response has a 2xx status code +func (o *GetPaymentRequestEDIUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i unprocessable entity response has a 3xx status code +func (o *GetPaymentRequestEDIUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i unprocessable entity response has a 4xx status code +func (o *GetPaymentRequestEDIUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this get payment request e d i unprocessable entity response has a 5xx status code +func (o *GetPaymentRequestEDIUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this get payment request e d i unprocessable entity response a status code equal to that given +func (o *GetPaymentRequestEDIUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the get payment request e d i unprocessable entity response +func (o *GetPaymentRequestEDIUnprocessableEntity) Code() int { + return 422 +} + +func (o *GetPaymentRequestEDIUnprocessableEntity) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPaymentRequestEDIUnprocessableEntity) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *GetPaymentRequestEDIUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *GetPaymentRequestEDIUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewGetPaymentRequestEDIInternalServerError creates a GetPaymentRequestEDIInternalServerError with default headers values +func NewGetPaymentRequestEDIInternalServerError() *GetPaymentRequestEDIInternalServerError { + return &GetPaymentRequestEDIInternalServerError{} +} + +/* +GetPaymentRequestEDIInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type GetPaymentRequestEDIInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this get payment request e d i internal server error response has a 2xx status code +func (o *GetPaymentRequestEDIInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this get payment request e d i internal server error response has a 3xx status code +func (o *GetPaymentRequestEDIInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this get payment request e d i internal server error response has a 4xx status code +func (o *GetPaymentRequestEDIInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this get payment request e d i internal server error response has a 5xx status code +func (o *GetPaymentRequestEDIInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this get payment request e d i internal server error response a status code equal to that given +func (o *GetPaymentRequestEDIInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the get payment request e d i internal server error response +func (o *GetPaymentRequestEDIInternalServerError) Code() int { + return 500 +} + +func (o *GetPaymentRequestEDIInternalServerError) Error() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPaymentRequestEDIInternalServerError) String() string { + return fmt.Sprintf("[GET /payment-requests/{paymentRequestID}/edi][%d] getPaymentRequestEDIInternalServerError %+v", 500, o.Payload) +} + +func (o *GetPaymentRequestEDIInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *GetPaymentRequestEDIInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go new file mode 100644 index 00000000000..30d1611d01c --- /dev/null +++ b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewListMTOPaymentRequestsParams creates a new ListMTOPaymentRequestsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewListMTOPaymentRequestsParams() *ListMTOPaymentRequestsParams { + return &ListMTOPaymentRequestsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewListMTOPaymentRequestsParamsWithTimeout creates a new ListMTOPaymentRequestsParams object +// with the ability to set a timeout on a request. +func NewListMTOPaymentRequestsParamsWithTimeout(timeout time.Duration) *ListMTOPaymentRequestsParams { + return &ListMTOPaymentRequestsParams{ + timeout: timeout, + } +} + +// NewListMTOPaymentRequestsParamsWithContext creates a new ListMTOPaymentRequestsParams object +// with the ability to set a context for a request. +func NewListMTOPaymentRequestsParamsWithContext(ctx context.Context) *ListMTOPaymentRequestsParams { + return &ListMTOPaymentRequestsParams{ + Context: ctx, + } +} + +// NewListMTOPaymentRequestsParamsWithHTTPClient creates a new ListMTOPaymentRequestsParams object +// with the ability to set a custom HTTPClient for a request. +func NewListMTOPaymentRequestsParamsWithHTTPClient(client *http.Client) *ListMTOPaymentRequestsParams { + return &ListMTOPaymentRequestsParams{ + HTTPClient: client, + } +} + +/* +ListMTOPaymentRequestsParams contains all the parameters to send to the API endpoint + + for the list m t o payment requests operation. + + Typically these are written to a http.Request. +*/ +type ListMTOPaymentRequestsParams struct { + + /* MoveTaskOrderID. + + Only return move task orders updated since this time. + + Format: uuid + */ + MoveTaskOrderID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the list m t o payment requests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMTOPaymentRequestsParams) WithDefaults() *ListMTOPaymentRequestsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the list m t o payment requests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ListMTOPaymentRequestsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) WithTimeout(timeout time.Duration) *ListMTOPaymentRequestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) WithContext(ctx context.Context) *ListMTOPaymentRequestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) WithHTTPClient(client *http.Client) *ListMTOPaymentRequestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithMoveTaskOrderID adds the moveTaskOrderID to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) WithMoveTaskOrderID(moveTaskOrderID strfmt.UUID) *ListMTOPaymentRequestsParams { + o.SetMoveTaskOrderID(moveTaskOrderID) + return o +} + +// SetMoveTaskOrderID adds the moveTaskOrderId to the list m t o payment requests params +func (o *ListMTOPaymentRequestsParams) SetMoveTaskOrderID(moveTaskOrderID strfmt.UUID) { + o.MoveTaskOrderID = moveTaskOrderID +} + +// WriteToRequest writes these params to a swagger request +func (o *ListMTOPaymentRequestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param moveTaskOrderID + if err := r.SetPathParam("moveTaskOrderID", o.MoveTaskOrderID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go new file mode 100644 index 00000000000..0a969ab9f9f --- /dev/null +++ b/pkg/gen/supportclient/payment_request/list_m_t_o_payment_requests_responses.go @@ -0,0 +1,471 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ListMTOPaymentRequestsReader is a Reader for the ListMTOPaymentRequests structure. +type ListMTOPaymentRequestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ListMTOPaymentRequestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewListMTOPaymentRequestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewListMTOPaymentRequestsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewListMTOPaymentRequestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewListMTOPaymentRequestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewListMTOPaymentRequestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewListMTOPaymentRequestsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[GET /move-task-orders/{moveTaskOrderID}/payment-requests] listMTOPaymentRequests", response, response.Code()) + } +} + +// NewListMTOPaymentRequestsOK creates a ListMTOPaymentRequestsOK with default headers values +func NewListMTOPaymentRequestsOK() *ListMTOPaymentRequestsOK { + return &ListMTOPaymentRequestsOK{} +} + +/* +ListMTOPaymentRequestsOK describes a response with status code 200, with default header values. + +Successfully retrieved payment requests associated with a given move task order +*/ +type ListMTOPaymentRequestsOK struct { + Payload supportmessages.PaymentRequests +} + +// IsSuccess returns true when this list m t o payment requests o k response has a 2xx status code +func (o *ListMTOPaymentRequestsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this list m t o payment requests o k response has a 3xx status code +func (o *ListMTOPaymentRequestsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests o k response has a 4xx status code +func (o *ListMTOPaymentRequestsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this list m t o payment requests o k response has a 5xx status code +func (o *ListMTOPaymentRequestsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t o payment requests o k response a status code equal to that given +func (o *ListMTOPaymentRequestsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the list m t o payment requests o k response +func (o *ListMTOPaymentRequestsOK) Code() int { + return 200 +} + +func (o *ListMTOPaymentRequestsOK) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsOK %+v", 200, o.Payload) +} + +func (o *ListMTOPaymentRequestsOK) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsOK %+v", 200, o.Payload) +} + +func (o *ListMTOPaymentRequestsOK) GetPayload() supportmessages.PaymentRequests { + return o.Payload +} + +func (o *ListMTOPaymentRequestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOPaymentRequestsBadRequest creates a ListMTOPaymentRequestsBadRequest with default headers values +func NewListMTOPaymentRequestsBadRequest() *ListMTOPaymentRequestsBadRequest { + return &ListMTOPaymentRequestsBadRequest{} +} + +/* +ListMTOPaymentRequestsBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type ListMTOPaymentRequestsBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t o payment requests bad request response has a 2xx status code +func (o *ListMTOPaymentRequestsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t o payment requests bad request response has a 3xx status code +func (o *ListMTOPaymentRequestsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests bad request response has a 4xx status code +func (o *ListMTOPaymentRequestsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t o payment requests bad request response has a 5xx status code +func (o *ListMTOPaymentRequestsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t o payment requests bad request response a status code equal to that given +func (o *ListMTOPaymentRequestsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the list m t o payment requests bad request response +func (o *ListMTOPaymentRequestsBadRequest) Code() int { + return 400 +} + +func (o *ListMTOPaymentRequestsBadRequest) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsBadRequest %+v", 400, o.Payload) +} + +func (o *ListMTOPaymentRequestsBadRequest) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsBadRequest %+v", 400, o.Payload) +} + +func (o *ListMTOPaymentRequestsBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOPaymentRequestsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOPaymentRequestsUnauthorized creates a ListMTOPaymentRequestsUnauthorized with default headers values +func NewListMTOPaymentRequestsUnauthorized() *ListMTOPaymentRequestsUnauthorized { + return &ListMTOPaymentRequestsUnauthorized{} +} + +/* +ListMTOPaymentRequestsUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type ListMTOPaymentRequestsUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t o payment requests unauthorized response has a 2xx status code +func (o *ListMTOPaymentRequestsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t o payment requests unauthorized response has a 3xx status code +func (o *ListMTOPaymentRequestsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests unauthorized response has a 4xx status code +func (o *ListMTOPaymentRequestsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t o payment requests unauthorized response has a 5xx status code +func (o *ListMTOPaymentRequestsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t o payment requests unauthorized response a status code equal to that given +func (o *ListMTOPaymentRequestsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the list m t o payment requests unauthorized response +func (o *ListMTOPaymentRequestsUnauthorized) Code() int { + return 401 +} + +func (o *ListMTOPaymentRequestsUnauthorized) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMTOPaymentRequestsUnauthorized) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsUnauthorized %+v", 401, o.Payload) +} + +func (o *ListMTOPaymentRequestsUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOPaymentRequestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOPaymentRequestsForbidden creates a ListMTOPaymentRequestsForbidden with default headers values +func NewListMTOPaymentRequestsForbidden() *ListMTOPaymentRequestsForbidden { + return &ListMTOPaymentRequestsForbidden{} +} + +/* +ListMTOPaymentRequestsForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type ListMTOPaymentRequestsForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t o payment requests forbidden response has a 2xx status code +func (o *ListMTOPaymentRequestsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t o payment requests forbidden response has a 3xx status code +func (o *ListMTOPaymentRequestsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests forbidden response has a 4xx status code +func (o *ListMTOPaymentRequestsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t o payment requests forbidden response has a 5xx status code +func (o *ListMTOPaymentRequestsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t o payment requests forbidden response a status code equal to that given +func (o *ListMTOPaymentRequestsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the list m t o payment requests forbidden response +func (o *ListMTOPaymentRequestsForbidden) Code() int { + return 403 +} + +func (o *ListMTOPaymentRequestsForbidden) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsForbidden %+v", 403, o.Payload) +} + +func (o *ListMTOPaymentRequestsForbidden) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsForbidden %+v", 403, o.Payload) +} + +func (o *ListMTOPaymentRequestsForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOPaymentRequestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOPaymentRequestsNotFound creates a ListMTOPaymentRequestsNotFound with default headers values +func NewListMTOPaymentRequestsNotFound() *ListMTOPaymentRequestsNotFound { + return &ListMTOPaymentRequestsNotFound{} +} + +/* +ListMTOPaymentRequestsNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type ListMTOPaymentRequestsNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this list m t o payment requests not found response has a 2xx status code +func (o *ListMTOPaymentRequestsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t o payment requests not found response has a 3xx status code +func (o *ListMTOPaymentRequestsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests not found response has a 4xx status code +func (o *ListMTOPaymentRequestsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this list m t o payment requests not found response has a 5xx status code +func (o *ListMTOPaymentRequestsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this list m t o payment requests not found response a status code equal to that given +func (o *ListMTOPaymentRequestsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the list m t o payment requests not found response +func (o *ListMTOPaymentRequestsNotFound) Code() int { + return 404 +} + +func (o *ListMTOPaymentRequestsNotFound) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsNotFound %+v", 404, o.Payload) +} + +func (o *ListMTOPaymentRequestsNotFound) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsNotFound %+v", 404, o.Payload) +} + +func (o *ListMTOPaymentRequestsNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ListMTOPaymentRequestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewListMTOPaymentRequestsInternalServerError creates a ListMTOPaymentRequestsInternalServerError with default headers values +func NewListMTOPaymentRequestsInternalServerError() *ListMTOPaymentRequestsInternalServerError { + return &ListMTOPaymentRequestsInternalServerError{} +} + +/* +ListMTOPaymentRequestsInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type ListMTOPaymentRequestsInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this list m t o payment requests internal server error response has a 2xx status code +func (o *ListMTOPaymentRequestsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this list m t o payment requests internal server error response has a 3xx status code +func (o *ListMTOPaymentRequestsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this list m t o payment requests internal server error response has a 4xx status code +func (o *ListMTOPaymentRequestsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this list m t o payment requests internal server error response has a 5xx status code +func (o *ListMTOPaymentRequestsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this list m t o payment requests internal server error response a status code equal to that given +func (o *ListMTOPaymentRequestsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the list m t o payment requests internal server error response +func (o *ListMTOPaymentRequestsInternalServerError) Code() int { + return 500 +} + +func (o *ListMTOPaymentRequestsInternalServerError) Error() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMTOPaymentRequestsInternalServerError) String() string { + return fmt.Sprintf("[GET /move-task-orders/{moveTaskOrderID}/payment-requests][%d] listMTOPaymentRequestsInternalServerError %+v", 500, o.Payload) +} + +func (o *ListMTOPaymentRequestsInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *ListMTOPaymentRequestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/payment_request/payment_request_client.go b/pkg/gen/supportclient/payment_request/payment_request_client.go new file mode 100644 index 00000000000..dae7a0dbbce --- /dev/null +++ b/pkg/gen/supportclient/payment_request/payment_request_client.go @@ -0,0 +1,271 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new payment request API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for payment request API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + GetPaymentRequestEDI(params *GetPaymentRequestEDIParams, opts ...ClientOption) (*GetPaymentRequestEDIOK, error) + + ListMTOPaymentRequests(params *ListMTOPaymentRequestsParams, opts ...ClientOption) (*ListMTOPaymentRequestsOK, error) + + ProcessReviewedPaymentRequests(params *ProcessReviewedPaymentRequestsParams, opts ...ClientOption) (*ProcessReviewedPaymentRequestsOK, error) + + RecalculatePaymentRequest(params *RecalculatePaymentRequestParams, opts ...ClientOption) (*RecalculatePaymentRequestCreated, error) + + UpdatePaymentRequestStatus(params *UpdatePaymentRequestStatusParams, opts ...ClientOption) (*UpdatePaymentRequestStatusOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* + GetPaymentRequestEDI gets payment request e d i + + Returns the EDI (Electronic Data Interchange) message for the payment request identified + +by the given payment request ID. Note that the EDI returned in the JSON payload will have where there +would normally be line breaks (due to JSON not allowing line breaks in a string). + +This is a support endpoint and will not be available in production. +*/ +func (a *Client) GetPaymentRequestEDI(params *GetPaymentRequestEDIParams, opts ...ClientOption) (*GetPaymentRequestEDIOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewGetPaymentRequestEDIParams() + } + op := &runtime.ClientOperation{ + ID: "getPaymentRequestEDI", + Method: "GET", + PathPattern: "/payment-requests/{paymentRequestID}/edi", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &GetPaymentRequestEDIReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*GetPaymentRequestEDIOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for getPaymentRequestEDI: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ListMTOPaymentRequests lists m t o payment requests + + ### Functionality + +This endpoint lists all PaymentRequests associated with a given MoveTaskOrder. + +This is a support endpoint and is not available in production. +*/ +func (a *Client) ListMTOPaymentRequests(params *ListMTOPaymentRequestsParams, opts ...ClientOption) (*ListMTOPaymentRequestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewListMTOPaymentRequestsParams() + } + op := &runtime.ClientOperation{ + ID: "listMTOPaymentRequests", + Method: "GET", + PathPattern: "/move-task-orders/{moveTaskOrderID}/payment-requests", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ListMTOPaymentRequestsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ListMTOPaymentRequestsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for listMTOPaymentRequests: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + ProcessReviewedPaymentRequests processes reviewed payment requests + + Updates the status of reviewed payment requests and sends PRs to Syncada if + +the SendToSyncada flag is set + +This is a support endpoint and will not be available in production. +*/ +func (a *Client) ProcessReviewedPaymentRequests(params *ProcessReviewedPaymentRequestsParams, opts ...ClientOption) (*ProcessReviewedPaymentRequestsOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewProcessReviewedPaymentRequestsParams() + } + op := &runtime.ClientOperation{ + ID: "processReviewedPaymentRequests", + Method: "PATCH", + PathPattern: "/payment-requests/process-reviewed", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ProcessReviewedPaymentRequestsReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ProcessReviewedPaymentRequestsOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for processReviewedPaymentRequests: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + RecalculatePaymentRequest recalculates payment request + + Recalculates an existing pending payment request by creating a new payment request for the same service + +items but is priced based on the current inputs (weights, dates, etc.). The previously existing payment +request is then deprecated. A link is made between the new and existing payment requests. + +This is a support endpoint and will not be available in production. +*/ +func (a *Client) RecalculatePaymentRequest(params *RecalculatePaymentRequestParams, opts ...ClientOption) (*RecalculatePaymentRequestCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewRecalculatePaymentRequestParams() + } + op := &runtime.ClientOperation{ + ID: "recalculatePaymentRequest", + Method: "POST", + PathPattern: "/payment-requests/{paymentRequestID}/recalculate", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &RecalculatePaymentRequestReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*RecalculatePaymentRequestCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for recalculatePaymentRequest: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* + UpdatePaymentRequestStatus updates payment request status + + Updates status of a payment request to REVIEWED, SENT_TO_GEX, TPPS_RECEIVED, REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED, PAID, EDI_ERROR, or DEPRECATED. + +A status of REVIEWED can optionally have a `rejectionReason`. + +This is a support endpoint and is not available in production. +*/ +func (a *Client) UpdatePaymentRequestStatus(params *UpdatePaymentRequestStatusParams, opts ...ClientOption) (*UpdatePaymentRequestStatusOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewUpdatePaymentRequestStatusParams() + } + op := &runtime.ClientOperation{ + ID: "updatePaymentRequestStatus", + Method: "PATCH", + PathPattern: "/payment-requests/{paymentRequestID}/status", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &UpdatePaymentRequestStatusReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*UpdatePaymentRequestStatusOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for updatePaymentRequestStatus: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go new file mode 100644 index 00000000000..9323038f443 --- /dev/null +++ b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_parameters.go @@ -0,0 +1,150 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewProcessReviewedPaymentRequestsParams creates a new ProcessReviewedPaymentRequestsParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewProcessReviewedPaymentRequestsParams() *ProcessReviewedPaymentRequestsParams { + return &ProcessReviewedPaymentRequestsParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewProcessReviewedPaymentRequestsParamsWithTimeout creates a new ProcessReviewedPaymentRequestsParams object +// with the ability to set a timeout on a request. +func NewProcessReviewedPaymentRequestsParamsWithTimeout(timeout time.Duration) *ProcessReviewedPaymentRequestsParams { + return &ProcessReviewedPaymentRequestsParams{ + timeout: timeout, + } +} + +// NewProcessReviewedPaymentRequestsParamsWithContext creates a new ProcessReviewedPaymentRequestsParams object +// with the ability to set a context for a request. +func NewProcessReviewedPaymentRequestsParamsWithContext(ctx context.Context) *ProcessReviewedPaymentRequestsParams { + return &ProcessReviewedPaymentRequestsParams{ + Context: ctx, + } +} + +// NewProcessReviewedPaymentRequestsParamsWithHTTPClient creates a new ProcessReviewedPaymentRequestsParams object +// with the ability to set a custom HTTPClient for a request. +func NewProcessReviewedPaymentRequestsParamsWithHTTPClient(client *http.Client) *ProcessReviewedPaymentRequestsParams { + return &ProcessReviewedPaymentRequestsParams{ + HTTPClient: client, + } +} + +/* +ProcessReviewedPaymentRequestsParams contains all the parameters to send to the API endpoint + + for the process reviewed payment requests operation. + + Typically these are written to a http.Request. +*/ +type ProcessReviewedPaymentRequestsParams struct { + + // Body. + Body *supportmessages.ProcessReviewedPaymentRequests + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the process reviewed payment requests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProcessReviewedPaymentRequestsParams) WithDefaults() *ProcessReviewedPaymentRequestsParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the process reviewed payment requests params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ProcessReviewedPaymentRequestsParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) WithTimeout(timeout time.Duration) *ProcessReviewedPaymentRequestsParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) WithContext(ctx context.Context) *ProcessReviewedPaymentRequestsParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) WithHTTPClient(client *http.Client) *ProcessReviewedPaymentRequestsParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) WithBody(body *supportmessages.ProcessReviewedPaymentRequests) *ProcessReviewedPaymentRequestsParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the process reviewed payment requests params +func (o *ProcessReviewedPaymentRequestsParams) SetBody(body *supportmessages.ProcessReviewedPaymentRequests) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ProcessReviewedPaymentRequestsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go new file mode 100644 index 00000000000..e853c7905ef --- /dev/null +++ b/pkg/gen/supportclient/payment_request/process_reviewed_payment_requests_responses.go @@ -0,0 +1,545 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ProcessReviewedPaymentRequestsReader is a Reader for the ProcessReviewedPaymentRequests structure. +type ProcessReviewedPaymentRequestsReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ProcessReviewedPaymentRequestsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewProcessReviewedPaymentRequestsOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewProcessReviewedPaymentRequestsBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewProcessReviewedPaymentRequestsUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewProcessReviewedPaymentRequestsForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewProcessReviewedPaymentRequestsNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewProcessReviewedPaymentRequestsUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewProcessReviewedPaymentRequestsInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /payment-requests/process-reviewed] processReviewedPaymentRequests", response, response.Code()) + } +} + +// NewProcessReviewedPaymentRequestsOK creates a ProcessReviewedPaymentRequestsOK with default headers values +func NewProcessReviewedPaymentRequestsOK() *ProcessReviewedPaymentRequestsOK { + return &ProcessReviewedPaymentRequestsOK{} +} + +/* +ProcessReviewedPaymentRequestsOK describes a response with status code 200, with default header values. + +Successfully updated status of reviewed payment request and sent to Syncada if that flag is set +*/ +type ProcessReviewedPaymentRequestsOK struct { + Payload supportmessages.PaymentRequests +} + +// IsSuccess returns true when this process reviewed payment requests o k response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this process reviewed payment requests o k response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests o k response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this process reviewed payment requests o k response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsOK) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests o k response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the process reviewed payment requests o k response +func (o *ProcessReviewedPaymentRequestsOK) Code() int { + return 200 +} + +func (o *ProcessReviewedPaymentRequestsOK) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsOK %+v", 200, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsOK) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsOK %+v", 200, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsOK) GetPayload() supportmessages.PaymentRequests { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + // response payload + if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsBadRequest creates a ProcessReviewedPaymentRequestsBadRequest with default headers values +func NewProcessReviewedPaymentRequestsBadRequest() *ProcessReviewedPaymentRequestsBadRequest { + return &ProcessReviewedPaymentRequestsBadRequest{} +} + +/* +ProcessReviewedPaymentRequestsBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type ProcessReviewedPaymentRequestsBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this process reviewed payment requests bad request response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests bad request response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests bad request response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this process reviewed payment requests bad request response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests bad request response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the process reviewed payment requests bad request response +func (o *ProcessReviewedPaymentRequestsBadRequest) Code() int { + return 400 +} + +func (o *ProcessReviewedPaymentRequestsBadRequest) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsBadRequest %+v", 400, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsBadRequest) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsBadRequest %+v", 400, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsUnauthorized creates a ProcessReviewedPaymentRequestsUnauthorized with default headers values +func NewProcessReviewedPaymentRequestsUnauthorized() *ProcessReviewedPaymentRequestsUnauthorized { + return &ProcessReviewedPaymentRequestsUnauthorized{} +} + +/* +ProcessReviewedPaymentRequestsUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type ProcessReviewedPaymentRequestsUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this process reviewed payment requests unauthorized response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests unauthorized response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests unauthorized response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this process reviewed payment requests unauthorized response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests unauthorized response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the process reviewed payment requests unauthorized response +func (o *ProcessReviewedPaymentRequestsUnauthorized) Code() int { + return 401 +} + +func (o *ProcessReviewedPaymentRequestsUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnauthorized %+v", 401, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsUnauthorized) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnauthorized %+v", 401, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsForbidden creates a ProcessReviewedPaymentRequestsForbidden with default headers values +func NewProcessReviewedPaymentRequestsForbidden() *ProcessReviewedPaymentRequestsForbidden { + return &ProcessReviewedPaymentRequestsForbidden{} +} + +/* +ProcessReviewedPaymentRequestsForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type ProcessReviewedPaymentRequestsForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this process reviewed payment requests forbidden response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests forbidden response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests forbidden response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this process reviewed payment requests forbidden response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests forbidden response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the process reviewed payment requests forbidden response +func (o *ProcessReviewedPaymentRequestsForbidden) Code() int { + return 403 +} + +func (o *ProcessReviewedPaymentRequestsForbidden) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsForbidden %+v", 403, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsForbidden) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsForbidden %+v", 403, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsNotFound creates a ProcessReviewedPaymentRequestsNotFound with default headers values +func NewProcessReviewedPaymentRequestsNotFound() *ProcessReviewedPaymentRequestsNotFound { + return &ProcessReviewedPaymentRequestsNotFound{} +} + +/* +ProcessReviewedPaymentRequestsNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type ProcessReviewedPaymentRequestsNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this process reviewed payment requests not found response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests not found response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests not found response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this process reviewed payment requests not found response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests not found response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the process reviewed payment requests not found response +func (o *ProcessReviewedPaymentRequestsNotFound) Code() int { + return 404 +} + +func (o *ProcessReviewedPaymentRequestsNotFound) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsNotFound %+v", 404, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsNotFound) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsNotFound %+v", 404, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsUnprocessableEntity creates a ProcessReviewedPaymentRequestsUnprocessableEntity with default headers values +func NewProcessReviewedPaymentRequestsUnprocessableEntity() *ProcessReviewedPaymentRequestsUnprocessableEntity { + return &ProcessReviewedPaymentRequestsUnprocessableEntity{} +} + +/* +ProcessReviewedPaymentRequestsUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type ProcessReviewedPaymentRequestsUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this process reviewed payment requests unprocessable entity response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests unprocessable entity response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests unprocessable entity response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this process reviewed payment requests unprocessable entity response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this process reviewed payment requests unprocessable entity response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the process reviewed payment requests unprocessable entity response +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) Code() int { + return 422 +} + +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewProcessReviewedPaymentRequestsInternalServerError creates a ProcessReviewedPaymentRequestsInternalServerError with default headers values +func NewProcessReviewedPaymentRequestsInternalServerError() *ProcessReviewedPaymentRequestsInternalServerError { + return &ProcessReviewedPaymentRequestsInternalServerError{} +} + +/* +ProcessReviewedPaymentRequestsInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type ProcessReviewedPaymentRequestsInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this process reviewed payment requests internal server error response has a 2xx status code +func (o *ProcessReviewedPaymentRequestsInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this process reviewed payment requests internal server error response has a 3xx status code +func (o *ProcessReviewedPaymentRequestsInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this process reviewed payment requests internal server error response has a 4xx status code +func (o *ProcessReviewedPaymentRequestsInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this process reviewed payment requests internal server error response has a 5xx status code +func (o *ProcessReviewedPaymentRequestsInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this process reviewed payment requests internal server error response a status code equal to that given +func (o *ProcessReviewedPaymentRequestsInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the process reviewed payment requests internal server error response +func (o *ProcessReviewedPaymentRequestsInternalServerError) Code() int { + return 500 +} + +func (o *ProcessReviewedPaymentRequestsInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsInternalServerError %+v", 500, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsInternalServerError) String() string { + return fmt.Sprintf("[PATCH /payment-requests/process-reviewed][%d] processReviewedPaymentRequestsInternalServerError %+v", 500, o.Payload) +} + +func (o *ProcessReviewedPaymentRequestsInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *ProcessReviewedPaymentRequestsInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go b/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go new file mode 100644 index 00000000000..a6660aa968f --- /dev/null +++ b/pkg/gen/supportclient/payment_request/recalculate_payment_request_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewRecalculatePaymentRequestParams creates a new RecalculatePaymentRequestParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewRecalculatePaymentRequestParams() *RecalculatePaymentRequestParams { + return &RecalculatePaymentRequestParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewRecalculatePaymentRequestParamsWithTimeout creates a new RecalculatePaymentRequestParams object +// with the ability to set a timeout on a request. +func NewRecalculatePaymentRequestParamsWithTimeout(timeout time.Duration) *RecalculatePaymentRequestParams { + return &RecalculatePaymentRequestParams{ + timeout: timeout, + } +} + +// NewRecalculatePaymentRequestParamsWithContext creates a new RecalculatePaymentRequestParams object +// with the ability to set a context for a request. +func NewRecalculatePaymentRequestParamsWithContext(ctx context.Context) *RecalculatePaymentRequestParams { + return &RecalculatePaymentRequestParams{ + Context: ctx, + } +} + +// NewRecalculatePaymentRequestParamsWithHTTPClient creates a new RecalculatePaymentRequestParams object +// with the ability to set a custom HTTPClient for a request. +func NewRecalculatePaymentRequestParamsWithHTTPClient(client *http.Client) *RecalculatePaymentRequestParams { + return &RecalculatePaymentRequestParams{ + HTTPClient: client, + } +} + +/* +RecalculatePaymentRequestParams contains all the parameters to send to the API endpoint + + for the recalculate payment request operation. + + Typically these are written to a http.Request. +*/ +type RecalculatePaymentRequestParams struct { + + /* PaymentRequestID. + + UUID of the payment request to recalculate. + + Format: uuid + */ + PaymentRequestID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the recalculate payment request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RecalculatePaymentRequestParams) WithDefaults() *RecalculatePaymentRequestParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the recalculate payment request params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *RecalculatePaymentRequestParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) WithTimeout(timeout time.Duration) *RecalculatePaymentRequestParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) WithContext(ctx context.Context) *RecalculatePaymentRequestParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) WithHTTPClient(client *http.Client) *RecalculatePaymentRequestParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithPaymentRequestID adds the paymentRequestID to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *RecalculatePaymentRequestParams { + o.SetPaymentRequestID(paymentRequestID) + return o +} + +// SetPaymentRequestID adds the paymentRequestId to the recalculate payment request params +func (o *RecalculatePaymentRequestParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { + o.PaymentRequestID = paymentRequestID +} + +// WriteToRequest writes these params to a swagger request +func (o *RecalculatePaymentRequestParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // path param paymentRequestID + if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go b/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go new file mode 100644 index 00000000000..b604df58365 --- /dev/null +++ b/pkg/gen/supportclient/payment_request/recalculate_payment_request_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// RecalculatePaymentRequestReader is a Reader for the RecalculatePaymentRequest structure. +type RecalculatePaymentRequestReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *RecalculatePaymentRequestReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewRecalculatePaymentRequestCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewRecalculatePaymentRequestBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewRecalculatePaymentRequestUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewRecalculatePaymentRequestForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewRecalculatePaymentRequestNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewRecalculatePaymentRequestConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewRecalculatePaymentRequestPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewRecalculatePaymentRequestUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewRecalculatePaymentRequestInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /payment-requests/{paymentRequestID}/recalculate] recalculatePaymentRequest", response, response.Code()) + } +} + +// NewRecalculatePaymentRequestCreated creates a RecalculatePaymentRequestCreated with default headers values +func NewRecalculatePaymentRequestCreated() *RecalculatePaymentRequestCreated { + return &RecalculatePaymentRequestCreated{} +} + +/* +RecalculatePaymentRequestCreated describes a response with status code 201, with default header values. + +The new payment request with recalculated pricing. +*/ +type RecalculatePaymentRequestCreated struct { + Payload *supportmessages.PaymentRequest +} + +// IsSuccess returns true when this recalculate payment request created response has a 2xx status code +func (o *RecalculatePaymentRequestCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this recalculate payment request created response has a 3xx status code +func (o *RecalculatePaymentRequestCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request created response has a 4xx status code +func (o *RecalculatePaymentRequestCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this recalculate payment request created response has a 5xx status code +func (o *RecalculatePaymentRequestCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request created response a status code equal to that given +func (o *RecalculatePaymentRequestCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the recalculate payment request created response +func (o *RecalculatePaymentRequestCreated) Code() int { + return 201 +} + +func (o *RecalculatePaymentRequestCreated) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestCreated %+v", 201, o.Payload) +} + +func (o *RecalculatePaymentRequestCreated) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestCreated %+v", 201, o.Payload) +} + +func (o *RecalculatePaymentRequestCreated) GetPayload() *supportmessages.PaymentRequest { + return o.Payload +} + +func (o *RecalculatePaymentRequestCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.PaymentRequest) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestBadRequest creates a RecalculatePaymentRequestBadRequest with default headers values +func NewRecalculatePaymentRequestBadRequest() *RecalculatePaymentRequestBadRequest { + return &RecalculatePaymentRequestBadRequest{} +} + +/* +RecalculatePaymentRequestBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type RecalculatePaymentRequestBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request bad request response has a 2xx status code +func (o *RecalculatePaymentRequestBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request bad request response has a 3xx status code +func (o *RecalculatePaymentRequestBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request bad request response has a 4xx status code +func (o *RecalculatePaymentRequestBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request bad request response has a 5xx status code +func (o *RecalculatePaymentRequestBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request bad request response a status code equal to that given +func (o *RecalculatePaymentRequestBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the recalculate payment request bad request response +func (o *RecalculatePaymentRequestBadRequest) Code() int { + return 400 +} + +func (o *RecalculatePaymentRequestBadRequest) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestBadRequest %+v", 400, o.Payload) +} + +func (o *RecalculatePaymentRequestBadRequest) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestBadRequest %+v", 400, o.Payload) +} + +func (o *RecalculatePaymentRequestBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestUnauthorized creates a RecalculatePaymentRequestUnauthorized with default headers values +func NewRecalculatePaymentRequestUnauthorized() *RecalculatePaymentRequestUnauthorized { + return &RecalculatePaymentRequestUnauthorized{} +} + +/* +RecalculatePaymentRequestUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type RecalculatePaymentRequestUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request unauthorized response has a 2xx status code +func (o *RecalculatePaymentRequestUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request unauthorized response has a 3xx status code +func (o *RecalculatePaymentRequestUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request unauthorized response has a 4xx status code +func (o *RecalculatePaymentRequestUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request unauthorized response has a 5xx status code +func (o *RecalculatePaymentRequestUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request unauthorized response a status code equal to that given +func (o *RecalculatePaymentRequestUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the recalculate payment request unauthorized response +func (o *RecalculatePaymentRequestUnauthorized) Code() int { + return 401 +} + +func (o *RecalculatePaymentRequestUnauthorized) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnauthorized %+v", 401, o.Payload) +} + +func (o *RecalculatePaymentRequestUnauthorized) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnauthorized %+v", 401, o.Payload) +} + +func (o *RecalculatePaymentRequestUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestForbidden creates a RecalculatePaymentRequestForbidden with default headers values +func NewRecalculatePaymentRequestForbidden() *RecalculatePaymentRequestForbidden { + return &RecalculatePaymentRequestForbidden{} +} + +/* +RecalculatePaymentRequestForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type RecalculatePaymentRequestForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request forbidden response has a 2xx status code +func (o *RecalculatePaymentRequestForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request forbidden response has a 3xx status code +func (o *RecalculatePaymentRequestForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request forbidden response has a 4xx status code +func (o *RecalculatePaymentRequestForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request forbidden response has a 5xx status code +func (o *RecalculatePaymentRequestForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request forbidden response a status code equal to that given +func (o *RecalculatePaymentRequestForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the recalculate payment request forbidden response +func (o *RecalculatePaymentRequestForbidden) Code() int { + return 403 +} + +func (o *RecalculatePaymentRequestForbidden) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestForbidden %+v", 403, o.Payload) +} + +func (o *RecalculatePaymentRequestForbidden) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestForbidden %+v", 403, o.Payload) +} + +func (o *RecalculatePaymentRequestForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestNotFound creates a RecalculatePaymentRequestNotFound with default headers values +func NewRecalculatePaymentRequestNotFound() *RecalculatePaymentRequestNotFound { + return &RecalculatePaymentRequestNotFound{} +} + +/* +RecalculatePaymentRequestNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type RecalculatePaymentRequestNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request not found response has a 2xx status code +func (o *RecalculatePaymentRequestNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request not found response has a 3xx status code +func (o *RecalculatePaymentRequestNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request not found response has a 4xx status code +func (o *RecalculatePaymentRequestNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request not found response has a 5xx status code +func (o *RecalculatePaymentRequestNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request not found response a status code equal to that given +func (o *RecalculatePaymentRequestNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the recalculate payment request not found response +func (o *RecalculatePaymentRequestNotFound) Code() int { + return 404 +} + +func (o *RecalculatePaymentRequestNotFound) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestNotFound %+v", 404, o.Payload) +} + +func (o *RecalculatePaymentRequestNotFound) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestNotFound %+v", 404, o.Payload) +} + +func (o *RecalculatePaymentRequestNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestConflict creates a RecalculatePaymentRequestConflict with default headers values +func NewRecalculatePaymentRequestConflict() *RecalculatePaymentRequestConflict { + return &RecalculatePaymentRequestConflict{} +} + +/* +RecalculatePaymentRequestConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type RecalculatePaymentRequestConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request conflict response has a 2xx status code +func (o *RecalculatePaymentRequestConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request conflict response has a 3xx status code +func (o *RecalculatePaymentRequestConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request conflict response has a 4xx status code +func (o *RecalculatePaymentRequestConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request conflict response has a 5xx status code +func (o *RecalculatePaymentRequestConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request conflict response a status code equal to that given +func (o *RecalculatePaymentRequestConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the recalculate payment request conflict response +func (o *RecalculatePaymentRequestConflict) Code() int { + return 409 +} + +func (o *RecalculatePaymentRequestConflict) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestConflict %+v", 409, o.Payload) +} + +func (o *RecalculatePaymentRequestConflict) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestConflict %+v", 409, o.Payload) +} + +func (o *RecalculatePaymentRequestConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestPreconditionFailed creates a RecalculatePaymentRequestPreconditionFailed with default headers values +func NewRecalculatePaymentRequestPreconditionFailed() *RecalculatePaymentRequestPreconditionFailed { + return &RecalculatePaymentRequestPreconditionFailed{} +} + +/* +RecalculatePaymentRequestPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type RecalculatePaymentRequestPreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this recalculate payment request precondition failed response has a 2xx status code +func (o *RecalculatePaymentRequestPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request precondition failed response has a 3xx status code +func (o *RecalculatePaymentRequestPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request precondition failed response has a 4xx status code +func (o *RecalculatePaymentRequestPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request precondition failed response has a 5xx status code +func (o *RecalculatePaymentRequestPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request precondition failed response a status code equal to that given +func (o *RecalculatePaymentRequestPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the recalculate payment request precondition failed response +func (o *RecalculatePaymentRequestPreconditionFailed) Code() int { + return 412 +} + +func (o *RecalculatePaymentRequestPreconditionFailed) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestPreconditionFailed %+v", 412, o.Payload) +} + +func (o *RecalculatePaymentRequestPreconditionFailed) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestPreconditionFailed %+v", 412, o.Payload) +} + +func (o *RecalculatePaymentRequestPreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *RecalculatePaymentRequestPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestUnprocessableEntity creates a RecalculatePaymentRequestUnprocessableEntity with default headers values +func NewRecalculatePaymentRequestUnprocessableEntity() *RecalculatePaymentRequestUnprocessableEntity { + return &RecalculatePaymentRequestUnprocessableEntity{} +} + +/* +RecalculatePaymentRequestUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type RecalculatePaymentRequestUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this recalculate payment request unprocessable entity response has a 2xx status code +func (o *RecalculatePaymentRequestUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request unprocessable entity response has a 3xx status code +func (o *RecalculatePaymentRequestUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request unprocessable entity response has a 4xx status code +func (o *RecalculatePaymentRequestUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this recalculate payment request unprocessable entity response has a 5xx status code +func (o *RecalculatePaymentRequestUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this recalculate payment request unprocessable entity response a status code equal to that given +func (o *RecalculatePaymentRequestUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the recalculate payment request unprocessable entity response +func (o *RecalculatePaymentRequestUnprocessableEntity) Code() int { + return 422 +} + +func (o *RecalculatePaymentRequestUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *RecalculatePaymentRequestUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *RecalculatePaymentRequestUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *RecalculatePaymentRequestUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewRecalculatePaymentRequestInternalServerError creates a RecalculatePaymentRequestInternalServerError with default headers values +func NewRecalculatePaymentRequestInternalServerError() *RecalculatePaymentRequestInternalServerError { + return &RecalculatePaymentRequestInternalServerError{} +} + +/* +RecalculatePaymentRequestInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type RecalculatePaymentRequestInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this recalculate payment request internal server error response has a 2xx status code +func (o *RecalculatePaymentRequestInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this recalculate payment request internal server error response has a 3xx status code +func (o *RecalculatePaymentRequestInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this recalculate payment request internal server error response has a 4xx status code +func (o *RecalculatePaymentRequestInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this recalculate payment request internal server error response has a 5xx status code +func (o *RecalculatePaymentRequestInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this recalculate payment request internal server error response a status code equal to that given +func (o *RecalculatePaymentRequestInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the recalculate payment request internal server error response +func (o *RecalculatePaymentRequestInternalServerError) Code() int { + return 500 +} + +func (o *RecalculatePaymentRequestInternalServerError) Error() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestInternalServerError %+v", 500, o.Payload) +} + +func (o *RecalculatePaymentRequestInternalServerError) String() string { + return fmt.Sprintf("[POST /payment-requests/{paymentRequestID}/recalculate][%d] recalculatePaymentRequestInternalServerError %+v", 500, o.Payload) +} + +func (o *RecalculatePaymentRequestInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *RecalculatePaymentRequestInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go b/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go new file mode 100644 index 00000000000..0f91c418a23 --- /dev/null +++ b/pkg/gen/supportclient/payment_request/update_payment_request_status_parameters.go @@ -0,0 +1,197 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewUpdatePaymentRequestStatusParams creates a new UpdatePaymentRequestStatusParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewUpdatePaymentRequestStatusParams() *UpdatePaymentRequestStatusParams { + return &UpdatePaymentRequestStatusParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewUpdatePaymentRequestStatusParamsWithTimeout creates a new UpdatePaymentRequestStatusParams object +// with the ability to set a timeout on a request. +func NewUpdatePaymentRequestStatusParamsWithTimeout(timeout time.Duration) *UpdatePaymentRequestStatusParams { + return &UpdatePaymentRequestStatusParams{ + timeout: timeout, + } +} + +// NewUpdatePaymentRequestStatusParamsWithContext creates a new UpdatePaymentRequestStatusParams object +// with the ability to set a context for a request. +func NewUpdatePaymentRequestStatusParamsWithContext(ctx context.Context) *UpdatePaymentRequestStatusParams { + return &UpdatePaymentRequestStatusParams{ + Context: ctx, + } +} + +// NewUpdatePaymentRequestStatusParamsWithHTTPClient creates a new UpdatePaymentRequestStatusParams object +// with the ability to set a custom HTTPClient for a request. +func NewUpdatePaymentRequestStatusParamsWithHTTPClient(client *http.Client) *UpdatePaymentRequestStatusParams { + return &UpdatePaymentRequestStatusParams{ + HTTPClient: client, + } +} + +/* +UpdatePaymentRequestStatusParams contains all the parameters to send to the API endpoint + + for the update payment request status operation. + + Typically these are written to a http.Request. +*/ +type UpdatePaymentRequestStatusParams struct { + + /* IfMatch. + + Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. + + */ + IfMatch string + + // Body. + Body *supportmessages.UpdatePaymentRequestStatus + + /* PaymentRequestID. + + UUID of payment request. + + Format: uuid + */ + PaymentRequestID strfmt.UUID + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the update payment request status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePaymentRequestStatusParams) WithDefaults() *UpdatePaymentRequestStatusParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the update payment request status params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *UpdatePaymentRequestStatusParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithTimeout(timeout time.Duration) *UpdatePaymentRequestStatusParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithContext(ctx context.Context) *UpdatePaymentRequestStatusParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithHTTPClient(client *http.Client) *UpdatePaymentRequestStatusParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithIfMatch adds the ifMatch to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithIfMatch(ifMatch string) *UpdatePaymentRequestStatusParams { + o.SetIfMatch(ifMatch) + return o +} + +// SetIfMatch adds the ifMatch to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetIfMatch(ifMatch string) { + o.IfMatch = ifMatch +} + +// WithBody adds the body to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithBody(body *supportmessages.UpdatePaymentRequestStatus) *UpdatePaymentRequestStatusParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetBody(body *supportmessages.UpdatePaymentRequestStatus) { + o.Body = body +} + +// WithPaymentRequestID adds the paymentRequestID to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) WithPaymentRequestID(paymentRequestID strfmt.UUID) *UpdatePaymentRequestStatusParams { + o.SetPaymentRequestID(paymentRequestID) + return o +} + +// SetPaymentRequestID adds the paymentRequestId to the update payment request status params +func (o *UpdatePaymentRequestStatusParams) SetPaymentRequestID(paymentRequestID strfmt.UUID) { + o.PaymentRequestID = paymentRequestID +} + +// WriteToRequest writes these params to a swagger request +func (o *UpdatePaymentRequestStatusParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + + // header param If-Match + if err := r.SetHeaderParam("If-Match", o.IfMatch); err != nil { + return err + } + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + // path param paymentRequestID + if err := r.SetPathParam("paymentRequestID", o.PaymentRequestID.String()); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go b/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go new file mode 100644 index 00000000000..a6b142179ac --- /dev/null +++ b/pkg/gen/supportclient/payment_request/update_payment_request_status_responses.go @@ -0,0 +1,695 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package payment_request + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// UpdatePaymentRequestStatusReader is a Reader for the UpdatePaymentRequestStatus structure. +type UpdatePaymentRequestStatusReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *UpdatePaymentRequestStatusReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewUpdatePaymentRequestStatusOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewUpdatePaymentRequestStatusBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewUpdatePaymentRequestStatusUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewUpdatePaymentRequestStatusForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 404: + result := NewUpdatePaymentRequestStatusNotFound() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 409: + result := NewUpdatePaymentRequestStatusConflict() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 412: + result := NewUpdatePaymentRequestStatusPreconditionFailed() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 422: + result := NewUpdatePaymentRequestStatusUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewUpdatePaymentRequestStatusInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[PATCH /payment-requests/{paymentRequestID}/status] updatePaymentRequestStatus", response, response.Code()) + } +} + +// NewUpdatePaymentRequestStatusOK creates a UpdatePaymentRequestStatusOK with default headers values +func NewUpdatePaymentRequestStatusOK() *UpdatePaymentRequestStatusOK { + return &UpdatePaymentRequestStatusOK{} +} + +/* +UpdatePaymentRequestStatusOK describes a response with status code 200, with default header values. + +Successfully updated payment request status. +*/ +type UpdatePaymentRequestStatusOK struct { + Payload *supportmessages.PaymentRequest +} + +// IsSuccess returns true when this update payment request status o k response has a 2xx status code +func (o *UpdatePaymentRequestStatusOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this update payment request status o k response has a 3xx status code +func (o *UpdatePaymentRequestStatusOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status o k response has a 4xx status code +func (o *UpdatePaymentRequestStatusOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this update payment request status o k response has a 5xx status code +func (o *UpdatePaymentRequestStatusOK) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status o k response a status code equal to that given +func (o *UpdatePaymentRequestStatusOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the update payment request status o k response +func (o *UpdatePaymentRequestStatusOK) Code() int { + return 200 +} + +func (o *UpdatePaymentRequestStatusOK) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusOK %+v", 200, o.Payload) +} + +func (o *UpdatePaymentRequestStatusOK) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusOK %+v", 200, o.Payload) +} + +func (o *UpdatePaymentRequestStatusOK) GetPayload() *supportmessages.PaymentRequest { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.PaymentRequest) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusBadRequest creates a UpdatePaymentRequestStatusBadRequest with default headers values +func NewUpdatePaymentRequestStatusBadRequest() *UpdatePaymentRequestStatusBadRequest { + return &UpdatePaymentRequestStatusBadRequest{} +} + +/* +UpdatePaymentRequestStatusBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type UpdatePaymentRequestStatusBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status bad request response has a 2xx status code +func (o *UpdatePaymentRequestStatusBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status bad request response has a 3xx status code +func (o *UpdatePaymentRequestStatusBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status bad request response has a 4xx status code +func (o *UpdatePaymentRequestStatusBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status bad request response has a 5xx status code +func (o *UpdatePaymentRequestStatusBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status bad request response a status code equal to that given +func (o *UpdatePaymentRequestStatusBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the update payment request status bad request response +func (o *UpdatePaymentRequestStatusBadRequest) Code() int { + return 400 +} + +func (o *UpdatePaymentRequestStatusBadRequest) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdatePaymentRequestStatusBadRequest) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusBadRequest %+v", 400, o.Payload) +} + +func (o *UpdatePaymentRequestStatusBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusUnauthorized creates a UpdatePaymentRequestStatusUnauthorized with default headers values +func NewUpdatePaymentRequestStatusUnauthorized() *UpdatePaymentRequestStatusUnauthorized { + return &UpdatePaymentRequestStatusUnauthorized{} +} + +/* +UpdatePaymentRequestStatusUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type UpdatePaymentRequestStatusUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status unauthorized response has a 2xx status code +func (o *UpdatePaymentRequestStatusUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status unauthorized response has a 3xx status code +func (o *UpdatePaymentRequestStatusUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status unauthorized response has a 4xx status code +func (o *UpdatePaymentRequestStatusUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status unauthorized response has a 5xx status code +func (o *UpdatePaymentRequestStatusUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status unauthorized response a status code equal to that given +func (o *UpdatePaymentRequestStatusUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the update payment request status unauthorized response +func (o *UpdatePaymentRequestStatusUnauthorized) Code() int { + return 401 +} + +func (o *UpdatePaymentRequestStatusUnauthorized) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdatePaymentRequestStatusUnauthorized) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnauthorized %+v", 401, o.Payload) +} + +func (o *UpdatePaymentRequestStatusUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusForbidden creates a UpdatePaymentRequestStatusForbidden with default headers values +func NewUpdatePaymentRequestStatusForbidden() *UpdatePaymentRequestStatusForbidden { + return &UpdatePaymentRequestStatusForbidden{} +} + +/* +UpdatePaymentRequestStatusForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type UpdatePaymentRequestStatusForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status forbidden response has a 2xx status code +func (o *UpdatePaymentRequestStatusForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status forbidden response has a 3xx status code +func (o *UpdatePaymentRequestStatusForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status forbidden response has a 4xx status code +func (o *UpdatePaymentRequestStatusForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status forbidden response has a 5xx status code +func (o *UpdatePaymentRequestStatusForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status forbidden response a status code equal to that given +func (o *UpdatePaymentRequestStatusForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the update payment request status forbidden response +func (o *UpdatePaymentRequestStatusForbidden) Code() int { + return 403 +} + +func (o *UpdatePaymentRequestStatusForbidden) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdatePaymentRequestStatusForbidden) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusForbidden %+v", 403, o.Payload) +} + +func (o *UpdatePaymentRequestStatusForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusNotFound creates a UpdatePaymentRequestStatusNotFound with default headers values +func NewUpdatePaymentRequestStatusNotFound() *UpdatePaymentRequestStatusNotFound { + return &UpdatePaymentRequestStatusNotFound{} +} + +/* +UpdatePaymentRequestStatusNotFound describes a response with status code 404, with default header values. + +The requested resource wasn't found. +*/ +type UpdatePaymentRequestStatusNotFound struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status not found response has a 2xx status code +func (o *UpdatePaymentRequestStatusNotFound) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status not found response has a 3xx status code +func (o *UpdatePaymentRequestStatusNotFound) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status not found response has a 4xx status code +func (o *UpdatePaymentRequestStatusNotFound) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status not found response has a 5xx status code +func (o *UpdatePaymentRequestStatusNotFound) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status not found response a status code equal to that given +func (o *UpdatePaymentRequestStatusNotFound) IsCode(code int) bool { + return code == 404 +} + +// Code gets the status code for the update payment request status not found response +func (o *UpdatePaymentRequestStatusNotFound) Code() int { + return 404 +} + +func (o *UpdatePaymentRequestStatusNotFound) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdatePaymentRequestStatusNotFound) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusNotFound %+v", 404, o.Payload) +} + +func (o *UpdatePaymentRequestStatusNotFound) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusNotFound) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusConflict creates a UpdatePaymentRequestStatusConflict with default headers values +func NewUpdatePaymentRequestStatusConflict() *UpdatePaymentRequestStatusConflict { + return &UpdatePaymentRequestStatusConflict{} +} + +/* +UpdatePaymentRequestStatusConflict describes a response with status code 409, with default header values. + +There was a conflict with the request. +*/ +type UpdatePaymentRequestStatusConflict struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status conflict response has a 2xx status code +func (o *UpdatePaymentRequestStatusConflict) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status conflict response has a 3xx status code +func (o *UpdatePaymentRequestStatusConflict) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status conflict response has a 4xx status code +func (o *UpdatePaymentRequestStatusConflict) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status conflict response has a 5xx status code +func (o *UpdatePaymentRequestStatusConflict) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status conflict response a status code equal to that given +func (o *UpdatePaymentRequestStatusConflict) IsCode(code int) bool { + return code == 409 +} + +// Code gets the status code for the update payment request status conflict response +func (o *UpdatePaymentRequestStatusConflict) Code() int { + return 409 +} + +func (o *UpdatePaymentRequestStatusConflict) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdatePaymentRequestStatusConflict) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusConflict %+v", 409, o.Payload) +} + +func (o *UpdatePaymentRequestStatusConflict) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusConflict) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusPreconditionFailed creates a UpdatePaymentRequestStatusPreconditionFailed with default headers values +func NewUpdatePaymentRequestStatusPreconditionFailed() *UpdatePaymentRequestStatusPreconditionFailed { + return &UpdatePaymentRequestStatusPreconditionFailed{} +} + +/* +UpdatePaymentRequestStatusPreconditionFailed describes a response with status code 412, with default header values. + +Precondition failed, likely due to a stale eTag (If-Match). Fetch the request again to get the updated eTag value. +*/ +type UpdatePaymentRequestStatusPreconditionFailed struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this update payment request status precondition failed response has a 2xx status code +func (o *UpdatePaymentRequestStatusPreconditionFailed) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status precondition failed response has a 3xx status code +func (o *UpdatePaymentRequestStatusPreconditionFailed) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status precondition failed response has a 4xx status code +func (o *UpdatePaymentRequestStatusPreconditionFailed) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status precondition failed response has a 5xx status code +func (o *UpdatePaymentRequestStatusPreconditionFailed) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status precondition failed response a status code equal to that given +func (o *UpdatePaymentRequestStatusPreconditionFailed) IsCode(code int) bool { + return code == 412 +} + +// Code gets the status code for the update payment request status precondition failed response +func (o *UpdatePaymentRequestStatusPreconditionFailed) Code() int { + return 412 +} + +func (o *UpdatePaymentRequestStatusPreconditionFailed) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdatePaymentRequestStatusPreconditionFailed) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusPreconditionFailed %+v", 412, o.Payload) +} + +func (o *UpdatePaymentRequestStatusPreconditionFailed) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusPreconditionFailed) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusUnprocessableEntity creates a UpdatePaymentRequestStatusUnprocessableEntity with default headers values +func NewUpdatePaymentRequestStatusUnprocessableEntity() *UpdatePaymentRequestStatusUnprocessableEntity { + return &UpdatePaymentRequestStatusUnprocessableEntity{} +} + +/* +UpdatePaymentRequestStatusUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type UpdatePaymentRequestStatusUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this update payment request status unprocessable entity response has a 2xx status code +func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status unprocessable entity response has a 3xx status code +func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status unprocessable entity response has a 4xx status code +func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this update payment request status unprocessable entity response has a 5xx status code +func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this update payment request status unprocessable entity response a status code equal to that given +func (o *UpdatePaymentRequestStatusUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the update payment request status unprocessable entity response +func (o *UpdatePaymentRequestStatusUnprocessableEntity) Code() int { + return 422 +} + +func (o *UpdatePaymentRequestStatusUnprocessableEntity) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdatePaymentRequestStatusUnprocessableEntity) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *UpdatePaymentRequestStatusUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewUpdatePaymentRequestStatusInternalServerError creates a UpdatePaymentRequestStatusInternalServerError with default headers values +func NewUpdatePaymentRequestStatusInternalServerError() *UpdatePaymentRequestStatusInternalServerError { + return &UpdatePaymentRequestStatusInternalServerError{} +} + +/* +UpdatePaymentRequestStatusInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type UpdatePaymentRequestStatusInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this update payment request status internal server error response has a 2xx status code +func (o *UpdatePaymentRequestStatusInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this update payment request status internal server error response has a 3xx status code +func (o *UpdatePaymentRequestStatusInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this update payment request status internal server error response has a 4xx status code +func (o *UpdatePaymentRequestStatusInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this update payment request status internal server error response has a 5xx status code +func (o *UpdatePaymentRequestStatusInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this update payment request status internal server error response a status code equal to that given +func (o *UpdatePaymentRequestStatusInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the update payment request status internal server error response +func (o *UpdatePaymentRequestStatusInternalServerError) Code() int { + return 500 +} + +func (o *UpdatePaymentRequestStatusInternalServerError) Error() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdatePaymentRequestStatusInternalServerError) String() string { + return fmt.Sprintf("[PATCH /payment-requests/{paymentRequestID}/status][%d] updatePaymentRequestStatusInternalServerError %+v", 500, o.Payload) +} + +func (o *UpdatePaymentRequestStatusInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *UpdatePaymentRequestStatusInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go b/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go new file mode 100644 index 00000000000..9b4ee14ea55 --- /dev/null +++ b/pkg/gen/supportclient/webhook/create_webhook_notification_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewCreateWebhookNotificationParams creates a new CreateWebhookNotificationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewCreateWebhookNotificationParams() *CreateWebhookNotificationParams { + return &CreateWebhookNotificationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewCreateWebhookNotificationParamsWithTimeout creates a new CreateWebhookNotificationParams object +// with the ability to set a timeout on a request. +func NewCreateWebhookNotificationParamsWithTimeout(timeout time.Duration) *CreateWebhookNotificationParams { + return &CreateWebhookNotificationParams{ + timeout: timeout, + } +} + +// NewCreateWebhookNotificationParamsWithContext creates a new CreateWebhookNotificationParams object +// with the ability to set a context for a request. +func NewCreateWebhookNotificationParamsWithContext(ctx context.Context) *CreateWebhookNotificationParams { + return &CreateWebhookNotificationParams{ + Context: ctx, + } +} + +// NewCreateWebhookNotificationParamsWithHTTPClient creates a new CreateWebhookNotificationParams object +// with the ability to set a custom HTTPClient for a request. +func NewCreateWebhookNotificationParamsWithHTTPClient(client *http.Client) *CreateWebhookNotificationParams { + return &CreateWebhookNotificationParams{ + HTTPClient: client, + } +} + +/* +CreateWebhookNotificationParams contains all the parameters to send to the API endpoint + + for the create webhook notification operation. + + Typically these are written to a http.Request. +*/ +type CreateWebhookNotificationParams struct { + + /* Body. + + The notification sent by webhook-client. + */ + Body *supportmessages.WebhookNotification + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the create webhook notification params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateWebhookNotificationParams) WithDefaults() *CreateWebhookNotificationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the create webhook notification params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *CreateWebhookNotificationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the create webhook notification params +func (o *CreateWebhookNotificationParams) WithTimeout(timeout time.Duration) *CreateWebhookNotificationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the create webhook notification params +func (o *CreateWebhookNotificationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the create webhook notification params +func (o *CreateWebhookNotificationParams) WithContext(ctx context.Context) *CreateWebhookNotificationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the create webhook notification params +func (o *CreateWebhookNotificationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the create webhook notification params +func (o *CreateWebhookNotificationParams) WithHTTPClient(client *http.Client) *CreateWebhookNotificationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the create webhook notification params +func (o *CreateWebhookNotificationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the create webhook notification params +func (o *CreateWebhookNotificationParams) WithBody(body *supportmessages.WebhookNotification) *CreateWebhookNotificationParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the create webhook notification params +func (o *CreateWebhookNotificationParams) SetBody(body *supportmessages.WebhookNotification) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *CreateWebhookNotificationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go b/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go new file mode 100644 index 00000000000..c12b9427076 --- /dev/null +++ b/pkg/gen/supportclient/webhook/create_webhook_notification_responses.go @@ -0,0 +1,251 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// CreateWebhookNotificationReader is a Reader for the CreateWebhookNotification structure. +type CreateWebhookNotificationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *CreateWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 201: + result := NewCreateWebhookNotificationCreated() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 422: + result := NewCreateWebhookNotificationUnprocessableEntity() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewCreateWebhookNotificationInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /webhook-notifications] createWebhookNotification", response, response.Code()) + } +} + +// NewCreateWebhookNotificationCreated creates a CreateWebhookNotificationCreated with default headers values +func NewCreateWebhookNotificationCreated() *CreateWebhookNotificationCreated { + return &CreateWebhookNotificationCreated{} +} + +/* +CreateWebhookNotificationCreated describes a response with status code 201, with default header values. + +Successful creation +*/ +type CreateWebhookNotificationCreated struct { + Payload *supportmessages.WebhookNotification +} + +// IsSuccess returns true when this create webhook notification created response has a 2xx status code +func (o *CreateWebhookNotificationCreated) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this create webhook notification created response has a 3xx status code +func (o *CreateWebhookNotificationCreated) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create webhook notification created response has a 4xx status code +func (o *CreateWebhookNotificationCreated) IsClientError() bool { + return false +} + +// IsServerError returns true when this create webhook notification created response has a 5xx status code +func (o *CreateWebhookNotificationCreated) IsServerError() bool { + return false +} + +// IsCode returns true when this create webhook notification created response a status code equal to that given +func (o *CreateWebhookNotificationCreated) IsCode(code int) bool { + return code == 201 +} + +// Code gets the status code for the create webhook notification created response +func (o *CreateWebhookNotificationCreated) Code() int { + return 201 +} + +func (o *CreateWebhookNotificationCreated) Error() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationCreated %+v", 201, o.Payload) +} + +func (o *CreateWebhookNotificationCreated) String() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationCreated %+v", 201, o.Payload) +} + +func (o *CreateWebhookNotificationCreated) GetPayload() *supportmessages.WebhookNotification { + return o.Payload +} + +func (o *CreateWebhookNotificationCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.WebhookNotification) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateWebhookNotificationUnprocessableEntity creates a CreateWebhookNotificationUnprocessableEntity with default headers values +func NewCreateWebhookNotificationUnprocessableEntity() *CreateWebhookNotificationUnprocessableEntity { + return &CreateWebhookNotificationUnprocessableEntity{} +} + +/* +CreateWebhookNotificationUnprocessableEntity describes a response with status code 422, with default header values. + +The payload was unprocessable. +*/ +type CreateWebhookNotificationUnprocessableEntity struct { + Payload *supportmessages.ValidationError +} + +// IsSuccess returns true when this create webhook notification unprocessable entity response has a 2xx status code +func (o *CreateWebhookNotificationUnprocessableEntity) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create webhook notification unprocessable entity response has a 3xx status code +func (o *CreateWebhookNotificationUnprocessableEntity) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create webhook notification unprocessable entity response has a 4xx status code +func (o *CreateWebhookNotificationUnprocessableEntity) IsClientError() bool { + return true +} + +// IsServerError returns true when this create webhook notification unprocessable entity response has a 5xx status code +func (o *CreateWebhookNotificationUnprocessableEntity) IsServerError() bool { + return false +} + +// IsCode returns true when this create webhook notification unprocessable entity response a status code equal to that given +func (o *CreateWebhookNotificationUnprocessableEntity) IsCode(code int) bool { + return code == 422 +} + +// Code gets the status code for the create webhook notification unprocessable entity response +func (o *CreateWebhookNotificationUnprocessableEntity) Code() int { + return 422 +} + +func (o *CreateWebhookNotificationUnprocessableEntity) Error() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateWebhookNotificationUnprocessableEntity) String() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationUnprocessableEntity %+v", 422, o.Payload) +} + +func (o *CreateWebhookNotificationUnprocessableEntity) GetPayload() *supportmessages.ValidationError { + return o.Payload +} + +func (o *CreateWebhookNotificationUnprocessableEntity) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ValidationError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewCreateWebhookNotificationInternalServerError creates a CreateWebhookNotificationInternalServerError with default headers values +func NewCreateWebhookNotificationInternalServerError() *CreateWebhookNotificationInternalServerError { + return &CreateWebhookNotificationInternalServerError{} +} + +/* +CreateWebhookNotificationInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type CreateWebhookNotificationInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this create webhook notification internal server error response has a 2xx status code +func (o *CreateWebhookNotificationInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this create webhook notification internal server error response has a 3xx status code +func (o *CreateWebhookNotificationInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this create webhook notification internal server error response has a 4xx status code +func (o *CreateWebhookNotificationInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this create webhook notification internal server error response has a 5xx status code +func (o *CreateWebhookNotificationInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this create webhook notification internal server error response a status code equal to that given +func (o *CreateWebhookNotificationInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the create webhook notification internal server error response +func (o *CreateWebhookNotificationInternalServerError) Code() int { + return 500 +} + +func (o *CreateWebhookNotificationInternalServerError) Error() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateWebhookNotificationInternalServerError) String() string { + return fmt.Sprintf("[POST /webhook-notifications][%d] createWebhookNotificationInternalServerError %+v", 500, o.Payload) +} + +func (o *CreateWebhookNotificationInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *CreateWebhookNotificationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go b/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go new file mode 100644 index 00000000000..f42c1ff0445 --- /dev/null +++ b/pkg/gen/supportclient/webhook/receive_webhook_notification_parameters.go @@ -0,0 +1,153 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// NewReceiveWebhookNotificationParams creates a new ReceiveWebhookNotificationParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewReceiveWebhookNotificationParams() *ReceiveWebhookNotificationParams { + return &ReceiveWebhookNotificationParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewReceiveWebhookNotificationParamsWithTimeout creates a new ReceiveWebhookNotificationParams object +// with the ability to set a timeout on a request. +func NewReceiveWebhookNotificationParamsWithTimeout(timeout time.Duration) *ReceiveWebhookNotificationParams { + return &ReceiveWebhookNotificationParams{ + timeout: timeout, + } +} + +// NewReceiveWebhookNotificationParamsWithContext creates a new ReceiveWebhookNotificationParams object +// with the ability to set a context for a request. +func NewReceiveWebhookNotificationParamsWithContext(ctx context.Context) *ReceiveWebhookNotificationParams { + return &ReceiveWebhookNotificationParams{ + Context: ctx, + } +} + +// NewReceiveWebhookNotificationParamsWithHTTPClient creates a new ReceiveWebhookNotificationParams object +// with the ability to set a custom HTTPClient for a request. +func NewReceiveWebhookNotificationParamsWithHTTPClient(client *http.Client) *ReceiveWebhookNotificationParams { + return &ReceiveWebhookNotificationParams{ + HTTPClient: client, + } +} + +/* +ReceiveWebhookNotificationParams contains all the parameters to send to the API endpoint + + for the receive webhook notification operation. + + Typically these are written to a http.Request. +*/ +type ReceiveWebhookNotificationParams struct { + + /* Body. + + The webhook notification being sent + */ + Body *supportmessages.WebhookNotification + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the receive webhook notification params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReceiveWebhookNotificationParams) WithDefaults() *ReceiveWebhookNotificationParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the receive webhook notification params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *ReceiveWebhookNotificationParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) WithTimeout(timeout time.Duration) *ReceiveWebhookNotificationParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) WithContext(ctx context.Context) *ReceiveWebhookNotificationParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) WithHTTPClient(client *http.Client) *ReceiveWebhookNotificationParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) WithBody(body *supportmessages.WebhookNotification) *ReceiveWebhookNotificationParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the receive webhook notification params +func (o *ReceiveWebhookNotificationParams) SetBody(body *supportmessages.WebhookNotification) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *ReceiveWebhookNotificationParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if o.Body != nil { + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go b/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go new file mode 100644 index 00000000000..ad7f5cadcb3 --- /dev/null +++ b/pkg/gen/supportclient/webhook/receive_webhook_notification_responses.go @@ -0,0 +1,399 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// 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" + "github.com/go-openapi/strfmt" + + "github.com/transcom/mymove/pkg/gen/supportmessages" +) + +// ReceiveWebhookNotificationReader is a Reader for the ReceiveWebhookNotification structure. +type ReceiveWebhookNotificationReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *ReceiveWebhookNotificationReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewReceiveWebhookNotificationOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + case 400: + result := NewReceiveWebhookNotificationBadRequest() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 401: + result := NewReceiveWebhookNotificationUnauthorized() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 403: + result := NewReceiveWebhookNotificationForbidden() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + case 500: + result := NewReceiveWebhookNotificationInternalServerError() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return nil, result + default: + return nil, runtime.NewAPIError("[POST /webhook-notify] receiveWebhookNotification", response, response.Code()) + } +} + +// NewReceiveWebhookNotificationOK creates a ReceiveWebhookNotificationOK with default headers values +func NewReceiveWebhookNotificationOK() *ReceiveWebhookNotificationOK { + return &ReceiveWebhookNotificationOK{} +} + +/* +ReceiveWebhookNotificationOK describes a response with status code 200, with default header values. + +Received notification +*/ +type ReceiveWebhookNotificationOK struct { + Payload *supportmessages.WebhookNotification +} + +// IsSuccess returns true when this receive webhook notification o k response has a 2xx status code +func (o *ReceiveWebhookNotificationOK) IsSuccess() bool { + return true +} + +// IsRedirect returns true when this receive webhook notification o k response has a 3xx status code +func (o *ReceiveWebhookNotificationOK) IsRedirect() bool { + return false +} + +// IsClientError returns true when this receive webhook notification o k response has a 4xx status code +func (o *ReceiveWebhookNotificationOK) IsClientError() bool { + return false +} + +// IsServerError returns true when this receive webhook notification o k response has a 5xx status code +func (o *ReceiveWebhookNotificationOK) IsServerError() bool { + return false +} + +// IsCode returns true when this receive webhook notification o k response a status code equal to that given +func (o *ReceiveWebhookNotificationOK) IsCode(code int) bool { + return code == 200 +} + +// Code gets the status code for the receive webhook notification o k response +func (o *ReceiveWebhookNotificationOK) Code() int { + return 200 +} + +func (o *ReceiveWebhookNotificationOK) Error() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationOK %+v", 200, o.Payload) +} + +func (o *ReceiveWebhookNotificationOK) String() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationOK %+v", 200, o.Payload) +} + +func (o *ReceiveWebhookNotificationOK) GetPayload() *supportmessages.WebhookNotification { + return o.Payload +} + +func (o *ReceiveWebhookNotificationOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.WebhookNotification) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReceiveWebhookNotificationBadRequest creates a ReceiveWebhookNotificationBadRequest with default headers values +func NewReceiveWebhookNotificationBadRequest() *ReceiveWebhookNotificationBadRequest { + return &ReceiveWebhookNotificationBadRequest{} +} + +/* +ReceiveWebhookNotificationBadRequest describes a response with status code 400, with default header values. + +The request payload is invalid. +*/ +type ReceiveWebhookNotificationBadRequest struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this receive webhook notification bad request response has a 2xx status code +func (o *ReceiveWebhookNotificationBadRequest) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this receive webhook notification bad request response has a 3xx status code +func (o *ReceiveWebhookNotificationBadRequest) IsRedirect() bool { + return false +} + +// IsClientError returns true when this receive webhook notification bad request response has a 4xx status code +func (o *ReceiveWebhookNotificationBadRequest) IsClientError() bool { + return true +} + +// IsServerError returns true when this receive webhook notification bad request response has a 5xx status code +func (o *ReceiveWebhookNotificationBadRequest) IsServerError() bool { + return false +} + +// IsCode returns true when this receive webhook notification bad request response a status code equal to that given +func (o *ReceiveWebhookNotificationBadRequest) IsCode(code int) bool { + return code == 400 +} + +// Code gets the status code for the receive webhook notification bad request response +func (o *ReceiveWebhookNotificationBadRequest) Code() int { + return 400 +} + +func (o *ReceiveWebhookNotificationBadRequest) Error() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationBadRequest %+v", 400, o.Payload) +} + +func (o *ReceiveWebhookNotificationBadRequest) String() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationBadRequest %+v", 400, o.Payload) +} + +func (o *ReceiveWebhookNotificationBadRequest) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ReceiveWebhookNotificationBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReceiveWebhookNotificationUnauthorized creates a ReceiveWebhookNotificationUnauthorized with default headers values +func NewReceiveWebhookNotificationUnauthorized() *ReceiveWebhookNotificationUnauthorized { + return &ReceiveWebhookNotificationUnauthorized{} +} + +/* +ReceiveWebhookNotificationUnauthorized describes a response with status code 401, with default header values. + +The request was denied. +*/ +type ReceiveWebhookNotificationUnauthorized struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this receive webhook notification unauthorized response has a 2xx status code +func (o *ReceiveWebhookNotificationUnauthorized) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this receive webhook notification unauthorized response has a 3xx status code +func (o *ReceiveWebhookNotificationUnauthorized) IsRedirect() bool { + return false +} + +// IsClientError returns true when this receive webhook notification unauthorized response has a 4xx status code +func (o *ReceiveWebhookNotificationUnauthorized) IsClientError() bool { + return true +} + +// IsServerError returns true when this receive webhook notification unauthorized response has a 5xx status code +func (o *ReceiveWebhookNotificationUnauthorized) IsServerError() bool { + return false +} + +// IsCode returns true when this receive webhook notification unauthorized response a status code equal to that given +func (o *ReceiveWebhookNotificationUnauthorized) IsCode(code int) bool { + return code == 401 +} + +// Code gets the status code for the receive webhook notification unauthorized response +func (o *ReceiveWebhookNotificationUnauthorized) Code() int { + return 401 +} + +func (o *ReceiveWebhookNotificationUnauthorized) Error() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationUnauthorized %+v", 401, o.Payload) +} + +func (o *ReceiveWebhookNotificationUnauthorized) String() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationUnauthorized %+v", 401, o.Payload) +} + +func (o *ReceiveWebhookNotificationUnauthorized) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ReceiveWebhookNotificationUnauthorized) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReceiveWebhookNotificationForbidden creates a ReceiveWebhookNotificationForbidden with default headers values +func NewReceiveWebhookNotificationForbidden() *ReceiveWebhookNotificationForbidden { + return &ReceiveWebhookNotificationForbidden{} +} + +/* +ReceiveWebhookNotificationForbidden describes a response with status code 403, with default header values. + +The request was denied. +*/ +type ReceiveWebhookNotificationForbidden struct { + Payload *supportmessages.ClientError +} + +// IsSuccess returns true when this receive webhook notification forbidden response has a 2xx status code +func (o *ReceiveWebhookNotificationForbidden) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this receive webhook notification forbidden response has a 3xx status code +func (o *ReceiveWebhookNotificationForbidden) IsRedirect() bool { + return false +} + +// IsClientError returns true when this receive webhook notification forbidden response has a 4xx status code +func (o *ReceiveWebhookNotificationForbidden) IsClientError() bool { + return true +} + +// IsServerError returns true when this receive webhook notification forbidden response has a 5xx status code +func (o *ReceiveWebhookNotificationForbidden) IsServerError() bool { + return false +} + +// IsCode returns true when this receive webhook notification forbidden response a status code equal to that given +func (o *ReceiveWebhookNotificationForbidden) IsCode(code int) bool { + return code == 403 +} + +// Code gets the status code for the receive webhook notification forbidden response +func (o *ReceiveWebhookNotificationForbidden) Code() int { + return 403 +} + +func (o *ReceiveWebhookNotificationForbidden) Error() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationForbidden %+v", 403, o.Payload) +} + +func (o *ReceiveWebhookNotificationForbidden) String() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationForbidden %+v", 403, o.Payload) +} + +func (o *ReceiveWebhookNotificationForbidden) GetPayload() *supportmessages.ClientError { + return o.Payload +} + +func (o *ReceiveWebhookNotificationForbidden) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.ClientError) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewReceiveWebhookNotificationInternalServerError creates a ReceiveWebhookNotificationInternalServerError with default headers values +func NewReceiveWebhookNotificationInternalServerError() *ReceiveWebhookNotificationInternalServerError { + return &ReceiveWebhookNotificationInternalServerError{} +} + +/* +ReceiveWebhookNotificationInternalServerError describes a response with status code 500, with default header values. + +A server error occurred. +*/ +type ReceiveWebhookNotificationInternalServerError struct { + Payload *supportmessages.Error +} + +// IsSuccess returns true when this receive webhook notification internal server error response has a 2xx status code +func (o *ReceiveWebhookNotificationInternalServerError) IsSuccess() bool { + return false +} + +// IsRedirect returns true when this receive webhook notification internal server error response has a 3xx status code +func (o *ReceiveWebhookNotificationInternalServerError) IsRedirect() bool { + return false +} + +// IsClientError returns true when this receive webhook notification internal server error response has a 4xx status code +func (o *ReceiveWebhookNotificationInternalServerError) IsClientError() bool { + return false +} + +// IsServerError returns true when this receive webhook notification internal server error response has a 5xx status code +func (o *ReceiveWebhookNotificationInternalServerError) IsServerError() bool { + return true +} + +// IsCode returns true when this receive webhook notification internal server error response a status code equal to that given +func (o *ReceiveWebhookNotificationInternalServerError) IsCode(code int) bool { + return code == 500 +} + +// Code gets the status code for the receive webhook notification internal server error response +func (o *ReceiveWebhookNotificationInternalServerError) Code() int { + return 500 +} + +func (o *ReceiveWebhookNotificationInternalServerError) Error() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationInternalServerError %+v", 500, o.Payload) +} + +func (o *ReceiveWebhookNotificationInternalServerError) String() string { + return fmt.Sprintf("[POST /webhook-notify][%d] receiveWebhookNotificationInternalServerError %+v", 500, o.Payload) +} + +func (o *ReceiveWebhookNotificationInternalServerError) GetPayload() *supportmessages.Error { + return o.Payload +} + +func (o *ReceiveWebhookNotificationInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + + o.Payload = new(supportmessages.Error) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} diff --git a/pkg/gen/supportclient/webhook/webhook_client.go b/pkg/gen/supportclient/webhook/webhook_client.go new file mode 100644 index 00000000000..0c645fb4d8b --- /dev/null +++ b/pkg/gen/supportclient/webhook/webhook_client.go @@ -0,0 +1,123 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package webhook + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "fmt" + + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" +) + +// New creates a new webhook API client. +func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService { + return &Client{transport: transport, formats: formats} +} + +/* +Client for webhook API +*/ +type Client struct { + transport runtime.ClientTransport + formats strfmt.Registry +} + +// ClientOption is the option for Client methods +type ClientOption func(*runtime.ClientOperation) + +// ClientService is the interface for Client methods +type ClientService interface { + CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error) + + ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error) + + SetTransport(transport runtime.ClientTransport) +} + +/* +CreateWebhookNotification tests endpoint for creating webhook notifications + +This endpoint creates a webhook notification in the database. If the webhook client is running, it may send the notification soon after creation. +*/ +func (a *Client) CreateWebhookNotification(params *CreateWebhookNotificationParams, opts ...ClientOption) (*CreateWebhookNotificationCreated, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewCreateWebhookNotificationParams() + } + op := &runtime.ClientOperation{ + ID: "createWebhookNotification", + Method: "POST", + PathPattern: "/webhook-notifications", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &CreateWebhookNotificationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*CreateWebhookNotificationCreated) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for createWebhookNotification: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +/* +ReceiveWebhookNotification tests endpoint for receiving messages from our own webhook client + +This endpoint receives a notification that matches the webhook notification model. This is a test endpoint that represents a receiving server. In production, the Prime will set up a receiving endpoint. In testing, this server accepts notifications at this endpoint and simply responds with success and logs them. The `webhook-client` is responsible for retrieving messages from the webhook_notifications table and sending them to the Prime (this endpoint in our testing case) via an mTLS connection. +*/ +func (a *Client) ReceiveWebhookNotification(params *ReceiveWebhookNotificationParams, opts ...ClientOption) (*ReceiveWebhookNotificationOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewReceiveWebhookNotificationParams() + } + op := &runtime.ClientOperation{ + ID: "receiveWebhookNotification", + Method: "POST", + PathPattern: "/webhook-notify", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http"}, + Params: params, + Reader: &ReceiveWebhookNotificationReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*ReceiveWebhookNotificationOK) + if ok { + return success, nil + } + // unexpected success response + // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue + msg := fmt.Sprintf("unexpected success response for receiveWebhookNotification: API contract not enforced by server. Client expected to get an error, but got: %T", result) + panic(msg) +} + +// SetTransport changes the transport on the client +func (a *Client) SetTransport(transport runtime.ClientTransport) { + a.transport = transport +} diff --git a/pkg/gen/supportmessages/orders_type_detail.go b/pkg/gen/supportmessages/orders_type_detail.go new file mode 100644 index 00000000000..55d6d1e2f10 --- /dev/null +++ b/pkg/gen/supportmessages/orders_type_detail.go @@ -0,0 +1,93 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// OrdersTypeDetail Orders type detail +// +// swagger:model OrdersTypeDetail +type OrdersTypeDetail string + +func NewOrdersTypeDetail(value OrdersTypeDetail) *OrdersTypeDetail { + return &value +} + +// Pointer returns a pointer to a freshly-allocated OrdersTypeDetail. +func (m OrdersTypeDetail) Pointer() *OrdersTypeDetail { + return &m +} + +const ( + + // OrdersTypeDetailHHGPERMITTED captures enum value "HHG_PERMITTED" + OrdersTypeDetailHHGPERMITTED OrdersTypeDetail = "HHG_PERMITTED" + + // OrdersTypeDetailPCSTDY captures enum value "PCS_TDY" + OrdersTypeDetailPCSTDY OrdersTypeDetail = "PCS_TDY" + + // OrdersTypeDetailHHGRESTRICTEDPROHIBITED captures enum value "HHG_RESTRICTED_PROHIBITED" + OrdersTypeDetailHHGRESTRICTEDPROHIBITED OrdersTypeDetail = "HHG_RESTRICTED_PROHIBITED" + + // OrdersTypeDetailHHGRESTRICTEDAREA captures enum value "HHG_RESTRICTED_AREA" + OrdersTypeDetailHHGRESTRICTEDAREA OrdersTypeDetail = "HHG_RESTRICTED_AREA" + + // OrdersTypeDetailINSTRUCTION20WEEKS captures enum value "INSTRUCTION_20_WEEKS" + OrdersTypeDetailINSTRUCTION20WEEKS OrdersTypeDetail = "INSTRUCTION_20_WEEKS" + + // OrdersTypeDetailHHGPROHIBITED20WEEKS captures enum value "HHG_PROHIBITED_20_WEEKS" + OrdersTypeDetailHHGPROHIBITED20WEEKS OrdersTypeDetail = "HHG_PROHIBITED_20_WEEKS" + + // OrdersTypeDetailDELAYEDAPPROVAL captures enum value "DELAYED_APPROVAL" + OrdersTypeDetailDELAYEDAPPROVAL OrdersTypeDetail = "DELAYED_APPROVAL" +) + +// for schema +var ordersTypeDetailEnum []interface{} + +func init() { + var res []OrdersTypeDetail + if err := json.Unmarshal([]byte(`["HHG_PERMITTED","PCS_TDY","HHG_RESTRICTED_PROHIBITED","HHG_RESTRICTED_AREA","INSTRUCTION_20_WEEKS","HHG_PROHIBITED_20_WEEKS","DELAYED_APPROVAL"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + ordersTypeDetailEnum = append(ordersTypeDetailEnum, v) + } +} + +func (m OrdersTypeDetail) validateOrdersTypeDetailEnum(path, location string, value OrdersTypeDetail) error { + if err := validate.EnumCase(path, location, value, ordersTypeDetailEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this orders type detail +func (m OrdersTypeDetail) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateOrdersTypeDetailEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this orders type detail based on context it is used +func (m OrdersTypeDetail) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/supportmessages/payment_request.go b/pkg/gen/supportmessages/payment_request.go new file mode 100644 index 00000000000..b3bd5e62162 --- /dev/null +++ b/pkg/gen/supportmessages/payment_request.go @@ -0,0 +1,289 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequest payment request +// +// swagger:model PaymentRequest +type PaymentRequest struct { + + // document package + DocumentPackage *ProofOfServicePackage `json:"documentPackage,omitempty"` + + // e tag + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // is final + IsFinal *bool `json:"isFinal,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // payment request number + // Example: 1234-5678-1 + // Read Only: true + PaymentRequestNumber string `json:"paymentRequestNumber,omitempty"` + + // recalculation of payment request ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + RecalculationOfPaymentRequestID *strfmt.UUID `json:"recalculationOfPaymentRequestID,omitempty"` + + // rejection reason + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this payment request +func (m *PaymentRequest) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDocumentPackage(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateRecalculationOfPaymentRequestID(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 *PaymentRequest) validateDocumentPackage(formats strfmt.Registry) error { + if swag.IsZero(m.DocumentPackage) { // not required + return nil + } + + if m.DocumentPackage != nil { + if err := m.DocumentPackage.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("documentPackage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("documentPackage") + } + return err + } + } + + return nil +} + +func (m *PaymentRequest) 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 *PaymentRequest) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) validateRecalculationOfPaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.RecalculationOfPaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("recalculationOfPaymentRequestID", "body", "uuid", m.RecalculationOfPaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this payment request based on the context it is used +func (m *PaymentRequest) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateDocumentPackage(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidatePaymentRequestNumber(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRecalculationOfPaymentRequestID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequest) contextValidateDocumentPackage(ctx context.Context, formats strfmt.Registry) error { + + if m.DocumentPackage != nil { + + if swag.IsZero(m.DocumentPackage) { // not required + return nil + } + + if err := m.DocumentPackage.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("documentPackage") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("documentPackage") + } + return err + } + } + + return nil +} + +func (m *PaymentRequest) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidatePaymentRequestNumber(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "paymentRequestNumber", "body", string(m.PaymentRequestNumber)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateRecalculationOfPaymentRequestID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "recalculationOfPaymentRequestID", "body", m.RecalculationOfPaymentRequestID); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequest) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequest) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequest) UnmarshalBinary(b []byte) error { + var res PaymentRequest + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/payment_request_e_d_i.go b/pkg/gen/supportmessages/payment_request_e_d_i.go new file mode 100644 index 00000000000..c739c6d72d3 --- /dev/null +++ b/pkg/gen/supportmessages/payment_request_e_d_i.go @@ -0,0 +1,111 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// PaymentRequestEDI payment request e d i +// +// swagger:model PaymentRequestEDI +type PaymentRequestEDI struct { + + // edi + // Read Only: true + Edi string `json:"edi,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` +} + +// Validate validates this payment request e d i +func (m *PaymentRequestEDI) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequestEDI) 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 +} + +// ContextValidate validate this payment request e d i based on the context it is used +func (m *PaymentRequestEDI) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateEdi(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *PaymentRequestEDI) contextValidateEdi(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "edi", "body", string(m.Edi)); err != nil { + return err + } + + return nil +} + +func (m *PaymentRequestEDI) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *PaymentRequestEDI) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *PaymentRequestEDI) UnmarshalBinary(b []byte) error { + var res PaymentRequestEDI + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/payment_request_status.go b/pkg/gen/supportmessages/payment_request_status.go new file mode 100644 index 00000000000..3fd718cfb10 --- /dev/null +++ b/pkg/gen/supportmessages/payment_request_status.go @@ -0,0 +1,96 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// PaymentRequestStatus Payment Request Status +// +// swagger:model PaymentRequestStatus +type PaymentRequestStatus string + +func NewPaymentRequestStatus(value PaymentRequestStatus) *PaymentRequestStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated PaymentRequestStatus. +func (m PaymentRequestStatus) Pointer() *PaymentRequestStatus { + return &m +} + +const ( + + // PaymentRequestStatusPENDING captures enum value "PENDING" + PaymentRequestStatusPENDING PaymentRequestStatus = "PENDING" + + // PaymentRequestStatusREVIEWED captures enum value "REVIEWED" + PaymentRequestStatusREVIEWED PaymentRequestStatus = "REVIEWED" + + // PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED captures enum value "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + PaymentRequestStatusREVIEWEDANDALLSERVICEITEMSREJECTED PaymentRequestStatus = "REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED" + + // PaymentRequestStatusSENTTOGEX captures enum value "SENT_TO_GEX" + PaymentRequestStatusSENTTOGEX PaymentRequestStatus = "SENT_TO_GEX" + + // PaymentRequestStatusTPPSRECEIVED captures enum value "TPPS_RECEIVED" + PaymentRequestStatusTPPSRECEIVED PaymentRequestStatus = "TPPS_RECEIVED" + + // PaymentRequestStatusPAID captures enum value "PAID" + PaymentRequestStatusPAID PaymentRequestStatus = "PAID" + + // PaymentRequestStatusEDIERROR captures enum value "EDI_ERROR" + PaymentRequestStatusEDIERROR PaymentRequestStatus = "EDI_ERROR" + + // PaymentRequestStatusDEPRECATED captures enum value "DEPRECATED" + PaymentRequestStatusDEPRECATED PaymentRequestStatus = "DEPRECATED" +) + +// for schema +var paymentRequestStatusEnum []interface{} + +func init() { + var res []PaymentRequestStatus + if err := json.Unmarshal([]byte(`["PENDING","REVIEWED","REVIEWED_AND_ALL_SERVICE_ITEMS_REJECTED","SENT_TO_GEX","TPPS_RECEIVED","PAID","EDI_ERROR","DEPRECATED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + paymentRequestStatusEnum = append(paymentRequestStatusEnum, v) + } +} + +func (m PaymentRequestStatus) validatePaymentRequestStatusEnum(path, location string, value PaymentRequestStatus) error { + if err := validate.EnumCase(path, location, value, paymentRequestStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this payment request status +func (m PaymentRequestStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validatePaymentRequestStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this payment request status based on context it is used +func (m PaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/supportmessages/payment_requests.go b/pkg/gen/supportmessages/payment_requests.go new file mode 100644 index 00000000000..c7802632d9a --- /dev/null +++ b/pkg/gen/supportmessages/payment_requests.go @@ -0,0 +1,78 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// PaymentRequests payment requests +// +// swagger:model PaymentRequests +type PaymentRequests []*PaymentRequest + +// Validate validates this payment requests +func (m PaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + if swag.IsZero(m[i]) { // not required + continue + } + + if m[i] != nil { + if err := m[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validate this payment requests based on the context it is used +func (m PaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + for i := 0; i < len(m); i++ { + + if m[i] != nil { + + if swag.IsZero(m[i]) { // not required + return nil + } + + if err := m[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName(strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName(strconv.Itoa(i)) + } + return err + } + } + + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/supportmessages/process_reviewed_payment_requests.go b/pkg/gen/supportmessages/process_reviewed_payment_requests.go new file mode 100644 index 00000000000..b0f8b9b9ed0 --- /dev/null +++ b/pkg/gen/supportmessages/process_reviewed_payment_requests.go @@ -0,0 +1,180 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ProcessReviewedPaymentRequests process reviewed payment requests +// +// swagger:model ProcessReviewedPaymentRequests +type ProcessReviewedPaymentRequests struct { + + // delete from syncada + // Example: true + // Required: true + DeleteFromSyncada *bool `json:"deleteFromSyncada"` + + // payment request ID + // Example: 1f2270c7-7166-40ae-981e-b200ebdf3054 + // Format: uuid + PaymentRequestID strfmt.UUID `json:"paymentRequestID,omitempty"` + + // read from syncada + // Example: true + // Required: true + ReadFromSyncada *bool `json:"readFromSyncada"` + + // send to syncada + // Example: true + // Required: true + SendToSyncada *bool `json:"sendToSyncada"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this process reviewed payment requests +func (m *ProcessReviewedPaymentRequests) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateDeleteFromSyncada(formats); err != nil { + res = append(res, err) + } + + if err := m.validatePaymentRequestID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReadFromSyncada(formats); err != nil { + res = append(res, err) + } + + if err := m.validateSendToSyncada(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 *ProcessReviewedPaymentRequests) validateDeleteFromSyncada(formats strfmt.Registry) error { + + if err := validate.Required("deleteFromSyncada", "body", m.DeleteFromSyncada); err != nil { + return err + } + + return nil +} + +func (m *ProcessReviewedPaymentRequests) validatePaymentRequestID(formats strfmt.Registry) error { + if swag.IsZero(m.PaymentRequestID) { // not required + return nil + } + + if err := validate.FormatOf("paymentRequestID", "body", "uuid", m.PaymentRequestID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *ProcessReviewedPaymentRequests) validateReadFromSyncada(formats strfmt.Registry) error { + + if err := validate.Required("readFromSyncada", "body", m.ReadFromSyncada); err != nil { + return err + } + + return nil +} + +func (m *ProcessReviewedPaymentRequests) validateSendToSyncada(formats strfmt.Registry) error { + + if err := validate.Required("sendToSyncada", "body", m.SendToSyncada); err != nil { + return err + } + + return nil +} + +func (m *ProcessReviewedPaymentRequests) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this process reviewed payment requests based on the context it is used +func (m *ProcessReviewedPaymentRequests) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProcessReviewedPaymentRequests) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProcessReviewedPaymentRequests) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProcessReviewedPaymentRequests) UnmarshalBinary(b []byte) error { + var res ProcessReviewedPaymentRequests + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/proof_of_service_package.go b/pkg/gen/supportmessages/proof_of_service_package.go new file mode 100644 index 00000000000..c9bd714efea --- /dev/null +++ b/pkg/gen/supportmessages/proof_of_service_package.go @@ -0,0 +1,143 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ProofOfServicePackage proof of service package +// +// swagger:model ProofOfServicePackage +type ProofOfServicePackage struct { + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // uploads + Uploads []*UploadWithOmissions `json:"uploads"` +} + +// Validate validates this proof of service package +func (m *ProofOfServicePackage) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUploads(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServicePackage) 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 *ProofOfServicePackage) validateUploads(formats strfmt.Registry) error { + if swag.IsZero(m.Uploads) { // not required + return nil + } + + for i := 0; i < len(m.Uploads); i++ { + if swag.IsZero(m.Uploads[i]) { // not required + continue + } + + if m.Uploads[i] != nil { + if err := m.Uploads[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this proof of service package based on the context it is used +func (m *ProofOfServicePackage) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateUploads(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ProofOfServicePackage) contextValidateUploads(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.Uploads); i++ { + + if m.Uploads[i] != nil { + + if swag.IsZero(m.Uploads[i]) { // not required + return nil + } + + if err := m.Uploads[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("uploads" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("uploads" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ProofOfServicePackage) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ProofOfServicePackage) UnmarshalBinary(b []byte) error { + var res ProofOfServicePackage + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/rank.go b/pkg/gen/supportmessages/rank.go new file mode 100644 index 00000000000..f42c0aec72e --- /dev/null +++ b/pkg/gen/supportmessages/rank.go @@ -0,0 +1,159 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// Rank Rank of the service member, must match specific list of available ranks. +// +// swagger:model Rank +type Rank string + +func NewRank(value Rank) *Rank { + return &value +} + +// Pointer returns a pointer to a freshly-allocated Rank. +func (m Rank) Pointer() *Rank { + return &m +} + +const ( + + // RankE1 captures enum value "E_1" + RankE1 Rank = "E_1" + + // RankE2 captures enum value "E_2" + RankE2 Rank = "E_2" + + // RankE3 captures enum value "E_3" + RankE3 Rank = "E_3" + + // RankE4 captures enum value "E_4" + RankE4 Rank = "E_4" + + // RankE5 captures enum value "E_5" + RankE5 Rank = "E_5" + + // RankE6 captures enum value "E_6" + RankE6 Rank = "E_6" + + // RankE7 captures enum value "E_7" + RankE7 Rank = "E_7" + + // RankE8 captures enum value "E_8" + RankE8 Rank = "E_8" + + // RankE9 captures enum value "E_9" + RankE9 Rank = "E_9" + + // RankE9SPECIALSENIORENLISTED captures enum value "E_9_SPECIAL_SENIOR_ENLISTED" + RankE9SPECIALSENIORENLISTED Rank = "E_9_SPECIAL_SENIOR_ENLISTED" + + // RankO1ACADEMYGRADUATE captures enum value "O_1_ACADEMY_GRADUATE" + RankO1ACADEMYGRADUATE Rank = "O_1_ACADEMY_GRADUATE" + + // RankO2 captures enum value "O_2" + RankO2 Rank = "O_2" + + // RankO3 captures enum value "O_3" + RankO3 Rank = "O_3" + + // RankO4 captures enum value "O_4" + RankO4 Rank = "O_4" + + // RankO5 captures enum value "O_5" + RankO5 Rank = "O_5" + + // RankO6 captures enum value "O_6" + RankO6 Rank = "O_6" + + // RankO7 captures enum value "O_7" + RankO7 Rank = "O_7" + + // RankO8 captures enum value "O_8" + RankO8 Rank = "O_8" + + // RankO9 captures enum value "O_9" + RankO9 Rank = "O_9" + + // RankO10 captures enum value "O_10" + RankO10 Rank = "O_10" + + // RankW1 captures enum value "W_1" + RankW1 Rank = "W_1" + + // RankW2 captures enum value "W_2" + RankW2 Rank = "W_2" + + // RankW3 captures enum value "W_3" + RankW3 Rank = "W_3" + + // RankW4 captures enum value "W_4" + RankW4 Rank = "W_4" + + // RankW5 captures enum value "W_5" + RankW5 Rank = "W_5" + + // RankAVIATIONCADET captures enum value "AVIATION_CADET" + RankAVIATIONCADET Rank = "AVIATION_CADET" + + // RankCIVILIANEMPLOYEE captures enum value "CIVILIAN_EMPLOYEE" + RankCIVILIANEMPLOYEE Rank = "CIVILIAN_EMPLOYEE" + + // RankACADEMYCADET captures enum value "ACADEMY_CADET" + RankACADEMYCADET Rank = "ACADEMY_CADET" + + // RankMIDSHIPMAN captures enum value "MIDSHIPMAN" + RankMIDSHIPMAN Rank = "MIDSHIPMAN" +) + +// for schema +var rankEnum []interface{} + +func init() { + var res []Rank + if err := json.Unmarshal([]byte(`["E_1","E_2","E_3","E_4","E_5","E_6","E_7","E_8","E_9","E_9_SPECIAL_SENIOR_ENLISTED","O_1_ACADEMY_GRADUATE","O_2","O_3","O_4","O_5","O_6","O_7","O_8","O_9","O_10","W_1","W_2","W_3","W_4","W_5","AVIATION_CADET","CIVILIAN_EMPLOYEE","ACADEMY_CADET","MIDSHIPMAN"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + rankEnum = append(rankEnum, v) + } +} + +func (m Rank) validateRankEnum(path, location string, value Rank) error { + if err := validate.EnumCase(path, location, value, rankEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this rank +func (m Rank) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateRankEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this rank based on context it is used +func (m Rank) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/supportmessages/re_service_code.go b/pkg/gen/supportmessages/re_service_code.go new file mode 100644 index 00000000000..ae293c133d2 --- /dev/null +++ b/pkg/gen/supportmessages/re_service_code.go @@ -0,0 +1,219 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// ReServiceCode This is the full list of service items that can be found on a shipment. Not all service items +// may be requested by the Prime, but may be returned in a response. +// +// Documentation of all the service items will be provided. +// +// swagger:model ReServiceCode +type ReServiceCode string + +func NewReServiceCode(value ReServiceCode) *ReServiceCode { + return &value +} + +// Pointer returns a pointer to a freshly-allocated ReServiceCode. +func (m ReServiceCode) Pointer() *ReServiceCode { + return &m +} + +const ( + + // ReServiceCodeCS captures enum value "CS" + ReServiceCodeCS ReServiceCode = "CS" + + // ReServiceCodeDBHF captures enum value "DBHF" + ReServiceCodeDBHF ReServiceCode = "DBHF" + + // ReServiceCodeDBTF captures enum value "DBTF" + ReServiceCodeDBTF ReServiceCode = "DBTF" + + // ReServiceCodeDCRT captures enum value "DCRT" + ReServiceCodeDCRT ReServiceCode = "DCRT" + + // ReServiceCodeDDASIT captures enum value "DDASIT" + ReServiceCodeDDASIT ReServiceCode = "DDASIT" + + // ReServiceCodeDDDSIT captures enum value "DDDSIT" + ReServiceCodeDDDSIT ReServiceCode = "DDDSIT" + + // ReServiceCodeDDFSIT captures enum value "DDFSIT" + ReServiceCodeDDFSIT ReServiceCode = "DDFSIT" + + // ReServiceCodeDDP captures enum value "DDP" + ReServiceCodeDDP ReServiceCode = "DDP" + + // ReServiceCodeDDSHUT captures enum value "DDSHUT" + ReServiceCodeDDSHUT ReServiceCode = "DDSHUT" + + // ReServiceCodeDLH captures enum value "DLH" + ReServiceCodeDLH ReServiceCode = "DLH" + + // ReServiceCodeDMHF captures enum value "DMHF" + ReServiceCodeDMHF ReServiceCode = "DMHF" + + // ReServiceCodeDNPK captures enum value "DNPK" + ReServiceCodeDNPK ReServiceCode = "DNPK" + + // ReServiceCodeDOASIT captures enum value "DOASIT" + ReServiceCodeDOASIT ReServiceCode = "DOASIT" + + // ReServiceCodeDOFSIT captures enum value "DOFSIT" + ReServiceCodeDOFSIT ReServiceCode = "DOFSIT" + + // ReServiceCodeDOP captures enum value "DOP" + ReServiceCodeDOP ReServiceCode = "DOP" + + // ReServiceCodeDOPSIT captures enum value "DOPSIT" + ReServiceCodeDOPSIT ReServiceCode = "DOPSIT" + + // ReServiceCodeDOSHUT captures enum value "DOSHUT" + ReServiceCodeDOSHUT ReServiceCode = "DOSHUT" + + // ReServiceCodeDPK captures enum value "DPK" + ReServiceCodeDPK ReServiceCode = "DPK" + + // ReServiceCodeDSH captures enum value "DSH" + ReServiceCodeDSH ReServiceCode = "DSH" + + // ReServiceCodeDUCRT captures enum value "DUCRT" + ReServiceCodeDUCRT ReServiceCode = "DUCRT" + + // ReServiceCodeDUPK captures enum value "DUPK" + ReServiceCodeDUPK ReServiceCode = "DUPK" + + // ReServiceCodeFSC captures enum value "FSC" + ReServiceCodeFSC ReServiceCode = "FSC" + + // ReServiceCodeIBHF captures enum value "IBHF" + ReServiceCodeIBHF ReServiceCode = "IBHF" + + // ReServiceCodeIBTF captures enum value "IBTF" + ReServiceCodeIBTF ReServiceCode = "IBTF" + + // ReServiceCodeICOLH captures enum value "ICOLH" + ReServiceCodeICOLH ReServiceCode = "ICOLH" + + // ReServiceCodeICOUB captures enum value "ICOUB" + ReServiceCodeICOUB ReServiceCode = "ICOUB" + + // ReServiceCodeICRT captures enum value "ICRT" + ReServiceCodeICRT ReServiceCode = "ICRT" + + // ReServiceCodeIDASIT captures enum value "IDASIT" + ReServiceCodeIDASIT ReServiceCode = "IDASIT" + + // ReServiceCodeIDDSIT captures enum value "IDDSIT" + ReServiceCodeIDDSIT ReServiceCode = "IDDSIT" + + // ReServiceCodeIDFSIT captures enum value "IDFSIT" + ReServiceCodeIDFSIT ReServiceCode = "IDFSIT" + + // ReServiceCodeIDSHUT captures enum value "IDSHUT" + ReServiceCodeIDSHUT ReServiceCode = "IDSHUT" + + // ReServiceCodeIHPK captures enum value "IHPK" + ReServiceCodeIHPK ReServiceCode = "IHPK" + + // ReServiceCodeIHUPK captures enum value "IHUPK" + ReServiceCodeIHUPK ReServiceCode = "IHUPK" + + // ReServiceCodeINPK captures enum value "INPK" + ReServiceCodeINPK ReServiceCode = "INPK" + + // ReServiceCodeIOASIT captures enum value "IOASIT" + ReServiceCodeIOASIT ReServiceCode = "IOASIT" + + // ReServiceCodeIOCLH captures enum value "IOCLH" + ReServiceCodeIOCLH ReServiceCode = "IOCLH" + + // ReServiceCodeIOCUB captures enum value "IOCUB" + ReServiceCodeIOCUB ReServiceCode = "IOCUB" + + // ReServiceCodeIOFSIT captures enum value "IOFSIT" + ReServiceCodeIOFSIT ReServiceCode = "IOFSIT" + + // ReServiceCodeIOOLH captures enum value "IOOLH" + ReServiceCodeIOOLH ReServiceCode = "IOOLH" + + // ReServiceCodeIOOUB captures enum value "IOOUB" + ReServiceCodeIOOUB ReServiceCode = "IOOUB" + + // ReServiceCodeIOPSIT captures enum value "IOPSIT" + ReServiceCodeIOPSIT ReServiceCode = "IOPSIT" + + // ReServiceCodeIOSHUT captures enum value "IOSHUT" + ReServiceCodeIOSHUT ReServiceCode = "IOSHUT" + + // ReServiceCodeIUBPK captures enum value "IUBPK" + ReServiceCodeIUBPK ReServiceCode = "IUBPK" + + // ReServiceCodeIUBUPK captures enum value "IUBUPK" + ReServiceCodeIUBUPK ReServiceCode = "IUBUPK" + + // ReServiceCodeIUCRT captures enum value "IUCRT" + ReServiceCodeIUCRT ReServiceCode = "IUCRT" + + // ReServiceCodeMS captures enum value "MS" + ReServiceCodeMS ReServiceCode = "MS" + + // ReServiceCodeNSTH captures enum value "NSTH" + ReServiceCodeNSTH ReServiceCode = "NSTH" + + // ReServiceCodeNSTUB captures enum value "NSTUB" + ReServiceCodeNSTUB ReServiceCode = "NSTUB" +) + +// for schema +var reServiceCodeEnum []interface{} + +func init() { + var res []ReServiceCode + if err := json.Unmarshal([]byte(`["CS","DBHF","DBTF","DCRT","DDASIT","DDDSIT","DDFSIT","DDP","DDSHUT","DLH","DMHF","DNPK","DOASIT","DOFSIT","DOP","DOPSIT","DOSHUT","DPK","DSH","DUCRT","DUPK","FSC","IBHF","IBTF","ICOLH","ICOUB","ICRT","IDASIT","IDDSIT","IDFSIT","IDSHUT","IHPK","IHUPK","INPK","IOASIT","IOCLH","IOCUB","IOFSIT","IOOLH","IOOUB","IOPSIT","IOSHUT","IUBPK","IUBUPK","IUCRT","MS","NSTH","NSTUB"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + reServiceCodeEnum = append(reServiceCodeEnum, v) + } +} + +func (m ReServiceCode) validateReServiceCodeEnum(path, location string, value ReServiceCode) error { + if err := validate.EnumCase(path, location, value, reServiceCodeEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this re service code +func (m ReServiceCode) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateReServiceCodeEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this re service code based on context it is used +func (m ReServiceCode) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} diff --git a/pkg/gen/supportmessages/update_m_t_o_service_item_status.go b/pkg/gen/supportmessages/update_m_t_o_service_item_status.go new file mode 100644 index 00000000000..a2243ef5595 --- /dev/null +++ b/pkg/gen/supportmessages/update_m_t_o_service_item_status.go @@ -0,0 +1,108 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// UpdateMTOServiceItemStatus update m t o service item status +// +// swagger:model UpdateMTOServiceItemStatus +type UpdateMTOServiceItemStatus struct { + + // Reason the service item was rejected by the TOO"" + // Example: item was too heavy + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status MTOServiceItemStatus `json:"status,omitempty"` +} + +// Validate validates this update m t o service item status +func (m *UpdateMTOServiceItemStatus) 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 *UpdateMTOServiceItemStatus) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this update m t o service item status based on the context it is used +func (m *UpdateMTOServiceItemStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdateMTOServiceItemStatus) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOServiceItemStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOServiceItemStatus) UnmarshalBinary(b []byte) error { + var res UpdateMTOServiceItemStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/update_m_t_o_shipment_status.go b/pkg/gen/supportmessages/update_m_t_o_shipment_status.go new file mode 100644 index 00000000000..201ee90a85b --- /dev/null +++ b/pkg/gen/supportmessages/update_m_t_o_shipment_status.go @@ -0,0 +1,121 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdateMTOShipmentStatus update m t o shipment status +// +// swagger:model UpdateMTOShipmentStatus +type UpdateMTOShipmentStatus struct { + + // rejection reason + // Example: MTO Shipment not good enough + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + // Enum: [REJECTED APPROVED SUBMITTED CANCELLATION_REQUESTED CANCELED DIVERSION_REQUESTED] + Status string `json:"status,omitempty"` +} + +// Validate validates this update m t o shipment status +func (m *UpdateMTOShipmentStatus) 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 +} + +var updateMTOShipmentStatusTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["REJECTED","APPROVED","SUBMITTED","CANCELLATION_REQUESTED","CANCELED","DIVERSION_REQUESTED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + updateMTOShipmentStatusTypeStatusPropEnum = append(updateMTOShipmentStatusTypeStatusPropEnum, v) + } +} + +const ( + + // UpdateMTOShipmentStatusStatusREJECTED captures enum value "REJECTED" + UpdateMTOShipmentStatusStatusREJECTED string = "REJECTED" + + // UpdateMTOShipmentStatusStatusAPPROVED captures enum value "APPROVED" + UpdateMTOShipmentStatusStatusAPPROVED string = "APPROVED" + + // UpdateMTOShipmentStatusStatusSUBMITTED captures enum value "SUBMITTED" + UpdateMTOShipmentStatusStatusSUBMITTED string = "SUBMITTED" + + // UpdateMTOShipmentStatusStatusCANCELLATIONREQUESTED captures enum value "CANCELLATION_REQUESTED" + UpdateMTOShipmentStatusStatusCANCELLATIONREQUESTED string = "CANCELLATION_REQUESTED" + + // UpdateMTOShipmentStatusStatusCANCELED captures enum value "CANCELED" + UpdateMTOShipmentStatusStatusCANCELED string = "CANCELED" + + // UpdateMTOShipmentStatusStatusDIVERSIONREQUESTED captures enum value "DIVERSION_REQUESTED" + UpdateMTOShipmentStatusStatusDIVERSIONREQUESTED string = "DIVERSION_REQUESTED" +) + +// prop value enum +func (m *UpdateMTOShipmentStatus) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, updateMTOShipmentStatusTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UpdateMTOShipmentStatus) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this update m t o shipment status based on context it is used +func (m *UpdateMTOShipmentStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdateMTOShipmentStatus) UnmarshalBinary(b []byte) error { + var res UpdateMTOShipmentStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/update_payment_request_status.go b/pkg/gen/supportmessages/update_payment_request_status.go new file mode 100644 index 00000000000..3060670f2ea --- /dev/null +++ b/pkg/gen/supportmessages/update_payment_request_status.go @@ -0,0 +1,126 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UpdatePaymentRequestStatus update payment request status +// +// swagger:model UpdatePaymentRequestStatus +type UpdatePaymentRequestStatus struct { + + // Attribute of the payment request object that automatically changes when the request is updated. This matches the value passed in the header for `If-Match`. Required when sending PUT or PATCH requests to prevent updating stale data. + // Read Only: true + ETag string `json:"eTag,omitempty"` + + // A written reason to provide context for the status. + // Example: documentation was incomplete + RejectionReason *string `json:"rejectionReason,omitempty"` + + // status + Status PaymentRequestStatus `json:"status,omitempty"` +} + +// Validate validates this update payment request status +func (m *UpdatePaymentRequestStatus) 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 *UpdatePaymentRequestStatus) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// ContextValidate validate this update payment request status based on the context it is used +func (m *UpdatePaymentRequestStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UpdatePaymentRequestStatus) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag)); err != nil { + return err + } + + return nil +} + +func (m *UpdatePaymentRequestStatus) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UpdatePaymentRequestStatus) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UpdatePaymentRequestStatus) UnmarshalBinary(b []byte) error { + var res UpdatePaymentRequestStatus + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/upload_with_omissions.go b/pkg/gen/supportmessages/upload_with_omissions.go new file mode 100644 index 00000000000..f30bb739563 --- /dev/null +++ b/pkg/gen/supportmessages/upload_with_omissions.go @@ -0,0 +1,279 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// UploadWithOmissions An uploaded file. +// +// swagger:model UploadWithOmissions +type UploadWithOmissions struct { + + // bytes + // Required: true + Bytes *int64 `json:"bytes"` + + // content type + // Example: application/pdf + // Required: true + ContentType *string `json:"contentType"` + + // created at + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // filename + // Example: filename.pdf + // Required: true + Filename *string `json:"filename"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // rotation + Rotation int64 `json:"rotation,omitempty"` + + // status + // Enum: [INFECTED CLEAN PROCESSING] + Status string `json:"status,omitempty"` + + // updated at + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` + + // url + // Example: https://uploads.domain.test/dir/c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uri + URL strfmt.URI `json:"url,omitempty"` +} + +// Validate validates this upload with omissions +func (m *UploadWithOmissions) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateBytes(formats); err != nil { + res = append(res, err) + } + + if err := m.validateContentType(formats); err != nil { + res = append(res, err) + } + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFilename(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateURL(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) validateBytes(formats strfmt.Registry) error { + + if err := validate.Required("bytes", "body", m.Bytes); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateContentType(formats strfmt.Registry) error { + + if err := validate.Required("contentType", "body", m.ContentType); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateFilename(formats strfmt.Registry) error { + + if err := validate.Required("filename", "body", m.Filename); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) 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 +} + +var uploadWithOmissionsTypeStatusPropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["INFECTED","CLEAN","PROCESSING"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + uploadWithOmissionsTypeStatusPropEnum = append(uploadWithOmissionsTypeStatusPropEnum, v) + } +} + +const ( + + // UploadWithOmissionsStatusINFECTED captures enum value "INFECTED" + UploadWithOmissionsStatusINFECTED string = "INFECTED" + + // UploadWithOmissionsStatusCLEAN captures enum value "CLEAN" + UploadWithOmissionsStatusCLEAN string = "CLEAN" + + // UploadWithOmissionsStatusPROCESSING captures enum value "PROCESSING" + UploadWithOmissionsStatusPROCESSING string = "PROCESSING" +) + +// prop value enum +func (m *UploadWithOmissions) validateStatusEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, uploadWithOmissionsTypeStatusPropEnum, true); err != nil { + return err + } + return nil +} + +func (m *UploadWithOmissions) validateStatus(formats strfmt.Registry) error { + if swag.IsZero(m.Status) { // not required + return nil + } + + // value enum + if err := m.validateStatusEnum("status", "body", m.Status); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) validateURL(formats strfmt.Registry) error { + if swag.IsZero(m.URL) { // not required + return nil + } + + if err := validate.FormatOf("url", "body", "uri", m.URL.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this upload with omissions based on the context it is used +func (m *UploadWithOmissions) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *UploadWithOmissions) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *UploadWithOmissions) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *UploadWithOmissions) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *UploadWithOmissions) UnmarshalBinary(b []byte) error { + var res UploadWithOmissions + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/validation_error.go b/pkg/gen/supportmessages/validation_error.go new file mode 100644 index 00000000000..49171854b2a --- /dev/null +++ b/pkg/gen/supportmessages/validation_error.go @@ -0,0 +1,132 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ValidationError validation error +// +// swagger:model ValidationError +type ValidationError struct { + ClientError + + // invalid fields + // Required: true + InvalidFields map[string][]string `json:"invalidFields"` +} + +// UnmarshalJSON unmarshals this object from a JSON structure +func (m *ValidationError) UnmarshalJSON(raw []byte) error { + // AO0 + var aO0 ClientError + if err := swag.ReadJSON(raw, &aO0); err != nil { + return err + } + m.ClientError = aO0 + + // AO1 + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + if err := swag.ReadJSON(raw, &dataAO1); err != nil { + return err + } + + m.InvalidFields = dataAO1.InvalidFields + + return nil +} + +// MarshalJSON marshals this object to a JSON structure +func (m ValidationError) MarshalJSON() ([]byte, error) { + _parts := make([][]byte, 0, 2) + + aO0, err := swag.WriteJSON(m.ClientError) + if err != nil { + return nil, err + } + _parts = append(_parts, aO0) + var dataAO1 struct { + InvalidFields map[string][]string `json:"invalidFields"` + } + + dataAO1.InvalidFields = m.InvalidFields + + jsonDataAO1, errAO1 := swag.WriteJSON(dataAO1) + if errAO1 != nil { + return nil, errAO1 + } + _parts = append(_parts, jsonDataAO1) + return swag.ConcatJSON(_parts...), nil +} + +// Validate validates this validation error +func (m *ValidationError) Validate(formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.Validate(formats); err != nil { + res = append(res, err) + } + + if err := m.validateInvalidFields(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ValidationError) validateInvalidFields(formats strfmt.Registry) error { + + if err := validate.Required("invalidFields", "body", m.InvalidFields); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this validation error based on the context it is used +func (m *ValidationError) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + // validation for a type composition with ClientError + if err := m.ClientError.ContextValidate(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// MarshalBinary interface implementation +func (m *ValidationError) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ValidationError) UnmarshalBinary(b []byte) error { + var res ValidationError + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/webhook_notification.go b/pkg/gen/supportmessages/webhook_notification.go new file mode 100644 index 00000000000..acaa8d3f34a --- /dev/null +++ b/pkg/gen/supportmessages/webhook_notification.go @@ -0,0 +1,312 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// WebhookNotification webhook notification +// +// swagger:model WebhookNotification +type WebhookNotification struct { + + // Time representing when the event was triggered + // Read Only: true + // Format: date-time + CreatedAt strfmt.DateTime `json:"createdAt,omitempty"` + + // Name of event triggered + // Example: PaymentRequest.Update + EventKey string `json:"eventKey,omitempty"` + + // Time representing when the system firstAttempted to send this notification + // Read Only: true + // Format: date-time + FirstAttemptedAt *strfmt.DateTime `json:"firstAttemptedAt,omitempty"` + + // id + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Read Only: true + // Format: uuid + ID strfmt.UUID `json:"id,omitempty"` + + // move task order ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID,omitempty"` + + // object + Object *string `json:"object,omitempty"` + + // object ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + ObjectID *strfmt.UUID `json:"objectID,omitempty"` + + // status + Status WebhookNotificationStatus `json:"status,omitempty"` + + // trace ID + // Example: c56a4180-65aa-42ec-a945-5fd21dec0538 + // Format: uuid + TraceID strfmt.UUID `json:"traceID,omitempty"` + + // Time representing when the notification was last updated + // Read Only: true + // Format: date-time + UpdatedAt strfmt.DateTime `json:"updatedAt,omitempty"` +} + +// Validate validates this webhook notification +func (m *WebhookNotification) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateCreatedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateFirstAttemptedAt(formats); err != nil { + res = append(res, err) + } + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateObjectID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateTraceID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateUpdatedAt(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WebhookNotification) validateCreatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.CreatedAt) { // not required + return nil + } + + if err := validate.FormatOf("createdAt", "body", "date-time", m.CreatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) validateFirstAttemptedAt(formats strfmt.Registry) error { + if swag.IsZero(m.FirstAttemptedAt) { // not required + return nil + } + + if err := validate.FormatOf("firstAttemptedAt", "body", "date-time", m.FirstAttemptedAt.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) 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 *WebhookNotification) validateMoveTaskOrderID(formats strfmt.Registry) error { + if swag.IsZero(m.MoveTaskOrderID) { // not required + return nil + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) validateObjectID(formats strfmt.Registry) error { + if swag.IsZero(m.ObjectID) { // not required + return nil + } + + if err := validate.FormatOf("objectID", "body", "uuid", m.ObjectID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *WebhookNotification) validateTraceID(formats strfmt.Registry) error { + if swag.IsZero(m.TraceID) { // not required + return nil + } + + if err := validate.FormatOf("traceID", "body", "uuid", m.TraceID.String(), formats); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) validateUpdatedAt(formats strfmt.Registry) error { + if swag.IsZero(m.UpdatedAt) { // not required + return nil + } + + if err := validate.FormatOf("updatedAt", "body", "date-time", m.UpdatedAt.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this webhook notification based on the context it is used +func (m *WebhookNotification) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateCreatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateFirstAttemptedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateUpdatedAt(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *WebhookNotification) contextValidateCreatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "createdAt", "body", strfmt.DateTime(m.CreatedAt)); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) contextValidateFirstAttemptedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "firstAttemptedAt", "body", m.FirstAttemptedAt); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID)); err != nil { + return err + } + + return nil +} + +func (m *WebhookNotification) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status) { // not required + return nil + } + + if err := m.Status.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +func (m *WebhookNotification) contextValidateUpdatedAt(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "updatedAt", "body", strfmt.DateTime(m.UpdatedAt)); err != nil { + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *WebhookNotification) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *WebhookNotification) UnmarshalBinary(b []byte) error { + var res WebhookNotification + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/webhook_notification_status.go b/pkg/gen/supportmessages/webhook_notification_status.go new file mode 100644 index 00000000000..b6ca9f4f176 --- /dev/null +++ b/pkg/gen/supportmessages/webhook_notification_status.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/validate" +) + +// WebhookNotificationStatus Statuses available for a Webhook Notification +// +// swagger:model WebhookNotificationStatus +type WebhookNotificationStatus string + +func NewWebhookNotificationStatus(value WebhookNotificationStatus) *WebhookNotificationStatus { + return &value +} + +// Pointer returns a pointer to a freshly-allocated WebhookNotificationStatus. +func (m WebhookNotificationStatus) Pointer() *WebhookNotificationStatus { + return &m +} + +const ( + + // WebhookNotificationStatusPENDING captures enum value "PENDING" + WebhookNotificationStatusPENDING WebhookNotificationStatus = "PENDING" + + // WebhookNotificationStatusSENT captures enum value "SENT" + WebhookNotificationStatusSENT WebhookNotificationStatus = "SENT" + + // WebhookNotificationStatusSKIPPED captures enum value "SKIPPED" + WebhookNotificationStatusSKIPPED WebhookNotificationStatus = "SKIPPED" + + // WebhookNotificationStatusFAILING captures enum value "FAILING" + WebhookNotificationStatusFAILING WebhookNotificationStatus = "FAILING" + + // WebhookNotificationStatusFAILED captures enum value "FAILED" + WebhookNotificationStatusFAILED WebhookNotificationStatus = "FAILED" +) + +// for schema +var webhookNotificationStatusEnum []interface{} + +func init() { + var res []WebhookNotificationStatus + if err := json.Unmarshal([]byte(`["PENDING","SENT","SKIPPED","FAILING","FAILED"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + webhookNotificationStatusEnum = append(webhookNotificationStatusEnum, v) + } +} + +func (m WebhookNotificationStatus) validateWebhookNotificationStatusEnum(path, location string, value WebhookNotificationStatus) error { + if err := validate.EnumCase(path, location, value, webhookNotificationStatusEnum, true); err != nil { + return err + } + return nil +} + +// Validate validates this webhook notification status +func (m WebhookNotificationStatus) Validate(formats strfmt.Registry) error { + var res []error + + // value enum + if err := m.validateWebhookNotificationStatusEnum("", "body", m); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +// ContextValidate validates this webhook notification status based on context it is used +func (m WebhookNotificationStatus) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} From 8183156977a673ac4255590a5466031a13128696 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 13 Jan 2025 22:45:18 +0000 Subject: [PATCH 028/229] B-21935 initial --- .../templates/move_submitted_template.html | 4 +-- .../templates/move_submitted_template.txt | 2 +- pkg/notifications/move_approved.go | 26 ++++++++++--------- .../MtoShipmentForm/MtoShipmentForm.jsx | 8 +++--- src/pages/MyMove/Home/index.jsx | 2 +- src/pages/MyMove/MovingInfo.jsx | 6 ++++- 6 files changed, 28 insertions(+), 20 deletions(-) diff --git a/pkg/assets/notifications/templates/move_submitted_template.html b/pkg/assets/notifications/templates/move_submitted_template.html index cce7d87e8b8..17e7c0732ff 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.html +++ b/pkg/assets/notifications/templates/move_submitted_template.html @@ -20,9 +20,9 @@

- Your weight allowance: {{.WeightAllowance}} pounds. + Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your - orders. + orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

diff --git a/pkg/assets/notifications/templates/move_submitted_template.txt b/pkg/assets/notifications/templates/move_submitted_template.txt index 72f1c68566d..85516ead51f 100644 --- a/pkg/assets/notifications/templates/move_submitted_template.txt +++ b/pkg/assets/notifications/templates/move_submitted_template.txt @@ -6,7 +6,7 @@ We have assigned you a move code: {{.Locator}}. You can use this code when talki {{ if .OriginDutyLocationPhoneLine -}} To change any information about your move, or to add or cancel shipments, you should contact {{.OriginDutyLocationPhoneLine}} or visit your local transportation office ({{.OneSourceTransportationOfficeLink}}) . {{- end }} {{- if not .OriginDutyLocationPhoneLine }} To change any information about your move, or to add or cancel shipments, you should contact your nearest transportation office. You can find the contact information using the directory of PCS-related contacts ({{.OneSourceTransportationOfficeLink}}) . {{- end }} -Your weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. +Your standard weight allowance: {{.WeightAllowance}} pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less. If you move more than {{.WeightAllowance}} pounds or ship to/from an other than authorized location, you may owe the government the difference in cost between what you are authorized and what you decide to move. diff --git a/pkg/notifications/move_approved.go b/pkg/notifications/move_approved.go index 96b198d6c8b..fb207acfbe3 100644 --- a/pkg/notifications/move_approved.go +++ b/pkg/notifications/move_approved.go @@ -86,12 +86,13 @@ func (m MoveApproved) emails(appCtx appcontext.AppContext) ([]emailContent, erro } htmlBody, textBody, err := m.renderTemplates(appCtx, moveApprovedEmailData{ - Link: ppmInfoSheetURL.String(), - OriginDutyLocation: originDutyLocation, - DestinationDutyLocation: orders.NewDutyLocation.Name, - OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, - Locator: move.Locator, - MyMoveLink: MyMoveLink, + Link: ppmInfoSheetURL.String(), + OriginDutyLocation: originDutyLocation, + DestinationDutyLocation: orders.NewDutyLocation.Name, + OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, + Locator: move.Locator, + MyMoveLink: MyMoveLink, + AdminRestrictedWeightLocation: orders.Entitlement.AdminRestrictedWeightLocation, }) if err != nil { @@ -128,12 +129,13 @@ func (m MoveApproved) renderTemplates(appCtx appcontext.AppContext, data moveApp // moveApprovedEmailData has content for email template type moveApprovedEmailData struct { - Link string - OriginDutyLocation *string - DestinationDutyLocation string - OriginDutyLocationPhoneLine *string - Locator string - MyMoveLink string + Link string + OriginDutyLocation *string + DestinationDutyLocation string + OriginDutyLocationPhoneLine *string + Locator string + MyMoveLink string + AdminRestrictedWeightLocation bool } // RenderHTML renders the html for the email diff --git a/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx b/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx index e1fb7f72263..badadb06df0 100644 --- a/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx +++ b/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx @@ -314,12 +314,14 @@ class MtoShipmentForm extends Component {

{shipmentForm.header[`${shipmentType}`]}

- Remember: You can move + Remember: {isUB - ? ` up to ${formatUBAllowanceWeight( + ? ` You can move up to ${formatUBAllowanceWeight( orders?.entitlement?.ub_allowance, )} for this UB shipment. The weight of your UB is part of your authorized weight allowance` - : ` ${formatWeight(orders.authorizedWeight)} total`} + : ` Your standard weight allowcance is ${formatWeight( + orders.authorizedWeight, + )} total. If you are moving to an administratively restricted HHG weight location this amount may be less. `} . You’ll be billed for any excess weight you move.
diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 33f7d5bfb34..12544c80b88 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -265,7 +265,7 @@ export class Home extends Component {
-
Weight allowance
+
Standard Weight allowance
{formatWeight(orders.authorizedWeight)}.
{move.locator && ( diff --git a/src/pages/MyMove/MovingInfo.jsx b/src/pages/MyMove/MovingInfo.jsx index ebcb960407f..c7afcb3b38a 100644 --- a/src/pages/MyMove/MovingInfo.jsx +++ b/src/pages/MyMove/MovingInfo.jsx @@ -84,8 +84,12 @@ export class MovingInfo extends Component { +

+ If you are moving to an administratively restricted HHG weight location this amount may be less. You + will have to pay for any excess weight above this amount. +

You will have to pay for any excess weight above this allowance, so work hard to make sure you stay within your weight limit. From 0c93aa57967f596fc4600ee1290473c55f4f56bf Mon Sep 17 00:00:00 2001 From: deandreJones Date: Tue, 14 Jan 2025 10:49:39 -0600 Subject: [PATCH 029/229] pointing --- ...250107184554_add_weight_restriction.up.sql | 2 +- pkg/factory/entitlement_factory.go | 4 +-- .../internal/payloads/model_to_payload.go | 5 ++-- .../primeapi/payloads/model_to_payload.go | 4 +-- .../primeapiv2/payloads/model_to_payload.go | 4 +-- .../primeapiv3/payloads/model_to_payload.go | 2 +- .../internal/payloads/model_to_payload.go | 2 +- pkg/models/ghc_entitlements.go | 4 +-- pkg/services/order/order_updater.go | 13 +++++---- pkg/testdatagen/make_entitlement.go | 2 ++ .../AllowancesDetailForm.jsx | 28 +++++++++++++++++-- 11 files changed, 49 insertions(+), 21 deletions(-) diff --git a/migrations/app/schema/20250107184554_add_weight_restriction.up.sql b/migrations/app/schema/20250107184554_add_weight_restriction.up.sql index 6d2a0ce08f6..13166af20ee 100644 --- a/migrations/app/schema/20250107184554_add_weight_restriction.up.sql +++ b/migrations/app/schema/20250107184554_add_weight_restriction.up.sql @@ -1,4 +1,4 @@ ALTER TABLE entitlements -ADD column weight_restriction int; +ADD column IF NOT EXISTS weight_restriction int; COMMENT ON COLUMN entitlements.weight_restriction IS 'The weight restricted on the move to a particular location'; diff --git a/pkg/factory/entitlement_factory.go b/pkg/factory/entitlement_factory.go index 2255527c223..02b2983c45d 100644 --- a/pkg/factory/entitlement_factory.go +++ b/pkg/factory/entitlement_factory.go @@ -60,8 +60,8 @@ func BuildEntitlement(db *pop.Connection, customs []Customization, traits []Trai ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, OrganizationalClothingAndIndividualEquipment: ocie, - AdminRestrictedWeightLocation: *setBoolPtr(&cEntitlement.AdminRestrictedWeightLocation, false), - WeightRestriction: weightRestriction, + AdminRestrictedWeightLocation: setBoolPtr(cEntitlement.AdminRestrictedWeightLocation, false), + WeightRestriction: &weightRestriction, } // Set default calculated values entitlement.SetWeightAllotment(string(*grade), ordersType) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index ba1facad756..1cc560d69ba 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -720,7 +720,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation var weightRestriction int64 - wr := int64(entitlement.WeightRestriction) + wr := int64(*entitlement.WeightRestriction) weightRestriction = wr var accompaniedTour *bool @@ -757,10 +757,11 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, GunSafe: gunSafe, - AdminRestrictedWeightLocation: adminRestrictedWeightLocation, + AdminRestrictedWeightLocation: *adminRestrictedWeightLocation, WeightRestriction: weightRestriction, ETag: etag.GenerateEtag(entitlement.UpdatedAt), } + } // DutyLocation payload func DutyLocation(dutyLocation *models.DutyLocation) *ghcmessages.DutyLocation { if dutyLocation == nil { diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 29d5aed536a..a708a4a5048 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -217,7 +217,7 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, + AdminRestrictedWeightLocation: *entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), @@ -227,7 +227,7 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { StorageInTransit: sit, TotalDependents: totalDependents, TotalWeight: totalWeight, - WeightRestriction: int64(entitlement.WeightRestriction), + WeightRestriction: int64(*entitlement.WeightRestriction), ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 44183723ac2..08859d8083a 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -162,7 +162,7 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, + AdminRestrictedWeightLocation: *entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), @@ -172,7 +172,7 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements StorageInTransit: sit, TotalDependents: totalDependents, TotalWeight: totalWeight, - WeightRestriction: int64(entitlement.WeightRestriction), + WeightRestriction: int64(*entitlement.WeightRestriction), ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 9e854f11c09..9c54a1d4377 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -198,7 +198,7 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements StorageInTransit: sit, TotalDependents: totalDependents, TotalWeight: totalWeight, - WeightRestriction: int64(entitlement.WeightRestriction), + WeightRestriction: int64(*entitlement.WeightRestriction), ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go index 55d81ac65a8..e1e3c9f18a8 100644 --- a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go @@ -166,7 +166,7 @@ func Entitlement(entitlement *models.Entitlement) *supportmessages.Entitlement { StorageInTransit: sit, TotalDependents: totalDependents, TotalWeight: totalWeight, - WeightRestriction: int64(entitlement.WeightRestriction), + WeightRestriction: int64(*entitlement.WeightRestriction), ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index f8e6a383bf6..1bec7547de0 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -31,8 +31,8 @@ type Entitlement struct { OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` - AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` - WeightRestriction int `db:"weight_restriction"` + AdminRestrictedWeightLocation *bool `db:"admin_restricted_weight_location"` + WeightRestriction *int `db:"weight_restriction"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` } diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index a8692b14653..6075058b43f 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -457,10 +457,11 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. } if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + order.Entitlement.AdminRestrictedWeightLocation = payload.AdminRestrictedWeightLocation } - order.Entitlement.WeightRestriction = int(payload.WeightRestriction) + weightRestriction := int(payload.WeightRestriction) + order.Entitlement.WeightRestriction = &weightRestriction if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour @@ -563,10 +564,13 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder } if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + order.Entitlement.AdminRestrictedWeightLocation = payload.AdminRestrictedWeightLocation } - order.Entitlement.WeightRestriction = int(*payload.WeightRestriction) + if payload.WeightRestriction != nil { + weightRestriction := int(*payload.WeightRestriction) + order.Entitlement.WeightRestriction = &weightRestriction + } if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour @@ -607,7 +611,6 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder } return order - } func (f *orderUpdater) saveDocumentForAmendedOrder(appCtx appcontext.AppContext, doc *models.Document) (*models.Document, error) { var docID uuid.UUID diff --git a/pkg/testdatagen/make_entitlement.go b/pkg/testdatagen/make_entitlement.go index e71bf02cec1..9d9c787df4d 100644 --- a/pkg/testdatagen/make_entitlement.go +++ b/pkg/testdatagen/make_entitlement.go @@ -17,6 +17,7 @@ func makeEntitlement(db *pop.Connection, assertions Assertions) models.Entitleme ordersType := assertions.Order.OrdersType proGearWeight := 2000 proGearWeightSpouse := 500 + falsePtr := false if grade == nil || *grade == "" { grade = models.ServiceMemberGradeE1.Pointer() @@ -32,6 +33,7 @@ func makeEntitlement(db *pop.Connection, assertions Assertions) models.Entitleme ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, OrganizationalClothingAndIndividualEquipment: ocie, + AdminRestrictedWeightLocation: &falsePtr, } entitlement.SetWeightAllotment(string(*grade), ordersType) dBAuthorizedWeight := entitlement.AuthorizedWeight() diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 23c99ba8862..8e5531ba5bc 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -35,6 +35,29 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab checkUBFeatureFlag(); }, []); + useEffect(() => { + if (!isAdminWeightLocationChecked) { + // Find the weight restriction input and reset its value to 0 + const weightRestrictionInput = document.getElementById('weightRestrictionId'); + if (weightRestrictionInput) { + weightRestrictionInput.value = '0'; + } + } + }, [isAdminWeightLocationChecked]); + + const handleAdminWeightLocationChange = (e) => { + setIsAdminWeightLocationChecked(e.target.checked); + if (!e.target.checked) { + const weightRestrictionInput = document.querySelector('input[name="weightRestriction"]'); + if (weightRestrictionInput) { + weightRestrictionInput.value = '0'; + // Trigger change event to ensure form state is updated + const event = new Event('input', { bubbles: true }); + weightRestrictionInput.dispatchEvent(event); + } + } + }; + return (

{header &&

{header}

} @@ -172,9 +195,9 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab data-testid="adminWeightLocation" id="adminWeightLocation" name="adminRestrictedWeightLocation" - label="Admin Restricted Weight Location" + label="Admin restricted weight location" isDisabled={formIsDisabled} - onChange={(e) => setIsAdminWeightLocationChecked(e.target.checked)} + onChange={handleAdminWeightLocationChange} />
{isAdminWeightLocationChecked && ( @@ -209,7 +232,6 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab ); }; - AllowancesDetailForm.propTypes = { entitlements: EntitlementShape.isRequired, branchOptions: DropdownArrayOf.isRequired, From 3f9ee3527fd73d042e5addfd1d3b644e96ca0889 Mon Sep 17 00:00:00 2001 From: Beth Grohmann Date: Tue, 14 Jan 2025 10:59:58 -0600 Subject: [PATCH 030/229] Update 20250106202424_update_duty_locs.up.sql --- migrations/app/schema/20250106202424_update_duty_locs.up.sql | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/migrations/app/schema/20250106202424_update_duty_locs.up.sql b/migrations/app/schema/20250106202424_update_duty_locs.up.sql index 4015ffe3e8c..bd801b9067d 100644 --- a/migrations/app/schema/20250106202424_update_duty_locs.up.sql +++ b/migrations/app/schema/20250106202424_update_duty_locs.up.sql @@ -21,6 +21,10 @@ INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_ ('6555ccb2-a8a1-4961-98cc-b507490580ed'::uuid,'San Diego, CA 92135',NULL,'cb437e3d-a2e8-4315-95c6-6da85b6c242a'::uuid,now(),now(),null,true); --add Cannon AFB 88101 duty location +INSERT INTO addresses +(id, street_address_1, street_address_2, city, state, postal_code, created_at, updated_at, street_address_3, county, is_oconus, country_id, us_post_region_cities_id) +VALUES('fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid, 'n/a', NULL, 'CANNON AFB', 'NM', '88101', now(), now(), NULL, 'CURRY', false, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, '68393e10-1aed-4a51-85a0-559a0a5b0e3f'::uuid); + INSERT INTO duty_locations (id,"name",affiliation,address_id,created_at,updated_at,transportation_office_id,provides_services_counseling) VALUES ('98beab3c-f8ce-4e3c-b78e-8db614721621'::uuid, 'Cannon AFB, NM 88101',null, 'fb90a7df-6494-4974-a0ce-4bdbcaff80c0'::uuid,now(),now(),'80796bc4-e494-4b19-bb16-cdcdba187829',true); From 47d484691d009bbf3f7fa6570ae218d41df8b192 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Tue, 14 Jan 2025 11:08:26 -0600 Subject: [PATCH 031/229] cupid shuffle --- .../Office/AllowancesDetailForm/AllowancesDetailForm.jsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 8e5531ba5bc..739a5ea9d63 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -172,6 +172,10 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab lazy={false} // immediate masking evaluation isDisabled={formIsDisabled} /> +
+
Standard Weight allowance
+
{formatWeight(entitlements.totalWeight)}
+
)} - -
-
Standard Weight allowance
-
{formatWeight(entitlements.totalWeight)}
-
Date: Tue, 14 Jan 2025 20:47:59 +0000 Subject: [PATCH 032/229] Changed migration to exclude some cols, added SQL to move_history_fetcher for payment_service_items, renamed move history event for consistency --- ...ory_table_for_payment_service_items.up.sql | 2 +- .../sql_scripts/move_history_fetcher.sql | 44 +++++++++++++++++++ ...jsx => UpdatePaymentServiceItemStatus.jsx} | 2 +- .../MoveHistory/EventTemplates/index.js | 2 +- .../MoveHistory/UIDisplay/Operations.js | 2 +- 5 files changed, 48 insertions(+), 4 deletions(-) rename src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/{UpdatePaymentServiceItem.jsx => UpdatePaymentServiceItemStatus.jsx} (94%) diff --git a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql index 68c3a865112..1502e3302c8 100644 --- a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql +++ b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql @@ -1 +1 @@ -SELECT add_audit_history_table('payment_service_items'); \ No newline at end of file +SELECT add_audit_history_table(target_table := 'payment_service_items', audit_rows := BOOLEAN 't', audit_query_text := BOOLEAN 't', ignored_cols := ARRAY['created_at', 'updated_at']); \ No newline at end of file diff --git a/pkg/assets/sql_scripts/move_history_fetcher.sql b/pkg/assets/sql_scripts/move_history_fetcher.sql index dacacf55d78..36584462a26 100644 --- a/pkg/assets/sql_scripts/move_history_fetcher.sql +++ b/pkg/assets/sql_scripts/move_history_fetcher.sql @@ -239,6 +239,45 @@ WITH move AS ( JOIN move_payment_requests ON move_payment_requests.id = audit_history.object_id WHERE audit_history.table_name = 'payment_requests' ), + move_payment_service_items AS ( + SELECT + jsonb_agg(jsonb_build_object( + 'name', re_services.name, + 'price', payment_service_items.price_cents::TEXT, + 'status', payment_service_items.status, + 'rejection_reason', payment_service_items.rejection_reason, + 'requested_at', payment_service_items.requested_at, + 'denied_at', payment_service_items.denied_at, + 'sent_to_gex_at', payment_service_items.sent_to_gex_at, + 'paid_at', payment_service_items.paid_at, + 'shipment_id', move_shipments.id::TEXT, + 'shipment_id_abbr', move_shipments.shipment_id_abbr, + 'shipment_type', move_shipments.shipment_type, + 'shipment_locator', move_shipments.shipment_locator + ) + )::TEXT AS context, + payment_service_items.id AS id + FROM + payment_requests + JOIN payment_service_items ON payment_service_items.payment_request_id = payment_requests.id + JOIN move_service_items ON move_service_items.id = payment_service_items.mto_service_item_id + LEFT JOIN move_shipments ON move_shipments.id = move_service_items.mto_shipment_id + JOIN re_services ON move_service_items.re_service_id = re_services.id + WHERE + payment_requests.move_id = (SELECT move.id FROM move) + GROUP BY + payment_service_items.id + ), + payment_service_items_logs AS ( + SELECT DISTINCT + audit_history.*, + context AS context, + NULL AS context_id + FROM + audit_history + JOIN move_payment_service_items ON move_payment_service_items.id = audit_history.object_id + WHERE audit_history.table_name = 'payment_service_items' + ), move_proof_of_service_docs AS ( SELECT proof_of_service_docs.*, @@ -698,6 +737,11 @@ WITH move AS ( FROM payment_requests_logs UNION + SELECT + * + FROM + payment_service_items_logs + UNION SELECT * FROM diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx similarity index 94% rename from src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx rename to src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index 0977bb649ca..cb7909334e6 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItem.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -17,7 +17,7 @@ const formatChangedValues = (historyRecord) => { export default { action: a.UPDATE, - eventName: o.updatePaymentServiceItem, + eventName: o.updatePaymentServiceItemStatus, tableName: t.payment_service_items, getEventNameDisplay: () => { return
Updated Payment Service Item
; diff --git a/src/constants/MoveHistory/EventTemplates/index.js b/src/constants/MoveHistory/EventTemplates/index.js index d1d582e6f16..9418f981424 100644 --- a/src/constants/MoveHistory/EventTemplates/index.js +++ b/src/constants/MoveHistory/EventTemplates/index.js @@ -109,4 +109,4 @@ export { default as moveCancelerPPMShipments } from './MoveCanceler/MoveCanceler export { default as cancelMove } from './CancelMove/CancelMove'; export { default as cancelMoveMTOShipments } from './CancelMove/CancelMoveMTOShipments'; export { default as cancelMovePPMShipments } from './CancelMove/CancelMovePPMShipments'; -export { default as updatePaymentServiceItem } from './UpdatePaymentServiceItem/UpdatePaymentServiceItem'; +export { default as updatePaymentServiceItemStatus } from './UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus'; diff --git a/src/constants/MoveHistory/UIDisplay/Operations.js b/src/constants/MoveHistory/UIDisplay/Operations.js index 79f50d951aa..c4b3c91decc 100644 --- a/src/constants/MoveHistory/UIDisplay/Operations.js +++ b/src/constants/MoveHistory/UIDisplay/Operations.js @@ -34,7 +34,7 @@ export default { updateOrder: 'updateOrder', // ghc.yaml updateOrders: 'updateOrders', // internal.yaml updatePaymentRequestStatus: 'updatePaymentRequestStatus', - updatePaymentServiceItem: 'updatePaymentServiceItem', + updatePaymentServiceItemStatus: 'updatePaymentServiceItemStatus', updateReweigh: 'updateReweigh', updateServiceItemStatus: 'updateMTOServiceItemStatus', updateServiceItemSitEntryDate: 'updateServiceItemSitEntryDate', // ghc.yaml From 1dc04d48adf1b236608b6f046096bdccf6068bc4 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 14 Jan 2025 21:51:28 +0000 Subject: [PATCH 033/229] initial commit, have the function working but need to address max incentive check since it is erroring out --- migrations/app/migrations_manifest.txt | 1 + ...52_add_ppm_estimated_incentive_proc.up.sql | 117 ++++++++++++++++++ pkg/models/ppm_shipment.go | 15 +++ .../mto_shipment/mto_shipment_updater.go | 4 +- pkg/services/ppmshipment/ppm_estimator.go | 66 ++++++---- 5 files changed, 175 insertions(+), 28 deletions(-) create mode 100644 migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index bacd3130cac..c4ddda302b5 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1069,3 +1069,4 @@ 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql 20250110214012_homesafeconnect_cert.up.sql 20250113201232_update_estimated_pricing_procs_add_is_peak_func.up.sql +20250114164752_add_ppm_estimated_incentive_proc.up.sql diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql new file mode 100644 index 00000000000..e6925e05eb0 --- /dev/null +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -0,0 +1,117 @@ +CREATE OR REPLACE FUNCTION calculate_ppm_incentive( + ppm_id UUID, + mileage INT, + weight INT, + is_estimated BOOLEAN, + is_actual BOOLEAN +) RETURNS NUMERIC AS +$$ +DECLARE + ppm RECORD; + escalated_price NUMERIC; + estimated_price_islh NUMERIC; + estimated_price_ihpk NUMERIC; + estimated_price_ihupk NUMERIC; + estimated_price_fsc NUMERIC; + total_incentive NUMERIC := 0; + contract_id UUID; + o_rate_area_id UUID; + d_rate_area_id UUID; + service_id UUID; + estimated_fsc_multiplier NUMERIC; + fuel_price NUMERIC; + price_difference NUMERIC; + cents_above_baseline NUMERIC; +BEGIN + + IF NOT is_estimated AND NOT is_actual THEN + RAISE EXCEPTION 'Both is_estimated and is_actual cannot be FALSE. No update will be performed.'; + END IF; + + SELECT ppms.id, ppms.pickup_postal_address_id, ppms.destination_postal_address_id, ppms.expected_departure_date + INTO ppm + FROM ppm_shipments ppms + WHERE ppms.id = ppm_id; + + IF ppm IS NULL THEN + RAISE EXCEPTION 'PPM with ID % not found', ppm_id; + END IF; + + contract_id := get_contract_id(ppm.expected_departure_date); + IF contract_id IS NULL THEN + RAISE EXCEPTION 'Contract not found for date: %', ppm.expected_departure_date; + END IF; + + o_rate_area_id := get_rate_area_id(ppm.pickup_postal_address_id, NULL, contract_id); + IF o_rate_area_id IS NULL THEN + RAISE EXCEPTION 'Origin rate area is NULL for address ID %', ppm.pickup_postal_address_id; + END IF; + + d_rate_area_id := get_rate_area_id(ppm.destination_postal_address_id, NULL, contract_id); + IF d_rate_area_id IS NULL THEN + RAISE EXCEPTION 'Destination rate area is NULL for address ID %', ppm.destination_postal_address_id; + END IF; + + -- ISLH calculation + SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'ISLH'; + estimated_price_islh := ROUND( + calculate_escalated_price( + o_rate_area_id, + d_rate_area_id, + service_id, + contract_id, + 'ISLH', + ppm.expected_departure_date + ) * (weight / 100)::NUMERIC * 100, 0 + ); + RAISE NOTICE 'Estimated price for ISLH: % cents', estimated_price_islh; + + -- IHPK calculation + SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHPK'; + estimated_price_ihpk := ROUND( + calculate_escalated_price( + o_rate_area_id, + NULL, + service_id, + contract_id, + 'IHPK', + ppm.expected_departure_date + ) * (weight / 100)::NUMERIC * 100, 0 + ); + RAISE NOTICE 'Estimated price for IHPK: % cents', estimated_price_ihpk; + + -- IHUPK calculation + SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHUPK'; + estimated_price_ihupk := ROUND( + calculate_escalated_price( + NULL, + d_rate_area_id, + service_id, + contract_id, + 'IHUPK', + ppm.expected_departure_date + ) * (weight / 100)::NUMERIC * 100, 0 + ); + RAISE NOTICE 'Estimated price for IHUPK: % cents', estimated_price_ihupk; + + -- FSC calculation + estimated_fsc_multiplier := get_fsc_multiplier(weight); + fuel_price := get_fuel_price(ppm.expected_departure_date); + price_difference := calculate_price_difference(fuel_price); + cents_above_baseline := mileage * estimated_fsc_multiplier; + estimated_price_fsc := ROUND((cents_above_baseline * price_difference) * 100); + RAISE NOTICE 'Estimated price for FSC: % cents', estimated_price_fsc; + + -- total + total_incentive := estimated_price_islh + estimated_price_ihpk + estimated_price_ihupk + estimated_price_fsc; + RAISE NOTICE 'Total PPM Incentive: % cents', total_incentive; + + -- now update the incentive value + UPDATE ppm_shipments + SET estimated_incentive = CASE WHEN is_estimated THEN total_incentive ELSE estimated_incentive END, + final_incentive = CASE WHEN is_actual THEN total_incentive ELSE final_incentive END + WHERE id = ppm_id; + + RETURN total_incentive; +END; +$$ LANGUAGE plpgsql; diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index 0737417207c..40719f45d98 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -1,6 +1,7 @@ package models import ( + "fmt" "time" "github.com/gobuffalo/pop/v6" @@ -319,3 +320,17 @@ func FetchPPMShipmentByPPMShipmentID(db *pop.Connection, ppmShipmentID uuid.UUID } return &ppmShipment, nil } + +// a db stored proc that will handle updating the estimated_incentive value +// this simulates pricing of a basic iHHG shipment with ISLH, IHPK, IHUPK, and the CONUS portion for a FSC +func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, mileage int, weight int, isEstimated bool, isActual bool) (int, error) { + var incentive int + + err := db.RawQuery("SELECT calculate_ppm_incentive($1, $2, $3, $4, $5)", ppmID, mileage, weight, isEstimated, isActual). + First(&incentive) + if err != nil { + return 0, fmt.Errorf("error calculating PPM incentive for PPM ID %s: %w", ppmID, err) + } + + return incentive, nil +} diff --git a/pkg/services/mto_shipment/mto_shipment_updater.go b/pkg/services/mto_shipment/mto_shipment_updater.go index 3fa1f6ed832..cf3336d0261 100644 --- a/pkg/services/mto_shipment/mto_shipment_updater.go +++ b/pkg/services/mto_shipment/mto_shipment_updater.go @@ -844,7 +844,9 @@ func (f *mtoShipmentUpdater) updateShipmentRecord(appCtx appcontext.AppContext, } // when populating the market_code column, it is considered domestic if both pickup & dest are CONUS addresses - newShipment = models.DetermineShipmentMarketCode(newShipment) + if newShipment.ShipmentType != models.MTOShipmentTypePPM { + newShipment = models.DetermineShipmentMarketCode(newShipment) + } if err := txnAppCtx.DB().Update(newShipment); err != nil { return err diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index e49d7846bbe..38f3b5aa832 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -203,46 +203,58 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip } } - calculateSITEstimate := shouldCalculateSITCost(newPPMShipment, &oldPPMShipment) + // if the PPM is international, we will use a db stored proc + if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { - // Clear out any previously calculated SIT estimated costs, if SIT is no longer expected - if newPPMShipment.SITExpected != nil && !*newPPMShipment.SITExpected { - newPPMShipment.SITEstimatedCost = nil - } - - skipCalculatingEstimatedIncentive := shouldSkipEstimatingIncentive(newPPMShipment, &oldPPMShipment) + calculateSITEstimate := shouldCalculateSITCost(newPPMShipment, &oldPPMShipment) - if skipCalculatingEstimatedIncentive && !calculateSITEstimate { - return oldPPMShipment.EstimatedIncentive, newPPMShipment.SITEstimatedCost, nil - } + // Clear out any previously calculated SIT estimated costs, if SIT is no longer expected + if newPPMShipment.SITExpected != nil && !*newPPMShipment.SITExpected { + newPPMShipment.SITEstimatedCost = nil + } - contractDate := newPPMShipment.ExpectedDepartureDate - contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) - if err != nil { - return nil, nil, err - } + skipCalculatingEstimatedIncentive := shouldSkipEstimatingIncentive(newPPMShipment, &oldPPMShipment) - estimatedIncentive := oldPPMShipment.EstimatedIncentive - if !skipCalculatingEstimatedIncentive { - // Clear out advance and advance requested fields when the estimated incentive is reset. - newPPMShipment.HasRequestedAdvance = nil - newPPMShipment.AdvanceAmountRequested = nil + if skipCalculatingEstimatedIncentive && !calculateSITEstimate { + return oldPPMShipment.EstimatedIncentive, newPPMShipment.SITEstimatedCost, nil + } - estimatedIncentive, err = f.calculatePrice(appCtx, newPPMShipment, 0, contract, false) + contractDate := newPPMShipment.ExpectedDepartureDate + contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) if err != nil { return nil, nil, err } - } - estimatedSITCost := oldPPMShipment.SITEstimatedCost - if calculateSITEstimate { - estimatedSITCost, err = CalculateSITCost(appCtx, newPPMShipment, contract) + estimatedIncentive := oldPPMShipment.EstimatedIncentive + if !skipCalculatingEstimatedIncentive { + // Clear out advance and advance requested fields when the estimated incentive is reset. + newPPMShipment.HasRequestedAdvance = nil + newPPMShipment.AdvanceAmountRequested = nil + + estimatedIncentive, err = f.calculatePrice(appCtx, newPPMShipment, 0, contract, false) + if err != nil { + return nil, nil, err + } + } + + estimatedSITCost := oldPPMShipment.SITEstimatedCost + if calculateSITEstimate { + estimatedSITCost, err = CalculateSITCost(appCtx, newPPMShipment, contract) + if err != nil { + return nil, nil, err + } + } + + return estimatedIncentive, estimatedSITCost, nil + + } else { + estimatedIncentive, err := models.CalculatePPMIncentive(appCtx.DB(), newPPMShipment.ID, 1000, newPPMShipment.EstimatedWeight.Int(), true, false) if err != nil { return nil, nil, err } - } - return estimatedIncentive, estimatedSITCost, nil + return (*unit.Cents)(&estimatedIncentive), nil, nil + } } func (f *estimatePPM) maxIncentive(appCtx appcontext.AppContext, oldPPMShipment models.PPMShipment, newPPMShipment *models.PPMShipment, checks ...ppmShipmentValidator) (*unit.Cents, error) { From edbbb04e64299ef399b8010d5bf147035f4926da Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 15 Jan 2025 14:50:15 +0000 Subject: [PATCH 034/229] added port check to estimator, need to address max incentive since it is also being checked --- pkg/models/port_location.go | 12 ++++++++ pkg/services/ppmshipment/ppm_estimator.go | 37 +++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/pkg/models/port_location.go b/pkg/models/port_location.go index 4d514a2a545..414006d9c82 100644 --- a/pkg/models/port_location.go +++ b/pkg/models/port_location.go @@ -3,7 +3,10 @@ package models import ( "time" + "github.com/gobuffalo/pop/v6" "github.com/gofrs/uuid" + + "github.com/transcom/mymove/pkg/apperror" ) type PortLocation struct { @@ -24,3 +27,12 @@ type PortLocation struct { func (l PortLocation) TableName() string { return "port_locations" } + +func FetchPortLocationByCode(db *pop.Connection, portCode string) (*PortLocation, error) { + portLocation := PortLocation{} + err := db.Eager("Port", "UsPostRegionCity").Where("is_active = TRUE").InnerJoin("ports p", "port_id = p.id").Where("p.port_code = $1", portCode).First(&portLocation) + if err != nil { + return nil, apperror.NewQueryError("PortLocation", err, "") + } + return &portLocation, err +} diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 38f3b5aa832..ef775c587d2 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -248,9 +248,42 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip return estimatedIncentive, estimatedSITCost, nil } else { - estimatedIncentive, err := models.CalculatePPMIncentive(appCtx.DB(), newPPMShipment.ID, 1000, newPPMShipment.EstimatedWeight.Int(), true, false) + var mileage int + pickupAddress := newPPMShipment.PickupAddress + destinationAddress := newPPMShipment.DestinationAddress + + // get the Tacoma, WA port (code: 3002) - this is the authorized port for PPMs + ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") if err != nil { - return nil, nil, err + return nil, nil, fmt.Errorf("failed to fetch port location: %w", err) + } + + // handling OCONUS/CONUS mileage logic to determine mileage checks + isPickupOconus := pickupAddress.IsOconus != nil && *pickupAddress.IsOconus + isDestinationOconus := destinationAddress.IsOconus != nil && *destinationAddress.IsOconus + + switch { + case isPickupOconus && isDestinationOconus: + // OCONUS -> OCONUS: no mileage (set to 0) + mileage = 0 + case isPickupOconus && !isDestinationOconus: + // OCONUS -> CONUS: get mileage from port ZIP to destination ZIP + mileage, err = f.planner.ZipTransitDistance(appCtx, ppmPort.UsPostRegionCity.UsprZipID, destinationAddress.PostalCode, true, true) + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate OCONUS to CONUS mileage: %w", err) + } + case !isPickupOconus && isDestinationOconus: + // CONUS -> OCONUS: get mileage from pickup ZIP to port ZIP + mileage, err = f.planner.ZipTransitDistance(appCtx, pickupAddress.PostalCode, ppmPort.UsPostRegionCity.UsprZipID, true, true) + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate CONUS to OCONUS mileage: %w", err) + } + } + + // now we can calculate the incentive + estimatedIncentive, err := models.CalculatePPMIncentive(appCtx.DB(), newPPMShipment.ID, mileage, newPPMShipment.EstimatedWeight.Int(), true, false) + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } return (*unit.Cents)(&estimatedIncentive), nil, nil From 9f503f7c78dc52b612b86188a2256f63f174d544 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Wed, 15 Jan 2025 16:16:24 +0000 Subject: [PATCH 035/229] B-21659 Add IUBUPK, UBP, and IUBPK to ServiceItemDetails --- .../Office/ServiceItemDetails/ServiceItemDetails.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/Office/ServiceItemDetails/ServiceItemDetails.jsx b/src/components/Office/ServiceItemDetails/ServiceItemDetails.jsx index 689a790ca64..76be9ca5d57 100644 --- a/src/components/Office/ServiceItemDetails/ServiceItemDetails.jsx +++ b/src/components/Office/ServiceItemDetails/ServiceItemDetails.jsx @@ -491,8 +491,11 @@ const ServiceItemDetails = ({ id, code, details, serviceRequestDocs, shipment, s case 'ISLH': case 'IHPK': case 'IHUPK': + case 'IUBPK': + case 'IUBUPK': case 'POEFSC': - case 'PODFSC': { + case 'PODFSC': + case 'UBP': { detailSection = (
From 3d248185e064b2e578daf7bf6048463459b34aaf Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 15 Jan 2025 16:26:19 +0000 Subject: [PATCH 036/229] Added tests for approved/denied payment service items. --- .../UpdatePaymentServiceItemStatus.test.jsx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx new file mode 100644 index 00000000000..55d83e79c77 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx @@ -0,0 +1,60 @@ +import { render, screen } from '@testing-library/react'; + +import getTemplate from 'constants/MoveHistory/TemplateManager'; +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; + +describe('When approving/rejecting a payment service item', () => { + const rejectPaymentServiceItemRecord = { + action: a.UPDATE, + actionTstampClk: '2025-01-10T19:44:31.255Z', + actionTstampStm: '2025-01-10T19:44:31.253Z', + actionTstampTx: '2025-01-10T19:44:31.220Z', + context: [ + { + shipment_type: 'PPM', + shipment_locator: 'RQ38D4-01', + shipment_id_abbr: 'f10be', + }, + ], + changedValues: { + reason: 'Some reason', + status: 'DENIED', + }, + eventName: o.updatePaymentServiceItemStatus, + tableName: t.payment_service_items, + id: '2419f1db-3f8b-4823-974f-9aa4edb753da', + objectId: 'eee30fb1-dc66-4821-a17c-2ecf431ceb9d', + oldValues: { + id: 'eee30fb1-dc66-4821-a17c-2ecf431ceb9d', + ppm_shipment_id: '86329c14-564b-4580-94b9-8a2e80bccefc', + reason: null, + status: null, + }, + }; + + const approvePaymentServiceItemRecord = { ...rejectPaymentServiceItemRecord }; + approvePaymentServiceItemRecord.changedValues = { + status: 'APPROVED', + }; + + it('displays an approved payment service item', () => { + const template = getTemplate(approvePaymentServiceItemRecord); + + render(template.getDetails(approvePaymentServiceItemRecord)); + expect(screen.getByText('PPM shipment #RQ38D4-01')).toBeInTheDocument(); + expect(screen.getByText('Status')).toBeInTheDocument(); + expect(screen.getByText(': APPROVED')).toBeInTheDocument(); + }); + + it('displays a rejected payment service item and the rejection reason', () => { + const template = getTemplate(rejectPaymentServiceItemRecord); + + render(template.getDetails(rejectPaymentServiceItemRecord)); + expect(screen.getByText('Status')).toBeInTheDocument(); + expect(screen.getByText(': DENIED')).toBeInTheDocument(); + expect(screen.getByText('Reason')).toBeInTheDocument(); + expect(screen.getByText(': Some reason')).toBeInTheDocument(); + }); +}); From 19600c13105678d9e12b0dd6869b9b8b7f1dcf3a Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Wed, 15 Jan 2025 20:50:09 +0000 Subject: [PATCH 037/229] B-21659 Add UB prop type to fix warnings Add UB prop type to ShipmentDisplay Add UB prop type to ShipmentInfoListSelector --- .../Office/DefinitionLists/ShipmentInfoListSelector.jsx | 1 + src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx | 1 + 2 files changed, 2 insertions(+) diff --git a/src/components/Office/DefinitionLists/ShipmentInfoListSelector.jsx b/src/components/Office/DefinitionLists/ShipmentInfoListSelector.jsx index 6830db6b735..b50fbc53e2f 100644 --- a/src/components/Office/DefinitionLists/ShipmentInfoListSelector.jsx +++ b/src/components/Office/DefinitionLists/ShipmentInfoListSelector.jsx @@ -140,6 +140,7 @@ ShipmentInfoListSelector.propTypes = { SHIPMENT_TYPES.BOAT_HAUL_AWAY, SHIPMENT_TYPES.BOAT_TOW_AWAY, SHIPMENT_OPTIONS.MOBILE_HOME, + SHIPMENT_OPTIONS.UNACCOMPANIED_BAGGAGE, ]), isForEvaluationReport: PropTypes.bool, destinationDutyLocationPostalCode: PropTypes.string, diff --git a/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx b/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx index 573c5edc984..3627b64714a 100644 --- a/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx +++ b/src/components/Office/ShipmentDisplay/ShipmentDisplay.jsx @@ -193,6 +193,7 @@ ShipmentDisplay.propTypes = { SHIPMENT_TYPES.BOAT_HAUL_AWAY, SHIPMENT_TYPES.BOAT_TOW_AWAY, SHIPMENT_OPTIONS.MOBILE_HOME, + SHIPMENT_OPTIONS.UNACCOMPANIED_BAGGAGE, ]), displayInfo: PropTypes.oneOfType([ PropTypes.shape({ From 26610d91970fc305a9ec440a58dcb317ca25820f Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 15 Jan 2025 21:00:45 +0000 Subject: [PATCH 038/229] estimated, actual, and max are good for db func, need to address closeout before tackling SIT --- ...52_add_ppm_estimated_incentive_proc.up.sql | 38 ++-- pkg/models/ppm_shipment.go | 4 +- pkg/services/ppmshipment/ppm_estimator.go | 177 +++++++++++------- .../ppmshipment/ppm_shipment_updater.go | 123 ++++++------ 4 files changed, 199 insertions(+), 143 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index e6925e05eb0..ce8be73a674 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -1,9 +1,15 @@ +-- function that calculates a ppm incentive given mileage, weight, and dates +-- this is used to calculate estimated, max, and actual incentives CREATE OR REPLACE FUNCTION calculate_ppm_incentive( ppm_id UUID, + pickup_address_id UUID, + destination_address_id UUID, + move_date DATE, mileage INT, weight INT, is_estimated BOOLEAN, - is_actual BOOLEAN + is_actual BOOLEAN, + is_max BOOLEAN ) RETURNS NUMERIC AS $$ DECLARE @@ -24,11 +30,12 @@ DECLARE cents_above_baseline NUMERIC; BEGIN - IF NOT is_estimated AND NOT is_actual THEN - RAISE EXCEPTION 'Both is_estimated and is_actual cannot be FALSE. No update will be performed.'; + IF NOT is_estimated AND NOT is_actual AND NOT is_max THEN + RAISE EXCEPTION 'is_estimated, is_actual, and is_max cannot all be FALSE. No update will be performed.'; END IF; - SELECT ppms.id, ppms.pickup_postal_address_id, ppms.destination_postal_address_id, ppms.expected_departure_date + -- validating it's a real PPM + SELECT ppms.id INTO ppm FROM ppm_shipments ppms WHERE ppms.id = ppm_id; @@ -37,19 +44,19 @@ BEGIN RAISE EXCEPTION 'PPM with ID % not found', ppm_id; END IF; - contract_id := get_contract_id(ppm.expected_departure_date); + contract_id := get_contract_id(move_date); IF contract_id IS NULL THEN - RAISE EXCEPTION 'Contract not found for date: %', ppm.expected_departure_date; + RAISE EXCEPTION 'Contract not found for date: %', move_date; END IF; - o_rate_area_id := get_rate_area_id(ppm.pickup_postal_address_id, NULL, contract_id); + o_rate_area_id := get_rate_area_id(pickup_address_id, NULL, contract_id); IF o_rate_area_id IS NULL THEN - RAISE EXCEPTION 'Origin rate area is NULL for address ID %', ppm.pickup_postal_address_id; + RAISE EXCEPTION 'Origin rate area is NULL for address ID %', pickup_address_id; END IF; - d_rate_area_id := get_rate_area_id(ppm.destination_postal_address_id, NULL, contract_id); + d_rate_area_id := get_rate_area_id(destination_address_id, NULL, contract_id); IF d_rate_area_id IS NULL THEN - RAISE EXCEPTION 'Destination rate area is NULL for address ID %', ppm.destination_postal_address_id; + RAISE EXCEPTION 'Destination rate area is NULL for address ID %', destination_address_id; END IF; -- ISLH calculation @@ -61,7 +68,7 @@ BEGIN service_id, contract_id, 'ISLH', - ppm.expected_departure_date + move_date ) * (weight / 100)::NUMERIC * 100, 0 ); RAISE NOTICE 'Estimated price for ISLH: % cents', estimated_price_islh; @@ -75,7 +82,7 @@ BEGIN service_id, contract_id, 'IHPK', - ppm.expected_departure_date + move_date ) * (weight / 100)::NUMERIC * 100, 0 ); RAISE NOTICE 'Estimated price for IHPK: % cents', estimated_price_ihpk; @@ -89,14 +96,14 @@ BEGIN service_id, contract_id, 'IHUPK', - ppm.expected_departure_date + move_date ) * (weight / 100)::NUMERIC * 100, 0 ); RAISE NOTICE 'Estimated price for IHUPK: % cents', estimated_price_ihupk; -- FSC calculation estimated_fsc_multiplier := get_fsc_multiplier(weight); - fuel_price := get_fuel_price(ppm.expected_departure_date); + fuel_price := get_fuel_price(move_date); price_difference := calculate_price_difference(fuel_price); cents_above_baseline := mileage * estimated_fsc_multiplier; estimated_price_fsc := ROUND((cents_above_baseline * price_difference) * 100); @@ -109,7 +116,8 @@ BEGIN -- now update the incentive value UPDATE ppm_shipments SET estimated_incentive = CASE WHEN is_estimated THEN total_incentive ELSE estimated_incentive END, - final_incentive = CASE WHEN is_actual THEN total_incentive ELSE final_incentive END + final_incentive = CASE WHEN is_actual THEN total_incentive ELSE final_incentive END, + max_incentive = CASE WHEN is_max THEN total_incentive ELSE max_incentive END WHERE id = ppm_id; RETURN total_incentive; diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index 40719f45d98..fab8720e125 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -323,10 +323,10 @@ func FetchPPMShipmentByPPMShipmentID(db *pop.Connection, ppmShipmentID uuid.UUID // a db stored proc that will handle updating the estimated_incentive value // this simulates pricing of a basic iHHG shipment with ISLH, IHPK, IHUPK, and the CONUS portion for a FSC -func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, mileage int, weight int, isEstimated bool, isActual bool) (int, error) { +func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (int, error) { var incentive int - err := db.RawQuery("SELECT calculate_ppm_incentive($1, $2, $3, $4, $5)", ppmID, mileage, weight, isEstimated, isActual). + err := db.RawQuery("SELECT calculate_ppm_incentive($1, $2, $3, $4, $5, $6, $7, $8, $9)", ppmID, pickupAddressID, destAddressID, moveDate, mileage, weight, isEstimated, isActual, isMax). First(&incentive) if err != nil { return 0, fmt.Errorf("error calculating PPM incentive for PPM ID %s: %w", ppmID, err) diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index ef775c587d2..971527632fc 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -203,7 +203,13 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip } } - // if the PPM is international, we will use a db stored proc + contractDate := newPPMShipment.ExpectedDepartureDate + contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) + if err != nil { + return nil, nil, err + } + + // if the PPM is international, we will use a db func if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { calculateSITEstimate := shouldCalculateSITCost(newPPMShipment, &oldPPMShipment) @@ -219,12 +225,6 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip return oldPPMShipment.EstimatedIncentive, newPPMShipment.SITEstimatedCost, nil } - contractDate := newPPMShipment.ExpectedDepartureDate - contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) - if err != nil { - return nil, nil, err - } - estimatedIncentive := oldPPMShipment.EstimatedIncentive if !skipCalculatingEstimatedIncentive { // Clear out advance and advance requested fields when the estimated incentive is reset. @@ -248,45 +248,15 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip return estimatedIncentive, estimatedSITCost, nil } else { - var mileage int pickupAddress := newPPMShipment.PickupAddress destinationAddress := newPPMShipment.DestinationAddress - // get the Tacoma, WA port (code: 3002) - this is the authorized port for PPMs - ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") - if err != nil { - return nil, nil, fmt.Errorf("failed to fetch port location: %w", err) - } - - // handling OCONUS/CONUS mileage logic to determine mileage checks - isPickupOconus := pickupAddress.IsOconus != nil && *pickupAddress.IsOconus - isDestinationOconus := destinationAddress.IsOconus != nil && *destinationAddress.IsOconus - - switch { - case isPickupOconus && isDestinationOconus: - // OCONUS -> OCONUS: no mileage (set to 0) - mileage = 0 - case isPickupOconus && !isDestinationOconus: - // OCONUS -> CONUS: get mileage from port ZIP to destination ZIP - mileage, err = f.planner.ZipTransitDistance(appCtx, ppmPort.UsPostRegionCity.UsprZipID, destinationAddress.PostalCode, true, true) - if err != nil { - return nil, nil, fmt.Errorf("failed to calculate OCONUS to CONUS mileage: %w", err) - } - case !isPickupOconus && isDestinationOconus: - // CONUS -> OCONUS: get mileage from pickup ZIP to port ZIP - mileage, err = f.planner.ZipTransitDistance(appCtx, pickupAddress.PostalCode, ppmPort.UsPostRegionCity.UsprZipID, true, true) - if err != nil { - return nil, nil, fmt.Errorf("failed to calculate CONUS to OCONUS mileage: %w", err) - } - } - - // now we can calculate the incentive - estimatedIncentive, err := models.CalculatePPMIncentive(appCtx.DB(), newPPMShipment.ID, mileage, newPPMShipment.EstimatedWeight.Int(), true, false) + estimatedIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) if err != nil { return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } - return (*unit.Cents)(&estimatedIncentive), nil, nil + return estimatedIncentive, nil, nil } } @@ -306,7 +276,7 @@ func (f *estimatePPM) maxIncentive(appCtx appcontext.AppContext, oldPPMShipment // we have access to the MoveTaskOrderID in the ppmShipment object so we can use that to get the customer's maximum weight entitlement var move models.Move err = appCtx.DB().Q().Eager( - "Orders.Entitlement", + "Orders.Entitlement", "Orders.OriginDutyLocation.Address", "Orders.NewDutyLocation.Address", ).Where("show = TRUE").Find(&move, newPPMShipment.Shipment.MoveTaskOrderID) if err != nil { return nil, apperror.NewNotFoundError(newPPMShipment.ID, " error querying move") @@ -322,14 +292,27 @@ func (f *estimatePPM) maxIncentive(appCtx appcontext.AppContext, oldPPMShipment return nil, err } - // since the max incentive is based off of the authorized weight entitlement and that value CAN change - // we will calculate the max incentive each time it is called - maxIncentive, err := f.calculatePrice(appCtx, newPPMShipment, unit.Pound(*orders.Entitlement.DBAuthorizedWeight), contract, true) - if err != nil { - return nil, err - } + if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { + + // since the max incentive is based off of the authorized weight entitlement and that value CAN change + // we will calculate the max incentive each time it is called + maxIncentive, err := f.calculatePrice(appCtx, newPPMShipment, unit.Pound(*orders.Entitlement.DBAuthorizedWeight), contract, true) + if err != nil { + return nil, err + } + + return maxIncentive, nil + } else { + pickupAddress := orders.OriginDutyLocation.Address + destinationAddress := orders.NewDutyLocation.Address - return maxIncentive, nil + maxIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, pickupAddress, destinationAddress, contractDate, *orders.Entitlement.DBAuthorizedWeight, false, false, true) + if err != nil { + return nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) + } + + return maxIncentive, nil + } } func (f *estimatePPM) finalIncentive(appCtx appcontext.AppContext, oldPPMShipment models.PPMShipment, newPPMShipment *models.PPMShipment, checks ...ppmShipmentValidator) (*unit.Cents, error) { @@ -352,32 +335,51 @@ func (f *estimatePPM) finalIncentive(appCtx appcontext.AppContext, oldPPMShipmen newTotalWeight = *newPPMShipment.AllowableWeight } - isMissingInfo := shouldSetFinalIncentiveToNil(newPPMShipment, newTotalWeight) - var skipCalculateFinalIncentive bool - finalIncentive := oldPPMShipment.FinalIncentive + contractDate := newPPMShipment.ExpectedDepartureDate + if newPPMShipment.ActualMoveDate != nil { + contractDate = *newPPMShipment.ActualMoveDate + } + contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) + if err != nil { + return nil, err + } - if !isMissingInfo { - skipCalculateFinalIncentive = shouldSkipCalculatingFinalIncentive(newPPMShipment, &oldPPMShipment, originalTotalWeight, newTotalWeight) - if !skipCalculateFinalIncentive { - contractDate := newPPMShipment.ExpectedDepartureDate - if newPPMShipment.ActualMoveDate != nil { - contractDate = *newPPMShipment.ActualMoveDate - } - contract, err := serviceparamvaluelookups.FetchContract(appCtx, contractDate) - if err != nil { - return nil, err + if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { + isMissingInfo := shouldSetFinalIncentiveToNil(newPPMShipment, newTotalWeight) + var skipCalculateFinalIncentive bool + finalIncentive := oldPPMShipment.FinalIncentive + if !isMissingInfo { + skipCalculateFinalIncentive = shouldSkipCalculatingFinalIncentive(newPPMShipment, &oldPPMShipment, originalTotalWeight, newTotalWeight) + if !skipCalculateFinalIncentive { + + finalIncentive, err := f.calculatePrice(appCtx, newPPMShipment, newTotalWeight, contract, false) + if err != nil { + return nil, err + } + return finalIncentive, nil } + } else { + finalIncentive = nil - finalIncentive, err = f.calculatePrice(appCtx, newPPMShipment, newTotalWeight, contract, false) + return finalIncentive, nil + } + + return finalIncentive, nil + } else { + pickupAddress := newPPMShipment.PickupAddress + destinationAddress := newPPMShipment.DestinationAddress + + // we can't calculate actual incentive without the weight + if newTotalWeight != 0 { + finalIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newTotalWeight.Int(), false, true, false) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } + return finalIncentive, nil + } else { + return nil, nil } - } else { - finalIncentive = nil } - - return finalIncentive, nil } // SumWeightTickets return the total weight of all weightTickets associated with a PPMShipment, returns 0 if there is no valid weight @@ -738,6 +740,49 @@ func (f estimatePPM) priceBreakdown(appCtx appcontext.AppContext, ppmShipment *m return linehaul, fuel, origin, dest, packing, unpacking, storage, nil } +// function for calculating incentives for OCONUS PPM shipments +// this uses a db function that takes in values needed to come up with the estimated/actual/max incentives +// this simulates the reimbursement for an iHHG move with ISLH, IHPK, IHUPK, and CONUS portion of FSC +func (f *estimatePPM) calculateOCONUSIncentive(appCtx appcontext.AppContext, ppmShipmentID uuid.UUID, pickupAddress models.Address, destinationAddress models.Address, moveDate time.Time, weight int, isEstimated bool, isActual bool, isMax bool) (*unit.Cents, error) { + var mileage int + ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") // Tacoma, WA port + if err != nil { + return nil, fmt.Errorf("failed to fetch port location: %w", err) + } + + // check if addresses are OCONUS or CONUS -> this determines how we check mileage to/from the authorized port + isPickupOconus := pickupAddress.IsOconus != nil && *pickupAddress.IsOconus + isDestinationOconus := destinationAddress.IsOconus != nil && *destinationAddress.IsOconus + + switch { + case isPickupOconus && isDestinationOconus: + // OCONUS -> OCONUS, we only reimburse for the CONUS mileage of the PPM + mileage = 0 + case isPickupOconus && !isDestinationOconus: + // OCONUS -> CONUS (port ZIP -> address ZIP) + mileage, err = f.planner.ZipTransitDistance(appCtx, ppmPort.UsPostRegionCity.UsprZipID, destinationAddress.PostalCode, true, true) + if err != nil { + return nil, fmt.Errorf("failed to calculate OCONUS to CONUS mileage: %w", err) + } + case !isPickupOconus && isDestinationOconus: + // CONUS -> OCONUS (address ZIP -> port ZIP) + mileage, err = f.planner.ZipTransitDistance(appCtx, pickupAddress.PostalCode, ppmPort.UsPostRegionCity.UsprZipID, true, true) + if err != nil { + return nil, fmt.Errorf("failed to calculate CONUS to OCONUS mileage: %w", err) + } + default: + // covering down on CONUS -> CONUS moves - they should not appear here + return nil, fmt.Errorf("invalid pickup and destination configuration: pickup isOconus=%v, destination isOconus=%v", isPickupOconus, isDestinationOconus) + } + + incentive, err := models.CalculatePPMIncentive(appCtx.DB(), ppmShipmentID, pickupAddress.ID, destinationAddress.ID, moveDate, mileage, weight, isEstimated, isActual, isMax) + if err != nil { + return nil, fmt.Errorf("failed to calculate PPM incentive: %w", err) + } + + return (*unit.Cents)(&incentive), nil +} + func CalculateSITCost(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, error) { logger := appCtx.Logger() diff --git a/pkg/services/ppmshipment/ppm_shipment_updater.go b/pkg/services/ppmshipment/ppm_shipment_updater.go index f8cc99b8d30..c52936e9e9f 100644 --- a/pkg/services/ppmshipment/ppm_shipment_updater.go +++ b/pkg/services/ppmshipment/ppm_shipment_updater.go @@ -117,66 +117,6 @@ func (f *ppmShipmentUpdater) updatePPMShipment(appCtx appcontext.AppContext, ppm } transactionError := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error { - // This potentially updates the MTOShipment.Distance field so include it in the transaction - estimatedIncentive, estimatedSITCost, err := f.estimator.EstimateIncentiveWithDefaultChecks(appCtx, *oldPPMShipment, updatedPPMShipment) - if err != nil { - return err - } - - updatedPPMShipment.EstimatedIncentive = estimatedIncentive - updatedPPMShipment.SITEstimatedCost = estimatedSITCost - - // if the PPM shipment is past closeout then we should not calculate the max incentive, it is already set in stone - if oldPPMShipment.Status != models.PPMShipmentStatusWaitingOnCustomer && - oldPPMShipment.Status != models.PPMShipmentStatusCloseoutComplete && - oldPPMShipment.Status != models.PPMShipmentStatusComplete && - oldPPMShipment.Status != models.PPMShipmentStatusNeedsCloseout { - maxIncentive, err := f.estimator.MaxIncentive(appCtx, *oldPPMShipment, updatedPPMShipment) - if err != nil { - return err - } - updatedPPMShipment.MaxIncentive = maxIncentive - } - - if appCtx.Session() != nil { - if appCtx.Session().IsOfficeUser() { - edited := models.PPMAdvanceStatusEdited - if oldPPMShipment.HasRequestedAdvance != nil && updatedPPMShipment.HasRequestedAdvance != nil { - if !*oldPPMShipment.HasRequestedAdvance && *updatedPPMShipment.HasRequestedAdvance { - updatedPPMShipment.AdvanceStatus = &edited - } else if *oldPPMShipment.HasRequestedAdvance && !*updatedPPMShipment.HasRequestedAdvance { - updatedPPMShipment.AdvanceStatus = &edited - } - } - if oldPPMShipment.AdvanceAmountRequested != nil && updatedPPMShipment.AdvanceAmountRequested != nil { - if *oldPPMShipment.AdvanceAmountRequested != *updatedPPMShipment.AdvanceAmountRequested { - updatedPPMShipment.AdvanceStatus = &edited - } - } - } - if appCtx.Session().IsMilApp() { - if isPrimeCounseled && updatedPPMShipment.HasRequestedAdvance != nil { - received := models.PPMAdvanceStatusReceived - notReceived := models.PPMAdvanceStatusNotReceived - - if updatedPPMShipment.HasReceivedAdvance != nil && *updatedPPMShipment.HasRequestedAdvance { - if *updatedPPMShipment.HasReceivedAdvance { - updatedPPMShipment.AdvanceStatus = &received - } - if !*updatedPPMShipment.HasReceivedAdvance { - updatedPPMShipment.AdvanceStatus = ¬Received - } - } - } - } - } - - finalIncentive, err := f.estimator.FinalIncentiveWithDefaultChecks(appCtx, *oldPPMShipment, updatedPPMShipment) - if err != nil { - return err - } - updatedPPMShipment.FinalIncentive = finalIncentive - if updatedPPMShipment.W2Address != nil { var updatedAddress *models.Address var createOrUpdateErr error @@ -282,6 +222,69 @@ func (f *ppmShipmentUpdater) updatePPMShipment(appCtx appcontext.AppContext, ppm updatedPPMShipment.TertiaryDestinationAddress = updatedAddress } + // if the actual move date is being provided, we no longer need to calculate the estimate - it has already happened + if updatedPPMShipment.ActualMoveDate == nil { + estimatedIncentive, estimatedSITCost, err := f.estimator.EstimateIncentiveWithDefaultChecks(appCtx, *oldPPMShipment, updatedPPMShipment) + if err != nil { + return err + } + updatedPPMShipment.EstimatedIncentive = estimatedIncentive + updatedPPMShipment.SITEstimatedCost = estimatedSITCost + } + + // if the PPM shipment is past closeout then we should not calculate the max incentive, it is already set in stone + if oldPPMShipment.Status != models.PPMShipmentStatusWaitingOnCustomer && + oldPPMShipment.Status != models.PPMShipmentStatusCloseoutComplete && + oldPPMShipment.Status != models.PPMShipmentStatusComplete && + oldPPMShipment.Status != models.PPMShipmentStatusNeedsCloseout { + maxIncentive, err := f.estimator.MaxIncentive(appCtx, *oldPPMShipment, updatedPPMShipment) + if err != nil { + return err + } + updatedPPMShipment.MaxIncentive = maxIncentive + } + + if appCtx.Session() != nil { + if appCtx.Session().IsOfficeUser() { + edited := models.PPMAdvanceStatusEdited + if oldPPMShipment.HasRequestedAdvance != nil && updatedPPMShipment.HasRequestedAdvance != nil { + if !*oldPPMShipment.HasRequestedAdvance && *updatedPPMShipment.HasRequestedAdvance { + updatedPPMShipment.AdvanceStatus = &edited + } else if *oldPPMShipment.HasRequestedAdvance && !*updatedPPMShipment.HasRequestedAdvance { + updatedPPMShipment.AdvanceStatus = &edited + } + } + if oldPPMShipment.AdvanceAmountRequested != nil && updatedPPMShipment.AdvanceAmountRequested != nil { + if *oldPPMShipment.AdvanceAmountRequested != *updatedPPMShipment.AdvanceAmountRequested { + updatedPPMShipment.AdvanceStatus = &edited + } + } + } + if appCtx.Session().IsMilApp() { + if isPrimeCounseled && updatedPPMShipment.HasRequestedAdvance != nil { + received := models.PPMAdvanceStatusReceived + notReceived := models.PPMAdvanceStatusNotReceived + + if updatedPPMShipment.HasReceivedAdvance != nil && *updatedPPMShipment.HasRequestedAdvance { + if *updatedPPMShipment.HasReceivedAdvance { + updatedPPMShipment.AdvanceStatus = &received + } + if !*updatedPPMShipment.HasReceivedAdvance { + updatedPPMShipment.AdvanceStatus = ¬Received + } + } + } + } + } + + if updatedPPMShipment.ActualMoveDate != nil { + finalIncentive, err := f.estimator.FinalIncentiveWithDefaultChecks(appCtx, *oldPPMShipment, updatedPPMShipment) + if err != nil { + return err + } + updatedPPMShipment.FinalIncentive = finalIncentive + } + verrs, err := appCtx.DB().ValidateAndUpdate(updatedPPMShipment) if verrs != nil && verrs.HasAny() { return apperror.NewInvalidInputError(updatedPPMShipment.ID, err, verrs, "Invalid input found while updating the PPMShipments.") From 9e80db22af3ef444bf85c7f09aef4979b82a2f8d Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 15 Jan 2025 21:43:45 +0000 Subject: [PATCH 039/229] changin proc to return a table, working on closeout --- ...52_add_ppm_estimated_incentive_proc.up.sql | 46 ++++++++----------- .../internal/payloads/model_to_payload.go | 2 +- pkg/models/ppm_shipment.go | 25 +++++++--- pkg/services/ppm_closeout/ppm_closeout.go | 12 ++--- pkg/services/ppmshipment/ppm_estimator.go | 2 +- 5 files changed, 45 insertions(+), 42 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index ce8be73a674..47436e133a9 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -1,5 +1,3 @@ --- function that calculates a ppm incentive given mileage, weight, and dates --- this is used to calculate estimated, max, and actual incentives CREATE OR REPLACE FUNCTION calculate_ppm_incentive( ppm_id UUID, pickup_address_id UUID, @@ -10,16 +8,16 @@ CREATE OR REPLACE FUNCTION calculate_ppm_incentive( is_estimated BOOLEAN, is_actual BOOLEAN, is_max BOOLEAN -) RETURNS NUMERIC AS +) RETURNS TABLE ( + total_incentive NUMERIC, + price_islh NUMERIC, + price_ihpk NUMERIC, + price_ihupk NUMERIC, + price_fsc NUMERIC +) AS $$ DECLARE ppm RECORD; - escalated_price NUMERIC; - estimated_price_islh NUMERIC; - estimated_price_ihpk NUMERIC; - estimated_price_ihupk NUMERIC; - estimated_price_fsc NUMERIC; - total_incentive NUMERIC := 0; contract_id UUID; o_rate_area_id UUID; d_rate_area_id UUID; @@ -34,12 +32,8 @@ BEGIN RAISE EXCEPTION 'is_estimated, is_actual, and is_max cannot all be FALSE. No update will be performed.'; END IF; - -- validating it's a real PPM - SELECT ppms.id - INTO ppm - FROM ppm_shipments ppms - WHERE ppms.id = ppm_id; - + -- Validating it's a real PPM + SELECT ppms.id INTO ppm FROM ppm_shipments ppms WHERE ppms.id = ppm_id; IF ppm IS NULL THEN RAISE EXCEPTION 'PPM with ID % not found', ppm_id; END IF; @@ -61,7 +55,7 @@ BEGIN -- ISLH calculation SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'ISLH'; - estimated_price_islh := ROUND( + price_islh := ROUND( calculate_escalated_price( o_rate_area_id, d_rate_area_id, @@ -71,11 +65,10 @@ BEGIN move_date ) * (weight / 100)::NUMERIC * 100, 0 ); - RAISE NOTICE 'Estimated price for ISLH: % cents', estimated_price_islh; -- IHPK calculation SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHPK'; - estimated_price_ihpk := ROUND( + price_ihpk := ROUND( calculate_escalated_price( o_rate_area_id, NULL, @@ -85,11 +78,10 @@ BEGIN move_date ) * (weight / 100)::NUMERIC * 100, 0 ); - RAISE NOTICE 'Estimated price for IHPK: % cents', estimated_price_ihpk; -- IHUPK calculation SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHUPK'; - estimated_price_ihupk := ROUND( + price_ihupk := ROUND( calculate_escalated_price( NULL, d_rate_area_id, @@ -99,27 +91,25 @@ BEGIN move_date ) * (weight / 100)::NUMERIC * 100, 0 ); - RAISE NOTICE 'Estimated price for IHUPK: % cents', estimated_price_ihupk; -- FSC calculation estimated_fsc_multiplier := get_fsc_multiplier(weight); fuel_price := get_fuel_price(move_date); price_difference := calculate_price_difference(fuel_price); cents_above_baseline := mileage * estimated_fsc_multiplier; - estimated_price_fsc := ROUND((cents_above_baseline * price_difference) * 100); - RAISE NOTICE 'Estimated price for FSC: % cents', estimated_price_fsc; + price_fsc := ROUND((cents_above_baseline * price_difference) * 100); - -- total - total_incentive := estimated_price_islh + estimated_price_ihpk + estimated_price_ihupk + estimated_price_fsc; - RAISE NOTICE 'Total PPM Incentive: % cents', total_incentive; + -- Total incentive + total_incentive := price_islh + price_ihpk + price_ihupk + price_fsc; - -- now update the incentive value + -- Update the PPM incentive values UPDATE ppm_shipments SET estimated_incentive = CASE WHEN is_estimated THEN total_incentive ELSE estimated_incentive END, final_incentive = CASE WHEN is_actual THEN total_incentive ELSE final_incentive END, max_incentive = CASE WHEN is_max THEN total_incentive ELSE max_incentive END WHERE id = ppm_id; - RETURN total_incentive; + -- Return all values + RETURN QUERY SELECT total_incentive, price_islh, price_ihpk, price_ihupk, price_fsc; END; $$ LANGUAGE plpgsql; diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 08879e080a0..89a6290a7ff 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -1306,7 +1306,7 @@ func PPMCloseout(ppmCloseout *models.PPMCloseout) *ghcmessages.PPMCloseout { Gcc: handlers.FmtCost(ppmCloseout.GCC), Aoa: handlers.FmtCost(ppmCloseout.AOA), RemainingIncentive: handlers.FmtCost(ppmCloseout.RemainingIncentive), - HaulType: (*string)(&ppmCloseout.HaulType), + HaulType: (*string)(ppmCloseout.HaulType), HaulPrice: handlers.FmtCost(ppmCloseout.HaulPrice), HaulFSC: handlers.FmtCost(ppmCloseout.HaulFSC), Dop: handlers.FmtCost(ppmCloseout.DOP), diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index fab8720e125..7989b973119 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -35,11 +35,15 @@ type PPMCloseout struct { RemainingIncentive *unit.Cents HaulPrice *unit.Cents HaulFSC *unit.Cents - HaulType HaulType + HaulType *HaulType DOP *unit.Cents DDP *unit.Cents PackPrice *unit.Cents UnpackPrice *unit.Cents + IHPKPrice *unit.Cents + IHUPKPrice *unit.Cents + ISLHPrice *unit.Cents + FSCPrice *unit.Cents SITReimbursement *unit.Cents } @@ -321,16 +325,25 @@ func FetchPPMShipmentByPPMShipmentID(db *pop.Connection, ppmShipmentID uuid.UUID return &ppmShipment, nil } +type PPMIncentive struct { + TotalIncentive int `db:"total_incentive"` + PriceISLH int `db:"price_islh"` + PriceIHPK int `db:"price_ihpk"` + PriceIHUPK int `db:"price_ihupk"` + PriceFSC int `db:"price_fsc"` +} + // a db stored proc that will handle updating the estimated_incentive value // this simulates pricing of a basic iHHG shipment with ISLH, IHPK, IHUPK, and the CONUS portion for a FSC -func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (int, error) { - var incentive int +func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (*PPMIncentive, error) { + var incentive PPMIncentive - err := db.RawQuery("SELECT calculate_ppm_incentive($1, $2, $3, $4, $5, $6, $7, $8, $9)", ppmID, pickupAddressID, destAddressID, moveDate, mileage, weight, isEstimated, isActual, isMax). + // Run the stored procedure and scan the results into the struct + err := db.RawQuery("SELECT * FROM calculate_ppm_incentive($1, $2, $3, $4, $5, $6, $7, $8, $9)", ppmID, pickupAddressID, destAddressID, moveDate, mileage, weight, isEstimated, isActual, isMax). First(&incentive) if err != nil { - return 0, fmt.Errorf("error calculating PPM incentive for PPM ID %s: %w", ppmID, err) + return nil, fmt.Errorf("error calculating PPM incentive for PPM ID %s: %w", ppmID, err) } - return incentive, nil + return &incentive, nil } diff --git a/pkg/services/ppm_closeout/ppm_closeout.go b/pkg/services/ppm_closeout/ppm_closeout.go index 925385d079b..9deab808a96 100644 --- a/pkg/services/ppm_closeout/ppm_closeout.go +++ b/pkg/services/ppm_closeout/ppm_closeout.go @@ -60,11 +60,6 @@ func (p *ppmCloseoutFetcher) GetPPMCloseout(appCtx appcontext.AppContext, ppmShi proGearWeightCustomer, proGearWeightSpouse := p.GetProGearWeights(*ppmShipment) - serviceItems, err := p.getServiceItemPrices(appCtx, *ppmShipment) - if err != nil { - return nil, err - } - var remainingIncentive unit.Cents // Most moves generated by `make db_dev_e2e_populate` skip the part that generates the FinalIncentive for the move, so just return 0. // Moves created through the UI shouldn't be able to skip this part @@ -96,6 +91,11 @@ func (p *ppmCloseoutFetcher) GetPPMCloseout(appCtx appcontext.AppContext, ppmShi fullWeightGCCShipment.ProGearWeight = &proGearCustomerMax fullWeightGCCShipment.SpouseProGearWeight = &proGearSpouseMax gcc, _ := p.calculateGCC(appCtx, *fullWeightGCCShipment, fullAllowableWeight) + + serviceItems, err := p.getServiceItemPrices(appCtx, *ppmShipment) + if err != nil { + return nil, err + } if serviceItems.storageReimbursementCosts != nil { gcc = gcc.AddCents(*serviceItems.storageReimbursementCosts) } @@ -114,7 +114,7 @@ func (p *ppmCloseoutFetcher) GetPPMCloseout(appCtx appcontext.AppContext, ppmShi ppmCloseoutObj.RemainingIncentive = &remainingIncentive ppmCloseoutObj.HaulPrice = serviceItems.haulPrice ppmCloseoutObj.HaulFSC = serviceItems.haulFSC - ppmCloseoutObj.HaulType = serviceItems.haulType + ppmCloseoutObj.HaulType = &serviceItems.haulType ppmCloseoutObj.DOP = serviceItems.dop ppmCloseoutObj.DDP = serviceItems.ddp ppmCloseoutObj.PackPrice = serviceItems.packPrice diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 971527632fc..81c76f99734 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -780,7 +780,7 @@ func (f *estimatePPM) calculateOCONUSIncentive(appCtx appcontext.AppContext, ppm return nil, fmt.Errorf("failed to calculate PPM incentive: %w", err) } - return (*unit.Cents)(&incentive), nil + return (*unit.Cents)(&incentive.TotalIncentive), nil } func CalculateSITCost(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, error) { From 4e79c09776780931ba7f2919806bf05ee2524ec1 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Tue, 7 Jan 2025 17:08:30 +0000 Subject: [PATCH 040/229] B-21934 --- migrations/app/migrations_manifest.txt | 2 + ...0106153750_admin_weight_restriction.up.sql | 2 + ...min_weight_restriction_convert_bool.up.sql | 4 + pkg/gen/ghcapi/embedded_spec.go | 28 + .../counseling_update_allowance_payload.go | 3 + pkg/gen/ghcmessages/entitlements.go | 4 + .../ghcmessages/update_allowance_payload.go | 3 + pkg/gen/primeapi/embedded_spec.go | 8 + pkg/gen/primemessages/entitlements.go | 4 + pkg/gen/primev2api/embedded_spec.go | 8 + pkg/gen/primev2messages/entitlements.go | 4 + pkg/gen/primev3api/embedded_spec.go | 8 + pkg/gen/primev3messages/entitlements.go | 4 + pkg/gen/supportapi/embedded_spec.go | 8 + pkg/gen/supportmessages/entitlement.go | 4 + .../internal/payloads/model_to_payload.go | 6 +- .../primeapi/payloads/model_to_payload.go | 1 + .../primeapiv2/payloads/model_to_payload.go | 1 + pkg/models/ghc_entitlements.go | 1 + pkg/services/order/order_updater.go | 8 + .../AllowancesDetailForm.jsx | 22 +- .../AllowancesDetailForm.test.jsx | 37 + .../Office/DefinitionLists/AllowancesList.jsx | 8 + .../MoveHistory/Database/BooleanFields.js | 1 + .../MoveHistory/Database/FieldMappings.js | 1 + .../Office/MoveAllowances/MoveAllowances.jsx | 4 + src/pages/Office/MoveDetails/MoveDetails.jsx | 1 + .../ServicesCounselingMoveAllowances.jsx | 4 + .../ServicesCounselingMoveDetails.jsx | 1 + .../definitions/prime/Entitlements.yaml | 3 + swagger-def/ghc.yaml | 3233 +++++++++-------- swagger-def/support.yaml | 3 + swagger/ghc.yaml | 15 + swagger/prime.yaml | 3 + swagger/prime_v2.yaml | 3 + swagger/prime_v3.yaml | 3 + swagger/support.yaml | 3 + 37 files changed, 1853 insertions(+), 1603 deletions(-) create mode 100644 migrations/app/schema/20250106153750_admin_weight_restriction.up.sql create mode 100644 migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 30c229b8c94..ef0d428cde8 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1070,5 +1070,7 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql +20250106153750_admin_weight_restriction.up.sql +20250106190758_admin_weight_restriction_convert_bool.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110214012_homesafeconnect_cert.up.sql diff --git a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql new file mode 100644 index 00000000000..a41fc9ee69d --- /dev/null +++ b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql @@ -0,0 +1,2 @@ +ALTER TABLE entitlements +ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; \ No newline at end of file diff --git a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql new file mode 100644 index 00000000000..f8f923c0ae7 --- /dev/null +++ b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql @@ -0,0 +1,4 @@ +ALTER TABLE entitlements + ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), + ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, + ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 807fcb73fa8..3559e4c6f90 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6999,6 +6999,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -8180,6 +8185,10 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -14062,6 +14071,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -24035,6 +24049,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -25220,6 +25239,10 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -31230,6 +31253,11 @@ func init() { "x-nullable": true, "example": true }, + "adminRestrictedWeightLocation": { + "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", + "type": "boolean", + "x-nullable": true + }, "agency": { "$ref": "#/definitions/Affiliation" }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index d6bed9fac0c..c1a0ce9f418 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -23,6 +23,9 @@ type CounselingUpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // Indicates if the customer is restricted to a specific location for their admin restricted weight. + AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` + // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 2ee15f3d03a..7699f3be0e3 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -23,6 +23,10 @@ type Entitlements struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index ee0d677c0e7..0a63d9b9fa9 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -23,6 +23,9 @@ type UpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` + // Indicates if the customer is restricted to a specific location for their admin restricted weight. + AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` + // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 78a49944297..caee0ddc444 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1735,6 +1735,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -6684,6 +6688,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index c51ada24273..a1e606a00aa 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 2d563e13644..d304034f5ae 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -971,6 +971,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -4607,6 +4611,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index e29d3f733e3..b39c4b64fd8 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index 147c3232d19..d2be9e57cfe 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1133,6 +1133,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -5479,6 +5483,10 @@ func init() { "Entitlements": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index 1e228c6350f..d642d70f69b 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlements type Entitlements struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 63314742252..389efc7385c 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1110,6 +1110,10 @@ func init() { "Entitlement": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -3977,6 +3981,10 @@ func init() { "Entitlement": { "type": "object", "properties": { + "adminRestrictedWeightLocation": { + "type": "boolean", + "example": false + }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 434ad8aeed3..4ae036d582c 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -19,6 +19,10 @@ import ( // swagger:model Entitlement type Entitlement struct { + // admin restricted weight location + // Example: false + AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` + // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 6bb39ec9fc0..e25d4ec8d26 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -716,6 +716,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { } requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) gunSafe := entitlement.GunSafe + adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation var accompaniedTour *bool if entitlement.AccompaniedTour != nil { accompaniedTour = models.BoolPointer(*entitlement.AccompaniedTour) @@ -749,8 +750,9 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { AccompaniedTour: accompaniedTour, UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - GunSafe: gunSafe, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + GunSafe: gunSafe, + AdminRestrictedWeightLocation: adminRestrictedWeightLocation, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index e4b759cd0e5..f3648ec9eab 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -245,6 +245,7 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, + AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 7f51632462e..dbd0e9792df 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -176,6 +176,7 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, + AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index f56c915ad19..d516d71eb0b 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -34,6 +34,7 @@ type Entitlement struct { OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` + AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` WeightRestriction *int `db:"weight_restriction"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 2d15739271b..464c12bec56 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -481,6 +481,10 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.GunSafe = *payload.GunSafe } + if payload.AdminRestrictedWeightLocation != nil { + order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } @@ -585,6 +589,10 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.GunSafe = *payload.GunSafe } + if payload.AdminRestrictedWeightLocation != nil { + order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 94d8bcc2dc3..edc345478ea 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,6 +20,8 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(false); + useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -164,8 +166,26 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab isDisabled={formIsDisabled} />
+
+ setIsAdminWeightLocationChecked(e.target.checked)} + /> + {isAdminWeightLocationChecked && ( + + )} +
-
Weight allowance
+
Standard Weight allowance
{formatWeight(entitlements.totalWeight)}
diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx index 503ab865df3..fcf825bd404 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.test.jsx @@ -159,3 +159,40 @@ describe('AllowancesDetailForm', () => { expect(screen.queryByLabelText(/Number of dependents of the age 12 or over/)).toBeInTheDocument(); }); }); +describe('AllowancesDetailForm additional tests', () => { + it('renders gun safe checkbox field', async () => { + render( + + + , + ); + + expect(await screen.findByTestId('gunSafeInput')).toBeInTheDocument(); + }); + + it('renders admin weight location section with conditional weight restriction field', async () => { + render( + + + , + ); + + const adminWeightCheckbox = await screen.findByTestId('adminWeightLocation'); + expect(adminWeightCheckbox).toBeInTheDocument(); + expect(screen.queryByTestId('weightRestrictionInput')).not.toBeInTheDocument(); + await act(async () => { + adminWeightCheckbox.click(); + }); + expect(screen.getByTestId('weightRestrictionInput')).toBeInTheDocument(); + }); + + it('displays the total weight allowance correctly', async () => { + render( + + + , + ); + + expect(await screen.findByTestId('weightAllowance')).toHaveTextContent('11,000'); + }); +}); diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 3d5c1e850cc..3e0cf3dd93d 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -104,6 +104,14 @@ const AllowancesList = ({ info, showVisualCues }) => {
Gun Safe
{info.gunSafe ? 'Authorized' : 'Unauthorized'}
+
+
Admin Restricted Weight Location
+
{info.adminRestrictedWeightLocation ? 'Yes' : 'No'}
+
+
+
Weight Restriction
+
-
+
); diff --git a/src/constants/MoveHistory/Database/BooleanFields.js b/src/constants/MoveHistory/Database/BooleanFields.js index 32a4cc5f7c7..c14cb67f56c 100644 --- a/src/constants/MoveHistory/Database/BooleanFields.js +++ b/src/constants/MoveHistory/Database/BooleanFields.js @@ -12,6 +12,7 @@ export default { missing_receipt: 'missing_receipt', organizational_clothing_and_individual_equipment: 'organizational_clothing_and_individual_equipment', gun_safe: 'gun_safe', + admin_restricted_weight_location: 'admin_restricted_weight_location', email_is_preferred: 'email_is_preferred', phone_is_preferred: 'phone_is_preferred', uses_external_vendor: 'uses_external_vendor', diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 5b9ece8b735..dcc57e3b540 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -39,6 +39,7 @@ export default { required_medical_equipment_weight: 'Required medical equipment', organizational_clothing_and_individual_equipment: 'OCIE', gun_safe: 'Gun Safe', + admin_restricted_weight_location: 'Admin restricted weight location', requested_pickup_date: 'Requested pickup date', grade: 'Pay grade', shipment_type: 'Shipment type', diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 9adf62bdc39..1412c39c972 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -98,6 +98,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -118,6 +119,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit: Number(storageInTransit), gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -133,6 +135,7 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -148,6 +151,7 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit: `${storageInTransit}`, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index 2032009100a..eb6fa438e30 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -430,6 +430,7 @@ const MoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, + adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 98a85147767..c954518334c 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -86,6 +86,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -106,6 +107,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: Number(storageInTransit), organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -121,6 +123,7 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, + adminRestrictedWeightLocation, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -136,6 +139,7 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, storageInTransit: `${storageInTransit}`, gunSafe, + adminRestrictedWeightLocation, organizationalClothingAndIndividualEquipment, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 7ab63c0a024..b3a0a1c809c 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -387,6 +387,7 @@ const ServicesCounselingMoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, + adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 5722870f9d7..8a95dccf41c 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -21,6 +21,9 @@ properties: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 9231fd5a8d4..8fa167501ab 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -1,4 +1,4 @@ -swagger: '2.0' +swagger: "2.0" info: contact: email: milmove-developers@caci.com @@ -6,7 +6,7 @@ info: $ref: info/ghc_description.md license: name: MIT - url: 'https://opensource.org/licenses/MIT' + url: "https://opensource.org/licenses/MIT" title: MilMove GHC API version: 0.0.1 basePath: /ghc/v1 @@ -15,7 +15,7 @@ schemes: tags: - name: queues - name: move - - $ref: 'tags/order.yaml' + - $ref: "tags/order.yaml" - name: moveTaskOrder - name: customer - name: mtoServiceItem @@ -31,7 +31,7 @@ tags: - name: paymentRequests - name: reServiceItems paths: - '/customer': + "/customer": post: summary: Creates a customer with Okta option description: Creates a customer with option to also create an Okta profile account based on the office user's input when completing the UI form and submitting. @@ -47,28 +47,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/CreateCustomerPayload' + $ref: "#/definitions/CreateCustomerPayload" responses: - '200': + "200": description: successfully created the customer schema: - $ref: '#/definitions/CreatedCustomer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/CreatedCustomer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /open/requested-office-users: post: consumes: @@ -92,19 +92,19 @@ paths: name: officeUser description: Office User information schema: - $ref: '#/definitions/OfficeUserCreate' + $ref: "#/definitions/OfficeUserCreate" responses: - '201': + "201": description: successfully requested the creation of provided office user schema: - $ref: '#/definitions/OfficeUser' - '422': + $ref: "#/definitions/OfficeUser" + "422": description: validation error schema: - $ref: '#/definitions/ValidationError' - '500': + $ref: "#/definitions/ValidationError" + "500": description: internal server error - '/customer/{customerID}': + "/customer/{customerID}": parameters: - description: ID of customer to use in: path @@ -117,20 +117,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved information on an individual customer schema: - $ref: '#/definitions/Customer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Customer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - customer description: Returns a given customer @@ -151,30 +151,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateCustomerPayload' + $ref: "#/definitions/UpdateCustomerPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Customer' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Customer" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.customer /customer/search: @@ -223,22 +223,30 @@ paths: sort: type: string x-nullable: true - enum: [customerName, edipi, emplid, branch, personalEmail, telephone] + enum: + [ + customerName, + edipi, + emplid, + branch, + personalEmail, + telephone, + ] order: type: string x-nullable: true enum: [asc, desc] description: field that results should be sorted by responses: - '200': + "200": description: Successfully returned all customers matching the criteria schema: - $ref: '#/definitions/SearchCustomersResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' - '/move/{locator}': + $ref: "#/definitions/SearchCustomersResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" + "/move/{locator}": parameters: - description: Code used to identify a move in the system in: path @@ -250,26 +258,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved the individual move schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns a given move for a unique alphanumeric locator string summary: Returns a given move operationId: getMove - '/move/{locator}/history': + "/move/{locator}/history": parameters: - description: Code used to identify a move in the system in: path @@ -289,26 +297,26 @@ paths: type: integer description: results per page responses: - '200': + "200": description: Successfully retrieved the individual move history schema: - $ref: '#/definitions/MoveHistoryResult' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MoveHistoryResult" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns the history for a given move for a unique alphanumeric locator string summary: Returns the history of an identified move operationId: getMoveHistory - '/moves/{moveID}/shipment-evaluation-reports-list': + "/moves/{moveID}/shipment-evaluation-reports-list": parameters: - description: Code used to identify a move in the system in: path @@ -320,26 +328,26 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the move's evaluation reports schema: - $ref: '#/definitions/EvaluationReportList' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReportList" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns shipment evaluation reports for the specified move that are visible to the current office user summary: Returns shipment evaluation reports for the specified move that are visible to the current office user operationId: getMoveShipmentEvaluationReportsList - '/moves/{moveID}/counseling-evaluation-reports-list': + "/moves/{moveID}/counseling-evaluation-reports-list": parameters: - description: Code used to identify a move in the system in: path @@ -351,26 +359,26 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the move's evaluation reports schema: - $ref: '#/definitions/EvaluationReportList' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReportList" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: Returns counseling evaluation reports for the specified move that are visible to the current office user summary: Returns counseling evaluation reports for the specified move that are visible to the current office user operationId: getMoveCounselingEvaluationReportsList - '/moves/{moveID}/cancel': + "/moves/{moveID}/cancel": parameters: - description: ID of the move in: path @@ -385,22 +393,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully canceled move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - move description: cancels a move @@ -408,7 +416,7 @@ paths: summary: Cancels a move x-permissions: - update.cancelMoveFlag - '/counseling/orders/{orderID}': + "/counseling/orders/{orderID}": parameters: - description: ID of order to update in: path @@ -431,27 +439,27 @@ paths: name: body required: true schema: - $ref: '#/definitions/CounselingUpdateOrderPayload' + $ref: "#/definitions/CounselingUpdateOrderPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/orders': + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/orders": post: summary: Creates an orders model for a logged-in user description: Creates an instance of orders tied to a service member, which allow for creation of a move and an entitlement. Orders are required before the creation of a move @@ -466,23 +474,23 @@ paths: - in: body name: createOrders schema: - $ref: '#/definitions/CreateOrders' + $ref: "#/definitions/CreateOrders" responses: - '200': + "200": description: created instance of orders schema: - $ref: '#/definitions/Order' - '400': + $ref: "#/definitions/Order" + "400": description: invalid request - '401': + "401": description: request requires user authentication - '403': + "403": description: user is not authorized - '422': - $ref: '#/responses/UnprocessableEntity' - '500': + "422": + $ref: "#/responses/UnprocessableEntity" + "500": description: internal server error - '/orders/{orderID}': + "/orders/{orderID}": parameters: - description: ID of order to use in: path @@ -505,30 +513,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateOrderPayload' + $ref: "#/definitions/UpdateOrderPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of orders schema: - $ref: '#/definitions/Order' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.orders get: @@ -536,26 +544,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved order schema: - $ref: '#/definitions/Order' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - order description: Gets an order operationId: getOrder summary: Gets an order by ID - '/orders/{orderID}/allowances': + "/orders/{orderID}/allowances": parameters: - description: ID of order to use in: path @@ -578,29 +586,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateAllowancePayload' + $ref: "#/definitions/UpdateAllowancePayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of allowance schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.allowances - '/orders/{orderID}/acknowledge-excess-weight-risk': + "/orders/{orderID}/acknowledge-excess-weight-risk": parameters: - description: ID of order to use in: path @@ -624,20 +632,20 @@ paths: type: string required: true responses: - '200': + "200": description: updated Move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.excessWeightRisk '/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk': @@ -680,7 +688,7 @@ paths: $ref: '#/responses/ServerError' x-permissions: - update.excessWeightRisk - '/orders/{orderID}/update-billable-weight': + "/orders/{orderID}/update-billable-weight": parameters: - description: ID of order to use in: path @@ -703,29 +711,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateBillableWeightPayload' + $ref: "#/definitions/UpdateBillableWeightPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated Order schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.billableWeight - '/orders/{orderID}/update-max-billable-weight/tio': + "/orders/{orderID}/update-max-billable-weight/tio": parameters: - description: ID of order to use in: path @@ -748,23 +756,23 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateMaxBillableWeightAsTIOPayload' - - $ref: 'parameters/ifMatch.yaml' + $ref: "#/definitions/UpdateMaxBillableWeightAsTIOPayload" + - $ref: "parameters/ifMatch.yaml" responses: - '200': + "200": description: updated Order schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.maxBillableWeight /orders/{orderID}/upload_amended_orders: @@ -789,23 +797,23 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error - '/counseling/orders/{orderID}/allowances': + "/counseling/orders/{orderID}/allowances": parameters: - description: ID of order to use in: path @@ -828,27 +836,27 @@ paths: name: body required: true schema: - $ref: '#/definitions/CounselingUpdateAllowancePayload' + $ref: "#/definitions/CounselingUpdateAllowancePayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated instance of allowance schema: - $ref: '#/definitions/Order' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move-task-orders/{moveTaskOrderID}': + $ref: "#/definitions/Order" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move-task-orders/{moveTaskOrderID}": parameters: - description: ID of move to use in: path @@ -860,26 +868,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved move task order schema: - $ref: '#/definitions/MoveTaskOrder' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MoveTaskOrder" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Gets a move operationId: getMoveTaskOrder summary: Gets a move by ID - '/move_task_orders/{moveTaskOrderID}/mto_service_items': + "/move_task_orders/{moveTaskOrderID}/mto_service_items": parameters: - description: ID of move for mto service item to use in: path @@ -892,22 +900,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: 'definitions/MTOServiceItems.yaml' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItems.yaml" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Gets all line items for a move operationId: listMTOServiceItems summary: Gets all line items for a move - '/mto-shipments': + "/mto-shipments": post: summary: createMTOShipment description: | @@ -934,21 +942,21 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateMTOShipment' + $ref: "#/definitions/CreateMTOShipment" responses: - '200': + "200": description: Successfully created a MTO shipment. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move_task_orders/{moveTaskOrderID}/mto_shipments': + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move_task_orders/{moveTaskOrderID}/mto_shipments": parameters: - description: ID of move task order for mto shipment to use in: path @@ -961,24 +969,24 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all mto shipments for a move task order schema: - $ref: '#/definitions/MTOShipments' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MTOShipments" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoShipment description: Gets all shipments for a move task order operationId: listMTOShipments summary: Gets all shipments for a move task order - '/shipments/{shipmentID}': + "/shipments/{shipmentID}": get: summary: fetches a shipment by ID description: fetches a shipment by ID @@ -995,20 +1003,20 @@ paths: format: uuid type: string responses: - '200': + "200": description: Successfully fetched the shipment schema: - $ref: '#/definitions/MTOShipment' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/MTOShipment" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" delete: summary: Soft deletes a shipment by ID description: Soft deletes a shipment by ID @@ -1025,21 +1033,21 @@ paths: format: uuid type: string responses: - '204': + "204": description: Successfully soft deleted the shipment - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}": patch: summary: updateMTOShipment description: | @@ -1093,27 +1101,27 @@ paths: - in: body name: body schema: - $ref: '#/definitions/UpdateShipment' + $ref: "#/definitions/UpdateShipment" responses: - '200': + "200": description: Successfully updated the specified MTO shipment. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/shipments/{shipmentID}/approve': + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/shipments/{shipmentID}/approve": parameters: - description: ID of the shipment in: path @@ -1132,22 +1140,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully approved the shipment schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Approves a shipment @@ -1155,7 +1163,7 @@ paths: summary: Approves a shipment x-permissions: - update.shipment - '/shipments/{shipmentID}/request-diversion': + "/shipments/{shipmentID}/request-diversion": parameters: - description: ID of the shipment in: path @@ -1177,24 +1185,24 @@ paths: name: body required: true schema: - $ref: '#/definitions/RequestDiversion' + $ref: "#/definitions/RequestDiversion" responses: - '200': + "200": description: Successfully requested the shipment diversion schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Requests a shipment diversion @@ -1202,7 +1210,7 @@ paths: summary: Requests a shipment diversion x-permissions: - create.shipmentDiversionRequest - '/shipments/{shipmentID}/approve-diversion': + "/shipments/{shipmentID}/approve-diversion": parameters: - description: ID of the shipment in: path @@ -1221,22 +1229,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully approved the shipment diversion schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.shipment tags: @@ -1244,7 +1252,7 @@ paths: description: Approves a shipment diversion operationId: approveShipmentDiversion summary: Approves a shipment diversion - '/shipments/{shipmentID}/reject': + "/shipments/{shipmentID}/reject": parameters: - description: ID of the shipment in: path @@ -1266,30 +1274,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/RejectShipment' + $ref: "#/definitions/RejectShipment" responses: - '200': + "200": description: Successfully rejected the shipment schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: rejects a shipment operationId: rejectShipment summary: rejects a shipment - '/shipments/{shipmentID}/request-cancellation': + "/shipments/{shipmentID}/request-cancellation": parameters: - description: ID of the shipment in: path @@ -1308,22 +1316,22 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully requested the shipment cancellation schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment description: Requests a shipment cancellation @@ -1331,7 +1339,7 @@ paths: summary: Requests a shipment cancellation x-permissions: - create.shipmentCancellation - '/shipments/{shipmentID}/request-reweigh': + "/shipments/{shipmentID}/request-reweigh": parameters: - description: ID of the shipment in: path @@ -1345,22 +1353,22 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully requested a reweigh of the shipment schema: - $ref: 'definitions/Reweigh.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Reweigh.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - reweigh @@ -1369,7 +1377,7 @@ paths: summary: Requests a shipment reweigh x-permissions: - create.reweighRequest - '/shipments/{shipmentID}/review-shipment-address-update': + "/shipments/{shipmentID}/review-shipment-address-update": parameters: - description: ID of the shipment in: path @@ -1403,29 +1411,30 @@ paths: - officeRemarks - status responses: - '200': + "200": description: Successfully requested a shipment address update schema: - $ref: 'definitions/ShipmentAddressUpdate.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/ShipmentAddressUpdate.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - description: This endpoint is used to approve a address update request. Office remarks are required. + description: + This endpoint is used to approve a address update request. Office remarks are required. Approving the address update will update the Destination Final Address of the associated service item operationId: reviewShipmentAddressUpdate summary: Allows TOO to review a shipment address update - '/shipments/{shipmentID}/sit-extensions': + "/shipments/{shipmentID}/sit-extensions": post: summary: Create an approved SIT Duration Update description: TOO can creates an already-approved SIT Duration Update on behalf of a customer @@ -1447,7 +1456,7 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateApprovedSITDurationUpdate' + $ref: "#/definitions/CreateApprovedSITDurationUpdate" required: true - in: header description: We want the shipment's eTag rather than the SIT Duration Update eTag as the SIT Duration Update is always associated with a shipment @@ -1455,23 +1464,23 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully created a SIT Extension. schema: - $ref: 'definitions/MTOShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.SITExtension - '/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve': + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/approve": parameters: - description: ID of the shipment in: path @@ -1495,29 +1504,29 @@ paths: name: body required: true schema: - $ref: '#/definitions/ApproveSITExtension' + $ref: "#/definitions/ApproveSITExtension" - in: header description: We want the shipment's eTag rather than the SIT extension eTag as the SIT extension is always associated with a shipment name: If-Match type: string required: true responses: - '200': + "200": description: Successfully approved a SIT extension schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - sitExtension @@ -1526,7 +1535,7 @@ paths: summary: Approves a SIT extension x-permissions: - update.SITExtension - '/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny': + "/shipments/{shipmentID}/sit-extensions/{sitExtensionID}/deny": parameters: - description: ID of the shipment in: path @@ -1550,28 +1559,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/DenySITExtension' + $ref: "#/definitions/DenySITExtension" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: Successfully denied a SIT extension schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - sitExtension @@ -1580,7 +1589,7 @@ paths: summary: Denies a SIT extension x-permissions: - update.SITExtension - '/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense': + "/shipments/{shipmentID}/sit-service-item/convert-to-customer-expense": parameters: - description: ID of the shipment in: path @@ -1598,28 +1607,28 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateSITServiceItemCustomerExpense' + $ref: "#/definitions/UpdateSITServiceItemCustomerExpense" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: Successfully converted to customer expense schema: - $ref: 'definitions/MTOShipment.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOShipment.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - shipment - mtoServiceItem @@ -1649,22 +1658,22 @@ paths: produces: - application/json responses: - '200': + "200": description: All PPM documents and associated uploads for the specified PPM shipment. schema: - $ref: 'definitions/PPMDocuments.yaml' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMDocuments.yaml" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/weight-ticket/{weightTicketId}: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/weightTicketId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/weightTicketId.yaml" patch: summary: Updates a weight ticket document description: | @@ -1678,35 +1687,35 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateWeightTicketPayload required: true schema: - $ref: '#/definitions/UpdateWeightTicket' + $ref: "#/definitions/UpdateWeightTicket" responses: - '200': + "200": description: returns an updated weight ticket object schema: - $ref: 'definitions/WeightTicket.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/WeightTicket.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/moving-expenses/{movingExpenseId}: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/movingExpenseId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/movingExpenseId.yaml" patch: summary: Updates the moving expense description: | @@ -1720,35 +1729,35 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateMovingExpense required: true schema: - $ref: '#/definitions/UpdateMovingExpense' + $ref: "#/definitions/UpdateMovingExpense" responses: - '200': + "200": description: returns an updated moving expense object schema: - $ref: 'definitions/MovingExpense.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId}: - parameters: - - $ref: 'parameters/ppmShipmentId.yaml' - - $ref: 'parameters/proGearWeightTicketId.yaml' + $ref: "definitions/MovingExpense.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + ? /ppm-shipments/{ppmShipmentId}/pro-gear-weight-tickets/{proGearWeightTicketId} + : parameters: + - $ref: "parameters/ppmShipmentId.yaml" + - $ref: "parameters/proGearWeightTicketId.yaml" patch: summary: Updates a pro-gear weight ticket description: | @@ -1762,31 +1771,31 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ifMatch.yaml' + - $ref: "parameters/ifMatch.yaml" - in: body name: updateProGearWeightTicket required: true schema: - $ref: '#/definitions/UpdateProGearWeightTicket' + $ref: "#/definitions/UpdateProGearWeightTicket" responses: - '200': + "200": description: returns an updated pro-gear weight ticket object schema: - $ref: 'definitions/ProGearWeightTicket.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/ProGearWeightTicket.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/aoa-packet: parameters: - description: the id for the ppmshipment with aoa to be downloaded @@ -1808,7 +1817,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -1817,19 +1826,19 @@ paths: schema: format: binary type: file - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/finish-document-review: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" patch: summary: Updates a PPM shipment's status after document review description: | @@ -1847,26 +1856,26 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully finished document review schema: - $ref: 'definitions/PPMShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.shipment /ppm-shipments/{ppmShipmentId}/ppm-sit: @@ -1882,7 +1891,7 @@ paths: produces: - application/json parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" - in: header name: If-Match type: string @@ -1890,27 +1899,27 @@ paths: - in: body name: body schema: - $ref: 'definitions/PPMShipmentSIT.yaml' + $ref: "definitions/PPMShipmentSIT.yaml" responses: - '200': + "200": description: Successfully finished PPM SIT update schema: - $ref: 'definitions/PPMShipment.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMShipment.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/closeout: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" get: summary: Get the closeout calcuations for the specified PPM shipment description: | @@ -1921,23 +1930,23 @@ paths: produces: - application/json responses: - '200': + "200": description: Returns closeout for the specified PPM shipment. schema: - $ref: 'definitions/PPMCloseout.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMCloseout.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/actual-weight: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" get: summary: Get the actual weight for a PPM shipment description: | @@ -1948,23 +1957,23 @@ paths: produces: - application/json responses: - '200': + "200": description: Returns actual weight for the specified PPM shipment. schema: - $ref: 'definitions/PPMActualWeight.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMActualWeight.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/sit_location/{sitLocation}/sit-estimated-cost: parameters: - - $ref: 'parameters/ppmShipmentId.yaml' + - $ref: "parameters/ppmShipmentId.yaml" - in: path format: string description: location of sit @@ -2002,20 +2011,20 @@ paths: produces: - application/json responses: - '200': + "200": description: Calculates and returns the SIT estimated cost for the specified PPM shipment. schema: - $ref: 'definitions/PPMSITEstimatedCost.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/PPMSITEstimatedCost.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /ppm-shipments/{ppmShipmentId}/payment-packet: get: summary: Returns PPM payment packet @@ -2033,7 +2042,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -2042,17 +2051,17 @@ paths: schema: format: binary type: file - '400': + "400": description: invalid request - '401': + "401": description: request requires user authentication - '403': + "403": description: user is not authorized - '404': + "404": description: ppm not found - '500': + "500": description: internal server error - '/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents': + "/move_task_orders/{moveTaskOrderID}/mto_shipments/{shipmentID}/mto-agents": parameters: - description: ID of move task order in: path @@ -2071,22 +2080,22 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all agents for a move task order schema: - $ref: 'definitions/MTOAgents.yaml' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOAgents.yaml" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoAgent description: Fetches a list of agents associated with a move task order. operationId: fetchMTOAgentList summary: Fetch move task order agents. - '/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}': + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}": parameters: - description: ID of move to use in: path @@ -2103,26 +2112,26 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved a line item for a move task order by ID schema: - $ref: 'definitions/MTOServiceItemSingle.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItemSingle.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Gets a line item by ID for a move by ID operationId: getMTOServiceItem summary: Gets a line item by ID for a move by ID - '/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status': + "/move-task-orders/{moveTaskOrderID}/service-items/{mtoServiceItemID}/status": parameters: - description: ID of move to use in: path @@ -2144,32 +2153,32 @@ paths: name: body required: true schema: - $ref: '#/definitions/PatchMTOServiceItemStatusPayload' + $ref: "#/definitions/PatchMTOServiceItemStatusPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: >- Successfully updated status for a line item for a move task order by ID schema: - $ref: 'definitions/MTOServiceItem.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItem.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Changes the status of a line item for a move by ID @@ -2177,7 +2186,7 @@ paths: summary: Change the status of a line item for a move by ID x-permissions: - update.MTOServiceItem - '/service-item/{mtoServiceItemID}/entry-date-update': + "/service-item/{mtoServiceItemID}/entry-date-update": parameters: - description: ID of the service item in: path @@ -2194,32 +2203,32 @@ paths: name: body required: true schema: - $ref: 'definitions/ServiceItemSitEntryDate.yaml' + $ref: "definitions/ServiceItemSitEntryDate.yaml" responses: - '200': + "200": description: Successfully updated SIT entry date schema: - $ref: 'definitions/MTOServiceItemSingle.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/MTOServiceItemSingle.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - mtoServiceItem description: Locates the service item in the database and updates the SIT entry date for the selected service item and returns the service item operationId: updateServiceItemSitEntryDate summary: Updates a service item's SIT entry date by ID - '/move-task-orders/{moveTaskOrderID}/status': + "/move-task-orders/{moveTaskOrderID}/status": patch: consumes: - application/json @@ -2238,29 +2247,29 @@ paths: - in: body name: serviceItemCodes schema: - $ref: '#/definitions/MTOApprovalServiceItemCodes' + $ref: "#/definitions/MTOApprovalServiceItemCodes" required: true responses: - '200': + "200": description: Successfully updated move task order status schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move task order status to make it available to prime @@ -2269,7 +2278,7 @@ paths: x-permissions: - update.move - create.serviceItem - '/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed': + "/move-task-orders/{moveTaskOrderID}/status/service-counseling-completed": patch: consumes: - application/json @@ -2286,33 +2295,33 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully updated move task order status schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) status to service counseling completed operationId: updateMTOStatusServiceCounselingCompleted summary: Changes move (move task order) status to service counseling completed - '/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status': - parameters: + ? "/move-task-orders/{moveTaskOrderID}/payment-service-items/{paymentServiceItemID}/status" + : parameters: - description: ID of move to use in: path name: moveTaskOrderID @@ -2333,32 +2342,32 @@ paths: name: body required: true schema: - $ref: '#/definitions/PaymentServiceItem' + $ref: "#/definitions/PaymentServiceItem" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: >- Successfully updated status for a line item for a move task order by ID schema: - $ref: '#/definitions/PaymentServiceItem' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentServiceItem" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentServiceItem description: Changes the status of a line item for a move by ID @@ -2366,7 +2375,7 @@ paths: summary: Change the status of a payment service item for a move by ID x-permissions: - update.paymentServiceItemStatus - '/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at': + "/move-task-orders/{moveTaskOrderID}/billable-weights-reviewed-at": patch: consumes: - application/json @@ -2383,31 +2392,31 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully updated move task order billableWeightsReviewedAt field schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) billableWeightsReviewedAt field to a timestamp operationId: updateMTOReviewedBillableWeightsAt - '/move-task-orders/{moveTaskOrderID}/tio-remarks': + "/move-task-orders/{moveTaskOrderID}/tio-remarks": patch: consumes: - application/json @@ -2427,33 +2436,33 @@ paths: name: body required: true schema: - $ref: '#/definitions/Move' + $ref: "#/definitions/Move" responses: - '200': + "200": description: Successfully updated move task order tioRemarks field schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - moveTaskOrder description: Changes move (move task order) billableWeightsReviewedAt field to a timestamp operationId: updateMoveTIORemarks - '/move-task-orders/{moveTaskOrderID}/entitlements': + "/move-task-orders/{moveTaskOrderID}/entitlements": parameters: - description: ID of move to use in: path @@ -2467,24 +2476,24 @@ paths: tags: - moveTaskOrder responses: - '200': + "200": description: Successfully retrieved entitlements schema: - $ref: '#/definitions/Entitlements' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Entitlements" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" description: Gets entitlements operationId: getEntitlements summary: Gets entitlements for a move by ID - '/payment-requests/{paymentRequestID}': + "/payment-requests/{paymentRequestID}": parameters: - description: UUID of payment request format: uuid @@ -2497,20 +2506,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: fetched instance of payment request schema: - $ref: '#/definitions/PaymentRequest' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequest" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Fetches an instance of a payment request by id @@ -2518,7 +2527,7 @@ paths: summary: Fetches a payment request by id x-permissions: - read.paymentRequest - '/moves/{locator}/closeout-office': + "/moves/{locator}/closeout-office": parameters: - description: move code to identify a move to update the PPM shipment's closeout office for Army and Air Force service members format: string @@ -2553,25 +2562,25 @@ paths: type: string required: true responses: - '200': + "200": description: Successfully set the closeout office for the move schema: - $ref: '#/definitions/Move' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/moves/{locator}/customer-support-remarks': + $ref: "#/definitions/Move" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/moves/{locator}/customer-support-remarks": parameters: - description: move code to identify a move for customer support remarks format: string @@ -2588,20 +2597,20 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateCustomerSupportRemark' + $ref: "#/definitions/CreateCustomerSupportRemark" responses: - '200': + "200": description: Successfully created customer support remark schema: - $ref: 'definitions/CustomerSupportRemark.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemark.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - customerSupportRemarks description: Creates a customer support remark for a move @@ -2612,24 +2621,24 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: 'definitions/CustomerSupportRemarks.yaml' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemarks.yaml" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - customerSupportRemarks description: Fetches customer support remarks for a move operationId: getCustomerSupportRemarksForMove summary: Fetches customer support remarks using the move code (locator). - '/customer-support-remarks/{customerSupportRemarkID}': + "/customer-support-remarks/{customerSupportRemarkID}": parameters: - in: path description: the customer support remark ID to be modified @@ -2652,22 +2661,22 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdateCustomerSupportRemarkPayload' + $ref: "#/definitions/UpdateCustomerSupportRemarkPayload" responses: - '200': + "200": description: Successfully updated customer support remark schema: - $ref: 'definitions/CustomerSupportRemark.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/CustomerSupportRemark.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" delete: summary: Soft deletes a customer support remark by ID description: Soft deletes a customer support remark by ID @@ -2677,21 +2686,21 @@ paths: produces: - application/json responses: - '204': + "204": description: Successfully soft deleted the shipment - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/moves/{locator}/evaluation-reports': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/moves/{locator}/evaluation-reports": parameters: - in: path name: locator @@ -2706,20 +2715,20 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateEvaluationReport' + $ref: "#/definitions/CreateEvaluationReport" responses: - '200': + "200": description: Successfully created evaluation report schema: - $ref: '#/definitions/EvaluationReport' - '400': - $ref: '#/responses/InvalidRequest' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReport" + "400": + $ref: "#/responses/InvalidRequest" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.evaluationReport tags: @@ -2727,7 +2736,7 @@ paths: description: Creates an evaluation report operationId: createEvaluationReport summary: Creates an evaluation report - '/evaluation-reports/{reportID}/download': + "/evaluation-reports/{reportID}/download": parameters: - in: path description: the evaluation report ID to be downloaded @@ -2744,7 +2753,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -2753,13 +2762,13 @@ paths: schema: format: binary type: file - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' - '/evaluation-reports/{reportID}': + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + "/evaluation-reports/{reportID}": parameters: - in: path description: the evaluation report ID to be modified @@ -2776,18 +2785,18 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully got the report schema: - $ref: '#/definitions/EvaluationReport' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/EvaluationReport" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" delete: summary: Deletes an evaluation report by ID description: Deletes an evaluation report by ID @@ -2799,20 +2808,20 @@ paths: produces: - application/json responses: - '204': + "204": description: Successfully deleted the report - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" put: summary: Saves an evaluation report as a draft description: Saves an evaluation report as a draft @@ -2829,7 +2838,7 @@ paths: - in: body name: body schema: - $ref: '#/definitions/EvaluationReport' + $ref: "#/definitions/EvaluationReport" - in: header name: If-Match type: string @@ -2838,23 +2847,23 @@ paths: Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. responses: - '204': + "204": description: Successfully saved the report - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' - '/evaluation-reports/{reportID}/submit': + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" + "/evaluation-reports/{reportID}/submit": parameters: - in: path description: the evaluation report ID to be modified @@ -2879,21 +2888,21 @@ paths: Optimistic locking is implemented via the `If-Match` header. If the ETag header does not match the value of the resource on the server, the server rejects the change with a `412 Precondition Failed` error. responses: - '204': + "204": description: Successfully submitted an evaluation report with the provided ID - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/evaluation-reports/{reportID}/appeal/add': + "/evaluation-reports/{reportID}/appeal/add": parameters: - in: path description: the evaluation report ID @@ -2915,23 +2924,23 @@ paths: - in: body name: body schema: - $ref: '#/definitions/CreateAppeal' + $ref: "#/definitions/CreateAppeal" responses: - '204': + "204": description: Successfully added an appeal to a serious incident - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/evaluation-reports/{reportID}/{reportViolationID}/appeal/add': + "/evaluation-reports/{reportID}/{reportViolationID}/appeal/add": parameters: - in: path description: the evaluation report ID @@ -2957,25 +2966,25 @@ paths: - application/json parameters: - in: body - name: body - schema: - $ref: '#/definitions/CreateAppeal' - responses: - '204': - description: Successfully added an appeal to a violation - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + name: body + schema: + $ref: "#/definitions/CreateAppeal" + responses: + "204": + description: Successfully added an appeal to a violation + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.evaluationReport - '/pws-violations': + "/pws-violations": get: summary: Fetch the possible PWS violations for an evaluation report description: Fetch the possible PWS violations for an evaluation report @@ -2985,19 +2994,19 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the PWS violations schema: - $ref: '#/definitions/PWSViolations' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' - '/report-violations/{reportID}': + $ref: "#/definitions/PWSViolations" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" + "/report-violations/{reportID}": parameters: - in: path description: the evaluation report ID that has associated violations @@ -3014,18 +3023,18 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully retrieved the report violations schema: - $ref: '#/definitions/ReportViolations' - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ReportViolations" + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" post: summary: Associate violations with an evaluation report description: >- @@ -3044,25 +3053,25 @@ paths: - in: body name: body schema: - $ref: '#/definitions/AssociateReportViolations' + $ref: "#/definitions/AssociateReportViolations" responses: - '204': + "204": description: Successfully saved the report violations - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '409': - $ref: '#/responses/Conflict' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "409": + $ref: "#/responses/Conflict" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - create.reportViolation - '/moves/{locator}/payment-requests': + "/moves/{locator}/payment-requests": parameters: - description: move code to identify a move for payment requests format: string @@ -3075,18 +3084,18 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved all line items for a move task order schema: - $ref: '#/definitions/PaymentRequests' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequests" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Fetches payment requests for a move @@ -3094,7 +3103,7 @@ paths: summary: Fetches payment requests using the move code (locator). x-permissions: - read.paymentRequest - '/moves/{moveID}/financial-review-flag': + "/moves/{moveID}/financial-review-flag": parameters: - description: ID of move to flag in: path @@ -3132,20 +3141,20 @@ paths: example: false type: boolean responses: - '200': + "200": description: updated Move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.financialReviewFlag /moves/{moveID}/uploadAdditionalDocuments: @@ -3170,25 +3179,25 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error x-permissions: - create.supportingDocuments - '/payment-requests/{paymentRequestID}/shipments-payment-sit-balance': + "/payment-requests/{paymentRequestID}/shipments-payment-sit-balance": parameters: - description: payment request ID of the payment request with SIT service items being reviewed name: paymentRequestID @@ -3201,18 +3210,18 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved shipments and their SIT days balance from all payment requests on the move schema: - $ref: '#/definitions/ShipmentsPaymentSITBalance' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ShipmentsPaymentSITBalance" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Returns all shipment payment request SIT usage to support partial SIT invoicing @@ -3220,7 +3229,7 @@ paths: summary: Returns all shipment payment request SIT usage to support partial SIT invoicing x-permissions: - read.shipmentsPaymentSITBalance - '/payment-requests/{paymentRequestID}/status': + "/payment-requests/{paymentRequestID}/status": patch: consumes: - application/json @@ -3237,30 +3246,30 @@ paths: name: body required: true schema: - $ref: '#/definitions/UpdatePaymentRequestStatusPayload' + $ref: "#/definitions/UpdatePaymentRequestStatusPayload" - in: header name: If-Match type: string required: true responses: - '200': + "200": description: updated payment request schema: - $ref: '#/definitions/PaymentRequest' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/PaymentRequest" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" tags: - paymentRequests description: Updates status of a payment request by id @@ -3268,7 +3277,7 @@ paths: summary: Updates status of a payment request by id x-permissions: - update.paymentRequest - '/payment-requests/{paymentRequestID}/bulkDownload': + "/payment-requests/{paymentRequestID}/bulkDownload": parameters: - description: the id for the payment-request with files to be downloaded in: path @@ -3285,7 +3294,7 @@ paths: produces: - application/pdf responses: - '200': + "200": headers: Content-Disposition: type: string @@ -3294,10 +3303,10 @@ paths: schema: format: binary type: file - '400': - $ref: '#/responses/InvalidRequest' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "500": + $ref: "#/responses/ServerError" /documents/{documentId}: get: summary: Returns a document @@ -3313,24 +3322,24 @@ paths: required: true description: UUID of the document to return responses: - '200': + "200": description: the requested document schema: - $ref: 'definitions/Document.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Document.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /documents: post: summary: Create a new document @@ -3343,17 +3352,17 @@ paths: name: documentPayload required: true schema: - $ref: '#/definitions/PostDocumentPayload' + $ref: "#/definitions/PostDocumentPayload" responses: - '201': + "201": description: created document schema: - $ref: 'definitions/Document.yaml' - '400': + $ref: "definitions/Document.yaml" + "400": description: invalid request - '403': - $ref: '#/responses/PermissionDenied' - '500': + "403": + $ref: "#/responses/PermissionDenied" + "500": description: server error /queues/counseling: get: @@ -3504,14 +3513,14 @@ paths: description: | Used to illustrate which user is assigned to this payment request. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueueMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueueMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/bulk-assignment: get: produces: @@ -3563,14 +3572,14 @@ paths: type: string description: Used to return an origins list for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/Locations' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Locations" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/prime-moves: get: summary: getPrimeMovesQueue @@ -3612,14 +3621,14 @@ paths: type: string description: order type responses: - '200': + "200": description: Successfully retrieved moves. A successful fetch might still return zero moves. schema: - $ref: '#/definitions/ListPrimeMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ListPrimeMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/moves: get: produces: @@ -3726,14 +3735,14 @@ paths: type: string description: filters using a counselingOffice name of the move responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueueMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueueMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /queues/payment-requests: get: produces: @@ -3748,7 +3757,20 @@ paths: - in: query name: sort type: string - enum: [customerName, locator, submittedAt, branch, status, edipi, emplid, age, originDutyLocation, assignedTo, counselingOffice] + enum: + [ + customerName, + locator, + submittedAt, + branch, + status, + edipi, + emplid, + age, + originDutyLocation, + assignedTo, + counselingOffice, + ] description: field that results should be sorted by - in: query name: order @@ -3822,14 +3844,14 @@ paths: description: | Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/QueuePaymentRequestsResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/QueuePaymentRequestsResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" /moves/search: post: produces: @@ -3934,15 +3956,15 @@ paths: enum: [asc, desc] description: field that results should be sorted by responses: - '200': + "200": description: Successfully returned all moves matching the criteria schema: - $ref: '#/definitions/SearchMovesResult' - '403': - $ref: '#/responses/PermissionDenied' - '500': - $ref: '#/responses/ServerError' - '/tac/valid': + $ref: "#/definitions/SearchMovesResult" + "403": + $ref: "#/responses/PermissionDenied" + "500": + $ref: "#/responses/ServerError" + "/tac/valid": get: summary: Validation of a TAC value description: Returns a boolean based on whether a tac value is valid or not @@ -3957,23 +3979,23 @@ paths: required: true description: The tac value to validate responses: - '200': + "200": description: Successfully retrieved validation status schema: - $ref: '#/definitions/TacValid' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TacValid" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /lines-of-accounting: post: - summary: 'Fetch line of accounting' + summary: "Fetch line of accounting" description: > Fetches a line of accounting based on provided service member affiliation, effective date, and Transportation Accounting Code (TAC). It uses these parameters to filter the correct Line of Accounting for the provided TAC. It does this by filtering @@ -3985,33 +4007,33 @@ paths: tags: - linesOfAccounting consumes: - - 'application/json' + - "application/json" produces: - - 'application/json' + - "application/json" parameters: - - in: 'body' - name: 'body' - description: 'Service member affiliation, effective date, and TAC code.' + - in: "body" + name: "body" + description: "Service member affiliation, effective date, and TAC code." required: true schema: - $ref: '#/definitions/FetchLineOfAccountingPayload' + $ref: "#/definitions/FetchLineOfAccountingPayload" responses: - '200': - description: 'Successfully retrieved line of accounting' - schema: - $ref: 'definitions/LineOfAccounting.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + "200": + description: "Successfully retrieved line of accounting" + schema: + $ref: "definitions/LineOfAccounting.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" /transportation-offices: get: produces: @@ -4029,20 +4051,20 @@ paths: minLength: 2 description: Search string for transportation offices responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/TransportationOffices' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TransportationOffices" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /open/transportation-offices: get: produces: @@ -4060,20 +4082,20 @@ paths: minLength: 2 description: Search string for transportation offices responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/TransportationOffices' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/TransportationOffices" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /transportation-offices/gblocs: get: produces: @@ -4084,20 +4106,20 @@ paths: tags: - transportationOffice responses: - '200': + "200": description: Successfully retrieved transportation offices schema: - $ref: '#/definitions/GBLOCs' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/GBLOCs" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /addresses/zip-city-lookup/{search}: get: summary: Returns city, state, postal code, and county associated with the specified full/partial postal code or city and state string @@ -4106,23 +4128,23 @@ paths: tags: - addresses parameters: - - in: path - name: search - type: string - required: true + - in: path + name: search + type: string + required: true responses: - '200': + "200": description: the requested list of city, state, county, and postal code matches schema: $ref: "#/definitions/VLocations" - '400': - $ref: '#/responses/InvalidRequest' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + "400": + $ref: "#/responses/InvalidRequest" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /uploads: post: summary: Create a new upload @@ -4147,19 +4169,19 @@ paths: description: The file to upload. required: true responses: - '201': + "201": description: created upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request - '403': + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error /re-service-items: get: @@ -4171,18 +4193,18 @@ paths: tags: - reServiceItems responses: - '200': + "200": description: Successfully retrieved all ReServiceItems. schema: - $ref: '#/definitions/ReServiceItems' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/ReServiceItems" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /uploads/{uploadID}: delete: summary: Deletes an upload @@ -4203,17 +4225,17 @@ paths: format: uuid description: ID of the order that the upload belongs to responses: - '204': + "204": description: deleted - '400': + "400": description: invalid request schema: - $ref: '#/definitions/InvalidRequestResponsePayload' - '403': + $ref: "#/definitions/InvalidRequestResponsePayload" + "403": description: not authorized - '404': + "404": description: not found - '500': + "500": description: server error /uploads/get/: get: @@ -4221,20 +4243,20 @@ paths: - application/json parameters: [] responses: - '200': + "200": description: Successfully retrieved upload schema: - $ref: 'definitions/Upload.yaml' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "definitions/Upload.yaml" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - uploads description: Gets an upload @@ -4269,19 +4291,19 @@ paths: minimum: 0 maximum: 3 responses: - '201': + "201": description: updated upload schema: - $ref: 'definitions/Upload.yaml' - '400': + $ref: "definitions/Upload.yaml" + "400": description: invalid request - '403': + "403": description: not authorized - '404': + "404": description: not found - '413': + "413": description: payload is too large - '500': + "500": description: server error /application_parameters/{parameterName}: get: @@ -4298,15 +4320,15 @@ paths: required: true description: Parameter Name responses: - '200': + "200": description: Application Parameters schema: - $ref: '#/definitions/ApplicationParameters' - '400': + $ref: "#/definitions/ApplicationParameters" + "400": description: invalid request - '401': + "401": description: request requires user authentication - '500': + "500": description: server error /calendar/{countryCode}/is-weekend-holiday/{date}: get: @@ -4333,18 +4355,18 @@ paths: type: string format: date responses: - '200': + "200": description: Successfully determine if given date is weekend and/or holiday for given country. schema: - $ref: '#/definitions/IsDateWeekendHolidayInfo' - '400': - $ref: '#/responses/InvalidRequest' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/IsDateWeekendHolidayInfo" + "400": + $ref: "#/responses/InvalidRequest" + "401": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" /moves/{moveID}/assignOfficeUser: parameters: - description: ID of the move @@ -4363,16 +4385,16 @@ paths: name: body required: true schema: - $ref: '#/definitions/AssignOfficeUserBody' + $ref: "#/definitions/AssignOfficeUserBody" responses: - '200': + "200": description: Successfully assigned office user to the move schema: - $ref: '#/definitions/Move' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "404": + $ref: "#/responses/NotFound" + "500": + $ref: "#/responses/ServerError" tags: - move description: assigns either a services counselor, task ordering officer, or task invoicing officer to the move @@ -4399,12 +4421,12 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully unassigned office user from the move schema: - $ref: '#/definitions/Move' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "500": + $ref: "#/responses/ServerError" tags: - move description: unassigns either a services counselor, task ordering officer, or task invoicing officer from the move @@ -4423,7 +4445,7 @@ paths: produces: - application/json responses: - '200': + "200": description: Successfully unlocked officer's move(s). schema: type: object @@ -4431,8 +4453,8 @@ paths: successMessage: type: string example: OK - '500': - $ref: '#/responses/ServerError' + "500": + $ref: "#/responses/ServerError" tags: - move description: >- @@ -4484,7 +4506,7 @@ definitions: - instance ValidationError: allOf: - - $ref: '#/definitions/ClientError' + - $ref: "#/definitions/ClientError" - type: object properties: invalid_fields: @@ -4576,17 +4598,17 @@ definitions: type: string format: uuid transportationOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" transportationOfficeAssignments: type: array items: - $ref: 'definitions/TransportationOfficeAssignment.yaml' + $ref: "definitions/TransportationOfficeAssignment.yaml" active: type: boolean roles: type: array items: - $ref: '#/definitions/Role' + $ref: "#/definitions/Role" edipi: type: string otherUniqueId: @@ -4634,18 +4656,18 @@ definitions: type: string format: uuid transportationOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" OfficeUserCreate: type: object properties: email: type: string - example: 'user@userdomain.com' + example: "user@userdomain.com" title: Email x-nullable: false edipi: type: string - example: '1234567890' + example: "1234567890" maxLength: 10 title: EDIPI x-nullable: true @@ -4675,12 +4697,12 @@ definitions: transportationOfficeId: type: string format: uuid - example: 'c56a4180-65aa-42ec-a945-5fd21dec0538' + example: "c56a4180-65aa-42ec-a945-5fd21dec0538" x-nullable: false roles: type: array items: - $ref: '#/definitions/OfficeUserRole' + $ref: "#/definitions/OfficeUserRole" x-nullable: false required: - firstName @@ -4694,12 +4716,12 @@ definitions: properties: name: type: string - example: 'Task Ordering Officer' + example: "Task Ordering Officer" x-nullable: true title: name roleType: type: string - example: 'task_ordering_officer' + example: "task_ordering_officer" x-nullable: true title: roleType Customer: @@ -4733,9 +4755,9 @@ definitions: example: David x-nullable: true current_address: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" backup_contact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" id: type: string format: uuid @@ -4758,7 +4780,7 @@ definitions: pattern: '^[2-9]\d{2}-\d{3}-\d{4}$|^$' x-nullable: true backupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" cacValidated: type: boolean x-nullable: true @@ -4795,9 +4817,9 @@ definitions: example: David x-nullable: true residentialAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" backupContact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" id: type: string format: uuid @@ -4823,7 +4845,7 @@ definitions: pattern: '^[2-9]\d{2}-\d{3}-\d{4}$' x-nullable: true backupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" cacValidated: type: boolean UpdateCustomerPayload: @@ -4855,9 +4877,9 @@ definitions: x-nullable: true current_address: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" backup_contact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" phoneIsPreferred: type: boolean emailIsPreferred: @@ -4869,22 +4891,22 @@ definitions: x-nullable: true backupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" cac_validated: type: boolean CreateCustomerPayload: type: object properties: affiliation: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" edipi: type: string - example: '1234567890' + example: "1234567890" maxLength: 10 x-nullable: false emplid: type: string - example: '9485155' + example: "9485155" maxLength: 7 x-nullable: true firstName: @@ -4922,12 +4944,12 @@ definitions: type: boolean residentialAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" backupContact: - $ref: '#/definitions/BackupContact' + $ref: "#/definitions/BackupContact" backupMailingAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" createOktaAccount: type: boolean cacUser: @@ -4936,7 +4958,7 @@ definitions: type: object properties: departmentIndicator: - $ref: 'definitions/DepartmentIndicator.yaml' + $ref: "definitions/DepartmentIndicator.yaml" effectiveDate: description: > The effective date for the Line Of Accounting (LOA) being fetched. Eg, the orders issue date or the Non-Temporary Storage (NTS) Move Task Order (MTO) approval date. @@ -4947,12 +4969,12 @@ definitions: users per customer request). type: string format: date - example: '2023-01-01' + example: "2023-01-01" tacCode: type: string minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" SearchCustomersResult: type: object properties: @@ -4963,11 +4985,11 @@ definitions: totalCount: type: integer searchCustomers: - $ref: '#/definitions/SearchCustomers' + $ref: "#/definitions/SearchCustomers" SearchCustomers: type: array items: - $ref: '#/definitions/SearchCustomer' + $ref: "#/definitions/SearchCustomer" SearchCustomer: type: object properties: @@ -5019,6 +5041,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -5174,22 +5199,22 @@ definitions: format: uuid x-nullable: true contractor: - $ref: '#/definitions/Contractor' + $ref: "#/definitions/Contractor" locator: type: string - example: '1K43AR' + example: "1K43AR" ordersId: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 orders: - $ref: '#/definitions/Order' + $ref: "#/definitions/Order" referenceId: example: 1001-3456 type: string x-nullable: true status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" excessUnaccompaniedBaggageWeightQualifiedAt: type: string format: date-time @@ -5226,7 +5251,7 @@ definitions: x-nullable: true readOnly: true closeoutOffice: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" closeoutOfficeId: type: string format: uuid @@ -5250,26 +5275,26 @@ definitions: eTag: type: string shipmentGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" lockedByOfficeUserID: type: string format: uuid x-nullable: true lockedByOfficeUser: - $ref: '#/definitions/LockedOfficeUser' + $ref: "#/definitions/LockedOfficeUser" x-nullable: true lockExpiresAt: type: string format: date-time x-nullable: true additionalDocuments: - $ref: 'definitions/Document.yaml' + $ref: "definitions/Document.yaml" SCAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" TOOAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" TIOAssignedUser: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" MoveHistory: properties: id: @@ -5279,11 +5304,11 @@ definitions: type: string historyRecords: description: A list of MoveAuditHistory's connected to the move. - $ref: '#/definitions/MoveAuditHistories' + $ref: "#/definitions/MoveAuditHistories" locator: description: move locator type: string - example: '1K43AR' + example: "1K43AR" referenceId: description: move referenceID example: 1001-3456 @@ -5305,11 +5330,11 @@ definitions: type: string historyRecords: description: A list of MoveAuditHistory's connected to the move. - $ref: '#/definitions/MoveAuditHistories' + $ref: "#/definitions/MoveAuditHistories" locator: description: move locator type: string - example: '1K43AR' + example: "1K43AR" referenceId: description: move referenceID example: 1001-3456 @@ -5318,7 +5343,7 @@ definitions: MoveAuditHistories: type: array items: - $ref: '#/definitions/MoveAuditHistory' + $ref: "#/definitions/MoveAuditHistory" MoveAuditHistory: properties: id: @@ -5415,7 +5440,7 @@ definitions: MoveAuditHistoryItems: type: array items: - $ref: '#/definitions/MoveAuditHistoryItem' + $ref: "#/definitions/MoveAuditHistoryItem" MoveAuditHistoryItem: properties: columnName: @@ -5492,10 +5517,10 @@ definitions: format: uuid type: string customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" moveCode: type: string - example: 'H2XFJF' + example: "H2XFJF" first_name: type: string example: John @@ -5505,19 +5530,19 @@ definitions: example: Doe readOnly: true grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" entitlement: - $ref: '#/definitions/Entitlements' + $ref: "#/definitions/Entitlements" destinationDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" destinationDutyLocationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" originDutyLocationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" moveTaskOrderID: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -5538,42 +5563,42 @@ definitions: order_number: type: string x-nullable: true - example: '030-00362' + example: "030-00362" order_type: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" order_type_detail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" x-nullable: true date_issued: type: string format: date - example: '2020-01-01' + example: "2020-01-01" report_by_date: type: string format: date - example: '2020-01-01' + example: "2020-01-01" department_indicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true tac: type: string title: TAC - example: 'F8J1' + example: "F8J1" x-nullable: true sac: type: string title: SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true ntsTac: type: string title: NTS TAC - example: 'F8J1' + example: "F8J1" x-nullable: true ntsSac: type: string title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true has_dependents: type: boolean @@ -5592,7 +5617,7 @@ definitions: naics: type: string orders_type: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" eTag: type: string type: object @@ -5611,7 +5636,7 @@ definitions: Locations: type: array items: - $ref: '#/definitions/Location' + $ref: "#/definitions/Location" OrderBody: type: object properties: @@ -5636,9 +5661,9 @@ definitions: format: date title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" hasDependents: type: boolean title: Are dependents included in your orders? @@ -5653,21 +5678,21 @@ definitions: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" tac: type: string title: TAC - example: 'F8J1' + example: "F8J1" x-nullable: true sac: type: string title: SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" x-nullable: true departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" originDutyLocationId: type: string format: uuid @@ -5702,25 +5727,25 @@ definitions: type: string description: The date and time that these orders were cut. format: date - example: '2018-04-26' + example: "2018-04-26" title: Orders date reportByDate: type: string description: Report By Date format: date - example: '2018-04-26' + example: "2018-04-26" title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" ordersNumber: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true originDutyLocationId: type: string @@ -5735,24 +5760,24 @@ definitions: title: HHG TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" x-nullable: true sac: title: HHG SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml ntsTac: title: NTS TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" $ref: definitions/NullableString.yaml ntsSac: title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" required: - issueDate - reportByDate @@ -5766,18 +5791,18 @@ definitions: type: string description: The date and time that these orders were cut. format: date - example: '2018-04-26' + example: "2018-04-26" title: Orders date reportByDate: type: string description: Report By Date format: date - example: '2018-04-26' + example: "2018-04-26" title: Report-by date ordersType: - $ref: 'definitions/OrdersType.yaml' + $ref: "definitions/OrdersType.yaml" ordersTypeDetail: - $ref: '#/definitions/OrdersTypeDetail' + $ref: "#/definitions/OrdersTypeDetail" originDutyLocationId: type: string format: uuid @@ -5790,37 +5815,37 @@ definitions: type: string title: Orders Number x-nullable: true - example: '030-00362' + example: "030-00362" tac: type: string title: HHG TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" x-nullable: true sac: title: HHG SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml ntsTac: title: NTS TAC minLength: 4 maxLength: 4 - example: 'F8J1' + example: "F8J1" $ref: definitions/NullableString.yaml ntsSac: title: NTS SAC - example: 'N002214CSW32Y9' + example: "N002214CSW32Y9" $ref: definitions/NullableString.yaml departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" x-nullable: true ordersAcknowledgement: description: Confirmation that the new amended orders were reviewed after previously approving the original orders type: boolean x-nullable: true grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" required: - issueDate - reportByDate @@ -5831,12 +5856,12 @@ definitions: type: object properties: grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" dependentsAuthorized: type: boolean x-nullable: true agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" proGearWeight: description: unit is in lbs example: 2000 @@ -5871,6 +5896,10 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: Indicates if the customer is restricted to a specific location for their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -5923,12 +5952,12 @@ definitions: type: object properties: grade: - $ref: '#/definitions/Grade' + $ref: "#/definitions/Grade" dependentsAuthorized: type: boolean x-nullable: true agency: - $ref: 'definitions/Affiliation.yaml' + $ref: "definitions/Affiliation.yaml" proGearWeight: minimum: 0 maximum: 2000 @@ -5963,6 +5992,10 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: Indicates if the customer is restricted to a specific location for their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -5998,7 +6031,7 @@ definitions: type: string locator: type: string - example: '1K43AR' + example: "1K43AR" referenceId: example: 1001-3456 type: string @@ -6018,9 +6051,9 @@ definitions: format: date-time type: string destinationAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" pickupAddress: - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" destinationDutyLocation: example: 1f2270c7-7166-40ae-981e-b200ebdf3054 format: uuid @@ -6030,7 +6063,7 @@ definitions: format: uuid type: string entitlements: - $ref: '#/definitions/Entitlements' + $ref: "#/definitions/Entitlements" requestedPickupDate: format: date type: string @@ -6043,12 +6076,12 @@ definitions: type: object MoveTaskOrders: items: - $ref: '#/definitions/MoveTaskOrder' + $ref: "#/definitions/MoveTaskOrder" type: array PaymentRequest: properties: proofOfServiceDocs: - $ref: '#/definitions/ProofOfServiceDocs' + $ref: "#/definitions/ProofOfServiceDocs" id: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -6058,7 +6091,7 @@ definitions: default: false type: boolean moveTaskOrder: - $ref: '#/definitions/Move' + $ref: "#/definitions/Move" moveTaskOrderID: example: c56a4180-65aa-42ec-a945-5fd21dec0538 format: uuid @@ -6068,9 +6101,9 @@ definitions: type: string x-nullable: true serviceItems: - $ref: '#/definitions/PaymentServiceItems' + $ref: "#/definitions/PaymentServiceItems" status: - $ref: '#/definitions/PaymentRequestStatus' + $ref: "#/definitions/PaymentRequestStatus" paymentRequestNumber: example: 1234-5678-1 readOnly: true @@ -6123,11 +6156,11 @@ definitions: type: object PaymentRequests: items: - $ref: '#/definitions/PaymentRequest' + $ref: "#/definitions/PaymentRequest" type: array PaymentServiceItems: items: - $ref: '#/definitions/PaymentServiceItem' + $ref: "#/definitions/PaymentServiceItem" type: array PaymentServiceItem: properties: @@ -6154,14 +6187,14 @@ definitions: example: Move management type: string mtoShipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" mtoShipmentID: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 x-nullable: true status: - $ref: 'definitions/PaymentServiceItemStatus.yaml' + $ref: "definitions/PaymentServiceItemStatus.yaml" priceCents: type: integer format: cents @@ -6176,7 +6209,7 @@ definitions: readOnly: true format: string paymentServiceItemParams: - $ref: 'definitions/PaymentServiceItemParams.yaml' + $ref: "definitions/PaymentServiceItemParams.yaml" eTag: type: string tppsInvoiceAmountPaidPerServiceItemMillicents: @@ -6186,10 +6219,10 @@ definitions: x-nullable: true type: object PaymentRequestStatus: - $ref: 'definitions/PaymentRequestStatus.yaml' + $ref: "definitions/PaymentRequestStatus.yaml" ProofOfServiceDocs: items: - $ref: '#/definitions/ProofOfServiceDoc' + $ref: "#/definitions/ProofOfServiceDoc" type: array ProofOfServiceDoc: properties: @@ -6197,11 +6230,11 @@ definitions: type: boolean uploads: items: - $ref: 'definitions/Upload.yaml' + $ref: "definitions/Upload.yaml" type: array ShipmentsPaymentSITBalance: items: - $ref: '#/definitions/ShipmentPaymentSITBalance' + $ref: "#/definitions/ShipmentPaymentSITBalance" type: array ShipmentPaymentSITBalance: properties: @@ -6241,7 +6274,7 @@ definitions: type: object properties: shipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" requestedPickupDate: format: date type: string @@ -6270,16 +6303,16 @@ definitions: x-nullable: true pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryDeliveryAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6290,10 +6323,10 @@ definitions: x-omitempty: false tertiaryDeliveryAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6311,14 +6344,14 @@ definitions: x-nullable: true x-omitempty: false destinationType: - $ref: 'definitions/DestinationType.yaml' + $ref: "definitions/DestinationType.yaml" agents: - $ref: 'definitions/MTOAgents.yaml' + $ref: "definitions/MTOAgents.yaml" x-nullable: true tacType: - $ref: 'definitions/LOATypeNullable.yaml' + $ref: "definitions/LOATypeNullable.yaml" sacType: - $ref: 'definitions/LOATypeNullable.yaml' + $ref: "definitions/LOATypeNullable.yaml" usesExternalVendor: type: boolean example: false @@ -6334,13 +6367,13 @@ definitions: x-nullable: true storageFacility: x-nullable: true - $ref: 'definitions/StorageFacility.yaml' + $ref: "definitions/StorageFacility.yaml" ppmShipment: - $ref: '#/definitions/UpdatePPMShipment' + $ref: "#/definitions/UpdatePPMShipment" boatShipment: - $ref: '#/definitions/UpdateBoatShipment' + $ref: "#/definitions/UpdateBoatShipment" mobileHomeShipment: - $ref: '#/definitions/UpdateMobileHomeShipment' + $ref: "#/definitions/UpdateMobileHomeShipment" UpdatePPMShipment: type: object properties: @@ -6356,34 +6389,34 @@ definitions: x-nullable: true pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" actualPickupPostalCode: description: > The actual postal code where the PPM shipment started. To be filled once the customer has moved the shipment. format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ x-nullable: true secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/PPMDestinationAddress.yaml' + - $ref: "definitions/PPMDestinationAddress.yaml" actualDestinationPostalCode: description: > The actual postal code where the PPM shipment ended. To be filled once the customer has moved the shipment. format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ x-nullable: true secondaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6394,10 +6427,10 @@ definitions: x-omitempty: false tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6408,13 +6441,13 @@ definitions: x-omitempty: false w2Address: x-nullable: true - $ref: 'definitions/Address.yaml' + $ref: "definitions/Address.yaml" sitExpected: type: boolean x-nullable: true sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedWeight: type: integer @@ -6472,7 +6505,7 @@ definitions: format: cents x-nullable: true advanceStatus: - $ref: 'definitions/PPMAdvanceStatus.yaml' + $ref: "definitions/PPMAdvanceStatus.yaml" x-nullable: true isActualExpenseReimbursement: description: Used for PPM shipments only. Denotes if this shipment uses the Actual Expense Reimbursement method. @@ -6566,7 +6599,7 @@ definitions: description: Indicates if the trailer that the customer used meets all the criteria to be claimable. type: boolean status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string @@ -6581,7 +6614,7 @@ definitions: type: object properties: movingExpenseType: - $ref: 'definitions/OmittableMovingExpenseType.yaml' + $ref: "definitions/OmittableMovingExpenseType.yaml" description: description: A brief description of the expense. type: string @@ -6599,7 +6632,7 @@ definitions: type: string format: date status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string @@ -6608,7 +6641,7 @@ definitions: type: integer sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedCost: description: The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. @@ -6636,13 +6669,13 @@ definitions: type: integer minimum: 0 status: - $ref: 'definitions/PPMDocumentStatus.yaml' + $ref: "definitions/PPMDocumentStatus.yaml" reason: description: The reason the services counselor has excluded or rejected the item. type: string MTOShipments: items: - $ref: 'definitions/MTOShipment.yaml' + $ref: "definitions/MTOShipment.yaml" type: array CreateMTOShipment: type: object @@ -6688,17 +6721,17 @@ definitions: example: handle with care x-nullable: true agents: - $ref: 'definitions/MTOAgents.yaml' + $ref: "definitions/MTOAgents.yaml" mtoServiceItems: - $ref: 'definitions/MTOServiceItems.yaml' + $ref: "definitions/MTOServiceItems.yaml" pickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6706,7 +6739,7 @@ definitions: secondaryPickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryDeliveryAddress: type: boolean x-nullable: true @@ -6714,7 +6747,7 @@ definitions: secondaryDeliveryAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryPickupAddress: type: boolean x-nullable: true @@ -6722,7 +6755,7 @@ definitions: tertiaryPickupAddress: description: The address where the movers should pick up this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasTertiaryDeliveryAddress: type: boolean x-nullable: true @@ -6730,18 +6763,18 @@ definitions: tertiaryDeliveryAddress: description: Where the movers should deliver this shipment. allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationType: - $ref: 'definitions/DestinationType.yaml' + $ref: "definitions/DestinationType.yaml" shipmentType: - $ref: 'definitions/MTOShipmentType.yaml' + $ref: "definitions/MTOShipmentType.yaml" tacType: allOf: - - $ref: 'definitions/LOAType.yaml' + - $ref: "definitions/LOAType.yaml" - x-nullable: true sacType: allOf: - - $ref: 'definitions/LOAType.yaml' + - $ref: "definitions/LOAType.yaml" - x-nullable: true usesExternalVendor: type: boolean @@ -6758,13 +6791,13 @@ definitions: x-formatting: weight storageFacility: x-nullable: true - $ref: 'definitions/StorageFacility.yaml' + $ref: "definitions/StorageFacility.yaml" mobileHomeShipment: - $ref: '#/definitions/CreateMobileHomeShipment' + $ref: "#/definitions/CreateMobileHomeShipment" ppmShipment: - $ref: '#/definitions/CreatePPMShipment' + $ref: "#/definitions/CreatePPMShipment" boatShipment: - $ref: '#/definitions/CreateBoatShipment' + $ref: "#/definitions/CreateBoatShipment" required: - moveTaskOrderID - shipmentType @@ -6778,22 +6811,22 @@ definitions: type: string pickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" secondaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryPickupAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" destinationAddress: allOf: - - $ref: 'definitions/PPMDestinationAddress.yaml' + - $ref: "definitions/PPMDestinationAddress.yaml" secondaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" tertiaryDestinationAddress: allOf: - - $ref: 'definitions/Address.yaml' + - $ref: "definitions/Address.yaml" hasSecondaryPickupAddress: type: boolean x-nullable: true @@ -6814,7 +6847,7 @@ definitions: type: boolean sitLocation: allOf: - - $ref: 'definitions/SITLocationType.yaml' + - $ref: "definitions/SITLocationType.yaml" - x-nullable: true sitEstimatedWeight: type: integer @@ -6947,7 +6980,7 @@ definitions: minimum: 1 requestReason: description: Reason from service counselor-provided picklist for SIT Duration Update - example: 'AWAITING_COMPLETION_OF_RESIDENCE' + example: "AWAITING_COMPLETION_OF_RESIDENCE" type: string enum: - SERIOUS_ILLNESS_MEMBER @@ -6994,7 +7027,7 @@ definitions: properties: requestReason: description: Reason from service counselor-provided picklist for SIT Duration Update - example: 'AWAITING_COMPLETION_OF_RESIDENCE' + example: "AWAITING_COMPLETION_OF_RESIDENCE" type: string enum: - SERIOUS_ILLNESS_MEMBER @@ -7055,7 +7088,7 @@ definitions: type: string x-nullable: true status: - $ref: '#/definitions/PaymentRequestStatus' + $ref: "#/definitions/PaymentRequestStatus" eTag: type: string type: object @@ -7070,7 +7103,7 @@ definitions: AvailableOfficeUsers: type: array items: - $ref: '#/definitions/AvailableOfficeUser' + $ref: "#/definitions/AvailableOfficeUser" AvailableOfficeUser: type: object properties: @@ -7096,7 +7129,7 @@ definitions: QueueMoves: type: array items: - $ref: '#/definitions/QueueMove' + $ref: "#/definitions/QueueMove" QueueMove: type: object properties: @@ -7104,9 +7137,9 @@ definitions: type: string format: uuid customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" locator: type: string submittedAt: @@ -7122,15 +7155,15 @@ definitions: type: string x-nullable: true departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" shipmentsCount: type: integer originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" destinationDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" ppmType: type: string enum: [FULL, PARTIAL] @@ -7150,14 +7183,14 @@ definitions: format: uuid x-nullable: true lockedByOfficeUser: - $ref: '#/definitions/LockedOfficeUser' + $ref: "#/definitions/LockedOfficeUser" x-nullable: true lockExpiresAt: type: string format: date-time x-nullable: true ppmStatus: - $ref: '#/definitions/PPMStatus' + $ref: "#/definitions/PPMStatus" x-nullable: true counselingOffice: type: string @@ -7167,10 +7200,10 @@ definitions: format: uuid x-nullable: true assignedTo: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" x-nullable: true availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' + $ref: "#/definitions/AvailableOfficeUsers" assignable: type: boolean QueueMovesResult: @@ -7183,7 +7216,7 @@ definitions: totalCount: type: integer queueMoves: - $ref: '#/definitions/QueueMoves' + $ref: "#/definitions/QueueMoves" ListPrimeMove: description: > An abbreviated definition for a move, without all the nested information (shipments, service items, etc). Used to @@ -7196,7 +7229,7 @@ definitions: type: string moveCode: type: string - example: 'HYXFJF' + example: "HYXFJF" readOnly: true createdAt: format: date-time @@ -7242,7 +7275,7 @@ definitions: ListPrimeMoves: type: array items: - $ref: '#/definitions/ListPrimeMove' + $ref: "#/definitions/ListPrimeMove" ListPrimeMovesResult: type: object properties: @@ -7253,7 +7286,7 @@ definitions: totalCount: type: integer queueMoves: - $ref: '#/definitions/ListPrimeMoves' + $ref: "#/definitions/ListPrimeMoves" QueuePaymentRequest: type: object properties: @@ -7264,9 +7297,9 @@ definitions: type: string format: uuid customer: - $ref: '#/definitions/Customer' + $ref: "#/definitions/Customer" status: - $ref: '#/definitions/QueuePaymentRequestStatus' + $ref: "#/definitions/QueuePaymentRequestStatus" age: type: number format: double @@ -7277,11 +7310,11 @@ definitions: locator: type: string departmentIndicator: - $ref: '#/definitions/DeptIndicator' + $ref: "#/definitions/DeptIndicator" originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" originDutyLocation: - $ref: 'definitions/DutyLocation.yaml' + $ref: "definitions/DutyLocation.yaml" orderType: type: string x-nullable: true @@ -7294,10 +7327,10 @@ definitions: format: date-time x-nullable: true assignedTo: - $ref: '#/definitions/AssignedOfficeUser' + $ref: "#/definitions/AssignedOfficeUser" x-nullable: true availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' + $ref: "#/definitions/AvailableOfficeUsers" assignable: type: boolean counselingOffice: @@ -7306,7 +7339,7 @@ definitions: QueuePaymentRequests: type: array items: - $ref: '#/definitions/QueuePaymentRequest' + $ref: "#/definitions/QueuePaymentRequest" QueuePaymentRequestsResult: type: object properties: @@ -7317,7 +7350,7 @@ definitions: totalCount: type: integer queuePaymentRequests: - $ref: '#/definitions/QueuePaymentRequests' + $ref: "#/definitions/QueuePaymentRequests" QueuePaymentRequestStatus: enum: - Payment requested @@ -7329,7 +7362,7 @@ definitions: SearchMoves: type: array items: - $ref: '#/definitions/SearchMove' + $ref: "#/definitions/SearchMove" SearchMove: type: object properties: @@ -7353,7 +7386,7 @@ definitions: example: 9551-6199-2 x-nullable: true status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" locator: type: string branch: @@ -7364,13 +7397,13 @@ definitions: format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ destinationPostalCode: format: zip type: string title: ZIP - example: '90210' + example: "90210" pattern: ^(\d{5})$ requestedPickupDate: type: string @@ -7383,9 +7416,9 @@ definitions: format: date x-nullable: true originGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" destinationGBLOC: - $ref: '#/definitions/GBLOC' + $ref: "#/definitions/GBLOC" lockedByOfficeUserID: type: string format: uuid @@ -7407,7 +7440,7 @@ definitions: totalCount: type: integer searchMoves: - $ref: '#/definitions/SearchMoves' + $ref: "#/definitions/SearchMoves" GBLOC: type: string enum: @@ -7502,7 +7535,7 @@ definitions: EvaluationReportList: type: array items: - $ref: '#/definitions/EvaluationReport' + $ref: "#/definitions/EvaluationReport" EvaluationReport: type: object description: An evaluation report @@ -7524,28 +7557,28 @@ definitions: x-nullable: true readOnly: true type: - $ref: '#/definitions/EvaluationReportType' + $ref: "#/definitions/EvaluationReportType" inspectionType: - $ref: '#/definitions/EvaluationReportInspectionType' + $ref: "#/definitions/EvaluationReportInspectionType" x-nullable: true inspectionDate: type: string format: date x-nullable: true officeUser: - $ref: '#/definitions/EvaluationReportOfficeUser' + $ref: "#/definitions/EvaluationReportOfficeUser" location: - $ref: '#/definitions/EvaluationReportLocation' + $ref: "#/definitions/EvaluationReportLocation" x-nullable: true reportViolations: - $ref: '#/definitions/ReportViolations' + $ref: "#/definitions/ReportViolations" x-nullable: true gsrAppeals: - $ref: '#/definitions/GSRAppeals' + $ref: "#/definitions/GSRAppeals" x-nullable: true locationDescription: type: string - example: 'Route 66 at crash inspection site 3' + example: "Route 66 at crash inspection site 3" x-nullable: true observedShipmentDeliveryDate: type: string @@ -7558,18 +7591,18 @@ definitions: timeDepart: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '14:30' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "14:30" evalStart: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '15:00' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "15:00" evalEnd: type: string x-nullable: true - pattern: '^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$' - example: '18:00' + pattern: "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$" + example: "18:00" violationsObserved: type: boolean x-nullable: true @@ -7681,7 +7714,7 @@ definitions: PWSViolations: type: array items: - $ref: '#/definitions/PWSViolation' + $ref: "#/definitions/PWSViolation" AssociateReportViolations: type: object description: A list of PWS violation string ids to associate with an evaluation report @@ -7708,14 +7741,14 @@ definitions: format: uuid type: string violation: - $ref: '#/definitions/PWSViolation' + $ref: "#/definitions/PWSViolation" gsrAppeals: - $ref: '#/definitions/GSRAppeals' + $ref: "#/definitions/GSRAppeals" x-nullable: true ReportViolations: type: array items: - $ref: '#/definitions/ReportViolation' + $ref: "#/definitions/ReportViolation" GSRAppealStatusType: type: string enum: @@ -7724,7 +7757,7 @@ definitions: GSRAppeals: type: array items: - $ref: '#/definitions/GSRAppeal' + $ref: "#/definitions/GSRAppeal" GSRAppeal: type: object description: An object associating appeals on violations and serious incidents @@ -7746,12 +7779,12 @@ definitions: format: uuid type: string officeUser: - $ref: '#/definitions/EvaluationReportOfficeUser' + $ref: "#/definitions/EvaluationReportOfficeUser" isSeriousIncident: type: boolean example: false appealStatus: - $ref: '#/definitions/GSRAppealStatusType' + $ref: "#/definitions/GSRAppealStatusType" remarks: type: string example: Office user remarks @@ -7762,7 +7795,7 @@ definitions: TransportationOffices: type: array items: - $ref: 'definitions/TransportationOffice.yaml' + $ref: "definitions/TransportationOffice.yaml" VLocations: type: array items: @@ -7793,9 +7826,9 @@ definitions: readOnly: true locator: type: string - example: '12432' + example: "12432" status: - $ref: '#/definitions/MoveStatus' + $ref: "#/definitions/MoveStatus" created_at: type: string format: date-time @@ -7807,9 +7840,9 @@ definitions: format: date-time x-nullable: true mto_shipments: - $ref: '#/definitions/MTOShipments' + $ref: "#/definitions/MTOShipments" closeout_office: - $ref: '#/definitions/TransportationOffice' + $ref: "#/definitions/TransportationOffice" cancel_reason: type: string example: Change of orders @@ -7821,7 +7854,7 @@ definitions: type: string readOnly: true additionalDocuments: - $ref: 'definitions/Document.yaml' + $ref: "definitions/Document.yaml" required: - id - orders_id @@ -7839,7 +7872,7 @@ definitions: date: type: string format: date - example: '2018-09-25' + example: "2018-09-25" is_weekend: type: boolean is_holiday: @@ -7878,28 +7911,28 @@ responses: InvalidRequest: description: The request payload is invalid schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" NotFound: description: The requested resource wasn't found schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" Conflict: description: Conflict error schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" PermissionDenied: description: The request was denied schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" ServerError: description: A server error occurred schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" PreconditionFailed: description: Precondition failed schema: - $ref: '#/definitions/Error' + $ref: "#/definitions/Error" UnprocessableEntity: description: The payload was unprocessable. schema: - $ref: '#/definitions/ValidationError' + $ref: "#/definitions/ValidationError" diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 4b230febd84..da9538fbf08 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -878,6 +878,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 6aa00056580..8efca6d4943 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5244,6 +5244,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean @@ -6145,6 +6148,12 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: >- + Indicates if the customer is restricted to a specific location for + their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true @@ -6248,6 +6257,12 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true + adminRestrictedWeightLocation: + description: >- + Indicates if the customer is restricted to a specific location for + their admin restricted weight. + type: boolean + x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger/prime.yaml b/swagger/prime.yaml index b27503aba19..17ea62556d7 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3246,6 +3246,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index c482b1ea7e9..9b1b7ed6661 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1638,6 +1638,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index 5e6d3df8cf2..aba33ede4cb 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1745,6 +1745,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/support.yaml b/swagger/support.yaml index 26b02e68d32..6d8db5984d2 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -953,6 +953,9 @@ definitions: gunSafe: type: boolean example: false + adminRestrictedWeightLocation: + type: boolean + example: false nonTemporaryStorage: example: false type: boolean From 9254ad2477c915a3db5c4bf6364d88876ad03ef4 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 16 Jan 2025 21:26:46 +0000 Subject: [PATCH 041/229] fix office user selecting counseling office validation --- .../Office/AddOrdersForm/AddOrdersForm.jsx | 3 ++ .../AddOrdersForm/AddOrdersForm.test.jsx | 32 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index beecfa6373e..07d984952ce 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -54,6 +54,9 @@ const AddOrdersForm = ({ .required('Required'), hasDependents: Yup.mixed().oneOf(['yes', 'no']).required('Required'), originDutyLocation: Yup.object().nullable().required('Required'), + counselingOfficeId: currentDutyLocation.provides_services_counseling + ? Yup.string().required('Required') + : Yup.string().notRequired(), newDutyLocation: Yup.object().nullable().required('Required'), grade: Yup.mixed().oneOf(Object.keys(ORDERS_PAY_GRADE_OPTIONS)).required('Required'), accompaniedTour: showAccompaniedTourField diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index 18495b24036..c14c9bf1c21 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -286,4 +286,36 @@ describe('AddOrdersForm - With Counseling Office', () => { const nextBtn = screen.getByRole('button', { name: 'Next' }); expect(nextBtn.getAttribute('disabled')).toBeFalsy(); }); + + it('disabled submit if counseling office is required and blank', async () => { + isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); + render( + + + , + ); + + await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); + await userEvent.type(screen.getByLabelText(/Orders date/), '08 Nov 2024'); + await userEvent.type(screen.getByLabelText(/Report by date/), '26 Nov 2024'); + await userEvent.click(screen.getByLabelText('No')); + await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']); + + // Test Current Duty Location Search Box interaction + await userEvent.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 100 }); + const selectedOptionCurrent = await screen.findByText(/Scott/); + await userEvent.click(selectedOptionCurrent); + + // Test New Duty Location Search Box interaction + await userEvent.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 100 }); + const selectedOptionNew = await screen.findByText(/Luke/); + await userEvent.click(selectedOptionNew); + screen.getByLabelText(/New duty location/).blurElement(); + + const counselingOfficeLabel = await screen.queryByText(/Counseling office/); + expect(counselingOfficeLabel).toBeTruthy(); // If the field is visible then it it required + + const nextBtn = await screen.getByRole('button', { name: 'Next' }); + expect(nextBtn.getAttribute('disabled')).toBeTruthy(); + }); }); From 224a40bb96ba111893ff5a82314f956eaab0fe03 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 16 Jan 2025 22:23:09 +0000 Subject: [PATCH 042/229] fix AddOrdersForm test --- .../Office/AddOrdersForm/AddOrdersForm.test.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index c14c9bf1c21..d1169ac92fe 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -298,8 +298,6 @@ describe('AddOrdersForm - With Counseling Office', () => { await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); await userEvent.type(screen.getByLabelText(/Orders date/), '08 Nov 2024'); await userEvent.type(screen.getByLabelText(/Report by date/), '26 Nov 2024'); - await userEvent.click(screen.getByLabelText('No')); - await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']); // Test Current Duty Location Search Box interaction await userEvent.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 100 }); @@ -310,12 +308,14 @@ describe('AddOrdersForm - With Counseling Office', () => { await userEvent.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 100 }); const selectedOptionNew = await screen.findByText(/Luke/); await userEvent.click(selectedOptionNew); - screen.getByLabelText(/New duty location/).blurElement(); const counselingOfficeLabel = await screen.queryByText(/Counseling office/); expect(counselingOfficeLabel).toBeTruthy(); // If the field is visible then it it required - const nextBtn = await screen.getByRole('button', { name: 'Next' }); - expect(nextBtn.getAttribute('disabled')).toBeTruthy(); + await userEvent.selectOptions(screen.getByLabelText(/Pay grade/), ['E_5']); + await userEvent.click(screen.getByLabelText('No')); + + const nextBtn = await screen.getByRole('button', { name: 'Next' }, { delay: 100 }); + expect(nextBtn).toBeDisabled(); }); }); From cdbfd2a61b37162e738617282962df4f21edf03f Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 17 Jan 2025 16:55:35 +0000 Subject: [PATCH 043/229] Added rejection reason to payment service items on Payment Requests tab --- .../ExpandableServiceItemRow.jsx | 8 +++++- .../ExpandableServiceItemRow.module.scss | 26 +++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx index 585ef6b44d6..c7cce7d97dc 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx @@ -94,7 +94,7 @@ const ExpandableServiceItemRow = ({ {isExpanded && ( - + + {serviceItem.rejectionReason !== undefined && ( + +

Rejection Reason

+ {serviceItem.rejectionReason} + + )} )} diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index 49a76c0f3b9..9618bc240c1 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -72,4 +72,30 @@ &.expandedDetail td { padding: 0; } + + .rejectionReasonCol { + @include u-padding(2); + border: 1px solid $base-lighter; + border-radius: 3px; + background-color: $bg-gray; + } + + .title { + font-weight: bold; + margin-top: 0; + @include u-margin-bottom(2); + @include u-padding-top(2); + } + + td { + background-color: $bg-gray; + } + + td[colspan='2']:nth-of-type(2).rejectionReasonTd { + vertical-align: top; + text-align: start; + word-break: break-all; + padding-right: 2rem; + border-left: 1px solid #dfe1e2; + } } From 13764bce5d9cc989b4bd9b4bd3a3913d2a725ec1 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 17 Jan 2025 18:27:08 +0000 Subject: [PATCH 044/229] B-21934 --- pkg/gen/ghcapi/embedded_spec.go | 36 +++++++++++ .../counseling_update_allowance_payload.go | 4 ++ pkg/gen/ghcmessages/entitlements.go | 4 ++ .../ghcmessages/update_allowance_payload.go | 4 ++ pkg/gen/primeapi/embedded_spec.go | 12 ++++ pkg/gen/primemessages/entitlements.go | 4 ++ pkg/gen/primev2api/embedded_spec.go | 12 ++++ pkg/gen/primev2messages/entitlements.go | 4 ++ pkg/gen/primev3api/embedded_spec.go | 12 ++++ pkg/gen/primev3messages/entitlements.go | 4 ++ pkg/gen/supportapi/embedded_spec.go | 10 +++ pkg/gen/supportmessages/entitlement.go | 4 ++ .../internal/payloads/model_to_payload.go | 6 ++ pkg/handlers/ghcapi/orders.go | 3 + .../primeapi/payloads/model_to_payload.go | 13 ++-- pkg/services/order/order_updater.go | 11 +++- .../AllowancesDetailForm.jsx | 63 ++++++++++++++----- .../Office/DefinitionLists/AllowancesList.jsx | 6 +- .../MoveHistory/Database/FieldMappings.js | 1 + .../Office/MoveAllowances/MoveAllowances.jsx | 8 +++ src/pages/Office/MoveDetails/MoveDetails.jsx | 1 + .../ServicesCounselingMoveAllowances.jsx | 8 +++ .../ServicesCounselingMoveDetails.jsx | 1 + .../definitions/prime/Entitlements.yaml | 5 ++ swagger-def/ghc.yaml | 49 ++++++++++----- swagger-def/support.yaml | 4 ++ swagger/ghc.yaml | 17 +++++ swagger/prime.yaml | 5 ++ swagger/prime_v2.yaml | 5 ++ swagger/prime_v3.yaml | 5 ++ swagger/support.yaml | 4 ++ 31 files changed, 284 insertions(+), 41 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 3559e4c6f90..a07887043cc 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -7066,6 +7066,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "Indicates the weight restriction for a move to a particular location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -8272,6 +8278,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -14138,6 +14150,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "Indicates the weight restriction for the move to a particular location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -24120,6 +24138,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "Indicates the weight restriction for a move to a particular location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -25326,6 +25350,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -31324,6 +31354,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 500 + }, + "weightRestriction": { + "description": "Indicates the weight restriction for the move to a particular location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index c1a0ce9f418..19ef562126b 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -73,6 +73,10 @@ type CounselingUpdateAllowancePayload struct { // ub allowance // Example: 500 UbAllowance *int64 `json:"ubAllowance,omitempty"` + + // Indicates the weight restriction for a move to a particular location. + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this counseling update allowance payload diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 7699f3be0e3..6c8ccba8ac9 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -94,6 +94,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index 0a63d9b9fa9..7827dd166a8 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -73,6 +73,10 @@ type UpdateAllowancePayload struct { // ub allowance // Example: 500 UbAllowance *int64 `json:"ubAllowance,omitempty"` + + // Indicates the weight restriction for the move to a particular location. + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this update allowance payload diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index caee0ddc444..0d49f7de7ad 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1810,6 +1810,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -6763,6 +6769,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index a1e606a00aa..c34f9074441 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index d304034f5ae..875a19b3b00 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -1046,6 +1046,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -4686,6 +4692,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index b39c4b64fd8..8cf36f2525e 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index d2be9e57cfe..9ff0927a459 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1208,6 +1208,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, @@ -5558,6 +5564,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-formatting": "weight", + "x-nullable": true, + "example": 1500 } } }, diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index d642d70f69b..3e19bc830ef 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -83,6 +83,10 @@ type Entitlements struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlements diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 389efc7385c..0b50f60c92a 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1187,6 +1187,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -4058,6 +4063,11 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weightRestriction": { + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 4ae036d582c..25fcd62293e 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -85,6 +85,10 @@ type Entitlement struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UnaccompaniedBaggageAllowance *int64 `json:"unaccompaniedBaggageAllowance,omitempty"` + + // weight restriction + // Example: 1500 + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this entitlement diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index e25d4ec8d26..60e18900d46 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -733,6 +733,11 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { if entitlement.UBAllowance != nil { ubAllowance = models.Int64Pointer(int64(*entitlement.UBAllowance)) } + var weightRestriction *int64 + if entitlement.WeightRestriction != nil { + weightRestriction = models.Int64Pointer(int64(*entitlement.WeightRestriction)) + } + return &ghcmessages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -752,6 +757,7 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, GunSafe: gunSafe, AdminRestrictedWeightLocation: adminRestrictedWeightLocation, + WeightRestriction: weightRestriction, ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/ghcapi/orders.go b/pkg/handlers/ghcapi/orders.go index f6b559513a2..62193a76f73 100644 --- a/pkg/handlers/ghcapi/orders.go +++ b/pkg/handlers/ghcapi/orders.go @@ -265,6 +265,8 @@ func (h CreateOrderHandler) Handle(params orderop.CreateOrderParams) middleware. weightAllotment.UnaccompaniedBaggageAllowance = unaccompaniedBaggageAllowance } + var weightRestriction *int + entitlement := models.Entitlement{ DependentsAuthorized: payload.HasDependents, DBAuthorizedWeight: models.IntPointer(weight), @@ -275,6 +277,7 @@ func (h CreateOrderHandler) Handle(params orderop.CreateOrderParams) middleware. DependentsUnderTwelve: dependentsUnderTwelve, DependentsTwelveAndOver: dependentsTwelveAndOver, UBAllowance: &weightAllotment.UnaccompaniedBaggageAllowance, + WeightRestriction: weightRestriction, } if saveEntitlementErr := appCtx.DB().Save(&entitlement); saveEntitlementErr != nil { diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index f3648ec9eab..945af140137 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -239,6 +239,10 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + var weightRestriction int64 + if entitlement.WeightRestriction != nil { + weightRestriction = int64(*entitlement.WeightRestriction) + } return &primemessages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -252,10 +256,11 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: &weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 464c12bec56..e4630890d7c 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -485,6 +485,11 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation } + if payload.WeightRestriction != nil { + weightRestriction := int(*payload.WeightRestriction) + order.Entitlement.WeightRestriction = &weightRestriction + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } @@ -531,7 +536,6 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. return order, nil } - func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder models.Order, payload ghcmessages.CounselingUpdateAllowancePayload) (models.Order, error) { order := existingOrder waf := entitlements.NewWeightAllotmentFetcher() @@ -593,6 +597,11 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation } + if payload.WeightRestriction != nil { + weightRestriction := int(*payload.WeightRestriction) + order.Entitlement.WeightRestriction = &weightRestriction + } + if payload.AccompaniedTour != nil { order.Entitlement.AccompaniedTour = payload.AccompaniedTour } diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index edc345478ea..7ae7acffc64 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,8 +20,9 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); - const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(false); - + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState( + entitlements?.adminRestrictedWeightLocation || false, + ); useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -34,6 +35,29 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab checkUBFeatureFlag(); }, []); + useEffect(() => { + if (!isAdminWeightLocationChecked) { + // Find the weight restriction input and reset its value to 0 + const weightRestrictionInput = document.getElementById('weightRestrictionId'); + if (weightRestrictionInput) { + weightRestrictionInput.value = '0'; + } + } + }, [isAdminWeightLocationChecked]); + + const handleAdminWeightLocationChange = (e) => { + setIsAdminWeightLocationChecked(e.target.checked); + if (!e.target.checked) { + const weightRestrictionInput = document.querySelector('input[name="weightRestriction"]'); + if (weightRestrictionInput) { + weightRestrictionInput.value = '0'; + // Trigger change event to ensure form state is updated + const event = new Event('input', { bubbles: true }); + weightRestrictionInput.dispatchEvent(event); + } + } + }; + return (
{header &&

{header}

} @@ -148,6 +172,10 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab lazy={false} // immediate masking evaluation isDisabled={formIsDisabled} /> +
+
Standard Weight allowance
+
{formatWeight(entitlements.totalWeight)}
+
setIsAdminWeightLocationChecked(e.target.checked)} + onChange={handleAdminWeightLocationChange} /> - {isAdminWeightLocationChecked && ( - - )}
-
-
Standard Weight allowance
-
{formatWeight(entitlements.totalWeight)}
-
+ {isAdminWeightLocationChecked && ( + + )}
{ const visualCuesStyle = classNames(descriptionListStyles.row, { [`${descriptionListStyles.rowWithVisualCue}`]: showVisualCues, }); - useEffect(() => { const checkUBFeatureFlag = async () => { const enabled = await isBooleanFlagEnabled(FEATURE_FLAG_KEYS.UNACCOMPANIED_BAGGAGE); @@ -110,13 +109,14 @@ const AllowancesList = ({ info, showVisualCues }) => {
Weight Restriction
-
-
+
+ {info.weightRestriction ? formatWeight(info.weightRestriction) : DEFAULT_EMPTY_VALUE} +
); }; - AllowancesList.propTypes = { info: PropTypes.shape({ branch: PropTypes.string, diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index dcc57e3b540..d58472e4346 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -40,6 +40,7 @@ export default { organizational_clothing_and_individual_equipment: 'OCIE', gun_safe: 'Gun Safe', admin_restricted_weight_location: 'Admin restricted weight location', + weight_restriction: 'Weight restriction', requested_pickup_date: 'Requested pickup date', grade: 'Pay grade', shipment_type: 'Shipment type', diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 1412c39c972..18484e884bd 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -43,6 +43,10 @@ const validationSchema = Yup.object({ .min(0, 'Storage in transit (days) must be greater than or equal to 0') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), + weightRestriction: Yup.number() + .min(0, 'Weight restriction must be greater than or equal to 0') + .transform((value) => (Number.isNaN(value) ? 0 : value)) + .notRequired(), }); const MoveAllowances = () => { @@ -99,6 +103,7 @@ const MoveAllowances = () => { storageInTransit, gunSafe, adminRestrictedWeightLocation, + weightRestriction, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -120,6 +125,7 @@ const MoveAllowances = () => { storageInTransit: Number(storageInTransit), gunSafe, adminRestrictedWeightLocation, + weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -136,6 +142,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -152,6 +159,7 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction: `${weightRestriction}`, storageInTransit: `${storageInTransit}`, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index eb6fa438e30..fcf27b5b15c 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -431,6 +431,7 @@ const MoveDetails = ({ organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, + weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index c954518334c..4a0cbd3846d 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -41,6 +41,10 @@ const validationSchema = Yup.object({ .min(0, 'Storage in transit (days) must be greater than or equal to 0') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), + weightRestriction: Yup.number() + .min(0, 'Weight restriction must be greater than or equal to 0') + .transform((value) => (Number.isNaN(value) ? 0 : value)) + .notRequired(), }); const ServicesCounselingMoveAllowances = () => { @@ -87,6 +91,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit, gunSafe, adminRestrictedWeightLocation, + weightRestriction, accompaniedTour, dependentsTwelveAndOver, dependentsUnderTwelve, @@ -108,6 +113,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), dependentsUnderTwelve: Number(dependentsUnderTwelve), @@ -124,6 +130,7 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, gunSafe, adminRestrictedWeightLocation, + weightRestriction, storageInTransit, dependentsUnderTwelve, dependentsTwelveAndOver, @@ -140,6 +147,7 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: `${storageInTransit}`, gunSafe, adminRestrictedWeightLocation, + weightRestriction: `${weightRestriction}`, organizationalClothingAndIndividualEquipment, accompaniedTour, dependentsUnderTwelve: `${dependentsUnderTwelve}`, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index b3a0a1c809c..10322e78921 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -388,6 +388,7 @@ const ServicesCounselingMoveDetails = ({ organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, + weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, accompaniedTour: allowances.accompaniedTour, diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 8a95dccf41c..164841fc6e2 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -57,6 +57,11 @@ properties: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight + x-nullable: true eTag: type: string readOnly: true diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 8fa167501ab..91168e48ef1 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -648,7 +648,7 @@ paths: $ref: "#/responses/ServerError" x-permissions: - update.excessWeightRisk - '/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk': + "/orders/{orderID}/acknowledge-excess-unaccompanied-baggage-weight-risk": parameters: - description: ID of order to use in: path @@ -672,20 +672,20 @@ paths: type: string required: true responses: - '200': + "200": description: updated Move schema: - $ref: '#/definitions/Move' - '403': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '412': - $ref: '#/responses/PreconditionFailed' - '422': - $ref: '#/responses/UnprocessableEntity' - '500': - $ref: '#/responses/ServerError' + $ref: "#/definitions/Move" + "403": + $ref: "#/responses/PermissionDenied" + "404": + $ref: "#/responses/NotFound" + "412": + $ref: "#/responses/PreconditionFailed" + "422": + $ref: "#/responses/UnprocessableEntity" + "500": + $ref: "#/responses/ServerError" x-permissions: - update.excessWeightRisk "/orders/{orderID}/update-billable-weight": @@ -3542,7 +3542,7 @@ paths: - TASK_ORDER - PAYMENT_REQUEST responses: - '200': + "200": description: Successfully returned bulk assignment data schema: $ref: '#/definitions/BulkAssignmentData' @@ -5044,6 +5044,11 @@ definitions: adminRestrictedWeightLocation: type: boolean example: false + weightRestriction: + type: integer + example: 1500 + x-formatting: weight + x-nullable: true nonTemporaryStorage: example: false type: boolean @@ -5919,6 +5924,11 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + x-nullable: true + description: Indicates the weight restriction for the move to a particular location. UpdateBillableWeightPayload: type: object properties: @@ -6015,6 +6025,11 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + x-nullable: true + description: Indicates the weight restriction for a move to a particular location. MoveTaskOrder: description: The Move (MoveTaskOrder) properties: @@ -7095,7 +7110,7 @@ definitions: BulkAssignmentMoveIDs: type: array items: - $ref: '#/definitions/BulkAssignmentMoveID' + $ref: "#/definitions/BulkAssignmentMoveID" BulkAssignmentMoveID: type: string format: uuid @@ -7123,9 +7138,9 @@ definitions: type: object properties: availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' + $ref: "#/definitions/AvailableOfficeUsers" bulkAssignmentMoveIDs: - $ref: '#/definitions/BulkAssignmentMoveIDs' + $ref: "#/definitions/BulkAssignmentMoveIDs" QueueMoves: type: array items: diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index da9538fbf08..2eeb7cd3c68 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -881,6 +881,10 @@ definitions: adminRestrictedWeightLocation: type: boolean example: false + weightRestriction: + example: 1500 + type: integer + x-nullable: true nonTemporaryStorage: example: false type: boolean diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 8efca6d4943..df3c1822bc1 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5247,6 +5247,11 @@ definitions: adminRestrictedWeightLocation: type: boolean example: false + weightRestriction: + type: integer + example: 1500 + x-formatting: weight + x-nullable: true nonTemporaryStorage: example: false type: boolean @@ -6180,6 +6185,13 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + x-nullable: true + description: >- + Indicates the weight restriction for the move to a particular + location. UpdateBillableWeightPayload: type: object properties: @@ -6289,6 +6301,11 @@ definitions: example: 500 type: integer x-nullable: true + weightRestriction: + example: 1500 + type: integer + x-nullable: true + description: Indicates the weight restriction for a move to a particular location. MoveTaskOrder: description: The Move (MoveTaskOrder) properties: diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 17ea62556d7..3fe547b0721 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3282,6 +3282,11 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight + x-nullable: true eTag: type: string readOnly: true diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 9b1b7ed6661..c89f0f2794e 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1674,6 +1674,11 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight + x-nullable: true eTag: type: string readOnly: true diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index aba33ede4cb..741ebb467dd 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1781,6 +1781,11 @@ definitions: totalDependents: example: 2 type: integer + weightRestriction: + example: 1500 + type: integer + x-formatting: weight + x-nullable: true eTag: type: string readOnly: true diff --git a/swagger/support.yaml b/swagger/support.yaml index 6d8db5984d2..b4ea28ca93c 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -956,6 +956,10 @@ definitions: adminRestrictedWeightLocation: type: boolean example: false + weightRestriction: + example: 1500 + type: integer + x-nullable: true nonTemporaryStorage: example: false type: boolean From cbd33dcc967505e96cee3512310d7fa331cd9472 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 17 Jan 2025 19:06:21 +0000 Subject: [PATCH 045/229] CSS changes to rejection reason text, added unit tests. --- .../ExpandableServiceItemRow.jsx | 10 +- .../ExpandableServiceItemRow.module.scss | 25 ++ .../ExpandableServiceItemRow.test.jsx | 269 ++++++++++++++++++ 3 files changed, 301 insertions(+), 3 deletions(-) create mode 100644 src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx index c7cce7d97dc..0634e3aba65 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx @@ -103,10 +103,14 @@ const ExpandableServiceItemRow = ({ shipmentType={serviceItem.mtoShipmentType} /> - {serviceItem.rejectionReason !== undefined && ( + {serviceItem.rejectionReason && ( -

Rejection Reason

- {serviceItem.rejectionReason} +
+ +

Rejection Reason

+
+ {serviceItem.rejectionReason} +
)} diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index 9618bc240c1..9dface86063 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -84,6 +84,7 @@ font-weight: bold; margin-top: 0; @include u-margin-bottom(2); + @include u-padding-left(1); @include u-padding-top(2); } @@ -91,11 +92,35 @@ background-color: $bg-gray; } + .reasonText { + font-weight: normal; + } + td[colspan='2']:nth-of-type(2).rejectionReasonTd { vertical-align: top; text-align: start; word-break: break-all; padding-right: 2rem; + padding-left: 1rem; border-left: 1px solid #dfe1e2; } + + .rejectionReasonContainer { + display: flex; + flex-direction: row; + flex-wrap: wrap; + align-items: center; + + svg { + path { + fill: $error; + } + height: 1.4rem; + } + } + + .break { + flex-basis: 100%; + height: 0; + } } diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx new file mode 100644 index 00000000000..ee58ee1531a --- /dev/null +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx @@ -0,0 +1,269 @@ +import React from 'react'; +import { act, render, screen } from '@testing-library/react'; + +import ExpandableServiceItemRow from './ExpandableServiceItemRow'; + +const serviceItem = { + createdAt: '2025-01-09T22:08:38.788Z', + eTag: 'MjAyNS0wMS0xN1QxNTowODo0Mi44MDI4MDZa', + id: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + mtoServiceItemCode: 'DLH', + mtoServiceItemID: '526f705d-dba1-4bae-bf9a-e97cd1931bd4', + mtoServiceItemName: 'Domestic linehaul', + mtoShipmentID: 'ad5c56af-9e32-41bf-8283-a6a52938cc6a', + mtoShipmentType: 'HHG', + paymentServiceItemParams: [ + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDQ5Nlo=', + id: 'd3fba800-cc16-45e3-975d-3236884fbf8a', + key: 'WeightOriginal', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '2000', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDAyNjFa', + id: '19192fe0-3e0b-4d5d-98dd-ea834fe9062f', + key: 'ActualPickupDate', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-09', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MjcwNTZa', + id: 'e249d609-96fa-4533-90dc-12d3164aed41', + key: 'RequestedPickupDate', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-02', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NDc5NjVa', + id: '75fc3b3b-517d-4383-9d3e-1493bcd564d9', + key: 'DistanceZip', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1540', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NTk0MTZa', + id: '15edbab6-ba00-47e2-bc92-49c7b16f57e1', + key: 'ContractYearName', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: 'Award Term 1', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDIwMVo=', + id: '984fb8ea-da8a-4b3a-8560-85a9da1589ab', + key: 'ZipDestAddress', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '85309', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDk1MzNa', + id: '6d8b063b-8af4-4d6a-9ad4-5880a2d5fbea', + key: 'ReferenceDate', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-02', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MzY0MjJa', + id: '7941f3cf-7bcd-495e-9291-f2965291676c', + key: 'ServiceAreaOrigin', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '456', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjExODda', + id: '9a69db91-2d5d-4446-b1f6-0c15a140cf7a', + key: 'EscalationCompounded', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DECIMAL', + value: '1.10701', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjI5ODla', + id: '35ddc999-a546-4076-9a2e-5295e4ae4279', + key: 'IsPeak', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'BOOLEAN', + value: 'false', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjQ3ODNa', + id: 'd35e3639-6a43-4f6a-8bf0-5a82685b80c4', + key: 'PriceRateOrFactor', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DECIMAL', + value: '3.148', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44Mzg0MTRa', + id: '163babcf-7874-474e-a36d-f602fdca5c88', + key: 'ContractCode', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: 'TRUSS_TEST', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44Mjk2OTFa', + id: '3f677c1e-1302-4cc1-9333-6fa34f5bdab5', + key: 'WeightEstimated', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1500', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDc2NDNa', + id: '1009cca9-cdc1-4814-97e9-e0ef82dce965', + key: 'WeightBilled', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1650', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MzE2Nzha', + id: '66b571ee-4142-4576-b563-cc3c8ea04bfe', + key: 'ZipPickupAddress', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '62225', + }, + ], + priceCents: 8855385, + referenceID: '4131-9325-46e2df6f', + rejectionReason: 'Rejection reason test text', + status: 'DENIED', +}; + +const additionalServiceItemData = { + approvedAt: '2025-01-09T20:24:58.522Z', + convertToCustomerExpense: false, + createdAt: '2025-01-09T20:24:58.621Z', + deletedAt: '0001-01-01', + eTag: 'MjAyNS0wMS0wOVQyMDoyNDo1OC42MjE5NzRa', + id: '526f705d-dba1-4bae-bf9a-e97cd1931bd4', + moveTaskOrderID: 'b02c42d7-bd4f-48ff-a5f8-6e7332fa5d03', + mtoShipmentID: 'ad5c56af-9e32-41bf-8283-a6a52938cc6a', + reServiceCode: 'DLH', + reServiceID: '8d600f25-1def-422d-b159-617c7d59156e', + reServiceName: 'Domestic linehaul', + status: 'APPROVED', + submittedAt: '0001-01-01', + updatedAt: '0001-01-01T00:00:00.000Z', +}; + +describe('Payment service items', () => { + it('Displays rejected service item with rejection reason', async () => { + render( + , + ); + + expect(screen.getByText('Domestic linehaul')).toBeVisible(); + expect(screen.getByText('$88,553.85')).toBeVisible(); + expect(screen.getByText('Rejected')).toBeVisible(); + + // Expand service item row + await act(async () => { + screen.getByText('Domestic linehaul').click(); + }); + + // Test for rejection reason + expect(screen.getByText('Rejection Reason')).toBeVisible(); + expect(screen.getByText('Rejection reason test text')).toBeVisible(); + + // Test for calculations + expect(screen.getByText('Billable weight (cwt)')).toBeVisible(); + expect(screen.getByText('16.5 cwt')).toBeVisible(); + expect(screen.getByText('Original: 2,000 lbs')).toBeVisible(); + expect(screen.getByText('Estimated: 1,500 lbs')).toBeVisible(); + + expect(screen.getByText('Mileage')).toBeVisible(); + expect(screen.getByText('1,540')).toBeVisible(); + expect(screen.getByText('ZIP 62225 to ZIP 85309')).toBeVisible(); + + expect(screen.getByText('Baseline linehaul price')).toBeVisible(); + expect(screen.getByText('3.148')).toBeVisible(); + expect(screen.getByText('Domestic non-peak')).toBeVisible(); + expect(screen.getByText('Origin service area: 456')).toBeVisible(); + expect(screen.getByText('Requested pickup: 02 Jan 2025')).toBeVisible(); + + expect(screen.getByText('Price escalation factor')).toBeVisible(); + expect(screen.getByText('1.10701')).toBeVisible(); + expect(screen.getByText('Base year: Award Term 1')).toBeVisible(); + }); + + it('Displays accepted service item without displaying rejection reason markup', async () => { + serviceItem.status = 'APPROVED'; + serviceItem.rejectionReason = null; + render( + , + ); + + expect(screen.getByText('Domestic linehaul')).toBeVisible(); + expect(screen.getByText('$88,553.85')).toBeVisible(); + expect(screen.getByText('Accepted')).toBeVisible(); + + // Expand service item row + await act(async () => { + screen.getByText('Domestic linehaul').click(); + }); + + // Test for rejection reason + expect(screen.queryByText('Rejection Reason')).toBeNull(); + expect(screen.queryByText('Rejection reason test text')).toBeNull(); + + // Test for calculations + expect(screen.getByText('Billable weight (cwt)')).toBeVisible(); + expect(screen.getByText('16.5 cwt')).toBeVisible(); + expect(screen.getByText('Original: 2,000 lbs')).toBeVisible(); + expect(screen.getByText('Estimated: 1,500 lbs')).toBeVisible(); + + expect(screen.getByText('Mileage')).toBeVisible(); + expect(screen.getByText('1,540')).toBeVisible(); + expect(screen.getByText('ZIP 62225 to ZIP 85309')).toBeVisible(); + + expect(screen.getByText('Baseline linehaul price')).toBeVisible(); + expect(screen.getByText('3.148')).toBeVisible(); + expect(screen.getByText('Domestic non-peak')).toBeVisible(); + expect(screen.getByText('Origin service area: 456')).toBeVisible(); + expect(screen.getByText('Requested pickup: 02 Jan 2025')).toBeVisible(); + + expect(screen.getByText('Price escalation factor')).toBeVisible(); + expect(screen.getByText('1.10701')).toBeVisible(); + expect(screen.getByText('Base year: Award Term 1')).toBeVisible(); + }); +}); From cb4cfaa7bd3060e986d1629d87b174915586d0f4 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 17 Jan 2025 19:28:44 +0000 Subject: [PATCH 046/229] consistent required hints on AddOrdersForm.jsx --- .../Office/AddOrdersForm/AddOrdersForm.jsx | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index 07d984952ce..147d45626cc 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -154,9 +154,10 @@ const AddOrdersForm = ({ options={ordersTypeOptions} required isDisabled={isSafetyMoveSelected || isBluebarkMoveSelected} + hint="Required" /> - - + + {currentDutyLocation.provides_services_counseling && (
@@ -217,6 +219,7 @@ const AddOrdersForm = ({ displayAddress={false} placeholder="Enter a city or ZIP" metaOverride={newDutyMeta} + hint="Required" onDutyLocationChange={(e) => { setNewDutyLocation(e); }} @@ -227,6 +230,7 @@ const AddOrdersForm = ({ name="newDutyLocation" label="New duty location" required + hint="Required" metaOverride={newDutyMeta} onDutyLocationChange={(e) => { setNewDutyLocation(e); @@ -235,7 +239,7 @@ const AddOrdersForm = ({ )} - +
- +
)} - +
From cf53cfaaf675816c3e810dfd07c86caeb09a8412 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 17 Jan 2025 20:13:52 +0000 Subject: [PATCH 047/229] test fixes for 21977 --- .../AddOrdersForm/AddOrdersForm.test.jsx | 30 ++++++++-------- .../ServicesCounselingAddOrders.test.jsx | 36 +++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index d1169ac92fe..81da5f5baf3 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -149,15 +149,15 @@ describe('CreateMoveCustomerInfo Component', () => { await waitFor(() => { expect(screen.getByText('Tell us about the orders')).toBeInTheDocument(); - expect(screen.getByLabelText('Orders type')).toBeInTheDocument(); - expect(screen.getByLabelText('Orders date')).toBeInTheDocument(); - expect(screen.getByLabelText('Report by date')).toBeInTheDocument(); - expect(screen.getByText('Are dependents included in the orders?')).toBeInTheDocument(); + expect(screen.getByLabelText(/Orders type/)).toBeInTheDocument(); + expect(screen.getByLabelText(/Orders date/)).toBeInTheDocument(); + expect(screen.getByLabelText(/Report by date/)).toBeInTheDocument(); + expect(screen.getByText(/Are dependents included in the orders?/)).toBeInTheDocument(); expect(screen.getByTestId('hasDependentsYes')).toBeInTheDocument(); expect(screen.getByTestId('hasDependentsNo')).toBeInTheDocument(); - expect(screen.getByLabelText('Current duty location')).toBeInTheDocument(); - expect(screen.getByLabelText('New duty location')).toBeInTheDocument(); - expect(screen.getByLabelText('Pay grade')).toBeInTheDocument(); + expect(screen.getByLabelText(/Current duty location/)).toBeInTheDocument(); + expect(screen.getByLabelText(/New duty location/)).toBeInTheDocument(); + expect(screen.getByLabelText(/Pay grade/)).toBeInTheDocument(); }); }); @@ -167,12 +167,12 @@ describe('CreateMoveCustomerInfo Component', () => { , ); - await userEvent.click(getByLabelText('Orders type')); - await userEvent.click(getByLabelText('Orders date')); - await userEvent.click(getByLabelText('Report by date')); - await userEvent.click(getByLabelText('Current duty location')); - await userEvent.click(getByLabelText('New duty location')); - await userEvent.click(getByLabelText('Pay grade')); + await userEvent.click(getByLabelText(/Orders type/)); + await userEvent.click(getByLabelText(/Orders date/)); + await userEvent.click(getByLabelText(/Report by date/)); + await userEvent.click(getByLabelText(/Current duty location/)); + await userEvent.click(getByLabelText(/New duty location/)); + await userEvent.click(getByLabelText(/Pay grade/)); const submitBtn = getByRole('button', { name: 'Next' }); await userEvent.click(submitBtn); @@ -240,7 +240,7 @@ describe('AddOrdersForm - Edge Cases and Additional Scenarios', () => { , ); - expect(screen.getByLabelText('Orders type')).toBeDisabled(); + expect(screen.getByLabelText(/Orders type/)).toBeDisabled(); }); it('disables orders type when bluebark move is selected', async () => { @@ -249,7 +249,7 @@ describe('AddOrdersForm - Edge Cases and Additional Scenarios', () => { , ); - expect(screen.getByLabelText('Orders type')).toBeDisabled(); + expect(screen.getByLabelText(/Orders type/)).toBeDisabled(); }); }); diff --git a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx index a0accc4b2db..8d2cc7a2fb8 100644 --- a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx @@ -357,21 +357,21 @@ describe('ServicesCounselingAddOrders component', () => { const user = userEvent.setup(); - await user.selectOptions(screen.getByLabelText('Orders type'), 'PERMANENT_CHANGE_OF_STATION'); - await user.type(screen.getByLabelText('Orders date'), '08 Nov 2020'); - await user.type(screen.getByLabelText('Report by date'), '26 Nov 2020'); + await user.selectOptions(screen.getByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); + await user.type(screen.getByLabelText(/Orders date/), '08 Nov 2020'); + await user.type(screen.getByLabelText(/Report by date/), '26 Nov 2020'); await user.click(screen.getByLabelText('No')); - await user.selectOptions(screen.getByLabelText('Pay grade'), ['E-5']); + await user.selectOptions(screen.getByLabelText(/Pay grade/), ['E-5']); // Test Current Duty Location Search Box interaction - await user.type(screen.getByLabelText('Current duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 500 }); const selectedOptionCurrent = await screen.findByText(/Altus/); await user.click(selectedOptionCurrent); const counselingOfficeLabel = await screen.queryByText(/Counseling office/); expect(counselingOfficeLabel).toBeFalsy(); - await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Luke/); await user.click(selectedOptionNew); @@ -395,14 +395,14 @@ describe('ServicesCounselingAddOrders component', () => { const user = userEvent.setup(); - await user.selectOptions(screen.getByLabelText('Orders type'), 'PERMANENT_CHANGE_OF_STATION'); - await user.type(screen.getByLabelText('Orders date'), '08 Nov 2020'); - await user.type(screen.getByLabelText('Report by date'), '29 Nov 2020'); + await user.selectOptions(screen.getByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); + await user.type(screen.getByLabelText(/Orders date/), '08 Nov 2020'); + await user.type(screen.getByLabelText(/Report by date/), '29 Nov 2020'); await user.click(screen.getByLabelText('No')); - await user.selectOptions(screen.getByLabelText('Pay grade'), ['E-5']); + await user.selectOptions(screen.getByLabelText(/Pay grade/), ['E-5']); // Test Current Duty Location Search Box interaction - await user.type(screen.getByLabelText('Current duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 500 }); const selectedOptionCurrent = await screen.findByText(/Hill/); await user.click(selectedOptionCurrent); @@ -411,7 +411,7 @@ describe('ServicesCounselingAddOrders component', () => { await userEvent.selectOptions(screen.getByLabelText(/Counseling office/), ['Glendale Luke AFB']); - await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Luke/); await user.click(selectedOptionNew); @@ -429,17 +429,17 @@ describe('ServicesCounselingAddOrders component', () => { const user = userEvent.setup(); - await user.selectOptions(screen.getByLabelText('Orders type'), 'PERMANENT_CHANGE_OF_STATION'); - await user.type(screen.getByLabelText('Orders date'), '08 Nov 2020'); - await user.type(screen.getByLabelText('Report by date'), '26 Nov 2020'); + await user.selectOptions(screen.getByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); + await user.type(screen.getByLabelText(/Orders date/), '08 Nov 2020'); + await user.type(screen.getByLabelText(/Report by date/), '26 Nov 2020'); await user.click(screen.getByLabelText('No')); - await user.selectOptions(screen.getByLabelText('Pay grade'), ['E-5']); + await user.selectOptions(screen.getByLabelText(/Pay grade/), ['E-5']); - await user.type(screen.getByLabelText('Current duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/Current duty location/), 'AFB', { delay: 500 }); const selectedOptionCurrent = await screen.findByText(/Altus/); await user.click(selectedOptionCurrent); - await user.type(screen.getByLabelText('New duty location'), 'AFB', { delay: 500 }); + await user.type(screen.getByLabelText(/New duty location/), 'AFB', { delay: 500 }); const selectedOptionNew = await screen.findByText(/Outta This World/); await user.click(selectedOptionNew); From 33f37ea69fe8d0502c8e57576480769ef4d009bc Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 17 Jan 2025 20:28:33 +0000 Subject: [PATCH 048/229] Fix total field formatting and left-aligned --- .../ServiceItemCalculations/ServiceItemCalculations.jsx | 5 ----- .../ServiceItemCalculations.module.scss | 2 -- src/components/Office/ServiceItemCalculations/helpers.js | 2 +- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.jsx b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.jsx index 814e82d124a..fea91773c2e 100644 --- a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.jsx +++ b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.jsx @@ -14,7 +14,6 @@ import { } from 'constants/serviceItems'; const times = ; -const equals = ; const ServiceItemCalculations = ({ itemCode, @@ -37,10 +36,6 @@ const ServiceItemCalculations = ({ return times; } - if (index === length - 1) { - return equals; - } - return null; }; diff --git a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.module.scss b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.module.scss index c83658fa704..48e25cd1efb 100644 --- a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.module.scss +++ b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.module.scss @@ -59,8 +59,6 @@ .col:last-of-type { @include u-margin-right(0); - @include u-text-align('right'); - hr { width: 100%; } diff --git a/src/components/Office/ServiceItemCalculations/helpers.js b/src/components/Office/ServiceItemCalculations/helpers.js index 6577e9118b8..2e44eb1b1ad 100644 --- a/src/components/Office/ServiceItemCalculations/helpers.js +++ b/src/components/Office/ServiceItemCalculations/helpers.js @@ -641,7 +641,7 @@ const uncappedRequestTotal = (params) => { const totalAmountRequested = (totalAmount) => { const value = toDollarString(formatCents(totalAmount)); - const label = `${SERVICE_ITEM_CALCULATION_LABELS.Total}:`; + const label = `${SERVICE_ITEM_CALCULATION_LABELS.Total}: `; const detail = ''; return calculation(value, label, formatDetail(detail)); From 2d64f350bbecf25a0f929aba0128fb6ee1fe15f3 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Fri, 17 Jan 2025 21:00:20 +0000 Subject: [PATCH 049/229] seem to have most of it working, need to refine and add tests, figure out UI display for iPPMs --- ...52_add_ppm_estimated_incentive_proc.up.sql | 136 +++++++++++++- pkg/gen/ghcapi/embedded_spec.go | 42 +++++ pkg/gen/ghcmessages/p_p_m_closeout.go | 9 + .../internal/payloads/model_to_payload.go | 3 + pkg/models/ppm_shipment.go | 29 ++- pkg/models/re_service_item.go | 12 ++ .../distance_zip_lookup.go | 53 ++++-- .../per_unit_cents_lookup.go | 153 ++++++++++++++-- .../port_zip_lookup.go | 14 +- .../service_param_value_lookups.go | 10 +- .../service_param_value_lookups_test.go | 2 +- pkg/services/ppm_closeout/ppm_closeout.go | 47 +++-- pkg/services/ppmshipment/ppm_estimator.go | 171 ++++++++++++++---- .../PPM/PPMHeaderSummary/HeaderSection.jsx | 121 +++++++++---- .../PPM/PPMHeaderSummary/PPMHeaderSummary.jsx | 5 + src/shared/constants.js | 5 + swagger-def/definitions/PPMCloseout.yaml | 36 ++-- swagger/ghc.yaml | 18 ++ 18 files changed, 713 insertions(+), 153 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index 47436e133a9..5aff4a61dd3 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -1,3 +1,47 @@ +-- inserting params for IDFSIT +INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES + ('fb7925e7-ebfe-49d9-9cf4-7219e68ec686'::uuid,'bd6064ca-e780-4ab4-a37b-0ae98eebb244','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents + +-- IDASIT +INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES + ('51393ee1-f505-4f7b-96c4-135f771af814'::uuid,'806c6d59-57ff-4a3f-9518-ebf29ba9cb10','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents + +-- IOFSIT +INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES + ('7518ec84-0c40-4c17-86dd-3ce04e2fe701'::uuid,'b488bf85-ea5e-49c8-ba5c-e2fa278ac806','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents + +-- IOASIT +INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES + ('cff34123-e2a5-40ed-9cf3-451701850a26'::uuid,'bd424e45-397b-4766-9712-de4ae3a2da36','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents + +-- inserting params for FSC +INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES + ('bb53e034-80c2-420e-8492-f54d2018fff1'::uuid,'4780b30c-e846-437a-b39a-c499a6b09872','d9ad3878-4b94-4722-bbaf-d4b8080f339d','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',true); -- PortZip + +-- remove PriceAreaIntlOrigin, we don't need it +DELETE FROM service_params +WHERE service_item_param_key_id = '6d44624c-b91b-4226-8fcd-98046e2f433d'; + +-- remove PriceAreaIntlDest, we don't need it +DELETE FROM service_params +WHERE service_item_param_key_id = '4736f489-dfda-4df1-a303-8c434a120d5d'; + +-- func to fetch a service id from re_services by providing the service code +CREATE OR REPLACE FUNCTION get_service_id(service_code TEXT) RETURNS UUID AS $$ +DECLARE + service_id UUID; +BEGIN + SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = service_code; + IF service_id IS NULL THEN + RAISE EXCEPTION 'Service code % not found in re_services', service_code; + END IF; + RETURN service_id; +END; +$$ LANGUAGE plpgsql; + + +-- db proc that will calculate a PPM's incentive +-- this is used for estimated/final/max incentives CREATE OR REPLACE FUNCTION calculate_ppm_incentive( ppm_id UUID, pickup_address_id UUID, @@ -32,7 +76,7 @@ BEGIN RAISE EXCEPTION 'is_estimated, is_actual, and is_max cannot all be FALSE. No update will be performed.'; END IF; - -- Validating it's a real PPM + -- validating it's a real PPM SELECT ppms.id INTO ppm FROM ppm_shipments ppms WHERE ppms.id = ppm_id; IF ppm IS NULL THEN RAISE EXCEPTION 'PPM with ID % not found', ppm_id; @@ -54,7 +98,7 @@ BEGIN END IF; -- ISLH calculation - SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'ISLH'; + service_id := get_service_id('ISLH'); price_islh := ROUND( calculate_escalated_price( o_rate_area_id, @@ -67,7 +111,7 @@ BEGIN ); -- IHPK calculation - SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHPK'; + service_id := get_service_id('IHPK'); price_ihpk := ROUND( calculate_escalated_price( o_rate_area_id, @@ -80,7 +124,7 @@ BEGIN ); -- IHUPK calculation - SELECT rs.id INTO service_id FROM re_services rs WHERE rs.code = 'IHUPK'; + service_id := get_service_id('IHUPK'); price_ihupk := ROUND( calculate_escalated_price( NULL, @@ -99,17 +143,95 @@ BEGIN cents_above_baseline := mileage * estimated_fsc_multiplier; price_fsc := ROUND((cents_above_baseline * price_difference) * 100); - -- Total incentive total_incentive := price_islh + price_ihpk + price_ihupk + price_fsc; - -- Update the PPM incentive values UPDATE ppm_shipments SET estimated_incentive = CASE WHEN is_estimated THEN total_incentive ELSE estimated_incentive END, final_incentive = CASE WHEN is_actual THEN total_incentive ELSE final_incentive END, max_incentive = CASE WHEN is_max THEN total_incentive ELSE max_incentive END WHERE id = ppm_id; - -- Return all values + -- returning a table so we can use this data in the breakdown for the service member RETURN QUERY SELECT total_incentive, price_islh, price_ihpk, price_ihupk, price_fsc; END; $$ LANGUAGE plpgsql; + + +-- db proc that will calculate a PPM's SIT cost +-- returns a table with total cost and the cost of each first day/add'l day SIT service item +CREATE OR REPLACE FUNCTION calculate_ppm_sit_cost( + ppm_id UUID, + address_id UUID, + is_origin BOOLEAN, + move_date DATE, + weight INT, + sit_days INT +) RETURNS TABLE ( + total_cost INT, + price_first_day INT, + price_addl_day INT +) AS +$$ +DECLARE + ppm RECORD; + contract_id UUID; + sit_rate_area_id UUID; + service_id UUID; +BEGIN + -- Validate SIT days + IF sit_days IS NULL OR sit_days < 0 THEN + RAISE EXCEPTION 'SIT days must be a positive integer. Provided value: %', sit_days; + END IF; + + -- Validate PPM existence + SELECT ppms.id INTO ppm FROM ppm_shipments ppms WHERE ppms.id = ppm_id; + IF ppm IS NULL THEN + RAISE EXCEPTION 'PPM with ID % not found', ppm_id; + END IF; + + -- Get contract ID + contract_id := get_contract_id(move_date); + IF contract_id IS NULL THEN + RAISE EXCEPTION 'Contract not found for date: %', move_date; + END IF; + + -- Get rate area + sit_rate_area_id := get_rate_area_id(address_id, NULL, contract_id); + IF sit_rate_area_id IS NULL THEN + RAISE EXCEPTION 'Rate area is NULL for address ID % and contract ID %', address_id, contract_id; + END IF; + + -- Calculate first day SIT cost + service_id := get_service_id(CASE WHEN is_origin THEN 'IOFSIT' ELSE 'IDFSIT' END); + price_first_day := ( + calculate_escalated_price( + CASE WHEN is_origin THEN sit_rate_area_id ELSE NULL END, + CASE WHEN NOT is_origin THEN sit_rate_area_id ELSE NULL END, + service_id, + contract_id, + CASE WHEN is_origin THEN 'IOFSIT' ELSE 'IDFSIT' END, + move_date + ) * (weight / 100)::NUMERIC * 100 + )::INT; + + -- Calculate additional day SIT cost + service_id := get_service_id(CASE WHEN is_origin THEN 'IOASIT' ELSE 'IDASIT' END); + price_addl_day := ( + calculate_escalated_price( + CASE WHEN is_origin THEN sit_rate_area_id ELSE NULL END, + CASE WHEN NOT is_origin THEN sit_rate_area_id ELSE NULL END, + service_id, + contract_id, + CASE WHEN is_origin THEN 'IOASIT' ELSE 'IDASIT' END, + move_date + ) * (weight / 100)::NUMERIC * 100 * sit_days + )::INT; + + -- Calculate total SIT cost + total_cost := price_first_day + price_addl_day; + + -- Return the breakdown for SIT costs + RETURN QUERY SELECT total_cost, price_first_day, price_addl_day; +END; +$$ LANGUAGE plpgsql; + diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index e0271647ece..2ba350e437e 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -11332,6 +11332,27 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, + "intlLinehaulPrice": { + "description": "The full price of international shipping and linehaul (ISLH)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "intlPackPrice": { + "description": "The full price of international packing (IHPK)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "intlUnpackPrice": { + "description": "The full price of international unpacking (IHUPK)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, "miles": { "description": "The distance between the old address and the new address in miles.", "type": "integer", @@ -28257,6 +28278,27 @@ func init() { "readOnly": true, "example": "1f2270c7-7166-40ae-981e-b200ebdf3054" }, + "intlLinehaulPrice": { + "description": "The full price of international shipping and linehaul (ISLH)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "intlPackPrice": { + "description": "The full price of international packing (IHPK)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, + "intlUnpackPrice": { + "description": "The full price of international unpacking (IHUPK)", + "type": "integer", + "format": "cents", + "x-nullable": true, + "x-omitempty": false + }, "miles": { "description": "The distance between the old address and the new address in miles.", "type": "integer", diff --git a/pkg/gen/ghcmessages/p_p_m_closeout.go b/pkg/gen/ghcmessages/p_p_m_closeout.go index b0f423ba61a..a84e0e4c2e0 100644 --- a/pkg/gen/ghcmessages/p_p_m_closeout.go +++ b/pkg/gen/ghcmessages/p_p_m_closeout.go @@ -69,6 +69,15 @@ type PPMCloseout struct { // Format: uuid ID strfmt.UUID `json:"id"` + // The full price of international shipping and linehaul (ISLH) + IntlLinehaulPrice *int64 `json:"intlLinehaulPrice"` + + // The full price of international packing (IHPK) + IntlPackPrice *int64 `json:"intlPackPrice"` + + // The full price of international unpacking (IHUPK) + IntlUnpackPrice *int64 `json:"intlUnpackPrice"` + // The distance between the old address and the new address in miles. // Example: 54 // Minimum: 0 diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 89a6290a7ff..87a7517ded5 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -1313,6 +1313,9 @@ func PPMCloseout(ppmCloseout *models.PPMCloseout) *ghcmessages.PPMCloseout { Ddp: handlers.FmtCost(ppmCloseout.DDP), PackPrice: handlers.FmtCost(ppmCloseout.PackPrice), UnpackPrice: handlers.FmtCost(ppmCloseout.UnpackPrice), + IntlPackPrice: handlers.FmtCost((ppmCloseout.IntlPackPrice)), + IntlUnpackPrice: handlers.FmtCost((ppmCloseout.IntlUnpackPrice)), + IntlLinehaulPrice: handlers.FmtCost((ppmCloseout.IntlLinehaulPrice)), SITReimbursement: handlers.FmtCost(ppmCloseout.SITReimbursement), } diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index 7989b973119..4506451053a 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -40,10 +40,9 @@ type PPMCloseout struct { DDP *unit.Cents PackPrice *unit.Cents UnpackPrice *unit.Cents - IHPKPrice *unit.Cents - IHUPKPrice *unit.Cents - ISLHPrice *unit.Cents - FSCPrice *unit.Cents + IntlPackPrice *unit.Cents + IntlUnpackPrice *unit.Cents + IntlLinehaulPrice *unit.Cents SITReimbursement *unit.Cents } @@ -333,12 +332,11 @@ type PPMIncentive struct { PriceFSC int `db:"price_fsc"` } -// a db stored proc that will handle updating the estimated_incentive value +// a db function that will handle updating the estimated_incentive value // this simulates pricing of a basic iHHG shipment with ISLH, IHPK, IHUPK, and the CONUS portion for a FSC func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (*PPMIncentive, error) { var incentive PPMIncentive - // Run the stored procedure and scan the results into the struct err := db.RawQuery("SELECT * FROM calculate_ppm_incentive($1, $2, $3, $4, $5, $6, $7, $8, $9)", ppmID, pickupAddressID, destAddressID, moveDate, mileage, weight, isEstimated, isActual, isMax). First(&incentive) if err != nil { @@ -347,3 +345,22 @@ func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID return &incentive, nil } + +type PPMSITCosts struct { + TotalSITCost int `db:"total_cost"` + PriceFirstDaySIT int `db:"price_first_day"` + PriceAddlDaySIT int `db:"price_addl_day"` +} + +// a db function that will handle calculating and returning the SIT costs related to a PPM shipment +func CalculatePPMSITCost(db *pop.Connection, ppmID uuid.UUID, addressID uuid.UUID, isOrigin bool, moveDate time.Time, weight int, sitDays int) (*PPMSITCosts, error) { + var costs PPMSITCosts + + err := db.RawQuery("SELECT * FROM calculate_ppm_SIT_cost($1, $2, $3, $4, $5, $6)", ppmID, addressID, isOrigin, moveDate, weight, sitDays). + First(&costs) + if err != nil { + return nil, fmt.Errorf("error calculating PPM SIT costs for PPM ID %s: %w", ppmID, err) + } + + return &costs, nil +} diff --git a/pkg/models/re_service_item.go b/pkg/models/re_service_item.go index f06ee0990a2..298c8dfa26a 100644 --- a/pkg/models/re_service_item.go +++ b/pkg/models/re_service_item.go @@ -3,7 +3,10 @@ package models import ( "time" + "github.com/gobuffalo/pop/v6" "github.com/gofrs/uuid" + + "github.com/transcom/mymove/pkg/apperror" ) type ReServiceItem struct { @@ -24,3 +27,12 @@ func (r ReServiceItem) TableName() string { // ReServiceItems is a slice of ReServiceItem type ReServiceItems []ReServiceItem + +func FetchReServiceByCode(db *pop.Connection, code ReServiceCode) (*ReService, error) { + reService := ReService{} + err := db.Where("code = ?", code).First(&reService) + if err != nil { + return nil, apperror.NewQueryError("ReService", err, "") + } + return &reService, err +} diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go index d2e08c221f0..2a6e1b70a97 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go @@ -48,6 +48,8 @@ func (r DistanceZipLookup) lookup(appCtx appcontext.AppContext, keyData *Service "Distance", "PickupAddress", "DestinationAddress", + "PPMShipment.PickupAddress", + "PPMShipment.DestinationAddress", ).Find(&mtoShipment, mtoShipment.ID) if err != nil { return "", err @@ -59,20 +61,47 @@ func (r DistanceZipLookup) lookup(appCtx appcontext.AppContext, keyData *Service // if the shipment is international, we need to change the respective ZIP to use the port ZIP and not the address ZIP if mtoShipment.MarketCode == models.MarketCodeInternational { - portZip, portType, err := models.GetPortLocationInfoForShipment(appCtx.DB(), *mtoShipmentID) - if err != nil { - return "", err - } - if portZip != nil && portType != nil { - // if the port type is POEFSC this means the shipment is CONUS -> OCONUS (pickup -> port) - // if the port type is PODFSC this means the shipment is OCONUS -> CONUS (port -> destination) - if *portType == models.ReServiceCodePOEFSC.String() { - destinationZip = *portZip - } else if *portType == models.ReServiceCodePODFSC.String() { - pickupZip = *portZip + if mtoShipment.ShipmentType != models.MTOShipmentTypePPM { + portZip, portType, err := models.GetPortLocationInfoForShipment(appCtx.DB(), *mtoShipmentID) + if err != nil { + return "", err + } + if portZip != nil && portType != nil { + // if the port type is POEFSC this means the shipment is CONUS -> OCONUS (pickup -> port) + // if the port type is PODFSC this means the shipment is OCONUS -> CONUS (port -> destination) + if *portType == models.ReServiceCodePOEFSC.String() { + destinationZip = *portZip + } else if *portType == models.ReServiceCodePODFSC.String() { + pickupZip = *portZip + } + } else { + return "", apperror.NewNotFoundError(*mtoShipmentID, "looking for port ZIP for shipment") } } else { - return "", apperror.NewNotFoundError(*mtoShipmentID, "looking for port ZIP for shipment") + // PPMs get reimbursed for their travel from CONUS <-> Port ZIPs, but only for the Tacoma Port + portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") // Tacoma port code + if err != nil { + return "", fmt.Errorf("unable to find port zip with code %s", "3002") + } + if mtoShipment.PPMShipment != nil && mtoShipment.PPMShipment.PickupAddress != nil && mtoShipment.PPMShipment.DestinationAddress != nil { + // need to figure out if we are going to go Port -> CONUS or CONUS -> Port + pickupOconus := *mtoShipment.PPMShipment.PickupAddress.IsOconus + destOconus := *mtoShipment.PPMShipment.DestinationAddress.IsOconus + if pickupOconus && !destOconus { + // Port ZIP -> CONUS ZIP + pickupZip = portLocation.UsPostRegionCity.UsprZipID + destinationZip = mtoShipment.PPMShipment.DestinationAddress.PostalCode + } else if !pickupOconus && destOconus { + // CONUS ZIP -> Port ZIP + pickupZip = mtoShipment.PPMShipment.PickupAddress.PostalCode + destinationZip = portLocation.UsPostRegionCity.UsprZipID + } else { + // OCONUS -> OCONUS mileage they don't get reimbursed for + return strconv.Itoa(0), nil + } + } else { + return "", fmt.Errorf("missing required PPM & address information for shipment with id %s", mtoShipmentID) + } } } errorMsgForPickupZip := fmt.Sprintf("Shipment must have valid pickup zipcode. Received: %s", pickupZip) diff --git a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go index b339fbf43dd..847093df3e2 100644 --- a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go @@ -2,6 +2,9 @@ package serviceparamvaluelookups import ( "fmt" + "time" + + "github.com/gofrs/uuid" "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/models" @@ -16,19 +19,67 @@ type PerUnitCentsLookup struct { func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemParamKeyData) (string, error) { serviceID := p.ServiceItem.ReServiceID + if serviceID == uuid.Nil { + reService, err := models.FetchReServiceByCode(appCtx.DB(), p.ServiceItem.ReService.Code) + if err != nil { + return "", fmt.Errorf("error fetching ReService Code %s: %w", p.ServiceItem.ReService.Code, err) + } + serviceID = reService.ID + } contractID := s.ContractID - if p.MTOShipment.RequestedPickupDate == nil { - return "", fmt.Errorf("requested pickup date is required for shipment with id: %s", p.MTOShipment.ID) + var shipmentID uuid.UUID + var pickupAddressID uuid.UUID + var destinationAddressID uuid.UUID + var moveDate time.Time + // HHG shipment + if p.MTOShipment.ShipmentType != models.MTOShipmentTypePPM { + shipmentID = p.MTOShipment.ID + if p.MTOShipment.RequestedPickupDate != nil { + moveDate = *p.MTOShipment.RequestedPickupDate + } else { + return "", fmt.Errorf("requested pickup date is required for shipment with id: %s", shipmentID) + } + if p.MTOShipment.PickupAddressID != nil { + pickupAddressID = *p.MTOShipment.PickupAddressID + } else { + return "", fmt.Errorf("pickup address is required for shipment with id: %s", shipmentID) + } + if p.MTOShipment.DestinationAddressID != nil { + destinationAddressID = *p.MTOShipment.DestinationAddressID + } else { + return "", fmt.Errorf("destination address is required for shipment with id: %s", shipmentID) + } + } else { // PPM shipment + shipmentID = p.MTOShipment.PPMShipment.ID + if p.MTOShipment.ActualPickupDate != nil { + moveDate = *p.MTOShipment.ActualPickupDate + } else if p.MTOShipment.RequestedPickupDate != nil { + moveDate = *p.MTOShipment.RequestedPickupDate + } else { + return "", fmt.Errorf("actual move date is required for PPM shipment with id: %s", shipmentID) + } + + if p.MTOShipment.PPMShipment.PickupAddressID != nil { + pickupAddressID = *p.MTOShipment.PPMShipment.PickupAddressID + } else { + return "", fmt.Errorf("pickup address is required for PPM shipment with id: %s", shipmentID) + } + + if p.MTOShipment.PPMShipment.DestinationAddressID != nil { + destinationAddressID = *p.MTOShipment.PPMShipment.DestinationAddressID + } else { + return "", fmt.Errorf("destination address is required for PPM shipment with id: %s", shipmentID) + } } switch p.ServiceItem.ReService.Code { case models.ReServiceCodeIHPK: // IHPK: Need rate area ID for the pickup address - rateAreaID, err := models.FetchRateAreaID(appCtx.DB(), *p.MTOShipment.PickupAddressID, serviceID, contractID) + rateAreaID, err := models.FetchRateAreaID(appCtx.DB(), pickupAddressID, serviceID, contractID) if err != nil { - return "", fmt.Errorf("error fetching rate area id for shipment ID: %s and service ID %s: %s", p.MTOShipment.ID, serviceID, err) + return "", fmt.Errorf("error fetching rate area id for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) } - isPeakPeriod := ghcrateengine.IsPeakPeriod(*p.MTOShipment.RequestedPickupDate) + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) var reIntlOtherPrice models.ReIntlOtherPrice err = appCtx.DB().Q(). Where("contract_id = ?", contractID). @@ -43,11 +94,11 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP case models.ReServiceCodeIHUPK: // IHUPK: Need rate area ID for the destination address - rateAreaID, err := models.FetchRateAreaID(appCtx.DB(), *p.MTOShipment.PickupAddressID, serviceID, contractID) + rateAreaID, err := models.FetchRateAreaID(appCtx.DB(), destinationAddressID, serviceID, contractID) if err != nil { - return "", fmt.Errorf("error fetching rate area id for shipment ID: %s and service ID %s: %s", p.MTOShipment.ID, serviceID, err) + return "", fmt.Errorf("error fetching rate area id for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) } - isPeakPeriod := ghcrateengine.IsPeakPeriod(*p.MTOShipment.RequestedPickupDate) + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) var reIntlOtherPrice models.ReIntlOtherPrice err = appCtx.DB().Q(). Where("contract_id = ?", contractID). @@ -62,15 +113,15 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP case models.ReServiceCodeISLH: // ISLH: Need rate area IDs for origin and destination - originRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), *p.MTOShipment.PickupAddressID, serviceID, contractID) + originRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), pickupAddressID, serviceID, contractID) if err != nil { - return "", fmt.Errorf("error fetching rate area id for origin address for shipment ID: %s and service ID %s: %s", p.MTOShipment.ID, serviceID, err) + return "", fmt.Errorf("error fetching rate area id for origin address for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) } - destRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), *p.MTOShipment.DestinationAddressID, serviceID, contractID) + destRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), destinationAddressID, serviceID, contractID) if err != nil { - return "", fmt.Errorf("error fetching rate area id for destination address for shipment ID: %s and service ID %s: %s", p.MTOShipment.ID, serviceID, err) + return "", fmt.Errorf("error fetching rate area id for destination address for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) } - isPeakPeriod := ghcrateengine.IsPeakPeriod(*p.MTOShipment.RequestedPickupDate) + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) var reIntlPrice models.ReIntlPrice err = appCtx.DB().Q(). Where("contract_id = ?", contractID). @@ -84,6 +135,82 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP } return reIntlPrice.PerUnitCents.ToMillicents().ToCents().String(), nil + case models.ReServiceCodeIOFSIT: + // IOFSIT: Need rate area ID for origin + originRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), pickupAddressID, serviceID, contractID) + if err != nil { + return "", fmt.Errorf("error fetching rate area id for origin address for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) + } + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) + var reIntlOtherPrice models.ReIntlOtherPrice + err = appCtx.DB().Q(). + Where("contract_id = ?", contractID). + Where("service_id = ?", serviceID). + Where("is_peak_period = ?", isPeakPeriod). + Where("origin_rate_area_id = ?", originRateAreaID). + First(&reIntlOtherPrice) + if err != nil { + return "", fmt.Errorf("error fetching IOFSIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, originRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, originRateAreaID, err) + } + return reIntlOtherPrice.PerUnitCents.ToMillicents().ToCents().String(), nil + + case models.ReServiceCodeIOASIT: + // IOASIT: Need rate area ID for origin + originRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), pickupAddressID, serviceID, contractID) + if err != nil { + return "", fmt.Errorf("error fetching rate area id for origin address for shipment ID: %s, service ID %s: %s", shipmentID, serviceID, err) + } + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) + var reIntlOtherPrice models.ReIntlOtherPrice + err = appCtx.DB().Q(). + Where("contract_id = ?", contractID). + Where("service_id = ?", serviceID). + Where("is_peak_period = ?", isPeakPeriod). + Where("origin_rate_area_id = ?", originRateAreaID). + First(&reIntlOtherPrice) + if err != nil { + return "", fmt.Errorf("error fetching IOASIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, originRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, originRateAreaID, err) + } + return reIntlOtherPrice.PerUnitCents.ToMillicents().ToCents().String(), nil + + case models.ReServiceCodeIDFSIT: + // IDFSIT: Need rate area ID for destination + destRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), destinationAddressID, serviceID, contractID) + if err != nil { + return "", fmt.Errorf("error fetching rate area id for destination address for shipment ID: %s, service ID %s: %s", shipmentID, serviceID, err) + } + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) + var reIntlOtherPrice models.ReIntlOtherPrice + err = appCtx.DB().Q(). + Where("contract_id = ?", contractID). + Where("service_id = ?", serviceID). + Where("is_peak_period = ?", isPeakPeriod). + Where("destination_rate_area_id = ?", destRateAreaID). + First(&reIntlOtherPrice) + if err != nil { + return "", fmt.Errorf("error fetching IDFSIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, destRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, destRateAreaID, err) + } + return reIntlOtherPrice.PerUnitCents.ToMillicents().ToCents().String(), nil + + case models.ReServiceCodeIDASIT: + // IDASIT: Need rate area ID for destination + destRateAreaID, err := models.FetchRateAreaID(appCtx.DB(), destinationAddressID, serviceID, contractID) + if err != nil { + return "", fmt.Errorf("error fetching rate area id for destination address for shipment ID: %s and service ID %s: %s", shipmentID, serviceID, err) + } + isPeakPeriod := ghcrateengine.IsPeakPeriod(moveDate) + var reIntlOtherPrice models.ReIntlOtherPrice + err = appCtx.DB().Q(). + Where("contract_id = ?", contractID). + Where("service_id = ?", serviceID). + Where("is_peak_period = ?", isPeakPeriod). + Where("destination_rate_area_id = ?", destRateAreaID). + First(&reIntlOtherPrice) + if err != nil { + return "", fmt.Errorf("error fetching IDASIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, destRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, destRateAreaID, err) + } + return reIntlOtherPrice.PerUnitCents.ToMillicents().ToCents().String(), nil + default: return "", fmt.Errorf("unsupported service code to retrieve service item param PerUnitCents") } diff --git a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go index 3ea8be94315..bf4971f9db2 100644 --- a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go @@ -15,13 +15,25 @@ type PortZipLookup struct { ServiceItem models.MTOServiceItem } -func (p PortZipLookup) lookup(appCtx appcontext.AppContext, _ *ServiceItemParamKeyData) (string, error) { +func (p PortZipLookup) lookup(appCtx appcontext.AppContext, keyData *ServiceItemParamKeyData) (string, error) { var portLocationID *uuid.UUID if p.ServiceItem.PODLocationID != nil { portLocationID = p.ServiceItem.PODLocationID } else if p.ServiceItem.POELocationID != nil { portLocationID = p.ServiceItem.POELocationID } else { + // for PPMs we need to send back the ZIP for the Tacoma Port, they are reimbursed for their CONUS <-> Port travel + shipment, err := models.FetchShipmentByID(appCtx.DB(), *keyData.mtoShipmentID) + if err != nil { + return "", fmt.Errorf("unable to find shipment with id %s", keyData.mtoShipmentID) + } + if shipment.ShipmentType == models.MTOShipmentTypePPM && shipment.MarketCode == models.MarketCodeInternational { + portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") + if err != nil { + return "", fmt.Errorf("unable to find port zip with code %s", "3002") + } + return portLocation.UsPostRegionCity.UsprZipID, nil + } return "", fmt.Errorf("unable to find port zip for service item id: %s", p.ServiceItem.ID) } var portLocation models.PortLocation diff --git a/pkg/payment_request/service_param_value_lookups/service_param_value_lookups.go b/pkg/payment_request/service_param_value_lookups/service_param_value_lookups.go index 6c5fc73c42a..545d95ad5ce 100644 --- a/pkg/payment_request/service_param_value_lookups/service_param_value_lookups.go +++ b/pkg/payment_request/service_param_value_lookups/service_param_value_lookups.go @@ -27,7 +27,7 @@ type ServiceItemParamKeyData struct { paramCache *ServiceParamsCache } -func NewServiceItemParamKeyData(planner route.Planner, lookups map[models.ServiceItemParamName]ServiceItemParamKeyLookup, mtoServiceItem models.MTOServiceItem, mtoShipment models.MTOShipment, contractCode string) ServiceItemParamKeyData { +func NewServiceItemParamKeyData(planner route.Planner, lookups map[models.ServiceItemParamName]ServiceItemParamKeyLookup, mtoServiceItem models.MTOServiceItem, mtoShipment models.MTOShipment, contractCode string, contractID uuid.UUID) ServiceItemParamKeyData { return ServiceItemParamKeyData{ planner: planner, lookups: lookups, @@ -36,6 +36,7 @@ func NewServiceItemParamKeyData(planner route.Planner, lookups map[models.Servic mtoShipmentID: &mtoShipment.ID, MoveTaskOrderID: mtoShipment.MoveTaskOrderID, ContractCode: contractCode, + ContractID: contractID, } } @@ -211,8 +212,11 @@ func ServiceParamLookupInitialize( mtoShipment.DestinationAddress = &destinationAddress switch mtoServiceItem.ReService.Code { - case models.ReServiceCodeDDASIT, models.ReServiceCodeDDDSIT, models.ReServiceCodeDDFSIT, models.ReServiceCodeDDSFSC, models.ReServiceCodeDOASIT, models.ReServiceCodeDOPSIT, models.ReServiceCodeDOFSIT, models.ReServiceCodeDOSFSC: - err := appCtx.DB().Load(&mtoShipment, "SITDurationUpdates") + case models.ReServiceCodeDDASIT, models.ReServiceCodeDDDSIT, models.ReServiceCodeDDFSIT, + models.ReServiceCodeDDSFSC, models.ReServiceCodeDOASIT, models.ReServiceCodeDOPSIT, + models.ReServiceCodeDOFSIT, models.ReServiceCodeDOSFSC, models.ReServiceCodeIOFSIT, + models.ReServiceCodeIOASIT, models.ReServiceCodeIDFSIT, models.ReServiceCodeIDASIT: + err := appCtx.DB().Load(&mtoShipment, "SITDurationUpdates", "PPMShipment.PickupAddress", "PPMShipment.DestinationAddress") if err != nil { return nil, err } diff --git a/pkg/payment_request/service_param_value_lookups/service_param_value_lookups_test.go b/pkg/payment_request/service_param_value_lookups/service_param_value_lookups_test.go index 48ba8bb1c7b..fb5c9b78efa 100644 --- a/pkg/payment_request/service_param_value_lookups/service_param_value_lookups_test.go +++ b/pkg/payment_request/service_param_value_lookups/service_param_value_lookups_test.go @@ -174,7 +174,7 @@ func (suite *ServiceParamValueLookupsSuite) setupTestMTOServiceItemWithEstimated // i don't think this function gets called for PPMs, but need to verify //paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, paymentRequest.ID, paymentRequest.MoveTaskOrderID, nil) //suite.FatalNoError(err) - paramLookup := NewServiceItemParamKeyData(suite.planner, serviceItemLookups, mtoServiceItem, mtoShipment, testdatagen.DefaultContractCode) + paramLookup := NewServiceItemParamKeyData(suite.planner, serviceItemLookups, mtoServiceItem, mtoShipment, testdatagen.DefaultContractCode, uuid.Nil) return mtoServiceItem, paymentRequest, ¶mLookup } diff --git a/pkg/services/ppm_closeout/ppm_closeout.go b/pkg/services/ppm_closeout/ppm_closeout.go index 9deab808a96..55707b91190 100644 --- a/pkg/services/ppm_closeout/ppm_closeout.go +++ b/pkg/services/ppm_closeout/ppm_closeout.go @@ -36,6 +36,9 @@ type serviceItemPrices struct { haulPrice *unit.Cents haulFSC *unit.Cents haulType models.HaulType + intlPackPrice *unit.Cents + intlUnpackPrice *unit.Cents + intlLinehaulPrice *unit.Cents } func NewPPMCloseoutFetcher(planner route.Planner, paymentRequestHelper paymentrequesthelper.Helper, estimator services.PPMEstimator) services.PPMCloseoutFetcher { @@ -119,6 +122,9 @@ func (p *ppmCloseoutFetcher) GetPPMCloseout(appCtx appcontext.AppContext, ppmShi ppmCloseoutObj.DDP = serviceItems.ddp ppmCloseoutObj.PackPrice = serviceItems.packPrice ppmCloseoutObj.UnpackPrice = serviceItems.unpackPrice + ppmCloseoutObj.IntlLinehaulPrice = serviceItems.intlLinehaulPrice + ppmCloseoutObj.IntlUnpackPrice = serviceItems.intlUnpackPrice + ppmCloseoutObj.IntlPackPrice = serviceItems.intlPackPrice ppmCloseoutObj.SITReimbursement = serviceItems.storageReimbursementCosts return &ppmCloseoutObj, nil @@ -317,12 +323,13 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, return serviceItemPrices{}, err } - serviceItemsToPrice = ppmshipment.BaseServiceItems(ppmShipment.ShipmentID) + isInternationalShipment := ppmShipment.Shipment.MarketCode == models.MarketCodeInternational + serviceItemsToPrice = ppmshipment.BaseServiceItems(ppmShipment) - // Change DLH to DSH if move within same Zip3 actualPickupPostal := *ppmShipment.ActualPickupPostalCode actualDestPostal := *ppmShipment.ActualDestinationPostalCode - if actualPickupPostal[0:3] == actualDestPostal[0:3] { + // Change DLH to DSH if move within same Zip3 + if !isInternationalShipment && actualPickupPostal[0:3] == actualDestPostal[0:3] { serviceItemsToPrice[0] = models.MTOServiceItem{ReService: models.ReService{Code: models.ReServiceCodeDSH}, MTOShipmentID: &ppmShipment.ShipmentID} } contractDate := ppmShipment.ExpectedDepartureDate @@ -335,7 +342,7 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, if paramErr != nil { return serviceItemPrices{}, paramErr } - var totalPrice, packPrice, unpackPrice, destinationPrice, originPrice, haulPrice, haulFSC unit.Cents + var totalPrice, packPrice, unpackPrice, destinationPrice, originPrice, haulPrice, haulFSC, intlPackPrice, intlUnpackPrice, intlLinehaulPrice unit.Cents var totalWeight unit.Pound var ppmToMtoShipment models.MTOShipment @@ -374,13 +381,16 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, } validCodes := map[models.ReServiceCode]string{ - models.ReServiceCodeDPK: "DPK", - models.ReServiceCodeDUPK: "DUPK", - models.ReServiceCodeDOP: "DOP", - models.ReServiceCodeDDP: "DDP", - models.ReServiceCodeDSH: "DSH", - models.ReServiceCodeDLH: "DLH", - models.ReServiceCodeFSC: "FSC", + models.ReServiceCodeDPK: "DPK", + models.ReServiceCodeDUPK: "DUPK", + models.ReServiceCodeDOP: "DOP", + models.ReServiceCodeDDP: "DDP", + models.ReServiceCodeDSH: "DSH", + models.ReServiceCodeDLH: "DLH", + models.ReServiceCodeFSC: "FSC", + models.ReServiceCodeISLH: "ISLH", + models.ReServiceCodeIHPK: "IHPK", + models.ReServiceCodeIHUPK: "IHUPK", } // If service item is of a type we need for a specific calculation, get its price @@ -402,11 +412,11 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, serviceItemLookups := serviceparamvaluelookups.InitializeLookups(appCtx, ppmToMtoShipment, serviceItem) // This is the struct that gets passed to every param lookup() method that was initialized above - keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(p.planner, serviceItemLookups, serviceItem, ppmToMtoShipment, contract.Code) + keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(p.planner, serviceItemLookups, serviceItem, ppmToMtoShipment, contract.Code, contract.ID) // The distance value gets saved to the mto shipment model to reduce repeated api calls. var shipmentWithDistance models.MTOShipment - err = appCtx.DB().Find(&shipmentWithDistance, ppmShipment.Shipment.ID) + err = appCtx.DB().Eager("PPMShipment").Find(&shipmentWithDistance, ppmShipment.Shipment.ID) if err != nil { logger.Error("could not find shipment in the database") return serviceItemPrices{}, err @@ -419,7 +429,7 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, for _, param := range paramsForServiceCode(serviceItem.ReService.Code, paramsForServiceItems) { paramKey := param.ServiceItemParamKey // This is where the lookup() method of each service item param is actually evaluated - paramValue, serviceParamErr := keyData.ServiceParamValue(appCtx, paramKey.Key) // Fails with "DistanceZip" param? + paramValue, serviceParamErr := keyData.ServiceParamValue(appCtx, paramKey.Key) if serviceParamErr != nil { logger.Error("could not calculate param value lookup", zap.Error(serviceParamErr)) return serviceItemPrices{}, serviceParamErr @@ -452,6 +462,12 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, totalPrice = totalPrice.AddCents(centsValue) switch serviceItem.ReService.Code { + case models.ReServiceCodeIHPK: + intlPackPrice += centsValue + case models.ReServiceCodeIHUPK: + intlUnpackPrice += centsValue + case models.ReServiceCodeISLH: + intlLinehaulPrice += centsValue case models.ReServiceCodeDPK: packPrice += centsValue case models.ReServiceCodeDUPK: @@ -488,6 +504,9 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, returnPriceObj.storageReimbursementCosts = &sitCosts returnPriceObj.haulPrice = &haulPrice returnPriceObj.haulFSC = &haulFSC + returnPriceObj.intlLinehaulPrice = &intlLinehaulPrice + returnPriceObj.intlPackPrice = &intlPackPrice + returnPriceObj.intlUnpackPrice = &intlUnpackPrice return returnPriceObj, nil } diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 81c76f99734..04378ce97dc 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -209,23 +209,25 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip return nil, nil, err } - // if the PPM is international, we will use a db func - if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { + calculateSITEstimate := shouldCalculateSITCost(newPPMShipment, &oldPPMShipment) - calculateSITEstimate := shouldCalculateSITCost(newPPMShipment, &oldPPMShipment) + // Clear out any previously calculated SIT estimated costs, if SIT is no longer expected + if newPPMShipment.SITExpected != nil && !*newPPMShipment.SITExpected { + newPPMShipment.SITEstimatedCost = nil + } - // Clear out any previously calculated SIT estimated costs, if SIT is no longer expected - if newPPMShipment.SITExpected != nil && !*newPPMShipment.SITExpected { - newPPMShipment.SITEstimatedCost = nil - } + skipCalculatingEstimatedIncentive := shouldSkipEstimatingIncentive(newPPMShipment, &oldPPMShipment) - skipCalculatingEstimatedIncentive := shouldSkipEstimatingIncentive(newPPMShipment, &oldPPMShipment) + if skipCalculatingEstimatedIncentive && !calculateSITEstimate { + return oldPPMShipment.EstimatedIncentive, newPPMShipment.SITEstimatedCost, nil + } - if skipCalculatingEstimatedIncentive && !calculateSITEstimate { - return oldPPMShipment.EstimatedIncentive, newPPMShipment.SITEstimatedCost, nil - } + estimatedIncentive := oldPPMShipment.EstimatedIncentive + estimatedSITCost := oldPPMShipment.SITEstimatedCost + + // if the PPM is international, we will use a db func + if newPPMShipment.Shipment.MarketCode != models.MarketCodeInternational { - estimatedIncentive := oldPPMShipment.EstimatedIncentive if !skipCalculatingEstimatedIncentive { // Clear out advance and advance requested fields when the estimated incentive is reset. newPPMShipment.HasRequestedAdvance = nil @@ -237,7 +239,6 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip } } - estimatedSITCost := oldPPMShipment.SITEstimatedCost if calculateSITEstimate { estimatedSITCost, err = CalculateSITCost(appCtx, newPPMShipment, contract) if err != nil { @@ -251,12 +252,35 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip pickupAddress := newPPMShipment.PickupAddress destinationAddress := newPPMShipment.DestinationAddress - estimatedIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) - if err != nil { - return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) + if !skipCalculatingEstimatedIncentive { + // Clear out advance and advance requested fields when the estimated incentive is reset. + newPPMShipment.HasRequestedAdvance = nil + newPPMShipment.AdvanceAmountRequested = nil + + estimatedIncentive, err = f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) + } } - return estimatedIncentive, nil, nil + if calculateSITEstimate { + var sitAddress models.Address + isOrigin := *newPPMShipment.SITLocation == models.SITLocationTypeOrigin + if isOrigin { + sitAddress = *newPPMShipment.PickupAddress + } else if !isOrigin { + sitAddress = *newPPMShipment.DestinationAddress + } else { + return estimatedIncentive, estimatedSITCost, nil + } + daysInSIT := additionalDaysInSIT(*newPPMShipment.SITEstimatedEntryDate, *newPPMShipment.SITEstimatedDepartureDate) + estimatedSITCost, err = f.calculateOCONUSSITCosts(appCtx, newPPMShipment.ID, sitAddress.ID, isOrigin, contractDate, newPPMShipment.EstimatedWeight.Int(), daysInSIT) + if err != nil { + return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) + } + } + + return estimatedIncentive, estimatedSITCost, nil } } @@ -419,7 +443,7 @@ func (f estimatePPM) calculatePrice(appCtx appcontext.AppContext, ppmShipment *m logger := appCtx.Logger() zeroTotal := false - serviceItemsToPrice := BaseServiceItems(ppmShipment.ShipmentID) + serviceItemsToPrice := BaseServiceItems(*ppmShipment) var move models.Move err := appCtx.DB().Q().Eager( @@ -509,7 +533,7 @@ func (f estimatePPM) calculatePrice(appCtx appcontext.AppContext, ppmShipment *m serviceItemLookups := serviceparamvaluelookups.InitializeLookups(appCtx, mtoShipment, serviceItem) // This is the struct that gets passed to every param lookup() method that was initialized above - keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(f.planner, serviceItemLookups, serviceItem, mtoShipment, contract.Code) + keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(f.planner, serviceItemLookups, serviceItem, mtoShipment, contract.Code, contract.ID) // The distance value gets saved to the mto shipment model to reduce repeated api calls. var shipmentWithDistance models.MTOShipment @@ -587,7 +611,7 @@ func (f estimatePPM) priceBreakdown(appCtx appcontext.AppContext, ppmShipment *m var unpacking unit.Cents var storage unit.Cents - serviceItemsToPrice := BaseServiceItems(ppmShipment.ShipmentID) + serviceItemsToPrice := BaseServiceItems(*ppmShipment) // Replace linehaul pricer with shorthaul pricer if move is within the same Zip3 var pickupPostal, destPostal string @@ -672,7 +696,7 @@ func (f estimatePPM) priceBreakdown(appCtx appcontext.AppContext, ppmShipment *m serviceItemLookups := serviceparamvaluelookups.InitializeLookups(appCtx, mtoShipment, serviceItem) // This is the struct that gets passed to every param lookup() method that was initialized above - keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(f.planner, serviceItemLookups, serviceItem, mtoShipment, contract.Code) + keyData := serviceparamvaluelookups.NewServiceItemParamKeyData(f.planner, serviceItemLookups, serviceItem, mtoShipment, contract.Code, contract.ID) // The distance value gets saved to the mto shipment model to reduce repeated api calls. var shipmentWithDistance models.MTOShipment @@ -783,12 +807,29 @@ func (f *estimatePPM) calculateOCONUSIncentive(appCtx appcontext.AppContext, ppm return (*unit.Cents)(&incentive.TotalIncentive), nil } +func (f *estimatePPM) calculateOCONUSSITCosts(appCtx appcontext.AppContext, ppmID uuid.UUID, addressID uuid.UUID, isOrigin bool, moveDate time.Time, weight int, sitDays int) (*unit.Cents, error) { + if sitDays <= 0 { + return nil, fmt.Errorf("SIT days must be greater than zero") + } + + if weight <= 0 { + return nil, fmt.Errorf("weight must be greater than zero") + } + + sitCosts, err := models.CalculatePPMSITCost(appCtx.DB(), ppmID, addressID, isOrigin, moveDate, weight, sitDays) + if err != nil { + return nil, fmt.Errorf("failed to calculate SIT costs: %w", err) + } + + return (*unit.Cents)(&sitCosts.TotalSITCost), nil +} + func CalculateSITCost(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, error) { logger := appCtx.Logger() additionalDaysInSIT := additionalDaysInSIT(*ppmShipment.SITEstimatedEntryDate, *ppmShipment.SITEstimatedDepartureDate) - serviceItemsToPrice := StorageServiceItems(ppmShipment.ShipmentID, *ppmShipment.SITLocation, additionalDaysInSIT) + serviceItemsToPrice := StorageServiceItems(*ppmShipment, *ppmShipment.SITLocation, additionalDaysInSIT) totalPrice := unit.Cents(0) for _, serviceItem := range serviceItemsToPrice { @@ -826,7 +867,7 @@ func CalculateSITCostBreakdown(appCtx appcontext.AppContext, ppmShipment *models additionalDaysInSIT := additionalDaysInSIT(*ppmShipment.SITEstimatedEntryDate, *ppmShipment.SITEstimatedDepartureDate) - serviceItemsToPrice := StorageServiceItems(ppmShipment.ShipmentID, *ppmShipment.SITLocation, additionalDaysInSIT) + serviceItemsToPrice := StorageServiceItems(*ppmShipment, *ppmShipment.SITLocation, additionalDaysInSIT) totalPrice := unit.Cents(0) for _, serviceItem := range serviceItemsToPrice { @@ -1037,10 +1078,14 @@ func priceAdditionalDaySIT(appCtx appcontext.AppContext, pricer services.ParamsP // expect to find them on the MTOShipment model. This is only in-memory and shouldn't get saved to the database. func MapPPMShipmentEstimatedFields(appCtx appcontext.AppContext, ppmShipment models.PPMShipment) (models.MTOShipment, error) { + ppmShipment.Shipment.PPMShipment = &ppmShipment + ppmShipment.Shipment.ShipmentType = models.MTOShipmentTypePPM ppmShipment.Shipment.ActualPickupDate = &ppmShipment.ExpectedDepartureDate ppmShipment.Shipment.RequestedPickupDate = &ppmShipment.ExpectedDepartureDate - ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode} - ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode} + ppmShipment.Shipment.PickupAddress = ppmShipment.PickupAddress + ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: *ppmShipment.ActualPickupPostalCode} + ppmShipment.Shipment.DestinationAddress = ppmShipment.DestinationAddress + ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: *ppmShipment.ActualDestinationPostalCode} ppmShipment.Shipment.PrimeActualWeight = ppmShipment.EstimatedWeight return ppmShipment.Shipment, nil @@ -1076,9 +1121,13 @@ func MapPPMShipmentMaxIncentiveFields(appCtx appcontext.AppContext, ppmShipment // expect to find them on the MTOShipment model. This is only in-memory and shouldn't get saved to the database. func MapPPMShipmentFinalFields(ppmShipment models.PPMShipment, totalWeight unit.Pound) models.MTOShipment { + ppmShipment.Shipment.PPMShipment = &ppmShipment + ppmShipment.Shipment.ShipmentType = models.MTOShipmentTypePPM ppmShipment.Shipment.ActualPickupDate = ppmShipment.ActualMoveDate ppmShipment.Shipment.RequestedPickupDate = ppmShipment.ActualMoveDate + ppmShipment.Shipment.PickupAddress = ppmShipment.PickupAddress ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: *ppmShipment.ActualPickupPostalCode} + ppmShipment.Shipment.DestinationAddress = ppmShipment.DestinationAddress ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: *ppmShipment.ActualDestinationPostalCode} ppmShipment.Shipment.PrimeActualWeight = &totalWeight @@ -1087,19 +1136,35 @@ func MapPPMShipmentFinalFields(ppmShipment models.PPMShipment, totalWeight unit. // baseServiceItems returns a list of the MTOServiceItems that makeup the price of the estimated incentive. These // are the same non-accesorial service items that get auto-created and approved when the TOO approves an HHG shipment. -func BaseServiceItems(mtoShipmentID uuid.UUID) []models.MTOServiceItem { - return []models.MTOServiceItem{ - {ReService: models.ReService{Code: models.ReServiceCodeDLH}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeFSC}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeDOP}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeDDP}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeDPK}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeDUPK}, MTOShipmentID: &mtoShipmentID}, +func BaseServiceItems(ppmShipment models.PPMShipment) []models.MTOServiceItem { + mtoShipmentID := ppmShipment.ShipmentID + isInternationalShipment := ppmShipment.Shipment.MarketCode == models.MarketCodeInternational + + if isInternationalShipment { + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeFSC}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeIHPK}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeIHUPK}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeISLH}, MTOShipmentID: &mtoShipmentID}, + } + } else { + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeDLH}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeFSC}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeDOP}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeDDP}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeDPK}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeDUPK}, MTOShipmentID: &mtoShipmentID}, + } } } -func StorageServiceItems(mtoShipmentID uuid.UUID, locationType models.SITLocationType, additionalDaysInSIT int) []models.MTOServiceItem { - if locationType == models.SITLocationTypeOrigin { +func StorageServiceItems(ppmShipment models.PPMShipment, locationType models.SITLocationType, additionalDaysInSIT int) []models.MTOServiceItem { + mtoShipmentID := ppmShipment.ShipmentID + isInternationalShipment := ppmShipment.Shipment.MarketCode == models.MarketCodeInternational + + // domestic shipments + if locationType == models.SITLocationTypeOrigin && !isInternationalShipment { if additionalDaysInSIT > 0 { return []models.MTOServiceItem{ {ReService: models.ReService{Code: models.ReServiceCodeDOFSIT}, MTOShipmentID: &mtoShipmentID}, @@ -1110,15 +1175,41 @@ func StorageServiceItems(mtoShipmentID uuid.UUID, locationType models.SITLocatio {ReService: models.ReService{Code: models.ReServiceCodeDOFSIT}, MTOShipmentID: &mtoShipmentID}} } - if additionalDaysInSIT > 0 { + if locationType == models.SITLocationTypeDestination && !isInternationalShipment { + if additionalDaysInSIT > 0 { + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeDDASIT}, MTOShipmentID: &mtoShipmentID}, + } + } + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}} + } + + // international shipments + if locationType == models.SITLocationTypeOrigin && isInternationalShipment { + if additionalDaysInSIT > 0 { + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeIOFSIT}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeIOASIT}, MTOShipmentID: &mtoShipmentID}, + } + } return []models.MTOServiceItem{ - {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}, - {ReService: models.ReService{Code: models.ReServiceCodeDDASIT}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeIOFSIT}, MTOShipmentID: &mtoShipmentID}} + } + + if locationType == models.SITLocationTypeDestination && isInternationalShipment { + if additionalDaysInSIT > 0 { + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeIDFSIT}, MTOShipmentID: &mtoShipmentID}, + {ReService: models.ReService{Code: models.ReServiceCodeIDASIT}, MTOShipmentID: &mtoShipmentID}, + } } + return []models.MTOServiceItem{ + {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}} } - return []models.MTOServiceItem{ - {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}} + return nil } // paramsForServiceCode filters the list of all service params for service items, to only those matching the service diff --git a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx index 603305cd7c2..2344a110ab2 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx @@ -62,6 +62,9 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat const isCivilian = grade === 'CIVILIAN_EMPLOYEE'; const renderHaulType = (haulType) => { + if (haulType === '') { + return null; + } return haulType === HAUL_TYPES.LINEHAUL ? 'Linehaul' : 'Shorthaul'; }; // check if the itemName is one of the items recalulated after item edit(updatedItemName). @@ -268,16 +271,18 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat case sectionTypes.incentiveFactors: return (
-
- - - {isFetchingItems && isRecalulatedItem('haulPrice') ? ( - - ) : ( - `$${formatCents(sectionInfo.haulPrice)}` - )} - -
+ {sectionInfo.haulPrice > 0 ?? ( +
+ + + {isFetchingItems && isRecalulatedItem('haulPrice') ? ( + + ) : ( + `$${formatCents(sectionInfo.haulPrice)}` + )} + +
+ )}
@@ -291,52 +296,92 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat )}
+ {sectionInfo.packPrice > 0 ?? ( +
+ + + {isFetchingItems && isRecalulatedItem('packPrice') ? ( + + ) : ( + `$${formatCents(sectionInfo.packPrice)}` + )} + +
+ )} + {sectionInfo.unpackPrice > 0 ?? ( +
+ + + {isFetchingItems && isRecalulatedItem('unpackPrice') ? ( + + ) : ( + `$${formatCents(sectionInfo.unpackPrice)}` + )} + +
+ )} + {sectionInfo.dop > 0 ?? ( +
+ + + {isFetchingItems && isRecalulatedItem('dop') ? ( + + ) : ( + `$${formatCents(sectionInfo.dop)}` + )} + +
+ )} + {sectionInfo.ddp > 0 ?? ( +
+ + + {isFetchingItems && isRecalulatedItem('ddp') ? ( + + ) : ( + `$${formatCents(sectionInfo.ddp)}` + )} + +
+ )}
- - - {isFetchingItems && isRecalulatedItem('packPrice') ? ( - - ) : ( - `$${formatCents(sectionInfo.packPrice)}` - )} - -
-
- - - {isFetchingItems && isRecalulatedItem('unpackPrice') ? ( + + + {isFetchingItems && isRecalulatedItem('intlPackPrice') ? ( ) : ( - `$${formatCents(sectionInfo.unpackPrice)}` + `$${formatCents(sectionInfo.intlPackPrice)}` )}
- - - {isFetchingItems && isRecalulatedItem('dop') ? ( + + + {isFetchingItems && isRecalulatedItem('intlUnpackPrice') ? ( ) : ( - `$${formatCents(sectionInfo.dop)}` + `$${formatCents(sectionInfo.intlUnpackPrice)}` )}
- - - {isFetchingItems && isRecalulatedItem('ddp') ? ( + + + {isFetchingItems && isRecalulatedItem('intlLinehaulPrice') ? ( ) : ( - `$${formatCents(sectionInfo.ddp)}` + `$${formatCents(sectionInfo.intlLinehaulPrice)}` )}
-
- - - ${formatCents(sectionInfo.sitReimbursement)} - -
+ {sectionInfo.sitReimbursement > 0 ?? ( +
+ + + ${formatCents(sectionInfo.sitReimbursement)} + +
+ )}
); diff --git a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx index 955389774cd..03a81392151 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx @@ -10,6 +10,7 @@ import LoadingPlaceholder from 'shared/LoadingPlaceholder'; import SomethingWentWrong from 'shared/SomethingWentWrong'; import { usePPMCloseoutQuery } from 'hooks/queries'; import { formatCustomerContactFullAddress } from 'utils/formatters'; +import { INTL_PPM_PORT_INFO } from 'shared/constants'; const GCCAndIncentiveInfo = ({ ppmShipmentInfo, updatedItemName, setUpdatedItemName, readOnly }) => { const { ppmCloseout, isLoading, isError } = usePPMCloseoutQuery(ppmShipmentInfo.id); @@ -36,6 +37,9 @@ const GCCAndIncentiveInfo = ({ ppmShipmentInfo, updatedItemName, setUpdatedItemN dop: ppmCloseout.dop, ddp: ppmCloseout.ddp, sitReimbursement: ppmCloseout.SITReimbursement, + intlPackPrice: ppmCloseout.intlPackPrice, + intlUnpackPrice: ppmCloseout.intlUnpackPrice, + intlLinehaulPrice: ppmCloseout.intlLinehaulPrice, }; return ( @@ -75,6 +79,7 @@ export default function PPMHeaderSummary({ ppmShipmentInfo, order, ppmNumber, sh : '—', pickupAddressObj: ppmShipmentInfo.pickupAddress, destinationAddressObj: ppmShipmentInfo.destinationAddress, + port: INTL_PPM_PORT_INFO, miles: ppmShipmentInfo.miles, estimatedWeight: ppmShipmentInfo.estimatedWeight, actualWeight: ppmShipmentInfo.actualWeight, diff --git a/src/shared/constants.js b/src/shared/constants.js index 884691d5c3c..6f2752d8016 100644 --- a/src/shared/constants.js +++ b/src/shared/constants.js @@ -236,4 +236,9 @@ const ADDRESS_LABELS_MAP = { [ADDRESS_TYPES.THIRD_DESTINATION]: 'Third Delivery Address', }; +export const INTL_PPM_PORT_INFO = { + portName: 'Tacoma, WA', + portZip: '98424', +}; + export const getAddressLabel = (type) => ADDRESS_LABELS_MAP[type]; diff --git a/swagger-def/definitions/PPMCloseout.yaml b/swagger-def/definitions/PPMCloseout.yaml index 20203d0e4e7..f7b420a0e7b 100644 --- a/swagger-def/definitions/PPMCloseout.yaml +++ b/swagger-def/definitions/PPMCloseout.yaml @@ -6,7 +6,6 @@ properties: format: uuid type: string readOnly: true - plannedMoveDate: description: > Date the customer expects to begin their move. @@ -27,32 +26,27 @@ properties: type: integer x-nullable: true x-omitempty: false - estimatedWeight: description: The estimated weight of the PPM shipment goods being moved. type: integer example: 4200 x-nullable: true x-omitempty: false - actualWeight: example: 2000 type: integer x-nullable: true x-omitempty: false - proGearWeightCustomer: description: The estimated weight of the pro-gear being moved belonging to the service member. type: integer x-nullable: true x-omitempty: false - proGearWeightSpouse: description: The estimated weight of the pro-gear being moved belonging to a spouse. type: integer x-nullable: true x-omitempty: false - grossIncentive: description: > The final calculated incentive for the PPM shipment. This does not include **SIT** as it is a reimbursement. @@ -61,7 +55,6 @@ properties: x-nullable: true x-omitempty: false readOnly: true - gcc: description: Government Constructive Cost (GCC) type: integer @@ -69,75 +62,82 @@ properties: format: cents x-nullable: true x-omitempty: false - aoa: description: Advance Operating Allowance (AOA). type: integer format: cents x-nullable: true x-omitempty: false - remainingIncentive: description: The remaining reimbursement amount that is still owed to the customer. type: integer format: cents x-nullable: true x-omitempty: false - haulType: description: The type of haul calculation used for this shipment (shorthaul or linehaul). type: string x-nullable: true x-omitempty: false - haulPrice: description: The price of the linehaul or shorthaul. type: integer format: cents x-nullable: true x-omitempty: false - haulFSC: description: The linehaul/shorthaul Fuel Surcharge (FSC). type: integer format: cents x-nullable: true x-omitempty: false - dop: description: The Domestic Origin Price (DOP). type: integer format: cents x-nullable: true x-omitempty: false - ddp: description: The Domestic Destination Price (DDP). type: integer format: cents x-nullable: true x-omitempty: false - packPrice: description: The full price of all packing/unpacking services. type: integer format: cents x-nullable: true x-omitempty: false - unpackPrice: description: The full price of all packing/unpacking services. type: integer format: cents x-nullable: true x-omitempty: false - + intlPackPrice: + description: The full price of international packing (IHPK) + type: integer + format: cents + x-nullable: true + x-omitempty: false + intlUnpackPrice: + description: The full price of international unpacking (IHUPK) + type: integer + format: cents + x-nullable: true + x-omitempty: false + intlLinehaulPrice: + description: The full price of international shipping and linehaul (ISLH) + type: integer + format: cents + x-nullable: true + x-omitempty: false SITReimbursement: description: The estimated amount that the government will pay the service member to put their goods into storage. This estimated storage cost is separate from the estimated incentive. type: integer format: cents x-nullable: true x-omitempty: false - required: - id diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index e40e0aaa1eb..945523f20de 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -10929,6 +10929,24 @@ definitions: format: cents x-nullable: true x-omitempty: false + intlPackPrice: + description: The full price of international packing (IHPK) + type: integer + format: cents + x-nullable: true + x-omitempty: false + intlUnpackPrice: + description: The full price of international unpacking (IHUPK) + type: integer + format: cents + x-nullable: true + x-omitempty: false + intlLinehaulPrice: + description: The full price of international shipping and linehaul (ISLH) + type: integer + format: cents + x-nullable: true + x-omitempty: false SITReimbursement: description: >- The estimated amount that the government will pay the service member From 5b30fcdd738f7db3278c63e27710f2aa320aa3a9 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Fri, 17 Jan 2025 22:38:56 +0000 Subject: [PATCH 050/229] test updates for 21977 --- .../AddOrdersForm/AddOrdersForm.test.jsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index 91357ff5db9..639d617de43 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -170,7 +170,7 @@ describe('CreateMoveCustomerInfo Component', () => { , ); - const ordersTypeDropdown = getByLabelText('Orders type'); + const ordersTypeDropdown = getByLabelText(/Orders type/); expect(ordersTypeDropdown).toBeInstanceOf(HTMLSelectElement); await userEvent.selectOptions(ordersTypeDropdown, ORDERS_TYPE.PERMANENT_CHANGE_OF_STATION); @@ -277,7 +277,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = , ); - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.STUDENT_TRAVEL); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.STUDENT_TRAVEL); const hasDependentsYes = screen.getByLabelText('Yes'); const hasDependentsNo = screen.getByLabelText('No'); @@ -298,7 +298,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = , ); - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.EARLY_RETURN_OF_DEPENDENTS); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.EARLY_RETURN_OF_DEPENDENTS); const hasDependentsYes = screen.getByLabelText('Yes'); const hasDependentsNo = screen.getByLabelText('No'); @@ -318,7 +318,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = , ); - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.PERMANENT_CHANGE_OF_STATION); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.PERMANENT_CHANGE_OF_STATION); const hasDependentsYesPermChg = screen.getByLabelText('Yes'); const hasDependentsNoPermChg = screen.getByLabelText('No'); @@ -331,7 +331,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = }); // set order type to value that disables and defaults "has dependents" - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.STUDENT_TRAVEL); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.STUDENT_TRAVEL); const hasDependentsYesStudent = screen.getByLabelText('Yes'); const hasDependentsNoStudent = screen.getByLabelText('No'); @@ -343,7 +343,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = }); // set order type to value the re-enables "has dependents" - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.LOCAL_MOVE); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.LOCAL_MOVE); const hasDependentsYesLocalMove = screen.getByLabelText('Yes'); const hasDependentsNoLocalMove = screen.getByLabelText('No'); @@ -365,7 +365,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = , ); - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.PERMANENT_CHANGE_OF_STATION); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.PERMANENT_CHANGE_OF_STATION); const hasDependentsYesPermChg = screen.getByLabelText('Yes'); const hasDependentsNoPermChg = screen.getByLabelText('No'); @@ -378,7 +378,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = }); // set order type to value that disables and defaults "has dependents" - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.EARLY_RETURN_OF_DEPENDENTS); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.EARLY_RETURN_OF_DEPENDENTS); const hasDependentsYesEarly = screen.getByLabelText('Yes'); const hasDependentsNoEarly = screen.getByLabelText('No'); @@ -390,7 +390,7 @@ describe('AddOrdersForm - Student Travel, Early Return of Dependents Test', () = }); // set order type to value the re-enables "has dependents" - await userEvent.selectOptions(screen.getByLabelText('Orders type'), ORDERS_TYPE.LOCAL_MOVE); + await userEvent.selectOptions(screen.getByLabelText(/Orders type/), ORDERS_TYPE.LOCAL_MOVE); const hasDependentsYesLocalMove = screen.getByLabelText('Yes'); const hasDependentsNoLocalMove = screen.getByLabelText('No'); From 4ef9c368e45f17959964626639826c9cb98e1da6 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Mon, 20 Jan 2025 14:32:32 +0000 Subject: [PATCH 051/229] some minor cleanup --- ...52_add_ppm_estimated_incentive_proc.up.sql | 6 ++ pkg/models/ppm_shipment.go | 6 +- pkg/services/ppm_closeout/ppm_closeout.go | 63 +++---------------- pkg/services/ppmshipment/ppm_estimator.go | 12 ++-- 4 files changed, 22 insertions(+), 65 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index 5aff4a61dd3..8b03c4fefed 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -22,10 +22,16 @@ INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,u DELETE FROM service_params WHERE service_item_param_key_id = '6d44624c-b91b-4226-8fcd-98046e2f433d'; +DELETE FROM service_item_param_keys +WHERE key = 'PriceAreaIntlOrigin'; + -- remove PriceAreaIntlDest, we don't need it DELETE FROM service_params WHERE service_item_param_key_id = '4736f489-dfda-4df1-a303-8c434a120d5d'; +DELETE FROM service_item_param_keys +WHERE key = 'PriceAreaIntlDest'; + -- func to fetch a service id from re_services by providing the service code CREATE OR REPLACE FUNCTION get_service_id(service_code TEXT) RETURNS UUID AS $$ DECLARE diff --git a/pkg/models/ppm_shipment.go b/pkg/models/ppm_shipment.go index 4506451053a..d53bdb5b3ac 100644 --- a/pkg/models/ppm_shipment.go +++ b/pkg/models/ppm_shipment.go @@ -324,7 +324,7 @@ func FetchPPMShipmentByPPMShipmentID(db *pop.Connection, ppmShipmentID uuid.UUID return &ppmShipment, nil } -type PPMIncentive struct { +type PPMIncentiveOCONUS struct { TotalIncentive int `db:"total_incentive"` PriceISLH int `db:"price_islh"` PriceIHPK int `db:"price_ihpk"` @@ -334,8 +334,8 @@ type PPMIncentive struct { // a db function that will handle updating the estimated_incentive value // this simulates pricing of a basic iHHG shipment with ISLH, IHPK, IHUPK, and the CONUS portion for a FSC -func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (*PPMIncentive, error) { - var incentive PPMIncentive +func CalculatePPMIncentive(db *pop.Connection, ppmID uuid.UUID, pickupAddressID uuid.UUID, destAddressID uuid.UUID, moveDate time.Time, mileage int, weight int, isEstimated bool, isActual bool, isMax bool) (*PPMIncentiveOCONUS, error) { + var incentive PPMIncentiveOCONUS err := db.RawQuery("SELECT * FROM calculate_ppm_incentive($1, $2, $3, $4, $5, $6, $7, $8, $9)", ppmID, pickupAddressID, destAddressID, moveDate, mileage, weight, isEstimated, isActual, isMax). First(&incentive) diff --git a/pkg/services/ppm_closeout/ppm_closeout.go b/pkg/services/ppm_closeout/ppm_closeout.go index 55707b91190..7ced6a8c257 100644 --- a/pkg/services/ppm_closeout/ppm_closeout.go +++ b/pkg/services/ppm_closeout/ppm_closeout.go @@ -255,53 +255,6 @@ func (p *ppmCloseoutFetcher) GetExpenseStoragePrice(appCtx appcontext.AppContext return storageExpensePrice, err } -func (p *ppmCloseoutFetcher) GetEntitlement(appCtx appcontext.AppContext, moveID uuid.UUID) (*models.Entitlement, error) { - var moveModel models.Move - err := appCtx.DB().EagerPreload( - "OrdersID", - ).Find(&moveModel, moveID) - - if err != nil { - switch err { - case sql.ErrNoRows: - return nil, apperror.NewNotFoundError(moveID, "while looking for Move") - default: - return nil, apperror.NewQueryError("Move", err, "unable to find Move") - } - } - - var order models.Order - orderID := &moveModel.OrdersID - errOrder := appCtx.DB().EagerPreload( - "EntitlementID", - ).Find(&order, orderID) - - if errOrder != nil { - switch errOrder { - case sql.ErrNoRows: - return nil, apperror.NewNotFoundError(*orderID, "while looking for Order") - default: - return nil, apperror.NewQueryError("Order", errOrder, "unable to find Order") - } - } - - var entitlement models.Entitlement - entitlementID := order.EntitlementID - errEntitlement := appCtx.DB().EagerPreload( - "DBAuthorizedWeight", - ).Find(&entitlement, entitlementID) - - if errEntitlement != nil { - switch errEntitlement { - case sql.ErrNoRows: - return nil, apperror.NewNotFoundError(*entitlementID, "while looking for Entitlement") - default: - return nil, apperror.NewQueryError("Entitlement", errEntitlement, "unable to find Entitlement") - } - } - return &entitlement, nil -} - func paramsForServiceCode(code models.ReServiceCode, serviceParams models.ServiceParams) models.ServiceParams { var serviceItemParams models.ServiceParams for _, serviceParam := range serviceParams { @@ -318,17 +271,12 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, var returnPriceObj serviceItemPrices logger := appCtx.Logger() - err := appCtx.DB().Where("mto_shipment_id = ?", ppmShipment.ShipmentID).All(&serviceItemsToPrice) - if err != nil { - return serviceItemPrices{}, err - } - isInternationalShipment := ppmShipment.Shipment.MarketCode == models.MarketCodeInternational serviceItemsToPrice = ppmshipment.BaseServiceItems(ppmShipment) actualPickupPostal := *ppmShipment.ActualPickupPostalCode actualDestPostal := *ppmShipment.ActualDestinationPostalCode - // Change DLH to DSH if move within same Zip3 + // Change DLH to DSH if move within same Zip3 (only for domestic shipments - intl uses ISLH) if !isInternationalShipment && actualPickupPostal[0:3] == actualDestPostal[0:3] { serviceItemsToPrice[0] = models.MTOServiceItem{ReService: models.ReService{Code: models.ReServiceCodeDSH}, MTOShipmentID: &ppmShipment.ShipmentID} } @@ -342,10 +290,12 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, if paramErr != nil { return serviceItemPrices{}, paramErr } + var totalPrice, packPrice, unpackPrice, destinationPrice, originPrice, haulPrice, haulFSC, intlPackPrice, intlUnpackPrice, intlLinehaulPrice unit.Cents var totalWeight unit.Pound var ppmToMtoShipment models.MTOShipment + // adding all the weight tickets together to get the total weight of the moved PPM if len(ppmShipment.WeightTickets) >= 1 { for _, weightTicket := range ppmShipment.WeightTickets { if weightTicket.Status != nil && *weightTicket.Status == models.PPMDocumentStatusRejected { @@ -380,6 +330,7 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, return serviceItemPrices{}, err } + // combo of domestic & int'l service items validCodes := map[models.ReServiceCode]string{ models.ReServiceCodeDPK: "DPK", models.ReServiceCodeDUPK: "DUPK", @@ -462,11 +413,11 @@ func (p *ppmCloseoutFetcher) getServiceItemPrices(appCtx appcontext.AppContext, totalPrice = totalPrice.AddCents(centsValue) switch serviceItem.ReService.Code { - case models.ReServiceCodeIHPK: + case models.ReServiceCodeIHPK: // Int'l pack intlPackPrice += centsValue - case models.ReServiceCodeIHUPK: + case models.ReServiceCodeIHUPK: // Int'l unpack intlUnpackPrice += centsValue - case models.ReServiceCodeISLH: + case models.ReServiceCodeISLH: // Int'l shipping & linehaul intlLinehaulPrice += centsValue case models.ReServiceCodeDPK: packPrice += centsValue diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 04378ce97dc..c6890497e87 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -257,7 +257,7 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip newPPMShipment.HasRequestedAdvance = nil newPPMShipment.AdvanceAmountRequested = nil - estimatedIncentive, err = f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) + estimatedIncentive, err = f.CalculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) if err != nil { return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } @@ -274,7 +274,7 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip return estimatedIncentive, estimatedSITCost, nil } daysInSIT := additionalDaysInSIT(*newPPMShipment.SITEstimatedEntryDate, *newPPMShipment.SITEstimatedDepartureDate) - estimatedSITCost, err = f.calculateOCONUSSITCosts(appCtx, newPPMShipment.ID, sitAddress.ID, isOrigin, contractDate, newPPMShipment.EstimatedWeight.Int(), daysInSIT) + estimatedSITCost, err = f.CalculateOCONUSSITCosts(appCtx, newPPMShipment.ID, sitAddress.ID, isOrigin, contractDate, newPPMShipment.EstimatedWeight.Int(), daysInSIT) if err != nil { return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } @@ -330,7 +330,7 @@ func (f *estimatePPM) maxIncentive(appCtx appcontext.AppContext, oldPPMShipment pickupAddress := orders.OriginDutyLocation.Address destinationAddress := orders.NewDutyLocation.Address - maxIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, pickupAddress, destinationAddress, contractDate, *orders.Entitlement.DBAuthorizedWeight, false, false, true) + maxIncentive, err := f.CalculateOCONUSIncentive(appCtx, newPPMShipment.ID, pickupAddress, destinationAddress, contractDate, *orders.Entitlement.DBAuthorizedWeight, false, false, true) if err != nil { return nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } @@ -395,7 +395,7 @@ func (f *estimatePPM) finalIncentive(appCtx appcontext.AppContext, oldPPMShipmen // we can't calculate actual incentive without the weight if newTotalWeight != 0 { - finalIncentive, err := f.calculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newTotalWeight.Int(), false, true, false) + finalIncentive, err := f.CalculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newTotalWeight.Int(), false, true, false) if err != nil { return nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } @@ -767,7 +767,7 @@ func (f estimatePPM) priceBreakdown(appCtx appcontext.AppContext, ppmShipment *m // function for calculating incentives for OCONUS PPM shipments // this uses a db function that takes in values needed to come up with the estimated/actual/max incentives // this simulates the reimbursement for an iHHG move with ISLH, IHPK, IHUPK, and CONUS portion of FSC -func (f *estimatePPM) calculateOCONUSIncentive(appCtx appcontext.AppContext, ppmShipmentID uuid.UUID, pickupAddress models.Address, destinationAddress models.Address, moveDate time.Time, weight int, isEstimated bool, isActual bool, isMax bool) (*unit.Cents, error) { +func (f *estimatePPM) CalculateOCONUSIncentive(appCtx appcontext.AppContext, ppmShipmentID uuid.UUID, pickupAddress models.Address, destinationAddress models.Address, moveDate time.Time, weight int, isEstimated bool, isActual bool, isMax bool) (*unit.Cents, error) { var mileage int ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") // Tacoma, WA port if err != nil { @@ -807,7 +807,7 @@ func (f *estimatePPM) calculateOCONUSIncentive(appCtx appcontext.AppContext, ppm return (*unit.Cents)(&incentive.TotalIncentive), nil } -func (f *estimatePPM) calculateOCONUSSITCosts(appCtx appcontext.AppContext, ppmID uuid.UUID, addressID uuid.UUID, isOrigin bool, moveDate time.Time, weight int, sitDays int) (*unit.Cents, error) { +func (f *estimatePPM) CalculateOCONUSSITCosts(appCtx appcontext.AppContext, ppmID uuid.UUID, addressID uuid.UUID, isOrigin bool, moveDate time.Time, weight int, sitDays int) (*unit.Cents, error) { if sitDays <= 0 { return nil, fmt.Errorf("SIT days must be greater than zero") } From 30267445acd54e30f7ea035cf0c0f099035124ab Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 20 Jan 2025 15:29:01 +0000 Subject: [PATCH 052/229] removed references to old equals sign in unit tests --- .../ServiceItemCalculations.test.jsx | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.test.jsx b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.test.jsx index 79a3704f074..7d7f1bf62c5 100644 --- a/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.test.jsx +++ b/src/components/Office/ServiceItemCalculations/ServiceItemCalculations.test.jsx @@ -77,10 +77,8 @@ describe('ServiceItemCalculations DLH', () => { it('renders icons', () => { const wrapper = serviceItemCalculationsLarge; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(3); - expect(equalsIcons.length).toBe(1); }); }); @@ -96,10 +94,8 @@ describe('ServiceItemCalculations DLH', () => { it('renders no icons', () => { const wrapper = serviceItemCalculationsSmall; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(0); - expect(equalsIcons.length).toBe(0); }); }); @@ -162,10 +158,8 @@ describe('ServiceItemCalculations DCRT', () => { it('renders icons', () => { const wrapper = serviceItemCalculationsLarge; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(2); - expect(equalsIcons.length).toBe(1); }); }); @@ -181,10 +175,8 @@ describe('ServiceItemCalculations DCRT', () => { it('renders no icons', () => { const wrapper = serviceItemCalculationsSmall; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(0); - expect(equalsIcons.length).toBe(0); }); }); @@ -248,10 +240,8 @@ describe('ServiceItemCalculations DUCRT', () => { it('renders icons', () => { const wrapper = serviceItemCalculationsLarge; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(2); - expect(equalsIcons.length).toBe(1); }); }); @@ -267,10 +257,8 @@ describe('ServiceItemCalculations DUCRT', () => { it('renders no icons', () => { const wrapper = serviceItemCalculationsSmall; const timesIcons = wrapper.find('[icon="times"]'); - const equalsIcons = wrapper.find('[icon="equals"]'); expect(timesIcons.length).toBe(0); - expect(equalsIcons.length).toBe(0); }); }); From 558b9b826c32e6f3930aa62c411fc936639a8ed9 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Mon, 20 Jan 2025 16:09:33 +0000 Subject: [PATCH 053/229] B-21659 Update ServiceItemDetails.test.jsx add case for UBP add case for PODFSC add case for POEFSC add case for IUBUPK add case for IUBPK add case for IHUPK add case for IHPK add case for ISLH add case for DUPK --- .../ServiceItemDetails.test.jsx | 96 ++++++++++++------- 1 file changed, 61 insertions(+), 35 deletions(-) diff --git a/src/components/Office/ServiceItemDetails/ServiceItemDetails.test.jsx b/src/components/Office/ServiceItemDetails/ServiceItemDetails.test.jsx index d9267d7e572..fab0ded5351 100644 --- a/src/components/Office/ServiceItemDetails/ServiceItemDetails.test.jsx +++ b/src/components/Office/ServiceItemDetails/ServiceItemDetails.test.jsx @@ -523,44 +523,70 @@ describe('ServiceItemDetails Crating Rejected', () => { }); }); -describe('ServiceItemDetails Estimated Price for DLH, DSH, FSC, DOP, DDP, DPK, DUPK', () => { - it.each([['DLH'], ['DSH'], ['FSC'], ['DOP'], ['DDP'], ['DPK'], ['DUPK']])( - 'renders the formatted estimated price field for the service items', - (code) => { - render( - , - ); - - expect(screen.getByText('Estimated Price:')).toBeInTheDocument(); - expect(screen.getByText('$28.00')).toBeInTheDocument(); - }, - ); +describe('ServiceItemDetails Estimated Price for DLH, DSH, FSC, DOP, DDP, DPK, DUPK, ISLH, IHPK, IHUPK, IUBPK, IUBUPK, POEFSC, PODFSC, UBP', () => { + it.each([ + ['DLH'], + ['DSH'], + ['FSC'], + ['DOP'], + ['DDP'], + ['DPK'], + ['DUPK'], + ['ISLH'], + ['IHPK'], + ['IHUPK'], + ['IUBPK'], + ['IUBUPK'], + ['POEFSC'], + ['PODFSC'], + ['UBP'], + ])('renders the formatted estimated price field for the service item: %s', (code) => { + render( + , + ); + + expect(screen.getByText('Estimated Price:')).toBeInTheDocument(); + expect(screen.getByText('$28.00')).toBeInTheDocument(); + }); const noEstimatePriceDetails = {}; - it.each([['DLH'], ['DSH'], ['FSC'], ['DOP'], ['DDP'], ['DPK'], ['DUPK']])( - 'renders - for estimated price when price is not in details', - (code) => { - render( - , - ); - - expect(screen.getByText('Estimated Price:')).toBeInTheDocument(); - expect(screen.getByText('-')).toBeInTheDocument(); - }, - ); + it.each([ + ['DLH'], + ['DSH'], + ['FSC'], + ['DOP'], + ['DDP'], + ['DPK'], + ['DUPK'], + ['ISLH'], + ['IHPK'], + ['IHUPK'], + ['IUBPK'], + ['IUBUPK'], + ['POEFSC'], + ['PODFSC'], + ['UBP'], + ])('renders - for estimated price when price is not in details for the service item: %s', (code) => { + render( + , + ); + + expect(screen.getByText('Estimated Price:')).toBeInTheDocument(); + expect(screen.getByText('-')).toBeInTheDocument(); + }); }); describe('ServiceItemDetails Price for MS, CS', () => { From 5571ed3632164680cc2af510bf53e035fafd40d4 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Mon, 20 Jan 2025 16:43:25 +0000 Subject: [PATCH 054/229] B-21659 Run make server_generate --- pkg/gen/ghcapi/embedded_spec.go | 10 ++++++++++ swagger/ghc.yaml | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index e0271647ece..2e16e7aa125 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -9445,6 +9445,11 @@ func init() { "format": "date", "x-nullable": true }, + "sort": { + "description": "Sort order for service items to be displayed for a given shipment type.", + "type": "string", + "x-nullable": true + }, "standaloneCrate": { "type": "boolean", "x-nullable": true @@ -26370,6 +26375,11 @@ func init() { "format": "date", "x-nullable": true }, + "sort": { + "description": "Sort order for service items to be displayed for a given shipment type.", + "type": "string", + "x-nullable": true + }, "standaloneCrate": { "type": "boolean", "x-nullable": true diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index e40e0aaa1eb..df930a690de 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -8885,6 +8885,12 @@ definitions: To identify whether the service was provided within (CONUS) or (OCONUS) x-nullable: true + sort: + type: string + description: >- + Sort order for service items to be displayed for a given shipment + type. + x-nullable: true MTOServiceItems: description: A list of service items connected to this shipment. type: array From a4b50e9725a094b940f8893f8b383dc54d3507b3 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Mon, 20 Jan 2025 20:45:59 +0000 Subject: [PATCH 055/229] MAIN-B-22238 First commit Attempt to return nil if the DeletedAt has a non nil value --- pkg/handlers/primeapiv3/payloads/model_to_payload.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index fff27628a51..d67bb63edb2 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -317,6 +317,10 @@ func MTOAgent(mtoAgent *models.MTOAgent) *primev3messages.MTOAgent { return nil } + if mtoAgent.DeletedAt != nil { + return nil + } + return &primev3messages.MTOAgent{ AgentType: primev3messages.MTOAgentType(mtoAgent.MTOAgentType), FirstName: mtoAgent.FirstName, From a36d4715dac632cc8e095e7bb7553b2d495afe60 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Mon, 20 Jan 2025 21:52:55 +0000 Subject: [PATCH 056/229] B-22238 Refactor code Move filtering to MTOAgents payload Make the length of agents slice equal to the number of active agents --- .../primeapiv3/payloads/model_to_payload.go | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index d67bb63edb2..b5e9e5e3b93 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -317,10 +317,6 @@ func MTOAgent(mtoAgent *models.MTOAgent) *primev3messages.MTOAgent { return nil } - if mtoAgent.DeletedAt != nil { - return nil - } - return &primev3messages.MTOAgent{ AgentType: primev3messages.MTOAgentType(mtoAgent.MTOAgentType), FirstName: mtoAgent.FirstName, @@ -341,11 +337,13 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primev3messages.MTOAgents { return nil } - agents := make(primev3messages.MTOAgents, len(*mtoAgents)) + var agents primev3messages.MTOAgents - for i, m := range *mtoAgents { - copyOfM := m // Make copy to avoid implicit memory aliasing of items from a range statement. - agents[i] = MTOAgent(©OfM) + for _, m := range *mtoAgents { + if m.DeletedAt == nil { + copyOfM := m // Make copy to avoid implicit memory aliasing of items from a range statement. + agents = append(agents, MTOAgent(©OfM)) + } } return &agents From 2f1bd06218f8a8e53aee5e4a76f8b7b2a7c9fdde Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Mon, 20 Jan 2025 21:56:34 +0000 Subject: [PATCH 057/229] should all be working and good to go, need to add tests and cleanup --- ...52_add_ppm_estimated_incentive_proc.up.sql | 11 +- pkg/models/re_intl_other_price.go | 34 ++ .../port_zip_lookup.go | 3 +- pkg/services/ghc_rate_engine.go | 32 ++ ..._destination_additional_days_sit_pricer.go | 50 +++ .../intl_destination_first_day_sit_pricer.go | 45 +++ .../intl_origin_additional_days_sit_pricer.go | 50 +++ .../intl_origin_first_day_sit_pricer.go | 45 +++ .../ghcrateengine/pricer_helpers_intl.go | 108 ++++++ .../ghcrateengine/service_item_pricer.go | 8 + pkg/services/ppmshipment/ppm_estimator.go | 350 +++++++++++++----- .../PPM/SitCostBreakdown/SitCostBreakdown.jsx | 28 +- 12 files changed, 652 insertions(+), 112 deletions(-) create mode 100644 pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go create mode 100644 pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer.go create mode 100644 pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer.go create mode 100644 pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer.go diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index 8b03c4fefed..4aecb8a3656 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -1,20 +1,21 @@ --- inserting params for IDFSIT +-- IDFSIT PerUnitCents INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES ('fb7925e7-ebfe-49d9-9cf4-7219e68ec686'::uuid,'bd6064ca-e780-4ab4-a37b-0ae98eebb244','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents --- IDASIT +-- IDASIT PerUnitCents INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES ('51393ee1-f505-4f7b-96c4-135f771af814'::uuid,'806c6d59-57ff-4a3f-9518-ebf29ba9cb10','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents --- IOFSIT +-- IOFSIT PerUnitCents INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES ('7518ec84-0c40-4c17-86dd-3ce04e2fe701'::uuid,'b488bf85-ea5e-49c8-ba5c-e2fa278ac806','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents --- IOASIT +-- IOASIT PerUnitCents INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES ('cff34123-e2a5-40ed-9cf3-451701850a26'::uuid,'bd424e45-397b-4766-9712-de4ae3a2da36','597bb77e-0ce7-4ba2-9624-24300962625f','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',false); -- PerUnitCents --- inserting params for FSC +-- inserting PortZip param for FSC +-- we need this for international PPMs since they only get reimbursed for the CONUS -> Port portion INSERT INTO service_params (id,service_id,service_item_param_key_id,created_at,updated_at,is_optional) VALUES ('bb53e034-80c2-420e-8492-f54d2018fff1'::uuid,'4780b30c-e846-437a-b39a-c499a6b09872','d9ad3878-4b94-4722-bbaf-d4b8080f339d','2024-01-17 15:55:50.041957','2024-01-17 15:55:50.041957',true); -- PortZip diff --git a/pkg/models/re_intl_other_price.go b/pkg/models/re_intl_other_price.go index b8dce673214..b49efa94712 100644 --- a/pkg/models/re_intl_other_price.go +++ b/pkg/models/re_intl_other_price.go @@ -1,6 +1,7 @@ package models import ( + "fmt" "time" "github.com/gobuffalo/pop/v6" @@ -45,3 +46,36 @@ func (r *ReIntlOtherPrice) Validate(_ *pop.Connection) (*validate.Errors, error) &validators.IntIsGreaterThan{Field: r.PerUnitCents.Int(), Name: "PerUnitCents", Compared: -1}, ), nil } + +// fetches a row from re_intl_other_prices using passed in parameters +// gets the rate_area_id & is_peak_period based on values provided +func FetchReIntlOtherPrice(db *pop.Connection, addressID uuid.UUID, serviceID uuid.UUID, contractID uuid.UUID, referenceDate *time.Time) (*ReIntlOtherPrice, error) { + if addressID != uuid.Nil && serviceID != uuid.Nil && contractID != uuid.Nil && referenceDate != nil { + // need to get the rate area first + rateAreaID, err := FetchRateAreaID(db, addressID, serviceID, contractID) + if err != nil { + return nil, fmt.Errorf("error fetching rate area id for shipment ID: %s, service ID %s, and contract ID: %s: %s", addressID, serviceID, contractID, err) + } + + var isPeakPeriod bool + err = db.RawQuery("SELECT is_peak_period($1)", referenceDate).First(&isPeakPeriod) + if err != nil { + return nil, fmt.Errorf("error checking if date is peak period with date: %s: %s", contractID, err) + } + + var reIntlOtherPrice ReIntlOtherPrice + err = db.Q(). + Where("contract_id = ?", contractID). + Where("service_id = ?", serviceID). + Where("is_peak_period = ?", isPeakPeriod). + Where("rate_area_id = ?", rateAreaID). + First(&reIntlOtherPrice) + if err != nil { + return nil, fmt.Errorf("error fetching row from re_int_other_prices using rateAreaID %s, service ID %s, and contract ID: %s: %s", rateAreaID, serviceID, contractID, err) + } + + return &reIntlOtherPrice, nil + } + + return nil, fmt.Errorf("error value from re_intl_other_prices - required parameters not provided") +} diff --git a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go index bf4971f9db2..bade82c04b9 100644 --- a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go @@ -33,8 +33,9 @@ func (p PortZipLookup) lookup(appCtx appcontext.AppContext, keyData *ServiceItem return "", fmt.Errorf("unable to find port zip with code %s", "3002") } return portLocation.UsPostRegionCity.UsprZipID, nil + } else { + return "", nil } - return "", fmt.Errorf("unable to find port zip for service item id: %s", p.ServiceItem.ID) } var portLocation models.PortLocation err := appCtx.DB().Q(). diff --git a/pkg/services/ghc_rate_engine.go b/pkg/services/ghc_rate_engine.go index 2247e3d7426..052956c0c0b 100644 --- a/pkg/services/ghc_rate_engine.go +++ b/pkg/services/ghc_rate_engine.go @@ -264,3 +264,35 @@ type IntlPortFuelSurchargePricer interface { Price(appCtx appcontext.AppContext, actualPickupDate time.Time, distance unit.Miles, weight unit.Pound, fscWeightBasedDistanceMultiplier float64, eiaFuelPrice unit.Millicents) (unit.Cents, PricingDisplayParams, error) ParamsPricer } + +// IntlOriginFirstDaySITPricer prices international origin first day SIT +// +//go:generate mockery --name IntlOriginFirstDaySITPricer +type IntlOriginFirstDaySITPricer interface { + Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, PricingDisplayParams, error) + ParamsPricer +} + +// IntlOriginAdditionalDaySITPricer prices international origin additional days of SIT +// +//go:generate mockery --name IntlOriginAdditionalDaySITPricer +type IntlOriginAdditionalDaySITPricer interface { + Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, PricingDisplayParams, error) + ParamsPricer +} + +// IntlDestinationFirstDaySITPricer prices international destination first day SIT +// +//go:generate mockery --name IntlDestinationFirstDaySITPricer +type IntlDestinationFirstDaySITPricer interface { + Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, PricingDisplayParams, error) + ParamsPricer +} + +// IntlDestinationAdditionalDaySITPricer prices international destination additional days of SIT +// +//go:generate mockery --name IntlDestinationAdditionalDaySITPricer +type IntlDestinationAdditionalDaySITPricer interface { + Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, PricingDisplayParams, error) + ParamsPricer +} diff --git a/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go new file mode 100644 index 00000000000..465099cf73f --- /dev/null +++ b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go @@ -0,0 +1,50 @@ +package ghcrateengine + +import ( + "time" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/unit" +) + +type intlDestinationAdditionalDaySITPricer struct { +} + +func NewIntlDestinationAdditionalDaySITPricer() services.IntlDestinationAdditionalDaySITPricer { + return &intlDestinationAdditionalDaySITPricer{} +} + +func (p intlDestinationAdditionalDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, referenceDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + return priceIntlAdditionalDaySIT(appCtx, models.ReServiceCodeIDASIT, contractCode, referenceDate, numberOfDaysInSIT, weight, perUnitCents) +} + +func (p intlDestinationAdditionalDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + contractCode, err := getParamString(params, models.ServiceItemParamNameContractCode) + if err != nil { + return unit.Cents(0), nil, err + } + + numberOfDaysInSIT, err := getParamInt(params, models.ServiceItemParamNameNumberDaysSIT) + if err != nil { + return unit.Cents(0), nil, err + } + + referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) + if err != nil { + return unit.Cents(0), nil, err + } + + perUnitCents, err := getParamInt(params, models.ServiceItemParamNamePerUnitCents) + if err != nil { + return unit.Cents(0), nil, err + } + + weightBilled, err := getParamInt(params, models.ServiceItemParamNameWeightBilled) + if err != nil { + return unit.Cents(0), nil, err + } + + return p.Price(appCtx, contractCode, referenceDate, numberOfDaysInSIT, unit.Pound(weightBilled), perUnitCents) +} diff --git a/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer.go b/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer.go new file mode 100644 index 00000000000..eb1354ebbd0 --- /dev/null +++ b/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer.go @@ -0,0 +1,45 @@ +package ghcrateengine + +import ( + "time" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/unit" +) + +type intlDestinationFirstDaySITPricer struct { +} + +func NewIntlDestinationFirstDaySITPricer() services.IntlDestinationFirstDaySITPricer { + return &intlDestinationFirstDaySITPricer{} +} + +func (p intlDestinationFirstDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, referenceDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + return priceIntlFirstDaySIT(appCtx, models.ReServiceCodeIDFSIT, contractCode, referenceDate, weight, perUnitCents) +} + +func (p intlDestinationFirstDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + contractCode, err := getParamString(params, models.ServiceItemParamNameContractCode) + if err != nil { + return unit.Cents(0), nil, err + } + + referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) + if err != nil { + return unit.Cents(0), nil, err + } + + perUnitCents, err := getParamInt(params, models.ServiceItemParamNamePerUnitCents) + if err != nil { + return unit.Cents(0), nil, err + } + + weightBilled, err := getParamInt(params, models.ServiceItemParamNameWeightBilled) + if err != nil { + return unit.Cents(0), nil, err + } + + return p.Price(appCtx, contractCode, referenceDate, unit.Pound(weightBilled), perUnitCents) +} diff --git a/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer.go b/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer.go new file mode 100644 index 00000000000..e9b4dc22478 --- /dev/null +++ b/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer.go @@ -0,0 +1,50 @@ +package ghcrateengine + +import ( + "time" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/unit" +) + +type intlOriginAdditionalDaySITPricer struct { +} + +func NewIntlOriginAdditionalDaySITPricer() services.IntlOriginAdditionalDaySITPricer { + return &intlOriginAdditionalDaySITPricer{} +} + +func (p intlOriginAdditionalDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, referenceDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + return priceIntlAdditionalDaySIT(appCtx, models.ReServiceCodeIOASIT, contractCode, referenceDate, numberOfDaysInSIT, weight, perUnitCents) +} + +func (p intlOriginAdditionalDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + contractCode, err := getParamString(params, models.ServiceItemParamNameContractCode) + if err != nil { + return unit.Cents(0), nil, err + } + + referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) + if err != nil { + return unit.Cents(0), nil, err + } + + numberOfDaysInSIT, err := getParamInt(params, models.ServiceItemParamNameNumberDaysSIT) + if err != nil { + return unit.Cents(0), nil, err + } + + perUnitCents, err := getParamInt(params, models.ServiceItemParamNamePerUnitCents) + if err != nil { + return unit.Cents(0), nil, err + } + + weightBilled, err := getParamInt(params, models.ServiceItemParamNameWeightBilled) + if err != nil { + return unit.Cents(0), nil, err + } + + return p.Price(appCtx, contractCode, referenceDate, numberOfDaysInSIT, unit.Pound(weightBilled), perUnitCents) +} diff --git a/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer.go b/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer.go new file mode 100644 index 00000000000..2070d13835b --- /dev/null +++ b/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer.go @@ -0,0 +1,45 @@ +package ghcrateengine + +import ( + "time" + + "github.com/transcom/mymove/pkg/appcontext" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/unit" +) + +type intlOriginFirstDaySITPricer struct { +} + +func NewIntlOriginFirstDaySITPricer() services.IntlOriginFirstDaySITPricer { + return &intlOriginFirstDaySITPricer{} +} + +func (p intlOriginFirstDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, referenceDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + return priceIntlFirstDaySIT(appCtx, models.ReServiceCodeIOFSIT, contractCode, referenceDate, weight, perUnitCents) +} + +func (p intlOriginFirstDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + contractCode, err := getParamString(params, models.ServiceItemParamNameContractCode) + if err != nil { + return unit.Cents(0), nil, err + } + + referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) + if err != nil { + return unit.Cents(0), nil, err + } + + perUnitCents, err := getParamInt(params, models.ServiceItemParamNamePerUnitCents) + if err != nil { + return unit.Cents(0), nil, err + } + + weightBilled, err := getParamInt(params, models.ServiceItemParamNameWeightBilled) + if err != nil { + return unit.Cents(0), nil, err + } + + return p.Price(appCtx, contractCode, referenceDate, unit.Pound(weightBilled), perUnitCents) +} diff --git a/pkg/services/ghcrateengine/pricer_helpers_intl.go b/pkg/services/ghcrateengine/pricer_helpers_intl.go index 924dad55537..bb49759504f 100644 --- a/pkg/services/ghcrateengine/pricer_helpers_intl.go +++ b/pkg/services/ghcrateengine/pricer_helpers_intl.go @@ -64,3 +64,111 @@ func priceIntlPackUnpack(appCtx appcontext.AppContext, packUnpackCode models.ReS return totalCost, displayParams, nil } + +func priceIntlFirstDaySIT(appCtx appcontext.AppContext, firstDaySITCode models.ReServiceCode, contractCode string, referenceDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + if firstDaySITCode != models.ReServiceCodeIOFSIT && firstDaySITCode != models.ReServiceCodeIDFSIT { + return 0, nil, fmt.Errorf("unsupported pack/unpack code of %s", firstDaySITCode) + } + if len(contractCode) == 0 { + return 0, nil, errors.New("ContractCode is required") + } + if referenceDate.IsZero() { + return 0, nil, errors.New("ReferenceDate is required") + } + if perUnitCents == 0 { + return 0, nil, errors.New("PerUnitCents is required") + } + + isPeakPeriod := IsPeakPeriod(referenceDate) + + contract, err := fetchContractByContractCode(appCtx, contractCode) + if err != nil { + return 0, nil, fmt.Errorf("could not find contract with code: %s: %w", contractCode, err) + } + + basePrice := float64(perUnitCents) + escalatedPrice, contractYear, err := escalatePriceForContractYear(appCtx, contract.ID, referenceDate, false, basePrice) + if err != nil { + return 0, nil, fmt.Errorf("could not calculate escalated price: %w", err) + } + + escalatedPrice = escalatedPrice * weight.ToCWTFloat64() + totalCost := unit.Cents(math.Round(escalatedPrice)) + + displayParams := services.PricingDisplayParams{ + { + Key: models.ServiceItemParamNameContractYearName, + Value: contractYear.Name, + }, + { + Key: models.ServiceItemParamNamePriceRateOrFactor, + Value: FormatCents(unit.Cents(perUnitCents)), + }, + { + Key: models.ServiceItemParamNameIsPeak, + Value: FormatBool(isPeakPeriod), + }, + { + Key: models.ServiceItemParamNameEscalationCompounded, + Value: FormatEscalation(contractYear.EscalationCompounded), + }, + } + + return totalCost, displayParams, nil +} + +func priceIntlAdditionalDaySIT(appCtx appcontext.AppContext, additionalDaySITCode models.ReServiceCode, contractCode string, referenceDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + if additionalDaySITCode != models.ReServiceCodeIOASIT && additionalDaySITCode != models.ReServiceCodeIDASIT { + return 0, nil, fmt.Errorf("unsupported additional day of SIT code of %s", additionalDaySITCode) + } + if len(contractCode) == 0 { + return 0, nil, errors.New("ContractCode is required") + } + if referenceDate.IsZero() { + return 0, nil, errors.New("ReferenceDate is required") + } + if numberOfDaysInSIT == 0 { + return 0, nil, errors.New("NumberDaysSIT is required") + } + if perUnitCents == 0 { + return 0, nil, errors.New("PerUnitCents is required") + } + + isPeakPeriod := IsPeakPeriod(referenceDate) + + contract, err := fetchContractByContractCode(appCtx, contractCode) + if err != nil { + return 0, nil, fmt.Errorf("could not find contract with code: %s: %w", contractCode, err) + } + + basePrice := float64(perUnitCents) + escalatedPrice, contractYear, err := escalatePriceForContractYear(appCtx, contract.ID, referenceDate, false, basePrice) + if err != nil { + return 0, nil, fmt.Errorf("could not calculate escalated price: %w", err) + } + + escalatedPrice = escalatedPrice * weight.ToCWTFloat64() + totalForNumberOfDaysPrice := escalatedPrice * float64(numberOfDaysInSIT) + totalCost := unit.Cents(math.Round(totalForNumberOfDaysPrice)) + + displayParams := services.PricingDisplayParams{ + { + Key: models.ServiceItemParamNameContractYearName, + Value: contractYear.Name, + }, + { + Key: models.ServiceItemParamNamePriceRateOrFactor, + Value: FormatCents(unit.Cents(perUnitCents)), + }, + { + Key: models.ServiceItemParamNameIsPeak, + Value: FormatBool(isPeakPeriod), + }, + { + Key: models.ServiceItemParamNameEscalationCompounded, + Value: FormatEscalation(contractYear.EscalationCompounded), + }, + } + + return totalCost, displayParams, nil +} diff --git a/pkg/services/ghcrateengine/service_item_pricer.go b/pkg/services/ghcrateengine/service_item_pricer.go index a673f832b63..9f34aea64e4 100644 --- a/pkg/services/ghcrateengine/service_item_pricer.go +++ b/pkg/services/ghcrateengine/service_item_pricer.go @@ -103,6 +103,14 @@ func PricerForServiceItem(serviceCode models.ReServiceCode) (services.ParamsPric return NewPortFuelSurchargePricer(), nil case models.ReServiceCodePODFSC: return NewPortFuelSurchargePricer(), nil + case models.ReServiceCodeIOFSIT: + return NewIntlOriginFirstDaySITPricer(), nil + case models.ReServiceCodeIOASIT: + return NewIntlOriginAdditionalDaySITPricer(), nil + case models.ReServiceCodeIDFSIT: + return NewIntlDestinationFirstDaySITPricer(), nil + case models.ReServiceCodeIDASIT: + return NewIntlDestinationAdditionalDaySITPricer(), nil default: // TODO: We may want a different error type here after all pricers have been implemented return nil, apperror.NewNotImplementedError(fmt.Sprintf("pricer not found for code %s", serviceCode)) diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index c6890497e87..1d3d4916f43 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -825,39 +825,56 @@ func (f *estimatePPM) CalculateOCONUSSITCosts(appCtx appcontext.AppContext, ppmI } func CalculateSITCost(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, error) { - logger := appCtx.Logger() - additionalDaysInSIT := additionalDaysInSIT(*ppmShipment.SITEstimatedEntryDate, *ppmShipment.SITEstimatedDepartureDate) - serviceItemsToPrice := StorageServiceItems(*ppmShipment, *ppmShipment.SITLocation, additionalDaysInSIT) + if ppmShipment.Shipment.MarketCode != models.MarketCodeInternational { + logger := appCtx.Logger() - totalPrice := unit.Cents(0) - for _, serviceItem := range serviceItemsToPrice { - pricer, err := ghcrateengine.PricerForServiceItem(serviceItem.ReService.Code) - if err != nil { - logger.Error("unable to find pricer for service item", zap.Error(err)) - return nil, err + serviceItemsToPrice := StorageServiceItems(*ppmShipment, *ppmShipment.SITLocation, additionalDaysInSIT) + + totalPrice := unit.Cents(0) + for _, serviceItem := range serviceItemsToPrice { + pricer, err := ghcrateengine.PricerForServiceItem(serviceItem.ReService.Code) + if err != nil { + logger.Error("unable to find pricer for service item", zap.Error(err)) + return nil, err + } + + var price *unit.Cents + switch serviceItemPricer := pricer.(type) { + case services.DomesticOriginFirstDaySITPricer, services.DomesticDestinationFirstDaySITPricer: + price, _, err = priceFirstDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract) + case services.DomesticOriginAdditionalDaysSITPricer, services.DomesticDestinationAdditionalDaysSITPricer: + price, _, err = priceAdditionalDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, additionalDaysInSIT, contract) + default: + return nil, fmt.Errorf("unknown SIT pricer type found for service item code %s", serviceItem.ReService.Code) + } + + if err != nil { + return nil, err + } + + logger.Debug(fmt.Sprintf("Price of service item %s %d", serviceItem.ReService.Code, *price)) + totalPrice += *price } - var price *unit.Cents - switch serviceItemPricer := pricer.(type) { - case services.DomesticOriginFirstDaySITPricer, services.DomesticDestinationFirstDaySITPricer: - price, _, err = priceFirstDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract) - case services.DomesticOriginAdditionalDaysSITPricer, services.DomesticDestinationAdditionalDaysSITPricer: - price, _, err = priceAdditionalDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, additionalDaysInSIT, contract) - default: - return nil, fmt.Errorf("unknown SIT pricer type found for service item code %s", serviceItem.ReService.Code) + return &totalPrice, nil + } else { + var sitAddress models.Address + isOrigin := *ppmShipment.SITLocation == models.SITLocationTypeOrigin + if isOrigin { + sitAddress = *ppmShipment.PickupAddress + } else { + sitAddress = *ppmShipment.DestinationAddress } + contractDate := ppmShipment.ExpectedDepartureDate + totalSITCost, err := models.CalculatePPMSITCost(appCtx.DB(), ppmShipment.ID, sitAddress.ID, isOrigin, contractDate, ppmShipment.SITEstimatedWeight.Int(), additionalDaysInSIT) if err != nil { - return nil, err + return nil, fmt.Errorf("failed to calculate PPM SIT incentive: %w", err) } - - logger.Debug(fmt.Sprintf("Price of service item %s %d", serviceItem.ReService.Code, *price)) - totalPrice += *price + return (*unit.Cents)(&totalSITCost.TotalSITCost), nil } - - return &totalPrice, nil } func CalculateSITCostBreakdown(appCtx appcontext.AppContext, ppmShipment *models.PPMShipment, contract models.ReContract) (*models.PPMSITEstimatedCostInfo, error) { @@ -881,8 +898,12 @@ func CalculateSITCostBreakdown(appCtx appcontext.AppContext, ppmShipment *models switch serviceItemPricer := pricer.(type) { case services.DomesticOriginFirstDaySITPricer, services.DomesticDestinationFirstDaySITPricer: price, ppmSITEstimatedCostInfoData, err = calculateFirstDaySITCostBreakdown(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract, ppmSITEstimatedCostInfoData, logger) + case services.IntlOriginFirstDaySITPricer, services.IntlDestinationFirstDaySITPricer: + price, ppmSITEstimatedCostInfoData, err = calculateIntlFirstDaySITCostBreakdown(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract, ppmSITEstimatedCostInfoData, logger) case services.DomesticOriginAdditionalDaysSITPricer, services.DomesticDestinationAdditionalDaysSITPricer: price, ppmSITEstimatedCostInfoData, err = calculateAdditionalDaySITCostBreakdown(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract, additionalDaysInSIT, ppmSITEstimatedCostInfoData, logger) + case services.IntlOriginAdditionalDaySITPricer, services.IntlDestinationAdditionalDaySITPricer: + price, ppmSITEstimatedCostInfoData, err = calculateIntlAdditionalDaySITCostBreakdown(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract, additionalDaysInSIT, ppmSITEstimatedCostInfoData, logger) default: return nil, fmt.Errorf("unknown SIT pricer type found for service item code %s", serviceItem.ReService.Code) } @@ -926,6 +947,33 @@ func calculateFirstDaySITCostBreakdown(appCtx appcontext.AppContext, serviceItem return price, ppmSITEstimatedCostInfoData, nil } +func calculateIntlFirstDaySITCostBreakdown(appCtx appcontext.AppContext, serviceItemPricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, contract models.ReContract, ppmSITEstimatedCostInfoData *models.PPMSITEstimatedCostInfo, logger *zap.Logger) (*unit.Cents, *models.PPMSITEstimatedCostInfo, error) { + price, priceParams, err := priceFirstDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, contract) + if err != nil { + return nil, nil, err + } + ppmSITEstimatedCostInfoData.PriceFirstDaySIT = price + for _, param := range priceParams { + switch param.Key { + case models.ServiceItemParamNameServiceAreaOrigin: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.ServiceAreaOrigin = param.Value + case models.ServiceItemParamNameServiceAreaDest: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.ServiceAreaDestination = param.Value + case models.ServiceItemParamNameIsPeak: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.IsPeak = param.Value + case models.ServiceItemParamNameContractYearName: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.ContractYearName = param.Value + case models.ServiceItemParamNamePriceRateOrFactor: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.PriceRateOrFactor = param.Value + case models.ServiceItemParamNameEscalationCompounded: + ppmSITEstimatedCostInfoData.ParamsFirstDaySIT.EscalationCompounded = param.Value + default: + logger.Debug(fmt.Sprintf("Unexpected ServiceItemParam in PPM First Day SIT: %s, %s", param.Key, param.Value)) + } + } + return price, ppmSITEstimatedCostInfoData, nil +} + func calculateAdditionalDaySITCostBreakdown(appCtx appcontext.AppContext, serviceItemPricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, contract models.ReContract, additionalDaysInSIT int, ppmSITEstimatedCostInfoData *models.PPMSITEstimatedCostInfo, logger *zap.Logger) (*unit.Cents, *models.PPMSITEstimatedCostInfo, error) { price, priceParams, err := priceAdditionalDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, additionalDaysInSIT, contract) if err != nil { @@ -955,56 +1003,119 @@ func calculateAdditionalDaySITCostBreakdown(appCtx appcontext.AppContext, servic return price, ppmSITEstimatedCostInfoData, nil } -func priceFirstDaySIT(appCtx appcontext.AppContext, pricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, services.PricingDisplayParams, error) { - firstDayPricer, ok := pricer.(services.DomesticFirstDaySITPricer) - if !ok { - return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the first day pricer interface") - } - - // Need to declare if origin or destination for the serviceAreaLookup, otherwise we already have it - serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode - serviceAreaKey := models.ServiceItemParamNameServiceAreaOrigin - if serviceItem.ReService.Code == models.ReServiceCodeDDFSIT { - serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode - serviceAreaKey = models.ServiceItemParamNameServiceAreaDest - } - - serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ - Address: models.Address{PostalCode: serviceAreaPostalCode}, - } - serviceArea, err := serviceAreaLookup.ParamValue(appCtx, contract.Code) +func calculateIntlAdditionalDaySITCostBreakdown(appCtx appcontext.AppContext, serviceItemPricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, contract models.ReContract, additionalDaysInSIT int, ppmSITEstimatedCostInfoData *models.PPMSITEstimatedCostInfo, logger *zap.Logger) (*unit.Cents, *models.PPMSITEstimatedCostInfo, error) { + price, priceParams, err := priceAdditionalDaySIT(appCtx, serviceItemPricer, serviceItem, ppmShipment, additionalDaysInSIT, contract) if err != nil { return nil, nil, err } - - serviceAreaParam := services.PricingDisplayParam{ - Key: serviceAreaKey, - Value: serviceArea, + ppmSITEstimatedCostInfoData.PriceAdditionalDaySIT = price + for _, param := range priceParams { + switch param.Key { + case models.ServiceItemParamNameServiceAreaOrigin: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.ServiceAreaOrigin = param.Value + case models.ServiceItemParamNameServiceAreaDest: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.ServiceAreaDestination = param.Value + case models.ServiceItemParamNameIsPeak: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.IsPeak = param.Value + case models.ServiceItemParamNameContractYearName: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.ContractYearName = param.Value + case models.ServiceItemParamNamePriceRateOrFactor: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.PriceRateOrFactor = param.Value + case models.ServiceItemParamNameEscalationCompounded: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.EscalationCompounded = param.Value + case models.ServiceItemParamNameNumberDaysSIT: + ppmSITEstimatedCostInfoData.ParamsAdditionalDaySIT.NumberDaysSIT = param.Value + default: + logger.Debug(fmt.Sprintf("Unexpected ServiceItemParam in PPM Additional Day SIT: %s, %s", param.Key, param.Value)) + } } + return price, ppmSITEstimatedCostInfoData, nil +} - // Since this function may be ran before closeout, we need to account for if there's no actual move date yet. - if ppmShipment.ActualMoveDate != nil { - price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, *ppmShipment.ActualMoveDate, *ppmShipment.SITEstimatedWeight, serviceArea, true) +func priceFirstDaySIT(appCtx appcontext.AppContext, pricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, contract models.ReContract) (*unit.Cents, services.PricingDisplayParams, error) { + if serviceItem.ReService.Code == models.ReServiceCodeIOFSIT || serviceItem.ReService.Code == models.ReServiceCodeIDFSIT { + var addressID uuid.UUID + if serviceItem.ReService.Code == models.ReServiceCodeIOFSIT { + addressID = *ppmShipment.PickupAddressID + } else { + addressID = *ppmShipment.DestinationAddressID + } + reServiceID, _ := models.FetchReServiceByCode(appCtx.DB(), serviceItem.ReService.Code) + intlOtherPrice, _ := models.FetchReIntlOtherPrice(appCtx.DB(), addressID, reServiceID.ID, contract.ID, &ppmShipment.ExpectedDepartureDate) + firstDayPricer, ok := pricer.(services.IntlOriginFirstDaySITPricer) + if !ok { + return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the first day pricer interface") + } + if ppmShipment.ActualMoveDate != nil { + price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, *ppmShipment.ActualMoveDate, *ppmShipment.SITEstimatedWeight, intlOtherPrice.PerUnitCents.Int()) + if err != nil { + return nil, nil, err + } + + appCtx.Logger().Debug(fmt.Sprintf("Pricing params for first day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + + return &price, pricingParams, nil + } + + price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, ppmShipment.ExpectedDepartureDate, *ppmShipment.SITEstimatedWeight, intlOtherPrice.PerUnitCents.Int()) if err != nil { return nil, nil, err } - pricingParams = append(pricingParams, serviceAreaParam) - appCtx.Logger().Debug(fmt.Sprintf("Pricing params for first day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) return &price, pricingParams, nil - } - price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, ppmShipment.ExpectedDepartureDate, *ppmShipment.SITEstimatedWeight, serviceArea, true) - if err != nil { - return nil, nil, err - } + } else { + firstDayPricer, ok := pricer.(services.DomesticFirstDaySITPricer) + if !ok { + return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the first day pricer interface") + } + + // Need to declare if origin or destination for the serviceAreaLookup, otherwise we already have it + serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode + serviceAreaKey := models.ServiceItemParamNameServiceAreaOrigin + if serviceItem.ReService.Code == models.ReServiceCodeDDFSIT { + serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode + serviceAreaKey = models.ServiceItemParamNameServiceAreaDest + } + + serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ + Address: models.Address{PostalCode: serviceAreaPostalCode}, + } + serviceArea, err := serviceAreaLookup.ParamValue(appCtx, contract.Code) + if err != nil { + return nil, nil, err + } + + serviceAreaParam := services.PricingDisplayParam{ + Key: serviceAreaKey, + Value: serviceArea, + } + + // Since this function may be ran before closeout, we need to account for if there's no actual move date yet. + if ppmShipment.ActualMoveDate != nil { + price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, *ppmShipment.ActualMoveDate, *ppmShipment.SITEstimatedWeight, serviceArea, true) + if err != nil { + return nil, nil, err + } - pricingParams = append(pricingParams, serviceAreaParam) + pricingParams = append(pricingParams, serviceAreaParam) - appCtx.Logger().Debug(fmt.Sprintf("Pricing params for first day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + appCtx.Logger().Debug(fmt.Sprintf("Pricing params for first day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) - return &price, pricingParams, nil + return &price, pricingParams, nil + } + price, pricingParams, err := firstDayPricer.Price(appCtx, contract.Code, ppmShipment.ExpectedDepartureDate, *ppmShipment.SITEstimatedWeight, serviceArea, true) + if err != nil { + return nil, nil, err + } + + pricingParams = append(pricingParams, serviceAreaParam) + + appCtx.Logger().Debug(fmt.Sprintf("Pricing params for first day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + + return &price, pricingParams, nil + } } func additionalDaysInSIT(sitEntryDate time.Time, sitDepartureDate time.Time) int { @@ -1018,60 +1129,103 @@ func additionalDaysInSIT(sitEntryDate time.Time, sitDepartureDate time.Time) int } func priceAdditionalDaySIT(appCtx appcontext.AppContext, pricer services.ParamsPricer, serviceItem models.MTOServiceItem, ppmShipment *models.PPMShipment, additionalDaysInSIT int, contract models.ReContract) (*unit.Cents, services.PricingDisplayParams, error) { - additionalDaysPricer, ok := pricer.(services.DomesticAdditionalDaysSITPricer) - if !ok { - return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the additional days pricer interface") - } + // international shipment logic + if serviceItem.ReService.Code == models.ReServiceCodeIOASIT || serviceItem.ReService.Code == models.ReServiceCodeIDASIT { + // address we need for the per_unit_cents is dependent on if it's origin/destination SIT + var addressID uuid.UUID + if serviceItem.ReService.Code == models.ReServiceCodeIOASIT { + addressID = *ppmShipment.PickupAddressID + } else { + addressID = *ppmShipment.DestinationAddressID + } - // Need to declare if origin or destination for the serviceAreaLookup, otherwise we already have it - serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode - serviceAreaKey := models.ServiceItemParamNameServiceAreaOrigin - if serviceItem.ReService.Code == models.ReServiceCodeDDASIT { - serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode - serviceAreaKey = models.ServiceItemParamNameServiceAreaDest - } - serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ - Address: models.Address{PostalCode: serviceAreaPostalCode}, - } + var moveDate time.Time + if ppmShipment.ActualMoveDate != nil { + moveDate = *ppmShipment.ActualMoveDate + } else { + moveDate = ppmShipment.ExpectedDepartureDate + } - serviceArea, err := serviceAreaLookup.ParamValue(appCtx, contract.Code) - if err != nil { - return nil, nil, err - } + reServiceID, _ := models.FetchReServiceByCode(appCtx.DB(), serviceItem.ReService.Code) + intlOtherPrice, _ := models.FetchReIntlOtherPrice(appCtx.DB(), addressID, reServiceID.ID, contract.ID, &moveDate) - serviceAreaParam := services.PricingDisplayParam{ - Key: serviceAreaKey, - Value: serviceArea, - } + sitDaysParam := services.PricingDisplayParam{ + Key: models.ServiceItemParamNameNumberDaysSIT, + Value: strconv.Itoa(additionalDaysInSIT), + } - sitDaysParam := services.PricingDisplayParam{ - Key: models.ServiceItemParamNameNumberDaysSIT, - Value: strconv.Itoa(additionalDaysInSIT), - } + additionalDayPricer, ok := pricer.(services.IntlOriginAdditionalDaySITPricer) + if !ok { + return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the first day pricer interface") + } - // Since this function may be ran before closeout, we need to account for if there's no actual move date yet. - if ppmShipment.ActualMoveDate != nil { - price, pricingParams, err := additionalDaysPricer.Price(appCtx, contract.Code, *ppmShipment.ActualMoveDate, *ppmShipment.SITEstimatedWeight, serviceArea, additionalDaysInSIT, true) + price, pricingParams, err := additionalDayPricer.Price(appCtx, contract.Code, moveDate, additionalDaysInSIT, *ppmShipment.SITEstimatedWeight, intlOtherPrice.PerUnitCents.Int()) if err != nil { return nil, nil, err } - pricingParams = append(pricingParams, serviceAreaParam, sitDaysParam) + pricingParams = append(pricingParams, sitDaysParam) appCtx.Logger().Debug(fmt.Sprintf("Pricing params for additional day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) return &price, pricingParams, nil - } - price, pricingParams, err := additionalDaysPricer.Price(appCtx, contract.Code, ppmShipment.ExpectedDepartureDate, *ppmShipment.SITEstimatedWeight, serviceArea, additionalDaysInSIT, true) - if err != nil { - return nil, nil, err - } + } else { + // domestic PPMs + additionalDaysPricer, ok := pricer.(services.DomesticAdditionalDaysSITPricer) + if !ok { + return nil, nil, errors.New("ppm estimate pricer for SIT service item does not implement the additional days pricer interface") + } + + // Need to declare if origin or destination for the serviceAreaLookup, otherwise we already have it + serviceAreaPostalCode := ppmShipment.PickupAddress.PostalCode + serviceAreaKey := models.ServiceItemParamNameServiceAreaOrigin + if serviceItem.ReService.Code == models.ReServiceCodeDDASIT { + serviceAreaPostalCode = ppmShipment.DestinationAddress.PostalCode + serviceAreaKey = models.ServiceItemParamNameServiceAreaDest + } + serviceAreaLookup := serviceparamvaluelookups.ServiceAreaLookup{ + Address: models.Address{PostalCode: serviceAreaPostalCode}, + } + + serviceArea, err := serviceAreaLookup.ParamValue(appCtx, contract.Code) + if err != nil { + return nil, nil, err + } + + serviceAreaParam := services.PricingDisplayParam{ + Key: serviceAreaKey, + Value: serviceArea, + } + + sitDaysParam := services.PricingDisplayParam{ + Key: models.ServiceItemParamNameNumberDaysSIT, + Value: strconv.Itoa(additionalDaysInSIT), + } - pricingParams = append(pricingParams, serviceAreaParam, sitDaysParam) + // Since this function may be ran before closeout, we need to account for if there's no actual move date yet. + if ppmShipment.ActualMoveDate != nil { + price, pricingParams, err := additionalDaysPricer.Price(appCtx, contract.Code, *ppmShipment.ActualMoveDate, *ppmShipment.SITEstimatedWeight, serviceArea, additionalDaysInSIT, true) + if err != nil { + return nil, nil, err + } - appCtx.Logger().Debug(fmt.Sprintf("Pricing params for additional day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + pricingParams = append(pricingParams, serviceAreaParam, sitDaysParam) - return &price, pricingParams, nil + appCtx.Logger().Debug(fmt.Sprintf("Pricing params for additional day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + + return &price, pricingParams, nil + } + price, pricingParams, err := additionalDaysPricer.Price(appCtx, contract.Code, ppmShipment.ExpectedDepartureDate, *ppmShipment.SITEstimatedWeight, serviceArea, additionalDaysInSIT, true) + if err != nil { + return nil, nil, err + } + + pricingParams = append(pricingParams, serviceAreaParam, sitDaysParam) + + appCtx.Logger().Debug(fmt.Sprintf("Pricing params for additional day SIT %+v", pricingParams), zap.String("shipmentId", ppmShipment.ShipmentID.String())) + + return &price, pricingParams, nil + } } // mapPPMShipmentEstimatedFields remaps our PPMShipment specific information into the fields where the service param lookups @@ -1083,9 +1237,9 @@ func MapPPMShipmentEstimatedFields(appCtx appcontext.AppContext, ppmShipment mod ppmShipment.Shipment.ActualPickupDate = &ppmShipment.ExpectedDepartureDate ppmShipment.Shipment.RequestedPickupDate = &ppmShipment.ExpectedDepartureDate ppmShipment.Shipment.PickupAddress = ppmShipment.PickupAddress - ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: *ppmShipment.ActualPickupPostalCode} + ppmShipment.Shipment.PickupAddress = &models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode} ppmShipment.Shipment.DestinationAddress = ppmShipment.DestinationAddress - ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: *ppmShipment.ActualDestinationPostalCode} + ppmShipment.Shipment.DestinationAddress = &models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode} ppmShipment.Shipment.PrimeActualWeight = ppmShipment.EstimatedWeight return ppmShipment.Shipment, nil diff --git a/src/components/Office/PPM/SitCostBreakdown/SitCostBreakdown.jsx b/src/components/Office/PPM/SitCostBreakdown/SitCostBreakdown.jsx index f275eb0f3a6..0b6412ddfe4 100644 --- a/src/components/Office/PPM/SitCostBreakdown/SitCostBreakdown.jsx +++ b/src/components/Office/PPM/SitCostBreakdown/SitCostBreakdown.jsx @@ -24,6 +24,11 @@ export default function SitCostBreakdown({ actualWeight, ); + const isEitherAddressOconus = (ppm) => { + return ppm?.destinationAddress?.isOconus || ppm?.pickupAddress?.isOconus; + }; + const isInternationalShipment = isEitherAddressOconus(ppmShipmentInfo); + setEstimatedCost(estimatedCost?.sitCost || 0); return (
@@ -36,18 +41,25 @@ export default function SitCostBreakdown({ SIT Information:
-
- - {estimatedCost.paramsFirstDaySIT.serviceAreaOrigin - ? `Origin service area: ${estimatedCost?.paramsFirstDaySIT.serviceAreaOrigin}` - : `Destination service area: ${estimatedCost?.paramsFirstDaySIT.serviceAreaDestination}`} - -
+ {(estimatedCost.paramsFirstDaySIT.serviceAreaOrigin || + estimatedCost.paramsFirstDaySIT.serviceAreaDestination) && ( +
+ + {estimatedCost.paramsFirstDaySIT.serviceAreaOrigin + ? `Origin service area: ${estimatedCost.paramsFirstDaySIT.serviceAreaOrigin}` + : `Destination service area: ${estimatedCost.paramsFirstDaySIT.serviceAreaDestination}`} + +
+ )}
Actual move date: {formatDate(ppmShipmentInfo.actualMoveDate)}
- {estimatedCost.paramsFirstDaySIT.isPeak ? 'Domestic peak' : 'Domestic non-peak'} + + {isInternationalShipment + ? `${estimatedCost.paramsFirstDaySIT.isPeak ? 'International peak' : 'International non-peak'}` + : `${estimatedCost.paramsFirstDaySIT.isPeak ? 'Domestic peak' : 'Domestic non-peak'}`} +
From 2bc55e22ee1e2eaddd68188c4e3d03ec9f5601fd Mon Sep 17 00:00:00 2001 From: JamesHawks224 <146897935+JamesHawks224@users.noreply.github.com> Date: Mon, 20 Jan 2025 22:47:27 +0000 Subject: [PATCH 058/229] migration files for hhg_outof_nts rename and inserts --- migrations/app/migrations_manifest.txt | 2 ++ ...3645_update_hhg_outof_nts_enum_name.up.sql | 25 +++++++++++++ ...dd_international_ntsr_service_items.up.sql | 36 +++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql create mode 100644 migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 8a92db1e557..c017662ab83 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1071,3 +1071,5 @@ 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110214012_homesafeconnect_cert.up.sql +20250120213645_update_hhg_outof_nts_enum_name.up.sql +20250120214107_add_international_ntsr_service_items.up.sql diff --git a/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql b/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql new file mode 100644 index 00000000000..c4b6a64ec66 --- /dev/null +++ b/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql @@ -0,0 +1,25 @@ +-- Rename the existing enum value 'HHG_INTO_NTS_DOMESTIC' to 'HHG_INTO_NTS' +DO $$ +BEGIN + IF EXISTS ( + SELECT 1 + FROM pg_type t + JOIN pg_enum e ON t.oid = e.enumtypid + WHERE t.typname = 'mto_shipment_type' + AND e.enumlabel = 'HHG_OUTOF_NTS_DOMESTIC' + ) THEN + ALTER TYPE mto_shipment_type + RENAME VALUE 'HHG_OUTOF_NTS_DOMESTIC' TO 'HHG_OUTOF_NTS'; + END IF; +END $$; + +-- Update column comments to include all current shipment types +COMMENT ON COLUMN mto_shipments.shipment_type IS 'The type of shipment. The list includes: +1. Personally procured move (PPM) +2. Household goods move (HHG) +3. Non-temporary storage (HHG_INTO_NTS) +4. Non-temporary storage-release (HHG_OUTOF_NTS) +5. Mobile home (MOBILE_HOME) +6. Boat haul away (BOAT_HAUL_AWAY) +7. Boat tow away (BOAT_TOW_AWAY) +8. Unaccompanied baggage (UNACCOMPANIED_BAGGAGE)'; diff --git a/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql new file mode 100644 index 00000000000..f6f966028d3 --- /dev/null +++ b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql @@ -0,0 +1,36 @@ +-- +-- Add service items for international NTS-R shipments. +-- +INSERT INTO re_service_items +(id, service_id, shipment_type, market_code, is_auto_approved, created_at, updated_at, sort) +VALUES + --ISLH International Shipping & Linehaul + ('bf76fb0f-408a-4391-8aa7-92908f3c027a', '9f3d551a-0725-430e-897e-80ee9add3ae9' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 1), + --PODFSC International POD Fuel Surcharge + ('db2106c8-887c-4304-aad2-c7413de13cc4', '388115e8-abe9-441d-96cf-a39f24baa0a3' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 2), + --INPK International NTS packing + ('4d348ec0-a278-4038-b061-6a4e17ea6721', '874cb86a-bc39-4f57-a614-53ee3fcacf14' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 3), + --ICRT International crating + ('b8f4e434-0912-44c5-b824-c60e5c5dffee', '86203d72-7f7c-49ff-82f0-5b95e4958f60' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IDASIT International destination add'l day SIT + ('7135540f-602c-4d02-ba66-403b7252738e', '806c6d59-57ff-4a3f-9518-ebf29ba9cb10' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IDDSIT International destination SIT delivery + ('5d3261a5-a7af-4133-b2e0-2a06f694c551', '28389ee1-56cf-400c-aa52-1501ecdd7c69' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IDFSIT International destination 1st day SIT + ('90e022da-9944-4563-98a3-6eb7cabb017e', 'bd6064ca-e780-4ab4-a37b-0ae98eebb244' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IDSHUT International destination shuttle service + ('ba6c218b-dd99-4ef4-87ed-421581218bbf', '22fc07ed-be15-4f50-b941-cbd38153b378' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IOASIT International origin add'l day SIT + ('ded116f5-ca9d-465e-acd8-3eee899e9713', 'bd424e45-397b-4766-9712-de4ae3a2da36' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IOFSIT International origin 1st day SIT + ('03114a6f-22ef-4664-9269-b76636466285', 'b488bf85-ea5e-49c8-ba5c-e2fa278ac806' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IOPSIT International origin SIT pickup + ('03e7b2fd-431d-4ce6-a640-78de846095c9', '6f4f6e31-0675-4051-b659-89832259f390' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IOSHUT International origin shuttle service + ('94b1786f-86ec-4736-8dbc-6a0e29b64272', '624a97c5-dfbf-4da9-a6e9-526b4f95af8d' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IUCRT International uncrating + ('cefe3094-5670-41c3-b6cd-72730bbb8fc7', '4132416b-b1aa-42e7-98f2-0ac0a03e8a31' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IOFSC International Origin SIT Fuel Surcharge + ('6506987f-925d-473d-9872-b94e0279c1af', '81e29d0c-02a6-4a7a-be02-554deb3ee49e' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), + --IDSFSC International Destination SIT Fuel Surcharge + ('ca34445f-3e42-4e7e-b631-b4ae81c813c9', '690a5fc1-0ea5-4554-8294-a367b5daefa9' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL); From 0332de784a3b4cb65ad093ace8b8a45ebc71cae5 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Mon, 20 Jan 2025 23:02:17 +0000 Subject: [PATCH 059/229] tests for model package added --- .../payloads/model_to_payload_test.go | 77 +++++++++ pkg/models/port_location_test.go | 26 +++ pkg/models/ppm_shipment_test.go | 159 ++++++++++++++++++ pkg/models/re_intl_other_price_test.go | 77 +++++++++ pkg/models/re_service.go | 16 ++ pkg/models/re_service_item.go | 12 -- pkg/models/re_service_test.go | 16 ++ 7 files changed, 371 insertions(+), 12 deletions(-) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index 7e201ca5212..ac3c3ac9f65 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -1354,3 +1354,80 @@ func (suite *PayloadsSuite) TestMTOShipment_POE_POD_Locations() { suite.Nil(payload.PoeLocation, "Expected PODLocation to be nil when PODLocation is set") }) } + +func (suite *PayloadsSuite) TestPPMCloseout() { + plannedMoveDate := time.Now() + actualMoveDate := time.Now() + miles := 1200 + estimatedWeight := unit.Pound(5000) + actualWeight := unit.Pound(5200) + proGearWeightCustomer := unit.Pound(300) + proGearWeightSpouse := unit.Pound(100) + grossIncentive := unit.Cents(100000) + gcc := unit.Cents(50000) + aoa := unit.Cents(20000) + remainingIncentive := unit.Cents(30000) + haulType := "Linehaul" + haulPrice := unit.Cents(40000) + haulFSC := unit.Cents(5000) + dop := unit.Cents(10000) + ddp := unit.Cents(8000) + packPrice := unit.Cents(7000) + unpackPrice := unit.Cents(6000) + intlPackPrice := unit.Cents(15000) + intlUnpackPrice := unit.Cents(14000) + intlLinehaulPrice := unit.Cents(13000) + sitReimbursement := unit.Cents(12000) + + ppmCloseout := models.PPMCloseout{ + ID: models.UUIDPointer(uuid.Must(uuid.NewV4())), + PlannedMoveDate: &plannedMoveDate, + ActualMoveDate: &actualMoveDate, + Miles: &miles, + EstimatedWeight: &estimatedWeight, + ActualWeight: &actualWeight, + ProGearWeightCustomer: &proGearWeightCustomer, + ProGearWeightSpouse: &proGearWeightSpouse, + GrossIncentive: &grossIncentive, + GCC: &gcc, + AOA: &aoa, + RemainingIncentive: &remainingIncentive, + HaulType: (*models.HaulType)(&haulType), + HaulPrice: &haulPrice, + HaulFSC: &haulFSC, + DOP: &dop, + DDP: &ddp, + PackPrice: &packPrice, + UnpackPrice: &unpackPrice, + IntlPackPrice: &intlPackPrice, + IntlUnpackPrice: &intlUnpackPrice, + IntlLinehaulPrice: &intlLinehaulPrice, + SITReimbursement: &sitReimbursement, + } + + payload := PPMCloseout(&ppmCloseout) + suite.NotNil(payload) + suite.Equal(ppmCloseout.ID.String(), payload.ID.String()) + suite.Equal(handlers.FmtDatePtr(ppmCloseout.PlannedMoveDate), payload.PlannedMoveDate) + suite.Equal(handlers.FmtDatePtr(ppmCloseout.ActualMoveDate), payload.ActualMoveDate) + suite.Equal(handlers.FmtIntPtrToInt64(ppmCloseout.Miles), payload.Miles) + suite.Equal(handlers.FmtPoundPtr(ppmCloseout.EstimatedWeight), payload.EstimatedWeight) + suite.Equal(handlers.FmtPoundPtr(ppmCloseout.ActualWeight), payload.ActualWeight) + suite.Equal(handlers.FmtPoundPtr(ppmCloseout.ProGearWeightCustomer), payload.ProGearWeightCustomer) + suite.Equal(handlers.FmtPoundPtr(ppmCloseout.ProGearWeightSpouse), payload.ProGearWeightSpouse) + suite.Equal(handlers.FmtCost(ppmCloseout.GrossIncentive), payload.GrossIncentive) + suite.Equal(handlers.FmtCost(ppmCloseout.GCC), payload.Gcc) + suite.Equal(handlers.FmtCost(ppmCloseout.AOA), payload.Aoa) + suite.Equal(handlers.FmtCost(ppmCloseout.RemainingIncentive), payload.RemainingIncentive) + suite.Equal((*string)(ppmCloseout.HaulType), payload.HaulType) + suite.Equal(handlers.FmtCost(ppmCloseout.HaulPrice), payload.HaulPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.HaulFSC), payload.HaulFSC) + suite.Equal(handlers.FmtCost(ppmCloseout.DOP), payload.Dop) + suite.Equal(handlers.FmtCost(ppmCloseout.DDP), payload.Ddp) + suite.Equal(handlers.FmtCost(ppmCloseout.PackPrice), payload.PackPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.UnpackPrice), payload.UnpackPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.IntlPackPrice), payload.IntlPackPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.IntlUnpackPrice), payload.IntlUnpackPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.IntlLinehaulPrice), payload.IntlLinehaulPrice) + suite.Equal(handlers.FmtCost(ppmCloseout.SITReimbursement), payload.SITReimbursement) +} diff --git a/pkg/models/port_location_test.go b/pkg/models/port_location_test.go index c63a4e34e29..ae50c68880f 100644 --- a/pkg/models/port_location_test.go +++ b/pkg/models/port_location_test.go @@ -2,6 +2,7 @@ package models_test import ( "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/models" ) func (suite *ModelSuite) TestPortLocation() { @@ -24,3 +25,28 @@ func (suite *ModelSuite) TestPortLocation() { suite.Equal("port_locations", portLocation.TableName()) }) } + +func (suite *ModelSuite) TestFetchPortLocationByCode() { + suite.Run("Port location can be fetched when it exists", func() { + + portLocation := factory.FetchPortLocation(suite.DB(), []factory.Customization{ + { + Model: models.Port{ + PortCode: "SEA", + }, + }, + }, nil) + suite.NotNil(portLocation) + + result, err := models.FetchPortLocationByCode(suite.AppContextForTest().DB(), "SEA") + suite.NotNil(result) + suite.NoError(err) + suite.Equal(portLocation.ID, result.ID) + }) + + suite.Run("Sends back an error when it does not exist", func() { + result, err := models.FetchPortLocationByCode(suite.AppContextForTest().DB(), "123") + suite.Nil(result) + suite.Error(err) + }) +} diff --git a/pkg/models/ppm_shipment_test.go b/pkg/models/ppm_shipment_test.go index 4def2567968..7dbeb27f545 100644 --- a/pkg/models/ppm_shipment_test.go +++ b/pkg/models/ppm_shipment_test.go @@ -7,6 +7,7 @@ import ( "github.com/gofrs/uuid" + "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/models" "github.com/transcom/mymove/pkg/testdatagen" "github.com/transcom/mymove/pkg/unit" @@ -125,3 +126,161 @@ func (suite *ModelSuite) TestPPMShipmentValidation() { }) } } + +func (suite *ModelSuite) TestCalculatePPMIncentive() { + suite.Run("success - receive PPM incentive when all values exist", func() { + ppmShipment := factory.BuildPPMShipment(suite.DB(), nil, nil) + pickupUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "74135") + suite.FatalNoError(err) + pickupAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + IsOconus: models.BoolPointer(false), + UsPostRegionCityID: &pickupUSPRC.ID, + }, + }, + }, nil) + + destUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "99505") + suite.FatalNoError(err) + destAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + UsPostRegionCityID: &destUSPRC.ID, + }, + }, + }, nil) + + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + moveDate := time.Now() + mileage := 1000 + weight := 2000 + + incentives, err := models.CalculatePPMIncentive(suite.DB(), ppmShipment.ID, pickupAddress.ID, destAddress.ID, moveDate, mileage, weight, true, false, false) + suite.NoError(err) + suite.NotNil(incentives) + suite.NotNil(incentives.PriceFSC) + suite.NotNil(incentives.PriceIHPK) + suite.NotNil(incentives.PriceIHUPK) + suite.NotNil(incentives.PriceISLH) + suite.NotNil(incentives.TotalIncentive) + }) + + suite.Run("failure - contract doesn't exist", func() { + ppmShipment := factory.BuildPPMShipment(suite.DB(), nil, nil) + pickupUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "74135") + suite.FatalNoError(err) + pickupAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + IsOconus: models.BoolPointer(false), + UsPostRegionCityID: &pickupUSPRC.ID, + }, + }, + }, nil) + + destUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "99505") + suite.FatalNoError(err) + destAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + UsPostRegionCityID: &destUSPRC.ID, + }, + }, + }, nil) + + moveDate := time.Now() + mileage := 1000 + weight := 2000 + + incentives, err := models.CalculatePPMIncentive(suite.DB(), ppmShipment.ID, pickupAddress.ID, destAddress.ID, moveDate, mileage, weight, true, false, false) + suite.Error(err) + suite.Nil(incentives) + }) +} + +func (suite *ModelSuite) TestCalculatePPMSITCost() { + suite.Run("success - receive PPM SIT costs when all values exist", func() { + ppmShipment := factory.BuildPPMShipment(suite.DB(), nil, nil) + destUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "99505") + suite.FatalNoError(err) + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + UsPostRegionCityID: &destUSPRC.ID, + }, + }, + }, nil) + + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + moveDate := time.Now() + sitDays := 7 + weight := 2000 + + sitCost, err := models.CalculatePPMSITCost(suite.DB(), ppmShipment.ID, address.ID, false, moveDate, weight, sitDays) + suite.NoError(err) + suite.NotNil(sitCost) + suite.NotNil(sitCost.PriceAddlDaySIT) + suite.NotNil(sitCost.PriceFirstDaySIT) + suite.NotNil(sitCost.TotalSITCost) + }) + + suite.Run("failure - contract doesn't exist", func() { + ppmShipment := factory.BuildPPMShipment(suite.DB(), nil, nil) + destUSPRC, err := models.FindByZipCode(suite.AppContextForTest().DB(), "99505") + suite.FatalNoError(err) + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + UsPostRegionCityID: &destUSPRC.ID, + }, + }, + }, nil) + + moveDate := time.Now() + sitDays := 7 + weight := 2000 + + sitCost, err := models.CalculatePPMSITCost(suite.DB(), ppmShipment.ID, address.ID, false, moveDate, weight, sitDays) + suite.Error(err) + suite.Nil(sitCost) + }) +} diff --git a/pkg/models/re_intl_other_price_test.go b/pkg/models/re_intl_other_price_test.go index 69e9770c47a..8cde04c61d4 100644 --- a/pkg/models/re_intl_other_price_test.go +++ b/pkg/models/re_intl_other_price_test.go @@ -1,9 +1,13 @@ package models_test import ( + "time" + "github.com/gofrs/uuid" + "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/testdatagen" ) func (suite *ModelSuite) TestReIntlOtherPriceValidation() { @@ -43,3 +47,76 @@ func (suite *ModelSuite) TestReIntlOtherPriceValidation() { suite.verifyValidationErrors(&intlOtherPrice, expErrors) }) } + +func (suite *ModelSuite) TestFetchReIntlOtherPrice() { + suite.Run("success - receive ReIntlOtherPrice when all values exist and are found", func() { + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + + reService, err := models.FetchReServiceByCode(suite.DB(), models.ReServiceCodeIHPK) + suite.NoError(err) + suite.NotNil(reService) + + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + moveDate := time.Now() + + reIntlOtherPrice, err := models.FetchReIntlOtherPrice(suite.DB(), address.ID, reService.ID, contract.ID, &moveDate) + suite.NoError(err) + suite.NotNil(reIntlOtherPrice) + suite.NotNil(reIntlOtherPrice.PerUnitCents) + }) + + suite.Run("failure - receive error when values aren't provided", func() { + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + + reService, err := models.FetchReServiceByCode(suite.DB(), models.ReServiceCodeIHPK) + suite.NoError(err) + suite.NotNil(reService) + + contract := testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{}) + moveDate := time.Now() + + // no address + reIntlOtherPrice, err := models.FetchReIntlOtherPrice(suite.DB(), uuid.Nil, reService.ID, contract.ID, &moveDate) + suite.Error(err) + suite.Nil(reIntlOtherPrice) + suite.Contains(err.Error(), "error value from re_intl_other_prices - required parameters not provided") + + // no service ID + reIntlOtherPrice, err = models.FetchReIntlOtherPrice(suite.DB(), address.ID, uuid.Nil, contract.ID, &moveDate) + suite.Error(err) + suite.Nil(reIntlOtherPrice) + suite.Contains(err.Error(), "error value from re_intl_other_prices - required parameters not provided") + + // no contract ID + reIntlOtherPrice, err = models.FetchReIntlOtherPrice(suite.DB(), address.ID, reService.ID, uuid.Nil, &moveDate) + suite.Error(err) + suite.Nil(reIntlOtherPrice) + suite.Contains(err.Error(), "error value from re_intl_other_prices - required parameters not provided") + + // no move date + reIntlOtherPrice, err = models.FetchReIntlOtherPrice(suite.DB(), address.ID, reService.ID, contract.ID, nil) + suite.Error(err) + suite.Nil(reIntlOtherPrice) + suite.Contains(err.Error(), "error value from re_intl_other_prices - required parameters not provided") + }) +} diff --git a/pkg/models/re_service.go b/pkg/models/re_service.go index 5fc9d9b3e75..3cf29ce33fa 100644 --- a/pkg/models/re_service.go +++ b/pkg/models/re_service.go @@ -1,12 +1,15 @@ package models import ( + "fmt" "time" "github.com/gobuffalo/pop/v6" "github.com/gobuffalo/validate/v3" "github.com/gobuffalo/validate/v3/validators" "github.com/gofrs/uuid" + + "github.com/transcom/mymove/pkg/apperror" ) // ReServiceCode is the code of service @@ -223,3 +226,16 @@ func (r *ReService) Validate(_ *pop.Connection) (*validate.Errors, error) { &validators.StringIsPresent{Field: r.Name, Name: "Name"}, ), nil } + +func FetchReServiceByCode(db *pop.Connection, code ReServiceCode) (*ReService, error) { + var reServiceCode ReServiceCode + if code != reServiceCode { + reService := ReService{} + err := db.Where("code = ?", code).First(&reService) + if err != nil { + return nil, apperror.NewQueryError("ReService", err, "") + } + return &reService, err + } + return nil, fmt.Errorf("error fetching from re_services - required code not provided") +} diff --git a/pkg/models/re_service_item.go b/pkg/models/re_service_item.go index 298c8dfa26a..f06ee0990a2 100644 --- a/pkg/models/re_service_item.go +++ b/pkg/models/re_service_item.go @@ -3,10 +3,7 @@ package models import ( "time" - "github.com/gobuffalo/pop/v6" "github.com/gofrs/uuid" - - "github.com/transcom/mymove/pkg/apperror" ) type ReServiceItem struct { @@ -27,12 +24,3 @@ func (r ReServiceItem) TableName() string { // ReServiceItems is a slice of ReServiceItem type ReServiceItems []ReServiceItem - -func FetchReServiceByCode(db *pop.Connection, code ReServiceCode) (*ReService, error) { - reService := ReService{} - err := db.Where("code = ?", code).First(&reService) - if err != nil { - return nil, apperror.NewQueryError("ReService", err, "") - } - return &reService, err -} diff --git a/pkg/models/re_service_test.go b/pkg/models/re_service_test.go index 929677faab7..41e60c55d73 100644 --- a/pkg/models/re_service_test.go +++ b/pkg/models/re_service_test.go @@ -23,3 +23,19 @@ func (suite *ModelSuite) TestReServiceValidation() { suite.verifyValidationErrors(&emptyReService, expErrors) }) } + +func (suite *ModelSuite) TestFetchReServiceBycode() { + suite.Run("success - receive ReService when code is provided", func() { + reService, err := models.FetchReServiceByCode(suite.DB(), models.ReServiceCodeIHPK) + suite.NoError(err) + suite.NotNil(reService) + }) + + suite.Run("failure - receive error when code is not provided", func() { + var blankReServiceCode models.ReServiceCode + reService, err := models.FetchReServiceByCode(suite.DB(), blankReServiceCode) + suite.Error(err) + suite.Nil(reService) + suite.Contains(err.Error(), "error fetching from re_services - required code not provided") + }) +} From 5a805d2500a22cbd1e48671274f9f46e9c6db1ef Mon Sep 17 00:00:00 2001 From: JamesHawks224 <146897935+JamesHawks224@users.noreply.github.com> Date: Tue, 21 Jan 2025 15:52:22 +0000 Subject: [PATCH 060/229] updated migration sql. --- migrations/app/migrations_manifest.txt | 1 - ...3645_update_hhg_outof_nts_enum_name.up.sql | 25 ------------------- ...dd_international_ntsr_service_items.up.sql | 2 ++ 3 files changed, 2 insertions(+), 26 deletions(-) delete mode 100644 migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index c017662ab83..4d2ce94c1dd 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1071,5 +1071,4 @@ 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110214012_homesafeconnect_cert.up.sql -20250120213645_update_hhg_outof_nts_enum_name.up.sql 20250120214107_add_international_ntsr_service_items.up.sql diff --git a/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql b/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql deleted file mode 100644 index c4b6a64ec66..00000000000 --- a/migrations/app/schema/20250120213645_update_hhg_outof_nts_enum_name.up.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Rename the existing enum value 'HHG_INTO_NTS_DOMESTIC' to 'HHG_INTO_NTS' -DO $$ -BEGIN - IF EXISTS ( - SELECT 1 - FROM pg_type t - JOIN pg_enum e ON t.oid = e.enumtypid - WHERE t.typname = 'mto_shipment_type' - AND e.enumlabel = 'HHG_OUTOF_NTS_DOMESTIC' - ) THEN - ALTER TYPE mto_shipment_type - RENAME VALUE 'HHG_OUTOF_NTS_DOMESTIC' TO 'HHG_OUTOF_NTS'; - END IF; -END $$; - --- Update column comments to include all current shipment types -COMMENT ON COLUMN mto_shipments.shipment_type IS 'The type of shipment. The list includes: -1. Personally procured move (PPM) -2. Household goods move (HHG) -3. Non-temporary storage (HHG_INTO_NTS) -4. Non-temporary storage-release (HHG_OUTOF_NTS) -5. Mobile home (MOBILE_HOME) -6. Boat haul away (BOAT_HAUL_AWAY) -7. Boat tow away (BOAT_TOW_AWAY) -8. Unaccompanied baggage (UNACCOMPANIED_BAGGAGE)'; diff --git a/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql index f6f966028d3..74db52ee7a1 100644 --- a/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql +++ b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql @@ -8,6 +8,8 @@ VALUES ('bf76fb0f-408a-4391-8aa7-92908f3c027a', '9f3d551a-0725-430e-897e-80ee9add3ae9' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 1), --PODFSC International POD Fuel Surcharge ('db2106c8-887c-4304-aad2-c7413de13cc4', '388115e8-abe9-441d-96cf-a39f24baa0a3' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 2), + --POEFSC International POD Fuel Surcharge + ('509a491d-cddd-476c-9ba0-65077cf93e58', 'f75758d8-2fcd-40ba-9432-3ff3032a71d1' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 2), --INPK International NTS packing ('4d348ec0-a278-4038-b061-6a4e17ea6721', '874cb86a-bc39-4f57-a614-53ee3fcacf14' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 3), --ICRT International crating From a4abea0f852e6a6811bd6c4347ddd1bb855b43f1 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 15:59:57 +0000 Subject: [PATCH 061/229] added lookup tests, mocks generated --- pkg/factory/ppm_shipment_factory.go | 90 +++++--- .../distance_zip_lookup.go | 2 +- .../distance_zip_lookup_test.go | 50 +++++ .../per_unit_cents_lookup.go | 8 +- .../per_unit_cents_lookup_test.go | 208 ++++++++++++++++++ .../port_zip_lookup_test.go | 76 ++++++- .../IntlDestinationAdditionalDaySITPricer.go | 109 +++++++++ .../mocks/IntlDestinationFirstDaySITPricer.go | 109 +++++++++ .../mocks/IntlOriginAdditionalDaySITPricer.go | 109 +++++++++ .../mocks/IntlOriginFirstDaySITPricer.go | 109 +++++++++ 10 files changed, 826 insertions(+), 44 deletions(-) create mode 100644 pkg/services/mocks/IntlDestinationAdditionalDaySITPricer.go create mode 100644 pkg/services/mocks/IntlDestinationFirstDaySITPricer.go create mode 100644 pkg/services/mocks/IntlOriginAdditionalDaySITPricer.go create mode 100644 pkg/services/mocks/IntlOriginFirstDaySITPricer.go diff --git a/pkg/factory/ppm_shipment_factory.go b/pkg/factory/ppm_shipment_factory.go index 0306aebe547..cc87032285e 100644 --- a/pkg/factory/ppm_shipment_factory.go +++ b/pkg/factory/ppm_shipment_factory.go @@ -87,42 +87,60 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, ppmShipment.W2Address = &w2AddressResult } - oldDutyLocationAddress := ppmShipment.Shipment.MoveTaskOrder.Orders.OriginDutyLocation.Address - pickupAddress := BuildAddress(db, []Customization{ - { - Model: models.Address{ - StreetAddress1: "987 New Street", - City: oldDutyLocationAddress.City, - State: oldDutyLocationAddress.State, - PostalCode: oldDutyLocationAddress.PostalCode, + pickupAddressResult := findValidCustomization(customs, Addresses.PickupAddress) + if pickupAddressResult != nil { + pickupAddressResultCustoms := convertCustomizationInList(customs, Addresses.PickupAddress, Address) + + pickupAddressResult := BuildAddress(db, pickupAddressResultCustoms, traits) + ppmShipment.PickupAddressID = &pickupAddressResult.ID + ppmShipment.PickupAddress = &pickupAddressResult + } else { + oldDutyLocationAddress := ppmShipment.Shipment.MoveTaskOrder.Orders.OriginDutyLocation.Address + pickupAddress := BuildAddress(db, []Customization{ + { + Model: models.Address{ + StreetAddress1: "987 New Street", + City: oldDutyLocationAddress.City, + State: oldDutyLocationAddress.State, + PostalCode: oldDutyLocationAddress.PostalCode, + }, }, - }, - }, nil) - ppmShipment.PickupAddressID = &pickupAddress.ID - ppmShipment.PickupAddress = &pickupAddress + }, nil) + ppmShipment.PickupAddressID = &pickupAddress.ID + ppmShipment.PickupAddress = &pickupAddress + } - newDutyLocationAddress := ppmShipment.Shipment.MoveTaskOrder.Orders.NewDutyLocation.Address - destinationAddress := BuildAddress(db, []Customization{ - { - Model: models.Address{ - StreetAddress1: "123 New Street", - City: newDutyLocationAddress.City, - State: newDutyLocationAddress.State, - PostalCode: newDutyLocationAddress.PostalCode, + deliveryAddressResult := findValidCustomization(customs, Addresses.DeliveryAddress) + if deliveryAddressResult != nil { + deliveryAddressResultCustoms := convertCustomizationInList(customs, Addresses.DeliveryAddress, Address) + + deliveryAddressResult := BuildAddress(db, deliveryAddressResultCustoms, traits) + ppmShipment.DestinationAddressID = &deliveryAddressResult.ID + ppmShipment.DestinationAddress = &deliveryAddressResult + } else { + newDutyLocationAddress := ppmShipment.Shipment.MoveTaskOrder.Orders.NewDutyLocation.Address + destinationAddress := BuildAddress(db, []Customization{ + { + Model: models.Address{ + StreetAddress1: "123 New Street", + City: newDutyLocationAddress.City, + State: newDutyLocationAddress.State, + PostalCode: newDutyLocationAddress.PostalCode, + }, }, - }, - }, nil) - ppmShipment.DestinationAddressID = &destinationAddress.ID - ppmShipment.DestinationAddress = &destinationAddress + }, nil) + ppmShipment.DestinationAddressID = &destinationAddress.ID + ppmShipment.DestinationAddress = &destinationAddress + } if buildType == ppmBuildFullAddress { secondaryPickupAddress := BuildAddress(db, []Customization{ { Model: models.Address{ StreetAddress1: "123 Main Street", - City: pickupAddress.City, - State: pickupAddress.State, - PostalCode: pickupAddress.PostalCode, + City: ppmShipment.PickupAddress.City, + State: ppmShipment.PickupAddress.State, + PostalCode: ppmShipment.PickupAddress.PostalCode, }, }, }, nil) @@ -130,9 +148,9 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, { Model: models.Address{ StreetAddress1: "1234 Main Street", - City: destinationAddress.City, - State: destinationAddress.State, - PostalCode: destinationAddress.PostalCode, + City: ppmShipment.DestinationAddress.City, + State: ppmShipment.DestinationAddress.State, + PostalCode: ppmShipment.DestinationAddress.PostalCode, }, }, }, nil) @@ -140,9 +158,9 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, { Model: models.Address{ StreetAddress1: "123 Third Street", - City: pickupAddress.City, - State: pickupAddress.State, - PostalCode: pickupAddress.PostalCode, + City: ppmShipment.PickupAddress.City, + State: ppmShipment.PickupAddress.State, + PostalCode: ppmShipment.PickupAddress.PostalCode, }, }, }, nil) @@ -150,9 +168,9 @@ func buildPPMShipmentWithBuildType(db *pop.Connection, customs []Customization, { Model: models.Address{ StreetAddress1: "1234 Third Street", - City: destinationAddress.City, - State: destinationAddress.State, - PostalCode: destinationAddress.PostalCode, + City: ppmShipment.DestinationAddress.City, + State: ppmShipment.DestinationAddress.State, + PostalCode: ppmShipment.DestinationAddress.PostalCode, }, }, }, nil) diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go index 2a6e1b70a97..cd1f99edda3 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go @@ -96,7 +96,7 @@ func (r DistanceZipLookup) lookup(appCtx appcontext.AppContext, keyData *Service pickupZip = mtoShipment.PPMShipment.PickupAddress.PostalCode destinationZip = portLocation.UsPostRegionCity.UsprZipID } else { - // OCONUS -> OCONUS mileage they don't get reimbursed for + // OCONUS -> OCONUS mileage they don't get reimbursed for this return strconv.Itoa(0), nil } } else { diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go index eeb37166850..918442f2ca5 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go @@ -125,6 +125,56 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { suite.Equal(unit.Miles(defaultInternationalZipDistance), *mtoShipment.Distance) }) + suite.Run("Call ZipTransitDistance on international PPMs with CONUS -> Tacoma Port ZIP", func() { + miles := unit.Miles(defaultZipDistance) + + ppmShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + Distance: &miles, + ShipmentType: models.MTOShipmentTypePPM, + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + distanceZipLookup := DistanceZipLookup{ + PickupAddress: models.Address{PostalCode: ppmShipment.PickupAddress.PostalCode}, + DestinationAddress: models.Address{PostalCode: ppmShipment.DestinationAddress.PostalCode}, + } + + appContext := suite.AppContextForTest() + distance, err := distanceZipLookup.lookup(appContext, &ServiceItemParamKeyData{ + planner: suite.planner, + mtoShipmentID: &ppmShipment.ShipmentID, + }) + suite.NoError(err) + suite.NotNil(distance) + + planner := suite.planner.(*mocks.Planner) + // should be called with the 98424 ZIP of the Tacoma port and NOT 99505 + planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupAddress.PostalCode, "98424", false, true) + }) + suite.Run("Calculate transit zip distance with an approved Destination SIT service item", func() { testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ ReContractYear: models.ReContractYear{ diff --git a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go index 847093df3e2..7ee8d005782 100644 --- a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup.go @@ -147,7 +147,7 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP Where("contract_id = ?", contractID). Where("service_id = ?", serviceID). Where("is_peak_period = ?", isPeakPeriod). - Where("origin_rate_area_id = ?", originRateAreaID). + Where("rate_area_id = ?", originRateAreaID). First(&reIntlOtherPrice) if err != nil { return "", fmt.Errorf("error fetching IOFSIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, originRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, originRateAreaID, err) @@ -166,7 +166,7 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP Where("contract_id = ?", contractID). Where("service_id = ?", serviceID). Where("is_peak_period = ?", isPeakPeriod). - Where("origin_rate_area_id = ?", originRateAreaID). + Where("rate_area_id = ?", originRateAreaID). First(&reIntlOtherPrice) if err != nil { return "", fmt.Errorf("error fetching IOASIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, originRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, originRateAreaID, err) @@ -185,7 +185,7 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP Where("contract_id = ?", contractID). Where("service_id = ?", serviceID). Where("is_peak_period = ?", isPeakPeriod). - Where("destination_rate_area_id = ?", destRateAreaID). + Where("rate_area_id = ?", destRateAreaID). First(&reIntlOtherPrice) if err != nil { return "", fmt.Errorf("error fetching IDFSIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, destRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, destRateAreaID, err) @@ -204,7 +204,7 @@ func (p PerUnitCentsLookup) lookup(appCtx appcontext.AppContext, s *ServiceItemP Where("contract_id = ?", contractID). Where("service_id = ?", serviceID). Where("is_peak_period = ?", isPeakPeriod). - Where("destination_rate_area_id = ?", destRateAreaID). + Where("rate_area_id = ?", destRateAreaID). First(&reIntlOtherPrice) if err != nil { return "", fmt.Errorf("error fetching IDASIT per unit cents for contractID: %s, serviceID %s, isPeakPeriod: %t, destRateAreaID: %s: %s", contractID, serviceID, isPeakPeriod, destRateAreaID, err) diff --git a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup_test.go b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup_test.go index 9937f86217b..dc69b69f888 100644 --- a/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/per_unit_cents_lookup_test.go @@ -30,6 +30,105 @@ func (suite *ServiceParamValueLookupsSuite) TestPerUnitCentsLookup() { } + setupTestDataPickupOCONUS := func(serviceCode models.ReServiceCode) models.Move { + testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "Anchorage", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + PickupAddressID: &address.ID, + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + mtoServiceItem = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: shipment, + LinkOnly: true, + }, + { + Model: models.ReService{ + Code: serviceCode, + }, + }, + }, nil) + + return move + } + + setupTestDataDestOCONUS := func(serviceCode models.ReServiceCode) models.Move { + testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + address := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "Anchorage", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + DestinationAddressID: &address.ID, + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + mtoServiceItem = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: shipment, + LinkOnly: true, + }, + { + Model: models.ReService{ + Code: serviceCode, + }, + }, + }, nil) + return move + } + suite.Run("success - returns perUnitCent value for IHPK", func() { setupTestData(models.ReServiceCodeIHPK) @@ -119,6 +218,115 @@ func (suite *ServiceParamValueLookupsSuite) TestPerUnitCentsLookup() { suite.Equal(perUnitCents, "1605") }) + suite.Run("success - returns perUnitCent value for IOFSIT", func() { + move := setupTestDataPickupOCONUS(models.ReServiceCodeIOFSIT) + + paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), move.ID, nil) + suite.FatalNoError(err) + + perUnitCents, err := paramLookup.ServiceParamValue(suite.AppContextForTest(), key) + suite.FatalNoError(err) + suite.Equal(perUnitCents, "607") + }) + + suite.Run("success - returns perUnitCent value for IOASIT", func() { + move := setupTestDataPickupOCONUS(models.ReServiceCodeIOASIT) + + paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), move.ID, nil) + suite.FatalNoError(err) + + perUnitCents, err := paramLookup.ServiceParamValue(suite.AppContextForTest(), key) + suite.FatalNoError(err) + suite.Equal(perUnitCents, "14") + }) + + suite.Run("success - returns perUnitCent value for IDFSIT", func() { + move := setupTestDataDestOCONUS(models.ReServiceCodeIDFSIT) + + paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), move.ID, nil) + suite.FatalNoError(err) + + perUnitCents, err := paramLookup.ServiceParamValue(suite.AppContextForTest(), key) + suite.FatalNoError(err) + suite.Equal(perUnitCents, "607") + }) + + suite.Run("success - returns perUnitCent value for IDASIT", func() { + move := setupTestDataDestOCONUS(models.ReServiceCodeIDASIT) + + paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), move.ID, nil) + suite.FatalNoError(err) + + perUnitCents, err := paramLookup.ServiceParamValue(suite.AppContextForTest(), key) + suite.FatalNoError(err) + suite.Equal(perUnitCents, "14") + }) + + suite.Run("success - returns perUnitCent value for IDASIT for a PPM", func() { + contractYear := testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + ActualPickupDate: models.TimePointer(time.Now()), + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + mtoServiceItem = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + { + Model: models.ReService{ + Code: models.ReServiceCodeIDASIT, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + _, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), mtoServiceItem.MoveTaskOrderID, nil) + suite.FatalNoError(err) + + perUnitCentsLookup := PerUnitCentsLookup{ + ServiceItem: mtoServiceItem, + MTOShipment: ppm.Shipment, + } + + appContext := suite.AppContextForTest() + perUnitCents, err := perUnitCentsLookup.lookup(appContext, &ServiceItemParamKeyData{ + planner: suite.planner, + mtoShipmentID: &ppm.ShipmentID, + ContractID: contractYear.ContractID, + }) + suite.NoError(err) + suite.Equal(perUnitCents, "14") + }) + suite.Run("failure - unauthorized service code", func() { setupTestData(models.ReServiceCodeDUPK) diff --git a/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go b/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go index 4410ba8e198..3f8776e0ecf 100644 --- a/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go @@ -85,7 +85,76 @@ func (suite *ServiceParamValueLookupsSuite) TestPortZipLookup() { suite.Equal(portZip, port.UsPostRegionCity.UsprZipID) }) - suite.Run("failure - no port zip on service item", func() { + suite.Run("success - returns PortZip value for Port Code 3002 for PPMs", func() { + port := factory.FetchPortLocation(suite.DB(), []factory.Customization{ + { + Model: models.Port{ + PortCode: "3002", + }, + }, + }, nil) + + contractYear := testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: time.Now().Add(-24 * time.Hour), + EndDate: time.Now().Add(24 * time.Hour), + }, + }) + + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + ActualPickupDate: models.TimePointer(time.Now()), + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + mtoServiceItem = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + }, nil) + + _, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), mtoServiceItem.MoveTaskOrderID, nil) + suite.FatalNoError(err) + + portZipLookup := PortZipLookup{ + ServiceItem: mtoServiceItem, + } + + appContext := suite.AppContextForTest() + portZip, err := portZipLookup.lookup(appContext, &ServiceItemParamKeyData{ + planner: suite.planner, + mtoShipmentID: &ppm.ShipmentID, + ContractID: contractYear.ContractID, + }) + suite.NoError(err) + suite.Equal(portZip, port.UsPostRegionCity.UsprZipID) + }) + + suite.Run("returns nothing if shipment is HHG and service item does not have port info", func() { testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ ReContractYear: models.ReContractYear{ StartDate: time.Now().Add(-24 * time.Hour), @@ -108,7 +177,8 @@ func (suite *ServiceParamValueLookupsSuite) TestPortZipLookup() { paramLookup, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, mtoServiceItem, uuid.Must(uuid.NewV4()), mtoServiceItem.MoveTaskOrderID, nil) suite.FatalNoError(err) - _, err = paramLookup.ServiceParamValue(suite.AppContextForTest(), key) - suite.Error(err) + portZip, err := paramLookup.ServiceParamValue(suite.AppContextForTest(), key) + suite.NoError(err) + suite.Equal(portZip, "") }) } diff --git a/pkg/services/mocks/IntlDestinationAdditionalDaySITPricer.go b/pkg/services/mocks/IntlDestinationAdditionalDaySITPricer.go new file mode 100644 index 00000000000..7a11b759d7f --- /dev/null +++ b/pkg/services/mocks/IntlDestinationAdditionalDaySITPricer.go @@ -0,0 +1,109 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + appcontext "github.com/transcom/mymove/pkg/appcontext" + + models "github.com/transcom/mymove/pkg/models" + + services "github.com/transcom/mymove/pkg/services" + + time "time" + + unit "github.com/transcom/mymove/pkg/unit" +) + +// IntlDestinationAdditionalDaySITPricer is an autogenerated mock type for the IntlDestinationAdditionalDaySITPricer type +type IntlDestinationAdditionalDaySITPricer struct { + mock.Mock +} + +// Price provides a mock function with given fields: appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents +func (_m *IntlDestinationAdditionalDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + + if len(ret) == 0 { + panic("no return value specified for Price") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) unit.Cents); ok { + r0 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) services.PricingDisplayParams); ok { + r1 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) error); ok { + r2 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PriceUsingParams provides a mock function with given fields: appCtx, params +func (_m *IntlDestinationAdditionalDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, params) + + if len(ret) == 0 { + panic("no return value specified for PriceUsingParams") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, params) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) unit.Cents); ok { + r0 = rf(appCtx, params) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.PaymentServiceItemParams) services.PricingDisplayParams); ok { + r1 = rf(appCtx, params) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, models.PaymentServiceItemParams) error); ok { + r2 = rf(appCtx, params) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// NewIntlDestinationAdditionalDaySITPricer creates a new instance of IntlDestinationAdditionalDaySITPricer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewIntlDestinationAdditionalDaySITPricer(t interface { + mock.TestingT + Cleanup(func()) +}) *IntlDestinationAdditionalDaySITPricer { + mock := &IntlDestinationAdditionalDaySITPricer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/services/mocks/IntlDestinationFirstDaySITPricer.go b/pkg/services/mocks/IntlDestinationFirstDaySITPricer.go new file mode 100644 index 00000000000..99df36da131 --- /dev/null +++ b/pkg/services/mocks/IntlDestinationFirstDaySITPricer.go @@ -0,0 +1,109 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + appcontext "github.com/transcom/mymove/pkg/appcontext" + + models "github.com/transcom/mymove/pkg/models" + + services "github.com/transcom/mymove/pkg/services" + + time "time" + + unit "github.com/transcom/mymove/pkg/unit" +) + +// IntlDestinationFirstDaySITPricer is an autogenerated mock type for the IntlDestinationFirstDaySITPricer type +type IntlDestinationFirstDaySITPricer struct { + mock.Mock +} + +// Price provides a mock function with given fields: appCtx, contractCode, requestedPickupDate, weight, perUnitCents +func (_m *IntlDestinationFirstDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + + if len(ret) == 0 { + panic("no return value specified for Price") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) unit.Cents); ok { + r0 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) services.PricingDisplayParams); ok { + r1 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) error); ok { + r2 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PriceUsingParams provides a mock function with given fields: appCtx, params +func (_m *IntlDestinationFirstDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, params) + + if len(ret) == 0 { + panic("no return value specified for PriceUsingParams") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, params) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) unit.Cents); ok { + r0 = rf(appCtx, params) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.PaymentServiceItemParams) services.PricingDisplayParams); ok { + r1 = rf(appCtx, params) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, models.PaymentServiceItemParams) error); ok { + r2 = rf(appCtx, params) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// NewIntlDestinationFirstDaySITPricer creates a new instance of IntlDestinationFirstDaySITPricer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewIntlDestinationFirstDaySITPricer(t interface { + mock.TestingT + Cleanup(func()) +}) *IntlDestinationFirstDaySITPricer { + mock := &IntlDestinationFirstDaySITPricer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/services/mocks/IntlOriginAdditionalDaySITPricer.go b/pkg/services/mocks/IntlOriginAdditionalDaySITPricer.go new file mode 100644 index 00000000000..a931b2d3879 --- /dev/null +++ b/pkg/services/mocks/IntlOriginAdditionalDaySITPricer.go @@ -0,0 +1,109 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + appcontext "github.com/transcom/mymove/pkg/appcontext" + + models "github.com/transcom/mymove/pkg/models" + + services "github.com/transcom/mymove/pkg/services" + + time "time" + + unit "github.com/transcom/mymove/pkg/unit" +) + +// IntlOriginAdditionalDaySITPricer is an autogenerated mock type for the IntlOriginAdditionalDaySITPricer type +type IntlOriginAdditionalDaySITPricer struct { + mock.Mock +} + +// Price provides a mock function with given fields: appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents +func (_m *IntlOriginAdditionalDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + + if len(ret) == 0 { + panic("no return value specified for Price") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) unit.Cents); ok { + r0 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) services.PricingDisplayParams); ok { + r1 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, string, time.Time, int, unit.Pound, int) error); ok { + r2 = rf(appCtx, contractCode, requestedPickupDate, numberOfDaysInSIT, weight, perUnitCents) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PriceUsingParams provides a mock function with given fields: appCtx, params +func (_m *IntlOriginAdditionalDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, params) + + if len(ret) == 0 { + panic("no return value specified for PriceUsingParams") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, params) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) unit.Cents); ok { + r0 = rf(appCtx, params) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.PaymentServiceItemParams) services.PricingDisplayParams); ok { + r1 = rf(appCtx, params) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, models.PaymentServiceItemParams) error); ok { + r2 = rf(appCtx, params) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// NewIntlOriginAdditionalDaySITPricer creates a new instance of IntlOriginAdditionalDaySITPricer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewIntlOriginAdditionalDaySITPricer(t interface { + mock.TestingT + Cleanup(func()) +}) *IntlOriginAdditionalDaySITPricer { + mock := &IntlOriginAdditionalDaySITPricer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/services/mocks/IntlOriginFirstDaySITPricer.go b/pkg/services/mocks/IntlOriginFirstDaySITPricer.go new file mode 100644 index 00000000000..d36cb1e92c9 --- /dev/null +++ b/pkg/services/mocks/IntlOriginFirstDaySITPricer.go @@ -0,0 +1,109 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + appcontext "github.com/transcom/mymove/pkg/appcontext" + + models "github.com/transcom/mymove/pkg/models" + + services "github.com/transcom/mymove/pkg/services" + + time "time" + + unit "github.com/transcom/mymove/pkg/unit" +) + +// IntlOriginFirstDaySITPricer is an autogenerated mock type for the IntlOriginFirstDaySITPricer type +type IntlOriginFirstDaySITPricer struct { + mock.Mock +} + +// Price provides a mock function with given fields: appCtx, contractCode, requestedPickupDate, weight, perUnitCents +func (_m *IntlOriginFirstDaySITPricer) Price(appCtx appcontext.AppContext, contractCode string, requestedPickupDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + + if len(ret) == 0 { + panic("no return value specified for Price") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) unit.Cents); ok { + r0 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) services.PricingDisplayParams); ok { + r1 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, string, time.Time, unit.Pound, int) error); ok { + r2 = rf(appCtx, contractCode, requestedPickupDate, weight, perUnitCents) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// PriceUsingParams provides a mock function with given fields: appCtx, params +func (_m *IntlOriginFirstDaySITPricer) PriceUsingParams(appCtx appcontext.AppContext, params models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error) { + ret := _m.Called(appCtx, params) + + if len(ret) == 0 { + panic("no return value specified for PriceUsingParams") + } + + var r0 unit.Cents + var r1 services.PricingDisplayParams + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) (unit.Cents, services.PricingDisplayParams, error)); ok { + return rf(appCtx, params) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.PaymentServiceItemParams) unit.Cents); ok { + r0 = rf(appCtx, params) + } else { + r0 = ret.Get(0).(unit.Cents) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.PaymentServiceItemParams) services.PricingDisplayParams); ok { + r1 = rf(appCtx, params) + } else { + if ret.Get(1) != nil { + r1 = ret.Get(1).(services.PricingDisplayParams) + } + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, models.PaymentServiceItemParams) error); ok { + r2 = rf(appCtx, params) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + +// NewIntlOriginFirstDaySITPricer creates a new instance of IntlOriginFirstDaySITPricer. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewIntlOriginFirstDaySITPricer(t interface { + mock.TestingT + Cleanup(func()) +}) *IntlOriginFirstDaySITPricer { + mock := &IntlOriginFirstDaySITPricer{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From 221d441d79ad27d56ece5d070c49a738ce1a585c Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Tue, 21 Jan 2025 16:00:53 +0000 Subject: [PATCH 062/229] ui changes per PO request --- .../MoveHistory/Database/FieldMappings.js | 3 +++ .../UpdatePaymentRequestStatusMoves.jsx | 10 ++++++---- .../UpdatePaymentRequestStatusMoves.test.jsx | 5 +++-- .../updateServiceItemStatusUpdateMove.jsx | 7 ++++++- .../updateServiceItemStatusUpdateMove.test.jsx | 1 + src/utils/formatters.js | 18 +++++++++++++----- 6 files changed, 32 insertions(+), 12 deletions(-) diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 5cfeab3e8a4..7f5e1af179c 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -151,4 +151,7 @@ export default { assigned_sc: 'Counselor assigned', assigned_too: 'Task ordering officer assigned', assigned_tio: 'Task invoicing officer assigned', + re_assigned_sc: 'Counselor reassigned', + re_assigned_too: 'Task ordering officer reassigned', + re_assigned_tio: 'Task invoicing officer reassigned', }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx index fb63a54891d..82fa3b3d2c7 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.jsx @@ -9,8 +9,10 @@ export default { eventName: o.updatePaymentRequestStatus, tableName: t.moves, getEventNameDisplay: () => 'Updated move', - getDetails: ({ changedValues }) => { - if (changedValues?.tio_assigned_id !== undefined) return <> Task Invoicing Officer Unassigned ; - return <> - ; - }, + getDetails: ({ changedValues }) => ( + <> +
Payment Requests Addressed
+ {changedValues?.tio_assigned_id !== undefined ?
Task Invoicing Officer Unassigned
: null} + + ), }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx index 8e555c10d84..4868aefe01c 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves.test.jsx @@ -21,11 +21,11 @@ describe('When given a completed services counseling for a move', () => { expect(screen.getByText('Updated move')).toBeInTheDocument(); }); - it('defaults to blank entry if TIO ID is not present in changedValues', () => { + it('displays default when TIO ID is not present', () => { const template = getTemplate(historyRecord); render(template.getDetails(historyRecord)); - expect(screen.getByText('-')).toBeInTheDocument(); + expect(screen.getByText('Payment Requests Addressed')).toBeInTheDocument(); }); it('displays correct details when a TIO is unassigned', () => { @@ -36,6 +36,7 @@ describe('When given a completed services counseling for a move', () => { const template = getTemplate(historyRecord); render(template.getDetails(historyRecord)); + expect(screen.getByText('Payment Requests Addressed')).toBeInTheDocument(); expect(screen.getByText('Task Invoicing Officer Unassigned')).toBeInTheDocument(); }); }); diff --git a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx index 4f0a084d37c..0bd4ffcedd8 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.jsx @@ -14,7 +14,12 @@ export default { return ( <> - {historyRecord.changedValues.too_assigned_id !== undefined ? <>Task Ordering Officer Unassigned : null} + {historyRecord?.changedValues?.too_assigned_id !== undefined ? ( + <> +
Service Items Addressed
+
Task Ordering Officer Unassigned
+ + ) : null} ); }, diff --git a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx index b77cade3d48..94d6497cd49 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateServiceItemStatus/updateServiceItemStatusUpdateMove.test.jsx @@ -34,6 +34,7 @@ describe('when given a update service item status, update move history record', const template = getTemplate(historyRecord); render(template.getDetails(historyRecord)); + expect(screen.getByText('Service Items Addressed')).toBeInTheDocument(); expect(screen.getByText('Task Ordering Officer Unassigned')).toBeInTheDocument(); }); }); diff --git a/src/utils/formatters.js b/src/utils/formatters.js index 5944ecec67f..d979dcdc624 100644 --- a/src/utils/formatters.js +++ b/src/utils/formatters.js @@ -602,16 +602,24 @@ export const constructSCOrderOconusFields = (values) => { }; export const formatAssignedOfficeUserFromContext = (historyRecord) => { - const { changedValues, context } = historyRecord; + const { changedValues, context, oldValues } = historyRecord; const newValues = {}; if (!context) return newValues; const name = `${context[0].assigned_office_user_last_name}, ${context[0].assigned_office_user_first_name}`; - if (changedValues.sc_assigned_id) newValues.assigned_sc = name; - if (changedValues.too_assigned_id) newValues.assigned_too = name; - if (changedValues.tio_assigned_id) newValues.assigned_tio = name; - + if (changedValues?.sc_assigned_id) { + if (oldValues.sc_assigned_id === null) newValues.assigned_sc = name; + if (oldValues.sc_assigned_id !== null) newValues.re_assigned_sc = name; + } + if (changedValues?.too_assigned_id) { + if (oldValues.too_assigned_id === null) newValues.assigned_too = name; + if (oldValues.too_assigned_id !== null) newValues.re_assigned_too = name; + } + if (changedValues?.tio_assigned_id) { + if (oldValues.tio_assigned_id === null) newValues.assigned_tio = name; + if (oldValues.tio_assigned_id !== null) newValues.re_assigned_tio = name; + } return newValues; }; /** From 7fad2a1d0065308d1f833aa1c3b7a8faf4549461 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 16:43:25 +0000 Subject: [PATCH 063/229] added tests for pricers and ghcrateengine --- ..._destination_additional_days_sit_pricer.go | 4 +- ...ination_additional_days_sit_pricer_test.go | 127 ++++++++++++++++++ ...l_destination_first_day_sit_pricer_test.go | 116 ++++++++++++++++ ..._origin_additional_days_sit_pricer_test.go | 127 ++++++++++++++++++ .../intl_origin_first_day_sit_pricer_test.go | 116 ++++++++++++++++ .../ghcrateengine/pricer_helpers_intl.go | 4 +- .../ghcrateengine/pricer_helpers_intl_test.go | 106 +++++++++++++++ 7 files changed, 596 insertions(+), 4 deletions(-) create mode 100644 pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer_test.go create mode 100644 pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer_test.go create mode 100644 pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer_test.go create mode 100644 pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer_test.go diff --git a/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go index 465099cf73f..ed57a28b57c 100644 --- a/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go +++ b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer.go @@ -26,12 +26,12 @@ func (p intlDestinationAdditionalDaySITPricer) PriceUsingParams(appCtx appcontex return unit.Cents(0), nil, err } - numberOfDaysInSIT, err := getParamInt(params, models.ServiceItemParamNameNumberDaysSIT) + referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) if err != nil { return unit.Cents(0), nil, err } - referenceDate, err := getParamTime(params, models.ServiceItemParamNameReferenceDate) + numberOfDaysInSIT, err := getParamInt(params, models.ServiceItemParamNameNumberDaysSIT) if err != nil { return unit.Cents(0), nil, err } diff --git a/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer_test.go b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer_test.go new file mode 100644 index 00000000000..76a40753891 --- /dev/null +++ b/pkg/services/ghcrateengine/intl_destination_additional_days_sit_pricer_test.go @@ -0,0 +1,127 @@ +package ghcrateengine + +import ( + "fmt" + "strconv" + "time" + + "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/testdatagen" + "github.com/transcom/mymove/pkg/unit" +) + +const ( + idasitTestContractYearName = "Base Period Year 1" + idasitTestPerUnitCents = unit.Cents(15000) + idasitTestTotalCost = unit.Cents(1575000) + idasitTestIsPeakPeriod = true + idasitTestEscalationCompounded = 1.0000 + idasitTestWeight = unit.Pound(2100) + idasitTestPriceCents = unit.Cents(500) + idasitNumerDaysInSIT = 5 +) + +var idasitTestRequestedPickupDate = time.Date(testdatagen.TestYear, peakStart.month, peakStart.day, 0, 0, 0, 0, time.UTC) + +func (suite *GHCRateEngineServiceSuite) TestIntlDestinationAdditionalDaySITPricer() { + pricer := NewIntlDestinationAdditionalDaySITPricer() + + suite.Run("success using PaymentServiceItemParams", func() { + paymentServiceItem := suite.setupIntlDestinationAdditionalDayServiceItem() + + totalCost, displayParams, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.NoError(err) + suite.Equal(idasitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: idasitTestContractYearName}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(idasitTestPerUnitCents)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(idasitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(idasitTestEscalationCompounded)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("invalid parameters to PriceUsingParams", func() { + paymentServiceItem := suite.setupIntlDestinationAdditionalDayServiceItem() + + // WeightBilled + paymentServiceItem.PaymentServiceItemParams[4].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameWeightBilled)) + + // PerUnitCents + paymentServiceItem.PaymentServiceItemParams[3].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNamePerUnitCents)) + + // NumberDaysSIT + paymentServiceItem.PaymentServiceItemParams[2].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameNumberDaysSIT)) + + // ReferenceDate + paymentServiceItem.PaymentServiceItemParams[1].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a time", models.ServiceItemParamNameReferenceDate)) + + // ContractCode + paymentServiceItem.PaymentServiceItemParams[0].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a string", models.ServiceItemParamNameContractCode)) + }) +} + +func (suite *GHCRateEngineServiceSuite) setupIntlDestinationAdditionalDayServiceItem() models.PaymentServiceItem { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + startDate := time.Date(2018, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2018, time.December, 31, 12, 0, 0, 0, time.UTC) + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + return factory.BuildPaymentServiceItemWithParams( + suite.DB(), + models.ReServiceCodeIDASIT, + []factory.CreatePaymentServiceItemParams{ + { + Key: models.ServiceItemParamNameContractCode, + KeyType: models.ServiceItemParamTypeString, + Value: contract.Code, + }, + { + Key: models.ServiceItemParamNameReferenceDate, + KeyType: models.ServiceItemParamTypeDate, + Value: idasitTestRequestedPickupDate.Format(DateParamFormat), + }, + { + Key: models.ServiceItemParamNameNumberDaysSIT, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(idasitNumerDaysInSIT)), + }, + { + Key: models.ServiceItemParamNamePerUnitCents, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(idasitTestPerUnitCents)), + }, + { + Key: models.ServiceItemParamNameWeightBilled, + KeyType: models.ServiceItemParamTypeInteger, + Value: strconv.Itoa(idasitTestWeight.Int()), + }, + }, nil, nil, + ) +} diff --git a/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer_test.go b/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer_test.go new file mode 100644 index 00000000000..fbaebec2df0 --- /dev/null +++ b/pkg/services/ghcrateengine/intl_destination_first_day_sit_pricer_test.go @@ -0,0 +1,116 @@ +package ghcrateengine + +import ( + "fmt" + "strconv" + "time" + + "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/testdatagen" + "github.com/transcom/mymove/pkg/unit" +) + +const ( + idfsitTestContractYearName = "Base Period Year 1" + idfsitTestPerUnitCents = unit.Cents(15000) + idfsitTestTotalCost = unit.Cents(315000) + idfsitTestIsPeakPeriod = true + idfsitTestEscalationCompounded = 1.0000 + idfsitTestWeight = unit.Pound(2100) + idfsitTestPriceCents = unit.Cents(500) + idfsitNumerDaysInSIT = 5 +) + +var idfsitTestRequestedPickupDate = time.Date(testdatagen.TestYear, peakStart.month, peakStart.day, 0, 0, 0, 0, time.UTC) + +func (suite *GHCRateEngineServiceSuite) TestIntlDestinationFirstDaySITPricer() { + pricer := NewIntlDestinationFirstDaySITPricer() + + suite.Run("success using PaymentServiceItemParams", func() { + paymentServiceItem := suite.setupIntlDestinationFirstDayServiceItem() + + totalCost, displayParams, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.NoError(err) + suite.Equal(idfsitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: idfsitTestContractYearName}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(idfsitTestPerUnitCents)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(idfsitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(idfsitTestEscalationCompounded)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("invalid parameters to PriceUsingParams", func() { + paymentServiceItem := suite.setupIntlDestinationFirstDayServiceItem() + + // WeightBilled + paymentServiceItem.PaymentServiceItemParams[3].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameWeightBilled)) + + // PerUnitCents + paymentServiceItem.PaymentServiceItemParams[2].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNamePerUnitCents)) + + // ReferenceDate + paymentServiceItem.PaymentServiceItemParams[1].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a time", models.ServiceItemParamNameReferenceDate)) + + // ContractCode + paymentServiceItem.PaymentServiceItemParams[0].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a string", models.ServiceItemParamNameContractCode)) + }) +} + +func (suite *GHCRateEngineServiceSuite) setupIntlDestinationFirstDayServiceItem() models.PaymentServiceItem { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + startDate := time.Date(2018, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2018, time.December, 31, 12, 0, 0, 0, time.UTC) + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + return factory.BuildPaymentServiceItemWithParams( + suite.DB(), + models.ReServiceCodeIDFSIT, + []factory.CreatePaymentServiceItemParams{ + { + Key: models.ServiceItemParamNameContractCode, + KeyType: models.ServiceItemParamTypeString, + Value: contract.Code, + }, + { + Key: models.ServiceItemParamNameReferenceDate, + KeyType: models.ServiceItemParamTypeDate, + Value: idfsitTestRequestedPickupDate.Format(DateParamFormat), + }, + { + Key: models.ServiceItemParamNamePerUnitCents, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(idfsitTestPerUnitCents)), + }, + { + Key: models.ServiceItemParamNameWeightBilled, + KeyType: models.ServiceItemParamTypeInteger, + Value: strconv.Itoa(idfsitTestWeight.Int()), + }, + }, nil, nil, + ) +} diff --git a/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer_test.go b/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer_test.go new file mode 100644 index 00000000000..87686d5110a --- /dev/null +++ b/pkg/services/ghcrateengine/intl_origin_additional_days_sit_pricer_test.go @@ -0,0 +1,127 @@ +package ghcrateengine + +import ( + "fmt" + "strconv" + "time" + + "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/testdatagen" + "github.com/transcom/mymove/pkg/unit" +) + +const ( + ioasitTestContractYearName = "Base Period Year 1" + ioasitTestPerUnitCents = unit.Cents(15000) + ioasitTestTotalCost = unit.Cents(1575000) + ioasitTestIsPeakPeriod = true + ioasitTestEscalationCompounded = 1.0000 + ioasitTestWeight = unit.Pound(2100) + ioasitTestPriceCents = unit.Cents(500) + ioasitNumerDaysInSIT = 5 +) + +var ioasitTestRequestedPickupDate = time.Date(testdatagen.TestYear, peakStart.month, peakStart.day, 0, 0, 0, 0, time.UTC) + +func (suite *GHCRateEngineServiceSuite) TestIntlOriginAdditionalDaySITPricer() { + pricer := NewIntlOriginAdditionalDaySITPricer() + + suite.Run("success using PaymentServiceItemParams", func() { + paymentServiceItem := suite.setupIntlOriginAdditionalDayServiceItem() + + totalCost, displayParams, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.NoError(err) + suite.Equal(ioasitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: ioasitTestContractYearName}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(ioasitTestPerUnitCents)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(ioasitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(ioasitTestEscalationCompounded)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("invalid parameters to PriceUsingParams", func() { + paymentServiceItem := suite.setupIntlOriginAdditionalDayServiceItem() + + // WeightBilled + paymentServiceItem.PaymentServiceItemParams[4].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameWeightBilled)) + + // PerUnitCents + paymentServiceItem.PaymentServiceItemParams[3].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNamePerUnitCents)) + + // NumberDaysSIT + paymentServiceItem.PaymentServiceItemParams[2].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameNumberDaysSIT)) + + // ReferenceDate + paymentServiceItem.PaymentServiceItemParams[1].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a time", models.ServiceItemParamNameReferenceDate)) + + // ContractCode + paymentServiceItem.PaymentServiceItemParams[0].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a string", models.ServiceItemParamNameContractCode)) + }) +} + +func (suite *GHCRateEngineServiceSuite) setupIntlOriginAdditionalDayServiceItem() models.PaymentServiceItem { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + startDate := time.Date(2018, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2018, time.December, 31, 12, 0, 0, 0, time.UTC) + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + return factory.BuildPaymentServiceItemWithParams( + suite.DB(), + models.ReServiceCodeIOASIT, + []factory.CreatePaymentServiceItemParams{ + { + Key: models.ServiceItemParamNameContractCode, + KeyType: models.ServiceItemParamTypeString, + Value: contract.Code, + }, + { + Key: models.ServiceItemParamNameReferenceDate, + KeyType: models.ServiceItemParamTypeDate, + Value: ioasitTestRequestedPickupDate.Format(DateParamFormat), + }, + { + Key: models.ServiceItemParamNameNumberDaysSIT, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(ioasitNumerDaysInSIT)), + }, + { + Key: models.ServiceItemParamNamePerUnitCents, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(ioasitTestPerUnitCents)), + }, + { + Key: models.ServiceItemParamNameWeightBilled, + KeyType: models.ServiceItemParamTypeInteger, + Value: strconv.Itoa(ioasitTestWeight.Int()), + }, + }, nil, nil, + ) +} diff --git a/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer_test.go b/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer_test.go new file mode 100644 index 00000000000..ae6d9069fc4 --- /dev/null +++ b/pkg/services/ghcrateengine/intl_origin_first_day_sit_pricer_test.go @@ -0,0 +1,116 @@ +package ghcrateengine + +import ( + "fmt" + "strconv" + "time" + + "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/testdatagen" + "github.com/transcom/mymove/pkg/unit" +) + +const ( + iofsitTestContractYearName = "Base Period Year 1" + iofsitTestPerUnitCents = unit.Cents(15000) + iofsitTestTotalCost = unit.Cents(315000) + iofsitTestIsPeakPeriod = true + iofsitTestEscalationCompounded = 1.0000 + iofsitTestWeight = unit.Pound(2100) + iofsitTestPriceCents = unit.Cents(500) + iofsitNumerDaysInSIT = 5 +) + +var iofsitTestRequestedPickupDate = time.Date(testdatagen.TestYear, peakStart.month, peakStart.day, 0, 0, 0, 0, time.UTC) + +func (suite *GHCRateEngineServiceSuite) TestIntlOriginFirstDaySITPricer() { + pricer := NewIntlOriginFirstDaySITPricer() + + suite.Run("success using PaymentServiceItemParams", func() { + paymentServiceItem := suite.setupIntlOriginFirstDayServiceItem() + + totalCost, displayParams, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.NoError(err) + suite.Equal(iofsitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: iofsitTestContractYearName}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(iofsitTestPerUnitCents)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(iofsitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(iofsitTestEscalationCompounded)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("invalid parameters to PriceUsingParams", func() { + paymentServiceItem := suite.setupIntlOriginFirstDayServiceItem() + + // WeightBilled + paymentServiceItem.PaymentServiceItemParams[3].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err := pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNameWeightBilled)) + + // PerUnitCents + paymentServiceItem.PaymentServiceItemParams[2].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to an int", models.ServiceItemParamNamePerUnitCents)) + + // ReferenceDate + paymentServiceItem.PaymentServiceItemParams[1].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a time", models.ServiceItemParamNameReferenceDate)) + + // ContractCode + paymentServiceItem.PaymentServiceItemParams[0].ServiceItemParamKey.Type = models.ServiceItemParamTypeBoolean + _, _, err = pricer.PriceUsingParams(suite.AppContextForTest(), paymentServiceItem.PaymentServiceItemParams) + suite.Error(err) + suite.Contains(err.Error(), fmt.Sprintf("trying to convert %s to a string", models.ServiceItemParamNameContractCode)) + }) +} + +func (suite *GHCRateEngineServiceSuite) setupIntlOriginFirstDayServiceItem() models.PaymentServiceItem { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + startDate := time.Date(2018, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2018, time.December, 31, 12, 0, 0, 0, time.UTC) + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + return factory.BuildPaymentServiceItemWithParams( + suite.DB(), + models.ReServiceCodeIOFSIT, + []factory.CreatePaymentServiceItemParams{ + { + Key: models.ServiceItemParamNameContractCode, + KeyType: models.ServiceItemParamTypeString, + Value: contract.Code, + }, + { + Key: models.ServiceItemParamNameReferenceDate, + KeyType: models.ServiceItemParamTypeDate, + Value: iofsitTestRequestedPickupDate.Format(DateParamFormat), + }, + { + Key: models.ServiceItemParamNamePerUnitCents, + KeyType: models.ServiceItemParamTypeInteger, + Value: fmt.Sprintf("%d", int(iofsitTestPerUnitCents)), + }, + { + Key: models.ServiceItemParamNameWeightBilled, + KeyType: models.ServiceItemParamTypeInteger, + Value: strconv.Itoa(iofsitTestWeight.Int()), + }, + }, nil, nil, + ) +} diff --git a/pkg/services/ghcrateengine/pricer_helpers_intl.go b/pkg/services/ghcrateengine/pricer_helpers_intl.go index bb49759504f..a7c1aa9f81f 100644 --- a/pkg/services/ghcrateengine/pricer_helpers_intl.go +++ b/pkg/services/ghcrateengine/pricer_helpers_intl.go @@ -67,7 +67,7 @@ func priceIntlPackUnpack(appCtx appcontext.AppContext, packUnpackCode models.ReS func priceIntlFirstDaySIT(appCtx appcontext.AppContext, firstDaySITCode models.ReServiceCode, contractCode string, referenceDate time.Time, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { if firstDaySITCode != models.ReServiceCodeIOFSIT && firstDaySITCode != models.ReServiceCodeIDFSIT { - return 0, nil, fmt.Errorf("unsupported pack/unpack code of %s", firstDaySITCode) + return 0, nil, fmt.Errorf("unsupported first day SIT code of %s", firstDaySITCode) } if len(contractCode) == 0 { return 0, nil, errors.New("ContractCode is required") @@ -119,7 +119,7 @@ func priceIntlFirstDaySIT(appCtx appcontext.AppContext, firstDaySITCode models.R func priceIntlAdditionalDaySIT(appCtx appcontext.AppContext, additionalDaySITCode models.ReServiceCode, contractCode string, referenceDate time.Time, numberOfDaysInSIT int, weight unit.Pound, perUnitCents int) (unit.Cents, services.PricingDisplayParams, error) { if additionalDaySITCode != models.ReServiceCodeIOASIT && additionalDaySITCode != models.ReServiceCodeIDASIT { - return 0, nil, fmt.Errorf("unsupported additional day of SIT code of %s", additionalDaySITCode) + return 0, nil, fmt.Errorf("unsupported additional day SIT code of %s", additionalDaySITCode) } if len(contractCode) == 0 { return 0, nil, errors.New("ContractCode is required") diff --git a/pkg/services/ghcrateengine/pricer_helpers_intl_test.go b/pkg/services/ghcrateengine/pricer_helpers_intl_test.go index 19539e4c976..848a5ad5e6a 100644 --- a/pkg/services/ghcrateengine/pricer_helpers_intl_test.go +++ b/pkg/services/ghcrateengine/pricer_helpers_intl_test.go @@ -44,3 +44,109 @@ func (suite *GHCRateEngineServiceSuite) TestPriceIntlPackUnpack() { }) } + +func (suite *GHCRateEngineServiceSuite) TestPriceIntlFirstDaySIT() { + suite.Run("success with IDFSIT", func() { + suite.setupIntlDestinationFirstDayServiceItem() + totalCost, displayParams, err := priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDFSIT, testdatagen.DefaultContractCode, idfsitTestRequestedPickupDate, idfsitTestWeight, idfsitTestPerUnitCents.Int()) + suite.NoError(err) + suite.Equal(idfsitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: idfsitTestContractYearName}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(idfsitTestEscalationCompounded)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(idfsitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(idfsitTestPerUnitCents)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("success with IOFSIT", func() { + suite.setupIntlOriginFirstDayServiceItem() + totalCost, displayParams, err := priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeIOFSIT, testdatagen.DefaultContractCode, iofsitTestRequestedPickupDate, iofsitTestWeight, iofsitTestPerUnitCents.Int()) + suite.NoError(err) + suite.Equal(iofsitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: iofsitTestContractYearName}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(iofsitTestEscalationCompounded)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(iofsitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(iofsitTestPerUnitCents)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("Invalid parameters to Price", func() { + suite.setupIntlDestinationFirstDayServiceItem() + _, _, err := priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeDLH, testdatagen.DefaultContractCode, idfsitTestRequestedPickupDate, idfsitTestWeight, idfsitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "unsupported first day SIT code") + + _, _, err = priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDFSIT, "", idfsitTestRequestedPickupDate, idfsitTestWeight, idfsitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "ContractCode is required") + + _, _, err = priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDFSIT, testdatagen.DefaultContractCode, time.Time{}, idfsitTestWeight, idfsitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "ReferenceDate is required") + + _, _, err = priceIntlFirstDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDFSIT, testdatagen.DefaultContractCode, idfsitTestRequestedPickupDate, idfsitTestWeight, 0) + suite.Error(err) + suite.Contains(err.Error(), "PerUnitCents is required") + }) +} + +func (suite *GHCRateEngineServiceSuite) TestPriceIntlAdditionalDaySIT() { + suite.Run("success with IDASIT", func() { + suite.setupIntlDestinationAdditionalDayServiceItem() + totalCost, displayParams, err := priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDASIT, testdatagen.DefaultContractCode, idasitTestRequestedPickupDate, idasitNumerDaysInSIT, idasitTestWeight, idasitTestPerUnitCents.Int()) + suite.NoError(err) + suite.Equal(idasitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: idasitTestContractYearName}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(idasitTestEscalationCompounded)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(idasitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(idasitTestPerUnitCents)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("success with IOASIT", func() { + suite.setupIntlOriginAdditionalDayServiceItem() + totalCost, displayParams, err := priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIOASIT, testdatagen.DefaultContractCode, ioasitTestRequestedPickupDate, idasitNumerDaysInSIT, ioasitTestWeight, ioasitTestPerUnitCents.Int()) + suite.NoError(err) + suite.Equal(ioasitTestTotalCost, totalCost) + + expectedParams := services.PricingDisplayParams{ + {Key: models.ServiceItemParamNameContractYearName, Value: ioasitTestContractYearName}, + {Key: models.ServiceItemParamNameEscalationCompounded, Value: FormatEscalation(ioasitTestEscalationCompounded)}, + {Key: models.ServiceItemParamNameIsPeak, Value: FormatBool(ioasitTestIsPeakPeriod)}, + {Key: models.ServiceItemParamNamePriceRateOrFactor, Value: FormatCents(ioasitTestPerUnitCents)}, + } + suite.validatePricerCreatedParams(expectedParams, displayParams) + }) + + suite.Run("Invalid parameters to Price", func() { + suite.setupIntlDestinationAdditionalDayServiceItem() + _, _, err := priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeDLH, testdatagen.DefaultContractCode, idasitTestRequestedPickupDate, idasitNumerDaysInSIT, idasitTestWeight, idasitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "unsupported additional day SIT code") + + _, _, err = priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDASIT, "", idasitTestRequestedPickupDate, idasitNumerDaysInSIT, idasitTestWeight, idasitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "ContractCode is required") + + _, _, err = priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDASIT, testdatagen.DefaultContractCode, time.Time{}, idasitNumerDaysInSIT, idasitTestWeight, idasitTestPerUnitCents.Int()) + suite.Error(err) + suite.Contains(err.Error(), "ReferenceDate is required") + + _, _, err = priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDASIT, testdatagen.DefaultContractCode, idasitTestRequestedPickupDate, idasitNumerDaysInSIT, idasitTestWeight, 0) + suite.Error(err) + suite.Contains(err.Error(), "PerUnitCents is required") + + _, _, err = priceIntlAdditionalDaySIT(suite.AppContextForTest(), models.ReServiceCodeIDASIT, testdatagen.DefaultContractCode, idasitTestRequestedPickupDate, 0, idasitTestWeight, 0) + suite.Error(err) + suite.Contains(err.Error(), "NumberDaysSIT is required") + }) +} From 97c702e34b462a16bb23bdc5ec59f4d7bea8bbb5 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Tue, 21 Jan 2025 17:24:13 +0000 Subject: [PATCH 064/229] update for tests --- .../UpdateAssignedOfficeUser.test.jsx | 5 +++++ src/utils/formatters.test.js | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx index 218b16bb2a0..bc1e6aa2d73 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdateAssignedOfficeUser/UpdateAssignedOfficeUser.test.jsx @@ -11,6 +11,9 @@ describe('When given a move that has been assigned', () => { changedValues: { sc_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', }, + oldValues: { + sc_assigned_id: null, + }, context: [{ assigned_office_user_last_name: 'Daniels', assigned_office_user_first_name: 'Jayden' }], }; @@ -36,6 +39,7 @@ describe('When given a move that has been assigned', () => { }); it('task ordering officer', () => { historyRecord.changedValues = { too_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137' }; + historyRecord.oldValues = { too_assigned_id: null }; historyRecord.context = [ { assigned_office_user_last_name: 'Robinson', assigned_office_user_first_name: 'Brian' }, ]; @@ -48,6 +52,7 @@ describe('When given a move that has been assigned', () => { }); it('task invoicing officer', () => { historyRecord.changedValues = { tio_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137' }; + historyRecord.oldValues = { tio_assigned_id: null }; historyRecord.context = [{ assigned_office_user_last_name: 'Luvu', assigned_office_user_first_name: 'Frankie' }]; const template = getTemplate(historyRecord); diff --git a/src/utils/formatters.test.js b/src/utils/formatters.test.js index 0165a47aec3..97b99f470a3 100644 --- a/src/utils/formatters.test.js +++ b/src/utils/formatters.test.js @@ -355,6 +355,9 @@ describe('formatAssignedOfficeUserFromContext', () => { changedValues: { sc_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', }, + oldValues: { + sc_assigned_id: null, + }, context: [{ assigned_office_user_last_name: 'Daniels', assigned_office_user_first_name: 'Jayden' }], }; @@ -370,6 +373,9 @@ describe('formatAssignedOfficeUserFromContext', () => { changedValues: { too_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', }, + oldValues: { + too_assigned_id: null, + }, context: [{ assigned_office_user_last_name: 'McLaurin', assigned_office_user_first_name: 'Terry' }], }; @@ -385,6 +391,9 @@ describe('formatAssignedOfficeUserFromContext', () => { changedValues: { tio_assigned_id: 'fb625e3c-067c-49d7-8fd9-88ef040e6137', }, + oldValues: { + tio_assigned_id: null, + }, context: [{ assigned_office_user_last_name: 'Robinson', assigned_office_user_first_name: 'Brian' }], }; From fc6e31e1884539a2668f243169145a20f84924b3 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 21 Jan 2025 14:27:10 -0500 Subject: [PATCH 065/229] Updated template to use correct prefix when rejecting, approving, or updating a service item. Also updated field mapping to include "denied_at" field. --- src/constants/MoveHistory/Database/FieldMappings.js | 1 + .../UpdatePaymentServiceItemStatus.jsx | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 5b9ece8b735..195972b8213 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -148,4 +148,5 @@ export default { approvals_requested_at: 'Approvals requested at', approved_at: 'Approved at', counseling_office_name: 'Counseling office', + denied_at: 'Denied at', }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index cb7909334e6..c136377f847 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -19,8 +19,16 @@ export default { action: a.UPDATE, eventName: o.updatePaymentServiceItemStatus, tableName: t.payment_service_items, - getEventNameDisplay: () => { - return
Updated Payment Service Item
; + getEventNameDisplay: (historyRecord) => { + let actionPrefix = ''; + if (historyRecord.changedValues.status === 'DENIED') { + actionPrefix = 'Rejected'; + } else if (historyRecord.changedValues.status === 'APPROVED') { + actionPrefix = 'Approved'; + } else { + actionPrefix = 'Updated'; + } + return
{actionPrefix} Payment Service Item
; }, getDetails: (historyRecord) => { return ; From ff8399f7266d2501bf5c5490df9606279502f592 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 19:31:03 +0000 Subject: [PATCH 066/229] added tests for ppm estimator --- .../ppm_closeout/ppm_closeout_test.go | 2 +- pkg/services/ppmshipment/ppm_estimator.go | 2 +- .../ppmshipment/ppm_estimator_test.go | 547 +++++++++++++++++- 3 files changed, 523 insertions(+), 28 deletions(-) diff --git a/pkg/services/ppm_closeout/ppm_closeout_test.go b/pkg/services/ppm_closeout/ppm_closeout_test.go index c1479c140ea..084c086908c 100644 --- a/pkg/services/ppm_closeout/ppm_closeout_test.go +++ b/pkg/services/ppm_closeout/ppm_closeout_test.go @@ -24,7 +24,7 @@ const ( ppmBuildWaitingOnCustomer = "waitingOnCustomer" ) -func (suite *PPMCloseoutSuite) TestPPMShipmentCreator() { +func (suite *PPMCloseoutSuite) TestPPMShipmentCloseout() { // One-time test setup mockedPlanner := &mocks.Planner{} diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index 1d3d4916f43..c80661561b0 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -257,7 +257,7 @@ func (f *estimatePPM) estimateIncentive(appCtx appcontext.AppContext, oldPPMShip newPPMShipment.HasRequestedAdvance = nil newPPMShipment.AdvanceAmountRequested = nil - estimatedIncentive, err = f.CalculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), false, false, true) + estimatedIncentive, err = f.CalculateOCONUSIncentive(appCtx, newPPMShipment.ID, *pickupAddress, *destinationAddress, contractDate, newPPMShipment.EstimatedWeight.Int(), true, false, false) if err != nil { return nil, nil, fmt.Errorf("failed to calculate estimated PPM incentive: %w", err) } diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index 71b0749a7ea..98fc639b472 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -696,6 +696,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, }, nil) + setupPricerData() newPPM := oldPPMShipment newPPM.HasProGear = models.BoolPointer(false) @@ -1559,6 +1560,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }) suite.Run("Final Incentive - does not change when required fields are the same", func() { + setupPricerData() oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ { Model: models.PPMShipment{ @@ -1607,6 +1609,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }) suite.Run("Final Incentive - set to nil when missing info", func() { + setupPricerData() oldPPMShipment := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ { Model: models.PPMShipment{ @@ -1698,7 +1701,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }, }, { - Model: &models.Address{ + Model: models.Address{ StreetAddress1: "987 Other Avenue", StreetAddress2: models.StringPointer("P.O. Box 1234"), StreetAddress3: models.StringPointer("c/o Another Person"), @@ -1710,7 +1713,7 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { Type: &factory.Addresses.PickupAddress, }, { - Model: &models.Address{ + Model: models.Address{ StreetAddress1: "987 Other Avenue", StreetAddress2: models.StringPointer("P.O. Box 12345"), StreetAddress3: models.StringPointer("c/o Another Person"), @@ -1760,30 +1763,6 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { SITEstimatedDepartureDate: &entryDate, }, }, - { - Model: models.Address{ - StreetAddress1: "987 Other Avenue", - StreetAddress2: models.StringPointer("P.O. Box 1234"), - StreetAddress3: models.StringPointer("c/o Another Person"), - City: "Des Moines", - State: "IA", - PostalCode: "50309", - County: models.StringPointer("POLK"), - }, - Type: &factory.Addresses.PickupAddress, - }, - { - Model: models.Address{ - StreetAddress1: "987 Other Avenue", - StreetAddress2: models.StringPointer("P.O. Box 12345"), - StreetAddress3: models.StringPointer("c/o Another Person"), - City: "Fort Eisenhower", - State: "GA", - PostalCode: "50309", - County: models.StringPointer("COLUMBIA"), - }, - Type: &factory.Addresses.DeliveryAddress, - }, { Model: mtoShipment, LinkOnly: true, @@ -2049,3 +2028,519 @@ func (suite *PPMShipmentSuite) TestPPMEstimator() { }) }) } + +func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { + planner := &mocks.Planner{} + paymentRequestHelper := &prhelpermocks.Helper{} + ppmEstimator := NewEstimatePPM(planner, paymentRequestHelper) + + setupPricerData := func() { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + startDate := time.Date(2020, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2020, time.December, 31, 12, 0, 0, 0, time.UTC) + testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + } + + suite.Run("Estimated Incentive", func() { + suite.Run("Estimated Incentive - Success using estimated weight and not db authorized weight for CONUS -> OCONUS", func() { + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + setupPricerData() + + estimatedWeight := unit.Pound(5000) + newPPM := ppm + newPPM.EstimatedWeight = &estimatedWeight + + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "74133", "98424", true, true).Return(3000, nil) + + ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmEstimate) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "74133", "98424", true, true) + suite.Equal(unit.Cents(459178), *ppmEstimate) + }) + + suite.Run("Estimated Incentive - Success using estimated weight and not db authorized weight for OCONUS -> CONUS", func() { + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.DeliveryAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.PickupAddress, + }, + }, nil) + + setupPricerData() + + estimatedWeight := unit.Pound(5000) + newPPM := ppm + newPPM.EstimatedWeight = &estimatedWeight + + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "74133", true, true).Return(3000, nil) + + ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmEstimate) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "74133", true, true) + suite.Equal(unit.Cents(423178), *ppmEstimate) + }) + }) + + suite.Run("Max Incentive", func() { + suite.Run("Max Incentive - Success using db authorized weight and not estimated for CONUS -> OCONUS", func() { + oconusAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + destDutyLocation := factory.BuildDutyLocation(suite.DB(), []factory.Customization{ + { + Model: models.DutyLocation{ + Name: "Test OCONUS Duty Location", + AddressID: oconusAddress.ID, + }, + }, + }, nil) + order := factory.BuildOrder(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + NewDutyLocationID: destDutyLocation.ID, + }, + }, + }, nil) + // when the PPM shipment is in draft, we use the estimated weight and not the db authorized weight + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + OrdersID: order.ID, + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + setupPricerData() + + estimatedWeight := unit.Pound(5000) + newPPM := ppm + newPPM.EstimatedWeight = &estimatedWeight + + // DTOD will be called to get the distance between the origin duty location & the Tacoma Port ZIP + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "50309", "98424", true, true).Return(3000, nil) + + ppmMaxIncentive, err := ppmEstimator.MaxIncentive(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmMaxIncentive) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "50309", "98424", true, true) + suite.Equal(unit.Cents(656532), *ppmMaxIncentive) + }) + + suite.Run("Max Incentive - Success using db authorized weight and not estimated for OCONUS -> CONUS", func() { + oconusAddress := factory.BuildAddress(suite.DB(), []factory.Customization{ + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + pickupDutyLocation := factory.BuildDutyLocation(suite.DB(), []factory.Customization{ + { + Model: models.DutyLocation{ + Name: "Test OCONUS Duty Location", + AddressID: oconusAddress.ID, + }, + }, + }, nil) + order := factory.BuildOrder(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OriginDutyLocationID: &pickupDutyLocation.ID, + }, + }, + }, nil) + // when the PPM shipment is in draft, we use the estimated weight and not the db authorized weight + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + OrdersID: order.ID, + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + setupPricerData() + + estimatedWeight := unit.Pound(5000) + newPPM := ppm + newPPM.EstimatedWeight = &estimatedWeight + + // DTOD will be called to get the distance between the origin duty location & the Tacoma Port ZIP + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "30813", true, true).Return(3000, nil) + + ppmMaxIncentive, err := ppmEstimator.MaxIncentive(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmMaxIncentive) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "30813", true, true) + suite.Equal(unit.Cents(676692), *ppmMaxIncentive) + }) + }) + + suite.Run("Final Incentive", func() { + suite.Run("Final Incentive - Success using estimated weight for CONUS -> OCONUS", func() { + updatedMoveDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + ActualMoveDate: models.TimePointer(updatedMoveDate), + Status: models.PPMShipmentStatusWaitingOnCustomer, + EstimatedWeight: models.PoundPointer(4000), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + newPPM := ppm + newFullWeight := unit.Pound(8000) + newEmptyWeight := unit.Pound(3000) + newPPM.WeightTickets = models.WeightTickets{ + factory.BuildWeightTicket(suite.DB(), []factory.Customization{ + { + Model: models.WeightTicket{ + FullWeight: &newFullWeight, + EmptyWeight: &newEmptyWeight, + }, + }, + }, nil), + } + + setupPricerData() + + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "74133", "98424", true, true).Return(3000, nil) + + ppmFinalIncentive, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmFinalIncentive) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "74133", "98424", true, true) + suite.Equal(unit.Cents(459178), *ppmFinalIncentive) + }) + + suite.Run("Final Incentive - Success using estimated weight for OCONUS -> CONUS", func() { + updatedMoveDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + ActualMoveDate: models.TimePointer(updatedMoveDate), + Status: models.PPMShipmentStatusWaitingOnCustomer, + EstimatedWeight: models.PoundPointer(4000), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.DeliveryAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.PickupAddress, + }, + }, nil) + + newPPM := ppm + newFullWeight := unit.Pound(8000) + newEmptyWeight := unit.Pound(3000) + newPPM.WeightTickets = models.WeightTickets{ + factory.BuildWeightTicket(suite.DB(), []factory.Customization{ + { + Model: models.WeightTicket{ + FullWeight: &newFullWeight, + EmptyWeight: &newEmptyWeight, + }, + }, + }, nil), + } + + setupPricerData() + + planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "74133", true, true).Return(3000, nil) + + ppmFinalIncentive, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(ppmFinalIncentive) + + // it should've called from the pickup -> port and NOT pickup -> dest + planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), + "98424", "74133", true, true) + suite.Equal(unit.Cents(423178), *ppmFinalIncentive) + }) + }) + + suite.Run("SIT Costs for OCONUS PPMs", func() { + suite.Run("CalculateSITCost - Success using estimated weight for CONUS -> OCONUS", func() { + originLocation := models.SITLocationTypeOrigin + entryDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + EstimatedWeight: models.PoundPointer(4000), + SITExpected: models.BoolPointer(true), + SITLocation: &originLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), + SITEstimatedEntryDate: &entryDate, + SITEstimatedDepartureDate: models.TimePointer(entryDate.Add(time.Hour * 24 * 30)), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + newPPM := ppm + newEstimatedWeight := models.PoundPointer(5500) + newPPM.SITEstimatedWeight = newEstimatedWeight + setupPricerData() + + _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(estimatedSITCost) + suite.Equal(unit.Cents(24360), *estimatedSITCost) + }) + + suite.Run("CalculateSITCost - Success using estimated weight for CONUS -> OCONUS", func() { + originLocation := models.SITLocationTypeDestination + entryDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + EstimatedWeight: models.PoundPointer(4000), + SITExpected: models.BoolPointer(true), + SITLocation: &originLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), + SITEstimatedEntryDate: &entryDate, + SITEstimatedDepartureDate: models.TimePointer(entryDate.Add(time.Hour * 24 * 30)), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + newPPM := ppm + newEstimatedWeight := models.PoundPointer(5500) + newPPM.SITEstimatedWeight = newEstimatedWeight + setupPricerData() + + _, estimatedSITCost, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) + suite.NilOrNoVerrs(err) + suite.NotNil(estimatedSITCost) + suite.Equal(unit.Cents(41080), *estimatedSITCost) + }) + }) +} From 9f8101601031fdd6756537f1e9331691b971d21d Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Tue, 21 Jan 2025 20:03:10 +0000 Subject: [PATCH 067/229] B-22238 Add payload tests and refactoring Add a condition check to return nil if the slice is empty Add tests to model_to_payload for prime api v3 --- .../primeapiv3/payloads/model_to_payload.go | 8 ++-- .../payloads/model_to_payload_test.go | 38 +++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index b5e9e5e3b93..745d66d564c 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -336,16 +336,18 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primev3messages.MTOAgents { if mtoAgents == nil { return nil } - var agents primev3messages.MTOAgents - for _, m := range *mtoAgents { + // Remove agents that have been deleted from the slice if m.DeletedAt == nil { copyOfM := m // Make copy to avoid implicit memory aliasing of items from a range statement. agents = append(agents, MTOAgent(©OfM)) } } - + // Return nil if there are no agents in the array + if len(agents) == 0 { + return nil + } return &agents } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 666233d4f52..7437005dc41 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -1171,6 +1171,44 @@ func (suite *PayloadsSuite) TestMTOAgentPayload() { suite.NotNil(payload) } +func (suite *PayloadsSuite) TestMTOAgentDeleted() { + deletedAgent := models.MTOAgent{ + MTOAgentType: models.MTOAgentReceiving, + DeletedAt: models.TimePointer(time.Now()), + } + agent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: deletedAgent}, + }, nil) + var mtoAgents models.MTOAgents + mtoAgents = append(mtoAgents, agent) + result := MTOAgents(&mtoAgents) + suite.Nil(result) +} + +func (suite *PayloadsSuite) TestMTOAgentOneActiveOneDeleted() { + oldAgent := models.MTOAgent{ + MTOAgentType: models.MTOAgentReleasing, + DeletedAt: models.TimePointer(time.Now()), + } + newAgent := models.MTOAgent{ + FirstName: models.StringPointer("John"), + LastName: models.StringPointer("Doe"), + Email: models.StringPointer("John.doe@example.com"), + Phone: models.StringPointer("222-222-2222"), + MTOAgentType: models.MTOAgentReleasing, + } + deletedAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: oldAgent}, + }, nil) + activeAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: newAgent}, + }, nil) + var mtoAgents models.MTOAgents + mtoAgents = append(mtoAgents, deletedAgent, activeAgent) + result := MTOAgents(&mtoAgents) + suite.NotNil(result) +} + func (suite *PayloadsSuite) TestStorageFacility() { storageFacilityID := uuid.Must(uuid.NewV4()) updatedAt := time.Now() From 2d9f515fa8211672b540d65de4bc1d034e6bd913 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 20:08:42 +0000 Subject: [PATCH 068/229] fixing UI tests --- .../PPM/PPMHeaderSummary/HeaderSection.jsx | 106 ++++++++---------- .../PPMHeaderSummary/HeaderSection.test.jsx | 20 +++- .../PPM/PPMHeaderSummary/PPMHeaderSummary.jsx | 2 - .../PPMHeaderSummary.test.jsx | 2 +- src/shared/constants.js | 5 - 5 files changed, 67 insertions(+), 68 deletions(-) diff --git a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx index 2344a110ab2..a9201b3ec3f 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.jsx @@ -271,7 +271,7 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat case sectionTypes.incentiveFactors: return (
- {sectionInfo.haulPrice > 0 ?? ( + {sectionInfo.haulPrice > 0 && (
@@ -296,54 +296,48 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat )}
- {sectionInfo.packPrice > 0 ?? ( -
- - - {isFetchingItems && isRecalulatedItem('packPrice') ? ( - - ) : ( - `$${formatCents(sectionInfo.packPrice)}` - )} - -
- )} - {sectionInfo.unpackPrice > 0 ?? ( -
- - - {isFetchingItems && isRecalulatedItem('unpackPrice') ? ( - - ) : ( - `$${formatCents(sectionInfo.unpackPrice)}` - )} - -
- )} - {sectionInfo.dop > 0 ?? ( -
- - - {isFetchingItems && isRecalulatedItem('dop') ? ( - - ) : ( - `$${formatCents(sectionInfo.dop)}` - )} - -
- )} - {sectionInfo.ddp > 0 ?? ( -
- - - {isFetchingItems && isRecalulatedItem('ddp') ? ( - - ) : ( - `$${formatCents(sectionInfo.ddp)}` - )} - -
- )} +
+ + + {isFetchingItems && isRecalulatedItem('packPrice') ? ( + + ) : ( + `$${formatCents(sectionInfo.packPrice)}` + )} + +
+
+ + + {isFetchingItems && isRecalulatedItem('unpackPrice') ? ( + + ) : ( + `$${formatCents(sectionInfo.unpackPrice)}` + )} + +
+ +
+ + + {isFetchingItems && isRecalulatedItem('dop') ? ( + + ) : ( + `$${formatCents(sectionInfo.dop)}` + )} + +
+ +
+ + + {isFetchingItems && isRecalulatedItem('ddp') ? ( + + ) : ( + `$${formatCents(sectionInfo.ddp)}` + )} + +
@@ -374,14 +368,12 @@ const getSectionMarkup = (sectionInfo, handleEditOnClick, isFetchingItems, updat )}
- {sectionInfo.sitReimbursement > 0 ?? ( -
- - - ${formatCents(sectionInfo.sitReimbursement)} - -
- )} +
+ + + ${formatCents(sectionInfo.sitReimbursement)} + +
); diff --git a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.test.jsx b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.test.jsx index 7fb05d4da7d..4b173db4bdb 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.test.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/HeaderSection.test.jsx @@ -219,16 +219,24 @@ const incentivesAdvanceReceivedZeroProps = { setIsSubmitting: jest.fn(), }; +const HAUL_TYPES = { + SHORTHAUL: 'Shorthaul', + LINEHAUL: 'Linehaul', +}; + const incentiveFactorsProps = { sectionInfo: { type: 'incentiveFactors', - haulType: 'Linehaul', + haulType: HAUL_TYPES.LINEHAUL, haulPrice: 6892668, - haulFSC: -143, + haulFSC: 143, packPrice: 20000, unpackPrice: 10000, dop: 15640, ddp: 34640, + intlPackPrice: 1234, + intlUnpackPrice: 12345, + intlLinehaulPrice: 123456, sitReimbursement: 30000, }, }; @@ -469,7 +477,7 @@ describe('PPMHeaderSummary component', () => { expect(screen.getByText('Linehaul Price')).toBeInTheDocument(); expect(screen.getByTestId('haulPrice')).toHaveTextContent('$68,926.68'); expect(screen.getByText('Linehaul Fuel Rate Adjustment')).toBeInTheDocument(); - expect(screen.getByTestId('haulFSC')).toHaveTextContent('-$1.43'); + expect(screen.getByTestId('haulFSC')).toHaveTextContent('$1.43'); expect(screen.getByText('Packing Charge')).toBeInTheDocument(); expect(screen.getByTestId('packPrice')).toHaveTextContent('$200.00'); expect(screen.getByText('Unpacking Charge')).toBeInTheDocument(); @@ -478,6 +486,12 @@ describe('PPMHeaderSummary component', () => { expect(screen.getByTestId('originPrice')).toHaveTextContent('$156.40'); expect(screen.getByText('Destination Price')).toBeInTheDocument(); expect(screen.getByTestId('destinationPrice')).toHaveTextContent('$346.40'); + expect(screen.getByText('International Packing Charge')).toBeInTheDocument(); + expect(screen.getByTestId('intlPackPrice')).toHaveTextContent('$12.34'); + expect(screen.getByText('International Unpacking Charge')).toBeInTheDocument(); + expect(screen.getByTestId('intlUnpackPrice')).toHaveTextContent('$123.45'); + expect(screen.getByText('International Shipping & Linehaul Charge')).toBeInTheDocument(); + expect(screen.getByTestId('intlLinehaulPrice')).toHaveTextContent('$1,234.56'); expect(screen.getByTestId('sitReimbursement')).toHaveTextContent('$300.00'); }); diff --git a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx index 03a81392151..23d84460bf7 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.jsx @@ -10,7 +10,6 @@ import LoadingPlaceholder from 'shared/LoadingPlaceholder'; import SomethingWentWrong from 'shared/SomethingWentWrong'; import { usePPMCloseoutQuery } from 'hooks/queries'; import { formatCustomerContactFullAddress } from 'utils/formatters'; -import { INTL_PPM_PORT_INFO } from 'shared/constants'; const GCCAndIncentiveInfo = ({ ppmShipmentInfo, updatedItemName, setUpdatedItemName, readOnly }) => { const { ppmCloseout, isLoading, isError } = usePPMCloseoutQuery(ppmShipmentInfo.id); @@ -79,7 +78,6 @@ export default function PPMHeaderSummary({ ppmShipmentInfo, order, ppmNumber, sh : '—', pickupAddressObj: ppmShipmentInfo.pickupAddress, destinationAddressObj: ppmShipmentInfo.destinationAddress, - port: INTL_PPM_PORT_INFO, miles: ppmShipmentInfo.miles, estimatedWeight: ppmShipmentInfo.estimatedWeight, actualWeight: ppmShipmentInfo.actualWeight, diff --git a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.test.jsx b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.test.jsx index 89c94406ccc..6d938da22b2 100644 --- a/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.test.jsx +++ b/src/components/Office/PPM/PPMHeaderSummary/PPMHeaderSummary.test.jsx @@ -167,7 +167,7 @@ const defaultProps = { describe('PPMHeaderSummary component', () => { describe('displays form', () => { - it('renders blank form on load with defaults', async () => { + it('renders default values', async () => { usePPMShipmentDocsQueries.mockReturnValue(useEditShipmentQueriesReturnValue); useEditShipmentQueries.mockReturnValue(useEditShipmentQueriesReturnValue); renderWithProviders(, mockRoutingConfig); diff --git a/src/shared/constants.js b/src/shared/constants.js index 947dd877ba4..56b7601c585 100644 --- a/src/shared/constants.js +++ b/src/shared/constants.js @@ -236,9 +236,4 @@ const ADDRESS_LABELS_MAP = { [ADDRESS_TYPES.THIRD_DESTINATION]: 'Third Delivery Address', }; -export const INTL_PPM_PORT_INFO = { - portName: 'Tacoma, WA', - portZip: '98424', -}; - export const getAddressLabel = (type) => ADDRESS_LABELS_MAP[type]; From 382187c9fbd214a2b87d38b0803fd0c0b52d8121 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 20:16:55 +0000 Subject: [PATCH 069/229] removing check from test since added logic to reduce overquerying incentives --- pkg/handlers/ghcapi/mto_shipment_test.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/pkg/handlers/ghcapi/mto_shipment_test.go b/pkg/handlers/ghcapi/mto_shipment_test.go index 858c571ce0e..ee40b31e2b7 100644 --- a/pkg/handlers/ghcapi/mto_shipment_test.go +++ b/pkg/handlers/ghcapi/mto_shipment_test.go @@ -4323,9 +4323,7 @@ func (suite *HandlerSuite) TestUpdateShipmentHandler() { suite.Equal(handlers.FmtPoundPtr(&sitEstimatedWeight), updatedShipment.PpmShipment.SitEstimatedWeight) suite.Equal(handlers.FmtDate(sitEstimatedEntryDate), updatedShipment.PpmShipment.SitEstimatedEntryDate) suite.Equal(handlers.FmtDate(sitEstimatedDepartureDate), updatedShipment.PpmShipment.SitEstimatedDepartureDate) - suite.Equal(int64(sitEstimatedCost), *updatedShipment.PpmShipment.SitEstimatedCost) suite.Equal(handlers.FmtPoundPtr(&estimatedWeight), updatedShipment.PpmShipment.EstimatedWeight) - suite.Equal(int64(estimatedIncentive), *updatedShipment.PpmShipment.EstimatedIncentive) suite.Equal(handlers.FmtBool(hasProGear), updatedShipment.PpmShipment.HasProGear) suite.Equal(handlers.FmtPoundPtr(&proGearWeight), updatedShipment.PpmShipment.ProGearWeight) suite.Equal(handlers.FmtPoundPtr(&spouseProGearWeight), updatedShipment.PpmShipment.SpouseProGearWeight) From e0b9e2148c158b656974dbaf2c8078088f643785 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 20:29:57 +0000 Subject: [PATCH 070/229] fixes --- ...64752_add_ppm_estimated_incentive_proc.up.sql | 16 ++++++---------- pkg/services/ppmshipment/ppm_estimator.go | 2 +- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index 4aecb8a3656..896af50b01e 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -47,7 +47,7 @@ END; $$ LANGUAGE plpgsql; --- db proc that will calculate a PPM's incentive +-- db func that will calculate a PPM's incentives -- this is used for estimated/final/max incentives CREATE OR REPLACE FUNCTION calculate_ppm_incentive( ppm_id UUID, @@ -164,7 +164,7 @@ END; $$ LANGUAGE plpgsql; --- db proc that will calculate a PPM's SIT cost +-- db func that will calculate a PPM's SIT cost -- returns a table with total cost and the cost of each first day/add'l day SIT service item CREATE OR REPLACE FUNCTION calculate_ppm_sit_cost( ppm_id UUID, @@ -185,30 +185,27 @@ DECLARE sit_rate_area_id UUID; service_id UUID; BEGIN - -- Validate SIT days + -- make sure we validate parameters IF sit_days IS NULL OR sit_days < 0 THEN RAISE EXCEPTION 'SIT days must be a positive integer. Provided value: %', sit_days; END IF; - -- Validate PPM existence SELECT ppms.id INTO ppm FROM ppm_shipments ppms WHERE ppms.id = ppm_id; IF ppm IS NULL THEN RAISE EXCEPTION 'PPM with ID % not found', ppm_id; END IF; - -- Get contract ID contract_id := get_contract_id(move_date); IF contract_id IS NULL THEN RAISE EXCEPTION 'Contract not found for date: %', move_date; END IF; - -- Get rate area sit_rate_area_id := get_rate_area_id(address_id, NULL, contract_id); IF sit_rate_area_id IS NULL THEN RAISE EXCEPTION 'Rate area is NULL for address ID % and contract ID %', address_id, contract_id; END IF; - -- Calculate first day SIT cost + -- calculate first day SIT cost service_id := get_service_id(CASE WHEN is_origin THEN 'IOFSIT' ELSE 'IDFSIT' END); price_first_day := ( calculate_escalated_price( @@ -221,7 +218,7 @@ BEGIN ) * (weight / 100)::NUMERIC * 100 )::INT; - -- Calculate additional day SIT cost + -- calculate additional day SIT cost service_id := get_service_id(CASE WHEN is_origin THEN 'IOASIT' ELSE 'IDASIT' END); price_addl_day := ( calculate_escalated_price( @@ -234,10 +231,9 @@ BEGIN ) * (weight / 100)::NUMERIC * 100 * sit_days )::INT; - -- Calculate total SIT cost + -- add em up total_cost := price_first_day + price_addl_day; - -- Return the breakdown for SIT costs RETURN QUERY SELECT total_cost, price_first_day, price_addl_day; END; $$ LANGUAGE plpgsql; diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index c80661561b0..b925cf6bfcf 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -1360,7 +1360,7 @@ func StorageServiceItems(ppmShipment models.PPMShipment, locationType models.SIT } } return []models.MTOServiceItem{ - {ReService: models.ReService{Code: models.ReServiceCodeDDFSIT}, MTOShipmentID: &mtoShipmentID}} + {ReService: models.ReService{Code: models.ReServiceCodeIDFSIT}, MTOShipmentID: &mtoShipmentID}} } return nil From 83549a8d56a604255e16b74000b587338923fada Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 21 Jan 2025 16:01:24 -0500 Subject: [PATCH 071/229] Changed "word-break" CSS property from "break-all" to "break-word" --- .../ExpandableServiceItemRow.module.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index 9dface86063..43ca34b8759 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -99,7 +99,7 @@ td[colspan='2']:nth-of-type(2).rejectionReasonTd { vertical-align: top; text-align: start; - word-break: break-all; + word-break: break-word; padding-right: 2rem; padding-left: 1rem; border-left: 1px solid #dfe1e2; From 11466d5e21289e797f116530a9c682f6b34bbbda Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Tue, 21 Jan 2025 21:29:34 +0000 Subject: [PATCH 072/229] B-22238 Refactor test for MTOAgents Add assertions for firstname, lastname, email, phone, mtoagent type, and empty payload slice --- .../payloads/model_to_payload_test.go | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 7437005dc41..3516cfb7c54 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -1186,27 +1186,34 @@ func (suite *PayloadsSuite) TestMTOAgentDeleted() { } func (suite *PayloadsSuite) TestMTOAgentOneActiveOneDeleted() { - oldAgent := models.MTOAgent{ - MTOAgentType: models.MTOAgentReleasing, + deletedAgentData := models.MTOAgent{ + MTOAgentType: models.MTOAgentReceiving, DeletedAt: models.TimePointer(time.Now()), } - newAgent := models.MTOAgent{ + activeAgentData := models.MTOAgent{ FirstName: models.StringPointer("John"), LastName: models.StringPointer("Doe"), Email: models.StringPointer("John.doe@example.com"), Phone: models.StringPointer("222-222-2222"), MTOAgentType: models.MTOAgentReleasing, } - deletedAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ - {Model: oldAgent}, + builtDeletedAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: deletedAgentData}, }, nil) - activeAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ - {Model: newAgent}, + builtActiveAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: activeAgentData}, }, nil) - var mtoAgents models.MTOAgents - mtoAgents = append(mtoAgents, deletedAgent, activeAgent) - result := MTOAgents(&mtoAgents) - suite.NotNil(result) + mtoAgentsPayload := models.MTOAgents{builtDeletedAgent, builtActiveAgent} + + result := MTOAgents(&mtoAgentsPayload) + actualAgent := (*result)[0] + suite.NotNil(result, "Expected result not to be nil") + suite.Len(*result, 1, "Expected only one active agent in the result") + suite.Equal(activeAgentData.FirstName, actualAgent.FirstName, "First names should match") + suite.Equal(activeAgentData.LastName, actualAgent.LastName, "Last names should match") + suite.Equal(activeAgentData.Email, actualAgent.Email, "Emails should match") + suite.Equal(activeAgentData.Phone, actualAgent.Phone, "Phone numbers should match") + suite.Equal(string(activeAgentData.MTOAgentType), string(actualAgent.AgentType), "Agent types should match") } func (suite *PayloadsSuite) TestStorageFacility() { From d55577309c6496f35a3c3f6a51720280637bf46f Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Tue, 21 Jan 2025 21:42:27 +0000 Subject: [PATCH 073/229] adding some more tests for SIT costs and breakdowns --- .../ppmshipment/ppm_estimator_test.go | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index 98fc639b472..1e0cf6cf6c2 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -2542,5 +2542,109 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { suite.NotNil(estimatedSITCost) suite.Equal(unit.Cents(41080), *estimatedSITCost) }) + + suite.Run("CalculatePPMSITEstimatedCost - Success for OCONUS PPM", func() { + originLocation := models.SITLocationTypeDestination + entryDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + EstimatedWeight: models.PoundPointer(4000), + SITExpected: models.BoolPointer(true), + SITLocation: &originLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), + SITEstimatedEntryDate: &entryDate, + SITEstimatedDepartureDate: models.TimePointer(entryDate.Add(time.Hour * 24 * 30)), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + newPPM := ppm + newEstimatedWeight := models.PoundPointer(5500) + newPPM.SITEstimatedWeight = newEstimatedWeight + setupPricerData() + + estimatedSITCost, err := ppmEstimator.CalculatePPMSITEstimatedCost(suite.AppContextForTest(), &ppm) + suite.NilOrNoVerrs(err) + suite.NotNil(estimatedSITCost) + suite.Equal(unit.Cents(20540), *estimatedSITCost) + }) + + suite.Run("CalculatePPMSITEstimatedCostBreakdown - Success for OCONUS PPM", func() { + originLocation := models.SITLocationTypeDestination + entryDate := time.Date(2020, time.March, 15, 0, 0, 0, 0, time.UTC) + ppm := factory.BuildPPMShipment(suite.DB(), []factory.Customization{ + { + Model: models.PPMShipment{ + EstimatedWeight: models.PoundPointer(4000), + SITExpected: models.BoolPointer(true), + SITLocation: &originLocation, + SITEstimatedWeight: models.PoundPointer(unit.Pound(2000)), + SITEstimatedEntryDate: &entryDate, + SITEstimatedDepartureDate: models.TimePointer(entryDate.Add(time.Hour * 24 * 30)), + }, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Tulsa", + State: "OK", + PostalCode: "74133", + }, + Type: &factory.Addresses.PickupAddress, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "JBER", + State: "AK", + PostalCode: "99505", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + }, nil) + + newPPM := ppm + newEstimatedWeight := models.PoundPointer(5500) + newPPM.SITEstimatedWeight = newEstimatedWeight + setupPricerData() + + sitCosts, err := ppmEstimator.CalculatePPMSITEstimatedCostBreakdown(suite.AppContextForTest(), &ppm) + suite.NilOrNoVerrs(err) + suite.NotNil(sitCosts) + suite.Equal(unit.Cents(20540), *sitCosts.EstimatedSITCost) + suite.Equal(unit.Cents(12140), *sitCosts.PriceFirstDaySIT) + suite.Equal(unit.Cents(8400), *sitCosts.PriceAdditionalDaySIT) + }) }) } From da2f49c8a9fe66432ee0150e82c1f9ae4d88d2f8 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Tue, 21 Jan 2025 22:03:12 +0000 Subject: [PATCH 074/229] B-22238 Refactor test and MTOAgents Removed the check for empty slice as it was crashing PrimeAPI Refactor test code so it checks that the pointer is null --- pkg/handlers/primeapiv3/payloads/model_to_payload.go | 4 ---- pkg/handlers/primeapiv3/payloads/model_to_payload_test.go | 6 +++--- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 745d66d564c..0c6eb773677 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -344,10 +344,6 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primev3messages.MTOAgents { agents = append(agents, MTOAgent(©OfM)) } } - // Return nil if there are no agents in the array - if len(agents) == 0 { - return nil - } return &agents } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 3516cfb7c54..44050f6e7ac 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -1179,10 +1179,10 @@ func (suite *PayloadsSuite) TestMTOAgentDeleted() { agent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ {Model: deletedAgent}, }, nil) - var mtoAgents models.MTOAgents - mtoAgents = append(mtoAgents, agent) + mtoAgents := models.MTOAgents{agent} + result := MTOAgents(&mtoAgents) - suite.Nil(result) + suite.Nil(*result) } func (suite *PayloadsSuite) TestMTOAgentOneActiveOneDeleted() { From 6f96ae7da6a12595da71026aff1ca54154243311 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 22 Jan 2025 12:04:07 -0500 Subject: [PATCH 075/229] add tests --- .../payloads/model_to_payload_test.go | 6 +++++ .../payloads/model_to_payload_test.go | 22 ++++++++++++------- pkg/services/order/order_updater_test.go | 6 +++++ .../DefinitionLists/AllowancesList.test.jsx | 6 +++++ 4 files changed, 32 insertions(+), 8 deletions(-) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index 7e201ca5212..c25d11377e9 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -641,6 +641,8 @@ func (suite *PayloadsSuite) TestEntitlement() { dependentsTwelveAndOver := 1 authorizedWeight := 8000 ubAllowance := 300 + adminRestriction := true + weightRestriction := 1000 entitlement := &models.Entitlement{ ID: entitlementID, @@ -658,6 +660,8 @@ func (suite *PayloadsSuite) TestEntitlement() { DependentsTwelveAndOver: &dependentsTwelveAndOver, UpdatedAt: time.Now(), UBAllowance: &ubAllowance, + AdminRestrictedWeightLocation: adminRestriction, + WeightRestriction: &weightRestriction, } returnedEntitlement := Entitlement(entitlement) @@ -679,6 +683,8 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(models.BoolPointer(accompaniedTour), returnedEntitlement.AccompaniedTour) suite.Equal(dependentsUnderTwelve, int(*returnedEntitlement.DependentsUnderTwelve)) suite.Equal(dependentsTwelveAndOver, int(*returnedEntitlement.DependentsTwelveAndOver)) + suite.Equal(adminRestriction, returnedEntitlement.AdminRestrictedWeightLocation) + suite.Equal(weightRestriction, int(*returnedEntitlement.WeightRestriction)) } func (suite *PayloadsSuite) TestCreateCustomer() { diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go index a643a414699..17e7ee4e196 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go @@ -294,10 +294,11 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + AdminRestrictedWeightLocation: false, } payload := Entitlement(&entitlement) @@ -320,6 +321,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(false, payload.AdminRestrictedWeightLocation) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { @@ -334,10 +336,12 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, - ProGearWeight: 1000, - ProGearWeightSpouse: 750, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), + ProGearWeight: 1000, + ProGearWeightSpouse: 750, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + AdminRestrictedWeightLocation: true, + WeightRestriction: models.IntPointer(1000), } // TotalWeight needs to read from the internal weightAllotment, in this case 7000 lbs w/o dependents and @@ -360,6 +364,8 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(true, payload.OrganizationalClothingAndIndividualEquipment) suite.Equal(int64(1000), payload.ProGearWeight) suite.Equal(int64(750), payload.ProGearWeightSpouse) + suite.Equal(true, payload.AdminRestrictedWeightLocation) + suite.Equal(int64(1000), *payload.WeightRestriction) suite.NotEmpty(payload.ETag) suite.Equal(etag.GenerateEtag(entitlement.UpdatedAt), payload.ETag) }) diff --git a/pkg/services/order/order_updater_test.go b/pkg/services/order/order_updater_test.go index 1bf72866552..549da5de625 100644 --- a/pkg/services/order/order_updater_test.go +++ b/pkg/services/order/order_updater_test.go @@ -775,6 +775,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { proGearWeightSpouse := models.Int64Pointer(10) rmeWeight := models.Int64Pointer(10000) eTag := etag.GenerateEtag(order.UpdatedAt) + adminrestrictedweight := models.BoolPointer(true) + weightRestriction := models.Int64Pointer(5000) payload := ghcmessages.CounselingUpdateAllowancePayload{ Agency: &affiliation, @@ -784,6 +786,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, + AdminRestrictedWeightLocation: adminrestrictedweight, + WeightRestriction: weightRestriction, } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -804,6 +808,8 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { suite.Equal(*payload.OrganizationalClothingAndIndividualEquipment, updatedOrder.Entitlement.OrganizationalClothingAndIndividualEquipment) suite.EqualValues(payload.Agency, fetchedSM.Affiliation) suite.Equal(*updatedOrder.Entitlement.DBAuthorizedWeight, 16000) + suite.Equal(payload.AdminRestrictedWeightLocation, true) + suite.Equal(*payload.WeightRestriction, int64(*updatedOrder.Entitlement.WeightRestriction)) }) suite.Run("Updates the allowance when all fields are valid with dependents present and authorized", func() { diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 45c2e97f246..4ca49b1039f 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -19,6 +19,7 @@ const info = { requiredMedicalEquipmentWeight: 1000, organizationalClothingAndIndividualEquipment: true, ubAllowance: 400, + weightRestriction: 1000, }; const initialValuesOconusAdditions = { @@ -175,4 +176,9 @@ describe('AllowancesList', () => { expect(screen.getByTestId('unaccompaniedBaggageAllowance')).toBeInTheDocument(); expect(screen.getByTestId('unaccompaniedBaggageAllowance').textContent).toEqual('400 lbs'); }); + it('renders unauthorized ocie', () => { + const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; + render(); + expect(screen.getByTestId('weightRestriction').textContent).toEqual(1000); + }); }); From 89d0db90239be147dac1034321aefc178edc686d Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 22 Jan 2025 12:32:06 -0500 Subject: [PATCH 076/229] Added storybook component and its required styles for ExpandableServiceItemRow.jsx --- .../ExpandableServiceItemRow.stories.jsx | 235 ++++++++++++++++++ src/shared/styles/_custom.scss | 27 ++ 2 files changed, 262 insertions(+) create mode 100644 src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx new file mode 100644 index 00000000000..46f49ef1633 --- /dev/null +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx @@ -0,0 +1,235 @@ +import React from 'react'; +import { GridContainer } from '@trussworks/react-uswds'; + +import ExpandableServiceItemRow from './ExpandableServiceItemRow'; +import '../ServiceItemCalculations/ServiceItemCalculations.module.scss'; + +export default { + title: 'Office Components/ExpandableServiceItemRow', + decorators: [ + (Story) => { + return ( +
+ + + + + + + + + + + + + + + + + +
Service itemAmountStatus
+
+
+ ); + }, + ], +}; + +const serviceItemRejected = { + createdAt: '2025-01-09T22:08:38.788Z', + eTag: 'MjAyNS0wMS0xN1QxNTowODo0Mi44MDI4MDZa', + id: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + mtoServiceItemCode: 'DLH', + mtoServiceItemID: '526f705d-dba1-4bae-bf9a-e97cd1931bd4', + mtoServiceItemName: 'Domestic linehaul', + mtoShipmentID: 'ad5c56af-9e32-41bf-8283-a6a52938cc6a', + mtoShipmentType: 'HHG', + paymentServiceItemParams: [ + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDQ5Nlo=', + id: 'd3fba800-cc16-45e3-975d-3236884fbf8a', + key: 'WeightOriginal', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '2000', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDAyNjFa', + id: '19192fe0-3e0b-4d5d-98dd-ea834fe9062f', + key: 'ActualPickupDate', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-09', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MjcwNTZa', + id: 'e249d609-96fa-4533-90dc-12d3164aed41', + key: 'RequestedPickupDate', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-02', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NDc5NjVa', + id: '75fc3b3b-517d-4383-9d3e-1493bcd564d9', + key: 'DistanceZip', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1540', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NTk0MTZa', + id: '15edbab6-ba00-47e2-bc92-49c7b16f57e1', + key: 'ContractYearName', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: 'Award Term 1', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDIwMVo=', + id: '984fb8ea-da8a-4b3a-8560-85a9da1589ab', + key: 'ZipDestAddress', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '85309', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDk1MzNa', + id: '6d8b063b-8af4-4d6a-9ad4-5880a2d5fbea', + key: 'ReferenceDate', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DATE', + value: '2025-01-02', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MzY0MjJa', + id: '7941f3cf-7bcd-495e-9291-f2965291676c', + key: 'ServiceAreaOrigin', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '456', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjExODda', + id: '9a69db91-2d5d-4446-b1f6-0c15a140cf7a', + key: 'EscalationCompounded', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DECIMAL', + value: '1.10701', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjI5ODla', + id: '35ddc999-a546-4076-9a2e-5295e4ae4279', + key: 'IsPeak', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'BOOLEAN', + value: 'false', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC45NjQ3ODNa', + id: 'd35e3639-6a43-4f6a-8bf0-5a82685b80c4', + key: 'PriceRateOrFactor', + origin: 'PRICER', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'DECIMAL', + value: '3.148', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44Mzg0MTRa', + id: '163babcf-7874-474e-a36d-f602fdca5c88', + key: 'ContractCode', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: 'TRUSS_TEST', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44Mjk2OTFa', + id: '3f677c1e-1302-4cc1-9333-6fa34f5bdab5', + key: 'WeightEstimated', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1500', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44NDc2NDNa', + id: '1009cca9-cdc1-4814-97e9-e0ef82dce965', + key: 'WeightBilled', + origin: 'SYSTEM', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'INTEGER', + value: '1650', + }, + { + eTag: 'MjAyNS0wMS0wOVQyMjowODozOC44MzE2Nzha', + id: '66b571ee-4142-4576-b563-cc3c8ea04bfe', + key: 'ZipPickupAddress', + origin: 'PRIME', + paymentServiceItemID: '46e2df6f-4fe9-47ee-9baa-b9de28251da8', + type: 'STRING', + value: '62225', + }, + ], + priceCents: 8855385, + referenceID: '4131-9325-46e2df6f', + rejectionReason: + 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', + status: 'DENIED', +}; + +const additionalServiceItemData = { + approvedAt: '2025-01-09T20:24:58.522Z', + convertToCustomerExpense: false, + createdAt: '2025-01-09T20:24:58.621Z', + deletedAt: '0001-01-01', + eTag: 'MjAyNS0wMS0wOVQyMDoyNDo1OC42MjE5NzRa', + id: '526f705d-dba1-4bae-bf9a-e97cd1931bd4', + moveTaskOrderID: 'b02c42d7-bd4f-48ff-a5f8-6e7332fa5d03', + mtoShipmentID: 'ad5c56af-9e32-41bf-8283-a6a52938cc6a', + reServiceCode: 'DLH', + reServiceID: '8d600f25-1def-422d-b159-617c7d59156e', + reServiceName: 'Domestic linehaul', + status: 'APPROVED', + submittedAt: '0001-01-01', + updatedAt: '0001-01-01T00:00:00.000Z', +}; + +export const rejectedServiceItem = () => ( + +); + +const serviceItemAccepted = { ...serviceItemRejected }; +serviceItemAccepted.status = 'APPROVED'; +serviceItemAccepted.rejectionReason = null; +export const acceptedServiceItem = () => ( + +); diff --git a/src/shared/styles/_custom.scss b/src/shared/styles/_custom.scss index 7b178084322..5d02594fc49 100644 --- a/src/shared/styles/_custom.scss +++ b/src/shared/styles/_custom.scss @@ -345,3 +345,30 @@ table { } } } + +// For displaying payment request details/rows in Storybook +.table--stacked { + width: 100%; + table-layout: fixed; + th { + @include u-font-weight(bold); + @include u-font-size('body', '3xs'); + color: $base-darker; + border-top: 0; + + &:not(:first-child) { + text-align: right; + } + } + + td:not(:first-child) { + @include u-font-weight(bold); + text-align: right; + } +} + +.gridContainer { + .shipmentCard { + @include u-padding-left(4); + } +} From 9070c366da6ce33d29e7de15411f0eb9fdbcdf3b Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 22 Jan 2025 12:32:10 -0500 Subject: [PATCH 077/229] fix test --- src/components/Office/DefinitionLists/AllowancesList.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 4ca49b1039f..31bea9a4c4b 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -179,6 +179,6 @@ describe('AllowancesList', () => { it('renders unauthorized ocie', () => { const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; render(); - expect(screen.getByTestId('weightRestriction').textContent).toEqual(1000); + expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,000 lbs'); }); }); From c3a23c493d92fd33156b0469912652b642d1a956 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 22 Jan 2025 13:49:01 -0500 Subject: [PATCH 078/229] test fix --- pkg/services/order/order_updater_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/order/order_updater_test.go b/pkg/services/order/order_updater_test.go index 549da5de625..33590dd225a 100644 --- a/pkg/services/order/order_updater_test.go +++ b/pkg/services/order/order_updater_test.go @@ -808,7 +808,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { suite.Equal(*payload.OrganizationalClothingAndIndividualEquipment, updatedOrder.Entitlement.OrganizationalClothingAndIndividualEquipment) suite.EqualValues(payload.Agency, fetchedSM.Affiliation) suite.Equal(*updatedOrder.Entitlement.DBAuthorizedWeight, 16000) - suite.Equal(payload.AdminRestrictedWeightLocation, true) + suite.Equal(payload.AdminRestrictedWeightLocation, models.BoolPointer(updatedOrder.Entitlement.AdminRestrictedWeightLocation)) suite.Equal(*payload.WeightRestriction, int64(*updatedOrder.Entitlement.WeightRestriction)) }) From a25402d710d22fdde1b1280770a0494d4045cfe8 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 22 Jan 2025 14:47:12 -0500 Subject: [PATCH 079/229] missing in payload for v2 and 3 --- .../primeapiv2/payloads/model_to_payload.go | 13 +++++++++---- .../primeapiv2/payloads/model_to_payload_test.go | 12 ++++++++---- .../primeapiv3/payloads/model_to_payload.go | 13 +++++++++---- .../primeapiv3/payloads/model_to_payload_test.go | 12 ++++++++---- 4 files changed, 34 insertions(+), 16 deletions(-) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index dbd0e9792df..1db56e3afd6 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -170,6 +170,10 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + var weightRestriction int64 + if entitlement.WeightRestriction != nil { + weightRestriction = int64(*entitlement.WeightRestriction) + } return &primev2messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -183,10 +187,11 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: &weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go index ed333f6fd95..da4cb427efe 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go @@ -285,10 +285,12 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + AdminRestrictedWeightLocation: true, + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -311,6 +313,8 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(int64(0), *payload.WeightRestriction) + suite.Equal(true, payload.AdminRestrictedWeightLocation) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 0de1211d151..b4596356952 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -198,6 +198,10 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + var weightRestriction int64 + if entitlement.WeightRestriction != nil { + weightRestriction = int64(*entitlement.WeightRestriction) + } return &primev3messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -209,10 +213,11 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: &weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 345ee203b0b..638b08e7c7d 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -527,10 +527,12 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + AdminRestrictedWeightLocation: true, + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -553,6 +555,8 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(true, payload.AdminRestrictedWeightLocation) + suite.Equal(int64(1000), *payload.WeightRestriction) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { From 82dfd40d2577ed810ae86c25b2ff4cc41b96450e Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Wed, 22 Jan 2025 21:43:46 +0000 Subject: [PATCH 080/229] MAIN-B-22238 Move fix to FetchMoveTaskOrder Removed previous code in the model_to_payload Removed tests from model_to_payload_test Added conditional logic to remove deleted agents from the DB query Added tests to move_task_order_fetcher_test.go --- .../primeapiv3/payloads/model_to_payload.go | 12 ++-- .../payloads/model_to_payload_test.go | 45 ------------ .../move_task_order_fetcher.go | 15 ++++ .../move_task_order_fetcher_test.go | 69 +++++++++++++++++++ 4 files changed, 89 insertions(+), 52 deletions(-) diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 0c6eb773677..5a48f97c15a 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -336,13 +336,11 @@ func MTOAgents(mtoAgents *models.MTOAgents) *primev3messages.MTOAgents { if mtoAgents == nil { return nil } - var agents primev3messages.MTOAgents - for _, m := range *mtoAgents { - // Remove agents that have been deleted from the slice - if m.DeletedAt == nil { - copyOfM := m // Make copy to avoid implicit memory aliasing of items from a range statement. - agents = append(agents, MTOAgent(©OfM)) - } + agents := make(primev3messages.MTOAgents, len(*mtoAgents)) + + for i, m := range *mtoAgents { + copyOfM := m // Make copy to avoid implicit memory aliasing of items from a range statement. + agents[i] = MTOAgent(©OfM) } return &agents } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 44050f6e7ac..666233d4f52 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -1171,51 +1171,6 @@ func (suite *PayloadsSuite) TestMTOAgentPayload() { suite.NotNil(payload) } -func (suite *PayloadsSuite) TestMTOAgentDeleted() { - deletedAgent := models.MTOAgent{ - MTOAgentType: models.MTOAgentReceiving, - DeletedAt: models.TimePointer(time.Now()), - } - agent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ - {Model: deletedAgent}, - }, nil) - mtoAgents := models.MTOAgents{agent} - - result := MTOAgents(&mtoAgents) - suite.Nil(*result) -} - -func (suite *PayloadsSuite) TestMTOAgentOneActiveOneDeleted() { - deletedAgentData := models.MTOAgent{ - MTOAgentType: models.MTOAgentReceiving, - DeletedAt: models.TimePointer(time.Now()), - } - activeAgentData := models.MTOAgent{ - FirstName: models.StringPointer("John"), - LastName: models.StringPointer("Doe"), - Email: models.StringPointer("John.doe@example.com"), - Phone: models.StringPointer("222-222-2222"), - MTOAgentType: models.MTOAgentReleasing, - } - builtDeletedAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ - {Model: deletedAgentData}, - }, nil) - builtActiveAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ - {Model: activeAgentData}, - }, nil) - mtoAgentsPayload := models.MTOAgents{builtDeletedAgent, builtActiveAgent} - - result := MTOAgents(&mtoAgentsPayload) - actualAgent := (*result)[0] - suite.NotNil(result, "Expected result not to be nil") - suite.Len(*result, 1, "Expected only one active agent in the result") - suite.Equal(activeAgentData.FirstName, actualAgent.FirstName, "First names should match") - suite.Equal(activeAgentData.LastName, actualAgent.LastName, "Last names should match") - suite.Equal(activeAgentData.Email, actualAgent.Email, "Emails should match") - suite.Equal(activeAgentData.Phone, actualAgent.Phone, "Phone numbers should match") - suite.Equal(string(activeAgentData.MTOAgentType), string(actualAgent.AgentType), "Agent types should match") -} - func (suite *PayloadsSuite) TestStorageFacility() { storageFacilityID := uuid.Must(uuid.NewV4()) updatedAt := time.Now() diff --git a/pkg/services/move_task_order/move_task_order_fetcher.go b/pkg/services/move_task_order/move_task_order_fetcher.go index 1d30aef5ceb..1a0f6d33a50 100644 --- a/pkg/services/move_task_order/move_task_order_fetcher.go +++ b/pkg/services/move_task_order/move_task_order_fetcher.go @@ -14,6 +14,7 @@ import ( "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/apperror" "github.com/transcom/mymove/pkg/cli" + "github.com/transcom/mymove/pkg/db/utilities" "github.com/transcom/mymove/pkg/models" "github.com/transcom/mymove/pkg/services" "github.com/transcom/mymove/pkg/services/featureflag" @@ -196,6 +197,20 @@ func (f moveTaskOrderFetcher) FetchMoveTaskOrder(appCtx appcontext.AppContext, s } } + for i := range mto.MTOShipments { + var nonDeletedAgents models.MTOAgents + loadErr := appCtx.DB(). + Scope(utilities.ExcludeDeletedScope()). + Where("mto_shipment_id = ?", mto.MTOShipments[i].ID). + All(&nonDeletedAgents) + + if loadErr != nil { + return &models.Move{}, apperror.NewQueryError("MTOAgents", loadErr, "") + } + + mto.MTOShipments[i].MTOAgents = nonDeletedAgents + } + // Due to a bug in Pop for EagerPreload the New Address of the DeliveryAddressUpdate and the PortLocation (City, Country, UsPostRegionCity.UsPostRegion.State") must be loaded manually. // The bug occurs in EagerPreload when there are two or more eager paths with 3+ levels // where the first 2 levels match. For example: diff --git a/pkg/services/move_task_order/move_task_order_fetcher_test.go b/pkg/services/move_task_order/move_task_order_fetcher_test.go index 45ad42f0cfc..7c5c9950655 100644 --- a/pkg/services/move_task_order/move_task_order_fetcher_test.go +++ b/pkg/services/move_task_order/move_task_order_fetcher_test.go @@ -567,6 +567,75 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderFetcher() { suite.True(found, "Expected service item ReServiceCodePODFSC") }) + suite.Run("Success - Move contains only deleted MTOAgents", func() { + move := factory.BuildMove(suite.DB(), nil, nil) + + factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: models.MTOAgent{ + MTOAgentType: models.MTOAgentReceiving, + DeletedAt: models.TimePointer(time.Now()), + }}, + {Model: move, LinkOnly: true}, + }, nil) + + searchParams := services.MoveTaskOrderFetcherParams{ + MoveTaskOrderID: move.ID, + } + + actualMTO, err := mtoFetcher.FetchMoveTaskOrder(suite.AppContextForTest(), &searchParams) + suite.NoError(err) + + suite.Equal(move.ID, actualMTO.ID) + suite.Len(actualMTO.MTOShipments[0].MTOAgents, 0, "Expected no active agents since all are deleted") + }) + + suite.Run("Success - Move contains one MTOAgent", func() { + move := factory.BuildMove(suite.DB(), nil, nil) + + shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + {Model: move, + LinkOnly: true}, + }, nil) + + factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: models.MTOAgent{ + MTOAgentType: models.MTOAgentReceiving, + DeletedAt: models.TimePointer(time.Now()), + }}, + {Model: move, LinkOnly: true}, + {Model: shipment, LinkOnly: true}, + }, nil) + + activeAgent := factory.BuildMTOAgent(suite.DB(), []factory.Customization{ + {Model: models.MTOAgent{ + FirstName: models.StringPointer("John"), + LastName: models.StringPointer("Doe"), + Email: models.StringPointer("John.doe@example.com"), + Phone: models.StringPointer("222-222-2222"), + MTOAgentType: models.MTOAgentReleasing, + }}, + {Model: move, LinkOnly: true}, + {Model: shipment, LinkOnly: true}, + }, nil) + + searchParams := services.MoveTaskOrderFetcherParams{ + MoveTaskOrderID: move.ID, + } + + actualMTO, err := mtoFetcher.FetchMoveTaskOrder(suite.AppContextForTest(), &searchParams) + suite.NoError(err) + + suite.Equal(move.ID, actualMTO.ID) + suite.Len(actualMTO.MTOShipments[0].MTOAgents, 1, "Expected only one active agent in the result") + + activeAgentReturned := actualMTO.MTOShipments[0].MTOAgents[0] + suite.Equal(activeAgent.FirstName, activeAgentReturned.FirstName, "First names should match") + suite.Equal(activeAgent.LastName, activeAgentReturned.LastName, "Last names should match") + suite.Equal(activeAgent.Email, activeAgentReturned.Email, "Emails should match") + suite.Equal(activeAgent.Phone, activeAgentReturned.Phone, "Phone numbers should match") + suite.Equal(activeAgent.MTOAgentType, activeAgentReturned.MTOAgentType, "Agent types should match") + }) + } func (suite *MoveTaskOrderServiceSuite) TestGetMoveTaskOrderFetcher() { From 58da051762f3213cc079a9feb42dbec4f9cb9d0d Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Wed, 22 Jan 2025 17:38:53 -0500 Subject: [PATCH 081/229] Added rejection reason to submitted payment request items in audit log, removed a bunch of unnecessary change tracking for payment items (approved_at, denied_at) --- ...it_history_table_for_payment_service_items.up.sql | 2 +- pkg/assets/sql_scripts/move_history_fetcher.sql | 6 ++---- src/constants/MoveHistory/Database/FieldMappings.js | 1 - .../UpdatePaymentServiceItemStatus.jsx | 12 ++++++++++-- src/pages/Office/MoveHistory/PaymentDetails.jsx | 7 +++++++ .../Office/MoveHistory/PaymentDetails.module.scss | 8 ++++++++ 6 files changed, 28 insertions(+), 8 deletions(-) diff --git a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql index 1502e3302c8..a5875998071 100644 --- a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql +++ b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql @@ -1 +1 @@ -SELECT add_audit_history_table(target_table := 'payment_service_items', audit_rows := BOOLEAN 't', audit_query_text := BOOLEAN 't', ignored_cols := ARRAY['created_at', 'updated_at']); \ No newline at end of file +SELECT add_audit_history_table(target_table := 'payment_service_items', audit_rows := BOOLEAN 't', audit_query_text := BOOLEAN 't', ignored_cols := ARRAY['created_at', 'updated_at', 'denied_at', 'requested_at', 'sent_to_gex_at']); \ No newline at end of file diff --git a/pkg/assets/sql_scripts/move_history_fetcher.sql b/pkg/assets/sql_scripts/move_history_fetcher.sql index 36584462a26..431aa0ef856 100644 --- a/pkg/assets/sql_scripts/move_history_fetcher.sql +++ b/pkg/assets/sql_scripts/move_history_fetcher.sql @@ -212,7 +212,8 @@ WITH move AS ( 'shipment_id', move_shipments.id::TEXT, 'shipment_id_abbr', move_shipments.shipment_id_abbr, 'shipment_type', move_shipments.shipment_type, - 'shipment_locator', move_shipments.shipment_locator + 'shipment_locator', move_shipments.shipment_locator, + 'rejection_reason', payment_service_items.rejection_reason ) )::TEXT AS context, payment_requests.id AS id, @@ -246,9 +247,6 @@ WITH move AS ( 'price', payment_service_items.price_cents::TEXT, 'status', payment_service_items.status, 'rejection_reason', payment_service_items.rejection_reason, - 'requested_at', payment_service_items.requested_at, - 'denied_at', payment_service_items.denied_at, - 'sent_to_gex_at', payment_service_items.sent_to_gex_at, 'paid_at', payment_service_items.paid_at, 'shipment_id', move_shipments.id::TEXT, 'shipment_id_abbr', move_shipments.shipment_id_abbr, diff --git a/src/constants/MoveHistory/Database/FieldMappings.js b/src/constants/MoveHistory/Database/FieldMappings.js index 195972b8213..5b9ece8b735 100644 --- a/src/constants/MoveHistory/Database/FieldMappings.js +++ b/src/constants/MoveHistory/Database/FieldMappings.js @@ -148,5 +148,4 @@ export default { approvals_requested_at: 'Approvals requested at', approved_at: 'Approved at', counseling_office_name: 'Counseling office', - denied_at: 'Denied at', }; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index c136377f847..c2f7608d388 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -12,7 +12,15 @@ const formatChangedValues = (historyRecord) => { ...getMtoShipmentLabel(historyRecord), }; - return { ...historyRecord, changedValues: newChangedValues }; + // Removed unneeded values to avoid clutter in audit log + if (newChangedValues.status === 'APPROVED') { + delete newChangedValues.rejection_reason; + } + + delete newChangedValues.status; + const newHistoryRecord = { ...historyRecord }; + delete newHistoryRecord.changedValues.status; + return { ...newHistoryRecord, changedValues: newChangedValues }; }; export default { @@ -21,7 +29,7 @@ export default { tableName: t.payment_service_items, getEventNameDisplay: (historyRecord) => { let actionPrefix = ''; - if (historyRecord.changedValues.status === 'DENIED') { + if (historyRecord.changedValues.rejection_reason !== null || historyRecord.changedValues.status === 'REJECTED') { actionPrefix = 'Rejected'; } else if (historyRecord.changedValues.status === 'APPROVED') { actionPrefix = 'Approved'; diff --git a/src/pages/Office/MoveHistory/PaymentDetails.jsx b/src/pages/Office/MoveHistory/PaymentDetails.jsx index 65af4dbe90c..807828ec635 100644 --- a/src/pages/Office/MoveHistory/PaymentDetails.jsx +++ b/src/pages/Office/MoveHistory/PaymentDetails.jsx @@ -24,6 +24,13 @@ const filterContextStatus = (context, statusToFilter) => {
{value.name}
{price.toFixed(2)}
+
+ {value.status === 'DENIED' ? ( +
+ Rejection Reason: + {value?.rejection_reason} +
+ ) : null}
, ); } diff --git a/src/pages/Office/MoveHistory/PaymentDetails.module.scss b/src/pages/Office/MoveHistory/PaymentDetails.module.scss index ba62a69fd09..8e347f56909 100644 --- a/src/pages/Office/MoveHistory/PaymentDetails.module.scss +++ b/src/pages/Office/MoveHistory/PaymentDetails.module.scss @@ -13,6 +13,7 @@ font-weight: 500; display: flex; justify-content: space-between; + flex-wrap: wrap; } .statusRow { display: flex; @@ -24,4 +25,11 @@ .rejectTimes { color: $error; } + .break { + flex-basis: 100%; + height: 0; + } + .rejectionReason { + text-indent: 1rem; + } } From 5f26682600d1edc4f1aad153dc9c84bfc5224e26 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Thu, 23 Jan 2025 15:51:00 +0000 Subject: [PATCH 082/229] refactored --- migrations/app/migrations_manifest.txt | 2 -- ...0106153750_admin_weight_restriction.up.sql | 2 -- ...min_weight_restriction_convert_bool.up.sql | 4 --- pkg/gen/ghcapi/embedded_spec.go | 28 ------------------- .../counseling_update_allowance_payload.go | 3 -- pkg/gen/ghcmessages/entitlements.go | 4 --- .../ghcmessages/update_allowance_payload.go | 3 -- pkg/gen/primeapi/embedded_spec.go | 8 ------ pkg/gen/primemessages/entitlements.go | 4 --- pkg/gen/primev2api/embedded_spec.go | 8 ------ pkg/gen/primev2messages/entitlements.go | 4 --- pkg/gen/primev3api/embedded_spec.go | 8 ------ pkg/gen/primev3messages/entitlements.go | 4 --- pkg/gen/supportapi/embedded_spec.go | 8 ------ pkg/gen/supportmessages/entitlement.go | 4 --- .../internal/payloads/model_to_payload.go | 8 ++---- .../payloads/model_to_payload_test.go | 3 -- .../primeapi/payloads/model_to_payload.go | 1 - .../payloads/model_to_payload_test.go | 22 ++++++--------- .../primeapiv2/payloads/model_to_payload.go | 1 - .../payloads/model_to_payload_test.go | 14 ++++------ .../payloads/model_to_payload_test.go | 12 ++++---- pkg/models/ghc_entitlements.go | 1 - pkg/services/order/order_updater.go | 8 ------ pkg/services/order/order_updater_test.go | 3 -- .../AllowancesDetailForm.jsx | 5 ++-- .../Office/DefinitionLists/AllowancesList.jsx | 5 ++-- .../DefinitionLists/AllowancesList.test.jsx | 2 +- .../Office/MoveAllowances/MoveAllowances.jsx | 4 --- src/pages/Office/MoveDetails/MoveDetails.jsx | 1 - .../ServicesCounselingMoveAllowances.jsx | 4 --- .../ServicesCounselingMoveDetails.jsx | 1 - .../definitions/prime/Entitlements.yaml | 3 -- swagger-def/ghc.yaml | 11 -------- swagger-def/support.yaml | 3 -- swagger/ghc.yaml | 15 ---------- swagger/prime.yaml | 3 -- swagger/prime_v2.yaml | 3 -- swagger/prime_v3.yaml | 3 -- swagger/support.yaml | 3 -- 40 files changed, 29 insertions(+), 204 deletions(-) delete mode 100644 migrations/app/schema/20250106153750_admin_weight_restriction.up.sql delete mode 100644 migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index ef0d428cde8..30c229b8c94 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1070,7 +1070,5 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql -20250106153750_admin_weight_restriction.up.sql -20250106190758_admin_weight_restriction_convert_bool.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110214012_homesafeconnect_cert.up.sql diff --git a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql deleted file mode 100644 index a41fc9ee69d..00000000000 --- a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE entitlements -ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; \ No newline at end of file diff --git a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql deleted file mode 100644 index f8f923c0ae7..00000000000 --- a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE entitlements - ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), - ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, - ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index a07887043cc..899c86f9274 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6999,11 +6999,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -8191,10 +8186,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -14083,11 +14074,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -24067,11 +24053,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -25263,10 +25244,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -31283,11 +31260,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index 19ef562126b..805a206b000 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -23,9 +23,6 @@ type CounselingUpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // Indicates if the customer is restricted to a specific location for their admin restricted weight. - AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` - // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 6c8ccba8ac9..e856534cc33 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -23,10 +23,6 @@ type Entitlements struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index 7827dd166a8..c0aa957934a 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -23,9 +23,6 @@ type UpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // Indicates if the customer is restricted to a specific location for their admin restricted weight. - AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` - // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 0d49f7de7ad..db02db6e057 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1735,10 +1735,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -6694,10 +6690,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index c34f9074441..65870bfa8e6 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 875a19b3b00..4d8e6fe6aa9 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -971,10 +971,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -4617,10 +4613,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index 8cf36f2525e..58280696ab1 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index 9ff0927a459..391eb94ffea 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1133,10 +1133,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -5489,10 +5485,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index 3e19bc830ef..2ef73ccfbf5 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 0b50f60c92a..a742b5fdc95 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1110,10 +1110,6 @@ func init() { "Entitlement": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -3986,10 +3982,6 @@ func init() { "Entitlement": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 25fcd62293e..f1fd0f5f8c9 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlement type Entitlement struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 60e18900d46..daa6096b880 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -716,7 +716,6 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { } requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) gunSafe := entitlement.GunSafe - adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation var accompaniedTour *bool if entitlement.AccompaniedTour != nil { accompaniedTour = models.BoolPointer(*entitlement.AccompaniedTour) @@ -755,10 +754,9 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { AccompaniedTour: accompaniedTour, UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - GunSafe: gunSafe, - AdminRestrictedWeightLocation: adminRestrictedWeightLocation, - WeightRestriction: weightRestriction, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + GunSafe: gunSafe, + WeightRestriction: weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index c25d11377e9..16641b76a6b 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -641,7 +641,6 @@ func (suite *PayloadsSuite) TestEntitlement() { dependentsTwelveAndOver := 1 authorizedWeight := 8000 ubAllowance := 300 - adminRestriction := true weightRestriction := 1000 entitlement := &models.Entitlement{ @@ -660,7 +659,6 @@ func (suite *PayloadsSuite) TestEntitlement() { DependentsTwelveAndOver: &dependentsTwelveAndOver, UpdatedAt: time.Now(), UBAllowance: &ubAllowance, - AdminRestrictedWeightLocation: adminRestriction, WeightRestriction: &weightRestriction, } @@ -683,7 +681,6 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(models.BoolPointer(accompaniedTour), returnedEntitlement.AccompaniedTour) suite.Equal(dependentsUnderTwelve, int(*returnedEntitlement.DependentsUnderTwelve)) suite.Equal(dependentsTwelveAndOver, int(*returnedEntitlement.DependentsTwelveAndOver)) - suite.Equal(adminRestriction, returnedEntitlement.AdminRestrictedWeightLocation) suite.Equal(weightRestriction, int(*returnedEntitlement.WeightRestriction)) } diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 945af140137..9f7037617f6 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -249,7 +249,6 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go index 17e7ee4e196..6914cb1a46e 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go @@ -294,11 +294,10 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), - AdminRestrictedWeightLocation: false, + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), } payload := Entitlement(&entitlement) @@ -321,7 +320,6 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) - suite.Equal(false, payload.AdminRestrictedWeightLocation) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { @@ -336,12 +334,11 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: handlers.FmtInt(45), RequiredMedicalEquipmentWeight: 500, OrganizationalClothingAndIndividualEquipment: true, - ProGearWeight: 1000, - ProGearWeightSpouse: 750, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), - AdminRestrictedWeightLocation: true, - WeightRestriction: models.IntPointer(1000), + ProGearWeight: 1000, + ProGearWeightSpouse: 750, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } // TotalWeight needs to read from the internal weightAllotment, in this case 7000 lbs w/o dependents and @@ -364,7 +361,6 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(true, payload.OrganizationalClothingAndIndividualEquipment) suite.Equal(int64(1000), payload.ProGearWeight) suite.Equal(int64(750), payload.ProGearWeightSpouse) - suite.Equal(true, payload.AdminRestrictedWeightLocation) suite.Equal(int64(1000), *payload.WeightRestriction) suite.NotEmpty(payload.ETag) suite.Equal(etag.GenerateEtag(entitlement.UpdatedAt), payload.ETag) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 1db56e3afd6..b4a5d2e4676 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -180,7 +180,6 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go index da4cb427efe..6f7b5ee3ec7 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go @@ -285,12 +285,11 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), - AdminRestrictedWeightLocation: true, - WeightRestriction: models.IntPointer(1000), + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -313,8 +312,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) - suite.Equal(int64(0), *payload.WeightRestriction) - suite.Equal(true, payload.AdminRestrictedWeightLocation) + suite.Equal(int64(1000), *payload.WeightRestriction) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 638b08e7c7d..ea061eecd40 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -527,12 +527,11 @@ func (suite *PayloadsSuite) TestEntitlement() { StorageInTransit: nil, RequiredMedicalEquipmentWeight: 0, OrganizationalClothingAndIndividualEquipment: false, - ProGearWeight: 0, - ProGearWeightSpouse: 0, - CreatedAt: time.Now(), - UpdatedAt: time.Now(), - AdminRestrictedWeightLocation: true, - WeightRestriction: models.IntPointer(1000), + ProGearWeight: 0, + ProGearWeightSpouse: 0, + CreatedAt: time.Now(), + UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -555,7 +554,6 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) - suite.Equal(true, payload.AdminRestrictedWeightLocation) suite.Equal(int64(1000), *payload.WeightRestriction) }) diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index d516d71eb0b..f56c915ad19 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -34,7 +34,6 @@ type Entitlement struct { OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` - AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` WeightRestriction *int `db:"weight_restriction"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index e4630890d7c..29cc0c5e56c 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -481,10 +481,6 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.GunSafe = *payload.GunSafe } - if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation - } - if payload.WeightRestriction != nil { weightRestriction := int(*payload.WeightRestriction) order.Entitlement.WeightRestriction = &weightRestriction @@ -593,10 +589,6 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.GunSafe = *payload.GunSafe } - if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation - } - if payload.WeightRestriction != nil { weightRestriction := int(*payload.WeightRestriction) order.Entitlement.WeightRestriction = &weightRestriction diff --git a/pkg/services/order/order_updater_test.go b/pkg/services/order/order_updater_test.go index 33590dd225a..0fa72e8d904 100644 --- a/pkg/services/order/order_updater_test.go +++ b/pkg/services/order/order_updater_test.go @@ -775,7 +775,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { proGearWeightSpouse := models.Int64Pointer(10) rmeWeight := models.Int64Pointer(10000) eTag := etag.GenerateEtag(order.UpdatedAt) - adminrestrictedweight := models.BoolPointer(true) weightRestriction := models.Int64Pointer(5000) payload := ghcmessages.CounselingUpdateAllowancePayload{ @@ -786,7 +785,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: adminrestrictedweight, WeightRestriction: weightRestriction, } @@ -808,7 +806,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { suite.Equal(*payload.OrganizationalClothingAndIndividualEquipment, updatedOrder.Entitlement.OrganizationalClothingAndIndividualEquipment) suite.EqualValues(payload.Agency, fetchedSM.Affiliation) suite.Equal(*updatedOrder.Entitlement.DBAuthorizedWeight, 16000) - suite.Equal(payload.AdminRestrictedWeightLocation, models.BoolPointer(updatedOrder.Entitlement.AdminRestrictedWeightLocation)) suite.Equal(*payload.WeightRestriction, int64(*updatedOrder.Entitlement.WeightRestriction)) }) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 7ae7acffc64..f79537af1e6 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,9 +20,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); - const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState( - entitlements?.adminRestrictedWeightLocation || false, - ); + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(entitlements?.weightRestriction > 0); useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -202,6 +200,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab label="Admin restricted weight location" isDisabled={formIsDisabled} onChange={handleAdminWeightLocationChange} + checked={entitlements?.weightRestriction > 0} />
{isAdminWeightLocationChecked && ( diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 6b3c69fe5d5..81dcd5b1a05 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -104,9 +104,10 @@ const AllowancesList = ({ info, showVisualCues }) => {
{info.gunSafe ? 'Authorized' : 'Unauthorized'}
-
Admin Restricted Weight Location
-
{info.adminRestrictedWeightLocation ? 'Yes' : 'No'}
+
Admin Weight Restricted Location
+
{info.weightRestriction > 0 ? 'Yes' : 'No'}
+
Weight Restriction
diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 31bea9a4c4b..8de716f0fa9 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -176,7 +176,7 @@ describe('AllowancesList', () => { expect(screen.getByTestId('unaccompaniedBaggageAllowance')).toBeInTheDocument(); expect(screen.getByTestId('unaccompaniedBaggageAllowance').textContent).toEqual('400 lbs'); }); - it('renders unauthorized ocie', () => { + it('renders unauthorized weight restriction', () => { const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; render(); expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,000 lbs'); diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 18484e884bd..08f05195377 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -102,7 +102,6 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, - adminRestrictedWeightLocation, weightRestriction, accompaniedTour, dependentsTwelveAndOver, @@ -124,7 +123,6 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit: Number(storageInTransit), gunSafe, - adminRestrictedWeightLocation, weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), @@ -141,7 +139,6 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction, storageInTransit, dependentsUnderTwelve, @@ -158,7 +155,6 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction: `${weightRestriction}`, storageInTransit: `${storageInTransit}`, accompaniedTour, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index fcf27b5b15c..1e74c050cc5 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -430,7 +430,6 @@ const MoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, - adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 4a0cbd3846d..9c156d7e384 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -90,7 +90,6 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, - adminRestrictedWeightLocation, weightRestriction, accompaniedTour, dependentsTwelveAndOver, @@ -112,7 +111,6 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: Number(storageInTransit), organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), @@ -129,7 +127,6 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction, storageInTransit, dependentsUnderTwelve, @@ -146,7 +143,6 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, storageInTransit: `${storageInTransit}`, gunSafe, - adminRestrictedWeightLocation, weightRestriction: `${weightRestriction}`, organizationalClothingAndIndividualEquipment, accompaniedTour, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 10322e78921..c5104b99537 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -387,7 +387,6 @@ const ServicesCounselingMoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, - adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 164841fc6e2..83a989da2b8 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -21,9 +21,6 @@ properties: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 91168e48ef1..ccf179de2c3 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -5041,9 +5041,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: type: integer example: 1500 @@ -5901,10 +5898,6 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: Indicates if the customer is restricted to a specific location for their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true @@ -6002,10 +5995,6 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: Indicates if the customer is restricted to a specific location for their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 2eeb7cd3c68..1a531468c77 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -878,9 +878,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: example: 1500 type: integer diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index df3c1822bc1..0ec16edf6cd 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5244,9 +5244,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: type: integer example: 1500 @@ -6153,12 +6150,6 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: >- - Indicates if the customer is restricted to a specific location for - their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true @@ -6269,12 +6260,6 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: >- - Indicates if the customer is restricted to a specific location for - their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 3fe547b0721..9d37bacb134 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3246,9 +3246,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index c89f0f2794e..f4d2c829d84 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1638,9 +1638,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index 741ebb467dd..cf74acb3640 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1745,9 +1745,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/support.yaml b/swagger/support.yaml index b4ea28ca93c..31ecdc921ce 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -953,9 +953,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: example: 1500 type: integer From 3853b1c82c183f69ed3fb283bc18ec26b788a4cf Mon Sep 17 00:00:00 2001 From: deandreJones Date: Thu, 23 Jan 2025 16:37:49 +0000 Subject: [PATCH 083/229] fix dup id --- src/components/Office/DefinitionLists/AllowancesList.jsx | 2 +- src/components/Office/DefinitionLists/AllowancesList.test.jsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 81dcd5b1a05..52fda2c92ba 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -105,7 +105,7 @@ const AllowancesList = ({ info, showVisualCues }) => {
Admin Weight Restricted Location
-
{info.weightRestriction > 0 ? 'Yes' : 'No'}
+
{info.weightRestriction > 0 ? 'Yes' : 'No'}
diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 8de716f0fa9..5c44421c7f5 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -176,7 +176,7 @@ describe('AllowancesList', () => { expect(screen.getByTestId('unaccompaniedBaggageAllowance')).toBeInTheDocument(); expect(screen.getByTestId('unaccompaniedBaggageAllowance').textContent).toEqual('400 lbs'); }); - it('renders unauthorized weight restriction', () => { + it('renders weight restriction', () => { const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; render(); expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,000 lbs'); From 0e2c5d0a412bfb7671804ed03fa8a00e66906375 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 23 Jan 2025 12:14:18 -0500 Subject: [PATCH 084/229] Added tests for new rejection reason in payment details and for event title text. Fixed a potential bad if check in the actionPrefix section. --- .../UpdatePaymentServiceItemStatus.jsx | 11 +++++++- .../UpdatePaymentServiceItemStatus.test.jsx | 25 +++++++++++++++---- .../MoveHistory/PaymentDetails.test.jsx | 24 +++++++++++++++++- 3 files changed, 53 insertions(+), 7 deletions(-) diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index c2f7608d388..a6cd5072ae0 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -29,7 +29,16 @@ export default { tableName: t.payment_service_items, getEventNameDisplay: (historyRecord) => { let actionPrefix = ''; - if (historyRecord.changedValues.rejection_reason !== null || historyRecord.changedValues.status === 'REJECTED') { + + /** + * IF there is a rejection_reason present in the changedValues, then either the reason was updated (in which case the status will be undefined) + * OR it was just rejected, wither way we want the rejected prefix, second || condition is a "just in case" check, not sure if there's a state + * where status would be updated but not rejection_reason + */ + if ( + ('rejection_reason' in historyRecord.changedValues && historyRecord.changedValues.rejection_reason !== null) || + historyRecord.changedValues.status === 'REJECTED' + ) { actionPrefix = 'Rejected'; } else if (historyRecord.changedValues.status === 'APPROVED') { actionPrefix = 'Approved'; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx index 55d83e79c77..a3814f809f4 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx @@ -19,7 +19,7 @@ describe('When approving/rejecting a payment service item', () => { }, ], changedValues: { - reason: 'Some reason', + rejection_reason: 'Some reason', status: 'DENIED', }, eventName: o.updatePaymentServiceItemStatus, @@ -42,18 +42,33 @@ describe('When approving/rejecting a payment service item', () => { it('displays an approved payment service item', () => { const template = getTemplate(approvePaymentServiceItemRecord); + render(template.getEventNameDisplay(approvePaymentServiceItemRecord)); + expect(screen.getByText('Approved Payment Service Item')).toBeInTheDocument(); + render(template.getDetails(approvePaymentServiceItemRecord)); expect(screen.getByText('PPM shipment #RQ38D4-01')).toBeInTheDocument(); - expect(screen.getByText('Status')).toBeInTheDocument(); - expect(screen.getByText(': APPROVED')).toBeInTheDocument(); + }); + + it('displays an updated payment service item', () => { + const updatedServiceItemRecord = { ...approvePaymentServiceItemRecord }; + delete updatedServiceItemRecord.changedValues.status; + delete updatedServiceItemRecord.changedValues.rejection_reason; + const template = getTemplate(updatedServiceItemRecord); + + render(template.getEventNameDisplay(updatedServiceItemRecord)); + expect(screen.getByText('Updated Payment Service Item')).toBeInTheDocument(); + + render(template.getDetails(updatedServiceItemRecord)); + expect(screen.getByText('PPM shipment #RQ38D4-01')).toBeInTheDocument(); }); it('displays a rejected payment service item and the rejection reason', () => { const template = getTemplate(rejectPaymentServiceItemRecord); + render(template.getEventNameDisplay(rejectPaymentServiceItemRecord)); + expect(screen.getByText('Rejected Payment Service Item')).toBeInTheDocument(); + render(template.getDetails(rejectPaymentServiceItemRecord)); - expect(screen.getByText('Status')).toBeInTheDocument(); - expect(screen.getByText(': DENIED')).toBeInTheDocument(); expect(screen.getByText('Reason')).toBeInTheDocument(); expect(screen.getByText(': Some reason')).toBeInTheDocument(); }); diff --git a/src/pages/Office/MoveHistory/PaymentDetails.test.jsx b/src/pages/Office/MoveHistory/PaymentDetails.test.jsx index fca870071c2..f9f38895d70 100644 --- a/src/pages/Office/MoveHistory/PaymentDetails.test.jsx +++ b/src/pages/Office/MoveHistory/PaymentDetails.test.jsx @@ -1,5 +1,5 @@ import React from 'react'; -import { render, screen } from '@testing-library/react'; +import { render, screen, act } from '@testing-library/react'; import PaymentDetails from './PaymentDetails'; @@ -47,4 +47,26 @@ describe('PaymentDetails', () => { expect(screen.getByText(156.78, { exact: false })).toBeInTheDocument(); }); + + describe('rejected service items', () => { + const context = [ + { + name: 'Domestic uncrating', + price: '5555', + status: 'DENIED', + rejection_reason: 'some reason', + }, + ]; + it('renders a rejected service item and its rejection reason', async () => { + render(); + + expect(screen.getByText('Domestic uncrating')).toBeInTheDocument(); + + expect(screen.getByText('Rejection Reason:')).toBeInTheDocument(); + await act(() => { + screen.getByText('Rejection Reason:').click(); + }); + expect(screen.getByText('some reason')).toBeVisible(); + }); + }); }); From 870ba01d0c71e68d7553c6b0cd58ce84452f0bec Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Thu, 23 Jan 2025 17:21:22 +0000 Subject: [PATCH 085/229] MAIN-B-22238 Remove preloaded agents --- pkg/services/move_task_order/move_task_order_fetcher.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/services/move_task_order/move_task_order_fetcher.go b/pkg/services/move_task_order/move_task_order_fetcher.go index 1a0f6d33a50..b7dffdc390d 100644 --- a/pkg/services/move_task_order/move_task_order_fetcher.go +++ b/pkg/services/move_task_order/move_task_order_fetcher.go @@ -156,7 +156,6 @@ func (f moveTaskOrderFetcher) FetchMoveTaskOrder(appCtx appcontext.AppContext, s "MTOShipments.SecondaryPickupAddress.Country", "MTOShipments.TertiaryDeliveryAddress.Country", "MTOShipments.TertiaryPickupAddress.Country", - "MTOShipments.MTOAgents", "MTOShipments.SITDurationUpdates", "MTOShipments.StorageFacility", "MTOShipments.StorageFacility.Address", From 3200c4e25d2637640c2ab16d6a24365e9baba352 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Thu, 23 Jan 2025 17:33:01 +0000 Subject: [PATCH 086/229] add max, fix standards --- .../Office/AllowancesDetailForm/AllowancesDetailForm.jsx | 2 +- src/components/Office/DefinitionLists/AllowancesList.jsx | 2 +- src/pages/Office/MoveAllowances/MoveAllowances.jsx | 1 + .../ServicesCounselingMoveAllowances.jsx | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index f79537af1e6..ee3dc6f5b00 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -171,7 +171,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab isDisabled={formIsDisabled} />
-
Standard Weight allowance
+
Standard weight allowance
{formatWeight(entitlements.totalWeight)}
diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 52fda2c92ba..7bdd17862ae 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -34,7 +34,7 @@ const AllowancesList = ({ info, showVisualCues }) => {
{info.branch ? ORDERS_BRANCH_OPTIONS[info.branch] : ''}
-
Weight allowance
+
Standard weight allowance
{formatWeight(info.totalWeight)}
diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 08f05195377..b2cf0264b3a 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -45,6 +45,7 @@ const validationSchema = Yup.object({ .notRequired(), weightRestriction: Yup.number() .min(0, 'Weight restriction must be greater than or equal to 0') + .max(18000, 'Weight restriction cannot exceed 18,000 lbs') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), }); diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 9c156d7e384..dafd49b76f6 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -43,6 +43,7 @@ const validationSchema = Yup.object({ .notRequired(), weightRestriction: Yup.number() .min(0, 'Weight restriction must be greater than or equal to 0') + .max(18000, 'Weight restriction cannot exceed 18,000 lbs') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), }); From 1951d9f32d45d56d53944a2f80e91fa1d6b66430 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 23 Jan 2025 12:47:30 -0500 Subject: [PATCH 087/229] Adjusted CSS to avoid conflicts with other storybook components --- .../ExpandableServiceItemRow.stories.jsx | 2 +- src/shared/styles/_custom.scss | 40 +++++++++---------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx index 46f49ef1633..4245c20706c 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.stories.jsx @@ -12,7 +12,7 @@ export default {
diff --git a/src/shared/styles/_custom.scss b/src/shared/styles/_custom.scss index 5d02594fc49..f1adceb5e7e 100644 --- a/src/shared/styles/_custom.scss +++ b/src/shared/styles/_custom.scss @@ -347,28 +347,28 @@ table { } // For displaying payment request details/rows in Storybook -.table--stacked { - width: 100%; - table-layout: fixed; - th { - @include u-font-weight(bold); - @include u-font-size('body', '3xs'); - color: $base-darker; - border-top: 0; - - &:not(:first-child) { - text-align: right; - } +.expandableServiceItemRow { + .shipmentCard { + @include u-padding-left(4); } - td:not(:first-child) { - @include u-font-weight(bold); - text-align: right; - } -} + .table--stacked { + width: 100%; + table-layout: fixed; + th { + @include u-font-weight(bold); + @include u-font-size('body', '3xs'); + color: $base-darker; + border-top: 0; -.gridContainer { - .shipmentCard { - @include u-padding-left(4); + &:not(:first-child) { + text-align: right; + } + } + + td:not(:first-child) { + @include u-font-weight(bold); + text-align: right; + } } } From 4a84e7eb9920827c1387f0bc889c57c503915761 Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Thu, 23 Jan 2025 18:15:20 +0000 Subject: [PATCH 088/229] added PPM port to migration, updated tests --- ...52_add_ppm_estimated_incentive_proc.up.sql | 9 +++++++ .../distance_zip_lookup.go | 4 ++-- .../distance_zip_lookup_test.go | 4 ++-- .../port_zip_lookup.go | 4 ++-- .../port_zip_lookup_test.go | 4 ++-- pkg/services/ppmshipment/ppm_estimator.go | 2 +- .../ppmshipment/ppm_estimator_test.go | 24 +++++++++---------- 7 files changed, 30 insertions(+), 21 deletions(-) diff --git a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql index 896af50b01e..c0d7b3c9407 100644 --- a/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql +++ b/migrations/app/schema/20250114164752_add_ppm_estimated_incentive_proc.up.sql @@ -33,6 +33,15 @@ WHERE service_item_param_key_id = '4736f489-dfda-4df1-a303-8c434a120d5d'; DELETE FROM service_item_param_keys WHERE key = 'PriceAreaIntlDest'; +-- adding port info that PPMs will consume +INSERT INTO public.ports +(id, port_code, port_type, port_name, created_at, updated_at) +VALUES('d8776c6b-bc5e-45d8-ac50-ab60c34c022d'::uuid, '4E1', 'S','TACOMA, PUGET SOUND', now(), now()); + +INSERT INTO public.port_locations +(id, port_id, cities_id, us_post_region_cities_id, country_id, is_active, created_at, updated_at) +VALUES('ee3a97dc-112e-4805-8518-f56f2d9c6cc6'::uuid, 'd8776c6b-bc5e-45d8-ac50-ab60c34c022d'::uuid, 'baaf6ab1-6142-4fb7-b753-d0a142c75baf'::uuid, '86fef297-d61f-44ea-afec-4f679ce686b7'::uuid, '791899e6-cd77-46f2-981b-176ecb8d7098'::uuid, true, now(), now()); + -- func to fetch a service id from re_services by providing the service code CREATE OR REPLACE FUNCTION get_service_id(service_code TEXT) RETURNS UUID AS $$ DECLARE diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go index cd1f99edda3..968cfe718a9 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup.go @@ -79,9 +79,9 @@ func (r DistanceZipLookup) lookup(appCtx appcontext.AppContext, keyData *Service } } else { // PPMs get reimbursed for their travel from CONUS <-> Port ZIPs, but only for the Tacoma Port - portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") // Tacoma port code + portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "4E1") // Tacoma port code if err != nil { - return "", fmt.Errorf("unable to find port zip with code %s", "3002") + return "", fmt.Errorf("unable to find port zip with code %s", "4E1") } if mtoShipment.PPMShipment != nil && mtoShipment.PPMShipment.PickupAddress != nil && mtoShipment.PPMShipment.DestinationAddress != nil { // need to figure out if we are going to go Port -> CONUS or CONUS -> Port diff --git a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go index 918442f2ca5..0ac37eb213b 100644 --- a/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/distance_zip_lookup_test.go @@ -171,8 +171,8 @@ func (suite *ServiceParamValueLookupsSuite) TestDistanceLookup() { suite.NotNil(distance) planner := suite.planner.(*mocks.Planner) - // should be called with the 98424 ZIP of the Tacoma port and NOT 99505 - planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupAddress.PostalCode, "98424", false, true) + // should be called with the 98421 ZIP of the Tacoma port and NOT 99505 + planner.AssertCalled(suite.T(), "ZipTransitDistance", appContext, ppmShipment.PickupAddress.PostalCode, "98421", false, true) }) suite.Run("Calculate transit zip distance with an approved Destination SIT service item", func() { diff --git a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go index bade82c04b9..9621c56cd8a 100644 --- a/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/port_zip_lookup.go @@ -28,9 +28,9 @@ func (p PortZipLookup) lookup(appCtx appcontext.AppContext, keyData *ServiceItem return "", fmt.Errorf("unable to find shipment with id %s", keyData.mtoShipmentID) } if shipment.ShipmentType == models.MTOShipmentTypePPM && shipment.MarketCode == models.MarketCodeInternational { - portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") + portLocation, err := models.FetchPortLocationByCode(appCtx.DB(), "4E1") if err != nil { - return "", fmt.Errorf("unable to find port zip with code %s", "3002") + return "", fmt.Errorf("unable to find port zip with code %s", "4E1") } return portLocation.UsPostRegionCity.UsprZipID, nil } else { diff --git a/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go b/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go index 3f8776e0ecf..b06533a4e1f 100644 --- a/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/port_zip_lookup_test.go @@ -85,11 +85,11 @@ func (suite *ServiceParamValueLookupsSuite) TestPortZipLookup() { suite.Equal(portZip, port.UsPostRegionCity.UsprZipID) }) - suite.Run("success - returns PortZip value for Port Code 3002 for PPMs", func() { + suite.Run("success - returns PortZip value for Port Code 4E1 for PPMs", func() { port := factory.FetchPortLocation(suite.DB(), []factory.Customization{ { Model: models.Port{ - PortCode: "3002", + PortCode: "4E1", }, }, }, nil) diff --git a/pkg/services/ppmshipment/ppm_estimator.go b/pkg/services/ppmshipment/ppm_estimator.go index b925cf6bfcf..d54f2f516f0 100644 --- a/pkg/services/ppmshipment/ppm_estimator.go +++ b/pkg/services/ppmshipment/ppm_estimator.go @@ -769,7 +769,7 @@ func (f estimatePPM) priceBreakdown(appCtx appcontext.AppContext, ppmShipment *m // this simulates the reimbursement for an iHHG move with ISLH, IHPK, IHUPK, and CONUS portion of FSC func (f *estimatePPM) CalculateOCONUSIncentive(appCtx appcontext.AppContext, ppmShipmentID uuid.UUID, pickupAddress models.Address, destinationAddress models.Address, moveDate time.Time, weight int, isEstimated bool, isActual bool, isMax bool) (*unit.Cents, error) { var mileage int - ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "3002") // Tacoma, WA port + ppmPort, err := models.FetchPortLocationByCode(appCtx.DB(), "4E1") // Tacoma, WA port if err != nil { return nil, fmt.Errorf("failed to fetch port location: %w", err) } diff --git a/pkg/services/ppmshipment/ppm_estimator_test.go b/pkg/services/ppmshipment/ppm_estimator_test.go index 1e0cf6cf6c2..6f647387bcc 100644 --- a/pkg/services/ppmshipment/ppm_estimator_test.go +++ b/pkg/services/ppmshipment/ppm_estimator_test.go @@ -2086,7 +2086,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { newPPM.EstimatedWeight = &estimatedWeight planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "74133", "98424", true, true).Return(3000, nil) + "74133", "98421", true, true).Return(3000, nil) ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2094,7 +2094,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "74133", "98424", true, true) + "74133", "98421", true, true) suite.Equal(unit.Cents(459178), *ppmEstimate) }) @@ -2133,7 +2133,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { newPPM.EstimatedWeight = &estimatedWeight planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "74133", true, true).Return(3000, nil) + "98421", "74133", true, true).Return(3000, nil) ppmEstimate, _, err := ppmEstimator.EstimateIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2141,7 +2141,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "74133", true, true) + "98421", "74133", true, true) suite.Equal(unit.Cents(423178), *ppmEstimate) }) }) @@ -2215,7 +2215,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // DTOD will be called to get the distance between the origin duty location & the Tacoma Port ZIP planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "50309", "98424", true, true).Return(3000, nil) + "50309", "98421", true, true).Return(3000, nil) ppmMaxIncentive, err := ppmEstimator.MaxIncentive(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2223,7 +2223,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "50309", "98424", true, true) + "50309", "98421", true, true) suite.Equal(unit.Cents(656532), *ppmMaxIncentive) }) @@ -2295,7 +2295,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // DTOD will be called to get the distance between the origin duty location & the Tacoma Port ZIP planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "30813", true, true).Return(3000, nil) + "98421", "30813", true, true).Return(3000, nil) ppmMaxIncentive, err := ppmEstimator.MaxIncentive(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2303,7 +2303,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "30813", true, true) + "98421", "30813", true, true) suite.Equal(unit.Cents(676692), *ppmMaxIncentive) }) }) @@ -2362,7 +2362,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { setupPricerData() planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "74133", "98424", true, true).Return(3000, nil) + "74133", "98421", true, true).Return(3000, nil) ppmFinalIncentive, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2370,7 +2370,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "74133", "98424", true, true) + "74133", "98421", true, true) suite.Equal(unit.Cents(459178), *ppmFinalIncentive) }) @@ -2427,7 +2427,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { setupPricerData() planner.On("ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "74133", true, true).Return(3000, nil) + "98421", "74133", true, true).Return(3000, nil) ppmFinalIncentive, err := ppmEstimator.FinalIncentiveWithDefaultChecks(suite.AppContextForTest(), ppm, &newPPM) suite.NilOrNoVerrs(err) @@ -2435,7 +2435,7 @@ func (suite *PPMShipmentSuite) TestInternationalPPMEstimator() { // it should've called from the pickup -> port and NOT pickup -> dest planner.AssertCalled(suite.T(), "ZipTransitDistance", mock.AnythingOfType("*appcontext.appContext"), - "98424", "74133", true, true) + "98421", "74133", true, true) suite.Equal(unit.Cents(423178), *ppmFinalIncentive) }) }) From 94bd71a933066f18d041a14f8b79751534833f67 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 23 Jan 2025 14:06:41 -0500 Subject: [PATCH 089/229] Fixed td style that was overriding other component styles. --- .../ExpandableServiceItemRow.module.scss | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index 43ca34b8759..0cab37efe3e 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -88,10 +88,6 @@ @include u-padding-top(2); } - td { - background-color: $bg-gray; - } - .reasonText { font-weight: normal; } @@ -103,6 +99,7 @@ padding-right: 2rem; padding-left: 1rem; border-left: 1px solid #dfe1e2; + background-color: $bg-gray; } .rejectionReasonContainer { From d02ee32a751cf89d5537ee322aa55f4b5b43e9ee Mon Sep 17 00:00:00 2001 From: JamesHawks224 <146897935+JamesHawks224@users.noreply.github.com> Date: Thu, 23 Jan 2025 20:10:30 +0000 Subject: [PATCH 090/229] code changes to add service items for international NTS-R --- ...250120214107_add_international_ntsr_service_items.up.sql | 4 +++- pkg/factory/mto_shipment_factory.go | 6 +++++- pkg/services/mto_shipment/shipment_approver.go | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql index 74db52ee7a1..c80906403d9 100644 --- a/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql +++ b/migrations/app/schema/20250120214107_add_international_ntsr_service_items.up.sql @@ -10,8 +10,10 @@ VALUES ('db2106c8-887c-4304-aad2-c7413de13cc4', '388115e8-abe9-441d-96cf-a39f24baa0a3' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 2), --POEFSC International POD Fuel Surcharge ('509a491d-cddd-476c-9ba0-65077cf93e58', 'f75758d8-2fcd-40ba-9432-3ff3032a71d1' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 2), + --IHUPK International HHG unpack + ('89c6c283-4666-46c6-91ee-8041db7f88a7', '56e91c2d-015d-4243-9657-3ed34867abaa' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 3), --INPK International NTS packing - ('4d348ec0-a278-4038-b061-6a4e17ea6721', '874cb86a-bc39-4f57-a614-53ee3fcacf14' ,'HHG_OUTOF_NTS', 'i', true, now(), now(), 3), + ('4d348ec0-a278-4038-b061-6a4e17ea6721', '874cb86a-bc39-4f57-a614-53ee3fcacf14' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), --ICRT International crating ('b8f4e434-0912-44c5-b824-c60e5c5dffee', '86203d72-7f7c-49ff-82f0-5b95e4958f60' ,'HHG_OUTOF_NTS', 'i', false, now(), now(), NULL), --IDASIT International destination add'l day SIT diff --git a/pkg/factory/mto_shipment_factory.go b/pkg/factory/mto_shipment_factory.go index 0dc95a166e6..e08ccb3f3ba 100644 --- a/pkg/factory/mto_shipment_factory.go +++ b/pkg/factory/mto_shipment_factory.go @@ -63,7 +63,7 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization, defaultStatus = models.MTOShipmentStatusDraft buildStorageFacility = hasStorageFacilityCustom addPrimeActualWeight = false - shipmentHasPickupDetails = false + shipmentHasPickupDetails = true shipmentHasDeliveryDetails = true case mtoShipmentBuildBasic: setupPickupAndDelivery = false @@ -87,6 +87,10 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization, newMTOShipment.DestinationAddress = &newMTOShipment.StorageFacility.Address } + if newMTOShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTS && newMTOShipment.StorageFacility != nil { + newMTOShipment.PickupAddress = &newMTOShipment.StorageFacility.Address + } + if cMtoShipment.Status == models.MTOShipmentStatusApproved { approvedDate := time.Date(GHCTestYear, time.March, 20, 0, 0, 0, 0, time.UTC) newMTOShipment.ApprovedDate = &approvedDate diff --git a/pkg/services/mto_shipment/shipment_approver.go b/pkg/services/mto_shipment/shipment_approver.go index b285684a62b..00c4c9f5fc4 100644 --- a/pkg/services/mto_shipment/shipment_approver.go +++ b/pkg/services/mto_shipment/shipment_approver.go @@ -81,7 +81,7 @@ func (f *shipmentApprover) ApproveShipment(appCtx appcontext.AppContext, shipmen transactionError := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error { // create international shipment service items before approving // we use a database proc to create the basic auto-approved service items - internationalShipmentTypes := []models.MTOShipmentType{models.MTOShipmentTypeHHG, models.MTOShipmentTypeHHGIntoNTS, models.MTOShipmentTypeUnaccompaniedBaggage} + internationalShipmentTypes := []models.MTOShipmentType{models.MTOShipmentTypeHHG, models.MTOShipmentTypeHHGIntoNTS, models.MTOShipmentTypeHHGOutOfNTS, models.MTOShipmentTypeUnaccompaniedBaggage} if slices.Contains(internationalShipmentTypes, shipment.ShipmentType) && shipment.MarketCode == models.MarketCodeInternational { err := models.CreateApprovedServiceItemsForShipment(appCtx.DB(), shipment) if err != nil { From a8e1a8b76d8d3c97b62b98993e7bf250b151f7c3 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 23 Jan 2025 20:57:15 +0000 Subject: [PATCH 091/229] Updated go code and frontend code to catch edge case where if TIO clicked "cleared selection" on a service item it would show as rejected. Added unit test for this case. --- .../payment_service_item_status_updater.go | 19 +++++++++++-------- .../UpdatePaymentServiceItemStatus.jsx | 8 +++++--- .../UpdatePaymentServiceItemStatus.test.jsx | 13 +++++++++++++ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/pkg/services/payment_service_item/payment_service_item_status_updater.go b/pkg/services/payment_service_item/payment_service_item_status_updater.go index b0d822ea7e2..0d064a6cc65 100644 --- a/pkg/services/payment_service_item/payment_service_item_status_updater.go +++ b/pkg/services/payment_service_item/payment_service_item_status_updater.go @@ -70,21 +70,24 @@ func (p *paymentServiceItemUpdater) updatePaymentServiceItem(appCtx appcontext.A return models.PaymentServiceItem{}, nil, verr } - // If we're denying this thing we want to make sure to update the DeniedAt field and nil out ApprovedAt. - if desiredStatus == models.PaymentServiceItemStatusDenied { + switch desiredStatus { + // when the user hits "clear selection" we want to clear all the fields + case models.PaymentServiceItemStatusRequested: + paymentServiceItem.RejectionReason = nil + paymentServiceItem.DeniedAt = nil + paymentServiceItem.ApprovedAt = nil + // if being denied, we want to nil out approvedAt and populate deniedAt + case models.PaymentServiceItemStatusDenied: paymentServiceItem.RejectionReason = rejectionReason paymentServiceItem.DeniedAt = models.TimePointer(time.Now()) paymentServiceItem.ApprovedAt = nil - paymentServiceItem.Status = desiredStatus - } - // If we're approving this thing then we don't want there to be a rejection reason - // We also will want to update the ApprovedAt field and nil out the DeniedAt field. - if desiredStatus == models.PaymentServiceItemStatusApproved { + // if being approved, populate approvedAt + case models.PaymentServiceItemStatusApproved: paymentServiceItem.RejectionReason = nil paymentServiceItem.DeniedAt = nil paymentServiceItem.ApprovedAt = models.TimePointer(time.Now()) - paymentServiceItem.Status = desiredStatus } + paymentServiceItem.Status = desiredStatus // Save the record verrs, err := appCtx.DB().ValidateAndSave(&paymentServiceItem) diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index a6cd5072ae0..5f92c395e70 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -13,10 +13,9 @@ const formatChangedValues = (historyRecord) => { }; // Removed unneeded values to avoid clutter in audit log - if (newChangedValues.status === 'APPROVED') { + if (newChangedValues.status === 'APPROVED' || newChangedValues.status === 'REQUESTED') { delete newChangedValues.rejection_reason; } - delete newChangedValues.status; const newHistoryRecord = { ...historyRecord }; delete newHistoryRecord.changedValues.status; @@ -36,7 +35,10 @@ export default { * where status would be updated but not rejection_reason */ if ( - ('rejection_reason' in historyRecord.changedValues && historyRecord.changedValues.rejection_reason !== null) || + ('rejection_reason' in historyRecord.changedValues && + historyRecord.changedValues.rejection_reason !== null && + historyRecord.changedValues.status !== 'APPROVED' && + historyRecord.changedValues.status !== 'REQUESTED') || historyRecord.changedValues.status === 'REJECTED' ) { actionPrefix = 'Rejected'; diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx index a3814f809f4..1d0c3216a91 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.test.jsx @@ -72,4 +72,17 @@ describe('When approving/rejecting a payment service item', () => { expect(screen.getByText('Reason')).toBeInTheDocument(); expect(screen.getByText(': Some reason')).toBeInTheDocument(); }); + + it('displays a cleared payment service item with no unneeded information', () => { + const clearedServiceItem = rejectPaymentServiceItemRecord; + clearedServiceItem.changedValues.status = 'REQUESTED'; + const template = getTemplate(clearedServiceItem); + + render(template.getEventNameDisplay(clearedServiceItem)); + expect(screen.getByText('Updated Payment Service Item')).toBeInTheDocument(); + + render(template.getDetails(clearedServiceItem)); + expect(screen.queryByText('Reason')).not.toBeInTheDocument(); + expect(screen.queryByText(': Some reason')).not.toBeInTheDocument(); + }); }); From 976d82366b7aff4dba0824d2193264de28fcca41 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Thu, 23 Jan 2025 21:27:11 +0000 Subject: [PATCH 092/229] Undo backend code change --- .../payment_service_item_status_updater.go | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkg/services/payment_service_item/payment_service_item_status_updater.go b/pkg/services/payment_service_item/payment_service_item_status_updater.go index 0d064a6cc65..b0d822ea7e2 100644 --- a/pkg/services/payment_service_item/payment_service_item_status_updater.go +++ b/pkg/services/payment_service_item/payment_service_item_status_updater.go @@ -70,24 +70,21 @@ func (p *paymentServiceItemUpdater) updatePaymentServiceItem(appCtx appcontext.A return models.PaymentServiceItem{}, nil, verr } - switch desiredStatus { - // when the user hits "clear selection" we want to clear all the fields - case models.PaymentServiceItemStatusRequested: - paymentServiceItem.RejectionReason = nil - paymentServiceItem.DeniedAt = nil - paymentServiceItem.ApprovedAt = nil - // if being denied, we want to nil out approvedAt and populate deniedAt - case models.PaymentServiceItemStatusDenied: + // If we're denying this thing we want to make sure to update the DeniedAt field and nil out ApprovedAt. + if desiredStatus == models.PaymentServiceItemStatusDenied { paymentServiceItem.RejectionReason = rejectionReason paymentServiceItem.DeniedAt = models.TimePointer(time.Now()) paymentServiceItem.ApprovedAt = nil - // if being approved, populate approvedAt - case models.PaymentServiceItemStatusApproved: + paymentServiceItem.Status = desiredStatus + } + // If we're approving this thing then we don't want there to be a rejection reason + // We also will want to update the ApprovedAt field and nil out the DeniedAt field. + if desiredStatus == models.PaymentServiceItemStatusApproved { paymentServiceItem.RejectionReason = nil paymentServiceItem.DeniedAt = nil paymentServiceItem.ApprovedAt = models.TimePointer(time.Now()) + paymentServiceItem.Status = desiredStatus } - paymentServiceItem.Status = desiredStatus // Save the record verrs, err := appCtx.DB().ValidateAndSave(&paymentServiceItem) From edb550052c5fdbbfab3e6e135d5b409bc1d57b22 Mon Sep 17 00:00:00 2001 From: Tevin Adams Date: Fri, 24 Jan 2025 11:41:29 +0000 Subject: [PATCH 093/229] Admin Requested Office Users Filtering --- pkg/handlers/adminapi/api.go | 10 +- .../adminapi/requested_office_users.go | 100 ++++++++++++++ .../adminapi/requested_office_users_test.go | 130 ++++++++++++++++++ pkg/handlers/ghcapi/tranportation_offices.go | 4 +- .../internalapi/transportation_offices.go | 2 +- pkg/models/roles/roles.go | 22 +++ pkg/models/roles/roles_test.go | 36 +++++ .../mocks/TransportationOfficesFetcher.go | 18 +-- pkg/services/transportation_office.go | 2 +- .../transportation_office_fetcher.go | 18 ++- .../transportation_office_fetcher_test.go | 6 +- .../RequestedOfficeUserList.jsx | 24 +++- .../RequestedOfficeUserShow.module.scss | 4 +- 13 files changed, 346 insertions(+), 30 deletions(-) diff --git a/pkg/handlers/adminapi/api.go b/pkg/handlers/adminapi/api.go index 34d6729a0f2..0af87177ea9 100644 --- a/pkg/handlers/adminapi/api.go +++ b/pkg/handlers/adminapi/api.go @@ -53,16 +53,19 @@ func NewAdminAPI(handlerConfig handlers.HandlerConfig) *adminops.MymoveAPI { adminAPI.ServeError = handlers.ServeCustomError + transportationOfficeFetcher := transportationoffice.NewTransportationOfficesFetcher() + userRolesCreator := usersroles.NewUsersRolesCreator() + newRolesFetcher := roles.NewRolesFetcher() + adminAPI.RequestedOfficeUsersIndexRequestedOfficeUsersHandler = IndexRequestedOfficeUsersHandler{ handlerConfig, requestedofficeusers.NewRequestedOfficeUsersListFetcher(queryBuilder), query.NewQueryFilter, pagination.NewPagination, + transportationOfficeFetcher, + newRolesFetcher, } - userRolesCreator := usersroles.NewUsersRolesCreator() - newRolesFetcher := roles.NewRolesFetcher() - adminAPI.RequestedOfficeUsersGetRequestedOfficeUserHandler = GetRequestedOfficeUserHandler{ handlerConfig, requestedofficeusers.NewRequestedOfficeUserFetcher(queryBuilder), @@ -119,7 +122,6 @@ func NewAdminAPI(handlerConfig handlers.HandlerConfig) *adminops.MymoveAPI { pagination.NewPagination, } - transportationOfficeFetcher := transportationoffice.NewTransportationOfficesFetcher() adminAPI.TransportationOfficesGetOfficeByIDHandler = GetOfficeByIdHandler{ handlerConfig, transportationOfficeFetcher, diff --git a/pkg/handlers/adminapi/requested_office_users.go b/pkg/handlers/adminapi/requested_office_users.go index ece06237578..e0ab3dc7175 100644 --- a/pkg/handlers/adminapi/requested_office_users.go +++ b/pkg/handlers/adminapi/requested_office_users.go @@ -21,6 +21,7 @@ import ( "github.com/transcom/mymove/pkg/handlers" "github.com/transcom/mymove/pkg/handlers/authentication/okta" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/models/roles" "github.com/transcom/mymove/pkg/notifications" "github.com/transcom/mymove/pkg/services" "github.com/transcom/mymove/pkg/services/query" @@ -148,12 +149,62 @@ func CreateOfficeOktaAccount(appCtx appcontext.AppContext, params requested_offi return res, nil } +// Function that filters Requested Office Users based on filtered Transportation Offices +func filterByTransportationOffice(officeUsers models.OfficeUsers, filteredTransportationOffices models.TransportationOffices) models.OfficeUsers { + var filteredOfficeUsers models.OfficeUsers + var currentOfficeUser models.OfficeUser + var currentTransportationOffice models.TransportationOffice + + for i := range officeUsers { + currentOfficeUser = officeUsers[i] + for j := range filteredTransportationOffices { + currentTransportationOffice = filteredTransportationOffices[j] + + if currentOfficeUser.TransportationOfficeID == currentTransportationOffice.ID { + filteredOfficeUsers = append(filteredOfficeUsers, currentOfficeUser) + } + } + } + + return filteredOfficeUsers +} + +// Function that filters Requested Office Users based on filtered Roles +func filterByRoles(officeUsers models.OfficeUsers, roles roles.Roles) models.OfficeUsers { + var filteredOfficeUsers models.OfficeUsers + filteredRoles := roles + + for i := range officeUsers { + currentOfficeUser := officeUsers[i] + userRoles := currentOfficeUser.User.Roles + hasFilteredRole := false + + for j := range userRoles { + compUserRole := userRoles[j] + for k := range filteredRoles { + compFilteredRole := filteredRoles[k] + if compUserRole.ID == compFilteredRole.ID { + hasFilteredRole = true + } + } + } + + if hasFilteredRole { + filteredOfficeUsers = append(filteredOfficeUsers, currentOfficeUser) + } + } + + return filteredOfficeUsers +} + // IndexRequestedOfficeUsersHandler returns a list of requested office users via GET /requested_office_users type IndexRequestedOfficeUsersHandler struct { handlers.HandlerConfig services.RequestedOfficeUserListFetcher services.NewQueryFilter services.NewPagination + services.TransportationOfficesFetcher + services.RoleAssociater } var requestedOfficeUserFilterConverters = map[string]func(string) []services.QueryFilter{ @@ -167,6 +218,9 @@ var requestedOfficeUserFilterConverters = map[string]func(string) []services.Que }, } +var TransportationOfficeSearch = "transportationOfficeSearch" +var RoleSearch = "rolesSearch" + // Handle retrieves a list of requested office users func (h IndexRequestedOfficeUsersHandler) Handle(params requested_office_users.IndexRequestedOfficeUsersParams) middleware.Responder { return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, @@ -192,6 +246,52 @@ func (h IndexRequestedOfficeUsersHandler) Handle(params requested_office_users.I return handlers.ResponseForError(appCtx.Logger(), err), err } + // Requested office user filters that is being used + requestedOfficeUserFilters := map[string]string{} + + if params.Filter != nil { + if err := json.Unmarshal([]byte(*params.Filter), &requestedOfficeUserFilters); err != nil { + return handlers.ResponseForError(appCtx.Logger(), err), err + } + } + + var filteredTransportationOffices models.TransportationOffices + // If there was a Transportation Office filter applied then get the filtered Transportation Offices + if requestedOfficeUserFilters[TransportationOfficeSearch] != "" { + var tErr error + searchString := requestedOfficeUserFilters[TransportationOfficeSearch] + transportationOfficesFilterResults, tErr := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, searchString, false, true) + if tErr != nil { + appCtx.Logger().Error("Error searching for Transportation Offices using filter: ", zap.Error(err)) + return handlers.ResponseForError(appCtx.Logger(), err), err + } + + filteredTransportationOffices = *transportationOfficesFilterResults + } + + // If there was a Roles filter applied then get the filtered Roles + var filteredRoles roles.Roles + if requestedOfficeUserFilters[RoleSearch] != "" { + var rErr error + rolesFilterResult, err := roles.FindRoles(appCtx.DB(), requestedOfficeUserFilters[RoleSearch]) + if rErr != nil { + appCtx.Logger().Error("Error searching for Roles using filter: ", zap.Error(err)) + return handlers.ResponseForError(appCtx.Logger(), err), err + } + + filteredRoles = rolesFilterResult + } + + // Filter users by filteredTransportationOffices if the filter is used + if len(filteredTransportationOffices) > 0 && len(officeUsers) > 0 { + officeUsers = filterByTransportationOffice(officeUsers, filteredTransportationOffices) + } + + // Filter users by roles if the filter is used + if len(filteredRoles) > 0 && len(officeUsers) > 0 { + officeUsers = filterByRoles(officeUsers, filteredRoles) + } + totalOfficeUsersCount, err := h.RequestedOfficeUserListFetcher.FetchRequestedOfficeUsersCount(appCtx, queryFilters) if err != nil { return handlers.ResponseForError(appCtx.Logger(), err), err diff --git a/pkg/handlers/adminapi/requested_office_users_test.go b/pkg/handlers/adminapi/requested_office_users_test.go index d84c87ad69c..117741cf35d 100644 --- a/pkg/handlers/adminapi/requested_office_users_test.go +++ b/pkg/handlers/adminapi/requested_office_users_test.go @@ -1,6 +1,7 @@ package adminapi import ( + "encoding/json" "fmt" "net/http" "time" @@ -22,6 +23,7 @@ import ( "github.com/transcom/mymove/pkg/services/pagination" "github.com/transcom/mymove/pkg/services/query" requestedofficeusers "github.com/transcom/mymove/pkg/services/requested_office_users" + transportationofficeservice "github.com/transcom/mymove/pkg/services/transportation_office" ) func (suite *HandlerSuite) TestIndexRequestedOfficeUsersHandler() { @@ -486,6 +488,134 @@ func (suite *HandlerSuite) TestUpdateRequestedOfficeUserHandlerWithOktaAccountCr }) } +func (suite *HandlerSuite) TestFilterByTransportationOffice() { + + transportationOffice1 := factory.BuildTransportationOffice(suite.DB(), []factory.Customization{ + { + Model: models.TransportationOffice{ + Name: "PPPO Camp Houston", + ProvidesCloseout: false, + }, + }, + }, nil) + transportationOffice2 := factory.BuildTransportationOffice(suite.DB(), []factory.Customization{ + { + Model: models.TransportationOffice{ + Name: "PPPO Camp David", + ProvidesCloseout: false, + }, + }, + }, nil) + transportationOffice3 := factory.BuildTransportationOffice(suite.DB(), []factory.Customization{ + { + Model: models.TransportationOffice{ + Name: "Fort Bliss", + ProvidesCloseout: false, + }, + }, + }, nil) + + mockRoleAssociator := &mocks.RoleAssociater{} + tioRole := factory.FetchOrBuildRoleByRoleType(suite.DB(), roles.RoleTypeTIO) + tooRole := factory.FetchOrBuildRoleByRoleType(suite.DB(), roles.RoleTypeTOO) + scRole := factory.FetchOrBuildRoleByRoleType(suite.DB(), roles.RoleTypeServicesCounselor) + primeRole := factory.FetchOrBuildRoleByRoleType(suite.DB(), roles.RoleTypePrimeSimulator) + mockRoles := roles.Roles{tioRole, tooRole, scRole, primeRole} + mockRoleAssociator.On( + "FetchRolesForUser", + mock.AnythingOfType("*appcontext.appContext"), + mock.Anything, + ).Return(mockRoles, nil) + + requestedStatus := models.OfficeUserStatusREQUESTED + + requestedOfficeUsers := models.OfficeUsers{ + factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice1, + LinkOnly: true, + }, + { + Model: models.OfficeUser{ + Status: &requestedStatus, + }, + }, + }, []roles.RoleType{roles.RoleTypeTOO}), + factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice2, + LinkOnly: true, + }, + { + Model: models.OfficeUser{ + Status: &requestedStatus, + }, + }, + }, []roles.RoleType{roles.RoleTypeTIO}), + factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice2, + LinkOnly: true, + }, + { + Model: models.OfficeUser{ + Status: &requestedStatus, + }, + }, + }, []roles.RoleType{roles.RoleTypeServicesCounselor}), + factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice3, + LinkOnly: true, + }, + { + Model: models.OfficeUser{ + Status: &requestedStatus, + }, + }, + }, []roles.RoleType{roles.RoleTypeServicesCounselor}), + } + + type paramFilter struct { + TransportationOfficeSearch string `json:"transportationOfficeSearch"` + RolesSearch string `json:"rolesSearch"` + } + + var testParamFilter paramFilter + + testParamFilter.RolesSearch = "Task" + testParamFilter.TransportationOfficeSearch = "PPPO" + + testParamFilterJsonStr, err := json.Marshal(testParamFilter) + suite.NoError(err) + + rolesSearchFilterString := string(testParamFilterJsonStr) + params := requestedofficeuserop.IndexRequestedOfficeUsersParams{ + HTTPRequest: suite.setupAuthenticatedRequest("GET", "/requested_office_users"), + Filter: &rolesSearchFilterString, + } + + queryBuilder := query.NewQueryBuilder() + transportationOfficeFetcher := transportationofficeservice.NewTransportationOfficesFetcher() + + handler := IndexRequestedOfficeUsersHandler{ + HandlerConfig: suite.HandlerConfig(), + RequestedOfficeUserListFetcher: requestedofficeusers.NewRequestedOfficeUsersListFetcher(queryBuilder), + NewQueryFilter: query.NewQueryFilter, + NewPagination: pagination.NewPagination, + TransportationOfficesFetcher: transportationOfficeFetcher, + RoleAssociater: mockRoleAssociator, + } + + response := handler.Handle(params) + + suite.IsType(&requestedofficeuserop.IndexRequestedOfficeUsersOK{}, response) + okResponse := response.(*requestedofficeuserop.IndexRequestedOfficeUsersOK) + suite.Len(okResponse.Payload, 2) + suite.Equal(requestedOfficeUsers[0].ID.String(), okResponse.Payload[0].ID.String()) + suite.Equal(requestedOfficeUsers[1].ID.String(), okResponse.Payload[1].ID.String()) +} + // Generate and activate Okta endpoints that will be using during the handler func mockAndActivateOktaEndpoints(provider *okta.Provider, responseCode int) { activate := "true" diff --git a/pkg/handlers/ghcapi/tranportation_offices.go b/pkg/handlers/ghcapi/tranportation_offices.go index 405580923bb..0f2e28cff30 100644 --- a/pkg/handlers/ghcapi/tranportation_offices.go +++ b/pkg/handlers/ghcapi/tranportation_offices.go @@ -22,7 +22,7 @@ func (h GetTransportationOfficesHandler) Handle(params transportationofficeop.Ge // B-21022: forPpm param is set true. This is used by PPM closeout widget. Need to ensure certain offices are included/excluded // if location has ppm closedout enabled. - transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, true) + transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, true, false) if err != nil { appCtx.Logger().Error("Error searching for Transportation Offices: ", zap.Error(err)) @@ -43,7 +43,7 @@ func (h GetTransportationOfficesOpenHandler) Handle(params transportationofficeo return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, func(appCtx appcontext.AppContext) (middleware.Responder, error) { - transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, false) + transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, false, false) if err != nil { appCtx.Logger().Error("Error searching for Transportation Offices: ", zap.Error(err)) return transportationofficeop.NewGetTransportationOfficesOpenInternalServerError(), err diff --git a/pkg/handlers/internalapi/transportation_offices.go b/pkg/handlers/internalapi/transportation_offices.go index 6b535fd9ba9..4694eba8fed 100644 --- a/pkg/handlers/internalapi/transportation_offices.go +++ b/pkg/handlers/internalapi/transportation_offices.go @@ -51,7 +51,7 @@ func (h GetTransportationOfficesHandler) Handle(params transportationofficeop.Ge return transportationofficeop.NewGetTransportationOfficesForbidden(), noServiceMemberIDErr } - transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, true) + transportationOffices, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, params.Search, true, false) if err != nil { appCtx.Logger().Error("Error searching for Transportation Offices: ", zap.Error(err)) return transportationofficeop.NewGetTransportationOfficesInternalServerError(), err diff --git a/pkg/models/roles/roles.go b/pkg/models/roles/roles.go index 10fedc99b6e..dd326a3f895 100644 --- a/pkg/models/roles/roles.go +++ b/pkg/models/roles/roles.go @@ -94,3 +94,25 @@ func FetchRolesForUser(db *pop.Connection, userID uuid.UUID) (Roles, error) { All(&roles) return roles, err } + +// Fetch like roles based on the search parameter +func FindRoles(db *pop.Connection, search string) (Roles, error) { + var rolesList Roles + + // The % operator filters out strings that are below this similarity threshold + err := db.Q().RawQuery("SET pg_trgm.similarity_threshold = 0.03").Exec() + if err != nil { + return rolesList, err + } + + sqlQuery := `select * from roles where role_name % $1` + + query := db.Q().RawQuery(sqlQuery, search) + if err := query.All(&rolesList); err != nil { + if err != nil { + return rolesList, err + } + } + + return rolesList, nil +} diff --git a/pkg/models/roles/roles_test.go b/pkg/models/roles/roles_test.go index 9ec5a0e7d86..8df5ab6a6be 100644 --- a/pkg/models/roles/roles_test.go +++ b/pkg/models/roles/roles_test.go @@ -3,10 +3,12 @@ package roles_test import ( "testing" + "github.com/gofrs/uuid" "github.com/stretchr/testify/suite" "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/models/roles" m "github.com/transcom/mymove/pkg/models/roles" "github.com/transcom/mymove/pkg/testingsuite" ) @@ -66,3 +68,37 @@ func (suite *RolesSuite) TestFetchRolesForUser() { suite.NoError(err) suite.Equal(1, len(userRoles), userRoles) } + +func (suite *RolesSuite) TestFindRoles() { + id1, _ := uuid.NewV4() + role1 := roles.Role{ + ID: id1, + RoleName: "Task Invoicing Officer", + RoleType: "role1", + } + + id2, _ := uuid.NewV4() + role2 := roles.Role{ + ID: id2, + RoleName: "Task Ordering Officer", + RoleType: "role2", + } + + id3, _ := uuid.NewV4() + role3 := roles.Role{ + ID: id3, + RoleName: "Contracting Officer", + RoleType: "role3", + } + + // Create roles + rs := roles.Roles{role1, role2, role3} + err := suite.DB().Create(rs) + suite.NoError(err) + + userRoles, err := m.FindRoles(suite.DB(), "Ta") + + suite.NoError(err) + suite.Equal(2, len(userRoles), userRoles) + +} diff --git a/pkg/services/mocks/TransportationOfficesFetcher.go b/pkg/services/mocks/TransportationOfficesFetcher.go index eed32753594..e455e6e082e 100644 --- a/pkg/services/mocks/TransportationOfficesFetcher.go +++ b/pkg/services/mocks/TransportationOfficesFetcher.go @@ -106,9 +106,9 @@ func (_m *TransportationOfficesFetcher) GetTransportationOffice(appCtx appcontex return r0, r1 } -// GetTransportationOffices provides a mock function with given fields: appCtx, search, forPpm -func (_m *TransportationOfficesFetcher) GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool) (*models.TransportationOffices, error) { - ret := _m.Called(appCtx, search, forPpm) +// GetTransportationOffices provides a mock function with given fields: appCtx, search, forPpm, forAdminOfficeUserReqFilter +func (_m *TransportationOfficesFetcher) GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool, forAdminOfficeUserReqFilter bool) (*models.TransportationOffices, error) { + ret := _m.Called(appCtx, search, forPpm, forAdminOfficeUserReqFilter) if len(ret) == 0 { panic("no return value specified for GetTransportationOffices") @@ -116,19 +116,19 @@ func (_m *TransportationOfficesFetcher) GetTransportationOffices(appCtx appconte var r0 *models.TransportationOffices var r1 error - if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, bool) (*models.TransportationOffices, error)); ok { - return rf(appCtx, search, forPpm) + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, bool, bool) (*models.TransportationOffices, error)); ok { + return rf(appCtx, search, forPpm, forAdminOfficeUserReqFilter) } - if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, bool) *models.TransportationOffices); ok { - r0 = rf(appCtx, search, forPpm) + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, bool, bool) *models.TransportationOffices); ok { + r0 = rf(appCtx, search, forPpm, forAdminOfficeUserReqFilter) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*models.TransportationOffices) } } - if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, bool) error); ok { - r1 = rf(appCtx, search, forPpm) + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, bool, bool) error); ok { + r1 = rf(appCtx, search, forPpm, forAdminOfficeUserReqFilter) } else { r1 = ret.Error(1) } diff --git a/pkg/services/transportation_office.go b/pkg/services/transportation_office.go index 307f0d0fef5..f596fbbceae 100644 --- a/pkg/services/transportation_office.go +++ b/pkg/services/transportation_office.go @@ -9,7 +9,7 @@ import ( //go:generate mockery --name TransportationOfficesFetcher type TransportationOfficesFetcher interface { - GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool) (*models.TransportationOffices, error) + GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool, forAdminOfficeUserReqFilter bool) (*models.TransportationOffices, error) GetTransportationOffice(appCtx appcontext.AppContext, transportationOfficeID uuid.UUID, includeOnlyPPMCloseoutOffices bool) (*models.TransportationOffice, error) GetAllGBLOCs(appCtx appcontext.AppContext) (*models.GBLOCs, error) GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffices, error) diff --git a/pkg/services/transportation_office/transportation_office_fetcher.go b/pkg/services/transportation_office/transportation_office_fetcher.go index be942890c75..c67b7234cef 100644 --- a/pkg/services/transportation_office/transportation_office_fetcher.go +++ b/pkg/services/transportation_office/transportation_office_fetcher.go @@ -46,8 +46,8 @@ func (o transportationOfficesFetcher) GetTransportationOffice(appCtx appcontext. return &transportationOffice, nil } -func (o transportationOfficesFetcher) GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool) (*models.TransportationOffices, error) { - officeList, err := FindTransportationOffice(appCtx, search, forPpm) +func (o transportationOfficesFetcher) GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool, forAdminOfficeUserReqFilter bool) (*models.TransportationOffices, error) { + officeList, err := FindTransportationOffice(appCtx, search, forPpm, forAdminOfficeUserReqFilter) if err != nil { switch err { @@ -61,9 +61,15 @@ func (o transportationOfficesFetcher) GetTransportationOffices(appCtx appcontext return &officeList, nil } -func FindTransportationOffice(appCtx appcontext.AppContext, search string, forPpm bool) (models.TransportationOffices, error) { +func FindTransportationOffice(appCtx appcontext.AppContext, search string, forPpm bool, forAdminOfficeUserReqFilter bool) (models.TransportationOffices, error) { var officeList []models.TransportationOffice + // Changing return limit for Admin Requested Office Users Transportation Office Filter implementation + var limit = 5 + if forAdminOfficeUserReqFilter { + limit = 50 + } + // The % operator filters out strings that are below this similarity threshold err := appCtx.DB().Q().RawQuery("SET pg_trgm.similarity_threshold = 0.03").Exec() if err != nil { @@ -80,13 +86,13 @@ func FindTransportationOffice(appCtx appcontext.AppContext, search string, forPp } sqlQuery += ` order by sim desc - limit 5) + limit $2) select office.* from names n inner join transportation_offices office on n.transportation_office_id = office.id group by office.id order by max(n.sim) desc, office.name - limit 5` - query := appCtx.DB().Q().RawQuery(sqlQuery, search) + limit $2` + query := appCtx.DB().Q().RawQuery(sqlQuery, search, limit) if err := query.All(&officeList); err != nil { if errors.Cause(err).Error() != models.RecordNotFoundErrorString { return officeList, err diff --git a/pkg/services/transportation_office/transportation_office_fetcher_test.go b/pkg/services/transportation_office/transportation_office_fetcher_test.go index 9ce5bab765c..408010619c1 100644 --- a/pkg/services/transportation_office/transportation_office_fetcher_test.go +++ b/pkg/services/transportation_office/transportation_office_fetcher_test.go @@ -43,7 +43,7 @@ func (suite *TransportationOfficeServiceSuite) Test_SearchTransportationOffice() }, }, }, nil) - office, err := FindTransportationOffice(suite.AppContextForTest(), "LRC Fort Knox", true) + office, err := FindTransportationOffice(suite.AppContextForTest(), "LRC Fort Knox", true, false) suite.NoError(err) suite.Equal(transportationOffice.Name, office[0].Name) @@ -54,7 +54,7 @@ func (suite *TransportationOfficeServiceSuite) Test_SearchTransportationOffice() func (suite *TransportationOfficeServiceSuite) Test_SearchWithNoTransportationOffices() { - office, err := FindTransportationOffice(suite.AppContextForTest(), "LRC Fort Knox", true) + office, err := FindTransportationOffice(suite.AppContextForTest(), "LRC Fort Knox", true, false) suite.NoError(err) suite.Len(office, 0) } @@ -88,7 +88,7 @@ func (suite *TransportationOfficeServiceSuite) Test_SortedTransportationOffices( }, }, nil) - office, err := FindTransportationOffice(suite.AppContextForTest(), "JPPSO", true) + office, err := FindTransportationOffice(suite.AppContextForTest(), "JPPSO", true, false) suite.NoError(err) suite.Equal(transportationOffice1.Name, office[0].Name) diff --git a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx index 9aeb51ea0f9..87f901d0d07 100644 --- a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx +++ b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx @@ -1,5 +1,16 @@ -import React from 'react'; -import { Datagrid, DateField, Filter, List, ReferenceField, TextField, TextInput, TopToolbar } from 'react-admin'; +import { React } from 'react'; +import { + Datagrid, + DateField, + Filter, + List, + ReferenceField, + TextField, + TopToolbar, + ArrayField, + SingleFieldList, + SearchInput, +} from 'react-admin'; import AdminPagination from 'scenes/SystemAdmin/shared/AdminPagination'; @@ -10,7 +21,9 @@ const ListActions = () => { const RequestedOfficeUserListFilter = () => ( - + + + ); @@ -34,6 +47,11 @@ const RequestedOfficeUserList = () => ( + + + + + ); diff --git a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserShow.module.scss b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserShow.module.scss index b37e5801e46..ba0802b28c7 100644 --- a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserShow.module.scss +++ b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserShow.module.scss @@ -50,4 +50,6 @@ margin-left: 15px; margin-right: 15px; margin-bottom: 10px; -} \ No newline at end of file +} + +ul { list-style-type: none; } \ No newline at end of file From 0efebf99693707eaa20bf62921467ca851783674 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Fri, 24 Jan 2025 15:10:49 +0000 Subject: [PATCH 094/229] Use constant variables instead of strings --- .../UpdatePaymentServiceItemStatus.jsx | 5 +++-- src/pages/Office/MoveHistory/PaymentDetails.jsx | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx index 5f92c395e70..8733ec0bc30 100644 --- a/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx +++ b/src/constants/MoveHistory/EventTemplates/UpdatePaymentServiceItem/UpdatePaymentServiceItemStatus.jsx @@ -5,6 +5,7 @@ import a from 'constants/MoveHistory/Database/Actions'; import t from 'constants/MoveHistory/Database/Tables'; import { getMtoShipmentLabel } from 'utils/formatMtoShipment'; import LabeledDetails from 'pages/Office/MoveHistory/LabeledDetails'; +import { PAYMENT_SERVICE_ITEM_STATUS } from 'shared/constants'; const formatChangedValues = (historyRecord) => { const newChangedValues = { @@ -39,10 +40,10 @@ export default { historyRecord.changedValues.rejection_reason !== null && historyRecord.changedValues.status !== 'APPROVED' && historyRecord.changedValues.status !== 'REQUESTED') || - historyRecord.changedValues.status === 'REJECTED' + historyRecord.changedValues.status === PAYMENT_SERVICE_ITEM_STATUS.DENIED ) { actionPrefix = 'Rejected'; - } else if (historyRecord.changedValues.status === 'APPROVED') { + } else if (historyRecord.changedValues.status === PAYMENT_SERVICE_ITEM_STATUS.APPROVED) { actionPrefix = 'Approved'; } else { actionPrefix = 'Updated'; diff --git a/src/pages/Office/MoveHistory/PaymentDetails.jsx b/src/pages/Office/MoveHistory/PaymentDetails.jsx index 807828ec635..f1b38320d23 100644 --- a/src/pages/Office/MoveHistory/PaymentDetails.jsx +++ b/src/pages/Office/MoveHistory/PaymentDetails.jsx @@ -25,7 +25,7 @@ const filterContextStatus = (context, statusToFilter) => {
{value.name}
{price.toFixed(2)}
- {value.status === 'DENIED' ? ( + {value.status === PAYMENT_SERVICE_ITEM_STATUS.DENIED ? (
Rejection Reason: {value?.rejection_reason} From 2637f0621c9d7b6fc6d469999538fda0fa969bcb Mon Sep 17 00:00:00 2001 From: pambecker Date: Fri, 24 Jan 2025 15:49:47 +0000 Subject: [PATCH 095/229] add validation for MARINES and update tests --- pkg/gen/ghcapi/embedded_spec.go | 22 -- ...ignment_payment_request_data_parameters.go | 46 --- ...ignment_payment_request_data_urlbuilder.go | 16 - .../internal/payloads/model_to_payload.go | 2 +- pkg/handlers/ghcapi/queues.go | 43 ++- pkg/handlers/ghcapi/queues_test.go | 114 +++++++ .../payment_request_fetcher.go | 53 +-- .../payment_request_fetcher_test.go | 323 ++++++++++++++++++ swagger-def/ghc.yaml | 7 - swagger/ghc.yaml | 7 - 10 files changed, 487 insertions(+), 146 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 72b6a7ee3df..dd4c8faa283 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -4426,17 +4426,6 @@ func init() { ], "summary": "Gets data for bulk assignment payment request modal", "operationId": "getBulkAssignmentPaymentRequestData", - "parameters": [ - { - "enum": [ - "PAYMENT_REQUEST" - ], - "type": "string", - "description": "A string corresponding to the queue type", - "name": "queueType", - "in": "query" - } - ], "responses": { "200": { "description": "Successfully returned bulk assignment payment request data", @@ -21136,17 +21125,6 @@ func init() { ], "summary": "Gets data for bulk assignment payment request modal", "operationId": "getBulkAssignmentPaymentRequestData", - "parameters": [ - { - "enum": [ - "PAYMENT_REQUEST" - ], - "type": "string", - "description": "A string corresponding to the queue type", - "name": "queueType", - "in": "query" - } - ], "responses": { "200": { "description": "Successfully returned bulk assignment payment request data", diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go index fe339a332bc..f65cec0f219 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go @@ -9,10 +9,7 @@ import ( "net/http" "github.com/go-openapi/errors" - "github.com/go-openapi/runtime" "github.com/go-openapi/runtime/middleware" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" ) // NewGetBulkAssignmentPaymentRequestDataParams creates a new GetBulkAssignmentPaymentRequestDataParams object @@ -31,11 +28,6 @@ type GetBulkAssignmentPaymentRequestDataParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` - - /*A string corresponding to the queue type - In: query - */ - QueueType *string } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -47,46 +39,8 @@ func (o *GetBulkAssignmentPaymentRequestDataParams) BindRequest(r *http.Request, o.HTTPRequest = r - qs := runtime.Values(r.URL.Query()) - - qQueueType, qhkQueueType, _ := qs.GetOK("queueType") - if err := o.bindQueueType(qQueueType, qhkQueueType, route.Formats); err != nil { - res = append(res, err) - } if len(res) > 0 { return errors.CompositeValidationError(res...) } return nil } - -// bindQueueType binds and validates parameter QueueType from query. -func (o *GetBulkAssignmentPaymentRequestDataParams) bindQueueType(rawData []string, hasKey bool, formats strfmt.Registry) error { - var raw string - if len(rawData) > 0 { - raw = rawData[len(rawData)-1] - } - - // Required: false - // AllowEmptyValue: false - - if raw == "" { // empty values pass all other validations - return nil - } - o.QueueType = &raw - - if err := o.validateQueueType(formats); err != nil { - return err - } - - return nil -} - -// validateQueueType carries on validations for parameter QueueType -func (o *GetBulkAssignmentPaymentRequestDataParams) validateQueueType(formats strfmt.Registry) error { - - if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"PAYMENT_REQUEST"}, true); err != nil { - return err - } - - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go index 3af039adfb1..fe282c8e97f 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go @@ -13,11 +13,7 @@ import ( // GetBulkAssignmentPaymentRequestDataURL generates an URL for the get bulk assignment payment request data operation type GetBulkAssignmentPaymentRequestDataURL struct { - QueueType *string - _basePath string - // avoid unkeyed usage - _ struct{} } // WithBasePath sets the base path for this url builder, only required when it's different from the @@ -47,18 +43,6 @@ func (o *GetBulkAssignmentPaymentRequestDataURL) Build() (*url.URL, error) { } _result.Path = golangswaggerpaths.Join(_basePath, _path) - qs := make(url.Values) - - var queueTypeQ string - if o.QueueType != nil { - queueTypeQ = *o.QueueType - } - if queueTypeQ != "" { - qs.Set("queueType", queueTypeQ) - } - - _result.RawQuery = qs.Encode() - return &_result, nil } diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 6a105784379..febd8495c75 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2188,7 +2188,7 @@ func BulkAssignmentData(appCtx appcontext.AppContext, moves []models.MoveWithEar return *bulkAssignmentData } -func BulkAssignmentPaymentRequestData(appCtx appcontext.AppContext, paymentRequests []models.PaymentRequestWithEarliestRequestedDate, officeUsers []models.OfficeUserWithWorkload, officeId uuid.UUID) ghcmessages.BulkAssignmentPaymentRequestData { +func BulkAssignmentPaymentRequestData(appCtx appcontext.AppContext, paymentRequests []models.PaymentRequestWithEarliestRequestedDate, officeUsers []models.OfficeUserWithWorkload) ghcmessages.BulkAssignmentPaymentRequestData { availableOfficeUsers := make(ghcmessages.AvailableOfficeUsers, len(officeUsers)) availablePaymentRequests := make(ghcmessages.BulkAssignmentPaymentRequestIDs, len(paymentRequests)) diff --git a/pkg/handlers/ghcapi/queues.go b/pkg/handlers/ghcapi/queues.go index 65b510f0972..2117a07e0d8 100644 --- a/pkg/handlers/ghcapi/queues.go +++ b/pkg/handlers/ghcapi/queues.go @@ -674,32 +674,27 @@ func (h GetPaymentRequestBulkAssignmentDataHandler) Handle( return queues.NewGetBulkAssignmentPaymentRequestDataUnauthorized(), err } - queueType := params.QueueType - var officeUserData ghcmessages.BulkAssignmentPaymentRequestData + // fetch the TIOs who work at their office + officeUsers, err := h.OfficeUserFetcherPop.FetchOfficeUsersWithWorkloadByRoleAndOffice( + appCtx, + roles.RoleTypeTIO, + officeUser.TransportationOfficeID, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving TIO office users", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err + } + // fetch the payment requests available to be assigned to their office users + paymentRequests, err := h.PaymentRequestFetcherBulkAssignment.FetchPaymentRequestsForBulkAssignment( + appCtx, officeUser.TransportationOffice.Gbloc, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving payment requests", zap.Error(err)) + return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err + } - switch *queueType { - case string(models.QueueTypePaymentRequest): - // fetch the TIOs who work at their office - officeUsers, err := h.OfficeUserFetcherPop.FetchOfficeUsersWithWorkloadByRoleAndOffice( - appCtx, - roles.RoleTypeTIO, - officeUser.TransportationOfficeID, - ) - if err != nil { - appCtx.Logger().Error("Error retreiving TIO office users", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err - } - // fetch the payment requests available to be assigned to their office users - paymentRequests, err := h.PaymentRequestFetcherBulkAssignment.FetchPaymentRequestsForBulkAssignment( - appCtx, officeUser.TransportationOffice.Gbloc, - ) - if err != nil { - appCtx.Logger().Error("Error retreiving payment requests", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err - } + officeUserData := payloads.BulkAssignmentPaymentRequestData(appCtx, paymentRequests, officeUsers) - officeUserData = payloads.BulkAssignmentPaymentRequestData(appCtx, paymentRequests, officeUsers, officeUser.TransportationOffice.ID) - } return queues.NewGetBulkAssignmentPaymentRequestDataOK().WithPayload(&officeUserData), nil }) } diff --git a/pkg/handlers/ghcapi/queues_test.go b/pkg/handlers/ghcapi/queues_test.go index e36de8d3226..f497e9e8c17 100644 --- a/pkg/handlers/ghcapi/queues_test.go +++ b/pkg/handlers/ghcapi/queues_test.go @@ -1809,3 +1809,117 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { suite.Len(payload.BulkAssignmentMoveIDs, 1) }) } + +func (suite *HandlerSuite) TestGetPaymentRequestBulkAssignmentDataHandler() { + suite.Run("TIO - bulk assign payment request - returns an unauthorized error when an attempt is made by a non supervisor", func() { + officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + Email: "officeuser1@example.com", + }, + }, + { + Model: models.User{ + Roles: []roles.Role{ + { + RoleType: roles.RoleTypeTIO, + }, + }, + }, + }, + }, nil) + + request := httptest.NewRequest("GET", "/queues/bulk-assignment-payment-requests", nil) + request = suite.AuthenticateOfficeRequest(request, officeUser) + params := queues.GetBulkAssignmentPaymentRequestDataParams{ + HTTPRequest: request, + } + handlerConfig := suite.HandlerConfig() + handler := GetPaymentRequestBulkAssignmentDataHandler{ + handlerConfig, + officeusercreator.NewOfficeUserFetcherPop(), + paymentrequest.NewPaymentRequestFetcherBulkAssignment(), + } + response := handler.Handle(params) + suite.IsNotErrResponse(response) + suite.IsType(&queues.GetBulkAssignmentPaymentRequestDataUnauthorized{}, response) + }) + suite.Run("TIO - payment request - returns properly formatted bulk assignment data", func() { + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + Email: "officeuser1@example.com", + Active: true, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.User{ + Privileges: []models.Privilege{ + { + PrivilegeType: models.PrivilegeTypeSupervisor, + }, + }, + Roles: []roles.Role{ + { + RoleType: roles.RoleTypeTIO, + }, + }, + }, + }, + }, nil) + + // payment request to appear in the return + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + request := httptest.NewRequest("GET", "/queues/bulk-assignment-payment-requests", nil) + request = suite.AuthenticateOfficeRequest(request, officeUser) + params := queues.GetBulkAssignmentPaymentRequestDataParams{ + HTTPRequest: request, + } + handlerConfig := suite.HandlerConfig() + handler := GetPaymentRequestBulkAssignmentDataHandler{ + handlerConfig, + officeusercreator.NewOfficeUserFetcherPop(), + paymentrequest.NewPaymentRequestFetcherBulkAssignment(), + } + response := handler.Handle(params) + suite.IsNotErrResponse(response) + suite.IsType(&queues.GetBulkAssignmentPaymentRequestDataOK{}, response) + payload := response.(*queues.GetBulkAssignmentPaymentRequestDataOK).Payload + suite.NoError(payload.Validate(strfmt.Default)) + suite.Len(payload.AvailableOfficeUsers, 1) + suite.Len(payload.BulkAssignmentPaymentRequestIDs, 1) + }) +} diff --git a/pkg/services/payment_request/payment_request_fetcher.go b/pkg/services/payment_request/payment_request_fetcher.go index a68f09f0c38..fe742f3a860 100644 --- a/pkg/services/payment_request/payment_request_fetcher.go +++ b/pkg/services/payment_request/payment_request_fetcher.go @@ -72,29 +72,36 @@ func NewPaymentRequestFetcherBulkAssignment() services.PaymentRequestFetcherBulk func (f paymentRequestFetcherBulkAssignment) FetchPaymentRequestsForBulkAssignment(appCtx appcontext.AppContext, gbloc string) ([]models.PaymentRequestWithEarliestRequestedDate, error) { var payment_requests []models.PaymentRequestWithEarliestRequestedDate - err := appCtx.DB(). - RawQuery(`SELECT - payment_requests.id, - payment_requests.requested_at - FROM payment_requests - INNER JOIN moves on moves.id = payment_requests.move_id - INNER JOIN orders ON orders.id = moves.orders_id - INNER JOIN service_members ON orders.service_member_id = service_members.id - LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id - WHERE - payment_requests.status = 'PENDING' - AND moves.show = $1 - AND (orders.orders_type NOT IN ($2, $3, $4)) - AND moves.tio_assigned_id IS NULL - AND service_members.affiliation != 'MARINES' - AND move_to_gbloc.gbloc = $5 - GROUP BY payment_requests.id - ORDER BY payment_requests.requested_at ASC`, - models.BoolPointer(true), - internalmessages.OrdersTypeBLUEBARK, - internalmessages.OrdersTypeWOUNDEDWARRIOR, - internalmessages.OrdersTypeSAFETY, - gbloc). + sqlQuery := ` + SELECT + payment_requests.id, + payment_requests.requested_at + FROM payment_requests + INNER JOIN moves on moves.id = payment_requests.move_id + INNER JOIN orders ON orders.id = moves.orders_id + INNER JOIN service_members ON orders.service_member_id = service_members.id + LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id + WHERE payment_requests.status = 'PENDING' + AND moves.show = $1 + AND (orders.orders_type NOT IN ($2, $3, $4)) + AND moves.tio_assigned_id IS NULL ` + if gbloc == "USMC" { + sqlQuery += ` + AND service_members.affiliation ILIKE 'MARINES' ` + } else { + sqlQuery += ` + AND service_members.affiliation != 'MARINES' + AND move_to_gbloc.gbloc = '` + gbloc + `' ` + } + sqlQuery += ` + GROUP BY payment_requests.id + ORDER BY payment_requests.requested_at ASC` + + err := appCtx.DB().RawQuery(sqlQuery, + models.BoolPointer(true), + internalmessages.OrdersTypeBLUEBARK, + internalmessages.OrdersTypeWOUNDEDWARRIOR, + internalmessages.OrdersTypeSAFETY). All(&payment_requests) if err != nil { diff --git a/pkg/services/payment_request/payment_request_fetcher_test.go b/pkg/services/payment_request/payment_request_fetcher_test.go index ab05924690f..33a48aebf9f 100644 --- a/pkg/services/payment_request/payment_request_fetcher_test.go +++ b/pkg/services/payment_request/payment_request_fetcher_test.go @@ -5,7 +5,10 @@ import ( "github.com/transcom/mymove/pkg/apperror" "github.com/transcom/mymove/pkg/factory" + "github.com/transcom/mymove/pkg/gen/internalmessages" "github.com/transcom/mymove/pkg/models" + "github.com/transcom/mymove/pkg/models/roles" + "github.com/transcom/mymove/pkg/services" ) func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequest() { @@ -65,3 +68,323 @@ func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequest() { suite.Equal(models.PaymentRequest{}, paymentRequest) }) } + +func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequestsForBulkAssignment() { + setupTestData := func() (services.PaymentRequestFetcherBulkAssignment, models.TransportationOffice) { + paymentRequestFetcher := NewPaymentRequestFetcherBulkAssignment() + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + // this move has a transportation office associated with it that matches + // the TIO's transportation office and should be found + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + move2 := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move2, + LinkOnly: true, + }, + }, nil) + + return paymentRequestFetcher, transportationOffice + } + + suite.Run("TIO: Returns payment requests that fulfill the query criteria", func() { + paymentRequestFetcher, _ := setupTestData() + paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") + suite.FatalNoError(err) + suite.Equal(2, len(paymentRequests)) + }) + + suite.Run("Does not return moves that are already assigned", func() { + paymentRequestFetcher := NewPaymentRequestFetcherBulkAssignment() + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, []roles.RoleType{roles.RoleTypeTIO}) + + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: officeUser, + LinkOnly: true, + Type: &factory.OfficeUsers.TIOAssignedUser, + }, + }, nil) + assignedPaymentRequest := factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") + suite.FatalNoError(err) + + // confirm that the assigned move isn't returned + for _, paymentRequest := range paymentRequests { + suite.NotEqual(paymentRequest.ID, assignedPaymentRequest.ID) + } + + // confirm that the rest of the details are correct + // move is APPROVALS REQUESTED STATUS + suite.Equal(assignedPaymentRequest.Status, models.PaymentRequestStatusPending) + // GBLOC is the same + suite.Equal(*move.Orders.OriginDutyLocationGBLOC, officeUser.TransportationOffice.Gbloc) + // Show is true + suite.Equal(move.Show, models.BoolPointer(true)) + // Orders type isn't WW, BB, or Safety + suite.Equal(move.Orders.OrdersType, internalmessages.OrdersTypePERMANENTCHANGEOFSTATION) + }) + + suite.Run("TIO: Does not return payment requests with safety, bluebark, or wounded warrior order types", func() { + paymentRequestFetcher, transportationOffice := setupTestData() + moveSafety := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeSAFETY, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveSafety, + LinkOnly: true, + }, + }, nil) + + moveBB := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeBLUEBARK, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveBB, + LinkOnly: true, + }, + }, nil) + + moveWW := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeWOUNDEDWARRIOR, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveWW, + LinkOnly: true, + }, + }, nil) + + paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") + suite.FatalNoError(err) + suite.Equal(2, len(paymentRequests)) + }) + + suite.Run("TIO: Does not return payment requests with Marines if GBLOC not USMC", func() { + paymentRequestFetcher, transportationOffice := setupTestData() + + marine := models.AffiliationMARINES + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.ServiceMember{ + Affiliation: &marine, + }, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") + suite.FatalNoError(err) + suite.Equal(2, len(paymentRequests)) + }) + + suite.Run("TIO: Only return payment requests with Marines if GBLOC is USMC", func() { + paymentRequestFetcher, transportationOffice := setupTestData() + + marine := models.AffiliationMARINES + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.ServiceMember{ + Affiliation: &marine, + }, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "USMC") + suite.FatalNoError(err) + suite.Equal(1, len(paymentRequests)) + }) +} diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 80bb313fa2b..8036745e8e8 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3554,13 +3554,6 @@ paths: operationId: getBulkAssignmentPaymentRequestData tags: - queues - parameters: - - in: query - name: queueType - type: string - description: A string corresponding to the queue type - enum: - - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment payment request data diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 1ecaa1e5e96..04f9619d407 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3692,13 +3692,6 @@ paths: operationId: getBulkAssignmentPaymentRequestData tags: - queues - parameters: - - in: query - name: queueType - type: string - description: A string corresponding to the queue type - enum: - - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment payment request data From 696bf7e7d5b0df340ee16927c79572b3bc59a489 Mon Sep 17 00:00:00 2001 From: pambecker Date: Fri, 24 Jan 2025 19:13:11 +0000 Subject: [PATCH 096/229] cleanup logic --- pkg/services/move/move_fetcher.go | 74 +++++---- pkg/services/move/move_fetcher_test.go | 156 +++++++++++++++++- .../payment_request_fetcher.go | 6 +- .../payment_request_fetcher_test.go | 2 +- 4 files changed, 200 insertions(+), 38 deletions(-) diff --git a/pkg/services/move/move_fetcher.go b/pkg/services/move/move_fetcher.go index f7e0970c656..4d8b922f678 100644 --- a/pkg/services/move/move_fetcher.go +++ b/pkg/services/move/move_fetcher.go @@ -135,7 +135,8 @@ func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentCounseling(appCtx INNER JOIN mto_shipments ON mto_shipments.move_id = moves.id LEFT JOIN ppm_shipments ON ppm_shipments.shipment_id = mto_shipments.id WHERE - moves.status = 'NEEDS SERVICE COUNSELING' + mto_shipments.deleted_at IS NULL + AND moves.status = 'NEEDS SERVICE COUNSELING' AND orders.gbloc = $1 AND moves.show = $2 AND moves.sc_assigned_id IS NULL @@ -169,37 +170,46 @@ func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentCounseling(appCtx func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentTaskOrder(appCtx appcontext.AppContext, gbloc string, officeId uuid.UUID) ([]models.MoveWithEarliestDate, error) { var moves []models.MoveWithEarliestDate - err := appCtx.DB(). - RawQuery(`SELECT - moves.id, - MIN(LEAST( - COALESCE(mto_shipments.requested_pickup_date, '9999-12-31'), - COALESCE(mto_shipments.requested_delivery_date, '9999-12-31'), - COALESCE(ppm_shipments.expected_departure_date, '9999-12-31') - )) AS earliest_date - FROM moves - INNER JOIN orders ON orders.id = moves.orders_id - INNER JOIN service_members ON orders.service_member_id = service_members.id - INNER JOIN mto_shipments ON mto_shipments.move_id = moves.id - LEFT JOIN ppm_shipments ON ppm_shipments.shipment_id = mto_shipments.id - LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id - WHERE - (moves.status IN ('APPROVALS REQUESTED', 'SUBMITTED', 'SERVICE COUNSELING COMPLETED')) - AND moves.show = $1 - AND moves.too_assigned_id IS NULL - AND (orders.orders_type NOT IN ($2, $3, $4)) - AND service_members.affiliation != 'MARINES' - AND ((mto_shipments.shipment_type != $5 AND move_to_gbloc.gbloc = $6) OR (mto_shipments.shipment_type = $7 AND orders.gbloc = $8)) - GROUP BY moves.id - ORDER BY earliest_date ASC`, - models.BoolPointer(true), - internalmessages.OrdersTypeBLUEBARK, - internalmessages.OrdersTypeWOUNDEDWARRIOR, - internalmessages.OrdersTypeSAFETY, - models.MTOShipmentTypeHHGOutOfNTS, - gbloc, - models.MTOShipmentTypeHHGOutOfNTS, - gbloc). + sqlQuery := ` + SELECT + moves.id, + MIN(LEAST( + COALESCE(mto_shipments.requested_pickup_date, '9999-12-31'), + COALESCE(mto_shipments.requested_delivery_date, '9999-12-31'), + COALESCE(ppm_shipments.expected_departure_date, '9999-12-31') + )) AS earliest_date + FROM moves + INNER JOIN orders ON orders.id = moves.orders_id + INNER JOIN service_members ON orders.service_member_id = service_members.id + INNER JOIN mto_shipments ON mto_shipments.move_id = moves.id + INNER JOIN duty_locations as origin_dl ON orders.origin_duty_location_id = origin_dl.id + LEFT JOIN ppm_shipments ON ppm_shipments.shipment_id = mto_shipments.id + LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id + WHERE + mto_shipments.deleted_at IS NULL + AND (moves.status IN ('APPROVALS REQUESTED', 'SUBMITTED', 'SERVICE COUNSELING COMPLETED')) + AND moves.show = $1 + AND moves.too_assigned_id IS NULL + AND (orders.orders_type NOT IN ($2, $3, $4)) + AND (moves.ppm_type IS NULL OR (moves.ppm_type = 'PARTIAL' or (moves.ppm_type = 'FULL' and origin_dl.provides_services_counseling = 'false'))) ` + if gbloc == "USMC" { + sqlQuery += ` + AND service_members.affiliation ILIKE 'MARINES' ` + } else { + sqlQuery += ` + AND service_members.affiliation != 'MARINES' + AND ((mto_shipments.shipment_type != 'HHG_OUTOF_NTS' AND move_to_gbloc.gbloc = '` + gbloc + `') + OR (mto_shipments.shipment_type = 'HHG_OUTOF_NTS' AND orders.gbloc = '` + gbloc + `')) ` + } + sqlQuery += ` + GROUP BY moves.id + ORDER BY earliest_date ASC` + + err := appCtx.DB().RawQuery(sqlQuery, + models.BoolPointer(true), + internalmessages.OrdersTypeBLUEBARK, + internalmessages.OrdersTypeWOUNDEDWARRIOR, + internalmessages.OrdersTypeSAFETY). All(&moves) if err != nil { diff --git a/pkg/services/move/move_fetcher_test.go b/pkg/services/move/move_fetcher_test.go index 92fb23751bb..a12b4d8a941 100644 --- a/pkg/services/move/move_fetcher_test.go +++ b/pkg/services/move/move_fetcher_test.go @@ -105,7 +105,7 @@ func (suite *MoveServiceSuite) TestMoveFetcher() { }) } -func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignment() { +func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentSC() { setupTestData := func() (services.MoveFetcherBulkAssignment, models.Move, models.TransportationOffice, models.OfficeUser) { moveFetcher := NewMoveFetcherBulkAssignment() transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) @@ -433,10 +433,13 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignment() { // Orders type isn't WW, BB, or Safety suite.Equal(assignedMove.Orders.OrdersType, internalmessages.OrdersTypePERMANENTCHANGEOFSTATION) }) +} - suite.Run("TOO: Returns moves that fulfill the query criteria", func() { +func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentTOO() { + setupTestData := func() (services.MoveFetcherBulkAssignment, models.TransportationOffice, models.OfficeUser) { moveFetcher := NewMoveFetcherBulkAssignment() transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ { Model: transportationOffice, @@ -471,6 +474,127 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignment() { }, }, nil) + return moveFetcher, transportationOffice, officeUser + } + + suite.Run("TOO: Returns moves that fulfill the query's criteria", func() { + moveFetcher, _, officeUser := setupTestData() + moves, err := moveFetcher.FetchMovesForBulkAssignmentTaskOrder(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(2, len(moves)) + }) + + suite.Run("TOO: Does not return moves with safety, bluebark, or wounded warrior order types", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeSAFETY, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeBLUEBARK, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeWOUNDEDWARRIOR, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentTaskOrder(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(2, len(moves)) + }) + + suite.Run("TOO: Does not return moves that are already assigned", func() { + moveFetcher := NewMoveFetcherBulkAssignment() + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, []roles.RoleType{roles.RoleTypeTOO}) + + assignedMove := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusNeedsServiceCounseling, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: officeUser, + LinkOnly: true, + Type: &factory.OfficeUsers.TOOAssignedUser, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentTaskOrder(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + + // confirm that the assigned move isn't returned + for _, move := range moves { + suite.NotEqual(move.ID, assignedMove.ID) + } + + // confirm that the rest of the details are correct + // move is SERVICE COUNSELING COMPLETED + suite.Equal(assignedMove.Status, models.MoveStatusServiceCounselingCompleted) + // GBLOC is the same + suite.Equal(*assignedMove.Orders.OriginDutyLocationGBLOC, officeUser.TransportationOffice.Gbloc) + // Show is true + suite.Equal(assignedMove.Show, models.BoolPointer(true)) + // Orders type isn't WW, BB, or Safety + suite.Equal(assignedMove.Orders.OrdersType, internalmessages.OrdersTypePERMANENTCHANGEOFSTATION) + }) + + suite.Run("TOO: Does not return payment requests with Marines if GBLOC not USMC", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + marine := models.AffiliationMARINES factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ { @@ -494,4 +618,32 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignment() { suite.FatalNoError(err) suite.Equal(2, len(moves)) }) + + suite.Run("TOO: Only return payment requests with Marines if GBLOC is USMC", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + + marine := models.AffiliationMARINES + factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.ServiceMember{ + Affiliation: &marine, + }, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentTaskOrder(suite.AppContextForTest(), "USMC", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(1, len(moves)) + }) + } diff --git a/pkg/services/payment_request/payment_request_fetcher.go b/pkg/services/payment_request/payment_request_fetcher.go index fe742f3a860..78c5c311baf 100644 --- a/pkg/services/payment_request/payment_request_fetcher.go +++ b/pkg/services/payment_request/payment_request_fetcher.go @@ -77,9 +77,9 @@ func (f paymentRequestFetcherBulkAssignment) FetchPaymentRequestsForBulkAssignme payment_requests.id, payment_requests.requested_at FROM payment_requests - INNER JOIN moves on moves.id = payment_requests.move_id - INNER JOIN orders ON orders.id = moves.orders_id - INNER JOIN service_members ON orders.service_member_id = service_members.id + INNER JOIN moves on moves.id = payment_requests.move_id + INNER JOIN orders ON orders.id = moves.orders_id + INNER JOIN service_members ON orders.service_member_id = service_members.id LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id WHERE payment_requests.status = 'PENDING' AND moves.show = $1 diff --git a/pkg/services/payment_request/payment_request_fetcher_test.go b/pkg/services/payment_request/payment_request_fetcher_test.go index 33a48aebf9f..fcb30090d86 100644 --- a/pkg/services/payment_request/payment_request_fetcher_test.go +++ b/pkg/services/payment_request/payment_request_fetcher_test.go @@ -313,7 +313,7 @@ func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequestsForBulkAssignme move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ { Model: models.Move{ - Status: models.MoveStatusServiceCounselingCompleted, + Status: models.MoveStatusAPPROVALSREQUESTED, }, }, { From b31bad5ffd3efee2f7956b04393bb5bef384f059 Mon Sep 17 00:00:00 2001 From: pambecker Date: Fri, 24 Jan 2025 20:21:54 +0000 Subject: [PATCH 097/229] fix test --- pkg/services/move/move_fetcher_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/move/move_fetcher_test.go b/pkg/services/move/move_fetcher_test.go index a12b4d8a941..8936aa35c77 100644 --- a/pkg/services/move/move_fetcher_test.go +++ b/pkg/services/move/move_fetcher_test.go @@ -558,7 +558,7 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentTOO() { assignedMove := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ { Model: models.Move{ - Status: models.MoveStatusNeedsServiceCounseling, + Status: models.MoveStatusServiceCounselingCompleted, }, }, { From e25ba35b3a1bceb16f437d291ba2f17894d317b0 Mon Sep 17 00:00:00 2001 From: msaki-caci Date: Fri, 24 Jan 2025 20:30:43 +0000 Subject: [PATCH 098/229] MAIN-B-21659 Add UB to ShipmentFormRemarks --- .../Office/ShipmentFormRemarks/ShipmentFormRemarks.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Office/ShipmentFormRemarks/ShipmentFormRemarks.jsx b/src/components/Office/ShipmentFormRemarks/ShipmentFormRemarks.jsx index 2ede143fb6b..20808b6be56 100644 --- a/src/components/Office/ShipmentFormRemarks/ShipmentFormRemarks.jsx +++ b/src/components/Office/ShipmentFormRemarks/ShipmentFormRemarks.jsx @@ -72,6 +72,7 @@ ShipmentFormRemarks.propTypes = { SHIPMENT_OPTIONS.BOAT, SHIPMENT_TYPES.BOAT_HAUL_AWAY, SHIPMENT_TYPES.BOAT_TOW_AWAY, + SHIPMENT_OPTIONS.UNACCOMPANIED_BAGGAGE, ]).isRequired, customerRemarks: PropTypes.string, counselorRemarks: PropTypes.string, From debf6722f414e2126a59c0c7e245b2f504490b6d Mon Sep 17 00:00:00 2001 From: deandreJones Date: Fri, 24 Jan 2025 21:54:06 +0000 Subject: [PATCH 099/229] merge 21934 --- migrations/app/migrations_manifest.txt | 2 -- ...0106153750_admin_weight_restriction.up.sql | 2 -- ...min_weight_restriction_convert_bool.up.sql | 4 --- pkg/gen/ghcapi/embedded_spec.go | 28 ------------------- .../counseling_update_allowance_payload.go | 3 -- pkg/gen/ghcmessages/entitlements.go | 4 --- .../ghcmessages/update_allowance_payload.go | 3 -- pkg/gen/primeapi/embedded_spec.go | 8 ------ pkg/gen/primemessages/entitlements.go | 4 --- pkg/gen/primev2api/embedded_spec.go | 8 ------ pkg/gen/primev2messages/entitlements.go | 4 --- pkg/gen/primev3api/embedded_spec.go | 8 ------ pkg/gen/primev3messages/entitlements.go | 4 --- pkg/gen/supportapi/embedded_spec.go | 8 ------ pkg/gen/supportmessages/entitlement.go | 4 --- .../internal/payloads/model_to_payload.go | 8 ++---- .../payloads/model_to_payload_test.go | 3 ++ pkg/handlers/ghcapi/orders_test.go | 1 - .../primeapi/payloads/model_to_payload.go | 1 - .../payloads/model_to_payload_test.go | 2 ++ .../primeapiv2/payloads/model_to_payload.go | 14 ++++++---- .../payloads/model_to_payload_test.go | 2 ++ .../primeapiv3/payloads/model_to_payload.go | 13 ++++++--- .../payloads/model_to_payload_test.go | 2 ++ pkg/models/ghc_entitlements.go | 1 - pkg/notifications/move_approved.go | 26 ++++++++--------- pkg/services/order/order_updater.go | 8 ------ pkg/services/order/order_updater_test.go | 13 ++------- .../AllowancesDetailForm.jsx | 7 ++--- .../Office/DefinitionLists/AllowancesList.jsx | 7 +++-- .../DefinitionLists/AllowancesList.test.jsx | 6 ++++ .../Office/MoveAllowances/MoveAllowances.jsx | 5 +--- src/pages/Office/MoveDetails/MoveDetails.jsx | 1 - .../ServicesCounselingMoveAllowances.jsx | 5 +--- .../ServicesCounselingMoveDetails.jsx | 1 - .../definitions/prime/Entitlements.yaml | 3 -- swagger-def/ghc.yaml | 11 -------- swagger-def/support.yaml | 3 -- swagger/ghc.yaml | 15 ---------- swagger/prime.yaml | 3 -- swagger/prime_v2.yaml | 3 -- swagger/prime_v3.yaml | 3 -- swagger/support.yaml | 3 -- 43 files changed, 60 insertions(+), 204 deletions(-) delete mode 100644 migrations/app/schema/20250106153750_admin_weight_restriction.up.sql delete mode 100644 migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index 71123dd5ad9..cdcffa92e7b 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1070,8 +1070,6 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql -20250106153750_admin_weight_restriction.up.sql -20250106190758_admin_weight_restriction_convert_bool.up.sql 20250107184554_add_weight_restriction.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110214012_homesafeconnect_cert.up.sql diff --git a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql b/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql deleted file mode 100644 index d5f248d8237..00000000000 --- a/migrations/app/schema/20250106153750_admin_weight_restriction.up.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE entitlements -ADD COLUMN IF NOT EXISTS admin_restricted_weight_location BOOLEAN; diff --git a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql b/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql deleted file mode 100644 index f8f923c0ae7..00000000000 --- a/migrations/app/schema/20250106190758_admin_weight_restriction_convert_bool.up.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE entitlements - ALTER COLUMN admin_restricted_weight_location TYPE boolean USING (COALESCE(admin_restricted_weight_location, false)), - ALTER COLUMN admin_restricted_weight_location SET DEFAULT false, - ALTER COLUMN admin_restricted_weight_location SET NOT NULL; \ No newline at end of file diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index a07887043cc..899c86f9274 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6999,11 +6999,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -8191,10 +8186,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -14083,11 +14074,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -24067,11 +24053,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, @@ -25263,10 +25244,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -31283,11 +31260,6 @@ func init() { "x-nullable": true, "example": true }, - "adminRestrictedWeightLocation": { - "description": "Indicates if the customer is restricted to a specific location for their admin restricted weight.", - "type": "boolean", - "x-nullable": true - }, "agency": { "$ref": "#/definitions/Affiliation" }, diff --git a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go index 19ef562126b..805a206b000 100644 --- a/pkg/gen/ghcmessages/counseling_update_allowance_payload.go +++ b/pkg/gen/ghcmessages/counseling_update_allowance_payload.go @@ -23,9 +23,6 @@ type CounselingUpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // Indicates if the customer is restricted to a specific location for their admin restricted weight. - AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` - // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/ghcmessages/entitlements.go b/pkg/gen/ghcmessages/entitlements.go index 6c8ccba8ac9..e856534cc33 100644 --- a/pkg/gen/ghcmessages/entitlements.go +++ b/pkg/gen/ghcmessages/entitlements.go @@ -23,10 +23,6 @@ type Entitlements struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/ghcmessages/update_allowance_payload.go b/pkg/gen/ghcmessages/update_allowance_payload.go index 7827dd166a8..c0aa957934a 100644 --- a/pkg/gen/ghcmessages/update_allowance_payload.go +++ b/pkg/gen/ghcmessages/update_allowance_payload.go @@ -23,9 +23,6 @@ type UpdateAllowancePayload struct { // Example: true AccompaniedTour *bool `json:"accompaniedTour,omitempty"` - // Indicates if the customer is restricted to a specific location for their admin restricted weight. - AdminRestrictedWeightLocation *bool `json:"adminRestrictedWeightLocation,omitempty"` - // agency Agency *Affiliation `json:"agency,omitempty"` diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index 0d49f7de7ad..db02db6e057 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -1735,10 +1735,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -6694,10 +6690,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primemessages/entitlements.go b/pkg/gen/primemessages/entitlements.go index c34f9074441..65870bfa8e6 100644 --- a/pkg/gen/primemessages/entitlements.go +++ b/pkg/gen/primemessages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 875a19b3b00..4d8e6fe6aa9 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -971,10 +971,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -4617,10 +4613,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev2messages/entitlements.go b/pkg/gen/primev2messages/entitlements.go index 8cf36f2525e..58280696ab1 100644 --- a/pkg/gen/primev2messages/entitlements.go +++ b/pkg/gen/primev2messages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index 9ff0927a459..391eb94ffea 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1133,10 +1133,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -5489,10 +5485,6 @@ func init() { "Entitlements": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/primev3messages/entitlements.go b/pkg/gen/primev3messages/entitlements.go index 3e19bc830ef..2ef73ccfbf5 100644 --- a/pkg/gen/primev3messages/entitlements.go +++ b/pkg/gen/primev3messages/entitlements.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlements type Entitlements struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index 0b50f60c92a..a742b5fdc95 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1110,10 +1110,6 @@ func init() { "Entitlement": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", @@ -3986,10 +3982,6 @@ func init() { "Entitlement": { "type": "object", "properties": { - "adminRestrictedWeightLocation": { - "type": "boolean", - "example": false - }, "authorizedWeight": { "type": "integer", "x-formatting": "weight", diff --git a/pkg/gen/supportmessages/entitlement.go b/pkg/gen/supportmessages/entitlement.go index 25fcd62293e..f1fd0f5f8c9 100644 --- a/pkg/gen/supportmessages/entitlement.go +++ b/pkg/gen/supportmessages/entitlement.go @@ -19,10 +19,6 @@ import ( // swagger:model Entitlement type Entitlement struct { - // admin restricted weight location - // Example: false - AdminRestrictedWeightLocation bool `json:"adminRestrictedWeightLocation,omitempty"` - // authorized weight // Example: 2000 AuthorizedWeight *int64 `json:"authorizedWeight,omitempty"` diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 0de14bba6ab..7cfe9108a96 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -716,7 +716,6 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { } requiredMedicalEquipmentWeight := int64(entitlement.RequiredMedicalEquipmentWeight) gunSafe := entitlement.GunSafe - adminRestrictedWeightLocation := entitlement.AdminRestrictedWeightLocation var accompaniedTour *bool if entitlement.AccompaniedTour != nil { accompaniedTour = models.BoolPointer(*entitlement.AccompaniedTour) @@ -755,10 +754,9 @@ func Entitlement(entitlement *models.Entitlement) *ghcmessages.Entitlements { AccompaniedTour: accompaniedTour, UnaccompaniedBaggageAllowance: ubAllowance, OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - GunSafe: gunSafe, - AdminRestrictedWeightLocation: adminRestrictedWeightLocation, - WeightRestriction: weightRestriction, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + GunSafe: gunSafe, + WeightRestriction: weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } // DutyLocation payload diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index 7e201ca5212..16641b76a6b 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -641,6 +641,7 @@ func (suite *PayloadsSuite) TestEntitlement() { dependentsTwelveAndOver := 1 authorizedWeight := 8000 ubAllowance := 300 + weightRestriction := 1000 entitlement := &models.Entitlement{ ID: entitlementID, @@ -658,6 +659,7 @@ func (suite *PayloadsSuite) TestEntitlement() { DependentsTwelveAndOver: &dependentsTwelveAndOver, UpdatedAt: time.Now(), UBAllowance: &ubAllowance, + WeightRestriction: &weightRestriction, } returnedEntitlement := Entitlement(entitlement) @@ -679,6 +681,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(models.BoolPointer(accompaniedTour), returnedEntitlement.AccompaniedTour) suite.Equal(dependentsUnderTwelve, int(*returnedEntitlement.DependentsUnderTwelve)) suite.Equal(dependentsTwelveAndOver, int(*returnedEntitlement.DependentsTwelveAndOver)) + suite.Equal(weightRestriction, int(*returnedEntitlement.WeightRestriction)) } func (suite *PayloadsSuite) TestCreateCustomer() { diff --git a/pkg/handlers/ghcapi/orders_test.go b/pkg/handlers/ghcapi/orders_test.go index d0cc3a2cc5e..e84d02e2e1c 100644 --- a/pkg/handlers/ghcapi/orders_test.go +++ b/pkg/handlers/ghcapi/orders_test.go @@ -1480,7 +1480,6 @@ func (suite *HandlerSuite) TestCounselingUpdateAllowanceHandler() { ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, StorageInTransit: models.Int64Pointer(80), - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 945af140137..9f7037617f6 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -249,7 +249,6 @@ func Entitlement(entitlement *models.Entitlement) *primemessages.Entitlements { UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go index a643a414699..6914cb1a46e 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go @@ -338,6 +338,7 @@ func (suite *PayloadsSuite) TestEntitlement() { ProGearWeightSpouse: 750, CreatedAt: time.Now(), UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } // TotalWeight needs to read from the internal weightAllotment, in this case 7000 lbs w/o dependents and @@ -360,6 +361,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(true, payload.OrganizationalClothingAndIndividualEquipment) suite.Equal(int64(1000), payload.ProGearWeight) suite.Equal(int64(750), payload.ProGearWeightSpouse) + suite.Equal(int64(1000), *payload.WeightRestriction) suite.NotEmpty(payload.ETag) suite.Equal(etag.GenerateEtag(entitlement.UpdatedAt), payload.ETag) }) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index dbd0e9792df..b4a5d2e4676 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -170,23 +170,27 @@ func Entitlement(entitlement *models.Entitlement) *primev2messages.Entitlements if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + var weightRestriction int64 + if entitlement.WeightRestriction != nil { + weightRestriction = int64(*entitlement.WeightRestriction) + } return &primev2messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, UnaccompaniedBaggageAllowance: &ubAllowance, DependentsAuthorized: entitlement.DependentsAuthorized, GunSafe: entitlement.GunSafe, - AdminRestrictedWeightLocation: entitlement.AdminRestrictedWeightLocation, NonTemporaryStorage: entitlement.NonTemporaryStorage, PrivatelyOwnedVehicle: entitlement.PrivatelyOwnedVehicle, ProGearWeight: int64(entitlement.ProGearWeight), ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: &weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go index ed333f6fd95..6f7b5ee3ec7 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go @@ -289,6 +289,7 @@ func (suite *PayloadsSuite) TestEntitlement() { ProGearWeightSpouse: 0, CreatedAt: time.Now(), UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -311,6 +312,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(int64(1000), *payload.WeightRestriction) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 0de1211d151..b4596356952 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -198,6 +198,10 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements if entitlement.UBAllowance != nil { ubAllowance = int64(*entitlement.UBAllowance) } + var weightRestriction int64 + if entitlement.WeightRestriction != nil { + weightRestriction = int64(*entitlement.WeightRestriction) + } return &primev3messages.Entitlements{ ID: strfmt.UUID(entitlement.ID.String()), AuthorizedWeight: authorizedWeight, @@ -209,10 +213,11 @@ func Entitlement(entitlement *models.Entitlement) *primev3messages.Entitlements ProGearWeightSpouse: int64(entitlement.ProGearWeightSpouse), RequiredMedicalEquipmentWeight: int64(entitlement.RequiredMedicalEquipmentWeight), OrganizationalClothingAndIndividualEquipment: entitlement.OrganizationalClothingAndIndividualEquipment, - StorageInTransit: sit, - TotalDependents: totalDependents, - TotalWeight: totalWeight, - ETag: etag.GenerateEtag(entitlement.UpdatedAt), + StorageInTransit: sit, + TotalDependents: totalDependents, + TotalWeight: totalWeight, + WeightRestriction: &weightRestriction, + ETag: etag.GenerateEtag(entitlement.UpdatedAt), } } diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 345ee203b0b..ea061eecd40 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -531,6 +531,7 @@ func (suite *PayloadsSuite) TestEntitlement() { ProGearWeightSpouse: 0, CreatedAt: time.Now(), UpdatedAt: time.Now(), + WeightRestriction: models.IntPointer(1000), } payload := Entitlement(&entitlement) @@ -553,6 +554,7 @@ func (suite *PayloadsSuite) TestEntitlement() { suite.Equal(int64(0), payload.TotalDependents) suite.Equal(int64(0), payload.TotalWeight) suite.Equal(int64(0), *payload.UnaccompaniedBaggageAllowance) + suite.Equal(int64(1000), *payload.WeightRestriction) }) suite.Run("Success - Returns the entitlement payload with all optional fields populated", func() { diff --git a/pkg/models/ghc_entitlements.go b/pkg/models/ghc_entitlements.go index d516d71eb0b..f56c915ad19 100644 --- a/pkg/models/ghc_entitlements.go +++ b/pkg/models/ghc_entitlements.go @@ -34,7 +34,6 @@ type Entitlement struct { OrganizationalClothingAndIndividualEquipment bool `db:"organizational_clothing_and_individual_equipment"` ProGearWeight int `db:"pro_gear_weight"` ProGearWeightSpouse int `db:"pro_gear_weight_spouse"` - AdminRestrictedWeightLocation bool `db:"admin_restricted_weight_location"` WeightRestriction *int `db:"weight_restriction"` CreatedAt time.Time `db:"created_at"` UpdatedAt time.Time `db:"updated_at"` diff --git a/pkg/notifications/move_approved.go b/pkg/notifications/move_approved.go index fb207acfbe3..96b198d6c8b 100644 --- a/pkg/notifications/move_approved.go +++ b/pkg/notifications/move_approved.go @@ -86,13 +86,12 @@ func (m MoveApproved) emails(appCtx appcontext.AppContext) ([]emailContent, erro } htmlBody, textBody, err := m.renderTemplates(appCtx, moveApprovedEmailData{ - Link: ppmInfoSheetURL.String(), - OriginDutyLocation: originDutyLocation, - DestinationDutyLocation: orders.NewDutyLocation.Name, - OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, - Locator: move.Locator, - MyMoveLink: MyMoveLink, - AdminRestrictedWeightLocation: orders.Entitlement.AdminRestrictedWeightLocation, + Link: ppmInfoSheetURL.String(), + OriginDutyLocation: originDutyLocation, + DestinationDutyLocation: orders.NewDutyLocation.Name, + OriginDutyLocationPhoneLine: originDutyLocationPhoneLine, + Locator: move.Locator, + MyMoveLink: MyMoveLink, }) if err != nil { @@ -129,13 +128,12 @@ func (m MoveApproved) renderTemplates(appCtx appcontext.AppContext, data moveApp // moveApprovedEmailData has content for email template type moveApprovedEmailData struct { - Link string - OriginDutyLocation *string - DestinationDutyLocation string - OriginDutyLocationPhoneLine *string - Locator string - MyMoveLink string - AdminRestrictedWeightLocation bool + Link string + OriginDutyLocation *string + DestinationDutyLocation string + OriginDutyLocationPhoneLine *string + Locator string + MyMoveLink string } // RenderHTML renders the html for the email diff --git a/pkg/services/order/order_updater.go b/pkg/services/order/order_updater.go index 397e7c159cf..bf196fa47d5 100644 --- a/pkg/services/order/order_updater.go +++ b/pkg/services/order/order_updater.go @@ -481,10 +481,6 @@ func allowanceFromTOOPayload(appCtx appcontext.AppContext, existingOrder models. order.Entitlement.GunSafe = *payload.GunSafe } - if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation - } - if payload.WeightRestriction != nil { weightRestriction := int(*payload.WeightRestriction) order.Entitlement.WeightRestriction = &weightRestriction @@ -593,10 +589,6 @@ func allowanceFromCounselingPayload(appCtx appcontext.AppContext, existingOrder order.Entitlement.GunSafe = *payload.GunSafe } - if payload.AdminRestrictedWeightLocation != nil { - order.Entitlement.AdminRestrictedWeightLocation = *payload.AdminRestrictedWeightLocation - } - if payload.WeightRestriction != nil { weightRestriction := int(*payload.WeightRestriction) order.Entitlement.WeightRestriction = &weightRestriction diff --git a/pkg/services/order/order_updater_test.go b/pkg/services/order/order_updater_test.go index 15ff4cf8b4b..9e86e990f95 100644 --- a/pkg/services/order/order_updater_test.go +++ b/pkg/services/order/order_updater_test.go @@ -588,7 +588,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -631,7 +630,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { AccompaniedTour: models.BoolPointer(true), DependentsTwelveAndOver: models.Int64Pointer(2), DependentsUnderTwelve: models.Int64Pointer(4), - AdminRestrictedWeightLocation: models.BoolPointer(false), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -677,7 +675,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsTOO() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsTOO(suite.AppContextForTest(), order.ID, payload, eTag) @@ -750,7 +747,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { AccompaniedTour: models.BoolPointer(true), DependentsTwelveAndOver: models.Int64Pointer(1), DependentsUnderTwelve: models.Int64Pointer(2), - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } @@ -780,6 +776,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { proGearWeightSpouse := models.Int64Pointer(10) rmeWeight := models.Int64Pointer(10000) eTag := etag.GenerateEtag(order.UpdatedAt) + weightRestriction := models.Int64Pointer(5000) payload := ghcmessages.CounselingUpdateAllowancePayload{ Agency: &affiliation, @@ -789,8 +786,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), - WeightRestriction: models.Int64Pointer(0), + WeightRestriction: weightRestriction, } updatedOrder, _, err := orderUpdater.UpdateAllowanceAsCounselor(suite.AppContextForTest(), order.ID, payload, eTag) @@ -811,6 +807,7 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { suite.Equal(*payload.OrganizationalClothingAndIndividualEquipment, updatedOrder.Entitlement.OrganizationalClothingAndIndividualEquipment) suite.EqualValues(payload.Agency, fetchedSM.Affiliation) suite.Equal(*updatedOrder.Entitlement.DBAuthorizedWeight, 16000) + suite.Equal(*payload.WeightRestriction, int64(*updatedOrder.Entitlement.WeightRestriction)) }) suite.Run("Updates the allowance when all fields are valid with dependents present and authorized", func() { @@ -836,7 +833,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } @@ -887,7 +883,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } @@ -940,7 +935,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } @@ -978,7 +972,6 @@ func (suite *OrderServiceSuite) TestUpdateAllowanceAsCounselor() { ProGearWeight: proGearWeight, ProGearWeightSpouse: proGearWeightSpouse, RequiredMedicalEquipmentWeight: rmeWeight, - AdminRestrictedWeightLocation: models.BoolPointer(false), WeightRestriction: models.Int64Pointer(0), } diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 739a5ea9d63..930ec6faae3 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -20,9 +20,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); - const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState( - entitlements?.adminRestrictedWeightLocation || false, - ); + const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(entitlements?.weightRestriction > 0); useEffect(() => { // Functional component version of "componentDidMount" // By leaving the dependency array empty this will only run once @@ -173,7 +171,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab isDisabled={formIsDisabled} />
-
Standard Weight allowance
+
Standard weight allowance
{formatWeight(entitlements.totalWeight)}
@@ -202,6 +200,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab label="Admin restricted weight location" isDisabled={formIsDisabled} onChange={handleAdminWeightLocationChange} + checked={entitlements?.weightRestriction > 0} />
{isAdminWeightLocationChecked && ( diff --git a/src/components/Office/DefinitionLists/AllowancesList.jsx b/src/components/Office/DefinitionLists/AllowancesList.jsx index 6b3c69fe5d5..7bdd17862ae 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.jsx @@ -34,7 +34,7 @@ const AllowancesList = ({ info, showVisualCues }) => {
{info.branch ? ORDERS_BRANCH_OPTIONS[info.branch] : ''}
-
Weight allowance
+
Standard weight allowance
{formatWeight(info.totalWeight)}
@@ -104,9 +104,10 @@ const AllowancesList = ({ info, showVisualCues }) => {
{info.gunSafe ? 'Authorized' : 'Unauthorized'}
-
Admin Restricted Weight Location
-
{info.adminRestrictedWeightLocation ? 'Yes' : 'No'}
+
Admin Weight Restricted Location
+
{info.weightRestriction > 0 ? 'Yes' : 'No'}
+
Weight Restriction
diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 45c2e97f246..5c44421c7f5 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -19,6 +19,7 @@ const info = { requiredMedicalEquipmentWeight: 1000, organizationalClothingAndIndividualEquipment: true, ubAllowance: 400, + weightRestriction: 1000, }; const initialValuesOconusAdditions = { @@ -175,4 +176,9 @@ describe('AllowancesList', () => { expect(screen.getByTestId('unaccompaniedBaggageAllowance')).toBeInTheDocument(); expect(screen.getByTestId('unaccompaniedBaggageAllowance').textContent).toEqual('400 lbs'); }); + it('renders weight restriction', () => { + const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; + render(); + expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,000 lbs'); + }); }); diff --git a/src/pages/Office/MoveAllowances/MoveAllowances.jsx b/src/pages/Office/MoveAllowances/MoveAllowances.jsx index 18484e884bd..b2cf0264b3a 100644 --- a/src/pages/Office/MoveAllowances/MoveAllowances.jsx +++ b/src/pages/Office/MoveAllowances/MoveAllowances.jsx @@ -45,6 +45,7 @@ const validationSchema = Yup.object({ .notRequired(), weightRestriction: Yup.number() .min(0, 'Weight restriction must be greater than or equal to 0') + .max(18000, 'Weight restriction cannot exceed 18,000 lbs') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), }); @@ -102,7 +103,6 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, - adminRestrictedWeightLocation, weightRestriction, accompaniedTour, dependentsTwelveAndOver, @@ -124,7 +124,6 @@ const MoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit: Number(storageInTransit), gunSafe, - adminRestrictedWeightLocation, weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), @@ -141,7 +140,6 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction, storageInTransit, dependentsUnderTwelve, @@ -158,7 +156,6 @@ const MoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction: `${weightRestriction}`, storageInTransit: `${storageInTransit}`, accompaniedTour, diff --git a/src/pages/Office/MoveDetails/MoveDetails.jsx b/src/pages/Office/MoveDetails/MoveDetails.jsx index fcf27b5b15c..1e74c050cc5 100644 --- a/src/pages/Office/MoveDetails/MoveDetails.jsx +++ b/src/pages/Office/MoveDetails/MoveDetails.jsx @@ -430,7 +430,6 @@ const MoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, - adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, diff --git a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx index 4a0cbd3846d..dafd49b76f6 100644 --- a/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx +++ b/src/pages/Office/ServicesCounselingMoveAllowances/ServicesCounselingMoveAllowances.jsx @@ -43,6 +43,7 @@ const validationSchema = Yup.object({ .notRequired(), weightRestriction: Yup.number() .min(0, 'Weight restriction must be greater than or equal to 0') + .max(18000, 'Weight restriction cannot exceed 18,000 lbs') .transform((value) => (Number.isNaN(value) ? 0 : value)) .notRequired(), }); @@ -90,7 +91,6 @@ const ServicesCounselingMoveAllowances = () => { organizationalClothingAndIndividualEquipment, storageInTransit, gunSafe, - adminRestrictedWeightLocation, weightRestriction, accompaniedTour, dependentsTwelveAndOver, @@ -112,7 +112,6 @@ const ServicesCounselingMoveAllowances = () => { storageInTransit: Number(storageInTransit), organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction: Number(weightRestriction), accompaniedTour, dependentsTwelveAndOver: Number(dependentsTwelveAndOver), @@ -129,7 +128,6 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment, gunSafe, - adminRestrictedWeightLocation, weightRestriction, storageInTransit, dependentsUnderTwelve, @@ -146,7 +144,6 @@ const ServicesCounselingMoveAllowances = () => { requiredMedicalEquipmentWeight: `${requiredMedicalEquipmentWeight}`, storageInTransit: `${storageInTransit}`, gunSafe, - adminRestrictedWeightLocation, weightRestriction: `${weightRestriction}`, organizationalClothingAndIndividualEquipment, accompaniedTour, diff --git a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx index 10322e78921..c5104b99537 100644 --- a/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx +++ b/src/pages/Office/ServicesCounselingMoveDetails/ServicesCounselingMoveDetails.jsx @@ -387,7 +387,6 @@ const ServicesCounselingMoveDetails = ({ requiredMedicalEquipmentWeight: allowances.requiredMedicalEquipmentWeight, organizationalClothingAndIndividualEquipment: allowances.organizationalClothingAndIndividualEquipment, gunSafe: allowances.gunSafe, - adminRestrictedWeightLocation: allowances.adminRestrictedWeightLocation, weightRestriction: allowances.weightRestriction, dependentsUnderTwelve: allowances.dependentsUnderTwelve, dependentsTwelveAndOver: allowances.dependentsTwelveAndOver, diff --git a/swagger-def/definitions/prime/Entitlements.yaml b/swagger-def/definitions/prime/Entitlements.yaml index 164841fc6e2..83a989da2b8 100644 --- a/swagger-def/definitions/prime/Entitlements.yaml +++ b/swagger-def/definitions/prime/Entitlements.yaml @@ -21,9 +21,6 @@ properties: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 91168e48ef1..ccf179de2c3 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -5041,9 +5041,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: type: integer example: 1500 @@ -5901,10 +5898,6 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: Indicates if the customer is restricted to a specific location for their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true @@ -6002,10 +5995,6 @@ definitions: description: True if user is entitled to move a gun safe (up to 500 lbs) as part of their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: Indicates if the customer is restricted to a specific location for their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 2eeb7cd3c68..1a531468c77 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -878,9 +878,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: example: 1500 type: integer diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index df3c1822bc1..0ec16edf6cd 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -5244,9 +5244,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: type: integer example: 1500 @@ -6153,12 +6150,6 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: >- - Indicates if the customer is restricted to a specific location for - their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true @@ -6269,12 +6260,6 @@ definitions: their move without it being charged against their weight allowance. type: boolean x-nullable: true - adminRestrictedWeightLocation: - description: >- - Indicates if the customer is restricted to a specific location for - their admin restricted weight. - type: boolean - x-nullable: true accompaniedTour: type: boolean example: true diff --git a/swagger/prime.yaml b/swagger/prime.yaml index 3fe547b0721..9d37bacb134 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -3246,9 +3246,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index c89f0f2794e..f4d2c829d84 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -1638,9 +1638,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index 741ebb467dd..cf74acb3640 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -1745,9 +1745,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false nonTemporaryStorage: example: false type: boolean diff --git a/swagger/support.yaml b/swagger/support.yaml index b4ea28ca93c..31ecdc921ce 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -953,9 +953,6 @@ definitions: gunSafe: type: boolean example: false - adminRestrictedWeightLocation: - type: boolean - example: false weightRestriction: example: 1500 type: integer From 3a3a74bc279e3947f46b6aaf87ae1f8688abf3c1 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 15:43:23 +0000 Subject: [PATCH 100/229] B-21935 --- .../templates/move_counseled_template.html | 3 + .../templates/move_counseled_template.txt | 4 +- pkg/gen/internalapi/embedded_spec.go | 20 +++++ pkg/gen/internalmessages/entitlement.go | 4 + pkg/gen/internalmessages/orders.go | 3 + pkg/handlers/internalapi/orders.go | 3 + pkg/notifications/move_counseled.go | 10 ++- pkg/notifications/move_counseled_test.go | 53 +++++++++++ .../MtoShipmentForm/MtoShipmentForm.jsx | 2 +- src/pages/MyMove/Home/MoveHome.jsx | 8 +- src/pages/MyMove/Home/MoveHome.test.jsx | 87 +++++++++++++++++++ src/pages/MyMove/Home/index.jsx | 8 +- swagger-def/internal.yaml | 8 ++ swagger/internal.yaml | 8 ++ 14 files changed, 216 insertions(+), 5 deletions(-) diff --git a/pkg/assets/notifications/templates/move_counseled_template.html b/pkg/assets/notifications/templates/move_counseled_template.html index d8c22a243b0..27bfa767bbe 100644 --- a/pkg/assets/notifications/templates/move_counseled_template.html +++ b/pkg/assets/notifications/templates/move_counseled_template.html @@ -2,6 +2,9 @@

This is a confirmation that your counselor has approved move details for the assigned move code{{if .Locator}} {{.Locator}}{{end}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system.

+{{if .WeightRestriction}} +

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{end}}

What this means to you:
If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

diff --git a/pkg/assets/notifications/templates/move_counseled_template.txt b/pkg/assets/notifications/templates/move_counseled_template.txt index 39aead0ef8a..535c27f66e9 100644 --- a/pkg/assets/notifications/templates/move_counseled_template.txt +++ b/pkg/assets/notifications/templates/move_counseled_template.txt @@ -1,7 +1,9 @@ *** DO NOT REPLY directly to this email *** This is a confirmation that your counselor has approved move details for the assigned move code {{.Locator}}{{if .OriginDutyLocation}} from {{.OriginDutyLocation}}{{end}}{{if .DestinationLocation}} to {{.DestinationLocation}}{{end}} in the MilMove system. - +{{if .WeightRestriction}} +

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+{{end}} What this means to you: If you are doing a Personally Procured Move (PPM), you can start moving your personal property. diff --git a/pkg/gen/internalapi/embedded_spec.go b/pkg/gen/internalapi/embedded_spec.go index c872ff075a7..35d92886247 100644 --- a/pkg/gen/internalapi/embedded_spec.go +++ b/pkg/gen/internalapi/embedded_spec.go @@ -4486,6 +4486,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weight_restriction": { + "description": "Indicates the weight restricted to a specific location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -6037,6 +6043,10 @@ func init() { }, "uploaded_orders": { "$ref": "#/definitions/Document" + }, + "weightRestriction": { + "type": "integer", + "x-nullable": true } } }, @@ -13615,6 +13625,12 @@ func init() { "type": "integer", "x-nullable": true, "example": 3 + }, + "weight_restriction": { + "description": "Indicates the weight restricted to a specific location.", + "type": "integer", + "x-nullable": true, + "example": 1500 } } }, @@ -15168,6 +15184,10 @@ func init() { }, "uploaded_orders": { "$ref": "#/definitions/Document" + }, + "weightRestriction": { + "type": "integer", + "x-nullable": true } } }, diff --git a/pkg/gen/internalmessages/entitlement.go b/pkg/gen/internalmessages/entitlement.go index 703b403758f..083ea350085 100644 --- a/pkg/gen/internalmessages/entitlement.go +++ b/pkg/gen/internalmessages/entitlement.go @@ -42,6 +42,10 @@ type Entitlement struct { // The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. // Example: 3 UbAllowance *int64 `json:"ub_allowance,omitempty"` + + // Indicates the weight restricted to a specific location. + // Example: 1500 + WeightRestriction *int64 `json:"weight_restriction,omitempty"` } // Validate validates this entitlement diff --git a/pkg/gen/internalmessages/orders.go b/pkg/gen/internalmessages/orders.go index 6a789163d32..f36800d8445 100644 --- a/pkg/gen/internalmessages/orders.go +++ b/pkg/gen/internalmessages/orders.go @@ -127,6 +127,9 @@ type Orders struct { // uploaded orders // Required: true UploadedOrders *Document `json:"uploaded_orders"` + + // weight restriction + WeightRestriction *int64 `json:"weightRestriction,omitempty"` } // Validate validates this orders diff --git a/pkg/handlers/internalapi/orders.go b/pkg/handlers/internalapi/orders.go index 6e663bff4ea..ce4cf66cde5 100644 --- a/pkg/handlers/internalapi/orders.go +++ b/pkg/handlers/internalapi/orders.go @@ -85,6 +85,9 @@ func payloadForOrdersModel(storer storage.FileStorer, order models.Order) (*inte if order.Entitlement.UBAllowance != nil { entitlement.UbAllowance = models.Int64Pointer(int64(*order.Entitlement.UBAllowance)) } + if order.Entitlement.WeightRestriction != nil { + entitlement.WeightRestriction = models.Int64Pointer(int64(*order.Entitlement.WeightRestriction)) + } } var originDutyLocation models.DutyLocation originDutyLocation = models.DutyLocation{} diff --git a/pkg/notifications/move_counseled.go b/pkg/notifications/move_counseled.go index e519fdcc6a7..a506a118eab 100644 --- a/pkg/notifications/move_counseled.go +++ b/pkg/notifications/move_counseled.go @@ -91,12 +91,19 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err return emails, fmt.Errorf("no email found for service member") } + var weightRestriction *int64 + if orders.Entitlement.WeightRestriction != nil { + weightRestrictionInt64 := int64(*orders.Entitlement.WeightRestriction) + weightRestriction = &weightRestrictionInt64 + } + htmlBody, textBody, err := m.renderTemplates(appCtx, MoveCounseledEmailData{ OriginDutyLocation: originDutyLocationName, DestinationLocation: destinationAddress, Locator: move.Locator, MyMoveLink: MyMoveLink, ActualExpenseReimbursement: actualExpenseReimbursement, + WeightRestriction: weightRestriction, }) if err != nil { @@ -115,8 +122,8 @@ func (m MoveCounseled) emails(appCtx appcontext.AppContext) ([]emailContent, err // TODO: Send email to trusted contacts when that's supported return append(emails, smEmail), nil -} +} func (m MoveCounseled) renderTemplates(appCtx appcontext.AppContext, data MoveCounseledEmailData) (string, string, error) { htmlBody, err := m.RenderHTML(appCtx, data) if err != nil { @@ -135,6 +142,7 @@ type MoveCounseledEmailData struct { Locator string MyMoveLink string ActualExpenseReimbursement bool + WeightRestriction *int64 } // RenderHTML renders the html for the email diff --git a/pkg/notifications/move_counseled_test.go b/pkg/notifications/move_counseled_test.go index a66370c27af..54f732a6d87 100644 --- a/pkg/notifications/move_counseled_test.go +++ b/pkg/notifications/move_counseled_test.go @@ -273,3 +273,56 @@ func (suite *NotificationSuite) TestMoveCounseledDestinationIsDutyStationForPpmP suite.Contains(email.htmlBody, "from "+move.Orders.OriginDutyLocation.Name+" to "+move.Orders.NewDutyLocation.Name+" in the ") suite.Contains(email.textBody, "from "+move.Orders.OriginDutyLocation.Name+" to "+move.Orders.NewDutyLocation.Name+" in the ") } + +func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRestriction() { + approver := factory.BuildUser(nil, nil, nil) + move := factory.BuildMove(suite.DB(), nil, nil) + notification := NewMoveCounseled(move.ID) + + originDutyLocation := "origDutyLocation" + + s := MoveCounseledEmailData{ + OriginDutyLocation: &originDutyLocation, + DestinationLocation: "destDutyLocation", + Locator: "abc123", + MyMoveLink: MyMoveLink, + ActualExpenseReimbursement: true, + WeightRestriction: models.Int64Pointer(1500), + } + + expectedHTMLContent := `

*** DO NOT REPLY directly to this email ***

+

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

+

What this means to you:
+

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

+

Next steps for a PPM: +

    +
  • Please Note: Your PPM has been designated as Actual Expense Reimbursement. This is the standard entitlement for Civilian employees. For uniformed Service Members, your PPM may have been designated as Actual Expense Reimbursement due to failure to receive authorization prior to movement or failure to obtain certified weight tickets. Actual Expense Reimbursement means reimbursement for expenses not to exceed the Government Constructed Cost (GCC).
  • +
  • Remember to get legible certified weight tickets for both the empty and full weights for every trip you perform. If you do not upload legible certified weight tickets, your PPM incentive (or Actual Expense Reimbursement for Civilians) could be affected. Failure to obtain weight tickets will result in losing eligibility to receive your incentive.
  • +

    Note: To receive allowance for Pro-Gear, you must identify allowable items and provide weight tickets separately for Pro-Gear.

    +
  • For authorized storage:
  • +
      +
    • You will need to get weight ticket(s) for the items you store.
    • +
    • Storage costs cannot be paid in advance.
    • +
    +
  • If your counselor approved an Advance Operating Allowance (AOA, or cash advance) for a PPM, log into MilMove to download your AOA Packet, and submit it to finance according to the instructions provided by your counselor. If you have been directed to use your government travel charge card (GTCC) for expenses no further action is required.
  • +
  • Once you complete your PPM, log into MilMove, upload your receipts and weight tickets, and submit your PPM for review.
  • +
+

Next steps for government arranged shipments:
+

    +
  • Your move request will be reviewed by the responsible personal property shipping office and a move task order for services will be placed with HomeSafe Alliance.
  • +
  • Once this order is placed, you will receive an e-mail invitation to create an account in HomeSafe Connect (check your spam or junk folder). This is the system you will use to schedule your pre-move survey.
  • +
  • HomeSafe is required to contact you within one Government Business Day. Once contact has been established, HomeSafe is your primary point of contact. If any information about your move changes at any point during the move, immediately notify your HomeSafe Customer Care Representative of the changes. Remember to keep your contact information updated in MilMove.
  • +
+

Thank you,
+USTRANSCOM MilMove Team

+

The information contained in this email may contain Privacy Act information and is therefore protected under the Privacy Act of 1974. Failure to protect Privacy Act information could result in a $5,000 fine.

` + + htmlContent, err := notification.RenderHTML(suite.AppContextWithSessionForTest(&auth.Session{ + UserID: approver.ID, + ApplicationName: auth.OfficeApp, + }), s) + + suite.NoError(err) + suite.Equal(trimExtraSpaces(expectedHTMLContent), trimExtraSpaces(htmlContent)) +} diff --git a/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx b/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx index badadb06df0..a7ca94c2646 100644 --- a/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx +++ b/src/components/Customer/MtoShipmentForm/MtoShipmentForm.jsx @@ -319,7 +319,7 @@ class MtoShipmentForm extends Component { ? ` You can move up to ${formatUBAllowanceWeight( orders?.entitlement?.ub_allowance, )} for this UB shipment. The weight of your UB is part of your authorized weight allowance` - : ` Your standard weight allowcance is ${formatWeight( + : ` Your standard weight allowance is ${formatWeight( orders.authorizedWeight, )} total. If you are moving to an administratively restricted HHG weight location this amount may be less. `} . You’ll be billed for any excess weight you move. diff --git a/src/pages/MyMove/Home/MoveHome.jsx b/src/pages/MyMove/Home/MoveHome.jsx index 69afb201a28..df26309e2e2 100644 --- a/src/pages/MyMove/Home/MoveHome.jsx +++ b/src/pages/MyMove/Home/MoveHome.jsx @@ -434,9 +434,15 @@ const MoveHome = ({ serviceMemberMoves, isProfileComplete, serviceMember, signed
-
Weight allowance
+
Standard weight allowance
{formatWeight(orders.authorizedWeight)}
+ {orders?.entitlement?.weight_restriction > 0 && ( +
+
Weight Restriction
+
{formatWeight(orders?.entitlement?.weight_restriction)}
+
+ )} {orders?.entitlement?.ub_allowance > 0 && (
UB allowance
diff --git a/src/pages/MyMove/Home/MoveHome.test.jsx b/src/pages/MyMove/Home/MoveHome.test.jsx index aa1da0f83ad..f8c6ce85549 100644 --- a/src/pages/MyMove/Home/MoveHome.test.jsx +++ b/src/pages/MyMove/Home/MoveHome.test.jsx @@ -1794,3 +1794,90 @@ describe('Home component', () => { }); }); }); +describe('renderCustomerHeaderText', () => { + const defaultOrders = { + new_duty_location: { + name: 'Fort Knox, KY 40121', + }, + origin_duty_location: { + name: 'Tinker AFB, OK 73145', + }, + report_by_date: '2024-02-29', + authorizedWeight: 11000, + }; + + const defaultMove = { + moveCode: '4H8VCD', + }; + + it('renders location and report by date correctly', () => { + const wrapper = mountMoveHomeWithProviders({ + ...defaultPropsOrdersWithUploads, + serviceMemberMoves: { + currentMove: [ + { + ...defaultPropsOrdersWithUploads.serviceMemberMoves.currentMove[0], + orders: defaultOrders, + move: defaultMove, + }, + ], + previousMoves: [], + }, + }); + + expect(wrapper.text()).toContain('Fort Knox, KY 40121'); + expect(wrapper.text()).toContain('Tinker AFB, OK 73145'); + expect(wrapper.text()).toContain('29 Feb 2024'); + }); + + it('renders weight restriction when present', () => { + const ordersWithRestriction = { + ...defaultOrders, + entitlement: { + weight_restriction: 9000, + }, + }; + + const wrapper = mountMoveHomeWithProviders({ + ...defaultPropsOrdersWithUploads, + serviceMemberMoves: { + currentMove: [ + { + ...defaultPropsOrdersWithUploads.serviceMemberMoves.currentMove[0], + orders: ordersWithRestriction, + move: defaultMove, + }, + ], + previousMoves: [], + }, + }); + + expect(wrapper.text()).toContain('Weight Restriction'); + expect(wrapper.text()).toContain('9,000 lbs'); + }); + + it('does not render weight restriction when not present', () => { + const ordersWithoutRestriction = { + ...defaultOrders, + entitlement: { + weight_restriction: 0, + }, + }; + + const wrapper = mountMoveHomeWithProviders({ + ...defaultPropsOrdersWithUploads, + serviceMemberMoves: { + currentMove: [ + { + ...defaultPropsOrdersWithUploads.serviceMemberMoves.currentMove[0], + orders: ordersWithoutRestriction, + move: defaultMove, + }, + ], + previousMoves: [], + }, + }); + + expect(wrapper.text()).not.toContain('Weight Restriction'); + }); +}); diff --git a/src/pages/MyMove/Home/index.jsx b/src/pages/MyMove/Home/index.jsx index 12544c80b88..38e20ac42a9 100644 --- a/src/pages/MyMove/Home/index.jsx +++ b/src/pages/MyMove/Home/index.jsx @@ -265,9 +265,15 @@ export class Home extends Component {
-
Standard Weight allowance
+
Standard weight alloowance
{formatWeight(orders.authorizedWeight)}.
+ {orders?.entitlement?.weight_restriction > 0 && ( +
+
Weight Restriction
+
{formatWeight(orders?.entitlement?.weight_restriction)}
+
+ )} {move.locator && (
Move code
diff --git a/swagger-def/internal.yaml b/swagger-def/internal.yaml index 3e9e054343a..17acc89241e 100644 --- a/swagger-def/internal.yaml +++ b/swagger-def/internal.yaml @@ -1408,6 +1408,9 @@ definitions: providesServicesCounseling: type: boolean x-omitempty: false + weightRestriction: + type: integer + x-nullable: true required: - id - service_member_id @@ -1455,6 +1458,11 @@ definitions: example: 3 x-nullable: true description: The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. + weight_restriction: + type: integer + example: 1500 + x-nullable: true + description: Indicates the weight restricted to a specific location. CreateUpdateOrders: type: object properties: diff --git a/swagger/internal.yaml b/swagger/internal.yaml index f7275136ef6..2f772c2ffcc 100644 --- a/swagger/internal.yaml +++ b/swagger/internal.yaml @@ -1431,6 +1431,9 @@ definitions: providesServicesCounseling: type: boolean x-omitempty: false + weightRestriction: + type: integer + x-nullable: true required: - id - service_member_id @@ -1489,6 +1492,11 @@ definitions: description: >- The amount of weight in pounds that the move is entitled for shipment types of Unaccompanied Baggage. + weight_restriction: + type: integer + example: 1500 + x-nullable: true + description: Indicates the weight restricted to a specific location. CreateUpdateOrders: type: object properties: From 87ac095c16a103a1a694db18b27832972b9520cc Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 16:21:28 +0000 Subject: [PATCH 101/229] fix test --- src/pages/MyMove/Home/MoveHome.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/MyMove/Home/MoveHome.test.jsx b/src/pages/MyMove/Home/MoveHome.test.jsx index f8c6ce85549..f26abfa3289 100644 --- a/src/pages/MyMove/Home/MoveHome.test.jsx +++ b/src/pages/MyMove/Home/MoveHome.test.jsx @@ -1196,7 +1196,7 @@ describe('Home component', () => { wrapper = mountMoveHomeWithProviders(defaultPropsOrdersWithUBAllowance); }); await waitFor(() => { - expect(wrapper.text()).toContain('Weight allowance'); + expect(wrapper.text()).toContain('Standard weight allowance'); expect(wrapper.text()).toContain('11,000 lbs'); expect(wrapper.text()).toContain('UB allowance'); expect(wrapper.text()).toContain('2,000 lbs'); From ef194e4fdfa2bbf2de6003f5ca0ed5d153db9c98 Mon Sep 17 00:00:00 2001 From: Tevin Adams Date: Mon, 27 Jan 2025 16:25:40 +0000 Subject: [PATCH 102/229] Adjusting Role display impl --- .../RequestedOfficeUserList.jsx | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx index 87f901d0d07..6ab0ff379e9 100644 --- a/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx +++ b/src/pages/Admin/RequestedOfficeUsers/RequestedOfficeUserList.jsx @@ -8,8 +8,8 @@ import { TextField, TopToolbar, ArrayField, - SingleFieldList, SearchInput, + useRecordContext, } from 'react-admin'; import AdminPagination from 'scenes/SystemAdmin/shared/AdminPagination'; @@ -29,6 +29,26 @@ const RequestedOfficeUserListFilter = () => ( const defaultSort = { field: 'createdAt', order: 'DESC' }; +const RolesTextField = (user) => { + const { roles } = user; + + let roleStr = ''; + for (let i = 0; i < roles.length; i += 1) { + roleStr += roles[i].roleName; + + if (i < roles.length - 1) { + roleStr += ', '; + } + } + + return roleStr; +}; + +const RolesField = () => { + const record = useRecordContext(); + return
{RolesTextField(record)}
; +}; + const RequestedOfficeUserList = () => ( } @@ -48,9 +68,7 @@ const RequestedOfficeUserList = () => ( - - - + From 1eef9478277e20d7795854f97e1acb5a9ee0a418 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 16:42:03 +0000 Subject: [PATCH 103/229] fix test --- src/pages/MyMove/Home/MoveHome.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/MyMove/Home/MoveHome.test.jsx b/src/pages/MyMove/Home/MoveHome.test.jsx index 03af9f8a81b..82e7c5b53ba 100644 --- a/src/pages/MyMove/Home/MoveHome.test.jsx +++ b/src/pages/MyMove/Home/MoveHome.test.jsx @@ -1200,7 +1200,7 @@ describe('Home component', () => { expect(wrapper.text()).toContain('11,000 lbs'); expect(wrapper.text()).toContain('UB allowance'); expect(wrapper.text()).toContain('2,000 lbs'); - expect(wrapper.text()).toContain('Weight restriction'); + expect(wrapper.text()).not.toContain('Weight restriction'); }); const ubToolTip = wrapper.find('ToolTip'); From 75850822706b8e3c1fc5c3ea101705308d067aba Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 16:53:02 +0000 Subject: [PATCH 104/229] test fix --- src/components/Office/DefinitionLists/AllowancesList.test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index 5c44421c7f5..f0e6c203639 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -179,6 +179,6 @@ describe('AllowancesList', () => { it('renders weight restriction', () => { const adminRestrictedWtLoc = { ...info, adminRestrictedWeightLocation: true }; render(); - expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,000 lbs'); + expect(screen.getByTestId('weightRestriction').textContent).toEqual('1,500 lbs'); }); }); From 5b5103562c76a48db15b0e9bb5eaeb9ec3c56063 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 27 Jan 2025 17:28:33 +0000 Subject: [PATCH 105/229] Edited to include MS and CS items (any item with a rejection reason) --- .../ExpandableServiceItemRow.jsx | 23 +++++++++++-------- .../ExpandableServiceItemRow.module.scss | 2 ++ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx index 0634e3aba65..bec330274b3 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx @@ -25,7 +25,8 @@ const ExpandableServiceItemRow = ({ return canShowExpandableContent && (paymentIsDeprecated || item.status !== PAYMENT_SERVICE_ITEM_STATUS.REQUESTED); }; const canShowExpandableContent = - !disableExpansion && allowedServiceItemCalculations.includes(serviceItem.mtoServiceItemCode); + !disableExpansion && + (allowedServiceItemCalculations.includes(serviceItem.mtoServiceItemCode) === true || serviceItem.rejectionReason); const handleExpandClick = () => { setIsExpanded((prev) => !prev); @@ -94,15 +95,17 @@ const ExpandableServiceItemRow = ({ {isExpanded && (
- + {Object.keys(additionalServiceItemData).length > 0 && ( + + )} {serviceItem.rejectionReason && ( )} {serviceItem.rejectionReason && ( -
- - + +
diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index 0cab37efe3e..eef510834fc 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -107,6 +107,8 @@ flex-direction: row; flex-wrap: wrap; align-items: center; + padding-left: 1rem; + padding-bottom: 1rem; svg { path { From 3bf5db9b3fc6a26d3cecb08c1e7509afe9da6d7b Mon Sep 17 00:00:00 2001 From: Tevin Adams Date: Mon, 27 Jan 2025 18:19:38 +0000 Subject: [PATCH 106/229] Error handling adjustments --- pkg/handlers/adminapi/requested_office_users.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkg/handlers/adminapi/requested_office_users.go b/pkg/handlers/adminapi/requested_office_users.go index e0ab3dc7175..e81b438b420 100644 --- a/pkg/handlers/adminapi/requested_office_users.go +++ b/pkg/handlers/adminapi/requested_office_users.go @@ -258,10 +258,9 @@ func (h IndexRequestedOfficeUsersHandler) Handle(params requested_office_users.I var filteredTransportationOffices models.TransportationOffices // If there was a Transportation Office filter applied then get the filtered Transportation Offices if requestedOfficeUserFilters[TransportationOfficeSearch] != "" { - var tErr error searchString := requestedOfficeUserFilters[TransportationOfficeSearch] - transportationOfficesFilterResults, tErr := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, searchString, false, true) - if tErr != nil { + transportationOfficesFilterResults, err := h.TransportationOfficesFetcher.GetTransportationOffices(appCtx, searchString, false, true) + if err != nil { appCtx.Logger().Error("Error searching for Transportation Offices using filter: ", zap.Error(err)) return handlers.ResponseForError(appCtx.Logger(), err), err } @@ -272,9 +271,8 @@ func (h IndexRequestedOfficeUsersHandler) Handle(params requested_office_users.I // If there was a Roles filter applied then get the filtered Roles var filteredRoles roles.Roles if requestedOfficeUserFilters[RoleSearch] != "" { - var rErr error rolesFilterResult, err := roles.FindRoles(appCtx.DB(), requestedOfficeUserFilters[RoleSearch]) - if rErr != nil { + if err != nil { appCtx.Logger().Error("Error searching for Roles using filter: ", zap.Error(err)) return handlers.ResponseForError(appCtx.Logger(), err), err } From acc62ba1c85c1d60c02ba05a801d4d8f4c9f7680 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 18:29:59 +0000 Subject: [PATCH 107/229] updates --- pkg/notifications/move_counseled_test.go | 2 +- pkg/notifications/move_submitted_test.go | 12 ++++++------ .../Office/DefinitionLists/AllowancesList.test.jsx | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/notifications/move_counseled_test.go b/pkg/notifications/move_counseled_test.go index 54f732a6d87..11e1a417b85 100644 --- a/pkg/notifications/move_counseled_test.go +++ b/pkg/notifications/move_counseled_test.go @@ -293,7 +293,7 @@ func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRes expectedHTMLContent := `

*** DO NOT REPLY directly to this email ***

This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

What this means to you:
-

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is {{.WeightRestriction}}lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

+

Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is 1500lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

Next steps for a PPM:

    diff --git a/pkg/notifications/move_submitted_test.go b/pkg/notifications/move_submitted_test.go index b636d26a536..75c2c9c33b7 100644 --- a/pkg/notifications/move_submitted_test.go +++ b/pkg/notifications/move_submitted_test.go @@ -273,9 +273,9 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithGovCounse

    - Your weight allowance: 7,999 pounds. + Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your - orders. + orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

    @@ -385,7 +385,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou

    - Your weight allowance: 7,999 pounds. + Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders.

    @@ -483,9 +483,9 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderNoDutyLocatio

    - Your weight allowance: 7,999 pounds. + Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your - orders. + orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

    @@ -578,7 +578,7 @@ We have assigned you a move code: abc123. You can use this code when talking to To change any information about your move, or to add or cancel shipments, you should contact 555-555-5555 or visit your local transportation office (` + OneSourceTransportationOfficeLink + `) . -Your weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. +Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less. If you move more than 7,999 pounds or ship to/from an other than authorized location, you may owe the government the difference in cost between what you are authorized and what you decide to move. diff --git a/src/components/Office/DefinitionLists/AllowancesList.test.jsx b/src/components/Office/DefinitionLists/AllowancesList.test.jsx index f0e6c203639..9eed73f1d62 100644 --- a/src/components/Office/DefinitionLists/AllowancesList.test.jsx +++ b/src/components/Office/DefinitionLists/AllowancesList.test.jsx @@ -19,7 +19,7 @@ const info = { requiredMedicalEquipmentWeight: 1000, organizationalClothingAndIndividualEquipment: true, ubAllowance: 400, - weightRestriction: 1000, + weightRestriction: 1500, }; const initialValuesOconusAdditions = { From 9038658aff5c46cddc9e553f6b421c2fd19f4d18 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Mon, 27 Jan 2025 18:47:33 +0000 Subject: [PATCH 108/229] pass serviceMemberId to office app's get counseling offices handler and pass it to service --- pkg/gen/ghcapi/embedded_spec.go | 47 +++++- pkg/gen/ghcapi/ghcoperations/mymove_api.go | 2 +- .../show_counseling_offices.go | 2 +- .../show_counseling_offices_parameters.go | 43 ++++++ .../show_counseling_offices_responses.go | 135 ++++++++++++++++++ .../show_counseling_offices_urlbuilder.go | 12 +- pkg/handlers/ghcapi/tranportation_offices.go | 3 +- .../internalapi/transportation_offices.go | 2 +- .../mocks/TransportationOfficesFetcher.go | 18 +-- pkg/services/transportation_office.go | 2 +- .../transportation_office_fetcher.go | 13 +- .../transportation_office_fetcher_test.go | 29 ++-- .../Office/AddOrdersForm/AddOrdersForm.jsx | 8 +- src/services/ghcApi.js | 4 +- swagger-def/ghc.yaml | 14 +- swagger/ghc.yaml | 16 ++- 16 files changed, 309 insertions(+), 41 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 9beed88f2e7..a882cd98800 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -6275,7 +6275,7 @@ func init() { } } }, - "/transportation_offices/{dutyLocationId}/counseling_offices": { + "/transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}": { "get": { "description": "Returns the counseling locations matching the GBLOC from the selected duty location", "produces": [ @@ -6294,6 +6294,14 @@ func init() { "name": "dutyLocationId", "in": "path", "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member, some counseling offices are branch specific", + "name": "serviceMemberId", + "in": "path", + "required": true } ], "responses": { @@ -6303,6 +6311,15 @@ func init() { "$ref": "#/definitions/CounselingOffices" } }, + "400": { + "$ref": "#/responses/InvalidRequest" + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, "500": { "description": "internal server error" } @@ -23365,7 +23382,7 @@ func init() { } } }, - "/transportation_offices/{dutyLocationId}/counseling_offices": { + "/transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}": { "get": { "description": "Returns the counseling locations matching the GBLOC from the selected duty location", "produces": [ @@ -23384,6 +23401,14 @@ func init() { "name": "dutyLocationId", "in": "path", "required": true + }, + { + "type": "string", + "format": "uuid", + "description": "UUID of the service member, some counseling offices are branch specific", + "name": "serviceMemberId", + "in": "path", + "required": true } ], "responses": { @@ -23393,6 +23418,24 @@ func init() { "$ref": "#/definitions/CounselingOffices" } }, + "400": { + "description": "The request payload is invalid", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, "500": { "description": "internal server error" } diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go index 49432fc71b9..7d9bb87acf6 100644 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -1487,7 +1487,7 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/transportation_offices/{dutyLocationId}/counseling_offices"] = transportation_office.NewShowCounselingOffices(o.context, o.TransportationOfficeShowCounselingOfficesHandler) + o.handlers["GET"]["/transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}"] = transportation_office.NewShowCounselingOffices(o.context, o.TransportationOfficeShowCounselingOfficesHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go index 5b4c1967e43..b0cb58981df 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices.go @@ -30,7 +30,7 @@ func NewShowCounselingOffices(ctx *middleware.Context, handler ShowCounselingOff } /* - ShowCounselingOffices swagger:route GET /transportation_offices/{dutyLocationId}/counseling_offices transportationOffice showCounselingOffices + ShowCounselingOffices swagger:route GET /transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId} transportationOffice showCounselingOffices # Returns the counseling locations in the GBLOC matching the duty location diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go index 24f4c585bfd..91d0a12238c 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_parameters.go @@ -36,6 +36,11 @@ type ShowCounselingOfficesParams struct { In: path */ DutyLocationID strfmt.UUID + /*UUID of the service member, some counseling offices are branch specific + Required: true + In: path + */ + ServiceMemberID strfmt.UUID } // BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface @@ -51,6 +56,11 @@ func (o *ShowCounselingOfficesParams) BindRequest(r *http.Request, route *middle if err := o.bindDutyLocationID(rDutyLocationID, rhkDutyLocationID, route.Formats); err != nil { res = append(res, err) } + + rServiceMemberID, rhkServiceMemberID, _ := route.Params.GetOK("serviceMemberId") + if err := o.bindServiceMemberID(rServiceMemberID, rhkServiceMemberID, route.Formats); err != nil { + res = append(res, err) + } if len(res) > 0 { return errors.CompositeValidationError(res...) } @@ -89,3 +99,36 @@ func (o *ShowCounselingOfficesParams) validateDutyLocationID(formats strfmt.Regi } return nil } + +// bindServiceMemberID binds and validates parameter ServiceMemberID from path. +func (o *ShowCounselingOfficesParams) bindServiceMemberID(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: true + // Parameter is provided by construction from the route + + // Format: uuid + value, err := formats.Parse("uuid", raw) + if err != nil { + return errors.InvalidType("serviceMemberId", "path", "strfmt.UUID", raw) + } + o.ServiceMemberID = *(value.(*strfmt.UUID)) + + if err := o.validateServiceMemberID(formats); err != nil { + return err + } + + return nil +} + +// validateServiceMemberID carries on validations for parameter ServiceMemberID +func (o *ShowCounselingOfficesParams) validateServiceMemberID(formats strfmt.Registry) error { + + if err := validate.FormatOf("serviceMemberId", "path", "uuid", o.ServiceMemberID.String(), formats); err != nil { + return err + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go index 73793566c47..0e38c7ca905 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_responses.go @@ -61,6 +61,141 @@ func (o *ShowCounselingOfficesOK) WriteResponse(rw http.ResponseWriter, producer } } +// ShowCounselingOfficesBadRequestCode is the HTTP code returned for type ShowCounselingOfficesBadRequest +const ShowCounselingOfficesBadRequestCode int = 400 + +/* +ShowCounselingOfficesBadRequest The request payload is invalid + +swagger:response showCounselingOfficesBadRequest +*/ +type ShowCounselingOfficesBadRequest struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowCounselingOfficesBadRequest creates ShowCounselingOfficesBadRequest with default headers values +func NewShowCounselingOfficesBadRequest() *ShowCounselingOfficesBadRequest { + + return &ShowCounselingOfficesBadRequest{} +} + +// WithPayload adds the payload to the show counseling offices bad request response +func (o *ShowCounselingOfficesBadRequest) WithPayload(payload *ghcmessages.Error) *ShowCounselingOfficesBadRequest { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show counseling offices bad request response +func (o *ShowCounselingOfficesBadRequest) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(400) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowCounselingOfficesForbiddenCode is the HTTP code returned for type ShowCounselingOfficesForbidden +const ShowCounselingOfficesForbiddenCode int = 403 + +/* +ShowCounselingOfficesForbidden The request was denied + +swagger:response showCounselingOfficesForbidden +*/ +type ShowCounselingOfficesForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowCounselingOfficesForbidden creates ShowCounselingOfficesForbidden with default headers values +func NewShowCounselingOfficesForbidden() *ShowCounselingOfficesForbidden { + + return &ShowCounselingOfficesForbidden{} +} + +// WithPayload adds the payload to the show counseling offices forbidden response +func (o *ShowCounselingOfficesForbidden) WithPayload(payload *ghcmessages.Error) *ShowCounselingOfficesForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show counseling offices forbidden response +func (o *ShowCounselingOfficesForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ShowCounselingOfficesNotFoundCode is the HTTP code returned for type ShowCounselingOfficesNotFound +const ShowCounselingOfficesNotFoundCode int = 404 + +/* +ShowCounselingOfficesNotFound The requested resource wasn't found + +swagger:response showCounselingOfficesNotFound +*/ +type ShowCounselingOfficesNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewShowCounselingOfficesNotFound creates ShowCounselingOfficesNotFound with default headers values +func NewShowCounselingOfficesNotFound() *ShowCounselingOfficesNotFound { + + return &ShowCounselingOfficesNotFound{} +} + +// WithPayload adds the payload to the show counseling offices not found response +func (o *ShowCounselingOfficesNotFound) WithPayload(payload *ghcmessages.Error) *ShowCounselingOfficesNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the show counseling offices not found response +func (o *ShowCounselingOfficesNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ShowCounselingOfficesNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + // ShowCounselingOfficesInternalServerErrorCode is the HTTP code returned for type ShowCounselingOfficesInternalServerError const ShowCounselingOfficesInternalServerErrorCode int = 500 diff --git a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go index 1f0e360afa7..269dfc8874e 100644 --- a/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go +++ b/pkg/gen/ghcapi/ghcoperations/transportation_office/show_counseling_offices_urlbuilder.go @@ -16,7 +16,8 @@ import ( // ShowCounselingOfficesURL generates an URL for the show counseling offices operation type ShowCounselingOfficesURL struct { - DutyLocationID strfmt.UUID + DutyLocationID strfmt.UUID + ServiceMemberID strfmt.UUID _basePath string // avoid unkeyed usage @@ -42,7 +43,7 @@ func (o *ShowCounselingOfficesURL) SetBasePath(bp string) { func (o *ShowCounselingOfficesURL) Build() (*url.URL, error) { var _result url.URL - var _path = "/transportation_offices/{dutyLocationId}/counseling_offices" + var _path = "/transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}" dutyLocationID := o.DutyLocationID.String() if dutyLocationID != "" { @@ -51,6 +52,13 @@ func (o *ShowCounselingOfficesURL) Build() (*url.URL, error) { return nil, errors.New("dutyLocationId is required on ShowCounselingOfficesURL") } + serviceMemberID := o.ServiceMemberID.String() + if serviceMemberID != "" { + _path = strings.Replace(_path, "{serviceMemberId}", serviceMemberID, -1) + } else { + return nil, errors.New("serviceMemberId is required on ShowCounselingOfficesURL") + } + _basePath := o._basePath if _basePath == "" { _basePath = "/ghc/v1" diff --git a/pkg/handlers/ghcapi/tranportation_offices.go b/pkg/handlers/ghcapi/tranportation_offices.go index 6c0dcacc1b6..5df15bb6aaa 100644 --- a/pkg/handlers/ghcapi/tranportation_offices.go +++ b/pkg/handlers/ghcapi/tranportation_offices.go @@ -86,8 +86,9 @@ func (h ShowCounselingOfficesHandler) Handle(params transportationofficeop.ShowC return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, func(appCtx appcontext.AppContext) (middleware.Responder, error) { dutyLocationID := uuid.FromStringOrNil(params.DutyLocationID.String()) + serviceMemberID := uuid.FromStringOrNil(params.ServiceMemberID.String()) - counselingOffices, err := h.TransportationOfficesFetcher.GetCounselingOffices(appCtx, dutyLocationID) + counselingOffices, err := h.TransportationOfficesFetcher.GetCounselingOffices(appCtx, dutyLocationID, serviceMemberID) if err != nil { appCtx.Logger().Error("Error searching for Counseling Offices: ", zap.Error(err)) return transportationofficeop.NewShowCounselingOfficesInternalServerError(), err diff --git a/pkg/handlers/internalapi/transportation_offices.go b/pkg/handlers/internalapi/transportation_offices.go index 6b535fd9ba9..f1f7eb706eb 100644 --- a/pkg/handlers/internalapi/transportation_offices.go +++ b/pkg/handlers/internalapi/transportation_offices.go @@ -74,7 +74,7 @@ func (h ShowCounselingOfficesHandler) Handle(params transportationofficeop.ShowC func(appCtx appcontext.AppContext) (middleware.Responder, error) { dutyLocationID := uuid.FromStringOrNil(params.DutyLocationID.String()) - counselingOffices, err := h.TransportationOfficesFetcher.GetCounselingOffices(appCtx, dutyLocationID) + counselingOffices, err := h.TransportationOfficesFetcher.GetCounselingOffices(appCtx, dutyLocationID, appCtx.Session().ServiceMemberID) if err != nil { appCtx.Logger().Error("Error searching for Counseling Offices: ", zap.Error(err)) return transportationofficeop.NewShowCounselingOfficesInternalServerError(), err diff --git a/pkg/services/mocks/TransportationOfficesFetcher.go b/pkg/services/mocks/TransportationOfficesFetcher.go index eed32753594..ad777d72b0a 100644 --- a/pkg/services/mocks/TransportationOfficesFetcher.go +++ b/pkg/services/mocks/TransportationOfficesFetcher.go @@ -46,9 +46,9 @@ func (_m *TransportationOfficesFetcher) GetAllGBLOCs(appCtx appcontext.AppContex return r0, r1 } -// GetCounselingOffices provides a mock function with given fields: appCtx, dutyLocationID -func (_m *TransportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffices, error) { - ret := _m.Called(appCtx, dutyLocationID) +// GetCounselingOffices provides a mock function with given fields: appCtx, dutyLocationID, serviceMemberID +func (_m *TransportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID, serviceMemberID uuid.UUID) (*models.TransportationOffices, error) { + ret := _m.Called(appCtx, dutyLocationID, serviceMemberID) if len(ret) == 0 { panic("no return value specified for GetCounselingOffices") @@ -56,19 +56,19 @@ func (_m *TransportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.A var r0 *models.TransportationOffices var r1 error - if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID) (*models.TransportationOffices, error)); ok { - return rf(appCtx, dutyLocationID) + if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID, uuid.UUID) (*models.TransportationOffices, error)); ok { + return rf(appCtx, dutyLocationID, serviceMemberID) } - if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID) *models.TransportationOffices); ok { - r0 = rf(appCtx, dutyLocationID) + if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID, uuid.UUID) *models.TransportationOffices); ok { + r0 = rf(appCtx, dutyLocationID, serviceMemberID) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*models.TransportationOffices) } } - if rf, ok := ret.Get(1).(func(appcontext.AppContext, uuid.UUID) error); ok { - r1 = rf(appCtx, dutyLocationID) + if rf, ok := ret.Get(1).(func(appcontext.AppContext, uuid.UUID, uuid.UUID) error); ok { + r1 = rf(appCtx, dutyLocationID, serviceMemberID) } else { r1 = ret.Error(1) } diff --git a/pkg/services/transportation_office.go b/pkg/services/transportation_office.go index 307f0d0fef5..9ec90364ba0 100644 --- a/pkg/services/transportation_office.go +++ b/pkg/services/transportation_office.go @@ -12,5 +12,5 @@ type TransportationOfficesFetcher interface { GetTransportationOffices(appCtx appcontext.AppContext, search string, forPpm bool) (*models.TransportationOffices, error) GetTransportationOffice(appCtx appcontext.AppContext, transportationOfficeID uuid.UUID, includeOnlyPPMCloseoutOffices bool) (*models.TransportationOffice, error) GetAllGBLOCs(appCtx appcontext.AppContext) (*models.GBLOCs, error) - GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffices, error) + GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID, serviceMemberID uuid.UUID) (*models.TransportationOffices, error) } diff --git a/pkg/services/transportation_office/transportation_office_fetcher.go b/pkg/services/transportation_office/transportation_office_fetcher.go index be942890c75..8ccd09694f3 100644 --- a/pkg/services/transportation_office/transportation_office_fetcher.go +++ b/pkg/services/transportation_office/transportation_office_fetcher.go @@ -127,8 +127,8 @@ func ListDistinctGBLOCs(appCtx appcontext.AppContext) (models.GBLOCs, error) { return gblocList, err } -func (o transportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (*models.TransportationOffices, error) { - officeList, err := findCounselingOffice(appCtx, dutyLocationID) +func (o transportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.AppContext, dutyLocationID uuid.UUID, serviceMemberID uuid.UUID) (*models.TransportationOffices, error) { + officeList, err := findCounselingOffice(appCtx, dutyLocationID, serviceMemberID) if err != nil { switch err { @@ -143,7 +143,8 @@ func (o transportationOfficesFetcher) GetCounselingOffices(appCtx appcontext.App } // return all the transportation offices in the GBLOC of the given duty location where provides_services_counseling = true -func findCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID) (models.TransportationOffices, error) { +// serviceMemberID is only provided when this function is called by the office handler +func findCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID, serviceMemberID uuid.UUID) (models.TransportationOffices, error) { var officeList []models.TransportationOffice duty_location, err := models.FetchDutyLocation(appCtx.DB(), dutyLocationID) @@ -157,7 +158,7 @@ func findCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID // Find for oconus duty location // ******************************** if *duty_location.Address.IsOconus { - gblocDepartmentIndicator, err := findOconusGblocDepartmentIndicator(appCtx, duty_location) + gblocDepartmentIndicator, err := findOconusGblocDepartmentIndicator(appCtx, duty_location, serviceMemberID) if err != nil { return officeList, err } @@ -238,8 +239,8 @@ func findCounselingOffice(appCtx appcontext.AppContext, dutyLocationID uuid.UUID return officeList, nil } -func findOconusGblocDepartmentIndicator(appCtx appcontext.AppContext, dutyLocation models.DutyLocation) (*oconusGblocDepartmentIndicator, error) { - serviceMember, err := models.FetchServiceMember(appCtx.DB(), appCtx.Session().ServiceMemberID) +func findOconusGblocDepartmentIndicator(appCtx appcontext.AppContext, dutyLocation models.DutyLocation, serviceMemberID uuid.UUID) (*oconusGblocDepartmentIndicator, error) { + serviceMember, err := models.FetchServiceMember(appCtx.DB(), serviceMemberID) if err != nil { return nil, err } diff --git a/pkg/services/transportation_office/transportation_office_fetcher_test.go b/pkg/services/transportation_office/transportation_office_fetcher_test.go index 9ce5bab765c..7514868e12a 100644 --- a/pkg/services/transportation_office/transportation_office_fetcher_test.go +++ b/pkg/services/transportation_office/transportation_office_fetcher_test.go @@ -181,7 +181,16 @@ func (suite *TransportationOfficeServiceSuite) Test_FindCounselingOffices() { }, }, nil) - offices, err := findCounselingOffice(suite.AppContextForTest(), origDutyLocation.ID) + armyAffliation := models.AffiliationARMY + serviceMember := factory.BuildServiceMember(suite.DB(), []factory.Customization{ + { + Model: models.ServiceMember{ + Affiliation: &armyAffliation, + }, + }, + }, nil) + + offices, err := findCounselingOffice(suite.AppContextForTest(), origDutyLocation.ID, serviceMember.ID) suite.NoError(err) suite.Len(offices, 2) @@ -368,7 +377,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi ServiceMemberID: serviceMember.ID, }) suite.Nil(err) - departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation) + departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation, uuid.Nil) suite.NotNil(departmentIndictor) suite.Nil(err) suite.Nil(departmentIndictor.DepartmentIndicator) @@ -427,7 +436,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi ServiceMemberID: serviceMember.ID, }) suite.Nil(err) - departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation) + departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation, appCtx.Session().ServiceMemberID) suite.NotNil(departmentIndictor) suite.Nil(err) suite.NotNil(departmentIndictor.DepartmentIndicator) @@ -455,7 +464,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi ServiceMemberID: serviceMember.ID, }) suite.Nil(err) - departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation) + departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation, appCtx.Session().ServiceMemberID) suite.Nil(departmentIndictor) suite.NotNil(err) }) @@ -473,7 +482,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi }) suite.Nil(err) - departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation) + departmentIndictor, err := findOconusGblocDepartmentIndicator(appCtx, dutylocation, appCtx.Session().ServiceMemberID) suite.Nil(departmentIndictor) suite.NotNil(err) }) @@ -483,7 +492,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi ServiceMemberID: uuid.Must(uuid.NewV4()), }) unknown_duty_location_id := uuid.Must(uuid.NewV4()) - offices, err := findCounselingOffice(appCtx, unknown_duty_location_id) + offices, err := findCounselingOffice(appCtx, unknown_duty_location_id, appCtx.Session().ServiceMemberID) suite.Nil(offices) suite.NotNil(err) }) @@ -523,7 +532,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi }) suite.Nil(err) - offices, err := findCounselingOffice(appCtx, dutylocation.ID) + offices, err := findCounselingOffice(appCtx, dutylocation.ID, appCtx.Session().ServiceMemberID) suite.NotNil(offices) suite.Nil(err) suite.Equal(1, len(offices)) @@ -539,7 +548,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi }, }, }, nil) - offices, err = findCounselingOffice(appCtx, dutylocation.ID) + offices, err = findCounselingOffice(appCtx, dutylocation.ID, appCtx.Session().ServiceMemberID) suite.NotNil(offices) suite.Nil(err) suite.Equal(2, len(offices)) @@ -618,7 +627,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi appCtx := suite.AppContextWithSessionForTest(&auth.Session{ ServiceMemberID: serviceMember.ID, }) - offices, err := findCounselingOffice(appCtx, dutylocation.ID) + offices, err := findCounselingOffice(appCtx, dutylocation.ID, appCtx.Session().ServiceMemberID) suite.NotNil(offices) suite.Nil(err) suite.Equal(1, len(offices)) @@ -629,7 +638,7 @@ func (suite *TransportationOfficeServiceSuite) Test_Oconus_AK_FindCounselingOffi appCtx := suite.AppContextWithSessionForTest(&auth.Session{ ServiceMemberID: serviceMember.ID, }) - offices, err := findCounselingOffice(appCtx, dutylocation.ID) + offices, err := findCounselingOffice(appCtx, dutylocation.ID, uuid.Nil) suite.NotNil(offices) suite.Nil(err) suite.Equal(1, len(offices)) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx index 9adc7e94e43..a2c6be4ff4d 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.jsx @@ -1,4 +1,5 @@ import React, { useState, useEffect } from 'react'; +import { useParams } from 'react-router-dom'; import { Field, Formik } from 'formik'; import * as Yup from 'yup'; import { FormGroup, Label, Radio, Link as USWDSLink } from '@trussworks/react-uswds'; @@ -44,6 +45,7 @@ const AddOrdersForm = ({ const [isHasDependentsDisabled, setHasDependentsDisabled] = useState(false); const [prevOrderType, setPrevOrderType] = useState(''); const [filteredOrderTypeOptions, setFilteredOrderTypeOptions] = useState(ordersTypeOptions); + const { customerId: serviceMemberId } = useParams(); const validationSchema = Yup.object().shape({ ordersType: Yup.mixed() @@ -84,8 +86,8 @@ const AddOrdersForm = ({ }, []); useEffect(() => { - if (currentDutyLocation?.id) { - showCounselingOffices(currentDutyLocation.id).then((fetchedData) => { + if (currentDutyLocation?.id && serviceMemberId) { + showCounselingOffices(currentDutyLocation.id, serviceMemberId).then((fetchedData) => { if (fetchedData.body) { const counselingOffices = fetchedData.body.map((item) => ({ key: item.id, @@ -112,7 +114,7 @@ const AddOrdersForm = ({ setShowDependentAgeFields(false); } } - }, [currentDutyLocation, newDutyLocation, isOconusMove, hasDependents, enableUB]); + }, [currentDutyLocation, newDutyLocation, isOconusMove, hasDependents, enableUB, serviceMemberId]); useEffect(() => { const fetchData = async () => { diff --git a/src/services/ghcApi.js b/src/services/ghcApi.js index ccb69d56275..65218c1d9e3 100644 --- a/src/services/ghcApi.js +++ b/src/services/ghcApi.js @@ -763,8 +763,8 @@ export async function getGBLOCs() { return makeGHCRequest(operationPath, {}, { normalize: false }); } -export async function showCounselingOffices(dutyLocationId) { - return makeGHCRequestRaw('transportationOffice.showCounselingOffices', { dutyLocationId }); +export async function showCounselingOffices(dutyLocationId, serviceMemberId) { + return makeGHCRequestRaw('transportationOffice.showCounselingOffices', { dutyLocationId, serviceMemberId }); } export const reviewShipmentAddressUpdate = async ({ shipmentID, ifMatchETag, body }) => { diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index ce83f5c37dd..4cee2b29b33 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -4124,7 +4124,7 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' - /transportation_offices/{dutyLocationId}/counseling_offices: + /transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}: get: summary: Returns the counseling locations in the GBLOC matching the duty location description: Returns the counseling locations matching the GBLOC from the selected duty location @@ -4138,6 +4138,12 @@ paths: type: string required: true description: UUID of the duty location + - in: path + name: serviceMemberId + format: uuid + type: string + required: true + description: UUID of the service member, some counseling offices are branch specific produces: - application/json responses: @@ -4145,6 +4151,12 @@ paths: description: Successfully retrieved counseling offices schema: $ref: '#/definitions/CounselingOffices' + '400': + $ref: '#/responses/InvalidRequest' + '403': + $ref: '#/responses/PermissionDenied' + '404': + $ref: '#/responses/NotFound' '500': description: internal server error /uploads: diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 4d6b137b868..9b53612328b 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -4332,7 +4332,7 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' - /transportation_offices/{dutyLocationId}/counseling_offices: + /transportation_offices/{dutyLocationId}/counseling_offices/{serviceMemberId}: get: summary: Returns the counseling locations in the GBLOC matching the duty location description: >- @@ -4348,6 +4348,14 @@ paths: type: string required: true description: UUID of the duty location + - in: path + name: serviceMemberId + format: uuid + type: string + required: true + description: >- + UUID of the service member, some counseling offices are branch + specific produces: - application/json responses: @@ -4355,6 +4363,12 @@ paths: description: Successfully retrieved counseling offices schema: $ref: '#/definitions/CounselingOffices' + '400': + $ref: '#/responses/InvalidRequest' + '403': + $ref: '#/responses/PermissionDenied' + '404': + $ref: '#/responses/NotFound' '500': description: internal server error /uploads: From a47a09671674164944a6e597239c4a194f01841a Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Mon, 27 Jan 2025 18:52:21 +0000 Subject: [PATCH 109/229] slightly expand tests for counseling offices handlers --- pkg/handlers/ghcapi/transportation_offices_test.go | 3 ++- pkg/handlers/internalapi/transportation_offices_test.go | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/pkg/handlers/ghcapi/transportation_offices_test.go b/pkg/handlers/ghcapi/transportation_offices_test.go index 087c5c2d243..deef04cac31 100644 --- a/pkg/handlers/ghcapi/transportation_offices_test.go +++ b/pkg/handlers/ghcapi/transportation_offices_test.go @@ -151,6 +151,7 @@ func (suite *HandlerSuite) TestGetTransportationOfficesGBLOCsHandler() { func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { user := factory.BuildDefaultUser(suite.DB()) + serviceMember := factory.BuildServiceMember(suite.DB(), nil, nil) fetcher := transportationofficeservice.NewTransportationOfficesFetcher() @@ -182,7 +183,7 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { }, nil) suite.MustSave(&origDutyLocation) - path := fmt.Sprintf("/transportation_offices/%v/counseling_offices", origDutyLocation.ID.String()) + path := fmt.Sprintf("/transportation_offices/%v/counseling_offices/%v", origDutyLocation.ID.String(), serviceMember.ID.String()) req := httptest.NewRequest("GET", path, nil) req = suite.AuthenticateUserRequest(req, user) params := transportationofficeop.ShowCounselingOfficesParams{ diff --git a/pkg/handlers/internalapi/transportation_offices_test.go b/pkg/handlers/internalapi/transportation_offices_test.go index b41c5aff7bf..ec7bf6ff858 100644 --- a/pkg/handlers/internalapi/transportation_offices_test.go +++ b/pkg/handlers/internalapi/transportation_offices_test.go @@ -174,4 +174,13 @@ func (suite *HandlerSuite) TestShowCounselingOfficesHandler() { // Validate outgoing payload suite.NoError(responsePayload.Payload.Validate(strfmt.Default)) + // Validate outgoing payload + suite.NoError(responsePayload.Payload.Validate(strfmt.Default)) + var i int + for index, office := range responsePayload.Payload { + if *office.Name == "New PPPO Travis AFB - USAF" { + i = index + } + } + suite.NotNil(i) } From 284ad453e64177fb2cd5cb36edbc1d0d5b680480 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 13:30:19 -0600 Subject: [PATCH 110/229] updates --- pkg/notifications/move_counseled_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/move_counseled_test.go b/pkg/notifications/move_counseled_test.go index 11e1a417b85..c7d90ab77d6 100644 --- a/pkg/notifications/move_counseled_test.go +++ b/pkg/notifications/move_counseled_test.go @@ -292,8 +292,8 @@ func (suite *NotificationSuite) TestMoveCounseledHTMLTemplateRenderWithWeightRes expectedHTMLContent := `

    *** DO NOT REPLY directly to this email ***

    This is a confirmation that your counselor has approved move details for the assigned move code abc123 from origDutyLocation to destDutyLocation in the MilMove system.

    -

    What this means to you:

    Your move has been identified as going to an administratively restricted HHG weight location. Your weight restriction is 1500lbs. Be advised, you may be required to pay excess cost if you choose to move more than your weight restriction.

    +

    What this means to you:
    If you are doing a Personally Procured Move (PPM), you can start moving your personal property.

    Next steps for a PPM:

      From 07264da0191abb190903a8c68cbd407e9c8dbd53 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 13:52:04 -0600 Subject: [PATCH 111/229] add missing line to emaill test --- pkg/notifications/move_submitted_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/notifications/move_submitted_test.go b/pkg/notifications/move_submitted_test.go index 75c2c9c33b7..7717901dae0 100644 --- a/pkg/notifications/move_submitted_test.go +++ b/pkg/notifications/move_submitted_test.go @@ -387,7 +387,7 @@ func (suite *NotificationSuite) TestMoveSubmittedHTMLTemplateRenderWithoutGovCou

      Your standard weight allowance: 7,999 pounds. That is how much combined weight the government will pay for all movements between authorized locations under your - orders. + orders. Be advised, if you are moving to an administratively restricted HHG weight location this amount could be less.

      From af317d2dc212929cef59c53e5be71da786e658c2 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Mon, 27 Jan 2025 14:16:40 -0600 Subject: [PATCH 112/229] fix rendering --- .../AllowancesDetailForm/AllowancesDetailForm.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index ee3dc6f5b00..df75f8d9a90 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -46,12 +46,15 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab const handleAdminWeightLocationChange = (e) => { setIsAdminWeightLocationChecked(e.target.checked); if (!e.target.checked) { + // Find the weight restriction input and update both DOM and form state const weightRestrictionInput = document.querySelector('input[name="weightRestriction"]'); if (weightRestrictionInput) { weightRestrictionInput.value = '0'; - // Trigger change event to ensure form state is updated - const event = new Event('input', { bubbles: true }); - weightRestrictionInput.dispatchEvent(event); + // Create and dispatch both input and change events + const inputEvent = new Event('input', { bubbles: true }); + const changeEvent = new Event('change', { bubbles: true }); + weightRestrictionInput.dispatchEvent(inputEvent); + weightRestrictionInput.dispatchEvent(changeEvent); } } }; @@ -200,7 +203,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab label="Admin restricted weight location" isDisabled={formIsDisabled} onChange={handleAdminWeightLocationChange} - checked={entitlements?.weightRestriction > 0} + checked={isAdminWeightLocationChecked} />

{isAdminWeightLocationChecked && ( From 9e1b2bd5f5034e248a4946001285e060a765d9ba Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Mon, 27 Jan 2025 21:16:25 +0000 Subject: [PATCH 113/229] Fix for bg color --- .../ExpandableServiceItemRow.jsx | 9 +++++++-- .../ExpandableServiceItemRow.module.scss | 3 +++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx index bec330274b3..41e4295c642 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.jsx @@ -6,7 +6,7 @@ import classnames from 'classnames'; import styles from './ExpandableServiceItemRow.module.scss'; import { PAYMENT_SERVICE_ITEM_STATUS } from 'shared/constants'; -import { allowedServiceItemCalculations } from 'constants/serviceItems'; +import { allowedServiceItemCalculations, SERVICE_ITEM_CODES } from 'constants/serviceItems'; import { PaymentServiceItemShape } from 'types'; import { MTOServiceItemShape } from 'types/order'; import { toDollarString, formatCents, formatDollarFromMillicents } from 'utils/formatters'; @@ -44,6 +44,11 @@ const ExpandableServiceItemRow = ({ [styles.expandedDetail]: isExpanded, }); + const colSpan = + serviceItem.mtoServiceItemCode === SERVICE_ITEM_CODES.MS || serviceItem.mtoServiceItemCode === SERVICE_ITEM_CODES.CS + ? 4 + : 2; + return ( <>
+

Rejection Reason

diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss index eef510834fc..c6ce0d63ff3 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.module.scss @@ -3,6 +3,7 @@ @import 'shared/styles/colors'; .ExpandableServiceItemRow { + background-color: $bg-gray; .accepted { svg { @include u-margin-right(1); @@ -109,6 +110,8 @@ align-items: center; padding-left: 1rem; padding-bottom: 1rem; + padding-right: 1rem; + background-color: $bg-gray; svg { path { From 3548768a6a1396317dcb20b2d2b6c614902c034d Mon Sep 17 00:00:00 2001 From: JamesHawks224 <146897935+JamesHawks224@users.noreply.github.com> Date: Tue, 28 Jan 2025 04:26:05 +0000 Subject: [PATCH 114/229] code and test updates --- pkg/factory/mto_shipment_factory.go | 10 +- .../mto_shipment/shipment_approver_test.go | 158 ++++++++++++++++++ 2 files changed, 163 insertions(+), 5 deletions(-) diff --git a/pkg/factory/mto_shipment_factory.go b/pkg/factory/mto_shipment_factory.go index e08ccb3f3ba..86819917c97 100644 --- a/pkg/factory/mto_shipment_factory.go +++ b/pkg/factory/mto_shipment_factory.go @@ -63,7 +63,7 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization, defaultStatus = models.MTOShipmentStatusDraft buildStorageFacility = hasStorageFacilityCustom addPrimeActualWeight = false - shipmentHasPickupDetails = true + shipmentHasPickupDetails = false shipmentHasDeliveryDetails = true case mtoShipmentBuildBasic: setupPickupAndDelivery = false @@ -87,10 +87,6 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization, newMTOShipment.DestinationAddress = &newMTOShipment.StorageFacility.Address } - if newMTOShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTS && newMTOShipment.StorageFacility != nil { - newMTOShipment.PickupAddress = &newMTOShipment.StorageFacility.Address - } - if cMtoShipment.Status == models.MTOShipmentStatusApproved { approvedDate := time.Date(GHCTestYear, time.March, 20, 0, 0, 0, 0, time.UTC) newMTOShipment.ApprovedDate = &approvedDate @@ -107,6 +103,10 @@ func buildMTOShipmentWithBuildType(db *pop.Connection, customs []Customization, newMTOShipment.StorageFacilityID = &storageFacility.ID } + if newMTOShipment.ShipmentType == models.MTOShipmentTypeHHGOutOfNTS && newMTOShipment.StorageFacility != nil { + newMTOShipment.PickupAddress = &newMTOShipment.StorageFacility.Address + } + if addPrimeActualWeight { actualWeight := unit.Pound(980) newMTOShipment.PrimeActualWeight = &actualWeight diff --git a/pkg/services/mto_shipment/shipment_approver_test.go b/pkg/services/mto_shipment/shipment_approver_test.go index 4cccd78af4c..56a7f2efddf 100644 --- a/pkg/services/mto_shipment/shipment_approver_test.go +++ b/pkg/services/mto_shipment/shipment_approver_test.go @@ -473,6 +473,164 @@ func (suite *MTOShipmentServiceSuite) TestApproveShipment() { } }) + suite.Run("Given international mtoShipment is approved successfully pre-approved mtoServiceItems are created NTS-R CONUS to OCONUS", func() { + storageFacility := factory.BuildStorageFacility(suite.DB(), []factory.Customization{ + { + Model: models.StorageFacility{ + FacilityName: *models.StringPointer("Test Storage Name"), + Email: models.StringPointer("old@email.com"), + LotNumber: models.StringPointer("Test lot number"), + Phone: models.StringPointer("555-555-5555"), + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Des Moines", + State: "IA", + PostalCode: "50314", + IsOconus: models.BoolPointer(false), + }, + }, + }, nil) + + internationalShipment := factory.BuildNTSRShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVED, + }, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "Anchorage", + State: "AK", + PostalCode: "99507", + IsOconus: models.BoolPointer(true), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + Status: models.MTOShipmentStatusSubmitted, + ShipmentType: models.MTOShipmentTypeHHGOutOfNTS, + }, + }, + { + Model: storageFacility, + LinkOnly: true, + }, + }, nil) + internationalShipmentEtag := etag.GenerateEtag(internationalShipment.UpdatedAt) + + shipmentRouter := NewShipmentRouter() + var serviceItemCreator services.MTOServiceItemCreator + var planner route.Planner + var moveWeights services.MoveWeights + + // Approve international shipment + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + _, err := shipmentApprover.ApproveShipment(suite.AppContextForTest(), internationalShipment.ID, internationalShipmentEtag) + suite.NoError(err) + + // Get created pre approved service items + var serviceItems []models.MTOServiceItem + err2 := suite.AppContextForTest().DB().EagerPreload("ReService").Where("mto_shipment_id = ?", internationalShipment.ID).Order("created_at asc").All(&serviceItems) + suite.NoError(err2) + + expectedReserviceCodes := []models.ReServiceCode{ + models.ReServiceCodeISLH, + models.ReServiceCodePOEFSC, + models.ReServiceCodeIHUPK, + } + + suite.Equal(len(expectedReserviceCodes), len(serviceItems)) + for i := 0; i < len(serviceItems); i++ { + actualReServiceCode := serviceItems[i].ReService.Code + suite.True(slices.Contains(expectedReserviceCodes, actualReServiceCode)) + } + }) + + suite.Run("Given international mtoShipment is approved successfully pre-approved mtoServiceItems are created NTS-R OCONUS to CONUS", func() { + storageFacility := factory.BuildStorageFacility(suite.DB(), []factory.Customization{ + { + Model: models.StorageFacility{ + FacilityName: *models.StringPointer("Test Storage Name"), + Email: models.StringPointer("old@email.com"), + LotNumber: models.StringPointer("Test lot number"), + Phone: models.StringPointer("555-555-5555"), + }, + }, + { + Model: models.Address{ + StreetAddress1: "JBER", + City: "Anchorage", + State: "AK", + PostalCode: "99507", + IsOconus: models.BoolPointer(true), + }, + }, + }, nil) + + internationalShipment := factory.BuildNTSRShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVED, + }, + }, + { + Model: models.Address{ + StreetAddress1: "Tester Address", + City: "Des Moines", + State: "IA", + PostalCode: "50314", + IsOconus: models.BoolPointer(false), + }, + Type: &factory.Addresses.DeliveryAddress, + }, + { + Model: models.MTOShipment{ + MarketCode: models.MarketCodeInternational, + Status: models.MTOShipmentStatusSubmitted, + ShipmentType: models.MTOShipmentTypeHHGOutOfNTS, + }, + }, + { + Model: storageFacility, + LinkOnly: true, + }, + }, nil) + internationalShipmentEtag := etag.GenerateEtag(internationalShipment.UpdatedAt) + + shipmentRouter := NewShipmentRouter() + var serviceItemCreator services.MTOServiceItemCreator + var planner route.Planner + var moveWeights services.MoveWeights + + // Approve international shipment + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + _, err := shipmentApprover.ApproveShipment(suite.AppContextForTest(), internationalShipment.ID, internationalShipmentEtag) + suite.NoError(err) + + // Get created pre approved service items + var serviceItems []models.MTOServiceItem + err2 := suite.AppContextForTest().DB().EagerPreload("ReService").Where("mto_shipment_id = ?", internationalShipment.ID).Order("created_at asc").All(&serviceItems) + suite.NoError(err2) + + expectedReserviceCodes := []models.ReServiceCode{ + models.ReServiceCodeISLH, + models.ReServiceCodePODFSC, + models.ReServiceCodeIHUPK, + } + + suite.Equal(len(expectedReserviceCodes), len(serviceItems)) + for i := 0; i < len(serviceItems); i++ { + actualReServiceCode := serviceItems[i].ReService.Code + suite.True(slices.Contains(expectedReserviceCodes, actualReServiceCode)) + } + }) + suite.Run("If the mtoShipment is approved successfully it should create approved mtoServiceItems", func() { subtestData := suite.createApproveShipmentSubtestData() appCtx := subtestData.appCtx From ff83d5940b2dd3977ec81d032040566a7a227cf8 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Tue, 28 Jan 2025 08:00:29 -0700 Subject: [PATCH 115/229] bug fixes for assignment --- pkg/gen/ghcapi/embedded_spec.go | 36 ++++++++++ .../queues/get_moves_queue_parameters.go | 27 +++++++ .../queues/get_moves_queue_urlbuilder.go | 9 +++ .../get_payment_requests_queue_parameters.go | 27 +++++++ .../get_payment_requests_queue_urlbuilder.go | 9 +++ ...et_services_counseling_queue_parameters.go | 27 +++++++ ...et_services_counseling_queue_urlbuilder.go | 9 +++ .../internal/payloads/model_to_payload.go | 70 +++++++++++-------- .../payloads/model_to_payload_test.go | 11 +-- pkg/handlers/ghcapi/queues.go | 21 +++++- src/components/Table/TableQueue.jsx | 1 + src/hooks/queries.js | 12 ++-- .../HeadquartersQueues/HeadquartersQueues.jsx | 6 +- src/pages/Office/MoveQueue/MoveQueue.jsx | 3 +- .../PaymentRequestQueue.jsx | 3 +- .../ServicesCounselingQueue.jsx | 3 + src/pages/Office/index.jsx | 20 ++++-- src/services/ghcApi.js | 42 +++++++++-- swagger-def/ghc.yaml | 12 ++++ swagger/ghc.yaml | 12 ++++ 20 files changed, 304 insertions(+), 56 deletions(-) diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 3db3ec66e71..66ce57b95a4 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -4617,6 +4617,12 @@ func init() { "description": "Used to illustrate which user is assigned to this payment request.\n", "name": "assignedTo", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { @@ -4820,6 +4826,12 @@ func init() { "description": "filters using a counselingOffice name of the move", "name": "counselingOffice", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { @@ -4974,6 +4986,12 @@ func init() { "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", "name": "viewAsGBLOC", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { @@ -21265,6 +21283,12 @@ func init() { "description": "Used to illustrate which user is assigned to this payment request.\n", "name": "assignedTo", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { @@ -21480,6 +21504,12 @@ func init() { "description": "filters using a counselingOffice name of the move", "name": "counselingOffice", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { @@ -21640,6 +21670,12 @@ func init() { "description": "Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment.\n", "name": "viewAsGBLOC", "in": "query" + }, + { + "type": "string", + "description": "user's actively logged in role", + "name": "activeRole", + "in": "query" } ], "responses": { diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go index f1cfe32cfae..2123cc801d9 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_parameters.go @@ -34,6 +34,10 @@ type GetMovesQueueParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` + /*user's actively logged in role + In: query + */ + ActiveRole *string /* In: query */ @@ -124,6 +128,11 @@ func (o *GetMovesQueueParams) BindRequest(r *http.Request, route *middleware.Mat qs := runtime.Values(r.URL.Query()) + qActiveRole, qhkActiveRole, _ := qs.GetOK("activeRole") + if err := o.bindActiveRole(qActiveRole, qhkActiveRole, route.Formats); err != nil { + res = append(res, err) + } + qAppearedInTooAt, qhkAppearedInTooAt, _ := qs.GetOK("appearedInTooAt") if err := o.bindAppearedInTooAt(qAppearedInTooAt, qhkAppearedInTooAt, route.Formats); err != nil { res = append(res, err) @@ -219,6 +228,24 @@ func (o *GetMovesQueueParams) BindRequest(r *http.Request, route *middleware.Mat return nil } +// bindActiveRole binds and validates parameter ActiveRole from query. +func (o *GetMovesQueueParams) bindActiveRole(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ActiveRole = &raw + + return nil +} + // bindAppearedInTooAt binds and validates parameter AppearedInTooAt from query. func (o *GetMovesQueueParams) bindAppearedInTooAt(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go index ec05a50a3eb..7d809005df8 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_moves_queue_urlbuilder.go @@ -16,6 +16,7 @@ import ( // GetMovesQueueURL generates an URL for the get moves queue operation type GetMovesQueueURL struct { + ActiveRole *string AppearedInTooAt *strfmt.DateTime AssignedTo *string Branch *string @@ -69,6 +70,14 @@ func (o *GetMovesQueueURL) Build() (*url.URL, error) { qs := make(url.Values) + var activeRoleQ string + if o.ActiveRole != nil { + activeRoleQ = *o.ActiveRole + } + if activeRoleQ != "" { + qs.Set("activeRole", activeRoleQ) + } + var appearedInTooAtQ string if o.AppearedInTooAt != nil { appearedInTooAtQ = o.AppearedInTooAt.String() diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go index fe0d201031e..423c3f7eaa6 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_parameters.go @@ -34,6 +34,10 @@ type GetPaymentRequestsQueueParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` + /*user's actively logged in role + In: query + */ + ActiveRole *string /*Used to illustrate which user is assigned to this payment request. In: query @@ -118,6 +122,11 @@ func (o *GetPaymentRequestsQueueParams) BindRequest(r *http.Request, route *midd qs := runtime.Values(r.URL.Query()) + qActiveRole, qhkActiveRole, _ := qs.GetOK("activeRole") + if err := o.bindActiveRole(qActiveRole, qhkActiveRole, route.Formats); err != nil { + res = append(res, err) + } + qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { res = append(res, err) @@ -208,6 +217,24 @@ func (o *GetPaymentRequestsQueueParams) BindRequest(r *http.Request, route *midd return nil } +// bindActiveRole binds and validates parameter ActiveRole from query. +func (o *GetPaymentRequestsQueueParams) bindActiveRole(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ActiveRole = &raw + + return nil +} + // bindAssignedTo binds and validates parameter AssignedTo from query. func (o *GetPaymentRequestsQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go index 1b5aa0e8b3b..45ac4629c59 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_payment_requests_queue_urlbuilder.go @@ -16,6 +16,7 @@ import ( // GetPaymentRequestsQueueURL generates an URL for the get payment requests queue operation type GetPaymentRequestsQueueURL struct { + ActiveRole *string AssignedTo *string Branch *string CounselingOffice *string @@ -68,6 +69,14 @@ func (o *GetPaymentRequestsQueueURL) Build() (*url.URL, error) { qs := make(url.Values) + var activeRoleQ string + if o.ActiveRole != nil { + activeRoleQ = *o.ActiveRole + } + if activeRoleQ != "" { + qs.Set("activeRole", activeRoleQ) + } + var assignedToQ string if o.AssignedTo != nil { assignedToQ = *o.AssignedTo diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go index 2b03f53918f..3f596c1f60c 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_parameters.go @@ -34,6 +34,10 @@ type GetServicesCounselingQueueParams struct { // HTTP Request Object HTTPRequest *http.Request `json:"-"` + /*user's actively logged in role + In: query + */ + ActiveRole *string /*Used to illustrate which user is assigned to this payment request. In: query @@ -148,6 +152,11 @@ func (o *GetServicesCounselingQueueParams) BindRequest(r *http.Request, route *m qs := runtime.Values(r.URL.Query()) + qActiveRole, qhkActiveRole, _ := qs.GetOK("activeRole") + if err := o.bindActiveRole(qActiveRole, qhkActiveRole, route.Formats); err != nil { + res = append(res, err) + } + qAssignedTo, qhkAssignedTo, _ := qs.GetOK("assignedTo") if err := o.bindAssignedTo(qAssignedTo, qhkAssignedTo, route.Formats); err != nil { res = append(res, err) @@ -273,6 +282,24 @@ func (o *GetServicesCounselingQueueParams) BindRequest(r *http.Request, route *m return nil } +// bindActiveRole binds and validates parameter ActiveRole from query. +func (o *GetServicesCounselingQueueParams) bindActiveRole(rawData []string, hasKey bool, formats strfmt.Registry) error { + var raw string + if len(rawData) > 0 { + raw = rawData[len(rawData)-1] + } + + // Required: false + // AllowEmptyValue: false + + if raw == "" { // empty values pass all other validations + return nil + } + o.ActiveRole = &raw + + return nil +} + // bindAssignedTo binds and validates parameter AssignedTo from query. func (o *GetServicesCounselingQueueParams) bindAssignedTo(rawData []string, hasKey bool, formats strfmt.Registry) error { var raw string diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go index d7ad7668c07..b013d4b0089 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_services_counseling_queue_urlbuilder.go @@ -16,6 +16,7 @@ import ( // GetServicesCounselingQueueURL generates an URL for the get services counseling queue operation type GetServicesCounselingQueueURL struct { + ActiveRole *string AssignedTo *string Branch *string CloseoutInitiated *strfmt.DateTime @@ -75,6 +76,14 @@ func (o *GetServicesCounselingQueueURL) Build() (*url.URL, error) { qs := make(url.Values) + var activeRoleQ string + if o.ActiveRole != nil { + activeRoleQ = *o.ActiveRole + } + if activeRoleQ != "" { + qs.Set("activeRole", activeRoleQ) + } + var assignedToQ string if o.AssignedTo != nil { assignedToQ = *o.AssignedTo diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index f97ea101fc0..09ae933d70b 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2181,12 +2181,12 @@ func BulkAssignmentData(appCtx appcontext.AppContext, moves []models.MoveWithEar return *bulkAssignmentData } -func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.AssignedOfficeUser, isCloseoutQueue bool, officeUser models.OfficeUser, ppmCloseoutGblocs bool) bool { +func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.AssignedOfficeUser, isCloseoutQueue bool, officeUser models.OfficeUser, ppmCloseoutGblocs bool, activeRole string) bool { // default to false isAssignable := false // HQ role is read only - if officeUser.User.Roles.HasRole(roles.RoleTypeHQ) { + if activeRole == string(roles.RoleTypeHQ) { isAssignable = false return isAssignable } @@ -2198,13 +2198,13 @@ func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.Assigne isSupervisor := officeUser.User.Privileges.HasPrivilege(models.PrivilegeTypeSupervisor) // in TOO queues, all moves are assignable for supervisor users - if officeUser.User.Roles.HasRole(roles.RoleTypeTOO) && isSupervisor { + if activeRole == string(roles.RoleTypeTOO) && isSupervisor { isAssignable = true } // if it is assigned in the SCs queue // it is only assignable if the user is a supervisor... - if officeUser.User.Roles.HasRole(roles.RoleTypeServicesCounselor) && isSupervisor { + if activeRole == string(roles.RoleTypeServicesCounselor) && isSupervisor { // AND we are in the counseling queue AND the move's counseling office is the supervisor's transportation office if !isCloseoutQueue && move.CounselingOfficeID != nil && *move.CounselingOfficeID == officeUser.TransportationOfficeID { isAssignable = true @@ -2224,35 +2224,36 @@ func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.Assigne } func servicesCounselorAvailableOfficeUsers(move models.Move, officeUsers []models.OfficeUser, officeUser models.OfficeUser, ppmCloseoutGblocs bool, isCloseoutQueue bool) []models.OfficeUser { - if officeUser.User.Roles.HasRole(roles.RoleTypeServicesCounselor) { - // if the office user currently assigned to the move works outside of the logged in users counseling office - // add them to the set - if move.SCAssignedUser != nil && move.SCAssignedUser.TransportationOfficeID != officeUser.TransportationOfficeID { - officeUsers = append(officeUsers, *move.SCAssignedUser) - } + // if the office user currently assigned to the move works outside of the logged in users counseling office + // add them to the set + if move.SCAssignedUser != nil && move.SCAssignedUser.TransportationOfficeID != officeUser.TransportationOfficeID { + officeUsers = append(officeUsers, *move.SCAssignedUser) + } - // if there is no counseling office - // OR if our current user doesn't work at the move's counseling office - // only available user should be themself - if !isCloseoutQueue && (move.CounselingOfficeID == nil) || (move.CounselingOfficeID != nil && *move.CounselingOfficeID != officeUser.TransportationOfficeID) { - officeUsers = models.OfficeUsers{officeUser} - } + var onlySelfAssign bool - // if its the closeout queue and its not a Navy, Marine, or Coast Guard user - // and the move doesn't have a closeout office - // OR the move's closeout office is not the office users office - // only available user should be themself - if isCloseoutQueue && !ppmCloseoutGblocs && move.CloseoutOfficeID == nil || (move.CloseoutOfficeID != nil && *move.CloseoutOfficeID != officeUser.TransportationOfficeID) { - officeUsers = models.OfficeUsers{officeUser} + // if there is no counseling office + // OR if our current user doesn't work at the move's counseling office + // only available user should be themself + onlySelfAssign = (move.CounselingOfficeID == nil) || (move.CounselingOfficeID != nil && *move.CounselingOfficeID != officeUser.TransportationOfficeID) + if !isCloseoutQueue && onlySelfAssign { + officeUsers = models.OfficeUsers{officeUser} + } - } + // if its the closeout queue and its not a Navy, Marine, or Coast Guard user + // and the move doesn't have a closeout office + // OR the move's closeout office is not the office users office + // only available user should be themself + onlySelfAssign = (move.CloseoutOfficeID == nil) || (move.CloseoutOfficeID != nil && *move.CloseoutOfficeID != officeUser.TransportationOfficeID) + if isCloseoutQueue && !ppmCloseoutGblocs && onlySelfAssign { + officeUsers = models.OfficeUsers{officeUser} } return officeUsers } // QueueMoves payload -func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedPpmStatus *models.PPMShipmentStatus, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser) *ghcmessages.QueueMoves { +func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedPpmStatus *models.PPMShipmentStatus, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser, activeRole string) *ghcmessages.QueueMoves { queueMoves := make(ghcmessages.QueueMoves, len(moves)) for i, move := range moves { customer := move.Orders.ServiceMember @@ -2324,10 +2325,10 @@ func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedP // determine if there is an assigned user var assignedToUser *ghcmessages.AssignedOfficeUser - if officeUser.User.Roles.HasRole(roles.RoleTypeServicesCounselor) && move.SCAssignedUser != nil { + if activeRole == string(roles.RoleTypeServicesCounselor) && move.SCAssignedUser != nil { assignedToUser = AssignedOfficeUser(move.SCAssignedUser) } - if officeUser.User.Roles.HasRole(roles.RoleTypeTOO) && move.TOOAssignedUser != nil { + if activeRole == string(roles.RoleTypeTOO) && move.TOOAssignedUser != nil { assignedToUser = AssignedOfficeUser(move.TOOAssignedUser) } @@ -2336,7 +2337,7 @@ func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedP // requestedPpmStatus also represents if we are viewing the closeout queue isCloseoutQueue := requestedPpmStatus != nil && *requestedPpmStatus == models.PPMShipmentStatusNeedsCloseout // determine if the move is assignable - assignable := queueMoveIsAssignable(move, assignedToUser, isCloseoutQueue, officeUser, ppmCloseoutGblocs) + assignable := queueMoveIsAssignable(move, assignedToUser, isCloseoutQueue, officeUser, ppmCloseoutGblocs, activeRole) isSupervisor := officeUser.User.Privileges.HasPrivilege(models.PrivilegeTypeSupervisor) // only need to attach available office users if move is assignable @@ -2348,7 +2349,16 @@ func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedP if isSupervisor && move.Orders.OrdersType == "SAFETY" { availableOfficeUsers = officeUsersSafety } - if officeUser.User.Roles.HasRole(roles.RoleTypeServicesCounselor) { + + // if the assigned user does not work at the logged in users transportation office + // append them to the office users + if activeRole == string(roles.RoleTypeTOO) { + if move.TOOAssignedUser != nil && move.TOOAssignedUser.TransportationOfficeID != officeUser.TransportationOfficeID { + availableOfficeUsers = append(availableOfficeUsers, *move.TOOAssignedUser) + } + } + + if activeRole == string(roles.RoleTypeServicesCounselor) { availableOfficeUsers = servicesCounselorAvailableOfficeUsers(move, availableOfficeUsers, officeUser, ppmCloseoutGblocs, isCloseoutQueue) } @@ -2449,7 +2459,7 @@ func queuePaymentRequestStatus(paymentRequest models.PaymentRequest) string { } // QueuePaymentRequests payload -func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers []models.OfficeUser, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser) *ghcmessages.QueuePaymentRequests { +func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers []models.OfficeUser, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser, activeRole string) *ghcmessages.QueuePaymentRequests { queuePaymentRequests := make(ghcmessages.QueuePaymentRequests, len(*paymentRequests)) @@ -2494,7 +2504,7 @@ func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers [ isAssignable = true } - if officeUser.User.Roles.HasRole(roles.RoleTypeHQ) { + if activeRole == string(roles.RoleTypeHQ) { isAssignable = false } diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go index 657f980e910..1557803e06d 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload_test.go @@ -195,7 +195,8 @@ func (suite *PayloadsSuite) TestPaymentRequestQueue() { var officeUsers models.OfficeUsers var officeUsersSafety models.OfficeUsers officeUsers = append(officeUsers, officeUser) - var paymentRequestsQueue = QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety) + activeRole := string(roles.RoleTypeTIO) + var paymentRequestsQueue = QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety, activeRole) suite.Run("Test Payment request is assignable due to not being assigend", func() { paymentRequestCopy := *paymentRequestsQueue @@ -214,7 +215,7 @@ func (suite *PayloadsSuite) TestPaymentRequestQueue() { paymentRequests[0].MoveTaskOrder.TIOAssignedUser = &officeUserTIO paymentRequests[0].MoveTaskOrder.CounselingOffice = &transportationOffice - paymentRequestsQueue = QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety) + paymentRequestsQueue = QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety, activeRole) suite.Run("Test PaymentRequest has both Counseling Office and TIO AssignedUser ", func() { PaymentRequestsCopy := *paymentRequestsQueue @@ -228,14 +229,14 @@ func (suite *PayloadsSuite) TestPaymentRequestQueue() { }) suite.Run("Test PaymentRequest is assignable due to user Supervisor role", func() { - paymentRequests := QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety) + paymentRequests := QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety, activeRole) paymentRequestCopy := *paymentRequests suite.Equal(paymentRequestCopy[0].Assignable, true) }) - officeUserHQ := factory.BuildOfficeUserWithRoles(suite.DB(), nil, []roles.RoleType{roles.RoleTypeHQ}) + activeRole = string(roles.RoleTypeHQ) suite.Run("Test PaymentRequest is not assignable due to user HQ role", func() { - paymentRequests := QueuePaymentRequests(&paymentRequests, officeUsers, officeUserHQ, officeUsersSafety) + paymentRequests := QueuePaymentRequests(&paymentRequests, officeUsers, officeUser, officeUsersSafety, activeRole) paymentRequestCopy := *paymentRequests suite.Equal(paymentRequestCopy[0].Assignable, false) }) diff --git a/pkg/handlers/ghcapi/queues.go b/pkg/handlers/ghcapi/queues.go index ed4980df650..03f4129aa05 100644 --- a/pkg/handlers/ghcapi/queues.go +++ b/pkg/handlers/ghcapi/queues.go @@ -64,6 +64,11 @@ func (h GetMovesQueueHandler) Handle(params queues.GetMovesQueueParams) middlewa CounselingOffice: params.CounselingOffice, } + var activeRole string + if params.ActiveRole != nil { + activeRole = *params.ActiveRole + } + // When no status filter applied, TOO should only see moves with status of New Move, Service Counseling Completed, or Approvals Requested if params.Status == nil { ListOrderParams.Status = []string{string(models.MoveStatusServiceCounselingCompleted), string(models.MoveStatusAPPROVALSREQUESTED), string(models.MoveStatusSUBMITTED)} @@ -165,7 +170,7 @@ func (h GetMovesQueueHandler) Handle(params queues.GetMovesQueueParams) middlewa } } - queueMoves := payloads.QueueMoves(moves, officeUsers, nil, officeUser, officeUsersSafety) + queueMoves := payloads.QueueMoves(moves, officeUsers, nil, officeUser, officeUsersSafety, activeRole) result := &ghcmessages.QueueMovesResult{ Page: *ListOrderParams.Page, @@ -271,6 +276,11 @@ func (h GetPaymentRequestsQueueHandler) Handle( CounselingOffice: params.CounselingOffice, } + var activeRole string + if params.ActiveRole != nil { + activeRole = *params.ActiveRole + } + listPaymentRequestParams.Status = []string{string(models.QueuePaymentRequestPaymentRequested)} // Let's set default values for page and perPage if we don't get arguments for them. We'll use 1 for page and 20 @@ -368,7 +378,7 @@ func (h GetPaymentRequestsQueueHandler) Handle( } } - queuePaymentRequests := payloads.QueuePaymentRequests(paymentRequests, officeUsers, officeUser, officeUsersSafety) + queuePaymentRequests := payloads.QueuePaymentRequests(paymentRequests, officeUsers, officeUser, officeUsersSafety, activeRole) result := &ghcmessages.QueuePaymentRequestsResult{ TotalCount: int64(count), @@ -429,6 +439,11 @@ func (h GetServicesCounselingQueueHandler) Handle( SCAssignedUser: params.AssignedTo, } + var activeRole string + if params.ActiveRole != nil { + activeRole = *params.ActiveRole + } + var requestedPpmStatus models.PPMShipmentStatus if params.NeedsPPMCloseout != nil && *params.NeedsPPMCloseout { requestedPpmStatus = models.PPMShipmentStatusNeedsCloseout @@ -538,7 +553,7 @@ func (h GetServicesCounselingQueueHandler) Handle( } } - queueMoves := payloads.QueueMoves(moves, officeUsers, &requestedPpmStatus, officeUser, officeUsersSafety) + queueMoves := payloads.QueueMoves(moves, officeUsers, &requestedPpmStatus, officeUser, officeUsersSafety, activeRole) result := &ghcmessages.QueueMovesResult{ Page: *ListOrderParams.Page, diff --git a/src/components/Table/TableQueue.jsx b/src/components/Table/TableQueue.jsx index d657df5007f..32e13cfc75f 100644 --- a/src/components/Table/TableQueue.jsx +++ b/src/components/Table/TableQueue.jsx @@ -125,6 +125,7 @@ const TableQueue = ({ currentPage, currentPageSize, viewAsGBLOC: selectedGbloc, + activeRole, }); // react-table setup below diff --git a/src/hooks/queries.js b/src/hooks/queries.js index ce469702359..17ccfe30f5a 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -571,9 +571,10 @@ export const useMovesQueueQueries = ({ currentPage = PAGINATION_PAGE_DEFAULT, currentPageSize = PAGINATION_PAGE_SIZE_DEFAULT, viewAsGBLOC, + activeRole, }) => { const { data = {}, ...movesQueueQuery } = useQuery( - [MOVES_QUEUE, { sort, order, filters, currentPage, currentPageSize, viewAsGBLOC }], + [MOVES_QUEUE, { sort, order, filters, currentPage, currentPageSize, viewAsGBLOC, activeRole }], ({ queryKey }) => getMovesQueue(...queryKey), ); const { isLoading, isError, isSuccess } = movesQueueQuery; @@ -593,11 +594,12 @@ export const useServicesCounselingQueuePPMQueries = ({ currentPage = PAGINATION_PAGE_DEFAULT, currentPageSize = PAGINATION_PAGE_SIZE_DEFAULT, viewAsGBLOC, + activeRole, }) => { const { data = {}, ...servicesCounselingQueueQuery } = useQuery( [ SERVICES_COUNSELING_QUEUE, - { sort, order, filters, currentPage, currentPageSize, needsPPMCloseout: true, viewAsGBLOC }, + { sort, order, filters, currentPage, currentPageSize, needsPPMCloseout: true, viewAsGBLOC, activeRole }, ], ({ queryKey }) => getServicesCounselingPPMQueue(...queryKey), ); @@ -619,11 +621,12 @@ export const useServicesCounselingQueueQueries = ({ currentPage = PAGINATION_PAGE_DEFAULT, currentPageSize = PAGINATION_PAGE_SIZE_DEFAULT, viewAsGBLOC, + activeRole, }) => { const { data = {}, ...servicesCounselingQueueQuery } = useQuery( [ SERVICES_COUNSELING_QUEUE, - { sort, order, filters, currentPage, currentPageSize, needsPPMCloseout: false, viewAsGBLOC }, + { sort, order, filters, currentPage, currentPageSize, needsPPMCloseout: false, viewAsGBLOC, activeRole }, ], ({ queryKey }) => getServicesCounselingQueue(...queryKey), ); @@ -645,9 +648,10 @@ export const usePaymentRequestQueueQueries = ({ currentPage = PAGINATION_PAGE_DEFAULT, currentPageSize = PAGINATION_PAGE_SIZE_DEFAULT, viewAsGBLOC, + activeRole, }) => { const { data = {}, ...paymentRequestsQueueQuery } = useQuery( - [PAYMENT_REQUESTS_QUEUE, { sort, order, filters, currentPage, currentPageSize, viewAsGBLOC }], + [PAYMENT_REQUESTS_QUEUE, { sort, order, filters, currentPage, currentPageSize, viewAsGBLOC, activeRole }], ({ queryKey }) => getPaymentRequestsQueue(...queryKey), ); diff --git a/src/pages/Office/HeadquartersQueues/HeadquartersQueues.jsx b/src/pages/Office/HeadquartersQueues/HeadquartersQueues.jsx index 1786b4525ff..c9d08481f3b 100644 --- a/src/pages/Office/HeadquartersQueues/HeadquartersQueues.jsx +++ b/src/pages/Office/HeadquartersQueues/HeadquartersQueues.jsx @@ -38,7 +38,7 @@ import { milmoveLogger } from 'utils/milmoveLog'; import ConnectedFlashMessage from 'containers/FlashMessage/FlashMessage'; import CustomerSearchForm from 'components/CustomerSearchForm/CustomerSearchForm'; -const HeadquartersQueue = ({ isQueueManagementFFEnabled }) => { +const HeadquartersQueue = ({ isQueueManagementFFEnabled, activeRole }) => { const navigate = useNavigate(); const { queueType } = useParams(); const [search, setSearch] = useState({ moveCode: null, dodID: null, customerName: null, paymentRequestCode: null }); @@ -247,6 +247,7 @@ const HeadquartersQueue = ({ isQueueManagementFFEnabled }) => { csvExportQueueFetcher={getMovesQueue} csvExportQueueFetcherKey="queueMoves" sessionStorageKey={queueType} + activeRole={activeRole} />
); @@ -273,6 +274,7 @@ const HeadquartersQueue = ({ isQueueManagementFFEnabled }) => { csvExportQueueFetcher={getPaymentRequestsQueue} csvExportQueueFetcherKey="queuePaymentRequests" sessionStorageKey={queueType} + activeRole={activeRole} /> ); @@ -299,6 +301,7 @@ const HeadquartersQueue = ({ isQueueManagementFFEnabled }) => { csvExportQueueFetcher={getServicesCounselingPPMQueue} csvExportQueueFetcherKey="queueMoves" sessionStorageKey={queueType} + activeRole={activeRole} /> ); @@ -326,6 +329,7 @@ const HeadquartersQueue = ({ isQueueManagementFFEnabled }) => { csvExportQueueFetcher={getServicesCounselingQueue} csvExportQueueFetcherKey="queueMoves" sessionStorageKey={queueType} + activeRole={activeRole} /> ); diff --git a/src/pages/Office/MoveQueue/MoveQueue.jsx b/src/pages/Office/MoveQueue/MoveQueue.jsx index 95b703189fc..12d42ac5d22 100644 --- a/src/pages/Office/MoveQueue/MoveQueue.jsx +++ b/src/pages/Office/MoveQueue/MoveQueue.jsx @@ -188,7 +188,7 @@ export const columns = (moveLockFlag, isQueueManagementEnabled, showBranchFilter return cols; }; -const MoveQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBulkAssignmentFFEnabled }) => { +const MoveQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBulkAssignmentFFEnabled, activeRole }) => { const navigate = useNavigate(); const { queueType } = useParams(); const [search, setSearch] = useState({ moveCode: null, dodID: null, customerName: null, paymentRequestCode: null }); @@ -334,6 +334,7 @@ const MoveQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBulkAssignmen key={queueType} isSupervisor={supervisor} isBulkAssignmentFFEnabled={isBulkAssignmentFFEnabled} + activeRole={activeRole} /> ); diff --git a/src/pages/Office/PaymentRequestQueue/PaymentRequestQueue.jsx b/src/pages/Office/PaymentRequestQueue/PaymentRequestQueue.jsx index a46518a2627..c43cf7bfbe6 100644 --- a/src/pages/Office/PaymentRequestQueue/PaymentRequestQueue.jsx +++ b/src/pages/Office/PaymentRequestQueue/PaymentRequestQueue.jsx @@ -191,7 +191,7 @@ export const columns = (moveLockFlag, isQueueManagementEnabled, showBranchFilter return cols; }; -const PaymentRequestQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBulkAssignmentFFEnabled }) => { +const PaymentRequestQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBulkAssignmentFFEnabled, activeRole }) => { const { queueType } = useParams(); const navigate = useNavigate(); const [search, setSearch] = useState({ moveCode: null, dodID: null, customerName: null, paymentRequestCode: null }); @@ -334,6 +334,7 @@ const PaymentRequestQueue = ({ isQueueManagementFFEnabled, userPrivileges, isBul key={queueType} isSupervisor={supervisor} isBulkAssignmentFFEnabled={isBulkAssignmentFFEnabled} + activeRole={activeRole} /> ); diff --git a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx index 44b11a5567d..5ba55412a60 100644 --- a/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx +++ b/src/pages/Office/ServicesCounselingQueue/ServicesCounselingQueue.jsx @@ -433,6 +433,7 @@ const ServicesCounselingQueue = ({ isQueueManagementFFEnabled, officeUser, isBulkAssignmentFFEnabled, + activeRole, }) => { const { queueType } = useParams(); const { data, isLoading, isError } = useUserQueries(); @@ -670,6 +671,7 @@ const ServicesCounselingQueue = ({ key={queueType} isSupervisor={supervisor} isBulkAssignmentFFEnabled={isBulkAssignmentFFEnabled} + activeRole={activeRole} /> ); @@ -699,6 +701,7 @@ const ServicesCounselingQueue = ({ key={queueType} isSupervisor={supervisor} isBulkAssignmentFFEnabled={isBulkAssignmentFFEnabled} + activeRole={activeRole} /> ); diff --git a/src/pages/Office/index.jsx b/src/pages/Office/index.jsx index 8a945c4c7f8..69f55fbf90c 100644 --- a/src/pages/Office/index.jsx +++ b/src/pages/Office/index.jsx @@ -292,7 +292,7 @@ export class OfficeApp extends Component { end element={ - + } /> @@ -301,7 +301,10 @@ export class OfficeApp extends Component { path="/invoicing/queue" element={ - + } /> @@ -311,7 +314,10 @@ export class OfficeApp extends Component { end element={ - + } /> @@ -336,6 +342,7 @@ export class OfficeApp extends Component { userPrivileges={userPrivileges} isQueueManagementFFEnabled={queueManagementFlag} isBulkAssignmentFFEnabled={bulkAssignmentFlag} + activeRole={activeRole} /> } @@ -367,6 +374,7 @@ export class OfficeApp extends Component { isQueueManagementFFEnabled={queueManagementFlag} userPrivileges={userPrivileges} isBulkAssignmentFFEnabled={bulkAssignmentFlag} + activeRole={activeRole} /> } @@ -382,6 +390,7 @@ export class OfficeApp extends Component { isQueueManagementFFEnabled={queueManagementFlag} userPrivileges={userPrivileges} isBulkAssignmentFFEnabled={bulkAssignmentFlag} + activeRole={activeRole} /> } @@ -394,7 +403,10 @@ export class OfficeApp extends Component { end element={ - + } /> diff --git a/src/services/ghcApi.js b/src/services/ghcApi.js index 1b787b7b8ad..a6c14a65e19 100644 --- a/src/services/ghcApi.js +++ b/src/services/ghcApi.js @@ -618,7 +618,7 @@ export function deleteShipment({ shipmentID, normalize = false, schemaKey = 'shi export async function getMovesQueue( key, - { sort, order, filters = [], currentPage = 1, currentPageSize = 20, viewAsGBLOC }, + { sort, order, filters = [], currentPage = 1, currentPageSize = 20, viewAsGBLOC, activeRole }, ) { const operationPath = 'queues.getMovesQueue'; const paramFilters = {}; @@ -627,14 +627,23 @@ export async function getMovesQueue( }); return makeGHCRequest( operationPath, - { sort, order, page: currentPage, perPage: currentPageSize, viewAsGBLOC, ...paramFilters }, + { sort, order, page: currentPage, perPage: currentPageSize, viewAsGBLOC, activeRole, ...paramFilters }, { schemaKey: 'queueMovesResult', normalize: false }, ); } export async function getServicesCounselingQueue( key, - { sort, order, filters = [], currentPage = 1, currentPageSize = 20, needsPPMCloseout = false, viewAsGBLOC }, + { + sort, + order, + filters = [], + currentPage = 1, + currentPageSize = 20, + needsPPMCloseout = false, + viewAsGBLOC, + activeRole, + }, ) { const operationPath = 'queues.getServicesCounselingQueue'; const paramFilters = {}; @@ -651,6 +660,7 @@ export async function getServicesCounselingQueue( perPage: currentPageSize, needsPPMCloseout, viewAsGBLOC, + activeRole, ...paramFilters, }, @@ -674,7 +684,16 @@ export async function getServicesCounselingOriginLocations(needsPPMCloseout, vie export async function getServicesCounselingPPMQueue( key, - { sort, order, filters = [], currentPage = 1, currentPageSize = 20, needsPPMCloseout = true, viewAsGBLOC }, + { + sort, + order, + filters = [], + currentPage = 1, + currentPageSize = 20, + needsPPMCloseout = true, + viewAsGBLOC, + activeRole, + }, ) { const operationPath = 'queues.getServicesCounselingQueue'; const paramFilters = {}; @@ -684,14 +703,23 @@ export async function getServicesCounselingPPMQueue( return makeGHCRequest( operationPath, - { sort, order, page: currentPage, perPage: currentPageSize, needsPPMCloseout, viewAsGBLOC, ...paramFilters }, + { + sort, + order, + page: currentPage, + perPage: currentPageSize, + needsPPMCloseout, + viewAsGBLOC, + ...paramFilters, + activeRole, + }, { schemaKey: 'queueMovesResult', normalize: false }, ); } export async function getPaymentRequestsQueue( key, - { sort, order, filters = [], currentPage = 1, currentPageSize = 20, viewAsGBLOC }, + { sort, order, filters = [], currentPage = 1, currentPageSize = 20, viewAsGBLOC, activeRole }, ) { const operationPath = 'queues.getPaymentRequestsQueue'; const paramFilters = {}; @@ -700,7 +728,7 @@ export async function getPaymentRequestsQueue( }); return makeGHCRequest( operationPath, - { sort, order, page: currentPage, perPage: currentPageSize, viewAsGBLOC, ...paramFilters }, + { sort, order, page: currentPage, perPage: currentPageSize, viewAsGBLOC, activeRole, ...paramFilters }, { schemaKey: 'queuePaymentRequestsResult', normalize: false }, ); } diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index df06a4ca220..2ecf88e122d 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3504,6 +3504,10 @@ paths: type: string description: | Used to illustrate which user is assigned to this payment request. + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria @@ -3726,6 +3730,10 @@ paths: name: counselingOffice type: string description: filters using a counselingOffice name of the move + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria @@ -3822,6 +3830,10 @@ paths: type: string description: | Used to return a queue for a GBLOC other than the default of the current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index a92ed3016a6..8f47f21efc0 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3637,6 +3637,10 @@ paths: type: string description: | Used to illustrate which user is assigned to this payment request. + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria @@ -3892,6 +3896,10 @@ paths: name: counselingOffice type: string description: filters using a counselingOffice name of the move + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria @@ -4008,6 +4016,10 @@ paths: current user. Requires the HQ role or a secondary transportation office assignment. The parameter is ignored if the requesting user does not have the necessary role or assignment. + - in: query + name: activeRole + type: string + description: user's actively logged in role responses: '200': description: Successfully returned all moves matching the criteria From 8255fdbce8d0595900d645bf3128ecd12320b6e8 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Tue, 28 Jan 2025 10:37:59 -0500 Subject: [PATCH 116/229] add path and params to clients tests for AddOrdersForm which now uses useParams --- .../Office/AddOrdersForm/AddOrdersForm.test.jsx | 14 +++++++++----- .../ServicesCounselingAddOrders.test.jsx | 6 +++++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx index 639d617de43..9110d400626 100644 --- a/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx +++ b/src/components/Office/AddOrdersForm/AddOrdersForm.test.jsx @@ -5,10 +5,12 @@ import { Provider } from 'react-redux'; import AddOrdersForm from './AddOrdersForm'; +import { MockProviders } from 'testUtils'; import { dropdownInputOptions } from 'utils/formatters'; import { ORDERS_TYPE, ORDERS_TYPE_OPTIONS } from 'constants/orders'; import { configureStore } from 'shared/store'; import { isBooleanFlagEnabled } from 'utils/featureFlags'; +import { servicesCounselingRoutes } from 'constants/routes'; jest.setTimeout(60000); @@ -138,6 +140,8 @@ const testProps = { onSubmit: jest.fn(), onBack: jest.fn(), }; +const mockParams = { customerId: 'ea51dab0-4553-4732-b843-1f33407f77bd' }; +const mockPath = servicesCounselingRoutes.BASE_CUSTOMERS_ORDERS_ADD_PATH; describe('CreateMoveCustomerInfo Component', () => { it('renders the form inputs', async () => { @@ -226,7 +230,7 @@ describe('AddOrdersForm - OCONUS and Accompanied Tour Test', () => { it('submits the form with OCONUS values and accompanied tour selection', async () => { isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); render( - + , ); @@ -429,9 +433,9 @@ describe('AddOrdersForm - With Counseling Office', () => { it('displays the counseling office dropdown', async () => { isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); render( - + - , + , ); await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); @@ -462,9 +466,9 @@ describe('AddOrdersForm - With Counseling Office', () => { it('disabled submit if counseling office is required and blank', async () => { isBooleanFlagEnabled.mockImplementation(() => Promise.resolve(true)); render( - + - , + , ); await userEvent.selectOptions(await screen.findByLabelText(/Orders type/), 'PERMANENT_CHANGE_OF_STATION'); diff --git a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx index 8d2cc7a2fb8..972b01d05ce 100644 --- a/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx +++ b/src/pages/Office/ServicesCounselingAddOrders/ServicesCounselingAddOrders.test.jsx @@ -8,6 +8,7 @@ import { MockProviders } from 'testUtils'; import { counselingCreateOrder } from 'services/ghcApi'; import { setCanAddOrders } from 'store/general/actions'; import { isBooleanFlagEnabled } from 'utils/featureFlags'; +import { servicesCounselingRoutes } from 'constants/routes'; const mockNavigate = jest.fn(); jest.mock('react-router-dom', () => ({ @@ -331,10 +332,13 @@ const fakeResponse = { }, }; +const mockParams = { customerId: 'ea51dab0-4553-4732-b843-1f33407f77bd' }; +const mockPath = servicesCounselingRoutes.BASE_CUSTOMERS_ORDERS_ADD_PATH; + const renderWithMocks = () => { const testProps = { customer, setCanAddOrders: jest.fn() }; render( - + , ); From e017facf722506239346026d6482f4e8ac67d9f4 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 28 Jan 2025 15:43:27 +0000 Subject: [PATCH 117/229] Added unit test --- .../ExpandableServiceItemRow.test.jsx | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx index ee58ee1531a..2bc115f4586 100644 --- a/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx +++ b/src/components/Office/ExpandableServiceItemRow/ExpandableServiceItemRow.test.jsx @@ -3,6 +3,8 @@ import { act, render, screen } from '@testing-library/react'; import ExpandableServiceItemRow from './ExpandableServiceItemRow'; +import { SERVICE_ITEM_CODES } from 'constants/serviceItems'; + const serviceItem = { createdAt: '2025-01-09T22:08:38.788Z', eTag: 'MjAyNS0wMS0xN1QxNTowODo0Mi44MDI4MDZa', @@ -172,6 +174,10 @@ const additionalServiceItemData = { updatedAt: '0001-01-01T00:00:00.000Z', }; +const basicServiceItem = { ...serviceItem }; +basicServiceItem.mtoServiceItemCode = SERVICE_ITEM_CODES.MS; +basicServiceItem.mtoServiceItemName = 'Move Management'; + describe('Payment service items', () => { it('Displays rejected service item with rejection reason', async () => { render( @@ -266,4 +272,30 @@ describe('Payment service items', () => { expect(screen.getByText('1.10701')).toBeVisible(); expect(screen.getByText('Base year: Award Term 1')).toBeVisible(); }); + + it('Displays rejected basic service item (Move Management) with rejection reason and no calculations', async () => { + render( + , + ); + + expect(screen.getByText('Move Management')).toBeVisible(); + expect(screen.getByText('$88,553.85')).toBeVisible(); + expect(screen.getByText('Rejected')).toBeVisible(); + + // Expand service item row + await act(async () => { + screen.getByText('Move Management').click(); + }); + + // Test for rejection reason + expect(screen.getByText('Rejection Reason')).toBeVisible(); + expect(screen.getByText('Rejection reason test text')).toBeVisible(); + }); }); From 20e42745406372c908673ad1723301a4fb450bec Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 28 Jan 2025 17:09:44 +0000 Subject: [PATCH 118/229] Setting Market and Status to show in prime sim --- .../move_task_order/move_task_order_fetcher.go | 11 +++++------ src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx | 10 ++++++++++ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pkg/services/move_task_order/move_task_order_fetcher.go b/pkg/services/move_task_order/move_task_order_fetcher.go index a0dee9339f1..6c2be9fd12d 100644 --- a/pkg/services/move_task_order/move_task_order_fetcher.go +++ b/pkg/services/move_task_order/move_task_order_fetcher.go @@ -338,12 +338,11 @@ func (f moveTaskOrderFetcher) FetchMoveTaskOrder(appCtx appcontext.AppContext, s if loadErr != nil { return &models.Move{}, apperror.NewQueryError("CustomerContacts", loadErr, "") } - } else if serviceItem.ReService.Code == models.ReServiceCodeICRT || // use address.isOconus to get 'market' value for intl crating - serviceItem.ReService.Code == models.ReServiceCodeIUCRT { - loadErr := appCtx.DB().Load(&mto.MTOServiceItems[i], "MTOShipment.PickupAddress", "MTOShipment.DestinationAddress") - if loadErr != nil { - return &models.Move{}, apperror.NewQueryError("MTOShipment.PickupAddress, MTOShipment.DestinationAddress", loadErr, "") - } + } + + loadErr := appCtx.DB().Load(&mto.MTOServiceItems[i], "MTOShipment.PickupAddress", "MTOShipment.DestinationAddress") + if loadErr != nil { + return &models.Move{}, apperror.NewQueryError("MTOShipment", loadErr, "") } loadedServiceItems = append(loadedServiceItems, mto.MTOServiceItems[i]) diff --git a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx index 45881d58602..d1b7f0d3199 100644 --- a/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx +++ b/src/pages/PrimeUI/MoveTaskOrder/MoveDetails.jsx @@ -256,6 +256,16 @@ const MoveDetails = ({ setFlashMessage }) => {

{serviceItem.reServiceCode} - {serviceItem.reServiceName}

+
+
Status:
+
{serviceItem.status}
+
+ {serviceItem.market && ( +
+
Market
+
{serviceItem.market}
+
+ )}
{SERVICE_ITEMS_ALLOWED_UPDATE.includes(serviceItem.reServiceCode) ? ( Date: Tue, 28 Jan 2025 11:20:11 -0600 Subject: [PATCH 119/229] refactor using formik set feild value --- .../AllowancesDetailForm.jsx | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index df75f8d9a90..54134d99935 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -1,5 +1,6 @@ import React, { useState, useEffect } from 'react'; import PropTypes from 'prop-types'; +import { useFormikContext } from 'formik'; import { isBooleanFlagEnabled } from '../../../utils/featureFlags'; import { FEATURE_FLAG_KEYS } from '../../../shared/constants'; @@ -20,6 +21,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab entitlements?.dependentsTwelveAndOver || entitlements?.dependentsUnderTwelve ); + const { setFieldValue } = useFormikContext(); const [isAdminWeightLocationChecked, setIsAdminWeightLocationChecked] = useState(entitlements?.weightRestriction > 0); useEffect(() => { // Functional component version of "componentDidMount" @@ -44,18 +46,11 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab }, [isAdminWeightLocationChecked]); const handleAdminWeightLocationChange = (e) => { - setIsAdminWeightLocationChecked(e.target.checked); - if (!e.target.checked) { - // Find the weight restriction input and update both DOM and form state - const weightRestrictionInput = document.querySelector('input[name="weightRestriction"]'); - if (weightRestrictionInput) { - weightRestrictionInput.value = '0'; - // Create and dispatch both input and change events - const inputEvent = new Event('input', { bubbles: true }); - const changeEvent = new Event('change', { bubbles: true }); - weightRestrictionInput.dispatchEvent(inputEvent); - weightRestrictionInput.dispatchEvent(changeEvent); - } + const isChecked = e.target.checked; + setIsAdminWeightLocationChecked(isChecked); + + if (!isChecked) { + setFieldValue('weightRestriction', 0); } }; From 3d151bbb5c1dc4b589ab2b65d6581a8dca33e83a Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Tue, 28 Jan 2025 18:30:42 +0000 Subject: [PATCH 120/229] Adding MTOServiceItemDomesticShuttle --- .../prime/create_mto_service_item.go | 9 + pkg/gen/primeapi/embedded_spec.go | 94 ++- pkg/gen/primemessages/m_t_o_service_item.go | 6 + .../m_t_o_service_item_domestic_shuttle.go | 633 ++++++++++++++++++ .../m_t_o_service_item_model_type.go | 6 +- pkg/gen/primev2api/embedded_spec.go | 94 ++- pkg/gen/primev2messages/m_t_o_service_item.go | 6 + .../m_t_o_service_item_domestic_shuttle.go | 633 ++++++++++++++++++ .../m_t_o_service_item_model_type.go | 6 +- pkg/gen/primev3api/embedded_spec.go | 94 ++- pkg/gen/primev3messages/m_t_o_service_item.go | 6 + .../m_t_o_service_item_domestic_shuttle.go | 633 ++++++++++++++++++ .../m_t_o_service_item_model_type.go | 6 +- pkg/gen/supportapi/embedded_spec.go | 96 ++- pkg/gen/supportmessages/m_t_o_service_item.go | 6 + .../m_t_o_service_item_domestic_shuttle.go | 521 ++++++++++++++ .../m_t_o_service_item_model_type.go | 6 +- pkg/handlers/primeapi/move_task_order_test.go | 6 +- pkg/handlers/primeapi/mto_service_item.go | 1 + .../primeapi/payloads/model_to_payload.go | 2 +- .../payloads/model_to_payload_test.go | 2 +- .../primeapi/payloads/payload_to_model.go | 4 +- .../primeapiv2/move_task_order_test.go | 6 +- .../primeapiv2/payloads/model_to_payload.go | 2 +- .../payloads/model_to_payload_test.go | 2 +- .../primeapiv2/payloads/payload_to_model.go | 4 +- .../payloads/payload_to_model_test.go | 4 +- .../primeapiv3/move_task_order_test.go | 6 +- pkg/handlers/primeapiv3/mto_service_item.go | 1 + .../primeapiv3/payloads/model_to_payload.go | 2 +- .../payloads/model_to_payload_test.go | 2 +- .../primeapiv3/payloads/payload_to_model.go | 4 +- .../payloads/payload_to_model_test.go | 4 +- .../internal/payloads/model_to_payload.go | 2 +- .../service_params_cache_test.go | 8 +- pkg/services/event/notification_test.go | 2 +- .../mto_service_item_creator_test.go | 2 +- .../CreateShipmentServiceItemForm.jsx | 6 +- .../CreateShipmentServiceItemForm.test.jsx | 2 +- .../ShuttleSITServiceItemForm.jsx | 6 +- src/constants/prime.js | 4 +- .../prime/MTOServiceItemDomesticShuttle.yaml | 34 + .../prime/MTOServiceItemModelType.yaml | 2 + swagger-def/prime.yaml | 2 + swagger-def/prime_v2.yaml | 2 + swagger-def/prime_v3.yaml | 2 + swagger-def/support.yaml | 34 + swagger/prime.yaml | 43 ++ swagger/prime_v2.yaml | 43 ++ swagger/prime_v3.yaml | 43 ++ swagger/support.yaml | 38 ++ 51 files changed, 3129 insertions(+), 53 deletions(-) create mode 100644 pkg/gen/primemessages/m_t_o_service_item_domestic_shuttle.go create mode 100644 pkg/gen/primev2messages/m_t_o_service_item_domestic_shuttle.go create mode 100644 pkg/gen/primev3messages/m_t_o_service_item_domestic_shuttle.go create mode 100644 pkg/gen/supportmessages/m_t_o_service_item_domestic_shuttle.go create mode 100644 swagger-def/definitions/prime/MTOServiceItemDomesticShuttle.yaml diff --git a/cmd/prime-api-client/prime/create_mto_service_item.go b/cmd/prime-api-client/prime/create_mto_service_item.go index 4147b173fce..65c8a9c16aa 100644 --- a/cmd/prime-api-client/prime/create_mto_service_item.go +++ b/cmd/prime-api-client/prime/create_mto_service_item.go @@ -39,6 +39,10 @@ type shuttleParams struct { Body primemessages.MTOServiceItemShuttle `json:"body"` } +type domesticShuttleParams struct { + Body primemessages.MTOServiceItemShuttle `json:"body"` +} + // InitCreateMTOServiceItemFlags initializes flags. func InitCreateMTOServiceItemFlags(flag *pflag.FlagSet) { flag.String(utils.FilenameFlag, "", "Name of the file being passed in") @@ -146,12 +150,17 @@ func CreateMTOServiceItem(cmd *cobra.Command, args []string) error { var params shuttleParams err = utils.DecodeJSONFileToPayload(filename, utils.ContainsDash(args), ¶ms) serviceItemParams.SetBody(¶ms.Body) + case primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: + var params domesticShuttleParams + err = utils.DecodeJSONFileToPayload(filename, utils.ContainsDash(args), ¶ms) + serviceItemParams.SetBody(¶ms.Body) default: err = fmt.Errorf("allowed modelType(): %v", []primemessages.MTOServiceItemModelType{ primemessages.MTOServiceItemModelTypeMTOServiceItemDestSIT, primemessages.MTOServiceItemModelTypeMTOServiceItemOriginSIT, primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticCrating, primemessages.MTOServiceItemModelTypeMTOServiceItemShuttle, + primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle, }) } // return any decoding errors diff --git a/pkg/gen/primeapi/embedded_spec.go b/pkg/gen/primeapi/embedded_spec.go index ab7b9225ce4..071ae792e57 100644 --- a/pkg/gen/primeapi/embedded_spec.go +++ b/pkg/gen/primeapi/embedded_spec.go @@ -2324,6 +2324,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -2480,13 +2524,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", @@ -7395,6 +7440,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -7551,13 +7640,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", diff --git a/pkg/gen/primemessages/m_t_o_service_item.go b/pkg/gen/primemessages/m_t_o_service_item.go index 5ed0f248ae0..028e219d5df 100644 --- a/pkg/gen/primemessages/m_t_o_service_item.go +++ b/pkg/gen/primemessages/m_t_o_service_item.go @@ -273,6 +273,12 @@ func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOService return nil, err } return &result, nil + case "MTOServiceItemDomesticShuttle": + var result MTOServiceItemDomesticShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil case "MTOServiceItemInternationalCrating": var result MTOServiceItemInternationalCrating if err := consumer.Consume(buf2, &result); err != nil { diff --git a/pkg/gen/primemessages/m_t_o_service_item_domestic_shuttle.go b/pkg/gen/primemessages/m_t_o_service_item_domestic_shuttle.go new file mode 100644 index 00000000000..1d5e28daaae --- /dev/null +++ b/pkg/gen/primemessages/m_t_o_service_item_domestic_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primemessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticShuttle Describes a domestic shuttle service item. +// +// swagger:model MTOServiceItemDomesticShuttle +type MTOServiceItemDomesticShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic shuttle +func (m *MTOServiceItemDomesticShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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 *MTOServiceItemDomesticShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum = append(mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic shuttle based on the context it is used +func (m *MTOServiceItemDomesticShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primemessages/m_t_o_service_item_model_type.go b/pkg/gen/primemessages/m_t_o_service_item_model_type.go index 9326c1377a1..3c494ac62f3 100644 --- a/pkg/gen/primemessages/m_t_o_service_item_model_type.go +++ b/pkg/gen/primemessages/m_t_o_service_item_model_type.go @@ -20,6 +20,7 @@ import ( // - DOFSIT, DOASIT - MTOServiceItemOriginSIT // - DDFSIT, DDASIT - MTOServiceItemDestSIT // - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle // - IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle // - DCRT, DUCRT - MTOServiceItemDomesticCrating // - ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -53,6 +54,9 @@ const ( // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + // MTOServiceItemModelTypeMTOServiceItemDomesticShuttle captures enum value "MTOServiceItemDomesticShuttle" + MTOServiceItemModelTypeMTOServiceItemDomesticShuttle MTOServiceItemModelType = "MTOServiceItemDomesticShuttle" + // MTOServiceItemModelTypeMTOServiceItemInternationalShuttle captures enum value "MTOServiceItemInternationalShuttle" MTOServiceItemModelTypeMTOServiceItemInternationalShuttle MTOServiceItemModelType = "MTOServiceItemInternationalShuttle" @@ -71,7 +75,7 @@ var mTOServiceItemModelTypeEnum []interface{} func init() { var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/primev2api/embedded_spec.go b/pkg/gen/primev2api/embedded_spec.go index 8cbeaf84b17..bff1b8499e1 100644 --- a/pkg/gen/primev2api/embedded_spec.go +++ b/pkg/gen/primev2api/embedded_spec.go @@ -1429,6 +1429,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -1560,13 +1604,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", @@ -5187,6 +5232,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -5318,13 +5407,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", diff --git a/pkg/gen/primev2messages/m_t_o_service_item.go b/pkg/gen/primev2messages/m_t_o_service_item.go index 7dfadf4c428..c06f87e420c 100644 --- a/pkg/gen/primev2messages/m_t_o_service_item.go +++ b/pkg/gen/primev2messages/m_t_o_service_item.go @@ -273,6 +273,12 @@ func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOService return nil, err } return &result, nil + case "MTOServiceItemDomesticShuttle": + var result MTOServiceItemDomesticShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil case "MTOServiceItemInternationalCrating": var result MTOServiceItemInternationalCrating if err := consumer.Consume(buf2, &result); err != nil { diff --git a/pkg/gen/primev2messages/m_t_o_service_item_domestic_shuttle.go b/pkg/gen/primev2messages/m_t_o_service_item_domestic_shuttle.go new file mode 100644 index 00000000000..c5767d8bddf --- /dev/null +++ b/pkg/gen/primev2messages/m_t_o_service_item_domestic_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev2messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticShuttle Describes a domestic shuttle service item. +// +// swagger:model MTOServiceItemDomesticShuttle +type MTOServiceItemDomesticShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic shuttle +func (m *MTOServiceItemDomesticShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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 *MTOServiceItemDomesticShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum = append(mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic shuttle based on the context it is used +func (m *MTOServiceItemDomesticShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev2messages/m_t_o_service_item_model_type.go b/pkg/gen/primev2messages/m_t_o_service_item_model_type.go index 97d0c5272dc..77247b78fe0 100644 --- a/pkg/gen/primev2messages/m_t_o_service_item_model_type.go +++ b/pkg/gen/primev2messages/m_t_o_service_item_model_type.go @@ -20,6 +20,7 @@ import ( // - DOFSIT, DOASIT - MTOServiceItemOriginSIT // - DDFSIT, DDASIT - MTOServiceItemDestSIT // - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle // - IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle // - DCRT, DUCRT - MTOServiceItemDomesticCrating // - ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -53,6 +54,9 @@ const ( // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + // MTOServiceItemModelTypeMTOServiceItemDomesticShuttle captures enum value "MTOServiceItemDomesticShuttle" + MTOServiceItemModelTypeMTOServiceItemDomesticShuttle MTOServiceItemModelType = "MTOServiceItemDomesticShuttle" + // MTOServiceItemModelTypeMTOServiceItemInternationalShuttle captures enum value "MTOServiceItemInternationalShuttle" MTOServiceItemModelTypeMTOServiceItemInternationalShuttle MTOServiceItemModelType = "MTOServiceItemInternationalShuttle" @@ -71,7 +75,7 @@ var mTOServiceItemModelTypeEnum []interface{} func init() { var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/primev3api/embedded_spec.go b/pkg/gen/primev3api/embedded_spec.go index b936756cd78..9848adb5471 100644 --- a/pkg/gen/primev3api/embedded_spec.go +++ b/pkg/gen/primev3api/embedded_spec.go @@ -1591,6 +1591,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -1747,13 +1791,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", @@ -6059,6 +6104,50 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a domestic shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode" + ], + "properties": { + "actualWeight": { + "description": "A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in the shuttling service.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "A unique code for the service item. Indicates if shuttling is requested for the shipment origin (` + "`" + `DOSHUT` + "`" + `) or destination (` + "`" + `DDSHUT` + "`" + `).\n", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item.\n", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemInternationalCrating": { "description": "Describes a international crating/uncrating service item subtype of a MTOServiceItem.", "allOf": [ @@ -6215,13 +6304,14 @@ func init() { ] }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n * PODFSC, POEFSC - MTOSerivceItemInternationalFuelSurcharge\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating", diff --git a/pkg/gen/primev3messages/m_t_o_service_item.go b/pkg/gen/primev3messages/m_t_o_service_item.go index 75d33c217f1..06f0d63c776 100644 --- a/pkg/gen/primev3messages/m_t_o_service_item.go +++ b/pkg/gen/primev3messages/m_t_o_service_item.go @@ -273,6 +273,12 @@ func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOService return nil, err } return &result, nil + case "MTOServiceItemDomesticShuttle": + var result MTOServiceItemDomesticShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil case "MTOServiceItemInternationalCrating": var result MTOServiceItemInternationalCrating if err := consumer.Consume(buf2, &result); err != nil { diff --git a/pkg/gen/primev3messages/m_t_o_service_item_domestic_shuttle.go b/pkg/gen/primev3messages/m_t_o_service_item_domestic_shuttle.go new file mode 100644 index 00000000000..caea94b6010 --- /dev/null +++ b/pkg/gen/primev3messages/m_t_o_service_item_domestic_shuttle.go @@ -0,0 +1,633 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package primev3messages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticShuttle Describes a domestic shuttle service item. +// +// swagger:model MTOServiceItemDomesticShuttle +type MTOServiceItemDomesticShuttle struct { + eTagField string + + idField strfmt.UUID + + lockedPriceCentsField *int64 + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + serviceRequestDocumentsField ServiceRequestDocuments + + statusField MTOServiceItemStatus + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// LockedPriceCents gets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) LockedPriceCents() *int64 { + return m.lockedPriceCentsField +} + +// SetLockedPriceCents sets the locked price cents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetLockedPriceCents(val *int64) { + m.lockedPriceCentsField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// ServiceRequestDocuments gets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) ServiceRequestDocuments() ServiceRequestDocuments { + return m.serviceRequestDocumentsField +} + +// SetServiceRequestDocuments sets the service request documents of this subtype +func (m *MTOServiceItemDomesticShuttle) SetServiceRequestDocuments(val ServiceRequestDocuments) { + m.serviceRequestDocumentsField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + result.lockedPriceCentsField = base.LockedPriceCents + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.serviceRequestDocumentsField = base.ServiceRequestDocuments + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in the shuttling service. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) or destination (`DDSHUT`). + // + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to approve or reject the service item. + // + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + LockedPriceCents *int64 `json:"lockedPriceCents,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + ServiceRequestDocuments ServiceRequestDocuments `json:"serviceRequestDocuments,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + LockedPriceCents: m.LockedPriceCents(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + ServiceRequestDocuments: m.ServiceRequestDocuments(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic shuttle +func (m *MTOServiceItemDomesticShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateServiceRequestDocuments(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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 *MTOServiceItemDomesticShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateServiceRequestDocuments(formats strfmt.Registry) error { + + if swag.IsZero(m.ServiceRequestDocuments()) { // not required + return nil + } + + if err := m.ServiceRequestDocuments().Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum = append(mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic shuttle based on the context it is used +func (m *MTOServiceItemDomesticShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateID(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateRejectionReason(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateServiceRequestDocuments(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateID(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "id", "body", strfmt.UUID(m.ID())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateRejectionReason(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "rejectionReason", "body", m.RejectionReason()); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateServiceRequestDocuments(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ServiceRequestDocuments().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("serviceRequestDocuments") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("serviceRequestDocuments") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/primev3messages/m_t_o_service_item_model_type.go b/pkg/gen/primev3messages/m_t_o_service_item_model_type.go index 53d2a0450f6..4dea531b524 100644 --- a/pkg/gen/primev3messages/m_t_o_service_item_model_type.go +++ b/pkg/gen/primev3messages/m_t_o_service_item_model_type.go @@ -20,6 +20,7 @@ import ( // - DOFSIT, DOASIT - MTOServiceItemOriginSIT // - DDFSIT, DDASIT - MTOServiceItemDestSIT // - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle // - IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle // - DCRT, DUCRT - MTOServiceItemDomesticCrating // - ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -53,6 +54,9 @@ const ( // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + // MTOServiceItemModelTypeMTOServiceItemDomesticShuttle captures enum value "MTOServiceItemDomesticShuttle" + MTOServiceItemModelTypeMTOServiceItemDomesticShuttle MTOServiceItemModelType = "MTOServiceItemDomesticShuttle" + // MTOServiceItemModelTypeMTOServiceItemInternationalShuttle captures enum value "MTOServiceItemInternationalShuttle" MTOServiceItemModelTypeMTOServiceItemInternationalShuttle MTOServiceItemModelType = "MTOServiceItemInternationalShuttle" @@ -71,7 +75,7 @@ var mTOServiceItemModelTypeEnum []interface{} func init() { var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating","MTOSerivceItemInternationalFuelSurcharge"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/gen/supportapi/embedded_spec.go b/pkg/gen/supportapi/embedded_spec.go index a8fc82230f8..ba5682f4a7e 100644 --- a/pkg/gen/supportapi/embedded_spec.go +++ b/pkg/gen/supportapi/embedded_spec.go @@ -1531,14 +1531,60 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode", + "description" + ], + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "Explanation of why a shuttle service is required.", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating" @@ -4399,14 +4445,60 @@ func init() { } ] }, + "MTOServiceItemDomesticShuttle": { + "description": "Describes a shuttle service item.", + "allOf": [ + { + "$ref": "#/definitions/MTOServiceItem" + }, + { + "type": "object", + "required": [ + "reason", + "reServiceCode", + "description" + ], + "properties": { + "actualWeight": { + "description": "Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT \u0026 DOSHUT) service items.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4000 + }, + "estimatedWeight": { + "description": "An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT \u0026 DOSHUT) service item.", + "type": "integer", + "x-nullable": true, + "x-omitempty": false, + "example": 4200 + }, + "reServiceCode": { + "description": "Service codes allowed for this model type.", + "type": "string", + "enum": [ + "DOSHUT", + "DDSHUT" + ] + }, + "reason": { + "description": "Explanation of why a shuttle service is required.", + "type": "string", + "example": "Storage items need to be picked up." + } + } + } + ] + }, "MTOServiceItemModelType": { - "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", + "description": "Describes all model sub-types for a MTOServiceItem model.\n\nUsing this list, choose the correct modelType in the dropdown, corresponding to the service item type.\n * DOFSIT, DOASIT - MTOServiceItemOriginSIT\n * DDFSIT, DDASIT - MTOServiceItemDestSIT\n * DOSHUT, DDSHUT - MTOServiceItemShuttle\n * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle\n * DCRT, DUCRT - MTOServiceItemDomesticCrating\n * ICRT, IUCRT - MTOServiceItemInternationalCrating\n\nThe documentation will then update with the supported fields.\n", "type": "string", "enum": [ "MTOServiceItemBasic", "MTOServiceItemOriginSIT", "MTOServiceItemDestSIT", "MTOServiceItemShuttle", + "MTOServiceItemDomesticShuttle", "MTOServiceItemInternationalShuttle", "MTOServiceItemDomesticCrating", "MTOServiceItemInternationalCrating" diff --git a/pkg/gen/supportmessages/m_t_o_service_item.go b/pkg/gen/supportmessages/m_t_o_service_item.go index 23f35835eb2..67cd5524d3f 100644 --- a/pkg/gen/supportmessages/m_t_o_service_item.go +++ b/pkg/gen/supportmessages/m_t_o_service_item.go @@ -239,6 +239,12 @@ func unmarshalMTOServiceItem(data []byte, consumer runtime.Consumer) (MTOService return nil, err } return &result, nil + case "MTOServiceItemDomesticShuttle": + var result MTOServiceItemDomesticShuttle + if err := consumer.Consume(buf2, &result); err != nil { + return nil, err + } + return &result, nil case "MTOServiceItemOriginSIT": var result MTOServiceItemOriginSIT if err := consumer.Consume(buf2, &result); err != nil { diff --git a/pkg/gen/supportmessages/m_t_o_service_item_domestic_shuttle.go b/pkg/gen/supportmessages/m_t_o_service_item_domestic_shuttle.go new file mode 100644 index 00000000000..47b7ad784ce --- /dev/null +++ b/pkg/gen/supportmessages/m_t_o_service_item_domestic_shuttle.go @@ -0,0 +1,521 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package supportmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "bytes" + "context" + "encoding/json" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// MTOServiceItemDomesticShuttle Describes a shuttle service item. +// +// swagger:model MTOServiceItemDomesticShuttle +type MTOServiceItemDomesticShuttle struct { + eTagField string + + idField strfmt.UUID + + moveTaskOrderIdField *strfmt.UUID + + mtoShipmentIdField strfmt.UUID + + reServiceNameField string + + rejectionReasonField *string + + statusField MTOServiceItemStatus + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service codes allowed for this model type. + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why a shuttle service is required. + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` +} + +// ETag gets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) ETag() string { + return m.eTagField +} + +// SetETag sets the e tag of this subtype +func (m *MTOServiceItemDomesticShuttle) SetETag(val string) { + m.eTagField = val +} + +// ID gets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) ID() strfmt.UUID { + return m.idField +} + +// SetID sets the id of this subtype +func (m *MTOServiceItemDomesticShuttle) SetID(val strfmt.UUID) { + m.idField = val +} + +// ModelType gets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) ModelType() MTOServiceItemModelType { + return "MTOServiceItemDomesticShuttle" +} + +// SetModelType sets the model type of this subtype +func (m *MTOServiceItemDomesticShuttle) SetModelType(val MTOServiceItemModelType) { +} + +// MoveTaskOrderID gets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MoveTaskOrderID() *strfmt.UUID { + return m.moveTaskOrderIdField +} + +// SetMoveTaskOrderID sets the move task order ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMoveTaskOrderID(val *strfmt.UUID) { + m.moveTaskOrderIdField = val +} + +// MtoShipmentID gets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) MtoShipmentID() strfmt.UUID { + return m.mtoShipmentIdField +} + +// SetMtoShipmentID sets the mto shipment ID of this subtype +func (m *MTOServiceItemDomesticShuttle) SetMtoShipmentID(val strfmt.UUID) { + m.mtoShipmentIdField = val +} + +// ReServiceName gets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) ReServiceName() string { + return m.reServiceNameField +} + +// SetReServiceName sets the re service name of this subtype +func (m *MTOServiceItemDomesticShuttle) SetReServiceName(val string) { + m.reServiceNameField = val +} + +// RejectionReason gets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) RejectionReason() *string { + return m.rejectionReasonField +} + +// SetRejectionReason sets the rejection reason of this subtype +func (m *MTOServiceItemDomesticShuttle) SetRejectionReason(val *string) { + m.rejectionReasonField = val +} + +// Status gets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) Status() MTOServiceItemStatus { + return m.statusField +} + +// SetStatus sets the status of this subtype +func (m *MTOServiceItemDomesticShuttle) SetStatus(val MTOServiceItemStatus) { + m.statusField = val +} + +// UnmarshalJSON unmarshals this object with a polymorphic type from a JSON structure +func (m *MTOServiceItemDomesticShuttle) UnmarshalJSON(raw []byte) error { + var data struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service codes allowed for this model type. + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why a shuttle service is required. + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + } + buf := bytes.NewBuffer(raw) + dec := json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&data); err != nil { + return err + } + + var base struct { + /* Just the base type fields. Used for unmashalling polymorphic types.*/ + + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + } + buf = bytes.NewBuffer(raw) + dec = json.NewDecoder(buf) + dec.UseNumber() + + if err := dec.Decode(&base); err != nil { + return err + } + + var result MTOServiceItemDomesticShuttle + + result.eTagField = base.ETag + + result.idField = base.ID + + if base.ModelType != result.ModelType() { + /* Not the type we're looking for. */ + return errors.New(422, "invalid modelType value: %q", base.ModelType) + } + result.moveTaskOrderIdField = base.MoveTaskOrderID + + result.mtoShipmentIdField = base.MtoShipmentID + + result.reServiceNameField = base.ReServiceName + + result.rejectionReasonField = base.RejectionReason + + result.statusField = base.Status + + result.ActualWeight = data.ActualWeight + result.EstimatedWeight = data.EstimatedWeight + result.ReServiceCode = data.ReServiceCode + result.Reason = data.Reason + + *m = result + + return nil +} + +// MarshalJSON marshals this object with a polymorphic type to a JSON structure +func (m MTOServiceItemDomesticShuttle) MarshalJSON() ([]byte, error) { + var b1, b2, b3 []byte + var err error + b1, err = json.Marshal(struct { + + // Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + // Example: 4000 + ActualWeight *int64 `json:"actualWeight"` + + // An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + // Example: 4200 + EstimatedWeight *int64 `json:"estimatedWeight"` + + // Service codes allowed for this model type. + // Required: true + // Enum: [DOSHUT DDSHUT] + ReServiceCode *string `json:"reServiceCode"` + + // Explanation of why a shuttle service is required. + // Example: Storage items need to be picked up. + // Required: true + Reason *string `json:"reason"` + }{ + + ActualWeight: m.ActualWeight, + + EstimatedWeight: m.EstimatedWeight, + + ReServiceCode: m.ReServiceCode, + + Reason: m.Reason, + }) + if err != nil { + return nil, err + } + b2, err = json.Marshal(struct { + ETag string `json:"eTag,omitempty"` + + ID strfmt.UUID `json:"id,omitempty"` + + ModelType MTOServiceItemModelType `json:"modelType"` + + MoveTaskOrderID *strfmt.UUID `json:"moveTaskOrderID"` + + MtoShipmentID strfmt.UUID `json:"mtoShipmentID,omitempty"` + + ReServiceName string `json:"reServiceName,omitempty"` + + RejectionReason *string `json:"rejectionReason,omitempty"` + + Status MTOServiceItemStatus `json:"status,omitempty"` + }{ + + ETag: m.ETag(), + + ID: m.ID(), + + ModelType: m.ModelType(), + + MoveTaskOrderID: m.MoveTaskOrderID(), + + MtoShipmentID: m.MtoShipmentID(), + + ReServiceName: m.ReServiceName(), + + RejectionReason: m.RejectionReason(), + + Status: m.Status(), + }) + if err != nil { + return nil, err + } + + return swag.ConcatJSON(b1, b2, b3), nil +} + +// Validate validates this m t o service item domestic shuttle +func (m *MTOServiceItemDomesticShuttle) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMoveTaskOrderID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateMtoShipmentID(formats); err != nil { + res = append(res, err) + } + + if err := m.validateStatus(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReServiceCode(formats); err != nil { + res = append(res, err) + } + + if err := m.validateReason(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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 *MTOServiceItemDomesticShuttle) validateMoveTaskOrderID(formats strfmt.Registry) error { + + if err := validate.Required("moveTaskOrderID", "body", m.MoveTaskOrderID()); err != nil { + return err + } + + if err := validate.FormatOf("moveTaskOrderID", "body", "uuid", m.MoveTaskOrderID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateMtoShipmentID(formats strfmt.Registry) error { + + if swag.IsZero(m.MtoShipmentID()) { // not required + return nil + } + + if err := validate.FormatOf("mtoShipmentID", "body", "uuid", m.MtoShipmentID().String(), formats); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) 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("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +var mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum []interface{} + +func init() { + var res []string + if err := json.Unmarshal([]byte(`["DOSHUT","DDSHUT"]`), &res); err != nil { + panic(err) + } + for _, v := range res { + mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum = append(mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, v) + } +} + +// property enum +func (m *MTOServiceItemDomesticShuttle) validateReServiceCodeEnum(path, location string, value string) error { + if err := validate.EnumCase(path, location, value, mTOServiceItemDomesticShuttleTypeReServiceCodePropEnum, true); err != nil { + return err + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReServiceCode(formats strfmt.Registry) error { + + if err := validate.Required("reServiceCode", "body", m.ReServiceCode); err != nil { + return err + } + + // value enum + if err := m.validateReServiceCodeEnum("reServiceCode", "body", *m.ReServiceCode); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) validateReason(formats strfmt.Registry) error { + + if err := validate.Required("reason", "body", m.Reason); err != nil { + return err + } + + return nil +} + +// ContextValidate validate this m t o service item domestic shuttle based on the context it is used +func (m *MTOServiceItemDomesticShuttle) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateETag(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateReServiceName(ctx, formats); err != nil { + res = append(res, err) + } + + if err := m.contextValidateStatus(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateETag(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "eTag", "body", string(m.ETag())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateModelType(ctx context.Context, formats strfmt.Registry) error { + + if err := m.ModelType().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("modelType") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("modelType") + } + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateReServiceName(ctx context.Context, formats strfmt.Registry) error { + + if err := validate.ReadOnly(ctx, "reServiceName", "body", string(m.ReServiceName())); err != nil { + return err + } + + return nil +} + +func (m *MTOServiceItemDomesticShuttle) contextValidateStatus(ctx context.Context, formats strfmt.Registry) error { + + if swag.IsZero(m.Status()) { // not required + return nil + } + + if err := m.Status().ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("status") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("status") + } + return err + } + + return nil +} + +// MarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *MTOServiceItemDomesticShuttle) UnmarshalBinary(b []byte) error { + var res MTOServiceItemDomesticShuttle + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/gen/supportmessages/m_t_o_service_item_model_type.go b/pkg/gen/supportmessages/m_t_o_service_item_model_type.go index 3f957023e8a..ac2cf879c35 100644 --- a/pkg/gen/supportmessages/m_t_o_service_item_model_type.go +++ b/pkg/gen/supportmessages/m_t_o_service_item_model_type.go @@ -20,6 +20,7 @@ import ( // - DOFSIT, DOASIT - MTOServiceItemOriginSIT // - DDFSIT, DDASIT - MTOServiceItemDestSIT // - DOSHUT, DDSHUT - MTOServiceItemShuttle +// - DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle // - DCRT, DUCRT - MTOServiceItemDomesticCrating // - ICRT, IUCRT - MTOServiceItemInternationalCrating // @@ -51,6 +52,9 @@ const ( // MTOServiceItemModelTypeMTOServiceItemShuttle captures enum value "MTOServiceItemShuttle" MTOServiceItemModelTypeMTOServiceItemShuttle MTOServiceItemModelType = "MTOServiceItemShuttle" + // MTOServiceItemModelTypeMTOServiceItemDomesticShuttle captures enum value "MTOServiceItemDomesticShuttle" + MTOServiceItemModelTypeMTOServiceItemDomesticShuttle MTOServiceItemModelType = "MTOServiceItemDomesticShuttle" + // MTOServiceItemModelTypeMTOServiceItemInternationalShuttle captures enum value "MTOServiceItemInternationalShuttle" MTOServiceItemModelTypeMTOServiceItemInternationalShuttle MTOServiceItemModelType = "MTOServiceItemInternationalShuttle" @@ -66,7 +70,7 @@ var mTOServiceItemModelTypeEnum []interface{} func init() { var res []MTOServiceItemModelType - if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating"]`), &res); err != nil { + if err := json.Unmarshal([]byte(`["MTOServiceItemBasic","MTOServiceItemOriginSIT","MTOServiceItemDestSIT","MTOServiceItemShuttle","MTOServiceItemDomesticShuttle","MTOServiceItemInternationalShuttle","MTOServiceItemDomesticCrating","MTOServiceItemInternationalCrating"]`), &res); err != nil { panic(err) } for _, v := range res { diff --git a/pkg/handlers/primeapi/move_task_order_test.go b/pkg/handlers/primeapi/move_task_order_test.go index f4ed43d4760..56f5e5e5f3d 100644 --- a/pkg/handlers/primeapi/move_task_order_test.go +++ b/pkg/handlers/primeapi/move_task_order_test.go @@ -1329,7 +1329,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { suite.NotNil(payload.ETag()) }) - suite.Run("Success - return all MTOServiceItemShuttle fields assoicated with the getMoveTaskOrder", func() { + suite.Run("Success - return all MTOServiceItemDomesticShuttle fields assoicated with the getMoveTaskOrder", func() { handler := GetMoveTaskOrderHandler{ suite.HandlerConfig(), movetaskorder.NewMoveTaskOrderFetcher(waf), @@ -1396,14 +1396,14 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { json, err := json.Marshal(serviceItemPayload) suite.NoError(err) - payload := primemessages.MTOServiceItemShuttle{} + payload := primemessages.MTOServiceItemDomesticShuttle{} err = payload.UnmarshalJSON(json) suite.NoError(err) suite.Equal(serviceItem.MoveTaskOrderID.String(), payload.MoveTaskOrderID().String()) suite.Equal(serviceItem.MTOShipmentID.String(), payload.MtoShipmentID().String()) suite.Equal(serviceItem.ID.String(), payload.ID().String()) - suite.Equal("MTOServiceItemShuttle", string(payload.ModelType())) + suite.Equal("MTOServiceItemDomesticShuttle", string(payload.ModelType())) suite.Equal(string(serviceItem.ReService.Code), string(*payload.ReServiceCode)) suite.Equal(serviceItem.ReService.Name, payload.ReServiceName()) suite.Equal(string(serviceItem.Status), string(payload.Status())) diff --git a/pkg/handlers/primeapi/mto_service_item.go b/pkg/handlers/primeapi/mto_service_item.go index 646c6d17bfb..c78f37b6950 100644 --- a/pkg/handlers/primeapi/mto_service_item.go +++ b/pkg/handlers/primeapi/mto_service_item.go @@ -28,6 +28,7 @@ var CreateableServiceItemMap = map[primemessages.MTOServiceItemModelType]bool{ primemessages.MTOServiceItemModelTypeMTOServiceItemOriginSIT: true, primemessages.MTOServiceItemModelTypeMTOServiceItemDestSIT: true, primemessages.MTOServiceItemModelTypeMTOServiceItemShuttle: true, + primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: true, primemessages.MTOServiceItemModelTypeMTOServiceItemInternationalShuttle: true, primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticCrating: true, primemessages.MTOServiceItemModelTypeMTOServiceItemInternationalCrating: true, diff --git a/pkg/handlers/primeapi/payloads/model_to_payload.go b/pkg/handlers/primeapi/payloads/model_to_payload.go index 8dc07ccaa32..8f74b2257dc 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload.go @@ -805,7 +805,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primemessages.MTOServ payload = &cratingSI case models.ReServiceCodeDDSHUT, models.ReServiceCodeDOSHUT: - payload = &primemessages.MTOServiceItemShuttle{ + payload = &primemessages.MTOServiceItemDomesticShuttle{ ReServiceCode: handlers.FmtString(string(mtoServiceItem.ReService.Code)), Reason: mtoServiceItem.Reason, EstimatedWeight: handlers.FmtPoundPtr(mtoServiceItem.EstimatedWeight), diff --git a/pkg/handlers/primeapi/payloads/model_to_payload_test.go b/pkg/handlers/primeapi/payloads/model_to_payload_test.go index 44cf2c2e40d..9e77e368110 100644 --- a/pkg/handlers/primeapi/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapi/payloads/model_to_payload_test.go @@ -958,7 +958,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemDDSHUT() { suite.NotNil(resultDDSHUT) - _, ok := resultDDSHUT.(*primemessages.MTOServiceItemShuttle) + _, ok := resultDDSHUT.(*primemessages.MTOServiceItemDomesticShuttle) suite.True(ok) } diff --git a/pkg/handlers/primeapi/payloads/payload_to_model.go b/pkg/handlers/primeapi/payloads/payload_to_model.go index 53362a88b84..b8137937e92 100644 --- a/pkg/handlers/primeapi/payloads/payload_to_model.go +++ b/pkg/handlers/primeapi/payloads/payload_to_model.go @@ -529,8 +529,8 @@ func MTOServiceItemModel(mtoServiceItem primemessages.MTOServiceItem) (*models.M model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } - case primemessages.MTOServiceItemModelTypeMTOServiceItemShuttle: - shuttleService := mtoServiceItem.(*primemessages.MTOServiceItemShuttle) + case primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: + shuttleService := mtoServiceItem.(*primemessages.MTOServiceItemDomesticShuttle) // values to get from payload model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) model.Reason = shuttleService.Reason diff --git a/pkg/handlers/primeapiv2/move_task_order_test.go b/pkg/handlers/primeapiv2/move_task_order_test.go index 0b4fc4c56d8..f173af34bda 100644 --- a/pkg/handlers/primeapiv2/move_task_order_test.go +++ b/pkg/handlers/primeapiv2/move_task_order_test.go @@ -1190,7 +1190,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { suite.NotNil(payload.ETag()) }) - suite.Run("Success - return all MTOServiceItemShuttle fields assoicated with the getMoveTaskOrder", func() { + suite.Run("Success - return all MTOServiceItemDomesticShuttle fields assoicated with the getMoveTaskOrder", func() { handler := GetMoveTaskOrderHandler{ suite.HandlerConfig(), movetaskorder.NewMoveTaskOrderFetcher(waf), @@ -1257,14 +1257,14 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { json, err := json.Marshal(serviceItemPayload) suite.NoError(err) - payload := primev2messages.MTOServiceItemShuttle{} + payload := primev2messages.MTOServiceItemDomesticShuttle{} err = payload.UnmarshalJSON(json) suite.NoError(err) suite.Equal(serviceItem.MoveTaskOrderID.String(), payload.MoveTaskOrderID().String()) suite.Equal(serviceItem.MTOShipmentID.String(), payload.MtoShipmentID().String()) suite.Equal(serviceItem.ID.String(), payload.ID().String()) - suite.Equal("MTOServiceItemShuttle", string(payload.ModelType())) + suite.Equal("MTOServiceItemDomesticShuttle", string(payload.ModelType())) suite.Equal(string(serviceItem.ReService.Code), string(*payload.ReServiceCode)) suite.Equal(serviceItem.ReService.Name, payload.ReServiceName()) suite.Equal(string(serviceItem.Status), string(payload.Status())) diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload.go b/pkg/handlers/primeapiv2/payloads/model_to_payload.go index 0950f80eafe..8ced7405baf 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload.go @@ -718,7 +718,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primev2messages.MTOSe payload = &cratingSI case models.ReServiceCodeDDSHUT, models.ReServiceCodeDOSHUT: - payload = &primev2messages.MTOServiceItemShuttle{ + payload = &primev2messages.MTOServiceItemDomesticShuttle{ ReServiceCode: handlers.FmtString(string(mtoServiceItem.ReService.Code)), Reason: mtoServiceItem.Reason, EstimatedWeight: handlers.FmtPoundPtr(mtoServiceItem.EstimatedWeight), diff --git a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go index cb69d490a44..fe1c4f469c3 100644 --- a/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv2/payloads/model_to_payload_test.go @@ -868,7 +868,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemDDSHUT() { suite.NotNil(resultDDSHUT) - _, ok := resultDDSHUT.(*primev2messages.MTOServiceItemShuttle) + _, ok := resultDDSHUT.(*primev2messages.MTOServiceItemDomesticShuttle) suite.True(ok) } diff --git a/pkg/handlers/primeapiv2/payloads/payload_to_model.go b/pkg/handlers/primeapiv2/payloads/payload_to_model.go index b628bcc0502..2d31149d3c2 100644 --- a/pkg/handlers/primeapiv2/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv2/payloads/payload_to_model.go @@ -622,8 +622,8 @@ func MTOServiceItemModel(mtoServiceItem primev2messages.MTOServiceItem) (*models model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } - case primev2messages.MTOServiceItemModelTypeMTOServiceItemShuttle: - shuttleService := mtoServiceItem.(*primev2messages.MTOServiceItemShuttle) + case primev2messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: + shuttleService := mtoServiceItem.(*primev2messages.MTOServiceItemDomesticShuttle) // values to get from payload model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) model.Reason = shuttleService.Reason diff --git a/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go b/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go index 3df180b58ea..5a1e7844ab6 100644 --- a/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapiv2/payloads/payload_to_model_test.go @@ -52,7 +52,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { Length: &crateMeasurement, } - DDSHUTServiceItem := &primev2messages.MTOServiceItemShuttle{ + DDSHUTServiceItem := &primev2messages.MTOServiceItemDomesticShuttle{ ReServiceCode: &ddshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, @@ -61,7 +61,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { DDSHUTServiceItem.SetMoveTaskOrderID(handlers.FmtUUID(moveTaskOrderIDField)) DDSHUTServiceItem.SetMtoShipmentID(*mtoShipmentIDString) - DOSHUTServiceItem := &primev2messages.MTOServiceItemShuttle{ + DOSHUTServiceItem := &primev2messages.MTOServiceItemDomesticShuttle{ ReServiceCode: &doshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, diff --git a/pkg/handlers/primeapiv3/move_task_order_test.go b/pkg/handlers/primeapiv3/move_task_order_test.go index 852fb0358c8..09d3c5f3894 100644 --- a/pkg/handlers/primeapiv3/move_task_order_test.go +++ b/pkg/handlers/primeapiv3/move_task_order_test.go @@ -1169,7 +1169,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { suite.NotNil(payload.ETag()) }) - suite.Run("Success - return all MTOServiceItemShuttle fields assoicated with the getMoveTaskOrder", func() { + suite.Run("Success - return all MTOServiceItemDomesticShuttle fields assoicated with the getMoveTaskOrder", func() { handler := setupDefaultTestHandler() successMove := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) @@ -1233,14 +1233,14 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { json, err := json.Marshal(serviceItemPayload) suite.NoError(err) - payload := primev3messages.MTOServiceItemShuttle{} + payload := primev3messages.MTOServiceItemDomesticShuttle{} err = payload.UnmarshalJSON(json) suite.NoError(err) suite.Equal(serviceItem.MoveTaskOrderID.String(), payload.MoveTaskOrderID().String()) suite.Equal(serviceItem.MTOShipmentID.String(), payload.MtoShipmentID().String()) suite.Equal(serviceItem.ID.String(), payload.ID().String()) - suite.Equal("MTOServiceItemShuttle", string(payload.ModelType())) + suite.Equal("MTOServiceItemDomesticShuttle", string(payload.ModelType())) suite.Equal(string(serviceItem.ReService.Code), string(*payload.ReServiceCode)) suite.Equal(serviceItem.ReService.Name, payload.ReServiceName()) suite.Equal(string(serviceItem.Status), string(payload.Status())) diff --git a/pkg/handlers/primeapiv3/mto_service_item.go b/pkg/handlers/primeapiv3/mto_service_item.go index f3c16b46e60..d3ab85fac3b 100644 --- a/pkg/handlers/primeapiv3/mto_service_item.go +++ b/pkg/handlers/primeapiv3/mto_service_item.go @@ -26,6 +26,7 @@ var CreateableServiceItemMap = map[primev3messages.MTOServiceItemModelType]bool{ primev3messages.MTOServiceItemModelTypeMTOServiceItemOriginSIT: true, primev3messages.MTOServiceItemModelTypeMTOServiceItemDestSIT: true, primev3messages.MTOServiceItemModelTypeMTOServiceItemShuttle: true, + primev3messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: true, primev3messages.MTOServiceItemModelTypeMTOServiceItemInternationalShuttle: true, primev3messages.MTOServiceItemModelTypeMTOServiceItemDomesticCrating: true, primev3messages.MTOServiceItemModelTypeMTOServiceItemInternationalCrating: true, diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload.go b/pkg/handlers/primeapiv3/payloads/model_to_payload.go index 4d6d51a9d23..b6b18ff023b 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload.go @@ -863,7 +863,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) primev3messages.MTOSe payload = &cratingSI case models.ReServiceCodeDDSHUT, models.ReServiceCodeDOSHUT: - payload = &primev3messages.MTOServiceItemShuttle{ + payload = &primev3messages.MTOServiceItemDomesticShuttle{ ReServiceCode: handlers.FmtString(string(mtoServiceItem.ReService.Code)), Reason: mtoServiceItem.Reason, EstimatedWeight: handlers.FmtPoundPtr(mtoServiceItem.EstimatedWeight), diff --git a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go index 3ff9bf25b94..52e51d4bd65 100644 --- a/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go +++ b/pkg/handlers/primeapiv3/payloads/model_to_payload_test.go @@ -1145,7 +1145,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemDDSHUT() { suite.NotNil(resultDDSHUT) - _, ok := resultDDSHUT.(*primev3messages.MTOServiceItemShuttle) + _, ok := resultDDSHUT.(*primev3messages.MTOServiceItemDomesticShuttle) suite.True(ok) } diff --git a/pkg/handlers/primeapiv3/payloads/payload_to_model.go b/pkg/handlers/primeapiv3/payloads/payload_to_model.go index f33d8b2ff34..f11c8b9aa28 100644 --- a/pkg/handlers/primeapiv3/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv3/payloads/payload_to_model.go @@ -787,8 +787,8 @@ func MTOServiceItemModel(mtoServiceItem primev3messages.MTOServiceItem) (*models model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } - case primev3messages.MTOServiceItemModelTypeMTOServiceItemShuttle: - shuttleService := mtoServiceItem.(*primev3messages.MTOServiceItemShuttle) + case primev3messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: + shuttleService := mtoServiceItem.(*primev3messages.MTOServiceItemDomesticShuttle) // values to get from payload model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) model.Reason = shuttleService.Reason diff --git a/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go b/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go index fd9430379f0..4f12b050b83 100644 --- a/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapiv3/payloads/payload_to_model_test.go @@ -64,7 +64,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { DCRTServiceItem.SetMoveTaskOrderID(handlers.FmtUUID(moveTaskOrderIDField)) DCRTServiceItem.SetMtoShipmentID(*mtoShipmentIDString) - DDSHUTServiceItem := &primev3messages.MTOServiceItemShuttle{ + DDSHUTServiceItem := &primev3messages.MTOServiceItemDomesticShuttle{ ReServiceCode: &ddshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, @@ -73,7 +73,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { DDSHUTServiceItem.SetMoveTaskOrderID(handlers.FmtUUID(moveTaskOrderIDField)) DDSHUTServiceItem.SetMtoShipmentID(*mtoShipmentIDString) - DOSHUTServiceItem := &primev3messages.MTOServiceItemShuttle{ + DOSHUTServiceItem := &primev3messages.MTOServiceItemDomesticShuttle{ ReServiceCode: &doshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, diff --git a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go index 12ebfd4b8a1..bcad1a9b07e 100644 --- a/pkg/handlers/supportapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/supportapi/internal/payloads/model_to_payload.go @@ -350,7 +350,7 @@ func MTOServiceItem(mtoServiceItem *models.MTOServiceItem) supportmessages.MTOSe StandaloneCrate: mtoServiceItem.StandaloneCrate, } case models.ReServiceCodeDDSHUT, models.ReServiceCodeDOSHUT: - payload = &supportmessages.MTOServiceItemShuttle{ + payload = &supportmessages.MTOServiceItemDomesticShuttle{ ReServiceCode: handlers.FmtString(string(mtoServiceItem.ReService.Code)), Reason: mtoServiceItem.Reason, EstimatedWeight: handlers.FmtPoundPtr(mtoServiceItem.EstimatedWeight), diff --git a/pkg/payment_request/service_param_value_lookups/service_params_cache_test.go b/pkg/payment_request/service_param_value_lookups/service_params_cache_test.go index f55832cc189..999db3de94b 100644 --- a/pkg/payment_request/service_param_value_lookups/service_params_cache_test.go +++ b/pkg/payment_request/service_param_value_lookups/service_params_cache_test.go @@ -20,7 +20,7 @@ type paramsCacheSubtestData struct { mtoServiceItemMS models.MTOServiceItem mtoServiceItemCrate1 models.MTOServiceItem mtoServiceItemCrate2 models.MTOServiceItem - mtoServiceItemShuttle models.MTOServiceItem + mtoServiceItemDomesticShuttle models.MTOServiceItem paramKeyWeightEstimated models.ServiceItemParamKey paramKeyRequestedPickupDate models.ServiceItemParamKey paramKeyMTOAvailableToPrimeAt models.ServiceItemParamKey @@ -224,7 +224,7 @@ func (suite *ServiceParamValueLookupsSuite) makeSubtestData() (subtestData *para subtestData.shuttleEstimatedWeight = unit.Pound(400) subtestData.shuttleActualWeight = unit.Pound(450) - subtestData.mtoServiceItemShuttle = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ + subtestData.mtoServiceItemDomesticShuttle = factory.BuildMTOServiceItem(suite.DB(), []factory.Customization{ { Model: subtestData.move, LinkOnly: true, @@ -248,7 +248,7 @@ func (suite *ServiceParamValueLookupsSuite) makeSubtestData() (subtestData *para // DOSHUT estimated weight factory.BuildServiceParam(suite.DB(), []factory.Customization{ { - Model: subtestData.mtoServiceItemShuttle.ReService, + Model: subtestData.mtoServiceItemDomesticShuttle.ReService, LinkOnly: true, }, { @@ -462,7 +462,7 @@ func (suite *ServiceParamValueLookupsSuite) TestServiceParamCache() { expected := strconv.Itoa(subtestData.estimatedWeight.Int()) suite.Equal(expected, estimatedWeightStr) - paramLookupService2, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, subtestData.mtoServiceItemShuttle, subtestData.paymentRequest.ID, subtestData.paymentRequest.MoveTaskOrderID, ¶mCache) + paramLookupService2, err := ServiceParamLookupInitialize(suite.AppContextForTest(), suite.planner, subtestData.mtoServiceItemDomesticShuttle, subtestData.paymentRequest.ID, subtestData.paymentRequest.MoveTaskOrderID, ¶mCache) suite.NoError(err) var shuttleEstimatedWeightStr string diff --git a/pkg/services/event/notification_test.go b/pkg/services/event/notification_test.go index eea593eba9a..ec669b81daf 100644 --- a/pkg/services/event/notification_test.go +++ b/pkg/services/event/notification_test.go @@ -200,7 +200,7 @@ func (suite *EventServiceSuite) Test_MTOServiceItemPayload() { }, }, }, nil) - data := &primemessages.MTOServiceItemShuttle{} + data := &primemessages.MTOServiceItemDomesticShuttle{} payload, assemblePayloadErr := assembleMTOServiceItemPayload(suite.AppContextForTest(), mtoServiceItemDOSHUT.ID) diff --git a/pkg/services/mto_service_item/mto_service_item_creator_test.go b/pkg/services/mto_service_item/mto_service_item_creator_test.go index d2a7709b9ff..53c78efc407 100644 --- a/pkg/services/mto_service_item/mto_service_item_creator_test.go +++ b/pkg/services/mto_service_item/mto_service_item_creator_test.go @@ -822,7 +822,7 @@ func (suite *MTOServiceItemServiceSuite) TestCreateMTOServiceItem() { }) // If the service item we're trying to create is shuttle service and there is no estimated weight, it fails. - suite.Run("MTOServiceItemShuttle no prime weight is okay", func() { + suite.Run("MTOServiceItemDomesticShuttle no prime weight is okay", func() { // TESTCASE SCENARIO // Under test: CreateMTOServiceItem function // Set up: Create DDSHUT service item on a shipment without estimated weight diff --git a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.jsx b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.jsx index b351755d15b..1bb2f9c517d 100644 --- a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.jsx +++ b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.jsx @@ -20,7 +20,7 @@ const CreateShipmentServiceItemForm = ({ shipment, createServiceItemMutation }) const { MTOServiceItemOriginSIT, MTOServiceItemDestSIT, - MTOServiceItemShuttle, + MTOServiceItemDomesticShuttle, MTOServiceItemDomesticCrating, MTOServiceItemInternationalCrating, MTOServiceItemInternationalShuttle, @@ -49,7 +49,7 @@ const CreateShipmentServiceItemForm = ({ shipment, createServiceItemMutation }) <> - + {enableAlaskaFeatureFlag && } @@ -61,7 +61,7 @@ const CreateShipmentServiceItemForm = ({ shipment, createServiceItemMutation }) {selectedServiceItemType === MTOServiceItemDestSIT && ( )} - {selectedServiceItemType === MTOServiceItemShuttle && ( + {selectedServiceItemType === MTOServiceItemDomesticShuttle && ( )} {selectedServiceItemType === MTOServiceItemInternationalShuttle && ( diff --git a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx index f30c0b9f459..99293f972dc 100644 --- a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx +++ b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx @@ -88,7 +88,7 @@ describe('CreateShipmentServiceItemForm component', () => { it.each([ ['originSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemOriginSIT], ['destinationSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemDestSIT], - ['shuttleSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemShuttle], + ['shuttleSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemDoemsticShuttle], ['DomesticCratingForm', createServiceItemModelTypes.MTOServiceItemDomesticCrating], ['InternationalCratingForm', createServiceItemModelTypes.MTOServiceItemInternationalCrating], ['InternationalShuttleServiceItemForm', createServiceItemModelTypes.MTOServiceItemInternationalShuttle], diff --git a/src/components/PrimeUI/CreateShipmentServiceItemForm/ShuttleSITServiceItemForm.jsx b/src/components/PrimeUI/CreateShipmentServiceItemForm/ShuttleSITServiceItemForm.jsx index 0bb6d6a3747..97dd8e8f128 100644 --- a/src/components/PrimeUI/CreateShipmentServiceItemForm/ShuttleSITServiceItemForm.jsx +++ b/src/components/PrimeUI/CreateShipmentServiceItemForm/ShuttleSITServiceItemForm.jsx @@ -9,7 +9,7 @@ import MaskedTextField from 'components/form/fields/MaskedTextField/MaskedTextFi import { Form } from 'components/form/Form'; import { ShipmentShape } from 'types/shipment'; import { DropdownInput } from 'components/form/fields'; -import { shuttleServiceItemCodeOptions, createServiceItemModelTypes } from 'constants/prime'; +import { domesticShuttleServiceItemCodeOptions, createServiceItemModelTypes } from 'constants/prime'; const shuttleSITValidationSchema = Yup.object().shape({ reServiceCode: Yup.string().required('Required'), @@ -20,7 +20,7 @@ const ShuttleSITServiceItemForm = ({ shipment, submission }) => { const initialValues = { moveTaskOrderID: shipment.moveTaskOrderID, mtoShipmentID: shipment.id, - modelType: createServiceItemModelTypes.MTOServiceItemShuttle, + modelType: createServiceItemModelTypes.MTOServiceItemDomesticShuttle, reason: '', estimatedWeight: null, actualWeight: null, @@ -44,7 +44,7 @@ const ShuttleSITServiceItemForm = ({ shipment, submission }) => { name="reServiceCode" id="reServiceCode" required - options={shuttleServiceItemCodeOptions} + options={domesticShuttleServiceItemCodeOptions} /> + A unique code for the service item. Indicates if shuttling is requested for the shipment origin (`DOSHUT`) + or destination (`DDSHUT`). + enum: + - DOSHUT # Domestic Origin Shuttle Service + - DDSHUT # Domestic Destination Shuttle Service + reason: + type: string + example: Storage items need to be picked up. + description: > + The contractor's explanation for why a shuttle service is requested. Used by the TOO while deciding to + approve or reject the service item. + estimatedWeight: + type: integer + example: 4200 + description: An estimate of how much weight from a shipment will be included in the shuttling service. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: A record of the actual weight that was shuttled. Provided by the movers, based on weight tickets. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode diff --git a/swagger-def/definitions/prime/MTOServiceItemModelType.yaml b/swagger-def/definitions/prime/MTOServiceItemModelType.yaml index 4d0ed5ad684..402844ae3ea 100644 --- a/swagger-def/definitions/prime/MTOServiceItemModelType.yaml +++ b/swagger-def/definitions/prime/MTOServiceItemModelType.yaml @@ -7,6 +7,7 @@ description: > * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -19,6 +20,7 @@ enum: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating diff --git a/swagger-def/prime.yaml b/swagger-def/prime.yaml index 5ca10ba69f1..99ad948fff0 100644 --- a/swagger-def/prime.yaml +++ b/swagger-def/prime.yaml @@ -1718,6 +1718,8 @@ definitions: $ref: 'definitions/prime/MTOServiceItemOriginSIT.yaml' MTOServiceItemShuttle: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemShuttle.yaml' + MTOServiceItemDomesticShuttle: # spectral oas2-unused-definition is OK here due to polymorphism + $ref: 'definitions/prime/MTOServiceItemDomesticShuttle.yaml' MTOServiceItemInternationalFuelSurcharge: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemInternationalFuelSurcharge.yaml' MTOServiceItemInternationalShuttle: # spectral oas2-unused-definition is OK here due to polymorphism diff --git a/swagger-def/prime_v2.yaml b/swagger-def/prime_v2.yaml index 5fb651099b5..7569e750568 100644 --- a/swagger-def/prime_v2.yaml +++ b/swagger-def/prime_v2.yaml @@ -357,6 +357,8 @@ definitions: $ref: 'definitions/prime/MTOServiceItemOriginSIT.yaml' MTOServiceItemShuttle: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemShuttle.yaml' + MTOServiceItemDomesticShuttle: # spectral oas2-unused-definition is OK here due to polymorphism + $ref: 'definitions/prime/MTOServiceItemDomesticShuttle.yaml' MTOServiceItemInternationalShuttle: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemInternationalShuttle.yaml' CreateMTOShipment: diff --git a/swagger-def/prime_v3.yaml b/swagger-def/prime_v3.yaml index b4296ffde49..23931d3b314 100644 --- a/swagger-def/prime_v3.yaml +++ b/swagger-def/prime_v3.yaml @@ -348,6 +348,8 @@ definitions: $ref: 'definitions/prime/MTOServiceItemOriginSIT.yaml' MTOServiceItemShuttle: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemShuttle.yaml' + MTOServiceItemDomesticShuttle: # spectral oas2-unused-definition is OK here due to polymorphism + $ref: 'definitions/prime/MTOServiceItemDomesticShuttle.yaml' MTOServiceItemInternationalShuttle: # spectral oas2-unused-definition is OK here due to polymorphism $ref: 'definitions/prime/MTOServiceItemInternationalShuttle.yaml' MTOServiceItemInternationalFuelSurcharge: # spectral oas2-unused-definition is OK here due to polymorphism diff --git a/swagger-def/support.yaml b/swagger-def/support.yaml index 77d18b9e6af..3cd0611e87d 100644 --- a/swagger-def/support.yaml +++ b/swagger-def/support.yaml @@ -1288,6 +1288,7 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -1299,6 +1300,7 @@ definitions: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating @@ -1369,6 +1371,38 @@ definitions: - reason - reServiceCode - description + MTOServiceItemDomesticShuttle: # spectral oas2-unused-definition is OK here due to polymorphism + description: Describes a shuttle service item. + allOf: + - $ref: '#/definitions/MTOServiceItem' + - type: object + properties: + reServiceCode: + type: string + description: Service codes allowed for this model type. + enum: + - DOSHUT # Domestic Origin Shuttle Service + - DDSHUT # Domestic Destination Shuttle Service + reason: + type: string + example: Storage items need to be picked up. + description: Explanation of why a shuttle service is required. + estimatedWeight: + type: integer + example: 4200 + description: An estimate of how much weight from a shipment will be included in a shuttling (DDSHUT & DOSHUT) service item. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: Provided by the movers, based on weight tickets. Relevant for shuttling (DDSHUT & DOSHUT) service items. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode + - description MTOServiceItemStatus: description: Describes all statuses for a MTOServiceItem. type: string diff --git a/swagger/prime.yaml b/swagger/prime.yaml index e183ef0aa0d..39149c5eb2e 100644 --- a/swagger/prime.yaml +++ b/swagger/prime.yaml @@ -2519,6 +2519,47 @@ definitions: required: - reason - reServiceCode + MTOServiceItemDomesticShuttle: + description: Describes a domestic shuttle service item. + allOf: + - $ref: '#/definitions/MTOServiceItem' + - type: object + properties: + reServiceCode: + type: string + description: > + A unique code for the service item. Indicates if shuttling is + requested for the shipment origin (`DOSHUT`) or destination + (`DDSHUT`). + enum: + - DOSHUT + - DDSHUT + reason: + type: string + example: Storage items need to be picked up. + description: > + The contractor's explanation for why a shuttle service is + requested. Used by the TOO while deciding to approve or reject the + service item. + estimatedWeight: + type: integer + example: 4200 + description: >- + An estimate of how much weight from a shipment will be included in + the shuttling service. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: >- + A record of the actual weight that was shuttled. Provided by the + movers, based on weight tickets. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode MTOServiceItemInternationalFuelSurcharge: description: >- Describes a international Port of Embarkation/Debarkation fuel surcharge @@ -3811,6 +3852,7 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -3823,6 +3865,7 @@ definitions: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating diff --git a/swagger/prime_v2.yaml b/swagger/prime_v2.yaml index 522a9c3157b..88bb030cdc3 100644 --- a/swagger/prime_v2.yaml +++ b/swagger/prime_v2.yaml @@ -686,6 +686,47 @@ definitions: required: - reason - reServiceCode + MTOServiceItemDomesticShuttle: + description: Describes a domestic shuttle service item. + allOf: + - $ref: '#/definitions/MTOServiceItem' + - type: object + properties: + reServiceCode: + type: string + description: > + A unique code for the service item. Indicates if shuttling is + requested for the shipment origin (`DOSHUT`) or destination + (`DDSHUT`). + enum: + - DOSHUT + - DDSHUT + reason: + type: string + example: Storage items need to be picked up. + description: > + The contractor's explanation for why a shuttle service is + requested. Used by the TOO while deciding to approve or reject the + service item. + estimatedWeight: + type: integer + example: 4200 + description: >- + An estimate of how much weight from a shipment will be included in + the shuttling service. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: >- + A record of the actual weight that was shuttled. Provided by the + movers, based on weight tickets. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode MTOServiceItemInternationalShuttle: description: Describes an international shuttle service item. allOf: @@ -2176,6 +2217,7 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -2188,6 +2230,7 @@ definitions: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating diff --git a/swagger/prime_v3.yaml b/swagger/prime_v3.yaml index d06c237667d..ddf980d590c 100644 --- a/swagger/prime_v3.yaml +++ b/swagger/prime_v3.yaml @@ -663,6 +663,47 @@ definitions: required: - reason - reServiceCode + MTOServiceItemDomesticShuttle: + description: Describes a domestic shuttle service item. + allOf: + - $ref: '#/definitions/MTOServiceItem' + - type: object + properties: + reServiceCode: + type: string + description: > + A unique code for the service item. Indicates if shuttling is + requested for the shipment origin (`DOSHUT`) or destination + (`DDSHUT`). + enum: + - DOSHUT + - DDSHUT + reason: + type: string + example: Storage items need to be picked up. + description: > + The contractor's explanation for why a shuttle service is + requested. Used by the TOO while deciding to approve or reject the + service item. + estimatedWeight: + type: integer + example: 4200 + description: >- + An estimate of how much weight from a shipment will be included in + the shuttling service. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: >- + A record of the actual weight that was shuttled. Provided by the + movers, based on weight tickets. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode MTOServiceItemInternationalShuttle: description: Describes an international shuttle service item. allOf: @@ -2283,6 +2324,7 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * IOSHUT, IDSHUT - MTOServiceItemInternationalShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -2295,6 +2337,7 @@ definitions: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating diff --git a/swagger/support.yaml b/swagger/support.yaml index f663ea33d09..4db8b6d39d7 100644 --- a/swagger/support.yaml +++ b/swagger/support.yaml @@ -1395,6 +1395,7 @@ definitions: * DOFSIT, DOASIT - MTOServiceItemOriginSIT * DDFSIT, DDASIT - MTOServiceItemDestSIT * DOSHUT, DDSHUT - MTOServiceItemShuttle + * DOSHUT, DDSHUT - MTOServiceItemDomesticShuttle * DCRT, DUCRT - MTOServiceItemDomesticCrating * ICRT, IUCRT - MTOServiceItemInternationalCrating @@ -1405,6 +1406,7 @@ definitions: - MTOServiceItemOriginSIT - MTOServiceItemDestSIT - MTOServiceItemShuttle + - MTOServiceItemDomesticShuttle - MTOServiceItemInternationalShuttle - MTOServiceItemDomesticCrating - MTOServiceItemInternationalCrating @@ -1482,6 +1484,42 @@ definitions: - reason - reServiceCode - description + MTOServiceItemDomesticShuttle: + description: Describes a shuttle service item. + allOf: + - $ref: '#/definitions/MTOServiceItem' + - type: object + properties: + reServiceCode: + type: string + description: Service codes allowed for this model type. + enum: + - DOSHUT + - DDSHUT + reason: + type: string + example: Storage items need to be picked up. + description: Explanation of why a shuttle service is required. + estimatedWeight: + type: integer + example: 4200 + description: >- + An estimate of how much weight from a shipment will be included in + a shuttling (DDSHUT & DOSHUT) service item. + x-nullable: true + x-omitempty: false + actualWeight: + type: integer + example: 4000 + description: >- + Provided by the movers, based on weight tickets. Relevant for + shuttling (DDSHUT & DOSHUT) service items. + x-nullable: true + x-omitempty: false + required: + - reason + - reServiceCode + - description MTOServiceItemStatus: description: Describes all statuses for a MTOServiceItem. type: string From f148ebe275c0223dd0064e538416b52c5e712ac4 Mon Sep 17 00:00:00 2001 From: Tevin Adams Date: Tue, 28 Jan 2025 19:03:18 +0000 Subject: [PATCH 121/229] Adjust role filtering logic --- .../adminapi/requested_office_users.go | 27 +++++++------------ 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/pkg/handlers/adminapi/requested_office_users.go b/pkg/handlers/adminapi/requested_office_users.go index e81b438b420..647ecc0ad1b 100644 --- a/pkg/handlers/adminapi/requested_office_users.go +++ b/pkg/handlers/adminapi/requested_office_users.go @@ -172,25 +172,18 @@ func filterByTransportationOffice(officeUsers models.OfficeUsers, filteredTransp // Function that filters Requested Office Users based on filtered Roles func filterByRoles(officeUsers models.OfficeUsers, roles roles.Roles) models.OfficeUsers { var filteredOfficeUsers models.OfficeUsers - filteredRoles := roles - for i := range officeUsers { - currentOfficeUser := officeUsers[i] - userRoles := currentOfficeUser.User.Roles - hasFilteredRole := false - - for j := range userRoles { - compUserRole := userRoles[j] - for k := range filteredRoles { - compFilteredRole := filteredRoles[k] - if compUserRole.ID == compFilteredRole.ID { - hasFilteredRole = true - } - } - } + roleIDSet := make(map[uuid.UUID]struct{}) + for _, role := range roles { + roleIDSet[role.ID] = struct{}{} + } - if hasFilteredRole { - filteredOfficeUsers = append(filteredOfficeUsers, currentOfficeUser) + for _, officeUser := range officeUsers { + for _, userRole := range officeUser.User.Roles { + if _, exists := roleIDSet[userRole.ID]; exists { + filteredOfficeUsers = append(filteredOfficeUsers, officeUser) + break + } } } From 45850c9e1eae8a819eab6fb6c2b63300786407be Mon Sep 17 00:00:00 2001 From: pambecker Date: Tue, 28 Jan 2025 19:15:47 +0000 Subject: [PATCH 122/229] change logic to use moves not payment requests for assignment --- pkg/gen/ghcapi/configure_mymove.go | 5 - pkg/gen/ghcapi/embedded_spec.go | 123 +------ pkg/gen/ghcapi/ghcoperations/mymove_api.go | 12 - .../queues/get_bulk_assignment_data.go | 2 +- .../get_bulk_assignment_data_parameters.go | 2 +- ...et_bulk_assignment_payment_request_data.go | 58 --- ...ignment_payment_request_data_parameters.go | 46 --- ...signment_payment_request_data_responses.go | 194 ---------- ...ignment_payment_request_data_urlbuilder.go | 87 ----- .../bulk_assignment_payment_request_data.go | 142 -------- .../bulk_assignment_payment_request_i_ds.go | 70 ---- .../bulk_assignment_payment_request_id.go | 39 -- pkg/handlers/ghcapi/api.go | 6 - .../internal/payloads/model_to_payload.go | 24 -- pkg/handlers/ghcapi/queues.go | 82 ++--- pkg/handlers/ghcapi/queues_test.go | 34 +- pkg/services/move.go | 1 + pkg/services/move/move_fetcher.go | 46 +++ pkg/services/move/move_fetcher_test.go | 332 +++++++++++++++++- pkg/services/payment_request.go | 4 - .../payment_request_fetcher.go | 56 --- .../payment_request_fetcher_test.go | 323 ----------------- src/hooks/queries.js | 15 - src/services/ghcApi.js | 4 - swagger-def/ghc.yaml | 40 +-- swagger/ghc.yaml | 42 +-- 26 files changed, 427 insertions(+), 1362 deletions(-) delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go delete mode 100644 pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go delete mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go delete mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go delete mode 100644 pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go index 21255e64940..32eb5174c09 100644 --- a/pkg/gen/ghcapi/configure_mymove.go +++ b/pkg/gen/ghcapi/configure_mymove.go @@ -232,11 +232,6 @@ func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") }) } - if api.QueuesGetBulkAssignmentPaymentRequestDataHandler == nil { - api.QueuesGetBulkAssignmentPaymentRequestDataHandler = queues.GetBulkAssignmentPaymentRequestDataHandlerFunc(func(params queues.GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetBulkAssignmentPaymentRequestData has not yet been implemented") - }) - } if api.CustomerGetCustomerHandler == nil { api.CustomerGetCustomerHandler = customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index dd4c8faa283..3db3ec66e71 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -4381,14 +4381,15 @@ func init() { "tags": [ "queues" ], - "summary": "Gets data for bulk assignment move modal", + "summary": "Gets data for bulk assignment modal", "operationId": "getBulkAssignmentData", "parameters": [ { "enum": [ "COUNSELING", "CLOSEOUT", - "TASK_ORDER" + "TASK_ORDER", + "PAYMENT_REQUEST" ], "type": "string", "description": "A string corresponding to the queue type", @@ -4415,36 +4416,6 @@ func init() { } } }, - "/queues/bulk-assignment-payment-requests": { - "get": { - "description": "Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets data for bulk assignment payment request modal", - "operationId": "getBulkAssignmentPaymentRequestData", - "responses": { - "200": { - "description": "Successfully returned bulk assignment payment request data", - "schema": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestData" - } - }, - "401": { - "$ref": "#/responses/PermissionDenied" - }, - "404": { - "$ref": "#/responses/NotFound" - }, - "500": { - "$ref": "#/responses/ServerError" - } - } - } - }, "/queues/counseling": { "get": { "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", @@ -6983,28 +6954,6 @@ func init() { "$ref": "#/definitions/BulkAssignmentMoveID" } }, - "BulkAssignmentPaymentRequestData": { - "type": "object", - "properties": { - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "bulkAssignmentPaymentRequestIDs": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestIDs" - } - } - }, - "BulkAssignmentPaymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "BulkAssignmentPaymentRequestIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestID" - } - }, "ClientError": { "type": "object", "required": [ @@ -21071,14 +21020,15 @@ func init() { "tags": [ "queues" ], - "summary": "Gets data for bulk assignment move modal", + "summary": "Gets data for bulk assignment modal", "operationId": "getBulkAssignmentData", "parameters": [ { "enum": [ "COUNSELING", "CLOSEOUT", - "TASK_ORDER" + "TASK_ORDER", + "PAYMENT_REQUEST" ], "type": "string", "description": "A string corresponding to the queue type", @@ -21114,45 +21064,6 @@ func init() { } } }, - "/queues/bulk-assignment-payment-requests": { - "get": { - "description": "Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned\n", - "produces": [ - "application/json" - ], - "tags": [ - "queues" - ], - "summary": "Gets data for bulk assignment payment request modal", - "operationId": "getBulkAssignmentPaymentRequestData", - "responses": { - "200": { - "description": "Successfully returned bulk assignment payment request data", - "schema": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestData" - } - }, - "401": { - "description": "The request was denied", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "404": { - "description": "The requested resource wasn't found", - "schema": { - "$ref": "#/definitions/Error" - } - }, - "500": { - "description": "A server error occurred", - "schema": { - "$ref": "#/definitions/Error" - } - } - } - } - }, "/queues/counseling": { "get": { "description": "An office services counselor user will be assigned a transportation office that will determine which moves are displayed in their queue based on the origin duty location. GHC moves will show up here onced they have reached the NEEDS SERVICE COUNSELING status after submission from a customer or created on a customer's behalf.\n", @@ -24085,28 +23996,6 @@ func init() { "$ref": "#/definitions/BulkAssignmentMoveID" } }, - "BulkAssignmentPaymentRequestData": { - "type": "object", - "properties": { - "availableOfficeUsers": { - "$ref": "#/definitions/AvailableOfficeUsers" - }, - "bulkAssignmentPaymentRequestIDs": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestIDs" - } - } - }, - "BulkAssignmentPaymentRequestID": { - "type": "string", - "format": "uuid", - "example": "c56a4180-65aa-42ec-a945-5fd21dec0538" - }, - "BulkAssignmentPaymentRequestIDs": { - "type": "array", - "items": { - "$ref": "#/definitions/BulkAssignmentPaymentRequestID" - } - }, "ClientError": { "type": "object", "required": [ diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go index de262876e52..c53c0fec4d7 100644 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -167,9 +167,6 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { QueuesGetBulkAssignmentDataHandler: queues.GetBulkAssignmentDataHandlerFunc(func(params queues.GetBulkAssignmentDataParams) middleware.Responder { return middleware.NotImplemented("operation queues.GetBulkAssignmentData has not yet been implemented") }), - QueuesGetBulkAssignmentPaymentRequestDataHandler: queues.GetBulkAssignmentPaymentRequestDataHandlerFunc(func(params queues.GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { - return middleware.NotImplemented("operation queues.GetBulkAssignmentPaymentRequestData has not yet been implemented") - }), CustomerGetCustomerHandler: customer.GetCustomerHandlerFunc(func(params customer.GetCustomerParams) middleware.Responder { return middleware.NotImplemented("operation customer.GetCustomer has not yet been implemented") }), @@ -508,8 +505,6 @@ type MymoveAPI struct { ReServiceItemsGetAllReServiceItemsHandler re_service_items.GetAllReServiceItemsHandler // QueuesGetBulkAssignmentDataHandler sets the operation handler for the get bulk assignment data operation QueuesGetBulkAssignmentDataHandler queues.GetBulkAssignmentDataHandler - // QueuesGetBulkAssignmentPaymentRequestDataHandler sets the operation handler for the get bulk assignment payment request data operation - QueuesGetBulkAssignmentPaymentRequestDataHandler queues.GetBulkAssignmentPaymentRequestDataHandler // CustomerGetCustomerHandler sets the operation handler for the get customer operation CustomerGetCustomerHandler customer.GetCustomerHandler // CustomerSupportRemarksGetCustomerSupportRemarksForMoveHandler sets the operation handler for the get customer support remarks for move operation @@ -841,9 +836,6 @@ func (o *MymoveAPI) Validate() error { if o.QueuesGetBulkAssignmentDataHandler == nil { unregistered = append(unregistered, "queues.GetBulkAssignmentDataHandler") } - if o.QueuesGetBulkAssignmentPaymentRequestDataHandler == nil { - unregistered = append(unregistered, "queues.GetBulkAssignmentPaymentRequestDataHandler") - } if o.CustomerGetCustomerHandler == nil { unregistered = append(unregistered, "customer.GetCustomerHandler") } @@ -1295,10 +1287,6 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) } - o.handlers["GET"]["/queues/bulk-assignment-payment-requests"] = queues.NewGetBulkAssignmentPaymentRequestData(o.context, o.QueuesGetBulkAssignmentPaymentRequestDataHandler) - if o.handlers["GET"] == nil { - o.handlers["GET"] = make(map[string]http.Handler) - } o.handlers["GET"]["/customer/{customerID}"] = customer.NewGetCustomer(o.context, o.CustomerGetCustomerHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go index a5f97625273..a48fbcedc45 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data.go @@ -32,7 +32,7 @@ func NewGetBulkAssignmentData(ctx *middleware.Context, handler GetBulkAssignment /* GetBulkAssignmentData swagger:route GET /queues/bulk-assignment queues getBulkAssignmentData -# Gets data for bulk assignment move modal +# Gets data for bulk assignment modal Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned */ diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go index 57a0402fdae..84675ac3ec4 100644 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go +++ b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_data_parameters.go @@ -84,7 +84,7 @@ func (o *GetBulkAssignmentDataParams) bindQueueType(rawData []string, hasKey boo // validateQueueType carries on validations for parameter QueueType func (o *GetBulkAssignmentDataParams) validateQueueType(formats strfmt.Registry) error { - if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER"}, true); err != nil { + if err := validate.EnumCase("queueType", "query", *o.QueueType, []interface{}{"COUNSELING", "CLOSEOUT", "TASK_ORDER", "PAYMENT_REQUEST"}, true); err != nil { return err } diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go deleted file mode 100644 index 837c5bbda92..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data.go +++ /dev/null @@ -1,58 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime/middleware" -) - -// GetBulkAssignmentPaymentRequestDataHandlerFunc turns a function with the right signature into a get bulk assignment payment request data handler -type GetBulkAssignmentPaymentRequestDataHandlerFunc func(GetBulkAssignmentPaymentRequestDataParams) middleware.Responder - -// Handle executing the request and returning a response -func (fn GetBulkAssignmentPaymentRequestDataHandlerFunc) Handle(params GetBulkAssignmentPaymentRequestDataParams) middleware.Responder { - return fn(params) -} - -// GetBulkAssignmentPaymentRequestDataHandler interface for that can handle valid get bulk assignment payment request data params -type GetBulkAssignmentPaymentRequestDataHandler interface { - Handle(GetBulkAssignmentPaymentRequestDataParams) middleware.Responder -} - -// NewGetBulkAssignmentPaymentRequestData creates a new http.Handler for the get bulk assignment payment request data operation -func NewGetBulkAssignmentPaymentRequestData(ctx *middleware.Context, handler GetBulkAssignmentPaymentRequestDataHandler) *GetBulkAssignmentPaymentRequestData { - return &GetBulkAssignmentPaymentRequestData{Context: ctx, Handler: handler} -} - -/* - GetBulkAssignmentPaymentRequestData swagger:route GET /queues/bulk-assignment-payment-requests queues getBulkAssignmentPaymentRequestData - -# Gets data for bulk assignment payment request modal - -Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the payment requests that are available to be assigned -*/ -type GetBulkAssignmentPaymentRequestData struct { - Context *middleware.Context - Handler GetBulkAssignmentPaymentRequestDataHandler -} - -func (o *GetBulkAssignmentPaymentRequestData) ServeHTTP(rw http.ResponseWriter, r *http.Request) { - route, rCtx, _ := o.Context.RouteInfo(r) - if rCtx != nil { - *r = *rCtx - } - var Params = NewGetBulkAssignmentPaymentRequestDataParams() - if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params - o.Context.Respond(rw, r, route.Produces, route, err) - return - } - - res := o.Handler.Handle(Params) // actually handle the request - o.Context.Respond(rw, r, route.Produces, route, res) - -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go deleted file mode 100644 index f65cec0f219..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_parameters.go +++ /dev/null @@ -1,46 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/errors" - "github.com/go-openapi/runtime/middleware" -) - -// NewGetBulkAssignmentPaymentRequestDataParams creates a new GetBulkAssignmentPaymentRequestDataParams object -// -// There are no default values defined in the spec. -func NewGetBulkAssignmentPaymentRequestDataParams() GetBulkAssignmentPaymentRequestDataParams { - - return GetBulkAssignmentPaymentRequestDataParams{} -} - -// GetBulkAssignmentPaymentRequestDataParams contains all the bound params for the get bulk assignment payment request data operation -// typically these are obtained from a http.Request -// -// swagger:parameters getBulkAssignmentPaymentRequestData -type GetBulkAssignmentPaymentRequestDataParams struct { - - // HTTP Request Object - HTTPRequest *http.Request `json:"-"` -} - -// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface -// for simple values it will use straight method calls. -// -// To ensure default values, the struct must have been initialized with NewGetBulkAssignmentPaymentRequestDataParams() beforehand. -func (o *GetBulkAssignmentPaymentRequestDataParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { - var res []error - - o.HTTPRequest = r - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go deleted file mode 100644 index e89cbdf7c59..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_responses.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "net/http" - - "github.com/go-openapi/runtime" - - "github.com/transcom/mymove/pkg/gen/ghcmessages" -) - -// GetBulkAssignmentPaymentRequestDataOKCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataOK -const GetBulkAssignmentPaymentRequestDataOKCode int = 200 - -/* -GetBulkAssignmentPaymentRequestDataOK Successfully returned bulk assignment payment request data - -swagger:response getBulkAssignmentPaymentRequestDataOK -*/ -type GetBulkAssignmentPaymentRequestDataOK struct { - - /* - In: Body - */ - Payload *ghcmessages.BulkAssignmentPaymentRequestData `json:"body,omitempty"` -} - -// NewGetBulkAssignmentPaymentRequestDataOK creates GetBulkAssignmentPaymentRequestDataOK with default headers values -func NewGetBulkAssignmentPaymentRequestDataOK() *GetBulkAssignmentPaymentRequestDataOK { - - return &GetBulkAssignmentPaymentRequestDataOK{} -} - -// WithPayload adds the payload to the get bulk assignment payment request data o k response -func (o *GetBulkAssignmentPaymentRequestDataOK) WithPayload(payload *ghcmessages.BulkAssignmentPaymentRequestData) *GetBulkAssignmentPaymentRequestDataOK { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment payment request data o k response -func (o *GetBulkAssignmentPaymentRequestDataOK) SetPayload(payload *ghcmessages.BulkAssignmentPaymentRequestData) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentPaymentRequestDataOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(200) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentPaymentRequestDataUnauthorizedCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataUnauthorized -const GetBulkAssignmentPaymentRequestDataUnauthorizedCode int = 401 - -/* -GetBulkAssignmentPaymentRequestDataUnauthorized The request was denied - -swagger:response getBulkAssignmentPaymentRequestDataUnauthorized -*/ -type GetBulkAssignmentPaymentRequestDataUnauthorized struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentPaymentRequestDataUnauthorized creates GetBulkAssignmentPaymentRequestDataUnauthorized with default headers values -func NewGetBulkAssignmentPaymentRequestDataUnauthorized() *GetBulkAssignmentPaymentRequestDataUnauthorized { - - return &GetBulkAssignmentPaymentRequestDataUnauthorized{} -} - -// WithPayload adds the payload to the get bulk assignment payment request data unauthorized response -func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataUnauthorized { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment payment request data unauthorized response -func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentPaymentRequestDataUnauthorized) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(401) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentPaymentRequestDataNotFoundCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataNotFound -const GetBulkAssignmentPaymentRequestDataNotFoundCode int = 404 - -/* -GetBulkAssignmentPaymentRequestDataNotFound The requested resource wasn't found - -swagger:response getBulkAssignmentPaymentRequestDataNotFound -*/ -type GetBulkAssignmentPaymentRequestDataNotFound struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentPaymentRequestDataNotFound creates GetBulkAssignmentPaymentRequestDataNotFound with default headers values -func NewGetBulkAssignmentPaymentRequestDataNotFound() *GetBulkAssignmentPaymentRequestDataNotFound { - - return &GetBulkAssignmentPaymentRequestDataNotFound{} -} - -// WithPayload adds the payload to the get bulk assignment payment request data not found response -func (o *GetBulkAssignmentPaymentRequestDataNotFound) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataNotFound { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment payment request data not found response -func (o *GetBulkAssignmentPaymentRequestDataNotFound) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentPaymentRequestDataNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(404) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} - -// GetBulkAssignmentPaymentRequestDataInternalServerErrorCode is the HTTP code returned for type GetBulkAssignmentPaymentRequestDataInternalServerError -const GetBulkAssignmentPaymentRequestDataInternalServerErrorCode int = 500 - -/* -GetBulkAssignmentPaymentRequestDataInternalServerError A server error occurred - -swagger:response getBulkAssignmentPaymentRequestDataInternalServerError -*/ -type GetBulkAssignmentPaymentRequestDataInternalServerError struct { - - /* - In: Body - */ - Payload *ghcmessages.Error `json:"body,omitempty"` -} - -// NewGetBulkAssignmentPaymentRequestDataInternalServerError creates GetBulkAssignmentPaymentRequestDataInternalServerError with default headers values -func NewGetBulkAssignmentPaymentRequestDataInternalServerError() *GetBulkAssignmentPaymentRequestDataInternalServerError { - - return &GetBulkAssignmentPaymentRequestDataInternalServerError{} -} - -// WithPayload adds the payload to the get bulk assignment payment request data internal server error response -func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) WithPayload(payload *ghcmessages.Error) *GetBulkAssignmentPaymentRequestDataInternalServerError { - o.Payload = payload - return o -} - -// SetPayload sets the payload to the get bulk assignment payment request data internal server error response -func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) SetPayload(payload *ghcmessages.Error) { - o.Payload = payload -} - -// WriteResponse to the client -func (o *GetBulkAssignmentPaymentRequestDataInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { - - rw.WriteHeader(500) - if o.Payload != nil { - payload := o.Payload - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this - } - } -} diff --git a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go deleted file mode 100644 index fe282c8e97f..00000000000 --- a/pkg/gen/ghcapi/ghcoperations/queues/get_bulk_assignment_payment_request_data_urlbuilder.go +++ /dev/null @@ -1,87 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package queues - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the generate command - -import ( - "errors" - "net/url" - golangswaggerpaths "path" -) - -// GetBulkAssignmentPaymentRequestDataURL generates an URL for the get bulk assignment payment request data operation -type GetBulkAssignmentPaymentRequestDataURL struct { - _basePath string -} - -// WithBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetBulkAssignmentPaymentRequestDataURL) WithBasePath(bp string) *GetBulkAssignmentPaymentRequestDataURL { - o.SetBasePath(bp) - return o -} - -// SetBasePath sets the base path for this url builder, only required when it's different from the -// base path specified in the swagger spec. -// When the value of the base path is an empty string -func (o *GetBulkAssignmentPaymentRequestDataURL) SetBasePath(bp string) { - o._basePath = bp -} - -// Build a url path and query string -func (o *GetBulkAssignmentPaymentRequestDataURL) Build() (*url.URL, error) { - var _result url.URL - - var _path = "/queues/bulk-assignment-payment-requests" - - _basePath := o._basePath - if _basePath == "" { - _basePath = "/ghc/v1" - } - _result.Path = golangswaggerpaths.Join(_basePath, _path) - - return &_result, nil -} - -// Must is a helper function to panic when the url builder returns an error -func (o *GetBulkAssignmentPaymentRequestDataURL) Must(u *url.URL, err error) *url.URL { - if err != nil { - panic(err) - } - if u == nil { - panic("url can't be nil") - } - return u -} - -// String returns the string representation of the path with query string -func (o *GetBulkAssignmentPaymentRequestDataURL) String() string { - return o.Must(o.Build()).String() -} - -// BuildFull builds a full url with scheme, host, path and query string -func (o *GetBulkAssignmentPaymentRequestDataURL) BuildFull(scheme, host string) (*url.URL, error) { - if scheme == "" { - return nil, errors.New("scheme is required for a full url on GetBulkAssignmentPaymentRequestDataURL") - } - if host == "" { - return nil, errors.New("host is required for a full url on GetBulkAssignmentPaymentRequestDataURL") - } - - base, err := o.Build() - if err != nil { - return nil, err - } - - base.Scheme = scheme - base.Host = host - return base, nil -} - -// StringFull returns the string representation of a complete url -func (o *GetBulkAssignmentPaymentRequestDataURL) StringFull(scheme, host string) string { - return o.Must(o.BuildFull(scheme, host)).String() -} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go deleted file mode 100644 index 7a431799d17..00000000000 --- a/pkg/gen/ghcmessages/bulk_assignment_payment_request_data.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BulkAssignmentPaymentRequestData bulk assignment payment request data -// -// swagger:model BulkAssignmentPaymentRequestData -type BulkAssignmentPaymentRequestData struct { - - // available office users - AvailableOfficeUsers AvailableOfficeUsers `json:"availableOfficeUsers,omitempty"` - - // bulk assignment payment request i ds - BulkAssignmentPaymentRequestIDs BulkAssignmentPaymentRequestIDs `json:"bulkAssignmentPaymentRequestIDs,omitempty"` -} - -// Validate validates this bulk assignment payment request data -func (m *BulkAssignmentPaymentRequestData) Validate(formats strfmt.Registry) error { - var res []error - - if err := m.validateAvailableOfficeUsers(formats); err != nil { - res = append(res, err) - } - - if err := m.validateBulkAssignmentPaymentRequestIDs(formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BulkAssignmentPaymentRequestData) validateAvailableOfficeUsers(formats strfmt.Registry) error { - if swag.IsZero(m.AvailableOfficeUsers) { // not required - return nil - } - - if err := m.AvailableOfficeUsers.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *BulkAssignmentPaymentRequestData) validateBulkAssignmentPaymentRequestIDs(formats strfmt.Registry) error { - if swag.IsZero(m.BulkAssignmentPaymentRequestIDs) { // not required - return nil - } - - if err := m.BulkAssignmentPaymentRequestIDs.Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bulkAssignmentPaymentRequestIDs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bulkAssignmentPaymentRequestIDs") - } - return err - } - - return nil -} - -// ContextValidate validate this bulk assignment payment request data based on the context it is used -func (m *BulkAssignmentPaymentRequestData) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - if err := m.contextValidateAvailableOfficeUsers(ctx, formats); err != nil { - res = append(res, err) - } - - if err := m.contextValidateBulkAssignmentPaymentRequestIDs(ctx, formats); err != nil { - res = append(res, err) - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -func (m *BulkAssignmentPaymentRequestData) contextValidateAvailableOfficeUsers(ctx context.Context, formats strfmt.Registry) error { - - if err := m.AvailableOfficeUsers.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("availableOfficeUsers") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("availableOfficeUsers") - } - return err - } - - return nil -} - -func (m *BulkAssignmentPaymentRequestData) contextValidateBulkAssignmentPaymentRequestIDs(ctx context.Context, formats strfmt.Registry) error { - - if err := m.BulkAssignmentPaymentRequestIDs.ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName("bulkAssignmentPaymentRequestIDs") - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName("bulkAssignmentPaymentRequestIDs") - } - return err - } - - return nil -} - -// MarshalBinary interface implementation -func (m *BulkAssignmentPaymentRequestData) MarshalBinary() ([]byte, error) { - if m == nil { - return nil, nil - } - return swag.WriteJSON(m) -} - -// UnmarshalBinary interface implementation -func (m *BulkAssignmentPaymentRequestData) UnmarshalBinary(b []byte) error { - var res BulkAssignmentPaymentRequestData - if err := swag.ReadJSON(b, &res); err != nil { - return err - } - *m = res - return nil -} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go deleted file mode 100644 index 7e49b4e7cbd..00000000000 --- a/pkg/gen/ghcmessages/bulk_assignment_payment_request_i_ds.go +++ /dev/null @@ -1,70 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - "strconv" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/swag" -) - -// BulkAssignmentPaymentRequestIDs bulk assignment payment request i ds -// -// swagger:model BulkAssignmentPaymentRequestIDs -type BulkAssignmentPaymentRequestIDs []BulkAssignmentPaymentRequestID - -// Validate validates this bulk assignment payment request i ds -func (m BulkAssignmentPaymentRequestIDs) Validate(formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if err := m[i].Validate(formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validate this bulk assignment payment request i ds based on the context it is used -func (m BulkAssignmentPaymentRequestIDs) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - var res []error - - for i := 0; i < len(m); i++ { - - if swag.IsZero(m[i]) { // not required - return nil - } - - if err := m[i].ContextValidate(ctx, formats); err != nil { - if ve, ok := err.(*errors.Validation); ok { - return ve.ValidateName(strconv.Itoa(i)) - } else if ce, ok := err.(*errors.CompositeError); ok { - return ce.ValidateName(strconv.Itoa(i)) - } - return err - } - - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} diff --git a/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go b/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go deleted file mode 100644 index 699c81bda10..00000000000 --- a/pkg/gen/ghcmessages/bulk_assignment_payment_request_id.go +++ /dev/null @@ -1,39 +0,0 @@ -// Code generated by go-swagger; DO NOT EDIT. - -package ghcmessages - -// This file was generated by the swagger tool. -// Editing this file might prove futile when you re-run the swagger generate command - -import ( - "context" - - "github.com/go-openapi/errors" - "github.com/go-openapi/strfmt" - "github.com/go-openapi/validate" -) - -// BulkAssignmentPaymentRequestID bulk assignment payment request ID -// Example: c56a4180-65aa-42ec-a945-5fd21dec0538 -// -// swagger:model BulkAssignmentPaymentRequestID -type BulkAssignmentPaymentRequestID strfmt.UUID - -// Validate validates this bulk assignment payment request ID -func (m BulkAssignmentPaymentRequestID) Validate(formats strfmt.Registry) error { - var res []error - - if err := validate.FormatOf("", "body", "uuid", strfmt.UUID(m).String(), formats); err != nil { - return err - } - - if len(res) > 0 { - return errors.CompositeValidationError(res...) - } - return nil -} - -// ContextValidate validates this bulk assignment payment request ID based on context it is used -func (m BulkAssignmentPaymentRequestID) ContextValidate(ctx context.Context, formats strfmt.Registry) error { - return nil -} diff --git a/pkg/handlers/ghcapi/api.go b/pkg/handlers/ghcapi/api.go index 7f9ae729452..38ea0a31b64 100644 --- a/pkg/handlers/ghcapi/api.go +++ b/pkg/handlers/ghcapi/api.go @@ -541,12 +541,6 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI { move.NewMoveFetcherBulkAssignment(), } - ghcAPI.QueuesGetBulkAssignmentPaymentRequestDataHandler = GetPaymentRequestBulkAssignmentDataHandler{ - handlerConfig, - officeusercreator.NewOfficeUserFetcherPop(), - paymentrequest.NewPaymentRequestFetcherBulkAssignment(), - } - ghcAPI.QueuesGetMovesQueueHandler = GetMovesQueueHandler{ handlerConfig, order.NewOrderFetcher(), diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 65e86296242..7c5b503c83a 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2184,30 +2184,6 @@ func BulkAssignmentData(appCtx appcontext.AppContext, moves []models.MoveWithEar return *bulkAssignmentData } -func BulkAssignmentPaymentRequestData(appCtx appcontext.AppContext, paymentRequests []models.PaymentRequestWithEarliestRequestedDate, officeUsers []models.OfficeUserWithWorkload) ghcmessages.BulkAssignmentPaymentRequestData { - availableOfficeUsers := make(ghcmessages.AvailableOfficeUsers, len(officeUsers)) - availablePaymentRequests := make(ghcmessages.BulkAssignmentPaymentRequestIDs, len(paymentRequests)) - - for i, officeUser := range officeUsers { - availableOfficeUsers[i] = &ghcmessages.AvailableOfficeUser{ - LastName: officeUser.LastName, - FirstName: officeUser.FirstName, - OfficeUserID: *handlers.FmtUUID(officeUser.ID), - Workload: int64(officeUser.Workload), - } - } - for i, paymentRequest := range paymentRequests { - availablePaymentRequests[i] = ghcmessages.BulkAssignmentPaymentRequestID(strfmt.UUID(paymentRequest.ID.String())) - } - - bulkAssignmentPaymentRequestData := &ghcmessages.BulkAssignmentPaymentRequestData{ - AvailableOfficeUsers: availableOfficeUsers, - BulkAssignmentPaymentRequestIDs: availablePaymentRequests, - } - - return *bulkAssignmentPaymentRequestData -} - func queueMoveIsAssignable(move models.Move, assignedToUser *ghcmessages.AssignedOfficeUser, isCloseoutQueue bool, officeUser models.OfficeUser, ppmCloseoutGblocs bool) bool { // default to false isAssignable := false diff --git a/pkg/handlers/ghcapi/queues.go b/pkg/handlers/ghcapi/queues.go index 2117a07e0d8..f0349275b6a 100644 --- a/pkg/handlers/ghcapi/queues.go +++ b/pkg/handlers/ghcapi/queues.go @@ -633,69 +633,29 @@ func (h GetBulkAssignmentDataHandler) Handle( } officeUserData = payloads.BulkAssignmentData(appCtx, moves, officeUsers, officeUser.TransportationOffice.ID) - } - return queues.NewGetBulkAssignmentDataOK().WithPayload(&officeUserData), nil - }) -} - -// GetPaymentRequestBulkAssignmentDataHandler returns payment requests that the supervisor can assign, along with the office users they are able to assign to -type GetPaymentRequestBulkAssignmentDataHandler struct { - handlers.HandlerConfig - services.OfficeUserFetcherPop - services.PaymentRequestFetcherBulkAssignment -} - -func (h GetPaymentRequestBulkAssignmentDataHandler) Handle( - params queues.GetBulkAssignmentPaymentRequestDataParams, -) middleware.Responder { - return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, - func(appCtx appcontext.AppContext) (middleware.Responder, error) { - if !appCtx.Session().IsOfficeUser() { - err := apperror.NewForbiddenError("not an office user") - appCtx.Logger().Error("Must be an office user", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataUnauthorized(), err - } - - officeUser, err := h.OfficeUserFetcherPop.FetchOfficeUserByID(appCtx, appCtx.Session().OfficeUserID) - if err != nil { - appCtx.Logger().Error("Error retrieving office_user", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataNotFound(), err - } - - privileges, err := models.FetchPrivilegesForUser(appCtx.DB(), *officeUser.UserID) - if err != nil { - appCtx.Logger().Error("Error retreiving user privileges", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataNotFound(), err - } - - isSupervisor := privileges.HasPrivilege(models.PrivilegeTypeSupervisor) - if !isSupervisor { - appCtx.Logger().Error("Unauthorized", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataUnauthorized(), err - } + case string(models.QueueTypePaymentRequest): + // fetch the TIOs who work at their office + officeUsers, err := h.OfficeUserFetcherPop.FetchOfficeUsersWithWorkloadByRoleAndOffice( + appCtx, + roles.RoleTypeTIO, + officeUser.TransportationOfficeID, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving office users", zap.Error(err)) + return queues.NewGetBulkAssignmentDataInternalServerError(), err + } + // fetch the moves available to be assigned to their office users + moves, err := h.MoveFetcherBulkAssignment.FetchMovesForBulkAssignmentTaskOrder( + appCtx, officeUser.TransportationOffice.Gbloc, officeUser.TransportationOffice.ID, + ) + if err != nil { + appCtx.Logger().Error("Error retreiving moves", zap.Error(err)) + return queues.NewGetBulkAssignmentDataInternalServerError(), err + } - // fetch the TIOs who work at their office - officeUsers, err := h.OfficeUserFetcherPop.FetchOfficeUsersWithWorkloadByRoleAndOffice( - appCtx, - roles.RoleTypeTIO, - officeUser.TransportationOfficeID, - ) - if err != nil { - appCtx.Logger().Error("Error retreiving TIO office users", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err - } - // fetch the payment requests available to be assigned to their office users - paymentRequests, err := h.PaymentRequestFetcherBulkAssignment.FetchPaymentRequestsForBulkAssignment( - appCtx, officeUser.TransportationOffice.Gbloc, - ) - if err != nil { - appCtx.Logger().Error("Error retreiving payment requests", zap.Error(err)) - return queues.NewGetBulkAssignmentPaymentRequestDataInternalServerError(), err + officeUserData = payloads.BulkAssignmentData(appCtx, moves, officeUsers, officeUser.TransportationOffice.ID) } - - officeUserData := payloads.BulkAssignmentPaymentRequestData(appCtx, paymentRequests, officeUsers) - - return queues.NewGetBulkAssignmentPaymentRequestDataOK().WithPayload(&officeUserData), nil + return queues.NewGetBulkAssignmentDataOK().WithPayload(&officeUserData), nil }) } diff --git a/pkg/handlers/ghcapi/queues_test.go b/pkg/handlers/ghcapi/queues_test.go index f497e9e8c17..30d277ec6a5 100644 --- a/pkg/handlers/ghcapi/queues_test.go +++ b/pkg/handlers/ghcapi/queues_test.go @@ -1643,7 +1643,7 @@ func (suite *HandlerSuite) TestGetServicesCounselingQueueHandler() { } func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { - suite.Run("returns an unauthorized error when an attempt is made by a non supervisor", func() { + suite.Run("SC - returns an unauthorized error when an attempt is made by a non supervisor", func() { officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ { Model: models.OfficeUser{ @@ -1677,7 +1677,7 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { suite.IsNotErrResponse(response) suite.IsType(&queues.GetBulkAssignmentDataUnauthorized{}, response) }) - suite.Run("returns properly formatted bulk assignment data", func() { + suite.Run("SC - returns properly formatted bulk assignment data", func() { transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ @@ -1808,10 +1808,8 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { suite.Len(payload.AvailableOfficeUsers, 1) suite.Len(payload.BulkAssignmentMoveIDs, 1) }) -} -func (suite *HandlerSuite) TestGetPaymentRequestBulkAssignmentDataHandler() { - suite.Run("TIO - bulk assign payment request - returns an unauthorized error when an attempt is made by a non supervisor", func() { + suite.Run("TIO - returns an unauthorized error when an attempt is made by a non supervisor", func() { officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ { Model: models.OfficeUser{ @@ -1829,22 +1827,22 @@ func (suite *HandlerSuite) TestGetPaymentRequestBulkAssignmentDataHandler() { }, }, nil) - request := httptest.NewRequest("GET", "/queues/bulk-assignment-payment-requests", nil) + request := httptest.NewRequest("GET", "/queues/bulk-assignment", nil) request = suite.AuthenticateOfficeRequest(request, officeUser) - params := queues.GetBulkAssignmentPaymentRequestDataParams{ + params := queues.GetBulkAssignmentDataParams{ HTTPRequest: request, } handlerConfig := suite.HandlerConfig() - handler := GetPaymentRequestBulkAssignmentDataHandler{ + handler := GetBulkAssignmentDataHandler{ handlerConfig, officeusercreator.NewOfficeUserFetcherPop(), - paymentrequest.NewPaymentRequestFetcherBulkAssignment(), + movefetcher.NewMoveFetcherBulkAssignment(), } response := handler.Handle(params) suite.IsNotErrResponse(response) - suite.IsType(&queues.GetBulkAssignmentPaymentRequestDataUnauthorized{}, response) + suite.IsType(&queues.GetBulkAssignmentDataUnauthorized{}, response) }) - suite.Run("TIO - payment request - returns properly formatted bulk assignment data", func() { + suite.Run("TIO - returns properly formatted bulk assignment data", func() { transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) officeUser := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ @@ -1903,23 +1901,23 @@ func (suite *HandlerSuite) TestGetPaymentRequestBulkAssignmentDataHandler() { }, }, nil) - request := httptest.NewRequest("GET", "/queues/bulk-assignment-payment-requests", nil) + request := httptest.NewRequest("GET", "/queues/bulk-assignment", nil) request = suite.AuthenticateOfficeRequest(request, officeUser) - params := queues.GetBulkAssignmentPaymentRequestDataParams{ + params := queues.GetBulkAssignmentDataParams{ HTTPRequest: request, } handlerConfig := suite.HandlerConfig() - handler := GetPaymentRequestBulkAssignmentDataHandler{ + handler := GetBulkAssignmentDataHandler{ handlerConfig, officeusercreator.NewOfficeUserFetcherPop(), - paymentrequest.NewPaymentRequestFetcherBulkAssignment(), + movefetcher.NewMoveFetcherBulkAssignment(), } response := handler.Handle(params) suite.IsNotErrResponse(response) - suite.IsType(&queues.GetBulkAssignmentPaymentRequestDataOK{}, response) - payload := response.(*queues.GetBulkAssignmentPaymentRequestDataOK).Payload + suite.IsType(&queues.GetBulkAssignmentDataOK{}, response) + payload := response.(*queues.GetBulkAssignmentDataOK).Payload suite.NoError(payload.Validate(strfmt.Default)) suite.Len(payload.AvailableOfficeUsers, 1) - suite.Len(payload.BulkAssignmentPaymentRequestIDs, 1) + suite.Len(payload.BulkAssignmentMoveIDs, 1) }) } diff --git a/pkg/services/move.go b/pkg/services/move.go index 8ddda83a8ec..9a3e8c22517 100644 --- a/pkg/services/move.go +++ b/pkg/services/move.go @@ -32,6 +32,7 @@ type MoveFetcher interface { type MoveFetcherBulkAssignment interface { FetchMovesForBulkAssignmentCounseling(appCtx appcontext.AppContext, gbloc string, officeId uuid.UUID) ([]models.MoveWithEarliestDate, error) FetchMovesForBulkAssignmentTaskOrder(appCtx appcontext.AppContext, gbloc string, officeId uuid.UUID) ([]models.MoveWithEarliestDate, error) + FetchMovesForBulkAssignmentPaymentRequest(appCtx appcontext.AppContext, gbloc string, officeId uuid.UUID) ([]models.MoveWithEarliestDate, error) } //go:generate mockery --name MoveSearcher diff --git a/pkg/services/move/move_fetcher.go b/pkg/services/move/move_fetcher.go index 4d8b922f678..d77f81e9cf1 100644 --- a/pkg/services/move/move_fetcher.go +++ b/pkg/services/move/move_fetcher.go @@ -222,3 +222,49 @@ func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentTaskOrder(appCtx a return moves, nil } + +func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentPaymentRequest(appCtx appcontext.AppContext, gbloc string, officeId uuid.UUID) ([]models.MoveWithEarliestDate, error) { + var moves []models.MoveWithEarliestDate + + sqlQuery := ` + SELECT + moves.id, + payment_requests.requested_at + FROM payment_requests + INNER JOIN moves on moves.id = payment_requests.move_id + INNER JOIN orders ON orders.id = moves.orders_id + INNER JOIN service_members ON orders.service_member_id = service_members.id + LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id + WHERE payment_requests.status = 'PENDING' + AND moves.show = $1 + AND (orders.orders_type NOT IN ($2, $3, $4)) + AND moves.tio_assigned_id IS NULL ` + if gbloc == "USMC" { + sqlQuery += ` + AND service_members.affiliation ILIKE 'MARINES' ` + } else { + sqlQuery += ` + AND service_members.affiliation != 'MARINES' + AND move_to_gbloc.gbloc = '` + gbloc + `' ` + } + sqlQuery += ` + GROUP BY payment_requests.id + ORDER BY payment_requests.requested_at ASC` + + err := appCtx.DB().RawQuery(sqlQuery, + models.BoolPointer(true), + internalmessages.OrdersTypeBLUEBARK, + internalmessages.OrdersTypeWOUNDEDWARRIOR, + internalmessages.OrdersTypeSAFETY). + All(&moves) + + if err != nil { + return nil, fmt.Errorf("error fetching moves for office: %s with error %w", officeId, err) + } + + if len(moves) < 1 { + return nil, nil + } + + return moves, nil +} diff --git a/pkg/services/move/move_fetcher_test.go b/pkg/services/move/move_fetcher_test.go index 8936aa35c77..17008fbd362 100644 --- a/pkg/services/move/move_fetcher_test.go +++ b/pkg/services/move/move_fetcher_test.go @@ -3,6 +3,8 @@ package move import ( "time" + "github.com/gofrs/uuid" + "github.com/transcom/mymove/pkg/apperror" "github.com/transcom/mymove/pkg/factory" "github.com/transcom/mymove/pkg/gen/internalmessages" @@ -149,7 +151,7 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentSC() { return moveFetcher, move, transportationOffice, officeUser } - suite.Run("Returns moves that fulfill the query's criteria", func() { + suite.Run("SC - Returns moves that fulfill the query's criteria", func() { moveFetcher, _, _, officeUser := setupTestData() moves, err := moveFetcher.FetchMovesForBulkAssignmentCounseling(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) suite.FatalNoError(err) @@ -647,3 +649,331 @@ func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentTOO() { }) } + +func (suite *MoveServiceSuite) TestMoveFetcherBulkAssignmentTIO() { + setupTestData := func() (services.MoveFetcherBulkAssignment, models.TransportationOffice, models.OfficeUser) { + moveFetcher := NewMoveFetcherBulkAssignment() + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + // this move has a transportation office associated with it that matches + // the TIO's transportation office and should be found + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + move2 := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move2, + LinkOnly: true, + }, + }, nil) + + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, []roles.RoleType{roles.RoleTypeTIO}) + + return moveFetcher, transportationOffice, officeUser + } + + suite.Run("TIO: Returns moves that fulfill the query criteria", func() { + moveFetcher, _, officeUser := setupTestData() + moves, err := moveFetcher.FetchMovesForBulkAssignmentPaymentRequest(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(2, len(moves)) + }) + + suite.Run("Does not return moves that are already assigned", func() { + moveFetcher := NewMoveFetcherBulkAssignment() + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, []roles.RoleType{roles.RoleTypeTIO}) + + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: officeUser, + LinkOnly: true, + Type: &factory.OfficeUsers.TIOAssignedUser, + }, + }, nil) + assignedPaymentRequest := factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentPaymentRequest(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + + // confirm that the assigned move isn't returned + for _, move := range moves { + suite.NotEqual(move.ID, assignedPaymentRequest.ID) + } + + // confirm that the rest of the details are correct + // move is APPROVALS REQUESTED STATUS + suite.Equal(assignedPaymentRequest.Status, models.PaymentRequestStatusPending) + // GBLOC is the same + suite.Equal(*move.Orders.OriginDutyLocationGBLOC, officeUser.TransportationOffice.Gbloc) + // Show is true + suite.Equal(move.Show, models.BoolPointer(true)) + // Orders type isn't WW, BB, or Safety + suite.Equal(move.Orders.OrdersType, internalmessages.OrdersTypePERMANENTCHANGEOFSTATION) + }) + + suite.Run("TIO: Does not return moves with safety, bluebark, or wounded warrior order types", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + moveSafety := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeSAFETY, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveSafety, + LinkOnly: true, + }, + }, nil) + + moveBB := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeBLUEBARK, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveBB, + LinkOnly: true, + }, + }, nil) + + moveWW := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Order{ + OrdersType: internalmessages.OrdersTypeWOUNDEDWARRIOR, + }, + }, + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: moveWW, + LinkOnly: true, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentPaymentRequest(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(2, len(moves)) + }) + + suite.Run("TIO: Does not return payment requests with Marines if GBLOC not USMC", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + + marine := models.AffiliationMARINES + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.ServiceMember{ + Affiliation: &marine, + }, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentPaymentRequest(suite.AppContextForTest(), "KKFA", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(2, len(moves)) + }) + + suite.Run("TIO: Only return payment requests with Marines if GBLOC is USMC", func() { + moveFetcher, transportationOffice, officeUser := setupTestData() + + marine := models.AffiliationMARINES + move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusServiceCounselingCompleted, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.ServiceMember{ + Affiliation: &marine, + }, + }, + }, nil) + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: models.PaymentRequest{ + ID: uuid.Must(uuid.NewV4()), + IsFinal: false, + Status: models.PaymentRequestStatusPending, + RejectionReason: nil, + }, + }, + { + Model: move, + LinkOnly: true, + }, + }, nil) + + moves, err := moveFetcher.FetchMovesForBulkAssignmentPaymentRequest(suite.AppContextForTest(), "USMC", officeUser.TransportationOffice.ID) + suite.FatalNoError(err) + suite.Equal(1, len(moves)) + }) +} diff --git a/pkg/services/payment_request.go b/pkg/services/payment_request.go index 74c3e5a6e98..ae7e345dc94 100644 --- a/pkg/services/payment_request.go +++ b/pkg/services/payment_request.go @@ -122,7 +122,3 @@ type ShipmentsPaymentSITBalance interface { type PaymentRequestBulkDownloadCreator interface { CreatePaymentRequestBulkDownload(appCtx appcontext.AppContext, paymentRequestID uuid.UUID) (afero.File, error) } - -type PaymentRequestFetcherBulkAssignment interface { - FetchPaymentRequestsForBulkAssignment(appCtx appcontext.AppContext, gbloc string) ([]models.PaymentRequestWithEarliestRequestedDate, error) -} diff --git a/pkg/services/payment_request/payment_request_fetcher.go b/pkg/services/payment_request/payment_request_fetcher.go index 78c5c311baf..b08d948d756 100644 --- a/pkg/services/payment_request/payment_request_fetcher.go +++ b/pkg/services/payment_request/payment_request_fetcher.go @@ -2,13 +2,11 @@ package paymentrequest import ( "database/sql" - "fmt" "github.com/gofrs/uuid" "github.com/transcom/mymove/pkg/appcontext" "github.com/transcom/mymove/pkg/apperror" - "github.com/transcom/mymove/pkg/gen/internalmessages" "github.com/transcom/mymove/pkg/models" "github.com/transcom/mymove/pkg/services" ) @@ -60,57 +58,3 @@ func (p *paymentRequestFetcher) FetchPaymentRequest(appCtx appcontext.AppContext return paymentRequest, err } - -type paymentRequestFetcherBulkAssignment struct { -} - -// NewPaymentRequestFetcherBulkAssignment creates a new paymentRequestFetcherBulkAssignment service -func NewPaymentRequestFetcherBulkAssignment() services.PaymentRequestFetcherBulkAssignment { - return &paymentRequestFetcherBulkAssignment{} -} - -func (f paymentRequestFetcherBulkAssignment) FetchPaymentRequestsForBulkAssignment(appCtx appcontext.AppContext, gbloc string) ([]models.PaymentRequestWithEarliestRequestedDate, error) { - var payment_requests []models.PaymentRequestWithEarliestRequestedDate - - sqlQuery := ` - SELECT - payment_requests.id, - payment_requests.requested_at - FROM payment_requests - INNER JOIN moves on moves.id = payment_requests.move_id - INNER JOIN orders ON orders.id = moves.orders_id - INNER JOIN service_members ON orders.service_member_id = service_members.id - LEFT JOIN move_to_gbloc ON move_to_gbloc.move_id = moves.id - WHERE payment_requests.status = 'PENDING' - AND moves.show = $1 - AND (orders.orders_type NOT IN ($2, $3, $4)) - AND moves.tio_assigned_id IS NULL ` - if gbloc == "USMC" { - sqlQuery += ` - AND service_members.affiliation ILIKE 'MARINES' ` - } else { - sqlQuery += ` - AND service_members.affiliation != 'MARINES' - AND move_to_gbloc.gbloc = '` + gbloc + `' ` - } - sqlQuery += ` - GROUP BY payment_requests.id - ORDER BY payment_requests.requested_at ASC` - - err := appCtx.DB().RawQuery(sqlQuery, - models.BoolPointer(true), - internalmessages.OrdersTypeBLUEBARK, - internalmessages.OrdersTypeWOUNDEDWARRIOR, - internalmessages.OrdersTypeSAFETY). - All(&payment_requests) - - if err != nil { - return nil, fmt.Errorf("error fetching payment requests for GBLOC: %s with error %w", gbloc, err) - } - - if len(payment_requests) < 1 { - return nil, nil - } - - return payment_requests, nil -} diff --git a/pkg/services/payment_request/payment_request_fetcher_test.go b/pkg/services/payment_request/payment_request_fetcher_test.go index fcb30090d86..ab05924690f 100644 --- a/pkg/services/payment_request/payment_request_fetcher_test.go +++ b/pkg/services/payment_request/payment_request_fetcher_test.go @@ -5,10 +5,7 @@ import ( "github.com/transcom/mymove/pkg/apperror" "github.com/transcom/mymove/pkg/factory" - "github.com/transcom/mymove/pkg/gen/internalmessages" "github.com/transcom/mymove/pkg/models" - "github.com/transcom/mymove/pkg/models/roles" - "github.com/transcom/mymove/pkg/services" ) func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequest() { @@ -68,323 +65,3 @@ func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequest() { suite.Equal(models.PaymentRequest{}, paymentRequest) }) } - -func (suite *PaymentRequestServiceSuite) TestFetchPaymentRequestsForBulkAssignment() { - setupTestData := func() (services.PaymentRequestFetcherBulkAssignment, models.TransportationOffice) { - paymentRequestFetcher := NewPaymentRequestFetcherBulkAssignment() - transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) - - // this move has a transportation office associated with it that matches - // the TIO's transportation office and should be found - move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: move, - LinkOnly: true, - }, - }, nil) - - move2 := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: move2, - LinkOnly: true, - }, - }, nil) - - return paymentRequestFetcher, transportationOffice - } - - suite.Run("TIO: Returns payment requests that fulfill the query criteria", func() { - paymentRequestFetcher, _ := setupTestData() - paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") - suite.FatalNoError(err) - suite.Equal(2, len(paymentRequests)) - }) - - suite.Run("Does not return moves that are already assigned", func() { - paymentRequestFetcher := NewPaymentRequestFetcherBulkAssignment() - transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) - - officeUser := factory.BuildOfficeUserWithRoles(suite.DB(), []factory.Customization{ - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, []roles.RoleType{roles.RoleTypeTIO}) - - move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - { - Model: officeUser, - LinkOnly: true, - Type: &factory.OfficeUsers.TIOAssignedUser, - }, - }, nil) - assignedPaymentRequest := factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: move, - LinkOnly: true, - }, - }, nil) - - paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") - suite.FatalNoError(err) - - // confirm that the assigned move isn't returned - for _, paymentRequest := range paymentRequests { - suite.NotEqual(paymentRequest.ID, assignedPaymentRequest.ID) - } - - // confirm that the rest of the details are correct - // move is APPROVALS REQUESTED STATUS - suite.Equal(assignedPaymentRequest.Status, models.PaymentRequestStatusPending) - // GBLOC is the same - suite.Equal(*move.Orders.OriginDutyLocationGBLOC, officeUser.TransportationOffice.Gbloc) - // Show is true - suite.Equal(move.Show, models.BoolPointer(true)) - // Orders type isn't WW, BB, or Safety - suite.Equal(move.Orders.OrdersType, internalmessages.OrdersTypePERMANENTCHANGEOFSTATION) - }) - - suite.Run("TIO: Does not return payment requests with safety, bluebark, or wounded warrior order types", func() { - paymentRequestFetcher, transportationOffice := setupTestData() - moveSafety := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Order{ - OrdersType: internalmessages.OrdersTypeSAFETY, - }, - }, - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: moveSafety, - LinkOnly: true, - }, - }, nil) - - moveBB := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Order{ - OrdersType: internalmessages.OrdersTypeBLUEBARK, - }, - }, - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: moveBB, - LinkOnly: true, - }, - }, nil) - - moveWW := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Order{ - OrdersType: internalmessages.OrdersTypeWOUNDEDWARRIOR, - }, - }, - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: moveWW, - LinkOnly: true, - }, - }, nil) - - paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") - suite.FatalNoError(err) - suite.Equal(2, len(paymentRequests)) - }) - - suite.Run("TIO: Does not return payment requests with Marines if GBLOC not USMC", func() { - paymentRequestFetcher, transportationOffice := setupTestData() - - marine := models.AffiliationMARINES - move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Move{ - Status: models.MoveStatusAPPROVALSREQUESTED, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - { - Model: models.ServiceMember{ - Affiliation: &marine, - }, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: move, - LinkOnly: true, - }, - }, nil) - - paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "KKFA") - suite.FatalNoError(err) - suite.Equal(2, len(paymentRequests)) - }) - - suite.Run("TIO: Only return payment requests with Marines if GBLOC is USMC", func() { - paymentRequestFetcher, transportationOffice := setupTestData() - - marine := models.AffiliationMARINES - move := factory.BuildMoveWithShipment(suite.DB(), []factory.Customization{ - { - Model: models.Move{ - Status: models.MoveStatusServiceCounselingCompleted, - }, - }, - { - Model: transportationOffice, - LinkOnly: true, - Type: &factory.TransportationOffices.CounselingOffice, - }, - { - Model: models.ServiceMember{ - Affiliation: &marine, - }, - }, - }, nil) - factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ - { - Model: models.PaymentRequest{ - ID: uuid.Must(uuid.NewV4()), - IsFinal: false, - Status: models.PaymentRequestStatusPending, - RejectionReason: nil, - }, - }, - { - Model: move, - LinkOnly: true, - }, - }, nil) - - paymentRequests, err := paymentRequestFetcher.FetchPaymentRequestsForBulkAssignment(suite.AppContextForTest(), "USMC") - suite.FatalNoError(err) - suite.Equal(1, len(paymentRequests)) - }) -} diff --git a/src/hooks/queries.js b/src/hooks/queries.js index cf67da7c887..ce469702359 100644 --- a/src/hooks/queries.js +++ b/src/hooks/queries.js @@ -35,7 +35,6 @@ import { searchCustomers, getGBLOCs, getBulkAssignmentData, - getBulkAssignmentPaymentRequestData, } from 'services/ghcApi'; import { getLoggedInUserQueries } from 'services/internalApi'; import { getPrimeSimulatorMove } from 'services/primeApi'; @@ -235,20 +234,6 @@ export const useBulkAssignmentQueries = (queueType) => { }; }; -export const useBulkAssignmentPaymentRequestQueries = (queueType) => { - const { data: bulkAssignmentPaymentRequestData, ...bulkAssignmentPaymentRequestDataQuery } = useQuery( - [queueType], - ({ queryKey }) => getBulkAssignmentPaymentRequestData(queryKey), - ); - const { isLoading, isError, isSuccess } = getQueriesStatus([bulkAssignmentPaymentRequestDataQuery]); - return { - bulkAssignmentPaymentRequestData, - isLoading, - isError, - isSuccess, - }; -}; - export const useEditShipmentQueries = (moveCode) => { // Get the orders info const { data: move = {}, ...moveQuery } = useQuery([MOVES, moveCode], ({ queryKey }) => getMove(...queryKey)); diff --git a/src/services/ghcApi.js b/src/services/ghcApi.js index cec540c4881..1b787b7b8ad 100644 --- a/src/services/ghcApi.js +++ b/src/services/ghcApi.js @@ -146,10 +146,6 @@ export async function getBulkAssignmentData(queueType) { return makeGHCRequest('queues.getBulkAssignmentData', { queueType }, { normalize: false }); } -export async function getBulkAssignmentPaymentRequestData(queueType) { - return makeGHCRequest('queues.getBulkAssignmentPaymentRequestData', { queueType }, { normalize: false }); -} - export async function createCustomerSupportRemarkForMove({ body, locator }) { return makeGHCRequest('customerSupportRemarks.createCustomerSupportRemarkForMove', { body, diff --git a/swagger-def/ghc.yaml b/swagger-def/ghc.yaml index 8036745e8e8..df06a4ca220 100644 --- a/swagger-def/ghc.yaml +++ b/swagger-def/ghc.yaml @@ -3517,7 +3517,7 @@ paths: get: produces: - application/json - summary: Gets data for bulk assignment move modal + summary: Gets data for bulk assignment modal description: > Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office users that work under them, and the moves that are available to be assigned operationId: getBulkAssignmentData @@ -3532,6 +3532,7 @@ paths: - COUNSELING - CLOSEOUT - TASK_ORDER + - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment data @@ -3543,28 +3544,6 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' - /queues/bulk-assignment-payment-requests: - get: - produces: - - application/json - summary: Gets data for bulk assignment payment request modal - description: > - Supervisor office users are able to bulk assign payment requests. This endpoint returns the relevant data to them; - the current workload of the office users that work under them, and the payment requests that are available to be assigned - operationId: getBulkAssignmentPaymentRequestData - tags: - - queues - responses: - '200': - description: Successfully returned bulk assignment payment request data - schema: - $ref: '#/definitions/BulkAssignmentPaymentRequestData' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' /queues/counseling/origin-list: get: produces: @@ -7093,14 +7072,6 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 - BulkAssignmentPaymentRequestIDs: - type: array - items: - $ref: '#/definitions/BulkAssignmentPaymentRequestID' - BulkAssignmentPaymentRequestID: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 AvailableOfficeUsers: type: array items: @@ -7127,13 +7098,6 @@ definitions: $ref: '#/definitions/AvailableOfficeUsers' bulkAssignmentMoveIDs: $ref: '#/definitions/BulkAssignmentMoveIDs' - BulkAssignmentPaymentRequestData: - type: object - properties: - availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' - bulkAssignmentPaymentRequestIDs: - $ref: '#/definitions/BulkAssignmentPaymentRequestIDs' QueueMoves: type: array items: diff --git a/swagger/ghc.yaml b/swagger/ghc.yaml index 04f9619d407..a92ed3016a6 100644 --- a/swagger/ghc.yaml +++ b/swagger/ghc.yaml @@ -3650,7 +3650,7 @@ paths: get: produces: - application/json - summary: Gets data for bulk assignment move modal + summary: Gets data for bulk assignment modal description: > Supervisor office users are able to bulk assign moves. This endpoint returns the relevant data to them; the current workload of the office @@ -3668,6 +3668,7 @@ paths: - COUNSELING - CLOSEOUT - TASK_ORDER + - PAYMENT_REQUEST responses: '200': description: Successfully returned bulk assignment data @@ -3679,30 +3680,6 @@ paths: $ref: '#/responses/NotFound' '500': $ref: '#/responses/ServerError' - /queues/bulk-assignment-payment-requests: - get: - produces: - - application/json - summary: Gets data for bulk assignment payment request modal - description: > - Supervisor office users are able to bulk assign payment requests. This - endpoint returns the relevant data to them; the current workload of the - office users that work under them, and the payment requests that are - available to be assigned - operationId: getBulkAssignmentPaymentRequestData - tags: - - queues - responses: - '200': - description: Successfully returned bulk assignment payment request data - schema: - $ref: '#/definitions/BulkAssignmentPaymentRequestData' - '401': - $ref: '#/responses/PermissionDenied' - '404': - $ref: '#/responses/NotFound' - '500': - $ref: '#/responses/ServerError' /queues/counseling/origin-list: get: produces: @@ -7444,14 +7421,6 @@ definitions: type: string format: uuid example: c56a4180-65aa-42ec-a945-5fd21dec0538 - BulkAssignmentPaymentRequestIDs: - type: array - items: - $ref: '#/definitions/BulkAssignmentPaymentRequestID' - BulkAssignmentPaymentRequestID: - type: string - format: uuid - example: c56a4180-65aa-42ec-a945-5fd21dec0538 AvailableOfficeUsers: type: array items: @@ -7478,13 +7447,6 @@ definitions: $ref: '#/definitions/AvailableOfficeUsers' bulkAssignmentMoveIDs: $ref: '#/definitions/BulkAssignmentMoveIDs' - BulkAssignmentPaymentRequestData: - type: object - properties: - availableOfficeUsers: - $ref: '#/definitions/AvailableOfficeUsers' - bulkAssignmentPaymentRequestIDs: - $ref: '#/definitions/BulkAssignmentPaymentRequestIDs' QueueMoves: type: array items: From 741b18d5604277edbdad56ab4f2a724da82d33e8 Mon Sep 17 00:00:00 2001 From: pambecker Date: Tue, 28 Jan 2025 20:21:32 +0000 Subject: [PATCH 123/229] updates --- pkg/handlers/ghcapi/queues.go | 2 +- pkg/handlers/ghcapi/queues_test.go | 2 ++ pkg/services/move/move_fetcher.go | 4 ++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/ghcapi/queues.go b/pkg/handlers/ghcapi/queues.go index f0349275b6a..8ff66f2d5d9 100644 --- a/pkg/handlers/ghcapi/queues.go +++ b/pkg/handlers/ghcapi/queues.go @@ -645,7 +645,7 @@ func (h GetBulkAssignmentDataHandler) Handle( return queues.NewGetBulkAssignmentDataInternalServerError(), err } // fetch the moves available to be assigned to their office users - moves, err := h.MoveFetcherBulkAssignment.FetchMovesForBulkAssignmentTaskOrder( + moves, err := h.MoveFetcherBulkAssignment.FetchMovesForBulkAssignmentPaymentRequest( appCtx, officeUser.TransportationOffice.Gbloc, officeUser.TransportationOffice.ID, ) if err != nil { diff --git a/pkg/handlers/ghcapi/queues_test.go b/pkg/handlers/ghcapi/queues_test.go index dd15e7bbb0d..2fb476e8c58 100644 --- a/pkg/handlers/ghcapi/queues_test.go +++ b/pkg/handlers/ghcapi/queues_test.go @@ -1843,6 +1843,7 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { request = suite.AuthenticateOfficeRequest(request, officeUser) params := queues.GetBulkAssignmentDataParams{ HTTPRequest: request, + QueueType: models.StringPointer("PAYMENT_REQUEST"), } handlerConfig := suite.HandlerConfig() handler := GetBulkAssignmentDataHandler{ @@ -1917,6 +1918,7 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { request = suite.AuthenticateOfficeRequest(request, officeUser) params := queues.GetBulkAssignmentDataParams{ HTTPRequest: request, + QueueType: models.StringPointer("PAYMENT_REQUEST"), } handlerConfig := suite.HandlerConfig() handler := GetBulkAssignmentDataHandler{ diff --git a/pkg/services/move/move_fetcher.go b/pkg/services/move/move_fetcher.go index d77f81e9cf1..42772b151fc 100644 --- a/pkg/services/move/move_fetcher.go +++ b/pkg/services/move/move_fetcher.go @@ -229,7 +229,7 @@ func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentPaymentRequest(app sqlQuery := ` SELECT moves.id, - payment_requests.requested_at + payment_requests.requested_at AS earliest_date FROM payment_requests INNER JOIN moves on moves.id = payment_requests.move_id INNER JOIN orders ON orders.id = moves.orders_id @@ -248,7 +248,7 @@ func (f moveFetcherBulkAssignment) FetchMovesForBulkAssignmentPaymentRequest(app AND move_to_gbloc.gbloc = '` + gbloc + `' ` } sqlQuery += ` - GROUP BY payment_requests.id + GROUP BY moves.id, payment_requests.id ORDER BY payment_requests.requested_at ASC` err := appCtx.DB().RawQuery(sqlQuery, From a0b85f7615f052357ad6dbd9534f5339f658b4c2 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Tue, 28 Jan 2025 21:14:16 +0000 Subject: [PATCH 124/229] add ppm closeout unassign counselor to move history --- .../FinishDocumentReviewMoves.jsx | 18 ++++++++ .../FinishDocumentReviewMoves.test.jsx | 42 +++++++++++++++++++ .../MoveHistory/EventTemplates/index.js | 1 + 3 files changed, 61 insertions(+) create mode 100644 src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.jsx create mode 100644 src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx diff --git a/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.jsx b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.jsx new file mode 100644 index 00000000000..1764fc61497 --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.jsx @@ -0,0 +1,18 @@ +import React from 'react'; + +import o from 'constants/MoveHistory/UIDisplay/Operations'; +import a from 'constants/MoveHistory/Database/Actions'; +import t from 'constants/MoveHistory/Database/Tables'; + +export default { + action: a.UPDATE, + eventName: o.finishDocumentReview, + tableName: t.moves, + getEventNameDisplay: () => 'Updated move', + getDetails: ({ changedValues }) => ( + <> +
PPM Closeout Complete
+ {changedValues?.sc_assigned_id !== undefined ?
Closeout Counselor Unassigned
: null} + + ), +}; diff --git a/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx new file mode 100644 index 00000000000..4e43cdca1cf --- /dev/null +++ b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx @@ -0,0 +1,42 @@ +import { screen, render } from '@testing-library/react'; + +import e from 'constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves'; +import getTemplate from 'constants/MoveHistory/TemplateManager'; + +describe('When given a completed services counseling for a move', () => { + const historyRecord = { + action: 'UPDATE', + eventName: 'finishDocumentReview', + tableName: 'moves', + }; + it('correctly matches the update mto status services counseling completed event to the proper template', () => { + const template = getTemplate(historyRecord); + expect(template).toMatchObject(e); + }); + + it('displays the proper name in the event name display column', () => { + const template = getTemplate(historyRecord); + + render(template.getEventNameDisplay(historyRecord)); + expect(screen.getByText('Updated move')).toBeInTheDocument(); + }); + + it('displays default when TIO ID is not present', () => { + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('PPM Closeout Complete')).toBeInTheDocument(); + }); + + it('displays correct details when a TIO is unassigned', () => { + historyRecord.changedValues = { + ...historyRecord.changedValues, + sc_assigned_id: null, + }; + const template = getTemplate(historyRecord); + + render(template.getDetails(historyRecord)); + expect(screen.getByText('PPM Closeout Complete')).toBeInTheDocument(); + expect(screen.getByText('Closeout Counselor Unassigned')).toBeInTheDocument(); + }); +}); diff --git a/src/constants/MoveHistory/EventTemplates/index.js b/src/constants/MoveHistory/EventTemplates/index.js index 9036e31baaf..b729c57984c 100644 --- a/src/constants/MoveHistory/EventTemplates/index.js +++ b/src/constants/MoveHistory/EventTemplates/index.js @@ -115,3 +115,4 @@ export { default as updateAssignedOfficeUser } from './UpdateAssignedOfficeUser/ export { default as deleteAssignedOfficeUser } from './UpdateAssignedOfficeUser/DeleteAssignedOfficeUser'; export { default as UpdatePaymentRequestStatusMoves } from './UpdatePaymentRequestStatus/UpdatePaymentRequestStatusMoves'; export { default as reviewShipmentAddressUpdate } from './ReviewShipmentAddressUpdate/reviewShipmentAddressUpdate'; +export { default as FinishDocumentReviewMoves } from './FinishDocumentReview/FinishDocumentReviewMoves'; From 115d4c57821311b77b63ff9d3c52f2f9fd90c195 Mon Sep 17 00:00:00 2001 From: Brooklyn Welsh Date: Tue, 28 Jan 2025 21:34:25 +0000 Subject: [PATCH 125/229] Fixed missing ignored col in migration --- ..._create_audit_history_table_for_payment_service_items.up.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql index a5875998071..8318441ef8d 100644 --- a/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql +++ b/migrations/app/schema/20250109194140_create_audit_history_table_for_payment_service_items.up.sql @@ -1 +1 @@ -SELECT add_audit_history_table(target_table := 'payment_service_items', audit_rows := BOOLEAN 't', audit_query_text := BOOLEAN 't', ignored_cols := ARRAY['created_at', 'updated_at', 'denied_at', 'requested_at', 'sent_to_gex_at']); \ No newline at end of file +SELECT add_audit_history_table(target_table := 'payment_service_items', audit_rows := BOOLEAN 't', audit_query_text := BOOLEAN 't', ignored_cols := ARRAY['created_at', 'updated_at', 'denied_at', 'requested_at', 'sent_to_gex_at', 'approved_at']); \ No newline at end of file From 55952fb7bc0de9a5d4645a87066633466282ac92 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 29 Jan 2025 14:10:33 +0000 Subject: [PATCH 126/229] fixing tests --- pkg/handlers/primeapi/payloads/payload_to_model_test.go | 4 ++-- .../CreateShipmentServiceItemForm.test.jsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/primeapi/payloads/payload_to_model_test.go b/pkg/handlers/primeapi/payloads/payload_to_model_test.go index 9b5ec6f69a5..d45071aa7fa 100644 --- a/pkg/handlers/primeapi/payloads/payload_to_model_test.go +++ b/pkg/handlers/primeapi/payloads/payload_to_model_test.go @@ -65,7 +65,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { DCRTServiceItem.SetMoveTaskOrderID(handlers.FmtUUID(moveTaskOrderIDField)) DCRTServiceItem.SetMtoShipmentID(*mtoShipmentIDString) - DDSHUTServiceItem := &primemessages.MTOServiceItemShuttle{ + DDSHUTServiceItem := &primemessages.MTOServiceItemDomesticShuttle{ ReServiceCode: &ddshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, @@ -74,7 +74,7 @@ func (suite *PayloadsSuite) TestMTOServiceItemModel() { DDSHUTServiceItem.SetMoveTaskOrderID(handlers.FmtUUID(moveTaskOrderIDField)) DDSHUTServiceItem.SetMtoShipmentID(*mtoShipmentIDString) - DOSHUTServiceItem := &primemessages.MTOServiceItemShuttle{ + DOSHUTServiceItem := &primemessages.MTOServiceItemDomesticShuttle{ ReServiceCode: &doshutCode, Reason: &reason, EstimatedWeight: &estimatedWeight, diff --git a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx index 99293f972dc..59c136325ce 100644 --- a/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx +++ b/src/components/PrimeUI/CreateShipmentServiceItemForm/CreateShipmentServiceItemForm.test.jsx @@ -88,7 +88,7 @@ describe('CreateShipmentServiceItemForm component', () => { it.each([ ['originSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemOriginSIT], ['destinationSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemDestSIT], - ['shuttleSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemDoemsticShuttle], + ['shuttleSITServiceItemForm', createServiceItemModelTypes.MTOServiceItemDomesticShuttle], ['DomesticCratingForm', createServiceItemModelTypes.MTOServiceItemDomesticCrating], ['InternationalCratingForm', createServiceItemModelTypes.MTOServiceItemInternationalCrating], ['InternationalShuttleServiceItemForm', createServiceItemModelTypes.MTOServiceItemInternationalShuttle], From 8ff11345a7061f3ffdd016b6ff7f1cde867089f8 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Wed, 29 Jan 2025 14:49:54 +0000 Subject: [PATCH 127/229] bugfix for TIO assigned --- pkg/handlers/ghcapi/internal/payloads/model_to_payload.go | 8 ++++++++ .../payment_request/payment_request_list_fetcher.go | 1 + 2 files changed, 9 insertions(+) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 09ae933d70b..366c2d9e120 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2458,6 +2458,7 @@ func queuePaymentRequestStatus(paymentRequest models.PaymentRequest) string { } +// dad // QueuePaymentRequests payload func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers []models.OfficeUser, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser, activeRole string) *ghcmessages.QueuePaymentRequests { @@ -2516,6 +2517,13 @@ func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers [ if isSupervisor && orders.OrdersType == "SAFETY" { availableOfficeUsers = officeUsersSafety } + + // if the assigned TIO doesn't work at the user's counseling office, append them + if queuePaymentRequests[i].AssignedTo != nil && paymentRequest.MoveTaskOrder.TIOAssignedUser.TransportationOfficeID != officeUser.TransportationOfficeID { + availableOfficeUsers = append(availableOfficeUsers, *paymentRequest.MoveTaskOrder.TIOAssignedUser) + } + + // if they're not a supervisor and it is assignable, the only option should be themself if !isSupervisor { availableOfficeUsers = models.OfficeUsers{officeUser} } diff --git a/pkg/services/payment_request/payment_request_list_fetcher.go b/pkg/services/payment_request/payment_request_list_fetcher.go index 11f0c52805c..fc42b14dc63 100644 --- a/pkg/services/payment_request/payment_request_list_fetcher.go +++ b/pkg/services/payment_request/payment_request_list_fetcher.go @@ -65,6 +65,7 @@ func (f *paymentRequestListFetcher) FetchPaymentRequestList(appCtx appcontext.Ap "MoveTaskOrder.Orders.OriginDutyLocation.TransportationOffice", "MoveTaskOrder.Orders.OriginDutyLocation.Address", "MoveTaskOrder.TIOAssignedUser", + "MoveTaskOrder.TIOAssignedUser.TransportationOfficeID", "MoveTaskOrder.CounselingOffice", // See note further below about having to do this in a separate Load call due to a Pop issue. // "MoveTaskOrder.Orders.ServiceMember", From e3915bc6d6cca51c7138c65c5f4ae54d91885cf9 Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 29 Jan 2025 16:23:34 +0000 Subject: [PATCH 128/229] fixing issue with domestic shuttle --- pkg/handlers/primeapiv2/mto_service_item.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/handlers/primeapiv2/mto_service_item.go b/pkg/handlers/primeapiv2/mto_service_item.go index 5188ccea511..495a597b88f 100644 --- a/pkg/handlers/primeapiv2/mto_service_item.go +++ b/pkg/handlers/primeapiv2/mto_service_item.go @@ -26,6 +26,7 @@ var CreateableServiceItemMap = map[primev2messages.MTOServiceItemModelType]bool{ primev2messages.MTOServiceItemModelTypeMTOServiceItemOriginSIT: true, primev2messages.MTOServiceItemModelTypeMTOServiceItemDestSIT: true, primev2messages.MTOServiceItemModelTypeMTOServiceItemShuttle: true, + primev2messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: true, primev2messages.MTOServiceItemModelTypeMTOServiceItemInternationalShuttle: true, primev2messages.MTOServiceItemModelTypeMTOServiceItemDomesticCrating: true, primev2messages.MTOServiceItemModelTypeMTOServiceItemInternationalCrating: true, From bab5e3b75c9ba5e2576f16c621527ab2e9d9c28e Mon Sep 17 00:00:00 2001 From: Daniel Jordan Date: Wed, 29 Jan 2025 16:45:17 +0000 Subject: [PATCH 129/229] adding POEFSC and PODFSC to weight billed lookup and picking minimum --- .../weight_billed_lookup.go | 19 ++++++++++--------- .../weight_billed_lookup_test.go | 14 +++++++------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/pkg/payment_request/service_param_value_lookups/weight_billed_lookup.go b/pkg/payment_request/service_param_value_lookups/weight_billed_lookup.go index bca7555ea28..2a3e2f8bb62 100644 --- a/pkg/payment_request/service_param_value_lookups/weight_billed_lookup.go +++ b/pkg/payment_request/service_param_value_lookups/weight_billed_lookup.go @@ -200,8 +200,13 @@ func applyMinimum(code models.ReServiceCode, shipmentType models.MTOShipmentType switch shipmentType { case models.MTOShipmentTypeUnaccompaniedBaggage: switch code { - case models.ReServiceCodeIOSHUT, - models.ReServiceCodeIDSHUT: + case models.ReServiceCodeUBP, + models.ReServiceCodeIUBPK, + models.ReServiceCodeIUBUPK, + models.ReServiceCodeIOSHUT, + models.ReServiceCodeIDSHUT, + models.ReServiceCodePODFSC, + models.ReServiceCodePOEFSC: if weight < 300 { result = 300 } @@ -238,16 +243,12 @@ func applyMinimum(code models.ReServiceCode, shipmentType models.MTOShipmentType models.ReServiceCodeIDDSIT, models.ReServiceCodeIOSHUT, models.ReServiceCodeIDSHUT, - models.ReServiceCodeFSC: + models.ReServiceCodeFSC, + models.ReServiceCodePODFSC, + models.ReServiceCodePOEFSC: if weight < 500 { result = 500 } - case models.ReServiceCodeUBP, - models.ReServiceCodeIUBPK, - models.ReServiceCodeIUBUPK: - if weight < 300 { - result = 300 - } } } return fmt.Sprintf("%d", result) diff --git a/pkg/payment_request/service_param_value_lookups/weight_billed_lookup_test.go b/pkg/payment_request/service_param_value_lookups/weight_billed_lookup_test.go index 78072940ae1..74ffcd88754 100644 --- a/pkg/payment_request/service_param_value_lookups/weight_billed_lookup_test.go +++ b/pkg/payment_request/service_param_value_lookups/weight_billed_lookup_test.go @@ -95,15 +95,15 @@ func (suite *ServiceParamValueLookupsSuite) TestWeightBilledLookup() { {models.ReServiceCodeDDDSIT, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, // International {models.ReServiceCodeISLH, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeUBP, unit.Pound(250), "300", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeISLH, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeUBP, unit.Pound(250), "300", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeISLH, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeUBP, unit.Pound(250), "300", models.MTOShipmentTypeHHG}, {models.ReServiceCodeIHPK, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, {models.ReServiceCodeIHUPK, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeIUBPK, unit.Pound(250), "300", models.MTOShipmentTypeHHG}, - {models.ReServiceCodeIUBUPK, unit.Pound(250), "300", models.MTOShipmentTypeHHG}, + {models.ReServiceCodePOEFSC, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, + {models.ReServiceCodePODFSC, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, + {models.ReServiceCodeUBP, unit.Pound(250), "300", models.MTOShipmentTypeUnaccompaniedBaggage}, + {models.ReServiceCodeIUBPK, unit.Pound(250), "300", models.MTOShipmentTypeUnaccompaniedBaggage}, + {models.ReServiceCodeIUBUPK, unit.Pound(250), "300", models.MTOShipmentTypeUnaccompaniedBaggage}, + {models.ReServiceCodePOEFSC, unit.Pound(250), "300", models.MTOShipmentTypeUnaccompaniedBaggage}, + {models.ReServiceCodePODFSC, unit.Pound(250), "300", models.MTOShipmentTypeUnaccompaniedBaggage}, // International SIT {models.ReServiceCodeIOFSIT, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, {models.ReServiceCodeIDFSIT, unit.Pound(450), "500", models.MTOShipmentTypeHHG}, From 763b709bac37d775f1c5162dc0c0cb07be3aa9ec Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Wed, 29 Jan 2025 18:21:39 +0000 Subject: [PATCH 130/229] Allowing MTO shuttle to be created --- pkg/handlers/primeapi/payloads/payload_to_model.go | 8 ++++++++ pkg/handlers/primeapiv2/payloads/payload_to_model.go | 7 +++++++ pkg/handlers/primeapiv3/payloads/payload_to_model.go | 7 +++++++ 3 files changed, 22 insertions(+) diff --git a/pkg/handlers/primeapi/payloads/payload_to_model.go b/pkg/handlers/primeapi/payloads/payload_to_model.go index b8137937e92..77d0db1e1f6 100644 --- a/pkg/handlers/primeapi/payloads/payload_to_model.go +++ b/pkg/handlers/primeapi/payloads/payload_to_model.go @@ -529,6 +529,14 @@ func MTOServiceItemModel(mtoServiceItem primemessages.MTOServiceItem) (*models.M model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } + case primemessages.MTOServiceItemModelTypeMTOServiceItemShuttle: + shuttleService := mtoServiceItem.(*primemessages.MTOServiceItemShuttle) + // values to get from payload + model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) + model.Reason = shuttleService.Reason + model.EstimatedWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.EstimatedWeight) + model.ActualWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.ActualWeight) + case primemessages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: shuttleService := mtoServiceItem.(*primemessages.MTOServiceItemDomesticShuttle) // values to get from payload diff --git a/pkg/handlers/primeapiv2/payloads/payload_to_model.go b/pkg/handlers/primeapiv2/payloads/payload_to_model.go index 2d31149d3c2..b57e5ca541b 100644 --- a/pkg/handlers/primeapiv2/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv2/payloads/payload_to_model.go @@ -621,6 +621,13 @@ func MTOServiceItemModel(mtoServiceItem primev2messages.MTOServiceItem) (*models if model.SITDestinationFinalAddress != nil { model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } + case primev2messages.MTOServiceItemModelTypeMTOServiceItemShuttle: + shuttleService := mtoServiceItem.(*primev2messages.MTOServiceItemShuttle) + // values to get from payload + model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) + model.Reason = shuttleService.Reason + model.EstimatedWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.EstimatedWeight) + model.ActualWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.ActualWeight) case primev2messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: shuttleService := mtoServiceItem.(*primev2messages.MTOServiceItemDomesticShuttle) diff --git a/pkg/handlers/primeapiv3/payloads/payload_to_model.go b/pkg/handlers/primeapiv3/payloads/payload_to_model.go index f11c8b9aa28..2acc20eb04a 100644 --- a/pkg/handlers/primeapiv3/payloads/payload_to_model.go +++ b/pkg/handlers/primeapiv3/payloads/payload_to_model.go @@ -786,6 +786,13 @@ func MTOServiceItemModel(mtoServiceItem primev3messages.MTOServiceItem) (*models if model.SITDestinationFinalAddress != nil { model.SITDestinationFinalAddressID = &model.SITDestinationFinalAddress.ID } + case primev3messages.MTOServiceItemModelTypeMTOServiceItemShuttle: + shuttleService := mtoServiceItem.(*primev3messages.MTOServiceItemShuttle) + // values to get from payload + model.ReService.Code = models.ReServiceCode(*shuttleService.ReServiceCode) + model.Reason = shuttleService.Reason + model.EstimatedWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.EstimatedWeight) + model.ActualWeight = handlers.PoundPtrFromInt64Ptr(shuttleService.ActualWeight) case primev3messages.MTOServiceItemModelTypeMTOServiceItemDomesticShuttle: shuttleService := mtoServiceItem.(*primev3messages.MTOServiceItemDomesticShuttle) From 257f3490e523cd83fadf470a583ec96696bbc361 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:30:32 +0000 Subject: [PATCH 131/229] include conus addresses when getting rate area info for prime api --- pkg/handlers/primeapiv3/move_task_order.go | 2 +- pkg/services/mocks/ShipmentRateAreaFinder.go | 6 +- pkg/services/mto_shipment.go | 2 +- .../mto_shipment_rate_area_fetcher.go | 68 +++++++++++++------ .../mto_shipment_rate_area_fetcher_test.go | 10 +-- 5 files changed, 59 insertions(+), 29 deletions(-) diff --git a/pkg/handlers/primeapiv3/move_task_order.go b/pkg/handlers/primeapiv3/move_task_order.go index c725fe7210b..20a260a4ae5 100644 --- a/pkg/handlers/primeapiv3/move_task_order.go +++ b/pkg/handlers/primeapiv3/move_task_order.go @@ -106,7 +106,7 @@ func (h GetMoveTaskOrderHandler) Handle(params movetaskorderops.GetMoveTaskOrder /** End of Feature Flag **/ // Add oconus rate area information to payload - shipmentPostalCodeRateArea, err := h.shipmentRateAreaFinder.GetPrimeMoveShipmentOconusRateArea(appCtx, *mto) + shipmentPostalCodeRateArea, err := h.shipmentRateAreaFinder.GetPrimeMoveShipmentRateAreas(appCtx, *mto) if err != nil { appCtx.Logger().Error("primeapi.GetMoveTaskOrderHandler error", zap.Error(err)) return movetaskorderops.NewGetMoveTaskOrderInternalServerError().WithPayload( diff --git a/pkg/services/mocks/ShipmentRateAreaFinder.go b/pkg/services/mocks/ShipmentRateAreaFinder.go index 663a74a3cb8..594551f1295 100644 --- a/pkg/services/mocks/ShipmentRateAreaFinder.go +++ b/pkg/services/mocks/ShipmentRateAreaFinder.go @@ -16,12 +16,12 @@ type ShipmentRateAreaFinder struct { mock.Mock } -// GetPrimeMoveShipmentOconusRateArea provides a mock function with given fields: appCtx, move -func (_m *ShipmentRateAreaFinder) GetPrimeMoveShipmentOconusRateArea(appCtx appcontext.AppContext, move models.Move) (*[]services.ShipmentPostalCodeRateArea, error) { +// GetPrimeMoveShipmentRateAreas provides a mock function with given fields: appCtx, move +func (_m *ShipmentRateAreaFinder) GetPrimeMoveShipmentRateAreas(appCtx appcontext.AppContext, move models.Move) (*[]services.ShipmentPostalCodeRateArea, error) { ret := _m.Called(appCtx, move) if len(ret) == 0 { - panic("no return value specified for GetPrimeMoveShipmentOconusRateArea") + panic("no return value specified for GetPrimeMoveShipmentRateAreas") } var r0 *[]services.ShipmentPostalCodeRateArea diff --git a/pkg/services/mto_shipment.go b/pkg/services/mto_shipment.go index 187d290cb9f..8f6c372bc75 100644 --- a/pkg/services/mto_shipment.go +++ b/pkg/services/mto_shipment.go @@ -163,5 +163,5 @@ type ShipmentPostalCodeRateArea struct { // //go:generate mockery --name ShipmentRateAreaFinder type ShipmentRateAreaFinder interface { - GetPrimeMoveShipmentOconusRateArea(appCtx appcontext.AppContext, move models.Move) (*[]ShipmentPostalCodeRateArea, error) + GetPrimeMoveShipmentRateAreas(appCtx appcontext.AppContext, move models.Move) (*[]ShipmentPostalCodeRateArea, error) } diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go index bbc290dba9e..10c808d5ed0 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go @@ -22,7 +22,7 @@ func NewMTOShipmentRateAreaFetcher() services.ShipmentRateAreaFinder { return &mtoShipmentRateAreaFetcher{} } -func (f mtoShipmentRateAreaFetcher) GetPrimeMoveShipmentOconusRateArea(appCtx appcontext.AppContext, moveTaskOrder models.Move) (*[]services.ShipmentPostalCodeRateArea, error) { +func (f mtoShipmentRateAreaFetcher) GetPrimeMoveShipmentRateAreas(appCtx appcontext.AppContext, moveTaskOrder models.Move) (*[]services.ShipmentPostalCodeRateArea, error) { if moveTaskOrder.AvailableToPrimeAt == nil { return nil, apperror.NewUnprocessableEntityError("Move not available to the Prime, unable to retrieve move shipment oconus rateArea") } @@ -33,53 +33,83 @@ func (f mtoShipmentRateAreaFetcher) GetPrimeMoveShipmentOconusRateArea(appCtx ap } // build set of postalCodes to fetch rateArea for - var postalCodes = make([]string, 0) + var oconusPostalCodes = make([]string, 0) + var conusPostalCodes = make([]string, 0) for _, shipment := range moveTaskOrder.MTOShipments { if shipment.PickupAddress != nil { - if !slices.Contains(postalCodes, shipment.PickupAddress.PostalCode) { - postalCodes = append(postalCodes, shipment.PickupAddress.PostalCode) + if !slices.Contains(oconusPostalCodes, shipment.PickupAddress.PostalCode) && *shipment.PickupAddress.IsOconus { + oconusPostalCodes = append(oconusPostalCodes, shipment.PickupAddress.PostalCode) + } else if !slices.Contains(conusPostalCodes, shipment.PickupAddress.PostalCode) { + conusPostalCodes = append(conusPostalCodes, shipment.PickupAddress.PostalCode) } } if shipment.DestinationAddress != nil { - if !slices.Contains(postalCodes, shipment.DestinationAddress.PostalCode) { - postalCodes = append(postalCodes, shipment.DestinationAddress.PostalCode) + if !slices.Contains(oconusPostalCodes, shipment.DestinationAddress.PostalCode) && *shipment.DestinationAddress.IsOconus { + oconusPostalCodes = append(oconusPostalCodes, shipment.DestinationAddress.PostalCode) + } else if !slices.Contains(conusPostalCodes, shipment.DestinationAddress.PostalCode) { + conusPostalCodes = append(conusPostalCodes, shipment.DestinationAddress.PostalCode) } } if shipment.PPMShipment != nil { if shipment.PPMShipment.PickupAddress != nil { - if !slices.Contains(postalCodes, shipment.PPMShipment.PickupAddress.PostalCode) { - postalCodes = append(postalCodes, shipment.PPMShipment.PickupAddress.PostalCode) + if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) && *shipment.PPMShipment.PickupAddress.IsOconus { + oconusPostalCodes = append(oconusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) + } else if !slices.Contains(conusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) { + conusPostalCodes = append(conusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) } } if shipment.PPMShipment.DestinationAddress != nil { - if !slices.Contains(postalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) { - postalCodes = append(postalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) + if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) && *shipment.PPMShipment.DestinationAddress.IsOconus { + oconusPostalCodes = append(oconusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) + } else if !slices.Contains(conusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) { + conusPostalCodes = append(conusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) } } } } - ra, err := fetchRateArea(appCtx, contract.ID, postalCodes) + ora, err := fetchOconusRateAreas(appCtx, contract.ID, oconusPostalCodes) if err != nil { return nil, err } - return ra, nil + cra, err := fetchConusRateAreas(appCtx, contract.ID, conusPostalCodes) + if err != nil { + return nil, err + } + + ra := append(*ora, *cra...) + return &ra, nil +} + +func fetchOconusRateAreas(appCtx appcontext.AppContext, contractId uuid.UUID, postalCodes []string) (*[]services.ShipmentPostalCodeRateArea, error) { + var rateAreasMap = make([]services.ShipmentPostalCodeRateArea, 0) + for _, postalCode := range postalCodes { + ra, err := fetchOconusRateAreaByPostalCode(appCtx, contractId, postalCode) + if err != nil { + if err != sql.ErrNoRows { + return nil, apperror.NewQueryError("GetRateArea", err, fmt.Sprintf("error retrieving rateArea for contractId:%s, postalCode:%s", contractId, postalCode)) + } + } else { + rateAreasMap = append(rateAreasMap, services.ShipmentPostalCodeRateArea{PostalCode: postalCode, RateArea: ra}) + } + } + return &rateAreasMap, nil } -func fetchRateArea(appCtx appcontext.AppContext, contractId uuid.UUID, postalCode []string) (*[]services.ShipmentPostalCodeRateArea, error) { - var rateArea = make([]services.ShipmentPostalCodeRateArea, 0) - for _, code := range postalCode { - ra, err := fetchOconusRateAreaByPostalCode(appCtx, contractId, code) +func fetchConusRateAreas(appCtx appcontext.AppContext, contractId uuid.UUID, postalCodes []string) (*[]services.ShipmentPostalCodeRateArea, error) { + var rateAreasMap = make([]services.ShipmentPostalCodeRateArea, 0) + for _, postalCode := range postalCodes { + ra, err := models.FetchConusRateAreaByPostalCode(appCtx.DB(), postalCode, contractId) if err != nil { if err != sql.ErrNoRows { - return nil, apperror.NewQueryError("GetRateArea", err, fmt.Sprintf("error retrieving rateArea for contractId:%s, postalCode:%s", contractId, code)) + return nil, apperror.NewQueryError("GetRateArea", err, fmt.Sprintf("error retrieving rateArea for contractId:%s, postalCode:%s", contractId, postalCode)) } } else { - rateArea = append(rateArea, services.ShipmentPostalCodeRateArea{PostalCode: code, RateArea: ra}) + rateAreasMap = append(rateAreasMap, services.ShipmentPostalCodeRateArea{PostalCode: postalCode, RateArea: ra}) } } - return &rateArea, nil + return &rateAreasMap, nil } func fetchOconusRateAreaByPostalCode(appCtx appcontext.AppContext, contractId uuid.UUID, postalCode string) (*models.ReRateArea, error) { diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index 976e03ac2e1..d7dbca13551 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -24,7 +24,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentRateAreaFetcher := NewMTOShipmentRateAreaFetcher() suite.Run("test mapping of one rateArea to many postCodes and one rateArea to one", func() { - availableToPrimeAtTime := time.Now().Add(-500 * time.Hour) + availableToPrimeAtTime := time.Now().Add(500 * time.Hour) testMove := models.Move{ AvailableToPrimeAt: &availableToPrimeAtTime, MTOShipments: models.MTOShipments{ @@ -151,7 +151,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { // setup Wasilla to have it's own RateArea rateArea2 := setupRateAreaToPostalCodeData(setupRateArea(*contract), wasillaAlaskaPostalCode) - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentOconusRateArea(suite.AppContextForTest(), testMove) + shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateArea) suite.FatalNoError(err) suite.Equal(3, len(*shipmentPostalCodeRateArea)) @@ -228,7 +228,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentOconusRateArea(suite.AppContextForTest(), testMove) + shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateArea) suite.Equal(0, len(*shipmentPostalCodeRateArea)) suite.Nil(err) @@ -254,7 +254,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentOconusRateArea(suite.AppContextForTest(), testMove) + shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.Nil(shipmentPostalCodeRateArea) suite.NotNil(err) suite.IsType(apperror.UnprocessableEntityError{}, err) @@ -296,7 +296,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentOconusRateArea(suite.AppContextForTest(), testMove) + shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.Nil(shipmentPostalCodeRateArea) suite.NotNil(err) suite.IsType(apperror.NotFoundError{}, err) From 2a08acba0a26930c4c79af392991f9e11b642d88 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:33:33 +0000 Subject: [PATCH 132/229] update prime rate area finder mocks --- pkg/handlers/primeapiv3/move_task_order_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/primeapiv3/move_task_order_test.go b/pkg/handlers/primeapiv3/move_task_order_test.go index 852fb0358c8..45b39cef0e4 100644 --- a/pkg/handlers/primeapiv3/move_task_order_test.go +++ b/pkg/handlers/primeapiv3/move_task_order_test.go @@ -46,7 +46,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { setupDefaultTestHandler := func() GetMoveTaskOrderHandler { mockShipmentRateAreaFinder := &mocks.ShipmentRateAreaFinder{} - mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentOconusRateArea", + mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentRateAreas", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("models.Move"), ).Return(nil, nil) @@ -1459,7 +1459,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { }, } - mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentOconusRateArea", + mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentRateAreas", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("models.Move"), ).Return(&shipmentPostalCodeRateArea, nil) @@ -1538,7 +1538,7 @@ func (suite *HandlerSuite) TestGetMoveTaskOrder() { defaultAddress := factory.BuildAddress(suite.DB(), nil, nil) - mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentOconusRateArea", + mockShipmentRateAreaFinder.On("GetPrimeMoveShipmentRateAreas", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("models.Move"), ).Return(nil, apperror.InternalServerError{}) From ece18588fa6d21daecd6ba19e098bf87d1f48f76 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:37:26 +0000 Subject: [PATCH 133/229] test updates for shipment rate area fetcher to expect conus rate areas --- .../mto_shipment_rate_area_fetcher_test.go | 176 ++++++++++-------- 1 file changed, 99 insertions(+), 77 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index d7dbca13551..96012238aa1 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -19,12 +19,83 @@ const testContractName = "Test Contract" const fairbanksAlaskaPostalCode = "99716" const anchorageAlaskaPostalCode = "99521" const wasillaAlaskaPostalCode = "99652" +const beverlyHillsCAPostalCode = "90210" +const sanDiegoCAPostalCode = "92075" +const brooklynNYPostalCode = "11220" func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentRateAreaFetcher := NewMTOShipmentRateAreaFetcher() + setupRateArea := func(contract models.ReContract) models.ReRateArea { + rateAreaCode := uuid.Must(uuid.NewV4()).String()[0:5] + rateArea := models.ReRateArea{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + IsOconus: true, + Code: rateAreaCode, + Name: fmt.Sprintf("Alaska-%s", rateAreaCode), + Contract: contract, + } + verrs, err := suite.DB().ValidateAndCreate(&rateArea) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + return rateArea + } + + setupRateAreaToPostalCodeData := func(rateArea models.ReRateArea, postalCode string) models.ReRateArea { + // fetch US by country id + us_countryId := uuid.FromStringOrNil("c390ced2-89e1-418d-bbff-f8a79b89c4b6") + us_country, err := models.FetchCountryByID(suite.DB(), us_countryId) + suite.NotNil(us_country) + suite.FatalNoError(err) + + usprc, err := findUsPostRegionCityByZipCode(suite.AppContextForTest(), postalCode) + suite.NotNil(usprc) + suite.FatalNoError(err) + + oconusRateArea := testOnlyOconusRateArea{ + ID: uuid.Must(uuid.NewV4()), + RateAreaId: rateArea.ID, + CountryId: us_country.ID, + UsPostRegionCityId: usprc.ID, + Active: true, + } + verrs, err := suite.DB().ValidateAndCreate(&oconusRateArea) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + return rateArea + } + + setupRateAreaToManyPostalCodesData := func(contract models.ReContract, testPostalCode []string) models.ReRateArea { + rateArea := setupRateArea(contract) + for _, postalCode := range testPostalCode { + setupRateAreaToPostalCodeData(rateArea, postalCode) + } + return rateArea + } + + isRateAreaEquals := func(expectedRateArea models.ReRateArea, postalCode string, shipmentPostalCodeRateArea *[]services.ShipmentPostalCodeRateArea) bool { + var shipmentPostalCodeRateAreaLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) + for _, i := range *shipmentPostalCodeRateArea { + shipmentPostalCodeRateAreaLookupMap[i.PostalCode] = i + } + if _, ok := shipmentPostalCodeRateAreaLookupMap[postalCode]; !ok { + return false + } + return (shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.ID == expectedRateArea.ID && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Name == expectedRateArea.Name && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Code == expectedRateArea.Code) + } + suite.Run("test mapping of one rateArea to many postCodes and one rateArea to one", func() { - availableToPrimeAtTime := time.Now().Add(500 * time.Hour) + availableToPrimeAtTime := time.Now().Add(-500 * time.Hour) testMove := models.Move{ AvailableToPrimeAt: &availableToPrimeAtTime, MTOShipments: models.MTOShipments{ @@ -34,12 +105,14 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { City: "Fairbanks", State: "AK", PostalCode: fairbanksAlaskaPostalCode, + IsOconus: models.BoolPointer(true), }, DestinationAddress: &models.Address{ StreetAddress1: "123 Main St", City: "Anchorage", State: "AK", PostalCode: anchorageAlaskaPostalCode, + IsOconus: models.BoolPointer(true), }, }, models.MTOShipment{ @@ -47,13 +120,15 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { StreetAddress1: "123 Main St", City: "Beverly Hills", State: "CA", - PostalCode: "90210", + PostalCode: beverlyHillsCAPostalCode, + IsOconus: models.BoolPointer(false), }, DestinationAddress: &models.Address{ StreetAddress1: "123 Main St", City: "San Diego", State: "CA", - PostalCode: "92075", + PostalCode: sanDiegoCAPostalCode, + IsOconus: models.BoolPointer(false), }, }, models.MTOShipment{ @@ -63,12 +138,14 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { City: "Wasilla", State: "AK", PostalCode: wasillaAlaskaPostalCode, + IsOconus: models.BoolPointer(true), }, DestinationAddress: &models.Address{ StreetAddress1: "123 Main St", City: "Wasilla", State: "AK", PostalCode: wasillaAlaskaPostalCode, + IsOconus: models.BoolPointer(true), }, }, }, @@ -89,63 +166,6 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) - setupRateArea := func(contract models.ReContract) models.ReRateArea { - rateAreaCode := uuid.Must(uuid.NewV4()).String()[0:5] - rateArea := models.ReRateArea{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - IsOconus: true, - Code: rateAreaCode, - Name: fmt.Sprintf("Alaska-%s", rateAreaCode), - Contract: contract, - } - verrs, err := suite.DB().ValidateAndCreate(&rateArea) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - return rateArea - } - - setupRateAreaToPostalCodeData := func(rateArea models.ReRateArea, postalCode string) models.ReRateArea { - // fetch US by country id - us_countryId := uuid.FromStringOrNil("c390ced2-89e1-418d-bbff-f8a79b89c4b6") - us_country, err := models.FetchCountryByID(suite.DB(), us_countryId) - suite.NotNil(us_country) - suite.FatalNoError(err) - - usprc, err := findUsPostRegionCityByZipCode(suite.AppContextForTest(), postalCode) - suite.NotNil(usprc) - suite.FatalNoError(err) - - oconusRateArea := testOnlyOconusRateArea{ - ID: uuid.Must(uuid.NewV4()), - RateAreaId: rateArea.ID, - CountryId: us_country.ID, - UsPostRegionCityId: usprc.ID, - Active: true, - } - verrs, err := suite.DB().ValidateAndCreate(&oconusRateArea) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - - return rateArea - } - - setupRateAreaToManyPostalCodesData := func(contract models.ReContract, testPostalCode []string) models.ReRateArea { - rateArea := setupRateArea(contract) - for _, postalCode := range testPostalCode { - setupRateAreaToPostalCodeData(rateArea, postalCode) - } - return rateArea - } - // setup Fairbanks and Anchorage to have same RateArea rateArea1 := setupRateAreaToManyPostalCodesData(*contract, []string{fairbanksAlaskaPostalCode, anchorageAlaskaPostalCode}) // setup Wasilla to have it's own RateArea @@ -156,17 +176,6 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { suite.FatalNoError(err) suite.Equal(3, len(*shipmentPostalCodeRateArea)) - isRateAreaEquals := func(expectedRateArea models.ReRateArea, postalCode string, shipmentPostalCodeRateArea *[]services.ShipmentPostalCodeRateArea) bool { - var shipmentPostalCodeRateAreaLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) - for _, i := range *shipmentPostalCodeRateArea { - shipmentPostalCodeRateAreaLookupMap[i.PostalCode] = i - } - if _, ok := shipmentPostalCodeRateAreaLookupMap[postalCode]; !ok { - return false - } - return (shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.ID == expectedRateArea.ID && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Name == expectedRateArea.Name && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Code == expectedRateArea.Code) - } - suite.Equal(true, isRateAreaEquals(rateArea1, fairbanksAlaskaPostalCode, shipmentPostalCodeRateArea)) suite.Equal(true, isRateAreaEquals(rateArea1, anchorageAlaskaPostalCode, shipmentPostalCodeRateArea)) suite.Equal(true, isRateAreaEquals(rateArea2, wasillaAlaskaPostalCode, shipmentPostalCodeRateArea)) @@ -186,28 +195,32 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { StreetAddress1: "123 Main St", City: "Beverly Hills", State: "CA", - PostalCode: "90210", + PostalCode: beverlyHillsCAPostalCode, + IsOconus: models.BoolPointer(false), }, DestinationAddress: &models.Address{ StreetAddress1: "123 Main St", City: "San Diego", State: "CA", - PostalCode: "92075", + PostalCode: sanDiegoCAPostalCode, + IsOconus: models.BoolPointer(false), }, }, models.MTOShipment{ PPMShipment: &models.PPMShipment{ PickupAddress: &models.Address{ StreetAddress1: "123 Main St", - City: "NY", + City: "Brooklyn", State: "NY", - PostalCode: "11220", + PostalCode: brooklynNYPostalCode, + IsOconus: models.BoolPointer(false), }, DestinationAddress: &models.Address{ StreetAddress1: "123 Main St", City: "Beverly Hills", State: "CA", - PostalCode: "90210", + PostalCode: beverlyHillsCAPostalCode, + IsOconus: models.BoolPointer(false), }, }, }, @@ -228,10 +241,19 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) + // setup San Diego and Beverly Hills to have same RateArea + rateAreaCA := setupRateAreaToManyPostalCodesData(*contract, []string{beverlyHillsCAPostalCode, sanDiegoCAPostalCode}) + // setup Brooklyn to have it's own RateArea + rateAreaNY := setupRateAreaToPostalCodeData(setupRateArea(*contract), brooklynNYPostalCode) + shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateArea) - suite.Equal(0, len(*shipmentPostalCodeRateArea)) + suite.Equal(4, len(*shipmentPostalCodeRateArea)) suite.Nil(err) + + suite.Equal(true, isRateAreaEquals(rateAreaCA, sanDiegoCAPostalCode, shipmentPostalCodeRateArea)) + suite.Equal(true, isRateAreaEquals(rateAreaCA, beverlyHillsCAPostalCode, shipmentPostalCodeRateArea)) + suite.Equal(true, isRateAreaEquals(rateAreaNY, brooklynNYPostalCode, shipmentPostalCodeRateArea)) }) suite.Run("not available to prime error", func() { From bbdb6b5dd0f11d2d502266e0e97fc5043d72d697 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:39:10 +0000 Subject: [PATCH 134/229] reduce unnecessary changes --- .../mto_shipment_rate_area_fetcher_test.go | 200 +++++++++--------- 1 file changed, 97 insertions(+), 103 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index 96012238aa1..27e4737e2aa 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -26,74 +26,6 @@ const brooklynNYPostalCode = "11220" func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentRateAreaFetcher := NewMTOShipmentRateAreaFetcher() - setupRateArea := func(contract models.ReContract) models.ReRateArea { - rateAreaCode := uuid.Must(uuid.NewV4()).String()[0:5] - rateArea := models.ReRateArea{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - IsOconus: true, - Code: rateAreaCode, - Name: fmt.Sprintf("Alaska-%s", rateAreaCode), - Contract: contract, - } - verrs, err := suite.DB().ValidateAndCreate(&rateArea) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - return rateArea - } - - setupRateAreaToPostalCodeData := func(rateArea models.ReRateArea, postalCode string) models.ReRateArea { - // fetch US by country id - us_countryId := uuid.FromStringOrNil("c390ced2-89e1-418d-bbff-f8a79b89c4b6") - us_country, err := models.FetchCountryByID(suite.DB(), us_countryId) - suite.NotNil(us_country) - suite.FatalNoError(err) - - usprc, err := findUsPostRegionCityByZipCode(suite.AppContextForTest(), postalCode) - suite.NotNil(usprc) - suite.FatalNoError(err) - - oconusRateArea := testOnlyOconusRateArea{ - ID: uuid.Must(uuid.NewV4()), - RateAreaId: rateArea.ID, - CountryId: us_country.ID, - UsPostRegionCityId: usprc.ID, - Active: true, - } - verrs, err := suite.DB().ValidateAndCreate(&oconusRateArea) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - - return rateArea - } - - setupRateAreaToManyPostalCodesData := func(contract models.ReContract, testPostalCode []string) models.ReRateArea { - rateArea := setupRateArea(contract) - for _, postalCode := range testPostalCode { - setupRateAreaToPostalCodeData(rateArea, postalCode) - } - return rateArea - } - - isRateAreaEquals := func(expectedRateArea models.ReRateArea, postalCode string, shipmentPostalCodeRateArea *[]services.ShipmentPostalCodeRateArea) bool { - var shipmentPostalCodeRateAreaLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) - for _, i := range *shipmentPostalCodeRateArea { - shipmentPostalCodeRateAreaLookupMap[i.PostalCode] = i - } - if _, ok := shipmentPostalCodeRateAreaLookupMap[postalCode]; !ok { - return false - } - return (shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.ID == expectedRateArea.ID && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Name == expectedRateArea.Name && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Code == expectedRateArea.Code) - } - suite.Run("test mapping of one rateArea to many postCodes and one rateArea to one", func() { availableToPrimeAtTime := time.Now().Add(-500 * time.Hour) testMove := models.Move{ @@ -152,6 +84,74 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } + setupRateArea := func(contract models.ReContract) models.ReRateArea { + rateAreaCode := uuid.Must(uuid.NewV4()).String()[0:5] + rateArea := models.ReRateArea{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + IsOconus: true, + Code: rateAreaCode, + Name: fmt.Sprintf("Alaska-%s", rateAreaCode), + Contract: contract, + } + verrs, err := suite.DB().ValidateAndCreate(&rateArea) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + return rateArea + } + + setupRateAreaToPostalCodeData := func(rateArea models.ReRateArea, postalCode string) models.ReRateArea { + // fetch US by country id + us_countryId := uuid.FromStringOrNil("c390ced2-89e1-418d-bbff-f8a79b89c4b6") + us_country, err := models.FetchCountryByID(suite.DB(), us_countryId) + suite.NotNil(us_country) + suite.FatalNoError(err) + + usprc, err := findUsPostRegionCityByZipCode(suite.AppContextForTest(), postalCode) + suite.NotNil(usprc) + suite.FatalNoError(err) + + oconusRateArea := testOnlyOconusRateArea{ + ID: uuid.Must(uuid.NewV4()), + RateAreaId: rateArea.ID, + CountryId: us_country.ID, + UsPostRegionCityId: usprc.ID, + Active: true, + } + verrs, err := suite.DB().ValidateAndCreate(&oconusRateArea) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + return rateArea + } + + setupRateAreaToManyPostalCodesData := func(contract models.ReContract, testPostalCode []string) models.ReRateArea { + rateArea := setupRateArea(contract) + for _, postalCode := range testPostalCode { + setupRateAreaToPostalCodeData(rateArea, postalCode) + } + return rateArea + } + + isRateAreaEquals := func(expectedRateArea models.ReRateArea, postalCode string, shipmentPostalCodeRateArea *[]services.ShipmentPostalCodeRateArea) bool { + var shipmentPostalCodeRateAreaLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) + for _, i := range *shipmentPostalCodeRateArea { + shipmentPostalCodeRateAreaLookupMap[i.PostalCode] = i + } + if _, ok := shipmentPostalCodeRateAreaLookupMap[postalCode]; !ok { + return false + } + return (shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.ID == expectedRateArea.ID && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Name == expectedRateArea.Name && shipmentPostalCodeRateAreaLookupMap[postalCode].RateArea.Code == expectedRateArea.Code) + } + // create test contract contract, err := suite.createContract(suite.AppContextForTest(), testContractCode, testContractName) suite.NotNil(contract) @@ -171,21 +171,29 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { // setup Wasilla to have it's own RateArea rateArea2 := setupRateAreaToPostalCodeData(setupRateArea(*contract), wasillaAlaskaPostalCode) - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) - suite.NotNil(shipmentPostalCodeRateArea) + shipmentPostalCodeRateAreas, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) + suite.NotNil(shipmentPostalCodeRateAreas) suite.FatalNoError(err) - suite.Equal(3, len(*shipmentPostalCodeRateArea)) + suite.Equal(5, len(*shipmentPostalCodeRateAreas)) + + suite.Equal(true, isRateAreaEquals(rateArea1, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(true, isRateAreaEquals(rateArea1, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(true, isRateAreaEquals(rateArea2, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) + + suite.Equal(false, isRateAreaEquals(rateArea2, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea2, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea1, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) - suite.Equal(true, isRateAreaEquals(rateArea1, fairbanksAlaskaPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(true, isRateAreaEquals(rateArea1, anchorageAlaskaPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(true, isRateAreaEquals(rateArea2, wasillaAlaskaPostalCode, shipmentPostalCodeRateArea)) + var shipmentPostalCodeRateAreasLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) + for _, pcra := range *shipmentPostalCodeRateAreas { + shipmentPostalCodeRateAreasLookupMap[pcra.PostalCode] = pcra + } - suite.Equal(false, isRateAreaEquals(rateArea2, fairbanksAlaskaPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(false, isRateAreaEquals(rateArea2, anchorageAlaskaPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(false, isRateAreaEquals(rateArea1, wasillaAlaskaPostalCode, shipmentPostalCodeRateArea)) + suite.Equal("California-South", shipmentPostalCodeRateAreasLookupMap[beverlyHillsCAPostalCode].RateArea.Name) + suite.Equal("California-South", shipmentPostalCodeRateAreasLookupMap[sanDiegoCAPostalCode].RateArea.Name) }) - suite.Run("no oconus rateArea found returns empty array", func() { + suite.Run("Returns matching CONUS rate areas", func() { availableToPrimeAtTime := time.Now().Add(-500 * time.Hour) testMove := models.Move{ AvailableToPrimeAt: &availableToPrimeAtTime, @@ -227,33 +235,19 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } - // create test contract - contract, err := suite.createContract(suite.AppContextForTest(), testContractCode, testContractName) - suite.NotNil(contract) - suite.FatalNoError(err) - - // setup contract year within availableToPrimeAtTime time - testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ - ReContractYear: models.ReContractYear{ - StartDate: availableToPrimeAtTime, - EndDate: time.Now(), - ContractID: contract.ID, - }, - }) - - // setup San Diego and Beverly Hills to have same RateArea - rateAreaCA := setupRateAreaToManyPostalCodesData(*contract, []string{beverlyHillsCAPostalCode, sanDiegoCAPostalCode}) - // setup Brooklyn to have it's own RateArea - rateAreaNY := setupRateAreaToPostalCodeData(setupRateArea(*contract), brooklynNYPostalCode) - - shipmentPostalCodeRateArea, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) - suite.NotNil(shipmentPostalCodeRateArea) - suite.Equal(4, len(*shipmentPostalCodeRateArea)) + shipmentPostalCodeRateAreas, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) + suite.NotNil(shipmentPostalCodeRateAreas) + suite.Equal(3, len(*shipmentPostalCodeRateAreas)) suite.Nil(err) - suite.Equal(true, isRateAreaEquals(rateAreaCA, sanDiegoCAPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(true, isRateAreaEquals(rateAreaCA, beverlyHillsCAPostalCode, shipmentPostalCodeRateArea)) - suite.Equal(true, isRateAreaEquals(rateAreaNY, brooklynNYPostalCode, shipmentPostalCodeRateArea)) + var shipmentPostalCodeRateAreaLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) + for _, pcra := range *shipmentPostalCodeRateAreas { + shipmentPostalCodeRateAreaLookupMap[pcra.PostalCode] = pcra + } + + suite.Equal("California-South", shipmentPostalCodeRateAreaLookupMap[beverlyHillsCAPostalCode].RateArea.Name) + suite.Equal("California-South", shipmentPostalCodeRateAreaLookupMap[sanDiegoCAPostalCode].RateArea.Name) + suite.Equal("New York", shipmentPostalCodeRateAreaLookupMap[brooklynNYPostalCode].RateArea.Name) }) suite.Run("not available to prime error", func() { From 649bcaf45418c1efb32665b1b9ec1c78324fc862 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:40:12 +0000 Subject: [PATCH 135/229] nil check for safety --- .../mto_shipment/mto_shipment_rate_area_fetcher.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go index 10c808d5ed0..ed7381c60a9 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher.go @@ -37,14 +37,16 @@ func (f mtoShipmentRateAreaFetcher) GetPrimeMoveShipmentRateAreas(appCtx appcont var conusPostalCodes = make([]string, 0) for _, shipment := range moveTaskOrder.MTOShipments { if shipment.PickupAddress != nil { - if !slices.Contains(oconusPostalCodes, shipment.PickupAddress.PostalCode) && *shipment.PickupAddress.IsOconus { + if !slices.Contains(oconusPostalCodes, shipment.PickupAddress.PostalCode) && + shipment.PickupAddress.IsOconus != nil && *shipment.PickupAddress.IsOconus { oconusPostalCodes = append(oconusPostalCodes, shipment.PickupAddress.PostalCode) } else if !slices.Contains(conusPostalCodes, shipment.PickupAddress.PostalCode) { conusPostalCodes = append(conusPostalCodes, shipment.PickupAddress.PostalCode) } } if shipment.DestinationAddress != nil { - if !slices.Contains(oconusPostalCodes, shipment.DestinationAddress.PostalCode) && *shipment.DestinationAddress.IsOconus { + if !slices.Contains(oconusPostalCodes, shipment.DestinationAddress.PostalCode) && + shipment.DestinationAddress.IsOconus != nil && *shipment.DestinationAddress.IsOconus { oconusPostalCodes = append(oconusPostalCodes, shipment.DestinationAddress.PostalCode) } else if !slices.Contains(conusPostalCodes, shipment.DestinationAddress.PostalCode) { conusPostalCodes = append(conusPostalCodes, shipment.DestinationAddress.PostalCode) @@ -52,14 +54,16 @@ func (f mtoShipmentRateAreaFetcher) GetPrimeMoveShipmentRateAreas(appCtx appcont } if shipment.PPMShipment != nil { if shipment.PPMShipment.PickupAddress != nil { - if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) && *shipment.PPMShipment.PickupAddress.IsOconus { + if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) && + shipment.PPMShipment.PickupAddress.IsOconus != nil && *shipment.PPMShipment.PickupAddress.IsOconus { oconusPostalCodes = append(oconusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) } else if !slices.Contains(conusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) { conusPostalCodes = append(conusPostalCodes, shipment.PPMShipment.PickupAddress.PostalCode) } } if shipment.PPMShipment.DestinationAddress != nil { - if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) && *shipment.PPMShipment.DestinationAddress.IsOconus { + if !slices.Contains(oconusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) && + shipment.PPMShipment.DestinationAddress.IsOconus != nil && *shipment.PPMShipment.DestinationAddress.IsOconus { oconusPostalCodes = append(oconusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) } else if !slices.Contains(conusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) { conusPostalCodes = append(conusPostalCodes, shipment.PPMShipment.DestinationAddress.PostalCode) From d3f9a6e2b558ebff94ff8fc1a485a5c27012b35c Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Wed, 29 Jan 2025 18:44:30 +0000 Subject: [PATCH 136/229] more test fixes for 22233 --- .../mto_shipment_rate_area_fetcher_test.go | 120 ++++++++++++++++-- 1 file changed, 111 insertions(+), 9 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index 27e4737e2aa..efaf15b3892 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -174,7 +174,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentPostalCodeRateAreas, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateAreas) suite.FatalNoError(err) - suite.Equal(5, len(*shipmentPostalCodeRateAreas)) + suite.Equal(3, len(*shipmentPostalCodeRateAreas)) suite.Equal(true, isRateAreaEquals(rateArea1, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(true, isRateAreaEquals(rateArea1, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) @@ -183,14 +183,6 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { suite.Equal(false, isRateAreaEquals(rateArea2, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(false, isRateAreaEquals(rateArea2, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(false, isRateAreaEquals(rateArea1, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) - - var shipmentPostalCodeRateAreasLookupMap = make(map[string]services.ShipmentPostalCodeRateArea) - for _, pcra := range *shipmentPostalCodeRateAreas { - shipmentPostalCodeRateAreasLookupMap[pcra.PostalCode] = pcra - } - - suite.Equal("California-South", shipmentPostalCodeRateAreasLookupMap[beverlyHillsCAPostalCode].RateArea.Name) - suite.Equal("California-South", shipmentPostalCodeRateAreasLookupMap[sanDiegoCAPostalCode].RateArea.Name) }) suite.Run("Returns matching CONUS rate areas", func() { @@ -235,6 +227,116 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } + // create test contract + contract, err := suite.createContract(suite.AppContextForTest(), testContractCode, testContractName) + suite.NotNil(contract) + suite.FatalNoError(err) + + // setup contract year within availableToPrimeAtTime time + testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + StartDate: availableToPrimeAtTime, + EndDate: time.Now(), + ContractID: contract.ID, + }, + }) + + rateAreaCA := models.ReRateArea{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + IsOconus: false, + Code: "US88", + Name: "California-South", + Contract: *contract, + } + verrs, err := suite.DB().ValidateAndCreate(&rateAreaCA) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + rateAreaNY := models.ReRateArea{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + IsOconus: false, + Code: "US17", + Name: "New York", + Contract: *contract, + } + verrs, err = suite.DB().ValidateAndCreate(&rateAreaNY) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + domServiceArea := testdatagen.MakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ + ReDomesticServiceArea: models.ReDomesticServiceArea{ + ContractID: contract.ID, + }, + }) + + brooklynZip3 := models.ReZip3{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + Contract: *contract, + Zip3: brooklynNYPostalCode[0:3], + RateAreaID: models.UUIDPointer(rateAreaNY.ID), + HasMultipleRateAreas: false, + BasePointCity: "Brooklyn", + State: "NY", + DomesticServiceAreaID: domServiceArea.ID, + } + verrs, err = suite.DB().ValidateAndCreate(&brooklynZip3) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + sanDiegoZip3 := models.ReZip3{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + Contract: *contract, + Zip3: sanDiegoCAPostalCode[0:3], + RateAreaID: models.UUIDPointer(rateAreaCA.ID), + HasMultipleRateAreas: false, + BasePointCity: "San Diego", + State: "CA", + DomesticServiceAreaID: domServiceArea.ID, + } + verrs, err = suite.DB().ValidateAndCreate(&sanDiegoZip3) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + + beverlyHillsZip3 := models.ReZip3{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + Contract: *contract, + Zip3: beverlyHillsCAPostalCode[0:3], + RateAreaID: models.UUIDPointer(rateAreaCA.ID), + HasMultipleRateAreas: false, + BasePointCity: "Los Angeles", + State: "CA", + DomesticServiceAreaID: domServiceArea.ID, + } + + verrs, err = suite.DB().ValidateAndCreate(&beverlyHillsZip3) + if verrs.HasAny() { + suite.Fail(verrs.Error()) + } + if err != nil { + suite.Fail(err.Error()) + } + shipmentPostalCodeRateAreas, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateAreas) suite.Equal(3, len(*shipmentPostalCodeRateAreas)) From 6eca36d821749be377227b4646ad13228a436026 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Wed, 29 Jan 2025 22:03:14 +0000 Subject: [PATCH 137/229] strings matter --- .../Office/AllowancesDetailForm/AllowancesDetailForm.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx index 54134d99935..32280ffa497 100644 --- a/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx +++ b/src/components/Office/AllowancesDetailForm/AllowancesDetailForm.jsx @@ -50,7 +50,7 @@ const AllowancesDetailForm = ({ header, entitlements, branchOptions, formIsDisab setIsAdminWeightLocationChecked(isChecked); if (!isChecked) { - setFieldValue('weightRestriction', 0); + setFieldValue('weightRestriction', '0'); } }; From 57dd6914e8cef83f77d0044252f99f37ad55284a Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Thu, 30 Jan 2025 07:16:50 +0000 Subject: [PATCH 138/229] add tests for supervisors available office users for assignment --- pkg/handlers/ghcapi/queues_test.go | 242 +++++++++++++++++++++++++++++ 1 file changed, 242 insertions(+) diff --git a/pkg/handlers/ghcapi/queues_test.go b/pkg/handlers/ghcapi/queues_test.go index f1eb8a3c106..fdec7399152 100644 --- a/pkg/handlers/ghcapi/queues_test.go +++ b/pkg/handlers/ghcapi/queues_test.go @@ -1821,3 +1821,245 @@ func (suite *HandlerSuite) TestGetBulkAssignmentDataHandler() { suite.Len(payload.BulkAssignmentMoveIDs, 1) }) } + +type availableOfficeUserSubtestData struct { + officeUsers []models.OfficeUser + office models.TransportationOffice +} + +func (suite *HandlerSuite) TestAvailableOfficeUsers() { + setupOfficeUserData := func(role1 roles.RoleType, role2 roles.RoleType) availableOfficeUserSubtestData { + subtestData := &availableOfficeUserSubtestData{} + transportationOffice := factory.BuildTransportationOffice(suite.DB(), nil, nil) + + // lets generate a few office users + // these first two are what we want returned in the query + // office user 1 is the supervisor making the request + officeUser1 := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + LastName: "Aname", + Email: "officeuser1@example.com", + Active: true, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.User{ + Privileges: []models.Privilege{ + { + PrivilegeType: models.PrivilegeTypeSupervisor, + }, + }, + Roles: []roles.Role{ + { + RoleType: role1, + }, + }, + }, + }, + }, nil) + + // officeUser2 is their underling + officeUser2 := factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + LastName: "Bname", + Email: "officeuser2@example.com", + Active: true, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.User{ + Roles: []roles.Role{ + { + RoleType: role1, + }, + }, + }, + }, + }, nil) + + // this office user shares their role but does NOT work at their office so should not be returned + factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + Email: "officeuser3@example.com", + Active: true, + }, + }, + { + Model: models.User{ + Roles: []roles.Role{ + { + RoleType: role1, + }, + }, + }, + }, + }, nil) + + // this office users works at their office, but doesn't share the same role, and should not be returned + factory.BuildOfficeUserWithPrivileges(suite.DB(), []factory.Customization{ + { + Model: models.OfficeUser{ + Email: "officeuser4@example.com", + Active: true, + }, + }, + { + Model: transportationOffice, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + { + Model: models.User{ + Roles: []roles.Role{ + { + RoleType: role2, + }, + }, + }, + }, + }, nil) + + availableOfficeUsers := []models.OfficeUser{officeUser1, officeUser2} + subtestData.officeUsers = availableOfficeUsers + subtestData.office = transportationOffice + return *subtestData + } + suite.Run("properly fetches a TOO supervisor's available office users for assignment", func() { + subtestData := setupOfficeUserData(roles.RoleTypeTOO, roles.RoleTypeServicesCounselor) + waf := entitlements.NewWeightAllotmentFetcher() + + hhgMove := factory.BuildSubmittedMove(suite.DB(), nil, nil) + + factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: hhgMove, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + request := httptest.NewRequest("GET", "/queues/moves", nil) + request = suite.AuthenticateOfficeRequest(request, subtestData.officeUsers[0]) + params := queues.GetMovesQueueParams{ + HTTPRequest: request, + } + handlerConfig := suite.HandlerConfig() + mockUnlocker := movelocker.NewMoveUnlocker() + handler := GetMovesQueueHandler{ + handlerConfig, + order.NewOrderFetcher(waf), + mockUnlocker, + officeusercreator.NewOfficeUserFetcherPop(), + } + + response := handler.Handle(params) + suite.IsNotErrResponse(response) + suite.IsType(&queues.GetMovesQueueOK{}, response) + payload := response.(*queues.GetMovesQueueOK).Payload + + suite.NotNil(payload.QueueMoves) + suite.NotNil(payload.QueueMoves[0].AvailableOfficeUsers) + suite.Equal(2, len(payload.QueueMoves[0].AvailableOfficeUsers)) + suite.Equal(subtestData.officeUsers[0].ID.String(), payload.QueueMoves[0].AvailableOfficeUsers[0].OfficeUserID.String()) + suite.Equal(subtestData.officeUsers[1].ID.String(), payload.QueueMoves[0].AvailableOfficeUsers[1].OfficeUserID.String()) + }) + suite.Run("properly fetches a SC supervisor's available office users for assignment", func() { + subtestData := setupOfficeUserData(roles.RoleTypeServicesCounselor, roles.RoleTypeTOO) + waf := entitlements.NewWeightAllotmentFetcher() + + needsCounselingMove := factory.BuildNeedsServiceCounselingMove(suite.DB(), []factory.Customization{ + { + Model: subtestData.office, + LinkOnly: true, + Type: &factory.TransportationOffices.CounselingOffice, + }, + }, nil) + + factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: needsCounselingMove, + LinkOnly: true, + }, + }, nil) + + request := httptest.NewRequest("GET", "/queues/counseling", nil) + request = suite.AuthenticateOfficeRequest(request, subtestData.officeUsers[0]) + params := queues.GetServicesCounselingQueueParams{ + HTTPRequest: request, + } + handlerConfig := suite.HandlerConfig() + mockUnlocker := movelocker.NewMoveUnlocker() + handler := GetServicesCounselingQueueHandler{ + handlerConfig, + order.NewOrderFetcher(waf), + mockUnlocker, + officeusercreator.NewOfficeUserFetcherPop(), + } + + response := handler.Handle(params) + suite.IsNotErrResponse(response) + suite.IsType(&queues.GetServicesCounselingQueueOK{}, response) + payload := response.(*queues.GetServicesCounselingQueueOK).Payload + + suite.NotNil(payload.QueueMoves) + suite.NotNil(payload.QueueMoves[0].AvailableOfficeUsers) + suite.Equal(2, len(payload.QueueMoves[0].AvailableOfficeUsers)) + suite.Equal(subtestData.officeUsers[0].ID.String(), payload.QueueMoves[0].AvailableOfficeUsers[0].OfficeUserID.String()) + suite.Equal(subtestData.officeUsers[1].ID.String(), payload.QueueMoves[0].AvailableOfficeUsers[1].OfficeUserID.String()) + }) + + suite.Run("properly fetches a TIO supervisor's available office users for assignment", func() { + subtestData := setupOfficeUserData(roles.RoleTypeTIO, roles.RoleTypeTOO) + hhgMove := factory.BuildMoveWithShipment(suite.DB(), nil, nil) + + factory.BuildPaymentRequest(suite.DB(), []factory.Customization{ + { + Model: hhgMove, + LinkOnly: true, + }, + }, nil) + + request := httptest.NewRequest("GET", "/queues/payment-requests", nil) + request = suite.AuthenticateOfficeRequest(request, subtestData.officeUsers[0]) + params := queues.GetPaymentRequestsQueueParams{ + HTTPRequest: request, + } + handlerConfig := suite.HandlerConfig() + mockUnlocker := movelocker.NewMoveUnlocker() + handler := GetPaymentRequestsQueueHandler{ + handlerConfig, + paymentrequest.NewPaymentRequestListFetcher(), + mockUnlocker, + officeusercreator.NewOfficeUserFetcherPop(), + } + + response := handler.Handle(params) + suite.IsNotErrResponse(response) + suite.IsType(&queues.GetPaymentRequestsQueueOK{}, response) + payload := response.(*queues.GetPaymentRequestsQueueOK).Payload + + suite.NotNil(payload.QueuePaymentRequests) + suite.NotNil(payload.QueuePaymentRequests[0].AvailableOfficeUsers) + suite.Equal(2, len(payload.QueuePaymentRequests[0].AvailableOfficeUsers)) + suite.Equal(subtestData.officeUsers[0].ID.String(), payload.QueuePaymentRequests[0].AvailableOfficeUsers[0].OfficeUserID.String()) + suite.Equal(subtestData.officeUsers[1].ID.String(), payload.QueuePaymentRequests[0].AvailableOfficeUsers[1].OfficeUserID.String()) + }) + +} From 1d87448c49fb7dde9ae8299059edc0f050cd5993 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Thu, 30 Jan 2025 13:58:24 +0000 Subject: [PATCH 139/229] bugfix for hq role not seeing any assigned data --- pkg/handlers/ghcapi/internal/payloads/model_to_payload.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go index 2db144c2897..7e2ef9fc277 100644 --- a/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go +++ b/pkg/handlers/ghcapi/internal/payloads/model_to_payload.go @@ -2335,10 +2335,10 @@ func QueueMoves(moves []models.Move, officeUsers []models.OfficeUser, requestedP // determine if there is an assigned user var assignedToUser *ghcmessages.AssignedOfficeUser - if activeRole == string(roles.RoleTypeServicesCounselor) && move.SCAssignedUser != nil { + if (activeRole == string(roles.RoleTypeServicesCounselor) || activeRole == string(roles.RoleTypeHQ)) && move.SCAssignedUser != nil { assignedToUser = AssignedOfficeUser(move.SCAssignedUser) } - if activeRole == string(roles.RoleTypeTOO) && move.TOOAssignedUser != nil { + if (activeRole == string(roles.RoleTypeTOO) || activeRole == string(roles.RoleTypeHQ)) && move.TOOAssignedUser != nil { assignedToUser = AssignedOfficeUser(move.TOOAssignedUser) } @@ -2468,7 +2468,6 @@ func queuePaymentRequestStatus(paymentRequest models.PaymentRequest) string { } -// dad // QueuePaymentRequests payload func QueuePaymentRequests(paymentRequests *models.PaymentRequests, officeUsers []models.OfficeUser, officeUser models.OfficeUser, officeUsersSafety []models.OfficeUser, activeRole string) *ghcmessages.QueuePaymentRequests { From 7dafc7594d7d437ea762d7e5ced2bb5fe2c9ab18 Mon Sep 17 00:00:00 2001 From: Tevin Adams Date: Thu, 30 Jan 2025 15:25:13 +0000 Subject: [PATCH 140/229] test adjustment --- pkg/models/roles/roles_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/models/roles/roles_test.go b/pkg/models/roles/roles_test.go index 8df5ab6a6be..6bcf0c07704 100644 --- a/pkg/models/roles/roles_test.go +++ b/pkg/models/roles/roles_test.go @@ -99,6 +99,5 @@ func (suite *RolesSuite) TestFindRoles() { userRoles, err := m.FindRoles(suite.DB(), "Ta") suite.NoError(err) - suite.Equal(2, len(userRoles), userRoles) - + suite.GreaterOrEqual(len(userRoles), 2) } From a7695662cf5c08935c45bd30c9fae0da7912fd24 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 30 Jan 2025 15:46:29 +0000 Subject: [PATCH 141/229] more thorough tests for 22233 --- .../mto_shipment_rate_area_fetcher_test.go | 157 ++++++++---------- 1 file changed, 68 insertions(+), 89 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index efaf15b3892..3e5ba2395db 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -26,6 +26,47 @@ const brooklynNYPostalCode = "11220" func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentRateAreaFetcher := NewMTOShipmentRateAreaFetcher() + setupDomesticRateAreaAndZip3s := func(rateAreaCode string, rateAreaName string, postalCodes map[string]string, contract models.ReContract, domesticServiceArea models.ReDomesticServiceArea) (models.ReRateArea, error) { + rateArea := models.ReRateArea{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + IsOconus: false, + Code: rateAreaCode, + Name: rateAreaName, + Contract: contract, + } + verrs, err := suite.DB().ValidateAndCreate(&rateArea) + if verrs.HasAny() { + return rateArea, verrs + } + if err != nil { + return rateArea, err + } + + for postalCode, basePointCity := range postalCodes { + zip3 := models.ReZip3{ + ID: uuid.Must(uuid.NewV4()), + ContractID: contract.ID, + Contract: contract, + Zip3: postalCode[0:3], + RateAreaID: models.UUIDPointer(rateArea.ID), + HasMultipleRateAreas: false, + BasePointCity: basePointCity, + State: "ST", + DomesticServiceAreaID: domesticServiceArea.ID, + } + verrs, err = suite.DB().ValidateAndCreate(&zip3) + if verrs.HasAny() { + return rateArea, verrs + } + if err != nil { + return rateArea, err + } + } + + return rateArea, nil + } + suite.Run("test mapping of one rateArea to many postCodes and one rateArea to one", func() { availableToPrimeAtTime := time.Now().Add(-500 * time.Hour) testMove := models.Move{ @@ -166,23 +207,43 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) + domServiceArea := testdatagen.MakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ + ReDomesticServiceArea: models.ReDomesticServiceArea{ + ContractID: contract.ID, + }, + }) + // setup Fairbanks and Anchorage to have same RateArea rateArea1 := setupRateAreaToManyPostalCodesData(*contract, []string{fairbanksAlaskaPostalCode, anchorageAlaskaPostalCode}) // setup Wasilla to have it's own RateArea rateArea2 := setupRateAreaToPostalCodeData(setupRateArea(*contract), wasillaAlaskaPostalCode) + rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, *contract, domServiceArea) + if err != nil { + suite.Fail(err.Error()) + } + shipmentPostalCodeRateAreas, err := shipmentRateAreaFetcher.GetPrimeMoveShipmentRateAreas(suite.AppContextForTest(), testMove) suite.NotNil(shipmentPostalCodeRateAreas) suite.FatalNoError(err) - suite.Equal(3, len(*shipmentPostalCodeRateAreas)) + suite.Equal(5, len(*shipmentPostalCodeRateAreas)) suite.Equal(true, isRateAreaEquals(rateArea1, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(true, isRateAreaEquals(rateArea1, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(true, isRateAreaEquals(rateArea2, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(true, isRateAreaEquals(rateAreaCA, beverlyHillsCAPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(true, isRateAreaEquals(rateAreaCA, sanDiegoCAPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(false, isRateAreaEquals(rateArea2, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(false, isRateAreaEquals(rateArea2, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) suite.Equal(false, isRateAreaEquals(rateArea1, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateAreaCA, fairbanksAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateAreaCA, anchorageAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateAreaCA, wasillaAlaskaPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea1, beverlyHillsCAPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea1, sanDiegoCAPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea2, beverlyHillsCAPostalCode, shipmentPostalCodeRateAreas)) + suite.Equal(false, isRateAreaEquals(rateArea2, sanDiegoCAPostalCode, shipmentPostalCodeRateAreas)) }) suite.Run("Returns matching CONUS rate areas", func() { @@ -227,10 +288,8 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } - // create test contract - contract, err := suite.createContract(suite.AppContextForTest(), testContractCode, testContractName) + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) suite.NotNil(contract) - suite.FatalNoError(err) // setup contract year within availableToPrimeAtTime time testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ @@ -241,98 +300,18 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) - rateAreaCA := models.ReRateArea{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - IsOconus: false, - Code: "US88", - Name: "California-South", - Contract: *contract, - } - verrs, err := suite.DB().ValidateAndCreate(&rateAreaCA) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - - rateAreaNY := models.ReRateArea{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - IsOconus: false, - Code: "US17", - Name: "New York", - Contract: *contract, - } - verrs, err = suite.DB().ValidateAndCreate(&rateAreaNY) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - domServiceArea := testdatagen.MakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ ReDomesticServiceArea: models.ReDomesticServiceArea{ ContractID: contract.ID, }, }) - brooklynZip3 := models.ReZip3{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - Contract: *contract, - Zip3: brooklynNYPostalCode[0:3], - RateAreaID: models.UUIDPointer(rateAreaNY.ID), - HasMultipleRateAreas: false, - BasePointCity: "Brooklyn", - State: "NY", - DomesticServiceAreaID: domServiceArea.ID, - } - verrs, err = suite.DB().ValidateAndCreate(&brooklynZip3) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } - if err != nil { - suite.Fail(err.Error()) - } - - sanDiegoZip3 := models.ReZip3{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - Contract: *contract, - Zip3: sanDiegoCAPostalCode[0:3], - RateAreaID: models.UUIDPointer(rateAreaCA.ID), - HasMultipleRateAreas: false, - BasePointCity: "San Diego", - State: "CA", - DomesticServiceAreaID: domServiceArea.ID, - } - verrs, err = suite.DB().ValidateAndCreate(&sanDiegoZip3) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } + rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, contract, domServiceArea) if err != nil { suite.Fail(err.Error()) } - beverlyHillsZip3 := models.ReZip3{ - ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - Contract: *contract, - Zip3: beverlyHillsCAPostalCode[0:3], - RateAreaID: models.UUIDPointer(rateAreaCA.ID), - HasMultipleRateAreas: false, - BasePointCity: "Los Angeles", - State: "CA", - DomesticServiceAreaID: domServiceArea.ID, - } - - verrs, err = suite.DB().ValidateAndCreate(&beverlyHillsZip3) - if verrs.HasAny() { - suite.Fail(verrs.Error()) - } + rateAreaNY, err := setupDomesticRateAreaAndZip3s("US17", "New York", map[string]string{brooklynNYPostalCode: "Brooklyn"}, contract, domServiceArea) if err != nil { suite.Fail(err.Error()) } @@ -347,9 +326,9 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentPostalCodeRateAreaLookupMap[pcra.PostalCode] = pcra } - suite.Equal("California-South", shipmentPostalCodeRateAreaLookupMap[beverlyHillsCAPostalCode].RateArea.Name) - suite.Equal("California-South", shipmentPostalCodeRateAreaLookupMap[sanDiegoCAPostalCode].RateArea.Name) - suite.Equal("New York", shipmentPostalCodeRateAreaLookupMap[brooklynNYPostalCode].RateArea.Name) + suite.Equal(rateAreaCA.Name, shipmentPostalCodeRateAreaLookupMap[beverlyHillsCAPostalCode].RateArea.Name) + suite.Equal(rateAreaCA.Name, shipmentPostalCodeRateAreaLookupMap[sanDiegoCAPostalCode].RateArea.Name) + suite.Equal(rateAreaNY.Name, shipmentPostalCodeRateAreaLookupMap[brooklynNYPostalCode].RateArea.Name) }) suite.Run("not available to prime error", func() { From adc0f510a6f81909b4ec3b0dcf5884fd4e661a32 Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 30 Jan 2025 16:13:12 +0000 Subject: [PATCH 142/229] make OR fetch domestic service area --- .../mto_shipment/mto_shipment_rate_area_fetcher_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index 3e5ba2395db..31ffb866b2c 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -300,7 +300,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, }) - domServiceArea := testdatagen.MakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ + domServiceArea := testdatagen.FetchOrMakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ ReDomesticServiceArea: models.ReDomesticServiceArea{ ContractID: contract.ID, }, From fc1c2e0d908d3052e0b7016a42ed859cd63f2614 Mon Sep 17 00:00:00 2001 From: deandreJones Date: Thu, 30 Jan 2025 16:39:31 +0000 Subject: [PATCH 143/229] remove old file --- migrations/app/migrations_manifest.txt | 1 - .../app/schema/20250107184554_add_weight_restriction.up.sql | 4 ---- 2 files changed, 5 deletions(-) delete mode 100644 migrations/app/schema/20250107184554_add_weight_restriction.up.sql diff --git a/migrations/app/migrations_manifest.txt b/migrations/app/migrations_manifest.txt index ced104e9f39..8f582e3dbde 100644 --- a/migrations/app/migrations_manifest.txt +++ b/migrations/app/migrations_manifest.txt @@ -1071,7 +1071,6 @@ 20241230190638_remove_AK_zips_from_zip3.up.sql 20241230190647_add_missing_AK_zips_to_zip3_distances.up.sql 20250103180420_update_pricing_proc_to_use_local_price_variable.up.sql -20250107184554_add_weight_restriction.up.sql 20250110001339_update_nts_release_enum_name.up.sql 20250110153428_add_shipment_address_updates_to_move_history.up.sql 20250110214012_homesafeconnect_cert.up.sql diff --git a/migrations/app/schema/20250107184554_add_weight_restriction.up.sql b/migrations/app/schema/20250107184554_add_weight_restriction.up.sql deleted file mode 100644 index 13166af20ee..00000000000 --- a/migrations/app/schema/20250107184554_add_weight_restriction.up.sql +++ /dev/null @@ -1,4 +0,0 @@ -ALTER TABLE entitlements -ADD column IF NOT EXISTS weight_restriction int; - -COMMENT ON COLUMN entitlements.weight_restriction IS 'The weight restricted on the move to a particular location'; From 7e6460b7767ab9dcf2b254d9f01e0a0071e97690 Mon Sep 17 00:00:00 2001 From: Paul Stonebraker Date: Thu, 30 Jan 2025 16:54:53 +0000 Subject: [PATCH 144/229] update FinishDocumentReviewMove test --- .../FinishDocumentReview/FinishDocumentReviewMoves.test.jsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx index 4e43cdca1cf..967f33d05e2 100644 --- a/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx +++ b/src/constants/MoveHistory/EventTemplates/FinishDocumentReview/FinishDocumentReviewMoves.test.jsx @@ -21,14 +21,15 @@ describe('When given a completed services counseling for a move', () => { expect(screen.getByText('Updated move')).toBeInTheDocument(); }); - it('displays default when TIO ID is not present', () => { + it('displays default when SC ID is not present', () => { const template = getTemplate(historyRecord); render(template.getDetails(historyRecord)); expect(screen.getByText('PPM Closeout Complete')).toBeInTheDocument(); + expect(screen.queryByText('Closeout Counselor Unassigned')).not.toBeInTheDocument(); }); - it('displays correct details when a TIO is unassigned', () => { + it('displays correct details when a SC is unassigned', () => { historyRecord.changedValues = { ...historyRecord.changedValues, sc_assigned_id: null, From 03a628243f82ba43a034f5b61f496489fd8d1afb Mon Sep 17 00:00:00 2001 From: Alex Lusk Date: Thu, 30 Jan 2025 17:00:13 +0000 Subject: [PATCH 145/229] test tweaks for 22233 --- .../mto_shipment_rate_area_fetcher_test.go | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go index 31ffb866b2c..6eea73f663c 100644 --- a/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go +++ b/pkg/services/mto_shipment/mto_shipment_rate_area_fetcher_test.go @@ -26,14 +26,14 @@ const brooklynNYPostalCode = "11220" func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { shipmentRateAreaFetcher := NewMTOShipmentRateAreaFetcher() - setupDomesticRateAreaAndZip3s := func(rateAreaCode string, rateAreaName string, postalCodes map[string]string, contract models.ReContract, domesticServiceArea models.ReDomesticServiceArea) (models.ReRateArea, error) { + setupDomesticRateAreaAndZip3s := func(rateAreaCode string, rateAreaName string, postalCodes map[string]string, domesticServiceArea models.ReDomesticServiceArea) (models.ReRateArea, error) { rateArea := models.ReRateArea{ ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, + ContractID: domesticServiceArea.ContractID, IsOconus: false, Code: rateAreaCode, Name: rateAreaName, - Contract: contract, + Contract: domesticServiceArea.Contract, } verrs, err := suite.DB().ValidateAndCreate(&rateArea) if verrs.HasAny() { @@ -46,8 +46,8 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { for postalCode, basePointCity := range postalCodes { zip3 := models.ReZip3{ ID: uuid.Must(uuid.NewV4()), - ContractID: contract.ID, - Contract: contract, + ContractID: domesticServiceArea.ContractID, + Contract: domesticServiceArea.Contract, Zip3: postalCode[0:3], RateAreaID: models.UUIDPointer(rateArea.ID), HasMultipleRateAreas: false, @@ -218,7 +218,7 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { // setup Wasilla to have it's own RateArea rateArea2 := setupRateAreaToPostalCodeData(setupRateArea(*contract), wasillaAlaskaPostalCode) - rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, *contract, domServiceArea) + rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, domServiceArea) if err != nil { suite.Fail(err.Error()) } @@ -288,30 +288,31 @@ func (suite *MTOShipmentServiceSuite) TestGetMoveShipmentRateArea() { }, } - contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) - suite.NotNil(contract) + domServiceArea := testdatagen.FetchOrMakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ + ReDomesticServiceArea: models.ReDomesticServiceArea{ + ServiceArea: "004", + ServicesSchedule: 2, + }, + ReContract: testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}), + }) + suite.NotNil(domServiceArea) + suite.NotNil(domServiceArea.Contract) // setup contract year within availableToPrimeAtTime time testdatagen.MakeReContractYear(suite.DB(), testdatagen.Assertions{ ReContractYear: models.ReContractYear{ StartDate: availableToPrimeAtTime, EndDate: time.Now(), - ContractID: contract.ID, - }, - }) - - domServiceArea := testdatagen.FetchOrMakeReDomesticServiceArea(suite.DB(), testdatagen.Assertions{ - ReDomesticServiceArea: models.ReDomesticServiceArea{ - ContractID: contract.ID, + ContractID: domServiceArea.ContractID, }, }) - rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, contract, domServiceArea) + rateAreaCA, err := setupDomesticRateAreaAndZip3s("US88", "California-South", map[string]string{beverlyHillsCAPostalCode: "Beverly Hills", sanDiegoCAPostalCode: "San Diego"}, domServiceArea) if err != nil { suite.Fail(err.Error()) } - rateAreaNY, err := setupDomesticRateAreaAndZip3s("US17", "New York", map[string]string{brooklynNYPostalCode: "Brooklyn"}, contract, domServiceArea) + rateAreaNY, err := setupDomesticRateAreaAndZip3s("US17", "New York", map[string]string{brooklynNYPostalCode: "Brooklyn"}, domServiceArea) if err != nil { suite.Fail(err.Error()) } From 49a9a2fff3d56ff0a8787d91f76bb24a09c2e3be Mon Sep 17 00:00:00 2001 From: Cory Kleinjan Date: Thu, 30 Jan 2025 17:17:53 +0000 Subject: [PATCH 146/229] Updating struct type --- cmd/prime-api-client/prime/create_mto_service_item.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/prime-api-client/prime/create_mto_service_item.go b/cmd/prime-api-client/prime/create_mto_service_item.go index 65c8a9c16aa..9c96f43e82c 100644 --- a/cmd/prime-api-client/prime/create_mto_service_item.go +++ b/cmd/prime-api-client/prime/create_mto_service_item.go @@ -40,7 +40,7 @@ type shuttleParams struct { } type domesticShuttleParams struct { - Body primemessages.MTOServiceItemShuttle `json:"body"` + Body primemessages.MTOServiceItemDomesticShuttle `json:"body"` } // InitCreateMTOServiceItemFlags initializes flags. From 534c142e5d133501c8bdee2270f23fa191bee4c3 Mon Sep 17 00:00:00 2001 From: Tae Jung Date: Thu, 30 Jan 2025 17:29:46 +0000 Subject: [PATCH 147/229] created new approveShipments api and moved availableToPrimeAt to shipment approval and added tests --- pkg/gen/ghcapi/configure_mymove.go | 5 + pkg/gen/ghcapi/embedded_spec.go | 199 ++++++- .../update_move_task_order_status.go | 4 +- pkg/gen/ghcapi/ghcoperations/mymove_api.go | 12 + .../shipment/approve_shipments.go | 58 ++ .../shipment/approve_shipments_parameters.go | 84 +++ .../shipment/approve_shipments_responses.go | 332 +++++++++++ .../shipment/approve_shipments_urlbuilder.go | 87 +++ pkg/gen/ghcmessages/approve_shipments.go | 202 +++++++ pkg/handlers/ghcapi/api.go | 17 + pkg/handlers/ghcapi/move_task_order.go | 33 +- pkg/handlers/ghcapi/move_task_order_test.go | 4 +- pkg/handlers/ghcapi/mto_shipment.go | 203 +++++++ pkg/handlers/ghcapi/mto_shipment_test.go | 532 +++++++++++++++++- pkg/handlers/supportapi/move_task_order.go | 14 +- pkg/services/mocks/MoveTaskOrderUpdater.go | 43 +- pkg/services/mocks/ShipmentApprover.go | 32 ++ pkg/services/mocks/WeightAllotmentFetcher.go | 117 ++++ pkg/services/mocks/WeightRestrictor.go | 89 +++ pkg/services/move_task_order.go | 3 +- .../move_task_order_updater.go | 47 +- .../move_task_order_updater_test.go | 158 +++++- .../mto_service_item_creator.go | 2 +- pkg/services/mto_shipment.go | 6 + .../mto_shipment/shipment_approver.go | 44 +- .../mto_shipment/shipment_approver_test.go | 207 ++++++- pkg/testdatagen/scenario/shared.go | 18 +- .../RequestedShipments.test.jsx | 237 ++++++++ .../RequestedShipmentsTestData.js | 61 ++ .../SubmittedRequestedShipments.jsx | 96 +++- .../ShipmentApprovalPreview.jsx | 3 +- .../ShipmentApprovalPreview.test.jsx | 19 + .../MoveHistory/Database/FieldMappings.js | 1 + .../ApproveShipment/approveShipment.jsx | 3 +- .../approveShipmentApproveMove.jsx | 3 +- .../approveShipmentUpdateAllowances.jsx | 3 +- .../createStandardServiceItem.jsx | 3 +- src/pages/Office/MoveDetails/MoveDetails.jsx | 22 +- src/services/ghcApi.js | 11 + swagger-def/ghc.yaml | 60 +- swagger/ghc.yaml | 60 +- 41 files changed, 2986 insertions(+), 148 deletions(-) create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_parameters.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_responses.go create mode 100644 pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_urlbuilder.go create mode 100644 pkg/gen/ghcmessages/approve_shipments.go create mode 100644 pkg/services/mocks/WeightAllotmentFetcher.go create mode 100644 pkg/services/mocks/WeightRestrictor.go diff --git a/pkg/gen/ghcapi/configure_mymove.go b/pkg/gen/ghcapi/configure_mymove.go index 32eb5174c09..43080615a7a 100644 --- a/pkg/gen/ghcapi/configure_mymove.go +++ b/pkg/gen/ghcapi/configure_mymove.go @@ -107,6 +107,11 @@ func configureAPI(api *ghcoperations.MymoveAPI) http.Handler { return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") }) } + if api.ShipmentApproveShipmentsHandler == nil { + api.ShipmentApproveShipmentsHandler = shipment.ApproveShipmentsHandlerFunc(func(params shipment.ApproveShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipments has not yet been implemented") + }) + } if api.ReportViolationsAssociateReportViolationsHandler == nil { api.ReportViolationsAssociateReportViolationsHandler = report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") diff --git a/pkg/gen/ghcapi/embedded_spec.go b/pkg/gen/ghcapi/embedded_spec.go index 3db3ec66e71..3f59d94c9db 100644 --- a/pkg/gen/ghcapi/embedded_spec.go +++ b/pkg/gen/ghcapi/embedded_spec.go @@ -1516,7 +1516,7 @@ func init() { }, "/move-task-orders/{moveTaskOrderID}/status": { "patch": { - "description": "Changes move task order status to make it available to prime", + "description": "Changes move task order status", "consumes": [ "application/json" ], @@ -1526,7 +1526,7 @@ func init() { "tags": [ "moveTaskOrder" ], - "summary": "Change the status of a move task order to make it available to prime", + "summary": "Change the status of a move task order", "operationId": "updateMoveTaskOrderStatus", "parameters": [ { @@ -5245,6 +5245,64 @@ func init() { } ] }, + "/shipments/approve": { + "post": { + "description": "Approves multiple shipments in one request", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves multiple shipments at once", + "operationId": "approveShipments", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApproveShipments" + } + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + } + }, + "403": { + "$ref": "#/responses/PermissionDenied" + }, + "404": { + "$ref": "#/responses/NotFound" + }, + "409": { + "$ref": "#/responses/Conflict" + }, + "412": { + "$ref": "#/responses/PreconditionFailed" + }, + "422": { + "$ref": "#/responses/UnprocessableEntity" + }, + "500": { + "$ref": "#/responses/ServerError" + } + }, + "x-permissions": [ + "update.shipment" + ] + } + }, "/shipments/{shipmentID}": { "get": { "description": "fetches a shipment by ID", @@ -6746,6 +6804,33 @@ func init() { } } }, + "ApproveShipments": { + "type": "object", + "required": [ + "approveShipments" + ], + "properties": { + "approveShipments": { + "type": "array", + "items": { + "type": "object", + "required": [ + "shipmentID", + "eTag" + ], + "properties": { + "eTag": { + "type": "string" + }, + "shipmentID": { + "type": "string", + "format": "uuid" + } + } + } + } + } + }, "AssignOfficeUserBody": { "type": "object", "required": [ @@ -17408,7 +17493,7 @@ func init() { }, "/move-task-orders/{moveTaskOrderID}/status": { "patch": { - "description": "Changes move task order status to make it available to prime", + "description": "Changes move task order status", "consumes": [ "application/json" ], @@ -17418,7 +17503,7 @@ func init() { "tags": [ "moveTaskOrder" ], - "summary": "Change the status of a move task order to make it available to prime", + "summary": "Change the status of a move task order", "operationId": "updateMoveTaskOrderStatus", "parameters": [ { @@ -21986,6 +22071,82 @@ func init() { } ] }, + "/shipments/approve": { + "post": { + "description": "Approves multiple shipments in one request", + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "tags": [ + "shipment" + ], + "summary": "Approves multiple shipments at once", + "operationId": "approveShipments", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/ApproveShipments" + } + } + ], + "responses": { + "200": { + "description": "Successfully approved the shipments", + "schema": { + "type": "array", + "items": { + "$ref": "#/definitions/MTOShipment" + } + } + }, + "403": { + "description": "The request was denied", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "404": { + "description": "The requested resource wasn't found", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "409": { + "description": "Conflict error", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "412": { + "description": "Precondition failed", + "schema": { + "$ref": "#/definitions/Error" + } + }, + "422": { + "description": "The payload was unprocessable.", + "schema": { + "$ref": "#/definitions/ValidationError" + } + }, + "500": { + "description": "A server error occurred", + "schema": { + "$ref": "#/definitions/Error" + } + } + }, + "x-permissions": [ + "update.shipment" + ] + } + }, "/shipments/{shipmentID}": { "get": { "description": "fetches a shipment by ID", @@ -23788,6 +23949,36 @@ func init() { } } }, + "ApproveShipments": { + "type": "object", + "required": [ + "approveShipments" + ], + "properties": { + "approveShipments": { + "type": "array", + "items": { + "$ref": "#/definitions/ApproveShipmentsApproveShipmentsItems0" + } + } + } + }, + "ApproveShipmentsApproveShipmentsItems0": { + "type": "object", + "required": [ + "shipmentID", + "eTag" + ], + "properties": { + "eTag": { + "type": "string" + }, + "shipmentID": { + "type": "string", + "format": "uuid" + } + } + }, "AssignOfficeUserBody": { "type": "object", "required": [ diff --git a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go index ec8f17920aa..8b51f08902a 100644 --- a/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go +++ b/pkg/gen/ghcapi/ghcoperations/move_task_order/update_move_task_order_status.go @@ -32,9 +32,9 @@ func NewUpdateMoveTaskOrderStatus(ctx *middleware.Context, handler UpdateMoveTas /* UpdateMoveTaskOrderStatus swagger:route PATCH /move-task-orders/{moveTaskOrderID}/status moveTaskOrder updateMoveTaskOrderStatus -# Change the status of a move task order to make it available to prime +# Change the status of a move task order -Changes move task order status to make it available to prime +Changes move task order status */ type UpdateMoveTaskOrderStatus struct { Context *middleware.Context diff --git a/pkg/gen/ghcapi/ghcoperations/mymove_api.go b/pkg/gen/ghcapi/ghcoperations/mymove_api.go index c53c0fec4d7..a3f9cebd6ef 100644 --- a/pkg/gen/ghcapi/ghcoperations/mymove_api.go +++ b/pkg/gen/ghcapi/ghcoperations/mymove_api.go @@ -92,6 +92,9 @@ func NewMymoveAPI(spec *loads.Document) *MymoveAPI { ShipmentApproveShipmentDiversionHandler: shipment.ApproveShipmentDiversionHandlerFunc(func(params shipment.ApproveShipmentDiversionParams) middleware.Responder { return middleware.NotImplemented("operation shipment.ApproveShipmentDiversion has not yet been implemented") }), + ShipmentApproveShipmentsHandler: shipment.ApproveShipmentsHandlerFunc(func(params shipment.ApproveShipmentsParams) middleware.Responder { + return middleware.NotImplemented("operation shipment.ApproveShipments has not yet been implemented") + }), ReportViolationsAssociateReportViolationsHandler: report_violations.AssociateReportViolationsHandlerFunc(func(params report_violations.AssociateReportViolationsParams) middleware.Responder { return middleware.NotImplemented("operation report_violations.AssociateReportViolations has not yet been implemented") }), @@ -455,6 +458,8 @@ type MymoveAPI struct { ShipmentApproveShipmentHandler shipment.ApproveShipmentHandler // ShipmentApproveShipmentDiversionHandler sets the operation handler for the approve shipment diversion operation ShipmentApproveShipmentDiversionHandler shipment.ApproveShipmentDiversionHandler + // ShipmentApproveShipmentsHandler sets the operation handler for the approve shipments operation + ShipmentApproveShipmentsHandler shipment.ApproveShipmentsHandler // ReportViolationsAssociateReportViolationsHandler sets the operation handler for the associate report violations operation ReportViolationsAssociateReportViolationsHandler report_violations.AssociateReportViolationsHandler // PaymentRequestsBulkDownloadHandler sets the operation handler for the bulk download operation @@ -761,6 +766,9 @@ func (o *MymoveAPI) Validate() error { if o.ShipmentApproveShipmentDiversionHandler == nil { unregistered = append(unregistered, "shipment.ApproveShipmentDiversionHandler") } + if o.ShipmentApproveShipmentsHandler == nil { + unregistered = append(unregistered, "shipment.ApproveShipmentsHandler") + } if o.ReportViolationsAssociateReportViolationsHandler == nil { unregistered = append(unregistered, "report_violations.AssociateReportViolationsHandler") } @@ -1187,6 +1195,10 @@ func (o *MymoveAPI) initHandlerCache() { if o.handlers["POST"] == nil { o.handlers["POST"] = make(map[string]http.Handler) } + o.handlers["POST"]["/shipments/approve"] = shipment.NewApproveShipments(o.context, o.ShipmentApproveShipmentsHandler) + if o.handlers["POST"] == nil { + o.handlers["POST"] = make(map[string]http.Handler) + } o.handlers["POST"]["/report-violations/{reportID}"] = report_violations.NewAssociateReportViolations(o.context, o.ReportViolationsAssociateReportViolationsHandler) if o.handlers["GET"] == nil { o.handlers["GET"] = make(map[string]http.Handler) diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments.go new file mode 100644 index 00000000000..c441f320f1a --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments.go @@ -0,0 +1,58 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime/middleware" +) + +// ApproveShipmentsHandlerFunc turns a function with the right signature into a approve shipments handler +type ApproveShipmentsHandlerFunc func(ApproveShipmentsParams) middleware.Responder + +// Handle executing the request and returning a response +func (fn ApproveShipmentsHandlerFunc) Handle(params ApproveShipmentsParams) middleware.Responder { + return fn(params) +} + +// ApproveShipmentsHandler interface for that can handle valid approve shipments params +type ApproveShipmentsHandler interface { + Handle(ApproveShipmentsParams) middleware.Responder +} + +// NewApproveShipments creates a new http.Handler for the approve shipments operation +func NewApproveShipments(ctx *middleware.Context, handler ApproveShipmentsHandler) *ApproveShipments { + return &ApproveShipments{Context: ctx, Handler: handler} +} + +/* + ApproveShipments swagger:route POST /shipments/approve shipment approveShipments + +# Approves multiple shipments at once + +Approves multiple shipments in one request +*/ +type ApproveShipments struct { + Context *middleware.Context + Handler ApproveShipmentsHandler +} + +func (o *ApproveShipments) ServeHTTP(rw http.ResponseWriter, r *http.Request) { + route, rCtx, _ := o.Context.RouteInfo(r) + if rCtx != nil { + *r = *rCtx + } + var Params = NewApproveShipmentsParams() + if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params + o.Context.Respond(rw, r, route.Produces, route, err) + return + } + + res := o.Handler.Handle(Params) // actually handle the request + o.Context.Respond(rw, r, route.Produces, route, res) + +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_parameters.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_parameters.go new file mode 100644 index 00000000000..2c11422365c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_parameters.go @@ -0,0 +1,84 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "io" + "net/http" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/runtime/middleware" + "github.com/go-openapi/validate" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// NewApproveShipmentsParams creates a new ApproveShipmentsParams object +// +// There are no default values defined in the spec. +func NewApproveShipmentsParams() ApproveShipmentsParams { + + return ApproveShipmentsParams{} +} + +// ApproveShipmentsParams contains all the bound params for the approve shipments operation +// typically these are obtained from a http.Request +// +// swagger:parameters approveShipments +type ApproveShipmentsParams struct { + + // HTTP Request Object + HTTPRequest *http.Request `json:"-"` + + /* + Required: true + In: body + */ + Body *ghcmessages.ApproveShipments +} + +// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface +// for simple values it will use straight method calls. +// +// To ensure default values, the struct must have been initialized with NewApproveShipmentsParams() beforehand. +func (o *ApproveShipmentsParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error { + var res []error + + o.HTTPRequest = r + + if runtime.HasBody(r) { + defer r.Body.Close() + var body ghcmessages.ApproveShipments + if err := route.Consumer.Consume(r.Body, &body); err != nil { + if err == io.EOF { + res = append(res, errors.Required("body", "body", "")) + } else { + res = append(res, errors.NewParseError("body", "body", "", err)) + } + } else { + // validate body object + if err := body.Validate(route.Formats); err != nil { + res = append(res, err) + } + + ctx := validate.WithOperationRequest(r.Context()) + if err := body.ContextValidate(ctx, route.Formats); err != nil { + res = append(res, err) + } + + if len(res) == 0 { + o.Body = &body + } + } + } else { + res = append(res, errors.Required("body", "body", "")) + } + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_responses.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_responses.go new file mode 100644 index 00000000000..44dd124ba3c --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_responses.go @@ -0,0 +1,332 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "net/http" + + "github.com/go-openapi/runtime" + + "github.com/transcom/mymove/pkg/gen/ghcmessages" +) + +// ApproveShipmentsOKCode is the HTTP code returned for type ApproveShipmentsOK +const ApproveShipmentsOKCode int = 200 + +/* +ApproveShipmentsOK Successfully approved the shipments + +swagger:response approveShipmentsOK +*/ +type ApproveShipmentsOK struct { + + /* + In: Body + */ + Payload []*ghcmessages.MTOShipment `json:"body,omitempty"` +} + +// NewApproveShipmentsOK creates ApproveShipmentsOK with default headers values +func NewApproveShipmentsOK() *ApproveShipmentsOK { + + return &ApproveShipmentsOK{} +} + +// WithPayload adds the payload to the approve shipments o k response +func (o *ApproveShipmentsOK) WithPayload(payload []*ghcmessages.MTOShipment) *ApproveShipmentsOK { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments o k response +func (o *ApproveShipmentsOK) SetPayload(payload []*ghcmessages.MTOShipment) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsOK) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(200) + payload := o.Payload + if payload == nil { + // return empty array + payload = make([]*ghcmessages.MTOShipment, 0, 50) + } + + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } +} + +// ApproveShipmentsForbiddenCode is the HTTP code returned for type ApproveShipmentsForbidden +const ApproveShipmentsForbiddenCode int = 403 + +/* +ApproveShipmentsForbidden The request was denied + +swagger:response approveShipmentsForbidden +*/ +type ApproveShipmentsForbidden struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentsForbidden creates ApproveShipmentsForbidden with default headers values +func NewApproveShipmentsForbidden() *ApproveShipmentsForbidden { + + return &ApproveShipmentsForbidden{} +} + +// WithPayload adds the payload to the approve shipments forbidden response +func (o *ApproveShipmentsForbidden) WithPayload(payload *ghcmessages.Error) *ApproveShipmentsForbidden { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments forbidden response +func (o *ApproveShipmentsForbidden) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsForbidden) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(403) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentsNotFoundCode is the HTTP code returned for type ApproveShipmentsNotFound +const ApproveShipmentsNotFoundCode int = 404 + +/* +ApproveShipmentsNotFound The requested resource wasn't found + +swagger:response approveShipmentsNotFound +*/ +type ApproveShipmentsNotFound struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentsNotFound creates ApproveShipmentsNotFound with default headers values +func NewApproveShipmentsNotFound() *ApproveShipmentsNotFound { + + return &ApproveShipmentsNotFound{} +} + +// WithPayload adds the payload to the approve shipments not found response +func (o *ApproveShipmentsNotFound) WithPayload(payload *ghcmessages.Error) *ApproveShipmentsNotFound { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments not found response +func (o *ApproveShipmentsNotFound) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsNotFound) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(404) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentsConflictCode is the HTTP code returned for type ApproveShipmentsConflict +const ApproveShipmentsConflictCode int = 409 + +/* +ApproveShipmentsConflict Conflict error + +swagger:response approveShipmentsConflict +*/ +type ApproveShipmentsConflict struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentsConflict creates ApproveShipmentsConflict with default headers values +func NewApproveShipmentsConflict() *ApproveShipmentsConflict { + + return &ApproveShipmentsConflict{} +} + +// WithPayload adds the payload to the approve shipments conflict response +func (o *ApproveShipmentsConflict) WithPayload(payload *ghcmessages.Error) *ApproveShipmentsConflict { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments conflict response +func (o *ApproveShipmentsConflict) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsConflict) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(409) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentsPreconditionFailedCode is the HTTP code returned for type ApproveShipmentsPreconditionFailed +const ApproveShipmentsPreconditionFailedCode int = 412 + +/* +ApproveShipmentsPreconditionFailed Precondition failed + +swagger:response approveShipmentsPreconditionFailed +*/ +type ApproveShipmentsPreconditionFailed struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentsPreconditionFailed creates ApproveShipmentsPreconditionFailed with default headers values +func NewApproveShipmentsPreconditionFailed() *ApproveShipmentsPreconditionFailed { + + return &ApproveShipmentsPreconditionFailed{} +} + +// WithPayload adds the payload to the approve shipments precondition failed response +func (o *ApproveShipmentsPreconditionFailed) WithPayload(payload *ghcmessages.Error) *ApproveShipmentsPreconditionFailed { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments precondition failed response +func (o *ApproveShipmentsPreconditionFailed) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsPreconditionFailed) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(412) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentsUnprocessableEntityCode is the HTTP code returned for type ApproveShipmentsUnprocessableEntity +const ApproveShipmentsUnprocessableEntityCode int = 422 + +/* +ApproveShipmentsUnprocessableEntity The payload was unprocessable. + +swagger:response approveShipmentsUnprocessableEntity +*/ +type ApproveShipmentsUnprocessableEntity struct { + + /* + In: Body + */ + Payload *ghcmessages.ValidationError `json:"body,omitempty"` +} + +// NewApproveShipmentsUnprocessableEntity creates ApproveShipmentsUnprocessableEntity with default headers values +func NewApproveShipmentsUnprocessableEntity() *ApproveShipmentsUnprocessableEntity { + + return &ApproveShipmentsUnprocessableEntity{} +} + +// WithPayload adds the payload to the approve shipments unprocessable entity response +func (o *ApproveShipmentsUnprocessableEntity) WithPayload(payload *ghcmessages.ValidationError) *ApproveShipmentsUnprocessableEntity { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments unprocessable entity response +func (o *ApproveShipmentsUnprocessableEntity) SetPayload(payload *ghcmessages.ValidationError) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsUnprocessableEntity) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(422) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} + +// ApproveShipmentsInternalServerErrorCode is the HTTP code returned for type ApproveShipmentsInternalServerError +const ApproveShipmentsInternalServerErrorCode int = 500 + +/* +ApproveShipmentsInternalServerError A server error occurred + +swagger:response approveShipmentsInternalServerError +*/ +type ApproveShipmentsInternalServerError struct { + + /* + In: Body + */ + Payload *ghcmessages.Error `json:"body,omitempty"` +} + +// NewApproveShipmentsInternalServerError creates ApproveShipmentsInternalServerError with default headers values +func NewApproveShipmentsInternalServerError() *ApproveShipmentsInternalServerError { + + return &ApproveShipmentsInternalServerError{} +} + +// WithPayload adds the payload to the approve shipments internal server error response +func (o *ApproveShipmentsInternalServerError) WithPayload(payload *ghcmessages.Error) *ApproveShipmentsInternalServerError { + o.Payload = payload + return o +} + +// SetPayload sets the payload to the approve shipments internal server error response +func (o *ApproveShipmentsInternalServerError) SetPayload(payload *ghcmessages.Error) { + o.Payload = payload +} + +// WriteResponse to the client +func (o *ApproveShipmentsInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { + + rw.WriteHeader(500) + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } + } +} diff --git a/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_urlbuilder.go b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_urlbuilder.go new file mode 100644 index 00000000000..de99aa28fa3 --- /dev/null +++ b/pkg/gen/ghcapi/ghcoperations/shipment/approve_shipments_urlbuilder.go @@ -0,0 +1,87 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package shipment + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the generate command + +import ( + "errors" + "net/url" + golangswaggerpaths "path" +) + +// ApproveShipmentsURL generates an URL for the approve shipments operation +type ApproveShipmentsURL struct { + _basePath string +} + +// WithBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentsURL) WithBasePath(bp string) *ApproveShipmentsURL { + o.SetBasePath(bp) + return o +} + +// SetBasePath sets the base path for this url builder, only required when it's different from the +// base path specified in the swagger spec. +// When the value of the base path is an empty string +func (o *ApproveShipmentsURL) SetBasePath(bp string) { + o._basePath = bp +} + +// Build a url path and query string +func (o *ApproveShipmentsURL) Build() (*url.URL, error) { + var _result url.URL + + var _path = "/shipments/approve" + + _basePath := o._basePath + if _basePath == "" { + _basePath = "/ghc/v1" + } + _result.Path = golangswaggerpaths.Join(_basePath, _path) + + return &_result, nil +} + +// Must is a helper function to panic when the url builder returns an error +func (o *ApproveShipmentsURL) Must(u *url.URL, err error) *url.URL { + if err != nil { + panic(err) + } + if u == nil { + panic("url can't be nil") + } + return u +} + +// String returns the string representation of the path with query string +func (o *ApproveShipmentsURL) String() string { + return o.Must(o.Build()).String() +} + +// BuildFull builds a full url with scheme, host, path and query string +func (o *ApproveShipmentsURL) BuildFull(scheme, host string) (*url.URL, error) { + if scheme == "" { + return nil, errors.New("scheme is required for a full url on ApproveShipmentsURL") + } + if host == "" { + return nil, errors.New("host is required for a full url on ApproveShipmentsURL") + } + + base, err := o.Build() + if err != nil { + return nil, err + } + + base.Scheme = scheme + base.Host = host + return base, nil +} + +// StringFull returns the string representation of a complete url +func (o *ApproveShipmentsURL) StringFull(scheme, host string) string { + return o.Must(o.BuildFull(scheme, host)).String() +} diff --git a/pkg/gen/ghcmessages/approve_shipments.go b/pkg/gen/ghcmessages/approve_shipments.go new file mode 100644 index 00000000000..c86a5252416 --- /dev/null +++ b/pkg/gen/ghcmessages/approve_shipments.go @@ -0,0 +1,202 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package ghcmessages + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" + "github.com/go-openapi/validate" +) + +// ApproveShipments approve shipments +// +// swagger:model ApproveShipments +type ApproveShipments struct { + + // approve shipments + // Required: true + ApproveShipments []*ApproveShipmentsApproveShipmentsItems0 `json:"approveShipments"` +} + +// Validate validates this approve shipments +func (m *ApproveShipments) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateApproveShipments(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApproveShipments) validateApproveShipments(formats strfmt.Registry) error { + + if err := validate.Required("approveShipments", "body", m.ApproveShipments); err != nil { + return err + } + + for i := 0; i < len(m.ApproveShipments); i++ { + if swag.IsZero(m.ApproveShipments[i]) { // not required + continue + } + + if m.ApproveShipments[i] != nil { + if err := m.ApproveShipments[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("approveShipments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("approveShipments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this approve shipments based on the context it is used +func (m *ApproveShipments) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := m.contextValidateApproveShipments(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApproveShipments) contextValidateApproveShipments(ctx context.Context, formats strfmt.Registry) error { + + for i := 0; i < len(m.ApproveShipments); i++ { + + if m.ApproveShipments[i] != nil { + + if swag.IsZero(m.ApproveShipments[i]) { // not required + return nil + } + + if err := m.ApproveShipments[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("approveShipments" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("approveShipments" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// MarshalBinary interface implementation +func (m *ApproveShipments) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApproveShipments) UnmarshalBinary(b []byte) error { + var res ApproveShipments + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} + +// ApproveShipmentsApproveShipmentsItems0 approve shipments approve shipments items0 +// +// swagger:model ApproveShipmentsApproveShipmentsItems0 +type ApproveShipmentsApproveShipmentsItems0 struct { + + // e tag + // Required: true + ETag *string `json:"eTag"` + + // shipment ID + // Required: true + // Format: uuid + ShipmentID *strfmt.UUID `json:"shipmentID"` +} + +// Validate validates this approve shipments approve shipments items0 +func (m *ApproveShipmentsApproveShipmentsItems0) Validate(formats strfmt.Registry) error { + var res []error + + if err := m.validateETag(formats); err != nil { + res = append(res, err) + } + + if err := m.validateShipmentID(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (m *ApproveShipmentsApproveShipmentsItems0) validateETag(formats strfmt.Registry) error { + + if err := validate.Required("eTag", "body", m.ETag); err != nil { + return err + } + + return nil +} + +func (m *ApproveShipmentsApproveShipmentsItems0) validateShipmentID(formats strfmt.Registry) error { + + if err := validate.Required("shipmentID", "body", m.ShipmentID); err != nil { + return err + } + + if err := validate.FormatOf("shipmentID", "body", "uuid", m.ShipmentID.String(), formats); err != nil { + return err + } + + return nil +} + +// ContextValidate validates this approve shipments approve shipments items0 based on context it is used +func (m *ApproveShipmentsApproveShipmentsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (m *ApproveShipmentsApproveShipmentsItems0) MarshalBinary() ([]byte, error) { + if m == nil { + return nil, nil + } + return swag.WriteJSON(m) +} + +// UnmarshalBinary interface implementation +func (m *ApproveShipmentsApproveShipmentsItems0) UnmarshalBinary(b []byte) error { + var res ApproveShipmentsApproveShipmentsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *m = res + return nil +} diff --git a/pkg/handlers/ghcapi/api.go b/pkg/handlers/ghcapi/api.go index 4a6bed9c52d..b893b01b3d4 100644 --- a/pkg/handlers/ghcapi/api.go +++ b/pkg/handlers/ghcapi/api.go @@ -410,6 +410,20 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI { mtoshipment.NewShipmentDeleter(moveTaskOrderUpdater, moveRouter), } + ghcAPI.ShipmentApproveShipmentsHandler = ApproveShipmentsHandler{ + handlerConfig, + mtoshipment.NewShipmentApprover( + mtoshipment.NewShipmentRouter(), + mtoserviceitem.NewMTOServiceItemCreator(handlerConfig.HHGPlanner(), queryBuilder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + handlerConfig.HHGPlanner(), + move.NewMoveWeights(mtoshipment.NewShipmentReweighRequester(), waf), + moveTaskOrderUpdater, + moveRouter, + ), + shipmentSITStatus, + moveTaskOrderUpdater, + } + ghcAPI.ShipmentApproveShipmentHandler = ApproveShipmentHandler{ handlerConfig, mtoshipment.NewShipmentApprover( @@ -417,8 +431,11 @@ func NewGhcAPIHandler(handlerConfig handlers.HandlerConfig) *ghcops.MymoveAPI { mtoserviceitem.NewMTOServiceItemCreator(handlerConfig.HHGPlanner(), queryBuilder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), handlerConfig.HHGPlanner(), move.NewMoveWeights(mtoshipment.NewShipmentReweighRequester(), waf), + moveTaskOrderUpdater, + moveRouter, ), shipmentSITStatus, + moveTaskOrderUpdater, } ghcAPI.ShipmentRequestShipmentDiversionHandler = RequestShipmentDiversionHandler{ diff --git a/pkg/handlers/ghcapi/move_task_order.go b/pkg/handlers/ghcapi/move_task_order.go index 2c9196b68be..5edab32d99a 100644 --- a/pkg/handlers/ghcapi/move_task_order.go +++ b/pkg/handlers/ghcapi/move_task_order.go @@ -17,7 +17,6 @@ import ( "github.com/transcom/mymove/pkg/services" "github.com/transcom/mymove/pkg/services/audit" "github.com/transcom/mymove/pkg/services/event" - movetaskorder "github.com/transcom/mymove/pkg/services/move_task_order" ) // GetMoveTaskOrderHandler fetches a Move Task Order @@ -74,13 +73,7 @@ func (h UpdateMoveTaskOrderStatusHandlerFunc) Handle(params movetaskorderops.Upd serviceItemCodes = *params.ServiceItemCodes } - checker := movetaskorder.NewMoveTaskOrderChecker() - availableBefore, err := checker.MTOAvailableToPrime(appCtx, moveTaskOrderID) - if err != nil { - return movetaskorderops.NewUpdateMoveTaskOrderStatusInternalServerError(), err - } - - mto, err := h.moveTaskOrderStatusUpdater.MakeAvailableToPrime(appCtx, moveTaskOrderID, eTag, + mto, err := h.moveTaskOrderStatusUpdater.ApproveMoveAndCreateServiceItems(appCtx, moveTaskOrderID, eTag, serviceItemCodes.ServiceCodeMS, serviceItemCodes.ServiceCodeCS) if err != nil { @@ -106,35 +99,11 @@ func (h UpdateMoveTaskOrderStatusHandlerFunc) Handle(params movetaskorderops.Upd } } - if !availableBefore { - availableAfter, checkErr := checker.MTOAvailableToPrime(appCtx, moveTaskOrderID) - if checkErr != nil { - return movetaskorderops.NewUpdateMoveTaskOrderStatusInternalServerError(), err - } - - /* Do not send TOO approving and submitting service items email if BLUEBARK/SAFETY */ - if availableAfter && mto.Orders.CanSendEmailWithOrdersType() { - emailErr := h.NotificationSender().SendNotification(appCtx, - notifications.NewMoveIssuedToPrime(moveTaskOrderID), - ) - if emailErr != nil { - return movetaskorderops.NewUpdateMoveTaskOrderStatusInternalServerError(), err - } - } - } - moveTaskOrderPayload, err := payloads.Move(mto, h.FileStorer()) if err != nil { return movetaskorderops.NewUpdateMoveTaskOrderStatusInternalServerError(), err } - // Audit attempt to make MTO available to prime - _, err = audit.Capture(appCtx, mto, moveTaskOrderPayload, params.HTTPRequest) - if err != nil { - appCtx.Logger().Error("Auditing service error for making MTO available to Prime.", zap.Error(err)) - return movetaskorderops.NewUpdateMoveTaskOrderStatusInternalServerError(), err - } - _, err = event.TriggerEvent(event.Event{ EventKey: event.MoveTaskOrderUpdateEventKey, MtoID: mto.ID, diff --git a/pkg/handlers/ghcapi/move_task_order_test.go b/pkg/handlers/ghcapi/move_task_order_test.go index a156eb19251..d03fcaf0828 100644 --- a/pkg/handlers/ghcapi/move_task_order_test.go +++ b/pkg/handlers/ghcapi/move_task_order_test.go @@ -218,9 +218,7 @@ func (suite *HandlerSuite) TestUpdateMoveTaskOrderHandlerIntegrationSuccess() { suite.Assertions.IsType(&movetaskorderops.UpdateMoveTaskOrderStatusOK{}, response) suite.Equal(strfmt.UUID(move.ID.String()), movePayload.ID) - suite.NotNil(movePayload.AvailableToPrimeAt) suite.NotNil(movePayload.ApprovedAt) - suite.HasWebhookNotification(move.ID, traceID) // this action always creates a notification for the Prime // also check MTO level service items are properly created var serviceItems models.MTOServiceItems @@ -264,7 +262,7 @@ func (suite *HandlerSuite) TestUpdateMoveTaskOrderHandlerIntegrationWithStaleEta // Stale ETags are already unit tested in the move_task_order_updater_test, // so we can mock this here to speed up the test and avoid hitting the DB moveUpdater := &mocks.MoveTaskOrderUpdater{} - moveUpdater.On("MakeAvailableToPrime", + moveUpdater.On("ApproveMoveAndCreateServiceItems", mock.AnythingOfType("*appcontext.appContext"), mock.Anything, mock.Anything, diff --git a/pkg/handlers/ghcapi/mto_shipment.go b/pkg/handlers/ghcapi/mto_shipment.go index 53011950b49..c59aeda1e81 100644 --- a/pkg/handlers/ghcapi/mto_shipment.go +++ b/pkg/handlers/ghcapi/mto_shipment.go @@ -23,6 +23,7 @@ import ( "github.com/transcom/mymove/pkg/models/roles" "github.com/transcom/mymove/pkg/notifications" "github.com/transcom/mymove/pkg/services" + "github.com/transcom/mymove/pkg/services/audit" "github.com/transcom/mymove/pkg/services/event" mtoshipment "github.com/transcom/mymove/pkg/services/mto_shipment" ppmshipment "github.com/transcom/mymove/pkg/services/ppmshipment" @@ -511,6 +512,7 @@ type ApproveShipmentHandler struct { handlers.HandlerConfig services.ShipmentApprover services.ShipmentSITStatus + services.MoveTaskOrderUpdater } // Handle approves a shipment @@ -551,6 +553,49 @@ func (h ApproveShipmentHandler) Handle(params shipmentops.ApproveShipmentParams) return handleError(err) } + move, wasMadeAvailableToPrime, err := h.MakeAvailableToPrime(appCtx, shipment.MoveTaskOrderID) + if err != nil { + appCtx.Logger().Error("Error making move available to prime", zap.Error(err)) + return handleError(err) + } + + // Execute tasks if the move has just become available to Prime (migrated from move_task_order.go) + if wasMadeAvailableToPrime { + /* Do not send TOO approving and submitting service items email if BLUEBARK/SAFETY */ + if move.Orders.CanSendEmailWithOrdersType() { + emailErr := h.NotificationSender().SendNotification(appCtx, + notifications.NewMoveIssuedToPrime(move.ID), + ) + if emailErr != nil { + return handleError(err) + } + } + + // Prepare move payload for auditing + moveTaskOrderPayload, err := payloads.Move(move, h.FileStorer()) + if err != nil { + return handleError(err) + } + // Audit attempt to make MTO available to prime + _, err = audit.Capture(appCtx, move, moveTaskOrderPayload, params.HTTPRequest) + if err != nil { + appCtx.Logger().Error("Auditing service error for making MTO available to Prime.", zap.Error(err)) + return handleError(err) + } + // Move update event + _, err = event.TriggerEvent(event.Event{ + EventKey: event.MoveTaskOrderUpdateEventKey, + MtoID: move.ID, + UpdatedObjectID: move.ID, + EndpointKey: event.GhcUpdateMoveTaskOrderStatusEndpointKey, + AppContext: appCtx, + TraceID: h.GetTraceIDFromRequest(params.HTTPRequest), + }) + if err != nil { + appCtx.Logger().Error("ghcapi.ApproveShipmentHandlerFunc could not generate the event") + } + } + h.triggerShipmentApprovalEvent(appCtx, shipmentID, shipment.MoveTaskOrderID, params) shipmentSITStatus, _, err := h.CalculateShipmentSITStatus(appCtx, *shipment) @@ -582,6 +627,164 @@ func (h ApproveShipmentHandler) triggerShipmentApprovalEvent(appCtx appcontext.A } } +// ApproveShipmentsHandler approves one or more shipments +type ApproveShipmentsHandler struct { + handlers.HandlerConfig + services.ShipmentApprover + services.ShipmentSITStatus + services.MoveTaskOrderUpdater +} + +// Handle approves one or more shipments +func (h ApproveShipmentsHandler) Handle(params shipmentops.ApproveShipmentsParams) middleware.Responder { + return h.AuditableAppContextFromRequestWithErrors(params.HTTPRequest, + func(appCtx appcontext.AppContext) (middleware.Responder, error) { + + // Check user permissions (TOO role required) + if !appCtx.Session().IsOfficeUser() || !appCtx.Session().Roles.HasRole(roles.RoleTypeTOO) { + forbiddenError := apperror.NewForbiddenError("Only TOO role can approve shipments") + appCtx.Logger().Error(forbiddenError.Error()) + return shipmentops.NewApproveShipmentsForbidden(), forbiddenError + } + + handleError := func(err error) (middleware.Responder, error) { + appCtx.Logger().Error("ghcapi.ApproveShipmentsHandler", zap.Error(err)) + payload := &ghcmessages.Error{Message: handlers.FmtString(err.Error())} + + switch e := err.(type) { + case apperror.NotFoundError: + return shipmentops.NewApproveShipmentsNotFound().WithPayload(payload), err + case apperror.InvalidInputError: + payload := payloadForValidationError("Validation errors", "ApproveShipments", h.GetTraceIDFromRequest(params.HTTPRequest), e.ValidationErrors) + return shipmentops.NewApproveShipmentsUnprocessableEntity().WithPayload(payload), err + case apperror.PreconditionFailedError: + return shipmentops.NewApproveShipmentsPreconditionFailed(). + WithPayload(&ghcmessages.Error{Message: handlers.FmtString(err.Error())}), err + case apperror.ConflictError, mtoshipment.ConflictStatusError: + return shipmentops.NewApproveShipmentsConflict().WithPayload(&ghcmessages.Error{Message: handlers.FmtString(err.Error())}), err + default: + return shipmentops.NewApproveShipmentsInternalServerError(). + WithPayload(&ghcmessages.Error{Message: handlers.FmtString("Internal server errors")}), err + } + } + + if len(params.Body.ApproveShipments) == 0 { + appCtx.Logger().Error("Invalid mto shipment: params Body is nil") + emptyBodyError := apperror.NewBadDataError("The MTO Shipment request body cannot be empty.") + payload := payloadForValidationError( + "Empty body error", + emptyBodyError.Error(), + h.GetTraceIDFromRequest(params.HTTPRequest), + validate.NewErrors(), + ) + + return shipmentops.NewApproveShipmentsUnprocessableEntity().WithPayload(payload), emptyBodyError + } + + var shipmentIdWithEtagArr []services.ShipmentIdWithEtag + for _, shipment := range params.Body.ApproveShipments { + shipmentID := uuid.FromStringOrNil(shipment.ShipmentID.String()) + + if shipment.ETag == nil { + return shipmentops.NewApproveShipmentsPreconditionFailed(). + WithPayload(&ghcmessages.Error{Message: handlers.FmtString("eTag is required for each shipment")}), nil + } + + shipmentIdWithEtagArr = append(shipmentIdWithEtagArr, services.ShipmentIdWithEtag{ + ShipmentID: shipmentID, + ETag: *shipment.ETag, + }) + } + + // Approve shipments + approvedShipments, err := h.ShipmentApprover.ApproveShipments(appCtx, shipmentIdWithEtagArr) + if err != nil { + appCtx.Logger().Error("Error approving shipments", zap.Error(err)) + return handleError(err) + } + + // Make the move available to prime + if approvedShipments != nil && len(*approvedShipments) > 0 { + move, wasMadeAvailableToPrime, err := h.MakeAvailableToPrime(appCtx, (*approvedShipments)[0].MoveTaskOrderID) + if err != nil { + appCtx.Logger().Error("Error making move available to prime", zap.Error(err)) + return handleError(err) + } + + // Execute tasks if the move has just become available to Prime (migrated from move_task_order.go) + if wasMadeAvailableToPrime { + /* Do not send TOO approving and submitting service items email if BLUEBARK/SAFETY */ + if move.Orders.CanSendEmailWithOrdersType() { + emailErr := h.NotificationSender().SendNotification(appCtx, + notifications.NewMoveIssuedToPrime(move.ID), + ) + if emailErr != nil { + return handleError(err) + } + } + + // Prepare move payload for auditing + moveTaskOrderPayload, err := payloads.Move(move, h.FileStorer()) + if err != nil { + return handleError(err) + } + // Audit attempt to make MTO available to prime + _, err = audit.Capture(appCtx, move, moveTaskOrderPayload, params.HTTPRequest) + if err != nil { + appCtx.Logger().Error("Auditing service error for making MTO available to Prime.", zap.Error(err)) + return handleError(err) + } + // Move update event + _, err = event.TriggerEvent(event.Event{ + EventKey: event.MoveTaskOrderUpdateEventKey, + MtoID: move.ID, + UpdatedObjectID: move.ID, + EndpointKey: event.GhcUpdateMoveTaskOrderStatusEndpointKey, + AppContext: appCtx, + TraceID: h.GetTraceIDFromRequest(params.HTTPRequest), + }) + if err != nil { + appCtx.Logger().Error("ghcapi.ApproveShipmentsHandlerFunc could not generate the event") + } + } + } + + // Prepare successful response payload + payload := make(ghcmessages.MTOShipments, len(*approvedShipments)) + for i, approvedShipment := range *approvedShipments { + h.triggerShipmentApprovalEvent(appCtx, approvedShipment.ID, approvedShipment.MoveTaskOrderID, params) + + shipmentSITStatus, _, err := h.CalculateShipmentSITStatus(appCtx, approvedShipment) + if err != nil { + return handleError(err) + } + + sitStatusPayload := payloads.SITStatus(shipmentSITStatus, h.FileStorer()) + payload[i] = payloads.MTOShipment(h.FileStorer(), &approvedShipment, sitStatusPayload) + } + + return shipmentops.NewApproveShipmentsOK().WithPayload(payload), nil + }) +} + +func (h ApproveShipmentsHandler) triggerShipmentApprovalEvent(appCtx appcontext.AppContext, shipmentID uuid.UUID, moveID uuid.UUID, params shipmentops.ApproveShipmentsParams) { + + _, err := event.TriggerEvent(event.Event{ + EndpointKey: event.GhcApproveShipmentEndpointKey, + // Endpoint that is being handled + EventKey: event.ShipmentApproveEventKey, // Event that you want to trigger + UpdatedObjectID: shipmentID, // ID of the updated logical object + MtoID: moveID, // ID of the associated Move + AppContext: appCtx, + TraceID: h.GetTraceIDFromRequest(params.HTTPRequest), + }) + + // If the event trigger fails, just log the error. + if err != nil { + appCtx.Logger().Error("ghcapi.ApproveShipmentHandler could not generate the event", zap.Error(err)) + } +} + // RequestShipmentDiversionHandler Requests a shipment diversion type RequestShipmentDiversionHandler struct { handlers.HandlerConfig diff --git a/pkg/handlers/ghcapi/mto_shipment_test.go b/pkg/handlers/ghcapi/mto_shipment_test.go index 8b101ecb4ae..147036bb95b 100644 --- a/pkg/handlers/ghcapi/mto_shipment_test.go +++ b/pkg/handlers/ghcapi/mto_shipment_test.go @@ -582,8 +582,62 @@ func (suite *HandlerSuite) TestGetShipmentHandler() { func (suite *HandlerSuite) TestApproveShipmentHandler() { waf := entitlements.NewWeightAllotmentFetcher() + setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { + mockCreator := &mocks.SignedCertificationCreator{} + + mockCreator.On( + "CreateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + ).Return(returnValue...) + + return mockCreator + } + + setUpSignedCertificationUpdaterMock := func(returnValue ...interface{}) services.SignedCertificationUpdater { + mockUpdater := &mocks.SignedCertificationUpdater{} + + mockUpdater.On( + "UpdateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + mock.AnythingOfType("string"), + ).Return(returnValue...) + + return mockUpdater + } + + builder := query.NewQueryBuilder() + moveRouter := moveservices.NewMoveRouter() + planner := &routemocks.Planner{} + planner.On("ZipTransitDistance", + mock.AnythingOfType("*appcontext.appContext"), + mock.Anything, + mock.Anything, + false, + false, + ).Return(400, nil) + ppmEstimator := mocks.PPMEstimator{} + planner.On("ZipTransitDistance", + mock.AnythingOfType("*appcontext.appContext"), + mock.Anything, + mock.Anything, + false, + ).Return(400, nil) + moveTaskOrderUpdater := movetaskorder.NewMoveTaskOrderUpdater( + builder, + mtoserviceitem.NewMTOServiceItemCreator(planner, builder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), &ppmEstimator, + ) + suite.Run("Returns 200 when all validations pass", func() { - move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + move := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + }, nil) shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ { Model: move, @@ -598,22 +652,14 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { eTag := etag.GenerateEtag(shipment.UpdatedAt) officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) - builder := query.NewQueryBuilder() - moveRouter := moveservices.NewMoveRouter() - planner := &routemocks.Planner{} moveWeights := moveservices.NewMoveWeights(mtoshipment.NewShipmentReweighRequester(), waf) - planner.On("ZipTransitDistance", - mock.AnythingOfType("*appcontext.appContext"), - mock.Anything, - mock.Anything, - false, - false, - ).Return(400, nil) approver := mtoshipment.NewShipmentApprover( mtoshipment.NewShipmentRouter(), mtoserviceitem.NewMTOServiceItemCreator(planner, builder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), &routemocks.Planner{}, moveWeights, + moveTaskOrderUpdater, + moveRouter, ) req := httptest.NewRequest("POST", fmt.Sprintf("/shipments/%s/approve", shipment.ID.String()), nil) @@ -629,6 +675,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ @@ -647,6 +694,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { suite.NoError(payload.Validate(strfmt.Default)) suite.HasWebhookNotification(shipment.ID, traceID) + suite.HasWebhookNotification(move.ID, traceID) // this action always creates a notification for the Prime }) suite.Run("Returns a 403 when the office user is not a TOO", func() { @@ -664,6 +712,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -703,6 +752,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -742,6 +792,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -781,6 +832,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -820,6 +872,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -859,6 +912,7 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { handlerConfig, approver, sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, } approveParams := shipmentops.ApproveShipmentParams{ HTTPRequest: req, @@ -877,6 +931,462 @@ func (suite *HandlerSuite) TestApproveShipmentHandler() { }) } +// ApproveShipment(s)Handler +func (suite *HandlerSuite) TestApproveShipmentsHandler() { + waf := entitlements.NewWeightAllotmentFetcher() + + setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { + mockCreator := &mocks.SignedCertificationCreator{} + + mockCreator.On( + "CreateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + ).Return(returnValue...) + + return mockCreator + } + + setUpSignedCertificationUpdaterMock := func(returnValue ...interface{}) services.SignedCertificationUpdater { + mockUpdater := &mocks.SignedCertificationUpdater{} + + mockUpdater.On( + "UpdateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + mock.AnythingOfType("string"), + ).Return(returnValue...) + + return mockUpdater + } + + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + builder := query.NewQueryBuilder() + moveRouter := moveservices.NewMoveRouter() + planner := &routemocks.Planner{} + moveWeights := moveservices.NewMoveWeights(mtoshipment.NewShipmentReweighRequester(), waf) + planner.On("ZipTransitDistance", + mock.AnythingOfType("*appcontext.appContext"), + mock.Anything, + mock.Anything, + false, + false, + ).Return(400, nil) + + ppmEstimator := mocks.PPMEstimator{} + planner.On("ZipTransitDistance", + mock.AnythingOfType("*appcontext.appContext"), + mock.Anything, + mock.Anything, + false, + ).Return(400, nil) + moveTaskOrderUpdater := movetaskorder.NewMoveTaskOrderUpdater( + builder, + mtoserviceitem.NewMTOServiceItemCreator(planner, builder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), &ppmEstimator, + ) + + suite.Run("Returns 200 when all validations pass", func() { + move := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + Status: models.MoveStatusAPPROVALSREQUESTED, + }, + }, + }, nil) + shipment1 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + shipment2 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + eTag1 := etag.GenerateEtag(shipment1.UpdatedAt) + eTag2 := etag.GenerateEtag(shipment2.UpdatedAt) + + approver := mtoshipment.NewShipmentApprover( + mtoshipment.NewShipmentRouter(), + mtoserviceitem.NewMTOServiceItemCreator(planner, builder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + &routemocks.Planner{}, + moveWeights, + moveTaskOrderUpdater, + moveRouter, + ) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + + traceID, err := uuid.NewV4() + suite.FatalNoError(err, "Error creating a new trace ID.") + req = req.WithContext(trace.NewContext(req.Context(), traceID)) + + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment1.ID), + ETag: &eTag1, + }, + { + ShipmentID: handlers.FmtUUID(shipment2.ID), + ETag: &eTag2, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsOK{}, response) + payload := response.(*shipmentops.ApproveShipmentsOK).Payload + + // Validate outgoing payload + suite.NoError(payload[0].Validate(strfmt.Default)) + suite.NoError(payload[1].Validate(strfmt.Default)) + + suite.HasWebhookNotification(move.ID, traceID) // this action always creates a notification for the Prime + suite.HasWebhookNotification(shipment1.ID, traceID) + suite.HasWebhookNotification(shipment2.ID, traceID) + }) + + suite.Run("Returns a 403 when the office user is not a TOO", func() { + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + shipment := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + eTag := etag.GenerateEtag(shipment.UpdatedAt) + + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeServicesCounselor}) + approver := &mocks.ShipmentApprover{} + + approver.AssertNumberOfCalls(suite.T(), "ApproveShipments", 0) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsForbidden{}, response) + payload := response.(*shipmentops.ApproveShipmentsForbidden).Payload + + // Validate outgoing payload: nil payload + suite.Nil(payload) + }) + + suite.Run("Returns 404 when approver returns NotFoundError", func() { + shipment := factory.BuildMTOShipmentMinimal(nil, []factory.Customization{ + { + Model: models.MTOShipment{ + ID: uuid.Must(uuid.NewV4()), + }, + }, + }, nil) + eTag := etag.GenerateEtag(shipment.UpdatedAt) + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, apperror.NotFoundError{}) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsNotFound{}, response) + payload := response.(*shipmentops.ApproveShipmentsNotFound).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) + + suite.Run("Returns 409 when approver returns Conflict Error", func() { + shipment := factory.BuildMTOShipmentMinimal(nil, []factory.Customization{ + { + Model: models.MTOShipment{ + ID: uuid.Must(uuid.NewV4()), + }, + }, + }, nil) + eTag := etag.GenerateEtag(shipment.UpdatedAt) + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, apperror.ConflictError{}) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsConflict{}, response) + payload := response.(*shipmentops.ApproveShipmentsConflict).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) + + suite.Run("Returns 412 when eTag does not match", func() { + shipment := factory.BuildMTOShipmentMinimal(nil, []factory.Customization{ + { + Model: models.MTOShipment{ + ID: uuid.Must(uuid.NewV4()), + }, + }, + }, nil) + eTag := etag.GenerateEtag(time.Now()) + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, apperror.PreconditionFailedError{}) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsPreconditionFailed{}, response) + payload := response.(*shipmentops.ApproveShipmentsPreconditionFailed).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) + + suite.Run("Returns 422 when approver returns validation errors", func() { + shipment := factory.BuildMTOShipmentMinimal(nil, []factory.Customization{ + { + Model: models.MTOShipment{ + ID: uuid.Must(uuid.NewV4()), + }, + }, + }, nil) + eTag := etag.GenerateEtag(shipment.UpdatedAt) + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, apperror.InvalidInputError{ValidationErrors: &validate.Errors{}}) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsUnprocessableEntity{}, response) + payload := response.(*shipmentops.ApproveShipmentsUnprocessableEntity).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) + + suite.Run("Returns 422 when ApproveShipments body is empty", func() { + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, apperror.InvalidInputError{ValidationErrors: &validate.Errors{}}) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{}, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsUnprocessableEntity{}, response) + payload := response.(*shipmentops.ApproveShipmentsUnprocessableEntity).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) + + suite.Run("Returns 500 when approver returns unexpected error", func() { + shipment := factory.BuildMTOShipmentMinimal(nil, []factory.Customization{ + { + Model: models.MTOShipment{ + ID: uuid.Must(uuid.NewV4()), + }, + }, + }, nil) + eTag := etag.GenerateEtag(shipment.UpdatedAt) + officeUser := factory.BuildOfficeUserWithRoles(nil, nil, []roles.RoleType{roles.RoleTypeTOO}) + approver := &mocks.ShipmentApprover{} + + approver.On("ApproveShipments", mock.AnythingOfType("*appcontext.appContext"), mock.AnythingOfType("[]services.ShipmentIdWithEtag")).Return(nil, errors.New("UnexpectedError")) + + req := httptest.NewRequest("POST", "/shipments/approve", nil) + req = suite.AuthenticateOfficeRequest(req, officeUser) + handlerConfig := suite.HandlerConfig() + + handler := ApproveShipmentsHandler{ + handlerConfig, + approver, + sitstatus.NewShipmentSITStatus(), + moveTaskOrderUpdater, + } + approveParams := shipmentops.ApproveShipmentsParams{ + HTTPRequest: req, + Body: &ghcmessages.ApproveShipments{ + ApproveShipments: []*ghcmessages.ApproveShipmentsApproveShipmentsItems0{ + { + ShipmentID: handlers.FmtUUID(shipment.ID), + ETag: &eTag, + }, + }, + }, + } + + // Validate incoming payload: no body to validate + response := handler.Handle(approveParams) + suite.IsType(&shipmentops.ApproveShipmentsInternalServerError{}, response) + payload := response.(*shipmentops.ApproveShipmentsInternalServerError).Payload + + // Validate outgoing payload + suite.NoError(payload.Validate(strfmt.Default)) + }) +} + func (suite *HandlerSuite) TestRequestShipmentDiversionHandler() { diversionReason := "Test Reason" diff --git a/pkg/handlers/supportapi/move_task_order.go b/pkg/handlers/supportapi/move_task_order.go index 98862bfbcc3..41bc92fbf9c 100644 --- a/pkg/handlers/supportapi/move_task_order.go +++ b/pkg/handlers/supportapi/move_task_order.go @@ -63,9 +63,7 @@ func (h MakeMoveTaskOrderAvailableHandlerFunc) Handle(params movetaskorderops.Ma moveTaskOrderID := uuid.FromStringOrNil(params.MoveTaskOrderID) - mto, err := h.moveTaskOrderAvailabilityUpdater.MakeAvailableToPrime(appCtx, moveTaskOrderID, eTag, false, false) - - if err != nil { + handleError := func(err error) (middleware.Responder, error) { appCtx.Logger().Error("supportapi.MakeMoveTaskOrderAvailableHandlerFunc error", zap.Error(err)) switch typedErr := err.(type) { case apperror.NotFoundError: @@ -83,6 +81,16 @@ func (h MakeMoveTaskOrderAvailableHandlerFunc) Handle(params movetaskorderops.Ma } } + _, err := h.moveTaskOrderAvailabilityUpdater.ApproveMoveAndCreateServiceItems(appCtx, moveTaskOrderID, eTag, false, false) + if err != nil { + return handleError(err) + } + + mto, _, err := h.moveTaskOrderAvailabilityUpdater.MakeAvailableToPrime(appCtx, moveTaskOrderID) + if err != nil { + return handleError(err) + } + moveTaskOrderPayload := payloads.MoveTaskOrder(mto) return movetaskorderops.NewMakeMoveTaskOrderAvailableOK().WithPayload(moveTaskOrderPayload), nil diff --git a/pkg/services/mocks/MoveTaskOrderUpdater.go b/pkg/services/mocks/MoveTaskOrderUpdater.go index 8eeaa09fcf3..ec3a1176939 100644 --- a/pkg/services/mocks/MoveTaskOrderUpdater.go +++ b/pkg/services/mocks/MoveTaskOrderUpdater.go @@ -16,12 +16,12 @@ type MoveTaskOrderUpdater struct { mock.Mock } -// MakeAvailableToPrime provides a mock function with given fields: appCtx, moveTaskOrderID, eTag, includeServiceCodeMS, includeServiceCodeCS -func (_m *MoveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, includeServiceCodeMS bool, includeServiceCodeCS bool) (*models.Move, error) { +// ApproveMoveAndCreateServiceItems provides a mock function with given fields: appCtx, moveTaskOrderID, eTag, includeServiceCodeMS, includeServiceCodeCS +func (_m *MoveTaskOrderUpdater) ApproveMoveAndCreateServiceItems(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, includeServiceCodeMS bool, includeServiceCodeCS bool) (*models.Move, error) { ret := _m.Called(appCtx, moveTaskOrderID, eTag, includeServiceCodeMS, includeServiceCodeCS) if len(ret) == 0 { - panic("no return value specified for MakeAvailableToPrime") + panic("no return value specified for ApproveMoveAndCreateServiceItems") } var r0 *models.Move @@ -46,6 +46,43 @@ func (_m *MoveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContex return r0, r1 } +// MakeAvailableToPrime provides a mock function with given fields: appCtx, moveTaskOrderID +func (_m *MoveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, bool, error) { + ret := _m.Called(appCtx, moveTaskOrderID) + + if len(ret) == 0 { + panic("no return value specified for MakeAvailableToPrime") + } + + var r0 *models.Move + var r1 bool + var r2 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID) (*models.Move, bool, error)); ok { + return rf(appCtx, moveTaskOrderID) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, uuid.UUID) *models.Move); ok { + r0 = rf(appCtx, moveTaskOrderID) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*models.Move) + } + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, uuid.UUID) bool); ok { + r1 = rf(appCtx, moveTaskOrderID) + } else { + r1 = ret.Get(1).(bool) + } + + if rf, ok := ret.Get(2).(func(appcontext.AppContext, uuid.UUID) error); ok { + r2 = rf(appCtx, moveTaskOrderID) + } else { + r2 = ret.Error(2) + } + + return r0, r1, r2 +} + // ShowHide provides a mock function with given fields: appCtx, moveTaskOrderID, show func (_m *MoveTaskOrderUpdater) ShowHide(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, show *bool) (*models.Move, error) { ret := _m.Called(appCtx, moveTaskOrderID, show) diff --git a/pkg/services/mocks/ShipmentApprover.go b/pkg/services/mocks/ShipmentApprover.go index ede7bdcc395..55722e53f55 100644 --- a/pkg/services/mocks/ShipmentApprover.go +++ b/pkg/services/mocks/ShipmentApprover.go @@ -8,6 +8,8 @@ import ( models "github.com/transcom/mymove/pkg/models" + services "github.com/transcom/mymove/pkg/services" + uuid "github.com/gofrs/uuid" ) @@ -46,6 +48,36 @@ func (_m *ShipmentApprover) ApproveShipment(appCtx appcontext.AppContext, shipme return r0, r1 } +// ApproveShipments provides a mock function with given fields: appCtx, shipments +func (_m *ShipmentApprover) ApproveShipments(appCtx appcontext.AppContext, shipments []services.ShipmentIdWithEtag) (*[]models.MTOShipment, error) { + ret := _m.Called(appCtx, shipments) + + if len(ret) == 0 { + panic("no return value specified for ApproveShipments") + } + + var r0 *[]models.MTOShipment + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, []services.ShipmentIdWithEtag) (*[]models.MTOShipment, error)); ok { + return rf(appCtx, shipments) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, []services.ShipmentIdWithEtag) *[]models.MTOShipment); ok { + r0 = rf(appCtx, shipments) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*[]models.MTOShipment) + } + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, []services.ShipmentIdWithEtag) error); ok { + r1 = rf(appCtx, shipments) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // NewShipmentApprover creates a new instance of ShipmentApprover. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewShipmentApprover(t interface { diff --git a/pkg/services/mocks/WeightAllotmentFetcher.go b/pkg/services/mocks/WeightAllotmentFetcher.go new file mode 100644 index 00000000000..fa36bfbee2e --- /dev/null +++ b/pkg/services/mocks/WeightAllotmentFetcher.go @@ -0,0 +1,117 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + appcontext "github.com/transcom/mymove/pkg/appcontext" + internalmessages "github.com/transcom/mymove/pkg/gen/internalmessages" + + mock "github.com/stretchr/testify/mock" + + models "github.com/transcom/mymove/pkg/models" +) + +// WeightAllotmentFetcher is an autogenerated mock type for the WeightAllotmentFetcher type +type WeightAllotmentFetcher struct { + mock.Mock +} + +// GetAllWeightAllotments provides a mock function with given fields: appCtx +func (_m *WeightAllotmentFetcher) GetAllWeightAllotments(appCtx appcontext.AppContext) (map[internalmessages.OrderPayGrade]models.WeightAllotment, error) { + ret := _m.Called(appCtx) + + if len(ret) == 0 { + panic("no return value specified for GetAllWeightAllotments") + } + + var r0 map[internalmessages.OrderPayGrade]models.WeightAllotment + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext) (map[internalmessages.OrderPayGrade]models.WeightAllotment, error)); ok { + return rf(appCtx) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext) map[internalmessages.OrderPayGrade]models.WeightAllotment); ok { + r0 = rf(appCtx) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(map[internalmessages.OrderPayGrade]models.WeightAllotment) + } + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext) error); ok { + r1 = rf(appCtx) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetWeightAllotment provides a mock function with given fields: appCtx, grade, ordersType +func (_m *WeightAllotmentFetcher) GetWeightAllotment(appCtx appcontext.AppContext, grade string, ordersType internalmessages.OrdersType) (models.WeightAllotment, error) { + ret := _m.Called(appCtx, grade, ordersType) + + if len(ret) == 0 { + panic("no return value specified for GetWeightAllotment") + } + + var r0 models.WeightAllotment + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, internalmessages.OrdersType) (models.WeightAllotment, error)); ok { + return rf(appCtx, grade, ordersType) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, string, internalmessages.OrdersType) models.WeightAllotment); ok { + r0 = rf(appCtx, grade, ordersType) + } else { + r0 = ret.Get(0).(models.WeightAllotment) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, string, internalmessages.OrdersType) error); ok { + r1 = rf(appCtx, grade, ordersType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// GetWeightAllotmentByOrdersType provides a mock function with given fields: appCtx, ordersType +func (_m *WeightAllotmentFetcher) GetWeightAllotmentByOrdersType(appCtx appcontext.AppContext, ordersType internalmessages.OrdersType) (models.WeightAllotment, error) { + ret := _m.Called(appCtx, ordersType) + + if len(ret) == 0 { + panic("no return value specified for GetWeightAllotmentByOrdersType") + } + + var r0 models.WeightAllotment + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, internalmessages.OrdersType) (models.WeightAllotment, error)); ok { + return rf(appCtx, ordersType) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, internalmessages.OrdersType) models.WeightAllotment); ok { + r0 = rf(appCtx, ordersType) + } else { + r0 = ret.Get(0).(models.WeightAllotment) + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, internalmessages.OrdersType) error); ok { + r1 = rf(appCtx, ordersType) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewWeightAllotmentFetcher creates a new instance of WeightAllotmentFetcher. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWeightAllotmentFetcher(t interface { + mock.TestingT + Cleanup(func()) +}) *WeightAllotmentFetcher { + mock := &WeightAllotmentFetcher{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/services/mocks/WeightRestrictor.go b/pkg/services/mocks/WeightRestrictor.go new file mode 100644 index 00000000000..6f7ad72bae4 --- /dev/null +++ b/pkg/services/mocks/WeightRestrictor.go @@ -0,0 +1,89 @@ +// Code generated by mockery. DO NOT EDIT. + +package mocks + +import ( + mock "github.com/stretchr/testify/mock" + appcontext "github.com/transcom/mymove/pkg/appcontext" + + models "github.com/transcom/mymove/pkg/models" +) + +// WeightRestrictor is an autogenerated mock type for the WeightRestrictor type +type WeightRestrictor struct { + mock.Mock +} + +// ApplyWeightRestrictionToEntitlement provides a mock function with given fields: appCtx, entitlement, weightRestriction, eTag +func (_m *WeightRestrictor) ApplyWeightRestrictionToEntitlement(appCtx appcontext.AppContext, entitlement models.Entitlement, weightRestriction int, eTag string) (*models.Entitlement, error) { + ret := _m.Called(appCtx, entitlement, weightRestriction, eTag) + + if len(ret) == 0 { + panic("no return value specified for ApplyWeightRestrictionToEntitlement") + } + + var r0 *models.Entitlement + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.Entitlement, int, string) (*models.Entitlement, error)); ok { + return rf(appCtx, entitlement, weightRestriction, eTag) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.Entitlement, int, string) *models.Entitlement); ok { + r0 = rf(appCtx, entitlement, weightRestriction, eTag) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*models.Entitlement) + } + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.Entitlement, int, string) error); ok { + r1 = rf(appCtx, entitlement, weightRestriction, eTag) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// RemoveWeightRestrictionFromEntitlement provides a mock function with given fields: appCtx, entitlement, eTag +func (_m *WeightRestrictor) RemoveWeightRestrictionFromEntitlement(appCtx appcontext.AppContext, entitlement models.Entitlement, eTag string) (*models.Entitlement, error) { + ret := _m.Called(appCtx, entitlement, eTag) + + if len(ret) == 0 { + panic("no return value specified for RemoveWeightRestrictionFromEntitlement") + } + + var r0 *models.Entitlement + var r1 error + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.Entitlement, string) (*models.Entitlement, error)); ok { + return rf(appCtx, entitlement, eTag) + } + if rf, ok := ret.Get(0).(func(appcontext.AppContext, models.Entitlement, string) *models.Entitlement); ok { + r0 = rf(appCtx, entitlement, eTag) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*models.Entitlement) + } + } + + if rf, ok := ret.Get(1).(func(appcontext.AppContext, models.Entitlement, string) error); ok { + r1 = rf(appCtx, entitlement, eTag) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// NewWeightRestrictor creates a new instance of WeightRestrictor. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewWeightRestrictor(t interface { + mock.TestingT + Cleanup(func()) +}) *WeightRestrictor { + mock := &WeightRestrictor{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/pkg/services/move_task_order.go b/pkg/services/move_task_order.go index 717d2b7c566..9f0d3a9f01e 100644 --- a/pkg/services/move_task_order.go +++ b/pkg/services/move_task_order.go @@ -57,13 +57,14 @@ type MoveTaskOrderFetcher interface { // //go:generate mockery --name MoveTaskOrderUpdater type MoveTaskOrderUpdater interface { - MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, includeServiceCodeMS bool, includeServiceCodeCS bool) (*models.Move, error) + ApproveMoveAndCreateServiceItems(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, includeServiceCodeMS bool, includeServiceCodeCS bool) (*models.Move, error) UpdatePostCounselingInfo(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string) (*models.Move, error) UpdateStatusServiceCounselingCompleted(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string) (*models.Move, error) UpdateReviewedBillableWeightsAt(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string) (*models.Move, error) UpdateTIORemarks(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, remarks string) (*models.Move, error) ShowHide(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, show *bool) (*models.Move, error) UpdatePPMType(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, error) + MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, bool, error) } // MoveTaskOrderChecker is the service object interface for checking if a MoveTaskOrder is in a certain state diff --git a/pkg/services/move_task_order/move_task_order_updater.go b/pkg/services/move_task_order/move_task_order_updater.go index d0cd55aed37..463c5e33a37 100644 --- a/pkg/services/move_task_order/move_task_order_updater.go +++ b/pkg/services/move_task_order/move_task_order_updater.go @@ -239,11 +239,11 @@ func (o moveTaskOrderUpdater) UpdateTIORemarks(appCtx appcontext.AppContext, mov return move, nil } -// MakeAvailableToPrime approves a Move, makes it available to prime, and +// ApproveMoveAndCreateServiceItems approves a Move and // creates Move-level service items (counseling and move management) if the // TOO selected them. If the move received service counseling, the counseling // service item will automatically be created without the TOO having to select it. -func (o *moveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, +func (o *moveTaskOrderUpdater) ApproveMoveAndCreateServiceItems(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID, eTag string, includeServiceCodeMS bool, includeServiceCodeCS bool) (*models.Move, error) { searchParams := services.MoveTaskOrderFetcherParams{ @@ -263,14 +263,9 @@ func (o *moveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext //When approving a shipment - remove the assigned TOO user move.TOOAssignedID = nil - // If the move is already been made available to prime, we will not need to approve and update the move, - // just the provided service items. updateMove := false - if move.AvailableToPrimeAt == nil { + if move.ApprovedAt == nil { updateMove = true - now := time.Now() - move.AvailableToPrimeAt = &now - err = o.moveRouter.Approve(appCtx, move) if err != nil { return &models.Move{}, apperror.NewConflictError(move.ID, err.Error()) @@ -308,6 +303,42 @@ func (o *moveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext return move, nil } +// MakeAvailableToPrime makes the move available to prime +func (o *moveTaskOrderUpdater) MakeAvailableToPrime(appCtx appcontext.AppContext, moveTaskOrderID uuid.UUID) (*models.Move, bool, error) { + var move *models.Move + var wasMadeAvailableToPrime = false + + transactionError := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error { + searchParams := services.MoveTaskOrderFetcherParams{ + IncludeHidden: false, + MoveTaskOrderID: moveTaskOrderID, + } + var err error + move, err = o.FetchMoveTaskOrder(txnAppCtx, &searchParams) + if err != nil { + return err + } + + if move.AvailableToPrimeAt == nil { + now := time.Now() + move.AvailableToPrimeAt = &now + + err = o.updateMove(txnAppCtx, move, order.CheckRequiredFields()) + if err != nil { + return err + } + wasMadeAvailableToPrime = true + } + return nil + }) + + if transactionError != nil { + return &models.Move{}, false, transactionError + } + + return move, wasMadeAvailableToPrime, nil +} + func (o *moveTaskOrderUpdater) updateMove(appCtx appcontext.AppContext, move *models.Move, checks ...order.Validator) error { if verr := order.ValidateOrder(&move.Orders, checks...); verr != nil { return verr diff --git a/pkg/services/move_task_order/move_task_order_updater_test.go b/pkg/services/move_task_order/move_task_order_updater_test.go index 778619788a9..ddc1b2c3b8a 100644 --- a/pkg/services/move_task_order/move_task_order_updater_test.go +++ b/pkg/services/move_task_order/move_task_order_updater_test.go @@ -89,7 +89,7 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_UpdateStatusSer moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator, ) - suite.Run("Makes move available to Prime and Removes assigned TOO office user", func() { + suite.Run("Completes counseling and removes assigned SC office user", func() { session := suite.AppContextWithSessionForTest(&auth.Session{ ApplicationName: auth.OfficeApp, OfficeUserID: uuid.Must(uuid.NewV4()), @@ -700,7 +700,7 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_ShowHide() { }) } -func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableToPrime() { +func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_ApproveMoveAndCreateServiceItems() { ppmEstimator := &mocks.PPMEstimator{} setupTestData := func() models.OfficeUser { @@ -794,13 +794,12 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo eTag := etag.GenerateEtag(move.UpdatedAt) fetchedMove := models.Move{} - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, true, true) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, true, true) mockserviceItemCreator.AssertNumberOfCalls(suite.T(), "CreateMTOServiceItem", 0) suite.Error(err) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.Nil(fetchedMove.AvailableToPrimeAt) suite.Nil(fetchedMove.ApprovedAt) }) @@ -813,14 +812,14 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo move := factory.BuildSubmittedMove(suite.DB(), nil, nil) eTag := etag.GenerateEtag(time.Now()) - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, true, true) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, true, true) mockserviceItemCreator.AssertNumberOfCalls(suite.T(), "CreateMTOServiceItem", 0) suite.Error(err) suite.IsType(apperror.PreconditionFailedError{}, err) }) - suite.Run("Makes move available to Prime and creates Move management and Service counseling service items when both are specified", func() { + suite.Run("Approves a move and creates Move management and Service counseling service items when both are specified", func() { queryBuilder := query.NewQueryBuilder() moveRouter := moverouter.NewMoveRouter() planner := &routemocks.Planner{} @@ -839,13 +838,11 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo fetchedMove := models.Move{} var serviceItems models.MTOServiceItems - suite.Nil(move.AvailableToPrimeAt) suite.Nil(move.ApprovedAt) - updatedMove, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, true, true) + updatedMove, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, true, true) suite.NoError(err) - suite.NotNil(updatedMove.AvailableToPrimeAt) suite.NotNil(updatedMove.ApprovedAt) suite.Equal(models.MoveStatusAPPROVED, updatedMove.Status) err = suite.DB().Eager("ReService").Where("move_id = ?", move.ID).All(&serviceItems) @@ -855,11 +852,10 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo suite.True(suite.containsServiceCode(serviceItems, models.ReServiceCodeCS), fmt.Sprintf("Expected to find reServiceCode, %s, in array.", models.ReServiceCodeCS)) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.NotNil(fetchedMove.AvailableToPrimeAt) suite.NotNil(fetchedMove.ApprovedAt) suite.Equal(models.MoveStatusAPPROVED, fetchedMove.Status) }) - suite.Run("Makes move available to Prime and Removes assigned TOO office user", func() { + suite.Run("Approves a move and removes assigned TOO office user", func() { queryBuilder := query.NewQueryBuilder() moveRouter := moverouter.NewMoveRouter() planner := &routemocks.Planner{} @@ -880,13 +876,13 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo serviceItemCreator := mtoserviceitem.NewMTOServiceItemCreator(planner, queryBuilder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()) mtoUpdater := mt.NewMoveTaskOrderUpdater(queryBuilder, serviceItemCreator, moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator) eTag := etag.GenerateEtag(move.UpdatedAt) - updatedMove, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, false, false) + updatedMove, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, false, false) suite.NoError(err) suite.Nil(updatedMove.TOOAssignedID) }) - suite.Run("Makes move available to Prime and only creates Move management when it's the only one specified", func() { + suite.Run("Approves a move and only creates Move management when it's the only one specified", func() { queryBuilder := query.NewQueryBuilder() moveRouter := moverouter.NewMoveRouter() planner := &routemocks.Planner{} @@ -905,15 +901,13 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo fetchedMove := models.Move{} var serviceItems models.MTOServiceItems - suite.Nil(move.AvailableToPrimeAt) suite.Nil(move.ApprovedAt) - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, true, false) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, true, false) suite.NoError(err) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.NotNil(fetchedMove.AvailableToPrimeAt) suite.NotNil(fetchedMove.ApprovedAt) err = suite.DB().Eager("ReService").Where("move_id = ?", move.ID).All(&serviceItems) suite.NoError(err) @@ -922,7 +916,7 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo suite.False(suite.containsServiceCode(serviceItems, models.ReServiceCodeCS), fmt.Sprintf("Expected to find reServiceCode, %s, in array.", models.ReServiceCodeCS)) }) - suite.Run("Makes move available to Prime and only creates CS service item when it's the only one specified", func() { + suite.Run("Approves a move and only creates CS service item when it's the only one specified", func() { queryBuilder := query.NewQueryBuilder() moveRouter := moverouter.NewMoveRouter() planner := &routemocks.Planner{} @@ -934,15 +928,13 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo fetchedMove := models.Move{} var serviceItems models.MTOServiceItems - suite.Nil(move.AvailableToPrimeAt) suite.Nil(move.ApprovedAt) - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, false, true) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, false, true) suite.NoError(err) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.NotNil(fetchedMove.AvailableToPrimeAt) suite.NotNil(fetchedMove.ApprovedAt) err = suite.DB().Eager("ReService").Where("move_id = ?", move.ID).All(&serviceItems) suite.NoError(err) @@ -961,20 +953,18 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo eTag := etag.GenerateEtag(move.UpdatedAt) fetchedMove := models.Move{} - suite.Nil(move.AvailableToPrimeAt) suite.Nil(move.ApprovedAt) - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, false, false) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, false, false) mockserviceItemCreator.AssertNumberOfCalls(suite.T(), "CreateMTOServiceItem", 0) suite.NoError(err) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.NotNil(fetchedMove.AvailableToPrimeAt) suite.NotNil(fetchedMove.ApprovedAt) }) - suite.Run("Does not make move available to prime if Order is missing required fields", func() { + suite.Run("Does not approve a move if Order is missing required fields", func() { mockserviceItemCreator := &mocks.MTOServiceItemCreator{} queryBuilder := query.NewQueryBuilder() moveRouter := moverouter.NewMoveRouter() @@ -990,18 +980,134 @@ func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableTo eTag := etag.GenerateEtag(move.UpdatedAt) fetchedMove := models.Move{} - _, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID, eTag, true, true) + _, err := mtoUpdater.ApproveMoveAndCreateServiceItems(suite.AppContextForTest(), move.ID, eTag, true, true) mockserviceItemCreator.AssertNumberOfCalls(suite.T(), "CreateMTOServiceItem", 0) suite.Error(err) suite.IsType(apperror.InvalidInputError{}, err) err = suite.DB().Find(&fetchedMove, move.ID) suite.NoError(err) - suite.Nil(fetchedMove.AvailableToPrimeAt) suite.Nil(fetchedMove.ApprovedAt) }) } +func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_MakeAvailableToPrime() { + ppmEstimator := &mocks.PPMEstimator{} + + setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { + mockCreator := &mocks.SignedCertificationCreator{} + + mockCreator.On( + "CreateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + ).Return(returnValue...) + + return mockCreator + } + + setUpSignedCertificationUpdaterMock := func(returnValue ...interface{}) services.SignedCertificationUpdater { + mockUpdater := &mocks.SignedCertificationUpdater{} + + mockUpdater.On( + "UpdateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + mock.AnythingOfType("string"), + ).Return(returnValue...) + + return mockUpdater + } + + setupPricerData := func() { + contract := testdatagen.FetchOrMakeReContract(suite.DB(), testdatagen.Assertions{}) + + startDate := time.Date(2020, time.January, 1, 12, 0, 0, 0, time.UTC) + endDate := time.Date(2020, time.December, 31, 12, 0, 0, 0, time.UTC) + contractYear := testdatagen.FetchOrMakeReContractYear(suite.DB(), testdatagen.Assertions{ + ReContractYear: models.ReContractYear{ + Contract: contract, + ContractID: contract.ID, + StartDate: startDate, + EndDate: endDate, + Escalation: 1.0, + EscalationCompounded: 1.0, + }, + }) + + service := factory.FetchReServiceByCode(suite.DB(), "MS") + msTaskOrderFee := models.ReTaskOrderFee{ + ContractYearID: contractYear.ID, + ServiceID: service.ID, + PriceCents: 90000, + } + suite.MustSave(&msTaskOrderFee) + + service = factory.FetchReServiceByCode(suite.DB(), "CS") + csTaskOrderFee := models.ReTaskOrderFee{ + ContractYearID: contractYear.ID, + ServiceID: service.ID, + PriceCents: 90000, + } + suite.MustSave(&csTaskOrderFee) + } + + suite.PreloadData(setupPricerData) + + suite.Run("Successfully makes move available to Prime", func() { + mockserviceItemCreator := &mocks.MTOServiceItemCreator{} + queryBuilder := query.NewQueryBuilder() + moveRouter := moverouter.NewMoveRouter() + mtoUpdater := mt.NewMoveTaskOrderUpdater(queryBuilder, mockserviceItemCreator, moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator) + move := factory.BuildMove(suite.DB(), nil, nil) + + result, wasUpdated, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID) + + suite.NoError(err) + suite.NotNil(result) + suite.True(wasUpdated) + suite.NotNil(result.AvailableToPrimeAt) + }) + + suite.Run("Does not update move that is already available to Prime", func() { + mockserviceItemCreator := &mocks.MTOServiceItemCreator{} + queryBuilder := query.NewQueryBuilder() + moveRouter := moverouter.NewMoveRouter() + mtoUpdater := mt.NewMoveTaskOrderUpdater(queryBuilder, mockserviceItemCreator, moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator) + + now := time.Now() + + move := factory.BuildMove(suite.DB(), []factory.Customization{ + { + Model: models.Move{ + AvailableToPrimeAt: &now, + }, + }, + }, nil) + + result, wasUpdated, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), move.ID) + + suite.NoError(err) + suite.NotNil(result) + suite.False(wasUpdated) + suite.WithinDuration(now.UTC(), result.AvailableToPrimeAt.UTC(), time.Second) + }) + + suite.Run("Returns error if move is not found", func() { + mockserviceItemCreator := &mocks.MTOServiceItemCreator{} + queryBuilder := query.NewQueryBuilder() + moveRouter := moverouter.NewMoveRouter() + mtoUpdater := mt.NewMoveTaskOrderUpdater(queryBuilder, mockserviceItemCreator, moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator) + moveID := uuid.Must(uuid.NewV4()) + + _, wasUpdated, err := mtoUpdater.MakeAvailableToPrime(suite.AppContextForTest(), moveID) + + suite.Error(err) + suite.False(wasUpdated) + suite.IsType(apperror.NotFoundError{}, err) + }) +} + func (suite *MoveTaskOrderServiceSuite) TestMoveTaskOrderUpdater_BillableWeightsReviewedAt() { ppmEstimator := &mocks.PPMEstimator{} setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { diff --git a/pkg/services/mto_service_item/mto_service_item_creator.go b/pkg/services/mto_service_item/mto_service_item_creator.go index 6c7da2ec3be..9bc0a9f32a9 100644 --- a/pkg/services/mto_service_item/mto_service_item_creator.go +++ b/pkg/services/mto_service_item/mto_service_item_creator.go @@ -374,7 +374,7 @@ func (o *mtoServiceItemCreator) CreateMTOServiceItem(appCtx appcontext.AppContex err := o.checkDuplicateServiceCodes(appCtx, serviceItem) if err != nil { appCtx.Logger().Error(fmt.Sprintf("Error trying to create a duplicate MS service item for move ID: %s", move.ID), zap.Error(err)) - return nil, nil, err + return &createdServiceItems, nil, nil } } diff --git a/pkg/services/mto_shipment.go b/pkg/services/mto_shipment.go index 187d290cb9f..de48307dfa6 100644 --- a/pkg/services/mto_shipment.go +++ b/pkg/services/mto_shipment.go @@ -49,11 +49,17 @@ type ShipmentDeleter interface { DeleteShipment(appCtx appcontext.AppContext, shipmentID uuid.UUID) (uuid.UUID, error) } +type ShipmentIdWithEtag struct { + ShipmentID uuid.UUID + ETag string +} + // ShipmentApprover is the service object interface for approving a shipment // //go:generate mockery --name ShipmentApprover type ShipmentApprover interface { ApproveShipment(appCtx appcontext.AppContext, shipmentID uuid.UUID, eTag string) (*models.MTOShipment, error) + ApproveShipments(appCtx appcontext.AppContext, shipments []ShipmentIdWithEtag) (*[]models.MTOShipment, error) } // ShipmentDiversionRequester is the service object interface for requesting a shipment diversion diff --git a/pkg/services/mto_shipment/shipment_approver.go b/pkg/services/mto_shipment/shipment_approver.go index b285684a62b..a841b917c6a 100644 --- a/pkg/services/mto_shipment/shipment_approver.go +++ b/pkg/services/mto_shipment/shipment_approver.go @@ -17,19 +17,23 @@ import ( ) type shipmentApprover struct { - router services.ShipmentRouter - siCreator services.MTOServiceItemCreator - planner route.Planner - moveWeights services.MoveWeights + router services.ShipmentRouter + siCreator services.MTOServiceItemCreator + planner route.Planner + moveWeights services.MoveWeights + moveTaskOrderUpdater services.MoveTaskOrderUpdater + moveRouter services.MoveRouter } // NewShipmentApprover creates a new struct with the service dependencies -func NewShipmentApprover(router services.ShipmentRouter, siCreator services.MTOServiceItemCreator, planner route.Planner, moveWeights services.MoveWeights) services.ShipmentApprover { +func NewShipmentApprover(router services.ShipmentRouter, siCreator services.MTOServiceItemCreator, planner route.Planner, moveWeights services.MoveWeights, moveTaskOrderUpdater services.MoveTaskOrderUpdater, moveRouter services.MoveRouter) services.ShipmentApprover { return &shipmentApprover{ router, siCreator, planner, moveWeights, + moveTaskOrderUpdater, + moveRouter, } } @@ -144,6 +148,13 @@ func (f *shipmentApprover) ApproveShipment(appCtx appcontext.AppContext, shipmen return err } + var move models.Move + move.ID = shipment.MoveTaskOrderID + // re-evaluate move status + if _, err = f.moveRouter.ApproveOrRequestApproval(txnAppCtx, move); err != nil { + return err + } + return nil }) @@ -154,6 +165,29 @@ func (f *shipmentApprover) ApproveShipment(appCtx appcontext.AppContext, shipmen return shipment, nil } +// ApproveShipments Approves one or more shipments in one transaction +func (f *shipmentApprover) ApproveShipments(appCtx appcontext.AppContext, shipments []services.ShipmentIdWithEtag) (*[]models.MTOShipment, error) { + var approvedShipments []models.MTOShipment + + transactionError := appCtx.NewTransaction(func(txnAppCtx appcontext.AppContext) error { + for _, shipment := range shipments { + shipmentID := shipment.ShipmentID + eTag := shipment.ETag + + approvedShipment, err := f.ApproveShipment(txnAppCtx, shipmentID, eTag) + if err != nil { + return err + } + + approvedShipments = append(approvedShipments, *approvedShipment) + } + + return nil + }) + + return &approvedShipments, transactionError +} + func (f *shipmentApprover) findShipment(appCtx appcontext.AppContext, shipmentID uuid.UUID) (*models.MTOShipment, error) { shipment, err := FindShipment(appCtx, shipmentID, "MoveTaskOrder", "PickupAddress", "DestinationAddress", "StorageFacility") diff --git a/pkg/services/mto_shipment/shipment_approver_test.go b/pkg/services/mto_shipment/shipment_approver_test.go index 4cccd78af4c..9720dc92b1a 100644 --- a/pkg/services/mto_shipment/shipment_approver_test.go +++ b/pkg/services/mto_shipment/shipment_approver_test.go @@ -19,8 +19,10 @@ import ( "github.com/transcom/mymove/pkg/services" "github.com/transcom/mymove/pkg/services/entitlements" "github.com/transcom/mymove/pkg/services/ghcrateengine" + servicesMocks "github.com/transcom/mymove/pkg/services/mocks" shipmentmocks "github.com/transcom/mymove/pkg/services/mocks" moverouter "github.com/transcom/mymove/pkg/services/move" + mt "github.com/transcom/mymove/pkg/services/move_task_order" mtoserviceitem "github.com/transcom/mymove/pkg/services/mto_service_item" "github.com/transcom/mymove/pkg/services/query" "github.com/transcom/mymove/pkg/testdatagen" @@ -36,6 +38,7 @@ type approveShipmentSubtestData struct { mockedShipmentRouter *shipmentmocks.ShipmentRouter reServiceCodes []models.ReServiceCode moveWeights services.MoveWeights + mtoUpdater services.MoveTaskOrderUpdater } // Creates data for the TestApproveShipment function @@ -81,6 +84,31 @@ func (suite *MTOShipmentServiceSuite) createApproveShipmentSubtestData() (subtes factory.FetchReServiceByCode(suite.DB(), serviceCode) } + setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { + mockCreator := &servicesMocks.SignedCertificationCreator{} + + mockCreator.On( + "CreateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + ).Return(returnValue...) + + return mockCreator + } + + setUpSignedCertificationUpdaterMock := func(returnValue ...interface{}) services.SignedCertificationUpdater { + mockUpdater := &servicesMocks.SignedCertificationUpdater{} + + mockUpdater.On( + "UpdateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + mock.AnythingOfType("string"), + ).Return(returnValue...) + + return mockUpdater + } + subtestData.mockedShipmentRouter = &shipmentmocks.ShipmentRouter{} router := NewShipmentRouter() @@ -96,12 +124,19 @@ func (suite *MTOShipmentServiceSuite) createApproveShipmentSubtestData() (subtes false, false, ).Return(400, nil) + ppmEstimator := &servicesMocks.PPMEstimator{} + queryBuilder := query.NewQueryBuilder() + subtestData.mtoUpdater = mt.NewMoveTaskOrderUpdater( + queryBuilder, + mtoserviceitem.NewMTOServiceItemCreator(planner, queryBuilder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator, + ) siCreator := mtoserviceitem.NewMTOServiceItemCreator(planner, builder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()) subtestData.planner = &mocks.Planner{} subtestData.moveWeights = moverouter.NewMoveWeights(NewShipmentReweighRequester(), waf) - subtestData.shipmentApprover = NewShipmentApprover(router, siCreator, subtestData.planner, subtestData.moveWeights) - subtestData.mockedShipmentApprover = NewShipmentApprover(subtestData.mockedShipmentRouter, siCreator, subtestData.planner, subtestData.moveWeights) + subtestData.shipmentApprover = NewShipmentApprover(router, siCreator, subtestData.planner, subtestData.moveWeights, subtestData.mtoUpdater, moveRouter) + subtestData.mockedShipmentApprover = NewShipmentApprover(subtestData.mockedShipmentRouter, siCreator, subtestData.planner, subtestData.moveWeights, subtestData.mtoUpdater, moveRouter) subtestData.appCtx = suite.AppContextWithSessionForTest(&auth.Session{ ApplicationName: auth.OfficeApp, OfficeUserID: uuid.Must(uuid.NewV4()), @@ -194,6 +229,40 @@ func (suite *MTOShipmentServiceSuite) createApproveShipmentSubtestData() (subtes } func (suite *MTOShipmentServiceSuite) TestApproveShipment() { + setUpSignedCertificationCreatorMock := func(returnValue ...interface{}) services.SignedCertificationCreator { + mockCreator := &servicesMocks.SignedCertificationCreator{} + + mockCreator.On( + "CreateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + ).Return(returnValue...) + + return mockCreator + } + + setUpSignedCertificationUpdaterMock := func(returnValue ...interface{}) services.SignedCertificationUpdater { + mockUpdater := &servicesMocks.SignedCertificationUpdater{} + + mockUpdater.On( + "UpdateSignedCertification", + mock.AnythingOfType("*appcontext.appContext"), + mock.AnythingOfType("models.SignedCertification"), + mock.AnythingOfType("string"), + ).Return(returnValue...) + + return mockUpdater + } + + moveRouter := moverouter.NewMoveRouter() + ppmEstimator := &servicesMocks.PPMEstimator{} + queryBuilder := query.NewQueryBuilder() + planner := &mocks.Planner{} + mtoUpdater := mt.NewMoveTaskOrderUpdater( + queryBuilder, + mtoserviceitem.NewMTOServiceItemCreator(planner, queryBuilder, moveRouter, ghcrateengine.NewDomesticUnpackPricer(), ghcrateengine.NewDomesticPackPricer(), ghcrateengine.NewDomesticLinehaulPricer(), ghcrateengine.NewDomesticShorthaulPricer(), ghcrateengine.NewDomesticOriginPricer(), ghcrateengine.NewDomesticDestinationPricer(), ghcrateengine.NewFuelSurchargePricer()), + moveRouter, setUpSignedCertificationCreatorMock(nil, nil), setUpSignedCertificationUpdaterMock(nil, nil), ppmEstimator, + ) suite.Run("If the international mtoShipment is approved successfully it should create pre approved mtoServiceItems and should NOT update pricing without port data", func() { move := factory.BuildAvailableToPrimeMove(suite.DB(), []factory.Customization{ { @@ -287,7 +356,7 @@ func (suite *MTOShipmentServiceSuite) TestApproveShipment() { ).Return(500, nil) // Approve international shipment - shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights, mtoUpdater, moveRouter) _, err = shipmentApprover.ApproveShipment(appCtx, internationalShipment.ID, internationalShipmentEtag) suite.NoError(err) @@ -373,7 +442,7 @@ func (suite *MTOShipmentServiceSuite) TestApproveShipment() { var moveWeights services.MoveWeights // Approve international shipment - shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights, mtoUpdater, moveRouter) _, err := shipmentApprover.ApproveShipment(suite.AppContextForTest(), internationalShipment.ID, internationalShipmentEtag) suite.NoError(err) @@ -451,7 +520,7 @@ func (suite *MTOShipmentServiceSuite) TestApproveShipment() { var moveWeights services.MoveWeights // Approve international shipment - shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights, mtoUpdater, moveRouter) _, err := shipmentApprover.ApproveShipment(suite.AppContextForTest(), internationalShipment.ID, internationalShipmentEtag) suite.NoError(err) @@ -1032,8 +1101,134 @@ func (suite *MTOShipmentServiceSuite) TestApproveShipment() { var moveWeights services.MoveWeights // Approve international shipment - shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights) + shipmentApprover := NewShipmentApprover(shipmentRouter, serviceItemCreator, planner, moveWeights, mtoUpdater, moveRouter) _, err := shipmentApprover.ApproveShipment(suite.AppContextForTest(), invalidShipment.ID, invalidShipmentEtag) suite.Error(err) }) } + +func (suite *MTOShipmentServiceSuite) TestApproveShipments() { + suite.Run("Successfully approves multiple shipments", func() { + subtestData := suite.createApproveShipmentSubtestData() + shipmentApprover := subtestData.shipmentApprover + + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + + shipment1 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + shipment2 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + eTag1 := etag.GenerateEtag(shipment1.UpdatedAt) + eTag2 := etag.GenerateEtag(shipment2.UpdatedAt) + + shipmentIdWithEtagArr := []services.ShipmentIdWithEtag{ + { + ShipmentID: shipment1.ID, + ETag: eTag1, + }, + { + ShipmentID: shipment2.ID, + ETag: eTag2, + }, + } + approvedShipments, err := shipmentApprover.ApproveShipments(suite.AppContextForTest(), shipmentIdWithEtagArr) + + suite.NoError(err) + suite.NotNil(approvedShipments) + suite.Len(*approvedShipments, 2) + suite.Equal(shipment1.ID, (*approvedShipments)[0].ID) + suite.Equal(shipment2.ID, (*approvedShipments)[1].ID) + }) + + suite.Run("Returns error if one shipment approval fails", func() { + subtestData := suite.createApproveShipmentSubtestData() + shipmentApprover := subtestData.shipmentApprover + + move := factory.BuildAvailableToPrimeMove(suite.DB(), nil, nil) + + shipment1 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + shipment2 := factory.BuildMTOShipment(suite.DB(), []factory.Customization{ + { + Model: move, + LinkOnly: true, + }, + { + Model: models.MTOShipment{ + Status: models.MTOShipmentStatusSubmitted, + }, + }, + }, nil) + + eTag := etag.GenerateEtag(shipment2.UpdatedAt) + + shipmentIdWithEtagArr := []services.ShipmentIdWithEtag{ + { + ShipmentID: shipment1.ID, + ETag: eTag, + }, + { + ShipmentID: shipment2.ID, + ETag: eTag, + }, + } + + approvedShipments, err := shipmentApprover.ApproveShipments(suite.AppContextForTest(), shipmentIdWithEtagArr) + + suite.Error(err) + suite.Len(*approvedShipments, 0) + }) + + suite.Run("Given invalid shipment error returned", func() { + subtestData := suite.createApproveShipmentSubtestData() + shipmentApprover := subtestData.shipmentApprover + invalidShipment := factory.BuildMTOShipment(suite.AppContextForTest().DB(), []factory.Customization{ + { + Model: models.MTOShipment{ + ShipmentType: models.MTOShipmentTypePPM, + }, + }, + }, nil) + invalidShipmentEtag := etag.GenerateEtag(invalidShipment.UpdatedAt) + + shipmentIdWithEtagArr := []services.ShipmentIdWithEtag{ + { + ShipmentID: invalidShipment.ID, + ETag: invalidShipmentEtag, + }, + } + + _, err := shipmentApprover.ApproveShipments(suite.AppContextForTest(), shipmentIdWithEtagArr) + suite.Error(err) + }) +} diff --git a/pkg/testdatagen/scenario/shared.go b/pkg/testdatagen/scenario/shared.go index 451f444ade5..ed5f0858d9c 100644 --- a/pkg/testdatagen/scenario/shared.go +++ b/pkg/testdatagen/scenario/shared.go @@ -4223,11 +4223,15 @@ func createHHGWithOriginSITServiceItems( handlerConfig := handlers.Config{} ppmEstimator := ppmshipment.NewEstimatePPM(handlerConfig.DTODPlanner(), &paymentrequesthelper.RequestPaymentHelper{}) mtoUpdater := movetaskorder.NewMoveTaskOrderUpdater(queryBuilder, serviceItemCreator, moveRouter, signedCertificationCreator, signedCertificationUpdater, ppmEstimator) - _, approveErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) + _, approveErr := mtoUpdater.ApproveMoveAndCreateServiceItems(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) if approveErr != nil { logger.Fatal("Error approving move") } + _, _, primeErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID) + if primeErr != nil { + logger.Fatal("Error making move available to Prime") + } // AvailableToPrimeAt is set to the current time when a move is approved, we need to update it to fall within the // same contract as the rest of the timestamps on our move for pricing to work. @@ -4496,7 +4500,11 @@ func createHHGWithDestinationSITServiceItems(appCtx appcontext.AppContext, prime handlerConfig := handlers.Config{} ppmEstimator := ppmshipment.NewEstimatePPM(handlerConfig.DTODPlanner(), &paymentrequesthelper.RequestPaymentHelper{}) mtoUpdater := movetaskorder.NewMoveTaskOrderUpdater(queryBuilder, serviceItemCreator, moveRouter, signedCertificationCreator, signedCertificationUpdater, ppmEstimator) - _, approveErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) + _, approveErr := mtoUpdater.ApproveMoveAndCreateServiceItems(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) + _, _, primeErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID) + if primeErr != nil { + logger.Fatal("Error making move available to Prime") + } // AvailableToPrimeAt is set to the current time when a move is approved, we need to update it to fall within the // same contract as the rest of the timestamps on our move for pricing to work. @@ -4907,7 +4915,11 @@ func createHHGWithPaymentServiceItems( handlerConfig := handlers.Config{} ppmEstimator := ppmshipment.NewEstimatePPM(handlerConfig.DTODPlanner(), &paymentrequesthelper.RequestPaymentHelper{}) mtoUpdater := movetaskorder.NewMoveTaskOrderUpdater(queryBuilder, serviceItemCreator, moveRouter, signedCertificationCreator, signedCertificationUpdater, ppmEstimator) - _, approveErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) + _, approveErr := mtoUpdater.ApproveMoveAndCreateServiceItems(appCtx, move.ID, etag.GenerateEtag(move.UpdatedAt), true, true) + _, _, primeErr := mtoUpdater.MakeAvailableToPrime(appCtx, move.ID) + if primeErr != nil { + logger.Fatal("Error making move available to Prime") + } // AvailableToPrimeAt is set to the current time when a move is approved, we need to update it to fall within the // same contract as the rest of the timestamps on our move for pricing to work. diff --git a/src/components/Office/RequestedShipments/RequestedShipments.test.jsx b/src/components/Office/RequestedShipments/RequestedShipments.test.jsx index 076edae05ec..ffd550269bf 100644 --- a/src/components/Office/RequestedShipments/RequestedShipments.test.jsx +++ b/src/components/Office/RequestedShipments/RequestedShipments.test.jsx @@ -8,6 +8,7 @@ import { Provider } from 'react-redux'; import { shipments, + shipmentsNoApprovedDate, ntsExternalVendorShipments, ordersInfo, allowancesInfo, @@ -479,6 +480,242 @@ describe('RequestedShipments', () => { expect(counselorRemarks.at(1).textContent).toBe('looks good'); }, ); + + it('calls approveMultipleShipments if move is not available to prime', async () => { + const mockOnSubmit = jest.fn((_, { onSuccess }) => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }).then(async () => { + await onSuccess(); + }); + }); + + const approveMultipleShipments = jest.fn(() => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }); + }); + + const { container } = render( + + + , + ); + + const shipmentInput = container.querySelector('input[name="shipments"]'); + await userEvent.type(shipmentInput, 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee'); + + const shipmentManagementFeeInput = screen.getByRole('checkbox', { name: 'Move management' }); + await userEvent.click(shipmentManagementFeeInput); + + const counselingFeeInput = screen.getByRole('checkbox', { name: 'Counseling' }); + await userEvent.click(counselingFeeInput); + await userEvent.click(screen.getByRole('button', { name: 'Approve selected' })); + + await userEvent.click(screen.getByText('Approve and send')); + + expect(mockOnSubmit).toHaveBeenCalled(); + expect(mockOnSubmit.mock.calls[0]).toEqual([ + { + moveTaskOrderID: moveTaskOrder.id, + ifMatchETag: moveTaskOrder.eTag, + mtoApprovalServiceItemCodes: { + serviceCodeCS: true, + serviceCodeMS: true, + }, + normalize: false, + }, + { + onSuccess: expect.any(Function), + onError: expect.any(Function), + }, + ]); + expect(approveMultipleShipments).toHaveBeenCalled(); + expect(approveMultipleShipments.mock.calls[0]).toEqual([ + { + payload: [ + { + shipmentID: shipments[0].id, + eTag: shipments[0].eTag, + }, + ], + normalize: false, + }, + { + onError: expect.any(Function), + }, + ]); + }); + + it('calls approveMultipleShipments when move is available to prime does NOT have approveDate', async () => { + const mockOnSubmit = jest.fn((_, { onSuccess }) => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }).then(async () => { + await onSuccess(); + }); + }); + + const approveMTOShipment = jest.fn(() => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }); + }); + const approveMultipleShipments = jest.fn(() => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }); + }); + + const { container } = render( + + + , + ); + + const shipmentInput = container.querySelector('input[name="shipments"]'); + await userEvent.type(shipmentInput, 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee'); + + const shipmentManagementFeeInput = screen.getByRole('checkbox', { name: 'Move management' }); + await userEvent.click(shipmentManagementFeeInput); + + const counselingFeeInput = screen.getByRole('checkbox', { name: 'Counseling' }); + await userEvent.click(counselingFeeInput); + await userEvent.click(screen.getByRole('button', { name: 'Approve selected' })); + + await userEvent.click(screen.getByText('Approve and send')); + + expect(mockOnSubmit).toHaveBeenCalled(); + expect(mockOnSubmit.mock.calls[0]).toEqual([ + { + moveTaskOrderID: moveTaskOrder.id, + ifMatchETag: moveTaskOrder.eTag, + mtoApprovalServiceItemCodes: { + serviceCodeCS: true, + serviceCodeMS: false, + }, + normalize: false, + }, + { + onSuccess: expect.any(Function), + onError: expect.any(Function), + }, + ]); + expect(approveMultipleShipments).toHaveBeenCalled(); + expect(approveMultipleShipments.mock.calls[0]).toEqual([ + { + payload: [ + { + shipmentID: shipments[0].id, + eTag: shipments[0].eTag, + }, + ], + normalize: false, + }, + { + onError: expect.any(Function), + }, + ]); + expect(approveMTOShipment).not.toHaveBeenCalled(); + }); + + it('calls approveMTOShipment when move is available to prime and has approveDate', async () => { + const mockOnSubmit = jest.fn((_, { onSuccess }) => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }).then(async () => { + await onSuccess(); + }); + }); + + const approveMTOShipment = jest.fn(() => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }); + }); + const approveMultipleShipments = jest.fn(() => { + return new Promise((resolve) => { + resolve({ response: { status: 200 } }); + }); + }); + + const { container } = render( + + + , + ); + + const shipmentInput = container.querySelector('input[name="shipments"]'); + await userEvent.type(shipmentInput, 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aee'); + + const shipmentManagementFeeInput = screen.getByRole('checkbox', { name: 'Move management' }); + await userEvent.click(shipmentManagementFeeInput); + + const counselingFeeInput = screen.getByRole('checkbox', { name: 'Counseling' }); + await userEvent.click(counselingFeeInput); + await userEvent.click(screen.getByRole('button', { name: 'Approve selected' })); + + await userEvent.click(screen.getByText('Approve and send')); + + expect(mockOnSubmit).toHaveBeenCalled(); + expect(mockOnSubmit.mock.calls[0]).toEqual([ + { + moveTaskOrderID: moveTaskOrder.id, + ifMatchETag: moveTaskOrder.eTag, + mtoApprovalServiceItemCodes: { + serviceCodeCS: true, + serviceCodeMS: false, + }, + normalize: false, + }, + { + onSuccess: expect.any(Function), + onError: expect.any(Function), + }, + ]); + expect(approveMTOShipment).toHaveBeenCalled(); + expect(approveMTOShipment.mock.calls[0]).toEqual([ + { + shipmentID: shipments[0].id, + ifMatchETag: shipments[0].eTag, + operationPath: 'shipment.approveShipmentDiversion', + normalize: false, + }, + { + onError: expect.any(Function), + }, + ]); + expect(approveMultipleShipments).not.toHaveBeenCalled(); + }); }); describe('External vendor shipments', () => { diff --git a/src/components/Office/RequestedShipments/RequestedShipmentsTestData.js b/src/components/Office/RequestedShipments/RequestedShipmentsTestData.js index c9eae8b2667..d3cb9c2a1e8 100644 --- a/src/components/Office/RequestedShipments/RequestedShipmentsTestData.js +++ b/src/components/Office/RequestedShipments/RequestedShipmentsTestData.js @@ -172,6 +172,67 @@ export const shipments = [ }, ]; +export const shipmentsNoApprovedDate = [ + { + createdAt: '2020-06-10T15:58:02.404029Z', + customerRemarks: 'please treat gently', + counselorRemarks: 'looks good', + destinationAddress: { + city: 'Fairfield', + country: 'US', + eTag: 'MjAyMC0wNi0xMFQxNTo1ODowMi4zODk0MTJa', + id: '672ff379-f6e3-48b4-a87d-796713f8f997', + postalCode: '94535', + state: 'CA', + streetAddress1: '987 Any Avenue', + streetAddress2: 'P.O. Box 9876', + streetAddress3: 'c/o Some Person', + }, + eTag: 'MjAyMC0wNi0xMFQxNTo1ODowMi40MDQwMzFa', + id: 'ce01a5b8-9b44-4511-8a8d-edb60f2a4aea', + moveTaskOrderID: '9c7b255c-2981-4bf8-839f-61c7458e2b4d', + pickupAddress: { + city: 'Beverly Hills', + country: 'US', + eTag: 'MjAyMC0wNi0xMFQxNTo1ODowMi4zODQ3Njla', + id: '1686751b-ab36-43cf-b3c9-c0f467d13c19', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + streetAddress3: 'c/o Some Person', + }, + rejectionReason: 'shipment not good enough', + requestedPickupDate: '2018-03-15', + scheduledPickupDate: '2018-03-16', + secondaryDeliveryAddress: { + city: 'Beverly Hills', + country: 'US', + eTag: 'MjAyMC0wNi0xMFQxNTo1ODowMi4zOTkzMlo=', + id: '15e8f6cc-e1d7-44b2-b1e0-fcb3d6442831', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + streetAddress3: 'c/o Some Person', + }, + secondaryPickupAddress: { + city: 'Beverly Hills', + country: 'US', + eTag: 'MjAyMC0wNi0xMFQxNTo1ODowMi4zOTM4OTZa', + id: '9b79e0c3-8ed5-4fb8-aa36-95845707d8ee', + postalCode: '90210', + state: 'CA', + streetAddress1: '123 Any Street', + streetAddress2: 'P.O. Box 12345', + streetAddress3: 'c/o Some Person', + }, + shipmentType: SHIPMENT_OPTIONS.HHG, + status: 'SUBMITTED', + updatedAt: '2020-06-10T15:58:02.404031Z', + }, +]; + export const ntsExternalVendorShipments = [ { approvedDate: '0001-01-01', diff --git a/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx b/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx index 69793103aae..cc3a1ee0b5d 100644 --- a/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx +++ b/src/components/Office/RequestedShipments/SubmittedRequestedShipments.jsx @@ -52,6 +52,7 @@ const SubmittedRequestedShipments = ({ customerInfo, approveMTO, approveMTOShipment, + approveMultipleShipments, handleAfterSuccess, missingRequiredOrdersInfo, errorIfMissing, @@ -149,6 +150,15 @@ const SubmittedRequestedShipments = ({ ); }; + const getUpdateMultipleShipmentPayload = (shipments) => { + return shipments.map((shipment) => { + return { + shipmentID: shipment.id, + eTag: shipment.eTag, + }; + }); + }; + const queryClient = useQueryClient(); const shipmentMutation = useMutation(updateMTOShipment, { onSuccess: (updatedMTOShipments) => { @@ -200,7 +210,9 @@ const SubmittedRequestedShipments = ({ }); try { - await Promise.all(ppmShipmentPromise).then(() => { + await Promise.all(ppmShipmentPromise); + + await new Promise((resolve, reject) => { approveMTO( { moveTaskOrderID: moveTaskOrder.id, @@ -211,38 +223,71 @@ const SubmittedRequestedShipments = ({ { onSuccess: async () => { try { - await Promise.all( - filteredShipments.map((shipment) => { - let operationPath = 'shipment.approveShipment'; - - if (shipment.approvedDate && moveTaskOrder.availableToPrimeAt) { - operationPath = 'shipment.approveShipmentDiversion'; - } - return approveMTOShipment( - { - shipmentID: shipment.id, - operationPath, - ifMatchETag: shipment.eTag, - normalize: false, + // if the move is not available to prime yet, we use the new approveShipments api + // to approve multiple shipments in one call and make it available to prime at the end. + // else we use the old looping method to account for approveShipmentDiversion api call. + if (!moveTaskOrder.availableToPrimeAt) { + await approveMultipleShipments( + { + payload: getUpdateMultipleShipmentPayload(filteredShipments), + normalize: false, + }, + { + onError: () => { + setSubmitting(false); + setFlashMessage(null); }, - { - onError: () => { - setSubmitting(false); - setFlashMessage(null); + }, + ); + } else { + // Approve each shipment asynchronously + await Promise.all( + filteredShipments.map((shipment) => { + if (shipment.approvedDate) { + return approveMTOShipment( + { + shipmentID: shipment.id, + operationPath: 'shipment.approveShipmentDiversion', + ifMatchETag: shipment.eTag, + normalize: false, + }, + { + onError: () => { + setSubmitting(false); + setFlashMessage(null); + reject(); + }, + }, + ); + } + return approveMultipleShipments( + { + payload: getUpdateMultipleShipmentPayload([shipment]), + normalize: false, }, - }, - ); - }), - ).then(() => { - setFlashMessage('TASK_ORDER_CREATE_SUCCESS', 'success', 'Task order created successfully.'); - handleAfterSuccess('../mto', { showMTOpostedMessage: true }); - }); + { + onError: () => { + setSubmitting(false); + setFlashMessage(null); + reject(); + }, + }, + ); + }), + ); + } + // All shipments approved, set flash message and navigate + setFlashMessage('TASK_ORDER_CREATE_SUCCESS', 'success', 'Task order created successfully.'); + handleAfterSuccess('../mto', { showMTOpostedMessage: true }); + resolve(); } catch { setSubmitting(false); + reject(); } }, onError: () => { setSubmitting(false); + reject(); }, }, ); @@ -311,6 +356,7 @@ const SubmittedRequestedShipments = ({ onSubmit={debouncedSubmit} counselingFee={formik.values.counselingFee} shipmentManagementFee={formik.values.shipmentManagementFee} + isSubmitting={formik.isSubmitting} />
diff --git a/src/components/Office/ShipmentApprovalPreview/ShipmentApprovalPreview.jsx b/src/components/Office/ShipmentApprovalPreview/ShipmentApprovalPreview.jsx index 200feb4991a..5aa4288ac9d 100644 --- a/src/components/Office/ShipmentApprovalPreview/ShipmentApprovalPreview.jsx +++ b/src/components/Office/ShipmentApprovalPreview/ShipmentApprovalPreview.jsx @@ -26,6 +26,7 @@ const ShipmentApprovalPreview = ({ onSubmit, counselingFee, shipmentManagementFee, + isSubmitting, }) => { return (
@@ -47,7 +48,7 @@ const ShipmentApprovalPreview = ({

Preview and post move task order

Is all the information shown correct and ready to send to Global Relocation Services?

-
+
+
Admin Restricted Weight:
+
+ {moveTaskOrder.order.entitlement.weightRestriction > 0 + ? formatWeight(moveTaskOrder.order.entitlement.weightRestriction) + : 'no'} +
+